@rcrsr/claude-code-runner 0.4.0 → 0.5.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 (79) hide show
  1. package/README.md +103 -30
  2. package/dist/cli/args.d.ts +0 -3
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +51 -20
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/core/runner.d.ts +5 -2
  7. package/dist/core/runner.d.ts.map +1 -1
  8. package/dist/core/runner.js +27 -24
  9. package/dist/core/runner.js.map +1 -1
  10. package/dist/index.js +83 -41
  11. package/dist/index.js.map +1 -1
  12. package/dist/output/colors.d.ts +5 -11
  13. package/dist/output/colors.d.ts.map +1 -1
  14. package/dist/output/colors.js +7 -59
  15. package/dist/output/colors.js.map +1 -1
  16. package/dist/output/deaddrop-queue.d.ts +45 -0
  17. package/dist/output/deaddrop-queue.d.ts.map +1 -0
  18. package/dist/output/deaddrop-queue.js +82 -0
  19. package/dist/output/deaddrop-queue.js.map +1 -0
  20. package/dist/output/formatter.d.ts +4 -0
  21. package/dist/output/formatter.d.ts.map +1 -1
  22. package/dist/output/formatter.js +20 -17
  23. package/dist/output/formatter.js.map +1 -1
  24. package/dist/process/pty.d.ts.map +1 -1
  25. package/dist/process/pty.js +3 -2
  26. package/dist/process/pty.js.map +1 -1
  27. package/dist/script/index.d.ts +8 -0
  28. package/dist/script/index.d.ts.map +1 -0
  29. package/dist/script/index.js +10 -0
  30. package/dist/script/index.js.map +1 -0
  31. package/dist/script/loader.d.ts +13 -0
  32. package/dist/script/loader.d.ts.map +1 -0
  33. package/dist/script/loader.js +66 -0
  34. package/dist/script/loader.js.map +1 -0
  35. package/dist/script/parser.d.ts +63 -0
  36. package/dist/script/parser.d.ts.map +1 -0
  37. package/dist/script/parser.js +349 -0
  38. package/dist/script/parser.js.map +1 -0
  39. package/dist/script/types.d.ts +49 -0
  40. package/dist/script/types.d.ts.map +1 -0
  41. package/dist/script/types.js +5 -0
  42. package/dist/script/types.js.map +1 -0
  43. package/dist/script/variables.d.ts +27 -0
  44. package/dist/script/variables.d.ts.map +1 -0
  45. package/dist/script/variables.js +74 -0
  46. package/dist/script/variables.js.map +1 -0
  47. package/dist/templates/command.d.ts +18 -20
  48. package/dist/templates/command.d.ts.map +1 -1
  49. package/dist/templates/command.js +40 -61
  50. package/dist/templates/command.js.map +1 -1
  51. package/dist/types/index.d.ts +1 -0
  52. package/dist/types/index.d.ts.map +1 -1
  53. package/dist/types/index.js +1 -0
  54. package/dist/types/index.js.map +1 -1
  55. package/dist/types/runner.d.ts +12 -0
  56. package/dist/types/runner.d.ts.map +1 -1
  57. package/dist/types/runner.js +4 -3
  58. package/dist/types/runner.js.map +1 -1
  59. package/dist/types/tools.d.ts +64 -0
  60. package/dist/types/tools.d.ts.map +1 -0
  61. package/dist/types/tools.js +12 -0
  62. package/dist/types/tools.js.map +1 -0
  63. package/dist/utils/arguments.d.ts +19 -0
  64. package/dist/utils/arguments.d.ts.map +1 -0
  65. package/dist/utils/arguments.js +31 -0
  66. package/dist/utils/arguments.js.map +1 -0
  67. package/dist/utils/constants.d.ts +49 -0
  68. package/dist/utils/constants.d.ts.map +1 -0
  69. package/dist/utils/constants.js +54 -0
  70. package/dist/utils/constants.js.map +1 -0
  71. package/dist/utils/formatting.d.ts +10 -0
  72. package/dist/utils/formatting.d.ts.map +1 -0
  73. package/dist/utils/formatting.js +19 -0
  74. package/dist/utils/formatting.js.map +1 -0
  75. package/dist/utils/index.d.ts +7 -0
  76. package/dist/utils/index.d.ts.map +1 -0
  77. package/dist/utils/index.js +7 -0
  78. package/dist/utils/index.js.map +1 -0
  79. package/package.json +1 -1
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Centralized constants for the runner codebase
3
+ * Replaces magic numbers with descriptive names
4
+ */
5
+ /** Threshold for displaying size in K (1000 chars) */
6
+ export declare const SIZE_THRESHOLD_K = 1000;
7
+ /** Threshold for displaying size in M (1000000 chars) */
8
+ export declare const SIZE_THRESHOLD_M = 1000000;
9
+ /** Maximum lines shown in tool result output */
10
+ export declare const MAX_RESULT_LINES = 10;
11
+ /** Truncation length for Grep pattern display */
12
+ export declare const TRUNCATE_GREP_PATTERN = 30;
13
+ /** Truncation length for Task description */
14
+ export declare const TRUNCATE_TASK_DESC = 40;
15
+ /** Truncation length for Bash command display */
16
+ export declare const TRUNCATE_BASH_CMD = 50;
17
+ /** Truncation length for preview text */
18
+ export declare const TRUNCATE_PREVIEW = 50;
19
+ /** Truncation length for unknown tool JSON */
20
+ export declare const TRUNCATE_TOOL_JSON = 60;
21
+ /** Truncation length for error messages */
22
+ export declare const TRUNCATE_ERROR = 100;
23
+ /** Truncation length for generic messages */
24
+ export declare const TRUNCATE_MESSAGE = 100;
25
+ /** Truncation length for verbose tool result lines */
26
+ export declare const TRUNCATE_VERBOSE_LINE = 150;
27
+ /** Truncation length for normal task result summary */
28
+ export declare const TRUNCATE_TASK_SUMMARY = 200;
29
+ /** Truncation length for quiet mode answer display */
30
+ export declare const TRUNCATE_ANSWER = 500;
31
+ /** Truncation length for verbose task result summary */
32
+ export declare const TRUNCATE_TASK_VERBOSE = 500;
33
+ /** Terminal column width */
34
+ export declare const PTY_COLS = 200;
35
+ /** Terminal row count */
36
+ export declare const PTY_ROWS = 50;
37
+ /** Milliseconds per second */
38
+ export declare const MS_PER_SECOND = 1000;
39
+ /** Seconds per minute */
40
+ export declare const SECONDS_PER_MINUTE = 60;
41
+ /** Seconds per hour */
42
+ export declare const SECONDS_PER_HOUR = 3600;
43
+ /** Default max iterations before stopping */
44
+ export declare const DEFAULT_MAX_ITERATIONS = 10;
45
+ /** Default parallel tool detection threshold in ms */
46
+ export declare const DEFAULT_PARALLEL_THRESHOLD_MS = 100;
47
+ /** Default pause between iterations in ms */
48
+ export declare const DEFAULT_ITERATION_PAUSE_MS = 2000;
49
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRo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0,0 +1,54 @@
1
+ /**
2
+ * Centralized constants for the runner codebase
3
+ * Replaces magic numbers with descriptive names
4
+ */
5
+ // === Size Thresholds ===
6
+ /** Threshold for displaying size in K (1000 chars) */
7
+ export const SIZE_THRESHOLD_K = 1000;
8
+ /** Threshold for displaying size in M (1000000 chars) */
9
+ export const SIZE_THRESHOLD_M = 1000000;
10
+ // === Display Limits ===
11
+ /** Maximum lines shown in tool result output */
12
+ export const MAX_RESULT_LINES = 10;
13
+ /** Truncation length for Grep pattern display */
14
+ export const TRUNCATE_GREP_PATTERN = 30;
15
+ /** Truncation length for Task description */
16
+ export const TRUNCATE_TASK_DESC = 40;
17
+ /** Truncation length for Bash command display */
18
+ export const TRUNCATE_BASH_CMD = 50;
19
+ /** Truncation length for preview text */
20
+ export const TRUNCATE_PREVIEW = 50;
21
+ /** Truncation length for unknown tool JSON */
22
+ export const TRUNCATE_TOOL_JSON = 60;
23
+ /** Truncation length for error messages */
24
+ export const TRUNCATE_ERROR = 100;
25
+ /** Truncation length for generic messages */
26
+ export const TRUNCATE_MESSAGE = 100;
27
+ /** Truncation length for verbose tool result lines */
28
+ export const TRUNCATE_VERBOSE_LINE = 150;
29
+ /** Truncation length for normal task result summary */
30
+ export const TRUNCATE_TASK_SUMMARY = 200;
31
+ /** Truncation length for quiet mode answer display */
32
+ export const TRUNCATE_ANSWER = 500;
33
+ /** Truncation length for verbose task result summary */
34
+ export const TRUNCATE_TASK_VERBOSE = 500;
35
+ // === PTY Configuration ===
36
+ /** Terminal column width */
37
+ export const PTY_COLS = 200;
38
+ /** Terminal row count */
39
+ export const PTY_ROWS = 50;
40
+ // === Time Constants ===
41
+ /** Milliseconds per second */
42
+ export const MS_PER_SECOND = 1000;
43
+ /** Seconds per minute */
44
+ export const SECONDS_PER_MINUTE = 60;
45
+ /** Seconds per hour */
46
+ export const SECONDS_PER_HOUR = 3600;
47
+ // === Default Configuration ===
48
+ /** Default max iterations before stopping */
49
+ export const DEFAULT_MAX_ITERATIONS = 10;
50
+ /** Default parallel tool detection threshold in ms */
51
+ export const DEFAULT_PARALLEL_THRESHOLD_MS = 100;
52
+ /** Default pause between iterations in ms */
53
+ export const DEFAULT_ITERATION_PAUSE_MS = 2000;
54
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0BAA0B;AAC1B,sDAAsD;AACtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,yDAAyD;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAExC,yBAAyB;AACzB,gDAAgD;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,iDAAiD;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,yCAAyC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,2CAA2C;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,sDAAsD;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,uDAAuD;AACvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,sDAAsD;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AACnC,wDAAwD;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,4BAA4B;AAC5B,4BAA4B;AAC5B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC;AAC5B,yBAAyB;AACzB,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAE3B,yBAAyB;AACzB,8BAA8B;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,yBAAyB;AACzB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,uBAAuB;AACvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,gCAAgC;AAChC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,sDAAsD;AACtD,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AACjD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shared formatting utilities
3
+ */
4
+ /**
5
+ * Format character count for display
6
+ * @param chars - Number of characters
7
+ * @returns Formatted string: "N chars", "N.NK chars", or "N.NM chars"
8
+ */
9
+ export declare function formatSize(chars: number): string;
10
+ //# sourceMappingURL=formatting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/utils/formatting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Shared formatting utilities
3
+ */
4
+ import { SIZE_THRESHOLD_K, SIZE_THRESHOLD_M } from './constants.js';
5
+ /**
6
+ * Format character count for display
7
+ * @param chars - Number of characters
8
+ * @returns Formatted string: "N chars", "N.NK chars", or "N.NM chars"
9
+ */
10
+ export function formatSize(chars) {
11
+ if (chars < SIZE_THRESHOLD_K) {
12
+ return `${chars} chars`;
13
+ }
14
+ else if (chars < SIZE_THRESHOLD_M) {
15
+ return `${(chars / SIZE_THRESHOLD_K).toFixed(1)}K chars`;
16
+ }
17
+ return `${(chars / SIZE_THRESHOLD_M).toFixed(1)}M chars`;
18
+ }
19
+ //# sourceMappingURL=formatting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src/utils/formatting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,IAAI,KAAK,GAAG,gBAAgB,EAAE,CAAC;QAC7B,OAAO,GAAG,KAAK,QAAQ,CAAC;IAC1B,CAAC;SAAM,IAAI,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACpC,OAAO,GAAG,CAAC,KAAK,GAAG,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,GAAG,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared utilities
3
+ */
4
+ export * from './arguments.js';
5
+ export * from './constants.js';
6
+ export * from './formatting.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared utilities
3
+ */
4
+ export * from './arguments.js';
5
+ export * from './constants.js';
6
+ export * from './formatting.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcrsr/claude-code-runner",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Execute Claude CLI with PTY handling, real-time tool visualization, and iterative execution support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",