@treeseed/sdk 0.13.0-rc.11 → 0.13.0-rc.111
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 +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/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
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const inboxItemKindSchema = z.enum(["proposal", "question"]);
|
|
3
|
+
const inboxItemStatusSchema = z.enum(["outstanding", "answered", "approved", "rejected", "closed", "deleted"]);
|
|
4
|
+
const inboxActionKindSchema = z.enum(["publish_revision", "approve", "reject", "comment", "answer", "reply", "reopen"]);
|
|
5
|
+
const inboxProvenanceSchema = z.object({
|
|
6
|
+
repositoryId: z.string().nullable(),
|
|
7
|
+
contentPath: z.string().nullable(),
|
|
8
|
+
commitSha: z.string().nullable(),
|
|
9
|
+
digest: z.string().nullable()
|
|
10
|
+
}).strict();
|
|
11
|
+
const inboxActionDescriptorSchema = z.object({
|
|
12
|
+
action: inboxActionKindSchema,
|
|
13
|
+
label: z.string(),
|
|
14
|
+
enabled: z.boolean(),
|
|
15
|
+
reason: z.string().nullable(),
|
|
16
|
+
requiresFeedback: z.boolean(),
|
|
17
|
+
confirmation: z.enum(["never", "input_required"])
|
|
18
|
+
}).strict();
|
|
19
|
+
const inboxCommentSchema = z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
parentId: z.string().nullable(),
|
|
22
|
+
kind: z.enum(["comment", "answer", "reply"]),
|
|
23
|
+
authorId: z.string(),
|
|
24
|
+
authorLabel: z.string(),
|
|
25
|
+
markdown: z.string(),
|
|
26
|
+
createdAt: z.string().datetime(),
|
|
27
|
+
provenance: inboxProvenanceSchema
|
|
28
|
+
}).strict();
|
|
29
|
+
const inboxItemSchema = z.object({
|
|
30
|
+
schemaVersion: z.literal("treeseed.inbox-item/v1"),
|
|
31
|
+
id: z.string(),
|
|
32
|
+
teamId: z.string(),
|
|
33
|
+
projectId: z.string(),
|
|
34
|
+
projectSlug: z.string(),
|
|
35
|
+
kind: inboxItemKindSchema,
|
|
36
|
+
title: z.string(),
|
|
37
|
+
markdown: z.string(),
|
|
38
|
+
status: inboxItemStatusSchema,
|
|
39
|
+
authorId: z.string(),
|
|
40
|
+
authorLabel: z.string(),
|
|
41
|
+
version: z.number().int().positive(),
|
|
42
|
+
discussionId: z.string().nullable(),
|
|
43
|
+
createdAt: z.string().datetime(),
|
|
44
|
+
updatedAt: z.string().datetime(),
|
|
45
|
+
provenance: inboxProvenanceSchema,
|
|
46
|
+
availableActions: z.array(inboxActionDescriptorSchema),
|
|
47
|
+
comments: z.array(inboxCommentSchema),
|
|
48
|
+
etag: z.string()
|
|
49
|
+
}).strict();
|
|
50
|
+
const inboxItemSummarySchema = inboxItemSchema.pick({
|
|
51
|
+
id: true,
|
|
52
|
+
teamId: true,
|
|
53
|
+
projectId: true,
|
|
54
|
+
projectSlug: true,
|
|
55
|
+
kind: true,
|
|
56
|
+
title: true,
|
|
57
|
+
status: true,
|
|
58
|
+
authorId: true,
|
|
59
|
+
authorLabel: true,
|
|
60
|
+
version: true,
|
|
61
|
+
createdAt: true,
|
|
62
|
+
updatedAt: true,
|
|
63
|
+
etag: true
|
|
64
|
+
});
|
|
65
|
+
const inboxItemPageSchema = z.object({
|
|
66
|
+
schemaVersion: z.literal("treeseed.inbox-page/v1"),
|
|
67
|
+
items: z.array(inboxItemSummarySchema),
|
|
68
|
+
cursor: z.string().nullable()
|
|
69
|
+
}).strict();
|
|
70
|
+
const inboxEventSchema = z.object({
|
|
71
|
+
schemaVersion: z.literal("treeseed.inbox-event/v1"),
|
|
72
|
+
sequence: z.string(),
|
|
73
|
+
id: z.string(),
|
|
74
|
+
teamId: z.string(),
|
|
75
|
+
itemId: z.string().nullable(),
|
|
76
|
+
type: z.enum(["item.created", "item.updated", "item.deleted", "draft.updated", "comment.created", "question.answered", "question.reopened", "proposal.revised", "proposal.decided"]),
|
|
77
|
+
actorId: z.string(),
|
|
78
|
+
occurredAt: z.string().datetime(),
|
|
79
|
+
summary: z.string(),
|
|
80
|
+
payload: z.record(z.unknown())
|
|
81
|
+
}).strict();
|
|
82
|
+
const inboxTimelineSchema = z.object({ events: z.array(inboxEventSchema), cursor: z.string() }).strict();
|
|
83
|
+
const inboxDraftPurposeSchema = z.enum(["feedback", "proposal_revision"]);
|
|
84
|
+
const inboxDraftSchema = z.object({
|
|
85
|
+
schemaVersion: z.literal("treeseed.inbox-draft/v1"),
|
|
86
|
+
itemId: z.string(),
|
|
87
|
+
purpose: inboxDraftPurposeSchema,
|
|
88
|
+
markdown: z.string(),
|
|
89
|
+
baseVersion: z.number().int().positive(),
|
|
90
|
+
revision: z.number().int().nonnegative(),
|
|
91
|
+
updatedAt: z.string().datetime(),
|
|
92
|
+
etag: z.string()
|
|
93
|
+
}).strict();
|
|
94
|
+
const inboxDraftWriteSchema = z.object({ markdown: z.string().max(1e5), baseVersion: z.number().int().positive() }).strict();
|
|
95
|
+
const inboxQuestionCreateSchema = z.object({
|
|
96
|
+
projectId: z.string(),
|
|
97
|
+
title: z.string().trim().min(1).max(180),
|
|
98
|
+
markdown: z.string().trim().min(1).max(1e5),
|
|
99
|
+
recipients: z.array(z.string()).max(64).default([]),
|
|
100
|
+
relatedObjectives: z.array(z.string()).max(64).default([])
|
|
101
|
+
}).strict();
|
|
102
|
+
const inboxActionRequestSchema = z.object({
|
|
103
|
+
action: inboxActionKindSchema,
|
|
104
|
+
markdown: z.string().max(1e5).optional(),
|
|
105
|
+
parentId: z.string().optional(),
|
|
106
|
+
changeReason: z.string().max(2e3).optional(),
|
|
107
|
+
draftRevision: z.number().int().nonnegative().optional()
|
|
108
|
+
}).strict();
|
|
109
|
+
const inboxMutationReceiptSchema = z.object({
|
|
110
|
+
schemaVersion: z.literal("treeseed.inbox-mutation-receipt/v1"),
|
|
111
|
+
item: inboxItemSchema,
|
|
112
|
+
action: inboxActionKindSchema.optional(),
|
|
113
|
+
replayed: z.boolean(),
|
|
114
|
+
receipts: z.array(z.record(z.unknown())).default([])
|
|
115
|
+
}).strict();
|
|
116
|
+
export {
|
|
117
|
+
inboxActionDescriptorSchema,
|
|
118
|
+
inboxActionKindSchema,
|
|
119
|
+
inboxActionRequestSchema,
|
|
120
|
+
inboxCommentSchema,
|
|
121
|
+
inboxDraftPurposeSchema,
|
|
122
|
+
inboxDraftSchema,
|
|
123
|
+
inboxDraftWriteSchema,
|
|
124
|
+
inboxEventSchema,
|
|
125
|
+
inboxItemKindSchema,
|
|
126
|
+
inboxItemPageSchema,
|
|
127
|
+
inboxItemSchema,
|
|
128
|
+
inboxItemStatusSchema,
|
|
129
|
+
inboxItemSummarySchema,
|
|
130
|
+
inboxMutationReceiptSchema,
|
|
131
|
+
inboxProvenanceSchema,
|
|
132
|
+
inboxQuestionCreateSchema,
|
|
133
|
+
inboxTimelineSchema
|
|
134
|
+
};
|
|
@@ -6,3 +6,9 @@ export * from './control-plane-operation.js';
|
|
|
6
6
|
export * from './control-plane-operations.js';
|
|
7
7
|
export * from './mcp.js';
|
|
8
8
|
export * from './oauth.js';
|
|
9
|
+
export * from './communication/contracts.js';
|
|
10
|
+
export * from './communication/addressing.js';
|
|
11
|
+
export * from './inbox/contracts.js';
|
|
12
|
+
export * from './knowledge/contracts.js';
|
|
13
|
+
export * from '../capacity-provider/capability-ontology.js';
|
|
14
|
+
export * from './seed/seed-bundle.js';
|
|
@@ -6,3 +6,9 @@ export * from "./control-plane-operation.js";
|
|
|
6
6
|
export * from "./control-plane-operations.js";
|
|
7
7
|
export * from "./mcp.js";
|
|
8
8
|
export * from "./oauth.js";
|
|
9
|
+
export * from "./communication/contracts.js";
|
|
10
|
+
export * from "./communication/addressing.js";
|
|
11
|
+
export * from "./inbox/contracts.js";
|
|
12
|
+
export * from "./knowledge/contracts.js";
|
|
13
|
+
export * from "../capacity-provider/capability-ontology.js";
|
|
14
|
+
export * from "./seed/seed-bundle.js";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const knowledgeShareOperationSchema: z.ZodEnum<["read", "query", "context", "graph"]>;
|
|
3
|
+
export declare const knowledgeShareGrantInputSchema: z.ZodObject<{
|
|
4
|
+
targetTeamId: z.ZodString;
|
|
5
|
+
projectIds: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
6
|
+
contentModels: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
7
|
+
paths: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
8
|
+
operations: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodEnum<["read", "query", "context", "graph"]>, "many">, ("read" | "context" | "query" | "graph")[], ("read" | "context" | "query" | "graph")[]>>;
|
|
9
|
+
expiresAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
expiresAt: string | null;
|
|
12
|
+
operations: ("read" | "context" | "query" | "graph")[];
|
|
13
|
+
paths: string[];
|
|
14
|
+
targetTeamId: string;
|
|
15
|
+
projectIds: string[];
|
|
16
|
+
contentModels: string[];
|
|
17
|
+
}, {
|
|
18
|
+
targetTeamId: string;
|
|
19
|
+
projectIds: string[];
|
|
20
|
+
expiresAt?: string | null | undefined;
|
|
21
|
+
operations?: ("read" | "context" | "query" | "graph")[] | undefined;
|
|
22
|
+
paths?: string[] | undefined;
|
|
23
|
+
contentModels?: string[] | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const knowledgeShareSchema: z.ZodEffects<z.ZodObject<{
|
|
26
|
+
targetTeamId: z.ZodString;
|
|
27
|
+
projectIds: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
28
|
+
contentModels: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
29
|
+
paths: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
30
|
+
operations: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodEnum<["read", "query", "context", "graph"]>, "many">, ("read" | "context" | "query" | "graph")[], ("read" | "context" | "query" | "graph")[]>>;
|
|
31
|
+
expiresAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
} & {
|
|
33
|
+
schemaVersion: z.ZodLiteral<"treeseed.knowledge-share/v1">;
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
sourceTeamId: z.ZodString;
|
|
36
|
+
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
37
|
+
createdAt: z.ZodString;
|
|
38
|
+
updatedAt: z.ZodString;
|
|
39
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
40
|
+
}, "strict", z.ZodTypeAny, {
|
|
41
|
+
status: "active" | "revoked" | "expired";
|
|
42
|
+
id: string;
|
|
43
|
+
expiresAt: string | null;
|
|
44
|
+
schemaVersion: "treeseed.knowledge-share/v1";
|
|
45
|
+
createdAt: string;
|
|
46
|
+
operations: ("read" | "context" | "query" | "graph")[];
|
|
47
|
+
paths: string[];
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
targetTeamId: string;
|
|
50
|
+
projectIds: string[];
|
|
51
|
+
contentModels: string[];
|
|
52
|
+
sourceTeamId: string;
|
|
53
|
+
revokedAt: string | null;
|
|
54
|
+
}, {
|
|
55
|
+
status: "active" | "revoked" | "expired";
|
|
56
|
+
id: string;
|
|
57
|
+
schemaVersion: "treeseed.knowledge-share/v1";
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
targetTeamId: string;
|
|
61
|
+
projectIds: string[];
|
|
62
|
+
sourceTeamId: string;
|
|
63
|
+
revokedAt: string | null;
|
|
64
|
+
expiresAt?: string | null | undefined;
|
|
65
|
+
operations?: ("read" | "context" | "query" | "graph")[] | undefined;
|
|
66
|
+
paths?: string[] | undefined;
|
|
67
|
+
contentModels?: string[] | undefined;
|
|
68
|
+
}>, {
|
|
69
|
+
status: "active" | "revoked" | "expired";
|
|
70
|
+
id: string;
|
|
71
|
+
expiresAt: string | null;
|
|
72
|
+
schemaVersion: "treeseed.knowledge-share/v1";
|
|
73
|
+
createdAt: string;
|
|
74
|
+
operations: ("read" | "context" | "query" | "graph")[];
|
|
75
|
+
paths: string[];
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
targetTeamId: string;
|
|
78
|
+
projectIds: string[];
|
|
79
|
+
contentModels: string[];
|
|
80
|
+
sourceTeamId: string;
|
|
81
|
+
revokedAt: string | null;
|
|
82
|
+
}, {
|
|
83
|
+
status: "active" | "revoked" | "expired";
|
|
84
|
+
id: string;
|
|
85
|
+
schemaVersion: "treeseed.knowledge-share/v1";
|
|
86
|
+
createdAt: string;
|
|
87
|
+
updatedAt: string;
|
|
88
|
+
targetTeamId: string;
|
|
89
|
+
projectIds: string[];
|
|
90
|
+
sourceTeamId: string;
|
|
91
|
+
revokedAt: string | null;
|
|
92
|
+
expiresAt?: string | null | undefined;
|
|
93
|
+
operations?: ("read" | "context" | "query" | "graph")[] | undefined;
|
|
94
|
+
paths?: string[] | undefined;
|
|
95
|
+
contentModels?: string[] | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
export declare const teamKnowledgeRequestSchema: z.ZodObject<{
|
|
98
|
+
projectIds: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
99
|
+
projectSlugs: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
100
|
+
sharedSources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
101
|
+
teamId: z.ZodString;
|
|
102
|
+
projectIds: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
103
|
+
}, "strict", z.ZodTypeAny, {
|
|
104
|
+
teamId: string;
|
|
105
|
+
projectIds: string[];
|
|
106
|
+
}, {
|
|
107
|
+
teamId: string;
|
|
108
|
+
projectIds?: string[] | undefined;
|
|
109
|
+
}>, "many">>;
|
|
110
|
+
request: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
111
|
+
}, "strict", z.ZodTypeAny, {
|
|
112
|
+
request: Record<string, unknown>;
|
|
113
|
+
projectIds: string[];
|
|
114
|
+
projectSlugs: string[];
|
|
115
|
+
sharedSources: {
|
|
116
|
+
teamId: string;
|
|
117
|
+
projectIds: string[];
|
|
118
|
+
}[];
|
|
119
|
+
}, {
|
|
120
|
+
request: Record<string, unknown>;
|
|
121
|
+
projectIds?: string[] | undefined;
|
|
122
|
+
projectSlugs?: string[] | undefined;
|
|
123
|
+
sharedSources?: {
|
|
124
|
+
teamId: string;
|
|
125
|
+
projectIds?: string[] | undefined;
|
|
126
|
+
}[] | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
export type KnowledgeShare = z.infer<typeof knowledgeShareSchema>;
|
|
129
|
+
export type KnowledgeShareGrantInput = z.infer<typeof knowledgeShareGrantInputSchema>;
|
|
130
|
+
export type TeamKnowledgeRequest = z.infer<typeof teamKnowledgeRequestSchema>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const nonEmpty = z.string().trim().min(1);
|
|
3
|
+
const uniqueStrings = (minimum = 0) => z.array(nonEmpty).min(minimum).superRefine((values, context) => {
|
|
4
|
+
if (new Set(values).size !== values.length) context.addIssue({ code: z.ZodIssueCode.custom, message: "Values must be unique." });
|
|
5
|
+
});
|
|
6
|
+
const knowledgeShareOperationSchema = z.enum(["read", "query", "context", "graph"]);
|
|
7
|
+
const knowledgeShareGrantInputSchema = z.object({
|
|
8
|
+
targetTeamId: nonEmpty,
|
|
9
|
+
projectIds: uniqueStrings(1),
|
|
10
|
+
contentModels: uniqueStrings().default([]),
|
|
11
|
+
paths: uniqueStrings(1).default(["**"]),
|
|
12
|
+
operations: z.array(knowledgeShareOperationSchema).min(1).superRefine((values, context) => {
|
|
13
|
+
if (new Set(values).size !== values.length) context.addIssue({ code: z.ZodIssueCode.custom, message: "Operations must be unique." });
|
|
14
|
+
}).default(["read", "query", "context", "graph"]),
|
|
15
|
+
expiresAt: z.string().datetime({ offset: true }).nullable().default(null)
|
|
16
|
+
}).strict();
|
|
17
|
+
const knowledgeShareSchema = knowledgeShareGrantInputSchema.extend({
|
|
18
|
+
schemaVersion: z.literal("treeseed.knowledge-share/v1"),
|
|
19
|
+
id: nonEmpty,
|
|
20
|
+
sourceTeamId: nonEmpty,
|
|
21
|
+
status: z.enum(["active", "revoked", "expired"]),
|
|
22
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
23
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
24
|
+
revokedAt: z.string().datetime({ offset: true }).nullable()
|
|
25
|
+
}).strict().superRefine((value, context) => {
|
|
26
|
+
if (value.sourceTeamId === value.targetTeamId) context.addIssue({ code: z.ZodIssueCode.custom, path: ["targetTeamId"], message: "Knowledge shares are only for another team." });
|
|
27
|
+
});
|
|
28
|
+
const teamKnowledgeRequestSchema = z.object({
|
|
29
|
+
projectIds: uniqueStrings().default([]),
|
|
30
|
+
projectSlugs: uniqueStrings().default([]),
|
|
31
|
+
sharedSources: z.array(z.object({ teamId: nonEmpty, projectIds: uniqueStrings().default([]) }).strict()).default([]),
|
|
32
|
+
request: z.record(z.unknown())
|
|
33
|
+
}).strict();
|
|
34
|
+
export {
|
|
35
|
+
knowledgeShareGrantInputSchema,
|
|
36
|
+
knowledgeShareOperationSchema,
|
|
37
|
+
knowledgeShareSchema,
|
|
38
|
+
teamKnowledgeRequestSchema
|
|
39
|
+
};
|
|
@@ -34,6 +34,7 @@ export interface InputRequired {
|
|
|
34
34
|
prompt: string;
|
|
35
35
|
confirmation: ConfirmationState;
|
|
36
36
|
}
|
|
37
|
+
export declare function encodeConfirmationState(state: ConfirmationState): string;
|
|
37
38
|
export interface McpToolDescriptor {
|
|
38
39
|
name: string;
|
|
39
40
|
description: string;
|
|
@@ -74,5 +75,9 @@ export interface McpCatalog {
|
|
|
74
75
|
resourceSubscriptions: true;
|
|
75
76
|
};
|
|
76
77
|
}
|
|
78
|
+
export declare const TREESEED_MCP_PROMPTS: readonly McpPromptDescriptor[];
|
|
79
|
+
export declare function operationToMcpResource(operation: ControlPlaneOperationDescriptor): McpResourceDescriptor | null;
|
|
77
80
|
export declare function operationToMcpTool(operation: ControlPlaneOperationDescriptor): McpToolDescriptor | null;
|
|
78
81
|
export declare function buildMcpTools(operations: readonly ControlPlaneOperationDescriptor[]): McpToolDescriptor[];
|
|
82
|
+
export declare function buildMcpResources(operations: readonly ControlPlaneOperationDescriptor[]): McpResourceDescriptor[];
|
|
83
|
+
export declare function buildMcpCatalog(operations: readonly ControlPlaneOperationDescriptor[]): McpCatalog;
|
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
const MCP_PROTOCOL_VERSION = "2026-07-28";
|
|
2
|
+
function encodeConfirmationState(state) {
|
|
3
|
+
const bytes = new TextEncoder().encode(JSON.stringify(state));
|
|
4
|
+
let binary = "";
|
|
5
|
+
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
6
|
+
return btoa(binary).replace(/\+/gu, "-").replace(/\//gu, "_").replace(/=+$/gu, "");
|
|
7
|
+
}
|
|
8
|
+
const TREESEED_MCP_PROMPTS = [
|
|
9
|
+
{ name: "operate", description: "Operate TreeSeed through currently discoverable capabilities.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
10
|
+
{ name: "research", description: "Research a governed TreeSeed question and accumulate knowledge.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
11
|
+
{ name: "governance-review", description: "Review a proposal or decision using current governance evidence.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
12
|
+
{ name: "workday-planning", description: "Plan a time-based workday without bypassing API authority.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
13
|
+
{ name: "project-agent-chat", description: "Prepare an explicit governed team-topic chat invocation for project agents.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] }
|
|
14
|
+
];
|
|
15
|
+
function resourcePath(restPath) {
|
|
16
|
+
const [root, version, ...segments] = restPath.split("/");
|
|
17
|
+
if (root !== "" || version !== "v1" || segments.length === 0) throw new Error(`MCP resource requires a versioned control-plane REST path: ${restPath}`);
|
|
18
|
+
const path = segments.join("/");
|
|
19
|
+
if (path === "me") return "accounts/current";
|
|
20
|
+
return path.replace(/^platform\/operations(?=\/|$)/u, "operations").replace(/^capacity-plans(?=\/|$)/u, "plans").replace(/\/workday-runs(?=\/|$)/u, "/workdays").replace(/\/capacity\/assignments(?=\/|$)/u, "/assignments");
|
|
21
|
+
}
|
|
22
|
+
function operationToMcpResource(operation) {
|
|
23
|
+
if (!operation.surfaces.includes("mcp_resource")) return null;
|
|
24
|
+
if (operation.kind !== "read" || operation.rest.method !== "GET") {
|
|
25
|
+
throw new Error(`MCP resource operation ${operation.operationId} must be a read-only GET operation.`);
|
|
26
|
+
}
|
|
27
|
+
const uriTemplate = `treeseed://${resourcePath(operation.rest.path)}`;
|
|
28
|
+
const parameters = (value) => [...value.matchAll(/\{([^}]+)\}/gu)].map((match) => match[1]).sort();
|
|
29
|
+
if (JSON.stringify(parameters(uriTemplate)) !== JSON.stringify(parameters(operation.rest.path))) {
|
|
30
|
+
throw new Error(`MCP resource ${operation.operationId} must preserve its REST path parameter names.`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
uriTemplate,
|
|
34
|
+
name: operation.operationId,
|
|
35
|
+
description: operation.description,
|
|
36
|
+
mimeType: "application/json",
|
|
37
|
+
operationId: operation.operationId,
|
|
38
|
+
subscribable: true,
|
|
39
|
+
...operation.operationId === "status.show" ? { cacheTtlSeconds: 10 } : {}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
2
42
|
function operationToMcpTool(operation) {
|
|
3
43
|
if (!operation.surfaces.includes("mcp_tool")) return null;
|
|
4
44
|
return {
|
|
@@ -16,8 +56,29 @@ function operationToMcpTool(operation) {
|
|
|
16
56
|
function buildMcpTools(operations) {
|
|
17
57
|
return operations.map(operationToMcpTool).filter((tool) => tool !== null).sort((left, right) => left.name.localeCompare(right.name));
|
|
18
58
|
}
|
|
59
|
+
function buildMcpResources(operations) {
|
|
60
|
+
const resources = operations.map(operationToMcpResource).filter((resource) => resource !== null).sort((left, right) => left.uriTemplate.localeCompare(right.uriTemplate));
|
|
61
|
+
const uriTemplates = new Set(resources.map(({ uriTemplate }) => uriTemplate));
|
|
62
|
+
if (uriTemplates.size !== resources.length) throw new Error("MCP resource URI templates must be unique.");
|
|
63
|
+
return resources;
|
|
64
|
+
}
|
|
65
|
+
function buildMcpCatalog(operations) {
|
|
66
|
+
return {
|
|
67
|
+
schemaVersion: "treeseed.mcp-catalog/v1",
|
|
68
|
+
protocolVersion: MCP_PROTOCOL_VERSION,
|
|
69
|
+
tools: buildMcpTools(operations),
|
|
70
|
+
resources: buildMcpResources(operations),
|
|
71
|
+
prompts: [...TREESEED_MCP_PROMPTS],
|
|
72
|
+
capabilities: { completion: true, progress: true, cancellation: true, inputRequired: true, resourceSubscriptions: true }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
19
75
|
export {
|
|
20
76
|
MCP_PROTOCOL_VERSION,
|
|
77
|
+
TREESEED_MCP_PROMPTS,
|
|
78
|
+
buildMcpCatalog,
|
|
79
|
+
buildMcpResources,
|
|
21
80
|
buildMcpTools,
|
|
81
|
+
encodeConfirmationState,
|
|
82
|
+
operationToMcpResource,
|
|
22
83
|
operationToMcpTool
|
|
23
84
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { OAuthScope } from './control-plane-operation.js';
|
|
2
|
+
export declare const OAUTH_CLIENT_IDS: {
|
|
3
|
+
readonly cli: "trsd";
|
|
4
|
+
readonly admin: "treeseed-admin";
|
|
5
|
+
};
|
|
6
|
+
export type OAuthClientId = typeof OAUTH_CLIENT_IDS[keyof typeof OAUTH_CLIENT_IDS];
|
|
2
7
|
export interface ApiPrincipal {
|
|
3
8
|
id: string;
|
|
4
9
|
displayName?: string;
|
|
@@ -18,6 +23,36 @@ export interface OAuthAuthorizationServerMetadata {
|
|
|
18
23
|
code_challenge_methods_supported: ['S256'];
|
|
19
24
|
scopes_supported: OAuthScope[];
|
|
20
25
|
}
|
|
26
|
+
export interface OAuthAuthorizationPresentation {
|
|
27
|
+
schemaVersion: 'treeseed.oauth.authorization-presentation/v1';
|
|
28
|
+
clientId: string;
|
|
29
|
+
clientName: string;
|
|
30
|
+
redirectUri: string;
|
|
31
|
+
redirectOrigin: string;
|
|
32
|
+
responseType: 'code';
|
|
33
|
+
codeChallenge: string;
|
|
34
|
+
codeChallengeMethod: 'S256';
|
|
35
|
+
scopes: OAuthScope[];
|
|
36
|
+
state: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface OAuthAuthorizationDecisionRequest {
|
|
39
|
+
clientId: string;
|
|
40
|
+
redirectUri: string;
|
|
41
|
+
responseType: 'code';
|
|
42
|
+
codeChallenge: string;
|
|
43
|
+
codeChallengeMethod: 'S256';
|
|
44
|
+
scope: OAuthScope[];
|
|
45
|
+
state?: string | null;
|
|
46
|
+
decision: 'approve' | 'deny';
|
|
47
|
+
identifier?: string;
|
|
48
|
+
password?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface OAuthAuthorizationDecisionResult {
|
|
51
|
+
schemaVersion: 'treeseed.oauth.authorization-decision/v1';
|
|
52
|
+
approved: boolean;
|
|
53
|
+
redirectTo: string;
|
|
54
|
+
expiresIn?: number;
|
|
55
|
+
}
|
|
21
56
|
export interface OAuthProtectedResourceMetadata {
|
|
22
57
|
resource: string;
|
|
23
58
|
authorization_servers: string[];
|
|
@@ -36,6 +71,16 @@ export interface OAuthDeviceAuthorizationResponse {
|
|
|
36
71
|
expiresIn: number;
|
|
37
72
|
interval: number;
|
|
38
73
|
}
|
|
74
|
+
/** Safe browser presentation of a pending device grant. It never contains the device code. */
|
|
75
|
+
export interface OAuthDeviceApprovalPresentation {
|
|
76
|
+
schemaVersion: 'treeseed.oauth.device-approval-presentation/v1';
|
|
77
|
+
clientId: string;
|
|
78
|
+
clientName: string;
|
|
79
|
+
userCode: string;
|
|
80
|
+
scopes: OAuthScope[];
|
|
81
|
+
expiresAt: string;
|
|
82
|
+
status: 'pending';
|
|
83
|
+
}
|
|
39
84
|
export interface OAuthTokenReceipt {
|
|
40
85
|
tokenType: 'Bearer';
|
|
41
86
|
accessToken: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type ControlPlaneOperationBinding, type ControlPlaneOperationDescriptor } from './control-plane-operation.js';
|
|
3
|
+
type Definition = Omit<ControlPlaneOperationDescriptor, 'schemaVersion' | 'schemas' | 'idempotency' | 'concurrency' | 'audited' | 'receipt' | 'redactedPaths' | 'authentication'> & {
|
|
4
|
+
parameters?: string;
|
|
5
|
+
redactedPaths?: string[];
|
|
6
|
+
idempotencyRequired?: boolean;
|
|
7
|
+
concurrencyRequired?: boolean;
|
|
8
|
+
authentication?: ControlPlaneOperationDescriptor['authentication'];
|
|
9
|
+
};
|
|
10
|
+
export declare function defineReadOperation(operationId: `${string}.${string}`, path: `/v1/${string}`, capability: string, surfaces?: ControlPlaneOperationDescriptor['surfaces']): ControlPlaneOperationBinding<{}, {}, undefined, Record<string, unknown>>;
|
|
11
|
+
export declare function defineOperation<TPath, TQuery, TBody, TOutput>(definition: Definition, schema: ControlPlaneOperationBinding<TPath, TQuery, TBody, TOutput>['schema']): ControlPlaneOperationBinding<TPath, TQuery, TBody, TOutput>;
|
|
12
|
+
export declare function defineTreeDxProxyOperation<T extends z.ZodRawShape>(operationId: `${string}.${string}`, upstreamOperationId: string | null, method: 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT', path: `/v1/${string}`, pathShape: T, options?: {
|
|
13
|
+
read?: boolean;
|
|
14
|
+
risk?: ControlPlaneOperationDescriptor['riskClass'];
|
|
15
|
+
surfaces?: ControlPlaneOperationDescriptor['surfaces'];
|
|
16
|
+
pagination?: ControlPlaneOperationDescriptor['pagination'];
|
|
17
|
+
}): ControlPlaneOperationBinding<z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TREEDX_OPENAPI_CONTRACT } from "@treeseed/treedx/openapi";
|
|
3
|
+
import {
|
|
4
|
+
CONTROL_PLANE_OPERATION_SCHEMA_VERSION
|
|
5
|
+
} from "./control-plane-operation.js";
|
|
6
|
+
function defineReadOperation(operationId, path, capability, surfaces = ["rest"]) {
|
|
7
|
+
return defineOperation({
|
|
8
|
+
operationId,
|
|
9
|
+
description: `Read ${operationId}.`,
|
|
10
|
+
rest: { method: "GET", path },
|
|
11
|
+
capability,
|
|
12
|
+
authentication: "oauth",
|
|
13
|
+
oauthScopes: ["treeseed:read"],
|
|
14
|
+
kind: "read",
|
|
15
|
+
riskClass: "ordinary",
|
|
16
|
+
confirmation: "never",
|
|
17
|
+
surfaces,
|
|
18
|
+
cacheScope: "principal",
|
|
19
|
+
pagination: "none"
|
|
20
|
+
}, { path: z.object({}).strict(), query: z.object({}).strict(), body: z.undefined(), output: z.record(z.unknown()) });
|
|
21
|
+
}
|
|
22
|
+
function defineOperation(definition, schema) {
|
|
23
|
+
const { parameters, redactedPaths = [], idempotencyRequired, concurrencyRequired, ...descriptor } = definition;
|
|
24
|
+
const mutation = definition.kind === "mutation";
|
|
25
|
+
return {
|
|
26
|
+
descriptor: {
|
|
27
|
+
...descriptor,
|
|
28
|
+
authentication: definition.authentication ?? (definition.oauthScopes.length ? "oauth" : "anonymous"),
|
|
29
|
+
schemaVersion: CONTROL_PLANE_OPERATION_SCHEMA_VERSION,
|
|
30
|
+
schemas: {
|
|
31
|
+
input: `treeseed.${definition.operationId}.input/v1`,
|
|
32
|
+
output: `treeseed.${definition.operationId}.output/v1`,
|
|
33
|
+
errors: "treeseed.problem/v1",
|
|
34
|
+
...parameters ? { parameters } : {}
|
|
35
|
+
},
|
|
36
|
+
idempotency: { required: idempotencyRequired ?? mutation, header: "Idempotency-Key" },
|
|
37
|
+
concurrency: { required: concurrencyRequired ?? false, readHeader: "ETag", writeHeader: "If-Match" },
|
|
38
|
+
audited: definition.surfaces.some((surface) => surface !== "internal"),
|
|
39
|
+
receipt: mutation,
|
|
40
|
+
redactedPaths
|
|
41
|
+
},
|
|
42
|
+
schema
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const empty = z.object({}).strict();
|
|
46
|
+
const none = z.undefined();
|
|
47
|
+
const record = z.record(z.unknown());
|
|
48
|
+
function defineTreeDxProxyOperation(operationId, upstreamOperationId, method, path, pathShape, options = {}) {
|
|
49
|
+
const kind = options.read ?? method === "GET" ? "read" : "mutation";
|
|
50
|
+
const riskClass = options.risk ?? "ordinary";
|
|
51
|
+
const surfaces = options.surfaces ?? ["rest", "mcp_tool", ...method === "GET" ? ["mcp_resource"] : []];
|
|
52
|
+
return defineOperation({
|
|
53
|
+
operationId,
|
|
54
|
+
description: `${kind === "read" ? "Read" : "Apply"} ${operationId} through the project-scoped TreeDX proxy.`,
|
|
55
|
+
...surfaces.includes("rest") ? { rest: { method, path } } : {},
|
|
56
|
+
...Object.keys(pathShape).length ? { parameters: `treeseed.${operationId}.parameters/v1` } : {},
|
|
57
|
+
capability: kind === "read" ? "treedx.read" : "treedx.write",
|
|
58
|
+
authentication: "oauth_or_provider",
|
|
59
|
+
oauthScopes: kind === "read" ? ["treeseed:read"] : ["treeseed:projects:write"],
|
|
60
|
+
kind,
|
|
61
|
+
riskClass,
|
|
62
|
+
confirmation: riskClass === "ordinary" ? "never" : "input_required",
|
|
63
|
+
surfaces,
|
|
64
|
+
cacheScope: kind === "read" ? "project" : "none",
|
|
65
|
+
pagination: options.pagination ?? "none",
|
|
66
|
+
...upstreamOperationId ? { upstream: { service: "treedx", operationId: upstreamOperationId, contractVersion: TREEDX_OPENAPI_CONTRACT.openapiVersion, contractDigest: TREEDX_OPENAPI_CONTRACT.openapiSha256 } } : {}
|
|
67
|
+
}, {
|
|
68
|
+
path: z.object(pathShape).strict(),
|
|
69
|
+
query: method === "GET" ? record : empty,
|
|
70
|
+
body: method === "GET" ? none : record,
|
|
71
|
+
output: record
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
defineOperation,
|
|
76
|
+
defineReadOperation,
|
|
77
|
+
defineTreeDxProxyOperation
|
|
78
|
+
};
|