anyclaude-sdk 0.8.0 → 0.8.1

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/README.md +15 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -386,6 +386,20 @@ npm create anyclaude-app@latest my-app # template: bolt — WebContainer + cha
386
386
 
387
387
  The `bolt` template wires `useWebContainerPreview({ wc })` (boot a dev server → live preview URL) + a browser-side `query()` + the IDE components. See [`anyclaude-react`](#react-ui-kit--anyclaude-react).
388
388
 
389
+ ## Token efficiency — deferred tools
390
+
391
+ Keep a large pool of rarely-used tools **out of the per-turn payload** (big savings on weak/uncached models) while staying discoverable + callable. Mark them deferred; `tool_search` indexes them and the loop **arms** a tool (sends its schema on subsequent turns) once search surfaces it — then it executes normally.
392
+
393
+ ```ts
394
+ query({ prompt, workspace, llm,
395
+ extraTools: [deploy, ...integrationTools], // e.g. 35 integration tools
396
+ deferredTools: ['stripe_charge', 'supabase_query', /* … the niche ones */],
397
+ })
398
+ // or per-tool: defineTool({ name, description, parameters, run, defer: true })
399
+ ```
400
+
401
+ Only the lean core + `tool_search` are sent each turn; the model searches when it needs a niche tool, the SDK arms it, and the call goes through. Register 35, send ~10.
402
+
389
403
  ## Other niceties
390
404
 
391
405
  - **Live compaction marker** — `autoCompact` emits a `compact_boundary` with `status: 'start'` *before* summarizing (for a live "compacting…" shimmer) and `status: 'end'` after with `post_tokens`.
@@ -402,7 +416,7 @@ Runnable Vite projects in [`examples/`](examples/): **`browser-ide`** (WebContai
402
416
  - `prompt: string | AsyncIterable<SDKUserMessage>`
403
417
  - `workspace: FileSystem & CommandExecutor`
404
418
  - `llm: LLMClient`
405
- - `tools?`, `extraTools?`, `allowedTools?`/`disallowedTools?`, `model?`, `systemPrompt?`/`appendSystemPrompt?`, `maxTurns?` (default 50), `cwd?`, `abortController?`
419
+ - `tools?`, `extraTools?`, `allowedTools?`/`disallowedTools?`, `deferredTools?` (lazy-load), `model?`, `systemPrompt?`/`appendSystemPrompt?`, `maxTurns?` (default 50), `cwd?`, `abortController?`
406
420
  - serverless: `sessionStore?`, `resume?`, `maxDurationMs?`, `continueRun?`
407
421
  - client tools: `clientTools?`, `clientToolResults?`; interactive: `onAskUser?`
408
422
  - also: `mcpServers?`, `agents?`, `commands?`, `hooks?`, `background?`, `team?`, `memory?`, `permissionMode?`/`canUseTool?`, `messageQueue?`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anyclaude-sdk",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Standalone, browser-compatible SDK providing Claude Code agent capabilities (tools, tool loop, multi-turn, MCP, sub-agents, sessions) against any OpenAI/Anthropic-compatible LLM endpoint. Runs in the browser (WebContainer), Node, and Bun — no backend required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",