@rcrsr/claude-code-runner 0.1.0 → 0.4.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 (45) hide show
  1. package/README.md +45 -17
  2. package/dist/cli/args.d.ts.map +1 -1
  3. package/dist/cli/args.js +58 -27
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/core/runner.d.ts +2 -1
  6. package/dist/core/runner.d.ts.map +1 -1
  7. package/dist/core/runner.js +27 -54
  8. package/dist/core/runner.js.map +1 -1
  9. package/dist/deaddrop/client.d.ts +23 -0
  10. package/dist/deaddrop/client.d.ts.map +1 -0
  11. package/dist/deaddrop/client.js +47 -0
  12. package/dist/deaddrop/client.js.map +1 -0
  13. package/dist/deaddrop/index.d.ts +2 -0
  14. package/dist/deaddrop/index.d.ts.map +1 -0
  15. package/dist/deaddrop/index.js +2 -0
  16. package/dist/deaddrop/index.js.map +1 -0
  17. package/dist/index.js +52 -47
  18. package/dist/index.js.map +1 -1
  19. package/dist/output/colors.d.ts +42 -0
  20. package/dist/output/colors.d.ts.map +1 -1
  21. package/dist/output/colors.js +106 -4
  22. package/dist/output/colors.js.map +1 -1
  23. package/dist/output/formatter.d.ts +1 -0
  24. package/dist/output/formatter.d.ts.map +1 -1
  25. package/dist/output/formatter.js +21 -37
  26. package/dist/output/formatter.js.map +1 -1
  27. package/dist/output/logger.d.ts.map +1 -1
  28. package/dist/output/logger.js +3 -2
  29. package/dist/output/logger.js.map +1 -1
  30. package/dist/parsers/signals.d.ts.map +1 -1
  31. package/dist/parsers/signals.js +2 -5
  32. package/dist/parsers/signals.js.map +1 -1
  33. package/dist/process/pty.d.ts +1 -0
  34. package/dist/process/pty.d.ts.map +1 -1
  35. package/dist/process/pty.js +7 -3
  36. package/dist/process/pty.js.map +1 -1
  37. package/dist/templates/command.d.ts +35 -4
  38. package/dist/templates/command.d.ts.map +1 -1
  39. package/dist/templates/command.js +95 -20
  40. package/dist/templates/command.js.map +1 -1
  41. package/dist/types/runner.d.ts +5 -3
  42. package/dist/types/runner.d.ts.map +1 -1
  43. package/dist/types/runner.js +3 -2
  44. package/dist/types/runner.js.map +1 -1
  45. package/package.json +1 -1
package/README.md CHANGED
@@ -58,7 +58,26 @@ Review the code in $1 for:
58
58
  Output findings as a numbered list.
59
59
  ```
60
60
 
61
- Templates support multiple arguments (`$1`, `$2`, `$3`, etc.) and YAML frontmatter is automatically stripped.
61
+ **Template variables:**
62
+
63
+ - `$1`, `$2`, `$3`... — Positional arguments
64
+ - `$ARGUMENTS` — All arguments joined with spaces
65
+
66
+ **Frontmatter support:**
67
+
68
+ ```markdown
69
+ ---
70
+ description: Review code for issues
71
+ argument-hint: <file> [severity]
72
+ model: claude-sonnet-4-20250514
73
+ ---
74
+
75
+ Review $1 with severity level $2...
76
+ ```
77
+
78
+ - `argument-hint` — Defines required `<arg>` and optional `[arg]` arguments
79
+ - `model` — Default model for this command (CLI `--model` takes precedence)
80
+ - `description` — Command description
62
81
 
63
82
  ### script — Run multiple commands in sequence
64
83
 
@@ -81,28 +100,38 @@ Scripts stop on `BLOCKED` or `ERROR` signals, letting you catch issues before co
81
100
 
82
101
  ### Options
83
102
 
84
- | Option | Description |
85
- | ----------- | ---------------------------- |
86
- | `--quiet` | Minimal output (errors only) |
87
- | `--normal` | Default output level |
88
- | `--verbose` | Full output with details |
89
- | `--no-log` | Disable file logging |
103
+ | Option | Description |
104
+ | ----------------- | ------------------------------------------------------ |
105
+ | `--version`, `-V` | Print version number |
106
+ | `--model`, `-m` | Specify Claude model (e.g., `sonnet`, `opus`, `haiku`) |
107
+ | `--quiet` | Minimal output (errors only) |
108
+ | `--normal` | Default output level |
109
+ | `--verbose` | Full output with details |
110
+ | `--no-log` | Disable file logging |
111
+ | `--deaddrop` | Enable [DeadDrop](https://deaddrop.sh) streaming |
112
+
113
+ **Example with model selection:**
114
+
115
+ ```bash
116
+ claude-code-runner -m sonnet "Explain this codebase"
117
+ ```
90
118
 
91
119
  ## Runner Signals
92
120
 
93
121
  Signals give Claude a way to control execution flow. Instruct Claude to output these signals in your prompts or templates, and the runner will respond accordingly.
94
122
 
95
- | Signal | Effect |
96
- | ------------------------ | -------------------------------- |
97
- | `:::RUNNER::DONE:::` | Exit successfully |
98
- | `:::RUNNER::CONTINUE:::` | Continue to next iteration |
99
- | `:::RUNNER::BLOCKED:::` | Exit with error (awaiting human) |
100
- | `:::RUNNER::ERROR:::` | Exit with error |
123
+ | Signal | Effect |
124
+ | --------------------------- | -------------------------------- |
125
+ | `:::RUNNER::REPEAT_STEP:::` | Run the same step again |
126
+ | `:::RUNNER::BLOCKED:::` | Exit with error (awaiting human) |
127
+ | `:::RUNNER::ERROR:::` | Exit with error |
128
+
129
+ No signal means success—the runner exits when Claude finishes without outputting a signal.
101
130
 
102
131
  **Example prompt using signals:**
103
132
 
104
133
  ```bash
