[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-ai-code-mode":3,"mdc--5399t9-key":54,"related-repo-tanstack-ai-code-mode":8997,"related-org-tanstack-ai-code-mode":9092},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":49,"sourceUrl":52,"mdContent":53},"ai-code-mode","execute sandboxed TypeScript code with LLMs","LLM-generated TypeScript execution in sandboxed environments: createCodeModeTool() with isolate drivers (createNodeIsolateDriver, createQuickJSIsolateDriver, createCloudflareIsolateDriver), codeModeWithSkills() for persistent skill libraries, trust strategies, skill storage (FileSystem, LocalStorage, InMemory, Mongo), client-side execution progress via code_mode:* custom events in useChat.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"tanstack","TanStack","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftanstack.png",[12,16,19,22,25],{"name":13,"slug":14,"type":15},"TypeScript","typescript","tag",{"name":17,"slug":18,"type":15},"Sandboxing","sandboxing",{"name":20,"slug":21,"type":15},"AI SDK","ai-sdk",{"name":23,"slug":24,"type":15},"Code Execution","code-execution",{"name":9,"slug":8,"type":15},2884,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai","2026-07-16T06:04:13.597905",null,269,[32,33,21,34,35,36,37,38,39,40,41,42,43,44,45,8,46,14,47,48],"ai","ai-agents","anthropic","chatbot","function-calling","gemini","generative-ai","llm","multimodal","openai","react","solidjs","streaming","svelte","tool-calling","typescript-sdk","vue",{"repoUrl":27,"stars":26,"forks":30,"topics":50,"description":51},[32,33,21,34,35,36,37,38,39,40,41,42,43,44,45,8,46,14,47,48],"🤖 Type-safe, provider-agnostic TypeScript AI SDK for streaming chat, tool calling, agents, and multimodal apps across OpenAI, Anthropic, Gemini, React, Vue, Svelte, and Solid.","https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai\u002Ftree\u002FHEAD\u002Fpackages\u002Fai-code-mode\u002Fskills\u002Fai-code-mode","---\nname: ai-code-mode\ndescription: >\n  LLM-generated TypeScript execution in sandboxed environments:\n  createCodeModeTool() with isolate drivers (createNodeIsolateDriver,\n  createQuickJSIsolateDriver, createCloudflareIsolateDriver),\n  codeModeWithSkills() for persistent skill libraries, trust strategies,\n  skill storage (FileSystem, LocalStorage, InMemory, Mongo), client-side\n  execution progress via code_mode:* custom events in useChat.\ntype: core\nlibrary: tanstack-ai\nlibrary_version: '0.10.0'\nsources:\n  - 'TanStack\u002Fai:docs\u002Fcode-mode\u002Fcode-mode.md'\n  - 'TanStack\u002Fai:docs\u002Fcode-mode\u002Fcode-mode-isolates.md'\n  - 'TanStack\u002Fai:docs\u002Fcode-mode\u002Fcode-mode-with-skills.md'\n  - 'TanStack\u002Fai:docs\u002Fcode-mode\u002Fclient-integration.md'\n  - 'TanStack\u002Fai:docs\u002Fcode-mode\u002Flazy-tools.md'\n---\n\n> **Note**: This skill requires familiarity with ai-core and ai-core\u002Fchat-experience. Code Mode is always used on top of a chat experience.\n\n## Setup\n\nComplete Code Mode setup with Node.js isolate driver:\n\n```typescript\nimport { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { createCodeModeTool } from '@tanstack\u002Fai-code-mode'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { toolDefinition } from '@tanstack\u002Fai'\nimport { z } from 'zod'\n\n\u002F\u002F Define a tool that code can call\nconst fetchWeather = toolDefinition({\n  name: 'fetchWeather',\n  description: 'Get current weather for a city',\n  inputSchema: z.object({ city: z.string() }),\n  outputSchema: z.object({ temp: z.number(), condition: z.string() }),\n}).server(async ({ city }) => {\n  const res = await fetch(`https:\u002F\u002Fapi.weather.com\u002F${city}`)\n  return res.json()\n})\n\n\u002F\u002F Create code mode tool with Node isolate\nconst codeModeTool = createCodeModeTool({\n  driver: createNodeIsolateDriver({\n    memoryLimit: 128,\n    timeout: 30000,\n  }),\n  tools: [fetchWeather],\n})\n\n\u002F\u002F Use in chat\nconst stream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  tools: [codeModeTool],\n})\n\nreturn toServerSentEventsResponse(stream)\n```\n\nThe recommended higher-level entry point is `createCodeMode()`, which returns both the tool and a matching system prompt:\n\n```typescript\nimport { chat } from '@tanstack\u002Fai'\nimport { createCodeMode } from '@tanstack\u002Fai-code-mode'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\nconst { tool, systemPrompt } = createCodeMode({\n  driver: createNodeIsolateDriver(),\n  tools: [fetchWeather],\n  timeout: 30_000,\n})\n\nconst stream = chat({\n  adapter: openaiText('gpt-4o'),\n  systemPrompts: ['You are a helpful assistant.', systemPrompt],\n  tools: [tool],\n  messages,\n})\n```\n\n`createCodeMode` calls `createCodeModeTool` and `createCodeModeSystemPrompt` internally. The system prompt includes generated TypeScript type stubs for each tool so the LLM writes correct calls.\n\n## Core Patterns\n\n### 1. Choosing an Isolate Driver\n\nThree drivers implement the `IsolateDriver` interface. All are interchangeable.\n\n**Node.js** (`createNodeIsolateDriver`) -- Full V8 with JIT. Fastest option. Requires `isolated-vm` native C++ addon.\n\n```typescript\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\n\nconst driver = createNodeIsolateDriver({\n  memoryLimit: 128, \u002F\u002F MB, default 128\n  timeout: 30_000, \u002F\u002F ms, default 30000\n  \u002F\u002F skipProbe: false -- set true only after verifying compatibility\n})\n```\n\n**QuickJS** (`createQuickJSIsolateDriver`) -- WASM-based, no native deps. Works in Node.js, browsers, Deno, Bun, and edge runtimes. Slower (interpreted, no JIT). Limited stdlib (no File I\u002FO).\n\n```typescript\nimport { createQuickJSIsolateDriver } from '@tanstack\u002Fai-isolate-quickjs'\n\nconst driver = createQuickJSIsolateDriver({\n  memoryLimit: 128, \u002F\u002F MB, default 128\n  timeout: 30_000, \u002F\u002F ms, default 30000\n  maxStackSize: 524288, \u002F\u002F bytes, default 512 KiB\n})\n```\n\n**Cloudflare** (`createCloudflareIsolateDriver`) -- Edge execution via a deployed Cloudflare Worker. Requires a `workerUrl` pointing to your deployed worker. Network latency on each tool call.\n\n```typescript\nimport { createCloudflareIsolateDriver } from '@tanstack\u002Fai-isolate-cloudflare'\n\nconst driver = createCloudflareIsolateDriver({\n  workerUrl: 'https:\u002F\u002Fmy-code-mode-worker.my-account.workers.dev',\n  authorization: process.env.CODE_MODE_WORKER_SECRET,\n  timeout: 30_000, \u002F\u002F ms, default 30000\n  maxToolRounds: 10, \u002F\u002F max tool-call\u002Fresult cycles, default 10\n})\n```\n\n| Driver     | Best for                    | Native deps     | Browser support | Performance          |\n| ---------- | --------------------------- | --------------- | --------------- | -------------------- |\n| Node       | Server-side Node.js         | Yes (C++ addon) | No              | Fast (V8 JIT)        |\n| QuickJS    | Browsers, edge, portability | None (WASM)     | Yes             | Slower (interpreted) |\n| Cloudflare | Edge deployments            | None            | N\u002FA             | Fast (V8 on edge)    |\n\n### 2. Adding Persistent Skills with codeModeWithSkills()\n\nSkills let the LLM save reusable code snippets. On future requests, relevant skills are loaded and exposed as callable tools.\n\n```typescript\nimport { chat, maxIterations } from '@tanstack\u002Fai'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { codeModeWithSkills } from '@tanstack\u002Fai-code-mode-skills'\nimport { createFileSkillStorage } from '@tanstack\u002Fai-code-mode-skills\u002Fstorage'\nimport {\n  createDefaultTrustStrategy,\n  createAlwaysTrustedStrategy,\n  createCustomTrustStrategy,\n} from '@tanstack\u002Fai-code-mode-skills'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Trust strategies control how skills earn trust through executions\n\u002F\u002F Default: untrusted -> provisional (10+ runs, >=90%) -> trusted (100+ runs, >=95%)\n\u002F\u002F Relaxed: untrusted -> provisional (3+ runs, >=80%) -> trusted (10+ runs, >=90%)\n\u002F\u002F Always trusted: immediately trusted (dev\u002Ftesting)\n\u002F\u002F Custom: configurable thresholds\nconst trustStrategy = createDefaultTrustStrategy()\n\n\u002F\u002F Storage options: file system (production) or memory (testing)\nconst storage = createFileSkillStorage({\n  directory: '.\u002F.skills',\n  trustStrategy,\n})\n\nconst driver = createNodeIsolateDriver()\n\n\u002F\u002F High-level API: automatic LLM-based skill selection\nconst { toolsRegistry, systemPrompt, selectedSkills } =\n  await codeModeWithSkills({\n    config: {\n      driver,\n      tools: [myTool1, myTool2],\n      timeout: 60_000,\n      memoryLimit: 128,\n    },\n    adapter: openaiText('gpt-4o-mini'), \u002F\u002F cheap model for skill selection\n    skills: {\n      storage,\n      maxSkillsInContext: 5,\n    },\n    messages,\n  })\n\nconst stream = chat({\n  adapter: openaiText('gpt-4o'),\n  tools: toolsRegistry.getTools(),\n  messages,\n  systemPrompts: ['You are a helpful assistant.', systemPrompt],\n  agentLoopStrategy: maxIterations(15),\n})\n```\n\nThe registry includes: `execute_typescript`, `search_skills`, `get_skill`, `register_skill`, and one tool per selected skill.\n\nCustom trust strategy example:\n\n```typescript\nconst strategy = createCustomTrustStrategy({\n  initialLevel: 'untrusted',\n  provisionalThreshold: { executions: 5, successRate: 0.85 },\n  trustedThreshold: { executions: 50, successRate: 0.95 },\n})\n```\n\nStorage implementations:\n\n```typescript\n\u002F\u002F File storage (production) -- persists skills as files on disk\nimport { createFileSkillStorage } from '@tanstack\u002Fai-code-mode-skills\u002Fstorage'\nconst fileStorage = createFileSkillStorage({ directory: '.\u002F.skills' })\n\n\u002F\u002F Memory storage (testing) -- in-memory, lost on restart\nimport { createMemorySkillStorage } from '@tanstack\u002Fai-code-mode-skills\u002Fstorage'\nconst memStorage = createMemorySkillStorage()\n```\n\n### 3. Client-Side Execution Progress Display\n\nCode Mode emits custom events during sandbox execution. Handle them in `useChat` via `onCustomEvent`.\n\nEvents emitted:\n\n| Event                         | When                                 | Key fields                       |\n| ----------------------------- | ------------------------------------ | -------------------------------- |\n| `code_mode:execution_started` | Sandbox begins                       | `timestamp`, `codeLength`        |\n| `code_mode:console`           | Each console.log\u002Ferror\u002Fwarn\u002Finfo     | `level`, `message`, `timestamp`  |\n| `code_mode:external_call`     | Before an external\\_\\* function runs | `function`, `args`, `timestamp`  |\n| `code_mode:external_result`   | After successful external\\_\\* call   | `function`, `result`, `duration` |\n| `code_mode:external_error`    | When external\\_\\* call fails         | `function`, `error`, `duration`  |\n\n```typescript\nimport { useCallback, useRef, useState } from 'react'\nimport { useChat, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\ninterface VMEvent {\n  id: string\n  eventType: string\n  data: unknown\n  timestamp: number\n}\n\nexport function CodeModeChat() {\n  const [toolCallEvents, setToolCallEvents] = useState\u003C\n    Map\u003Cstring, Array\u003CVMEvent>>\n  >(new Map())\n  const eventIdCounter = useRef(0)\n\n  const handleCustomEvent = useCallback(\n    (\n      eventType: string,\n      data: unknown,\n      context: { toolCallId?: string },\n    ) => {\n      const { toolCallId } = context\n      if (!toolCallId) return\n\n      const event: VMEvent = {\n        id: `event-${eventIdCounter.current++}`,\n        eventType,\n        data,\n        timestamp: Date.now(),\n      }\n\n      setToolCallEvents((prev) => {\n        const next = new Map(prev)\n        const events = next.get(toolCallId) || []\n        next.set(toolCallId, [...events, event])\n        return next\n      })\n    },\n    [],\n  )\n\n  const { messages, sendMessage, isLoading } = useChat({\n    connection: fetchServerSentEvents('\u002Fapi\u002Fchat'),\n    onCustomEvent: handleCustomEvent,\n  })\n\n  return (\n    \u003Cdiv>\n      {messages.map((message) => (\n        \u003Cdiv key={message.id}>\n          {message.parts.map((part) => {\n            if (part.type === 'text') {\n              return \u003Cp key={part.id}>{part.content}\u003C\u002Fp>\n            }\n            if (\n              part.type === 'tool-call' &&\n              part.name === 'execute_typescript'\n            ) {\n              const events = toolCallEvents.get(part.id) || []\n              return (\n                \u003Cdiv key={part.id}>\n                  \u003Cpre>{JSON.parse(part.arguments)?.typescriptCode}\u003C\u002Fpre>\n                  {events.map((evt) => (\n                    \u003Cdiv key={evt.id}>\n                      {evt.eventType}: {JSON.stringify(evt.data)}\n                    \u003C\u002Fdiv>\n                  ))}\n                  {part.output && (\n                    \u003Cpre>{JSON.stringify(part.output, null, 2)}\u003C\u002Fpre>\n                  )}\n                \u003C\u002Fdiv>\n              )\n            }\n            return null\n          })}\n        \u003C\u002Fdiv>\n      ))}\n    \u003C\u002Fdiv>\n  )\n}\n```\n\nThe `onCustomEvent` callback signature is identical across all framework integrations (`@tanstack\u002Fai-react`, `@tanstack\u002Fai-solid`, `@tanstack\u002Fai-vue`, `@tanstack\u002Fai-svelte`):\n\n```typescript\n(eventType: string, data: unknown, context: { toolCallId?: string }) => void\n```\n\nSkill-specific events (when using `codeModeWithSkills`):\n\n| Event                    | When               | Key fields                    |\n| ------------------------ | ------------------ | ----------------------------- |\n| `code_mode:skill_call`   | Skill tool invoked | `skill`, `input`, `timestamp` |\n| `code_mode:skill_result` | Skill completed    | `skill`, `result`, `duration` |\n| `code_mode:skill_error`  | Skill failed       | `skill`, `error`, `duration`  |\n| `skill:registered`       | New skill saved    | `id`, `name`, `description`   |\n\n### 4. Lazy Tools\n\nWhen a large tool catalog would bloat the `execute_typescript` system prompt, mark low-priority tools `lazy: true`. Lazy tools are kept out of the full type-stub documentation and listed in a compact \"Discoverable APIs\" catalog instead. All sandbox bindings are always injected — `lazy` defers documentation, not callability.\n\n**Marking a tool lazy:**\n\n```typescript\nimport { toolDefinition } from '@tanstack\u002Fai'\nimport { z } from 'zod'\n\nconst rarelyUsedTool = toolDefinition({\n  name: 'fetchStocks',\n  description: 'Get stock prices for a ticker. Returns a price quote.',\n  inputSchema: z.object({ ticker: z.string() }),\n  outputSchema: z.object({ price: z.number() }),\n  lazy: true, \u002F\u002F \u003C-- opt out of full system-prompt documentation\n}).server(async ({ ticker }) => {\n  \u002F\u002F ...\n  return { price: 0 }\n})\n```\n\n**`createCodeMode` return shape:**\n\n`createCodeMode()` returns `{ tool, discoveryTool, tools, systemPrompt }`. When lazy tools are present `discoveryTool` is a `discover_tools` server tool; otherwise it is `null`. Always spread `tools` (not just `tool`) into `chat()` so the discovery tool is registered:\n\n```typescript\nimport { chat } from '@tanstack\u002Fai'\nimport { createCodeMode } from '@tanstack\u002Fai-code-mode'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\nconst { tools, systemPrompt } = createCodeMode({\n  driver: createNodeIsolateDriver(),\n  tools: [eagerTool, rarelyUsedTool], \u002F\u002F rarelyUsedTool has lazy: true\n})\n\nconst stream = chat({\n  adapter: openaiText('gpt-5.5'),\n  systemPrompts: ['You are a helpful assistant.', systemPrompt],\n  tools: [...tools, ...otherTools], \u002F\u002F spread tools, not just tool\n  messages,\n})\n```\n\n`tools` equals `[tool]` when there are no lazy tools (backward compatible) and `[tool, discoveryTool]` when lazy tools exist.\n\n**`discover_tools` flow:**\n\nWhen the model encounters a lazy tool it has not seen before, it calls `discover_tools` with the bare name (no `external_` prefix). The tool returns each requested tool's TypeScript type stub and description. The model then writes correctly-typed `external_\u003Cname>` calls inside `execute_typescript`.\n\n```text\nModel sees: \"Discoverable APIs: external_fetchStocks\"\nModel calls: discover_tools({ toolNames: [\"fetchStocks\"] })\nResponse:    { tools: [{ name: \"external_fetchStocks\", description: \"...\", typeStub: \"declare function external_fetchStocks(...)\" }] }\nModel writes inside execute_typescript: const result = await external_fetchStocks({ ticker: \"AAPL\" })\n```\n\n**`lazyToolsConfig.includeDescription`:**\n\nControl how much of each lazy tool's description appears in the Discoverable APIs catalog (the pre-discovery list):\n\n| Value              | Catalog entry                                                     |\n| ------------------ | ----------------------------------------------------------------- |\n| `'none'`           | `external_fetchStocks` (name only — default)                      |\n| `'first-sentence'` | `external_fetchStocks — Get stock prices.`                        |\n| `'full'`           | `external_fetchStocks — Get stock prices. Returns a price quote.` |\n\n```typescript\nconst { tools, systemPrompt } = createCodeMode({\n  driver: createNodeIsolateDriver(),\n  tools: [eagerTool, rarelyUsedTool],\n  lazyToolsConfig: { includeDescription: 'first-sentence' },\n})\n```\n\nThe same `lazyToolsConfig` option is accepted by plain `chat()` for its own lazy-tool discovery catalog (see `ai-core\u002Ftool-calling\u002FSKILL.md`).\n\n## Common Mistakes\n\n### CRITICAL: Passing API keys or secrets to the sandbox environment\n\nCode Mode executes LLM-generated code. Any secrets available in the sandbox context are accessible to generated code, which could exfiltrate them via tool calls. Never pass API keys, database credentials, or tokens into the sandbox. Keep secrets in your tool server implementations, which run in the host process outside the sandbox.\n\nWrong:\n\n```typescript\nconst codeModeTool = createCodeModeTool({\n  driver,\n  tools: [\n    toolDefinition({\n      name: 'callApi',\n      inputSchema: z.object({ url: z.string(), apiKey: z.string() }),\n      outputSchema: z.any(),\n    }).server(async ({ url, apiKey }) =>\n      fetch(url, {\n        headers: { Authorization: apiKey },\n      }),\n    ),\n  ],\n})\n```\n\nRight:\n\n```typescript\nconst codeModeTool = createCodeModeTool({\n  driver,\n  tools: [\n    toolDefinition({\n      name: 'callApi',\n      inputSchema: z.object({ url: z.string() }),\n      outputSchema: z.any(),\n    }).server(async ({ url }) =>\n      fetch(url, {\n        headers: { Authorization: process.env.API_KEY }, \u002F\u002F secret stays in host\n      }),\n    ),\n  ],\n})\n```\n\nSource: docs\u002Fcode-mode\u002Fcode-mode.md\n\n### HIGH: Not setting timeout for code execution\n\nLLM-generated code may contain infinite loops. The default timeout is 30s, but developers may override to 0 (no timeout). Always set an explicit, finite timeout.\n\nWrong:\n\n```typescript\nconst driver = createNodeIsolateDriver({ timeout: 0 })\n```\n\nRight:\n\n```typescript\nconst driver = createNodeIsolateDriver({ timeout: 30_000 })\n```\n\nSource: ai-code-mode source (default timeout in CodeModeToolConfig)\n\n### HIGH: Using Node isolated-vm driver without checking platform compatibility\n\n`isolated-vm` requires native module compilation. An incompatible build (wrong Node.js version, missing build tools) causes segfaults that no JS error handling can catch. The driver runs a subprocess probe by default. Never set `skipProbe: true` unless you have independently verified compatibility. Use `probeIsolatedVm()` to check before creating the driver.\n\n```typescript\nimport {\n  createNodeIsolateDriver,\n  probeIsolatedVm,\n} from '@tanstack\u002Fai-isolate-node'\n\nconst probe = probeIsolatedVm()\nif (!probe.compatible) {\n  console.error('isolated-vm not compatible:', probe.error)\n  \u002F\u002F Fall back to QuickJS\n}\n\n\u002F\u002F Never do this unless you verified compatibility yourself:\n\u002F\u002F const driver = createNodeIsolateDriver({ skipProbe: true })\n```\n\nSource: ai-isolate-node source (probeIsolatedVm implementation)\n\n### MEDIUM: Expecting identical behavior across isolate drivers\n\nThe three drivers have different capabilities. Same code may work in Node but fail elsewhere.\n\n- **Node**: Full V8 support, JIT compilation, configurable memory limit\n- **QuickJS**: Interpreted, limited stdlib (no File I\u002FO), configurable stack size, asyncified execution (serialized through global queue)\n- **Cloudflare**: Network latency per tool call round-trip, `maxToolRounds` limit (default 10), requires deployed worker with `UNSAFE_EVAL` or `eval` unsafe binding\n\nTest generated code against your target driver. If you need portability, target QuickJS's subset.\n\nSource: docs\u002Fcode-mode\u002Fcode-mode-isolates.md\n\n## Cross-References\n\n- See also: ai-core\u002Ftool-calling\u002FSKILL.md -- Code Mode is an alternative to standard tool calling for complex multi-step operations\n- See also: ai-core\u002Fchat-experience\u002FSKILL.md -- Code Mode requires handling custom events in useChat\n",{"data":55,"body":65},{"name":4,"description":6,"type":56,"library":57,"library_version":58,"sources":59},"core","tanstack-ai","0.10.0",[60,61,62,63,64],"TanStack\u002Fai:docs\u002Fcode-mode\u002Fcode-mode.md","TanStack\u002Fai:docs\u002Fcode-mode\u002Fcode-mode-isolates.md","TanStack\u002Fai:docs\u002Fcode-mode\u002Fcode-mode-with-skills.md","TanStack\u002Fai:docs\u002Fcode-mode\u002Fclient-integration.md","TanStack\u002Fai:docs\u002Fcode-mode\u002Flazy-tools.md",{"type":66,"children":67},"root",[68,86,93,98,1139,1152,1585,1612,1618,1625,1638,1664,1809,1826,1987,2012,2218,2343,2349,2354,3340,3375,3380,3558,3563,3745,3751,3771,3776,3991,6032,6072,6159,6171,6347,6353,6381,6389,6815,6828,6894,7341,7367,7380,7414,7424,7437,7442,7529,7682,7710,7716,7722,7727,7732,8128,8133,8497,8502,8508,8513,8517,8572,8576,8630,8635,8641,8667,8890,8895,8901,8906,8962,8967,8972,8978,8991],{"type":69,"tag":70,"props":71,"children":72},"element","blockquote",{},[73],{"type":69,"tag":74,"props":75,"children":76},"p",{},[77,84],{"type":69,"tag":78,"props":79,"children":80},"strong",{},[81],{"type":82,"value":83},"text","Note",{"type":82,"value":85},": This skill requires familiarity with ai-core and ai-core\u002Fchat-experience. Code Mode is always used on top of a chat experience.",{"type":69,"tag":87,"props":88,"children":90},"h2",{"id":89},"setup",[91],{"type":82,"value":92},"Setup",{"type":69,"tag":74,"props":94,"children":95},{},[96],{"type":82,"value":97},"Complete Code Mode setup with Node.js isolate driver:",{"type":69,"tag":99,"props":100,"children":104},"pre",{"className":101,"code":102,"language":14,"meta":103,"style":103},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { createCodeModeTool } from '@tanstack\u002Fai-code-mode'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { toolDefinition } from '@tanstack\u002Fai'\nimport { z } from 'zod'\n\n\u002F\u002F Define a tool that code can call\nconst fetchWeather = toolDefinition({\n  name: 'fetchWeather',\n  description: 'Get current weather for a city',\n  inputSchema: z.object({ city: z.string() }),\n  outputSchema: z.object({ temp: z.number(), condition: z.string() }),\n}).server(async ({ city }) => {\n  const res = await fetch(`https:\u002F\u002Fapi.weather.com\u002F${city}`)\n  return res.json()\n})\n\n\u002F\u002F Create code mode tool with Node isolate\nconst codeModeTool = createCodeModeTool({\n  driver: createNodeIsolateDriver({\n    memoryLimit: 128,\n    timeout: 30000,\n  }),\n  tools: [fetchWeather],\n})\n\n\u002F\u002F Use in chat\nconst stream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  tools: [codeModeTool],\n})\n\nreturn toServerSentEventsResponse(stream)\n","",[105],{"type":69,"tag":106,"props":107,"children":108},"code",{"__ignoreMap":103},[109,169,207,245,283,320,358,368,378,413,447,477,554,655,710,773,800,812,820,829,858,883,906,928,945,967,979,987,996,1025,1067,1080,1101,1113,1121],{"type":69,"tag":110,"props":111,"children":114},"span",{"class":112,"line":113},"line",1,[115,121,127,133,138,143,148,153,158,164],{"type":69,"tag":110,"props":116,"children":118},{"style":117},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[119],{"type":82,"value":120},"import",{"type":69,"tag":110,"props":122,"children":124},{"style":123},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[125],{"type":82,"value":126}," {",{"type":69,"tag":110,"props":128,"children":130},{"style":129},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[131],{"type":82,"value":132}," chat",{"type":69,"tag":110,"props":134,"children":135},{"style":123},[136],{"type":82,"value":137},",",{"type":69,"tag":110,"props":139,"children":140},{"style":129},[141],{"type":82,"value":142}," toServerSentEventsResponse",{"type":69,"tag":110,"props":144,"children":145},{"style":123},[146],{"type":82,"value":147}," }",{"type":69,"tag":110,"props":149,"children":150},{"style":117},[151],{"type":82,"value":152}," from",{"type":69,"tag":110,"props":154,"children":155},{"style":123},[156],{"type":82,"value":157}," '",{"type":69,"tag":110,"props":159,"children":161},{"style":160},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[162],{"type":82,"value":163},"@tanstack\u002Fai",{"type":69,"tag":110,"props":165,"children":166},{"style":123},[167],{"type":82,"value":168},"'\n",{"type":69,"tag":110,"props":170,"children":172},{"class":112,"line":171},2,[173,177,181,186,190,194,198,203],{"type":69,"tag":110,"props":174,"children":175},{"style":117},[176],{"type":82,"value":120},{"type":69,"tag":110,"props":178,"children":179},{"style":123},[180],{"type":82,"value":126},{"type":69,"tag":110,"props":182,"children":183},{"style":129},[184],{"type":82,"value":185}," openaiText",{"type":69,"tag":110,"props":187,"children":188},{"style":123},[189],{"type":82,"value":147},{"type":69,"tag":110,"props":191,"children":192},{"style":117},[193],{"type":82,"value":152},{"type":69,"tag":110,"props":195,"children":196},{"style":123},[197],{"type":82,"value":157},{"type":69,"tag":110,"props":199,"children":200},{"style":160},[201],{"type":82,"value":202},"@tanstack\u002Fai-openai",{"type":69,"tag":110,"props":204,"children":205},{"style":123},[206],{"type":82,"value":168},{"type":69,"tag":110,"props":208,"children":210},{"class":112,"line":209},3,[211,215,219,224,228,232,236,241],{"type":69,"tag":110,"props":212,"children":213},{"style":117},[214],{"type":82,"value":120},{"type":69,"tag":110,"props":216,"children":217},{"style":123},[218],{"type":82,"value":126},{"type":69,"tag":110,"props":220,"children":221},{"style":129},[222],{"type":82,"value":223}," createCodeModeTool",{"type":69,"tag":110,"props":225,"children":226},{"style":123},[227],{"type":82,"value":147},{"type":69,"tag":110,"props":229,"children":230},{"style":117},[231],{"type":82,"value":152},{"type":69,"tag":110,"props":233,"children":234},{"style":123},[235],{"type":82,"value":157},{"type":69,"tag":110,"props":237,"children":238},{"style":160},[239],{"type":82,"value":240},"@tanstack\u002Fai-code-mode",{"type":69,"tag":110,"props":242,"children":243},{"style":123},[244],{"type":82,"value":168},{"type":69,"tag":110,"props":246,"children":248},{"class":112,"line":247},4,[249,253,257,262,266,270,274,279],{"type":69,"tag":110,"props":250,"children":251},{"style":117},[252],{"type":82,"value":120},{"type":69,"tag":110,"props":254,"children":255},{"style":123},[256],{"type":82,"value":126},{"type":69,"tag":110,"props":258,"children":259},{"style":129},[260],{"type":82,"value":261}," createNodeIsolateDriver",{"type":69,"tag":110,"props":263,"children":264},{"style":123},[265],{"type":82,"value":147},{"type":69,"tag":110,"props":267,"children":268},{"style":117},[269],{"type":82,"value":152},{"type":69,"tag":110,"props":271,"children":272},{"style":123},[273],{"type":82,"value":157},{"type":69,"tag":110,"props":275,"children":276},{"style":160},[277],{"type":82,"value":278},"@tanstack\u002Fai-isolate-node",{"type":69,"tag":110,"props":280,"children":281},{"style":123},[282],{"type":82,"value":168},{"type":69,"tag":110,"props":284,"children":286},{"class":112,"line":285},5,[287,291,295,300,304,308,312,316],{"type":69,"tag":110,"props":288,"children":289},{"style":117},[290],{"type":82,"value":120},{"type":69,"tag":110,"props":292,"children":293},{"style":123},[294],{"type":82,"value":126},{"type":69,"tag":110,"props":296,"children":297},{"style":129},[298],{"type":82,"value":299}," toolDefinition",{"type":69,"tag":110,"props":301,"children":302},{"style":123},[303],{"type":82,"value":147},{"type":69,"tag":110,"props":305,"children":306},{"style":117},[307],{"type":82,"value":152},{"type":69,"tag":110,"props":309,"children":310},{"style":123},[311],{"type":82,"value":157},{"type":69,"tag":110,"props":313,"children":314},{"style":160},[315],{"type":82,"value":163},{"type":69,"tag":110,"props":317,"children":318},{"style":123},[319],{"type":82,"value":168},{"type":69,"tag":110,"props":321,"children":323},{"class":112,"line":322},6,[324,328,332,337,341,345,349,354],{"type":69,"tag":110,"props":325,"children":326},{"style":117},[327],{"type":82,"value":120},{"type":69,"tag":110,"props":329,"children":330},{"style":123},[331],{"type":82,"value":126},{"type":69,"tag":110,"props":333,"children":334},{"style":129},[335],{"type":82,"value":336}," z",{"type":69,"tag":110,"props":338,"children":339},{"style":123},[340],{"type":82,"value":147},{"type":69,"tag":110,"props":342,"children":343},{"style":117},[344],{"type":82,"value":152},{"type":69,"tag":110,"props":346,"children":347},{"style":123},[348],{"type":82,"value":157},{"type":69,"tag":110,"props":350,"children":351},{"style":160},[352],{"type":82,"value":353},"zod",{"type":69,"tag":110,"props":355,"children":356},{"style":123},[357],{"type":82,"value":168},{"type":69,"tag":110,"props":359,"children":361},{"class":112,"line":360},7,[362],{"type":69,"tag":110,"props":363,"children":365},{"emptyLinePlaceholder":364},true,[366],{"type":82,"value":367},"\n",{"type":69,"tag":110,"props":369,"children":371},{"class":112,"line":370},8,[372],{"type":69,"tag":110,"props":373,"children":375},{"style":374},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[376],{"type":82,"value":377},"\u002F\u002F Define a tool that code can call\n",{"type":69,"tag":110,"props":379,"children":381},{"class":112,"line":380},9,[382,388,393,398,403,408],{"type":69,"tag":110,"props":383,"children":385},{"style":384},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[386],{"type":82,"value":387},"const",{"type":69,"tag":110,"props":389,"children":390},{"style":129},[391],{"type":82,"value":392}," fetchWeather ",{"type":69,"tag":110,"props":394,"children":395},{"style":123},[396],{"type":82,"value":397},"=",{"type":69,"tag":110,"props":399,"children":401},{"style":400},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[402],{"type":82,"value":299},{"type":69,"tag":110,"props":404,"children":405},{"style":129},[406],{"type":82,"value":407},"(",{"type":69,"tag":110,"props":409,"children":410},{"style":123},[411],{"type":82,"value":412},"{\n",{"type":69,"tag":110,"props":414,"children":416},{"class":112,"line":415},10,[417,423,428,432,437,442],{"type":69,"tag":110,"props":418,"children":420},{"style":419},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[421],{"type":82,"value":422},"  name",{"type":69,"tag":110,"props":424,"children":425},{"style":123},[426],{"type":82,"value":427},":",{"type":69,"tag":110,"props":429,"children":430},{"style":123},[431],{"type":82,"value":157},{"type":69,"tag":110,"props":433,"children":434},{"style":160},[435],{"type":82,"value":436},"fetchWeather",{"type":69,"tag":110,"props":438,"children":439},{"style":123},[440],{"type":82,"value":441},"'",{"type":69,"tag":110,"props":443,"children":444},{"style":123},[445],{"type":82,"value":446},",\n",{"type":69,"tag":110,"props":448,"children":450},{"class":112,"line":449},11,[451,456,460,464,469,473],{"type":69,"tag":110,"props":452,"children":453},{"style":419},[454],{"type":82,"value":455},"  description",{"type":69,"tag":110,"props":457,"children":458},{"style":123},[459],{"type":82,"value":427},{"type":69,"tag":110,"props":461,"children":462},{"style":123},[463],{"type":82,"value":157},{"type":69,"tag":110,"props":465,"children":466},{"style":160},[467],{"type":82,"value":468},"Get current weather for a city",{"type":69,"tag":110,"props":470,"children":471},{"style":123},[472],{"type":82,"value":441},{"type":69,"tag":110,"props":474,"children":475},{"style":123},[476],{"type":82,"value":446},{"type":69,"tag":110,"props":478,"children":480},{"class":112,"line":479},12,[481,486,490,494,499,504,508,513,518,522,526,530,535,540,545,550],{"type":69,"tag":110,"props":482,"children":483},{"style":419},[484],{"type":82,"value":485},"  inputSchema",{"type":69,"tag":110,"props":487,"children":488},{"style":123},[489],{"type":82,"value":427},{"type":69,"tag":110,"props":491,"children":492},{"style":129},[493],{"type":82,"value":336},{"type":69,"tag":110,"props":495,"children":496},{"style":123},[497],{"type":82,"value":498},".",{"type":69,"tag":110,"props":500,"children":501},{"style":400},[502],{"type":82,"value":503},"object",{"type":69,"tag":110,"props":505,"children":506},{"style":129},[507],{"type":82,"value":407},{"type":69,"tag":110,"props":509,"children":510},{"style":123},[511],{"type":82,"value":512},"{",{"type":69,"tag":110,"props":514,"children":515},{"style":419},[516],{"type":82,"value":517}," city",{"type":69,"tag":110,"props":519,"children":520},{"style":123},[521],{"type":82,"value":427},{"type":69,"tag":110,"props":523,"children":524},{"style":129},[525],{"type":82,"value":336},{"type":69,"tag":110,"props":527,"children":528},{"style":123},[529],{"type":82,"value":498},{"type":69,"tag":110,"props":531,"children":532},{"style":400},[533],{"type":82,"value":534},"string",{"type":69,"tag":110,"props":536,"children":537},{"style":129},[538],{"type":82,"value":539},"() ",{"type":69,"tag":110,"props":541,"children":542},{"style":123},[543],{"type":82,"value":544},"}",{"type":69,"tag":110,"props":546,"children":547},{"style":129},[548],{"type":82,"value":549},")",{"type":69,"tag":110,"props":551,"children":552},{"style":123},[553],{"type":82,"value":446},{"type":69,"tag":110,"props":555,"children":557},{"class":112,"line":556},13,[558,563,567,571,575,579,583,587,592,596,600,604,609,614,618,623,627,631,635,639,643,647,651],{"type":69,"tag":110,"props":559,"children":560},{"style":419},[561],{"type":82,"value":562},"  outputSchema",{"type":69,"tag":110,"props":564,"children":565},{"style":123},[566],{"type":82,"value":427},{"type":69,"tag":110,"props":568,"children":569},{"style":129},[570],{"type":82,"value":336},{"type":69,"tag":110,"props":572,"children":573},{"style":123},[574],{"type":82,"value":498},{"type":69,"tag":110,"props":576,"children":577},{"style":400},[578],{"type":82,"value":503},{"type":69,"tag":110,"props":580,"children":581},{"style":129},[582],{"type":82,"value":407},{"type":69,"tag":110,"props":584,"children":585},{"style":123},[586],{"type":82,"value":512},{"type":69,"tag":110,"props":588,"children":589},{"style":419},[590],{"type":82,"value":591}," temp",{"type":69,"tag":110,"props":593,"children":594},{"style":123},[595],{"type":82,"value":427},{"type":69,"tag":110,"props":597,"children":598},{"style":129},[599],{"type":82,"value":336},{"type":69,"tag":110,"props":601,"children":602},{"style":123},[603],{"type":82,"value":498},{"type":69,"tag":110,"props":605,"children":606},{"style":400},[607],{"type":82,"value":608},"number",{"type":69,"tag":110,"props":610,"children":611},{"style":129},[612],{"type":82,"value":613},"()",{"type":69,"tag":110,"props":615,"children":616},{"style":123},[617],{"type":82,"value":137},{"type":69,"tag":110,"props":619,"children":620},{"style":419},[621],{"type":82,"value":622}," condition",{"type":69,"tag":110,"props":624,"children":625},{"style":123},[626],{"type":82,"value":427},{"type":69,"tag":110,"props":628,"children":629},{"style":129},[630],{"type":82,"value":336},{"type":69,"tag":110,"props":632,"children":633},{"style":123},[634],{"type":82,"value":498},{"type":69,"tag":110,"props":636,"children":637},{"style":400},[638],{"type":82,"value":534},{"type":69,"tag":110,"props":640,"children":641},{"style":129},[642],{"type":82,"value":539},{"type":69,"tag":110,"props":644,"children":645},{"style":123},[646],{"type":82,"value":544},{"type":69,"tag":110,"props":648,"children":649},{"style":129},[650],{"type":82,"value":549},{"type":69,"tag":110,"props":652,"children":653},{"style":123},[654],{"type":82,"value":446},{"type":69,"tag":110,"props":656,"children":658},{"class":112,"line":657},14,[659,663,667,671,676,680,685,690,695,700,705],{"type":69,"tag":110,"props":660,"children":661},{"style":123},[662],{"type":82,"value":544},{"type":69,"tag":110,"props":664,"children":665},{"style":129},[666],{"type":82,"value":549},{"type":69,"tag":110,"props":668,"children":669},{"style":123},[670],{"type":82,"value":498},{"type":69,"tag":110,"props":672,"children":673},{"style":400},[674],{"type":82,"value":675},"server",{"type":69,"tag":110,"props":677,"children":678},{"style":129},[679],{"type":82,"value":407},{"type":69,"tag":110,"props":681,"children":682},{"style":384},[683],{"type":82,"value":684},"async",{"type":69,"tag":110,"props":686,"children":687},{"style":123},[688],{"type":82,"value":689}," ({",{"type":69,"tag":110,"props":691,"children":693},{"style":692},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[694],{"type":82,"value":517},{"type":69,"tag":110,"props":696,"children":697},{"style":123},[698],{"type":82,"value":699}," })",{"type":69,"tag":110,"props":701,"children":702},{"style":384},[703],{"type":82,"value":704}," =>",{"type":69,"tag":110,"props":706,"children":707},{"style":123},[708],{"type":82,"value":709}," {\n",{"type":69,"tag":110,"props":711,"children":713},{"class":112,"line":712},15,[714,719,724,729,734,739,743,748,753,758,763,768],{"type":69,"tag":110,"props":715,"children":716},{"style":384},[717],{"type":82,"value":718},"  const",{"type":69,"tag":110,"props":720,"children":721},{"style":129},[722],{"type":82,"value":723}," res",{"type":69,"tag":110,"props":725,"children":726},{"style":123},[727],{"type":82,"value":728}," =",{"type":69,"tag":110,"props":730,"children":731},{"style":117},[732],{"type":82,"value":733}," await",{"type":69,"tag":110,"props":735,"children":736},{"style":400},[737],{"type":82,"value":738}," fetch",{"type":69,"tag":110,"props":740,"children":741},{"style":419},[742],{"type":82,"value":407},{"type":69,"tag":110,"props":744,"children":745},{"style":123},[746],{"type":82,"value":747},"`",{"type":69,"tag":110,"props":749,"children":750},{"style":160},[751],{"type":82,"value":752},"https:\u002F\u002Fapi.weather.com\u002F",{"type":69,"tag":110,"props":754,"children":755},{"style":123},[756],{"type":82,"value":757},"${",{"type":69,"tag":110,"props":759,"children":760},{"style":129},[761],{"type":82,"value":762},"city",{"type":69,"tag":110,"props":764,"children":765},{"style":123},[766],{"type":82,"value":767},"}`",{"type":69,"tag":110,"props":769,"children":770},{"style":419},[771],{"type":82,"value":772},")\n",{"type":69,"tag":110,"props":774,"children":776},{"class":112,"line":775},16,[777,782,786,790,795],{"type":69,"tag":110,"props":778,"children":779},{"style":117},[780],{"type":82,"value":781},"  return",{"type":69,"tag":110,"props":783,"children":784},{"style":129},[785],{"type":82,"value":723},{"type":69,"tag":110,"props":787,"children":788},{"style":123},[789],{"type":82,"value":498},{"type":69,"tag":110,"props":791,"children":792},{"style":400},[793],{"type":82,"value":794},"json",{"type":69,"tag":110,"props":796,"children":797},{"style":419},[798],{"type":82,"value":799},"()\n",{"type":69,"tag":110,"props":801,"children":803},{"class":112,"line":802},17,[804,808],{"type":69,"tag":110,"props":805,"children":806},{"style":123},[807],{"type":82,"value":544},{"type":69,"tag":110,"props":809,"children":810},{"style":129},[811],{"type":82,"value":772},{"type":69,"tag":110,"props":813,"children":815},{"class":112,"line":814},18,[816],{"type":69,"tag":110,"props":817,"children":818},{"emptyLinePlaceholder":364},[819],{"type":82,"value":367},{"type":69,"tag":110,"props":821,"children":823},{"class":112,"line":822},19,[824],{"type":69,"tag":110,"props":825,"children":826},{"style":374},[827],{"type":82,"value":828},"\u002F\u002F Create code mode tool with Node isolate\n",{"type":69,"tag":110,"props":830,"children":832},{"class":112,"line":831},20,[833,837,842,846,850,854],{"type":69,"tag":110,"props":834,"children":835},{"style":384},[836],{"type":82,"value":387},{"type":69,"tag":110,"props":838,"children":839},{"style":129},[840],{"type":82,"value":841}," codeModeTool ",{"type":69,"tag":110,"props":843,"children":844},{"style":123},[845],{"type":82,"value":397},{"type":69,"tag":110,"props":847,"children":848},{"style":400},[849],{"type":82,"value":223},{"type":69,"tag":110,"props":851,"children":852},{"style":129},[853],{"type":82,"value":407},{"type":69,"tag":110,"props":855,"children":856},{"style":123},[857],{"type":82,"value":412},{"type":69,"tag":110,"props":859,"children":861},{"class":112,"line":860},21,[862,867,871,875,879],{"type":69,"tag":110,"props":863,"children":864},{"style":419},[865],{"type":82,"value":866},"  driver",{"type":69,"tag":110,"props":868,"children":869},{"style":123},[870],{"type":82,"value":427},{"type":69,"tag":110,"props":872,"children":873},{"style":400},[874],{"type":82,"value":261},{"type":69,"tag":110,"props":876,"children":877},{"style":129},[878],{"type":82,"value":407},{"type":69,"tag":110,"props":880,"children":881},{"style":123},[882],{"type":82,"value":412},{"type":69,"tag":110,"props":884,"children":886},{"class":112,"line":885},22,[887,892,896,902],{"type":69,"tag":110,"props":888,"children":889},{"style":419},[890],{"type":82,"value":891},"    memoryLimit",{"type":69,"tag":110,"props":893,"children":894},{"style":123},[895],{"type":82,"value":427},{"type":69,"tag":110,"props":897,"children":899},{"style":898},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[900],{"type":82,"value":901}," 128",{"type":69,"tag":110,"props":903,"children":904},{"style":123},[905],{"type":82,"value":446},{"type":69,"tag":110,"props":907,"children":909},{"class":112,"line":908},23,[910,915,919,924],{"type":69,"tag":110,"props":911,"children":912},{"style":419},[913],{"type":82,"value":914},"    timeout",{"type":69,"tag":110,"props":916,"children":917},{"style":123},[918],{"type":82,"value":427},{"type":69,"tag":110,"props":920,"children":921},{"style":898},[922],{"type":82,"value":923}," 30000",{"type":69,"tag":110,"props":925,"children":926},{"style":123},[927],{"type":82,"value":446},{"type":69,"tag":110,"props":929,"children":931},{"class":112,"line":930},24,[932,937,941],{"type":69,"tag":110,"props":933,"children":934},{"style":123},[935],{"type":82,"value":936},"  }",{"type":69,"tag":110,"props":938,"children":939},{"style":129},[940],{"type":82,"value":549},{"type":69,"tag":110,"props":942,"children":943},{"style":123},[944],{"type":82,"value":446},{"type":69,"tag":110,"props":946,"children":948},{"class":112,"line":947},25,[949,954,958,963],{"type":69,"tag":110,"props":950,"children":951},{"style":419},[952],{"type":82,"value":953},"  tools",{"type":69,"tag":110,"props":955,"children":956},{"style":123},[957],{"type":82,"value":427},{"type":69,"tag":110,"props":959,"children":960},{"style":129},[961],{"type":82,"value":962}," [fetchWeather]",{"type":69,"tag":110,"props":964,"children":965},{"style":123},[966],{"type":82,"value":446},{"type":69,"tag":110,"props":968,"children":970},{"class":112,"line":969},26,[971,975],{"type":69,"tag":110,"props":972,"children":973},{"style":123},[974],{"type":82,"value":544},{"type":69,"tag":110,"props":976,"children":977},{"style":129},[978],{"type":82,"value":772},{"type":69,"tag":110,"props":980,"children":982},{"class":112,"line":981},27,[983],{"type":69,"tag":110,"props":984,"children":985},{"emptyLinePlaceholder":364},[986],{"type":82,"value":367},{"type":69,"tag":110,"props":988,"children":990},{"class":112,"line":989},28,[991],{"type":69,"tag":110,"props":992,"children":993},{"style":374},[994],{"type":82,"value":995},"\u002F\u002F Use in chat\n",{"type":69,"tag":110,"props":997,"children":999},{"class":112,"line":998},29,[1000,1004,1009,1013,1017,1021],{"type":69,"tag":110,"props":1001,"children":1002},{"style":384},[1003],{"type":82,"value":387},{"type":69,"tag":110,"props":1005,"children":1006},{"style":129},[1007],{"type":82,"value":1008}," stream ",{"type":69,"tag":110,"props":1010,"children":1011},{"style":123},[1012],{"type":82,"value":397},{"type":69,"tag":110,"props":1014,"children":1015},{"style":400},[1016],{"type":82,"value":132},{"type":69,"tag":110,"props":1018,"children":1019},{"style":129},[1020],{"type":82,"value":407},{"type":69,"tag":110,"props":1022,"children":1023},{"style":123},[1024],{"type":82,"value":412},{"type":69,"tag":110,"props":1026,"children":1028},{"class":112,"line":1027},30,[1029,1034,1038,1042,1046,1050,1055,1059,1063],{"type":69,"tag":110,"props":1030,"children":1031},{"style":419},[1032],{"type":82,"value":1033},"  adapter",{"type":69,"tag":110,"props":1035,"children":1036},{"style":123},[1037],{"type":82,"value":427},{"type":69,"tag":110,"props":1039,"children":1040},{"style":400},[1041],{"type":82,"value":185},{"type":69,"tag":110,"props":1043,"children":1044},{"style":129},[1045],{"type":82,"value":407},{"type":69,"tag":110,"props":1047,"children":1048},{"style":123},[1049],{"type":82,"value":441},{"type":69,"tag":110,"props":1051,"children":1052},{"style":160},[1053],{"type":82,"value":1054},"gpt-5.2",{"type":69,"tag":110,"props":1056,"children":1057},{"style":123},[1058],{"type":82,"value":441},{"type":69,"tag":110,"props":1060,"children":1061},{"style":129},[1062],{"type":82,"value":549},{"type":69,"tag":110,"props":1064,"children":1065},{"style":123},[1066],{"type":82,"value":446},{"type":69,"tag":110,"props":1068,"children":1070},{"class":112,"line":1069},31,[1071,1076],{"type":69,"tag":110,"props":1072,"children":1073},{"style":129},[1074],{"type":82,"value":1075},"  messages",{"type":69,"tag":110,"props":1077,"children":1078},{"style":123},[1079],{"type":82,"value":446},{"type":69,"tag":110,"props":1081,"children":1083},{"class":112,"line":1082},32,[1084,1088,1092,1097],{"type":69,"tag":110,"props":1085,"children":1086},{"style":419},[1087],{"type":82,"value":953},{"type":69,"tag":110,"props":1089,"children":1090},{"style":123},[1091],{"type":82,"value":427},{"type":69,"tag":110,"props":1093,"children":1094},{"style":129},[1095],{"type":82,"value":1096}," [codeModeTool]",{"type":69,"tag":110,"props":1098,"children":1099},{"style":123},[1100],{"type":82,"value":446},{"type":69,"tag":110,"props":1102,"children":1104},{"class":112,"line":1103},33,[1105,1109],{"type":69,"tag":110,"props":1106,"children":1107},{"style":123},[1108],{"type":82,"value":544},{"type":69,"tag":110,"props":1110,"children":1111},{"style":129},[1112],{"type":82,"value":772},{"type":69,"tag":110,"props":1114,"children":1116},{"class":112,"line":1115},34,[1117],{"type":69,"tag":110,"props":1118,"children":1119},{"emptyLinePlaceholder":364},[1120],{"type":82,"value":367},{"type":69,"tag":110,"props":1122,"children":1124},{"class":112,"line":1123},35,[1125,1130,1134],{"type":69,"tag":110,"props":1126,"children":1127},{"style":117},[1128],{"type":82,"value":1129},"return",{"type":69,"tag":110,"props":1131,"children":1132},{"style":400},[1133],{"type":82,"value":142},{"type":69,"tag":110,"props":1135,"children":1136},{"style":129},[1137],{"type":82,"value":1138},"(stream)\n",{"type":69,"tag":74,"props":1140,"children":1141},{},[1142,1144,1150],{"type":82,"value":1143},"The recommended higher-level entry point is ",{"type":69,"tag":106,"props":1145,"children":1147},{"className":1146},[],[1148],{"type":82,"value":1149},"createCodeMode()",{"type":82,"value":1151},", which returns both the tool and a matching system prompt:",{"type":69,"tag":99,"props":1153,"children":1155},{"className":101,"code":1154,"language":14,"meta":103,"style":103},"import { chat } from '@tanstack\u002Fai'\nimport { createCodeMode } from '@tanstack\u002Fai-code-mode'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\nconst { tool, systemPrompt } = createCodeMode({\n  driver: createNodeIsolateDriver(),\n  tools: [fetchWeather],\n  timeout: 30_000,\n})\n\nconst stream = chat({\n  adapter: openaiText('gpt-4o'),\n  systemPrompts: ['You are a helpful assistant.', systemPrompt],\n  tools: [tool],\n  messages,\n})\n",[1156],{"type":69,"tag":106,"props":1157,"children":1158},{"__ignoreMap":103},[1159,1194,1230,1265,1300,1307,1352,1375,1394,1415,1426,1433,1460,1500,1543,1563,1574],{"type":69,"tag":110,"props":1160,"children":1161},{"class":112,"line":113},[1162,1166,1170,1174,1178,1182,1186,1190],{"type":69,"tag":110,"props":1163,"children":1164},{"style":117},[1165],{"type":82,"value":120},{"type":69,"tag":110,"props":1167,"children":1168},{"style":123},[1169],{"type":82,"value":126},{"type":69,"tag":110,"props":1171,"children":1172},{"style":129},[1173],{"type":82,"value":132},{"type":69,"tag":110,"props":1175,"children":1176},{"style":123},[1177],{"type":82,"value":147},{"type":69,"tag":110,"props":1179,"children":1180},{"style":117},[1181],{"type":82,"value":152},{"type":69,"tag":110,"props":1183,"children":1184},{"style":123},[1185],{"type":82,"value":157},{"type":69,"tag":110,"props":1187,"children":1188},{"style":160},[1189],{"type":82,"value":163},{"type":69,"tag":110,"props":1191,"children":1192},{"style":123},[1193],{"type":82,"value":168},{"type":69,"tag":110,"props":1195,"children":1196},{"class":112,"line":171},[1197,1201,1205,1210,1214,1218,1222,1226],{"type":69,"tag":110,"props":1198,"children":1199},{"style":117},[1200],{"type":82,"value":120},{"type":69,"tag":110,"props":1202,"children":1203},{"style":123},[1204],{"type":82,"value":126},{"type":69,"tag":110,"props":1206,"children":1207},{"style":129},[1208],{"type":82,"value":1209}," createCodeMode",{"type":69,"tag":110,"props":1211,"children":1212},{"style":123},[1213],{"type":82,"value":147},{"type":69,"tag":110,"props":1215,"children":1216},{"style":117},[1217],{"type":82,"value":152},{"type":69,"tag":110,"props":1219,"children":1220},{"style":123},[1221],{"type":82,"value":157},{"type":69,"tag":110,"props":1223,"children":1224},{"style":160},[1225],{"type":82,"value":240},{"type":69,"tag":110,"props":1227,"children":1228},{"style":123},[1229],{"type":82,"value":168},{"type":69,"tag":110,"props":1231,"children":1232},{"class":112,"line":209},[1233,1237,1241,1245,1249,1253,1257,1261],{"type":69,"tag":110,"props":1234,"children":1235},{"style":117},[1236],{"type":82,"value":120},{"type":69,"tag":110,"props":1238,"children":1239},{"style":123},[1240],{"type":82,"value":126},{"type":69,"tag":110,"props":1242,"children":1243},{"style":129},[1244],{"type":82,"value":261},{"type":69,"tag":110,"props":1246,"children":1247},{"style":123},[1248],{"type":82,"value":147},{"type":69,"tag":110,"props":1250,"children":1251},{"style":117},[1252],{"type":82,"value":152},{"type":69,"tag":110,"props":1254,"children":1255},{"style":123},[1256],{"type":82,"value":157},{"type":69,"tag":110,"props":1258,"children":1259},{"style":160},[1260],{"type":82,"value":278},{"type":69,"tag":110,"props":1262,"children":1263},{"style":123},[1264],{"type":82,"value":168},{"type":69,"tag":110,"props":1266,"children":1267},{"class":112,"line":247},[1268,1272,1276,1280,1284,1288,1292,1296],{"type":69,"tag":110,"props":1269,"children":1270},{"style":117},[1271],{"type":82,"value":120},{"type":69,"tag":110,"props":1273,"children":1274},{"style":123},[1275],{"type":82,"value":126},{"type":69,"tag":110,"props":1277,"children":1278},{"style":129},[1279],{"type":82,"value":185},{"type":69,"tag":110,"props":1281,"children":1282},{"style":123},[1283],{"type":82,"value":147},{"type":69,"tag":110,"props":1285,"children":1286},{"style":117},[1287],{"type":82,"value":152},{"type":69,"tag":110,"props":1289,"children":1290},{"style":123},[1291],{"type":82,"value":157},{"type":69,"tag":110,"props":1293,"children":1294},{"style":160},[1295],{"type":82,"value":202},{"type":69,"tag":110,"props":1297,"children":1298},{"style":123},[1299],{"type":82,"value":168},{"type":69,"tag":110,"props":1301,"children":1302},{"class":112,"line":285},[1303],{"type":69,"tag":110,"props":1304,"children":1305},{"emptyLinePlaceholder":364},[1306],{"type":82,"value":367},{"type":69,"tag":110,"props":1308,"children":1309},{"class":112,"line":322},[1310,1314,1318,1323,1327,1332,1336,1340,1344,1348],{"type":69,"tag":110,"props":1311,"children":1312},{"style":384},[1313],{"type":82,"value":387},{"type":69,"tag":110,"props":1315,"children":1316},{"style":123},[1317],{"type":82,"value":126},{"type":69,"tag":110,"props":1319,"children":1320},{"style":129},[1321],{"type":82,"value":1322}," tool",{"type":69,"tag":110,"props":1324,"children":1325},{"style":123},[1326],{"type":82,"value":137},{"type":69,"tag":110,"props":1328,"children":1329},{"style":129},[1330],{"type":82,"value":1331}," systemPrompt ",{"type":69,"tag":110,"props":1333,"children":1334},{"style":123},[1335],{"type":82,"value":544},{"type":69,"tag":110,"props":1337,"children":1338},{"style":123},[1339],{"type":82,"value":728},{"type":69,"tag":110,"props":1341,"children":1342},{"style":400},[1343],{"type":82,"value":1209},{"type":69,"tag":110,"props":1345,"children":1346},{"style":129},[1347],{"type":82,"value":407},{"type":69,"tag":110,"props":1349,"children":1350},{"style":123},[1351],{"type":82,"value":412},{"type":69,"tag":110,"props":1353,"children":1354},{"class":112,"line":360},[1355,1359,1363,1367,1371],{"type":69,"tag":110,"props":1356,"children":1357},{"style":419},[1358],{"type":82,"value":866},{"type":69,"tag":110,"props":1360,"children":1361},{"style":123},[1362],{"type":82,"value":427},{"type":69,"tag":110,"props":1364,"children":1365},{"style":400},[1366],{"type":82,"value":261},{"type":69,"tag":110,"props":1368,"children":1369},{"style":129},[1370],{"type":82,"value":613},{"type":69,"tag":110,"props":1372,"children":1373},{"style":123},[1374],{"type":82,"value":446},{"type":69,"tag":110,"props":1376,"children":1377},{"class":112,"line":370},[1378,1382,1386,1390],{"type":69,"tag":110,"props":1379,"children":1380},{"style":419},[1381],{"type":82,"value":953},{"type":69,"tag":110,"props":1383,"children":1384},{"style":123},[1385],{"type":82,"value":427},{"type":69,"tag":110,"props":1387,"children":1388},{"style":129},[1389],{"type":82,"value":962},{"type":69,"tag":110,"props":1391,"children":1392},{"style":123},[1393],{"type":82,"value":446},{"type":69,"tag":110,"props":1395,"children":1396},{"class":112,"line":380},[1397,1402,1406,1411],{"type":69,"tag":110,"props":1398,"children":1399},{"style":419},[1400],{"type":82,"value":1401},"  timeout",{"type":69,"tag":110,"props":1403,"children":1404},{"style":123},[1405],{"type":82,"value":427},{"type":69,"tag":110,"props":1407,"children":1408},{"style":898},[1409],{"type":82,"value":1410}," 30_000",{"type":69,"tag":110,"props":1412,"children":1413},{"style":123},[1414],{"type":82,"value":446},{"type":69,"tag":110,"props":1416,"children":1417},{"class":112,"line":415},[1418,1422],{"type":69,"tag":110,"props":1419,"children":1420},{"style":123},[1421],{"type":82,"value":544},{"type":69,"tag":110,"props":1423,"children":1424},{"style":129},[1425],{"type":82,"value":772},{"type":69,"tag":110,"props":1427,"children":1428},{"class":112,"line":449},[1429],{"type":69,"tag":110,"props":1430,"children":1431},{"emptyLinePlaceholder":364},[1432],{"type":82,"value":367},{"type":69,"tag":110,"props":1434,"children":1435},{"class":112,"line":479},[1436,1440,1444,1448,1452,1456],{"type":69,"tag":110,"props":1437,"children":1438},{"style":384},[1439],{"type":82,"value":387},{"type":69,"tag":110,"props":1441,"children":1442},{"style":129},[1443],{"type":82,"value":1008},{"type":69,"tag":110,"props":1445,"children":1446},{"style":123},[1447],{"type":82,"value":397},{"type":69,"tag":110,"props":1449,"children":1450},{"style":400},[1451],{"type":82,"value":132},{"type":69,"tag":110,"props":1453,"children":1454},{"style":129},[1455],{"type":82,"value":407},{"type":69,"tag":110,"props":1457,"children":1458},{"style":123},[1459],{"type":82,"value":412},{"type":69,"tag":110,"props":1461,"children":1462},{"class":112,"line":556},[1463,1467,1471,1475,1479,1483,1488,1492,1496],{"type":69,"tag":110,"props":1464,"children":1465},{"style":419},[1466],{"type":82,"value":1033},{"type":69,"tag":110,"props":1468,"children":1469},{"style":123},[1470],{"type":82,"value":427},{"type":69,"tag":110,"props":1472,"children":1473},{"style":400},[1474],{"type":82,"value":185},{"type":69,"tag":110,"props":1476,"children":1477},{"style":129},[1478],{"type":82,"value":407},{"type":69,"tag":110,"props":1480,"children":1481},{"style":123},[1482],{"type":82,"value":441},{"type":69,"tag":110,"props":1484,"children":1485},{"style":160},[1486],{"type":82,"value":1487},"gpt-4o",{"type":69,"tag":110,"props":1489,"children":1490},{"style":123},[1491],{"type":82,"value":441},{"type":69,"tag":110,"props":1493,"children":1494},{"style":129},[1495],{"type":82,"value":549},{"type":69,"tag":110,"props":1497,"children":1498},{"style":123},[1499],{"type":82,"value":446},{"type":69,"tag":110,"props":1501,"children":1502},{"class":112,"line":657},[1503,1508,1512,1517,1521,1526,1530,1534,1539],{"type":69,"tag":110,"props":1504,"children":1505},{"style":419},[1506],{"type":82,"value":1507},"  systemPrompts",{"type":69,"tag":110,"props":1509,"children":1510},{"style":123},[1511],{"type":82,"value":427},{"type":69,"tag":110,"props":1513,"children":1514},{"style":129},[1515],{"type":82,"value":1516}," [",{"type":69,"tag":110,"props":1518,"children":1519},{"style":123},[1520],{"type":82,"value":441},{"type":69,"tag":110,"props":1522,"children":1523},{"style":160},[1524],{"type":82,"value":1525},"You are a helpful assistant.",{"type":69,"tag":110,"props":1527,"children":1528},{"style":123},[1529],{"type":82,"value":441},{"type":69,"tag":110,"props":1531,"children":1532},{"style":123},[1533],{"type":82,"value":137},{"type":69,"tag":110,"props":1535,"children":1536},{"style":129},[1537],{"type":82,"value":1538}," systemPrompt]",{"type":69,"tag":110,"props":1540,"children":1541},{"style":123},[1542],{"type":82,"value":446},{"type":69,"tag":110,"props":1544,"children":1545},{"class":112,"line":712},[1546,1550,1554,1559],{"type":69,"tag":110,"props":1547,"children":1548},{"style":419},[1549],{"type":82,"value":953},{"type":69,"tag":110,"props":1551,"children":1552},{"style":123},[1553],{"type":82,"value":427},{"type":69,"tag":110,"props":1555,"children":1556},{"style":129},[1557],{"type":82,"value":1558}," [tool]",{"type":69,"tag":110,"props":1560,"children":1561},{"style":123},[1562],{"type":82,"value":446},{"type":69,"tag":110,"props":1564,"children":1565},{"class":112,"line":775},[1566,1570],{"type":69,"tag":110,"props":1567,"children":1568},{"style":129},[1569],{"type":82,"value":1075},{"type":69,"tag":110,"props":1571,"children":1572},{"style":123},[1573],{"type":82,"value":446},{"type":69,"tag":110,"props":1575,"children":1576},{"class":112,"line":802},[1577,1581],{"type":69,"tag":110,"props":1578,"children":1579},{"style":123},[1580],{"type":82,"value":544},{"type":69,"tag":110,"props":1582,"children":1583},{"style":129},[1584],{"type":82,"value":772},{"type":69,"tag":74,"props":1586,"children":1587},{},[1588,1594,1596,1602,1604,1610],{"type":69,"tag":106,"props":1589,"children":1591},{"className":1590},[],[1592],{"type":82,"value":1593},"createCodeMode",{"type":82,"value":1595}," calls ",{"type":69,"tag":106,"props":1597,"children":1599},{"className":1598},[],[1600],{"type":82,"value":1601},"createCodeModeTool",{"type":82,"value":1603}," and ",{"type":69,"tag":106,"props":1605,"children":1607},{"className":1606},[],[1608],{"type":82,"value":1609},"createCodeModeSystemPrompt",{"type":82,"value":1611}," internally. The system prompt includes generated TypeScript type stubs for each tool so the LLM writes correct calls.",{"type":69,"tag":87,"props":1613,"children":1615},{"id":1614},"core-patterns",[1616],{"type":82,"value":1617},"Core Patterns",{"type":69,"tag":1619,"props":1620,"children":1622},"h3",{"id":1621},"_1-choosing-an-isolate-driver",[1623],{"type":82,"value":1624},"1. Choosing an Isolate Driver",{"type":69,"tag":74,"props":1626,"children":1627},{},[1628,1630,1636],{"type":82,"value":1629},"Three drivers implement the ",{"type":69,"tag":106,"props":1631,"children":1633},{"className":1632},[],[1634],{"type":82,"value":1635},"IsolateDriver",{"type":82,"value":1637}," interface. All are interchangeable.",{"type":69,"tag":74,"props":1639,"children":1640},{},[1641,1646,1648,1654,1656,1662],{"type":69,"tag":78,"props":1642,"children":1643},{},[1644],{"type":82,"value":1645},"Node.js",{"type":82,"value":1647}," (",{"type":69,"tag":106,"props":1649,"children":1651},{"className":1650},[],[1652],{"type":82,"value":1653},"createNodeIsolateDriver",{"type":82,"value":1655},") -- Full V8 with JIT. Fastest option. Requires ",{"type":69,"tag":106,"props":1657,"children":1659},{"className":1658},[],[1660],{"type":82,"value":1661},"isolated-vm",{"type":82,"value":1663}," native C++ addon.",{"type":69,"tag":99,"props":1665,"children":1667},{"className":101,"code":1666,"language":14,"meta":103,"style":103},"import { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\n\nconst driver = createNodeIsolateDriver({\n  memoryLimit: 128, \u002F\u002F MB, default 128\n  timeout: 30_000, \u002F\u002F ms, default 30000\n  \u002F\u002F skipProbe: false -- set true only after verifying compatibility\n})\n",[1668],{"type":69,"tag":106,"props":1669,"children":1670},{"__ignoreMap":103},[1671,1706,1713,1741,1766,1790,1798],{"type":69,"tag":110,"props":1672,"children":1673},{"class":112,"line":113},[1674,1678,1682,1686,1690,1694,1698,1702],{"type":69,"tag":110,"props":1675,"children":1676},{"style":117},[1677],{"type":82,"value":120},{"type":69,"tag":110,"props":1679,"children":1680},{"style":123},[1681],{"type":82,"value":126},{"type":69,"tag":110,"props":1683,"children":1684},{"style":129},[1685],{"type":82,"value":261},{"type":69,"tag":110,"props":1687,"children":1688},{"style":123},[1689],{"type":82,"value":147},{"type":69,"tag":110,"props":1691,"children":1692},{"style":117},[1693],{"type":82,"value":152},{"type":69,"tag":110,"props":1695,"children":1696},{"style":123},[1697],{"type":82,"value":157},{"type":69,"tag":110,"props":1699,"children":1700},{"style":160},[1701],{"type":82,"value":278},{"type":69,"tag":110,"props":1703,"children":1704},{"style":123},[1705],{"type":82,"value":168},{"type":69,"tag":110,"props":1707,"children":1708},{"class":112,"line":171},[1709],{"type":69,"tag":110,"props":1710,"children":1711},{"emptyLinePlaceholder":364},[1712],{"type":82,"value":367},{"type":69,"tag":110,"props":1714,"children":1715},{"class":112,"line":209},[1716,1720,1725,1729,1733,1737],{"type":69,"tag":110,"props":1717,"children":1718},{"style":384},[1719],{"type":82,"value":387},{"type":69,"tag":110,"props":1721,"children":1722},{"style":129},[1723],{"type":82,"value":1724}," driver ",{"type":69,"tag":110,"props":1726,"children":1727},{"style":123},[1728],{"type":82,"value":397},{"type":69,"tag":110,"props":1730,"children":1731},{"style":400},[1732],{"type":82,"value":261},{"type":69,"tag":110,"props":1734,"children":1735},{"style":129},[1736],{"type":82,"value":407},{"type":69,"tag":110,"props":1738,"children":1739},{"style":123},[1740],{"type":82,"value":412},{"type":69,"tag":110,"props":1742,"children":1743},{"class":112,"line":247},[1744,1749,1753,1757,1761],{"type":69,"tag":110,"props":1745,"children":1746},{"style":419},[1747],{"type":82,"value":1748},"  memoryLimit",{"type":69,"tag":110,"props":1750,"children":1751},{"style":123},[1752],{"type":82,"value":427},{"type":69,"tag":110,"props":1754,"children":1755},{"style":898},[1756],{"type":82,"value":901},{"type":69,"tag":110,"props":1758,"children":1759},{"style":123},[1760],{"type":82,"value":137},{"type":69,"tag":110,"props":1762,"children":1763},{"style":374},[1764],{"type":82,"value":1765}," \u002F\u002F MB, default 128\n",{"type":69,"tag":110,"props":1767,"children":1768},{"class":112,"line":285},[1769,1773,1777,1781,1785],{"type":69,"tag":110,"props":1770,"children":1771},{"style":419},[1772],{"type":82,"value":1401},{"type":69,"tag":110,"props":1774,"children":1775},{"style":123},[1776],{"type":82,"value":427},{"type":69,"tag":110,"props":1778,"children":1779},{"style":898},[1780],{"type":82,"value":1410},{"type":69,"tag":110,"props":1782,"children":1783},{"style":123},[1784],{"type":82,"value":137},{"type":69,"tag":110,"props":1786,"children":1787},{"style":374},[1788],{"type":82,"value":1789}," \u002F\u002F ms, default 30000\n",{"type":69,"tag":110,"props":1791,"children":1792},{"class":112,"line":322},[1793],{"type":69,"tag":110,"props":1794,"children":1795},{"style":374},[1796],{"type":82,"value":1797},"  \u002F\u002F skipProbe: false -- set true only after verifying compatibility\n",{"type":69,"tag":110,"props":1799,"children":1800},{"class":112,"line":360},[1801,1805],{"type":69,"tag":110,"props":1802,"children":1803},{"style":123},[1804],{"type":82,"value":544},{"type":69,"tag":110,"props":1806,"children":1807},{"style":129},[1808],{"type":82,"value":772},{"type":69,"tag":74,"props":1810,"children":1811},{},[1812,1817,1818,1824],{"type":69,"tag":78,"props":1813,"children":1814},{},[1815],{"type":82,"value":1816},"QuickJS",{"type":82,"value":1647},{"type":69,"tag":106,"props":1819,"children":1821},{"className":1820},[],[1822],{"type":82,"value":1823},"createQuickJSIsolateDriver",{"type":82,"value":1825},") -- WASM-based, no native deps. Works in Node.js, browsers, Deno, Bun, and edge runtimes. Slower (interpreted, no JIT). Limited stdlib (no File I\u002FO).",{"type":69,"tag":99,"props":1827,"children":1829},{"className":101,"code":1828,"language":14,"meta":103,"style":103},"import { createQuickJSIsolateDriver } from '@tanstack\u002Fai-isolate-quickjs'\n\nconst driver = createQuickJSIsolateDriver({\n  memoryLimit: 128, \u002F\u002F MB, default 128\n  timeout: 30_000, \u002F\u002F ms, default 30000\n  maxStackSize: 524288, \u002F\u002F bytes, default 512 KiB\n})\n",[1830],{"type":69,"tag":106,"props":1831,"children":1832},{"__ignoreMap":103},[1833,1870,1877,1904,1927,1950,1976],{"type":69,"tag":110,"props":1834,"children":1835},{"class":112,"line":113},[1836,1840,1844,1849,1853,1857,1861,1866],{"type":69,"tag":110,"props":1837,"children":1838},{"style":117},[1839],{"type":82,"value":120},{"type":69,"tag":110,"props":1841,"children":1842},{"style":123},[1843],{"type":82,"value":126},{"type":69,"tag":110,"props":1845,"children":1846},{"style":129},[1847],{"type":82,"value":1848}," createQuickJSIsolateDriver",{"type":69,"tag":110,"props":1850,"children":1851},{"style":123},[1852],{"type":82,"value":147},{"type":69,"tag":110,"props":1854,"children":1855},{"style":117},[1856],{"type":82,"value":152},{"type":69,"tag":110,"props":1858,"children":1859},{"style":123},[1860],{"type":82,"value":157},{"type":69,"tag":110,"props":1862,"children":1863},{"style":160},[1864],{"type":82,"value":1865},"@tanstack\u002Fai-isolate-quickjs",{"type":69,"tag":110,"props":1867,"children":1868},{"style":123},[1869],{"type":82,"value":168},{"type":69,"tag":110,"props":1871,"children":1872},{"class":112,"line":171},[1873],{"type":69,"tag":110,"props":1874,"children":1875},{"emptyLinePlaceholder":364},[1876],{"type":82,"value":367},{"type":69,"tag":110,"props":1878,"children":1879},{"class":112,"line":209},[1880,1884,1888,1892,1896,1900],{"type":69,"tag":110,"props":1881,"children":1882},{"style":384},[1883],{"type":82,"value":387},{"type":69,"tag":110,"props":1885,"children":1886},{"style":129},[1887],{"type":82,"value":1724},{"type":69,"tag":110,"props":1889,"children":1890},{"style":123},[1891],{"type":82,"value":397},{"type":69,"tag":110,"props":1893,"children":1894},{"style":400},[1895],{"type":82,"value":1848},{"type":69,"tag":110,"props":1897,"children":1898},{"style":129},[1899],{"type":82,"value":407},{"type":69,"tag":110,"props":1901,"children":1902},{"style":123},[1903],{"type":82,"value":412},{"type":69,"tag":110,"props":1905,"children":1906},{"class":112,"line":247},[1907,1911,1915,1919,1923],{"type":69,"tag":110,"props":1908,"children":1909},{"style":419},[1910],{"type":82,"value":1748},{"type":69,"tag":110,"props":1912,"children":1913},{"style":123},[1914],{"type":82,"value":427},{"type":69,"tag":110,"props":1916,"children":1917},{"style":898},[1918],{"type":82,"value":901},{"type":69,"tag":110,"props":1920,"children":1921},{"style":123},[1922],{"type":82,"value":137},{"type":69,"tag":110,"props":1924,"children":1925},{"style":374},[1926],{"type":82,"value":1765},{"type":69,"tag":110,"props":1928,"children":1929},{"class":112,"line":285},[1930,1934,1938,1942,1946],{"type":69,"tag":110,"props":1931,"children":1932},{"style":419},[1933],{"type":82,"value":1401},{"type":69,"tag":110,"props":1935,"children":1936},{"style":123},[1937],{"type":82,"value":427},{"type":69,"tag":110,"props":1939,"children":1940},{"style":898},[1941],{"type":82,"value":1410},{"type":69,"tag":110,"props":1943,"children":1944},{"style":123},[1945],{"type":82,"value":137},{"type":69,"tag":110,"props":1947,"children":1948},{"style":374},[1949],{"type":82,"value":1789},{"type":69,"tag":110,"props":1951,"children":1952},{"class":112,"line":322},[1953,1958,1962,1967,1971],{"type":69,"tag":110,"props":1954,"children":1955},{"style":419},[1956],{"type":82,"value":1957},"  maxStackSize",{"type":69,"tag":110,"props":1959,"children":1960},{"style":123},[1961],{"type":82,"value":427},{"type":69,"tag":110,"props":1963,"children":1964},{"style":898},[1965],{"type":82,"value":1966}," 524288",{"type":69,"tag":110,"props":1968,"children":1969},{"style":123},[1970],{"type":82,"value":137},{"type":69,"tag":110,"props":1972,"children":1973},{"style":374},[1974],{"type":82,"value":1975}," \u002F\u002F bytes, default 512 KiB\n",{"type":69,"tag":110,"props":1977,"children":1978},{"class":112,"line":360},[1979,1983],{"type":69,"tag":110,"props":1980,"children":1981},{"style":123},[1982],{"type":82,"value":544},{"type":69,"tag":110,"props":1984,"children":1985},{"style":129},[1986],{"type":82,"value":772},{"type":69,"tag":74,"props":1988,"children":1989},{},[1990,1995,1996,2002,2004,2010],{"type":69,"tag":78,"props":1991,"children":1992},{},[1993],{"type":82,"value":1994},"Cloudflare",{"type":82,"value":1647},{"type":69,"tag":106,"props":1997,"children":1999},{"className":1998},[],[2000],{"type":82,"value":2001},"createCloudflareIsolateDriver",{"type":82,"value":2003},") -- Edge execution via a deployed Cloudflare Worker. Requires a ",{"type":69,"tag":106,"props":2005,"children":2007},{"className":2006},[],[2008],{"type":82,"value":2009},"workerUrl",{"type":82,"value":2011}," pointing to your deployed worker. Network latency on each tool call.",{"type":69,"tag":99,"props":2013,"children":2015},{"className":101,"code":2014,"language":14,"meta":103,"style":103},"import { createCloudflareIsolateDriver } from '@tanstack\u002Fai-isolate-cloudflare'\n\nconst driver = createCloudflareIsolateDriver({\n  workerUrl: 'https:\u002F\u002Fmy-code-mode-worker.my-account.workers.dev',\n  authorization: process.env.CODE_MODE_WORKER_SECRET,\n  timeout: 30_000, \u002F\u002F ms, default 30000\n  maxToolRounds: 10, \u002F\u002F max tool-call\u002Fresult cycles, default 10\n})\n",[2016],{"type":69,"tag":106,"props":2017,"children":2018},{"__ignoreMap":103},[2019,2056,2063,2090,2119,2158,2181,2207],{"type":69,"tag":110,"props":2020,"children":2021},{"class":112,"line":113},[2022,2026,2030,2035,2039,2043,2047,2052],{"type":69,"tag":110,"props":2023,"children":2024},{"style":117},[2025],{"type":82,"value":120},{"type":69,"tag":110,"props":2027,"children":2028},{"style":123},[2029],{"type":82,"value":126},{"type":69,"tag":110,"props":2031,"children":2032},{"style":129},[2033],{"type":82,"value":2034}," createCloudflareIsolateDriver",{"type":69,"tag":110,"props":2036,"children":2037},{"style":123},[2038],{"type":82,"value":147},{"type":69,"tag":110,"props":2040,"children":2041},{"style":117},[2042],{"type":82,"value":152},{"type":69,"tag":110,"props":2044,"children":2045},{"style":123},[2046],{"type":82,"value":157},{"type":69,"tag":110,"props":2048,"children":2049},{"style":160},[2050],{"type":82,"value":2051},"@tanstack\u002Fai-isolate-cloudflare",{"type":69,"tag":110,"props":2053,"children":2054},{"style":123},[2055],{"type":82,"value":168},{"type":69,"tag":110,"props":2057,"children":2058},{"class":112,"line":171},[2059],{"type":69,"tag":110,"props":2060,"children":2061},{"emptyLinePlaceholder":364},[2062],{"type":82,"value":367},{"type":69,"tag":110,"props":2064,"children":2065},{"class":112,"line":209},[2066,2070,2074,2078,2082,2086],{"type":69,"tag":110,"props":2067,"children":2068},{"style":384},[2069],{"type":82,"value":387},{"type":69,"tag":110,"props":2071,"children":2072},{"style":129},[2073],{"type":82,"value":1724},{"type":69,"tag":110,"props":2075,"children":2076},{"style":123},[2077],{"type":82,"value":397},{"type":69,"tag":110,"props":2079,"children":2080},{"style":400},[2081],{"type":82,"value":2034},{"type":69,"tag":110,"props":2083,"children":2084},{"style":129},[2085],{"type":82,"value":407},{"type":69,"tag":110,"props":2087,"children":2088},{"style":123},[2089],{"type":82,"value":412},{"type":69,"tag":110,"props":2091,"children":2092},{"class":112,"line":247},[2093,2098,2102,2106,2111,2115],{"type":69,"tag":110,"props":2094,"children":2095},{"style":419},[2096],{"type":82,"value":2097},"  workerUrl",{"type":69,"tag":110,"props":2099,"children":2100},{"style":123},[2101],{"type":82,"value":427},{"type":69,"tag":110,"props":2103,"children":2104},{"style":123},[2105],{"type":82,"value":157},{"type":69,"tag":110,"props":2107,"children":2108},{"style":160},[2109],{"type":82,"value":2110},"https:\u002F\u002Fmy-code-mode-worker.my-account.workers.dev",{"type":69,"tag":110,"props":2112,"children":2113},{"style":123},[2114],{"type":82,"value":441},{"type":69,"tag":110,"props":2116,"children":2117},{"style":123},[2118],{"type":82,"value":446},{"type":69,"tag":110,"props":2120,"children":2121},{"class":112,"line":285},[2122,2127,2131,2136,2140,2145,2149,2154],{"type":69,"tag":110,"props":2123,"children":2124},{"style":419},[2125],{"type":82,"value":2126},"  authorization",{"type":69,"tag":110,"props":2128,"children":2129},{"style":123},[2130],{"type":82,"value":427},{"type":69,"tag":110,"props":2132,"children":2133},{"style":129},[2134],{"type":82,"value":2135}," process",{"type":69,"tag":110,"props":2137,"children":2138},{"style":123},[2139],{"type":82,"value":498},{"type":69,"tag":110,"props":2141,"children":2142},{"style":129},[2143],{"type":82,"value":2144},"env",{"type":69,"tag":110,"props":2146,"children":2147},{"style":123},[2148],{"type":82,"value":498},{"type":69,"tag":110,"props":2150,"children":2151},{"style":129},[2152],{"type":82,"value":2153},"CODE_MODE_WORKER_SECRET",{"type":69,"tag":110,"props":2155,"children":2156},{"style":123},[2157],{"type":82,"value":446},{"type":69,"tag":110,"props":2159,"children":2160},{"class":112,"line":322},[2161,2165,2169,2173,2177],{"type":69,"tag":110,"props":2162,"children":2163},{"style":419},[2164],{"type":82,"value":1401},{"type":69,"tag":110,"props":2166,"children":2167},{"style":123},[2168],{"type":82,"value":427},{"type":69,"tag":110,"props":2170,"children":2171},{"style":898},[2172],{"type":82,"value":1410},{"type":69,"tag":110,"props":2174,"children":2175},{"style":123},[2176],{"type":82,"value":137},{"type":69,"tag":110,"props":2178,"children":2179},{"style":374},[2180],{"type":82,"value":1789},{"type":69,"tag":110,"props":2182,"children":2183},{"class":112,"line":360},[2184,2189,2193,2198,2202],{"type":69,"tag":110,"props":2185,"children":2186},{"style":419},[2187],{"type":82,"value":2188},"  maxToolRounds",{"type":69,"tag":110,"props":2190,"children":2191},{"style":123},[2192],{"type":82,"value":427},{"type":69,"tag":110,"props":2194,"children":2195},{"style":898},[2196],{"type":82,"value":2197}," 10",{"type":69,"tag":110,"props":2199,"children":2200},{"style":123},[2201],{"type":82,"value":137},{"type":69,"tag":110,"props":2203,"children":2204},{"style":374},[2205],{"type":82,"value":2206}," \u002F\u002F max tool-call\u002Fresult cycles, default 10\n",{"type":69,"tag":110,"props":2208,"children":2209},{"class":112,"line":370},[2210,2214],{"type":69,"tag":110,"props":2211,"children":2212},{"style":123},[2213],{"type":82,"value":544},{"type":69,"tag":110,"props":2215,"children":2216},{"style":129},[2217],{"type":82,"value":772},{"type":69,"tag":2219,"props":2220,"children":2221},"table",{},[2222,2256],{"type":69,"tag":2223,"props":2224,"children":2225},"thead",{},[2226],{"type":69,"tag":2227,"props":2228,"children":2229},"tr",{},[2230,2236,2241,2246,2251],{"type":69,"tag":2231,"props":2232,"children":2233},"th",{},[2234],{"type":82,"value":2235},"Driver",{"type":69,"tag":2231,"props":2237,"children":2238},{},[2239],{"type":82,"value":2240},"Best for",{"type":69,"tag":2231,"props":2242,"children":2243},{},[2244],{"type":82,"value":2245},"Native deps",{"type":69,"tag":2231,"props":2247,"children":2248},{},[2249],{"type":82,"value":2250},"Browser support",{"type":69,"tag":2231,"props":2252,"children":2253},{},[2254],{"type":82,"value":2255},"Performance",{"type":69,"tag":2257,"props":2258,"children":2259},"tbody",{},[2260,2289,2316],{"type":69,"tag":2227,"props":2261,"children":2262},{},[2263,2269,2274,2279,2284],{"type":69,"tag":2264,"props":2265,"children":2266},"td",{},[2267],{"type":82,"value":2268},"Node",{"type":69,"tag":2264,"props":2270,"children":2271},{},[2272],{"type":82,"value":2273},"Server-side Node.js",{"type":69,"tag":2264,"props":2275,"children":2276},{},[2277],{"type":82,"value":2278},"Yes (C++ addon)",{"type":69,"tag":2264,"props":2280,"children":2281},{},[2282],{"type":82,"value":2283},"No",{"type":69,"tag":2264,"props":2285,"children":2286},{},[2287],{"type":82,"value":2288},"Fast (V8 JIT)",{"type":69,"tag":2227,"props":2290,"children":2291},{},[2292,2296,2301,2306,2311],{"type":69,"tag":2264,"props":2293,"children":2294},{},[2295],{"type":82,"value":1816},{"type":69,"tag":2264,"props":2297,"children":2298},{},[2299],{"type":82,"value":2300},"Browsers, edge, portability",{"type":69,"tag":2264,"props":2302,"children":2303},{},[2304],{"type":82,"value":2305},"None (WASM)",{"type":69,"tag":2264,"props":2307,"children":2308},{},[2309],{"type":82,"value":2310},"Yes",{"type":69,"tag":2264,"props":2312,"children":2313},{},[2314],{"type":82,"value":2315},"Slower (interpreted)",{"type":69,"tag":2227,"props":2317,"children":2318},{},[2319,2323,2328,2333,2338],{"type":69,"tag":2264,"props":2320,"children":2321},{},[2322],{"type":82,"value":1994},{"type":69,"tag":2264,"props":2324,"children":2325},{},[2326],{"type":82,"value":2327},"Edge deployments",{"type":69,"tag":2264,"props":2329,"children":2330},{},[2331],{"type":82,"value":2332},"None",{"type":69,"tag":2264,"props":2334,"children":2335},{},[2336],{"type":82,"value":2337},"N\u002FA",{"type":69,"tag":2264,"props":2339,"children":2340},{},[2341],{"type":82,"value":2342},"Fast (V8 on edge)",{"type":69,"tag":1619,"props":2344,"children":2346},{"id":2345},"_2-adding-persistent-skills-with-codemodewithskills",[2347],{"type":82,"value":2348},"2. Adding Persistent Skills with codeModeWithSkills()",{"type":69,"tag":74,"props":2350,"children":2351},{},[2352],{"type":82,"value":2353},"Skills let the LLM save reusable code snippets. On future requests, relevant skills are loaded and exposed as callable tools.",{"type":69,"tag":99,"props":2355,"children":2357},{"className":101,"code":2356,"language":14,"meta":103,"style":103},"import { chat, maxIterations } from '@tanstack\u002Fai'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { codeModeWithSkills } from '@tanstack\u002Fai-code-mode-skills'\nimport { createFileSkillStorage } from '@tanstack\u002Fai-code-mode-skills\u002Fstorage'\nimport {\n  createDefaultTrustStrategy,\n  createAlwaysTrustedStrategy,\n  createCustomTrustStrategy,\n} from '@tanstack\u002Fai-code-mode-skills'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Trust strategies control how skills earn trust through executions\n\u002F\u002F Default: untrusted -> provisional (10+ runs, >=90%) -> trusted (100+ runs, >=95%)\n\u002F\u002F Relaxed: untrusted -> provisional (3+ runs, >=80%) -> trusted (10+ runs, >=90%)\n\u002F\u002F Always trusted: immediately trusted (dev\u002Ftesting)\n\u002F\u002F Custom: configurable thresholds\nconst trustStrategy = createDefaultTrustStrategy()\n\n\u002F\u002F Storage options: file system (production) or memory (testing)\nconst storage = createFileSkillStorage({\n  directory: '.\u002F.skills',\n  trustStrategy,\n})\n\nconst driver = createNodeIsolateDriver()\n\n\u002F\u002F High-level API: automatic LLM-based skill selection\nconst { toolsRegistry, systemPrompt, selectedSkills } =\n  await codeModeWithSkills({\n    config: {\n      driver,\n      tools: [myTool1, myTool2],\n      timeout: 60_000,\n      memoryLimit: 128,\n    },\n    adapter: openaiText('gpt-4o-mini'), \u002F\u002F cheap model for skill selection\n    skills: {\n      storage,\n      maxSkillsInContext: 5,\n    },\n    messages,\n  })\n\nconst stream = chat({\n  adapter: openaiText('gpt-4o'),\n  tools: toolsRegistry.getTools(),\n  messages,\n  systemPrompts: ['You are a helpful assistant.', systemPrompt],\n  agentLoopStrategy: maxIterations(15),\n})\n",[2358],{"type":69,"tag":106,"props":2359,"children":2360},{"__ignoreMap":103},[2361,2405,2440,2477,2514,2525,2537,2549,2561,2584,2619,2626,2634,2642,2650,2658,2666,2691,2698,2706,2734,2763,2775,2786,2793,2816,2823,2831,2874,2894,2910,2922,2952,2973,2993,3001,3048,3065,3078,3100,3108,3121,3133,3141,3169,3209,3242,3254,3294,3328],{"type":69,"tag":110,"props":2362,"children":2363},{"class":112,"line":113},[2364,2368,2372,2376,2380,2385,2389,2393,2397,2401],{"type":69,"tag":110,"props":2365,"children":2366},{"style":117},[2367],{"type":82,"value":120},{"type":69,"tag":110,"props":2369,"children":2370},{"style":123},[2371],{"type":82,"value":126},{"type":69,"tag":110,"props":2373,"children":2374},{"style":129},[2375],{"type":82,"value":132},{"type":69,"tag":110,"props":2377,"children":2378},{"style":123},[2379],{"type":82,"value":137},{"type":69,"tag":110,"props":2381,"children":2382},{"style":129},[2383],{"type":82,"value":2384}," maxIterations",{"type":69,"tag":110,"props":2386,"children":2387},{"style":123},[2388],{"type":82,"value":147},{"type":69,"tag":110,"props":2390,"children":2391},{"style":117},[2392],{"type":82,"value":152},{"type":69,"tag":110,"props":2394,"children":2395},{"style":123},[2396],{"type":82,"value":157},{"type":69,"tag":110,"props":2398,"children":2399},{"style":160},[2400],{"type":82,"value":163},{"type":69,"tag":110,"props":2402,"children":2403},{"style":123},[2404],{"type":82,"value":168},{"type":69,"tag":110,"props":2406,"children":2407},{"class":112,"line":171},[2408,2412,2416,2420,2424,2428,2432,2436],{"type":69,"tag":110,"props":2409,"children":2410},{"style":117},[2411],{"type":82,"value":120},{"type":69,"tag":110,"props":2413,"children":2414},{"style":123},[2415],{"type":82,"value":126},{"type":69,"tag":110,"props":2417,"children":2418},{"style":129},[2419],{"type":82,"value":261},{"type":69,"tag":110,"props":2421,"children":2422},{"style":123},[2423],{"type":82,"value":147},{"type":69,"tag":110,"props":2425,"children":2426},{"style":117},[2427],{"type":82,"value":152},{"type":69,"tag":110,"props":2429,"children":2430},{"style":123},[2431],{"type":82,"value":157},{"type":69,"tag":110,"props":2433,"children":2434},{"style":160},[2435],{"type":82,"value":278},{"type":69,"tag":110,"props":2437,"children":2438},{"style":123},[2439],{"type":82,"value":168},{"type":69,"tag":110,"props":2441,"children":2442},{"class":112,"line":209},[2443,2447,2451,2456,2460,2464,2468,2473],{"type":69,"tag":110,"props":2444,"children":2445},{"style":117},[2446],{"type":82,"value":120},{"type":69,"tag":110,"props":2448,"children":2449},{"style":123},[2450],{"type":82,"value":126},{"type":69,"tag":110,"props":2452,"children":2453},{"style":129},[2454],{"type":82,"value":2455}," codeModeWithSkills",{"type":69,"tag":110,"props":2457,"children":2458},{"style":123},[2459],{"type":82,"value":147},{"type":69,"tag":110,"props":2461,"children":2462},{"style":117},[2463],{"type":82,"value":152},{"type":69,"tag":110,"props":2465,"children":2466},{"style":123},[2467],{"type":82,"value":157},{"type":69,"tag":110,"props":2469,"children":2470},{"style":160},[2471],{"type":82,"value":2472},"@tanstack\u002Fai-code-mode-skills",{"type":69,"tag":110,"props":2474,"children":2475},{"style":123},[2476],{"type":82,"value":168},{"type":69,"tag":110,"props":2478,"children":2479},{"class":112,"line":247},[2480,2484,2488,2493,2497,2501,2505,2510],{"type":69,"tag":110,"props":2481,"children":2482},{"style":117},[2483],{"type":82,"value":120},{"type":69,"tag":110,"props":2485,"children":2486},{"style":123},[2487],{"type":82,"value":126},{"type":69,"tag":110,"props":2489,"children":2490},{"style":129},[2491],{"type":82,"value":2492}," createFileSkillStorage",{"type":69,"tag":110,"props":2494,"children":2495},{"style":123},[2496],{"type":82,"value":147},{"type":69,"tag":110,"props":2498,"children":2499},{"style":117},[2500],{"type":82,"value":152},{"type":69,"tag":110,"props":2502,"children":2503},{"style":123},[2504],{"type":82,"value":157},{"type":69,"tag":110,"props":2506,"children":2507},{"style":160},[2508],{"type":82,"value":2509},"@tanstack\u002Fai-code-mode-skills\u002Fstorage",{"type":69,"tag":110,"props":2511,"children":2512},{"style":123},[2513],{"type":82,"value":168},{"type":69,"tag":110,"props":2515,"children":2516},{"class":112,"line":285},[2517,2521],{"type":69,"tag":110,"props":2518,"children":2519},{"style":117},[2520],{"type":82,"value":120},{"type":69,"tag":110,"props":2522,"children":2523},{"style":123},[2524],{"type":82,"value":709},{"type":69,"tag":110,"props":2526,"children":2527},{"class":112,"line":322},[2528,2533],{"type":69,"tag":110,"props":2529,"children":2530},{"style":129},[2531],{"type":82,"value":2532},"  createDefaultTrustStrategy",{"type":69,"tag":110,"props":2534,"children":2535},{"style":123},[2536],{"type":82,"value":446},{"type":69,"tag":110,"props":2538,"children":2539},{"class":112,"line":360},[2540,2545],{"type":69,"tag":110,"props":2541,"children":2542},{"style":129},[2543],{"type":82,"value":2544},"  createAlwaysTrustedStrategy",{"type":69,"tag":110,"props":2546,"children":2547},{"style":123},[2548],{"type":82,"value":446},{"type":69,"tag":110,"props":2550,"children":2551},{"class":112,"line":370},[2552,2557],{"type":69,"tag":110,"props":2553,"children":2554},{"style":129},[2555],{"type":82,"value":2556},"  createCustomTrustStrategy",{"type":69,"tag":110,"props":2558,"children":2559},{"style":123},[2560],{"type":82,"value":446},{"type":69,"tag":110,"props":2562,"children":2563},{"class":112,"line":380},[2564,2568,2572,2576,2580],{"type":69,"tag":110,"props":2565,"children":2566},{"style":123},[2567],{"type":82,"value":544},{"type":69,"tag":110,"props":2569,"children":2570},{"style":117},[2571],{"type":82,"value":152},{"type":69,"tag":110,"props":2573,"children":2574},{"style":123},[2575],{"type":82,"value":157},{"type":69,"tag":110,"props":2577,"children":2578},{"style":160},[2579],{"type":82,"value":2472},{"type":69,"tag":110,"props":2581,"children":2582},{"style":123},[2583],{"type":82,"value":168},{"type":69,"tag":110,"props":2585,"children":2586},{"class":112,"line":415},[2587,2591,2595,2599,2603,2607,2611,2615],{"type":69,"tag":110,"props":2588,"children":2589},{"style":117},[2590],{"type":82,"value":120},{"type":69,"tag":110,"props":2592,"children":2593},{"style":123},[2594],{"type":82,"value":126},{"type":69,"tag":110,"props":2596,"children":2597},{"style":129},[2598],{"type":82,"value":185},{"type":69,"tag":110,"props":2600,"children":2601},{"style":123},[2602],{"type":82,"value":147},{"type":69,"tag":110,"props":2604,"children":2605},{"style":117},[2606],{"type":82,"value":152},{"type":69,"tag":110,"props":2608,"children":2609},{"style":123},[2610],{"type":82,"value":157},{"type":69,"tag":110,"props":2612,"children":2613},{"style":160},[2614],{"type":82,"value":202},{"type":69,"tag":110,"props":2616,"children":2617},{"style":123},[2618],{"type":82,"value":168},{"type":69,"tag":110,"props":2620,"children":2621},{"class":112,"line":449},[2622],{"type":69,"tag":110,"props":2623,"children":2624},{"emptyLinePlaceholder":364},[2625],{"type":82,"value":367},{"type":69,"tag":110,"props":2627,"children":2628},{"class":112,"line":479},[2629],{"type":69,"tag":110,"props":2630,"children":2631},{"style":374},[2632],{"type":82,"value":2633},"\u002F\u002F Trust strategies control how skills earn trust through executions\n",{"type":69,"tag":110,"props":2635,"children":2636},{"class":112,"line":556},[2637],{"type":69,"tag":110,"props":2638,"children":2639},{"style":374},[2640],{"type":82,"value":2641},"\u002F\u002F Default: untrusted -> provisional (10+ runs, >=90%) -> trusted (100+ runs, >=95%)\n",{"type":69,"tag":110,"props":2643,"children":2644},{"class":112,"line":657},[2645],{"type":69,"tag":110,"props":2646,"children":2647},{"style":374},[2648],{"type":82,"value":2649},"\u002F\u002F Relaxed: untrusted -> provisional (3+ runs, >=80%) -> trusted (10+ runs, >=90%)\n",{"type":69,"tag":110,"props":2651,"children":2652},{"class":112,"line":712},[2653],{"type":69,"tag":110,"props":2654,"children":2655},{"style":374},[2656],{"type":82,"value":2657},"\u002F\u002F Always trusted: immediately trusted (dev\u002Ftesting)\n",{"type":69,"tag":110,"props":2659,"children":2660},{"class":112,"line":775},[2661],{"type":69,"tag":110,"props":2662,"children":2663},{"style":374},[2664],{"type":82,"value":2665},"\u002F\u002F Custom: configurable thresholds\n",{"type":69,"tag":110,"props":2667,"children":2668},{"class":112,"line":802},[2669,2673,2678,2682,2687],{"type":69,"tag":110,"props":2670,"children":2671},{"style":384},[2672],{"type":82,"value":387},{"type":69,"tag":110,"props":2674,"children":2675},{"style":129},[2676],{"type":82,"value":2677}," trustStrategy ",{"type":69,"tag":110,"props":2679,"children":2680},{"style":123},[2681],{"type":82,"value":397},{"type":69,"tag":110,"props":2683,"children":2684},{"style":400},[2685],{"type":82,"value":2686}," createDefaultTrustStrategy",{"type":69,"tag":110,"props":2688,"children":2689},{"style":129},[2690],{"type":82,"value":799},{"type":69,"tag":110,"props":2692,"children":2693},{"class":112,"line":814},[2694],{"type":69,"tag":110,"props":2695,"children":2696},{"emptyLinePlaceholder":364},[2697],{"type":82,"value":367},{"type":69,"tag":110,"props":2699,"children":2700},{"class":112,"line":822},[2701],{"type":69,"tag":110,"props":2702,"children":2703},{"style":374},[2704],{"type":82,"value":2705},"\u002F\u002F Storage options: file system (production) or memory (testing)\n",{"type":69,"tag":110,"props":2707,"children":2708},{"class":112,"line":831},[2709,2713,2718,2722,2726,2730],{"type":69,"tag":110,"props":2710,"children":2711},{"style":384},[2712],{"type":82,"value":387},{"type":69,"tag":110,"props":2714,"children":2715},{"style":129},[2716],{"type":82,"value":2717}," storage ",{"type":69,"tag":110,"props":2719,"children":2720},{"style":123},[2721],{"type":82,"value":397},{"type":69,"tag":110,"props":2723,"children":2724},{"style":400},[2725],{"type":82,"value":2492},{"type":69,"tag":110,"props":2727,"children":2728},{"style":129},[2729],{"type":82,"value":407},{"type":69,"tag":110,"props":2731,"children":2732},{"style":123},[2733],{"type":82,"value":412},{"type":69,"tag":110,"props":2735,"children":2736},{"class":112,"line":860},[2737,2742,2746,2750,2755,2759],{"type":69,"tag":110,"props":2738,"children":2739},{"style":419},[2740],{"type":82,"value":2741},"  directory",{"type":69,"tag":110,"props":2743,"children":2744},{"style":123},[2745],{"type":82,"value":427},{"type":69,"tag":110,"props":2747,"children":2748},{"style":123},[2749],{"type":82,"value":157},{"type":69,"tag":110,"props":2751,"children":2752},{"style":160},[2753],{"type":82,"value":2754},".\u002F.skills",{"type":69,"tag":110,"props":2756,"children":2757},{"style":123},[2758],{"type":82,"value":441},{"type":69,"tag":110,"props":2760,"children":2761},{"style":123},[2762],{"type":82,"value":446},{"type":69,"tag":110,"props":2764,"children":2765},{"class":112,"line":885},[2766,2771],{"type":69,"tag":110,"props":2767,"children":2768},{"style":129},[2769],{"type":82,"value":2770},"  trustStrategy",{"type":69,"tag":110,"props":2772,"children":2773},{"style":123},[2774],{"type":82,"value":446},{"type":69,"tag":110,"props":2776,"children":2777},{"class":112,"line":908},[2778,2782],{"type":69,"tag":110,"props":2779,"children":2780},{"style":123},[2781],{"type":82,"value":544},{"type":69,"tag":110,"props":2783,"children":2784},{"style":129},[2785],{"type":82,"value":772},{"type":69,"tag":110,"props":2787,"children":2788},{"class":112,"line":930},[2789],{"type":69,"tag":110,"props":2790,"children":2791},{"emptyLinePlaceholder":364},[2792],{"type":82,"value":367},{"type":69,"tag":110,"props":2794,"children":2795},{"class":112,"line":947},[2796,2800,2804,2808,2812],{"type":69,"tag":110,"props":2797,"children":2798},{"style":384},[2799],{"type":82,"value":387},{"type":69,"tag":110,"props":2801,"children":2802},{"style":129},[2803],{"type":82,"value":1724},{"type":69,"tag":110,"props":2805,"children":2806},{"style":123},[2807],{"type":82,"value":397},{"type":69,"tag":110,"props":2809,"children":2810},{"style":400},[2811],{"type":82,"value":261},{"type":69,"tag":110,"props":2813,"children":2814},{"style":129},[2815],{"type":82,"value":799},{"type":69,"tag":110,"props":2817,"children":2818},{"class":112,"line":969},[2819],{"type":69,"tag":110,"props":2820,"children":2821},{"emptyLinePlaceholder":364},[2822],{"type":82,"value":367},{"type":69,"tag":110,"props":2824,"children":2825},{"class":112,"line":981},[2826],{"type":69,"tag":110,"props":2827,"children":2828},{"style":374},[2829],{"type":82,"value":2830},"\u002F\u002F High-level API: automatic LLM-based skill selection\n",{"type":69,"tag":110,"props":2832,"children":2833},{"class":112,"line":989},[2834,2838,2842,2847,2851,2856,2860,2865,2869],{"type":69,"tag":110,"props":2835,"children":2836},{"style":384},[2837],{"type":82,"value":387},{"type":69,"tag":110,"props":2839,"children":2840},{"style":123},[2841],{"type":82,"value":126},{"type":69,"tag":110,"props":2843,"children":2844},{"style":129},[2845],{"type":82,"value":2846}," toolsRegistry",{"type":69,"tag":110,"props":2848,"children":2849},{"style":123},[2850],{"type":82,"value":137},{"type":69,"tag":110,"props":2852,"children":2853},{"style":129},[2854],{"type":82,"value":2855}," systemPrompt",{"type":69,"tag":110,"props":2857,"children":2858},{"style":123},[2859],{"type":82,"value":137},{"type":69,"tag":110,"props":2861,"children":2862},{"style":129},[2863],{"type":82,"value":2864}," selectedSkills ",{"type":69,"tag":110,"props":2866,"children":2867},{"style":123},[2868],{"type":82,"value":544},{"type":69,"tag":110,"props":2870,"children":2871},{"style":123},[2872],{"type":82,"value":2873}," =\n",{"type":69,"tag":110,"props":2875,"children":2876},{"class":112,"line":998},[2877,2882,2886,2890],{"type":69,"tag":110,"props":2878,"children":2879},{"style":117},[2880],{"type":82,"value":2881},"  await",{"type":69,"tag":110,"props":2883,"children":2884},{"style":400},[2885],{"type":82,"value":2455},{"type":69,"tag":110,"props":2887,"children":2888},{"style":129},[2889],{"type":82,"value":407},{"type":69,"tag":110,"props":2891,"children":2892},{"style":123},[2893],{"type":82,"value":412},{"type":69,"tag":110,"props":2895,"children":2896},{"class":112,"line":1027},[2897,2902,2906],{"type":69,"tag":110,"props":2898,"children":2899},{"style":419},[2900],{"type":82,"value":2901},"    config",{"type":69,"tag":110,"props":2903,"children":2904},{"style":123},[2905],{"type":82,"value":427},{"type":69,"tag":110,"props":2907,"children":2908},{"style":123},[2909],{"type":82,"value":709},{"type":69,"tag":110,"props":2911,"children":2912},{"class":112,"line":1069},[2913,2918],{"type":69,"tag":110,"props":2914,"children":2915},{"style":129},[2916],{"type":82,"value":2917},"      driver",{"type":69,"tag":110,"props":2919,"children":2920},{"style":123},[2921],{"type":82,"value":446},{"type":69,"tag":110,"props":2923,"children":2924},{"class":112,"line":1082},[2925,2930,2934,2939,2943,2948],{"type":69,"tag":110,"props":2926,"children":2927},{"style":419},[2928],{"type":82,"value":2929},"      tools",{"type":69,"tag":110,"props":2931,"children":2932},{"style":123},[2933],{"type":82,"value":427},{"type":69,"tag":110,"props":2935,"children":2936},{"style":129},[2937],{"type":82,"value":2938}," [myTool1",{"type":69,"tag":110,"props":2940,"children":2941},{"style":123},[2942],{"type":82,"value":137},{"type":69,"tag":110,"props":2944,"children":2945},{"style":129},[2946],{"type":82,"value":2947}," myTool2]",{"type":69,"tag":110,"props":2949,"children":2950},{"style":123},[2951],{"type":82,"value":446},{"type":69,"tag":110,"props":2953,"children":2954},{"class":112,"line":1103},[2955,2960,2964,2969],{"type":69,"tag":110,"props":2956,"children":2957},{"style":419},[2958],{"type":82,"value":2959},"      timeout",{"type":69,"tag":110,"props":2961,"children":2962},{"style":123},[2963],{"type":82,"value":427},{"type":69,"tag":110,"props":2965,"children":2966},{"style":898},[2967],{"type":82,"value":2968}," 60_000",{"type":69,"tag":110,"props":2970,"children":2971},{"style":123},[2972],{"type":82,"value":446},{"type":69,"tag":110,"props":2974,"children":2975},{"class":112,"line":1115},[2976,2981,2985,2989],{"type":69,"tag":110,"props":2977,"children":2978},{"style":419},[2979],{"type":82,"value":2980},"      memoryLimit",{"type":69,"tag":110,"props":2982,"children":2983},{"style":123},[2984],{"type":82,"value":427},{"type":69,"tag":110,"props":2986,"children":2987},{"style":898},[2988],{"type":82,"value":901},{"type":69,"tag":110,"props":2990,"children":2991},{"style":123},[2992],{"type":82,"value":446},{"type":69,"tag":110,"props":2994,"children":2995},{"class":112,"line":1123},[2996],{"type":69,"tag":110,"props":2997,"children":2998},{"style":123},[2999],{"type":82,"value":3000},"    },\n",{"type":69,"tag":110,"props":3002,"children":3004},{"class":112,"line":3003},36,[3005,3010,3014,3018,3022,3026,3031,3035,3039,3043],{"type":69,"tag":110,"props":3006,"children":3007},{"style":419},[3008],{"type":82,"value":3009},"    adapter",{"type":69,"tag":110,"props":3011,"children":3012},{"style":123},[3013],{"type":82,"value":427},{"type":69,"tag":110,"props":3015,"children":3016},{"style":400},[3017],{"type":82,"value":185},{"type":69,"tag":110,"props":3019,"children":3020},{"style":129},[3021],{"type":82,"value":407},{"type":69,"tag":110,"props":3023,"children":3024},{"style":123},[3025],{"type":82,"value":441},{"type":69,"tag":110,"props":3027,"children":3028},{"style":160},[3029],{"type":82,"value":3030},"gpt-4o-mini",{"type":69,"tag":110,"props":3032,"children":3033},{"style":123},[3034],{"type":82,"value":441},{"type":69,"tag":110,"props":3036,"children":3037},{"style":129},[3038],{"type":82,"value":549},{"type":69,"tag":110,"props":3040,"children":3041},{"style":123},[3042],{"type":82,"value":137},{"type":69,"tag":110,"props":3044,"children":3045},{"style":374},[3046],{"type":82,"value":3047}," \u002F\u002F cheap model for skill selection\n",{"type":69,"tag":110,"props":3049,"children":3051},{"class":112,"line":3050},37,[3052,3057,3061],{"type":69,"tag":110,"props":3053,"children":3054},{"style":419},[3055],{"type":82,"value":3056},"    skills",{"type":69,"tag":110,"props":3058,"children":3059},{"style":123},[3060],{"type":82,"value":427},{"type":69,"tag":110,"props":3062,"children":3063},{"style":123},[3064],{"type":82,"value":709},{"type":69,"tag":110,"props":3066,"children":3068},{"class":112,"line":3067},38,[3069,3074],{"type":69,"tag":110,"props":3070,"children":3071},{"style":129},[3072],{"type":82,"value":3073},"      storage",{"type":69,"tag":110,"props":3075,"children":3076},{"style":123},[3077],{"type":82,"value":446},{"type":69,"tag":110,"props":3079,"children":3081},{"class":112,"line":3080},39,[3082,3087,3091,3096],{"type":69,"tag":110,"props":3083,"children":3084},{"style":419},[3085],{"type":82,"value":3086},"      maxSkillsInContext",{"type":69,"tag":110,"props":3088,"children":3089},{"style":123},[3090],{"type":82,"value":427},{"type":69,"tag":110,"props":3092,"children":3093},{"style":898},[3094],{"type":82,"value":3095}," 5",{"type":69,"tag":110,"props":3097,"children":3098},{"style":123},[3099],{"type":82,"value":446},{"type":69,"tag":110,"props":3101,"children":3103},{"class":112,"line":3102},40,[3104],{"type":69,"tag":110,"props":3105,"children":3106},{"style":123},[3107],{"type":82,"value":3000},{"type":69,"tag":110,"props":3109,"children":3111},{"class":112,"line":3110},41,[3112,3117],{"type":69,"tag":110,"props":3113,"children":3114},{"style":129},[3115],{"type":82,"value":3116},"    messages",{"type":69,"tag":110,"props":3118,"children":3119},{"style":123},[3120],{"type":82,"value":446},{"type":69,"tag":110,"props":3122,"children":3124},{"class":112,"line":3123},42,[3125,3129],{"type":69,"tag":110,"props":3126,"children":3127},{"style":123},[3128],{"type":82,"value":936},{"type":69,"tag":110,"props":3130,"children":3131},{"style":129},[3132],{"type":82,"value":772},{"type":69,"tag":110,"props":3134,"children":3136},{"class":112,"line":3135},43,[3137],{"type":69,"tag":110,"props":3138,"children":3139},{"emptyLinePlaceholder":364},[3140],{"type":82,"value":367},{"type":69,"tag":110,"props":3142,"children":3144},{"class":112,"line":3143},44,[3145,3149,3153,3157,3161,3165],{"type":69,"tag":110,"props":3146,"children":3147},{"style":384},[3148],{"type":82,"value":387},{"type":69,"tag":110,"props":3150,"children":3151},{"style":129},[3152],{"type":82,"value":1008},{"type":69,"tag":110,"props":3154,"children":3155},{"style":123},[3156],{"type":82,"value":397},{"type":69,"tag":110,"props":3158,"children":3159},{"style":400},[3160],{"type":82,"value":132},{"type":69,"tag":110,"props":3162,"children":3163},{"style":129},[3164],{"type":82,"value":407},{"type":69,"tag":110,"props":3166,"children":3167},{"style":123},[3168],{"type":82,"value":412},{"type":69,"tag":110,"props":3170,"children":3172},{"class":112,"line":3171},45,[3173,3177,3181,3185,3189,3193,3197,3201,3205],{"type":69,"tag":110,"props":3174,"children":3175},{"style":419},[3176],{"type":82,"value":1033},{"type":69,"tag":110,"props":3178,"children":3179},{"style":123},[3180],{"type":82,"value":427},{"type":69,"tag":110,"props":3182,"children":3183},{"style":400},[3184],{"type":82,"value":185},{"type":69,"tag":110,"props":3186,"children":3187},{"style":129},[3188],{"type":82,"value":407},{"type":69,"tag":110,"props":3190,"children":3191},{"style":123},[3192],{"type":82,"value":441},{"type":69,"tag":110,"props":3194,"children":3195},{"style":160},[3196],{"type":82,"value":1487},{"type":69,"tag":110,"props":3198,"children":3199},{"style":123},[3200],{"type":82,"value":441},{"type":69,"tag":110,"props":3202,"children":3203},{"style":129},[3204],{"type":82,"value":549},{"type":69,"tag":110,"props":3206,"children":3207},{"style":123},[3208],{"type":82,"value":446},{"type":69,"tag":110,"props":3210,"children":3212},{"class":112,"line":3211},46,[3213,3217,3221,3225,3229,3234,3238],{"type":69,"tag":110,"props":3214,"children":3215},{"style":419},[3216],{"type":82,"value":953},{"type":69,"tag":110,"props":3218,"children":3219},{"style":123},[3220],{"type":82,"value":427},{"type":69,"tag":110,"props":3222,"children":3223},{"style":129},[3224],{"type":82,"value":2846},{"type":69,"tag":110,"props":3226,"children":3227},{"style":123},[3228],{"type":82,"value":498},{"type":69,"tag":110,"props":3230,"children":3231},{"style":400},[3232],{"type":82,"value":3233},"getTools",{"type":69,"tag":110,"props":3235,"children":3236},{"style":129},[3237],{"type":82,"value":613},{"type":69,"tag":110,"props":3239,"children":3240},{"style":123},[3241],{"type":82,"value":446},{"type":69,"tag":110,"props":3243,"children":3245},{"class":112,"line":3244},47,[3246,3250],{"type":69,"tag":110,"props":3247,"children":3248},{"style":129},[3249],{"type":82,"value":1075},{"type":69,"tag":110,"props":3251,"children":3252},{"style":123},[3253],{"type":82,"value":446},{"type":69,"tag":110,"props":3255,"children":3257},{"class":112,"line":3256},48,[3258,3262,3266,3270,3274,3278,3282,3286,3290],{"type":69,"tag":110,"props":3259,"children":3260},{"style":419},[3261],{"type":82,"value":1507},{"type":69,"tag":110,"props":3263,"children":3264},{"style":123},[3265],{"type":82,"value":427},{"type":69,"tag":110,"props":3267,"children":3268},{"style":129},[3269],{"type":82,"value":1516},{"type":69,"tag":110,"props":3271,"children":3272},{"style":123},[3273],{"type":82,"value":441},{"type":69,"tag":110,"props":3275,"children":3276},{"style":160},[3277],{"type":82,"value":1525},{"type":69,"tag":110,"props":3279,"children":3280},{"style":123},[3281],{"type":82,"value":441},{"type":69,"tag":110,"props":3283,"children":3284},{"style":123},[3285],{"type":82,"value":137},{"type":69,"tag":110,"props":3287,"children":3288},{"style":129},[3289],{"type":82,"value":1538},{"type":69,"tag":110,"props":3291,"children":3292},{"style":123},[3293],{"type":82,"value":446},{"type":69,"tag":110,"props":3295,"children":3297},{"class":112,"line":3296},49,[3298,3303,3307,3311,3315,3320,3324],{"type":69,"tag":110,"props":3299,"children":3300},{"style":419},[3301],{"type":82,"value":3302},"  agentLoopStrategy",{"type":69,"tag":110,"props":3304,"children":3305},{"style":123},[3306],{"type":82,"value":427},{"type":69,"tag":110,"props":3308,"children":3309},{"style":400},[3310],{"type":82,"value":2384},{"type":69,"tag":110,"props":3312,"children":3313},{"style":129},[3314],{"type":82,"value":407},{"type":69,"tag":110,"props":3316,"children":3317},{"style":898},[3318],{"type":82,"value":3319},"15",{"type":69,"tag":110,"props":3321,"children":3322},{"style":129},[3323],{"type":82,"value":549},{"type":69,"tag":110,"props":3325,"children":3326},{"style":123},[3327],{"type":82,"value":446},{"type":69,"tag":110,"props":3329,"children":3331},{"class":112,"line":3330},50,[3332,3336],{"type":69,"tag":110,"props":3333,"children":3334},{"style":123},[3335],{"type":82,"value":544},{"type":69,"tag":110,"props":3337,"children":3338},{"style":129},[3339],{"type":82,"value":772},{"type":69,"tag":74,"props":3341,"children":3342},{},[3343,3345,3351,3353,3359,3360,3366,3367,3373],{"type":82,"value":3344},"The registry includes: ",{"type":69,"tag":106,"props":3346,"children":3348},{"className":3347},[],[3349],{"type":82,"value":3350},"execute_typescript",{"type":82,"value":3352},", ",{"type":69,"tag":106,"props":3354,"children":3356},{"className":3355},[],[3357],{"type":82,"value":3358},"search_skills",{"type":82,"value":3352},{"type":69,"tag":106,"props":3361,"children":3363},{"className":3362},[],[3364],{"type":82,"value":3365},"get_skill",{"type":82,"value":3352},{"type":69,"tag":106,"props":3368,"children":3370},{"className":3369},[],[3371],{"type":82,"value":3372},"register_skill",{"type":82,"value":3374},", and one tool per selected skill.",{"type":69,"tag":74,"props":3376,"children":3377},{},[3378],{"type":82,"value":3379},"Custom trust strategy example:",{"type":69,"tag":99,"props":3381,"children":3383},{"className":101,"code":3382,"language":14,"meta":103,"style":103},"const strategy = createCustomTrustStrategy({\n  initialLevel: 'untrusted',\n  provisionalThreshold: { executions: 5, successRate: 0.85 },\n  trustedThreshold: { executions: 50, successRate: 0.95 },\n})\n",[3384],{"type":69,"tag":106,"props":3385,"children":3386},{"__ignoreMap":103},[3387,3416,3445,3497,3547],{"type":69,"tag":110,"props":3388,"children":3389},{"class":112,"line":113},[3390,3394,3399,3403,3408,3412],{"type":69,"tag":110,"props":3391,"children":3392},{"style":384},[3393],{"type":82,"value":387},{"type":69,"tag":110,"props":3395,"children":3396},{"style":129},[3397],{"type":82,"value":3398}," strategy ",{"type":69,"tag":110,"props":3400,"children":3401},{"style":123},[3402],{"type":82,"value":397},{"type":69,"tag":110,"props":3404,"children":3405},{"style":400},[3406],{"type":82,"value":3407}," createCustomTrustStrategy",{"type":69,"tag":110,"props":3409,"children":3410},{"style":129},[3411],{"type":82,"value":407},{"type":69,"tag":110,"props":3413,"children":3414},{"style":123},[3415],{"type":82,"value":412},{"type":69,"tag":110,"props":3417,"children":3418},{"class":112,"line":171},[3419,3424,3428,3432,3437,3441],{"type":69,"tag":110,"props":3420,"children":3421},{"style":419},[3422],{"type":82,"value":3423},"  initialLevel",{"type":69,"tag":110,"props":3425,"children":3426},{"style":123},[3427],{"type":82,"value":427},{"type":69,"tag":110,"props":3429,"children":3430},{"style":123},[3431],{"type":82,"value":157},{"type":69,"tag":110,"props":3433,"children":3434},{"style":160},[3435],{"type":82,"value":3436},"untrusted",{"type":69,"tag":110,"props":3438,"children":3439},{"style":123},[3440],{"type":82,"value":441},{"type":69,"tag":110,"props":3442,"children":3443},{"style":123},[3444],{"type":82,"value":446},{"type":69,"tag":110,"props":3446,"children":3447},{"class":112,"line":209},[3448,3453,3457,3461,3466,3470,3474,3478,3483,3487,3492],{"type":69,"tag":110,"props":3449,"children":3450},{"style":419},[3451],{"type":82,"value":3452},"  provisionalThreshold",{"type":69,"tag":110,"props":3454,"children":3455},{"style":123},[3456],{"type":82,"value":427},{"type":69,"tag":110,"props":3458,"children":3459},{"style":123},[3460],{"type":82,"value":126},{"type":69,"tag":110,"props":3462,"children":3463},{"style":419},[3464],{"type":82,"value":3465}," executions",{"type":69,"tag":110,"props":3467,"children":3468},{"style":123},[3469],{"type":82,"value":427},{"type":69,"tag":110,"props":3471,"children":3472},{"style":898},[3473],{"type":82,"value":3095},{"type":69,"tag":110,"props":3475,"children":3476},{"style":123},[3477],{"type":82,"value":137},{"type":69,"tag":110,"props":3479,"children":3480},{"style":419},[3481],{"type":82,"value":3482}," successRate",{"type":69,"tag":110,"props":3484,"children":3485},{"style":123},[3486],{"type":82,"value":427},{"type":69,"tag":110,"props":3488,"children":3489},{"style":898},[3490],{"type":82,"value":3491}," 0.85",{"type":69,"tag":110,"props":3493,"children":3494},{"style":123},[3495],{"type":82,"value":3496}," },\n",{"type":69,"tag":110,"props":3498,"children":3499},{"class":112,"line":247},[3500,3505,3509,3513,3517,3521,3526,3530,3534,3538,3543],{"type":69,"tag":110,"props":3501,"children":3502},{"style":419},[3503],{"type":82,"value":3504},"  trustedThreshold",{"type":69,"tag":110,"props":3506,"children":3507},{"style":123},[3508],{"type":82,"value":427},{"type":69,"tag":110,"props":3510,"children":3511},{"style":123},[3512],{"type":82,"value":126},{"type":69,"tag":110,"props":3514,"children":3515},{"style":419},[3516],{"type":82,"value":3465},{"type":69,"tag":110,"props":3518,"children":3519},{"style":123},[3520],{"type":82,"value":427},{"type":69,"tag":110,"props":3522,"children":3523},{"style":898},[3524],{"type":82,"value":3525}," 50",{"type":69,"tag":110,"props":3527,"children":3528},{"style":123},[3529],{"type":82,"value":137},{"type":69,"tag":110,"props":3531,"children":3532},{"style":419},[3533],{"type":82,"value":3482},{"type":69,"tag":110,"props":3535,"children":3536},{"style":123},[3537],{"type":82,"value":427},{"type":69,"tag":110,"props":3539,"children":3540},{"style":898},[3541],{"type":82,"value":3542}," 0.95",{"type":69,"tag":110,"props":3544,"children":3545},{"style":123},[3546],{"type":82,"value":3496},{"type":69,"tag":110,"props":3548,"children":3549},{"class":112,"line":285},[3550,3554],{"type":69,"tag":110,"props":3551,"children":3552},{"style":123},[3553],{"type":82,"value":544},{"type":69,"tag":110,"props":3555,"children":3556},{"style":129},[3557],{"type":82,"value":772},{"type":69,"tag":74,"props":3559,"children":3560},{},[3561],{"type":82,"value":3562},"Storage implementations:",{"type":69,"tag":99,"props":3564,"children":3566},{"className":101,"code":3565,"language":14,"meta":103,"style":103},"\u002F\u002F File storage (production) -- persists skills as files on disk\nimport { createFileSkillStorage } from '@tanstack\u002Fai-code-mode-skills\u002Fstorage'\nconst fileStorage = createFileSkillStorage({ directory: '.\u002F.skills' })\n\n\u002F\u002F Memory storage (testing) -- in-memory, lost on restart\nimport { createMemorySkillStorage } from '@tanstack\u002Fai-code-mode-skills\u002Fstorage'\nconst memStorage = createMemorySkillStorage()\n",[3567],{"type":69,"tag":106,"props":3568,"children":3569},{"__ignoreMap":103},[3570,3578,3613,3670,3677,3685,3721],{"type":69,"tag":110,"props":3571,"children":3572},{"class":112,"line":113},[3573],{"type":69,"tag":110,"props":3574,"children":3575},{"style":374},[3576],{"type":82,"value":3577},"\u002F\u002F File storage (production) -- persists skills as files on disk\n",{"type":69,"tag":110,"props":3579,"children":3580},{"class":112,"line":171},[3581,3585,3589,3593,3597,3601,3605,3609],{"type":69,"tag":110,"props":3582,"children":3583},{"style":117},[3584],{"type":82,"value":120},{"type":69,"tag":110,"props":3586,"children":3587},{"style":123},[3588],{"type":82,"value":126},{"type":69,"tag":110,"props":3590,"children":3591},{"style":129},[3592],{"type":82,"value":2492},{"type":69,"tag":110,"props":3594,"children":3595},{"style":123},[3596],{"type":82,"value":147},{"type":69,"tag":110,"props":3598,"children":3599},{"style":117},[3600],{"type":82,"value":152},{"type":69,"tag":110,"props":3602,"children":3603},{"style":123},[3604],{"type":82,"value":157},{"type":69,"tag":110,"props":3606,"children":3607},{"style":160},[3608],{"type":82,"value":2509},{"type":69,"tag":110,"props":3610,"children":3611},{"style":123},[3612],{"type":82,"value":168},{"type":69,"tag":110,"props":3614,"children":3615},{"class":112,"line":209},[3616,3620,3625,3629,3633,3637,3641,3646,3650,3654,3658,3662,3666],{"type":69,"tag":110,"props":3617,"children":3618},{"style":384},[3619],{"type":82,"value":387},{"type":69,"tag":110,"props":3621,"children":3622},{"style":129},[3623],{"type":82,"value":3624}," fileStorage ",{"type":69,"tag":110,"props":3626,"children":3627},{"style":123},[3628],{"type":82,"value":397},{"type":69,"tag":110,"props":3630,"children":3631},{"style":400},[3632],{"type":82,"value":2492},{"type":69,"tag":110,"props":3634,"children":3635},{"style":129},[3636],{"type":82,"value":407},{"type":69,"tag":110,"props":3638,"children":3639},{"style":123},[3640],{"type":82,"value":512},{"type":69,"tag":110,"props":3642,"children":3643},{"style":419},[3644],{"type":82,"value":3645}," directory",{"type":69,"tag":110,"props":3647,"children":3648},{"style":123},[3649],{"type":82,"value":427},{"type":69,"tag":110,"props":3651,"children":3652},{"style":123},[3653],{"type":82,"value":157},{"type":69,"tag":110,"props":3655,"children":3656},{"style":160},[3657],{"type":82,"value":2754},{"type":69,"tag":110,"props":3659,"children":3660},{"style":123},[3661],{"type":82,"value":441},{"type":69,"tag":110,"props":3663,"children":3664},{"style":123},[3665],{"type":82,"value":147},{"type":69,"tag":110,"props":3667,"children":3668},{"style":129},[3669],{"type":82,"value":772},{"type":69,"tag":110,"props":3671,"children":3672},{"class":112,"line":247},[3673],{"type":69,"tag":110,"props":3674,"children":3675},{"emptyLinePlaceholder":364},[3676],{"type":82,"value":367},{"type":69,"tag":110,"props":3678,"children":3679},{"class":112,"line":285},[3680],{"type":69,"tag":110,"props":3681,"children":3682},{"style":374},[3683],{"type":82,"value":3684},"\u002F\u002F Memory storage (testing) -- in-memory, lost on restart\n",{"type":69,"tag":110,"props":3686,"children":3687},{"class":112,"line":322},[3688,3692,3696,3701,3705,3709,3713,3717],{"type":69,"tag":110,"props":3689,"children":3690},{"style":117},[3691],{"type":82,"value":120},{"type":69,"tag":110,"props":3693,"children":3694},{"style":123},[3695],{"type":82,"value":126},{"type":69,"tag":110,"props":3697,"children":3698},{"style":129},[3699],{"type":82,"value":3700}," createMemorySkillStorage",{"type":69,"tag":110,"props":3702,"children":3703},{"style":123},[3704],{"type":82,"value":147},{"type":69,"tag":110,"props":3706,"children":3707},{"style":117},[3708],{"type":82,"value":152},{"type":69,"tag":110,"props":3710,"children":3711},{"style":123},[3712],{"type":82,"value":157},{"type":69,"tag":110,"props":3714,"children":3715},{"style":160},[3716],{"type":82,"value":2509},{"type":69,"tag":110,"props":3718,"children":3719},{"style":123},[3720],{"type":82,"value":168},{"type":69,"tag":110,"props":3722,"children":3723},{"class":112,"line":360},[3724,3728,3733,3737,3741],{"type":69,"tag":110,"props":3725,"children":3726},{"style":384},[3727],{"type":82,"value":387},{"type":69,"tag":110,"props":3729,"children":3730},{"style":129},[3731],{"type":82,"value":3732}," memStorage ",{"type":69,"tag":110,"props":3734,"children":3735},{"style":123},[3736],{"type":82,"value":397},{"type":69,"tag":110,"props":3738,"children":3739},{"style":400},[3740],{"type":82,"value":3700},{"type":69,"tag":110,"props":3742,"children":3743},{"style":129},[3744],{"type":82,"value":799},{"type":69,"tag":1619,"props":3746,"children":3748},{"id":3747},"_3-client-side-execution-progress-display",[3749],{"type":82,"value":3750},"3. Client-Side Execution Progress Display",{"type":69,"tag":74,"props":3752,"children":3753},{},[3754,3756,3762,3764,3770],{"type":82,"value":3755},"Code Mode emits custom events during sandbox execution. Handle them in ",{"type":69,"tag":106,"props":3757,"children":3759},{"className":3758},[],[3760],{"type":82,"value":3761},"useChat",{"type":82,"value":3763}," via ",{"type":69,"tag":106,"props":3765,"children":3767},{"className":3766},[],[3768],{"type":82,"value":3769},"onCustomEvent",{"type":82,"value":498},{"type":69,"tag":74,"props":3772,"children":3773},{},[3774],{"type":82,"value":3775},"Events emitted:",{"type":69,"tag":2219,"props":3777,"children":3778},{},[3779,3800],{"type":69,"tag":2223,"props":3780,"children":3781},{},[3782],{"type":69,"tag":2227,"props":3783,"children":3784},{},[3785,3790,3795],{"type":69,"tag":2231,"props":3786,"children":3787},{},[3788],{"type":82,"value":3789},"Event",{"type":69,"tag":2231,"props":3791,"children":3792},{},[3793],{"type":82,"value":3794},"When",{"type":69,"tag":2231,"props":3796,"children":3797},{},[3798],{"type":82,"value":3799},"Key fields",{"type":69,"tag":2257,"props":3801,"children":3802},{},[3803,3836,3875,3914,3953],{"type":69,"tag":2227,"props":3804,"children":3805},{},[3806,3815,3820],{"type":69,"tag":2264,"props":3807,"children":3808},{},[3809],{"type":69,"tag":106,"props":3810,"children":3812},{"className":3811},[],[3813],{"type":82,"value":3814},"code_mode:execution_started",{"type":69,"tag":2264,"props":3816,"children":3817},{},[3818],{"type":82,"value":3819},"Sandbox begins",{"type":69,"tag":2264,"props":3821,"children":3822},{},[3823,3829,3830],{"type":69,"tag":106,"props":3824,"children":3826},{"className":3825},[],[3827],{"type":82,"value":3828},"timestamp",{"type":82,"value":3352},{"type":69,"tag":106,"props":3831,"children":3833},{"className":3832},[],[3834],{"type":82,"value":3835},"codeLength",{"type":69,"tag":2227,"props":3837,"children":3838},{},[3839,3848,3853],{"type":69,"tag":2264,"props":3840,"children":3841},{},[3842],{"type":69,"tag":106,"props":3843,"children":3845},{"className":3844},[],[3846],{"type":82,"value":3847},"code_mode:console",{"type":69,"tag":2264,"props":3849,"children":3850},{},[3851],{"type":82,"value":3852},"Each console.log\u002Ferror\u002Fwarn\u002Finfo",{"type":69,"tag":2264,"props":3854,"children":3855},{},[3856,3862,3863,3869,3870],{"type":69,"tag":106,"props":3857,"children":3859},{"className":3858},[],[3860],{"type":82,"value":3861},"level",{"type":82,"value":3352},{"type":69,"tag":106,"props":3864,"children":3866},{"className":3865},[],[3867],{"type":82,"value":3868},"message",{"type":82,"value":3352},{"type":69,"tag":106,"props":3871,"children":3873},{"className":3872},[],[3874],{"type":82,"value":3828},{"type":69,"tag":2227,"props":3876,"children":3877},{},[3878,3887,3892],{"type":69,"tag":2264,"props":3879,"children":3880},{},[3881],{"type":69,"tag":106,"props":3882,"children":3884},{"className":3883},[],[3885],{"type":82,"value":3886},"code_mode:external_call",{"type":69,"tag":2264,"props":3888,"children":3889},{},[3890],{"type":82,"value":3891},"Before an external_* function runs",{"type":69,"tag":2264,"props":3893,"children":3894},{},[3895,3901,3902,3908,3909],{"type":69,"tag":106,"props":3896,"children":3898},{"className":3897},[],[3899],{"type":82,"value":3900},"function",{"type":82,"value":3352},{"type":69,"tag":106,"props":3903,"children":3905},{"className":3904},[],[3906],{"type":82,"value":3907},"args",{"type":82,"value":3352},{"type":69,"tag":106,"props":3910,"children":3912},{"className":3911},[],[3913],{"type":82,"value":3828},{"type":69,"tag":2227,"props":3915,"children":3916},{},[3917,3926,3931],{"type":69,"tag":2264,"props":3918,"children":3919},{},[3920],{"type":69,"tag":106,"props":3921,"children":3923},{"className":3922},[],[3924],{"type":82,"value":3925},"code_mode:external_result",{"type":69,"tag":2264,"props":3927,"children":3928},{},[3929],{"type":82,"value":3930},"After successful external_* call",{"type":69,"tag":2264,"props":3932,"children":3933},{},[3934,3939,3940,3946,3947],{"type":69,"tag":106,"props":3935,"children":3937},{"className":3936},[],[3938],{"type":82,"value":3900},{"type":82,"value":3352},{"type":69,"tag":106,"props":3941,"children":3943},{"className":3942},[],[3944],{"type":82,"value":3945},"result",{"type":82,"value":3352},{"type":69,"tag":106,"props":3948,"children":3950},{"className":3949},[],[3951],{"type":82,"value":3952},"duration",{"type":69,"tag":2227,"props":3954,"children":3955},{},[3956,3965,3970],{"type":69,"tag":2264,"props":3957,"children":3958},{},[3959],{"type":69,"tag":106,"props":3960,"children":3962},{"className":3961},[],[3963],{"type":82,"value":3964},"code_mode:external_error",{"type":69,"tag":2264,"props":3966,"children":3967},{},[3968],{"type":82,"value":3969},"When external_* call fails",{"type":69,"tag":2264,"props":3971,"children":3972},{},[3973,3978,3979,3985,3986],{"type":69,"tag":106,"props":3974,"children":3976},{"className":3975},[],[3977],{"type":82,"value":3900},{"type":82,"value":3352},{"type":69,"tag":106,"props":3980,"children":3982},{"className":3981},[],[3983],{"type":82,"value":3984},"error",{"type":82,"value":3352},{"type":69,"tag":106,"props":3987,"children":3989},{"className":3988},[],[3990],{"type":82,"value":3952},{"type":69,"tag":99,"props":3992,"children":3994},{"className":101,"code":3993,"language":14,"meta":103,"style":103},"import { useCallback, useRef, useState } from 'react'\nimport { useChat, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\ninterface VMEvent {\n  id: string\n  eventType: string\n  data: unknown\n  timestamp: number\n}\n\nexport function CodeModeChat() {\n  const [toolCallEvents, setToolCallEvents] = useState\u003C\n    Map\u003Cstring, Array\u003CVMEvent>>\n  >(new Map())\n  const eventIdCounter = useRef(0)\n\n  const handleCustomEvent = useCallback(\n    (\n      eventType: string,\n      data: unknown,\n      context: { toolCallId?: string },\n    ) => {\n      const { toolCallId } = context\n      if (!toolCallId) return\n\n      const event: VMEvent = {\n        id: `event-${eventIdCounter.current++}`,\n        eventType,\n        data,\n        timestamp: Date.now(),\n      }\n\n      setToolCallEvents((prev) => {\n        const next = new Map(prev)\n        const events = next.get(toolCallId) || []\n        next.set(toolCallId, [...events, event])\n        return next\n      })\n    },\n    [],\n  )\n\n  const { messages, sendMessage, isLoading } = useChat({\n    connection: fetchServerSentEvents('\u002Fapi\u002Fchat'),\n    onCustomEvent: handleCustomEvent,\n  })\n\n  return (\n    \u003Cdiv>\n      {messages.map((message) => (\n        \u003Cdiv key={message.id}>\n          {message.parts.map((part) => {\n            if (part.type === 'text') {\n              return \u003Cp key={part.id}>{part.content}\u003C\u002Fp>\n            }\n            if (\n              part.type === 'tool-call' &&\n              part.name === 'execute_typescript'\n            ) {\n              const events = toolCallEvents.get(part.id) || []\n              return (\n                \u003Cdiv key={part.id}>\n                  \u003Cpre>{JSON.parse(part.arguments)?.typescriptCode}\u003C\u002Fpre>\n                  {events.map((evt) => (\n                    \u003Cdiv key={evt.id}>\n                      {evt.eventType}: {JSON.stringify(evt.data)}\n                    \u003C\u002Fdiv>\n                  ))}\n                  {part.output && (\n                    \u003Cpre>{JSON.stringify(part.output, null, 2)}\u003C\u002Fpre>\n                  )}\n                \u003C\u002Fdiv>\n              )\n            }\n            return null\n          })}\n        \u003C\u002Fdiv>\n      ))}\n    \u003C\u002Fdiv>\n  )\n}\n",[3995],{"type":69,"tag":106,"props":3996,"children":3997},{"__ignoreMap":103},[3998,4052,4098,4105,4123,4140,4156,4173,4190,4198,4205,4231,4274,4314,4341,4374,4381,4406,4414,4435,4456,4490,4507,4537,4569,4576,4604,4657,4669,4681,4715,4723,4730,4763,4801,4852,4908,4921,4933,4940,4952,4960,4967,5021,5062,5082,5093,5100,5112,5130,5173,5211,5262,5300,5378,5387,5399,5426,5447,5460,5518,5530,5563,5606,5648,5682,5752,5769,5782,5808,5891,5904,5921,5930,5938,5952,5969,5986,5999,6016,6024],{"type":69,"tag":110,"props":3999,"children":4000},{"class":112,"line":113},[4001,4005,4009,4014,4018,4023,4027,4032,4036,4040,4044,4048],{"type":69,"tag":110,"props":4002,"children":4003},{"style":117},[4004],{"type":82,"value":120},{"type":69,"tag":110,"props":4006,"children":4007},{"style":123},[4008],{"type":82,"value":126},{"type":69,"tag":110,"props":4010,"children":4011},{"style":129},[4012],{"type":82,"value":4013}," useCallback",{"type":69,"tag":110,"props":4015,"children":4016},{"style":123},[4017],{"type":82,"value":137},{"type":69,"tag":110,"props":4019,"children":4020},{"style":129},[4021],{"type":82,"value":4022}," useRef",{"type":69,"tag":110,"props":4024,"children":4025},{"style":123},[4026],{"type":82,"value":137},{"type":69,"tag":110,"props":4028,"children":4029},{"style":129},[4030],{"type":82,"value":4031}," useState",{"type":69,"tag":110,"props":4033,"children":4034},{"style":123},[4035],{"type":82,"value":147},{"type":69,"tag":110,"props":4037,"children":4038},{"style":117},[4039],{"type":82,"value":152},{"type":69,"tag":110,"props":4041,"children":4042},{"style":123},[4043],{"type":82,"value":157},{"type":69,"tag":110,"props":4045,"children":4046},{"style":160},[4047],{"type":82,"value":42},{"type":69,"tag":110,"props":4049,"children":4050},{"style":123},[4051],{"type":82,"value":168},{"type":69,"tag":110,"props":4053,"children":4054},{"class":112,"line":171},[4055,4059,4063,4068,4072,4077,4081,4085,4089,4094],{"type":69,"tag":110,"props":4056,"children":4057},{"style":117},[4058],{"type":82,"value":120},{"type":69,"tag":110,"props":4060,"children":4061},{"style":123},[4062],{"type":82,"value":126},{"type":69,"tag":110,"props":4064,"children":4065},{"style":129},[4066],{"type":82,"value":4067}," useChat",{"type":69,"tag":110,"props":4069,"children":4070},{"style":123},[4071],{"type":82,"value":137},{"type":69,"tag":110,"props":4073,"children":4074},{"style":129},[4075],{"type":82,"value":4076}," fetchServerSentEvents",{"type":69,"tag":110,"props":4078,"children":4079},{"style":123},[4080],{"type":82,"value":147},{"type":69,"tag":110,"props":4082,"children":4083},{"style":117},[4084],{"type":82,"value":152},{"type":69,"tag":110,"props":4086,"children":4087},{"style":123},[4088],{"type":82,"value":157},{"type":69,"tag":110,"props":4090,"children":4091},{"style":160},[4092],{"type":82,"value":4093},"@tanstack\u002Fai-react",{"type":69,"tag":110,"props":4095,"children":4096},{"style":123},[4097],{"type":82,"value":168},{"type":69,"tag":110,"props":4099,"children":4100},{"class":112,"line":209},[4101],{"type":69,"tag":110,"props":4102,"children":4103},{"emptyLinePlaceholder":364},[4104],{"type":82,"value":367},{"type":69,"tag":110,"props":4106,"children":4107},{"class":112,"line":247},[4108,4113,4119],{"type":69,"tag":110,"props":4109,"children":4110},{"style":384},[4111],{"type":82,"value":4112},"interface",{"type":69,"tag":110,"props":4114,"children":4116},{"style":4115},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[4117],{"type":82,"value":4118}," VMEvent",{"type":69,"tag":110,"props":4120,"children":4121},{"style":123},[4122],{"type":82,"value":709},{"type":69,"tag":110,"props":4124,"children":4125},{"class":112,"line":285},[4126,4131,4135],{"type":69,"tag":110,"props":4127,"children":4128},{"style":419},[4129],{"type":82,"value":4130},"  id",{"type":69,"tag":110,"props":4132,"children":4133},{"style":123},[4134],{"type":82,"value":427},{"type":69,"tag":110,"props":4136,"children":4137},{"style":4115},[4138],{"type":82,"value":4139}," string\n",{"type":69,"tag":110,"props":4141,"children":4142},{"class":112,"line":322},[4143,4148,4152],{"type":69,"tag":110,"props":4144,"children":4145},{"style":419},[4146],{"type":82,"value":4147},"  eventType",{"type":69,"tag":110,"props":4149,"children":4150},{"style":123},[4151],{"type":82,"value":427},{"type":69,"tag":110,"props":4153,"children":4154},{"style":4115},[4155],{"type":82,"value":4139},{"type":69,"tag":110,"props":4157,"children":4158},{"class":112,"line":360},[4159,4164,4168],{"type":69,"tag":110,"props":4160,"children":4161},{"style":419},[4162],{"type":82,"value":4163},"  data",{"type":69,"tag":110,"props":4165,"children":4166},{"style":123},[4167],{"type":82,"value":427},{"type":69,"tag":110,"props":4169,"children":4170},{"style":4115},[4171],{"type":82,"value":4172}," unknown\n",{"type":69,"tag":110,"props":4174,"children":4175},{"class":112,"line":370},[4176,4181,4185],{"type":69,"tag":110,"props":4177,"children":4178},{"style":419},[4179],{"type":82,"value":4180},"  timestamp",{"type":69,"tag":110,"props":4182,"children":4183},{"style":123},[4184],{"type":82,"value":427},{"type":69,"tag":110,"props":4186,"children":4187},{"style":4115},[4188],{"type":82,"value":4189}," number\n",{"type":69,"tag":110,"props":4191,"children":4192},{"class":112,"line":380},[4193],{"type":69,"tag":110,"props":4194,"children":4195},{"style":123},[4196],{"type":82,"value":4197},"}\n",{"type":69,"tag":110,"props":4199,"children":4200},{"class":112,"line":415},[4201],{"type":69,"tag":110,"props":4202,"children":4203},{"emptyLinePlaceholder":364},[4204],{"type":82,"value":367},{"type":69,"tag":110,"props":4206,"children":4207},{"class":112,"line":449},[4208,4213,4218,4223,4227],{"type":69,"tag":110,"props":4209,"children":4210},{"style":117},[4211],{"type":82,"value":4212},"export",{"type":69,"tag":110,"props":4214,"children":4215},{"style":384},[4216],{"type":82,"value":4217}," function",{"type":69,"tag":110,"props":4219,"children":4220},{"style":400},[4221],{"type":82,"value":4222}," CodeModeChat",{"type":69,"tag":110,"props":4224,"children":4225},{"style":123},[4226],{"type":82,"value":613},{"type":69,"tag":110,"props":4228,"children":4229},{"style":123},[4230],{"type":82,"value":709},{"type":69,"tag":110,"props":4232,"children":4233},{"class":112,"line":479},[4234,4238,4242,4247,4251,4256,4261,4265,4269],{"type":69,"tag":110,"props":4235,"children":4236},{"style":384},[4237],{"type":82,"value":718},{"type":69,"tag":110,"props":4239,"children":4240},{"style":123},[4241],{"type":82,"value":1516},{"type":69,"tag":110,"props":4243,"children":4244},{"style":129},[4245],{"type":82,"value":4246},"toolCallEvents",{"type":69,"tag":110,"props":4248,"children":4249},{"style":123},[4250],{"type":82,"value":137},{"type":69,"tag":110,"props":4252,"children":4253},{"style":129},[4254],{"type":82,"value":4255}," setToolCallEvents",{"type":69,"tag":110,"props":4257,"children":4258},{"style":123},[4259],{"type":82,"value":4260},"]",{"type":69,"tag":110,"props":4262,"children":4263},{"style":123},[4264],{"type":82,"value":728},{"type":69,"tag":110,"props":4266,"children":4267},{"style":129},[4268],{"type":82,"value":4031},{"type":69,"tag":110,"props":4270,"children":4271},{"style":123},[4272],{"type":82,"value":4273},"\u003C\n",{"type":69,"tag":110,"props":4275,"children":4276},{"class":112,"line":556},[4277,4282,4287,4291,4295,4300,4304,4309],{"type":69,"tag":110,"props":4278,"children":4279},{"style":129},[4280],{"type":82,"value":4281},"    Map",{"type":69,"tag":110,"props":4283,"children":4284},{"style":123},[4285],{"type":82,"value":4286},"\u003C",{"type":69,"tag":110,"props":4288,"children":4289},{"style":129},[4290],{"type":82,"value":534},{"type":69,"tag":110,"props":4292,"children":4293},{"style":123},[4294],{"type":82,"value":137},{"type":69,"tag":110,"props":4296,"children":4297},{"style":129},[4298],{"type":82,"value":4299}," Array",{"type":69,"tag":110,"props":4301,"children":4302},{"style":123},[4303],{"type":82,"value":4286},{"type":69,"tag":110,"props":4305,"children":4306},{"style":129},[4307],{"type":82,"value":4308},"VMEvent",{"type":69,"tag":110,"props":4310,"children":4311},{"style":123},[4312],{"type":82,"value":4313},">>\n",{"type":69,"tag":110,"props":4315,"children":4316},{"class":112,"line":657},[4317,4322,4326,4331,4336],{"type":69,"tag":110,"props":4318,"children":4319},{"style":123},[4320],{"type":82,"value":4321},"  >",{"type":69,"tag":110,"props":4323,"children":4324},{"style":419},[4325],{"type":82,"value":407},{"type":69,"tag":110,"props":4327,"children":4328},{"style":123},[4329],{"type":82,"value":4330},"new",{"type":69,"tag":110,"props":4332,"children":4333},{"style":400},[4334],{"type":82,"value":4335}," Map",{"type":69,"tag":110,"props":4337,"children":4338},{"style":419},[4339],{"type":82,"value":4340},"())\n",{"type":69,"tag":110,"props":4342,"children":4343},{"class":112,"line":712},[4344,4348,4353,4357,4361,4365,4370],{"type":69,"tag":110,"props":4345,"children":4346},{"style":384},[4347],{"type":82,"value":718},{"type":69,"tag":110,"props":4349,"children":4350},{"style":129},[4351],{"type":82,"value":4352}," eventIdCounter",{"type":69,"tag":110,"props":4354,"children":4355},{"style":123},[4356],{"type":82,"value":728},{"type":69,"tag":110,"props":4358,"children":4359},{"style":400},[4360],{"type":82,"value":4022},{"type":69,"tag":110,"props":4362,"children":4363},{"style":419},[4364],{"type":82,"value":407},{"type":69,"tag":110,"props":4366,"children":4367},{"style":898},[4368],{"type":82,"value":4369},"0",{"type":69,"tag":110,"props":4371,"children":4372},{"style":419},[4373],{"type":82,"value":772},{"type":69,"tag":110,"props":4375,"children":4376},{"class":112,"line":775},[4377],{"type":69,"tag":110,"props":4378,"children":4379},{"emptyLinePlaceholder":364},[4380],{"type":82,"value":367},{"type":69,"tag":110,"props":4382,"children":4383},{"class":112,"line":802},[4384,4388,4393,4397,4401],{"type":69,"tag":110,"props":4385,"children":4386},{"style":384},[4387],{"type":82,"value":718},{"type":69,"tag":110,"props":4389,"children":4390},{"style":129},[4391],{"type":82,"value":4392}," handleCustomEvent",{"type":69,"tag":110,"props":4394,"children":4395},{"style":123},[4396],{"type":82,"value":728},{"type":69,"tag":110,"props":4398,"children":4399},{"style":400},[4400],{"type":82,"value":4013},{"type":69,"tag":110,"props":4402,"children":4403},{"style":419},[4404],{"type":82,"value":4405},"(\n",{"type":69,"tag":110,"props":4407,"children":4408},{"class":112,"line":814},[4409],{"type":69,"tag":110,"props":4410,"children":4411},{"style":419},[4412],{"type":82,"value":4413},"    (\n",{"type":69,"tag":110,"props":4415,"children":4416},{"class":112,"line":822},[4417,4422,4427,4431],{"type":69,"tag":110,"props":4418,"children":4419},{"style":129},[4420],{"type":82,"value":4421},"      eventType",{"type":69,"tag":110,"props":4423,"children":4424},{"style":419},[4425],{"type":82,"value":4426},": ",{"type":69,"tag":110,"props":4428,"children":4429},{"style":129},[4430],{"type":82,"value":534},{"type":69,"tag":110,"props":4432,"children":4433},{"style":123},[4434],{"type":82,"value":446},{"type":69,"tag":110,"props":4436,"children":4437},{"class":112,"line":831},[4438,4443,4447,4452],{"type":69,"tag":110,"props":4439,"children":4440},{"style":129},[4441],{"type":82,"value":4442},"      data",{"type":69,"tag":110,"props":4444,"children":4445},{"style":419},[4446],{"type":82,"value":4426},{"type":69,"tag":110,"props":4448,"children":4449},{"style":129},[4450],{"type":82,"value":4451},"unknown",{"type":69,"tag":110,"props":4453,"children":4454},{"style":123},[4455],{"type":82,"value":446},{"type":69,"tag":110,"props":4457,"children":4458},{"class":112,"line":860},[4459,4464,4468,4472,4477,4481,4486],{"type":69,"tag":110,"props":4460,"children":4461},{"style":129},[4462],{"type":82,"value":4463},"      context",{"type":69,"tag":110,"props":4465,"children":4466},{"style":419},[4467],{"type":82,"value":4426},{"type":69,"tag":110,"props":4469,"children":4470},{"style":123},[4471],{"type":82,"value":512},{"type":69,"tag":110,"props":4473,"children":4474},{"style":419},[4475],{"type":82,"value":4476}," toolCallId?",{"type":69,"tag":110,"props":4478,"children":4479},{"style":123},[4480],{"type":82,"value":427},{"type":69,"tag":110,"props":4482,"children":4483},{"style":129},[4484],{"type":82,"value":4485}," string",{"type":69,"tag":110,"props":4487,"children":4488},{"style":123},[4489],{"type":82,"value":3496},{"type":69,"tag":110,"props":4491,"children":4492},{"class":112,"line":885},[4493,4498,4503],{"type":69,"tag":110,"props":4494,"children":4495},{"style":419},[4496],{"type":82,"value":4497},"    ) ",{"type":69,"tag":110,"props":4499,"children":4500},{"style":384},[4501],{"type":82,"value":4502},"=>",{"type":69,"tag":110,"props":4504,"children":4505},{"style":123},[4506],{"type":82,"value":709},{"type":69,"tag":110,"props":4508,"children":4509},{"class":112,"line":908},[4510,4515,4519,4524,4528,4532],{"type":69,"tag":110,"props":4511,"children":4512},{"style":384},[4513],{"type":82,"value":4514},"      const",{"type":69,"tag":110,"props":4516,"children":4517},{"style":123},[4518],{"type":82,"value":126},{"type":69,"tag":110,"props":4520,"children":4521},{"style":129},[4522],{"type":82,"value":4523}," toolCallId",{"type":69,"tag":110,"props":4525,"children":4526},{"style":123},[4527],{"type":82,"value":147},{"type":69,"tag":110,"props":4529,"children":4530},{"style":123},[4531],{"type":82,"value":728},{"type":69,"tag":110,"props":4533,"children":4534},{"style":129},[4535],{"type":82,"value":4536}," context\n",{"type":69,"tag":110,"props":4538,"children":4539},{"class":112,"line":930},[4540,4545,4549,4554,4559,4564],{"type":69,"tag":110,"props":4541,"children":4542},{"style":117},[4543],{"type":82,"value":4544},"      if",{"type":69,"tag":110,"props":4546,"children":4547},{"style":419},[4548],{"type":82,"value":1647},{"type":69,"tag":110,"props":4550,"children":4551},{"style":123},[4552],{"type":82,"value":4553},"!",{"type":69,"tag":110,"props":4555,"children":4556},{"style":129},[4557],{"type":82,"value":4558},"toolCallId",{"type":69,"tag":110,"props":4560,"children":4561},{"style":419},[4562],{"type":82,"value":4563},") ",{"type":69,"tag":110,"props":4565,"children":4566},{"style":117},[4567],{"type":82,"value":4568},"return\n",{"type":69,"tag":110,"props":4570,"children":4571},{"class":112,"line":947},[4572],{"type":69,"tag":110,"props":4573,"children":4574},{"emptyLinePlaceholder":364},[4575],{"type":82,"value":367},{"type":69,"tag":110,"props":4577,"children":4578},{"class":112,"line":969},[4579,4583,4588,4592,4596,4600],{"type":69,"tag":110,"props":4580,"children":4581},{"style":384},[4582],{"type":82,"value":4514},{"type":69,"tag":110,"props":4584,"children":4585},{"style":129},[4586],{"type":82,"value":4587}," event",{"type":69,"tag":110,"props":4589,"children":4590},{"style":123},[4591],{"type":82,"value":427},{"type":69,"tag":110,"props":4593,"children":4594},{"style":4115},[4595],{"type":82,"value":4118},{"type":69,"tag":110,"props":4597,"children":4598},{"style":123},[4599],{"type":82,"value":728},{"type":69,"tag":110,"props":4601,"children":4602},{"style":123},[4603],{"type":82,"value":709},{"type":69,"tag":110,"props":4605,"children":4606},{"class":112,"line":981},[4607,4612,4616,4621,4626,4630,4635,4639,4644,4649,4653],{"type":69,"tag":110,"props":4608,"children":4609},{"style":419},[4610],{"type":82,"value":4611},"        id",{"type":69,"tag":110,"props":4613,"children":4614},{"style":123},[4615],{"type":82,"value":427},{"type":69,"tag":110,"props":4617,"children":4618},{"style":123},[4619],{"type":82,"value":4620}," `",{"type":69,"tag":110,"props":4622,"children":4623},{"style":160},[4624],{"type":82,"value":4625},"event-",{"type":69,"tag":110,"props":4627,"children":4628},{"style":123},[4629],{"type":82,"value":757},{"type":69,"tag":110,"props":4631,"children":4632},{"style":129},[4633],{"type":82,"value":4634},"eventIdCounter",{"type":69,"tag":110,"props":4636,"children":4637},{"style":123},[4638],{"type":82,"value":498},{"type":69,"tag":110,"props":4640,"children":4641},{"style":129},[4642],{"type":82,"value":4643},"current",{"type":69,"tag":110,"props":4645,"children":4646},{"style":123},[4647],{"type":82,"value":4648},"++",{"type":69,"tag":110,"props":4650,"children":4651},{"style":123},[4652],{"type":82,"value":767},{"type":69,"tag":110,"props":4654,"children":4655},{"style":123},[4656],{"type":82,"value":446},{"type":69,"tag":110,"props":4658,"children":4659},{"class":112,"line":989},[4660,4665],{"type":69,"tag":110,"props":4661,"children":4662},{"style":129},[4663],{"type":82,"value":4664},"        eventType",{"type":69,"tag":110,"props":4666,"children":4667},{"style":123},[4668],{"type":82,"value":446},{"type":69,"tag":110,"props":4670,"children":4671},{"class":112,"line":998},[4672,4677],{"type":69,"tag":110,"props":4673,"children":4674},{"style":129},[4675],{"type":82,"value":4676},"        data",{"type":69,"tag":110,"props":4678,"children":4679},{"style":123},[4680],{"type":82,"value":446},{"type":69,"tag":110,"props":4682,"children":4683},{"class":112,"line":1027},[4684,4689,4693,4698,4702,4707,4711],{"type":69,"tag":110,"props":4685,"children":4686},{"style":419},[4687],{"type":82,"value":4688},"        timestamp",{"type":69,"tag":110,"props":4690,"children":4691},{"style":123},[4692],{"type":82,"value":427},{"type":69,"tag":110,"props":4694,"children":4695},{"style":129},[4696],{"type":82,"value":4697}," Date",{"type":69,"tag":110,"props":4699,"children":4700},{"style":123},[4701],{"type":82,"value":498},{"type":69,"tag":110,"props":4703,"children":4704},{"style":400},[4705],{"type":82,"value":4706},"now",{"type":69,"tag":110,"props":4708,"children":4709},{"style":419},[4710],{"type":82,"value":613},{"type":69,"tag":110,"props":4712,"children":4713},{"style":123},[4714],{"type":82,"value":446},{"type":69,"tag":110,"props":4716,"children":4717},{"class":112,"line":1069},[4718],{"type":69,"tag":110,"props":4719,"children":4720},{"style":123},[4721],{"type":82,"value":4722},"      }\n",{"type":69,"tag":110,"props":4724,"children":4725},{"class":112,"line":1082},[4726],{"type":69,"tag":110,"props":4727,"children":4728},{"emptyLinePlaceholder":364},[4729],{"type":82,"value":367},{"type":69,"tag":110,"props":4731,"children":4732},{"class":112,"line":1103},[4733,4738,4742,4746,4751,4755,4759],{"type":69,"tag":110,"props":4734,"children":4735},{"style":400},[4736],{"type":82,"value":4737},"      setToolCallEvents",{"type":69,"tag":110,"props":4739,"children":4740},{"style":419},[4741],{"type":82,"value":407},{"type":69,"tag":110,"props":4743,"children":4744},{"style":123},[4745],{"type":82,"value":407},{"type":69,"tag":110,"props":4747,"children":4748},{"style":692},[4749],{"type":82,"value":4750},"prev",{"type":69,"tag":110,"props":4752,"children":4753},{"style":123},[4754],{"type":82,"value":549},{"type":69,"tag":110,"props":4756,"children":4757},{"style":384},[4758],{"type":82,"value":704},{"type":69,"tag":110,"props":4760,"children":4761},{"style":123},[4762],{"type":82,"value":709},{"type":69,"tag":110,"props":4764,"children":4765},{"class":112,"line":1115},[4766,4771,4776,4780,4785,4789,4793,4797],{"type":69,"tag":110,"props":4767,"children":4768},{"style":384},[4769],{"type":82,"value":4770},"        const",{"type":69,"tag":110,"props":4772,"children":4773},{"style":129},[4774],{"type":82,"value":4775}," next",{"type":69,"tag":110,"props":4777,"children":4778},{"style":123},[4779],{"type":82,"value":728},{"type":69,"tag":110,"props":4781,"children":4782},{"style":123},[4783],{"type":82,"value":4784}," new",{"type":69,"tag":110,"props":4786,"children":4787},{"style":400},[4788],{"type":82,"value":4335},{"type":69,"tag":110,"props":4790,"children":4791},{"style":419},[4792],{"type":82,"value":407},{"type":69,"tag":110,"props":4794,"children":4795},{"style":129},[4796],{"type":82,"value":4750},{"type":69,"tag":110,"props":4798,"children":4799},{"style":419},[4800],{"type":82,"value":772},{"type":69,"tag":110,"props":4802,"children":4803},{"class":112,"line":1123},[4804,4808,4813,4817,4821,4825,4830,4834,4838,4842,4847],{"type":69,"tag":110,"props":4805,"children":4806},{"style":384},[4807],{"type":82,"value":4770},{"type":69,"tag":110,"props":4809,"children":4810},{"style":129},[4811],{"type":82,"value":4812}," events",{"type":69,"tag":110,"props":4814,"children":4815},{"style":123},[4816],{"type":82,"value":728},{"type":69,"tag":110,"props":4818,"children":4819},{"style":129},[4820],{"type":82,"value":4775},{"type":69,"tag":110,"props":4822,"children":4823},{"style":123},[4824],{"type":82,"value":498},{"type":69,"tag":110,"props":4826,"children":4827},{"style":400},[4828],{"type":82,"value":4829},"get",{"type":69,"tag":110,"props":4831,"children":4832},{"style":419},[4833],{"type":82,"value":407},{"type":69,"tag":110,"props":4835,"children":4836},{"style":129},[4837],{"type":82,"value":4558},{"type":69,"tag":110,"props":4839,"children":4840},{"style":419},[4841],{"type":82,"value":4563},{"type":69,"tag":110,"props":4843,"children":4844},{"style":123},[4845],{"type":82,"value":4846},"||",{"type":69,"tag":110,"props":4848,"children":4849},{"style":419},[4850],{"type":82,"value":4851}," []\n",{"type":69,"tag":110,"props":4853,"children":4854},{"class":112,"line":3003},[4855,4860,4864,4869,4873,4877,4881,4885,4890,4895,4899,4903],{"type":69,"tag":110,"props":4856,"children":4857},{"style":129},[4858],{"type":82,"value":4859},"        next",{"type":69,"tag":110,"props":4861,"children":4862},{"style":123},[4863],{"type":82,"value":498},{"type":69,"tag":110,"props":4865,"children":4866},{"style":400},[4867],{"type":82,"value":4868},"set",{"type":69,"tag":110,"props":4870,"children":4871},{"style":419},[4872],{"type":82,"value":407},{"type":69,"tag":110,"props":4874,"children":4875},{"style":129},[4876],{"type":82,"value":4558},{"type":69,"tag":110,"props":4878,"children":4879},{"style":123},[4880],{"type":82,"value":137},{"type":69,"tag":110,"props":4882,"children":4883},{"style":419},[4884],{"type":82,"value":1516},{"type":69,"tag":110,"props":4886,"children":4887},{"style":123},[4888],{"type":82,"value":4889},"...",{"type":69,"tag":110,"props":4891,"children":4892},{"style":129},[4893],{"type":82,"value":4894},"events",{"type":69,"tag":110,"props":4896,"children":4897},{"style":123},[4898],{"type":82,"value":137},{"type":69,"tag":110,"props":4900,"children":4901},{"style":129},[4902],{"type":82,"value":4587},{"type":69,"tag":110,"props":4904,"children":4905},{"style":419},[4906],{"type":82,"value":4907},"])\n",{"type":69,"tag":110,"props":4909,"children":4910},{"class":112,"line":3050},[4911,4916],{"type":69,"tag":110,"props":4912,"children":4913},{"style":117},[4914],{"type":82,"value":4915},"        return",{"type":69,"tag":110,"props":4917,"children":4918},{"style":129},[4919],{"type":82,"value":4920}," next\n",{"type":69,"tag":110,"props":4922,"children":4923},{"class":112,"line":3067},[4924,4929],{"type":69,"tag":110,"props":4925,"children":4926},{"style":123},[4927],{"type":82,"value":4928},"      }",{"type":69,"tag":110,"props":4930,"children":4931},{"style":419},[4932],{"type":82,"value":772},{"type":69,"tag":110,"props":4934,"children":4935},{"class":112,"line":3080},[4936],{"type":69,"tag":110,"props":4937,"children":4938},{"style":123},[4939],{"type":82,"value":3000},{"type":69,"tag":110,"props":4941,"children":4942},{"class":112,"line":3102},[4943,4948],{"type":69,"tag":110,"props":4944,"children":4945},{"style":419},[4946],{"type":82,"value":4947},"    []",{"type":69,"tag":110,"props":4949,"children":4950},{"style":123},[4951],{"type":82,"value":446},{"type":69,"tag":110,"props":4953,"children":4954},{"class":112,"line":3110},[4955],{"type":69,"tag":110,"props":4956,"children":4957},{"style":419},[4958],{"type":82,"value":4959},"  )\n",{"type":69,"tag":110,"props":4961,"children":4962},{"class":112,"line":3123},[4963],{"type":69,"tag":110,"props":4964,"children":4965},{"emptyLinePlaceholder":364},[4966],{"type":82,"value":367},{"type":69,"tag":110,"props":4968,"children":4969},{"class":112,"line":3135},[4970,4974,4978,4983,4987,4992,4996,5001,5005,5009,5013,5017],{"type":69,"tag":110,"props":4971,"children":4972},{"style":384},[4973],{"type":82,"value":718},{"type":69,"tag":110,"props":4975,"children":4976},{"style":123},[4977],{"type":82,"value":126},{"type":69,"tag":110,"props":4979,"children":4980},{"style":129},[4981],{"type":82,"value":4982}," messages",{"type":69,"tag":110,"props":4984,"children":4985},{"style":123},[4986],{"type":82,"value":137},{"type":69,"tag":110,"props":4988,"children":4989},{"style":129},[4990],{"type":82,"value":4991}," sendMessage",{"type":69,"tag":110,"props":4993,"children":4994},{"style":123},[4995],{"type":82,"value":137},{"type":69,"tag":110,"props":4997,"children":4998},{"style":129},[4999],{"type":82,"value":5000}," isLoading",{"type":69,"tag":110,"props":5002,"children":5003},{"style":123},[5004],{"type":82,"value":147},{"type":69,"tag":110,"props":5006,"children":5007},{"style":123},[5008],{"type":82,"value":728},{"type":69,"tag":110,"props":5010,"children":5011},{"style":400},[5012],{"type":82,"value":4067},{"type":69,"tag":110,"props":5014,"children":5015},{"style":419},[5016],{"type":82,"value":407},{"type":69,"tag":110,"props":5018,"children":5019},{"style":123},[5020],{"type":82,"value":412},{"type":69,"tag":110,"props":5022,"children":5023},{"class":112,"line":3143},[5024,5029,5033,5037,5041,5045,5050,5054,5058],{"type":69,"tag":110,"props":5025,"children":5026},{"style":419},[5027],{"type":82,"value":5028},"    connection",{"type":69,"tag":110,"props":5030,"children":5031},{"style":123},[5032],{"type":82,"value":427},{"type":69,"tag":110,"props":5034,"children":5035},{"style":400},[5036],{"type":82,"value":4076},{"type":69,"tag":110,"props":5038,"children":5039},{"style":419},[5040],{"type":82,"value":407},{"type":69,"tag":110,"props":5042,"children":5043},{"style":123},[5044],{"type":82,"value":441},{"type":69,"tag":110,"props":5046,"children":5047},{"style":160},[5048],{"type":82,"value":5049},"\u002Fapi\u002Fchat",{"type":69,"tag":110,"props":5051,"children":5052},{"style":123},[5053],{"type":82,"value":441},{"type":69,"tag":110,"props":5055,"children":5056},{"style":419},[5057],{"type":82,"value":549},{"type":69,"tag":110,"props":5059,"children":5060},{"style":123},[5061],{"type":82,"value":446},{"type":69,"tag":110,"props":5063,"children":5064},{"class":112,"line":3171},[5065,5070,5074,5078],{"type":69,"tag":110,"props":5066,"children":5067},{"style":419},[5068],{"type":82,"value":5069},"    onCustomEvent",{"type":69,"tag":110,"props":5071,"children":5072},{"style":123},[5073],{"type":82,"value":427},{"type":69,"tag":110,"props":5075,"children":5076},{"style":129},[5077],{"type":82,"value":4392},{"type":69,"tag":110,"props":5079,"children":5080},{"style":123},[5081],{"type":82,"value":446},{"type":69,"tag":110,"props":5083,"children":5084},{"class":112,"line":3211},[5085,5089],{"type":69,"tag":110,"props":5086,"children":5087},{"style":123},[5088],{"type":82,"value":936},{"type":69,"tag":110,"props":5090,"children":5091},{"style":419},[5092],{"type":82,"value":772},{"type":69,"tag":110,"props":5094,"children":5095},{"class":112,"line":3244},[5096],{"type":69,"tag":110,"props":5097,"children":5098},{"emptyLinePlaceholder":364},[5099],{"type":82,"value":367},{"type":69,"tag":110,"props":5101,"children":5102},{"class":112,"line":3256},[5103,5107],{"type":69,"tag":110,"props":5104,"children":5105},{"style":117},[5106],{"type":82,"value":781},{"type":69,"tag":110,"props":5108,"children":5109},{"style":419},[5110],{"type":82,"value":5111}," (\n",{"type":69,"tag":110,"props":5113,"children":5114},{"class":112,"line":3296},[5115,5120,5125],{"type":69,"tag":110,"props":5116,"children":5117},{"style":419},[5118],{"type":82,"value":5119},"    \u003C",{"type":69,"tag":110,"props":5121,"children":5122},{"style":4115},[5123],{"type":82,"value":5124},"div",{"type":69,"tag":110,"props":5126,"children":5127},{"style":419},[5128],{"type":82,"value":5129},">\n",{"type":69,"tag":110,"props":5131,"children":5132},{"class":112,"line":3330},[5133,5138,5143,5147,5152,5157,5161,5165,5169],{"type":69,"tag":110,"props":5134,"children":5135},{"style":123},[5136],{"type":82,"value":5137},"      {",{"type":69,"tag":110,"props":5139,"children":5140},{"style":692},[5141],{"type":82,"value":5142},"messages",{"type":69,"tag":110,"props":5144,"children":5145},{"style":419},[5146],{"type":82,"value":498},{"type":69,"tag":110,"props":5148,"children":5149},{"style":692},[5150],{"type":82,"value":5151},"map",{"type":69,"tag":110,"props":5153,"children":5154},{"style":419},[5155],{"type":82,"value":5156},"((",{"type":69,"tag":110,"props":5158,"children":5159},{"style":692},[5160],{"type":82,"value":3868},{"type":69,"tag":110,"props":5162,"children":5163},{"style":419},[5164],{"type":82,"value":4563},{"type":69,"tag":110,"props":5166,"children":5167},{"style":123},[5168],{"type":82,"value":4502},{"type":69,"tag":110,"props":5170,"children":5171},{"style":419},[5172],{"type":82,"value":5111},{"type":69,"tag":110,"props":5174,"children":5176},{"class":112,"line":5175},51,[5177,5182,5186,5191,5196,5201,5206],{"type":69,"tag":110,"props":5178,"children":5179},{"style":123},[5180],{"type":82,"value":5181},"        \u003C",{"type":69,"tag":110,"props":5183,"children":5184},{"style":129},[5185],{"type":82,"value":5124},{"type":69,"tag":110,"props":5187,"children":5188},{"style":129},[5189],{"type":82,"value":5190}," key",{"type":69,"tag":110,"props":5192,"children":5193},{"style":123},[5194],{"type":82,"value":5195},"={",{"type":69,"tag":110,"props":5197,"children":5198},{"style":419},[5199],{"type":82,"value":5200},"message.",{"type":69,"tag":110,"props":5202,"children":5203},{"style":129},[5204],{"type":82,"value":5205},"id",{"type":69,"tag":110,"props":5207,"children":5208},{"style":123},[5209],{"type":82,"value":5210},"}>\n",{"type":69,"tag":110,"props":5212,"children":5214},{"class":112,"line":5213},52,[5215,5220,5224,5228,5233,5237,5241,5245,5250,5254,5258],{"type":69,"tag":110,"props":5216,"children":5217},{"style":123},[5218],{"type":82,"value":5219},"          {",{"type":69,"tag":110,"props":5221,"children":5222},{"style":692},[5223],{"type":82,"value":3868},{"type":69,"tag":110,"props":5225,"children":5226},{"style":419},[5227],{"type":82,"value":498},{"type":69,"tag":110,"props":5229,"children":5230},{"style":692},[5231],{"type":82,"value":5232},"parts",{"type":69,"tag":110,"props":5234,"children":5235},{"style":419},[5236],{"type":82,"value":498},{"type":69,"tag":110,"props":5238,"children":5239},{"style":692},[5240],{"type":82,"value":5151},{"type":69,"tag":110,"props":5242,"children":5243},{"style":419},[5244],{"type":82,"value":5156},{"type":69,"tag":110,"props":5246,"children":5247},{"style":692},[5248],{"type":82,"value":5249},"part",{"type":69,"tag":110,"props":5251,"children":5252},{"style":419},[5253],{"type":82,"value":4563},{"type":69,"tag":110,"props":5255,"children":5256},{"style":123},[5257],{"type":82,"value":4502},{"type":69,"tag":110,"props":5259,"children":5260},{"style":123},[5261],{"type":82,"value":709},{"type":69,"tag":110,"props":5263,"children":5265},{"class":112,"line":5264},53,[5266,5271,5275,5280,5284,5288,5292,5296],{"type":69,"tag":110,"props":5267,"children":5268},{"style":419},[5269],{"type":82,"value":5270},"            if ",{"type":69,"tag":110,"props":5272,"children":5273},{"style":123},[5274],{"type":82,"value":407},{"type":69,"tag":110,"props":5276,"children":5277},{"style":419},[5278],{"type":82,"value":5279},"part.type === ",{"type":69,"tag":110,"props":5281,"children":5282},{"style":123},[5283],{"type":82,"value":441},{"type":69,"tag":110,"props":5285,"children":5286},{"style":160},[5287],{"type":82,"value":82},{"type":69,"tag":110,"props":5289,"children":5290},{"style":123},[5291],{"type":82,"value":441},{"type":69,"tag":110,"props":5293,"children":5294},{"style":123},[5295],{"type":82,"value":549},{"type":69,"tag":110,"props":5297,"children":5298},{"style":123},[5299],{"type":82,"value":709},{"type":69,"tag":110,"props":5301,"children":5303},{"class":112,"line":5302},54,[5304,5309,5314,5318,5322,5326,5330,5334,5338,5342,5346,5351,5355,5360,5365,5370,5374],{"type":69,"tag":110,"props":5305,"children":5306},{"style":117},[5307],{"type":82,"value":5308},"              return",{"type":69,"tag":110,"props":5310,"children":5311},{"style":419},[5312],{"type":82,"value":5313}," \u003C",{"type":69,"tag":110,"props":5315,"children":5316},{"style":4115},[5317],{"type":82,"value":74},{"type":69,"tag":110,"props":5319,"children":5320},{"style":4115},[5321],{"type":82,"value":5190},{"type":69,"tag":110,"props":5323,"children":5324},{"style":419},[5325],{"type":82,"value":397},{"type":69,"tag":110,"props":5327,"children":5328},{"style":123},[5329],{"type":82,"value":512},{"type":69,"tag":110,"props":5331,"children":5332},{"style":4115},[5333],{"type":82,"value":5249},{"type":69,"tag":110,"props":5335,"children":5336},{"style":123},[5337],{"type":82,"value":498},{"type":69,"tag":110,"props":5339,"children":5340},{"style":419},[5341],{"type":82,"value":5205},{"type":69,"tag":110,"props":5343,"children":5344},{"style":123},[5345],{"type":82,"value":544},{"type":69,"tag":110,"props":5347,"children":5348},{"style":419},[5349],{"type":82,"value":5350},">",{"type":69,"tag":110,"props":5352,"children":5353},{"style":123},[5354],{"type":82,"value":512},{"type":69,"tag":110,"props":5356,"children":5357},{"style":419},[5358],{"type":82,"value":5359},"part.",{"type":69,"tag":110,"props":5361,"children":5362},{"style":129},[5363],{"type":82,"value":5364},"content",{"type":69,"tag":110,"props":5366,"children":5367},{"style":123},[5368],{"type":82,"value":5369},"}\u003C\u002F",{"type":69,"tag":110,"props":5371,"children":5372},{"style":129},[5373],{"type":82,"value":74},{"type":69,"tag":110,"props":5375,"children":5376},{"style":123},[5377],{"type":82,"value":5129},{"type":69,"tag":110,"props":5379,"children":5381},{"class":112,"line":5380},55,[5382],{"type":69,"tag":110,"props":5383,"children":5384},{"style":123},[5385],{"type":82,"value":5386},"            }\n",{"type":69,"tag":110,"props":5388,"children":5390},{"class":112,"line":5389},56,[5391,5395],{"type":69,"tag":110,"props":5392,"children":5393},{"style":419},[5394],{"type":82,"value":5270},{"type":69,"tag":110,"props":5396,"children":5397},{"style":123},[5398],{"type":82,"value":4405},{"type":69,"tag":110,"props":5400,"children":5402},{"class":112,"line":5401},57,[5403,5408,5412,5417,5421],{"type":69,"tag":110,"props":5404,"children":5405},{"style":419},[5406],{"type":82,"value":5407},"              part.type === ",{"type":69,"tag":110,"props":5409,"children":5410},{"style":123},[5411],{"type":82,"value":441},{"type":69,"tag":110,"props":5413,"children":5414},{"style":160},[5415],{"type":82,"value":5416},"tool-call",{"type":69,"tag":110,"props":5418,"children":5419},{"style":123},[5420],{"type":82,"value":441},{"type":69,"tag":110,"props":5422,"children":5423},{"style":419},[5424],{"type":82,"value":5425}," &&\n",{"type":69,"tag":110,"props":5427,"children":5429},{"class":112,"line":5428},58,[5430,5435,5439,5443],{"type":69,"tag":110,"props":5431,"children":5432},{"style":419},[5433],{"type":82,"value":5434},"              part.name === ",{"type":69,"tag":110,"props":5436,"children":5437},{"style":123},[5438],{"type":82,"value":441},{"type":69,"tag":110,"props":5440,"children":5441},{"style":160},[5442],{"type":82,"value":3350},{"type":69,"tag":110,"props":5444,"children":5445},{"style":123},[5446],{"type":82,"value":168},{"type":69,"tag":110,"props":5448,"children":5450},{"class":112,"line":5449},59,[5451,5456],{"type":69,"tag":110,"props":5452,"children":5453},{"style":123},[5454],{"type":82,"value":5455},"            )",{"type":69,"tag":110,"props":5457,"children":5458},{"style":123},[5459],{"type":82,"value":709},{"type":69,"tag":110,"props":5461,"children":5463},{"class":112,"line":5462},60,[5464,5469,5473,5477,5482,5486,5490,5494,5498,5502,5506,5510,5514],{"type":69,"tag":110,"props":5465,"children":5466},{"style":384},[5467],{"type":82,"value":5468},"              const",{"type":69,"tag":110,"props":5470,"children":5471},{"style":129},[5472],{"type":82,"value":4812},{"type":69,"tag":110,"props":5474,"children":5475},{"style":123},[5476],{"type":82,"value":728},{"type":69,"tag":110,"props":5478,"children":5479},{"style":129},[5480],{"type":82,"value":5481}," toolCallEvents",{"type":69,"tag":110,"props":5483,"children":5484},{"style":123},[5485],{"type":82,"value":498},{"type":69,"tag":110,"props":5487,"children":5488},{"style":400},[5489],{"type":82,"value":4829},{"type":69,"tag":110,"props":5491,"children":5492},{"style":419},[5493],{"type":82,"value":407},{"type":69,"tag":110,"props":5495,"children":5496},{"style":129},[5497],{"type":82,"value":5249},{"type":69,"tag":110,"props":5499,"children":5500},{"style":123},[5501],{"type":82,"value":498},{"type":69,"tag":110,"props":5503,"children":5504},{"style":129},[5505],{"type":82,"value":5205},{"type":69,"tag":110,"props":5507,"children":5508},{"style":419},[5509],{"type":82,"value":4563},{"type":69,"tag":110,"props":5511,"children":5512},{"style":123},[5513],{"type":82,"value":4846},{"type":69,"tag":110,"props":5515,"children":5516},{"style":419},[5517],{"type":82,"value":4851},{"type":69,"tag":110,"props":5519,"children":5521},{"class":112,"line":5520},61,[5522,5526],{"type":69,"tag":110,"props":5523,"children":5524},{"style":117},[5525],{"type":82,"value":5308},{"type":69,"tag":110,"props":5527,"children":5528},{"style":419},[5529],{"type":82,"value":5111},{"type":69,"tag":110,"props":5531,"children":5533},{"class":112,"line":5532},62,[5534,5539,5543,5547,5551,5555,5559],{"type":69,"tag":110,"props":5535,"children":5536},{"style":123},[5537],{"type":82,"value":5538},"                \u003C",{"type":69,"tag":110,"props":5540,"children":5541},{"style":129},[5542],{"type":82,"value":5124},{"type":69,"tag":110,"props":5544,"children":5545},{"style":129},[5546],{"type":82,"value":5190},{"type":69,"tag":110,"props":5548,"children":5549},{"style":123},[5550],{"type":82,"value":5195},{"type":69,"tag":110,"props":5552,"children":5553},{"style":419},[5554],{"type":82,"value":5359},{"type":69,"tag":110,"props":5556,"children":5557},{"style":129},[5558],{"type":82,"value":5205},{"type":69,"tag":110,"props":5560,"children":5561},{"style":123},[5562],{"type":82,"value":5210},{"type":69,"tag":110,"props":5564,"children":5566},{"class":112,"line":5565},63,[5567,5572,5576,5580,5584,5589,5594,5598,5602],{"type":69,"tag":110,"props":5568,"children":5569},{"style":419},[5570],{"type":82,"value":5571},"                  \u003C",{"type":69,"tag":110,"props":5573,"children":5574},{"style":4115},[5575],{"type":82,"value":99},{"type":69,"tag":110,"props":5577,"children":5578},{"style":419},[5579],{"type":82,"value":5350},{"type":69,"tag":110,"props":5581,"children":5582},{"style":123},[5583],{"type":82,"value":512},{"type":69,"tag":110,"props":5585,"children":5586},{"style":419},[5587],{"type":82,"value":5588},"JSON.parse(part.arguments)?.",{"type":69,"tag":110,"props":5590,"children":5591},{"style":129},[5592],{"type":82,"value":5593},"typescriptCode",{"type":69,"tag":110,"props":5595,"children":5596},{"style":123},[5597],{"type":82,"value":5369},{"type":69,"tag":110,"props":5599,"children":5600},{"style":129},[5601],{"type":82,"value":99},{"type":69,"tag":110,"props":5603,"children":5604},{"style":123},[5605],{"type":82,"value":5129},{"type":69,"tag":110,"props":5607,"children":5609},{"class":112,"line":5608},64,[5610,5615,5619,5623,5627,5631,5636,5640,5644],{"type":69,"tag":110,"props":5611,"children":5612},{"style":123},[5613],{"type":82,"value":5614},"                  {",{"type":69,"tag":110,"props":5616,"children":5617},{"style":692},[5618],{"type":82,"value":4894},{"type":69,"tag":110,"props":5620,"children":5621},{"style":419},[5622],{"type":82,"value":498},{"type":69,"tag":110,"props":5624,"children":5625},{"style":692},[5626],{"type":82,"value":5151},{"type":69,"tag":110,"props":5628,"children":5629},{"style":419},[5630],{"type":82,"value":5156},{"type":69,"tag":110,"props":5632,"children":5633},{"style":692},[5634],{"type":82,"value":5635},"evt",{"type":69,"tag":110,"props":5637,"children":5638},{"style":419},[5639],{"type":82,"value":4563},{"type":69,"tag":110,"props":5641,"children":5642},{"style":123},[5643],{"type":82,"value":4502},{"type":69,"tag":110,"props":5645,"children":5646},{"style":419},[5647],{"type":82,"value":5111},{"type":69,"tag":110,"props":5649,"children":5651},{"class":112,"line":5650},65,[5652,5657,5661,5665,5669,5674,5678],{"type":69,"tag":110,"props":5653,"children":5654},{"style":123},[5655],{"type":82,"value":5656},"                    \u003C",{"type":69,"tag":110,"props":5658,"children":5659},{"style":129},[5660],{"type":82,"value":5124},{"type":69,"tag":110,"props":5662,"children":5663},{"style":129},[5664],{"type":82,"value":5190},{"type":69,"tag":110,"props":5666,"children":5667},{"style":123},[5668],{"type":82,"value":5195},{"type":69,"tag":110,"props":5670,"children":5671},{"style":419},[5672],{"type":82,"value":5673},"evt.",{"type":69,"tag":110,"props":5675,"children":5676},{"style":129},[5677],{"type":82,"value":5205},{"type":69,"tag":110,"props":5679,"children":5680},{"style":123},[5681],{"type":82,"value":5210},{"type":69,"tag":110,"props":5683,"children":5685},{"class":112,"line":5684},66,[5686,5691,5695,5699,5704,5709,5713,5718,5722,5727,5731,5735,5739,5744,5748],{"type":69,"tag":110,"props":5687,"children":5688},{"style":123},[5689],{"type":82,"value":5690},"                      {",{"type":69,"tag":110,"props":5692,"children":5693},{"style":692},[5694],{"type":82,"value":5635},{"type":69,"tag":110,"props":5696,"children":5697},{"style":419},[5698],{"type":82,"value":498},{"type":69,"tag":110,"props":5700,"children":5701},{"style":692},[5702],{"type":82,"value":5703},"eventType",{"type":69,"tag":110,"props":5705,"children":5706},{"style":123},[5707],{"type":82,"value":5708},"}:",{"type":69,"tag":110,"props":5710,"children":5711},{"style":123},[5712],{"type":82,"value":126},{"type":69,"tag":110,"props":5714,"children":5715},{"style":4115},[5716],{"type":82,"value":5717},"JSON",{"type":69,"tag":110,"props":5719,"children":5720},{"style":123},[5721],{"type":82,"value":498},{"type":69,"tag":110,"props":5723,"children":5724},{"style":4115},[5725],{"type":82,"value":5726},"stringify",{"type":69,"tag":110,"props":5728,"children":5729},{"style":419},[5730],{"type":82,"value":407},{"type":69,"tag":110,"props":5732,"children":5733},{"style":4115},[5734],{"type":82,"value":5635},{"type":69,"tag":110,"props":5736,"children":5737},{"style":123},[5738],{"type":82,"value":498},{"type":69,"tag":110,"props":5740,"children":5741},{"style":4115},[5742],{"type":82,"value":5743},"data",{"type":69,"tag":110,"props":5745,"children":5746},{"style":419},[5747],{"type":82,"value":549},{"type":69,"tag":110,"props":5749,"children":5750},{"style":123},[5751],{"type":82,"value":4197},{"type":69,"tag":110,"props":5753,"children":5755},{"class":112,"line":5754},67,[5756,5761,5765],{"type":69,"tag":110,"props":5757,"children":5758},{"style":123},[5759],{"type":82,"value":5760},"                    \u003C\u002F",{"type":69,"tag":110,"props":5762,"children":5763},{"style":129},[5764],{"type":82,"value":5124},{"type":69,"tag":110,"props":5766,"children":5767},{"style":123},[5768],{"type":82,"value":5129},{"type":69,"tag":110,"props":5770,"children":5772},{"class":112,"line":5771},68,[5773,5778],{"type":69,"tag":110,"props":5774,"children":5775},{"style":419},[5776],{"type":82,"value":5777},"                  ))",{"type":69,"tag":110,"props":5779,"children":5780},{"style":123},[5781],{"type":82,"value":4197},{"type":69,"tag":110,"props":5783,"children":5785},{"class":112,"line":5784},69,[5786,5790,5794,5798,5803],{"type":69,"tag":110,"props":5787,"children":5788},{"style":123},[5789],{"type":82,"value":5614},{"type":69,"tag":110,"props":5791,"children":5792},{"style":692},[5793],{"type":82,"value":5249},{"type":69,"tag":110,"props":5795,"children":5796},{"style":419},[5797],{"type":82,"value":498},{"type":69,"tag":110,"props":5799,"children":5800},{"style":692},[5801],{"type":82,"value":5802},"output",{"type":69,"tag":110,"props":5804,"children":5805},{"style":419},[5806],{"type":82,"value":5807}," && (\n",{"type":69,"tag":110,"props":5809,"children":5811},{"class":112,"line":5810},70,[5812,5816,5820,5824,5828,5832,5836,5840,5844,5848,5852,5856,5860,5865,5869,5874,5878,5883,5887],{"type":69,"tag":110,"props":5813,"children":5814},{"style":419},[5815],{"type":82,"value":5656},{"type":69,"tag":110,"props":5817,"children":5818},{"style":692},[5819],{"type":82,"value":99},{"type":69,"tag":110,"props":5821,"children":5822},{"style":419},[5823],{"type":82,"value":5350},{"type":69,"tag":110,"props":5825,"children":5826},{"style":123},[5827],{"type":82,"value":512},{"type":69,"tag":110,"props":5829,"children":5830},{"style":692},[5831],{"type":82,"value":5717},{"type":69,"tag":110,"props":5833,"children":5834},{"style":419},[5835],{"type":82,"value":498},{"type":69,"tag":110,"props":5837,"children":5838},{"style":692},[5839],{"type":82,"value":5726},{"type":69,"tag":110,"props":5841,"children":5842},{"style":419},[5843],{"type":82,"value":407},{"type":69,"tag":110,"props":5845,"children":5846},{"style":692},[5847],{"type":82,"value":5249},{"type":69,"tag":110,"props":5849,"children":5850},{"style":419},[5851],{"type":82,"value":498},{"type":69,"tag":110,"props":5853,"children":5854},{"style":692},[5855],{"type":82,"value":5802},{"type":69,"tag":110,"props":5857,"children":5858},{"style":123},[5859],{"type":82,"value":137},{"type":69,"tag":110,"props":5861,"children":5862},{"style":692},[5863],{"type":82,"value":5864}," null",{"type":69,"tag":110,"props":5866,"children":5867},{"style":123},[5868],{"type":82,"value":137},{"type":69,"tag":110,"props":5870,"children":5871},{"style":419},[5872],{"type":82,"value":5873}," 2)",{"type":69,"tag":110,"props":5875,"children":5876},{"style":123},[5877],{"type":82,"value":544},{"type":69,"tag":110,"props":5879,"children":5880},{"style":419},[5881],{"type":82,"value":5882},"\u003C\u002F",{"type":69,"tag":110,"props":5884,"children":5885},{"style":692},[5886],{"type":82,"value":99},{"type":69,"tag":110,"props":5888,"children":5889},{"style":419},[5890],{"type":82,"value":5129},{"type":69,"tag":110,"props":5892,"children":5894},{"class":112,"line":5893},71,[5895,5900],{"type":69,"tag":110,"props":5896,"children":5897},{"style":419},[5898],{"type":82,"value":5899},"                  )",{"type":69,"tag":110,"props":5901,"children":5902},{"style":123},[5903],{"type":82,"value":4197},{"type":69,"tag":110,"props":5905,"children":5907},{"class":112,"line":5906},72,[5908,5913,5917],{"type":69,"tag":110,"props":5909,"children":5910},{"style":123},[5911],{"type":82,"value":5912},"                \u003C\u002F",{"type":69,"tag":110,"props":5914,"children":5915},{"style":129},[5916],{"type":82,"value":5124},{"type":69,"tag":110,"props":5918,"children":5919},{"style":123},[5920],{"type":82,"value":5129},{"type":69,"tag":110,"props":5922,"children":5924},{"class":112,"line":5923},73,[5925],{"type":69,"tag":110,"props":5926,"children":5927},{"style":419},[5928],{"type":82,"value":5929},"              )\n",{"type":69,"tag":110,"props":5931,"children":5933},{"class":112,"line":5932},74,[5934],{"type":69,"tag":110,"props":5935,"children":5936},{"style":123},[5937],{"type":82,"value":5386},{"type":69,"tag":110,"props":5939,"children":5941},{"class":112,"line":5940},75,[5942,5947],{"type":69,"tag":110,"props":5943,"children":5944},{"style":419},[5945],{"type":82,"value":5946},"            return ",{"type":69,"tag":110,"props":5948,"children":5949},{"style":129},[5950],{"type":82,"value":5951},"null\n",{"type":69,"tag":110,"props":5953,"children":5955},{"class":112,"line":5954},76,[5956,5961,5965],{"type":69,"tag":110,"props":5957,"children":5958},{"style":123},[5959],{"type":82,"value":5960},"          }",{"type":69,"tag":110,"props":5962,"children":5963},{"style":419},[5964],{"type":82,"value":549},{"type":69,"tag":110,"props":5966,"children":5967},{"style":123},[5968],{"type":82,"value":4197},{"type":69,"tag":110,"props":5970,"children":5972},{"class":112,"line":5971},77,[5973,5978,5982],{"type":69,"tag":110,"props":5974,"children":5975},{"style":123},[5976],{"type":82,"value":5977},"        \u003C\u002F",{"type":69,"tag":110,"props":5979,"children":5980},{"style":129},[5981],{"type":82,"value":5124},{"type":69,"tag":110,"props":5983,"children":5984},{"style":123},[5985],{"type":82,"value":5129},{"type":69,"tag":110,"props":5987,"children":5989},{"class":112,"line":5988},78,[5990,5995],{"type":69,"tag":110,"props":5991,"children":5992},{"style":419},[5993],{"type":82,"value":5994},"      ))",{"type":69,"tag":110,"props":5996,"children":5997},{"style":123},[5998],{"type":82,"value":4197},{"type":69,"tag":110,"props":6000,"children":6002},{"class":112,"line":6001},79,[6003,6008,6012],{"type":69,"tag":110,"props":6004,"children":6005},{"style":123},[6006],{"type":82,"value":6007},"    \u003C\u002F",{"type":69,"tag":110,"props":6009,"children":6010},{"style":129},[6011],{"type":82,"value":5124},{"type":69,"tag":110,"props":6013,"children":6014},{"style":123},[6015],{"type":82,"value":5129},{"type":69,"tag":110,"props":6017,"children":6019},{"class":112,"line":6018},80,[6020],{"type":69,"tag":110,"props":6021,"children":6022},{"style":419},[6023],{"type":82,"value":4959},{"type":69,"tag":110,"props":6025,"children":6027},{"class":112,"line":6026},81,[6028],{"type":69,"tag":110,"props":6029,"children":6030},{"style":123},[6031],{"type":82,"value":4197},{"type":69,"tag":74,"props":6033,"children":6034},{},[6035,6037,6042,6044,6049,6050,6056,6057,6063,6064,6070],{"type":82,"value":6036},"The ",{"type":69,"tag":106,"props":6038,"children":6040},{"className":6039},[],[6041],{"type":82,"value":3769},{"type":82,"value":6043}," callback signature is identical across all framework integrations (",{"type":69,"tag":106,"props":6045,"children":6047},{"className":6046},[],[6048],{"type":82,"value":4093},{"type":82,"value":3352},{"type":69,"tag":106,"props":6051,"children":6053},{"className":6052},[],[6054],{"type":82,"value":6055},"@tanstack\u002Fai-solid",{"type":82,"value":3352},{"type":69,"tag":106,"props":6058,"children":6060},{"className":6059},[],[6061],{"type":82,"value":6062},"@tanstack\u002Fai-vue",{"type":82,"value":3352},{"type":69,"tag":106,"props":6065,"children":6067},{"className":6066},[],[6068],{"type":82,"value":6069},"@tanstack\u002Fai-svelte",{"type":82,"value":6071},"):",{"type":69,"tag":99,"props":6073,"children":6075},{"className":101,"code":6074,"language":14,"meta":103,"style":103},"(eventType: string, data: unknown, context: { toolCallId?: string }) => void\n",[6076],{"type":69,"tag":106,"props":6077,"children":6078},{"__ignoreMap":103},[6079],{"type":69,"tag":110,"props":6080,"children":6081},{"class":112,"line":113},[6082,6086,6090,6094,6098,6102,6107,6111,6116,6120,6125,6129,6133,6137,6142,6146,6150,6154],{"type":69,"tag":110,"props":6083,"children":6084},{"style":123},[6085],{"type":82,"value":407},{"type":69,"tag":110,"props":6087,"children":6088},{"style":692},[6089],{"type":82,"value":5703},{"type":69,"tag":110,"props":6091,"children":6092},{"style":123},[6093],{"type":82,"value":427},{"type":69,"tag":110,"props":6095,"children":6096},{"style":4115},[6097],{"type":82,"value":4485},{"type":69,"tag":110,"props":6099,"children":6100},{"style":123},[6101],{"type":82,"value":137},{"type":69,"tag":110,"props":6103,"children":6104},{"style":692},[6105],{"type":82,"value":6106}," data",{"type":69,"tag":110,"props":6108,"children":6109},{"style":123},[6110],{"type":82,"value":427},{"type":69,"tag":110,"props":6112,"children":6113},{"style":4115},[6114],{"type":82,"value":6115}," unknown",{"type":69,"tag":110,"props":6117,"children":6118},{"style":123},[6119],{"type":82,"value":137},{"type":69,"tag":110,"props":6121,"children":6122},{"style":692},[6123],{"type":82,"value":6124}," context",{"type":69,"tag":110,"props":6126,"children":6127},{"style":123},[6128],{"type":82,"value":427},{"type":69,"tag":110,"props":6130,"children":6131},{"style":123},[6132],{"type":82,"value":126},{"type":69,"tag":110,"props":6134,"children":6135},{"style":419},[6136],{"type":82,"value":4523},{"type":69,"tag":110,"props":6138,"children":6139},{"style":123},[6140],{"type":82,"value":6141},"?:",{"type":69,"tag":110,"props":6143,"children":6144},{"style":4115},[6145],{"type":82,"value":4485},{"type":69,"tag":110,"props":6147,"children":6148},{"style":123},[6149],{"type":82,"value":699},{"type":69,"tag":110,"props":6151,"children":6152},{"style":384},[6153],{"type":82,"value":704},{"type":69,"tag":110,"props":6155,"children":6156},{"style":123},[6157],{"type":82,"value":6158}," void\n",{"type":69,"tag":74,"props":6160,"children":6161},{},[6162,6164,6170],{"type":82,"value":6163},"Skill-specific events (when using ",{"type":69,"tag":106,"props":6165,"children":6167},{"className":6166},[],[6168],{"type":82,"value":6169},"codeModeWithSkills",{"type":82,"value":6071},{"type":69,"tag":2219,"props":6172,"children":6173},{},[6174,6192],{"type":69,"tag":2223,"props":6175,"children":6176},{},[6177],{"type":69,"tag":2227,"props":6178,"children":6179},{},[6180,6184,6188],{"type":69,"tag":2231,"props":6181,"children":6182},{},[6183],{"type":82,"value":3789},{"type":69,"tag":2231,"props":6185,"children":6186},{},[6187],{"type":82,"value":3794},{"type":69,"tag":2231,"props":6189,"children":6190},{},[6191],{"type":82,"value":3799},{"type":69,"tag":2257,"props":6193,"children":6194},{},[6195,6234,6271,6308],{"type":69,"tag":2227,"props":6196,"children":6197},{},[6198,6207,6212],{"type":69,"tag":2264,"props":6199,"children":6200},{},[6201],{"type":69,"tag":106,"props":6202,"children":6204},{"className":6203},[],[6205],{"type":82,"value":6206},"code_mode:skill_call",{"type":69,"tag":2264,"props":6208,"children":6209},{},[6210],{"type":82,"value":6211},"Skill tool invoked",{"type":69,"tag":2264,"props":6213,"children":6214},{},[6215,6221,6222,6228,6229],{"type":69,"tag":106,"props":6216,"children":6218},{"className":6217},[],[6219],{"type":82,"value":6220},"skill",{"type":82,"value":3352},{"type":69,"tag":106,"props":6223,"children":6225},{"className":6224},[],[6226],{"type":82,"value":6227},"input",{"type":82,"value":3352},{"type":69,"tag":106,"props":6230,"children":6232},{"className":6231},[],[6233],{"type":82,"value":3828},{"type":69,"tag":2227,"props":6235,"children":6236},{},[6237,6246,6251],{"type":69,"tag":2264,"props":6238,"children":6239},{},[6240],{"type":69,"tag":106,"props":6241,"children":6243},{"className":6242},[],[6244],{"type":82,"value":6245},"code_mode:skill_result",{"type":69,"tag":2264,"props":6247,"children":6248},{},[6249],{"type":82,"value":6250},"Skill completed",{"type":69,"tag":2264,"props":6252,"children":6253},{},[6254,6259,6260,6265,6266],{"type":69,"tag":106,"props":6255,"children":6257},{"className":6256},[],[6258],{"type":82,"value":6220},{"type":82,"value":3352},{"type":69,"tag":106,"props":6261,"children":6263},{"className":6262},[],[6264],{"type":82,"value":3945},{"type":82,"value":3352},{"type":69,"tag":106,"props":6267,"children":6269},{"className":6268},[],[6270],{"type":82,"value":3952},{"type":69,"tag":2227,"props":6272,"children":6273},{},[6274,6283,6288],{"type":69,"tag":2264,"props":6275,"children":6276},{},[6277],{"type":69,"tag":106,"props":6278,"children":6280},{"className":6279},[],[6281],{"type":82,"value":6282},"code_mode:skill_error",{"type":69,"tag":2264,"props":6284,"children":6285},{},[6286],{"type":82,"value":6287},"Skill failed",{"type":69,"tag":2264,"props":6289,"children":6290},{},[6291,6296,6297,6302,6303],{"type":69,"tag":106,"props":6292,"children":6294},{"className":6293},[],[6295],{"type":82,"value":6220},{"type":82,"value":3352},{"type":69,"tag":106,"props":6298,"children":6300},{"className":6299},[],[6301],{"type":82,"value":3984},{"type":82,"value":3352},{"type":69,"tag":106,"props":6304,"children":6306},{"className":6305},[],[6307],{"type":82,"value":3952},{"type":69,"tag":2227,"props":6309,"children":6310},{},[6311,6320,6325],{"type":69,"tag":2264,"props":6312,"children":6313},{},[6314],{"type":69,"tag":106,"props":6315,"children":6317},{"className":6316},[],[6318],{"type":82,"value":6319},"skill:registered",{"type":69,"tag":2264,"props":6321,"children":6322},{},[6323],{"type":82,"value":6324},"New skill saved",{"type":69,"tag":2264,"props":6326,"children":6327},{},[6328,6333,6334,6340,6341],{"type":69,"tag":106,"props":6329,"children":6331},{"className":6330},[],[6332],{"type":82,"value":5205},{"type":82,"value":3352},{"type":69,"tag":106,"props":6335,"children":6337},{"className":6336},[],[6338],{"type":82,"value":6339},"name",{"type":82,"value":3352},{"type":69,"tag":106,"props":6342,"children":6344},{"className":6343},[],[6345],{"type":82,"value":6346},"description",{"type":69,"tag":1619,"props":6348,"children":6350},{"id":6349},"_4-lazy-tools",[6351],{"type":82,"value":6352},"4. Lazy Tools",{"type":69,"tag":74,"props":6354,"children":6355},{},[6356,6358,6363,6365,6371,6373,6379],{"type":82,"value":6357},"When a large tool catalog would bloat the ",{"type":69,"tag":106,"props":6359,"children":6361},{"className":6360},[],[6362],{"type":82,"value":3350},{"type":82,"value":6364}," system prompt, mark low-priority tools ",{"type":69,"tag":106,"props":6366,"children":6368},{"className":6367},[],[6369],{"type":82,"value":6370},"lazy: true",{"type":82,"value":6372},". Lazy tools are kept out of the full type-stub documentation and listed in a compact \"Discoverable APIs\" catalog instead. All sandbox bindings are always injected — ",{"type":69,"tag":106,"props":6374,"children":6376},{"className":6375},[],[6377],{"type":82,"value":6378},"lazy",{"type":82,"value":6380}," defers documentation, not callability.",{"type":69,"tag":74,"props":6382,"children":6383},{},[6384],{"type":69,"tag":78,"props":6385,"children":6386},{},[6387],{"type":82,"value":6388},"Marking a tool lazy:",{"type":69,"tag":99,"props":6390,"children":6392},{"className":101,"code":6391,"language":14,"meta":103,"style":103},"import { toolDefinition } from '@tanstack\u002Fai'\nimport { z } from 'zod'\n\nconst rarelyUsedTool = toolDefinition({\n  name: 'fetchStocks',\n  description: 'Get stock prices for a ticker. Returns a price quote.',\n  inputSchema: z.object({ ticker: z.string() }),\n  outputSchema: z.object({ price: z.number() }),\n  lazy: true, \u002F\u002F \u003C-- opt out of full system-prompt documentation\n}).server(async ({ ticker }) => {\n  \u002F\u002F ...\n  return { price: 0 }\n})\n",[6393],{"type":69,"tag":106,"props":6394,"children":6395},{"__ignoreMap":103},[6396,6431,6466,6473,6501,6529,6557,6625,6693,6720,6767,6775,6804],{"type":69,"tag":110,"props":6397,"children":6398},{"class":112,"line":113},[6399,6403,6407,6411,6415,6419,6423,6427],{"type":69,"tag":110,"props":6400,"children":6401},{"style":117},[6402],{"type":82,"value":120},{"type":69,"tag":110,"props":6404,"children":6405},{"style":123},[6406],{"type":82,"value":126},{"type":69,"tag":110,"props":6408,"children":6409},{"style":129},[6410],{"type":82,"value":299},{"type":69,"tag":110,"props":6412,"children":6413},{"style":123},[6414],{"type":82,"value":147},{"type":69,"tag":110,"props":6416,"children":6417},{"style":117},[6418],{"type":82,"value":152},{"type":69,"tag":110,"props":6420,"children":6421},{"style":123},[6422],{"type":82,"value":157},{"type":69,"tag":110,"props":6424,"children":6425},{"style":160},[6426],{"type":82,"value":163},{"type":69,"tag":110,"props":6428,"children":6429},{"style":123},[6430],{"type":82,"value":168},{"type":69,"tag":110,"props":6432,"children":6433},{"class":112,"line":171},[6434,6438,6442,6446,6450,6454,6458,6462],{"type":69,"tag":110,"props":6435,"children":6436},{"style":117},[6437],{"type":82,"value":120},{"type":69,"tag":110,"props":6439,"children":6440},{"style":123},[6441],{"type":82,"value":126},{"type":69,"tag":110,"props":6443,"children":6444},{"style":129},[6445],{"type":82,"value":336},{"type":69,"tag":110,"props":6447,"children":6448},{"style":123},[6449],{"type":82,"value":147},{"type":69,"tag":110,"props":6451,"children":6452},{"style":117},[6453],{"type":82,"value":152},{"type":69,"tag":110,"props":6455,"children":6456},{"style":123},[6457],{"type":82,"value":157},{"type":69,"tag":110,"props":6459,"children":6460},{"style":160},[6461],{"type":82,"value":353},{"type":69,"tag":110,"props":6463,"children":6464},{"style":123},[6465],{"type":82,"value":168},{"type":69,"tag":110,"props":6467,"children":6468},{"class":112,"line":209},[6469],{"type":69,"tag":110,"props":6470,"children":6471},{"emptyLinePlaceholder":364},[6472],{"type":82,"value":367},{"type":69,"tag":110,"props":6474,"children":6475},{"class":112,"line":247},[6476,6480,6485,6489,6493,6497],{"type":69,"tag":110,"props":6477,"children":6478},{"style":384},[6479],{"type":82,"value":387},{"type":69,"tag":110,"props":6481,"children":6482},{"style":129},[6483],{"type":82,"value":6484}," rarelyUsedTool ",{"type":69,"tag":110,"props":6486,"children":6487},{"style":123},[6488],{"type":82,"value":397},{"type":69,"tag":110,"props":6490,"children":6491},{"style":400},[6492],{"type":82,"value":299},{"type":69,"tag":110,"props":6494,"children":6495},{"style":129},[6496],{"type":82,"value":407},{"type":69,"tag":110,"props":6498,"children":6499},{"style":123},[6500],{"type":82,"value":412},{"type":69,"tag":110,"props":6502,"children":6503},{"class":112,"line":285},[6504,6508,6512,6516,6521,6525],{"type":69,"tag":110,"props":6505,"children":6506},{"style":419},[6507],{"type":82,"value":422},{"type":69,"tag":110,"props":6509,"children":6510},{"style":123},[6511],{"type":82,"value":427},{"type":69,"tag":110,"props":6513,"children":6514},{"style":123},[6515],{"type":82,"value":157},{"type":69,"tag":110,"props":6517,"children":6518},{"style":160},[6519],{"type":82,"value":6520},"fetchStocks",{"type":69,"tag":110,"props":6522,"children":6523},{"style":123},[6524],{"type":82,"value":441},{"type":69,"tag":110,"props":6526,"children":6527},{"style":123},[6528],{"type":82,"value":446},{"type":69,"tag":110,"props":6530,"children":6531},{"class":112,"line":322},[6532,6536,6540,6544,6549,6553],{"type":69,"tag":110,"props":6533,"children":6534},{"style":419},[6535],{"type":82,"value":455},{"type":69,"tag":110,"props":6537,"children":6538},{"style":123},[6539],{"type":82,"value":427},{"type":69,"tag":110,"props":6541,"children":6542},{"style":123},[6543],{"type":82,"value":157},{"type":69,"tag":110,"props":6545,"children":6546},{"style":160},[6547],{"type":82,"value":6548},"Get stock prices for a ticker. Returns a price quote.",{"type":69,"tag":110,"props":6550,"children":6551},{"style":123},[6552],{"type":82,"value":441},{"type":69,"tag":110,"props":6554,"children":6555},{"style":123},[6556],{"type":82,"value":446},{"type":69,"tag":110,"props":6558,"children":6559},{"class":112,"line":360},[6560,6564,6568,6572,6576,6580,6584,6588,6593,6597,6601,6605,6609,6613,6617,6621],{"type":69,"tag":110,"props":6561,"children":6562},{"style":419},[6563],{"type":82,"value":485},{"type":69,"tag":110,"props":6565,"children":6566},{"style":123},[6567],{"type":82,"value":427},{"type":69,"tag":110,"props":6569,"children":6570},{"style":129},[6571],{"type":82,"value":336},{"type":69,"tag":110,"props":6573,"children":6574},{"style":123},[6575],{"type":82,"value":498},{"type":69,"tag":110,"props":6577,"children":6578},{"style":400},[6579],{"type":82,"value":503},{"type":69,"tag":110,"props":6581,"children":6582},{"style":129},[6583],{"type":82,"value":407},{"type":69,"tag":110,"props":6585,"children":6586},{"style":123},[6587],{"type":82,"value":512},{"type":69,"tag":110,"props":6589,"children":6590},{"style":419},[6591],{"type":82,"value":6592}," ticker",{"type":69,"tag":110,"props":6594,"children":6595},{"style":123},[6596],{"type":82,"value":427},{"type":69,"tag":110,"props":6598,"children":6599},{"style":129},[6600],{"type":82,"value":336},{"type":69,"tag":110,"props":6602,"children":6603},{"style":123},[6604],{"type":82,"value":498},{"type":69,"tag":110,"props":6606,"children":6607},{"style":400},[6608],{"type":82,"value":534},{"type":69,"tag":110,"props":6610,"children":6611},{"style":129},[6612],{"type":82,"value":539},{"type":69,"tag":110,"props":6614,"children":6615},{"style":123},[6616],{"type":82,"value":544},{"type":69,"tag":110,"props":6618,"children":6619},{"style":129},[6620],{"type":82,"value":549},{"type":69,"tag":110,"props":6622,"children":6623},{"style":123},[6624],{"type":82,"value":446},{"type":69,"tag":110,"props":6626,"children":6627},{"class":112,"line":370},[6628,6632,6636,6640,6644,6648,6652,6656,6661,6665,6669,6673,6677,6681,6685,6689],{"type":69,"tag":110,"props":6629,"children":6630},{"style":419},[6631],{"type":82,"value":562},{"type":69,"tag":110,"props":6633,"children":6634},{"style":123},[6635],{"type":82,"value":427},{"type":69,"tag":110,"props":6637,"children":6638},{"style":129},[6639],{"type":82,"value":336},{"type":69,"tag":110,"props":6641,"children":6642},{"style":123},[6643],{"type":82,"value":498},{"type":69,"tag":110,"props":6645,"children":6646},{"style":400},[6647],{"type":82,"value":503},{"type":69,"tag":110,"props":6649,"children":6650},{"style":129},[6651],{"type":82,"value":407},{"type":69,"tag":110,"props":6653,"children":6654},{"style":123},[6655],{"type":82,"value":512},{"type":69,"tag":110,"props":6657,"children":6658},{"style":419},[6659],{"type":82,"value":6660}," price",{"type":69,"tag":110,"props":6662,"children":6663},{"style":123},[6664],{"type":82,"value":427},{"type":69,"tag":110,"props":6666,"children":6667},{"style":129},[6668],{"type":82,"value":336},{"type":69,"tag":110,"props":6670,"children":6671},{"style":123},[6672],{"type":82,"value":498},{"type":69,"tag":110,"props":6674,"children":6675},{"style":400},[6676],{"type":82,"value":608},{"type":69,"tag":110,"props":6678,"children":6679},{"style":129},[6680],{"type":82,"value":539},{"type":69,"tag":110,"props":6682,"children":6683},{"style":123},[6684],{"type":82,"value":544},{"type":69,"tag":110,"props":6686,"children":6687},{"style":129},[6688],{"type":82,"value":549},{"type":69,"tag":110,"props":6690,"children":6691},{"style":123},[6692],{"type":82,"value":446},{"type":69,"tag":110,"props":6694,"children":6695},{"class":112,"line":380},[6696,6701,6705,6711,6715],{"type":69,"tag":110,"props":6697,"children":6698},{"style":419},[6699],{"type":82,"value":6700},"  lazy",{"type":69,"tag":110,"props":6702,"children":6703},{"style":123},[6704],{"type":82,"value":427},{"type":69,"tag":110,"props":6706,"children":6708},{"style":6707},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[6709],{"type":82,"value":6710}," true",{"type":69,"tag":110,"props":6712,"children":6713},{"style":123},[6714],{"type":82,"value":137},{"type":69,"tag":110,"props":6716,"children":6717},{"style":374},[6718],{"type":82,"value":6719}," \u002F\u002F \u003C-- opt out of full system-prompt documentation\n",{"type":69,"tag":110,"props":6721,"children":6722},{"class":112,"line":415},[6723,6727,6731,6735,6739,6743,6747,6751,6755,6759,6763],{"type":69,"tag":110,"props":6724,"children":6725},{"style":123},[6726],{"type":82,"value":544},{"type":69,"tag":110,"props":6728,"children":6729},{"style":129},[6730],{"type":82,"value":549},{"type":69,"tag":110,"props":6732,"children":6733},{"style":123},[6734],{"type":82,"value":498},{"type":69,"tag":110,"props":6736,"children":6737},{"style":400},[6738],{"type":82,"value":675},{"type":69,"tag":110,"props":6740,"children":6741},{"style":129},[6742],{"type":82,"value":407},{"type":69,"tag":110,"props":6744,"children":6745},{"style":384},[6746],{"type":82,"value":684},{"type":69,"tag":110,"props":6748,"children":6749},{"style":123},[6750],{"type":82,"value":689},{"type":69,"tag":110,"props":6752,"children":6753},{"style":692},[6754],{"type":82,"value":6592},{"type":69,"tag":110,"props":6756,"children":6757},{"style":123},[6758],{"type":82,"value":699},{"type":69,"tag":110,"props":6760,"children":6761},{"style":384},[6762],{"type":82,"value":704},{"type":69,"tag":110,"props":6764,"children":6765},{"style":123},[6766],{"type":82,"value":709},{"type":69,"tag":110,"props":6768,"children":6769},{"class":112,"line":449},[6770],{"type":69,"tag":110,"props":6771,"children":6772},{"style":374},[6773],{"type":82,"value":6774},"  \u002F\u002F ...\n",{"type":69,"tag":110,"props":6776,"children":6777},{"class":112,"line":479},[6778,6782,6786,6790,6794,6799],{"type":69,"tag":110,"props":6779,"children":6780},{"style":117},[6781],{"type":82,"value":781},{"type":69,"tag":110,"props":6783,"children":6784},{"style":123},[6785],{"type":82,"value":126},{"type":69,"tag":110,"props":6787,"children":6788},{"style":419},[6789],{"type":82,"value":6660},{"type":69,"tag":110,"props":6791,"children":6792},{"style":123},[6793],{"type":82,"value":427},{"type":69,"tag":110,"props":6795,"children":6796},{"style":898},[6797],{"type":82,"value":6798}," 0",{"type":69,"tag":110,"props":6800,"children":6801},{"style":123},[6802],{"type":82,"value":6803}," }\n",{"type":69,"tag":110,"props":6805,"children":6806},{"class":112,"line":556},[6807,6811],{"type":69,"tag":110,"props":6808,"children":6809},{"style":123},[6810],{"type":82,"value":544},{"type":69,"tag":110,"props":6812,"children":6813},{"style":129},[6814],{"type":82,"value":772},{"type":69,"tag":74,"props":6816,"children":6817},{},[6818],{"type":69,"tag":78,"props":6819,"children":6820},{},[6821,6826],{"type":69,"tag":106,"props":6822,"children":6824},{"className":6823},[],[6825],{"type":82,"value":1593},{"type":82,"value":6827}," return shape:",{"type":69,"tag":74,"props":6829,"children":6830},{},[6831,6836,6838,6844,6846,6852,6854,6860,6862,6868,6870,6876,6878,6884,6886,6892],{"type":69,"tag":106,"props":6832,"children":6834},{"className":6833},[],[6835],{"type":82,"value":1149},{"type":82,"value":6837}," returns ",{"type":69,"tag":106,"props":6839,"children":6841},{"className":6840},[],[6842],{"type":82,"value":6843},"{ tool, discoveryTool, tools, systemPrompt }",{"type":82,"value":6845},". When lazy tools are present ",{"type":69,"tag":106,"props":6847,"children":6849},{"className":6848},[],[6850],{"type":82,"value":6851},"discoveryTool",{"type":82,"value":6853}," is a ",{"type":69,"tag":106,"props":6855,"children":6857},{"className":6856},[],[6858],{"type":82,"value":6859},"discover_tools",{"type":82,"value":6861}," server tool; otherwise it is ",{"type":69,"tag":106,"props":6863,"children":6865},{"className":6864},[],[6866],{"type":82,"value":6867},"null",{"type":82,"value":6869},". Always spread ",{"type":69,"tag":106,"props":6871,"children":6873},{"className":6872},[],[6874],{"type":82,"value":6875},"tools",{"type":82,"value":6877}," (not just ",{"type":69,"tag":106,"props":6879,"children":6881},{"className":6880},[],[6882],{"type":82,"value":6883},"tool",{"type":82,"value":6885},") into ",{"type":69,"tag":106,"props":6887,"children":6889},{"className":6888},[],[6890],{"type":82,"value":6891},"chat()",{"type":82,"value":6893}," so the discovery tool is registered:",{"type":69,"tag":99,"props":6895,"children":6897},{"className":101,"code":6896,"language":14,"meta":103,"style":103},"import { chat } from '@tanstack\u002Fai'\nimport { createCodeMode } from '@tanstack\u002Fai-code-mode'\nimport { createNodeIsolateDriver } from '@tanstack\u002Fai-isolate-node'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\nconst { tools, systemPrompt } = createCodeMode({\n  driver: createNodeIsolateDriver(),\n  tools: [eagerTool, rarelyUsedTool], \u002F\u002F rarelyUsedTool has lazy: true\n})\n\nconst stream = chat({\n  adapter: openaiText('gpt-5.5'),\n  systemPrompts: ['You are a helpful assistant.', systemPrompt],\n  tools: [...tools, ...otherTools], \u002F\u002F spread tools, not just tool\n  messages,\n})\n",[6898],{"type":69,"tag":106,"props":6899,"children":6900},{"__ignoreMap":103},[6901,6936,6971,7006,7041,7048,7092,7115,7149,7160,7167,7194,7234,7273,7319,7330],{"type":69,"tag":110,"props":6902,"children":6903},{"class":112,"line":113},[6904,6908,6912,6916,6920,6924,6928,6932],{"type":69,"tag":110,"props":6905,"children":6906},{"style":117},[6907],{"type":82,"value":120},{"type":69,"tag":110,"props":6909,"children":6910},{"style":123},[6911],{"type":82,"value":126},{"type":69,"tag":110,"props":6913,"children":6914},{"style":129},[6915],{"type":82,"value":132},{"type":69,"tag":110,"props":6917,"children":6918},{"style":123},[6919],{"type":82,"value":147},{"type":69,"tag":110,"props":6921,"children":6922},{"style":117},[6923],{"type":82,"value":152},{"type":69,"tag":110,"props":6925,"children":6926},{"style":123},[6927],{"type":82,"value":157},{"type":69,"tag":110,"props":6929,"children":6930},{"style":160},[6931],{"type":82,"value":163},{"type":69,"tag":110,"props":6933,"children":6934},{"style":123},[6935],{"type":82,"value":168},{"type":69,"tag":110,"props":6937,"children":6938},{"class":112,"line":171},[6939,6943,6947,6951,6955,6959,6963,6967],{"type":69,"tag":110,"props":6940,"children":6941},{"style":117},[6942],{"type":82,"value":120},{"type":69,"tag":110,"props":6944,"children":6945},{"style":123},[6946],{"type":82,"value":126},{"type":69,"tag":110,"props":6948,"children":6949},{"style":129},[6950],{"type":82,"value":1209},{"type":69,"tag":110,"props":6952,"children":6953},{"style":123},[6954],{"type":82,"value":147},{"type":69,"tag":110,"props":6956,"children":6957},{"style":117},[6958],{"type":82,"value":152},{"type":69,"tag":110,"props":6960,"children":6961},{"style":123},[6962],{"type":82,"value":157},{"type":69,"tag":110,"props":6964,"children":6965},{"style":160},[6966],{"type":82,"value":240},{"type":69,"tag":110,"props":6968,"children":6969},{"style":123},[6970],{"type":82,"value":168},{"type":69,"tag":110,"props":6972,"children":6973},{"class":112,"line":209},[6974,6978,6982,6986,6990,6994,6998,7002],{"type":69,"tag":110,"props":6975,"children":6976},{"style":117},[6977],{"type":82,"value":120},{"type":69,"tag":110,"props":6979,"children":6980},{"style":123},[6981],{"type":82,"value":126},{"type":69,"tag":110,"props":6983,"children":6984},{"style":129},[6985],{"type":82,"value":261},{"type":69,"tag":110,"props":6987,"children":6988},{"style":123},[6989],{"type":82,"value":147},{"type":69,"tag":110,"props":6991,"children":6992},{"style":117},[6993],{"type":82,"value":152},{"type":69,"tag":110,"props":6995,"children":6996},{"style":123},[6997],{"type":82,"value":157},{"type":69,"tag":110,"props":6999,"children":7000},{"style":160},[7001],{"type":82,"value":278},{"type":69,"tag":110,"props":7003,"children":7004},{"style":123},[7005],{"type":82,"value":168},{"type":69,"tag":110,"props":7007,"children":7008},{"class":112,"line":247},[7009,7013,7017,7021,7025,7029,7033,7037],{"type":69,"tag":110,"props":7010,"children":7011},{"style":117},[7012],{"type":82,"value":120},{"type":69,"tag":110,"props":7014,"children":7015},{"style":123},[7016],{"type":82,"value":126},{"type":69,"tag":110,"props":7018,"children":7019},{"style":129},[7020],{"type":82,"value":185},{"type":69,"tag":110,"props":7022,"children":7023},{"style":123},[7024],{"type":82,"value":147},{"type":69,"tag":110,"props":7026,"children":7027},{"style":117},[7028],{"type":82,"value":152},{"type":69,"tag":110,"props":7030,"children":7031},{"style":123},[7032],{"type":82,"value":157},{"type":69,"tag":110,"props":7034,"children":7035},{"style":160},[7036],{"type":82,"value":202},{"type":69,"tag":110,"props":7038,"children":7039},{"style":123},[7040],{"type":82,"value":168},{"type":69,"tag":110,"props":7042,"children":7043},{"class":112,"line":285},[7044],{"type":69,"tag":110,"props":7045,"children":7046},{"emptyLinePlaceholder":364},[7047],{"type":82,"value":367},{"type":69,"tag":110,"props":7049,"children":7050},{"class":112,"line":322},[7051,7055,7059,7064,7068,7072,7076,7080,7084,7088],{"type":69,"tag":110,"props":7052,"children":7053},{"style":384},[7054],{"type":82,"value":387},{"type":69,"tag":110,"props":7056,"children":7057},{"style":123},[7058],{"type":82,"value":126},{"type":69,"tag":110,"props":7060,"children":7061},{"style":129},[7062],{"type":82,"value":7063}," tools",{"type":69,"tag":110,"props":7065,"children":7066},{"style":123},[7067],{"type":82,"value":137},{"type":69,"tag":110,"props":7069,"children":7070},{"style":129},[7071],{"type":82,"value":1331},{"type":69,"tag":110,"props":7073,"children":7074},{"style":123},[7075],{"type":82,"value":544},{"type":69,"tag":110,"props":7077,"children":7078},{"style":123},[7079],{"type":82,"value":728},{"type":69,"tag":110,"props":7081,"children":7082},{"style":400},[7083],{"type":82,"value":1209},{"type":69,"tag":110,"props":7085,"children":7086},{"style":129},[7087],{"type":82,"value":407},{"type":69,"tag":110,"props":7089,"children":7090},{"style":123},[7091],{"type":82,"value":412},{"type":69,"tag":110,"props":7093,"children":7094},{"class":112,"line":360},[7095,7099,7103,7107,7111],{"type":69,"tag":110,"props":7096,"children":7097},{"style":419},[7098],{"type":82,"value":866},{"type":69,"tag":110,"props":7100,"children":7101},{"style":123},[7102],{"type":82,"value":427},{"type":69,"tag":110,"props":7104,"children":7105},{"style":400},[7106],{"type":82,"value":261},{"type":69,"tag":110,"props":7108,"children":7109},{"style":129},[7110],{"type":82,"value":613},{"type":69,"tag":110,"props":7112,"children":7113},{"style":123},[7114],{"type":82,"value":446},{"type":69,"tag":110,"props":7116,"children":7117},{"class":112,"line":370},[7118,7122,7126,7131,7135,7140,7144],{"type":69,"tag":110,"props":7119,"children":7120},{"style":419},[7121],{"type":82,"value":953},{"type":69,"tag":110,"props":7123,"children":7124},{"style":123},[7125],{"type":82,"value":427},{"type":69,"tag":110,"props":7127,"children":7128},{"style":129},[7129],{"type":82,"value":7130}," [eagerTool",{"type":69,"tag":110,"props":7132,"children":7133},{"style":123},[7134],{"type":82,"value":137},{"type":69,"tag":110,"props":7136,"children":7137},{"style":129},[7138],{"type":82,"value":7139}," rarelyUsedTool]",{"type":69,"tag":110,"props":7141,"children":7142},{"style":123},[7143],{"type":82,"value":137},{"type":69,"tag":110,"props":7145,"children":7146},{"style":374},[7147],{"type":82,"value":7148}," \u002F\u002F rarelyUsedTool has lazy: true\n",{"type":69,"tag":110,"props":7150,"children":7151},{"class":112,"line":380},[7152,7156],{"type":69,"tag":110,"props":7153,"children":7154},{"style":123},[7155],{"type":82,"value":544},{"type":69,"tag":110,"props":7157,"children":7158},{"style":129},[7159],{"type":82,"value":772},{"type":69,"tag":110,"props":7161,"children":7162},{"class":112,"line":415},[7163],{"type":69,"tag":110,"props":7164,"children":7165},{"emptyLinePlaceholder":364},[7166],{"type":82,"value":367},{"type":69,"tag":110,"props":7168,"children":7169},{"class":112,"line":449},[7170,7174,7178,7182,7186,7190],{"type":69,"tag":110,"props":7171,"children":7172},{"style":384},[7173],{"type":82,"value":387},{"type":69,"tag":110,"props":7175,"children":7176},{"style":129},[7177],{"type":82,"value":1008},{"type":69,"tag":110,"props":7179,"children":7180},{"style":123},[7181],{"type":82,"value":397},{"type":69,"tag":110,"props":7183,"children":7184},{"style":400},[7185],{"type":82,"value":132},{"type":69,"tag":110,"props":7187,"children":7188},{"style":129},[7189],{"type":82,"value":407},{"type":69,"tag":110,"props":7191,"children":7192},{"style":123},[7193],{"type":82,"value":412},{"type":69,"tag":110,"props":7195,"children":7196},{"class":112,"line":479},[7197,7201,7205,7209,7213,7217,7222,7226,7230],{"type":69,"tag":110,"props":7198,"children":7199},{"style":419},[7200],{"type":82,"value":1033},{"type":69,"tag":110,"props":7202,"children":7203},{"style":123},[7204],{"type":82,"value":427},{"type":69,"tag":110,"props":7206,"children":7207},{"style":400},[7208],{"type":82,"value":185},{"type":69,"tag":110,"props":7210,"children":7211},{"style":129},[7212],{"type":82,"value":407},{"type":69,"tag":110,"props":7214,"children":7215},{"style":123},[7216],{"type":82,"value":441},{"type":69,"tag":110,"props":7218,"children":7219},{"style":160},[7220],{"type":82,"value":7221},"gpt-5.5",{"type":69,"tag":110,"props":7223,"children":7224},{"style":123},[7225],{"type":82,"value":441},{"type":69,"tag":110,"props":7227,"children":7228},{"style":129},[7229],{"type":82,"value":549},{"type":69,"tag":110,"props":7231,"children":7232},{"style":123},[7233],{"type":82,"value":446},{"type":69,"tag":110,"props":7235,"children":7236},{"class":112,"line":556},[7237,7241,7245,7249,7253,7257,7261,7265,7269],{"type":69,"tag":110,"props":7238,"children":7239},{"style":419},[7240],{"type":82,"value":1507},{"type":69,"tag":110,"props":7242,"children":7243},{"style":123},[7244],{"type":82,"value":427},{"type":69,"tag":110,"props":7246,"children":7247},{"style":129},[7248],{"type":82,"value":1516},{"type":69,"tag":110,"props":7250,"children":7251},{"style":123},[7252],{"type":82,"value":441},{"type":69,"tag":110,"props":7254,"children":7255},{"style":160},[7256],{"type":82,"value":1525},{"type":69,"tag":110,"props":7258,"children":7259},{"style":123},[7260],{"type":82,"value":441},{"type":69,"tag":110,"props":7262,"children":7263},{"style":123},[7264],{"type":82,"value":137},{"type":69,"tag":110,"props":7266,"children":7267},{"style":129},[7268],{"type":82,"value":1538},{"type":69,"tag":110,"props":7270,"children":7271},{"style":123},[7272],{"type":82,"value":446},{"type":69,"tag":110,"props":7274,"children":7275},{"class":112,"line":657},[7276,7280,7284,7288,7292,7296,7300,7305,7310,7314],{"type":69,"tag":110,"props":7277,"children":7278},{"style":419},[7279],{"type":82,"value":953},{"type":69,"tag":110,"props":7281,"children":7282},{"style":123},[7283],{"type":82,"value":427},{"type":69,"tag":110,"props":7285,"children":7286},{"style":129},[7287],{"type":82,"value":1516},{"type":69,"tag":110,"props":7289,"children":7290},{"style":123},[7291],{"type":82,"value":4889},{"type":69,"tag":110,"props":7293,"children":7294},{"style":129},[7295],{"type":82,"value":6875},{"type":69,"tag":110,"props":7297,"children":7298},{"style":123},[7299],{"type":82,"value":137},{"type":69,"tag":110,"props":7301,"children":7302},{"style":123},[7303],{"type":82,"value":7304}," ...",{"type":69,"tag":110,"props":7306,"children":7307},{"style":129},[7308],{"type":82,"value":7309},"otherTools]",{"type":69,"tag":110,"props":7311,"children":7312},{"style":123},[7313],{"type":82,"value":137},{"type":69,"tag":110,"props":7315,"children":7316},{"style":374},[7317],{"type":82,"value":7318}," \u002F\u002F spread tools, not just tool\n",{"type":69,"tag":110,"props":7320,"children":7321},{"class":112,"line":712},[7322,7326],{"type":69,"tag":110,"props":7323,"children":7324},{"style":129},[7325],{"type":82,"value":1075},{"type":69,"tag":110,"props":7327,"children":7328},{"style":123},[7329],{"type":82,"value":446},{"type":69,"tag":110,"props":7331,"children":7332},{"class":112,"line":775},[7333,7337],{"type":69,"tag":110,"props":7334,"children":7335},{"style":123},[7336],{"type":82,"value":544},{"type":69,"tag":110,"props":7338,"children":7339},{"style":129},[7340],{"type":82,"value":772},{"type":69,"tag":74,"props":7342,"children":7343},{},[7344,7349,7351,7357,7359,7365],{"type":69,"tag":106,"props":7345,"children":7347},{"className":7346},[],[7348],{"type":82,"value":6875},{"type":82,"value":7350}," equals ",{"type":69,"tag":106,"props":7352,"children":7354},{"className":7353},[],[7355],{"type":82,"value":7356},"[tool]",{"type":82,"value":7358}," when there are no lazy tools (backward compatible) and ",{"type":69,"tag":106,"props":7360,"children":7362},{"className":7361},[],[7363],{"type":82,"value":7364},"[tool, discoveryTool]",{"type":82,"value":7366}," when lazy tools exist.",{"type":69,"tag":74,"props":7368,"children":7369},{},[7370],{"type":69,"tag":78,"props":7371,"children":7372},{},[7373,7378],{"type":69,"tag":106,"props":7374,"children":7376},{"className":7375},[],[7377],{"type":82,"value":6859},{"type":82,"value":7379}," flow:",{"type":69,"tag":74,"props":7381,"children":7382},{},[7383,7385,7390,7392,7398,7400,7406,7408,7413],{"type":82,"value":7384},"When the model encounters a lazy tool it has not seen before, it calls ",{"type":69,"tag":106,"props":7386,"children":7388},{"className":7387},[],[7389],{"type":82,"value":6859},{"type":82,"value":7391}," with the bare name (no ",{"type":69,"tag":106,"props":7393,"children":7395},{"className":7394},[],[7396],{"type":82,"value":7397},"external_",{"type":82,"value":7399}," prefix). The tool returns each requested tool's TypeScript type stub and description. The model then writes correctly-typed ",{"type":69,"tag":106,"props":7401,"children":7403},{"className":7402},[],[7404],{"type":82,"value":7405},"external_\u003Cname>",{"type":82,"value":7407}," calls inside ",{"type":69,"tag":106,"props":7409,"children":7411},{"className":7410},[],[7412],{"type":82,"value":3350},{"type":82,"value":498},{"type":69,"tag":99,"props":7415,"children":7419},{"className":7416,"code":7418,"language":82,"meta":103},[7417],"language-text","Model sees: \"Discoverable APIs: external_fetchStocks\"\nModel calls: discover_tools({ toolNames: [\"fetchStocks\"] })\nResponse:    { tools: [{ name: \"external_fetchStocks\", description: \"...\", typeStub: \"declare function external_fetchStocks(...)\" }] }\nModel writes inside execute_typescript: const result = await external_fetchStocks({ ticker: \"AAPL\" })\n",[7420],{"type":69,"tag":106,"props":7421,"children":7422},{"__ignoreMap":103},[7423],{"type":82,"value":7418},{"type":69,"tag":74,"props":7425,"children":7426},{},[7427],{"type":69,"tag":78,"props":7428,"children":7429},{},[7430,7436],{"type":69,"tag":106,"props":7431,"children":7433},{"className":7432},[],[7434],{"type":82,"value":7435},"lazyToolsConfig.includeDescription",{"type":82,"value":427},{"type":69,"tag":74,"props":7438,"children":7439},{},[7440],{"type":82,"value":7441},"Control how much of each lazy tool's description appears in the Discoverable APIs catalog (the pre-discovery list):",{"type":69,"tag":2219,"props":7443,"children":7444},{},[7445,7461],{"type":69,"tag":2223,"props":7446,"children":7447},{},[7448],{"type":69,"tag":2227,"props":7449,"children":7450},{},[7451,7456],{"type":69,"tag":2231,"props":7452,"children":7453},{},[7454],{"type":82,"value":7455},"Value",{"type":69,"tag":2231,"props":7457,"children":7458},{},[7459],{"type":82,"value":7460},"Catalog entry",{"type":69,"tag":2257,"props":7462,"children":7463},{},[7464,7487,7508],{"type":69,"tag":2227,"props":7465,"children":7466},{},[7467,7476],{"type":69,"tag":2264,"props":7468,"children":7469},{},[7470],{"type":69,"tag":106,"props":7471,"children":7473},{"className":7472},[],[7474],{"type":82,"value":7475},"'none'",{"type":69,"tag":2264,"props":7477,"children":7478},{},[7479,7485],{"type":69,"tag":106,"props":7480,"children":7482},{"className":7481},[],[7483],{"type":82,"value":7484},"external_fetchStocks",{"type":82,"value":7486}," (name only — default)",{"type":69,"tag":2227,"props":7488,"children":7489},{},[7490,7499],{"type":69,"tag":2264,"props":7491,"children":7492},{},[7493],{"type":69,"tag":106,"props":7494,"children":7496},{"className":7495},[],[7497],{"type":82,"value":7498},"'first-sentence'",{"type":69,"tag":2264,"props":7500,"children":7501},{},[7502],{"type":69,"tag":106,"props":7503,"children":7505},{"className":7504},[],[7506],{"type":82,"value":7507},"external_fetchStocks — Get stock prices.",{"type":69,"tag":2227,"props":7509,"children":7510},{},[7511,7520],{"type":69,"tag":2264,"props":7512,"children":7513},{},[7514],{"type":69,"tag":106,"props":7515,"children":7517},{"className":7516},[],[7518],{"type":82,"value":7519},"'full'",{"type":69,"tag":2264,"props":7521,"children":7522},{},[7523],{"type":69,"tag":106,"props":7524,"children":7526},{"className":7525},[],[7527],{"type":82,"value":7528},"external_fetchStocks — Get stock prices. Returns a price quote.",{"type":69,"tag":99,"props":7530,"children":7532},{"className":101,"code":7531,"language":14,"meta":103,"style":103},"const { tools, systemPrompt } = createCodeMode({\n  driver: createNodeIsolateDriver(),\n  tools: [eagerTool, rarelyUsedTool],\n  lazyToolsConfig: { includeDescription: 'first-sentence' },\n})\n",[7533],{"type":69,"tag":106,"props":7534,"children":7535},{"__ignoreMap":103},[7536,7579,7602,7629,7671],{"type":69,"tag":110,"props":7537,"children":7538},{"class":112,"line":113},[7539,7543,7547,7551,7555,7559,7563,7567,7571,7575],{"type":69,"tag":110,"props":7540,"children":7541},{"style":384},[7542],{"type":82,"value":387},{"type":69,"tag":110,"props":7544,"children":7545},{"style":123},[7546],{"type":82,"value":126},{"type":69,"tag":110,"props":7548,"children":7549},{"style":129},[7550],{"type":82,"value":7063},{"type":69,"tag":110,"props":7552,"children":7553},{"style":123},[7554],{"type":82,"value":137},{"type":69,"tag":110,"props":7556,"children":7557},{"style":129},[7558],{"type":82,"value":1331},{"type":69,"tag":110,"props":7560,"children":7561},{"style":123},[7562],{"type":82,"value":544},{"type":69,"tag":110,"props":7564,"children":7565},{"style":123},[7566],{"type":82,"value":728},{"type":69,"tag":110,"props":7568,"children":7569},{"style":400},[7570],{"type":82,"value":1209},{"type":69,"tag":110,"props":7572,"children":7573},{"style":129},[7574],{"type":82,"value":407},{"type":69,"tag":110,"props":7576,"children":7577},{"style":123},[7578],{"type":82,"value":412},{"type":69,"tag":110,"props":7580,"children":7581},{"class":112,"line":171},[7582,7586,7590,7594,7598],{"type":69,"tag":110,"props":7583,"children":7584},{"style":419},[7585],{"type":82,"value":866},{"type":69,"tag":110,"props":7587,"children":7588},{"style":123},[7589],{"type":82,"value":427},{"type":69,"tag":110,"props":7591,"children":7592},{"style":400},[7593],{"type":82,"value":261},{"type":69,"tag":110,"props":7595,"children":7596},{"style":129},[7597],{"type":82,"value":613},{"type":69,"tag":110,"props":7599,"children":7600},{"style":123},[7601],{"type":82,"value":446},{"type":69,"tag":110,"props":7603,"children":7604},{"class":112,"line":209},[7605,7609,7613,7617,7621,7625],{"type":69,"tag":110,"props":7606,"children":7607},{"style":419},[7608],{"type":82,"value":953},{"type":69,"tag":110,"props":7610,"children":7611},{"style":123},[7612],{"type":82,"value":427},{"type":69,"tag":110,"props":7614,"children":7615},{"style":129},[7616],{"type":82,"value":7130},{"type":69,"tag":110,"props":7618,"children":7619},{"style":123},[7620],{"type":82,"value":137},{"type":69,"tag":110,"props":7622,"children":7623},{"style":129},[7624],{"type":82,"value":7139},{"type":69,"tag":110,"props":7626,"children":7627},{"style":123},[7628],{"type":82,"value":446},{"type":69,"tag":110,"props":7630,"children":7631},{"class":112,"line":247},[7632,7637,7641,7645,7650,7654,7658,7663,7667],{"type":69,"tag":110,"props":7633,"children":7634},{"style":419},[7635],{"type":82,"value":7636},"  lazyToolsConfig",{"type":69,"tag":110,"props":7638,"children":7639},{"style":123},[7640],{"type":82,"value":427},{"type":69,"tag":110,"props":7642,"children":7643},{"style":123},[7644],{"type":82,"value":126},{"type":69,"tag":110,"props":7646,"children":7647},{"style":419},[7648],{"type":82,"value":7649}," includeDescription",{"type":69,"tag":110,"props":7651,"children":7652},{"style":123},[7653],{"type":82,"value":427},{"type":69,"tag":110,"props":7655,"children":7656},{"style":123},[7657],{"type":82,"value":157},{"type":69,"tag":110,"props":7659,"children":7660},{"style":160},[7661],{"type":82,"value":7662},"first-sentence",{"type":69,"tag":110,"props":7664,"children":7665},{"style":123},[7666],{"type":82,"value":441},{"type":69,"tag":110,"props":7668,"children":7669},{"style":123},[7670],{"type":82,"value":3496},{"type":69,"tag":110,"props":7672,"children":7673},{"class":112,"line":285},[7674,7678],{"type":69,"tag":110,"props":7675,"children":7676},{"style":123},[7677],{"type":82,"value":544},{"type":69,"tag":110,"props":7679,"children":7680},{"style":129},[7681],{"type":82,"value":772},{"type":69,"tag":74,"props":7683,"children":7684},{},[7685,7687,7693,7695,7700,7702,7708],{"type":82,"value":7686},"The same ",{"type":69,"tag":106,"props":7688,"children":7690},{"className":7689},[],[7691],{"type":82,"value":7692},"lazyToolsConfig",{"type":82,"value":7694}," option is accepted by plain ",{"type":69,"tag":106,"props":7696,"children":7698},{"className":7697},[],[7699],{"type":82,"value":6891},{"type":82,"value":7701}," for its own lazy-tool discovery catalog (see ",{"type":69,"tag":106,"props":7703,"children":7705},{"className":7704},[],[7706],{"type":82,"value":7707},"ai-core\u002Ftool-calling\u002FSKILL.md",{"type":82,"value":7709},").",{"type":69,"tag":87,"props":7711,"children":7713},{"id":7712},"common-mistakes",[7714],{"type":82,"value":7715},"Common Mistakes",{"type":69,"tag":1619,"props":7717,"children":7719},{"id":7718},"critical-passing-api-keys-or-secrets-to-the-sandbox-environment",[7720],{"type":82,"value":7721},"CRITICAL: Passing API keys or secrets to the sandbox environment",{"type":69,"tag":74,"props":7723,"children":7724},{},[7725],{"type":82,"value":7726},"Code Mode executes LLM-generated code. Any secrets available in the sandbox context are accessible to generated code, which could exfiltrate them via tool calls. Never pass API keys, database credentials, or tokens into the sandbox. Keep secrets in your tool server implementations, which run in the host process outside the sandbox.",{"type":69,"tag":74,"props":7728,"children":7729},{},[7730],{"type":82,"value":7731},"Wrong:",{"type":69,"tag":99,"props":7733,"children":7735},{"className":101,"code":7734,"language":14,"meta":103,"style":103},"const codeModeTool = createCodeModeTool({\n  driver,\n  tools: [\n    toolDefinition({\n      name: 'callApi',\n      inputSchema: z.object({ url: z.string(), apiKey: z.string() }),\n      outputSchema: z.any(),\n    }).server(async ({ url, apiKey }) =>\n      fetch(url, {\n        headers: { Authorization: apiKey },\n      }),\n    ),\n  ],\n})\n",[7736],{"type":69,"tag":106,"props":7737,"children":7738},{"__ignoreMap":103},[7739,7766,7777,7793,7809,7838,7936,7969,8022,8043,8078,8093,8105,8117],{"type":69,"tag":110,"props":7740,"children":7741},{"class":112,"line":113},[7742,7746,7750,7754,7758,7762],{"type":69,"tag":110,"props":7743,"children":7744},{"style":384},[7745],{"type":82,"value":387},{"type":69,"tag":110,"props":7747,"children":7748},{"style":129},[7749],{"type":82,"value":841},{"type":69,"tag":110,"props":7751,"children":7752},{"style":123},[7753],{"type":82,"value":397},{"type":69,"tag":110,"props":7755,"children":7756},{"style":400},[7757],{"type":82,"value":223},{"type":69,"tag":110,"props":7759,"children":7760},{"style":129},[7761],{"type":82,"value":407},{"type":69,"tag":110,"props":7763,"children":7764},{"style":123},[7765],{"type":82,"value":412},{"type":69,"tag":110,"props":7767,"children":7768},{"class":112,"line":171},[7769,7773],{"type":69,"tag":110,"props":7770,"children":7771},{"style":129},[7772],{"type":82,"value":866},{"type":69,"tag":110,"props":7774,"children":7775},{"style":123},[7776],{"type":82,"value":446},{"type":69,"tag":110,"props":7778,"children":7779},{"class":112,"line":209},[7780,7784,7788],{"type":69,"tag":110,"props":7781,"children":7782},{"style":419},[7783],{"type":82,"value":953},{"type":69,"tag":110,"props":7785,"children":7786},{"style":123},[7787],{"type":82,"value":427},{"type":69,"tag":110,"props":7789,"children":7790},{"style":129},[7791],{"type":82,"value":7792}," [\n",{"type":69,"tag":110,"props":7794,"children":7795},{"class":112,"line":247},[7796,7801,7805],{"type":69,"tag":110,"props":7797,"children":7798},{"style":400},[7799],{"type":82,"value":7800},"    toolDefinition",{"type":69,"tag":110,"props":7802,"children":7803},{"style":129},[7804],{"type":82,"value":407},{"type":69,"tag":110,"props":7806,"children":7807},{"style":123},[7808],{"type":82,"value":412},{"type":69,"tag":110,"props":7810,"children":7811},{"class":112,"line":285},[7812,7817,7821,7825,7830,7834],{"type":69,"tag":110,"props":7813,"children":7814},{"style":419},[7815],{"type":82,"value":7816},"      name",{"type":69,"tag":110,"props":7818,"children":7819},{"style":123},[7820],{"type":82,"value":427},{"type":69,"tag":110,"props":7822,"children":7823},{"style":123},[7824],{"type":82,"value":157},{"type":69,"tag":110,"props":7826,"children":7827},{"style":160},[7828],{"type":82,"value":7829},"callApi",{"type":69,"tag":110,"props":7831,"children":7832},{"style":123},[7833],{"type":82,"value":441},{"type":69,"tag":110,"props":7835,"children":7836},{"style":123},[7837],{"type":82,"value":446},{"type":69,"tag":110,"props":7839,"children":7840},{"class":112,"line":322},[7841,7846,7850,7854,7858,7862,7866,7870,7875,7879,7883,7887,7891,7895,7899,7904,7908,7912,7916,7920,7924,7928,7932],{"type":69,"tag":110,"props":7842,"children":7843},{"style":419},[7844],{"type":82,"value":7845},"      inputSchema",{"type":69,"tag":110,"props":7847,"children":7848},{"style":123},[7849],{"type":82,"value":427},{"type":69,"tag":110,"props":7851,"children":7852},{"style":129},[7853],{"type":82,"value":336},{"type":69,"tag":110,"props":7855,"children":7856},{"style":123},[7857],{"type":82,"value":498},{"type":69,"tag":110,"props":7859,"children":7860},{"style":400},[7861],{"type":82,"value":503},{"type":69,"tag":110,"props":7863,"children":7864},{"style":129},[7865],{"type":82,"value":407},{"type":69,"tag":110,"props":7867,"children":7868},{"style":123},[7869],{"type":82,"value":512},{"type":69,"tag":110,"props":7871,"children":7872},{"style":419},[7873],{"type":82,"value":7874}," url",{"type":69,"tag":110,"props":7876,"children":7877},{"style":123},[7878],{"type":82,"value":427},{"type":69,"tag":110,"props":7880,"children":7881},{"style":129},[7882],{"type":82,"value":336},{"type":69,"tag":110,"props":7884,"children":7885},{"style":123},[7886],{"type":82,"value":498},{"type":69,"tag":110,"props":7888,"children":7889},{"style":400},[7890],{"type":82,"value":534},{"type":69,"tag":110,"props":7892,"children":7893},{"style":129},[7894],{"type":82,"value":613},{"type":69,"tag":110,"props":7896,"children":7897},{"style":123},[7898],{"type":82,"value":137},{"type":69,"tag":110,"props":7900,"children":7901},{"style":419},[7902],{"type":82,"value":7903}," apiKey",{"type":69,"tag":110,"props":7905,"children":7906},{"style":123},[7907],{"type":82,"value":427},{"type":69,"tag":110,"props":7909,"children":7910},{"style":129},[7911],{"type":82,"value":336},{"type":69,"tag":110,"props":7913,"children":7914},{"style":123},[7915],{"type":82,"value":498},{"type":69,"tag":110,"props":7917,"children":7918},{"style":400},[7919],{"type":82,"value":534},{"type":69,"tag":110,"props":7921,"children":7922},{"style":129},[7923],{"type":82,"value":539},{"type":69,"tag":110,"props":7925,"children":7926},{"style":123},[7927],{"type":82,"value":544},{"type":69,"tag":110,"props":7929,"children":7930},{"style":129},[7931],{"type":82,"value":549},{"type":69,"tag":110,"props":7933,"children":7934},{"style":123},[7935],{"type":82,"value":446},{"type":69,"tag":110,"props":7937,"children":7938},{"class":112,"line":360},[7939,7944,7948,7952,7956,7961,7965],{"type":69,"tag":110,"props":7940,"children":7941},{"style":419},[7942],{"type":82,"value":7943},"      outputSchema",{"type":69,"tag":110,"props":7945,"children":7946},{"style":123},[7947],{"type":82,"value":427},{"type":69,"tag":110,"props":7949,"children":7950},{"style":129},[7951],{"type":82,"value":336},{"type":69,"tag":110,"props":7953,"children":7954},{"style":123},[7955],{"type":82,"value":498},{"type":69,"tag":110,"props":7957,"children":7958},{"style":400},[7959],{"type":82,"value":7960},"any",{"type":69,"tag":110,"props":7962,"children":7963},{"style":129},[7964],{"type":82,"value":613},{"type":69,"tag":110,"props":7966,"children":7967},{"style":123},[7968],{"type":82,"value":446},{"type":69,"tag":110,"props":7970,"children":7971},{"class":112,"line":370},[7972,7977,7981,7985,7989,7993,7997,8001,8005,8009,8013,8017],{"type":69,"tag":110,"props":7973,"children":7974},{"style":123},[7975],{"type":82,"value":7976},"    }",{"type":69,"tag":110,"props":7978,"children":7979},{"style":129},[7980],{"type":82,"value":549},{"type":69,"tag":110,"props":7982,"children":7983},{"style":123},[7984],{"type":82,"value":498},{"type":69,"tag":110,"props":7986,"children":7987},{"style":400},[7988],{"type":82,"value":675},{"type":69,"tag":110,"props":7990,"children":7991},{"style":129},[7992],{"type":82,"value":407},{"type":69,"tag":110,"props":7994,"children":7995},{"style":384},[7996],{"type":82,"value":684},{"type":69,"tag":110,"props":7998,"children":7999},{"style":123},[8000],{"type":82,"value":689},{"type":69,"tag":110,"props":8002,"children":8003},{"style":692},[8004],{"type":82,"value":7874},{"type":69,"tag":110,"props":8006,"children":8007},{"style":123},[8008],{"type":82,"value":137},{"type":69,"tag":110,"props":8010,"children":8011},{"style":692},[8012],{"type":82,"value":7903},{"type":69,"tag":110,"props":8014,"children":8015},{"style":123},[8016],{"type":82,"value":699},{"type":69,"tag":110,"props":8018,"children":8019},{"style":384},[8020],{"type":82,"value":8021}," =>\n",{"type":69,"tag":110,"props":8023,"children":8024},{"class":112,"line":380},[8025,8030,8035,8039],{"type":69,"tag":110,"props":8026,"children":8027},{"style":400},[8028],{"type":82,"value":8029},"      fetch",{"type":69,"tag":110,"props":8031,"children":8032},{"style":129},[8033],{"type":82,"value":8034},"(url",{"type":69,"tag":110,"props":8036,"children":8037},{"style":123},[8038],{"type":82,"value":137},{"type":69,"tag":110,"props":8040,"children":8041},{"style":123},[8042],{"type":82,"value":709},{"type":69,"tag":110,"props":8044,"children":8045},{"class":112,"line":415},[8046,8051,8055,8059,8064,8068,8073],{"type":69,"tag":110,"props":8047,"children":8048},{"style":419},[8049],{"type":82,"value":8050},"        headers",{"type":69,"tag":110,"props":8052,"children":8053},{"style":123},[8054],{"type":82,"value":427},{"type":69,"tag":110,"props":8056,"children":8057},{"style":123},[8058],{"type":82,"value":126},{"type":69,"tag":110,"props":8060,"children":8061},{"style":419},[8062],{"type":82,"value":8063}," Authorization",{"type":69,"tag":110,"props":8065,"children":8066},{"style":123},[8067],{"type":82,"value":427},{"type":69,"tag":110,"props":8069,"children":8070},{"style":129},[8071],{"type":82,"value":8072}," apiKey ",{"type":69,"tag":110,"props":8074,"children":8075},{"style":123},[8076],{"type":82,"value":8077},"},\n",{"type":69,"tag":110,"props":8079,"children":8080},{"class":112,"line":449},[8081,8085,8089],{"type":69,"tag":110,"props":8082,"children":8083},{"style":123},[8084],{"type":82,"value":4928},{"type":69,"tag":110,"props":8086,"children":8087},{"style":129},[8088],{"type":82,"value":549},{"type":69,"tag":110,"props":8090,"children":8091},{"style":123},[8092],{"type":82,"value":446},{"type":69,"tag":110,"props":8094,"children":8095},{"class":112,"line":479},[8096,8101],{"type":69,"tag":110,"props":8097,"children":8098},{"style":129},[8099],{"type":82,"value":8100},"    )",{"type":69,"tag":110,"props":8102,"children":8103},{"style":123},[8104],{"type":82,"value":446},{"type":69,"tag":110,"props":8106,"children":8107},{"class":112,"line":556},[8108,8113],{"type":69,"tag":110,"props":8109,"children":8110},{"style":129},[8111],{"type":82,"value":8112},"  ]",{"type":69,"tag":110,"props":8114,"children":8115},{"style":123},[8116],{"type":82,"value":446},{"type":69,"tag":110,"props":8118,"children":8119},{"class":112,"line":657},[8120,8124],{"type":69,"tag":110,"props":8121,"children":8122},{"style":123},[8123],{"type":82,"value":544},{"type":69,"tag":110,"props":8125,"children":8126},{"style":129},[8127],{"type":82,"value":772},{"type":69,"tag":74,"props":8129,"children":8130},{},[8131],{"type":82,"value":8132},"Right:",{"type":69,"tag":99,"props":8134,"children":8136},{"className":101,"code":8135,"language":14,"meta":103,"style":103},"const codeModeTool = createCodeModeTool({\n  driver,\n  tools: [\n    toolDefinition({\n      name: 'callApi',\n      inputSchema: z.object({ url: z.string() }),\n      outputSchema: z.any(),\n    }).server(async ({ url }) =>\n      fetch(url, {\n        headers: { Authorization: process.env.API_KEY }, \u002F\u002F secret stays in host\n      }),\n    ),\n  ],\n})\n",[8137],{"type":69,"tag":106,"props":8138,"children":8139},{"__ignoreMap":103},[8140,8167,8178,8193,8208,8235,8302,8333,8376,8395,8449,8464,8475,8486],{"type":69,"tag":110,"props":8141,"children":8142},{"class":112,"line":113},[8143,8147,8151,8155,8159,8163],{"type":69,"tag":110,"props":8144,"children":8145},{"style":384},[8146],{"type":82,"value":387},{"type":69,"tag":110,"props":8148,"children":8149},{"style":129},[8150],{"type":82,"value":841},{"type":69,"tag":110,"props":8152,"children":8153},{"style":123},[8154],{"type":82,"value":397},{"type":69,"tag":110,"props":8156,"children":8157},{"style":400},[8158],{"type":82,"value":223},{"type":69,"tag":110,"props":8160,"children":8161},{"style":129},[8162],{"type":82,"value":407},{"type":69,"tag":110,"props":8164,"children":8165},{"style":123},[8166],{"type":82,"value":412},{"type":69,"tag":110,"props":8168,"children":8169},{"class":112,"line":171},[8170,8174],{"type":69,"tag":110,"props":8171,"children":8172},{"style":129},[8173],{"type":82,"value":866},{"type":69,"tag":110,"props":8175,"children":8176},{"style":123},[8177],{"type":82,"value":446},{"type":69,"tag":110,"props":8179,"children":8180},{"class":112,"line":209},[8181,8185,8189],{"type":69,"tag":110,"props":8182,"children":8183},{"style":419},[8184],{"type":82,"value":953},{"type":69,"tag":110,"props":8186,"children":8187},{"style":123},[8188],{"type":82,"value":427},{"type":69,"tag":110,"props":8190,"children":8191},{"style":129},[8192],{"type":82,"value":7792},{"type":69,"tag":110,"props":8194,"children":8195},{"class":112,"line":247},[8196,8200,8204],{"type":69,"tag":110,"props":8197,"children":8198},{"style":400},[8199],{"type":82,"value":7800},{"type":69,"tag":110,"props":8201,"children":8202},{"style":129},[8203],{"type":82,"value":407},{"type":69,"tag":110,"props":8205,"children":8206},{"style":123},[8207],{"type":82,"value":412},{"type":69,"tag":110,"props":8209,"children":8210},{"class":112,"line":285},[8211,8215,8219,8223,8227,8231],{"type":69,"tag":110,"props":8212,"children":8213},{"style":419},[8214],{"type":82,"value":7816},{"type":69,"tag":110,"props":8216,"children":8217},{"style":123},[8218],{"type":82,"value":427},{"type":69,"tag":110,"props":8220,"children":8221},{"style":123},[8222],{"type":82,"value":157},{"type":69,"tag":110,"props":8224,"children":8225},{"style":160},[8226],{"type":82,"value":7829},{"type":69,"tag":110,"props":8228,"children":8229},{"style":123},[8230],{"type":82,"value":441},{"type":69,"tag":110,"props":8232,"children":8233},{"style":123},[8234],{"type":82,"value":446},{"type":69,"tag":110,"props":8236,"children":8237},{"class":112,"line":322},[8238,8242,8246,8250,8254,8258,8262,8266,8270,8274,8278,8282,8286,8290,8294,8298],{"type":69,"tag":110,"props":8239,"children":8240},{"style":419},[8241],{"type":82,"value":7845},{"type":69,"tag":110,"props":8243,"children":8244},{"style":123},[8245],{"type":82,"value":427},{"type":69,"tag":110,"props":8247,"children":8248},{"style":129},[8249],{"type":82,"value":336},{"type":69,"tag":110,"props":8251,"children":8252},{"style":123},[8253],{"type":82,"value":498},{"type":69,"tag":110,"props":8255,"children":8256},{"style":400},[8257],{"type":82,"value":503},{"type":69,"tag":110,"props":8259,"children":8260},{"style":129},[8261],{"type":82,"value":407},{"type":69,"tag":110,"props":8263,"children":8264},{"style":123},[8265],{"type":82,"value":512},{"type":69,"tag":110,"props":8267,"children":8268},{"style":419},[8269],{"type":82,"value":7874},{"type":69,"tag":110,"props":8271,"children":8272},{"style":123},[8273],{"type":82,"value":427},{"type":69,"tag":110,"props":8275,"children":8276},{"style":129},[8277],{"type":82,"value":336},{"type":69,"tag":110,"props":8279,"children":8280},{"style":123},[8281],{"type":82,"value":498},{"type":69,"tag":110,"props":8283,"children":8284},{"style":400},[8285],{"type":82,"value":534},{"type":69,"tag":110,"props":8287,"children":8288},{"style":129},[8289],{"type":82,"value":539},{"type":69,"tag":110,"props":8291,"children":8292},{"style":123},[8293],{"type":82,"value":544},{"type":69,"tag":110,"props":8295,"children":8296},{"style":129},[8297],{"type":82,"value":549},{"type":69,"tag":110,"props":8299,"children":8300},{"style":123},[8301],{"type":82,"value":446},{"type":69,"tag":110,"props":8303,"children":8304},{"class":112,"line":360},[8305,8309,8313,8317,8321,8325,8329],{"type":69,"tag":110,"props":8306,"children":8307},{"style":419},[8308],{"type":82,"value":7943},{"type":69,"tag":110,"props":8310,"children":8311},{"style":123},[8312],{"type":82,"value":427},{"type":69,"tag":110,"props":8314,"children":8315},{"style":129},[8316],{"type":82,"value":336},{"type":69,"tag":110,"props":8318,"children":8319},{"style":123},[8320],{"type":82,"value":498},{"type":69,"tag":110,"props":8322,"children":8323},{"style":400},[8324],{"type":82,"value":7960},{"type":69,"tag":110,"props":8326,"children":8327},{"style":129},[8328],{"type":82,"value":613},{"type":69,"tag":110,"props":8330,"children":8331},{"style":123},[8332],{"type":82,"value":446},{"type":69,"tag":110,"props":8334,"children":8335},{"class":112,"line":370},[8336,8340,8344,8348,8352,8356,8360,8364,8368,8372],{"type":69,"tag":110,"props":8337,"children":8338},{"style":123},[8339],{"type":82,"value":7976},{"type":69,"tag":110,"props":8341,"children":8342},{"style":129},[8343],{"type":82,"value":549},{"type":69,"tag":110,"props":8345,"children":8346},{"style":123},[8347],{"type":82,"value":498},{"type":69,"tag":110,"props":8349,"children":8350},{"style":400},[8351],{"type":82,"value":675},{"type":69,"tag":110,"props":8353,"children":8354},{"style":129},[8355],{"type":82,"value":407},{"type":69,"tag":110,"props":8357,"children":8358},{"style":384},[8359],{"type":82,"value":684},{"type":69,"tag":110,"props":8361,"children":8362},{"style":123},[8363],{"type":82,"value":689},{"type":69,"tag":110,"props":8365,"children":8366},{"style":692},[8367],{"type":82,"value":7874},{"type":69,"tag":110,"props":8369,"children":8370},{"style":123},[8371],{"type":82,"value":699},{"type":69,"tag":110,"props":8373,"children":8374},{"style":384},[8375],{"type":82,"value":8021},{"type":69,"tag":110,"props":8377,"children":8378},{"class":112,"line":380},[8379,8383,8387,8391],{"type":69,"tag":110,"props":8380,"children":8381},{"style":400},[8382],{"type":82,"value":8029},{"type":69,"tag":110,"props":8384,"children":8385},{"style":129},[8386],{"type":82,"value":8034},{"type":69,"tag":110,"props":8388,"children":8389},{"style":123},[8390],{"type":82,"value":137},{"type":69,"tag":110,"props":8392,"children":8393},{"style":123},[8394],{"type":82,"value":709},{"type":69,"tag":110,"props":8396,"children":8397},{"class":112,"line":415},[8398,8402,8406,8410,8414,8418,8422,8426,8430,8434,8439,8444],{"type":69,"tag":110,"props":8399,"children":8400},{"style":419},[8401],{"type":82,"value":8050},{"type":69,"tag":110,"props":8403,"children":8404},{"style":123},[8405],{"type":82,"value":427},{"type":69,"tag":110,"props":8407,"children":8408},{"style":123},[8409],{"type":82,"value":126},{"type":69,"tag":110,"props":8411,"children":8412},{"style":419},[8413],{"type":82,"value":8063},{"type":69,"tag":110,"props":8415,"children":8416},{"style":123},[8417],{"type":82,"value":427},{"type":69,"tag":110,"props":8419,"children":8420},{"style":129},[8421],{"type":82,"value":2135},{"type":69,"tag":110,"props":8423,"children":8424},{"style":123},[8425],{"type":82,"value":498},{"type":69,"tag":110,"props":8427,"children":8428},{"style":129},[8429],{"type":82,"value":2144},{"type":69,"tag":110,"props":8431,"children":8432},{"style":123},[8433],{"type":82,"value":498},{"type":69,"tag":110,"props":8435,"children":8436},{"style":129},[8437],{"type":82,"value":8438},"API_KEY ",{"type":69,"tag":110,"props":8440,"children":8441},{"style":123},[8442],{"type":82,"value":8443},"},",{"type":69,"tag":110,"props":8445,"children":8446},{"style":374},[8447],{"type":82,"value":8448}," \u002F\u002F secret stays in host\n",{"type":69,"tag":110,"props":8450,"children":8451},{"class":112,"line":449},[8452,8456,8460],{"type":69,"tag":110,"props":8453,"children":8454},{"style":123},[8455],{"type":82,"value":4928},{"type":69,"tag":110,"props":8457,"children":8458},{"style":129},[8459],{"type":82,"value":549},{"type":69,"tag":110,"props":8461,"children":8462},{"style":123},[8463],{"type":82,"value":446},{"type":69,"tag":110,"props":8465,"children":8466},{"class":112,"line":479},[8467,8471],{"type":69,"tag":110,"props":8468,"children":8469},{"style":129},[8470],{"type":82,"value":8100},{"type":69,"tag":110,"props":8472,"children":8473},{"style":123},[8474],{"type":82,"value":446},{"type":69,"tag":110,"props":8476,"children":8477},{"class":112,"line":556},[8478,8482],{"type":69,"tag":110,"props":8479,"children":8480},{"style":129},[8481],{"type":82,"value":8112},{"type":69,"tag":110,"props":8483,"children":8484},{"style":123},[8485],{"type":82,"value":446},{"type":69,"tag":110,"props":8487,"children":8488},{"class":112,"line":657},[8489,8493],{"type":69,"tag":110,"props":8490,"children":8491},{"style":123},[8492],{"type":82,"value":544},{"type":69,"tag":110,"props":8494,"children":8495},{"style":129},[8496],{"type":82,"value":772},{"type":69,"tag":74,"props":8498,"children":8499},{},[8500],{"type":82,"value":8501},"Source: docs\u002Fcode-mode\u002Fcode-mode.md",{"type":69,"tag":1619,"props":8503,"children":8505},{"id":8504},"high-not-setting-timeout-for-code-execution",[8506],{"type":82,"value":8507},"HIGH: Not setting timeout for code execution",{"type":69,"tag":74,"props":8509,"children":8510},{},[8511],{"type":82,"value":8512},"LLM-generated code may contain infinite loops. The default timeout is 30s, but developers may override to 0 (no timeout). Always set an explicit, finite timeout.",{"type":69,"tag":74,"props":8514,"children":8515},{},[8516],{"type":82,"value":7731},{"type":69,"tag":99,"props":8518,"children":8520},{"className":101,"code":8519,"language":14,"meta":103,"style":103},"const driver = createNodeIsolateDriver({ timeout: 0 })\n",[8521],{"type":69,"tag":106,"props":8522,"children":8523},{"__ignoreMap":103},[8524],{"type":69,"tag":110,"props":8525,"children":8526},{"class":112,"line":113},[8527,8531,8535,8539,8543,8547,8551,8556,8560,8564,8568],{"type":69,"tag":110,"props":8528,"children":8529},{"style":384},[8530],{"type":82,"value":387},{"type":69,"tag":110,"props":8532,"children":8533},{"style":129},[8534],{"type":82,"value":1724},{"type":69,"tag":110,"props":8536,"children":8537},{"style":123},[8538],{"type":82,"value":397},{"type":69,"tag":110,"props":8540,"children":8541},{"style":400},[8542],{"type":82,"value":261},{"type":69,"tag":110,"props":8544,"children":8545},{"style":129},[8546],{"type":82,"value":407},{"type":69,"tag":110,"props":8548,"children":8549},{"style":123},[8550],{"type":82,"value":512},{"type":69,"tag":110,"props":8552,"children":8553},{"style":419},[8554],{"type":82,"value":8555}," timeout",{"type":69,"tag":110,"props":8557,"children":8558},{"style":123},[8559],{"type":82,"value":427},{"type":69,"tag":110,"props":8561,"children":8562},{"style":898},[8563],{"type":82,"value":6798},{"type":69,"tag":110,"props":8565,"children":8566},{"style":123},[8567],{"type":82,"value":147},{"type":69,"tag":110,"props":8569,"children":8570},{"style":129},[8571],{"type":82,"value":772},{"type":69,"tag":74,"props":8573,"children":8574},{},[8575],{"type":82,"value":8132},{"type":69,"tag":99,"props":8577,"children":8579},{"className":101,"code":8578,"language":14,"meta":103,"style":103},"const driver = createNodeIsolateDriver({ timeout: 30_000 })\n",[8580],{"type":69,"tag":106,"props":8581,"children":8582},{"__ignoreMap":103},[8583],{"type":69,"tag":110,"props":8584,"children":8585},{"class":112,"line":113},[8586,8590,8594,8598,8602,8606,8610,8614,8618,8622,8626],{"type":69,"tag":110,"props":8587,"children":8588},{"style":384},[8589],{"type":82,"value":387},{"type":69,"tag":110,"props":8591,"children":8592},{"style":129},[8593],{"type":82,"value":1724},{"type":69,"tag":110,"props":8595,"children":8596},{"style":123},[8597],{"type":82,"value":397},{"type":69,"tag":110,"props":8599,"children":8600},{"style":400},[8601],{"type":82,"value":261},{"type":69,"tag":110,"props":8603,"children":8604},{"style":129},[8605],{"type":82,"value":407},{"type":69,"tag":110,"props":8607,"children":8608},{"style":123},[8609],{"type":82,"value":512},{"type":69,"tag":110,"props":8611,"children":8612},{"style":419},[8613],{"type":82,"value":8555},{"type":69,"tag":110,"props":8615,"children":8616},{"style":123},[8617],{"type":82,"value":427},{"type":69,"tag":110,"props":8619,"children":8620},{"style":898},[8621],{"type":82,"value":1410},{"type":69,"tag":110,"props":8623,"children":8624},{"style":123},[8625],{"type":82,"value":147},{"type":69,"tag":110,"props":8627,"children":8628},{"style":129},[8629],{"type":82,"value":772},{"type":69,"tag":74,"props":8631,"children":8632},{},[8633],{"type":82,"value":8634},"Source: ai-code-mode source (default timeout in CodeModeToolConfig)",{"type":69,"tag":1619,"props":8636,"children":8638},{"id":8637},"high-using-node-isolated-vm-driver-without-checking-platform-compatibility",[8639],{"type":82,"value":8640},"HIGH: Using Node isolated-vm driver without checking platform compatibility",{"type":69,"tag":74,"props":8642,"children":8643},{},[8644,8649,8651,8657,8659,8665],{"type":69,"tag":106,"props":8645,"children":8647},{"className":8646},[],[8648],{"type":82,"value":1661},{"type":82,"value":8650}," requires native module compilation. An incompatible build (wrong Node.js version, missing build tools) causes segfaults that no JS error handling can catch. The driver runs a subprocess probe by default. Never set ",{"type":69,"tag":106,"props":8652,"children":8654},{"className":8653},[],[8655],{"type":82,"value":8656},"skipProbe: true",{"type":82,"value":8658}," unless you have independently verified compatibility. Use ",{"type":69,"tag":106,"props":8660,"children":8662},{"className":8661},[],[8663],{"type":82,"value":8664},"probeIsolatedVm()",{"type":82,"value":8666}," to check before creating the driver.",{"type":69,"tag":99,"props":8668,"children":8670},{"className":101,"code":8669,"language":14,"meta":103,"style":103},"import {\n  createNodeIsolateDriver,\n  probeIsolatedVm,\n} from '@tanstack\u002Fai-isolate-node'\n\nconst probe = probeIsolatedVm()\nif (!probe.compatible) {\n  console.error('isolated-vm not compatible:', probe.error)\n  \u002F\u002F Fall back to QuickJS\n}\n\n\u002F\u002F Never do this unless you verified compatibility yourself:\n\u002F\u002F const driver = createNodeIsolateDriver({ skipProbe: true })\n",[8671],{"type":69,"tag":106,"props":8672,"children":8673},{"__ignoreMap":103},[8674,8685,8697,8709,8732,8739,8764,8798,8852,8860,8867,8874,8882],{"type":69,"tag":110,"props":8675,"children":8676},{"class":112,"line":113},[8677,8681],{"type":69,"tag":110,"props":8678,"children":8679},{"style":117},[8680],{"type":82,"value":120},{"type":69,"tag":110,"props":8682,"children":8683},{"style":123},[8684],{"type":82,"value":709},{"type":69,"tag":110,"props":8686,"children":8687},{"class":112,"line":171},[8688,8693],{"type":69,"tag":110,"props":8689,"children":8690},{"style":129},[8691],{"type":82,"value":8692},"  createNodeIsolateDriver",{"type":69,"tag":110,"props":8694,"children":8695},{"style":123},[8696],{"type":82,"value":446},{"type":69,"tag":110,"props":8698,"children":8699},{"class":112,"line":209},[8700,8705],{"type":69,"tag":110,"props":8701,"children":8702},{"style":129},[8703],{"type":82,"value":8704},"  probeIsolatedVm",{"type":69,"tag":110,"props":8706,"children":8707},{"style":123},[8708],{"type":82,"value":446},{"type":69,"tag":110,"props":8710,"children":8711},{"class":112,"line":247},[8712,8716,8720,8724,8728],{"type":69,"tag":110,"props":8713,"children":8714},{"style":123},[8715],{"type":82,"value":544},{"type":69,"tag":110,"props":8717,"children":8718},{"style":117},[8719],{"type":82,"value":152},{"type":69,"tag":110,"props":8721,"children":8722},{"style":123},[8723],{"type":82,"value":157},{"type":69,"tag":110,"props":8725,"children":8726},{"style":160},[8727],{"type":82,"value":278},{"type":69,"tag":110,"props":8729,"children":8730},{"style":123},[8731],{"type":82,"value":168},{"type":69,"tag":110,"props":8733,"children":8734},{"class":112,"line":285},[8735],{"type":69,"tag":110,"props":8736,"children":8737},{"emptyLinePlaceholder":364},[8738],{"type":82,"value":367},{"type":69,"tag":110,"props":8740,"children":8741},{"class":112,"line":322},[8742,8746,8751,8755,8760],{"type":69,"tag":110,"props":8743,"children":8744},{"style":384},[8745],{"type":82,"value":387},{"type":69,"tag":110,"props":8747,"children":8748},{"style":129},[8749],{"type":82,"value":8750}," probe ",{"type":69,"tag":110,"props":8752,"children":8753},{"style":123},[8754],{"type":82,"value":397},{"type":69,"tag":110,"props":8756,"children":8757},{"style":400},[8758],{"type":82,"value":8759}," probeIsolatedVm",{"type":69,"tag":110,"props":8761,"children":8762},{"style":129},[8763],{"type":82,"value":799},{"type":69,"tag":110,"props":8765,"children":8766},{"class":112,"line":360},[8767,8772,8776,8780,8785,8789,8794],{"type":69,"tag":110,"props":8768,"children":8769},{"style":117},[8770],{"type":82,"value":8771},"if",{"type":69,"tag":110,"props":8773,"children":8774},{"style":129},[8775],{"type":82,"value":1647},{"type":69,"tag":110,"props":8777,"children":8778},{"style":123},[8779],{"type":82,"value":4553},{"type":69,"tag":110,"props":8781,"children":8782},{"style":129},[8783],{"type":82,"value":8784},"probe",{"type":69,"tag":110,"props":8786,"children":8787},{"style":123},[8788],{"type":82,"value":498},{"type":69,"tag":110,"props":8790,"children":8791},{"style":129},[8792],{"type":82,"value":8793},"compatible) ",{"type":69,"tag":110,"props":8795,"children":8796},{"style":123},[8797],{"type":82,"value":412},{"type":69,"tag":110,"props":8799,"children":8800},{"class":112,"line":370},[8801,8806,8810,8814,8818,8822,8827,8831,8835,8840,8844,8848],{"type":69,"tag":110,"props":8802,"children":8803},{"style":129},[8804],{"type":82,"value":8805},"  console",{"type":69,"tag":110,"props":8807,"children":8808},{"style":123},[8809],{"type":82,"value":498},{"type":69,"tag":110,"props":8811,"children":8812},{"style":400},[8813],{"type":82,"value":3984},{"type":69,"tag":110,"props":8815,"children":8816},{"style":419},[8817],{"type":82,"value":407},{"type":69,"tag":110,"props":8819,"children":8820},{"style":123},[8821],{"type":82,"value":441},{"type":69,"tag":110,"props":8823,"children":8824},{"style":160},[8825],{"type":82,"value":8826},"isolated-vm not compatible:",{"type":69,"tag":110,"props":8828,"children":8829},{"style":123},[8830],{"type":82,"value":441},{"type":69,"tag":110,"props":8832,"children":8833},{"style":123},[8834],{"type":82,"value":137},{"type":69,"tag":110,"props":8836,"children":8837},{"style":129},[8838],{"type":82,"value":8839}," probe",{"type":69,"tag":110,"props":8841,"children":8842},{"style":123},[8843],{"type":82,"value":498},{"type":69,"tag":110,"props":8845,"children":8846},{"style":129},[8847],{"type":82,"value":3984},{"type":69,"tag":110,"props":8849,"children":8850},{"style":419},[8851],{"type":82,"value":772},{"type":69,"tag":110,"props":8853,"children":8854},{"class":112,"line":380},[8855],{"type":69,"tag":110,"props":8856,"children":8857},{"style":374},[8858],{"type":82,"value":8859},"  \u002F\u002F Fall back to QuickJS\n",{"type":69,"tag":110,"props":8861,"children":8862},{"class":112,"line":415},[8863],{"type":69,"tag":110,"props":8864,"children":8865},{"style":123},[8866],{"type":82,"value":4197},{"type":69,"tag":110,"props":8868,"children":8869},{"class":112,"line":449},[8870],{"type":69,"tag":110,"props":8871,"children":8872},{"emptyLinePlaceholder":364},[8873],{"type":82,"value":367},{"type":69,"tag":110,"props":8875,"children":8876},{"class":112,"line":479},[8877],{"type":69,"tag":110,"props":8878,"children":8879},{"style":374},[8880],{"type":82,"value":8881},"\u002F\u002F Never do this unless you verified compatibility yourself:\n",{"type":69,"tag":110,"props":8883,"children":8884},{"class":112,"line":556},[8885],{"type":69,"tag":110,"props":8886,"children":8887},{"style":374},[8888],{"type":82,"value":8889},"\u002F\u002F const driver = createNodeIsolateDriver({ skipProbe: true })\n",{"type":69,"tag":74,"props":8891,"children":8892},{},[8893],{"type":82,"value":8894},"Source: ai-isolate-node source (probeIsolatedVm implementation)",{"type":69,"tag":1619,"props":8896,"children":8898},{"id":8897},"medium-expecting-identical-behavior-across-isolate-drivers",[8899],{"type":82,"value":8900},"MEDIUM: Expecting identical behavior across isolate drivers",{"type":69,"tag":74,"props":8902,"children":8903},{},[8904],{"type":82,"value":8905},"The three drivers have different capabilities. Same code may work in Node but fail elsewhere.",{"type":69,"tag":8907,"props":8908,"children":8909},"ul",{},[8910,8920,8929],{"type":69,"tag":8911,"props":8912,"children":8913},"li",{},[8914,8918],{"type":69,"tag":78,"props":8915,"children":8916},{},[8917],{"type":82,"value":2268},{"type":82,"value":8919},": Full V8 support, JIT compilation, configurable memory limit",{"type":69,"tag":8911,"props":8921,"children":8922},{},[8923,8927],{"type":69,"tag":78,"props":8924,"children":8925},{},[8926],{"type":82,"value":1816},{"type":82,"value":8928},": Interpreted, limited stdlib (no File I\u002FO), configurable stack size, asyncified execution (serialized through global queue)",{"type":69,"tag":8911,"props":8930,"children":8931},{},[8932,8936,8938,8944,8946,8952,8954,8960],{"type":69,"tag":78,"props":8933,"children":8934},{},[8935],{"type":82,"value":1994},{"type":82,"value":8937},": Network latency per tool call round-trip, ",{"type":69,"tag":106,"props":8939,"children":8941},{"className":8940},[],[8942],{"type":82,"value":8943},"maxToolRounds",{"type":82,"value":8945}," limit (default 10), requires deployed worker with ",{"type":69,"tag":106,"props":8947,"children":8949},{"className":8948},[],[8950],{"type":82,"value":8951},"UNSAFE_EVAL",{"type":82,"value":8953}," or ",{"type":69,"tag":106,"props":8955,"children":8957},{"className":8956},[],[8958],{"type":82,"value":8959},"eval",{"type":82,"value":8961}," unsafe binding",{"type":69,"tag":74,"props":8963,"children":8964},{},[8965],{"type":82,"value":8966},"Test generated code against your target driver. If you need portability, target QuickJS's subset.",{"type":69,"tag":74,"props":8968,"children":8969},{},[8970],{"type":82,"value":8971},"Source: docs\u002Fcode-mode\u002Fcode-mode-isolates.md",{"type":69,"tag":87,"props":8973,"children":8975},{"id":8974},"cross-references",[8976],{"type":82,"value":8977},"Cross-References",{"type":69,"tag":8907,"props":8979,"children":8980},{},[8981,8986],{"type":69,"tag":8911,"props":8982,"children":8983},{},[8984],{"type":82,"value":8985},"See also: ai-core\u002Ftool-calling\u002FSKILL.md -- Code Mode is an alternative to standard tool calling for complex multi-step operations",{"type":69,"tag":8911,"props":8987,"children":8988},{},[8989],{"type":82,"value":8990},"See also: ai-core\u002Fchat-experience\u002FSKILL.md -- Code Mode requires handling custom events in useChat",{"type":69,"tag":8992,"props":8993,"children":8994},"style",{},[8995],{"type":82,"value":8996},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":8998,"total":981},[8999,9007,9022,9037,9050,9064,9078],{"slug":4,"name":4,"fn":5,"description":6,"org":9000,"tags":9001,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9002,9003,9004,9005,9006],{"name":20,"slug":21,"type":15},{"name":23,"slug":24,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":9008,"name":9008,"fn":9009,"description":9010,"org":9011,"tags":9012,"stars":26,"repoUrl":27,"updatedAt":9021},"ai-core","configure TanStack AI agent features","Entry point for TanStack AI skills. Routes to chat-experience, tool-calling, media-generation, structured-outputs, adapter-configuration, ag-ui-protocol, middleware, locks, custom-backend-integration, and debug-logging, plus the skills shipped by companion packages (@tanstack\u002Fai-persistence, @tanstack\u002Fai-code-mode). Use chat() not streamText(), openaiText() not createOpenAI(), toServerSentEventsResponse() not manual SSE, middleware hooks not onEnd callbacks.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9013,9016,9018],{"name":9014,"slug":9015,"type":15},"Agents","agents",{"name":9017,"slug":32,"type":15},"AI",{"name":9019,"slug":9020,"type":15},"Middleware","middleware","2026-07-30T05:26:10.404565",{"slug":9023,"name":9024,"fn":9025,"description":9026,"org":9027,"tags":9028,"stars":26,"repoUrl":27,"updatedAt":9036},"ai-coreadapter-configuration","ai-core\u002Fadapter-configuration","configure AI provider adapters","Provider adapter selection and configuration: openaiText, anthropicText, geminiText, ollamaText, grokText, groqText, openRouterText, bedrockText, openaiCompatible. Per-model type safety with modelOptions, reasoning\u002Fthinking configuration, runtime adapter switching, extendAdapter() for custom models, createModel(). Generic OpenAI-compatible providers (DeepSeek, Together, Fireworks, etc.) via openaiCompatible({ baseURL, apiKey, models }) from @tanstack\u002Fai-openai\u002Fcompatible. API key env vars: OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY\u002FGEMINI_API_KEY, XAI_API_KEY, GROQ_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, BEDROCK_API_KEY (or AWS_BEARER_TOKEN_BEDROCK).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9029,9030,9033,9035],{"name":20,"slug":21,"type":15},{"name":9031,"slug":9032,"type":15},"Configuration","configuration",{"name":9034,"slug":39,"type":15},"LLM",{"name":9,"slug":8,"type":15},"2026-07-16T06:04:17.82075",{"slug":9038,"name":9039,"fn":9040,"description":9041,"org":9042,"tags":9043,"stars":26,"repoUrl":27,"updatedAt":9049},"ai-coreag-ui-protocol","ai-core\u002Fag-ui-protocol","implement TanStack AI streaming protocol","Server-side AG-UI streaming protocol implementation: StreamChunk event types (RUN_STARTED, TEXT_MESSAGE_START\u002FCONTENT\u002FEND, TOOL_CALL_START\u002FARGS\u002FEND, RUN_FINISHED, RUN_ERROR, STEP_STARTED\u002FSTEP_FINISHED, STATE_SNAPSHOT\u002FDELTA, CUSTOM), toServerSentEventsStream() for SSE format, toHttpStream() for NDJSON format. For backends serving AG-UI events without client packages.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9044,9047,9048],{"name":9045,"slug":9046,"type":15},"API Development","api-development",{"name":9034,"slug":39,"type":15},{"name":9,"slug":8,"type":15},"2026-07-16T06:04:10.093367",{"slug":9051,"name":9052,"fn":9053,"description":9054,"org":9055,"tags":9056,"stars":26,"repoUrl":27,"updatedAt":9063},"ai-corechat-experience","ai-core\u002Fchat-experience","implement chat experiences with TanStack AI","End-to-end chat implementation: server endpoint with chat() and toServerSentEventsResponse(), client-side useChat hook with fetchServerSentEvents(), message rendering with UIMessage parts, multimodal content, thinking\u002Freasoning display. Covers streaming states, connection adapters, and message format conversions. NOT Vercel AI SDK — uses chat() not streamText().\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9057,9058,9061,9062],{"name":9045,"slug":9046,"type":15},{"name":9059,"slug":9060,"type":15},"Frontend","frontend",{"name":9034,"slug":39,"type":15},{"name":9,"slug":8,"type":15},"2026-07-30T05:26:11.505241",{"slug":9065,"name":9066,"fn":9067,"description":9068,"org":9069,"tags":9070,"stars":26,"repoUrl":27,"updatedAt":9077},"ai-coreclient-persistence","ai-core\u002Fclient-persistence","implement browser chat persistence for TanStack AI","Browser chat persistence on useChat \u002F ChatClient: localStoragePersistence, sessionStoragePersistence, indexedDBPersistence. Client-authoritative (adapter, full transcript) vs server-authoritative (persistence: true, no client cache). Reload restore, pending interrupts, mid-stream rejoin with delivery durability. Use for SPA reload durability — NOT server history alone. No extra package: the adapters ship in the framework packages.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9071,9072,9073,9076],{"name":9017,"slug":32,"type":15},{"name":9059,"slug":9060,"type":15},{"name":9074,"slug":9075,"type":15},"Persistence","persistence",{"name":9,"slug":8,"type":15},"2026-07-30T05:53:35.503176",{"slug":9079,"name":9080,"fn":9081,"description":9082,"org":9083,"tags":9084,"stars":26,"repoUrl":27,"updatedAt":9091},"ai-corecustom-backend-integration","ai-core\u002Fcustom-backend-integration","integrate custom backends with TanStack AI","Connect useChat to a non-TanStack-AI backend through custom connection adapters. ConnectConnectionAdapter (single async iterable) vs SubscribeConnectionAdapter (separate subscribe\u002Fsend). Customize fetchServerSentEvents() and fetchHttpStream() with auth headers, custom URLs, and request options. Import from framework package, not @tanstack\u002Fai-client.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9085,9086,9087,9090],{"name":9017,"slug":32,"type":15},{"name":9045,"slug":9046,"type":15},{"name":9088,"slug":9089,"type":15},"Backend","backend",{"name":9,"slug":8,"type":15},"2026-07-17T06:06:39.855351",{"items":9093,"total":9231},[9094,9108,9120,9132,9146,9158,9168,9178,9191,9201,9212,9222],{"slug":9095,"name":9095,"fn":9096,"description":9097,"org":9098,"tags":9099,"stars":9105,"repoUrl":9106,"updatedAt":9107},"aggregation","perform data aggregation in TanStack Table","Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9100,9103,9104],{"name":9101,"slug":9102,"type":15},"Data Analysis","data-analysis",{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":9109,"name":9109,"fn":9110,"description":9111,"org":9112,"tags":9113,"stars":9105,"repoUrl":9106,"updatedAt":9119},"api-not-found","diagnose TanStack Table API errors","Diagnose missing TanStack Table v9 exports, options, state slices, and instance methods. Load before inventing an API when code sees a type error, undefined feature method, absent object key, adapter mismatch, or v8-shaped example.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9114,9117,9118],{"name":9115,"slug":9116,"type":15},"Debugging","debugging",{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},"2026-07-30T05:26:05.418735",{"slug":9121,"name":9121,"fn":9122,"description":9123,"org":9124,"tags":9125,"stars":9105,"repoUrl":9106,"updatedAt":9131},"cell-selection","select rectangular cell ranges in tables","Select rectangular cell ranges with cellSelectionFeature: two-corner range state keyed by row and column id, mousedown\u002Fmouseenter handlers, selection edges, render-order resolution under pinning, and autoResetCellSelection. Load when ranges widen unexpectedly after sorting or column reordering, when a drag re-renders the whole table, or when building copy-to-clipboard from a selection.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9126,9127,9128],{"name":9101,"slug":9102,"type":15},{"name":9,"slug":8,"type":15},{"name":9129,"slug":9130,"type":15},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":9133,"name":9133,"fn":9134,"description":9135,"org":9136,"tags":9137,"stars":9105,"repoUrl":9106,"updatedAt":9145},"client-vs-server","manage TanStack Table data pipelines","Choose client or server ownership for filtering, grouping, sorting, expanding, and pagination in TanStack Table v9. Load for manual* flags, mixed pipelines, server counts, or deciding which dataset each row-model stage receives.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9138,9141,9142,9144],{"name":9139,"slug":9140,"type":15},"Data Pipeline","data-pipeline",{"name":9059,"slug":9060,"type":15},{"name":2255,"slug":9143,"type":15},"performance",{"name":9,"slug":8,"type":15},"2026-07-30T05:25:45.400104",{"slug":9147,"name":9147,"fn":9148,"description":9149,"org":9150,"tags":9151,"stars":9105,"repoUrl":9106,"updatedAt":9157},"column-faceting","build faceted filter UIs","Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9152,9155,9156],{"name":9153,"slug":9154,"type":15},"Data Visualization","data-visualization",{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},"2026-07-30T05:25:41.397257",{"slug":9159,"name":9159,"fn":9160,"description":9161,"org":9162,"tags":9163,"stars":9105,"repoUrl":9106,"updatedAt":9167},"column-filtering","implement column filtering in TanStack Table","Filter columns with columnFilteringFeature, filteredRowModel, filterFns, filterMeta, nested-row direction, and manualFiltering. Load for accessor compatibility, controlled filter updaters, fuzzy metadata, or client\u002Fserver ownership.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9164,9165,9166],{"name":9101,"slug":9102,"type":15},{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},"2026-07-30T05:25:53.391632",{"slug":9169,"name":9169,"fn":9170,"description":9171,"org":9172,"tags":9173,"stars":9105,"repoUrl":9106,"updatedAt":9177},"column-ordering","manage TanStack Table column ordering","Control TanStack Table v9 leaf columnOrder with stable IDs while accounting for pinning regions, visibility, and groupedColumnMode precedence. Load for drag-and-drop columns or rendered order that differs from state.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9174,9175,9176],{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},{"name":9129,"slug":9130,"type":15},"2026-07-30T05:26:03.37801",{"slug":9179,"name":9179,"fn":9180,"description":9181,"org":9182,"tags":9183,"stars":9105,"repoUrl":9106,"updatedAt":9190},"column-pinning","configure column pinning in TanStack Table","Pin columns into logical start, center, and end regions with columnPinningFeature and renderer-owned sticky CSS. Load for RTL offsets, z-index, backgrounds, overflow, widths, gaps, or overlaps.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9184,9187,9188,9189],{"name":9185,"slug":9186,"type":15},"CSS","css",{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},{"name":9129,"slug":9130,"type":15},"2026-07-30T05:25:55.377366",{"slug":9192,"name":9192,"fn":9193,"description":9194,"org":9195,"tags":9196,"stars":9105,"repoUrl":9106,"updatedAt":9200},"column-resizing","implement column resizing in TanStack Table","Wire columnResizingFeature, header.getResizeHandler, resize mode and direction, pointer or touch events, and performant CSS-variable updates. Load when resize state changes but widths do not, or large tables resize slowly.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9197,9198,9199],{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},{"name":9129,"slug":9130,"type":15},"2026-07-30T05:25:51.400011",{"slug":9202,"name":9202,"fn":9203,"description":9204,"org":9205,"tags":9206,"stars":9105,"repoUrl":9106,"updatedAt":9211},"column-sizing","configure column sizing in TanStack Table","Use columnSizingFeature numeric size, minSize, maxSize, getSize, getStart, getAfter, and total-size APIs in table, grid, or flex CSS. Load for auto or percentage misconceptions and sizing\u002Fpinning layout mismatch.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9207,9208,9209,9210],{"name":9185,"slug":9186,"type":15},{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},{"name":9129,"slug":9130,"type":15},"2026-07-30T05:25:48.703799",{"slug":9213,"name":9213,"fn":9214,"description":9215,"org":9216,"tags":9217,"stars":9105,"repoUrl":9106,"updatedAt":9221},"column-visibility","manage column visibility in TanStack Table","Hide columns with columnVisibilityFeature while rendering visibility-aware header, column, and cell collections. Load when hidden columns remain in the DOM, false-versus-absent state is confused, or enableHiding is misunderstood.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9218,9219,9220],{"name":9059,"slug":9060,"type":15},{"name":9,"slug":8,"type":15},{"name":9129,"slug":9130,"type":15},"2026-07-30T05:25:47.367943",{"slug":56,"name":56,"fn":9223,"description":9224,"org":9225,"tags":9226,"stars":9105,"repoUrl":9106,"updatedAt":9230},"build data grids with TanStack Table","Use TanStack Table v9 as a headless data-grid state and row-processing engine. Load for first-table architecture, stable data and columns, row numbering with getDisplayIndex, semantic rendering, framework adapter choice, or deciding what Table owns versus the renderer.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[9227,9228,9229],{"name":9101,"slug":9102,"type":15},{"name":9059,"slug":9060,"type":15},{"name":9129,"slug":9130,"type":15},"2026-07-30T05:25:52.366295",125]