@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.
Files changed (173) hide show
  1. package/LICENSE +190 -21
  2. package/README.md +7 -7
  3. package/dist/commands/action/create.js +1 -1
  4. package/dist/commands/agent/{temp/cleanup.d.ts → cleanup.d.ts} +1 -1
  5. package/dist/commands/agent/{temp/cleanup.js → cleanup.js} +4 -4
  6. package/dist/commands/agent/index.js +8 -8
  7. package/dist/commands/branch/create.js +2 -2
  8. package/dist/commands/epic/create.d.ts +1 -0
  9. package/dist/commands/epic/create.js +39 -2
  10. package/dist/commands/epic/index.js +2 -2
  11. package/dist/commands/{epic/link/remove.d.ts → link/create.d.ts} +6 -7
  12. package/dist/commands/link/create.js +141 -0
  13. package/dist/commands/{epic/link/relates.d.ts → link/index.d.ts} +4 -5
  14. package/dist/commands/link/index.js +87 -0
  15. package/dist/commands/{epic/link/duplicates.d.ts → link/list.d.ts} +7 -4
  16. package/dist/commands/link/list.js +182 -0
  17. package/dist/commands/{spec/link → link}/remove.d.ts +4 -5
  18. package/dist/commands/link/remove.js +120 -0
  19. package/dist/commands/mcp-server.d.ts +22 -0
  20. package/dist/commands/mcp-server.js +98 -0
  21. package/dist/commands/phase/create.js +1 -1
  22. package/dist/commands/project/create.d.ts +1 -0
  23. package/dist/commands/project/create.js +38 -4
  24. package/dist/commands/spec/create.d.ts +1 -0
  25. package/dist/commands/spec/create.js +43 -2
  26. package/dist/commands/spec/index.js +2 -2
  27. package/dist/commands/{agent/staff → staff}/add.js +10 -10
  28. package/dist/commands/{agent/staff → staff}/index.d.ts +1 -1
  29. package/dist/commands/{agent/staff → staff}/index.js +7 -7
  30. package/dist/commands/{agent/staff → staff}/list.js +3 -3
  31. package/dist/commands/{agent/staff → staff}/remove.d.ts +1 -1
  32. package/dist/commands/{agent/staff → staff}/remove.js +8 -8
  33. package/dist/commands/{ticket/template → template}/apply.d.ts +8 -6
  34. package/dist/commands/template/apply.js +262 -0
  35. package/dist/commands/{ticket/template → template}/create.d.ts +5 -6
  36. package/dist/commands/template/create.js +238 -0
  37. package/dist/commands/template/index.js +48 -36
  38. package/dist/commands/{ticket/template → template}/save.d.ts +2 -2
  39. package/dist/commands/template/save.js +104 -0
  40. package/dist/commands/{phase/template → template}/update.d.ts +2 -2
  41. package/dist/commands/template/update.js +99 -0
  42. package/dist/commands/{agent/themes → theme}/add-names.d.ts +1 -1
  43. package/dist/commands/{agent/themes → theme}/add-names.js +6 -6
  44. package/dist/commands/{agent/themes → theme}/create.d.ts +1 -1
  45. package/dist/commands/{agent/themes → theme}/create.js +5 -5
  46. package/dist/commands/{agent/themes → theme}/index.d.ts +1 -1
  47. package/dist/commands/{agent/themes → theme}/index.js +10 -10
  48. package/dist/commands/{agent/themes → theme}/list.d.ts +1 -1
  49. package/dist/commands/{agent/themes → theme}/list.js +5 -5
  50. package/dist/commands/{agent/themes → theme}/set.d.ts +1 -1
  51. package/dist/commands/{agent/themes → theme}/set.js +7 -7
  52. package/dist/commands/ticket/create.d.ts +1 -0
  53. package/dist/commands/ticket/create.js +54 -2
  54. package/dist/commands/ticket/index.js +6 -6
  55. package/dist/commands/work/spawn.js +1 -1
  56. package/dist/lib/mcp/helpers.d.ts +43 -0
  57. package/dist/lib/mcp/helpers.js +57 -0
  58. package/dist/lib/mcp/index.d.ts +6 -0
  59. package/dist/lib/mcp/index.js +6 -0
  60. package/dist/lib/mcp/tools/action.d.ts +6 -0
  61. package/dist/lib/mcp/tools/action.js +88 -0
  62. package/dist/lib/mcp/tools/board.d.ts +6 -0
  63. package/dist/lib/mcp/tools/board.js +139 -0
  64. package/dist/lib/mcp/tools/category.d.ts +6 -0
  65. package/dist/lib/mcp/tools/category.js +84 -0
  66. package/dist/lib/mcp/tools/cli-passthrough.d.ts +15 -0
  67. package/dist/lib/mcp/tools/cli-passthrough.js +333 -0
  68. package/dist/lib/mcp/tools/epic.d.ts +6 -0
  69. package/dist/lib/mcp/tools/epic.js +178 -0
  70. package/dist/lib/mcp/tools/index.d.ts +18 -0
  71. package/dist/lib/mcp/tools/index.js +19 -0
  72. package/dist/lib/mcp/tools/phase.d.ts +6 -0
  73. package/dist/lib/mcp/tools/phase.js +131 -0
  74. package/dist/lib/mcp/tools/project.d.ts +6 -0
  75. package/dist/lib/mcp/tools/project.js +196 -0
  76. package/dist/lib/mcp/tools/roadmap.d.ts +6 -0
  77. package/dist/lib/mcp/tools/roadmap.js +123 -0
  78. package/dist/lib/mcp/tools/spec.d.ts +6 -0
  79. package/dist/lib/mcp/tools/spec.js +196 -0
  80. package/dist/lib/mcp/tools/status.d.ts +6 -0
  81. package/dist/lib/mcp/tools/status.js +109 -0
  82. package/dist/lib/mcp/tools/template.d.ts +6 -0
  83. package/dist/lib/mcp/tools/template.js +107 -0
  84. package/dist/lib/mcp/tools/ticket.d.ts +6 -0
  85. package/dist/lib/mcp/tools/ticket.js +393 -0
  86. package/dist/lib/mcp/tools/view.d.ts +6 -0
  87. package/dist/lib/mcp/tools/view.js +76 -0
  88. package/dist/lib/mcp/tools/work.d.ts +6 -0
  89. package/dist/lib/mcp/tools/work.js +132 -0
  90. package/dist/lib/mcp/tools/workflow.d.ts +6 -0
  91. package/dist/lib/mcp/tools/workflow.js +95 -0
  92. package/dist/lib/mcp/types.d.ts +17 -0
  93. package/dist/lib/mcp/types.js +4 -0
  94. package/dist/lib/prompt-json.d.ts +52 -1
  95. package/dist/lib/prompt-json.js +45 -0
  96. package/oclif.manifest.json +3553 -5457
  97. package/package.json +10 -7
  98. package/dist/commands/agent/temp/index.d.ts +0 -14
  99. package/dist/commands/agent/temp/index.js +0 -85
  100. package/dist/commands/agent/temp/list.d.ts +0 -7
  101. package/dist/commands/agent/temp/list.js +0 -108
  102. package/dist/commands/epic/link/block.d.ts +0 -14
  103. package/dist/commands/epic/link/block.js +0 -81
  104. package/dist/commands/epic/link/duplicates.js +0 -68
  105. package/dist/commands/epic/link/index.d.ts +0 -19
  106. package/dist/commands/epic/link/index.js +0 -272
  107. package/dist/commands/epic/link/relates.js +0 -68
  108. package/dist/commands/epic/link/remove.js +0 -93
  109. package/dist/commands/phase/template/apply.d.ts +0 -17
  110. package/dist/commands/phase/template/apply.js +0 -108
  111. package/dist/commands/phase/template/create.d.ts +0 -17
  112. package/dist/commands/phase/template/create.js +0 -104
  113. package/dist/commands/phase/template/delete.d.ts +0 -17
  114. package/dist/commands/phase/template/delete.js +0 -100
  115. package/dist/commands/phase/template/index.d.ts +0 -15
  116. package/dist/commands/phase/template/index.js +0 -130
  117. package/dist/commands/phase/template/list.d.ts +0 -16
  118. package/dist/commands/phase/template/list.js +0 -97
  119. package/dist/commands/phase/template/update.js +0 -89
  120. package/dist/commands/spec/link/depends.d.ts +0 -14
  121. package/dist/commands/spec/link/depends.js +0 -64
  122. package/dist/commands/spec/link/duplicates.d.ts +0 -14
  123. package/dist/commands/spec/link/duplicates.js +0 -63
  124. package/dist/commands/spec/link/index.d.ts +0 -19
  125. package/dist/commands/spec/link/index.js +0 -207
  126. package/dist/commands/spec/link/relates.d.ts +0 -14
  127. package/dist/commands/spec/link/relates.js +0 -63
  128. package/dist/commands/spec/link/remove.js +0 -96
  129. package/dist/commands/template/phase/apply.d.ts +0 -14
  130. package/dist/commands/template/phase/apply.js +0 -43
  131. package/dist/commands/template/phase/create.d.ts +0 -13
  132. package/dist/commands/template/phase/create.js +0 -38
  133. package/dist/commands/template/phase/delete.d.ts +0 -13
  134. package/dist/commands/template/phase/delete.js +0 -36
  135. package/dist/commands/template/phase/index.d.ts +0 -10
  136. package/dist/commands/template/phase/index.js +0 -63
  137. package/dist/commands/template/phase/list.d.ts +0 -11
  138. package/dist/commands/template/phase/list.js +0 -36
  139. package/dist/commands/template/phase/update.d.ts +0 -14
  140. package/dist/commands/template/phase/update.js +0 -43
  141. package/dist/commands/template/ticket/apply.d.ts +0 -17
  142. package/dist/commands/template/ticket/apply.js +0 -60
  143. package/dist/commands/template/ticket/create.d.ts +0 -20
  144. package/dist/commands/template/ticket/create.js +0 -89
  145. package/dist/commands/template/ticket/delete.d.ts +0 -13
  146. package/dist/commands/template/ticket/delete.js +0 -38
  147. package/dist/commands/template/ticket/index.d.ts +0 -10
  148. package/dist/commands/template/ticket/index.js +0 -63
  149. package/dist/commands/template/ticket/list.d.ts +0 -11
  150. package/dist/commands/template/ticket/list.js +0 -36
  151. package/dist/commands/template/ticket/save.d.ts +0 -15
  152. package/dist/commands/template/ticket/save.js +0 -46
  153. package/dist/commands/ticket/link/block.d.ts +0 -14
  154. package/dist/commands/ticket/link/block.js +0 -96
  155. package/dist/commands/ticket/link/duplicates.d.ts +0 -14
  156. package/dist/commands/ticket/link/duplicates.js +0 -95
  157. package/dist/commands/ticket/link/index.d.ts +0 -19
  158. package/dist/commands/ticket/link/index.js +0 -256
  159. package/dist/commands/ticket/link/relates.d.ts +0 -14
  160. package/dist/commands/ticket/link/relates.js +0 -95
  161. package/dist/commands/ticket/link/remove.d.ts +0 -16
  162. package/dist/commands/ticket/link/remove.js +0 -132
  163. package/dist/commands/ticket/template/apply.js +0 -252
  164. package/dist/commands/ticket/template/create.js +0 -386
  165. package/dist/commands/ticket/template/delete.d.ts +0 -17
  166. package/dist/commands/ticket/template/delete.js +0 -94
  167. package/dist/commands/ticket/template/index.d.ts +0 -15
  168. package/dist/commands/ticket/template/index.js +0 -120
  169. package/dist/commands/ticket/template/list.d.ts +0 -16
  170. package/dist/commands/ticket/template/list.js +0 -112
  171. package/dist/commands/ticket/template/save.js +0 -163
  172. /package/dist/commands/{agent/staff → staff}/add.d.ts +0 -0
  173. /package/dist/commands/{agent/staff → staff}/list.d.ts +0 -0
