@proletariat/cli 0.3.93 → 0.3.94
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 +1 -1
- package/dist/commands/agent/gc.d.ts +1 -1
- package/dist/commands/agent/index.d.ts +1 -1
- package/dist/commands/agent/list.d.ts +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 +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 +1 -1
- package/dist/commands/agent/staff/remove.d.ts +1 -1
- package/dist/commands/agent/status.d.ts +1 -1
- package/dist/commands/agent/visit.d.ts +1 -1
- package/dist/commands/asana/import.d.ts +1 -1
- package/dist/commands/branch/create.d.ts +1 -1
- package/dist/commands/branch/index.d.ts +1 -1
- package/dist/commands/branch/list.d.ts +1 -1
- package/dist/commands/branch/validate.d.ts +1 -1
- package/dist/commands/branch/where.d.ts +1 -1
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/index.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 +1 -1
- package/dist/commands/execution/index.d.ts +1 -1
- package/dist/commands/execution/list.d.ts +1 -1
- package/dist/commands/execution/logs.d.ts +1 -1
- package/dist/commands/execution/stop.d.ts +1 -1
- package/dist/commands/execution/view.d.ts +1 -1
- package/dist/commands/hook/export.d.ts +1 -1
- package/dist/commands/hook/fire.d.ts +1 -1
- package/dist/commands/hook/index.d.ts +1 -1
- package/dist/commands/hook/list.d.ts +1 -1
- package/dist/commands/hook/preset.d.ts +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 +1 -1
- package/dist/commands/orchestrator/index.d.ts +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 +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 +1 -1
- package/dist/commands/repo/create.d.ts +1 -1
- package/dist/commands/repo/fix-remotes.d.ts +1 -1
- package/dist/commands/repo/index.d.ts +1 -1
- package/dist/commands/repo/list.d.ts +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 +1 -1
- package/dist/commands/session/create.d.ts +1 -1
- package/dist/commands/session/exec.d.ts +1 -1
- package/dist/commands/session/health.d.ts +1 -1
- package/dist/commands/session/index.d.ts +1 -1
- package/dist/commands/session/inspect.d.ts +1 -1
- package/dist/commands/session/list.d.ts +1 -1
- package/dist/commands/session/peek.d.ts +1 -1
- package/dist/commands/session/prune.d.ts +1 -1
- package/dist/commands/session/report.d.ts +1 -1
- package/dist/commands/session/restart.d.ts +1 -1
- 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 +1 -1
- package/dist/commands/ticket/index.js +6 -36
- 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/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 +1 -1
- package/dist/commands/work/hooks/index.d.ts +1 -1
- package/dist/commands/work/hooks/list.d.ts +1 -1
- package/dist/commands/work/hooks/remove.d.ts +1 -1
- package/dist/commands/work/hooks/toggle.d.ts +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 +1 -1
- package/dist/commands/work/ready.d.ts +1 -1
- package/dist/commands/work/rebase.d.ts +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 +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/status.d.ts +1 -1
- package/dist/commands/work/stop.d.ts +1 -1
- package/dist/commands/work/watch.d.ts +1 -1
- package/dist/hooks/init.js +1 -1
- 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/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/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/index.d.ts +1 -0
- package/dist/lib/database/index.js +2 -0
- 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 +4 -0
- 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/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/types.js +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/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/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 +0 -231
- 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/resolver.d.ts +1 -1
- package/dist/lib/providers/resolver.js +16 -5
- package/dist/lib/providers/resolver.js.map +1 -1
- 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/shortcut/config.js +13 -7
- package/dist/lib/shortcut/config.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 +3015 -4827
- package/package.json +1 -1
- 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.d.ts +0 -14
- 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.d.ts +0 -17
- 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
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RuntimeCommand - Base class for commands that need workspace.db access.
|
|
3
|
+
*
|
|
4
|
+
* Hierarchy: PromptCommand → RuntimeCommand → PMOCommand
|
|
5
|
+
*
|
|
6
|
+
* Provides:
|
|
7
|
+
* - HQ workspace resolution (this.hqPath)
|
|
8
|
+
* - workspace.db lifecycle (this.db, auto-close on cleanup)
|
|
9
|
+
* - SettingsStore for workspace_settings (this.settings)
|
|
10
|
+
* - execute()/cleanup() lifecycle pattern
|
|
11
|
+
* - Generic prompt utilities (selectFromList, promptForInput, handleError)
|
|
12
|
+
*
|
|
13
|
+
* Use this base class for commands that need workspace database access
|
|
14
|
+
* but do NOT require a ticket provider (PMO, Linear, etc.). For commands
|
|
15
|
+
* that need ticket/project operations, use PMOCommand which extends this.
|
|
16
|
+
*
|
|
17
|
+
* Commands that don't need workspace.db should extend PromptCommand directly.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { RuntimeCommand, runtimeBaseFlags } from '../../lib/runtime-command.js';
|
|
22
|
+
*
|
|
23
|
+
* export default class MyCommand extends RuntimeCommand {
|
|
24
|
+
* static flags = { ...runtimeBaseFlags };
|
|
25
|
+
*
|
|
26
|
+
* async execute(): Promise<void> {
|
|
27
|
+
* // HQ path and workspace.db are available
|
|
28
|
+
* const hqPath = this.requireHQ();
|
|
29
|
+
* const db = this.requireDB();
|
|
30
|
+
* const apiKey = this.settings?.get('linear.api_key');
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
import type Database from 'better-sqlite3';
|
|
36
|
+
import { PromptCommand } from './prompt-command.js';
|
|
37
|
+
import { type WorkspaceConfig } from './database/index.js';
|
|
38
|
+
import { SettingsStore } from './database/settings-store.js';
|
|
39
|
+
import { type JsonFlags } from './prompt-json.js';
|
|
40
|
+
/**
|
|
41
|
+
* Base flags for machine-readable output mode.
|
|
42
|
+
* Include these in your command's flags by spreading: ...machineOutputFlags
|
|
43
|
+
*/
|
|
44
|
+
export declare const machineOutputFlags: {
|
|
45
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
46
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Base flags for RuntimeCommand subclasses.
|
|
50
|
+
* Includes machine output flags. Add command-specific flags alongside.
|
|
51
|
+
*/
|
|
52
|
+
export declare const runtimeBaseFlags: {
|
|
53
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
54
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
55
|
+
};
|
|
56
|
+
export declare abstract class RuntimeCommand extends PromptCommand {
|
|
57
|
+
/**
|
|
58
|
+
* Workspace database connection.
|
|
59
|
+
* Available after init() runs. May be null if no HQ found or DB failed to open.
|
|
60
|
+
*/
|
|
61
|
+
private _db;
|
|
62
|
+
/**
|
|
63
|
+
* Settings store for workspace_settings table.
|
|
64
|
+
* Available after init() runs. May be null if no DB available.
|
|
65
|
+
*/
|
|
66
|
+
private _settings;
|
|
67
|
+
/**
|
|
68
|
+
* HQ workspace root path.
|
|
69
|
+
* Available after init() runs. May be null if not in an HQ workspace.
|
|
70
|
+
*/
|
|
71
|
+
private _hqPath;
|
|
72
|
+
/**
|
|
73
|
+
* Workspace configuration from workspace.db.
|
|
74
|
+
* Available after init() runs. May be null if no DB available.
|
|
75
|
+
*/
|
|
76
|
+
private _workspaceConfig;
|
|
77
|
+
/**
|
|
78
|
+
* Flag to track if runtime context was successfully initialized
|
|
79
|
+
*/
|
|
80
|
+
private _runtimeInitialized;
|
|
81
|
+
/**
|
|
82
|
+
* oclif init hook - runs before the command executes.
|
|
83
|
+
* Resolves HQ workspace and opens workspace.db.
|
|
84
|
+
*/
|
|
85
|
+
init(): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Override run() to delegate to execute() and ensure cleanup.
|
|
88
|
+
* Subclasses should implement execute() instead of run().
|
|
89
|
+
*/
|
|
90
|
+
run(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Main command logic — implement this instead of run().
|
|
93
|
+
* Runtime context (hqPath, db, settings) is available via getters.
|
|
94
|
+
*/
|
|
95
|
+
protected abstract execute(): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Cleanup handler — ensures database connections are closed.
|
|
98
|
+
* Called automatically after execute() completes or throws.
|
|
99
|
+
* Override in subclasses to add additional cleanup (call super.cleanup()).
|
|
100
|
+
*/
|
|
101
|
+
protected cleanup(): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* oclif catch hook — called when an error occurs.
|
|
104
|
+
* Ensures cleanup even on errors.
|
|
105
|
+
*/
|
|
106
|
+
catch(error: Error & {
|
|
107
|
+
exitCode?: number;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* oclif finally hook — called after run() completes.
|
|
111
|
+
*/
|
|
112
|
+
finally(_: Error | undefined): Promise<void>;
|
|
113
|
+
/** HQ workspace root path, or null if not in an HQ workspace. */
|
|
114
|
+
protected get hqPath(): string | null;
|
|
115
|
+
/** Workspace database connection, or null if not available. */
|
|
116
|
+
protected get db(): Database.Database | null;
|
|
117
|
+
/** Settings store for workspace_settings, or null if not available. */
|
|
118
|
+
protected get settings(): SettingsStore | null;
|
|
119
|
+
/** Workspace configuration, or null if not available. */
|
|
120
|
+
protected get workspaceConfig(): WorkspaceConfig | null;
|
|
121
|
+
/** Whether the runtime context was successfully initialized. */
|
|
122
|
+
protected get runtimeInitialized(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Require HQ workspace to be available. Throws with a helpful
|
|
125
|
+
* error message if no HQ was found.
|
|
126
|
+
*/
|
|
127
|
+
protected requireHQ(): string;
|
|
128
|
+
/**
|
|
129
|
+
* Require workspace database to be available. Throws with a helpful
|
|
130
|
+
* error message if the DB could not be opened.
|
|
131
|
+
*/
|
|
132
|
+
protected requireDB(): Database.Database;
|
|
133
|
+
/**
|
|
134
|
+
* Require settings store to be available.
|
|
135
|
+
*/
|
|
136
|
+
protected requireSettings(): SettingsStore;
|
|
137
|
+
/**
|
|
138
|
+
* Select from a list of items with JSON mode support for AI agents.
|
|
139
|
+
*
|
|
140
|
+
* In JSON mode: outputs choices as JSON with command field and exits
|
|
141
|
+
* In interactive mode: shows prompt and returns selected value
|
|
142
|
+
*
|
|
143
|
+
* @param options Configuration for the selection
|
|
144
|
+
* @returns The selected value (only in interactive mode)
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const ticketId = await this.selectFromList({
|
|
149
|
+
* message: 'Select ticket:',
|
|
150
|
+
* items: tickets,
|
|
151
|
+
* getName: (t) => `${t.id}: ${t.title}`,
|
|
152
|
+
* getValue: (t) => t.id,
|
|
153
|
+
* getCommand: (t) => `prlt ticket view ${t.id} --json`,
|
|
154
|
+
* jsonMode: { flags, commandName: 'ticket view' },
|
|
155
|
+
* });
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
protected selectFromList<T>(options: {
|
|
159
|
+
/** Prompt message shown to user */
|
|
160
|
+
message: string;
|
|
161
|
+
/** Items to select from */
|
|
162
|
+
items: T[];
|
|
163
|
+
/** Extract display name from item */
|
|
164
|
+
getName: (item: T) => string;
|
|
165
|
+
/** Extract value from item */
|
|
166
|
+
getValue: (item: T) => string;
|
|
167
|
+
/** Build command string for item (should include --json) */
|
|
168
|
+
getCommand: (item: T) => string;
|
|
169
|
+
/** JSON mode config — if provided and flags indicate JSON mode, outputs JSON */
|
|
170
|
+
jsonMode?: {
|
|
171
|
+
flags: JsonFlags & Record<string, unknown>;
|
|
172
|
+
commandName: string;
|
|
173
|
+
} | null;
|
|
174
|
+
/** Optional: include a Cancel option */
|
|
175
|
+
allowCancel?: boolean;
|
|
176
|
+
/** Optional: custom cancel value (default: null returned) */
|
|
177
|
+
cancelValue?: string;
|
|
178
|
+
}): Promise<string | null>;
|
|
179
|
+
/**
|
|
180
|
+
* Prompt for input with JSON mode support for AI agents.
|
|
181
|
+
*
|
|
182
|
+
* In JSON mode: outputs field info as JSON and exits
|
|
183
|
+
* In interactive mode: shows prompt and returns input value
|
|
184
|
+
*
|
|
185
|
+
* @param options Configuration for the input
|
|
186
|
+
* @returns The input value (only in interactive mode)
|
|
187
|
+
*/
|
|
188
|
+
protected promptForInput(options: {
|
|
189
|
+
/** Prompt message shown to user */
|
|
190
|
+
message: string;
|
|
191
|
+
/** Field name for the prompt */
|
|
192
|
+
fieldName: string;
|
|
193
|
+
/** Default value */
|
|
194
|
+
defaultValue?: string;
|
|
195
|
+
/** Validation function */
|
|
196
|
+
validate?: (input: string) => boolean | string;
|
|
197
|
+
/** JSON mode config */
|
|
198
|
+
jsonMode?: {
|
|
199
|
+
flags: JsonFlags & Record<string, unknown>;
|
|
200
|
+
commandName: string;
|
|
201
|
+
/** Hint for how to provide this value */
|
|
202
|
+
commandHint: string;
|
|
203
|
+
/** Example command */
|
|
204
|
+
example?: string;
|
|
205
|
+
} | null;
|
|
206
|
+
}): Promise<string>;
|
|
207
|
+
/**
|
|
208
|
+
* Unified error handler for JSON/interactive modes.
|
|
209
|
+
*
|
|
210
|
+
* Consolidates error handling to avoid message drift between JSON and interactive modes.
|
|
211
|
+
* In JSON mode: outputs structured error JSON and exits
|
|
212
|
+
* In interactive mode: calls this.error() with the message
|
|
213
|
+
*/
|
|
214
|
+
protected handleError(code: string, message: string, options: {
|
|
215
|
+
jsonMode: boolean;
|
|
216
|
+
commandName: string;
|
|
217
|
+
flags: Record<string, unknown>;
|
|
218
|
+
}): void;
|
|
219
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RuntimeCommand - Base class for commands that need workspace.db access.
|
|
3
|
+
*
|
|
4
|
+
* Hierarchy: PromptCommand → RuntimeCommand → PMOCommand
|
|
5
|
+
*
|
|
6
|
+
* Provides:
|
|
7
|
+
* - HQ workspace resolution (this.hqPath)
|
|
8
|
+
* - workspace.db lifecycle (this.db, auto-close on cleanup)
|
|
9
|
+
* - SettingsStore for workspace_settings (this.settings)
|
|
10
|
+
* - execute()/cleanup() lifecycle pattern
|
|
11
|
+
* - Generic prompt utilities (selectFromList, promptForInput, handleError)
|
|
12
|
+
*
|
|
13
|
+
* Use this base class for commands that need workspace database access
|
|
14
|
+
* but do NOT require a ticket provider (PMO, Linear, etc.). For commands
|
|
15
|
+
* that need ticket/project operations, use PMOCommand which extends this.
|
|
16
|
+
*
|
|
17
|
+
* Commands that don't need workspace.db should extend PromptCommand directly.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { RuntimeCommand, runtimeBaseFlags } from '../../lib/runtime-command.js';
|
|
22
|
+
*
|
|
23
|
+
* export default class MyCommand extends RuntimeCommand {
|
|
24
|
+
* static flags = { ...runtimeBaseFlags };
|
|
25
|
+
*
|
|
26
|
+
* async execute(): Promise<void> {
|
|
27
|
+
* // HQ path and workspace.db are available
|
|
28
|
+
* const hqPath = this.requireHQ();
|
|
29
|
+
* const db = this.requireDB();
|
|
30
|
+
* const apiKey = this.settings?.get('linear.api_key');
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
import { Flags } from '@oclif/core';
|
|
36
|
+
import inquirer from 'inquirer';
|
|
37
|
+
import { PromptCommand } from './prompt-command.js';
|
|
38
|
+
import { findHQRoot } from './workspace.js';
|
|
39
|
+
import { openWorkspaceDatabase, getWorkspaceConfig } from './database/index.js';
|
|
40
|
+
import { SettingsStore } from './database/settings-store.js';
|
|
41
|
+
import { shouldOutputJson, isNonTTY, outputPromptAsJson, outputErrorAsJson, createMetadata, } from './prompt-json.js';
|
|
42
|
+
import { withSignalSafePrompt } from './signal-handler.js';
|
|
43
|
+
/**
|
|
44
|
+
* Base flags for machine-readable output mode.
|
|
45
|
+
* Include these in your command's flags by spreading: ...machineOutputFlags
|
|
46
|
+
*/
|
|
47
|
+
export const machineOutputFlags = {
|
|
48
|
+
json: Flags.boolean({
|
|
49
|
+
description: 'Output as JSON for AI agents/scripts',
|
|
50
|
+
default: false,
|
|
51
|
+
}),
|
|
52
|
+
machine: Flags.boolean({
|
|
53
|
+
char: 'm',
|
|
54
|
+
description: 'Output as JSON for AI agents/scripts',
|
|
55
|
+
default: false,
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Base flags for RuntimeCommand subclasses.
|
|
60
|
+
* Includes machine output flags. Add command-specific flags alongside.
|
|
61
|
+
*/
|
|
62
|
+
export const runtimeBaseFlags = {
|
|
63
|
+
...machineOutputFlags,
|
|
64
|
+
};
|
|
65
|
+
export class RuntimeCommand extends PromptCommand {
|
|
66
|
+
/**
|
|
67
|
+
* Workspace database connection.
|
|
68
|
+
* Available after init() runs. May be null if no HQ found or DB failed to open.
|
|
69
|
+
*/
|
|
70
|
+
_db = null;
|
|
71
|
+
/**
|
|
72
|
+
* Settings store for workspace_settings table.
|
|
73
|
+
* Available after init() runs. May be null if no DB available.
|
|
74
|
+
*/
|
|
75
|
+
_settings = null;
|
|
76
|
+
/**
|
|
77
|
+
* HQ workspace root path.
|
|
78
|
+
* Available after init() runs. May be null if not in an HQ workspace.
|
|
79
|
+
*/
|
|
80
|
+
_hqPath = null;
|
|
81
|
+
/**
|
|
82
|
+
* Workspace configuration from workspace.db.
|
|
83
|
+
* Available after init() runs. May be null if no DB available.
|
|
84
|
+
*/
|
|
85
|
+
_workspaceConfig = null;
|
|
86
|
+
/**
|
|
87
|
+
* Flag to track if runtime context was successfully initialized
|
|
88
|
+
*/
|
|
89
|
+
_runtimeInitialized = false;
|
|
90
|
+
/**
|
|
91
|
+
* oclif init hook - runs before the command executes.
|
|
92
|
+
* Resolves HQ workspace and opens workspace.db.
|
|
93
|
+
*/
|
|
94
|
+
async init() {
|
|
95
|
+
await super.init();
|
|
96
|
+
this._hqPath = findHQRoot(process.cwd());
|
|
97
|
+
if (!this._hqPath) {
|
|
98
|
+
return; // No HQ found — subclass decides whether to error
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
this._db = openWorkspaceDatabase(this._hqPath);
|
|
102
|
+
this._settings = new SettingsStore(this._db);
|
|
103
|
+
this._workspaceConfig = getWorkspaceConfig(this._hqPath);
|
|
104
|
+
this._runtimeInitialized = true;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// Database open failed — subclass decides how to handle
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Override run() to delegate to execute() and ensure cleanup.
|
|
112
|
+
* Subclasses should implement execute() instead of run().
|
|
113
|
+
*/
|
|
114
|
+
async run() {
|
|
115
|
+
try {
|
|
116
|
+
await this.execute();
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
await this.cleanup();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Cleanup handler — ensures database connections are closed.
|
|
124
|
+
* Called automatically after execute() completes or throws.
|
|
125
|
+
* Override in subclasses to add additional cleanup (call super.cleanup()).
|
|
126
|
+
*/
|
|
127
|
+
async cleanup() {
|
|
128
|
+
if (this._runtimeInitialized && this._db) {
|
|
129
|
+
try {
|
|
130
|
+
this._db.close();
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
// Ignore close errors — database might already be closed
|
|
134
|
+
}
|
|
135
|
+
this._db = null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* oclif catch hook — called when an error occurs.
|
|
140
|
+
* Ensures cleanup even on errors.
|
|
141
|
+
*/
|
|
142
|
+
async catch(error) {
|
|
143
|
+
await this.cleanup();
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* oclif finally hook — called after run() completes.
|
|
148
|
+
*/
|
|
149
|
+
async finally(_) {
|
|
150
|
+
await this.cleanup();
|
|
151
|
+
}
|
|
152
|
+
// ─── Getters ────────────────────────────────────────────────
|
|
153
|
+
/** HQ workspace root path, or null if not in an HQ workspace. */
|
|
154
|
+
get hqPath() {
|
|
155
|
+
return this._hqPath;
|
|
156
|
+
}
|
|
157
|
+
/** Workspace database connection, or null if not available. */
|
|
158
|
+
get db() {
|
|
159
|
+
return this._db;
|
|
160
|
+
}
|
|
161
|
+
/** Settings store for workspace_settings, or null if not available. */
|
|
162
|
+
get settings() {
|
|
163
|
+
return this._settings;
|
|
164
|
+
}
|
|
165
|
+
/** Workspace configuration, or null if not available. */
|
|
166
|
+
get workspaceConfig() {
|
|
167
|
+
return this._workspaceConfig;
|
|
168
|
+
}
|
|
169
|
+
/** Whether the runtime context was successfully initialized. */
|
|
170
|
+
get runtimeInitialized() {
|
|
171
|
+
return this._runtimeInitialized;
|
|
172
|
+
}
|
|
173
|
+
// ─── Require helpers (throw if missing) ─────────────────────
|
|
174
|
+
/**
|
|
175
|
+
* Require HQ workspace to be available. Throws with a helpful
|
|
176
|
+
* error message if no HQ was found.
|
|
177
|
+
*/
|
|
178
|
+
requireHQ() {
|
|
179
|
+
if (!this._hqPath) {
|
|
180
|
+
throw new Error('Not in an HQ workspace. Run "prlt new" first.');
|
|
181
|
+
}
|
|
182
|
+
return this._hqPath;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Require workspace database to be available. Throws with a helpful
|
|
186
|
+
* error message if the DB could not be opened.
|
|
187
|
+
*/
|
|
188
|
+
requireDB() {
|
|
189
|
+
if (!this._db) {
|
|
190
|
+
throw new Error('Workspace database not available. Run "prlt new" first.');
|
|
191
|
+
}
|
|
192
|
+
return this._db;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Require settings store to be available.
|
|
196
|
+
*/
|
|
197
|
+
requireSettings() {
|
|
198
|
+
if (!this._settings) {
|
|
199
|
+
throw new Error('Workspace settings not available. Run "prlt new" first.');
|
|
200
|
+
}
|
|
201
|
+
return this._settings;
|
|
202
|
+
}
|
|
203
|
+
// ─── Prompt utilities ───────────────────────────────────────
|
|
204
|
+
/**
|
|
205
|
+
* Select from a list of items with JSON mode support for AI agents.
|
|
206
|
+
*
|
|
207
|
+
* In JSON mode: outputs choices as JSON with command field and exits
|
|
208
|
+
* In interactive mode: shows prompt and returns selected value
|
|
209
|
+
*
|
|
210
|
+
* @param options Configuration for the selection
|
|
211
|
+
* @returns The selected value (only in interactive mode)
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```typescript
|
|
215
|
+
* const ticketId = await this.selectFromList({
|
|
216
|
+
* message: 'Select ticket:',
|
|
217
|
+
* items: tickets,
|
|
218
|
+
* getName: (t) => `${t.id}: ${t.title}`,
|
|
219
|
+
* getValue: (t) => t.id,
|
|
220
|
+
* getCommand: (t) => `prlt ticket view ${t.id} --json`,
|
|
221
|
+
* jsonMode: { flags, commandName: 'ticket view' },
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
async selectFromList(options) {
|
|
226
|
+
const { message, items, getName, getValue, getCommand, jsonMode, allowCancel = false, cancelValue, } = options;
|
|
227
|
+
// Auto-detect non-TTY: switch to JSON mode when no TTY present
|
|
228
|
+
const effectiveJsonMode = jsonMode ?? (isNonTTY()
|
|
229
|
+
? { flags: { json: true }, commandName: this.id ?? 'unknown' }
|
|
230
|
+
: null);
|
|
231
|
+
// Build choices with command field
|
|
232
|
+
const choices = items.map(item => ({
|
|
233
|
+
name: getName(item),
|
|
234
|
+
value: getValue(item),
|
|
235
|
+
command: getCommand(item),
|
|
236
|
+
}));
|
|
237
|
+
// Check for JSON mode
|
|
238
|
+
if (effectiveJsonMode && shouldOutputJson(effectiveJsonMode.flags)) {
|
|
239
|
+
outputPromptAsJson({
|
|
240
|
+
type: 'list',
|
|
241
|
+
name: 'selection',
|
|
242
|
+
message,
|
|
243
|
+
choices,
|
|
244
|
+
}, createMetadata(effectiveJsonMode.commandName, effectiveJsonMode.flags));
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
// Interactive mode
|
|
248
|
+
const interactiveChoices = choices.map(c => ({
|
|
249
|
+
name: c.name,
|
|
250
|
+
value: c.value,
|
|
251
|
+
}));
|
|
252
|
+
if (allowCancel) {
|
|
253
|
+
interactiveChoices.push({ name: '─'.repeat(20), value: '__separator__' }, { name: 'Cancel', value: cancelValue ?? '__cancel__' });
|
|
254
|
+
}
|
|
255
|
+
const { selection } = await withSignalSafePrompt(() => inquirer.prompt([{
|
|
256
|
+
type: 'list',
|
|
257
|
+
name: 'selection',
|
|
258
|
+
message,
|
|
259
|
+
choices: interactiveChoices,
|
|
260
|
+
}]));
|
|
261
|
+
if (selection === '__cancel__' || selection === '__separator__') {
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
return selection;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Prompt for input with JSON mode support for AI agents.
|
|
268
|
+
*
|
|
269
|
+
* In JSON mode: outputs field info as JSON and exits
|
|
270
|
+
* In interactive mode: shows prompt and returns input value
|
|
271
|
+
*
|
|
272
|
+
* @param options Configuration for the input
|
|
273
|
+
* @returns The input value (only in interactive mode)
|
|
274
|
+
*/
|
|
275
|
+
async promptForInput(options) {
|
|
276
|
+
const { message, fieldName, defaultValue, validate, jsonMode } = options;
|
|
277
|
+
// Auto-detect non-TTY: switch to JSON mode when no TTY present
|
|
278
|
+
const effectiveJsonMode = jsonMode ?? (isNonTTY()
|
|
279
|
+
? { flags: { json: true }, commandName: this.id ?? 'unknown', commandHint: '', example: undefined }
|
|
280
|
+
: null);
|
|
281
|
+
// Check for JSON mode
|
|
282
|
+
if (effectiveJsonMode && shouldOutputJson(effectiveJsonMode.flags)) {
|
|
283
|
+
outputPromptAsJson({
|
|
284
|
+
type: 'input',
|
|
285
|
+
name: fieldName,
|
|
286
|
+
message,
|
|
287
|
+
default: defaultValue,
|
|
288
|
+
context: {
|
|
289
|
+
hint: effectiveJsonMode.commandHint,
|
|
290
|
+
example: effectiveJsonMode.example,
|
|
291
|
+
},
|
|
292
|
+
}, createMetadata(effectiveJsonMode.commandName, effectiveJsonMode.flags));
|
|
293
|
+
return '';
|
|
294
|
+
}
|
|
295
|
+
// Interactive mode
|
|
296
|
+
const { value } = await withSignalSafePrompt(() => inquirer.prompt([{
|
|
297
|
+
type: 'input',
|
|
298
|
+
name: 'value',
|
|
299
|
+
message,
|
|
300
|
+
default: defaultValue,
|
|
301
|
+
validate,
|
|
302
|
+
}]));
|
|
303
|
+
return value;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Unified error handler for JSON/interactive modes.
|
|
307
|
+
*
|
|
308
|
+
* Consolidates error handling to avoid message drift between JSON and interactive modes.
|
|
309
|
+
* In JSON mode: outputs structured error JSON and exits
|
|
310
|
+
* In interactive mode: calls this.error() with the message
|
|
311
|
+
*/
|
|
312
|
+
handleError(code, message, options) {
|
|
313
|
+
if (options.jsonMode) {
|
|
314
|
+
outputErrorAsJson(code, message, createMetadata(options.commandName, options.flags));
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
this.error(message);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=runtime-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-command.js","sourceRoot":"","sources":["../../src/lib/runtime-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,KAAK,EA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AC,MAAM,CAAC,CAAC;gBACf,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;gBACb,OAAO;gBACP,OAAO,EAAE,YAAY;gBACrB,QAAQ;aACT,CAAC,CAAC,CACJ,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACO,WAAW,CACnB,IAAY,EACZ,OAAe,EACf,OAIC;QAED,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YACrF,OAAM;QACR,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { loadProviderSources, resolveApiKey } from '../work-source/provider-sources.js';
|
|
7
7
|
import { SettingsStore } from '../database/settings-store.js';
|
|
8
|
+
import { getCredential, setCredential, deleteCredential, hasCredential } from '../database/credential-store.js';
|
|
8
9
|
const SHORTCUT_CONFIG_KEYS = {
|
|
9
10
|
apiToken: 'shortcut.api_token',
|
|
10
11
|
workspaceSlug: 'shortcut.workspace_slug',
|
|
@@ -13,7 +14,7 @@ const SHORTCUT_CONFIG_KEYS = {
|
|
|
13
14
|
* Check if Shortcut is configured.
|
|
14
15
|
*/
|
|
15
16
|
export function isShortcutConfigured(db) {
|
|
16
|
-
const hasDbConfig =
|
|
17
|
+
const hasDbConfig = hasCredential(db, SHORTCUT_CONFIG_KEYS.apiToken);
|
|
17
18
|
if (hasDbConfig)
|
|
18
19
|
return true;
|
|
19
20
|
const hasEnvToken = !!(process.env.PRLT_SHORTCUT_API_TOKEN || process.env.SHORTCUT_API_TOKEN);
|
|
@@ -24,7 +25,7 @@ export function isShortcutConfigured(db) {
|
|
|
24
25
|
*/
|
|
25
26
|
export function loadShortcutConfig(db) {
|
|
26
27
|
const settings = new SettingsStore(db);
|
|
27
|
-
const apiToken =
|
|
28
|
+
const apiToken = getCredential(db, SHORTCUT_CONFIG_KEYS.apiToken)
|
|
28
29
|
|| process.env.PRLT_SHORTCUT_API_TOKEN
|
|
29
30
|
|| process.env.SHORTCUT_API_TOKEN;
|
|
30
31
|
if (!apiToken)
|
|
@@ -42,7 +43,7 @@ export function loadShortcutConfig(db) {
|
|
|
42
43
|
*/
|
|
43
44
|
export function saveShortcutConfig(db, config) {
|
|
44
45
|
const settings = new SettingsStore(db);
|
|
45
|
-
|
|
46
|
+
setCredential(db, SHORTCUT_CONFIG_KEYS.apiToken, config.apiToken);
|
|
46
47
|
if (config.workspaceSlug) {
|
|
47
48
|
settings.set(SHORTCUT_CONFIG_KEYS.workspaceSlug, config.workspaceSlug);
|
|
48
49
|
}
|
|
@@ -51,7 +52,7 @@ export function saveShortcutConfig(db, config) {
|
|
|
51
52
|
* Save the Shortcut API token.
|
|
52
53
|
*/
|
|
53
54
|
export function saveShortcutApiToken(db, apiToken) {
|
|
54
|
-
|
|
55
|
+
setCredential(db, SHORTCUT_CONFIG_KEYS.apiToken, apiToken);
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
58
|
* Save the Shortcut workspace slug.
|
|
@@ -65,7 +66,12 @@ export function saveShortcutWorkspaceSlug(db, slug) {
|
|
|
65
66
|
export function clearShortcutConfig(db) {
|
|
66
67
|
const settings = new SettingsStore(db);
|
|
67
68
|
for (const key of Object.values(SHORTCUT_CONFIG_KEYS)) {
|
|
68
|
-
|
|
69
|
+
if (key === SHORTCUT_CONFIG_KEYS.apiToken) {
|
|
70
|
+
deleteCredential(db, key);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
settings.delete(key);
|
|
74
|
+
}
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
77
|
/**
|
|
@@ -90,7 +96,7 @@ export function getShortcutApiToken(db) {
|
|
|
90
96
|
const envKey = process.env.PRLT_SHORTCUT_API_TOKEN || process.env.SHORTCUT_API_TOKEN;
|
|
91
97
|
if (envKey)
|
|
92
98
|
return envKey;
|
|
93
|
-
// 3. Legacy: stored workspace setting
|
|
94
|
-
return
|
|
99
|
+
// 3. Legacy: stored workspace setting (now in credentials.db)
|
|
100
|
+
return getCredential(db, SHORTCUT_CONFIG_KEYS.apiToken);
|
|
95
101
|
}
|
|
96
102
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/shortcut/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/shortcut/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAE/G,MAAM,oBAAoB,GAAG;IAC3B,QAAQ,EAAE,oBAAoB;IAC9B,aAAa,EAAE,yBAAyB;CAChC,CAAA;AAOV;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAqB;IACxD,MAAM,WAAW,GAAG,aAAa,CAAC,EAAE,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAA;IACpE,IAAI,WAAW;QAAE,OAAO,IAAI,CAAA;IAE5B,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC7F,OAAO,WAAW,CAAA;AACpB,CAAC;AA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