@vertesia/common 1.5.0-dev.20260901.052906Z → 1.5.0-dev.20260910.051115Z

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 (67) hide show
  1. package/lib/api-contract/components.generated.json +177 -13
  2. package/lib/api-schemas/agent-runs.d.ts +40 -0
  3. package/lib/api-schemas/agent-runs.d.ts.map +1 -1
  4. package/lib/api-schemas/app-lifecycle.d.ts +1 -0
  5. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
  6. package/lib/api-schemas/app-lifecycle.js +8 -0
  7. package/lib/api-schemas/app-lifecycle.js.map +1 -1
  8. package/lib/api-schemas/app-runtime.d.ts +112 -0
  9. package/lib/api-schemas/app-runtime.d.ts.map +1 -1
  10. package/lib/api-schemas/content.d.ts +40 -0
  11. package/lib/api-schemas/content.d.ts.map +1 -1
  12. package/lib/api-schemas/cost-analytics.d.ts +38 -0
  13. package/lib/api-schemas/cost-analytics.d.ts.map +1 -1
  14. package/lib/api-schemas/cost-analytics.js +31 -1
  15. package/lib/api-schemas/cost-analytics.js.map +1 -1
  16. package/lib/api-schemas/document-processing.d.ts +24 -0
  17. package/lib/api-schemas/document-processing.d.ts.map +1 -1
  18. package/lib/api-schemas/embeddings.d.ts +5 -0
  19. package/lib/api-schemas/embeddings.d.ts.map +1 -1
  20. package/lib/api-schemas/embeddings.js +12 -1
  21. package/lib/api-schemas/embeddings.js.map +1 -1
  22. package/lib/api-schemas/events.d.ts +72 -0
  23. package/lib/api-schemas/events.d.ts.map +1 -1
  24. package/lib/api-schemas/interaction.d.ts +404 -0
  25. package/lib/api-schemas/interaction.d.ts.map +1 -1
  26. package/lib/api-schemas/interaction.js +26 -2
  27. package/lib/api-schemas/interaction.js.map +1 -1
  28. package/lib/api-schemas/project-configuration.d.ts +80 -0
  29. package/lib/api-schemas/project-configuration.d.ts.map +1 -1
  30. package/lib/api-schemas/project.d.ts +120 -0
  31. package/lib/api-schemas/project.d.ts.map +1 -1
  32. package/lib/api-schemas/registry.d.ts +1320 -0
  33. package/lib/api-schemas/registry.d.ts.map +1 -1
  34. package/lib/api-schemas/store.d.ts +400 -0
  35. package/lib/api-schemas/store.d.ts.map +1 -1
  36. package/lib/api-schemas/workflow-runs.d.ts +16 -0
  37. package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
  38. package/lib/appgen.d.ts +3 -0
  39. package/lib/appgen.d.ts.map +1 -0
  40. package/lib/appgen.js +3 -0
  41. package/lib/appgen.js.map +1 -0
  42. package/lib/index.d.ts +1 -0
  43. package/lib/index.d.ts.map +1 -1
  44. package/lib/index.js +1 -0
  45. package/lib/index.js.map +1 -1
  46. package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
  47. package/lib/store/intake-policy-schema.generated.js +5 -1
  48. package/lib/store/intake-policy-schema.generated.js.map +1 -1
  49. package/lib/vertesia-common.js +2 -2
  50. package/lib/vertesia-common.js.map +1 -1
  51. package/lib/workflow-analytics.d.ts +3 -1
  52. package/lib/workflow-analytics.d.ts.map +1 -1
  53. package/lib/workflow-analytics.js +2 -0
  54. package/lib/workflow-analytics.js.map +1 -1
  55. package/package.json +3 -3
  56. package/src/api-contract/components.generated.json +177 -13
  57. package/src/api-schemas/app-lifecycle.ts +9 -0
  58. package/src/api-schemas/cost-analytics.ts +34 -1
  59. package/src/api-schemas/embeddings.ts +14 -1
  60. package/src/api-schemas/environment.contract.test.ts +15 -0
  61. package/src/api-schemas/interaction.contract.test.ts +54 -0
  62. package/src/api-schemas/interaction.ts +26 -2
  63. package/src/api-schemas/llumiverse.contract.test.ts +16 -0
  64. package/src/appgen.ts +4 -0
  65. package/src/index.ts +1 -0
  66. package/src/store/intake-policy-schema.generated.ts +5 -1
  67. package/src/workflow-analytics.ts +2 -0
@@ -14,7 +14,9 @@ import {
14
14
  InteractionUpdatePayloadSchema,
15
15
  PromptSegmentDefSchema,
16
16
  ResolvedCatalogInteractionSchema,
17
+ RunClonePayloadSchema,
17
18
  } from './interaction.js';
