@assistant-ui/mcp-docs-server 0.1.31 → 0.1.32
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 +8 -8
- package/.docs/organized/code-examples/with-a2a.md +10 -10
- package/.docs/organized/code-examples/with-ag-ui.md +11 -11
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +13 -13
- package/.docs/organized/code-examples/with-artifacts.md +13 -13
- package/.docs/organized/code-examples/with-assistant-transport.md +10 -10
- package/.docs/organized/code-examples/with-browser-extension.md +345 -0
- package/.docs/organized/code-examples/with-chain-of-thought.md +54 -17
- package/.docs/organized/code-examples/with-cloud-standalone.md +13 -13
- package/.docs/organized/code-examples/with-cloud.md +13 -13
- package/.docs/organized/code-examples/with-custom-thread-list.md +13 -13
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +17 -16
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +17 -16
- package/.docs/organized/code-examples/with-expo.md +24 -24
- package/.docs/organized/code-examples/with-external-store.md +10 -10
- package/.docs/organized/code-examples/with-ffmpeg.md +13 -13
- package/.docs/organized/code-examples/with-generative-ui.md +210 -13
- package/.docs/organized/code-examples/with-google-adk.md +10 -10
- package/.docs/organized/code-examples/with-heat-graph.md +8 -8
- package/.docs/organized/code-examples/with-image-generation.md +454 -0
- package/.docs/organized/code-examples/with-interactables.md +13 -13
- package/.docs/organized/code-examples/with-langchain.md +12 -12
- package/.docs/organized/code-examples/with-langgraph.md +15 -12
- package/.docs/organized/code-examples/with-livekit.md +18 -17
- package/.docs/organized/code-examples/with-mcp.md +748 -0
- package/.docs/organized/code-examples/with-opencode.md +11 -11
- package/.docs/organized/code-examples/with-parent-id-grouping.md +11 -11
- package/.docs/organized/code-examples/with-react-hook-form.md +14 -14
- package/.docs/organized/code-examples/with-react-ink.md +4 -4
- package/.docs/organized/code-examples/with-react-router.md +15 -15
- package/.docs/organized/code-examples/with-resumable-stream.md +660 -0
- package/.docs/organized/code-examples/with-store.md +8 -8
- package/.docs/organized/code-examples/with-tanstack.md +14 -14
- package/.docs/organized/code-examples/with-tap-runtime.md +11 -10
- package/.docs/raw/docs/(docs)/cli.mdx +1 -0
- package/.docs/raw/docs/(docs)/index.mdx +2 -2
- package/.docs/raw/docs/(docs)/installation.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +26 -24
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +20 -12
- package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +44 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +37 -16
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +12 -23
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +37 -8
- package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +11 -9
- package/.docs/raw/docs/(reference)/api-reference/context-providers/scoped-providers.mdx +64 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +52 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +36 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +98 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +18 -13
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +18 -57
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +640 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +15 -28
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +64 -18
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +434 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/cloud-ai-sdk.mdx +24 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +11 -12
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +79 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +52 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/registry.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +110 -131
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +78 -221
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +127 -242
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +39 -20
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +66 -87
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +50 -58
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +80 -48
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +67 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +323 -461
- package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +36 -43
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +29 -24
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +63 -245
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +175 -591
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +65 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +35 -22
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +57 -140
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +70 -161
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +84 -108
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +77 -96
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +173 -349
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +9 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +10 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +15 -70
- package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +18 -13
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +25 -28
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +11 -63
- package/.docs/raw/docs/(reference)/api-reference/runtimes/queue-state.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +11 -48
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +10 -47
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +18 -30
- package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +68 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +39 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +79 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +42 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +92 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/assistant-transport.mdx +48 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +62 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/utilities/index.mdx +19 -0
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +131 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +54 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/speech-dictation.mdx +36 -0
- package/.docs/raw/docs/cloud/ai-sdk.mdx +1 -1
- package/.docs/raw/docs/cloud/index.mdx +2 -2
- package/.docs/raw/docs/guides/attachments.mdx +4 -4
- package/.docs/raw/docs/guides/branching.mdx +1 -1
- package/.docs/raw/docs/guides/chain-of-thought.mdx +5 -5
- package/.docs/raw/docs/guides/context-api.mdx +4 -4
- package/.docs/raw/docs/guides/dictation.mdx +2 -2
- package/.docs/raw/docs/guides/editing.mdx +1 -1
- package/.docs/raw/docs/guides/generative-ui.mdx +142 -0
- package/.docs/raw/docs/guides/image-generation.mdx +74 -0
- package/.docs/raw/docs/guides/index.mdx +2 -2
- package/.docs/raw/docs/guides/interactables.mdx +2 -2
- package/.docs/raw/docs/guides/latex.mdx +2 -2
- package/.docs/raw/docs/guides/mcp-apps.mdx +231 -0
- package/.docs/raw/docs/guides/mentions.mdx +2 -2
- package/.docs/raw/docs/guides/message-timing.mdx +38 -5
- package/.docs/raw/docs/guides/multi-agent.mdx +2 -2
- package/.docs/raw/docs/guides/quoting.mdx +1 -1
- package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +212 -0
- package/.docs/raw/docs/guides/resumable-stream-stores.mdx +152 -0
- package/.docs/raw/docs/guides/resumable-streams.mdx +210 -0
- package/.docs/raw/docs/guides/slash-commands.mdx +1 -1
- package/.docs/raw/docs/guides/speech.mdx +2 -2
- package/.docs/raw/docs/guides/suggestions.mdx +88 -4
- package/.docs/raw/docs/guides/tool-ui.mdx +2 -2
- package/.docs/raw/docs/guides/tools.mdx +66 -5
- package/.docs/raw/docs/guides/voice.mdx +2 -2
- package/.docs/raw/docs/ink/adapters.mdx +37 -1
- package/.docs/raw/docs/ink/custom-backend.mdx +59 -8
- package/.docs/raw/docs/ink/index.mdx +10 -11
- package/.docs/raw/docs/ink/primitives.mdx +349 -8
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/clerk.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +282 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/gateways/index.mdx +9 -4
- package/.docs/raw/docs/integrations/index.mdx +15 -3
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +8 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +8 -4
- package/.docs/raw/docs/integrations/tools/react-mcp.mdx +337 -0
- package/.docs/raw/docs/primitives/composer.mdx +53 -0
- package/.docs/raw/docs/primitives/index.mdx +2 -2
- package/.docs/raw/docs/primitives/suggestion.mdx +9 -0
- package/.docs/raw/docs/react-native/hooks.mdx +2 -2
- package/.docs/raw/docs/react-native/index.mdx +4 -4
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +4 -4
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +32 -1
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +7 -2
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +7 -0
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +27 -2
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +9 -1
- package/.docs/raw/docs/runtimes/custom/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +12 -5
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +11 -1
- package/.docs/raw/docs/ui/mcp-config.mdx +102 -0
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/sources.mdx +17 -0
- package/.docs/raw/docs/ui/streamdown.mdx +34 -2
- package/.docs/raw/docs/ui/thread-list.mdx +2 -2
- package/.docs/raw/docs/ui/thread.mdx +2 -2
- package/README.md +14 -72
- package/dist/constants.d.ts +12 -9
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +13 -9
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts +4 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/code-examples.js +109 -121
- package/dist/prepare-docs/code-examples.js.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts +4 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.js +45 -42
- package/dist/prepare-docs/copy-raw.js.map +1 -1
- package/dist/prepare-docs/prepare.d.ts +1 -2
- package/dist/prepare-docs/prepare.js +17 -17
- package/dist/prepare-docs/prepare.js.map +1 -1
- package/dist/stdio.d.ts +1 -3
- package/dist/stdio.js +6 -3
- package/dist/stdio.js.map +1 -1
- package/dist/tools/docs.d.ts +20 -15
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +140 -161
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +20 -15
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +74 -86
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/tests/test-setup.d.ts +5 -2
- package/dist/tools/tests/test-setup.d.ts.map +1 -1
- package/dist/tools/tests/test-setup.js +21 -28
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/utils/logger.d.ts +8 -5
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +17 -17
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/mcp-format.d.ts +8 -5
- package/dist/utils/mcp-format.d.ts.map +1 -1
- package/dist/utils/mcp-format.js +9 -9
- package/dist/utils/mcp-format.js.map +1 -1
- package/dist/utils/mdx.d.ts +8 -6
- package/dist/utils/mdx.d.ts.map +1 -1
- package/dist/utils/mdx.js +22 -22
- package/dist/utils/mdx.js.map +1 -1
- package/dist/utils/paths.d.ts +9 -6
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +66 -76
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/security.d.ts +4 -1
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js +19 -40
- package/dist/utils/security.js.map +1 -1
- package/package.json +5 -5
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +0 -41
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +0 -40
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +0 -260
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +0 -103
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +0 -254
- package/dist/prepare-docs/prepare.d.ts.map +0 -1
- package/dist/stdio.d.ts.map +0 -1
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/deprecation-policy.mdx +0 -0
- /package/.docs/raw/docs/{(reference) → migrations}/react-compatibility.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/react-langgraph-v0-7.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-11.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-12.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-14.mdx +0 -0
|
@@ -44,7 +44,7 @@ export async function POST(req: Request) {
|
|
|
44
44
|
: {};
|
|
45
45
|
|
|
46
46
|
const result = streamText({
|
|
47
|
-
model: openai("gpt-
|
|
47
|
+
model: openai("gpt-5.4-nano"),
|
|
48
48
|
messages: await convertToModelMessages(messages),
|
|
49
49
|
stopWhen: stepCountIs(10),
|
|
50
50
|
...(system ? { system } : {}),
|
|
@@ -355,6 +355,106 @@ export default function Home() {
|
|
|
355
355
|
|
|
356
356
|
```
|
|
357
357
|
|
|
358
|
+
## app/primitive/page.tsx
|
|
359
|
+
|
|
360
|
+
```tsx
|
|
361
|
+
"use client";
|
|
362
|
+
|
|
363
|
+
import { GenerativeUIRender, type GenerativeUISpec } from "@assistant-ui/react";
|
|
364
|
+
import { componentsAllowlist } from "@/components/gui";
|
|
365
|
+
|
|
366
|
+
const UnknownComponentFallback = ({ component }: { component: string }) => (
|
|
367
|
+
<span className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">
|
|
368
|
+
unknown component: {component}
|
|
369
|
+
</span>
|
|
370
|
+
);
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Self-contained demo of the GenerativeUI primitive.
|
|
374
|
+
*
|
|
375
|
+
* Renders a hand-written `GenerativeUISpec` directly via `GenerativeUIRender`,
|
|
376
|
+
* the same renderer that backs `MessagePrimitive.GenerativeUI` when a
|
|
377
|
+
* `generative-ui` part flows through `MessagePrimitive.Parts`.
|
|
378
|
+
*
|
|
379
|
+
* In a real integration the spec arrives as a `generative-ui` message part
|
|
380
|
+
* from the agent; the consumer-provided allowlist is the security boundary.
|
|
381
|
+
*/
|
|
382
|
+
const exampleSpec: GenerativeUISpec = {
|
|
383
|
+
root: [
|
|
384
|
+
{
|
|
385
|
+
component: "Card",
|
|
386
|
+
props: {
|
|
387
|
+
title: "Welcome",
|
|
388
|
+
description: "An agent-described card with a primary CTA.",
|
|
389
|
+
},
|
|
390
|
+
children: [
|
|
391
|
+
{
|
|
392
|
+
component: "Stack",
|
|
393
|
+
props: { gap: "sm" },
|
|
394
|
+
children: [
|
|
395
|
+
{
|
|
396
|
+
component: "Text",
|
|
397
|
+
children: [
|
|
398
|
+
"This card was rendered from a JSON spec emitted by the agent.",
|
|
399
|
+
],
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
component: "Button",
|
|
403
|
+
props: {
|
|
404
|
+
label: "Get started",
|
|
405
|
+
variant: "primary",
|
|
406
|
+
onClickPrompt: "open onboarding",
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
],
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
component: "Card",
|
|
415
|
+
props: { title: "Stats" },
|
|
416
|
+
children: [
|
|
417
|
+
{
|
|
418
|
+
component: "Stack",
|
|
419
|
+
props: { direction: "row", gap: "md" },
|
|
420
|
+
children: [
|
|
421
|
+
{ component: "Stat", props: { label: "Revenue", value: "$124k" } },
|
|
422
|
+
{
|
|
423
|
+
component: "Stat",
|
|
424
|
+
props: { label: "Active Users", value: "8.2k" },
|
|
425
|
+
},
|
|
426
|
+
{ component: "Stat", props: { label: "Latency", value: "42ms" } },
|
|
427
|
+
],
|
|
428
|
+
},
|
|
429
|
+
],
|
|
430
|
+
},
|
|
431
|
+
],
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
export default function GenerativeUIPrimitivePage() {
|
|
435
|
+
return (
|
|
436
|
+
<main className="mx-auto flex h-full max-w-2xl flex-col gap-6 p-8">
|
|
437
|
+
<header>
|
|
438
|
+
<h1 className="font-bold text-2xl">MessagePrimitive.GenerativeUI</h1>
|
|
439
|
+
<p className="mt-1 text-muted-foreground text-sm">
|
|
440
|
+
Agent-described React UI rendered from a JSON spec via a
|
|
441
|
+
consumer-provided component allowlist.
|
|
442
|
+
</p>
|
|
443
|
+
</header>
|
|
444
|
+
|
|
445
|
+
<section className="flex flex-col gap-4">
|
|
446
|
+
<GenerativeUIRender
|
|
447
|
+
spec={exampleSpec}
|
|
448
|
+
components={componentsAllowlist}
|
|
449
|
+
Fallback={UnknownComponentFallback}
|
|
450
|
+
/>
|
|
451
|
+
</section>
|
|
452
|
+
</main>
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
|
|
358
458
|
## components.json
|
|
359
459
|
|
|
360
460
|
```json
|
|
@@ -697,6 +797,103 @@ export const DatePickerToolUI = makeAssistantToolUI<
|
|
|
697
797
|
|
|
698
798
|
```
|
|
699
799
|
|
|
800
|
+
## components/gui/index.tsx
|
|
801
|
+
|
|
802
|
+
```tsx
|
|
803
|
+
"use client";
|
|
804
|
+
|
|
805
|
+
import type { ComponentType, PropsWithChildren } from "react";
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* The component allowlist passed to `<MessagePrimitive.GenerativeUI />`.
|
|
809
|
+
* The agent's JSON spec can reference any of these by name.
|
|
810
|
+
*/
|
|
811
|
+
|
|
812
|
+
const Card: ComponentType<
|
|
813
|
+
PropsWithChildren<{ title?: string; description?: string }>
|
|
814
|
+
> = ({ title, description, children }) => (
|
|
815
|
+
<div className="rounded-xl border bg-card p-4 shadow-sm">
|
|
816
|
+
{title ? <div className="font-semibold text-base">{title}</div> : null}
|
|
817
|
+
{description ? (
|
|
818
|
+
<div className="mt-1 text-muted-foreground text-sm">{description}</div>
|
|
819
|
+
) : null}
|
|
820
|
+
{children ? <div className="mt-3">{children}</div> : null}
|
|
821
|
+
</div>
|
|
822
|
+
);
|
|
823
|
+
|
|
824
|
+
const Button: ComponentType<
|
|
825
|
+
PropsWithChildren<{
|
|
826
|
+
label?: string;
|
|
827
|
+
variant?: "primary" | "secondary";
|
|
828
|
+
onClickPrompt?: string;
|
|
829
|
+
}>
|
|
830
|
+
> = ({ label, variant = "primary", onClickPrompt, children }) => {
|
|
831
|
+
const cls =
|
|
832
|
+
variant === "primary"
|
|
833
|
+
? "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
834
|
+
: "bg-secondary text-secondary-foreground hover:bg-secondary/80";
|
|
835
|
+
return (
|
|
836
|
+
<button
|
|
837
|
+
type="button"
|
|
838
|
+
className={`mt-2 inline-flex items-center rounded-md px-3 py-1.5 font-medium text-sm ${cls}`}
|
|
839
|
+
onClick={() => {
|
|
840
|
+
if (onClickPrompt) {
|
|
841
|
+
// In a richer integration this would call composer.setText / send.
|
|
842
|
+
alert(`button -> ${onClickPrompt}`);
|
|
843
|
+
}
|
|
844
|
+
}}
|
|
845
|
+
>
|
|
846
|
+
{children ?? label ?? "Click"}
|
|
847
|
+
</button>
|
|
848
|
+
);
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
const Stack: ComponentType<
|
|
852
|
+
PropsWithChildren<{ gap?: "sm" | "md" | "lg"; direction?: "row" | "column" }>
|
|
853
|
+
> = ({ gap = "md", direction = "column", children }) => {
|
|
854
|
+
const gapClass = gap === "sm" ? "gap-2" : gap === "lg" ? "gap-6" : "gap-4";
|
|
855
|
+
const dirClass = direction === "row" ? "flex-row" : "flex-col";
|
|
856
|
+
return <div className={`flex ${dirClass} ${gapClass}`}>{children}</div>;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
const Heading: ComponentType<
|
|
860
|
+
PropsWithChildren<{ level?: 1 | 2 | 3; children?: React.ReactNode }>
|
|
861
|
+
> = ({ level = 2, children }) => {
|
|
862
|
+
const cls =
|
|
863
|
+
level === 1
|
|
864
|
+
? "text-2xl font-bold"
|
|
865
|
+
: level === 2
|
|
866
|
+
? "text-lg font-semibold"
|
|
867
|
+
: "text-base font-semibold";
|
|
868
|
+
const Tag = `h${level}` as keyof React.JSX.IntrinsicElements;
|
|
869
|
+
return <Tag className={cls}>{children}</Tag>;
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
const Text: ComponentType<PropsWithChildren> = ({ children }) => (
|
|
873
|
+
<p className="text-foreground text-sm leading-6">{children}</p>
|
|
874
|
+
);
|
|
875
|
+
|
|
876
|
+
const Stat: ComponentType<{ label: string; value: string | number }> = ({
|
|
877
|
+
label,
|
|
878
|
+
value,
|
|
879
|
+
}) => (
|
|
880
|
+
<div className="flex flex-col rounded-lg border bg-muted/40 p-3">
|
|
881
|
+
<span className="text-muted-foreground text-xs">{label}</span>
|
|
882
|
+
<span className="font-semibold text-xl">{value}</span>
|
|
883
|
+
</div>
|
|
884
|
+
);
|
|
885
|
+
|
|
886
|
+
export const componentsAllowlist = {
|
|
887
|
+
Card,
|
|
888
|
+
Button,
|
|
889
|
+
Stack,
|
|
890
|
+
Heading,
|
|
891
|
+
Text,
|
|
892
|
+
Stat,
|
|
893
|
+
} as const;
|
|
894
|
+
|
|
895
|
+
```
|
|
896
|
+
|
|
700
897
|
## components/location-tool-ui.tsx
|
|
701
898
|
|
|
702
899
|
```tsx
|
|
@@ -787,29 +984,29 @@ export default nextConfig;
|
|
|
787
984
|
"start": "next start"
|
|
788
985
|
},
|
|
789
986
|
"dependencies": {
|
|
790
|
-
"@ai-sdk/openai": "^3.0.
|
|
987
|
+
"@ai-sdk/openai": "^3.0.64",
|
|
791
988
|
"@assistant-ui/react": "workspace:*",
|
|
792
989
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
793
990
|
"@assistant-ui/ui": "workspace:*",
|
|
794
|
-
"ai": "^6.0.
|
|
991
|
+
"ai": "^6.0.188",
|
|
795
992
|
"class-variance-authority": "^0.7.1",
|
|
796
993
|
"clsx": "^2.1.1",
|
|
797
|
-
"lucide-react": "^1.
|
|
798
|
-
"next": "^16.2.
|
|
799
|
-
"react": "^19.2.
|
|
800
|
-
"react-dom": "^19.2.
|
|
994
|
+
"lucide-react": "^1.16.0",
|
|
995
|
+
"next": "^16.2.6",
|
|
996
|
+
"react": "^19.2.6",
|
|
997
|
+
"react-dom": "^19.2.6",
|
|
801
998
|
"recharts": "^3.8.1",
|
|
802
|
-
"tailwind-merge": "^3.
|
|
999
|
+
"tailwind-merge": "^3.6.0",
|
|
803
1000
|
"zod": "^4.4.3"
|
|
804
1001
|
},
|
|
805
1002
|
"devDependencies": {
|
|
806
1003
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
807
|
-
"@tailwindcss/postcss": "^4.
|
|
808
|
-
"@types/node": "^25.
|
|
809
|
-
"@types/react": "^19.2.
|
|
1004
|
+
"@tailwindcss/postcss": "^4.3.0",
|
|
1005
|
+
"@types/node": "^25.9.1",
|
|
1006
|
+
"@types/react": "^19.2.15",
|
|
810
1007
|
"@types/react-dom": "^19.2.3",
|
|
811
|
-
"postcss": "^8.5.
|
|
812
|
-
"tailwindcss": "^4.
|
|
1008
|
+
"postcss": "^8.5.15",
|
|
1009
|
+
"tailwindcss": "^4.3.0",
|
|
813
1010
|
"tw-animate-css": "^1.4.0",
|
|
814
1011
|
"typescript": "^6.0.3"
|
|
815
1012
|
}
|
|
@@ -307,21 +307,21 @@ export default nextConfig;
|
|
|
307
307
|
"@google/adk": "^1.1.0",
|
|
308
308
|
"class-variance-authority": "^0.7.1",
|
|
309
309
|
"clsx": "^2.1.1",
|
|
310
|
-
"lucide-react": "^1.
|
|
311
|
-
"next": "^16.2.
|
|
312
|
-
"react": "^19.2.
|
|
313
|
-
"react-dom": "^19.2.
|
|
314
|
-
"tailwind-merge": "^3.
|
|
310
|
+
"lucide-react": "^1.16.0",
|
|
311
|
+
"next": "^16.2.6",
|
|
312
|
+
"react": "^19.2.6",
|
|
313
|
+
"react-dom": "^19.2.6",
|
|
314
|
+
"tailwind-merge": "^3.6.0",
|
|
315
315
|
"zod": "^4.4.3"
|
|
316
316
|
},
|
|
317
317
|
"devDependencies": {
|
|
318
318
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
319
|
-
"@tailwindcss/postcss": "^4.
|
|
320
|
-
"@types/node": "^25.
|
|
321
|
-
"@types/react": "^19.2.
|
|
319
|
+
"@tailwindcss/postcss": "^4.3.0",
|
|
320
|
+
"@types/node": "^25.9.1",
|
|
321
|
+
"@types/react": "^19.2.15",
|
|
322
322
|
"@types/react-dom": "^19.2.3",
|
|
323
|
-
"postcss": "^8.5.
|
|
324
|
-
"tailwindcss": "^4.
|
|
323
|
+
"postcss": "^8.5.15",
|
|
324
|
+
"tailwindcss": "^4.3.0",
|
|
325
325
|
"tw-animate-css": "^1.4.0",
|
|
326
326
|
"typescript": "^6.0.3"
|
|
327
327
|
}
|
|
@@ -270,18 +270,18 @@ export default nextConfig;
|
|
|
270
270
|
},
|
|
271
271
|
"dependencies": {
|
|
272
272
|
"heat-graph": "workspace:*",
|
|
273
|
-
"next": "^16.2.
|
|
274
|
-
"react": "^19.2.
|
|
275
|
-
"react-dom": "^19.2.
|
|
273
|
+
"next": "^16.2.6",
|
|
274
|
+
"react": "^19.2.6",
|
|
275
|
+
"react-dom": "^19.2.6"
|
|
276
276
|
},
|
|
277
277
|
"devDependencies": {
|
|
278
278
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
279
|
-
"@tailwindcss/postcss": "^4.
|
|
280
|
-
"@types/node": "^25.
|
|
281
|
-
"@types/react": "^19.2.
|
|
279
|
+
"@tailwindcss/postcss": "^4.3.0",
|
|
280
|
+
"@types/node": "^25.9.1",
|
|
281
|
+
"@types/react": "^19.2.15",
|
|
282
282
|
"@types/react-dom": "^19.2.3",
|
|
283
|
-
"postcss": "^8.5.
|
|
284
|
-
"tailwindcss": "^4.
|
|
283
|
+
"postcss": "^8.5.15",
|
|
284
|
+
"tailwindcss": "^4.3.0",
|
|
285
285
|
"typescript": "^6.0.3"
|
|
286
286
|
}
|
|
287
287
|
}
|