@software-dlc/cli 0.157.2
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/CHANGELOG.md +11 -0
- package/LICENSE +105 -0
- package/README.md +31 -0
- package/dist/checkout.d.ts +43 -0
- package/dist/checkout.d.ts.map +1 -0
- package/dist/checkout.js +92 -0
- package/dist/checkout.js.map +1 -0
- package/dist/cli-arguments.d.ts +13 -0
- package/dist/cli-arguments.d.ts.map +1 -0
- package/dist/cli-arguments.js +67 -0
- package/dist/cli-arguments.js.map +1 -0
- package/dist/cli-branch-history.d.ts +48 -0
- package/dist/cli-branch-history.d.ts.map +1 -0
- package/dist/cli-branch-history.js +319 -0
- package/dist/cli-branch-history.js.map +1 -0
- package/dist/cli-branches.d.ts +22 -0
- package/dist/cli-branches.d.ts.map +1 -0
- package/dist/cli-branches.js +59 -0
- package/dist/cli-branches.js.map +1 -0
- package/dist/cli-deploy.d.ts +14 -0
- package/dist/cli-deploy.d.ts.map +1 -0
- package/dist/cli-deploy.js +164 -0
- package/dist/cli-deploy.js.map +1 -0
- package/dist/cli-health.d.ts +3 -0
- package/dist/cli-health.d.ts.map +1 -0
- package/dist/cli-health.js +73 -0
- package/dist/cli-health.js.map +1 -0
- package/dist/cli-help.d.ts +21 -0
- package/dist/cli-help.d.ts.map +1 -0
- package/dist/cli-help.js +176 -0
- package/dist/cli-help.js.map +1 -0
- package/dist/cli-login.d.ts +76 -0
- package/dist/cli-login.d.ts.map +1 -0
- package/dist/cli-login.js +634 -0
- package/dist/cli-login.js.map +1 -0
- package/dist/cli-operation.d.ts +2 -0
- package/dist/cli-operation.d.ts.map +1 -0
- package/dist/cli-operation.js +66 -0
- package/dist/cli-operation.js.map +1 -0
- package/dist/cli-org.d.ts +12 -0
- package/dist/cli-org.d.ts.map +1 -0
- package/dist/cli-org.js +218 -0
- package/dist/cli-org.js.map +1 -0
- package/dist/cli-rebuild.d.ts +20 -0
- package/dist/cli-rebuild.d.ts.map +1 -0
- package/dist/cli-rebuild.js +29 -0
- package/dist/cli-rebuild.js.map +1 -0
- package/dist/cli-reset.d.ts +27 -0
- package/dist/cli-reset.d.ts.map +1 -0
- package/dist/cli-reset.js +44 -0
- package/dist/cli-reset.js.map +1 -0
- package/dist/cli-snapshot.d.ts +398 -0
- package/dist/cli-snapshot.d.ts.map +1 -0
- package/dist/cli-snapshot.js +45 -0
- package/dist/cli-snapshot.js.map +1 -0
- package/dist/cli-task-context.d.ts +3 -0
- package/dist/cli-task-context.d.ts.map +1 -0
- package/dist/cli-task-context.js +112 -0
- package/dist/cli-task-context.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1004 -0
- package/dist/cli.js.map +1 -0
- package/dist/graph-packages-lock.d.ts +169 -0
- package/dist/graph-packages-lock.d.ts.map +1 -0
- package/dist/graph-packages-lock.js +503 -0
- package/dist/graph-packages-lock.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/local/aggregate-preflight.d.ts +12 -0
- package/dist/local/aggregate-preflight.d.ts.map +1 -0
- package/dist/local/aggregate-preflight.js +22 -0
- package/dist/local/aggregate-preflight.js.map +1 -0
- package/dist/local/allow-mcp.d.ts +77 -0
- package/dist/local/allow-mcp.d.ts.map +1 -0
- package/dist/local/allow-mcp.js +394 -0
- package/dist/local/allow-mcp.js.map +1 -0
- package/dist/local/api-client.d.ts +15 -0
- package/dist/local/api-client.d.ts.map +1 -0
- package/dist/local/api-client.js +87 -0
- package/dist/local/api-client.js.map +1 -0
- package/dist/local/app-contract-readers.d.ts +229 -0
- package/dist/local/app-contract-readers.d.ts.map +1 -0
- package/dist/local/app-contract-readers.js +450 -0
- package/dist/local/app-contract-readers.js.map +1 -0
- package/dist/local/app-org-reader.d.ts +21 -0
- package/dist/local/app-org-reader.d.ts.map +1 -0
- package/dist/local/app-org-reader.js +66 -0
- package/dist/local/app-org-reader.js.map +1 -0
- package/dist/local/app-shell-readers.d.ts +96 -0
- package/dist/local/app-shell-readers.d.ts.map +1 -0
- package/dist/local/app-shell-readers.js +381 -0
- package/dist/local/app-shell-readers.js.map +1 -0
- package/dist/local/app-tasks-read.d.ts +202 -0
- package/dist/local/app-tasks-read.d.ts.map +1 -0
- package/dist/local/app-tasks-read.js +290 -0
- package/dist/local/app-tasks-read.js.map +1 -0
- package/dist/local/app-worktrees.d.ts +69 -0
- package/dist/local/app-worktrees.d.ts.map +1 -0
- package/dist/local/app-worktrees.js +554 -0
- package/dist/local/app-worktrees.js.map +1 -0
- package/dist/local/base-sync-manifest.d.ts +12 -0
- package/dist/local/base-sync-manifest.d.ts.map +1 -0
- package/dist/local/base-sync-manifest.js +57 -0
- package/dist/local/base-sync-manifest.js.map +1 -0
- package/dist/local/blast-radius.d.ts +191 -0
- package/dist/local/blast-radius.d.ts.map +1 -0
- package/dist/local/blast-radius.js +585 -0
- package/dist/local/blast-radius.js.map +1 -0
- package/dist/local/canonical.d.ts +2 -0
- package/dist/local/canonical.d.ts.map +1 -0
- package/dist/local/canonical.js +2 -0
- package/dist/local/canonical.js.map +1 -0
- package/dist/local/config.d.ts +22 -0
- package/dist/local/config.d.ts.map +1 -0
- package/dist/local/config.js +57 -0
- package/dist/local/config.js.map +1 -0
- package/dist/local/document-commands.d.ts +163 -0
- package/dist/local/document-commands.d.ts.map +1 -0
- package/dist/local/document-commands.js +620 -0
- package/dist/local/document-commands.js.map +1 -0
- package/dist/local/document-embeds.d.ts +21 -0
- package/dist/local/document-embeds.d.ts.map +1 -0
- package/dist/local/document-embeds.js +38 -0
- package/dist/local/document-embeds.js.map +1 -0
- package/dist/local/environment-context.d.ts +39 -0
- package/dist/local/environment-context.d.ts.map +1 -0
- package/dist/local/environment-context.js +193 -0
- package/dist/local/environment-context.js.map +1 -0
- package/dist/local/environment-exclude.d.ts +7 -0
- package/dist/local/environment-exclude.d.ts.map +1 -0
- package/dist/local/environment-exclude.js +82 -0
- package/dist/local/environment-exclude.js.map +1 -0
- package/dist/local/environment-sidecar.d.ts +126 -0
- package/dist/local/environment-sidecar.d.ts.map +1 -0
- package/dist/local/environment-sidecar.js +442 -0
- package/dist/local/environment-sidecar.js.map +1 -0
- package/dist/local/environment-switch.d.ts +22 -0
- package/dist/local/environment-switch.d.ts.map +1 -0
- package/dist/local/environment-switch.js +385 -0
- package/dist/local/environment-switch.js.map +1 -0
- package/dist/local/exact-remote-projection.d.ts +17 -0
- package/dist/local/exact-remote-projection.d.ts.map +1 -0
- package/dist/local/exact-remote-projection.js +53 -0
- package/dist/local/exact-remote-projection.js.map +1 -0
- package/dist/local/experimental/path-object-store.d.ts +66 -0
- package/dist/local/experimental/path-object-store.d.ts.map +1 -0
- package/dist/local/experimental/path-object-store.js +135 -0
- package/dist/local/experimental/path-object-store.js.map +1 -0
- package/dist/local/external-worktree-binding.d.ts +21 -0
- package/dist/local/external-worktree-binding.d.ts.map +1 -0
- package/dist/local/external-worktree-binding.js +56 -0
- package/dist/local/external-worktree-binding.js.map +1 -0
- package/dist/local/folder-members.d.ts +34 -0
- package/dist/local/folder-members.d.ts.map +1 -0
- package/dist/local/folder-members.js +168 -0
- package/dist/local/folder-members.js.map +1 -0
- package/dist/local/git-ref-authority.d.ts +11 -0
- package/dist/local/git-ref-authority.d.ts.map +1 -0
- package/dist/local/git-ref-authority.js +76 -0
- package/dist/local/git-ref-authority.js.map +1 -0
- package/dist/local/git.d.ts +88 -0
- package/dist/local/git.d.ts.map +1 -0
- package/dist/local/git.js +413 -0
- package/dist/local/git.js.map +1 -0
- package/dist/local/graph-read.d.ts +168 -0
- package/dist/local/graph-read.d.ts.map +1 -0
- package/dist/local/graph-read.js +360 -0
- package/dist/local/graph-read.js.map +1 -0
- package/dist/local/graph-sync.d.ts +39 -0
- package/dist/local/graph-sync.d.ts.map +1 -0
- package/dist/local/graph-sync.js +186 -0
- package/dist/local/graph-sync.js.map +1 -0
- package/dist/local/guide-commands.d.ts +79 -0
- package/dist/local/guide-commands.d.ts.map +1 -0
- package/dist/local/guide-commands.js +247 -0
- package/dist/local/guide-commands.js.map +1 -0
- package/dist/local/health-files.d.ts +24 -0
- package/dist/local/health-files.d.ts.map +1 -0
- package/dist/local/health-files.js +133 -0
- package/dist/local/health-files.js.map +1 -0
- package/dist/local/health-inspection.d.ts +12 -0
- package/dist/local/health-inspection.d.ts.map +1 -0
- package/dist/local/health-inspection.js +407 -0
- package/dist/local/health-inspection.js.map +1 -0
- package/dist/local/health-policy.d.ts +11 -0
- package/dist/local/health-policy.d.ts.map +1 -0
- package/dist/local/health-policy.js +257 -0
- package/dist/local/health-policy.js.map +1 -0
- package/dist/local/health-projection.d.ts +14 -0
- package/dist/local/health-projection.d.ts.map +1 -0
- package/dist/local/health-projection.js +102 -0
- package/dist/local/health-projection.js.map +1 -0
- package/dist/local/health-schema.d.ts +338 -0
- package/dist/local/health-schema.d.ts.map +1 -0
- package/dist/local/health-schema.js +213 -0
- package/dist/local/health-schema.js.map +1 -0
- package/dist/local/health-store.d.ts +61 -0
- package/dist/local/health-store.d.ts.map +1 -0
- package/dist/local/health-store.js +218 -0
- package/dist/local/health-store.js.map +1 -0
- package/dist/local/index.d.ts +66 -0
- package/dist/local/index.d.ts.map +1 -0
- package/dist/local/index.js +66 -0
- package/dist/local/index.js.map +1 -0
- package/dist/local/journey-commands.d.ts +65 -0
- package/dist/local/journey-commands.d.ts.map +1 -0
- package/dist/local/journey-commands.js +138 -0
- package/dist/local/journey-commands.js.map +1 -0
- package/dist/local/local-org-store.d.ts +46 -0
- package/dist/local/local-org-store.d.ts.map +1 -0
- package/dist/local/local-org-store.js +132 -0
- package/dist/local/local-org-store.js.map +1 -0
- package/dist/local/local-org.d.ts +389 -0
- package/dist/local/local-org.d.ts.map +1 -0
- package/dist/local/local-org.js +855 -0
- package/dist/local/local-org.js.map +1 -0
- package/dist/local/media-upload.d.ts +5 -0
- package/dist/local/media-upload.d.ts.map +1 -0
- package/dist/local/media-upload.js +41 -0
- package/dist/local/media-upload.js.map +1 -0
- package/dist/local/operation.d.ts +155 -0
- package/dist/local/operation.d.ts.map +1 -0
- package/dist/local/operation.js +340 -0
- package/dist/local/operation.js.map +1 -0
- package/dist/local/ownership-reader-schema.d.ts +117 -0
- package/dist/local/ownership-reader-schema.d.ts.map +1 -0
- package/dist/local/ownership-reader-schema.js +105 -0
- package/dist/local/ownership-reader-schema.js.map +1 -0
- package/dist/local/ownership-reader-worker.d.ts +2 -0
- package/dist/local/ownership-reader-worker.d.ts.map +1 -0
- package/dist/local/ownership-reader-worker.js +341 -0
- package/dist/local/ownership-reader-worker.js.map +1 -0
- package/dist/local/ownership-reader.d.ts +10 -0
- package/dist/local/ownership-reader.d.ts.map +1 -0
- package/dist/local/ownership-reader.js +93 -0
- package/dist/local/ownership-reader.js.map +1 -0
- package/dist/local/package-uses-check.d.ts +33 -0
- package/dist/local/package-uses-check.d.ts.map +1 -0
- package/dist/local/package-uses-check.js +62 -0
- package/dist/local/package-uses-check.js.map +1 -0
- package/dist/local/pending-recovery.d.ts +22 -0
- package/dist/local/pending-recovery.d.ts.map +1 -0
- package/dist/local/pending-recovery.js +171 -0
- package/dist/local/pending-recovery.js.map +1 -0
- package/dist/local/portable-commit-store.d.ts +28 -0
- package/dist/local/portable-commit-store.d.ts.map +1 -0
- package/dist/local/portable-commit-store.js +187 -0
- package/dist/local/portable-commit-store.js.map +1 -0
- package/dist/local/portable-commit.d.ts +109 -0
- package/dist/local/portable-commit.d.ts.map +1 -0
- package/dist/local/portable-commit.js +209 -0
- package/dist/local/portable-commit.js.map +1 -0
- package/dist/local/portable-remote.d.ts +432 -0
- package/dist/local/portable-remote.d.ts.map +1 -0
- package/dist/local/portable-remote.js +280 -0
- package/dist/local/portable-remote.js.map +1 -0
- package/dist/local/project-deleted.d.ts +4 -0
- package/dist/local/project-deleted.d.ts.map +1 -0
- package/dist/local/project-deleted.js +13 -0
- package/dist/local/project-deleted.js.map +1 -0
- package/dist/local/projection.d.ts +166 -0
- package/dist/local/projection.d.ts.map +1 -0
- package/dist/local/projection.js +709 -0
- package/dist/local/projection.js.map +1 -0
- package/dist/local/read-operation.d.ts +3 -0
- package/dist/local/read-operation.d.ts.map +1 -0
- package/dist/local/read-operation.js +19 -0
- package/dist/local/read-operation.js.map +1 -0
- package/dist/local/rebuild.d.ts +11 -0
- package/dist/local/rebuild.d.ts.map +1 -0
- package/dist/local/rebuild.js +42 -0
- package/dist/local/rebuild.js.map +1 -0
- package/dist/local/remote-base.d.ts +25 -0
- package/dist/local/remote-base.d.ts.map +1 -0
- package/dist/local/remote-base.js +68 -0
- package/dist/local/remote-base.js.map +1 -0
- package/dist/local/save-layout-worker.d.ts +19 -0
- package/dist/local/save-layout-worker.d.ts.map +1 -0
- package/dist/local/save-layout-worker.js +28 -0
- package/dist/local/save-layout-worker.js.map +1 -0
- package/dist/local/save-layout.d.ts +84 -0
- package/dist/local/save-layout.d.ts.map +1 -0
- package/dist/local/save-layout.js +221 -0
- package/dist/local/save-layout.js.map +1 -0
- package/dist/local/scope-impact.d.ts +31 -0
- package/dist/local/scope-impact.d.ts.map +1 -0
- package/dist/local/scope-impact.js +32 -0
- package/dist/local/scope-impact.js.map +1 -0
- package/dist/local/source-evidence/filesystem-worker.d.ts +2 -0
- package/dist/local/source-evidence/filesystem-worker.d.ts.map +1 -0
- package/dist/local/source-evidence/filesystem-worker.js +139 -0
- package/dist/local/source-evidence/filesystem-worker.js.map +1 -0
- package/dist/local/source-evidence/processes.d.ts +20 -0
- package/dist/local/source-evidence/processes.d.ts.map +1 -0
- package/dist/local/source-evidence/processes.js +133 -0
- package/dist/local/source-evidence/processes.js.map +1 -0
- package/dist/local/source-evidence/protocol.d.ts +52 -0
- package/dist/local/source-evidence/protocol.d.ts.map +1 -0
- package/dist/local/source-evidence/protocol.js +72 -0
- package/dist/local/source-evidence/protocol.js.map +1 -0
- package/dist/local/source-evidence/reader.d.ts +14 -0
- package/dist/local/source-evidence/reader.d.ts.map +1 -0
- package/dist/local/source-evidence/reader.js +308 -0
- package/dist/local/source-evidence/reader.js.map +1 -0
- package/dist/local/source-evidence/schema.d.ts +2504 -0
- package/dist/local/source-evidence/schema.d.ts.map +1 -0
- package/dist/local/source-evidence/schema.js +99 -0
- package/dist/local/source-evidence/schema.js.map +1 -0
- package/dist/local/source-policy/loader.d.ts +29 -0
- package/dist/local/source-policy/loader.d.ts.map +1 -0
- package/dist/local/source-policy/loader.js +209 -0
- package/dist/local/source-policy/loader.js.map +1 -0
- package/dist/local/source-policy/process.d.ts +7 -0
- package/dist/local/source-policy/process.d.ts.map +1 -0
- package/dist/local/source-policy/process.js +53 -0
- package/dist/local/source-policy/process.js.map +1 -0
- package/dist/local/source-policy/protocol.d.ts +27 -0
- package/dist/local/source-policy/protocol.d.ts.map +1 -0
- package/dist/local/source-policy/protocol.js +48 -0
- package/dist/local/source-policy/protocol.js.map +1 -0
- package/dist/local/source-policy/worker.d.ts +2 -0
- package/dist/local/source-policy/worker.d.ts.map +1 -0
- package/dist/local/source-policy/worker.js +100 -0
- package/dist/local/source-policy/worker.js.map +1 -0
- package/dist/local/state-directory.d.ts +17 -0
- package/dist/local/state-directory.d.ts.map +1 -0
- package/dist/local/state-directory.js +68 -0
- package/dist/local/state-directory.js.map +1 -0
- package/dist/local/store-database.d.ts +13 -0
- package/dist/local/store-database.d.ts.map +1 -0
- package/dist/local/store-database.js +187 -0
- package/dist/local/store-database.js.map +1 -0
- package/dist/local/store.d.ts +181 -0
- package/dist/local/store.d.ts.map +1 -0
- package/dist/local/store.js +585 -0
- package/dist/local/store.js.map +1 -0
- package/dist/local/sync.d.ts +47 -0
- package/dist/local/sync.d.ts.map +1 -0
- package/dist/local/sync.js +518 -0
- package/dist/local/sync.js.map +1 -0
- package/dist/local/task-context-inspection.d.ts +23 -0
- package/dist/local/task-context-inspection.d.ts.map +1 -0
- package/dist/local/task-context-inspection.js +165 -0
- package/dist/local/task-context-inspection.js.map +1 -0
- package/dist/local/task-context-observations.d.ts +9553 -0
- package/dist/local/task-context-observations.d.ts.map +1 -0
- package/dist/local/task-context-observations.js +232 -0
- package/dist/local/task-context-observations.js.map +1 -0
- package/dist/local/task-context-provider.d.ts +18 -0
- package/dist/local/task-context-provider.d.ts.map +1 -0
- package/dist/local/task-context-provider.js +231 -0
- package/dist/local/task-context-provider.js.map +1 -0
- package/dist/local/task-context-schema.d.ts +847 -0
- package/dist/local/task-context-schema.d.ts.map +1 -0
- package/dist/local/task-context-schema.js +305 -0
- package/dist/local/task-context-schema.js.map +1 -0
- package/dist/local/task-context-source.d.ts +16 -0
- package/dist/local/task-context-source.d.ts.map +1 -0
- package/dist/local/task-context-source.js +45 -0
- package/dist/local/task-context-source.js.map +1 -0
- package/dist/local/task-context.d.ts +14 -0
- package/dist/local/task-context.d.ts.map +1 -0
- package/dist/local/task-context.js +570 -0
- package/dist/local/task-context.js.map +1 -0
- package/dist/local/test-commands.d.ts +71 -0
- package/dist/local/test-commands.d.ts.map +1 -0
- package/dist/local/test-commands.js +292 -0
- package/dist/local/test-commands.js.map +1 -0
- package/dist/local/tree-save.d.ts +117 -0
- package/dist/local/tree-save.d.ts.map +1 -0
- package/dist/local/tree-save.js +615 -0
- package/dist/local/tree-save.js.map +1 -0
- package/dist/local/variants.d.ts +125 -0
- package/dist/local/variants.d.ts.map +1 -0
- package/dist/local/variants.js +267 -0
- package/dist/local/variants.js.map +1 -0
- package/dist/local/workspace-admission.d.ts +61 -0
- package/dist/local/workspace-admission.d.ts.map +1 -0
- package/dist/local/workspace-admission.js +112 -0
- package/dist/local/workspace-admission.js.map +1 -0
- package/dist/local/workspace-authority-guard.d.ts +18 -0
- package/dist/local/workspace-authority-guard.d.ts.map +1 -0
- package/dist/local/workspace-authority-guard.js +69 -0
- package/dist/local/workspace-authority-guard.js.map +1 -0
- package/dist/local/workspace-authority.d.ts +33 -0
- package/dist/local/workspace-authority.d.ts.map +1 -0
- package/dist/local/workspace-authority.js +33 -0
- package/dist/local/workspace-authority.js.map +1 -0
- package/dist/local/workspace-branch-runtime.d.ts +61 -0
- package/dist/local/workspace-branch-runtime.d.ts.map +1 -0
- package/dist/local/workspace-branch-runtime.js +216 -0
- package/dist/local/workspace-branch-runtime.js.map +1 -0
- package/dist/local/workspace-built-content.d.ts +137 -0
- package/dist/local/workspace-built-content.d.ts.map +1 -0
- package/dist/local/workspace-built-content.js +393 -0
- package/dist/local/workspace-built-content.js.map +1 -0
- package/dist/local/workspace-claim-status-read.d.ts +53 -0
- package/dist/local/workspace-claim-status-read.d.ts.map +1 -0
- package/dist/local/workspace-claim-status-read.js +118 -0
- package/dist/local/workspace-claim-status-read.js.map +1 -0
- package/dist/local/workspace-claim-status.d.ts +172 -0
- package/dist/local/workspace-claim-status.d.ts.map +1 -0
- package/dist/local/workspace-claim-status.js +721 -0
- package/dist/local/workspace-claim-status.js.map +1 -0
- package/dist/local/workspace-claim-views.d.ts +45 -0
- package/dist/local/workspace-claim-views.d.ts.map +1 -0
- package/dist/local/workspace-claim-views.js +45 -0
- package/dist/local/workspace-claim-views.js.map +1 -0
- package/dist/local/workspace-cli.d.ts +46 -0
- package/dist/local/workspace-cli.d.ts.map +1 -0
- package/dist/local/workspace-cli.js +1524 -0
- package/dist/local/workspace-cli.js.map +1 -0
- package/dist/local/workspace-commit-resolver.d.ts +19 -0
- package/dist/local/workspace-commit-resolver.d.ts.map +1 -0
- package/dist/local/workspace-commit-resolver.js +47 -0
- package/dist/local/workspace-commit-resolver.js.map +1 -0
- package/dist/local/workspace-decision-store.d.ts +184 -0
- package/dist/local/workspace-decision-store.d.ts.map +1 -0
- package/dist/local/workspace-decision-store.js +510 -0
- package/dist/local/workspace-decision-store.js.map +1 -0
- package/dist/local/workspace-environment-runtime.d.ts +107 -0
- package/dist/local/workspace-environment-runtime.d.ts.map +1 -0
- package/dist/local/workspace-environment-runtime.js +135 -0
- package/dist/local/workspace-environment-runtime.js.map +1 -0
- package/dist/local/workspace-evidence-drop.d.ts +21 -0
- package/dist/local/workspace-evidence-drop.d.ts.map +1 -0
- package/dist/local/workspace-evidence-drop.js +58 -0
- package/dist/local/workspace-evidence-drop.js.map +1 -0
- package/dist/local/workspace-evidence-sign-tool.d.ts +20 -0
- package/dist/local/workspace-evidence-sign-tool.d.ts.map +1 -0
- package/dist/local/workspace-evidence-sign-tool.js +85 -0
- package/dist/local/workspace-evidence-sign-tool.js.map +1 -0
- package/dist/local/workspace-evidence-status.d.ts +89 -0
- package/dist/local/workspace-evidence-status.d.ts.map +1 -0
- package/dist/local/workspace-evidence-status.js +141 -0
- package/dist/local/workspace-evidence-status.js.map +1 -0
- package/dist/local/workspace-evidence.d.ts +145 -0
- package/dist/local/workspace-evidence.d.ts.map +1 -0
- package/dist/local/workspace-evidence.js +347 -0
- package/dist/local/workspace-evidence.js.map +1 -0
- package/dist/local/workspace-graph-store.d.ts +32 -0
- package/dist/local/workspace-graph-store.d.ts.map +1 -0
- package/dist/local/workspace-graph-store.js +249 -0
- package/dist/local/workspace-graph-store.js.map +1 -0
- package/dist/local/workspace-handoff.d.ts +32 -0
- package/dist/local/workspace-handoff.d.ts.map +1 -0
- package/dist/local/workspace-handoff.js +144 -0
- package/dist/local/workspace-handoff.js.map +1 -0
- package/dist/local/workspace-history-journal.d.ts +70 -0
- package/dist/local/workspace-history-journal.d.ts.map +1 -0
- package/dist/local/workspace-history-journal.js +131 -0
- package/dist/local/workspace-history-journal.js.map +1 -0
- package/dist/local/workspace-history-store.d.ts +98 -0
- package/dist/local/workspace-history-store.d.ts.map +1 -0
- package/dist/local/workspace-history-store.js +632 -0
- package/dist/local/workspace-history-store.js.map +1 -0
- package/dist/local/workspace-history-types.d.ts +307 -0
- package/dist/local/workspace-history-types.d.ts.map +1 -0
- package/dist/local/workspace-history-types.js +2 -0
- package/dist/local/workspace-history-types.js.map +1 -0
- package/dist/local/workspace-integration-runtime.d.ts +48 -0
- package/dist/local/workspace-integration-runtime.d.ts.map +1 -0
- package/dist/local/workspace-integration-runtime.js +419 -0
- package/dist/local/workspace-integration-runtime.js.map +1 -0
- package/dist/local/workspace-lock.d.ts +7 -0
- package/dist/local/workspace-lock.d.ts.map +1 -0
- package/dist/local/workspace-lock.js +211 -0
- package/dist/local/workspace-lock.js.map +1 -0
- package/dist/local/workspace-merge.d.ts +77 -0
- package/dist/local/workspace-merge.d.ts.map +1 -0
- package/dist/local/workspace-merge.js +703 -0
- package/dist/local/workspace-merge.js.map +1 -0
- package/dist/local/workspace-mixed-history.d.ts +33 -0
- package/dist/local/workspace-mixed-history.d.ts.map +1 -0
- package/dist/local/workspace-mixed-history.js +107 -0
- package/dist/local/workspace-mixed-history.js.map +1 -0
- package/dist/local/workspace-overlap-allocation.d.ts +33 -0
- package/dist/local/workspace-overlap-allocation.d.ts.map +1 -0
- package/dist/local/workspace-overlap-allocation.js +69 -0
- package/dist/local/workspace-overlap-allocation.js.map +1 -0
- package/dist/local/workspace-overlap-impact.d.ts +46 -0
- package/dist/local/workspace-overlap-impact.d.ts.map +1 -0
- package/dist/local/workspace-overlap-impact.js +162 -0
- package/dist/local/workspace-overlap-impact.js.map +1 -0
- package/dist/local/workspace-overlap.d.ts +109 -0
- package/dist/local/workspace-overlap.d.ts.map +1 -0
- package/dist/local/workspace-overlap.js +327 -0
- package/dist/local/workspace-overlap.js.map +1 -0
- package/dist/local/workspace-paths.d.ts +4 -0
- package/dist/local/workspace-paths.d.ts.map +1 -0
- package/dist/local/workspace-paths.js +8 -0
- package/dist/local/workspace-paths.js.map +1 -0
- package/dist/local/workspace-pick-runtime.d.ts +70 -0
- package/dist/local/workspace-pick-runtime.d.ts.map +1 -0
- package/dist/local/workspace-pick-runtime.js +177 -0
- package/dist/local/workspace-pick-runtime.js.map +1 -0
- package/dist/local/workspace-pick-store.d.ts +33 -0
- package/dist/local/workspace-pick-store.d.ts.map +1 -0
- package/dist/local/workspace-pick-store.js +43 -0
- package/dist/local/workspace-pick-store.js.map +1 -0
- package/dist/local/workspace-pick.d.ts +73 -0
- package/dist/local/workspace-pick.d.ts.map +1 -0
- package/dist/local/workspace-pick.js +253 -0
- package/dist/local/workspace-pick.js.map +1 -0
- package/dist/local/workspace-portable-authoring.d.ts +43 -0
- package/dist/local/workspace-portable-authoring.d.ts.map +1 -0
- package/dist/local/workspace-portable-authoring.js +128 -0
- package/dist/local/workspace-portable-authoring.js.map +1 -0
- package/dist/local/workspace-prune.d.ts +63 -0
- package/dist/local/workspace-prune.d.ts.map +1 -0
- package/dist/local/workspace-prune.js +267 -0
- package/dist/local/workspace-prune.js.map +1 -0
- package/dist/local/workspace-remote-fetch.d.ts +82 -0
- package/dist/local/workspace-remote-fetch.d.ts.map +1 -0
- package/dist/local/workspace-remote-fetch.js +409 -0
- package/dist/local/workspace-remote-fetch.js.map +1 -0
- package/dist/local/workspace-remote-provider.d.ts +97 -0
- package/dist/local/workspace-remote-provider.d.ts.map +1 -0
- package/dist/local/workspace-remote-provider.js +400 -0
- package/dist/local/workspace-remote-provider.js.map +1 -0
- package/dist/local/workspace-remote-pull-request-journal.d.ts +49 -0
- package/dist/local/workspace-remote-pull-request-journal.d.ts.map +1 -0
- package/dist/local/workspace-remote-pull-request-journal.js +63 -0
- package/dist/local/workspace-remote-pull-request-journal.js.map +1 -0
- package/dist/local/workspace-remote-pull-request.d.ts +36 -0
- package/dist/local/workspace-remote-pull-request.d.ts.map +1 -0
- package/dist/local/workspace-remote-pull-request.js +158 -0
- package/dist/local/workspace-remote-pull-request.js.map +1 -0
- package/dist/local/workspace-remote-push.d.ts +88 -0
- package/dist/local/workspace-remote-push.d.ts.map +1 -0
- package/dist/local/workspace-remote-push.js +297 -0
- package/dist/local/workspace-remote-push.js.map +1 -0
- package/dist/local/workspace-remote-topic-journal.d.ts +56 -0
- package/dist/local/workspace-remote-topic-journal.d.ts.map +1 -0
- package/dist/local/workspace-remote-topic-journal.js +121 -0
- package/dist/local/workspace-remote-topic-journal.js.map +1 -0
- package/dist/local/workspace-remote-topic.d.ts +45 -0
- package/dist/local/workspace-remote-topic.d.ts.map +1 -0
- package/dist/local/workspace-remote-topic.js +204 -0
- package/dist/local/workspace-remote-topic.js.map +1 -0
- package/dist/local/workspace-remote-transfer.d.ts +76 -0
- package/dist/local/workspace-remote-transfer.d.ts.map +1 -0
- package/dist/local/workspace-remote-transfer.js +270 -0
- package/dist/local/workspace-remote-transfer.js.map +1 -0
- package/dist/local/workspace-resolution.d.ts +145 -0
- package/dist/local/workspace-resolution.d.ts.map +1 -0
- package/dist/local/workspace-resolution.js +479 -0
- package/dist/local/workspace-resolution.js.map +1 -0
- package/dist/local/workspace-resolver-provider.d.ts +72 -0
- package/dist/local/workspace-resolver-provider.d.ts.map +1 -0
- package/dist/local/workspace-resolver-provider.js +312 -0
- package/dist/local/workspace-resolver-provider.js.map +1 -0
- package/dist/local/workspace-runtime-handoff.d.ts +52 -0
- package/dist/local/workspace-runtime-handoff.d.ts.map +1 -0
- package/dist/local/workspace-runtime-handoff.js +237 -0
- package/dist/local/workspace-runtime-handoff.js.map +1 -0
- package/dist/local/workspace-runtime-lease.d.ts +26 -0
- package/dist/local/workspace-runtime-lease.d.ts.map +1 -0
- package/dist/local/workspace-runtime-lease.js +123 -0
- package/dist/local/workspace-runtime-lease.js.map +1 -0
- package/dist/local/workspace-runtime.d.ts +690 -0
- package/dist/local/workspace-runtime.d.ts.map +1 -0
- package/dist/local/workspace-runtime.js +2124 -0
- package/dist/local/workspace-runtime.js.map +1 -0
- package/dist/local/workspace-scope.d.ts +70 -0
- package/dist/local/workspace-scope.d.ts.map +1 -0
- package/dist/local/workspace-scope.js +206 -0
- package/dist/local/workspace-scope.js.map +1 -0
- package/dist/local/workspace-sources.d.ts +159 -0
- package/dist/local/workspace-sources.d.ts.map +1 -0
- package/dist/local/workspace-sources.js +570 -0
- package/dist/local/workspace-sources.js.map +1 -0
- package/dist/local/workspace-store-database.d.ts +5 -0
- package/dist/local/workspace-store-database.d.ts.map +1 -0
- package/dist/local/workspace-store-database.js +726 -0
- package/dist/local/workspace-store-database.js.map +1 -0
- package/dist/local/workspace-store.d.ts +261 -0
- package/dist/local/workspace-store.d.ts.map +1 -0
- package/dist/local/workspace-store.js +831 -0
- package/dist/local/workspace-store.js.map +1 -0
- package/dist/local/workspace-topology-runtime.d.ts +27 -0
- package/dist/local/workspace-topology-runtime.d.ts.map +1 -0
- package/dist/local/workspace-topology-runtime.js +396 -0
- package/dist/local/workspace-topology-runtime.js.map +1 -0
- package/dist/local/workspace-topology.d.ts +140 -0
- package/dist/local/workspace-topology.d.ts.map +1 -0
- package/dist/local/workspace-topology.js +359 -0
- package/dist/local/workspace-topology.js.map +1 -0
- package/dist/local/workspace-upstream-inspection.d.ts +60 -0
- package/dist/local/workspace-upstream-inspection.d.ts.map +1 -0
- package/dist/local/workspace-upstream-inspection.js +189 -0
- package/dist/local/workspace-upstream-inspection.js.map +1 -0
- package/dist/local/workspace-upstream-runtime.d.ts +91 -0
- package/dist/local/workspace-upstream-runtime.d.ts.map +1 -0
- package/dist/local/workspace-upstream-runtime.js +270 -0
- package/dist/local/workspace-upstream-runtime.js.map +1 -0
- package/dist/local/workspace-upstream-store.d.ts +51 -0
- package/dist/local/workspace-upstream-store.d.ts.map +1 -0
- package/dist/local/workspace-upstream-store.js +475 -0
- package/dist/local/workspace-upstream-store.js.map +1 -0
- package/dist/local/workspace-viewer-server.d.ts +136 -0
- package/dist/local/workspace-viewer-server.d.ts.map +1 -0
- package/dist/local/workspace-viewer-server.js +1097 -0
- package/dist/local/workspace-viewer-server.js.map +1 -0
- package/dist/local/workspace-viewer-snapshot.d.ts +49 -0
- package/dist/local/workspace-viewer-snapshot.d.ts.map +1 -0
- package/dist/local/workspace-viewer-snapshot.js +91 -0
- package/dist/local/workspace-viewer-snapshot.js.map +1 -0
- package/dist/local/worktree-projection.d.ts +76 -0
- package/dist/local/worktree-projection.d.ts.map +1 -0
- package/dist/local/worktree-projection.js +470 -0
- package/dist/local/worktree-projection.js.map +1 -0
- package/dist/mcp/client-identity.d.ts +8 -0
- package/dist/mcp/client-identity.d.ts.map +1 -0
- package/dist/mcp/client-identity.js +33 -0
- package/dist/mcp/client-identity.js.map +1 -0
- package/dist/mcp/graph-to-code.d.ts +53 -0
- package/dist/mcp/graph-to-code.d.ts.map +1 -0
- package/dist/mcp/graph-to-code.js +1624 -0
- package/dist/mcp/graph-to-code.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/stdio/graph-to-code.d.ts +3 -0
- package/dist/mcp/stdio/graph-to-code.d.ts.map +1 -0
- package/dist/mcp/stdio/graph-to-code.js +55 -0
- package/dist/mcp/stdio/graph-to-code.js.map +1 -0
- package/dist/mcp/stdio/worktree.d.ts +3 -0
- package/dist/mcp/stdio/worktree.d.ts.map +1 -0
- package/dist/mcp/stdio/worktree.js +67 -0
- package/dist/mcp/stdio/worktree.js.map +1 -0
- package/dist/mcp/worktree-claim-status.d.ts +162 -0
- package/dist/mcp/worktree-claim-status.d.ts.map +1 -0
- package/dist/mcp/worktree-claim-status.js +113 -0
- package/dist/mcp/worktree-claim-status.js.map +1 -0
- package/dist/mcp/worktree-dispatch.d.ts +13 -0
- package/dist/mcp/worktree-dispatch.d.ts.map +1 -0
- package/dist/mcp/worktree-dispatch.js +52 -0
- package/dist/mcp/worktree-dispatch.js.map +1 -0
- package/dist/mcp/worktree-errors.d.ts +15 -0
- package/dist/mcp/worktree-errors.d.ts.map +1 -0
- package/dist/mcp/worktree-errors.js +17 -0
- package/dist/mcp/worktree-errors.js.map +1 -0
- package/dist/mcp/worktree-health.d.ts +12 -0
- package/dist/mcp/worktree-health.d.ts.map +1 -0
- package/dist/mcp/worktree-health.js +32 -0
- package/dist/mcp/worktree-health.js.map +1 -0
- package/dist/mcp/worktree-results.d.ts +15 -0
- package/dist/mcp/worktree-results.d.ts.map +1 -0
- package/dist/mcp/worktree-results.js +12 -0
- package/dist/mcp/worktree-results.js.map +1 -0
- package/dist/mcp/worktree-task-context.d.ts +57 -0
- package/dist/mcp/worktree-task-context.d.ts.map +1 -0
- package/dist/mcp/worktree-task-context.js +45 -0
- package/dist/mcp/worktree-task-context.js.map +1 -0
- package/dist/mcp/worktree-tools.d.ts +2648 -0
- package/dist/mcp/worktree-tools.d.ts.map +1 -0
- package/dist/mcp/worktree-tools.js +192 -0
- package/dist/mcp/worktree-tools.js.map +1 -0
- package/dist/mcp/worktree.d.ts +33 -0
- package/dist/mcp/worktree.d.ts.map +1 -0
- package/dist/mcp/worktree.js +551 -0
- package/dist/mcp/worktree.js.map +1 -0
- package/dist/own-package.d.ts +13 -0
- package/dist/own-package.d.ts.map +1 -0
- package/dist/own-package.js +32 -0
- package/dist/own-package.js.map +1 -0
- package/dist/packages-browse.d.ts +107 -0
- package/dist/packages-browse.d.ts.map +1 -0
- package/dist/packages-browse.js +646 -0
- package/dist/packages-browse.js.map +1 -0
- package/dist/packages-cli.d.ts +8 -0
- package/dist/packages-cli.d.ts.map +1 -0
- package/dist/packages-cli.js +184 -0
- package/dist/packages-cli.js.map +1 -0
- package/dist/packages-uses.d.ts +46 -0
- package/dist/packages-uses.d.ts.map +1 -0
- package/dist/packages-uses.js +737 -0
- package/dist/packages-uses.js.map +1 -0
- package/dist/portable.d.ts +7 -0
- package/dist/portable.d.ts.map +1 -0
- package/dist/portable.js +14 -0
- package/dist/portable.js.map +1 -0
- package/dist/quiet-warnings.d.ts +3 -0
- package/dist/quiet-warnings.d.ts.map +1 -0
- package/dist/quiet-warnings.js +21 -0
- package/dist/quiet-warnings.js.map +1 -0
- package/dist/view-seam.d.ts +62 -0
- package/dist/view-seam.d.ts.map +1 -0
- package/dist/view-seam.js +70 -0
- package/dist/view-seam.js.map +1 -0
- package/generated/graph-packages/index.json +5 -0
- package/graph-packages.lock.json +4 -0
- package/package.json +81 -0
- package/viewer/assets/index-BZKGDARF.css +1 -0
- package/viewer/assets/index-DWu0CbZZ.js +272 -0
- package/viewer/index.html +13 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,1004 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import './quiet-warnings.js';
|
|
3
|
+
import { uploadHostedWorktreeMedia } from './local/media-upload.js';
|
|
4
|
+
import { trackPendingOperation, currentOperation } from './local/operation.js';
|
|
5
|
+
import { runCliOperation } from './cli-operation.js';
|
|
6
|
+
import { inspectSnapshotCommand } from './cli-snapshot.js';
|
|
7
|
+
import { branchApplyCommand, branchCommitCommand, pullRequestCommand } from './cli-branch-history.js';
|
|
8
|
+
import { branchesCommand, unboundBranchError } from './cli-branches.js';
|
|
9
|
+
import { argumentValue, argumentValues, hasArgument, requiredArgument, explicitGraphTarget, optionalIntegerArgument } from './cli-arguments.js';
|
|
10
|
+
import { isAutoMergePreflightClean, readAutoMergeScopeRecipes } from './local/aggregate-preflight.js';
|
|
11
|
+
import { parseGraphFileSaveMode, runCliMetaCommand, viewHelpRequested, SDLC_CLI_USAGE } from './cli-help.js';
|
|
12
|
+
import { runCliDeploy } from './cli-deploy.js';
|
|
13
|
+
import { runCliLogin } from './cli-login.js';
|
|
14
|
+
import { loadViewModule, viewMissing } from './view-seam.js';
|
|
15
|
+
import { runPackagesCommand } from './packages-cli.js';
|
|
16
|
+
import { readFile } from 'node:fs/promises';
|
|
17
|
+
import { basename, extname } from 'node:path';
|
|
18
|
+
import { portable_graph_schema } from '@software-dlc/graph/schema';
|
|
19
|
+
import { compareGraphPayloads, compareGraphSubgraphs, compareGraphWorkspace, ensureBranchWorktree } from '@software-dlc/graph/client';
|
|
20
|
+
import { runAllowMcpCommand } from './local/allow-mcp.js';
|
|
21
|
+
import { runOrgCommand } from './cli-org.js';
|
|
22
|
+
import { sdlcPlatformFetch } from './local/api-client.js';
|
|
23
|
+
import { readRepositoryConfig, rebindRepositoryConfig } from './local/config.js';
|
|
24
|
+
import { initializeEnvironmentProfile, resolveActiveEnvironmentContext, resolveEnvironmentClient } from './local/environment-context.js';
|
|
25
|
+
import { addTrustedConnection, getTrustedConnection, listEnvironmentProfiles, listTrustedConnections, migrateLegacyLocalSidecar, normalizeEnvironmentProfile, normalizeServiceOrigin, readActiveEnvironmentSelector, readEnvironmentMetadata, readEnvironmentSwitchJournal } from './local/environment-sidecar.js';
|
|
26
|
+
import { recoverEnvironmentSwitch, switchEnvironment, withActiveEnvironmentOperation } from './local/environment-switch.js';
|
|
27
|
+
import { excludeEnvironmentPaths } from './local/environment-exclude.js';
|
|
28
|
+
import { discoverGitWorktree } from './local/git.js';
|
|
29
|
+
import { checkoutWorktreeProjection, adoptWorktreeProjection, getManagedProjectionStatus, requireManagedProjectionCompleteness, refreshWorktreeProjection, removeManagedProjectionEntity, saveManagedProjection, syncManagedProjection } from './local/worktree-projection.js';
|
|
30
|
+
import { composeGraphProjection } from './local/projection.js';
|
|
31
|
+
import { rebuildCommand } from './cli-rebuild.js';
|
|
32
|
+
import { resetCommand } from './cli-reset.js';
|
|
33
|
+
import { resolveLocalScopeImpact } from './local/scope-impact.js';
|
|
34
|
+
import { recoverManagedProjectionFromStalePending } from './local/pending-recovery.js';
|
|
35
|
+
import { LocalSdlcStore } from './local/store.js';
|
|
36
|
+
import { TreeSaveStillFinalizingError } from './local/tree-save.js';
|
|
37
|
+
import { prepareLocalStateDirectory } from './local/state-directory.js';
|
|
38
|
+
import { saveLiveWorktreeChange, syncPendingWorktreeChanges } from './local/sync.js';
|
|
39
|
+
import { isLocalWorkspaceCommand, runLocalWorkspaceCommand } from './local/workspace-cli.js';
|
|
40
|
+
function parsePortableGraph(value) {
|
|
41
|
+
let parsed;
|
|
42
|
+
try {
|
|
43
|
+
parsed = JSON.parse(value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
47
|
+
throw new Error(`Graph file contains invalid JSON: ${message}`);
|
|
48
|
+
}
|
|
49
|
+
return portable_graph_schema.parse(parsed);
|
|
50
|
+
}
|
|
51
|
+
async function readPortableGraphFile(path) {
|
|
52
|
+
return parsePortableGraph(await readFile(path, 'utf8'));
|
|
53
|
+
}
|
|
54
|
+
function resolveClient(args, environment) {
|
|
55
|
+
const client = resolveEnvironmentClient({
|
|
56
|
+
context: environment,
|
|
57
|
+
fetch_impl: sdlcPlatformFetch()
|
|
58
|
+
});
|
|
59
|
+
const explicit_base_url = argumentValue(args, '--base-url');
|
|
60
|
+
if (explicit_base_url &&
|
|
61
|
+
normalizeServiceOrigin(explicit_base_url) !== client.base_url) {
|
|
62
|
+
throw new Error('--base-url cannot select a different origin from the active trusted connection.');
|
|
63
|
+
}
|
|
64
|
+
return client;
|
|
65
|
+
}
|
|
66
|
+
function printJson(value) {
|
|
67
|
+
console.log(JSON.stringify(value, null, 2));
|
|
68
|
+
}
|
|
69
|
+
function isMissingPathError(error) {
|
|
70
|
+
return (typeof error === 'object' &&
|
|
71
|
+
error !== null &&
|
|
72
|
+
'code' in error &&
|
|
73
|
+
error.code === 'ENOENT');
|
|
74
|
+
}
|
|
75
|
+
function trustedConnectionSummary(connection) {
|
|
76
|
+
return {
|
|
77
|
+
connection_id: connection.connection_id,
|
|
78
|
+
name: connection.name,
|
|
79
|
+
base_url: connection.base_url,
|
|
80
|
+
origin_fingerprint: connection.origin_fingerprint,
|
|
81
|
+
credential_env: connection.credential_env
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
async function runConnectionCommand(input) {
|
|
85
|
+
if (input.subcommand === 'add') {
|
|
86
|
+
const name = input.args.find((argument) => !argument.startsWith('--'));
|
|
87
|
+
if (!name) {
|
|
88
|
+
throw new Error('Usage: sdlc connection add <name> --url <origin> --credential-env <ENV_NAME>');
|
|
89
|
+
}
|
|
90
|
+
const connection = await addTrustedConnection({
|
|
91
|
+
name,
|
|
92
|
+
base_url: requiredArgument(input.args, '--url'),
|
|
93
|
+
credential_env: requiredArgument(input.args, '--credential-env')
|
|
94
|
+
});
|
|
95
|
+
printJson({ connection: trustedConnectionSummary(connection) });
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (input.subcommand === 'list') {
|
|
99
|
+
printJson({
|
|
100
|
+
connections: (await listTrustedConnections()).map(trustedConnectionSummary)
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
throw new Error('Usage: sdlc connection add <name> --url <origin> --credential-env <ENV_NAME> | sdlc connection list');
|
|
105
|
+
}
|
|
106
|
+
async function runEnvironmentCommand(input) {
|
|
107
|
+
if (input.subcommand === 'use' || input.subcommand === 'recover') {
|
|
108
|
+
await runEnvironmentCommandUnlocked(input);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
await withActiveEnvironmentOperation({
|
|
112
|
+
git: input.git,
|
|
113
|
+
operation: `cli:env-${input.subcommand ?? 'unknown'}`,
|
|
114
|
+
run: () => runEnvironmentCommandUnlocked(input)
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
async function runEnvironmentCommandUnlocked(input) {
|
|
118
|
+
if (input.subcommand === 'add') {
|
|
119
|
+
const profile_argument = input.args.find((argument) => !argument.startsWith('--'));
|
|
120
|
+
if (!profile_argument) {
|
|
121
|
+
throw new Error('Usage: sdlc env add <profile> --connection <name> --repository-id <uuid>');
|
|
122
|
+
}
|
|
123
|
+
const profile = normalizeEnvironmentProfile(profile_argument);
|
|
124
|
+
const connection = await getTrustedConnection({
|
|
125
|
+
name_or_id: requiredArgument(input.args, '--connection')
|
|
126
|
+
});
|
|
127
|
+
printJson({
|
|
128
|
+
environment: await initializeEnvironmentProfile({
|
|
129
|
+
git: input.git,
|
|
130
|
+
profile,
|
|
131
|
+
repository_id: requiredArgument(input.args, '--repository-id'),
|
|
132
|
+
connection
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (input.subcommand === 'migrate') {
|
|
138
|
+
if (await readEnvironmentSwitchJournal(input.git.repository_root)) {
|
|
139
|
+
throw new Error('Complete or recover the pending environment switch before migration.');
|
|
140
|
+
}
|
|
141
|
+
const connection = await getTrustedConnection({
|
|
142
|
+
name_or_id: requiredArgument(input.args, '--connection')
|
|
143
|
+
});
|
|
144
|
+
await readRepositoryConfig(input.git.repository_root);
|
|
145
|
+
if (process.env.SDLC_STATE_DIR &&
|
|
146
|
+
process.env.SDLC_STATE_PROFILE !== 'local') {
|
|
147
|
+
throw new Error('Migrating legacy external state requires SDLC_STATE_PROFILE=local.');
|
|
148
|
+
}
|
|
149
|
+
const legacy_state = await prepareLocalStateDirectory({
|
|
150
|
+
repository_root: input.git.repository_root,
|
|
151
|
+
git_dir: input.git.git_dir,
|
|
152
|
+
override: process.env.SDLC_STATE_DIR
|
|
153
|
+
});
|
|
154
|
+
const legacy_store = await LocalSdlcStore.open(legacy_state.state_dir);
|
|
155
|
+
try {
|
|
156
|
+
if (legacy_store.hasPendingChanges()) {
|
|
157
|
+
throw new Error('Legacy local state has pending save/sync work and cannot be migrated.');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
legacy_store.close();
|
|
162
|
+
}
|
|
163
|
+
const excluded = await excludeEnvironmentPaths({
|
|
164
|
+
repository_root: input.git.repository_root,
|
|
165
|
+
git_common_dir: input.git.git_common_dir,
|
|
166
|
+
profile: 'local'
|
|
167
|
+
});
|
|
168
|
+
printJson({
|
|
169
|
+
migration: await migrateLegacyLocalSidecar({
|
|
170
|
+
repository_root: input.git.repository_root,
|
|
171
|
+
connection
|
|
172
|
+
}),
|
|
173
|
+
excluded
|
|
174
|
+
});
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (input.subcommand === 'use') {
|
|
178
|
+
const profile_argument = input.args.find((argument) => !argument.startsWith('--'));
|
|
179
|
+
if (!profile_argument) {
|
|
180
|
+
throw new Error('Usage: sdlc env use <profile>');
|
|
181
|
+
}
|
|
182
|
+
const target_profile = normalizeEnvironmentProfile(profile_argument);
|
|
183
|
+
// Also covers repositories set up before init excluded these paths.
|
|
184
|
+
const excluded = await excludeEnvironmentPaths({
|
|
185
|
+
repository_root: input.git.repository_root,
|
|
186
|
+
git_common_dir: input.git.git_common_dir,
|
|
187
|
+
profile: target_profile
|
|
188
|
+
});
|
|
189
|
+
printJson({
|
|
190
|
+
environment: await switchEnvironment({
|
|
191
|
+
git: input.git,
|
|
192
|
+
target_profile
|
|
193
|
+
}),
|
|
194
|
+
excluded
|
|
195
|
+
});
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (input.subcommand === 'recover') {
|
|
199
|
+
printJson({
|
|
200
|
+
environment: await recoverEnvironmentSwitch({ git: input.git })
|
|
201
|
+
});
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (input.subcommand === 'current') {
|
|
205
|
+
const environment = await resolveActiveEnvironmentContext({
|
|
206
|
+
git: input.git,
|
|
207
|
+
state_override: process.env.SDLC_STATE_DIR
|
|
208
|
+
});
|
|
209
|
+
printJson({
|
|
210
|
+
profile: environment.profile,
|
|
211
|
+
sidecar_dir: environment.sidecar_dir,
|
|
212
|
+
repository_id: environment.config.repository_id,
|
|
213
|
+
connection: environment.connection
|
|
214
|
+
? trustedConnectionSummary(environment.connection)
|
|
215
|
+
: null,
|
|
216
|
+
legacy_migration_required: environment.legacy_migration_required
|
|
217
|
+
});
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (input.subcommand === 'list') {
|
|
221
|
+
const selector = await readActiveEnvironmentSelector(input.git.repository_root);
|
|
222
|
+
const profiles = await Promise.all((await listEnvironmentProfiles(input.git.repository_root)).map(async ({ profile, sidecar_dir }) => {
|
|
223
|
+
try {
|
|
224
|
+
const metadata = await readEnvironmentMetadata(sidecar_dir);
|
|
225
|
+
const connection = await getTrustedConnection({
|
|
226
|
+
name_or_id: metadata.connection_id
|
|
227
|
+
});
|
|
228
|
+
const config = await readRepositoryConfig(input.git.repository_root, sidecar_dir);
|
|
229
|
+
return {
|
|
230
|
+
profile,
|
|
231
|
+
active: selector?.profile === profile,
|
|
232
|
+
sidecar_dir,
|
|
233
|
+
repository_id: config.repository_id,
|
|
234
|
+
connection: trustedConnectionSummary(connection),
|
|
235
|
+
legacy_migration_required: false
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
if (profile !== 'live' || selector || !isMissingPathError(error)) {
|
|
240
|
+
throw error;
|
|
241
|
+
}
|
|
242
|
+
const config = await readRepositoryConfig(input.git.repository_root, sidecar_dir);
|
|
243
|
+
return {
|
|
244
|
+
profile: 'local',
|
|
245
|
+
active: true,
|
|
246
|
+
sidecar_dir,
|
|
247
|
+
repository_id: config.repository_id,
|
|
248
|
+
connection: null,
|
|
249
|
+
legacy_migration_required: true
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}));
|
|
253
|
+
printJson({
|
|
254
|
+
active_profile: selector?.profile ??
|
|
255
|
+
(profiles.some((profile) => profile.legacy_migration_required)
|
|
256
|
+
? 'local'
|
|
257
|
+
: null),
|
|
258
|
+
profiles
|
|
259
|
+
});
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
throw new Error('Usage: sdlc env add <profile> --connection <name> --repository-id <uuid> | env migrate --connection <name> | env use <profile> | env recover | env current | env list');
|
|
263
|
+
}
|
|
264
|
+
function imageMimeFromPath(path) {
|
|
265
|
+
switch (extname(path).toLowerCase()) {
|
|
266
|
+
case '.png':
|
|
267
|
+
return 'image/png';
|
|
268
|
+
case '.jpg':
|
|
269
|
+
case '.jpeg':
|
|
270
|
+
return 'image/jpeg';
|
|
271
|
+
case '.gif':
|
|
272
|
+
return 'image/gif';
|
|
273
|
+
case '.webp':
|
|
274
|
+
return 'image/webp';
|
|
275
|
+
default:
|
|
276
|
+
throw new Error('Media upload supports PNG, JPEG, GIF, and WebP files.');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function requireBinding(binding) {
|
|
280
|
+
if (!binding)
|
|
281
|
+
throw unboundBranchError();
|
|
282
|
+
return binding;
|
|
283
|
+
}
|
|
284
|
+
async function main() {
|
|
285
|
+
const view_help = viewHelpRequested(process.argv.slice(2)) ? await loadViewModule() : null;
|
|
286
|
+
if (runCliMetaCommand(process.argv.slice(2), { viewUsage: view_help?.SDLC_VIEW_USAGE })) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (await runCliLogin(process.argv.slice(2))) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const deploy_exit = await runCliDeploy(process.argv.slice(2));
|
|
293
|
+
if (deploy_exit !== null) {
|
|
294
|
+
process.exitCode = deploy_exit;
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const [, , command, subcommand, ...rest] = process.argv;
|
|
298
|
+
if (command === 'view') {
|
|
299
|
+
// The view's code ships with @software-dlc/agents, not the public CLI (view-seam.ts).
|
|
300
|
+
const view = await loadViewModule();
|
|
301
|
+
process.exitCode = view ? await view.runViewCommand(process.argv.slice(3)) : viewMissing(process.cwd());
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (command === 'packages') {
|
|
305
|
+
process.exitCode = await runPackagesCommand(process.argv.slice(3));
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (command === 'allow-mcp') {
|
|
309
|
+
process.exitCode = await runAllowMcpCommand(process.argv.slice(3));
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (command === 'org') {
|
|
313
|
+
process.exitCode = await runOrgCommand(process.argv.slice(3));
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if (isLocalWorkspaceCommand(command, subcommand)) {
|
|
317
|
+
await runLocalWorkspaceCommand({
|
|
318
|
+
command,
|
|
319
|
+
subcommand,
|
|
320
|
+
args: command === 'viewer'
|
|
321
|
+
? [subcommand, ...rest].filter((value) => typeof value === 'string')
|
|
322
|
+
: rest
|
|
323
|
+
});
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const command_args = [subcommand, ...rest].filter((value) => typeof value === 'string');
|
|
327
|
+
if (command === 'connection') {
|
|
328
|
+
await runConnectionCommand({ subcommand, args: rest });
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const git = await discoverGitWorktree();
|
|
332
|
+
if (command === 'env') {
|
|
333
|
+
await runEnvironmentCommand({ git, subcommand, args: rest });
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (command === 'init') {
|
|
337
|
+
await withActiveEnvironmentOperation({
|
|
338
|
+
git,
|
|
339
|
+
operation: 'cli:init',
|
|
340
|
+
run: async () => {
|
|
341
|
+
const profile = normalizeEnvironmentProfile(argumentValue(command_args, '--profile') ?? 'live');
|
|
342
|
+
const connection = await getTrustedConnection({
|
|
343
|
+
name_or_id: requiredArgument(command_args, '--connection')
|
|
344
|
+
});
|
|
345
|
+
const environment = await initializeEnvironmentProfile({
|
|
346
|
+
git,
|
|
347
|
+
profile,
|
|
348
|
+
repository_id: requiredArgument(command_args, '--repository-id'),
|
|
349
|
+
connection
|
|
350
|
+
});
|
|
351
|
+
printJson({ initialized: true, environment });
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
await withActiveEnvironmentOperation({
|
|
357
|
+
git,
|
|
358
|
+
operation: `cli:${command ?? 'unknown'}`,
|
|
359
|
+
run: async () => {
|
|
360
|
+
const environment = await resolveActiveEnvironmentContext({
|
|
361
|
+
git,
|
|
362
|
+
state_override: process.env.SDLC_STATE_DIR
|
|
363
|
+
});
|
|
364
|
+
const { config } = environment;
|
|
365
|
+
if (command === 'snapshot') {
|
|
366
|
+
printJson(await inspectSnapshotCommand({
|
|
367
|
+
args: command_args,
|
|
368
|
+
client: resolveClient(command_args, environment),
|
|
369
|
+
project_id: config.repository_id
|
|
370
|
+
}));
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
if (command === 'pr') {
|
|
374
|
+
const result = await pullRequestCommand({
|
|
375
|
+
args: command_args,
|
|
376
|
+
client: resolveClient([], environment),
|
|
377
|
+
project_id: config.repository_id
|
|
378
|
+
});
|
|
379
|
+
printJson(result.output);
|
|
380
|
+
if (result.exit_code !== 0)
|
|
381
|
+
process.exitCode = result.exit_code;
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
const state_resolution = environment.state;
|
|
385
|
+
const { state_dir } = state_resolution;
|
|
386
|
+
console.error(`[sdlc] ${environment.profile} state (${state_resolution.source}): ${state_dir}`);
|
|
387
|
+
if (state_resolution.warning) {
|
|
388
|
+
console.error(`[sdlc] warning: ${state_resolution.warning}`);
|
|
389
|
+
}
|
|
390
|
+
const store = await LocalSdlcStore.open(state_dir);
|
|
391
|
+
try {
|
|
392
|
+
const branch_binding = git.ref ? store.getBranchBinding(git.ref) : null;
|
|
393
|
+
if (command === 'reconnect') {
|
|
394
|
+
if (!git.ref) {
|
|
395
|
+
throw new Error('Detached HEAD cannot reconnect to an SDLC branch.');
|
|
396
|
+
}
|
|
397
|
+
if (!hasArgument(command_args, '--adopt-projection')) {
|
|
398
|
+
throw new Error('Reconnect requires --adopt-projection to preserve and explicitly adopt the existing sdlc/ graph.');
|
|
399
|
+
}
|
|
400
|
+
const expected_project_id = requiredArgument(command_args, '--expected-project-id');
|
|
401
|
+
const project_id = requiredArgument(command_args, '--project-id');
|
|
402
|
+
const branch_id = requiredArgument(command_args, '--branch-id');
|
|
403
|
+
if (config.repository_id !== expected_project_id &&
|
|
404
|
+
config.repository_id !== project_id) {
|
|
405
|
+
throw new Error(`SDLC project association changed: expected ${expected_project_id} or ${project_id}, found ${config.repository_id}.`);
|
|
406
|
+
}
|
|
407
|
+
const client = resolveClient(command_args, environment);
|
|
408
|
+
const ensured = await ensureBranchWorktree(client, branch_id);
|
|
409
|
+
if (ensured.branch_id !== branch_id ||
|
|
410
|
+
ensured.project_id !== project_id) {
|
|
411
|
+
throw new Error('Initialized worktree does not belong to the requested project and branch.');
|
|
412
|
+
}
|
|
413
|
+
const status = await adoptWorktreeProjection({
|
|
414
|
+
store,
|
|
415
|
+
client,
|
|
416
|
+
worktree_id: ensured.worktree.id,
|
|
417
|
+
repository_root: git.repository_root,
|
|
418
|
+
projection_dir: argumentValue(command_args, '--work-dir') ?? undefined
|
|
419
|
+
});
|
|
420
|
+
const association = await rebindRepositoryConfig({
|
|
421
|
+
repository_root: git.repository_root,
|
|
422
|
+
expected_repository_id: expected_project_id,
|
|
423
|
+
repository_id: project_id,
|
|
424
|
+
sidecar_dir: environment.sidecar_dir
|
|
425
|
+
});
|
|
426
|
+
const binding = store.bindBranch({
|
|
427
|
+
source_ref: git.ref,
|
|
428
|
+
branch_id,
|
|
429
|
+
worktree_id: ensured.worktree.id
|
|
430
|
+
});
|
|
431
|
+
printJson({
|
|
432
|
+
reconnected: true,
|
|
433
|
+
association,
|
|
434
|
+
binding,
|
|
435
|
+
worktree: ensured.worktree,
|
|
436
|
+
status
|
|
437
|
+
});
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (command === 'context') {
|
|
441
|
+
const projection_state = branch_binding
|
|
442
|
+
? store.getProjectionState(branch_binding.worktree_id)
|
|
443
|
+
: null;
|
|
444
|
+
printJson({
|
|
445
|
+
source: git,
|
|
446
|
+
sdlc: {
|
|
447
|
+
environment_profile: environment.profile,
|
|
448
|
+
environment_sidecar_dir: environment.sidecar_dir,
|
|
449
|
+
environment_connection: environment.connection
|
|
450
|
+
? trustedConnectionSummary(environment.connection)
|
|
451
|
+
: null,
|
|
452
|
+
legacy_migration_required: environment.legacy_migration_required,
|
|
453
|
+
repository_id: config.repository_id,
|
|
454
|
+
state_dir,
|
|
455
|
+
state_dir_source: state_resolution.source,
|
|
456
|
+
state_warning: state_resolution.warning,
|
|
457
|
+
branch_binding,
|
|
458
|
+
projection_state
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
if (command === 'branches') {
|
|
464
|
+
printJson(await branchesCommand({
|
|
465
|
+
args: command_args,
|
|
466
|
+
client: resolveClient([], environment),
|
|
467
|
+
project_id: config.repository_id,
|
|
468
|
+
bound_branch_id: branch_binding?.branch_id ?? null,
|
|
469
|
+
source_ref: git.ref
|
|
470
|
+
}));
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
if (command === 'branch' && subcommand === 'bind') {
|
|
474
|
+
if (!git.ref) {
|
|
475
|
+
throw new Error('Detached HEAD cannot be bound to an SDLC branch.');
|
|
476
|
+
}
|
|
477
|
+
const branch_id = requiredArgument(rest, '--branch-id');
|
|
478
|
+
const requested_worktree_id = argumentValue(rest, '--worktree-id');
|
|
479
|
+
let worktree_id = requested_worktree_id;
|
|
480
|
+
let worktree = null;
|
|
481
|
+
if (!worktree_id) {
|
|
482
|
+
const ensured = await ensureBranchWorktree(resolveClient(command_args, environment), branch_id);
|
|
483
|
+
if (ensured.branch_id !== branch_id ||
|
|
484
|
+
ensured.project_id !== config.repository_id) {
|
|
485
|
+
throw new Error('Initialized worktree does not belong to the active project and requested branch.');
|
|
486
|
+
}
|
|
487
|
+
worktree_id = ensured.worktree.id;
|
|
488
|
+
worktree = ensured.worktree;
|
|
489
|
+
}
|
|
490
|
+
const binding = store.bindBranch({
|
|
491
|
+
source_ref: git.ref,
|
|
492
|
+
branch_id,
|
|
493
|
+
worktree_id
|
|
494
|
+
});
|
|
495
|
+
printJson({ binding, worktree });
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
const local_workspace = branch_binding
|
|
499
|
+
? {
|
|
500
|
+
worktree_id: branch_binding.worktree_id,
|
|
501
|
+
revision: store.getActiveSession(branch_binding.worktree_id)
|
|
502
|
+
?.last_acknowledged_revision ?? null
|
|
503
|
+
}
|
|
504
|
+
: null;
|
|
505
|
+
if (command === 'branch' && subcommand === 'apply') {
|
|
506
|
+
const result = await branchApplyCommand({
|
|
507
|
+
args: rest,
|
|
508
|
+
client: resolveClient([], environment),
|
|
509
|
+
bound_branch_id: branch_binding?.branch_id ?? null,
|
|
510
|
+
project_id: config.repository_id,
|
|
511
|
+
local_workspace
|
|
512
|
+
});
|
|
513
|
+
printJson(result.output);
|
|
514
|
+
if (result.exit_code !== 0)
|
|
515
|
+
process.exitCode = result.exit_code;
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
if (command === 'branch' && subcommand === 'commit') {
|
|
519
|
+
const result = await branchCommitCommand({
|
|
520
|
+
args: rest,
|
|
521
|
+
client: resolveClient([], environment),
|
|
522
|
+
bound_branch_id: branch_binding?.branch_id ?? null,
|
|
523
|
+
project_id: config.repository_id,
|
|
524
|
+
local_workspace
|
|
525
|
+
});
|
|
526
|
+
printJson(result.output);
|
|
527
|
+
if (result.exit_code !== 0)
|
|
528
|
+
process.exitCode = result.exit_code;
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
if (command === 'session' && subcommand === 'start') {
|
|
532
|
+
const binding = requireBinding(branch_binding);
|
|
533
|
+
const requested_worktree_id = argumentValue(rest, '--worktree-id');
|
|
534
|
+
if (requested_worktree_id &&
|
|
535
|
+
requested_worktree_id !== binding.worktree_id) {
|
|
536
|
+
throw new Error('Requested worktree does not match the current branch binding.');
|
|
537
|
+
}
|
|
538
|
+
const revision = Number(requiredArgument(rest, '--revision'));
|
|
539
|
+
const session = store.startSession({
|
|
540
|
+
worktree_id: binding.worktree_id,
|
|
541
|
+
revision
|
|
542
|
+
});
|
|
543
|
+
printJson({ session });
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
if (command === 'checkout' || command === 'refresh') {
|
|
547
|
+
if (!git.ref) {
|
|
548
|
+
throw new Error('Detached HEAD is read-only for SDLC materialization.');
|
|
549
|
+
}
|
|
550
|
+
const binding = requireBinding(branch_binding);
|
|
551
|
+
const operation = command === 'checkout'
|
|
552
|
+
? checkoutWorktreeProjection
|
|
553
|
+
: refreshWorktreeProjection;
|
|
554
|
+
const status = await operation({
|
|
555
|
+
store,
|
|
556
|
+
client: resolveClient(command_args, environment),
|
|
557
|
+
worktree_id: binding.worktree_id,
|
|
558
|
+
repository_root: git.repository_root,
|
|
559
|
+
projection_dir: argumentValue(command_args, '--work-dir') ?? undefined,
|
|
560
|
+
force: hasArgument(command_args, '--force'),
|
|
561
|
+
upgrade_evidence: hasArgument(command_args, '--upgrade-evidence')
|
|
562
|
+
});
|
|
563
|
+
printJson({ operation: command, status });
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (command === 'status' ||
|
|
567
|
+
command === 'diff' ||
|
|
568
|
+
command === 'validate') {
|
|
569
|
+
const binding = branch_binding;
|
|
570
|
+
const requested_worktree_id = argumentValue(command_args, '--worktree-id');
|
|
571
|
+
const worktree_id = requested_worktree_id ?? binding?.worktree_id ?? null;
|
|
572
|
+
const projection_status = worktree_id
|
|
573
|
+
? await getManagedProjectionStatus({ store, worktree_id })
|
|
574
|
+
: null;
|
|
575
|
+
if ((command === 'diff' || command === 'validate') &&
|
|
576
|
+
!projection_status?.materialized) {
|
|
577
|
+
throw new Error('No managed projection exists. Run sdlc checkout first.');
|
|
578
|
+
}
|
|
579
|
+
if (command === 'diff') {
|
|
580
|
+
printJson({ worktree_id, diff: projection_status?.diff });
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
if (command === 'validate') {
|
|
584
|
+
const missing_unrecorded = projection_status?.diff?.missing_unrecorded ?? [];
|
|
585
|
+
const valid = projection_status?.validation?.is_valid === true &&
|
|
586
|
+
missing_unrecorded.length === 0;
|
|
587
|
+
printJson({
|
|
588
|
+
worktree_id,
|
|
589
|
+
valid,
|
|
590
|
+
validation: projection_status?.validation,
|
|
591
|
+
missing_unrecorded
|
|
592
|
+
});
|
|
593
|
+
if (!valid)
|
|
594
|
+
process.exitCode = 2;
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
printJson({
|
|
598
|
+
environment_profile: environment.profile,
|
|
599
|
+
repository_id: config.repository_id,
|
|
600
|
+
source_ref: git.ref,
|
|
601
|
+
source_head: git.head,
|
|
602
|
+
source_dirty: git.is_dirty,
|
|
603
|
+
state_dir,
|
|
604
|
+
branch_binding,
|
|
605
|
+
active_session: worktree_id
|
|
606
|
+
? store.getActiveSession(worktree_id)
|
|
607
|
+
: null,
|
|
608
|
+
projection: projection_status
|
|
609
|
+
});
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
if (command === 'compare') {
|
|
613
|
+
const binding = requireBinding(branch_binding);
|
|
614
|
+
const projection_state = store.getProjectionState(binding.worktree_id);
|
|
615
|
+
if (!projection_state) {
|
|
616
|
+
throw new Error('No managed projection exists. Run sdlc checkout first.');
|
|
617
|
+
}
|
|
618
|
+
const composed = await composeGraphProjection(projection_state.projection_dir);
|
|
619
|
+
const options = {
|
|
620
|
+
scope_recipes: await readAutoMergeScopeRecipes(argumentValue(command_args, '--scope-recipes-file')),
|
|
621
|
+
include_entities: hasArgument(command_args, '--include-entities'),
|
|
622
|
+
include_fields: !hasArgument(command_args, '--no-fields'),
|
|
623
|
+
entity_ids: command_args
|
|
624
|
+
.filter((value) => value.startsWith('--entity-id='))
|
|
625
|
+
.map((value) => value.slice('--entity-id='.length))
|
|
626
|
+
};
|
|
627
|
+
const target_graph_file = argumentValue(command_args, '--target-graph-file');
|
|
628
|
+
const source_graph_file = argumentValue(command_args, '--source-graph-file');
|
|
629
|
+
const merge_graph_file = argumentValue(command_args, '--merge-base-graph-file');
|
|
630
|
+
if (source_graph_file && !target_graph_file) {
|
|
631
|
+
throw new Error('--source-graph-file requires --target-graph-file. Without an explicit target, compare uses the managed projection against the bound saved branch.');
|
|
632
|
+
}
|
|
633
|
+
const response = target_graph_file
|
|
634
|
+
? await compareGraphPayloads(resolveClient(command_args, environment), {
|
|
635
|
+
target_graph: await readPortableGraphFile(target_graph_file),
|
|
636
|
+
source_graph: source_graph_file
|
|
637
|
+
? await readPortableGraphFile(source_graph_file)
|
|
638
|
+
: composed.graph,
|
|
639
|
+
merge_graph: merge_graph_file
|
|
640
|
+
? await readPortableGraphFile(merge_graph_file)
|
|
641
|
+
: undefined,
|
|
642
|
+
labels: {
|
|
643
|
+
target: 'Explicit Target Graph',
|
|
644
|
+
source: source_graph_file
|
|
645
|
+
? 'Explicit Source Graph'
|
|
646
|
+
: 'Managed Local Projection',
|
|
647
|
+
merge: merge_graph_file
|
|
648
|
+
? 'Explicit Merge Base Graph'
|
|
649
|
+
: 'Target Fallback'
|
|
650
|
+
},
|
|
651
|
+
options
|
|
652
|
+
})
|
|
653
|
+
: await compareGraphWorkspace(resolveClient(command_args, environment), {
|
|
654
|
+
branch_id: binding.branch_id,
|
|
655
|
+
source: 'local_graph',
|
|
656
|
+
graph: composed.graph,
|
|
657
|
+
options
|
|
658
|
+
});
|
|
659
|
+
printJson(response);
|
|
660
|
+
if (hasArgument(command_args, '--require-auto-merge-clean') &&
|
|
661
|
+
!isAutoMergePreflightClean(response.auto_merge_simulation)) {
|
|
662
|
+
process.exitCode = 2;
|
|
663
|
+
}
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
if (command === 'scope-impact') {
|
|
667
|
+
const binding = requireBinding(branch_binding);
|
|
668
|
+
const projection_state = store.getProjectionState(binding.worktree_id);
|
|
669
|
+
if (!projection_state) {
|
|
670
|
+
throw new Error('No managed projection exists. Run sdlc checkout first.');
|
|
671
|
+
}
|
|
672
|
+
const impact_node_id = argumentValue(command_args, '--impact-node-id');
|
|
673
|
+
const impact_edge_id = argumentValue(command_args, '--impact-edge-id');
|
|
674
|
+
if (Boolean(impact_node_id) === Boolean(impact_edge_id)) {
|
|
675
|
+
throw new Error('Provide exactly one --impact-node-id or --impact-edge-id.');
|
|
676
|
+
}
|
|
677
|
+
await requireManagedProjectionCompleteness({
|
|
678
|
+
store,
|
|
679
|
+
worktree_id: binding.worktree_id
|
|
680
|
+
});
|
|
681
|
+
const composed = await composeGraphProjection(projection_state.projection_dir);
|
|
682
|
+
const result = resolveLocalScopeImpact({
|
|
683
|
+
graph: composed.graph,
|
|
684
|
+
selectors: {
|
|
685
|
+
path_ids: argumentValues(command_args, '--path-id'),
|
|
686
|
+
path_tree_root_ids: argumentValues(command_args, '--path-tree-root-id'),
|
|
687
|
+
node_ids: argumentValues(command_args, '--node-id'),
|
|
688
|
+
edge_ids: argumentValues(command_args, '--edge-id')
|
|
689
|
+
},
|
|
690
|
+
entity: impact_node_id
|
|
691
|
+
? { entity_kind: 'node', entity_id: impact_node_id }
|
|
692
|
+
: {
|
|
693
|
+
entity_kind: 'edge',
|
|
694
|
+
entity_id: impact_edge_id
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
if (result.status === 'invalid_projection') {
|
|
698
|
+
printJson({
|
|
699
|
+
operation: 'scope-impact',
|
|
700
|
+
source: 'managed_local_projection',
|
|
701
|
+
status: 'invalid_projection',
|
|
702
|
+
validation: result.validation
|
|
703
|
+
});
|
|
704
|
+
process.exitCode = 2;
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
if (result.status === 'resolution_failed') {
|
|
708
|
+
printJson({
|
|
709
|
+
operation: 'scope-impact',
|
|
710
|
+
source: 'managed_local_projection',
|
|
711
|
+
resolution: result.resolution
|
|
712
|
+
});
|
|
713
|
+
process.exitCode = 2;
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
printJson({
|
|
717
|
+
operation: 'scope-impact',
|
|
718
|
+
source: 'managed_local_projection',
|
|
719
|
+
recipe_hash: result.recipe_hash,
|
|
720
|
+
membership_profile_id: result.membership_profile_id,
|
|
721
|
+
membership_profile_version: result.membership_profile_version,
|
|
722
|
+
impact: result.impact
|
|
723
|
+
});
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
if (command === 'compare-subgraph') {
|
|
727
|
+
const binding = requireBinding(branch_binding);
|
|
728
|
+
const projection_state = store.getProjectionState(binding.worktree_id);
|
|
729
|
+
const session = store.getActiveSession(binding.worktree_id);
|
|
730
|
+
if (!projection_state || !session) {
|
|
731
|
+
throw new Error('A managed projection and active session are required. Run sdlc checkout first.');
|
|
732
|
+
}
|
|
733
|
+
if (!session.last_acknowledged_sync_root_hash) {
|
|
734
|
+
throw new Error('The active session has no acknowledged sync root. Run sdlc sync or checkout first.');
|
|
735
|
+
}
|
|
736
|
+
const seed_entity_ids = argumentValues(command_args, '--seed-entity-id');
|
|
737
|
+
if (seed_entity_ids.length === 0) {
|
|
738
|
+
throw new Error('Provide at least one --seed-entity-id <node-or-edge-or-path-id>.');
|
|
739
|
+
}
|
|
740
|
+
const target = explicitGraphTarget(command_args, 'target') ?? {
|
|
741
|
+
branch_id: binding.branch_id
|
|
742
|
+
};
|
|
743
|
+
const source = explicitGraphTarget(command_args, 'source') ?? {
|
|
744
|
+
worktree_id: binding.worktree_id,
|
|
745
|
+
worktree_revision: session.last_acknowledged_revision,
|
|
746
|
+
worktree_root_hash: session.last_acknowledged_sync_root_hash
|
|
747
|
+
};
|
|
748
|
+
const connection_hops = optionalIntegerArgument({
|
|
749
|
+
args: command_args,
|
|
750
|
+
name: '--connection-hops',
|
|
751
|
+
min: 0,
|
|
752
|
+
max: 3
|
|
753
|
+
});
|
|
754
|
+
const related_path_hops = optionalIntegerArgument({
|
|
755
|
+
args: command_args,
|
|
756
|
+
name: '--related-path-hops',
|
|
757
|
+
min: 0,
|
|
758
|
+
max: 1
|
|
759
|
+
});
|
|
760
|
+
const connection_direction = argumentValue(command_args, '--connection-direction');
|
|
761
|
+
if (connection_direction &&
|
|
762
|
+
!['incoming', 'outgoing', 'both'].includes(connection_direction)) {
|
|
763
|
+
throw new Error('--connection-direction must be incoming, outgoing, or both.');
|
|
764
|
+
}
|
|
765
|
+
const descendants = argumentValue(command_args, '--descendants');
|
|
766
|
+
if (descendants && !['none', 'direct', 'all'].includes(descendants)) {
|
|
767
|
+
throw new Error('--descendants must be none, direct, or all.');
|
|
768
|
+
}
|
|
769
|
+
const projection_overridden = [
|
|
770
|
+
connection_hops,
|
|
771
|
+
related_path_hops,
|
|
772
|
+
connection_direction,
|
|
773
|
+
descendants
|
|
774
|
+
].some((value) => value !== undefined && value !== null) ||
|
|
775
|
+
hasArgument(command_args, '--no-intersecting-paths') ||
|
|
776
|
+
hasArgument(command_args, '--no-internal-edges');
|
|
777
|
+
const projection = projection_overridden
|
|
778
|
+
? {
|
|
779
|
+
...(connection_hops !== undefined ? { connection_hops } : {}),
|
|
780
|
+
...(related_path_hops !== undefined
|
|
781
|
+
? { related_path_hops }
|
|
782
|
+
: {}),
|
|
783
|
+
...(connection_direction ? { connection_direction } : {}),
|
|
784
|
+
...(descendants ? { descendants } : {}),
|
|
785
|
+
...(hasArgument(command_args, '--no-intersecting-paths')
|
|
786
|
+
? { include_intersecting_paths: false }
|
|
787
|
+
: {}),
|
|
788
|
+
...(hasArgument(command_args, '--no-internal-edges')
|
|
789
|
+
? { include_internal_edges: false }
|
|
790
|
+
: {})
|
|
791
|
+
}
|
|
792
|
+
: undefined;
|
|
793
|
+
const response = await compareGraphSubgraphs(resolveClient(command_args, environment), {
|
|
794
|
+
target,
|
|
795
|
+
source,
|
|
796
|
+
seed_entity_ids,
|
|
797
|
+
...(projection ? { projection } : {}),
|
|
798
|
+
max_nodes: optionalIntegerArgument({
|
|
799
|
+
args: command_args,
|
|
800
|
+
name: '--max-nodes',
|
|
801
|
+
min: 1,
|
|
802
|
+
max: 240
|
|
803
|
+
}),
|
|
804
|
+
max_edges: optionalIntegerArgument({
|
|
805
|
+
args: command_args,
|
|
806
|
+
name: '--max-edges',
|
|
807
|
+
min: 0,
|
|
808
|
+
max: 480
|
|
809
|
+
}),
|
|
810
|
+
max_paths: optionalIntegerArgument({
|
|
811
|
+
args: command_args,
|
|
812
|
+
name: '--max-paths',
|
|
813
|
+
min: 0,
|
|
814
|
+
max: 240
|
|
815
|
+
}),
|
|
816
|
+
max_path_relations: optionalIntegerArgument({
|
|
817
|
+
args: command_args,
|
|
818
|
+
name: '--max-path-relations',
|
|
819
|
+
min: 0,
|
|
820
|
+
max: 240
|
|
821
|
+
})
|
|
822
|
+
});
|
|
823
|
+
printJson(response);
|
|
824
|
+
if (hasArgument(command_args, '--require-unchanged') &&
|
|
825
|
+
response.status !== 'unchanged') {
|
|
826
|
+
process.exitCode = 2;
|
|
827
|
+
}
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
if (command === 'rebuild') {
|
|
831
|
+
const binding = requireBinding(branch_binding);
|
|
832
|
+
if (!git.ref) {
|
|
833
|
+
throw new Error('Detached HEAD is read-only for SDLC rebuilds.');
|
|
834
|
+
}
|
|
835
|
+
const response = await rebuildCommand({
|
|
836
|
+
store,
|
|
837
|
+
client: resolveClient(command_args, environment),
|
|
838
|
+
worktree_id: binding.worktree_id,
|
|
839
|
+
node_ids: argumentValues(command_args, '--node'),
|
|
840
|
+
without_projection: hasArgument(command_args, '--without-projection')
|
|
841
|
+
});
|
|
842
|
+
printJson(response);
|
|
843
|
+
if (!response.accepted)
|
|
844
|
+
process.exitCode = 2;
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
if (command === 'reset') {
|
|
848
|
+
const binding = requireBinding(branch_binding);
|
|
849
|
+
if (!git.ref) {
|
|
850
|
+
throw new Error('Detached HEAD is read-only for SDLC resets.');
|
|
851
|
+
}
|
|
852
|
+
printJson(await resetCommand({
|
|
853
|
+
store,
|
|
854
|
+
client: resolveClient(command_args, environment),
|
|
855
|
+
worktree_id: binding.worktree_id,
|
|
856
|
+
discard_proposal: hasArgument(command_args, '--discard-proposal')
|
|
857
|
+
}));
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
if (command === 'rm') {
|
|
861
|
+
const binding = requireBinding(branch_binding);
|
|
862
|
+
if (!subcommand || subcommand.startsWith('--')) {
|
|
863
|
+
throw new Error('Usage: sdlc rm <entity-relative-path>');
|
|
864
|
+
}
|
|
865
|
+
const result = await removeManagedProjectionEntity({
|
|
866
|
+
store,
|
|
867
|
+
worktree_id: binding.worktree_id,
|
|
868
|
+
relative_path: subcommand
|
|
869
|
+
});
|
|
870
|
+
printJson(result);
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
if (command === 'media' && subcommand === 'upload') {
|
|
874
|
+
const binding = requireBinding(branch_binding);
|
|
875
|
+
const file_path = rest.find((argument, index) => !argument.startsWith('--') && rest[index - 1] !== '--timeout-ms');
|
|
876
|
+
if (!file_path) {
|
|
877
|
+
throw new Error('Usage: sdlc media upload <image-path>');
|
|
878
|
+
}
|
|
879
|
+
const response = await uploadHostedWorktreeMedia(resolveClient(command_args, environment), binding.worktree_id, {
|
|
880
|
+
bytes: await readFile(file_path, {
|
|
881
|
+
signal: currentOperation()?.signal
|
|
882
|
+
}),
|
|
883
|
+
filename: basename(file_path),
|
|
884
|
+
mime_type: imageMimeFromPath(file_path)
|
|
885
|
+
});
|
|
886
|
+
printJson(response);
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
if (command === 'save') {
|
|
890
|
+
const binding = requireBinding(branch_binding);
|
|
891
|
+
if (!git.ref) {
|
|
892
|
+
throw new Error('Detached HEAD is read-only for SDLC live saves.');
|
|
893
|
+
}
|
|
894
|
+
const requested_worktree_id = argumentValue(command_args, '--worktree-id');
|
|
895
|
+
if (requested_worktree_id &&
|
|
896
|
+
requested_worktree_id !== binding.worktree_id) {
|
|
897
|
+
throw new Error('Requested worktree does not match the current branch binding.');
|
|
898
|
+
}
|
|
899
|
+
const client = resolveClient(command_args, environment);
|
|
900
|
+
const source_context = {
|
|
901
|
+
repository_id: config.repository_id,
|
|
902
|
+
git_ref: git.ref,
|
|
903
|
+
git_commit: git.head,
|
|
904
|
+
is_dirty: git.is_dirty
|
|
905
|
+
};
|
|
906
|
+
const graph_file = argumentValue(command_args, '--graph-file');
|
|
907
|
+
// Standard output carries only the JSON result.
|
|
908
|
+
const progress = (message) => {
|
|
909
|
+
process.stderr.write(`${message}\n`);
|
|
910
|
+
};
|
|
911
|
+
if (!graph_file) {
|
|
912
|
+
const result = await saveManagedProjection({
|
|
913
|
+
store,
|
|
914
|
+
client,
|
|
915
|
+
worktree_id: binding.worktree_id,
|
|
916
|
+
source_context,
|
|
917
|
+
progress
|
|
918
|
+
});
|
|
919
|
+
printJson(result);
|
|
920
|
+
if (result.saved && !result.result.response.accepted)
|
|
921
|
+
process.exitCode = 2;
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
const session = store.getActiveSession(binding.worktree_id);
|
|
925
|
+
if (!session) {
|
|
926
|
+
throw new Error('Start a local session for this worktree before saving.');
|
|
927
|
+
}
|
|
928
|
+
const result = await saveLiveWorktreeChange({
|
|
929
|
+
store,
|
|
930
|
+
client,
|
|
931
|
+
worktree_id: binding.worktree_id,
|
|
932
|
+
session_id: session.id,
|
|
933
|
+
graph: parsePortableGraph(await readFile(graph_file, 'utf8')),
|
|
934
|
+
source_context,
|
|
935
|
+
save_mode: parseGraphFileSaveMode(argumentValue(command_args, '--save-mode')),
|
|
936
|
+
progress
|
|
937
|
+
});
|
|
938
|
+
printJson(result);
|
|
939
|
+
if (!result.response.accepted)
|
|
940
|
+
process.exitCode = 2;
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
if (command === 'sync') {
|
|
944
|
+
const binding = requireBinding(branch_binding);
|
|
945
|
+
const client = resolveClient(command_args, environment);
|
|
946
|
+
const session = store.getActiveSession(binding.worktree_id);
|
|
947
|
+
if (!session) {
|
|
948
|
+
throw new Error('No active local session exists for this worktree.');
|
|
949
|
+
}
|
|
950
|
+
const pending = store.listPendingChanges(session.id)[0];
|
|
951
|
+
if (pending)
|
|
952
|
+
trackPendingOperation(pending, true);
|
|
953
|
+
if (hasArgument(command_args, '--recover-stale-pending')) {
|
|
954
|
+
const expected_remote_revision = Number(requiredArgument(command_args, '--expected-remote-revision'));
|
|
955
|
+
const expected_remote_sync_revision = Number(requiredArgument(command_args, '--expected-remote-sync-revision'));
|
|
956
|
+
const expected_remote_sync_root_hash = requiredArgument(command_args, '--expected-remote-sync-root-hash');
|
|
957
|
+
const result = await recoverManagedProjectionFromStalePending({
|
|
958
|
+
store,
|
|
959
|
+
client,
|
|
960
|
+
worktree_id: binding.worktree_id,
|
|
961
|
+
expected_remote_revision,
|
|
962
|
+
expected_remote_sync_revision,
|
|
963
|
+
expected_remote_sync_root_hash,
|
|
964
|
+
allow_unapplied_remote_state: hasArgument(command_args, '--discard-unapplied-pending')
|
|
965
|
+
});
|
|
966
|
+
printJson(result);
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
const result = store.getProjectionState(binding.worktree_id)
|
|
970
|
+
? await syncManagedProjection({
|
|
971
|
+
store,
|
|
972
|
+
client,
|
|
973
|
+
worktree_id: binding.worktree_id,
|
|
974
|
+
session_id: session.id
|
|
975
|
+
})
|
|
976
|
+
: await syncPendingWorktreeChanges({
|
|
977
|
+
store,
|
|
978
|
+
client,
|
|
979
|
+
worktree_id: binding.worktree_id,
|
|
980
|
+
session_id: session.id
|
|
981
|
+
});
|
|
982
|
+
printJson(result);
|
|
983
|
+
const conflicts = 'conflicts' in result ? result.conflicts : result.result.conflicts;
|
|
984
|
+
if (conflicts.length > 0)
|
|
985
|
+
process.exitCode = 2;
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
throw new Error(SDLC_CLI_USAGE);
|
|
989
|
+
}
|
|
990
|
+
finally {
|
|
991
|
+
store.close();
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
void runCliOperation(process.argv.slice(2), main).catch((error) => {
|
|
997
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
998
|
+
console.error(message);
|
|
999
|
+
// A save the server still finalizes in the background exits with its own
|
|
1000
|
+
// status, so a caller can tell it from a failure and run sdlc sync.
|
|
1001
|
+
process.exitCode =
|
|
1002
|
+
error instanceof TreeSaveStillFinalizingError ? error.exit_code : 1;
|
|
1003
|
+
});
|
|
1004
|
+
//# sourceMappingURL=cli.js.map
|