@crewhaus/tool-executor 0.5.7 → 0.6.0
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 +9 -1
- package/dist/index.js +2 -0
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CrewhausError } from "@crewhaus/errors";
|
|
2
|
-
import type { RegisteredTool, ToolExecuteResult } from "@crewhaus/tool-catalog";
|
|
2
|
+
import type { RegisteredTool, ToolExecuteModel, ToolExecuteResult } from "@crewhaus/tool-catalog";
|
|
3
3
|
/**
|
|
4
4
|
* Section 14 — `content` widened from `string` to `string | ToolResultContent`
|
|
5
5
|
* so tools like `ReadImage` can return Anthropic image content blocks. Error
|
|
@@ -29,6 +29,14 @@ export type ExecutionContext = {
|
|
|
29
29
|
* bus as `tool_stream_chunk` events.
|
|
30
30
|
*/
|
|
31
31
|
readonly onStreamChunk?: (stream: "stdout" | "stderr", chunk: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 0.6.0 §4.4 — the serving model (pool runs only) and this tool's
|
|
34
|
+
* per-candidate `tool_config` override, forwarded verbatim into the tool's
|
|
35
|
+
* `ToolExecuteContext.model` / `.toolConfig`. Both presence-gated: a call
|
|
36
|
+
* without them hands the tool the exact pre-0.6.0 context.
|
|
37
|
+
*/
|
|
38
|
+
readonly model?: ToolExecuteModel;
|
|
39
|
+
readonly toolConfig?: unknown;
|
|
32
40
|
};
|
|
33
41
|
export declare class ToolPermissionError extends CrewhausError {
|
|
34
42
|
readonly name = "ToolPermissionError";
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,8 @@ export async function executeTool(tool, rawInput, context) {
|
|
|
31
31
|
signal: context.signal,
|
|
32
32
|
...(context.bridge !== undefined ? { bridge: context.bridge } : {}),
|
|
33
33
|
...(context.onStreamChunk !== undefined ? { onStreamChunk: context.onStreamChunk } : {}),
|
|
34
|
+
...(context.model !== undefined ? { model: context.model } : {}),
|
|
35
|
+
...(context.toolConfig !== undefined ? { toolConfig: context.toolConfig } : {}),
|
|
34
36
|
});
|
|
35
37
|
return { toolUseId, content, isError: false };
|
|
36
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewhaus/tool-executor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Execute a single tool: validate → permission-check → invoke → format result",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"test": "bun test src"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@crewhaus/errors": "0.
|
|
19
|
-
"@crewhaus/tool-catalog": "0.
|
|
20
|
-
"@crewhaus/tool-validate": "0.
|
|
21
|
-
"@crewhaus/tool-permission-matcher": "0.
|
|
22
|
-
"@crewhaus/tool-builder": "0.
|
|
18
|
+
"@crewhaus/errors": "0.6.0",
|
|
19
|
+
"@crewhaus/tool-catalog": "0.6.0",
|
|
20
|
+
"@crewhaus/tool-validate": "0.6.0",
|
|
21
|
+
"@crewhaus/tool-permission-matcher": "0.6.0",
|
|
22
|
+
"@crewhaus/tool-builder": "0.6.0",
|
|
23
23
|
"zod": "^3.23.8"
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|