ambitry 0.1.4 → 0.1.5

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 (2) hide show
  1. package/dist/parse.js +7 -2
  2. package/package.json +1 -1
package/dist/parse.js CHANGED
@@ -94,7 +94,11 @@ export class ResponseParser {
94
94
  this.outputTokens = e.message?.usage?.output_tokens ?? this.outputTokens;
95
95
  break;
96
96
  case 'content_block_start':
97
- if (e.content_block?.type === 'tool_use') {
97
+ // server_tool_use covers Anthropic's own tools (web search, code
98
+ // execution). They are calls the agent made and belong in the audit
99
+ // log; matching only tool_use leaves them invisible to both the trace
100
+ // and the policy.
101
+ if (e.content_block?.type === 'tool_use' || e.content_block?.type === 'server_tool_use') {
98
102
  this.partial.set(e.index, { name: e.content_block.name, json: '' });
99
103
  }
100
104
  break;
@@ -176,7 +180,8 @@ export class ResponseParser {
176
180
  this.outputTokens = json.usage?.output_tokens ?? null;
177
181
  const content = json.content ?? [];
178
182
  for (let i = 0; i < content.length; i++) {
179
- if (content[i]?.type === 'tool_use') {
183
+ const type = content[i]?.type;
184
+ if (type === 'tool_use' || type === 'server_tool_use') {
180
185
  this.done.push({ name: content[i].name, input: content[i].input ?? {}, index: i });
181
186
  }
182
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ambitry",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Audit log and permission layer for AI agents. One-line integration, zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "bin": {