@vertesia/common 1.5.0-dev.20260806.125520Z → 1.5.0-dev.20260826.064249Z
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.d.ts +0 -14
- package/lib/access-control.d.ts.map +1 -1
- package/lib/access-control.js +0 -23
- package/lib/access-control.js.map +1 -1
- package/lib/account-values.d.ts +0 -10
- package/lib/account-values.d.ts.map +1 -1
- package/lib/account-values.js +0 -44
- package/lib/account-values.js.map +1 -1
- package/lib/api-contract/components.generated.json +40303 -0
- package/lib/api-contract/index.d.ts +186 -0
- package/lib/api-contract/index.d.ts.map +1 -0
- package/lib/api-contract/index.js +554 -0
- package/lib/api-contract/index.js.map +1 -0
- package/lib/api-schemas/adapter.d.ts +1 -0
- package/lib/api-schemas/adapter.d.ts.map +1 -1
- package/lib/api-schemas/adapter.js +1 -1
- package/lib/api-schemas/adapter.js.map +1 -1
- package/lib/api-schemas/agent-communication.d.ts +199 -0
- package/lib/api-schemas/agent-communication.d.ts.map +1 -0
- package/lib/api-schemas/agent-communication.js +150 -0
- package/lib/api-schemas/agent-communication.js.map +1 -0
- package/lib/api-schemas/agent-runs.d.ts +723 -0
- package/lib/api-schemas/agent-runs.d.ts.map +1 -1
- package/lib/api-schemas/agent-runs.js +44 -2
- package/lib/api-schemas/agent-runs.js.map +1 -1
- package/lib/api-schemas/app-lifecycle.d.ts +19 -0
- package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
- package/lib/api-schemas/app-lifecycle.js +34 -4
- package/lib/api-schemas/app-lifecycle.js.map +1 -1
- package/lib/api-schemas/app-runtime.d.ts +9946 -8884
- package/lib/api-schemas/app-runtime.d.ts.map +1 -1
- package/lib/api-schemas/app-runtime.js +7 -0
- package/lib/api-schemas/app-runtime.js.map +1 -1
- package/lib/api-schemas/apps.d.ts +1 -0
- package/lib/api-schemas/apps.d.ts.map +1 -1
- package/lib/api-schemas/apps.js +4 -3
- package/lib/api-schemas/apps.js.map +1 -1
- package/lib/api-schemas/content-query.d.ts +39 -0
- package/lib/api-schemas/content-query.d.ts.map +1 -0
- package/lib/api-schemas/content-query.js +30 -0
- package/lib/api-schemas/content-query.js.map +1 -0
- package/lib/api-schemas/content.d.ts +966 -30
- package/lib/api-schemas/content.d.ts.map +1 -1
- package/lib/api-schemas/content.js +82 -15
- package/lib/api-schemas/content.js.map +1 -1
- package/lib/api-schemas/dashboard.d.ts +4 -0
- package/lib/api-schemas/dashboard.d.ts.map +1 -1
- package/lib/api-schemas/dashboard.js +3 -0
- package/lib/api-schemas/dashboard.js.map +1 -1
- package/lib/api-schemas/document-processing.d.ts +411 -0
- package/lib/api-schemas/document-processing.d.ts.map +1 -1
- package/lib/api-schemas/environment.d.ts +2 -0
- package/lib/api-schemas/environment.d.ts.map +1 -1
- package/lib/api-schemas/events.d.ts +1245 -8
- package/lib/api-schemas/events.d.ts.map +1 -1
- package/lib/api-schemas/events.js +4 -1
- package/lib/api-schemas/events.js.map +1 -1
- package/lib/api-schemas/files.d.ts +17 -0
- package/lib/api-schemas/files.d.ts.map +1 -1
- package/lib/api-schemas/files.js +23 -0
- package/lib/api-schemas/files.js.map +1 -1
- package/lib/api-schemas/group.d.ts +7 -0
- package/lib/api-schemas/group.d.ts.map +1 -1
- package/lib/api-schemas/group.js +9 -0
- package/lib/api-schemas/group.js.map +1 -1
- package/lib/api-schemas/index.d.ts +4 -0
- package/lib/api-schemas/index.d.ts.map +1 -1
- package/lib/api-schemas/index.js +4 -0
- package/lib/api-schemas/index.js.map +1 -1
- package/lib/api-schemas/integrations.d.ts +5 -5
- package/lib/api-schemas/integrations.d.ts.map +1 -1
- package/lib/api-schemas/integrations.js +15 -2
- package/lib/api-schemas/integrations.js.map +1 -1
- package/lib/api-schemas/interaction.d.ts +9469 -1092
- package/lib/api-schemas/interaction.d.ts.map +1 -1
- package/lib/api-schemas/interaction.js +161 -9
- package/lib/api-schemas/interaction.js.map +1 -1
- package/lib/api-schemas/oauth-server.d.ts +131 -3
- package/lib/api-schemas/oauth-server.d.ts.map +1 -1
- package/lib/api-schemas/oauth-server.js +137 -3
- package/lib/api-schemas/oauth-server.js.map +1 -1
- package/lib/api-schemas/process.d.ts +1295 -0
- package/lib/api-schemas/process.d.ts.map +1 -1
- package/lib/api-schemas/process.js +309 -1
- package/lib/api-schemas/process.js.map +1 -1
- package/lib/api-schemas/project-configuration.d.ts +1388 -11
- package/lib/api-schemas/project-configuration.d.ts.map +1 -1
- package/lib/api-schemas/project-configuration.js +6 -2
- package/lib/api-schemas/project-configuration.js.map +1 -1
- package/lib/api-schemas/project.d.ts +2094 -30
- package/lib/api-schemas/project.d.ts.map +1 -1
- package/lib/api-schemas/registry.d.ts +88965 -66382
- package/lib/api-schemas/registry.d.ts.map +1 -1
- package/lib/api-schemas/registry.js +234 -281
- package/lib/api-schemas/registry.js.map +1 -1
- package/lib/api-schemas/schema-primitives.d.ts +4 -0
- package/lib/api-schemas/schema-primitives.d.ts.map +1 -1
- package/lib/api-schemas/schema-primitives.js +10 -0
- package/lib/api-schemas/schema-primitives.js.map +1 -1
- package/lib/api-schemas/store.d.ts +6899 -40
- package/lib/api-schemas/store.d.ts.map +1 -1
- package/lib/api-schemas/store.js +53 -8
- package/lib/api-schemas/store.js.map +1 -1
- package/lib/api-schemas/tools.d.ts +115 -0
- package/lib/api-schemas/tools.d.ts.map +1 -1
- package/lib/api-schemas/tools.js +55 -0
- package/lib/api-schemas/tools.js.map +1 -1
- package/lib/api-schemas/view-execution.d.ts +330 -798
- package/lib/api-schemas/view-execution.d.ts.map +1 -1
- package/lib/api-schemas/view-execution.js +26 -2
- package/lib/api-schemas/view-execution.js.map +1 -1
- package/lib/api-schemas/views.d.ts +452 -2394
- package/lib/api-schemas/views.d.ts.map +1 -1
- package/lib/api-schemas/views.js +119 -3
- package/lib/api-schemas/views.js.map +1 -1
- package/lib/api-schemas/workflow-runs.d.ts +396 -5
- package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
- package/lib/api-schemas/workflow-runs.js +9 -7
- package/lib/api-schemas/workflow-runs.js.map +1 -1
- package/lib/apps.d.ts +8 -145
- package/lib/apps.d.ts.map +1 -1
- package/lib/apps.js +1 -54
- package/lib/apps.js.map +1 -1
- package/lib/ask-user.d.ts +2 -1
- package/lib/ask-user.d.ts.map +1 -1
- package/lib/audit-trail.d.ts +2 -2
- package/lib/audit-trail.d.ts.map +1 -1
- package/lib/audit-trail.js +2 -2
- package/lib/audit-trail.js.map +1 -1
- package/lib/browser-credentials.d.ts +2 -7
- package/lib/browser-credentials.d.ts.map +1 -1
- package/lib/common.d.ts +4 -1
- package/lib/common.d.ts.map +1 -1
- package/lib/content-query.d.ts +5 -0
- package/lib/content-query.d.ts.map +1 -0
- package/lib/content-query.js +2 -0
- package/lib/content-query.js.map +1 -0
- package/lib/data-platform.d.ts +4 -46
- package/lib/data-platform.d.ts.map +1 -1
- package/lib/data-platform.js.map +1 -1
- package/lib/email.d.ts +12 -18
- package/lib/email.d.ts.map +1 -1
- package/lib/email.js.map +1 -1
- package/lib/environment.d.ts +0 -10
- package/lib/environment.d.ts.map +1 -1
- package/lib/environment.js +1 -12
- package/lib/environment.js.map +1 -1
- package/lib/facets.d.ts +0 -4
- package/lib/facets.d.ts.map +1 -1
- package/lib/group.d.ts +2 -12
- package/lib/group.d.ts.map +1 -1
- package/lib/group.js.map +1 -1
- package/lib/index.d.ts +3 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -10
- package/lib/index.js.map +1 -1
- package/lib/integrations.d.ts +0 -26
- package/lib/integrations.d.ts.map +1 -1
- package/lib/integrations.js +0 -6
- package/lib/integrations.js.map +1 -1
- package/lib/interaction.d.ts +10 -222
- package/lib/interaction.d.ts.map +1 -1
- package/lib/interaction.js +0 -31
- package/lib/interaction.js.map +1 -1
- package/lib/meters.d.ts +5 -10
- package/lib/meters.d.ts.map +1 -1
- package/lib/meters.js +1 -9
- package/lib/meters.js.map +1 -1
- package/lib/oauth-scopes.d.ts +2 -16
- package/lib/oauth-scopes.d.ts.map +1 -1
- package/lib/oauth-scopes.js +9 -49
- package/lib/oauth-scopes.js.map +1 -1
- package/lib/oauth-server.d.ts +16 -195
- package/lib/oauth-server.d.ts.map +1 -1
- package/lib/payload.d.ts +2 -5
- package/lib/payload.d.ts.map +1 -1
- package/lib/pending-asks.d.ts +9 -41
- package/lib/pending-asks.d.ts.map +1 -1
- package/lib/platform-event.d.ts +4 -142
- package/lib/platform-event.d.ts.map +1 -1
- package/lib/platform-event.js.map +1 -1
- package/lib/project.d.ts +7 -46
- package/lib/project.d.ts.map +1 -1
- package/lib/project.js +2 -132
- package/lib/project.js.map +1 -1
- package/lib/prompt.d.ts +4 -7
- package/lib/prompt.d.ts.map +1 -1
- package/lib/prompt.js.map +1 -1
- package/lib/query.d.ts +0 -8
- package/lib/query.d.ts.map +1 -1
- package/lib/rate-limiter.d.ts +4 -3
- package/lib/rate-limiter.d.ts.map +1 -1
- package/lib/runs.d.ts +5 -1
- package/lib/runs.d.ts.map +1 -1
- package/lib/schema-for-extraction.d.ts +0 -1
- package/lib/schema-for-extraction.d.ts.map +1 -1
- package/lib/schema-for-extraction.js +1 -1
- package/lib/schema-for-extraction.js.map +1 -1
- package/lib/secrets.d.ts +2 -1
- package/lib/secrets.d.ts.map +1 -1
- package/lib/skill.d.ts +0 -13
- package/lib/skill.d.ts.map +1 -1
- package/lib/store/activity-catalog.d.ts +2 -0
- package/lib/store/activity-catalog.d.ts.map +1 -1
- package/lib/store/agent-approval.d.ts +0 -1
- package/lib/store/agent-approval.d.ts.map +1 -1
- package/lib/store/agent-approval.js +0 -3
- package/lib/store/agent-approval.js.map +1 -1
- package/lib/store/agent-run.d.ts +32 -69
- package/lib/store/agent-run.d.ts.map +1 -1
- package/lib/store/collections.d.ts +2 -6
- package/lib/store/collections.d.ts.map +1 -1
- package/lib/store/collections.js.map +1 -1
- package/lib/store/conversation-state.d.ts +11 -12
- package/lib/store/conversation-state.d.ts.map +1 -1
- package/lib/store/conversation-state.js +0 -18
- package/lib/store/conversation-state.js.map +1 -1
- package/lib/store/doc-analyzer.d.ts +0 -22
- package/lib/store/doc-analyzer.d.ts.map +1 -1
- package/lib/store/dsl-workflow.d.ts +18 -5
- package/lib/store/dsl-workflow.d.ts.map +1 -1
- package/lib/store/dsl-workflow.js.map +1 -1
- package/lib/store/grounded-extraction.d.ts +0 -14
- package/lib/store/grounded-extraction.d.ts.map +1 -1
- package/lib/store/grounded-extraction.js +1 -7
- package/lib/store/grounded-extraction.js.map +1 -1
- package/lib/store/index.d.ts +0 -5
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/index.js +0 -6
- package/lib/store/index.js.map +1 -1
- package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
- package/lib/store/intake-policy-schema.generated.js +305 -1
- package/lib/store/intake-policy-schema.generated.js.map +1 -1
- package/lib/store/process.d.ts +43 -1
- package/lib/store/process.d.ts.map +1 -1
- package/lib/store/process.js.map +1 -1
- package/lib/store/rendering.d.ts +3 -5
- package/lib/store/rendering.d.ts.map +1 -1
- package/lib/store/rendering.js +0 -4
- package/lib/store/rendering.js.map +1 -1
- package/lib/store/schedule.d.ts +0 -16
- package/lib/store/schedule.d.ts.map +1 -1
- package/lib/store/schedule.js.map +1 -1
- package/lib/store/signals.d.ts +12 -0
- package/lib/store/signals.d.ts.map +1 -1
- package/lib/store/store.d.ts +80 -94
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +5 -25
- package/lib/store/store.js.map +1 -1
- package/lib/store/workflow.d.ts +35 -86
- package/lib/store/workflow.d.ts.map +1 -1
- package/lib/store/workflow.js +0 -47
- package/lib/store/workflow.js.map +1 -1
- package/lib/sts-errors.d.ts +0 -1
- package/lib/sts-errors.d.ts.map +1 -1
- package/lib/sts-token-types.d.ts +2 -8
- package/lib/sts-token-types.d.ts.map +1 -1
- package/lib/sts-token-types.js +1 -19
- package/lib/sts-token-types.js.map +1 -1
- package/lib/tools.d.ts +6 -1
- package/lib/tools.d.ts.map +1 -1
- package/lib/transient-tokens.d.ts +0 -2
- package/lib/transient-tokens.d.ts.map +1 -1
- package/lib/user.d.ts +0 -17
- package/lib/user.d.ts.map +1 -1
- package/lib/user.js.map +1 -1
- package/lib/utils/schemas.d.ts +2 -24
- package/lib/utils/schemas.d.ts.map +1 -1
- package/lib/utils/schemas.js +0 -151
- package/lib/utils/schemas.js.map +1 -1
- package/lib/vertesia-common.js +3 -4
- package/lib/vertesia-common.js.map +1 -1
- package/lib/views.d.ts +23 -27
- package/lib/views.d.ts.map +1 -1
- package/lib/views.js +5 -26
- package/lib/views.js.map +1 -1
- package/lib/workflow-analytics.d.ts +12 -34
- package/lib/workflow-analytics.d.ts.map +1 -1
- package/package.json +12 -6
- package/src/access-control.ts +0 -26
- package/src/account-values.ts +0 -49
- package/src/agent-resources.test.ts +1 -12
- package/src/api-contract/components.contract.test.ts +99 -0
- package/src/api-contract/components.generated.json +40303 -0
- package/src/api-contract/index.ts +664 -0
- package/src/api-schemas/adapter.ts +1 -1
- package/src/api-schemas/agent-communication.contract.test.ts +90 -0
- package/src/api-schemas/agent-communication.ts +169 -0
- package/src/api-schemas/agent-runs.ts +46 -1
- package/src/api-schemas/api-discriminators.test.ts +185 -0
- package/src/api-schemas/app-lifecycle.ts +39 -4
- package/src/api-schemas/app-runtime.ts +8 -0
- package/src/api-schemas/apps.ts +4 -3
- package/src/api-schemas/content-query.ts +31 -0
- package/src/api-schemas/content.ts +88 -15
- package/src/api-schemas/dashboard.contract.test.ts +16 -5
- package/src/api-schemas/dashboard.ts +3 -0
- package/src/api-schemas/events.ts +9 -1
- package/src/api-schemas/files.ts +27 -0
- package/src/api-schemas/group.ts +10 -0
- package/src/api-schemas/index.ts +4 -0
- package/src/api-schemas/integrations.ts +15 -2
- package/src/api-schemas/interaction.contract.test.ts +204 -1
- package/src/api-schemas/interaction.ts +176 -8
- package/src/api-schemas/llumiverse.contract.test.ts +18 -2
- package/src/api-schemas/oauth-server.ts +152 -3
- package/src/api-schemas/oauth.contract.test.ts +64 -1
- package/src/api-schemas/process.ts +343 -1
- package/src/api-schemas/project-configuration.ts +11 -7
- package/src/api-schemas/project.contract.test.ts +64 -6
- package/src/api-schemas/registry.ts +290 -300
- package/src/api-schemas/schema-primitives.ts +13 -0
- package/src/api-schemas/store.contract.test.ts +30 -1
- package/src/api-schemas/store.ts +58 -11
- package/src/api-schemas/tools.ts +62 -0
- package/src/api-schemas/view-execution.ts +28 -2
- package/src/api-schemas/views.contract.test.ts +119 -0
- package/src/api-schemas/views.ts +142 -3
- package/src/api-schemas/workflow-runs.ts +9 -7
- package/src/api-schemas/zeno-response-contracts.test.ts +320 -0
- package/src/apps.test.ts +2 -40
- package/src/apps.ts +14 -181
- package/src/ask-user.ts +1 -1
- package/src/audit-trail.ts +3 -3
- package/src/browser-credentials.ts +3 -7
- package/src/common.ts +13 -1
- package/src/content-query.ts +5 -0
- package/src/data-platform.ts +4 -51
- package/src/email.ts +24 -18
- package/src/environment.ts +1 -14
- package/src/facets.ts +0 -6
- package/src/group.ts +2 -12
- package/src/index.ts +3 -15
- package/src/integrations.ts +0 -51
- package/src/interaction.ts +12 -271
- package/src/meters.ts +10 -11
- package/src/oauth-scopes.test.ts +15 -0
- package/src/oauth-scopes.ts +10 -64
- package/src/oauth-server.ts +28 -215
- package/src/payload.ts +1 -6
- package/src/pending-asks.ts +17 -42
- package/src/platform-event.ts +3 -156
- package/src/project.ts +12 -160
- package/src/prompt.ts +9 -8
- package/src/query.ts +0 -9
- package/src/rate-limiter.ts +3 -3
- package/src/runs.ts +8 -0
- package/src/schema-for-extraction.ts +1 -1
- package/src/secrets.ts +3 -0
- package/src/skill.ts +0 -15
- package/src/store/activity-catalog.ts +3 -0
- package/src/store/agent-approval.ts +0 -4
- package/src/store/agent-run.ts +39 -93
- package/src/store/collections.ts +3 -6
- package/src/store/conversation-state.ts +12 -25
- package/src/store/doc-analyzer.ts +0 -26
- package/src/store/dsl-workflow.ts +24 -5
- package/src/store/grounded-extraction.ts +0 -18
- package/src/store/index.ts +0 -6
- package/src/store/intake-policy-schema.generated.ts +319 -1
- package/src/store/process.ts +84 -0
- package/src/store/rendering.ts +3 -8
- package/src/store/schedule.ts +0 -19
- package/src/store/signals.ts +14 -0
- package/src/store/store.ts +118 -127
- package/src/store/workflow.ts +32 -120
- package/src/sts-errors.ts +0 -2
- package/src/sts-token-types.ts +3 -28
- package/src/tools.ts +15 -0
- package/src/transient-tokens.ts +0 -2
- package/src/user.ts +0 -20
- package/src/utils/schemas.ts +2 -159
- package/src/views.ts +50 -47
- package/src/workflow-analytics.ts +12 -40
- package/tsconfig.dist.json +4 -1
- package/lib/Progress.d.ts +0 -22
- package/lib/Progress.d.ts.map +0 -1
- package/lib/Progress.js +0 -57
- package/lib/Progress.js.map +0 -1
- package/lib/agent-request-template.d.ts +0 -4
- package/lib/agent-request-template.d.ts.map +0 -1
- package/lib/agent-request-template.js +0 -46
- package/lib/agent-request-template.js.map +0 -1
- package/lib/channels.d.ts +0 -22
- package/lib/channels.d.ts.map +0 -1
- package/lib/channels.js +0 -57
- package/lib/channels.js.map +0 -1
- package/lib/host-utils.d.ts +0 -8
- package/lib/host-utils.d.ts.map +0 -1
- package/lib/host-utils.js +0 -84
- package/lib/host-utils.js.map +0 -1
- package/lib/platform-event-validation.d.ts +0 -45
- package/lib/platform-event-validation.d.ts.map +0 -1
- package/lib/platform-event-validation.js +0 -336
- package/lib/platform-event-validation.js.map +0 -1
- package/lib/store/hive-memory.d.ts +0 -117
- package/lib/store/hive-memory.d.ts.map +0 -1
- package/lib/store/hive-memory.js +0 -2
- package/lib/store/hive-memory.js.map +0 -1
- package/lib/store/object-types.d.ts +0 -24
- package/lib/store/object-types.d.ts.map +0 -1
- package/lib/store/object-types.js +0 -95
- package/lib/store/object-types.js.map +0 -1
- package/lib/store/process-schema.d.ts +0 -561
- package/lib/store/process-schema.d.ts.map +0 -1
- package/lib/store/process-schema.js +0 -561
- package/lib/store/process-schema.js.map +0 -1
- package/lib/store/process-validation.d.ts +0 -17
- package/lib/store/process-validation.d.ts.map +0 -1
- package/lib/store/process-validation.js +0 -515
- package/lib/store/process-validation.js.map +0 -1
- package/lib/store/temporalio.d.ts +0 -17
- package/lib/store/temporalio.d.ts.map +0 -1
- package/lib/store/temporalio.js +0 -41
- package/lib/store/temporalio.js.map +0 -1
- package/lib/view-configuration-validation.d.ts +0 -15
- package/lib/view-configuration-validation.d.ts.map +0 -1
- package/lib/view-configuration-validation.js +0 -63
- package/lib/view-configuration-validation.js.map +0 -1
- package/lib/view-query-validation.d.ts +0 -13
- package/lib/view-query-validation.d.ts.map +0 -1
- package/lib/view-query-validation.js +0 -266
- package/lib/view-query-validation.js.map +0 -1
- package/lib/view-validation-helpers.d.ts +0 -15
- package/lib/view-validation-helpers.d.ts.map +0 -1
- package/lib/view-validation-helpers.js +0 -25
- package/lib/view-validation-helpers.js.map +0 -1
- package/lib/views-schema.d.ts +0 -1992
- package/lib/views-schema.d.ts.map +0 -1
- package/lib/views-schema.js +0 -674
- package/lib/views-schema.js.map +0 -1
- package/lib/views-validation.d.ts +0 -21
- package/lib/views-validation.d.ts.map +0 -1
- package/lib/views-validation.js +0 -164
- package/lib/views-validation.js.map +0 -1
- package/src/Progress.ts +0 -59
- package/src/agent-request-template.test.ts +0 -40
- package/src/agent-request-template.ts +0 -45
- package/src/channels.ts +0 -70
- package/src/host-utils.test.ts +0 -61
- package/src/host-utils.ts +0 -93
- package/src/platform-event-validation.test.ts +0 -251
- package/src/platform-event-validation.ts +0 -372
- package/src/project.test.ts +0 -44
- package/src/store/hive-memory.ts +0 -167
- package/src/store/object-types.ts +0 -123
- package/src/store/process-schema.test.ts +0 -149
- package/src/store/process-schema.ts +0 -564
- package/src/store/process-validation.test.ts +0 -635
- package/src/store/process-validation.ts +0 -646
- package/src/store/temporalio.ts +0 -54
- package/src/view-configuration-validation.ts +0 -74
- package/src/view-query-validation.test.ts +0 -21
- package/src/view-query-validation.ts +0 -319
- package/src/view-validation-helpers.ts +0 -28
- package/src/views-schema.test.ts +0 -372
- package/src/views-schema.ts +0 -689
- package/src/views-validation.ts +0 -234
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { describe, expect, expectTypeOf, it } from 'vitest';
|
|
2
|
+
import type {
|
|
3
|
+
ComputeRunFacetsResponse,
|
|
4
|
+
ContentQueryPayload,
|
|
5
|
+
ContentQueryResult,
|
|
6
|
+
ListUserGroupsQuery,
|
|
7
|
+
RegisterPendingAskRequest,
|
|
8
|
+
SendEmailRequest,
|
|
9
|
+
UpdateEmailRouteRequest,
|
|
10
|
+
} from '../index.js';
|
|
11
|
+
import type {
|
|
12
|
+
RegisterPendingAskRequestSchema,
|
|
13
|
+
SendEmailRequestSchema,
|
|
14
|
+
UpdateEmailRouteRequestSchema,
|
|
15
|
+
} from './agent-communication.js';
|
|
16
|
+
import type { ContentQueryPayloadSchema, ContentQueryResultSchema } from './content-query.js';
|
|
17
|
+
import type { ListUserGroupsQuerySchema } from './group.js';
|
|
18
|
+
import type { ComputeRunFacetsResponseSchema } from './interaction.js';
|
|
19
|
+
import { validateApiRequest, validateApiResponse } from './registry.js';
|
|
20
|
+
|
|
21
|
+
describe('agent communication API contracts', () => {
|
|
22
|
+
it('derives public types from the runtime schemas', () => {
|
|
23
|
+
expectTypeOf<SendEmailRequest>().toEqualTypeOf<import('zod').z.infer<typeof SendEmailRequestSchema>>();
|
|
24
|
+
expectTypeOf<UpdateEmailRouteRequest>().toEqualTypeOf<
|
|
25
|
+
import('zod').z.infer<typeof UpdateEmailRouteRequestSchema>
|
|
26
|
+
>();
|
|
27
|
+
expectTypeOf<RegisterPendingAskRequest>().toEqualTypeOf<
|
|
28
|
+
import('zod').z.infer<typeof RegisterPendingAskRequestSchema>
|
|
29
|
+
>();
|
|
30
|
+
expectTypeOf<ContentQueryPayload>().toEqualTypeOf<import('zod').z.infer<typeof ContentQueryPayloadSchema>>();
|
|
31
|
+
expectTypeOf<ContentQueryResult>().toEqualTypeOf<import('zod').z.infer<typeof ContentQueryResultSchema>>();
|
|
32
|
+
expectTypeOf<ComputeRunFacetsResponse>().toEqualTypeOf<
|
|
33
|
+
import('zod').z.infer<typeof ComputeRunFacetsResponseSchema>
|
|
34
|
+
>();
|
|
35
|
+
expectTypeOf<ListUserGroupsQuery>().toEqualTypeOf<import('zod').z.infer<typeof ListUserGroupsQuerySchema>>();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('allows only the email route fields the server updates', () => {
|
|
39
|
+
expect(validateApiRequest('UpdateEmailRouteRequest', { threadSubject: 'Subject' }).valid).toBe(true);
|
|
40
|
+
expect(validateApiRequest('UpdateEmailRouteRequest', { projectId: 'project-1' }).valid).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('preserves the established user-group filter contract', () => {
|
|
44
|
+
expect(
|
|
45
|
+
validateApiRequest('ListUserGroupsQuery', {
|
|
46
|
+
search: 'admins',
|
|
47
|
+
tags: ['internal'],
|
|
48
|
+
limit: 20,
|
|
49
|
+
offset: 0,
|
|
50
|
+
project: 'project-1',
|
|
51
|
+
}).valid,
|
|
52
|
+
).toBe(true);
|
|
53
|
+
expect(validateApiRequest('ListUserGroupsQuery', { unsupported: true }).valid).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('validates content query requests and results', () => {
|
|
57
|
+
expect(validateApiRequest('ContentQueryPayload', { sql: 'SELECT * FROM content' }).valid).toBe(true);
|
|
58
|
+
expect(validateApiRequest('ContentQueryPayload', { explain: true }).valid).toBe(false);
|
|
59
|
+
expect(
|
|
60
|
+
validateApiResponse('ContentQueryResult', {
|
|
61
|
+
type: 'dsl',
|
|
62
|
+
hits: [{ id: 'object-1', score: 1, source: { name: 'Example' } }],
|
|
63
|
+
total: 1,
|
|
64
|
+
}).valid,
|
|
65
|
+
).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('validates the flat run-facet response returned by the endpoint', () => {
|
|
69
|
+
expect(
|
|
70
|
+
validateApiResponse('ComputeRunFacetsResponse', {
|
|
71
|
+
total: 3,
|
|
72
|
+
statuses: [
|
|
73
|
+
{ _id: 'completed', count: 2 },
|
|
74
|
+
{ _id: null, count: 1 },
|
|
75
|
+
],
|
|
76
|
+
}).valid,
|
|
77
|
+
).toBe(true);
|
|
78
|
+
expect(
|
|
79
|
+
validateApiResponse('ComputeRunFacetsResponse', {
|
|
80
|
+
status: [{ _id: 'completed', count: 2 }],
|
|
81
|
+
}).valid,
|
|
82
|
+
).toBe(false);
|
|
83
|
+
expect(
|
|
84
|
+
validateApiResponse('ComputeRunFacetsResponse', {
|
|
85
|
+
count: { total: 3 },
|
|
86
|
+
facet: { statuses: { buckets: [] } },
|
|
87
|
+
}).valid,
|
|
88
|
+
).toBe(false);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UserChannelSchema } from './interaction.js';
|
|
3
|
+
import { TaskFieldSchema } from './task.js';
|
|
4
|
+
|
|
5
|
+
export const EmailRouteDataSchema = z
|
|
6
|
+
.strictObject({
|
|
7
|
+
runId: z.string(),
|
|
8
|
+
accountId: z.string(),
|
|
9
|
+
projectId: z.string(),
|
|
10
|
+
threadSubject: z.string().optional(),
|
|
11
|
+
inReplyTo: z.string().optional(),
|
|
12
|
+
references: z.array(z.string()).optional(),
|
|
13
|
+
userEmail: z.string(),
|
|
14
|
+
inboundDomain: z.string(),
|
|
15
|
+
})
|
|
16
|
+
.meta({ id: 'EmailRouteData' });
|
|
17
|
+
|
|
18
|
+
export const SendEmailRequestSchema = z
|
|
19
|
+
.strictObject({
|
|
20
|
+
to_email: z.string(),
|
|
21
|
+
subject: z.string(),
|
|
22
|
+
body: z.string(),
|
|
23
|
+
agent_name: z.string(),
|
|
24
|
+
from_name: z.string().optional(),
|
|
25
|
+
run_id: z.string(),
|
|
26
|
+
route_key: z.string().optional(),
|
|
27
|
+
in_reply_to: z.string().optional(),
|
|
28
|
+
references: z.array(z.string()).optional(),
|
|
29
|
+
})
|
|
30
|
+
.meta({ id: 'SendEmailRequest' });
|
|
31
|
+
|
|
32
|
+
export const SendEmailResponseSchema = z
|
|
33
|
+
.strictObject({
|
|
34
|
+
success: z.boolean(),
|
|
35
|
+
email_id: z.string().optional(),
|
|
36
|
+
message_id: z.string().optional(),
|
|
37
|
+
route_key: z.string().optional(),
|
|
38
|
+
error: z.string().optional(),
|
|
39
|
+
})
|
|
40
|
+
.meta({ id: 'SendEmailResponse' });
|
|
41
|
+
|
|
42
|
+
export const ResolveEmailRouteRequestSchema = z
|
|
43
|
+
.strictObject({ route_key: z.string() })
|
|
44
|
+
.meta({ id: 'ResolveEmailRouteRequest' });
|
|
45
|
+
|
|
46
|
+
export const CreateEmailRouteRequestSchema = z
|
|
47
|
+
.strictObject({
|
|
48
|
+
run_id: z.string(),
|
|
49
|
+
user_email: z.string(),
|
|
50
|
+
thread_subject: z.string().optional(),
|
|
51
|
+
})
|
|
52
|
+
.meta({ id: 'CreateEmailRouteRequest' });
|
|
53
|
+
|
|
54
|
+
export const CreateEmailRouteResponseSchema = z
|
|
55
|
+
.strictObject({
|
|
56
|
+
route_key: z.string(),
|
|
57
|
+
reply_to: z.string(),
|
|
58
|
+
email_domain: z.string(),
|
|
59
|
+
})
|
|
60
|
+
.meta({ id: 'CreateEmailRouteResponse' });
|
|
61
|
+
|
|
62
|
+
export const EmailRouteResponseSchema = EmailRouteDataSchema.extend({ route_key: z.string() }).meta({
|
|
63
|
+
id: 'EmailRouteResponse',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const UpdateEmailRouteRequestSchema = EmailRouteDataSchema.pick({
|
|
67
|
+
threadSubject: true,
|
|
68
|
+
inReplyTo: true,
|
|
69
|
+
references: true,
|
|
70
|
+
userEmail: true,
|
|
71
|
+
})
|
|
72
|
+
.partial()
|
|
73
|
+
.meta({ id: 'UpdateEmailRouteRequest' });
|
|
74
|
+
|
|
75
|
+
export const UpdateEmailRouteResponseSchema = z
|
|
76
|
+
.strictObject({ success: z.boolean(), route_key: z.string() })
|
|
77
|
+
.meta({ id: 'UpdateEmailRouteResponse' });
|
|
78
|
+
|
|
79
|
+
export const ForwardEmailRequestSchema = z
|
|
80
|
+
.strictObject({
|
|
81
|
+
email: z.strictObject({
|
|
82
|
+
from: z.string(),
|
|
83
|
+
subject: z.string().optional(),
|
|
84
|
+
text: z.string(),
|
|
85
|
+
html: z.string().optional(),
|
|
86
|
+
message_id: z.string().optional(),
|
|
87
|
+
}),
|
|
88
|
+
context: z.record(z.string(), z.unknown()).optional(),
|
|
89
|
+
attachments: z
|
|
90
|
+
.array(
|
|
91
|
+
z.strictObject({
|
|
92
|
+
filename: z.string(),
|
|
93
|
+
content_type: z.string(),
|
|
94
|
+
size: z.number(),
|
|
95
|
+
download_url: z.string(),
|
|
96
|
+
}),
|
|
97
|
+
)
|
|
98
|
+
.optional(),
|
|
99
|
+
})
|
|
100
|
+
.meta({ id: 'ForwardEmailRequest' });
|
|
101
|
+
|
|
102
|
+
export const ForwardEmailResponseSchema = z
|
|
103
|
+
.strictObject({
|
|
104
|
+
success: z.boolean(),
|
|
105
|
+
run_id: z.string(),
|
|
106
|
+
workflow_id: z.string(),
|
|
107
|
+
route_key: z.string(),
|
|
108
|
+
})
|
|
109
|
+
.meta({ id: 'ForwardEmailResponse' });
|
|
110
|
+
|
|
111
|
+
export const PendingAskStatusSchema = z.enum(['pending', 'resolved', 'expired']).meta({ id: 'PendingAskStatus' });
|
|
112
|
+
|
|
113
|
+
export const PendingAskDataSchema = z
|
|
114
|
+
.strictObject({
|
|
115
|
+
askId: z.string(),
|
|
116
|
+
runId: z.string(),
|
|
117
|
+
workflowId: z.string(),
|
|
118
|
+
projectId: z.string(),
|
|
119
|
+
accountId: z.string(),
|
|
120
|
+
agentName: z.string(),
|
|
121
|
+
questions: z.array(z.string()),
|
|
122
|
+
timeoutHours: z.number(),
|
|
123
|
+
userChannels: z.array(UserChannelSchema),
|
|
124
|
+
createdAt: z.number(),
|
|
125
|
+
expiresAt: z.number(),
|
|
126
|
+
status: PendingAskStatusSchema,
|
|
127
|
+
taskId: z.string().optional(),
|
|
128
|
+
resolvedAt: z.number().optional(),
|
|
129
|
+
response: z.string().optional(),
|
|
130
|
+
})
|
|
131
|
+
.meta({ id: 'PendingAskData' });
|
|
132
|
+
|
|
133
|
+
export const RegisterPendingAskRequestSchema = z
|
|
134
|
+
.strictObject({
|
|
135
|
+
runId: z.string(),
|
|
136
|
+
workflowId: z.string(),
|
|
137
|
+
agentName: z.string(),
|
|
138
|
+
questions: z.array(z.string()),
|
|
139
|
+
timeoutHours: z.number().optional(),
|
|
140
|
+
userChannels: z.array(UserChannelSchema),
|
|
141
|
+
taskFields: z.array(TaskFieldSchema).optional(),
|
|
142
|
+
})
|
|
143
|
+
.meta({ id: 'RegisterPendingAskRequest' });
|
|
144
|
+
|
|
145
|
+
export const RegisterPendingAskResponseSchema = z
|
|
146
|
+
.strictObject({
|
|
147
|
+
success: z.boolean(),
|
|
148
|
+
askId: z.string().optional(),
|
|
149
|
+
webhookSent: z.boolean().optional(),
|
|
150
|
+
error: z.string().optional(),
|
|
151
|
+
})
|
|
152
|
+
.meta({ id: 'RegisterPendingAskResponse' });
|
|
153
|
+
|
|
154
|
+
export const ResolvePendingAskRequestSchema = z
|
|
155
|
+
.strictObject({ response: z.string() })
|
|
156
|
+
.meta({ id: 'ResolvePendingAskRequest' });
|
|
157
|
+
|
|
158
|
+
export const ResolvePendingAskResponseSchema = z
|
|
159
|
+
.strictObject({
|
|
160
|
+
success: z.boolean(),
|
|
161
|
+
webhookSent: z.boolean().optional(),
|
|
162
|
+
waitDurationMs: z.number().optional(),
|
|
163
|
+
error: z.string().optional(),
|
|
164
|
+
})
|
|
165
|
+
.meta({ id: 'ResolvePendingAskResponse' });
|
|
166
|
+
|
|
167
|
+
export const ListPendingAsksResponseSchema = z
|
|
168
|
+
.strictObject({ asks: z.array(PendingAskDataSchema) })
|
|
169
|
+
.meta({ id: 'ListPendingAsksResponse' });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Runtime schemas for the agent runs API domain.
|
|
2
2
|
|
|
3
|
-
import { ExecutionTokenUsageSchema } from '@llumiverse/common/schemas';
|
|
3
|
+
import { ExecutionTokenUsageSchema, ReasoningEffortSchema } from '@llumiverse/common/schemas';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import type { AgentMessageType, FileProcessingStatus } from '../store/workflow.js';
|
|
6
6
|
import { type AgentEvent, AgentEventType, LlmCallType, TelemetryToolType } from '../workflow-analytics.js';
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
AgentResourceReferenceSchema,
|
|
18
18
|
AgentSearchScopeSchema,
|
|
19
19
|
AgentToolApprovalModeSchema,
|
|
20
|
+
ConversationEnrichmentFields,
|
|
20
21
|
ConversationVisibilitySchema,
|
|
21
22
|
InitialToolCallSchema,
|
|
22
23
|
InteractionRefSchema,
|
|
@@ -354,6 +355,17 @@ export const AutonomousRunResponseSchema = z
|
|
|
354
355
|
}).optional(),
|
|
355
356
|
id: z.string().meta({ description: 'The stable identifier used by all client code' }),
|
|
356
357
|
run_kind: z.literal('agent').meta({ description: 'Internal discriminator key' }),
|
|
358
|
+
parent_run_id: z
|
|
359
|
+
.string()
|
|
360
|
+
.meta({
|
|
361
|
+
description:
|
|
362
|
+
'Process run this agent belongs to — set when a process agent node recorded this run. Its conversation lives on the parent run under `workstream_id`.',
|
|
363
|
+
})
|
|
364
|
+
.optional(),
|
|
365
|
+
workstream_id: z
|
|
366
|
+
.string()
|
|
367
|
+
.meta({ description: 'Workstream this run occupies inside its parent run (the process node id).' })
|
|
368
|
+
.optional(),
|
|
357
369
|
run_type: z.literal('autonomous'),
|
|
358
370
|
account: z.string().meta({ description: 'Account ID' }),
|
|
359
371
|
project: z.string().meta({ description: 'Project ID' }),
|
|
@@ -396,6 +408,14 @@ export const AutonomousRunResponseSchema = z
|
|
|
396
408
|
.string()
|
|
397
409
|
.meta({ description: 'Conversation topic (longer description from topic analysis)' })
|
|
398
410
|
.optional(),
|
|
411
|
+
generate_topic: z
|
|
412
|
+
.boolean()
|
|
413
|
+
.meta({ description: 'Whether automatic conversation title/topic generation is enabled for this run.' })
|
|
414
|
+
.optional(),
|
|
415
|
+
generate_lessons: z
|
|
416
|
+
.boolean()
|
|
417
|
+
.meta({ description: 'Whether automatic lessons generation is enabled for this run.' })
|
|
418
|
+
.optional(),
|
|
399
419
|
lessons_learned: z
|
|
400
420
|
.array(z.string())
|
|
401
421
|
.meta({ description: 'Lessons learned from the conversation (extracted at completion)' })
|
|
@@ -483,6 +503,17 @@ export const AgentRunSchema = z
|
|
|
483
503
|
}).optional(),
|
|
484
504
|
id: z.string().meta({ description: 'The stable identifier used by all client code' }),
|
|
485
505
|
run_kind: z.literal('agent').meta({ description: 'Internal discriminator key' }),
|
|
506
|
+
parent_run_id: z
|
|
507
|
+
.string()
|
|
508
|
+
.meta({
|
|
509
|
+
description:
|
|
510
|
+
'Process run this agent belongs to — set when a process agent node recorded this run. Its conversation lives on the parent run under `workstream_id`.',
|
|
511
|
+
})
|
|
512
|
+
.optional(),
|
|
513
|
+
workstream_id: z
|
|
514
|
+
.string()
|
|
515
|
+
.meta({ description: 'Workstream this run occupies inside its parent run (the process node id).' })
|
|
516
|
+
.optional(),
|
|
486
517
|
run_type: z.literal('autonomous').meta({ description: 'Public-facing runtime mode' }),
|
|
487
518
|
account: z.string().meta({ description: 'Account ID' }),
|
|
488
519
|
project: z.string().meta({ description: 'Project ID' }),
|
|
@@ -525,6 +556,14 @@ export const AgentRunSchema = z
|
|
|
525
556
|
.string()
|
|
526
557
|
.meta({ description: 'Conversation topic (longer description from topic analysis)' })
|
|
527
558
|
.optional(),
|
|
559
|
+
generate_topic: z
|
|
560
|
+
.boolean()
|
|
561
|
+
.meta({ description: 'Whether automatic conversation title/topic generation is enabled for this run.' })
|
|
562
|
+
.optional(),
|
|
563
|
+
generate_lessons: z
|
|
564
|
+
.boolean()
|
|
565
|
+
.meta({ description: 'Whether automatic lessons generation is enabled for this run.' })
|
|
566
|
+
.optional(),
|
|
528
567
|
lessons_learned: z
|
|
529
568
|
.array(z.string())
|
|
530
569
|
.meta({ description: 'Lessons learned from the conversation (extracted at completion)' })
|
|
@@ -555,6 +594,7 @@ export const AgentRunSchema = z
|
|
|
555
594
|
export const CreateAgentRunPayloadSchema = z
|
|
556
595
|
.strictObject({
|
|
557
596
|
interaction: z.string().meta({ description: 'Interaction ID or code (e.g. "sys:generic_question").' }),
|
|
597
|
+
...ConversationEnrichmentFields,
|
|
558
598
|
data: z.looseObject({}).meta({ description: 'Input parameters, typed per interaction' }).optional(),
|
|
559
599
|
config: InteractionExecutionConfigurationSchema.meta({
|
|
560
600
|
description: 'Execution configuration (environment, model, model_options, etc.)',
|
|
@@ -1034,6 +1074,9 @@ export const RecordAgentRunPayloadSchema = z
|
|
|
1034
1074
|
first_workflow_run_id: z.string(),
|
|
1035
1075
|
run_kind: z.literal('agent').optional(),
|
|
1036
1076
|
interaction: z.string(),
|
|
1077
|
+
...ConversationEnrichmentFields,
|
|
1078
|
+
parent_run_id: z.string().optional(),
|
|
1079
|
+
workstream_id: z.string().optional(),
|
|
1037
1080
|
schedule_id: z.string().optional(),
|
|
1038
1081
|
visibility: ConversationVisibilitySchema.optional(),
|
|
1039
1082
|
data: z.looseObject({}).optional(),
|
|
@@ -1056,6 +1099,8 @@ export const UpdateAgentRunStatusPayloadSchema = z
|
|
|
1056
1099
|
content: z.string().optional(),
|
|
1057
1100
|
disabled_mcp_collections: z.array(z.string()).optional(),
|
|
1058
1101
|
tool_approval_mode: AgentToolApprovalModeSchema.optional(),
|
|
1102
|
+
model: z.string().min(1).optional(),
|
|
1103
|
+
effort: ReasoningEffortSchema.nullable().optional(),
|
|
1059
1104
|
archive_state: AgentRunArchiveStateSchema.optional(),
|
|
1060
1105
|
archived_at: z.string().optional(),
|
|
1061
1106
|
archive_version: z.number().optional(),
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { type ApiComponentName, ApiSchemaComponents, validateApiResponse } from './registry.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The build-time half of `discriminator: true`.
|
|
6
|
+
*
|
|
7
|
+
* AJV applies its discriminator rules when it COMPILES a schema, not when it validates one, and it
|
|
8
|
+
* signals a union it cannot handle by throwing. Left unchecked that turns into a 500 on the first
|
|
9
|
+
* request to whichever endpoint publishes the offending component — a failure mode that depends on
|
|
10
|
+
* traffic and would reach a deployed environment before anyone saw it. Compiling every registered
|
|
11
|
+
* component here moves that to the build, and names the component when it happens.
|
|
12
|
+
*
|
|
13
|
+
* The rules a union has to satisfy, all of which `synthesizeDiscriminator` in the adapter already
|
|
14
|
+
* enforces before emitting a discriminator: `oneOf` members resolving to object schemas, a tag
|
|
15
|
+
* property present and REQUIRED in every branch, and a `const` or single-valued `enum` for the tag
|
|
16
|
+
* in each. A hand-written `.meta({ discriminator })` gets no such check when it is written, which
|
|
17
|
+
* is the case this test exists for.
|
|
18
|
+
*
|
|
19
|
+
* Generating a validator for each of the ~1000 components is real work: well under a second on a
|
|
20
|
+
* developer machine, ~8s on a loaded CI runner, past vitest's 5s default, hence the explicit budget
|
|
21
|
+
* below. It is generous on purpose — an unsupported discriminator makes AJV THROW during
|
|
22
|
+
* compilation, so a genuine regression is caught by the try/catch and never by the clock.
|
|
23
|
+
*/
|
|
24
|
+
const COMPILE_ALL_TIMEOUT_MS = 60_000;
|
|
25
|
+
|
|
26
|
+
describe('published discriminators', () => {
|
|
27
|
+
it(
|
|
28
|
+
'compiles every registered component under AJV discriminator support',
|
|
29
|
+
() => {
|
|
30
|
+
const failures: string[] = [];
|
|
31
|
+
for (const name of Object.keys(ApiSchemaComponents)) {
|
|
32
|
+
try {
|
|
33
|
+
// Compilation is the subject; the value only has to reach the validator. An
|
|
34
|
+
// invalid result is expected and irrelevant.
|
|
35
|
+
validateApiResponse(name as ApiComponentName, undefined);
|
|
36
|
+
} catch (err: unknown) {
|
|
37
|
+
failures.push(`${name}: ${err instanceof Error ? err.message : String(err)}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
expect(failures, `components AJV could not compile:\n${failures.join('\n')}`).toEqual([]);
|
|
41
|
+
},
|
|
42
|
+
COMPILE_ALL_TIMEOUT_MS,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
it('keeps discriminator mapping in the published components for generated clients', () => {
|
|
46
|
+
// AJV's copy drops `mapping`; the OpenAPI document must not. A Java or Go client reads the
|
|
47
|
+
// mapping to pick a concrete subtype, so losing it here would be a silent codegen
|
|
48
|
+
// regression that no schema assertion elsewhere would catch.
|
|
49
|
+
const union = ApiSchemaComponents.ToolCollectionObject as {
|
|
50
|
+
discriminator?: { propertyName?: string; mapping?: Record<string, string> };
|
|
51
|
+
};
|
|
52
|
+
expect(union.discriminator?.propertyName).toBe('type');
|
|
53
|
+
expect(union.discriminator?.mapping).toMatchObject({
|
|
54
|
+
mcp: '#/components/schemas/MCPToolCollectionObject',
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('reports only the tagged branch when a legacy MCP collection is missing its id', () => {
|
|
59
|
+
// The `hubspot-mcp-dev` shape: created before the write path required `id`, still served by
|
|
60
|
+
// the five-level resolution chain in fetch-tools.ts. Without discriminator support AJV also
|
|
61
|
+
// reported `oauth_app` as an undeclared property and `type` as not matching a constant —
|
|
62
|
+
// both from the vertesia_sdk branch this value never claimed to be.
|
|
63
|
+
const legacy = {
|
|
64
|
+
type: 'mcp',
|
|
65
|
+
name: 'HubSpot',
|
|
66
|
+
namespace: 'hubspot',
|
|
67
|
+
description: 'HubSpot MCP',
|
|
68
|
+
auth: 'oauth',
|
|
69
|
+
url: 'https://mcp.hubspot.com',
|
|
70
|
+
oauth_app: 'hubspot',
|
|
71
|
+
};
|
|
72
|
+
const result = validateApiResponse('ToolCollectionObject', legacy);
|
|
73
|
+
expect(result.valid).toBe(false);
|
|
74
|
+
if (result.valid) return;
|
|
75
|
+
expect(result.errors).toEqual(["/ must have required property 'id'"]);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/** A one-branch `condition` node, the smallest thing that reaches the untagged `branches` union. */
|
|
79
|
+
function withBranch(branch: unknown): unknown {
|
|
80
|
+
return {
|
|
81
|
+
format_version: 1,
|
|
82
|
+
process: 'demo',
|
|
83
|
+
initial: 'a',
|
|
84
|
+
context: { schema: { type: 'object' }, initial: {} },
|
|
85
|
+
nodes: { a: { type: 'condition', branches: [branch] } },
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
it('attributes every claim under an untagged union to the candidate that made it', () => {
|
|
90
|
+
// The process-runs list, which `ProcessDefinitionBody` reaches through
|
|
91
|
+
// `ListAgentRunsResponse.items[].process_definition_snapshot`. `branches` is a `oneOf` with
|
|
92
|
+
// no tag, so AJV reports every candidate's failures flat and unattributed:
|
|
93
|
+
//
|
|
94
|
+
// /nodes/a/branches/0 must NOT have additional properties: label, to, when
|
|
95
|
+
//
|
|
96
|
+
// `to` and `when` are declared on `BranchDefinition` — the shape this value plainly means —
|
|
97
|
+
// so read as a fact that line sends the reader after two valid fields.
|
|
98
|
+
const result = validateApiResponse(
|
|
99
|
+
'ProcessDefinitionBody',
|
|
100
|
+
withBranch({ label: 'Accepted', to: 'accepted', when: { '==': [{ var: 'ok' }, true] } }),
|
|
101
|
+
);
|
|
102
|
+
expect(result.valid).toBe(false);
|
|
103
|
+
if (result.valid) return;
|
|
104
|
+
|
|
105
|
+
// Against the candidate it means, `label` is the whole story.
|
|
106
|
+
expect(result.errors).toContain(
|
|
107
|
+
'/nodes/a/branches/0 as BranchDefinition: must NOT have additional properties: label',
|
|
108
|
+
);
|
|
109
|
+
// The other candidate is still reported — with no tag neither can be ruled out — but named,
|
|
110
|
+
// so it reads as a claim about that shape rather than about the value.
|
|
111
|
+
expect(result.errors).toContain(
|
|
112
|
+
'/nodes/a/branches/0 as BranchNodeBranchDefinition: must NOT have additional properties: label, to, when',
|
|
113
|
+
);
|
|
114
|
+
// Every attributed claim names a candidate of THIS union, never some nearer schema.
|
|
115
|
+
const named = result.issues.filter((i) => i.component !== undefined).map((i) => i.component);
|
|
116
|
+
expect(new Set(named)).toEqual(new Set(['BranchDefinition', 'BranchNodeBranchDefinition']));
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('attributes candidates that fail at different paths', () => {
|
|
120
|
+
// The case that defeats counting candidates per instance path: with a malformed `when`, the
|
|
121
|
+
// intended candidate fails at `/when` while the other fails at the branch root, so no path
|
|
122
|
+
// has two candidates and a per-path rule drops EVERY name — leaving
|
|
123
|
+
//
|
|
124
|
+
// /nodes/a/branches/0 must NOT have additional properties: to, when
|
|
125
|
+
//
|
|
126
|
+
// stated as a bare fact again. Attribution has to follow the union, not the path.
|
|
127
|
+
const result = validateApiResponse('ProcessDefinitionBody', withBranch({ to: 'accepted', when: 'bad' }));
|
|
128
|
+
expect(result.valid).toBe(false);
|
|
129
|
+
if (result.valid) return;
|
|
130
|
+
|
|
131
|
+
expect(result.errors).toContain('/nodes/a/branches/0/when as BranchDefinition: must be object');
|
|
132
|
+
expect(result.errors).toContain(
|
|
133
|
+
'/nodes/a/branches/0 as BranchNodeBranchDefinition: must NOT have additional properties: to, when',
|
|
134
|
+
);
|
|
135
|
+
// The point of the fix: nothing under a failed union is left unattributed except the union's
|
|
136
|
+
// own line, so no candidate's complaint can be mistaken for a fact about the value.
|
|
137
|
+
const unattributed = result.issues.filter((i) => i.component === undefined);
|
|
138
|
+
expect(unattributed.map((i) => i.message)).toEqual(['must match exactly one schema in oneOf']);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('leaves the component off outside a union', () => {
|
|
142
|
+
// A component name marks a claim as conditional. Attaching one where the issue holds
|
|
143
|
+
// outright would weaken a fact, besides spending characters against the response budget.
|
|
144
|
+
const result = validateApiResponse('ProcessDefinitionBody', {
|
|
145
|
+
format_version: 1,
|
|
146
|
+
process: 'demo',
|
|
147
|
+
initial: 'a',
|
|
148
|
+
title: 'Undeclared at the body level',
|
|
149
|
+
context: { schema: { type: 'object' }, initial: {} },
|
|
150
|
+
nodes: {},
|
|
151
|
+
});
|
|
152
|
+
expect(result.valid).toBe(false);
|
|
153
|
+
if (result.valid) return;
|
|
154
|
+
expect(result.issues).toEqual([
|
|
155
|
+
{ path: '/', message: 'must NOT have additional properties', undeclared: ['title'], component: undefined },
|
|
156
|
+
]);
|
|
157
|
+
expect(result.errors).toEqual(['/ must NOT have additional properties: title']);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('still gathers every undeclared name one schema reports at a path', () => {
|
|
161
|
+
// The case gathering exists for, unaffected by the split above: one strict object, many
|
|
162
|
+
// foreign keys — an unmapped Mongoose subdocument — stays a single issue.
|
|
163
|
+
const result = validateApiResponse('ProcessDefinitionBody', {
|
|
164
|
+
format_version: 1,
|
|
165
|
+
process: 'demo',
|
|
166
|
+
initial: 'a',
|
|
167
|
+
context: { schema: { type: 'object' }, initial: {} },
|
|
168
|
+
nodes: {},
|
|
169
|
+
$__parent: {},
|
|
170
|
+
$isNew: false,
|
|
171
|
+
_doc: {},
|
|
172
|
+
});
|
|
173
|
+
expect(result.valid).toBe(false);
|
|
174
|
+
if (result.valid) return;
|
|
175
|
+
expect(result.issues).toHaveLength(1);
|
|
176
|
+
expect(result.issues[0].undeclared).toEqual(['$__parent', '$isNew', '_doc']);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('rejects a value whose tag names no branch', () => {
|
|
180
|
+
const result = validateApiResponse('ToolCollectionObject', { type: 'nonesuch', url: 'https://example.com' });
|
|
181
|
+
expect(result.valid).toBe(false);
|
|
182
|
+
if (result.valid) return;
|
|
183
|
+
expect(result.errors.join('; ')).toContain('tag');
|
|
184
|
+
});
|
|
185
|
+
});
|
|
@@ -398,9 +398,9 @@ export const AppVersionGitSourceSchema = z
|
|
|
398
398
|
|
|
399
399
|
export const StartAppScaffoldRequestSchema = z
|
|
400
400
|
.strictObject({
|
|
401
|
-
app_id: z
|
|
402
|
-
.
|
|
403
|
-
|
|
401
|
+
app_id: z.string().meta({
|
|
402
|
+
description: 'Package name for the new app to create and scaffold. This is not the id of an existing app.',
|
|
403
|
+
}),
|
|
404
404
|
title: z.string().optional(),
|
|
405
405
|
description: z.string().optional(),
|
|
406
406
|
modules: z.array(AppScaffoldModuleSchema).optional(),
|
|
@@ -413,6 +413,18 @@ export const StartAppScaffoldRequestSchema = z
|
|
|
413
413
|
})
|
|
414
414
|
.meta({ id: 'StartAppScaffoldRequest' });
|
|
415
415
|
|
|
416
|
+
export const StartAppDevelopmentTaskRequestSchema = z
|
|
417
|
+
.strictObject({
|
|
418
|
+
prompt: z.string().min(1).meta({ description: 'Development request passed to the App Builder parent.' }),
|
|
419
|
+
environment: z.string().min(1).meta({ description: 'Execution environment id for the App Builder run.' }),
|
|
420
|
+
model: z.string().min(1).meta({ description: 'Model id for the App Builder run.' }),
|
|
421
|
+
build_version: z
|
|
422
|
+
.boolean()
|
|
423
|
+
.meta({ description: 'Create one immutable app version after validation. Defaults to false.' })
|
|
424
|
+
.optional(),
|
|
425
|
+
})
|
|
426
|
+
.meta({ id: 'StartAppDevelopmentTaskRequest' });
|
|
427
|
+
|
|
416
428
|
export const StartAppBuildRequestSchema = z
|
|
417
429
|
.strictObject({
|
|
418
430
|
source_ref: z
|
|
@@ -442,6 +454,12 @@ export const AgentToolDefinitionSchema = z
|
|
|
442
454
|
// component publishes `true`. They accept identical values, but the name is still derived
|
|
443
455
|
// through `AppPackage`, so this reproduces the published form exactly.
|
|
444
456
|
input_schema: openObjectSchema,
|
|
457
|
+
output_schema: openObjectSchema
|
|
458
|
+
.meta({
|
|
459
|
+
description:
|
|
460
|
+
'Optional MCP outputSchema advertised by the provider for its structuredContent payload. Execution adapters may expose results differently.',
|
|
461
|
+
})
|
|
462
|
+
.optional(),
|
|
445
463
|
url: z
|
|
446
464
|
.string()
|
|
447
465
|
.meta({
|
|
@@ -844,7 +862,7 @@ export const AppDevelopmentTaskDetailsSchema = z
|
|
|
844
862
|
source_commit: z.string().meta({ description: 'Commit currently at the branch head.' }),
|
|
845
863
|
commit_date: z.string().meta({ description: 'Branch-head commit date, when available.' }).optional(),
|
|
846
864
|
agent_run: AgentRunSearchHitSchema.meta({
|
|
847
|
-
description: 'Latest
|
|
865
|
+
description: 'Latest App Builder parent run started for this task branch.',
|
|
848
866
|
}).optional(),
|
|
849
867
|
})
|
|
850
868
|
.meta({
|
|
@@ -863,6 +881,23 @@ export const AppInstallationKindSchema = z
|
|
|
863
881
|
.enum(['ui', 'tools', 'all'])
|
|
864
882
|
.meta({ id: 'AppInstallationKind', description: 'Which app contributions an installation listing is for.' });
|
|
865
883
|
|
|
884
|
+
// `AppListScope` has a TypeScript name and therefore gets a reusable component of its own.
|
|
885
|
+
export const AppListScopeSchema = z.enum(['account', 'project']).meta({
|
|
886
|
+
id: 'AppListScope',
|
|
887
|
+
description: 'Which apps an app listing covers.',
|
|
888
|
+
});
|
|
889
|
+
|
|
890
|
+
export const AppsQuerySchema = z
|
|
891
|
+
.strictObject({
|
|
892
|
+
scope: AppListScopeSchema.meta({
|
|
893
|
+
description:
|
|
894
|
+
'Restrict the listing to apps that belong to the current project — those installed ' +
|
|
895
|
+
'into it or that have built versions in it. Defaults to `account`, which lists every ' +
|
|
896
|
+
'app visible to the account, including the public catalog.',
|
|
897
|
+
}).optional(),
|
|
898
|
+
})
|
|
899
|
+
.meta({ id: 'AppsQuery' });
|
|
900
|
+
|
|
866
901
|
export const AppInstallationsQuerySchema = z
|
|
867
902
|
.strictObject({
|
|
868
903
|
kind: AppInstallationKindSchema.meta({
|
|
@@ -35,6 +35,7 @@ import { RemoteActivityDefinitionSchema } from './integrations.js';
|
|
|
35
35
|
import { CatalogInteractionRefSchema } from './interaction.js';
|
|
36
36
|
import { ProcessDefinitionBodySchema } from './process.js';
|
|
37
37
|
import { RenderingTemplateDefinitionRefSchema } from './project.js';
|
|
38
|
+
import { EditRevisionSchema, ExpectedEditRevisionSchema } from './schema-primitives.js';
|
|
38
39
|
import { InCodeTypeDefinitionSchema } from './store.js';
|
|
39
40
|
import { ViewExperienceConfigurationSchema } from './view-execution.js';
|
|
40
41
|
|
|
@@ -428,6 +429,10 @@ export const AppManifestDataSchema = z
|
|
|
428
429
|
})
|
|
429
430
|
.meta({ id: 'AppManifestData' });
|
|
430
431
|
|
|
432
|
+
export const UpdateAppPayloadSchema = AppManifestDataSchema.extend({
|
|
433
|
+
expected_edit_revision: ExpectedEditRevisionSchema,
|
|
434
|
+
}).meta({ id: 'UpdateAppPayload' });
|
|
435
|
+
|
|
431
436
|
export const CompositeAppMenuNavItemSchema: z.ZodType<CompositeAppMenuNavItem> = z
|
|
432
437
|
.strictObject({
|
|
433
438
|
id: z.string().meta({ description: 'Stable unique identifier' }),
|
|
@@ -506,6 +511,7 @@ export const CompositeAppMessageOverridesSchema = z
|
|
|
506
511
|
|
|
507
512
|
export const AppManifestSchema = z
|
|
508
513
|
.strictObject({
|
|
514
|
+
edit_revision: EditRevisionSchema,
|
|
509
515
|
name: z.string().meta({
|
|
510
516
|
description: 'The name of the app, used as the id in the system. Must be in kebab case (e.g. my-app).',
|
|
511
517
|
}),
|
|
@@ -737,6 +743,7 @@ export const AppInstallationListEntryArraySchema = z
|
|
|
737
743
|
|
|
738
744
|
export const CompositeAppConfigSchema = z
|
|
739
745
|
.strictObject({
|
|
746
|
+
edit_revision: EditRevisionSchema,
|
|
740
747
|
id: z
|
|
741
748
|
.string()
|
|
742
749
|
.meta({
|
|
@@ -958,6 +965,7 @@ export const AppPackageSchema = z
|
|
|
958
965
|
|
|
959
966
|
export const CompositeAppConfigPayloadSchema = z
|
|
960
967
|
.strictObject({
|
|
968
|
+
expected_edit_revision: ExpectedEditRevisionSchema,
|
|
961
969
|
card: CompositeAppCardOverridesSchema.meta({
|
|
962
970
|
description: 'Card display overrides (includes visibility)',
|
|
963
971
|
}).optional(),
|