@proletariat/cli 0.3.32 → 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 +9 -11
- package/dist/commands/work/start.d.ts +3 -1
- package/dist/commands/work/start.js +5 -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/execution/runners.js +4 -0
- package/dist/lib/execution/types.d.ts +1 -0
- 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 +4228 -3440
- package/package.json +1 -1
|
@@ -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);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Args
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
4
|
import { PromptCommand } from '../../lib/prompt-command.js';
|
|
5
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
5
6
|
import { isValidHQ } from '../../lib/workspace.js';
|
|
6
7
|
import { findWorkspacesByName, findWorkspaceByPath, setActiveWorkspace, normalizePath, getRegisteredWorkspaces, } from '../../lib/machine-config.js';
|
|
7
8
|
export default class WorkspaceUse extends PromptCommand {
|
|
@@ -17,12 +18,7 @@ export default class WorkspaceUse extends PromptCommand {
|
|
|
17
18
|
}),
|
|
18
19
|
};
|
|
19
20
|
static flags = {
|
|
20
|
-
|
|
21
|
-
char: 'm',
|
|
22
|
-
aliases: ['machine'],
|
|
23
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
24
|
-
default: false,
|
|
25
|
-
}),
|
|
21
|
+
...machineOutputFlags,
|
|
26
22
|
};
|
|
27
23
|
async run() {
|
|
28
24
|
const { args, flags } = await this.parse(WorkspaceUse);
|
|
@@ -33,7 +33,7 @@ export declare const workspace: import("drizzle-orm/sqlite-core").SQLiteTableWit
|
|
|
33
33
|
tableName: "workspace";
|
|
34
34
|
dataType: "string";
|
|
35
35
|
columnType: "SQLiteText";
|
|
36
|
-
data: "
|
|
36
|
+
data: "workspace" | "hq";
|
|
37
37
|
driverParam: string;
|
|
38
38
|
notNull: true;
|
|
39
39
|
hasDefault: false;
|
|
@@ -214,6 +214,10 @@ function buildPrompt(context) {
|
|
|
214
214
|
}
|
|
215
215
|
// Note: Branch setup (fetch + checkout/create) is now handled programmatically
|
|
216
216
|
// in work/start.ts before the agent spawns, so no prompt instructions needed
|
|
217
|
+
// Additional instructions from --message flag (appended to any action)
|
|
218
|
+
if (context.customMessage) {
|
|
219
|
+
prompt += `\n## Additional Instructions\n\n${context.customMessage}\n`;
|
|
220
|
+
}
|
|
217
221
|
// END HOOK - Action-specific completion instructions
|
|
218
222
|
prompt += `\n---\n\n## When Complete\n\n`;
|
|
219
223
|
// For revisions, use the revision-specific end prompt
|
|
@@ -8,14 +8,16 @@ import { type JsonFlags } from '../prompt-json.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const jsonModeFlags: {
|
|
10
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Base flags for machine-readable output mode
|
|
14
15
|
* Include these in your command's flags by spreading: ...machineOutputFlags
|
|
15
|
-
* --json
|
|
16
|
+
* --json and --machine/-m both trigger JSON output mode
|
|
16
17
|
*/
|
|
17
18
|
export declare const machineOutputFlags: {
|
|
18
19
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
23
|
* Base flags shared by all PMO commands
|
|
@@ -23,6 +25,7 @@ export declare const machineOutputFlags: {
|
|
|
23
25
|
*/
|
|
24
26
|
export declare const pmoBaseFlags: {
|
|
25
27
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
26
29
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
30
|
};
|
|
28
31
|
/**
|
|
@@ -11,8 +11,11 @@ import { shouldOutputJson, outputPromptAsJson, outputErrorAsJson, createMetadata
|
|
|
11
11
|
*/
|
|
12
12
|
export const jsonModeFlags = {
|
|
13
13
|
json: Flags.boolean({
|
|
14
|
+
description: 'Output as JSON for AI agents/scripts',
|
|
15
|
+
default: false,
|
|
16
|
+
}),
|
|
17
|
+
machine: Flags.boolean({
|
|
14
18
|
char: 'm',
|
|
15
|
-
aliases: ['machine'],
|
|
16
19
|
description: 'Output as JSON for AI agents/scripts',
|
|
17
20
|
default: false,
|
|
18
21
|
}),
|
|
@@ -20,12 +23,15 @@ export const jsonModeFlags = {
|
|
|
20
23
|
/**
|
|
21
24
|
* Base flags for machine-readable output mode
|
|
22
25
|
* Include these in your command's flags by spreading: ...machineOutputFlags
|
|
23
|
-
* --json
|
|
26
|
+
* --json and --machine/-m both trigger JSON output mode
|
|
24
27
|
*/
|
|
25
28
|
export const machineOutputFlags = {
|
|
26
29
|
json: Flags.boolean({
|
|
30
|
+
description: 'Output as JSON for AI agents/scripts',
|
|
31
|
+
default: false,
|
|
32
|
+
}),
|
|
33
|
+
machine: Flags.boolean({
|
|
27
34
|
char: 'm',
|
|
28
|
-
aliases: ['machine'],
|
|
29
35
|
description: 'Output as JSON for AI agents/scripts',
|
|
30
36
|
default: false,
|
|
31
37
|
}),
|
|
@@ -467,6 +467,22 @@ Analyze this ticket and improve its definition:
|
|
|
467
467
|
|
|
468
468
|
Do NOT implement the ticket - only improve its definition so it's ready to be worked on.
|
|
469
469
|
|
|
470
|
+
## Flagging Ambiguities
|
|
471
|
+
|
|
472
|
+
If you identify ambiguities or questions that need human clarification, add them to the description using this **exact format**:
|
|
473
|
+
|
|
474
|
+
\`\`\`
|
|
475
|
+
**Q1:** Should the API use REST or GraphQL?
|
|
476
|
+
**Q2:** What is the expected timeout for sessions?
|
|
477
|
+
**Q3:** Should this feature be behind a feature flag?
|
|
478
|
+
\`\`\`
|
|
479
|
+
|
|
480
|
+
When questions are added:
|
|
481
|
+
- Add the \`needs-clarification\` label: \`--add-label "needs-clarification"\`
|
|
482
|
+
- Questions can later be resolved with \`prlt ticket resolve\` or \`prlt work resolve\`
|
|
483
|
+
|
|
484
|
+
If NO ambiguities are found, add the \`ready\` label instead.
|
|
485
|
+
|
|
470
486
|
**AI Agent Tip:** When running \`prlt\` commands without all required arguments, use \`--json\` to receive interactive prompts as structured JSON.
|
|
471
487
|
|
|
472
488
|
## Ticket Schema Reference
|
|
@@ -528,6 +544,54 @@ After updating, output a brief summary of your grooming changes.`,
|
|
|
528
544
|
modifiesCode: false,
|
|
529
545
|
position: 0,
|
|
530
546
|
},
|
|
547
|
+
{
|
|
548
|
+
id: 'resolve',
|
|
549
|
+
name: 'Resolve',
|
|
550
|
+
description: 'Help human resolve ambiguity questions flagged during grooming',
|
|
551
|
+
prompt: `${PRLT_USAGE_RULE}
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
# Action: Resolve Ambiguities
|
|
556
|
+
|
|
557
|
+
This ticket has been groomed and has open questions (Q1, Q2, etc.) that need human answers.
|
|
558
|
+
|
|
559
|
+
Your job is to help the human answer each question by:
|
|
560
|
+
1. Reading the ticket description to find all **Q1:**, **Q2:**, etc. questions
|
|
561
|
+
2. For each question, explore the codebase to find relevant context
|
|
562
|
+
3. Present each question to the human with your findings and a suggested answer
|
|
563
|
+
4. Collect the human's answer (they may accept your suggestion or provide their own)
|
|
564
|
+
5. Write the resolved answers back into the ticket description
|
|
565
|
+
|
|
566
|
+
## Process
|
|
567
|
+
|
|
568
|
+
For each question:
|
|
569
|
+
1. **Search the codebase** for relevant context (files, patterns, existing implementations)
|
|
570
|
+
2. **Present your findings**: "Q1: Should this use REST or GraphQL? I found you're already using GraphQL in \`src/api/schema.ts\`..."
|
|
571
|
+
3. **Suggest an answer** based on the codebase context
|
|
572
|
+
4. **Ask the human** to confirm or provide their own answer
|
|
573
|
+
5. After collecting all answers, update the ticket:
|
|
574
|
+
\`\`\`bash
|
|
575
|
+
prlt ticket edit {{TICKET_ID}} --description "updated description with answers"
|
|
576
|
+
prlt ticket edit {{TICKET_ID}} --remove-label "needs-clarification" --add-label "ready"
|
|
577
|
+
\`\`\`
|
|
578
|
+
|
|
579
|
+
## Important
|
|
580
|
+
- This is an INTERACTIVE session - always ask the human before writing answers
|
|
581
|
+
- If the ticket has acceptance criteria or subtasks that need updating based on answers, update those too
|
|
582
|
+
- After resolving, move the ticket to the Ready column if all questions are answered`,
|
|
583
|
+
endPrompt: `After resolving all questions:
|
|
584
|
+
1. Update the ticket description with answers below each question
|
|
585
|
+
2. Remove the \`needs-clarification\` label and add \`ready\` label
|
|
586
|
+
3. Update acceptance criteria and subtasks if answers affect them
|
|
587
|
+
|
|
588
|
+
\`\`\`bash
|
|
589
|
+
prlt ticket edit {{TICKET_ID}} --description "..." --remove-label "needs-clarification" --add-label "ready"
|
|
590
|
+
\`\`\``,
|
|
591
|
+
suggestedForCategories: [],
|
|
592
|
+
modifiesCode: false,
|
|
593
|
+
position: 1,
|
|
594
|
+
},
|
|
531
595
|
{
|
|
532
596
|
id: 'implement',
|
|
533
597
|
name: 'Implement',
|
|
@@ -579,7 +643,7 @@ When complete, the ticket should be ready for code review.`,
|
|
|
579
643
|
suggestedForCategories: ['unstarted', 'started'],
|
|
580
644
|
defaultMoveToCategory: 'started',
|
|
581
645
|
modifiesCode: true,
|
|
582
|
-
position:
|
|
646
|
+
position: 2,
|
|
583
647
|
},
|
|
584
648
|
{
|
|
585
649
|
id: 'continue',
|
|
@@ -624,7 +688,7 @@ git add -A && prlt commit "your change" && git push
|
|
|
624
688
|
suggestedForCategories: ['started'],
|
|
625
689
|
defaultMoveToCategory: 'started',
|
|
626
690
|
modifiesCode: true,
|
|
627
|
-
position:
|
|
691
|
+
position: 3,
|
|
628
692
|
},
|
|
629
693
|
{
|
|
630
694
|
id: 'test',
|
|
@@ -666,7 +730,7 @@ git add -A && prlt commit "add tests for X" && git push
|
|
|
666
730
|
**IMPORTANT:** Use the global \`prlt\` command.`,
|
|
667
731
|
suggestedForCategories: ['started', 'completed'],
|
|
668
732
|
modifiesCode: true,
|
|
669
|
-
position:
|
|
733
|
+
position: 4,
|
|
670
734
|
},
|
|
671
735
|
{
|
|
672
736
|
id: 'review',
|
|
@@ -689,7 +753,7 @@ Output a review summary with your findings and any concerns.`,
|
|
|
689
753
|
No commits are needed for code review.`,
|
|
690
754
|
suggestedForCategories: ['started', 'completed'],
|
|
691
755
|
modifiesCode: false,
|
|
692
|
-
position:
|
|
756
|
+
position: 5,
|
|
693
757
|
},
|
|
694
758
|
{
|
|
695
759
|
id: 'revise',
|
|
@@ -715,7 +779,7 @@ The PR will be updated automatically.`,
|
|
|
715
779
|
suggestedForCategories: ['completed'],
|
|
716
780
|
defaultMoveToCategory: 'started',
|
|
717
781
|
modifiesCode: true,
|
|
718
|
-
position:
|
|
782
|
+
position: 6,
|
|
719
783
|
},
|
|
720
784
|
];
|
|
721
785
|
// Use INSERT OR REPLACE to always update builtin actions with latest prompts
|
|
@@ -198,14 +198,17 @@ export type JsonOutput = PromptJsonOutput | SuccessJsonOutput | ErrorJsonOutput
|
|
|
198
198
|
*/
|
|
199
199
|
export interface JsonFlags {
|
|
200
200
|
json?: boolean;
|
|
201
|
+
machine?: boolean;
|
|
201
202
|
}
|
|
202
203
|
/**
|
|
203
204
|
* Flags interface for machine-readable output mode detection
|
|
204
|
-
* --json
|
|
205
|
+
* --json and --machine/-m both trigger JSON output mode
|
|
205
206
|
*/
|
|
206
207
|
export interface MachineOutputFlags {
|
|
207
|
-
/**
|
|
208
|
+
/** JSON output flag */
|
|
208
209
|
json?: boolean;
|
|
210
|
+
/** Machine output flag (-m shorthand) */
|
|
211
|
+
machine?: boolean;
|
|
209
212
|
}
|
|
210
213
|
/**
|
|
211
214
|
* Check if the current environment is non-TTY (piped output)
|
package/dist/lib/prompt-json.js
CHANGED
|
@@ -48,8 +48,8 @@ export function isNonTTY() {
|
|
|
48
48
|
* @returns true if JSON mode should be used
|
|
49
49
|
*/
|
|
50
50
|
export function shouldOutputJson(flags) {
|
|
51
|
-
// --json flag
|
|
52
|
-
if (flags.json === true) {
|
|
51
|
+
// --json flag or --machine/-m flag
|
|
52
|
+
if (flags.json === true || flags.machine === true) {
|
|
53
53
|
return true;
|
|
54
54
|
}
|
|
55
55
|
// Automatic detection for non-TTY environments
|
|
@@ -70,8 +70,8 @@ export const isAgentMode = shouldOutputJson;
|
|
|
70
70
|
* @returns true if machine-readable output mode should be used
|
|
71
71
|
*/
|
|
72
72
|
export function isMachineOutput(flags) {
|
|
73
|
-
// --json flag
|
|
74
|
-
if (flags.json === true) {
|
|
73
|
+
// --json flag or --machine/-m flag
|
|
74
|
+
if (flags.json === true || flags.machine === true) {
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
77
77
|
// Automatic detection for non-TTY environments
|