19
+ import { validateApiRequest } from './registry.js';
18
20
 
19
21
  describe('conversation state contract', () => {
20
22
  it('publishes the tool catalog storage scope used to resolve tool references', () => {
@@ -228,3 +230,55 @@ describe('interaction contracts', () => {
228
230
  ).toBe(true);
229
231
  });
230
232
  });
233
+
234
+ describe('user message payload contract', () => {
235
+ const base = {
236
+ run: { id: 'run-1', account: 'acc-1', project: 'proj-1' },
237
+ environment: 'env-1',
238
+ options: { model: 'model-1' },
239
+ tools: [],
240
+ message: 'Search the other collection instead.',
241
+ };
242
+
243
+ it('accepts tool results owed to the model alongside the message', () => {
244
+ // A stop or an approval denial can leave results undelivered. They have to travel with
245
+ // the message that resumes the conversation: the payload is strict, so before `results`
246
+ // existed here the server rejected them and the work was silently dropped.
247
+ const result = validateApiRequest('UserMessagePayload', {
248
+ ...base,
249
+ results: [{ tool_use_id: 'search-1', content: 'found 3 docs', is_error: false }],
250
+ });
251
+
252
+ expect(result.valid).toBe(true);
253
+ });
254
+
255
+ it('still accepts a message with no owed results', () => {
256
+ expect(validateApiRequest('UserMessagePayload', base).valid).toBe(true);
257
+ });
258
+
259
+ it('stays closed to undeclared fields', () => {
260
+ expect(validateApiRequest('UserMessagePayload', { ...base, unsupported: true }).valid).toBe(false);
261
+ });
262
+ });
263
+
264
+ describe('inference workflow attribution', () => {
265
+ it('keeps required clone workflow identifiers free of execution deprecation metadata', () => {
266
+ const workflow = RunClonePayloadSchema.shape.workflow.shape;
267
+ expect(workflow.run_id.meta()?.deprecated).toBeUndefined();
268
+ expect(workflow.workflow_id.meta()?.deprecated).toBeUndefined();
269
+ });
270
+ it('accepts root agent attribution on execution and clone requests', () => {
271
+ const workflow = { run_id: 'child-run', workflow_id: 'workstream:parent:child', agent_run_id: 'root-agent' };
272
+ expect(validateApiRequest('ExecutionRunWorkflow', workflow).valid).toBe(true);
273
+ expect(validateApiRequest('RunClonePayload', { source_run_id: 'source', workflow }).valid).toBe(true);
274
+ expect(
275
+ validateApiRequest('ExecutionRunWorkflow', { run_id: 'legacy', workflow_id: 'AgentRun:legacy' }).valid,
276
+ ).toBe(true);
277
+ });
278
+ });
279
+
280
+ describe('background inference telemetry contract', () => {
281
+ it('accepts the background call type in the generated runtime contract', () => {
282
+ expect(validateApiRequest('LlmCallType', 'background').valid).toBe(true);
283
+ });
284
+ });
@@ -304,6 +304,9 @@ export const TemplateTypeSchema = z.enum(TemplateType).meta({ id: 'TemplateType'
304
304
 
305
305
  export const ExecutionRunWorkflowSchema = z
306
306
  .strictObject({
307
+ agent_run_id: z.string().optional().meta({
308
+ description: 'Root agent run owning this inference, including inference performed by child workstreams.',
309
+ }),
307
310
  rate_limit_id: z
308
311
  .string()
309
312
  .meta({
@@ -2453,7 +2456,23 @@ export const ToolResultsPayloadSchema = z
2453
2456
  .meta({ id: 'ToolResultsPayload' });
2454
2457
 
2455
2458
  export const UserMessagePayloadSchema = z
2456
- .strictObject({ ...resumeConversationFields, message: z.string() })
2459
+ .strictObject({
2460
+ ...resumeConversationFields,
2461
+ message: z.string(),
2462
+ /**
2463
+ * Tool results still owed to the model when the user message is sent.
2464
+ *
2465
+ * A conversation can be interrupted — the user stops the run, or a tool approval is
2466
+ * denied — while a tool batch has already produced results, or while `tool_use` blocks
2467
+ * are outstanding. Providers require a `tool_result` for every `tool_use` before the
2468
+ * next turn, so those results have to travel with the message that resumes the
2469
+ * conversation rather than in a separate turn of their own.
2470
+ */
2471
+ results: z
2472
+ .array(ToolResultSchema)
2473
+ .optional()
2474
+ .meta({ description: 'Tool results owed to the model, delivered with this message.' }),
2475
+ })
2457
2476
  .meta({ id: 'UserMessagePayload' });
2458
2477
 
2459
2478
  export const ExecutionResponseSchema = z
@@ -2461,6 +2480,7 @@ export const ExecutionResponseSchema = z
2461
2480
  result: z.array(CompletionResultSchema),
2462
2481
  token_usage: ExecutionTokenUsageSchema.optional(),
2463
2482
  prompt_cache_diagnostic: PromptCacheDiagnosticSchema.optional(),
2483
+ service_tier: z.string().meta({ description: 'Processing tier actually used by the provider' }).optional(),
2464
2484
  tool_use: z.array(ToolUseSchema).optional(),
2465
2485
  finish_reason: z.string().optional(),
2466
2486
  error: z
@@ -2527,6 +2547,10 @@ export const ComputeRunFacetsResponseSchema = z
2527
2547
  export const RunClonePayloadSchema = z
2528
2548
  .strictObject({
2529
2549
  source_run_id: z.string(),
2530
- workflow: z.strictObject({ run_id: z.string(), workflow_id: z.string() }),
2550
+ workflow: z.strictObject({
2551
+ run_id: z.string(),
2552
+ workflow_id: z.string(),
2553
+ agent_run_id: ExecutionRunWorkflowSchema.shape.agent_run_id,
2554
+ }),
2531
2555
  })
2532
2556
  .meta({ id: 'RunClonePayload' });
@@ -111,6 +111,22 @@ describe('the ModelOptions closure is published whole and enforced closed', () =
111
111
  ).toBe(true);
112
112
  expect(validate({ _option_id: 'openai-text', extra_body: ['invalid'] })).toBe(false);
113
113
  });
114
+
115
+ it('accepts Gemini Omni task and resolution options through the run request contract', () => {
116
+ const result = validateApiRequest('RunCreatePayload', {
117
+ interaction: 'GenerateVideo',
118
+ config: {
119
+ model: 'locations/global/publishers/google/models/gemini-omni-1.1-flash-preview',
120
+ model_options: {
121
+ _option_id: 'vertexai-gemini-omni-video',
122
+ task: 'extend',
123
+ resolution: '4k',
124
+ },
125
+ },
126
+ });
127
+
128
+ expect(result.valid ? [] : result.errors).toEqual([]);
129
+ });
114
130
  });
115
131
 
116
132
  describe('the JSONSchema closure is published open, because a JSON Schema is open', () => {
package/src/appgen.ts ADDED
@@ -0,0 +1,4 @@
1
+ export const APPGEN_PACKAGE_SPEC_PATTERN_SOURCE =
2
+ '^(?:latest|dev|dev-[0-9]+\\.[0-9]+|snapshot-[0-9a-f]{7}|[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?)$';
3
+
4
+ export const APPGEN_PACKAGE_SPEC_PATTERN = new RegExp(APPGEN_PACKAGE_SPEC_PATTERN_SOURCE);
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ export type {
13
13
  UserRefArrayFromSchema,
14
14
  } from './api-schemas/user.js';
15
15
  export * from './apikey.js';
16
+ export * from './appgen.js';
16
17
  export * from './apps.js';
17
18
  export * from './ask-user.js';
18
19
  export * from './audit-trail.js';
@@ -1592,7 +1592,7 @@ export const ContentTypeIntakePolicySchema: JSONObject = {
1592
1592
  },
1593
1593
  task: {
1594
1594
  type: 'string',
1595
- enum: ['text_to_video', 'image_to_video', 'reference_to_video'],
1595
+ enum: ['text_to_video', 'image_to_video', 'reference_to_video', 'edit', 'extend'],
1596
1596
  },
1597
1597
  aspect_ratio: {
1598
1598
  type: 'string',
@@ -1603,6 +1603,10 @@ export const ContentTypeIntakePolicySchema: JSONObject = {
1603
1603
  minimum: 3,
1604
1604
  maximum: 10,
1605
1605
  },
1606
+ resolution: {
1607
+ type: 'string',
1608
+ enum: ['360p', '720p', '1080p', '4k'],
1609
+ },
1606
1610
  },
1607
1611
  required: ['_option_id'],
1608
1612
  additionalProperties: false,
@@ -32,6 +32,8 @@ export enum LlmCallType {
32
32
  Checkpoint = 'checkpoint',
33
33
  /** Nested interaction call from within tools */
34
34
  NestedInteraction = 'nested_interaction',
35
+ /** Background inference attributed to an agent, such as topic generation */
36
+ Background = 'background',
35
37
  }
36
38
 
37
39
  /**