@1presence/bridge 0.1.16 → 0.1.17
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/claude.js +14 -0
- package/package.json +1 -1
package/dist/claude.js
CHANGED
|
@@ -79,13 +79,27 @@ function spawnClaude(params) {
|
|
|
79
79
|
}
|
|
80
80
|
const content = msg?.['content'];
|
|
81
81
|
if (Array.isArray(content)) {
|
|
82
|
+
let wroteText = false;
|
|
82
83
|
for (const block of content) {
|
|
83
84
|
if (block['type'] === 'tool_use') {
|
|
85
|
+
if (wroteText) {
|
|
86
|
+
process.stderr.write('\n');
|
|
87
|
+
wroteText = false;
|
|
88
|
+
}
|
|
84
89
|
const toolName = block['name'];
|
|
85
90
|
const prefix = toolName.startsWith('mcp__') ? '[mcp]' : '[tool]';
|
|
86
91
|
process.stderr.write(`[bridge] ${prefix} ${toolName}\n`);
|
|
87
92
|
}
|
|
93
|
+
else if (block['type'] === 'text') {
|
|
94
|
+
const text = block['text'];
|
|
95
|
+
if (text) {
|
|
96
|
+
process.stderr.write(text.replace(/\n+/g, ' '));
|
|
97
|
+
wroteText = true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
88
100
|
}
|
|
101
|
+
if (wroteText)
|
|
102
|
+
process.stderr.write('\n');
|
|
89
103
|
}
|
|
90
104
|
}
|
|
91
105
|
// Extract cost from the final result event
|