@vertesia/common 1.6.0-dev.20261014.015055Z → 1.6.0-dev.20261019.172735Z

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.
Files changed (116) hide show
  1. package/lib/api-contract/components.generated.json +1203 -24
  2. package/lib/api-schemas/agent-runs.d.ts +50 -0
  3. package/lib/api-schemas/agent-runs.d.ts.map +1 -1
  4. package/lib/api-schemas/agent-runs.js +3 -3
  5. package/lib/api-schemas/agent-runs.js.map +1 -1
  6. package/lib/api-schemas/app-lifecycle.d.ts +126 -0
  7. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
  8. package/lib/api-schemas/app-lifecycle.js +134 -1
  9. package/lib/api-schemas/app-lifecycle.js.map +1 -1
  10. package/lib/api-schemas/app-runtime.d.ts +466 -0
  11. package/lib/api-schemas/app-runtime.d.ts.map +1 -1
  12. package/lib/api-schemas/app-runtime.js +50 -1
  13. package/lib/api-schemas/app-runtime.js.map +1 -1
  14. package/lib/api-schemas/apps.d.ts +73 -0
  15. package/lib/api-schemas/apps.d.ts.map +1 -1
  16. package/lib/api-schemas/apps.js +41 -0
  17. package/lib/api-schemas/apps.js.map +1 -1
  18. package/lib/api-schemas/audit-trail.d.ts.map +1 -1
  19. package/lib/api-schemas/audit-trail.js +5 -5
  20. package/lib/api-schemas/audit-trail.js.map +1 -1
  21. package/lib/api-schemas/content.d.ts +25 -0
  22. package/lib/api-schemas/content.d.ts.map +1 -1
  23. package/lib/api-schemas/content.js +5 -5
  24. package/lib/api-schemas/content.js.map +1 -1
  25. package/lib/api-schemas/document-processing.d.ts +15 -0
  26. package/lib/api-schemas/document-processing.d.ts.map +1 -1
  27. package/lib/api-schemas/events.d.ts +45 -0
  28. package/lib/api-schemas/events.d.ts.map +1 -1
  29. package/lib/api-schemas/inference-profile.d.ts +30 -0
  30. package/lib/api-schemas/inference-profile.d.ts.map +1 -1
  31. package/lib/api-schemas/interaction.d.ts +395 -0
  32. package/lib/api-schemas/interaction.d.ts.map +1 -1
  33. package/lib/api-schemas/interaction.js +9 -7
  34. package/lib/api-schemas/interaction.js.map +1 -1
  35. package/lib/api-schemas/oauth-server.d.ts +128 -0
  36. package/lib/api-schemas/oauth-server.d.ts.map +1 -1
  37. package/lib/api-schemas/oauth-server.js +95 -2
  38. package/lib/api-schemas/oauth-server.js.map +1 -1
  39. package/lib/api-schemas/process.d.ts +11 -0
  40. package/lib/api-schemas/process.d.ts.map +1 -1
  41. package/lib/api-schemas/process.js +12 -0
  42. package/lib/api-schemas/process.js.map +1 -1
  43. package/lib/api-schemas/project-configuration.d.ts +50 -0
  44. package/lib/api-schemas/project-configuration.d.ts.map +1 -1
  45. package/lib/api-schemas/project.d.ts +75 -0
  46. package/lib/api-schemas/project.d.ts.map +1 -1
  47. package/lib/api-schemas/prompt.d.ts.map +1 -1
  48. package/lib/api-schemas/prompt.js +5 -2
  49. package/lib/api-schemas/prompt.js.map +1 -1
  50. package/lib/api-schemas/registry.d.ts +1266 -0
  51. package/lib/api-schemas/registry.d.ts.map +1 -1
  52. package/lib/api-schemas/registry.js +33 -3
  53. package/lib/api-schemas/registry.js.map +1 -1
  54. package/lib/api-schemas/schema-primitives.d.ts +8 -0
  55. package/lib/api-schemas/schema-primitives.d.ts.map +1 -1
  56. package/lib/api-schemas/schema-primitives.js +8 -0
  57. package/lib/api-schemas/schema-primitives.js.map +1 -1
  58. package/lib/api-schemas/store.d.ts +250 -0
  59. package/lib/api-schemas/store.d.ts.map +1 -1
  60. package/lib/api-schemas/store.js +3 -3
  61. package/lib/api-schemas/store.js.map +1 -1
  62. package/lib/api-schemas/task.d.ts.map +1 -1
  63. package/lib/api-schemas/task.js +3 -2
  64. package/lib/api-schemas/task.js.map +1 -1
  65. package/lib/api-schemas/workflow-runs.d.ts +10 -0
  66. package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
  67. package/lib/apikey.d.ts +7 -0
  68. package/lib/apikey.d.ts.map +1 -1
  69. package/lib/apikey.js.map +1 -1
  70. package/lib/apps.d.ts +37 -1
  71. package/lib/apps.d.ts.map +1 -1
  72. package/lib/apps.js +74 -3
  73. package/lib/apps.js.map +1 -1
  74. package/lib/interaction.d.ts.map +1 -1
  75. package/lib/interaction.js.map +1 -1
  76. package/lib/oauth-server.d.ts +5 -0
  77. package/lib/oauth-server.d.ts.map +1 -1
  78. package/lib/store/index.d.ts +1 -0
  79. package/lib/store/index.d.ts.map +1 -1
  80. package/lib/store/index.js +1 -0
  81. package/lib/store/index.js.map +1 -1
  82. package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
  83. package/lib/store/intake-policy-schema.generated.js +1 -2
  84. package/lib/store/intake-policy-schema.generated.js.map +1 -1
  85. package/lib/store/text-limits.d.ts +18 -0
  86. package/lib/store/text-limits.d.ts.map +1 -0
  87. package/lib/store/text-limits.js +56 -0
  88. package/lib/store/text-limits.js.map +1 -0
  89. package/lib/vertesia-common.js +4 -2
  90. package/lib/vertesia-common.js.map +1 -1
  91. package/lib/wire-types.generated.d.ts +246 -2
  92. package/lib/wire-types.generated.d.ts.map +1 -1
  93. package/package.json +3 -3
  94. package/src/api-contract/components.generated.json +1203 -24
  95. package/src/api-schemas/agent-runs.ts +3 -3
  96. package/src/api-schemas/app-lifecycle.ts +163 -1
  97. package/src/api-schemas/app-runtime.ts +54 -0
  98. package/src/api-schemas/apps.ts +46 -0
  99. package/src/api-schemas/audit-trail.ts +5 -5
  100. package/src/api-schemas/content.ts +5 -5
  101. package/src/api-schemas/interaction.ts +9 -7
  102. package/src/api-schemas/oauth-server.ts +103 -2
  103. package/src/api-schemas/process.ts +13 -0
  104. package/src/api-schemas/prompt.ts +5 -2
  105. package/src/api-schemas/registry.ts +52 -0
  106. package/src/api-schemas/schema-primitives.ts +9 -0
  107. package/src/api-schemas/store.ts +3 -3
  108. package/src/api-schemas/task.ts +3 -2
  109. package/src/apikey.ts +8 -0
  110. package/src/apps.ts +116 -3
  111. package/src/interaction.ts +1 -0
  112. package/src/oauth-server.ts +10 -0
  113. package/src/store/index.ts +1 -0
  114. package/src/store/intake-policy-schema.generated.ts +1 -2
  115. package/src/store/text-limits.ts +64 -0
  116. package/src/wire-types.generated.ts +266 -2
