@proletariat/cli 0.3.19 → 0.3.21
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/agent/login.js +2 -2
- package/dist/commands/agent/remove.d.ts +1 -0
- package/dist/commands/agent/remove.js +36 -28
- package/dist/commands/agent/shell.js +2 -2
- package/dist/commands/agent/staff/remove.d.ts +1 -0
- package/dist/commands/agent/staff/remove.js +36 -28
- package/dist/commands/agent/status.js +2 -2
- package/dist/commands/agent/temp/cleanup.js +10 -17
- package/dist/commands/agent/themes/add-names.d.ts +1 -0
- package/dist/commands/agent/themes/add-names.js +5 -1
- package/dist/commands/agent/visit.js +2 -2
- package/dist/commands/board/view.d.ts +15 -0
- package/dist/commands/board/view.js +136 -0
- package/dist/commands/config/index.js +6 -3
- package/dist/commands/epic/link/index.js +17 -0
- package/dist/commands/execution/config.d.ts +34 -0
- package/dist/commands/execution/config.js +433 -0
- package/dist/commands/execution/index.js +6 -1
- package/dist/commands/execution/kill.d.ts +12 -0
- package/dist/commands/execution/kill.js +17 -0
- package/dist/commands/execution/list.js +5 -4
- package/dist/commands/execution/logs.js +1 -0
- package/dist/commands/execution/view.d.ts +17 -0
- package/dist/commands/execution/view.js +288 -0
- package/dist/commands/phase/move.js +8 -0
- package/dist/commands/phase/template/apply.js +2 -2
- package/dist/commands/phase/template/create.js +67 -20
- package/dist/commands/phase/template/list.js +1 -1
- package/dist/commands/pr/index.js +6 -2
- package/dist/commands/pr/list.d.ts +17 -0
- package/dist/commands/pr/list.js +163 -0
- package/dist/commands/project/update.d.ts +19 -0
- package/dist/commands/project/update.js +163 -0
- package/dist/commands/roadmap/create.js +5 -0
- package/dist/commands/spec/delete.d.ts +18 -0
- package/dist/commands/spec/delete.js +111 -0
- package/dist/commands/spec/edit.d.ts +23 -0
- package/dist/commands/spec/edit.js +232 -0
- package/dist/commands/spec/index.js +5 -0
- package/dist/commands/status/create.js +38 -34
- package/dist/commands/status/list.js +5 -3
- package/dist/commands/template/phase/create.d.ts +1 -0
- package/dist/commands/template/phase/create.js +10 -1
- package/dist/commands/template/phase/index.js +4 -4
- package/dist/commands/template/ticket/create.d.ts +20 -0
- package/dist/commands/template/ticket/create.js +87 -0
- package/dist/commands/template/ticket/delete.d.ts +1 -1
- package/dist/commands/template/ticket/delete.js +4 -2
- package/dist/commands/template/ticket/save.d.ts +2 -0
- package/dist/commands/template/ticket/save.js +11 -0
- package/dist/commands/ticket/create.js +8 -1
- package/dist/commands/ticket/edit.js +1 -1
- package/dist/commands/ticket/list.d.ts +2 -0
- package/dist/commands/ticket/list.js +39 -2
- package/dist/commands/ticket/template/create.d.ts +9 -1
- package/dist/commands/ticket/template/create.js +224 -52
- package/dist/commands/ticket/template/save.d.ts +2 -1
- package/dist/commands/ticket/template/save.js +58 -7
- package/dist/commands/ticket/update.js +2 -2
- package/dist/commands/work/ready.js +8 -8
- package/dist/commands/work/spawn.js +32 -8
- package/dist/commands/work/watch.js +2 -0
- package/dist/lib/agents/commands.d.ts +7 -0
- package/dist/lib/agents/commands.js +11 -0
- package/dist/lib/agents/index.js +14 -4
- package/dist/lib/branch/index.js +24 -0
- package/dist/lib/execution/config.d.ts +2 -0
- package/dist/lib/execution/config.js +12 -0
- package/dist/lib/execution/runners.js +1 -2
- package/dist/lib/pmo/storage/epics.js +20 -10
- package/dist/lib/pmo/storage/helpers.d.ts +10 -0
- package/dist/lib/pmo/storage/helpers.js +59 -1
- package/dist/lib/pmo/storage/projects.js +20 -8
- package/dist/lib/pmo/storage/specs.js +23 -13
- package/dist/lib/pmo/storage/statuses.js +39 -18
- package/dist/lib/pmo/storage/subtasks.js +19 -8
- package/dist/lib/pmo/storage/tickets.js +27 -15
- package/dist/lib/pmo/utils.d.ts +4 -2
- package/dist/lib/pmo/utils.js +4 -2
- package/oclif.manifest.json +4037 -3234
- package/package.json +2 -4
|
@@ -3,7 +3,7 @@ import * as path from 'node:path';
|
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
4
|
import { execSync } from 'node:child_process';
|
|
5
5
|
import { colors } from '../../lib/colors.js';
|
|
6
|
-
import { getWorkspaceInfo } from '../../lib/agents/commands.js';
|
|
6
|
+
import { getWorkspaceInfo, formatAgentList } from '../../lib/agents/commands.js';
|
|
7
7
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
8
8
|
import { isDockerRunning, getAgentContainerName, isContainerRunning, getContainerId, } from '../../lib/execution/runners.js';
|
|
9
9
|
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
@@ -76,7 +76,7 @@ export default class Login extends PMOCommand {
|
|
|
76
76
|
// Validate agent exists
|
|
77
77
|
const agent = workspaceInfo.agents.find(a => a.name === agentName);
|
|
78
78
|
if (!agent) {
|
|
79
|
-
this.error(`Agent "${agentName}" not found. Available
|
|
79
|
+
this.error(`Agent "${agentName}" not found. Available: ${formatAgentList(workspaceInfo.agents)}`);
|
|
80
80
|
}
|
|
81
81
|
const agentDir = path.join(workspaceInfo.agentsPath, agentName);
|
|
82
82
|
// Check if Docker config exists
|
|
@@ -7,6 +7,7 @@ export default class Remove extends PMOCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
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
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { colors, format } from '../../lib/colors.js';
|
|
4
|
-
import { getWorkspaceInfo, removeAgentsFromWorkspace } from '../../lib/agents/commands.js';
|
|
4
|
+
import { getWorkspaceInfo, removeAgentsFromWorkspace, formatAgentList } from '../../lib/agents/commands.js';
|
|
5
5
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
6
6
|
import { shouldOutputJson, outputPromptAsJson, outputErrorAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
|
|
7
7
|
export default class Remove extends PMOCommand {
|
|
@@ -22,6 +22,11 @@ export default class Remove extends PMOCommand {
|
|
|
22
22
|
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
23
23
|
default: false,
|
|
24
24
|
}),
|
|
25
|
+
force: Flags.boolean({
|
|
26
|
+
char: 'f',
|
|
27
|
+
description: 'Skip confirmation prompt (for non-interactive use)',
|
|
28
|
+
default: false,
|
|
29
|
+
}),
|
|
25
30
|
};
|
|
26
31
|
getPMOOptions() {
|
|
27
32
|
return { promptIfMultiple: false };
|
|
@@ -90,36 +95,39 @@ export default class Remove extends PMOCommand {
|
|
|
90
95
|
// Validate agent exists
|
|
91
96
|
const agent = workspaceInfo.agents.find((a) => a.name === agentName);
|
|
92
97
|
if (!agent) {
|
|
93
|
-
return handleError('AGENT_NOT_FOUND', `Agent "${agentName}" not found. Available
|
|
98
|
+
return handleError('AGENT_NOT_FOUND', `Agent "${agentName}" not found. Available: ${formatAgentList(workspaceInfo.agents)}`);
|
|
94
99
|
}
|
|
95
100
|
const agentsToRemove = [agentName];
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
101
|
+
// Skip confirmation if --force flag is passed
|
|
102
|
+
if (!flags.force) {
|
|
103
|
+
// Build choices once, use for both JSON and interactive modes
|
|
104
|
+
const confirmChoices = [
|
|
105
|
+
{ name: 'No, cancel', value: 'false' },
|
|
106
|
+
{ name: 'Yes, remove agent', value: 'true' },
|
|
107
|
+
];
|
|
108
|
+
const confirmMessage = `Are you sure you want to remove agent "${agentName}"? This will delete its worktree.`;
|
|
109
|
+
// Confirm removal
|
|
110
|
+
// In JSON mode, output confirmation prompt
|
|
111
|
+
if (jsonMode) {
|
|
112
|
+
outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('agent remove', flags));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const { confirm } = await inquirer.prompt([
|
|
116
|
+
{
|
|
117
|
+
type: 'list',
|
|
118
|
+
name: 'confirm',
|
|
119
|
+
message: confirmMessage,
|
|
120
|
+
choices: [
|
|
121
|
+
{ name: '❌ ' + confirmChoices[0].name, value: false },
|
|
122
|
+
{ name: '⚠️ ' + confirmChoices[1].name, value: true }
|
|
123
|
+
],
|
|
124
|
+
default: 0 // Default to "No, cancel"
|
|
125
|
+
}
|
|
126
|
+
]);
|
|
127
|
+
if (!confirm) {
|
|
128
|
+
this.log(colors.textMuted('Removal cancelled.'));
|
|
129
|
+
return;
|
|
118
130
|
}
|
|
119
|
-
]);
|
|
120
|
-
if (!confirm) {
|
|
121
|
-
this.log(colors.textMuted('Removal cancelled.'));
|
|
122
|
-
return;
|
|
123
131
|
}
|
|
124
132
|
// Remove agents
|
|
125
133
|
this.log(colors.primary(`Removing agent "${agentName}"...`));
|
|
@@ -4,7 +4,7 @@ import * as fs from 'node:fs';
|
|
|
4
4
|
import { execSync, spawn } from 'node:child_process';
|
|
5
5
|
import Database from 'better-sqlite3';
|
|
6
6
|
import { colors } from '../../lib/colors.js';
|
|
7
|
-
import { getWorkspaceInfo, getAgentTmuxSessions } from '../../lib/agents/commands.js';
|
|
7
|
+
import { getWorkspaceInfo, getAgentTmuxSessions, formatAgentList } from '../../lib/agents/commands.js';
|
|
8
8
|
import { hasDevcontainerConfig } from '../../lib/execution/devcontainer.js';
|
|
9
9
|
import { getTerminalApp } from '../../lib/execution/config.js';
|
|
10
10
|
import { isDockerRunning, getAgentContainerName, isContainerRunning, getContainerId, } from '../../lib/execution/runners.js';
|
|
@@ -74,7 +74,7 @@ export default class Shell extends PMOCommand {
|
|
|
74
74
|
// Validate agent exists
|
|
75
75
|
const agent = workspaceInfo.agents.find(a => a.name === agentName);
|
|
76
76
|
if (!agent) {
|
|
77
|
-
this.handleError('AGENT_NOT_FOUND', `Agent "${agentName}" not found. Available
|
|
77
|
+
this.handleError('AGENT_NOT_FOUND', `Agent "${agentName}" not found. Available: ${formatAgentList(workspaceInfo.agents)}`, errorConfig);
|
|
78
78
|
}
|
|
79
79
|
// Check for existing tmux sessions (skip in JSON mode - can't handle interactive tmux)
|
|
80
80
|
const existingSessions = getAgentTmuxSessions(agentName);
|
|
@@ -7,6 +7,7 @@ export default class Remove extends PMOCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
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
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { colors, format } from '../../../lib/colors.js';
|
|
4
|
-
import { getWorkspaceInfo, removeAgentsFromWorkspace } from '../../../lib/agents/commands.js';
|
|
4
|
+
import { getWorkspaceInfo, removeAgentsFromWorkspace, formatAgentList } from '../../../lib/agents/commands.js';
|
|
5
5
|
import { PMOCommand, pmoBaseFlags } from '../../../lib/pmo/index.js';
|
|
6
6
|
import { shouldOutputJson, outputPromptAsJson, outputErrorAsJson, createMetadata, buildPromptConfig, } from '../../../lib/prompt-json.js';
|
|
7
7
|
export default class Remove extends PMOCommand {
|
|
@@ -22,6 +22,11 @@ export default class Remove extends PMOCommand {
|
|
|
22
22
|
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
23
23
|
default: false,
|
|
24
24
|
}),
|
|
25
|
+
force: Flags.boolean({
|
|
26
|
+
char: 'f',
|
|
27
|
+
description: 'Skip confirmation prompt (for non-interactive use)',
|
|
28
|
+
default: false,
|
|
29
|
+
}),
|
|
25
30
|
};
|
|
26
31
|
getPMOOptions() {
|
|
27
32
|
return { promptIfMultiple: false };
|
|
@@ -85,36 +90,39 @@ export default class Remove extends PMOCommand {
|
|
|
85
90
|
// Validate agent exists and is a staff agent
|
|
86
91
|
const agent = staffAgents.find((a) => a.name === agentName);
|
|
87
92
|
if (!agent) {
|
|
88
|
-
return handleError('AGENT_NOT_FOUND', `Staff agent "${agentName}" not found. Available
|
|
93
|
+
return handleError('AGENT_NOT_FOUND', `Staff agent "${agentName}" not found. Available: ${formatAgentList(staffAgents)}`);
|
|
89
94
|
}
|
|
90
95
|
const agentsToRemove = [agentName];
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
// Skip confirmation if --force flag is passed
|
|
97
|
+
if (!flags.force) {
|
|
98
|
+
// Build choices once, use for both JSON and interactive modes
|
|
99
|
+
const confirmChoices = [
|
|
100
|
+
{ name: 'No, cancel', value: 'false' },
|
|
101
|
+
{ name: 'Yes, remove agent', value: 'true' },
|
|
102
|
+
];
|
|
103
|
+
const confirmMessage = `Are you sure you want to remove agent "${agentName}"? This will delete its worktree.`;
|
|
104
|
+
// Confirm removal
|
|
105
|
+
// In JSON mode, output confirmation prompt
|
|
106
|
+
if (jsonMode) {
|
|
107
|
+
outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('agent remove', flags));
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const { confirm } = await inquirer.prompt([
|
|
111
|
+
{
|
|
112
|
+
type: 'list',
|
|
113
|
+
name: 'confirm',
|
|
114
|
+
message: confirmMessage,
|
|
115
|
+
choices: [
|
|
116
|
+
{ name: '❌ ' + confirmChoices[0].name, value: false },
|
|
117
|
+
{ name: '⚠️ ' + confirmChoices[1].name, value: true }
|
|
118
|
+
],
|
|
119
|
+
default: 0 // Default to "No, cancel"
|
|
120
|
+
}
|
|
121
|
+
]);
|
|
122
|
+
if (!confirm) {
|
|
123
|
+
this.log(colors.textMuted('Removal cancelled.'));
|
|
124
|
+
return;
|
|
113
125
|
}
|
|
114
|
-
]);
|
|
115
|
-
if (!confirm) {
|
|
116
|
-
this.log(colors.textMuted('Removal cancelled.'));
|
|
117
|
-
return;
|
|
118
126
|
}
|
|
119
127
|
// Remove agents
|
|
120
128
|
this.log(colors.primary(`Removing agent "${agentName}"...`));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import { colors, format } from '../../lib/colors.js';
|
|
3
|
-
import { getWorkspaceInfo, getAgentStatus } from '../../lib/agents/commands.js';
|
|
3
|
+
import { getWorkspaceInfo, getAgentStatus, formatAgentList } from '../../lib/agents/commands.js';
|
|
4
4
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
5
5
|
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
6
6
|
export default class Status extends PMOCommand {
|
|
@@ -69,7 +69,7 @@ export default class Status extends PMOCommand {
|
|
|
69
69
|
// Validate agent exists
|
|
70
70
|
const agent = workspaceInfo.agents.find((a) => a.name === agentName);
|
|
71
71
|
if (!agent) {
|
|
72
|
-
this.error(`Agent "${agentName}" not found. Available
|
|
72
|
+
this.error(`Agent "${agentName}" not found. Available: ${formatAgentList(workspaceInfo.agents)}`);
|
|
73
73
|
}
|
|
74
74
|
const agentStatus = getAgentStatus(workspaceInfo, agentName);
|
|
75
75
|
this.log(format.title(`🤖 Agent: ${agentName}`));
|
|
@@ -132,9 +132,16 @@ export default class Cleanup extends PMOCommand {
|
|
|
132
132
|
this.log(colors.textMuted('No agents to clean up.'));
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
//
|
|
135
|
+
// Get temp (ephemeral) agents only - this is temp cleanup, not staff cleanup
|
|
136
136
|
const tempAgents = allAgents.filter(a => a.type === 'ephemeral');
|
|
137
|
-
|
|
137
|
+
if (tempAgents.length === 0) {
|
|
138
|
+
if (jsonMode) {
|
|
139
|
+
outputErrorAsJson('NO_TEMP_AGENTS', 'No temp agents to clean up.', createMetadata('agent cleanup', flags));
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
this.log(colors.textMuted('No temp agents to clean up.'));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
138
145
|
// Build choices with separators
|
|
139
146
|
const choices = [];
|
|
140
147
|
// Add "All temp agents" option if there are temp agents
|
|
@@ -163,21 +170,7 @@ export default class Cleanup extends PMOCommand {
|
|
|
163
170
|
});
|
|
164
171
|
}
|
|
165
172
|
}
|
|
166
|
-
|
|
167
|
-
if (staffAgents.length > 0) {
|
|
168
|
-
choices.push(new inquirer.Separator(`── Staff Agents (${staffAgents.length}) ──`));
|
|
169
|
-
for (const agent of staffAgents) {
|
|
170
|
-
const sessions = getAgentTmuxSessions(agent.name);
|
|
171
|
-
const hasRunningWork = sessions.length > 0;
|
|
172
|
-
const statusLabel = hasRunningWork ? ' (running)' : '';
|
|
173
|
-
choices.push({
|
|
174
|
-
name: `${agent.name}${statusLabel}`,
|
|
175
|
-
value: agent.name,
|
|
176
|
-
disabled: hasRunningWork ? 'has running work' : false,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
const selectMessage = 'Select agents to clean up:';
|
|
173
|
+
const selectMessage = 'Select temp agents to clean up:';
|
|
181
174
|
// In JSON mode, output agent selection prompt
|
|
182
175
|
if (jsonMode) {
|
|
183
176
|
outputPromptAsJson(buildPromptConfig('checkbox', 'agents', selectMessage, choices), createMetadata('agent cleanup', flags));
|
|
@@ -4,6 +4,7 @@ export default class ThemesAddNames extends Command {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
6
|
theme: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
names: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
8
|
};
|
|
8
9
|
static strict: boolean;
|
|
9
10
|
run(): Promise<void>;
|
|
@@ -11,9 +11,13 @@ export default class ThemesAddNames extends Command {
|
|
|
11
11
|
];
|
|
12
12
|
static args = {
|
|
13
13
|
theme: Args.string({
|
|
14
|
-
description: 'Theme ID
|
|
14
|
+
description: 'Theme ID',
|
|
15
15
|
required: true,
|
|
16
16
|
}),
|
|
17
|
+
names: Args.string({
|
|
18
|
+
description: 'Names to add to the theme (space-separated)',
|
|
19
|
+
required: false,
|
|
20
|
+
}),
|
|
17
21
|
};
|
|
18
22
|
static strict = false; // Allow multiple name arguments
|
|
19
23
|
async run() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { colors } from '../../lib/colors.js';
|
|
4
|
-
import { getWorkspaceInfo } from '../../lib/agents/commands.js';
|
|
4
|
+
import { getWorkspaceInfo, formatAgentList } from '../../lib/agents/commands.js';
|
|
5
5
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
6
6
|
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
7
7
|
export default class Visit extends PMOCommand {
|
|
@@ -75,7 +75,7 @@ export default class Visit extends PMOCommand {
|
|
|
75
75
|
// Validate agent exists
|
|
76
76
|
const agent = workspaceInfo.agents.find(a => a.name === agentName);
|
|
77
77
|
if (!agent) {
|
|
78
|
-
return handleError('AGENT_NOT_FOUND', `Agent "${agentName}" not found. Available
|
|
78
|
+
return handleError('AGENT_NOT_FOUND', `Agent "${agentName}" not found. Available: ${formatAgentList(workspaceInfo.agents)}`);
|
|
79
79
|
}
|
|
80
80
|
// Calculate path to agent directory
|
|
81
81
|
const agentDir = path.join(workspaceInfo.agentsPath, agentName);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
export default class BoardView extends PMOCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
compact: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
execute(): Promise<void>;
|
|
12
|
+
private renderBoard;
|
|
13
|
+
private outputTicketCompact;
|
|
14
|
+
private outputTicketFull;
|
|
15
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { PMOCommand, pmoBaseFlags, } from '../../lib/pmo/index.js';
|
|
3
|
+
import { styles, formatPriority, formatCategory, getColumnStyle, getColumnEmoji, divider, } from '../../lib/styles.js';
|
|
4
|
+
import { shouldOutputJson, outputErrorAsJson, outputSuccessAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
|
+
export default class BoardView extends PMOCommand {
|
|
6
|
+
static description = 'View the kanban board';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --compact',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
...pmoBaseFlags,
|
|
14
|
+
compact: Flags.boolean({
|
|
15
|
+
char: 'c',
|
|
16
|
+
description: 'Show compact ticket view (ID and title only)',
|
|
17
|
+
default: false,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
async execute() {
|
|
21
|
+
const { flags } = await this.parse(BoardView);
|
|
22
|
+
// Board operations require project context
|
|
23
|
+
const projectId = await this.requireProject();
|
|
24
|
+
// Check if JSON output mode is active
|
|
25
|
+
const jsonMode = shouldOutputJson(flags);
|
|
26
|
+
// Helper to handle errors in JSON mode
|
|
27
|
+
const handleError = (code, message) => {
|
|
28
|
+
if (jsonMode) {
|
|
29
|
+
outputErrorAsJson(code, message, createMetadata('board view', flags));
|
|
30
|
+
this.exit(1);
|
|
31
|
+
}
|
|
32
|
+
this.error(message);
|
|
33
|
+
};
|
|
34
|
+
const board = await this.storage.getBoard(projectId);
|
|
35
|
+
if (!board) {
|
|
36
|
+
return handleError('BOARD_NOT_FOUND', `Board not found for project "${projectId}".`);
|
|
37
|
+
}
|
|
38
|
+
// In JSON mode, output board as structured data
|
|
39
|
+
if (jsonMode) {
|
|
40
|
+
outputSuccessAsJson({
|
|
41
|
+
id: board.id,
|
|
42
|
+
name: board.name,
|
|
43
|
+
columns: board.columns.map(col => ({
|
|
44
|
+
id: col.id,
|
|
45
|
+
name: col.name,
|
|
46
|
+
position: col.position,
|
|
47
|
+
ticketCount: col.tickets.length,
|
|
48
|
+
tickets: col.tickets.map(t => ({
|
|
49
|
+
id: t.id,
|
|
50
|
+
title: t.title,
|
|
51
|
+
description: t.description,
|
|
52
|
+
priority: t.priority,
|
|
53
|
+
category: t.category,
|
|
54
|
+
owner: t.owner,
|
|
55
|
+
assignee: t.assignee,
|
|
56
|
+
specId: t.specId,
|
|
57
|
+
epicId: t.epicId,
|
|
58
|
+
labels: t.labels,
|
|
59
|
+
subtasksDone: t.subtasks.filter((s) => s.done).length,
|
|
60
|
+
subtasksTotal: t.subtasks.length,
|
|
61
|
+
position: t.position,
|
|
62
|
+
})),
|
|
63
|
+
})),
|
|
64
|
+
totalTickets: board.columns.reduce((sum, col) => sum + col.tickets.length, 0),
|
|
65
|
+
}, createMetadata('board view', flags));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
// Interactive mode - render board to terminal
|
|
69
|
+
this.renderBoard(board, flags.compact);
|
|
70
|
+
}
|
|
71
|
+
renderBoard(board, compact) {
|
|
72
|
+
// Header
|
|
73
|
+
this.log(styles.title(`\n${board.name}`));
|
|
74
|
+
this.log(styles.muted(`Storage: SQLite`));
|
|
75
|
+
this.log(styles.muted('═'.repeat(60)));
|
|
76
|
+
// Display ALL columns (always show empty ones too)
|
|
77
|
+
for (const column of board.columns) {
|
|
78
|
+
const headerColor = getColumnStyle(column.name);
|
|
79
|
+
const emoji = getColumnEmoji(column.name);
|
|
80
|
+
this.log(headerColor(`\n${emoji} ${column.name} (${column.tickets.length})`));
|
|
81
|
+
this.log(divider(50));
|
|
82
|
+
if (column.tickets.length === 0) {
|
|
83
|
+
this.log(styles.muted(' (empty)'));
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
// Sort tickets by position
|
|
87
|
+
const sortedTickets = [...column.tickets].sort((a, b) => (a.position || 0) - (b.position || 0));
|
|
88
|
+
for (const ticket of sortedTickets) {
|
|
89
|
+
if (compact) {
|
|
90
|
+
this.outputTicketCompact(ticket);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.outputTicketFull(ticket);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Summary
|
|
98
|
+
const totalTickets = board.columns.reduce((sum, col) => sum + col.tickets.length, 0);
|
|
99
|
+
this.log(styles.muted('\n' + '═'.repeat(60)));
|
|
100
|
+
this.log(styles.emphasis(`Total: ${totalTickets} ticket${totalTickets === 1 ? '' : 's'}`));
|
|
101
|
+
// Per-column summary (only non-empty)
|
|
102
|
+
const summary = board.columns
|
|
103
|
+
.filter(col => col.tickets.length > 0)
|
|
104
|
+
.map(col => `${col.name}: ${col.tickets.length}`)
|
|
105
|
+
.join(' | ');
|
|
106
|
+
if (summary) {
|
|
107
|
+
this.log(styles.primary(summary));
|
|
108
|
+
}
|
|
109
|
+
this.log(styles.muted('\nCommands:'));
|
|
110
|
+
this.log(styles.primary(' prlt ticket create ') + styles.muted('Create a new ticket'));
|
|
111
|
+
this.log(styles.primary(' prlt ticket list ') + styles.muted('List all tickets'));
|
|
112
|
+
this.log(styles.primary(' prlt ticket move <id> ') + styles.muted('Move a ticket'));
|
|
113
|
+
}
|
|
114
|
+
outputTicketCompact(ticket) {
|
|
115
|
+
const priority = formatPriority(ticket.priority);
|
|
116
|
+
this.log(` ${styles.code(ticket.id)}: ${ticket.title} ${priority}`);
|
|
117
|
+
}
|
|
118
|
+
outputTicketFull(ticket) {
|
|
119
|
+
const priority = formatPriority(ticket.priority);
|
|
120
|
+
const category = formatCategory(ticket.category);
|
|
121
|
+
this.log(` ${styles.code(ticket.id)} ${ticket.title} ${priority} ${category}`);
|
|
122
|
+
if (ticket.description) {
|
|
123
|
+
const shortDesc = ticket.description.split('\n')[0].substring(0, 55);
|
|
124
|
+
this.log(styles.muted(` ${shortDesc}${ticket.description.length > 55 ? '...' : ''}`));
|
|
125
|
+
}
|
|
126
|
+
if (ticket.subtasks.length > 0) {
|
|
127
|
+
const done = ticket.subtasks.filter(s => s.done).length;
|
|
128
|
+
const total = ticket.subtasks.length;
|
|
129
|
+
const progress = Math.round((done / total) * 100);
|
|
130
|
+
this.log(styles.muted(` Subtasks: ${done}/${total} (${progress}%)`));
|
|
131
|
+
}
|
|
132
|
+
if (ticket.specId) {
|
|
133
|
+
this.log(styles.muted(` Spec: ${ticket.specId}`));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -6,7 +6,7 @@ import { Command } from '@oclif/core';
|
|
|
6
6
|
import { styles } from '../../lib/styles.js';
|
|
7
7
|
import { getWorkspaceInfo } from '../../lib/agents/commands.js';
|
|
8
8
|
import { loadExecutionConfig, saveTerminalApp, saveTerminalOpenInBackground, saveTmuxControlMode, saveShell, } from '../../lib/execution/config.js';
|
|
9
|
-
import { shouldOutputJson, isAgentMode, outputPromptAsJson, outputSuccessAsJson, outputErrorAsJson, createMetadata, normalizeChoices, } from '../../lib/prompt-json.js';
|
|
9
|
+
import { shouldOutputJson, isAgentMode, isNonTTY, outputPromptAsJson, outputSuccessAsJson, outputErrorAsJson, createMetadata, normalizeChoices, } from '../../lib/prompt-json.js';
|
|
10
10
|
export default class Config extends Command {
|
|
11
11
|
static description = 'View and update workspace configuration';
|
|
12
12
|
static examples = [
|
|
@@ -103,8 +103,11 @@ export default class Config extends Command {
|
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
// Handle --list or --json flag without --setting (just show config)
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
// Also handle non-TTY mode without explicit flags - output config as readable list
|
|
107
|
+
const isExplicitJsonMode = flags.json === true;
|
|
108
|
+
const shouldShowConfigList = flags.list || (isExplicitJsonMode && !flags.setting) || (isNonTTY() && !flags.setting && !flags.set?.length);
|
|
109
|
+
if (shouldShowConfigList) {
|
|
110
|
+
if (isExplicitJsonMode) {
|
|
108
111
|
outputSuccessAsJson({
|
|
109
112
|
terminal: {
|
|
110
113
|
app: config.terminal.app,
|
|
@@ -97,6 +97,23 @@ export default class EpicLink extends PMOCommand {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
// Interactive mode: show menu in a loop
|
|
100
|
+
// In JSON mode, output the interactive menu config instead of prompting
|
|
101
|
+
if (jsonMode) {
|
|
102
|
+
const menuChoices = [
|
|
103
|
+
{ name: 'View dependencies', value: 'view' },
|
|
104
|
+
{ name: 'Add blocking dependency (blocked by...)', value: 'blocks' },
|
|
105
|
+
{ name: 'Add relates_to dependency', value: 'relates_to' },
|
|
106
|
+
{ name: 'Add duplicates dependency', value: 'duplicates' },
|
|
107
|
+
{ name: 'Remove dependency', value: 'remove' },
|
|
108
|
+
{ name: 'Done', value: 'done' },
|
|
109
|
+
];
|
|
110
|
+
outputPromptAsJson(buildPromptConfig('list', 'action', `Dependencies for ${epicId}:`, menuChoices), createMetadata('epic link', flags));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
// Check for TTY before showing interactive menu
|
|
114
|
+
if (!process.stdin.isTTY) {
|
|
115
|
+
this.error('Interactive mode requires a TTY. Use --json for scripted usage or provide flags like --blocks, --relates, or --duplicates.');
|
|
116
|
+
}
|
|
100
117
|
let continueLoop = true;
|
|
101
118
|
while (continueLoop) {
|
|
102
119
|
// eslint-disable-next-line no-await-in-loop -- Interactive user loop
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
export default class ExecutionConfig extends PMOCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
set: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
list: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
setting: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
protected getPMOOptions(): {
|
|
14
|
+
promptIfMultiple: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Prompt wrapper - drop-in replacement for inquirer.prompt
|
|
18
|
+
*/
|
|
19
|
+
private promptUser;
|
|
20
|
+
execute(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Handle a specific setting's sub-prompt
|
|
23
|
+
*/
|
|
24
|
+
private handleSettingPrompt;
|
|
25
|
+
private setConfigValue;
|
|
26
|
+
/**
|
|
27
|
+
* Save output mode to workspace settings
|
|
28
|
+
*/
|
|
29
|
+
private setOutputMode;
|
|
30
|
+
/**
|
|
31
|
+
* Save sandboxed preference to workspace settings
|
|
32
|
+
*/
|
|
33
|
+
private setSandboxed;
|
|
34
|
+
}
|