@vertesia/common 1.6.0-dev.20261009.095813Z → 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 (133) hide show
  1. package/lib/api-contract/components.generated.json +1329 -37
  2. package/lib/api-schemas/agent-runs.d.ts +410 -0
  3. package/lib/api-schemas/agent-runs.d.ts.map +1 -1
  4. package/lib/api-schemas/agent-runs.js +10 -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 +948 -6
  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 +199 -0
  22. package/lib/api-schemas/content.d.ts.map +1 -1
  23. package/lib/api-schemas/content.js +19 -5
  24. package/lib/api-schemas/content.js.map +1 -1
  25. package/lib/api-schemas/data-store.d.ts +30 -0
  26. package/lib/api-schemas/data-store.d.ts.map +1 -1
  27. package/lib/api-schemas/data-store.js +8 -0
  28. package/lib/api-schemas/data-store.js.map +1 -1
  29. package/lib/api-schemas/document-processing.d.ts +117 -0
  30. package/lib/api-schemas/document-processing.d.ts.map +1 -1
  31. package/lib/api-schemas/events.d.ts +351 -0
  32. package/lib/api-schemas/events.d.ts.map +1 -1
  33. package/lib/api-schemas/indexing.d.ts +1 -0
  34. package/lib/api-schemas/indexing.d.ts.map +1 -1
  35. package/lib/api-schemas/indexing.js +9 -0
  36. package/lib/api-schemas/indexing.js.map +1 -1
  37. package/lib/api-schemas/inference-profile.d.ts +234 -0
  38. package/lib/api-schemas/inference-profile.d.ts.map +1 -1
  39. package/lib/api-schemas/interaction.d.ts +3013 -0
  40. package/lib/api-schemas/interaction.d.ts.map +1 -1
  41. package/lib/api-schemas/interaction.js +9 -7
  42. package/lib/api-schemas/interaction.js.map +1 -1
  43. package/lib/api-schemas/oauth-server.d.ts +128 -0
  44. package/lib/api-schemas/oauth-server.d.ts.map +1 -1
  45. package/lib/api-schemas/oauth-server.js +95 -2
  46. package/lib/api-schemas/oauth-server.js.map +1 -1
  47. package/lib/api-schemas/process.d.ts +81 -0
  48. package/lib/api-schemas/process.d.ts.map +1 -1
  49. package/lib/api-schemas/process.js +29 -0
  50. package/lib/api-schemas/process.js.map +1 -1
  51. package/lib/api-schemas/project-configuration.d.ts +390 -0
  52. package/lib/api-schemas/project-configuration.d.ts.map +1 -1
  53. package/lib/api-schemas/project.d.ts +591 -6
  54. package/lib/api-schemas/project.d.ts.map +1 -1
  55. package/lib/api-schemas/prompt.d.ts.map +1 -1
  56. package/lib/api-schemas/prompt.js +5 -2
  57. package/lib/api-schemas/prompt.js.map +1 -1
  58. package/lib/api-schemas/registry.d.ts +23032 -461
  59. package/lib/api-schemas/registry.d.ts.map +1 -1
  60. package/lib/api-schemas/registry.js +38 -3
  61. package/lib/api-schemas/registry.js.map +1 -1
  62. package/lib/api-schemas/schema-primitives.d.ts +8 -0
  63. package/lib/api-schemas/schema-primitives.d.ts.map +1 -1
  64. package/lib/api-schemas/schema-primitives.js +8 -0
  65. package/lib/api-schemas/schema-primitives.js.map +1 -1
  66. package/lib/api-schemas/store.d.ts +1950 -0
  67. package/lib/api-schemas/store.d.ts.map +1 -1
  68. package/lib/api-schemas/store.js +3 -3
  69. package/lib/api-schemas/store.js.map +1 -1
  70. package/lib/api-schemas/task.d.ts.map +1 -1
  71. package/lib/api-schemas/task.js +3 -2
  72. package/lib/api-schemas/task.js.map +1 -1
  73. package/lib/api-schemas/workflow-runs.d.ts +78 -0
  74. package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
  75. package/lib/apikey.d.ts +7 -0
  76. package/lib/apikey.d.ts.map +1 -1
  77. package/lib/apikey.js.map +1 -1
  78. package/lib/apps.d.ts +37 -1
  79. package/lib/apps.d.ts.map +1 -1
  80. package/lib/apps.js +74 -3
  81. package/lib/apps.js.map +1 -1
  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 +20 -2
  92. package/lib/store/intake-policy-schema.generated.js.map +1 -1
  93. package/lib/store/store.d.ts +1 -0
  94. package/lib/store/store.d.ts.map +1 -1
  95. package/lib/store/store.js.map +1 -1
  96. package/lib/store/text-limits.d.ts +18 -0
  97. package/lib/store/text-limits.d.ts.map +1 -0
  98. package/lib/store/text-limits.js +56 -0
  99. package/lib/store/text-limits.js.map +1 -0
  100. package/lib/vertesia-common.js +4 -2
  101. package/lib/vertesia-common.js.map +1 -1
  102. package/lib/wire-types.generated.d.ts +261 -3
  103. package/lib/wire-types.generated.d.ts.map +1 -1
  104. package/lib/workflow-analytics.d.ts +19 -1
  105. package/lib/workflow-analytics.d.ts.map +1 -1
  106. package/package.json +6 -6
  107. package/src/api-contract/components.generated.json +1329 -37
  108. package/src/api-schemas/agent-runs.ts +10 -3
  109. package/src/api-schemas/app-lifecycle.ts +163 -1
  110. package/src/api-schemas/app-runtime.ts +54 -0
  111. package/src/api-schemas/apps.ts +46 -0
  112. package/src/api-schemas/audit-trail.ts +5 -5
  113. package/src/api-schemas/content.ts +21 -5
  114. package/src/api-schemas/data-store.ts +8 -0
  115. package/src/api-schemas/indexing.ts +10 -0
  116. package/src/api-schemas/interaction.ts +9 -7
  117. package/src/api-schemas/oauth-server.ts +103 -2
  118. package/src/api-schemas/process.ts +32 -0
  119. package/src/api-schemas/prompt.ts +5 -2
  120. package/src/api-schemas/registry.ts +59 -6
  121. package/src/api-schemas/schema-primitives.ts +9 -0
  122. package/src/api-schemas/store.ts +3 -3
  123. package/src/api-schemas/task.ts +3 -2
  124. package/src/apikey.ts +8 -0
  125. package/src/apps.ts +116 -3
  126. package/src/interaction.ts +1 -0
  127. package/src/oauth-server.ts +10 -0
  128. package/src/store/index.ts +1 -0
  129. package/src/store/intake-policy-schema.generated.ts +20 -2
  130. package/src/store/store.ts +2 -0
  131. package/src/store/text-limits.ts +64 -0
  132. package/src/wire-types.generated.ts +285 -3
  133. package/src/workflow-analytics.ts +21 -1
