ralphctl 0.2.5 → 0.3.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 (55) hide show
  1. package/dist/add-GX7P7XTT.mjs +16 -0
  2. package/dist/add-JGUOR4Z5.mjs +18 -0
  3. package/dist/bootstrap-FMHG6DRY.mjs +11 -0
  4. package/dist/chunk-3QBEBKMZ.mjs +103 -0
  5. package/dist/chunk-4GHVNKLV.mjs +5088 -0
  6. package/dist/{chunk-EDJX7TT6.mjs → chunk-57UWLHRH.mjs} +22 -2
  7. package/dist/chunk-747KW2RW.mjs +24 -0
  8. package/dist/chunk-CDOPLXFK.mjs +5485 -0
  9. package/dist/{chunk-7TG3EAQ2.mjs → chunk-CFUVE2BP.mjs} +1 -5
  10. package/dist/{chunk-IB6OCKZW.mjs → chunk-CTP2A436.mjs} +60 -55
  11. package/dist/{chunk-UBPZHHCD.mjs → chunk-D2YGPLIV.mjs} +84 -41
  12. package/dist/{chunk-QBXHAXHI.mjs → chunk-FKMKOWLA.mjs} +154 -208
  13. package/dist/chunk-HL4ZMHCQ.mjs +261 -0
  14. package/dist/{chunk-OEUJDSHY.mjs → chunk-IWXBJD2D.mjs} +1 -1
  15. package/dist/chunk-JXMHLW42.mjs +227 -0
  16. package/dist/{chunk-EUNAUHC3.mjs → chunk-NUYQK5MN.mjs} +80 -29
  17. package/dist/{chunk-JRFOUFD3.mjs → chunk-YCDUVPRT.mjs} +32 -52
  18. package/dist/cli.mjs +168 -3995
  19. package/dist/create-7WFSCMP4.mjs +15 -0
  20. package/dist/{handle-TA4MYNQJ.mjs → handle-BBAZJ44Y.mjs} +2 -2
  21. package/dist/mount-XZPBDRPZ.mjs +6751 -0
  22. package/dist/{project-YONEJICR.mjs → project-2IE7VWDB.mjs} +9 -5
  23. package/dist/prompts/harness-context.md +3 -3
  24. package/dist/prompts/ideate-auto.md +8 -10
  25. package/dist/prompts/ideate.md +3 -2
  26. package/dist/prompts/plan-auto.md +12 -12
  27. package/dist/prompts/plan-common.md +24 -15
  28. package/dist/prompts/plan-interactive.md +8 -8
  29. package/dist/prompts/signals-evaluation.md +1 -1
  30. package/dist/prompts/sprint-feedback.md +48 -0
  31. package/dist/prompts/task-evaluation-resume.md +7 -5
  32. package/dist/prompts/task-evaluation.md +37 -33
  33. package/dist/prompts/task-execution.md +33 -24
  34. package/dist/prompts/ticket-refine.md +6 -5
  35. package/dist/prompts/validation-checklist.md +10 -10
  36. package/dist/{resolver-RXEY6EJE.mjs → resolver-EOE5WUMV.mjs} +5 -5
  37. package/dist/{sprint-FGLWYWKX.mjs → sprint-OGOFEJJH.mjs} +7 -9
  38. package/dist/start-MMWC7QLI.mjs +17 -0
  39. package/package.json +15 -13
  40. package/dist/add-3T225IX5.mjs +0 -16
  41. package/dist/add-6A5432U2.mjs +0 -16
  42. package/dist/chunk-742XQ7FL.mjs +0 -551
  43. package/dist/chunk-7LZ6GOGN.mjs +0 -53
  44. package/dist/chunk-CSICORGV.mjs +0 -4333
  45. package/dist/chunk-DUU5346E.mjs +0 -59
  46. package/dist/create-MYGOWO2F.mjs +0 -12
  47. package/dist/multiline-OHSNFCRG.mjs +0 -40
  48. package/dist/wizard-XZ7OGBCJ.mjs +0 -193
  49. package/schemas/config.schema.json +0 -30
  50. package/schemas/ideate-output.schema.json +0 -22
  51. package/schemas/projects.schema.json +0 -58
  52. package/schemas/requirements-output.schema.json +0 -24
  53. package/schemas/sprint.schema.json +0 -109
  54. package/schemas/task-import.schema.json +0 -56
  55. package/schemas/tasks.schema.json +0 -98
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ log
4
+ } from "./chunk-FKMKOWLA.mjs";
2
5
  import {
3
6
  unwrapOrThrow
4
- } from "./chunk-OEUJDSHY.mjs";
7
+ } from "./chunk-IWXBJD2D.mjs";
5
8
  import {
6
9
  ConfigSchema,
7
10
  SprintSchema,
@@ -10,6 +13,7 @@ import {
10
13
  assertSafeCwd,
11
14
  ensureDir,
12
15
  fileExists,
16
+ generateSprintId,
13
17
  getConfigPath,
14
18
  getProgressFilePath,
15
19
  getSprintDir,
@@ -21,19 +25,16 @@ import {
21
25
  readValidatedJson,
22
26
  removeDir,
23
27
  writeValidatedJson
24
- } from "./chunk-IB6OCKZW.mjs";
28
+ } from "./chunk-CTP2A436.mjs";
25
29
  import {
26
30
  LockError,
27
31
  NoCurrentSprintError,
28
32
  SprintNotFoundError,
29
33
  SprintStatusError,
30
34
  StorageError
31
- } from "./chunk-EDJX7TT6.mjs";
32
- import {
33
- log
34
- } from "./chunk-QBXHAXHI.mjs";
35
+ } from "./chunk-57UWLHRH.mjs";
35
36
 
