@proletariat/cli 0.3.33 → 0.3.34
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/delete.d.ts +1 -0
- package/dist/commands/action/index.d.ts +1 -0
- package/dist/commands/action/list.d.ts +1 -0
- package/dist/commands/action/list.js +0 -6
- package/dist/commands/action/run.d.ts +1 -0
- package/dist/commands/action/show.d.ts +1 -0
- package/dist/commands/action/update.d.ts +1 -0
- package/dist/commands/agent/auth.d.ts +2 -1
- package/dist/commands/agent/auth.js +2 -6
- package/dist/commands/agent/cleanup.d.ts +2 -1
- package/dist/commands/agent/cleanup.js +0 -6
- package/dist/commands/agent/discover.d.ts +2 -1
- package/dist/commands/agent/discover.js +2 -6
- package/dist/commands/agent/index.d.ts +1 -0
- package/dist/commands/agent/index.js +0 -7
- package/dist/commands/agent/list.d.ts +1 -0
- package/dist/commands/agent/login.d.ts +1 -0
- package/dist/commands/agent/login.js +1 -7
- package/dist/commands/agent/rebuild.d.ts +2 -1
- package/dist/commands/agent/rebuild.js +0 -6
- package/dist/commands/agent/remove.d.ts +2 -1
- package/dist/commands/agent/remove.js +0 -6
- package/dist/commands/agent/restart.d.ts +1 -0
- package/dist/commands/agent/restart.js +1 -7
- package/dist/commands/agent/shell.d.ts +1 -0
- package/dist/commands/agent/shell.js +1 -7
- package/dist/commands/agent/status.d.ts +1 -0
- package/dist/commands/agent/status.js +1 -7
- package/dist/commands/agent/visit.d.ts +1 -0
- package/dist/commands/agent/visit.js +1 -7
- package/dist/commands/autocomplete/setup.d.ts +1 -0
- package/dist/commands/board/index.d.ts +1 -0
- package/dist/commands/board/view.d.ts +1 -0
- package/dist/commands/board/watch.d.ts +1 -0
- package/dist/commands/branch/create.d.ts +1 -0
- package/dist/commands/branch/create.js +0 -6
- package/dist/commands/branch/index.d.ts +1 -0
- package/dist/commands/branch/index.js +0 -7
- package/dist/commands/branch/list.d.ts +1 -0
- package/dist/commands/branch/validate.d.ts +1 -0
- package/dist/commands/branch/where.d.ts +1 -0
- package/dist/commands/branch/where.js +3 -9
- package/dist/commands/category/create.d.ts +1 -0
- package/dist/commands/category/delete.d.ts +1 -0
- package/dist/commands/category/index.d.ts +1 -0
- package/dist/commands/category/list.d.ts +1 -0
- package/dist/commands/category/list.js +1 -1
- package/dist/commands/category/rename.d.ts +1 -0
- package/dist/commands/claude.d.ts +2 -1
- package/dist/commands/claude.js +2 -6
- package/dist/commands/commit.d.ts +2 -1
- package/dist/commands/commit.js +2 -6
- package/dist/commands/config/index.d.ts +2 -1
- package/dist/commands/config/index.js +3 -7
- package/dist/commands/diet.d.ts +1 -0
- package/dist/commands/docker/clean.d.ts +1 -0
- package/dist/commands/docker/index.d.ts +1 -0
- package/dist/commands/docker/list.d.ts +1 -0
- package/dist/commands/docker/logs.d.ts +2 -0
- package/dist/commands/docker/logs.js +2 -0
- package/dist/commands/docker/prune.d.ts +1 -0
- package/dist/commands/docker/restart.d.ts +1 -0
- package/dist/commands/docker/shell.d.ts +2 -0
- package/dist/commands/docker/shell.js +2 -0
- package/dist/commands/docker/start.d.ts +2 -0
- package/dist/commands/docker/start.js +2 -0
- package/dist/commands/docker/status.d.ts +1 -0
- package/dist/commands/docker/stop.d.ts +1 -0
- package/dist/commands/epic/activate.d.ts +1 -0
- package/dist/commands/epic/activate.js +1 -7
- package/dist/commands/epic/archive.d.ts +2 -1
- package/dist/commands/epic/archive.js +0 -6
- package/dist/commands/epic/create.d.ts +2 -1
- package/dist/commands/epic/create.js +0 -6
- package/dist/commands/epic/delete.d.ts +1 -0
- package/dist/commands/epic/index.d.ts +1 -0
- package/dist/commands/epic/index.js +0 -7
- package/dist/commands/epic/list.d.ts +1 -0
- package/dist/commands/epic/move.d.ts +2 -1
- package/dist/commands/epic/move.js +0 -6
- package/dist/commands/epic/progress.d.ts +2 -1
- package/dist/commands/epic/progress.js +0 -6
- package/dist/commands/epic/project.d.ts +2 -1
- package/dist/commands/epic/project.js +0 -6
- package/dist/commands/epic/reorder.d.ts +1 -0
- package/dist/commands/epic/reorder.js +0 -6
- package/dist/commands/epic/spec.d.ts +2 -1
- package/dist/commands/epic/spec.js +0 -6
- package/dist/commands/epic/ticket.d.ts +2 -1
- package/dist/commands/epic/ticket.js +0 -6
- package/dist/commands/epic/view.d.ts +1 -0
- package/dist/commands/epic/view.js +1 -7
- package/dist/commands/execution/config.d.ts +2 -1
- package/dist/commands/execution/config.js +1 -7
- package/dist/commands/execution/index.d.ts +1 -0
- package/dist/commands/execution/index.js +1 -8
- package/dist/commands/execution/list.d.ts +1 -0
- package/dist/commands/execution/logs.d.ts +1 -0
- package/dist/commands/execution/logs.js +1 -7
- package/dist/commands/execution/stop.d.ts +1 -0
- package/dist/commands/execution/stop.js +1 -7
- package/dist/commands/execution/view.d.ts +1 -0
- package/dist/commands/execution/view.js +2 -8
- package/dist/commands/feedback/index.d.ts +1 -0
- package/dist/commands/feedback/list.d.ts +1 -0
- package/dist/commands/feedback/submit.d.ts +1 -0
- package/dist/commands/feedback/view.d.ts +1 -0
- package/dist/commands/gh/index.d.ts +1 -0
- package/dist/commands/gh/login.d.ts +1 -0
- package/dist/commands/gh/status.d.ts +1 -0
- package/dist/commands/gh/token.d.ts +1 -0
- package/dist/commands/init.d.ts +2 -1
- package/dist/commands/init.js +3 -8
- package/dist/commands/link/create.d.ts +1 -0
- package/dist/commands/link/create.js +0 -6
- package/dist/commands/link/index.d.ts +1 -0
- package/dist/commands/link/index.js +1 -7
- package/dist/commands/link/list.d.ts +1 -0
- package/dist/commands/link/list.js +0 -6
- package/dist/commands/link/remove.d.ts +1 -0
- package/dist/commands/link/remove.js +0 -6
- package/dist/commands/phase/create.d.ts +1 -0
- package/dist/commands/phase/create.js +1 -1
- package/dist/commands/phase/delete.d.ts +1 -0
- package/dist/commands/phase/delete.js +1 -1
- package/dist/commands/phase/list.d.ts +1 -0
- package/dist/commands/phase/move.d.ts +1 -0
- package/dist/commands/phase/move.js +2 -2
- package/dist/commands/phase/update.d.ts +1 -0
- package/dist/commands/phase/update.js +2 -2
- package/dist/commands/pmo/init.d.ts +4 -3
- package/dist/commands/pmo/init.js +2 -7
- package/dist/commands/pr/create.d.ts +1 -0
- package/dist/commands/pr/index.d.ts +1 -0
- package/dist/commands/pr/link.d.ts +1 -0
- package/dist/commands/pr/list.d.ts +1 -0
- package/dist/commands/pr/status.d.ts +1 -0
- package/dist/commands/priority/add.d.ts +1 -0
- package/dist/commands/priority/list.d.ts +1 -0
- package/dist/commands/priority/remove.d.ts +1 -0
- package/dist/commands/priority/set.d.ts +1 -0
- package/dist/commands/project/archive.d.ts +1 -0
- package/dist/commands/project/create.d.ts +1 -0
- package/dist/commands/project/delete.d.ts +1 -0
- package/dist/commands/project/index.d.ts +1 -0
- package/dist/commands/project/list.d.ts +1 -0
- package/dist/commands/project/spec.d.ts +1 -0
- package/dist/commands/project/unarchive.d.ts +1 -0
- package/dist/commands/project/update.d.ts +1 -0
- package/dist/commands/project/view.d.ts +1 -0
- package/dist/commands/pull.d.ts +1 -0
- package/dist/commands/repo/add.d.ts +1 -0
- package/dist/commands/repo/add.js +0 -6
- package/dist/commands/repo/create.d.ts +1 -0
- package/dist/commands/repo/index.d.ts +1 -0
- package/dist/commands/repo/list.d.ts +1 -0
- package/dist/commands/repo/remove.d.ts +1 -0
- package/dist/commands/repo/view.d.ts +1 -0
- package/dist/commands/roadmap/add-project.d.ts +1 -0
- package/dist/commands/roadmap/add-project.js +0 -6
- package/dist/commands/roadmap/create.d.ts +1 -0
- package/dist/commands/roadmap/create.js +0 -6
- package/dist/commands/roadmap/delete.d.ts +1 -0
- package/dist/commands/roadmap/delete.js +0 -6
- package/dist/commands/roadmap/generate.d.ts +1 -0
- package/dist/commands/roadmap/generate.js +0 -6
- package/dist/commands/roadmap/index.d.ts +1 -0
- package/dist/commands/roadmap/index.js +0 -7
- package/dist/commands/roadmap/list.d.ts +1 -0
- package/dist/commands/roadmap/remove-project.d.ts +1 -0
- package/dist/commands/roadmap/remove-project.js +0 -6
- package/dist/commands/roadmap/reorder.d.ts +1 -0
- package/dist/commands/roadmap/reorder.js +0 -6
- package/dist/commands/roadmap/update.d.ts +1 -0
- package/dist/commands/roadmap/update.js +0 -6
- package/dist/commands/roadmap/view.d.ts +1 -0
- package/dist/commands/roadmap/view.js +1 -7
- package/dist/commands/session/attach.d.ts +2 -1
- package/dist/commands/session/attach.js +0 -6
- package/dist/commands/session/health.d.ts +1 -0
- package/dist/commands/session/index.d.ts +1 -0
- package/dist/commands/session/index.js +0 -7
- package/dist/commands/session/list.d.ts +1 -0
- package/dist/commands/spec/create.d.ts +1 -0
- package/dist/commands/spec/delete.d.ts +1 -0
- package/dist/commands/spec/edit.d.ts +1 -0
- package/dist/commands/spec/index.d.ts +1 -0
- package/dist/commands/spec/list.d.ts +1 -0
- package/dist/commands/spec/plan.d.ts +1 -0
- package/dist/commands/spec/ticket.d.ts +1 -0
- package/dist/commands/spec/view.d.ts +1 -0
- package/dist/commands/staff/add.d.ts +3 -2
- package/dist/commands/staff/add.js +2 -6
- package/dist/commands/staff/index.d.ts +2 -1
- package/dist/commands/staff/index.js +0 -6
- package/dist/commands/staff/list.d.ts +1 -0
- package/dist/commands/staff/remove.d.ts +2 -1
- package/dist/commands/staff/remove.js +0 -6
- package/dist/commands/status/category.d.ts +1 -0
- package/dist/commands/status/create.d.ts +1 -0
- package/dist/commands/status/delete.d.ts +1 -0
- package/dist/commands/status/index.d.ts +1 -0
- package/dist/commands/status/list.d.ts +1 -0
- package/dist/commands/status/move.d.ts +1 -0
- package/dist/commands/status/update.d.ts +1 -0
- package/dist/commands/support/book.d.ts +1 -0
- package/dist/commands/support/discord.d.ts +1 -0
- package/dist/commands/support/docs.d.ts +1 -0
- package/dist/commands/support/index.d.ts +1 -0
- package/dist/commands/support/issues.d.ts +1 -0
- package/dist/commands/support/logs.d.ts +1 -0
- package/dist/commands/template/apply.d.ts +1 -0
- package/dist/commands/template/apply.js +0 -6
- package/dist/commands/template/create.d.ts +1 -0
- package/dist/commands/template/create.js +0 -6
- package/dist/commands/template/delete.d.ts +1 -0
- package/dist/commands/template/delete.js +0 -6
- package/dist/commands/template/index.d.ts +1 -0
- package/dist/commands/template/index.js +2 -7
- package/dist/commands/template/list.d.ts +1 -0
- package/dist/commands/template/list.js +1 -7
- package/dist/commands/template/save.d.ts +1 -0
- package/dist/commands/template/save.js +0 -6
- package/dist/commands/template/update.d.ts +1 -0
- package/dist/commands/template/update.js +0 -6
- package/dist/commands/terminal/title.d.ts +1 -0
- package/dist/commands/theme/index.d.ts +1 -0
- package/dist/commands/theme/index.js +2 -7
- package/dist/commands/theme/list.d.ts +1 -0
- package/dist/commands/theme/set.d.ts +1 -0
- package/dist/commands/theme/set.js +3 -7
- package/dist/commands/ticket/bulk.d.ts +1 -0
- package/dist/commands/ticket/bulk.js +0 -7
- package/dist/commands/ticket/category.d.ts +1 -0
- package/dist/commands/ticket/complete.d.ts +2 -1
- package/dist/commands/ticket/complete.js +2 -8
- package/dist/commands/ticket/create.d.ts +2 -1
- package/dist/commands/ticket/create.js +0 -6
- package/dist/commands/ticket/delete.d.ts +2 -1
- package/dist/commands/ticket/delete.js +0 -6
- package/dist/commands/ticket/edit.d.ts +1 -0
- package/dist/commands/ticket/edit.js +0 -6
- package/dist/commands/ticket/epic.d.ts +2 -1
- package/dist/commands/ticket/epic.js +0 -6
- package/dist/commands/ticket/index.d.ts +1 -0
- package/dist/commands/ticket/index.js +6 -9
- package/dist/commands/ticket/list.d.ts +1 -0
- package/dist/commands/ticket/move.d.ts +2 -1
- package/dist/commands/ticket/move.js +2 -8
- package/dist/commands/ticket/project.d.ts +2 -1
- package/dist/commands/ticket/project.js +0 -6
- package/dist/commands/ticket/reassign.d.ts +2 -1
- package/dist/commands/ticket/reassign.js +0 -6
- package/dist/commands/ticket/resolve.d.ts +68 -0
- package/dist/commands/ticket/resolve.js +294 -0
- package/dist/commands/ticket/spec.d.ts +2 -1
- package/dist/commands/ticket/spec.js +0 -6
- package/dist/commands/ticket/status.d.ts +1 -0
- package/dist/commands/ticket/status.js +1 -7
- package/dist/commands/ticket/update.d.ts +2 -1
- package/dist/commands/ticket/update.js +0 -6
- package/dist/commands/ticket/view.d.ts +1 -0
- package/dist/commands/ticket/view.js +1 -7
- package/dist/commands/whoami.d.ts +1 -0
- package/dist/commands/work/complete.d.ts +1 -0
- package/dist/commands/work/complete.js +1 -7
- package/dist/commands/work/index.d.ts +1 -0
- package/dist/commands/work/index.js +4 -7
- package/dist/commands/work/ready.d.ts +2 -1
- package/dist/commands/work/ready.js +21 -14
- package/dist/commands/work/resolve.d.ts +15 -0
- package/dist/commands/work/resolve.js +76 -0
- package/dist/commands/work/revise.d.ts +2 -1
- package/dist/commands/work/revise.js +0 -6
- package/dist/commands/work/spawn-all.d.ts +2 -1
- package/dist/commands/work/spawn-all.js +2 -6
- package/dist/commands/work/spawn.d.ts +2 -1
- package/dist/commands/work/spawn.js +0 -6
- package/dist/commands/work/start.d.ts +2 -1
- package/dist/commands/work/start.js +0 -6
- package/dist/commands/work/watch.d.ts +2 -1
- package/dist/commands/work/watch.js +0 -6
- package/dist/commands/workflow/create.d.ts +1 -0
- package/dist/commands/workflow/delete.d.ts +1 -0
- package/dist/commands/workflow/index.d.ts +1 -0
- package/dist/commands/workflow/index.js +1 -7
- package/dist/commands/workflow/list.d.ts +1 -0
- package/dist/commands/workflow/switch.d.ts +1 -0
- package/dist/commands/workflow/view.d.ts +1 -0
- package/dist/commands/workspace/add.d.ts +2 -0
- package/dist/commands/workspace/add.js +2 -0
- package/dist/commands/workspace/list.d.ts +1 -0
- package/dist/commands/workspace/list.js +4 -8
- package/dist/commands/workspace/prune.d.ts +1 -0
- package/dist/commands/workspace/prune.js +4 -6
- package/dist/commands/workspace/remove.d.ts +1 -0
- package/dist/commands/workspace/remove.js +3 -7
- package/dist/commands/workspace/use.d.ts +1 -0
- package/dist/commands/workspace/use.js +3 -7
- package/dist/lib/database/drizzle-schema.d.ts +1 -1
- package/dist/lib/pmo/base-command.d.ts +4 -1
- package/dist/lib/pmo/base-command.js +9 -3
- package/dist/lib/pmo/storage/base.js +69 -5
- package/dist/lib/prompt-json.d.ts +5 -2
- package/dist/lib/prompt-json.js +4 -4
- package/oclif.manifest.json +4208 -3427
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Args
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import Database from 'better-sqlite3';
|
|
4
4
|
import { PMOCommand, pmoBaseFlags, autoExportToBoard } from '../../lib/pmo/index.js';
|
|
@@ -21,12 +21,6 @@ export default class WorkComplete extends PMOCommand {
|
|
|
21
21
|
};
|
|
22
22
|
static flags = {
|
|
23
23
|
...pmoBaseFlags,
|
|
24
|
-
json: Flags.boolean({
|
|
25
|
-
char: 'm',
|
|
26
|
-
aliases: ['machine'],
|
|
27
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
28
|
-
default: false,
|
|
29
|
-
}),
|
|
30
24
|
};
|
|
31
25
|
async execute() {
|
|
32
26
|
const { args, flags } = await this.parse(WorkComplete);
|
|
@@ -4,6 +4,7 @@ export default class Work extends PMOCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
};
|
|
9
10
|
protected getPMOOptions(): {
|
|
@@ -1,4 +1,3 @@
|
|
|
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';
|
|
4
3
|
export default class Work extends PMOCommand {
|
|
@@ -8,12 +7,6 @@ export default class Work extends PMOCommand {
|
|
|
8
7
|
];
|
|
9
8
|
static flags = {
|
|
10
9
|
...pmoBaseFlags,
|
|
11
|
-
json: Flags.boolean({
|
|
12
|
-
char: 'm',
|
|
13
|
-
aliases: ['machine'],
|
|
14
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
15
|
-
default: false,
|
|
16
|
-
}),
|
|
17
10
|
};
|
|
18
11
|
getPMOOptions() {
|
|
19
12
|
// Prompt for project selection so we can pass it to subcommands
|
|
@@ -30,6 +23,7 @@ export default class Work extends PMOCommand {
|
|
|
30
23
|
// Each choice includes the full command for AI agents to execute
|
|
31
24
|
const menuChoices = [
|
|
32
25
|
{ id: 'start', name: 'Start work (launch single agent)', command: `prlt work start -P ${projectId} --json` },
|
|
26
|
+
{ id: 'resolve', name: 'Resolve questions (agent-assisted)', command: `prlt work resolve -P ${projectId} --json` },
|
|
33
27
|
{ id: 'spawn', name: 'Spawn work (batch by column)', command: `prlt work spawn -P ${projectId} --json` },
|
|
34
28
|
{ id: 'watch', name: 'Watch column (auto-spawn)', command: `prlt work watch -P ${projectId} --json` },
|
|
35
29
|
{ id: 'ready', name: 'Mark work ready for review', command: `prlt work ready -P ${projectId} --json` },
|
|
@@ -55,6 +49,9 @@ export default class Work extends PMOCommand {
|
|
|
55
49
|
case 'start':
|
|
56
50
|
await this.config.runCommand('work:start', projectArgs);
|
|
57
51
|
break;
|
|
52
|
+
case 'resolve':
|
|
53
|
+
await this.config.runCommand('work:resolve', projectArgs);
|
|
54
|
+
break;
|
|
58
55
|
case 'spawn':
|
|
59
56
|
await this.config.runCommand('work:spawn', projectArgs);
|
|
60
57
|
break;
|
|
@@ -6,10 +6,11 @@ export default class WorkReady extends PMOCommand {
|
|
|
6
6
|
ticketId: 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
|
pr: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
'draft-pr': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
11
|
'no-pr': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
machine: 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>;
|
|
@@ -26,12 +26,6 @@ export default class WorkReady extends PMOCommand {
|
|
|
26
26
|
};
|
|
27
27
|
static flags = {
|
|
28
28
|
...pmoBaseFlags,
|
|
29
|
-
json: Flags.boolean({
|
|
30
|
-
char: 'm',
|
|
31
|
-
aliases: ['machine'],
|
|
32
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
33
|
-
default: false,
|
|
34
|
-
}),
|
|
35
29
|
pr: Flags.boolean({
|
|
36
30
|
description: 'Create a pull request for this work',
|
|
37
31
|
default: false,
|
|
@@ -152,14 +146,27 @@ export default class WorkReady extends PMOCommand {
|
|
|
152
146
|
}
|
|
153
147
|
}
|
|
154
148
|
else {
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
149
|
+
// Resolve agent directory based on agent type (staff vs temp)
|
|
150
|
+
const agentRecord = workspaceInfo.agents.find(a => a.name === agentName);
|
|
151
|
+
let agentDir;
|
|
152
|
+
if (agentRecord?.worktree_path) {
|
|
153
|
+
// Use the worktree_path from the database if available
|
|
154
|
+
agentDir = path.join(workspaceInfo.path, agentRecord.worktree_path);
|
|
155
|
+
}
|
|
156
|
+
else if (agentRecord?.type === 'ephemeral') {
|
|
157
|
+
agentDir = path.join(workspaceInfo.path, 'agents', workspaceInfo.ephemeralAgentsDir, agentName);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
agentDir = path.join(workspaceInfo.path, 'agents', workspaceInfo.persistentAgentsDir, agentName);
|
|
161
|
+
}
|
|
162
|
+
if (fs.existsSync(agentDir)) {
|
|
163
|
+
// Look for repo directories inside agent dir
|
|
164
|
+
const entries = fs.readdirSync(agentDir, { withFileTypes: true });
|
|
165
|
+
const repoDirs = entries.filter((e) => e.isDirectory() && !e.name.startsWith('.') && e.name !== 'node_modules');
|
|
166
|
+
if (repoDirs.length > 0) {
|
|
167
|
+
// Use the first repo directory (typically the main worktree)
|
|
168
|
+
worktreePath = path.join(agentDir, repoDirs[0].name);
|
|
169
|
+
}
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
172
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
export default class WorkResolve extends PMOCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static strict: boolean;
|
|
6
|
+
static args: {
|
|
7
|
+
ticketId: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
execute(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
|
+
import { styles } from '../../lib/styles.js';
|
|
4
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
|
+
export default class WorkResolve extends PMOCommand {
|
|
6
|
+
static description = 'Agent-assisted resolution of ambiguity questions on tickets (spawns interactive agent)';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> TKT-001',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> TKT-001 TKT-002',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> # Interactive picker for needs-clarification tickets',
|
|
11
|
+
];
|
|
12
|
+
static strict = false;
|
|
13
|
+
static args = {
|
|
14
|
+
ticketId: Args.string({
|
|
15
|
+
description: 'Ticket ID(s) to resolve - prompts with picker if not provided',
|
|
16
|
+
required: false,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
...pmoBaseFlags,
|
|
21
|
+
json: Flags.boolean({
|
|
22
|
+
char: 'm',
|
|
23
|
+
aliases: ['machine'],
|
|
24
|
+
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
25
|
+
default: false,
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
async execute() {
|
|
29
|
+
const { args, flags, argv } = await this.parse(WorkResolve);
|
|
30
|
+
const projectId = flags.project;
|
|
31
|
+
const jsonMode = shouldOutputJson(flags);
|
|
32
|
+
const handleError = (code, message) => {
|
|
33
|
+
if (jsonMode) {
|
|
34
|
+
outputErrorAsJson(code, message, createMetadata('work resolve', flags));
|
|
35
|
+
this.exit(1);
|
|
36
|
+
}
|
|
37
|
+
this.error(message);
|
|
38
|
+
};
|
|
39
|
+
// Collect ticket IDs from argv (supports multiple args)
|
|
40
|
+
let ticketIds = argv.filter(a => !a.startsWith('-'));
|
|
41
|
+
if (ticketIds.length === 0) {
|
|
42
|
+
// No tickets specified - show picker of needs-clarification tickets
|
|
43
|
+
const allTickets = await this.storage.listTickets(projectId);
|
|
44
|
+
const clarificationTickets = allTickets.filter((t) => t.labels.includes('needs-clarification') ||
|
|
45
|
+
t.statusName?.toLowerCase() === 'needs clarification');
|
|
46
|
+
if (clarificationTickets.length === 0) {
|
|
47
|
+
return handleError('NO_TICKETS', 'No tickets need clarification. Run "prlt work start --action groom" to groom tickets first.');
|
|
48
|
+
}
|
|
49
|
+
const selected = await this.selectFromList({
|
|
50
|
+
message: 'Select ticket to resolve (agent-assisted):',
|
|
51
|
+
items: clarificationTickets,
|
|
52
|
+
getName: (t) => `${t.id} - ${t.title} (${t.statusName})`,
|
|
53
|
+
getValue: (t) => t.id,
|
|
54
|
+
getCommand: (t) => `prlt work resolve ${t.id}${projectId ? ` -P ${projectId}` : ''} --json`,
|
|
55
|
+
jsonMode: jsonMode ? { flags, commandName: 'work resolve' } : null,
|
|
56
|
+
});
|
|
57
|
+
if (!selected) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
ticketIds = [selected];
|
|
61
|
+
}
|
|
62
|
+
// Launch work start with resolve action for each ticket
|
|
63
|
+
for (const ticketId of ticketIds) {
|
|
64
|
+
this.log(styles.info(`\nLaunching agent-assisted resolve for ${styles.emphasis(ticketId)}...`));
|
|
65
|
+
const workStartArgs = [ticketId, '--action', 'resolve'];
|
|
66
|
+
if (projectId) {
|
|
67
|
+
workStartArgs.push('--project', projectId);
|
|
68
|
+
}
|
|
69
|
+
if (jsonMode) {
|
|
70
|
+
workStartArgs.push('--json');
|
|
71
|
+
}
|
|
72
|
+
// eslint-disable-next-line no-await-in-loop
|
|
73
|
+
await this.config.runCommand('work:start', workStartArgs);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -6,12 +6,13 @@ export default class WorkRevise extends PMOCommand {
|
|
|
6
6
|
ticketId: 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
|
mode: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
10
|
executor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
12
|
'run-on-host': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
13
|
session: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
};
|
|
17
18
|
execute(): Promise<void>;
|
|
@@ -30,12 +30,6 @@ export default class WorkRevise extends PMOCommand {
|
|
|
30
30
|
};
|
|
31
31
|
static flags = {
|
|
32
32
|
...pmoBaseFlags,
|
|
33
|
-
json: Flags.boolean({
|
|
34
|
-
char: 'm',
|
|
35
|
-
aliases: ['machine'],
|
|
36
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
37
|
-
default: false,
|
|
38
|
-
}),
|
|
39
33
|
mode: Flags.string({
|
|
40
34
|
char: 'd',
|
|
41
35
|
description: 'Runtime mode',
|
|
@@ -3,12 +3,13 @@ export default class WorkSpawnAll extends PMOCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
6
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
7
|
'run-on-host': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
8
|
'skip-permissions': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
'create-pr': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
executor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
machine: 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
|
protected getPMOOptions(): {
|
|
@@ -10,12 +10,6 @@ export default class WorkSpawnAll extends PMOCommand {
|
|
|
10
10
|
];
|
|
11
11
|
static flags = {
|
|
12
12
|
...pmoBaseFlags,
|
|
13
|
-
json: Flags.boolean({
|
|
14
|
-
char: 'm',
|
|
15
|
-
aliases: ['machine'],
|
|
16
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
17
|
-
default: false,
|
|
18
|
-
}),
|
|
19
13
|
force: Flags.boolean({
|
|
20
14
|
char: 'f',
|
|
21
15
|
description: 'Start even if work already in progress',
|
|
@@ -51,6 +45,8 @@ export default class WorkSpawnAll extends PMOCommand {
|
|
|
51
45
|
const args = ['--all', '--project', projectId];
|
|
52
46
|
if (flags.json)
|
|
53
47
|
args.push('--json');
|
|
48
|
+
if (flags.machine)
|
|
49
|
+
args.push('--machine');
|
|
54
50
|
if (flags.force)
|
|
55
51
|
args.push('--force');
|
|
56
52
|
if (flags['run-on-host'])
|
|
@@ -4,7 +4,6 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
4
4
|
static strict: boolean;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
7
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
8
|
many: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
column: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -32,6 +31,8 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
32
31
|
priority: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
32
|
epic: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
33
|
status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
35
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
35
36
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
36
37
|
};
|
|
37
38
|
execute(): Promise<void>;
|
|
@@ -28,12 +28,6 @@ export default class WorkSpawn extends PMOCommand {
|
|
|
28
28
|
];
|
|
29
29
|
static flags = {
|
|
30
30
|
...pmoBaseFlags,
|
|
31
|
-
json: Flags.boolean({
|
|
32
|
-
char: 'm',
|
|
33
|
-
aliases: ['machine'],
|
|
34
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
35
|
-
default: false,
|
|
36
|
-
}),
|
|
37
31
|
all: Flags.boolean({
|
|
38
32
|
char: 'a',
|
|
39
33
|
description: 'Spawn all tickets tickets in a column',
|
|
@@ -6,7 +6,6 @@ export default class WorkStart extends PMOCommand {
|
|
|
6
6
|
ticketId: 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
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
executor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
action: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -29,6 +28,8 @@ export default class WorkStart extends PMOCommand {
|
|
|
29
28
|
focus: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
30
29
|
clone: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
31
30
|
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
31
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
32
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
32
33
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
34
|
};
|
|
34
35
|
execute(): Promise<void>;
|
|
@@ -85,12 +85,6 @@ export default class WorkStart extends PMOCommand {
|
|
|
85
85
|
};
|
|
86
86
|
static flags = {
|
|
87
87
|
...pmoBaseFlags,
|
|
88
|
-
json: Flags.boolean({
|
|
89
|
-
char: 'm',
|
|
90
|
-
aliases: ['machine'],
|
|
91
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
92
|
-
default: false,
|
|
93
|
-
}),
|
|
94
88
|
all: Flags.boolean({
|
|
95
89
|
char: 'a',
|
|
96
90
|
description: 'Start work on all unassigned backlog tickets (batch mode)',
|
|
@@ -3,7 +3,6 @@ export default class WorkWatch extends PMOCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
6
|
column: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
7
|
strategy: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
8
|
agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -13,6 +12,8 @@ export default class WorkWatch extends PMOCommand {
|
|
|
13
12
|
mode: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
13
|
'skip-permissions': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
14
|
'create-pr': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
};
|
|
18
19
|
private isRunning;
|
|
@@ -21,12 +21,6 @@ export default class WorkWatch extends PMOCommand {
|
|
|
21
21
|
];
|
|
22
22
|
static flags = {
|
|
23
23
|
...pmoBaseFlags,
|
|
24
|
-
json: Flags.boolean({
|
|
25
|
-
char: 'm',
|
|
26
|
-
aliases: ['machine'],
|
|
27
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
28
|
-
default: false,
|
|
29
|
-
}),
|
|
30
24
|
column: Flags.string({
|
|
31
25
|
char: 'c',
|
|
32
26
|
description: 'Column to watch for new tickets (prompts if not provided)',
|
|
@@ -9,6 +9,7 @@ export default class WorkflowCreate extends PMOCommand {
|
|
|
9
9
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
statuses: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
machine: 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
|
protected getPMOOptions(): {
|
|
@@ -8,6 +8,7 @@ export default class WorkflowDelete extends PMOCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
};
|
|
13
14
|
protected getPMOOptions(): {
|
|
@@ -6,6 +6,7 @@ export default class Workflow extends PMOCommand {
|
|
|
6
6
|
builtin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
custom: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
};
|
|
11
12
|
protected getPMOOptions(): {
|
|
@@ -18,12 +18,6 @@ export default class Workflow extends PMOCommand {
|
|
|
18
18
|
description: 'Show only custom workflows',
|
|
19
19
|
default: false,
|
|
20
20
|
}),
|
|
21
|
-
json: Flags.boolean({
|
|
22
|
-
char: 'm',
|
|
23
|
-
aliases: ['machine'],
|
|
24
|
-
description: 'Output as JSON',
|
|
25
|
-
default: false,
|
|
26
|
-
}),
|
|
27
21
|
};
|
|
28
22
|
getPMOOptions() {
|
|
29
23
|
return { promptIfMultiple: false };
|
|
@@ -37,7 +31,7 @@ export default class Workflow extends PMOCommand {
|
|
|
37
31
|
if (flags.custom)
|
|
38
32
|
filter.isBuiltin = false;
|
|
39
33
|
const workflows = await this.storage.listWorkflows(Object.keys(filter).length > 0 ? filter : undefined);
|
|
40
|
-
if (flags.json) {
|
|
34
|
+
if (flags.json || flags.machine) {
|
|
41
35
|
this.log(JSON.stringify(workflows, null, 2));
|
|
42
36
|
return;
|
|
43
37
|
}
|
|
@@ -6,6 +6,7 @@ export default class WorkflowList extends PMOCommand {
|
|
|
6
6
|
builtin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
custom: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
};
|
|
11
12
|
protected getPMOOptions(): {
|
|
@@ -8,6 +8,7 @@ export default class WorkflowSwitch extends PMOCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
};
|
|
13
14
|
execute(): Promise<void>;
|
|
@@ -7,6 +7,7 @@ export default class WorkflowView extends PMOCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
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
|
protected getPMOOptions(): {
|
|
@@ -7,6 +7,8 @@ export default class WorkspaceAdd extends Command {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
12
|
};
|
|
11
13
|
run(): Promise<void>;
|
|
12
14
|
}
|
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
import { registerWorkspace, normalizePath, isWorkspaceRegistered, getWorkspaceNameFromPath, } from '../../lib/machine-config.js';
|
|
6
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
6
7
|
export default class WorkspaceAdd extends Command {
|
|
7
8
|
static description = 'Register an existing workspace in the machine config';
|
|
8
9
|
static examples = [
|
|
@@ -17,6 +18,7 @@ export default class WorkspaceAdd extends Command {
|
|
|
17
18
|
}),
|
|
18
19
|
};
|
|
19
20
|
static flags = {
|
|
21
|
+
...machineOutputFlags,
|
|
20
22
|
name: Flags.string({
|
|
21
23
|
char: 'n',
|
|
22
24
|
description: 'Custom name for the workspace (defaults to directory basename or workspace config name)',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Command
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { findAllHQs, findHQRootWithSource, isValidHQ } from '../../lib/workspace.js';
|
|
4
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
4
5
|
import { getRegisteredWorkspaces, getActiveWorkspace, } from '../../lib/machine-config.js';
|
|
5
6
|
import * as fs from 'node:fs';
|
|
6
7
|
import * as path from 'node:path';
|
|
@@ -11,12 +12,7 @@ export default class WorkspaceList extends Command {
|
|
|
11
12
|
'<%= config.bin %> <%= command.id %> --json',
|
|
12
13
|
];
|
|
13
14
|
static flags = {
|
|
14
|
-
|
|
15
|
-
char: 'm',
|
|
16
|
-
aliases: ['machine'],
|
|
17
|
-
description: 'Output as JSON for machine-readable format',
|
|
18
|
-
default: false,
|
|
19
|
-
}),
|
|
15
|
+
...machineOutputFlags,
|
|
20
16
|
};
|
|
21
17
|
async run() {
|
|
22
18
|
const { flags } = await this.parse(WorkspaceList);
|
|
@@ -82,7 +78,7 @@ export default class WorkspaceList extends Command {
|
|
|
82
78
|
});
|
|
83
79
|
}
|
|
84
80
|
// JSON output
|
|
85
|
-
if (flags.json) {
|
|
81
|
+
if (flags.json || flags.machine) {
|
|
86
82
|
const output = {
|
|
87
83
|
workspaces: workspaces.map((w) => ({
|
|
88
84
|
name: w.name,
|
|
@@ -6,6 +6,7 @@ export default class WorkspacePrune extends PromptCommand {
|
|
|
6
6
|
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
};
|
|
10
11
|
run(): Promise<void>;
|
|
11
12
|
private findStaleWorkspaces;
|
|
@@ -6,6 +6,7 @@ import { styles } from '../../lib/styles.js';
|
|
|
6
6
|
import { getRegisteredHeadquarters, unregisterHeadquarters, } from '../../lib/machine-config.js';
|
|
7
7
|
import { getWorkspaceAgents, removeAgentsFromDatabase, getDatabasePath, } from '../../lib/database/index.js';
|
|
8
8
|
import { outputConfirmationNeededAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
9
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
9
10
|
export default class WorkspacePrune extends PromptCommand {
|
|
10
11
|
static description = 'Remove stale workspace entries and agents with deleted worktrees';
|
|
11
12
|
static examples = [
|
|
@@ -14,6 +15,7 @@ export default class WorkspacePrune extends PromptCommand {
|
|
|
14
15
|
'<%= config.bin %> <%= command.id %> --force',
|
|
15
16
|
];
|
|
16
17
|
static flags = {
|
|
18
|
+
...machineOutputFlags,
|
|
17
19
|
'dry-run': Flags.boolean({
|
|
18
20
|
char: 'd',
|
|
19
21
|
description: 'Show what would be removed without removing',
|
|
@@ -24,23 +26,19 @@ export default class WorkspacePrune extends PromptCommand {
|
|
|
24
26
|
description: 'Skip confirmation prompt and prune immediately',
|
|
25
27
|
default: false,
|
|
26
28
|
}),
|
|
27
|
-
json: Flags.boolean({
|
|
28
|
-
description: 'Output as JSON',
|
|
29
|
-
default: false,
|
|
30
|
-
}),
|
|
31
29
|
};
|
|
32
30
|
async run() {
|
|
33
31
|
const { flags } = await this.parse(WorkspacePrune);
|
|
34
32
|
// In non-TTY mode without --json (CI, scripts, piped), default to dry-run unless --force is set.
|
|
35
33
|
// In --json mode, we use confirmation_needed output instead of auto-dry-run so agents can review and confirm.
|
|
36
34
|
const isNonTTY = !process.stdout.isTTY;
|
|
37
|
-
const effectiveDryRun = flags['dry-run'] || (!flags.json && isNonTTY && !flags.force);
|
|
35
|
+
const effectiveDryRun = flags['dry-run'] || (!(flags.json || flags.machine) && isNonTTY && !flags.force);
|
|
38
36
|
// Find stale entries
|
|
39
37
|
const staleWorkspaces = this.findStaleWorkspaces();
|
|
40
38
|
const staleAgents = this.findStaleAgents();
|
|
41
39
|
const totalStale = staleWorkspaces.length + staleAgents.length;
|
|
42
40
|
// JSON output
|
|
43
|
-
if (flags.json) {
|
|
41
|
+
if (flags.json || flags.machine) {
|
|
44
42
|
const output = {
|
|
45
43
|
dryRun: effectiveDryRun,
|
|
46
44
|
staleWorkspaces: staleWorkspaces.map(w => ({
|
|
@@ -7,6 +7,7 @@ export default class WorkspaceRemove extends PromptCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
};
|
|
11
12
|
run(): Promise<void>;
|
|
12
13
|
private resolveWorkspacePath;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Args
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { PromptCommand } from '../../lib/prompt-command.js';
|
|
4
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
4
5
|
import { findWorkspacesByName, findWorkspaceByPath, unregisterWorkspace, normalizePath, getActiveWorkspace, } from '../../lib/machine-config.js';
|
|
5
6
|
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
6
7
|
export default class WorkspaceRemove extends PromptCommand {
|
|
@@ -16,12 +17,7 @@ export default class WorkspaceRemove extends PromptCommand {
|
|
|
16
17
|
}),
|
|
17
18
|
};
|
|
18
19
|
static flags = {
|
|
19
|
-
|
|
20
|
-
char: 'm',
|
|
21
|
-
aliases: ['machine'],
|
|
22
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
23
|
-
default: false,
|
|
24
|
-
}),
|
|
20
|
+
...machineOutputFlags,
|
|
25
21
|
};
|
|
26
22
|
async run() {
|
|
27
23
|
const { args, flags } = await this.parse(WorkspaceRemove);
|