105
- claude-code-runner "Fix all lint errors in src/. Output :::RUNNER::DONE::: when complete, or :::RUNNER::BLOCKED::: if you need human input."
134
+ claude-code-runner "Fix all lint errors in src/. Output :::RUNNER::BLOCKED::: if you need human input."
106
135
  ```
107
136
 
108
137
  **Example template with signals** (`.claude/commands/fix-tests.md`):
@@ -110,12 +139,11 @@ claude-code-runner "Fix all lint errors in src/. Output :::RUNNER::DONE::: when
110
139
  ```markdown
111
140
  Run the test suite for $1.
112
141
 
113
- - If all tests pass, output :::RUNNER::DONE:::
114
- - If tests fail and you can fix them, fix them and output :::RUNNER::CONTINUE::: to re-run
142
+ - If tests fail and you can fix them, fix them and output :::RUNNER::REPEAT_STEP::: to re-run
115
143
  - If tests fail and you need help, output :::RUNNER::BLOCKED::: with an explanation
116
144
  ```
117
145
 
118
- This pattern enables self-correcting loops: Claude attempts a fix, signals `CONTINUE` to retry, and only exits when done or stuck.
146
+ This pattern enables self-correcting loops: Claude attempts a fix, signals `REPEAT_STEP` to retry, and exits when done or stuck.
119
147
 
120
148
  **Defaults:**
121
149
 
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,mBAAmB,CAAC;AAsC3B;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAkBjE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAwDpD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CA0BjC"}
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,mBAAmB,CAAC;AAkD3B;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAmBjE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAsEpD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CA2BjC"}
package/dist/cli/args.js CHANGED
@@ -2,33 +2,52 @@
2
2
  * CLI argument parsing
3
3
  */
4
4
  import * as fs from 'fs';
5
+ import { createRequire } from 'module';
5
6
  import { loadCommandTemplate } from '../templates/command.js';
7
+ const require = createRequire(import.meta.url);
8
+ const pkg = require('../../package.json');
6
9
  /**
7
10
  * Extract options from raw args, returning positional args and config
8
11
  */
9
12
  function extractOptions(args) {
13
+ // Handle --version early
14
+ if (args.includes('--version') || args.includes('-V')) {
15
+ console.log(pkg.version);
16
+ process.exit(0);
17
+ }
10
18
  let verbosity = 'normal';
11
19
  let enableLog = true;
20
+ let model = null;
21
+ let deaddrop = false;
12
22
  const positionalArgs = [];
13
- for (const arg of args) {
14
- switch (arg) {
15
- case '--quiet':
16
- verbosity = 'quiet';
17
- break;
18
- case '--normal':
19
- verbosity = 'normal';
20
- break;
21
- case '--verbose':
22
- verbosity = 'verbose';
23
- break;
24
- case '--no-log':
25
- enableLog = false;
26
- break;
27
- default:
28
- positionalArgs.push(arg);
23
+ for (let i = 0; i < args.length; i++) {
24
+ const arg = args[i];
25
+ if (arg === '--quiet') {
26
+ verbosity = 'quiet';
27
+ }
28
+ else if (arg === '--normal') {
29
+ verbosity = 'normal';
30
+ }
31
+ else if (arg === '--verbose') {
32
+ verbosity = 'verbose';
33
+ }
34
+ else if (arg === '--no-log') {
35
+ enableLog = false;
36
+ }
37
+ else if (arg === '--deaddrop') {
38
+ deaddrop = true;
39
+ }
40
+ else if (arg === '--model' || arg === '-m') {
41
+ model = args[++i] ?? null;
42
+ }
43
+ else if (arg?.startsWith('--model=')) {
44
+ model = arg.slice(8);
45
+ }
46
+ else {
47
+ positionalArgs.push(arg ?? '');
29
48
  }
30
49
  }
31
- return { positionalArgs, verbosity, enableLog };
50
+ return { positionalArgs, verbosity, enableLog, model, deaddrop };
32
51
  }
33
52
  /**
34
53
  * Parse a command line into a prompt
@@ -45,7 +64,8 @@ export function parseCommandLine(line) {
45
64
  if (!cmdName) {
46
65
  throw new Error('command requires a name');
47
66
  }
48
- return { prompt: loadCommandTemplate(cmdName, parts.slice(2)) };
67
+ const { prompt } = loadCommandTemplate(cmdName, parts.slice(2));
68
+ return { prompt };
49
69
  }
50
70
  else if (cmd === 'script') {
51
71
  throw new Error('script cannot be nested');
@@ -59,11 +79,13 @@ export function parseCommandLine(line) {
59
79
  * Parse CLI arguments
60
80
  */
61
81
  export function parseArgs(args) {
62
- const { positionalArgs, verbosity, enableLog } = extractOptions(args);
82
+ const { positionalArgs, verbosity, enableLog, model, deaddrop } = extractOptions(args);
63
83
  const subcommand = (positionalArgs[0] ?? 'prompt');
64
84
  let prompt = '';
85
+ let displayCommand = '';
65
86
  let scriptMode = false;
66
87
  let scriptLines = [];
88
+ let frontmatterModel = null;
67
89
  switch (subcommand) {
68
90
  case 'command': {
69
91
  const commandName = positionalArgs[1];
@@ -72,7 +94,10 @@ export function parseArgs(args) {
72
94
  console.error('Usage: claude-code-runner command <name> [args...]');
73
95
  process.exit(1);
74
96
  }
75
- prompt = loadCommandTemplate(commandName, positionalArgs.slice(2));
97
+ const template = loadCommandTemplate(commandName, positionalArgs.slice(2));
98
+ prompt = template.prompt;
99
+ frontmatterModel = template.frontmatter.model ?? null;
100
+ displayCommand = positionalArgs.slice(1).join(' ');
76
101
  break;
77
102
  }
78
103
  case 'script': {
@@ -92,20 +117,25 @@ export function parseArgs(args) {
92
117
  .map((l) => l.trim())
93
118
  .filter((l) => l && !l.startsWith('#')); // Skip empty lines and comments
94
119
  scriptMode = true;
120
+ displayCommand = `script ${scriptFile}`;
95
121
  break;
96
122
  }
97
123
  case 'prompt':
98
124
  prompt =
99
125
  positionalArgs.slice(1).join(' ') || 'Tell me about this project';
126
+ displayCommand = `"${prompt}"`;
100
127
  break;
101
128
  }
102
129
  const config = {
103
130
  verbosity,
104
131
  enableLog,
132
+ model: model ?? frontmatterModel,
133
+ deaddrop,
105
134
  };
106
135
  return {
107
136
  subcommand: scriptMode ? 'script' : subcommand,
108
137
  prompt,
138
+ displayCommand,
109
139
  scriptLines,
110
140
  scriptMode,
111
141
  config,
@@ -128,17 +158,18 @@ Subcommands:
128
158
  command <name> [args] Load .claude/commands/<name>.md (supports RUNNER signals)
129
159
  script <file> Run commands from file, stop on ERROR/BLOCKED
130
160
 
131
- Iteration Status Signals (output by Claude to control loop):
132
- :::RUNNER::DONE::: Exit successfully
133
- :::RUNNER::CONTINUE::: Continue to next iteration
161
+ Iteration Signals (control runner execution):
162
+ :::RUNNER::REPEAT_STEP::: Run the same step again
134
163
  :::RUNNER::BLOCKED::: Exit with error (awaiting human intervention)
135
164
  :::RUNNER::ERROR::: Exit with error (something went wrong)
136
165
 
137
166
  Options:
138
- --quiet Minimal output (errors only)
139
- --normal Default output level
140
- --verbose Full output with all details
141
- --no-log Disable logging to file (enabled by default)
167
+ --quiet Minimal output (errors only)
168
+ --normal Default output level
169
+ --verbose Full output with all details
170
+ --no-log Disable logging to file (enabled by default)
171
+ --model, -m <model> Specify Claude model (e.g., sonnet, opus, haiku)
172
+ --deaddrop Send messages to Deaddrop (requires DEADDROP_API_KEY env var)
142
173
  `);
