@opengeni/contracts 2.5.0-canary.2 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/personal-github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\n\nexport const PERSONAL_GITHUB_PROVIDER_DOMAIN = \"github.com\" as const;\nexport const PERSONAL_GITHUB_PROVIDER_FAMILY = \"github\" as const;\nexport const PERSONAL_GITHUB_CREDENTIAL_ROLE = \"opengeni_github_personal\" as const;\nexport const PERSONAL_GITHUB_CONNECTION_SURFACE_ID = \"github:personal\" as const;\nexport const PERSONAL_GITHUB_REQUESTED_SCOPES = [\"repo\"] as const;\nexport const PERSONAL_GITHUB_AUTHORIZATION_URL =\n \"https://github.com/login/oauth/authorize\" as const;\nexport const PERSONAL_GITHUB_TOKEN_URL = \"https://github.com/login/oauth/access_token\" as const;\nexport const PERSONAL_GITHUB_USER_URL = \"https://api.github.com/user\" as const;\nexport const PERSONAL_GITHUB_API_ORIGIN = \"https://api.github.com\" as const;\nexport const PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX = 100 as const;\n\nexport const PersonalGitHubRepositoryId = z.string().regex(/^[1-9]\\d*$/u);\nexport type PersonalGitHubRepositoryId = z.infer<typeof PersonalGitHubRepositoryId>;\n\nexport const PersonalGitHubRepositoryAccess = z.enum([\"read\", \"write\"]);\nexport type PersonalGitHubRepositoryAccess = z.infer<typeof PersonalGitHubRepositoryAccess>;\n\nexport const PersonalGitHubRepositoryPermissions = z\n .object({\n pull: z.boolean(),\n push: z.boolean(),\n admin: z.boolean(),\n maintain: z.boolean(),\n triage: z.boolean(),\n })\n .strict();\nexport type PersonalGitHubRepositoryPermissions = z.infer<\n typeof PersonalGitHubRepositoryPermissions\n>;\n\nexport const PersonalGitHubRepositoryVisibility = z.enum([\"public\", \"private\", \"internal\"]);\nexport type PersonalGitHubRepositoryVisibility = z.infer<typeof PersonalGitHubRepositoryVisibility>;\n\nconst PersonalGitHubRepositoryFullName = z\n .string()\n .min(3)\n .max(140)\n .regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\\/[A-Za-z0-9_.-]{1,100}$/u);\n\nexport function canonicalPersonalGitHubRepositoryUrl(fullName: string): string {\n return `https://github.com/${fullName}`;\n}\n\n/** A bounded, credential-free projection verified directly against GitHub. */\nexport const PersonalGitHubRepository = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n canonicalUrl: z.string().url().max(512),\n defaultBranch: z.string().min(1).max(255),\n visibility: PersonalGitHubRepositoryVisibility,\n private: z.boolean(),\n archived: z.boolean(),\n disabled: z.boolean(),\n permissions: PersonalGitHubRepositoryPermissions,\n })\n .strict()\n .superRefine((repository, context) => {\n if (repository.canonicalUrl !== canonicalPersonalGitHubRepositoryUrl(repository.fullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"canonicalUrl\"],\n message: \"canonicalUrl must be derived from fullName\",\n });\n }\n if (repository.private !== (repository.visibility === \"private\")) {\n context.addIssue({\n code: \"custom\",\n path: [\"private\"],\n message: \"private must agree with visibility\",\n });\n }\n });\nexport type PersonalGitHubRepository = z.infer<typeof PersonalGitHubRepository>;\n\nexport const PersonalGitHubSelectedRepository = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess,\n selectionGeneration: z.number().int().positive(),\n selectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n}).strict();\nexport type PersonalGitHubSelectedRepository = z.infer<typeof PersonalGitHubSelectedRepository>;\n\nexport const PersonalGitHubRepositorySelectionState = z\n .object({\n connectionAuthorityGeneration: z.number().int().positive(),\n credentialBindingId: z.string().uuid(),\n providerPrincipalId: PersonalGitHubRepositoryId,\n selectionGeneration: z.number().int().nonnegative(),\n repositories: z\n .array(PersonalGitHubSelectedRepository)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionState = z.infer<\n typeof PersonalGitHubRepositorySelectionState\n>;\n\nexport const ListPersonalGitHubRepositoriesQuery = z\n .object({\n cursor: z.coerce.number().int().positive().max(10_000).default(1),\n limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50),\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesQuery = z.infer<\n typeof ListPersonalGitHubRepositoriesQuery\n>;\n\nexport const PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess.nullable(),\n}).strict();\nexport type PersonalGitHubRepositoryCatalogItem = z.infer<\n typeof PersonalGitHubRepositoryCatalogItem\n>;\n\nexport const ListPersonalGitHubRepositoriesResponse = z\n .object({\n repositories: z\n .array(PersonalGitHubRepositoryCatalogItem)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n nextCursor: z.number().int().positive().nullable(),\n selection: PersonalGitHubRepositorySelectionState,\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesResponse = z.infer<\n typeof ListPersonalGitHubRepositoriesResponse\n>;\n\nexport const PersonalGitHubRepositorySelectionInput = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n access: PersonalGitHubRepositoryAccess,\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionInput = z.infer<\n typeof PersonalGitHubRepositorySelectionInput\n>;\n\nexport const ReplacePersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n repositories: z\n .array(PersonalGitHubRepositorySelectionInput)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict()\n .superRefine((request, context) => {\n const repositoryIds = new Set<string>();\n const fullNames = new Set<string>();\n request.repositories.forEach((repository, index) => {\n const normalizedFullName = repository.fullName.toLowerCase();\n if (repositoryIds.has(repository.repositoryId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"repositoryId\"],\n message: \"repositoryId must be unique\",\n });\n }\n if (fullNames.has(normalizedFullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"fullName\"],\n message: \"fullName must be unique\",\n });\n }\n repositoryIds.add(repository.repositoryId);\n fullNames.add(normalizedFullName);\n });\n });\nexport type ReplacePersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof ReplacePersonalGitHubRepositorySelectionsRequest\n>;\n\nexport const VerifyPersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type VerifyPersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof VerifyPersonalGitHubRepositorySelectionsRequest\n>;\n\n/**\n * Owner-visible, credential-free metadata for one dedicated personal GitHub\n * OAuth connection. Repository selections are a separate authority and never\n * live in this credential record.\n */\nexport const PersonalGitHubConnectionMetadata = z\n .object({\n credentialRole: z.literal(PERSONAL_GITHUB_CREDENTIAL_ROLE),\n providerFamily: z.literal(PERSONAL_GITHUB_PROVIDER_FAMILY),\n providerPrincipalId: z.string().regex(/^\\d+$/u),\n githubUserId: z.string().regex(/^\\d+$/u),\n githubLogin: z.string().min(1).max(100),\n oauthEnvironment: z.string().min(1).max(128),\n oauthClientMarker: z.string().regex(/^[a-f0-9]{32}$/u),\n credentialBindingId: z.string().uuid(),\n connectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n disconnectedAt: z.string().datetime({ offset: true }).nullable().optional(),\n refreshTokenExpiresAt: z.string().datetime({ offset: true }).nullable().optional(),\n })\n .passthrough();\nexport type PersonalGitHubConnectionMetadata = z.infer<typeof PersonalGitHubConnectionMetadata>;\n\nexport const PersonalGitHubOAuthStartRequest = z\n .object({\n /** Existing exact connection generation to re-authorize in place. */\n connectionId: z.string().uuid().optional(),\n /** Same-workspace UI path restored after the callback. */\n returnPath: z.string().min(1).max(2048).optional(),\n })\n .strict();\nexport type PersonalGitHubOAuthStartRequest = z.infer<typeof PersonalGitHubOAuthStartRequest>;\n\nexport const PersonalGitHubOAuthStartResponse = z\n .object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n })\n .strict();\nexport type PersonalGitHubOAuthStartResponse = z.infer<typeof PersonalGitHubOAuthStartResponse>;\n\nexport const PersonalGitHubConnectionStatusResponse = z\n .object({\n enabled: z.boolean(),\n connection: ConnectionMetadata.nullable(),\n reviewUrl: z.string().url().nullable(),\n })\n .strict();\nexport type PersonalGitHubConnectionStatusResponse = z.infer<\n typeof PersonalGitHubConnectionStatusResponse\n>;\n\nexport const PersonalGitHubDisconnectRequest = z\n .object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type PersonalGitHubDisconnectRequest = z.infer<typeof PersonalGitHubDisconnectRequest>;\n\nexport function isPersonalGitHubConnection(\n connection: Pick<z.infer<typeof ConnectionMetadata>, \"providerDomain\" | \"kind\" | \"metadata\">,\n): boolean {\n return (\n connection.providerDomain.toLowerCase() === PERSONAL_GITHUB_PROVIDER_DOMAIN &&\n connection.kind === \"oauth2\" &&\n PersonalGitHubConnectionMetadata.safeParse(connection.metadata).success\n );\n}\n\nexport function hasReservedPersonalGitHubMetadata(\n metadata: Record<string, unknown> | undefined,\n): boolean {\n return metadata?.credentialRole === PERSONAL_GITHUB_CREDENTIAL_ROLE;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAIX,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,wCAAwC;AAC9C,IAAM,mCAAmC,CAAC,MAA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,SAAS,EAAE,QAAQ;AAAA,EACnB,YAAY,mBAAmB,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACvC,CAAC,EACA,OAAO;AAKH,IAAM,kCAAkC,EAC5C,OAAO;AAAA,EACN,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC3C,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAClD,CAAC,EACA,OAAO;AAGH,SAAS,2BACd,YACS;AACT,SACE,WAAW,eAAe,YAAY,MAAM,mCAC5C,WAAW,SAAS,YACpB,iCAAiC,UAAU,WAAW,QAAQ,EAAE;AAEpE;AAEO,SAAS,kCACd,UACS;AACT,SAAO,UAAU,mBAAmB;AACtC;","names":[]}
1
+ {"version":3,"sources":["../src/personal-github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\n\nexport const PERSONAL_GITHUB_PROVIDER_DOMAIN = \"github.com\" as const;\nexport const PERSONAL_GITHUB_PROVIDER_FAMILY = \"github\" as const;\nexport const PERSONAL_GITHUB_CREDENTIAL_ROLE = \"opengeni_github_personal\" as const;\nexport const PERSONAL_GITHUB_CONNECTION_SURFACE_ID = \"github:personal\" as const;\nexport const PERSONAL_GITHUB_REQUESTED_SCOPES = [\"repo\"] as const;\nexport const PERSONAL_GITHUB_AUTHORIZATION_URL =\n \"https://github.com/login/oauth/authorize\" as const;\nexport const PERSONAL_GITHUB_TOKEN_URL = \"https://github.com/login/oauth/access_token\" as const;\nexport const PERSONAL_GITHUB_USER_URL = \"https://api.github.com/user\" as const;\nexport const PERSONAL_GITHUB_API_ORIGIN = \"https://api.github.com\" as const;\nexport const PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX = 100 as const;\n\nexport const PersonalGitHubRepositoryId = z.string().regex(/^[1-9]\\d*$/u);\nexport type PersonalGitHubRepositoryId = z.infer<typeof PersonalGitHubRepositoryId>;\n\nexport const PersonalGitHubRepositoryAccess = z.enum([\"read\", \"write\"]);\nexport type PersonalGitHubRepositoryAccess = z.infer<typeof PersonalGitHubRepositoryAccess>;\n\nexport const PersonalGitHubRepositoryPermissions = z\n .object({\n pull: z.boolean(),\n push: z.boolean(),\n admin: z.boolean(),\n maintain: z.boolean(),\n triage: z.boolean(),\n })\n .strict();\nexport type PersonalGitHubRepositoryPermissions = z.infer<\n typeof PersonalGitHubRepositoryPermissions\n>;\n\nexport const PersonalGitHubRepositoryVisibility = z.enum([\"public\", \"private\", \"internal\"]);\nexport type PersonalGitHubRepositoryVisibility = z.infer<typeof PersonalGitHubRepositoryVisibility>;\n\nconst PersonalGitHubRepositoryFullName = z\n .string()\n .min(3)\n .max(140)\n .regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\\/[A-Za-z0-9_.-]{1,100}$/u);\n\nexport function canonicalPersonalGitHubRepositoryUrl(fullName: string): string {\n return `https://github.com/${fullName}`;\n}\n\n/** A bounded, credential-free projection verified directly against GitHub. */\nexport const PersonalGitHubRepository = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n canonicalUrl: z.string().url().max(512),\n defaultBranch: z.string().min(1).max(255),\n visibility: PersonalGitHubRepositoryVisibility,\n private: z.boolean(),\n archived: z.boolean(),\n disabled: z.boolean(),\n permissions: PersonalGitHubRepositoryPermissions,\n })\n .strict()\n .superRefine((repository, context) => {\n if (repository.canonicalUrl !== canonicalPersonalGitHubRepositoryUrl(repository.fullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"canonicalUrl\"],\n message: \"canonicalUrl must be derived from fullName\",\n });\n }\n if (repository.private !== (repository.visibility === \"private\")) {\n context.addIssue({\n code: \"custom\",\n path: [\"private\"],\n message: \"private must agree with visibility\",\n });\n }\n });\nexport type PersonalGitHubRepository = z.infer<typeof PersonalGitHubRepository>;\n\nexport const PersonalGitHubSelectedRepository = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess,\n selectionGeneration: z.number().int().positive(),\n selectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n}).strict();\nexport type PersonalGitHubSelectedRepository = z.infer<typeof PersonalGitHubSelectedRepository>;\n\nexport const PersonalGitHubRepositorySelectionState = z\n .object({\n connectionAuthorityGeneration: z.number().int().positive(),\n credentialBindingId: z.string().uuid(),\n providerPrincipalId: PersonalGitHubRepositoryId,\n selectionGeneration: z.number().int().nonnegative(),\n repositories: z\n .array(PersonalGitHubSelectedRepository)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionState = z.infer<\n typeof PersonalGitHubRepositorySelectionState\n>;\n\nexport const ListPersonalGitHubRepositoriesQuery = z\n .object({\n cursor: z.coerce.number().int().positive().max(10_000).default(1),\n limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50),\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesQuery = z.infer<\n typeof ListPersonalGitHubRepositoriesQuery\n>;\n\nexport const PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess.nullable(),\n}).strict();\nexport type PersonalGitHubRepositoryCatalogItem = z.infer<\n typeof PersonalGitHubRepositoryCatalogItem\n>;\n\nexport const ListPersonalGitHubRepositoriesResponse = z\n .object({\n repositories: z\n .array(PersonalGitHubRepositoryCatalogItem)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n nextCursor: z.number().int().positive().nullable(),\n selection: PersonalGitHubRepositorySelectionState,\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesResponse = z.infer<\n typeof ListPersonalGitHubRepositoriesResponse\n>;\n\nexport const PersonalGitHubRepositorySelectionInput = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n access: PersonalGitHubRepositoryAccess,\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionInput = z.infer<\n typeof PersonalGitHubRepositorySelectionInput\n>;\n\nexport const ReplacePersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n repositories: z\n .array(PersonalGitHubRepositorySelectionInput)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict()\n .superRefine((request, context) => {\n const repositoryIds = new Set<string>();\n const fullNames = new Set<string>();\n request.repositories.forEach((repository, index) => {\n const normalizedFullName = repository.fullName.toLowerCase();\n if (repositoryIds.has(repository.repositoryId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"repositoryId\"],\n message: \"repositoryId must be unique\",\n });\n }\n if (fullNames.has(normalizedFullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"fullName\"],\n message: \"fullName must be unique\",\n });\n }\n repositoryIds.add(repository.repositoryId);\n fullNames.add(normalizedFullName);\n });\n });\nexport type ReplacePersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof ReplacePersonalGitHubRepositorySelectionsRequest\n>;\n\nexport const VerifyPersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type VerifyPersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof VerifyPersonalGitHubRepositorySelectionsRequest\n>;\n\n/**\n * Owner-visible, credential-free metadata for one dedicated personal GitHub\n * OAuth connection. Repository selections are a separate authority and never\n * live in this credential record.\n */\nexport const PersonalGitHubConnectionMetadata = z\n .object({\n credentialRole: z.literal(PERSONAL_GITHUB_CREDENTIAL_ROLE),\n providerFamily: z.literal(PERSONAL_GITHUB_PROVIDER_FAMILY),\n providerPrincipalId: z.string().regex(/^\\d+$/u),\n githubUserId: z.string().regex(/^\\d+$/u),\n githubLogin: z.string().min(1).max(100),\n oauthEnvironment: z.string().min(1).max(128),\n oauthClientMarker: z.string().regex(/^[a-f0-9]{32}$/u),\n credentialBindingId: z.string().uuid(),\n connectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n disconnectedAt: z.string().datetime({ offset: true }).nullable().optional(),\n refreshTokenExpiresAt: z.string().datetime({ offset: true }).nullable().optional(),\n })\n .passthrough();\nexport type PersonalGitHubConnectionMetadata = z.infer<typeof PersonalGitHubConnectionMetadata>;\n\nexport const PersonalGitHubOAuthStartRequest = z\n .object({\n /** Existing exact connection generation to re-authorize in place. */\n connectionId: z.string().uuid().optional(),\n /** Same-workspace UI path restored after the callback. */\n returnPath: z.string().min(1).max(2048).optional(),\n })\n .strict();\nexport type PersonalGitHubOAuthStartRequest = z.infer<typeof PersonalGitHubOAuthStartRequest>;\n\nexport const PersonalGitHubOAuthStartResponse = z\n .object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n })\n .strict();\nexport type PersonalGitHubOAuthStartResponse = z.infer<typeof PersonalGitHubOAuthStartResponse>;\n\nexport const PersonalGitHubConnectionStatusResponse = z\n .object({\n enabled: z.boolean(),\n connection: ConnectionMetadata.nullable(),\n reviewUrl: z.string().url().nullable(),\n })\n .strict();\nexport type PersonalGitHubConnectionStatusResponse = z.infer<\n typeof PersonalGitHubConnectionStatusResponse\n>;\n\nexport const PersonalGitHubDisconnectRequest = z\n .object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type PersonalGitHubDisconnectRequest = z.infer<typeof PersonalGitHubDisconnectRequest>;\n\nexport function isPersonalGitHubConnection(\n connection: Pick<z.infer<typeof ConnectionMetadata>, \"providerDomain\" | \"kind\" | \"metadata\">,\n): boolean {\n return (\n connection.providerDomain.toLowerCase() === PERSONAL_GITHUB_PROVIDER_DOMAIN &&\n connection.kind === \"oauth2\" &&\n PersonalGitHubConnectionMetadata.safeParse(connection.metadata).success\n );\n}\n\nexport function hasReservedPersonalGitHubMetadata(\n metadata: Record<string, unknown> | undefined,\n): boolean {\n return metadata?.credentialRole === PERSONAL_GITHUB_CREDENTIAL_ROLE;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAIX,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,wCAAwC;AAC9C,IAAM,mCAAmC,CAAC,MAAM;AAChD,IAAM,oCACX;AACK,IAAM,4BAA4B;AAClC,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,yCAAyC;AAE/C,IAAM,6BAA6B,EAAE,OAAO,EAAE,MAAM,aAAa;AAGjE,IAAM,iCAAiC,EAAE,KAAK,CAAC,QAAQ,OAAO,CAAC;AAG/D,IAAM,sCAAsC,EAChD,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ;AAAA,EAChB,MAAM,EAAE,QAAQ;AAAA,EAChB,OAAO,EAAE,QAAQ;AAAA,EACjB,UAAU,EAAE,QAAQ;AAAA,EACpB,QAAQ,EAAE,QAAQ;AACpB,CAAC,EACA,OAAO;AAKH,IAAM,qCAAqC,EAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAC;AAG1F,IAAM,mCAAmC,EACtC,OAAO,EACP,IAAI,CAAC,EACL,IAAI,GAAG,EACP,MAAM,6DAA6D;AAE/D,SAAS,qCAAqC,UAA0B;AAC7E,SAAO,sBAAsB,QAAQ;AACvC;AAGO,IAAM,2BAA2B,EACrC,OAAO;AAAA,EACN,cAAc;AAAA,EACd,UAAU;AAAA,EACV,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG;AAAA,EACtC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACxC,YAAY;AAAA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O;AAAA;AAAA,EAEN,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA;AAAA,EAEzC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,EAAE,SAAS;AACnD,CAAC,EACA,OAAO;AAGH,IAAM,mCAAmC,EAC7C,OAAO;AAAA,EACN,kBAAkB,EAAE,OAAO,EAAE,IAAI;AAAA,EACjC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,KAAK,CAAC;AACjD,CAAC,EACA,OAAO;AAGH,IAAM,yCAAyC,EACnD,OAAO;AAAA,EACN,SAAS,EAAE,QAAQ;AAAA,EACnB,YAAY,mBAAmB,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACvC,CAAC,EACA,OAAO;AAKH,IAAM,kCAAkC,EAC5C,OAAO;AAAA,EACN,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC3C,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAClD,CAAC,EACA,OAAO;AAGH,SAAS,2BACd,YACS;AACT,SACE,WAAW,eAAe,YAAY,MAAM,mCAC5C,WAAW,SAAS,YACpB,iCAAiC,UAAU,WAAW,QAAQ,EAAE;AAEpE;AAEO,SAAS,kCACd,UACS;AACT,SAAO,UAAU,mBAAmB;AACtC;","names":[]}
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ export declare const SessionStatus: z.ZodEnum<{
3
+ cancelled: "cancelled";
4
+ failed: "failed";
5
+ idle: "idle";
6
+ queued: "queued";
7
+ recovering: "recovering";
8
+ requires_action: "requires_action";
9
+ running: "running";
10
+ waiting_capacity: "waiting_capacity";
11
+ }>;
12
+ export type SessionStatus = z.infer<typeof SessionStatus>;
13
+ export declare const SessionGoalStatus: z.ZodEnum<{
14
+ active: "active";
15
+ completed: "completed";
16
+ paused: "paused";
17
+ }>;
18
+ export type SessionGoalStatus = z.infer<typeof SessionGoalStatus>;
19
+ /** Physical ceiling of the PostgreSQL integer columns that persist depth policy. */
20
+ export declare const MAX_NESTED_AGENT_DEPTH = 2147483647;
21
+ export declare const NestedAgentDepthValue: z.ZodNumber;
22
+ export type NestedAgentDepthValue = z.infer<typeof NestedAgentDepthValue>;
@@ -0,0 +1,411 @@
1
+ import { z } from "zod";
2
+ export declare const WORK_CLAIM_NAMESPACE_MAX_BYTES = 64;
3
+ export declare const WORK_CLAIM_CANONICAL_KEY_MAX_BYTES = 512;
4
+ export declare const WORK_CLAIM_DISPLAY_LABEL_MAX_BYTES = 256;
5
+ export declare const WORK_CLAIM_VERSION_VALUE_MAX_BYTES = 256;
6
+ export declare const WORK_CLAIM_ACTIVE_SESSION_CAP = 64;
7
+ export declare const WORK_CLAIM_DISCOVERY_LIMIT = 8;
8
+ export declare const WORK_CLAIM_DISCOVERY_DEFAULT_LIMIT = 4;
9
+ export declare const WORK_DISCOVERY_QUERY_MAX_CHARS = 200;
10
+ export declare const WORK_DISCOVERY_RECENT_HOURS_MAX: number;
11
+ export declare function normalizeWorkClaimNamespace(value: string): string;
12
+ export declare function normalizeWorkClaimCanonicalKey(value: string): string;
13
+ export declare function normalizeWorkClaimDisplayLabel(value: string): string | null;
14
+ export declare const WorkClaimNamespace: z.ZodString;
15
+ export type WorkClaimNamespace = z.infer<typeof WorkClaimNamespace>;
16
+ export declare const WorkClaimCanonicalKey: z.ZodString;
17
+ export type WorkClaimCanonicalKey = z.infer<typeof WorkClaimCanonicalKey>;
18
+ export declare const WorkClaimDisplayLabel: z.ZodString;
19
+ export type WorkClaimDisplayLabel = z.infer<typeof WorkClaimDisplayLabel>;
20
+ export declare const WorkClaimSubjectType: z.ZodEnum<{
21
+ artifact: "artifact";
22
+ branch: "branch";
23
+ ci_run: "ci_run";
24
+ issue: "issue";
25
+ other: "other";
26
+ pull_request: "pull_request";
27
+ release: "release";
28
+ repository: "repository";
29
+ }>;
30
+ export type WorkClaimSubjectType = z.infer<typeof WorkClaimSubjectType>;
31
+ export declare const WorkClaimRole: z.ZodEnum<{
32
+ delivering: "delivering";
33
+ monitoring: "monitoring";
34
+ reviewing: "reviewing";
35
+ working: "working";
36
+ }>;
37
+ export type WorkClaimRole = z.infer<typeof WorkClaimRole>;
38
+ export declare const WorkClaimState: z.ZodEnum<{
39
+ active: "active";
40
+ released: "released";
41
+ stale: "stale";
42
+ superseded: "superseded";
43
+ }>;
44
+ export type WorkClaimState = z.infer<typeof WorkClaimState>;
45
+ export declare const WorkClaimProvenance: z.ZodEnum<{
46
+ explicit_agent: "explicit_agent";
47
+ session_resource: "session_resource";
48
+ system_lifecycle: "system_lifecycle";
49
+ trusted_integration: "trusted_integration";
50
+ user_api: "user_api";
51
+ }>;
52
+ export type WorkClaimProvenance = z.infer<typeof WorkClaimProvenance>;
53
+ export declare const WorkClaimVersionKind: z.ZodEnum<{
54
+ artifact_version: "artifact_version";
55
+ branch_head: "branch_head";
56
+ ci_run: "ci_run";
57
+ git_commit: "git_commit";
58
+ other: "other";
59
+ pull_request_head: "pull_request_head";
60
+ release_version: "release_version";
61
+ }>;
62
+ export type WorkClaimVersionKind = z.infer<typeof WorkClaimVersionKind>;
63
+ export declare const WorkClaimVersionValue: z.ZodString;
64
+ export type WorkClaimVersionValue = z.infer<typeof WorkClaimVersionValue>;
65
+ export declare const WorkClaimReleaseReason: z.ZodEnum<{
66
+ cancelled: "cancelled";
67
+ completed: "completed";
68
+ corrected: "corrected";
69
+ external_state_changed: "external_state_changed";
70
+ failed: "failed";
71
+ no_longer_active: "no_longer_active";
72
+ other: "other";
73
+ superseded: "superseded";
74
+ }>;
75
+ export type WorkClaimReleaseReason = z.infer<typeof WorkClaimReleaseReason>;
76
+ export declare const WorkClaimMutationKind: z.ZodEnum<{
77
+ created: "created";
78
+ released: "released";
79
+ stale: "stale";
80
+ superseded: "superseded";
81
+ updated: "updated";
82
+ }>;
83
+ export type WorkClaimMutationKind = z.infer<typeof WorkClaimMutationKind>;
84
+ export declare const WorkClaim: z.ZodObject<{
85
+ id: z.ZodString;
86
+ sessionId: z.ZodString;
87
+ rootSessionId: z.ZodString;
88
+ subject: z.ZodObject<{
89
+ namespace: z.ZodString;
90
+ type: z.ZodEnum<{
91
+ artifact: "artifact";
92
+ branch: "branch";
93
+ ci_run: "ci_run";
94
+ issue: "issue";
95
+ other: "other";
96
+ pull_request: "pull_request";
97
+ release: "release";
98
+ repository: "repository";
99
+ }>;
100
+ canonicalKey: z.ZodString;
101
+ displayLabel: z.ZodNullable<z.ZodString>;
102
+ }, z.core.$strip>;
103
+ role: z.ZodEnum<{
104
+ delivering: "delivering";
105
+ monitoring: "monitoring";
106
+ reviewing: "reviewing";
107
+ working: "working";
108
+ }>;
109
+ state: z.ZodEnum<{
110
+ active: "active";
111
+ released: "released";
112
+ stale: "stale";
113
+ superseded: "superseded";
114
+ }>;
115
+ revision: z.ZodNumber;
116
+ provenance: z.ZodEnum<{
117
+ explicit_agent: "explicit_agent";
118
+ session_resource: "session_resource";
119
+ system_lifecycle: "system_lifecycle";
120
+ trusted_integration: "trusted_integration";
121
+ user_api: "user_api";
122
+ }>;
123
+ version: z.ZodNullable<z.ZodObject<{
124
+ kind: z.ZodEnum<{
125
+ artifact_version: "artifact_version";
126
+ branch_head: "branch_head";
127
+ ci_run: "ci_run";
128
+ git_commit: "git_commit";
129
+ other: "other";
130
+ pull_request_head: "pull_request_head";
131
+ release_version: "release_version";
132
+ }>;
133
+ value: z.ZodString;
134
+ }, z.core.$strip>>;
135
+ observedAt: z.ZodString;
136
+ createdAt: z.ZodString;
137
+ updatedAt: z.ZodString;
138
+ settledAt: z.ZodNullable<z.ZodString>;
139
+ }, z.core.$strip>;
140
+ export type WorkClaim = z.infer<typeof WorkClaim>;
141
+ export declare const WorkClaimMutationResult: z.ZodObject<{
142
+ claim: z.ZodObject<{
143
+ id: z.ZodString;
144
+ sessionId: z.ZodString;
145
+ rootSessionId: z.ZodString;
146
+ subject: z.ZodObject<{
147
+ namespace: z.ZodString;
148
+ type: z.ZodEnum<{
149
+ artifact: "artifact";
150
+ branch: "branch";
151
+ ci_run: "ci_run";
152
+ issue: "issue";
153
+ other: "other";
154
+ pull_request: "pull_request";
155
+ release: "release";
156
+ repository: "repository";
157
+ }>;
158
+ canonicalKey: z.ZodString;
159
+ displayLabel: z.ZodNullable<z.ZodString>;
160
+ }, z.core.$strip>;
161
+ role: z.ZodEnum<{
162
+ delivering: "delivering";
163
+ monitoring: "monitoring";
164
+ reviewing: "reviewing";
165
+ working: "working";
166
+ }>;
167
+ state: z.ZodEnum<{
168
+ active: "active";
169
+ released: "released";
170
+ stale: "stale";
171
+ superseded: "superseded";
172
+ }>;
173
+ revision: z.ZodNumber;
174
+ provenance: z.ZodEnum<{
175
+ explicit_agent: "explicit_agent";
176
+ session_resource: "session_resource";
177
+ system_lifecycle: "system_lifecycle";
178
+ trusted_integration: "trusted_integration";
179
+ user_api: "user_api";
180
+ }>;
181
+ version: z.ZodNullable<z.ZodObject<{
182
+ kind: z.ZodEnum<{
183
+ artifact_version: "artifact_version";
184
+ branch_head: "branch_head";
185
+ ci_run: "ci_run";
186
+ git_commit: "git_commit";
187
+ other: "other";
188
+ pull_request_head: "pull_request_head";
189
+ release_version: "release_version";
190
+ }>;
191
+ value: z.ZodString;
192
+ }, z.core.$strip>>;
193
+ observedAt: z.ZodString;
194
+ createdAt: z.ZodString;
195
+ updatedAt: z.ZodString;
196
+ settledAt: z.ZodNullable<z.ZodString>;
197
+ }, z.core.$strip>;
198
+ mutation: z.ZodEnum<{
199
+ created: "created";
200
+ released: "released";
201
+ stale: "stale";
202
+ superseded: "superseded";
203
+ updated: "updated";
204
+ }>;
205
+ replayed: z.ZodBoolean;
206
+ }, z.core.$strip>;
207
+ export type WorkClaimMutationResult = z.infer<typeof WorkClaimMutationResult>;
208
+ export declare const WorkClaimDiscoverySummary: z.ZodObject<{
209
+ id: z.ZodString;
210
+ sessionId: z.ZodString;
211
+ subject: z.ZodObject<{
212
+ namespace: z.ZodString;
213
+ type: z.ZodEnum<{
214
+ artifact: "artifact";
215
+ branch: "branch";
216
+ ci_run: "ci_run";
217
+ issue: "issue";
218
+ other: "other";
219
+ pull_request: "pull_request";
220
+ release: "release";
221
+ repository: "repository";
222
+ }>;
223
+ canonicalKey: z.ZodString;
224
+ displayLabel: z.ZodNullable<z.ZodString>;
225
+ }, z.core.$strip>;
226
+ role: z.ZodEnum<{
227
+ delivering: "delivering";
228
+ monitoring: "monitoring";
229
+ reviewing: "reviewing";
230
+ working: "working";
231
+ }>;
232
+ state: z.ZodEnum<{
233
+ active: "active";
234
+ released: "released";
235
+ stale: "stale";
236
+ superseded: "superseded";
237
+ }>;
238
+ revision: z.ZodNumber;
239
+ provenance: z.ZodEnum<{
240
+ explicit_agent: "explicit_agent";
241
+ session_resource: "session_resource";
242
+ system_lifecycle: "system_lifecycle";
243
+ trusted_integration: "trusted_integration";
244
+ user_api: "user_api";
245
+ }>;
246
+ version: z.ZodNullable<z.ZodObject<{
247
+ kind: z.ZodEnum<{
248
+ artifact_version: "artifact_version";
249
+ branch_head: "branch_head";
250
+ ci_run: "ci_run";
251
+ git_commit: "git_commit";
252
+ other: "other";
253
+ pull_request_head: "pull_request_head";
254
+ release_version: "release_version";
255
+ }>;
256
+ value: z.ZodString;
257
+ }, z.core.$strip>>;
258
+ observedAt: z.ZodString;
259
+ updatedAt: z.ZodString;
260
+ settledAt: z.ZodNullable<z.ZodString>;
261
+ }, z.core.$strip>;
262
+ export type WorkClaimDiscoverySummary = z.infer<typeof WorkClaimDiscoverySummary>;
263
+ export declare const WorkClaimSubjectFilter: z.ZodObject<{
264
+ namespace: z.ZodString;
265
+ type: z.ZodEnum<{
266
+ artifact: "artifact";
267
+ branch: "branch";
268
+ ci_run: "ci_run";
269
+ issue: "issue";
270
+ other: "other";
271
+ pull_request: "pull_request";
272
+ release: "release";
273
+ repository: "repository";
274
+ }>;
275
+ canonicalKey: z.ZodString;
276
+ }, z.core.$strict>;
277
+ export type WorkClaimSubjectFilter = z.infer<typeof WorkClaimSubjectFilter>;
278
+ export declare const WorkDiscoveryMatchClass: z.ZodEnum<{
279
+ exact_subject: "exact_subject";
280
+ fuzzy: "fuzzy";
281
+ goal: "goal";
282
+ title: "title";
283
+ }>;
284
+ export type WorkDiscoveryMatchClass = z.infer<typeof WorkDiscoveryMatchClass>;
285
+ export declare const WorkDiscoveryMatchedField: z.ZodEnum<{
286
+ claim_key: "claim_key";
287
+ claim_label: "claim_label";
288
+ goal: "goal";
289
+ subject: "subject";
290
+ title: "title";
291
+ }>;
292
+ export type WorkDiscoveryMatchedField = z.infer<typeof WorkDiscoveryMatchedField>;
293
+ /**
294
+ * Deliberately stable bands rather than a raw ranking score. Raw full-text or
295
+ * trigram values are query-relative and become a misleading cross-query API.
296
+ */
297
+ export declare const WorkDiscoveryScoreBand: z.ZodEnum<{
298
+ exact: "exact";
299
+ related: "related";
300
+ strong: "strong";
301
+ }>;
302
+ export type WorkDiscoveryScoreBand = z.infer<typeof WorkDiscoveryScoreBand>;
303
+ export declare const WorkDiscoveryMatch: z.ZodObject<{
304
+ class: z.ZodEnum<{
305
+ exact_subject: "exact_subject";
306
+ fuzzy: "fuzzy";
307
+ goal: "goal";
308
+ title: "title";
309
+ }>;
310
+ field: z.ZodEnum<{
311
+ claim_key: "claim_key";
312
+ claim_label: "claim_label";
313
+ goal: "goal";
314
+ subject: "subject";
315
+ title: "title";
316
+ }>;
317
+ scoreBand: z.ZodEnum<{
318
+ exact: "exact";
319
+ related: "related";
320
+ strong: "strong";
321
+ }>;
322
+ claimId: z.ZodNullable<z.ZodString>;
323
+ }, z.core.$strict>;
324
+ export type WorkDiscoveryMatch = z.infer<typeof WorkDiscoveryMatch>;
325
+ /**
326
+ * Provider-neutral related-work evidence. The two literal booleans are part of
327
+ * the wire contract so a consumer cannot accidentally present a claim as a
328
+ * lock, authorization grant, ownership transfer, or mandatory instruction.
329
+ */
330
+ export declare const WorkDiscoveryProjection: z.ZodObject<{
331
+ claims: z.ZodArray<z.ZodObject<{
332
+ id: z.ZodString;
333
+ sessionId: z.ZodString;
334
+ subject: z.ZodObject<{
335
+ namespace: z.ZodString;
336
+ type: z.ZodEnum<{
337
+ artifact: "artifact";
338
+ branch: "branch";
339
+ ci_run: "ci_run";
340
+ issue: "issue";
341
+ other: "other";
342
+ pull_request: "pull_request";
343
+ release: "release";
344
+ repository: "repository";
345
+ }>;
346
+ canonicalKey: z.ZodString;
347
+ displayLabel: z.ZodNullable<z.ZodString>;
348
+ }, z.core.$strip>;
349
+ role: z.ZodEnum<{
350
+ delivering: "delivering";
351
+ monitoring: "monitoring";
352
+ reviewing: "reviewing";
353
+ working: "working";
354
+ }>;
355
+ state: z.ZodEnum<{
356
+ active: "active";
357
+ released: "released";
358
+ stale: "stale";
359
+ superseded: "superseded";
360
+ }>;
361
+ revision: z.ZodNumber;
362
+ provenance: z.ZodEnum<{
363
+ explicit_agent: "explicit_agent";
364
+ session_resource: "session_resource";
365
+ system_lifecycle: "system_lifecycle";
366
+ trusted_integration: "trusted_integration";
367
+ user_api: "user_api";
368
+ }>;
369
+ version: z.ZodNullable<z.ZodObject<{
370
+ kind: z.ZodEnum<{
371
+ artifact_version: "artifact_version";
372
+ branch_head: "branch_head";
373
+ ci_run: "ci_run";
374
+ git_commit: "git_commit";
375
+ other: "other";
376
+ pull_request_head: "pull_request_head";
377
+ release_version: "release_version";
378
+ }>;
379
+ value: z.ZodString;
380
+ }, z.core.$strip>>;
381
+ observedAt: z.ZodString;
382
+ updatedAt: z.ZodString;
383
+ settledAt: z.ZodNullable<z.ZodString>;
384
+ }, z.core.$strip>>;
385
+ claimsTruncated: z.ZodBoolean;
386
+ match: z.ZodNullable<z.ZodObject<{
387
+ class: z.ZodEnum<{
388
+ exact_subject: "exact_subject";
389
+ fuzzy: "fuzzy";
390
+ goal: "goal";
391
+ title: "title";
392
+ }>;
393
+ field: z.ZodEnum<{
394
+ claim_key: "claim_key";
395
+ claim_label: "claim_label";
396
+ goal: "goal";
397
+ subject: "subject";
398
+ title: "title";
399
+ }>;
400
+ scoreBand: z.ZodEnum<{
401
+ exact: "exact";
402
+ related: "related";
403
+ strong: "strong";
404
+ }>;
405
+ claimId: z.ZodNullable<z.ZodString>;
406
+ }, z.core.$strict>>;
407
+ possibleOverlap: z.ZodBoolean;
408
+ advisoryOnly: z.ZodLiteral<true>;
409
+ noAdditionalAccess: z.ZodLiteral<true>;
410
+ }, z.core.$strict>;
411
+ export type WorkDiscoveryProjection = z.infer<typeof WorkDiscoveryProjection>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/contracts",
3
- "version": "2.5.0-canary.2",
3
+ "version": "2.7.0",
4
4
  "description": "Shared zod schemas and wire-contract types for the OpenGeni API.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -58,6 +58,14 @@
58
58
  "types": "./dist/canonical-human-identities.d.ts",
59
59
  "import": "./dist/canonical-human-identities.js"
60
60
  },
