@rcrsr/claude-code-runner 0.1.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.
- package/LICENSE +21 -0
- package/README.md +148 -0
- package/dist/cli/args.d.ts +20 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +144 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/runner.d.ts +18 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/runner.js +107 -0
- package/dist/core/runner.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -0
- package/dist/output/colors.d.ts +33 -0
- package/dist/output/colors.d.ts.map +1 -0
- package/dist/output/colors.js +63 -0
- package/dist/output/colors.js.map +1 -0
- package/dist/output/formatter.d.ts +28 -0
- package/dist/output/formatter.d.ts.map +1 -0
- package/dist/output/formatter.js +275 -0
- package/dist/output/formatter.js.map +1 -0
- package/dist/output/index.d.ts +4 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +4 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/logger.d.ts +13 -0
- package/dist/output/logger.d.ts.map +1 -0
- package/dist/output/logger.js +38 -0
- package/dist/output/logger.js.map +1 -0
- package/dist/parsers/index.d.ts +3 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +3 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/signals.d.ts +10 -0
- package/dist/parsers/signals.d.ts.map +1 -0
- package/dist/parsers/signals.js +24 -0
- package/dist/parsers/signals.js.map +1 -0
- package/dist/parsers/stream.d.ts +16 -0
- package/dist/parsers/stream.d.ts.map +1 -0
- package/dist/parsers/stream.js +45 -0
- package/dist/parsers/stream.js.map +1 -0
- package/dist/process/index.d.ts +2 -0
- package/dist/process/index.d.ts.map +1 -0
- package/dist/process/index.js +2 -0
- package/dist/process/index.js.map +1 -0
- package/dist/process/pty.d.ts +19 -0
- package/dist/process/pty.d.ts.map +1 -0
- package/dist/process/pty.js +47 -0
- package/dist/process/pty.js.map +1 -0
- package/dist/templates/command.d.ts +17 -0
- package/dist/templates/command.d.ts.map +1 -0
- package/dist/templates/command.js +48 -0
- package/dist/templates/command.js.map +1 -0
- package/dist/templates/index.d.ts +2 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +2 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/types/claude.d.ts +66 -0
- package/dist/types/claude.d.ts.map +1 -0
- package/dist/types/claude.js +28 -0
- package/dist/types/claude.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/runner.d.ts +74 -0
- package/dist/types/runner.d.ts.map +1 -0
- package/dist/types/runner.js +31 -0
- package/dist/types/runner.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAsB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAqB,MAAM,mBA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GAAG,CAChB,sBAAsB,WAAW,CAAC,MAAM,cAAc,aAAa,SAAS,CAC7E,CAAC;IACF,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,OAAe,EAAE,KAAa,EAAE,IAAY;IACnE,OAAO,CAAC,GAAG,CACT,GAAG,MAAM,CAAC,IAAI,+DAA+D,MAAM,CAAC,KAAK,EAAE,CAC5F,CAAC;IACF,OAAO,CAAC,GAAG,CACT,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAC3E,CAAC;IACF,OAAO,CAAC,GAAG,CACT,GAAG,MAAM,CAAC,IAAI,+DAA+D,MAAM,CAAC,KAAK,EAAE,CAC5F,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,WAAW;AACX,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI color codes for terminal output
|
|
3
|
+
*/
|
|
4
|
+
export declare const colors: {
|
|
5
|
+
readonly reset: "\u001B[0m";
|
|
6
|
+
readonly dim: "\u001B[2m";
|
|
7
|
+
readonly bold: "\u001B[1m";
|
|
8
|
+
readonly cyan: "\u001B[36m";
|
|
9
|
+
readonly yellow: "\u001B[33m";
|
|
10
|
+
readonly green: "\u001B[32m";
|
|
11
|
+
readonly red: "\u001B[31m";
|
|
12
|
+
readonly magenta: "\u001B[35m";
|
|
13
|
+
readonly blue: "\u001B[34m";
|
|
14
|
+
};
|
|
15
|
+
export type ColorName = keyof typeof colors;
|
|
16
|
+
export declare function stripAnsi(str: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Apply color to a string
|
|
19
|
+
*/
|
|
20
|
+
export declare function colorize(text: string, color: ColorName): string;
|
|
21
|
+
/**
|
|
22
|
+
* Truncate a string to a maximum length
|
|
23
|
+
*/
|
|
24
|
+
export declare function truncate(str: string, len: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* Format duration in human-readable form
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatDuration(ms: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* Shorten file paths by removing common prefixes
|
|
31
|
+
*/
|
|
32
|
+
export declare function shortenPath(filePath: string): string;
|
|
33
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/output/colors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;CAUT,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,MAAM,CAAC;AAQ5C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAE/D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAUjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOpD"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI color codes for terminal output
|
|
3
|
+
*/
|
|
4
|
+
export const colors = {
|
|
5
|
+
reset: '\x1b[0m',
|
|
6
|
+
dim: '\x1b[2m',
|
|
7
|
+
bold: '\x1b[1m',
|
|
8
|
+
cyan: '\x1b[36m',
|
|
9
|
+
yellow: '\x1b[33m',
|
|
10
|
+
green: '\x1b[32m',
|
|
11
|
+
red: '\x1b[31m',
|
|
12
|
+
magenta: '\x1b[35m',
|
|
13
|
+
blue: '\x1b[34m',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Strip ANSI escape codes from a string
|
|
17
|
+
*/
|
|
18
|
+
// eslint-disable-next-line no-control-regex -- ANSI escape codes require control characters
|
|
19
|
+
const ANSI_REGEX = /\x1b\[[0-9;]*[a-zA-Z]/g;
|
|
20
|
+
export function stripAnsi(str) {
|
|
21
|
+
return str.replace(ANSI_REGEX, '');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Apply color to a string
|
|
25
|
+
*/
|
|
26
|
+
export function colorize(text, color) {
|
|
27
|
+
return `${colors[color]}${text}${colors.reset}`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Truncate a string to a maximum length
|
|
31
|
+
*/
|
|
32
|
+
export function truncate(str, len) {
|
|
33
|
+
if (str.length <= len) {
|
|
34
|
+
return str;
|
|
35
|
+
}
|
|
36
|
+
return str.slice(0, len) + '...';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Format duration in human-readable form
|
|
40
|
+
*/
|
|
41
|
+
export function formatDuration(ms) {
|
|
42
|
+
if (ms < 1000) {
|
|
43
|
+
return `${ms}ms`;
|
|
44
|
+
}
|
|
45
|
+
if (ms < 60000) {
|
|
46
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
47
|
+
}
|
|
48
|
+
const mins = Math.floor(ms / 60000);
|
|
49
|
+
const secs = ((ms % 60000) / 1000).toFixed(0);
|
|
50
|
+
return `${mins}m${secs}s`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Shorten file paths by removing common prefixes
|
|
54
|
+
*/
|
|
55
|
+
export function shortenPath(filePath) {
|
|
56
|
+
return filePath
|
|
57
|
+
.replace(/.*\/apps\//, 'apps/')
|
|
58
|
+
.replace(/.*\/packages\//, 'packages/')
|
|
59
|
+
.replace(/.*\/scripts\//, 'scripts/')
|
|
60
|
+
.replace(/.*\/\.claude\//, '.claude/')
|
|
61
|
+
.replace(/.*\/infra\//, 'infra/');
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/output/colors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,UAAU;IACjB,GAAG,EAAE,UAAU;IACf,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,UAAU;CACR,CAAC;AAIX;;GAEG;AACH,4FAA4F;AAC5F,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAE5C,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAgB;IACrD,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,GAAW;IAC/C,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QACtB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;QACd,OAAO,GAAG,EAAE,IAAI,CAAC;IACnB,CAAC;IACD,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;QACf,OAAO,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACtC,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9C,OAAO,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,QAAQ;SACZ,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;SAC9B,OAAO,CAAC,gBAAgB,EAAE,WAAW,CAAC;SACtC,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC;SACpC,OAAO,CAAC,gBAAgB,EAAE,UAAU,CAAC;SACrC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Console output formatting for tool calls and messages
|
|
3
|
+
*/
|
|
4
|
+
import { type ClaudeMessage } from '../types/claude.js';
|
|
5
|
+
import { type ActiveTask, type PendingTool, type Verbosity } from '../types/runner.js';
|
|
6
|
+
import type { Logger } from './logger.js';
|
|
7
|
+
/**
|
|
8
|
+
* State for tracking parallel tool calls and active tasks
|
|
9
|
+
*/
|
|
10
|
+
export interface FormatterState {
|
|
11
|
+
pendingTools: PendingTool[];
|
|
12
|
+
lastToolTime: number | null;
|
|
13
|
+
activeTask: ActiveTask | null;
|
|
14
|
+
toolStartTimes: Map<string, number>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createFormatterState(): FormatterState;
|
|
17
|
+
export declare function resetFormatterState(state: FormatterState): void;
|
|
18
|
+
/**
|
|
19
|
+
* Flush pending tools, grouping parallel calls
|
|
20
|
+
*/
|
|
21
|
+
export declare function flushPendingTools(state: FormatterState, verbosity: Verbosity): void;
|
|
22
|
+
/**
|
|
23
|
+
* Format and display a Claude message
|
|
24
|
+
* Returns collected Claude text for signal detection
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatMessage(msg: ClaudeMessage, state: FormatterState, verbosity: Verbosity, _logger: Logger, // Reserved for future verbose logging
|
|
27
|
+
parallelThresholdMs: number): string;
|
|
28
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/output/formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,KAAK,aAAa,EASnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAOrD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAK/D;AAwED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,SAAS,GACnB,IAAI,CAuBN;AAoFD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EAAE,sCAAsC;AACvD,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAoIR"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Console output formatting for tool calls and messages
|
|
3
|
+
*/
|
|
4
|
+
import { isAssistantMessage, isResultMessage, isSystemInitMessage, isTextBlock, isToolResultBlock, isToolUseBlock, isUserMessage, } from '../types/claude.js';
|
|
5
|
+
import { NOISE_PATTERNS, } from '../types/runner.js';
|
|
6
|
+
import { colors, formatDuration, shortenPath, truncate } from './colors.js';
|
|
7
|
+
export function createFormatterState() {
|
|
8
|
+
return {
|
|
9
|
+
pendingTools: [],
|
|
10
|
+
lastToolTime: null,
|
|
11
|
+
activeTask: null,
|
|
12
|
+
toolStartTimes: new Map(),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function resetFormatterState(state) {
|
|
16
|
+
state.pendingTools = [];
|
|
17
|
+
state.lastToolTime = null;
|
|
18
|
+
state.activeTask = null;
|
|
19
|
+
state.toolStartTimes.clear();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if a line contains noise patterns (node_modules, venv, etc.)
|
|
23
|
+
*/
|
|
24
|
+
function isNoise(text) {
|
|
25
|
+
return NOISE_PATTERNS.some((p) => p.test(text));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Filter noise lines from output
|
|
29
|
+
*/
|
|
30
|
+
function filterNoiseLines(text) {
|
|
31
|
+
return text
|
|
32
|
+
.split('\n')
|
|
33
|
+
.filter((line) => !isNoise(line))
|
|
34
|
+
.join('\n');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Format a single tool use for display
|
|
38
|
+
*/
|
|
39
|
+
function formatToolUse(tool, indented, state) {
|
|
40
|
+
const inTask = state.activeTask !== null;
|
|
41
|
+
const indent = inTask ? ' │ ' : '';
|
|
42
|
+
const prefix = indented
|
|
43
|
+
? `${indent} → `
|
|
44
|
+
: `${indent}${colors.yellow}[TOOL]${colors.reset} `;
|
|
45
|
+
const name = tool.name;
|
|
46
|
+
const input = tool.input;
|
|
47
|
+
let summary = '';
|
|
48
|
+
if (name === 'Read') {
|
|
49
|
+
summary = shortenPath(input['file_path'] ?? '');
|
|
50
|
+
}
|
|
51
|
+
else if (name === 'Glob') {
|
|
52
|
+
summary = input['pattern'] ?? '';
|
|
53
|
+
}
|
|
54
|
+
else if (name === 'Grep') {
|
|
55
|
+
summary = `"${truncate(input['pattern'] ?? '', 30)}"`;
|
|
56
|
+
}
|
|
57
|
+
else if (name === 'Bash') {
|
|
58
|
+
summary = truncate(input['command'] ?? '', 50);
|
|
59
|
+
}
|
|
60
|
+
else if (name === 'Task') {
|
|
61
|
+
const taskType = input['subagent_type'] ?? 'agent';
|
|
62
|
+
const taskDesc = truncate(input['description'] ??
|
|
63
|
+
input['prompt'] ??
|
|
64
|
+
'', 40);
|
|
65
|
+
summary = `${colors.magenta}${taskType}${colors.reset}: ${taskDesc}`;
|
|
66
|
+
// Mark task as active and print task header
|
|
67
|
+
state.activeTask = { name: taskType, description: taskDesc, id: tool.id };
|
|
68
|
+
console.log(`${colors.yellow}[TASK]${colors.reset} ${colors.magenta}${taskType}${colors.reset} ${taskDesc}`);
|
|
69
|
+
console.log(` ${colors.dim}┌─────────────────────────────────────────────────${colors.reset}`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
else if (name === 'Write' || name === 'Edit') {
|
|
73
|
+
summary = shortenPath(input['file_path'] ?? '');
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
summary = truncate(JSON.stringify(input), 60);
|
|
77
|
+
}
|
|
78
|
+
console.log(`${prefix}${colors.cyan}${name}${colors.reset} ${summary}`);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Flush pending tools, grouping parallel calls
|
|
82
|
+
*/
|
|
83
|
+
export function flushPendingTools(state, verbosity) {
|
|
84
|
+
if (state.pendingTools.length === 0) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (verbosity === 'quiet') {
|
|
88
|
+
state.pendingTools = [];
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const firstTool = state.pendingTools[0];
|
|
92
|
+
if (state.pendingTools.length === 1 && firstTool) {
|
|
93
|
+
formatToolUse(firstTool, false, state);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// Group parallel tools
|
|
97
|
+
console.log(`${colors.yellow}[TOOL ×${state.pendingTools.length}]${colors.reset} ${colors.dim}(parallel)${colors.reset}`);
|
|
98
|
+
for (const tool of state.pendingTools) {
|
|
99
|
+
formatToolUse(tool, true, state);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
state.pendingTools = [];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Print a tool result
|
|
106
|
+
*/
|
|
107
|
+
function printToolResult(result, durationStr, verbosity, state) {
|
|
108
|
+
if (verbosity === 'quiet') {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const inTask = state.activeTask !== null;
|
|
112
|
+
const indent = inTask ? ' │ ' : '';
|
|
113
|
+
if (verbosity === 'normal') {
|
|
114
|
+
// In normal mode, suppress per-tool timing
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
// Verbose only: show detailed results
|
|
118
|
+
const content = typeof result.content === 'string'
|
|
119
|
+
? result.content
|
|
120
|
+
: JSON.stringify(result.content);
|
|
121
|
+
const filtered = filterNoiseLines(content);
|
|
122
|
+
const lines = filtered.split('\n').filter((l) => l.trim());
|
|
123
|
+
const maxLines = 10;
|
|
124
|
+
const showLines = lines.slice(0, maxLines);
|
|
125
|
+
for (const line of showLines) {
|
|
126
|
+
console.log(`${indent} ${colors.dim}${truncate(line, 150)}${colors.reset}`);
|
|
127
|
+
}
|
|
128
|
+
if (lines.length > maxLines) {
|
|
129
|
+
console.log(`${indent} ${colors.dim}... (${lines.length - maxLines} more lines)${colors.reset}${durationStr}`);
|
|
130
|
+
}
|
|
131
|
+
else if (durationStr) {
|
|
132
|
+
console.log(`${indent} ${durationStr}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Print a task result
|
|
137
|
+
*/
|
|
138
|
+
function printTaskResult(result, durationStr, verbosity, state) {
|
|
139
|
+
const content = typeof result.content === 'string'
|
|
140
|
+
? result.content
|
|
141
|
+
: JSON.stringify(result.content);
|
|
142
|
+
// Close the task visual box with duration
|
|
143
|
+
console.log(` ${colors.dim}└─────────────────────────────────────────────────${colors.reset}${durationStr}`);
|
|
144
|
+
// Extract the text part of task result, skip agentId line
|
|
145
|
+
const lines = content
|
|
146
|
+
.split('\n')
|
|
147
|
+
.filter((l) => l.trim() && !l.includes('agentId:'));
|
|
148
|
+
// Show task result summary
|
|
149
|
+
if (lines.length > 0) {
|
|
150
|
+
const maxLen = verbosity === 'verbose' ? 500 : 200;
|
|
151
|
+
const summary = lines.join(' ').replace(/\s+/g, ' ');
|
|
152
|
+
console.log(` ${colors.green}→ ${truncate(summary, maxLen)}${colors.reset}`);
|
|
153
|
+
}
|
|
154
|
+
// Clear active task
|
|
155
|
+
state.activeTask = null;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Format and display a Claude message
|
|
159
|
+
* Returns collected Claude text for signal detection
|
|
160
|
+
*/
|
|
161
|
+
export function formatMessage(msg, state, verbosity, _logger, // Reserved for future verbose logging
|
|
162
|
+
parallelThresholdMs) {
|
|
163
|
+
let claudeText = '';
|
|
164
|
+
if (isSystemInitMessage(msg)) {
|
|
165
|
+
if (verbosity !== 'quiet') {
|
|
166
|
+
console.log(`${colors.blue}[INIT]${colors.reset} ${msg.model} | ${msg.tools?.length ?? 0} tools`);
|
|
167
|
+
if (msg.mcp_servers && verbosity === 'verbose') {
|
|
168
|
+
const connected = msg.mcp_servers
|
|
169
|
+
.filter((s) => s.status === 'connected')
|
|
170
|
+
.map((s) => s.name);
|
|
171
|
+
const failed = msg.mcp_servers
|
|
172
|
+
.filter((s) => s.status === 'failed')
|
|
173
|
+
.map((s) => s.name);
|
|
174
|
+
if (connected.length) {
|
|
175
|
+
console.log(` ${colors.green}MCP:${colors.reset} ${connected.join(', ')}`);
|
|
176
|
+
}
|
|
177
|
+
if (failed.length) {
|
|
178
|
+
console.log(` ${colors.red}MCP failed:${colors.reset} ${failed.join(', ')}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else if (isAssistantMessage(msg)) {
|
|
184
|
+
flushPendingTools(state, verbosity);
|
|
185
|
+
for (const block of msg.message.content) {
|
|
186
|
+
if (isTextBlock(block)) {
|
|
187
|
+
claudeText += block.text + '\n';
|
|
188
|
+
if (verbosity === 'quiet') {
|
|
189
|
+
// Show answers but not thinking/status updates
|
|
190
|
+
if (!block.text.startsWith("I'll ") &&
|
|
191
|
+
!block.text.startsWith('Let me ')) {
|
|
192
|
+
console.log(`${colors.green}[ANSWER]${colors.reset} ${truncate(block.text, 500)}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
const maxLen = verbosity === 'verbose' ? 1000 : 300;
|
|
197
|
+
console.log(`${colors.green}[CLAUDE]${colors.reset} ${truncate(block.text, maxLen)}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else if (isToolUseBlock(block)) {
|
|
201
|
+
const now = Date.now();
|
|
202
|
+
// Record start time
|
|
203
|
+
state.toolStartTimes.set(block.id, now);
|
|
204
|
+
if (state.lastToolTime &&
|
|
205
|
+
now - state.lastToolTime < parallelThresholdMs) {
|
|
206
|
+
// Part of parallel batch
|
|
207
|
+
state.pendingTools.push({
|
|
208
|
+
name: block.name,
|
|
209
|
+
input: block.input,
|
|
210
|
+
id: block.id,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
// New batch
|
|
215
|
+
flushPendingTools(state, verbosity);
|
|
216
|
+
state.pendingTools.push({
|
|
217
|
+
name: block.name,
|
|
218
|
+
input: block.input,
|
|
219
|
+
id: block.id,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
state.lastToolTime = now;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
else if (isUserMessage(msg)) {
|
|
227
|
+
flushPendingTools(state, verbosity);
|
|
228
|
+
for (const block of msg.message.content) {
|
|
229
|
+
if (isToolResultBlock(block)) {
|
|
230
|
+
const toolUseId = block.tool_use_id;
|
|
231
|
+
const content = typeof block.content === 'string'
|
|
232
|
+
? block.content
|
|
233
|
+
: JSON.stringify(block.content);
|
|
234
|
+
// Calculate duration
|
|
235
|
+
let durationStr = '';
|
|
236
|
+
const startTime = state.toolStartTimes.get(toolUseId);
|
|
237
|
+
if (startTime !== undefined) {
|
|
238
|
+
const elapsed = Date.now() - startTime;
|
|
239
|
+
durationStr = ` ${colors.dim}(${formatDuration(elapsed)})${colors.reset}`;
|
|
240
|
+
state.toolStartTimes.delete(toolUseId);
|
|
241
|
+
}
|
|
242
|
+
// Check for tool errors
|
|
243
|
+
const isError = content.startsWith('<tool_use_error>') ||
|
|
244
|
+
content.startsWith('Error:') ||
|
|
245
|
+
content.startsWith('error:');
|
|
246
|
+
if (isError) {
|
|
247
|
+
console.log(` ${colors.red}ERROR: ${truncate(content, 100)}${colors.reset}${durationStr}`);
|
|
248
|
+
}
|
|
249
|
+
else if (state.activeTask?.id === toolUseId) {
|
|
250
|
+
// Task completing
|
|
251
|
+
printTaskResult(block, durationStr, verbosity, state);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
printToolResult(block, durationStr, verbosity, state);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else if (isResultMessage(msg)) {
|
|
260
|
+
flushPendingTools(state, verbosity);
|
|
261
|
+
if (verbosity !== 'quiet') {
|
|
262
|
+
const duration = msg.duration_ms
|
|
263
|
+
? `${(msg.duration_ms / 1000).toFixed(1)}s`
|
|
264
|
+
: '?';
|
|
265
|
+
console.log(`${colors.magenta}[DONE]${colors.reset} ${duration}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
if (verbosity === 'verbose') {
|
|
270
|
+
console.log(`${colors.dim}[${msg.type.toUpperCase()}] ${truncate(JSON.stringify(msg), 100)}${colors.reset}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return claudeText;
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../src/output/formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,cAAc,GAGf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAa5E,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,IAAI,GAAG,EAAE;KAC1B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAqB;IACvD,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC;IACxB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,UAAU,GAAG,IAA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C,CAAC,GAAG,CAAC;YACR,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CACT,GAAG,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,CAChG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File logging with ANSI stripping
|
|
3
|
+
*/
|
|
4
|
+
export interface Logger {
|
|
5
|
+
log(msg: string): void;
|
|
6
|
+
close(): void;
|
|
7
|
+
filePath: string | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create a logger that writes to a timestamped log file
|
|
11
|
+
*/
|
|
12
|
+
export declare function createLogger(enabled: boolean, logDir: string, commandName: string): Logger;
|
|
13
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/output/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,MAAM,CA8BR"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File logging with ANSI stripping
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { stripAnsi } from './colors.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create a logger that writes to a timestamped log file
|
|
9
|
+
*/
|
|
10
|
+
export function createLogger(enabled, logDir, commandName) {
|
|
11
|
+
if (!enabled) {
|
|
12
|
+
return {
|
|
13
|
+
log: () => undefined,
|
|
14
|
+
close: () => undefined,
|
|
15
|
+
filePath: null,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
// Ensure log directory exists
|
|
19
|
+
if (!fs.existsSync(logDir)) {
|
|
20
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
// Create timestamped filename
|
|
23
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
24
|
+
const sanitizedName = path.basename(commandName, '.txt');
|
|
25
|
+
const logFile = path.join(logDir, `${sanitizedName}-${timestamp}.log`);
|
|
26
|
+
const logStream = fs.createWriteStream(logFile, { flags: 'a' });
|
|
27
|
+
return {
|
|
28
|
+
log(msg) {
|
|
29
|
+
// Strip ANSI codes for clean log file
|
|
30
|
+
logStream.write(stripAnsi(msg) + '\n');
|
|
31
|
+
},
|
|
32
|
+
close() {
|
|
33
|
+
logStream.end();
|
|
34
|
+
},
|
|
35
|
+
filePath: logFile,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/output/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAgB,EAChB,MAAc,EACd,WAAmB;IAEnB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;YACpB,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;IACJ,CAAC;IAED,8BAA8B;IAC9B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,8BAA8B;IAC9B,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9E,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,aAAa,IAAI,SAAS,MAAM,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAEhE,OAAO;QACL,GAAG,CAAC,GAAW;YACb,sCAAsC;YACtC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,KAAK;YACH,SAAS,CAAC,GAAG,EAAE,CAAC;QAClB,CAAC;QACD,QAAQ,EAAE,OAAO;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parsers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/parsers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runner signal detection in Claude output
|
|
3
|
+
*/
|
|
4
|
+
import { type RunnerSignal } from '../types/runner.js';
|
|
5
|
+
/**
|
|
6
|
+
* Detect loop control signals in Claude's text output
|
|
7
|
+
* Returns null if no signal found
|
|
8
|
+
*/
|
|
9
|
+
export declare function detectRunnerSignal(text: string): RunnerSignal | null;
|
|
10
|
+
//# sourceMappingURL=signals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/parsers/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAcpE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runner signal detection in Claude output
|
|
3
|
+
*/
|
|
4
|
+
import { RUNNER_SIGNALS } from '../types/runner.js';
|
|
5
|
+
/**
|
|
6
|
+
* Detect loop control signals in Claude's text output
|
|
7
|
+
* Returns null if no signal found
|
|
8
|
+
*/
|
|
9
|
+
export function detectRunnerSignal(text) {
|
|
10
|
+
if (text.includes(RUNNER_SIGNALS.DONE)) {
|
|
11
|
+
return 'done';
|
|
12
|
+
}
|
|
13
|
+
if (text.includes(RUNNER_SIGNALS.CONTINUE)) {
|
|
14
|
+
return 'continue';
|
|
15
|
+
}
|
|
16
|
+
if (text.includes(RUNNER_SIGNALS.BLOCKED)) {
|
|
17
|
+
return 'blocked';
|
|
18
|
+
}
|
|
19
|
+
if (text.includes(RUNNER_SIGNALS.ERROR)) {
|
|
20
|
+
return 'error';
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=signals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/parsers/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AAEvE;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stream JSON parser for Claude CLI output
|
|
3
|
+
* Handles line-by-line JSON parsing with ANSI stripping
|
|
4
|
+
*/
|
|
5
|
+
import type { ClaudeMessage } from '../types/claude.js';
|
|
6
|
+
export interface StreamParser {
|
|
7
|
+
/** Process incoming data chunk, returns parsed messages */
|
|
8
|
+
process(data: string): ClaudeMessage[];
|
|
9
|
+
/** Get any remaining buffer content */
|
|
10
|
+
flush(): string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create a stream parser for Claude CLI JSON output
|
|
14
|
+
*/
|
|
15
|
+
export declare function createStreamParser(): StreamParser;
|
|
16
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/parsers/stream.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAAC;IACvC,uCAAuC;IACvC,KAAK,IAAI,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAyCjD"}
|