@1presence/bridge 0.1.14 → 0.1.16
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 +12 -3
- package/dist/index.js +0 -0
- package/package.json +1 -1
package/dist/claude.js
CHANGED
|
@@ -63,11 +63,10 @@ function spawnClaude(params) {
|
|
|
63
63
|
}
|
|
64
64
|
const keySource = event['apiKeySource'];
|
|
65
65
|
const model = event['model'];
|
|
66
|
-
|
|
67
|
-
process.stderr.write(`[bridge] model: ${model ?? 'unknown'} auth: ${authLabel}\n`);
|
|
66
|
+
process.stderr.write(`[bridge] model: ${model ?? 'unknown'} apiKeySource: ${keySource ?? 'none'}\n`);
|
|
68
67
|
sessionIdExtracted = true;
|
|
69
68
|
}
|
|
70
|
-
// Count complete assistant turns + accumulate token usage
|
|
69
|
+
// Count complete assistant turns + accumulate token usage + log tool calls
|
|
71
70
|
if (type === 'assistant') {
|
|
72
71
|
messageCount++;
|
|
73
72
|
const msg = event['message'];
|
|
@@ -78,6 +77,16 @@ function spawnClaude(params) {
|
|
|
78
77
|
output_tokens: (usage?.output_tokens ?? 0) + (u['output_tokens'] ?? 0),
|
|
79
78
|
};
|
|
80
79
|
}
|
|
80
|
+
const content = msg?.['content'];
|
|
81
|
+
if (Array.isArray(content)) {
|
|
82
|
+
for (const block of content) {
|
|
83
|
+
if (block['type'] === 'tool_use') {
|
|
84
|
+
const toolName = block['name'];
|
|
85
|
+
const prefix = toolName.startsWith('mcp__') ? '[mcp]' : '[tool]';
|
|
86
|
+
process.stderr.write(`[bridge] ${prefix} ${toolName}\n`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
81
90
|
}
|
|
82
91
|
// Extract cost from the final result event
|
|
83
92
|
if (type === 'result') {
|
package/dist/index.js
CHANGED
|
File without changes
|