@@ -1,14 +1,13 @@
1
- import { PMOCommand } from '../../../lib/pmo/index.js';
2
- export default class EpicLinkRelates extends PMOCommand {
1
+ import { PMOCommand } from '../../lib/pmo/index.js';
2
+ export default class Link extends PMOCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static args: {
6
- id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
- target: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
6
+ action: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
8
7
  };
9
8
  static flags: {
10
- project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
9
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
11
  };
13
12
  execute(): Promise<void>;
14
13
  }
@@ -0,0 +1,87 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import inquirer from 'inquirer';
3
+ import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
4
+ import { styles } from '../../lib/styles.js';
5
+ import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
6
+ export default class Link extends PMOCommand {
7
+ static description = 'Manage links (dependencies) between entities';
8
+ static examples = [
9
+ '<%= config.bin %> <%= command.id %> create TKT-001 TKT-002 --type blocks',
10
+ '<%= config.bin %> <%= command.id %> list TKT-001',
11
+ '<%= config.bin %> <%= command.id %> remove TKT-001 TKT-002',
12
+ ];
13
+ static args = {
14
+ action: Args.string({
15
+ description: 'Action to perform',
16
+ options: ['create', 'list', 'remove'],
17
+ required: false,
18
+ }),
19
+ };
20
+ static flags = {
21
+ ...pmoBaseFlags,
22
+ json: Flags.boolean({
23
+ char: 'm',
24
+ aliases: ['machine'],
25
+ description: 'Output prompt configuration as JSON (for AI agents/scripts)',
26
+ default: false,
27
+ }),
28
+ };
29
+ async execute() {
30
+ const { args, flags } = await this.parse(Link);
31
+ const jsonMode = shouldOutputJson(flags);
32
+ let action = args.action;
33
+ if (!action) {
34
+ const menuChoices = [
35
+ { name: 'Create a new link', value: 'create', command: 'prlt link create --help' },
36
+ { name: 'List links for an entity', value: 'list', command: 'prlt link list --help' },
37
+ { name: 'Remove a link', value: 'remove', command: 'prlt link remove --help' },
38
+ { name: 'Cancel', value: 'cancel', command: '' },
39
+ ];
40
+ const message = 'What would you like to do?';
41
+ if (jsonMode) {
42
+ outputPromptAsJson(buildPromptConfig('list', 'action', message, menuChoices), createMetadata('link', flags));
43
+ return;
44
+ }
45
+ const { selected } = await inquirer.prompt([{
46
+ type: 'list',
47
+ name: 'selected',
48
+ message,
49
+ choices: [
50
+ ...menuChoices.slice(0, 3).map(c => ({ name: c.name, value: c.value })),
51
+ new inquirer.Separator(),
52
+ { name: menuChoices[3].name, value: menuChoices[3].value }
53
+ ]
54
+ }]);
55
+ if (selected === 'cancel') {
56
+ this.log(styles.muted('\nCancelled.'));
57
+ return;
58
+ }
59
+ action = selected;
60
+ }
61
+ // Show help for the selected action
62
+ this.log(styles.muted(`\nUsage:`));
63
+ switch (action) {
64
+ case 'create':
65
+ this.log(' prlt link create <from> <to> --type <blocks|relates|duplicates|depends>');
66
+ this.log('');
67
+ this.log('Examples:');
68
+ this.log(' prlt link create TKT-001 TKT-002 --type blocks # TKT-001 is blocked by TKT-002');
69
+ this.log(' prlt link create SPEC-001 SPEC-002 --type depends # SPEC-001 depends on SPEC-002');
70
+ break;
71
+ case 'list':
72
+ this.log(' prlt link list <entity-id>');
73
+ this.log('');
74
+ this.log('Examples:');
75
+ this.log(' prlt link list TKT-001 # List links for ticket');
76
+ this.log(' prlt link list SPEC-001 --all # Include reverse links');
77
+ break;
78
+ case 'remove':
79
+ this.log(' prlt link remove <from> <to>');
80
+ this.log('');
81
+ this.log('Examples:');
82
+ this.log(' prlt link remove TKT-001 TKT-002');
83
+ this.log(' prlt link remove SPEC-001 SPEC-002 --type depends');
84
+ break;
85
+ }
86
+ }
87
+ }
@@ -1,14 +1,17 @@
1
- import { PMOCommand } from '../../../lib/pmo/index.js';
2
- export default class EpicLinkDuplicates extends PMOCommand {
1
+ import { PMOCommand } from '../../lib/pmo/index.js';
2
+ export default class LinkList extends PMOCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static args: {
6
6
  id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
- original: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
8
7
  };
9
8
  static flags: {
10
- project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
10
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  };
13
13
  execute(): Promise<void>;
14
+ private listTicketLinks;
15
+ private listSpecLinks;
16
+ private listEpicLinks;
14
17
  }