61
+ "./managed-auth-session-sets": {
62
+ "types": "./dist/managed-auth-session-sets.d.ts",
63
+ "import": "./dist/managed-auth-session-sets.js"
64
+ },
65
+ "./organization-recovery": {
66
+ "types": "./dist/organization-recovery.d.ts",
67
+ "import": "./dist/organization-recovery.js"
68
+ },
61
69
  "./codex-provider-account-authority": {
62
70
  "types": "./dist/codex-provider-account-authority.d.ts",
63
71
  "import": "./dist/codex-provider-account-authority.js"
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+
3
+ import {
4
+ NestedAgentDepthValue,
5
+ SessionGoalStatus,
6
+ SessionStatus,
7
+ } from "./session-topology-primitives";
8
+ import { WorkDiscoveryProjection } from "./work-claims";
9
+
10
+ /** Compact, bounded session projection for workspace agent-topology browsers. */
11
+ export const AgentTopologySession = z.object({
12
+ id: z.string().uuid(),
13
+ title: z.string().nullable(),
14
+ titleTruncated: z.boolean(),
15
+ parentSessionId: z.string().uuid().nullable(),
16
+ rootSessionId: z.string().uuid(),
17
+ nestedAgentDepth: NestedAgentDepthValue,
18
+ ancestorPath: z.array(
19
+ z.object({
20
+ id: z.string().uuid(),
21
+ title: z.string().nullable(),
22
+ titleTruncated: z.boolean(),
23
+ }),
24
+ ),
25
+ status: SessionStatus,
26
+ goal: z
27
+ .object({
28
+ status: SessionGoalStatus,
29
+ summary: z.string(),
30
+ summaryTruncated: z.boolean(),
31
+ })
32
+ .nullable(),
33
+ pause: z.object({
34
+ state: z.enum(["active", "paused"]),
35
+ additionalBlockerCount: z.number().int().nonnegative(),
36
+ source: z
37
+ .object({
38
+ kind: z.enum(["session", "workspace"]),
39
+ sessionId: z.string().uuid().optional(),
40
+ displayName: z.string(),
41
+ displayNameTruncated: z.boolean(),
42
+ })
43
+ .nullable(),
44
+ }),
45
+ children: z.object({
46
+ directChildren: z.number().int().nonnegative(),
47
+ totalDescendants: z.number().int().nonnegative(),
48
+ runningDescendants: z.number().int().nonnegative(),
49
+ queuedDescendants: z.number().int().nonnegative(),
50
+ attentionDescendants: z.number().int().nonnegative(),
51
+ pausedDescendants: z.number().int().nonnegative(),
52
+ failedDescendants: z.number().int().nonnegative(),
53
+ truncated: z.boolean(),
54
+ }),
55
+ relatedWork: WorkDiscoveryProjection,
56
+ createdAt: z.string(),
57
+ updatedAt: z.string(),
58
+ });
59
+ export type AgentTopologySession = z.infer<typeof AgentTopologySession>;
60
+
61
+ export const AgentTopologyPageResponse = z.object({
62
+ sessions: z.array(AgentTopologySession),
63
+ total: z.number().int().nonnegative(),
64
+ hasMore: z.boolean(),
65
+ /** Operator rollout decision for human advisory presentation. */
66
+ humanAdvisoriesEnabled: z.boolean().optional(),
67
+ nextCursor: z.string().nullable(),
68
+ });
69
+ export type AgentTopologyPageResponse = z.infer<typeof AgentTopologyPageResponse>;
@@ -16,7 +16,10 @@ const WorkspaceImagePathSchema = z
16
16
  // without sending unsupported regex syntax to model providers.
17
17
  .refine((path) => path.split("/").every((segment) => segment !== "." && segment !== ".."), {
18
18
  message: "Sandbox image paths cannot contain dot segments",
19
- });
19
+ })
20
+ .describe(
21
+ "Absolute /workspace path to a PNG, JPEG, or WebP image. Convert SVG or other formats before using them as image-generation references.",
22
+ );
20
23
 
21
24
  /** One ordered, workspace-owned input used to guide or edit an image. */
22
25
  export const ImageGenerationReferenceSchema = z.discriminatedUnion("kind", [
@@ -49,7 +52,10 @@ export const GenerateImageToolInput = z
49
52
  .array(ImageGenerationReferenceSchema)
50
53
  .max(IMAGE_GENERATION_MAX_REFERENCES)
51
54
  .optional()
52
- .default([]),
55
+ .default([])
56
+ .describe(
57
+ "Ordered image references. Every sandbox path, File, or artifact must resolve to PNG, JPEG, or WebP bytes.",
58
+ ),
53
59
  })
54
60
  .strict();
55
61
  export type GenerateImageToolInput = z.infer<typeof GenerateImageToolInput>;