36
- // src/store/config.ts
37
+ // src/integration/persistence/config.ts
37
38
  var DEFAULT_EVALUATION_ITERATIONS = 1;
38
39
  var DEFAULT_CONFIG = {
39
40
  currentSprint: null,
@@ -87,26 +88,10 @@ async function setEvaluationIterations(iterations) {
87
88
  await saveConfig(config);
88
89
  }
89
90
 
90
- // src/utils/ids.ts
91
- import { randomBytes } from "crypto";
92
- function generateUuid8() {
93
- return randomBytes(4).toString("hex");
94
- }
95
- function slugify(input, maxLength = 40) {
96
- return input.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-").slice(0, maxLength).replace(/-$/, "");
97
- }
98
- function generateSprintId(name) {
99
- const now = /* @__PURE__ */ new Date();
100
- const date = now.toISOString().slice(0, 10).replace(/-/g, "");
101
- const time = now.toISOString().slice(11, 19).replace(/:/g, "");
102
- const slug = name ? slugify(name) : generateUuid8();
103
- return `${date}-${time}-${slug || generateUuid8()}`;
104
- }
105
-
106
- // src/store/progress.ts
91
+ // src/integration/persistence/progress.ts
107
92
  import { execSync } from "child_process";
108
93
 
109
- // src/utils/file-lock.ts
94
+ // src/integration/persistence/file-lock.ts
110
95
  import { mkdir, readFile, unlink, writeFile } from "fs/promises";
111
96
  import { dirname } from "path";
112
97
  import { Result } from "typescript-result";
@@ -193,7 +178,7 @@ async function withFileLock(filePath, fn) {
193
178
  }
194
179
  }
195
180
 
