@assistant-ui/mcp-docs-server 0.2.1 → 0.2.3
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 +3 -3
- package/.docs/organized/code-examples/with-a2a.md +5 -4
- package/.docs/organized/code-examples/with-ag-ui.md +7 -6
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +14 -13
- package/.docs/organized/code-examples/with-artifacts.md +12 -11
- package/.docs/organized/code-examples/with-assistant-transport.md +6 -5
- package/.docs/organized/code-examples/with-browser-extension.md +6 -6
- package/.docs/organized/code-examples/with-chain-of-thought.md +16 -14
- package/.docs/organized/code-examples/with-cloud-standalone.md +7 -7
- package/.docs/organized/code-examples/with-cloud.md +11 -10
- package/.docs/organized/code-examples/with-custom-thread-list.md +11 -10
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +14 -13
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +15 -14
- package/.docs/organized/code-examples/with-eve.md +6 -5
- package/.docs/organized/code-examples/with-expo.md +213 -36
- package/.docs/organized/code-examples/with-external-store.md +6 -5
- package/.docs/organized/code-examples/with-ffmpeg.md +11 -10
- package/.docs/organized/code-examples/with-generative-ui.md +263 -29
- package/.docs/organized/code-examples/with-google-adk.md +5 -4
- package/.docs/organized/code-examples/with-heat-graph.md +3 -3
- package/.docs/organized/code-examples/with-image-generation.md +8 -7
- package/.docs/organized/code-examples/with-interactables.md +11 -10
- package/.docs/organized/code-examples/with-langchain.md +10 -9
- package/.docs/organized/code-examples/with-langgraph.md +7 -6
- package/.docs/organized/code-examples/with-livekit.md +15 -14
- package/.docs/organized/code-examples/with-mcp.md +14 -12
- package/.docs/organized/code-examples/with-nuxt.md +511 -575
- package/.docs/organized/code-examples/with-opencode.md +4 -4
- package/.docs/organized/code-examples/with-openui.md +450 -0
- package/.docs/organized/code-examples/with-pi.md +6 -5
- package/.docs/organized/code-examples/with-react-hook-form.md +16 -13
- package/.docs/organized/code-examples/with-react-ink-web.md +65 -15
- package/.docs/organized/code-examples/with-react-ink.md +5 -4
- package/.docs/organized/code-examples/with-react-router.md +8 -7
- package/.docs/organized/code-examples/with-resumable-stream.md +13 -12
- package/.docs/organized/code-examples/with-store.md +3 -3
- package/.docs/organized/code-examples/with-svelte.md +415 -0
- package/.docs/organized/code-examples/with-sveltekit.md +1061 -0
- package/.docs/organized/code-examples/with-tanstack.md +10 -9
- package/.docs/organized/code-examples/with-tap-runtime.md +5 -4
- package/.docs/organized/code-examples/with-virtualized-thread.md +6 -5
- package/.docs/organized/code-examples/with-vue.md +2 -2
- package/.docs/raw/docs/{(docs) → (getting-started)}/cli.mdx +6 -1
- package/.docs/raw/docs/{(docs) → (getting-started)}/devtools.mdx +1 -1
- package/.docs/raw/docs/{(docs) → (getting-started)}/index.mdx +4 -2
- package/.docs/raw/docs/{(docs) → (getting-started)}/installation.mdx +26 -26
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +6 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +6 -1
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +5 -1
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +9 -2
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/{react-ai-sdk.mdx → ai-sdk.mdx} +43 -18
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +61 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +3 -3
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +20 -2
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +32 -1
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +1 -1
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +10 -10
- package/.docs/raw/docs/cloud/ai-sdk.mdx +4 -2
- package/.docs/raw/docs/cloud/index.mdx +1 -1
- package/.docs/raw/docs/copilots/assistant-frame.mdx +19 -8
- package/.docs/raw/docs/guides/attachments.mdx +4 -4
- package/.docs/raw/docs/guides/branching.mdx +1 -1
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +1 -1
- package/.docs/raw/docs/guides/context-api.mdx +15 -17
- package/.docs/raw/docs/guides/dictation.mdx +2 -2
- package/.docs/raw/docs/guides/electron.mdx +1 -1
- package/.docs/raw/docs/guides/latex.mdx +1 -1
- package/.docs/raw/docs/guides/mentions.mdx +2 -0
- package/.docs/raw/docs/guides/message-timing.mdx +11 -5
- package/.docs/raw/docs/guides/quoting.mdx +1 -1
- package/.docs/raw/docs/guides/resumable-streams.mdx +3 -3
- package/.docs/raw/docs/guides/speech.mdx +1 -1
- package/.docs/raw/docs/guides/suggestions.mdx +8 -5
- package/.docs/raw/docs/guides/voice.mdx +1 -1
- package/.docs/raw/docs/ink/hooks.mdx +1 -1
- package/.docs/raw/docs/ink/index.mdx +3 -2
- package/.docs/raw/docs/ink/migration.mdx +1 -1
- package/.docs/raw/docs/ink/primitives.mdx +1 -1
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/{cloudflare-agents/overview.mdx → cloudflare-agents.mdx} +4 -3
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/index.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +149 -131
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +2 -2
- package/.docs/raw/docs/migrations/v0-15.mdx +34 -0
- package/.docs/raw/docs/primitives/action-bar.mdx +1 -1
- package/.docs/raw/docs/primitives/assistant-modal.mdx +1 -1
- package/.docs/raw/docs/primitives/attachment.mdx +1 -1
- package/.docs/raw/docs/primitives/branch-picker.mdx +1 -1
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +3 -3
- package/.docs/raw/docs/primitives/composer.mdx +1 -1
- package/.docs/raw/docs/primitives/error.mdx +1 -1
- package/.docs/raw/docs/primitives/message.mdx +1 -1
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +1 -1
- package/.docs/raw/docs/primitives/suggestion.mdx +4 -2
- package/.docs/raw/docs/primitives/thread-list.mdx +1 -1
- package/.docs/raw/docs/primitives/thread.mdx +2 -2
- package/.docs/raw/docs/react-native/adapters.mdx +1 -1
- package/.docs/raw/docs/react-native/index.mdx +2 -2
- package/.docs/raw/docs/react-native/migration.mdx +2 -2
- package/.docs/raw/docs/react-native/primitives.mdx +142 -5
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +48 -6
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +3 -3
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +4 -4
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +31 -16
- package/.docs/raw/docs/runtimes/claude-managed-agents.mdx +118 -0
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +3 -3
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +3 -3
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +2 -1
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +73 -33
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +6 -2
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +4 -0
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +9 -2
- package/.docs/raw/docs/tools/backend.mdx +4 -4
- package/.docs/raw/docs/tools/defining-tools.mdx +21 -2
- package/.docs/raw/docs/tools/generative-ui-primitive.mdx +180 -0
- package/.docs/raw/docs/tools/generative-ui-slack.mdx +167 -0
- package/.docs/raw/docs/tools/generative-ui-teams.mdx +160 -0
- package/.docs/raw/docs/tools/generative-ui.mdx +224 -211
- package/.docs/raw/docs/tools/index.mdx +2 -1
- package/.docs/raw/docs/tools/interactables.mdx +8 -7
- package/.docs/raw/docs/tools/mcp-apps.mdx +18 -1
- package/.docs/raw/docs/tools/mcp.mdx +2 -2
- package/.docs/raw/docs/tools/openui.mdx +175 -0
- package/.docs/raw/docs/tools/tool-ui.mdx +18 -7
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +7 -3
- package/.docs/raw/docs/ui/assistant-modal.mdx +3 -3
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -1
- package/.docs/raw/docs/ui/attachment.mdx +50 -3
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +36 -1
- package/.docs/raw/docs/ui/context-display.mdx +1 -1
- package/.docs/raw/docs/ui/directive-text.mdx +1 -1
- package/.docs/raw/docs/ui/file.mdx +2 -2
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +1 -1
- package/.docs/raw/docs/ui/image.mdx +2 -2
- package/.docs/raw/docs/ui/markdown.mdx +40 -1
- package/.docs/raw/docs/ui/mermaid.mdx +1 -1
- package/.docs/raw/docs/ui/message-timing.mdx +1 -1
- package/.docs/raw/docs/ui/model-selector.mdx +4 -4
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -1
- package/.docs/raw/docs/ui/quote.mdx +3 -3
- package/.docs/raw/docs/ui/reasoning.mdx +31 -3
- package/.docs/raw/docs/ui/scrollbar.mdx +1 -1
- package/.docs/raw/docs/ui/sources.mdx +10 -1
- package/.docs/raw/docs/ui/streamdown.mdx +2 -2
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -1
- package/.docs/raw/docs/ui/thread-list.mdx +40 -1
- package/.docs/raw/docs/ui/thread.mdx +49 -2
- package/.docs/raw/docs/ui/tool-fallback.mdx +23 -9
- package/.docs/raw/docs/ui/tool-group.mdx +1 -1
- package/.docs/raw/docs/ui/voice.mdx +1 -1
- package/.docs/raw/docs/utilities/react-o11y.mdx +2 -2
- package/dist/xulux/catalog-client.d.ts.map +1 -1
- package/dist/xulux/catalog-client.js +51 -6
- package/dist/xulux/catalog-client.js.map +1 -1
- package/dist/xulux/types.d.ts +7 -7
- package/dist/xulux/types.d.ts.map +1 -1
- package/dist/xulux/types.js.map +1 -1
- package/package.json +5 -5
- package/src/tools/tests/docs.test.ts +10 -7
- package/src/tools/tests/path-traversal.test.ts +5 -2
- package/src/tools/tests/xulux-templates.test.ts +63 -0
- package/src/xulux/catalog-client.ts +68 -23
- package/src/xulux/types.ts +17 -13
- package/.docs/raw/docs/tools/interactables-legacy.mdx +0 -423
- package/.docs/raw/docs/ui/accordion.mdx +0 -266
- package/.docs/raw/docs/ui/badge.mdx +0 -150
- package/.docs/raw/docs/ui/diff-viewer.mdx +0 -280
- package/.docs/raw/docs/ui/dot-matrix.mdx +0 -133
- package/.docs/raw/docs/ui/number-roll.mdx +0 -154
- package/.docs/raw/docs/ui/select.mdx +0 -254
- package/.docs/raw/docs/ui/tabs.mdx +0 -271
- /package/.docs/raw/docs/{(docs) → (getting-started)}/architecture.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/base-ui.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/llm.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/rtl.mdx +0 -0
|
@@ -65,10 +65,7 @@ import {
|
|
|
65
65
|
StatusBarPrimitive,
|
|
66
66
|
useAui,
|
|
67
67
|
} from "@assistant-ui/react-ink";
|
|
68
|
-
import {
|
|
69
|
-
useChatRuntime,
|
|
70
|
-
AssistantChatTransport,
|
|
71
|
-
} from "@assistant-ui/react-ai-sdk";
|
|
68
|
+
import { useChatRuntime, AssistantChatTransport } from "@assistant-ui/ai-sdk";
|
|
72
69
|
import { lastAssistantMessageIsCompleteWithToolCalls } from "ai";
|
|
73
70
|
import { Thread } from "./thread";
|
|
74
71
|
|
|
@@ -79,10 +76,62 @@ const CHAT_API =
|
|
|
79
76
|
: "https://www.assistant-ui.com/api/chat");
|
|
80
77
|
|
|
81
78
|
const MODEL_NAME = "assistant-ui";
|
|
79
|
+
const ANONYMOUS_SESSION_HEADER = "x-assistant-ui-anonymous-session";
|
|
80
|
+
|
|
81
|
+
// Mirrors examples/with-expo/hooks/anonymous-session-fetch.ts; keep in sync.
|
|
82
|
+
function createAnonymousSessionFetch(chatApi: string): typeof fetch {
|
|
83
|
+
let tokenPromise: Promise<string | null> | null = null;
|
|
84
|
+
|
|
85
|
+
const getToken = () => {
|
|
86
|
+
tokenPromise ??= (async () => {
|
|
87
|
+
const endpoint = new URL(chatApi, window.location.origin);
|
|
88
|
+
endpoint.pathname = "/api/anonymous-session";
|
|
89
|
+
endpoint.search = "";
|
|
90
|
+
const response = await fetch(endpoint, { credentials: "same-origin" });
|
|
91
|
+
if (!response.ok) {
|
|
92
|
+
throw new Error("Unable to start an anonymous session");
|
|
93
|
+
}
|
|
94
|
+
if (response.status === 204) return null;
|
|
95
|
+
const payload = (await response.json()) as { token?: unknown };
|
|
96
|
+
if (typeof payload.token !== "string" || !payload.token) {
|
|
97
|
+
throw new Error("Anonymous session token is missing");
|
|
98
|
+
}
|
|
99
|
+
return payload.token;
|
|
100
|
+
})().catch(() => {
|
|
101
|
+
tokenPromise = null;
|
|
102
|
+
return null;
|
|
103
|
+
});
|
|
104
|
+
return tokenPromise;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return async (input, init) => {
|
|
108
|
+
const requestTemplate =
|
|
109
|
+
input instanceof Request ? new Request(input, init) : null;
|
|
110
|
+
|
|
111
|
+
const send = async () => {
|
|
112
|
+
const headers = new Headers(requestTemplate?.headers ?? init?.headers);
|
|
113
|
+
const token = await getToken();
|
|
114
|
+
if (token) headers.set(ANONYMOUS_SESSION_HEADER, token);
|
|
115
|
+
if (requestTemplate) {
|
|
116
|
+
return fetch(requestTemplate.clone(), { headers });
|
|
117
|
+
}
|
|
118
|
+
return fetch(input, { ...init, headers });
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const response = await send();
|
|
122
|
+
if (response.status !== 401) return response;
|
|
123
|
+
tokenPromise = null;
|
|
124
|
+
return send();
|
|
125
|
+
};
|
|
126
|
+
}
|
|
82
127
|
|
|
83
128
|
export const InkApp = () => {
|
|
84
129
|
const transport = useMemo(
|
|
85
|
-
() =>
|
|
130
|
+
() =>
|
|
131
|
+
new AssistantChatTransport({
|
|
132
|
+
api: CHAT_API,
|
|
133
|
+
fetch: createAnonymousSessionFetch(CHAT_API),
|
|
134
|
+
}),
|
|
86
135
|
[],
|
|
87
136
|
);
|
|
88
137
|
const runtime = useChatRuntime({
|
|
@@ -406,6 +455,7 @@ export default function InkTerminal() {
|
|
|
406
455
|
// Mirrors examples/with-react-ink/src/components/thread.tsx; keep in sync.
|
|
407
456
|
import { Box, Text, useStdout } from "ink";
|
|
408
457
|
import {
|
|
458
|
+
AuiIf,
|
|
409
459
|
ThreadPrimitive,
|
|
410
460
|
ComposerPrimitive,
|
|
411
461
|
MessagePrimitive,
|
|
@@ -477,7 +527,7 @@ const Loading = () => (
|
|
|
477
527
|
export const Thread = () => {
|
|
478
528
|
return (
|
|
479
529
|
<ThreadPrimitive.Root>
|
|
480
|
-
<
|
|
530
|
+
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
481
531
|
<Box flexDirection="column" marginBottom={1}>
|
|
482
532
|
<Text>
|
|
483
533
|
A real LLM streaming into a real Ink render loop in your browser.
|
|
@@ -486,7 +536,7 @@ export const Thread = () => {
|
|
|
486
536
|
{' try: "what is assistant-ui?" or "how do I render markdown?"'}
|
|
487
537
|
</Text>
|
|
488
538
|
</Box>
|
|
489
|
-
</
|
|
539
|
+
</AuiIf>
|
|
490
540
|
|
|
491
541
|
<ThreadPrimitive.Messages>
|
|
492
542
|
{({ message }) =>
|
|
@@ -551,22 +601,22 @@ export default config;
|
|
|
551
601
|
"start": "next start"
|
|
552
602
|
},
|
|
553
603
|
"dependencies": {
|
|
554
|
-
"@assistant-ui/
|
|
604
|
+
"@assistant-ui/ai-sdk": "workspace:*",
|
|
555
605
|
"@assistant-ui/react-ink": "workspace:*",
|
|
556
606
|
"@assistant-ui/react-ink-markdown": "workspace:*",
|
|
557
|
-
"@wterm/dom": "^0.3.
|
|
558
|
-
"@wterm/react": "^0.3.
|
|
559
|
-
"ai": "^7.0.
|
|
607
|
+
"@wterm/dom": "^0.3.4",
|
|
608
|
+
"@wterm/react": "^0.3.4",
|
|
609
|
+
"ai": "^7.0.77",
|
|
560
610
|
"ink": "^7.1.1",
|
|
561
611
|
"ink-web": "^0.2.0",
|
|
562
|
-
"next": "^16.3.
|
|
612
|
+
"next": "^16.3.2",
|
|
563
613
|
"react": "^19.2.8",
|
|
564
614
|
"react-dom": "^19.2.8",
|
|
565
615
|
"react-reconciler": "^0.33.0",
|
|
566
616
|
"scheduler": "^0.27.0"
|
|
567
617
|
},
|
|
568
618
|
"devDependencies": {
|
|
569
|
-
"@types/node": "^26.
|
|
619
|
+
"@types/node": "^26.2.0",
|
|
570
620
|
"@types/react": "^19.2.18",
|
|
571
621
|
"typescript": "^7.0.2"
|
|
572
622
|
}
|
|
@@ -607,7 +657,7 @@ The terminal opens on [localhost:8081](http://localhost:8081), and the docs app
|
|
|
607
657
|
|
|
608
658
|
Ink has no official web target, so this app renders the real `@assistant-ui/react-ink` component tree through [ink-web](https://github.com/cjroth/ink-web)'s browser build of Ink, bridged to a [wterm](https://github.com/vercel-labs/wterm) terminal. wterm renders to the DOM, so text selection, copy, find, and screen readers work natively.
|
|
609
659
|
|
|
610
|
-
Chat requests go to the assistant-ui docs site's `/api/chat`, the same pattern as the React Native demo at [assistant-ui-expo.vercel.app](https://assistant-ui-expo.vercel.app).
|
|
660
|
+
Chat requests go to the assistant-ui docs site's `/api/chat`, the same pattern as the React Native demo at [assistant-ui-expo.vercel.app](https://assistant-ui-expo.vercel.app). The app obtains a signed anonymous session when the backend supports it and holds no API keys; custom backends without the session route continue to receive normal chat requests.
|
|
611
661
|
|
|
612
662
|
## Learn more
|
|
613
663
|
|
|
@@ -670,7 +720,7 @@ export default supportsHyperlinks;
|
|
|
670
720
|
{
|
|
671
721
|
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
672
722
|
"ignoreCommand": "bash ../../scripts/vercel-ignore-changeset-release.sh",
|
|
673
|
-
"buildCommand": "cd ../.. && pnpm turbo build --filter=@assistant-ui/react-ink --filter=@assistant-ui/react-ink-markdown --filter=@assistant-ui/
|
|
723
|
+
"buildCommand": "cd ../.. && pnpm turbo build --filter=@assistant-ui/react-ink --filter=@assistant-ui/react-ink-markdown --filter=@assistant-ui/ai-sdk && cd examples/with-react-ink-web && pnpm run build",
|
|
674
724
|
"outputDirectory": "out",
|
|
675
725
|
"framework": null,
|
|
676
726
|
"headers": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/react": "^19.2.18",
|
|
24
|
-
"esbuild": "^0.28.
|
|
25
|
-
"tsx": "^4.23.
|
|
24
|
+
"esbuild": "^0.28.2",
|
|
25
|
+
"tsx": "^4.23.12",
|
|
26
26
|
"typescript": "^7.0.2"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -86,6 +86,7 @@ export const App = () => {
|
|
|
86
86
|
```tsx
|
|
87
87
|
import { Box, Text } from "ink";
|
|
88
88
|
import {
|
|
89
|
+
AuiIf,
|
|
89
90
|
ThreadPrimitive,
|
|
90
91
|
ComposerPrimitive,
|
|
91
92
|
MessagePrimitive,
|
|
@@ -143,7 +144,7 @@ const Loading = () => (
|
|
|
143
144
|
export const Thread = () => {
|
|
144
145
|
return (
|
|
145
146
|
<ThreadPrimitive.Root>
|
|
146
|
-
<
|
|
147
|
+
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
147
148
|
<Box flexDirection="column" marginBottom={1}>
|
|
148
149
|
<Text>
|
|
149
150
|
Working in this project. <Text color="yellow">fetchUser()</Text> is
|
|
@@ -151,7 +152,7 @@ export const Thread = () => {
|
|
|
151
152
|
</Text>
|
|
152
153
|
<Text dimColor>{' try: "make fetchUser retry on failure"'}</Text>
|
|
153
154
|
</Box>
|
|
154
|
-
</
|
|
155
|
+
</AuiIf>
|
|
155
156
|
|
|
156
157
|
<ThreadPrimitive.Messages>
|
|
157
158
|
{({ message }) =>
|
|
@@ -520,7 +520,7 @@ export async function action({ request }: Route.ActionArgs) {
|
|
|
520
520
|
|
|
521
521
|
while (continueLoop) {
|
|
522
522
|
const response = await openai.chat.completions.create({
|
|
523
|
-
model: "gpt-5.
|
|
523
|
+
model: "gpt-5.6-luna",
|
|
524
524
|
messages: openaiMessages,
|
|
525
525
|
tools,
|
|
526
526
|
stream: true,
|
|
@@ -783,10 +783,10 @@ export default function Home() {
|
|
|
783
783
|
"@react-router/serve": "^8.3.0",
|
|
784
784
|
"class-variance-authority": "^0.7.1",
|
|
785
785
|
"clsx": "^2.1.1",
|
|
786
|
-
"eventsource-parser": "^
|
|
786
|
+
"eventsource-parser": "^4.1.0",
|
|
787
787
|
"isbot": "^5.2.1",
|
|
788
|
-
"lucide-react": "^1.
|
|
789
|
-
"openai": "^7.
|
|
788
|
+
"lucide-react": "^1.33.0",
|
|
789
|
+
"openai": "^7.5.0",
|
|
790
790
|
"react": "^19.2.8",
|
|
791
791
|
"react-dom": "^19.2.8",
|
|
792
792
|
"react-router": "^8.3.0",
|
|
@@ -796,14 +796,14 @@ export default function Home() {
|
|
|
796
796
|
"devDependencies": {
|
|
797
797
|
"@react-router/dev": "^8.3.0",
|
|
798
798
|
"@tailwindcss/vite": "^4.3.3",
|
|
799
|
-
"@types/node": "^26.
|
|
799
|
+
"@types/node": "^26.2.0",
|
|
800
800
|
"@types/react": "^19.2.18",
|
|
801
|
-
"@types/react-dom": "^19.2.
|
|
801
|
+
"@types/react-dom": "^19.2.5",
|
|
802
802
|
"tailwindcss": "^4.3.3",
|
|
803
803
|
"tw-animate-css": "^1.4.0",
|
|
804
804
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
805
805
|
"typescript-7": "npm:typescript@^7.0.2",
|
|
806
|
-
"vite": "^8.2.
|
|
806
|
+
"vite": "^8.2.2",
|
|
807
807
|
"vite-tsconfig-paths": "^6.1.1"
|
|
808
808
|
}
|
|
809
809
|
}
|
|
@@ -892,6 +892,7 @@ npm run dev
|
|
|
892
892
|
"@/components/assistant-ui/*": [
|
|
893
893
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
894
894
|
],
|
|
895
|
+
"@/hooks/*": ["../../packages/ui/src/hooks/*"],
|
|
895
896
|
"@/components/ui/*": [
|
|
896
897
|
"../../packages/ui/src/components/ui/base/*",
|
|
897
898
|
"../../packages/ui/src/components/ui/radix/*"
|
|
@@ -120,7 +120,7 @@ async function buildOpenAIBody({
|
|
|
120
120
|
}),
|
|
121
121
|
});
|
|
122
122
|
const result = streamText({
|
|
123
|
-
model: openai("gpt-5.
|
|
123
|
+
model: openai("gpt-5.6-luna"),
|
|
124
124
|
messages: await convertToModelMessages(messages),
|
|
125
125
|
...(system ? { system } : {}),
|
|
126
126
|
stopWhen: stepCountIs(10),
|
|
@@ -374,7 +374,7 @@ import {
|
|
|
374
374
|
AssistantChatTransport,
|
|
375
375
|
createResumableSessionStorage,
|
|
376
376
|
useChatRuntime,
|
|
377
|
-
} from "@assistant-ui/
|
|
377
|
+
} from "@assistant-ui/ai-sdk";
|
|
378
378
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
379
379
|
|
|
380
380
|
const storage = createResumableSessionStorage();
|
|
@@ -514,23 +514,23 @@ export default withAui(nextConfig);
|
|
|
514
514
|
"start": "next start"
|
|
515
515
|
},
|
|
516
516
|
"dependencies": {
|
|
517
|
-
"@ai-sdk/openai": "^4.0.
|
|
518
|
-
"@ai-sdk/react": "^4.0.
|
|
517
|
+
"@ai-sdk/openai": "^4.0.46",
|
|
518
|
+
"@ai-sdk/react": "^4.0.80",
|
|
519
|
+
"@assistant-ui/ai-sdk": "workspace:*",
|
|
519
520
|
"@assistant-ui/react": "workspace:*",
|
|
520
|
-
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
521
521
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
522
522
|
"@assistant-ui/store": "workspace:*",
|
|
523
523
|
"@assistant-ui/tap": "workspace:*",
|
|
524
524
|
"@assistant-ui/ui": "workspace:*",
|
|
525
|
-
"ai": "^7.0.
|
|
525
|
+
"ai": "^7.0.77",
|
|
526
526
|
"assistant-stream": "workspace:*",
|
|
527
527
|
"class-variance-authority": "^0.7.1",
|
|
528
528
|
"clsx": "^2.1.1",
|
|
529
|
-
"lucide-react": "^1.
|
|
530
|
-
"next": "^16.3.
|
|
529
|
+
"lucide-react": "^1.33.0",
|
|
530
|
+
"next": "^16.3.2",
|
|
531
531
|
"react": "^19.2.8",
|
|
532
532
|
"react-dom": "^19.2.8",
|
|
533
|
-
"redis": "^6.2.
|
|
533
|
+
"redis": "^6.2.1",
|
|
534
534
|
"tailwind-merge": "^3.6.0",
|
|
535
535
|
"zod": "^4.4.3"
|
|
536
536
|
},
|
|
@@ -538,9 +538,9 @@ export default withAui(nextConfig);
|
|
|
538
538
|
"@assistant-ui/next": "workspace:*",
|
|
539
539
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
540
540
|
"@tailwindcss/postcss": "^4.3.3",
|
|
541
|
-
"@types/node": "^26.
|
|
541
|
+
"@types/node": "^26.2.0",
|
|
542
542
|
"@types/react": "^19.2.18",
|
|
543
|
-
"@types/react-dom": "^19.2.
|
|
543
|
+
"@types/react-dom": "^19.2.5",
|
|
544
544
|
"postcss": "^8.5.26",
|
|
545
545
|
"tailwindcss": "^4.3.3",
|
|
546
546
|
"tw-animate-css": "^1.4.0",
|
|
@@ -579,7 +579,7 @@ Open [http://localhost:3000](http://localhost:3000), send a prompt, then reload
|
|
|
579
579
|
|
|
580
580
|
## Client integration
|
|
581
581
|
|
|
582
|
-
The browser side is wired through two helpers from `@assistant-ui/
|
|
582
|
+
The browser side is wired through two helpers from `@assistant-ui/ai-sdk`:
|
|
583
583
|
|
|
584
584
|
- `createResumableSessionStorage()` returns a small `sessionStorage`-backed storage object for the pending stream id. Pass `{ key }` to namespace per route. Use `localStorage` instead if you want a stream that survives full browser restarts (and accept the cross-tab race that comes with it).
|
|
585
585
|
- `AssistantChatTransport` accepts a `resumable` option. When set, the transport captures the `x-resumable-stream-id` response header, watches the SSE body for the `finish` event so the stored id is cleared on natural completion (cancellation leaves it intact), and redirects `chat.resumeStream()` reconnects to the configured `resumeApi`.
|
|
@@ -648,6 +648,7 @@ docker run -d --name redis -p 6379:6379 redis:7-alpine
|
|
|
648
648
|
"@/components/assistant-ui/*": [
|
|
649
649
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
650
650
|
],
|
|
651
|
+
"@/hooks/*": ["../../packages/ui/src/hooks/*"],
|
|
651
652
|
"@/components/ui/*": [
|
|
652
653
|
"../../packages/ui/src/components/ui/base/*",
|
|
653
654
|
"../../packages/ui/src/components/ui/radix/*"
|
|
@@ -501,7 +501,7 @@ export default withAui(nextConfig);
|
|
|
501
501
|
"dependencies": {
|
|
502
502
|
"@assistant-ui/store": "workspace:*",
|
|
503
503
|
"@assistant-ui/tap": "workspace:*",
|
|
504
|
-
"next": "^16.3.
|
|
504
|
+
"next": "^16.3.2",
|
|
505
505
|
"react": "^19.2.8",
|
|
506
506
|
"react-dom": "^19.2.8"
|
|
507
507
|
},
|
|
@@ -509,9 +509,9 @@ export default withAui(nextConfig);
|
|
|
509
509
|
"@assistant-ui/next": "workspace:*",
|
|
510
510
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
511
511
|
"@tailwindcss/postcss": "^4.3.3",
|
|
512
|
-
"@types/node": "^26.
|
|
512
|
+
"@types/node": "^26.2.0",
|
|
513
513
|
"@types/react": "^19.2.18",
|
|
514
|
-
"@types/react-dom": "^19.2.
|
|
514
|
+
"@types/react-dom": "^19.2.5",
|
|
515
515
|
"postcss": "^8.5.26",
|
|
516
516
|
"tailwindcss": "^4.3.3",
|
|
517
517
|
"tw-animate-css": "^1.4.0",
|