@@ -36,7 +36,7 @@ import {
36
36
  RecordProcessRunPayloadSchema,
37
37
  } from './process.js';
38
38
  import { AgentBudgetConfigurationSchema, AgentCheckpointConfigurationSchema } from './project-configuration.js';
39
- import { nullableStringSchema } from './schema-primitives.js';
39
+ import { nullableStringSchema, PageCountSchema } from './schema-primitives.js';
40
40
  import { InteractionExecutionConfigurationSchema } from './store.js';
41
41
 
42
42
  // ----------------------------------------------------------------------------
@@ -66,6 +66,8 @@ export const TurnEvaluationFlagSchema = z
66
66
  'followup_after_answer',
67
67
  'approval_denied',
68
68
  'circuit_breaker',
69
+ 'no_visible_answer',
70
+ 'answer_in_tool_preamble',
69
71
  ])
70
72
  .meta({ id: 'TurnEvaluationFlag', description: 'Reason behind an evaluation severity.' });
71
73
 
@@ -348,6 +350,8 @@ const LlmCallEventSchema = z.strictObject({
348
350
  success: z.boolean(),
349
351
  streamingEnabled: z.boolean(),
350
352
  toolUseCount: z.number(),
353
+ finishReason: z.string().optional(),
354
+ outputTextChars: z.number().int().optional(),
351
355
  callType: z.enum(LlmCallType),
352
356
  attemptNumber: z.number().optional(),
353
357
  errorType: z.string().optional(),
@@ -434,6 +438,9 @@ const TurnEvaluationEventSchema = z.strictObject({
434
438
  /** Absent on events from producers that predate the stall counters; read as 0. */
435
439
  stallCorrectives: z.number().int().optional(),
436
440
  stallTrips: z.number().int().optional(),
441
+ /** Absent on events from producers that predate the answer counters. */
442
+ answerChars: z.number().int().optional(),
443
+ finalToolCallTextChars: z.number().int().optional(),
437
444
  followupAfterAnswer: z.boolean(),
438
445
  severity: EvaluationSeveritySchema,
439
446
  flags: z.array(TurnEvaluationFlagSchema),
@@ -1431,8 +1438,8 @@ export const ListAgentRunsQuerySchema = z
1431
1438
  .string()
1432
1439
  .meta({ description: 'Only return runs started at or before this date', format: 'date-time' })
1433
1440
  .optional(),
1434
- limit: z.number().meta({ description: 'Maximum number of results (default: 50)' }).optional(),
1435
- offset: z.number().meta({ description: 'Offset for pagination' }).optional(),
1441
+ limit: PageCountSchema.meta({ description: 'Maximum number of results (default: 50)' }).optional(),
1442
+ offset: PageCountSchema.meta({ description: 'Offset for pagination' }).optional(),
1436
1443
  cursor: z.string().meta({ description: 'Cursor for stable pagination' }).optional(),
1437
1444
  schedule_id: z.string().meta({ description: 'Filter by schedule ID' }).optional(),
1438
1445
  type: AgentRunTypeSchema.meta({ description: 'Filter by run type' }).optional(),
@@ -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' });
@@ -226,6 +226,22 @@ export const ContentObjectTextResponseSchema = z
226
226
  })
227
227
  .meta({ id: 'ContentObjectTextResponse' });
228
228
 
229
+ export const SetObjectTextPayloadSchema = z
230
+ .strictObject({
231
+ text: z.string().meta({ description: 'The extracted text to store for the object.' }),
232
+ etag: z
233
+ .string()
234
+ .meta({
235
+ description:
236
+ 'The etag of the content the text was extracted from. When provided, the server records it as the object text_etag so extraction can be skipped while the content is unchanged.',
237
+ })
238
+ .optional(),
239
+ })
240
+ .meta({
241
+ id: 'SetObjectTextPayload',
242
+ description: 'Payload for storing the extracted text of a content object as a text artifact.',
243
+ });
244
+
229
245
  export const GetRenditionResponseSchema = z
230
246
  .strictObject({
231
247
  status: z.enum(['found', 'generating', 'failed']),
@@ -441,8 +457,8 @@ export const ComplexCollectionSearchQuerySchema = z
441
457
  parent: nullableStringSchema.optional(),
442
458
  dynamic: z.boolean().optional(),
443
459
  status: CollectionStatusSchema.optional(),
444
- limit: z.number().optional(),
445
- offset: z.number().optional(),
460
+ limit: PageCountSchema.optional(),
461
+ offset: PageCountSchema.optional(),
446
462
  name: z.string().optional(),
447
463
  type: z.string().optional(),
448
464
  types: z.array(z.string()).optional(),
@@ -1043,8 +1059,8 @@ export const CollectionMembersQuerySchema = z
1043
1059
  .object({
1044
1060
  status: z.string().optional(),
1045
1061
  type: z.string().optional(),
1046
- limit: z.number().optional(),
1047
- offset: z.number().optional(),
1062
+ limit: PageCountSchema.optional(),
1063
+ offset: PageCountSchema.optional(),
1048
1064
  })
1049
1065
  .meta({ id: 'CollectionMembersQuery' });
1050
1066
 
@@ -297,6 +297,14 @@ export const AlterTableOperationSchema = z
297
297
  column: z.string(),
298
298
  updates: DataColumnUpdateSchema,
299
299
  }),
300
+ z.strictObject({
301
+ op: z.literal('add_foreign_key'),
302
+ foreign_key: DataForeignKeySchema,
303
+ }),
304
+ z.strictObject({
305
+ op: z.literal('drop_foreign_key'),
306
+ column: z.string().meta({ description: 'Column whose foreign key is removed' }),
307
+ }),
300
308
  ])
