ralphctl 0.4.6 → 0.6.0

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 (58) hide show
  1. package/README.md +29 -16
  2. package/dist/absolute-path-WUTZQ37D.mjs +8 -0
  3. package/dist/chunk-6RDMCLWU.mjs +108 -0
  4. package/dist/chunk-HIU74KTO.mjs +1046 -0
  5. package/dist/chunk-S3PTDH57.mjs +78 -0
  6. package/dist/chunk-WV4D2CPG.mjs +26 -0
  7. package/dist/cli.mjs +22413 -717
  8. package/dist/manifest.json +24 -0
  9. package/dist/prompt-adapter-JQICGVX7.mjs +7 -0
  10. package/dist/prompts/ideate.md +3 -1
  11. package/dist/prompts/plan-auto.md +23 -8
  12. package/dist/prompts/plan-common-examples.md +3 -3
  13. package/dist/prompts/plan-common.md +6 -5
  14. package/dist/prompts/plan-interactive.md +30 -7
  15. package/dist/prompts/repo-onboard.md +154 -64
  16. package/dist/prompts/signals-task.md +3 -0
  17. package/dist/prompts/sprint-feedback.md +3 -0
  18. package/dist/prompts/task-evaluation.md +74 -53
  19. package/dist/prompts/task-execution.md +65 -21
  20. package/dist/prompts/ticket-refine.md +11 -8
  21. package/dist/prompts/validation-checklist.md +3 -2
  22. package/dist/skills/default/abstraction-first/SKILL.md +45 -0
  23. package/dist/skills/default/alignment/SKILL.md +46 -0
  24. package/dist/skills/default/iterative-review/SKILL.md +48 -0
  25. package/dist/skills/exec/.gitkeep +0 -0
  26. package/dist/skills/plan/.gitkeep +0 -0
  27. package/dist/skills/refine/.gitkeep +0 -0
  28. package/dist/storage-paths-IPNZZM5D.mjs +15 -0
  29. package/dist/validation-error-QT6Q7FYU.mjs +7 -0
  30. package/package.json +9 -4
  31. package/dist/add-DVPVHENV.mjs +0 -18
  32. package/dist/add-YVXM34RP.mjs +0 -17
  33. package/dist/bootstrap-FMHG6DRY.mjs +0 -11
  34. package/dist/chunk-747KW2RW.mjs +0 -24
  35. package/dist/chunk-B3RCOHW3.mjs +0 -5519
  36. package/dist/chunk-BSB4EDGR.mjs +0 -260
  37. package/dist/chunk-CBMFRQ4Y.mjs +0 -441
  38. package/dist/chunk-CFUVE2BP.mjs +0 -16
  39. package/dist/chunk-FNAAA32W.mjs +0 -103
  40. package/dist/chunk-GQ2WFKBN.mjs +0 -269
  41. package/dist/chunk-IWXBJD2D.mjs +0 -27
  42. package/dist/chunk-O566EEDL.mjs +0 -5542
  43. package/dist/chunk-OGEXYSFS.mjs +0 -228
  44. package/dist/chunk-PYZEQ2VK.mjs +0 -787
  45. package/dist/chunk-VAZ3LJBI.mjs +0 -179
  46. package/dist/chunk-WDMLPXOD.mjs +0 -363
  47. package/dist/chunk-XN2UIHBY.mjs +0 -589
  48. package/dist/chunk-ZLWSPLWI.mjs +0 -1117
  49. package/dist/create-Z635FQKO.mjs +0 -15
  50. package/dist/handle-23EFF3BE.mjs +0 -22
  51. package/dist/mount-B3MLHNVY.mjs +0 -7434
  52. package/dist/project-DQHF4ISP.mjs +0 -34
  53. package/dist/prompts/check-script-discover.md +0 -69
  54. package/dist/prompts/ideate-auto.md +0 -195
  55. package/dist/prompts/task-evaluation-resume.md +0 -41
  56. package/dist/resolver-OVPYVW6Q.mjs +0 -163
  57. package/dist/sprint-4E26AB5F.mjs +0 -38
  58. package/dist/start-FP7MVN5P.mjs +0 -19
