@treeseed/sdk 0.11.0 → 0.12.4
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 +9 -4
- package/dist/agent-capacity.d.ts +916 -0
- package/dist/agent-capacity.js +1600 -0
- package/dist/agent-tools.d.ts +37 -0
- package/dist/agent-tools.js +301 -0
- package/dist/api/app.d.ts +1 -1
- package/dist/api/auth/d1-database.d.ts +2 -2
- package/dist/api/auth/d1-provider.d.ts +4 -4
- package/dist/api/auth/d1-store.d.ts +2 -2
- package/dist/api/auth/memory-provider.d.ts +1 -1
- package/dist/api/auth/tokens.d.ts +1 -1
- package/dist/api/config.d.ts +3 -1
- package/dist/api/config.js +34 -10
- package/dist/api/http.d.ts +2 -2
- package/dist/api/index.d.ts +10 -10
- package/dist/api/index.js +4 -2
- package/dist/api/operations-routes.d.ts +3 -3
- package/dist/api/operations.d.ts +1 -1
- package/dist/api/providers.d.ts +1 -1
- package/dist/api/providers.js +21 -4
- package/dist/api/railway.d.ts +3 -2
- package/dist/api/sdk-dispatch.d.ts +4 -4
- package/dist/api/sdk-routes.d.ts +2 -2
- package/dist/api/templates.d.ts +2 -2
- package/dist/api/types.d.ts +3 -2
- package/dist/capacity-provider.d.ts +117 -60
- package/dist/capacity-provider.js +215 -43
- package/dist/capacity.d.ts +2 -2
- package/dist/cli-tools.d.ts +1 -1
- package/dist/content-operations.d.ts +97 -0
- package/dist/content-operations.js +250 -0
- package/dist/content-store.d.ts +4 -4
- package/dist/control-plane-client.d.ts +13 -18
- package/dist/control-plane-client.js +8 -86
- package/dist/control-plane.d.ts +2 -2
- package/dist/copilot.d.ts +3 -0
- package/dist/copilot.js +16 -1
- package/dist/d1-http.d.ts +1 -1
- package/dist/d1-store.d.ts +32 -57
- package/dist/d1-store.js +115 -318
- package/dist/db/d1.d.ts +1 -232
- package/dist/db/index.d.ts +3 -3
- package/dist/db/market-schema.d.ts +49037 -11843
- package/dist/db/market-schema.js +1788 -50
- package/dist/db/node-sqlite.d.ts +1 -232
- package/dist/db/schema.d.ts +0 -462
- package/dist/db/schema.js +2 -22
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +0 -11
- package/dist/fixture-support.js +52 -4
- package/dist/governance.d.ts +133 -0
- package/dist/governance.js +285 -0
- package/dist/graph/build.d.ts +2 -2
- package/dist/graph/context-query-contracts.d.ts +1 -1
- package/dist/graph/dsl.d.ts +1 -1
- package/dist/graph/query.d.ts +4 -4
- package/dist/graph/ranking.d.ts +1 -1
- package/dist/graph/schema.d.ts +1 -1
- package/dist/graph.d.ts +11 -11
- package/dist/guarantees/index.d.ts +425 -0
- package/dist/guarantees/index.js +1146 -0
- package/dist/hosting/apps.d.ts +1 -1
- package/dist/hosting/builtins.d.ts +1 -1
- package/dist/hosting/builtins.js +9 -198
- package/dist/hosting/contracts.d.ts +3 -2
- package/dist/hosting/graph.d.ts +24 -21
- package/dist/hosting/graph.js +280 -294
- package/dist/hosting/index.d.ts +4 -4
- package/dist/index.d.ts +88 -74
- package/dist/index.js +81 -10
- package/dist/local-dev/managed-dev.d.ts +85 -0
- package/dist/local-dev/managed-dev.js +368 -0
- package/dist/managed-dependencies.d.ts +9 -0
- package/dist/managed-dependencies.js +10 -8
- package/dist/market-client.d.ts +265 -7
- package/dist/market-client.js +381 -9
- package/dist/model-registry.d.ts +1 -1
- package/dist/model-registry.js +19 -19
- package/dist/operations/agent-tools.d.ts +2 -11
- package/dist/operations/agent-tools.js +2 -14
- package/dist/operations/providers/default.d.ts +1 -1
- package/dist/operations/providers/default.js +20 -37
- package/dist/operations/repository-operations.d.ts +26 -2
- package/dist/operations/repository-operations.js +159 -1
- package/dist/operations/runtime.d.ts +3 -3
- package/dist/operations/services/bootstrap-runner.d.ts +1 -1
- package/dist/operations/services/build-warning-policy.d.ts +34 -0
- package/dist/operations/services/build-warning-policy.js +81 -82
- package/dist/operations/services/commit-message-provider.js +4 -4
- package/dist/operations/services/config-runtime.d.ts +73 -19
- package/dist/operations/services/config-runtime.js +276 -100
- package/dist/operations/services/deploy.d.ts +41 -622
- package/dist/operations/services/deploy.js +181 -213
- package/dist/operations/services/deployment-readiness.d.ts +1 -1
- package/dist/operations/services/deployment-readiness.js +38 -7
- package/dist/operations/services/git-remote-policy.js +12 -4
- package/dist/operations/services/git-runner.d.ts +66 -0
- package/dist/operations/services/git-runner.js +479 -0
- package/dist/operations/services/git-workflow.d.ts +43 -5
- package/dist/operations/services/git-workflow.js +242 -20
- package/dist/operations/services/github-actions-verification.d.ts +3 -1
- package/dist/operations/services/github-actions-verification.js +11 -3
- package/dist/operations/services/github-api.js +21 -5
- package/dist/operations/services/github-automation.d.ts +3 -3
- package/dist/operations/services/github-automation.js +15 -18
- package/dist/operations/services/github-credentials.js +2 -1
- package/dist/operations/services/hosted-service-checks.d.ts +19 -1
- package/dist/operations/services/hosted-service-checks.js +162 -11
- package/dist/operations/services/hosting-audit.d.ts +2 -2
- package/dist/operations/services/hosting-audit.js +7 -7
- package/dist/operations/services/hub-launch.d.ts +1 -1
- package/dist/operations/services/hub-provider-launch.d.ts +5 -5
- package/dist/operations/services/hub-provider-launch.js +19 -14
- package/dist/operations/services/live-hosted-service-checks.d.ts +2 -1
- package/dist/operations/services/live-hosted-service-checks.js +193 -80
- package/dist/operations/services/local-dev.js +0 -1
- package/dist/operations/services/managed-host-security.d.ts +1 -1
- package/dist/operations/services/managed-repositories.d.ts +37 -0
- package/dist/operations/services/managed-repositories.js +177 -0
- package/dist/operations/services/operations-runner-smoke.d.ts +3 -2
- package/dist/operations/services/operations-runner-smoke.js +22 -4
- package/dist/operations/services/package-adapters.d.ts +77 -2
- package/dist/operations/services/package-adapters.js +627 -56
- package/dist/operations/services/package-reference-policy.d.ts +12 -88
- package/dist/operations/services/package-reference-policy.js +81 -213
- package/dist/operations/services/project-host-operations.d.ts +4 -4
- package/dist/operations/services/project-platform.d.ts +19 -193
- package/dist/operations/services/project-platform.js +31 -103
- package/dist/operations/services/project-web-monitor.d.ts +2 -2
- package/dist/operations/services/project-web-monitor.js +97 -2
- package/dist/operations/services/railway-api.d.ts +36 -7
- package/dist/operations/services/railway-api.js +331 -100
- package/dist/operations/services/railway-deploy.d.ts +7 -95
- package/dist/operations/services/railway-deploy.js +334 -742
- package/dist/operations/services/release-history.js +3 -4
- package/dist/operations/services/release-proof-ledger.d.ts +13 -0
- package/dist/operations/services/release-proof-ledger.js +81 -0
- package/dist/operations/services/release-proof-planner.d.ts +48 -0
- package/dist/operations/services/release-proof-planner.js +195 -0
- package/dist/operations/services/release-proof-runner.d.ts +16 -0
- package/dist/operations/services/release-proof-runner.js +169 -0
- package/dist/operations/services/release-proof.d.ts +81 -0
- package/dist/operations/services/release-proof.js +79 -0
- package/dist/operations/services/repository-save-orchestrator.d.ts +6 -7
- package/dist/operations/services/repository-save-orchestrator.js +353 -174
- package/dist/operations/services/runtime-paths.d.ts +1 -3
- package/dist/operations/services/runtime-paths.js +0 -4
- package/dist/operations/services/runtime-tools.d.ts +1 -192
- package/dist/operations/services/runtime-tools.js +4 -444
- package/dist/operations/services/save-deploy-preflight.js +9 -1
- package/dist/operations/services/template-host-bindings.d.ts +2 -2
- package/dist/operations/services/template-host-bindings.js +3 -2
- package/dist/operations/services/template-registry.d.ts +6 -6
- package/dist/operations/services/template-registry.js +33 -14
- package/dist/operations/services/template-secret-sync.d.ts +3 -3
- package/dist/operations/services/workflow-timing.d.ts +25 -0
- package/dist/operations/services/workflow-timing.js +79 -0
- package/dist/operations/services/workspace-dependency-mode.js +41 -4
- package/dist/operations/services/workspace-preflight.js +8 -8
- package/dist/operations/services/workspace-save-script.d.ts +4 -4
- package/dist/operations/services/workspace-save.d.ts +1 -0
- package/dist/operations/services/workspace-save.js +41 -18
- package/dist/operations/services/workspace-tools.js +40 -6
- package/dist/operations-registry.d.ts +1 -1
- package/dist/operations-registry.js +5 -6
- package/dist/operations-types.d.ts +1 -1
- package/dist/operations.d.ts +17 -11
- package/dist/operations.js +57 -3
- package/dist/platform/book-export.js +2 -0
- package/dist/platform/books-data.d.ts +1 -1
- package/dist/platform/config.d.ts +27 -0
- package/dist/platform/config.js +100 -0
- package/dist/platform/content-runtime-source.d.ts +54 -0
- package/dist/platform/content-runtime-source.js +169 -0
- package/dist/platform/contracts.d.ts +6 -1
- package/dist/platform/deploy-config.d.ts +1 -1
- package/dist/platform/deploy-config.js +7 -1
- package/dist/platform/deploy-runtime.d.ts +1 -1
- package/dist/platform/desired-state.d.ts +63 -0
- package/dist/platform/desired-state.js +1021 -0
- package/dist/platform/env.yaml +414 -19
- package/dist/platform/environment.d.ts +2 -2
- package/dist/platform/environment.js +54 -22
- package/dist/platform/local-content-materialization.d.ts +9 -0
- package/dist/platform/local-content-materialization.js +212 -0
- package/dist/platform/plugin.d.ts +5 -5
- package/dist/platform/plugins/runtime.d.ts +3 -3
- package/dist/platform/plugins/runtime.js +62 -1
- package/dist/platform/plugins.d.ts +6 -6
- package/dist/platform/published-content-pipeline.d.ts +3 -3
- package/dist/platform/published-content-pipeline.js +5 -1
- package/dist/platform/published-content.d.ts +4 -3
- package/dist/platform/site-config-schema.d.ts +1 -0
- package/dist/platform/site-config-schema.js +4 -1
- package/dist/platform/tenant/runtime-config.d.ts +152 -2
- package/dist/platform/tenant-config.d.ts +1 -1
- package/dist/platform/utils/site-config-schema.d.ts +154 -0
- package/dist/platform/utils/site-config-schema.js +400 -461
- package/dist/platform-operation-store.d.ts +1 -1
- package/dist/plugin-default.d.ts +1 -1
- package/dist/plugin-default.js +27 -12
- package/dist/project-import.d.ts +91 -0
- package/dist/project-import.js +257 -0
- package/dist/project-workflow.d.ts +1 -1
- package/dist/reconcile/bootstrap-systems.d.ts +2 -2
- package/dist/reconcile/bootstrap-systems.js +3 -3
- package/dist/reconcile/builtin-adapters.d.ts +7 -1
- package/dist/reconcile/builtin-adapters.js +2924 -346
- package/dist/reconcile/contracts.d.ts +15 -2
- package/dist/reconcile/desired-state.d.ts +2 -193
- package/dist/reconcile/desired-state.js +24 -33
- package/dist/reconcile/engine.d.ts +60 -397
- package/dist/reconcile/engine.js +182 -18
- package/dist/reconcile/index.d.ts +10 -10
- package/dist/reconcile/live-acceptance.d.ts +22 -1
- package/dist/reconcile/live-acceptance.js +456 -44
- package/dist/reconcile/providers/docker-private.d.ts +54 -0
- package/dist/reconcile/providers/docker-private.js +101 -0
- package/dist/reconcile/providers/github-private.d.ts +65 -0
- package/dist/reconcile/providers/github-private.js +119 -0
- package/dist/reconcile/providers/local-private.d.ts +28 -0
- package/dist/reconcile/providers/local-private.js +75 -0
- package/dist/reconcile/providers/railway-iac.d.ts +66 -0
- package/dist/reconcile/providers/railway-iac.js +275 -0
- package/dist/reconcile/providers/release-private.d.ts +92 -0
- package/dist/reconcile/providers/release-private.js +152 -0
- package/dist/reconcile/registry.d.ts +2 -2
- package/dist/reconcile/registry.js +16 -1
- package/dist/reconcile/state.d.ts +1 -1
- package/dist/reconcile/state.js +3 -40
- package/dist/reconcile/units.d.ts +1 -1
- package/dist/reconcile/units.js +7 -1
- package/dist/remote.d.ts +6 -6
- package/dist/scenes/artifacts.d.ts +16 -0
- package/dist/scenes/artifacts.js +61 -0
- package/dist/scenes/auth.d.ts +2 -0
- package/dist/scenes/auth.js +28 -0
- package/dist/scenes/base-url.d.ts +12 -0
- package/dist/scenes/base-url.js +123 -0
- package/dist/scenes/builtin-plugins.d.ts +2 -0
- package/dist/scenes/builtin-plugins.js +447 -0
- package/dist/scenes/checkpoints.d.ts +14 -0
- package/dist/scenes/checkpoints.js +33 -0
- package/dist/scenes/device-matrix.d.ts +2 -0
- package/dist/scenes/device-matrix.js +97 -0
- package/dist/scenes/devices.d.ts +11 -0
- package/dist/scenes/devices.js +22 -0
- package/dist/scenes/diagnostics.d.ts +5 -0
- package/dist/scenes/diagnostics.js +22 -0
- package/dist/scenes/diagram-providers.d.ts +2 -0
- package/dist/scenes/diagram-providers.js +181 -0
- package/dist/scenes/diagram-validation.d.ts +22 -0
- package/dist/scenes/diagram-validation.js +74 -0
- package/dist/scenes/environment.d.ts +2 -0
- package/dist/scenes/environment.js +65 -0
- package/dist/scenes/evidence-bundle.d.ts +5 -0
- package/dist/scenes/evidence-bundle.js +42 -0
- package/dist/scenes/evidence-report.d.ts +10 -0
- package/dist/scenes/evidence-report.js +73 -0
- package/dist/scenes/evidence.d.ts +16 -0
- package/dist/scenes/evidence.js +277 -0
- package/dist/scenes/index.d.ts +48 -0
- package/dist/scenes/index.js +312 -0
- package/dist/scenes/inspect.d.ts +9 -0
- package/dist/scenes/inspect.js +64 -0
- package/dist/scenes/loader.d.ts +3 -0
- package/dist/scenes/loader.js +38 -0
- package/dist/scenes/logs.d.ts +2 -0
- package/dist/scenes/logs.js +47 -0
- package/dist/scenes/operations.d.ts +3 -0
- package/dist/scenes/operations.js +128 -0
- package/dist/scenes/phase0.d.ts +9 -0
- package/dist/scenes/phase0.js +637 -0
- package/dist/scenes/planner.d.ts +12 -0
- package/dist/scenes/planner.js +166 -0
- package/dist/scenes/playwright-adapter.d.ts +2 -0
- package/dist/scenes/playwright-adapter.js +63 -0
- package/dist/scenes/plugins.d.ts +5 -0
- package/dist/scenes/plugins.js +115 -0
- package/dist/scenes/progress.d.ts +17 -0
- package/dist/scenes/progress.js +24 -0
- package/dist/scenes/publish-destinations.d.ts +12 -0
- package/dist/scenes/publish-destinations.js +99 -0
- package/dist/scenes/publish-plan-report.d.ts +10 -0
- package/dist/scenes/publish-plan-report.js +70 -0
- package/dist/scenes/publish-plan.d.ts +15 -0
- package/dist/scenes/publish-plan.js +248 -0
- package/dist/scenes/publish-redaction.d.ts +16 -0
- package/dist/scenes/publish-redaction.js +148 -0
- package/dist/scenes/publish-release-record.d.ts +13 -0
- package/dist/scenes/publish-release-record.js +34 -0
- package/dist/scenes/publish-report.d.ts +10 -0
- package/dist/scenes/publish-report.js +67 -0
- package/dist/scenes/publish.d.ts +16 -0
- package/dist/scenes/publish.js +298 -0
- package/dist/scenes/registry.d.ts +12 -0
- package/dist/scenes/registry.js +65 -0
- package/dist/scenes/remotion-adapter.d.ts +3 -0
- package/dist/scenes/remotion-adapter.js +94 -0
- package/dist/scenes/remotion-composition-registry.d.ts +2 -0
- package/dist/scenes/remotion-composition-registry.js +12 -0
- package/dist/scenes/remotion-compositions.d.ts +15 -0
- package/dist/scenes/remotion-compositions.js +464 -0
- package/dist/scenes/remotion-diagrams.d.ts +9 -0
- package/dist/scenes/remotion-diagrams.js +188 -0
- package/dist/scenes/remotion-input.d.ts +13 -0
- package/dist/scenes/remotion-input.js +291 -0
- package/dist/scenes/remotion-visuals.d.ts +29 -0
- package/dist/scenes/remotion-visuals.js +198 -0
- package/dist/scenes/render-media-assets.d.ts +9 -0
- package/dist/scenes/render-media-assets.js +117 -0
- package/dist/scenes/render-report.d.ts +10 -0
- package/dist/scenes/render-report.js +27 -0
- package/dist/scenes/render.d.ts +2 -0
- package/dist/scenes/render.js +218 -0
- package/dist/scenes/reporter.d.ts +3 -0
- package/dist/scenes/reporter.js +101 -0
- package/dist/scenes/resume.d.ts +2 -0
- package/dist/scenes/resume.js +79 -0
- package/dist/scenes/runner.d.ts +2 -0
- package/dist/scenes/runner.js +674 -0
- package/dist/scenes/schema.d.ts +6 -0
- package/dist/scenes/schema.js +994 -0
- package/dist/scenes/seed.d.ts +2 -0
- package/dist/scenes/seed.js +83 -0
- package/dist/scenes/segments.d.ts +15 -0
- package/dist/scenes/segments.js +79 -0
- package/dist/scenes/selectors.d.ts +3 -0
- package/dist/scenes/selectors.js +21 -0
- package/dist/scenes/timeline.d.ts +11 -0
- package/dist/scenes/timeline.js +26 -0
- package/dist/scenes/timeouts.d.ts +6 -0
- package/dist/scenes/timeouts.js +17 -0
- package/dist/scenes/training-captions.d.ts +14 -0
- package/dist/scenes/training-captions.js +98 -0
- package/dist/scenes/training-report.d.ts +10 -0
- package/dist/scenes/training-report.js +78 -0
- package/dist/scenes/training-transcript.d.ts +24 -0
- package/dist/scenes/training-transcript.js +204 -0
- package/dist/scenes/training.d.ts +10 -0
- package/dist/scenes/training.js +134 -0
- package/dist/scenes/types.d.ts +1872 -0
- package/dist/scenes/types.js +8 -0
- package/dist/scenes/visual-audit-contact-sheets.d.ts +6 -0
- package/dist/scenes/visual-audit-contact-sheets.js +119 -0
- package/dist/scenes/visual-audit-fixtures.d.ts +25 -0
- package/dist/scenes/visual-audit-fixtures.js +210 -0
- package/dist/scenes/visual-audit-report.d.ts +11 -0
- package/dist/scenes/visual-audit-report.js +85 -0
- package/dist/scenes/visual-audit-review.d.ts +23 -0
- package/dist/scenes/visual-audit-review.js +829 -0
- package/dist/scenes/visual-audit-routes.d.ts +13 -0
- package/dist/scenes/visual-audit-routes.js +308 -0
- package/dist/scenes/visual-audit.d.ts +3 -0
- package/dist/scenes/visual-audit.js +596 -0
- package/dist/scripts/build-dist.js +154 -40
- package/dist/scripts/check-build-warnings.js +42 -53
- package/dist/scripts/cleanup-markdown.js +1 -1
- package/dist/scripts/cli-test-fixtures.js +24 -28
- package/dist/scripts/migrate-journey-csv-to-guarantees.js +140 -0
- package/dist/scripts/package-tools.js +12 -1
- package/dist/scripts/prepare.js +3 -7
- package/dist/scripts/release-verify.js +2 -5
- package/dist/scripts/run-fixture-astro-command.js +1 -1
- package/dist/scripts/template-catalog.test.js +68 -82
- package/dist/scripts/tenant-dev.js +0 -10
- package/dist/scripts/test-cloudflare-local.js +1 -1
- package/dist/scripts/test-scaffold.js +0 -1
- package/dist/scripts/test-smoke.js +3 -3
- package/dist/scripts/treeseed-build-dist.js +4 -7
- package/dist/scripts/treeseed-release-verify.js +1 -1
- package/dist/scripts/verify-driver.js +30 -21
- package/dist/scripts/workflow-commands.test.js +18 -27
- package/dist/scripts/workspace-command-e2e.js +1 -1
- package/dist/scripts/workspace-lint.js +6 -0
- package/dist/scripts/workspace-release-test.js +90 -1
- package/dist/scripts/workspace-test.js +6 -0
- package/dist/sdk-dispatch.d.ts +1 -1
- package/dist/sdk-dispatch.js +0 -16
- package/dist/sdk-fields.d.ts +1 -1
- package/dist/sdk-filters.d.ts +1 -1
- package/dist/sdk-types.d.ts +1184 -113
- package/dist/sdk-types.js +393 -0
- package/dist/sdk.d.ts +74 -79
- package/dist/sdk.js +27 -36
- package/dist/secrets-capability.d.ts +421 -0
- package/dist/secrets-capability.js +530 -0
- package/dist/seeds/normalize.js +1 -0
- package/dist/seeds/planner.js +38 -0
- package/dist/seeds/schema.js +293 -4
- package/dist/seeds/types.d.ts +60 -0
- package/dist/seeds/types.js +9 -1
- package/dist/service-credentials.d.ts +54 -0
- package/dist/service-credentials.js +112 -0
- package/dist/stores/cursor-store.d.ts +2 -2
- package/dist/stores/envelopes.d.ts +1 -1
- package/dist/stores/helpers.d.ts +1 -1
- package/dist/stores/lease-store.d.ts +2 -2
- package/dist/stores/message-store.d.ts +2 -2
- package/dist/stores/operational-store.d.ts +3 -26
- package/dist/stores/operational-store.js +0 -225
- package/dist/stores/project-workflow-store.d.ts +2 -2
- package/dist/stores/run-store.d.ts +2 -3
- package/dist/stores/run-store.js +0 -98
- package/dist/stores/subscription-store.d.ts +2 -3
- package/dist/stores/subscription-store.js +0 -100
- package/dist/template-catalog.d.ts +1 -1
- package/dist/template-launch-requirements.d.ts +2 -2
- package/dist/template-launch-ui.d.ts +2 -2
- package/dist/treedx/adapters.d.ts +6 -6
- package/dist/treedx/client.d.ts +1 -1
- package/dist/treedx/errors.d.ts +1 -1
- package/dist/treedx/federated-client.d.ts +3 -3
- package/dist/treedx/graph-adapter.d.ts +2 -2
- package/dist/treedx/index.d.ts +14 -14
- package/dist/treedx/market-integration.d.ts +1 -1
- package/dist/treedx/ports.d.ts +30 -30
- package/dist/treedx/query-adapter.d.ts +3 -3
- package/dist/treedx/registry-client.d.ts +2 -2
- package/dist/treedx/repository-adapter.d.ts +4 -4
- package/dist/treedx/repository-adapter.js +14 -3
- package/dist/treedx/sdk-integration.d.ts +3 -3
- package/dist/treedx/types.d.ts +2 -2
- package/dist/treedx/workspace-adapter.d.ts +2 -2
- package/dist/treedx-backends.d.ts +13 -11
- package/dist/treedx-backends.js +52 -50
- package/dist/treedx-client.d.ts +3 -0
- package/dist/treedx-client.js +10 -1
- package/dist/treeseed/services/compose.yml +2 -3
- package/dist/treeseed/template-catalog/catalog.fixture.json +4 -4
- package/dist/types/agents.d.ts +256 -0
- package/dist/types/agents.js +42 -1
- package/dist/verification.d.ts +1 -0
- package/dist/verification.js +143 -14
- package/dist/workflow/operations.d.ts +510 -559
- package/dist/workflow/operations.js +1891 -1342
- package/dist/workflow/policy.js +19 -7
- package/dist/workflow/runs.d.ts +9 -3
- package/dist/workflow/runs.js +66 -26
- package/dist/workflow/session.d.ts +4 -1
- package/dist/workflow/session.js +50 -10
- package/dist/workflow/worktrees.d.ts +6 -2
- package/dist/workflow/worktrees.js +98 -15
- package/dist/workflow-state.d.ts +5 -5
- package/dist/workflow-state.js +27 -17
- package/dist/workflow-support.d.ts +26 -25
- package/dist/workflow-support.js +27 -31
- package/dist/workflow.d.ts +46 -16
- package/dist/workflow.js +19 -7
- package/drizzle/d1/0000_treeseed_d1.sql +0 -18
- package/drizzle/market/0000_market_control_plane.sql +1793 -1499
- package/drizzle/market/0005_agent_capacity_coordination.sql +145 -0
- package/drizzle/market/0006_provider_assignment_lifecycle.sql +9 -0
- package/drizzle/market/0007_agent_architecture_gap_closure.sql +157 -0
- package/drizzle/market/0008_agent_capacity_operational_closure.sql +27 -0
- package/drizzle/market/0009_agent_capacity_runtime_hardening.sql +29 -0
- package/drizzle/market/0010_secrets_capability_persistence.sql +130 -0
- package/drizzle/market/0011_github_app_adapter.sql +47 -0
- package/drizzle/market/0012_workday_test_runs.sql +44 -0
- package/drizzle/market/0013_runtime_task_lifecycle.sql +39 -0
- package/drizzle/market/0014_governance_pipeline.sql +189 -0
- package/package.json +75 -18
- package/scripts/{verify-driver.mjs → verify-driver.ts} +19 -4
- package/templates/github/deploy-web.workflow.yml +12 -8
- package/dist/operations/services/mailpit-runtime.d.ts +0 -20
- package/dist/operations/services/mailpit-runtime.js +0 -67
- package/dist/operations/services/release-candidate.d.ts +0 -60
- package/dist/operations/services/release-candidate.js +0 -953
- package/dist/scripts/ensure-mailpit.js +0 -48
- package/dist/scripts/logs-mailpit.js +0 -2
- package/dist/scripts/run-ts.js +0 -45
- package/dist/scripts/stop-mailpit.js +0 -5
- package/dist/scripts/treeseed-run-ts.js +0 -45
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export type DevDependencyReferenceMode = 'git-
|
|
2
|
-
export type DevTagCleanupMode = 'safe-after-release' | 'off';
|
|
1
|
+
export type DevDependencyReferenceMode = 'git-commit';
|
|
3
2
|
export type GitDependencyProtocol = 'preserve-origin' | 'https' | 'ssh';
|
|
4
|
-
export type DevTagBranchScope = 'staging' | 'preview' | 'all';
|
|
5
3
|
export type PackageDependencyReference = {
|
|
6
4
|
packageName: string;
|
|
7
5
|
version: string;
|
|
@@ -10,7 +8,7 @@ export type PackageDependencyReference = {
|
|
|
10
8
|
installSpec: string;
|
|
11
9
|
tagName: string | null;
|
|
12
10
|
remoteUrl: string | null;
|
|
13
|
-
mode: 'stable-semver' | 'dev-git-
|
|
11
|
+
mode: 'stable-semver' | 'dev-git-commit';
|
|
14
12
|
};
|
|
15
13
|
export type RewrittenDevReference = {
|
|
16
14
|
packageName: string;
|
|
@@ -19,22 +17,6 @@ export type RewrittenDevReference = {
|
|
|
19
17
|
to: string;
|
|
20
18
|
tagName: string | null;
|
|
21
19
|
};
|
|
22
|
-
export type TreeseedDevTagInfo = {
|
|
23
|
-
tagName: string;
|
|
24
|
-
stableVersion: string;
|
|
25
|
-
branchSlug: string;
|
|
26
|
-
timestamp: string;
|
|
27
|
-
metadata: Record<string, string>;
|
|
28
|
-
branch: string | null;
|
|
29
|
-
packageName: string | null;
|
|
30
|
-
version: string | null;
|
|
31
|
-
};
|
|
32
|
-
export type StaleDevTagClassification = {
|
|
33
|
-
tagName: string;
|
|
34
|
-
action: 'delete' | 'skip';
|
|
35
|
-
reason: string;
|
|
36
|
-
info: TreeseedDevTagInfo | null;
|
|
37
|
-
};
|
|
38
20
|
export declare function internalDependencyFields(packageJson: Record<string, unknown> | null): string[];
|
|
39
21
|
export declare function isPrereleaseVersion(version: string): boolean;
|
|
40
22
|
export declare function isStableVersion(version: string): boolean;
|
|
@@ -48,6 +30,7 @@ export declare function createPackageDependencyReference(input: {
|
|
|
48
30
|
version: string;
|
|
49
31
|
branchMode: 'package-release-main' | 'package-dev-save';
|
|
50
32
|
remoteUrl?: string | null;
|
|
33
|
+
commitSha?: string | null;
|
|
51
34
|
devDependencyReferenceMode?: DevDependencyReferenceMode;
|
|
52
35
|
gitDependencyProtocol?: GitDependencyProtocol;
|
|
53
36
|
}): PackageDependencyReference;
|
|
@@ -69,72 +52,13 @@ export declare function collectInternalDevReferenceIssues(root?: any, packageNam
|
|
|
69
52
|
spec: string;
|
|
70
53
|
reason: string;
|
|
71
54
|
}[];
|
|
55
|
+
export declare function collectDevelopmentCommitReferenceIssues(root?: any, packageNames?: Set<any>): {
|
|
56
|
+
repoName: string;
|
|
57
|
+
filePath: string;
|
|
58
|
+
field?: string;
|
|
59
|
+
dependencyName?: string;
|
|
60
|
+
spec: string;
|
|
61
|
+
reason: string;
|
|
62
|
+
}[];
|
|
63
|
+
export declare function assertDevelopmentInternalCommitReferences(root?: any, packageNames?: Set<string>): void;
|
|
72
64
|
export declare function assertNoInternalDevReferences(root?: any, packageNames?: Set<string>): void;
|
|
73
|
-
export declare function createDevTagMessage(input: {
|
|
74
|
-
packageName: string;
|
|
75
|
-
version: string;
|
|
76
|
-
branch: string;
|
|
77
|
-
commitSha: string;
|
|
78
|
-
workflowRunId?: string | null;
|
|
79
|
-
createdAt?: string;
|
|
80
|
-
}): string;
|
|
81
|
-
export declare function gitTagMessage(repoDir: string, tagName: string): string;
|
|
82
|
-
export declare function tagHasTreeseedDevMetadata(repoDir: string, tagName: string): boolean;
|
|
83
|
-
export declare function parseTreeseedDevTag(tagName: string, message: string): TreeseedDevTagInfo | null;
|
|
84
|
-
export declare function classifyStaleTreeseedDevTag(input: {
|
|
85
|
-
tagName: string;
|
|
86
|
-
message: string;
|
|
87
|
-
currentVersion: string;
|
|
88
|
-
activeReferences?: string[];
|
|
89
|
-
branchScope?: DevTagBranchScope;
|
|
90
|
-
expectedPackageName?: string | null;
|
|
91
|
-
}): StaleDevTagClassification;
|
|
92
|
-
export declare function cleanupDevTags(repoDir: string, tagNames: string[], activeReferences?: string[]): {
|
|
93
|
-
cleaned: string[];
|
|
94
|
-
skipped: {
|
|
95
|
-
tagName: string;
|
|
96
|
-
reason: string;
|
|
97
|
-
}[];
|
|
98
|
-
};
|
|
99
|
-
export declare function collectTreeseedDevTagCleanupPlan(input: {
|
|
100
|
-
repoDir: string;
|
|
101
|
-
packageName: string;
|
|
102
|
-
currentVersion: string;
|
|
103
|
-
activeReferences?: string[];
|
|
104
|
-
branchScope?: DevTagBranchScope;
|
|
105
|
-
}): {
|
|
106
|
-
packageName: string;
|
|
107
|
-
currentVersion: string;
|
|
108
|
-
branchScope: DevTagBranchScope;
|
|
109
|
-
candidates: StaleDevTagClassification[];
|
|
110
|
-
skipped: StaleDevTagClassification[];
|
|
111
|
-
tags: StaleDevTagClassification[];
|
|
112
|
-
};
|
|
113
|
-
export declare function cleanupStaleTreeseedDevTags(input: {
|
|
114
|
-
repoDir: string;
|
|
115
|
-
packageName: string;
|
|
116
|
-
currentVersion: string;
|
|
117
|
-
activeReferences?: string[];
|
|
118
|
-
branchScope?: DevTagBranchScope;
|
|
119
|
-
dryRun?: boolean;
|
|
120
|
-
}): {
|
|
121
|
-
status: string;
|
|
122
|
-
packageName: string;
|
|
123
|
-
currentVersion: string;
|
|
124
|
-
branchScope: DevTagBranchScope;
|
|
125
|
-
candidates: {
|
|
126
|
-
tagName: string;
|
|
127
|
-
reason: string;
|
|
128
|
-
branch: string | null | undefined;
|
|
129
|
-
branchSlug: string | undefined;
|
|
130
|
-
version: string | null | undefined;
|
|
131
|
-
}[];
|
|
132
|
-
candidateCount: number;
|
|
133
|
-
cleaned: string[];
|
|
134
|
-
cleanedCount: number;
|
|
135
|
-
skipped: {
|
|
136
|
-
tagName: string;
|
|
137
|
-
reason: string;
|
|
138
|
-
}[];
|
|
139
|
-
skippedCount: number;
|
|
140
|
-
};
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { discoverTreeseedPackageAdapters } from "./package-adapters.js";
|
|
5
|
-
import {
|
|
5
|
+
import { workspacePackages, workspaceRoot } from "./workspace-tools.js";
|
|
6
6
|
const INTERNAL_DEPENDENCY_FIELDS = ["dependencies", "optionalDependencies", "peerDependencies", "devDependencies"];
|
|
7
7
|
function readJson(filePath) {
|
|
8
8
|
return JSON.parse(readFileSync(filePath, "utf8"));
|
|
@@ -21,19 +21,6 @@ function isPrereleaseVersion(version) {
|
|
|
21
21
|
function isStableVersion(version) {
|
|
22
22
|
return /^\d+\.\d+\.\d+$/u.test(String(version).trim());
|
|
23
23
|
}
|
|
24
|
-
function stableVersionBase(version) {
|
|
25
|
-
const match = String(version).trim().match(/^(\d+\.\d+\.\d+)(?:-|$)/u);
|
|
26
|
-
return match?.[1] ?? null;
|
|
27
|
-
}
|
|
28
|
-
function compareStableVersions(left, right) {
|
|
29
|
-
const leftParts = left.split(".").map((part) => Number(part));
|
|
30
|
-
const rightParts = right.split(".").map((part) => Number(part));
|
|
31
|
-
for (let index = 0; index < 3; index += 1) {
|
|
32
|
-
const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);
|
|
33
|
-
if (difference !== 0) return difference;
|
|
34
|
-
}
|
|
35
|
-
return 0;
|
|
36
|
-
}
|
|
37
24
|
function isGitDependencySpec(spec) {
|
|
38
25
|
return /^(?:git\+|github:|gitlab:|bitbucket:|ssh:\/\/|https:\/\/|file:)/u.test(String(spec).trim()) && String(spec).includes("#");
|
|
39
26
|
}
|
|
@@ -105,33 +92,25 @@ function createPackageDependencyReference(input) {
|
|
|
105
92
|
mode: "stable-semver"
|
|
106
93
|
};
|
|
107
94
|
}
|
|
108
|
-
if ((input.devDependencyReferenceMode ?? "git-tag") === "registry-prerelease") {
|
|
109
|
-
return {
|
|
110
|
-
packageName: input.packageName,
|
|
111
|
-
version: input.version,
|
|
112
|
-
spec: input.version,
|
|
113
|
-
manifestSpec: input.version,
|
|
114
|
-
installSpec: input.version,
|
|
115
|
-
tagName: input.version,
|
|
116
|
-
remoteUrl: input.remoteUrl ?? null,
|
|
117
|
-
mode: "dev-registry-prerelease"
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
95
|
const installRemote = normalizeGitRemoteForDependency(input.remoteUrl ?? "", input.gitDependencyProtocol ?? "preserve-origin");
|
|
121
96
|
const manifestRemote = normalizeGitRemoteForManifest(input.remoteUrl ?? "", input.gitDependencyProtocol ?? "preserve-origin");
|
|
122
97
|
if (!installRemote || !manifestRemote) {
|
|
123
|
-
throw new Error(`Unable to create Git
|
|
98
|
+
throw new Error(`Unable to create Git dependency for ${input.packageName}; origin remote is missing.`);
|
|
99
|
+
}
|
|
100
|
+
const ref = String(input.commitSha ?? "").trim();
|
|
101
|
+
if (!ref) {
|
|
102
|
+
throw new Error(`Unable to create commit dependency for ${input.packageName}; commit SHA is missing.`);
|
|
124
103
|
}
|
|
125
|
-
const manifestSpec = `${manifestRemote}#${
|
|
104
|
+
const manifestSpec = `${manifestRemote}#${ref}`;
|
|
126
105
|
return {
|
|
127
106
|
packageName: input.packageName,
|
|
128
107
|
version: input.version,
|
|
129
108
|
spec: manifestSpec,
|
|
130
109
|
manifestSpec,
|
|
131
110
|
installSpec: manifestSpec,
|
|
132
|
-
tagName:
|
|
111
|
+
tagName: null,
|
|
133
112
|
remoteUrl: input.remoteUrl ?? null,
|
|
134
|
-
mode: "dev-git-
|
|
113
|
+
mode: "dev-git-commit"
|
|
135
114
|
};
|
|
136
115
|
}
|
|
137
116
|
function updateInternalDependencySpecs(packageJson, references) {
|
|
@@ -243,8 +222,8 @@ function collectInternalDevReferenceIssues(root = workspaceRoot(), packageNames
|
|
|
243
222
|
for (const [depName, specValue] of Object.entries(values)) {
|
|
244
223
|
if (!packageNames.has(depName)) continue;
|
|
245
224
|
const spec = String(specValue);
|
|
246
|
-
if (isGitDependencySpec(spec)
|
|
247
|
-
issues.push({ repoName: pkg.name, filePath: packageJsonPath, field, dependencyName: depName, spec, reason: "git-dev-ref" });
|
|
225
|
+
if (isGitDependencySpec(spec)) {
|
|
226
|
+
issues.push({ repoName: pkg.name, filePath: packageJsonPath, field, dependencyName: depName, spec, reason: releaseTagFromDependencySpec(spec) ? "git-release-ref" : "git-dev-ref" });
|
|
248
227
|
} else if (isPrereleaseVersion(spec)) {
|
|
249
228
|
issues.push({ repoName: pkg.name, filePath: packageJsonPath, field, dependencyName: depName, spec, reason: "prerelease-dev-ref" });
|
|
250
229
|
}
|
|
@@ -271,10 +250,10 @@ function collectInternalDevReferenceIssues(root = workspaceRoot(), packageNames
|
|
|
271
250
|
record.resolved,
|
|
272
251
|
record.from
|
|
273
252
|
].map((value) => typeof value === "string" ? value : "").find(
|
|
274
|
-
(value) => isGitDependencySpec(value)
|
|
253
|
+
(value) => isGitDependencySpec(value) || devTagFromDependencySpec(value) || isPrereleaseVersion(value)
|
|
275
254
|
);
|
|
276
255
|
if (spec) {
|
|
277
|
-
issues.push({ repoName: lockRoot.name, filePath: lockPath, spec, reason: "lockfile-dev-ref", dependencyName: packageName });
|
|
256
|
+
issues.push({ repoName: lockRoot.name, filePath: lockPath, spec, reason: releaseTagFromDependencySpec(spec) ? "lockfile-git-release-ref" : "lockfile-dev-ref", dependencyName: packageName });
|
|
278
257
|
}
|
|
279
258
|
}
|
|
280
259
|
}
|
|
@@ -282,194 +261,85 @@ function collectInternalDevReferenceIssues(root = workspaceRoot(), packageNames
|
|
|
282
261
|
}
|
|
283
262
|
return issues;
|
|
284
263
|
}
|
|
285
|
-
function
|
|
286
|
-
const issues =
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return "";
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
function gitRemoteTagMessage(repoDir, tagName) {
|
|
315
|
-
try {
|
|
316
|
-
run("git", ["fetch", "--no-tags", "origin", `refs/tags/${tagName}`], { cwd: repoDir, capture: true });
|
|
317
|
-
return run("git", ["cat-file", "-p", "FETCH_HEAD"], { cwd: repoDir, capture: true });
|
|
318
|
-
} catch {
|
|
319
|
-
return "";
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
function gitDevTagMessage(repoDir, tagName) {
|
|
323
|
-
const local = gitTagMessage(repoDir, tagName);
|
|
324
|
-
if (local.trim()) return local;
|
|
325
|
-
return gitRemoteTagMessage(repoDir, tagName);
|
|
326
|
-
}
|
|
327
|
-
function tagHasTreeseedDevMetadata(repoDir, tagName) {
|
|
328
|
-
return gitTagMessage(repoDir, tagName).includes("treeseed-dev-tag: true");
|
|
329
|
-
}
|
|
330
|
-
function parseTreeseedDevTag(tagName, message) {
|
|
331
|
-
const match = String(tagName).match(/^(\d+\.\d+\.\d+)-dev\.([0-9A-Za-z.-]+)\.(\d{8}T\d{6}Z)$/u);
|
|
332
|
-
if (!match) return null;
|
|
333
|
-
const metadata = Object.fromEntries(
|
|
334
|
-
String(message).split(/\r?\n/u).map((line) => line.match(/^([^:]+):\s*(.*)$/u)).filter((lineMatch) => Boolean(lineMatch)).map((lineMatch) => [String(lineMatch[1]).trim(), String(lineMatch[2] ?? "").trim()])
|
|
335
|
-
);
|
|
336
|
-
if (metadata["treeseed-dev-tag"] !== "true") return null;
|
|
337
|
-
return {
|
|
338
|
-
tagName,
|
|
339
|
-
stableVersion: match[1],
|
|
340
|
-
branchSlug: match[2],
|
|
341
|
-
timestamp: match[3],
|
|
342
|
-
metadata,
|
|
343
|
-
branch: metadata.branch || null,
|
|
344
|
-
packageName: metadata.package || null,
|
|
345
|
-
version: metadata.version || null
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
function devTagScope(info) {
|
|
349
|
-
const branch = info.branch ?? info.branchSlug;
|
|
350
|
-
if (branch === "staging" || info.branchSlug === "staging") return "staging";
|
|
351
|
-
if (branch === "main" || branch === "prod" || branch === "production" || info.branchSlug === "main" || info.branchSlug === "prod" || info.branchSlug === "production") return "main";
|
|
352
|
-
return "preview";
|
|
353
|
-
}
|
|
354
|
-
function classifyStaleTreeseedDevTag(input) {
|
|
355
|
-
const tagName = String(input.tagName).trim();
|
|
356
|
-
if (!tagName.includes("-dev.")) return { tagName, action: "skip", reason: "not-dev-tag", info: null };
|
|
357
|
-
if (tagName.startsWith("deprecated/")) return { tagName, action: "skip", reason: "deprecated-tag", info: null };
|
|
358
|
-
const info = parseTreeseedDevTag(tagName, input.message);
|
|
359
|
-
if (!info) return { tagName, action: "skip", reason: input.message.includes("treeseed-dev-tag: true") ? "malformed-dev-tag" : "missing-treeseed-metadata", info: null };
|
|
360
|
-
if (input.expectedPackageName && info.packageName && info.packageName !== input.expectedPackageName) {
|
|
361
|
-
return { tagName, action: "skip", reason: "package-mismatch", info };
|
|
362
|
-
}
|
|
363
|
-
if ((input.activeReferences ?? []).includes(tagName)) return { tagName, action: "skip", reason: "still-referenced", info };
|
|
364
|
-
const scope = devTagScope(info);
|
|
365
|
-
if (scope === "main") return { tagName, action: "skip", reason: "main-or-production-tag", info };
|
|
366
|
-
const branchScope = input.branchScope ?? "all";
|
|
367
|
-
if (branchScope !== "all" && branchScope !== scope) return { tagName, action: "skip", reason: `scope-${scope}`, info };
|
|
368
|
-
const currentStableVersion = stableVersionBase(input.currentVersion);
|
|
369
|
-
if (!currentStableVersion) return { tagName, action: "skip", reason: "invalid-current-version", info };
|
|
370
|
-
const comparison = compareStableVersions(info.stableVersion, currentStableVersion);
|
|
371
|
-
if (comparison >= 0) {
|
|
372
|
-
return { tagName, action: "skip", reason: comparison === 0 ? "current-version" : "newer-version", info };
|
|
373
|
-
}
|
|
374
|
-
return { tagName, action: "delete", reason: "stale-before-current-version", info };
|
|
375
|
-
}
|
|
376
|
-
function cleanupDevTags(repoDir, tagNames, activeReferences = []) {
|
|
377
|
-
const active = new Set(activeReferences.filter(Boolean));
|
|
378
|
-
const cleaned = [];
|
|
379
|
-
const skipped = [];
|
|
380
|
-
for (const tagName of [...new Set(tagNames.filter(Boolean))].sort()) {
|
|
381
|
-
if (!tagName.includes("-dev.")) {
|
|
382
|
-
skipped.push({ tagName, reason: "not-dev-tag" });
|
|
383
|
-
continue;
|
|
384
|
-
}
|
|
385
|
-
if (active.has(tagName)) {
|
|
386
|
-
skipped.push({ tagName, reason: "still-referenced" });
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
if (!tagHasTreeseedDevMetadata(repoDir, tagName)) {
|
|
390
|
-
skipped.push({ tagName, reason: "missing-treeseed-metadata" });
|
|
391
|
-
continue;
|
|
392
|
-
}
|
|
393
|
-
try {
|
|
394
|
-
run("git", ["tag", "-d", tagName], { cwd: repoDir });
|
|
395
|
-
run("git", ["push", "origin", `:refs/tags/${tagName}`], { cwd: repoDir });
|
|
396
|
-
cleaned.push(tagName);
|
|
397
|
-
} catch (error) {
|
|
398
|
-
skipped.push({ tagName, reason: error instanceof Error ? error.message : String(error) });
|
|
264
|
+
function collectDevelopmentCommitReferenceIssues(root = workspaceRoot(), packageNames = new Set(workspacePackages(root).map((pkg) => pkg.name))) {
|
|
265
|
+
const issues = [];
|
|
266
|
+
const manifestRoots = [
|
|
267
|
+
{ name: "@treeseed/market", dir: root },
|
|
268
|
+
...workspacePackages(root).map((pkg) => ({ name: pkg.name, dir: pkg.dir }))
|
|
269
|
+
];
|
|
270
|
+
for (const pkg of manifestRoots) {
|
|
271
|
+
const packageJsonPath = resolve(pkg.dir, "package.json");
|
|
272
|
+
if (!existsSync(packageJsonPath)) continue;
|
|
273
|
+
const packageJson = readJson(packageJsonPath);
|
|
274
|
+
for (const field of internalDependencyFields(packageJson)) {
|
|
275
|
+
const values = packageJson[field];
|
|
276
|
+
for (const [depName, specValue] of Object.entries(values)) {
|
|
277
|
+
if (!packageNames.has(depName)) continue;
|
|
278
|
+
const spec = String(specValue);
|
|
279
|
+
if (!/^github:treeseed-ai\/[a-z0-9._-]+#[a-f0-9]{40}$/u.test(spec)) {
|
|
280
|
+
issues.push({
|
|
281
|
+
repoName: pkg.name,
|
|
282
|
+
filePath: packageJsonPath,
|
|
283
|
+
field,
|
|
284
|
+
dependencyName: depName,
|
|
285
|
+
spec,
|
|
286
|
+
reason: isGitDependencySpec(spec) ? "git-ref-is-not-commit-sha" : isPrereleaseVersion(spec) ? "prerelease-ref" : "non-git-commit-ref"
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
399
290
|
}
|
|
400
291
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
292
|
+
for (const lockRoot of manifestRoots) {
|
|
293
|
+
for (const lockName of ["package-lock.json", "npm-shrinkwrap.json"]) {
|
|
294
|
+
const lockPath = resolve(lockRoot.dir, lockName);
|
|
295
|
+
if (!existsSync(lockPath)) continue;
|
|
296
|
+
const lockfile = readJson(lockPath);
|
|
297
|
+
const packageEntries = lockfile.packages && typeof lockfile.packages === "object" ? Object.entries(lockfile.packages) : [];
|
|
298
|
+
for (const [entryPath, entry] of packageEntries) {
|
|
299
|
+
if (!entry || typeof entry !== "object") continue;
|
|
300
|
+
for (const field of internalDependencyFields(entry)) {
|
|
301
|
+
const values = entry[field];
|
|
302
|
+
for (const [depName, specValue] of Object.entries(values)) {
|
|
303
|
+
if (!packageNames.has(depName)) continue;
|
|
304
|
+
const spec = String(specValue);
|
|
305
|
+
if (!/^github:treeseed-ai\/[a-z0-9._-]+#[a-f0-9]{40}$/u.test(spec)) {
|
|
306
|
+
issues.push({
|
|
307
|
+
repoName: lockRoot.name,
|
|
308
|
+
filePath: lockPath,
|
|
309
|
+
field: entryPath ? `packages.${entryPath}.${field}` : field,
|
|
310
|
+
dependencyName: depName,
|
|
311
|
+
spec,
|
|
312
|
+
reason: isGitDependencySpec(spec) ? "lockfile-git-ref-is-not-commit-sha" : "lockfile-non-git-commit-ref"
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
411
319
|
}
|
|
320
|
+
return issues;
|
|
412
321
|
}
|
|
413
|
-
function
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
activeReferences: input.activeReferences ?? [],
|
|
420
|
-
branchScope: input.branchScope ?? "all",
|
|
421
|
-
expectedPackageName: input.packageName
|
|
422
|
-
}));
|
|
423
|
-
return {
|
|
424
|
-
packageName: input.packageName,
|
|
425
|
-
currentVersion: input.currentVersion,
|
|
426
|
-
branchScope: input.branchScope ?? "all",
|
|
427
|
-
candidates: classifications.filter((classification) => classification.action === "delete"),
|
|
428
|
-
skipped: classifications.filter((classification) => classification.action === "skip"),
|
|
429
|
-
tags: classifications
|
|
430
|
-
};
|
|
322
|
+
function assertDevelopmentInternalCommitReferences(root = workspaceRoot(), packageNames) {
|
|
323
|
+
const issues = collectDevelopmentCommitReferenceIssues(root, packageNames);
|
|
324
|
+
if (issues.length === 0) return;
|
|
325
|
+
const rendered = issues.map((issue) => `${issue.filePath}${issue.field ? ` ${issue.field}.${issue.dependencyName}` : ""}: ${issue.reason} ${issue.spec}`).join("\n");
|
|
326
|
+
throw new Error(`Development and staging package references must use GitHub commit SHAs for internal Treeseed dependencies.
|
|
327
|
+
${rendered}`);
|
|
431
328
|
}
|
|
432
|
-
function
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
try {
|
|
439
|
-
run("git", ["tag", "-d", candidate.tagName], { cwd: input.repoDir });
|
|
440
|
-
} catch {
|
|
441
|
-
}
|
|
442
|
-
try {
|
|
443
|
-
run("git", ["push", "origin", `:refs/tags/${candidate.tagName}`], { cwd: input.repoDir });
|
|
444
|
-
cleaned.push(candidate.tagName);
|
|
445
|
-
} catch (error) {
|
|
446
|
-
skipped.push({ tagName: candidate.tagName, reason: error instanceof Error ? error.message : String(error) });
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
return {
|
|
450
|
-
status: input.dryRun ? "planned" : "completed",
|
|
451
|
-
packageName: input.packageName,
|
|
452
|
-
currentVersion: input.currentVersion,
|
|
453
|
-
branchScope: input.branchScope ?? "all",
|
|
454
|
-
candidates: plan.candidates.map((entry) => ({ tagName: entry.tagName, reason: entry.reason, branch: entry.info?.branch, branchSlug: entry.info?.branchSlug, version: entry.info?.version })),
|
|
455
|
-
candidateCount: plan.candidates.length,
|
|
456
|
-
cleaned,
|
|
457
|
-
cleanedCount: cleaned.length,
|
|
458
|
-
skipped,
|
|
459
|
-
skippedCount: skipped.length
|
|
460
|
-
};
|
|
329
|
+
function assertNoInternalDevReferences(root = workspaceRoot(), packageNames) {
|
|
330
|
+
const issues = collectInternalDevReferenceIssues(root, packageNames);
|
|
331
|
+
if (issues.length === 0) return;
|
|
332
|
+
const rendered = issues.map((issue) => `${issue.filePath}${issue.field ? ` ${issue.field}.${issue.dependencyName}` : ""}: ${issue.reason} ${issue.spec}`).join("\n");
|
|
333
|
+
throw new Error(`Stable release still contains internal Git or dev dependency references; production package.json files must use plain semver npm versions.
|
|
334
|
+
${rendered}`);
|
|
461
335
|
}
|
|
462
336
|
export {
|
|
337
|
+
assertDevelopmentInternalCommitReferences,
|
|
463
338
|
assertNoInternalDevReferences,
|
|
464
|
-
|
|
465
|
-
cleanupDevTags,
|
|
466
|
-
cleanupStaleTreeseedDevTags,
|
|
339
|
+
collectDevelopmentCommitReferenceIssues,
|
|
467
340
|
collectInternalDevReferenceIssues,
|
|
468
|
-
collectTreeseedDevTagCleanupPlan,
|
|
469
|
-
createDevTagMessage,
|
|
470
341
|
createPackageDependencyReference,
|
|
471
342
|
devTagFromDependencySpec,
|
|
472
|
-
gitTagMessage,
|
|
473
343
|
installableInternalDependencyVersions,
|
|
474
344
|
internalDependencyFields,
|
|
475
345
|
isGitDependencySpec,
|
|
@@ -477,10 +347,8 @@ export {
|
|
|
477
347
|
isStableVersion,
|
|
478
348
|
normalizeGitRemoteForDependency,
|
|
479
349
|
normalizeGitRemoteForManifest,
|
|
480
|
-
parseTreeseedDevTag,
|
|
481
350
|
releaseTagFromDependencySpec,
|
|
482
351
|
rewriteInternalDependenciesToStableVersions,
|
|
483
352
|
rewriteProjectInternalDependenciesToStableVersions,
|
|
484
|
-
tagHasTreeseedDevMetadata,
|
|
485
353
|
updateInternalDependencySpecs
|
|
486
354
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ProjectEnvironmentName, ProjectLaunchHostBindingInput, TemplateLaunchRequirements } from '../../sdk-types.
|
|
2
|
-
import { type PlatformRepositoryDescriptor } from '../repository-operations.
|
|
3
|
-
import { type ProjectLaunchSecretSyncProgressEvent, type ProjectLaunchSecretSyncResult } from './template-secret-sync.
|
|
4
|
-
import { type ProjectLaunchHostInventoryRecord, type ProjectLaunchResolvedHostBinding, type ResolveProjectLaunchHostBindingsResult } from '../../template-launch-requirements.
|
|
1
|
+
import type { ProjectEnvironmentName, ProjectLaunchHostBindingInput, TemplateLaunchRequirements } from '../../sdk-types.js';
|
|
2
|
+
import { type PlatformRepositoryDescriptor } from '../repository-operations.js';
|
|
3
|
+
import { type ProjectLaunchSecretSyncProgressEvent, type ProjectLaunchSecretSyncResult } from './template-secret-sync.js';
|
|
4
|
+
import { type ProjectLaunchHostInventoryRecord, type ProjectLaunchResolvedHostBinding, type ResolveProjectLaunchHostBindingsResult } from '../../template-launch-requirements.js';
|
|
5
5
|
export type ProjectHostOperationKind = 'inspect' | 'audit' | 'resync' | 'replace' | 'rotate';
|
|
6
6
|
export type ProjectHostOperationStatus = 'ok' | 'warning' | 'blocked';
|
|
7
7
|
export interface ProjectHostOperationDiagnostic {
|