@@ -20,11 +20,16 @@ export const OAuthRegistrationSourceSchema = z.enum(['admin', 'dynamic']).meta({
20
20
  export const OAuthProjectBindingModeSchema = z.enum(['user_select', 'fixed']).meta({ id: 'OAuthProjectBindingMode' });
21
21
 
22
22
  export const OAuthTokenEndpointAuthMethodSchema = z
23
- .enum(['none', 'client_secret_post', 'client_secret_basic'])
23
+ .enum(['none', 'client_secret_post', 'client_secret_basic', 'private_key_jwt'])
24
24
  .meta({ id: 'OAuthTokenEndpointAuthMethod' });
25
25
 
26
26
  export const OAuthGrantTypeSchema = z
27
- .enum(['authorization_code', 'refresh_token', 'urn:ietf:params:oauth:grant-type:device_code'])
27
+ .enum([
28
+ 'authorization_code',
29
+ 'refresh_token',
30
+ 'urn:ietf:params:oauth:grant-type:device_code',
31
+ 'urn:ietf:params:oauth:grant-type:token-exchange',
32
+ ])
28
33
  .meta({ id: 'OAuthGrantType' });
29
34
 
30
35
  export const OAuthResponseTypeSchema = z.literal('code').meta({ id: 'OAuthResponseType' });
@@ -58,6 +63,7 @@ export const OAuthAuthorizationServerMetadataSchema = z
58
63
  grant_types_supported: z.array(z.string()),
59
64
  code_challenge_methods_supported: z.array(z.string()),
60
65
  token_endpoint_auth_methods_supported: z.array(z.string()),
66
+ token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
61
67
  scopes_supported: z.array(z.string()),
62
68
  client_id_metadata_document_supported: z.boolean().optional(),
63
69
  authorization_response_iss_parameter_supported: z.boolean().optional(),
@@ -110,6 +116,7 @@ export const OAuthAuthorizationRequestSchema = z
110
116
  }),
111
117
  client_id: z.string(),
112
118
  client_name: z.string(),
119
+ app_id: z.string().optional(),
113
120
  client_metadata: OAuthClientDisplayMetadataSchema.optional(),
114
121
  client_registration_mode: OAuthClientRegistrationModeSchema.optional(),
115
122
  redirect_uri: z.string(),
@@ -212,12 +219,17 @@ export const OAuthTokenResponseSchema = z
212
219
  * publishes these properties inline under `OAuthClient`, with `client_id` last.
213
220
  */
214
221
  export const OAuthClientDataSchema = z.strictObject({
222
+ app_id: z.string().optional().meta({
223
+ description:
224
+ 'App associated with this client. Authorization requires an installation explicitly enabling this client and current user app access.',
225
+ }),
215
226
  client_name: z.string(),
216
227
  client_type: OAuthClientTypeSchema,
217
228
  redirect_uris: z.array(z.string()),
218
229
  grant_types: z.array(OAuthGrantTypeSchema),
219
230
  response_types: z.array(OAuthResponseTypeSchema),
220
231
  token_endpoint_auth_method: OAuthTokenEndpointAuthMethodSchema,
232
+ jwks_uri: z.string().url().optional(),
221
233
  allowed_scopes: z.array(z.string()),
222
234
  default_scopes: z.array(z.string()).optional(),
223
235
  registration_source: OAuthRegistrationSourceSchema,
@@ -269,6 +281,7 @@ export const CreateOAuthClientPayloadSchema = z
269
281
  grant_types: z.array(OAuthGrantTypeSchema).optional(),
270
282
  response_types: z.array(OAuthResponseTypeSchema).optional(),
271
283
  token_endpoint_auth_method: OAuthTokenEndpointAuthMethodSchema.optional(),
284
+ jwks_uri: z.string().url().optional(),
272
285
  allowed_scopes: z.array(z.string()).optional(),
273
286
  default_scopes: z.array(z.string()).optional(),
274
287
  project_binding_mode: OAuthProjectBindingModeSchema.optional(),
@@ -292,9 +305,13 @@ export const UpdateOAuthClientPayloadSchema = z
292
305
  grant_types: z.array(OAuthGrantTypeSchema).optional(),
293
306
  response_types: z.array(OAuthResponseTypeSchema).optional(),
294
307
  token_endpoint_auth_method: OAuthTokenEndpointAuthMethodSchema.optional(),
308
+ jwks_uri: z.string().url().optional(),
295
309
  allowed_scopes: z.array(z.string()).optional(),
296
310
  default_scopes: z.array(z.string()).optional(),
297
311
  status: OAuthClientStatusSchema.optional(),
312
+ revoke_previous_client_secret: z.boolean().optional().meta({
313
+ description: 'Immediately revoke the previous rotation secret while retaining the current secret.',
314
+ }),
298
315
  project_binding_mode: OAuthProjectBindingModeSchema.optional(),
299
316
  fixed_project_id: z.string().optional(),
300
317
  restrict_to_owner_account: z.boolean().optional(),
@@ -406,3 +423,87 @@ export const OAuthLoginUserNotFoundResponseSchema = z
406
423
  ensure_user_url: z.string(),
407
424
  })