@@ -0,0 +1,182 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
3
+ import { styles } from '../../lib/styles.js';
4
+ import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
5
+ /**
6
+ * Infer entity type from ID prefix
7
+ */
8
+ function inferEntityType(id) {
9
+ const upper = id.toUpperCase();
10
+ if (upper.startsWith('TKT-'))
11
+ return 'ticket';
12
+ if (upper.startsWith('SPEC-'))
13
+ return 'spec';
14
+ if (upper.startsWith('EPIC-'))
15
+ return 'epic';
16
+ return null;
17
+ }
18
+ export default class LinkList extends PMOCommand {
19
+ static description = 'List all links (dependencies) for an entity';
20
+ static examples = [
21
+ '<%= config.bin %> <%= command.id %> TKT-001 # List ticket links',
22
+ '<%= config.bin %> <%= command.id %> SPEC-001 # List spec links',
23
+ '<%= config.bin %> <%= command.id %> EPIC-001 # List epic links',
24
+ '<%= config.bin %> <%= command.id %> TKT-001 --all # Include reverse links',
25
+ ];
26
+ static args = {
27
+ id: Args.string({
28
+ description: 'Entity ID (TKT-xxx, SPEC-xxx, or EPIC-xxx)',
29
+ required: true,
30
+ }),
31
+ };
32
+ static flags = {
33
+ ...pmoBaseFlags,
34
+ all: Flags.boolean({
35
+ char: 'a',
36
+ description: 'Show all links including reverse dependencies (what blocks this, what this blocks)',
37
+ default: false,
38
+ }),
39
+ json: Flags.boolean({
40
+ char: 'm',
41
+ aliases: ['machine'],
42
+ description: 'Output as JSON for AI agents/scripts',
43
+ default: false,
44
+ }),
45
+ };
46
+ async execute() {
47
+ const { args, flags } = await this.parse(LinkList);
48
+ const jsonMode = shouldOutputJson(flags);
49
+ const handleError = (code, message) => {
50
+ if (jsonMode) {
51
+ outputErrorAsJson(code, message, createMetadata('link list', flags));
52
+ this.exit(1);
53
+ }
54
+ this.error(message);
55
+ };
56
+ const entityType = inferEntityType(args.id);
57
+ if (!entityType) {
58
+ return handleError('INVALID_ID', `Cannot infer entity type from "${args.id}". Use TKT-, SPEC-, or EPIC- prefix.`);
59
+ }
60
+ if (entityType === 'ticket') {
61
+ await this.listTicketLinks(args.id, flags.all);
62
+ }
63
+ else if (entityType === 'spec') {
64
+ await this.listSpecLinks(args.id, flags.all);
65
+ }
66
+ else if (entityType === 'epic') {
67
+ await this.listEpicLinks(args.id, flags.all);
68
+ }
69
+ }
70
+ async listTicketLinks(ticketId, showAll) {
71
+ const ticket = await this.storage.getTicket(ticketId);
72
+ if (!ticket) {
73
+ this.error(`Ticket not found: ${ticketId}`);
74
+ }
75
+ const dependencies = await this.storage.listTicketDependencies(ticketId);
76
+ const blockers = await this.storage.getTicketBlockers(ticketId);
77
+ const isBlocked = await this.storage.isTicketBlocked(ticketId);
78
+ this.log(`\n${styles.emphasis(ticket.id)}: ${ticket.title}`);
79
+ if (isBlocked) {
80
+ this.log(styles.warning(' Status: BLOCKED'));
81
+ }
82
+ if (blockers.length > 0) {
83
+ this.log(styles.muted('\n Blocked by:'));
84
+ for (const blocker of blockers) {
85
+ const status = blocker.status === 'done' ? styles.success('done') : styles.warning(blocker.status);
86
+ this.log(` - ${blocker.id}: ${blocker.title} (${status})`);
87
+ }
88
+ }
89
+ const otherDeps = dependencies.filter(d => d.dependencyType !== 'blocks');
90
+ if (otherDeps.length > 0) {
91
+ this.log(styles.muted('\n Related:'));
92
+ const relatedTickets = await Promise.all(otherDeps.map(async (dep) => ({
93
+ dep,
94
+ ticket: await this.storage.getTicket(dep.dependsOnTicketId)
95
+ })));
96
+ for (const { dep, ticket: relatedTicket } of relatedTickets) {
97
+ if (relatedTicket) {
98
+ this.log(` - ${dep.dependencyType}: ${relatedTicket.id} - ${relatedTicket.title}`);
99
+ }
100
+ }
101
+ }
102
+ if (showAll) {
103
+ const blockedBy = await this.storage.getTicketsBlockedBy(ticketId);
104
+ if (blockedBy.length > 0) {
105
+ this.log(styles.muted('\n Blocking:'));
106
+ for (const blocked of blockedBy) {
107
+ this.log(` - ${blocked.id}: ${blocked.title} (${blocked.status})`);
108
+ }
109
+ }
110
+ }
111
+ if (dependencies.length === 0 && blockers.length === 0) {
112
+ this.log(styles.muted('\n No links.'));
113
+ }
114
+ this.log('');
115
+ }
116
+ async listSpecLinks(specId, showAll) {
117
+ const spec = await this.storage.getSpec(specId);
118
+ if (!spec) {
119
+ this.error(`Spec not found: ${specId}`);
120
+ }
121
+ const dependencies = await this.storage.listSpecDependencies(specId);
122
+ this.log(`\n${styles.emphasis(spec.id)}: ${spec.title}`);
123
+ if (dependencies.length === 0) {
124
+ this.log(styles.muted('\n No links.'));
125
+ this.log('');
126
+ return;
127
+ }
128
+ // Group by type
129
+ const byType = {};
130
+ for (const dep of dependencies) {
131
+ if (!byType[dep.dependencyType])
132
+ byType[dep.dependencyType] = [];
133
+ byType[dep.dependencyType].push(dep);
134
+ }
135
+ for (const [depType, deps] of Object.entries(byType)) {
136
+ this.log(styles.muted(`\n ${depType}:`));
137
+ for (const dep of deps) {
138
+ const targetSpec = await this.storage.getSpec(dep.dependsOnSpecId);
139
+ if (targetSpec) {
140
+ this.log(` - ${targetSpec.id}: ${targetSpec.title}`);
141
+ }
142
+ }
143
+ }
144
+ this.log('');
145
+ }
146
+ async listEpicLinks(epicId, showAll) {
147
+ const epic = await this.storage.getEpic(epicId);
148
+ if (!epic) {
149
+ this.error(`Epic not found: ${epicId}`);
150
+ }
151
+ const dependencies = await this.storage.listEpicDependencies(epicId);
152
+ this.log(`\n${styles.emphasis(epic.id)}: ${epic.title}`);
153
+ // Show blocking dependencies
154
+ const blockingDeps = dependencies.filter(d => d.dependencyType === 'blocks');
155
+ if (blockingDeps.length > 0) {
156
+ this.log(styles.muted('\n Blocked by:'));
157
+ for (const dep of blockingDeps) {
158
+ const blocker = await this.storage.getEpic(dep.dependsOnEpicId);
159
+ if (blocker) {
160
+ const status = blocker.status === 'complete' ? styles.success('done') : styles.warning(blocker.status);
161
+ this.log(` - ${blocker.id}: ${blocker.title} (${status})`);
162
+ }
163
+ }
164
+ }
165
+ const otherDeps = dependencies.filter(d => d.dependencyType !== 'blocks');
166
+ if (otherDeps.length > 0) {
167
+ this.log(styles.muted('\n Related:'));
168
+ for (const dep of otherDeps) {
169
+ const targetEpic = await this.storage.getEpic(dep.dependsOnEpicId);
170
+ if (targetEpic) {
171
+ this.log(` - ${dep.dependencyType}: ${targetEpic.id} - ${targetEpic.title}`);
172
+ }
173
+ }
174
+ }
175
+ // Note: showAll would show reverse dependencies, but we don't have getEpicsBlockedBy
176
+ // For now, we just show the epic's own dependencies
177
+ if (dependencies.length === 0) {
178
+ this.log(styles.muted('\n No links.'));
179
+ }
180
+ this.log('');
181
+ }
182
+ }
@@ -1,14 +1,13 @@
1
- import { PMOCommand } from '../../../lib/pmo/index.js';
2
- export default class SpecLinkRemove extends PMOCommand {
1
+ import { PMOCommand } from '../../lib/pmo/index.js';
2
+ export default class LinkRemove extends PMOCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static args: {
6
- id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
- target: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
6
+ from: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ to: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
8
  };
9
9
  static flags: {
10
10
  type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
11
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
12
  project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
13
  };
@@ -0,0 +1,120 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { autoExportToBoard, PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
3
+ import { styles } from '../../lib/styles.js';
4
+ import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
5
+ /**
6
+ * Infer entity type from ID prefix
7
+ */
8
+ function inferEntityType(id) {
9
+ const upper = id.toUpperCase();
10
+ if (upper.startsWith('TKT-'))
11
+ return 'ticket';
12
+ if (upper.startsWith('SPEC-'))
13
+ return 'spec';
14
+ if (upper.startsWith('EPIC-'))
15
+ return 'epic';
16
+ return null;
17
+ }
18
+ export default class LinkRemove extends PMOCommand {
19
+ static description = 'Remove a link (dependency) between two entities';
20
+ static examples = [
21
+ '<%= config.bin %> <%= command.id %> TKT-001 TKT-002 # Remove link between tickets',
22
+ '<%= config.bin %> <%= command.id %> SPEC-001 SPEC-002 # Remove link between specs',
23
+ '<%= config.bin %> <%= command.id %> EPIC-001 EPIC-002 # Remove link between epics',
24
+ ];
25
+ static args = {
26
+ from: Args.string({
27
+ description: 'Source entity ID (TKT-xxx, SPEC-xxx, or EPIC-xxx)',
28
+ required: true,
29
+ }),
30
+ to: Args.string({
31
+ description: 'Target entity ID',
32
+ required: true,
33
+ }),
34
+ };
35
+ static flags = {
36
+ ...pmoBaseFlags,
37
+ type: Flags.string({
38
+ char: 't',
39
+ description: 'Link type to remove (if not specified, removes any link)',
40
+ options: ['blocks', 'relates', 'duplicates', 'depends'],
41
+ }),
42
+ json: Flags.boolean({
43
+ char: 'm',
44
+ aliases: ['machine'],
45
+ description: 'Output prompt configuration as JSON (for AI agents/scripts)',
46
+ default: false,
47
+ }),
48
+ };
49
+ async execute() {
50
+ const { args, flags } = await this.parse(LinkRemove);
51
+ const jsonMode = shouldOutputJson(flags);
52
+ const handleError = (code, message) => {
53
+ if (jsonMode) {
54
+ outputErrorAsJson(code, message, createMetadata('link remove', flags));
55
+ this.exit(1);
56
+ }
57
+ this.error(message);
58
+ };
59
+ const fromType = inferEntityType(args.from);
60
+ const toType = inferEntityType(args.to);
61
+ if (!fromType) {
62
+ return handleError('INVALID_FROM_ID', `Cannot infer entity type from "${args.from}". Use TKT-, SPEC-, or EPIC- prefix.`);
63
+ }
64
+ if (!toType) {
65
+ return handleError('INVALID_TO_ID', `Cannot infer entity type from "${args.to}". Use TKT-, SPEC-, or EPIC- prefix.`);
66
+ }
67
+ if (fromType !== toType) {
68
+ return handleError('TYPE_MISMATCH', `Cannot link different entity types: ${fromType} and ${toType}`);
69
+ }
70
+ // Map the link type to the storage dependency type
71
+ const linkType = flags.type;
72
+ const dependencyType = linkType === 'relates' ? 'relates_to' :
73
+ linkType === 'depends' ? 'depends_on' : linkType;
74
+ try {
75
+ if (fromType === 'ticket') {
76
+ const ticket = await this.storage.getTicket(args.from);
77
+ if (!ticket)
78
+ return handleError('FROM_NOT_FOUND', `Ticket not found: ${args.from}`);
79
+ const targetTicket = await this.storage.getTicket(args.to);
80
+ if (!targetTicket)
81
+ return handleError('TO_NOT_FOUND', `Ticket not found: ${args.to}`);
82
+ await this.storage.deleteTicketDependency(args.from, args.to, dependencyType);
83
+ await autoExportToBoard(this.pmoPath, this.storage, (msg) => this.log(styles.muted(msg)));
84
+ this.log(styles.success(`\n✅ Link removed: ${styles.emphasis(args.from)} → ${styles.emphasis(args.to)}`));
85
+ this.log(styles.muted(` ${ticket.title} no longer linked to ${targetTicket.title}`));
86
+ }
87
+ else if (fromType === 'spec') {
88
+ const spec = await this.storage.getSpec(args.from);
89
+ if (!spec)
90
+ return handleError('FROM_NOT_FOUND', `Spec not found: ${args.from}`);
91
+ const targetSpec = await this.storage.getSpec(args.to);
92
+ if (!targetSpec)
93
+ return handleError('TO_NOT_FOUND', `Spec not found: ${args.to}`);
94
+ await this.storage.deleteSpecDependency(args.from, args.to, dependencyType);
95
+ this.log(styles.success(`\n✅ Link removed: ${styles.emphasis(args.from)} → ${styles.emphasis(args.to)}`));
96
+ this.log(styles.muted(` ${spec.title} no longer linked to ${targetSpec.title}`));
97
+ }
98
+ else if (fromType === 'epic') {
99
+ const epic = await this.storage.getEpic(args.from);
100
+ if (!epic)
101
+ return handleError('FROM_NOT_FOUND', `Epic not found: ${args.from}`);
102
+ const targetEpic = await this.storage.getEpic(args.to);
103
+ if (!targetEpic)
104
+ return handleError('TO_NOT_FOUND', `Epic not found: ${args.to}`);
105
+ await this.storage.deleteEpicDependency(args.from, args.to, dependencyType);
106
+ await autoExportToBoard(this.pmoPath, this.storage, (msg) => this.log(styles.muted(msg)));
107
+ this.log(styles.success(`\n✅ Link removed: ${styles.emphasis(args.from)} → ${styles.emphasis(args.to)}`));
108
+ this.log(styles.muted(` ${epic.title} no longer linked to ${targetEpic.title}`));
109
+ }
110
+ }
111
+ catch (error) {
112
+ if (error instanceof Error) {
113
+ if (error.message.includes('not found')) {
114
+ return handleError('LINK_NOT_FOUND', 'Link not found');
115
+ }
116
+ }
117
+ throw error;
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * MCP Server Command
3
+ *
4
+ * Comprehensive MCP (Model Context Protocol) server exposing ALL prlt commands
5
+ * as tools for AI agent integration.
6
+ *
7
+ * Usage in Claude Code config:
8
+ * ```json
9
+ * {
10
+ * "mcpServers": {
11
+ * "prlt": { "command": "prlt", "args": ["mcp-server"] }
12
+ * }
13
+ * }
14
+ * ```
15
+ */
16
+ import { Command } from '@oclif/core';
17
+ export default class McpServerCommand extends Command {
18
+ static description: string;
19
+ static hidden: boolean;
20
+ static examples: string[];
21
+ run(): Promise<void>;
22
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * MCP Server Command
3
+ *
4
+ * Comprehensive MCP (Model Context Protocol) server exposing ALL prlt commands
5
+ * as tools for AI agent integration.
6
+ *
7
+ * Usage in Claude Code config:
8
+ * ```json
9
+ * {
10
+ * "mcpServers": {
11
+ * "prlt": { "command": "prlt", "args": ["mcp-server"] }
12
+ * }
13
+ * }
14
+ * ```
15
+ */
16
+ import { Command } from '@oclif/core';
17
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
18
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
19
+ import { execSync } from 'node:child_process';
20
+ import * as path from 'node:path';
21
+ import { getPMOContext } from '../lib/pmo/pmo-context.js';
22
+ import { registerTicketTools, registerProjectTools, registerBoardTools, registerSpecTools, registerEpicTools, registerWorkTools, registerWorkflowTools, registerStatusTools, registerPhaseTools, registerActionTools, registerRoadmapTools, registerCategoryTools, registerTemplateTools, registerViewTools, registerAgentTools, registerDockerTools, registerRepoTools, registerBranchTools, registerGitHubTools, registerInitTools, registerUtilityTools, } from '../lib/mcp/index.js';
23
+ export default class McpServerCommand extends Command {
24
+ static description = 'Start MCP server for AI agent integration (exposes all prlt commands as tools)';
25
+ static hidden = true;
26
+ static examples = ['<%= config.bin %> mcp-server'];
27
+ async run() {
28
+ // Initialize PMO context (may be null if not in a workspace)
29
+ let pmoContext = null;
30
+ try {
31
+ pmoContext = await getPMOContext({ logger: () => { } });
32
+ }
33
+ catch {
34
+ pmoContext = null;
35
+ }
36
+ // Create MCP server
37
+ const server = new McpServer({
38
+ name: 'prlt',
39
+ version: this.config.version,
40
+ });
41
+ // Create tool context
42
+ const ctx = {
43
+ get storage() {
44
+ if (!pmoContext) {
45
+ throw new Error('PMO not initialized. Run "prlt init" first.');
46
+ }
47
+ return pmoContext.storage;
48
+ },
49
+ runCommand: (cmd) => {
50
+ try {
51
+ const result = execSync(cmd, {
52
+ encoding: 'utf-8',
53
+ cwd: process.cwd(),
54
+ env: {
55
+ ...process.env,
56
+ PATH: `${path.dirname(process.execPath)}:${process.env.PATH}`,
57
+ },
58
+ maxBuffer: 10 * 1024 * 1024,
59
+ });
60
+ return result.trim();
61
+ }
62
+ catch (error) {
63
+ const execError = error;
64
+ if (execError.stderr)
65
+ return execError.stderr.trim();
66
+ if (execError.stdout)
67
+ return execError.stdout.trim();
68
+ throw error;
69
+ }
70
+ },
71
+ };
72
+ // Register all tool categories
73
+ registerTicketTools(server, ctx);
74
+ registerProjectTools(server, ctx);
75
+ registerBoardTools(server, ctx);
76
+ registerSpecTools(server, ctx);
77
+ registerEpicTools(server, ctx);
78
+ registerWorkTools(server, ctx);
79
+ registerWorkflowTools(server, ctx);
80
+ registerStatusTools(server, ctx);
81
+ registerPhaseTools(server, ctx);
82
+ registerActionTools(server, ctx);
83
+ registerRoadmapTools(server, ctx);
84
+ registerCategoryTools(server, ctx);
85
+ registerTemplateTools(server, ctx);
86
+ registerViewTools(server, ctx);
87
+ registerAgentTools(server, ctx);
88
+ registerDockerTools(server, ctx);
89
+ registerRepoTools(server, ctx);
90
+ registerBranchTools(server, ctx);
91
+ registerGitHubTools(server, ctx);
92
+ registerInitTools(server, ctx);
93
+ registerUtilityTools(server, ctx);
94
+ // Connect via stdio transport
95
+ const transport = new StdioServerTransport();
96
+ await server.connect(transport);
97
+ }
98
+ }
@@ -21,7 +21,7 @@ export default class PhaseCreate extends PMOCommand {
21
21
  ...pmoBaseFlags,
22
22
  category: Flags.string({
23
23
  char: 'c',
24
- description: 'State category',
24
+ description: 'State category [required for non-interactive]',
25
25
  options: ['backlog', 'unstarted', 'started', 'completed', 'canceled'],
26
26
  }),
27
27
  color: Flags.string({
@@ -11,6 +11,7 @@ export default class ProjectCreate extends PMOCommand {
11
11
  description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  template: import("@oclif/core/interfaces").OptionFlag<string, 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
  };