@proletariat/cli 0.3.16 → 0.3.18
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 -0
- package/dist/commands/action/create.js +74 -38
- package/dist/commands/action/delete.d.ts +1 -0
- package/dist/commands/action/delete.js +23 -24
- package/dist/commands/action/index.d.ts +1 -0
- package/dist/commands/action/index.js +5 -10
- package/dist/commands/action/list.d.ts +1 -0
- package/dist/commands/action/list.js +3 -1
- package/dist/commands/action/run.d.ts +1 -0
- package/dist/commands/action/run.js +44 -32
- package/dist/commands/action/show.d.ts +2 -0
- package/dist/commands/action/update.d.ts +1 -0
- package/dist/commands/action/update.js +80 -39
- package/dist/commands/agent/auth.d.ts +2 -0
- package/dist/commands/agent/auth.js +44 -3
- package/dist/commands/agent/discover.d.ts +2 -0
- package/dist/commands/agent/discover.js +35 -3
- package/dist/commands/agent/index.d.ts +1 -0
- package/dist/commands/agent/index.js +25 -45
- package/dist/commands/agent/list.d.ts +8 -3
- package/dist/commands/agent/list.js +16 -29
- package/dist/commands/agent/login.d.ts +1 -0
- package/dist/commands/agent/login.js +14 -32
- package/dist/commands/agent/rebuild.d.ts +1 -0
- package/dist/commands/agent/rebuild.js +2 -2
- package/dist/commands/agent/remove.d.ts +17 -0
- package/dist/commands/agent/remove.js +144 -0
- package/dist/commands/agent/restart.d.ts +1 -0
- package/dist/commands/agent/restart.js +2 -2
- package/dist/commands/agent/shell.d.ts +1 -0
- package/dist/commands/agent/shell.js +63 -76
- package/dist/commands/agent/staff/add.d.ts +1 -0
- package/dist/commands/agent/staff/add.js +7 -1
- package/dist/commands/agent/staff/index.d.ts +1 -0
- package/dist/commands/agent/staff/index.js +5 -4
- package/dist/commands/agent/staff/remove.d.ts +1 -0
- package/dist/commands/agent/status.d.ts +1 -0
- package/dist/commands/agent/status.js +11 -23
- package/dist/commands/agent/temp/cleanup.d.ts +1 -0
- package/dist/commands/agent/temp/index.d.ts +1 -0
- package/dist/commands/agent/temp/index.js +4 -3
- package/dist/commands/agent/themes/index.d.ts +1 -0
- package/dist/commands/agent/themes/index.js +9 -3
- package/dist/commands/agent/themes/set.d.ts +1 -0
- package/dist/commands/agent/themes/set.js +7 -1
- package/dist/commands/agent/visit.d.ts +1 -0
- package/dist/commands/agent/visit.js +11 -23
- package/dist/commands/autocomplete/setup.d.ts +11 -0
- package/dist/commands/autocomplete/setup.js +113 -8
- package/dist/commands/board/index.d.ts +4 -0
- package/dist/commands/board/index.js +32 -30
- package/dist/commands/board/watch.d.ts +2 -0
- package/dist/commands/branch/create.d.ts +1 -0
- package/dist/commands/branch/create.js +33 -41
- package/dist/commands/branch/index.d.ts +1 -0
- package/dist/commands/branch/list.d.ts +2 -0
- package/dist/commands/branch/validate.d.ts +2 -0
- package/dist/commands/branch/where.d.ts +1 -0
- package/dist/commands/claude.d.ts +6 -0
- package/dist/commands/claude.js +166 -116
- package/dist/commands/commit.d.ts +6 -0
- package/dist/commands/commit.js +68 -73
- package/dist/commands/config/index.d.ts +13 -0
- package/dist/commands/config/index.js +142 -98
- package/dist/commands/docker/clean.d.ts +2 -1
- package/dist/commands/docker/clean.js +20 -29
- package/dist/commands/docker/index.d.ts +1 -0
- package/dist/commands/docker/index.js +37 -41
- package/dist/commands/docker/prune.d.ts +2 -1
- package/dist/commands/docker/prune.js +20 -27
- package/dist/commands/docker/restart.d.ts +2 -1
- package/dist/commands/docker/restart.js +20 -29
- package/dist/commands/docker/stop.d.ts +2 -1
- package/dist/commands/docker/stop.js +20 -29
- package/dist/commands/epic/activate.d.ts +1 -0
- package/dist/commands/epic/archive.d.ts +1 -0
- package/dist/commands/epic/create.d.ts +1 -0
- package/dist/commands/epic/index.d.ts +1 -0
- package/dist/commands/epic/link/block.d.ts +1 -0
- package/dist/commands/epic/link/duplicates.d.ts +1 -0
- package/dist/commands/epic/link/index.d.ts +1 -0
- package/dist/commands/epic/link/relates.d.ts +1 -0
- package/dist/commands/epic/link/remove.d.ts +1 -0
- package/dist/commands/epic/list.d.ts +2 -0
- package/dist/commands/epic/move.d.ts +1 -0
- package/dist/commands/epic/progress.d.ts +1 -0
- package/dist/commands/epic/project.d.ts +1 -0
- package/dist/commands/epic/reorder.d.ts +1 -0
- package/dist/commands/epic/spec.d.ts +1 -0
- package/dist/commands/epic/ticket.d.ts +1 -0
- package/dist/commands/epic/view.d.ts +1 -0
- package/dist/commands/execution/index.d.ts +1 -0
- package/dist/commands/execution/index.js +9 -25
- package/dist/commands/execution/list.d.ts +2 -0
- package/dist/commands/execution/logs.d.ts +1 -0
- package/dist/commands/execution/logs.js +6 -16
- package/dist/commands/execution/stop.d.ts +1 -0
- package/dist/commands/execution/stop.js +4 -15
- package/dist/commands/gh/index.d.ts +1 -0
- package/dist/commands/gh/index.js +27 -27
- package/dist/commands/gh/login.d.ts +4 -0
- package/dist/commands/gh/login.js +31 -0
- package/dist/commands/gh/status.d.ts +4 -0
- package/dist/commands/gh/status.js +27 -4
- package/dist/commands/gh/token.d.ts +4 -0
- package/dist/commands/gh/token.js +49 -5
- package/dist/commands/phase/create.d.ts +1 -1
- package/dist/commands/phase/create.js +116 -74
- package/dist/commands/phase/delete.d.ts +1 -0
- package/dist/commands/phase/delete.js +23 -22
- package/dist/commands/phase/list.d.ts +1 -0
- package/dist/commands/phase/list.js +3 -5
- package/dist/commands/phase/move.d.ts +1 -0
- package/dist/commands/phase/move.js +39 -39
- package/dist/commands/phase/template/apply.d.ts +1 -0
- package/dist/commands/phase/template/create.d.ts +2 -0
- package/dist/commands/phase/template/delete.d.ts +1 -0
- package/dist/commands/phase/template/index.d.ts +1 -0
- package/dist/commands/phase/template/list.d.ts +1 -0
- package/dist/commands/phase/template/update.d.ts +2 -0
- package/dist/commands/phase/update.d.ts +1 -1
- package/dist/commands/phase/update.js +89 -55
- package/dist/commands/pmo/init.d.ts +2 -0
- package/dist/commands/pmo/init.js +84 -22
- package/dist/commands/pr/create.d.ts +12 -3
- package/dist/commands/pr/create.js +130 -147
- package/dist/commands/pr/index.d.ts +6 -3
- package/dist/commands/pr/index.js +41 -39
- package/dist/commands/pr/link.d.ts +7 -3
- package/dist/commands/pr/link.js +126 -150
- package/dist/commands/pr/status.d.ts +6 -3
- package/dist/commands/pr/status.js +101 -126
- package/dist/commands/project/archive.d.ts +1 -0
- package/dist/commands/project/archive.js +15 -20
- package/dist/commands/project/create.d.ts +1 -0
- package/dist/commands/project/create.js +13 -5
- package/dist/commands/project/delete.d.ts +1 -0
- package/dist/commands/project/delete.js +14 -28
- package/dist/commands/project/index.d.ts +1 -0
- package/dist/commands/project/index.js +0 -5
- package/dist/commands/project/list.d.ts +2 -0
- package/dist/commands/project/list.js +21 -3
- package/dist/commands/project/spec.d.ts +1 -0
- package/dist/commands/project/spec.js +17 -23
- package/dist/commands/project/unarchive.d.ts +2 -0
- package/dist/commands/project/unarchive.js +21 -2
- package/dist/commands/project/view.d.ts +1 -0
- package/dist/commands/project/view.js +34 -22
- package/dist/commands/repo/add.d.ts +2 -0
- package/dist/commands/repo/add.js +44 -1
- package/dist/commands/repo/index.d.ts +1 -0
- package/dist/commands/repo/index.js +20 -38
- package/dist/commands/repo/list.d.ts +2 -0
- package/dist/commands/repo/remove.d.ts +1 -0
- package/dist/commands/repo/remove.js +45 -63
- package/dist/commands/repo/view.d.ts +2 -0
- package/dist/commands/repo/view.js +30 -5
- package/dist/commands/roadmap/add-project.d.ts +1 -0
- package/dist/commands/roadmap/create.d.ts +1 -0
- package/dist/commands/roadmap/delete.d.ts +1 -0
- package/dist/commands/roadmap/generate.d.ts +1 -0
- package/dist/commands/roadmap/index.d.ts +1 -0
- package/dist/commands/roadmap/list.d.ts +2 -0
- package/dist/commands/roadmap/remove-project.d.ts +1 -0
- package/dist/commands/roadmap/reorder.d.ts +1 -0
- package/dist/commands/roadmap/update.d.ts +1 -0
- package/dist/commands/roadmap/view.d.ts +1 -0
- package/dist/commands/session/attach.d.ts +1 -0
- package/dist/commands/session/index.d.ts +1 -0
- package/dist/commands/session/index.js +8 -25
- package/dist/commands/session/list.d.ts +2 -0
- package/dist/commands/spec/create.d.ts +1 -1
- package/dist/commands/spec/create.js +64 -65
- package/dist/commands/spec/index.d.ts +1 -0
- package/dist/commands/spec/index.js +36 -22
- package/dist/commands/spec/link/depends.d.ts +1 -0
- package/dist/commands/spec/link/depends.js +6 -6
- package/dist/commands/spec/link/duplicates.d.ts +1 -0
- package/dist/commands/spec/link/duplicates.js +6 -6
- package/dist/commands/spec/link/index.d.ts +2 -1
- package/dist/commands/spec/link/index.js +0 -4
- package/dist/commands/spec/link/relates.d.ts +1 -0
- package/dist/commands/spec/link/relates.js +6 -6
- package/dist/commands/spec/link/remove.d.ts +2 -1
- package/dist/commands/spec/link/remove.js +6 -6
- package/dist/commands/spec/list.d.ts +2 -0
- package/dist/commands/spec/list.js +25 -0
- package/dist/commands/spec/plan.d.ts +2 -1
- package/dist/commands/spec/plan.js +19 -26
- package/dist/commands/spec/ticket.d.ts +2 -1
- package/dist/commands/spec/ticket.js +48 -34
- package/dist/commands/spec/view.d.ts +2 -1
- package/dist/commands/spec/view.js +25 -16
- package/dist/commands/status/create.d.ts +1 -1
- package/dist/commands/status/create.js +80 -64
- package/dist/commands/status/delete.d.ts +2 -1
- package/dist/commands/status/delete.js +26 -22
- package/dist/commands/status/index.d.ts +1 -0
- package/dist/commands/status/index.js +26 -19
- package/dist/commands/status/list.d.ts +1 -0
- package/dist/commands/status/list.js +12 -7
- package/dist/commands/status/move.d.ts +2 -1
- package/dist/commands/status/move.js +62 -61
- package/dist/commands/status/update.d.ts +2 -2
- package/dist/commands/status/update.js +110 -77
- package/dist/commands/template/delete.d.ts +1 -0
- package/dist/commands/template/delete.js +47 -48
- package/dist/commands/template/index.d.ts +1 -0
- package/dist/commands/template/index.js +26 -33
- package/dist/commands/template/list.d.ts +1 -0
- package/dist/commands/template/phase/create.d.ts +1 -0
- package/dist/commands/template/phase/create.js +6 -0
- package/dist/commands/template/phase/index.d.ts +1 -0
- package/dist/commands/template/phase/index.js +27 -26
- package/dist/commands/template/phase/update.d.ts +1 -0
- package/dist/commands/template/phase/update.js +6 -0
- package/dist/commands/template/ticket/index.d.ts +1 -0
- package/dist/commands/template/ticket/index.js +27 -26
- package/dist/commands/template/ticket/save.d.ts +1 -0
- package/dist/commands/template/ticket/save.js +6 -0
- package/dist/commands/terminal/title.d.ts +26 -0
- package/dist/commands/terminal/title.js +37 -3
- package/dist/commands/ticket/bulk.d.ts +1 -0
- package/dist/commands/ticket/complete.d.ts +1 -0
- package/dist/commands/ticket/complete.js +18 -14
- package/dist/commands/ticket/create.d.ts +1 -0
- package/dist/commands/ticket/create.js +45 -41
- package/dist/commands/ticket/delete.d.ts +1 -0
- package/dist/commands/ticket/delete.js +1 -1
- package/dist/commands/ticket/edit.d.ts +1 -0
- package/dist/commands/ticket/edit.js +1 -1
- package/dist/commands/ticket/epic.d.ts +1 -0
- package/dist/commands/ticket/epic.js +2 -2
- package/dist/commands/ticket/index.d.ts +1 -0
- package/dist/commands/ticket/link/block.d.ts +1 -0
- package/dist/commands/ticket/link/block.js +1 -1
- package/dist/commands/ticket/link/duplicates.d.ts +1 -0
- package/dist/commands/ticket/link/duplicates.js +1 -1
- package/dist/commands/ticket/link/index.d.ts +1 -0
- package/dist/commands/ticket/link/index.js +9 -8
- package/dist/commands/ticket/link/relates.d.ts +1 -0
- package/dist/commands/ticket/link/relates.js +1 -1
- package/dist/commands/ticket/link/remove.d.ts +1 -0
- package/dist/commands/ticket/link/remove.js +1 -1
- package/dist/commands/ticket/list.d.ts +2 -0
- package/dist/commands/ticket/move.d.ts +1 -0
- package/dist/commands/ticket/move.js +27 -19
- package/dist/commands/ticket/project.d.ts +1 -0
- package/dist/commands/ticket/project.js +3 -3
- package/dist/commands/ticket/reassign.d.ts +1 -0
- package/dist/commands/ticket/reassign.js +1 -1
- package/dist/commands/ticket/spec.d.ts +1 -0
- package/dist/commands/ticket/spec.js +3 -3
- package/dist/commands/ticket/status.d.ts +1 -0
- package/dist/commands/ticket/status.js +1 -1
- package/dist/commands/ticket/template/apply.d.ts +1 -0
- package/dist/commands/ticket/template/create.d.ts +2 -0
- package/dist/commands/ticket/template/delete.d.ts +1 -0
- package/dist/commands/ticket/template/index.d.ts +1 -0
- package/dist/commands/ticket/template/list.d.ts +1 -0
- package/dist/commands/ticket/template/save.d.ts +2 -0
- package/dist/commands/ticket/update.d.ts +1 -0
- package/dist/commands/ticket/update.js +1 -1
- package/dist/commands/ticket/view.d.ts +1 -0
- package/dist/commands/ticket/view.js +1 -1
- package/dist/commands/work/complete.d.ts +1 -0
- package/dist/commands/work/index.d.ts +1 -0
- package/dist/commands/work/ready.d.ts +1 -0
- package/dist/commands/work/revise.d.ts +1 -0
- package/dist/commands/work/spawn-all.d.ts +2 -0
- package/dist/commands/work/spawn-all.js +11 -4
- package/dist/commands/work/spawn.d.ts +1 -0
- package/dist/commands/work/spawn.js +261 -166
- package/dist/commands/work/start.d.ts +1 -0
- package/dist/commands/work/start.js +270 -189
- package/dist/commands/work/watch.d.ts +1 -0
- package/dist/commands/work/watch.js +63 -58
- package/dist/commands/workflow/create.d.ts +1 -0
- package/dist/commands/workflow/create.js +2 -4
- package/dist/commands/workflow/delete.d.ts +1 -0
- package/dist/commands/workflow/delete.js +21 -33
- package/dist/commands/workflow/index.d.ts +1 -0
- package/dist/commands/workflow/list.d.ts +1 -0
- package/dist/commands/workflow/list.js +3 -6
- package/dist/commands/workflow/switch.d.ts +2 -0
- package/dist/commands/workflow/switch.js +46 -21
- package/dist/commands/workflow/view.d.ts +1 -0
- package/dist/commands/workflow/view.js +18 -27
- package/dist/commands/workspace/remove.d.ts +2 -2
- package/dist/commands/workspace/remove.js +16 -21
- package/dist/commands/workspace/use.d.ts +2 -2
- package/dist/commands/workspace/use.js +12 -18
- package/dist/lib/agents/commands.d.ts +1 -1
- package/dist/lib/agents/commands.js +4 -4
- package/dist/lib/database/drizzle-schema.d.ts +5009 -0
- package/dist/lib/database/drizzle-schema.js +699 -0
- package/dist/lib/database/drizzle.d.ts +29 -0
- package/dist/lib/database/drizzle.js +37 -0
- package/dist/lib/database/index.d.ts +1 -0
- package/dist/lib/database/index.js +1 -1
- package/dist/lib/execution/config.d.ts +6 -0
- package/dist/lib/execution/config.js +31 -13
- package/dist/lib/execution/devcontainer.js +13 -7
- package/dist/lib/execution/runners.js +24 -7
- package/dist/lib/execution/spawner.js +19 -0
- package/dist/lib/flags/index.d.ts +4 -0
- package/dist/lib/flags/index.js +4 -0
- package/dist/lib/flags/resolver.d.ts +224 -0
- package/dist/lib/flags/resolver.js +313 -0
- package/dist/lib/pmo/base-command.d.ts +53 -3
- package/dist/lib/pmo/base-command.js +92 -13
- package/dist/lib/pmo/find-pmo.d.ts +1 -1
- package/dist/lib/pmo/find-pmo.js +4 -4
- package/dist/lib/pmo/index.d.ts +1 -1
- package/dist/lib/pmo/index.js +1 -1
- package/dist/lib/pmo/storage/helpers.js +2 -1
- package/dist/lib/pmo/storage/index.d.ts +9 -0
- package/dist/lib/pmo/storage/index.js +14 -0
- package/dist/lib/pmo/storage/projects.d.ts +28 -13
- package/dist/lib/pmo/storage/projects.js +110 -34
- package/dist/lib/pmo/storage/roadmaps.d.ts +2 -0
- package/dist/lib/pmo/storage/roadmaps.js +182 -111
- package/dist/lib/pmo/storage/specs.js +13 -16
- package/dist/lib/pmo/storage/subtasks.js +17 -2
- package/dist/lib/pmo/storage/tickets.d.ts +12 -2
- package/dist/lib/pmo/storage/tickets.js +63 -5
- package/dist/lib/pmo/storage/types.d.ts +7 -3
- package/dist/lib/pmo/storage/views.d.ts +12 -1
- package/dist/lib/pmo/storage/views.js +61 -6
- package/dist/lib/prompt-command.d.ts +90 -0
- package/dist/lib/prompt-command.js +102 -0
- package/dist/lib/prompt-json.d.ts +34 -4
- package/dist/lib/prompt-json.js +35 -3
- package/dist/lib/repos/index.js +15 -15
- package/dist/lib/workspace.d.ts +4 -3
- package/dist/lib/workspace.js +3 -3
- package/oclif.manifest.json +4610 -2997
- package/package.json +13 -5
|
@@ -25,6 +25,7 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
25
25
|
session: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
26
|
focus: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
27
27
|
clone: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
29
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
30
|
};
|
|
30
31
|
execute(): Promise<void>;
|
|
@@ -6,7 +6,8 @@ import { PMOCommand, pmoBaseFlags, autoExportToBoard } from '../../lib/pmo/index
|
|
|
6
6
|
import { styles } from '../../lib/styles.js';
|
|
7
7
|
import { getWorkspaceInfo, getTicketTmuxSession, killTmuxSession } from '../../lib/agents/commands.js';
|
|
8
8
|
import { isDockerRunning, isGitHubTokenAvailable, isDevcontainerCliInstalled } from '../../lib/execution/runners.js';
|
|
9
|
-
import { shouldOutputJson,
|
|
9
|
+
import { shouldOutputJson, outputSuccessAsJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
10
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
10
11
|
export default class WorkSpawn extends PMOCommand {
|
|
11
12
|
static description = 'Spawn work for multiple tickets by column (batch mode)';
|
|
12
13
|
static strict = false; // Allow multiple ticket ID args without defining them
|
|
@@ -116,10 +117,16 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
116
117
|
};
|
|
117
118
|
async execute() {
|
|
118
119
|
const { flags, argv } = await this.parse(WorkSpawn);
|
|
119
|
-
// This command requires project context
|
|
120
|
-
const projectId = await this.requireProject();
|
|
121
120
|
// Check if JSON output mode is active
|
|
122
121
|
const jsonMode = shouldOutputJson(flags);
|
|
122
|
+
// This command requires project context (pass JSON mode config for AI agents)
|
|
123
|
+
const projectId = await this.requireProject({
|
|
124
|
+
jsonMode: {
|
|
125
|
+
flags,
|
|
126
|
+
commandName: 'work spawn',
|
|
127
|
+
baseCommand: 'prlt work spawn',
|
|
128
|
+
},
|
|
129
|
+
});
|
|
123
130
|
// Helper to handle errors in JSON mode
|
|
124
131
|
const handleError = (code, message) => {
|
|
125
132
|
if (jsonMode) {
|
|
@@ -177,28 +184,27 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
177
184
|
spawnMode = 'many';
|
|
178
185
|
}
|
|
179
186
|
else if (!flags.column) {
|
|
180
|
-
//
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
name: '
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
spawnMode = mode;
|
|
187
|
+
// Use FlagResolver for mode selection prompt
|
|
188
|
+
const modeResolver = new FlagResolver({
|
|
189
|
+
commandName: 'work spawn',
|
|
190
|
+
baseCommand: 'prlt work spawn',
|
|
191
|
+
jsonMode,
|
|
192
|
+
flags: {},
|
|
193
|
+
context: { projectId },
|
|
194
|
+
});
|
|
195
|
+
modeResolver.addPrompt({
|
|
196
|
+
flagName: 'mode',
|
|
197
|
+
type: 'list',
|
|
198
|
+
message: 'How would you like to spawn work?',
|
|
199
|
+
choices: () => [
|
|
200
|
+
{ name: jsonMode ? 'All - Spawn all tickets in a column' : '📦 All - Spawn all tickets tickets in a column', value: 'all' },
|
|
201
|
+
{ name: jsonMode ? 'Many - Select specific tickets to spawn' : '✅ Many - Select specific tickets to spawn', value: 'many' },
|
|
202
|
+
],
|
|
203
|
+
});
|
|
204
|
+
const resolved = await modeResolver.resolve();
|
|
205
|
+
// In JSON mode, resolve() exits after outputting prompt, so we never reach here
|
|
206
|
+
// In interactive mode, we get the selected value
|
|
207
|
+
spawnMode = resolved.mode;
|
|
202
208
|
}
|
|
203
209
|
let ticketsToSpawn = [];
|
|
204
210
|
if (spawnMode === 'args') {
|
|
@@ -240,29 +246,28 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
240
246
|
// ALL MODE: Column picker, then spawn all tickets in that column
|
|
241
247
|
let targetColumn = flags.column;
|
|
242
248
|
if (!targetColumn) {
|
|
243
|
-
//
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
249
|
+
// Use FlagResolver for column selection
|
|
250
|
+
const columnResolver = new FlagResolver({
|
|
251
|
+
commandName: 'work spawn',
|
|
252
|
+
baseCommand: 'prlt work spawn --all',
|
|
253
|
+
jsonMode,
|
|
254
|
+
flags: {},
|
|
255
|
+
context: { projectId },
|
|
250
256
|
});
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
targetColumn = selectedColumn;
|
|
257
|
+
columnResolver.addPrompt({
|
|
258
|
+
flagName: 'selectedColumn',
|
|
259
|
+
type: 'list',
|
|
260
|
+
message: 'Select column to spawn all tickets tickets from:',
|
|
261
|
+
choices: () => columnNames.map(name => {
|
|
262
|
+
const count = allTickets.filter(t => t.statusName === name).length;
|
|
263
|
+
return {
|
|
264
|
+
name: `${name} (${count} tickets)`,
|
|
265
|
+
value: name,
|
|
266
|
+
};
|
|
267
|
+
}),
|
|
268
|
+
});
|
|
269
|
+
const resolved = await columnResolver.resolve();
|
|
270
|
+
targetColumn = resolved.selectedColumn;
|
|
266
271
|
}
|
|
267
272
|
// Verify column exists
|
|
268
273
|
const matchedColumn = columnNames.find(c => c.toLowerCase() === targetColumn.toLowerCase());
|
|
@@ -288,15 +293,28 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
288
293
|
// In JSON mode with --many, output the ticket selection prompt directly
|
|
289
294
|
// (skip column selection for simplicity - show all tickets)
|
|
290
295
|
if (jsonMode) {
|
|
291
|
-
//
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
296
|
+
// Use FlagResolver for ticket selection in JSON mode
|
|
297
|
+
const ticketResolver = new FlagResolver({
|
|
298
|
+
commandName: 'work spawn',
|
|
299
|
+
baseCommand: 'prlt work spawn',
|
|
300
|
+
jsonMode,
|
|
301
|
+
flags: {},
|
|
302
|
+
context: { projectId },
|
|
303
|
+
});
|
|
304
|
+
ticketResolver.addPrompt({
|
|
305
|
+
flagName: 'selectedTickets',
|
|
306
|
+
type: 'checkbox',
|
|
307
|
+
message: 'Select tickets to spawn (provide ticket IDs as positional args to execute):',
|
|
308
|
+
choices: () => allTickets.map(ticket => {
|
|
309
|
+
const priority = ticket.priority ? `[${ticket.priority}] ` : '';
|
|
310
|
+
return {
|
|
311
|
+
name: `${priority}${ticket.id} - ${ticket.title} (${ticket.statusName || 'No Status'})`,
|
|
312
|
+
value: ticket.id,
|
|
313
|
+
};
|
|
314
|
+
}),
|
|
298
315
|
});
|
|
299
|
-
|
|
316
|
+
// In JSON mode, this exits after outputting prompt
|
|
317
|
+
await ticketResolver.resolve();
|
|
300
318
|
db.close();
|
|
301
319
|
return;
|
|
302
320
|
}
|
|
@@ -311,14 +329,21 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
311
329
|
value: name,
|
|
312
330
|
});
|
|
313
331
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
332
|
+
// Use FlagResolver for column selection (many mode)
|
|
333
|
+
const manyColumnResolver = new FlagResolver({
|
|
334
|
+
commandName: 'work spawn',
|
|
335
|
+
baseCommand: 'prlt work spawn --many',
|
|
336
|
+
jsonMode,
|
|
337
|
+
flags: {},
|
|
338
|
+
});
|
|
339
|
+
manyColumnResolver.addPrompt({
|
|
340
|
+
flagName: 'manyColumn',
|
|
341
|
+
type: 'list',
|
|
342
|
+
message: 'Select from which column:',
|
|
343
|
+
choices: () => columnChoices,
|
|
344
|
+
});
|
|
345
|
+
const manyColumnResult = await manyColumnResolver.resolve();
|
|
346
|
+
const manyColumn = manyColumnResult.manyColumn;
|
|
322
347
|
// Filter tickets based on column selection
|
|
323
348
|
const ticketsForSelection = manyColumn === '__ALL__'
|
|
324
349
|
? allTickets
|
|
@@ -343,6 +368,8 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
343
368
|
}
|
|
344
369
|
// Build choices with priority separators
|
|
345
370
|
const choices = [];
|
|
371
|
+
// Also build flat choices for JSON mode (without separators)
|
|
372
|
+
const flatChoices = [];
|
|
346
373
|
for (const priority of PRIORITY_ORDER) {
|
|
347
374
|
const tickets = ticketsByPriority.get(priority) || [];
|
|
348
375
|
if (tickets.length === 0)
|
|
@@ -350,26 +377,35 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
350
377
|
choices.push(new inquirer.Separator(`── ${priority} (${tickets.length}) ──`));
|
|
351
378
|
for (const ticket of tickets) {
|
|
352
379
|
const statusBadge = ticket.statusName ? ` [${ticket.statusName}]` : '';
|
|
353
|
-
|
|
380
|
+
const ticketChoice = {
|
|
354
381
|
name: `[${priority}] ${ticket.id} - ${ticket.title}${statusBadge}`,
|
|
355
382
|
value: ticket.id,
|
|
356
|
-
}
|
|
383
|
+
};
|
|
384
|
+
choices.push(ticketChoice);
|
|
385
|
+
flatChoices.push(ticketChoice);
|
|
357
386
|
}
|
|
358
387
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
388
|
+
// Use FlagResolver for ticket selection (checkbox)
|
|
389
|
+
const ticketSelectResolver = new FlagResolver({
|
|
390
|
+
commandName: 'work spawn',
|
|
391
|
+
baseCommand: 'prlt work spawn',
|
|
392
|
+
jsonMode,
|
|
393
|
+
flags: {},
|
|
394
|
+
});
|
|
395
|
+
ticketSelectResolver.addPrompt({
|
|
396
|
+
flagName: 'selectedTicketIds',
|
|
397
|
+
type: 'checkbox',
|
|
398
|
+
message: 'Select tickets to spawn (space to toggle, enter to confirm):',
|
|
399
|
+
choices: () => flatChoices,
|
|
400
|
+
validate: (input) => {
|
|
401
|
+
if (input.length === 0) {
|
|
402
|
+
return 'Please select at least one ticket';
|
|
403
|
+
}
|
|
404
|
+
return true;
|
|
371
405
|
},
|
|
372
|
-
|
|
406
|
+
});
|
|
407
|
+
const ticketSelectResult = await ticketSelectResolver.resolve();
|
|
408
|
+
const selectedTicketIds = ticketSelectResult.selectedTicketIds || [];
|
|
373
409
|
ticketsToSpawn = allTickets.filter(t => selectedTicketIds.includes(t.id));
|
|
374
410
|
this.log('');
|
|
375
411
|
this.log(styles.header(`🚀 Spawn Many: ${ticketsToSpawn.length} tickets`));
|
|
@@ -485,15 +521,22 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
485
521
|
name: 'adhoc - Unstructured exploration/debugging',
|
|
486
522
|
value: '__adhoc__',
|
|
487
523
|
});
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
524
|
+
// Use FlagResolver for action selection
|
|
525
|
+
const actionResolver = new FlagResolver({
|
|
526
|
+
commandName: 'work spawn',
|
|
527
|
+
baseCommand: 'prlt work spawn',
|
|
528
|
+
jsonMode,
|
|
529
|
+
flags: {},
|
|
530
|
+
});
|
|
531
|
+
actionResolver.addPrompt({
|
|
532
|
+
flagName: 'selectedAction',
|
|
533
|
+
type: 'list',
|
|
534
|
+
message: 'What action should agents perform?',
|
|
535
|
+
default: 'implement',
|
|
536
|
+
choices: () => actionChoices,
|
|
537
|
+
});
|
|
538
|
+
const actionResult = await actionResolver.resolve();
|
|
539
|
+
const selectedAction = actionResult.selectedAction;
|
|
497
540
|
batchAction = selectedAction === '__adhoc__' ? 'adhoc' : selectedAction;
|
|
498
541
|
}
|
|
499
542
|
// Now fetch action details after selection is made
|
|
@@ -523,18 +566,25 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
523
566
|
const defaultsDescription = modifiesCode
|
|
524
567
|
? 'devcontainer, terminal, interactive, safe permissions, create PRs'
|
|
525
568
|
: 'devcontainer, terminal, interactive, safe permissions, no PRs';
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
|
|
569
|
+
// Use FlagResolver for defaults choice
|
|
570
|
+
const defaultsResolver = new FlagResolver({
|
|
571
|
+
commandName: 'work spawn',
|
|
572
|
+
baseCommand: 'prlt work spawn',
|
|
573
|
+
jsonMode,
|
|
574
|
+
flags: {},
|
|
575
|
+
});
|
|
576
|
+
defaultsResolver.addPrompt({
|
|
577
|
+
flagName: 'useDefaults',
|
|
578
|
+
type: 'list',
|
|
579
|
+
message: `Use default settings for "${actionName}"?`,
|
|
580
|
+
default: 'yes',
|
|
581
|
+
choices: () => [
|
|
582
|
+
{ name: `✓ Yes - Use defaults (${defaultsDescription})`, value: 'yes' },
|
|
583
|
+
{ name: '✗ No - Configure each setting', value: 'no' },
|
|
584
|
+
],
|
|
585
|
+
});
|
|
586
|
+
const defaultsResult = await defaultsResolver.resolve();
|
|
587
|
+
const useDefaults = defaultsResult.useDefaults === 'yes';
|
|
538
588
|
if (useDefaults) {
|
|
539
589
|
// Apply defaults
|
|
540
590
|
if (hasDevcontainer) {
|
|
@@ -574,6 +624,31 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
574
624
|
missing.push('devcontainer CLI');
|
|
575
625
|
devcontainerLabel = `🐳 devcontainer (requires: ${missing.join(', ')})`;
|
|
576
626
|
}
|
|
627
|
+
const envChoices = [
|
|
628
|
+
{ name: devcontainerLabel, value: 'devcontainer', disabled: !devcontainerReady },
|
|
629
|
+
{ name: '💻 host (runs directly on your machine)', value: 'host' },
|
|
630
|
+
{ name: '✗ cancel', value: 'cancel' },
|
|
631
|
+
];
|
|
632
|
+
// In JSON mode, use FlagResolver (outputs prompt and exits)
|
|
633
|
+
if (jsonMode) {
|
|
634
|
+
const envResolver = new FlagResolver({
|
|
635
|
+
commandName: 'work spawn',
|
|
636
|
+
baseCommand: 'prlt work spawn',
|
|
637
|
+
jsonMode,
|
|
638
|
+
flags: {},
|
|
639
|
+
});
|
|
640
|
+
envResolver.addPrompt({
|
|
641
|
+
flagName: 'selectedEnvironment',
|
|
642
|
+
type: 'list',
|
|
643
|
+
message: 'Where should agents run?',
|
|
644
|
+
default: devcontainerReady ? 'devcontainer' : 'host',
|
|
645
|
+
choices: () => envChoices,
|
|
646
|
+
});
|
|
647
|
+
await envResolver.resolve();
|
|
648
|
+
// FlagResolver exits in JSON mode, so we never reach here
|
|
649
|
+
db.close();
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
577
652
|
let environmentSelected = false;
|
|
578
653
|
while (!environmentSelected) {
|
|
579
654
|
// eslint-disable-next-line no-await-in-loop -- Interactive loop with retry on Docker check
|
|
@@ -582,11 +657,7 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
582
657
|
type: 'list',
|
|
583
658
|
name: 'selectedEnvironment',
|
|
584
659
|
message: 'Where should agents run?',
|
|
585
|
-
choices:
|
|
586
|
-
{ name: devcontainerLabel, value: 'devcontainer', disabled: !devcontainerReady },
|
|
587
|
-
{ name: '💻 host (runs directly on your machine)', value: 'host' },
|
|
588
|
-
{ name: '✗ cancel', value: 'cancel' },
|
|
589
|
-
],
|
|
660
|
+
choices: envChoices,
|
|
590
661
|
default: devcontainerReady ? 'devcontainer' : 'host',
|
|
591
662
|
},
|
|
592
663
|
]);
|
|
@@ -615,32 +686,37 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
615
686
|
}
|
|
616
687
|
// Check GitHub token is available for git push operations
|
|
617
688
|
if (!isGitHubTokenAvailable()) {
|
|
618
|
-
const tokenChoices = [
|
|
619
|
-
{ name: 'Yes, continue anyway (git push may fail)', value: 'continue' },
|
|
620
|
-
{ name: 'No, let me run gh auth login first', value: 'cancel' },
|
|
621
|
-
{ name: 'Switch to host mode instead', value: 'host' },
|
|
622
|
-
];
|
|
623
689
|
const tokenMessage = 'GitHub token not found. Git push may fail. Continue without token?';
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
690
|
+
// Use FlagResolver for token action prompt
|
|
691
|
+
const tokenResolver = new FlagResolver({
|
|
692
|
+
commandName: 'work spawn',
|
|
693
|
+
baseCommand: 'prlt work spawn',
|
|
694
|
+
jsonMode,
|
|
695
|
+
flags: {},
|
|
696
|
+
});
|
|
697
|
+
tokenResolver.addPrompt({
|
|
698
|
+
flagName: 'tokenAction',
|
|
699
|
+
type: 'list',
|
|
700
|
+
message: tokenMessage,
|
|
701
|
+
default: 'continue',
|
|
702
|
+
choices: () => [
|
|
703
|
+
{ name: 'Yes, continue anyway (git push may fail)', value: 'continue' },
|
|
704
|
+
{ name: 'No, let me run gh auth login first', value: 'cancel' },
|
|
705
|
+
{ name: 'Switch to host mode instead', value: 'host' },
|
|
706
|
+
],
|
|
707
|
+
});
|
|
708
|
+
// In JSON mode, this will output prompt and exit
|
|
709
|
+
// In interactive mode, show warning first
|
|
710
|
+
if (!jsonMode) {
|
|
711
|
+
this.log('');
|
|
712
|
+
this.warn('GitHub token not found.\n' +
|
|
713
|
+
'Git push operations may fail inside containers.\n' +
|
|
714
|
+
'Run `gh auth login` to authenticate, or continue without token.');
|
|
715
|
+
this.log('');
|
|
628
716
|
}
|
|
629
|
-
this.log('');
|
|
630
|
-
this.warn('GitHub token not found.\n' +
|
|
631
|
-
'Git push operations may fail inside containers.\n' +
|
|
632
|
-
'Run `gh auth login` to authenticate, or continue without token.');
|
|
633
|
-
this.log('');
|
|
634
717
|
// eslint-disable-next-line no-await-in-loop -- Interactive user prompt in loop
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
type: 'list',
|
|
638
|
-
name: 'tokenAction',
|
|
639
|
-
message: tokenMessage,
|
|
640
|
-
choices: tokenChoices,
|
|
641
|
-
default: 'continue',
|
|
642
|
-
},
|
|
643
|
-
]);
|
|
718
|
+
const resolved = await tokenResolver.resolve();
|
|
719
|
+
const tokenAction = resolved.tokenAction;
|
|
644
720
|
if (tokenAction === 'cancel') {
|
|
645
721
|
db.close();
|
|
646
722
|
this.log(styles.muted('Run `gh auth login` and try again.'));
|
|
@@ -682,18 +758,25 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
682
758
|
}
|
|
683
759
|
// Prompt for display mode if not already set (for host mode without devcontainer)
|
|
684
760
|
if (!batchDisplay) {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
761
|
+
// Use FlagResolver for display mode
|
|
762
|
+
const displayResolver = new FlagResolver({
|
|
763
|
+
commandName: 'work spawn',
|
|
764
|
+
baseCommand: 'prlt work spawn',
|
|
765
|
+
jsonMode,
|
|
766
|
+
flags: {},
|
|
767
|
+
});
|
|
768
|
+
displayResolver.addPrompt({
|
|
769
|
+
flagName: 'selectedMode',
|
|
770
|
+
type: 'list',
|
|
771
|
+
message: 'How should agent output be displayed?',
|
|
772
|
+
default: 'terminal',
|
|
773
|
+
choices: () => [
|
|
774
|
+
{ name: '🖥️ New tab - Opens in new terminal tab (recommended)', value: 'terminal' },
|
|
775
|
+
{ name: '📦 Background - Runs detached, reattach with: prlt session attach', value: 'background' },
|
|
776
|
+
],
|
|
777
|
+
});
|
|
778
|
+
const displayResult = await displayResolver.resolve();
|
|
779
|
+
batchDisplay = displayResult.selectedMode;
|
|
697
780
|
}
|
|
698
781
|
// Default to interactive output mode (streaming UI)
|
|
699
782
|
// Can be overridden via --output flag if needed
|
|
@@ -702,39 +785,51 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
702
785
|
}
|
|
703
786
|
// Prompt for permissions mode if not explicitly set via --skip-permissions flag
|
|
704
787
|
if (!flags['skip-permissions']) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
788
|
+
// Use FlagResolver for permission mode
|
|
789
|
+
const permissionResolver = new FlagResolver({
|
|
790
|
+
commandName: 'work spawn',
|
|
791
|
+
baseCommand: 'prlt work spawn',
|
|
792
|
+
jsonMode,
|
|
793
|
+
flags: {},
|
|
794
|
+
});
|
|
795
|
+
permissionResolver.addPrompt({
|
|
796
|
+
flagName: 'permissionMode',
|
|
797
|
+
type: 'list',
|
|
798
|
+
message: 'Permission mode for Claude Code:',
|
|
799
|
+
default: 'danger',
|
|
800
|
+
choices: () => [
|
|
801
|
+
{ name: '⚠️ danger - Skip permission checks (faster, container provides isolation)', value: 'danger' },
|
|
802
|
+
{ name: '🔒 safe - Requires approval for dangerous operations', value: 'safe' },
|
|
803
|
+
],
|
|
804
|
+
});
|
|
805
|
+
const permissionResult = await permissionResolver.resolve();
|
|
806
|
+
batchPermissionMode = permissionResult.permissionMode;
|
|
718
807
|
}
|
|
719
808
|
// Prompt for PR creation if not provided AND action modifies code
|
|
720
809
|
// Skip this prompt entirely for non-code-modifying actions (like groom)
|
|
721
810
|
const actionModifiesCode = selectedActionDetails?.modifiesCode ?? true;
|
|
722
811
|
if (!batchCreatePr && !batchNoPr) {
|
|
723
812
|
if (actionModifiesCode) {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
813
|
+
// Use FlagResolver for PR choice
|
|
814
|
+
const prResolver = new FlagResolver({
|
|
815
|
+
commandName: 'work spawn',
|
|
816
|
+
baseCommand: 'prlt work spawn',
|
|
817
|
+
jsonMode,
|
|
818
|
+
flags: {},
|
|
819
|
+
});
|
|
820
|
+
prResolver.addPrompt({
|
|
821
|
+
flagName: 'prChoice',
|
|
822
|
+
type: 'list',
|
|
823
|
+
message: 'Create pull requests when work is ready?',
|
|
824
|
+
default: 'yes',
|
|
825
|
+
choices: () => [
|
|
826
|
+
{ name: '✓ Yes - Create PR for each ticket', value: 'yes' },
|
|
827
|
+
{ name: '✗ No - Just move tickets to review', value: 'no' },
|
|
828
|
+
],
|
|
829
|
+
});
|
|
830
|
+
const prResult = await prResolver.resolve();
|
|
831
|
+
batchCreatePr = prResult.prChoice === 'yes';
|
|
832
|
+
batchNoPr = prResult.prChoice === 'no';
|
|
738
833
|
}
|
|
739
834
|
else {
|
|
740
835
|
// Non-code-modifying action - no PR needed
|
|
@@ -27,6 +27,7 @@ export default class WorkStart extends PMOCommand {
|
|
|
27
27
|
ephemeral: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
28
|
focus: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
29
29
|
clone: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
30
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
30
31
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
32
|
};
|
|
32
33
|
execute(): Promise<void>;
|