408
425
  .meta({ id: 'OAuthLoginUserNotFoundResponse' });
426
+
427
+ const federationId = z.string().regex(/^[a-fA-F0-9]{24}$/);
428
+ export const OidcFederationConnectionPayloadSchema = z
429
+ .strictObject({
430
+ name: z.string().min(1).max(200),
431
+ issuer: z.string().url(),
432
+ jwks_uri: z.string().url().optional(),
433
+ external_id_claim: z.string().min(1).max(256).regex(/\S/).meta({
434
+ description:
435
+ 'Exact top-level verified token claim matched to SCIM externalId within the owning provisioning account.',
436
+ }),
437
+ allowed_audiences: z.array(z.string().min(1)).min(1).max(20),
438
+ allowed_algorithms: z
439
+ .array(z.enum(['RS256', 'ES256']))
440
+ .min(1)
441
+ .max(2),
442
+ subject_token_type: z.enum([
443
+ 'urn:ietf:params:oauth:token-type:jwt',
444
+ 'urn:ietf:params:oauth:token-type:id_token',
445
+ 'urn:ietf:params:oauth:token-type:access_token',
446
+ ]),
447
+ required_claims: z.record(z.string(), z.string()).optional().meta({
448
+ description: 'Exact string matches against verified top-level IdP claims, such as tenant or azp.',
449
+ }),
450
+ all_projects: z.boolean().optional().meta({
451
+ description:
452
+ 'Explicitly allow all current and future projects in the owning organization, subject to the user’s current access. Defaults to false for existing allowlists. When true, allowed_project_ids must be empty.',
453
+ }),
454
+ allowed_project_ids: z.array(federationId).max(100).meta({
455
+ description: 'Explicit project allowlist. Must contain 1–100 projects unless all_projects is true.',
456
+ }),
457
+ allowed_client_ids: z.array(z.string().min(1).max(256)).min(1).max(20).optional().meta({
458
+ description:
459
+ 'When set, require authentication by one of these account-owned confidential OAuth clients. Omit to allow exchanges without separate client authentication.',
460
+ }),
461
+ allowed_scopes: z.array(z.string().min(1)).min(1).max(100).optional().meta({
462
+ description:
463
+ 'Optional restriction on delegable Vertesia permissions, excluding account:admin. Omit to use the user’s current permissions. An explicit list further restricts the grant.',
464
+ }),
465
+ max_token_ttl_seconds: z.number().int().min(30).max(300),
466
+ max_subject_token_age_seconds: z.number().int().min(30).max(86400).optional().meta({
467
+ description:
468
+ 'Maximum age since the signed iat claim. Defaults to 3600 seconds; 60 seconds of clock tolerance applies.',
469
+ }),
470
+ enabled: z.boolean(),
471
+ })
472
+ .meta({ id: 'OidcFederationConnectionPayload' });
473
+ export const OidcFederationConnectionSchema = OidcFederationConnectionPayloadSchema.extend({
474
+ id: federationId,
475
+ account_id: federationId,
476
+ max_subject_token_age_seconds: z.number().int().min(30).max(86400),
477
+ }).meta({ id: 'OidcFederationConnection' });
478
+ export const OidcFederationConnectionArraySchema = z
479
+ .array(OidcFederationConnectionSchema)
480
+ .meta({ id: 'OidcFederationConnectionArray' });
481
+ export const OAuthTokenExchangeRequestSchema = z
482
+ .strictObject({
483
+ grant_type: z.literal('urn:ietf:params:oauth:grant-type:token-exchange'),
484
+ subject_token: z.string().min(1).max(65536),
485
+ subject_token_type: OidcFederationConnectionPayloadSchema.shape.subject_token_type,
486
+ requested_token_type: z.literal('urn:ietf:params:oauth:token-type:access_token').optional(),
487
+ federation_connection_id: federationId,
488
+ client_id: z.string().min(1).max(256).optional(),
489
+ client_secret: z.string().min(1).max(4096).optional(),
490
+ client_assertion: z.string().min(1).max(16384).optional(),
491
+ client_assertion_type: z.literal('urn:ietf:params:oauth:client-assertion-type:jwt-bearer').optional(),
492
+ project_id: federationId,
493
+ resource: z.string().min(1),
494
+ scope: z.string().min(1).max(4096).optional().meta({
495
+ description:
496
+ 'Optional space-separated permission subset. Omit to use current user permissions within the connection policy.',
497
+ }),
498
+ })
499
+ .meta({ id: 'OAuthTokenExchangeRequest' });
500
+ export const OAuthTokenExchangeResponseSchema = OAuthTokenResponseSchema.omit({
501
+ refresh_token: true,
502
+ refresh_token_expires_in: true,
503
+ id_token: true,
504
+ })
505
+ .extend({
506
+ token_type: z.literal('Bearer'),
507
+ issued_token_type: z.literal('urn:ietf:params:oauth:token-type:access_token'),
508
+ })
509
+ .meta({ id: 'OAuthTokenExchangeResponse' });
@@ -155,6 +155,19 @@ export const PublishProcessDefinitionPayloadSchema = z
155
155
  .optional(),
