@vertesia/common 1.5.0-dev.20260722.120446Z → 1.5.0-dev.20260804.124748Z
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.
- package/lib/access-control-values.d.ts +98 -0
- package/lib/access-control-values.d.ts.map +1 -0
- package/lib/access-control-values.js +101 -0
- package/lib/access-control-values.js.map +1 -0
- package/lib/access-control.d.ts +22 -119
- package/lib/access-control.d.ts.map +1 -1
- package/lib/access-control.js +6 -78
- package/lib/access-control.js.map +1 -1
- package/lib/account-values.d.ts +53 -0
- package/lib/account-values.d.ts.map +1 -0
- package/lib/account-values.js +91 -0
- package/lib/account-values.js.map +1 -0
- package/lib/analytics.d.ts +12 -38
- package/lib/analytics.d.ts.map +1 -1
- package/lib/api-schemas/access-control.d.ts +215 -0
- package/lib/api-schemas/access-control.d.ts.map +1 -0
- package/lib/api-schemas/access-control.js +165 -0
- package/lib/api-schemas/access-control.js.map +1 -0
- package/lib/api-schemas/account.d.ts +101 -0
- package/lib/api-schemas/account.d.ts.map +1 -0
- package/lib/api-schemas/account.js +136 -0
- package/lib/api-schemas/account.js.map +1 -0
- package/lib/api-schemas/adapter.d.ts +80 -0
- package/lib/api-schemas/adapter.d.ts.map +1 -0
- package/lib/api-schemas/adapter.js +726 -0
- package/lib/api-schemas/adapter.js.map +1 -0
- package/lib/api-schemas/agent-runs.d.ts +3781 -0
- package/lib/api-schemas/agent-runs.d.ts.map +1 -0
- package/lib/api-schemas/agent-runs.js +991 -0
- package/lib/api-schemas/agent-runs.js.map +1 -0
- package/lib/api-schemas/analytics.d.ts +86 -0
- package/lib/api-schemas/analytics.d.ts.map +1 -0
- package/lib/api-schemas/analytics.js +58 -0
- package/lib/api-schemas/analytics.js.map +1 -0
- package/lib/api-schemas/apikey.d.ts +231 -0
- package/lib/api-schemas/apikey.d.ts.map +1 -0
- package/lib/api-schemas/apikey.js +172 -0
- package/lib/api-schemas/apikey.js.map +1 -0
- package/lib/api-schemas/app-lifecycle.d.ts +1114 -0
- package/lib/api-schemas/app-lifecycle.d.ts.map +1 -0
- package/lib/api-schemas/app-lifecycle.js +750 -0
- package/lib/api-schemas/app-lifecycle.js.map +1 -0
- package/lib/api-schemas/app-runtime.d.ts +9056 -0
- package/lib/api-schemas/app-runtime.d.ts.map +1 -0
- package/lib/api-schemas/app-runtime.js +782 -0
- package/lib/api-schemas/app-runtime.js.map +1 -0
- package/lib/api-schemas/apps.d.ts +247 -0
- package/lib/api-schemas/apps.d.ts.map +1 -0
- package/lib/api-schemas/apps.js +366 -0
- package/lib/api-schemas/apps.js.map +1 -0
- package/lib/api-schemas/audit-trail.d.ts +465 -0
- package/lib/api-schemas/audit-trail.d.ts.map +1 -0
- package/lib/api-schemas/audit-trail.js +218 -0
- package/lib/api-schemas/audit-trail.js.map +1 -0
- package/lib/api-schemas/bulk-operation.d.ts +104 -0
- package/lib/api-schemas/bulk-operation.d.ts.map +1 -0
- package/lib/api-schemas/bulk-operation.js +66 -0
- package/lib/api-schemas/bulk-operation.js.map +1 -0
- package/lib/api-schemas/commands.d.ts +50 -0
- package/lib/api-schemas/commands.d.ts.map +1 -0
- package/lib/api-schemas/commands.js +58 -0
- package/lib/api-schemas/commands.js.map +1 -0
- package/lib/api-schemas/content.d.ts +3561 -0
- package/lib/api-schemas/content.d.ts.map +1 -0
- package/lib/api-schemas/content.js +842 -0
- package/lib/api-schemas/content.js.map +1 -0
- package/lib/api-schemas/cost-analytics.d.ts +300 -0
- package/lib/api-schemas/cost-analytics.d.ts.map +1 -0
- package/lib/api-schemas/cost-analytics.js +218 -0
- package/lib/api-schemas/cost-analytics.js.map +1 -0
- package/lib/api-schemas/dashboard.d.ts +408 -0
- package/lib/api-schemas/dashboard.d.ts.map +1 -0
- package/lib/api-schemas/dashboard.js +311 -0
- package/lib/api-schemas/dashboard.js.map +1 -0
- package/lib/api-schemas/data-store.d.ts +1650 -0
- package/lib/api-schemas/data-store.d.ts.map +1 -0
- package/lib/api-schemas/data-store.js +504 -0
- package/lib/api-schemas/data-store.js.map +1 -0
- package/lib/api-schemas/document-processing.d.ts +1501 -0
- package/lib/api-schemas/document-processing.d.ts.map +1 -0
- package/lib/api-schemas/document-processing.js +312 -0
- package/lib/api-schemas/document-processing.js.map +1 -0
- package/lib/api-schemas/embeddings.d.ts +184 -0
- package/lib/api-schemas/embeddings.d.ts.map +1 -0
- package/lib/api-schemas/embeddings.js +102 -0
- package/lib/api-schemas/embeddings.js.map +1 -0
- package/lib/api-schemas/environment.d.ts +412 -0
- package/lib/api-schemas/environment.d.ts.map +1 -0
- package/lib/api-schemas/environment.js +170 -0
- package/lib/api-schemas/environment.js.map +1 -0
- package/lib/api-schemas/events.d.ts +4880 -0
- package/lib/api-schemas/events.d.ts.map +1 -0
- package/lib/api-schemas/events.js +832 -0
- package/lib/api-schemas/events.js.map +1 -0
- package/lib/api-schemas/files.d.ts +107 -0
- package/lib/api-schemas/files.d.ts.map +1 -0
- package/lib/api-schemas/files.js +137 -0
- package/lib/api-schemas/files.js.map +1 -0
- package/lib/api-schemas/group.d.ts +122 -0
- package/lib/api-schemas/group.d.ts.map +1 -0
- package/lib/api-schemas/group.js +142 -0
- package/lib/api-schemas/group.js.map +1 -0
- package/lib/api-schemas/index.d.ts +36 -0
- package/lib/api-schemas/index.d.ts.map +1 -0
- package/lib/api-schemas/index.js +36 -0
- package/lib/api-schemas/index.js.map +1 -0
- package/lib/api-schemas/indexing.d.ts +144 -0
- package/lib/api-schemas/indexing.d.ts.map +1 -0
- package/lib/api-schemas/indexing.js +217 -0
- package/lib/api-schemas/indexing.js.map +1 -0
- package/lib/api-schemas/integrations.d.ts +269 -0
- package/lib/api-schemas/integrations.d.ts.map +1 -0
- package/lib/api-schemas/integrations.js +335 -0
- package/lib/api-schemas/integrations.js.map +1 -0
- package/lib/api-schemas/interaction.d.ts +22454 -0
- package/lib/api-schemas/interaction.d.ts.map +1 -0
- package/lib/api-schemas/interaction.js +2065 -0
- package/lib/api-schemas/interaction.js.map +1 -0
- package/lib/api-schemas/invites.d.ts +162 -0
- package/lib/api-schemas/invites.d.ts.map +1 -0
- package/lib/api-schemas/invites.js +106 -0
- package/lib/api-schemas/invites.js.map +1 -0
- package/lib/api-schemas/oauth-server.d.ts +415 -0
- package/lib/api-schemas/oauth-server.d.ts.map +1 -0
- package/lib/api-schemas/oauth-server.js +193 -0
- package/lib/api-schemas/oauth-server.js.map +1 -0
- package/lib/api-schemas/oauth.d.ts +150 -0
- package/lib/api-schemas/oauth.d.ts.map +1 -0
- package/lib/api-schemas/oauth.js +148 -0
- package/lib/api-schemas/oauth.js.map +1 -0
- package/lib/api-schemas/parameters.d.ts +64 -0
- package/lib/api-schemas/parameters.d.ts.map +1 -0
- package/lib/api-schemas/parameters.js +246 -0
- package/lib/api-schemas/parameters.js.map +1 -0
- package/lib/api-schemas/process.d.ts +499 -0
- package/lib/api-schemas/process.d.ts.map +1 -0
- package/lib/api-schemas/process.js +817 -0
- package/lib/api-schemas/process.js.map +1 -0
- package/lib/api-schemas/project-configuration.d.ts +4900 -0
- package/lib/api-schemas/project-configuration.d.ts.map +1 -0
- package/lib/api-schemas/project-configuration.js +425 -0
- package/lib/api-schemas/project-configuration.js.map +1 -0
- package/lib/api-schemas/project.d.ts +7247 -0
- package/lib/api-schemas/project.d.ts.map +1 -0
- package/lib/api-schemas/project.js +185 -0
- package/lib/api-schemas/project.js.map +1 -0
- package/lib/api-schemas/prompt.d.ts +70 -0
- package/lib/api-schemas/prompt.d.ts.map +1 -0
- package/lib/api-schemas/prompt.js +77 -0
- package/lib/api-schemas/prompt.js.map +1 -0
- package/lib/api-schemas/quota.d.ts +90 -0
- package/lib/api-schemas/quota.d.ts.map +1 -0
- package/lib/api-schemas/quota.js +95 -0
- package/lib/api-schemas/quota.js.map +1 -0
- package/lib/api-schemas/registry.d.ts +97458 -0
- package/lib/api-schemas/registry.d.ts.map +1 -0
- package/lib/api-schemas/registry.js +2586 -0
- package/lib/api-schemas/registry.js.map +1 -0
- package/lib/api-schemas/schema-primitives.d.ts +5 -0
- package/lib/api-schemas/schema-primitives.d.ts.map +1 -0
- package/lib/api-schemas/schema-primitives.js +11 -0
- package/lib/api-schemas/schema-primitives.js.map +1 -0
- package/lib/api-schemas/secrets.d.ts +497 -0
- package/lib/api-schemas/secrets.d.ts.map +1 -0
- package/lib/api-schemas/secrets.js +298 -0
- package/lib/api-schemas/secrets.js.map +1 -0
- package/lib/api-schemas/store.d.ts +22140 -0
- package/lib/api-schemas/store.d.ts.map +1 -0
- package/lib/api-schemas/store.js +557 -0
- package/lib/api-schemas/store.js.map +1 -0
- package/lib/api-schemas/sts.d.ts +156 -0
- package/lib/api-schemas/sts.d.ts.map +1 -0
- package/lib/api-schemas/sts.js +96 -0
- package/lib/api-schemas/sts.js.map +1 -0
- package/lib/api-schemas/task.d.ts +215 -0
- package/lib/api-schemas/task.d.ts.map +1 -0
- package/lib/api-schemas/task.js +95 -0
- package/lib/api-schemas/task.js.map +1 -0
- package/lib/api-schemas/tools.d.ts +111 -0
- package/lib/api-schemas/tools.d.ts.map +1 -0
- package/lib/api-schemas/tools.js +122 -0
- package/lib/api-schemas/tools.js.map +1 -0
- package/lib/api-schemas/user.d.ts +208 -0
- package/lib/api-schemas/user.d.ts.map +1 -0
- package/lib/api-schemas/user.js +180 -0
- package/lib/api-schemas/user.js.map +1 -0
- package/lib/api-schemas/view-execution.d.ts +3163 -0
- package/lib/api-schemas/view-execution.d.ts.map +1 -0
- package/lib/api-schemas/view-execution.js +172 -0
- package/lib/api-schemas/view-execution.js.map +1 -0
- package/lib/api-schemas/views.d.ts +5990 -0
- package/lib/api-schemas/views.d.ts.map +1 -0
- package/lib/api-schemas/views.js +396 -0
- package/lib/api-schemas/views.js.map +1 -0
- package/lib/api-schemas/workflow-runs.d.ts +2209 -0
- package/lib/api-schemas/workflow-runs.d.ts.map +1 -0
- package/lib/api-schemas/workflow-runs.js +589 -0
- package/lib/api-schemas/workflow-runs.js.map +1 -0
- package/lib/apikey-values.d.ts +10 -0
- package/lib/apikey-values.d.ts.map +1 -0
- package/lib/apikey-values.js +11 -0
- package/lib/apikey-values.js.map +1 -0
- package/lib/apikey.d.ts +37 -36
- package/lib/apikey.d.ts.map +1 -1
- package/lib/apikey.js +5 -4
- package/lib/apikey.js.map +1 -1
- package/lib/apps.d.ts +116 -1121
- package/lib/apps.d.ts.map +1 -1
- package/lib/apps.js.map +1 -1
- package/lib/ask-user.d.ts +8 -1
- package/lib/ask-user.d.ts.map +1 -1
- package/lib/audit-trail.d.ts +17 -128
- package/lib/audit-trail.d.ts.map +1 -1
- package/lib/audit-trail.js.map +1 -1
- package/lib/browser-credentials.d.ts +11 -106
- package/lib/browser-credentials.d.ts.map +1 -1
- package/lib/common.d.ts +59 -81
- package/lib/common.d.ts.map +1 -1
- package/lib/cost-analytics.d.ts +14 -167
- package/lib/cost-analytics.d.ts.map +1 -1
- package/lib/cost-analytics.js.map +1 -1
- package/lib/data-platform.d.ts +122 -786
- package/lib/data-platform.d.ts.map +1 -1
- package/lib/data-platform.js +41 -61
- package/lib/data-platform.js.map +1 -1
- package/lib/email.d.ts +5 -17
- package/lib/email.d.ts.map +1 -1
- package/lib/email.js +0 -3
- package/lib/email.js.map +1 -1
- package/lib/embeddings.d.ts +14 -56
- package/lib/embeddings.d.ts.map +1 -1
- package/lib/environment.d.ts +19 -113
- package/lib/environment.d.ts.map +1 -1
- package/lib/environment.js +3 -0
- package/lib/environment.js.map +1 -1
- package/lib/facets.d.ts +4 -7
- package/lib/facets.d.ts.map +1 -1
- package/lib/group.d.ts +33 -39
- package/lib/group.d.ts.map +1 -1
- package/lib/group.js +0 -1
- package/lib/group.js.map +1 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/integrations.d.ts +20 -108
- package/lib/integrations.d.ts.map +1 -1
- package/lib/integrations.js.map +1 -1
- package/lib/interaction-values.d.ts +11 -0
- package/lib/interaction-values.d.ts.map +1 -0
- package/lib/interaction-values.js +24 -0
- package/lib/interaction-values.js.map +1 -0
- package/lib/interaction.d.ts +116 -734
- package/lib/interaction.d.ts.map +1 -1
- package/lib/interaction.js +56 -12
- package/lib/interaction.js.map +1 -1
- package/lib/meters.d.ts +11 -7
- package/lib/meters.d.ts.map +1 -1
- package/lib/meters.js.map +1 -1
- package/lib/oauth-server.d.ts +33 -119
- package/lib/oauth-server.d.ts.map +1 -1
- package/lib/oauth.d.ts +14 -96
- package/lib/oauth.d.ts.map +1 -1
- package/lib/oauth.js +0 -4
- package/lib/oauth.js.map +1 -1
- package/lib/payload.d.ts +15 -38
- package/lib/payload.d.ts.map +1 -1
- package/lib/platform-event.d.ts +49 -462
- package/lib/platform-event.d.ts.map +1 -1
- package/lib/platform-event.js.map +1 -1
- package/lib/principal-context.d.ts +10 -15
- package/lib/principal-context.d.ts.map +1 -1
- package/lib/project-values.d.ts +24 -0
- package/lib/project-values.d.ts.map +1 -0
- package/lib/project-values.js +42 -0
- package/lib/project-values.js.map +1 -0
- package/lib/project.d.ts +55 -503
- package/lib/project.d.ts.map +1 -1
- package/lib/project.js +6 -76
- package/lib/project.js.map +1 -1
- package/lib/prompt.d.ts +20 -51
- package/lib/prompt.d.ts.map +1 -1
- package/lib/prompt.js.map +1 -1
- package/lib/query.d.ts +27 -88
- package/lib/query.d.ts.map +1 -1
- package/lib/rate-limiter.d.ts +19 -70
- package/lib/rate-limiter.d.ts.map +1 -1
- package/lib/rate-limiter.js +0 -3
- package/lib/rate-limiter.js.map +1 -1
- package/lib/refs.d.ts +3 -11
- package/lib/refs.d.ts.map +1 -1
- package/lib/refs.js.map +1 -1
- package/lib/roles/types.d.ts +14 -20
- package/lib/roles/types.d.ts.map +1 -1
- package/lib/roles/types.js +5 -9
- package/lib/roles/types.js.map +1 -1
- package/lib/runs.d.ts +6 -25
- package/lib/runs.d.ts.map +1 -1
- package/lib/secrets.d.ts +20 -105
- package/lib/secrets.d.ts.map +1 -1
- package/lib/store/agent-approval.d.ts +5 -14
- package/lib/store/agent-approval.d.ts.map +1 -1
- package/lib/store/agent-approval.js.map +1 -1
- package/lib/store/agent-run.d.ts +63 -342
- package/lib/store/agent-run.d.ts.map +1 -1
- package/lib/store/collections.d.ts +11 -63
- package/lib/store/collections.d.ts.map +1 -1
- package/lib/store/collections.js.map +1 -1
- package/lib/store/conversation-state.d.ts +63 -61
- package/lib/store/conversation-state.d.ts.map +1 -1
- package/lib/store/conversation-state.js +2 -0
- package/lib/store/conversation-state.js.map +1 -1
- package/lib/store/doc-analyzer.d.ts +9 -32
- package/lib/store/doc-analyzer.d.ts.map +1 -1
- package/lib/store/dsl-workflow.d.ts +37 -151
- package/lib/store/dsl-workflow.d.ts.map +1 -1
- package/lib/store/dsl-workflow.js.map +1 -1
- package/lib/store/editing-policy-schema.generated.d.ts +3 -0
- package/lib/store/editing-policy-schema.generated.d.ts.map +1 -0
- package/lib/store/editing-policy-schema.generated.js +28 -0
- package/lib/store/editing-policy-schema.generated.js.map +1 -0
- package/lib/store/grounded-extraction.d.ts +7 -104
- package/lib/store/grounded-extraction.d.ts.map +1 -1
- package/lib/store/grounded-extraction.js.map +1 -1
- package/lib/store/index.d.ts +2 -0
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/index.js +3 -0
- package/lib/store/index.js.map +1 -1
- package/lib/store/intake-policy-schema.generated.d.ts +3 -0
- package/lib/store/intake-policy-schema.generated.d.ts.map +1 -0
- package/lib/store/intake-policy-schema.generated.js +1425 -0
- package/lib/store/intake-policy-schema.generated.js.map +1 -0
- package/lib/store/process-schema.d.ts +80 -0
- package/lib/store/process-schema.d.ts.map +1 -1
- package/lib/store/process-schema.js +79 -0
- package/lib/store/process-schema.js.map +1 -1
- package/lib/store/process-validation.d.ts.map +1 -1
- package/lib/store/process-validation.js +70 -2
- package/lib/store/process-validation.js.map +1 -1
- package/lib/store/process.d.ts +36 -125
- package/lib/store/process.d.ts.map +1 -1
- package/lib/store/process.js.map +1 -1
- package/lib/store/rendering.d.ts +9 -64
- package/lib/store/rendering.d.ts.map +1 -1
- package/lib/store/rendering.js.map +1 -1
- package/lib/store/store.d.ts +98 -693
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +4 -443
- package/lib/store/store.js.map +1 -1
- package/lib/store/task.d.ts +15 -59
- package/lib/store/task.d.ts.map +1 -1
- package/lib/store/task.js +0 -3
- package/lib/store/task.js.map +1 -1
- package/lib/store/workflow.d.ts +56 -516
- package/lib/store/workflow.d.ts.map +1 -1
- package/lib/store/workflow.js +28 -11
- package/lib/store/workflow.js.map +1 -1
- package/lib/sts-token-types.d.ts +12 -66
- package/lib/sts-token-types.d.ts.map +1 -1
- package/lib/sts-token-types.js.map +1 -1
- package/lib/tools.d.ts +8 -100
- package/lib/tools.d.ts.map +1 -1
- package/lib/transient-tokens-values.d.ts +11 -0
- package/lib/transient-tokens-values.d.ts.map +1 -0
- package/lib/transient-tokens-values.js +12 -0
- package/lib/transient-tokens-values.js.map +1 -0
- package/lib/transient-tokens.d.ts +15 -13
- package/lib/transient-tokens.d.ts.map +1 -1
- package/lib/transient-tokens.js +5 -5
- package/lib/transient-tokens.js.map +1 -1
- package/lib/user.d.ts +54 -155
- package/lib/user.d.ts.map +1 -1
- package/lib/user.js +1 -78
- package/lib/user.js.map +1 -1
- package/lib/versions.d.ts +24 -1
- package/lib/versions.d.ts.map +1 -1
- package/lib/versions.js +23 -0
- package/lib/versions.js.map +1 -1
- package/lib/vertesia-common.js +6 -2
- package/lib/vertesia-common.js.map +1 -1
- package/lib/views-schema.d.ts +4 -4
- package/lib/views.d.ts +56 -312
- package/lib/views.d.ts.map +1 -1
- package/lib/views.js.map +1 -1
- package/package.json +14 -5
- package/src/access-control-values.ts +113 -0
- package/src/access-control.ts +33 -138
- package/src/account-values.ts +95 -0
- package/src/agent-resources.test.ts +100 -0
- package/src/analytics.ts +18 -42
- package/src/api-schemas/access-control.contract.test.ts +209 -0
- package/src/api-schemas/access-control.ts +208 -0
- package/src/api-schemas/account.contract.test.ts +318 -0
- package/src/api-schemas/account.ts +150 -0
- package/src/api-schemas/adapter-edge-cases.test.ts +480 -0
- package/src/api-schemas/adapter.ts +778 -0
- package/src/api-schemas/agent-runs.ts +1081 -0
- package/src/api-schemas/analytics.ts +65 -0
- package/src/api-schemas/apikey.contract.test.ts +270 -0
- package/src/api-schemas/apikey.ts +199 -0
- package/src/api-schemas/app-lifecycle.ts +841 -0
- package/src/api-schemas/app-runtime.ts +919 -0
- package/src/api-schemas/apps.ts +415 -0
- package/src/api-schemas/audit-trail.ts +243 -0
- package/src/api-schemas/bulk-operation.contract.test.ts +39 -0
- package/src/api-schemas/bulk-operation.ts +75 -0
- package/src/api-schemas/bundle-isolation.test.ts +80 -0
- package/src/api-schemas/commands.contract.test.ts +51 -0
- package/src/api-schemas/commands.ts +62 -0
- package/src/api-schemas/content.ts +939 -0
- package/src/api-schemas/cost-analytics.contract.test.ts +64 -0
- package/src/api-schemas/cost-analytics.ts +235 -0
- package/src/api-schemas/dashboard.contract.test.ts +127 -0
- package/src/api-schemas/dashboard.ts +351 -0
- package/src/api-schemas/data-store.contract.test.ts +91 -0
- package/src/api-schemas/data-store.ts +571 -0
- package/src/api-schemas/document-processing.contract.test.ts +76 -0
- package/src/api-schemas/document-processing.ts +344 -0
- package/src/api-schemas/embeddings.ts +113 -0
- package/src/api-schemas/environment.contract.test.ts +184 -0
- package/src/api-schemas/environment.ts +190 -0
- package/src/api-schemas/events.ts +921 -0
- package/src/api-schemas/files.ts +159 -0
- package/src/api-schemas/group.contract.test.ts +205 -0
- package/src/api-schemas/group.ts +155 -0
- package/src/api-schemas/index.ts +35 -0
- package/src/api-schemas/indexing.contract.test.ts +83 -0
- package/src/api-schemas/indexing.ts +234 -0
- package/src/api-schemas/integrations.ts +369 -0
- package/src/api-schemas/interaction.ts +2357 -0
- package/src/api-schemas/invites.contract.test.ts +268 -0
- package/src/api-schemas/invites.ts +127 -0
- package/src/api-schemas/llumiverse.contract.test.ts +108 -0
- package/src/api-schemas/oauth-server.ts +219 -0
- package/src/api-schemas/oauth.contract.test.ts +118 -0
- package/src/api-schemas/oauth.ts +166 -0
- package/src/api-schemas/parameters.test.ts +402 -0
- package/src/api-schemas/parameters.ts +310 -0
- package/src/api-schemas/process.ts +929 -0
- package/src/api-schemas/project-configuration.ts +478 -0
- package/src/api-schemas/project.contract.test.ts +365 -0
- package/src/api-schemas/project.ts +214 -0
- package/src/api-schemas/prompt.ts +88 -0
- package/src/api-schemas/pruning-limits.test.ts +189 -0
- package/src/api-schemas/quota.contract.test.ts +147 -0
- package/src/api-schemas/quota.ts +122 -0
- package/src/api-schemas/registry-groups.test.ts +91 -0
- package/src/api-schemas/registry.ts +3487 -0
- package/src/api-schemas/response-pruning.test.ts +260 -0
- package/src/api-schemas/schema-primitives.ts +12 -0
- package/src/api-schemas/secrets.ts +332 -0
- package/src/api-schemas/store.contract.test.ts +450 -0
- package/src/api-schemas/store.ts +604 -0
- package/src/api-schemas/sts.contract.test.ts +80 -0
- package/src/api-schemas/sts.ts +110 -0
- package/src/api-schemas/task.ts +104 -0
- package/src/api-schemas/tools.ts +140 -0
- package/src/api-schemas/user.contract.test.ts +191 -0
- package/src/api-schemas/user.ts +204 -0
- package/src/api-schemas/view-execution.ts +200 -0
- package/src/api-schemas/views.ts +437 -0
- package/src/api-schemas/workflow-runs.ts +653 -0
- package/src/apikey-values.ts +10 -0
- package/src/apikey.ts +49 -40
- package/src/apps.ts +249 -1179
- package/src/ask-user.ts +9 -1
- package/src/audit-trail.ts +45 -137
- package/src/browser-credentials.ts +21 -106
- package/src/common.ts +67 -78
- package/src/cost-analytics.ts +37 -176
- package/src/data-platform.ts +205 -776
- package/src/email.ts +5 -17
- package/src/embeddings.ts +22 -60
- package/src/environment.ts +52 -124
- package/src/facets.ts +4 -7
- package/src/group.ts +38 -42
- package/src/index.ts +11 -0
- package/src/integrations.ts +39 -129
- package/src/interaction-values.ts +23 -0
- package/src/interaction.ts +231 -841
- package/src/meters.ts +11 -7
- package/src/oauth-server.ts +58 -127
- package/src/oauth.ts +24 -108
- package/src/payload.ts +25 -40
- package/src/platform-event.ts +98 -484
- package/src/principal-context.ts +11 -15
- package/src/project-values.ts +41 -0
- package/src/project.ts +116 -588
- package/src/prompt.ts +34 -61
- package/src/query.ts +34 -93
- package/src/rate-limiter.ts +27 -75
- package/src/refs.ts +4 -11
- package/src/roles/types.ts +20 -20
- package/src/runs.ts +11 -24
- package/src/secrets.ts +38 -117
- package/src/store/agent-approval.ts +9 -14
- package/src/store/agent-run.ts +106 -434
- package/src/store/collections.ts +21 -63
- package/src/store/content-type-editing.test.ts +17 -0
- package/src/store/conversation-state.ts +78 -64
- package/src/store/doc-analyzer.ts +17 -33
- package/src/store/dsl-workflow.ts +62 -158
- package/src/store/editing-policy-schema.generated.ts +30 -0
- package/src/store/grounded-extraction.ts +13 -104
- package/src/store/index.ts +3 -0
- package/src/store/intake-policy-schema.generated.ts +1442 -0
- package/src/store/process-schema.test.ts +43 -0
- package/src/store/process-schema.ts +79 -0
- package/src/store/process-validation.test.ts +141 -0
- package/src/store/process-validation.ts +82 -2
- package/src/store/process.ts +70 -146
- package/src/store/rendering.ts +15 -64
- package/src/store/store.ts +197 -1182
- package/src/store/task.ts +25 -59
- package/src/store/workflow.ts +103 -554
- package/src/sts-token-types.ts +24 -75
- package/src/tools.ts +18 -97
- package/src/transient-tokens-values.ts +11 -0
- package/src/transient-tokens.ts +16 -13
- package/src/user.ts +74 -214
- package/src/versions.ts +24 -0
- package/src/views-schema.test.ts +9 -1
- package/src/views.ts +106 -329
|
@@ -0,0 +1,991 @@
|
|
|
1
|
+
// Runtime schemas for the agent runs API domain.
|
|
2
|
+
import { ExecutionTokenUsageSchema } from '@llumiverse/common/schemas';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { AgentEventType, LlmCallType, TelemetryToolType } from '../workflow-analytics.js';
|
|
5
|
+
import * as AppLifecycleSchemas from './app-lifecycle.js';
|
|
6
|
+
import { AgentRunStatusSchema, ContentObjectTypeRefSchema, ConversationActivityStateSchema, EventRefSchema, RunKindSchema, RunTypeSchema, } from './app-lifecycle.js';
|
|
7
|
+
import { AgentResourceReferenceSchema, AgentSearchScopeSchema, AgentToolApprovalModeSchema, ConversationVisibilitySchema, InitialToolCallSchema, InteractionRefSchema, PlanTaskSchema, RunSourceSchema, UserChannelSchema, } from './interaction.js';
|
|
8
|
+
import * as ProcessSchemas from './process.js';
|
|
9
|
+
import { ProcessDefinitionBodySchema, ProcessRunConfigSchema, ProcessStateSchema, RecordProcessRunPayloadSchema, } from './process.js';
|
|
10
|
+
import { AgentCheckpointConfigurationSchema } from './project-configuration.js';
|
|
11
|
+
import { nullableStringSchema } from './schema-primitives.js';
|
|
12
|
+
import { InteractionExecutionConfigurationSchema } from './store.js';
|
|
13
|
+
const agentEventBase = {
|
|
14
|
+
timestamp: z.string(),
|
|
15
|
+
runId: z.string(),
|
|
16
|
+
agentRunId: z.string().optional(),
|
|
17
|
+
model: z.string(),
|
|
18
|
+
environmentId: z.string(),
|
|
19
|
+
environmentType: z.string(),
|
|
20
|
+
interactionId: z.string(),
|
|
21
|
+
parentRunId: z.string().optional(),
|
|
22
|
+
ancestorRunIds: z.array(z.string()).optional(),
|
|
23
|
+
};
|
|
24
|
+
const AgentRunStartedEventSchema = z.strictObject({
|
|
25
|
+
...agentEventBase,
|
|
26
|
+
eventType: z.literal(AgentEventType.AgentRunStarted),
|
|
27
|
+
interactive: z.boolean(),
|
|
28
|
+
taskId: z.string().optional(),
|
|
29
|
+
userChannels: z.array(z.string()).optional(),
|
|
30
|
+
});
|
|
31
|
+
const AgentRunCompletedEventSchema = z.strictObject({
|
|
32
|
+
...agentEventBase,
|
|
33
|
+
eventType: z.literal(AgentEventType.AgentRunCompleted),
|
|
34
|
+
success: z.boolean(),
|
|
35
|
+
durationMs: z.number(),
|
|
36
|
+
errorType: z.string().optional(),
|
|
37
|
+
errorMessage: z.string().optional(),
|
|
38
|
+
totalIterations: z.number(),
|
|
39
|
+
totalToolCalls: z.number(),
|
|
40
|
+
totalLlmCalls: z.number(),
|
|
41
|
+
totalTokens: z
|
|
42
|
+
.strictObject({
|
|
43
|
+
input: z.number(),
|
|
44
|
+
output: z.number(),
|
|
45
|
+
total: z.number(),
|
|
46
|
+
})
|
|
47
|
+
.optional(),
|
|
48
|
+
endConversation: z
|
|
49
|
+
.strictObject({
|
|
50
|
+
status: z.enum(['success', 'failure']),
|
|
51
|
+
reason: z.string().optional(),
|
|
52
|
+
})
|
|
53
|
+
.optional(),
|
|
54
|
+
});
|
|
55
|
+
const LlmCallEventSchema = z.strictObject({
|
|
56
|
+
...agentEventBase,
|
|
57
|
+
eventType: z.literal(AgentEventType.LlmCall),
|
|
58
|
+
promptTokens: z.number(),
|
|
59
|
+
promptCachedTokens: z.number().optional(),
|
|
60
|
+
promptCacheWriteTokens: z.number().optional(),
|
|
61
|
+
completionTokens: z.number(),
|
|
62
|
+
totalTokens: z.number(),
|
|
63
|
+
durationMs: z.number(),
|
|
64
|
+
success: z.boolean(),
|
|
65
|
+
streamingEnabled: z.boolean(),
|
|
66
|
+
toolUseCount: z.number(),
|
|
67
|
+
callType: z.enum(LlmCallType),
|
|
68
|
+
attemptNumber: z.number().optional(),
|
|
69
|
+
errorType: z.string().optional(),
|
|
70
|
+
// `NestedInteractionEvent` — an interaction executed from inside a tool — is an `LlmCallEvent`
|
|
71
|
+
// with three more fields and the same `eventType`, so it cannot be a branch of its own and has to
|
|
72
|
+
// widen this one. They are optional because a plain LLM call carries none of them; the three
|
|
73
|
+
// travel together, pinned by `callType: 'nested_interaction'`.
|
|
74
|
+
nestedInteractionId: z.string().optional(),
|
|
75
|
+
toolName: z.string().optional(),
|
|
76
|
+
toolType: z.enum(TelemetryToolType).optional(),
|
|
77
|
+
});
|
|
78
|
+
const ToolCallEventSchema = z.strictObject({
|
|
79
|
+
...agentEventBase,
|
|
80
|
+
eventType: z.literal(AgentEventType.ToolCall),
|
|
81
|
+
toolName: z.string(),
|
|
82
|
+
toolUseId: z.string(),
|
|
83
|
+
toolType: z.enum(TelemetryToolType),
|
|
84
|
+
iteration: z.number(),
|
|
85
|
+
parameters: z.record(z.string(), z.unknown()).optional(),
|
|
86
|
+
parametersSizeBytes: z.number().optional(),
|
|
87
|
+
success: z.boolean(),
|
|
88
|
+
durationMs: z.number(),
|
|
89
|
+
resultSizeBytes: z.number().optional(),
|
|
90
|
+
errorType: z.string().optional(),
|
|
91
|
+
errorMessage: z.string().optional(),
|
|
92
|
+
spawnedChildWorkflow: z.boolean().optional(),
|
|
93
|
+
});
|
|
94
|
+
export const AgentEventSchema = z
|
|
95
|
+
.discriminatedUnion('eventType', [
|
|
96
|
+
AgentRunStartedEventSchema,
|
|
97
|
+
AgentRunCompletedEventSchema,
|
|
98
|
+
LlmCallEventSchema,
|
|
99
|
+
ToolCallEventSchema,
|
|
100
|
+
])
|
|
101
|
+
.meta({ id: 'AgentEvent' });
|
|
102
|
+
export const IngestAgentEventsPayloadSchema = z
|
|
103
|
+
.strictObject({
|
|
104
|
+
events: z.array(AgentEventSchema),
|
|
105
|
+
})
|
|
106
|
+
.meta({ id: 'IngestAgentEventsPayload' });
|
|
107
|
+
export const IngestAgentEventsResponseSchema = z
|
|
108
|
+
.strictObject({
|
|
109
|
+
ingested: z.number(),
|
|
110
|
+
status: z.string().optional(),
|
|
111
|
+
error: z.string().optional(),
|
|
112
|
+
})
|
|
113
|
+
.meta({ id: 'IngestAgentEventsResponse' });
|
|
114
|
+
export const AgentMessageTypeSchema = z
|
|
115
|
+
.union([
|
|
116
|
+
z.literal(0),
|
|
117
|
+
z.literal(1),
|
|
118
|
+
z.literal(2),
|
|
119
|
+
z.literal(3),
|
|
120
|
+
z.literal(4),
|
|
121
|
+
z.literal(5),
|
|
122
|
+
z.literal(6),
|
|
123
|
+
z.literal(7),
|
|
124
|
+
z.literal(8),
|
|
125
|
+
z.literal(9),
|
|
126
|
+
z.literal(10),
|
|
127
|
+
z.literal(11),
|
|
128
|
+
z.literal(12),
|
|
129
|
+
z.literal(13),
|
|
130
|
+
z.literal(14),
|
|
131
|
+
])
|
|
132
|
+
.meta({
|
|
133
|
+
id: 'AgentMessageType',
|
|
134
|
+
anyOf: undefined,
|
|
135
|
+
type: 'number',
|
|
136
|
+
enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
|
|
137
|
+
});
|
|
138
|
+
export const AgentRunArtifactPathArraySchema = z.array(z.string()).meta({ id: 'AgentRunArtifactPathArray' });
|
|
139
|
+
export const UpdateAgentArtifactContentResponseSchema = z
|
|
140
|
+
.strictObject({
|
|
141
|
+
path: z.string(),
|
|
142
|
+
generation: z.string(),
|
|
143
|
+
})
|
|
144
|
+
.meta({ id: 'UpdateAgentArtifactContentResponse', description: 'Result of a conditional agent artifact update.' });
|
|
145
|
+
export const UpdateAgentArtifactContentPayloadSchema = z
|
|
146
|
+
.strictObject({
|
|
147
|
+
content: z.string(),
|
|
148
|
+
generation: z.string(),
|
|
149
|
+
})
|
|
150
|
+
.meta({ id: 'UpdateAgentArtifactContentPayload', description: 'Conditional text update for an agent artifact.' });
|
|
151
|
+
export const TerminateAgentRunResponseSchema = z
|
|
152
|
+
.strictObject({
|
|
153
|
+
message: z.string(),
|
|
154
|
+
reason: z.string().optional(),
|
|
155
|
+
})
|
|
156
|
+
.meta({ id: 'TerminateAgentRunResponse', description: 'Response from terminating an agent run.' });
|
|
157
|
+
export const SignalAgentPayloadSchema = z.looseObject({}).meta({
|
|
158
|
+
id: 'SignalAgentPayload',
|
|
159
|
+
additionalProperties: true,
|
|
160
|
+
description: 'Generic signal payload sent to a running agent workflow.',
|
|
161
|
+
});
|
|
162
|
+
const AgentRunTypeSchema = AppLifecycleSchemas.AgentRunTypeSchema;
|
|
163
|
+
export const PostAgentRunUpdateResponseSchema = z
|
|
164
|
+
.strictObject({
|
|
165
|
+
success: z.boolean(),
|
|
166
|
+
})
|
|
167
|
+
.meta({ id: 'PostAgentRunUpdateResponse', description: 'Response from posting an agent update.' });
|
|
168
|
+
export const FileProcessingStatusSchema = z.enum(['uploading', 'processing', 'ready', 'error']).meta({
|
|
169
|
+
id: 'FileProcessingStatus',
|
|
170
|
+
description: 'Status of a file being processed for conversation use.',
|
|
171
|
+
});
|
|
172
|
+
export const AgentRunArchiveStateSchema = z.enum(['none', 'pending', 'archiving', 'complete', 'failed']).meta({
|
|
173
|
+
id: 'AgentRunArchiveState',
|
|
174
|
+
description: 'Archive lifecycle state for an agent run.\n\n- `none`: No archive exists (default)\n- `pending`: Terminal status recorded; archive workflow triggered\n- `archiving`: Archive workflow is running\n- `complete`: Archive stored in GCS successfully\n- `failed`: Archive attempt failed (see `last_archive_error`)',
|
|
175
|
+
});
|
|
176
|
+
export const ResourceRefSchema = z
|
|
177
|
+
.strictObject({
|
|
178
|
+
id: z.string(),
|
|
179
|
+
name: z.string(),
|
|
180
|
+
type: z.string(),
|
|
181
|
+
email: z.string().optional(),
|
|
182
|
+
description: z.string().optional(),
|
|
183
|
+
version: z.number().optional(),
|
|
184
|
+
status: z.string().optional(),
|
|
185
|
+
tags: z.array(z.string()).optional(),
|
|
186
|
+
endpoint: z.string().optional(),
|
|
187
|
+
})
|
|
188
|
+
.meta({ id: 'ResourceRef' });
|
|
189
|
+
export const AgentArtifactContentResponseSchema = z
|
|
190
|
+
.strictObject({
|
|
191
|
+
path: z.string(),
|
|
192
|
+
content: z.string(),
|
|
193
|
+
generation: z.string(),
|
|
194
|
+
})
|
|
195
|
+
.meta({
|
|
196
|
+
id: 'AgentArtifactContentResponse',
|
|
197
|
+
description: 'Text content and concurrency token for an agent artifact.',
|
|
198
|
+
});
|
|
199
|
+
export const AgentArtifactUrlResponseSchema = z
|
|
200
|
+
.strictObject({
|
|
201
|
+
url: z.string(),
|
|
202
|
+
path: z.string(),
|
|
203
|
+
})
|
|
204
|
+
.meta({ id: 'AgentArtifactUrlResponse', description: 'Signed artifact URL response for agent artifacts.' });
|
|
205
|
+
export const SignalAgentResponseSchema = z
|
|
206
|
+
.strictObject({
|
|
207
|
+
status: z.string(),
|
|
208
|
+
message: z.string(),
|
|
209
|
+
})
|
|
210
|
+
.meta({ id: 'SignalAgentResponse', description: 'Response from signaling an agent workflow.' });
|
|
211
|
+
const AgentRunSearchHitSchema = AppLifecycleSchemas.AgentRunSearchHitSchema;
|
|
212
|
+
export const ConversationFileSchema = z
|
|
213
|
+
.strictObject({
|
|
214
|
+
id: z.string().meta({ description: 'Unique ID for tracking this file (generated client-side)' }),
|
|
215
|
+
name: z.string().meta({ description: 'Original filename' }),
|
|
216
|
+
content_type: z.string().meta({ description: 'MIME type' }),
|
|
217
|
+
size: z.number().meta({ description: 'Size in bytes' }),
|
|
218
|
+
status: FileProcessingStatusSchema.meta({ description: 'Current processing status' }),
|
|
219
|
+
artifact_path: z
|
|
220
|
+
.string()
|
|
221
|
+
.meta({ description: 'Artifact path (e.g., "files/document.pdf") - set after upload' })
|
|
222
|
+
.optional(),
|
|
223
|
+
reference: z
|
|
224
|
+
.string()
|
|
225
|
+
.meta({ description: 'Full artifact reference URI (e.g., "artifact:files/document.pdf")' })
|
|
226
|
+
.optional(),
|
|
227
|
+
md_path: z
|
|
228
|
+
.string()
|
|
229
|
+
.meta({ description: 'Path to extracted text markdown (e.g., "files/document.pdf.md")' })
|
|
230
|
+
.optional(),
|
|
231
|
+
text_extracted: z.boolean().meta({ description: 'Whether text extraction completed successfully' }).optional(),
|
|
232
|
+
error: z.string().meta({ description: 'Error message if status is ERROR' }).optional(),
|
|
233
|
+
started_at: z.number().meta({ description: 'Timestamp when upload started' }),
|
|
234
|
+
completed_at: z.number().meta({ description: 'Timestamp when processing completed' }).optional(),
|
|
235
|
+
})
|
|
236
|
+
.meta({ id: 'ConversationFile', description: 'Represents a file being processed in a conversation workflow.' });
|
|
237
|
+
export const AutonomousRunResponseSchema = z
|
|
238
|
+
.strictObject({
|
|
239
|
+
interaction: z.string().meta({ description: 'Interaction ID or code (e.g. "sys:generic_question").' }),
|
|
240
|
+
data: z.looseObject({}).meta({ description: 'Input parameters, typed per interaction' }).optional(),
|
|
241
|
+
config: InteractionExecutionConfigurationSchema.meta({
|
|
242
|
+
description: 'Execution configuration (environment, model, model_options, etc.)',
|
|
243
|
+
}).optional(),
|
|
244
|
+
interactive: z.boolean().meta({ description: 'Whether the agent accepts user input' }).optional(),
|
|
245
|
+
tool_approval_mode: AgentToolApprovalModeSchema.meta({
|
|
246
|
+
description: 'How side-effecting tool actions are approved for interactive runs.',
|
|
247
|
+
}).optional(),
|
|
248
|
+
tool_names: z
|
|
249
|
+
.array(z.string())
|
|
250
|
+
.meta({ description: 'Tools configured for this run (+/- syntax supported)' })
|
|
251
|
+
.optional(),
|
|
252
|
+
initial_skills: z
|
|
253
|
+
.array(z.string())
|
|
254
|
+
.meta({ description: 'Builtin system skills activated before the first model turn.' })
|
|
255
|
+
.optional(),
|
|
256
|
+
initial_tool_calls: z
|
|
257
|
+
.array(InitialToolCallSchema)
|
|
258
|
+
.meta({ description: 'Ordered, bounded hydration/read calls executed before the first model turn.' })
|
|
259
|
+
.optional(),
|
|
260
|
+
excluded_tools: z
|
|
261
|
+
.array(z.string())
|
|
262
|
+
.meta({
|
|
263
|
+
description: 'Hard denylist of tool names: never exposed to the model, refused at execution time.',
|
|
264
|
+
})
|
|
265
|
+
.optional(),
|
|
266
|
+
collection_id: z.string().meta({ description: 'Scoped collection (if any)' }).optional(),
|
|
267
|
+
disabled_mcp_collections: z
|
|
268
|
+
.array(z.string())
|
|
269
|
+
.meta({
|
|
270
|
+
description: 'Denylist of MCP tool-collection ids deactivated for this run. `undefined`/empty means all installed/connected MCP collections are active (back-compat, and new servers stay active by default). Listed collections are excluded even if connected.',
|
|
271
|
+
})
|
|
272
|
+
.optional(),
|
|
273
|
+
content_type: ContentObjectTypeRefSchema.meta({
|
|
274
|
+
description: 'Content type linked to this run — defines the schema for `properties`',
|
|
275
|
+
}).optional(),
|
|
276
|
+
visibility: ConversationVisibilitySchema.meta({ description: 'Conversation/process visibility' }).optional(),
|
|
277
|
+
tags: z.array(z.string()).meta({ description: 'User-defined or system tags for categorization' }).optional(),
|
|
278
|
+
categories: z.array(z.string()).meta({ description: 'Categories for organizing runs' }).optional(),
|
|
279
|
+
properties: z
|
|
280
|
+
.looseObject({})
|
|
281
|
+
.meta({ description: 'Business metadata — typed by the linked content_type schema' })
|
|
282
|
+
.optional(),
|
|
283
|
+
source: RunSourceSchema.meta({ description: 'How the run was started' }).optional(),
|
|
284
|
+
schedule_id: z
|
|
285
|
+
.string()
|
|
286
|
+
.meta({ description: 'Schedule ID — set when this run was triggered by a Temporal schedule' })
|
|
287
|
+
.optional(),
|
|
288
|
+
source_type: AgentRunTypeSchema.meta({ description: 'Replacement for legacy AgentRun.type' }).optional(),
|
|
289
|
+
type: AgentRunTypeSchema.meta({
|
|
290
|
+
description: 'Deprecated: Use source_type for creation source and run_type for runtime mode.',
|
|
291
|
+
deprecated: true,
|
|
292
|
+
'x-deprecated-message': 'Use source_type for creation source and run_type for runtime mode.',
|
|
293
|
+
}).optional(),
|
|
294
|
+
id: z.string().meta({ description: 'The stable identifier used by all client code' }),
|
|
295
|
+
run_kind: z.literal('agent').meta({ description: 'Internal discriminator key' }),
|
|
296
|
+
run_type: z.literal('autonomous'),
|
|
297
|
+
account: z.string().meta({ description: 'Account ID' }),
|
|
298
|
+
project: z.string().meta({ description: 'Project ID' }),
|
|
299
|
+
workflow_id: z.string().meta({ description: 'Temporal workflow ID (stable across continueAsNew)' }).optional(),
|
|
300
|
+
first_workflow_run_id: z
|
|
301
|
+
.string()
|
|
302
|
+
.meta({ description: 'First Temporal workflow run ID (used for Redis channel and artifact resolution)' })
|
|
303
|
+
.optional(),
|
|
304
|
+
artifacts_path: z.string().meta({ description: 'Artifact storage path for this run' }).optional(),
|
|
305
|
+
status: AgentRunStatusSchema.meta({ description: 'Current status of the agent run' }),
|
|
306
|
+
activity_state: ConversationActivityStateSchema.meta({
|
|
307
|
+
description: 'Whether the agent is currently working or idle (waiting for user input)',
|
|
308
|
+
}).optional(),
|
|
309
|
+
started_by: z.string().meta({ description: 'User or service that initiated the run' }),
|
|
310
|
+
started_at: z.string().meta({ description: 'When the run started', format: 'date-time' }),
|
|
311
|
+
completed_at: z
|
|
312
|
+
.string()
|
|
313
|
+
.meta({ description: 'When the run completed (or failed/cancelled)', format: 'date-time' })
|
|
314
|
+
.optional(),
|
|
315
|
+
title: z.string().meta({ description: 'Conversation title (short, human-readable)' }).optional(),
|
|
316
|
+
event_subscription_id: z
|
|
317
|
+
.string()
|
|
318
|
+
.meta({ description: 'Event subscription ID — set when this run was triggered by the event bus.' })
|
|
319
|
+
.optional(),
|
|
320
|
+
event_ref: EventRefSchema.meta({
|
|
321
|
+
description: 'Event reference — set when this run was triggered by the event bus.',
|
|
322
|
+
}).optional(),
|
|
323
|
+
archive_state: AgentRunArchiveStateSchema.meta({ description: 'Archive lifecycle state' }).optional(),
|
|
324
|
+
created_at: z.string().meta({ description: 'Timestamp when the document was created', format: 'date-time' }),
|
|
325
|
+
updated_at: z
|
|
326
|
+
.string()
|
|
327
|
+
.meta({ description: 'Timestamp when the document was last updated', format: 'date-time' }),
|
|
328
|
+
interaction_name: z.string().meta({ description: 'Human-readable interaction name' }).optional(),
|
|
329
|
+
interactionRef: InteractionRefSchema,
|
|
330
|
+
environmentRef: ResourceRefSchema.meta({
|
|
331
|
+
description: 'Resolved environment reference (name resolved from `config.environment` id). Populated by the list endpoint; may be absent on other endpoints or when the id cannot be resolved, in which case consumers should fall back to `config.environment`.',
|
|
332
|
+
}).optional(),
|
|
333
|
+
topic: z
|
|
334
|
+
.string()
|
|
335
|
+
.meta({ description: 'Conversation topic (longer description from topic analysis)' })
|
|
336
|
+
.optional(),
|
|
337
|
+
lessons_learned: z
|
|
338
|
+
.array(z.string())
|
|
339
|
+
.meta({ description: 'Lessons learned from the conversation (extracted at completion)' })
|
|
340
|
+
.optional(),
|
|
341
|
+
archived_at: z
|
|
342
|
+
.string()
|
|
343
|
+
.meta({ description: 'When the last successful archive completed', format: 'date-time' })
|
|
344
|
+
.optional(),
|
|
345
|
+
archive_version: z
|
|
346
|
+
.number()
|
|
347
|
+
.meta({ description: 'Archive format version (for forward compatibility)' })
|
|
348
|
+
.optional(),
|
|
349
|
+
last_archive_error: z
|
|
350
|
+
.string()
|
|
351
|
+
.meta({ description: "Last archive error message (when archive_state === 'failed')" })
|
|
352
|
+
.optional(),
|
|
353
|
+
forked_from: z
|
|
354
|
+
.string()
|
|
355
|
+
.meta({ description: 'Source agent run ID when this run was forked (enables message history chaining)' })
|
|
356
|
+
.optional(),
|
|
357
|
+
})
|
|
358
|
+
.meta({
|
|
359
|
+
id: 'AutonomousRunResponse',
|
|
360
|
+
description: 'AgentRun — the client-facing stable identity for a running or completed agent.\n\nAll operations use `id` as the sole identifier. Temporal workflow internals are never exposed to clients.',
|
|
361
|
+
});
|
|
362
|
+
export const AgentRunSchema = z
|
|
363
|
+
.strictObject({
|
|
364
|
+
interaction: z.string().meta({ description: 'Interaction ID or code (e.g. "sys:generic_question").' }),
|
|
365
|
+
data: z.looseObject({}).meta({ description: 'Input parameters, typed per interaction' }).optional(),
|
|
366
|
+
config: InteractionExecutionConfigurationSchema.meta({
|
|
367
|
+
description: 'Execution configuration (environment, model, model_options, etc.)',
|
|
368
|
+
}).optional(),
|
|
369
|
+
interactive: z.boolean().meta({ description: 'Whether the agent accepts user input' }).optional(),
|
|
370
|
+
tool_approval_mode: AgentToolApprovalModeSchema.meta({
|
|
371
|
+
description: 'How side-effecting tool actions are approved for interactive runs.',
|
|
372
|
+
}).optional(),
|
|
373
|
+
tool_names: z
|
|
374
|
+
.array(z.string())
|
|
375
|
+
.meta({ description: 'Tools configured for this run (+/- syntax supported)' })
|
|
376
|
+
.optional(),
|
|
377
|
+
initial_skills: z
|
|
378
|
+
.array(z.string())
|
|
379
|
+
.meta({ description: 'Builtin system skills activated before the first model turn.' })
|
|
380
|
+
.optional(),
|
|
381
|
+
initial_tool_calls: z
|
|
382
|
+
.array(InitialToolCallSchema)
|
|
383
|
+
.meta({ description: 'Ordered, bounded hydration/read calls executed before the first model turn.' })
|
|
384
|
+
.optional(),
|
|
385
|
+
excluded_tools: z
|
|
386
|
+
.array(z.string())
|
|
387
|
+
.meta({
|
|
388
|
+
description: 'Hard denylist of tool names: never exposed to the model, refused at execution time.',
|
|
389
|
+
})
|
|
390
|
+
.optional(),
|
|
391
|
+
collection_id: z.string().meta({ description: 'Scoped collection (if any)' }).optional(),
|
|
392
|
+
disabled_mcp_collections: z
|
|
393
|
+
.array(z.string())
|
|
394
|
+
.meta({
|
|
395
|
+
description: 'Denylist of MCP tool-collection ids deactivated for this run. `undefined`/empty means all installed/connected MCP collections are active (back-compat, and new servers stay active by default). Listed collections are excluded even if connected.',
|
|
396
|
+
})
|
|
397
|
+
.optional(),
|
|
398
|
+
content_type: ContentObjectTypeRefSchema.meta({
|
|
399
|
+
description: 'Content type linked to this run — defines the schema for `properties`',
|
|
400
|
+
}).optional(),
|
|
401
|
+
visibility: ConversationVisibilitySchema.meta({ description: 'Conversation/process visibility' }).optional(),
|
|
402
|
+
tags: z.array(z.string()).meta({ description: 'User-defined or system tags for categorization' }).optional(),
|
|
403
|
+
categories: z.array(z.string()).meta({ description: 'Categories for organizing runs' }).optional(),
|
|
404
|
+
properties: z
|
|
405
|
+
.looseObject({})
|
|
406
|
+
.meta({ description: 'Business metadata — typed by the linked content_type schema' })
|
|
407
|
+
.optional(),
|
|
408
|
+
source: RunSourceSchema.meta({ description: 'How the run was started' }).optional(),
|
|
409
|
+
schedule_id: z
|
|
410
|
+
.string()
|
|
411
|
+
.meta({ description: 'Schedule ID — set when this run was triggered by a Temporal schedule' })
|
|
412
|
+
.optional(),
|
|
413
|
+
source_type: AgentRunTypeSchema.meta({ description: 'Replacement for legacy AgentRun.type' }).optional(),
|
|
414
|
+
type: AgentRunTypeSchema.meta({
|
|
415
|
+
description: 'Deprecated: Use source_type for creation source and run_type for runtime mode.',
|
|
416
|
+
deprecated: true,
|
|
417
|
+
'x-deprecated-message': 'Use source_type for creation source and run_type for runtime mode.',
|
|
418
|
+
}).optional(),
|
|
419
|
+
id: z.string().meta({ description: 'The stable identifier used by all client code' }),
|
|
420
|
+
run_kind: z.literal('agent').meta({ description: 'Internal discriminator key' }),
|
|
421
|
+
run_type: z.literal('autonomous').meta({ description: 'Public-facing runtime mode' }),
|
|
422
|
+
account: z.string().meta({ description: 'Account ID' }),
|
|
423
|
+
project: z.string().meta({ description: 'Project ID' }),
|
|
424
|
+
workflow_id: z.string().meta({ description: 'Temporal workflow ID (stable across continueAsNew)' }).optional(),
|
|
425
|
+
first_workflow_run_id: z
|
|
426
|
+
.string()
|
|
427
|
+
.meta({ description: 'First Temporal workflow run ID (used for Redis channel and artifact resolution)' })
|
|
428
|
+
.optional(),
|
|
429
|
+
artifacts_path: z.string().meta({ description: 'Artifact storage path for this run' }).optional(),
|
|
430
|
+
status: AgentRunStatusSchema.meta({ description: 'Current status of the agent run' }),
|
|
431
|
+
activity_state: ConversationActivityStateSchema.meta({
|
|
432
|
+
description: 'Whether the agent is currently working or idle (waiting for user input)',
|
|
433
|
+
}).optional(),
|
|
434
|
+
started_by: z.string().meta({ description: 'User or service that initiated the run' }),
|
|
435
|
+
started_at: z.string().meta({ description: 'When the run started', format: 'date-time' }),
|
|
436
|
+
completed_at: z
|
|
437
|
+
.string()
|
|
438
|
+
.meta({ description: 'When the run completed (or failed/cancelled)', format: 'date-time' })
|
|
439
|
+
.optional(),
|
|
440
|
+
title: z.string().meta({ description: 'Conversation title (short, human-readable)' }).optional(),
|
|
441
|
+
event_subscription_id: z
|
|
442
|
+
.string()
|
|
443
|
+
.meta({ description: 'Event subscription ID — set when this run was triggered by the event bus.' })
|
|
444
|
+
.optional(),
|
|
445
|
+
event_ref: EventRefSchema.meta({
|
|
446
|
+
description: 'Event reference — set when this run was triggered by the event bus.',
|
|
447
|
+
}).optional(),
|
|
448
|
+
archive_state: AgentRunArchiveStateSchema.meta({ description: 'Archive lifecycle state' }).optional(),
|
|
449
|
+
created_at: z.string().meta({ description: 'Timestamp when the document was created', format: 'date-time' }),
|
|
450
|
+
updated_at: z
|
|
451
|
+
.string()
|
|
452
|
+
.meta({ description: 'Timestamp when the document was last updated', format: 'date-time' }),
|
|
453
|
+
interaction_name: z.string().meta({ description: 'Human-readable interaction name' }).optional(),
|
|
454
|
+
interactionRef: InteractionRefSchema,
|
|
455
|
+
environmentRef: ResourceRefSchema.meta({
|
|
456
|
+
description: 'Resolved environment reference (name resolved from `config.environment` id). Populated by the list endpoint; may be absent on other endpoints or when the id cannot be resolved, in which case consumers should fall back to `config.environment`.',
|
|
457
|
+
}).optional(),
|
|
458
|
+
topic: z
|
|
459
|
+
.string()
|
|
460
|
+
.meta({ description: 'Conversation topic (longer description from topic analysis)' })
|
|
461
|
+
.optional(),
|
|
462
|
+
lessons_learned: z
|
|
463
|
+
.array(z.string())
|
|
464
|
+
.meta({ description: 'Lessons learned from the conversation (extracted at completion)' })
|
|
465
|
+
.optional(),
|
|
466
|
+
archived_at: z
|
|
467
|
+
.string()
|
|
468
|
+
.meta({ description: 'When the last successful archive completed', format: 'date-time' })
|
|
469
|
+
.optional(),
|
|
470
|
+
archive_version: z
|
|
471
|
+
.number()
|
|
472
|
+
.meta({ description: 'Archive format version (for forward compatibility)' })
|
|
473
|
+
.optional(),
|
|
474
|
+
last_archive_error: z
|
|
475
|
+
.string()
|
|
476
|
+
.meta({ description: "Last archive error message (when archive_state === 'failed')" })
|
|
477
|
+
.optional(),
|
|
478
|
+
forked_from: z
|
|
479
|
+
.string()
|
|
480
|
+
.meta({ description: 'Source agent run ID when this run was forked (enables message history chaining)' })
|
|
481
|
+
.optional(),
|
|
482
|
+
})
|
|
483
|
+
.meta({
|
|
484
|
+
id: 'AgentRun',
|
|
485
|
+
description: 'AgentRun — the client-facing stable identity for a running or completed agent.\n\nAll operations use `id` as the sole identifier. Temporal workflow internals are never exposed to clients.',
|
|
486
|
+
});
|
|
487
|
+
export const CreateAgentRunPayloadSchema = z
|
|
488
|
+
.strictObject({
|
|
489
|
+
interaction: z.string().meta({ description: 'Interaction ID or code (e.g. "sys:generic_question").' }),
|
|
490
|
+
data: z.looseObject({}).meta({ description: 'Input parameters, typed per interaction' }).optional(),
|
|
491
|
+
config: InteractionExecutionConfigurationSchema.meta({
|
|
492
|
+
description: 'Execution configuration (environment, model, model_options, etc.)',
|
|
493
|
+
}).optional(),
|
|
494
|
+
interactive: z.boolean().meta({ description: 'Whether the agent accepts user input' }).optional(),
|
|
495
|
+
tool_approval_mode: AgentToolApprovalModeSchema.meta({
|
|
496
|
+
description: 'How side-effecting tool actions are approved for interactive runs.',
|
|
497
|
+
}).optional(),
|
|
498
|
+
tool_names: z
|
|
499
|
+
.array(z.string())
|
|
500
|
+
.meta({ description: 'Tools configured for this run (+/- syntax supported)' })
|
|
501
|
+
.optional(),
|
|
502
|
+
initial_skills: z
|
|
503
|
+
.array(z.string())
|
|
504
|
+
.meta({ description: 'Builtin system skills activated before the first model turn.' })
|
|
505
|
+
.optional(),
|
|
506
|
+
initial_tool_calls: z
|
|
507
|
+
.array(InitialToolCallSchema)
|
|
508
|
+
.meta({ description: 'Ordered, bounded hydration/read calls executed before the first model turn.' })
|
|
509
|
+
.optional(),
|
|
510
|
+
excluded_tools: z
|
|
511
|
+
.array(z.string())
|
|
512
|
+
.meta({
|
|
513
|
+
description: 'Hard denylist of tool names: never exposed to the model, refused at execution time.',
|
|
514
|
+
})
|
|
515
|
+
.optional(),
|
|
516
|
+
collection_id: z.string().meta({ description: 'Scoped collection (if any)' }).optional(),
|
|
517
|
+
disabled_mcp_collections: z
|
|
518
|
+
.array(z.string())
|
|
519
|
+
.meta({
|
|
520
|
+
description: 'Denylist of MCP tool-collection ids deactivated for this run. `undefined`/empty means all installed/connected MCP collections are active (back-compat, and new servers stay active by default). Listed collections are excluded even if connected.',
|
|
521
|
+
})
|
|
522
|
+
.optional(),
|
|
523
|
+
content_type: ContentObjectTypeRefSchema.meta({
|
|
524
|
+
description: 'Content type linked to this run — defines the schema for `properties`',
|
|
525
|
+
}).optional(),
|
|
526
|
+
visibility: ConversationVisibilitySchema.meta({ description: 'Conversation visibility' }).optional(),
|
|
527
|
+
tags: z.array(z.string()).meta({ description: 'User-defined or system tags for categorization' }).optional(),
|
|
528
|
+
categories: z
|
|
529
|
+
.array(z.string())
|
|
530
|
+
.meta({ description: 'Categories for organizing runs (e.g. "support", "analysis", "generation")' })
|
|
531
|
+
.optional(),
|
|
532
|
+
properties: z
|
|
533
|
+
.looseObject({})
|
|
534
|
+
.meta({ description: 'Business metadata — typed by the linked content_type schema' })
|
|
535
|
+
.optional(),
|
|
536
|
+
source: RunSourceSchema.meta({ description: 'How the run was started' }).optional(),
|
|
537
|
+
schedule_id: z
|
|
538
|
+
.string()
|
|
539
|
+
.meta({ description: 'Schedule ID — set when this run was triggered by a Temporal schedule' })
|
|
540
|
+
.optional(),
|
|
541
|
+
source_type: AgentRunTypeSchema.meta({ description: 'How the run was created' }).optional(),
|
|
542
|
+
type: AgentRunTypeSchema.meta({
|
|
543
|
+
description: 'Deprecated: Use source_type for creation source and run_type for runtime mode.',
|
|
544
|
+
deprecated: true,
|
|
545
|
+
'x-deprecated-message': 'Use source_type for creation source and run_type for runtime mode.',
|
|
546
|
+
}).optional(),
|
|
547
|
+
search_scope: AgentSearchScopeSchema.meta({ description: 'Search scope for RAG queries' }).optional(),
|
|
548
|
+
user_channels: z
|
|
549
|
+
.array(UserChannelSchema)
|
|
550
|
+
.meta({ description: 'User communication channels (email, interactive)' })
|
|
551
|
+
.optional(),
|
|
552
|
+
checkpoint_tokens: z
|
|
553
|
+
.number()
|
|
554
|
+
.meta({
|
|
555
|
+
description: 'Token budget for checkpointing, in thousands (K). Wins over every other checkpoint setting.',
|
|
556
|
+
})
|
|
557
|
+
.optional(),
|
|
558
|
+
checkpoint: AgentCheckpointConfigurationSchema.meta({
|
|
559
|
+
description: "Structured checkpoint override for this run. Field-wise it takes precedence over the interaction's `agent_runner_options.checkpoint` and the project's `configuration.agent.checkpoint`; the legacy `checkpoint_tokens` above still wins over everything when set.",
|
|
560
|
+
}).optional(),
|
|
561
|
+
max_iterations: z.number().meta({ description: 'Maximum conversation iterations (default: 20)' }).optional(),
|
|
562
|
+
notify_endpoints: z.array(z.string()).meta({ description: 'Webhook URLs to notify on completion' }).optional(),
|
|
563
|
+
debug_mode: z.boolean().meta({ description: 'Enable debug mode for verbose logging' }).optional(),
|
|
564
|
+
started_by: z
|
|
565
|
+
.string()
|
|
566
|
+
.meta({ description: 'Principal ref of the user who initiated the run (for server-to-server forwarding)' })
|
|
567
|
+
.optional(),
|
|
568
|
+
})
|
|
569
|
+
.meta({ id: 'CreateAgentRunPayload', description: 'Payload to create and start a new agent run.' });
|
|
570
|
+
/**
|
|
571
|
+
* The other shape `POST /agents` accepts — a process run rather than an agent run.
|
|
572
|
+
*
|
|
573
|
+
* `AgentsApi.start` is overloaded on exactly these two payloads and the handler branches on
|
|
574
|
+
* `isProcessStartPayload`, so an endpoint contract naming only the agent one rejects every process
|
|
575
|
+
* start: it has no `interaction`, and its own fields read as undeclared extras.
|
|
576
|
+
*/
|
|
577
|
+
const processRunFields = {
|
|
578
|
+
// Optional here on purpose: `isProcessStartPayload` only rejects a run_type it cannot parse, so a
|
|
579
|
+
// process start that omits it is valid today and requiring it would reject those callers.
|
|
580
|
+
run_type: ProcessSchemas.ProcessRunTypeSchema.optional(),
|
|
581
|
+
process_version: z
|
|
582
|
+
.number()
|
|
583
|
+
.meta({ description: 'Published process version to pin. Defaults to the head revision.' })
|
|
584
|
+
.optional(),
|
|
585
|
+
data: z.looseObject({}).meta({ description: 'Input parameters, typed per process.' }).optional(),
|
|
586
|
+
config: ProcessSchemas.ProcessRunConfigSchema.optional(),
|
|
587
|
+
visibility: ConversationVisibilitySchema.optional(),
|
|
588
|
+
tags: z.array(z.string()).optional(),
|
|
589
|
+
categories: z.array(z.string()).optional(),
|
|
590
|
+
source: RunSourceSchema.meta({ description: 'How the run was started' }).optional(),
|
|
591
|
+
started_by: z
|
|
592
|
+
.string()
|
|
593
|
+
.meta({ description: 'Principal ref of the user who initiated the run (for server-to-server forwarding)' })
|
|
594
|
+
.optional(),
|
|
595
|
+
};
|
|
596
|
+
/**
|
|
597
|
+
* Starting a stored process by id.
|
|
598
|
+
*
|
|
599
|
+
* Split from {@link CreateProcessRunWithDefinitionPayloadSchema} rather than making both references
|
|
600
|
+
* optional, because the process reference is what `isProcessStartPayload` actually keys on. With both
|
|
601
|
+
* optional this branch would match ANY object, and the union below would then accept an agent payload
|
|
602
|
+
* whose `interaction` was misspelled — making the agent branch's validation worthless.
|
|
603
|
+
*/
|
|
604
|
+
export const CreateProcessRunByIdPayloadSchema = z
|
|
605
|
+
.object({ ...processRunFields, process_id: z.string().meta({ description: 'Process to start.' }) })
|
|
606
|
+
.meta({ id: 'CreateProcessRunByIdPayload', description: 'Payload to start a stored process by id.' });
|
|
607
|
+
/**
|
|
608
|
+
* Starting a process from an inline definition that is not stored. See the sibling above.
|
|
609
|
+
*
|
|
610
|
+
* The field carries no `.meta({description})`: `ProcessDefinitionBody` is recursive, and re-metaing a
|
|
611
|
+
* registered recursive component clones it under the same id with a different shape, which the
|
|
612
|
+
* adapter rejects as a duplicate.
|
|
613
|
+
*/
|
|
614
|
+
export const CreateProcessRunWithDefinitionPayloadSchema = z
|
|
615
|
+
.object({ ...processRunFields, process_definition: ProcessSchemas.ProcessDefinitionBodySchema })
|
|
616
|
+
.meta({
|
|
617
|
+
id: 'CreateProcessRunWithDefinitionPayload',
|
|
618
|
+
description: 'Payload to start a process from an inline definition.',
|
|
619
|
+
});
|
|
620
|
+
/**
|
|
621
|
+
* What `POST /agents` actually accepts.
|
|
622
|
+
*
|
|
623
|
+
* A plain union rather than a discriminated one: the two kinds are told apart by which fields are
|
|
624
|
+
* PRESENT, not by a shared literal, and OpenAPI's discriminator has to be required in every branch.
|
|
625
|
+
*/
|
|
626
|
+
export const CreateRunPayloadSchema = z
|
|
627
|
+
.union([
|
|
628
|
+
CreateAgentRunPayloadSchema,
|
|
629
|
+
CreateProcessRunByIdPayloadSchema,
|
|
630
|
+
CreateProcessRunWithDefinitionPayloadSchema,
|
|
631
|
+
])
|
|
632
|
+
.meta({ id: 'CreateRunPayload', description: 'Payload to create and start an agent run or a process run.' });
|
|
633
|
+
export const SearchAgentRunsResponseSchema = z
|
|
634
|
+
.strictObject({
|
|
635
|
+
hits: z.array(AgentRunSearchHitSchema).meta({ description: 'Search results' }),
|
|
636
|
+
total: z.number().meta({ description: 'Total matching results' }),
|
|
637
|
+
})
|
|
638
|
+
.meta({ id: 'SearchAgentRunsResponse', description: 'Response from the agent runs search endpoint.' });
|
|
639
|
+
export const AgentMessageDetailsSchema = z
|
|
640
|
+
.looseObject({
|
|
641
|
+
ack: z.string().optional(),
|
|
642
|
+
event_class: z.string().optional(),
|
|
643
|
+
tool: z.string().optional(),
|
|
644
|
+
tools: z.array(z.string()).optional(),
|
|
645
|
+
tool_event: z.enum(['started', 'progress', 'completed', 'failed']).optional(),
|
|
646
|
+
streamed: z.boolean().optional(),
|
|
647
|
+
display_role: z.string().optional(),
|
|
648
|
+
activity_id: z.string().optional(),
|
|
649
|
+
activity_group_id: z.string().optional(),
|
|
650
|
+
batch_id: z.string().optional(),
|
|
651
|
+
tool_run_id: z.string().optional(),
|
|
652
|
+
tool_use_id: z.string().optional(),
|
|
653
|
+
tool_status: z.enum(['running', 'completed', 'error', 'warning']).optional(),
|
|
654
|
+
tool_iteration: z.number().optional(),
|
|
655
|
+
message_to_human: z.string().optional(),
|
|
656
|
+
duration_ms: z.number().optional(),
|
|
657
|
+
observation: z.unknown().optional(),
|
|
658
|
+
token_usage: ExecutionTokenUsageSchema.optional(),
|
|
659
|
+
checkpoint_at: z.number().optional(),
|
|
660
|
+
checkpoint_threshold: z.number().optional(),
|
|
661
|
+
workflow_run_id: z.string().optional(),
|
|
662
|
+
outputFiles: z.array(z.string()).optional(),
|
|
663
|
+
files: z
|
|
664
|
+
.array(z.union([ConversationFileSchema, z.string()]).meta({
|
|
665
|
+
anyOf: undefined,
|
|
666
|
+
oneOf: [{ $ref: 'ConversationFile' }, { type: 'string' }],
|
|
667
|
+
}))
|
|
668
|
+
.optional(),
|
|
669
|
+
plan: z.array(PlanTaskSchema).optional(),
|
|
670
|
+
resources: z
|
|
671
|
+
.array(AgentResourceReferenceSchema)
|
|
672
|
+
.meta({
|
|
673
|
+
description: 'Deep-linkable references to resources a tool created/updated/deleted (see AgentResourceReference).',
|
|
674
|
+
})
|
|
675
|
+
.optional(),
|
|
676
|
+
streaming_id: z.string().optional(),
|
|
677
|
+
streaming_id_scope: z.enum(['workflow_run', 'workstream']).optional(),
|
|
678
|
+
chunk_index: z.number().optional(),
|
|
679
|
+
is_final: z.boolean().optional(),
|
|
680
|
+
_optimistic: z.boolean().optional(),
|
|
681
|
+
_messageId: z.string().optional(),
|
|
682
|
+
_deliveryStatus: z.enum(['sending', 'received', 'consumed', 'failed']).optional(),
|
|
683
|
+
})
|
|
684
|
+
.meta({ id: 'AgentMessageDetails' });
|
|
685
|
+
export const CompactMessageSchema = z
|
|
686
|
+
.strictObject({
|
|
687
|
+
t: AgentMessageTypeSchema.meta({ description: 'Message type (integer enum)' }),
|
|
688
|
+
m: z.string().meta({ description: 'Message content' }).optional(),
|
|
689
|
+
w: z.string().meta({ description: 'Workstream ID (only when not "main")' }).optional(),
|
|
690
|
+
d: AgentMessageDetailsSchema.nullable().meta({ description: 'Type-specific details' }).optional(),
|
|
691
|
+
f: z
|
|
692
|
+
.union([z.literal(0), z.literal(1)])
|
|
693
|
+
.meta({
|
|
694
|
+
anyOf: undefined,
|
|
695
|
+
type: 'number',
|
|
696
|
+
enum: [0, 1],
|
|
697
|
+
description: 'Is final chunk (only for STREAMING_CHUNK, 0 or 1)',
|
|
698
|
+
})
|
|
699
|
+
.optional(),
|
|
700
|
+
ts: z.number().meta({ description: 'Timestamp (only for stored/persisted messages)' }).optional(),
|
|
701
|
+
i: z
|
|
702
|
+
.string()
|
|
703
|
+
.meta({ description: 'Activity ID for deduplication between streaming chunks and final messages' })
|
|
704
|
+
.optional(),
|
|
705
|
+
})
|
|
706
|
+
.meta({
|
|
707
|
+
id: 'CompactMessage',
|
|
708
|
+
description: 'Compact message format for efficient wire transfer. Primary type used throughout the system. ~85% smaller than legacy AgentMessage format.',
|
|
709
|
+
});
|
|
710
|
+
export const PostAgentRunUpdatePayloadSchema = z
|
|
711
|
+
.strictObject({
|
|
712
|
+
timestamp: z.number().optional(),
|
|
713
|
+
workflow_run_id: z.string().optional(),
|
|
714
|
+
type: AgentMessageTypeSchema.optional(),
|
|
715
|
+
message: z.string().optional(),
|
|
716
|
+
details: AgentMessageDetailsSchema.optional(),
|
|
717
|
+
workstream_id: z.string().optional(),
|
|
718
|
+
})
|
|
719
|
+
.meta({
|
|
720
|
+
id: 'PostAgentRunUpdatePayload',
|
|
721
|
+
description: "Payload for posting an update into an agent's workflow stream.",
|
|
722
|
+
});
|
|
723
|
+
export const AgentRunUpdatesResponseSchema = z
|
|
724
|
+
.strictObject({
|
|
725
|
+
messages: z.array(CompactMessageSchema),
|
|
726
|
+
})
|
|
727
|
+
.meta({ id: 'AgentRunUpdatesResponse', description: 'Response payload for retrieving compact agent updates.' });
|
|
728
|
+
export const AgentRunResponseSchema = z
|
|
729
|
+
.discriminatedUnion('run_type', [
|
|
730
|
+
AutonomousRunResponseSchema,
|
|
731
|
+
z.lazy(() => SupervisedRunResponseSchema),
|
|
732
|
+
z.lazy(() => ProgrammaticRunResponseSchema),
|
|
733
|
+
])
|
|
734
|
+
.meta({ id: 'AgentRunResponse' });
|
|
735
|
+
export const ListAgentRunsResponseSchema = z
|
|
736
|
+
.strictObject({
|
|
737
|
+
items: z.array(z.lazy(() => AgentRunResponseSchema)),
|
|
738
|
+
total_count: z.number(),
|
|
739
|
+
next_cursor: nullableStringSchema,
|
|
740
|
+
})
|
|
741
|
+
.meta({ id: 'ListAgentRunsResponse' });
|
|
742
|
+
export const ProgrammaticRunResponseSchema = z
|
|
743
|
+
.strictObject({
|
|
744
|
+
run_type: z.literal('programmatic'),
|
|
745
|
+
id: z.string().meta({ description: 'The stable identifier used by all client code' }),
|
|
746
|
+
run_kind: z.literal('process').meta({ description: 'Internal discriminator key' }),
|
|
747
|
+
account: z.string().meta({ description: 'Account ID' }),
|
|
748
|
+
project: z.string().meta({ description: 'Project ID' }),
|
|
749
|
+
workflow_id: z.string().meta({ description: 'Temporal workflow ID (stable across continueAsNew)' }).optional(),
|
|
750
|
+
first_workflow_run_id: z
|
|
751
|
+
.string()
|
|
752
|
+
.meta({ description: 'First Temporal workflow run ID (used for Redis channel and artifact resolution)' })
|
|
753
|
+
.optional(),
|
|
754
|
+
artifacts_path: z.string().meta({ description: 'Artifact storage path for this run' }).optional(),
|
|
755
|
+
status: AgentRunStatusSchema.meta({ description: 'Current status of the run' }),
|
|
756
|
+
activity_state: ConversationActivityStateSchema.meta({
|
|
757
|
+
description: 'Whether the run is currently working or idle',
|
|
758
|
+
}).optional(),
|
|
759
|
+
visibility: ConversationVisibilitySchema.meta({ description: 'Conversation/process visibility' }).optional(),
|
|
760
|
+
started_by: z.string().meta({ description: 'User or service that initiated the run' }),
|
|
761
|
+
started_at: z.string().meta({ description: 'When the run started', format: 'date-time' }),
|
|
762
|
+
completed_at: z
|
|
763
|
+
.string()
|
|
764
|
+
.meta({ description: 'When the run completed (or failed/cancelled)', format: 'date-time' })
|
|
765
|
+
.optional(),
|
|
766
|
+
title: z.string().meta({ description: 'Short human-readable title' }).optional(),
|
|
767
|
+
tags: z.array(z.string()).meta({ description: 'User-defined or system tags for categorization' }).optional(),
|
|
768
|
+
categories: z.array(z.string()).meta({ description: 'Categories for organizing runs' }).optional(),
|
|
769
|
+
source: RunSourceSchema.meta({ description: 'How the run was started' }).optional(),
|
|
770
|
+
source_type: AgentRunTypeSchema.meta({ description: 'Replacement for legacy AgentRun.type' }).optional(),
|
|
771
|
+
schedule_id: z
|
|
772
|
+
.string()
|
|
773
|
+
.meta({ description: 'Schedule ID — set when this run was triggered by a Temporal schedule' })
|
|
774
|
+
.optional(),
|
|
775
|
+
event_subscription_id: z
|
|
776
|
+
.string()
|
|
777
|
+
.meta({ description: 'Event subscription ID — set when this run was triggered by the event bus.' })
|
|
778
|
+
.optional(),
|
|
779
|
+
event_ref: EventRefSchema.meta({
|
|
780
|
+
description: 'Event reference — set when this run was triggered by the event bus.',
|
|
781
|
+
}).optional(),
|
|
782
|
+
archive_state: AgentRunArchiveStateSchema.meta({ description: 'Archive lifecycle state' }).optional(),
|
|
783
|
+
created_at: z.string().meta({ description: 'Timestamp when the document was created', format: 'date-time' }),
|
|
784
|
+
updated_at: z
|
|
785
|
+
.string()
|
|
786
|
+
.meta({ description: 'Timestamp when the document was last updated', format: 'date-time' }),
|
|
787
|
+
process_id: z.string().optional(),
|
|
788
|
+
process_definition_snapshot: z.lazy(() => ProcessDefinitionBodySchema),
|
|
789
|
+
process_version: z.number().optional(),
|
|
790
|
+
process_state: ProcessStateSchema,
|
|
791
|
+
config: ProcessRunConfigSchema.optional(),
|
|
792
|
+
})
|
|
793
|
+
.meta({ id: 'ProgrammaticRunResponse' });
|
|
794
|
+
export const SupervisedRunResponseSchema = z
|
|
795
|
+
.strictObject({
|
|
796
|
+
run_type: z.literal('supervised'),
|
|
797
|
+
id: z.string().meta({ description: 'The stable identifier used by all client code' }),
|
|
798
|
+
run_kind: z.literal('process').meta({ description: 'Internal discriminator key' }),
|
|
799
|
+
account: z.string().meta({ description: 'Account ID' }),
|
|
800
|
+
project: z.string().meta({ description: 'Project ID' }),
|
|
801
|
+
workflow_id: z.string().meta({ description: 'Temporal workflow ID (stable across continueAsNew)' }).optional(),
|
|
802
|
+
first_workflow_run_id: z
|
|
803
|
+
.string()
|
|
804
|
+
.meta({ description: 'First Temporal workflow run ID (used for Redis channel and artifact resolution)' })
|
|
805
|
+
.optional(),
|
|
806
|
+
artifacts_path: z.string().meta({ description: 'Artifact storage path for this run' }).optional(),
|
|
807
|
+
status: AgentRunStatusSchema.meta({ description: 'Current status of the run' }),
|
|
808
|
+
activity_state: ConversationActivityStateSchema.meta({
|
|
809
|
+
description: 'Whether the run is currently working or idle',
|
|
810
|
+
}).optional(),
|
|
811
|
+
visibility: ConversationVisibilitySchema.meta({ description: 'Conversation/process visibility' }).optional(),
|
|
812
|
+
started_by: z.string().meta({ description: 'User or service that initiated the run' }),
|
|
813
|
+
started_at: z.string().meta({ description: 'When the run started', format: 'date-time' }),
|
|
814
|
+
completed_at: z
|
|
815
|
+
.string()
|
|
816
|
+
.meta({ description: 'When the run completed (or failed/cancelled)', format: 'date-time' })
|
|
817
|
+
.optional(),
|
|
818
|
+
title: z.string().meta({ description: 'Short human-readable title' }).optional(),
|
|
819
|
+
tags: z.array(z.string()).meta({ description: 'User-defined or system tags for categorization' }).optional(),
|
|
820
|
+
categories: z.array(z.string()).meta({ description: 'Categories for organizing runs' }).optional(),
|
|
821
|
+
source: RunSourceSchema.meta({ description: 'How the run was started' }).optional(),
|
|
822
|
+
source_type: AgentRunTypeSchema.meta({ description: 'Replacement for legacy AgentRun.type' }).optional(),
|
|
823
|
+
schedule_id: z
|
|
824
|
+
.string()
|
|
825
|
+
.meta({ description: 'Schedule ID — set when this run was triggered by a Temporal schedule' })
|
|
826
|
+
.optional(),
|
|
827
|
+
event_subscription_id: z
|
|
828
|
+
.string()
|
|
829
|
+
.meta({ description: 'Event subscription ID — set when this run was triggered by the event bus.' })
|
|
830
|
+
.optional(),
|
|
831
|
+
event_ref: EventRefSchema.meta({
|
|
832
|
+
description: 'Event reference — set when this run was triggered by the event bus.',
|
|
833
|
+
}).optional(),
|
|
834
|
+
archive_state: AgentRunArchiveStateSchema.meta({ description: 'Archive lifecycle state' }).optional(),
|
|
835
|
+
created_at: z.string().meta({ description: 'Timestamp when the document was created', format: 'date-time' }),
|
|
836
|
+
updated_at: z
|
|
837
|
+
.string()
|
|
838
|
+
.meta({ description: 'Timestamp when the document was last updated', format: 'date-time' }),
|
|
839
|
+
process_id: z.string().optional(),
|
|
840
|
+
process_definition_snapshot: z.lazy(() => ProcessDefinitionBodySchema),
|
|
841
|
+
process_version: z.number().optional(),
|
|
842
|
+
process_state: ProcessStateSchema,
|
|
843
|
+
config: ProcessRunConfigSchema.optional(),
|
|
844
|
+
})
|
|
845
|
+
.meta({ id: 'SupervisedRunResponse' });
|
|
846
|
+
export const AgentRunArtifactUploadHeadersSchema = z
|
|
847
|
+
.object({
|
|
848
|
+
'content-type': z.string().optional(),
|
|
849
|
+
})
|
|
850
|
+
.meta({ id: 'AgentRunArtifactUploadHeaders' });
|
|
851
|
+
export const AgentRunArtifactQuerySchema = z
|
|
852
|
+
.object({
|
|
853
|
+
url: z.boolean().optional(),
|
|
854
|
+
disposition: z.enum(['inline', 'attachment']).optional(),
|
|
855
|
+
filename: z.string().optional(),
|
|
856
|
+
})
|
|
857
|
+
.meta({ id: 'AgentRunArtifactQuery' });
|
|
858
|
+
export const AgentRunDetailsQuerySchema = z
|
|
859
|
+
.object({
|
|
860
|
+
include_history: z.boolean().optional(),
|
|
861
|
+
hydrate_payloads: z.boolean().optional(),
|
|
862
|
+
})
|
|
863
|
+
.meta({ id: 'AgentRunDetailsQuery' });
|
|
864
|
+
export const AgentRunArtifactsQuerySchema = z
|
|
865
|
+
.object({
|
|
866
|
+
visibility: z.enum(['user', 'internal', 'all']).optional(),
|
|
867
|
+
})
|
|
868
|
+
.meta({ id: 'AgentRunArtifactsQuery' });
|
|
869
|
+
export const ListAgentRunsQuerySchema = z
|
|
870
|
+
.object({
|
|
871
|
+
id: z.string().meta({ description: 'Filter by agent run ID' }).optional(),
|
|
872
|
+
status: z.array(AgentRunStatusSchema).meta({ description: 'Filter by status (single or multiple)' }).optional(),
|
|
873
|
+
interaction: z.string().meta({ description: 'Filter by interaction ID or code' }).optional(),
|
|
874
|
+
started_by: z.string().meta({ description: 'Filter by user who started the run' }).optional(),
|
|
875
|
+
since: z
|
|
876
|
+
.string()
|
|
877
|
+
.meta({ description: 'Only return runs started after this date', format: 'date-time' })
|
|
878
|
+
.optional(),
|
|
879
|
+
until: z
|
|
880
|
+
.string()
|
|
881
|
+
.meta({ description: 'Only return runs started at or before this date', format: 'date-time' })
|
|
882
|
+
.optional(),
|
|
883
|
+
limit: z.number().meta({ description: 'Maximum number of results (default: 50)' }).optional(),
|
|
884
|
+
offset: z.number().meta({ description: 'Offset for pagination' }).optional(),
|
|
885
|
+
cursor: z.string().meta({ description: 'Cursor for stable pagination' }).optional(),
|
|
886
|
+
schedule_id: z.string().meta({ description: 'Filter by schedule ID' }).optional(),
|
|
887
|
+
type: AgentRunTypeSchema.meta({ description: 'Filter by run type' }).optional(),
|
|
888
|
+
run_type: z.array(RunTypeSchema).meta({ description: 'Filter by public runtime mode' }).optional(),
|
|
889
|
+
run_kind: RunKindSchema.meta({ description: 'Filter by internal run discriminator' }).optional(),
|
|
890
|
+
sort: z.enum(['started_at', 'updated_at']).meta({ description: 'Field to sort by' }).optional(),
|
|
891
|
+
order: z.enum(['asc', 'desc']).meta({ description: 'Sort order' }).optional(),
|
|
892
|
+
})
|
|
893
|
+
.meta({ id: 'ListAgentRunsQuery' });
|
|
894
|
+
export const AgentRunUpdatesQuerySchema = z
|
|
895
|
+
.object({
|
|
896
|
+
since: z.number().optional(),
|
|
897
|
+
})
|
|
898
|
+
.meta({ id: 'AgentRunUpdatesQuery' });
|
|
899
|
+
export const SearchAgentRunsQuerySchema = z
|
|
900
|
+
.object({
|
|
901
|
+
query: z
|
|
902
|
+
.string()
|
|
903
|
+
.meta({ description: 'Full-text search across name, title, topic, interaction_name, and content' })
|
|
904
|
+
.optional(),
|
|
905
|
+
status: z.array(AgentRunStatusSchema).meta({ description: 'Filter by status (single or multiple)' }).optional(),
|
|
906
|
+
interaction: z.string().meta({ description: 'Filter by interaction ID or code' }).optional(),
|
|
907
|
+
started_by: z.string().meta({ description: 'Filter by user who started the run' }).optional(),
|
|
908
|
+
categories: z.array(z.string()).meta({ description: 'Filter by categories' }).optional(),
|
|
909
|
+
tags: z.array(z.string()).meta({ description: 'Filter by tags' }).optional(),
|
|
910
|
+
content_type_name: z.string().meta({ description: 'Filter by content type name' }).optional(),
|
|
911
|
+
run_type: z.array(RunTypeSchema).meta({ description: 'Filter by public runtime mode' }).optional(),
|
|
912
|
+
since: z
|
|
913
|
+
.string()
|
|
914
|
+
.meta({ description: 'Only return runs started after this date', format: 'date-time' })
|
|
915
|
+
.optional(),
|
|
916
|
+
until: z
|
|
917
|
+
.string()
|
|
918
|
+
.meta({ description: 'Only return runs started at or before this date', format: 'date-time' })
|
|
919
|
+
.optional(),
|
|
920
|
+
limit: z.number().meta({ description: 'Maximum number of results (default: 50)' }).optional(),
|
|
921
|
+
offset: z.number().meta({ description: 'Offset for pagination' }).optional(),
|
|
922
|
+
sort: z
|
|
923
|
+
.array(z.string())
|
|
924
|
+
.meta({
|
|
925
|
+
description: "Multi-field sort. Each item has the form `field` or `field:order`, where field is one of: `started_at`, `updated_at` order is one of: `asc`, `desc` (default: `desc`) The first item is the primary sort; subsequent items are tie-breakers. Example: `['updated_at:desc', 'started_at:asc']`. Defaults to `['started_at:desc']` when omitted.",
|
|
926
|
+
})
|
|
927
|
+
.optional(),
|
|
928
|
+
})
|
|
929
|
+
.meta({ id: 'SearchAgentRunsQuery' });
|
|
930
|
+
export const StreamAgentRunQuerySchema = AgentRunUpdatesQuerySchema.extend({
|
|
931
|
+
skipHistory: z.boolean().optional(),
|
|
932
|
+
}).meta({ id: 'StreamAgentRunQuery' });
|
|
933
|
+
export const RecordAgentRunPayloadSchema = z
|
|
934
|
+
.strictObject({
|
|
935
|
+
workflow_id: z.string(),
|
|
936
|
+
first_workflow_run_id: z.string(),
|
|
937
|
+
run_kind: z.literal('agent').optional(),
|
|
938
|
+
interaction: z.string(),
|
|
939
|
+
schedule_id: z.string().optional(),
|
|
940
|
+
visibility: ConversationVisibilitySchema.optional(),
|
|
941
|
+
data: z.looseObject({}).optional(),
|
|
942
|
+
type: AgentRunTypeSchema.optional(),
|
|
943
|
+
})
|
|
944
|
+
.meta({ id: 'RecordAgentRunPayload' });
|
|
945
|
+
export const RecordRunPayloadSchema = z
|
|
946
|
+
.union([RecordAgentRunPayloadSchema, RecordProcessRunPayloadSchema])
|
|
947
|
+
.meta({ id: 'RecordRunPayload' });
|
|
948
|
+
export const UpdateAgentRunStatusPayloadSchema = z
|
|
949
|
+
.strictObject({
|
|
950
|
+
status: AgentRunStatusSchema.optional(),
|
|
951
|
+
activity_state: ConversationActivityStateSchema.optional(),
|
|
952
|
+
title: z.string().optional(),
|
|
953
|
+
topic: z.string().optional(),
|
|
954
|
+
lessons_learned: z.array(z.string()).optional(),
|
|
955
|
+
properties: z.looseObject({}).optional(),
|
|
956
|
+
content: z.string().optional(),
|
|
957
|
+
disabled_mcp_collections: z.array(z.string()).optional(),
|
|
958
|
+
tool_approval_mode: AgentToolApprovalModeSchema.optional(),
|
|
959
|
+
archive_state: AgentRunArchiveStateSchema.optional(),
|
|
960
|
+
archived_at: z.string().optional(),
|
|
961
|
+
archive_version: z.number().optional(),
|
|
962
|
+
last_archive_error: z.string().optional(),
|
|
963
|
+
sequence: z.number().optional(),
|
|
964
|
+
process_state: ProcessStateSchema.optional(),
|
|
965
|
+
})
|
|
966
|
+
.meta({ id: 'UpdateAgentRunStatusPayload' });
|
|
967
|
+
export const AgentRunInternalsSchema = z
|
|
968
|
+
.strictObject({
|
|
969
|
+
id: z.string(),
|
|
970
|
+
workflow_id: z.string().optional(),
|
|
971
|
+
first_workflow_run_id: z.string().optional(),
|
|
972
|
+
artifacts_path: z.string().optional(),
|
|
973
|
+
status: AgentRunStatusSchema,
|
|
974
|
+
run_kind: RunKindSchema.optional(),
|
|
975
|
+
run_type: RunTypeSchema.optional(),
|
|
976
|
+
interaction: z.string().optional(),
|
|
977
|
+
interaction_name: z.string().optional(),
|
|
978
|
+
config: InteractionExecutionConfigurationSchema.optional(),
|
|
979
|
+
interactive: z.boolean().optional(),
|
|
980
|
+
process_id: z.string().optional(),
|
|
981
|
+
process_definition_snapshot: ProcessDefinitionBodySchema.optional(),
|
|
982
|
+
process_version: z.number().optional(),
|
|
983
|
+
process_state: ProcessStateSchema.optional(),
|
|
984
|
+
started_at: z.string().meta({ format: 'date-time' }),
|
|
985
|
+
completed_at: z.string().meta({ format: 'date-time' }).optional(),
|
|
986
|
+
started_by: z.string(),
|
|
987
|
+
created_at: z.string().meta({ format: 'date-time' }),
|
|
988
|
+
updated_at: z.string().meta({ format: 'date-time' }),
|
|
989
|
+
})
|
|
990
|
+
.meta({ id: 'AgentRunInternals' });
|
|
991
|
+
//# sourceMappingURL=agent-runs.js.map
|