196
- // src/store/progress.ts
181
+ // src/integration/persistence/progress.ts
197
182
  async function logProgress(message, options = {}) {
198
183
  const id = await resolveSprintId(options.sprintId);
199
184
  const sprint = await getSprint(id);
@@ -347,7 +332,7 @@ function filterProgressByProject(progress, projectPath) {
347
332
  return filtered.join("\n---\n") + "\n\n---\n\n";
348
333
  }
349
334
 
350
- // src/store/sprint.ts
335
+ // src/integration/persistence/sprint.ts
351
336
  function assertSprintStatus(sprint, allowedStatuses, operation) {
352
337
  if (!allowedStatuses.includes(sprint.status)) {
353
338
  const statusText = allowedStatuses.join(" or ");
@@ -375,13 +360,15 @@ Hint: ${hint}` : "";
375
360
  );
376
361
  }
377
362
  }
378
- async function createSprint(name) {
363
+ async function createSprint(input) {
364
+ const { projectId, name } = input;
379
365
  const id = generateSprintId(name);
380
366
  const now = (/* @__PURE__ */ new Date()).toISOString();
381
367
  const displayName = name ?? id.slice(16);
382
368
  const sprint = {
383
369
  id,
384
370
  name: displayName,
371
+ projectId,
385
372
  status: "draft",
386
373
  createdAt: now,
387
374
  activatedAt: null,
@@ -409,10 +396,6 @@ Created: ${now}
409
396
  if (!appendResult.ok) throw appendResult.error;
410
397
  return sprint;
411
398
  }
412
- async function findActiveSprint() {
413
- const sprints = await listSprints();
414
- return sprints.find((s) => s.status === "active") ?? null;
415
- }
416
399
  async function getSprint(sprintId) {
417
400
  const sprintPath = getSprintFilePath(sprintId);
418
401
  if (!await fileExists(sprintPath)) {
@@ -447,17 +430,23 @@ async function activateSprint(sprintId) {
447
430
  await saveSprint(sprint);
448
431
  const tasksResult = await readValidatedJson(getTasksFilePath(sprintId), TasksSchema);
449
432
  if (!tasksResult.ok) throw tasksResult.error;
450
- const tasks = tasksResult.value;
451
- const projectPaths = tasks.map((t) => t.projectPath).filter((p) => !!p);
452
- if (projectPaths.length > 0) {
453
- await logBaselines({
454
- sprintId,
455
- sprintName: sprint.name,
456
- projectPaths
457
- });
458
- }
433
+ const _tasks = tasksResult.value;
434
+ void _tasks;
459
435
  return sprint;
460
436
  }
437
+ async function logSprintBaselines(sprint, resolvePath) {
438
+ const tasksResult = await readValidatedJson(getTasksFilePath(sprint.id), TasksSchema);
439
+ if (!tasksResult.ok) throw tasksResult.error;
440
+ const repoIds = [...new Set(tasksResult.value.map((t) => t.repoId))];
441
+ const paths = [];
442
+ for (const repoId of repoIds) {
443
+ const p = await resolvePath(repoId);
444
+ if (p) paths.push(p);
445
+ }
446
+ if (paths.length > 0) {
447
+ await logBaselines({ sprintId: sprint.id, sprintName: sprint.name, projectPaths: paths });
448
+ }
449
+ }
461
450
  async function closeSprint(sprintId) {
462
451
  const sprint = await getSprint(sprintId);
463
452
  assertSprintStatus(sprint, ["active"], "close");
@@ -480,13 +469,6 @@ async function getCurrentSprintOrThrow() {
480
469
  }
481
470
  return getSprint(currentSprintId);
482
471
  }
483
- async function getActiveSprintOrThrow() {
484
- const activeSprint = await findActiveSprint();
485
- if (!activeSprint) {
486
- throw new NoCurrentSprintError();
487
- }
488
- return activeSprint;
489
- }
490
472
  async function resolveSprintId(sprintId) {
491
473
  if (sprintId) {
492
474
  return sprintId;
@@ -499,8 +481,8 @@ async function resolveSprintId(sprintId) {
499
481
  }
500
482
 
501
483
  export {
502
- DEFAULT_EVALUATION_ITERATIONS,
503
484
  getConfig,
485
+ saveConfig,
504
486
  getCurrentSprint,
505
487
  setCurrentSprint,
506
488
  getAiProvider,
@@ -509,21 +491,19 @@ export {
509
491
  setEditor,
510
492
  getEvaluationIterations,
511
493
  setEvaluationIterations,
512
- generateUuid8,
513
494
  withFileLock,
514
495
  logProgress,
515
496
  getProgress,
516
497
  summarizeProgressForContext,
517
498
  assertSprintStatus,
518
499
  createSprint,
519
- findActiveSprint,
520
500
  getSprint,
521
501
  saveSprint,
522
502
  listSprints,
523
503
  activateSprint,
504
+ logSprintBaselines,
524
505
  closeSprint,
525
506
  deleteSprint,
526
507
  getCurrentSprintOrThrow,
527
- getActiveSprintOrThrow,
528
508
  resolveSprintId
529
509
  };