@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,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const repositorySchema = z.object({
|
|
3
|
+
key: z.string().min(1),
|
|
4
|
+
project: z.string().min(1),
|
|
5
|
+
role: z.enum(["primary", "library", "fixture"]),
|
|
6
|
+
gitUrl: z.string().min(1),
|
|
7
|
+
defaultBranch: z.string().min(1).default("main"),
|
|
8
|
+
repositoryPolicy: z.object({ stagingBranch: z.string().min(1).optional() }).passthrough().optional()
|
|
9
|
+
}).passthrough();
|
|
10
|
+
const projectSchema = z.object({
|
|
11
|
+
key: z.string().min(1),
|
|
12
|
+
slug: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),
|
|
13
|
+
kind: z.string().optional(),
|
|
14
|
+
primaryRepository: z.string().min(1).optional(),
|
|
15
|
+
libraryRepository: z.string().min(1).optional()
|
|
16
|
+
}).passthrough().superRefine((project, context) => {
|
|
17
|
+
if (!project.primaryRepository && project.kind !== "content") context.addIssue({ code: "custom", path: ["primaryRepository"], message: "Software projects require a primary source repository." });
|
|
18
|
+
if (project.kind === "content" && !project.libraryRepository) context.addIssue({ code: "custom", path: ["libraryRepository"], message: "Content projects require a library repository." });
|
|
19
|
+
});
|
|
20
|
+
const inventorySchema = z.object({
|
|
21
|
+
schemaVersion: z.string().min(1),
|
|
22
|
+
resources: z.object({
|
|
23
|
+
projects: z.array(projectSchema),
|
|
24
|
+
repositories: z.array(repositorySchema)
|
|
25
|
+
}).passthrough()
|
|
26
|
+
}).passthrough();
|
|
27
|
+
const profileSchema = z.object({
|
|
28
|
+
schemaVersion: z.literal("treeseed.platform-profile/v1"),
|
|
29
|
+
id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),
|
|
30
|
+
extends: z.array(z.string()).default([]),
|
|
31
|
+
sources: z.object({ projects: z.array(z.string()).default([]) }).default({ projects: [] }),
|
|
32
|
+
runtime: z.object({ targets: z.array(z.string()).default([]) }).passthrough().default({ targets: [] })
|
|
33
|
+
}).passthrough();
|
|
34
|
+
const worksetSelectionSchema = z.object({
|
|
35
|
+
profiles: z.array(z.string()).default([]),
|
|
36
|
+
projects: z.array(z.string()).default([]),
|
|
37
|
+
exclude: z.array(z.string()).default([])
|
|
38
|
+
});
|
|
39
|
+
const worksetEntrySchema = z.object({
|
|
40
|
+
project: z.string(),
|
|
41
|
+
repository: z.string(),
|
|
42
|
+
gitUrl: z.string(),
|
|
43
|
+
branch: z.string(),
|
|
44
|
+
commit: z.string().regex(/^[0-9a-f]{40}$/u),
|
|
45
|
+
path: z.string(),
|
|
46
|
+
action: z.enum(["clone", "fast-forward", "noop", "blocked"]),
|
|
47
|
+
blockers: z.array(z.string()).default([])
|
|
48
|
+
});
|
|
49
|
+
const worksetPlanSchema = z.object({
|
|
50
|
+
schemaVersion: z.literal("treeseed.platform-workset-plan/v1"),
|
|
51
|
+
root: z.string(),
|
|
52
|
+
inventoryPath: z.string(),
|
|
53
|
+
inventoryDigest: z.string(),
|
|
54
|
+
selection: worksetSelectionSchema,
|
|
55
|
+
entries: z.array(worksetEntrySchema),
|
|
56
|
+
ok: z.boolean()
|
|
57
|
+
});
|
|
58
|
+
const worksetReceiptSchema = z.object({
|
|
59
|
+
schemaVersion: z.literal("treeseed.platform-workset-receipt/v1"),
|
|
60
|
+
planDigest: z.string(),
|
|
61
|
+
inventoryDigest: z.string(),
|
|
62
|
+
entries: z.array(worksetEntrySchema.omit({ action: true, blockers: true }).extend({ action: z.enum(["clone", "fast-forward", "noop"]) }))
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
inventorySchema,
|
|
66
|
+
profileSchema,
|
|
67
|
+
projectSchema,
|
|
68
|
+
repositorySchema,
|
|
69
|
+
worksetEntrySchema,
|
|
70
|
+
worksetPlanSchema,
|
|
71
|
+
worksetReceiptSchema,
|
|
72
|
+
worksetSelectionSchema
|
|
73
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PlatformDiagnostic } from './schemas.js';
|
|
2
|
+
export interface PlatformVerification {
|
|
3
|
+
schemaVersion: 'treeseed.platform-verification/v1';
|
|
4
|
+
root: string;
|
|
5
|
+
digest: string;
|
|
6
|
+
ok: boolean;
|
|
7
|
+
diagnostics: PlatformDiagnostic[];
|
|
8
|
+
}
|
|
9
|
+
export declare function verifyPlatformRepository(root?: string): PlatformVerification;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, lstatSync, readFileSync } from "node:fs";
|
|
3
|
+
import { extname, relative, resolve } from "node:path";
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
5
|
+
import { parse } from "yaml";
|
|
6
|
+
import { hostTemplateSchema, integrationLockSchema } from "./contracts.js";
|
|
7
|
+
import { inventorySchema, profileSchema } from "./schemas.js";
|
|
8
|
+
const allowedRoots = /* @__PURE__ */ new Set([".github", "config", "docs", "profiles", "seeds", "templates"]);
|
|
9
|
+
const allowedFiles = /* @__PURE__ */ new Set([".gitignore", "AGENTS.md", "LICENSE", "LICENSE.md", "README.md", "skills-lock.json", "treeseed.site.yaml"]);
|
|
10
|
+
const allowedExtensions = /* @__PURE__ */ new Set([".md", ".yaml", ".yml", ".json", ".lock", ".toml"]);
|
|
11
|
+
const forbiddenExtensions = /* @__PURE__ */ new Set([".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".py", ".sh", ".go", ".rs", ".java"]);
|
|
12
|
+
const personalPath = /(?:^|[\s'"`:=])(?:\/home\/[^/\s]+|\/Users\/[^/\s]+|[A-Za-z]:\\Users\\[^\\\s]+)/u;
|
|
13
|
+
function semanticDiagnostics(root, tracked) {
|
|
14
|
+
const diagnostics = [];
|
|
15
|
+
const document = (path) => parse(readFileSync(resolve(root, path), "utf8"));
|
|
16
|
+
const report = (code, path, message) => diagnostics.push({ code, path, message });
|
|
17
|
+
const safe = (path, load) => {
|
|
18
|
+
try {
|
|
19
|
+
return load();
|
|
20
|
+
} catch (error) {
|
|
21
|
+
report("declaration_invalid", path, error instanceof Error ? error.message : String(error));
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const profiles = /* @__PURE__ */ new Map();
|
|
26
|
+
for (const path of [...tracked].filter((value) => /^profiles\/[^/]+\.ya?ml$/u.test(value))) {
|
|
27
|
+
const profile = safe(path, () => profileSchema.parse(document(path)));
|
|
28
|
+
if (profile) profiles.set(profile.id, profile);
|
|
29
|
+
}
|
|
30
|
+
const sitePath = "treeseed.site.yaml";
|
|
31
|
+
if (!tracked.has(sitePath)) return diagnostics;
|
|
32
|
+
const site = safe(sitePath, () => document(sitePath));
|
|
33
|
+
if (!site) return diagnostics;
|
|
34
|
+
const development = site.development;
|
|
35
|
+
const inventoryPath = development?.local?.inventory?.path;
|
|
36
|
+
let projectSlugs = /* @__PURE__ */ new Set();
|
|
37
|
+
if (development?.local?.inventory?.source !== "seed" || !inventoryPath || !tracked.has(inventoryPath)) {
|
|
38
|
+
report("inventory_reference_invalid", sitePath, "The local inventory must reference a tracked seed declaration.");
|
|
39
|
+
} else {
|
|
40
|
+
const inventory = safe(inventoryPath, () => inventorySchema.parse(document(inventoryPath)));
|
|
41
|
+
if (inventory) projectSlugs = new Set(inventory.resources.projects.map((project) => project.slug));
|
|
42
|
+
}
|
|
43
|
+
for (const [id, profile] of profiles) {
|
|
44
|
+
for (const project of profile.sources.projects) if (!projectSlugs.has(project)) report("profile_project_unknown", `profiles/${id}.yaml`, `Profile project ${project} is absent from the portable inventory.`);
|
|
45
|
+
for (const parent of profile.extends) if (!profiles.has(parent)) report("profile_parent_unknown", `profiles/${id}.yaml`, `Profile parent ${parent} does not exist.`);
|
|
46
|
+
}
|
|
47
|
+
const integrations = site.integrations;
|
|
48
|
+
const integrationDigests = /* @__PURE__ */ new Map();
|
|
49
|
+
for (const path of Object.values(integrations ?? {}).filter((value) => value.includes("/integrations/"))) {
|
|
50
|
+
if (!tracked.has(path)) {
|
|
51
|
+
report("integration_reference_invalid", sitePath, `Integration lock ${path} is not tracked.`);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const lock = safe(path, () => integrationLockSchema.parse(document(path)));
|
|
55
|
+
if (!lock) continue;
|
|
56
|
+
const digest = `sha256:${createHash("sha256").update(JSON.stringify(lock.components)).digest("hex")}`;
|
|
57
|
+
if (digest !== lock.digest) report("integration_digest_mismatch", path, "Integration lock digest does not bind its exact component list.");
|
|
58
|
+
integrationDigests.set(lock.release.replace(/-\d+$/u, ""), lock.digest);
|
|
59
|
+
}
|
|
60
|
+
for (const path of [...tracked].filter((value) => /^config\/hosts\/[^/]+\.ya?ml$/u.test(value))) {
|
|
61
|
+
const host = safe(path, () => hostTemplateSchema.parse(document(path)));
|
|
62
|
+
if (!host) continue;
|
|
63
|
+
for (const profile of host.profiles) if (!profiles.has(profile)) report("host_profile_unknown", path, `Host template profile ${profile} does not exist.`);
|
|
64
|
+
if (![...integrationDigests.values()].includes(host.integration.digest)) report("host_integration_unknown", path, "Host template integration digest is not present in a referenced integration lock.");
|
|
65
|
+
}
|
|
66
|
+
const production = site.production;
|
|
67
|
+
if (production && production.mutation !== "blocked") report("production_not_fail_closed", sitePath, "Production mutation must remain blocked until promotion gates pass.");
|
|
68
|
+
if (production?.topology && !tracked.has(production.topology)) report("topology_reference_invalid", sitePath, "Production topology must reference a tracked declaration.");
|
|
69
|
+
return diagnostics;
|
|
70
|
+
}
|
|
71
|
+
function verifyPlatformRepository(root = process.cwd()) {
|
|
72
|
+
const absoluteRoot = resolve(root);
|
|
73
|
+
const listed = execFileSync("git", ["ls-files", "-z"], { cwd: absoluteRoot, encoding: "utf8" }).split("\0").filter(Boolean).sort();
|
|
74
|
+
const diagnostics = [];
|
|
75
|
+
const hash = createHash("sha256");
|
|
76
|
+
for (const path of listed) {
|
|
77
|
+
const fullPath = resolve(absoluteRoot, path);
|
|
78
|
+
if (!fullPath.startsWith(`${absoluteRoot}/`)) {
|
|
79
|
+
diagnostics.push({ code: "path_not_portable", path, message: "Tracked paths must stay beneath the repository and cannot be symbolic links." });
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (!existsSync(fullPath)) {
|
|
83
|
+
diagnostics.push({ code: "tracked_file_missing", path, message: "Tracked Platform files must exist in the working tree." });
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (lstatSync(fullPath).isSymbolicLink()) {
|
|
87
|
+
diagnostics.push({ code: "path_not_portable", path, message: "Tracked paths must stay beneath the repository and cannot be symbolic links." });
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const rootSegment = path.split("/")[0];
|
|
91
|
+
const extension = extname(path);
|
|
92
|
+
if (!allowedFiles.has(path) && !allowedRoots.has(rootSegment)) diagnostics.push({ code: "content_root_forbidden", path, message: "Platform may contain only declarations, documentation, locks, and GitHub configuration." });
|
|
93
|
+
if (forbiddenExtensions.has(extension)) diagnostics.push({ code: "implementation_forbidden", path, message: "Executable implementation belongs in its owning package." });
|
|
94
|
+
if (!allowedFiles.has(path) && !allowedExtensions.has(extension)) diagnostics.push({ code: "file_type_forbidden", path, message: "This tracked file type is outside the declarative Platform boundary." });
|
|
95
|
+
const source = readFileSync(fullPath);
|
|
96
|
+
hash.update(relative(absoluteRoot, fullPath)).update("\0").update(source);
|
|
97
|
+
if (personalPath.test(source.toString("utf8"))) diagnostics.push({ code: "personal_path_forbidden", path, message: "Committed home-directory paths are forbidden." });
|
|
98
|
+
}
|
|
99
|
+
diagnostics.push(...semanticDiagnostics(absoluteRoot, new Set(listed)));
|
|
100
|
+
return { schemaVersion: "treeseed.platform-verification/v1", root: absoluteRoot, digest: `sha256:${hash.digest("hex")}`, ok: diagnostics.length === 0, diagnostics };
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
verifyPlatformRepository
|
|
104
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Inventory, type PlatformProfile, type WorksetPlan, type WorksetReceipt, type WorksetSelection } from './schemas.js';
|
|
2
|
+
export interface GitRunner {
|
|
3
|
+
run(cwd: string, args: string[]): string;
|
|
4
|
+
}
|
|
5
|
+
export interface RemoteObserver {
|
|
6
|
+
observe(url: string, branch: string): string;
|
|
7
|
+
isAncestor(url: string, base: string, target: string): boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PlanWorksetInput {
|
|
10
|
+
root: string;
|
|
11
|
+
inventoryPath: string;
|
|
12
|
+
inventoryDigest: string;
|
|
13
|
+
inventory: Inventory;
|
|
14
|
+
profiles?: PlatformProfile[];
|
|
15
|
+
selection?: Partial<WorksetSelection>;
|
|
16
|
+
git?: GitRunner;
|
|
17
|
+
remote?: RemoteObserver;
|
|
18
|
+
}
|
|
19
|
+
export declare function planPlatformWorkset(input: PlanWorksetInput): WorksetPlan;
|
|
20
|
+
export declare function applyPlatformWorkset(plan: WorksetPlan, git?: GitRunner, remote?: RemoteObserver): WorksetReceipt;
|
|
21
|
+
export declare function readWorksetReceipt(path: string): WorksetReceipt;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
5
|
+
import { execFileSync } from "node:child_process";
|
|
6
|
+
import { worksetReceiptSchema } from "./schemas.js";
|
|
7
|
+
import { resolveProfileProjects } from "./inventory.js";
|
|
8
|
+
const systemGit = { run: (cwd, args) => execFileSync("git", args, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim() };
|
|
9
|
+
const systemRemote = { observe: (url, branch) => {
|
|
10
|
+
const output = execFileSync("git", ["ls-remote", "--exit-code", url, `refs/heads/${branch}`], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
11
|
+
const commit = output.split(/\s+/u)[0];
|
|
12
|
+
if (!commit) throw new Error(`Remote branch ${branch} was not found at ${url}.`);
|
|
13
|
+
return commit;
|
|
14
|
+
}, isAncestor: (url, base, target) => {
|
|
15
|
+
const temporary = mkdtempSync(resolve(tmpdir(), "platform-workset-"));
|
|
16
|
+
try {
|
|
17
|
+
execFileSync("git", ["init", "--bare", temporary], { stdio: "ignore" });
|
|
18
|
+
execFileSync("git", ["fetch", "--quiet", "--filter=blob:none", "--no-tags", url, target], { cwd: temporary, stdio: "ignore" });
|
|
19
|
+
execFileSync("git", ["merge-base", "--is-ancestor", base, target], { cwd: temporary, stdio: "ignore" });
|
|
20
|
+
return true;
|
|
21
|
+
} catch {
|
|
22
|
+
return false;
|
|
23
|
+
} finally {
|
|
24
|
+
rmSync(temporary, { recursive: true, force: true });
|
|
25
|
+
}
|
|
26
|
+
} };
|
|
27
|
+
const digest = (value) => `sha256:${createHash("sha256").update(JSON.stringify(value)).digest("hex")}`;
|
|
28
|
+
const normalizedRemote = (url) => url.replace(/^git@github\.com:/u, "https://github.com/").replace(/\.git$/u, "").toLowerCase();
|
|
29
|
+
function safePath(root, slug) {
|
|
30
|
+
const path = resolve(root, "packages", slug);
|
|
31
|
+
if (!path.startsWith(`${resolve(root)}/packages/`)) throw new Error(`Project ${slug} escapes packages/.`);
|
|
32
|
+
return path;
|
|
33
|
+
}
|
|
34
|
+
function inspectCheckout(entry, git, remote) {
|
|
35
|
+
if (!existsSync(entry.path)) return { ...entry, action: "clone", blockers: [] };
|
|
36
|
+
const blockers = [];
|
|
37
|
+
if (lstatSync(entry.path).isSymbolicLink()) blockers.push("checkout_path_is_symlink");
|
|
38
|
+
try {
|
|
39
|
+
if (realpathSync(entry.path) !== entry.path) blockers.push("checkout_path_not_canonical");
|
|
40
|
+
if (normalizedRemote(git.run(entry.path, ["remote", "get-url", "origin"])) !== normalizedRemote(entry.gitUrl)) blockers.push("origin_mismatch");
|
|
41
|
+
if (git.run(entry.path, ["status", "--porcelain"])) blockers.push("checkout_dirty");
|
|
42
|
+
if (git.run(entry.path, ["branch", "--show-current"]) !== entry.branch) blockers.push("branch_mismatch");
|
|
43
|
+
const current = git.run(entry.path, ["rev-parse", "HEAD"]);
|
|
44
|
+
if (current === entry.commit) return { ...entry, action: blockers.length ? "blocked" : "noop", blockers };
|
|
45
|
+
if (!remote.isAncestor(entry.gitUrl, current, entry.commit)) blockers.push("remote_history_diverged");
|
|
46
|
+
return { ...entry, action: blockers.length ? "blocked" : "fast-forward", blockers };
|
|
47
|
+
} catch {
|
|
48
|
+
blockers.push("checkout_not_safe_git_repository");
|
|
49
|
+
return { ...entry, action: "blocked", blockers: [...new Set(blockers)] };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function planPlatformWorkset(input) {
|
|
53
|
+
const selection = { profiles: input.selection?.profiles ?? [], projects: input.selection?.projects ?? [], exclude: input.selection?.exclude ?? [] };
|
|
54
|
+
const projectCatalog = new Map(input.inventory.resources.projects.map((project) => [project.slug, project]));
|
|
55
|
+
const profileProjects = resolveProfileProjects(input.profiles ?? [], selection.profiles);
|
|
56
|
+
const requested = new Set(selection.projects.length || profileProjects.length ? [...profileProjects, ...selection.projects] : [...projectCatalog.keys()]);
|
|
57
|
+
selection.exclude.forEach((slug) => requested.delete(slug));
|
|
58
|
+
requested.delete("platform");
|
|
59
|
+
for (const slug of requested) {
|
|
60
|
+
const project = projectCatalog.get(slug);
|
|
61
|
+
if (project?.kind === "content" && !project.primaryRepository) requested.delete(slug);
|
|
62
|
+
}
|
|
63
|
+
const repositories = new Map(input.inventory.resources.repositories.map((repository) => [repository.key, repository]));
|
|
64
|
+
const entries = [...requested].sort().map((slug) => {
|
|
65
|
+
const project = projectCatalog.get(slug);
|
|
66
|
+
if (!project) throw new Error(`Unknown project ${slug}.`);
|
|
67
|
+
const repository = project.primaryRepository ? repositories.get(project.primaryRepository) : void 0;
|
|
68
|
+
if (!repository || repository.role !== "primary") throw new Error(`Project ${slug} has no primary source repository.`);
|
|
69
|
+
const branch = repository.repositoryPolicy?.stagingBranch ?? repository.defaultBranch;
|
|
70
|
+
const remote = input.remote ?? systemRemote;
|
|
71
|
+
const commit = remote.observe(repository.gitUrl, branch);
|
|
72
|
+
return inspectCheckout({ project: slug, repository: repository.key, gitUrl: repository.gitUrl, branch, commit, path: safePath(input.root, slug) }, input.git ?? systemGit, remote);
|
|
73
|
+
});
|
|
74
|
+
return { schemaVersion: "treeseed.platform-workset-plan/v1", root: resolve(input.root), inventoryPath: input.inventoryPath, inventoryDigest: input.inventoryDigest, selection, entries, ok: entries.every((entry) => entry.action !== "blocked") };
|
|
75
|
+
}
|
|
76
|
+
function applyPlatformWorkset(plan, git = systemGit, remote = systemRemote) {
|
|
77
|
+
if (!plan.ok || plan.entries.some((entry) => entry.action === "blocked")) throw new Error("Blocked workset plans cannot be applied.");
|
|
78
|
+
for (const entry of plan.entries) {
|
|
79
|
+
if (remote.observe(entry.gitUrl, entry.branch) !== entry.commit) throw new Error(`Remote branch moved after planning for ${entry.project}; create a new plan.`);
|
|
80
|
+
}
|
|
81
|
+
for (const entry of plan.entries) {
|
|
82
|
+
if (entry.action === "clone") {
|
|
83
|
+
mkdirSync(dirname(entry.path), { recursive: true });
|
|
84
|
+
git.run(plan.root, ["clone", "--branch", entry.branch, "--single-branch", entry.gitUrl, entry.path]);
|
|
85
|
+
} else if (entry.action === "fast-forward") {
|
|
86
|
+
git.run(entry.path, ["fetch", "origin", entry.branch]);
|
|
87
|
+
git.run(entry.path, ["merge", "--ff-only", entry.commit]);
|
|
88
|
+
}
|
|
89
|
+
const actual = git.run(entry.path, ["rev-parse", "HEAD"]);
|
|
90
|
+
if (actual !== entry.commit) throw new Error(`Checkout ${entry.project} did not converge to ${entry.commit}.`);
|
|
91
|
+
}
|
|
92
|
+
const receipt = worksetReceiptSchema.parse({ schemaVersion: "treeseed.platform-workset-receipt/v1", planDigest: digest(plan), inventoryDigest: plan.inventoryDigest, entries: plan.entries.map(({ blockers: _blockers, ...entry }) => ({ ...entry, action: entry.action === "blocked" ? "noop" : entry.action })) });
|
|
93
|
+
const receiptPath = resolve(plan.root, ".treeseed", "worksets", `${receipt.planDigest.slice("sha256:".length)}.json`);
|
|
94
|
+
mkdirSync(dirname(receiptPath), { recursive: true });
|
|
95
|
+
writeFileSync(receiptPath, `${JSON.stringify(receipt, null, 2)}
|
|
96
|
+
`, { mode: 384 });
|
|
97
|
+
return receipt;
|
|
98
|
+
}
|
|
99
|
+
function readWorksetReceipt(path) {
|
|
100
|
+
return worksetReceiptSchema.parse(JSON.parse(readFileSync(path, "utf8")));
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
applyPlatformWorkset,
|
|
104
|
+
planPlatformWorkset,
|
|
105
|
+
readWorksetReceipt
|
|
106
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
async function encryptGitHubActionsSecret(value, providerPublicKey) {
|
|
2
|
+
const { default: sodium } = await import("libsodium-wrappers-sumo");
|
|
3
|
+
await sodium.ready;
|
|
4
|
+
if (!value) throw new Error("GitHub Actions secret value is required.");
|
|
5
|
+
const key = sodium.from_base64(providerPublicKey, sodium.base64_variants.ORIGINAL);
|
|
6
|
+
if (key.length !== sodium.crypto_box_PUBLICKEYBYTES) throw new Error("Invalid GitHub public key.");
|
|
7
|
+
return sodium.to_base64(sodium.crypto_box_seal(value, key), sodium.base64_variants.ORIGINAL);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
encryptGitHubActionsSecret
|
|
11
|
+
};
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import type { CredentialAuthorityScheme, ServiceCapabilityType } from './service-provider-contracts.js';
|
|
2
2
|
export declare const PROVIDER_ADAPTER_KINDS: readonly ["repository-hosting", "workflow-execution", "workflow-configuration", "object-storage", "webhook-ingress"];
|
|
3
3
|
export type ProviderAdapterKind = (typeof PROVIDER_ADAPTER_KINDS)[number];
|
|
4
|
+
/** Bounded delivery requirements attached to a workflow-execution binding.
|
|
5
|
+
* Values and vault login material never belong in this declaration.
|
|
6
|
+
*/
|
|
7
|
+
export type WorkflowConfigurationDeclaration = {
|
|
8
|
+
workflowPath: string;
|
|
9
|
+
repositoryBindingId: string;
|
|
10
|
+
kind: 'secrets' | 'variables';
|
|
11
|
+
scope: 'repository' | 'environment';
|
|
12
|
+
environment?: string | null;
|
|
13
|
+
names: string[];
|
|
14
|
+
};
|
|
15
|
+
export type WorkflowConfigurationPolicy = {
|
|
16
|
+
workflowConfiguration: WorkflowConfigurationDeclaration[];
|
|
17
|
+
};
|
|
4
18
|
export type ProviderCredentialAuthority = {
|
|
5
19
|
id: string;
|
|
6
20
|
teamId: string;
|
|
@@ -9,7 +23,7 @@ export type ProviderCredentialAuthority = {
|
|
|
9
23
|
scheme: CredentialAuthorityScheme;
|
|
10
24
|
reference: string;
|
|
11
25
|
capabilities: ServiceCapabilityType[];
|
|
12
|
-
status: 'ready' | '
|
|
26
|
+
status: 'ready' | 'reauthorization-required' | 'revoked';
|
|
13
27
|
version: number;
|
|
14
28
|
};
|
|
15
29
|
export type ProjectRemoteRepositoryBinding = {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const secretScopeSchema: z.ZodObject<{
|
|
3
|
+
team: z.ZodString;
|
|
4
|
+
project: z.ZodString;
|
|
5
|
+
environment: z.ZodString;
|
|
6
|
+
purpose: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
project: string;
|
|
11
|
+
team: string;
|
|
12
|
+
purpose: string;
|
|
13
|
+
environment: string;
|
|
14
|
+
}, {
|
|
15
|
+
name: string;
|
|
16
|
+
project: string;
|
|
17
|
+
team: string;
|
|
18
|
+
purpose: string;
|
|
19
|
+
environment: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type SecretScope = z.infer<typeof secretScopeSchema>;
|
|
22
|
+
export declare const SECRET_CUSTODY_BACKENDS: readonly ["openbao", "os"];
|
|
23
|
+
export declare function canonicalSecretPath(input: SecretScope): string;
|
|
24
|
+
export type HostedSecretOperationBinding = {
|
|
25
|
+
subjectType: 'declaration' | 'plan' | 'rollback';
|
|
26
|
+
subjectDigest: string;
|
|
27
|
+
deploymentId: string;
|
|
28
|
+
stackId: string;
|
|
29
|
+
environment: 'staging' | 'production';
|
|
30
|
+
};
|
|
31
|
+
export declare function containsForbiddenPlaintextSecretMaterial(value: unknown, path?: string): string[];
|
|
32
|
+
export declare function canonicalHostedSecretOperationBinding(input: HostedSecretOperationBinding): string;
|
|
33
|
+
export declare function validateHostedSecretOperationBinding(value: unknown): value is HostedSecretOperationBinding;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const segment = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u);
|
|
3
|
+
const secretScopeSchema = z.object({
|
|
4
|
+
team: segment,
|
|
5
|
+
project: segment,
|
|
6
|
+
environment: segment,
|
|
7
|
+
purpose: segment,
|
|
8
|
+
name: segment
|
|
9
|
+
}).strict();
|
|
10
|
+
const SECRET_CUSTODY_BACKENDS = ["openbao", "os"];
|
|
11
|
+
function canonicalSecretPath(input) {
|
|
12
|
+
const s = secretScopeSchema.parse(input);
|
|
13
|
+
return `teams/${s.team}/projects/${s.project}/environments/${s.environment}/purposes/${s.purpose}/secrets/${s.name}`;
|
|
14
|
+
}
|
|
15
|
+
const FORBIDDEN_SECRET_KEYS = /(?:passphrase|password|plaintext|derivedKey|privateKey|apiToken|accessToken|secretValue|credentialValue)$/iu;
|
|
16
|
+
function containsForbiddenPlaintextSecretMaterial(value, path = "") {
|
|
17
|
+
if (!value || typeof value !== "object") return [];
|
|
18
|
+
const failures = [];
|
|
19
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
20
|
+
const nextPath = path ? `${path}.${key}` : key;
|
|
21
|
+
if (FORBIDDEN_SECRET_KEYS.test(key) && typeof entry === "string" && entry.trim()) failures.push(nextPath);
|
|
22
|
+
if (entry && typeof entry === "object") failures.push(...containsForbiddenPlaintextSecretMaterial(entry, nextPath));
|
|
23
|
+
}
|
|
24
|
+
return failures;
|
|
25
|
+
}
|
|
26
|
+
const digest = /^sha256:[a-f0-9]{64}$/u;
|
|
27
|
+
const identifier = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
|
|
28
|
+
function canonicalHostedSecretOperationBinding(input) {
|
|
29
|
+
return JSON.stringify({
|
|
30
|
+
subjectType: input.subjectType,
|
|
31
|
+
subjectDigest: input.subjectDigest,
|
|
32
|
+
deploymentId: input.deploymentId,
|
|
33
|
+
stackId: input.stackId,
|
|
34
|
+
environment: input.environment
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function validateHostedSecretOperationBinding(value) {
|
|
38
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
39
|
+
const binding = value;
|
|
40
|
+
return ["declaration", "plan", "rollback"].includes(String(binding.subjectType)) && digest.test(String(binding.subjectDigest)) && identifier.test(String(binding.deploymentId)) && identifier.test(String(binding.stackId)) && ["staging", "production"].includes(String(binding.environment));
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
SECRET_CUSTODY_BACKENDS,
|
|
44
|
+
canonicalHostedSecretOperationBinding,
|
|
45
|
+
canonicalSecretPath,
|
|
46
|
+
containsForbiddenPlaintextSecretMaterial,
|
|
47
|
+
secretScopeSchema,
|
|
48
|
+
validateHostedSecretOperationBinding
|
|
49
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const SERVICE_PROVIDER_IDS: readonly ["github", "cloudflare", "railway", "
|
|
2
|
-
export declare const SERVICE_CAPABILITY_TYPES: readonly ["repository-hosting", "workflow-execution", "
|
|
1
|
+
export declare const SERVICE_PROVIDER_IDS: readonly ["github", "cloudflare", "railway", "hyperstack"];
|
|
2
|
+
export declare const SERVICE_CAPABILITY_TYPES: readonly ["repository-hosting", "workflow-execution", "frontend-hosting", "backend-hosting", "dns-management", "object-storage", "state-encryption", "database-hosting", "capacity-runtime-hosting", "private-knowledge-index-hosting", "artifact-hosting", "ai-inference-hosting", "ai-training-hosting"];
|
|
3
3
|
export declare const SERVICE_CONNECTION_STATUSES: readonly ["draft", "active", "degraded", "validation-failed", "reentry-required", "reauthorization-required", "disconnected"];
|
|
4
4
|
export declare const SERVICE_CAPABILITY_STATUSES: readonly ["configured", "disabled", "blocked", "planned"];
|
|
5
5
|
export type ServiceProviderId = (typeof SERVICE_PROVIDER_IDS)[number];
|
|
@@ -11,6 +11,8 @@ export type ServiceFieldDefinition = {
|
|
|
11
11
|
label: string;
|
|
12
12
|
description: string;
|
|
13
13
|
required: boolean;
|
|
14
|
+
requiredForCapabilities?: ServiceCapabilityType[];
|
|
15
|
+
pattern?: string;
|
|
14
16
|
sensitive: boolean;
|
|
15
17
|
input: 'text' | 'password' | 'url';
|
|
16
18
|
placeholder?: string;
|
|
@@ -27,7 +29,7 @@ export type CredentialProfileDefinition = {
|
|
|
27
29
|
authoritySchemes?: CredentialAuthorityScheme[];
|
|
28
30
|
knowledgePageIds: string[];
|
|
29
31
|
};
|
|
30
|
-
export declare const CREDENTIAL_AUTHORITY_SCHEMES: readonly ["app-installation", "
|
|
32
|
+
export declare const CREDENTIAL_AUTHORITY_SCHEMES: readonly ["app-installation", "openbao"];
|
|
31
33
|
export type CredentialAuthorityScheme = (typeof CREDENTIAL_AUTHORITY_SCHEMES)[number];
|
|
32
34
|
export type ServiceCapabilityDefinition = {
|
|
33
35
|
type: ServiceCapabilityType;
|