@proletariat/cli 0.3.93 → 0.3.95
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/dist/commands/action/create.d.ts +1 -1
- package/dist/commands/action/delete.d.ts +1 -1
- package/dist/commands/action/index.d.ts +1 -1
- package/dist/commands/action/list.d.ts +1 -1
- package/dist/commands/action/run.d.ts +1 -1
- package/dist/commands/action/show.d.ts +1 -1
- package/dist/commands/action/update.d.ts +1 -1
- package/dist/commands/agent/cleanup.d.ts +3 -4
- package/dist/commands/agent/cleanup.js +5 -4
- package/dist/commands/agent/cleanup.js.map +1 -1
- package/dist/commands/agent/gc.d.ts +3 -4
- package/dist/commands/agent/gc.js +5 -4
- package/dist/commands/agent/gc.js.map +1 -1
- package/dist/commands/agent/index.d.ts +3 -4
- package/dist/commands/agent/index.js +5 -4
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/agent/list.d.ts +3 -4
- package/dist/commands/agent/list.js +5 -4
- package/dist/commands/agent/list.js.map +1 -1
- package/dist/commands/agent/login.d.ts +1 -1
- package/dist/commands/agent/rebuild.d.ts +1 -1
- package/dist/commands/agent/remove.d.ts +3 -4
- package/dist/commands/agent/remove.js +5 -4
- package/dist/commands/agent/remove.js.map +1 -1
- package/dist/commands/agent/restart.d.ts +1 -1
- package/dist/commands/agent/shell.d.ts +1 -1
- package/dist/commands/agent/staff/index.d.ts +3 -4
- package/dist/commands/agent/staff/index.js +5 -4
- package/dist/commands/agent/staff/index.js.map +1 -1
- package/dist/commands/agent/staff/remove.d.ts +3 -4
- package/dist/commands/agent/staff/remove.js +5 -4
- package/dist/commands/agent/staff/remove.js.map +1 -1
- package/dist/commands/agent/status.d.ts +3 -4
- package/dist/commands/agent/status.js +5 -4
- package/dist/commands/agent/status.js.map +1 -1
- package/dist/commands/agent/visit.d.ts +3 -4
- package/dist/commands/agent/visit.js +5 -4
- package/dist/commands/agent/visit.js.map +1 -1
- package/dist/commands/asana/import.d.ts +1 -1
- package/dist/commands/branch/create.d.ts +1 -1
- package/dist/commands/branch/create.js +1 -12
- package/dist/commands/branch/create.js.map +1 -1
- package/dist/commands/branch/index.d.ts +1 -1
- package/dist/commands/branch/list.d.ts +3 -4
- package/dist/commands/branch/list.js +5 -4
- package/dist/commands/branch/list.js.map +1 -1
- package/dist/commands/branch/validate.d.ts +3 -4
- package/dist/commands/branch/validate.js +6 -5
- package/dist/commands/branch/validate.js.map +1 -1
- package/dist/commands/branch/where.d.ts +3 -4
- package/dist/commands/branch/where.js +5 -4
- package/dist/commands/branch/where.js.map +1 -1
- package/dist/commands/commit.js +1 -1
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/index.js.map +1 -1
- package/dist/commands/db/backup.d.ts +16 -0
- package/dist/commands/db/backup.js +125 -0
- package/dist/commands/db/backup.js.map +1 -0
- package/dist/commands/db/repair.js +8 -11
- package/dist/commands/db/repair.js.map +1 -1
- package/dist/commands/diet.d.ts +1 -1
- package/dist/commands/docker/index.js +2 -0
- package/dist/commands/docker/index.js.map +1 -1
- package/dist/commands/docker/rebuild-cache.d.ts +12 -0
- package/dist/commands/docker/rebuild-cache.js +144 -0
- package/dist/commands/docker/rebuild-cache.js.map +1 -0
- package/dist/commands/execution/config.d.ts +3 -4
- package/dist/commands/execution/config.js +5 -4
- package/dist/commands/execution/config.js.map +1 -1
- package/dist/commands/execution/index.d.ts +3 -4
- package/dist/commands/execution/index.js +5 -4
- package/dist/commands/execution/index.js.map +1 -1
- package/dist/commands/execution/list.d.ts +3 -4
- package/dist/commands/execution/list.js +5 -4
- package/dist/commands/execution/list.js.map +1 -1
- package/dist/commands/execution/logs.d.ts +3 -4
- package/dist/commands/execution/logs.js +5 -4
- package/dist/commands/execution/logs.js.map +1 -1
- package/dist/commands/execution/stop.d.ts +3 -4
- package/dist/commands/execution/stop.js +5 -4
- package/dist/commands/execution/stop.js.map +1 -1
- package/dist/commands/execution/view.d.ts +3 -4
- package/dist/commands/execution/view.js +5 -4
- package/dist/commands/execution/view.js.map +1 -1
- package/dist/commands/hook/export.d.ts +3 -4
- package/dist/commands/hook/export.js +5 -4
- package/dist/commands/hook/export.js.map +1 -1
- package/dist/commands/hook/fire.d.ts +3 -4
- package/dist/commands/hook/fire.js +5 -4
- package/dist/commands/hook/fire.js.map +1 -1
- package/dist/commands/hook/index.d.ts +1 -1
- package/dist/commands/hook/list.d.ts +3 -4
- package/dist/commands/hook/list.js +5 -4
- package/dist/commands/hook/list.js.map +1 -1
- package/dist/commands/hook/preset.d.ts +3 -4
- package/dist/commands/hook/preset.js +5 -4
- package/dist/commands/hook/preset.js.map +1 -1
- package/dist/commands/linear/auth.d.ts +1 -1
- package/dist/commands/linear/connect.d.ts +1 -1
- package/dist/commands/linear/import.d.ts +1 -1
- package/dist/commands/linear/status.d.ts +1 -1
- package/dist/commands/linear/sync.d.ts +1 -1
- package/dist/commands/mcp-server.d.ts +8 -2
- package/dist/commands/mcp-server.js +15 -28
- package/dist/commands/mcp-server.js.map +1 -1
- package/dist/commands/monday/connect.d.ts +1 -1
- package/dist/commands/monday/sync.d.ts +1 -1
- package/dist/commands/orchestrate/index.d.ts +3 -4
- package/dist/commands/orchestrate/index.js +5 -4
- package/dist/commands/orchestrate/index.js.map +1 -1
- package/dist/commands/orchestrator/index.d.ts +3 -4
- package/dist/commands/orchestrator/index.js +5 -4
- package/dist/commands/orchestrator/index.js.map +1 -1
- package/dist/commands/orchestrator/start.d.ts +3 -3
- package/dist/commands/orchestrator/start.js +38 -40
- package/dist/commands/orchestrator/start.js.map +1 -1
- package/dist/commands/pr/checks.d.ts +3 -4
- package/dist/commands/pr/checks.js +5 -4
- package/dist/commands/pr/checks.js.map +1 -1
- package/dist/commands/pr/close.d.ts +1 -1
- package/dist/commands/pr/create.d.ts +1 -1
- package/dist/commands/pr/index.d.ts +1 -1
- package/dist/commands/pr/link.d.ts +1 -1
- package/dist/commands/pr/list.d.ts +1 -1
- package/dist/commands/pr/merge.d.ts +1 -1
- package/dist/commands/pr/status.d.ts +1 -1
- package/dist/commands/pull.d.ts +1 -1
- package/dist/commands/repo/add.d.ts +3 -4
- package/dist/commands/repo/add.js +5 -4
- package/dist/commands/repo/add.js.map +1 -1
- package/dist/commands/repo/create.d.ts +3 -4
- package/dist/commands/repo/create.js +5 -4
- package/dist/commands/repo/create.js.map +1 -1
- package/dist/commands/repo/fix-remotes.d.ts +3 -4
- package/dist/commands/repo/fix-remotes.js +5 -4
- package/dist/commands/repo/fix-remotes.js.map +1 -1
- package/dist/commands/repo/index.d.ts +3 -4
- package/dist/commands/repo/index.js +5 -4
- package/dist/commands/repo/index.js.map +1 -1
- package/dist/commands/repo/list.d.ts +3 -4
- package/dist/commands/repo/list.js +5 -4
- package/dist/commands/repo/list.js.map +1 -1
- package/dist/commands/repo/remove.d.ts +1 -1
- package/dist/commands/repo/view.d.ts +1 -1
- package/dist/commands/session/attach.d.ts +1 -1
- package/dist/commands/session/cleanup.d.ts +3 -4
- package/dist/commands/session/cleanup.js +5 -4
- package/dist/commands/session/cleanup.js.map +1 -1
- package/dist/commands/session/create.d.ts +3 -4
- package/dist/commands/session/create.js +5 -4
- package/dist/commands/session/create.js.map +1 -1
- package/dist/commands/session/exec.d.ts +3 -4
- package/dist/commands/session/exec.js +5 -4
- package/dist/commands/session/exec.js.map +1 -1
- package/dist/commands/session/health.d.ts +1 -1
- package/dist/commands/session/health.js +18 -0
- package/dist/commands/session/health.js.map +1 -1
- package/dist/commands/session/index.d.ts +3 -4
- package/dist/commands/session/index.js +9 -4
- package/dist/commands/session/index.js.map +1 -1
- package/dist/commands/session/inspect.d.ts +3 -4
- package/dist/commands/session/inspect.js +5 -4
- package/dist/commands/session/inspect.js.map +1 -1
- package/dist/commands/session/list.d.ts +3 -4
- package/dist/commands/session/list.js +19 -5
- package/dist/commands/session/list.js.map +1 -1
- package/dist/commands/session/peek.d.ts +1 -1
- package/dist/commands/session/prune.d.ts +3 -4
- package/dist/commands/session/prune.js +5 -4
- package/dist/commands/session/prune.js.map +1 -1
- package/dist/commands/session/report.d.ts +25 -5
- package/dist/commands/session/report.js +201 -5
- package/dist/commands/session/report.js.map +1 -1
- package/dist/commands/session/restart.d.ts +3 -4
- package/dist/commands/session/restart.js +5 -4
- package/dist/commands/session/restart.js.map +1 -1
- package/dist/commands/session/watch.d.ts +17 -0
- package/dist/commands/session/watch.js +139 -0
- package/dist/commands/session/watch.js.map +1 -0
- package/dist/commands/shortcut/connect.d.ts +1 -1
- package/dist/commands/support/logs.d.ts +1 -1
- package/dist/commands/ticket/create.d.ts +1 -1
- package/dist/commands/ticket/delete.d.ts +1 -1
- package/dist/commands/ticket/edit.d.ts +1 -1
- package/dist/commands/ticket/index.d.ts +3 -4
- package/dist/commands/ticket/index.js +11 -40
- package/dist/commands/ticket/index.js.map +1 -1
- package/dist/commands/ticket/list.d.ts +1 -1
- package/dist/commands/ticket/move.d.ts +1 -1
- package/dist/commands/ticket/show.d.ts +8 -7
- package/dist/commands/ticket/show.js +101 -8
- package/dist/commands/ticket/show.js.map +1 -1
- package/dist/commands/ticket/update.d.ts +1 -1
- package/dist/commands/trello/configure.d.ts +1 -1
- package/dist/commands/trello/import.d.ts +1 -1
- package/dist/commands/trello/sync.d.ts +1 -1
- package/dist/commands/{dashboard/index.d.ts → web.d.ts} +10 -4
- package/dist/commands/web.js +82 -0
- package/dist/commands/web.js.map +1 -0
- package/dist/commands/work/asana.d.ts +1 -1
- package/dist/commands/work/complete.d.ts +1 -1
- package/dist/commands/work/groom.d.ts +1 -1
- package/dist/commands/work/hooks/add.d.ts +3 -4
- package/dist/commands/work/hooks/add.js +5 -4
- package/dist/commands/work/hooks/add.js.map +1 -1
- package/dist/commands/work/hooks/index.d.ts +1 -1
- package/dist/commands/work/hooks/list.d.ts +3 -4
- package/dist/commands/work/hooks/list.js +5 -4
- package/dist/commands/work/hooks/list.js.map +1 -1
- package/dist/commands/work/hooks/remove.d.ts +1 -1
- package/dist/commands/work/hooks/toggle.d.ts +3 -4
- package/dist/commands/work/hooks/toggle.js +5 -4
- package/dist/commands/work/hooks/toggle.js.map +1 -1
- package/dist/commands/work/implement.d.ts +1 -1
- package/dist/commands/work/index.d.ts +1 -1
- package/dist/commands/work/jira.d.ts +1 -1
- package/dist/commands/work/linear.d.ts +1 -1
- package/dist/commands/work/peek.d.ts +3 -4
- package/dist/commands/work/peek.js +5 -4
- package/dist/commands/work/peek.js.map +1 -1
- package/dist/commands/{ticket/cancel.d.ts → work/propose.d.ts} +11 -5
- package/dist/commands/work/propose.js +57 -0
- package/dist/commands/work/propose.js.map +1 -0
- package/dist/commands/work/ready.d.ts +1 -1
- package/dist/commands/work/ready.js +2 -2
- package/dist/commands/work/ready.js.map +1 -1
- package/dist/commands/work/rebase.d.ts +2 -2
- package/dist/commands/work/rebase.js +52 -49
- package/dist/commands/work/rebase.js.map +1 -1
- package/dist/commands/work/resolve.d.ts +1 -1
- package/dist/commands/work/review.d.ts +1 -1
- package/dist/commands/work/ship.d.ts +7 -1
- package/dist/commands/work/ship.js +217 -48
- package/dist/commands/work/ship.js.map +1 -1
- package/dist/commands/work/shortcut.d.ts +1 -1
- package/dist/commands/work/source/set.d.ts +1 -1
- package/dist/commands/work/source.d.ts +1 -1
- package/dist/commands/work/spawn.d.ts +1 -1
- package/dist/commands/work/start.d.ts +1 -1
- package/dist/commands/work/start.js +3 -6
- package/dist/commands/work/start.js.map +1 -1
- package/dist/commands/work/status.d.ts +1 -1
- package/dist/commands/work/stop.d.ts +3 -4
- package/dist/commands/work/stop.js +5 -4
- package/dist/commands/work/stop.js.map +1 -1
- package/dist/commands/work/watch.d.ts +1 -1
- package/dist/hooks/init.js +12 -2
- package/dist/hooks/init.js.map +1 -1
- package/dist/lib/asana/config.js +13 -7
- package/dist/lib/asana/config.js.map +1 -1
- package/dist/lib/branch/index.d.ts +6 -5
- package/dist/lib/branch/index.js +8 -13
- package/dist/lib/branch/index.js.map +1 -1
- package/dist/lib/clickup/client.d.ts +92 -0
- package/dist/lib/clickup/client.js +150 -0
- package/dist/lib/clickup/client.js.map +1 -0
- package/dist/lib/clickup/config.d.ts +41 -0
- package/dist/lib/clickup/config.js +104 -0
- package/dist/lib/clickup/config.js.map +1 -0
- package/dist/lib/clickup/index.d.ts +4 -0
- package/dist/lib/clickup/index.js +4 -0
- package/dist/lib/clickup/index.js.map +1 -0
- package/dist/lib/clickup/types.d.ts +104 -0
- package/dist/lib/clickup/types.js +34 -0
- package/dist/lib/clickup/types.js.map +1 -0
- package/dist/lib/dashboard/html.d.ts +2 -1
- package/dist/lib/dashboard/html.js +150 -522
- package/dist/lib/dashboard/html.js.map +1 -1
- package/dist/lib/database/credential-store.d.ts +64 -0
- package/dist/lib/database/credential-store.js +306 -0
- package/dist/lib/database/credential-store.js.map +1 -0
- package/dist/lib/database/db-safety.d.ts +48 -9
- package/dist/lib/database/db-safety.js +308 -43
- package/dist/lib/database/db-safety.js.map +1 -1
- package/dist/lib/database/index.d.ts +2 -1
- package/dist/lib/database/index.js +3 -1
- package/dist/lib/database/index.js.map +1 -1
- package/dist/lib/database/pmo-bootstrap.d.ts +7 -0
- package/dist/lib/database/pmo-bootstrap.js +45 -20
- package/dist/lib/database/pmo-bootstrap.js.map +1 -1
- package/dist/lib/database/workspace.js +7 -1
- package/dist/lib/database/workspace.js.map +1 -1
- package/dist/lib/execution/devcontainer.js +51 -0
- package/dist/lib/execution/devcontainer.js.map +1 -1
- package/dist/lib/execution/runners/docker-management.d.ts +23 -0
- package/dist/lib/execution/runners/docker-management.js +99 -7
- package/dist/lib/execution/runners/docker-management.js.map +1 -1
- package/dist/lib/execution/runners/docker.js +8 -0
- package/dist/lib/execution/runners/docker.js.map +1 -1
- package/dist/lib/execution/runners/prompt-builder.js +9 -6
- package/dist/lib/execution/runners/prompt-builder.js.map +1 -1
- package/dist/lib/execution/session-utils.d.ts +4 -0
- package/dist/lib/execution/session-utils.js +34 -24
- package/dist/lib/execution/session-utils.js.map +1 -1
- package/dist/lib/execution/spawner.js +2 -4
- package/dist/lib/execution/spawner.js.map +1 -1
- package/dist/lib/execution/storage.d.ts +29 -1
- package/dist/lib/execution/storage.js +77 -0
- package/dist/lib/execution/storage.js.map +1 -1
- package/dist/lib/execution/types.d.ts +17 -6
- package/dist/lib/execution/types.js +11 -8
- package/dist/lib/execution/types.js.map +1 -1
- package/dist/lib/external-issues/types.d.ts +3 -3
- package/dist/lib/external-issues/types.js +1 -1
- package/dist/lib/external-issues/types.js.map +1 -1
- package/dist/lib/jira/config.js +10 -4
- package/dist/lib/jira/config.js.map +1 -1
- package/dist/lib/linear/config.js +13 -8
- package/dist/lib/linear/config.js.map +1 -1
- package/dist/lib/machine-config.d.ts +8 -0
- package/dist/lib/machine-config.js +37 -0
- package/dist/lib/machine-config.js.map +1 -1
- package/dist/lib/mcp/generator.d.ts +26 -0
- package/dist/lib/mcp/generator.js +219 -0
- package/dist/lib/mcp/generator.js.map +1 -0
- package/dist/lib/mcp/index.d.ts +1 -0
- package/dist/lib/mcp/index.js +1 -0
- package/dist/lib/mcp/index.js.map +1 -1
- package/dist/lib/mcp/tools/index.d.ts +0 -11
- package/dist/lib/mcp/tools/index.js +0 -11
- package/dist/lib/mcp/tools/index.js.map +1 -1
- package/dist/lib/mcp/tools/overrides/index.d.ts +23 -0
- package/dist/lib/mcp/tools/overrides/index.js +30 -0
- package/dist/lib/mcp/tools/overrides/index.js.map +1 -0
- package/dist/lib/mcp/tools/overrides/tmux.d.ts +11 -0
- package/dist/lib/mcp/tools/overrides/tmux.js +184 -0
- package/dist/lib/mcp/tools/overrides/tmux.js.map +1 -0
- package/dist/lib/mcp/tools/overrides/work-start.d.ts +12 -0
- package/dist/lib/mcp/tools/overrides/work-start.js +108 -0
- package/dist/lib/mcp/tools/overrides/work-start.js.map +1 -0
- package/dist/lib/mcp/tools/ticket.js +10 -48
- package/dist/lib/mcp/tools/ticket.js.map +1 -1
- package/dist/lib/monday/config.js +11 -5
- package/dist/lib/monday/config.js.map +1 -1
- package/dist/lib/orchestrate/poller.d.ts +1 -1
- package/dist/lib/orchestrate/poller.js +1 -1
- package/dist/lib/pmo/base-command.d.ts +20 -152
- package/dist/lib/pmo/base-command.js +32 -198
- package/dist/lib/pmo/base-command.js.map +1 -1
- package/dist/lib/pmo/index.d.ts +1 -0
- package/dist/lib/pmo/index.js +3 -0
- package/dist/lib/pmo/index.js.map +1 -1
- package/dist/lib/pmo/storage/base.d.ts +0 -18
- package/dist/lib/pmo/storage/base.js +5 -234
- package/dist/lib/pmo/storage/base.js.map +1 -1
- package/dist/lib/pmo/storage/index.d.ts +1 -76
- package/dist/lib/pmo/storage/index.js +1 -215
- package/dist/lib/pmo/storage/index.js.map +1 -1
- package/dist/lib/pmo/storage/tickets.d.ts +2 -2
- package/dist/lib/pmo/storage/tickets.js +4 -34
- package/dist/lib/pmo/storage/tickets.js.map +1 -1
- package/dist/lib/pmo/types.d.ts +0 -37
- package/dist/lib/providers/clickup-provider.d.ts +28 -0
- package/dist/lib/providers/clickup-provider.js +353 -0
- package/dist/lib/providers/clickup-provider.js.map +1 -0
- package/dist/lib/providers/index.d.ts +1 -0
- package/dist/lib/providers/index.js +1 -0
- package/dist/lib/providers/index.js.map +1 -1
- package/dist/lib/providers/resolver.d.ts +1 -1
- package/dist/lib/providers/resolver.js +32 -5
- package/dist/lib/providers/resolver.js.map +1 -1
- package/dist/lib/providers/trello-provider.d.ts +28 -0
- package/dist/lib/providers/trello-provider.js +381 -0
- package/dist/lib/providers/trello-provider.js.map +1 -0
- package/dist/lib/providers/types.d.ts +1 -1
- package/dist/lib/runners/claude-code-runner.js +13 -4
- package/dist/lib/runners/claude-code-runner.js.map +1 -1
- package/dist/lib/runtime-command.d.ts +219 -0
- package/dist/lib/runtime-command.js +320 -0
- package/dist/lib/runtime-command.js.map +1 -0
- package/dist/lib/session/heartbeat.d.ts +45 -0
- package/dist/lib/session/heartbeat.js +150 -0
- package/dist/lib/session/heartbeat.js.map +1 -0
- package/dist/lib/session/index.d.ts +7 -0
- package/dist/lib/session/index.js +8 -0
- package/dist/lib/session/index.js.map +1 -0
- package/dist/lib/session/watcher.d.ts +79 -0
- package/dist/lib/session/watcher.js +142 -0
- package/dist/lib/session/watcher.js.map +1 -0
- package/dist/lib/shipping/auto-merge.d.ts +57 -0
- package/dist/lib/shipping/auto-merge.js +311 -0
- package/dist/lib/shipping/auto-merge.js.map +1 -0
- package/dist/lib/shipping/github.d.ts +68 -0
- package/dist/lib/shipping/github.js +217 -0
- package/dist/lib/shipping/github.js.map +1 -0
- package/dist/lib/shipping/index.d.ts +13 -0
- package/dist/lib/shipping/index.js +11 -0
- package/dist/lib/shipping/index.js.map +1 -0
- package/dist/lib/shipping/rebase.d.ts +35 -0
- package/dist/lib/shipping/rebase.js +107 -0
- package/dist/lib/shipping/rebase.js.map +1 -0
- package/dist/lib/shipping/types.d.ts +181 -0
- package/dist/lib/shipping/types.js +9 -0
- package/dist/lib/shipping/types.js.map +1 -0
- package/dist/lib/shortcut/config.js +13 -7
- package/dist/lib/shortcut/config.js.map +1 -1
- package/dist/lib/trello/client.d.ts +1 -0
- package/dist/lib/trello/client.js +6 -0
- package/dist/lib/trello/client.js.map +1 -1
- package/dist/lib/trello/config.js +17 -12
- package/dist/lib/trello/config.js.map +1 -1
- package/dist/lib/work-lifecycle/events.d.ts +1 -1
- package/dist/lib/work-source/config.d.ts +1 -1
- package/dist/lib/work-source/config.js +11 -1
- package/dist/lib/work-source/config.js.map +1 -1
- package/dist/lib/work-source/provider-sources.js +6 -1
- package/dist/lib/work-source/provider-sources.js.map +1 -1
- package/oclif.manifest.json +3810 -5723
- package/package.json +8 -8
- package/dist/commands/board/index.d.ts +0 -21
- package/dist/commands/board/index.js +0 -263
- package/dist/commands/board/index.js.map +0 -1
- package/dist/commands/board/view.d.ts +0 -15
- package/dist/commands/board/view.js +0 -137
- package/dist/commands/board/view.js.map +0 -1
- package/dist/commands/board/watch.d.ts +0 -15
- package/dist/commands/board/watch.js +0 -59
- package/dist/commands/board/watch.js.map +0 -1
- package/dist/commands/dashboard/index.js +0 -117
- package/dist/commands/dashboard/index.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -38
- package/dist/commands/dashboard.js +0 -353
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/pmo/init.d.ts +0 -28
- package/dist/commands/pmo/init.js +0 -410
- package/dist/commands/pmo/init.js.map +0 -1
- package/dist/commands/project/archive.d.ts +0 -18
- package/dist/commands/project/archive.js +0 -79
- package/dist/commands/project/archive.js.map +0 -1
- package/dist/commands/project/create.d.ts +0 -24
- package/dist/commands/project/create.js +0 -191
- package/dist/commands/project/create.js.map +0 -1
- package/dist/commands/project/delete.d.ts +0 -18
- package/dist/commands/project/delete.js +0 -115
- package/dist/commands/project/delete.js.map +0 -1
- package/dist/commands/project/index.d.ts +0 -14
- package/dist/commands/project/index.js +0 -60
- package/dist/commands/project/index.js.map +0 -1
- package/dist/commands/project/list.d.ts +0 -16
- package/dist/commands/project/list.js +0 -115
- package/dist/commands/project/list.js.map +0 -1
- package/dist/commands/project/spec.d.ts +0 -19
- package/dist/commands/project/spec.js +0 -218
- package/dist/commands/project/spec.js.map +0 -1
- package/dist/commands/project/unarchive.d.ts +0 -17
- package/dist/commands/project/unarchive.js +0 -55
- package/dist/commands/project/unarchive.js.map +0 -1
- package/dist/commands/project/update.d.ts +0 -19
- package/dist/commands/project/update.js +0 -161
- package/dist/commands/project/update.js.map +0 -1
- package/dist/commands/project/view.d.ts +0 -17
- package/dist/commands/project/view.js +0 -107
- package/dist/commands/project/view.js.map +0 -1
- package/dist/commands/ticket/bulk.d.ts +0 -14
- package/dist/commands/ticket/bulk.js +0 -141
- package/dist/commands/ticket/bulk.js.map +0 -1
- package/dist/commands/ticket/cancel.js +0 -206
- package/dist/commands/ticket/cancel.js.map +0 -1
- package/dist/commands/ticket/category.d.ts +0 -15
- package/dist/commands/ticket/category.js +0 -64
- package/dist/commands/ticket/category.js.map +0 -1
- package/dist/commands/ticket/complete.d.ts +0 -17
- package/dist/commands/ticket/complete.js +0 -193
- package/dist/commands/ticket/complete.js.map +0 -1
- package/dist/commands/ticket/epic.d.ts +0 -21
- package/dist/commands/ticket/epic.js +0 -306
- package/dist/commands/ticket/epic.js.map +0 -1
- package/dist/commands/ticket/link/block.d.ts +0 -15
- package/dist/commands/ticket/link/block.js +0 -96
- package/dist/commands/ticket/link/block.js.map +0 -1
- package/dist/commands/ticket/link/duplicates.d.ts +0 -15
- package/dist/commands/ticket/link/duplicates.js +0 -96
- package/dist/commands/ticket/link/duplicates.js.map +0 -1
- package/dist/commands/ticket/link/index.d.ts +0 -14
- package/dist/commands/ticket/link/index.js +0 -99
- package/dist/commands/ticket/link/index.js.map +0 -1
- package/dist/commands/ticket/link/relates.d.ts +0 -15
- package/dist/commands/ticket/link/relates.js +0 -96
- package/dist/commands/ticket/link/relates.js.map +0 -1
- package/dist/commands/ticket/project.d.ts +0 -19
- package/dist/commands/ticket/project.js +0 -257
- package/dist/commands/ticket/project.js.map +0 -1
- package/dist/commands/ticket/reassign.d.ts +0 -20
- package/dist/commands/ticket/reassign.js +0 -340
- package/dist/commands/ticket/reassign.js.map +0 -1
- package/dist/commands/ticket/resolve.d.ts +0 -68
- package/dist/commands/ticket/resolve.js +0 -306
- package/dist/commands/ticket/resolve.js.map +0 -1
- package/dist/commands/ticket/spec.d.ts +0 -19
- package/dist/commands/ticket/spec.js +0 -260
- package/dist/commands/ticket/spec.js.map +0 -1
- package/dist/commands/ticket/status.d.ts +0 -14
- package/dist/commands/ticket/status.js +0 -84
- package/dist/commands/ticket/status.js.map +0 -1
- package/dist/commands/ticket/view.d.ts +0 -14
- package/dist/commands/ticket/view.js +0 -113
- package/dist/commands/ticket/view.js.map +0 -1
- package/dist/lib/mcp/tools/board.d.ts +0 -6
- package/dist/lib/mcp/tools/board.js +0 -190
- package/dist/lib/mcp/tools/board.js.map +0 -1
- package/dist/lib/mcp/tools/category.d.ts +0 -6
- package/dist/lib/mcp/tools/category.js +0 -85
- package/dist/lib/mcp/tools/category.js.map +0 -1
- package/dist/lib/mcp/tools/epic.d.ts +0 -6
- package/dist/lib/mcp/tools/epic.js +0 -184
- package/dist/lib/mcp/tools/epic.js.map +0 -1
- package/dist/lib/mcp/tools/label.d.ts +0 -6
- package/dist/lib/mcp/tools/label.js +0 -339
- package/dist/lib/mcp/tools/label.js.map +0 -1
- package/dist/lib/mcp/tools/phase.d.ts +0 -6
- package/dist/lib/mcp/tools/phase.js +0 -132
- package/dist/lib/mcp/tools/phase.js.map +0 -1
- package/dist/lib/mcp/tools/project.d.ts +0 -6
- package/dist/lib/mcp/tools/project.js +0 -197
- package/dist/lib/mcp/tools/project.js.map +0 -1
- package/dist/lib/mcp/tools/roadmap.d.ts +0 -6
- package/dist/lib/mcp/tools/roadmap.js +0 -124
- package/dist/lib/mcp/tools/roadmap.js.map +0 -1
- package/dist/lib/mcp/tools/status.d.ts +0 -6
- package/dist/lib/mcp/tools/status.js +0 -110
- package/dist/lib/mcp/tools/status.js.map +0 -1
- package/dist/lib/mcp/tools/template.d.ts +0 -6
- package/dist/lib/mcp/tools/template.js +0 -108
- package/dist/lib/mcp/tools/template.js.map +0 -1
- package/dist/lib/mcp/tools/view.d.ts +0 -6
- package/dist/lib/mcp/tools/view.js +0 -77
- package/dist/lib/mcp/tools/view.js.map +0 -1
- package/dist/lib/mcp/tools/workflow.d.ts +0 -6
- package/dist/lib/mcp/tools/workflow.js +0 -96
- package/dist/lib/mcp/tools/workflow.js.map +0 -1
- package/dist/lib/pmo/storage/categories.d.ts +0 -50
- package/dist/lib/pmo/storage/categories.js +0 -206
- package/dist/lib/pmo/storage/categories.js.map +0 -1
- package/dist/lib/pmo/storage/labels.d.ts +0 -55
- package/dist/lib/pmo/storage/labels.js +0 -347
- package/dist/lib/pmo/storage/labels.js.map +0 -1
- package/dist/lib/pmo/storage/phases.d.ts +0 -65
- package/dist/lib/pmo/storage/phases.js +0 -393
- package/dist/lib/pmo/storage/phases.js.map +0 -1
- package/dist/lib/pmo/storage/roadmaps.d.ts +0 -64
- package/dist/lib/pmo/storage/roadmaps.js +0 -373
- package/dist/lib/pmo/storage/roadmaps.js.map +0 -1
- package/dist/lib/pmo/storage/views.d.ts +0 -57
- package/dist/lib/pmo/storage/views.js +0 -456
- package/dist/lib/pmo/storage/views.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../../src/lib/dashboard/html.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../../src/lib/dashboard/html.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2SD,CAAA;AACR,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential Store
|
|
3
|
+
*
|
|
4
|
+
* Stores API keys and tokens in a separate credentials.db file
|
|
5
|
+
* that is NOT mounted into agent containers. This prevents agents
|
|
6
|
+
* from reading or leaking credentials.
|
|
7
|
+
*
|
|
8
|
+
* Credentials are stored at {workspacePath}/.proletariat-credentials/credentials.db
|
|
9
|
+
* while the main workspace.db lives at {workspacePath}/.proletariat/workspace.db.
|
|
10
|
+
* Only .proletariat/ is mounted into containers, keeping credentials isolated.
|
|
11
|
+
*
|
|
12
|
+
* PRLT-1114: Agent secret isolation
|
|
13
|
+
*/
|
|
14
|
+
import Database from 'better-sqlite3';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a workspace_settings key stores a credential (API key or token).
|
|
17
|
+
*/
|
|
18
|
+
export declare function isCredentialKey(key: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Get the path to the credentials database for a workspace.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCredentialDatabasePath(workspacePath: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get a credential value, with automatic migration from workspace.db.
|
|
25
|
+
*
|
|
26
|
+
* Resolution order:
|
|
27
|
+
* 1. Check credentials.db (if available)
|
|
28
|
+
* 2. Fall back to workspace.db (for backward compatibility)
|
|
29
|
+
* 3. If found in workspace.db, migrate to credentials.db and delete from workspace.db
|
|
30
|
+
*
|
|
31
|
+
* In agent containers, credentials.db won't exist and workspace.db will have
|
|
32
|
+
* credentials removed — so this returns null, which is the desired behavior.
|
|
33
|
+
*
|
|
34
|
+
* For in-memory databases (tests), falls back to workspace_settings directly
|
|
35
|
+
* since there's no filesystem path to store credentials.db.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getCredential(workspaceDb: Database.Database, key: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Set a credential value. Always writes to credentials.db.
|
|
40
|
+
* Also removes from workspace.db if present (migration cleanup).
|
|
41
|
+
* For in-memory databases (tests), writes to workspace_settings directly.
|
|
42
|
+
*/
|
|
43
|
+
export declare function setCredential(workspaceDb: Database.Database, key: string, value: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Delete a credential from both credentials.db and workspace.db.
|
|
46
|
+
* For in-memory databases (tests), deletes from workspace_settings directly.
|
|
47
|
+
*/
|
|
48
|
+
export declare function deleteCredential(workspaceDb: Database.Database, key: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Check if a credential exists in either credentials.db or workspace.db.
|
|
51
|
+
*/
|
|
52
|
+
export declare function hasCredential(workspaceDb: Database.Database, key: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Close all cached credential database connections.
|
|
55
|
+
* Call this during cleanup/shutdown.
|
|
56
|
+
*/
|
|
57
|
+
export declare function closeAllCredentialStores(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Eagerly migrate all known credential keys from workspace.db to credentials.db.
|
|
60
|
+
* This is safe to call multiple times (idempotent).
|
|
61
|
+
* Useful during workspace open to proactively move all credentials out.
|
|
62
|
+
* No-op for in-memory databases (tests).
|
|
63
|
+
*/
|
|
64
|
+
export declare function migrateCredentials(workspaceDb: Database.Database): void;
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential Store
|
|
3
|
+
*
|
|
4
|
+
* Stores API keys and tokens in a separate credentials.db file
|
|
5
|
+
* that is NOT mounted into agent containers. This prevents agents
|
|
6
|
+
* from reading or leaking credentials.
|
|
7
|
+
*
|
|
8
|
+
* Credentials are stored at {workspacePath}/.proletariat-credentials/credentials.db
|
|
9
|
+
* while the main workspace.db lives at {workspacePath}/.proletariat/workspace.db.
|
|
10
|
+
* Only .proletariat/ is mounted into containers, keeping credentials isolated.
|
|
11
|
+
*
|
|
12
|
+
* PRLT-1114: Agent secret isolation
|
|
13
|
+
*/
|
|
14
|
+
import Database from 'better-sqlite3';
|
|
15
|
+
import * as fs from 'node:fs';
|
|
16
|
+
import * as path from 'node:path';
|
|
17
|
+
const CREDENTIALS_TABLE = 'credentials';
|
|
18
|
+
/** Known credential setting keys that must be stored in credentials.db */
|
|
19
|
+
const CREDENTIAL_KEYS = new Set([
|
|
20
|
+
'linear.api_key',
|
|
21
|
+
'jira.api_token',
|
|
22
|
+
'asana.access_token',
|
|
23
|
+
'trello.api_key',
|
|
24
|
+
'trello.api_token',
|
|
25
|
+
'shortcut.api_token',
|
|
26
|
+
'monday.api_token',
|
|
27
|
+
'clickup.api_key',
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Check if a workspace_settings key stores a credential (API key or token).
|
|
31
|
+
*/
|
|
32
|
+
export function isCredentialKey(key) {
|
|
33
|
+
return CREDENTIAL_KEYS.has(key);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get the path to the credentials database for a workspace.
|
|
37
|
+
*/
|
|
38
|
+
export function getCredentialDatabasePath(workspacePath) {
|
|
39
|
+
return path.join(workspacePath, '.proletariat-credentials', 'credentials.db');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Derive the workspace root path from a workspace.db Database instance.
|
|
43
|
+
* workspace.db is at {workspacePath}/.proletariat/workspace.db
|
|
44
|
+
* Returns empty string for in-memory databases (used in tests).
|
|
45
|
+
*/
|
|
46
|
+
function deriveWorkspacePath(db) {
|
|
47
|
+
const dbName = db.name;
|
|
48
|
+
// In-memory or unnamed databases don't have a filesystem path
|
|
49
|
+
if (!dbName || dbName === ':memory:' || dbName === '')
|
|
50
|
+
return '';
|
|
51
|
+
return path.dirname(path.dirname(dbName));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Open or create the credentials database.
|
|
55
|
+
* Creates the directory and schema if they don't exist.
|
|
56
|
+
*/
|
|
57
|
+
function openCredentialDb(workspacePath) {
|
|
58
|
+
const dbPath = getCredentialDatabasePath(workspacePath);
|
|
59
|
+
const dir = path.dirname(dbPath);
|
|
60
|
+
if (!fs.existsSync(dir)) {
|
|
61
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
62
|
+
}
|
|
63
|
+
const credDb = new Database(dbPath);
|
|
64
|
+
credDb.pragma('journal_mode = WAL');
|
|
65
|
+
credDb.pragma('foreign_keys = ON');
|
|
66
|
+
credDb.pragma('busy_timeout = 5000');
|
|
67
|
+
credDb.exec(`
|
|
68
|
+
CREATE TABLE IF NOT EXISTS ${CREDENTIALS_TABLE} (
|
|
69
|
+
key TEXT PRIMARY KEY,
|
|
70
|
+
value TEXT NOT NULL
|
|
71
|
+
)
|
|
72
|
+
`);
|
|
73
|
+
return credDb;
|
|
74
|
+
}
|
|
75
|
+
// Cache open credential db connections keyed by workspace path
|
|
76
|
+
const credentialDbCache = new Map();
|
|
77
|
+
/**
|
|
78
|
+
* Get a cached credential database connection.
|
|
79
|
+
* Returns null if credentials.db cannot be opened (e.g., in agent containers
|
|
80
|
+
* where the credentials directory is not mounted).
|
|
81
|
+
*/
|
|
82
|
+
function getCachedCredentialDb(workspacePath, autoCreate) {
|
|
83
|
+
const cached = credentialDbCache.get(workspacePath);
|
|
84
|
+
if (cached) {
|
|
85
|
+
try {
|
|
86
|
+
cached.pragma('journal_mode');
|
|
87
|
+
return cached;
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
credentialDbCache.delete(workspacePath);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const dbPath = getCredentialDatabasePath(workspacePath);
|
|
94
|
+
const dir = path.dirname(dbPath);
|
|
95
|
+
// If the credentials directory doesn't exist and we're not auto-creating,
|
|
96
|
+
// return null. This is expected in agent containers where only .proletariat/
|
|
97
|
+
// is mounted, not .proletariat-credentials/.
|
|
98
|
+
if (!autoCreate && !fs.existsSync(dir)) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const credDb = openCredentialDb(workspacePath);
|
|
103
|
+
credentialDbCache.set(workspacePath, credDb);
|
|
104
|
+
return credDb;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get a credential value, with automatic migration from workspace.db.
|
|
112
|
+
*
|
|
113
|
+
* Resolution order:
|
|
114
|
+
* 1. Check credentials.db (if available)
|
|
115
|
+
* 2. Fall back to workspace.db (for backward compatibility)
|
|
116
|
+
* 3. If found in workspace.db, migrate to credentials.db and delete from workspace.db
|
|
117
|
+
*
|
|
118
|
+
* In agent containers, credentials.db won't exist and workspace.db will have
|
|
119
|
+
* credentials removed — so this returns null, which is the desired behavior.
|
|
120
|
+
*
|
|
121
|
+
* For in-memory databases (tests), falls back to workspace_settings directly
|
|
122
|
+
* since there's no filesystem path to store credentials.db.
|
|
123
|
+
*/
|
|
124
|
+
export function getCredential(workspaceDb, key) {
|
|
125
|
+
const workspacePath = deriveWorkspacePath(workspaceDb);
|
|
126
|
+
// In-memory databases (tests) — use workspace_settings directly
|
|
127
|
+
if (!workspacePath) {
|
|
128
|
+
try {
|
|
129
|
+
const row = workspaceDb
|
|
130
|
+
.prepare('SELECT value FROM workspace_settings WHERE key = ?')
|
|
131
|
+
.get(key);
|
|
132
|
+
return row?.value ?? null;
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// Check credentials.db first (don't auto-create just for reads)
|
|
139
|
+
const credDb = getCachedCredentialDb(workspacePath, false);
|
|
140
|
+
if (credDb) {
|
|
141
|
+
const row = credDb
|
|
142
|
+
.prepare(`SELECT value FROM ${CREDENTIALS_TABLE} WHERE key = ?`)
|
|
143
|
+
.get(key);
|
|
144
|
+
if (row)
|
|
145
|
+
return row.value;
|
|
146
|
+
}
|
|
147
|
+
// Fall back to workspace.db (backward compatibility + auto-migration)
|
|
148
|
+
let fallbackValue = null;
|
|
149
|
+
try {
|
|
150
|
+
const fallbackRow = workspaceDb
|
|
151
|
+
.prepare('SELECT value FROM workspace_settings WHERE key = ?')
|
|
152
|
+
.get(key);
|
|
153
|
+
fallbackValue = fallbackRow?.value ?? null;
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// workspace.db may not have the table yet
|
|
157
|
+
}
|
|
158
|
+
if (fallbackValue) {
|
|
159
|
+
// Auto-migrate: move credential to credentials.db (auto-create on write)
|
|
160
|
+
const writeDb = getCachedCredentialDb(workspacePath, true);
|
|
161
|
+
if (writeDb) {
|
|
162
|
+
writeDb
|
|
163
|
+
.prepare(`INSERT OR REPLACE INTO ${CREDENTIALS_TABLE} (key, value) VALUES (?, ?)`)
|
|
164
|
+
.run(key, fallbackValue);
|
|
165
|
+
}
|
|
166
|
+
// Remove from workspace.db so agents can't see it
|
|
167
|
+
try {
|
|
168
|
+
workspaceDb.prepare('DELETE FROM workspace_settings WHERE key = ?').run(key);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// workspace.db may be read-only in containers
|
|
172
|
+
}
|
|
173
|
+
return fallbackValue;
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Set a credential value. Always writes to credentials.db.
|
|
179
|
+
* Also removes from workspace.db if present (migration cleanup).
|
|
180
|
+
* For in-memory databases (tests), writes to workspace_settings directly.
|
|
181
|
+
*/
|
|
182
|
+
export function setCredential(workspaceDb, key, value) {
|
|
183
|
+
const workspacePath = deriveWorkspacePath(workspaceDb);
|
|
184
|
+
// In-memory databases (tests) — use workspace_settings directly
|
|
185
|
+
if (!workspacePath) {
|
|
186
|
+
workspaceDb.prepare(`
|
|
187
|
+
INSERT INTO workspace_settings (key, value)
|
|
188
|
+
VALUES (?, ?)
|
|
189
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value
|
|
190
|
+
`).run(key, value);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const credDb = getCachedCredentialDb(workspacePath, true);
|
|
194
|
+
if (!credDb) {
|
|
195
|
+
throw new Error(`Cannot open credential store at ${getCredentialDatabasePath(workspacePath)}`);
|
|
196
|
+
}
|
|
197
|
+
credDb
|
|
198
|
+
.prepare(`INSERT OR REPLACE INTO ${CREDENTIALS_TABLE} (key, value) VALUES (?, ?)`)
|
|
199
|
+
.run(key, value);
|
|
200
|
+
// Clean up from workspace.db if it was there
|
|
201
|
+
try {
|
|
202
|
+
workspaceDb.prepare('DELETE FROM workspace_settings WHERE key = ?').run(key);
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// workspace.db may be read-only in containers
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Delete a credential from both credentials.db and workspace.db.
|
|
210
|
+
* For in-memory databases (tests), deletes from workspace_settings directly.
|
|
211
|
+
*/
|
|
212
|
+
export function deleteCredential(workspaceDb, key) {
|
|
213
|
+
const workspacePath = deriveWorkspacePath(workspaceDb);
|
|
214
|
+
// In-memory databases (tests) — use workspace_settings directly
|
|
215
|
+
if (!workspacePath) {
|
|
216
|
+
try {
|
|
217
|
+
workspaceDb.prepare('DELETE FROM workspace_settings WHERE key = ?').run(key);
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
// Table may not exist
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const credDb = getCachedCredentialDb(workspacePath, false);
|
|
225
|
+
if (credDb) {
|
|
226
|
+
credDb.prepare(`DELETE FROM ${CREDENTIALS_TABLE} WHERE key = ?`).run(key);
|
|
227
|
+
}
|
|
228
|
+
// Also delete from workspace.db in case it's still there
|
|
229
|
+
try {
|
|
230
|
+
workspaceDb.prepare('DELETE FROM workspace_settings WHERE key = ?').run(key);
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
// workspace.db may be read-only
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Check if a credential exists in either credentials.db or workspace.db.
|
|
238
|
+
*/
|
|
239
|
+
export function hasCredential(workspaceDb, key) {
|
|
240
|
+
return getCredential(workspaceDb, key) !== null;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Close all cached credential database connections.
|
|
244
|
+
* Call this during cleanup/shutdown.
|
|
245
|
+
*/
|
|
246
|
+
export function closeAllCredentialStores() {
|
|
247
|
+
for (const [, db] of credentialDbCache) {
|
|
248
|
+
try {
|
|
249
|
+
db.close();
|
|
250
|
+
}
|
|
251
|
+
catch {
|
|
252
|
+
// Ignore close errors
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
credentialDbCache.clear();
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Eagerly migrate all known credential keys from workspace.db to credentials.db.
|
|
259
|
+
* This is safe to call multiple times (idempotent).
|
|
260
|
+
* Useful during workspace open to proactively move all credentials out.
|
|
261
|
+
* No-op for in-memory databases (tests).
|
|
262
|
+
*/
|
|
263
|
+
export function migrateCredentials(workspaceDb) {
|
|
264
|
+
const workspacePath = deriveWorkspacePath(workspaceDb);
|
|
265
|
+
if (!workspacePath)
|
|
266
|
+
return; // In-memory databases (tests)
|
|
267
|
+
// Check if any credentials exist in workspace.db
|
|
268
|
+
let hasAny = false;
|
|
269
|
+
try {
|
|
270
|
+
for (const key of CREDENTIAL_KEYS) {
|
|
271
|
+
const row = workspaceDb
|
|
272
|
+
.prepare('SELECT value FROM workspace_settings WHERE key = ?')
|
|
273
|
+
.get(key);
|
|
274
|
+
if (row) {
|
|
275
|
+
hasAny = true;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
return; // workspace_settings table may not exist
|
|
282
|
+
}
|
|
283
|
+
if (!hasAny)
|
|
284
|
+
return;
|
|
285
|
+
// Open/create credentials.db and migrate
|
|
286
|
+
const credDb = getCachedCredentialDb(workspacePath, true);
|
|
287
|
+
if (!credDb)
|
|
288
|
+
return;
|
|
289
|
+
for (const key of CREDENTIAL_KEYS) {
|
|
290
|
+
try {
|
|
291
|
+
const row = workspaceDb
|
|
292
|
+
.prepare('SELECT value FROM workspace_settings WHERE key = ?')
|
|
293
|
+
.get(key);
|
|
294
|
+
if (row) {
|
|
295
|
+
credDb
|
|
296
|
+
.prepare(`INSERT OR REPLACE INTO ${CREDENTIALS_TABLE} (key, value) VALUES (?, ?)`)
|
|
297
|
+
.run(key, row.value);
|
|
298
|
+
workspaceDb.prepare('DELETE FROM workspace_settings WHERE key = ?').run(key);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
// Skip individual key failures
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=credential-store.js.map
|
|
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
6
|
+
* - Timestamped backup in .proletariat/backups/ (keeps last 5)
|
|
7
7
|
* - Integrity check on open with auto-recovery
|
|
8
8
|
* - Manual repair via dump/reimport
|
|
9
|
+
* - Migration of legacy scattered backup files
|
|
9
10
|
*
|
|
10
|
-
* See: PRLT-1081
|
|
11
|
+
* See: PRLT-1081, PRLT-1154
|
|
11
12
|
*/
|
|
12
13
|
import Database from 'better-sqlite3';
|
|
13
14
|
/**
|
|
@@ -16,18 +17,56 @@ import Database from 'better-sqlite3';
|
|
|
16
17
|
* more resistant to corruption than the default journal_mode=delete.
|
|
17
18
|
*/
|
|
18
19
|
export declare function enableWALMode(db: Database.Database): void;
|
|
20
|
+
/**
|
|
21
|
+
* Get the backups directory for a given database path.
|
|
22
|
+
* The backups directory is always a sibling `backups/` directory
|
|
23
|
+
* relative to the database file (e.g., `.proletariat/backups/`).
|
|
24
|
+
*/
|
|
25
|
+
export declare function getBackupsDir(dbPath: string): string;
|
|
19
26
|
/**
|
|
20
27
|
* Get the backup path for a given database path and backup number.
|
|
28
|
+
* Backups are stored in the backups/ directory with timestamps.
|
|
29
|
+
*
|
|
30
|
+
* For numbered access (used by backup restore), returns a path
|
|
31
|
+
* based on sorted backup files in the directory.
|
|
32
|
+
* Returns null if the backup doesn't exist.
|
|
21
33
|
*/
|
|
22
|
-
export declare function getBackupPath(dbPath: string, n: number): string;
|
|
34
|
+
export declare function getBackupPath(dbPath: string, n: number): string | null;
|
|
23
35
|
/**
|
|
24
|
-
* Create a
|
|
25
|
-
* Keeps the last MAX_BACKUPS copies,
|
|
26
|
-
* Rotates existing backups before copying the current database.
|
|
36
|
+
* Create a timestamped backup of the database file in the backups/ directory.
|
|
37
|
+
* Keeps the last MAX_BACKUPS copies, deletes older ones.
|
|
27
38
|
*
|
|
28
|
-
* Returns
|
|
39
|
+
* Returns the backup path if created, null if source didn't exist.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createRotatingBackup(dbPath: string): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Create a manual backup with an optional label.
|
|
44
|
+
* Unlike auto-backups, manual backups include a "manual" prefix.
|
|
45
|
+
* Returns the backup path.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createManualBackup(dbPath: string, label?: string): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Migrate legacy backup files from the .proletariat/ top level into backups/.
|
|
50
|
+
*
|
|
51
|
+
* Handles:
|
|
52
|
+
* - workspace.db.backup (plain backup)
|
|
53
|
+
* - workspace.db.backup-YYYYMMDD-HHMMSS (timestamped backups)
|
|
54
|
+
* - workspace.db.backup.N (numbered backups with -wal/-shm companions)
|
|
55
|
+
* - workspace.db.corrupt (corrupt file preservations)
|
|
56
|
+
*
|
|
57
|
+
* Called on first run after upgrade. Safe to call multiple times.
|
|
58
|
+
*/
|
|
59
|
+
export declare function migrateExistingBackups(dbPath: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* List all backup entries with metadata, sorted newest-first.
|
|
62
|
+
* Used by the repair and backup commands to display backup info.
|
|
29
63
|
*/
|
|
30
|
-
export declare function
|
|
64
|
+
export declare function listBackups(dbPath: string): Array<{
|
|
65
|
+
path: string;
|
|
66
|
+
filename: string;
|
|
67
|
+
size: number;
|
|
68
|
+
mtime: Date;
|
|
69
|
+
}>;
|
|
31
70
|
export interface IntegrityCheckResult {
|
|
32
71
|
ok: boolean;
|
|
33
72
|
errors: string[];
|
|
@@ -54,6 +93,6 @@ export interface RepairResult {
|
|
|
54
93
|
* 1. Try dump/reimport — opens the corrupt DB, dumps all SQL, creates a new DB
|
|
55
94
|
* 2. If dump fails, fall back to the most recent backup
|
|
56
95
|
*
|
|
57
|
-
* The original corrupt file is preserved
|
|
96
|
+
* The original corrupt file is preserved in backups/ for forensics.
|
|
58
97
|
*/
|
|
59
98
|
export declare function repairDatabase(dbPath: string): RepairResult;
|