@assistant-ui/mcp-docs-server 0.1.35 → 0.1.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/.docs/organized/code-examples/waterfall.md +1 -1
  2. package/.docs/organized/code-examples/with-a2a.md +2 -2
  3. package/.docs/organized/code-examples/with-ag-ui.md +2 -2
  4. package/.docs/organized/code-examples/with-ai-sdk-v6.md +4 -4
  5. package/.docs/organized/code-examples/with-artifacts.md +4 -4
  6. package/.docs/organized/code-examples/with-assistant-transport.md +70 -54
  7. package/.docs/organized/code-examples/with-browser-extension.md +4 -4
  8. package/.docs/organized/code-examples/with-chain-of-thought.md +40 -89
  9. package/.docs/organized/code-examples/with-cloud-standalone.md +4 -4
  10. package/.docs/organized/code-examples/with-cloud.md +4 -4
  11. package/.docs/organized/code-examples/with-custom-thread-list.md +4 -4
  12. package/.docs/organized/code-examples/with-elevenlabs-conversational.md +6 -6
  13. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +6 -6
  14. package/.docs/organized/code-examples/with-eve.md +343 -0
  15. package/.docs/organized/code-examples/with-expo.md +909 -932
  16. package/.docs/organized/code-examples/with-external-store.md +2 -2
  17. package/.docs/organized/code-examples/with-ffmpeg.md +5 -8
  18. package/.docs/organized/code-examples/with-generative-ui.md +5 -5
  19. package/.docs/organized/code-examples/with-google-adk.md +2 -2
  20. package/.docs/organized/code-examples/with-heat-graph.md +1 -1
  21. package/.docs/organized/code-examples/with-image-generation.md +4 -4
  22. package/.docs/organized/code-examples/with-interactables.md +166 -338
  23. package/.docs/organized/code-examples/with-langchain.md +4 -4
  24. package/.docs/organized/code-examples/with-langgraph.md +20 -157
  25. package/.docs/organized/code-examples/with-livekit.md +6 -6
  26. package/.docs/organized/code-examples/with-mcp.md +4 -4
  27. package/.docs/organized/code-examples/with-opencode.md +3 -3
  28. package/.docs/organized/code-examples/with-pi.md +9 -7
  29. package/.docs/organized/code-examples/with-react-hook-form.md +13 -6
  30. package/.docs/organized/code-examples/with-react-ink-web.md +5 -5
  31. package/.docs/organized/code-examples/with-react-ink.md +1 -1
  32. package/.docs/organized/code-examples/with-react-router.md +10 -10
  33. package/.docs/organized/code-examples/with-resumable-stream.md +5 -5
  34. package/.docs/organized/code-examples/with-store.md +1 -1
  35. package/.docs/organized/code-examples/with-tanstack.md +5 -5
  36. package/.docs/organized/code-examples/with-tap-runtime.md +2 -2
  37. package/.docs/organized/code-examples/with-virtualized-thread.md +44 -24
  38. package/.docs/raw/docs/(docs)/cli.mdx +4 -2
  39. package/.docs/raw/docs/(docs)/devtools.mdx +25 -2
  40. package/.docs/raw/docs/(docs)/index.mdx +5 -2
  41. package/.docs/raw/docs/(docs)/installation.mdx +5 -2
  42. package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +16 -16
  43. package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +73 -42
  44. package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +3 -20
  45. package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +234 -166
  46. package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +51 -0
  47. package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +4 -1
  48. package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +70 -38
  49. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +30 -0
  50. package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +7 -0
  51. package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +26 -0
  52. package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +15 -0
  53. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +103 -0
  54. package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +16 -0
  55. package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +56 -0
  56. package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +12 -0
  57. package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +12 -0
  58. package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +14 -0
  59. package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +57 -1
  60. package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +6 -0
  61. package/.docs/raw/docs/(reference)/api-reference/tools/interactables-legacy.mdx +55 -0
  62. package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +151 -0
  63. package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +15 -15
  64. package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +20 -20
  65. package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +25 -9
  66. package/.docs/raw/docs/guides/headless-composer-input.mdx +113 -0
  67. package/.docs/raw/docs/guides/latex.mdx +28 -22
  68. package/.docs/raw/docs/guides/mentions.mdx +32 -7
  69. package/.docs/raw/docs/guides/slash-commands.mdx +3 -6
  70. package/.docs/raw/docs/guides/speech.mdx +5 -7
  71. package/.docs/raw/docs/guides/virtualization.mdx +77 -7
  72. package/.docs/raw/docs/guides/voice.mdx +3 -2
  73. package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +4 -12
  74. package/.docs/raw/docs/integrations/auth/better-auth.mdx +7 -10
  75. package/.docs/raw/docs/integrations/auth/clerk.mdx +3 -9
  76. package/.docs/raw/docs/integrations/auth/next-auth.mdx +3 -8
  77. package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +8 -5
  78. package/.docs/raw/docs/integrations/index.mdx +5 -12
  79. package/.docs/raw/docs/integrations/observability/helicone.mdx +3 -4
  80. package/.docs/raw/docs/integrations/observability/langfuse.mdx +3 -5
  81. package/.docs/raw/docs/integrations/observability/langsmith.mdx +3 -2
  82. package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +4 -3
  83. package/.docs/raw/docs/primitives/composer.mdx +8 -0
  84. package/.docs/raw/docs/primitives/thread.mdx +24 -0
  85. package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +21 -0
  86. package/.docs/raw/docs/runtimes/custom/external-store.mdx +54 -0
  87. package/.docs/raw/docs/runtimes/eve/overview.mdx +100 -0
  88. package/.docs/raw/docs/runtimes/eve/quickstart.mdx +143 -0
  89. package/.docs/raw/docs/runtimes/langchain.mdx +386 -18
  90. package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +1 -1
  91. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -1
  92. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +6 -0
  93. package/.docs/raw/docs/tools/defining-tools.mdx +4 -0
  94. package/.docs/raw/docs/tools/interactables-legacy.mdx +410 -0
  95. package/.docs/raw/docs/tools/interactables.mdx +892 -223
  96. package/.docs/raw/docs/tools/mcp.mdx +4 -4
  97. package/.docs/raw/docs/tools/multi-agent.mdx +5 -0
  98. package/.docs/raw/docs/ui/composer-trigger-popover.mdx +2 -0
  99. package/.docs/raw/docs/ui/file.mdx +1 -1
  100. package/.docs/raw/docs/ui/part-grouping.mdx +38 -0
  101. package/.docs/raw/docs/utilities/react-o11y.mdx +92 -6
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +18 -2
  104. package/dist/index.js.map +1 -1
  105. package/package.json +4 -4
  106. package/src/index.ts +14 -6
  107. package/src/tools/tests/mcp-protocol.test.ts +9 -0
