@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Flags, Args } from '@oclif/core';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
4
3
|
import { styles } from '../../lib/styles.js';
|
|
5
4
|
import { STATE_CATEGORY_ORDER } from '../../lib/pmo/types.js';
|
|
6
|
-
import { shouldOutputJson,
|
|
5
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
6
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
7
7
|
export default class PhaseUpdate extends PMOCommand {
|
|
8
8
|
static description = 'Update a project lifecycle phase';
|
|
9
9
|
static examples = [
|
|
@@ -44,10 +44,6 @@ export default class PhaseUpdate extends PMOCommand {
|
|
|
44
44
|
description: 'Interactive mode',
|
|
45
45
|
default: false,
|
|
46
46
|
}),
|
|
47
|
-
json: Flags.boolean({
|
|
48
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
49
|
-
default: false,
|
|
50
|
-
}),
|
|
51
47
|
};
|
|
52
48
|
getPMOOptions() {
|
|
53
49
|
return { promptIfMultiple: false }; // Phases are workspace-scoped, no project selection needed
|
|
@@ -64,47 +60,47 @@ export default class PhaseUpdate extends PMOCommand {
|
|
|
64
60
|
}
|
|
65
61
|
this.error(message);
|
|
66
62
|
};
|
|
67
|
-
// Get phase ID -
|
|
63
|
+
// Get phase ID - use FlagResolver if not provided
|
|
68
64
|
let phaseId = args.id;
|
|
69
65
|
if (!phaseId) {
|
|
70
66
|
const phases = await this.storage.listPhases();
|
|
71
67
|
if (phases.length === 0) {
|
|
72
68
|
return handleError('NO_PHASES', 'No phases found. Create a phase first with "prlt phase create".');
|
|
73
69
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
const idResolver = new FlagResolver({
|
|
71
|
+
commandName: 'phase update',
|
|
72
|
+
baseCommand: 'prlt phase update',
|
|
73
|
+
jsonMode,
|
|
74
|
+
flags: { machine: flags.machine, json: flags.json },
|
|
75
|
+
});
|
|
76
|
+
idResolver.addPrompt({
|
|
77
|
+
flagName: 'phaseId',
|
|
78
|
+
type: 'list',
|
|
79
|
+
message: 'Select phase to update:',
|
|
80
|
+
choices: () => phases.map(p => ({
|
|
77
81
|
name: `${p.name} (${p.category})`,
|
|
78
82
|
value: p.id,
|
|
79
|
-
}))
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
name: 'selectedId',
|
|
86
|
-
message: 'Select phase to update:',
|
|
87
|
-
choices: phases.map(p => ({
|
|
88
|
-
name: `${p.name} (${p.category})`,
|
|
89
|
-
value: p.id,
|
|
90
|
-
})),
|
|
91
|
-
}]);
|
|
92
|
-
phaseId = selectedId;
|
|
83
|
+
})),
|
|
84
|
+
// Use positional arg format for phase ID
|
|
85
|
+
getCommand: (value) => `prlt phase update ${value} --json`,
|
|
86
|
+
});
|
|
87
|
+
const resolved = await idResolver.resolve();
|
|
88
|
+
phaseId = resolved.phaseId;
|
|
93
89
|
}
|
|
94
90
|
const existing = await this.storage.getPhase(phaseId);
|
|
95
91
|
if (!existing) {
|
|
96
92
|
return handleError('PHASE_NOT_FOUND', `Phase "${phaseId}" not found.`);
|
|
97
93
|
}
|
|
98
|
-
let updates;
|
|
99
94
|
// Check if any change flags were provided
|
|
100
95
|
const hasChangeFlags = flags.name !== undefined ||
|
|
101
96
|
flags.category !== undefined ||
|
|
102
97
|
flags.color !== undefined ||
|
|
103
98
|
flags.description !== undefined ||
|
|
104
99
|
flags.default !== undefined;
|
|
100
|
+
let updates;
|
|
105
101
|
// Auto-enter interactive mode if no change flags provided
|
|
106
102
|
if (flags.interactive || !hasChangeFlags) {
|
|
107
|
-
// Define labels
|
|
103
|
+
// Define category labels - single source of truth
|
|
108
104
|
const categoryLabels = {
|
|
109
105
|
triage: 'Triage - Inbox, needs review',
|
|
110
106
|
backlog: 'Backlog - Not yet scheduled for work',
|
|
@@ -113,22 +109,76 @@ export default class PhaseUpdate extends PMOCommand {
|
|
|
113
109
|
completed: 'Completed - Work finished successfully',
|
|
114
110
|
canceled: 'Canceled - Work won\'t be done',
|
|
115
111
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
112
|
+
// Use FlagResolver for update prompts
|
|
113
|
+
const resolver = new FlagResolver({
|
|
114
|
+
commandName: 'phase update',
|
|
115
|
+
baseCommand: `prlt phase update ${phaseId}`,
|
|
116
|
+
jsonMode,
|
|
117
|
+
flags: { machine: flags.machine, json: flags.json },
|
|
118
|
+
});
|
|
119
|
+
resolver.addPrompt({
|
|
120
|
+
flagName: 'name',
|
|
121
|
+
type: 'input',
|
|
122
|
+
message: 'Name:',
|
|
123
|
+
default: existing.name,
|
|
124
|
+
});
|
|
125
|
+
resolver.addPrompt({
|
|
126
|
+
flagName: 'category',
|
|
127
|
+
type: 'list',
|
|
128
|
+
message: 'Category:',
|
|
129
|
+
choices: () => STATE_CATEGORY_ORDER.map(cat => ({
|
|
130
|
+
name: categoryLabels[cat],
|
|
131
|
+
value: cat,
|
|
132
|
+
})),
|
|
133
|
+
default: existing.category,
|
|
134
|
+
when: (ctx) => ctx.flags.name !== undefined,
|
|
135
|
+
});
|
|
136
|
+
resolver.addPrompt({
|
|
137
|
+
flagName: 'color',
|
|
138
|
+
type: 'input',
|
|
139
|
+
message: 'Color (hex):',
|
|
140
|
+
default: existing.color || '',
|
|
141
|
+
when: (ctx) => ctx.flags.category !== undefined,
|
|
142
|
+
});
|
|
143
|
+
resolver.addPrompt({
|
|
144
|
+
flagName: 'description',
|
|
145
|
+
type: 'input',
|
|
146
|
+
message: 'Description:',
|
|
147
|
+
default: existing.description || '',
|
|
148
|
+
when: (ctx) => ctx.flags.color !== undefined,
|
|
149
|
+
});
|
|
150
|
+
resolver.addPrompt({
|
|
151
|
+
flagName: 'isDefault',
|
|
152
|
+
type: 'list',
|
|
153
|
+
message: 'Default for new projects?',
|
|
154
|
+
choices: () => [
|
|
155
|
+
{ name: 'No', value: false },
|
|
156
|
+
{ name: 'Yes', value: true },
|
|
157
|
+
],
|
|
158
|
+
default: existing.isDefault || false,
|
|
159
|
+
when: (ctx) => ctx.flags.description !== undefined,
|
|
160
|
+
});
|
|
161
|
+
const resolved = await resolver.resolve();
|
|
162
|
+
// Build updates from resolved values - only include changed values
|
|
163
|
+
updates = {};
|
|
164
|
+
if (resolved.name && resolved.name !== existing.name) {
|
|
165
|
+
updates.name = resolved.name;
|
|
166
|
+
}
|
|
167
|
+
if (resolved.category && resolved.category !== existing.category) {
|
|
168
|
+
updates.category = resolved.category;
|
|
169
|
+
}
|
|
170
|
+
if (resolved.color !== undefined && resolved.color !== (existing.color || '')) {
|
|
171
|
+
updates.color = resolved.color || undefined;
|
|
172
|
+
}
|
|
173
|
+
if (resolved.description !== undefined && resolved.description !== (existing.description || '')) {
|
|
174
|
+
updates.description = resolved.description || undefined;
|
|
175
|
+
}
|
|
176
|
+
if (resolved.isDefault !== undefined && resolved.isDefault !== (existing.isDefault || false)) {
|
|
177
|
+
updates.isDefault = resolved.isDefault;
|
|
128
178
|
}
|
|
129
|
-
updates = await this.promptUpdates(fields, existing);
|
|
130
179
|
}
|
|
131
180
|
else {
|
|
181
|
+
// Use flags directly
|
|
132
182
|
updates = {};
|
|
133
183
|
if (flags.name)
|
|
134
184
|
updates.name = flags.name;
|
|
@@ -155,20 +205,4 @@ export default class PhaseUpdate extends PMOCommand {
|
|
|
155
205
|
this.log(styles.muted(` Default: Yes`));
|
|
156
206
|
}
|
|
157
207
|
}
|
|
158
|
-
async promptUpdates(fields, existing) {
|
|
159
|
-
// Build inquirer prompts from fields
|
|
160
|
-
const answers = await inquirer.prompt(fields);
|
|
161
|
-
const updates = {};
|
|
162
|
-
if (answers.name !== existing.name)
|
|
163
|
-
updates.name = answers.name;
|
|
164
|
-
if (answers.category !== existing.category)
|
|
165
|
-
updates.category = answers.category;
|
|
166
|
-
if (answers.color !== (existing.color || ''))
|
|
167
|
-
updates.color = answers.color || undefined;
|
|
168
|
-
if (answers.description !== (existing.description || ''))
|
|
169
|
-
updates.description = answers.description || undefined;
|
|
170
|
-
if (answers.isDefault !== (existing.isDefault || false))
|
|
171
|
-
updates.isDefault = answers.isDefault;
|
|
172
|
-
return updates;
|
|
173
|
-
}
|
|
174
208
|
}
|
|
@@ -7,6 +7,8 @@ export default class PMOInit extends Command {
|
|
|
7
7
|
template: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
action: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
confirmation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
12
|
};
|
|
11
13
|
run(): Promise<void>;
|
|
12
14
|
/**
|
|
@@ -36,6 +36,15 @@ export default class PMOInit extends Command {
|
|
|
36
36
|
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
37
37
|
default: false,
|
|
38
38
|
}),
|
|
39
|
+
action: Flags.string({
|
|
40
|
+
description: 'Action for existing PMO (cancel or reinitialize)',
|
|
41
|
+
options: ['cancel', 'reinitialize'],
|
|
42
|
+
hidden: true,
|
|
43
|
+
}),
|
|
44
|
+
confirmation: Flags.string({
|
|
45
|
+
description: 'Confirmation text for destructive operations',
|
|
46
|
+
hidden: true,
|
|
47
|
+
}),
|
|
39
48
|
};
|
|
40
49
|
async run() {
|
|
41
50
|
const { flags } = await this.parse(PMOInit);
|
|
@@ -179,6 +188,23 @@ export default class PMOInit extends Command {
|
|
|
179
188
|
this.log(chalk.green(' ✓ Standalone PMO structure created'));
|
|
180
189
|
}
|
|
181
190
|
findHQRoot() {
|
|
191
|
+
// Support PRLT_HQ_PATH override (for devcontainers and tests)
|
|
192
|
+
const hqPathEnv = process.env.PRLT_HQ_PATH;
|
|
193
|
+
const allowEnvHqPath = process.env.DEVCONTAINER === 'true' || process.env.PRLT_TEST_ENV === 'true';
|
|
194
|
+
if (hqPathEnv && allowEnvHqPath) {
|
|
195
|
+
const configPath = path.join(hqPathEnv, '.proletariat', 'config.json');
|
|
196
|
+
if (fs.existsSync(configPath)) {
|
|
197
|
+
try {
|
|
198
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
199
|
+
if (config.type === 'hq') {
|
|
200
|
+
return hqPathEnv;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
// Fall through to directory walk
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
182
208
|
let currentDir = process.cwd();
|
|
183
209
|
while (currentDir !== '/') {
|
|
184
210
|
const configPath = path.join(currentDir, '.proletariat', 'config.json');
|
|
@@ -214,38 +240,74 @@ export default class PMOInit extends Command {
|
|
|
214
240
|
}
|
|
215
241
|
// Define choices once, use for both JSON and interactive modes
|
|
216
242
|
const actionChoices = [
|
|
217
|
-
{
|
|
218
|
-
|
|
243
|
+
{
|
|
244
|
+
name: 'Cancel (keep existing PMO)',
|
|
245
|
+
value: 'cancel',
|
|
246
|
+
command: 'prlt pmo init --action cancel --json',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: 'Reinitialize (DELETES all data)',
|
|
250
|
+
value: 'reinitialize',
|
|
251
|
+
command: 'prlt pmo init --action reinitialize --json',
|
|
252
|
+
},
|
|
219
253
|
];
|
|
220
254
|
const message = `PMO already exists at ${pmoPath} (${projectCount} projects, ${ticketCount} tickets). What would you like to do?`;
|
|
221
|
-
//
|
|
222
|
-
|
|
255
|
+
// Determine action: from flag, JSON mode, or interactive prompt
|
|
256
|
+
let action;
|
|
257
|
+
if (flags.action) {
|
|
258
|
+
action = flags.action;
|
|
259
|
+
}
|
|
260
|
+
else if (jsonMode) {
|
|
223
261
|
outputPromptAsJson(buildPromptConfig('list', 'action', message, actionChoices), createMetadata('pmo init', flags));
|
|
262
|
+
return null; // unreachable - outputPromptAsJson calls process.exit
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
this.log(chalk.yellow('\n⚠️ PMO already exists'));
|
|
266
|
+
this.log(chalk.gray(` Location: ${pmoPath}`));
|
|
267
|
+
this.log(chalk.gray(` Projects: ${projectCount}`));
|
|
268
|
+
this.log(chalk.gray(` Tickets: ${ticketCount}\n`));
|
|
269
|
+
const result = await inquirer.prompt([{
|
|
270
|
+
type: 'list',
|
|
271
|
+
name: 'action',
|
|
272
|
+
message: 'What would you like to do?',
|
|
273
|
+
choices: actionChoices,
|
|
274
|
+
default: 'cancel',
|
|
275
|
+
}]);
|
|
276
|
+
action = result.action;
|
|
224
277
|
}
|
|
225
|
-
this.log(chalk.yellow('\n⚠️ PMO already exists'));
|
|
226
|
-
this.log(chalk.gray(` Location: ${pmoPath}`));
|
|
227
|
-
this.log(chalk.gray(` Projects: ${projectCount}`));
|
|
228
|
-
this.log(chalk.gray(` Tickets: ${ticketCount}\n`));
|
|
229
|
-
const { action } = await inquirer.prompt([{
|
|
230
|
-
type: 'list',
|
|
231
|
-
name: 'action',
|
|
232
|
-
message: 'What would you like to do?',
|
|
233
|
-
choices: actionChoices,
|
|
234
|
-
default: 'cancel',
|
|
235
|
-
}]);
|
|
236
278
|
if (action === 'cancel') {
|
|
237
279
|
return false;
|
|
238
280
|
}
|
|
239
|
-
//
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
281
|
+
// Determine confirmation: from flag, JSON mode, or interactive prompt
|
|
282
|
+
let confirmation;
|
|
283
|
+
if (flags.confirmation) {
|
|
284
|
+
confirmation = flags.confirmation;
|
|
285
|
+
}
|
|
286
|
+
else if (jsonMode) {
|
|
287
|
+
outputPromptAsJson({
|
|
245
288
|
type: 'input',
|
|
246
289
|
name: 'confirmation',
|
|
247
290
|
message: 'Type "delete pmo" to confirm:',
|
|
248
|
-
|
|
291
|
+
context: {
|
|
292
|
+
hint: 'Pass --confirmation "delete pmo" to confirm reinitialize',
|
|
293
|
+
example: 'prlt pmo init --action reinitialize --confirmation "delete pmo" --location separate --template kanban --name "my-board" --json',
|
|
294
|
+
},
|
|
295
|
+
}, createMetadata('pmo init', flags));
|
|
296
|
+
return null; // unreachable - outputPromptAsJson calls process.exit
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
// Show warning and require typed confirmation
|
|
300
|
+
this.log(chalk.red('\n⚠️ WARNING: This will permanently delete:'));
|
|
301
|
+
this.log(chalk.red(' • All tickets and boards'));
|
|
302
|
+
this.log(chalk.red(' • All specs and documentation'));
|
|
303
|
+
this.log(chalk.red(' • Database tables (pmo_*)\n'));
|
|
304
|
+
const result = await inquirer.prompt([{
|
|
305
|
+
type: 'input',
|
|
306
|
+
name: 'confirmation',
|
|
307
|
+
message: 'Type "delete pmo" to confirm:',
|
|
308
|
+
}]);
|
|
309
|
+
confirmation = result.confirmation;
|
|
310
|
+
}
|
|
249
311
|
if (confirmation !== 'delete pmo') {
|
|
250
312
|
this.log(chalk.yellow('\nCancelled. Confirmation text did not match.'));
|
|
251
313
|
return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class PRCreate extends
|
|
1
|
+
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
export default class PRCreate extends PMOCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
@@ -11,7 +11,16 @@ export default class PRCreate extends Command {
|
|
|
11
11
|
'no-link': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
body: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
ticket: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
16
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
18
|
};
|
|
16
|
-
|
|
19
|
+
private hasPMO;
|
|
20
|
+
/**
|
|
21
|
+
* Override init to gracefully handle missing PMO
|
|
22
|
+
* PR creation should work even without PMO (just without ticket linking)
|
|
23
|
+
*/
|
|
24
|
+
init(): Promise<void>;
|
|
25
|
+
execute(): Promise<void>;
|
|
17
26
|
}
|