@@ -1,228 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- addTicket,
4
- fetchIssueFromUrl,
5
- truncate
6
- } from "./chunk-GQ2WFKBN.mjs";
7
- import {
8
- EXIT_ERROR,
9
- exitWithCode
10
- } from "./chunk-CFUVE2BP.mjs";
11
- import {
12
- getPrompt
13
- } from "./chunk-747KW2RW.mjs";
14
- import {
15
- getProjectById
16
- } from "./chunk-BSB4EDGR.mjs";
17
- import {
18
- getCurrentSprintOrThrow
19
- } from "./chunk-CBMFRQ4Y.mjs";
20
- import {
21
- createSpinner,
22
- emoji,
23
- error,
24
- field,
25
- fieldMultiline,
26
- icons,
27
- log,
28
- renderCard,
29
- showError,
30
- showSuccess,
31
- showWarning
32
- } from "./chunk-XN2UIHBY.mjs";
33
- import {
34
- ensureError,
35
- wrapAsync
36
- } from "./chunk-IWXBJD2D.mjs";
37
- import {
38
- IOError,
39
- SprintStatusError
40
- } from "./chunk-VAZ3LJBI.mjs";
41
-
42
- // src/integration/cli/commands/ticket/add.ts
43
- import { Result as Result2 } from "typescript-result";
44
-
45
- // src/integration/ui/prompts/editor-input.ts
46
- import { Result } from "typescript-result";
47
- async function editorInput(options) {
48
- try {
49
- const result = await getPrompt().editor({
50
- message: options.message,
51
- default: options.default,
52
- kind: "markdown"
53
- });
54
- if (result === null) {
55
- return Result.error(new IOError("Editor cancelled"));
56
- }
57
- return Result.ok(result);
58
- } catch (err) {
59
- return Result.error(
60
- new IOError(
61
- `Editor failed: ${err instanceof Error ? err.message : String(err)}`,
62
- err instanceof Error ? err : void 0
63
- )
64
- );
65
- }
66
- }
67
-
68
- // src/integration/cli/commands/ticket/add.ts
69
- function tryFetchIssue(url) {
70
- const spinner = createSpinner("Fetching issue data...");
71
- spinner.start();
72
- const fetchR = Result2.try(() => fetchIssueFromUrl(url));
73
- if (!fetchR.ok) {
74
- spinner.fail("Could not fetch issue data");
75
- showWarning(fetchR.error.message);
76
- log.newline();
77
- return void 0;
78
- }
79
- const data = fetchR.value;
80
- if (!data) {
81
- spinner.stop();
82
- return void 0;
83
- }
84
- spinner.succeed("Issue data fetched");
85
- log.newline();
86
- const bodyPreview = truncate(data.body, 200);
87
- const cardLines = [`Title: ${data.title}`, "", bodyPreview];
88
- if (data.comments.length > 0) {
89
- cardLines.push("", `${String(data.comments.length)} comment(s)`);
90
- }
91
- console.log(renderCard(`${icons.info} Fetched Issue`, cardLines));
92
- log.newline();
93
- return data;
94
- }
95
- function validateUrl(url) {
96
- try {
97
- new URL(url);
98
- return true;
99
- } catch {
100
- return false;
101
- }
102
- }
103
- async function addSingleTicketNonInteractive(options) {
104
- const errors = [];
105
- const trimmedTitle = options.title?.trim();
106
- if (!trimmedTitle) {
107
- errors.push("--title is required");
108
- }
109
- if (options.link && !validateUrl(options.link)) {
110
- errors.push("--link must be a valid URL");
111
- }
112
- if (errors.length > 0 || !trimmedTitle) {
113
- showError("Validation failed");
114
- for (const e of errors) {
115
- log.item(error(e));
116
- }
117
- log.newline();
118
- exitWithCode(EXIT_ERROR);
119
- }
120
- const title = trimmedTitle;
121
- const trimmedDesc = options.description?.trim();
122
- const description = trimmedDesc === "" ? void 0 : trimmedDesc;
123
- const trimmedLink = options.link?.trim();
124
- const link = trimmedLink === "" ? void 0 : trimmedLink;
125
- const addR = await wrapAsync(() => addTicket({ title, description, link }), ensureError);
126
- if (!addR.ok) {
127
- handleTicketError(addR.error);
128
- return;
129
- }
130
- await showTicketResult(addR.value);
131
- }
132
- async function addSingleTicketInteractive(options) {
133
- const link = await getPrompt().input({
134
- message: `${icons.info} Issue link (optional):`,
135
- default: options.link?.trim(),
136
- validate: (v) => {
137
- if (!v) return true;
138
- return validateUrl(v) ? true : "Invalid URL format";
139
- }
140
- });
141
- const trimmedLink = link.trim();
142
- const normalizedLink = trimmedLink === "" ? void 0 : trimmedLink;
143
- let prefill;
144
- if (normalizedLink) {
145
- prefill = tryFetchIssue(normalizedLink);
146
- }
147
- let title = await getPrompt().input({
148
- message: `${icons.ticket} Title:`,
149
- default: prefill?.title ?? options.title?.trim(),
150
- validate: (v) => v.trim().length > 0 ? true : "Title is required"
151
- });
152
- const descR = await editorInput({
153
- message: "Description (recommended):",
154
- default: prefill?.body ?? options.description?.trim()
155
- });
156
- if (!descR.ok) {
157
- showError(`Editor input failed: ${descR.error.message}`);
158
- return null;
159
- }
160
- const description = descR.value;
161
- title = title.trim();
162
- const trimmedDescription = description.trim();
163
- const normalizedDescription = trimmedDescription === "" ? void 0 : trimmedDescription;
164
- const addR = await wrapAsync(
165
- () => addTicket({ title, description: normalizedDescription, link: normalizedLink }),
166
- ensureError
167
- );
168
- if (!addR.ok) {
169
- handleTicketError(addR.error);
170
- return null;
171
- }
172
- await showTicketResult(addR.value);
173
- return addR.value;
174
- }
175
- async function showTicketResult(ticket) {
176
- const sprintR = await wrapAsync(() => getCurrentSprintOrThrow(), ensureError);
177
- const projectLabel = sprintR.ok ? await wrapAsync(() => getProjectById(sprintR.value.projectId), ensureError).then(
178
- (r) => r.ok ? `${r.value.displayName} (${r.value.name})` : sprintR.value.projectId
179
- ) : "unknown";
180
- showSuccess("Ticket added!", [
181
- ["ID", ticket.id],
182
- ["Title", ticket.title],
183
- ["Project", projectLabel]
184
- ]);
185
- if (ticket.description) {
186
- console.log(fieldMultiline("Description", ticket.description));
187
- }
188
- if (ticket.link) {
189
- console.log(field("Link", ticket.link));
190
- }
191
- console.log("");
192
- }
193
- function handleTicketError(err) {
194
- if (err instanceof SprintStatusError) {
195
- showError(err.message);
196
- } else if (err instanceof Error && err.message.includes("does not exist")) {
197
- showError(err.message);
198
- } else {
199
- throw err;
200
- }
201
- }
202
- async function ticketAddCommand(options = {}) {
203
- if (options.interactive === false) {
204
- await addSingleTicketNonInteractive(options);
205
- return;
206
- }
207
- let count = 0;
208
- while (true) {
209
- const ticket = await addSingleTicketInteractive(options);
210
- if (ticket) {
211
- count++;
212
- log.dim(`${String(count)} ticket(s) added in this session`);
213
- } else {
214
- break;
215
- }
216
- const another = await getPrompt().confirm({
217
- message: `${emoji.donut} Add another ticket?`,
218
- default: true
219
- });
220
- if (!another) break;
221
- }
222
- }
223
-
224
- export {
225
- editorInput,
226
- addSingleTicketInteractive,
227
- ticketAddCommand
228
- };