@anthropic-ai/claude-agent-sdk 0.3.143 → 0.3.145

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 CHANGED
@@ -16,6 +16,27 @@ Install the Claude Agent SDK:
16
16
  npm install @anthropic-ai/claude-agent-sdk
17
17
  ```
18
18
 
19
+ ## Compiled binaries (`bun build --compile`)
20
+
21
+ 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.
22
+
23
+ Embed the platform-specific binary as a file asset, extract it to a real path, and pass it explicitly:
24
+
25
+ ```js
26
+ import binPath from '@anthropic-ai/claude-agent-sdk-darwin-arm64/claude' with { type: 'file' }
27
+ import { extractFromBunfs } from '@anthropic-ai/claude-agent-sdk/extract'
28
+ import { query } from '@anthropic-ai/claude-agent-sdk'
29
+
30
+ const cliPath = extractFromBunfs(binPath)
31
+
32
+ for await (const message of query({
33
+ prompt: '…',
34
+ options: { pathToClaudeCodeExecutable: cliPath },
35
+ })) { /* … */ }
36
+ ```
37
+
38
+ Each compiled executable embeds one platform's binary, matching your `--target`. Cross-compiling requires installing the non-matching platform package (e.g. `npm install @anthropic-ai/claude-agent-sdk-linux-x64 --force`). On Windows the binary subpath is `/claude.exe` (e.g. `@anthropic-ai/claude-agent-sdk-win32-x64/claude.exe`).
39
+
19
40
  ## Migrating from the Claude Code SDK
20
41
 
21
42
  The Claude Code SDK is now the Claude Agent SDK. Please check out the [migration guide](https://platform.claude.com/docs/en/agent-sdk/migration-guide) for details on breaking changes.