143
174
  }
144
175
  //# sourceMappingURL=args.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAc9D;;GAEG;AACH,SAAS,cAAc,CAAC,IAAc;IACpC,IAAI,SAAS,GAAc,QAAQ,CAAC;IACpC,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,SAAS;gBACZ,SAAS,GAAG,OAAO,CAAC;gBACpB,MAAM;YACR,KAAK,UAAU;gBACb,SAAS,GAAG,QAAQ,CAAC;gBACrB,MAAM;YACR,KAAK,WAAW;gBACd,SAAS,GAAG,SAAS,CAAC;gBACtB,MAAM;YACR,KAAK,UAAU;gBACb,SAAS,GAAG,KAAK,CAAC;gBAClB,MAAM;YACR;gBACE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAErB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IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gCAAgC;YAC3E,UAAU,GAAG,IAAI,CAAC;YAClB,cAAc,GAAG,UAAU,UAAU,EAAE,CAAC;YACxC,MAAM;QACR,CAAC;QACD,KAAK,QAAQ;YACX,MAAM;gBACJ,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,4BAA4B,CAAC;YACpE,cAAc,GAAG,IAAI,MAAM,GAAG,CAAC;YAC/B,MAAM;IACV,CAAC;IAED,MAAM,MAAM,GAA0B;QACpC,SAAS;QACT,SAAS;QACT,KAAK,EAAE,KAAK,IAAI,gBAAgB;QAChC,QAAQ;KACT,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU;QAC9C,MAAM;QACN,cAAc;QACd,WAAW;QACX,UAAU;QACV,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAyBb,CAAC,CAAC;AACH,CAAC"}