156
156
  label: z.string().meta({ description: 'Optional human-readable revision label.' }).optional(),
157
157
  comment: z.string().meta({ description: 'Optional publish note.' }).optional(),
158
+ idempotency_key: z
159
+ .string()
160
+ .min(1)
161
+ .max(256)
162
+ .meta({
163
+ description:
164
+ 'Client-chosen key that makes this request safe to retry. Publishing is otherwise not ' +
165
+ 'idempotent: a repeat of a publish that already succeeded is rejected because the revision ' +
166
+ 'is no longer a draft. When the revision was published by a request with the same key and ' +
167
+ 'the same body, the repeat returns that revision instead. Reusing the key with a different ' +
168
+ 'body is rejected with 409. The key is bound to the revision it published.',
169
+ })
170
+ .optional(),
158
171
  })
159
172
  .meta({ id: 'PublishProcessDefinitionPayload' });
160
173
 
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { FacetSpecSchema, PromptTemplateRefSchema } from './interaction.js';
3
+ import { PageCountSchema } from './schema-primitives.js';
3
4
 
4
5
  // The prompt-authoring contracts: what a fork, a render and a prompt search publish, and how a
5
6
  // prompt's interaction usages are reported. `PromptTemplate` itself and its two write payloads live
@@ -50,8 +51,10 @@ export const PromptSearchQuerySchema = z
50
51
  'Accepted and ignored. `GET /prompts` and `POST /prompts/facets` list drafts only, and always have.',
51
52
  })
52
53
  .optional(),
53
- limit: z.number().meta({ description: 'Maximum number of prompts to return. Defaults to 100.' }).optional(),
54
- offset: z.number().meta({ description: 'Number of prompts to skip.' }).optional(),
54
+ limit: PageCountSchema.meta({
55
+ description: 'Maximum number of prompts to return. Defaults to 100.',
56
+ }).optional(),
57
+ offset: PageCountSchema.meta({ description: 'Number of prompts to skip.' }).optional(),
55
58
  role: z.string().meta({ description: 'Exact match on the prompt role.' }).optional(),
56
59
  tags: z.array(z.string()).meta({ description: 'Match prompts carrying any of these tags.' }).optional(),
57
60
  matchInteractions: z
