@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,455 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AI_MODE_INTERNAL_PATH } from "./ai-mode.js";
|
|
3
|
+
import { postgresComponentRequirementSchema, postgresTopologySchema } from "./postgres/contracts.js";
|
|
4
|
+
const identifier = z.string().regex(/^[a-z][a-z0-9.-]{1,63}$/u);
|
|
5
|
+
const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/u);
|
|
6
|
+
const gitCommit = z.string().regex(/^[a-f0-9]{40}$/u);
|
|
7
|
+
const packageVersion = z.string().min(1).regex(/^[0-9][0-9A-Za-z.+:~-]*$/u);
|
|
8
|
+
const ociRepository = z.string().min(1).max(255).regex(
|
|
9
|
+
/^(?:(?:localhost|[a-z0-9]+(?:[.-][a-z0-9]+)+)(?::[1-9][0-9]{0,4})?\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/u,
|
|
10
|
+
"OCI repositories must be normalized lowercase names without a scheme, tag, digest, credentials, or traversal."
|
|
11
|
+
);
|
|
12
|
+
const localAlias = z.string().regex(
|
|
13
|
+
/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*\.localhost$/u,
|
|
14
|
+
"Host aliases must use the .localhost namespace."
|
|
15
|
+
);
|
|
16
|
+
const binding = z.string().regex(/^(?:\[[0-9a-f:]+\]|[^:]+):[1-9][0-9]{0,4}$/iu);
|
|
17
|
+
const httpsUrl = z.string().url().refine((value) => new URL(value).protocol === "https:", "Remote TreeSeed connections require HTTPS.");
|
|
18
|
+
const deploymentTrackSchema = z.enum(["stable", "development"]);
|
|
19
|
+
const hostCredentialInitializerSchema = z.object({
|
|
20
|
+
schemaVersion: z.literal("treeseed.host-credential-initializer/v1"),
|
|
21
|
+
id: identifier,
|
|
22
|
+
displayName: z.string().min(1).max(128),
|
|
23
|
+
description: z.string().min(1).max(1024),
|
|
24
|
+
credentialId: identifier,
|
|
25
|
+
sources: z.array(z.object({
|
|
26
|
+
id: identifier,
|
|
27
|
+
label: z.string().min(1).max(128),
|
|
28
|
+
kind: z.enum(["file", "secret"]),
|
|
29
|
+
prompt: z.string().min(1).max(256),
|
|
30
|
+
suggestedPaths: z.array(z.string().min(1).max(4096)).max(16).default([]),
|
|
31
|
+
contentType: z.enum(["application/json", "text/plain"]),
|
|
32
|
+
minimumBytes: z.number().int().positive().max(1048576),
|
|
33
|
+
maximumBytes: z.number().int().positive().max(1048576)
|
|
34
|
+
}).strict().refine((source) => source.maximumBytes >= source.minimumBytes, "Credential source maximum must be at least its minimum.")).min(1),
|
|
35
|
+
activation: z.object({
|
|
36
|
+
kind: z.literal("sandbox-model-gateway"),
|
|
37
|
+
authenticationModes: z.record(identifier, z.enum(["api-key", "subscription-file"]))
|
|
38
|
+
}).strict()
|
|
39
|
+
}).strict().superRefine((initializer, context) => {
|
|
40
|
+
for (const source of initializer.sources) if (!initializer.activation.authenticationModes[source.id]) {
|
|
41
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["activation", "authenticationModes", source.id], message: "Every credential source requires an activation mode." });
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const hostRoleSchema = z.union([
|
|
45
|
+
z.enum(["integrated", "capacity-provider", "control-plane", "knowledge", "ai-gpu", "edge"]),
|
|
46
|
+
identifier
|
|
47
|
+
]);
|
|
48
|
+
const connectionHealthGateSchema = z.object({
|
|
49
|
+
protocol: z.enum(["http", "https", "tcp"]),
|
|
50
|
+
path: z.string().startsWith("/").optional(),
|
|
51
|
+
timeoutSeconds: z.number().int().positive().max(600)
|
|
52
|
+
}).strict();
|
|
53
|
+
const remoteTlsSchema = z.object({
|
|
54
|
+
trust: z.enum(["system", "secret", "spki"]),
|
|
55
|
+
serverName: z.string().min(1).optional(),
|
|
56
|
+
caSecretRef: identifier.optional(),
|
|
57
|
+
spkiSha256: digest.optional()
|
|
58
|
+
}).strict().superRefine((tls, context) => {
|
|
59
|
+
if (tls.trust === "secret" && !tls.caSecretRef) context.addIssue({ code: z.ZodIssueCode.custom, path: ["caSecretRef"], message: "Secret TLS trust requires a CA secret reference." });
|
|
60
|
+
if (tls.trust === "spki" && !tls.spkiSha256) context.addIssue({ code: z.ZodIssueCode.custom, path: ["spkiSha256"], message: "SPKI TLS trust requires an exact SHA-256 pin." });
|
|
61
|
+
});
|
|
62
|
+
const hostConnectionBindingSchema = z.union([
|
|
63
|
+
z.object({
|
|
64
|
+
kind: z.literal("local"),
|
|
65
|
+
componentId: identifier,
|
|
66
|
+
serviceId: identifier,
|
|
67
|
+
endpointId: identifier
|
|
68
|
+
}).strict(),
|
|
69
|
+
z.object({
|
|
70
|
+
kind: z.literal("remote"),
|
|
71
|
+
url: httpsUrl,
|
|
72
|
+
audience: z.string().min(1),
|
|
73
|
+
tls: remoteTlsSchema,
|
|
74
|
+
authentication: z.object({ mode: z.enum(["none", "application", "bearer", "mtls"]), secretRef: identifier.optional() }).strict(),
|
|
75
|
+
healthGate: connectionHealthGateSchema
|
|
76
|
+
}).strict()
|
|
77
|
+
]).superRefine((connection, context) => {
|
|
78
|
+
if (connection.kind === "remote" && connection.authentication.mode !== "none" && !connection.authentication.secretRef) context.addIssue({ code: z.ZodIssueCode.custom, path: ["authentication", "secretRef"], message: "Authenticated remote connections require a secret reference." });
|
|
79
|
+
});
|
|
80
|
+
const hostComponentSchema = z.object({
|
|
81
|
+
enabled: z.boolean(),
|
|
82
|
+
track: deploymentTrackSchema,
|
|
83
|
+
profile: identifier.optional(),
|
|
84
|
+
aliases: z.record(z.string().min(1), localAlias).default({}),
|
|
85
|
+
configuration: z.record(z.unknown()).default({}),
|
|
86
|
+
resources: z.object({
|
|
87
|
+
cpuCores: z.number().positive().optional(),
|
|
88
|
+
memoryBytes: z.number().int().positive().optional(),
|
|
89
|
+
storageBytes: z.number().int().positive().optional(),
|
|
90
|
+
gpuDevices: z.array(z.string().min(1)).default([])
|
|
91
|
+
}).strict().default({ gpuDevices: [] }),
|
|
92
|
+
connections: z.record(identifier, hostConnectionBindingSchema).default({})
|
|
93
|
+
}).strict();
|
|
94
|
+
const hostConfigurationSchema = z.object({
|
|
95
|
+
schemaVersion: z.literal("treeseed.host/v1"),
|
|
96
|
+
configurationId: identifier,
|
|
97
|
+
generation: z.number().int().positive(),
|
|
98
|
+
host: z.object({
|
|
99
|
+
id: identifier,
|
|
100
|
+
role: hostRoleSchema,
|
|
101
|
+
architecture: z.literal("amd64")
|
|
102
|
+
}).strict(),
|
|
103
|
+
runtime: z.object({
|
|
104
|
+
management: z.enum(["managed", "external"]),
|
|
105
|
+
environment: z.enum(["production", "development"]).default("production"),
|
|
106
|
+
dataRoot: z.string().startsWith("/").regex(/\/\.treeseed\/data$/u, "Development dataRoot must end with /.treeseed/data.").optional()
|
|
107
|
+
}).strict().superRefine((runtime, context) => {
|
|
108
|
+
if (runtime.environment === "development" && !runtime.dataRoot) context.addIssue({ code: z.ZodIssueCode.custom, path: ["dataRoot"], message: "Development hosts require an explicit workspace-visible dataRoot." });
|
|
109
|
+
if (runtime.environment === "production" && runtime.dataRoot) context.addIssue({ code: z.ZodIssueCode.custom, path: ["dataRoot"], message: "Production hosts use manager-owned /var/lib state and cannot override dataRoot." });
|
|
110
|
+
}),
|
|
111
|
+
updates: z.object({
|
|
112
|
+
defaultTrack: deploymentTrackSchema,
|
|
113
|
+
stable: z.object({
|
|
114
|
+
metadataPollSeconds: z.number().int().min(3600),
|
|
115
|
+
maintenanceWindow: z.object({
|
|
116
|
+
weekday: z.enum(["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]),
|
|
117
|
+
localTime: z.string().regex(/^(?:[01][0-9]|2[0-3]):[0-5][0-9]$/u),
|
|
118
|
+
jitterMinutes: z.number().int().min(0).max(30)
|
|
119
|
+
}).strict()
|
|
120
|
+
}).strict(),
|
|
121
|
+
development: z.object({ pollSeconds: z.literal(60) }).strict()
|
|
122
|
+
}).strict(),
|
|
123
|
+
components: z.record(identifier, hostComponentSchema),
|
|
124
|
+
postgres: postgresTopologySchema.optional(),
|
|
125
|
+
network: z.object({
|
|
126
|
+
manager: z.object({ binding, aliases: z.array(localAlias).default([]), sans: z.array(z.string().min(1)).default([]), trustedLanCidrs: z.array(z.string().min(1)).default([]) }).strict()
|
|
127
|
+
}).strict(),
|
|
128
|
+
fleet: z.object({
|
|
129
|
+
rolloutGroup: identifier,
|
|
130
|
+
receiptReporting: z.object({
|
|
131
|
+
enabled: z.boolean(),
|
|
132
|
+
connection: hostConnectionBindingSchema.optional(),
|
|
133
|
+
intervalSeconds: z.number().int().min(60).max(86400)
|
|
134
|
+
}).strict()
|
|
135
|
+
}).strict().superRefine((fleet, context) => {
|
|
136
|
+
if (fleet.receiptReporting.enabled && fleet.receiptReporting.connection?.kind !== "remote") context.addIssue({ code: z.ZodIssueCode.custom, path: ["receiptReporting", "connection"], message: "Enabled fleet receipt reporting requires an explicit remote connection." });
|
|
137
|
+
}),
|
|
138
|
+
secrets: z.record(identifier, z.object({
|
|
139
|
+
provider: z.enum(["file", "systemd-credential"]),
|
|
140
|
+
reference: z.string().min(1)
|
|
141
|
+
}).strict()),
|
|
142
|
+
security: z.object({
|
|
143
|
+
sandbox: z.object({
|
|
144
|
+
required: z.boolean(),
|
|
145
|
+
runtime: z.literal("kata-runtime-rs-qemu"),
|
|
146
|
+
brokerSocket: z.string().startsWith("/run/treeseed/"),
|
|
147
|
+
modelGateway: z.object({ provider: z.literal("openai"), upstreamBaseUrl: z.literal("https://api.openai.com"), allowedModels: z.array(z.string().min(1)).min(1) }).strict(),
|
|
148
|
+
profiles: z.array(z.object({ id: identifier, guestImage: z.string().min(1), guestImageDigest: digest }).strict()).min(1)
|
|
149
|
+
}).strict(),
|
|
150
|
+
providerVolume: z.object({ encryption: z.literal("luks2"), backingPath: z.string().startsWith("/"), mountPath: z.string().startsWith("/"), sizeBytes: z.number().int().min(1073741824), unlock: z.enum(["tpm2", "systemd-credential"]), recoveryRequired: z.literal(true) }).strict(),
|
|
151
|
+
applicationEncryption: z.object({ provider: z.literal("systemd-credential"), activeKeyVersion: z.number().int().positive(), diagnosticsKeyVersion: z.number().int().positive() }).strict()
|
|
152
|
+
}).strict().optional()
|
|
153
|
+
}).strict().superRefine((host, context) => {
|
|
154
|
+
if (!host.postgres) return;
|
|
155
|
+
const fail = (message) => context.addIssue({ code: z.ZodIssueCode.custom, path: ["postgres"], message });
|
|
156
|
+
for (const requirement of host.postgres.requirements) {
|
|
157
|
+
if (!host.components[requirement.componentId] || host.components[requirement.componentId].enabled !== requirement.enabled) fail("Database requirements must match configured component activation.");
|
|
158
|
+
}
|
|
159
|
+
for (const allocation of host.postgres.allocations) {
|
|
160
|
+
if (!host.postgres.requirements.find((item) => item.id === allocation.requirementId)?.enabled) continue;
|
|
161
|
+
for (const reference of [allocation.migrationCredentialReference, allocation.runtimeCredentialReference]) {
|
|
162
|
+
if (host.secrets[reference]?.provider !== "systemd-credential" || host.secrets[reference]?.reference !== `/etc/treeseed/credentials/${reference}.cred`) fail("Database credentials require explicit fixed OS custody bindings.");
|
|
163
|
+
}
|
|
164
|
+
const server = host.postgres.servers.find((item) => item.id === allocation.serverId);
|
|
165
|
+
if (server.mode !== "external" && !host.components.postgres?.enabled) fail("Managed database allocations require the PostgreSQL component.");
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
const packageEndpointSchema = z.object({
|
|
169
|
+
id: identifier,
|
|
170
|
+
protocol: z.enum(["http", "https", "tcp"]),
|
|
171
|
+
port: z.number().int().min(1).max(65535),
|
|
172
|
+
visibility: z.enum(["private", "host"]),
|
|
173
|
+
defaultAlias: localAlias.optional(),
|
|
174
|
+
aliasOverride: z.boolean().default(true),
|
|
175
|
+
tls: z.enum(["edge", "passthrough", "none"]),
|
|
176
|
+
authentication: z.enum(["none", "application", "mtls"]),
|
|
177
|
+
healthGate: z.object({ protocol: z.enum(["http", "https", "tcp"]), path: z.string().startsWith("/").optional(), timeoutSeconds: z.number().int().positive().max(1200) }).strict().optional()
|
|
178
|
+
}).strict().superRefine((endpoint, context) => {
|
|
179
|
+
if (endpoint.visibility === "host" && !endpoint.defaultAlias) context.addIssue({ code: z.ZodIssueCode.custom, path: ["defaultAlias"], message: "Host-visible endpoints require a .localhost alias." });
|
|
180
|
+
if (endpoint.visibility === "host" && !endpoint.healthGate) context.addIssue({ code: z.ZodIssueCode.custom, path: ["healthGate"], message: "Host-visible endpoints require a health gate." });
|
|
181
|
+
if (endpoint.visibility === "private" && endpoint.defaultAlias) context.addIssue({ code: z.ZodIssueCode.custom, path: ["defaultAlias"], message: "Private endpoints cannot declare host aliases." });
|
|
182
|
+
});
|
|
183
|
+
const environmentName = z.string().regex(/^[A-Z][A-Z0-9_]{0,127}$/u, "Environment names must use portable uppercase identifiers.");
|
|
184
|
+
const componentSecretPath = z.string().regex(/^\/etc\/treeseed\/credentials\/[a-z0-9][a-z0-9._-]{0,127}$/u, "Secret inputs must use manager-owned credential paths.");
|
|
185
|
+
const componentConfigurationPath = z.string().regex(/^\/etc\/treeseed\/components\/[a-z][a-z0-9.-]*\/[a-z0-9][a-z0-9._-]{0,127}$/u, "Configuration inputs must use manager-owned component paths.");
|
|
186
|
+
const componentRuntimeConfigurationSchema = z.object({
|
|
187
|
+
environment: z.array(z.object({ name: environmentName, required: z.boolean(), source: z.enum(["configuration", "manager"]).default("configuration"), default: z.string().max(16384).optional() }).strict().superRefine((input, context) => {
|
|
188
|
+
if (input.source === "manager" && input.default !== void 0) context.addIssue({ code: z.ZodIssueCode.custom, path: ["default"], message: "Manager-derived environment inputs cannot declare configuration defaults." });
|
|
189
|
+
})).default([]),
|
|
190
|
+
secretEnvironment: z.array(z.object({ name: environmentName, required: z.boolean() }).strict()).default([]),
|
|
191
|
+
secretFiles: z.array(z.object({ id: identifier, path: componentSecretPath, required: z.boolean() }).strict()).default([]),
|
|
192
|
+
files: z.array(z.object({
|
|
193
|
+
id: identifier,
|
|
194
|
+
path: componentConfigurationPath,
|
|
195
|
+
required: z.boolean(),
|
|
196
|
+
sensitive: z.boolean().default(false),
|
|
197
|
+
default: z.string().max(1048576).optional()
|
|
198
|
+
}).strict().superRefine((file, context) => {
|
|
199
|
+
if (file.sensitive && file.default !== void 0) context.addIssue({ code: z.ZodIssueCode.custom, path: ["default"], message: "Sensitive managed files cannot publish defaults." });
|
|
200
|
+
})).default([])
|
|
201
|
+
}).strict().default({ environment: [], secretEnvironment: [], secretFiles: [], files: [] }).superRefine((configuration, context) => {
|
|
202
|
+
const environment = configuration.environment.map(({ name }) => name);
|
|
203
|
+
const secretEnvironment = configuration.secretEnvironment.map(({ name }) => name);
|
|
204
|
+
for (const [path, values] of [["environment", environment], ["secretEnvironment", secretEnvironment]]) {
|
|
205
|
+
if (new Set(values).size !== values.length) context.addIssue({ code: z.ZodIssueCode.custom, path: [path], message: `Duplicate ${path} inputs are not allowed.` });
|
|
206
|
+
}
|
|
207
|
+
const overlap = environment.filter((name) => secretEnvironment.includes(name));
|
|
208
|
+
if (overlap.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["secretEnvironment"], message: `Environment inputs cannot have both public and secret custody: ${overlap.join(", ")}.` });
|
|
209
|
+
const filePaths = [...configuration.secretFiles.map(({ path }) => path), ...configuration.files.map(({ path }) => path)];
|
|
210
|
+
if (new Set(filePaths).size !== filePaths.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["files"], message: "Component file input paths must be unique." });
|
|
211
|
+
});
|
|
212
|
+
const packageRuntimeSchema = z.object({
|
|
213
|
+
schemaVersion: z.literal("treeseed.package-runtime/v1"),
|
|
214
|
+
componentId: identifier,
|
|
215
|
+
version: packageVersion,
|
|
216
|
+
compose: z.object({
|
|
217
|
+
projectName: identifier,
|
|
218
|
+
files: z.array(z.object({ path: z.string().min(1), digest }).strict()).min(1)
|
|
219
|
+
}).strict(),
|
|
220
|
+
configuration: componentRuntimeConfigurationSchema,
|
|
221
|
+
// Optional without a default: parsing published artifacts must not change their digest.
|
|
222
|
+
postgresRequirements: z.array(postgresComponentRequirementSchema).max(32).optional(),
|
|
223
|
+
postgresLifecycle: z.array(z.object({
|
|
224
|
+
requirementId: identifier,
|
|
225
|
+
credentialOwner: z.object({ uid: z.number().int().min(0).max(65535), gid: z.number().int().min(0).max(65535) }).strict(),
|
|
226
|
+
migration: z.object({ composeService: identifier, completion: z.enum(["exit-zero", "healthy-stop"]), timeoutSeconds: z.number().int().min(1).max(3600) }).strict(),
|
|
227
|
+
runtimeServices: z.array(identifier).min(1).max(128)
|
|
228
|
+
}).strict()).max(32).optional(),
|
|
229
|
+
services: z.array(z.object({ id: identifier, composeService: identifier, endpoints: z.array(packageEndpointSchema) }).strict()).min(1),
|
|
230
|
+
stateVolumes: z.array(z.object({ id: identifier, volume: z.string().min(1), backup: z.enum(["required", "optional", "none"]) }).strict()),
|
|
231
|
+
migrations: z.array(z.object({ id: identifier, order: z.number().int().nonnegative(), backupRequired: z.boolean() }).strict()),
|
|
232
|
+
requiredCapabilities: z.array(identifier),
|
|
233
|
+
dependencies: z.array(z.object({
|
|
234
|
+
id: identifier,
|
|
235
|
+
capability: identifier,
|
|
236
|
+
locality: z.enum(["local", "remote", "either"]),
|
|
237
|
+
optional: z.boolean().default(false)
|
|
238
|
+
}).strict()).default([]),
|
|
239
|
+
modeControl: z.object({
|
|
240
|
+
resource: z.literal("ai-gpu"),
|
|
241
|
+
role: z.enum(["inference", "training", "controller"]),
|
|
242
|
+
gate: z.object({
|
|
243
|
+
service: identifier,
|
|
244
|
+
executable: z.literal("/usr/local/bin/treeseed-ai-gpu-gate")
|
|
245
|
+
}).strict().optional(),
|
|
246
|
+
services: z.object({
|
|
247
|
+
base: z.array(identifier).min(1),
|
|
248
|
+
gpu: z.array(identifier).max(2),
|
|
249
|
+
warm: identifier.optional()
|
|
250
|
+
}).strict(),
|
|
251
|
+
internalControl: z.object({
|
|
252
|
+
transport: z.literal("mtls"),
|
|
253
|
+
clientCommonName: z.literal("client-ai-lab-mode"),
|
|
254
|
+
path: z.literal(AI_MODE_INTERNAL_PATH)
|
|
255
|
+
}).strict().optional()
|
|
256
|
+
}).strict().optional()
|
|
257
|
+
}).strict().superRefine((runtime, context) => {
|
|
258
|
+
const requirements = runtime.postgresRequirements ?? [];
|
|
259
|
+
if (new Set(requirements.map(({ id }) => id)).size !== requirements.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["postgresRequirements"], message: "PostgreSQL requirement identities must be unique within a component." });
|
|
260
|
+
const lifecycles = runtime.postgresLifecycle ?? [];
|
|
261
|
+
const lifecycleFailure = () => context.addIssue({ code: z.ZodIssueCode.custom, path: ["postgresLifecycle"], message: "Each database requirement needs a distinct declared migration service and explicit runtime services." });
|
|
262
|
+
if (lifecycles.length !== requirements.length || new Set(lifecycles.map((item) => item.requirementId)).size !== lifecycles.length) lifecycleFailure();
|
|
263
|
+
const composeServices = new Set(runtime.services.map((item) => item.composeService));
|
|
264
|
+
const migrationServices = new Set(lifecycles.map((item) => item.migration.composeService));
|
|
265
|
+
if (migrationServices.size !== lifecycles.length) lifecycleFailure();
|
|
266
|
+
for (const item of lifecycles) {
|
|
267
|
+
if (!requirements.some((requirement) => requirement.id === item.requirementId) || !composeServices.has(item.migration.composeService) || new Set(item.runtimeServices).size !== item.runtimeServices.length || item.runtimeServices.some((service) => !composeServices.has(service) || migrationServices.has(service))) lifecycleFailure();
|
|
268
|
+
}
|
|
269
|
+
const endpointIds = runtime.services.flatMap((service) => service.endpoints.map((endpoint) => `${service.id}.${endpoint.id}`));
|
|
270
|
+
if (new Set(endpointIds).size !== endpointIds.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["services"], message: "Endpoint identities must be unique within a component." });
|
|
271
|
+
for (const file of runtime.configuration.files) if (!file.path.startsWith(`/etc/treeseed/components/${runtime.componentId}/`)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["configuration", "files"], message: `Configuration file ${file.id} is outside component ${runtime.componentId} custody.` });
|
|
272
|
+
if (runtime.modeControl) {
|
|
273
|
+
const services = new Set(runtime.services.map(({ composeService }) => composeService));
|
|
274
|
+
for (const service of [...runtime.modeControl.services.base, ...runtime.modeControl.services.gpu, ...runtime.modeControl.services.warm ? [runtime.modeControl.services.warm] : []]) if (!services.has(service)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["modeControl", "services"], message: `AI mode service ${service} is not declared by the component runtime.` });
|
|
275
|
+
if (runtime.modeControl.gate && !services.has(runtime.modeControl.gate.service)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["modeControl", "gate"], message: `AI mode gate service ${runtime.modeControl.gate.service} is not declared by the component runtime.` });
|
|
276
|
+
if (runtime.modeControl.role === "controller" && (!runtime.modeControl.internalControl || runtime.modeControl.gate || runtime.modeControl.services.gpu.length)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["modeControl"], message: "The AI controller may declare only the scoped internal control surface." });
|
|
277
|
+
if (runtime.modeControl.role !== "controller" && (!runtime.modeControl.gate || runtime.modeControl.internalControl || runtime.modeControl.services.gpu.length === 0)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["modeControl"], message: "AI GPU components require a fixed gate and at least one GPU service." });
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
const catalogPackageSchema = z.object({ name: z.string().regex(/^treeseed(?:-[a-z0-9-]+)?$/u), version: packageVersion, architecture: z.enum(["amd64", "all"]), origin: z.literal("TreeSeed Deployment"), order: z.number().int().nonnegative() }).strict();
|
|
281
|
+
const catalogImageSchema = z.object({ role: identifier, repository: ociRepository, digest, platforms: z.array(z.enum(["linux/amd64", "linux/arm64"])).min(1), consumers: z.array(identifier).min(1) }).strict();
|
|
282
|
+
const componentReleaseSchema = z.object({
|
|
283
|
+
schemaVersion: z.literal("treeseed.component-release/v1"),
|
|
284
|
+
componentId: identifier,
|
|
285
|
+
release: packageVersion,
|
|
286
|
+
applicationVersion: packageVersion,
|
|
287
|
+
revision: z.number().int().positive(),
|
|
288
|
+
track: deploymentTrackSchema,
|
|
289
|
+
source: z.object({ repository: z.string().regex(/^treeseed-ai\/[a-z0-9-]+$/u), commit: gitCommit }).strict(),
|
|
290
|
+
stableBase: z.object({ releaseRange: z.string().min(1), compatibilityId: identifier, catalogDigest: digest.nullable() }).strict().nullable(),
|
|
291
|
+
packages: z.array(catalogPackageSchema).min(1),
|
|
292
|
+
images: z.array(catalogImageSchema),
|
|
293
|
+
runtime: packageRuntimeSchema,
|
|
294
|
+
runtimeDigest: digest,
|
|
295
|
+
rollback: z.object({ compatible: z.boolean(), requiresBackup: z.boolean() }).strict(),
|
|
296
|
+
evidence: z.object({ provenance: z.array(z.string().url()), sboms: z.array(z.string().url()), vulnerabilities: z.array(z.string().url()) }).strict()
|
|
297
|
+
}).strict().superRefine((release, context) => {
|
|
298
|
+
if (release.runtime.componentId !== release.componentId || release.runtime.version !== release.release) context.addIssue({ code: z.ZodIssueCode.custom, path: ["runtime"], message: "Runtime identity must match its component release." });
|
|
299
|
+
if (release.track === "development" && !release.stableBase) context.addIssue({ code: z.ZodIssueCode.custom, path: ["stableBase"], message: "Development releases require an exact stable-base binding." });
|
|
300
|
+
if (release.track === "stable" && release.stableBase) context.addIssue({ code: z.ZodIssueCode.custom, path: ["stableBase"], message: "Stable releases cannot be overlays." });
|
|
301
|
+
});
|
|
302
|
+
const lockedArtifactSchema = z.object({ url: z.string().url(), sha256: z.string().regex(/^[a-f0-9]{64}$/u) }).strict();
|
|
303
|
+
const initializationInputName = z.string().regex(/^[a-z][A-Za-z0-9]{1,63}$/u);
|
|
304
|
+
const hostInitializationProfileSchema = z.object({
|
|
305
|
+
schemaVersion: z.literal("treeseed.host-initialization-profile/v1"),
|
|
306
|
+
id: identifier,
|
|
307
|
+
role: hostRoleSchema,
|
|
308
|
+
runtime: z.object({ management: z.literal("managed"), environment: z.enum(["track-default", "production", "development"]) }).strict(),
|
|
309
|
+
components: z.array(identifier).min(1),
|
|
310
|
+
security: z.object({ requirement: z.enum(["required", "optional", "none"]) }).strict(),
|
|
311
|
+
inputs: z.array(z.object({
|
|
312
|
+
name: initializationInputName,
|
|
313
|
+
required: z.boolean(),
|
|
314
|
+
sensitive: z.boolean(),
|
|
315
|
+
description: z.string().min(1).max(512)
|
|
316
|
+
}).strict()).default([])
|
|
317
|
+
}).strict().superRefine((profile, context) => {
|
|
318
|
+
for (const [path, values] of [["components", profile.components], ["inputs", profile.inputs.map(({ name }) => name)]]) {
|
|
319
|
+
if (new Set(values).size !== values.length) context.addIssue({ code: z.ZodIssueCode.custom, path: [path], message: `Host initialization profile ${path} must be unique.` });
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
const integrationReleaseSchema = z.object({
|
|
323
|
+
schemaVersion: z.literal("treeseed.integration-release/v1"),
|
|
324
|
+
release: packageVersion,
|
|
325
|
+
generation: z.number().int().positive(),
|
|
326
|
+
track: deploymentTrackSchema,
|
|
327
|
+
compatibilityId: identifier,
|
|
328
|
+
platform: z.object({ repository: z.literal("treeseed-ai/platform"), commit: gitCommit }).strict(),
|
|
329
|
+
deployment: z.object({ repository: z.literal("treeseed-ai/deployment"), commit: gitCommit, tag: z.string().min(1) }).strict(),
|
|
330
|
+
hostPayloads: z.array(z.object({ id: identifier, packageName: z.string().min(1), version: packageVersion, artifact: lockedArtifactSchema }).strict()),
|
|
331
|
+
hostProfiles: z.array(z.object({ id: identifier, artifact: lockedArtifactSchema }).strict()).default([]),
|
|
332
|
+
components: z.array(z.object({
|
|
333
|
+
componentId: identifier,
|
|
334
|
+
release: packageVersion,
|
|
335
|
+
manifest: lockedArtifactSchema,
|
|
336
|
+
files: z.array(z.object({ path: z.string().min(1), artifact: lockedArtifactSchema }).strict()).min(1)
|
|
337
|
+
}).strict()),
|
|
338
|
+
createdAt: z.string().datetime()
|
|
339
|
+
}).strict().superRefine((release, context) => {
|
|
340
|
+
const components = release.components.map((component) => component.componentId);
|
|
341
|
+
if (new Set(components).size !== components.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["components"], message: "Integration releases cannot select a component more than once." });
|
|
342
|
+
const profiles = release.hostProfiles.map((profile) => profile.id);
|
|
343
|
+
if (new Set(profiles).size !== profiles.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["hostProfiles"], message: "Integration releases cannot select a host profile more than once." });
|
|
344
|
+
});
|
|
345
|
+
const releaseCatalogSchema = z.object({
|
|
346
|
+
schemaVersion: z.literal("treeseed.release-catalog/v1"),
|
|
347
|
+
release: packageVersion,
|
|
348
|
+
generation: z.number().int().positive(),
|
|
349
|
+
track: deploymentTrackSchema,
|
|
350
|
+
compatibilityId: identifier,
|
|
351
|
+
catalogDigest: digest,
|
|
352
|
+
stableBase: z.object({ release: packageVersion, catalogDigest: digest }).strict().nullable(),
|
|
353
|
+
components: z.array(componentReleaseSchema),
|
|
354
|
+
hostProfiles: z.array(hostInitializationProfileSchema).default([]),
|
|
355
|
+
createdAt: z.string().datetime()
|
|
356
|
+
}).strict().superRefine((catalog, context) => {
|
|
357
|
+
if (catalog.track === "development" && !catalog.stableBase) context.addIssue({ code: z.ZodIssueCode.custom, path: ["stableBase"], message: "Development catalogs require an exact stable base." });
|
|
358
|
+
if (catalog.track === "stable" && catalog.stableBase) context.addIssue({ code: z.ZodIssueCode.custom, path: ["stableBase"], message: "Stable catalogs cannot bind another stable base." });
|
|
359
|
+
if (catalog.track === "development" && catalog.stableBase) for (const [index, component] of catalog.components.entries()) {
|
|
360
|
+
if (component.track !== "development" || component.stableBase?.catalogDigest !== catalog.stableBase.catalogDigest) context.addIssue({ code: z.ZodIssueCode.custom, path: ["components", index, "stableBase", "catalogDigest"], message: "Catalog ingestion must bind every development component to the exact selected stable base." });
|
|
361
|
+
}
|
|
362
|
+
const profileIds = catalog.hostProfiles.map((profile) => profile.id);
|
|
363
|
+
if (new Set(profileIds).size !== profileIds.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["hostProfiles"], message: "Release catalogs cannot contain duplicate host profiles." });
|
|
364
|
+
const components = new Set(catalog.components.map((component) => component.componentId));
|
|
365
|
+
for (const [profileIndex, profile] of catalog.hostProfiles.entries()) for (const [componentIndex, componentId] of profile.components.entries()) {
|
|
366
|
+
if (!components.has(componentId)) context.addIssue({ code: z.ZodIssueCode.custom, path: ["hostProfiles", profileIndex, "components", componentIndex], message: `Host profile ${profile.id} selects unavailable component ${componentId}.` });
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
const hostPlanSchema = z.object({ schemaVersion: z.literal("treeseed.host-plan/v1"), planId: identifier, configurationDigest: digest, catalogDigest: digest, changes: z.array(z.object({ componentId: identifier, action: z.enum(["install", "upgrade", "reconfigure", "remove", "noop"]), from: packageVersion.nullable(), to: packageVersion.nullable() }).strict()), blockers: z.array(z.object({ code: identifier, message: z.string().min(1) }).strict()) }).strict();
|
|
370
|
+
const hostBootstrapSchema = z.object({
|
|
371
|
+
schemaVersion: z.literal("treeseed.host-bootstrap/v1"),
|
|
372
|
+
bootstrapId: identifier,
|
|
373
|
+
configurationDigest: digest,
|
|
374
|
+
apt: z.object({ origin: z.literal("TreeSeed Deployment"), suite: deploymentTrackSchema, repository: z.string().url(), keyFingerprint: z.string().regex(/^[A-F0-9]{40}$/u) }).strict(),
|
|
375
|
+
packages: z.array(catalogPackageSchema).min(1),
|
|
376
|
+
credentialPolicy: z.object({ noStoreResponse: z.literal(true), redactedLogging: z.literal(true), ephemeralGeneration: z.literal(true), deleteAfterInstall: z.literal(true) }).strict(),
|
|
377
|
+
createdAt: z.string().datetime()
|
|
378
|
+
}).strict();
|
|
379
|
+
const hostUpdateSchema = z.object({
|
|
380
|
+
schemaVersion: z.literal("treeseed.host-update/v1"),
|
|
381
|
+
updateId: identifier,
|
|
382
|
+
track: deploymentTrackSchema,
|
|
383
|
+
fromCatalogDigest: digest,
|
|
384
|
+
toCatalogDigest: digest,
|
|
385
|
+
components: z.array(z.object({ componentId: identifier, from: packageVersion.nullable(), to: packageVersion, imageDigests: z.array(digest) }).strict()).min(1),
|
|
386
|
+
activation: z.object({ policy: z.enum(["maintenance-window", "continuous"]), eligibleAt: z.string().datetime(), jitterSeconds: z.number().int().nonnegative() }).strict(),
|
|
387
|
+
state: z.enum(["planned", "draining", "applying", "healthy", "failed", "rolled-back"])
|
|
388
|
+
}).strict();
|
|
389
|
+
const hostReceiptSchema = z.object({ schemaVersion: z.literal("treeseed.host-receipt/v1"), receiptId: identifier, planId: identifier, state: z.enum(["known-good", "degraded", "rolled-back"]), hostId: identifier, role: hostRoleSchema, rolloutGroup: identifier, configurationDigest: digest, catalogDigest: digest, packages: z.array(catalogPackageSchema), images: z.array(catalogImageSchema), runtimes: z.array(z.object({ componentId: identifier, release: packageVersion, runtimeDigest: digest }).strict()), completedAt: z.string().datetime() }).strict();
|
|
390
|
+
const hostBackupSchema = z.object({
|
|
391
|
+
schemaVersion: z.literal("treeseed.host-backup/v1"),
|
|
392
|
+
backupId: identifier,
|
|
393
|
+
componentId: identifier,
|
|
394
|
+
generation: z.number().int().positive(),
|
|
395
|
+
state: z.enum(["pending", "complete", "failed", "verified"]),
|
|
396
|
+
artifacts: z.array(z.object({ volumeId: identifier, location: z.string().min(1), digest, encrypted: z.boolean() }).strict()),
|
|
397
|
+
createdAt: z.string().datetime(),
|
|
398
|
+
verifiedAt: z.string().datetime().nullable()
|
|
399
|
+
}).strict();
|
|
400
|
+
const hostMigrationSchema = z.object({
|
|
401
|
+
schemaVersion: z.literal("treeseed.host-migration/v1"),
|
|
402
|
+
migrationId: identifier,
|
|
403
|
+
componentId: identifier,
|
|
404
|
+
operation: identifier,
|
|
405
|
+
fromGeneration: z.number().int().nonnegative(),
|
|
406
|
+
toGeneration: z.number().int().positive(),
|
|
407
|
+
backupId: identifier.nullable(),
|
|
408
|
+
state: z.enum(["pending", "quiesced", "copied", "verified", "activated", "failed", "rolled-back"]),
|
|
409
|
+
sourceWritersStopped: z.boolean(),
|
|
410
|
+
completedAt: z.string().datetime().nullable()
|
|
411
|
+
}).strict();
|
|
412
|
+
const hostRecoverySchema = z.object({
|
|
413
|
+
schemaVersion: z.literal("treeseed.host-recovery/v1"),
|
|
414
|
+
recoveryId: identifier,
|
|
415
|
+
receiptId: identifier,
|
|
416
|
+
componentId: identifier.nullable(),
|
|
417
|
+
trigger: z.enum(["health-gate", "operator", "boot", "interrupted-update"]),
|
|
418
|
+
action: z.enum(["retry", "rollback", "restore"]),
|
|
419
|
+
targetGeneration: z.number().int().positive(),
|
|
420
|
+
state: z.enum(["pending", "running", "healthy", "failed"]),
|
|
421
|
+
backupId: identifier.nullable(),
|
|
422
|
+
completedAt: z.string().datetime().nullable()
|
|
423
|
+
}).strict();
|
|
424
|
+
const hostSecurityReceiptSchema = z.object({
|
|
425
|
+
schemaVersion: z.literal("treeseed.host-security-receipt/v1"),
|
|
426
|
+
receiptId: identifier,
|
|
427
|
+
hostId: identifier,
|
|
428
|
+
sandbox: z.object({ runtime: z.literal("kata-runtime-rs-qemu"), kvmReady: z.boolean(), brokerReady: z.boolean(), guestImageDigests: z.array(digest) }).strict(),
|
|
429
|
+
providerVolume: z.object({ encrypted: z.boolean(), format: z.literal("luks2"), mountPath: z.string().startsWith("/"), unlock: z.enum(["tpm2", "systemd-credential"]) }).strict(),
|
|
430
|
+
keys: z.object({ provider: z.literal("systemd-credential"), activeCredentialVersion: z.number().int().positive(), activeDiagnosticsVersion: z.number().int().positive(), recoveryBundleVerified: z.boolean() }).strict(),
|
|
431
|
+
state: z.enum(["planned", "migrating", "known-good", "blocked"]),
|
|
432
|
+
completedAt: z.string().datetime()
|
|
433
|
+
}).strict();
|
|
434
|
+
export {
|
|
435
|
+
componentReleaseSchema,
|
|
436
|
+
deploymentTrackSchema,
|
|
437
|
+
hostBackupSchema,
|
|
438
|
+
hostBootstrapSchema,
|
|
439
|
+
hostComponentSchema,
|
|
440
|
+
hostConfigurationSchema,
|
|
441
|
+
hostConnectionBindingSchema,
|
|
442
|
+
hostCredentialInitializerSchema,
|
|
443
|
+
hostInitializationProfileSchema,
|
|
444
|
+
hostMigrationSchema,
|
|
445
|
+
hostPlanSchema,
|
|
446
|
+
hostReceiptSchema,
|
|
447
|
+
hostRecoverySchema,
|
|
448
|
+
hostRoleSchema,
|
|
449
|
+
hostSecurityReceiptSchema,
|
|
450
|
+
hostUpdateSchema,
|
|
451
|
+
integrationReleaseSchema,
|
|
452
|
+
packageEndpointSchema,
|
|
453
|
+
packageRuntimeSchema,
|
|
454
|
+
releaseCatalogSchema
|
|
455
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentRelease, HostConfiguration } from './schemas.js';
|
|
2
|
+
export interface TopologyBlocker {
|
|
3
|
+
code: 'missing-connection' | 'invalid-locality' | 'missing-local-component' | 'missing-local-endpoint';
|
|
4
|
+
componentId: string;
|
|
5
|
+
dependencyId: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function collectTopologyBlockers(host: HostConfiguration, releases: ComponentRelease[]): TopologyBlocker[];
|
|
9
|
+
export declare function hostNeedsEdge(host: HostConfiguration, releases: ComponentRelease[]): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function collectTopologyBlockers(host, releases) {
|
|
2
|
+
const selected = new Map(releases.map((release) => [release.componentId, release]));
|
|
3
|
+
const blockers = [];
|
|
4
|
+
for (const release of releases) {
|
|
5
|
+
const selection = host.components[release.componentId];
|
|
6
|
+
if (!selection?.enabled) continue;
|
|
7
|
+
for (const dependency of release.runtime.dependencies) {
|
|
8
|
+
const connection = selection.connections[dependency.id];
|
|
9
|
+
if (!connection) {
|
|
10
|
+
if (!dependency.optional) blockers.push({ code: "missing-connection", componentId: release.componentId, dependencyId: dependency.id, message: `${release.componentId} requires an explicit ${dependency.id} connection.` });
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (dependency.locality !== "either" && connection.kind !== dependency.locality) {
|
|
14
|
+
blockers.push({ code: "invalid-locality", componentId: release.componentId, dependencyId: dependency.id, message: `${release.componentId}.${dependency.id} requires a ${dependency.locality} connection.` });
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (connection.kind !== "local") continue;
|
|
18
|
+
const target = selected.get(connection.componentId);
|
|
19
|
+
if (!target || !host.components[connection.componentId]?.enabled) {
|
|
20
|
+
blockers.push({ code: "missing-local-component", componentId: release.componentId, dependencyId: dependency.id, message: `${release.componentId}.${dependency.id} references disabled or unselected component ${connection.componentId}.` });
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const service = target.runtime.services.find((candidate) => candidate.id === connection.serviceId);
|
|
24
|
+
if (!service?.endpoints.some((endpoint) => endpoint.id === connection.endpointId)) blockers.push({ code: "missing-local-endpoint", componentId: release.componentId, dependencyId: dependency.id, message: `${release.componentId}.${dependency.id} references unknown endpoint ${connection.componentId}.${connection.serviceId}.${connection.endpointId}.` });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return blockers.sort((left, right) => `${left.componentId}.${left.dependencyId}`.localeCompare(`${right.componentId}.${right.dependencyId}`));
|
|
28
|
+
}
|
|
29
|
+
function hostNeedsEdge(host, releases) {
|
|
30
|
+
return releases.some((release) => host.components[release.componentId]?.enabled && release.runtime.services.some((service) => service.endpoints.some((endpoint) => endpoint.visibility === "host")));
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
collectTopologyBlockers,
|
|
34
|
+
hostNeedsEdge
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './schemas.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./schemas.js";
|