@@ -300,23 +300,45 @@ const ESTIMATED_TURN_HEIGHT = 200;
300
300
  const AT_BOTTOM_THRESHOLD = 4;
301
301
 
302
302
  type MessageComponents = ComponentProps<
303
- typeof ThreadPrimitive.MessageByIndex
303
+ typeof ThreadPrimitive.Unstable_MessageById
304
304
  >["components"];
305
305
 
306
- type Turn = { id: string; indices: number[] };
306
+ type MessageRow = {
307
+ id: string;
308
+ role: "user" | "assistant" | "system";
309
+ };
310
+
311
+ type Turn = { id: string; messageIds: string[] };
312
+
313
+ const useThreadMessageRows = (): readonly MessageRow[] => {
314
+ const prevRowsRef = useRef<readonly MessageRow[]>([]);
315
+
316
+ return useAuiState((s) => {
317
+ const messages = s.thread.messages;
318
+ const prev = prevRowsRef.current;
319
+ if (
320
+ prev.length === messages.length &&
321
+ prev.every((row, index) => {
322
+ const message = messages[index]!;
323
+ return row.id === message.id && row.role === message.role;
324
+ })
325
+ ) {
326
+ return prev;
327
+ }
307
328
 
308
- const buildTurns = (signature: string): Turn[] => {
309
- if (!signature) return [];
329
+ const next = messages.map(({ id, role }) => ({ id, role }));
330
+ prevRowsRef.current = next;
331
+ return next;
332
+ });
333
+ };
334
+
335
+ const buildTurns = (messages: readonly MessageRow[]): Turn[] => {
336
+ if (messages.length === 0) return [];
310
337
  const turns: Turn[] = [];
311
- for (const row of signature.split("\n")) {
312
- const firstColon = row.indexOf(":");
313
- const secondColon = row.indexOf(":", firstColon + 1);
314
- const index = Number(row.slice(0, firstColon));
315
- const role = row.slice(firstColon + 1, secondColon);
316
- const id = row.slice(secondColon + 1);
338
+ for (const { id, role } of messages) {
317
339
  const last = turns.at(-1);
318
- if (role === "user" || !last) turns.push({ id, indices: [index] });
319
- else last.indices.push(index);
340
+ if (role === "user" || !last) turns.push({ id, messageIds: [id] });
341
+ else last.messageIds.push(id);
320
342
  }
321
343
  return turns;
322
344
  };
@@ -359,11 +381,9 @@ const Composer: FC = () => (
359
381
  );
360
382
 
361
383
  export const VirtualizedThread: FC = () => {
362
- const signature = useAuiState((s) =>
363
- s.thread.messages.map((m, i) => `${i}:${m.role}:${m.id}`).join("\n"),
364
- );
384
+ const messages = useThreadMessageRows();
365
385
  const isRunning = useAuiState((s) => s.thread.isRunning);
366
- const turns = useMemo(() => buildTurns(signature), [signature]);
386
+ const turns = useMemo(() => buildTurns(messages), [messages]);
367
387
 
368
388
  const scrollerRef = useRef<HTMLDivElement>(null);
369
389
  const contentRef = useRef<HTMLDivElement>(null);
@@ -487,10 +507,10 @@ export const VirtualizedThread: FC = () => {
487
507
  ref={virtualizer.measureElement}
488
508
  className="flex flex-col gap-4 py-3"
489
509
  >
490
- {turns[item.index]!.indices.map((index) => (
491
- <ThreadPrimitive.MessageByIndex
492
- key={index}
493
- index={index}
510
+ {turns[item.index]!.messageIds.map((messageId) => (
511
+ <ThreadPrimitive.Unstable_MessageById
512
+ key={messageId}
513
+ messageId={messageId}
494
514
  components={MESSAGE_COMPONENTS}
495
515
  />
496
516
  ))}
@@ -579,10 +599,10 @@ export default withAui(nextConfig);
579
599
  "@assistant-ui/react": "workspace:*",
580
600
  "@assistant-ui/react-markdown": "workspace:*",
581
601
  "@assistant-ui/ui": "workspace:*",
582
- "@tanstack/react-virtual": "^3.14.2",
602
+ "@tanstack/react-virtual": "^3.14.3",
583
603
  "class-variance-authority": "^0.7.1",
584
604
  "clsx": "^2.1.1",
585
- "lucide-react": "^1.18.0",
605
+ "lucide-react": "^1.21.0",
586
606
  "next": "^16.2.9",
587
607
  "react": "^19.2.7",
588
608
  "react-dom": "^19.2.7",
@@ -592,7 +612,7 @@ export default withAui(nextConfig);
592
612
  "@assistant-ui/next": "workspace:*",
593
613
  "@assistant-ui/x-buildutils": "workspace:*",
594
614
  "@tailwindcss/postcss": "^4.3.1",
595
- "@types/node": "^25.9.3",
615
+ "@types/node": "^26.0.0",
596
616
  "@types/react": "^19.2.17",
597
617
  "@types/react-dom": "^19.2.3",
598
618
  "postcss": "^8.5.15",
@@ -623,7 +643,7 @@ pnpm --filter with-virtualized-thread dev
623
643
  | Concern | File |
624
644
  | --- | --- |
625
645
  | Virtualizer over user turns, padding spacers, `measureElement` | `app/VirtualizedThread.tsx` |
626
- | Per-message rendering through `ThreadPrimitive.MessageByIndex` | `app/VirtualizedThread.tsx` |
646
+ | Id-keyed per-message rendering through `ThreadPrimitive.Unstable_MessageById` | `app/VirtualizedThread.tsx` |
627
647
  | Sticky-bottom auto-follow with a user-scroll disarm guard | `app/VirtualizedThread.tsx` |
628
648
  | External store runtime with seeded messages and a streaming tail | `app/MyRuntimeProvider.tsx` |
629
649
  | Deterministic synthetic thread content | `app/seed-messages.ts` |
@@ -56,8 +56,9 @@ This command scaffolds a project from assistant-ui starter templates or examples
56
56
  | `minimal` | Bare-bones starting point | `npx assistant-ui create -t minimal` |
57
57
  | `cloud` | Cloud-backed persistence starter | `npx assistant-ui create -t cloud` |
58
58
  | `cloud-clerk` | Cloud-backed starter with Clerk auth | `npx assistant-ui create -t cloud-clerk` |
59
- | `langgraph` | LangGraph starter template | `npx assistant-ui create -t langgraph` |
59
+ | `langchain` | LangGraph starter with the react-langchain adapter | `npx assistant-ui create -t langchain` |
60
60
  | `mcp` | MCP starter template | `npx assistant-ui create -t mcp` |
61
+ | `eve` | Eve agent + Next.js starter | `npx assistant-ui create -t eve` |
61
62
 
62
63
  **Available Examples**
63
64
 
@@ -66,6 +67,7 @@ Use `--example` to create a project from one of the monorepo examples with full
66
67
  | Example | Description | Command |
67
68
  |---------|-------------|---------|
68
69
  | `with-ai-sdk-v6` | Vercel AI SDK v6 integration | `npx assistant-ui create my-app -e with-ai-sdk-v6` |
70
+ | `with-eve` | Eve agent integration | `npx assistant-ui create my-app -e with-eve` |
69
71
  | `with-artifacts` | HTML artifact rendering with live preview | `npx assistant-ui create my-app -e with-artifacts` |
70
72
  | `with-langgraph` | LangGraph agent with custom tools | `npx assistant-ui create my-app -e with-langgraph` |
71
73
  | `with-cloud` | Assistant Cloud persistence | `npx assistant-ui create my-app -e with-cloud` |
@@ -116,7 +118,7 @@ Arguments:
116
118
  project-directory name of the project directory
117
119
 
118
120
  Options:
119
- -t, --template <template> template to use (default, minimal, cloud, cloud-clerk, langgraph, mcp)
121
+ -t, --template <template> template to use (default, minimal, cloud, cloud-clerk, langchain, mcp, eve)
120
122
  -e, --example <example> create from an example (e.g., with-langgraph)
121
123
  -p, --preset <name-or-url> preset name or URL (e.g., chatgpt)
122
124
  --native create an Expo / React Native project
@@ -43,9 +43,32 @@ export function AssistantApp() {
43
43
 
44
44
  ### Verify the DevTools overlay
45
45
 
46
- That's it! In development builds you should now see the DevTools in the lower-right corner of your site.
46
+ That's it! In development builds you should now see the DevTools launcher in the lower-right corner of your site. The panel renders inline in an isolated shadow root, and the whole component is stripped from production builds.
47
47
 
48
- ![DevTools floating modal anchored in the lower-right corner of a page](../../../../../.github/assets/devtoolsmodal.png)
48
+ ![DevTools floating launcher anchored in the lower-right corner of a page](../../../../../.github/assets/devtoolsmodal.png)
49
49
 
50
50
  </Step>
51
51
  </Steps>
52
+
53
+ ## Custom tabs
54
+
55
+ The panel is extensible. Pass extra inspector tabs to `DevToolsModal` with `plugins`; each plugin renders from the inspected instance's projected data (`state`, `logs`, `modelContext`, `scopes`).
56
+
57
+ ```tsx
58
+ import { createDevToolsPlugin, DevToolsModal } from "@assistant-ui/react-devtools";
59
+
60
+ const stateTab = createDevToolsPlugin({
61
+ id: "my-state",
62
+ label: "My state",
63
+ Component: ({ data }) => <pre>{JSON.stringify(data.state, null, 2)}</pre>,
64
+ });
65
+
66
+ export function AssistantApp() {
67
+ return (
68
+ <AssistantRuntimeProvider runtime={runtime}>
69
+ <DevToolsModal plugins={[stateTab]} />
70
+ {/* ...your assistant-ui... */}
71
+ </AssistantRuntimeProvider>
72
+ );
73
+ }
74
+ ```
@@ -52,11 +52,14 @@ npx assistant-ui@latest create -t cloud
52
52
  # Assistant Cloud + Clerk authentication
53
53
  npx assistant-ui@latest create -t cloud-clerk
54
54
 
55
- # LangGraph starter template
56
- npx assistant-ui@latest create -t langgraph
55
+ # LangGraph starter (react-langchain adapter)
56
+ npx assistant-ui@latest create -t langchain
57
57
 
58
58
  # MCP starter template
59
59
  npx assistant-ui@latest create -t mcp
60
+
61
+ # Eve agent starter template
62
+ npx assistant-ui@latest create -t eve
60
63
  ```
61
64
 
62
65
  ## What's Next?
@@ -34,11 +34,14 @@ npx assistant-ui@latest create -t cloud
34
34
  # Assistant Cloud + Clerk authentication
35
35
  npx assistant-ui@latest create -t cloud-clerk
36
36
 
37
- # LangGraph starter template
38
- npx assistant-ui@latest create -t langgraph
37
+ # LangGraph starter (react-langchain adapter)
38
+ npx assistant-ui@latest create -t langchain
39
39
 
40
40
  # MCP starter template
41
41
  npx assistant-ui@latest create -t mcp
42
+
43
+ # Eve agent starter template
44
+ npx assistant-ui@latest create -t eve
42
45
  ```
43
46
 
44
47
  **Add to an existing project:**
@@ -14,39 +14,39 @@ import { useExternalMessageConverter } from "@/generated/typeDocs";
14
14
 
15
15
  ## API Reference
16
16
 
17
- ### bindExternalStoreMessage
17
+ ### getExternalStoreMessages
18
18
 
19
- <Callout type="warn">
20
- <strong>Deprecated.</strong> This API is experimental and may change without notice.
21
- </Callout>
19
+ ```ts
20
+ const getExternalStoreMessages: <T>(input: { messages: readonly ThreadMessage[]; } | ThreadMessage | ThreadMessage["content"][number]) => T[];
21
+ ```
22
22
 
23
- Attach the original external store message(s) to a ThreadMessage or message part.
24
- This is a no-op if the target already has a bound message.
25
- Use `getExternalStoreMessages` to retrieve the bound messages later.
23
+ ### unstable_convertExternalMessages
26
24
 
27
25
  ```ts
28
- const bindExternalStoreMessage: <T>(target: object, message: T | T[]) => void;
26
+ const unstable_convertExternalMessages: <T extends WeakKey>(messages: T[], callback: useExternalMessageConverter.Callback<T>, isRunning: boolean, metadata: useExternalMessageConverter.Metadata) => ThreadMessage[];
29
27
  ```
30
28
 
31
- ### getExternalStoreMessages
29
+ ### unstable_createMessageConverter
32
30
 
33
31
  ```ts
34
- const getExternalStoreMessages: <T>(input: { messages: readonly ThreadMessage[]; } | ThreadMessage | ThreadMessage["content"][number]) => T[];
32
+ const unstable_createMessageConverter: <T extends object>(callback: useExternalMessageConverter.Callback<T>) => { useThreadMessages: ({ messages, isRunning, joinStrategy, metadata, }: { messages: T[]; isRunning: boolean; joinStrategy?: JoinStrategy | undefined; metadata?: useExternalMessageConverter.Metadata; }) => ThreadMessage[]; toThreadMessages: (messages: T[], isRunning?: boolean, metadata?: useExternalMessageConverter.Metadata) => ThreadMessage[]; toOriginalMessages: (input: ThreadState | ThreadMessage | ThreadMessage["content"][number]) => unknown[]; toOriginalMessage: (input: ThreadState | ThreadMessage | ThreadMessage["content"][number]) => {}; useOriginalMessage: () => {}; useOriginalMessages: () => unknown[]; };
35
33
  ```
36
34
 
37
35
  ### useExternalMessageConverter
38
36
 
39
37
  <ParametersTable {...useExternalMessageConverter} />
40
38
 
41
- ### unstable_convertExternalMessages
39
+ ### bindExternalStoreMessage
42
40
 
43
- ```ts
44
- const unstable_convertExternalMessages: <T extends WeakKey>(messages: T[], callback: useExternalMessageConverter.Callback<T>, isRunning: boolean, metadata: useExternalMessageConverter.Metadata) => ThreadMessage[];
45
- ```
41
+ <Callout type="tip">
42
+ <strong>Experimental.</strong> This API is experimental and may change without notice.
43
+ </Callout>
46
44
 
47
- ### unstable_createMessageConverter
45
+ Attach the original external store message(s) to a ThreadMessage or message part.
46
+ This is a no-op if the target already has a bound message.
47
+ Use `getExternalStoreMessages` to retrieve the bound messages later.
48
48
 
49
49
  ```ts
50
- const unstable_createMessageConverter: <T extends object>(callback: useExternalMessageConverter.Callback<T>) => { useThreadMessages: ({ messages, isRunning, joinStrategy, metadata, }: { messages: T[]; isRunning: boolean; joinStrategy?: JoinStrategy | undefined; metadata?: useExternalMessageConverter.Metadata; }) => ThreadMessage[]; toThreadMessages: (messages: T[], isRunning?: boolean, metadata?: useExternalMessageConverter.Metadata) => ThreadMessage[]; toOriginalMessages: (input: ThreadState | ThreadMessage | ThreadMessage["content"][number]) => unknown[]; toOriginalMessage: (input: ThreadState | ThreadMessage | ThreadMessage["content"][number]) => {}; useOriginalMessage: () => {}; useOriginalMessages: () => unknown[]; };
50
+ const bindExternalStoreMessage: <T>(target: object, message: T | T[]) => void;
51
51
  ```
52
52
  {/* api-reference:end */}
@@ -3,7 +3,7 @@ title: Composer Trigger Hooks
3
3
  description: Unstable assistant-ui hooks for mention menus, slash commands, and custom composer trigger popovers.
4
4
  ---
5
5
 
6
- import { unstable_useMentionAdapter, unstable_useSlashCommandAdapter } from "@/generated/typeDocs";
6
+ import { unstable_useLiveCompletionAdapter, unstable_useMentionAdapter, unstable_useSlashCommandAdapter } from "@/generated/typeDocs";
7
7
 
8
8
  {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
9
  {/* Do not edit manually. */}
@@ -14,47 +14,6 @@ import { unstable_useMentionAdapter, unstable_useSlashCommandAdapter } from "@/g
14
14
 
15
15
  ## API Reference
16
16
 
17
- ### unstable_useMentionAdapter
18
-
19
- <Callout type="warn">
20
- <strong>Deprecated.</strong> Under active development and might change without notice.
21
- </Callout>
22
-
23
- Creates a spreadable `{ adapter, directive }` bundle for `@` mentions.
24
- Supports tools registered in model context, explicit items, or both —
25
- flat or categorized.
26
-
27
- ```tsx
28
- const mention = unstable_useMentionAdapter();
29
- <ComposerTriggerPopover char="@" {...mention} />
30
- ```
31
-
32
- <ParametersTable {...unstable_useMentionAdapter} />
33
-
34
- ### unstable_useSlashCommandAdapter
35
-
36
- <Callout type="warn">
37
- <strong>Deprecated.</strong> Under active development and may change without notice.
38
- </Callout>
39
-
40
- Bundles slash command definitions (with inline `execute` callbacks) into
41
- `{adapter, action}` that plug directly into `ComposerTriggerPopover`.
42
- `execute` stays in the hook closure and is never attached to the returned
43
- `TriggerItem`, keeping items serializable.
44
-
45
- ```tsx
46
- const slash = unstable_useSlashCommandAdapter({
47
- commands: [
48
- { id: "summarize", execute: () => runSummarize(), icon: "FileText" },
49
- { id: "translate", execute: () => runTranslate(), icon: "Languages" },
50
- ],
51
- });
52
-
53
- <ComposerTriggerPopover char="/" {...slash} />
54
- ```
55
-
56
- <ParametersTable {...unstable_useSlashCommandAdapter} />
57
-
58
17
  ### unstable_useTriggerPopoverRootContext
59
18
 
60
19
  ```ts
@@ -95,4 +54,76 @@ Like `useTriggerPopoverTriggers` but returns an empty map outside a root.
95
54
  ```ts
96
55
  const unstable_useTriggerPopoverTriggersOptional: () => ReadonlyMap<string, RegisteredTrigger>;
97
56
  ```
57
+
58
+ ### unstable_useLiveCompletionAdapter
59
+
60
+ <Callout type="tip">
61
+ <strong>Experimental.</strong> Under active development and may change without notice.
62
+ </Callout>
63
+
64
+ Bridges an async completion source (a server search, a gateway RPC) into the
65
+ synchronous `Unstable_TriggerAdapter` that `ComposerTriggerPopover` consumes.
66
+ `search(query)` returns the last fetched items synchronously and schedules a
67
+ debounced fetch when the query changes; when results arrive the returned
68
+ `adapter` identity changes, which re-runs the popover's lookup so the fresh
69
+ items render. This is a search-only adapter (`categories` are empty).
70
+
71
+ `isLoading` is `true` while a fetch is in flight. Pass it to the popover's
72
+ `isLoading` prop to render a loading state.
73
+
74
+ ```tsx
75
+ const mentions = unstable_useLiveCompletionAdapter({
76
+ fetcher: (query) => searchUsers(query),
77
+ });
78
+
79
+ <ComposerTriggerPopover
80
+ char="@"
81
+ adapter={mentions.adapter}
82
+ isLoading={mentions.isLoading}
83
+ directive={{ onInserted }}
84
+ />
85
+ ```
86
+
87
+ <ParametersTable {...unstable_useLiveCompletionAdapter} />
88
+
89
+ ### unstable_useMentionAdapter
90
+
91
+ <Callout type="tip">
92
+ <strong>Experimental.</strong> Under active development and might change without notice.
93
+ </Callout>
94
+
95
+ Creates a spreadable `{ adapter, directive }` bundle for `@` mentions.
96
+ Supports tools registered in model context, explicit items, or both —
97
+ flat or categorized.
98
+
99
+ ```tsx
100
+ const mention = unstable_useMentionAdapter();
101
+ <ComposerTriggerPopover char="@" {...mention} />
102
+ ```
103
+
104
+ <ParametersTable {...unstable_useMentionAdapter} />
105
+
106
+ ### unstable_useSlashCommandAdapter
107
+
108
+ <Callout type="tip">
109
+ <strong>Experimental.</strong> Under active development and may change without notice.
110
+ </Callout>
111
+
112
+ Bundles slash command definitions (with inline `execute` callbacks) into
113
+ `{adapter, action}` that plug directly into `ComposerTriggerPopover`.
114
+ `execute` stays in the hook closure and is never attached to the returned
115
+ `TriggerItem`, keeping items serializable.
116
+
117
+ ```tsx
118
+ const slash = unstable_useSlashCommandAdapter({
119
+ commands: [
120
+ { id: "summarize", execute: () => runSummarize(), icon: "FileText" },
121
+ { id: "translate", execute: () => runTranslate(), icon: "Languages" },
122
+ ],
123
+ });
124
+
125
+ <ComposerTriggerPopover char="/" {...slash} />
126
+ ```
127
+
128
+ <ParametersTable {...unstable_useSlashCommandAdapter} />
98
129
  {/* api-reference:end */}
@@ -3,7 +3,7 @@ title: Model Context Hooks
3
3
  description: React hooks for registering assistant-ui tools, data renderers, instructions, and model context providers.
4
4
  ---
5
5
 
6
- import { useAssistantInteractable, useAuiToolOverrides, useInteractableState } from "@/generated/typeDocs";
6
+ import { useAuiToolOverrides } from "@/generated/typeDocs";
7
7
 
8
8
  {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
9
  {/* Do not edit manually. */}
@@ -14,19 +14,10 @@ import { useAssistantInteractable, useAuiToolOverrides, useInteractableState } f
14
14
 
15
15
  ## API Reference
16
16
 
17
- ### useAssistantInteractable
18
-
19
- Registers an interactable with the AI assistant.
20
-
21
- This hook handles registration only. To read and write the interactable's
22
- state, use [useInteractableState](/docs/api-reference/hooks/model-context#useinteractablestate) with the returned id.
23
-
24
- <ParametersTable {...useAssistantInteractable} />
25
-
26
17
  ### useAuiToolOverrides
27
18
 
28
- <Callout type="warn">
29
- <strong>Deprecated.</strong> Experimental, API may change.
19
+ <Callout type="tip">
20
+ <strong>Experimental.</strong> Experimental, API may change.
30
21
  </Callout>
31
22
 
32
23
  Overrides toolkit entries for the current assistant scope.
@@ -40,12 +31,4 @@ Overrides are registered at priority 1000, above toolkit defaults. Only one
40
31
  mounted override provider may define a given tool name at a time.
41
32
 
42
33
  <ParametersTable {...useAuiToolOverrides} />
43
-
44
- ### useInteractableState
45
-
46
- Reads and writes the state of a registered interactable.
47
-
48
- Pair with [useAssistantInteractable](/docs/api-reference/hooks/model-context#useassistantinteractable) which handles registration.
49
-
50
- <ParametersTable {...useInteractableState} />
51
34
  {/* api-reference:end */}