@@ -88,6 +88,16 @@ import {
88
88
  AppDevelopmentTaskDetailsSchema,
89
89
  AppDevelopmentTaskListSchema,
90
90
  AppDevelopmentTaskSchema,
91
+ AppGithubAccountSchema,
92
+ AppGithubBranchStateSchema,
93
+ AppGithubConfigurationSchema,
94
+ AppGithubInstallationSchema,
95
+ AppGithubRepositoriesQuerySchema,
96
+ AppGithubRepositoryCreationSchema,
97
+ AppGithubRepositoryListSchema,
98
+ AppGithubRepositorySchema,
99
+ AppGithubRepositorySetupQuerySchema,
100
+ AppGithubRepositorySetupSchema,
91
101
  AppInspectionCapabilityReportSchema,
92
102
  AppInspectionIssueSchema,
93
103
  AppInspectionResultSchema,
@@ -97,6 +107,7 @@ import {
97
107
  AppInstallationProjectsQuerySchema,
98
108
  AppInstallationProviderBindingSchema,
99
109
  AppInstallationsQuerySchema,
110
+ AppInstanceAvailabilitySchema,
100
111
  AppListScopeSchema,
101
112
  AppOAuthCollectionParamsSchema,
102
113
  AppOAuthProviderParamsSchema,
@@ -112,6 +123,7 @@ import {
112
123
  AppScaffoldModuleSchema,
113
124
  AppScaffoldProgressSchema,
114
125
  AppScaffoldProgressStatusSchema,
126
+ AppScaffoldSourceModeSchema,
115
127
  AppsQuerySchema,
116
128
  AppToolCollectionArraySchema,
117
129
  AppToolCollectionSchema,
@@ -128,6 +140,8 @@ import {
128
140
  ConversationActivityStateSchema,
129
141
  DeleteAppVersionResponseSchema,
130
142
  EventRefSchema,
143
+ ExchangeAppGithubAuthorizationRequestSchema,
144
+ ExchangeAppGithubAuthorizationResponseSchema,
131
145
  Extract_AppVersionGitRefType_branch_tag_commitSchema,
132
146
  InCodeTypeRefSchema,
133
147
  McpApiKeyCredentialSchema,
@@ -138,6 +152,7 @@ import {
138
152
  StartAppBuildRequestSchema,
139
153
  StartAppBuildResponseSchema,
140
154
  StartAppDevelopmentTaskRequestSchema,
155
+ StartAppGithubAuthorizationResponseSchema,
141
156
  StartAppScaffoldRequestSchema,
142
157
  StartAppScaffoldResponseSchema,
143
158
  StoredTypeRefSchema,
@@ -152,6 +167,7 @@ import * as AppRuntimeSchemas from './app-runtime.js';
152
167
  import {
153
168
  AppAccessControlSchema,
154
169
  AppCapabilitiesSchema,
170
+ AppGitSourceProviderSchema,
155
171
  AppManifestSourceSchema,
156
172
  AppSourceConfigSchema,
157
173
  AppUIConfigSchema,
@@ -657,7 +673,12 @@ import {
657
673
  OAuthRegistrationSourceSchema,
658
674
  OAuthResponseTypeSchema,
659
675
  OAuthTokenEndpointAuthMethodSchema,
676
+ OAuthTokenExchangeRequestSchema,
677
+ OAuthTokenExchangeResponseSchema,
660
678
  OAuthTokenResponseSchema,
679
+ OidcFederationConnectionArraySchema,
680
+ OidcFederationConnectionPayloadSchema,
681
+ OidcFederationConnectionSchema,
661
682
  RevokeOAuthGrantQuerySchema,
662
683
  UpdateOAuthClientPayloadSchema,
663
684
  } from './oauth-server.js';
@@ -934,6 +955,7 @@ const PROJECT_AND_APP_SCHEMAS = {
934
955
  AppCapabilities: AppCapabilitiesSchema,
935
956
  AppAccessControl: AppAccessControlSchema,
936
957
  AppSourceConfig: AppSourceConfigSchema,
958
+ AppGitSourceProvider: AppGitSourceProviderSchema,
937
959
  AppManifestSource: AppManifestSourceSchema,
938
960
  } as const satisfies Record<string, z.ZodType>;
939
961
 
@@ -987,6 +1009,12 @@ const OAUTH_SCHEMAS = {
987
1009
  OAuthDeviceAuthorizationRequest: OAuthDeviceAuthorizationRequestSchema,
988
1010
  OAuthDeviceAuthorizationResponse: OAuthDeviceAuthorizationResponseSchema,
989
1011
  OAuthTokenResponse: OAuthTokenResponseSchema,
1012
+ OidcFederationConnectionPayload: OidcFederationConnectionPayloadSchema,
1013
+ OidcFederationConnection: OidcFederationConnectionSchema,
1014
+ OidcFederationConnectionArray: OidcFederationConnectionArraySchema,
1015
+ OAuthTokenExchangeRequest: OAuthTokenExchangeRequestSchema,
1016
+ OAuthTokenExchangeResponse: OAuthTokenExchangeResponseSchema,
1017
+
990
1018
  // Clients registered against Vertesia's own OAuth server. `OAuthClientData` is composed into
991
1019
  // `OAuthClient` rather than hoisted, so it has no component of its own — as today.
992
1020
  OAuthClient: OAuthClientSchema,
@@ -2224,6 +2252,20 @@ const APP_LIFECYCLE_SCHEMAS = {
2224
2252
  AppRepoBranch: AppRepoBranchSchema,
2225
2253
  AppRepoDocumentCommit: AppRepoDocumentCommitSchema,
2226
2254
  AppVersionGitSource: AppVersionGitSourceSchema,
2255
+ AppGithubConfiguration: AppGithubConfigurationSchema,
2256
+ StartAppGithubAuthorizationResponse: StartAppGithubAuthorizationResponseSchema,
2257
+ ExchangeAppGithubAuthorizationRequest: ExchangeAppGithubAuthorizationRequestSchema,
2258
+ AppGithubRepositoriesQuery: AppGithubRepositoriesQuerySchema,
2259
+ ExchangeAppGithubAuthorizationResponse: ExchangeAppGithubAuthorizationResponseSchema,
2260
+ AppGithubInstallation: AppGithubInstallationSchema,
2261
+ AppGithubAccount: AppGithubAccountSchema,
2262
+ AppGithubRepository: AppGithubRepositorySchema,
2263
+ AppGithubRepositoryCreation: AppGithubRepositoryCreationSchema,
2264
+ AppGithubRepositoryList: AppGithubRepositoryListSchema,
2265
+ AppGithubRepositorySetupQuery: AppGithubRepositorySetupQuerySchema,
2266
+ AppGithubBranchState: AppGithubBranchStateSchema,
2267
+ AppGithubRepositorySetup: AppGithubRepositorySetupSchema,
2268
+ AppScaffoldSourceMode: AppScaffoldSourceModeSchema,
2227
2269
  StartAppScaffoldRequest: StartAppScaffoldRequestSchema,
2228
2270
  StartAppDevelopmentTaskRequest: StartAppDevelopmentTaskRequestSchema,
2229
2271
  StartAppBuildRequest: StartAppBuildRequestSchema,
@@ -2248,6 +2290,7 @@ const APP_LIFECYCLE_SCHEMAS = {
2248
2290
  AgentRunSearchHit: AgentRunSearchHitSchema,
2249
2291
  UpsertAppVersionRequest: UpsertAppVersionRequestSchema,
2250
2292
  AppInstallationPayload: AppInstallationPayloadSchema,
2293
+ AppInstanceAvailability: AppInstanceAvailabilitySchema,
2251
2294
  AppDevelopmentTaskDetails: AppDevelopmentTaskDetailsSchema,
2252
2295
  AppVersionRecordArray: AppVersionRecordArraySchema,
2253
2296
  AppToolCollectionArray: AppToolCollectionArraySchema,
@@ -2338,6 +2381,7 @@ const APP_MANIFEST_SCHEMAS = {
2338
2381
  MCPOAuthConfigMap: AppRuntimeSchemas.MCPOAuthConfigMapSchema,
2339
2382
  AppWidgetInfo: AppRuntimeSchemas.AppWidgetInfoSchema,
2340
2383
  AppDashboardDefinition: AppRuntimeSchemas.AppDashboardDefinitionSchema,
2384
+ AppOAuthClientConfig: AppRuntimeSchemas.AppOAuthClientConfigSchema,
2341
2385
  AppManifestData: AppRuntimeSchemas.AppManifestDataSchema,
2342
2386
  UpdateAppPayload: AppRuntimeSchemas.UpdateAppPayloadSchema,
2343
2387
  AppManifest: AppRuntimeSchemas.AppManifestSchema,
@@ -2557,6 +2601,10 @@ const API_SCHEMAS: Readonly<Record<ApiComponentName, z.ZodType>> = mergeComponen
2557
2601
  * objects, so a body carrying an undeclared property is rejected rather than quietly accepted.
2558
2602
  */
2559
2603
  const STRICT_COMPONENTS: ReadonlySet<string> = new Set<string>([
2604
+ 'OidcFederationConnectionPayload',
2605
+ 'OidcFederationConnection',
2606
+ 'OAuthTokenExchangeRequest',
2607
+ 'OAuthTokenExchangeResponse',
2560
2608
  'UpdateInteractionConfigurationPayload',
2561
2609
  'InteractionConfigurationRecord',
2562
2610
  'InteractionConfigurationResult',
@@ -2774,6 +2822,8 @@ const STRICT_COMPONENTS: ReadonlySet<string> = new Set<string>([
2774
2822
  'MCPOAuthConfig',
2775
2823
  'MCPApiKeyConfig',
2776
2824
  'MCPToolCollectionObject',
2825
+ 'McpPublicParameter',
2826
+ 'McpSecretParameter',
2777
2827
  'VertesiaSDKToolCollectionObject',
2778
2828
  // File, task, content-type and command components. Every one is published closed
2779
2829
  // today; `StringValueMap`, `MigrationListResponse`, `TaskArray`, the two content-type array
@@ -3474,6 +3524,8 @@ const STRICT_COMPONENTS: ReadonlySet<string> = new Set<string>([
3474
3524
  'AgentRunSearchHit',
3475
3525
  'UpsertAppVersionRequest',
3476
3526
  'AppInstallationPayload',
3527
+ 'AppInstanceAvailability',
3528
+ 'AppOAuthClientConfig',
3477
3529
  'AppDevelopmentTaskDetails',
3478
3530
  'AppInstallationsQuery',
3479
3531
  'AppsQuery',
@@ -11,6 +11,15 @@ export const nullableNumberSchema = z
11
11
  .nullable()
12
12
  .meta({ anyOf: undefined, type: ['number', 'null'] });
13
13
 
14
+ /**
15
+ * A `limit` or `offset` query count: a whole number, zero or more. A fraction or a negative count used to
16
+ * reach the database and fail there as a 500.
17
+ *
18
+ * Published as `type: number` with `multipleOf: 1` rather than `type: integer`, so the generated Java and Go
19
+ * clients keep the parameter types they already expose while the contract enforcer answers 400.
20
+ */
21
+ export const PageCountSchema = z.number().multipleOf(1).min(0);
22
+
14
23
  /** Monotonic token for optimistic concurrency on mutable, user-authored resources. */
15
24
  export const EditRevisionSchema = z
16
25
  .number()
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  // From the values module, for the reason `./apikey.js` gives.
4
4
  import { ConfigModes, RunDataStorageLevel } from '../interaction-values.js';
5
5
  import { InferenceProfileIdSchema } from './inference-profile.js';
6
- import { EditRevisionSchema, ExpectedEditRevisionSchema } from './schema-primitives.js';
6
+ import { EditRevisionSchema, ExpectedEditRevisionSchema, PageCountSchema } from './schema-primitives.js';
7
7
 
8
8
  /**
9
9
  * Runtime API schemas for the content-intake policy tree.
@@ -643,8 +643,8 @@ export const ContentObjectTypeSchema = z.strictObject(storedContentTypeShape).me
643
643
  const contentTypeListingFields = {
644
644
  layout: z.boolean().optional(),
645
645
  schema: z.boolean().optional(),
646
- limit: z.number().optional(),
647
- offset: z.number().optional(),
646
+ limit: PageCountSchema.optional(),
647
+ offset: PageCountSchema.optional(),
648
648
  };
649
649
 
650
650
  export const ContentObjectTypeCatalogQuerySchema = z
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { PageCountSchema } from './schema-primitives.js';
2
3
 
3
4
  export const CompleteTaskPayloadSchema = z
4
5
  .strictObject({
@@ -98,7 +99,7 @@ export const ListTasksQuerySchema = z
98
99
  assignee: z.string().optional(),
99
100
  run_id: z.string().optional(),
100
101
  source_type: TaskSourceSchema.shape.type.optional(),
101
- limit: z.number().optional(),
102
- offset: z.number().optional(),
102
+ limit: PageCountSchema.optional(),
103
+ offset: PageCountSchema.optional(),
103
104
  })
104
105
  .meta({ id: 'ListTasksQuery' });
package/src/apikey.ts CHANGED
@@ -97,6 +97,14 @@ export interface AuthTokenPayload {
97
97
  */
98
98
  apps: string[];
99
99
 
100
+ /** Versioned grants for installations in the selected project. Absence means a legacy token. */
101
+ app_installations?: {
102
+ version: 1;
103
+ project_id: string;
104
+ ids: string[];
105
+ ui_restrictions?: string[];
106
+ };
107
+
100
108
  /**
101
109
  * Apps in `apps[]` whose UI surface is restricted for this principal — present only on
102
110
  * user tokens, and only when at least one app applies. Such apps grant functional access
package/src/apps.ts CHANGED
@@ -1,8 +1,28 @@
1
+ import type { AuthTokenPayload } from './apikey.js';
1
2
  import type * as Wire from './wire-types.generated.js';
2
3
 
3
4
  /** Allowed values for AppUINavItem.preferredSection */
4
5
  export const PREFERRED_SECTIONS = ['default', 'footer', 'settings'] as const;
5
6
 
7
+ function trimBoundaryHyphens(value: string): string {
8
+ let start = 0;
9
+ let end = value.length;
10
+ while (start < end && value[start] === '-') start++;
11
+ while (end > start && value[end - 1] === '-') end--;
12
+ return value.slice(start, end);
13
+ }
14
+
15
+ /** Convert an app display/package name into the canonical persisted app id. */
16
+ export function slugifyAppId(value: string): string {
17
+ const normalized = value
18
+ .trim()
19
+ .toLowerCase()
20
+ .replace(/[^a-z0-9._-]+/g, '-');
21
+ const slug = trimBoundaryHyphens(normalized).slice(0, 80);
22
+ if (!slug) throw new Error('App name must contain at least one letter or number');
23
+ return slug;
24
+ }
25
+
6
26
  // The app-manifest closure is declared once, as the Zod schemas in `./api-schemas/apps.ts`, and
7
27
  // inferred below. The documentation moved with it: what a published component says about a field now
8
28
  // comes from the schema's own `.meta({ description })` rather than from a TSDoc comment a generator
@@ -41,6 +61,7 @@ export interface AppUINavItem {
41
61
  }
42
62
 
43
63
  export type AppUIConfig = Wire.AppUIConfig;
64
+ export type AppOAuthClientConfig = Wire.AppOAuthClientConfig;
44
65
 
45
66
  export type AppInstallationProjectsQuery = Wire.AppInstallationProjectsQuery;
46
67
 
@@ -81,11 +102,24 @@ function deriveMCPCollectionId(input: string): string {
81
102
  * @param vars - Optional endpoint variables to substitute in URLs
82
103
  * @returns Normalized ToolCollectionObject
83
104
  */
84
- export function normalizeToolCollection(collection: ToolCollectionObject, vars?: Endpoints): ToolCollectionObject {
105
+ export function normalizeToolCollection(
106
+ collection: ToolCollectionObject,
107
+ vars?: Endpoints,
108
+ sharedParameters?: MCPToolCollectionObject['parameters'],
109
+ ): ToolCollectionObject {
85
110
  if (!collection || typeof collection !== 'object') {
86
111
  throw new TypeError('Tool collection must be an object');
87
112
  }
88
- const substitutedUrl = vars && collection.url ? substituteEndpoints(collection.url, vars) : collection.url;
113
+ const substitutedUrl =
114
+ vars && collection.url
115
+ ? substituteEndpoints(
116
+ collection.url,
117
+ vars,
118
+ collection.type === 'mcp'
119
+ ? [...Object.keys(sharedParameters ?? {}), ...Object.keys(collection.parameters ?? {})]
120
+ : [],
121
+ )
122
+ : collection.url;
89
123
  const urlChanged = substitutedUrl !== collection.url;
90
124
  if (collection.type === 'mcp') {
91
125
  const fallbackId = deriveMCPCollectionId(collection.id || collection.name || collection.url);
@@ -191,10 +225,26 @@ export type AppBuildProgress = Wire.AppBuildProgress;
191
225
 
192
226
  export type AppScaffoldModule = Wire.AppScaffoldModule;
193
227
 
228
+ export type AppScaffoldSourceMode = Wire.AppScaffoldSourceMode;
229
+
194
230
  export type StartAppScaffoldRequest = Wire.StartAppScaffoldRequest;
195
231
 
196
232
  export type StartAppScaffoldResponse = Wire.StartAppScaffoldResponse;
197
233
 
234
+ export type AppGithubConfiguration = Wire.AppGithubConfiguration;
235
+ export type StartAppGithubAuthorizationResponse = Wire.StartAppGithubAuthorizationResponse;
236
+ export type ExchangeAppGithubAuthorizationRequest = Wire.ExchangeAppGithubAuthorizationRequest;
237
+ export type AppGithubRepositoriesQuery = Wire.AppGithubRepositoriesQuery;
238
+ export type AppGithubInstallation = Wire.AppGithubInstallation;
239
+ export type AppGithubAccount = Wire.AppGithubAccount;
240
+ export type ExchangeAppGithubAuthorizationResponse = Wire.ExchangeAppGithubAuthorizationResponse;
241
+ export type AppGithubRepository = Wire.AppGithubRepository;
242
+ export type AppGithubRepositoryCreation = Wire.AppGithubRepositoryCreation;
243
+ export type AppGithubRepositoryList = Wire.AppGithubRepositoryList;
244
+ export type AppGithubRepositorySetupQuery = Wire.AppGithubRepositorySetupQuery;
245
+ export type AppGithubBranchState = Wire.AppGithubBranchState;
246
+ export type AppGithubRepositorySetup = Wire.AppGithubRepositorySetup;
247
+
198
248
  export type StartAppDevelopmentTaskRequest = Wire.StartAppDevelopmentTaskRequest;
199
249
 
200
250
  export type AppScaffoldProgressStatus = Wire.AppScaffoldProgressStatus;
@@ -232,6 +282,7 @@ export type AppManifestData = Wire.AppManifestData;
232
282
  export type UpdateAppPayload = Wire.UpdateAppPayload;
233
283
 
234
284
  export type AppGitSourceConfig = Wire.AppGitSourceConfig;
285
+ export type AppGitSourceProvider = Wire.AppGitSourceProvider;
235
286
 
236
287
  export type AppSourceConfig = Wire.AppSourceConfig;
237
288
 
@@ -262,9 +313,11 @@ export interface Endpoints {
262
313
  * with the unresolved placeholder visible, rather than silently pointing nowhere).
263
314
  * Trailing slashes on replacement values are stripped to avoid `//api/...` joins.
264
315
  */
265
- function substituteEndpoints(url: string, endpoints?: Endpoints): string {
316
+ function substituteEndpoints(url: string, endpoints?: Endpoints, parameterNames: string[] = []): string {
266
317
  if (!url || !endpoints) return url;
267
318
  return url.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, key: string) => {
319
+ // Explicit installation parameters take precedence over legacy platform endpoint placeholders.
320
+ if (parameterNames.includes(key)) return match;
268
321
  const value = (endpoints as Record<string, string | undefined>)[key];
269
322
  if (typeof value !== 'string' || !value) return match;
270
323
  return trimTrailingSlashes(value);
@@ -632,3 +685,63 @@ export type ValidateUrlResponse = Wire.ValidateUrlResponse;
632
685
  export type AppDeleteSummary = Wire.AppDeleteSummary;
633
686
 
634
687
  export type UpdateAppInstallationOAuthApprovalPayload = Wire.UpdateAppInstallationOAuthApprovalPayload;
688
+
689
+ /** Check exact installation grants; legacy app-name grants authorize only the default instance. */
690
+ export function hasAppInstallationAccess(
691
+ token: AuthTokenPayload,
692
+ installation: { id: string; project: string; instance_key?: string; manifest: { name: string } },
693
+ ui = false,
694
+ ): boolean {
695
+ if (token.project?.id !== installation.project) return false;
696
+ const grants = token.app_installations;
697
+ if (grants !== undefined) {
698
+ if (grants.version !== 1 || grants.project_id !== installation.project) return false;
699
+ if (grants.ids.includes(installation.id)) {
700
+ return !ui || !grants.ui_restrictions?.includes(installation.id);
701
+ }
702
+ }
703
+ // Default app-name grants survive reinstalling the same app with a new installation ID.
704
+ // Named instances never inherit these grants, including on refreshed running-agent tokens.
705
+ return (
706
+ (!installation.instance_key || installation.instance_key === 'default') &&
707
+ (token.apps ?? []).includes(installation.manifest.name) &&
708
+ (!ui || !token.ui_restrictions?.includes(installation.manifest.name))
709
+ );
710
+ }
711
+
712
+ /** Persist this effective collection in catalogs so discovery and execution use the same namespace. */
713
+ export function resolveInstallationCollection(
714
+ collection: ToolCollectionObject,
715
+ installation: Pick<AppInstallation, 'instance_key' | 'namespace_overrides' | 'namespace_conflicts'>,
716
+ ): ToolCollectionObject {
717
+ if (collection.type === 'mcp' && installation.namespace_conflicts?.includes(collection.id)) {
718
+ throw new Error(`Namespace conflict for MCP collection '${collection.id}'; resolve it in project app settings`);
719
+ }
720
+ if (collection.type !== 'mcp') return collection;
721
+ const overrides = installation.namespace_overrides;
722
+ if (overrides && Object.hasOwn(overrides, collection.id)) {
723
+ const namespace = overrides[collection.id];
724
+ if (typeof namespace === 'string' && namespace.length > 0) return { ...collection, namespace };
725
+ } else if (!installation.instance_key || installation.instance_key === 'default') {
726
+ return collection;
727
+ }
728
+ throw new Error(`Namespace allocation required for MCP collection '${collection.id}'`);
729
+ }
730
+
731
+ export type AppInstanceAvailability = Wire.AppInstanceAvailability;
732
+ export type McpPublicParameter = Wire.McpPublicParameter;
733
+ export type McpSecretParameter = Wire.McpSecretParameter;
734
+ export type McpConnectionParameter = Wire.McpConnectionParameter;
735
+
736
+ /** Whether a manifest can safely back an additional MCP-only installation. */
737
+ export function isMcpOnlyInstanceManifest(
738
+ manifest: Pick<AppManifestData, 'endpoint' | 'ui' | 'capabilities' | 'tool_collections'>,
739
+ ): boolean {
740
+ return (
741
+ !manifest.endpoint &&
742
+ !manifest.ui &&
743
+ !manifest.capabilities?.some((capability) => capability !== 'tools') &&
744
+ !!manifest.tool_collections?.length &&
745
+ manifest.tool_collections.every((collection) => normalizeToolCollection(collection).type === 'mcp')
746
+ );
747
+ }
@@ -2,6 +2,7 @@ import type {
2
2
  CompletionResult,
3
3
  ExecutionTokenUsage,
4
4
  JSONSchema,
5
+ // biome-ignore lint/suspicious/noDeprecatedImports: Legacy output_modality contracts still require this enum.
5
6
  Modalities,
6
7
  PromptCacheDiagnostic,
7
8
  StatelessExecutionOptions,
@@ -62,3 +62,13 @@ export type OAuthLoginPayload = Wire.OAuthLoginPayload;
62
62
  export type OAuthLoginDecisionResponse = Wire.OAuthLoginDecisionResponse;
63
63
 
64
64
  export type OAuthLoginUserNotFoundResponse = Wire.OAuthLoginUserNotFoundResponse;
65
+
66
+ export type OidcFederationConnectionPayload = Wire.OidcFederationConnectionPayload;
67
+
68
+ export type OidcFederationConnection = Wire.OidcFederationConnection;
69
+
70
+ export type OidcFederationConnectionArray = Wire.OidcFederationConnectionArray;
71
+
72
+ export type OAuthTokenExchangeRequest = Wire.OAuthTokenExchangeRequest;
73
+
74
+ export type OAuthTokenExchangeResponse = Wire.OAuthTokenExchangeResponse;
@@ -15,4 +15,5 @@ export * from './schedule.js';
15
15
  export * from './signals.js';
16
16
  export * from './store.js';
17
17
  export * from './task.js';
18
+ export * from './text-limits.js';
18
19
  export * from './workflow.js';
@@ -1236,8 +1236,7 @@ export const ContentTypeIntakePolicySchema: JSONObject = {
1236
1236
  },
1237
1237
  },
1238
1238
  effort: {
1239
- type: 'string',
1240
- enum: ['none', 'high'],
1239
+ $ref: '#/$defs/ReasoningEffort',
1241
1240
  },
1242
1241
  random_seed: {
1243
1242
  type: 'integer',