@loom-framework/backend 0.1.0-alpha.13 → 0.1.0-alpha.15
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.
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Parses `claude -p --output-format stream-json --verbose --include-partial-messages` output stream.
|
|
5
5
|
* Supports real-time streaming with thinking, tool calls, and text deltas.
|
|
6
|
+
*
|
|
7
|
+
* Key insight: Tool input comes via input_json_delta events, need to accumulate them.
|
|
6
8
|
*/
|
|
7
9
|
import type { AIChunk } from '@loom-framework/core';
|
|
8
10
|
/** Parser log entry for diagnostics */
|
|
@@ -21,6 +23,7 @@ export type ParserLogger = (entry: ParserLogEntry) => void;
|
|
|
21
23
|
* 2. Strip ANSI escape codes
|
|
22
24
|
* 3. Parse each line as JSON
|
|
23
25
|
* 4. Map to appropriate AIChunk types
|
|
26
|
+
* 5. Accumulate tool input from input_json_delta events
|
|
24
27
|
*/
|
|
25
28
|
export declare function parseClaudeOutput(stdout: NodeJS.ReadableStream, logger?: ParserLogger): AsyncGenerator<AIChunk>;
|
|
26
29
|
//# sourceMappingURL=output-parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-parser.d.ts","sourceRoot":"","sources":["../../src/ai/output-parser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"output-parser.d.ts","sourceRoot":"","sources":["../../src/ai/output-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,sBAAsB,CAAC;AAE7D,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,gBAAgB,GAAG,aAAa,GAAG,aAAa,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;AA0F3D;;;;;;;;;GASG;AACH,wBAAuB,iBAAiB,CACtC,MAAM,EAAE,MAAM,CAAC,cAAc,EAC7B,MAAM,CAAC,EAAE,YAAY,GACpB,cAAc,CAAC,OAAO,CAAC,CAgCzB"}
|
package/dist/ai/output-parser.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Parses `claude -p --output-format stream-json --verbose --include-partial-messages` output stream.
|
|
5
5
|
* Supports real-time streaming with thinking, tool calls, and text deltas.
|
|
6
|
+
*
|
|
7
|
+
* Key insight: Tool input comes via input_json_delta events, need to accumulate them.
|
|
6
8
|
*/
|
|
7
9
|
/** ANSI escape code pattern */
|
|
8
10
|
const ANSI_ESCAPE = /\x1b\[[0-9;]*m/g;
|
|
@@ -14,10 +16,15 @@ const ANSI_ESCAPE = /\x1b\[[0-9;]*m/g;
|
|
|
14
16
|
* 2. Strip ANSI escape codes
|
|
15
17
|
* 3. Parse each line as JSON
|
|
16
18
|
* 4. Map to appropriate AIChunk types
|
|
19
|
+
* 5. Accumulate tool input from input_json_delta events
|
|
17
20
|
*/
|
|
18
21
|
export async function* parseClaudeOutput(stdout, logger) {
|
|
19
22
|
let buffer = '';
|
|
20
|
-
|
|
23
|
+
const state = {
|
|
24
|
+
toolInputBuffers: new Map(),
|
|
25
|
+
activeToolId: null,
|
|
26
|
+
activeToolName: null,
|
|
27
|
+
};
|
|
21
28
|
for await (const chunk of stdout) {
|
|
22
29
|
buffer += chunk.toString();
|
|
23
30
|
// Process complete lines
|
|
@@ -27,11 +34,8 @@ export async function* parseClaudeOutput(stdout, logger) {
|
|
|
27
34
|
const trimmed = line.trim();
|
|
28
35
|
if (!trimmed)
|
|
29
36
|
continue;
|
|
30
|
-
const chunks = parseLine(trimmed, logger,
|
|
37
|
+
const chunks = parseLine(trimmed, logger, state);
|
|
31
38
|
for (const c of chunks) {
|
|
32
|
-
if (c.type === 'tool_call' && c.toolUseId) {
|
|
33
|
-
currentToolUseId = c.toolUseId;
|
|
34
|
-
}
|
|
35
39
|
yield c;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
@@ -39,23 +43,23 @@ export async function* parseClaudeOutput(stdout, logger) {
|
|
|
39
43
|
// Process any remaining buffer
|
|
40
44
|
if (buffer.trim()) {
|
|
41
45
|
const cleanOutput = buffer.replace(ANSI_ESCAPE, '').trim();
|
|
42
|
-
const chunks = parseLine(cleanOutput, logger,
|
|
46
|
+
const chunks = parseLine(cleanOutput, logger, state);
|
|
43
47
|
for (const c of chunks)
|
|
44
48
|
yield c;
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
|
-
function parseLine(line, logger,
|
|
51
|
+
function parseLine(line, logger, state) {
|
|
48
52
|
try {
|
|
49
53
|
const data = JSON.parse(line);
|
|
50
54
|
logger?.({ type: 'LINE_PARSED', timestamp: new Date().toISOString(), message: `Parsed ${data.type}` });
|
|
51
|
-
return mapToChunks(data,
|
|
55
|
+
return mapToChunks(data, state);
|
|
52
56
|
}
|
|
53
57
|
catch {
|
|
54
58
|
logger?.({ type: 'PARSE_ERROR', timestamp: new Date().toISOString(), message: 'Failed to parse line', data: line.slice(0, 200) });
|
|
55
59
|
return [];
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
|
-
function mapToChunks(data,
|
|
62
|
+
function mapToChunks(data, state) {
|
|
59
63
|
switch (data.type) {
|
|
60
64
|
case 'system':
|
|
61
65
|
if (data.subtype === 'init' && data.session_id) {
|
|
@@ -63,11 +67,10 @@ function mapToChunks(data, currentToolUseId) {
|
|
|
63
67
|
}
|
|
64
68
|
return [];
|
|
65
69
|
case 'stream_event':
|
|
66
|
-
return handleStreamEvent(data);
|
|
70
|
+
return handleStreamEvent(data, state);
|
|
67
71
|
case 'assistant':
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
return [];
|
|
72
|
+
// Process assistant message - it contains complete tool_use with full input
|
|
73
|
+
return handleAssistantMessage(data, state);
|
|
71
74
|
case 'user':
|
|
72
75
|
return handleUserMessage(data);
|
|
73
76
|
case 'result':
|
|
@@ -76,46 +79,110 @@ function mapToChunks(data, currentToolUseId) {
|
|
|
76
79
|
return [];
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
|
-
function handleStreamEvent(wrapper) {
|
|
82
|
+
function handleStreamEvent(wrapper, state) {
|
|
80
83
|
const { event } = wrapper;
|
|
81
84
|
switch (event.type) {
|
|
82
85
|
case 'content_block_delta':
|
|
86
|
+
// Handle thinking and text deltas
|
|
83
87
|
if (event.delta?.type === 'thinking_delta' && event.delta.thinking) {
|
|
84
88
|
return [{ type: 'thinking', content: event.delta.thinking }];
|
|
85
89
|
}
|
|
86
90
|
if (event.delta?.type === 'text_delta' && event.delta.text) {
|
|
87
91
|
return [{ type: 'content', content: event.delta.text }];
|
|
88
92
|
}
|
|
93
|
+
// Handle tool input JSON delta - accumulate it
|
|
94
|
+
if (event.delta?.type === 'input_json_delta' && event.delta.partial_json) {
|
|
95
|
+
if (state.activeToolId) {
|
|
96
|
+
const current = state.toolInputBuffers.get(state.activeToolId) || '';
|
|
97
|
+
state.toolInputBuffers.set(state.activeToolId, current + event.delta.partial_json);
|
|
98
|
+
}
|
|
99
|
+
return []; // Don't emit until tool call is complete
|
|
100
|
+
}
|
|
89
101
|
return [];
|
|
90
102
|
case 'content_block_start':
|
|
91
103
|
if (event.content_block?.type === 'tool_use') {
|
|
104
|
+
const toolUseId = event.content_block.id || '';
|
|
105
|
+
const toolName = event.content_block.name || 'unknown';
|
|
106
|
+
// Set active tool for accumulation
|
|
107
|
+
state.activeToolId = toolUseId;
|
|
108
|
+
state.activeToolName = toolName;
|
|
109
|
+
// Initialize buffer if there's already input
|
|
110
|
+
if (event.content_block.input !== undefined) {
|
|
111
|
+
state.toolInputBuffers.set(toolUseId, JSON.stringify(event.content_block.input));
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
state.toolInputBuffers.set(toolUseId, '');
|
|
115
|
+
}
|
|
116
|
+
// Emit tool_call without input yet (will be updated later)
|
|
92
117
|
return [{
|
|
93
118
|
type: 'tool_call',
|
|
94
|
-
toolUseId
|
|
95
|
-
toolName
|
|
119
|
+
toolUseId,
|
|
120
|
+
toolName,
|
|
96
121
|
toolInput: event.content_block.input,
|
|
97
122
|
}];
|
|
98
123
|
}
|
|
99
124
|
return [];
|
|
125
|
+
case 'content_block_stop':
|
|
126
|
+
// When content block stops, emit the complete tool input if we have one
|
|
127
|
+
if (state.activeToolId && event.index !== undefined) {
|
|
128
|
+
const accumulatedInput = state.toolInputBuffers.get(state.activeToolId);
|
|
129
|
+
if (accumulatedInput && state.activeToolName) {
|
|
130
|
+
try {
|
|
131
|
+
const parsedInput = JSON.parse(accumulatedInput);
|
|
132
|
+
// Emit update with complete input
|
|
133
|
+
const chunks = [{
|
|
134
|
+
type: 'tool_call',
|
|
135
|
+
toolUseId: state.activeToolId,
|
|
136
|
+
toolName: state.activeToolName,
|
|
137
|
+
toolInput: parsedInput,
|
|
138
|
+
}];
|
|
139
|
+
state.activeToolId = null;
|
|
140
|
+
state.activeToolName = null;
|
|
141
|
+
return chunks;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// JSON not complete yet, keep state
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
state.activeToolId = null;
|
|
148
|
+
state.activeToolName = null;
|
|
149
|
+
}
|
|
150
|
+
return [];
|
|
100
151
|
default:
|
|
101
152
|
return [];
|
|
102
153
|
}
|
|
103
154
|
}
|
|
104
|
-
function handleAssistantMessage(data) {
|
|
155
|
+
function handleAssistantMessage(data, state) {
|
|
105
156
|
const chunks = [];
|
|
106
157
|
for (const block of data.message.content || []) {
|
|
107
158
|
if (block.type === 'thinking' && block.thinking) {
|
|
108
|
-
|
|
159
|
+
// Skip - already sent via thinking_delta
|
|
109
160
|
}
|
|
110
161
|
if (block.type === 'text' && block.text) {
|
|
111
|
-
|
|
162
|
+
// Skip - already sent via text_delta
|
|
112
163
|
}
|
|
113
164
|
if (block.type === 'tool_use') {
|
|
165
|
+
// Assistant message contains complete tool_use with full input
|
|
166
|
+
// Use the accumulated input if we have it, otherwise use the block's input
|
|
167
|
+
const toolUseId = block.id || '';
|
|
168
|
+
const accumulatedInput = state.toolInputBuffers.get(toolUseId);
|
|
169
|
+
let toolInput;
|
|
170
|
+
if (accumulatedInput) {
|
|
171
|
+
try {
|
|
172
|
+
toolInput = JSON.parse(accumulatedInput);
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
toolInput = block.input;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
toolInput = block.input;
|
|
180
|
+
}
|
|
114
181
|
chunks.push({
|
|
115
182
|
type: 'tool_call',
|
|
116
|
-
toolUseId
|
|
183
|
+
toolUseId,
|
|
117
184
|
toolName: block.name || 'unknown',
|
|
118
|
-
toolInput
|
|
185
|
+
toolInput,
|
|
119
186
|
});
|
|
120
187
|
}
|
|
121
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-parser.js","sourceRoot":"","sources":["../../src/ai/output-parser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"output-parser.js","sourceRoot":"","sources":["../../src/ai/output-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4FH,+BAA+B;AAC/B,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAStC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,iBAAiB,CACtC,MAA6B,EAC7B,MAAqB;IAErB,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,KAAK,GAAgB;QACzB,gBAAgB,EAAE,IAAI,GAAG,EAAE;QAC3B,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,IAAI;KACrB,CAAC;IAEF,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,C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UAAU;QAAE,OAAO,SAAS,CAAC;IAClC,OAAO;QACL,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,aAAa,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loom-framework/backend",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.15",
|
|
4
4
|
"description": "Loom framework backend - AI communication, SSE chat, REST routes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lint": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@loom-framework/core": "^0.1.0-alpha.
|
|
28
|
+
"@loom-framework/core": "^0.1.0-alpha.15",
|
|
29
29
|
"fastify": "^5.2.0",
|
|
30
30
|
"@fastify/cors": "^10.0.0",
|
|
31
31
|
"@fastify/static": "^8.0.0"
|