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

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 (126) hide show
  1. package/lib/api-contract/components.generated.json +1243 -121
  2. package/lib/api-schemas/agent-runs.d.ts +52 -0
  3. package/lib/api-schemas/agent-runs.d.ts.map +1 -1
  4. package/lib/api-schemas/agent-runs.js +5 -4
  5. package/lib/api-schemas/agent-runs.js.map +1 -1
  6. package/lib/api-schemas/apikey.d.ts +3 -40
  7. package/lib/api-schemas/apikey.d.ts.map +1 -1
  8. package/lib/api-schemas/apikey.js +3 -17
  9. package/lib/api-schemas/apikey.js.map +1 -1
  10. package/lib/api-schemas/app-lifecycle.d.ts +126 -0
  11. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
  12. package/lib/api-schemas/app-lifecycle.js +134 -1
  13. package/lib/api-schemas/app-lifecycle.js.map +1 -1
  14. package/lib/api-schemas/app-runtime.d.ts +466 -0
  15. package/lib/api-schemas/app-runtime.d.ts.map +1 -1
  16. package/lib/api-schemas/app-runtime.js +50 -1
  17. package/lib/api-schemas/app-runtime.js.map +1 -1
  18. package/lib/api-schemas/apps.d.ts +73 -0
  19. package/lib/api-schemas/apps.d.ts.map +1 -1
  20. package/lib/api-schemas/apps.js +41 -0
  21. package/lib/api-schemas/apps.js.map +1 -1
  22. package/lib/api-schemas/audit-trail.d.ts.map +1 -1
  23. package/lib/api-schemas/audit-trail.js +5 -5
  24. package/lib/api-schemas/audit-trail.js.map +1 -1
  25. package/lib/api-schemas/content.d.ts +25 -0
  26. package/lib/api-schemas/content.d.ts.map +1 -1
  27. package/lib/api-schemas/content.js +5 -5
  28. package/lib/api-schemas/content.js.map +1 -1
  29. package/lib/api-schemas/data-store.d.ts.map +1 -1
  30. package/lib/api-schemas/data-store.js +17 -1
  31. package/lib/api-schemas/data-store.js.map +1 -1
  32. package/lib/api-schemas/document-processing.d.ts +15 -0
  33. package/lib/api-schemas/document-processing.d.ts.map +1 -1
  34. package/lib/api-schemas/events.d.ts +45 -0
  35. package/lib/api-schemas/events.d.ts.map +1 -1
  36. package/lib/api-schemas/inference-profile.d.ts +30 -0
  37. package/lib/api-schemas/inference-profile.d.ts.map +1 -1
  38. package/lib/api-schemas/interaction.d.ts +405 -0
  39. package/lib/api-schemas/interaction.d.ts.map +1 -1
  40. package/lib/api-schemas/interaction.js +38 -7
  41. package/lib/api-schemas/interaction.js.map +1 -1
  42. package/lib/api-schemas/oauth-server.d.ts +128 -0
  43. package/lib/api-schemas/oauth-server.d.ts.map +1 -1
  44. package/lib/api-schemas/oauth-server.js +95 -2
  45. package/lib/api-schemas/oauth-server.js.map +1 -1
  46. package/lib/api-schemas/process.d.ts +11 -0
  47. package/lib/api-schemas/process.d.ts.map +1 -1
  48. package/lib/api-schemas/process.js +12 -0
  49. package/lib/api-schemas/process.js.map +1 -1
  50. package/lib/api-schemas/project-configuration.d.ts +50 -0
  51. package/lib/api-schemas/project-configuration.d.ts.map +1 -1
  52. package/lib/api-schemas/project.d.ts +75 -0
  53. package/lib/api-schemas/project.d.ts.map +1 -1
  54. package/lib/api-schemas/prompt.d.ts.map +1 -1
  55. package/lib/api-schemas/prompt.js +5 -2
  56. package/lib/api-schemas/prompt.js.map +1 -1
  57. package/lib/api-schemas/registry.d.ts +1271 -30
  58. package/lib/api-schemas/registry.d.ts.map +1 -1
  59. package/lib/api-schemas/registry.js +39 -9
  60. package/lib/api-schemas/registry.js.map +1 -1
  61. package/lib/api-schemas/schema-primitives.d.ts +8 -0
  62. package/lib/api-schemas/schema-primitives.d.ts.map +1 -1
  63. package/lib/api-schemas/schema-primitives.js +8 -0
  64. package/lib/api-schemas/schema-primitives.js.map +1 -1
  65. package/lib/api-schemas/store.d.ts +250 -0
  66. package/lib/api-schemas/store.d.ts.map +1 -1
  67. package/lib/api-schemas/store.js +3 -3
  68. package/lib/api-schemas/store.js.map +1 -1
  69. package/lib/api-schemas/task.d.ts.map +1 -1
  70. package/lib/api-schemas/task.js +3 -2
  71. package/lib/api-schemas/task.js.map +1 -1
  72. package/lib/api-schemas/workflow-runs.d.ts +10 -0
  73. package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
  74. package/lib/apikey.d.ts +7 -2
  75. package/lib/apikey.d.ts.map +1 -1
  76. package/lib/apikey.js.map +1 -1
  77. package/lib/apps.d.ts +37 -1
  78. package/lib/apps.d.ts.map +1 -1
  79. package/lib/apps.js +74 -3
  80. package/lib/apps.js.map +1 -1
  81. package/lib/interaction.d.ts +3 -3
  82. package/lib/interaction.d.ts.map +1 -1
  83. package/lib/interaction.js.map +1 -1
  84. package/lib/oauth-server.d.ts +5 -0
  85. package/lib/oauth-server.d.ts.map +1 -1
  86. package/lib/store/index.d.ts +1 -0
  87. package/lib/store/index.d.ts.map +1 -1
  88. package/lib/store/index.js +1 -0
  89. package/lib/store/index.js.map +1 -1
  90. package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
  91. package/lib/store/intake-policy-schema.generated.js +1 -2
  92. package/lib/store/intake-policy-schema.generated.js.map +1 -1
  93. package/lib/store/text-limits.d.ts +18 -0
  94. package/lib/store/text-limits.d.ts.map +1 -0
  95. package/lib/store/text-limits.js +56 -0
  96. package/lib/store/text-limits.js.map +1 -0
  97. package/lib/vertesia-common.js +4 -2
  98. package/lib/vertesia-common.js.map +1 -1
  99. package/lib/wire-types.generated.d.ts +261 -34
  100. package/lib/wire-types.generated.d.ts.map +1 -1
  101. package/package.json +12 -7
  102. package/src/api-contract/components.generated.json +1243 -121
  103. package/src/api-schemas/agent-runs.ts +5 -3
  104. package/src/api-schemas/apikey.ts +3 -21
  105. package/src/api-schemas/app-lifecycle.ts +163 -1
  106. package/src/api-schemas/app-runtime.ts +54 -0
  107. package/src/api-schemas/apps.ts +46 -0
  108. package/src/api-schemas/audit-trail.ts +5 -5
  109. package/src/api-schemas/content.ts +5 -5
  110. package/src/api-schemas/data-store.ts +19 -1
  111. package/src/api-schemas/interaction.ts +48 -7
  112. package/src/api-schemas/oauth-server.ts +103 -2
  113. package/src/api-schemas/process.ts +13 -0
  114. package/src/api-schemas/prompt.ts +5 -2
  115. package/src/api-schemas/registry.ts +60 -6
  116. package/src/api-schemas/schema-primitives.ts +9 -0
  117. package/src/api-schemas/store.ts +3 -3
  118. package/src/api-schemas/task.ts +3 -2
  119. package/src/apikey.ts +8 -2
  120. package/src/apps.ts +116 -3
  121. package/src/interaction.ts +6 -3
  122. package/src/oauth-server.ts +10 -0
  123. package/src/store/index.ts +1 -0
  124. package/src/store/intake-policy-schema.generated.ts +1 -2
  125. package/src/store/text-limits.ts +64 -0
  126. package/src/wire-types.generated.ts +281 -34
