@treeseed/sdk 0.13.0-rc.12 → 0.13.0-rc.121
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/README.md +23 -9
- package/dist/.treeseed-build-complete.json +1 -0
- package/dist/accounts/account-contracts.d.ts +6 -0
- package/dist/agent-capacity/allocation.d.ts +0 -3
- package/dist/agent-capacity/allocation.js +0 -221
- package/dist/agent-capacity/artifact-mutation-receipt.d.ts +1 -1
- package/dist/agent-capacity/artifacts.d.ts +17 -1
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +4395 -0
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.js +176 -0
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.d.ts +304 -0
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.js +44 -0
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +22 -2
- package/dist/agent-capacity/contracts/capacity/assignments/context-pack-compiler.d.ts +25 -0
- package/dist/agent-capacity/contracts/capacity/assignments/context-pack-compiler.js +67 -0
- package/dist/agent-capacity/contracts/capacity/communication/communication-records.d.ts +1 -1
- package/dist/agent-capacity/contracts/capacity/providers/supply-policy.d.ts +0 -2
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.d.ts +82 -0
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.js +115 -0
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.d.ts +142 -0
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.js +51 -0
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.d.ts +331 -0
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.js +135 -0
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +3 -22
- package/dist/agent-capacity/contracts/configuration/configuration.js +1 -1
- package/dist/agent-capacity/contracts/operations/agent-team-clone.d.ts +218 -0
- package/dist/agent-capacity/contracts/operations/agent-team-clone.js +57 -0
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +0 -1
- package/dist/agent-capacity/contracts/runtime/runtime-observability.d.ts +3 -3
- package/dist/agent-capacity/contracts/support/decision-work.d.ts +3 -27
- package/dist/agent-capacity/contracts/support/execution-graph.d.ts +1087 -0
- package/dist/agent-capacity/contracts/support/execution-graph.js +120 -0
- package/dist/agent-capacity/contracts/support/time-capacity.d.ts +0 -14
- package/dist/agent-capacity/contracts/support/time-capacity.js +1 -8
- package/dist/agent-capacity/validation/activity-profile.d.ts +1 -1
- package/dist/agent-capacity/validation/activity-profile.js +3 -259
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +2687 -8933
- package/dist/agent-capacity/validation/agent-definition-schema.js +64 -174
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +23 -23
- package/dist/agent-capacity/validation/assignment-records.js +1 -1
- package/dist/agent-capacity/validation/configuration.d.ts +1 -1
- package/dist/agent-capacity/validation/configuration.js +1 -2
- package/dist/agent-capacity/validation/execution/execution-graph.d.ts +1 -0
- package/dist/agent-capacity/validation/execution/execution-graph.js +16 -0
- package/dist/agent-capacity/validation/index.d.ts +2 -1
- package/dist/agent-capacity/validation/index.js +2 -1
- package/dist/capacity/agents/agent-capacity.d.ts +9 -1
- package/dist/capacity/agents/agent-capacity.js +8 -1
- package/dist/capacity-provider/capability-ontology.d.ts +1495 -0
- package/dist/capacity-provider/capability-ontology.js +221 -0
- package/dist/capacity-provider/client.d.ts +69 -0
- package/dist/capacity-provider/client.js +22 -1
- package/dist/capacity-provider/contracts/capacity-facts.d.ts +14 -0
- package/dist/capacity-provider/contracts/environment-profiles.d.ts +255 -0
- package/dist/capacity-provider/contracts/environment-profiles.js +71 -0
- package/dist/capacity-provider/contracts/governance.d.ts +109 -35
- package/dist/capacity-provider/contracts/index.d.ts +1 -0
- package/dist/capacity-provider/contracts/index.js +1 -0
- package/dist/capacity-provider/core-capability-catalog.d.ts +47 -0
- package/dist/capacity-provider/core-capability-catalog.js +49 -0
- package/dist/capacity-provider/environment-catalog.d.ts +877 -0
- package/dist/capacity-provider/environment-catalog.js +116 -0
- package/dist/capacity-provider/index.d.ts +5 -0
- package/dist/capacity-provider/index.js +5 -0
- package/dist/capacity-provider/install-configuration.d.ts +39 -0
- package/dist/capacity-provider/install-configuration.js +18 -0
- package/dist/capacity-provider/sandbox-contracts.d.ts +602 -0
- package/dist/capacity-provider/sandbox-contracts.js +90 -0
- package/dist/capacity-provider/sandbox.d.ts +2 -0
- package/dist/capacity-provider/sandbox.js +2 -0
- package/dist/capacity-provider/source-workspace.d.ts +642 -0
- package/dist/capacity-provider/source-workspace.js +126 -0
- package/dist/capacity-provider/validation.d.ts +2 -2
- package/dist/capacity-provider/validation.js +91 -55
- package/dist/configuration/secrets-capability.d.ts +5 -1
- package/dist/configuration/secrets-capability.js +5 -1
- package/dist/content/contracts.d.ts +1 -1
- package/dist/content/validation/agent-operational-content-schemas.d.ts +431 -780
- package/dist/content/validation/agent-operational-content-schemas.js +29 -57
- package/dist/content/validation/auxiliary-content-schemas.d.ts +208 -208
- package/dist/content/validation/content-model-schemas.d.ts +9362 -19159
- package/dist/content/validation/content-model-schemas.js +172 -43
- package/dist/content/validation/portable-content-data.d.ts +453 -1761
- package/dist/content/validation/portable-content-data.js +5 -4
- package/dist/deployment/ai/storage.d.ts +158 -0
- package/dist/deployment/ai/storage.js +32 -0
- package/dist/deployment/ai-hosting.d.ts +297 -0
- package/dist/deployment/ai-hosting.js +63 -0
- package/dist/deployment/ai-instance.d.ts +65 -0
- package/dist/deployment/ai-instance.js +30 -0
- package/dist/deployment/ai-mode.d.ts +454 -0
- package/dist/deployment/ai-mode.js +67 -0
- package/dist/deployment/canonical.d.ts +2 -0
- package/dist/deployment/canonical.js +17 -0
- package/dist/deployment/catalog.d.ts +16 -0
- package/dist/deployment/catalog.js +48 -0
- package/dist/deployment/hosted-topology-template.d.ts +449 -0
- package/dist/deployment/hosted-topology-template.js +56 -0
- package/dist/deployment/hosted-topology.d.ts +2698 -0
- package/dist/deployment/hosted-topology.js +468 -0
- package/dist/deployment/index.d.ts +13 -0
- package/dist/deployment/index.js +13 -0
- package/dist/deployment/postgres/contracts.d.ts +418 -0
- package/dist/deployment/postgres/contracts.js +83 -0
- package/dist/deployment/postgres/requirements.d.ts +15 -0
- package/dist/deployment/postgres/requirements.js +32 -0
- package/dist/deployment/postgres/transfer.d.ts +97 -0
- package/dist/deployment/postgres/transfer.js +29 -0
- package/dist/deployment/schemas.d.ts +8625 -0
- package/dist/deployment/schemas.js +455 -0
- package/dist/deployment/topology.d.ts +9 -0
- package/dist/deployment/topology.js +35 -0
- package/dist/development/index.d.ts +1 -0
- package/dist/development/index.js +1 -0
- package/dist/development/schemas.d.ts +3594 -0
- package/dist/development/schemas.js +204 -0
- package/dist/development/session-migration.d.ts +3 -0
- package/dist/development/session-migration.js +25 -0
- package/dist/entrypoints/clients/control-plane-client.d.ts +9 -1
- package/dist/entrypoints/clients/control-plane-client.js +17 -5
- package/dist/graph/context-query-contracts.d.ts +16 -1
- package/dist/graph/context-query-contracts.js +5 -0
- package/dist/guarantees/evidence-trust.d.ts +32 -0
- package/dist/guarantees/evidence-trust.js +47 -0
- package/dist/guarantees/index.d.ts +130 -0
- package/dist/guarantees/index.js +44 -0
- package/dist/identity/browser-session.d.ts +233 -0
- package/dist/identity/browser-session.js +51 -0
- package/dist/identity/contracts.d.ts +191 -0
- package/dist/identity/contracts.js +72 -0
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.js +3 -0
- package/dist/identity/runtime.d.ts +186 -0
- package/dist/identity/runtime.js +49 -0
- package/dist/model-registry/agent-operational-models.d.ts +1 -1
- package/dist/model-registry/agent-operational-models.js +1 -4
- package/dist/model-registry/build-builtin-model-registry.js +44 -72
- package/dist/operator-contracts/canonical-command-tree.js +397 -43
- package/dist/operator-contracts/catalog/admin-account-team-operations.d.ts +36 -0
- package/dist/operator-contracts/catalog/admin-account-team-operations.js +52 -0
- package/dist/operator-contracts/catalog/agents/agent-team-clone-operations.d.ts +75 -0
- package/dist/operator-contracts/catalog/agents/agent-team-clone-operations.js +42 -0
- package/dist/operator-contracts/catalog/capability-ontology-operations.d.ts +163 -0
- package/dist/operator-contracts/catalog/capability-ontology-operations.js +24 -0
- package/dist/operator-contracts/catalog/commands/command-tree-builders.d.ts +60 -0
- package/dist/operator-contracts/catalog/commands/command-tree-builders.js +191 -0
- package/dist/operator-contracts/catalog/communication-operations.d.ts +439 -0
- package/dist/operator-contracts/catalog/communication-operations.js +92 -0
- package/dist/operator-contracts/catalog/control-plane-catalog.d.ts +6 -0
- package/dist/operator-contracts/catalog/control-plane-catalog.js +18 -0
- package/dist/operator-contracts/catalog/execution/execution-operations.d.ts +36 -0
- package/dist/operator-contracts/catalog/execution/execution-operations.js +39 -0
- package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +399 -0
- package/dist/operator-contracts/catalog/hosted-topology-operations.js +79 -0
- package/dist/operator-contracts/catalog/inbox-operations.d.ts +265 -0
- package/dist/operator-contracts/catalog/inbox-operations.js +36 -0
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +53 -0
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +23 -0
- package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.d.ts +3 -0
- package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.js +15 -0
- package/dist/operator-contracts/catalog/knowledge-share-operations.d.ts +127 -0
- package/dist/operator-contracts/catalog/knowledge-share-operations.js +25 -0
- package/dist/operator-contracts/catalog/provider-environment-commands.d.ts +4 -0
- package/dist/operator-contracts/catalog/provider-environment-commands.js +69 -0
- package/dist/operator-contracts/catalog/provider-environment-operations.d.ts +41 -0
- package/dist/operator-contracts/catalog/provider-environment-operations.js +61 -0
- package/dist/operator-contracts/catalog/services/identity-commands.d.ts +2 -0
- package/dist/operator-contracts/catalog/services/identity-commands.js +13 -0
- package/dist/operator-contracts/catalog/services/secret-commands.d.ts +2 -0
- package/dist/operator-contracts/catalog/services/secret-commands.js +31 -0
- package/dist/operator-contracts/catalog/services/secret-operations.d.ts +62 -0
- package/dist/operator-contracts/catalog/services/secret-operations.js +51 -0
- package/dist/operator-contracts/catalog/treeai-operations.d.ts +13 -0
- package/dist/operator-contracts/catalog/treeai-operations.js +61 -0
- package/dist/operator-contracts/catalog/workdays/profile-commands.d.ts +4 -0
- package/dist/operator-contracts/catalog/workdays/profile-commands.js +20 -0
- package/dist/operator-contracts/catalog/workdays/profile-operations.d.ts +41 -0
- package/dist/operator-contracts/catalog/workdays/profile-operations.js +50 -0
- package/dist/operator-contracts/catalog/workdays/selection-commands.d.ts +3 -0
- package/dist/operator-contracts/catalog/workdays/selection-commands.js +29 -0
- package/dist/operator-contracts/command-tree.d.ts +29 -0
- package/dist/operator-contracts/command-tree.js +50 -0
- package/dist/operator-contracts/communication/addressing.d.ts +8 -0
- package/dist/operator-contracts/communication/addressing.js +57 -0
- package/dist/operator-contracts/communication/contracts.d.ts +1824 -0
- package/dist/operator-contracts/communication/contracts.js +190 -0
- package/dist/operator-contracts/control-plane-operation.d.ts +9 -0
- package/dist/operator-contracts/control-plane-operation.js +12 -2
- package/dist/operator-contracts/control-plane-operations.d.ts +2356 -209
- package/dist/operator-contracts/control-plane-operations.js +239 -102
- package/dist/operator-contracts/inbox/contracts.d.ts +1111 -0
- package/dist/operator-contracts/inbox/contracts.js +138 -0
- package/dist/operator-contracts/index.d.ts +6 -1
- package/dist/operator-contracts/index.js +6 -1
- package/dist/operator-contracts/knowledge/contracts.d.ts +130 -0
- package/dist/operator-contracts/knowledge/contracts.js +39 -0
- package/dist/operator-contracts/mcp.d.ts +5 -0
- package/dist/operator-contracts/mcp.js +61 -0
- package/dist/operator-contracts/oauth.d.ts +45 -0
- package/dist/operator-contracts/oauth.js +7 -0
- package/dist/operator-contracts/operation-builder.d.ts +18 -0
- package/dist/operator-contracts/operation-builder.js +78 -0
- package/dist/operator-contracts/seed/seed-bundle.d.ts +138 -0
- package/dist/operator-contracts/seed/seed-bundle.js +68 -0
- package/dist/operator-contracts/workday-lifecycle.d.ts +21 -28
- package/dist/operator-contracts/workday-lifecycle.js +46 -8
- package/dist/platform/contracts.d.ts +429 -0
- package/dist/platform/contracts.js +93 -0
- package/dist/platform/index.d.ts +6 -0
- package/dist/platform/index.js +6 -0
- package/dist/platform/inventory.d.ts +11 -0
- package/dist/platform/inventory.js +53 -0
- package/dist/platform/project-create.d.ts +49 -0
- package/dist/platform/project-create.js +75 -0
- package/dist/platform/schemas.d.ts +986 -0
- package/dist/platform/schemas.js +73 -0
- package/dist/platform/verification.d.ts +9 -0
- package/dist/platform/verification.js +104 -0
- package/dist/platform/workset.d.ts +21 -0
- package/dist/platform/workset.js +106 -0
- package/dist/sdk-types/support/sdk-model-names.d.ts +1 -1
- package/dist/sdk-types/support/sdk-model-names.js +0 -3
- package/dist/secrets-capability/github-actions-encryption.d.ts +2 -0
- package/dist/secrets-capability/github-actions-encryption.js +11 -0
- package/dist/secrets-capability/provider-operation-contracts.d.ts +15 -1
- package/dist/secrets-capability/secret-contracts.d.ts +33 -0
- package/dist/secrets-capability/secret-contracts.js +49 -0
- package/dist/secrets-capability/service-provider-contracts.d.ts +5 -3
- package/dist/secrets-capability/service-provider-contracts.js +66 -50
- package/dist/secrets-capability/shared-access.d.ts +51 -0
- package/dist/secrets-capability/shared-access.js +36 -0
- package/dist/secrets-capability/shared-resources.d.ts +376 -0
- package/dist/secrets-capability/shared-resources.js +91 -0
- package/dist/secrets-capability/vault-contracts.d.ts +132 -0
- package/dist/secrets-capability/vault-contracts.js +56 -0
- package/dist/security/encrypted-envelope.d.ts +177 -0
- package/dist/security/encrypted-envelope.js +34 -0
- package/dist/security/envelope-codec.d.ts +38 -0
- package/dist/security/envelope-codec.js +96 -0
- package/dist/security/index.d.ts +2 -0
- package/dist/security/index.js +2 -0
- package/dist/site-contracts/catalog.d.ts +16 -0
- package/dist/site-contracts/catalog.js +19 -0
- package/dist/site-contracts/cloudflare.d.ts +48 -0
- package/dist/site-contracts/platform.d.ts +94 -0
- package/dist/site-contracts/plugin.d.ts +63 -0
- package/dist/site-contracts/plugin.js +26 -0
- package/dist/treeai/catalog.d.ts +1 -0
- package/dist/treeai/catalog.js +1 -0
- package/dist/treeai/client.d.ts +793 -0
- package/dist/treeai/client.js +44 -0
- package/dist/treeai/contract.d.ts +41 -0
- package/dist/treeai/contract.js +51 -0
- package/dist/treeai/generated/upstream.d.ts +770 -0
- package/dist/treeai/generated/upstream.js +4 -0
- package/dist/treeai/index.d.ts +4 -0
- package/dist/treeai/index.js +4 -0
- package/dist/treedx/client.d.ts +605 -0
- package/dist/treedx/client.js +39 -0
- package/dist/treedx/contract.d.ts +32 -0
- package/dist/treedx/contract.js +63 -0
- package/dist/treedx/index.d.ts +3 -0
- package/dist/treedx/index.js +2 -0
- package/dist/treedx/types.d.ts +8 -7
- package/dist/treedx/types.js +0 -7
- package/dist/types/agents/agent-activity-profile.d.ts +42 -98
- package/dist/types/agents/agent-activity-profile.js +23 -0
- package/dist/types/agents/agent-trigger-kinds.d.ts +3 -5
- package/dist/types/agents/agent-trigger-kinds.js +1 -13
- package/dist/types/agents/execution-run-ref.d.ts +1 -8
- package/package.json +64 -11
- package/dist/agent-capacity/authority/agent-authority-presets.d.ts +0 -13
- package/dist/agent-capacity/authority/agent-authority-presets.js +0 -106
- package/dist/agent-capacity/contracts/operations/workflow-promotion.d.ts +0 -24
- package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.d.ts +0 -29
- package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.js +0 -110
- package/dist/agent-capacity/validation/workflow-promotion.d.ts +0 -2
- package/dist/agent-capacity/validation/workflow-promotion.js +0 -34
- package/dist/operator-contracts/workday-profile.d.ts +0 -72
- package/dist/operator-contracts/workday-profile.js +0 -106
- package/dist/secrets-capability/service-vault-contracts.d.ts +0 -61
- package/dist/secrets-capability/service-vault-contracts.js +0 -39
- package/dist/treedx/accounts/auth.d.ts +0 -17
- package/dist/treedx/accounts/auth.js +0 -48
- package/dist/treedx/client/accounts/contracts/auth-mode.d.ts +0 -3
- package/dist/treedx/client/accounts/contracts/auth-mode.js +0 -6
- package/dist/treedx/client/build/creation/build-context.d.ts +0 -3
- package/dist/treedx/client/build/creation/build-context.js +0 -7
- package/dist/treedx/client/build/creation/build-snapshot.d.ts +0 -3
- package/dist/treedx/client/build/creation/build-snapshot.js +0 -8
- package/dist/treedx/client/capacity/allocations/contracts/put-capability-grant.d.ts +0 -3
- package/dist/treedx/client/capacity/allocations/contracts/put-capability-grant.js +0 -7
- package/dist/treedx/client/capacity/allocations/queries/list-capability-grants.d.ts +0 -6
- package/dist/treedx/client/capacity/allocations/queries/list-capability-grants.js +0 -10
- package/dist/treedx/client/methods.d.ts +0 -102
- package/dist/treedx/client/methods.js +0 -209
- package/dist/treedx/client/persistence/contracts/restore-storage.d.ts +0 -3
- package/dist/treedx/client/persistence/contracts/restore-storage.js +0 -6
- package/dist/treedx/client/persistence/lifecycle/verify-storage-restore.d.ts +0 -3
- package/dist/treedx/client/persistence/lifecycle/verify-storage-restore.js +0 -6
- package/dist/treedx/client/repositories/creation/register-repository.d.ts +0 -3
- package/dist/treedx/client/repositories/creation/register-repository.js +0 -7
- package/dist/treedx/client/repositories/queries/get-repository.d.ts +0 -3
- package/dist/treedx/client/repositories/queries/get-repository.js +0 -7
- package/dist/treedx/client/repositories/queries/list-repository-paths.d.ts +0 -3
- package/dist/treedx/client/repositories/queries/list-repository-paths.js +0 -7
- package/dist/treedx/client/repositories/queries/list-repository-refs.d.ts +0 -3
- package/dist/treedx/client/repositories/queries/list-repository-refs.js +0 -12
- package/dist/treedx/client/repositories/queries/query-repository.d.ts +0 -3
- package/dist/treedx/client/repositories/queries/query-repository.js +0 -7
- package/dist/treedx/client/repositories/queries/read-repository-file.d.ts +0 -3
- package/dist/treedx/client/repositories/queries/read-repository-file.js +0 -6
- package/dist/treedx/client/repositories/queries/read-repository-files.d.ts +0 -3
- package/dist/treedx/client/repositories/queries/read-repository-files.js +0 -7
- package/dist/treedx/client/repositories/queries/search-repository-files.d.ts +0 -3
- package/dist/treedx/client/repositories/queries/search-repository-files.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/artifacts/contracts/download-artifact.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/artifacts/contracts/download-artifact.js +0 -9
- package/dist/treedx/client/support/contracts/treedx/authorization/contracts/whoami.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/authorization/contracts/whoami.js +0 -6
- package/dist/treedx/client/support/contracts/treedx/graph/contracts/parse-context-dsl.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/graph/contracts/parse-context-dsl.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/health/contracts/deep-health.d.ts +0 -5
- package/dist/treedx/client/support/contracts/treedx/health/contracts/deep-health.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/health/contracts/health.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/health/contracts/health.js +0 -6
- package/dist/treedx/client/support/contracts/treedx/health/contracts/metrics.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/health/contracts/metrics.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/health/contracts/prometheus-metrics.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/health/contracts/prometheus-metrics.js +0 -19
- package/dist/treedx/client/support/contracts/treedx/health/contracts/ready.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/health/contracts/ready.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/health/contracts/status.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/health/contracts/status.js +0 -6
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/commit.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/commit.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/diff.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/diff.js +0 -6
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/fetch-remote.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/fetch-remote.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/push.d.ts +0 -6
- package/dist/treedx/client/support/contracts/treedx/repositories/contracts/push.js +0 -23
- package/dist/treedx/client/support/contracts/treedx/search/contracts/compact-search-index.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/search/contracts/compact-search-index.js +0 -8
- package/dist/treedx/client/support/contracts/treedx/search/contracts/search.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/search/contracts/search.js +0 -7
- package/dist/treedx/client/support/contracts/treedx/storage/contracts/backup-storage.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/storage/contracts/backup-storage.js +0 -8
- package/dist/treedx/client/support/contracts/treedx/storage/contracts/compact-storage.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/storage/contracts/compact-storage.js +0 -8
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/assert-binary-ok.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/assert-binary-ok.js +0 -15
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/fetch-with-timeout.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/fetch-with-timeout.js +0 -38
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/headers.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/headers.js +0 -15
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/parse-json-response.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/parse-json-response.js +0 -15
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/query.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/query.js +0 -14
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/repo-id.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/repo-id.js +0 -14
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/request.d.ts +0 -6
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/request.js +0 -41
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/throw-api-error.d.ts +0 -2
- package/dist/treedx/client/support/contracts/treedx/transport/contracts/throw-api-error.js +0 -14
- package/dist/treedx/client/support/contracts/treedx/workspaces/contracts/exec.d.ts +0 -3
- package/dist/treedx/client/support/contracts/treedx/workspaces/contracts/exec.js +0 -7
- package/dist/treedx/client/support/creation/apply-changeset.d.ts +0 -3
- package/dist/treedx/client/support/creation/apply-changeset.js +0 -10
- package/dist/treedx/client/support/creation/apply-storage-migration.d.ts +0 -3
- package/dist/treedx/client/support/creation/apply-storage-migration.js +0 -7
- package/dist/treedx/client/support/creation/create-migration.d.ts +0 -6
- package/dist/treedx/client/support/creation/create-migration.js +0 -7
- package/dist/treedx/client/support/creation/export-artifact.d.ts +0 -3
- package/dist/treedx/client/support/creation/export-artifact.js +0 -8
- package/dist/treedx/client/support/creation/plan-storage-migration.d.ts +0 -3
- package/dist/treedx/client/support/creation/plan-storage-migration.js +0 -7
- package/dist/treedx/client/support/creation/request-binary.d.ts +0 -6
- package/dist/treedx/client/support/creation/request-binary.js +0 -42
- package/dist/treedx/client/support/creation/write-file.d.ts +0 -3
- package/dist/treedx/client/support/creation/write-file.js +0 -10
- package/dist/treedx/client/support/creation/write-files.d.ts +0 -3
- package/dist/treedx/client/support/creation/write-files.js +0 -12
- package/dist/treedx/client/support/queries/treedx/artifacts/queries/get-artifact.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/artifacts/queries/get-artifact.js +0 -7
- package/dist/treedx/client/support/queries/treedx/artifacts/queries/list-artifacts.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/artifacts/queries/list-artifacts.js +0 -7
- package/dist/treedx/client/support/queries/treedx/authorization/queries/effective-scope.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/authorization/queries/effective-scope.js +0 -9
- package/dist/treedx/client/support/queries/treedx/authorization/queries/list-capabilities.d.ts +0 -4
- package/dist/treedx/client/support/queries/treedx/authorization/queries/list-capabilities.js +0 -6
- package/dist/treedx/client/support/queries/treedx/federation/queries/get-placement.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/federation/queries/get-placement.js +0 -7
- package/dist/treedx/client/support/queries/treedx/graph/queries/get-node.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/graph/queries/get-node.js +0 -7
- package/dist/treedx/client/support/queries/treedx/graph/queries/get-related.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/graph/queries/get-related.js +0 -7
- package/dist/treedx/client/support/queries/treedx/graph/queries/list-nodes.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/graph/queries/list-nodes.js +0 -7
- package/dist/treedx/client/support/queries/treedx/repositories/queries/list-tree.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/repositories/queries/list-tree.js +0 -10
- package/dist/treedx/client/support/queries/treedx/repositories/queries/read-file.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/repositories/queries/read-file.js +0 -9
- package/dist/treedx/client/support/queries/treedx/search/queries/get-search-index-status.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/search/queries/get-search-index-status.js +0 -7
- package/dist/treedx/client/support/queries/treedx/storage/queries/get-migration.d.ts +0 -6
- package/dist/treedx/client/support/queries/treedx/storage/queries/get-migration.js +0 -7
- package/dist/treedx/client/support/queries/treedx/storage/queries/get-snapshot.d.ts +0 -6
- package/dist/treedx/client/support/queries/treedx/storage/queries/get-snapshot.js +0 -7
- package/dist/treedx/client/support/queries/treedx/storage/queries/list-storage-migrations.d.ts +0 -6
- package/dist/treedx/client/support/queries/treedx/storage/queries/list-storage-migrations.js +0 -6
- package/dist/treedx/client/support/queries/treedx/transport/queries/list-audit-events.d.ts +0 -15
- package/dist/treedx/client/support/queries/treedx/transport/queries/list-audit-events.js +0 -6
- package/dist/treedx/client/support/queries/treedx/transport/queries/list-repositories.d.ts +0 -3
- package/dist/treedx/client/support/queries/treedx/transport/queries/list-repositories.js +0 -7
- package/dist/treedx/client/support/retirement/cleanup-artifacts.d.ts +0 -3
- package/dist/treedx/client/support/retirement/cleanup-artifacts.js +0 -7
- package/dist/treedx/client/support/retirement/delete-artifact.d.ts +0 -3
- package/dist/treedx/client/support/retirement/delete-artifact.js +0 -7
- package/dist/treedx/client/support/retirement/delete-file.d.ts +0 -3
- package/dist/treedx/client/support/retirement/delete-file.js +0 -10
- package/dist/treedx/client/support/retirement/rollback-storage-migration.d.ts +0 -3
- package/dist/treedx/client/support/retirement/rollback-storage-migration.js +0 -7
- package/dist/treedx/client/support/updates/patch-file.d.ts +0 -3
- package/dist/treedx/client/support/updates/patch-file.js +0 -10
- package/dist/treedx/client/support/updates/refresh-search-index.d.ts +0 -3
- package/dist/treedx/client/support/updates/refresh-search-index.js +0 -8
- package/dist/treedx/client/treedx/blobs/contracts/download-blob.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/contracts/download-blob.js +0 -6
- package/dist/treedx/client/treedx/blobs/creation/create-blob-upload.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/creation/create-blob-upload.js +0 -8
- package/dist/treedx/client/treedx/blobs/creation/request-blob-download.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/creation/request-blob-download.js +0 -27
- package/dist/treedx/client/treedx/blobs/creation/request-blob-upload.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/creation/request-blob-upload.js +0 -41
- package/dist/treedx/client/treedx/blobs/creation/upload-blob-part.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/creation/upload-blob-part.js +0 -27
- package/dist/treedx/client/treedx/blobs/creation/upload-blob.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/creation/upload-blob.js +0 -6
- package/dist/treedx/client/treedx/blobs/creation/write-blob.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/creation/write-blob.js +0 -8
- package/dist/treedx/client/treedx/blobs/lifecycle/complete-blob-upload.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/lifecycle/complete-blob-upload.js +0 -8
- package/dist/treedx/client/treedx/blobs/queries/read-blob.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/queries/read-blob.js +0 -10
- package/dist/treedx/client/treedx/blobs/retirement/abort-blob-upload.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/retirement/abort-blob-upload.js +0 -7
- package/dist/treedx/client/treedx/blobs/retirement/delete-blob.d.ts +0 -3
- package/dist/treedx/client/treedx/blobs/retirement/delete-blob.js +0 -8
- package/dist/treedx/client/treedx/federation/contracts/federated-query.d.ts +0 -3
- package/dist/treedx/client/treedx/federation/contracts/federated-query.js +0 -7
- package/dist/treedx/client/treedx/federation/creation/plan-federated-query.d.ts +0 -3
- package/dist/treedx/client/treedx/federation/creation/plan-federated-query.js +0 -6
- package/dist/treedx/client/treedx/federation/queries/check-mirror-health.d.ts +0 -3
- package/dist/treedx/client/treedx/federation/queries/check-mirror-health.js +0 -7
- package/dist/treedx/client/treedx/federation/updates/promote-mirror.d.ts +0 -3
- package/dist/treedx/client/treedx/federation/updates/promote-mirror.js +0 -7
- package/dist/treedx/client/treedx/federation/updates/sync-mirror.d.ts +0 -3
- package/dist/treedx/client/treedx/federation/updates/sync-mirror.js +0 -7
- package/dist/treedx/client/treedx/graph/contracts/federated-context.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/contracts/federated-context.js +0 -7
- package/dist/treedx/client/treedx/graph/contracts/federated-graph.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/contracts/federated-graph.js +0 -7
- package/dist/treedx/client/treedx/graph/contracts/graph-search.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/contracts/graph-search.js +0 -8
- package/dist/treedx/client/treedx/graph/queries/get-graph-node.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/queries/get-graph-node.js +0 -10
- package/dist/treedx/client/treedx/graph/queries/get-graph-refresh-job.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/queries/get-graph-refresh-job.js +0 -7
- package/dist/treedx/client/treedx/graph/queries/get-subgraph.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/queries/get-subgraph.js +0 -7
- package/dist/treedx/client/treedx/graph/queries/query-graph.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/queries/query-graph.js +0 -7
- package/dist/treedx/client/treedx/graph/queries/search-graph-entities.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/queries/search-graph-entities.js +0 -6
- package/dist/treedx/client/treedx/graph/queries/search-graph-files.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/queries/search-graph-files.js +0 -6
- package/dist/treedx/client/treedx/graph/queries/search-graph-sections.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/queries/search-graph-sections.js +0 -6
- package/dist/treedx/client/treedx/graph/updates/refresh-graph.d.ts +0 -3
- package/dist/treedx/client/treedx/graph/updates/refresh-graph.js +0 -7
- package/dist/treedx/client/treedx/search/contracts/federated-search.d.ts +0 -3
- package/dist/treedx/client/treedx/search/contracts/federated-search.js +0 -7
- package/dist/treedx/client/treedx/workspaces/creation/create-workspace.d.ts +0 -3
- package/dist/treedx/client/treedx/workspaces/creation/create-workspace.js +0 -7
- package/dist/treedx/client/treedx/workspaces/retirement/abandon-workspace.d.ts +0 -3
- package/dist/treedx/client/treedx/workspaces/retirement/abandon-workspace.js +0 -12
- package/dist/treedx/client/treedx/workspaces/retirement/close-workspace.d.ts +0 -2
- package/dist/treedx/client/treedx/workspaces/retirement/close-workspace.js +0 -6
- package/dist/treedx/generated/openapi-types.d.ts +0 -3662
- package/dist/treedx/support/client.d.ts +0 -251
- package/dist/treedx/support/client.js +0 -252
- package/dist/treedx/support/errors.d.ts +0 -13
- package/dist/treedx/support/errors.js +0 -17
- package/dist/treedx/types/tree-dx-actor.d.ts +0 -209
- package/dist/treedx/types/tree-dx-actor.js +0 -8
- package/dist/treedx/types/tree-dx-artifact-list-response.d.ts +0 -13
- package/dist/treedx/types/tree-dx-artifact-list-response.js +0 -0
- package/dist/treedx/types/tree-dx-changeset.d.ts +0 -51
- package/dist/treedx/types/tree-dx-changeset.js +0 -6
- package/dist/treedx/types/tree-dx-context-request.d.ts +0 -245
- package/dist/treedx/types/tree-dx-context-request.js +0 -0
- package/dist/treedx/types/tree-dx-exec-result.d.ts +0 -249
- package/dist/treedx/types/tree-dx-exec-result.js +0 -0
- package/dist/treedx/types/tree-dx-list-tree-request.d.ts +0 -222
- package/dist/treedx/types/tree-dx-list-tree-request.js +0 -0
- package/dist/treedx/types/tree-dx-push-request.d.ts +0 -229
- package/dist/treedx/types/tree-dx-push-request.js +0 -0
- /package/dist/{agent-capacity/contracts/operations/workflow-promotion.js → site-contracts/cloudflare.js} +0 -0
- /package/dist/{treedx/generated/openapi-types.js → site-contracts/platform.js} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { activityProfileSchema } from "../../validation/agent-definition-schema.js";
|
|
3
|
+
import { estimateSchema, exactEntityReferenceSchema } from "../capacity/assignments/agent-execution.js";
|
|
4
|
+
const identifier = z.string().trim().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u);
|
|
5
|
+
const slug = z.string().trim().min(1).max(100).regex(/^[a-z0-9]+(?:[._/-][a-z0-9]+)*$/u);
|
|
6
|
+
const uniqueIds = z.array(identifier).superRefine((items, context) => {
|
|
7
|
+
if (new Set(items).size !== items.length) context.addIssue({ code: z.ZodIssueCode.custom, message: "Values must be unique." });
|
|
8
|
+
});
|
|
9
|
+
const conditionDefinitionSchema = z.object({
|
|
10
|
+
conditionType: z.enum(["question", "external", "authority", "lifecycle"]),
|
|
11
|
+
subjectRef: exactEntityReferenceSchema,
|
|
12
|
+
expectedState: identifier
|
|
13
|
+
}).strict();
|
|
14
|
+
const executionNodeSchema = z.object({
|
|
15
|
+
schemaVersion: z.literal("treeseed.execution-node/v1"),
|
|
16
|
+
id: identifier,
|
|
17
|
+
teamId: identifier,
|
|
18
|
+
projectId: identifier,
|
|
19
|
+
workdayId: identifier.optional(),
|
|
20
|
+
workItemId: slug.optional(),
|
|
21
|
+
kind: z.enum(["planning", "estimating", "acting", "reviewing", "reporting", "communication", "condition"]),
|
|
22
|
+
pairRole: z.enum(["actor", "reviewer"]).nullable(),
|
|
23
|
+
sourceRef: exactEntityReferenceSchema,
|
|
24
|
+
authorityRefs: z.array(exactEntityReferenceSchema).optional(),
|
|
25
|
+
ruleRevision: z.number().int().positive(),
|
|
26
|
+
nodeRevision: z.number().int().positive(),
|
|
27
|
+
agentClass: z.string().regex(/^[a-z][a-z0-9-]*$/u).optional(),
|
|
28
|
+
status: z.enum(["proposed", "blocked", "ready", "assigned", "running", "completed", "failed", "cancelled", "stale"]),
|
|
29
|
+
estimate: estimateSchema.optional(),
|
|
30
|
+
requiredCapabilities: uniqueIds.optional(),
|
|
31
|
+
requestedPermissions: activityProfileSchema.shape.permissions.optional(),
|
|
32
|
+
workspace: z.enum(["read-only", "treedx", "git"]).optional(),
|
|
33
|
+
acceptanceCriteria: z.array(z.string().trim().min(1)).min(1).optional(),
|
|
34
|
+
maximumReviewCycles: z.number().int().positive().optional(),
|
|
35
|
+
condition: conditionDefinitionSchema.optional(),
|
|
36
|
+
graphRevisionCreated: z.number().int().positive(),
|
|
37
|
+
graphRevisionUpdated: z.number().int().positive()
|
|
38
|
+
}).strict().superRefine((node, context) => {
|
|
39
|
+
const assignable = ["agentClass", "estimate", "requiredCapabilities", "requestedPermissions", "workspace"];
|
|
40
|
+
if (node.kind === "condition") {
|
|
41
|
+
if (!node.condition) context.addIssue({ code: z.ZodIssueCode.custom, path: ["condition"], message: "Condition nodes require condition." });
|
|
42
|
+
for (const key of assignable) if (node[key] !== void 0) context.addIssue({ code: z.ZodIssueCode.custom, path: [key], message: `Condition nodes cannot define ${key}.` });
|
|
43
|
+
} else {
|
|
44
|
+
for (const key of assignable) if (node[key] === void 0) context.addIssue({ code: z.ZodIssueCode.custom, path: [key], message: `Assignable nodes require ${key}.` });
|
|
45
|
+
if (node.condition) context.addIssue({ code: z.ZodIssueCode.custom, path: ["condition"], message: "Assignable nodes cannot define condition." });
|
|
46
|
+
}
|
|
47
|
+
if (node.pairRole && !(node.workItemId && node.maximumReviewCycles)) context.addIssue({ code: z.ZodIssueCode.custom, message: "Actor and Reviewer nodes require workItemId and maximumReviewCycles." });
|
|
48
|
+
if (node.graphRevisionUpdated < node.graphRevisionCreated) context.addIssue({ code: z.ZodIssueCode.custom, path: ["graphRevisionUpdated"], message: "Updated revision cannot precede created revision." });
|
|
49
|
+
});
|
|
50
|
+
const executionEdgeSchema = z.object({
|
|
51
|
+
schemaVersion: z.literal("treeseed.execution-edge/v1"),
|
|
52
|
+
id: identifier,
|
|
53
|
+
teamId: identifier,
|
|
54
|
+
fromNodeId: identifier,
|
|
55
|
+
toNodeId: identifier,
|
|
56
|
+
provenance: z.enum(["profile-agent", "profile-event", "work-item", "review-pair", "governance"]),
|
|
57
|
+
sourceRef: exactEntityReferenceSchema.optional(),
|
|
58
|
+
graphRevisionCreated: z.number().int().positive(),
|
|
59
|
+
graphRevisionRemoved: z.number().int().positive().optional()
|
|
60
|
+
}).strict().refine((edge) => edge.fromNodeId !== edge.toNodeId, { message: "Execution edges cannot be self-referential." });
|
|
61
|
+
const graphChangeSetSchema = z.object({
|
|
62
|
+
added: uniqueIds,
|
|
63
|
+
changed: uniqueIds,
|
|
64
|
+
completed: uniqueIds,
|
|
65
|
+
blocked: uniqueIds,
|
|
66
|
+
stale: uniqueIds,
|
|
67
|
+
removedEdges: uniqueIds,
|
|
68
|
+
addedEdges: uniqueIds
|
|
69
|
+
}).strict();
|
|
70
|
+
const graphRevisionSchema = z.object({
|
|
71
|
+
schemaVersion: z.literal("treeseed.graph-revision/v1"),
|
|
72
|
+
teamId: identifier,
|
|
73
|
+
revision: z.number().int().positive(),
|
|
74
|
+
ruleRevision: z.number().int().positive(),
|
|
75
|
+
changedSourceRefs: z.array(exactEntityReferenceSchema).min(1),
|
|
76
|
+
graphDigest: z.string().regex(/^sha256:[a-f0-9]{64}$/u),
|
|
77
|
+
changes: graphChangeSetSchema,
|
|
78
|
+
createdAt: z.string().datetime({ offset: true })
|
|
79
|
+
}).strict();
|
|
80
|
+
function validateExecutionGraph(nodes, edges) {
|
|
81
|
+
const diagnostics = [];
|
|
82
|
+
const nodeIds = /* @__PURE__ */ new Set();
|
|
83
|
+
for (const [index, candidate] of nodes.entries()) {
|
|
84
|
+
const parsed = executionNodeSchema.safeParse(candidate);
|
|
85
|
+
if (!parsed.success) diagnostics.push(...parsed.error.issues.map((issue) => ({ code: `execution_node_${issue.code}`, path: `nodes.${index}.${issue.path.join(".")}`, message: issue.message })));
|
|
86
|
+
if (nodeIds.has(candidate.id)) diagnostics.push({ code: "execution_node_duplicate", path: `nodes.${index}.id`, message: `Node ${candidate.id} is duplicated.` });
|
|
87
|
+
nodeIds.add(candidate.id);
|
|
88
|
+
}
|
|
89
|
+
const activeEdges = edges.filter((edge) => edge.graphRevisionRemoved === void 0);
|
|
90
|
+
const edgeIds = /* @__PURE__ */ new Set();
|
|
91
|
+
for (const [index, candidate] of edges.entries()) {
|
|
92
|
+
const parsed = executionEdgeSchema.safeParse(candidate);
|
|
93
|
+
if (!parsed.success) diagnostics.push(...parsed.error.issues.map((issue) => ({ code: `execution_edge_${issue.code}`, path: `edges.${index}.${issue.path.join(".")}`, message: issue.message })));
|
|
94
|
+
if (!nodeIds.has(candidate.fromNodeId) || !nodeIds.has(candidate.toNodeId)) diagnostics.push({ code: "execution_edge_endpoint_missing", path: `edges.${index}`, message: "Both edge endpoints must exist." });
|
|
95
|
+
if (edgeIds.has(candidate.id)) diagnostics.push({ code: "execution_edge_duplicate", path: `edges.${index}.id`, message: `Edge ${candidate.id} is duplicated.` });
|
|
96
|
+
edgeIds.add(candidate.id);
|
|
97
|
+
}
|
|
98
|
+
const outgoing = new Map([...nodeIds].map((id) => [id, []]));
|
|
99
|
+
for (const edge of activeEdges) outgoing.get(edge.fromNodeId)?.push(edge.toNodeId);
|
|
100
|
+
const visiting = /* @__PURE__ */ new Set(), visited = /* @__PURE__ */ new Set();
|
|
101
|
+
const cyclic = (id) => {
|
|
102
|
+
if (visiting.has(id)) return true;
|
|
103
|
+
if (visited.has(id)) return false;
|
|
104
|
+
visiting.add(id);
|
|
105
|
+
if ((outgoing.get(id) ?? []).some(cyclic)) return true;
|
|
106
|
+
visiting.delete(id);
|
|
107
|
+
visited.add(id);
|
|
108
|
+
return false;
|
|
109
|
+
};
|
|
110
|
+
if ([...nodeIds].some(cyclic)) diagnostics.push({ code: "execution_graph_cycle", path: "edges", message: "Execution graph must be acyclic." });
|
|
111
|
+
return { ok: diagnostics.length === 0, diagnostics };
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
conditionDefinitionSchema,
|
|
115
|
+
executionEdgeSchema,
|
|
116
|
+
executionNodeSchema,
|
|
117
|
+
graphChangeSetSchema,
|
|
118
|
+
graphRevisionSchema,
|
|
119
|
+
validateExecutionGraph
|
|
120
|
+
};
|
|
@@ -146,18 +146,4 @@ export interface AssignmentPerformanceSummary {
|
|
|
146
146
|
};
|
|
147
147
|
downstreamOutcomes: AssignmentDownstreamOutcome[];
|
|
148
148
|
}
|
|
149
|
-
export interface WorkdayTimePolicy {
|
|
150
|
-
cooperativePlanningPercent: number;
|
|
151
|
-
governedExecutionPercent: number;
|
|
152
|
-
reservePercent: number;
|
|
153
|
-
}
|
|
154
|
-
export declare function validateWorkdayTimePolicy(policy: WorkdayTimePolicy): {
|
|
155
|
-
ok: boolean;
|
|
156
|
-
diagnostics: Array<{
|
|
157
|
-
code: string;
|
|
158
|
-
path: string;
|
|
159
|
-
message: string;
|
|
160
|
-
}>;
|
|
161
|
-
value?: WorkdayTimePolicy;
|
|
162
|
-
};
|
|
163
149
|
export declare function emptyCapacityBudget(deadline: string, requestedSeconds: number): CapacityBudgetV2;
|
|
@@ -38,12 +38,6 @@ const ASSIGNMENT_TERMINAL_DISPOSITIONS = [
|
|
|
38
38
|
"failed"
|
|
39
39
|
];
|
|
40
40
|
const ASSIGNMENT_PERFORMANCE_SCHEMA = "treeseed.assignment-performance/v2";
|
|
41
|
-
function validateWorkdayTimePolicy(policy) {
|
|
42
|
-
const values = [policy.cooperativePlanningPercent, policy.governedExecutionPercent, policy.reservePercent];
|
|
43
|
-
if (values.some((value) => !Number.isFinite(value) || value < 0 || value > 100)) return { ok: false, diagnostics: [{ code: "workday_time_percent_invalid", path: "timePolicy", message: "Workday time percentages must be finite values from 0 through 100." }] };
|
|
44
|
-
if (Math.abs(values.reduce((sum, value) => sum + value, 0) - 100) >= 1e-6) return { ok: false, diagnostics: [{ code: "workday_time_total_invalid", path: "timePolicy", message: "Workday time percentages must total exactly 100%." }] };
|
|
45
|
-
return { ok: true, diagnostics: [], value: policy };
|
|
46
|
-
}
|
|
47
41
|
function emptyCapacityBudget(deadline, requestedSeconds) {
|
|
48
42
|
return {
|
|
49
43
|
schemaVersion: CAPACITY_BUDGET_SCHEMA,
|
|
@@ -58,6 +52,5 @@ export {
|
|
|
58
52
|
ASSIGNMENT_TERMINAL_DISPOSITIONS,
|
|
59
53
|
CAPACITY_BUDGET_SCHEMA,
|
|
60
54
|
assignmentTimeWindow,
|
|
61
|
-
emptyCapacityBudget
|
|
62
|
-
validateWorkdayTimePolicy
|
|
55
|
+
emptyCapacityBudget
|
|
63
56
|
};
|
|
@@ -1,263 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { compileAgentAuthoritySnapshot } from "../authority/agent-authority-presets.js";
|
|
3
|
-
const PROFILE_KEYS = /* @__PURE__ */ new Set(["activityType", "enabled", "handler", "prompt", "branchPolicy", "contextQueryRefs", "contextQuerySetRefs", "instructionTemplateRefs", "permissions", "authorityPresets", "artifactTriggers", "closeoutPolicy", "providerOverrides", "tools", "signals", "outputs", "planningIntent", "questionPolicy", "execution"]);
|
|
4
|
-
const PROMPT_KEYS = /* @__PURE__ */ new Set(["system", "task", "templates"]);
|
|
5
|
-
const TOOL_KEYS = /* @__PURE__ */ new Set(["allowed", "denied"]);
|
|
6
|
-
const SIGNAL_KEYS = /* @__PURE__ */ new Set(["subscribesTo", "publishes"]);
|
|
7
|
-
const SUBSCRIPTION_KEYS = /* @__PURE__ */ new Set(["contract", "groupScope", "filters", "cardinality", "producerPolicy", "quorum"]);
|
|
8
|
-
const OUTPUT_KEYS = /* @__PURE__ */ new Set(["messageTypes", "modelMutations"]);
|
|
9
|
-
const EXECUTION_KEYS = /* @__PURE__ */ new Set(["requiredCapabilities", "maxRuntimeSeconds", "preparationSeconds", "closeoutSeconds", "closeoutWarningSeconds", "maxRetries", "verificationRequired", "maxTotalTokens", "warningTokens", "maxCostAmount", "costCurrency", "nativeLimits", "pricingGeneration", "enforcementConfidence", "allowedPaths", "forbiddenPaths"]);
|
|
10
|
-
const CONTENT_ACCESS_KEYS = /* @__PURE__ */ new Set(["content", "commit", "repository", "network", "shell"]);
|
|
11
|
-
const MODEL_PERMISSION_KEYS = /* @__PURE__ */ new Set(["operations", "filters"]);
|
|
12
|
-
const QUESTION_KEYS = /* @__PURE__ */ new Set(["defaultAnswerPolicy", "blockExecutionWhenCreated"]);
|
|
13
|
-
const PLANNING_INTENT_KEYS = /* @__PURE__ */ new Set(["objective", "proposalTypes", "artifactKind", "subjectModel", "subjectId", "includeWorkdayArtifacts", "stage", "stages", "requiresArtifactKinds"]);
|
|
14
|
-
const PLANNING_STAGE_KEYS = /* @__PURE__ */ new Set(["stage", "promptTask", "signals"]);
|
|
15
|
-
const QUESTION_POLICY_KEYS = /* @__PURE__ */ new Set(["kind", "teamId", "requiredRoles", "allowedRoles", "allowedAgentIds", "allowedAgentClasses", "allowedActivityProfiles", "teamMemberId", "projectId", "agentSlug"]);
|
|
16
|
-
const BRANCH_KEYS = {
|
|
17
|
-
"read-only": /* @__PURE__ */ new Set(["kind", "base"]),
|
|
18
|
-
"main-planning-content": /* @__PURE__ */ new Set(["kind", "base"]),
|
|
19
|
-
"staging-content": /* @__PURE__ */ new Set(["kind", "base"]),
|
|
20
|
-
"assignment-feature": /* @__PURE__ */ new Set(["kind", "base", "target", "prefix", "branchNameTemplate", "worktree", "updateBaseBeforeRun", "mergeTargetBeforeSave"]),
|
|
21
|
-
"staging-release": /* @__PURE__ */ new Set(["kind", "base", "target"])
|
|
22
|
-
};
|
|
23
|
-
function record(value) {
|
|
24
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
25
|
-
}
|
|
26
|
-
function strings(value) {
|
|
27
|
-
return Array.isArray(value) && value.every((entry) => typeof entry === "string" && entry.trim().length > 0) && new Set(value).size === value.length;
|
|
28
|
-
}
|
|
29
|
-
function exactRefs(value) {
|
|
30
|
-
return Array.isArray(value) && value.every((entry) => record(entry) && typeof entry.id === "string" && entry.id.trim() && Number.isInteger(entry.revision) && Number(entry.revision) > 0) && new Set(value.map((entry) => `${entry.id}@${entry.revision}`)).size === value.length;
|
|
31
|
-
}
|
|
32
|
-
function unknownKeys(value, allowed, path, add) {
|
|
33
|
-
for (const key of Object.keys(value)) if (!allowed.has(key)) add("agent_activity_unknown_field", `${path}.${key}`, `Unknown activity-profile field ${path}.${key}.`);
|
|
34
|
-
}
|
|
1
|
+
import { activityProfilesSchema, diagnosticsFromZod } from "./agent-definition-schema.js";
|
|
35
2
|
function validateAgentActivityProfilesConfiguration(value) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
if (!record(value)) return { ok: false, diagnostics: [{ code: "agent_activity_profiles_invalid", path: "activityProfiles", message: "activityProfiles must be an object." }] };
|
|
39
|
-
let enabled = 0;
|
|
40
|
-
for (const [activity, raw] of Object.entries(value)) {
|
|
41
|
-
const path = `activityProfiles.${activity}`;
|
|
42
|
-
if (!AGENT_ACTIVITY_TYPES.includes(activity)) {
|
|
43
|
-
add("agent_activity_type_invalid", path, `Unsupported activity type ${activity}.`);
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
if (!record(raw)) {
|
|
47
|
-
add("agent_activity_profile_invalid", path, `${path} must be an object.`);
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
unknownKeys(raw, PROFILE_KEYS, path, add);
|
|
51
|
-
if (raw.activityType !== void 0 && raw.activityType !== activity) add("agent_activity_type_mismatch", `${path}.activityType`, "activityType must match its activityProfiles key.");
|
|
52
|
-
if (typeof raw.enabled !== "boolean") add("agent_activity_enabled_invalid", `${path}.enabled`, "enabled must be boolean.");
|
|
53
|
-
else if (raw.enabled) enabled += 1;
|
|
54
|
-
if (typeof raw.handler !== "string" || !AGENT_HANDLER_KINDS.includes(raw.handler)) add("agent_activity_handler_invalid", `${path}.handler`, "handler must name a supported built-in handler.");
|
|
55
|
-
if (!record(raw.prompt)) add("agent_activity_prompt_invalid", `${path}.prompt`, "prompt must be an object.");
|
|
56
|
-
else {
|
|
57
|
-
unknownKeys(raw.prompt, PROMPT_KEYS, `${path}.prompt`, add);
|
|
58
|
-
if (typeof raw.prompt.system !== "string" || !raw.prompt.system.trim()) add("agent_activity_system_prompt_required", `${path}.prompt.system`, "prompt.system is required.");
|
|
59
|
-
if (raw.prompt.task !== void 0 && typeof raw.prompt.task !== "string") add("agent_activity_task_prompt_invalid", `${path}.prompt.task`, "prompt.task must be a string.");
|
|
60
|
-
if (raw.prompt.templates !== void 0 && (!record(raw.prompt.templates) || Object.values(raw.prompt.templates).some((entry) => typeof entry !== "string"))) add("agent_activity_templates_invalid", `${path}.prompt.templates`, "prompt.templates must map names to strings.");
|
|
61
|
-
}
|
|
62
|
-
validateBranch(raw.branchPolicy, `${path}.branchPolicy`, add);
|
|
63
|
-
validateStringLists(raw.tools, TOOL_KEYS, ["allowed"], `${path}.tools`, add);
|
|
64
|
-
validateSignals(raw.signals, `${path}.signals`, add);
|
|
65
|
-
validateStringLists(raw.outputs, OUTPUT_KEYS, ["messageTypes", "modelMutations"], `${path}.outputs`, add);
|
|
66
|
-
validatePlanningIntent(raw.planningIntent, `${path}.planningIntent`, add);
|
|
67
|
-
validateContentAccess(raw.permissions, `${path}.permissions`, add);
|
|
68
|
-
if (raw.authorityPresets !== void 0 && (!strings(raw.authorityPresets) || raw.authorityPresets.some((preset) => !["messaging", "direction", "influence", "estimation", "plan-contribution", "source-execution", "review-authority", "reporting"].includes(preset)))) add("agent_activity_authority_presets_invalid", `${path}.authorityPresets`, "authorityPresets must contain supported unique preset ids.");
|
|
69
|
-
for (const key of ["contextQueryRefs", "contextQuerySetRefs", "instructionTemplateRefs"]) if (raw[key] !== void 0 && !exactRefs(raw[key])) add("agent_activity_revision_refs_invalid", `${path}.${key}`, `${path}.${key} must contain unique exact id and revision references.`);
|
|
70
|
-
validateArtifactTriggers(raw.artifactTriggers, `${path}.artifactTriggers`, add);
|
|
71
|
-
validateCloseoutPolicy(raw.closeoutPolicy, `${path}.closeoutPolicy`, add);
|
|
72
|
-
validateProviderOverrides(raw.providerOverrides, `${path}.providerOverrides`, add);
|
|
73
|
-
validateQuestionPolicy(raw.questionPolicy, `${path}.questionPolicy`, add);
|
|
74
|
-
validateExecution(raw.execution, `${path}.execution`, add);
|
|
75
|
-
if (typeof raw.enabled === "boolean" && typeof raw.handler === "string" && record(raw.tools) && record(raw.outputs) && record(raw.branchPolicy)) {
|
|
76
|
-
for (const message of compileAgentAuthoritySnapshot(activity, raw).diagnostics) {
|
|
77
|
-
add("agent_activity_authority_widening_forbidden", path, message);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (enabled === 0) add("agent_activity_profile_enabled_required", "activityProfiles", "At least one activity profile must be enabled.");
|
|
82
|
-
return { ok: diagnostics.length === 0, diagnostics };
|
|
83
|
-
}
|
|
84
|
-
function validateSignals(value, path, add) {
|
|
85
|
-
if (value === void 0) return;
|
|
86
|
-
if (!record(value)) {
|
|
87
|
-
add("agent_activity_signals_invalid", path, "signals must be an object.");
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
unknownKeys(value, SIGNAL_KEYS, path, add);
|
|
91
|
-
if (value.publishes !== void 0 && !strings(value.publishes)) add("agent_activity_signal_publications_invalid", `${path}.publishes`, "publishes must contain unique signal contract IDs.");
|
|
92
|
-
if (value.subscribesTo === void 0) return;
|
|
93
|
-
if (!Array.isArray(value.subscribesTo)) {
|
|
94
|
-
add("agent_activity_signal_subscriptions_invalid", `${path}.subscribesTo`, "subscribesTo must be an array.");
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
value.subscribesTo.forEach((candidate, index) => {
|
|
98
|
-
const itemPath = `${path}.subscribesTo[${index}]`;
|
|
99
|
-
if (!record(candidate)) {
|
|
100
|
-
add("agent_activity_signal_subscription_invalid", itemPath, "Signal subscription must be an object.");
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
unknownKeys(candidate, SUBSCRIPTION_KEYS, itemPath, add);
|
|
104
|
-
if (typeof candidate.contract !== "string" || !candidate.contract.trim()) add("agent_activity_signal_contract_required", `${itemPath}.contract`, "Signal subscription contract is required.");
|
|
105
|
-
if (candidate.filters !== void 0 && !record(candidate.filters)) add("agent_activity_signal_filters_invalid", `${itemPath}.filters`, "Signal filters must be an object.");
|
|
106
|
-
if (candidate.groupScope !== void 0) validateGroupScope(candidate.groupScope, `${itemPath}.groupScope`, add);
|
|
107
|
-
if (candidate.cardinality !== void 0 && !["single", "each"].includes(String(candidate.cardinality))) add("agent_activity_signal_cardinality_invalid", `${itemPath}.cardinality`, "cardinality must be single or each.");
|
|
108
|
-
if (candidate.producerPolicy !== void 0 && !["any", "all", "quorum"].includes(String(candidate.producerPolicy))) add("agent_activity_producer_policy_invalid", `${itemPath}.producerPolicy`, "producerPolicy must be any, all, or quorum.");
|
|
109
|
-
if (candidate.producerPolicy === "quorum" && (!Number.isInteger(candidate.quorum) || Number(candidate.quorum) < 1)) add("agent_activity_signal_quorum_invalid", `${itemPath}.quorum`, "quorum must be a positive integer.");
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function validateGroupScope(value, path, add) {
|
|
113
|
-
if (!record(value) || !["member-groups", "specific-groups", "project"].includes(String(value.mode))) {
|
|
114
|
-
add("agent_activity_group_scope_invalid", path, "groupScope.mode must be member-groups, specific-groups, or project.");
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (value.mode === "project" && (typeof value.projectId !== "string" || !value.projectId.trim())) add("agent_activity_group_scope_project_required", `${path}.projectId`, "Project-scoped subscriptions require projectId.");
|
|
118
|
-
if (value.mode === "specific-groups" && (!Array.isArray(value.groupRefs) || value.groupRefs.length === 0 || value.groupRefs.some((candidate) => !record(candidate) || typeof candidate.projectId !== "string" || typeof candidate.groupId !== "string"))) add("agent_activity_group_scope_refs_required", `${path}.groupRefs`, "Specific group scopes require projectId and groupId references.");
|
|
119
|
-
}
|
|
120
|
-
function validatePlanningIntent(value, path, add) {
|
|
121
|
-
if (value === void 0) return;
|
|
122
|
-
if (!record(value)) {
|
|
123
|
-
add("agent_activity_planning_intent_invalid", path, "planningIntent must be an object.");
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
unknownKeys(value, PLANNING_INTENT_KEYS, path, add);
|
|
127
|
-
for (const key of ["objective", "artifactKind", "subjectModel"]) {
|
|
128
|
-
if (value[key] !== void 0 && (typeof value[key] !== "string" || !value[key].trim())) add("agent_activity_planning_intent_text_invalid", `${path}.${key}`, `${path}.${key} must be a non-empty string.`);
|
|
129
|
-
}
|
|
130
|
-
if (value.subjectId !== void 0 && value.subjectId !== null && (typeof value.subjectId !== "string" || !value.subjectId.trim())) add("agent_activity_planning_intent_text_invalid", `${path}.subjectId`, `${path}.subjectId must be a non-empty string or null.`);
|
|
131
|
-
if (value.includeWorkdayArtifacts !== void 0 && typeof value.includeWorkdayArtifacts !== "boolean") add("agent_activity_planning_intent_boolean_invalid", `${path}.includeWorkdayArtifacts`, `${path}.includeWorkdayArtifacts must be boolean.`);
|
|
132
|
-
const stages = ["discovery", "synthesis", "deliberation", "evaluation", "revision", "closeout"];
|
|
133
|
-
if (value.stage !== void 0 && !stages.includes(String(value.stage))) add("agent_activity_planning_stage_invalid", `${path}.stage`, `${path}.stage is unsupported.`);
|
|
134
|
-
if (value.stages !== void 0) {
|
|
135
|
-
if (!Array.isArray(value.stages) || value.stages.length === 0) add("agent_activity_planning_stages_invalid", `${path}.stages`, "stages must be a non-empty array.");
|
|
136
|
-
else value.stages.forEach((candidate, index) => {
|
|
137
|
-
const stagePath = `${path}.stages[${index}]`;
|
|
138
|
-
if (!record(candidate)) {
|
|
139
|
-
add("agent_activity_planning_stage_invalid", stagePath, "Planning stage must be an object.");
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
unknownKeys(candidate, PLANNING_STAGE_KEYS, stagePath, add);
|
|
143
|
-
if (!stages.includes(String(candidate.stage))) add("agent_activity_planning_stage_invalid", `${stagePath}.stage`, "Planning stage is unsupported.");
|
|
144
|
-
if (candidate.promptTask !== void 0 && (typeof candidate.promptTask !== "string" || !candidate.promptTask.trim())) add("agent_activity_planning_stage_prompt_invalid", `${stagePath}.promptTask`, "promptTask must be non-empty.");
|
|
145
|
-
validateSignals(candidate.signals, `${stagePath}.signals`, add);
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
if (value.requiresArtifactKinds !== void 0 && !strings(value.requiresArtifactKinds)) add("agent_activity_string_list_invalid", `${path}.requiresArtifactKinds`, `${path}.requiresArtifactKinds must contain unique non-empty strings.`);
|
|
149
|
-
if (value.proposalTypes !== void 0 && !strings(value.proposalTypes)) add("agent_activity_string_list_invalid", `${path}.proposalTypes`, `${path}.proposalTypes must contain unique non-empty strings.`);
|
|
150
|
-
}
|
|
151
|
-
function validateStringLists(value, keys, required, path, add) {
|
|
152
|
-
if (!record(value)) {
|
|
153
|
-
add("agent_activity_policy_invalid", path, `${path} must be an object.`);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
unknownKeys(value, keys, path, add);
|
|
157
|
-
for (const key of required) if (!strings(value[key])) add("agent_activity_string_list_invalid", `${path}.${key}`, `${path}.${key} must contain unique non-empty strings.`);
|
|
158
|
-
for (const key of keys) if (!["producerPolicy", "fanout"].includes(key) && value[key] !== void 0 && !strings(value[key])) add("agent_activity_string_list_invalid", `${path}.${key}`, `${path}.${key} must contain unique non-empty strings.`);
|
|
159
|
-
}
|
|
160
|
-
function validateBranch(value, path, add) {
|
|
161
|
-
if (!record(value) || typeof value.kind !== "string" || !BRANCH_KEYS[value.kind]) {
|
|
162
|
-
add("agent_activity_branch_policy_invalid", path, "branchPolicy.kind is invalid.");
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
unknownKeys(value, BRANCH_KEYS[value.kind], path, add);
|
|
166
|
-
const expected = value.kind === "read-only" ? ["main", "staging"] : value.kind === "main-planning-content" ? ["main"] : ["staging"];
|
|
167
|
-
if (!expected.includes(String(value.base))) add("agent_activity_branch_base_invalid", `${path}.base`, `branchPolicy.base must be ${expected.join(" or ")}.`);
|
|
168
|
-
if (value.kind === "assignment-feature" && value.target !== "staging") add("agent_activity_branch_target_invalid", `${path}.target`, "assignment-feature target must be staging.");
|
|
169
|
-
if (value.kind === "staging-release" && value.target !== "main") add("agent_activity_branch_target_invalid", `${path}.target`, "staging-release target must be main.");
|
|
170
|
-
}
|
|
171
|
-
function validateContentAccess(value, path, add) {
|
|
172
|
-
if (value === void 0) return;
|
|
173
|
-
if (!record(value)) {
|
|
174
|
-
add("agent_activity_permissions_invalid", path, "permissions must be an object.");
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
unknownKeys(value, CONTENT_ACCESS_KEYS, path, add);
|
|
178
|
-
if (value.content !== void 0) {
|
|
179
|
-
if (!record(value.content)) add("agent_activity_content_matrix_invalid", `${path}.content`, "content permissions must map model names to operation/filter policies.");
|
|
180
|
-
else for (const [model, permission] of Object.entries(value.content)) {
|
|
181
|
-
const modelPath = `${path}.content.${model}`;
|
|
182
|
-
if (!model.trim() || !record(permission)) {
|
|
183
|
-
add("agent_activity_model_permission_invalid", modelPath, "Each model permission must be an object.");
|
|
184
|
-
continue;
|
|
185
|
-
}
|
|
186
|
-
unknownKeys(permission, MODEL_PERMISSION_KEYS, modelPath, add);
|
|
187
|
-
if (!strings(permission.operations) || permission.operations.length === 0) add("agent_activity_model_operations_invalid", `${modelPath}.operations`, "Model operations must contain unique non-empty values.");
|
|
188
|
-
if (permission.filters !== void 0 && !record(permission.filters)) add("agent_activity_model_filters_invalid", `${modelPath}.filters`, "Model filters must be an object.");
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (value.commit !== void 0 && (!record(value.commit) || typeof value.commit.allowed !== "boolean" || Object.keys(value.commit).some((key) => key !== "allowed"))) add("agent_activity_commit_policy_invalid", `${path}.commit`, "commit must contain only a boolean allowed field.");
|
|
192
|
-
for (const key of ["repository", "network", "shell"]) if (value[key] !== void 0 && !record(value[key])) add("agent_activity_permissions_invalid", `${path}.${key}`, `${key} permissions must be an object.`);
|
|
193
|
-
}
|
|
194
|
-
function validateArtifactTriggers(value, path, add) {
|
|
195
|
-
if (value === void 0) return;
|
|
196
|
-
if (!Array.isArray(value)) {
|
|
197
|
-
add("agent_activity_artifact_triggers_invalid", path, "artifactTriggers must be an array.");
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
value.forEach((candidate, index) => {
|
|
201
|
-
const itemPath = `${path}[${index}]`;
|
|
202
|
-
if (!record(candidate)) {
|
|
203
|
-
add("agent_activity_artifact_trigger_invalid", itemPath, "Artifact trigger must be an object.");
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
unknownKeys(candidate, /* @__PURE__ */ new Set(["event", "artifactKind", "model", "required"]), itemPath, add);
|
|
207
|
-
for (const key of ["event", "artifactKind"]) if (typeof candidate[key] !== "string" || !candidate[key].trim()) add("agent_activity_artifact_trigger_invalid", `${itemPath}.${key}`, `${key} is required.`);
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function validateCloseoutPolicy(value, path, add) {
|
|
211
|
-
if (value === void 0) return;
|
|
212
|
-
if (!record(value)) {
|
|
213
|
-
add("agent_activity_closeout_policy_invalid", path, "closeoutPolicy must be an object.");
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
unknownKeys(value, /* @__PURE__ */ new Set(["warningSeconds", "summaryRequired", "requiredArtifactKinds", "blockOnOpenQuestions"]), path, add);
|
|
217
|
-
if (value.warningSeconds !== void 0 && (!Number.isInteger(value.warningSeconds) || Number(value.warningSeconds) < 1)) add("agent_activity_closeout_warning_invalid", `${path}.warningSeconds`, "warningSeconds must be positive.");
|
|
218
|
-
if (value.requiredArtifactKinds !== void 0 && !strings(value.requiredArtifactKinds)) add("agent_activity_string_list_invalid", `${path}.requiredArtifactKinds`, "requiredArtifactKinds must contain unique non-empty strings.");
|
|
219
|
-
}
|
|
220
|
-
function validateProviderOverrides(value, path, add) {
|
|
221
|
-
if (value === void 0) return;
|
|
222
|
-
if (!record(value)) {
|
|
223
|
-
add("agent_activity_provider_overrides_invalid", path, "providerOverrides must be an object.");
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
unknownKeys(value, /* @__PURE__ */ new Set(["requiredCapabilities", "disallowedProviderIds", "promptRef", "instructionTemplateRefs", "maxRuntimeSeconds", "maxTotalTokens", "maxCostAmount"]), path, add);
|
|
227
|
-
for (const key of ["requiredCapabilities", "disallowedProviderIds"]) if (value[key] !== void 0 && !strings(value[key])) add("agent_activity_string_list_invalid", `${path}.${key}`, `${key} must contain unique non-empty strings.`);
|
|
228
|
-
if (value.instructionTemplateRefs !== void 0 && !exactRefs(value.instructionTemplateRefs)) add("agent_activity_revision_refs_invalid", `${path}.instructionTemplateRefs`, "instructionTemplateRefs must contain unique exact id and revision references.");
|
|
229
|
-
if (value.promptRef !== void 0 && (typeof value.promptRef !== "string" || !value.promptRef.trim())) add("agent_activity_provider_prompt_invalid", `${path}.promptRef`, "promptRef must be non-empty.");
|
|
230
|
-
}
|
|
231
|
-
function validateQuestionPolicy(value, path, add) {
|
|
232
|
-
if (value === void 0) return;
|
|
233
|
-
if (!record(value)) {
|
|
234
|
-
add("agent_activity_question_policy_invalid", path, "questionPolicy must be an object.");
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
unknownKeys(value, QUESTION_KEYS, path, add);
|
|
238
|
-
if (value.blockExecutionWhenCreated !== void 0 && typeof value.blockExecutionWhenCreated !== "boolean") add("agent_activity_question_block_invalid", `${path}.blockExecutionWhenCreated`, "blockExecutionWhenCreated must be boolean.");
|
|
239
|
-
if (value.defaultAnswerPolicy !== void 0) {
|
|
240
|
-
if (!record(value.defaultAnswerPolicy)) add("agent_activity_answer_policy_invalid", `${path}.defaultAnswerPolicy`, "defaultAnswerPolicy must be an object.");
|
|
241
|
-
else {
|
|
242
|
-
unknownKeys(value.defaultAnswerPolicy, QUESTION_POLICY_KEYS, `${path}.defaultAnswerPolicy`, add);
|
|
243
|
-
if (!["team-human", "human-or-agent", "specific-human", "specific-agent"].includes(String(value.defaultAnswerPolicy.kind))) add("agent_activity_answer_policy_kind_invalid", `${path}.defaultAnswerPolicy.kind`, "Unknown answer policy kind.");
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
function validateExecution(value, path, add) {
|
|
248
|
-
if (value === void 0) return;
|
|
249
|
-
if (!record(value)) {
|
|
250
|
-
add("agent_activity_execution_invalid", path, "execution must be an object.");
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
unknownKeys(value, EXECUTION_KEYS, path, add);
|
|
254
|
-
for (const key of ["requiredCapabilities", "allowedPaths", "forbiddenPaths"]) if (value[key] !== void 0 && !strings(value[key])) add("agent_activity_string_list_invalid", `${path}.${key}`, `${path}.${key} must contain unique non-empty strings.`);
|
|
255
|
-
if (value.maxRuntimeSeconds !== void 0 && (!Number.isInteger(value.maxRuntimeSeconds) || Number(value.maxRuntimeSeconds) < 1)) add("agent_activity_runtime_invalid", `${path}.maxRuntimeSeconds`, "maxRuntimeSeconds must be a positive integer.");
|
|
256
|
-
if (value.closeoutWarningSeconds !== void 0 && (!Number.isInteger(value.closeoutWarningSeconds) || Number(value.closeoutWarningSeconds) < 1)) add("agent_activity_closeout_warning_invalid", `${path}.closeoutWarningSeconds`, "closeoutWarningSeconds must be a positive integer.");
|
|
257
|
-
if (value.preparationSeconds !== void 0 && (!Number.isInteger(value.preparationSeconds) || Number(value.preparationSeconds) < 1)) add("agent_activity_preparation_duration_invalid", `${path}.preparationSeconds`, "preparationSeconds must be a positive integer.");
|
|
258
|
-
if (value.closeoutSeconds !== void 0 && (!Number.isInteger(value.closeoutSeconds) || Number(value.closeoutSeconds) < 1)) add("agent_activity_closeout_duration_invalid", `${path}.closeoutSeconds`, "closeoutSeconds must be a positive integer.");
|
|
259
|
-
if (value.maxRetries !== void 0 && (!Number.isInteger(value.maxRetries) || Number(value.maxRetries) < 0)) add("agent_activity_retries_invalid", `${path}.maxRetries`, "maxRetries must be a non-negative integer.");
|
|
260
|
-
if (value.verificationRequired !== void 0 && typeof value.verificationRequired !== "boolean") add("agent_activity_verification_invalid", `${path}.verificationRequired`, "verificationRequired must be boolean.");
|
|
3
|
+
const parsed = activityProfilesSchema.safeParse(value);
|
|
4
|
+
return parsed.success ? { ok: true, diagnostics: [] } : { ok: false, diagnostics: diagnosticsFromZod(parsed.error, "activityProfiles") };
|
|
261
5
|
}
|
|
262
6
|
export {
|
|
263
7
|
validateAgentActivityProfilesConfiguration
|