@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.
Files changed (235) hide show
  1. package/dist/commands/action/create.js +4 -4
  2. package/dist/commands/action/update.js +3 -3
  3. package/dist/commands/agent/{temp/cleanup.d.ts → cleanup.d.ts} +1 -1
  4. package/dist/commands/agent/{temp/cleanup.js → cleanup.js} +4 -4
  5. package/dist/commands/agent/index.js +8 -8
  6. package/dist/commands/branch/create.js +2 -2
  7. package/dist/commands/epic/activate.js +9 -17
  8. package/dist/commands/epic/archive.js +13 -24
  9. package/dist/commands/epic/create.d.ts +1 -0
  10. package/dist/commands/epic/create.js +46 -8
  11. package/dist/commands/epic/index.js +2 -2
  12. package/dist/commands/epic/move.js +28 -47
  13. package/dist/commands/epic/progress.js +10 -14
  14. package/dist/commands/epic/project.js +42 -59
  15. package/dist/commands/epic/reorder.js +25 -30
  16. package/dist/commands/epic/spec.d.ts +1 -0
  17. package/dist/commands/epic/spec.js +39 -40
  18. package/dist/commands/epic/ticket.d.ts +2 -0
  19. package/dist/commands/epic/ticket.js +63 -37
  20. package/dist/commands/feedback/index.d.ts +10 -0
  21. package/dist/commands/feedback/index.js +60 -0
  22. package/dist/commands/feedback/list.d.ts +12 -0
  23. package/dist/commands/feedback/list.js +126 -0
  24. package/dist/commands/feedback/submit.d.ts +16 -0
  25. package/dist/commands/feedback/submit.js +220 -0
  26. package/dist/commands/{template/phase/delete.d.ts → feedback/view.d.ts} +7 -5
  27. package/dist/commands/feedback/view.js +109 -0
  28. package/dist/commands/gh/index.js +4 -0
  29. package/dist/commands/{epic/link/remove.d.ts → link/create.d.ts} +6 -7
  30. package/dist/commands/link/create.js +141 -0
  31. package/dist/commands/{epic/link/relates.d.ts → link/index.d.ts} +4 -5
  32. package/dist/commands/link/index.js +87 -0
  33. package/dist/commands/{epic/link/duplicates.d.ts → link/list.d.ts} +7 -4
  34. package/dist/commands/link/list.js +182 -0
  35. package/dist/commands/{spec/link → link}/remove.d.ts +4 -5
  36. package/dist/commands/link/remove.js +120 -0
  37. package/dist/commands/mcp-server.d.ts +22 -0
  38. package/dist/commands/mcp-server.js +98 -0
  39. package/dist/commands/phase/create.js +1 -1
  40. package/dist/commands/project/create.d.ts +1 -0
  41. package/dist/commands/project/create.js +38 -4
  42. package/dist/commands/repo/create.d.ts +38 -0
  43. package/dist/commands/repo/create.js +283 -0
  44. package/dist/commands/repo/index.js +7 -0
  45. package/dist/commands/roadmap/add-project.js +9 -22
  46. package/dist/commands/roadmap/create.d.ts +0 -1
  47. package/dist/commands/roadmap/create.js +46 -40
  48. package/dist/commands/roadmap/delete.js +10 -24
  49. package/dist/commands/roadmap/generate.d.ts +1 -0
  50. package/dist/commands/roadmap/generate.js +21 -22
  51. package/dist/commands/roadmap/remove-project.js +14 -34
  52. package/dist/commands/roadmap/reorder.js +19 -26
  53. package/dist/commands/roadmap/update.js +27 -26
  54. package/dist/commands/roadmap/view.js +5 -12
  55. package/dist/commands/session/attach.d.ts +1 -8
  56. package/dist/commands/session/attach.js +93 -59
  57. package/dist/commands/session/list.d.ts +0 -8
  58. package/dist/commands/session/list.js +130 -81
  59. package/dist/commands/spec/create.d.ts +1 -0
  60. package/dist/commands/spec/create.js +44 -3
  61. package/dist/commands/spec/edit.js +63 -33
  62. package/dist/commands/spec/index.js +2 -2
  63. package/dist/commands/{agent/staff → staff}/add.js +10 -10
  64. package/dist/commands/{agent/staff → staff}/index.d.ts +1 -1
  65. package/dist/commands/{agent/staff → staff}/index.js +7 -7
  66. package/dist/commands/{agent/staff → staff}/list.js +3 -3
  67. package/dist/commands/{agent/staff → staff}/remove.d.ts +1 -1
  68. package/dist/commands/{agent/staff → staff}/remove.js +8 -8
  69. package/dist/commands/{template/phase/index.d.ts → support/book.d.ts} +2 -2
  70. package/dist/commands/support/book.js +54 -0
  71. package/dist/commands/{template/ticket/index.d.ts → support/discord.d.ts} +2 -2
  72. package/dist/commands/support/discord.js +54 -0
  73. package/dist/commands/support/docs.d.ts +10 -0
  74. package/dist/commands/support/docs.js +54 -0
  75. package/dist/commands/support/index.d.ts +19 -0
  76. package/dist/commands/support/index.js +81 -0
  77. package/dist/commands/support/issues.d.ts +11 -0
  78. package/dist/commands/support/issues.js +77 -0
  79. package/dist/commands/support/logs.d.ts +18 -0
  80. package/dist/commands/support/logs.js +247 -0
  81. package/dist/commands/{ticket/template → template}/apply.d.ts +8 -6
  82. package/dist/commands/template/apply.js +262 -0
  83. package/dist/commands/{ticket/template → template}/create.d.ts +5 -6
  84. package/dist/commands/template/create.js +238 -0
  85. package/dist/commands/template/index.js +48 -36
  86. package/dist/commands/{ticket/template → template}/save.d.ts +2 -2
  87. package/dist/commands/template/save.js +104 -0
  88. package/dist/commands/{phase/template → template}/update.d.ts +2 -2
  89. package/dist/commands/template/update.js +99 -0
  90. package/dist/commands/{agent/themes → theme}/add-names.d.ts +1 -1
  91. package/dist/commands/{agent/themes → theme}/add-names.js +6 -6
  92. package/dist/commands/{agent/themes → theme}/create.d.ts +1 -1
  93. package/dist/commands/{agent/themes → theme}/create.js +5 -5
  94. package/dist/commands/{agent/themes → theme}/index.d.ts +1 -1
  95. package/dist/commands/{agent/themes → theme}/index.js +10 -10
  96. package/dist/commands/{agent/themes → theme}/list.d.ts +1 -1
  97. package/dist/commands/{agent/themes → theme}/list.js +5 -5
  98. package/dist/commands/{agent/themes → theme}/set.d.ts +1 -1
  99. package/dist/commands/{agent/themes → theme}/set.js +7 -7
  100. package/dist/commands/ticket/create.d.ts +1 -0
  101. package/dist/commands/ticket/create.js +75 -15
  102. package/dist/commands/ticket/edit.js +44 -13
  103. package/dist/commands/ticket/index.js +6 -6
  104. package/dist/commands/ticket/move.d.ts +7 -0
  105. package/dist/commands/ticket/move.js +132 -0
  106. package/dist/commands/work/spawn.d.ts +1 -0
  107. package/dist/commands/work/spawn.js +72 -8
  108. package/dist/commands/work/start.js +6 -0
  109. package/dist/lib/execution/runners.js +21 -17
  110. package/dist/lib/execution/session-utils.d.ts +60 -0
  111. package/dist/lib/execution/session-utils.js +162 -0
  112. package/dist/lib/execution/spawner.d.ts +2 -0
  113. package/dist/lib/execution/spawner.js +42 -0
  114. package/dist/lib/flags/resolver.d.ts +2 -2
  115. package/dist/lib/flags/resolver.js +15 -0
  116. package/dist/lib/init/index.js +18 -0
  117. package/dist/lib/mcp/helpers.d.ts +43 -0
  118. package/dist/lib/mcp/helpers.js +57 -0
  119. package/dist/lib/mcp/index.d.ts +6 -0
  120. package/dist/lib/mcp/index.js +6 -0
  121. package/dist/lib/mcp/tools/action.d.ts +6 -0
  122. package/dist/lib/mcp/tools/action.js +88 -0
  123. package/dist/lib/mcp/tools/board.d.ts +6 -0
  124. package/dist/lib/mcp/tools/board.js +139 -0
  125. package/dist/lib/mcp/tools/category.d.ts +6 -0
  126. package/dist/lib/mcp/tools/category.js +84 -0
  127. package/dist/lib/mcp/tools/cli-passthrough.d.ts +15 -0
  128. package/dist/lib/mcp/tools/cli-passthrough.js +333 -0
  129. package/dist/lib/mcp/tools/epic.d.ts +6 -0
  130. package/dist/lib/mcp/tools/epic.js +178 -0
  131. package/dist/lib/mcp/tools/index.d.ts +18 -0
  132. package/dist/lib/mcp/tools/index.js +19 -0
  133. package/dist/lib/mcp/tools/phase.d.ts +6 -0
  134. package/dist/lib/mcp/tools/phase.js +131 -0
  135. package/dist/lib/mcp/tools/project.d.ts +6 -0
  136. package/dist/lib/mcp/tools/project.js +196 -0
  137. package/dist/lib/mcp/tools/roadmap.d.ts +6 -0
  138. package/dist/lib/mcp/tools/roadmap.js +123 -0
  139. package/dist/lib/mcp/tools/spec.d.ts +6 -0
  140. package/dist/lib/mcp/tools/spec.js +196 -0
  141. package/dist/lib/mcp/tools/status.d.ts +6 -0
  142. package/dist/lib/mcp/tools/status.js +109 -0
  143. package/dist/lib/mcp/tools/template.d.ts +6 -0
  144. package/dist/lib/mcp/tools/template.js +107 -0
  145. package/dist/lib/mcp/tools/ticket.d.ts +6 -0
  146. package/dist/lib/mcp/tools/ticket.js +393 -0
  147. package/dist/lib/mcp/tools/view.d.ts +6 -0
  148. package/dist/lib/mcp/tools/view.js +76 -0
  149. package/dist/lib/mcp/tools/work.d.ts +6 -0
  150. package/dist/lib/mcp/tools/work.js +132 -0
  151. package/dist/lib/mcp/tools/workflow.d.ts +6 -0
  152. package/dist/lib/mcp/tools/workflow.js +95 -0
  153. package/dist/lib/mcp/types.d.ts +17 -0
  154. package/dist/lib/mcp/types.js +4 -0
  155. package/dist/lib/multiline-input.d.ts +63 -0
  156. package/dist/lib/multiline-input.js +360 -0
  157. package/dist/lib/prompt-json.d.ts +57 -6
  158. package/dist/lib/prompt-json.js +45 -0
  159. package/dist/lib/repos/git.d.ts +7 -0
  160. package/dist/lib/repos/git.js +20 -0
  161. package/oclif.manifest.json +3690 -4995
  162. package/package.json +6 -4
  163. package/dist/commands/agent/temp/index.d.ts +0 -14
  164. package/dist/commands/agent/temp/index.js +0 -85
  165. package/dist/commands/agent/temp/list.d.ts +0 -7
  166. package/dist/commands/agent/temp/list.js +0 -108
  167. package/dist/commands/epic/link/block.d.ts +0 -14
  168. package/dist/commands/epic/link/block.js +0 -81
  169. package/dist/commands/epic/link/duplicates.js +0 -68
  170. package/dist/commands/epic/link/index.d.ts +0 -19
  171. package/dist/commands/epic/link/index.js +0 -272
  172. package/dist/commands/epic/link/relates.js +0 -68
  173. package/dist/commands/epic/link/remove.js +0 -93
  174. package/dist/commands/phase/template/apply.d.ts +0 -17
  175. package/dist/commands/phase/template/apply.js +0 -108
  176. package/dist/commands/phase/template/create.d.ts +0 -17
  177. package/dist/commands/phase/template/create.js +0 -104
  178. package/dist/commands/phase/template/delete.d.ts +0 -17
  179. package/dist/commands/phase/template/delete.js +0 -100
  180. package/dist/commands/phase/template/index.d.ts +0 -15
  181. package/dist/commands/phase/template/index.js +0 -130
  182. package/dist/commands/phase/template/list.d.ts +0 -16
  183. package/dist/commands/phase/template/list.js +0 -97
  184. package/dist/commands/phase/template/update.js +0 -89
  185. package/dist/commands/spec/link/depends.d.ts +0 -14
  186. package/dist/commands/spec/link/depends.js +0 -64
  187. package/dist/commands/spec/link/duplicates.d.ts +0 -14
  188. package/dist/commands/spec/link/duplicates.js +0 -63
  189. package/dist/commands/spec/link/index.d.ts +0 -19
  190. package/dist/commands/spec/link/index.js +0 -207
  191. package/dist/commands/spec/link/relates.d.ts +0 -14
  192. package/dist/commands/spec/link/relates.js +0 -63
  193. package/dist/commands/spec/link/remove.js +0 -96
  194. package/dist/commands/template/phase/apply.d.ts +0 -14
  195. package/dist/commands/template/phase/apply.js +0 -43
  196. package/dist/commands/template/phase/create.d.ts +0 -13
  197. package/dist/commands/template/phase/create.js +0 -38
  198. package/dist/commands/template/phase/delete.js +0 -36
  199. package/dist/commands/template/phase/index.js +0 -63
  200. package/dist/commands/template/phase/list.d.ts +0 -11
  201. package/dist/commands/template/phase/list.js +0 -36
  202. package/dist/commands/template/phase/update.d.ts +0 -14
  203. package/dist/commands/template/phase/update.js +0 -43
  204. package/dist/commands/template/ticket/apply.d.ts +0 -17
  205. package/dist/commands/template/ticket/apply.js +0 -60
  206. package/dist/commands/template/ticket/create.d.ts +0 -20
  207. package/dist/commands/template/ticket/create.js +0 -89
  208. package/dist/commands/template/ticket/delete.d.ts +0 -13
  209. package/dist/commands/template/ticket/delete.js +0 -38
  210. package/dist/commands/template/ticket/index.js +0 -63
  211. package/dist/commands/template/ticket/list.d.ts +0 -11
  212. package/dist/commands/template/ticket/list.js +0 -36
  213. package/dist/commands/template/ticket/save.d.ts +0 -15
  214. package/dist/commands/template/ticket/save.js +0 -46
  215. package/dist/commands/ticket/link/block.d.ts +0 -14
  216. package/dist/commands/ticket/link/block.js +0 -96
  217. package/dist/commands/ticket/link/duplicates.d.ts +0 -14
  218. package/dist/commands/ticket/link/duplicates.js +0 -95
  219. package/dist/commands/ticket/link/index.d.ts +0 -19
  220. package/dist/commands/ticket/link/index.js +0 -256
  221. package/dist/commands/ticket/link/relates.d.ts +0 -14
  222. package/dist/commands/ticket/link/relates.js +0 -95
  223. package/dist/commands/ticket/link/remove.d.ts +0 -16
  224. package/dist/commands/ticket/link/remove.js +0 -132
  225. package/dist/commands/ticket/template/apply.js +0 -252
  226. package/dist/commands/ticket/template/create.js +0 -386
  227. package/dist/commands/ticket/template/delete.d.ts +0 -17
  228. package/dist/commands/ticket/template/delete.js +0 -94
  229. package/dist/commands/ticket/template/index.d.ts +0 -15
  230. package/dist/commands/ticket/template/index.js +0 -120
  231. package/dist/commands/ticket/template/list.d.ts +0 -16
  232. package/dist/commands/ticket/template/list.js +0 -112
  233. package/dist/commands/ticket/template/save.js +0 -163
  234. /package/dist/commands/{agent/staff → staff}/add.d.ts +0 -0
  235. /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
