@proletariat/cli 0.3.23 → 0.3.25
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.js +4 -4
- package/dist/commands/action/update.js +3 -3
- 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/activate.js +9 -17
- package/dist/commands/epic/archive.js +13 -24
- package/dist/commands/epic/create.d.ts +1 -0
- package/dist/commands/epic/create.js +46 -8
- package/dist/commands/epic/index.js +2 -2
- package/dist/commands/epic/move.js +28 -47
- package/dist/commands/epic/progress.js +10 -14
- package/dist/commands/epic/project.js +42 -59
- package/dist/commands/epic/reorder.js +25 -30
- package/dist/commands/epic/spec.d.ts +1 -0
- package/dist/commands/epic/spec.js +39 -40
- package/dist/commands/epic/ticket.d.ts +2 -0
- package/dist/commands/epic/ticket.js +63 -37
- package/dist/commands/feedback/index.d.ts +10 -0
- package/dist/commands/feedback/index.js +60 -0
- package/dist/commands/feedback/list.d.ts +12 -0
- package/dist/commands/feedback/list.js +126 -0
- package/dist/commands/feedback/submit.d.ts +16 -0
- package/dist/commands/feedback/submit.js +220 -0
- package/dist/commands/{template/phase/delete.d.ts → feedback/view.d.ts} +7 -5
- package/dist/commands/feedback/view.js +109 -0
- package/dist/commands/gh/index.js +4 -0
- 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/repo/create.d.ts +38 -0
- package/dist/commands/repo/create.js +283 -0
- package/dist/commands/repo/index.js +7 -0
- package/dist/commands/roadmap/add-project.js +9 -22
- package/dist/commands/roadmap/create.d.ts +0 -1
- package/dist/commands/roadmap/create.js +46 -40
- package/dist/commands/roadmap/delete.js +10 -24
- package/dist/commands/roadmap/generate.d.ts +1 -0
- package/dist/commands/roadmap/generate.js +21 -22
- package/dist/commands/roadmap/remove-project.js +14 -34
- package/dist/commands/roadmap/reorder.js +19 -26
- package/dist/commands/roadmap/update.js +27 -26
- package/dist/commands/roadmap/view.js +5 -12
- package/dist/commands/session/attach.d.ts +1 -8
- package/dist/commands/session/attach.js +93 -59
- package/dist/commands/session/list.d.ts +0 -8
- package/dist/commands/session/list.js +130 -81
- package/dist/commands/spec/create.d.ts +1 -0
- package/dist/commands/spec/create.js +44 -3
- package/dist/commands/spec/edit.js +63 -33
- 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/{template/phase/index.d.ts → support/book.d.ts} +2 -2
- package/dist/commands/support/book.js +54 -0
- package/dist/commands/{template/ticket/index.d.ts → support/discord.d.ts} +2 -2
- package/dist/commands/support/discord.js +54 -0
- package/dist/commands/support/docs.d.ts +10 -0
- package/dist/commands/support/docs.js +54 -0
- package/dist/commands/support/index.d.ts +19 -0
- package/dist/commands/support/index.js +81 -0
- package/dist/commands/support/issues.d.ts +11 -0
- package/dist/commands/support/issues.js +77 -0
- package/dist/commands/support/logs.d.ts +18 -0
- package/dist/commands/support/logs.js +247 -0
- 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 +75 -15
- package/dist/commands/ticket/edit.js +44 -13
- package/dist/commands/ticket/index.js +6 -6
- package/dist/commands/ticket/move.d.ts +7 -0
- package/dist/commands/ticket/move.js +132 -0
- package/dist/commands/work/spawn.d.ts +1 -0
- package/dist/commands/work/spawn.js +72 -8
- package/dist/commands/work/start.js +6 -0
- package/dist/lib/execution/runners.js +21 -17
- package/dist/lib/execution/session-utils.d.ts +60 -0
- package/dist/lib/execution/session-utils.js +162 -0
- package/dist/lib/execution/spawner.d.ts +2 -0
- package/dist/lib/execution/spawner.js +42 -0
- package/dist/lib/flags/resolver.d.ts +2 -2
- package/dist/lib/flags/resolver.js +15 -0
- package/dist/lib/init/index.js +18 -0
- 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/multiline-input.d.ts +63 -0
- package/dist/lib/multiline-input.js +360 -0
- package/dist/lib/prompt-json.d.ts +57 -6
- package/dist/lib/prompt-json.js +45 -0
- package/dist/lib/repos/git.d.ts +7 -0
- package/dist/lib/repos/git.js +20 -0
- package/oclif.manifest.json +3690 -4995
- package/package.json +6 -4
- 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.js +0 -36
- 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.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
|
@@ -4,6 +4,7 @@ import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
|
4
4
|
import { styles } from '../../lib/styles.js';
|
|
5
5
|
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
6
6
|
import { FlagResolver } from '../../lib/flags/index.js';
|
|
7
|
+
import { multiLineInput } from '../../lib/multiline-input.js';
|
|
7
8
|
export default class SpecEdit extends PMOCommand {
|
|
8
9
|
static description = 'Edit an existing spec';
|
|
9
10
|
static examples = [
|
|
@@ -114,6 +115,25 @@ export default class SpecEdit extends PMOCommand {
|
|
|
114
115
|
const hasFlags = flags.title || flags.status || flags.type || flags.problem ||
|
|
115
116
|
flags.solution || flags.decisions;
|
|
116
117
|
if (flags.interactive || !hasFlags) {
|
|
118
|
+
// In JSON mode without flags, output a form prompt instead of interactive prompts
|
|
119
|
+
if (jsonMode) {
|
|
120
|
+
const { outputPromptAsJson, buildFormPromptConfig } = await import('../../lib/prompt-json.js');
|
|
121
|
+
const formConfig = buildFormPromptConfig([
|
|
122
|
+
{ type: 'input', name: 'title', message: 'Title:', default: spec.title },
|
|
123
|
+
{ type: 'list', name: 'status', message: 'Status:', choices: statusChoices, default: spec.status },
|
|
124
|
+
{ type: 'list', name: 'type', message: 'Type:', choices: typeChoices, default: spec.type || '' },
|
|
125
|
+
{ type: 'multiline', name: 'problem', message: 'Problem statement:', default: spec.problem || '' },
|
|
126
|
+
{ type: 'multiline', name: 'solution', message: 'Solution:', default: spec.solution || '' },
|
|
127
|
+
{ type: 'multiline', name: 'decisions', message: 'Design decisions:', default: spec.decisions || '' },
|
|
128
|
+
]);
|
|
129
|
+
formConfig.context = {
|
|
130
|
+
hint: `Edit spec with: prlt spec edit ${specId} --title "..." --problem "..." --json`,
|
|
131
|
+
specId,
|
|
132
|
+
currentValues: { title: spec.title, status: spec.status, type: spec.type, problem: spec.problem, solution: spec.solution, decisions: spec.decisions },
|
|
133
|
+
};
|
|
134
|
+
outputPromptAsJson(formConfig, createMetadata('spec edit', flags));
|
|
135
|
+
return; // outputPromptAsJson exits, but TypeScript doesn't know
|
|
136
|
+
}
|
|
117
137
|
// Interactive mode - prompt for editable fields
|
|
118
138
|
updates = await this.promptForEdits(spec, typeChoices, statusChoices);
|
|
119
139
|
}
|
|
@@ -162,7 +182,8 @@ export default class SpecEdit extends PMOCommand {
|
|
|
162
182
|
this.log(styles.muted(`View spec: prlt spec view ${updatedSpec.id}`));
|
|
163
183
|
}
|
|
164
184
|
async promptForEdits(spec, typeChoices, statusChoices) {
|
|
165
|
-
|
|
185
|
+
// First prompt for title, status, and type
|
|
186
|
+
const basicAnswers = await inquirer.prompt([
|
|
166
187
|
{
|
|
167
188
|
type: 'input',
|
|
168
189
|
name: 'title',
|
|
@@ -184,48 +205,57 @@ export default class SpecEdit extends PMOCommand {
|
|
|
184
205
|
choices: typeChoices,
|
|
185
206
|
default: spec.type || '',
|
|
186
207
|
},
|
|
187
|
-
{
|
|
188
|
-
type: 'editor',
|
|
189
|
-
name: 'problem',
|
|
190
|
-
message: 'Problem statement (opens $EDITOR):',
|
|
191
|
-
default: spec.problem || '',
|
|
192
|
-
waitForUseInput: false,
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
type: 'editor',
|
|
196
|
-
name: 'solution',
|
|
197
|
-
message: 'Solution (opens $EDITOR):',
|
|
198
|
-
default: spec.solution || '',
|
|
199
|
-
waitForUseInput: false,
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
type: 'editor',
|
|
203
|
-
name: 'decisions',
|
|
204
|
-
message: 'Design decisions (opens $EDITOR):',
|
|
205
|
-
default: spec.decisions || '',
|
|
206
|
-
waitForUseInput: false,
|
|
207
|
-
},
|
|
208
208
|
]);
|
|
209
|
+
// Prompt for problem statement using multiline input
|
|
210
|
+
const problemResult = await multiLineInput({
|
|
211
|
+
message: 'Problem statement:',
|
|
212
|
+
default: spec.problem || '',
|
|
213
|
+
hint: 'Describe the problem this spec addresses. Ctrl+D to finish, Ctrl+C to cancel',
|
|
214
|
+
});
|
|
215
|
+
if (problemResult.cancelled) {
|
|
216
|
+
throw new Error('Edit cancelled');
|
|
217
|
+
}
|
|
218
|
+
// Prompt for solution using multiline input
|
|
219
|
+
const solutionResult = await multiLineInput({
|
|
220
|
+
message: 'Solution:',
|
|
221
|
+
default: spec.solution || '',
|
|
222
|
+
hint: 'Describe the proposed solution. Ctrl+D to finish, Ctrl+C to cancel',
|
|
223
|
+
});
|
|
224
|
+
if (solutionResult.cancelled) {
|
|
225
|
+
throw new Error('Edit cancelled');
|
|
226
|
+
}
|
|
227
|
+
// Prompt for decisions using multiline input
|
|
228
|
+
const decisionsResult = await multiLineInput({
|
|
229
|
+
message: 'Design decisions:',
|
|
230
|
+
default: spec.decisions || '',
|
|
231
|
+
hint: 'Document key design decisions. Ctrl+D to finish, Ctrl+C to cancel',
|
|
232
|
+
});
|
|
233
|
+
if (decisionsResult.cancelled) {
|
|
234
|
+
throw new Error('Edit cancelled');
|
|
235
|
+
}
|
|
209
236
|
// Build updates object with only changed fields
|
|
210
237
|
const updates = {};
|
|
211
|
-
if (
|
|
212
|
-
updates.title =
|
|
238
|
+
if (basicAnswers.title !== spec.title) {
|
|
239
|
+
updates.title = basicAnswers.title;
|
|
213
240
|
}
|
|
214
|
-
if (
|
|
215
|
-
updates.status =
|
|
241
|
+
if (basicAnswers.status !== spec.status) {
|
|
242
|
+
updates.status = basicAnswers.status;
|
|
216
243
|
}
|
|
217
|
-
const newType =
|
|
244
|
+
const newType = basicAnswers.type === '' ? undefined : basicAnswers.type;
|
|
218
245
|
if (newType !== spec.type) {
|
|
219
246
|
updates.type = newType;
|
|
220
247
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
248
|
+
if (problemResult.value !== (spec.problem || '')) {
|
|
249
|
+
// Preserve empty string to allow clearing the field
|
|
250
|
+
updates.problem = problemResult.value;
|
|
223
251
|
}
|
|
224
|
-
if (
|
|
225
|
-
|
|
252
|
+
if (solutionResult.value !== (spec.solution || '')) {
|
|
253
|
+
// Preserve empty string to allow clearing the field
|
|
254
|
+
updates.solution = solutionResult.value;
|
|
226
255
|
}
|
|
227
|
-
if (
|
|
228
|
-
|
|
256
|
+
if (decisionsResult.value !== (spec.decisions || '')) {
|
|
257
|
+
// Preserve empty string to allow clearing the field
|
|
258
|
+
updates.decisions = decisionsResult.value;
|
|
229
259
|
}
|
|
230
260
|
return updates;
|
|
231
261
|
}
|
|
@@ -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,10 +1,10 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
export default class
|
|
2
|
+
export default class SupportBook extends Command {
|
|
3
3
|
static description: string;
|
|
4
|
-
static aliases: string[];
|
|
5
4
|
static examples: string[];
|
|
6
5
|
static flags: {
|
|
7
6
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
7
|
};
|
|
9
8
|
run(): Promise<void>;
|
|
9
|
+
private openUrl;
|
|
10
10
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { execSync } from 'node:child_process';
|
|
3
|
+
import { styles } from '../../lib/styles.js';
|
|
4
|
+
import { isMachineOutput, outputSuccessAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
6
|
+
import { SUPPORT_URLS } from './index.js';
|
|
7
|
+
export default class SupportBook extends Command {
|
|
8
|
+
static description = 'Book a call for support';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
...machineOutputFlags,
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(SupportBook);
|
|
18
|
+
const url = SUPPORT_URLS.calcom;
|
|
19
|
+
// In JSON mode, return the URL
|
|
20
|
+
if (isMachineOutput(flags)) {
|
|
21
|
+
outputSuccessAsJson({
|
|
22
|
+
action: 'book',
|
|
23
|
+
url,
|
|
24
|
+
message: 'Book a call for support',
|
|
25
|
+
}, createMetadata('support book', flags));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Open the URL in the browser
|
|
29
|
+
this.openUrl(url);
|
|
30
|
+
this.log(styles.success('Opening cal.com booking page...'));
|
|
31
|
+
this.log(styles.muted(`URL: ${url}`));
|
|
32
|
+
}
|
|
33
|
+
openUrl(url) {
|
|
34
|
+
const platform = process.platform;
|
|
35
|
+
try {
|
|
36
|
+
if (platform === 'darwin') {
|
|
37
|
+
execSync(`open "${url}"`);
|
|
38
|
+
}
|
|
39
|
+
else if (platform === 'linux') {
|
|
40
|
+
execSync(`xdg-open "${url}"`);
|
|
41
|
+
}
|
|
42
|
+
else if (platform === 'win32') {
|
|
43
|
+
execSync(`start "" "${url}"`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
this.log(styles.warning('Could not open browser automatically.'));
|
|
51
|
+
this.log(styles.info(`Please visit: ${url}`));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
export default class
|
|
2
|
+
export default class SupportDiscord extends Command {
|
|
3
3
|
static description: string;
|
|
4
|
-
static aliases: string[];
|
|
5
4
|
static examples: string[];
|
|
6
5
|
static flags: {
|
|
7
6
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
7
|
};
|
|
9
8
|
run(): Promise<void>;
|
|
9
|
+
private openUrl;
|
|
10
10
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { execSync } from 'node:child_process';
|
|
3
|
+
import { styles } from '../../lib/styles.js';
|
|
4
|
+
import { isMachineOutput, outputSuccessAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
6
|
+
import { SUPPORT_URLS } from './index.js';
|
|
7
|
+
export default class SupportDiscord extends Command {
|
|
8
|
+
static description = 'Join the Discord community';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
...machineOutputFlags,
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(SupportDiscord);
|
|
18
|
+
const url = SUPPORT_URLS.discord;
|
|
19
|
+
// In JSON mode, return the URL
|
|
20
|
+
if (isMachineOutput(flags)) {
|
|
21
|
+
outputSuccessAsJson({
|
|
22
|
+
action: 'discord',
|
|
23
|
+
url,
|
|
24
|
+
message: 'Join Discord community',
|
|
25
|
+
}, createMetadata('support discord', flags));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Open the URL in the browser
|
|
29
|
+
this.openUrl(url);
|
|
30
|
+
this.log(styles.success('Opening Discord invite...'));
|
|
31
|
+
this.log(styles.muted(`URL: ${url}`));
|
|
32
|
+
}
|
|
33
|
+
openUrl(url) {
|
|
34
|
+
const platform = process.platform;
|
|
35
|
+
try {
|
|
36
|
+
if (platform === 'darwin') {
|
|
37
|
+
execSync(`open "${url}"`);
|
|
38
|
+
}
|
|
39
|
+
else if (platform === 'linux') {
|
|
40
|
+
execSync(`xdg-open "${url}"`);
|
|
41
|
+
}
|
|
42
|
+
else if (platform === 'win32') {
|
|
43
|
+
execSync(`start "" "${url}"`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
this.log(styles.warning('Could not open browser automatically.'));
|
|
51
|
+
this.log(styles.info(`Please visit: ${url}`));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class SupportDocs extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
private openUrl;
|
|
10
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { execSync } from 'node:child_process';
|
|
3
|
+
import { styles } from '../../lib/styles.js';
|
|
4
|
+
import { isMachineOutput, outputSuccessAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
6
|
+
import { SUPPORT_URLS } from './index.js';
|
|
7
|
+
export default class SupportDocs extends Command {
|
|
8
|
+
static description = 'Open documentation in browser';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
...machineOutputFlags,
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(SupportDocs);
|
|
18
|
+
const url = SUPPORT_URLS.docs;
|
|
19
|
+
// In JSON mode, return the URL
|
|
20
|
+
if (isMachineOutput(flags)) {
|
|
21
|
+
outputSuccessAsJson({
|
|
22
|
+
action: 'docs',
|
|
23
|
+
url,
|
|
24
|
+
message: 'Open documentation',
|
|
25
|
+
}, createMetadata('support docs', flags));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Open the URL in the browser
|
|
29
|
+
this.openUrl(url);
|
|
30
|
+
this.log(styles.success('Opening documentation...'));
|
|
31
|
+
this.log(styles.muted(`URL: ${url}`));
|
|
32
|
+
}
|
|
33
|
+
openUrl(url) {
|
|
34
|
+
const platform = process.platform;
|
|
35
|
+
try {
|
|
36
|
+
if (platform === 'darwin') {
|
|
37
|
+
execSync(`open "${url}"`);
|
|
38
|
+
}
|
|
39
|
+
else if (platform === 'linux') {
|
|
40
|
+
execSync(`xdg-open "${url}"`);
|
|
41
|
+
}
|
|
42
|
+
else if (platform === 'win32') {
|
|
43
|
+
execSync(`start "" "${url}"`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
this.log(styles.warning('Could not open browser automatically.'));
|
|
51
|
+
this.log(styles.info(`Please visit: ${url}`));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Support URLs - centralized for consistency
|
|
4
|
+
*/
|
|
5
|
+
export declare const SUPPORT_URLS: {
|
|
6
|
+
calcom: string;
|
|
7
|
+
discord: string;
|
|
8
|
+
issues: string;
|
|
9
|
+
docs: string;
|
|
10
|
+
npm: string;
|
|
11
|
+
};
|
|
12
|
+
export default class Support extends Command {
|
|
13
|
+
static description: string;
|
|
14
|
+
static examples: string[];
|
|
15
|
+
static flags: {
|
|
16
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
|
|
3
|
+
import { machineOutputFlags } from '../../lib/pmo/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Support URLs - centralized for consistency
|
|
6
|
+
*/
|
|
7
|
+
export const SUPPORT_URLS = {
|
|
8
|
+
calcom: 'https://cal.com/chrismcdermut',
|
|
9
|
+
discord: 'https://discord.gg/tmZyjNNSvw',
|
|
10
|
+
issues: 'https://github.com/chrismcdermut/proletariat/issues',
|
|
11
|
+
docs: 'https://github.com/chrismcdermut/proletariat#readme',
|
|
12
|
+
npm: 'https://www.npmjs.com/package/@proletariat/cli',
|
|
13
|
+
};
|
|
14
|
+
export default class Support extends Command {
|
|
15
|
+
static description = 'Get help, troubleshoot, and connect with the community';
|
|
16
|
+
static examples = [
|
|
17
|
+
'<%= config.bin %> <%= command.id %>',
|
|
18
|
+
'<%= config.bin %> <%= command.id %> book',
|
|
19
|
+
'<%= config.bin %> <%= command.id %> docs',
|
|
20
|
+
'<%= config.bin %> <%= command.id %> discord',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> issues',
|
|
22
|
+
'<%= config.bin %> <%= command.id %> logs',
|
|
23
|
+
];
|
|
24
|
+
static flags = {
|
|
25
|
+
...machineOutputFlags,
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
const { flags } = await this.parse(Support);
|
|
29
|
+
// Check if JSON output mode is active
|
|
30
|
+
const jsonMode = shouldOutputJson(flags);
|
|
31
|
+
// Use FlagResolver for the menu selection
|
|
32
|
+
const resolver = new FlagResolver({
|
|
33
|
+
commandName: 'support',
|
|
34
|
+
baseCommand: 'prlt support',
|
|
35
|
+
jsonMode,
|
|
36
|
+
flags: {},
|
|
37
|
+
});
|
|
38
|
+
// Add prompt for action selection
|
|
39
|
+
resolver.addPrompt({
|
|
40
|
+
flagName: 'action',
|
|
41
|
+
type: 'list',
|
|
42
|
+
message: 'How can we help?',
|
|
43
|
+
choices: () => [
|
|
44
|
+
{ name: 'Book a call', value: 'book', command: 'prlt support book --json' },
|
|
45
|
+
{ name: 'Documentation', value: 'docs', command: 'prlt support docs --json' },
|
|
46
|
+
{ name: 'Report a bug', value: 'bug', command: 'prlt feedback submit --category bug --json' },
|
|
47
|
+
{ name: 'Request a feature', value: 'feature', command: 'prlt feedback submit --category feature --json' },
|
|
48
|
+
{ name: 'Join Discord', value: 'discord', command: 'prlt support discord --json' },
|
|
49
|
+
{ name: 'Browse issues', value: 'issues', command: 'prlt support issues --json' },
|
|
50
|
+
{ name: 'Collect diagnostics', value: 'logs', command: 'prlt support logs --json' },
|
|
51
|
+
],
|
|
52
|
+
skipAutoCommand: true,
|
|
53
|
+
});
|
|
54
|
+
// Resolve - in JSON mode this outputs the prompt and exits
|
|
55
|
+
const resolved = await resolver.resolve();
|
|
56
|
+
// Execute the selected action
|
|
57
|
+
switch (resolved.action) {
|
|
58
|
+
case 'book':
|
|
59
|
+
await this.config.runCommand('support book');
|
|
60
|
+
break;
|
|
61
|
+
case 'docs':
|
|
62
|
+
await this.config.runCommand('support docs');
|
|
63
|
+
break;
|
|
64
|
+
case 'bug':
|
|
65
|
+
await this.config.runCommand('feedback submit', ['--category', 'bug']);
|
|
66
|
+
break;
|
|
67
|
+
case 'feature':
|
|
68
|
+
await this.config.runCommand('feedback submit', ['--category', 'feature']);
|
|
69
|
+
break;
|
|
70
|
+
case 'discord':
|
|
71
|
+
await this.config.runCommand('support discord');
|
|
72
|
+
break;
|
|
73
|
+
case 'issues':
|
|
74
|
+
await this.config.runCommand('support issues');
|
|
75
|
+
break;
|
|
76
|
+
case 'logs':
|
|
77
|
+
await this.config.runCommand('support logs');
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|