@treeseed/sdk 0.13.0-rc.17 → 0.13.0-rc.19
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 +19 -9
- package/dist/agent-capacity/artifacts.d.ts +17 -1
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +84 -84
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +1 -1
- package/dist/content/validation/agent-operational-content-schemas.d.ts +32 -32
- package/dist/content/validation/auxiliary-content-schemas.d.ts +20 -20
- package/dist/content/validation/content-model-schemas.d.ts +220 -220
- package/dist/content/validation/portable-content-data.d.ts +23 -23
- package/dist/entrypoints/clients/control-plane-client.d.ts +2 -0
- package/dist/entrypoints/clients/control-plane-client.js +8 -2
- package/dist/operator-contracts/canonical-command-tree.js +80 -4
- package/dist/operator-contracts/command-tree.d.ts +28 -0
- package/dist/operator-contracts/command-tree.js +49 -0
- package/dist/operator-contracts/control-plane-operation.d.ts +7 -0
- package/dist/operator-contracts/control-plane-operation.js +3 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +282 -41
- package/dist/operator-contracts/control-plane-operations.js +93 -42
- package/dist/operator-contracts/mcp.d.ts +1 -0
- package/dist/operator-contracts/mcp.js +7 -0
- package/dist/operator-contracts/operation-builder.d.ts +17 -0
- package/dist/operator-contracts/operation-builder.js +60 -0
- package/dist/treedx/client.d.ts +589 -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/package.json +8 -10
- 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/generated/openapi-types.js +0 -0
- package/dist/treedx/support/client.d.ts +0 -251
- package/dist/treedx/support/client.js +0 -252
- package/dist/treedx/support/errors.d.ts +0 -13
- package/dist/treedx/support/errors.js +0 -17
- package/dist/treedx/types/tree-dx-actor.d.ts +0 -209
- package/dist/treedx/types/tree-dx-actor.js +0 -8
- package/dist/treedx/types/tree-dx-artifact-list-response.d.ts +0 -13
- package/dist/treedx/types/tree-dx-artifact-list-response.js +0 -0
- package/dist/treedx/types/tree-dx-changeset.d.ts +0 -51
- package/dist/treedx/types/tree-dx-changeset.js +0 -6
- package/dist/treedx/types/tree-dx-context-request.d.ts +0 -245
- package/dist/treedx/types/tree-dx-context-request.js +0 -0
- package/dist/treedx/types/tree-dx-exec-result.d.ts +0 -249
- package/dist/treedx/types/tree-dx-exec-result.js +0 -0
- package/dist/treedx/types/tree-dx-list-tree-request.d.ts +0 -222
- package/dist/treedx/types/tree-dx-list-tree-request.js +0 -0
- package/dist/treedx/types/tree-dx-push-request.d.ts +0 -229
- package/dist/treedx/types/tree-dx-push-request.js +0 -0
|
@@ -650,8 +650,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
650
650
|
}>, "many">>;
|
|
651
651
|
requiresArtifactKinds: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodArray<import("zod").ZodString, "many">, string[], string[]>>;
|
|
652
652
|
}, "strict", import("zod").ZodTypeAny, {
|
|
653
|
-
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
654
653
|
objective?: string | undefined;
|
|
654
|
+
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
655
655
|
proposalTypes?: string[] | undefined;
|
|
656
656
|
artifactKind?: string | undefined;
|
|
657
657
|
subjectModel?: string | undefined;
|
|
@@ -681,8 +681,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
681
681
|
}[] | undefined;
|
|
682
682
|
requiresArtifactKinds?: string[] | undefined;
|
|
683
683
|
}, {
|
|
684
|
-
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
685
684
|
objective?: string | undefined;
|
|
685
|
+
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
686
686
|
proposalTypes?: string[] | undefined;
|
|
687
687
|
artifactKind?: string | undefined;
|
|
688
688
|
subjectModel?: string | undefined;
|
|
@@ -728,8 +728,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
728
728
|
}, "strict", import("zod").ZodTypeAny, {
|
|
729
729
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
730
730
|
projectId?: string | undefined;
|
|
731
|
-
teamId?: string | undefined;
|
|
732
731
|
agentSlug?: string | undefined;
|
|
732
|
+
teamId?: string | undefined;
|
|
733
733
|
requiredRoles?: string[] | undefined;
|
|
734
734
|
allowedRoles?: string[] | undefined;
|
|
735
735
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -739,8 +739,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
739
739
|
}, {
|
|
740
740
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
741
741
|
projectId?: string | undefined;
|
|
742
|
-
teamId?: string | undefined;
|
|
743
742
|
agentSlug?: string | undefined;
|
|
743
|
+
teamId?: string | undefined;
|
|
744
744
|
requiredRoles?: string[] | undefined;
|
|
745
745
|
allowedRoles?: string[] | undefined;
|
|
746
746
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -752,8 +752,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
752
752
|
defaultAnswerPolicy?: {
|
|
753
753
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
754
754
|
projectId?: string | undefined;
|
|
755
|
-
teamId?: string | undefined;
|
|
756
755
|
agentSlug?: string | undefined;
|
|
756
|
+
teamId?: string | undefined;
|
|
757
757
|
requiredRoles?: string[] | undefined;
|
|
758
758
|
allowedRoles?: string[] | undefined;
|
|
759
759
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -766,8 +766,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
766
766
|
defaultAnswerPolicy?: {
|
|
767
767
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
768
768
|
projectId?: string | undefined;
|
|
769
|
-
teamId?: string | undefined;
|
|
770
769
|
agentSlug?: string | undefined;
|
|
770
|
+
teamId?: string | undefined;
|
|
771
771
|
requiredRoles?: string[] | undefined;
|
|
772
772
|
allowedRoles?: string[] | undefined;
|
|
773
773
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -976,8 +976,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
976
976
|
publishes?: string[] | undefined;
|
|
977
977
|
} | undefined;
|
|
978
978
|
planningIntent?: {
|
|
979
|
-
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
980
979
|
objective?: string | undefined;
|
|
980
|
+
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
981
981
|
proposalTypes?: string[] | undefined;
|
|
982
982
|
artifactKind?: string | undefined;
|
|
983
983
|
subjectModel?: string | undefined;
|
|
@@ -1011,8 +1011,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1011
1011
|
defaultAnswerPolicy?: {
|
|
1012
1012
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
1013
1013
|
projectId?: string | undefined;
|
|
1014
|
-
teamId?: string | undefined;
|
|
1015
1014
|
agentSlug?: string | undefined;
|
|
1015
|
+
teamId?: string | undefined;
|
|
1016
1016
|
requiredRoles?: string[] | undefined;
|
|
1017
1017
|
allowedRoles?: string[] | undefined;
|
|
1018
1018
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -1149,8 +1149,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1149
1149
|
publishes?: string[] | undefined;
|
|
1150
1150
|
} | undefined;
|
|
1151
1151
|
planningIntent?: {
|
|
1152
|
-
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
1153
1152
|
objective?: string | undefined;
|
|
1153
|
+
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
1154
1154
|
proposalTypes?: string[] | undefined;
|
|
1155
1155
|
artifactKind?: string | undefined;
|
|
1156
1156
|
subjectModel?: string | undefined;
|
|
@@ -1184,8 +1184,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1184
1184
|
defaultAnswerPolicy?: {
|
|
1185
1185
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
1186
1186
|
projectId?: string | undefined;
|
|
1187
|
-
teamId?: string | undefined;
|
|
1188
1187
|
agentSlug?: string | undefined;
|
|
1188
|
+
teamId?: string | undefined;
|
|
1189
1189
|
requiredRoles?: string[] | undefined;
|
|
1190
1190
|
allowedRoles?: string[] | undefined;
|
|
1191
1191
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -1322,8 +1322,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1322
1322
|
publishes?: string[] | undefined;
|
|
1323
1323
|
} | undefined;
|
|
1324
1324
|
planningIntent?: {
|
|
1325
|
-
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
1326
1325
|
objective?: string | undefined;
|
|
1326
|
+
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
1327
1327
|
proposalTypes?: string[] | undefined;
|
|
1328
1328
|
artifactKind?: string | undefined;
|
|
1329
1329
|
subjectModel?: string | undefined;
|
|
@@ -1357,8 +1357,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1357
1357
|
defaultAnswerPolicy?: {
|
|
1358
1358
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
1359
1359
|
projectId?: string | undefined;
|
|
1360
|
-
teamId?: string | undefined;
|
|
1361
1360
|
agentSlug?: string | undefined;
|
|
1361
|
+
teamId?: string | undefined;
|
|
1362
1362
|
requiredRoles?: string[] | undefined;
|
|
1363
1363
|
allowedRoles?: string[] | undefined;
|
|
1364
1364
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -1495,8 +1495,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1495
1495
|
publishes?: string[] | undefined;
|
|
1496
1496
|
} | undefined;
|
|
1497
1497
|
planningIntent?: {
|
|
1498
|
-
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
1499
1498
|
objective?: string | undefined;
|
|
1499
|
+
stage?: "closeout" | "revision" | "discovery" | "synthesis" | "deliberation" | "evaluation" | undefined;
|
|
1500
1500
|
proposalTypes?: string[] | undefined;
|
|
1501
1501
|
artifactKind?: string | undefined;
|
|
1502
1502
|
subjectModel?: string | undefined;
|
|
@@ -1530,8 +1530,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1530
1530
|
defaultAnswerPolicy?: {
|
|
1531
1531
|
kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
|
|
1532
1532
|
projectId?: string | undefined;
|
|
1533
|
-
teamId?: string | undefined;
|
|
1534
1533
|
agentSlug?: string | undefined;
|
|
1534
|
+
teamId?: string | undefined;
|
|
1535
1535
|
requiredRoles?: string[] | undefined;
|
|
1536
1536
|
allowedRoles?: string[] | undefined;
|
|
1537
1537
|
allowedAgentIds?: string[] | undefined;
|
|
@@ -1568,10 +1568,10 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1568
1568
|
model: string;
|
|
1569
1569
|
priority: number;
|
|
1570
1570
|
status?: string | undefined;
|
|
1571
|
+
reason?: string | undefined;
|
|
1571
1572
|
title?: string | undefined;
|
|
1572
1573
|
slug?: string | undefined;
|
|
1573
1574
|
estimatedCredits?: number | undefined;
|
|
1574
|
-
reason?: string | undefined;
|
|
1575
1575
|
}[];
|
|
1576
1576
|
totalTasks: number;
|
|
1577
1577
|
completedTasks: number;
|
|
@@ -1635,9 +1635,9 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1635
1635
|
fulfillment: {
|
|
1636
1636
|
source: {
|
|
1637
1637
|
kind: "git";
|
|
1638
|
-
ref: string;
|
|
1639
1638
|
repoUrl: string;
|
|
1640
1639
|
directory: string;
|
|
1640
|
+
ref: string;
|
|
1641
1641
|
integrity?: string | undefined;
|
|
1642
1642
|
} | {
|
|
1643
1643
|
version: string;
|
|
@@ -1709,9 +1709,9 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1709
1709
|
id: string;
|
|
1710
1710
|
required: boolean;
|
|
1711
1711
|
description: string;
|
|
1712
|
+
query: string;
|
|
1712
1713
|
title: string;
|
|
1713
1714
|
revision: number;
|
|
1714
|
-
query: string;
|
|
1715
1715
|
filters: Record<string, unknown>;
|
|
1716
1716
|
target: {
|
|
1717
1717
|
kind: "code" | "content" | "mixed" | "graph";
|
|
@@ -1720,8 +1720,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1720
1720
|
};
|
|
1721
1721
|
depth: number;
|
|
1722
1722
|
purpose: string;
|
|
1723
|
-
relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
|
|
1724
1723
|
maturity: "draft" | "validated" | "simulated" | "proven";
|
|
1724
|
+
relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
|
|
1725
1725
|
resultLimit: number;
|
|
1726
1726
|
contextBudget: {
|
|
1727
1727
|
maxItems: number;
|
|
@@ -1763,15 +1763,15 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1763
1763
|
id: string;
|
|
1764
1764
|
status: "active" | "completed" | "ready" | "superseded" | "draft";
|
|
1765
1765
|
projectId: string;
|
|
1766
|
+
teamId: string;
|
|
1767
|
+
objective: string;
|
|
1766
1768
|
completed: {
|
|
1767
1769
|
id: string;
|
|
1768
1770
|
description: string;
|
|
1769
1771
|
title: string;
|
|
1770
1772
|
}[];
|
|
1771
|
-
teamId: string;
|
|
1772
1773
|
title: string;
|
|
1773
1774
|
revision: number;
|
|
1774
|
-
objective: string;
|
|
1775
1775
|
createdAt: Date;
|
|
1776
1776
|
remaining: {
|
|
1777
1777
|
id: string;
|
|
@@ -1804,10 +1804,10 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1804
1804
|
sequence: number;
|
|
1805
1805
|
phase: string;
|
|
1806
1806
|
description?: string | undefined;
|
|
1807
|
+
reason?: string | undefined;
|
|
1807
1808
|
assignmentId?: string | undefined;
|
|
1808
1809
|
updatedAt?: Date | undefined;
|
|
1809
1810
|
workdayId?: string | undefined;
|
|
1810
|
-
reason?: string | undefined;
|
|
1811
1811
|
previousStatusRef?: {
|
|
1812
1812
|
id: string;
|
|
1813
1813
|
revision: number;
|
|
@@ -1825,8 +1825,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1825
1825
|
artifactRefs: string[];
|
|
1826
1826
|
lessons: string[];
|
|
1827
1827
|
performance: {
|
|
1828
|
-
metrics: Record<string, number>;
|
|
1829
1828
|
outcome: string;
|
|
1829
|
+
metrics: Record<string, number>;
|
|
1830
1830
|
};
|
|
1831
1831
|
verificationRefs: string[];
|
|
1832
1832
|
description?: string | undefined;
|
|
@@ -2066,11 +2066,11 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
2066
2066
|
} | {
|
|
2067
2067
|
title: string;
|
|
2068
2068
|
sequence?: number | undefined;
|
|
2069
|
-
refs?: string[] | undefined;
|
|
2070
2069
|
phase?: string | undefined;
|
|
2071
2070
|
group_ids?: string[] | undefined;
|
|
2072
2071
|
discussion_id?: string | undefined;
|
|
2073
2072
|
occurred_at?: Date | undefined;
|
|
2073
|
+
refs?: string[] | undefined;
|
|
2074
2074
|
} | {
|
|
2075
2075
|
id: string;
|
|
2076
2076
|
classification: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ControlPlaneOperationBinding, ControlPlaneOperationBody, ControlPlaneOperationOutput, ControlPlaneOperationPath, ControlPlaneOperationQuery, OAuthScope } from '../../operator-contracts/control-plane-operation.js';
|
|
2
2
|
import type { ApiPrincipal } from '../../operator-contracts/oauth.js';
|
|
3
|
+
import type { InputRequired } from '../../operator-contracts/mcp.js';
|
|
3
4
|
export declare const DEFAULT_CONTROL_PLANE_BASE_URL = "http://127.0.0.1:3002";
|
|
4
5
|
export declare const CONTROL_PLANE_BASE_URL_ENV = "TREESEED_API_BASE_URL";
|
|
5
6
|
export interface ControlPlaneServerProfile {
|
|
@@ -58,6 +59,7 @@ export interface ProblemDetails {
|
|
|
58
59
|
requestId?: string;
|
|
59
60
|
traceId?: string;
|
|
60
61
|
fields?: Record<string, string[]>;
|
|
62
|
+
inputRequired?: InputRequired;
|
|
61
63
|
}
|
|
62
64
|
export interface ControlPlaneCallOptions {
|
|
63
65
|
method?: 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT';
|
|
@@ -67,7 +67,8 @@ function problemFrom(payload, status) {
|
|
|
67
67
|
code: typeof source.code === "string" ? source.code : "control_plane_request_failed",
|
|
68
68
|
requestId: typeof source.requestId === "string" ? source.requestId : void 0,
|
|
69
69
|
traceId: typeof source.traceId === "string" ? source.traceId : void 0,
|
|
70
|
-
fields: source.fields && typeof source.fields === "object" ? source.fields : void 0
|
|
70
|
+
fields: source.fields && typeof source.fields === "object" ? source.fields : void 0,
|
|
71
|
+
inputRequired: source.inputRequired && typeof source.inputRequired === "object" ? source.inputRequired : void 0
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
class ControlPlaneClient {
|
|
@@ -132,7 +133,12 @@ class ControlPlaneClient {
|
|
|
132
133
|
async exchangeOAuthToken(values, signal) {
|
|
133
134
|
const response = await this.fetchImpl(`${this.baseUrl}/oauth/token`, { method: "POST", headers: { accept: "application/json", "content-type": "application/x-www-form-urlencoded" }, body: new URLSearchParams(values), signal });
|
|
134
135
|
const payload = await responsePayload(response);
|
|
135
|
-
if (!response.ok)
|
|
136
|
+
if (!response.ok) {
|
|
137
|
+
const problem = problemFrom(payload, response.status);
|
|
138
|
+
problem.code = typeof payload.error === "string" ? payload.error : problem.code;
|
|
139
|
+
problem.detail = typeof payload.error_description === "string" ? payload.error_description : problem.detail;
|
|
140
|
+
throw new ControlPlaneClientError(problem.detail ?? problem.code, response.status, problem, response.headers);
|
|
141
|
+
}
|
|
136
142
|
return { tokenType: "Bearer", accessToken: String(payload.access_token), refreshToken: typeof payload.refresh_token === "string" ? payload.refresh_token : void 0, expiresIn: Number(payload.expires_in), scope: String(payload.scope ?? "").split(/\s+/u).filter(Boolean), audience: String(payload.audience ?? this.baseUrl), principal: payload.principal && typeof payload.principal === "object" ? payload.principal : void 0 };
|
|
137
143
|
}
|
|
138
144
|
async request(options) {
|
|
@@ -1,3 +1,61 @@
|
|
|
1
|
+
const unavailable = (reason = "This capability is not enabled until its control-plane operation is accepted.") => ({
|
|
2
|
+
kind: "unavailable",
|
|
3
|
+
code: "standards_migration_not_enabled",
|
|
4
|
+
reason
|
|
5
|
+
});
|
|
6
|
+
const protocol = (handlerId) => ({ kind: "protocol", handlerId });
|
|
7
|
+
const local = (handlerId) => ({ kind: "local", handlerId });
|
|
8
|
+
const field = (target, name, source, sourceName = name, required = false, transform = "identity") => ({ target, field: name, source, name: sourceName, required, transform });
|
|
9
|
+
const operation = (operationId, input = []) => ({ kind: "operation", operationId, input });
|
|
10
|
+
const page = () => [field("query", "status", "option"), field("query", "limit", "option", "limit", false, "integer"), field("query", "cursor", "option")];
|
|
11
|
+
const operationBindings = {
|
|
12
|
+
"auth login": protocol("protocol.oauth.device.login"),
|
|
13
|
+
"auth logout": protocol("protocol.oauth.revoke"),
|
|
14
|
+
"auth status": operation("accounts.current.show"),
|
|
15
|
+
"secrets list": local("local.secrets.list"),
|
|
16
|
+
"secrets status": local("local.secrets.status"),
|
|
17
|
+
"secrets unlock": local("local.secrets.unlock"),
|
|
18
|
+
"secrets lock": local("local.secrets.lock"),
|
|
19
|
+
"secrets rotate": local("local.secrets.rotate"),
|
|
20
|
+
"agents list": operation("agents.list", [field("path", "projectId", "context", "project", true), ...page()]),
|
|
21
|
+
"agents show": operation("agents.show", [field("path", "projectId", "context", "project", true), field("path", "agentSlug", "argument", "agent", true)]),
|
|
22
|
+
"agents classes list": operation("agents.classes.list", [field("path", "projectId", "context", "project", true)]),
|
|
23
|
+
"agents classes show": operation("agents.classes.show", [field("path", "projectId", "context", "project", true), field("path", "classId", "argument", "class", true)]),
|
|
24
|
+
"providers list": operation("services.providers.list", page()),
|
|
25
|
+
"providers show": operation("services.connections.show", [field("path", "teamId", "context", "team", true), field("path", "connectionId", "argument", "provider", true)]),
|
|
26
|
+
"providers status": operation("services.connections.show", [field("path", "teamId", "context", "team", true), field("path", "connectionId", "argument", "provider", true)]),
|
|
27
|
+
"providers connect": operation("services.connections.create", [field("path", "teamId", "context", "team", true), field("body", "providerId", "option", "provider", true)]),
|
|
28
|
+
"providers disconnect": operation("services.connections.disconnect", [field("path", "teamId", "context", "team", true), field("path", "connectionId", "argument", "connection", true), field("body", "reason", "option")]),
|
|
29
|
+
"providers credentials status": operation("services.credential.authorities.list", [field("path", "teamId", "context", "team", true), field("path", "connectionId", "argument", "connection", true)]),
|
|
30
|
+
"capacity status": operation("capacity.status", [field("path", "teamId", "context", "team", true), ...page()]),
|
|
31
|
+
"capacity usage": operation("capacity.usage", [field("path", "teamId", "context", "team", true)]),
|
|
32
|
+
"capacity ledger": operation("capacity.ledger", [field("path", "teamId", "context", "team", true), ...page()]),
|
|
33
|
+
"plans list": operation("plans.list", [field("path", "decisionId", "option", "decision", true), ...page()]),
|
|
34
|
+
"plans show": operation("plans.show", [field("path", "capacityPlanId", "argument", "plan", true)]),
|
|
35
|
+
"workdays plan": operation("workdays.plan", [field("path", "teamId", "context", "team", true), field("body", "profile", "option"), field("body", "projects", "option", "projects", false, "csv"), field("body", "start", "option"), field("body", "end", "option"), field("body", "duration", "option", "duration", false, "integer"), field("body", "objective", "option")]),
|
|
36
|
+
"workdays start": operation("workdays.start", [field("path", "teamId", "context", "team", true), field("body", "preflightId", "option", "preflight", true), field("body", "digest", "option", "digest", true)]),
|
|
37
|
+
"workdays list": operation("workdays.list", [field("path", "teamId", "context", "team", true), ...page()]),
|
|
38
|
+
"workdays show": operation("workdays.show", [field("path", "teamId", "context", "team", true), field("path", "runId", "argument", "workday", true)]),
|
|
39
|
+
"workdays schedules list": operation("workdays.schedules.list", [field("path", "teamId", "context", "team", true)]),
|
|
40
|
+
"workdays schedules start": operation("workdays.schedules.create", [field("path", "teamId", "context", "team", true), field("body", "profile", "option"), field("body", "projects", "option", "projects", false, "csv"), field("body", "duration", "option", "duration", false, "integer")]),
|
|
41
|
+
"assignments list": operation("assignments.list", [field("path", "teamId", "context", "team", true), ...page()]),
|
|
42
|
+
"assignments show": operation("assignments.show", [field("path", "teamId", "context", "team", true), field("path", "assignmentId", "argument", "assignment", true)]),
|
|
43
|
+
"assignments explain": operation("assignments.explain", [field("path", "teamId", "context", "team", true), field("path", "assignmentId", "argument", "assignment", true)]),
|
|
44
|
+
"assignments retry": operation("assignments.retry", [field("path", "teamId", "context", "team", true), field("path", "assignmentId", "argument", "assignment", true), field("body", "reason", "option")]),
|
|
45
|
+
"assignments cancel": operation("assignments.cancel", [field("path", "teamId", "context", "team", true), field("path", "assignmentId", "argument", "assignment", true), field("body", "reason", "option")]),
|
|
46
|
+
"projects treedx show": operation("treedx.library.show", [field("path", "projectId", "argument", "project", true)]),
|
|
47
|
+
"projects treedx bind": operation("treedx.library.bind", [field("path", "projectId", "argument", "project", true), field("body", "connectionId", "option", "connection", true)]),
|
|
48
|
+
"projects treedx status": operation("treedx.health.show", [field("path", "projectId", "argument", "project", true)]),
|
|
49
|
+
"projects treedx diagnose": operation("treedx.service.contract", [field("path", "projectId", "argument", "project", true)]),
|
|
50
|
+
"projects treedx capabilities": operation("treedx.capabilities.list", [field("path", "projectId", "argument", "project", true)]),
|
|
51
|
+
"projects treedx workspaces list": operation("treedx.workspaces.list", [field("path", "projectId", "argument", "project", true), ...page()]),
|
|
52
|
+
"projects treedx workspaces show": operation("treedx.workspaces.show", [field("path", "projectId", "context", "project", true), field("path", "workspaceId", "argument", "workspace", true)]),
|
|
53
|
+
"projects treedx workspaces abandon": operation("treedx.workspaces.abandon", [field("path", "projectId", "context", "project", true), field("path", "workspaceId", "argument", "workspace", true)]),
|
|
54
|
+
"status": operation("status.show"),
|
|
55
|
+
"save": unavailable("Unified GitHub-backed save is intentionally fail-closed during this cutover."),
|
|
56
|
+
"stage": unavailable("Unified GitHub-backed stage is intentionally fail-closed during this cutover."),
|
|
57
|
+
"release": unavailable("Production release is intentionally fail-closed during this cutover.")
|
|
58
|
+
};
|
|
1
59
|
const planOption = { name: "--plan", description: "Return the exact proposed outcome without mutation.", type: "boolean" };
|
|
2
60
|
function leaf(segment, kind = "read", argument, confirmation = "never") {
|
|
3
61
|
const value = {
|
|
@@ -7,14 +65,15 @@ function leaf(segment, kind = "read", argument, confirmation = "never") {
|
|
|
7
65
|
arguments: argument ? [{ name: argument, description: `${argument} identity or path.`, required: true }] : void 0,
|
|
8
66
|
options: kind === "mutation" ? [planOption] : void 0,
|
|
9
67
|
authorization: kind === "mutation" ? { capability: `command.${segment}`, confirmation } : void 0,
|
|
10
|
-
resultSchemaId: `treeseed.command.${segment}/v1
|
|
68
|
+
resultSchemaId: `treeseed.command.${segment}/v1`,
|
|
69
|
+
execution: unavailable()
|
|
11
70
|
};
|
|
12
71
|
return { nodeType: "leaf", ...value };
|
|
13
72
|
}
|
|
14
73
|
function branch(segment, children) {
|
|
15
74
|
return { nodeType: "branch", segment, description: `${segment[0].toUpperCase()}${segment.slice(1)} operations.`, children };
|
|
16
75
|
}
|
|
17
|
-
const
|
|
76
|
+
const commandTree = {
|
|
18
77
|
schemaVersion: "treeseed.command-tree/v1",
|
|
19
78
|
executable: "trsd",
|
|
20
79
|
commands: [
|
|
@@ -41,10 +100,10 @@ const TREESEED_COMMAND_TREE_V1 = {
|
|
|
41
100
|
branch("offers", [leaf("show", "read", "connection"), leaf("validate", "read", "file"), leaf("plan", "read", "file"), leaf("apply", "mutation", "file", "authority")])
|
|
42
101
|
]),
|
|
43
102
|
branch("capacity", [leaf("status"), leaf("explain"), leaf("usage"), leaf("ledger"), leaf("audit")]),
|
|
44
|
-
branch("plans", [leaf("list"), leaf("show", "read", "plan"), leaf("explain", "read", "plan"), { nodeType: "leaf", segment: "diff", description: "Compare two API-derived plans.", kind: "read", arguments: [{ name: "left", description: "Left plan identity.", required: true }, { name: "right", description: "Right plan identity.", required: true }], resultSchemaId: "treeseed.command.plans.diff/v1" }]),
|
|
103
|
+
branch("plans", [leaf("list"), leaf("show", "read", "plan"), leaf("explain", "read", "plan"), { nodeType: "leaf", segment: "diff", description: "Compare two API-derived plans.", kind: "read", arguments: [{ name: "left", description: "Left plan identity.", required: true }, { name: "right", description: "Right plan identity.", required: true }], resultSchemaId: "treeseed.command.plans.diff/v1", execution: unavailable() }]),
|
|
45
104
|
branch("workdays", [
|
|
46
105
|
branch("profiles", [leaf("list"), leaf("show", "read", "profile"), leaf("validate", "read", "file")]),
|
|
47
|
-
leaf("plan"),
|
|
106
|
+
leaf("plan", "mutation"),
|
|
48
107
|
leaf("start", "mutation", void 0, "authority"),
|
|
49
108
|
leaf("list"),
|
|
50
109
|
leaf("show", "read", "workday"),
|
|
@@ -56,6 +115,14 @@ const TREESEED_COMMAND_TREE_V1 = {
|
|
|
56
115
|
branch("schedules", [leaf("list"), leaf("show", "read", "schedule"), leaf("plan"), leaf("start", "mutation", void 0, "authority"), leaf("pause", "mutation", "schedule", "authority"), leaf("resume", "mutation", "schedule", "authority"), leaf("retire", "mutation", "schedule", "destructive")])
|
|
57
116
|
]),
|
|
58
117
|
branch("assignments", [leaf("list"), leaf("show", "read", "assignment"), leaf("explain", "read", "assignment"), leaf("watch", "read", "assignment"), leaf("retry", "mutation", "assignment", "authority"), leaf("cancel", "mutation", "assignment", "destructive"), leaf("artifacts", "read", "assignment")]),
|
|
118
|
+
branch("projects", [branch("treedx", [
|
|
119
|
+
leaf("show", "read", "project"),
|
|
120
|
+
leaf("bind", "mutation", "project"),
|
|
121
|
+
leaf("status", "read", "project"),
|
|
122
|
+
leaf("diagnose", "read", "project"),
|
|
123
|
+
leaf("capabilities", "read", "project"),
|
|
124
|
+
branch("workspaces", [leaf("list", "read", "project"), leaf("show", "read", "workspace"), leaf("abandon", "mutation", "workspace", "destructive")])
|
|
125
|
+
])]),
|
|
59
126
|
leaf("save", "mutation"),
|
|
60
127
|
leaf("stage", "mutation", void 0, "authority"),
|
|
61
128
|
leaf("release", "mutation", void 0, "production"),
|
|
@@ -63,6 +130,15 @@ const TREESEED_COMMAND_TREE_V1 = {
|
|
|
63
130
|
leaf("diagnose")
|
|
64
131
|
]
|
|
65
132
|
};
|
|
133
|
+
function attachExecution(nodes, parent = []) {
|
|
134
|
+
for (const node of nodes) {
|
|
135
|
+
const path = [...parent, node.segment];
|
|
136
|
+
if (node.nodeType === "branch") attachExecution(node.children, path);
|
|
137
|
+
else node.execution = operationBindings[path.join(" ")] ?? node.execution;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
attachExecution(commandTree.commands);
|
|
141
|
+
const TREESEED_COMMAND_TREE_V1 = commandTree;
|
|
66
142
|
function listCommandPaths(tree = TREESEED_COMMAND_TREE_V1) {
|
|
67
143
|
const paths = [];
|
|
68
144
|
const visit = (nodes, parent) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ControlPlaneOperationBinding } from './control-plane-operation.js';
|
|
1
2
|
export type CommandOperationKind = 'read' | 'mutation';
|
|
2
3
|
export type CommandExecutionMode = 'execute' | 'plan';
|
|
3
4
|
export type CommandErrorCategory = 'unknown_command' | 'invalid_input' | 'ambiguous_context' | 'authentication_required' | 'authorization_denied' | 'confirmation_required' | 'policy_blocked' | 'stale_preflight' | 'conflict' | 'not_found' | 'provider_unavailable' | 'rate_limited' | 'internal_error';
|
|
@@ -19,6 +20,31 @@ export interface CommandAuthorizationDescriptor {
|
|
|
19
20
|
capability: string;
|
|
20
21
|
confirmation: 'never' | 'destructive' | 'credential' | 'authority' | 'production' | 'irreversible';
|
|
21
22
|
}
|
|
23
|
+
export type CommandInputSource = 'argument' | 'context' | 'option';
|
|
24
|
+
export type CommandInputTarget = 'path' | 'query' | 'body';
|
|
25
|
+
export interface CommandInputBinding {
|
|
26
|
+
field: string;
|
|
27
|
+
source: CommandInputSource;
|
|
28
|
+
name: string;
|
|
29
|
+
target: CommandInputTarget;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
transform?: 'identity' | 'integer' | 'csv';
|
|
32
|
+
}
|
|
33
|
+
export type CommandExecutionBinding = {
|
|
34
|
+
kind: 'operation';
|
|
35
|
+
operationId: `${string}.${string}`;
|
|
36
|
+
input: CommandInputBinding[];
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'protocol';
|
|
39
|
+
handlerId: `protocol.${string}`;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'local';
|
|
42
|
+
handlerId: `local.${string}`;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'unavailable';
|
|
45
|
+
code: string;
|
|
46
|
+
reason: string;
|
|
47
|
+
};
|
|
22
48
|
export interface CommandLeafDescriptor {
|
|
23
49
|
segment: string;
|
|
24
50
|
description: string;
|
|
@@ -27,6 +53,7 @@ export interface CommandLeafDescriptor {
|
|
|
27
53
|
options?: CommandOptionDescriptor[];
|
|
28
54
|
authorization?: CommandAuthorizationDescriptor;
|
|
29
55
|
resultSchemaId: string;
|
|
56
|
+
execution: CommandExecutionBinding;
|
|
30
57
|
}
|
|
31
58
|
export interface CommandBranchDescriptor {
|
|
32
59
|
segment: string;
|
|
@@ -76,4 +103,5 @@ export interface CommandTreeDiagnostic {
|
|
|
76
103
|
message: string;
|
|
77
104
|
}
|
|
78
105
|
export declare function validateCommandTree(tree: CommandTreeDescriptor): CommandTreeDiagnostic[];
|
|
106
|
+
export declare function validateCommandOperationBindings(tree: CommandTreeDescriptor, operations: readonly ControlPlaneOperationBinding<any, any, any, any>[]): CommandTreeDiagnostic[];
|
|
79
107
|
export declare function createCommandResult<TResult>(input: Omit<CommandResultEnvelope<TResult>, 'schemaVersion'>): CommandResultEnvelope<TResult>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ZodUndefined } from "zod";
|
|
1
2
|
const SEGMENT = /^[a-z][a-z0-9]*$/;
|
|
2
3
|
const FORBIDDEN_AGENT_MANAGEMENT_OPTIONS = /* @__PURE__ */ new Set([
|
|
3
4
|
"--commit",
|
|
@@ -31,6 +32,17 @@ function validateCommandTree(tree) {
|
|
|
31
32
|
}
|
|
32
33
|
if ("children" in raw) diagnostics.push({ code: "command_node_ambiguous", path: diagnosticPath, message: "Leaf command nodes cannot contain child commands." });
|
|
33
34
|
if (!node.resultSchemaId.trim()) diagnostics.push({ code: "result_schema_required", path: `${diagnosticPath}.resultSchemaId`, message: "Leaf commands require a stable result schema." });
|
|
35
|
+
if (!node.execution) diagnostics.push({ code: "command_execution_required", path: `${diagnosticPath}.execution`, message: "Every leaf must declare one authoritative execution binding." });
|
|
36
|
+
if (node.execution?.kind === "operation") {
|
|
37
|
+
const targets = /* @__PURE__ */ new Set();
|
|
38
|
+
for (const binding of node.execution.input) {
|
|
39
|
+
const key = `${binding.target}.${binding.field}`;
|
|
40
|
+
if (targets.has(key)) diagnostics.push({ code: "command_input_target_duplicate", path: `${diagnosticPath}.execution.input`, message: `Duplicate command input target ${key}.` });
|
|
41
|
+
targets.add(key);
|
|
42
|
+
if (!binding.field.trim() || !binding.name.trim()) diagnostics.push({ code: "command_input_binding_invalid", path: `${diagnosticPath}.execution.input`, message: "Command input bindings require field and source names." });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (node.execution?.kind === "unavailable" && (!node.execution.code.trim() || !node.execution.reason.trim())) diagnostics.push({ code: "command_unavailable_reason_required", path: `${diagnosticPath}.execution`, message: "Unavailable commands require a stable code and explanation." });
|
|
34
46
|
const optionNames = /* @__PURE__ */ new Set();
|
|
35
47
|
for (const option of node.options ?? []) {
|
|
36
48
|
if (optionNames.has(option.name)) diagnostics.push({ code: "command_option_duplicate", path: `${diagnosticPath}.options.${index}`, message: `Duplicate option ${option.name}.` });
|
|
@@ -44,10 +56,47 @@ function validateCommandTree(tree) {
|
|
|
44
56
|
visit(tree.commands, []);
|
|
45
57
|
return diagnostics;
|
|
46
58
|
}
|
|
59
|
+
function validateCommandOperationBindings(tree, operations) {
|
|
60
|
+
const diagnostics = [];
|
|
61
|
+
const catalog = new Map(operations.map((operation) => [operation.descriptor.operationId, operation]));
|
|
62
|
+
const visit = (nodes, parent) => {
|
|
63
|
+
for (const node of nodes) {
|
|
64
|
+
const path = [...parent, node.segment];
|
|
65
|
+
if (node.nodeType === "branch") {
|
|
66
|
+
visit(node.children, path);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (node.execution.kind !== "operation") continue;
|
|
70
|
+
const binding = catalog.get(node.execution.operationId);
|
|
71
|
+
const diagnosticPath = `commands.${path.join(".")}.execution`;
|
|
72
|
+
if (!binding) {
|
|
73
|
+
diagnostics.push({ code: "command_operation_unknown", path: diagnosticPath, message: `Unknown control-plane operation ${node.execution.operationId}.` });
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (!binding.descriptor.surfaces.includes("cli")) diagnostics.push({ code: "command_operation_surface_missing", path: diagnosticPath, message: `Operation ${node.execution.operationId} does not declare the CLI surface.` });
|
|
77
|
+
if (binding.descriptor.kind !== node.kind) diagnostics.push({ code: "command_operation_kind_mismatch", path: diagnosticPath, message: `Command and operation ${node.execution.operationId} disagree about mutation behavior.` });
|
|
78
|
+
const expectedConfirmation = binding.descriptor.confirmation === "input_required" ? binding.descriptor.riskClass : "never";
|
|
79
|
+
if ((node.authorization?.confirmation ?? "never") !== expectedConfirmation) diagnostics.push({ code: "command_operation_confirmation_mismatch", path: diagnosticPath, message: `Command and operation ${node.execution.operationId} disagree about confirmation.` });
|
|
80
|
+
const shapes = {
|
|
81
|
+
path: "shape" in binding.schema.path ? Object.keys(binding.schema.path.shape) : null,
|
|
82
|
+
query: "shape" in binding.schema.query ? Object.keys(binding.schema.query.shape) : null,
|
|
83
|
+
body: "shape" in binding.schema.body ? Object.keys(binding.schema.body.shape) : null
|
|
84
|
+
};
|
|
85
|
+
for (const input of node.execution.input) {
|
|
86
|
+
const keys = shapes[input.target];
|
|
87
|
+
const undefinedSchema = binding.schema[input.target] instanceof ZodUndefined;
|
|
88
|
+
if (keys !== null && !keys.includes(input.field) || undefinedSchema) diagnostics.push({ code: "command_operation_input_unknown", path: `${diagnosticPath}.input.${input.target}.${input.field}`, message: `Operation ${node.execution.operationId} does not accept ${input.target} field ${input.field}.` });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
visit(tree.commands, []);
|
|
93
|
+
return diagnostics.sort((left, right) => `${left.path}:${left.code}`.localeCompare(`${right.path}:${right.code}`));
|
|
94
|
+
}
|
|
47
95
|
function createCommandResult(input) {
|
|
48
96
|
return { schemaVersion: "treeseed.command-result/v1", ...input };
|
|
49
97
|
}
|
|
50
98
|
export {
|
|
51
99
|
createCommandResult,
|
|
100
|
+
validateCommandOperationBindings,
|
|
52
101
|
validateCommandTree
|
|
53
102
|
};
|
|
@@ -27,6 +27,12 @@ export interface ControlPlaneConcurrencyContract {
|
|
|
27
27
|
readHeader: 'ETag';
|
|
28
28
|
writeHeader: 'If-Match';
|
|
29
29
|
}
|
|
30
|
+
export interface ControlPlaneUpstreamBinding {
|
|
31
|
+
service: 'treedx';
|
|
32
|
+
operationId: string;
|
|
33
|
+
contractVersion: string;
|
|
34
|
+
contractDigest: `sha256:${string}`;
|
|
35
|
+
}
|
|
30
36
|
export interface ControlPlaneOperationDescriptor {
|
|
31
37
|
schemaVersion: typeof CONTROL_PLANE_OPERATION_SCHEMA_VERSION;
|
|
32
38
|
operationId: `${string}.${string}`;
|
|
@@ -47,6 +53,7 @@ export interface ControlPlaneOperationDescriptor {
|
|
|
47
53
|
audited: boolean;
|
|
48
54
|
receipt: boolean;
|
|
49
55
|
redactedPaths: string[];
|
|
56
|
+
upstream?: ControlPlaneUpstreamBinding;
|
|
50
57
|
}
|
|
51
58
|
export interface ControlPlaneOperationInput<TPath = Record<string, never>, TQuery = Record<string, never>, TBody = undefined> {
|
|
52
59
|
path: TPath;
|
|
@@ -52,6 +52,9 @@ function validateControlPlaneCatalog(catalog) {
|
|
|
52
52
|
}
|
|
53
53
|
for (const duplicate of duplicates(operation.surfaces)) diagnostics.push({ code: "surface_duplicate", path: `${path}.surfaces`, message: `Duplicate operation surface ${duplicate}.` });
|
|
54
54
|
for (const duplicate of duplicates(operation.oauthScopes)) diagnostics.push({ code: "oauth_scope_duplicate", path: `${path}.oauthScopes`, message: `Duplicate OAuth scope ${duplicate}.` });
|
|
55
|
+
if (operation.upstream && (!operation.upstream.operationId || !/^sha256:[0-9a-f]{64}$/u.test(operation.upstream.contractDigest))) {
|
|
56
|
+
diagnostics.push({ code: "upstream_binding_invalid", path: `${path}.upstream`, message: "Upstream bindings require an operation ID and exact SHA-256 contract digest." });
|
|
57
|
+
}
|
|
55
58
|
const elevatedRisk = operation.riskClass !== "ordinary";
|
|
56
59
|
if (elevatedRisk !== (operation.confirmation === "input_required")) {
|
|
57
60
|
diagnostics.push({ code: "confirmation_policy_invalid", path: `${path}.confirmation`, message: "Elevated-risk operations require input_required; ordinary operations must not." });
|