fix(mobile): restore agent invocation target_type "team" enum value

AgentInvocationTarget.target_type's "team" is an unrelated, inert
placeholder from migration 130 (agent_invocation_permission) —
"reserved for the future team concept... NOT effective in V1" — not
the workspace Team entity this branch renamed to Space. The server's
CHECK constraint, Go constant, and packages/core/types/agent.ts all
still say "team"; only apps/mobile/data/schemas.ts had been swept to
"space" by mistake (most likely an overzealous find/replace during the
Team→Space rename), which desynced it from the server and broke
mobile's typecheck. Revert schemas.ts and its test back to "team" to
match the real server contract.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing
2026-07-08 19:00:07 +08:00
parent 05ad0d292f
commit 7ad6591c05
2 changed files with 2 additions and 2 deletions

View File

@@ -551,7 +551,7 @@ export const EMPTY_MEMBER_LIST: MemberWithUser[] = [];
const AgentInvocationTargetSchema: z.ZodType<AgentInvocationTarget> = z
.object({
target_type: z.enum(["workspace", "member", "space"]).catch("space"),
target_type: z.enum(["workspace", "member", "team"]).catch("team"),
target_id: z
.string()
.nullable()

View File

@@ -35,7 +35,7 @@ describe("AgentSchema invocation permissions", () => {
expect(parsed.permission_mode).toBe("private");
expect(parsed.invocation_targets).toEqual([
{ target_type: "space", target_id: null },
{ target_type: "team", target_id: null },
]);
});
});