@@ -9,10 +9,11 @@ export interface RunnerContext {
9
9
  logger: Logger;
10
10
  formatterState: FormatterState;
11
11
  cwd: string;
12
+ runId: string | null;
12
13
  }
13
14
  /**
14
15
  * Run a command with RUNNER signal support
15
16
  * Handles iteration loop and signal detection
16
17
  */
17
- export declare function runWithSignals(promptText: string, startTime: number, context: RunnerContext): Promise<SignalResult>;
18
+ export declare function runWithSignals(promptText: string, displayCommand: string, startTime: number, context: RunnerContext): Promise<SignalResult>;
18
19
  //# sourceMappingURL=runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,cAAc,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAoGvB"}
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,cAAc,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAwFvB"}
@@ -1,103 +1,76 @@
1
1
  /**
2
2
  * Core runner with iteration control and signal detection
3
3
  */
4
- import { colors, formatDuration } from '../output/colors.js';
4
+ import { colors, formatDuration, printRunner } from '../output/colors.js';
5
5
  import { detectRunnerSignal } from '../parsers/signals.js';
6
6
  import { spawnClaude } from '../process/pty.js';
7
7
  /**
8
8
  * Run a command with RUNNER signal support
9
9
  * Handles iteration loop and signal detection
10
10
  */
