@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
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { compareSemver, defaultPackageView, graphPackageContentTypes, isSemver, latestVersion, markChange, packageDiffView, readVersionDocument, renderTextView } from '@software-dlc/graph/packages';
|
|
6
|
+
import { DEFAULT_GRAPH_PACKAGES_ORIGIN, GRAPH_PACKAGES_SNAPSHOT_INDEX, GraphPackagesLockError, cacheGraphPackageIndex, cacheGraphPackageVersion, defaultGraphPackagesCacheDir, downloadLockedVersion, fetchPackageIndexByCoordinate, fetchPackageIndexById, listCachedGraphPackageVersions, readCachedGraphPackageIndex } from './graph-packages-lock.js';
|
|
7
|
+
import { ownPackageName } from './own-package.js';
|
|
8
|
+
/** Splits `@scope/name@1.2.0` into its coordinate and version; the version is optional. */
|
|
9
|
+
export function parsePackageSpec(spec) {
|
|
10
|
+
const at = spec.lastIndexOf('@');
|
|
11
|
+
if (at > 0)
|
|
12
|
+
return {
|
|
13
|
+
coordinate: spec.slice(0, at),
|
|
14
|
+
version: spec.slice(at + 1) || null
|
|
15
|
+
};
|
|
16
|
+
return { coordinate: spec, version: null };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Browsing graph packages offline (docs/specs/graph-packages.md, Browsing and Offline to online):
|
|
20
|
+
* `sdlc packages list|show|diff` read the bundled snapshot (generated/graph-packages, which the
|
|
21
|
+
* build writes from graph-packages.lock.json) and the download cache, with no account and no
|
|
22
|
+
* network. `sdlc packages fetch` reads public indexes and downloads newer versions into the cache.
|
|
23
|
+
* Every document is checked against its content hash before it is shown.
|
|
24
|
+
*/
|
|
25
|
+
export const BROWSE_ACTIONS = ['list', 'show', 'diff', 'fetch'];
|
|
26
|
+
export const PACKAGES_BROWSE_USAGE = 'Usage: sdlc packages list [--json]\n' +
|
|
27
|
+
' sdlc packages show <coordinate>[@<version>] [--json]\n' +
|
|
28
|
+
' sdlc packages diff <coordinate> <from-version> <to-version> [--json]\n' +
|
|
29
|
+
' sdlc packages fetch [<coordinate>[@<version>]] [--origin <url>]\n' +
|
|
30
|
+
'Browse graph packages offline, with no account: the public packages bundled with this sdlc and the versions in the download cache. ' +
|
|
31
|
+
"list shows each package and its versions held here; show prints a version (default: the latest held that is not withdrawn) through its content type's view, with its version history and lineage; " +
|
|
32
|
+
"diff prints what changed between two versions, with the content type's marks and the gates they need. " +
|
|
33
|
+
'fetch needs the network but no account: it reads the public index of each package held here, or of the named one, and downloads each newer version that is not withdrawn (or the named version) into the download cache. ' +
|
|
34
|
+
'The origin is https://www.softwaredlc.com unless --origin or SDLC_GRAPH_PACKAGES_ORIGIN names another; SDLC_GRAPH_PACKAGES_BYPASS passes a protected (staging) origin. ' +
|
|
35
|
+
'The cache is SDLC_GRAPH_PACKAGES_CACHE, else under XDG_CACHE_HOME or ~/.cache. ' +
|
|
36
|
+
'Exit 0: done; 1: refused, with the reason on stderr.';
|
|
37
|
+
/** The bundled snapshot as built: `generated/graph-packages` of the installed package. */
|
|
38
|
+
export function defaultGraphPackagesSnapshotDir() {
|
|
39
|
+
return fileURLToPath(new URL('../generated/graph-packages', import.meta.url));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Every package held here: the bundled snapshot's versions, then the download cache's, each
|
|
43
|
+
* checked against its content hash. A bundled version that fails its hash is an error (the install
|
|
44
|
+
* is damaged); a cached one is reported and skipped.
|
|
45
|
+
*/
|
|
46
|
+
export function readLocalPackages(options) {
|
|
47
|
+
const warnings = [];
|
|
48
|
+
const by_id = new Map();
|
|
49
|
+
const hold = (held) => {
|
|
50
|
+
const document = held.document;
|
|
51
|
+
let entry = by_id.get(document.package.id);
|
|
52
|
+
if (!entry) {
|
|
53
|
+
entry = {
|
|
54
|
+
id: document.package.id,
|
|
55
|
+
coordinate: document.package.coordinate,
|
|
56
|
+
content_type: document.package.content_type,
|
|
57
|
+
owner_slug: document.package.owner_slug,
|
|
58
|
+
display_name: document.package.display_name,
|
|
59
|
+
description: document.package.description,
|
|
60
|
+
held: [],
|
|
61
|
+
index: null
|
|
62
|
+
};
|
|
63
|
+
by_id.set(document.package.id, entry);
|
|
64
|
+
}
|
|
65
|
+
const same = entry.held.find((other) => other.version === held.version);
|
|
66
|
+
if (same) {
|
|
67
|
+
if (same.content_hash !== held.content_hash) {
|
|
68
|
+
warnings.push(`${entry.coordinate}@${held.version}: the ${held.source} copy (${held.content_hash}) differs from the ${same.source} one (${same.content_hash}); showing the ${same.source} one`);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
entry.held.push(held);
|
|
73
|
+
};
|
|
74
|
+
for (const held of readSnapshot(options.snapshotDir, warnings))
|
|
75
|
+
hold(held);
|
|
76
|
+
for (const cached of listCachedGraphPackageVersions(options.cacheDir)) {
|
|
77
|
+
if ('tampered' in cached) {
|
|
78
|
+
warnings.push(cached.tampered);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const { document, content_hash } = readVersionDocument(Buffer.from(cached.bytes).toString('utf8'), cached.content_hash);
|
|
83
|
+
hold({
|
|
84
|
+
version: document.version,
|
|
85
|
+
content_hash,
|
|
86
|
+
source: 'cached',
|
|
87
|
+
document
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
warnings.push(`${cached.file} is not a valid version document: ${error.message}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
for (const entry of by_id.values()) {
|
|
95
|
+
entry.held.sort((a, b) => compareSemver(b.version, a.version));
|
|
96
|
+
const newest = entry.held[0].document.package;
|
|
97
|
+
Object.assign(entry, {
|
|
98
|
+
coordinate: newest.coordinate,
|
|
99
|
+
content_type: newest.content_type,
|
|
100
|
+
owner_slug: newest.owner_slug,
|
|
101
|
+
display_name: newest.display_name,
|
|
102
|
+
description: newest.description
|
|
103
|
+
});
|
|
104
|
+
const indexBytes = readCachedGraphPackageIndex(entry.id, options.cacheDir);
|
|
105
|
+
if (indexBytes) {
|
|
106
|
+
const index = readCachedIndex(entry.id, indexBytes);
|
|
107
|
+
if (typeof index === 'string')
|
|
108
|
+
warnings.push(index);
|
|
109
|
+
else {
|
|
110
|
+
entry.index = index.index;
|
|
111
|
+
if (index.coordinate)
|
|
112
|
+
entry.coordinate = index.coordinate;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const packages = [...by_id.values()].sort((a, b) => a.coordinate < b.coordinate ? -1 : a.coordinate > b.coordinate ? 1 : 0);
|
|
117
|
+
return { packages, warnings };
|
|
118
|
+
}
|
|
119
|
+
function readSnapshot(dir, warnings) {
|
|
120
|
+
const indexPath = path.join(dir, GRAPH_PACKAGES_SNAPSHOT_INDEX);
|
|
121
|
+
if (!existsSync(indexPath)) {
|
|
122
|
+
warnings.push(`no bundled snapshot at ${dir}: this sdlc was not built with one, so only the download cache is read`);
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
let listed;
|
|
126
|
+
try {
|
|
127
|
+
listed = JSON.parse(readFileSync(indexPath, 'utf8')).packages;
|
|
128
|
+
if (!Array.isArray(listed))
|
|
129
|
+
throw new Error('packages must be a list');
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
throw new GraphPackagesLockError(`${indexPath} cannot be read (${error.message}); reinstall or rebuild ${ownPackageName()}`);
|
|
133
|
+
}
|
|
134
|
+
return listed.map((entry) => {
|
|
135
|
+
const file = path.join(dir, String(entry.file));
|
|
136
|
+
const label = `${String(entry.coordinate)}@${String(entry.version)}`;
|
|
137
|
+
if (!existsSync(file))
|
|
138
|
+
throw new GraphPackagesLockError(`the bundled ${label} is missing (${file}); reinstall or rebuild ${ownPackageName()}`);
|
|
139
|
+
try {
|
|
140
|
+
const { document, content_hash } = readVersionDocument(readFileSync(file, 'utf8'), String(entry.content_hash));
|
|
141
|
+
return {
|
|
142
|
+
version: document.version,
|
|
143
|
+
content_hash,
|
|
144
|
+
source: 'bundled',
|
|
145
|
+
document
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
throw new GraphPackagesLockError(`the bundled ${label} (${file}) is damaged: ${error.message}; reinstall or rebuild ${ownPackageName()}`);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** A cached index, read leniently: only what browsing shows. A string is why it cannot be read. */
|
|
154
|
+
function readCachedIndex(id, bytes) {
|
|
155
|
+
try {
|
|
156
|
+
const value = JSON.parse(Buffer.from(bytes).toString('utf8'));
|
|
157
|
+
if (value?.package?.id !== id || !Array.isArray(value.versions))
|
|
158
|
+
throw new Error('it does not describe the package');
|
|
159
|
+
const versions = value.versions
|
|
160
|
+
.filter((entry) => isSemver(String(entry.version)))
|
|
161
|
+
.map((entry) => ({
|
|
162
|
+
version: String(entry.version),
|
|
163
|
+
content_hash: String(entry.content_hash),
|
|
164
|
+
withdrawn: entry.withdrawn === true,
|
|
165
|
+
withdrawn_reason: typeof entry.withdrawn_reason === 'string'
|
|
166
|
+
? entry.withdrawn_reason
|
|
167
|
+
: null
|
|
168
|
+
}))
|
|
169
|
+
.sort((a, b) => compareSemver(b.version, a.version));
|
|
170
|
+
return {
|
|
171
|
+
index: {
|
|
172
|
+
visibility: typeof value.package.visibility === 'string'
|
|
173
|
+
? value.package.visibility
|
|
174
|
+
: null,
|
|
175
|
+
versions,
|
|
176
|
+
latest: typeof value.latest === 'string'
|
|
177
|
+
? value.latest
|
|
178
|
+
: latestVersion(versions)
|
|
179
|
+
},
|
|
180
|
+
coordinate: typeof value.package.coordinate === 'string'
|
|
181
|
+
? value.package.coordinate
|
|
182
|
+
: null
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
return `the cached index of ${id} cannot be read (${error.message}); run sdlc packages fetch again`;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The resolver's package source over what is held here (graph-packages.md, Local resolution).
|
|
191
|
+
* Every held document was checked against its hash when it was read. Neither a version
|
|
192
|
+
* document nor the public index carries the import policy yet, so it is unknown here.
|
|
193
|
+
*/
|
|
194
|
+
export function localPackageSource(local) {
|
|
195
|
+
return {
|
|
196
|
+
document(package_id, version) {
|
|
197
|
+
const held = local.packages
|
|
198
|
+
.find((entry) => entry.id === package_id)
|
|
199
|
+
?.held.find((v) => v.version === version);
|
|
200
|
+
return held
|
|
201
|
+
? { document: held.document, content_hash: held.content_hash }
|
|
202
|
+
: null;
|
|
203
|
+
},
|
|
204
|
+
importPolicy: () => null
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** The package a coordinate (or package id) names, or a refusal naming what is held. */
|
|
208
|
+
export function findLocalPackage(local, name) {
|
|
209
|
+
const found = local.packages.find((entry) => entry.coordinate === name || entry.id === name);
|
|
210
|
+
if (found)
|
|
211
|
+
return found;
|
|
212
|
+
const known = local.packages.map((entry) => entry.coordinate);
|
|
213
|
+
throw new GraphPackagesLockError(`no package ${name} is held here${known.length ? ` (held: ${known.join(', ')})` : ''}; download it with sdlc packages fetch ${name}`);
|
|
214
|
+
}
|
|
215
|
+
export function withdrawnOf(entry, version) {
|
|
216
|
+
const listed = entry.index?.versions.find((v) => v.version === version);
|
|
217
|
+
return listed?.withdrawn ? listed : null;
|
|
218
|
+
}
|
|
219
|
+
/** The version `show` opens by default: the index's latest when held, else the newest held that is not withdrawn. */
|
|
220
|
+
export function defaultHeldVersion(entry) {
|
|
221
|
+
const latest = entry.index?.latest;
|
|
222
|
+
const newest = newestHeld(entry, (version) => Boolean(withdrawnOf(entry, version)));
|
|
223
|
+
return ((latest && entry.held.find((v) => v.version === latest)) ||
|
|
224
|
+
entry.held.find((v) => v.version === newest) ||
|
|
225
|
+
entry.held[0]);
|
|
226
|
+
}
|
|
227
|
+
/** The newest held version that is not withdrawn, by the index's rule: a release before any pre-release. */
|
|
228
|
+
function newestHeld(entry, withdrawn) {
|
|
229
|
+
return latestVersion(entry.held.map((v) => ({
|
|
230
|
+
version: v.version,
|
|
231
|
+
withdrawn: withdrawn(v.version)
|
|
232
|
+
})));
|
|
233
|
+
}
|
|
234
|
+
export function heldVersion(entry, version) {
|
|
235
|
+
const held = entry.held.find((v) => v.version === version);
|
|
236
|
+
if (held)
|
|
237
|
+
return held;
|
|
238
|
+
throw new GraphPackagesLockError(`${entry.coordinate}@${version} is not held here (held: ${entry.held.map((v) => v.version).join(', ')}); download it with sdlc packages fetch ${entry.coordinate}@${version}`);
|
|
239
|
+
}
|
|
240
|
+
/** A content type this sdlc does not know: its content drawn by the default view, unmarked. */
|
|
241
|
+
export function contentTypeFor(registry, id) {
|
|
242
|
+
const known = registry.get(id);
|
|
243
|
+
if (known)
|
|
244
|
+
return { type: known, known: true };
|
|
245
|
+
return {
|
|
246
|
+
known: false,
|
|
247
|
+
type: {
|
|
248
|
+
id,
|
|
249
|
+
schema_version: 1,
|
|
250
|
+
label: id,
|
|
251
|
+
node_types: [],
|
|
252
|
+
edge_types: [],
|
|
253
|
+
subjects: [],
|
|
254
|
+
overridable: () => 'This sdlc does not know the content type.',
|
|
255
|
+
floors: () => [],
|
|
256
|
+
mark: () => [],
|
|
257
|
+
metadata_schema: z.unknown(),
|
|
258
|
+
view: defaultPackageView
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
const MAX_LINEAGE = 8;
|
|
263
|
+
/** The base chain of a version, as far as the bases are held here, at most eight links. */
|
|
264
|
+
export function lineageOf(local, document) {
|
|
265
|
+
const links = [];
|
|
266
|
+
let base = document.base;
|
|
267
|
+
while (base && links.length < MAX_LINEAGE) {
|
|
268
|
+
const pkg = local.packages.find((entry) => entry.id === base.package_id);
|
|
269
|
+
const held = pkg?.held.find((v) => v.version === base.version && v.content_hash === base.content_hash);
|
|
270
|
+
links.push({
|
|
271
|
+
package_id: base.package_id,
|
|
272
|
+
version: base.version,
|
|
273
|
+
mode: base.mode,
|
|
274
|
+
coordinate: held ? pkg.coordinate : null,
|
|
275
|
+
available: Boolean(held)
|
|
276
|
+
});
|
|
277
|
+
base = held ? held.document.base : null;
|
|
278
|
+
}
|
|
279
|
+
return { links, truncated: Boolean(base) };
|
|
280
|
+
}
|
|
281
|
+
/** `sdlc packages list|show|diff|fetch`: the exit code. */
|
|
282
|
+
export async function runPackagesBrowseCommand(args, context = {}) {
|
|
283
|
+
const stdout = context.stdout ?? process.stdout;
|
|
284
|
+
const stderr = context.stderr ?? process.stderr;
|
|
285
|
+
try {
|
|
286
|
+
const [action, ...rest] = args;
|
|
287
|
+
const options = parseBrowseOptions(action, rest);
|
|
288
|
+
const env = context.env ?? process.env;
|
|
289
|
+
const cacheDir = defaultGraphPackagesCacheDir(env);
|
|
290
|
+
const snapshotDir = context.snapshotDir ?? defaultGraphPackagesSnapshotDir();
|
|
291
|
+
const registry = context.registry ?? graphPackageContentTypes;
|
|
292
|
+
if (action === 'fetch') {
|
|
293
|
+
const fetchOptions = {
|
|
294
|
+
origin: options.origin ??
|
|
295
|
+
env.SDLC_GRAPH_PACKAGES_ORIGIN ??
|
|
296
|
+
DEFAULT_GRAPH_PACKAGES_ORIGIN,
|
|
297
|
+
bypass: env.SDLC_GRAPH_PACKAGES_BYPASS || undefined,
|
|
298
|
+
fetchImpl: context.fetchImpl
|
|
299
|
+
};
|
|
300
|
+
const local = readLocalPackages({ snapshotDir, cacheDir });
|
|
301
|
+
for (const warning of local.warnings)
|
|
302
|
+
stderr.write(`warning: ${warning}\n`);
|
|
303
|
+
const lines = await fetchPackages(local, options.positional[0] ?? null, fetchOptions, cacheDir);
|
|
304
|
+
stdout.write(`${lines.join('\n')}\n`);
|
|
305
|
+
return 0;
|
|
306
|
+
}
|
|
307
|
+
const local = readLocalPackages({ snapshotDir, cacheDir });
|
|
308
|
+
for (const warning of local.warnings)
|
|
309
|
+
stderr.write(`warning: ${warning}\n`);
|
|
310
|
+
let output;
|
|
311
|
+
if (action === 'list')
|
|
312
|
+
output = listPackages(local, registry, options.json);
|
|
313
|
+
else if (action === 'show')
|
|
314
|
+
output = showPackage(local, registry, options.positional[0], options.json);
|
|
315
|
+
else
|
|
316
|
+
output = diffPackage(local, registry, options.positional, options.json);
|
|
317
|
+
stdout.write(`${output}\n`);
|
|
318
|
+
return 0;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
stderr.write(`sdlc packages: ${error.message}\n`);
|
|
322
|
+
return 1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const POSITIONALS = {
|
|
326
|
+
list: [0, 0, 'sdlc packages list [--json]'],
|
|
327
|
+
show: [1, 1, 'sdlc packages show <coordinate>[@<version>] [--json]'],
|
|
328
|
+
diff: [
|
|
329
|
+
3,
|
|
330
|
+
3,
|
|
331
|
+
'sdlc packages diff <coordinate> <from-version> <to-version> [--json]'
|
|
332
|
+
],
|
|
333
|
+
fetch: [
|
|
334
|
+
0,
|
|
335
|
+
1,
|
|
336
|
+
'sdlc packages fetch [<coordinate>[@<version>]] [--origin <url>]'
|
|
337
|
+
]
|
|
338
|
+
};
|
|
339
|
+
function parseBrowseOptions(action, args) {
|
|
340
|
+
const [min, max, usage] = POSITIONALS[action];
|
|
341
|
+
const positional = [];
|
|
342
|
+
let json = false;
|
|
343
|
+
let origin;
|
|
344
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
345
|
+
const arg = args[i];
|
|
346
|
+
if (arg === '--json' && action !== 'fetch')
|
|
347
|
+
json = true;
|
|
348
|
+
else if (arg === '--origin' && action === 'fetch') {
|
|
349
|
+
const value = args[i + 1];
|
|
350
|
+
if (!value || value.startsWith('--'))
|
|
351
|
+
throw new GraphPackagesLockError('--origin needs a value');
|
|
352
|
+
origin = value;
|
|
353
|
+
i += 1;
|
|
354
|
+
}
|
|
355
|
+
else if (arg.startsWith('--'))
|
|
356
|
+
throw new GraphPackagesLockError(`unexpected option ${arg}; usage: ${usage}`);
|
|
357
|
+
else
|
|
358
|
+
positional.push(arg);
|
|
359
|
+
}
|
|
360
|
+
if (positional.length < min || positional.length > max)
|
|
361
|
+
throw new GraphPackagesLockError(`usage: ${usage}`);
|
|
362
|
+
return { positional, json, origin };
|
|
363
|
+
}
|
|
364
|
+
function versionNote(entry, version) {
|
|
365
|
+
const withdrawn = withdrawnOf(entry, version);
|
|
366
|
+
return withdrawn
|
|
367
|
+
? ` withdrawn${withdrawn.withdrawn_reason ? `: ${withdrawn.withdrawn_reason}` : ''}`
|
|
368
|
+
: '';
|
|
369
|
+
}
|
|
370
|
+
function listPackages(local, registry, json) {
|
|
371
|
+
if (json) {
|
|
372
|
+
return JSON.stringify({
|
|
373
|
+
packages: local.packages.map((entry) => ({
|
|
374
|
+
id: entry.id,
|
|
375
|
+
coordinate: entry.coordinate,
|
|
376
|
+
content_type: entry.content_type,
|
|
377
|
+
content_type_known: Boolean(registry.get(entry.content_type)),
|
|
378
|
+
display_name: entry.display_name,
|
|
379
|
+
latest: entry.index?.latest ?? null,
|
|
380
|
+
held: entry.held.map((v) => ({
|
|
381
|
+
version: v.version,
|
|
382
|
+
content_hash: v.content_hash,
|
|
383
|
+
source: v.source,
|
|
384
|
+
withdrawn: Boolean(withdrawnOf(entry, v.version))
|
|
385
|
+
}))
|
|
386
|
+
})),
|
|
387
|
+
warnings: local.warnings
|
|
388
|
+
}, null, 2);
|
|
389
|
+
}
|
|
390
|
+
if (local.packages.length === 0) {
|
|
391
|
+
return 'No graph packages are held here: none is bundled with this sdlc and the download cache has none. Download a public package with sdlc packages fetch <coordinate>.';
|
|
392
|
+
}
|
|
393
|
+
const lines = [];
|
|
394
|
+
for (const entry of local.packages) {
|
|
395
|
+
const known = registry.get(entry.content_type)
|
|
396
|
+
? ''
|
|
397
|
+
: ', not known to this sdlc';
|
|
398
|
+
lines.push(`${entry.coordinate} ${entry.display_name} (${entry.content_type}${known})`);
|
|
399
|
+
const held = entry.held
|
|
400
|
+
.map((v) => `${v.version} ${v.source}${versionNote(entry, v.version)}`)
|
|
401
|
+
.join(', ');
|
|
402
|
+
lines.push(` held: ${held}`);
|
|
403
|
+
const latest = entry.index?.latest;
|
|
404
|
+
if (latest && !entry.held.some((v) => v.version === latest))
|
|
405
|
+
lines.push(` latest: ${latest}, not held; sdlc packages fetch ${entry.coordinate} downloads it`);
|
|
406
|
+
else if (latest)
|
|
407
|
+
lines.push(` latest: ${latest}`);
|
|
408
|
+
else
|
|
409
|
+
lines.push(' latest: unknown; sdlc packages fetch reads the public index');
|
|
410
|
+
}
|
|
411
|
+
return lines.join('\n');
|
|
412
|
+
}
|
|
413
|
+
function showPackage(local, registry, spec, json) {
|
|
414
|
+
const { coordinate, version } = parsePackageSpec(spec);
|
|
415
|
+
const entry = findLocalPackage(local, coordinate);
|
|
416
|
+
const held = version
|
|
417
|
+
? heldVersion(entry, version)
|
|
418
|
+
: defaultHeldVersion(entry);
|
|
419
|
+
const { type, known } = contentTypeFor(registry, entry.content_type);
|
|
420
|
+
const view = type.view(held.document.content);
|
|
421
|
+
const lineage = lineageOf(local, held.document);
|
|
422
|
+
const history = versionHistory(entry);
|
|
423
|
+
if (json) {
|
|
424
|
+
return JSON.stringify({
|
|
425
|
+
package: {
|
|
426
|
+
id: entry.id,
|
|
427
|
+
coordinate: entry.coordinate,
|
|
428
|
+
content_type: entry.content_type,
|
|
429
|
+
content_type_known: known,
|
|
430
|
+
owner_slug: entry.owner_slug,
|
|
431
|
+
display_name: entry.display_name,
|
|
432
|
+
description: entry.description,
|
|
433
|
+
visibility: entry.index?.visibility ?? null
|
|
434
|
+
},
|
|
435
|
+
version: {
|
|
436
|
+
version: held.version,
|
|
437
|
+
content_hash: held.content_hash,
|
|
438
|
+
source: held.source,
|
|
439
|
+
published_at: held.document.published_at,
|
|
440
|
+
withdrawn: Boolean(withdrawnOf(entry, held.version)),
|
|
441
|
+
base: held.document.base,
|
|
442
|
+
metadata: held.document.metadata
|
|
443
|
+
},
|
|
444
|
+
versions: history,
|
|
445
|
+
lineage,
|
|
446
|
+
view
|
|
447
|
+
}, null, 2);
|
|
448
|
+
}
|
|
449
|
+
const lines = [
|
|
450
|
+
`${entry.coordinate}@${held.version} ${entry.display_name}`,
|
|
451
|
+
`owner ${entry.owner_slug} · content type ${entry.content_type}${known ? '' : ' (not known to this sdlc; drawn with the default view)'}${entry.index?.visibility ? ` · ${entry.index.visibility}` : ''}`
|
|
452
|
+
];
|
|
453
|
+
if (entry.description)
|
|
454
|
+
lines.push(entry.description);
|
|
455
|
+
lines.push(`version ${held.version}, published ${held.document.published_at}, ${held.source}, ${held.content_hash}${versionNote(entry, held.version)}`);
|
|
456
|
+
lines.push('', 'Versions');
|
|
457
|
+
for (const item of history) {
|
|
458
|
+
const where = item.held ?? 'not held';
|
|
459
|
+
const flags = [
|
|
460
|
+
item.version === entry.index?.latest ? 'latest' : null,
|
|
461
|
+
item.withdrawn
|
|
462
|
+
? `withdrawn${item.withdrawn_reason ? `: ${item.withdrawn_reason}` : ''}`
|
|
463
|
+
: null
|
|
464
|
+
].filter(Boolean);
|
|
465
|
+
const mark = item.version === held.version ? '*' : ' ';
|
|
466
|
+
lines.push(`${mark} ${item.version} ${where}${flags.length ? ` (${flags.join('; ')})` : ''}`);
|
|
467
|
+
}
|
|
468
|
+
lines.push('', 'Lineage');
|
|
469
|
+
if (lineage.links.length === 0)
|
|
470
|
+
lines.push(' no base: this version is the start of its chain');
|
|
471
|
+
for (const link of lineage.links) {
|
|
472
|
+
lines.push(link.available
|
|
473
|
+
? ` ${link.mode} ${link.coordinate}@${link.version}`
|
|
474
|
+
: ` ${link.mode} package ${link.package_id} ${link.version}: not available here`);
|
|
475
|
+
}
|
|
476
|
+
if (lineage.truncated)
|
|
477
|
+
lines.push(` earlier versions are not shown (the first ${MAX_LINEAGE} links)`);
|
|
478
|
+
lines.push('', renderOrEmpty(view));
|
|
479
|
+
return lines.join('\n');
|
|
480
|
+
}
|
|
481
|
+
function versionHistory(entry) {
|
|
482
|
+
const versions = new Set([
|
|
483
|
+
...entry.held.map((v) => v.version),
|
|
484
|
+
...(entry.index?.versions.map((v) => v.version) ?? [])
|
|
485
|
+
]);
|
|
486
|
+
return [...versions]
|
|
487
|
+
.sort((a, b) => compareSemver(b, a))
|
|
488
|
+
.map((version) => {
|
|
489
|
+
const listed = entry.index?.versions.find((v) => v.version === version);
|
|
490
|
+
return {
|
|
491
|
+
version,
|
|
492
|
+
held: entry.held.find((v) => v.version === version)?.source ?? null,
|
|
493
|
+
withdrawn: listed?.withdrawn ?? false,
|
|
494
|
+
withdrawn_reason: listed?.withdrawn_reason ?? null
|
|
495
|
+
};
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
function renderOrEmpty(view) {
|
|
499
|
+
return view.sections.length
|
|
500
|
+
? renderTextView(view)
|
|
501
|
+
: 'The version has no content.';
|
|
502
|
+
}
|
|
503
|
+
function diffPackage(local, registry, [name, from, to], json) {
|
|
504
|
+
const entry = findLocalPackage(local, name);
|
|
505
|
+
const before = heldVersion(entry, from);
|
|
506
|
+
const after = heldVersion(entry, to);
|
|
507
|
+
const { type, known } = contentTypeFor(registry, entry.content_type);
|
|
508
|
+
const change = markChange({
|
|
509
|
+
content_type: type,
|
|
510
|
+
before: before.document.content,
|
|
511
|
+
after: after.document.content
|
|
512
|
+
});
|
|
513
|
+
const view = packageDiffView({
|
|
514
|
+
content_type: type,
|
|
515
|
+
before: before.document.content,
|
|
516
|
+
after: after.document.content
|
|
517
|
+
});
|
|
518
|
+
if (json) {
|
|
519
|
+
return JSON.stringify({
|
|
520
|
+
package: {
|
|
521
|
+
id: entry.id,
|
|
522
|
+
coordinate: entry.coordinate,
|
|
523
|
+
content_type: entry.content_type,
|
|
524
|
+
content_type_known: known
|
|
525
|
+
},
|
|
526
|
+
from: { version: from, content_hash: before.content_hash },
|
|
527
|
+
to: { version: to, content_hash: after.content_hash },
|
|
528
|
+
diff: change.diff,
|
|
529
|
+
marks: change.marks,
|
|
530
|
+
required_gates: change.required_gates,
|
|
531
|
+
view
|
|
532
|
+
}, null, 2);
|
|
533
|
+
}
|
|
534
|
+
const counts = `${change.diff.added.length} added, ${change.diff.modified.length} changed, ${change.diff.deleted.length} removed`;
|
|
535
|
+
const lines = [
|
|
536
|
+
`${entry.coordinate} ${from} → ${to}: ${counts}${change.diff.changed_keys.length ? `; also changed: ${change.diff.changed_keys.join(', ')}` : ''}`
|
|
537
|
+
];
|
|
538
|
+
if (!known)
|
|
539
|
+
lines.push(`${entry.content_type} is not known to this sdlc: drawn with the default view, with no marks`);
|
|
540
|
+
if (change.required_gates.length)
|
|
541
|
+
lines.push(`gates the marked changes need: ${change.required_gates.join(', ')}`);
|
|
542
|
+
const changed = view.sections
|
|
543
|
+
.map((section) => ({
|
|
544
|
+
...section,
|
|
545
|
+
items: section.items.filter((item) => item.change)
|
|
546
|
+
}))
|
|
547
|
+
.filter((section) => section.items.length);
|
|
548
|
+
lines.push('', changed.length ? renderTextView({ sections: changed }) : 'No changes.');
|
|
549
|
+
return lines.join('\n');
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Reads the public index of each package held here, or of the named one, keeps it in the cache,
|
|
553
|
+
* and downloads into the cache each version that is not withdrawn and is newer than the newest
|
|
554
|
+
* held release (or is the index's latest), or the one named. Every download is checked against the index's hash and its ETag first.
|
|
555
|
+
*/
|
|
556
|
+
async function fetchPackages(local, spec, options, cacheDir) {
|
|
557
|
+
const lines = [];
|
|
558
|
+
const targets = [];
|
|
559
|
+
if (spec) {
|
|
560
|
+
const { coordinate, version } = parsePackageSpec(spec);
|
|
561
|
+
const held = local.packages.find((entry) => entry.coordinate === coordinate || entry.id === coordinate);
|
|
562
|
+
targets.push({
|
|
563
|
+
name: held?.coordinate ?? coordinate,
|
|
564
|
+
id: held?.id ?? null,
|
|
565
|
+
version
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
for (const entry of local.packages)
|
|
570
|
+
targets.push({ name: entry.coordinate, id: entry.id, version: null });
|
|
571
|
+
if (!targets.length)
|
|
572
|
+
return [
|
|
573
|
+
'No graph packages are held here to fetch updates for; name one: sdlc packages fetch <coordinate>'
|
|
574
|
+
];
|
|
575
|
+
}
|
|
576
|
+
for (const target of targets) {
|
|
577
|
+
let fetched;
|
|
578
|
+
try {
|
|
579
|
+
fetched = target.id
|
|
580
|
+
? await fetchPackageIndexById(target.id, options)
|
|
581
|
+
: await fetchPackageIndexByCoordinate(target.name, options);
|
|
582
|
+
}
|
|
583
|
+
catch (error) {
|
|
584
|
+
if (spec)
|
|
585
|
+
throw error;
|
|
586
|
+
lines.push(`${target.name}: ${error.message}`);
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
589
|
+
const { index } = fetched;
|
|
590
|
+
cacheGraphPackageIndex(index.package.id, fetched.bytes, cacheDir);
|
|
591
|
+
const entry = local.packages.find((p) => p.id === index.package.id);
|
|
592
|
+
const heldVersions = new Set(entry?.held.map((v) => v.version) ?? []);
|
|
593
|
+
// Newer than the newest held release (withdrawn or not, so nothing older than a held version
|
|
594
|
+
// is downloaded), and always the index's latest: a held pre-release never hides a later release.
|
|
595
|
+
const newest = entry ? newestHeld(entry, () => false) : null;
|
|
596
|
+
const wanted = target.version
|
|
597
|
+
? index.versions.filter((v) => v.version === target.version)
|
|
598
|
+
: index.versions.filter((v) => !v.withdrawn &&
|
|
599
|
+
isSemver(v.version) &&
|
|
600
|
+
(newest === null ||
|
|
601
|
+
v.version === index.latest ||
|
|
602
|
+
compareSemver(v.version, newest) > 0));
|
|
603
|
+
if (target.version && !wanted.length)
|
|
604
|
+
throw new GraphPackagesLockError(`${index.package.coordinate} has no published version ${target.version}`);
|
|
605
|
+
const downloaded = [];
|
|
606
|
+
let failure = null;
|
|
607
|
+
for (const listed of wanted.sort((a, b) => compareSemver(a.version, b.version))) {
|
|
608
|
+
if (heldVersions.has(listed.version))
|
|
609
|
+
continue;
|
|
610
|
+
const lockEntry = {
|
|
611
|
+
id: index.package.id,
|
|
612
|
+
coordinate: index.package.coordinate,
|
|
613
|
+
version: listed.version,
|
|
614
|
+
content_hash: listed.content_hash
|
|
615
|
+
};
|
|
616
|
+
try {
|
|
617
|
+
const bytes = await downloadLockedVersion(lockEntry, options);
|
|
618
|
+
readVersionDocument(Buffer.from(bytes).toString('utf8'), listed.content_hash);
|
|
619
|
+
cacheGraphPackageVersion(lockEntry, bytes, cacheDir);
|
|
620
|
+
}
|
|
621
|
+
catch (error) {
|
|
622
|
+
// Fetching everything held, one package's failure is its line; the others go on.
|
|
623
|
+
if (spec)
|
|
624
|
+
throw error;
|
|
625
|
+
failure = error.message;
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
downloaded.push(`${listed.version}${listed.withdrawn ? ` (withdrawn${listed.withdrawn_reason ? `: ${listed.withdrawn_reason}` : ''})` : ''}`);
|
|
629
|
+
}
|
|
630
|
+
const latest = index.latest
|
|
631
|
+
? `; latest ${index.latest}`
|
|
632
|
+
: '; no version that is not withdrawn';
|
|
633
|
+
const done = downloaded.length
|
|
634
|
+
? `${index.package.coordinate}: downloaded ${downloaded.join(', ')}${latest}`
|
|
635
|
+
: null;
|
|
636
|
+
if (failure)
|
|
637
|
+
lines.push(`${done ? `${done}; then ` : `${index.package.coordinate}: `}${failure}`);
|
|
638
|
+
else
|
|
639
|
+
lines.push(done ??
|
|
640
|
+
(target.version
|
|
641
|
+
? `${index.package.coordinate}@${target.version} is already held here${latest}`
|
|
642
|
+
: `${index.package.coordinate}: nothing newer to download${latest}`));
|
|
643
|
+
}
|
|
644
|
+
return lines;
|
|
645
|
+
}
|
|
646
|
+
//# sourceMappingURL=packages-browse.js.map
|