[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-ai-persistencestores":3,"mdc-2zbykj-key":51,"related-org-tanstack-ai-persistencestores":3765,"related-repo-tanstack-ai-persistencestores":3909},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":12,"stars":21,"repoUrl":22,"updatedAt":23,"license":24,"forks":25,"topics":26,"repo":46,"sourceUrl":49,"mdContent":50},"ai-persistencestores","ai-persistence\u002Fstores","implement persistence store contracts for TanStack AI","Implement the MessageStore, RunStore, InterruptStore, MetadataStore contracts for @tanstack\u002Fai-persistence against any database. defineAIPersistence, composePersistence overrides, critical invariants (full-replace saveThread, insert-if-absent createOrResume and interrupt create), authorize thread access, runPersistenceConformance testkit. Use whenever you need server persistence — the package ships contracts, not a backend for your database.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},"tanstack","TanStack","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftanstack.png",[13,17,20],{"name":14,"slug":15,"type":16},"Database","database","tag",{"name":18,"slug":19,"type":16},"Persistence","persistence",{"name":10,"slug":9,"type":16},2884,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai","2026-07-30T05:53:31.017951",null,269,[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,9,42,43,44,45],"ai","ai-agents","ai-sdk","anthropic","chatbot","function-calling","gemini","generative-ai","llm","multimodal","openai","react","solidjs","streaming","svelte","tool-calling","typescript","typescript-sdk","vue",{"repoUrl":22,"stars":21,"forks":25,"topics":47,"description":48},[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,9,42,43,44,45],"🤖 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-persistence\u002Fskills\u002Fai-persistence\u002Fstores","---\nname: ai-persistence\u002Fstores\ndescription: >\n  Implement the MessageStore, RunStore, InterruptStore, MetadataStore contracts\n  for @tanstack\u002Fai-persistence against any database. defineAIPersistence,\n  composePersistence overrides, critical invariants (full-replace saveThread,\n  insert-if-absent createOrResume and interrupt create), authorize thread\n  access, runPersistenceConformance testkit. Use whenever you need server\n  persistence — the package ships contracts, not a backend for your database.\ntype: sub-skill\nlibrary: tanstack-ai\nlibrary_version: '0.0.0'\nsources:\n  - 'TanStack\u002Fai:docs\u002Fpersistence\u002Fbuild-your-own-adapter.md'\n  - 'TanStack\u002Fai:docs\u002Fpersistence\u002Fcontrols.md'\n  - 'TanStack\u002Fai:packages\u002Fai-persistence\u002Fsrc\u002Ftypes.ts'\n---\n\n# Persistence Stores\n\n> Builds on **ai-persistence** and **ai-persistence\u002Fserver**.\n\n`@tanstack\u002Fai-persistence` ships **contracts**, not a backend for your\ndatabase. An adapter is an object with a `stores` map; implement the stores you\nneed against whatever you already run and hand the result to\n`withPersistence`. The core never inspects your tables, so the schema is yours.\n\nUse `memoryPersistence()` for dev and tests. Everything durable is an adapter\nyou write. This skill is the contract reference; the per-stack recipes that\nwrite a `chat-persistence.ts` into an app are\n`ai-persistence\u002Fbuild-{drizzle,prisma,cloudflare,custom}-adapter`, and\na complete `node:sqlite` implementation lives in\n`examples\u002Fts-react-chat\u002Fsrc\u002Flib\u002Fsqlite-persistence.ts`.\n\n## Choose a shape\n\n```ts\nimport { defineAIPersistence } from '@tanstack\u002Fai-persistence'\nimport type { ChatWithInterruptsPersistence } from '@tanstack\u002Fai-persistence'\n\n\u002F\u002F Sparse is fine — only implement what you need.\nexport const persistence: ChatWithInterruptsPersistence = defineAIPersistence({\n  stores: {\n    messages, \u002F\u002F required for withPersistence \u002F reconstructChat\n    runs, \u002F\u002F required if you have interrupts\n    interrupts,\n    \u002F\u002F metadata optional\n  },\n})\n```\n\n| Shape                           | Contents                                         |\n| ------------------------------- | ------------------------------------------------ |\n| `ChatTranscriptPersistence`     | `messages` (+ optional runs\u002Finterrupts\u002Fmetadata) |\n| `ChatWithInterruptsPersistence` | `messages` + `runs` + `interrupts`               |\n| `ChatPersistence`               | all four chat stores                             |\n\n`defineAIPersistence` preserves exact keys and rejects unknown keys at runtime.\n\n**Annotate your factory with a named shape.** Bare `AIPersistence` is the\nall-optional sparse bag, so `withPersistence` and `reconstructChat` reject it\n(`stores.messages` is possibly `undefined`). This is the single most common\nmistake when writing an adapter.\n\n**`stores` accepts exactly four keys** — `messages`, `runs`, `interrupts`,\n`metadata`. Anything else (notably `locks` or sandbox instance maps) throws\n`Unknown AIPersistence store key` at runtime and fails to type-check. Locks:\n**ai-core\u002Flocks** \u002F `@tanstack\u002Fai\u002Flocks`. Sandbox instance resume:\n`@tanstack\u002Fai-sandbox`.\n\n## Contracts and invariants\n\n### `MessageStore`\n\n```ts\ninterface MessageStore {\n  loadThread(threadId: string): Promise\u003CArray\u003CModelMessage>>\n  saveThread(threadId: string, messages: Array\u003CModelMessage>): Promise\u003Cvoid>\n}\n```\n\n- `loadThread` → `[]` for unknown threads (never `null`).\n- `saveThread` is a **full overwrite**, not append. A one-message payload wipes history.\n\n### `RunStore`\n\n```ts\ninterface RunStore {\n  createOrResume(input: {\n    runId: string\n    threadId: string\n    status?: RunStatus\n    startedAt: number\n  }): Promise\u003CRunRecord>\n  update(\n    runId: string,\n    patch: Partial\u003C\n      Pick\u003CRunRecord, 'status' | 'finishedAt' | 'error' | 'usage'>\n    >,\n  ): Promise\u003Cvoid>\n  get(runId: string): Promise\u003CRunRecord | null>\n  findActiveRun(threadId: string): Promise\u003CRunRecord | null>\n}\n```\n\n- **`createOrResume`**: if `runId` exists, return it **unchanged** (ignore new\n  fields). Idempotent retries \u002F resume depend on this.\n- **`update`**: missing `runId` is a **no-op** (do not throw, do not insert).\n- **`findActiveRun`**: latest `'running'` for `threadId` (max `startedAt`);\n  this is what `reconstructChat` uses to reconnect a reloading client without a\n  client-held run id. Stub it out and reconnect silently stops working — `null`\n  is also the correct answer for an idle thread, so nothing can detect the\n  difference.\n\nEvery method is **required**. Capability tiers live at the store level (omit\n`runs` and declare `ChatTranscriptStores`), never at the method level.\n\n### `InterruptStore`\n\n```ts\ninterface InterruptStore {\n  create(record: Omit\u003CInterruptRecord, 'status' | 'resolvedAt'>): Promise\u003Cvoid>\n  resolve(interruptId: string, response?: unknown): Promise\u003Cvoid>\n  cancel(interruptId: string): Promise\u003Cvoid>\n  get(interruptId: string): Promise\u003CInterruptRecord | null>\n  list(threadId: string): Promise\u003CArray\u003CInterruptRecord>>\n  listPending(threadId: string): Promise\u003CArray\u003CInterruptRecord>>\n  listByRun(runId: string): Promise\u003CArray\u003CInterruptRecord>>\n  listPendingByRun(runId: string): Promise\u003CArray\u003CInterruptRecord>>\n}\n```\n\n- `create` always births `'pending'`; **insert-if-absent** on `interruptId`\n  (never clobber resolved back to pending).\n- All `list*` ordered by `requestedAt` ascending.\n- Requires a `runs` store when used with chat persistence.\n\n### `MetadataStore`\n\n```ts\ninterface MetadataStore {\n  get(namespace: string, key: string): Promise\u003Cunknown | null>\n  set(namespace: string, key: string, value: unknown): Promise\u003Cvoid>\n  delete(namespace: string, key: string): Promise\u003Cvoid>\n}\n```\n\n- The first argument is an **app-defined namespace string**, not the `Scope`\n  identity type — despite SQL backends conventionally naming the column\n  `scope`.\n- Identity is **two fields** `(namespace, key)` — do not join with `:`\n  (`('a:b','c')` and `('a','b:c')` must stay distinct).\n- Stored `null` is type-indistinguishable from absence; wrap if you must\n  persist real null (`{ value: null }`).\n- SQL backends usually reject nullish `set` (NOT NULL JSON columns) with a\n  clear `TypeError` — match that or document your semantics.\n\n## Timestamp convention\n\nStore _records_ (`RunRecord`, `InterruptRecord`) speak **epoch milliseconds**\n(`number`). Wire\u002Fresult references that leave the persistence layer speak\n**ISO-8601 strings**; the middleware converts at the boundary. Do not mix the\ntwo on one field.\n\n## Minimal message store example\n\nType each store with its `define*Store` helper (`defineMessageStore`,\n`defineRunStore`, `defineInterruptStore`, `defineMetadataStore`): pass the object\nliteral and get autocomplete + contract checking inline, with no `: MessageStore`\nannotation. The result composes into `defineAIPersistence` with exact presence.\n\n```ts\nimport { defineMessageStore } from '@tanstack\u002Fai-persistence'\nimport type { ModelMessage } from '@tanstack\u002Fai'\n\nconst threads = new Map\u003Cstring, Array\u003CModelMessage>>()\n\nexport const messages = defineMessageStore({\n  async loadThread(threadId) {\n    return [...(threads.get(threadId) ?? [])]\n  },\n  async saveThread(threadId, next) {\n    threads.set(threadId, [...next])\n  },\n})\n```\n\nFor durable DBs, preserve the same semantics with upserts \u002F full-row replace.\n\n## Adopt part of it\n\nYou rarely need all four stores in the same system. Implement the ones you own\nand fill the rest from another base with `composePersistence`:\n\n```ts\nimport { composePersistence, memoryPersistence } from '@tanstack\u002Fai-persistence'\nimport { messages, runs } from '.\u002Fmy-postgres-stores'\n\nexport const persistence = composePersistence(memoryPersistence(), {\n  overrides: { messages, runs },\n})\n```\n\nOnly listed keys move; others stay on the base. Pass `false` to drop a store.\nThere is **no cross-store transaction** — if `messages` lives in Postgres and\n`interrupts` in Redis, a write touching both is two writes. The store\ninvariants (idempotent `createOrResume`, insert-if-absent `create`) are exactly\nwhat make those retries safe.\n\n`composePersistence` accepts the four state keys. Locks and sandbox instance\nmaps are not composable here.\n\n## Map onto an existing schema\n\n- **Your column names, your types.** Name columns anything; use `jsonb`,\n  `timestamptz`, whatever — convert in the row mapper. The record shape the\n  methods return is fixed; how you store it is not.\n- **Extra columns are fine.** Add `user_id`, audit columns, a tenant id. Keep\n  them nullable or defaulted so the store's inserts still succeed. The stores\n  never read or write columns they do not know about.\n- **Omit absent optionals** in row mappers (`...(row.error != null ? { error: row.error } : {})`)\n  so records compare cleanly.\n\n## Authorization\n\nStore methods take bare `threadId`s. **Authorize at the route** before\n`loadThread` \u002F `saveThread` \u002F `reconstructChat({ authorize })`. Derive user\nidentity from session, not the client body alone.\n\n## Conformance tests (required)\n\n```ts\nimport { runPersistenceConformance } from '@tanstack\u002Fai-persistence\u002Ftestkit'\nimport { myPersistence } from '..\u002Fsrc\u002Fpersistence'\n\nrunPersistenceConformance('my-backend', () => myPersistence())\n\n\u002F\u002F Declare intentional omissions — only the four state stores are valid keys:\n\u002F\u002F runPersistenceConformance('msgs-only', () => p, {\n\u002F\u002F   skip: ['runs', 'interrupts', 'metadata'],\n\u002F\u002F })\n```\n\nThe testkit is the compatibility gate: round-trips, rich message shapes,\nempty-thread `[]`, `createOrResume` idempotency, interrupt insert-if-absent,\nlist ordering, composite-key non-aliasing. A missing store that is not listed\nin `skip` fails loudly.\n\n`skip` accepts only `'messages' | 'runs' | 'interrupts' | 'metadata'`. **Do not\npass `'locks'`** — it is not a state store and the suite does not cover it.\n\nReference implementation: `memoryPersistence()` in `@tanstack\u002Fai-persistence`.\n\n## Common mistakes\n\n### CRITICAL: Append-only `saveThread`\n\nBreaks the authoritative-history contract.\n\n### CRITICAL: `createOrResume` overwriting existing runs\n\nBreaks safe resume \u002F double-submit.\n\n### CRITICAL: Interrupt `create` upserting to pending\n\nCan resurrect a resolved approval.\n\n### HIGH: Returning bare `AIPersistence` from the factory\n\n`withPersistence` rejects it. Annotate a named shape.\n\n### HIGH: `list*` without stable `requestedAt` order\n\nMiddleware and tests assume ascending order.\n\n### HIGH: Skipping the testkit\n\nSilent semantic drift shows up as stuck approvals or wiped history in prod.\n\n## Cross-references\n\n- **ai-persistence\u002Fserver** — when middleware calls each store\n- **ai-persistence\u002Fbuild-drizzle-adapter** \u002F **-prisma-** \u002F **-cloudflare-** \u002F **-custom-** — per-stack recipes\n- **ai-core\u002Flocks** — not a state store\n",{"data":52,"body":60},{"name":5,"description":7,"type":53,"library":54,"library_version":55,"sources":56},"sub-skill","tanstack-ai","0.0.0",[57,58,59],"TanStack\u002Fai:docs\u002Fpersistence\u002Fbuild-your-own-adapter.md","TanStack\u002Fai:docs\u002Fpersistence\u002Fcontrols.md","TanStack\u002Fai:packages\u002Fai-persistence\u002Fsrc\u002Ftypes.ts",{"type":61,"children":62},"root",[63,72,97,132,176,183,457,560,571,619,699,705,716,882,932,942,1376,1485,1512,1522,2006,2075,2085,2322,2434,2440,2487,2493,2550,2940,2945,2951,2963,3158,3206,3216,3222,3286,3292,3331,3337,3512,3538,3569,3587,3593,3604,3609,3622,3627,3640,3645,3658,3668,3688,3693,3699,3704,3710,3759],{"type":64,"tag":65,"props":66,"children":68},"element","h1",{"id":67},"persistence-stores",[69],{"type":70,"value":71},"text","Persistence Stores",{"type":64,"tag":73,"props":74,"children":75},"blockquote",{},[76],{"type":64,"tag":77,"props":78,"children":79},"p",{},[80,82,88,90,95],{"type":70,"value":81},"Builds on ",{"type":64,"tag":83,"props":84,"children":85},"strong",{},[86],{"type":70,"value":87},"ai-persistence",{"type":70,"value":89}," and ",{"type":64,"tag":83,"props":91,"children":92},{},[93],{"type":70,"value":94},"ai-persistence\u002Fserver",{"type":70,"value":96},".",{"type":64,"tag":77,"props":98,"children":99},{},[100,107,109,114,116,122,124,130],{"type":64,"tag":101,"props":102,"children":104},"code",{"className":103},[],[105],{"type":70,"value":106},"@tanstack\u002Fai-persistence",{"type":70,"value":108}," ships ",{"type":64,"tag":83,"props":110,"children":111},{},[112],{"type":70,"value":113},"contracts",{"type":70,"value":115},", not a backend for your\ndatabase. An adapter is an object with a ",{"type":64,"tag":101,"props":117,"children":119},{"className":118},[],[120],{"type":70,"value":121},"stores",{"type":70,"value":123}," map; implement the stores you\nneed against whatever you already run and hand the result to\n",{"type":64,"tag":101,"props":125,"children":127},{"className":126},[],[128],{"type":70,"value":129},"withPersistence",{"type":70,"value":131},". The core never inspects your tables, so the schema is yours.",{"type":64,"tag":77,"props":133,"children":134},{},[135,137,143,145,151,153,159,161,167,169,175],{"type":70,"value":136},"Use ",{"type":64,"tag":101,"props":138,"children":140},{"className":139},[],[141],{"type":70,"value":142},"memoryPersistence()",{"type":70,"value":144}," for dev and tests. Everything durable is an adapter\nyou write. This skill is the contract reference; the per-stack recipes that\nwrite a ",{"type":64,"tag":101,"props":146,"children":148},{"className":147},[],[149],{"type":70,"value":150},"chat-persistence.ts",{"type":70,"value":152}," into an app are\n",{"type":64,"tag":101,"props":154,"children":156},{"className":155},[],[157],{"type":70,"value":158},"ai-persistence\u002Fbuild-{drizzle,prisma,cloudflare,custom}-adapter",{"type":70,"value":160},", and\na complete ",{"type":64,"tag":101,"props":162,"children":164},{"className":163},[],[165],{"type":70,"value":166},"node:sqlite",{"type":70,"value":168}," implementation lives in\n",{"type":64,"tag":101,"props":170,"children":172},{"className":171},[],[173],{"type":70,"value":174},"examples\u002Fts-react-chat\u002Fsrc\u002Flib\u002Fsqlite-persistence.ts",{"type":70,"value":96},{"type":64,"tag":177,"props":178,"children":180},"h2",{"id":179},"choose-a-shape",[181],{"type":70,"value":182},"Choose a shape",{"type":64,"tag":184,"props":185,"children":190},"pre",{"className":186,"code":187,"language":188,"meta":189,"style":189},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineAIPersistence } from '@tanstack\u002Fai-persistence'\nimport type { ChatWithInterruptsPersistence } from '@tanstack\u002Fai-persistence'\n\n\u002F\u002F Sparse is fine — only implement what you need.\nexport const persistence: ChatWithInterruptsPersistence = defineAIPersistence({\n  stores: {\n    messages, \u002F\u002F required for withPersistence \u002F reconstructChat\n    runs, \u002F\u002F required if you have interrupts\n    interrupts,\n    \u002F\u002F metadata optional\n  },\n})\n","ts","",[191],{"type":64,"tag":101,"props":192,"children":193},{"__ignoreMap":189},[194,243,285,295,305,355,374,393,411,425,434,443],{"type":64,"tag":195,"props":196,"children":199},"span",{"class":197,"line":198},"line",1,[200,206,212,218,223,228,233,238],{"type":64,"tag":195,"props":201,"children":203},{"style":202},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[204],{"type":70,"value":205},"import",{"type":64,"tag":195,"props":207,"children":209},{"style":208},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[210],{"type":70,"value":211}," {",{"type":64,"tag":195,"props":213,"children":215},{"style":214},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[216],{"type":70,"value":217}," defineAIPersistence",{"type":64,"tag":195,"props":219,"children":220},{"style":208},[221],{"type":70,"value":222}," }",{"type":64,"tag":195,"props":224,"children":225},{"style":202},[226],{"type":70,"value":227}," from",{"type":64,"tag":195,"props":229,"children":230},{"style":208},[231],{"type":70,"value":232}," '",{"type":64,"tag":195,"props":234,"children":236},{"style":235},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[237],{"type":70,"value":106},{"type":64,"tag":195,"props":239,"children":240},{"style":208},[241],{"type":70,"value":242},"'\n",{"type":64,"tag":195,"props":244,"children":246},{"class":197,"line":245},2,[247,251,256,260,265,269,273,277,281],{"type":64,"tag":195,"props":248,"children":249},{"style":202},[250],{"type":70,"value":205},{"type":64,"tag":195,"props":252,"children":253},{"style":202},[254],{"type":70,"value":255}," type",{"type":64,"tag":195,"props":257,"children":258},{"style":208},[259],{"type":70,"value":211},{"type":64,"tag":195,"props":261,"children":262},{"style":214},[263],{"type":70,"value":264}," ChatWithInterruptsPersistence",{"type":64,"tag":195,"props":266,"children":267},{"style":208},[268],{"type":70,"value":222},{"type":64,"tag":195,"props":270,"children":271},{"style":202},[272],{"type":70,"value":227},{"type":64,"tag":195,"props":274,"children":275},{"style":208},[276],{"type":70,"value":232},{"type":64,"tag":195,"props":278,"children":279},{"style":235},[280],{"type":70,"value":106},{"type":64,"tag":195,"props":282,"children":283},{"style":208},[284],{"type":70,"value":242},{"type":64,"tag":195,"props":286,"children":288},{"class":197,"line":287},3,[289],{"type":64,"tag":195,"props":290,"children":292},{"emptyLinePlaceholder":291},true,[293],{"type":70,"value":294},"\n",{"type":64,"tag":195,"props":296,"children":298},{"class":197,"line":297},4,[299],{"type":64,"tag":195,"props":300,"children":302},{"style":301},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[303],{"type":70,"value":304},"\u002F\u002F Sparse is fine — only implement what you need.\n",{"type":64,"tag":195,"props":306,"children":308},{"class":197,"line":307},5,[309,314,320,325,330,335,340,345,350],{"type":64,"tag":195,"props":310,"children":311},{"style":202},[312],{"type":70,"value":313},"export",{"type":64,"tag":195,"props":315,"children":317},{"style":316},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[318],{"type":70,"value":319}," const",{"type":64,"tag":195,"props":321,"children":322},{"style":214},[323],{"type":70,"value":324}," persistence",{"type":64,"tag":195,"props":326,"children":327},{"style":208},[328],{"type":70,"value":329},":",{"type":64,"tag":195,"props":331,"children":333},{"style":332},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[334],{"type":70,"value":264},{"type":64,"tag":195,"props":336,"children":337},{"style":208},[338],{"type":70,"value":339}," =",{"type":64,"tag":195,"props":341,"children":343},{"style":342},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[344],{"type":70,"value":217},{"type":64,"tag":195,"props":346,"children":347},{"style":214},[348],{"type":70,"value":349},"(",{"type":64,"tag":195,"props":351,"children":352},{"style":208},[353],{"type":70,"value":354},"{\n",{"type":64,"tag":195,"props":356,"children":358},{"class":197,"line":357},6,[359,365,369],{"type":64,"tag":195,"props":360,"children":362},{"style":361},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[363],{"type":70,"value":364},"  stores",{"type":64,"tag":195,"props":366,"children":367},{"style":208},[368],{"type":70,"value":329},{"type":64,"tag":195,"props":370,"children":371},{"style":208},[372],{"type":70,"value":373}," {\n",{"type":64,"tag":195,"props":375,"children":377},{"class":197,"line":376},7,[378,383,388],{"type":64,"tag":195,"props":379,"children":380},{"style":214},[381],{"type":70,"value":382},"    messages",{"type":64,"tag":195,"props":384,"children":385},{"style":208},[386],{"type":70,"value":387},",",{"type":64,"tag":195,"props":389,"children":390},{"style":301},[391],{"type":70,"value":392}," \u002F\u002F required for withPersistence \u002F reconstructChat\n",{"type":64,"tag":195,"props":394,"children":396},{"class":197,"line":395},8,[397,402,406],{"type":64,"tag":195,"props":398,"children":399},{"style":214},[400],{"type":70,"value":401},"    runs",{"type":64,"tag":195,"props":403,"children":404},{"style":208},[405],{"type":70,"value":387},{"type":64,"tag":195,"props":407,"children":408},{"style":301},[409],{"type":70,"value":410}," \u002F\u002F required if you have interrupts\n",{"type":64,"tag":195,"props":412,"children":414},{"class":197,"line":413},9,[415,420],{"type":64,"tag":195,"props":416,"children":417},{"style":214},[418],{"type":70,"value":419},"    interrupts",{"type":64,"tag":195,"props":421,"children":422},{"style":208},[423],{"type":70,"value":424},",\n",{"type":64,"tag":195,"props":426,"children":428},{"class":197,"line":427},10,[429],{"type":64,"tag":195,"props":430,"children":431},{"style":301},[432],{"type":70,"value":433},"    \u002F\u002F metadata optional\n",{"type":64,"tag":195,"props":435,"children":437},{"class":197,"line":436},11,[438],{"type":64,"tag":195,"props":439,"children":440},{"style":208},[441],{"type":70,"value":442},"  },\n",{"type":64,"tag":195,"props":444,"children":446},{"class":197,"line":445},12,[447,452],{"type":64,"tag":195,"props":448,"children":449},{"style":208},[450],{"type":70,"value":451},"}",{"type":64,"tag":195,"props":453,"children":454},{"style":214},[455],{"type":70,"value":456},")\n",{"type":64,"tag":458,"props":459,"children":460},"table",{},[461,480],{"type":64,"tag":462,"props":463,"children":464},"thead",{},[465],{"type":64,"tag":466,"props":467,"children":468},"tr",{},[469,475],{"type":64,"tag":470,"props":471,"children":472},"th",{},[473],{"type":70,"value":474},"Shape",{"type":64,"tag":470,"props":476,"children":477},{},[478],{"type":70,"value":479},"Contents",{"type":64,"tag":481,"props":482,"children":483},"tbody",{},[484,508,543],{"type":64,"tag":466,"props":485,"children":486},{},[487,497],{"type":64,"tag":488,"props":489,"children":490},"td",{},[491],{"type":64,"tag":101,"props":492,"children":494},{"className":493},[],[495],{"type":70,"value":496},"ChatTranscriptPersistence",{"type":64,"tag":488,"props":498,"children":499},{},[500,506],{"type":64,"tag":101,"props":501,"children":503},{"className":502},[],[504],{"type":70,"value":505},"messages",{"type":70,"value":507}," (+ optional runs\u002Finterrupts\u002Fmetadata)",{"type":64,"tag":466,"props":509,"children":510},{},[511,520],{"type":64,"tag":488,"props":512,"children":513},{},[514],{"type":64,"tag":101,"props":515,"children":517},{"className":516},[],[518],{"type":70,"value":519},"ChatWithInterruptsPersistence",{"type":64,"tag":488,"props":521,"children":522},{},[523,528,530,536,537],{"type":64,"tag":101,"props":524,"children":526},{"className":525},[],[527],{"type":70,"value":505},{"type":70,"value":529}," + ",{"type":64,"tag":101,"props":531,"children":533},{"className":532},[],[534],{"type":70,"value":535},"runs",{"type":70,"value":529},{"type":64,"tag":101,"props":538,"children":540},{"className":539},[],[541],{"type":70,"value":542},"interrupts",{"type":64,"tag":466,"props":544,"children":545},{},[546,555],{"type":64,"tag":488,"props":547,"children":548},{},[549],{"type":64,"tag":101,"props":550,"children":552},{"className":551},[],[553],{"type":70,"value":554},"ChatPersistence",{"type":64,"tag":488,"props":556,"children":557},{},[558],{"type":70,"value":559},"all four chat stores",{"type":64,"tag":77,"props":561,"children":562},{},[563,569],{"type":64,"tag":101,"props":564,"children":566},{"className":565},[],[567],{"type":70,"value":568},"defineAIPersistence",{"type":70,"value":570}," preserves exact keys and rejects unknown keys at runtime.",{"type":64,"tag":77,"props":572,"children":573},{},[574,579,581,587,589,594,595,601,603,609,611,617],{"type":64,"tag":83,"props":575,"children":576},{},[577],{"type":70,"value":578},"Annotate your factory with a named shape.",{"type":70,"value":580}," Bare ",{"type":64,"tag":101,"props":582,"children":584},{"className":583},[],[585],{"type":70,"value":586},"AIPersistence",{"type":70,"value":588}," is the\nall-optional sparse bag, so ",{"type":64,"tag":101,"props":590,"children":592},{"className":591},[],[593],{"type":70,"value":129},{"type":70,"value":89},{"type":64,"tag":101,"props":596,"children":598},{"className":597},[],[599],{"type":70,"value":600},"reconstructChat",{"type":70,"value":602}," reject it\n(",{"type":64,"tag":101,"props":604,"children":606},{"className":605},[],[607],{"type":70,"value":608},"stores.messages",{"type":70,"value":610}," is possibly ",{"type":64,"tag":101,"props":612,"children":614},{"className":613},[],[615],{"type":70,"value":616},"undefined",{"type":70,"value":618},"). This is the single most common\nmistake when writing an adapter.",{"type":64,"tag":77,"props":620,"children":621},{},[622,632,634,639,641,646,647,652,653,659,661,667,669,675,677,682,684,690,692,698],{"type":64,"tag":83,"props":623,"children":624},{},[625,630],{"type":64,"tag":101,"props":626,"children":628},{"className":627},[],[629],{"type":70,"value":121},{"type":70,"value":631}," accepts exactly four keys",{"type":70,"value":633}," — ",{"type":64,"tag":101,"props":635,"children":637},{"className":636},[],[638],{"type":70,"value":505},{"type":70,"value":640},", ",{"type":64,"tag":101,"props":642,"children":644},{"className":643},[],[645],{"type":70,"value":535},{"type":70,"value":640},{"type":64,"tag":101,"props":648,"children":650},{"className":649},[],[651],{"type":70,"value":542},{"type":70,"value":424},{"type":64,"tag":101,"props":654,"children":656},{"className":655},[],[657],{"type":70,"value":658},"metadata",{"type":70,"value":660},". Anything else (notably ",{"type":64,"tag":101,"props":662,"children":664},{"className":663},[],[665],{"type":70,"value":666},"locks",{"type":70,"value":668}," or sandbox instance maps) throws\n",{"type":64,"tag":101,"props":670,"children":672},{"className":671},[],[673],{"type":70,"value":674},"Unknown AIPersistence store key",{"type":70,"value":676}," at runtime and fails to type-check. Locks:\n",{"type":64,"tag":83,"props":678,"children":679},{},[680],{"type":70,"value":681},"ai-core\u002Flocks",{"type":70,"value":683}," \u002F ",{"type":64,"tag":101,"props":685,"children":687},{"className":686},[],[688],{"type":70,"value":689},"@tanstack\u002Fai\u002Flocks",{"type":70,"value":691},". Sandbox instance resume:\n",{"type":64,"tag":101,"props":693,"children":695},{"className":694},[],[696],{"type":70,"value":697},"@tanstack\u002Fai-sandbox",{"type":70,"value":96},{"type":64,"tag":177,"props":700,"children":702},{"id":701},"contracts-and-invariants",[703],{"type":70,"value":704},"Contracts and invariants",{"type":64,"tag":706,"props":707,"children":709},"h3",{"id":708},"messagestore",[710],{"type":64,"tag":101,"props":711,"children":713},{"className":712},[],[714],{"type":70,"value":715},"MessageStore",{"type":64,"tag":184,"props":717,"children":719},{"className":186,"code":718,"language":188,"meta":189,"style":189},"interface MessageStore {\n  loadThread(threadId: string): Promise\u003CArray\u003CModelMessage>>\n  saveThread(threadId: string, messages: Array\u003CModelMessage>): Promise\u003Cvoid>\n}\n",[720],{"type":64,"tag":101,"props":721,"children":722},{"__ignoreMap":189},[723,740,801,874],{"type":64,"tag":195,"props":724,"children":725},{"class":197,"line":198},[726,731,736],{"type":64,"tag":195,"props":727,"children":728},{"style":316},[729],{"type":70,"value":730},"interface",{"type":64,"tag":195,"props":732,"children":733},{"style":332},[734],{"type":70,"value":735}," MessageStore",{"type":64,"tag":195,"props":737,"children":738},{"style":208},[739],{"type":70,"value":373},{"type":64,"tag":195,"props":741,"children":742},{"class":197,"line":245},[743,748,752,758,762,767,772,777,782,787,791,796],{"type":64,"tag":195,"props":744,"children":745},{"style":361},[746],{"type":70,"value":747},"  loadThread",{"type":64,"tag":195,"props":749,"children":750},{"style":208},[751],{"type":70,"value":349},{"type":64,"tag":195,"props":753,"children":755},{"style":754},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[756],{"type":70,"value":757},"threadId",{"type":64,"tag":195,"props":759,"children":760},{"style":208},[761],{"type":70,"value":329},{"type":64,"tag":195,"props":763,"children":764},{"style":332},[765],{"type":70,"value":766}," string",{"type":64,"tag":195,"props":768,"children":769},{"style":208},[770],{"type":70,"value":771},"):",{"type":64,"tag":195,"props":773,"children":774},{"style":332},[775],{"type":70,"value":776}," Promise",{"type":64,"tag":195,"props":778,"children":779},{"style":208},[780],{"type":70,"value":781},"\u003C",{"type":64,"tag":195,"props":783,"children":784},{"style":332},[785],{"type":70,"value":786},"Array",{"type":64,"tag":195,"props":788,"children":789},{"style":208},[790],{"type":70,"value":781},{"type":64,"tag":195,"props":792,"children":793},{"style":332},[794],{"type":70,"value":795},"ModelMessage",{"type":64,"tag":195,"props":797,"children":798},{"style":208},[799],{"type":70,"value":800},">>\n",{"type":64,"tag":195,"props":802,"children":803},{"class":197,"line":287},[804,809,813,817,821,825,829,834,838,843,847,851,856,860,864,869],{"type":64,"tag":195,"props":805,"children":806},{"style":361},[807],{"type":70,"value":808},"  saveThread",{"type":64,"tag":195,"props":810,"children":811},{"style":208},[812],{"type":70,"value":349},{"type":64,"tag":195,"props":814,"children":815},{"style":754},[816],{"type":70,"value":757},{"type":64,"tag":195,"props":818,"children":819},{"style":208},[820],{"type":70,"value":329},{"type":64,"tag":195,"props":822,"children":823},{"style":332},[824],{"type":70,"value":766},{"type":64,"tag":195,"props":826,"children":827},{"style":208},[828],{"type":70,"value":387},{"type":64,"tag":195,"props":830,"children":831},{"style":754},[832],{"type":70,"value":833}," messages",{"type":64,"tag":195,"props":835,"children":836},{"style":208},[837],{"type":70,"value":329},{"type":64,"tag":195,"props":839,"children":840},{"style":332},[841],{"type":70,"value":842}," Array",{"type":64,"tag":195,"props":844,"children":845},{"style":208},[846],{"type":70,"value":781},{"type":64,"tag":195,"props":848,"children":849},{"style":332},[850],{"type":70,"value":795},{"type":64,"tag":195,"props":852,"children":853},{"style":208},[854],{"type":70,"value":855},">):",{"type":64,"tag":195,"props":857,"children":858},{"style":332},[859],{"type":70,"value":776},{"type":64,"tag":195,"props":861,"children":862},{"style":208},[863],{"type":70,"value":781},{"type":64,"tag":195,"props":865,"children":866},{"style":332},[867],{"type":70,"value":868},"void",{"type":64,"tag":195,"props":870,"children":871},{"style":208},[872],{"type":70,"value":873},">\n",{"type":64,"tag":195,"props":875,"children":876},{"class":197,"line":297},[877],{"type":64,"tag":195,"props":878,"children":879},{"style":208},[880],{"type":70,"value":881},"}\n",{"type":64,"tag":883,"props":884,"children":885},"ul",{},[886,914],{"type":64,"tag":887,"props":888,"children":889},"li",{},[890,896,898,904,906,912],{"type":64,"tag":101,"props":891,"children":893},{"className":892},[],[894],{"type":70,"value":895},"loadThread",{"type":70,"value":897}," → ",{"type":64,"tag":101,"props":899,"children":901},{"className":900},[],[902],{"type":70,"value":903},"[]",{"type":70,"value":905}," for unknown threads (never ",{"type":64,"tag":101,"props":907,"children":909},{"className":908},[],[910],{"type":70,"value":911},"null",{"type":70,"value":913},").",{"type":64,"tag":887,"props":915,"children":916},{},[917,923,925,930],{"type":64,"tag":101,"props":918,"children":920},{"className":919},[],[921],{"type":70,"value":922},"saveThread",{"type":70,"value":924}," is a ",{"type":64,"tag":83,"props":926,"children":927},{},[928],{"type":70,"value":929},"full overwrite",{"type":70,"value":931},", not append. A one-message payload wipes history.",{"type":64,"tag":706,"props":933,"children":935},{"id":934},"runstore",[936],{"type":64,"tag":101,"props":937,"children":939},{"className":938},[],[940],{"type":70,"value":941},"RunStore",{"type":64,"tag":184,"props":943,"children":945},{"className":186,"code":944,"language":188,"meta":189,"style":189},"interface RunStore {\n  createOrResume(input: {\n    runId: string\n    threadId: string\n    status?: RunStatus\n    startedAt: number\n  }): Promise\u003CRunRecord>\n  update(\n    runId: string,\n    patch: Partial\u003C\n      Pick\u003CRunRecord, 'status' | 'finishedAt' | 'error' | 'usage'>\n    >,\n  ): Promise\u003Cvoid>\n  get(runId: string): Promise\u003CRunRecord | null>\n  findActiveRun(threadId: string): Promise\u003CRunRecord | null>\n}\n",[946],{"type":64,"tag":101,"props":947,"children":948},{"__ignoreMap":189},[949,965,990,1007,1023,1041,1058,1083,1096,1115,1137,1227,1235,1260,1315,1368],{"type":64,"tag":195,"props":950,"children":951},{"class":197,"line":198},[952,956,961],{"type":64,"tag":195,"props":953,"children":954},{"style":316},[955],{"type":70,"value":730},{"type":64,"tag":195,"props":957,"children":958},{"style":332},[959],{"type":70,"value":960}," RunStore",{"type":64,"tag":195,"props":962,"children":963},{"style":208},[964],{"type":70,"value":373},{"type":64,"tag":195,"props":966,"children":967},{"class":197,"line":245},[968,973,977,982,986],{"type":64,"tag":195,"props":969,"children":970},{"style":361},[971],{"type":70,"value":972},"  createOrResume",{"type":64,"tag":195,"props":974,"children":975},{"style":208},[976],{"type":70,"value":349},{"type":64,"tag":195,"props":978,"children":979},{"style":754},[980],{"type":70,"value":981},"input",{"type":64,"tag":195,"props":983,"children":984},{"style":208},[985],{"type":70,"value":329},{"type":64,"tag":195,"props":987,"children":988},{"style":208},[989],{"type":70,"value":373},{"type":64,"tag":195,"props":991,"children":992},{"class":197,"line":287},[993,998,1002],{"type":64,"tag":195,"props":994,"children":995},{"style":361},[996],{"type":70,"value":997},"    runId",{"type":64,"tag":195,"props":999,"children":1000},{"style":208},[1001],{"type":70,"value":329},{"type":64,"tag":195,"props":1003,"children":1004},{"style":332},[1005],{"type":70,"value":1006}," string\n",{"type":64,"tag":195,"props":1008,"children":1009},{"class":197,"line":297},[1010,1015,1019],{"type":64,"tag":195,"props":1011,"children":1012},{"style":361},[1013],{"type":70,"value":1014},"    threadId",{"type":64,"tag":195,"props":1016,"children":1017},{"style":208},[1018],{"type":70,"value":329},{"type":64,"tag":195,"props":1020,"children":1021},{"style":332},[1022],{"type":70,"value":1006},{"type":64,"tag":195,"props":1024,"children":1025},{"class":197,"line":307},[1026,1031,1036],{"type":64,"tag":195,"props":1027,"children":1028},{"style":361},[1029],{"type":70,"value":1030},"    status",{"type":64,"tag":195,"props":1032,"children":1033},{"style":208},[1034],{"type":70,"value":1035},"?:",{"type":64,"tag":195,"props":1037,"children":1038},{"style":332},[1039],{"type":70,"value":1040}," RunStatus\n",{"type":64,"tag":195,"props":1042,"children":1043},{"class":197,"line":357},[1044,1049,1053],{"type":64,"tag":195,"props":1045,"children":1046},{"style":361},[1047],{"type":70,"value":1048},"    startedAt",{"type":64,"tag":195,"props":1050,"children":1051},{"style":208},[1052],{"type":70,"value":329},{"type":64,"tag":195,"props":1054,"children":1055},{"style":332},[1056],{"type":70,"value":1057}," number\n",{"type":64,"tag":195,"props":1059,"children":1060},{"class":197,"line":376},[1061,1066,1070,1074,1079],{"type":64,"tag":195,"props":1062,"children":1063},{"style":208},[1064],{"type":70,"value":1065},"  }):",{"type":64,"tag":195,"props":1067,"children":1068},{"style":332},[1069],{"type":70,"value":776},{"type":64,"tag":195,"props":1071,"children":1072},{"style":208},[1073],{"type":70,"value":781},{"type":64,"tag":195,"props":1075,"children":1076},{"style":332},[1077],{"type":70,"value":1078},"RunRecord",{"type":64,"tag":195,"props":1080,"children":1081},{"style":208},[1082],{"type":70,"value":873},{"type":64,"tag":195,"props":1084,"children":1085},{"class":197,"line":395},[1086,1091],{"type":64,"tag":195,"props":1087,"children":1088},{"style":361},[1089],{"type":70,"value":1090},"  update",{"type":64,"tag":195,"props":1092,"children":1093},{"style":208},[1094],{"type":70,"value":1095},"(\n",{"type":64,"tag":195,"props":1097,"children":1098},{"class":197,"line":413},[1099,1103,1107,1111],{"type":64,"tag":195,"props":1100,"children":1101},{"style":754},[1102],{"type":70,"value":997},{"type":64,"tag":195,"props":1104,"children":1105},{"style":208},[1106],{"type":70,"value":329},{"type":64,"tag":195,"props":1108,"children":1109},{"style":332},[1110],{"type":70,"value":766},{"type":64,"tag":195,"props":1112,"children":1113},{"style":208},[1114],{"type":70,"value":424},{"type":64,"tag":195,"props":1116,"children":1117},{"class":197,"line":427},[1118,1123,1127,1132],{"type":64,"tag":195,"props":1119,"children":1120},{"style":754},[1121],{"type":70,"value":1122},"    patch",{"type":64,"tag":195,"props":1124,"children":1125},{"style":208},[1126],{"type":70,"value":329},{"type":64,"tag":195,"props":1128,"children":1129},{"style":332},[1130],{"type":70,"value":1131}," Partial",{"type":64,"tag":195,"props":1133,"children":1134},{"style":208},[1135],{"type":70,"value":1136},"\u003C\n",{"type":64,"tag":195,"props":1138,"children":1139},{"class":197,"line":436},[1140,1145,1149,1153,1157,1161,1166,1171,1176,1180,1185,1189,1193,1197,1202,1206,1210,1214,1219,1223],{"type":64,"tag":195,"props":1141,"children":1142},{"style":332},[1143],{"type":70,"value":1144},"      Pick",{"type":64,"tag":195,"props":1146,"children":1147},{"style":208},[1148],{"type":70,"value":781},{"type":64,"tag":195,"props":1150,"children":1151},{"style":332},[1152],{"type":70,"value":1078},{"type":64,"tag":195,"props":1154,"children":1155},{"style":208},[1156],{"type":70,"value":387},{"type":64,"tag":195,"props":1158,"children":1159},{"style":208},[1160],{"type":70,"value":232},{"type":64,"tag":195,"props":1162,"children":1163},{"style":235},[1164],{"type":70,"value":1165},"status",{"type":64,"tag":195,"props":1167,"children":1168},{"style":208},[1169],{"type":70,"value":1170},"'",{"type":64,"tag":195,"props":1172,"children":1173},{"style":208},[1174],{"type":70,"value":1175}," |",{"type":64,"tag":195,"props":1177,"children":1178},{"style":208},[1179],{"type":70,"value":232},{"type":64,"tag":195,"props":1181,"children":1182},{"style":235},[1183],{"type":70,"value":1184},"finishedAt",{"type":64,"tag":195,"props":1186,"children":1187},{"style":208},[1188],{"type":70,"value":1170},{"type":64,"tag":195,"props":1190,"children":1191},{"style":208},[1192],{"type":70,"value":1175},{"type":64,"tag":195,"props":1194,"children":1195},{"style":208},[1196],{"type":70,"value":232},{"type":64,"tag":195,"props":1198,"children":1199},{"style":235},[1200],{"type":70,"value":1201},"error",{"type":64,"tag":195,"props":1203,"children":1204},{"style":208},[1205],{"type":70,"value":1170},{"type":64,"tag":195,"props":1207,"children":1208},{"style":208},[1209],{"type":70,"value":1175},{"type":64,"tag":195,"props":1211,"children":1212},{"style":208},[1213],{"type":70,"value":232},{"type":64,"tag":195,"props":1215,"children":1216},{"style":235},[1217],{"type":70,"value":1218},"usage",{"type":64,"tag":195,"props":1220,"children":1221},{"style":208},[1222],{"type":70,"value":1170},{"type":64,"tag":195,"props":1224,"children":1225},{"style":208},[1226],{"type":70,"value":873},{"type":64,"tag":195,"props":1228,"children":1229},{"class":197,"line":445},[1230],{"type":64,"tag":195,"props":1231,"children":1232},{"style":208},[1233],{"type":70,"value":1234},"    >,\n",{"type":64,"tag":195,"props":1236,"children":1238},{"class":197,"line":1237},13,[1239,1244,1248,1252,1256],{"type":64,"tag":195,"props":1240,"children":1241},{"style":208},[1242],{"type":70,"value":1243},"  ):",{"type":64,"tag":195,"props":1245,"children":1246},{"style":332},[1247],{"type":70,"value":776},{"type":64,"tag":195,"props":1249,"children":1250},{"style":208},[1251],{"type":70,"value":781},{"type":64,"tag":195,"props":1253,"children":1254},{"style":332},[1255],{"type":70,"value":868},{"type":64,"tag":195,"props":1257,"children":1258},{"style":208},[1259],{"type":70,"value":873},{"type":64,"tag":195,"props":1261,"children":1263},{"class":197,"line":1262},14,[1264,1269,1273,1278,1282,1286,1290,1294,1298,1302,1306,1311],{"type":64,"tag":195,"props":1265,"children":1266},{"style":361},[1267],{"type":70,"value":1268},"  get",{"type":64,"tag":195,"props":1270,"children":1271},{"style":208},[1272],{"type":70,"value":349},{"type":64,"tag":195,"props":1274,"children":1275},{"style":754},[1276],{"type":70,"value":1277},"runId",{"type":64,"tag":195,"props":1279,"children":1280},{"style":208},[1281],{"type":70,"value":329},{"type":64,"tag":195,"props":1283,"children":1284},{"style":332},[1285],{"type":70,"value":766},{"type":64,"tag":195,"props":1287,"children":1288},{"style":208},[1289],{"type":70,"value":771},{"type":64,"tag":195,"props":1291,"children":1292},{"style":332},[1293],{"type":70,"value":776},{"type":64,"tag":195,"props":1295,"children":1296},{"style":208},[1297],{"type":70,"value":781},{"type":64,"tag":195,"props":1299,"children":1300},{"style":332},[1301],{"type":70,"value":1078},{"type":64,"tag":195,"props":1303,"children":1304},{"style":208},[1305],{"type":70,"value":1175},{"type":64,"tag":195,"props":1307,"children":1308},{"style":332},[1309],{"type":70,"value":1310}," null",{"type":64,"tag":195,"props":1312,"children":1313},{"style":208},[1314],{"type":70,"value":873},{"type":64,"tag":195,"props":1316,"children":1318},{"class":197,"line":1317},15,[1319,1324,1328,1332,1336,1340,1344,1348,1352,1356,1360,1364],{"type":64,"tag":195,"props":1320,"children":1321},{"style":361},[1322],{"type":70,"value":1323},"  findActiveRun",{"type":64,"tag":195,"props":1325,"children":1326},{"style":208},[1327],{"type":70,"value":349},{"type":64,"tag":195,"props":1329,"children":1330},{"style":754},[1331],{"type":70,"value":757},{"type":64,"tag":195,"props":1333,"children":1334},{"style":208},[1335],{"type":70,"value":329},{"type":64,"tag":195,"props":1337,"children":1338},{"style":332},[1339],{"type":70,"value":766},{"type":64,"tag":195,"props":1341,"children":1342},{"style":208},[1343],{"type":70,"value":771},{"type":64,"tag":195,"props":1345,"children":1346},{"style":332},[1347],{"type":70,"value":776},{"type":64,"tag":195,"props":1349,"children":1350},{"style":208},[1351],{"type":70,"value":781},{"type":64,"tag":195,"props":1353,"children":1354},{"style":332},[1355],{"type":70,"value":1078},{"type":64,"tag":195,"props":1357,"children":1358},{"style":208},[1359],{"type":70,"value":1175},{"type":64,"tag":195,"props":1361,"children":1362},{"style":332},[1363],{"type":70,"value":1310},{"type":64,"tag":195,"props":1365,"children":1366},{"style":208},[1367],{"type":70,"value":873},{"type":64,"tag":195,"props":1369,"children":1371},{"class":197,"line":1370},16,[1372],{"type":64,"tag":195,"props":1373,"children":1374},{"style":208},[1375],{"type":70,"value":881},{"type":64,"tag":883,"props":1377,"children":1378},{},[1379,1407,1434],{"type":64,"tag":887,"props":1380,"children":1381},{},[1382,1391,1393,1398,1400,1405],{"type":64,"tag":83,"props":1383,"children":1384},{},[1385],{"type":64,"tag":101,"props":1386,"children":1388},{"className":1387},[],[1389],{"type":70,"value":1390},"createOrResume",{"type":70,"value":1392},": if ",{"type":64,"tag":101,"props":1394,"children":1396},{"className":1395},[],[1397],{"type":70,"value":1277},{"type":70,"value":1399}," exists, return it ",{"type":64,"tag":83,"props":1401,"children":1402},{},[1403],{"type":70,"value":1404},"unchanged",{"type":70,"value":1406}," (ignore new\nfields). Idempotent retries \u002F resume depend on this.",{"type":64,"tag":887,"props":1408,"children":1409},{},[1410,1419,1421,1426,1427,1432],{"type":64,"tag":83,"props":1411,"children":1412},{},[1413],{"type":64,"tag":101,"props":1414,"children":1416},{"className":1415},[],[1417],{"type":70,"value":1418},"update",{"type":70,"value":1420},": missing ",{"type":64,"tag":101,"props":1422,"children":1424},{"className":1423},[],[1425],{"type":70,"value":1277},{"type":70,"value":924},{"type":64,"tag":83,"props":1428,"children":1429},{},[1430],{"type":70,"value":1431},"no-op",{"type":70,"value":1433}," (do not throw, do not insert).",{"type":64,"tag":887,"props":1435,"children":1436},{},[1437,1446,1448,1454,1456,1461,1463,1469,1471,1476,1478,1483],{"type":64,"tag":83,"props":1438,"children":1439},{},[1440],{"type":64,"tag":101,"props":1441,"children":1443},{"className":1442},[],[1444],{"type":70,"value":1445},"findActiveRun",{"type":70,"value":1447},": latest ",{"type":64,"tag":101,"props":1449,"children":1451},{"className":1450},[],[1452],{"type":70,"value":1453},"'running'",{"type":70,"value":1455}," for ",{"type":64,"tag":101,"props":1457,"children":1459},{"className":1458},[],[1460],{"type":70,"value":757},{"type":70,"value":1462}," (max ",{"type":64,"tag":101,"props":1464,"children":1466},{"className":1465},[],[1467],{"type":70,"value":1468},"startedAt",{"type":70,"value":1470},");\nthis is what ",{"type":64,"tag":101,"props":1472,"children":1474},{"className":1473},[],[1475],{"type":70,"value":600},{"type":70,"value":1477}," uses to reconnect a reloading client without a\nclient-held run id. Stub it out and reconnect silently stops working — ",{"type":64,"tag":101,"props":1479,"children":1481},{"className":1480},[],[1482],{"type":70,"value":911},{"type":70,"value":1484},"\nis also the correct answer for an idle thread, so nothing can detect the\ndifference.",{"type":64,"tag":77,"props":1486,"children":1487},{},[1488,1490,1495,1497,1502,1504,1510],{"type":70,"value":1489},"Every method is ",{"type":64,"tag":83,"props":1491,"children":1492},{},[1493],{"type":70,"value":1494},"required",{"type":70,"value":1496},". Capability tiers live at the store level (omit\n",{"type":64,"tag":101,"props":1498,"children":1500},{"className":1499},[],[1501],{"type":70,"value":535},{"type":70,"value":1503}," and declare ",{"type":64,"tag":101,"props":1505,"children":1507},{"className":1506},[],[1508],{"type":70,"value":1509},"ChatTranscriptStores",{"type":70,"value":1511},"), never at the method level.",{"type":64,"tag":706,"props":1513,"children":1515},{"id":1514},"interruptstore",[1516],{"type":64,"tag":101,"props":1517,"children":1519},{"className":1518},[],[1520],{"type":70,"value":1521},"InterruptStore",{"type":64,"tag":184,"props":1523,"children":1525},{"className":186,"code":1524,"language":188,"meta":189,"style":189},"interface InterruptStore {\n  create(record: Omit\u003CInterruptRecord, 'status' | 'resolvedAt'>): Promise\u003Cvoid>\n  resolve(interruptId: string, response?: unknown): Promise\u003Cvoid>\n  cancel(interruptId: string): Promise\u003Cvoid>\n  get(interruptId: string): Promise\u003CInterruptRecord | null>\n  list(threadId: string): Promise\u003CArray\u003CInterruptRecord>>\n  listPending(threadId: string): Promise\u003CArray\u003CInterruptRecord>>\n  listByRun(runId: string): Promise\u003CArray\u003CInterruptRecord>>\n  listPendingByRun(runId: string): Promise\u003CArray\u003CInterruptRecord>>\n}\n",[1526],{"type":64,"tag":101,"props":1527,"children":1528},{"__ignoreMap":189},[1529,1545,1633,1696,1740,1791,1843,1895,1947,1999],{"type":64,"tag":195,"props":1530,"children":1531},{"class":197,"line":198},[1532,1536,1541],{"type":64,"tag":195,"props":1533,"children":1534},{"style":316},[1535],{"type":70,"value":730},{"type":64,"tag":195,"props":1537,"children":1538},{"style":332},[1539],{"type":70,"value":1540}," InterruptStore",{"type":64,"tag":195,"props":1542,"children":1543},{"style":208},[1544],{"type":70,"value":373},{"type":64,"tag":195,"props":1546,"children":1547},{"class":197,"line":245},[1548,1553,1557,1562,1566,1571,1575,1580,1584,1588,1592,1596,1600,1604,1609,1613,1617,1621,1625,1629],{"type":64,"tag":195,"props":1549,"children":1550},{"style":361},[1551],{"type":70,"value":1552},"  create",{"type":64,"tag":195,"props":1554,"children":1555},{"style":208},[1556],{"type":70,"value":349},{"type":64,"tag":195,"props":1558,"children":1559},{"style":754},[1560],{"type":70,"value":1561},"record",{"type":64,"tag":195,"props":1563,"children":1564},{"style":208},[1565],{"type":70,"value":329},{"type":64,"tag":195,"props":1567,"children":1568},{"style":332},[1569],{"type":70,"value":1570}," Omit",{"type":64,"tag":195,"props":1572,"children":1573},{"style":208},[1574],{"type":70,"value":781},{"type":64,"tag":195,"props":1576,"children":1577},{"style":332},[1578],{"type":70,"value":1579},"InterruptRecord",{"type":64,"tag":195,"props":1581,"children":1582},{"style":208},[1583],{"type":70,"value":387},{"type":64,"tag":195,"props":1585,"children":1586},{"style":208},[1587],{"type":70,"value":232},{"type":64,"tag":195,"props":1589,"children":1590},{"style":235},[1591],{"type":70,"value":1165},{"type":64,"tag":195,"props":1593,"children":1594},{"style":208},[1595],{"type":70,"value":1170},{"type":64,"tag":195,"props":1597,"children":1598},{"style":208},[1599],{"type":70,"value":1175},{"type":64,"tag":195,"props":1601,"children":1602},{"style":208},[1603],{"type":70,"value":232},{"type":64,"tag":195,"props":1605,"children":1606},{"style":235},[1607],{"type":70,"value":1608},"resolvedAt",{"type":64,"tag":195,"props":1610,"children":1611},{"style":208},[1612],{"type":70,"value":1170},{"type":64,"tag":195,"props":1614,"children":1615},{"style":208},[1616],{"type":70,"value":855},{"type":64,"tag":195,"props":1618,"children":1619},{"style":332},[1620],{"type":70,"value":776},{"type":64,"tag":195,"props":1622,"children":1623},{"style":208},[1624],{"type":70,"value":781},{"type":64,"tag":195,"props":1626,"children":1627},{"style":332},[1628],{"type":70,"value":868},{"type":64,"tag":195,"props":1630,"children":1631},{"style":208},[1632],{"type":70,"value":873},{"type":64,"tag":195,"props":1634,"children":1635},{"class":197,"line":287},[1636,1641,1645,1650,1654,1658,1662,1667,1671,1676,1680,1684,1688,1692],{"type":64,"tag":195,"props":1637,"children":1638},{"style":361},[1639],{"type":70,"value":1640},"  resolve",{"type":64,"tag":195,"props":1642,"children":1643},{"style":208},[1644],{"type":70,"value":349},{"type":64,"tag":195,"props":1646,"children":1647},{"style":754},[1648],{"type":70,"value":1649},"interruptId",{"type":64,"tag":195,"props":1651,"children":1652},{"style":208},[1653],{"type":70,"value":329},{"type":64,"tag":195,"props":1655,"children":1656},{"style":332},[1657],{"type":70,"value":766},{"type":64,"tag":195,"props":1659,"children":1660},{"style":208},[1661],{"type":70,"value":387},{"type":64,"tag":195,"props":1663,"children":1664},{"style":754},[1665],{"type":70,"value":1666}," response",{"type":64,"tag":195,"props":1668,"children":1669},{"style":208},[1670],{"type":70,"value":1035},{"type":64,"tag":195,"props":1672,"children":1673},{"style":332},[1674],{"type":70,"value":1675}," unknown",{"type":64,"tag":195,"props":1677,"children":1678},{"style":208},[1679],{"type":70,"value":771},{"type":64,"tag":195,"props":1681,"children":1682},{"style":332},[1683],{"type":70,"value":776},{"type":64,"tag":195,"props":1685,"children":1686},{"style":208},[1687],{"type":70,"value":781},{"type":64,"tag":195,"props":1689,"children":1690},{"style":332},[1691],{"type":70,"value":868},{"type":64,"tag":195,"props":1693,"children":1694},{"style":208},[1695],{"type":70,"value":873},{"type":64,"tag":195,"props":1697,"children":1698},{"class":197,"line":297},[1699,1704,1708,1712,1716,1720,1724,1728,1732,1736],{"type":64,"tag":195,"props":1700,"children":1701},{"style":361},[1702],{"type":70,"value":1703},"  cancel",{"type":64,"tag":195,"props":1705,"children":1706},{"style":208},[1707],{"type":70,"value":349},{"type":64,"tag":195,"props":1709,"children":1710},{"style":754},[1711],{"type":70,"value":1649},{"type":64,"tag":195,"props":1713,"children":1714},{"style":208},[1715],{"type":70,"value":329},{"type":64,"tag":195,"props":1717,"children":1718},{"style":332},[1719],{"type":70,"value":766},{"type":64,"tag":195,"props":1721,"children":1722},{"style":208},[1723],{"type":70,"value":771},{"type":64,"tag":195,"props":1725,"children":1726},{"style":332},[1727],{"type":70,"value":776},{"type":64,"tag":195,"props":1729,"children":1730},{"style":208},[1731],{"type":70,"value":781},{"type":64,"tag":195,"props":1733,"children":1734},{"style":332},[1735],{"type":70,"value":868},{"type":64,"tag":195,"props":1737,"children":1738},{"style":208},[1739],{"type":70,"value":873},{"type":64,"tag":195,"props":1741,"children":1742},{"class":197,"line":307},[1743,1747,1751,1755,1759,1763,1767,1771,1775,1779,1783,1787],{"type":64,"tag":195,"props":1744,"children":1745},{"style":361},[1746],{"type":70,"value":1268},{"type":64,"tag":195,"props":1748,"children":1749},{"style":208},[1750],{"type":70,"value":349},{"type":64,"tag":195,"props":1752,"children":1753},{"style":754},[1754],{"type":70,"value":1649},{"type":64,"tag":195,"props":1756,"children":1757},{"style":208},[1758],{"type":70,"value":329},{"type":64,"tag":195,"props":1760,"children":1761},{"style":332},[1762],{"type":70,"value":766},{"type":64,"tag":195,"props":1764,"children":1765},{"style":208},[1766],{"type":70,"value":771},{"type":64,"tag":195,"props":1768,"children":1769},{"style":332},[1770],{"type":70,"value":776},{"type":64,"tag":195,"props":1772,"children":1773},{"style":208},[1774],{"type":70,"value":781},{"type":64,"tag":195,"props":1776,"children":1777},{"style":332},[1778],{"type":70,"value":1579},{"type":64,"tag":195,"props":1780,"children":1781},{"style":208},[1782],{"type":70,"value":1175},{"type":64,"tag":195,"props":1784,"children":1785},{"style":332},[1786],{"type":70,"value":1310},{"type":64,"tag":195,"props":1788,"children":1789},{"style":208},[1790],{"type":70,"value":873},{"type":64,"tag":195,"props":1792,"children":1793},{"class":197,"line":357},[1794,1799,1803,1807,1811,1815,1819,1823,1827,1831,1835,1839],{"type":64,"tag":195,"props":1795,"children":1796},{"style":361},[1797],{"type":70,"value":1798},"  list",{"type":64,"tag":195,"props":1800,"children":1801},{"style":208},[1802],{"type":70,"value":349},{"type":64,"tag":195,"props":1804,"children":1805},{"style":754},[1806],{"type":70,"value":757},{"type":64,"tag":195,"props":1808,"children":1809},{"style":208},[1810],{"type":70,"value":329},{"type":64,"tag":195,"props":1812,"children":1813},{"style":332},[1814],{"type":70,"value":766},{"type":64,"tag":195,"props":1816,"children":1817},{"style":208},[1818],{"type":70,"value":771},{"type":64,"tag":195,"props":1820,"children":1821},{"style":332},[1822],{"type":70,"value":776},{"type":64,"tag":195,"props":1824,"children":1825},{"style":208},[1826],{"type":70,"value":781},{"type":64,"tag":195,"props":1828,"children":1829},{"style":332},[1830],{"type":70,"value":786},{"type":64,"tag":195,"props":1832,"children":1833},{"style":208},[1834],{"type":70,"value":781},{"type":64,"tag":195,"props":1836,"children":1837},{"style":332},[1838],{"type":70,"value":1579},{"type":64,"tag":195,"props":1840,"children":1841},{"style":208},[1842],{"type":70,"value":800},{"type":64,"tag":195,"props":1844,"children":1845},{"class":197,"line":376},[1846,1851,1855,1859,1863,1867,1871,1875,1879,1883,1887,1891],{"type":64,"tag":195,"props":1847,"children":1848},{"style":361},[1849],{"type":70,"value":1850},"  listPending",{"type":64,"tag":195,"props":1852,"children":1853},{"style":208},[1854],{"type":70,"value":349},{"type":64,"tag":195,"props":1856,"children":1857},{"style":754},[1858],{"type":70,"value":757},{"type":64,"tag":195,"props":1860,"children":1861},{"style":208},[1862],{"type":70,"value":329},{"type":64,"tag":195,"props":1864,"children":1865},{"style":332},[1866],{"type":70,"value":766},{"type":64,"tag":195,"props":1868,"children":1869},{"style":208},[1870],{"type":70,"value":771},{"type":64,"tag":195,"props":1872,"children":1873},{"style":332},[1874],{"type":70,"value":776},{"type":64,"tag":195,"props":1876,"children":1877},{"style":208},[1878],{"type":70,"value":781},{"type":64,"tag":195,"props":1880,"children":1881},{"style":332},[1882],{"type":70,"value":786},{"type":64,"tag":195,"props":1884,"children":1885},{"style":208},[1886],{"type":70,"value":781},{"type":64,"tag":195,"props":1888,"children":1889},{"style":332},[1890],{"type":70,"value":1579},{"type":64,"tag":195,"props":1892,"children":1893},{"style":208},[1894],{"type":70,"value":800},{"type":64,"tag":195,"props":1896,"children":1897},{"class":197,"line":395},[1898,1903,1907,1911,1915,1919,1923,1927,1931,1935,1939,1943],{"type":64,"tag":195,"props":1899,"children":1900},{"style":361},[1901],{"type":70,"value":1902},"  listByRun",{"type":64,"tag":195,"props":1904,"children":1905},{"style":208},[1906],{"type":70,"value":349},{"type":64,"tag":195,"props":1908,"children":1909},{"style":754},[1910],{"type":70,"value":1277},{"type":64,"tag":195,"props":1912,"children":1913},{"style":208},[1914],{"type":70,"value":329},{"type":64,"tag":195,"props":1916,"children":1917},{"style":332},[1918],{"type":70,"value":766},{"type":64,"tag":195,"props":1920,"children":1921},{"style":208},[1922],{"type":70,"value":771},{"type":64,"tag":195,"props":1924,"children":1925},{"style":332},[1926],{"type":70,"value":776},{"type":64,"tag":195,"props":1928,"children":1929},{"style":208},[1930],{"type":70,"value":781},{"type":64,"tag":195,"props":1932,"children":1933},{"style":332},[1934],{"type":70,"value":786},{"type":64,"tag":195,"props":1936,"children":1937},{"style":208},[1938],{"type":70,"value":781},{"type":64,"tag":195,"props":1940,"children":1941},{"style":332},[1942],{"type":70,"value":1579},{"type":64,"tag":195,"props":1944,"children":1945},{"style":208},[1946],{"type":70,"value":800},{"type":64,"tag":195,"props":1948,"children":1949},{"class":197,"line":413},[1950,1955,1959,1963,1967,1971,1975,1979,1983,1987,1991,1995],{"type":64,"tag":195,"props":1951,"children":1952},{"style":361},[1953],{"type":70,"value":1954},"  listPendingByRun",{"type":64,"tag":195,"props":1956,"children":1957},{"style":208},[1958],{"type":70,"value":349},{"type":64,"tag":195,"props":1960,"children":1961},{"style":754},[1962],{"type":70,"value":1277},{"type":64,"tag":195,"props":1964,"children":1965},{"style":208},[1966],{"type":70,"value":329},{"type":64,"tag":195,"props":1968,"children":1969},{"style":332},[1970],{"type":70,"value":766},{"type":64,"tag":195,"props":1972,"children":1973},{"style":208},[1974],{"type":70,"value":771},{"type":64,"tag":195,"props":1976,"children":1977},{"style":332},[1978],{"type":70,"value":776},{"type":64,"tag":195,"props":1980,"children":1981},{"style":208},[1982],{"type":70,"value":781},{"type":64,"tag":195,"props":1984,"children":1985},{"style":332},[1986],{"type":70,"value":786},{"type":64,"tag":195,"props":1988,"children":1989},{"style":208},[1990],{"type":70,"value":781},{"type":64,"tag":195,"props":1992,"children":1993},{"style":332},[1994],{"type":70,"value":1579},{"type":64,"tag":195,"props":1996,"children":1997},{"style":208},[1998],{"type":70,"value":800},{"type":64,"tag":195,"props":2000,"children":2001},{"class":197,"line":427},[2002],{"type":64,"tag":195,"props":2003,"children":2004},{"style":208},[2005],{"type":70,"value":881},{"type":64,"tag":883,"props":2007,"children":2008},{},[2009,2042,2063],{"type":64,"tag":887,"props":2010,"children":2011},{},[2012,2018,2020,2026,2028,2033,2035,2040],{"type":64,"tag":101,"props":2013,"children":2015},{"className":2014},[],[2016],{"type":70,"value":2017},"create",{"type":70,"value":2019}," always births ",{"type":64,"tag":101,"props":2021,"children":2023},{"className":2022},[],[2024],{"type":70,"value":2025},"'pending'",{"type":70,"value":2027},"; ",{"type":64,"tag":83,"props":2029,"children":2030},{},[2031],{"type":70,"value":2032},"insert-if-absent",{"type":70,"value":2034}," on ",{"type":64,"tag":101,"props":2036,"children":2038},{"className":2037},[],[2039],{"type":70,"value":1649},{"type":70,"value":2041},"\n(never clobber resolved back to pending).",{"type":64,"tag":887,"props":2043,"children":2044},{},[2045,2047,2053,2055,2061],{"type":70,"value":2046},"All ",{"type":64,"tag":101,"props":2048,"children":2050},{"className":2049},[],[2051],{"type":70,"value":2052},"list*",{"type":70,"value":2054}," ordered by ",{"type":64,"tag":101,"props":2056,"children":2058},{"className":2057},[],[2059],{"type":70,"value":2060},"requestedAt",{"type":70,"value":2062}," ascending.",{"type":64,"tag":887,"props":2064,"children":2065},{},[2066,2068,2073],{"type":70,"value":2067},"Requires a ",{"type":64,"tag":101,"props":2069,"children":2071},{"className":2070},[],[2072],{"type":70,"value":535},{"type":70,"value":2074}," store when used with chat persistence.",{"type":64,"tag":706,"props":2076,"children":2078},{"id":2077},"metadatastore",[2079],{"type":64,"tag":101,"props":2080,"children":2082},{"className":2081},[],[2083],{"type":70,"value":2084},"MetadataStore",{"type":64,"tag":184,"props":2086,"children":2088},{"className":186,"code":2087,"language":188,"meta":189,"style":189},"interface MetadataStore {\n  get(namespace: string, key: string): Promise\u003Cunknown | null>\n  set(namespace: string, key: string, value: unknown): Promise\u003Cvoid>\n  delete(namespace: string, key: string): Promise\u003Cvoid>\n}\n",[2089],{"type":64,"tag":101,"props":2090,"children":2091},{"__ignoreMap":189},[2092,2108,2178,2255,2315],{"type":64,"tag":195,"props":2093,"children":2094},{"class":197,"line":198},[2095,2099,2104],{"type":64,"tag":195,"props":2096,"children":2097},{"style":316},[2098],{"type":70,"value":730},{"type":64,"tag":195,"props":2100,"children":2101},{"style":332},[2102],{"type":70,"value":2103}," MetadataStore",{"type":64,"tag":195,"props":2105,"children":2106},{"style":208},[2107],{"type":70,"value":373},{"type":64,"tag":195,"props":2109,"children":2110},{"class":197,"line":245},[2111,2115,2119,2124,2128,2132,2136,2141,2145,2149,2153,2157,2161,2166,2170,2174],{"type":64,"tag":195,"props":2112,"children":2113},{"style":361},[2114],{"type":70,"value":1268},{"type":64,"tag":195,"props":2116,"children":2117},{"style":208},[2118],{"type":70,"value":349},{"type":64,"tag":195,"props":2120,"children":2121},{"style":754},[2122],{"type":70,"value":2123},"namespace",{"type":64,"tag":195,"props":2125,"children":2126},{"style":208},[2127],{"type":70,"value":329},{"type":64,"tag":195,"props":2129,"children":2130},{"style":332},[2131],{"type":70,"value":766},{"type":64,"tag":195,"props":2133,"children":2134},{"style":208},[2135],{"type":70,"value":387},{"type":64,"tag":195,"props":2137,"children":2138},{"style":754},[2139],{"type":70,"value":2140}," key",{"type":64,"tag":195,"props":2142,"children":2143},{"style":208},[2144],{"type":70,"value":329},{"type":64,"tag":195,"props":2146,"children":2147},{"style":332},[2148],{"type":70,"value":766},{"type":64,"tag":195,"props":2150,"children":2151},{"style":208},[2152],{"type":70,"value":771},{"type":64,"tag":195,"props":2154,"children":2155},{"style":332},[2156],{"type":70,"value":776},{"type":64,"tag":195,"props":2158,"children":2159},{"style":208},[2160],{"type":70,"value":781},{"type":64,"tag":195,"props":2162,"children":2163},{"style":332},[2164],{"type":70,"value":2165},"unknown",{"type":64,"tag":195,"props":2167,"children":2168},{"style":208},[2169],{"type":70,"value":1175},{"type":64,"tag":195,"props":2171,"children":2172},{"style":332},[2173],{"type":70,"value":1310},{"type":64,"tag":195,"props":2175,"children":2176},{"style":208},[2177],{"type":70,"value":873},{"type":64,"tag":195,"props":2179,"children":2180},{"class":197,"line":287},[2181,2186,2190,2194,2198,2202,2206,2210,2214,2218,2222,2227,2231,2235,2239,2243,2247,2251],{"type":64,"tag":195,"props":2182,"children":2183},{"style":361},[2184],{"type":70,"value":2185},"  set",{"type":64,"tag":195,"props":2187,"children":2188},{"style":208},[2189],{"type":70,"value":349},{"type":64,"tag":195,"props":2191,"children":2192},{"style":754},[2193],{"type":70,"value":2123},{"type":64,"tag":195,"props":2195,"children":2196},{"style":208},[2197],{"type":70,"value":329},{"type":64,"tag":195,"props":2199,"children":2200},{"style":332},[2201],{"type":70,"value":766},{"type":64,"tag":195,"props":2203,"children":2204},{"style":208},[2205],{"type":70,"value":387},{"type":64,"tag":195,"props":2207,"children":2208},{"style":754},[2209],{"type":70,"value":2140},{"type":64,"tag":195,"props":2211,"children":2212},{"style":208},[2213],{"type":70,"value":329},{"type":64,"tag":195,"props":2215,"children":2216},{"style":332},[2217],{"type":70,"value":766},{"type":64,"tag":195,"props":2219,"children":2220},{"style":208},[2221],{"type":70,"value":387},{"type":64,"tag":195,"props":2223,"children":2224},{"style":754},[2225],{"type":70,"value":2226}," value",{"type":64,"tag":195,"props":2228,"children":2229},{"style":208},[2230],{"type":70,"value":329},{"type":64,"tag":195,"props":2232,"children":2233},{"style":332},[2234],{"type":70,"value":1675},{"type":64,"tag":195,"props":2236,"children":2237},{"style":208},[2238],{"type":70,"value":771},{"type":64,"tag":195,"props":2240,"children":2241},{"style":332},[2242],{"type":70,"value":776},{"type":64,"tag":195,"props":2244,"children":2245},{"style":208},[2246],{"type":70,"value":781},{"type":64,"tag":195,"props":2248,"children":2249},{"style":332},[2250],{"type":70,"value":868},{"type":64,"tag":195,"props":2252,"children":2253},{"style":208},[2254],{"type":70,"value":873},{"type":64,"tag":195,"props":2256,"children":2257},{"class":197,"line":297},[2258,2263,2267,2271,2275,2279,2283,2287,2291,2295,2299,2303,2307,2311],{"type":64,"tag":195,"props":2259,"children":2260},{"style":361},[2261],{"type":70,"value":2262},"  delete",{"type":64,"tag":195,"props":2264,"children":2265},{"style":208},[2266],{"type":70,"value":349},{"type":64,"tag":195,"props":2268,"children":2269},{"style":754},[2270],{"type":70,"value":2123},{"type":64,"tag":195,"props":2272,"children":2273},{"style":208},[2274],{"type":70,"value":329},{"type":64,"tag":195,"props":2276,"children":2277},{"style":332},[2278],{"type":70,"value":766},{"type":64,"tag":195,"props":2280,"children":2281},{"style":208},[2282],{"type":70,"value":387},{"type":64,"tag":195,"props":2284,"children":2285},{"style":754},[2286],{"type":70,"value":2140},{"type":64,"tag":195,"props":2288,"children":2289},{"style":208},[2290],{"type":70,"value":329},{"type":64,"tag":195,"props":2292,"children":2293},{"style":332},[2294],{"type":70,"value":766},{"type":64,"tag":195,"props":2296,"children":2297},{"style":208},[2298],{"type":70,"value":771},{"type":64,"tag":195,"props":2300,"children":2301},{"style":332},[2302],{"type":70,"value":776},{"type":64,"tag":195,"props":2304,"children":2305},{"style":208},[2306],{"type":70,"value":781},{"type":64,"tag":195,"props":2308,"children":2309},{"style":332},[2310],{"type":70,"value":868},{"type":64,"tag":195,"props":2312,"children":2313},{"style":208},[2314],{"type":70,"value":873},{"type":64,"tag":195,"props":2316,"children":2317},{"class":197,"line":307},[2318],{"type":64,"tag":195,"props":2319,"children":2320},{"style":208},[2321],{"type":70,"value":881},{"type":64,"tag":883,"props":2323,"children":2324},{},[2325,2352,2394,2413],{"type":64,"tag":887,"props":2326,"children":2327},{},[2328,2330,2335,2337,2343,2345,2351],{"type":70,"value":2329},"The first argument is an ",{"type":64,"tag":83,"props":2331,"children":2332},{},[2333],{"type":70,"value":2334},"app-defined namespace string",{"type":70,"value":2336},", not the ",{"type":64,"tag":101,"props":2338,"children":2340},{"className":2339},[],[2341],{"type":70,"value":2342},"Scope",{"type":70,"value":2344},"\nidentity type — despite SQL backends conventionally naming the column\n",{"type":64,"tag":101,"props":2346,"children":2348},{"className":2347},[],[2349],{"type":70,"value":2350},"scope",{"type":70,"value":96},{"type":64,"tag":887,"props":2353,"children":2354},{},[2355,2357,2362,2364,2370,2372,2377,2379,2385,2386,2392],{"type":70,"value":2356},"Identity is ",{"type":64,"tag":83,"props":2358,"children":2359},{},[2360],{"type":70,"value":2361},"two fields",{"type":70,"value":2363}," ",{"type":64,"tag":101,"props":2365,"children":2367},{"className":2366},[],[2368],{"type":70,"value":2369},"(namespace, key)",{"type":70,"value":2371}," — do not join with ",{"type":64,"tag":101,"props":2373,"children":2375},{"className":2374},[],[2376],{"type":70,"value":329},{"type":70,"value":2378},"\n(",{"type":64,"tag":101,"props":2380,"children":2382},{"className":2381},[],[2383],{"type":70,"value":2384},"('a:b','c')",{"type":70,"value":89},{"type":64,"tag":101,"props":2387,"children":2389},{"className":2388},[],[2390],{"type":70,"value":2391},"('a','b:c')",{"type":70,"value":2393}," must stay distinct).",{"type":64,"tag":887,"props":2395,"children":2396},{},[2397,2399,2404,2406,2412],{"type":70,"value":2398},"Stored ",{"type":64,"tag":101,"props":2400,"children":2402},{"className":2401},[],[2403],{"type":70,"value":911},{"type":70,"value":2405}," is type-indistinguishable from absence; wrap if you must\npersist real null (",{"type":64,"tag":101,"props":2407,"children":2409},{"className":2408},[],[2410],{"type":70,"value":2411},"{ value: null }",{"type":70,"value":913},{"type":64,"tag":887,"props":2414,"children":2415},{},[2416,2418,2424,2426,2432],{"type":70,"value":2417},"SQL backends usually reject nullish ",{"type":64,"tag":101,"props":2419,"children":2421},{"className":2420},[],[2422],{"type":70,"value":2423},"set",{"type":70,"value":2425}," (NOT NULL JSON columns) with a\nclear ",{"type":64,"tag":101,"props":2427,"children":2429},{"className":2428},[],[2430],{"type":70,"value":2431},"TypeError",{"type":70,"value":2433}," — match that or document your semantics.",{"type":64,"tag":177,"props":2435,"children":2437},{"id":2436},"timestamp-convention",[2438],{"type":70,"value":2439},"Timestamp convention",{"type":64,"tag":77,"props":2441,"children":2442},{},[2443,2445,2451,2453,2458,2459,2464,2466,2471,2472,2478,2480,2485],{"type":70,"value":2444},"Store ",{"type":64,"tag":2446,"props":2447,"children":2448},"em",{},[2449],{"type":70,"value":2450},"records",{"type":70,"value":2452}," (",{"type":64,"tag":101,"props":2454,"children":2456},{"className":2455},[],[2457],{"type":70,"value":1078},{"type":70,"value":640},{"type":64,"tag":101,"props":2460,"children":2462},{"className":2461},[],[2463],{"type":70,"value":1579},{"type":70,"value":2465},") speak ",{"type":64,"tag":83,"props":2467,"children":2468},{},[2469],{"type":70,"value":2470},"epoch milliseconds",{"type":70,"value":2378},{"type":64,"tag":101,"props":2473,"children":2475},{"className":2474},[],[2476],{"type":70,"value":2477},"number",{"type":70,"value":2479},"). Wire\u002Fresult references that leave the persistence layer speak\n",{"type":64,"tag":83,"props":2481,"children":2482},{},[2483],{"type":70,"value":2484},"ISO-8601 strings",{"type":70,"value":2486},"; the middleware converts at the boundary. Do not mix the\ntwo on one field.",{"type":64,"tag":177,"props":2488,"children":2490},{"id":2489},"minimal-message-store-example",[2491],{"type":70,"value":2492},"Minimal message store example",{"type":64,"tag":77,"props":2494,"children":2495},{},[2496,2498,2504,2506,2512,2513,2519,2520,2526,2527,2533,2535,2541,2543,2548],{"type":70,"value":2497},"Type each store with its ",{"type":64,"tag":101,"props":2499,"children":2501},{"className":2500},[],[2502],{"type":70,"value":2503},"define*Store",{"type":70,"value":2505}," helper (",{"type":64,"tag":101,"props":2507,"children":2509},{"className":2508},[],[2510],{"type":70,"value":2511},"defineMessageStore",{"type":70,"value":424},{"type":64,"tag":101,"props":2514,"children":2516},{"className":2515},[],[2517],{"type":70,"value":2518},"defineRunStore",{"type":70,"value":640},{"type":64,"tag":101,"props":2521,"children":2523},{"className":2522},[],[2524],{"type":70,"value":2525},"defineInterruptStore",{"type":70,"value":640},{"type":64,"tag":101,"props":2528,"children":2530},{"className":2529},[],[2531],{"type":70,"value":2532},"defineMetadataStore",{"type":70,"value":2534},"): pass the object\nliteral and get autocomplete + contract checking inline, with no ",{"type":64,"tag":101,"props":2536,"children":2538},{"className":2537},[],[2539],{"type":70,"value":2540},": MessageStore",{"type":70,"value":2542},"\nannotation. The result composes into ",{"type":64,"tag":101,"props":2544,"children":2546},{"className":2545},[],[2547],{"type":70,"value":568},{"type":70,"value":2549}," with exact presence.",{"type":64,"tag":184,"props":2551,"children":2553},{"className":186,"code":2552,"language":188,"meta":189,"style":189},"import { defineMessageStore } from '@tanstack\u002Fai-persistence'\nimport type { ModelMessage } from '@tanstack\u002Fai'\n\nconst threads = new Map\u003Cstring, Array\u003CModelMessage>>()\n\nexport const messages = defineMessageStore({\n  async loadThread(threadId) {\n    return [...(threads.get(threadId) ?? [])]\n  },\n  async saveThread(threadId, next) {\n    threads.set(threadId, [...next])\n  },\n})\n",[2554],{"type":64,"tag":101,"props":2555,"children":2556},{"__ignoreMap":189},[2557,2593,2634,2641,2704,2711,2743,2773,2832,2839,2876,2922,2929],{"type":64,"tag":195,"props":2558,"children":2559},{"class":197,"line":198},[2560,2564,2568,2573,2577,2581,2585,2589],{"type":64,"tag":195,"props":2561,"children":2562},{"style":202},[2563],{"type":70,"value":205},{"type":64,"tag":195,"props":2565,"children":2566},{"style":208},[2567],{"type":70,"value":211},{"type":64,"tag":195,"props":2569,"children":2570},{"style":214},[2571],{"type":70,"value":2572}," defineMessageStore",{"type":64,"tag":195,"props":2574,"children":2575},{"style":208},[2576],{"type":70,"value":222},{"type":64,"tag":195,"props":2578,"children":2579},{"style":202},[2580],{"type":70,"value":227},{"type":64,"tag":195,"props":2582,"children":2583},{"style":208},[2584],{"type":70,"value":232},{"type":64,"tag":195,"props":2586,"children":2587},{"style":235},[2588],{"type":70,"value":106},{"type":64,"tag":195,"props":2590,"children":2591},{"style":208},[2592],{"type":70,"value":242},{"type":64,"tag":195,"props":2594,"children":2595},{"class":197,"line":245},[2596,2600,2604,2608,2613,2617,2621,2625,2630],{"type":64,"tag":195,"props":2597,"children":2598},{"style":202},[2599],{"type":70,"value":205},{"type":64,"tag":195,"props":2601,"children":2602},{"style":202},[2603],{"type":70,"value":255},{"type":64,"tag":195,"props":2605,"children":2606},{"style":208},[2607],{"type":70,"value":211},{"type":64,"tag":195,"props":2609,"children":2610},{"style":214},[2611],{"type":70,"value":2612}," ModelMessage",{"type":64,"tag":195,"props":2614,"children":2615},{"style":208},[2616],{"type":70,"value":222},{"type":64,"tag":195,"props":2618,"children":2619},{"style":202},[2620],{"type":70,"value":227},{"type":64,"tag":195,"props":2622,"children":2623},{"style":208},[2624],{"type":70,"value":232},{"type":64,"tag":195,"props":2626,"children":2627},{"style":235},[2628],{"type":70,"value":2629},"@tanstack\u002Fai",{"type":64,"tag":195,"props":2631,"children":2632},{"style":208},[2633],{"type":70,"value":242},{"type":64,"tag":195,"props":2635,"children":2636},{"class":197,"line":287},[2637],{"type":64,"tag":195,"props":2638,"children":2639},{"emptyLinePlaceholder":291},[2640],{"type":70,"value":294},{"type":64,"tag":195,"props":2642,"children":2643},{"class":197,"line":297},[2644,2649,2654,2659,2664,2669,2673,2678,2682,2686,2690,2694,2699],{"type":64,"tag":195,"props":2645,"children":2646},{"style":316},[2647],{"type":70,"value":2648},"const",{"type":64,"tag":195,"props":2650,"children":2651},{"style":214},[2652],{"type":70,"value":2653}," threads ",{"type":64,"tag":195,"props":2655,"children":2656},{"style":208},[2657],{"type":70,"value":2658},"=",{"type":64,"tag":195,"props":2660,"children":2661},{"style":208},[2662],{"type":70,"value":2663}," new",{"type":64,"tag":195,"props":2665,"children":2666},{"style":342},[2667],{"type":70,"value":2668}," Map",{"type":64,"tag":195,"props":2670,"children":2671},{"style":208},[2672],{"type":70,"value":781},{"type":64,"tag":195,"props":2674,"children":2675},{"style":332},[2676],{"type":70,"value":2677},"string",{"type":64,"tag":195,"props":2679,"children":2680},{"style":208},[2681],{"type":70,"value":387},{"type":64,"tag":195,"props":2683,"children":2684},{"style":332},[2685],{"type":70,"value":842},{"type":64,"tag":195,"props":2687,"children":2688},{"style":208},[2689],{"type":70,"value":781},{"type":64,"tag":195,"props":2691,"children":2692},{"style":332},[2693],{"type":70,"value":795},{"type":64,"tag":195,"props":2695,"children":2696},{"style":208},[2697],{"type":70,"value":2698},">>",{"type":64,"tag":195,"props":2700,"children":2701},{"style":214},[2702],{"type":70,"value":2703},"()\n",{"type":64,"tag":195,"props":2705,"children":2706},{"class":197,"line":307},[2707],{"type":64,"tag":195,"props":2708,"children":2709},{"emptyLinePlaceholder":291},[2710],{"type":70,"value":294},{"type":64,"tag":195,"props":2712,"children":2713},{"class":197,"line":357},[2714,2718,2722,2727,2731,2735,2739],{"type":64,"tag":195,"props":2715,"children":2716},{"style":202},[2717],{"type":70,"value":313},{"type":64,"tag":195,"props":2719,"children":2720},{"style":316},[2721],{"type":70,"value":319},{"type":64,"tag":195,"props":2723,"children":2724},{"style":214},[2725],{"type":70,"value":2726}," messages ",{"type":64,"tag":195,"props":2728,"children":2729},{"style":208},[2730],{"type":70,"value":2658},{"type":64,"tag":195,"props":2732,"children":2733},{"style":342},[2734],{"type":70,"value":2572},{"type":64,"tag":195,"props":2736,"children":2737},{"style":214},[2738],{"type":70,"value":349},{"type":64,"tag":195,"props":2740,"children":2741},{"style":208},[2742],{"type":70,"value":354},{"type":64,"tag":195,"props":2744,"children":2745},{"class":197,"line":376},[2746,2751,2756,2760,2764,2769],{"type":64,"tag":195,"props":2747,"children":2748},{"style":316},[2749],{"type":70,"value":2750},"  async",{"type":64,"tag":195,"props":2752,"children":2753},{"style":361},[2754],{"type":70,"value":2755}," loadThread",{"type":64,"tag":195,"props":2757,"children":2758},{"style":208},[2759],{"type":70,"value":349},{"type":64,"tag":195,"props":2761,"children":2762},{"style":754},[2763],{"type":70,"value":757},{"type":64,"tag":195,"props":2765,"children":2766},{"style":208},[2767],{"type":70,"value":2768},")",{"type":64,"tag":195,"props":2770,"children":2771},{"style":208},[2772],{"type":70,"value":373},{"type":64,"tag":195,"props":2774,"children":2775},{"class":197,"line":395},[2776,2781,2786,2791,2795,2800,2804,2809,2813,2817,2822,2827],{"type":64,"tag":195,"props":2777,"children":2778},{"style":202},[2779],{"type":70,"value":2780},"    return",{"type":64,"tag":195,"props":2782,"children":2783},{"style":361},[2784],{"type":70,"value":2785}," [",{"type":64,"tag":195,"props":2787,"children":2788},{"style":208},[2789],{"type":70,"value":2790},"...",{"type":64,"tag":195,"props":2792,"children":2793},{"style":361},[2794],{"type":70,"value":349},{"type":64,"tag":195,"props":2796,"children":2797},{"style":214},[2798],{"type":70,"value":2799},"threads",{"type":64,"tag":195,"props":2801,"children":2802},{"style":208},[2803],{"type":70,"value":96},{"type":64,"tag":195,"props":2805,"children":2806},{"style":342},[2807],{"type":70,"value":2808},"get",{"type":64,"tag":195,"props":2810,"children":2811},{"style":361},[2812],{"type":70,"value":349},{"type":64,"tag":195,"props":2814,"children":2815},{"style":214},[2816],{"type":70,"value":757},{"type":64,"tag":195,"props":2818,"children":2819},{"style":361},[2820],{"type":70,"value":2821},") ",{"type":64,"tag":195,"props":2823,"children":2824},{"style":208},[2825],{"type":70,"value":2826},"??",{"type":64,"tag":195,"props":2828,"children":2829},{"style":361},[2830],{"type":70,"value":2831}," [])]\n",{"type":64,"tag":195,"props":2833,"children":2834},{"class":197,"line":413},[2835],{"type":64,"tag":195,"props":2836,"children":2837},{"style":208},[2838],{"type":70,"value":442},{"type":64,"tag":195,"props":2840,"children":2841},{"class":197,"line":427},[2842,2846,2851,2855,2859,2863,2868,2872],{"type":64,"tag":195,"props":2843,"children":2844},{"style":316},[2845],{"type":70,"value":2750},{"type":64,"tag":195,"props":2847,"children":2848},{"style":361},[2849],{"type":70,"value":2850}," saveThread",{"type":64,"tag":195,"props":2852,"children":2853},{"style":208},[2854],{"type":70,"value":349},{"type":64,"tag":195,"props":2856,"children":2857},{"style":754},[2858],{"type":70,"value":757},{"type":64,"tag":195,"props":2860,"children":2861},{"style":208},[2862],{"type":70,"value":387},{"type":64,"tag":195,"props":2864,"children":2865},{"style":754},[2866],{"type":70,"value":2867}," next",{"type":64,"tag":195,"props":2869,"children":2870},{"style":208},[2871],{"type":70,"value":2768},{"type":64,"tag":195,"props":2873,"children":2874},{"style":208},[2875],{"type":70,"value":373},{"type":64,"tag":195,"props":2877,"children":2878},{"class":197,"line":436},[2879,2884,2888,2892,2896,2900,2904,2908,2912,2917],{"type":64,"tag":195,"props":2880,"children":2881},{"style":214},[2882],{"type":70,"value":2883},"    threads",{"type":64,"tag":195,"props":2885,"children":2886},{"style":208},[2887],{"type":70,"value":96},{"type":64,"tag":195,"props":2889,"children":2890},{"style":342},[2891],{"type":70,"value":2423},{"type":64,"tag":195,"props":2893,"children":2894},{"style":361},[2895],{"type":70,"value":349},{"type":64,"tag":195,"props":2897,"children":2898},{"style":214},[2899],{"type":70,"value":757},{"type":64,"tag":195,"props":2901,"children":2902},{"style":208},[2903],{"type":70,"value":387},{"type":64,"tag":195,"props":2905,"children":2906},{"style":361},[2907],{"type":70,"value":2785},{"type":64,"tag":195,"props":2909,"children":2910},{"style":208},[2911],{"type":70,"value":2790},{"type":64,"tag":195,"props":2913,"children":2914},{"style":214},[2915],{"type":70,"value":2916},"next",{"type":64,"tag":195,"props":2918,"children":2919},{"style":361},[2920],{"type":70,"value":2921},"])\n",{"type":64,"tag":195,"props":2923,"children":2924},{"class":197,"line":445},[2925],{"type":64,"tag":195,"props":2926,"children":2927},{"style":208},[2928],{"type":70,"value":442},{"type":64,"tag":195,"props":2930,"children":2931},{"class":197,"line":1237},[2932,2936],{"type":64,"tag":195,"props":2933,"children":2934},{"style":208},[2935],{"type":70,"value":451},{"type":64,"tag":195,"props":2937,"children":2938},{"style":214},[2939],{"type":70,"value":456},{"type":64,"tag":77,"props":2941,"children":2942},{},[2943],{"type":70,"value":2944},"For durable DBs, preserve the same semantics with upserts \u002F full-row replace.",{"type":64,"tag":177,"props":2946,"children":2948},{"id":2947},"adopt-part-of-it",[2949],{"type":70,"value":2950},"Adopt part of it",{"type":64,"tag":77,"props":2952,"children":2953},{},[2954,2956,2962],{"type":70,"value":2955},"You rarely need all four stores in the same system. Implement the ones you own\nand fill the rest from another base with ",{"type":64,"tag":101,"props":2957,"children":2959},{"className":2958},[],[2960],{"type":70,"value":2961},"composePersistence",{"type":70,"value":329},{"type":64,"tag":184,"props":2964,"children":2966},{"className":186,"code":2965,"language":188,"meta":189,"style":189},"import { composePersistence, memoryPersistence } from '@tanstack\u002Fai-persistence'\nimport { messages, runs } from '.\u002Fmy-postgres-stores'\n\nexport const persistence = composePersistence(memoryPersistence(), {\n  overrides: { messages, runs },\n})\n",[2967],{"type":64,"tag":101,"props":2968,"children":2969},{"__ignoreMap":189},[2970,3015,3060,3067,3113,3147],{"type":64,"tag":195,"props":2971,"children":2972},{"class":197,"line":198},[2973,2977,2981,2986,2990,2995,2999,3003,3007,3011],{"type":64,"tag":195,"props":2974,"children":2975},{"style":202},[2976],{"type":70,"value":205},{"type":64,"tag":195,"props":2978,"children":2979},{"style":208},[2980],{"type":70,"value":211},{"type":64,"tag":195,"props":2982,"children":2983},{"style":214},[2984],{"type":70,"value":2985}," composePersistence",{"type":64,"tag":195,"props":2987,"children":2988},{"style":208},[2989],{"type":70,"value":387},{"type":64,"tag":195,"props":2991,"children":2992},{"style":214},[2993],{"type":70,"value":2994}," memoryPersistence",{"type":64,"tag":195,"props":2996,"children":2997},{"style":208},[2998],{"type":70,"value":222},{"type":64,"tag":195,"props":3000,"children":3001},{"style":202},[3002],{"type":70,"value":227},{"type":64,"tag":195,"props":3004,"children":3005},{"style":208},[3006],{"type":70,"value":232},{"type":64,"tag":195,"props":3008,"children":3009},{"style":235},[3010],{"type":70,"value":106},{"type":64,"tag":195,"props":3012,"children":3013},{"style":208},[3014],{"type":70,"value":242},{"type":64,"tag":195,"props":3016,"children":3017},{"class":197,"line":245},[3018,3022,3026,3030,3034,3039,3043,3047,3051,3056],{"type":64,"tag":195,"props":3019,"children":3020},{"style":202},[3021],{"type":70,"value":205},{"type":64,"tag":195,"props":3023,"children":3024},{"style":208},[3025],{"type":70,"value":211},{"type":64,"tag":195,"props":3027,"children":3028},{"style":214},[3029],{"type":70,"value":833},{"type":64,"tag":195,"props":3031,"children":3032},{"style":208},[3033],{"type":70,"value":387},{"type":64,"tag":195,"props":3035,"children":3036},{"style":214},[3037],{"type":70,"value":3038}," runs",{"type":64,"tag":195,"props":3040,"children":3041},{"style":208},[3042],{"type":70,"value":222},{"type":64,"tag":195,"props":3044,"children":3045},{"style":202},[3046],{"type":70,"value":227},{"type":64,"tag":195,"props":3048,"children":3049},{"style":208},[3050],{"type":70,"value":232},{"type":64,"tag":195,"props":3052,"children":3053},{"style":235},[3054],{"type":70,"value":3055},".\u002Fmy-postgres-stores",{"type":64,"tag":195,"props":3057,"children":3058},{"style":208},[3059],{"type":70,"value":242},{"type":64,"tag":195,"props":3061,"children":3062},{"class":197,"line":287},[3063],{"type":64,"tag":195,"props":3064,"children":3065},{"emptyLinePlaceholder":291},[3066],{"type":70,"value":294},{"type":64,"tag":195,"props":3068,"children":3069},{"class":197,"line":297},[3070,3074,3078,3083,3087,3091,3095,3100,3105,3109],{"type":64,"tag":195,"props":3071,"children":3072},{"style":202},[3073],{"type":70,"value":313},{"type":64,"tag":195,"props":3075,"children":3076},{"style":316},[3077],{"type":70,"value":319},{"type":64,"tag":195,"props":3079,"children":3080},{"style":214},[3081],{"type":70,"value":3082}," persistence ",{"type":64,"tag":195,"props":3084,"children":3085},{"style":208},[3086],{"type":70,"value":2658},{"type":64,"tag":195,"props":3088,"children":3089},{"style":342},[3090],{"type":70,"value":2985},{"type":64,"tag":195,"props":3092,"children":3093},{"style":214},[3094],{"type":70,"value":349},{"type":64,"tag":195,"props":3096,"children":3097},{"style":342},[3098],{"type":70,"value":3099},"memoryPersistence",{"type":64,"tag":195,"props":3101,"children":3102},{"style":214},[3103],{"type":70,"value":3104},"()",{"type":64,"tag":195,"props":3106,"children":3107},{"style":208},[3108],{"type":70,"value":387},{"type":64,"tag":195,"props":3110,"children":3111},{"style":208},[3112],{"type":70,"value":373},{"type":64,"tag":195,"props":3114,"children":3115},{"class":197,"line":307},[3116,3121,3125,3129,3133,3137,3142],{"type":64,"tag":195,"props":3117,"children":3118},{"style":361},[3119],{"type":70,"value":3120},"  overrides",{"type":64,"tag":195,"props":3122,"children":3123},{"style":208},[3124],{"type":70,"value":329},{"type":64,"tag":195,"props":3126,"children":3127},{"style":208},[3128],{"type":70,"value":211},{"type":64,"tag":195,"props":3130,"children":3131},{"style":214},[3132],{"type":70,"value":833},{"type":64,"tag":195,"props":3134,"children":3135},{"style":208},[3136],{"type":70,"value":387},{"type":64,"tag":195,"props":3138,"children":3139},{"style":214},[3140],{"type":70,"value":3141}," runs ",{"type":64,"tag":195,"props":3143,"children":3144},{"style":208},[3145],{"type":70,"value":3146},"},\n",{"type":64,"tag":195,"props":3148,"children":3149},{"class":197,"line":357},[3150,3154],{"type":64,"tag":195,"props":3151,"children":3152},{"style":208},[3153],{"type":70,"value":451},{"type":64,"tag":195,"props":3155,"children":3156},{"style":214},[3157],{"type":70,"value":456},{"type":64,"tag":77,"props":3159,"children":3160},{},[3161,3163,3169,3171,3176,3178,3183,3185,3190,3192,3197,3199,3204],{"type":70,"value":3162},"Only listed keys move; others stay on the base. Pass ",{"type":64,"tag":101,"props":3164,"children":3166},{"className":3165},[],[3167],{"type":70,"value":3168},"false",{"type":70,"value":3170}," to drop a store.\nThere is ",{"type":64,"tag":83,"props":3172,"children":3173},{},[3174],{"type":70,"value":3175},"no cross-store transaction",{"type":70,"value":3177}," — if ",{"type":64,"tag":101,"props":3179,"children":3181},{"className":3180},[],[3182],{"type":70,"value":505},{"type":70,"value":3184}," lives in Postgres and\n",{"type":64,"tag":101,"props":3186,"children":3188},{"className":3187},[],[3189],{"type":70,"value":542},{"type":70,"value":3191}," in Redis, a write touching both is two writes. The store\ninvariants (idempotent ",{"type":64,"tag":101,"props":3193,"children":3195},{"className":3194},[],[3196],{"type":70,"value":1390},{"type":70,"value":3198},", insert-if-absent ",{"type":64,"tag":101,"props":3200,"children":3202},{"className":3201},[],[3203],{"type":70,"value":2017},{"type":70,"value":3205},") are exactly\nwhat make those retries safe.",{"type":64,"tag":77,"props":3207,"children":3208},{},[3209,3214],{"type":64,"tag":101,"props":3210,"children":3212},{"className":3211},[],[3213],{"type":70,"value":2961},{"type":70,"value":3215}," accepts the four state keys. Locks and sandbox instance\nmaps are not composable here.",{"type":64,"tag":177,"props":3217,"children":3219},{"id":3218},"map-onto-an-existing-schema",[3220],{"type":70,"value":3221},"Map onto an existing schema",{"type":64,"tag":883,"props":3223,"children":3224},{},[3225,3250,3268],{"type":64,"tag":887,"props":3226,"children":3227},{},[3228,3233,3235,3241,3242,3248],{"type":64,"tag":83,"props":3229,"children":3230},{},[3231],{"type":70,"value":3232},"Your column names, your types.",{"type":70,"value":3234}," Name columns anything; use ",{"type":64,"tag":101,"props":3236,"children":3238},{"className":3237},[],[3239],{"type":70,"value":3240},"jsonb",{"type":70,"value":424},{"type":64,"tag":101,"props":3243,"children":3245},{"className":3244},[],[3246],{"type":70,"value":3247},"timestamptz",{"type":70,"value":3249},", whatever — convert in the row mapper. The record shape the\nmethods return is fixed; how you store it is not.",{"type":64,"tag":887,"props":3251,"children":3252},{},[3253,3258,3260,3266],{"type":64,"tag":83,"props":3254,"children":3255},{},[3256],{"type":70,"value":3257},"Extra columns are fine.",{"type":70,"value":3259}," Add ",{"type":64,"tag":101,"props":3261,"children":3263},{"className":3262},[],[3264],{"type":70,"value":3265},"user_id",{"type":70,"value":3267},", audit columns, a tenant id. Keep\nthem nullable or defaulted so the store's inserts still succeed. The stores\nnever read or write columns they do not know about.",{"type":64,"tag":887,"props":3269,"children":3270},{},[3271,3276,3278,3284],{"type":64,"tag":83,"props":3272,"children":3273},{},[3274],{"type":70,"value":3275},"Omit absent optionals",{"type":70,"value":3277}," in row mappers (",{"type":64,"tag":101,"props":3279,"children":3281},{"className":3280},[],[3282],{"type":70,"value":3283},"...(row.error != null ? { error: row.error } : {})",{"type":70,"value":3285},")\nso records compare cleanly.",{"type":64,"tag":177,"props":3287,"children":3289},{"id":3288},"authorization",[3290],{"type":70,"value":3291},"Authorization",{"type":64,"tag":77,"props":3293,"children":3294},{},[3295,3297,3302,3304,3309,3311,3316,3317,3322,3323,3329],{"type":70,"value":3296},"Store methods take bare ",{"type":64,"tag":101,"props":3298,"children":3300},{"className":3299},[],[3301],{"type":70,"value":757},{"type":70,"value":3303},"s. ",{"type":64,"tag":83,"props":3305,"children":3306},{},[3307],{"type":70,"value":3308},"Authorize at the route",{"type":70,"value":3310}," before\n",{"type":64,"tag":101,"props":3312,"children":3314},{"className":3313},[],[3315],{"type":70,"value":895},{"type":70,"value":683},{"type":64,"tag":101,"props":3318,"children":3320},{"className":3319},[],[3321],{"type":70,"value":922},{"type":70,"value":683},{"type":64,"tag":101,"props":3324,"children":3326},{"className":3325},[],[3327],{"type":70,"value":3328},"reconstructChat({ authorize })",{"type":70,"value":3330},". Derive user\nidentity from session, not the client body alone.",{"type":64,"tag":177,"props":3332,"children":3334},{"id":3333},"conformance-tests-required",[3335],{"type":70,"value":3336},"Conformance tests (required)",{"type":64,"tag":184,"props":3338,"children":3340},{"className":186,"code":3339,"language":188,"meta":189,"style":189},"import { runPersistenceConformance } from '@tanstack\u002Fai-persistence\u002Ftestkit'\nimport { myPersistence } from '..\u002Fsrc\u002Fpersistence'\n\nrunPersistenceConformance('my-backend', () => myPersistence())\n\n\u002F\u002F Declare intentional omissions — only the four state stores are valid keys:\n\u002F\u002F runPersistenceConformance('msgs-only', () => p, {\n\u002F\u002F   skip: ['runs', 'interrupts', 'metadata'],\n\u002F\u002F })\n",[3341],{"type":64,"tag":101,"props":3342,"children":3343},{"__ignoreMap":189},[3344,3381,3418,3425,3473,3480,3488,3496,3504],{"type":64,"tag":195,"props":3345,"children":3346},{"class":197,"line":198},[3347,3351,3355,3360,3364,3368,3372,3377],{"type":64,"tag":195,"props":3348,"children":3349},{"style":202},[3350],{"type":70,"value":205},{"type":64,"tag":195,"props":3352,"children":3353},{"style":208},[3354],{"type":70,"value":211},{"type":64,"tag":195,"props":3356,"children":3357},{"style":214},[3358],{"type":70,"value":3359}," runPersistenceConformance",{"type":64,"tag":195,"props":3361,"children":3362},{"style":208},[3363],{"type":70,"value":222},{"type":64,"tag":195,"props":3365,"children":3366},{"style":202},[3367],{"type":70,"value":227},{"type":64,"tag":195,"props":3369,"children":3370},{"style":208},[3371],{"type":70,"value":232},{"type":64,"tag":195,"props":3373,"children":3374},{"style":235},[3375],{"type":70,"value":3376},"@tanstack\u002Fai-persistence\u002Ftestkit",{"type":64,"tag":195,"props":3378,"children":3379},{"style":208},[3380],{"type":70,"value":242},{"type":64,"tag":195,"props":3382,"children":3383},{"class":197,"line":245},[3384,3388,3392,3397,3401,3405,3409,3414],{"type":64,"tag":195,"props":3385,"children":3386},{"style":202},[3387],{"type":70,"value":205},{"type":64,"tag":195,"props":3389,"children":3390},{"style":208},[3391],{"type":70,"value":211},{"type":64,"tag":195,"props":3393,"children":3394},{"style":214},[3395],{"type":70,"value":3396}," myPersistence",{"type":64,"tag":195,"props":3398,"children":3399},{"style":208},[3400],{"type":70,"value":222},{"type":64,"tag":195,"props":3402,"children":3403},{"style":202},[3404],{"type":70,"value":227},{"type":64,"tag":195,"props":3406,"children":3407},{"style":208},[3408],{"type":70,"value":232},{"type":64,"tag":195,"props":3410,"children":3411},{"style":235},[3412],{"type":70,"value":3413},"..\u002Fsrc\u002Fpersistence",{"type":64,"tag":195,"props":3415,"children":3416},{"style":208},[3417],{"type":70,"value":242},{"type":64,"tag":195,"props":3419,"children":3420},{"class":197,"line":287},[3421],{"type":64,"tag":195,"props":3422,"children":3423},{"emptyLinePlaceholder":291},[3424],{"type":70,"value":294},{"type":64,"tag":195,"props":3426,"children":3427},{"class":197,"line":297},[3428,3433,3437,3441,3446,3450,3454,3459,3464,3468],{"type":64,"tag":195,"props":3429,"children":3430},{"style":342},[3431],{"type":70,"value":3432},"runPersistenceConformance",{"type":64,"tag":195,"props":3434,"children":3435},{"style":214},[3436],{"type":70,"value":349},{"type":64,"tag":195,"props":3438,"children":3439},{"style":208},[3440],{"type":70,"value":1170},{"type":64,"tag":195,"props":3442,"children":3443},{"style":235},[3444],{"type":70,"value":3445},"my-backend",{"type":64,"tag":195,"props":3447,"children":3448},{"style":208},[3449],{"type":70,"value":1170},{"type":64,"tag":195,"props":3451,"children":3452},{"style":208},[3453],{"type":70,"value":387},{"type":64,"tag":195,"props":3455,"children":3456},{"style":208},[3457],{"type":70,"value":3458}," ()",{"type":64,"tag":195,"props":3460,"children":3461},{"style":316},[3462],{"type":70,"value":3463}," =>",{"type":64,"tag":195,"props":3465,"children":3466},{"style":342},[3467],{"type":70,"value":3396},{"type":64,"tag":195,"props":3469,"children":3470},{"style":214},[3471],{"type":70,"value":3472},"())\n",{"type":64,"tag":195,"props":3474,"children":3475},{"class":197,"line":307},[3476],{"type":64,"tag":195,"props":3477,"children":3478},{"emptyLinePlaceholder":291},[3479],{"type":70,"value":294},{"type":64,"tag":195,"props":3481,"children":3482},{"class":197,"line":357},[3483],{"type":64,"tag":195,"props":3484,"children":3485},{"style":301},[3486],{"type":70,"value":3487},"\u002F\u002F Declare intentional omissions — only the four state stores are valid keys:\n",{"type":64,"tag":195,"props":3489,"children":3490},{"class":197,"line":376},[3491],{"type":64,"tag":195,"props":3492,"children":3493},{"style":301},[3494],{"type":70,"value":3495},"\u002F\u002F runPersistenceConformance('msgs-only', () => p, {\n",{"type":64,"tag":195,"props":3497,"children":3498},{"class":197,"line":395},[3499],{"type":64,"tag":195,"props":3500,"children":3501},{"style":301},[3502],{"type":70,"value":3503},"\u002F\u002F   skip: ['runs', 'interrupts', 'metadata'],\n",{"type":64,"tag":195,"props":3505,"children":3506},{"class":197,"line":413},[3507],{"type":64,"tag":195,"props":3508,"children":3509},{"style":301},[3510],{"type":70,"value":3511},"\u002F\u002F })\n",{"type":64,"tag":77,"props":3513,"children":3514},{},[3515,3517,3522,3523,3528,3530,3536],{"type":70,"value":3516},"The testkit is the compatibility gate: round-trips, rich message shapes,\nempty-thread ",{"type":64,"tag":101,"props":3518,"children":3520},{"className":3519},[],[3521],{"type":70,"value":903},{"type":70,"value":640},{"type":64,"tag":101,"props":3524,"children":3526},{"className":3525},[],[3527],{"type":70,"value":1390},{"type":70,"value":3529}," idempotency, interrupt insert-if-absent,\nlist ordering, composite-key non-aliasing. A missing store that is not listed\nin ",{"type":64,"tag":101,"props":3531,"children":3533},{"className":3532},[],[3534],{"type":70,"value":3535},"skip",{"type":70,"value":3537}," fails loudly.",{"type":64,"tag":77,"props":3539,"children":3540},{},[3541,3546,3548,3554,3556,3567],{"type":64,"tag":101,"props":3542,"children":3544},{"className":3543},[],[3545],{"type":70,"value":3535},{"type":70,"value":3547}," accepts only ",{"type":64,"tag":101,"props":3549,"children":3551},{"className":3550},[],[3552],{"type":70,"value":3553},"'messages' | 'runs' | 'interrupts' | 'metadata'",{"type":70,"value":3555},". ",{"type":64,"tag":83,"props":3557,"children":3558},{},[3559,3561],{"type":70,"value":3560},"Do not\npass ",{"type":64,"tag":101,"props":3562,"children":3564},{"className":3563},[],[3565],{"type":70,"value":3566},"'locks'",{"type":70,"value":3568}," — it is not a state store and the suite does not cover it.",{"type":64,"tag":77,"props":3570,"children":3571},{},[3572,3574,3579,3581,3586],{"type":70,"value":3573},"Reference implementation: ",{"type":64,"tag":101,"props":3575,"children":3577},{"className":3576},[],[3578],{"type":70,"value":142},{"type":70,"value":3580}," in ",{"type":64,"tag":101,"props":3582,"children":3584},{"className":3583},[],[3585],{"type":70,"value":106},{"type":70,"value":96},{"type":64,"tag":177,"props":3588,"children":3590},{"id":3589},"common-mistakes",[3591],{"type":70,"value":3592},"Common mistakes",{"type":64,"tag":706,"props":3594,"children":3596},{"id":3595},"critical-append-only-savethread",[3597,3599],{"type":70,"value":3598},"CRITICAL: Append-only ",{"type":64,"tag":101,"props":3600,"children":3602},{"className":3601},[],[3603],{"type":70,"value":922},{"type":64,"tag":77,"props":3605,"children":3606},{},[3607],{"type":70,"value":3608},"Breaks the authoritative-history contract.",{"type":64,"tag":706,"props":3610,"children":3612},{"id":3611},"critical-createorresume-overwriting-existing-runs",[3613,3615,3620],{"type":70,"value":3614},"CRITICAL: ",{"type":64,"tag":101,"props":3616,"children":3618},{"className":3617},[],[3619],{"type":70,"value":1390},{"type":70,"value":3621}," overwriting existing runs",{"type":64,"tag":77,"props":3623,"children":3624},{},[3625],{"type":70,"value":3626},"Breaks safe resume \u002F double-submit.",{"type":64,"tag":706,"props":3628,"children":3630},{"id":3629},"critical-interrupt-create-upserting-to-pending",[3631,3633,3638],{"type":70,"value":3632},"CRITICAL: Interrupt ",{"type":64,"tag":101,"props":3634,"children":3636},{"className":3635},[],[3637],{"type":70,"value":2017},{"type":70,"value":3639}," upserting to pending",{"type":64,"tag":77,"props":3641,"children":3642},{},[3643],{"type":70,"value":3644},"Can resurrect a resolved approval.",{"type":64,"tag":706,"props":3646,"children":3648},{"id":3647},"high-returning-bare-aipersistence-from-the-factory",[3649,3651,3656],{"type":70,"value":3650},"HIGH: Returning bare ",{"type":64,"tag":101,"props":3652,"children":3654},{"className":3653},[],[3655],{"type":70,"value":586},{"type":70,"value":3657}," from the factory",{"type":64,"tag":77,"props":3659,"children":3660},{},[3661,3666],{"type":64,"tag":101,"props":3662,"children":3664},{"className":3663},[],[3665],{"type":70,"value":129},{"type":70,"value":3667}," rejects it. Annotate a named shape.",{"type":64,"tag":706,"props":3669,"children":3671},{"id":3670},"high-list-without-stable-requestedat-order",[3672,3674,3679,3681,3686],{"type":70,"value":3673},"HIGH: ",{"type":64,"tag":101,"props":3675,"children":3677},{"className":3676},[],[3678],{"type":70,"value":2052},{"type":70,"value":3680}," without stable ",{"type":64,"tag":101,"props":3682,"children":3684},{"className":3683},[],[3685],{"type":70,"value":2060},{"type":70,"value":3687}," order",{"type":64,"tag":77,"props":3689,"children":3690},{},[3691],{"type":70,"value":3692},"Middleware and tests assume ascending order.",{"type":64,"tag":706,"props":3694,"children":3696},{"id":3695},"high-skipping-the-testkit",[3697],{"type":70,"value":3698},"HIGH: Skipping the testkit",{"type":64,"tag":77,"props":3700,"children":3701},{},[3702],{"type":70,"value":3703},"Silent semantic drift shows up as stuck approvals or wiped history in prod.",{"type":64,"tag":177,"props":3705,"children":3707},{"id":3706},"cross-references",[3708],{"type":70,"value":3709},"Cross-references",{"type":64,"tag":883,"props":3711,"children":3712},{},[3713,3722,3750],{"type":64,"tag":887,"props":3714,"children":3715},{},[3716,3720],{"type":64,"tag":83,"props":3717,"children":3718},{},[3719],{"type":70,"value":94},{"type":70,"value":3721}," — when middleware calls each store",{"type":64,"tag":887,"props":3723,"children":3724},{},[3725,3730,3731,3736,3737,3742,3743,3748],{"type":64,"tag":83,"props":3726,"children":3727},{},[3728],{"type":70,"value":3729},"ai-persistence\u002Fbuild-drizzle-adapter",{"type":70,"value":683},{"type":64,"tag":83,"props":3732,"children":3733},{},[3734],{"type":70,"value":3735},"-prisma-",{"type":70,"value":683},{"type":64,"tag":83,"props":3738,"children":3739},{},[3740],{"type":70,"value":3741},"-cloudflare-",{"type":70,"value":683},{"type":64,"tag":83,"props":3744,"children":3745},{},[3746],{"type":70,"value":3747},"-custom-",{"type":70,"value":3749}," — per-stack recipes",{"type":64,"tag":887,"props":3751,"children":3752},{},[3753,3757],{"type":64,"tag":83,"props":3754,"children":3755},{},[3756],{"type":70,"value":681},{"type":70,"value":3758}," — not a state store",{"type":64,"tag":3760,"props":3761,"children":3762},"style",{},[3763],{"type":70,"value":3764},"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":3766,"total":3908},[3767,3783,3795,3807,3822,3834,3844,3854,3867,3877,3888,3898],{"slug":3768,"name":3768,"fn":3769,"description":3770,"org":3771,"tags":3772,"stars":3780,"repoUrl":3781,"updatedAt":3782},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3773,3776,3779],{"name":3774,"slug":3775,"type":16},"Data Analysis","data-analysis",{"name":3777,"slug":3778,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":3784,"name":3784,"fn":3785,"description":3786,"org":3787,"tags":3788,"stars":3780,"repoUrl":3781,"updatedAt":3794},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3789,3792,3793],{"name":3790,"slug":3791,"type":16},"Debugging","debugging",{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":3796,"name":3796,"fn":3797,"description":3798,"org":3799,"tags":3800,"stars":3780,"repoUrl":3781,"updatedAt":3806},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3801,3802,3803],{"name":3774,"slug":3775,"type":16},{"name":10,"slug":9,"type":16},{"name":3804,"slug":3805,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":3808,"name":3808,"fn":3809,"description":3810,"org":3811,"tags":3812,"stars":3780,"repoUrl":3781,"updatedAt":3821},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3813,3816,3817,3820],{"name":3814,"slug":3815,"type":16},"Data Pipeline","data-pipeline",{"name":3777,"slug":3778,"type":16},{"name":3818,"slug":3819,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":3823,"name":3823,"fn":3824,"description":3825,"org":3826,"tags":3827,"stars":3780,"repoUrl":3781,"updatedAt":3833},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3828,3831,3832],{"name":3829,"slug":3830,"type":16},"Data Visualization","data-visualization",{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":3835,"name":3835,"fn":3836,"description":3837,"org":3838,"tags":3839,"stars":3780,"repoUrl":3781,"updatedAt":3843},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3840,3841,3842],{"name":3774,"slug":3775,"type":16},{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":3845,"name":3845,"fn":3846,"description":3847,"org":3848,"tags":3849,"stars":3780,"repoUrl":3781,"updatedAt":3853},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3850,3851,3852],{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},{"name":3804,"slug":3805,"type":16},"2026-07-30T05:26:03.37801",{"slug":3855,"name":3855,"fn":3856,"description":3857,"org":3858,"tags":3859,"stars":3780,"repoUrl":3781,"updatedAt":3866},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3860,3863,3864,3865],{"name":3861,"slug":3862,"type":16},"CSS","css",{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},{"name":3804,"slug":3805,"type":16},"2026-07-30T05:25:55.377366",{"slug":3868,"name":3868,"fn":3869,"description":3870,"org":3871,"tags":3872,"stars":3780,"repoUrl":3781,"updatedAt":3876},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3873,3874,3875],{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},{"name":3804,"slug":3805,"type":16},"2026-07-30T05:25:51.400011",{"slug":3878,"name":3878,"fn":3879,"description":3880,"org":3881,"tags":3882,"stars":3780,"repoUrl":3781,"updatedAt":3887},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3883,3884,3885,3886],{"name":3861,"slug":3862,"type":16},{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},{"name":3804,"slug":3805,"type":16},"2026-07-30T05:25:48.703799",{"slug":3889,"name":3889,"fn":3890,"description":3891,"org":3892,"tags":3893,"stars":3780,"repoUrl":3781,"updatedAt":3897},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3894,3895,3896],{"name":3777,"slug":3778,"type":16},{"name":10,"slug":9,"type":16},{"name":3804,"slug":3805,"type":16},"2026-07-30T05:25:47.367943",{"slug":3899,"name":3899,"fn":3900,"description":3901,"org":3902,"tags":3903,"stars":3780,"repoUrl":3781,"updatedAt":3907},"core","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":9,"name":10,"logoUrl":11,"githubOrg":10},[3904,3905,3906],{"name":3774,"slug":3775,"type":16},{"name":3777,"slug":3778,"type":16},{"name":3804,"slug":3805,"type":16},"2026-07-30T05:25:52.366295",125,{"items":3910,"total":4010},[3911,3929,3944,3959,3972,3984,3996],{"slug":3912,"name":3912,"fn":3913,"description":3914,"org":3915,"tags":3916,"stars":21,"repoUrl":22,"updatedAt":3928},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3917,3919,3922,3925,3926],{"name":3918,"slug":29,"type":16},"AI SDK",{"name":3920,"slug":3921,"type":16},"Code Execution","code-execution",{"name":3923,"slug":3924,"type":16},"Sandboxing","sandboxing",{"name":10,"slug":9,"type":16},{"name":3927,"slug":43,"type":16},"TypeScript","2026-07-16T06:04:13.597905",{"slug":3930,"name":3930,"fn":3931,"description":3932,"org":3933,"tags":3934,"stars":21,"repoUrl":22,"updatedAt":3943},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3935,3938,3940],{"name":3936,"slug":3937,"type":16},"Agents","agents",{"name":3939,"slug":27,"type":16},"AI",{"name":3941,"slug":3942,"type":16},"Middleware","middleware","2026-07-30T05:26:10.404565",{"slug":3945,"name":3946,"fn":3947,"description":3948,"org":3949,"tags":3950,"stars":21,"repoUrl":22,"updatedAt":3958},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3951,3952,3955,3957],{"name":3918,"slug":29,"type":16},{"name":3953,"slug":3954,"type":16},"Configuration","configuration",{"name":3956,"slug":35,"type":16},"LLM",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:17.82075",{"slug":3960,"name":3961,"fn":3962,"description":3963,"org":3964,"tags":3965,"stars":21,"repoUrl":22,"updatedAt":3971},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3966,3969,3970],{"name":3967,"slug":3968,"type":16},"API Development","api-development",{"name":3956,"slug":35,"type":16},{"name":10,"slug":9,"type":16},"2026-07-16T06:04:10.093367",{"slug":3973,"name":3974,"fn":3975,"description":3976,"org":3977,"tags":3978,"stars":21,"repoUrl":22,"updatedAt":3983},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3979,3980,3981,3982],{"name":3967,"slug":3968,"type":16},{"name":3777,"slug":3778,"type":16},{"name":3956,"slug":35,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:11.505241",{"slug":3985,"name":3986,"fn":3987,"description":3988,"org":3989,"tags":3990,"stars":21,"repoUrl":22,"updatedAt":3995},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[3991,3992,3993,3994],{"name":3939,"slug":27,"type":16},{"name":3777,"slug":3778,"type":16},{"name":18,"slug":19,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:53:35.503176",{"slug":3997,"name":3998,"fn":3999,"description":4000,"org":4001,"tags":4002,"stars":21,"repoUrl":22,"updatedAt":4009},"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":9,"name":10,"logoUrl":11,"githubOrg":10},[4003,4004,4005,4008],{"name":3939,"slug":27,"type":16},{"name":3967,"slug":3968,"type":16},{"name":4006,"slug":4007,"type":16},"Backend","backend",{"name":10,"slug":9,"type":16},"2026-07-17T06:06:39.855351",27]