@@ -18,6 +18,7 @@ import {
18
18
  import {
19
19
  AgentEvaluateRequestSchema,
20
20
  AgentResourceReferenceSchema,
21
+ AgentRunIdempotencyKeySchema,
21
22
  AgentSearchScopeSchema,
22
23
  AgentToolApprovalModeSchema,
23
24
  ConversationEnrichmentFields,
@@ -36,7 +37,7 @@ import {
36
37
  RecordProcessRunPayloadSchema,
37
38
  } from './process.js';
38
39
  import { AgentBudgetConfigurationSchema, AgentCheckpointConfigurationSchema } from './project-configuration.js';
39
- import { nullableStringSchema } from './schema-primitives.js';
40
+ import { nullableStringSchema, PageCountSchema } from './schema-primitives.js';
40
41
  import { InteractionExecutionConfigurationSchema } from './store.js';
41
42
 
42
43
  // ----------------------------------------------------------------------------
@@ -1089,6 +1090,7 @@ export const CreateAgentRunPayloadSchema = z
1089
1090
  .string()
1090
1091
  .meta({ description: 'Principal ref of the user who initiated the run (for server-to-server forwarding)' })
1091
1092
  .optional(),
1093
+ idempotency_key: AgentRunIdempotencyKeySchema.optional(),
1092
1094
  })
1093
1095
  .meta({ id: 'CreateAgentRunPayload', description: 'Payload to create and start a new agent run.' });
1094
1096
 
@@ -1438,8 +1440,8 @@ export const ListAgentRunsQuerySchema = z
1438
1440
  .string()