- const answers = await inquirer.prompt([
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 (answers.title !== spec.title) {
212
- updates.title = answers.title;
238
+ if (basicAnswers.title !== spec.title) {
239
+ updates.title = basicAnswers.title;
213
240
  }
214
- if (answers.status !== spec.status) {
215
- updates.status = answers.status;
241
+ if (basicAnswers.status !== spec.status) {
242
+ updates.status = basicAnswers.status;
216
243
  }
217
- const newType = answers.type === '' ? undefined : answers.type;
244
+ const newType = basicAnswers.type === '' ? undefined : basicAnswers.type;
218
245
  if (newType !== spec.type) {
219
246
  updates.type = newType;
220
247
  }
221
- if (answers.problem !== (spec.problem || '')) {
222
- updates.problem = answers.problem || undefined;
248
+ if (problemResult.value !== (spec.problem || '')) {
249
+ // Preserve empty string to allow clearing the field
250
+ updates.problem = problemResult.value;
223
251
  }
224
- if (answers.solution !== (spec.solution || '')) {
225
- updates.solution = answers.solution || undefined;
252
+ if (solutionResult.value !== (spec.solution || '')) {
253
+ // Preserve empty string to allow clearing the field
254
+ updates.solution = solutionResult.value;
226
255
  }
227
- if (answers.decisions !== (spec.decisions || '')) {
228
- updates.decisions = answers.decisions || undefined;
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 spec link --json',
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('spec:link', []);
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 '../../../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';
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('agent add', flags));
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('agent add', flags));
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('agent add', flags));
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('agent add', flags));
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('agent add', flags));
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('agent add', flags));
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,4 +1,4 @@
1
- import { PMOCommand } from '../../../lib/pmo/index.js';
1
+ import { PMOCommand } from '../../lib/pmo/index.js';
2
2
  export default class Staff extends PMOCommand {
3
3
  static description: string;
4
4
  static examples: string[];
@@ -1,8 +1,8 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import inquirer from 'inquirer';
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';
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 agent staff list --machine' },
37
- { name: 'Add staff agent', value: 'add', command: 'prlt agent staff add --machine' },
38
- { name: 'Remove staff agent', value: 'remove', command: 'prlt agent staff remove --machine' },
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('agent staff', flags));
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 '../../../lib/agents/commands.js';
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 agent staff add"'));
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 agent staff add" to recreate'));
71
+ this.log(chalk.white(' Run "prlt staff add" to recreate'));
72
72
  }
73
73
  this.log(''); // Empty line between agents
74
74
  }
@@ -1,4 +1,4 @@
1
- import { PMOCommand } from '../../../lib/pmo/index.js';
1
+ import { PMOCommand } from '../../lib/pmo/index.js';
2
2
  export default class Remove extends PMOCommand {
3
3
  static description: string;
4
4
  static examples: string[];
@@ -1,9 +1,9 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import inquirer from 'inquirer';
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';
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('agent remove', flags));
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('agent staff remove', flags));
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('agent remove', flags));
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('agent remove', flags));
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 TemplatePhase extends Command {
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 TemplateTicket extends Command {
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
+ }