@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,726 @@
|
|
|
1
|
+
import { chmod, mkdir } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const { DatabaseSync } = require('node:sqlite');
|
|
6
|
+
const LOCAL_WORKSPACE_STORE_SCHEMA = `
|
|
7
|
+
create table if not exists local_repository (
|
|
8
|
+
singleton integer primary key check (singleton = 1),
|
|
9
|
+
repository_id text not null unique,
|
|
10
|
+
git_common_dir text not null unique,
|
|
11
|
+
schema_version integer not null check (schema_version = 1),
|
|
12
|
+
created_at text not null
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
create table if not exists local_workspace_ref (
|
|
16
|
+
ref_name text primary key,
|
|
17
|
+
head_commit_id text not null,
|
|
18
|
+
created_at text not null,
|
|
19
|
+
updated_at text not null
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
create table if not exists local_workspace (
|
|
23
|
+
id text primary key,
|
|
24
|
+
repository_id text not null,
|
|
25
|
+
source_workspace_id text references local_workspace(id),
|
|
26
|
+
actor_kind text not null check (actor_kind in ('human', 'ai')),
|
|
27
|
+
git_worktree_path text not null unique,
|
|
28
|
+
git_dir text not null unique,
|
|
29
|
+
git_common_dir text not null,
|
|
30
|
+
fork_git_commit_id text not null,
|
|
31
|
+
fork_sdlc_commit_id text not null,
|
|
32
|
+
head_sdlc_commit_id text not null,
|
|
33
|
+
attached_ref text references local_workspace_ref(ref_name),
|
|
34
|
+
status text not null check (status in ('active', 'closed')),
|
|
35
|
+
created_at text not null,
|
|
36
|
+
updated_at text not null
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
create table if not exists local_source_repository_binding (
|
|
40
|
+
git_common_dir text primary key,
|
|
41
|
+
repository_id text not null,
|
|
42
|
+
source_repository_association_id text not null,
|
|
43
|
+
remote_name text not null,
|
|
44
|
+
remote_url text not null,
|
|
45
|
+
remote_identity text not null,
|
|
46
|
+
moved_from_remote_identity text,
|
|
47
|
+
created_at text not null,
|
|
48
|
+
updated_at text not null
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
create index if not exists local_source_binding_by_association
|
|
52
|
+
on local_source_repository_binding(
|
|
53
|
+
repository_id, source_repository_association_id
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
create unique index if not exists one_workspace_per_attached_ref
|
|
57
|
+
on local_workspace(attached_ref)
|
|
58
|
+
where attached_ref is not null and status = 'active';
|
|
59
|
+
|
|
60
|
+
create index if not exists local_workspace_by_source
|
|
61
|
+
on local_workspace(source_workspace_id, created_at);
|
|
62
|
+
|
|
63
|
+
create table if not exists local_workspace_task_scope (
|
|
64
|
+
workspace_id text primary key references local_workspace(id),
|
|
65
|
+
scope_json text not null,
|
|
66
|
+
created_at text not null
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
create table if not exists local_workspace_deletion_intent (
|
|
70
|
+
workspace_id text not null references local_workspace(id),
|
|
71
|
+
entity_kind text not null
|
|
72
|
+
check (entity_kind in ('node', 'edge', 'path', 'path_relation')),
|
|
73
|
+
entity_id text not null,
|
|
74
|
+
recorded_at text not null,
|
|
75
|
+
primary key (workspace_id, entity_kind, entity_id)
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
create table if not exists local_workspace_commit (
|
|
79
|
+
id text primary key,
|
|
80
|
+
root_hash text not null,
|
|
81
|
+
parent_ids_json text not null,
|
|
82
|
+
author_workspace_id text not null references local_workspace(id),
|
|
83
|
+
message text not null,
|
|
84
|
+
validation_status text not null
|
|
85
|
+
check (validation_status in ('passed', 'failed')),
|
|
86
|
+
validation_evidence_json text not null,
|
|
87
|
+
created_at text not null
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
create index if not exists local_commit_by_author
|
|
91
|
+
on local_workspace_commit(author_workspace_id, created_at);
|
|
92
|
+
|
|
93
|
+
create table if not exists local_workspace_commit_source_context (
|
|
94
|
+
commit_id text primary key references local_workspace_commit(id),
|
|
95
|
+
source_repository_association_id text not null,
|
|
96
|
+
remote_identity text not null,
|
|
97
|
+
git_ref text,
|
|
98
|
+
git_head text not null,
|
|
99
|
+
evidence_scope_json text not null,
|
|
100
|
+
created_at text not null
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
create table if not exists portable_commit (
|
|
104
|
+
id text primary key,
|
|
105
|
+
commit_json text not null
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
create table if not exists local_commit_portable_mapping (
|
|
109
|
+
local_commit_id text primary key references local_workspace_commit(id),
|
|
110
|
+
portable_commit_id text not null references portable_commit(id),
|
|
111
|
+
attestation_json text not null
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
create index if not exists local_mapping_by_portable_commit
|
|
115
|
+
on local_commit_portable_mapping(portable_commit_id);
|
|
116
|
+
|
|
117
|
+
create table if not exists remote_tracking_ref (
|
|
118
|
+
remote_name text not null,
|
|
119
|
+
source_ref text not null,
|
|
120
|
+
tracking_ref text primary key,
|
|
121
|
+
commit_id text not null references portable_commit(id),
|
|
122
|
+
created_at text not null,
|
|
123
|
+
updated_at text not null,
|
|
124
|
+
unique (remote_name, source_ref)
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
create index if not exists remote_tracking_ref_by_remote
|
|
128
|
+
on remote_tracking_ref(remote_name, source_ref);
|
|
129
|
+
|
|
130
|
+
create table if not exists local_branch_association (
|
|
131
|
+
local_ref text primary key references local_workspace_ref(ref_name),
|
|
132
|
+
git_ref text not null unique,
|
|
133
|
+
upstream_remote_name text,
|
|
134
|
+
upstream_source_ref text,
|
|
135
|
+
upstream_tracking_ref text,
|
|
136
|
+
base_portable_commit_id text references portable_commit(id),
|
|
137
|
+
created_at text not null,
|
|
138
|
+
updated_at text not null,
|
|
139
|
+
check (
|
|
140
|
+
(upstream_remote_name is null and upstream_source_ref is null
|
|
141
|
+
and upstream_tracking_ref is null and base_portable_commit_id is null)
|
|
142
|
+
or
|
|
143
|
+
(upstream_remote_name is not null and upstream_source_ref is not null
|
|
144
|
+
and upstream_tracking_ref is not null
|
|
145
|
+
and base_portable_commit_id is not null)
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
create table if not exists remote_fetch_journal (
|
|
150
|
+
id text primary key,
|
|
151
|
+
remote_name text not null,
|
|
152
|
+
source_ref text not null,
|
|
153
|
+
tracking_ref text not null,
|
|
154
|
+
expected_old_commit_id text,
|
|
155
|
+
wanted_commit_id text not null,
|
|
156
|
+
haves_json text not null,
|
|
157
|
+
received_commit_ids_json text not null,
|
|
158
|
+
received_graph_roots_json text not null,
|
|
159
|
+
status text not null
|
|
160
|
+
check (status in ('planned', 'verified', 'completed', 'stale', 'failed')),
|
|
161
|
+
error_code text,
|
|
162
|
+
created_at text not null,
|
|
163
|
+
updated_at text not null
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
create index if not exists remote_fetch_journal_by_remote
|
|
167
|
+
on remote_fetch_journal(remote_name, created_at, id);
|
|
168
|
+
|
|
169
|
+
create table if not exists remote_push_journal (
|
|
170
|
+
id text primary key,
|
|
171
|
+
remote_name text not null,
|
|
172
|
+
destination_ref text not null,
|
|
173
|
+
expected_old_commit_id text not null,
|
|
174
|
+
new_commit_id text not null,
|
|
175
|
+
commit_ids_json text not null,
|
|
176
|
+
graph_roots_json text not null,
|
|
177
|
+
missing_commit_ids_json text not null,
|
|
178
|
+
missing_graph_roots_json text not null,
|
|
179
|
+
idempotency_key text not null unique,
|
|
180
|
+
status text not null
|
|
181
|
+
check (status in (
|
|
182
|
+
'planned', 'negotiated', 'uploaded', 'completed', 'stale',
|
|
183
|
+
'rejected', 'failed'
|
|
184
|
+
)),
|
|
185
|
+
error_code text,
|
|
186
|
+
current_remote_commit_id text,
|
|
187
|
+
created_at text not null,
|
|
188
|
+
updated_at text not null
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
create index if not exists remote_push_journal_by_remote
|
|
192
|
+
on remote_push_journal(remote_name, destination_ref, created_at, id);
|
|
193
|
+
|
|
194
|
+
create table if not exists remote_topic_branch_journal (
|
|
195
|
+
id text primary key,
|
|
196
|
+
remote_name text not null,
|
|
197
|
+
topic_ref text not null,
|
|
198
|
+
target_ref text not null,
|
|
199
|
+
expected_target_commit_id text not null,
|
|
200
|
+
new_commit_id text not null,
|
|
201
|
+
commit_ids_json text not null,
|
|
202
|
+
graph_roots_json text not null,
|
|
203
|
+
missing_commit_ids_json text not null,
|
|
204
|
+
missing_graph_roots_json text not null,
|
|
205
|
+
idempotency_key text not null unique,
|
|
206
|
+
status text not null
|
|
207
|
+
check (status in (
|
|
208
|
+
'planned', 'negotiated', 'uploaded', 'completed', 'stale',
|
|
209
|
+
'rejected', 'failed'
|
|
210
|
+
)),
|
|
211
|
+
error_code text,
|
|
212
|
+
current_target_commit_id text,
|
|
213
|
+
remote_branch_id text,
|
|
214
|
+
legacy_commit_id text,
|
|
215
|
+
created_at text not null,
|
|
216
|
+
updated_at text not null
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
create index if not exists remote_topic_branch_journal_by_remote
|
|
220
|
+
on remote_topic_branch_journal(remote_name, topic_ref, created_at, id);
|
|
221
|
+
|
|
222
|
+
create table if not exists remote_pull_request_journal (
|
|
223
|
+
id text primary key,
|
|
224
|
+
remote_name text not null,
|
|
225
|
+
source_ref text not null,
|
|
226
|
+
target_ref text not null,
|
|
227
|
+
expected_source_commit_id text not null,
|
|
228
|
+
expected_target_commit_id text not null,
|
|
229
|
+
title text not null,
|
|
230
|
+
description text,
|
|
231
|
+
idempotency_key text not null unique,
|
|
232
|
+
status text not null
|
|
233
|
+
check (status in ('planned', 'completed', 'stale', 'rejected')),
|
|
234
|
+
error_code text,
|
|
235
|
+
current_source_commit_id text,
|
|
236
|
+
current_target_commit_id text,
|
|
237
|
+
pull_request_id text,
|
|
238
|
+
created_at text not null,
|
|
239
|
+
updated_at text not null
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
create index if not exists remote_pull_request_journal_by_remote
|
|
243
|
+
on remote_pull_request_journal(remote_name, source_ref, created_at, id);
|
|
244
|
+
|
|
245
|
+
create table if not exists local_integration_queue (
|
|
246
|
+
id integer primary key autoincrement,
|
|
247
|
+
coordinator_workspace_id text not null references local_workspace(id),
|
|
248
|
+
child_workspace_id text not null references local_workspace(id),
|
|
249
|
+
child_commit_id text not null,
|
|
250
|
+
status text not null
|
|
251
|
+
check (status in (
|
|
252
|
+
'queued', 'integrated', 'blocked_conflict', 'blocked_validation'
|
|
253
|
+
)),
|
|
254
|
+
enqueued_at text not null,
|
|
255
|
+
updated_at text not null,
|
|
256
|
+
unique (coordinator_workspace_id, child_commit_id)
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
create index if not exists local_integration_queue_fifo
|
|
260
|
+
on local_integration_queue(coordinator_workspace_id, status, id);
|
|
261
|
+
|
|
262
|
+
create table if not exists local_integration_attempt (
|
|
263
|
+
id text primary key,
|
|
264
|
+
queue_entry_id integer not null references local_integration_queue(id),
|
|
265
|
+
merge_base_commit_id text not null,
|
|
266
|
+
expected_coordinator_commit_id text not null,
|
|
267
|
+
child_commit_id text not null,
|
|
268
|
+
base_root_hash text not null,
|
|
269
|
+
coordinator_root_hash text not null,
|
|
270
|
+
child_root_hash text not null,
|
|
271
|
+
candidate_commit_id text references local_workspace_commit(id),
|
|
272
|
+
status text not null
|
|
273
|
+
check (status in (
|
|
274
|
+
'integrated', 'stale_head', 'blocked_conflict', 'blocked_validation'
|
|
275
|
+
)),
|
|
276
|
+
conflict_json text not null,
|
|
277
|
+
validation_json text not null,
|
|
278
|
+
created_at text not null
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
create index if not exists local_integration_attempt_by_queue
|
|
282
|
+
on local_integration_attempt(queue_entry_id, created_at);
|
|
283
|
+
|
|
284
|
+
create table if not exists local_resolution_attempt (
|
|
285
|
+
id text primary key,
|
|
286
|
+
queue_entry_id integer not null references local_integration_queue(id),
|
|
287
|
+
attempt_number integer not null,
|
|
288
|
+
status text not null
|
|
289
|
+
check (status in (
|
|
290
|
+
'resolved', 'rejected_output', 'provider_error', 'timed_out',
|
|
291
|
+
'budget_exceeded'
|
|
292
|
+
)),
|
|
293
|
+
provider_json text not null,
|
|
294
|
+
prompt_contract_version text not null,
|
|
295
|
+
conflict_json text not null,
|
|
296
|
+
dependency_json text not null,
|
|
297
|
+
context_bytes integer not null,
|
|
298
|
+
elapsed_ms integer not null,
|
|
299
|
+
output_hash text,
|
|
300
|
+
validation_json text not null,
|
|
301
|
+
candidate_root_hash text,
|
|
302
|
+
resulting_commit_id text references local_workspace_commit(id),
|
|
303
|
+
created_at text not null
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
create index if not exists local_resolution_attempt_by_queue
|
|
307
|
+
on local_resolution_attempt(queue_entry_id, created_at, id);
|
|
308
|
+
|
|
309
|
+
create table if not exists local_reconciliation_attempt (
|
|
310
|
+
id text primary key,
|
|
311
|
+
child_workspace_id text not null references local_workspace(id),
|
|
312
|
+
source_workspace_id text not null references local_workspace(id),
|
|
313
|
+
expected_child_commit_id text not null,
|
|
314
|
+
expected_source_commit_id text not null,
|
|
315
|
+
merge_base_commit_id text not null,
|
|
316
|
+
base_root_hash text not null,
|
|
317
|
+
child_root_hash text not null,
|
|
318
|
+
source_root_hash text not null,
|
|
319
|
+
candidate_commit_id text references local_workspace_commit(id),
|
|
320
|
+
status text not null
|
|
321
|
+
check (status in (
|
|
322
|
+
'reconciled', 'stale_head', 'blocked_conflict', 'blocked_validation'
|
|
323
|
+
)),
|
|
324
|
+
conflict_json text not null,
|
|
325
|
+
validation_json text not null,
|
|
326
|
+
created_at text not null
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
create index if not exists local_reconciliation_by_child
|
|
330
|
+
on local_reconciliation_attempt(child_workspace_id, created_at);
|
|
331
|
+
|
|
332
|
+
create table if not exists local_reconciliation_resolution_attempt (
|
|
333
|
+
id text primary key,
|
|
334
|
+
reconciliation_attempt_id text not null
|
|
335
|
+
references local_reconciliation_attempt(id),
|
|
336
|
+
attempt_number integer not null,
|
|
337
|
+
status text not null
|
|
338
|
+
check (status in (
|
|
339
|
+
'resolved', 'rejected_output', 'provider_error', 'timed_out',
|
|
340
|
+
'budget_exceeded'
|
|
341
|
+
)),
|
|
342
|
+
provider_json text not null,
|
|
343
|
+
prompt_contract_version text not null,
|
|
344
|
+
conflict_json text not null,
|
|
345
|
+
dependency_json text not null,
|
|
346
|
+
context_bytes integer not null,
|
|
347
|
+
elapsed_ms integer not null,
|
|
348
|
+
output_hash text,
|
|
349
|
+
validation_json text not null,
|
|
350
|
+
candidate_root_hash text,
|
|
351
|
+
resulting_commit_id text references local_workspace_commit(id),
|
|
352
|
+
created_at text not null
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
create index if not exists local_reconciliation_resolution_by_attempt
|
|
356
|
+
on local_reconciliation_resolution_attempt(
|
|
357
|
+
reconciliation_attempt_id, created_at, id
|
|
358
|
+
);
|
|
359
|
+
|
|
360
|
+
create table if not exists local_branch_integration_attempt (
|
|
361
|
+
id text primary key,
|
|
362
|
+
workspace_id text not null references local_workspace(id),
|
|
363
|
+
local_ref text not null references local_workspace_ref(ref_name),
|
|
364
|
+
tracking_ref text not null,
|
|
365
|
+
expected_local_commit_id text not null,
|
|
366
|
+
expected_upstream_commit_id text not null,
|
|
367
|
+
merge_base_commit_id text not null,
|
|
368
|
+
base_root_hash text not null,
|
|
369
|
+
local_root_hash text not null,
|
|
370
|
+
upstream_root_hash text not null,
|
|
371
|
+
candidate_commit_id text references local_workspace_commit(id),
|
|
372
|
+
resulting_head_commit_id text,
|
|
373
|
+
status text not null
|
|
374
|
+
check (status in (
|
|
375
|
+
'already_integrated', 'fast_forwarded', 'merged', 'stale_head',
|
|
376
|
+
'blocked_conflict',
|
|
377
|
+
'blocked_validation'
|
|
378
|
+
)),
|
|
379
|
+
conflict_json text not null,
|
|
380
|
+
validation_json text not null,
|
|
381
|
+
created_at text not null
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
create index if not exists local_branch_integration_by_ref
|
|
385
|
+
on local_branch_integration_attempt(local_ref, created_at, id);
|
|
386
|
+
|
|
387
|
+
create table if not exists local_branch_integration_resolution_attempt (
|
|
388
|
+
id text primary key,
|
|
389
|
+
branch_integration_attempt_id text not null
|
|
390
|
+
references local_branch_integration_attempt(id),
|
|
391
|
+
attempt_number integer not null,
|
|
392
|
+
status text not null
|
|
393
|
+
check (status in (
|
|
394
|
+
'resolved', 'rejected_output', 'provider_error', 'timed_out',
|
|
395
|
+
'budget_exceeded'
|
|
396
|
+
)),
|
|
397
|
+
provider_json text not null,
|
|
398
|
+
prompt_contract_version text not null,
|
|
399
|
+
conflict_json text not null,
|
|
400
|
+
dependency_json text not null,
|
|
401
|
+
context_bytes integer not null,
|
|
402
|
+
elapsed_ms integer not null,
|
|
403
|
+
output_hash text,
|
|
404
|
+
validation_json text not null,
|
|
405
|
+
candidate_root_hash text,
|
|
406
|
+
resulting_commit_id text references local_workspace_commit(id),
|
|
407
|
+
created_at text not null
|
|
408
|
+
);
|
|
409
|
+
|
|
410
|
+
create index if not exists local_branch_integration_resolution_by_attempt
|
|
411
|
+
on local_branch_integration_resolution_attempt(
|
|
412
|
+
branch_integration_attempt_id, created_at, id
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
create table if not exists local_branch_integration_revert_attempt (
|
|
416
|
+
id text primary key,
|
|
417
|
+
branch_integration_attempt_id text not null
|
|
418
|
+
references local_branch_integration_attempt(id),
|
|
419
|
+
workspace_id text not null references local_workspace(id),
|
|
420
|
+
local_ref text not null references local_workspace_ref(ref_name),
|
|
421
|
+
expected_head_commit_id text not null,
|
|
422
|
+
observed_head_commit_id text not null,
|
|
423
|
+
target_commit_id text not null,
|
|
424
|
+
revert_commit_id text references local_workspace_commit(id),
|
|
425
|
+
status text not null check (status in ('reverted', 'stale_head')),
|
|
426
|
+
validation_json text not null,
|
|
427
|
+
created_at text not null
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
create index if not exists local_branch_integration_revert_by_ref
|
|
431
|
+
on local_branch_integration_revert_attempt(local_ref, created_at, id);
|
|
432
|
+
|
|
433
|
+
create unique index if not exists one_successful_branch_integration_revert
|
|
434
|
+
on local_branch_integration_revert_attempt(branch_integration_attempt_id)
|
|
435
|
+
where status = 'reverted';
|
|
436
|
+
|
|
437
|
+
create table if not exists local_handoff (
|
|
438
|
+
id text primary key,
|
|
439
|
+
source_workspace_id text not null references local_workspace(id),
|
|
440
|
+
source_commit_id text not null,
|
|
441
|
+
child_workspace_id text not null references local_workspace(id),
|
|
442
|
+
child_commit_id text not null references local_workspace_commit(id),
|
|
443
|
+
created_at text not null,
|
|
444
|
+
unique (
|
|
445
|
+
source_workspace_id, source_commit_id,
|
|
446
|
+
child_workspace_id, child_commit_id
|
|
447
|
+
)
|
|
448
|
+
);
|
|
449
|
+
|
|
450
|
+
create table if not exists local_handoff_attempt (
|
|
451
|
+
id text primary key,
|
|
452
|
+
handoff_id text not null references local_handoff(id),
|
|
453
|
+
status text not null check (status in ('applied', 'stale_base')),
|
|
454
|
+
observed_source_commit_id text not null,
|
|
455
|
+
observed_child_commit_id text not null,
|
|
456
|
+
created_at text not null
|
|
457
|
+
);
|
|
458
|
+
|
|
459
|
+
create unique index if not exists one_applied_handoff
|
|
460
|
+
on local_handoff_attempt(handoff_id)
|
|
461
|
+
where status = 'applied';
|
|
462
|
+
|
|
463
|
+
create table if not exists graph_decision (
|
|
464
|
+
id text primary key,
|
|
465
|
+
coordinator_workspace_id text not null references local_workspace(id),
|
|
466
|
+
base_commit_id text not null,
|
|
467
|
+
question text not null,
|
|
468
|
+
criteria_json text not null,
|
|
469
|
+
evaluations_json text not null,
|
|
470
|
+
decider text not null,
|
|
471
|
+
status text not null
|
|
472
|
+
check (status in ('open', 'selected', 'landed', 'closed', 'abandoned')),
|
|
473
|
+
reason text,
|
|
474
|
+
landed_commit_id text,
|
|
475
|
+
created_at text not null,
|
|
476
|
+
updated_at text not null
|
|
477
|
+
);
|
|
478
|
+
|
|
479
|
+
create table if not exists decision_candidate (
|
|
480
|
+
decision_id text not null references graph_decision(id),
|
|
481
|
+
workspace_id text not null references local_workspace(id),
|
|
482
|
+
label text,
|
|
483
|
+
base_commit_id text not null,
|
|
484
|
+
status text not null
|
|
485
|
+
check (status in (
|
|
486
|
+
'candidate', 'selected', 'rejected', 'abandoned', 'detached',
|
|
487
|
+
'superseded'
|
|
488
|
+
)),
|
|
489
|
+
reason text,
|
|
490
|
+
attached_at text not null,
|
|
491
|
+
updated_at text not null,
|
|
492
|
+
primary key (decision_id, workspace_id)
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
create index if not exists decision_candidate_by_workspace
|
|
496
|
+
on decision_candidate(workspace_id, status);
|
|
497
|
+
|
|
498
|
+
create table if not exists decision_selection (
|
|
499
|
+
id text primary key,
|
|
500
|
+
decision_id text not null references graph_decision(id),
|
|
501
|
+
digest text not null,
|
|
502
|
+
winner_workspace_id text not null references local_workspace(id),
|
|
503
|
+
parts_json text not null,
|
|
504
|
+
reason text not null,
|
|
505
|
+
status text not null check (status in ('current', 'superseded')),
|
|
506
|
+
superseded_reason text,
|
|
507
|
+
created_at text not null
|
|
508
|
+
);
|
|
509
|
+
|
|
510
|
+
create unique index if not exists one_current_decision_selection
|
|
511
|
+
on decision_selection(decision_id)
|
|
512
|
+
where status = 'current';
|
|
513
|
+
|
|
514
|
+
create table if not exists local_pick_receipt (
|
|
515
|
+
id text primary key,
|
|
516
|
+
target_workspace_id text not null references local_workspace(id),
|
|
517
|
+
target_commit_before text not null,
|
|
518
|
+
target_commit_after text not null unique,
|
|
519
|
+
source_workspace_id text not null references local_workspace(id),
|
|
520
|
+
source_commit_id text not null,
|
|
521
|
+
merge_base_commit_id text not null,
|
|
522
|
+
selection_hash text not null,
|
|
523
|
+
result_root_hash text not null,
|
|
524
|
+
picked_json text not null,
|
|
525
|
+
dependency_additions_json text not null,
|
|
526
|
+
skipped_json text not null,
|
|
527
|
+
created_at text not null
|
|
528
|
+
);
|
|
529
|
+
|
|
530
|
+
create index if not exists local_pick_receipt_by_target
|
|
531
|
+
on local_pick_receipt(target_workspace_id, created_at);
|
|
532
|
+
|
|
533
|
+
create table if not exists local_integration_queue_gate (
|
|
534
|
+
queue_entry_id integer primary key
|
|
535
|
+
references local_integration_queue(id),
|
|
536
|
+
gate text not null check (gate in ('plan', 'design'))
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
create table if not exists local_workspace_pending_claim (
|
|
540
|
+
coordinator_workspace_id text not null references local_workspace(id),
|
|
541
|
+
entity_kind text not null
|
|
542
|
+
check (entity_kind in ('node', 'edge', 'path', 'path_relation')),
|
|
543
|
+
entity_id text not null,
|
|
544
|
+
work_stream_workspace_id text not null references local_workspace(id),
|
|
545
|
+
gate text not null check (gate in ('plan', 'design')),
|
|
546
|
+
change text not null check (change in ('added', 'changed', 'removal')),
|
|
547
|
+
built_commit_id text,
|
|
548
|
+
gate_commit_id text not null,
|
|
549
|
+
recorded_at text not null,
|
|
550
|
+
built_content text,
|
|
551
|
+
built_content_commit_id text,
|
|
552
|
+
gate_content text,
|
|
553
|
+
gate_content_commit_id text,
|
|
554
|
+
primary key (
|
|
555
|
+
coordinator_workspace_id, entity_kind, entity_id,
|
|
556
|
+
work_stream_workspace_id
|
|
557
|
+
)
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
create table if not exists local_vocabulary_admission (
|
|
561
|
+
singleton integer primary key check (singleton = 1),
|
|
562
|
+
origin text not null,
|
|
563
|
+
capabilities_json text not null,
|
|
564
|
+
evidence text not null,
|
|
565
|
+
recorded_at text not null
|
|
566
|
+
);
|
|
567
|
+
|
|
568
|
+
-- A local org (org-structure-and-access.md, Local org without an org
|
|
569
|
+
-- connection): its governance graph is an object in objects/ named here, and
|
|
570
|
+
-- who holds each post is live data beside it.
|
|
571
|
+
create table if not exists local_governance_graph (
|
|
572
|
+
org_id text primary key,
|
|
573
|
+
root_hash text not null,
|
|
574
|
+
updated_at text not null
|
|
575
|
+
);
|
|
576
|
+
|
|
577
|
+
create table if not exists local_org_post_holder (
|
|
578
|
+
org_id text not null references local_governance_graph(org_id),
|
|
579
|
+
post_id text not null,
|
|
580
|
+
member_kind text not null check (member_kind in ('person', 'agent')),
|
|
581
|
+
member_id text not null,
|
|
582
|
+
held_since text not null,
|
|
583
|
+
primary key (org_id, post_id, member_kind, member_id)
|
|
584
|
+
);
|
|
585
|
+
|
|
586
|
+
-- The repository is its local org's one project (osa-slots): the team that
|
|
587
|
+
-- owns it, and its hand-set slot bindings, one row per post an override
|
|
588
|
+
-- names. Slot and post ids are the governance graph's node ids.
|
|
589
|
+
create table if not exists local_org_project (
|
|
590
|
+
org_id text primary key references local_governance_graph(org_id),
|
|
591
|
+
team_id text not null,
|
|
592
|
+
set_at text not null
|
|
593
|
+
);
|
|
594
|
+
|
|
595
|
+
create table if not exists local_org_slot_binding (
|
|
596
|
+
org_id text not null references local_governance_graph(org_id),
|
|
597
|
+
slot_id text not null,
|
|
598
|
+
post_id text not null,
|
|
599
|
+
reason text not null,
|
|
600
|
+
set_by_kind text not null check (set_by_kind in ('person', 'agent')),
|
|
601
|
+
set_by_id text not null,
|
|
602
|
+
set_at text not null,
|
|
603
|
+
primary key (org_id, slot_id, post_id)
|
|
604
|
+
);
|
|
605
|
+
`;
|
|
606
|
+
/**
|
|
607
|
+
* Stores made before pending claims kept their content gain the columns
|
|
608
|
+
* empty; sdlc integrate fills them (workspace-built-content.ts). Each content
|
|
609
|
+
* column has a column naming the commit it was read at.
|
|
610
|
+
*/
|
|
611
|
+
function addPendingClaimContent(database) {
|
|
612
|
+
const missing = () => {
|
|
613
|
+
const columns = new Set(database
|
|
614
|
+
.prepare("pragma table_info('local_workspace_pending_claim')")
|
|
615
|
+
.all().map((column) => column.name));
|
|
616
|
+
return [
|
|
617
|
+
'built_content',
|
|
618
|
+
'built_content_commit_id',
|
|
619
|
+
'gate_content',
|
|
620
|
+
'gate_content_commit_id'
|
|
621
|
+
].filter((column) => !columns.has(column));
|
|
622
|
+
};
|
|
623
|
+
if (missing().length === 0)
|
|
624
|
+
return;
|
|
625
|
+
// Another process may add them first: check again under the write lock.
|
|
626
|
+
database.exec('begin immediate');
|
|
627
|
+
try {
|
|
628
|
+
for (const column of missing()) {
|
|
629
|
+
database.exec(`alter table local_workspace_pending_claim add column ${column} text`);
|
|
630
|
+
}
|
|
631
|
+
database.exec('commit');
|
|
632
|
+
}
|
|
633
|
+
catch (error) {
|
|
634
|
+
database.exec('rollback');
|
|
635
|
+
throw error;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Stores made before a binding could move remotes gain the identity it moved
|
|
640
|
+
* from, empty (workspace-topology.ts topologyBindingMatch).
|
|
641
|
+
*/
|
|
642
|
+
function addBindingMovedFrom(database) {
|
|
643
|
+
const missing = () => !database
|
|
644
|
+
.prepare("pragma table_info('local_source_repository_binding')")
|
|
645
|
+
.all().some((column) => column.name === 'moved_from_remote_identity');
|
|
646
|
+
if (!missing())
|
|
647
|
+
return;
|
|
648
|
+
// Another process may add it first: check again under the write lock.
|
|
649
|
+
database.exec('begin immediate');
|
|
650
|
+
try {
|
|
651
|
+
if (missing()) {
|
|
652
|
+
database.exec('alter table local_source_repository_binding add column moved_from_remote_identity text');
|
|
653
|
+
}
|
|
654
|
+
database.exec('commit');
|
|
655
|
+
}
|
|
656
|
+
catch (error) {
|
|
657
|
+
database.exec('rollback');
|
|
658
|
+
throw error;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function migratePortableHandoffEndpoints(database) {
|
|
662
|
+
const foreign_keys = database
|
|
663
|
+
.prepare("pragma foreign_key_list('local_handoff')")
|
|
664
|
+
.all();
|
|
665
|
+
if (!foreign_keys.some((entry) => entry.table === 'local_workspace_commit' &&
|
|
666
|
+
entry.from === 'child_commit_id')) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
database.exec('pragma foreign_keys = off; begin immediate;');
|
|
670
|
+
try {
|
|
671
|
+
database.exec(`
|
|
672
|
+
drop index if exists one_applied_handoff;
|
|
673
|
+
alter table local_handoff_attempt rename to local_handoff_attempt_legacy;
|
|
674
|
+
alter table local_handoff rename to local_handoff_legacy;
|
|
675
|
+
create table local_handoff (
|
|
676
|
+
id text primary key,
|
|
677
|
+
source_workspace_id text not null references local_workspace(id),
|
|
678
|
+
source_commit_id text not null,
|
|
679
|
+
child_workspace_id text not null references local_workspace(id),
|
|
680
|
+
child_commit_id text not null,
|
|
681
|
+
created_at text not null,
|
|
682
|
+
unique (
|
|
683
|
+
source_workspace_id, source_commit_id,
|
|
684
|
+
child_workspace_id, child_commit_id
|
|
685
|
+
)
|
|
686
|
+
);
|
|
687
|
+
create table local_handoff_attempt (
|
|
688
|
+
id text primary key,
|
|
689
|
+
handoff_id text not null references local_handoff(id),
|
|
690
|
+
status text not null check (status in ('applied', 'stale_base')),
|
|
691
|
+
observed_source_commit_id text not null,
|
|
692
|
+
observed_child_commit_id text not null,
|
|
693
|
+
created_at text not null
|
|
694
|
+
);
|
|
695
|
+
insert into local_handoff select * from local_handoff_legacy;
|
|
696
|
+
insert into local_handoff_attempt select * from local_handoff_attempt_legacy;
|
|
697
|
+
drop table local_handoff_attempt_legacy;
|
|
698
|
+
drop table local_handoff_legacy;
|
|
699
|
+
create unique index one_applied_handoff
|
|
700
|
+
on local_handoff_attempt(handoff_id)
|
|
701
|
+
where status = 'applied';
|
|
702
|
+
commit;
|
|
703
|
+
`);
|
|
704
|
+
}
|
|
705
|
+
catch (error) {
|
|
706
|
+
database.exec('rollback;');
|
|
707
|
+
throw error;
|
|
708
|
+
}
|
|
709
|
+
finally {
|
|
710
|
+
database.exec('pragma foreign_keys = on;');
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
export async function openLocalWorkspaceStoreDatabase(state_dir) {
|
|
714
|
+
await mkdir(state_dir, { recursive: true, mode: 0o700 });
|
|
715
|
+
await chmod(state_dir, 0o700);
|
|
716
|
+
const database_path = join(state_dir, 'repository.sqlite');
|
|
717
|
+
const database = new DatabaseSync(database_path);
|
|
718
|
+
await chmod(database_path, 0o600);
|
|
719
|
+
database.exec('PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON; PRAGMA busy_timeout = 5000;');
|
|
720
|
+
database.exec(LOCAL_WORKSPACE_STORE_SCHEMA);
|
|
721
|
+
migratePortableHandoffEndpoints(database);
|
|
722
|
+
addPendingClaimContent(database);
|
|
723
|
+
addBindingMovedFrom(database);
|
|
724
|
+
return database;
|
|
725
|
+
}
|
|
726
|
+
//# sourceMappingURL=workspace-store-database.js.map
|