1439
1441
  .meta({ description: 'Only return runs started at or before this date', format: 'date-time' })
1440
1442
  .optional(),
1441
- limit: z.number().meta({ description: 'Maximum number of results (default: 50)' }).optional(),
1442
- offset: z.number().meta({ description: 'Offset for pagination' }).optional(),
1443
+ limit: PageCountSchema.meta({ description: 'Maximum number of results (default: 50)' }).optional(),
1444
+ offset: PageCountSchema.meta({ description: 'Offset for pagination' }).optional(),
1443
1445
  cursor: z.string().meta({ description: 'Cursor for stable pagination' }).optional(),
1444
1446
  schedule_id: z.string().meta({ description: 'Filter by schedule ID' }).optional(),
1445
1447
  type: AgentRunTypeSchema.meta({ description: 'Filter by run type' }).optional(),
@@ -17,12 +17,6 @@ export const ApiKeyListQuerySchema = z
17
17
  })
18
18
  .meta({ id: 'ApiKeyListQuery' });
19
19
 
20
- export const ApiKeyReadQuerySchema = z
21
- .object({
22
- withValue: z.boolean().optional(),
23
- })
24
- .meta({ id: 'ApiKeyReadQuery' });
25
-
26
20
  /**
27
21
  * `z.literal` rather than `z.enum`, because the enum has exactly one member and the document
28
22
  * publishes it as `const: 'sk'`. A one-member `enum: ['sk']` would validate identically but change
@@ -70,9 +64,8 @@ export const ProjectRefArraySchema = z.array(ProjectRefSchema).meta({ id: 'Proje
70
64
  * plain string all the way down, which is why tightening it there would have turned stored data into
71
65
  * a 500 on read.
72
66
  *
73
- * `value` is deliberately absent. A key's secret is published only by the two components that
74
- * declare it — {@link ApiKeyWithValueSchema} on creation and {@link ApiKeyReadResponseSchema} on an
75
- * explicit `?withValue=true` read — so a handler cannot leak it by returning the wrong shape.
67
+ * `value` is deliberately absent. A key's secret is published only on creation, by
68
+ * {@link ApiKeyWithValueSchema}, so a handler cannot leak it by returning the wrong shape.
76
69
  */
77
70
  export const ApiKeySchema = z
