@neriros/ralphy 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -37423,28 +37423,28 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
37423
37423
  return null;
37424
37424
  }
37425
37425
  var ReactSharedInternals = React10.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
37426
- function error(format) {
37426
+ function error(format2) {
37427
37427
  {
37428
37428
  {
37429
37429
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++) {
37430
37430
  args[_key2 - 1] = arguments[_key2];
37431
37431
  }
37432
- printWarning("error", format, args);
37432
+ printWarning("error", format2, args);
37433
37433
  }
37434
37434
  }
37435
37435
  }
37436
- function printWarning(level, format, args) {
37436
+ function printWarning(level, format2, args) {
37437
37437
  {
37438
37438
  var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
37439
37439
  var stack = ReactDebugCurrentFrame2.getStackAddendum();
37440
37440
  if (stack !== "") {
37441
- format += "%s";
37441
+ format2 += "%s";
37442
37442
  args = args.concat([stack]);
37443
37443
  }
37444
37444
  var argsWithFormat = args.map(function(item) {
37445
37445
  return String(item);
37446
37446
  });
37447
- argsWithFormat.unshift("Warning: " + format);
37447
+ argsWithFormat.unshift("Warning: " + format2);
37448
37448
  Function.prototype.apply.call(console[level], console, argsWithFormat);
37449
37449
  }
37450
37450
  }
@@ -43760,8 +43760,76 @@ var import_react58 = __toESM(require_react(), 1);
43760
43760
 
43761
43761
  // apps/cli/src/cli.ts
43762
43762
  import { readFileSync as readFileSync2 } from "fs";
43763
+
43764
+ // packages/output/src/output.ts
43765
+ var formatters = {
43766
+ bold: (text) => source_default.bold(text),
43767
+ dim: (text) => source_default.dim(text),
43768
+ gray: (text) => source_default.gray(text),
43769
+ error: (text) => source_default.red(text),
43770
+ fail: (text) => source_default.red.bold(text),
43771
+ warn: (text) => source_default.yellow.bold(text),
43772
+ header: (text) => source_default.bold.cyan(text),
43773
+ success: (text) => source_default.green(text),
43774
+ successBold: (text) => source_default.green.bold(text),
43775
+ cyan: (text) => source_default.cyan(text)
43776
+ };
43777
+ function format(msg) {
43778
+ return formatters[msg.style](msg.text);
43779
+ }
43780
+ function styled(text, style) {
43781
+ return format({ text, style });
43782
+ }
43783
+ function log(msg) {
43784
+ console.log(typeof msg === "string" ? msg : format(msg));
43785
+ }
43786
+
43787
+ // apps/cli/src/cli.ts
43763
43788
  var VALID_MODES = new Set(["task", "list", "status", "advance", "set-phase", "init"]);
43764
43789
  var VALID_MODELS = new Set(["haiku", "sonnet", "opus"]);
43790
+ var HELP_TEXT = [
43791
+ "Usage: ralph <command> [options]",
43792
+ "",
43793
+ "Commands:",
43794
+ " task Run a task (default)",
43795
+ " list List incomplete tasks",
43796
+ " status Show detailed task status",
43797
+ " advance Advance task to next phase",
43798
+ " set-phase Set task to a specific phase",
43799
+ " init Initialize ralph in current directory",
43800
+ "",
43801
+ "Options:",
43802
+ " --name <name> Task name (required for most commands)",
43803
+ " --prompt <text> Task description",
43804
+ " --prompt-file <path> Read prompt from file",
43805
+ " --model <model> Set model (haiku|sonnet|opus)",
43806
+ " --claude [model] Use Claude engine (haiku|sonnet|opus, default: opus)",
43807
+ " --codex Use Codex engine",
43808
+ " --phase <phase> Target phase (for set-phase)",
43809
+ " --no-execute Stop after research + plan",
43810
+ " --interactive Run research+plan interactively, then continue automated",
43811
+ " --delay <seconds> Seconds between iterations",
43812
+ " --max-iterations <n> Stop after N iterations (0 = unlimited)",
43813
+ " --max-cost <n> Stop when total cost exceeds $N (0 = no limit)",
43814
+ " --max-runtime <n> Stop after N minutes of wall-clock time (0 = no limit)",
43815
+ " --max-failures <n> Stop after N consecutive failures (default: 5, 0 = disable)",
43816
+ " --unlimited No iteration limit (default)",
43817
+ " --log Log raw engine stream",
43818
+ " --verbose Verbose output",
43819
+ " --help, -h Show this help message",
43820
+ "",
43821
+ "Examples:",
43822
+ ' ralph task --name my-feature --prompt "Add dark mode"',
43823
+ " ralph task --name my-feature --claude sonnet --max-iterations 10",
43824
+ " ralph list",
43825
+ " ralph status --name my-feature",
43826
+ " ralph advance --name my-feature",
43827
+ " ralph set-phase --name my-feature --phase exec"
43828
+ ].join(`
43829
+ `);
43830
+ function printHelp() {
43831
+ log(HELP_TEXT);
43832
+ }
43765
43833
  function parseArgs(argv) {
43766
43834
  const result2 = {
43767
43835
  mode: "task",
@@ -43865,6 +43933,10 @@ function parseArgs(argv) {
43865
43933
  continue;
43866
43934
  }
43867
43935
  switch (arg) {
43936
+ case "--help":
43937
+ case "-h":
43938
+ printHelp();
43939
+ process.exit(0);
43868
43940
  case "--claude":
43869
43941
  if (result2.engineSet && result2.engine !== "claude") {
43870
43942
  throw new Error("Choose only one engine flag: --claude or --codex");
@@ -43935,7 +44007,9 @@ function parseArgs(argv) {
43935
44007
  if (VALID_MODES.has(arg)) {
43936
44008
  result2.mode = arg;
43937
44009
  } else {
43938
- throw new Error(`Unknown argument or mode '${arg}'`);
44010
+ throw new Error(`Unknown argument '${arg}'
44011
+
44012
+ Run 'ralph --help' for usage information.`);
43939
44013
  }
43940
44014
  break;
43941
44015
  }
@@ -52392,26 +52466,6 @@ import { writeFileSync as writeFileSync3, unlinkSync as unlinkSync2, existsSync
52392
52466
  import { join as join9 } from "path";
52393
52467
  import { tmpdir } from "os";
52394
52468
 
52395
- // packages/output/src/output.ts
52396
- var formatters = {
52397
- bold: (text) => source_default.bold(text),
52398
- dim: (text) => source_default.dim(text),
52399
- gray: (text) => source_default.gray(text),
52400
- error: (text) => source_default.red(text),
52401
- fail: (text) => source_default.red.bold(text),
52402
- warn: (text) => source_default.yellow.bold(text),
52403
- header: (text) => source_default.bold.cyan(text),
52404
- success: (text) => source_default.green(text),
52405
- successBold: (text) => source_default.green.bold(text),
52406
- cyan: (text) => source_default.cyan(text)
52407
- };
52408
- function format(msg) {
52409
- return formatters[msg.style](msg.text);
52410
- }
52411
- function styled(text, style) {
52412
- return format({ text, style });
52413
- }
52414
-
52415
52469
  // packages/engine/src/feed-events.ts
52416
52470
  function formatCost2(usd) {
52417
52471
  return (Math.round(usd * 100) / 100).toFixed(2);