@proletariat/cli 0.3.17 → 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 +12 -6
- package/dist/lib/execution/runners.js +13 -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 +3985 -2372
- package/package.json +3 -1
|
@@ -11,6 +11,7 @@ export default class ActionCreate extends PMOCommand {
|
|
|
11
11
|
'suggested-for': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
'move-to': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Args, Flags } 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 } from '../../lib/prompt-json.js';
|
|
6
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
7
7
|
export default class ActionCreate extends PMOCommand {
|
|
8
8
|
static description = 'Create a new work action';
|
|
9
9
|
static examples = [
|
|
@@ -39,10 +39,6 @@ export default class ActionCreate extends PMOCommand {
|
|
|
39
39
|
description: 'Interactive mode - prompt for all fields',
|
|
40
40
|
default: false,
|
|
41
41
|
}),
|
|
42
|
-
json: Flags.boolean({
|
|
43
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
44
|
-
default: false,
|
|
45
|
-
}),
|
|
46
42
|
};
|
|
47
43
|
getPMOOptions() {
|
|
48
44
|
return { promptIfMultiple: false };
|
|
@@ -58,44 +54,84 @@ export default class ActionCreate extends PMOCommand {
|
|
|
58
54
|
let moveTo = flags['move-to'];
|
|
59
55
|
// Interactive mode if name or prompt is missing
|
|
60
56
|
if (!name || !prompt || flags.interactive) {
|
|
61
|
-
// Build choices
|
|
57
|
+
// Build choices for list/checkbox prompts
|
|
62
58
|
const suggestedForChoices = STATE_CATEGORY_ORDER.map(c => ({ name: c, value: c }));
|
|
63
59
|
const moveToChoices = [
|
|
64
60
|
{ name: '(no automatic move)', value: '' },
|
|
65
61
|
...STATE_CATEGORY_ORDER.map(c => ({ name: c, value: c })),
|
|
66
62
|
];
|
|
67
|
-
//
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
// Use FlagResolver for prompts - works in both JSON and interactive modes
|
|
64
|
+
const resolver = new FlagResolver({
|
|
65
|
+
commandName: 'action create',
|
|
66
|
+
baseCommand: 'prlt action create',
|
|
67
|
+
jsonMode,
|
|
68
|
+
flags: {
|
|
69
|
+
name,
|
|
70
|
+
prompt,
|
|
71
|
+
description,
|
|
72
|
+
moveTo: moveTo || '',
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
// Name input
|
|
76
|
+
resolver.addPrompt({
|
|
77
|
+
flagName: 'name',
|
|
78
|
+
type: 'input',
|
|
79
|
+
message: 'Action name:',
|
|
80
|
+
default: name,
|
|
81
|
+
when: (ctx) => !ctx.flags.name,
|
|
82
|
+
validate: (value) => value.trim() ? true : 'Name is required',
|
|
83
|
+
context: {
|
|
84
|
+
hint: 'Provide with: prlt action create "Action Name" --prompt "..."',
|
|
85
|
+
requiredFields: ['name (as first argument)', '--prompt'],
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
// Prompt input (editor type in interactive, but input for JSON mode context)
|
|
89
|
+
resolver.addPrompt({
|
|
90
|
+
flagName: 'prompt',
|
|
91
|
+
type: 'editor',
|
|
92
|
+
message: 'Prompt (opens editor):',
|
|
93
|
+
default: prompt || 'Enter the prompt that will be sent to the agent...',
|
|
94
|
+
when: (ctx) => !ctx.flags.prompt && ctx.flags.name !== undefined,
|
|
95
|
+
validate: (value) => value.trim() ? true : 'Prompt is required',
|
|
96
|
+
context: (ctx) => ({
|
|
97
|
+
hint: `Provide with: prlt action create "${ctx.flags.name}" --prompt "Your prompt here"`,
|
|
98
|
+
requiredFields: ['--prompt'],
|
|
99
|
+
optionalFields: ['--description', '--suggested-for', '--move-to'],
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
102
|
+
// Description input (optional, only in full interactive mode)
|
|
103
|
+
if (flags.interactive) {
|
|
104
|
+
resolver.addPrompt({
|
|
105
|
+
flagName: 'description',
|
|
106
|
+
type: 'input',
|
|
107
|
+
message: 'Description (optional):',
|
|
108
|
+
default: description || '',
|
|
109
|
+
when: (ctx) => ctx.flags.name !== undefined && ctx.flags.prompt !== undefined,
|
|
110
|
+
});
|
|
111
|
+
// Suggested-for checkbox (optional)
|
|
112
|
+
resolver.addPrompt({
|
|
113
|
+
flagName: 'suggestedFor',
|
|
114
|
+
type: 'checkbox',
|
|
115
|
+
message: 'Suggested for categories (optional):',
|
|
116
|
+
choices: () => suggestedForChoices,
|
|
117
|
+
when: (ctx) => ctx.flags.name !== undefined && ctx.flags.prompt !== undefined,
|
|
118
|
+
});
|
|
119
|
+
// Move-to list (optional)
|
|
120
|
+
resolver.addPrompt({
|
|
121
|
+
flagName: 'moveTo',
|
|
122
|
+
type: 'list',
|
|
123
|
+
message: 'Move ticket to category after action:',
|
|
124
|
+
choices: () => moveToChoices,
|
|
125
|
+
default: moveTo || '',
|
|
126
|
+
when: (ctx) => ctx.flags.name !== undefined && ctx.flags.prompt !== undefined,
|
|
127
|
+
});
|
|
78
128
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// Add validators for required fields
|
|
86
|
-
validate: field.name === 'name' ? ((input) => input.trim() ? true : 'Name is required')
|
|
87
|
-
: field.name === 'prompt' ? ((input) => input.trim() ? true : 'Prompt is required')
|
|
88
|
-
: undefined,
|
|
89
|
-
// Skip fields that already have values
|
|
90
|
-
when: field.name === 'name' ? !name
|
|
91
|
-
: field.name === 'prompt' ? !prompt
|
|
92
|
-
: true,
|
|
93
|
-
})));
|
|
94
|
-
name = answers.name || name;
|
|
95
|
-
prompt = answers.prompt || prompt;
|
|
96
|
-
description = answers.description || description;
|
|
97
|
-
suggestedFor = answers.suggestedFor?.length ? answers.suggestedFor : undefined;
|
|
98
|
-
moveTo = answers.moveTo || undefined;
|
|
129
|
+
const resolved = await resolver.resolve();
|
|
130
|
+
name = resolved.name || name;
|
|
131
|
+
prompt = resolved.prompt || prompt;
|
|
132
|
+
description = resolved.description || description;
|
|
133
|
+
suggestedFor = resolved.suggestedFor?.length ? resolved.suggestedFor : undefined;
|
|
134
|
+
moveTo = (resolved.moveTo || undefined);
|
|
99
135
|
}
|
|
100
136
|
else {
|
|
101
137
|
// Parse flags
|
|
@@ -7,6 +7,7 @@ export default class ActionDelete extends PMOCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
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,8 +1,8 @@
|
|
|
1
1
|
import { Args, Flags } 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 ActionDelete extends PMOCommand {
|
|
7
7
|
static description = 'Delete a work action';
|
|
8
8
|
static examples = [
|
|
@@ -22,10 +22,6 @@ export default class ActionDelete extends PMOCommand {
|
|
|
22
22
|
description: 'Skip confirmation',
|
|
23
23
|
default: false,
|
|
24
24
|
}),
|
|
25
|
-
json: Flags.boolean({
|
|
26
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
27
|
-
default: false,
|
|
28
|
-
}),
|
|
29
25
|
};
|
|
30
26
|
getPMOOptions() {
|
|
31
27
|
return { promptIfMultiple: false };
|
|
@@ -50,24 +46,27 @@ export default class ActionDelete extends PMOCommand {
|
|
|
50
46
|
return handleError('CANNOT_DELETE_BUILTIN', 'Cannot delete built-in actions');
|
|
51
47
|
}
|
|
52
48
|
if (!flags.force) {
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
name: '
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
49
|
+
// Use FlagResolver for confirmation prompt - works in both JSON and interactive modes
|
|
50
|
+
const resolver = new FlagResolver({
|
|
51
|
+
commandName: 'action delete',
|
|
52
|
+
baseCommand: `prlt action delete ${args.id}`,
|
|
53
|
+
jsonMode,
|
|
54
|
+
flags: {},
|
|
55
|
+
});
|
|
56
|
+
resolver.addPrompt({
|
|
57
|
+
flagName: 'confirmed',
|
|
58
|
+
type: 'list',
|
|
59
|
+
message: `Delete action "${action.name}"?`,
|
|
60
|
+
choices: () => [
|
|
61
|
+
{ name: 'No', value: false },
|
|
62
|
+
{ name: 'Yes', value: true },
|
|
63
|
+
],
|
|
64
|
+
getCommand: (value) => value
|
|
65
|
+
? `prlt action delete ${args.id} --force --json`
|
|
66
|
+
: '',
|
|
67
|
+
});
|
|
68
|
+
const resolved = await resolver.resolve();
|
|
69
|
+
if (!resolved.confirmed) {
|
|
71
70
|
this.log(styles.muted('Cancelled'));
|
|
72
71
|
return;
|
|
73
72
|
}
|
|
@@ -4,6 +4,7 @@ export default class Action extends PMOCommand {
|
|
|
4
4
|
static aliases: string[];
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
1
|
import inquirer from 'inquirer';
|
|
3
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
4
3
|
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
@@ -10,10 +9,6 @@ export default class Action extends PMOCommand {
|
|
|
10
9
|
];
|
|
11
10
|
static flags = {
|
|
12
11
|
...pmoBaseFlags,
|
|
13
|
-
json: Flags.boolean({
|
|
14
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
15
|
-
default: false,
|
|
16
|
-
}),
|
|
17
12
|
};
|
|
18
13
|
getPMOOptions() {
|
|
19
14
|
return { promptIfMultiple: false };
|
|
@@ -25,11 +20,11 @@ export default class Action extends PMOCommand {
|
|
|
25
20
|
// Define choices once, use for both JSON and interactive modes
|
|
26
21
|
// Each choice includes the full command for AI agents to execute
|
|
27
22
|
const menuChoices = [
|
|
28
|
-
{ id: 'list', name: 'List all actions', command: 'prlt action list --
|
|
29
|
-
{ id: 'show', name: 'View action details', command: 'prlt action show --
|
|
30
|
-
{ id: 'create', name: 'Create custom action', command: 'prlt action create --
|
|
31
|
-
{ id: 'update', name: 'Update action', command: 'prlt action update --
|
|
32
|
-
{ id: 'delete', name: 'Delete action', command: 'prlt action delete --
|
|
23
|
+
{ id: 'list', name: 'List all actions', command: 'prlt action list --machine' },
|
|
24
|
+
{ id: 'show', name: 'View action details', command: 'prlt action show --machine' },
|
|
25
|
+
{ id: 'create', name: 'Create custom action', command: 'prlt action create --machine' },
|
|
26
|
+
{ id: 'update', name: 'Update action', command: 'prlt action update --machine' },
|
|
27
|
+
{ id: 'delete', name: 'Delete action', command: 'prlt action delete --machine' },
|
|
33
28
|
{ id: 'cancel', name: 'Cancel', command: '' },
|
|
34
29
|
];
|
|
35
30
|
const message = 'Work Actions - What would you like to do?';
|
|
@@ -7,6 +7,7 @@ export default class ActionList extends PMOCommand {
|
|
|
7
7
|
custom: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
'suggested-for': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
};
|
|
12
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 } from '../../lib/prompt-json.js';
|
|
4
5
|
export default class ActionList extends PMOCommand {
|
|
5
6
|
static description = 'List available work actions';
|
|
6
7
|
static examples = [
|
|
@@ -38,7 +39,8 @@ export default class ActionList extends PMOCommand {
|
|
|
38
39
|
if (flags['suggested-for'])
|
|
39
40
|
filter.suggestedFor = flags['suggested-for'];
|
|
40
41
|
const actions = await this.storage.listActions(filter);
|
|
41
|
-
|
|
42
|
+
// Check for JSON output mode (--machine or --json flag)
|
|
43
|
+
if (shouldOutputJson(flags)) {
|
|
42
44
|
this.log(JSON.stringify(actions, null, 2));
|
|
43
45
|
return;
|
|
44
46
|
}
|
|
@@ -12,6 +12,7 @@ export default class ActionRun extends PMOCommand {
|
|
|
12
12
|
category: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Args, Flags } 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 ActionRun extends PMOCommand {
|
|
7
7
|
static description = 'Run an action on one or more tickets (bulk action support)';
|
|
8
8
|
static examples = [
|
|
@@ -44,10 +44,6 @@ export default class ActionRun extends PMOCommand {
|
|
|
44
44
|
description: 'Skip confirmation prompt',
|
|
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
|
async execute() {
|
|
53
49
|
const { argv, flags } = await this.parse(ActionRun);
|
|
@@ -94,32 +90,34 @@ export default class ActionRun extends PMOCommand {
|
|
|
94
90
|
tickets = results.filter((t) => t !== null);
|
|
95
91
|
}
|
|
96
92
|
else {
|
|
97
|
-
// Interactive: show list of tickets to select
|
|
93
|
+
// Interactive: show list of tickets to select using FlagResolver
|
|
98
94
|
const allTickets = await this.storage.listTickets(projectId);
|
|
99
95
|
if (allTickets.length === 0) {
|
|
100
96
|
return handleError('NO_TICKETS', 'No tickets found.');
|
|
101
97
|
}
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
// Use FlagResolver for ticket selection - works in both JSON and interactive modes
|
|
99
|
+
const resolver = new FlagResolver({
|
|
100
|
+
commandName: 'action run',
|
|
101
|
+
baseCommand: `prlt action run --action ${flags.action}`,
|
|
102
|
+
jsonMode,
|
|
103
|
+
flags: {},
|
|
104
|
+
});
|
|
105
|
+
resolver.addPrompt({
|
|
106
|
+
flagName: 'ticketIds',
|
|
107
|
+
type: 'checkbox',
|
|
108
|
+
message: `Select tickets for "${action.name}" action:`,
|
|
109
|
+
choices: () => allTickets.map(t => ({
|
|
105
110
|
name: `${t.id} - ${t.title} [${t.statusName || t.statusCategory || 'unknown'}]`,
|
|
106
111
|
value: t.id,
|
|
107
|
-
}))
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
})),
|
|
113
|
+
validate: (value) => value.length > 0 || 'Select at least one ticket',
|
|
114
|
+
getCommand: (value) => `prlt action run ${value.join(' ')} --action ${flags.action} --json`,
|
|
115
|
+
});
|
|
116
|
+
const resolved = await resolver.resolve();
|
|
117
|
+
if (!resolved.ticketIds || resolved.ticketIds.length === 0) {
|
|
118
|
+
this.error('No tickets selected.');
|
|
110
119
|
}
|
|
111
|
-
const
|
|
112
|
-
type: 'checkbox',
|
|
113
|
-
name: 'selectedTickets',
|
|
114
|
-
message: `Select tickets for "${action.name}" action:`,
|
|
115
|
-
choices: allTickets.map(t => ({
|
|
116
|
-
name: `${t.id} - ${t.title} [${t.statusName || t.statusCategory || 'unknown'}]`,
|
|
117
|
-
value: t.id,
|
|
118
|
-
checked: action.suggestedForCategories?.includes(t.statusCategory),
|
|
119
|
-
})),
|
|
120
|
-
validate: (input) => input.length > 0 || 'Select at least one ticket',
|
|
121
|
-
}]);
|
|
122
|
-
const selectedResults = await Promise.all(selectedTickets.map((id) => this.storage.getTicket(id)));
|
|
120
|
+
const selectedResults = await Promise.all(resolved.ticketIds.map((id) => this.storage.getTicket(id)));
|
|
123
121
|
tickets = selectedResults.filter((t) => t !== null);
|
|
124
122
|
}
|
|
125
123
|
if (tickets.length === 0) {
|
|
@@ -148,13 +146,27 @@ export default class ActionRun extends PMOCommand {
|
|
|
148
146
|
}
|
|
149
147
|
// Confirm unless --force
|
|
150
148
|
if (!flags.force && tickets.length > 1) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
149
|
+
// Use FlagResolver for confirmation prompt - works in both JSON and interactive modes
|
|
150
|
+
const resolver = new FlagResolver({
|
|
151
|
+
commandName: 'action run',
|
|
152
|
+
baseCommand: `prlt action run ${tickets.map(t => t.id).join(' ')} --action ${flags.action}`,
|
|
153
|
+
jsonMode,
|
|
154
|
+
flags: {},
|
|
155
|
+
});
|
|
156
|
+
resolver.addPrompt({
|
|
157
|
+
flagName: 'confirmed',
|
|
158
|
+
type: 'list',
|
|
159
|
+
message: `Run "${action.name}" on ${tickets.length} tickets?`,
|
|
160
|
+
choices: () => [
|
|
161
|
+
{ name: 'Yes', value: true },
|
|
162
|
+
{ name: 'No', value: false },
|
|
163
|
+
],
|
|
164
|
+
getCommand: (value) => value
|
|
165
|
+
? `prlt action run ${tickets.map(t => t.id).join(' ')} --action ${flags.action} --force --json`
|
|
166
|
+
: '',
|
|
167
|
+
});
|
|
168
|
+
const resolved = await resolver.resolve();
|
|
169
|
+
if (!resolved.confirmed) {
|
|
158
170
|
this.log(styles.muted('Cancelled.'));
|
|
159
171
|
return;
|
|
160
172
|
}
|
|
@@ -6,6 +6,8 @@ export default class ActionShow extends PMOCommand {
|
|
|
6
6
|
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
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
|
protected getPMOOptions(): {
|
|
@@ -12,6 +12,7 @@ export default class ActionUpdate extends PMOCommand {
|
|
|
12
12
|
'suggested-for': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
'move-to': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Args, Flags } 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 ActionUpdate extends PMOCommand {
|
|
8
8
|
static description = 'Update a work action';
|
|
9
9
|
static examples = [
|
|
@@ -43,10 +43,6 @@ export default class ActionUpdate extends PMOCommand {
|
|
|
43
43
|
description: 'Interactive mode - prompt for all fields',
|
|
44
44
|
default: false,
|
|
45
45
|
}),
|
|
46
|
-
json: Flags.boolean({
|
|
47
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
48
|
-
default: false,
|
|
49
|
-
}),
|
|
50
46
|
};
|
|
51
47
|
getPMOOptions() {
|
|
52
48
|
return { promptIfMultiple: false };
|
|
@@ -82,47 +78,92 @@ export default class ActionUpdate extends PMOCommand {
|
|
|
82
78
|
{ name: '(no change)', value: '__none__' },
|
|
83
79
|
...STATE_CATEGORY_ORDER.map(c => ({ name: c, value: c })),
|
|
84
80
|
];
|
|
85
|
-
//
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
81
|
+
// Use FlagResolver for prompts - works in both JSON and interactive modes
|
|
82
|
+
const resolver = new FlagResolver({
|
|
83
|
+
commandName: 'action update',
|
|
84
|
+
baseCommand: `prlt action update ${args.id}`,
|
|
85
|
+
jsonMode,
|
|
86
|
+
flags: {
|
|
87
|
+
name: flags.name,
|
|
88
|
+
description: flags.description,
|
|
89
|
+
prompt: flags.prompt,
|
|
90
|
+
suggestedFor: flags['suggested-for'] ? flags['suggested-for'].split(',').map(s => s.trim()) : undefined,
|
|
91
|
+
moveTo: flags['move-to'] || '',
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
// Name input
|
|
95
|
+
resolver.addPrompt({
|
|
96
|
+
flagName: 'name',
|
|
97
|
+
type: 'input',
|
|
98
|
+
message: 'Name:',
|
|
99
|
+
default: existingAction.name,
|
|
100
|
+
context: {
|
|
101
|
+
hint: `Provide with: prlt action update ${args.id} --name "New Name"`,
|
|
102
|
+
currentValue: existingAction.name,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
// Description input
|
|
106
|
+
resolver.addPrompt({
|
|
107
|
+
flagName: 'description',
|
|
108
|
+
type: 'input',
|
|
109
|
+
message: 'Description:',
|
|
110
|
+
default: existingAction.description || '',
|
|
111
|
+
when: (ctx) => ctx.flags.name !== undefined,
|
|
112
|
+
context: {
|
|
113
|
+
currentValue: existingAction.description || '',
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
// Prompt input (editor)
|
|
117
|
+
resolver.addPrompt({
|
|
118
|
+
flagName: 'prompt',
|
|
119
|
+
type: 'editor',
|
|
120
|
+
message: 'Prompt (opens editor):',
|
|
121
|
+
default: existingAction.prompt,
|
|
122
|
+
when: (ctx) => ctx.flags.name !== undefined && ctx.flags.description !== undefined,
|
|
123
|
+
context: {
|
|
124
|
+
hint: `Current prompt length: ${existingAction.prompt.length} chars`,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
// Suggested-for checkbox
|
|
128
|
+
resolver.addPrompt({
|
|
129
|
+
flagName: 'suggestedFor',
|
|
130
|
+
type: 'checkbox',
|
|
131
|
+
message: 'Suggested for categories:',
|
|
132
|
+
choices: () => suggestedForChoices.map(c => ({
|
|
133
|
+
...c,
|
|
134
|
+
// Pre-select current values
|
|
135
|
+
checked: existingAction.suggestedForCategories?.includes(c.value),
|
|
136
|
+
})),
|
|
137
|
+
when: (ctx) => ctx.flags.prompt !== undefined && ctx.flags.suggestedFor === undefined,
|
|
138
|
+
});
|
|
139
|
+
// Move-to list
|
|
140
|
+
resolver.addPrompt({
|
|
141
|
+
flagName: 'moveTo',
|
|
142
|
+
type: 'list',
|
|
143
|
+
message: 'Move ticket to category after action:',
|
|
144
|
+
choices: () => moveToChoices,
|
|
145
|
+
default: existingAction.defaultMoveToCategory || '__none__',
|
|
146
|
+
when: (ctx) => ctx.flags.suggestedFor !== undefined,
|
|
147
|
+
});
|
|
97
148
|
this.log('');
|
|
98
149
|
this.log(styles.header(`Updating action: ${existingAction.name}`));
|
|
99
150
|
this.log(styles.muted('Press Enter to keep current value, or enter new value.'));
|
|
100
151
|
this.log('');
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
checked: field.default?.includes(c.value),
|
|
109
|
-
}))
|
|
110
|
-
: field.choices,
|
|
111
|
-
})));
|
|
112
|
-
if (answers.name !== existingAction.name)
|
|
113
|
-
changes.name = answers.name;
|
|
114
|
-
if (answers.description !== (existingAction.description || ''))
|
|
115
|
-
changes.description = answers.description;
|
|
116
|
-
if (answers.prompt !== existingAction.prompt)
|
|
117
|
-
changes.prompt = answers.prompt;
|
|
152
|
+
const resolved = await resolver.resolve();
|
|
153
|
+
if (resolved.name !== existingAction.name)
|
|
154
|
+
changes.name = resolved.name;
|
|
155
|
+
if (resolved.description !== (existingAction.description || ''))
|
|
156
|
+
changes.description = resolved.description;
|
|
157
|
+
if (resolved.prompt !== existingAction.prompt)
|
|
158
|
+
changes.prompt = resolved.prompt;
|
|
118
159
|
const currentSuggested = existingAction.suggestedForCategories?.sort().join(',') || '';
|
|
119
|
-
const newSuggested =
|
|
160
|
+
const newSuggested = (resolved.suggestedFor || []).sort().join(',');
|
|
120
161
|
if (newSuggested !== currentSuggested) {
|
|
121
|
-
changes.suggestedForCategories =
|
|
162
|
+
changes.suggestedForCategories = resolved.suggestedFor;
|
|
122
163
|
}
|
|
123
164
|
const currentMoveTo = existingAction.defaultMoveToCategory || '__none__';
|
|
124
|
-
if (
|
|
125
|
-
changes.defaultMoveToCategory =
|
|
165
|
+
if (resolved.moveTo !== currentMoveTo) {
|
|
166
|
+
changes.defaultMoveToCategory = resolved.moveTo === '__none__' ? null : resolved.moveTo;
|
|
126
167
|
}
|
|
127
168
|
}
|
|
128
169
|
else {
|
|
@@ -5,6 +5,8 @@ export default class Auth extends Command {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
check: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
10
|
};
|
|
9
11
|
/**
|
|
10
12
|
* Check if the claude-credentials volume exists
|