@treeseed/sdk 0.13.0-rc.12 → 0.13.0-rc.121
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/allocation.d.ts +0 -3
- package/dist/agent-capacity/allocation.js +0 -221
- package/dist/agent-capacity/artifact-mutation-receipt.d.ts +1 -1
- package/dist/agent-capacity/artifacts.d.ts +17 -1
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +4395 -0
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.js +176 -0
- 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 +22 -2
- 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/assignment-allocation.d.ts +82 -0
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.js +115 -0
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.d.ts +142 -0
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.js +51 -0
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.d.ts +331 -0
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.js +135 -0
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +3 -22
- package/dist/agent-capacity/contracts/configuration/configuration.js +1 -1
- package/dist/agent-capacity/contracts/operations/agent-team-clone.d.ts +218 -0
- package/dist/agent-capacity/contracts/operations/agent-team-clone.js +57 -0
- 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 +3 -27
- package/dist/agent-capacity/contracts/support/execution-graph.d.ts +1087 -0
- package/dist/agent-capacity/contracts/support/execution-graph.js +120 -0
- package/dist/agent-capacity/contracts/support/time-capacity.d.ts +0 -14
- package/dist/agent-capacity/contracts/support/time-capacity.js +1 -8
- package/dist/agent-capacity/validation/activity-profile.d.ts +1 -1
- package/dist/agent-capacity/validation/activity-profile.js +3 -259
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +2687 -8933
- package/dist/agent-capacity/validation/agent-definition-schema.js +64 -174
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +23 -23
- package/dist/agent-capacity/validation/assignment-records.js +1 -1
- package/dist/agent-capacity/validation/configuration.d.ts +1 -1
- package/dist/agent-capacity/validation/configuration.js +1 -2
- package/dist/agent-capacity/validation/execution/execution-graph.d.ts +1 -0
- package/dist/agent-capacity/validation/execution/execution-graph.js +16 -0
- package/dist/agent-capacity/validation/index.d.ts +2 -1
- package/dist/agent-capacity/validation/index.js +2 -1
- package/dist/capacity/agents/agent-capacity.d.ts +9 -1
- package/dist/capacity/agents/agent-capacity.js +8 -1
- 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 +69 -0
- package/dist/capacity-provider/client.js +22 -1
- package/dist/capacity-provider/contracts/capacity-facts.d.ts +14 -0
- 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 +109 -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 +602 -0
- package/dist/capacity-provider/sandbox-contracts.js +90 -0
- package/dist/capacity-provider/sandbox.d.ts +2 -0
- package/dist/capacity-provider/sandbox.js +2 -0
- package/dist/capacity-provider/source-workspace.d.ts +642 -0
- package/dist/capacity-provider/source-workspace.js +126 -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/contracts.d.ts +1 -1
- package/dist/content/validation/agent-operational-content-schemas.d.ts +431 -780
- package/dist/content/validation/agent-operational-content-schemas.js +29 -57
- package/dist/content/validation/auxiliary-content-schemas.d.ts +208 -208
- package/dist/content/validation/content-model-schemas.d.ts +9362 -19159
- package/dist/content/validation/content-model-schemas.js +172 -43
- package/dist/content/validation/portable-content-data.d.ts +453 -1761
- package/dist/content/validation/portable-content-data.js +5 -4
- 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 +15 -0
- package/dist/deployment/postgres/requirements.js +32 -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 +3594 -0
- package/dist/development/schemas.js +204 -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.d.ts +1 -1
- package/dist/model-registry/agent-operational-models.js +1 -4
- package/dist/model-registry/build-builtin-model-registry.js +44 -72
- package/dist/operator-contracts/canonical-command-tree.js +397 -43
- 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/agents/agent-team-clone-operations.d.ts +75 -0
- package/dist/operator-contracts/catalog/agents/agent-team-clone-operations.js +42 -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/commands/command-tree-builders.d.ts +60 -0
- package/dist/operator-contracts/catalog/commands/command-tree-builders.js +191 -0
- package/dist/operator-contracts/catalog/communication-operations.d.ts +439 -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/execution/execution-operations.d.ts +36 -0
- package/dist/operator-contracts/catalog/execution/execution-operations.js +39 -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 +265 -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/catalog/workdays/profile-commands.d.ts +4 -0
- package/dist/operator-contracts/catalog/workdays/profile-commands.js +20 -0
- package/dist/operator-contracts/catalog/workdays/profile-operations.d.ts +41 -0
- package/dist/operator-contracts/catalog/workdays/profile-operations.js +50 -0
- package/dist/operator-contracts/catalog/workdays/selection-commands.d.ts +3 -0
- package/dist/operator-contracts/catalog/workdays/selection-commands.js +29 -0
- package/dist/operator-contracts/command-tree.d.ts +29 -0
- package/dist/operator-contracts/command-tree.js +50 -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 +1824 -0
- package/dist/operator-contracts/communication/contracts.js +190 -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 +2356 -209
- package/dist/operator-contracts/control-plane-operations.js +239 -102
- package/dist/operator-contracts/inbox/contracts.d.ts +1111 -0
- package/dist/operator-contracts/inbox/contracts.js +138 -0
- package/dist/operator-contracts/index.d.ts +6 -1
- package/dist/operator-contracts/index.js +6 -1
- 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/operator-contracts/workday-lifecycle.d.ts +21 -28
- package/dist/operator-contracts/workday-lifecycle.js +46 -8
- 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/sdk-types/support/sdk-model-names.d.ts +1 -1
- package/dist/sdk-types/support/sdk-model-names.js +0 -3
- 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 +42 -98
- package/dist/types/agents/agent-activity-profile.js +23 -0
- package/dist/types/agents/agent-trigger-kinds.d.ts +3 -5
- package/dist/types/agents/agent-trigger-kinds.js +1 -13
- package/dist/types/agents/execution-run-ref.d.ts +1 -8
- package/package.json +64 -11
- package/dist/agent-capacity/authority/agent-authority-presets.d.ts +0 -13
- package/dist/agent-capacity/authority/agent-authority-presets.js +0 -106
- package/dist/agent-capacity/contracts/operations/workflow-promotion.d.ts +0 -24
- package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.d.ts +0 -29
- package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.js +0 -110
- package/dist/agent-capacity/validation/workflow-promotion.d.ts +0 -2
- package/dist/agent-capacity/validation/workflow-promotion.js +0 -34
- package/dist/operator-contracts/workday-profile.d.ts +0 -72
- package/dist/operator-contracts/workday-profile.js +0 -106
- 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-artifact-list-response.js +0 -0
- package/dist/treedx/types/tree-dx-changeset.d.ts +0 -51
- package/dist/treedx/types/tree-dx-changeset.js +0 -6
- package/dist/treedx/types/tree-dx-context-request.d.ts +0 -245
- package/dist/treedx/types/tree-dx-context-request.js +0 -0
- package/dist/treedx/types/tree-dx-exec-result.d.ts +0 -249
- package/dist/treedx/types/tree-dx-exec-result.js +0 -0
- package/dist/treedx/types/tree-dx-list-tree-request.d.ts +0 -222
- package/dist/treedx/types/tree-dx-list-tree-request.js +0 -0
- package/dist/treedx/types/tree-dx-push-request.d.ts +0 -229
- package/dist/treedx/types/tree-dx-push-request.js +0 -0
- /package/dist/{agent-capacity/contracts/operations/workflow-promotion.js → site-contracts/cloudflare.js} +0 -0
- /package/dist/{treedx/generated/openapi-types.js → site-contracts/platform.js} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { EngineeringAssignmentGraphRoles } from '../support/decision-work.js';
|
|
2
|
-
export interface EngineeringWorkflowPromotionConfigV1 {
|
|
3
|
-
schemaVersion: 1;
|
|
4
|
-
id: string;
|
|
5
|
-
projectId: string;
|
|
6
|
-
decisionId: string;
|
|
7
|
-
objectiveId: string;
|
|
8
|
-
exactBaseRef: string;
|
|
9
|
-
roles: EngineeringAssignmentGraphRoles;
|
|
10
|
-
includeResearch?: boolean;
|
|
11
|
-
includeArchitecture?: boolean;
|
|
12
|
-
requireLinkedProposal?: boolean;
|
|
13
|
-
requireRevisionCycle?: boolean;
|
|
14
|
-
seconds?: Partial<Record<'research' | 'architecture' | 'test' | 'implementation' | 'verification' | 'review' | 'documentation' | 'release' | 'operations', number>>;
|
|
15
|
-
metadata?: Record<string, unknown>;
|
|
16
|
-
}
|
|
17
|
-
export interface EngineeringWorkflowPromotionValidation {
|
|
18
|
-
ok: boolean;
|
|
19
|
-
diagnostics: Array<{
|
|
20
|
-
code: string;
|
|
21
|
-
path: string;
|
|
22
|
-
message: string;
|
|
23
|
-
}>;
|
|
24
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { CapacityAdmissionCounterClaim, CapacityAdmissionReasonCode, CapacityAllocationSetV2 } from '../../../allocation.js';
|
|
2
|
-
interface AllocationHierarchyInput {
|
|
3
|
-
allocation: CapacityAllocationSetV2;
|
|
4
|
-
workdayId: string;
|
|
5
|
-
totalSeconds: number;
|
|
6
|
-
requestedSeconds: number;
|
|
7
|
-
selectedSliceIds: string[];
|
|
8
|
-
committedBySlice: Record<string, number>;
|
|
9
|
-
committedBorrowedByRule?: Record<string, number>;
|
|
10
|
-
reserveCommittedSeconds?: number;
|
|
11
|
-
approvedBorrowingRuleIds?: string[];
|
|
12
|
-
}
|
|
13
|
-
export interface AllocationHierarchyDecision {
|
|
14
|
-
reasons: CapacityAdmissionReasonCode[];
|
|
15
|
-
explanation: Array<{
|
|
16
|
-
gate: string;
|
|
17
|
-
allowed: boolean;
|
|
18
|
-
remaining?: number;
|
|
19
|
-
detail?: string;
|
|
20
|
-
}>;
|
|
21
|
-
counterClaims: CapacityAdmissionCounterClaim[];
|
|
22
|
-
maxReservableSeconds: number;
|
|
23
|
-
requiresApproval: boolean;
|
|
24
|
-
calculations: Record<string, unknown>;
|
|
25
|
-
priorityBand: 'minimum' | 'target' | 'normal' | 'overflow';
|
|
26
|
-
priorityScore: number;
|
|
27
|
-
}
|
|
28
|
-
export declare function evaluateAllocationHierarchy(input: AllocationHierarchyInput): AllocationHierarchyDecision;
|
|
29
|
-
export {};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
function sliceLimits(allocation, totalSeconds, slice, cache = /* @__PURE__ */ new Map()) {
|
|
2
|
-
const cached = cache.get(slice.id);
|
|
3
|
-
if (cached) return cached;
|
|
4
|
-
const parent = slice.parentSliceId ? allocation.slices.find((candidate) => candidate.id === slice.parentSliceId) : null;
|
|
5
|
-
const basis = parent ? sliceLimits(allocation, totalSeconds, parent, cache).target : totalSeconds;
|
|
6
|
-
const limits = {
|
|
7
|
-
min: basis * slice.policy.minPercent / 100,
|
|
8
|
-
target: basis * slice.policy.targetPercent / 100,
|
|
9
|
-
max: basis * slice.policy.maxPercent / 100,
|
|
10
|
-
hard: basis * slice.policy.hardCapPercent / 100
|
|
11
|
-
};
|
|
12
|
-
cache.set(slice.id, limits);
|
|
13
|
-
return limits;
|
|
14
|
-
}
|
|
15
|
-
function claim(id, scope, scopeId, periodKey, hardLimit, amount) {
|
|
16
|
-
return amount > 0 ? { id, scope, scopeId, periodKey, hardLimit, amount, release: "settlement-difference" } : null;
|
|
17
|
-
}
|
|
18
|
-
function evaluateAllocationHierarchy(input) {
|
|
19
|
-
const reasons = [];
|
|
20
|
-
const explanation = [];
|
|
21
|
-
const counterClaims = [];
|
|
22
|
-
const calculations = {};
|
|
23
|
-
const approved = new Set(input.approvedBorrowingRuleIds ?? []);
|
|
24
|
-
const cache = /* @__PURE__ */ new Map();
|
|
25
|
-
let remaining = Number.POSITIVE_INFINITY;
|
|
26
|
-
let requiresApproval = false;
|
|
27
|
-
let priorityScore = 4;
|
|
28
|
-
for (const sliceId of input.selectedSliceIds) {
|
|
29
|
-
const slice = input.allocation.slices.find((candidate) => candidate.id === sliceId);
|
|
30
|
-
if (!slice) {
|
|
31
|
-
reasons.push("allocation_slice_missing");
|
|
32
|
-
explanation.push({ gate: `allocation:${sliceId}`, allowed: false, detail: "selected slice does not exist" });
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
const limits = sliceLimits(input.allocation, input.totalSeconds, slice, cache);
|
|
36
|
-
const committed = input.committedBySlice[sliceId] ?? 0;
|
|
37
|
-
const normalAvailable = Math.max(0, limits.max - committed);
|
|
38
|
-
const overflowAvailable = Math.max(0, limits.hard - Math.max(committed, limits.max));
|
|
39
|
-
let available = normalAvailable;
|
|
40
|
-
let overflowSource = "none";
|
|
41
|
-
let overflowRuleId = null;
|
|
42
|
-
let overflowSourceAvailable = 0;
|
|
43
|
-
if (overflowAvailable > 0) {
|
|
44
|
-
const rule = input.allocation.borrowingRules.find((candidate) => candidate.toSliceId === sliceId);
|
|
45
|
-
if (rule) {
|
|
46
|
-
const donor = input.allocation.slices.find((candidate) => candidate.id === rule.fromSliceId);
|
|
47
|
-
if (donor) {
|
|
48
|
-
const donorLimits = sliceLimits(input.allocation, input.totalSeconds, donor, cache);
|
|
49
|
-
const donorCommitted = input.committedBySlice[donor.id] ?? 0;
|
|
50
|
-
const donorAvailable = Math.max(0, donorLimits.target - Math.max(donorCommitted, donorLimits.min));
|
|
51
|
-
const ruleLimit = donorLimits.target * rule.maxPercent / 100;
|
|
52
|
-
const ruleAvailable = Math.max(0, ruleLimit - (input.committedBorrowedByRule?.[rule.id] ?? 0));
|
|
53
|
-
overflowSource = "borrowing-rule";
|
|
54
|
-
overflowRuleId = rule.id;
|
|
55
|
-
overflowSourceAvailable = Math.min(donorAvailable, ruleAvailable);
|
|
56
|
-
}
|
|
57
|
-
} else if (!slice.parentSliceId) {
|
|
58
|
-
overflowSource = "reserve";
|
|
59
|
-
overflowSourceAvailable = Math.max(0, input.totalSeconds * input.allocation.reservePolicy.percent / 100 - (input.reserveCommittedSeconds ?? 0));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const usableOverflow = Math.min(overflowAvailable, overflowSourceAvailable);
|
|
63
|
-
if (input.allocation.reservePolicy.overflow === "borrow") available += usableOverflow;
|
|
64
|
-
else if (input.requestedSeconds > normalAvailable && input.allocation.reservePolicy.overflow === "approval-required") {
|
|
65
|
-
requiresApproval = true;
|
|
66
|
-
reasons.push("allocation_borrowing_approval_required");
|
|
67
|
-
}
|
|
68
|
-
if (overflowRuleId) {
|
|
69
|
-
const rule = input.allocation.borrowingRules.find((candidate) => candidate.id === overflowRuleId);
|
|
70
|
-
if (rule.requiresApproval && !approved.has(rule.id) && input.requestedSeconds > normalAvailable) {
|
|
71
|
-
requiresApproval = true;
|
|
72
|
-
reasons.push("allocation_borrowing_approval_required");
|
|
73
|
-
available = normalAvailable;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (input.requestedSeconds > available && !reasons.includes("allocation_borrowing_approval_required")) {
|
|
77
|
-
reasons.push(input.allocation.reservePolicy.overflow === "deny" ? "allocation_borrowing_denied" : "allocation_hard_cap_exhausted");
|
|
78
|
-
}
|
|
79
|
-
remaining = Math.min(remaining, available);
|
|
80
|
-
const ownAmount = Math.min(input.requestedSeconds, normalAvailable);
|
|
81
|
-
const overflowAmount = Math.max(0, input.requestedSeconds - ownAmount);
|
|
82
|
-
const ownClaim = claim(`allocation-slice:${input.allocation.id}:${slice.id}:${input.workdayId}`, "allocation-slice", `${input.allocation.id}:${slice.id}`, input.workdayId, limits.max, ownAmount);
|
|
83
|
-
if (ownClaim) counterClaims.push(ownClaim);
|
|
84
|
-
if (overflowAmount > 0 && overflowAmount <= usableOverflow && input.allocation.reservePolicy.overflow === "borrow") {
|
|
85
|
-
const overflowClaim = claim(`allocation-overflow:${input.allocation.id}:${slice.id}:${input.workdayId}`, "allocation-overflow", `${input.allocation.id}:${slice.id}`, input.workdayId, Math.max(0, limits.hard - limits.max), overflowAmount);
|
|
86
|
-
if (overflowClaim) counterClaims.push(overflowClaim);
|
|
87
|
-
if (overflowSource === "reserve") {
|
|
88
|
-
const reserveClaim = claim(`allocation-reserve:${input.allocation.id}:${input.workdayId}`, "allocation-reserve", input.allocation.id, input.workdayId, input.totalSeconds * input.allocation.reservePolicy.percent / 100, overflowAmount);
|
|
89
|
-
if (reserveClaim) counterClaims.push(reserveClaim);
|
|
90
|
-
} else if (overflowRuleId) {
|
|
91
|
-
const rule = input.allocation.borrowingRules.find((candidate) => candidate.id === overflowRuleId);
|
|
92
|
-
const donor = input.allocation.slices.find((candidate) => candidate.id === rule.fromSliceId);
|
|
93
|
-
const donorLimits = sliceLimits(input.allocation, input.totalSeconds, donor, cache);
|
|
94
|
-
const donorClaim = claim(`allocation-slice:${input.allocation.id}:${donor.id}:${input.workdayId}`, "allocation-slice", `${input.allocation.id}:${donor.id}`, input.workdayId, donorLimits.target, overflowAmount);
|
|
95
|
-
const ruleClaim = claim(`allocation-borrow:${input.allocation.id}:${rule.id}:${input.workdayId}`, "allocation-borrow", `${input.allocation.id}:${rule.id}`, input.workdayId, donorLimits.target * rule.maxPercent / 100, overflowAmount);
|
|
96
|
-
if (donorClaim) counterClaims.push(donorClaim);
|
|
97
|
-
if (ruleClaim) counterClaims.push(ruleClaim);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
const position = committed < limits.min ? "below-minimum" : committed < limits.target ? "below-target" : committed < limits.max ? "above-target" : "overflow";
|
|
101
|
-
priorityScore = Math.min(priorityScore, position === "below-minimum" ? 4 : position === "below-target" ? 3 : position === "above-target" ? 2 : 1);
|
|
102
|
-
calculations[sliceId] = { committed, ...limits, normalAvailable, overflowAvailable, overflowSource, overflowSourceAvailable, usableOverflow, position };
|
|
103
|
-
explanation.push({ gate: `allocation:${sliceId}`, allowed: input.requestedSeconds <= available, remaining: available, detail: JSON.stringify(calculations[sliceId]) });
|
|
104
|
-
}
|
|
105
|
-
const priorityBand = priorityScore === 4 ? "minimum" : priorityScore === 3 ? "target" : priorityScore === 2 ? "normal" : "overflow";
|
|
106
|
-
return { reasons: [...new Set(reasons)], explanation, counterClaims, maxReservableSeconds: Number.isFinite(remaining) ? Math.max(0, remaining) : 0, requiresApproval, calculations, priorityBand, priorityScore };
|
|
107
|
-
}
|
|
108
|
-
export {
|
|
109
|
-
evaluateAllocationHierarchy
|
|
110
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const REQUIRED_ROLES = ["tester", "engineer", "reviewer", "technicalWriter", "releaser"];
|
|
2
|
-
function text(value) {
|
|
3
|
-
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
4
|
-
}
|
|
5
|
-
function validateEngineeringWorkflowPromotionConfig(value) {
|
|
6
|
-
const diagnostics = [];
|
|
7
|
-
const input = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
8
|
-
if (input.schemaVersion !== 1) diagnostics.push({ code: "schema_version_invalid", path: "schemaVersion", message: "schemaVersion must be 1." });
|
|
9
|
-
for (const field of ["id", "projectId", "decisionId", "objectiveId", "exactBaseRef"]) {
|
|
10
|
-
if (!text(input[field])) diagnostics.push({ code: "field_required", path: field, message: `${field} is required.` });
|
|
11
|
-
}
|
|
12
|
-
if (text(input.exactBaseRef) && !/^[0-9a-f]{7,64}$/iu.test(input.exactBaseRef)) {
|
|
13
|
-
diagnostics.push({ code: "exact_base_ref_invalid", path: "exactBaseRef", message: "exactBaseRef must be an immutable hexadecimal commit id." });
|
|
14
|
-
}
|
|
15
|
-
const roles = input.roles && typeof input.roles === "object" ? input.roles : {};
|
|
16
|
-
for (const role of REQUIRED_ROLES) {
|
|
17
|
-
if (!text(roles[role])) diagnostics.push({ code: "role_required", path: `roles.${role}`, message: `${role} role is required.` });
|
|
18
|
-
}
|
|
19
|
-
for (const optional of ["operations", "researcher", "architect"]) {
|
|
20
|
-
if (roles[optional] != null && !text(roles[optional])) diagnostics.push({ code: "role_invalid", path: `roles.${optional}`, message: `${optional} must be a non-empty string when supplied.` });
|
|
21
|
-
}
|
|
22
|
-
if (input.includeResearch === true && !text(roles.researcher)) diagnostics.push({ code: "researcher_role_required", path: "roles.researcher", message: "includeResearch requires a researcher role." });
|
|
23
|
-
if (input.includeArchitecture === true && !text(roles.architect)) diagnostics.push({ code: "architect_role_required", path: "roles.architect", message: "includeArchitecture requires an architect role." });
|
|
24
|
-
if (input.requireRevisionCycle != null && typeof input.requireRevisionCycle !== "boolean") {
|
|
25
|
-
diagnostics.push({ code: "revision_cycle_invalid", path: "requireRevisionCycle", message: "requireRevisionCycle must be boolean when supplied." });
|
|
26
|
-
}
|
|
27
|
-
for (const [stage, amount] of Object.entries(input.seconds ?? {})) {
|
|
28
|
-
if (!Number.isFinite(amount) || Number(amount) <= 0) diagnostics.push({ code: "time_invalid", path: `seconds.${stage}`, message: "Stage agent time must be positive finite seconds." });
|
|
29
|
-
}
|
|
30
|
-
return { ok: diagnostics.length === 0, diagnostics };
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
validateEngineeringWorkflowPromotionConfig
|
|
34
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export type WorkdayDemandSourcePolicy = 'approved-decisions' | 'planning-inputs' | 'questions' | 'proposals' | 'knowledge-gaps' | 'reliability-campaigns';
|
|
2
|
-
export interface WorkdayClassAllocation {
|
|
3
|
-
classSlug: string;
|
|
4
|
-
minimumPercent: number;
|
|
5
|
-
targetPercent: number;
|
|
6
|
-
maximumPercent: number;
|
|
7
|
-
mayLend: boolean;
|
|
8
|
-
mayBorrow: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface WorkdayAllocationProfile {
|
|
11
|
-
schemaVersion: 'treeseed.workday-allocation-profile/v1';
|
|
12
|
-
id: string;
|
|
13
|
-
version: string;
|
|
14
|
-
projects: 'all' | string[];
|
|
15
|
-
excludedClassSlugs?: Record<string, string[]>;
|
|
16
|
-
classes: WorkdayClassAllocation[];
|
|
17
|
-
demandSources: WorkdayDemandSourcePolicy[];
|
|
18
|
-
actingDecisionRequired: true;
|
|
19
|
-
defaultDurationSeconds: number;
|
|
20
|
-
maxConcurrency: number;
|
|
21
|
-
reservePercent: number;
|
|
22
|
-
prioritization: {
|
|
23
|
-
strategy: 'priority-then-age' | 'age-then-priority' | 'weighted-fair';
|
|
24
|
-
starvationLimitSeconds: number;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export interface RepositoryWorkdayProfileBundle {
|
|
28
|
-
schemaVersion: 'treeseed.workday-allocation-profile-bundle/v1';
|
|
29
|
-
profiles: WorkdayAllocationProfile[];
|
|
30
|
-
}
|
|
31
|
-
export interface ProjectAgentClassMembership {
|
|
32
|
-
projectId: string;
|
|
33
|
-
agentId: string;
|
|
34
|
-
classSlug: string;
|
|
35
|
-
status: 'active' | 'paused' | 'archived';
|
|
36
|
-
}
|
|
37
|
-
export interface ProjectAgentIdentity {
|
|
38
|
-
projectId: string;
|
|
39
|
-
agentId: string;
|
|
40
|
-
}
|
|
41
|
-
export interface ProjectClassCatalog {
|
|
42
|
-
projectId: string;
|
|
43
|
-
classSlugs: string[];
|
|
44
|
-
}
|
|
45
|
-
export interface WorkdayProfileDiagnostic {
|
|
46
|
-
code: string;
|
|
47
|
-
path: string;
|
|
48
|
-
message: string;
|
|
49
|
-
}
|
|
50
|
-
export interface WorkdayBorrowingEvidence {
|
|
51
|
-
workdayId: string;
|
|
52
|
-
borrowerClassSlug: string;
|
|
53
|
-
lenderClassSlug: string;
|
|
54
|
-
borrowedSeconds: number;
|
|
55
|
-
lendingPermitted: boolean;
|
|
56
|
-
borrowingPermitted: boolean;
|
|
57
|
-
lenderAllocatedSecondsBefore: number;
|
|
58
|
-
lenderAllocatedSecondsAfter: number;
|
|
59
|
-
lenderMinimumSeconds: number;
|
|
60
|
-
borrowerAllocatedSecondsBefore: number;
|
|
61
|
-
borrowerAllocatedSecondsAfter: number;
|
|
62
|
-
borrowerMaximumSeconds: number;
|
|
63
|
-
profileId: string;
|
|
64
|
-
profileVersion: string;
|
|
65
|
-
profileDigest: string;
|
|
66
|
-
}
|
|
67
|
-
export declare function validateOneClassPerProjectAgent(memberships: ProjectAgentClassMembership[], expectedAgents?: ProjectAgentIdentity[]): WorkdayProfileDiagnostic[];
|
|
68
|
-
export declare function validateWorkdayAllocationProfile(profile: WorkdayAllocationProfile, classCatalogs?: ProjectClassCatalog[]): WorkdayProfileDiagnostic[];
|
|
69
|
-
export declare function normalizeWorkdayAllocationProfile(profile: WorkdayAllocationProfile): WorkdayAllocationProfile;
|
|
70
|
-
export declare function validateRepositoryWorkdayProfileBundle(bundle: RepositoryWorkdayProfileBundle, classCatalogs?: ProjectClassCatalog[]): WorkdayProfileDiagnostic[];
|
|
71
|
-
export declare function normalizeRepositoryWorkdayProfileBundle(bundle: RepositoryWorkdayProfileBundle): RepositoryWorkdayProfileBundle;
|
|
72
|
-
export declare function validateWorkdayBorrowingEvidence(evidence: WorkdayBorrowingEvidence): WorkdayProfileDiagnostic[];
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
const PERCENT_TOLERANCE = 1e-6;
|
|
2
|
-
const PROFILE_VERSION = /^[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
3
|
-
function validateOneClassPerProjectAgent(memberships, expectedAgents = []) {
|
|
4
|
-
const diagnostics = [];
|
|
5
|
-
const byAgent = /* @__PURE__ */ new Map();
|
|
6
|
-
for (const membership of memberships) {
|
|
7
|
-
const key = `${membership.projectId}:${membership.agentId}`;
|
|
8
|
-
byAgent.set(key, [...byAgent.get(key) ?? [], membership]);
|
|
9
|
-
}
|
|
10
|
-
for (const [key, values] of byAgent) {
|
|
11
|
-
if (values.length !== 1) diagnostics.push({ code: "agent_class_membership_multiple", path: `memberships.${key}`, message: "Each project agent must have exactly one allocation-class membership." });
|
|
12
|
-
if (values.some((value) => value.status !== "active")) diagnostics.push({ code: "agent_class_membership_inactive", path: `memberships.${key}`, message: "The single allocation-class membership must be active." });
|
|
13
|
-
}
|
|
14
|
-
for (const agent of expectedAgents) {
|
|
15
|
-
const key = `${agent.projectId}:${agent.agentId}`;
|
|
16
|
-
if (!byAgent.has(key)) diagnostics.push({ code: "agent_class_membership_missing", path: `memberships.${key}`, message: "Each project agent must have exactly one allocation-class membership." });
|
|
17
|
-
}
|
|
18
|
-
return diagnostics;
|
|
19
|
-
}
|
|
20
|
-
function validateWorkdayAllocationProfile(profile, classCatalogs) {
|
|
21
|
-
const diagnostics = [];
|
|
22
|
-
if (profile.schemaVersion !== "treeseed.workday-allocation-profile/v1") diagnostics.push({ code: "schema_version_invalid", path: "schemaVersion", message: "Unsupported workday allocation profile schema." });
|
|
23
|
-
if (!profile.id.trim()) diagnostics.push({ code: "profile_id_required", path: "id", message: "Profile id is required." });
|
|
24
|
-
if (!PROFILE_VERSION.test(profile.version)) diagnostics.push({ code: "profile_version_invalid", path: "version", message: "Profile version must be a semantic version." });
|
|
25
|
-
if (profile.actingDecisionRequired !== true) diagnostics.push({ code: "acting_decision_requirement_invalid", path: "actingDecisionRequired", message: "Acting work must require an approved decision." });
|
|
26
|
-
if (profile.projects !== "all" && profile.projects.length === 0) diagnostics.push({ code: "project_scope_empty", path: "projects", message: "Profile project scope must select at least one project or all." });
|
|
27
|
-
if (profile.demandSources.length === 0) diagnostics.push({ code: "demand_sources_empty", path: "demandSources", message: "At least one governed demand source is required." });
|
|
28
|
-
if (new Set(profile.demandSources).size !== profile.demandSources.length) diagnostics.push({ code: "demand_source_duplicate", path: "demandSources", message: "Demand sources must be unique." });
|
|
29
|
-
if (!Number.isInteger(profile.defaultDurationSeconds) || profile.defaultDurationSeconds <= 0) diagnostics.push({ code: "duration_invalid", path: "defaultDurationSeconds", message: "Default duration must be a positive integer number of seconds." });
|
|
30
|
-
if (!Number.isInteger(profile.maxConcurrency) || profile.maxConcurrency <= 0) diagnostics.push({ code: "concurrency_invalid", path: "maxConcurrency", message: "Maximum concurrency must be a positive integer." });
|
|
31
|
-
if (!Number.isFinite(profile.reservePercent) || profile.reservePercent < 0 || profile.reservePercent > 100) diagnostics.push({ code: "reserve_invalid", path: "reservePercent", message: "Reserve percent must be between 0 and 100." });
|
|
32
|
-
if (!Number.isFinite(profile.prioritization.starvationLimitSeconds) || profile.prioritization.starvationLimitSeconds <= 0) diagnostics.push({ code: "starvation_limit_invalid", path: "prioritization.starvationLimitSeconds", message: "Starvation limit must be positive." });
|
|
33
|
-
const classSlugs = /* @__PURE__ */ new Set();
|
|
34
|
-
let minimumTotal = 0;
|
|
35
|
-
let targetTotal = 0;
|
|
36
|
-
let maximumTotal = 0;
|
|
37
|
-
for (const [index, allocation] of profile.classes.entries()) {
|
|
38
|
-
const path = `classes.${index}`;
|
|
39
|
-
if (!allocation.classSlug.trim()) diagnostics.push({ code: "class_slug_required", path: `${path}.classSlug`, message: "Class slug is required." });
|
|
40
|
-
if (classSlugs.has(allocation.classSlug)) diagnostics.push({ code: "class_slug_duplicate", path: `${path}.classSlug`, message: `Class ${allocation.classSlug} is declared more than once.` });
|
|
41
|
-
classSlugs.add(allocation.classSlug);
|
|
42
|
-
const values = [allocation.minimumPercent, allocation.targetPercent, allocation.maximumPercent];
|
|
43
|
-
if (values.some((value) => !Number.isFinite(value) || value < 0 || value > 100) || allocation.minimumPercent > allocation.targetPercent || allocation.targetPercent > allocation.maximumPercent) diagnostics.push({ code: "class_allocation_invalid", path, message: "Class allocation must satisfy 0 <= minimum <= target <= maximum <= 100." });
|
|
44
|
-
minimumTotal += allocation.minimumPercent;
|
|
45
|
-
targetTotal += allocation.targetPercent;
|
|
46
|
-
maximumTotal += allocation.maximumPercent;
|
|
47
|
-
}
|
|
48
|
-
if (minimumTotal > 100 + PERCENT_TOLERANCE) diagnostics.push({ code: "minimum_total_invalid", path: "classes", message: "Class minimum percentages cannot total more than 100." });
|
|
49
|
-
if (Math.abs(targetTotal - 100) > PERCENT_TOLERANCE) diagnostics.push({ code: "target_total_invalid", path: "classes", message: "Class target percentages must total exactly 100." });
|
|
50
|
-
if (maximumTotal < 100 - PERCENT_TOLERANCE) diagnostics.push({ code: "maximum_total_invalid", path: "classes", message: "Class maximum percentages must total at least 100." });
|
|
51
|
-
const selectedProjects = classCatalogs === void 0 ? [] : profile.projects === "all" ? classCatalogs.map((catalog) => catalog.projectId) : profile.projects;
|
|
52
|
-
for (const projectId of selectedProjects) {
|
|
53
|
-
const catalog = classCatalogs?.find((candidate) => candidate.projectId === projectId);
|
|
54
|
-
if (!catalog) {
|
|
55
|
-
diagnostics.push({ code: "project_class_catalog_missing", path: `projects.${projectId}`, message: `No class catalog exists for selected project ${projectId}.` });
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
const exclusions = new Set(profile.excludedClassSlugs?.[projectId] ?? []);
|
|
59
|
-
for (const classSlug of classSlugs) {
|
|
60
|
-
if (!catalog.classSlugs.includes(classSlug) && !exclusions.has(classSlug)) diagnostics.push({ code: "class_missing_from_project", path: `projects.${projectId}.${classSlug}`, message: `Class ${classSlug} is missing from project ${projectId} and is not explicitly excluded.` });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return diagnostics;
|
|
64
|
-
}
|
|
65
|
-
function normalizeWorkdayAllocationProfile(profile) {
|
|
66
|
-
return {
|
|
67
|
-
...profile,
|
|
68
|
-
projects: profile.projects === "all" ? "all" : [...new Set(profile.projects)].sort(),
|
|
69
|
-
excludedClassSlugs: profile.excludedClassSlugs ? Object.fromEntries(Object.entries(profile.excludedClassSlugs).sort(([left], [right]) => left.localeCompare(right)).map(([projectId, slugs]) => [projectId, [...new Set(slugs)].sort()])) : void 0,
|
|
70
|
-
classes: [...profile.classes].sort((left, right) => left.classSlug.localeCompare(right.classSlug)),
|
|
71
|
-
demandSources: [...new Set(profile.demandSources)].sort()
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function validateRepositoryWorkdayProfileBundle(bundle, classCatalogs) {
|
|
75
|
-
const diagnostics = [];
|
|
76
|
-
if (bundle.schemaVersion !== "treeseed.workday-allocation-profile-bundle/v1") diagnostics.push({ code: "bundle_schema_version_invalid", path: "schemaVersion", message: "Unsupported repository workday profile bundle schema." });
|
|
77
|
-
if (!Array.isArray(bundle.profiles) || bundle.profiles.length === 0) diagnostics.push({ code: "bundle_profiles_empty", path: "profiles", message: "A repository workday profile bundle must contain at least one profile." });
|
|
78
|
-
const profileIds = /* @__PURE__ */ new Set();
|
|
79
|
-
for (const [index, profile] of (Array.isArray(bundle.profiles) ? bundle.profiles : []).entries()) {
|
|
80
|
-
if (profileIds.has(profile.id)) diagnostics.push({ code: "bundle_profile_id_duplicate", path: `profiles.${index}.id`, message: `Stable profile id ${profile.id} is declared more than once; a repository bundle contains exactly one current generation per profile.` });
|
|
81
|
-
profileIds.add(profile.id);
|
|
82
|
-
diagnostics.push(...validateWorkdayAllocationProfile(profile, classCatalogs).map((diagnostic) => ({ ...diagnostic, path: `profiles.${index}.${diagnostic.path}` })));
|
|
83
|
-
}
|
|
84
|
-
return diagnostics;
|
|
85
|
-
}
|
|
86
|
-
function normalizeRepositoryWorkdayProfileBundle(bundle) {
|
|
87
|
-
return { schemaVersion: "treeseed.workday-allocation-profile-bundle/v1", profiles: [...bundle.profiles].map(normalizeWorkdayAllocationProfile).sort((left, right) => left.id.localeCompare(right.id) || left.version.localeCompare(right.version)) };
|
|
88
|
-
}
|
|
89
|
-
function validateWorkdayBorrowingEvidence(evidence) {
|
|
90
|
-
const diagnostics = [];
|
|
91
|
-
if (!evidence.lendingPermitted) diagnostics.push({ code: "lending_not_permitted", path: "lendingPermitted", message: "The profile does not permit the lender to lend capacity." });
|
|
92
|
-
if (!evidence.borrowingPermitted) diagnostics.push({ code: "borrowing_not_permitted", path: "borrowingPermitted", message: "The profile does not permit the borrower to borrow capacity." });
|
|
93
|
-
if (evidence.borrowedSeconds <= 0) diagnostics.push({ code: "borrowed_seconds_invalid", path: "borrowedSeconds", message: "Borrowed seconds must be positive." });
|
|
94
|
-
if (evidence.lenderAllocatedSecondsAfter < evidence.lenderMinimumSeconds) diagnostics.push({ code: "lender_minimum_violated", path: "lenderAllocatedSecondsAfter", message: "Borrowing cannot reduce the lender below its minimum." });
|
|
95
|
-
if (evidence.borrowerAllocatedSecondsAfter > evidence.borrowerMaximumSeconds) diagnostics.push({ code: "borrower_maximum_violated", path: "borrowerAllocatedSecondsAfter", message: "Borrowing cannot raise the borrower above its maximum." });
|
|
96
|
-
if (evidence.lenderAllocatedSecondsBefore - evidence.lenderAllocatedSecondsAfter !== evidence.borrowedSeconds || evidence.borrowerAllocatedSecondsAfter - evidence.borrowerAllocatedSecondsBefore !== evidence.borrowedSeconds) diagnostics.push({ code: "borrowing_accounting_mismatch", path: "borrowedSeconds", message: "Lender and borrower deltas must exactly equal the borrowed seconds." });
|
|
97
|
-
return diagnostics;
|
|
98
|
-
}
|
|
99
|
-
export {
|
|
100
|
-
normalizeRepositoryWorkdayProfileBundle,
|
|
101
|
-
normalizeWorkdayAllocationProfile,
|
|
102
|
-
validateOneClassPerProjectAgent,
|
|
103
|
-
validateRepositoryWorkdayProfileBundle,
|
|
104
|
-
validateWorkdayAllocationProfile,
|
|
105
|
-
validateWorkdayBorrowingEvidence
|
|
106
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export declare const SERVICE_VAULT_ENCRYPTION_VERSION: "service-vault-v1";
|
|
2
|
-
export declare const SERVICE_VAULT_AEAD_ALGORITHM: "xchacha20-poly1305-ietf";
|
|
3
|
-
export declare const SERVICE_VAULT_KEY_AGREEMENT: "x25519-sealed-box";
|
|
4
|
-
export declare const SERVICE_VAULT_KDF: "argon2id";
|
|
5
|
-
export type EncryptedCredentialEnvelope = {
|
|
6
|
-
version: typeof SERVICE_VAULT_ENCRYPTION_VERSION;
|
|
7
|
-
algorithm: typeof SERVICE_VAULT_AEAD_ALGORITHM;
|
|
8
|
-
ciphertext: string;
|
|
9
|
-
nonce: string;
|
|
10
|
-
wrappedKey: string;
|
|
11
|
-
wrappedKeyNonce: string;
|
|
12
|
-
associatedData: string;
|
|
13
|
-
associatedDataDigest: string;
|
|
14
|
-
fingerprint: string;
|
|
15
|
-
};
|
|
16
|
-
export type EncryptedPrivateKeyEnvelope = {
|
|
17
|
-
version: typeof SERVICE_VAULT_ENCRYPTION_VERSION;
|
|
18
|
-
algorithm: typeof SERVICE_VAULT_AEAD_ALGORITHM;
|
|
19
|
-
kdf: {
|
|
20
|
-
algorithm: typeof SERVICE_VAULT_KDF;
|
|
21
|
-
opsLimit: number;
|
|
22
|
-
memLimit: number;
|
|
23
|
-
salt: string;
|
|
24
|
-
};
|
|
25
|
-
nonce: string;
|
|
26
|
-
ciphertext: string;
|
|
27
|
-
publicKey: string;
|
|
28
|
-
};
|
|
29
|
-
export type TeamVaultGrantEnvelope = {
|
|
30
|
-
version: typeof SERVICE_VAULT_ENCRYPTION_VERSION;
|
|
31
|
-
algorithm: typeof SERVICE_VAULT_KEY_AGREEMENT;
|
|
32
|
-
recipientPublicKey: string;
|
|
33
|
-
wrappedTeamVaultKey: string;
|
|
34
|
-
};
|
|
35
|
-
export type SecretOperationLease = {
|
|
36
|
-
id: string;
|
|
37
|
-
teamId: string;
|
|
38
|
-
connectionId: string;
|
|
39
|
-
capabilityType: string;
|
|
40
|
-
purpose: 'provider-connection-validation' | 'remote-git-publication' | 'workflow-dispatch' | 'workflow-configuration';
|
|
41
|
-
resourceScope: Record<string, string>;
|
|
42
|
-
credentialProfileId: string;
|
|
43
|
-
actorUserId: string;
|
|
44
|
-
requiredFields: string[];
|
|
45
|
-
publicKey: string;
|
|
46
|
-
status: 'awaiting-runner' | 'pending' | 'ready' | 'consumed' | 'expired' | 'cancelled' | 'failed';
|
|
47
|
-
expiresAt: string;
|
|
48
|
-
consumedAt?: string | null;
|
|
49
|
-
operationCorrelationId: string;
|
|
50
|
-
};
|
|
51
|
-
export type ServiceVaultAssociatedData = {
|
|
52
|
-
teamId: string;
|
|
53
|
-
connectionId: string;
|
|
54
|
-
credentialProfileId: string;
|
|
55
|
-
field: string;
|
|
56
|
-
purpose: string;
|
|
57
|
-
version: number;
|
|
58
|
-
};
|
|
59
|
-
export declare function containsForbiddenPlaintextSecretMaterial(value: unknown, path?: string): string[];
|
|
60
|
-
export declare function canonicalServiceVaultAssociatedData(input: ServiceVaultAssociatedData): string;
|
|
61
|
-
export declare function validateEncryptedCredentialEnvelope(value: unknown): value is EncryptedCredentialEnvelope;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const SERVICE_VAULT_ENCRYPTION_VERSION = "service-vault-v1";
|
|
2
|
-
const SERVICE_VAULT_AEAD_ALGORITHM = "xchacha20-poly1305-ietf";
|
|
3
|
-
const SERVICE_VAULT_KEY_AGREEMENT = "x25519-sealed-box";
|
|
4
|
-
const SERVICE_VAULT_KDF = "argon2id";
|
|
5
|
-
const FORBIDDEN_SECRET_KEYS = /(?:passphrase|password|plaintext|derivedKey|privateKey|apiToken|accessToken|secretValue|credentialValue)$/iu;
|
|
6
|
-
function containsForbiddenPlaintextSecretMaterial(value, path = "") {
|
|
7
|
-
if (!value || typeof value !== "object") return [];
|
|
8
|
-
const failures = [];
|
|
9
|
-
for (const [key, entry] of Object.entries(value)) {
|
|
10
|
-
const nextPath = path ? `${path}.${key}` : key;
|
|
11
|
-
if (FORBIDDEN_SECRET_KEYS.test(key) && typeof entry === "string" && entry.trim()) failures.push(nextPath);
|
|
12
|
-
if (entry && typeof entry === "object") failures.push(...containsForbiddenPlaintextSecretMaterial(entry, nextPath));
|
|
13
|
-
}
|
|
14
|
-
return failures;
|
|
15
|
-
}
|
|
16
|
-
function canonicalServiceVaultAssociatedData(input) {
|
|
17
|
-
return JSON.stringify({
|
|
18
|
-
teamId: input.teamId,
|
|
19
|
-
connectionId: input.connectionId,
|
|
20
|
-
credentialProfileId: input.credentialProfileId,
|
|
21
|
-
field: input.field,
|
|
22
|
-
purpose: input.purpose,
|
|
23
|
-
version: input.version
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function validateEncryptedCredentialEnvelope(value) {
|
|
27
|
-
if (!value || typeof value !== "object") return false;
|
|
28
|
-
const envelope = value;
|
|
29
|
-
return envelope.version === SERVICE_VAULT_ENCRYPTION_VERSION && envelope.algorithm === SERVICE_VAULT_AEAD_ALGORITHM && [envelope.ciphertext, envelope.nonce, envelope.wrappedKey, envelope.wrappedKeyNonce, envelope.associatedData, envelope.associatedDataDigest, envelope.fingerprint].every((field) => typeof field === "string" && field.length > 0);
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
SERVICE_VAULT_AEAD_ALGORITHM,
|
|
33
|
-
SERVICE_VAULT_ENCRYPTION_VERSION,
|
|
34
|
-
SERVICE_VAULT_KDF,
|
|
35
|
-
SERVICE_VAULT_KEY_AGREEMENT,
|
|
36
|
-
canonicalServiceVaultAssociatedData,
|
|
37
|
-
containsForbiddenPlaintextSecretMaterial,
|
|
38
|
-
validateEncryptedCredentialEnvelope
|
|
39
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface TreeDxHs256TokenInput {
|
|
2
|
-
secret: string;
|
|
3
|
-
issuer: string;
|
|
4
|
-
audience: string;
|
|
5
|
-
actorId: string;
|
|
6
|
-
tenantId: string;
|
|
7
|
-
repoIds?: string[];
|
|
8
|
-
capabilities?: string[];
|
|
9
|
-
refs?: string[];
|
|
10
|
-
paths?: string[];
|
|
11
|
-
projectId?: string;
|
|
12
|
-
capacityWorkdayRunId?: string;
|
|
13
|
-
ttlSeconds?: number;
|
|
14
|
-
nowEpochSeconds?: number;
|
|
15
|
-
jti?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function mintTreeDxHs256Token(input: TreeDxHs256TokenInput): string;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { createHmac, randomUUID } from "node:crypto";
|
|
2
|
-
function required(value, owner) {
|
|
3
|
-
const normalized = value.trim();
|
|
4
|
-
if (!normalized) throw new Error(`${owner} is required to mint a TreeDX token.`);
|
|
5
|
-
return normalized;
|
|
6
|
-
}
|
|
7
|
-
function normalizedStrings(values, fallback) {
|
|
8
|
-
const normalized = values?.map((value) => String(value).trim()).filter(Boolean) ?? [];
|
|
9
|
-
return normalized.length > 0 ? [...new Set(normalized)] : fallback;
|
|
10
|
-
}
|
|
11
|
-
function base64urlJson(value) {
|
|
12
|
-
return Buffer.from(JSON.stringify(value)).toString("base64url");
|
|
13
|
-
}
|
|
14
|
-
function mintTreeDxHs256Token(input) {
|
|
15
|
-
const secret = required(input.secret, "secret");
|
|
16
|
-
const issuer = required(input.issuer, "issuer");
|
|
17
|
-
const audience = required(input.audience, "audience");
|
|
18
|
-
const actorId = required(input.actorId, "actorId");
|
|
19
|
-
const tenantId = required(input.tenantId, "tenantId");
|
|
20
|
-
const ttlSeconds = input.ttlSeconds ?? 300;
|
|
21
|
-
if (!Number.isInteger(ttlSeconds) || ttlSeconds < 30 || ttlSeconds > 3600) {
|
|
22
|
-
throw new Error("ttlSeconds must be an integer between 30 and 3600.");
|
|
23
|
-
}
|
|
24
|
-
const now = input.nowEpochSeconds ?? Math.floor(Date.now() / 1e3);
|
|
25
|
-
if (!Number.isInteger(now) || now < 0) throw new Error("nowEpochSeconds must be a nonnegative integer.");
|
|
26
|
-
const payload = {
|
|
27
|
-
iss: issuer,
|
|
28
|
-
aud: audience,
|
|
29
|
-
sub: actorId,
|
|
30
|
-
jti: input.jti?.trim() || randomUUID(),
|
|
31
|
-
iat: now,
|
|
32
|
-
nbf: now - 5,
|
|
33
|
-
exp: now + ttlSeconds,
|
|
34
|
-
treedx_actor_id: actorId,
|
|
35
|
-
treedx_tenant_id: tenantId,
|
|
36
|
-
treedx_repo_ids: normalizedStrings(input.repoIds, ["*"]),
|
|
37
|
-
treedx_capabilities: normalizedStrings(input.capabilities, []),
|
|
38
|
-
treedx_refs: normalizedStrings(input.refs, ["*"]),
|
|
39
|
-
treedx_paths: normalizedStrings(input.paths, ["**"]),
|
|
40
|
-
...input.projectId?.trim() ? { treeseed_project_id: input.projectId.trim() } : {},
|
|
41
|
-
...input.capacityWorkdayRunId?.trim() ? { treeseed_capacity_workday_run_id: input.capacityWorkdayRunId.trim() } : {}
|
|
42
|
-
};
|
|
43
|
-
const signingInput = `${base64urlJson({ alg: "HS256", typ: "JWT" })}.${base64urlJson(payload)}`;
|
|
44
|
-
return `${signingInput}.${createHmac("sha256", secret).update(signingInput).digest("base64url")}`;
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
mintTreeDxHs256Token
|
|
48
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { firstPayload } from "../../../support/client.js";
|
|
2
|
-
function buildSnapshotMethod(input = {}) {
|
|
3
|
-
const { repoId, ...body } = input;
|
|
4
|
-
return this.request("POST", `/api/v1/repos/${encodeURIComponent(this.repoId(repoId))}/snapshots/build`, body, { tokenRequired: true }).then((payload) => firstPayload(payload, ["snapshot"]));
|
|
5
|
-
}
|
|
6
|
-
export {
|
|
7
|
-
buildSnapshotMethod
|
|
8
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { firstPayload } from "../../../../support/client.js";
|
|
2
|
-
function putCapabilityGrantMethod(input) {
|
|
3
|
-
return this.request("POST", "/api/v1/policy/grants", input, { tokenRequired: true }).then((payload) => firstPayload(payload, ["grant"]));
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
putCapabilityGrantMethod
|
|
7
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TreeDxClient } from "../../../../support/client.js";
|
|
2
|
-
import type { TreeDxCapabilityGrant } from "../../../../types.js";
|
|
3
|
-
export declare function listCapabilityGrantsMethod(this: TreeDxClient, input?: {
|
|
4
|
-
actorId?: string;
|
|
5
|
-
repoId?: string;
|
|
6
|
-
}): Promise<TreeDxCapabilityGrant[]>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { firstPayload } from "../../../../support/client.js";
|
|
2
|
-
function listCapabilityGrantsMethod(input = {}) {
|
|
3
|
-
return this.request("GET", "/api/v1/policy/grants", void 0, {
|
|
4
|
-
query: input,
|
|
5
|
-
tokenRequired: true
|
|
6
|
-
}).then((payload) => firstPayload(payload, ["grants"]));
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
listCapabilityGrantsMethod
|
|
10
|
-
};
|