11
- export async function runWithSignals(promptText, startTime, context) {
12
- const { config, logger, formatterState, cwd } = context;
13
- const { verbosity, maxIterations, parallelThresholdMs, iterationPauseMs } = config;
11
+ export async function runWithSignals(promptText, displayCommand, startTime, context) {
12
+ const { config, logger, formatterState, cwd, runId } = context;
13
+ const { verbosity, maxIterations, parallelThresholdMs, iterationPauseMs, model, } = config;
14
14
  let iteration = 0;
15
15
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- intentional infinite loop with internal exits
16
16
  while (true) {
17
17
  iteration++;
18
18
  // Check max iterations
19
19
  if (iteration > maxIterations) {
20
- const totalDuration = Math.round((Date.now() - startTime) / 1000);
21
- console.log('');
22
- printSeparator();
23
- console.log(`${colors.red}MAX ITERATIONS (${maxIterations})${colors.reset} | Total: ${formatDuration(totalDuration * 1000)}`);
24
- printSeparator();
20
+ const totalDuration = Date.now() - startTime;
21
+ printRunner(`${colors.red}Run stopped${colors.reset} max iterations (${maxIterations}) in ${formatDuration(totalDuration)}`);
25
22
  logger.log(`\nMAX ITERATIONS reached after ${maxIterations}`);
26
23
  return 'error';
27
24
  }
28
- // Print iteration header for subsequent iterations
25
+ // Log iteration for subsequent iterations
29
26
  if (iteration > 1) {
30
- console.log('');
31
- printIterationHeader(iteration);
32
27
  logger.log(`\n--- Iteration ${iteration} ---\n`);
33
28
  }
29
+ // Print running message
30
+ if (verbosity !== 'quiet') {
31
+ printRunner(`Running step ${iteration}: ${displayCommand}`);
32
+ }
33
+ // Update formatter with current step
34
+ formatterState.currentStep = iteration;
34
35
  // Run Claude
35
- const { exitCode, duration, claudeText } = await spawnClaude({
36
+ const { exitCode, claudeText } = await spawnClaude({
36
37
  prompt: promptText,
37
38
  cwd,
38
39
  verbosity,
39
40
  logger,
40
41
  formatterState,
41
42
  parallelThresholdMs,
43
+ model,
42
44
  });
43
45
  const status = detectRunnerSignal(claudeText);
44
- const totalDuration = Math.round((Date.now() - startTime) / 1000);
45
- console.log('');
46
- printSeparator();
47
- if (status === 'done') {
48
- console.log(`${colors.green}COMPLETE${colors.reset} | Iterations: ${iteration} | Total: ${formatDuration(totalDuration * 1000)}`);
49
- printSeparator();
50
- logger.log(`\nCOMPLETE after ${iteration} iterations, ${totalDuration}s total`);
51
- return 'ok';
52
- }
53
- else if (status === 'blocked') {
54
- console.log(`${colors.red}BLOCKED${colors.reset} | Iterations: ${iteration} | Total: ${formatDuration(totalDuration * 1000)}`);
55
- printSeparator();
56
- logger.log(`\nBLOCKED after ${iteration} iterations, ${totalDuration}s total`);
46
+ const totalDuration = Date.now() - startTime;
47
+ const totalSeconds = Math.round(totalDuration / 1000);
48
+ const runLabel = runId ? ` ${runId}` : '';
49
+ const stepLabel = ` (${iteration} step${iteration > 1 ? 's' : ''})`;
50
+ if (status === 'blocked') {
51
+ printRunner(`${colors.red}Blocked run${runLabel}${colors.reset}${stepLabel} in ${formatDuration(totalDuration)}`);
52
+ logger.log(`\nBLOCKED after ${iteration} iterations, ${totalSeconds}s total`);
57
53
  return 'blocked';
58
54
  }
59
55
  else if (status === 'error') {
60
- console.log(`${colors.red}ERROR${colors.reset} | Iterations: ${iteration} | Total: ${formatDuration(totalDuration * 1000)}`);
61
- printSeparator();
62
- logger.log(`\nERROR after ${iteration} iterations, ${totalDuration}s total`);
56
+ printRunner(`${colors.red}Failed run${runLabel}${colors.reset}${stepLabel} in ${formatDuration(totalDuration)}`);
57
+ logger.log(`\nERROR after ${iteration} iterations, ${totalSeconds}s total`);
63
58
  return 'error';
64
59
  }
65
- else if (status === 'continue') {
66
- console.log(`${colors.yellow}CONTINUE${colors.reset} | Iteration ${iteration} done (${duration}s), continuing...`);
67
- printSeparator();
60
+ else if (status === 'repeat_step') {
61
+ printRunner(`Claude requested to repeat the step`);
68
62
  logger.log(`Iteration ${iteration} complete, continuing...`);
69
63
  await sleep(iterationPauseMs);
70
64
  }
71
65
  else {
72
66
  // No status signal - treat as successful single run
73
67
  const exitStatus = exitCode === 0 ? 'ok' : 'error';
74
- if (iteration === 1) {
75
- console.log(`Exit: ${exitCode === 0 ? colors.green : colors.red}${exitCode}${colors.reset} | Duration: ${duration}s`);
76
- }
77
- else {
78
- console.log(`${exitCode === 0 ? colors.green + 'COMPLETE' : colors.red + 'FAILED'}${colors.reset} | Iterations: ${iteration} | Total: ${formatDuration(totalDuration * 1000)}`);
79
- }
80
- printSeparator();
68
+ printRunner(`${exitCode === 0 ? colors.green + 'Completed run' : colors.red + 'Failed run'}${runLabel}${colors.reset}${stepLabel} in ${formatDuration(totalDuration)}`);
81
69
  logger.log(`\nCompleted after ${iteration} iteration(s), exit=${exitCode}`);
82
70
  return exitStatus;
83
71
  }
84
72
  }
85
73
  }
86
- /**
87
- * Print a separator line
88
- */
89
- function printSeparator() {
90
- console.log(`${colors.bold}════════════════════════════════════════════════════════════${colors.reset}`);
91
- }
92
- /**
93
- * Print iteration header
94
- */
95
- function printIterationHeader(iteration) {
96
- console.log(`${colors.blue}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}`);
97
- console.log(`${colors.blue}Iteration ${iteration}${colors.reset}`);
98
- console.log(`${colors.blue}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}`);
99
- console.log('');
100
- }
101
74
  /**
102
75
  * Sleep for a given number of milliseconds
103
76
  */
@@ -1 +1 @@
1
- {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD;;;GAGG;AACH,M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AS,OAAO,cAAc,CAAC,aAAa,CAAC,EAAE,CAC3J,CAAC;YACF,MAAM,CAAC,GAAG,CACR,qBAAqB,SAAS,uBAAuB,QAAQ,EAAE,CAChE,CAAC;YACF,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * DeadDrop client for sending messages to a Deaddrop endpoint
3
+ * https://deaddrop.sh
4
+ */
5
+ export interface DeadDropConfig {
6
+ apiKey: string;
7
+ host: string;
8
+ runId: string;
9
+ }
10
+ export type DeadDropUser = 'Runner' | 'Claude Code';
11
+ export interface DeadDropClient {
12
+ send(content: string, user: DeadDropUser): Promise<void>;
13
+ }
14
+ /**
15
+ * Create a DeadDrop client from environment variables
16
+ * Returns null if DEADDROP_API_KEY is not set
17
+ */
18
+ export declare function createDeadDropClientFromEnv(runId: string): DeadDropClient | null;
19
+ /**
20
+ * Create a DeadDrop client with the given configuration
21
+ */
22
+ export declare function createDeadDropClient(config: DeadDropConfig): DeadDropClient;
23
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/deaddrop/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAID;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,GACZ,cAAc,GAAG,IAAI,CAQvB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CA4B3E"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * DeadDrop client for sending messages to a Deaddrop endpoint
3
+ * https://deaddrop.sh
4
+ */
5
+ const DEFAULT_HOST = 'https://deaddrop.bezoan.com';
6
+ /**
7
+ * Create a DeadDrop client from environment variables
8
+ * Returns null if DEADDROP_API_KEY is not set
9
+ */
10
+ export function createDeadDropClientFromEnv(runId) {
11
+ const apiKey = process.env['DEADDROP_API_KEY'];
12
+ if (!apiKey) {
13
+ return null;
14
+ }
15
+ const host = process.env['DEADDROP_HOST'] ?? DEFAULT_HOST;
16
+ return createDeadDropClient({ apiKey, host, runId });
17
+ }
18
+ /**
19
+ * Create a DeadDrop client with the given configuration
20
+ */
21
+ export function createDeadDropClient(config) {
22
+ const host = config.host.replace(/\/+$/, ''); // Remove trailing slashes
23
+ const url = `${host}/v1/messages`;
24
+ return {
25
+ async send(content, user) {
26
+ try {
27
+ const response = await fetch(url, {
28
+ method: 'POST',
29
+ headers: {
30
+ 'Content-Type': 'text/markdown',
31
+ 'X-API-Key': config.apiKey,
32
+ 'X-DeadDrop-User': user,
33
+ 'X-DeadDrop-Subject': config.runId,
34
+ },
35
+ body: content,
36
+ });
37
+ if (!response.ok) {
38
+ console.warn(`[DEADDROP] Warning: Failed to send message (${response.status})`);
39
+ }
40
+ }
41
+ catch (err) {
42
+ console.warn(`[DEADDROP] Warning: ${err.message}`);
43
+ }
44
+ },
45
+ };
46
+ }
47
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/deaddrop/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,MAAM,YAAY,GAAG,6BAA6B,CAAC;AAEnD;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+1,2 @@
1
+ export * from './client.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deaddrop/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './client.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/deaddrop/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}