@anthropic-ai/claude-agent-sdk 0.3.280 → 0.3.282
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/README.md +4 -0
- package/bridge.d.ts +11 -1
- package/bridge.mjs +96 -157
- package/browser-sdk.js +56 -96
- package/core-276encc2.mjs +38 -0
- package/core-5drmq1nt.mjs +31 -0
- package/core.d.ts +20 -0
- package/core.mjs +41 -0
- package/manifest.json +24 -24
- package/manifest.zst.json +28 -28
- package/package.json +19 -11
- package/sdk-tools.d.ts +6 -6
- package/sdk.d.ts +280 -18
- package/sdk.mjs +85 -161
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@ Install the Claude Agent SDK:
|
|
|
16
16
|
npm install @anthropic-ai/claude-agent-sdk
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
## The `/core` entry (for apps that bundle the SDK)
|
|
20
|
+
|
|
21
|
+
`@anthropic-ai/claude-agent-sdk/core` exports the same `query()`, `startup()`, `tool()`, `createSdkMcpServer()`, `renameSession()`/`tagSession()`/`deleteSession()`, `resolveSettings()`/`filterEscalatingDefaultMode()` and runtime constants as the root entry, and nothing else — no session listing/reading/import helpers — so its eagerly loaded code is about a fifth of the root's; the settings resolver behind `resolveSettings()` loads on first call. Unlike the root entry it does **not** inline the SDK's peer dependencies: `zod` (^4, as declared in this package's `peerDependencies`) and `@modelcontextprotocol/sdk` (^1.29) are imported from your install — specifically the `zod/v4` subpath, plus `zod/v3` when the settings resolver loads — which is what you want when your bundler already carries them. (zod 3.25+, which carries the v4 engine under `zod/v4`, also works in practice, but ^4 is the supported range.) Import from **either** the root **or** `/core` in a given process, not both — they are separate bundles, and mixing them loads two copies of the SDK's classes and state. Its types require TypeScript 5.0+.
|
|
22
|
+
|
|
19
23
|
## Compiled binaries (`bun build --compile`)
|
|
20
24
|
|
|
21
25
|
When bundling your application into a single executable with `bun build --compile`, the SDK cannot resolve the native CLI binary at runtime — `require.resolve` doesn't work from inside the compiled `$bunfs` (or `B:\~BUN\...` on Windows) virtual filesystem.
|
package/bridge.d.ts
CHANGED
|
@@ -181,7 +181,17 @@ export type AttachBridgeSessionOptions = {
|
|
|
181
181
|
ok: false;
|
|
182
182
|
error: string;
|
|
183
183
|
}>;
|
|
184
|
-
onSetMaxThinkingTokens?: (tokens: number | null | undefined, thinkingDisplay?: 'summarized' | 'omitted' | 'highlights' | null) =>
|
|
184
|
+
onSetMaxThinkingTokens?: (tokens: number | null | undefined, thinkingDisplay?: 'summarized' | 'omitted' | 'highlights' | null) => {
|
|
185
|
+
ok: true;
|
|
186
|
+
} | {
|
|
187
|
+
ok: false;
|
|
188
|
+
error: string;
|
|
189
|
+
} | void | Promise<{
|
|
190
|
+
ok: true;
|
|
191
|
+
} | {
|
|
192
|
+
ok: false;
|
|
193
|
+
error: string;
|
|
194
|
+
} | void>;
|
|
185
195
|
/**
|
|
186
196
|
* `set_permission_mode` from claude.ai. Return an error verdict to send
|
|
187
197
|
* an error control_response (vs silently false-succeeding). Omit if
|