@assistant-ui/mcp-docs-server 0.1.35 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/organized/code-examples/waterfall.md +1 -1
- package/.docs/organized/code-examples/with-a2a.md +2 -2
- package/.docs/organized/code-examples/with-ag-ui.md +2 -2
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +4 -4
- package/.docs/organized/code-examples/with-artifacts.md +4 -4
- package/.docs/organized/code-examples/with-assistant-transport.md +70 -54
- package/.docs/organized/code-examples/with-browser-extension.md +4 -4
- package/.docs/organized/code-examples/with-chain-of-thought.md +40 -89
- package/.docs/organized/code-examples/with-cloud-standalone.md +4 -4
- package/.docs/organized/code-examples/with-cloud.md +4 -4
- package/.docs/organized/code-examples/with-custom-thread-list.md +4 -4
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +7 -7
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +7 -7
- package/.docs/organized/code-examples/with-eve.md +343 -0
- package/.docs/organized/code-examples/with-expo.md +910 -933
- package/.docs/organized/code-examples/with-external-store.md +2 -2
- package/.docs/organized/code-examples/with-ffmpeg.md +5 -8
- package/.docs/organized/code-examples/with-generative-ui.md +6 -6
- package/.docs/organized/code-examples/with-google-adk.md +3 -3
- package/.docs/organized/code-examples/with-heat-graph.md +1 -1
- package/.docs/organized/code-examples/with-image-generation.md +4 -4
- package/.docs/organized/code-examples/with-interactables.md +166 -338
- package/.docs/organized/code-examples/with-langchain.md +4 -4
- package/.docs/organized/code-examples/with-langgraph.md +20 -157
- package/.docs/organized/code-examples/with-livekit.md +8 -8
- package/.docs/organized/code-examples/with-mcp.md +19 -10
- package/.docs/organized/code-examples/with-opencode.md +3 -3
- package/.docs/organized/code-examples/with-pi.md +9 -7
- package/.docs/organized/code-examples/with-react-hook-form.md +13 -6
- package/.docs/organized/code-examples/with-react-ink-web.md +5 -5
- package/.docs/organized/code-examples/with-react-ink.md +1 -1
- package/.docs/organized/code-examples/with-react-router.md +11 -11
- package/.docs/organized/code-examples/with-resumable-stream.md +5 -5
- package/.docs/organized/code-examples/with-store.md +1 -1
- package/.docs/organized/code-examples/with-tanstack.md +7 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +2 -2
- package/.docs/organized/code-examples/with-virtualized-thread.md +44 -24
- package/.docs/raw/docs/(docs)/cli.mdx +5 -3
- package/.docs/raw/docs/(docs)/devtools.mdx +25 -2
- package/.docs/raw/docs/(docs)/index.mdx +5 -2
- package/.docs/raw/docs/(docs)/installation.mdx +5 -2
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +16 -16
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +73 -42
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +3 -20
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +234 -166
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +51 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +70 -38
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +30 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +7 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +26 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +15 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +103 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +16 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +56 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +12 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +12 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +14 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +57 -1
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +6 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables-legacy.mdx +55 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +151 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +15 -15
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +20 -20
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +25 -9
- package/.docs/raw/docs/cloud/langgraph.mdx +1 -1
- package/.docs/raw/docs/guides/headless-composer-input.mdx +113 -0
- package/.docs/raw/docs/guides/latex.mdx +28 -22
- package/.docs/raw/docs/guides/mentions.mdx +32 -7
- package/.docs/raw/docs/guides/slash-commands.mdx +3 -6
- package/.docs/raw/docs/guides/speech.mdx +5 -7
- package/.docs/raw/docs/guides/virtualization.mdx +77 -7
- package/.docs/raw/docs/guides/voice.mdx +3 -2
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +4 -12
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +7 -10
- package/.docs/raw/docs/integrations/auth/clerk.mdx +3 -9
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +3 -8
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +11 -8
- package/.docs/raw/docs/integrations/index.mdx +6 -13
- package/.docs/raw/docs/integrations/observability/helicone.mdx +3 -4
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +3 -5
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +5 -4
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +4 -3
- package/.docs/raw/docs/migrations/react-langgraph-v0-7.mdx +2 -2
- package/.docs/raw/docs/primitives/composer.mdx +8 -0
- package/.docs/raw/docs/primitives/thread-list.mdx +30 -6
- package/.docs/raw/docs/primitives/thread.mdx +24 -0
- package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +24 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +54 -0
- package/.docs/raw/docs/runtimes/eve/overview.mdx +100 -0
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +143 -0
- package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/langchain.mdx +388 -20
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -1
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +6 -0
- package/.docs/raw/docs/tools/defining-tools.mdx +9 -0
- package/.docs/raw/docs/tools/generative-ui.mdx +37 -0
- package/.docs/raw/docs/tools/interactables-legacy.mdx +410 -0
- package/.docs/raw/docs/tools/interactables.mdx +892 -223
- package/.docs/raw/docs/tools/mcp-apps.mdx +12 -3
- package/.docs/raw/docs/tools/mcp.mdx +9 -4
- package/.docs/raw/docs/tools/multi-agent.mdx +5 -0
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +17 -3
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +2 -0
- package/.docs/raw/docs/ui/file.mdx +1 -1
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +80 -0
- package/.docs/raw/docs/ui/model-selector.mdx +38 -5
- package/.docs/raw/docs/ui/part-grouping.mdx +38 -0
- package/.docs/raw/docs/utilities/react-o11y.mdx +92 -6
- package/README.md +1 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.js +0 -4
- package/dist/prepare-docs/copy-raw.js.map +1 -1
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +18 -6
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +3 -1
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +1 -1
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.d.ts +7 -0
- package/dist/tools/resources.d.ts.map +1 -0
- package/dist/tools/resources.js +74 -0
- package/dist/tools/resources.js.map +1 -0
- package/dist/tools/search.d.ts +33 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +39 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/tests/test-setup.d.ts.map +1 -1
- package/dist/tools/tests/test-setup.js +3 -1
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/utils/mdx.d.ts +2 -1
- package/dist/utils/mdx.d.ts.map +1 -1
- package/dist/utils/mdx.js +19 -2
- package/dist/utils/mdx.js.map +1 -1
- package/dist/utils/paths.d.ts +2 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +18 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/search.d.ts +10 -0
- package/dist/utils/search.d.ts.map +1 -0
- package/dist/utils/search.js +97 -0
- package/dist/utils/search.js.map +1 -0
- package/package.json +4 -4
- package/src/constants.ts +2 -0
- package/src/index.ts +28 -6
- package/src/prepare-docs/copy-raw.ts +0 -5
- package/src/tools/docs.ts +30 -4
- package/src/tools/examples.ts +4 -2
- package/src/tools/resources.ts +114 -0
- package/src/tools/search.ts +46 -0
- package/src/tools/tests/completions.test.ts +46 -0
- package/src/tools/tests/directory-size-cap.test.ts +50 -0
- package/src/tools/tests/mcp-protocol.test.ts +21 -1
- package/src/tools/tests/resources.test.ts +102 -0
- package/src/tools/tests/search.test.ts +37 -0
- package/src/tools/tests/test-setup.ts +2 -0
- package/src/utils/mdx.ts +21 -1
- package/src/utils/paths.ts +22 -0
- package/src/utils/search.ts +131 -0
- package/.docs/raw/blog/2024-07-29-hello/index.mdx +0 -64
- package/.docs/raw/blog/2024-09-11/index.mdx +0 -10
- package/.docs/raw/blog/2024-12-15/index.mdx +0 -10
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +0 -127
- package/.docs/raw/blog/2026-03-launch-week/index.mdx +0 -258
|
@@ -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.
|
|
303
|
+
typeof ThreadPrimitive.Unstable_MessageById
|
|
304
304
|
>["components"];
|
|
305
305
|
|
|
306
|
-
type
|
|
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
|
|
309
|
-
|
|
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
|
|
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,
|
|
319
|
-
else last.
|
|
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
|
|
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(
|
|
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]!.
|
|
491
|
-
<ThreadPrimitive.
|
|
492
|
-
key={
|
|
493
|
-
|
|
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.
|
|
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.
|
|
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": "^
|
|
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
|
-
|
|
|
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
|
-
| `
|
|
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,10 +67,11 @@ 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` |
|
|
72
|
-
| `with-ag-ui` | [AG-UI protocol](/docs/runtimes/ag-ui) integration | `npx assistant-ui create my-app -e with-ag-ui` |
|
|
74
|
+
| `with-ag-ui` | [AG-UI protocol](/docs/runtimes/ag-ui/overview) integration | `npx assistant-ui create my-app -e with-ag-ui` |
|
|
73
75
|
| `with-assistant-transport` | Custom backend via Assistant Transport | `npx assistant-ui create my-app -e with-assistant-transport` |
|
|
74
76
|
| `with-resumable-stream` | Resumable LLM stream that survives reload mid-response | `npx assistant-ui create my-app -e with-resumable-stream` |
|
|
75
77
|
| `with-chain-of-thought` | Chain-of-thought reasoning, tool calls, and source citations | `npx assistant-ui create my-app -e with-chain-of-thought` |
|
|
@@ -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,
|
|
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
|
-

|
|
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
|
|
56
|
-
npx assistant-ui@latest create -t
|
|
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
|
|
38
|
-
npx assistant-ui@latest create -t
|
|
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
|
-
###
|
|
17
|
+
### getExternalStoreMessages
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
19
|
+
```ts
|
|
20
|
+
const getExternalStoreMessages: <T>(input: { messages: readonly ThreadMessage[]; } | ThreadMessage | ThreadMessage["content"][number]) => T[];
|
|
21
|
+
```
|
|
22
22
|
|
|
23
|
-
|
|
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
|
|
26
|
+
const unstable_convertExternalMessages: <T extends WeakKey>(messages: T[], callback: useExternalMessageConverter.Callback<T>, isRunning: boolean, metadata: useExternalMessageConverter.Metadata) => ThreadMessage[];
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
###
|
|
29
|
+
### unstable_createMessageConverter
|
|
32
30
|
|
|
33
31
|
```ts
|
|
34
|
-
const
|
|
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
|
-
###
|
|
39
|
+
### bindExternalStoreMessage
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
<Callout type="tip">
|
|
42
|
+
<strong>Experimental.</strong> This API is experimental and may change without notice.
|
|
43
|
+
</Callout>
|
|
46
44
|
|
|
47
|
-
|
|
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
|
|
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 {
|
|
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="
|
|
29
|
-
<strong>
|
|
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 */}
|