@crewhaus/tool-executor 0.2.3 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { CrewhausError } from "@crewhaus/errors";
1
+ import { CrewhausError, isRunFailedError } from "@crewhaus/errors";
2
2
  import { compilePattern, matchesPattern } from "@crewhaus/tool-permission-matcher";
3
3
  import { validateToolInput } from "@crewhaus/tool-validate";
4
4
  export class ToolPermissionError extends CrewhausError {
@@ -35,6 +35,13 @@ export async function executeTool(tool, rawInput, context) {
35
35
  return { toolUseId, content, isError: false };
36
36
  }
37
37
  catch (err) {
38
+ // v0.3.0 §7.1 — a RunFailedError is a terminal RUN verdict (e.g. a
39
+ // sub-agent's billing/auth failure escalated by the spawner), not a
40
+ // tool error: let it propagate so the run halts with its classified
41
+ // report instead of dissolving into an is_error string the model
42
+ // would try to talk its way past.
43
+ if (isRunFailedError(err))
44
+ throw err;
38
45
  const msg = err instanceof Error ? err.message : String(err);
39
46
  return { toolUseId, content: msg, isError: true };
40
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewhaus/tool-executor",
3
- "version": "0.2.3",
3
+ "version": "0.3.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.2.3",
19
- "@crewhaus/tool-catalog": "0.2.3",
20
- "@crewhaus/tool-validate": "0.2.3",
21
- "@crewhaus/tool-permission-matcher": "0.2.3",
22
- "@crewhaus/tool-builder": "0.2.3",
18
+ "@crewhaus/errors": "0.3.0",
19
+ "@crewhaus/tool-catalog": "0.3.0",
20
+ "@crewhaus/tool-validate": "0.3.0",
21
+ "@crewhaus/tool-permission-matcher": "0.3.0",
22
+ "@crewhaus/tool-builder": "0.3.0",
23
23
  "zod": "^3.23.8"
24
24
  },
25
25
  "license": "Apache-2.0",