301
309
  .meta({
302
310
  id: 'AlterTableOperation',
@@ -12,6 +12,16 @@ export const StartProjectReindexPayloadSchema = z
12
12
  concurrency: z.number().optional(),
13
13
  bulk_size_bytes: z.number().optional(),
14
14
  bulk_concurrency: z.number().optional(),
15
+ modified_since: z
16
+ .string()
17
+ .meta({
18
+ format: 'date-time',
19
+ description:
20
+ 'When set, reindex only documents whose updated_at is at or after this RFC3339/ISO-8601 ' +
21
+ 'datetime. Writes in-place into the live index (no new versioned target, no alias swap). ' +
22
+ 'Omit for a full reindex into a fresh versioned target.',
23
+ })
24
+ .optional(),
15
25
  })
16
26
  .meta({ id: 'StartProjectReindexPayload' });
17
27
 
@@ -28,7 +28,7 @@ import { InferenceProfileIdSchema, InferenceProfileSnapshotSchema } from './infe
28
28
  import { AccountRefSchema } from './invites.js';
29
29
  import { ProcessAgentExecutionPolicySchema } from './process-agent-policy.js';
30
30
  import { AgentBudgetConfigurationSchema, AgentCheckpointConfigurationSchema } from './project-configuration.js';
31
- import { EditRevisionSchema, ExpectedEditRevisionSchema } from './schema-primitives.js';
31
+ import { EditRevisionSchema, ExpectedEditRevisionSchema, PageCountSchema } from './schema-primitives.js';
32
32
  import { InteractionExecutionConfigurationSchema, RunDataStorageLevelSchema } from './store.js';
