@vertesia/common 1.5.0-dev.20260804.124748Z → 1.5.0-dev.20260806.125520Z

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 (163) hide show
  1. package/lib/Progress.d.ts.map +1 -1
  2. package/lib/Progress.js.map +1 -1
  3. package/lib/access-control-values.d.ts +2 -2
  4. package/lib/access-control-values.d.ts.map +1 -1
  5. package/lib/account-values.d.ts +1 -1
  6. package/lib/account-values.d.ts.map +1 -1
  7. package/lib/api-schemas/access-control.d.ts +19 -19
  8. package/lib/api-schemas/adapter.js.map +1 -1
  9. package/lib/api-schemas/agent-runs.d.ts +520 -515
  10. package/lib/api-schemas/agent-runs.d.ts.map +1 -1
  11. package/lib/api-schemas/agent-runs.js +11 -2
  12. package/lib/api-schemas/agent-runs.js.map +1 -1
  13. package/lib/api-schemas/analytics.d.ts +12 -12
  14. package/lib/api-schemas/apikey.d.ts +10 -10
  15. package/lib/api-schemas/app-lifecycle.d.ts +186 -152
  16. package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
  17. package/lib/api-schemas/app-lifecycle.js +51 -0
  18. package/lib/api-schemas/app-lifecycle.js.map +1 -1
  19. package/lib/api-schemas/app-runtime.d.ts +4022 -2127
  20. package/lib/api-schemas/app-runtime.d.ts.map +1 -1
  21. package/lib/api-schemas/app-runtime.js +93 -1
  22. package/lib/api-schemas/app-runtime.js.map +1 -1
  23. package/lib/api-schemas/apps.d.ts +43 -19
  24. package/lib/api-schemas/apps.d.ts.map +1 -1
  25. package/lib/api-schemas/apps.js +63 -3
  26. package/lib/api-schemas/apps.js.map +1 -1
  27. package/lib/api-schemas/audit-trail.d.ts +129 -129
  28. package/lib/api-schemas/bulk-operation.d.ts +10 -10
  29. package/lib/api-schemas/content.d.ts +402 -398
  30. package/lib/api-schemas/content.d.ts.map +1 -1
  31. package/lib/api-schemas/content.js +12 -0
  32. package/lib/api-schemas/content.js.map +1 -1
  33. package/lib/api-schemas/cost-analytics.d.ts +12 -12
  34. package/lib/api-schemas/dashboard.d.ts +10 -10
  35. package/lib/api-schemas/data-store.d.ts +556 -556
  36. package/lib/api-schemas/document-processing.d.ts +196 -196
  37. package/lib/api-schemas/embeddings.d.ts +12 -12
  38. package/lib/api-schemas/environment.d.ts +18 -18
  39. package/lib/api-schemas/events.d.ts +723 -685
  40. package/lib/api-schemas/events.d.ts.map +1 -1
  41. package/lib/api-schemas/events.js +59 -3
  42. package/lib/api-schemas/events.js.map +1 -1
  43. package/lib/api-schemas/files.d.ts +1 -1
  44. package/lib/api-schemas/group.d.ts +3 -3
  45. package/lib/api-schemas/indexing.d.ts +3 -3
  46. package/lib/api-schemas/integrations.d.ts +4 -4
  47. package/lib/api-schemas/interaction.d.ts +2744 -2742
  48. package/lib/api-schemas/interaction.d.ts.map +1 -1
  49. package/lib/api-schemas/interaction.js +6 -0
  50. package/lib/api-schemas/interaction.js.map +1 -1
  51. package/lib/api-schemas/invites.d.ts +9 -9
  52. package/lib/api-schemas/oauth-server.d.ts +36 -36
  53. package/lib/api-schemas/parameters.js.map +1 -1
  54. package/lib/api-schemas/process.d.ts +47 -47
  55. package/lib/api-schemas/project-configuration.d.ts +662 -662
  56. package/lib/api-schemas/project.d.ts +979 -979
  57. package/lib/api-schemas/registry.d.ts +14782 -13734
  58. package/lib/api-schemas/registry.d.ts.map +1 -1
  59. package/lib/api-schemas/registry.js +22 -2
  60. package/lib/api-schemas/registry.js.map +1 -1
  61. package/lib/api-schemas/secrets.d.ts +4 -4
  62. package/lib/api-schemas/store.d.ts +3203 -3203
  63. package/lib/api-schemas/sts.d.ts +46 -36
  64. package/lib/api-schemas/sts.d.ts.map +1 -1
  65. package/lib/api-schemas/sts.js +11 -0
  66. package/lib/api-schemas/sts.js.map +1 -1
  67. package/lib/api-schemas/task.d.ts +30 -30
  68. package/lib/api-schemas/tools.d.ts +9 -9
  69. package/lib/api-schemas/user.d.ts +6 -6
  70. package/lib/api-schemas/view-execution.d.ts +569 -569
  71. package/lib/api-schemas/views.d.ts +1124 -1124
  72. package/lib/api-schemas/workflow-runs.d.ts +269 -268
  73. package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
  74. package/lib/apps.d.ts +38 -24
  75. package/lib/apps.d.ts.map +1 -1
  76. package/lib/apps.js +4 -0
  77. package/lib/apps.js.map +1 -1
  78. package/lib/audit-trail.d.ts +3 -3
  79. package/lib/audit-trail.d.ts.map +1 -1
  80. package/lib/data-platform.d.ts +31 -31
  81. package/lib/data-platform.d.ts.map +1 -1
  82. package/lib/environment.d.ts +3 -3
  83. package/lib/index.d.ts +1 -0
  84. package/lib/index.d.ts.map +1 -1
  85. package/lib/index.js +1 -0
  86. package/lib/index.js.map +1 -1
  87. package/lib/platform-event-validation.d.ts.map +1 -1
  88. package/lib/platform-event-validation.js +15 -2
  89. package/lib/platform-event-validation.js.map +1 -1
  90. package/lib/platform-event.d.ts +31 -3
  91. package/lib/platform-event.d.ts.map +1 -1
  92. package/lib/platform-event.js.map +1 -1
  93. package/lib/project.d.ts +1 -1
  94. package/lib/schema-for-extraction.js.map +1 -1
  95. package/lib/store/agent-approval.d.ts +1 -1
  96. package/lib/store/agent-approval.d.ts.map +1 -1
  97. package/lib/store/process-schema.d.ts +1 -1
  98. package/lib/store/process-schema.d.ts.map +1 -1
  99. package/lib/store/process-validation.js.map +1 -1
  100. package/lib/store/schedule.d.ts +6 -6
  101. package/lib/store/schedule.d.ts.map +1 -1
  102. package/lib/store/store.d.ts +3 -3
  103. package/lib/store/store.d.ts.map +1 -1
  104. package/lib/store/workflow.d.ts +6 -0
  105. package/lib/store/workflow.d.ts.map +1 -1
  106. package/lib/store/workflow.js +8 -0
  107. package/lib/store/workflow.js.map +1 -1
  108. package/lib/sts-errors.d.ts +7 -0
  109. package/lib/sts-errors.d.ts.map +1 -0
  110. package/lib/sts-errors.js +11 -0
  111. package/lib/sts-errors.js.map +1 -0
  112. package/lib/sts-token-types.d.ts +2 -1
  113. package/lib/sts-token-types.d.ts.map +1 -1
  114. package/lib/sts-token-types.js.map +1 -1
  115. package/lib/user.d.ts +1 -1
  116. package/lib/user.d.ts.map +1 -1
  117. package/lib/user.js +1 -1
  118. package/lib/user.js.map +1 -1
  119. package/lib/versions.d.ts +10 -0
  120. package/lib/versions.d.ts.map +1 -1
  121. package/lib/versions.js +10 -0
  122. package/lib/versions.js.map +1 -1
  123. package/lib/vertesia-common.js +3 -3
  124. package/lib/vertesia-common.js.map +1 -1
  125. package/lib/view-configuration-validation.js.map +1 -1
  126. package/lib/view-query-validation.js.map +1 -1
  127. package/lib/view-validation-helpers.d.ts +1 -1
  128. package/lib/view-validation-helpers.d.ts.map +1 -1
  129. package/lib/views-schema.d.ts +51 -51
  130. package/lib/views-schema.d.ts.map +1 -1
  131. package/lib/views-validation.js.map +1 -1
  132. package/lib/views.d.ts +2 -2
  133. package/lib/views.d.ts.map +1 -1
  134. package/lib/workflow-analytics.d.ts +10 -3
  135. package/lib/workflow-analytics.d.ts.map +1 -1
  136. package/package.json +4 -4
  137. package/src/api-schemas/agent-runs.ts +12 -2
  138. package/src/api-schemas/app-delete-summary.contract.test.ts +67 -0
  139. package/src/api-schemas/app-lifecycle.ts +59 -0
  140. package/src/api-schemas/app-runtime.ts +103 -0
  141. package/src/api-schemas/apps.ts +72 -3
  142. package/src/api-schemas/content.ts +13 -0
  143. package/src/api-schemas/events.ts +63 -3
  144. package/src/api-schemas/interaction.contract.test.ts +27 -0
  145. package/src/api-schemas/interaction.ts +7 -0
  146. package/src/api-schemas/mcp-api-key.contract.test.ts +86 -0
  147. package/src/api-schemas/registry.ts +25 -0
  148. package/src/api-schemas/store.contract.test.ts +21 -0
  149. package/src/api-schemas/sts.contract.test.ts +33 -1
  150. package/src/api-schemas/sts.ts +13 -0
  151. package/src/apps.test.ts +82 -0
  152. package/src/apps.ts +50 -16
  153. package/src/index.ts +1 -0
  154. package/src/platform-event-validation.test.ts +26 -0
  155. package/src/platform-event-validation.ts +15 -2
  156. package/src/platform-event.ts +43 -0
  157. package/src/store/workflow.ts +9 -0
  158. package/src/sts-errors.ts +13 -0
  159. package/src/sts-token-types.ts +2 -0
  160. package/src/user.ts +1 -1
  161. package/src/versions.test.ts +13 -0
  162. package/src/versions.ts +12 -0
  163. package/src/workflow-analytics.ts +10 -3
