@warble/claude-agent-sdk 0.17.0 → 0.18.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/cli.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  preflightDispatchAssets,
17
17
  prepareDispatch,
18
18
  prepareDisplayManifest
19
- } from "./chunk-74JAAZB7.js";
19
+ } from "./chunk-MIW7NT66.js";
20
20
 
21
21
  // src/cli.ts
22
22
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Query, Options, CanUseTool, HookCallbackMatcher, NonNullableUsage, ModelUsage, SDKMessage } from '@anthropic-ai/claude-agent-sdk';
1
+ import { Query, Options, CanUseTool, HookCallbackMatcher, PermissionResult, NonNullableUsage, ModelUsage, SDKMessage } from '@anthropic-ai/claude-agent-sdk';
2
2
 
3
3
  /**
4
4
  * Dispatch-time error — the TS analogue of the Rust back-end's `DispatchError`.
@@ -823,9 +823,19 @@ declare function fingerprintPrompts(plan: DispatchPlan): PromptFingerprint;
823
823
  * An embedder denial returns immediately without consulting the floor, so the floor's `denials`
824
824
  * ledger stays a record of guardrail enforcement rather than a mixed log of both parties.
825
825
  *
826
+ * An embedder that returns `null` has answered the permission request out-of-band. The floor cannot
827
+ * see that answer, so it cannot compose with it: the composed callback denies instead, fail-closed.
828
+ * The SDK then writes that denial to the control channel too, alongside the embedder's own answer;
829
+ * whichever the CLI honours, the worst case is a refused tool call, never an unchecked one.
830
+ *
826
831
  * With no embedder callback the floor's own callback is returned unchanged, so a run without an
827
832
  * embedder behaves exactly as it did before this seam existed.
828
833
  */
834
+ /**
835
+ * A `CanUseTool` that always decides: it never returns `null` (the SDK's "answered out-of-band"
836
+ * signal). Warble's own guard is one, and it is assignable wherever a `CanUseTool` is expected.
837
+ */
838
+ type DecidingCanUseTool = (...args: Parameters<CanUseTool>) => Promise<PermissionResult>;
829
839
  declare function composeCanUseTool(embedder: CanUseTool | undefined, floor: CanUseTool): CanUseTool;
830
840
  /**
831
841
  * Merge an embedding host's `hooks` with a guardrail's `PreToolUse` matchers, appending the
@@ -902,7 +912,7 @@ interface GuardConfig {
902
912
  * Fail-closed: anything not explicitly permitted by `canUseTool` is denied with guidance.
903
913
  */
904
914
  declare function makeReadOnlyGuard(cfg: GuardConfig): {
905
- canUseTool: CanUseTool;
915
+ canUseTool: DecidingCanUseTool;
906
916
  denials: Denial[];
907
917
  hooks: HookCallbackMatcher[];
908
918
  };
package/dist/index.js CHANGED
@@ -86,7 +86,7 @@ import {
86
86
  shouldSplitPerStepTier,
87
87
  usesLocalProvider,
88
88
  validateAssets
89
- } from "./chunk-74JAAZB7.js";
89
+ } from "./chunk-MIW7NT66.js";
90
90
  export {
91
91
  COMPONENT_TYPES,
92
92
  ChatSession,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warble/claude-agent-sdk",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Warble back-end: Claude Agent SDK query() loop dispatcher (embeddable library + CLI)",
@@ -55,7 +55,7 @@
55
55
  "test:live": "node --import tsx --test tests/*.live.ts"
56
56
  },
57
57
  "dependencies": {
58
- "@anthropic-ai/claude-agent-sdk": "^0.1.0",
58
+ "@anthropic-ai/claude-agent-sdk": "^0.3.296",
59
59
  "yaml": "^2.9.0",
60
60
  "zod": "^4.4.3"
61
61
  },
@@ -63,8 +63,8 @@
63
63
  "@warble/ir-spec": "0.9.x"
64
64
  },
65
65
  "devDependencies": {
66
- "@warble/ir-spec": "file:../../packages/ir-spec",
67
66
  "@types/node": "^22",
67
+ "@warble/ir-spec": "file:../../packages/ir-spec",
68
68
  "tsup": "^8",
69
69
  "tsx": "^4",
70
70
  "typescript": "^5"