@treeseed/sdk 0.13.0-rc.11 → 0.13.0-rc.110
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/artifact-mutation-receipt.d.ts +1 -1
- package/dist/agent-capacity/artifacts.d.ts +17 -1
- package/dist/agent-capacity/authority/agent-authority-presets.js +2 -1
- 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 +10 -1
- 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/workday-records.d.ts +1 -1
- package/dist/agent-capacity/contracts/configuration/configuration.js +1 -1
- 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 +2 -3
- package/dist/agent-capacity/validation/activity-profile.js +25 -12
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +1092 -1170
- package/dist/agent-capacity/validation/agent-definition-schema.js +11 -29
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +20 -20
- package/dist/agent-capacity/validation/configuration.d.ts +1 -1
- package/dist/agent-capacity/validation/configuration.js +1 -2
- package/dist/capacity/agents/agent-capacity.d.ts +2 -0
- package/dist/capacity/agents/agent-capacity.js +2 -0
- 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 +24 -0
- package/dist/capacity-provider/client.js +11 -1
- 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 +103 -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 +548 -0
- package/dist/capacity-provider/sandbox-contracts.js +86 -0
- package/dist/capacity-provider/sandbox.d.ts +1 -0
- package/dist/capacity-provider/sandbox.js +1 -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/validation/agent-operational-content-schemas.d.ts +490 -168
- package/dist/content/validation/agent-operational-content-schemas.js +18 -3
- package/dist/content/validation/auxiliary-content-schemas.d.ts +160 -160
- package/dist/content/validation/content-model-schemas.d.ts +2943 -2747
- package/dist/content/validation/portable-content-data.d.ts +296 -292
- 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 +14 -0
- package/dist/deployment/postgres/requirements.js +30 -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 +3578 -0
- package/dist/development/schemas.js +199 -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.js +1 -1
- package/dist/operator-contracts/canonical-command-tree.js +465 -16
- 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/capability-ontology-operations.d.ts +163 -0
- package/dist/operator-contracts/catalog/capability-ontology-operations.js +24 -0
- package/dist/operator-contracts/catalog/communication-operations.d.ts +437 -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/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 +261 -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 +12 -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/command-tree.d.ts +28 -0
- package/dist/operator-contracts/command-tree.js +49 -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 +1818 -0
- package/dist/operator-contracts/communication/contracts.js +188 -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 +2255 -195
- package/dist/operator-contracts/control-plane-operations.js +247 -85
- package/dist/operator-contracts/inbox/contracts.d.ts +1099 -0
- package/dist/operator-contracts/inbox/contracts.js +134 -0
- package/dist/operator-contracts/index.d.ts +6 -0
- package/dist/operator-contracts/index.js +6 -0
- 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/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/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 +18 -36
- package/dist/types/agents/agent-trigger-kinds.d.ts +3 -5
- package/dist/types/agents/agent-trigger-kinds.js +1 -13
- package/package.json +64 -11
- 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-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/{treedx/generated/openapi-types.js → site-contracts/cloudflare.js} +0 -0
- /package/dist/{treedx/types/tree-dx-artifact-list-response.js → site-contracts/platform.js} +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# `@treeseed/sdk`
|
|
2
2
|
|
|
3
|
+
The operator catalog includes versioned `inbox.*` operations for unified team inbox queries, ordered events, private drafts, routed question creation, and exact-version governance actions.
|
|
4
|
+
|
|
3
5
|
`@treeseed/sdk` is TreeSeed's portable contract and remote API package. It gives API, CLI, Agent, browser, and external integrations one versioned description of the control plane and typed conduits to remote TreeSeed and TreeDX services.
|
|
4
6
|
|
|
5
7
|
The SDK does not own control-plane persistence, scheduling, repository mutation, content publication, deployment, provider runtimes, or server-side business workflows. Those implementations belong to the API or their dedicated runtime packages.
|
|
@@ -19,32 +21,44 @@ import {
|
|
|
19
21
|
ControlPlaneClient,
|
|
20
22
|
defaultLocalControlPlaneServer,
|
|
21
23
|
} from '@treeseed/sdk/control-plane-client';
|
|
24
|
+
import { CONTROL_PLANE_OPERATIONS } from '@treeseed/sdk/operator-contracts';
|
|
22
25
|
|
|
23
26
|
const client = new ControlPlaneClient({
|
|
24
27
|
profile: defaultLocalControlPlaneServer(),
|
|
25
28
|
accessToken: process.env.TREESEED_ACCESS_TOKEN,
|
|
26
29
|
});
|
|
27
30
|
|
|
28
|
-
const health = await client.
|
|
31
|
+
const health = await client.invoke(CONTROL_PLANE_OPERATIONS.health.readiness, {
|
|
32
|
+
path: {},
|
|
33
|
+
query: {},
|
|
34
|
+
body: undefined,
|
|
35
|
+
});
|
|
29
36
|
```
|
|
30
37
|
|
|
31
|
-
The client provides typed operation dispatch, RFC 9457 problem handling, OAuth device and refresh flows, server-profile normalization, idempotency keys, optimistic-concurrency headers, and request cancellation.
|
|
38
|
+
The client provides typed operation dispatch, RFC 9457 problem handling, OAuth device and refresh flows, server-profile normalization, idempotency keys, optimistic-concurrency headers, and request cancellation. Operation bindings come from the versioned operation catalog; callers do not construct control-plane paths. Token and profile persistence belong to the consuming CLI, application, or host credential store.
|
|
39
|
+
|
|
40
|
+
Communication contracts treat discussion topics as team-wide coordination scopes. Qualified `@project/agent` addresses select one agent, while unqualified `@agent` addresses expand to every matching chat-enabled agent across active team projects. The API maintains a project-local TreeDX discussion stream for each addressed project and aggregates their invocations under one send identity.
|
|
32
41
|
|
|
33
42
|
## TreeDX API
|
|
34
43
|
|
|
35
44
|
```ts
|
|
36
|
-
import {
|
|
45
|
+
import { ControlPlaneClient } from '@treeseed/sdk/control-plane-client';
|
|
46
|
+
import { TreeSeedTreeDxClient } from '@treeseed/sdk/treedx';
|
|
37
47
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
repoId: 'repo_123',
|
|
48
|
+
const controlPlane = new ControlPlaneClient({
|
|
49
|
+
profile: defaultLocalControlPlaneServer(),
|
|
50
|
+
accessToken: process.env.TREESEED_ACCESS_TOKEN,
|
|
42
51
|
});
|
|
52
|
+
const treeDx = new TreeSeedTreeDxClient(controlPlane);
|
|
43
53
|
|
|
44
|
-
const result = await treeDx.
|
|
54
|
+
const result = await treeDx.proxy.repositories.searchFiles({
|
|
55
|
+
path: { projectId: 'project_123', repositoryId: 'repository_123' },
|
|
56
|
+
query: { query: 'release' },
|
|
57
|
+
body: undefined,
|
|
58
|
+
});
|
|
45
59
|
```
|
|
46
60
|
|
|
47
|
-
TreeDX remains
|
|
61
|
+
TreeDX remains an independently released remote service. This package imports its authoritative payload types but exposes only the project-scoped TreeSeed proxy facade. Direct TreeDX transport, endpoints, topology, and credentials remain confined to trusted control-plane infrastructure.
|
|
48
62
|
|
|
49
63
|
## Public boundaries
|
|
50
64
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"completedAt":"2026-09-10T15:27:03.485Z"}
|
|
@@ -83,11 +83,15 @@ export interface AccountIdentity {
|
|
|
83
83
|
linkedAt: string;
|
|
84
84
|
canUnlink: boolean;
|
|
85
85
|
}>;
|
|
86
|
+
/** Exact account revision supplied as If-Match for concurrent identity mutations. */
|
|
87
|
+
updatedAt?: string;
|
|
86
88
|
}
|
|
87
89
|
export interface AccountPreferences {
|
|
88
90
|
timeZone: string;
|
|
89
91
|
realTimeUpdates: boolean;
|
|
90
92
|
realTimePollingIntervalSeconds: 2 | 5 | 15 | 30;
|
|
93
|
+
/** Exact preference revision supplied as If-Match for concurrent preference mutations. */
|
|
94
|
+
updatedAt?: string;
|
|
91
95
|
}
|
|
92
96
|
export type AccountPreferencesUpdate = Partial<AccountPreferences>;
|
|
93
97
|
export interface AccountWebSession {
|
|
@@ -130,6 +134,8 @@ export interface NotificationPreferences {
|
|
|
130
134
|
emailCadence: NotificationEmailCadence;
|
|
131
135
|
globalContentTypes: string[];
|
|
132
136
|
projectOverrides: NotificationProjectOverride[];
|
|
137
|
+
/** Exact notification-preference revision supplied as If-Match for concurrent updates. */
|
|
138
|
+
updatedAt?: string;
|
|
133
139
|
}
|
|
134
140
|
export interface AccountNotification {
|
|
135
141
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const ARTIFACT_MUTATION_RECEIPT_SCHEMA: "treeseed.artifact-mutation-receipt/v1";
|
|
2
2
|
export type ArtifactMutationKind = 'treedx-content' | 'source-checkpoint';
|
|
3
3
|
export type ArtifactMutationPhase = 'provisional' | 'integrated';
|
|
4
|
-
import type { AgentWorkExecutionMode, UpstreamMutationPolicy } from './contracts/support/execution-mode.js';
|
|
4
|
+
import type { AgentWorkExecutionMode, UpstreamMutationPolicy } from './contracts/support/authority/execution-mode.js';
|
|
5
5
|
export interface ArtifactMutationEvidence {
|
|
6
6
|
ref: string;
|
|
7
7
|
digest?: string | null;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExecutionUsageActual } from '../types/agents.js';
|
|
2
2
|
import type { ResearchCitation } from './contracts/support/research-citation.js';
|
|
3
|
-
import type { ArtifactRef } from '../treedx/types.js';
|
|
4
3
|
import { type ArtifactMutationReceipt } from './artifact-mutation-receipt.js';
|
|
5
4
|
export interface AgentToolEventReference {
|
|
6
5
|
id: string;
|
|
@@ -62,6 +61,23 @@ export interface AgentDiagnosticReference {
|
|
|
62
61
|
retryable?: boolean | null;
|
|
63
62
|
evidenceRef?: string | null;
|
|
64
63
|
}
|
|
64
|
+
export interface ArtifactRef {
|
|
65
|
+
contract: 'treeseed.artifact-ref/v1';
|
|
66
|
+
kind: 'treedx-content' | 'repository-file' | 'r2-object' | 'verification-evidence' | 'provider-input' | 'provider-output' | 'citation' | 'source-commit';
|
|
67
|
+
repositoryId?: string;
|
|
68
|
+
workspaceId?: string;
|
|
69
|
+
path?: string;
|
|
70
|
+
commitSha?: string | null;
|
|
71
|
+
objectKey?: string;
|
|
72
|
+
sha256: string | null;
|
|
73
|
+
byteLength?: number;
|
|
74
|
+
mediaType?: string;
|
|
75
|
+
visibility: 'private' | 'assignment' | 'project' | 'team' | 'public';
|
|
76
|
+
assignmentId?: string;
|
|
77
|
+
toolCallId?: string;
|
|
78
|
+
eventId?: string;
|
|
79
|
+
provenance?: Record<string, string>;
|
|
80
|
+
}
|
|
65
81
|
/** Portable, secret-free terminal evidence emitted by AgentKernel. */
|
|
66
82
|
export interface AgentArtifactManifest {
|
|
67
83
|
schemaVersion: 1;
|
|
@@ -18,6 +18,7 @@ const CHAT_ALLOWED_TOOLS = /* @__PURE__ */ new Set([
|
|
|
18
18
|
...OPERATIONAL_TOOLS,
|
|
19
19
|
...MESSAGING_TOOLS,
|
|
20
20
|
...CONTENT_TOOLS,
|
|
21
|
+
...SOURCE_READ_TOOLS,
|
|
21
22
|
"treedx.build_context",
|
|
22
23
|
"treedx.read_repository_files",
|
|
23
24
|
"treedx.search_workspace",
|
|
@@ -32,7 +33,7 @@ const PROFILE_PRESETS = {
|
|
|
32
33
|
acting: ["source-execution", "influence"],
|
|
33
34
|
reviewing: ["review-authority", "plan-contribution"],
|
|
34
35
|
reporting: ["messaging", "reporting"],
|
|
35
|
-
chat: ["
|
|
36
|
+
chat: ["review-authority"]
|
|
36
37
|
};
|
|
37
38
|
function toolsForPreset(preset) {
|
|
38
39
|
if (preset === "messaging") return MESSAGING_TOOLS;
|
|
@@ -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,5 +1,5 @@
|
|
|
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';
|
|
@@ -75,6 +75,15 @@ export interface TreeDxProxyHandle {
|
|
|
75
75
|
allowedPaths?: string[];
|
|
76
76
|
allowedReadPaths?: string[];
|
|
77
77
|
allowedWritePaths?: string[];
|
|
78
|
+
readRepositories?: Array<{
|
|
79
|
+
projectId: string;
|
|
80
|
+
projectSlug: string;
|
|
81
|
+
repositoryId: string;
|
|
82
|
+
baseRef: string;
|
|
83
|
+
allowedPaths: string[];
|
|
84
|
+
allowedModels: string[];
|
|
85
|
+
source: 'team-library' | 'same-team' | 'shared-team';
|
|
86
|
+
}>;
|
|
78
87
|
metadata?: Record<string, unknown>;
|
|
79
88
|
}
|
|
80
89
|
export interface ProviderAssignmentCapabilityHandleBase {
|
|
@@ -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
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ProviderLanePurpose = 'communication' | '
|
|
1
|
+
export type ProviderLanePurpose = 'communication' | 'platform' | 'workday';
|
|
2
2
|
export type CapacityExecutionKind = 'workday' | 'conversation' | 'simulation' | 'recovery';
|
|
3
3
|
export type CapacityTriggerKind = 'scheduled' | 'manual' | 'discussion' | 'agent-handoff';
|
|
4
4
|
export type CommunicationPriorityClass = 'human-interactive' | 'workday-blocking-agent' | 'agent-asynchronous' | 'operational';
|
|
@@ -7,9 +7,7 @@ export interface CapacitySupplyPolicy {
|
|
|
7
7
|
allowPlanningFailover: boolean;
|
|
8
8
|
allowActingFailover: boolean;
|
|
9
9
|
preferredCapacityProviderIds?: string[];
|
|
10
|
-
preferredExecutionProviderIds?: string[];
|
|
11
10
|
disallowedCapacityProviderIds?: string[];
|
|
12
|
-
disallowedExecutionProviderIds?: string[];
|
|
13
11
|
}
|
|
14
12
|
export interface CapacitySupplyCandidate {
|
|
15
13
|
capacityProviderId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Portable durable records shared by workday control-plane and operator consumers. */
|
|
2
2
|
import type { WorkdayAgentSelection } from '../../../workday.js';
|
|
3
|
-
import type { AgentWorkExecutionMode } from '../../support/execution-mode.js';
|
|
3
|
+
import type { AgentWorkExecutionMode } from '../../support/authority/execution-mode.js';
|
|
4
4
|
export type CapacityWorkdayRunStatus = 'queued' | 'running' | 'completed' | 'cancelled' | 'failed' | 'degraded';
|
|
5
5
|
export type CapacityWorkdayEventStatus = 'recorded' | 'active' | 'completed' | 'warning' | 'error' | 'failed';
|
|
6
6
|
export type CapacityWorkdayDemandSource = 'objective' | 'question' | 'proposal' | 'decision-review' | 'knowledge-gap' | 'release-readiness' | 'idle-intent' | 'planning-input' | 'capacity-plan' | 'assignment-completion' | 'assignment-blockage' | 'workday-summary' | 'handoff' | 'research-workflow';
|
|
@@ -7,7 +7,7 @@ const CAPACITY_CONFIGURATION_FAMILIES = [
|
|
|
7
7
|
"activity-profile"
|
|
8
8
|
];
|
|
9
9
|
const CAPACITY_CONFIGURATION_DESCRIPTORS = [
|
|
10
|
-
{ id: "provider-manifest", ownerPackage: "@treeseed/sdk", format: "yaml", schemaId: "treeseed.capacity-provider/
|
|
10
|
+
{ id: "provider-manifest", ownerPackage: "@treeseed/sdk", format: "yaml", schemaId: "treeseed.capacity-provider/v5", validator: "validateCapacityProviderManifestV5", runtimeOwner: "@treeseed/agent" },
|
|
11
11
|
{ id: "provider-offer", ownerPackage: "@treeseed/sdk", format: "yaml", schemaId: "treeseed.provider-supply-offer/v1", validator: "validateProviderSupplyOffer", runtimeOwner: "@treeseed/agent" },
|
|
12
12
|
{ id: "capacity-grant", ownerPackage: "@treeseed/sdk", format: "yaml", schemaId: "treeseed.capacity-grant/v2", validator: "validateCapacityGrantV2", runtimeOwner: "@treeseed/api" },
|
|
13
13
|
{ id: "allocation-set", ownerPackage: "@treeseed/sdk", format: "yaml", schemaId: "treeseed.capacity-allocation-set/v2", validator: "validateCapacityAllocationSetV2", runtimeOwner: "@treeseed/api" },
|