33
33
 
34
34
  /**
@@ -498,8 +498,8 @@ export const InteractionForkPayloadSchema = z
498
498
 
499
499
  export const InteractionEndpointQuerySchema = z
500
500
  .strictObject({
501
- limit: z.number().optional(),
502
- offset: z.number().optional(),
501
+ limit: PageCountSchema.optional(),
502
+ offset: PageCountSchema.optional(),
503
503
  status: InteractionStatusSchema.optional(),
504
504
  visibility: InteractionVisibilitySchema.optional(),
505
505
  version: z.number().optional(),
@@ -701,8 +701,10 @@ export const RunSearchQuerySchema = z
701
701
  */
702
702
  export const RunListQuerySchema = z
703
703
  .strictObject({
704
- limit: z.number().int().meta({ description: 'Maximum number of runs to return.' }).optional(),
705
- offset: z.number().int().meta({ description: 'Number of runs to skip.' }).optional(),
704
+ // Already published as `integer`, so these keep that type and only gain the lower bound a find
705
+ // `skip` needs; a negative count failed there as a 500.
706
+ limit: z.number().int().min(0).meta({ description: 'Maximum number of runs to return.' }).optional(),
707
+ offset: z.number().int().min(0).meta({ description: 'Number of runs to skip.' }).optional(),
706
708
  interaction: z
707
709
  .array(z.string())
708
710
  .meta({ description: 'Interaction ids, or in-code interaction names, to filter by.' })
@@ -1144,8 +1146,8 @@ export const RunSearchPayloadSchema = z
1144
1146
  })
1145
1147
  .optional(),
1146
1148
  query: RunSearchQuerySchema.optional(),
1147
- limit: z.number().optional(),
1148
- offset: z.number().optional(),
1149
+ limit: PageCountSchema.optional(),
1150
+ offset: PageCountSchema.optional(),
1149
1151
  select: z.string().optional(),
1150
1152
  all_revisions: z.boolean().optional(),
1151
1153
  from_root: z.string().optional(),