@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,176 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { activityProfileSchema } from "../../../validation/agent-definition-schema.js";
|
|
3
|
+
const identifier = z.string().trim().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u);
|
|
4
|
+
const timestamp = z.string().datetime({ offset: true });
|
|
5
|
+
const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/u);
|
|
6
|
+
const commit = z.string().regex(/^[a-f0-9]{40}$/u);
|
|
7
|
+
const uniqueStrings = z.array(z.string().min(1)).superRefine((items, context) => {
|
|
8
|
+
if (new Set(items).size !== items.length) context.addIssue({ code: z.ZodIssueCode.custom, message: "Values must be unique." });
|
|
9
|
+
});
|
|
10
|
+
const exactEntityReferenceSchema = z.object({
|
|
11
|
+
store: z.enum(["treedx", "postgresql", "git", "url"]),
|
|
12
|
+
model: z.string().min(1),
|
|
13
|
+
id: identifier,
|
|
14
|
+
revision: z.number().int().positive().optional(),
|
|
15
|
+
digest: digest.optional(),
|
|
16
|
+
repository: z.string().min(1).optional(),
|
|
17
|
+
commit: commit.optional(),
|
|
18
|
+
path: z.string().min(1).optional(),
|
|
19
|
+
anchor: z.string().min(1).optional(),
|
|
20
|
+
startLine: z.number().int().positive().optional(),
|
|
21
|
+
endLine: z.number().int().positive().optional(),
|
|
22
|
+
url: z.string().url().optional()
|
|
23
|
+
}).strict().superRefine((reference, context) => {
|
|
24
|
+
if (reference.endLine && !reference.startLine) context.addIssue({ code: z.ZodIssueCode.custom, path: ["startLine"], message: "startLine is required with endLine." });
|
|
25
|
+
if (reference.store === "treedx" && !(reference.commit || reference.revision && reference.digest)) context.addIssue({ code: z.ZodIssueCode.custom, message: "TreeDX references require commit or revision and digest." });
|
|
26
|
+
if (reference.store === "git" && !(reference.repository && reference.commit)) context.addIssue({ code: z.ZodIssueCode.custom, message: "Git references require repository and commit." });
|
|
27
|
+
if (reference.store === "url" && !reference.url) context.addIssue({ code: z.ZodIssueCode.custom, message: "URL references require url." });
|
|
28
|
+
});
|
|
29
|
+
const assignmentReferenceSchema = z.discriminatedUnion("kind", [
|
|
30
|
+
z.object({ kind: z.literal("git"), repository: z.string().min(1), commit, branch: z.string().min(1).optional(), path: z.string().min(1).optional() }).strict(),
|
|
31
|
+
z.object({ kind: z.literal("treedx"), projectId: identifier, repository: z.string().min(1), commit, path: z.string().min(1), workspaceId: identifier.optional() }).strict(),
|
|
32
|
+
z.object({ kind: z.literal("url"), url: z.string().url(), digest: digest.optional() }).strict()
|
|
33
|
+
]);
|
|
34
|
+
const exactGrantSchema = z.object({
|
|
35
|
+
contentRead: z.array(exactEntityReferenceSchema),
|
|
36
|
+
contentWrite: z.array(exactEntityReferenceSchema),
|
|
37
|
+
sourceRead: uniqueStrings,
|
|
38
|
+
sourceWrite: uniqueStrings,
|
|
39
|
+
tools: uniqueStrings
|
|
40
|
+
}).strict();
|
|
41
|
+
const assignmentWorkspaceSchema = z.discriminatedUnion("mode", [
|
|
42
|
+
z.object({ mode: z.literal("read-only") }).strict(),
|
|
43
|
+
z.object({ mode: z.literal("treedx"), workspaceId: identifier, repository: z.string().min(1), baseCommit: commit, writablePaths: uniqueStrings.refine((paths) => paths.length > 0) }).strict(),
|
|
44
|
+
z.object({ mode: z.literal("git"), repository: z.string().min(1), baseCommit: commit, branch: z.string().min(1), writablePaths: uniqueStrings.refine((paths) => paths.length > 0) }).strict()
|
|
45
|
+
]);
|
|
46
|
+
const estimateSchema = z.object({
|
|
47
|
+
minimumSeconds: z.number().int().positive(),
|
|
48
|
+
expectedSeconds: z.number().int().positive(),
|
|
49
|
+
maximumSeconds: z.number().int().positive(),
|
|
50
|
+
rationale: z.string().optional()
|
|
51
|
+
}).strict().refine((value) => value.minimumSeconds <= value.expectedSeconds && value.expectedSeconds <= value.maximumSeconds, {
|
|
52
|
+
message: "Estimate must satisfy minimumSeconds <= expectedSeconds <= maximumSeconds."
|
|
53
|
+
});
|
|
54
|
+
const effectiveActivityProfileSchema = activityProfileSchema.omit({ dependsOn: true }).extend({
|
|
55
|
+
profileRef: exactEntityReferenceSchema,
|
|
56
|
+
activity: z.enum(["planning", "estimating", "acting", "reviewing", "reporting", "chat"]),
|
|
57
|
+
handlerOrigin: z.enum(["agent-package", "project-runtime"]),
|
|
58
|
+
permissionCeiling: activityProfileSchema.shape.permissions
|
|
59
|
+
}).omit({ permissions: true }).strict();
|
|
60
|
+
const providerSelectionSchema = z.object({
|
|
61
|
+
providerId: identifier,
|
|
62
|
+
offerId: identifier,
|
|
63
|
+
executionProviderId: identifier,
|
|
64
|
+
modelConfigurationId: identifier,
|
|
65
|
+
executionCapabilityId: identifier,
|
|
66
|
+
offerRevision: z.number().int().positive(),
|
|
67
|
+
runtimeBuild: digest
|
|
68
|
+
}).strict();
|
|
69
|
+
const limitsSchema = z.object({
|
|
70
|
+
maximumSeconds: z.number().int().positive(),
|
|
71
|
+
maximumContextBytes: z.number().int().positive(),
|
|
72
|
+
maximumContextTokens: z.number().int().positive().optional(),
|
|
73
|
+
maximumContextItems: z.number().int().positive()
|
|
74
|
+
}).strict();
|
|
75
|
+
const assignmentAttemptSchema = z.object({
|
|
76
|
+
schemaVersion: z.literal("treeseed.assignment-attempt/v1"),
|
|
77
|
+
id: identifier,
|
|
78
|
+
idempotencyKey: identifier,
|
|
79
|
+
teamId: identifier,
|
|
80
|
+
projectId: identifier,
|
|
81
|
+
workdayId: identifier,
|
|
82
|
+
nodeId: identifier,
|
|
83
|
+
workItemId: identifier.optional(),
|
|
84
|
+
nodeRevision: z.number().int().positive(),
|
|
85
|
+
graphRevision: z.number().int().positive(),
|
|
86
|
+
sourceRef: exactEntityReferenceSchema,
|
|
87
|
+
authorityRefs: z.array(exactEntityReferenceSchema).min(1),
|
|
88
|
+
effectiveProfile: effectiveActivityProfileSchema,
|
|
89
|
+
requiredCapabilities: uniqueStrings,
|
|
90
|
+
grant: exactGrantSchema,
|
|
91
|
+
provider: providerSelectionSchema,
|
|
92
|
+
contextRefs: z.array(exactEntityReferenceSchema),
|
|
93
|
+
predecessorResultIds: uniqueStrings,
|
|
94
|
+
acceptanceCriteria: z.array(z.string().trim().min(1)).min(1).optional(),
|
|
95
|
+
workspace: assignmentWorkspaceSchema,
|
|
96
|
+
estimate: estimateSchema,
|
|
97
|
+
limits: limitsSchema,
|
|
98
|
+
deadline: timestamp,
|
|
99
|
+
leaseId: identifier,
|
|
100
|
+
reservationId: identifier,
|
|
101
|
+
attempt: z.number().int().positive(),
|
|
102
|
+
status: z.enum(["created", "leased", "running", "completed", "blocked", "failed", "cancelled", "expired"]),
|
|
103
|
+
createdAt: timestamp,
|
|
104
|
+
startedAt: timestamp.optional(),
|
|
105
|
+
finishedAt: timestamp.optional()
|
|
106
|
+
}).strict();
|
|
107
|
+
const verificationRecordSchema = z.object({
|
|
108
|
+
command: z.string().min(1),
|
|
109
|
+
status: z.enum(["passed", "failed", "skipped"]),
|
|
110
|
+
exitCode: z.number().int(),
|
|
111
|
+
outputDigest: digest,
|
|
112
|
+
durationSeconds: z.number().int().nonnegative().optional()
|
|
113
|
+
}).strict();
|
|
114
|
+
const usageSchema = z.object({
|
|
115
|
+
elapsedSeconds: z.number().int().nonnegative(),
|
|
116
|
+
modelInputTokens: z.number().int().nonnegative().optional(),
|
|
117
|
+
modelOutputTokens: z.number().int().nonnegative().optional(),
|
|
118
|
+
native: z.record(z.number().nonnegative()).optional()
|
|
119
|
+
}).strict();
|
|
120
|
+
const diagnosticSchema = z.object({
|
|
121
|
+
code: identifier,
|
|
122
|
+
severity: z.enum(["info", "warning", "error"]),
|
|
123
|
+
message: z.string().min(1),
|
|
124
|
+
ref: exactEntityReferenceSchema.optional()
|
|
125
|
+
}).strict();
|
|
126
|
+
const assignmentTimingAwarenessReceiptSchema = z.object({
|
|
127
|
+
schemaVersion: z.literal("treeseed.assignment-timing-awareness/v1"),
|
|
128
|
+
requiredChecks: z.literal(2),
|
|
129
|
+
completedChecks: z.number().int().min(2),
|
|
130
|
+
firstTool: z.literal("treedx:treeseed_time_status"),
|
|
131
|
+
firstToolSucceeded: z.literal(true),
|
|
132
|
+
lastTool: z.literal("treedx:treeseed_time_status"),
|
|
133
|
+
lastToolSucceeded: z.literal(true),
|
|
134
|
+
firstToolCompliant: z.literal(true),
|
|
135
|
+
finalToolCompliant: z.literal(true)
|
|
136
|
+
}).strict();
|
|
137
|
+
const assignmentResultSchema = z.object({
|
|
138
|
+
schemaVersion: z.literal("treeseed.assignment-result/v1"),
|
|
139
|
+
id: identifier,
|
|
140
|
+
assignmentId: identifier,
|
|
141
|
+
status: z.enum(["completed", "blocked", "failed"]),
|
|
142
|
+
summary: z.string().min(1),
|
|
143
|
+
references: z.array(assignmentReferenceSchema),
|
|
144
|
+
verification: z.array(verificationRecordSchema),
|
|
145
|
+
usage: usageSchema,
|
|
146
|
+
diagnostics: z.array(diagnosticSchema),
|
|
147
|
+
timingAwareness: assignmentTimingAwarenessReceiptSchema.optional(),
|
|
148
|
+
completedAt: timestamp
|
|
149
|
+
}).strict();
|
|
150
|
+
const authorizedContextItemSchema = z.object({
|
|
151
|
+
ref: exactEntityReferenceSchema,
|
|
152
|
+
mediaType: z.string().min(1),
|
|
153
|
+
digest,
|
|
154
|
+
value: z.any()
|
|
155
|
+
}).strict();
|
|
156
|
+
const assignmentContextSchema = z.object({
|
|
157
|
+
assignment: assignmentAttemptSchema,
|
|
158
|
+
context: z.array(authorizedContextItemSchema),
|
|
159
|
+
predecessorResults: z.array(assignmentResultSchema)
|
|
160
|
+
}).strict();
|
|
161
|
+
export {
|
|
162
|
+
assignmentAttemptSchema,
|
|
163
|
+
assignmentContextSchema,
|
|
164
|
+
assignmentReferenceSchema,
|
|
165
|
+
assignmentResultSchema,
|
|
166
|
+
assignmentTimingAwarenessReceiptSchema,
|
|
167
|
+
assignmentWorkspaceSchema,
|
|
168
|
+
authorizedContextItemSchema,
|
|
169
|
+
diagnosticSchema,
|
|
170
|
+
effectiveActivityProfileSchema,
|
|
171
|
+
estimateSchema,
|
|
172
|
+
exactEntityReferenceSchema,
|
|
173
|
+
exactGrantSchema,
|
|
174
|
+
usageSchema,
|
|
175
|
+
verificationRecordSchema
|
|
176
|
+
};
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const contextSourceSelectorSchema: z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
|
|
3
|
+
scope: z.ZodLiteral<"current-project">;
|
|
4
|
+
}, "strict", z.ZodTypeAny, {
|
|
5
|
+
scope: "current-project";
|
|
6
|
+
}, {
|
|
7
|
+
scope: "current-project";
|
|
8
|
+
}>, z.ZodObject<{
|
|
9
|
+
scope: z.ZodLiteral<"team-library">;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
scope: "team-library";
|
|
12
|
+
}, {
|
|
13
|
+
scope: "team-library";
|
|
14
|
+
}>, z.ZodObject<{
|
|
15
|
+
scope: z.ZodLiteral<"same-team">;
|
|
16
|
+
projectIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
projectSlugs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
scope: "same-team";
|
|
20
|
+
projectIds: string[];
|
|
21
|
+
projectSlugs: string[];
|
|
22
|
+
}, {
|
|
23
|
+
scope: "same-team";
|
|
24
|
+
projectIds?: string[] | undefined;
|
|
25
|
+
projectSlugs?: string[] | undefined;
|
|
26
|
+
}>, z.ZodObject<{
|
|
27
|
+
scope: z.ZodLiteral<"shared-team">;
|
|
28
|
+
teamId: z.ZodString;
|
|
29
|
+
projectIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
30
|
+
}, "strict", z.ZodTypeAny, {
|
|
31
|
+
teamId: string;
|
|
32
|
+
scope: "shared-team";
|
|
33
|
+
projectIds: string[];
|
|
34
|
+
}, {
|
|
35
|
+
teamId: string;
|
|
36
|
+
scope: "shared-team";
|
|
37
|
+
projectIds?: string[] | undefined;
|
|
38
|
+
}>]>;
|
|
39
|
+
export declare const assignmentContextSourceSchema: z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
layer: z.ZodEnum<["core", "agent", "activity", "live", "tool"]>;
|
|
42
|
+
kind: z.ZodString;
|
|
43
|
+
teamId: z.ZodString;
|
|
44
|
+
projectId: z.ZodString;
|
|
45
|
+
path: z.ZodNullable<z.ZodString>;
|
|
46
|
+
digest: z.ZodString;
|
|
47
|
+
disposition: z.ZodEnum<["included", "summarized", "omitted", "failed"]>;
|
|
48
|
+
required: z.ZodBoolean;
|
|
49
|
+
measurement: z.ZodObject<{
|
|
50
|
+
unit: z.ZodEnum<["tokens", "bytes", "items"]>;
|
|
51
|
+
amount: z.ZodNumber;
|
|
52
|
+
provenance: z.ZodString;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
provenance: string;
|
|
55
|
+
amount: number;
|
|
56
|
+
unit: "items" | "tokens" | "bytes";
|
|
57
|
+
}, {
|
|
58
|
+
provenance: string;
|
|
59
|
+
amount: number;
|
|
60
|
+
unit: "items" | "tokens" | "bytes";
|
|
61
|
+
}>;
|
|
62
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
63
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
64
|
+
}, "strict", z.ZodTypeAny, {
|
|
65
|
+
path: string | null;
|
|
66
|
+
kind: string;
|
|
67
|
+
id: string;
|
|
68
|
+
digest: string;
|
|
69
|
+
required: boolean;
|
|
70
|
+
projectId: string;
|
|
71
|
+
teamId: string;
|
|
72
|
+
reason: string | null;
|
|
73
|
+
metadata: Record<string, unknown>;
|
|
74
|
+
measurement: {
|
|
75
|
+
provenance: string;
|
|
76
|
+
amount: number;
|
|
77
|
+
unit: "items" | "tokens" | "bytes";
|
|
78
|
+
};
|
|
79
|
+
layer: "agent" | "live" | "core" | "tool" | "activity";
|
|
80
|
+
disposition: "failed" | "included" | "summarized" | "omitted";
|
|
81
|
+
}, {
|
|
82
|
+
path: string | null;
|
|
83
|
+
kind: string;
|
|
84
|
+
id: string;
|
|
85
|
+
digest: string;
|
|
86
|
+
required: boolean;
|
|
87
|
+
projectId: string;
|
|
88
|
+
teamId: string;
|
|
89
|
+
reason: string | null;
|
|
90
|
+
measurement: {
|
|
91
|
+
provenance: string;
|
|
92
|
+
amount: number;
|
|
93
|
+
unit: "items" | "tokens" | "bytes";
|
|
94
|
+
};
|
|
95
|
+
layer: "agent" | "live" | "core" | "tool" | "activity";
|
|
96
|
+
disposition: "failed" | "included" | "summarized" | "omitted";
|
|
97
|
+
metadata?: Record<string, unknown> | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
export declare const assignmentContextPackSchema: z.ZodObject<{
|
|
100
|
+
schemaVersion: z.ZodLiteral<"treeseed.assignment-context-pack/v1">;
|
|
101
|
+
assignmentId: z.ZodString;
|
|
102
|
+
capacity: z.ZodObject<{
|
|
103
|
+
mode: z.ZodEnum<["bounded", "unbounded"]>;
|
|
104
|
+
measurement: z.ZodNullable<z.ZodEnum<["tokens", "bytes", "items"]>>;
|
|
105
|
+
defaultInitial: z.ZodNullable<z.ZodNumber>;
|
|
106
|
+
maximum: z.ZodNullable<z.ZodNumber>;
|
|
107
|
+
reservedOutput: z.ZodNullable<z.ZodNumber>;
|
|
108
|
+
transportPayloadBytes: z.ZodNumber;
|
|
109
|
+
measurementProvenance: z.ZodObject<{
|
|
110
|
+
provider: z.ZodString;
|
|
111
|
+
implementation: z.ZodString;
|
|
112
|
+
version: z.ZodNullable<z.ZodString>;
|
|
113
|
+
}, "strict", z.ZodTypeAny, {
|
|
114
|
+
provider: string;
|
|
115
|
+
version: string | null;
|
|
116
|
+
implementation: string;
|
|
117
|
+
}, {
|
|
118
|
+
provider: string;
|
|
119
|
+
version: string | null;
|
|
120
|
+
implementation: string;
|
|
121
|
+
}>;
|
|
122
|
+
}, "strict", z.ZodTypeAny, {
|
|
123
|
+
maximum: number | null;
|
|
124
|
+
mode: "bounded" | "unbounded";
|
|
125
|
+
measurement: "items" | "tokens" | "bytes" | null;
|
|
126
|
+
defaultInitial: number | null;
|
|
127
|
+
reservedOutput: number | null;
|
|
128
|
+
transportPayloadBytes: number;
|
|
129
|
+
measurementProvenance: {
|
|
130
|
+
provider: string;
|
|
131
|
+
version: string | null;
|
|
132
|
+
implementation: string;
|
|
133
|
+
};
|
|
134
|
+
}, {
|
|
135
|
+
maximum: number | null;
|
|
136
|
+
mode: "bounded" | "unbounded";
|
|
137
|
+
measurement: "items" | "tokens" | "bytes" | null;
|
|
138
|
+
defaultInitial: number | null;
|
|
139
|
+
reservedOutput: number | null;
|
|
140
|
+
transportPayloadBytes: number;
|
|
141
|
+
measurementProvenance: {
|
|
142
|
+
provider: string;
|
|
143
|
+
version: string | null;
|
|
144
|
+
implementation: string;
|
|
145
|
+
};
|
|
146
|
+
}>;
|
|
147
|
+
totals: z.ZodObject<{
|
|
148
|
+
tokens: z.ZodNumber;
|
|
149
|
+
bytes: z.ZodNumber;
|
|
150
|
+
items: z.ZodNumber;
|
|
151
|
+
}, "strict", z.ZodTypeAny, {
|
|
152
|
+
items: number;
|
|
153
|
+
tokens: number;
|
|
154
|
+
bytes: number;
|
|
155
|
+
}, {
|
|
156
|
+
items: number;
|
|
157
|
+
tokens: number;
|
|
158
|
+
bytes: number;
|
|
159
|
+
}>;
|
|
160
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
layer: z.ZodEnum<["core", "agent", "activity", "live", "tool"]>;
|
|
163
|
+
kind: z.ZodString;
|
|
164
|
+
teamId: z.ZodString;
|
|
165
|
+
projectId: z.ZodString;
|
|
166
|
+
path: z.ZodNullable<z.ZodString>;
|
|
167
|
+
digest: z.ZodString;
|
|
168
|
+
disposition: z.ZodEnum<["included", "summarized", "omitted", "failed"]>;
|
|
169
|
+
required: z.ZodBoolean;
|
|
170
|
+
measurement: z.ZodObject<{
|
|
171
|
+
unit: z.ZodEnum<["tokens", "bytes", "items"]>;
|
|
172
|
+
amount: z.ZodNumber;
|
|
173
|
+
provenance: z.ZodString;
|
|
174
|
+
}, "strict", z.ZodTypeAny, {
|
|
175
|
+
provenance: string;
|
|
176
|
+
amount: number;
|
|
177
|
+
unit: "items" | "tokens" | "bytes";
|
|
178
|
+
}, {
|
|
179
|
+
provenance: string;
|
|
180
|
+
amount: number;
|
|
181
|
+
unit: "items" | "tokens" | "bytes";
|
|
182
|
+
}>;
|
|
183
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
184
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
185
|
+
}, "strict", z.ZodTypeAny, {
|
|
186
|
+
path: string | null;
|
|
187
|
+
kind: string;
|
|
188
|
+
id: string;
|
|
189
|
+
digest: string;
|
|
190
|
+
required: boolean;
|
|
191
|
+
projectId: string;
|
|
192
|
+
teamId: string;
|
|
193
|
+
reason: string | null;
|
|
194
|
+
metadata: Record<string, unknown>;
|
|
195
|
+
measurement: {
|
|
196
|
+
provenance: string;
|
|
197
|
+
amount: number;
|
|
198
|
+
unit: "items" | "tokens" | "bytes";
|
|
199
|
+
};
|
|
200
|
+
layer: "agent" | "live" | "core" | "tool" | "activity";
|
|
201
|
+
disposition: "failed" | "included" | "summarized" | "omitted";
|
|
202
|
+
}, {
|
|
203
|
+
path: string | null;
|
|
204
|
+
kind: string;
|
|
205
|
+
id: string;
|
|
206
|
+
digest: string;
|
|
207
|
+
required: boolean;
|
|
208
|
+
projectId: string;
|
|
209
|
+
teamId: string;
|
|
210
|
+
reason: string | null;
|
|
211
|
+
measurement: {
|
|
212
|
+
provenance: string;
|
|
213
|
+
amount: number;
|
|
214
|
+
unit: "items" | "tokens" | "bytes";
|
|
215
|
+
};
|
|
216
|
+
layer: "agent" | "live" | "core" | "tool" | "activity";
|
|
217
|
+
disposition: "failed" | "included" | "summarized" | "omitted";
|
|
218
|
+
metadata?: Record<string, unknown> | undefined;
|
|
219
|
+
}>, "many">;
|
|
220
|
+
digest: z.ZodString;
|
|
221
|
+
}, "strict", z.ZodTypeAny, {
|
|
222
|
+
schemaVersion: "treeseed.assignment-context-pack/v1";
|
|
223
|
+
sources: {
|
|
224
|
+
path: string | null;
|
|
225
|
+
kind: string;
|
|
226
|
+
id: string;
|
|
227
|
+
digest: string;
|
|
228
|
+
required: boolean;
|
|
229
|
+
projectId: string;
|
|
230
|
+
teamId: string;
|
|
231
|
+
reason: string | null;
|
|
232
|
+
metadata: Record<string, unknown>;
|
|
233
|
+
measurement: {
|
|
234
|
+
provenance: string;
|
|
235
|
+
amount: number;
|
|
236
|
+
unit: "items" | "tokens" | "bytes";
|
|
237
|
+
};
|
|
238
|
+
layer: "agent" | "live" | "core" | "tool" | "activity";
|
|
239
|
+
disposition: "failed" | "included" | "summarized" | "omitted";
|
|
240
|
+
}[];
|
|
241
|
+
digest: string;
|
|
242
|
+
assignmentId: string;
|
|
243
|
+
capacity: {
|
|
244
|
+
maximum: number | null;
|
|
245
|
+
mode: "bounded" | "unbounded";
|
|
246
|
+
measurement: "items" | "tokens" | "bytes" | null;
|
|
247
|
+
defaultInitial: number | null;
|
|
248
|
+
reservedOutput: number | null;
|
|
249
|
+
transportPayloadBytes: number;
|
|
250
|
+
measurementProvenance: {
|
|
251
|
+
provider: string;
|
|
252
|
+
version: string | null;
|
|
253
|
+
implementation: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
totals: {
|
|
257
|
+
items: number;
|
|
258
|
+
tokens: number;
|
|
259
|
+
bytes: number;
|
|
260
|
+
};
|
|
261
|
+
}, {
|
|
262
|
+
schemaVersion: "treeseed.assignment-context-pack/v1";
|
|
263
|
+
sources: {
|
|
264
|
+
path: string | null;
|
|
265
|
+
kind: string;
|
|
266
|
+
id: string;
|
|
267
|
+
digest: string;
|
|
268
|
+
required: boolean;
|
|
269
|
+
projectId: string;
|
|
270
|
+
teamId: string;
|
|
271
|
+
reason: string | null;
|
|
272
|
+
measurement: {
|
|
273
|
+
provenance: string;
|
|
274
|
+
amount: number;
|
|
275
|
+
unit: "items" | "tokens" | "bytes";
|
|
276
|
+
};
|
|
277
|
+
layer: "agent" | "live" | "core" | "tool" | "activity";
|
|
278
|
+
disposition: "failed" | "included" | "summarized" | "omitted";
|
|
279
|
+
metadata?: Record<string, unknown> | undefined;
|
|
280
|
+
}[];
|
|
281
|
+
digest: string;
|
|
282
|
+
assignmentId: string;
|
|
283
|
+
capacity: {
|
|
284
|
+
maximum: number | null;
|
|
285
|
+
mode: "bounded" | "unbounded";
|
|
286
|
+
measurement: "items" | "tokens" | "bytes" | null;
|
|
287
|
+
defaultInitial: number | null;
|
|
288
|
+
reservedOutput: number | null;
|
|
289
|
+
transportPayloadBytes: number;
|
|
290
|
+
measurementProvenance: {
|
|
291
|
+
provider: string;
|
|
292
|
+
version: string | null;
|
|
293
|
+
implementation: string;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
totals: {
|
|
297
|
+
items: number;
|
|
298
|
+
tokens: number;
|
|
299
|
+
bytes: number;
|
|
300
|
+
};
|
|
301
|
+
}>;
|
|
302
|
+
export type ContextSourceSelector = z.infer<typeof contextSourceSelectorSchema>;
|
|
303
|
+
export type AssignmentContextSource = z.infer<typeof assignmentContextSourceSchema>;
|
|
304
|
+
export type AssignmentContextPack = z.infer<typeof assignmentContextPackSchema>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const nonEmpty = z.string().trim().min(1);
|
|
3
|
+
const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/u);
|
|
4
|
+
const contextSourceSelectorSchema = z.discriminatedUnion("scope", [
|
|
5
|
+
z.object({ scope: z.literal("current-project") }).strict(),
|
|
6
|
+
z.object({ scope: z.literal("team-library") }).strict(),
|
|
7
|
+
z.object({ scope: z.literal("same-team"), projectIds: z.array(nonEmpty).default([]), projectSlugs: z.array(nonEmpty).default([]) }).strict(),
|
|
8
|
+
z.object({ scope: z.literal("shared-team"), teamId: nonEmpty, projectIds: z.array(nonEmpty).default([]) }).strict()
|
|
9
|
+
]);
|
|
10
|
+
const assignmentContextSourceSchema = z.object({
|
|
11
|
+
id: nonEmpty,
|
|
12
|
+
layer: z.enum(["core", "agent", "activity", "live", "tool"]),
|
|
13
|
+
kind: nonEmpty,
|
|
14
|
+
teamId: nonEmpty,
|
|
15
|
+
projectId: nonEmpty,
|
|
16
|
+
path: nonEmpty.nullable(),
|
|
17
|
+
digest,
|
|
18
|
+
disposition: z.enum(["included", "summarized", "omitted", "failed"]),
|
|
19
|
+
required: z.boolean(),
|
|
20
|
+
measurement: z.object({ unit: z.enum(["tokens", "bytes", "items"]), amount: z.number().int().nonnegative(), provenance: nonEmpty }).strict(),
|
|
21
|
+
reason: z.string().nullable(),
|
|
22
|
+
metadata: z.record(z.unknown()).default({})
|
|
23
|
+
}).strict();
|
|
24
|
+
const assignmentContextPackSchema = z.object({
|
|
25
|
+
schemaVersion: z.literal("treeseed.assignment-context-pack/v1"),
|
|
26
|
+
assignmentId: nonEmpty,
|
|
27
|
+
capacity: z.object({
|
|
28
|
+
mode: z.enum(["bounded", "unbounded"]),
|
|
29
|
+
measurement: z.enum(["tokens", "bytes", "items"]).nullable(),
|
|
30
|
+
defaultInitial: z.number().int().positive().nullable(),
|
|
31
|
+
maximum: z.number().int().positive().nullable(),
|
|
32
|
+
reservedOutput: z.number().int().nonnegative().nullable(),
|
|
33
|
+
transportPayloadBytes: z.number().int().positive(),
|
|
34
|
+
measurementProvenance: z.object({ provider: nonEmpty, implementation: nonEmpty, version: z.string().nullable() }).strict()
|
|
35
|
+
}).strict(),
|
|
36
|
+
totals: z.object({ tokens: z.number().int().nonnegative(), bytes: z.number().int().nonnegative(), items: z.number().int().nonnegative() }).strict(),
|
|
37
|
+
sources: z.array(assignmentContextSourceSchema),
|
|
38
|
+
digest
|
|
39
|
+
}).strict();
|
|
40
|
+
export {
|
|
41
|
+
assignmentContextPackSchema,
|
|
42
|
+
assignmentContextSourceSchema,
|
|
43
|
+
contextSourceSelectorSchema
|
|
44
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type AgentExecutionMode = 'planning' | 'acting';
|
|
2
|
-
|
|
2
|
+
import type { AgentWorkExecutionMode } from '../../support/authority/execution-mode.js';
|
|
3
3
|
export type ProviderAssignmentStatus = 'pending' | 'leased' | 'running' | 'completed' | 'failed' | 'returned' | 'expired' | 'cancelled';
|
|
4
4
|
export type ProviderAssignmentLeaseState = 'unleased' | 'leased' | 'released' | 'expired';
|
|
5
5
|
export type AgentModeRunStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
6
|
-
export type ProviderAssignmentSynthesisSource = 'approved_decision' | 'planning_input_request' | 'capacity_plan' | 'workday_demand' | 'verification_failure' | 'fallback_queue';
|
|
6
|
+
export type ProviderAssignmentSynthesisSource = 'approved_decision' | 'planning_input_request' | 'capacity_plan' | 'living_execution_graph' | 'workday_demand' | 'verification_failure' | 'fallback_queue';
|
|
7
7
|
export declare const AGENT_ASSIGNMENT_WORKSPACE_ACCESS_MODES: readonly ["context_only", "workspace_write", "brokered_workspace", "full_workspace_no_credentials", "trusted_direct"];
|
|
8
8
|
export type AgentAssignmentWorkspaceAccessMode = (typeof AGENT_ASSIGNMENT_WORKSPACE_ACCESS_MODES)[number];
|
|
9
9
|
export type AgentAssignmentCapabilityHandleKind = 'repository_access' | 'treedx_workspace' | 'workflow_operation' | 'secret_use';
|
|
@@ -59,6 +59,7 @@ export interface TreeDxProxyHandle {
|
|
|
59
59
|
assignmentId?: string | null;
|
|
60
60
|
executionMode?: AgentWorkExecutionMode;
|
|
61
61
|
repositoryId?: string | null;
|
|
62
|
+
repositoryProjectId?: string | null;
|
|
62
63
|
workspaceId?: string | null;
|
|
63
64
|
baseCommitSha?: string | null;
|
|
64
65
|
baseRef?: string | null;
|
|
@@ -75,6 +76,15 @@ export interface TreeDxProxyHandle {
|
|
|
75
76
|
allowedPaths?: string[];
|
|
76
77
|
allowedReadPaths?: string[];
|
|
77
78
|
allowedWritePaths?: string[];
|
|
79
|
+
readRepositories?: Array<{
|
|
80
|
+
projectId: string;
|
|
81
|
+
projectSlug: string;
|
|
82
|
+
repositoryId: string;
|
|
83
|
+
baseRef: string;
|
|
84
|
+
allowedPaths: string[];
|
|
85
|
+
allowedModels: string[];
|
|
86
|
+
source: 'team-library' | 'same-team' | 'shared-team';
|
|
87
|
+
}>;
|
|
78
88
|
metadata?: Record<string, unknown>;
|
|
79
89
|
}
|
|
80
90
|
export interface ProviderAssignmentCapabilityHandleBase {
|
|
@@ -189,6 +199,11 @@ export interface ProviderAssignment {
|
|
|
189
199
|
synthesisKey: string | null;
|
|
190
200
|
decisionId: string | null;
|
|
191
201
|
proposalId: string | null;
|
|
202
|
+
graphRevision?: number | null;
|
|
203
|
+
executionNodeId?: string | null;
|
|
204
|
+
executionNodeRevision?: number | null;
|
|
205
|
+
assignmentAttempt?: import('./agent-execution.js').AssignmentAttempt | null;
|
|
206
|
+
assignmentResult?: import('./agent-execution.js').AssignmentResult | null;
|
|
192
207
|
fallbackOutputId: string | null;
|
|
193
208
|
treedxProxyHandle: TreeDxProxyHandle | Record<string, unknown> | null;
|
|
194
209
|
capabilityHandles: ProviderAssignmentCapabilityHandles | Record<string, unknown> | null;
|
|
@@ -197,6 +212,11 @@ export interface ProviderAssignment {
|
|
|
197
212
|
updatedAt: string;
|
|
198
213
|
}
|
|
199
214
|
export interface ProviderAssignmentLifecycleRequest {
|
|
215
|
+
activeSeconds?: number | null;
|
|
216
|
+
elapsedSeconds?: number | null;
|
|
217
|
+
actualUsd?: number | null;
|
|
218
|
+
providerUnits?: number | null;
|
|
219
|
+
usage?: Record<string, unknown> | null;
|
|
200
220
|
runnerId?: string | null;
|
|
201
221
|
leaseToken?: string | null;
|
|
202
222
|
leaseSeconds?: number | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ProviderContextCapacity } from '../../../../capacity-provider/capability-ontology.js';
|
|
2
|
+
import type { AssignmentContextPack, AssignmentContextSource } from './assignment-context-pack.js';
|
|
3
|
+
export interface ContextPackCandidate {
|
|
4
|
+
source: Omit<AssignmentContextSource, 'disposition' | 'measurement' | 'reason'>;
|
|
5
|
+
measurement: {
|
|
6
|
+
unit: 'tokens' | 'bytes' | 'items';
|
|
7
|
+
amount: number;
|
|
8
|
+
provenance: string;
|
|
9
|
+
};
|
|
10
|
+
priority: number;
|
|
11
|
+
mandatory?: boolean;
|
|
12
|
+
minimumBudget?: number;
|
|
13
|
+
maximumBudget?: number;
|
|
14
|
+
summaryMeasurement?: {
|
|
15
|
+
unit: 'tokens' | 'bytes' | 'items';
|
|
16
|
+
amount: number;
|
|
17
|
+
provenance: string;
|
|
18
|
+
};
|
|
19
|
+
omissionReason?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function compileAssignmentContextPack(input: {
|
|
22
|
+
assignmentId: string;
|
|
23
|
+
capacity: ProviderContextCapacity;
|
|
24
|
+
candidates: ContextPackCandidate[];
|
|
25
|
+
}): AssignmentContextPack;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
const canonical = (value) => value === null || typeof value !== "object" ? JSON.stringify(value) : Array.isArray(value) ? `[${value.map(canonical).join(",")}]` : `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => `${JSON.stringify(key)}:${canonical(item)}`).join(",")}}`;
|
|
3
|
+
function compileAssignmentContextPack(input) {
|
|
4
|
+
const capacityUnit = input.capacity.mode === "bounded" ? input.capacity.measurement : null;
|
|
5
|
+
const budgetUnit = input.capacity.mode === "bounded" ? input.capacity.measurement : "bytes";
|
|
6
|
+
const ordered = [...input.candidates].sort((left, right) => Number(Boolean(right.mandatory)) - Number(Boolean(left.mandatory)) || Number(right.source.required) - Number(left.source.required) || right.priority - left.priority || left.source.id.localeCompare(right.source.id));
|
|
7
|
+
const mandatoryAmount = ordered.filter((candidate) => candidate.mandatory && !candidate.omissionReason).reduce((sum, candidate) => {
|
|
8
|
+
if (candidate.measurement.unit !== budgetUnit) throw new Error(`Context source ${candidate.source.id} uses ${candidate.measurement.unit}, but the offer budgets ${budgetUnit}.`);
|
|
9
|
+
return sum + candidate.measurement.amount;
|
|
10
|
+
}, 0);
|
|
11
|
+
const requiredFloor = ordered.filter((candidate) => candidate.source.required && !candidate.omissionReason).reduce((sum, candidate) => {
|
|
12
|
+
if (candidate.measurement.unit !== budgetUnit) throw new Error(`Context source ${candidate.source.id} uses ${candidate.measurement.unit}, but the offer budgets ${budgetUnit}.`);
|
|
13
|
+
if (candidate.mandatory) return sum + candidate.measurement.amount;
|
|
14
|
+
const summarized = candidate.summaryMeasurement?.unit === budgetUnit && candidate.summaryMeasurement.amount >= (candidate.minimumBudget ?? 0) ? candidate.summaryMeasurement.amount : candidate.measurement.amount;
|
|
15
|
+
return sum + summarized;
|
|
16
|
+
}, 0);
|
|
17
|
+
const maximumInput = input.capacity.mode === "bounded" ? input.capacity.maximum - input.capacity.reservedOutput : input.capacity.transportPayloadBytes;
|
|
18
|
+
if (input.capacity.mode === "bounded" && mandatoryAmount > maximumInput) throw new Error("Mandatory context exceeds the selected provider offer maximum input capacity.");
|
|
19
|
+
if (input.capacity.mode === "bounded" && requiredFloor > maximumInput) throw new Error("Required context exceeds the selected provider offer maximum input capacity.");
|
|
20
|
+
const limit = input.capacity.mode === "bounded" ? Math.min(maximumInput, Math.max(input.capacity.defaultInitial, mandatoryAmount, requiredFloor)) : input.capacity.transportPayloadBytes;
|
|
21
|
+
const sources = [];
|
|
22
|
+
let consumed = 0;
|
|
23
|
+
for (const candidate of ordered) {
|
|
24
|
+
if (candidate.omissionReason) {
|
|
25
|
+
sources.push({ ...candidate.source, disposition: "omitted", measurement: { ...candidate.measurement, amount: 0 }, reason: candidate.omissionReason });
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const compatible = candidate.measurement.unit === budgetUnit;
|
|
29
|
+
if (!compatible) throw new Error(`Context source ${candidate.source.id} uses ${candidate.measurement.unit}, but the offer budgets ${budgetUnit}.`);
|
|
30
|
+
if (candidate.maximumBudget !== void 0 && candidate.minimumBudget !== void 0 && candidate.minimumBudget > candidate.maximumBudget) throw new Error(`Context source ${candidate.source.id} has an invalid minimum/maximum budget.`);
|
|
31
|
+
if (candidate.minimumBudget !== void 0 && candidate.measurement.amount < candidate.minimumBudget && candidate.source.required) throw new Error(`Required context source ${candidate.source.id} cannot satisfy its minimum budget.`);
|
|
32
|
+
if (candidate.mandatory && consumed + candidate.measurement.amount > limit) throw new Error(`Mandatory context exceeds the selected provider offer default: ${candidate.source.id}.`);
|
|
33
|
+
if (consumed + candidate.measurement.amount <= limit && (candidate.maximumBudget === void 0 || candidate.measurement.amount <= candidate.maximumBudget)) {
|
|
34
|
+
sources.push({ ...candidate.source, disposition: "included", measurement: candidate.measurement, reason: null });
|
|
35
|
+
consumed += candidate.measurement.amount;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (!candidate.mandatory && candidate.summaryMeasurement && consumed + candidate.summaryMeasurement.amount <= limit && (candidate.maximumBudget === void 0 || candidate.summaryMeasurement.amount <= candidate.maximumBudget) && (candidate.minimumBudget === void 0 || candidate.summaryMeasurement.amount >= candidate.minimumBudget)) {
|
|
39
|
+
sources.push({ ...candidate.source, disposition: "summarized", measurement: candidate.summaryMeasurement, reason: "provider_context_default" });
|
|
40
|
+
consumed += candidate.summaryMeasurement.amount;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (candidate.source.required) throw new Error(`Mandatory context exceeds the selected provider offer default: ${candidate.source.id}.`);
|
|
44
|
+
sources.push({ ...candidate.source, disposition: "omitted", measurement: { ...candidate.measurement, amount: 0 }, reason: "provider_context_default" });
|
|
45
|
+
}
|
|
46
|
+
const totals = { tokens: 0, bytes: 0, items: 0 };
|
|
47
|
+
for (const source of sources) totals[source.measurement.unit] += source.measurement.amount;
|
|
48
|
+
const material = {
|
|
49
|
+
schemaVersion: "treeseed.assignment-context-pack/v1",
|
|
50
|
+
assignmentId: input.assignmentId,
|
|
51
|
+
capacity: {
|
|
52
|
+
mode: input.capacity.mode,
|
|
53
|
+
measurement: capacityUnit,
|
|
54
|
+
defaultInitial: input.capacity.mode === "bounded" ? input.capacity.defaultInitial : null,
|
|
55
|
+
maximum: input.capacity.mode === "bounded" ? input.capacity.maximum : null,
|
|
56
|
+
reservedOutput: input.capacity.mode === "bounded" ? input.capacity.reservedOutput : null,
|
|
57
|
+
transportPayloadBytes: input.capacity.transportPayloadBytes,
|
|
58
|
+
measurementProvenance: input.capacity.measurementProvenance
|
|
59
|
+
},
|
|
60
|
+
totals,
|
|
61
|
+
sources
|
|
62
|
+
};
|
|
63
|
+
return { ...material, digest: `sha256:${createHash("sha256").update(canonical(material)).digest("hex")}` };
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
compileAssignmentContextPack
|
|
67
|
+
};
|