@@ -5,6 +5,10 @@ import type {
5
5
  AgentDeliveryMatchModeSchema,
6
6
  AgentEventDeliveryTargetSchema,
7
7
  AgentSemanticEvaluatorSchema,
8
+ AppEventDeliveryTargetInputSchema,
9
+ AppEventDeliveryTargetSchema,
10
+ CancelEventDeliveryIntentsPayloadSchema,
11
+ CancelEventDeliveryIntentsResponseSchema,
8
12
  CreateEventIngestChannelPayloadSchema,
9
13
  EventDeliveryIntentStatusSchema,
10
14
  EventDeliveryIntentSummarySchema,
@@ -217,6 +221,8 @@ export type WorkflowEventDeliveryTarget = z.infer<typeof WorkflowEventDeliveryTa
217
221
 
218
222
  export type WebhookEventDeliveryTarget = z.infer<typeof WebhookEventDeliveryTargetSchema>;
219
223
 
224
+ export type AppEventDeliveryTarget = z.infer<typeof AppEventDeliveryTargetSchema>;
225
+
220
226
  export const DEFAULT_EVENT_AGENT_INTERACTION_REF = 'sys:GeneralAgent';
221
227
 
222
228
  export type AgentDeliveryMatchMode = z.infer<typeof AgentDeliveryMatchModeSchema>;
@@ -242,6 +248,7 @@ export interface ProcessEventDeliveryTarget {
242
248
  export type EventDeliveryTarget =
243
249
  | WorkflowEventDeliveryTarget
244
250
  | WebhookEventDeliveryTarget
251
+ | AppEventDeliveryTarget
245
252
  | AgentEventDeliveryTarget
246
253
  | ProcessEventDeliveryTarget;
247
254
 
@@ -254,9 +261,12 @@ export type WorkflowEventDeliveryTargetInput = z.infer<typeof WorkflowEventDeliv
254
261
 
255
262
  export type WebhookEventDeliveryTargetInput = z.infer<typeof WebhookEventDeliveryTargetInputSchema>;
256
263
 
264
+ export type AppEventDeliveryTargetInput = z.infer<typeof AppEventDeliveryTargetInputSchema>;
265
+
257
266
  export type EventDeliveryTargetInput =
258
267
  | WorkflowEventDeliveryTargetInput
259
268
  | WebhookEventDeliveryTargetInput
269
+ | AppEventDeliveryTargetInput
260
270
  | AgentEventDeliveryTarget
261
271
  | ProcessEventDeliveryTarget;
262
272
 
@@ -284,6 +294,9 @@ export interface EventSubscription {
284
294
  protected: boolean;
285
295
  enabled: boolean;
286
296
  priority?: EventPriority;
297
+ app_installation_id?: string;
298
+ app_id?: string;
299
+ app_subscription_id?: string;
287
300
  created_by?: string;
288
301
  updated_by?: string;
289
302
  created_at?: string;
@@ -387,6 +400,32 @@ export interface ListEventSubscriptionsQuery {
387
400
  scope?: ('account' | 'project')[];
388
401
  sort_by?: EventSubscriptionSortField;
389
402
  sort_order?: 'asc' | 'desc';
403
+ app_installation_id?: string;
404
+ }
405
+
406
+ /** Trusted Studio -> Zeno request used to provision subscriptions declared by an installed app. */
407
+ export interface ProvisionAppEventSubscriptionsRequest {
408
+ account_id: string;
409
+ project_id: string;
410
+ subscriptions: Array<
411
+ CreateEventSubscriptionPayload & {
412
+ target: AppEventDeliveryTargetInput;
413
+ app_installation_id: string;
414
+ app_id: string;
415
+ app_subscription_id: string;
416
+ }
417
+ >;
418
+ }
419
+
420
+ /** Trusted Studio -> Zeno request used to remove every subscription owned by an app installation. */
421
+ export interface RemoveAppEventSubscriptionsRequest {
422
+ account_id: string;
423
+ project_id: string;
424
+ app_installation_id: string;
425
+ }
426
+
427
+ export interface AppEventSubscriptionsMutationResponse {
428
+ subscription_ids: string[];
390
429
  }
391
430
 
392
431
  export type EventIngestChannelSortField = 'name' | 'source' | 'enabled' | 'updated_at';
@@ -410,6 +449,10 @@ export type EventDeliveryQueueSubscriptionSummary = z.infer<typeof EventDelivery
410
449
 
411
450
  export type EventDeliveryQueueSummaryResponse = z.infer<typeof EventDeliveryQueueSummaryResponseSchema>;
412
451
 
452
+ export type CancelEventDeliveryIntentsPayload = z.infer<typeof CancelEventDeliveryIntentsPayloadSchema>;
453
+
454
+ export type CancelEventDeliveryIntentsResponse = z.infer<typeof CancelEventDeliveryIntentsResponseSchema>;
455
+
413
456
  export interface PublishPlatformEventPayload {
414
457
  event: PlatformEvent;
415
458
  priority?: EventPriority;
@@ -737,6 +737,15 @@ export enum FileProcessingStatus {
737
737
 
738
738
  export type ConversationFile = z.infer<typeof ConversationFileSchema>;
739
739
 
740
+ /**
741
+ * A file is deliverable when it is ready and has not yet been delivered to the agent as part
742
+ * of a user message. Deliverable files get attached to the next message; consumed ones stay
743
+ * reachable to tools via artifact_path/md_path but are not re-attached.
744
+ */
745
+ export function isDeliverableFile(file: ConversationFile): boolean {
746
+ return file.status === FileProcessingStatus.READY && !file.consumed_at;
747
+ }
748
+
740
749
  /**
741
750
  * Details for file processing SYSTEM messages.
742
751
  * Used when type is AgentMessageType.SYSTEM with system_type: 'file_processing'.
@@ -0,0 +1,13 @@
1
+ export const REQUESTED_SCOPE_UNAVAILABLE_ERROR_CODE = 'requested_scope_unavailable';
2
+ export const NO_ACCESSIBLE_ACCOUNT_ERROR_CODE = 'no_accessible_account';
3
+ export const RESTRICTED_ENVIRONMENT_ERROR_CODE = 'restricted_environment';
4
+ export const TOKEN_ISSUANCE_FORBIDDEN_ERROR_CODE = 'token_issuance_forbidden';
5
+
6
+ export const ISSUE_TOKEN_FORBIDDEN_ERROR_CODES = [
7
+ REQUESTED_SCOPE_UNAVAILABLE_ERROR_CODE,
8
+ NO_ACCESSIBLE_ACCOUNT_ERROR_CODE,
9
+ RESTRICTED_ENVIRONMENT_ERROR_CODE,
10
+ TOKEN_ISSUANCE_FORBIDDEN_ERROR_CODE,
11
+ ] as const;
12
+
13
+ export type IssueTokenForbiddenErrorCode = (typeof ISSUE_TOKEN_FORBIDDEN_ERROR_CODES)[number];
@@ -7,6 +7,7 @@ import type {
7
7
  AgentTokenRequestSchema,
8
8
  ApiKeyTokenRequestSchema,
9
9
  EnvironmentTokenRequestSchema,
10
+ IssueTokenForbiddenResponseSchema,
10
11
  IssueTokenRequestSchema,
11
12
  IssueTokenResponseSchema,
12
13
  ProjectTokenRequestSchema,
@@ -91,6 +92,7 @@ export interface TokenResponse {
91
92
  }
92
93
 
93
94
  export type IssueTokenResponse = z.infer<typeof IssueTokenResponseSchema>;
95
+ export type IssueTokenForbiddenResponse = z.infer<typeof IssueTokenForbiddenResponseSchema>;
94
96
 
95
97
  export interface ValidateTokenResponse {
96
98
  valid: boolean;
package/src/user.ts CHANGED
@@ -59,7 +59,7 @@ export const EARLY_ACCESS_ANNOTATION = 'early-access';
59
59
  * restricted (`preview`/`preprod`) environment because they lack the {@link EARLY_ACCESS_ANNOTATION}
60
60
  * annotation. The UI keys its dedicated rejection screen off this code.
61
61
  */
62
- export const RESTRICTED_ENVIRONMENT_ERROR_CODE = 'restricted_environment';
62
+ export { RESTRICTED_ENVIRONMENT_ERROR_CODE } from './sts-errors.js';
63
63
 
64
64
  /**
65
65
  * The account as it crosses the wire.
@@ -0,0 +1,13 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { ApiVersions, CURRENT_API_VERSION, CURRENT_API_VERSION_HEADER_VALUE } from './versions.js';
3
+
4
+ describe('API versions', () => {
5
+ it('keeps the current API version aligned with the latest milestone', () => {
6
+ const milestones = Object.values(ApiVersions).filter(
7
+ (version): version is number => typeof version === 'number',
8
+ );
9
+
10
+ expect(CURRENT_API_VERSION).toBe(Math.max(...milestones));
11
+ expect(CURRENT_API_VERSION_HEADER_VALUE).toBe(String(CURRENT_API_VERSION));
12
+ });
13
+ });
package/src/versions.ts CHANGED
@@ -27,3 +27,15 @@ export enum ApiVersions {
27
27
  */
28
28
  REQUEST_CONTRACT_ENFORCEMENT_V1 = 20260803,
29
29
  }
30
+
31
+ /**
32
+ * The API version used by current clients and published as the current OpenAPI shape.
33
+ *
34
+ * Keep this explicit rather than deriving it at runtime: promoting a milestone to the client
35
+ * default is a deliberate compatibility decision. The versions test ensures this alias is
36
+ * reconsidered whenever a newer milestone is added.
37
+ */
38
+ export const CURRENT_API_VERSION = ApiVersions.REQUEST_CONTRACT_ENFORCEMENT_V1;
39
+
40
+ /** The current API version formatted for the {@link VERSION_HEADER} wire value. */
41
+ export const CURRENT_API_VERSION_HEADER_VALUE = String(CURRENT_API_VERSION);
@@ -114,11 +114,18 @@ export interface AgentRunCompletedEvent extends BaseAgentEvent {
114
114
  totalToolCalls: number;
115
115
  /** Total LLM calls made */
116
116
  totalLlmCalls: number;
117
- /** Cumulative token usage */
118
- totalTokens?: {
117
+ /**
118
+ * Cumulative token usage breakdown for the run.
119
+ *
120
+ * No `totalTokens` (and no `total` here): an input+output sum mixes
121
+ * differently-priced quantities and nothing consumes it — token analytics
122
+ * aggregate the per-call LlmCallEvent fields. This also keeps
123
+ * `$.totalTokens` scalar-only in the telemetry `event_data` column
124
+ * (LlmCallEvent is the only current producer of that path).
125
+ */
126
+ tokenUsage?: {
119
127
  input: number;
120
128
  output: number;
121
- total: number;
122
129
  };
123
130
  /** If conversation was ended via end_conversation tool */
124
131
  endConversation?: {