@t2000/engine 0.46.13 → 0.46.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.
- package/dist/index.d.ts +7 -0
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1460,6 +1460,13 @@ declare class EarlyToolDispatcher {
|
|
|
1460
1460
|
hasPending(): boolean;
|
|
1461
1461
|
/** List of call IDs that were early-dispatched. */
|
|
1462
1462
|
dispatchedIds(): Set<string>;
|
|
1463
|
+
/**
|
|
1464
|
+
* Look up the original tool input by `tool_use_id`. Used by the engine to
|
|
1465
|
+
* feed `updateGuardStateAfterToolResult` (which needs the call input to
|
|
1466
|
+
* record swap_quote → swap_execute pairing, etc.) for tools that were
|
|
1467
|
+
* dispatched here instead of going through the normal post-stream loop.
|
|
1468
|
+
*/
|
|
1469
|
+
getInputById(toolUseId: string): unknown | undefined;
|
|
1463
1470
|
/**
|
|
1464
1471
|
* Collect all results in original dispatch order.
|
|
1465
1472
|
* Yields `tool_result` events as each promise resolves.
|
package/dist/index.js
CHANGED
|
@@ -4608,6 +4608,15 @@ var EarlyToolDispatcher = class {
|
|
|
4608
4608
|
dispatchedIds() {
|
|
4609
4609
|
return new Set(this.entries.map((e) => e.call.id));
|
|
4610
4610
|
}
|
|
4611
|
+
/**
|
|
4612
|
+
* Look up the original tool input by `tool_use_id`. Used by the engine to
|
|
4613
|
+
* feed `updateGuardStateAfterToolResult` (which needs the call input to
|
|
4614
|
+
* record swap_quote → swap_execute pairing, etc.) for tools that were
|
|
4615
|
+
* dispatched here instead of going through the normal post-stream loop.
|
|
4616
|
+
*/
|
|
4617
|
+
getInputById(toolUseId) {
|
|
4618
|
+
return this.entries.find((e) => e.call.id === toolUseId)?.call.input;
|
|
4619
|
+
}
|
|
4611
4620
|
/**
|
|
4612
4621
|
* Collect all results in original dispatch order.
|
|
4613
4622
|
* Yields `tool_result` events as each promise resolves.
|
|
@@ -5163,10 +5172,11 @@ ${recipeCtx}`;
|
|
|
5163
5172
|
}
|
|
5164
5173
|
}
|
|
5165
5174
|
const tool = findTool(this.tools, earlyEvent.toolName);
|
|
5175
|
+
const earlyInput = dispatcher.getInputById(earlyEvent.toolUseId) ?? null;
|
|
5166
5176
|
updateGuardStateAfterToolResult(
|
|
5167
5177
|
earlyEvent.toolName,
|
|
5168
5178
|
tool,
|
|
5169
|
-
|
|
5179
|
+
earlyInput,
|
|
5170
5180
|
earlyEvent.result,
|
|
5171
5181
|
earlyEvent.isError,
|
|
5172
5182
|
this.guardState
|
|
@@ -5251,6 +5261,9 @@ ${recipeCtx}`;
|
|
|
5251
5261
|
const needsConfirmation = (() => {
|
|
5252
5262
|
if (!tool || tool.isReadOnly) return false;
|
|
5253
5263
|
if (tool.permissionLevel === "explicit") return true;
|
|
5264
|
+
if (tool.permissionLevel === "auto" && !toolNameToOperation(call.name)) {
|
|
5265
|
+
return false;
|
|
5266
|
+
}
|
|
5254
5267
|
if (!context.agent && !tool.isReadOnly) return true;
|
|
5255
5268
|
if (context.permissionConfig && context.priceCache) {
|
|
5256
5269
|
const operation = toolNameToOperation(call.name);
|