78
71
  .object({
@@ -118,20 +111,11 @@ export const ApiKeySchema = z
118
111
 
119
112
  export const ApiKeyArraySchema = z.array(ApiKeySchema).meta({ id: 'ApiKeyArray' });
120
113
 
121
- /** The creation response: the only time the secret is returned unconditionally. */
114
+ /** The creation response: the only time the secret is ever returned. */
122
115
  export const ApiKeyWithValueSchema = ApiKeySchema.extend({
123
116
  value: z.string(),
124
117
  }).meta({ id: 'ApiKeyWithValue' });
125
118
 
126
- /**
127
- * The single-key read. `value` is present only when the caller asked for it AND holds
128
- * `api_key:secret_read`, so it is optional here where creation makes it required — which is exactly
129
- * why the two cannot share one component.
130
- */
131
- export const ApiKeyReadResponseSchema = ApiKeySchema.extend({
132
- value: z.string().optional(),
133
- }).meta({ id: 'ApiKeyReadResponse' });
134
-
135
119
  /**
136
120
  * What `POST /apikeys` accepts.
137
121
  *
@@ -199,12 +183,10 @@ export const DeleteOperationResultSchema = z
199
183
  .meta({ id: 'DeleteOperationResult' });
200
184
 
201
185
  export type ApiKeyListQueryFromSchema = Wire.ApiKeyListQueryFromSchema;
202
- export type ApiKeyReadQueryFromSchema = Wire.ApiKeyReadQueryFromSchema;
203
186
  export type ProjectRefArrayFromSchema = Wire.ProjectRefArrayFromSchema;
204
187
  export type ApiKeyFromSchema = Wire.ApiKeyFromSchema;
205
188
  export type ApiKeyArrayFromSchema = Wire.ApiKeyArrayFromSchema;
206
189
  export type ApiKeyWithValueFromSchema = Wire.ApiKeyWithValueFromSchema;
207
- export type ApiKeyReadResponseFromSchema = Wire.ApiKeyReadResponseFromSchema;
208
190
  export type CreateApiKeyPayloadFromSchema = Wire.CreateApiKeyPayloadFromSchema;
209
191
  export type UpdateApiKeyPayloadFromSchema = Wire.UpdateApiKeyPayloadFromSchema;
210
192
  export type AuthTokenResponseFromSchema = Wire.AuthTokenResponseFromSchema;
@@ -1,6 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { APPGEN_PACKAGE_SPEC_PATTERN } from '../appgen.js';
3
- import { AppAccessControlSchema, AppAvailableInSchema, MCPToolAnnotationsSchema } from './apps.js';
3
+ import {
4
+ AppAccessControlSchema,
5
+ AppAvailableInSchema,
6
+ AppSourceConfigSchema,
7
+ MCPToolAnnotationsSchema,
8
+ } from './apps.js';
4
9
  import { EventCategorySchema } from './audit-trail.js';
5
10
  import { AgentBudgetConfigurationSchema } from './project-configuration.js';
6
11
 
@@ -95,6 +100,12 @@ export const AppScaffoldModuleSchema = z
95
100
  .enum(['service', 'assistant', 'content-app', 'examples'])
96
101
  .meta({ id: 'AppScaffoldModule' });
97
102
 
103
+ export const AppScaffoldSourceModeSchema = z.enum(['generate', 'existing']).meta({
104
+ id: 'AppScaffoldSourceMode',
105
+ description:
106
+ 'How App Builder should use a connected source repository. `generate` writes a starter app to an empty branch; `existing` only binds the repository.',
107
+ });
108
+
98
109
  export const AppBuildTriggerSchema = z.enum(['ui', 'git_push', 'agent', 'api']).meta({ id: 'AppBuildTrigger' });
99
110
 
100
111
  export const Extract_AppVersionGitRefType_branch_tag_commitSchema = z
@@ -405,6 +416,22 @@ export const AppVersionGitSourceSchema = z
405
416
  })
406
417
  .meta({ id: 'AppVersionGitSource' });
407
418
 
419
+ export const AppGithubRepositoryCreationSchema = z
420
+ .strictObject({
421
+ name: z
422
+ .string()
423
+ .trim()
424
+ .min(1)
425
+ .max(100)
426
+ .regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/)
427
+ .meta({ description: 'Name of the empty GitHub repository to create in the verified installation.' }),
428
+ private: z
429
+ .boolean()
430
+ .optional()
431
+ .meta({ description: 'Create a private repository. Defaults to true when omitted.' }),
432
+ })
433
+ .meta({ id: 'AppGithubRepositoryCreation' });
434
+
408
435
  export const StartAppScaffoldRequestSchema = z
409
436
  .strictObject({
410
437
  app_id: z.string().meta({
@@ -431,9 +458,115 @@ export const StartAppScaffoldRequestSchema = z
431
458
  description: 'Start an initial app version build after the source has been pushed. Defaults to true.',
432
459
  })
433
460
  .optional(),
461
+ source_mode: AppScaffoldSourceModeSchema.optional().meta({
462
+ description:
463
+ 'Explicit source setup behavior for external repositories. Omit to retain the legacy automatic behavior.',
464
+ }),
465
+ source: AppSourceConfigSchema.optional().meta({
466
+ description:
467
+ 'Source repository to bind to the app. Omit to create and scaffold a Vertesia-managed repository.',
468
+ }),
469
+ github_connection_id: z.string().optional().meta({
470
+ description: 'Short-lived proof that the current user verified the selected GitHub installation.',
471
+ }),
472
+ github_repository_creation: AppGithubRepositoryCreationSchema.optional().meta({
473
+ description:
474
+ 'Create an empty repository in the verified GitHub installation before generating the app source.',
475
+ }),
434
476
  })
435
477
  .meta({ id: 'StartAppScaffoldRequest' });
436
478
 
479
+ export const AppGithubConfigurationSchema = z
480
+ .strictObject({
481
+ enabled: z.boolean(),
482
+ app_slug: z.string().optional(),
483
+ install_url: z.string().optional(),
484
+ relay_url: z.string().optional(),
485
+ })
486
+ .meta({ id: 'AppGithubConfiguration' });
487
+
488
+ export const StartAppGithubAuthorizationResponseSchema = z
489
+ .strictObject({ authorization_url: z.string() })
490
+ .meta({ id: 'StartAppGithubAuthorizationResponse' });
491
+
492
+ export const ExchangeAppGithubAuthorizationRequestSchema = z
493
+ .strictObject({ code: z.string(), state: z.string() })
494
+ .meta({ id: 'ExchangeAppGithubAuthorizationRequest' });
495
+
496
+ export const AppGithubRepositoriesQuerySchema = z
497
+ .strictObject({
498
+ connection_id: z.string().trim().min(1),
499
+ installation_id: z.string().trim().min(1),
500
+ })
501
+ .meta({ id: 'AppGithubRepositoriesQuery' });
502
+
503
+ export const AppGithubInstallationSchema = z
504
+ .strictObject({
505
+ id: z.string(),
506
+ account_login: z.string(),
507
+ account_type: z.string().optional(),
508
+ repository_selection: z.enum(['all', 'selected']),
509
+ })
510
+ .meta({ id: 'AppGithubInstallation' });
511
+
512
+ export const AppGithubAccountSchema = z
513
+ .strictObject({
514
+ login: z.string(),
515
+ account_type: z.string(),
516
+ avatar_url: z.string().optional(),
517
+ })
518
+ .meta({ id: 'AppGithubAccount' });
519
+
520
+ export const ExchangeAppGithubAuthorizationResponseSchema = z
521
+ .strictObject({
522
+ connection_id: z.string(),
523
+ installations: z.array(AppGithubInstallationSchema),
524
+ accounts: z.array(AppGithubAccountSchema),
525
+ })
526
+ .meta({ id: 'ExchangeAppGithubAuthorizationResponse' });
527
+
528
+ export const AppGithubRepositorySchema = z
529
+ .strictObject({
530
+ name: z.string(),
531
+ full_name: z.string(),
532
+ private: z.boolean(),
533
+ default_branch: z.string(),
534
+ html_url: z.string(),
535
+ })
536
+ .meta({ id: 'AppGithubRepository' });
537
+
538
+ export const AppGithubRepositoryListSchema = z
539
+ .strictObject({ repositories: z.array(AppGithubRepositorySchema) })
540
+ .meta({ id: 'AppGithubRepositoryList' });
541
+
542
+ export const AppGithubRepositorySetupQuerySchema = z
543
+ .strictObject({
544
+ connection_id: z.string().trim().min(1),
545
+ installation_id: z.string().trim().min(1),
546
+ repository: z.string().trim().min(1),
547
+ branch: z.string().trim().min(1),
548
+ })
549
+ .meta({ id: 'AppGithubRepositorySetupQuery' });
550
+
551
+ export const AppGithubBranchStateSchema = z
552
+ .strictObject({
553
+ name: z.string(),
554
+ exists: z.boolean(),
555
+ empty: z.boolean(),
556
+ })
557
+ .meta({ id: 'AppGithubBranchState' });
558
+
559
+ export const AppGithubRepositorySetupSchema = z
560
+ .strictObject({
561
+ default_branch: z.string(),
562
+ branches: z.array(z.string()),
563
+ selected_branch: AppGithubBranchStateSchema,
564
+ })
565
+ .meta({
566
+ id: 'AppGithubRepositorySetup',
567
+ description: 'Branch choices and write-safety state for a verified GitHub repository.',
568
+ });
569
+
437
570
  export const StartAppDevelopmentTaskRequestSchema = z
438
571
  .strictObject({
439
572
  prompt: z.string().min(1).meta({ description: 'Development request passed to the App Builder parent.' }),
@@ -685,6 +818,7 @@ export const AppVersionStorageSchema = z
685
818
  export const AppToolCollectionSchema = z
686
819
  .strictObject({
687
820
  name: z.string().meta({ description: 'The collection name' }),
821
+ collection_id: z.string().optional(),
688
822
  description: z.string().meta({ description: 'Optional collection description' }).optional(),
689
823
  tools: z.array(AgentToolDefinitionSchema).meta({ description: 'the tools provided by this collection' }),
690
824
  })
@@ -855,6 +989,30 @@ export const UpsertAppVersionRequestSchema = z
855
989
  export const AppInstallationPayloadSchema = z
856
990
  .strictObject({
857
991
  app_id: z.string(),
992
+ instance_key: z
993
+ .string()
994
+ .regex(/^[a-z][a-z0-9_-]{0,31}$/)
995
+ .optional(),
996
+ display_name: z.string().max(120).optional().meta({
997
+ description: 'Optional instance label. Send an empty string to clear the saved label; omit to preserve it.',
998
+ }),
999
+ namespace_overrides: z
1000
+ .record(
1001
+ z.string(),
1002
+ z
1003
+ .string()
1004
+ .max(24)
1005
+ .regex(/^[a-z]([a-z0-9]|_[a-z0-9])*_?$/),
1006
+ )
1007
+ .optional(),
1008
+ mcp_shared_parameters: z.record(z.string(), z.string().nullable()).optional().meta({
1009
+ description:
1010
+ 'Shared MCP parameter overrides. Omitted values are retained; null clears an override or restores its default.',
1011
+ }),
1012
+ mcp_parameters: z.record(z.string(), z.record(z.string(), z.string().nullable())).optional().meta({
1013
+ description:
1014
+ 'Installation parameter overrides by MCP collection id. Omit to preserve; null clears an override. Secret inputs are write-only.',
1015
+ }),
858
1016
  settings: z.looseObject({}).optional(),
859
1017
  access_control: z
860
1018
  .union([AppAccessControlSchema, z.null()])
@@ -958,3 +1116,7 @@ export const SystemPackageQuerySchema = z
958
1116
  .optional(),
959
1117
  })
960
1118
  .meta({ id: 'SystemPackageQuery' });
1119
+
1120
+ export const AppInstanceAvailabilitySchema = z
1121
+ .strictObject({ enabled: z.boolean() })
1122
+ .meta({ id: 'AppInstanceAvailability' });
@@ -20,6 +20,7 @@ import {
20
20
  AppSourceConfigSchema,
21
21
  AppUIConfigSchema,
22
22
  MCPOAuthConfigSchema,
23
+ McpConnectionParameterSchema,
23
24
  ToolCollectionObjectSchema,
24
25
  } from './apps.js';
25
26
  import { AuditMeterSchema } from './audit-trail.js';
@@ -262,12 +263,28 @@ const appOAuthApprovalSchema = z.strictObject({
262
263
  approved_at: z.string(),
263
264
  });
264
265
 
266
+ const mcpConfigurationSchema = z.strictObject({
267
+ revision: z.string(),
268
+ values: z.record(z.string(), z.record(z.string(), z.string())),
269
+ configured_secrets: z.record(z.string(), z.array(z.string())),
270
+ shared_values: z.record(z.string(), z.string()).optional(),
271
+ configured_shared_secrets: z.array(z.string()).optional(),
272
+ });
273
+
265
274
  export const AppInstallationSchema = z
266
275
  .strictObject({
267
276
  id: z.string(),
268
277
  project: z.string(),
278
+ instance_key: z.string().optional(),
279
+ display_name: z.string().optional(),
280
+ installation_version: z.literal(1).optional(),
281
+ namespace_overrides: z.record(z.string(), z.string()).optional(),
282
+ reserved_namespaces: z.array(z.string()).min(1).optional(),
283
+ namespace_conflicts: z.array(z.string()).optional(),
269
284
  manifest: z.string(),
285
+ mcp_configuration: mcpConfigurationSchema.optional(),
270
286
  oauth_approval: appOAuthApprovalSchema.optional(),
287
+ oauth_client_id: z.string().optional(),
271
288
  settings: z.looseObject({}).optional(),
272
289
  tool_allowlist: z
273
290
  .array(z.string())
@@ -336,9 +353,27 @@ export const AppDashboardDefinitionSchema = z
336
353
  'Dashboard definition contributed by an app package.\n\nApp dashboard IDs are local to the app. The platform exposes them as `app:<app_name>:<id>` when listing or retrieving dashboards.',
337
354
  });
338
355
 
356
+ export const AppOAuthClientConfigSchema = z
357
+ .strictObject({
358
+ redirect_uris: z.array(z.string().url()).min(1),
359
+ })
360
+ .meta({
361
+ id: 'AppOAuthClientConfig',
362
+ description:
363
+ 'Standalone public PKCE OAuth. Installation automatically provisions an app client with these exact callback URLs.',
364
+ });
365
+
339
366
  export const AppManifestDataSchema = z
340
367
  .strictObject({
368
+ parameters: z
369
+ .record(z.string().regex(/^[a-z][a-z0-9_]*$/), McpConnectionParameterSchema)
370
+ .optional()
371
+ .meta({
372
+ description:
373
+ 'Shared MCP installation parameters available to every collection. Collection-local names must not overlap.',
374
+ }),
341
375
  oauth_scopes: z.array(z.string()).optional(),
376
+ oauth_client: AppOAuthClientConfigSchema.optional(),
342
377
  name: z.string().meta({
343
378
  description: 'The name of the app, used as the id in the system. Must be in kebab case (e.g. my-app).',
344
379
  }),
@@ -519,7 +554,9 @@ export const CompositeAppMessageOverridesSchema = z
519
554
 
520
555
  export const AppManifestSchema = z
521
556
  .strictObject({
557
+ parameters: AppManifestDataSchema.shape.parameters,
522
558
  oauth_scopes: z.array(z.string()).optional(),
559
+ oauth_client: AppOAuthClientConfigSchema.optional(),
523
560
  edit_revision: EditRevisionSchema,
524
561
  name: z.string().meta({
525
562
  description: 'The name of the app, used as the id in the system. Must be in kebab case (e.g. my-app).',
@@ -639,7 +676,15 @@ export const AppInstallationWithManifestSchema = z
639
676
  .strictObject({
640
677
  id: z.string(),
641
678
  project: z.string(),
679
+ instance_key: z.string().optional(),
680
+ display_name: z.string().optional(),
681
+ installation_version: z.literal(1).optional(),
682
+ namespace_overrides: z.record(z.string(), z.string()).optional(),
683
+ reserved_namespaces: z.array(z.string()).min(1).optional(),
684
+ namespace_conflicts: z.array(z.string()).optional(),
685
+ mcp_configuration: mcpConfigurationSchema.optional(),
642
686
  oauth_approval: appOAuthApprovalSchema.optional(),
687
+ oauth_client_id: z.string().optional(),
643
688
  settings: z.looseObject({}).optional(),
644
689
  tool_allowlist: z
645
690
  .array(z.string())
@@ -685,7 +730,15 @@ export const AppInstallationListEntrySchema = z
685
730
  .strictObject({
686
731
  id: z.string(),
687
732
  project: z.string(),
733
+ instance_key: z.string().optional(),
734
+ display_name: z.string().optional(),
735
+ installation_version: z.literal(1).optional(),
736
+ namespace_overrides: z.record(z.string(), z.string()).optional(),
737
+ reserved_namespaces: z.array(z.string()).min(1).optional(),
738
+ namespace_conflicts: z.array(z.string()).optional(),
739
+ mcp_configuration: mcpConfigurationSchema.optional(),
688
740
  oauth_approval: appOAuthApprovalSchema.optional(),
741
+ oauth_client_id: z.string().optional(),
689
742
  settings: z.looseObject({}).optional(),
690
743
  tool_allowlist: z
691
744
  .array(z.string())
@@ -922,6 +975,7 @@ export const AppEventSubscriptionDefinitionSchema = z
922
975
 
923
976
  export const AppPackageSchema = z
924
977
  .strictObject({
978
+ oauth_client: AppOAuthClientConfigSchema.optional(),
925
979
  oauth_scopes: z
926
980
  .array(z.string())
927
981
  .meta({ description: 'OAuth scopes requested by the app. Users must consent to project permissions.' })
@@ -208,10 +208,39 @@ const toolCollectionBaseShape = {
208
208
  }),
209
209
  };
210
210
 
211
+ const mcpParameterFields = {
212
+ title: z.string().optional(),
213
+ description: z.string().optional(),
214
+ required: z.boolean().optional(),
215
+ };
216
+
217
+ // Separate variants forbid plaintext defaults for secret parameters in the emitted contract too.
218
+ export const McpPublicParameterSchema = z
219
+ .strictObject({
220
+ ...mcpParameterFields,
221
+ type: z.literal('string').optional(),
222
+ default: z.string().optional(),
223
+ })
224
+ .meta({ id: 'McpPublicParameter' });
225
+ export const McpSecretParameterSchema = z
226
+ .strictObject({
227
+ ...mcpParameterFields,
228
+ type: z.literal('secret'),
229
+ })
230
+ .meta({ id: 'McpSecretParameter' });
231
+ export const McpConnectionParameterSchema = z
232
+ .union([McpPublicParameterSchema, McpSecretParameterSchema])
233
+ .meta({ id: 'McpConnectionParameter' });
234
+
211
235
  export const MCPToolCollectionObjectSchema = z
212
236
  .strictObject({
213
237
  ...toolCollectionBaseShape,
214
238
  type: z.literal('mcp'),
239
+ parameters: z.record(z.string().regex(/^[a-z][a-z0-9_]*$/), McpConnectionParameterSchema).optional(),
240
+ headers: z.record(z.string(), z.string()).optional().meta({
241
+ description:
242
+ 'HTTP header templates. Reference declared installation parameters with {{name}}. Never embed secrets.',
243
+ }),
215
244
  id: z.string().meta({
216
245
  description:
217
246
  'Stable identifier for this collection. Used to key oauth_bindings on AppInstallation — ' +
@@ -318,9 +347,23 @@ export const ToolCollectionObjectSchema = z
318
347
  .discriminatedUnion('type', [MCPToolCollectionObjectSchema, VertesiaSDKToolCollectionObjectSchema])
319
348
  .meta({ id: 'ToolCollectionObject' });
320
349
 
350
+ export const AppGitSourceProviderSchema = z.enum(['vertesia', 'github']).meta({ id: 'AppGitSourceProvider' });
351
+
321
352
  export const AppGitSourceConfigSchema = z
322
353
  .strictObject({
354
+ provider: AppGitSourceProviderSchema.optional().meta({
355
+ description:
356
+ 'Repository provider. Missing values are treated as `vertesia` for apps created before provider support.',
357
+ }),
323
358
  url: z.string().optional(),
359
+ installation_id: z
360
+ .string()
361
+ .optional()
362
+ .meta({ description: 'Verified GitHub App installation id. Required when provider is `github`.' }),
363
+ repository: z
364
+ .string()
365
+ .optional()
366
+ .meta({ description: 'GitHub repository in `owner/name` form. Required when provider is `github`.' }),
324
367
  default_branch: z.string().optional(),
325
368
  production_branch: z.string().optional(),
326
369
  development_branch: z.string().optional(),
@@ -343,7 +386,10 @@ export const AppManifestSourceSchema = z
343
386
  .strictObject({
344
387
  kind: z.literal('git'),
345
388
  git: z.strictObject({
389
+ provider: AppGitSourceProviderSchema.optional(),
346
390
  url: z.string(),
391
+ installation_id: z.string().optional(),
392
+ repository: z.string().optional(),
347
393
  default_branch: z.string().optional(),
348
394
  production_branch: z.string().optional(),
349
395
  development_branch: z.string().optional(),
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { AUDIT_ACTIONS, AUDIT_AGGREGATION_DIMENSIONS } from '../audit-trail.js';
3
3
  import { NumberValueMapSchema } from './interaction.js';
4
+ import { PageCountSchema } from './schema-primitives.js';
4
5
 
5
6
  // The audit trail: the events `GET /audit-trail` pages through and the aggregation `POST
6
7
  // /audit-trail/aggregate` computes over them.
@@ -244,11 +245,10 @@ export const AuditTrailQuerySchema = z
244
245
  .optional(),
245
246
  from: z.string().meta({ description: 'Start time (ISO string)' }).optional(),
246
247
  to: z.string().meta({ description: 'End time (ISO string)' }).optional(),
247
- limit: z
248
- .number()
249
- .meta({ description: 'Pagination: number of items to return (default 50, max 200)' })
250
- .optional(),
251
- offset: z.number().meta({ description: 'Pagination: offset' }).optional(),
248
+ limit: PageCountSchema.meta({
249
+ description: 'Pagination: number of items to return (default 50, max 200)',
250
+ }).optional(),
251
+ offset: PageCountSchema.meta({ description: 'Pagination: offset' }).optional(),
252
252
  })
253
253
  .meta({ id: 'AuditTrailQuery' });
254
254
 
@@ -7,7 +7,7 @@ import { ContentObjectStatus } from '../store/store.js';
7
7
  import { ContentObjectTypeRefSchema } from './app-lifecycle.js';
8
8
  import { StringArrayMapSchema } from './dashboard.js';
9
9
  import { ComputedFacetResponseSchema, FacetSpecSchema, SortOptionSchema } from './interaction.js';
10
- import { nullableStringSchema } from './schema-primitives.js';
10
+ import { nullableStringSchema, PageCountSchema } from './schema-primitives.js';
11
11
  import { ColumnLayoutSchema, ContentObjectTypeSchema, EmbeddingTypeEnabledMapSchema } from './store.js';
12
12
 
13
13
  export const scoreAggregationTypesSchema = z.enum(['rrf', 'rsf', 'smart']).meta({ id: 'scoreAggregationTypes' });
@@ -457,8 +457,8 @@ export const ComplexCollectionSearchQuerySchema = z
457
457
  parent: nullableStringSchema.optional(),
458
458
  dynamic: z.boolean().optional(),
459
459
  status: CollectionStatusSchema.optional(),
460
- limit: z.number().optional(),
461
- offset: z.number().optional(),
460
+ limit: PageCountSchema.optional(),
461
+ offset: PageCountSchema.optional(),
462
462
  name: z.string().optional(),
463
463
  type: z.string().optional(),
464
464
  types: z.array(z.string()).optional(),
@@ -1059,8 +1059,8 @@ export const CollectionMembersQuerySchema = z
1059
1059
  .object({
1060
1060
  status: z.string().optional(),
1061
1061
  type: z.string().optional(),
1062
- limit: z.number().optional(),
1063
- offset: z.number().optional(),
1062
+ limit: PageCountSchema.optional(),
1063
+ offset: PageCountSchema.optional(),
1064
1064
  })
1065
1065
  .meta({ id: 'CollectionMembersQuery' });
1066
1066
 
@@ -244,9 +244,27 @@ export const DataStoreDownloadInfoSchema = z
244
244
  })
245
245
  .meta({ id: 'DataStoreDownloadInfo' });
246
246
 
247
+ /**
248
+ * A store name is a display label, never a path: no `/` or `\`, no control characters (C0, DEL, C1),
249
+ * no leading dot (which also rules out `.` and `..`), and no leading or trailing space. The pattern
250
+ * avoids lookaheads and `\u` escapes so the Go (RE2) and Java generated clients accept it too.
251
+ */
252
+ const DATA_STORE_NAME_MAX_LENGTH = 128;
253
+ // biome-ignore lint/suspicious/noControlCharactersInRegex: the pattern exists to reject control characters.
254
+ const DATA_STORE_NAME_PATTERN = /^[^\x00-\x20\x7f-\x9f/\\.](?:[^\x00-\x1f\x7f-\x9f/\\]*[^\x00-\x20\x7f-\x9f/\\])?$/;
255
+
247
256
  export const CreateDataStorePayloadSchema = z
248
257
  .strictObject({
249
- name: z.string().meta({ description: 'Store name (unique within project)' }),
258
+ name: z
259
+ .string()
260
+ .min(1)
261
+ .max(DATA_STORE_NAME_MAX_LENGTH)
262
+ .regex(DATA_STORE_NAME_PATTERN)
263
+ .meta({
264
+ description:
265
+ 'Store name (unique within project). 1 to 128 characters; must not contain `/`, `\\` or ' +
266
+ 'control characters, start with a dot, or start or end with a space.',
267
+ }),
250
268
  description: z.string().meta({ description: 'Store description' }).optional(),
251
269
  tags: z.array(z.string()).meta({ description: 'Tags for organization' }).optional(),
252
270
  })