@proletariat/cli 0.3.22 → 0.3.24
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/LICENSE +190 -21
- package/README.md +7 -7
- package/dist/commands/action/create.js +1 -1
- package/dist/commands/agent/{temp/cleanup.d.ts → cleanup.d.ts} +1 -1
- package/dist/commands/agent/{temp/cleanup.js → cleanup.js} +4 -4
- package/dist/commands/agent/index.js +8 -8
- package/dist/commands/branch/create.js +2 -2
- package/dist/commands/epic/create.d.ts +1 -0
- package/dist/commands/epic/create.js +39 -2
- package/dist/commands/epic/index.js +2 -2
- package/dist/commands/{epic/link/remove.d.ts → link/create.d.ts} +6 -7
- package/dist/commands/link/create.js +141 -0
- package/dist/commands/{epic/link/relates.d.ts → link/index.d.ts} +4 -5
- package/dist/commands/link/index.js +87 -0
- package/dist/commands/{epic/link/duplicates.d.ts → link/list.d.ts} +7 -4
- package/dist/commands/link/list.js +182 -0
- package/dist/commands/{spec/link → link}/remove.d.ts +4 -5
- package/dist/commands/link/remove.js +120 -0
- package/dist/commands/mcp-server.d.ts +22 -0
- package/dist/commands/mcp-server.js +98 -0
- package/dist/commands/phase/create.js +1 -1
- package/dist/commands/project/create.d.ts +1 -0
- package/dist/commands/project/create.js +38 -4
- package/dist/commands/spec/create.d.ts +1 -0
- package/dist/commands/spec/create.js +43 -2
- package/dist/commands/spec/index.js +2 -2
- package/dist/commands/{agent/staff → staff}/add.js +10 -10
- package/dist/commands/{agent/staff → staff}/index.d.ts +1 -1
- package/dist/commands/{agent/staff → staff}/index.js +7 -7
- package/dist/commands/{agent/staff → staff}/list.js +3 -3
- package/dist/commands/{agent/staff → staff}/remove.d.ts +1 -1
- package/dist/commands/{agent/staff → staff}/remove.js +8 -8
- package/dist/commands/{ticket/template → template}/apply.d.ts +8 -6
- package/dist/commands/template/apply.js +262 -0
- package/dist/commands/{ticket/template → template}/create.d.ts +5 -6
- package/dist/commands/template/create.js +238 -0
- package/dist/commands/template/index.js +48 -36
- package/dist/commands/{ticket/template → template}/save.d.ts +2 -2
- package/dist/commands/template/save.js +104 -0
- package/dist/commands/{phase/template → template}/update.d.ts +2 -2
- package/dist/commands/template/update.js +99 -0
- package/dist/commands/{agent/themes → theme}/add-names.d.ts +1 -1
- package/dist/commands/{agent/themes → theme}/add-names.js +6 -6
- package/dist/commands/{agent/themes → theme}/create.d.ts +1 -1
- package/dist/commands/{agent/themes → theme}/create.js +5 -5
- package/dist/commands/{agent/themes → theme}/index.d.ts +1 -1
- package/dist/commands/{agent/themes → theme}/index.js +10 -10
- package/dist/commands/{agent/themes → theme}/list.d.ts +1 -1
- package/dist/commands/{agent/themes → theme}/list.js +5 -5
- package/dist/commands/{agent/themes → theme}/set.d.ts +1 -1
- package/dist/commands/{agent/themes → theme}/set.js +7 -7
- package/dist/commands/ticket/create.d.ts +1 -0
- package/dist/commands/ticket/create.js +54 -2
- package/dist/commands/ticket/index.js +6 -6
- package/dist/commands/work/spawn.js +1 -1
- package/dist/lib/mcp/helpers.d.ts +43 -0
- package/dist/lib/mcp/helpers.js +57 -0
- package/dist/lib/mcp/index.d.ts +6 -0
- package/dist/lib/mcp/index.js +6 -0
- package/dist/lib/mcp/tools/action.d.ts +6 -0
- package/dist/lib/mcp/tools/action.js +88 -0
- package/dist/lib/mcp/tools/board.d.ts +6 -0
- package/dist/lib/mcp/tools/board.js +139 -0
- package/dist/lib/mcp/tools/category.d.ts +6 -0
- package/dist/lib/mcp/tools/category.js +84 -0
- package/dist/lib/mcp/tools/cli-passthrough.d.ts +15 -0
- package/dist/lib/mcp/tools/cli-passthrough.js +333 -0
- package/dist/lib/mcp/tools/epic.d.ts +6 -0
- package/dist/lib/mcp/tools/epic.js +178 -0
- package/dist/lib/mcp/tools/index.d.ts +18 -0
- package/dist/lib/mcp/tools/index.js +19 -0
- package/dist/lib/mcp/tools/phase.d.ts +6 -0
- package/dist/lib/mcp/tools/phase.js +131 -0
- package/dist/lib/mcp/tools/project.d.ts +6 -0
- package/dist/lib/mcp/tools/project.js +196 -0
- package/dist/lib/mcp/tools/roadmap.d.ts +6 -0
- package/dist/lib/mcp/tools/roadmap.js +123 -0
- package/dist/lib/mcp/tools/spec.d.ts +6 -0
- package/dist/lib/mcp/tools/spec.js +196 -0
- package/dist/lib/mcp/tools/status.d.ts +6 -0
- package/dist/lib/mcp/tools/status.js +109 -0
- package/dist/lib/mcp/tools/template.d.ts +6 -0
- package/dist/lib/mcp/tools/template.js +107 -0
- package/dist/lib/mcp/tools/ticket.d.ts +6 -0
- package/dist/lib/mcp/tools/ticket.js +393 -0
- package/dist/lib/mcp/tools/view.d.ts +6 -0
- package/dist/lib/mcp/tools/view.js +76 -0
- package/dist/lib/mcp/tools/work.d.ts +6 -0
- package/dist/lib/mcp/tools/work.js +132 -0
- package/dist/lib/mcp/tools/workflow.d.ts +6 -0
- package/dist/lib/mcp/tools/workflow.js +95 -0
- package/dist/lib/mcp/types.d.ts +17 -0
- package/dist/lib/mcp/types.js +4 -0
- package/dist/lib/prompt-json.d.ts +52 -1
- package/dist/lib/prompt-json.js +45 -0
- package/oclif.manifest.json +3553 -5457
- package/package.json +10 -7
- package/dist/commands/agent/temp/index.d.ts +0 -14
- package/dist/commands/agent/temp/index.js +0 -85
- package/dist/commands/agent/temp/list.d.ts +0 -7
- package/dist/commands/agent/temp/list.js +0 -108
- package/dist/commands/epic/link/block.d.ts +0 -14
- package/dist/commands/epic/link/block.js +0 -81
- package/dist/commands/epic/link/duplicates.js +0 -68
- package/dist/commands/epic/link/index.d.ts +0 -19
- package/dist/commands/epic/link/index.js +0 -272
- package/dist/commands/epic/link/relates.js +0 -68
- package/dist/commands/epic/link/remove.js +0 -93
- package/dist/commands/phase/template/apply.d.ts +0 -17
- package/dist/commands/phase/template/apply.js +0 -108
- package/dist/commands/phase/template/create.d.ts +0 -17
- package/dist/commands/phase/template/create.js +0 -104
- package/dist/commands/phase/template/delete.d.ts +0 -17
- package/dist/commands/phase/template/delete.js +0 -100
- package/dist/commands/phase/template/index.d.ts +0 -15
- package/dist/commands/phase/template/index.js +0 -130
- package/dist/commands/phase/template/list.d.ts +0 -16
- package/dist/commands/phase/template/list.js +0 -97
- package/dist/commands/phase/template/update.js +0 -89
- package/dist/commands/spec/link/depends.d.ts +0 -14
- package/dist/commands/spec/link/depends.js +0 -64
- package/dist/commands/spec/link/duplicates.d.ts +0 -14
- package/dist/commands/spec/link/duplicates.js +0 -63
- package/dist/commands/spec/link/index.d.ts +0 -19
- package/dist/commands/spec/link/index.js +0 -207
- package/dist/commands/spec/link/relates.d.ts +0 -14
- package/dist/commands/spec/link/relates.js +0 -63
- package/dist/commands/spec/link/remove.js +0 -96
- package/dist/commands/template/phase/apply.d.ts +0 -14
- package/dist/commands/template/phase/apply.js +0 -43
- package/dist/commands/template/phase/create.d.ts +0 -13
- package/dist/commands/template/phase/create.js +0 -38
- package/dist/commands/template/phase/delete.d.ts +0 -13
- package/dist/commands/template/phase/delete.js +0 -36
- package/dist/commands/template/phase/index.d.ts +0 -10
- package/dist/commands/template/phase/index.js +0 -63
- package/dist/commands/template/phase/list.d.ts +0 -11
- package/dist/commands/template/phase/list.js +0 -36
- package/dist/commands/template/phase/update.d.ts +0 -14
- package/dist/commands/template/phase/update.js +0 -43
- package/dist/commands/template/ticket/apply.d.ts +0 -17
- package/dist/commands/template/ticket/apply.js +0 -60
- package/dist/commands/template/ticket/create.d.ts +0 -20
- package/dist/commands/template/ticket/create.js +0 -89
- package/dist/commands/template/ticket/delete.d.ts +0 -13
- package/dist/commands/template/ticket/delete.js +0 -38
- package/dist/commands/template/ticket/index.d.ts +0 -10
- package/dist/commands/template/ticket/index.js +0 -63
- package/dist/commands/template/ticket/list.d.ts +0 -11
- package/dist/commands/template/ticket/list.js +0 -36
- package/dist/commands/template/ticket/save.d.ts +0 -15
- package/dist/commands/template/ticket/save.js +0 -46
- package/dist/commands/ticket/link/block.d.ts +0 -14
- package/dist/commands/ticket/link/block.js +0 -96
- package/dist/commands/ticket/link/duplicates.d.ts +0 -14
- package/dist/commands/ticket/link/duplicates.js +0 -95
- package/dist/commands/ticket/link/index.d.ts +0 -19
- package/dist/commands/ticket/link/index.js +0 -256
- package/dist/commands/ticket/link/relates.d.ts +0 -14
- package/dist/commands/ticket/link/relates.js +0 -95
- package/dist/commands/ticket/link/remove.d.ts +0 -16
- package/dist/commands/ticket/link/remove.js +0 -132
- package/dist/commands/ticket/template/apply.js +0 -252
- package/dist/commands/ticket/template/create.js +0 -386
- package/dist/commands/ticket/template/delete.d.ts +0 -17
- package/dist/commands/ticket/template/delete.js +0 -94
- package/dist/commands/ticket/template/index.d.ts +0 -15
- package/dist/commands/ticket/template/index.js +0 -120
- package/dist/commands/ticket/template/list.d.ts +0 -16
- package/dist/commands/ticket/template/list.js +0 -112
- package/dist/commands/ticket/template/save.js +0 -163
- /package/dist/commands/{agent/staff → staff}/add.d.ts +0 -0
- /package/dist/commands/{agent/staff → staff}/list.d.ts +0 -0
|
@@ -5,7 +5,7 @@ import inquirer from 'inquirer';
|
|
|
5
5
|
import { createBoardContent, createSpecFolders, PMOCommand, pmoBaseFlags, BUILTIN_TEMPLATES } from '../../lib/pmo/index.js';
|
|
6
6
|
import { styles } from '../../lib/styles.js';
|
|
7
7
|
import { slugify } from '../../lib/pmo/utils.js';
|
|
8
|
-
import { shouldOutputJson, outputPromptAsJson, outputSuccessAsJson, createMetadata, buildFormPromptConfig, } from '../../lib/prompt-json.js';
|
|
8
|
+
import { shouldOutputJson, outputPromptAsJson, outputSuccessAsJson, outputDryRunSuccessAsJson, outputDryRunErrorsAsJson, createMetadata, buildFormPromptConfig, } from '../../lib/prompt-json.js';
|
|
9
9
|
// Build template options dynamically from shared definitions
|
|
10
10
|
const TEMPLATE_IDS = BUILTIN_TEMPLATES.map(t => t.id);
|
|
11
11
|
export default class ProjectCreate extends PMOCommand {
|
|
@@ -14,6 +14,7 @@ export default class ProjectCreate extends PMOCommand {
|
|
|
14
14
|
'<%= config.bin %> <%= command.id %> "My New Project"',
|
|
15
15
|
'<%= config.bin %> <%= command.id %> --name "Mobile App" --description "iOS and Android app"',
|
|
16
16
|
'<%= config.bin %> <%= command.id %> -i # Interactive mode',
|
|
17
|
+
'<%= config.bin %> <%= command.id %> --name "Test" --dry-run --json # Validate without creating',
|
|
17
18
|
];
|
|
18
19
|
static args = {
|
|
19
20
|
name: Args.string({
|
|
@@ -25,7 +26,7 @@ export default class ProjectCreate extends PMOCommand {
|
|
|
25
26
|
...pmoBaseFlags,
|
|
26
27
|
name: Flags.string({
|
|
27
28
|
char: 'n',
|
|
28
|
-
description: 'Project name',
|
|
29
|
+
description: 'Project name [required for non-interactive]',
|
|
29
30
|
}),
|
|
30
31
|
id: Flags.string({
|
|
31
32
|
description: 'Custom project ID (auto-generated from name if not provided)',
|
|
@@ -45,6 +46,10 @@ export default class ProjectCreate extends PMOCommand {
|
|
|
45
46
|
description: 'Interactive mode',
|
|
46
47
|
default: false,
|
|
47
48
|
}),
|
|
49
|
+
'dry-run': Flags.boolean({
|
|
50
|
+
description: 'Validate inputs without creating project (use with --json for structured output)',
|
|
51
|
+
default: false,
|
|
52
|
+
}),
|
|
48
53
|
};
|
|
49
54
|
getPMOOptions() {
|
|
50
55
|
return { promptIfMultiple: false };
|
|
@@ -86,8 +91,39 @@ export default class ProjectCreate extends PMOCommand {
|
|
|
86
91
|
// Check if project already exists
|
|
87
92
|
const existing = await this.storage.getProject(projectId);
|
|
88
93
|
if (existing) {
|
|
94
|
+
if (flags['dry-run']) {
|
|
95
|
+
if (jsonMode) {
|
|
96
|
+
outputDryRunErrorsAsJson([{ field: 'id', error: `Project "${projectId}" already exists` }], createMetadata('project create', flags));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
89
99
|
this.error(`Project "${projectId}" already exists.`);
|
|
90
100
|
}
|
|
101
|
+
// Get the statuses from the workflow (for dry-run preview)
|
|
102
|
+
const statuses = await this.storage.listStatuses(projectData.template);
|
|
103
|
+
// Handle dry-run: show what would be created without actually creating
|
|
104
|
+
if (flags['dry-run']) {
|
|
105
|
+
const wouldCreate = {
|
|
106
|
+
id: projectId,
|
|
107
|
+
name: projectData.name,
|
|
108
|
+
template: projectData.template,
|
|
109
|
+
statuses: statuses.map(s => s.name),
|
|
110
|
+
...(projectData.description && { description: projectData.description }),
|
|
111
|
+
};
|
|
112
|
+
if (jsonMode) {
|
|
113
|
+
outputDryRunSuccessAsJson('project', wouldCreate, createMetadata('project create', flags));
|
|
114
|
+
}
|
|
115
|
+
// Human-readable dry-run output
|
|
116
|
+
this.log(styles.warning('\n[DRY RUN] Would create project:'));
|
|
117
|
+
this.log(styles.muted(` ID: ${projectId}`));
|
|
118
|
+
this.log(styles.muted(` Name: ${projectData.name}`));
|
|
119
|
+
this.log(styles.muted(` Template: ${projectData.template}`));
|
|
120
|
+
this.log(styles.muted(` Statuses: ${statuses.map(s => s.name).join(' → ')}`));
|
|
121
|
+
if (projectData.description) {
|
|
122
|
+
this.log(styles.muted(` Description: ${projectData.description}`));
|
|
123
|
+
}
|
|
124
|
+
this.log(styles.muted('\n(No project was created)'));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
91
127
|
// Create project in database
|
|
92
128
|
const project = await this.storage.createProject({
|
|
93
129
|
id: projectId,
|
|
@@ -104,8 +140,6 @@ export default class ProjectCreate extends PMOCommand {
|
|
|
104
140
|
fs.writeFileSync(boardPath, boardContent);
|
|
105
141
|
// Create spec folders in project directory
|
|
106
142
|
const specsPath = createSpecFolders(this.pmoPath, projectId);
|
|
107
|
-
// Get the statuses from the workflow (template name = workflow ID for built-in templates)
|
|
108
|
-
const statuses = await this.storage.listStatuses(projectData.template);
|
|
109
143
|
// In JSON mode, output success with project details
|
|
110
144
|
if (jsonMode) {
|
|
111
145
|
outputSuccessAsJson({
|
|
@@ -11,6 +11,7 @@ export default class SpecCreate extends PMOCommand {
|
|
|
11
11
|
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
problem: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
};
|
|
@@ -2,7 +2,7 @@ import { Flags, Args } from '@oclif/core';
|
|
|
2
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
3
|
import { styles } from '../../lib/styles.js';
|
|
4
4
|
import { slugify } from '../../lib/pmo/utils.js';
|
|
5
|
-
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
5
|
+
import { shouldOutputJson, outputDryRunSuccessAsJson, outputDryRunErrorsAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
6
6
|
import { FlagResolver } from '../../lib/flags/index.js';
|
|
7
7
|
export default class SpecCreate extends PMOCommand {
|
|
8
8
|
static description = 'Create a new spec';
|
|
@@ -10,6 +10,7 @@ export default class SpecCreate extends PMOCommand {
|
|
|
10
10
|
'<%= config.bin %> <%= command.id %> "User Authentication"',
|
|
11
11
|
'<%= config.bin %> <%= command.id %> --title "API Design" --type product',
|
|
12
12
|
'<%= config.bin %> <%= command.id %> -i # Interactive mode',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --title "Test" --dry-run --json # Validate without creating',
|
|
13
14
|
];
|
|
14
15
|
static args = {
|
|
15
16
|
title: Args.string({
|
|
@@ -21,7 +22,7 @@ export default class SpecCreate extends PMOCommand {
|
|
|
21
22
|
...pmoBaseFlags,
|
|
22
23
|
title: Flags.string({
|
|
23
24
|
char: 't',
|
|
24
|
-
description: 'Spec title',
|
|
25
|
+
description: 'Spec title [required for non-interactive]',
|
|
25
26
|
}),
|
|
26
27
|
status: Flags.string({
|
|
27
28
|
char: 's',
|
|
@@ -41,6 +42,10 @@ export default class SpecCreate extends PMOCommand {
|
|
|
41
42
|
description: 'Interactive mode',
|
|
42
43
|
default: false,
|
|
43
44
|
}),
|
|
45
|
+
'dry-run': Flags.boolean({
|
|
46
|
+
description: 'Validate inputs without creating spec (use with --json for structured output)',
|
|
47
|
+
default: false,
|
|
48
|
+
}),
|
|
44
49
|
};
|
|
45
50
|
async execute() {
|
|
46
51
|
const { args, flags } = await this.parse(SpecCreate);
|
|
@@ -108,6 +113,42 @@ export default class SpecCreate extends PMOCommand {
|
|
|
108
113
|
const specType = resolved.type === '' ? undefined : resolved.type;
|
|
109
114
|
// Generate ID from title
|
|
110
115
|
const specId = slugify(resolved.title);
|
|
116
|
+
// Check if spec already exists
|
|
117
|
+
const existing = await this.storage.getSpec(specId);
|
|
118
|
+
if (existing) {
|
|
119
|
+
if (flags['dry-run']) {
|
|
120
|
+
if (jsonMode) {
|
|
121
|
+
outputDryRunErrorsAsJson([{ field: 'id', error: `Spec "${specId}" already exists` }], createMetadata('spec create', flags));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
this.error(`Spec "${specId}" already exists.`);
|
|
125
|
+
}
|
|
126
|
+
// Handle dry-run: show what would be created without actually creating
|
|
127
|
+
if (flags['dry-run']) {
|
|
128
|
+
const wouldCreate = {
|
|
129
|
+
id: specId,
|
|
130
|
+
title: resolved.title,
|
|
131
|
+
status: resolved.status || 'draft',
|
|
132
|
+
...(specType && { type: specType }),
|
|
133
|
+
...(resolved.problem && { problem: resolved.problem }),
|
|
134
|
+
};
|
|
135
|
+
if (jsonMode) {
|
|
136
|
+
outputDryRunSuccessAsJson('spec', wouldCreate, createMetadata('spec create', flags));
|
|
137
|
+
}
|
|
138
|
+
// Human-readable dry-run output
|
|
139
|
+
this.log(styles.warning('\n[DRY RUN] Would create spec:'));
|
|
140
|
+
this.log(styles.muted(` ID: ${specId}`));
|
|
141
|
+
this.log(styles.muted(` Title: ${resolved.title}`));
|
|
142
|
+
this.log(styles.muted(` Status: ${resolved.status || 'draft'}`));
|
|
143
|
+
if (specType) {
|
|
144
|
+
this.log(styles.muted(` Type: ${specType}`));
|
|
145
|
+
}
|
|
146
|
+
if (resolved.problem) {
|
|
147
|
+
this.log(styles.muted(` Problem: ${resolved.problem}`));
|
|
148
|
+
}
|
|
149
|
+
this.log(styles.muted('\n(No spec was created)'));
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
111
152
|
// Create spec in database
|
|
112
153
|
const spec = await this.storage.createSpec({
|
|
113
154
|
id: specId,
|
|
@@ -48,7 +48,7 @@ export default class Spec extends PMOCommand {
|
|
|
48
48
|
delete: 'prlt spec delete --json',
|
|
49
49
|
generate: 'prlt spec plan --json',
|
|
50
50
|
ticket: 'prlt spec ticket --json',
|
|
51
|
-
link: 'prlt
|
|
51
|
+
link: 'prlt link list --json',
|
|
52
52
|
cancel: '',
|
|
53
53
|
};
|
|
54
54
|
return commands[value] || '';
|
|
@@ -80,7 +80,7 @@ export default class Spec extends PMOCommand {
|
|
|
80
80
|
await this.config.runCommand('spec:ticket', []);
|
|
81
81
|
break;
|
|
82
82
|
case 'link':
|
|
83
|
-
await this.config.runCommand('
|
|
83
|
+
await this.config.runCommand('link', []);
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command, Args, Flags } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
|
-
import { getWorkspaceInfo, validateAgentNames, addAgentsToWorkspace } from '
|
|
5
|
-
import { ensureBuiltinThemes, BUILTIN_THEMES, isValidAgentName, normalizeAgentName } from '
|
|
6
|
-
import { getTheme, getThemes, getAvailableThemeNames, getActiveTheme } from '
|
|
7
|
-
import { shouldOutputJson, outputPromptAsJson, outputErrorAsJson, createMetadata, buildPromptConfig, } from '
|
|
4
|
+
import { getWorkspaceInfo, validateAgentNames, addAgentsToWorkspace } from '../../lib/agents/commands.js';
|
|
5
|
+
import { ensureBuiltinThemes, BUILTIN_THEMES, isValidAgentName, normalizeAgentName } from '../../lib/themes.js';
|
|
6
|
+
import { getTheme, getThemes, getAvailableThemeNames, getActiveTheme } from '../../lib/database/index.js';
|
|
7
|
+
import { shouldOutputJson, outputPromptAsJson, outputErrorAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
|
|
8
8
|
export default class Add extends Command {
|
|
9
9
|
static description = 'Add new agents to the workspace';
|
|
10
10
|
static examples = [
|
|
@@ -58,7 +58,7 @@ export default class Add extends Command {
|
|
|
58
58
|
if (!theme) {
|
|
59
59
|
const available = BUILTIN_THEMES.map(t => t.name).join(', ');
|
|
60
60
|
if (jsonMode) {
|
|
61
|
-
outputErrorAsJson('THEME_NOT_FOUND', `Theme "${flags.theme}" not found. Available: ${available}`, createMetadata('
|
|
61
|
+
outputErrorAsJson('THEME_NOT_FOUND', `Theme "${flags.theme}" not found. Available: ${available}`, createMetadata('staff add', flags));
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
this.error(`Theme "${flags.theme}" not found. Available: ${available}`);
|
|
@@ -68,7 +68,7 @@ export default class Add extends Command {
|
|
|
68
68
|
const availableNames = getAvailableThemeNames(workspaceInfo.path, themeId);
|
|
69
69
|
if (availableNames.length === 0) {
|
|
70
70
|
if (jsonMode) {
|
|
71
|
-
outputErrorAsJson('NO_AVAILABLE_NAMES', `No available names in theme "${theme.display_name}". All names are in use.`, createMetadata('
|
|
71
|
+
outputErrorAsJson('NO_AVAILABLE_NAMES', `No available names in theme "${theme.display_name}". All names are in use.`, createMetadata('staff add', flags));
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
this.error(`No available names in theme "${theme.display_name}". All names are in use.`);
|
|
@@ -78,7 +78,7 @@ export default class Add extends Command {
|
|
|
78
78
|
const selectMessage = `Select agent names from ${theme.display_name}:`;
|
|
79
79
|
// In JSON mode, output theme names selection prompt
|
|
80
80
|
if (jsonMode) {
|
|
81
|
-
outputPromptAsJson(buildPromptConfig('checkbox', 'names', selectMessage, nameChoices), createMetadata('
|
|
81
|
+
outputPromptAsJson(buildPromptConfig('checkbox', 'names', selectMessage, nameChoices), createMetadata('staff add', flags));
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
// Interactive selection from theme
|
|
@@ -103,7 +103,7 @@ export default class Add extends Command {
|
|
|
103
103
|
const availableNames = getAvailableThemeNames(workspaceInfo.path, activeTheme.id);
|
|
104
104
|
if (availableNames.length === 0) {
|
|
105
105
|
if (jsonMode) {
|
|
106
|
-
outputErrorAsJson('NO_AVAILABLE_NAMES', `No available names in ${activeTheme.display_name}. All names are in use.`, createMetadata('
|
|
106
|
+
outputErrorAsJson('NO_AVAILABLE_NAMES', `No available names in ${activeTheme.display_name}. All names are in use.`, createMetadata('staff add', flags));
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
this.log(chalk.yellow(`No available names in ${activeTheme.display_name}. All names are in use.`));
|
|
@@ -118,7 +118,7 @@ export default class Add extends Command {
|
|
|
118
118
|
const selectMessage = `Select agents from ${activeTheme.display_name}:`;
|
|
119
119
|
// In JSON mode, output agent names selection prompt
|
|
120
120
|
if (jsonMode) {
|
|
121
|
-
outputPromptAsJson(buildPromptConfig('checkbox', 'names', selectMessage, nameChoices), createMetadata('
|
|
121
|
+
outputPromptAsJson(buildPromptConfig('checkbox', 'names', selectMessage, nameChoices), createMetadata('staff add', flags));
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
// Add separator before custom option for interactive mode
|
|
@@ -175,7 +175,7 @@ export default class Add extends Command {
|
|
|
175
175
|
const selectMessage = 'No theme set. Select a theme or enter custom names:';
|
|
176
176
|
// In JSON mode, output theme selection prompt
|
|
177
177
|
if (jsonMode) {
|
|
178
|
-
outputPromptAsJson(buildPromptConfig('list', 'theme', selectMessage, themeChoices), createMetadata('
|
|
178
|
+
outputPromptAsJson(buildPromptConfig('list', 'theme', selectMessage, themeChoices), createMetadata('staff add', flags));
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
// Add separator and styling for interactive mode
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
-
import { colors } from '
|
|
4
|
-
import { PMOCommand, pmoBaseFlags } from '
|
|
5
|
-
import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '
|
|
3
|
+
import { colors } from '../../lib/colors.js';
|
|
4
|
+
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
5
|
+
import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
|
|
6
6
|
export default class Staff extends PMOCommand {
|
|
7
7
|
static description = 'Manage staff (persistent) agents';
|
|
8
8
|
static examples = [
|
|
@@ -33,15 +33,15 @@ export default class Staff extends PMOCommand {
|
|
|
33
33
|
// Define choices once, use for both JSON and interactive modes
|
|
34
34
|
// Include command field for AI agent navigation
|
|
35
35
|
const menuChoices = [
|
|
36
|
-
{ name: 'List staff agents', value: 'list', command: 'prlt
|
|
37
|
-
{ name: 'Add staff agent', value: 'add', command: 'prlt
|
|
38
|
-
{ name: 'Remove staff agent', value: 'remove', command: 'prlt
|
|
36
|
+
{ name: 'List staff agents', value: 'list', command: 'prlt staff list --machine' },
|
|
37
|
+
{ name: 'Add staff agent', value: 'add', command: 'prlt staff add --machine' },
|
|
38
|
+
{ name: 'Remove staff agent', value: 'remove', command: 'prlt staff remove --machine' },
|
|
39
39
|
{ name: 'Cancel', value: 'cancel', command: '' },
|
|
40
40
|
];
|
|
41
41
|
const message = 'What would you like to do?';
|
|
42
42
|
// In JSON mode, output menu prompt
|
|
43
43
|
if (jsonMode) {
|
|
44
|
-
outputPromptAsJson(buildPromptConfig('list', 'action', message, menuChoices), createMetadata('
|
|
44
|
+
outputPromptAsJson(buildPromptConfig('list', 'action', message, menuChoices), createMetadata('staff', flags));
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
this.log(colors.primary('Staff Agents'));
|
|
@@ -2,7 +2,7 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
4
|
import * as fs from 'node:fs';
|
|
5
|
-
import { getWorkspaceInfo, getAllAgentsStatus } from '
|
|
5
|
+
import { getWorkspaceInfo, getAllAgentsStatus } from '../../lib/agents/commands.js';
|
|
6
6
|
export default class List extends Command {
|
|
7
7
|
static description = 'List all staff (persistent) agents and their status';
|
|
8
8
|
static examples = [
|
|
@@ -16,7 +16,7 @@ export default class List extends Command {
|
|
|
16
16
|
// Filter to staff agents only
|
|
17
17
|
const staffAgents = workspaceInfo.agents.filter(a => a.type === 'persistent');
|
|
18
18
|
if (staffAgents.length === 0) {
|
|
19
|
-
this.log(chalk.yellow('No staff agents found. Add staff agents with "prlt
|
|
19
|
+
this.log(chalk.yellow('No staff agents found. Add staff agents with "prlt staff add"'));
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
// Get status for all agents and filter to staff
|
|
@@ -68,7 +68,7 @@ export default class List extends Command {
|
|
|
68
68
|
else {
|
|
69
69
|
this.log(chalk.red(` Agent directory not found`));
|
|
70
70
|
}
|
|
71
|
-
this.log(chalk.white(' Run "prlt
|
|
71
|
+
this.log(chalk.white(' Run "prlt staff add" to recreate'));
|
|
72
72
|
}
|
|
73
73
|
this.log(''); // Empty line between agents
|
|
74
74
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
-
import { colors, format } from '
|
|
4
|
-
import { getWorkspaceInfo, removeAgentsFromWorkspace, formatAgentList } from '
|
|
5
|
-
import { PMOCommand, pmoBaseFlags } from '
|
|
6
|
-
import { shouldOutputJson, outputPromptAsJson, outputErrorAsJson, createMetadata, buildPromptConfig, } from '
|
|
3
|
+
import { colors, format } from '../../lib/colors.js';
|
|
4
|
+
import { getWorkspaceInfo, removeAgentsFromWorkspace, formatAgentList } from '../../lib/agents/commands.js';
|
|
5
|
+
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
6
|
+
import { shouldOutputJson, outputPromptAsJson, outputErrorAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
|
|
7
7
|
export default class Remove extends PMOCommand {
|
|
8
8
|
static description = 'Remove a specific agent from the workspace';
|
|
9
9
|
static examples = [
|
|
@@ -40,7 +40,7 @@ export default class Remove extends PMOCommand {
|
|
|
40
40
|
// Helper to handle errors in JSON mode
|
|
41
41
|
const handleError = (code, message) => {
|
|
42
42
|
if (jsonMode) {
|
|
43
|
-
outputErrorAsJson(code, message, createMetadata('
|
|
43
|
+
outputErrorAsJson(code, message, createMetadata('staff remove', flags));
|
|
44
44
|
this.exit(1);
|
|
45
45
|
}
|
|
46
46
|
this.error(message);
|
|
@@ -51,7 +51,7 @@ export default class Remove extends PMOCommand {
|
|
|
51
51
|
const staffAgents = workspaceInfo.agents.filter(a => a.type === 'persistent');
|
|
52
52
|
if (staffAgents.length === 0) {
|
|
53
53
|
if (jsonMode) {
|
|
54
|
-
outputErrorAsJson('NO_AGENTS', 'No staff agents to remove.', createMetadata('
|
|
54
|
+
outputErrorAsJson('NO_AGENTS', 'No staff agents to remove.', createMetadata('staff remove', flags));
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
this.log(colors.warning('No staff agents to remove.'));
|
|
@@ -68,7 +68,7 @@ export default class Remove extends PMOCommand {
|
|
|
68
68
|
const selectMessage = 'Select agent to remove:';
|
|
69
69
|
// In JSON mode, output agent selection prompt
|
|
70
70
|
if (jsonMode) {
|
|
71
|
-
outputPromptAsJson(buildPromptConfig('list', 'name', selectMessage, agentChoices), createMetadata('
|
|
71
|
+
outputPromptAsJson(buildPromptConfig('list', 'name', selectMessage, agentChoices), createMetadata('staff remove', flags));
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
const { selected } = await inquirer.prompt([
|
|
@@ -106,7 +106,7 @@ export default class Remove extends PMOCommand {
|
|
|
106
106
|
// Confirm removal
|
|
107
107
|
// In JSON mode, output confirmation prompt
|
|
108
108
|
if (jsonMode) {
|
|
109
|
-
outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('
|
|
109
|
+
outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('staff remove', flags));
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
const { confirm } = await inquirer.prompt([
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { PMOCommand } from '
|
|
2
|
-
export default class
|
|
1
|
+
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
export default class TemplateApply extends PMOCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
6
|
template: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
+
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
column: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
priority: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
category: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
assignee: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
owner: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
-
status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
labels: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
16
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
epic: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'no-subtasks': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
19
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
21
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
-
'no-subtasks': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
-
epic: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
22
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
23
|
};
|
|
24
24
|
execute(): Promise<void>;
|
|
25
|
+
private applyTicketTemplate;
|
|
26
|
+
private applyPhaseTemplate;
|
|
25
27
|
}
|