@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 { slugify } from '../../lib/pmo/utils.js';
|
|
6
|
-
import { shouldOutputJson
|
|
5
|
+
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
6
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
7
7
|
export default class SpecCreate extends PMOCommand {
|
|
8
8
|
static description = 'Create a new spec';
|
|
9
9
|
static examples = [
|
|
@@ -41,61 +41,80 @@ export default class SpecCreate extends PMOCommand {
|
|
|
41
41
|
description: 'Interactive mode',
|
|
42
42
|
default: false,
|
|
43
43
|
}),
|
|
44
|
-
json: Flags.boolean({
|
|
45
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
46
|
-
default: false,
|
|
47
|
-
}),
|
|
48
44
|
};
|
|
49
45
|
async execute() {
|
|
50
46
|
const { args, flags } = await this.parse(SpecCreate);
|
|
51
47
|
// Check if JSON output mode is active
|
|
52
48
|
const jsonMode = shouldOutputJson(flags);
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{ type: 'list', name: 'status', message: 'Status:', choices: statusChoices, default: flags.status || 'draft' },
|
|
74
|
-
{ type: 'input', name: 'problem', message: 'Problem statement (optional):', default: flags.problem },
|
|
75
|
-
];
|
|
76
|
-
// In JSON mode, output form prompts
|
|
77
|
-
if (jsonMode) {
|
|
78
|
-
outputPromptAsJson(buildFormPromptConfig(fields), createMetadata('spec create', flags));
|
|
79
|
-
}
|
|
80
|
-
specData = await this.promptSpecData(fields);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
specData = {
|
|
84
|
-
title: args.title || flags.title || 'Untitled Spec',
|
|
85
|
-
status: flags.status || 'draft',
|
|
49
|
+
// Build choices for prompts
|
|
50
|
+
const typeChoices = [
|
|
51
|
+
{ name: 'Product (user-facing feature)', value: 'product' },
|
|
52
|
+
{ name: 'Platform (internal tooling)', value: 'platform' },
|
|
53
|
+
{ name: 'Infra (technical infrastructure)', value: 'infra' },
|
|
54
|
+
{ name: 'Integration (external service)', value: 'integration' },
|
|
55
|
+
{ name: 'None', value: '' },
|
|
56
|
+
];
|
|
57
|
+
const statusChoices = [
|
|
58
|
+
{ name: 'Draft (planning)', value: 'draft' },
|
|
59
|
+
{ name: 'Active (in progress)', value: 'active' },
|
|
60
|
+
{ name: 'Implemented (complete)', value: 'implemented' },
|
|
61
|
+
];
|
|
62
|
+
// Use FlagResolver for all fields
|
|
63
|
+
const resolver = new FlagResolver({
|
|
64
|
+
commandName: 'spec create',
|
|
65
|
+
baseCommand: 'prlt spec create',
|
|
66
|
+
jsonMode,
|
|
67
|
+
flags: {
|
|
68
|
+
title: args.title || flags.title,
|
|
86
69
|
type: flags.type,
|
|
70
|
+
status: flags.status || 'draft',
|
|
87
71
|
problem: flags.problem,
|
|
88
|
-
}
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
// Only prompt if interactive mode or no title provided
|
|
75
|
+
const needsPrompts = flags.interactive || (!args.title && !flags.title);
|
|
76
|
+
if (needsPrompts) {
|
|
77
|
+
resolver.addPrompt({
|
|
78
|
+
flagName: 'title',
|
|
79
|
+
type: 'input',
|
|
80
|
+
message: 'Spec title:',
|
|
81
|
+
validate: (value) => value.length > 0 || 'Title is required',
|
|
82
|
+
when: (ctx) => !ctx.flags.title,
|
|
83
|
+
});
|
|
84
|
+
resolver.addPrompt({
|
|
85
|
+
flagName: 'type',
|
|
86
|
+
type: 'list',
|
|
87
|
+
message: 'Spec type:',
|
|
88
|
+
choices: () => typeChoices,
|
|
89
|
+
when: (ctx) => !ctx.flags.type && ctx.flags.title !== undefined,
|
|
90
|
+
});
|
|
91
|
+
resolver.addPrompt({
|
|
92
|
+
flagName: 'status',
|
|
93
|
+
type: 'list',
|
|
94
|
+
message: 'Status:',
|
|
95
|
+
choices: () => statusChoices,
|
|
96
|
+
default: 'draft',
|
|
97
|
+
when: (ctx) => ctx.flags.title !== undefined,
|
|
98
|
+
});
|
|
99
|
+
resolver.addPrompt({
|
|
100
|
+
flagName: 'problem',
|
|
101
|
+
type: 'input',
|
|
102
|
+
message: 'Problem statement (optional):',
|
|
103
|
+
when: (ctx) => ctx.flags.title !== undefined,
|
|
104
|
+
});
|
|
89
105
|
}
|
|
106
|
+
const resolved = await resolver.resolve();
|
|
107
|
+
// Convert empty type to undefined
|
|
108
|
+
const specType = resolved.type === '' ? undefined : resolved.type;
|
|
90
109
|
// Generate ID from title
|
|
91
|
-
const specId = slugify(
|
|
110
|
+
const specId = slugify(resolved.title);
|
|
92
111
|
// Create spec in database
|
|
93
112
|
const spec = await this.storage.createSpec({
|
|
94
113
|
id: specId,
|
|
95
|
-
title:
|
|
96
|
-
status:
|
|
97
|
-
type:
|
|
98
|
-
problem:
|
|
114
|
+
title: resolved.title,
|
|
115
|
+
status: resolved.status || 'draft',
|
|
116
|
+
type: specType,
|
|
117
|
+
problem: resolved.problem || undefined,
|
|
99
118
|
});
|
|
100
119
|
this.log(styles.success(`\n✅ Created spec "${styles.emphasis(spec.title)}"`));
|
|
101
120
|
this.log(styles.muted(` ID: ${spec.id}`));
|
|
@@ -107,24 +126,4 @@ export default class SpecCreate extends PMOCommand {
|
|
|
107
126
|
this.log(styles.muted(` 2. prlt spec edit ${spec.id} (to add details)`));
|
|
108
127
|
this.log(styles.muted(` 3. prlt spec plan ${spec.id} (to generate tickets)`));
|
|
109
128
|
}
|
|
110
|
-
async promptSpecData(fields) {
|
|
111
|
-
// Build inquirer prompts from fields, adding validators
|
|
112
|
-
const answers = await inquirer.prompt(fields.map(field => ({
|
|
113
|
-
...field,
|
|
114
|
-
// Convert empty string value to undefined for 'type' field
|
|
115
|
-
choices: field.name === 'type' && field.choices
|
|
116
|
-
? field.choices.map(c => ({ ...c, value: c.value || undefined }))
|
|
117
|
-
: field.choices,
|
|
118
|
-
// Add validator for required title field
|
|
119
|
-
validate: field.name === 'title'
|
|
120
|
-
? ((input) => input.length > 0 || 'Title is required')
|
|
121
|
-
: undefined,
|
|
122
|
-
})));
|
|
123
|
-
return {
|
|
124
|
-
title: answers.title,
|
|
125
|
-
status: answers.status,
|
|
126
|
-
type: answers.type,
|
|
127
|
-
problem: answers.problem || undefined,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
129
|
}
|
|
@@ -3,6 +3,7 @@ export default class Spec extends PMOCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
7
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
1
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
2
|
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
3
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
4
4
|
export default class Spec extends PMOCommand {
|
|
5
5
|
static description = 'Interactive menu for spec operations';
|
|
6
6
|
static examples = [
|
|
@@ -8,10 +8,6 @@ export default class Spec extends PMOCommand {
|
|
|
8
8
|
];
|
|
9
9
|
static flags = {
|
|
10
10
|
...pmoBaseFlags,
|
|
11
|
-
json: Flags.boolean({
|
|
12
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
13
|
-
default: false,
|
|
14
|
-
}),
|
|
15
11
|
};
|
|
16
12
|
getPMOOptions() {
|
|
17
13
|
return { promptIfMultiple: false };
|
|
@@ -20,26 +16,44 @@ export default class Spec extends PMOCommand {
|
|
|
20
16
|
const { flags } = await this.parse(Spec);
|
|
21
17
|
// Check if JSON output mode is active
|
|
22
18
|
const jsonMode = shouldOutputJson(flags);
|
|
23
|
-
// Define choices
|
|
24
|
-
// Each choice includes the full command for AI agents to execute
|
|
19
|
+
// Define choices for the menu
|
|
25
20
|
const menuChoices = [
|
|
26
|
-
{
|
|
27
|
-
{
|
|
28
|
-
{
|
|
29
|
-
{
|
|
30
|
-
{
|
|
31
|
-
{
|
|
32
|
-
{
|
|
21
|
+
{ name: 'Create new spec', value: 'create' },
|
|
22
|
+
{ name: 'List all specs', value: 'list' },
|
|
23
|
+
{ name: 'View spec', value: 'view' },
|
|
24
|
+
{ name: 'Generate tickets from spec', value: 'generate' },
|
|
25
|
+
{ name: 'Assign ticket to spec', value: 'ticket' },
|
|
26
|
+
{ name: 'Manage dependencies', value: 'link' },
|
|
27
|
+
{ name: 'Cancel', value: 'cancel' },
|
|
33
28
|
];
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
getCommand: (c) => c.command,
|
|
41
|
-
jsonMode: jsonMode ? { flags, commandName: 'spec' } : null,
|
|
29
|
+
// Use FlagResolver for action selection
|
|
30
|
+
const resolver = new FlagResolver({
|
|
31
|
+
commandName: 'spec',
|
|
32
|
+
baseCommand: 'prlt spec',
|
|
33
|
+
jsonMode,
|
|
34
|
+
flags: {},
|
|
42
35
|
});
|
|
36
|
+
resolver.addPrompt({
|
|
37
|
+
flagName: 'action',
|
|
38
|
+
type: 'list',
|
|
39
|
+
message: '📄 Spec Operations - What would you like to do?',
|
|
40
|
+
choices: () => menuChoices,
|
|
41
|
+
// Custom command builder for menu items
|
|
42
|
+
getCommand: (value) => {
|
|
43
|
+
const commands = {
|
|
44
|
+
create: 'prlt spec create --json',
|
|
45
|
+
list: 'prlt spec list --json',
|
|
46
|
+
view: 'prlt spec view --json',
|
|
47
|
+
generate: 'prlt spec plan --json',
|
|
48
|
+
ticket: 'prlt spec ticket --json',
|
|
49
|
+
link: 'prlt spec link --json',
|
|
50
|
+
cancel: '',
|
|
51
|
+
};
|
|
52
|
+
return commands[value] || '';
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
const resolved = await resolver.resolve();
|
|
56
|
+
const action = resolved.action;
|
|
43
57
|
if (action === 'cancel' || !action) {
|
|
44
58
|
return;
|
|
45
59
|
}
|
|
@@ -7,6 +7,7 @@ export default class SpecLinkDepends extends PMOCommand {
|
|
|
7
7
|
target: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Args
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { PMOCommand, pmoBaseFlags } from '../../../lib/pmo/index.js';
|
|
4
4
|
import { styles } from '../../../lib/styles.js';
|
|
@@ -12,10 +12,6 @@ export default class SpecLinkDepends extends PMOCommand {
|
|
|
12
12
|
};
|
|
13
13
|
static flags = {
|
|
14
14
|
...pmoBaseFlags,
|
|
15
|
-
json: Flags.boolean({
|
|
16
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
17
|
-
default: false,
|
|
18
|
-
}),
|
|
19
15
|
};
|
|
20
16
|
async execute() {
|
|
21
17
|
const { args, flags } = await this.parse(SpecLinkDepends);
|
|
@@ -46,7 +42,11 @@ export default class SpecLinkDepends extends PMOCommand {
|
|
|
46
42
|
}
|
|
47
43
|
// In JSON mode, output spec selection prompt
|
|
48
44
|
if (jsonMode) {
|
|
49
|
-
const specChoices = otherSpecs.map(s => ({
|
|
45
|
+
const specChoices = otherSpecs.map(s => ({
|
|
46
|
+
name: `${s.id} - ${s.title}`,
|
|
47
|
+
value: s.id,
|
|
48
|
+
command: `prlt spec link depends ${args.id} ${s.id} --json`,
|
|
49
|
+
}));
|
|
50
50
|
outputPromptAsJson(buildPromptConfig('list', 'target', `Select spec that ${args.id} depends on:`, specChoices), createMetadata('spec link depends', flags));
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -7,6 +7,7 @@ export default class SpecLinkDuplicates extends PMOCommand {
|
|
|
7
7
|
original: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Args
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { PMOCommand, pmoBaseFlags } from '../../../lib/pmo/index.js';
|
|
4
4
|
import { styles } from '../../../lib/styles.js';
|
|
@@ -12,10 +12,6 @@ export default class SpecLinkDuplicates extends PMOCommand {
|
|
|
12
12
|
};
|
|
13
13
|
static flags = {
|
|
14
14
|
...pmoBaseFlags,
|
|
15
|
-
json: Flags.boolean({
|
|
16
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
17
|
-
default: false,
|
|
18
|
-
}),
|
|
19
15
|
};
|
|
20
16
|
async execute() {
|
|
21
17
|
const { args, flags } = await this.parse(SpecLinkDuplicates);
|
|
@@ -46,7 +42,11 @@ export default class SpecLinkDuplicates extends PMOCommand {
|
|
|
46
42
|
}
|
|
47
43
|
// In JSON mode, output spec selection prompt
|
|
48
44
|
if (jsonMode) {
|
|
49
|
-
const specChoices = otherSpecs.map(s => ({
|
|
45
|
+
const specChoices = otherSpecs.map(s => ({
|
|
46
|
+
name: `${s.id} - ${s.title}`,
|
|
47
|
+
value: s.id,
|
|
48
|
+
command: `prlt spec link duplicates ${args.id} ${s.id} --json`,
|
|
49
|
+
}));
|
|
50
50
|
outputPromptAsJson(buildPromptConfig('list', 'original', `Select the original spec (${args.id} is a duplicate of):`, specChoices), createMetadata('spec link duplicates', flags));
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -6,11 +6,12 @@ export default class SpecLink extends PMOCommand {
|
|
|
6
6
|
id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
depends: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
10
|
relates: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
duplicates: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
12
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
};
|
|
16
17
|
execute(): Promise<void>;
|
|
@@ -17,10 +17,6 @@ export default class SpecLink extends PMOCommand {
|
|
|
17
17
|
};
|
|
18
18
|
static flags = {
|
|
19
19
|
...pmoBaseFlags,
|
|
20
|
-
json: Flags.boolean({
|
|
21
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
22
|
-
default: false,
|
|
23
|
-
}),
|
|
24
20
|
depends: Flags.string({ char: 'd', description: 'Add depends_on dependency' }),
|
|
25
21
|
relates: Flags.string({ char: 'r', description: 'Add relates_to dependency' }),
|
|
26
22
|
duplicates: Flags.string({ description: 'Add duplicates dependency' }),
|
|
@@ -7,6 +7,7 @@ export default class SpecLinkRelates extends PMOCommand {
|
|
|
7
7
|
target: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Args
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { PMOCommand, pmoBaseFlags } from '../../../lib/pmo/index.js';
|
|
4
4
|
import { styles } from '../../../lib/styles.js';
|
|
@@ -12,10 +12,6 @@ export default class SpecLinkRelates extends PMOCommand {
|
|
|
12
12
|
};
|
|
13
13
|
static flags = {
|
|
14
14
|
...pmoBaseFlags,
|
|
15
|
-
json: Flags.boolean({
|
|
16
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
17
|
-
default: false,
|
|
18
|
-
}),
|
|
19
15
|
};
|
|
20
16
|
async execute() {
|
|
21
17
|
const { args, flags } = await this.parse(SpecLinkRelates);
|
|
@@ -46,7 +42,11 @@ export default class SpecLinkRelates extends PMOCommand {
|
|
|
46
42
|
}
|
|
47
43
|
// In JSON mode, output spec selection prompt
|
|
48
44
|
if (jsonMode) {
|
|
49
|
-
const specChoices = otherSpecs.map(s => ({
|
|
45
|
+
const specChoices = otherSpecs.map(s => ({
|
|
46
|
+
name: `${s.id} - ${s.title}`,
|
|
47
|
+
value: s.id,
|
|
48
|
+
command: `prlt spec link relates ${args.id} ${s.id} --json`,
|
|
49
|
+
}));
|
|
50
50
|
outputPromptAsJson(buildPromptConfig('list', 'target', `Select spec that ${args.id} relates to:`, specChoices), createMetadata('spec link relates', flags));
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -7,9 +7,10 @@ export default class SpecLinkRemove extends PMOCommand {
|
|
|
7
7
|
target: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
15
16
|
execute(): Promise<void>;
|
|
@@ -15,10 +15,6 @@ export default class SpecLinkRemove extends PMOCommand {
|
|
|
15
15
|
};
|
|
16
16
|
static flags = {
|
|
17
17
|
...pmoBaseFlags,
|
|
18
|
-
json: Flags.boolean({
|
|
19
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
20
|
-
default: false,
|
|
21
|
-
}),
|
|
22
18
|
type: Flags.string({ char: 't', description: 'Dependency type', options: ['depends_on', 'relates_to', 'duplicates'] }),
|
|
23
19
|
all: Flags.boolean({ char: 'a', description: 'Remove all dependencies', default: false }),
|
|
24
20
|
};
|
|
@@ -82,9 +78,13 @@ export default class SpecLinkRemove extends PMOCommand {
|
|
|
82
78
|
const depSpec = await this.storage.getSpec(dep.dependsOnSpecId);
|
|
83
79
|
return { name: `${dep.dependsOnSpecId} - ${depSpec?.title || 'Unknown'} (${dep.dependencyType})`, value: dep.dependsOnSpecId };
|
|
84
80
|
}));
|
|
85
|
-
// In JSON mode, output dependency selection prompt
|
|
81
|
+
// In JSON mode, output dependency selection prompt with command fields
|
|
86
82
|
if (jsonMode) {
|
|
87
|
-
|
|
83
|
+
const choicesWithCommands = choices.map(c => ({
|
|
84
|
+
...c,
|
|
85
|
+
command: `prlt spec link remove ${args.id} ${c.value} --json`,
|
|
86
|
+
}));
|
|
87
|
+
outputPromptAsJson(buildPromptConfig('list', 'target', 'Select dependency to remove:', choicesWithCommands), createMetadata('spec link remove', flags));
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
const { selected } = await inquirer.prompt([{ type: 'list', name: 'selected', message: 'Select dependency to remove:', choices }]);
|
|
@@ -6,6 +6,8 @@ export default class SpecList extends PMOCommand {
|
|
|
6
6
|
status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
11
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
12
|
};
|
|
11
13
|
execute(): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
3
|
import { styles } from '../../lib/styles.js';
|
|
4
|
+
import { shouldOutputJson, outputSuccessAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
4
5
|
export default class SpecList extends PMOCommand {
|
|
5
6
|
static description = 'List all specs';
|
|
6
7
|
static examples = [
|
|
@@ -26,12 +27,36 @@ export default class SpecList extends PMOCommand {
|
|
|
26
27
|
};
|
|
27
28
|
async execute() {
|
|
28
29
|
const { flags } = await this.parse(SpecList);
|
|
30
|
+
// Check if JSON output mode is active
|
|
31
|
+
const jsonMode = shouldOutputJson(flags);
|
|
29
32
|
// List specs with filters
|
|
30
33
|
const specs = await this.storage.listSpecs({
|
|
31
34
|
status: flags.status,
|
|
32
35
|
type: flags.type,
|
|
33
36
|
search: flags.search,
|
|
34
37
|
});
|
|
38
|
+
// In JSON mode, output specs as structured data
|
|
39
|
+
if (jsonMode) {
|
|
40
|
+
outputSuccessAsJson({
|
|
41
|
+
specs: specs.map(s => ({
|
|
42
|
+
id: s.id,
|
|
43
|
+
title: s.title,
|
|
44
|
+
status: s.status,
|
|
45
|
+
type: s.type,
|
|
46
|
+
tags: s.tags,
|
|
47
|
+
problem: s.problem,
|
|
48
|
+
createdAt: s.createdAt?.toISOString(),
|
|
49
|
+
updatedAt: s.updatedAt?.toISOString(),
|
|
50
|
+
})),
|
|
51
|
+
count: specs.length,
|
|
52
|
+
filters: {
|
|
53
|
+
status: flags.status,
|
|
54
|
+
type: flags.type,
|
|
55
|
+
search: flags.search,
|
|
56
|
+
},
|
|
57
|
+
}, createMetadata('spec list', flags));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
35
60
|
if (specs.length === 0) {
|
|
36
61
|
this.log(styles.warning('\nNo specs found'));
|
|
37
62
|
this.log(styles.muted(' Create your first spec: prlt spec create'));
|
|
@@ -6,9 +6,10 @@ export default class SpecPlan extends PMOCommand {
|
|
|
6
6
|
spec: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
10
|
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
};
|
|
14
15
|
execute(): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
import { shouldOutputJson,
|
|
4
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
6
6
|
export default class SpecPlan extends PMOCommand {
|
|
7
7
|
static description = 'Generate tickets from spec by comparing ideal state vs codebase (uses LLM)';
|
|
8
8
|
static examples = [
|
|
@@ -17,10 +17,6 @@ export default class SpecPlan extends PMOCommand {
|
|
|
17
17
|
};
|
|
18
18
|
static flags = {
|
|
19
19
|
...pmoBaseFlags,
|
|
20
|
-
json: Flags.boolean({
|
|
21
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
22
|
-
default: false,
|
|
23
|
-
}),
|
|
24
20
|
spec: Flags.string({
|
|
25
21
|
char: 's',
|
|
26
22
|
description: 'Spec ID',
|
|
@@ -42,7 +38,7 @@ export default class SpecPlan extends PMOCommand {
|
|
|
42
38
|
}
|
|
43
39
|
this.error(message);
|
|
44
40
|
};
|
|
45
|
-
// Get spec ID
|
|
41
|
+
// Get spec ID from args or flags
|
|
46
42
|
let specId = args.spec || flags.spec;
|
|
47
43
|
if (!specId) {
|
|
48
44
|
// List specs and prompt for selection
|
|
@@ -50,27 +46,24 @@ export default class SpecPlan extends PMOCommand {
|
|
|
50
46
|
if (specs.length === 0) {
|
|
51
47
|
return handleError('NO_SPECS', 'No specs found. Create a spec first with "prlt spec create".');
|
|
52
48
|
}
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
// Use FlagResolver for spec selection
|
|
50
|
+
const resolver = new FlagResolver({
|
|
51
|
+
commandName: 'spec plan',
|
|
52
|
+
baseCommand: 'prlt spec plan',
|
|
53
|
+
jsonMode,
|
|
54
|
+
flags: { spec: flags.spec },
|
|
55
|
+
});
|
|
56
|
+
resolver.addPrompt({
|
|
57
|
+
flagName: 'spec',
|
|
58
|
+
type: 'list',
|
|
59
|
+
message: 'Select spec to plan:',
|
|
60
|
+
choices: () => specs.map(s => ({
|
|
56
61
|
name: `${s.title} [${s.status}]${s.type ? ` (${s.type})` : ''}`,
|
|
57
62
|
value: s.id,
|
|
58
|
-
}))
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const { selectedSpec } = await inquirer.prompt([
|
|
63
|
-
{
|
|
64
|
-
type: 'list',
|
|
65
|
-
name: 'selectedSpec',
|
|
66
|
-
message: 'Select spec to plan:',
|
|
67
|
-
choices: specs.map(s => ({
|
|
68
|
-
name: `${s.title} [${s.status}]${s.type ? ` (${s.type})` : ''}`,
|
|
69
|
-
value: s.id,
|
|
70
|
-
})),
|
|
71
|
-
},
|
|
72
|
-
]);
|
|
73
|
-
specId = selectedSpec;
|
|
63
|
+
})),
|
|
64
|
+
});
|
|
65
|
+
const resolved = await resolver.resolve();
|
|
66
|
+
specId = resolved.spec;
|
|
74
67
|
}
|
|
75
68
|
// Get the spec
|
|
76
69
|
const spec = await this.storage.getSpec(specId);
|
|
@@ -7,9 +7,10 @@ export default class SpecTicket extends PMOCommand {
|
|
|
7
7
|
specId: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
ticket: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
15
16
|
execute(): Promise<void>;
|