@kitn.ai/ui 0.15.0 → 0.16.0
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/README.md +9 -0
- package/bin/mcp.js +22 -0
- package/dist/bash-InADTalH.js +6 -1
- package/dist/components/artifact.d.ts +58 -0
- package/dist/components/attachments.d.ts +67 -0
- package/dist/components/card-fallback.d.ts +10 -0
- package/dist/components/card-renderer.d.ts +13 -0
- package/dist/components/card.d.ts +28 -0
- package/dist/components/chain-of-thought.d.ts +29 -0
- package/dist/components/chat-container.d.ts +19 -0
- package/dist/components/chat-scope-picker.d.ts +9 -0
- package/dist/components/chat-thread.d.ts +93 -0
- package/dist/components/checkpoint.d.ts +20 -0
- package/dist/components/choice-card.d.ts +77 -0
- package/dist/components/code-block.d.ts +16 -0
- package/dist/components/confirm-card.d.ts +57 -0
- package/dist/components/context.d.ts +65 -0
- package/dist/components/conversation-item.d.ts +8 -0
- package/dist/components/conversation-list.d.ts +11 -0
- package/dist/components/embed.d.ts +21 -0
- package/dist/components/empty.d.ts +43 -0
- package/dist/components/feedback-bar.d.ts +45 -0
- package/dist/components/file-tree.d.ts +57 -0
- package/dist/components/file-upload.d.ts +16 -0
- package/dist/components/form-widgets.d.ts +31 -0
- package/dist/components/form.d.ts +103 -0
- package/dist/components/image.d.ts +12 -0
- package/dist/components/link-preview.d.ts +23 -0
- package/dist/components/loader.d.ts +60 -0
- package/dist/components/markdown.d.ts +8 -0
- package/dist/components/message-skills.d.ts +15 -0
- package/dist/components/message.d.ts +54 -0
- package/dist/components/model-switcher.d.ts +8 -0
- package/dist/components/prompt-input.d.ts +38 -0
- package/dist/components/prompt-suggestion.d.ts +13 -0
- package/dist/components/reasoning.d.ts +20 -0
- package/dist/components/response-stream.d.ts +14 -0
- package/dist/components/scroll-button.d.ts +7 -0
- package/dist/components/slash-command.d.ts +15 -0
- package/dist/components/source.d.ts +23 -0
- package/dist/components/tasks-card.d.ts +71 -0
- package/dist/components/text-shimmer.d.ts +9 -0
- package/dist/components/thinking-bar.d.ts +10 -0
- package/dist/components/tool.d.ts +16 -0
- package/dist/components/use-card-resolution.d.ts +12 -0
- package/dist/components/voice-input.d.ts +7 -0
- package/dist/core-AYMC6_lb.js +5874 -12
- package/dist/css-M7EaDHN_.js +6 -1
- package/dist/elements/artifact.d.ts +1 -0
- package/dist/elements/attachments.d.ts +1 -0
- package/dist/elements/card.d.ts +1 -0
- package/dist/elements/cards.d.ts +0 -0
- package/dist/elements/chain-of-thought.d.ts +13 -0
- package/dist/elements/chat-scope-picker.d.ts +1 -0
- package/dist/elements/chat-types.d.ts +41 -0
- package/dist/elements/chat-workspace.d.ts +1 -0
- package/dist/elements/chat.d.ts +1 -0
- package/dist/elements/checkpoint.d.ts +1 -0
- package/dist/elements/choice.d.ts +1 -0
- package/dist/elements/code-block.d.ts +1 -0
- package/dist/elements/confirm-card.d.ts +1 -0
- package/dist/elements/context-meter.d.ts +1 -0
- package/dist/elements/conversation-list.d.ts +11 -0
- package/dist/elements/css.d.ts +1 -0
- package/dist/elements/default-input.d.ts +40 -0
- package/dist/elements/define.d.ts +42 -0
- package/dist/elements/embed.d.ts +1 -0
- package/dist/elements/empty.d.ts +1 -0
- package/dist/elements/feedback-bar.d.ts +1 -0
- package/dist/elements/file-tree.d.ts +1 -0
- package/dist/elements/file-upload.d.ts +1 -0
- package/dist/elements/form.d.ts +1 -0
- package/dist/elements/image.d.ts +1 -0
- package/dist/elements/link-preview.d.ts +1 -0
- package/dist/elements/loader.d.ts +1 -0
- package/dist/elements/markdown.d.ts +1 -0
- package/dist/elements/message-skills.d.ts +17 -0
- package/dist/elements/message.d.ts +1 -0
- package/dist/elements/model-switcher.d.ts +11 -0
- package/dist/elements/popover.d.ts +1 -0
- package/dist/elements/prompt-input.d.ts +9 -0
- package/dist/elements/prompt-suggestions.d.ts +7 -0
- package/dist/elements/reasoning.d.ts +1 -0
- package/dist/elements/register-impl.d.ts +0 -0
- package/dist/elements/register.d.ts +3 -0
- package/dist/elements/remote.d.ts +1 -0
- package/dist/elements/resizable.d.ts +17 -0
- package/dist/elements/response-stream.d.ts +1 -0
- package/dist/elements/scroll-button.d.ts +1 -0
- package/dist/elements/source.d.ts +18 -0
- package/dist/elements/switch.d.ts +1 -0
- package/dist/elements/tasks.d.ts +1 -0
- package/dist/elements/text-shimmer.d.ts +1 -0
- package/dist/elements/thinking-bar.d.ts +1 -0
- package/dist/elements/tool.d.ts +1 -0
- package/dist/elements/voice-input.d.ts +1 -0
- package/dist/elements.d.ts +732 -0
- package/dist/engine-javascript-vq0WuIJl.js +2516 -14
- package/dist/github-dark-dimmed-DUshB20C.js +4 -1
- package/dist/github-light-JYsPkUQd.js +4 -1
- package/dist/html-CPZ3oZQ7.js +10 -1
- package/dist/index.d.ts +112 -2
- package/dist/index.js +13551 -0
- package/dist/javascript-C25yR2R2.js +6 -1
- package/dist/json-DxJze_jm.js +6 -1
- package/dist/kitn-chat.es.js +1 -77
- package/dist/llms/llms-full.txt +1 -1
- package/dist/llms/llms.txt +1 -1
- package/dist/mcp.es.js +2140 -0
- package/dist/primitives/card-contract.d.ts +103 -0
- package/dist/primitives/card-host.d.ts +12 -0
- package/dist/primitives/card-registry.d.ts +17 -0
- package/dist/primitives/card-resolution.d.ts +8 -0
- package/dist/primitives/card-routing.d.ts +12 -0
- package/dist/primitives/card-validate.d.ts +25 -0
- package/dist/primitives/chat-config.d.ts +31 -0
- package/dist/primitives/controllable.d.ts +13 -0
- package/dist/primitives/embed-providers.d.ts +65 -0
- package/dist/primitives/highlighter.d.ts +23 -0
- package/dist/primitives/link-preview.d.ts +47 -0
- package/dist/primitives/pdf-preview.d.ts +50 -0
- package/dist/primitives/use-auto-resize.d.ts +8 -0
- package/dist/primitives/use-resize-observer.d.ts +1 -0
- package/dist/primitives/use-stick-to-bottom.d.ts +5 -0
- package/dist/primitives/use-text-stream.d.ts +19 -0
- package/dist/primitives/use-voice-recorder.d.ts +9 -0
- package/dist/react/index.d.ts +1118 -0
- package/dist/react/runtime.d.ts +15 -0
- package/dist/react.js +265 -0
- package/dist/register-impl-wCsFPoh9.js +77 -0
- package/dist/register-ujhr1nBS.js +1 -0
- package/dist/remote/host-embed.d.ts +33 -0
- package/dist/remote/index.d.ts +2 -0
- package/dist/remote/origin.d.ts +5 -0
- package/dist/remote/provider-runtime.d.ts +27 -0
- package/dist/remote/provider.d.ts +2 -0
- package/dist/remote/validate.d.ts +4 -0
- package/dist/remote/version.d.ts +4 -0
- package/dist/remote/wire.d.ts +53 -0
- package/dist/svelte--5p79yCD.js +15 -1
- package/dist/tsx-B8rCNbgL.js +6 -1
- package/dist/types.d.ts +42 -0
- package/dist/typescript-RycA9KXf.js +6 -1
- package/dist/ui/action-icons.d.ts +11 -0
- package/dist/ui/avatar.d.ts +8 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/collapsible.d.ts +27 -0
- package/dist/ui/dropdown.d.ts +20 -0
- package/dist/ui/hover-card.d.ts +28 -0
- package/dist/ui/overlay.d.ts +67 -0
- package/dist/ui/popover.d.ts +32 -0
- package/dist/ui/resizable.d.ts +76 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/skeleton.d.ts +5 -0
- package/dist/ui/switch.d.ts +19 -0
- package/dist/ui/textarea.d.ts +6 -0
- package/dist/ui/tooltip.d.ts +8 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/vue-BmIZj4XD.js +33 -1
- package/frameworks/react/index.tsx +4 -0
- package/frameworks/react/runtime.tsx +16 -2
- package/llms-full.txt +1 -1
- package/llms.txt +1 -1
- package/package.json +29 -11
- package/src/agent-tooling/archetypes.ts +46 -0
- package/src/agent-tooling/integrations/cloudflare.ts +88 -0
- package/src/agent-tooling/integrations/langgraph.ts +60 -0
- package/src/agent-tooling/integrations/mastra.ts +27 -0
- package/src/agent-tooling/integrations/mock.ts +34 -0
- package/src/agent-tooling/integrations/ollama.ts +47 -0
- package/src/agent-tooling/integrations/openrouter.ts +26 -0
- package/src/agent-tooling/integrations/pi.ts +40 -0
- package/src/agent-tooling/integrations/pydantic-ai.ts +52 -0
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +44 -0
- package/src/agent-tooling/mcp/manifest.ts +128 -0
- package/src/agent-tooling/mcp/server.ts +59 -0
- package/src/agent-tooling/mcp/stdio.ts +18 -0
- package/src/agent-tooling/mcp/tools/debug.ts +305 -0
- package/src/agent-tooling/mcp/tools/reference.ts +132 -0
- package/src/agent-tooling/mcp/tools/scaffold.ts +1627 -0
- package/src/agent-tooling/mcp/tools/theme.ts +340 -0
- package/src/agent-tooling/mcp/tools/types.ts +14 -0
- package/src/agent-tooling/registry.ts +41 -0
- package/src/agent-tooling/types.ts +30 -0
- package/src/elements/compiled.css +1 -1
- package/src/elements/define.tsx +7 -1
- package/src/elements/element-types.d.ts +2 -1
- package/src/elements/register-impl.ts +55 -0
- package/src/elements/register.ts +17 -51
- package/theme.css +4 -2
- package/src/components/artifact.stories.tsx +0 -138
- package/src/components/attachments.stories.tsx +0 -303
- package/src/components/attachments.test.tsx +0 -64
- package/src/components/chain-of-thought.stories.tsx +0 -211
- package/src/components/chat-container.stories.tsx +0 -187
- package/src/components/chat-thread.test.tsx +0 -58
- package/src/components/checkpoint.stories.tsx +0 -102
- package/src/components/code-block.stories.tsx +0 -150
- package/src/components/confirm-card.stories.tsx +0 -74
- package/src/components/context.stories.tsx +0 -229
- package/src/components/context.test.tsx +0 -133
- package/src/components/conversation-item.stories.tsx +0 -125
- package/src/components/conversation-list.stories.tsx +0 -133
- package/src/components/default-input.test.tsx +0 -111
- package/src/components/empty.stories.tsx +0 -434
- package/src/components/feedback-bar.stories.tsx +0 -138
- package/src/components/feedback-bar.test.tsx +0 -103
- package/src/components/file-tree.stories.tsx +0 -73
- package/src/components/file-upload.stories.tsx +0 -156
- package/src/components/image.stories.tsx +0 -89
- package/src/components/loader.stories.tsx +0 -181
- package/src/components/markdown.stories.tsx +0 -180
- package/src/components/message-action-bar.test.tsx +0 -128
- package/src/components/message-narrow.stories.tsx +0 -329
- package/src/components/message-skills.stories.tsx +0 -211
- package/src/components/message.stories.tsx +0 -281
- package/src/components/model-switcher.stories.tsx +0 -123
- package/src/components/model-switcher.test.tsx +0 -65
- package/src/components/prompt-input.stories.tsx +0 -222
- package/src/components/prompt-suggestion.stories.tsx +0 -142
- package/src/components/reasoning.stories.tsx +0 -140
- package/src/components/resizable.test.tsx +0 -226
- package/src/components/scroll-button.stories.tsx +0 -100
- package/src/components/slash-command.stories.tsx +0 -163
- package/src/components/source-list.test.tsx +0 -152
- package/src/components/source.stories.tsx +0 -124
- package/src/components/tasks-card.stories.tsx +0 -78
- package/src/components/text-shimmer.stories.tsx +0 -87
- package/src/components/thinking-bar.stories.tsx +0 -87
- package/src/components/tool.stories.tsx +0 -153
- package/src/components/voice-input.stories.tsx +0 -83
- package/src/elements/artifact.stories.tsx +0 -506
- package/src/elements/attachments.stories.tsx +0 -190
- package/src/elements/card.stories.tsx +0 -113
- package/src/elements/cards.stories.tsx +0 -59
- package/src/elements/catalog.stories.tsx +0 -491
- package/src/elements/chain-of-thought.declarative.test.tsx +0 -153
- package/src/elements/chain-of-thought.stories.tsx +0 -113
- package/src/elements/chat-scope-picker.stories.tsx +0 -73
- package/src/elements/chat-workspace.stories.tsx +0 -288
- package/src/elements/chat.stories.tsx +0 -151
- package/src/elements/checkpoint.stories.tsx +0 -72
- package/src/elements/choice.stories.tsx +0 -240
- package/src/elements/code-block.stories.tsx +0 -83
- package/src/elements/composed-shell.stories.tsx +0 -316
- package/src/elements/confirm-card.stories.tsx +0 -227
- package/src/elements/context-meter.stories.tsx +0 -151
- package/src/elements/conversation-list.declarative.test.tsx +0 -137
- package/src/elements/conversation-list.stories.tsx +0 -243
- package/src/elements/embed.stories.tsx +0 -213
- package/src/elements/empty.stories.tsx +0 -111
- package/src/elements/feedback-bar.stories.tsx +0 -114
- package/src/elements/file-tree.stories.tsx +0 -134
- package/src/elements/file-upload.stories.tsx +0 -82
- package/src/elements/form.stories.tsx +0 -248
- package/src/elements/image.stories.tsx +0 -71
- package/src/elements/link-preview.stories.tsx +0 -209
- package/src/elements/loader.stories.tsx +0 -88
- package/src/elements/markdown.stories.tsx +0 -76
- package/src/elements/message-skills.declarative.test.tsx +0 -104
- package/src/elements/message-skills.stories.tsx +0 -114
- package/src/elements/message.stories.tsx +0 -218
- package/src/elements/model-switcher.declarative.test.tsx +0 -130
- package/src/elements/model-switcher.stories.tsx +0 -198
- package/src/elements/popover.stories.tsx +0 -80
- package/src/elements/prompt-input-slash-command.test.tsx +0 -128
- package/src/elements/prompt-input-stoppable.test.tsx +0 -88
- package/src/elements/prompt-input-toolbar-actions.test.tsx +0 -120
- package/src/elements/prompt-input.stories.tsx +0 -331
- package/src/elements/prompt-suggestions.declarative.test.tsx +0 -164
- package/src/elements/prompt-suggestions.stories.tsx +0 -213
- package/src/elements/reasoning.stories.tsx +0 -77
- package/src/elements/remote.stories.tsx +0 -314
- package/src/elements/resizable.stories.tsx +0 -426
- package/src/elements/response-stream.stories.tsx +0 -79
- package/src/elements/scroll-button.stories.tsx +0 -202
- package/src/elements/scroll-button.test.tsx +0 -148
- package/src/elements/source-list.stories.tsx +0 -143
- package/src/elements/source.stories.tsx +0 -88
- package/src/elements/switch.stories.tsx +0 -56
- package/src/elements/tasks.stories.tsx +0 -237
- package/src/elements/text-shimmer.stories.tsx +0 -64
- package/src/elements/thinking-bar.stories.tsx +0 -72
- package/src/elements/tool.stories.tsx +0 -89
- package/src/elements/voice-input.stories.tsx +0 -88
- package/src/primitives/controllable.test.ts +0 -47
- package/src/stories/chat-panel-layout.stories.tsx +0 -145
- package/src/stories/chat-scene.tsx +0 -571
- package/src/stories/checkpoint-restore.stories.tsx +0 -256
- package/src/stories/context-usage.stories.tsx +0 -212
- package/src/stories/conversation-with-reasoning.stories.tsx +0 -182
- package/src/stories/conversation-with-sources.stories.tsx +0 -471
- package/src/stories/docs/Accessibility.mdx +0 -119
- package/src/stories/docs/ChildElements.mdx +0 -269
- package/src/stories/docs/ForAIAgents.mdx +0 -162
- package/src/stories/docs/GettingStarted.mdx +0 -65
- package/src/stories/docs/Installation.mdx +0 -83
- package/src/stories/docs/Introduction.mdx +0 -50
- package/src/stories/docs/SolidJsAdvanced.mdx +0 -17
- package/src/stories/docs/Theming.mdx +0 -85
- package/src/stories/docs/element-controls.ts +0 -121
- package/src/stories/docs/frameworks/Angular.mdx +0 -245
- package/src/stories/docs/frameworks/Html.mdx +0 -227
- package/src/stories/docs/frameworks/Overview.mdx +0 -47
- package/src/stories/docs/frameworks/React.mdx +0 -227
- package/src/stories/docs/frameworks/Solid.mdx +0 -173
- package/src/stories/docs/frameworks/Svelte.mdx +0 -194
- package/src/stories/docs/frameworks/Vue.mdx +0 -238
- package/src/stories/docs/generative-ui-overview.mdx +0 -186
- package/src/stories/docs/recipes/SpeechToText.mdx +0 -7
- package/src/stories/docs/recipes/Streaming.mdx +0 -68
- package/src/stories/docs/recipes/TextToSpeech.mdx +0 -35
- package/src/stories/docs/theme-editor/canvas.tsx +0 -32
- package/src/stories/docs/theme-editor/inspector.tsx +0 -66
- package/src/stories/docs/theme-editor/presets.test.ts +0 -32
- package/src/stories/docs/theme-editor/presets.ts +0 -64
- package/src/stories/docs/theme-editor/theme-css.test.ts +0 -19
- package/src/stories/docs/theme-editor/theme-css.ts +0 -15
- package/src/stories/docs/theme-editor/theme-editor.tsx +0 -146
- package/src/stories/docs/theme-tokens.tsx +0 -174
- package/src/stories/examples/ChoosingComponents.mdx +0 -106
- package/src/stories/examples/sample-data.ts +0 -79
- package/src/stories/examples/usage/checkpoint-restore.ts +0 -156
- package/src/stories/examples/usage/context-usage.ts +0 -591
- package/src/stories/examples/usage/conversation-with-reasoning.ts +0 -224
- package/src/stories/examples/usage/conversation-with-sources.ts +0 -589
- package/src/stories/examples/usage/empty-state.ts +0 -144
- package/src/stories/examples/usage/full-chat-app.ts +0 -277
- package/src/stories/examples/usage/index.ts +0 -63
- package/src/stories/examples/usage/message-actions.ts +0 -704
- package/src/stories/examples/usage/pattern-centered-conversation.ts +0 -446
- package/src/stories/examples/usage/pattern-chat-panel-layout.ts +0 -442
- package/src/stories/examples/usage/pattern-docked-widget.ts +0 -479
- package/src/stories/examples/usage/prompt-input-variants.ts +0 -1356
- package/src/stories/examples/usage/streaming-response.ts +0 -687
- package/src/stories/examples/usage/types.ts +0 -33
- package/src/stories/full-chat.stories.tsx +0 -18
- package/src/stories/message-actions.stories.tsx +0 -230
- package/src/stories/pattern-centered-conversation.stories.tsx +0 -93
- package/src/stories/pattern-docked-widget.stories.tsx +0 -93
- package/src/stories/pattern-empty-state.stories.tsx +0 -76
- package/src/stories/prompt-input-variants.stories.tsx +0 -456
- package/src/stories/streaming-response.stories.tsx +0 -438
- package/src/stories/theme-editor.stories.tsx +0 -16
- package/src/stories/token-reference.stories.tsx +0 -18
- package/src/stories/typography.stories.tsx +0 -78
- package/src/ui/avatar.stories.tsx +0 -103
- package/src/ui/badge.stories.tsx +0 -86
- package/src/ui/button.stories.tsx +0 -145
- package/src/ui/collapsible.stories.tsx +0 -69
- package/src/ui/dropdown.stories.tsx +0 -59
- package/src/ui/hover-card.stories.tsx +0 -77
- package/src/ui/hover-card.test.tsx +0 -30
- package/src/ui/overlay.stories.tsx +0 -115
- package/src/ui/popover.stories.tsx +0 -81
- package/src/ui/popover.test.tsx +0 -99
- package/src/ui/resizable.stories.tsx +0 -236
- package/src/ui/scroll-area.stories.tsx +0 -50
- package/src/ui/separator.stories.tsx +0 -81
- package/src/ui/skeleton.stories.tsx +0 -337
- package/src/ui/switch.stories.tsx +0 -51
- package/src/ui/switch.test.tsx +0 -59
- package/src/ui/textarea.stories.tsx +0 -76
- package/src/ui/tooltip.stories.tsx +0 -74
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CardEnvelope, CardHost, CardResolution } from '../primitives/card-contract';
|
|
3
|
+
/** A field definition (the JSON Schema subset kai-form renders). */
|
|
4
|
+
export interface FormField {
|
|
5
|
+
type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
default?: unknown;
|
|
9
|
+
enum?: unknown[];
|
|
10
|
+
format?: 'email' | 'uri' | 'url' | 'date' | 'date-time' | 'time';
|
|
11
|
+
minimum?: number;
|
|
12
|
+
maximum?: number;
|
|
13
|
+
minLength?: number;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
pattern?: string;
|
|
16
|
+
minItems?: number;
|
|
17
|
+
maxItems?: number;
|
|
18
|
+
items?: FormField | {
|
|
19
|
+
enum: unknown[];
|
|
20
|
+
};
|
|
21
|
+
properties?: Record<string, FormField>;
|
|
22
|
+
required?: string[];
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
'x-kai-widget'?: 'textarea' | 'slider' | 'rating' | 'radio' | 'select' | 'checkbox' | 'password' | 'switch';
|
|
25
|
+
'x-kai-placeholder'?: string;
|
|
26
|
+
'x-kai-step'?: number;
|
|
27
|
+
}
|
|
28
|
+
/** The form definition = CardEnvelope.data for type:'form'. */
|
|
29
|
+
export interface FormDefinition {
|
|
30
|
+
type: 'object';
|
|
31
|
+
title?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
required?: string[];
|
|
34
|
+
properties: Record<string, FormField>;
|
|
35
|
+
'x-kai-order'?: string[];
|
|
36
|
+
'x-kai-inlineMax'?: number;
|
|
37
|
+
'x-kai-submitLabel'?: string;
|
|
38
|
+
'x-kai-dismissible'?: boolean;
|
|
39
|
+
'x-kai-actions'?: {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
variant?: 'default' | 'ghost' | 'outline';
|
|
43
|
+
}[];
|
|
44
|
+
}
|
|
45
|
+
export type FormCardEnvelope = CardEnvelope<'form', FormDefinition>;
|
|
46
|
+
/** The internal widget identifiers `widgetFor` resolves to. */
|
|
47
|
+
export type WidgetKind = 'text' | 'textarea' | 'password' | 'email' | 'url' | 'date' | 'datetime' | 'time' | 'number' | 'slider' | 'rating' | 'switch' | 'checkbox' | 'radio' | 'select' | 'checkbox-group' | 'multiselect' | 'repeater' | 'taglist' | 'fieldset' | 'unsupported';
|
|
48
|
+
export declare const DEFAULT_INLINE_MAX = 4;
|
|
49
|
+
/** Resolve the widget for a field. An explicit valid `x-kai-widget` always wins;
|
|
50
|
+
* otherwise the type/format/enum/constraint combination selects the widget. */
|
|
51
|
+
export declare function widgetFor(field: FormField, inlineMax: number): WidgetKind;
|
|
52
|
+
/** Humanize a camelCase / snake_case property key into a label. */
|
|
53
|
+
export declare function humanize(key: string): string;
|
|
54
|
+
/** Field order: `x-kai-order` (filtered to known keys, missing appended) if
|
|
55
|
+
* present, else `required` first then schema declaration order. */
|
|
56
|
+
export declare function orderedKeys(def: FormDefinition): string[];
|
|
57
|
+
/** Coerce a raw control value to the field's JSON type. Empty number string →
|
|
58
|
+
* undefined; number/integer → Number; boolean → real boolean. */
|
|
59
|
+
export declare function coerceValue(field: FormField, raw: unknown): unknown;
|
|
60
|
+
export interface FormValidation {
|
|
61
|
+
valid: boolean;
|
|
62
|
+
fieldErrors: Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
/** Full client-side validation of `values` against the form definition. Returns a
|
|
65
|
+
* per-field error map (the contract validator subset, applied field-by-field so
|
|
66
|
+
* each field can show its own inline message). */
|
|
67
|
+
export declare function validateForm(def: FormDefinition, values: Record<string, unknown>): FormValidation;
|
|
68
|
+
export interface FormSummaryRow {
|
|
69
|
+
key: string;
|
|
70
|
+
label: string;
|
|
71
|
+
value: string;
|
|
72
|
+
}
|
|
73
|
+
/** Format one field's value for the read-only summary. */
|
|
74
|
+
export declare function formatFieldValue(field: FormField | undefined, raw: unknown): string;
|
|
75
|
+
/** Build the label→value rows for a submitted form, honoring x-kai-order. */
|
|
76
|
+
export declare function summarizeForm(def: FormDefinition, data: Record<string, unknown>): FormSummaryRow[];
|
|
77
|
+
/** Build the result object: coerced values with empty optional fields omitted.
|
|
78
|
+
* `false` and `0` are kept (they are real values, not "empty"). */
|
|
79
|
+
export declare function buildResult(def: FormDefinition, values: Record<string, unknown>): Record<string, unknown>;
|
|
80
|
+
export interface FormProps {
|
|
81
|
+
/** The form definition (CardEnvelope.data). */
|
|
82
|
+
data?: FormDefinition;
|
|
83
|
+
/** The card id used to correlate every emitted CardEvent. */
|
|
84
|
+
cardId?: string;
|
|
85
|
+
/** The envelope title rendered in the card chrome. */
|
|
86
|
+
heading?: string;
|
|
87
|
+
/** Optional explicit CardHost (otherwise read from a CardProvider, otherwise the
|
|
88
|
+
* bubbling `kai-card` CustomEvent off `hostElement`). */
|
|
89
|
+
host?: CardHost;
|
|
90
|
+
/** The custom-element host node, for the bubbling `kai-card` fallback emit. */
|
|
91
|
+
hostElement?: HTMLElement;
|
|
92
|
+
class?: string;
|
|
93
|
+
/** When set, render the chromed read-only view instead of the form inputs. */
|
|
94
|
+
resolution?: CardResolution;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* `Form` — renders a JSON-Schema form definition into themed, accessible widgets
|
|
98
|
+
* inside `Card` chrome, validates input against that schema, and emits the
|
|
99
|
+
* collected, coerced, validated object up the Card contract as `submit`.
|
|
100
|
+
* Reads context/emits via a `CardProvider` when present, else the bubbling
|
|
101
|
+
* `kai-card` CustomEvent.
|
|
102
|
+
*/
|
|
103
|
+
export declare function Form(props: FormProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface GeneratedImageLike {
|
|
3
|
+
base64?: string;
|
|
4
|
+
uint8Array?: Uint8Array;
|
|
5
|
+
mediaType?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ImageProps extends GeneratedImageLike {
|
|
8
|
+
alt: string;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function Image(props: ImageProps): JSX.Element;
|
|
12
|
+
export { Image };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CardEvent } from '../primitives/card-contract';
|
|
3
|
+
import { LinkPreviewData } from '../primitives/link-preview';
|
|
4
|
+
export interface LinkPreviewProps {
|
|
5
|
+
/** The card id correlating every emitted event. */
|
|
6
|
+
cardId: string;
|
|
7
|
+
/** The link payload (data-down). */
|
|
8
|
+
data: LinkPreviewData;
|
|
9
|
+
/** Emit a contract CardEvent up (host routes it). */
|
|
10
|
+
onEmit?: (event: CardEvent) => void;
|
|
11
|
+
/** Extra classes for the card root. */
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `LinkPreview` — a pure, themed, accessible rich link / OG preview. Renders from the
|
|
16
|
+
* supplied metadata; it never fetches the network itself. When the payload is a
|
|
17
|
+
* bare `{ url }` and an app has registered a `configureLinkPreview` fetcher, it
|
|
18
|
+
* shows a skeleton, calls the hook, merges the result, and renders. Activating the
|
|
19
|
+
* card (click / Enter / Space) emits the contract `open` verb (`target:'tab'`); the
|
|
20
|
+
* host policy performs the navigation so it can veto/redirect.
|
|
21
|
+
*/
|
|
22
|
+
export declare function LinkPreview(props: LinkPreviewProps): JSX.Element;
|
|
23
|
+
export type { LinkPreviewData } from '../primitives/link-preview';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type LoaderVariant = 'circular' | 'classic' | 'pulse' | 'pulse-dot' | 'dots' | 'typing' | 'wave' | 'bars' | 'terminal' | 'text-blink' | 'text-shimmer' | 'loading-dots';
|
|
2
|
+
export type LoaderSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface LoaderProps {
|
|
4
|
+
variant?: LoaderVariant;
|
|
5
|
+
size?: LoaderSize;
|
|
6
|
+
text?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function CircularLoader(props: {
|
|
10
|
+
class?: string;
|
|
11
|
+
size?: LoaderSize;
|
|
12
|
+
}): import("solid-js").JSX.Element;
|
|
13
|
+
export declare function ClassicLoader(props: {
|
|
14
|
+
class?: string;
|
|
15
|
+
size?: LoaderSize;
|
|
16
|
+
}): import("solid-js").JSX.Element;
|
|
17
|
+
export declare function PulseLoader(props: {
|
|
18
|
+
class?: string;
|
|
19
|
+
size?: LoaderSize;
|
|
20
|
+
}): import("solid-js").JSX.Element;
|
|
21
|
+
export declare function PulseDotLoader(props: {
|
|
22
|
+
class?: string;
|
|
23
|
+
size?: LoaderSize;
|
|
24
|
+
}): import("solid-js").JSX.Element;
|
|
25
|
+
export declare function DotsLoader(props: {
|
|
26
|
+
class?: string;
|
|
27
|
+
size?: LoaderSize;
|
|
28
|
+
}): import("solid-js").JSX.Element;
|
|
29
|
+
export declare function TypingLoader(props: {
|
|
30
|
+
class?: string;
|
|
31
|
+
size?: LoaderSize;
|
|
32
|
+
}): import("solid-js").JSX.Element;
|
|
33
|
+
export declare function WaveLoader(props: {
|
|
34
|
+
class?: string;
|
|
35
|
+
size?: LoaderSize;
|
|
36
|
+
}): import("solid-js").JSX.Element;
|
|
37
|
+
export declare function BarsLoader(props: {
|
|
38
|
+
class?: string;
|
|
39
|
+
size?: LoaderSize;
|
|
40
|
+
}): import("solid-js").JSX.Element;
|
|
41
|
+
export declare function TerminalLoader(props: {
|
|
42
|
+
class?: string;
|
|
43
|
+
size?: LoaderSize;
|
|
44
|
+
}): import("solid-js").JSX.Element;
|
|
45
|
+
export declare function TextBlinkLoader(props: {
|
|
46
|
+
text?: string;
|
|
47
|
+
class?: string;
|
|
48
|
+
size?: LoaderSize;
|
|
49
|
+
}): import("solid-js").JSX.Element;
|
|
50
|
+
export declare function TextShimmerLoader(props: {
|
|
51
|
+
text?: string;
|
|
52
|
+
class?: string;
|
|
53
|
+
size?: LoaderSize;
|
|
54
|
+
}): import("solid-js").JSX.Element;
|
|
55
|
+
export declare function TextDotsLoader(props: {
|
|
56
|
+
text?: string;
|
|
57
|
+
class?: string;
|
|
58
|
+
size?: LoaderSize;
|
|
59
|
+
}): import("solid-js").JSX.Element;
|
|
60
|
+
export declare function Loader(props: LoaderProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface Skill {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface MessageSkillsProps {
|
|
7
|
+
skills: Skill[];
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Displays skill badges above a message to indicate which skills
|
|
12
|
+
* were active when the message was generated.
|
|
13
|
+
*/
|
|
14
|
+
declare function MessageSkills(props: MessageSkillsProps): JSX.Element;
|
|
15
|
+
export { MessageSkills };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { ChatMessageAction, CustomAction } from '../elements/chat-types';
|
|
3
|
+
export interface MessageProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
declare function Message(props: MessageProps): JSX.Element;
|
|
7
|
+
export interface MessageAvatarProps {
|
|
8
|
+
src: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
fallback?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function MessageAvatar(props: MessageAvatarProps): JSX.Element;
|
|
14
|
+
export interface MessageContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
children: JSX.Element | string;
|
|
16
|
+
markdown?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare function MessageContent(props: MessageContentProps): JSX.Element;
|
|
19
|
+
export interface MessageActionsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
children: JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
declare function MessageActions(props: MessageActionsProps): JSX.Element;
|
|
23
|
+
export interface MessageActionBarProps {
|
|
24
|
+
/** Built-in action names and/or custom action descriptors, in order. */
|
|
25
|
+
actions: (ChatMessageAction | CustomAction)[];
|
|
26
|
+
/** `'always'` (default) keeps the bar visible; `'hover'` reveals it on
|
|
27
|
+
* parent `.group` hover. */
|
|
28
|
+
reveal?: 'always' | 'hover';
|
|
29
|
+
/** Fired with the built-in name or the custom action id when a button is clicked. */
|
|
30
|
+
onAction: (id: string) => void;
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The shared message action toolbar. Renders one ghost icon button per entry —
|
|
35
|
+
* built-in names pull their label+icon from the curated registry; custom
|
|
36
|
+
* descriptors use their `label` plus `actionIcon(icon)` (label-only when the
|
|
37
|
+
* icon is unknown or absent). `reveal="hover"` makes the bar fade in on the
|
|
38
|
+
* parent `.group`'s hover.
|
|
39
|
+
*/
|
|
40
|
+
declare function MessageActionBar(props: MessageActionBarProps): JSX.Element;
|
|
41
|
+
export interface MessageActionProps {
|
|
42
|
+
tooltip: string;
|
|
43
|
+
children: JSX.Element;
|
|
44
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
45
|
+
class?: string;
|
|
46
|
+
}
|
|
47
|
+
declare function MessageAction(props: MessageActionProps): JSX.Element;
|
|
48
|
+
export interface MessageCopyButtonProps {
|
|
49
|
+
content: string;
|
|
50
|
+
size?: number;
|
|
51
|
+
class?: string;
|
|
52
|
+
}
|
|
53
|
+
declare function MessageCopyButton(props: MessageCopyButtonProps): JSX.Element;
|
|
54
|
+
export { Message, MessageAvatar, MessageContent, MessageActions, MessageActionBar, MessageAction, MessageCopyButton };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModelOption } from '../types';
|
|
2
|
+
export interface ModelSwitcherProps {
|
|
3
|
+
models: ModelOption[];
|
|
4
|
+
currentModelId: string;
|
|
5
|
+
onModelChange: (modelId: string) => void;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ModelSwitcher(props: ModelSwitcherProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
interface PromptInputContextType {
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
value: () => string;
|
|
5
|
+
setValue: (value: string) => void;
|
|
6
|
+
maxHeight: number | string;
|
|
7
|
+
onSubmit?: () => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
textareaRef: HTMLTextAreaElement | undefined;
|
|
10
|
+
setTextareaRef: (el: HTMLTextAreaElement) => void;
|
|
11
|
+
}
|
|
12
|
+
declare function usePromptInput(): PromptInputContextType;
|
|
13
|
+
export interface PromptInputProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
value?: string;
|
|
16
|
+
onValueChange?: (value: string) => void;
|
|
17
|
+
maxHeight?: number | string;
|
|
18
|
+
onSubmit?: () => void;
|
|
19
|
+
children: JSX.Element;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function PromptInput(props: PromptInputProps): JSX.Element;
|
|
23
|
+
export interface PromptInputTextareaProps extends JSX.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
24
|
+
disableAutosize?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare function PromptInputTextarea(props: PromptInputTextareaProps): JSX.Element;
|
|
27
|
+
export interface PromptInputActionsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
28
|
+
children: JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
declare function PromptInputActions(props: PromptInputActionsProps): JSX.Element;
|
|
31
|
+
export interface PromptInputActionProps {
|
|
32
|
+
tooltip?: string;
|
|
33
|
+
children: JSX.Element;
|
|
34
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
35
|
+
class?: string;
|
|
36
|
+
}
|
|
37
|
+
declare function PromptInputAction(props: PromptInputActionProps): JSX.Element;
|
|
38
|
+
export { PromptInput, PromptInputTextarea, PromptInputActions, PromptInputAction, usePromptInput, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface PromptSuggestionProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
children: JSX.Element | string;
|
|
4
|
+
variant?: 'outline' | 'ghost' | 'default';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm';
|
|
6
|
+
highlight?: string;
|
|
7
|
+
/** Render as a full-width, left-aligned list row (the "suggested questions"
|
|
8
|
+
* idiom) instead of a rounded pill. Wraps long text. Ignored in highlight
|
|
9
|
+
* mode, which is always a list row. */
|
|
10
|
+
block?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function PromptSuggestion(props: PromptSuggestionProps): JSX.Element;
|
|
13
|
+
export { PromptSuggestion };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface ReasoningProps {
|
|
3
|
+
children: JSX.Element;
|
|
4
|
+
class?: string;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
isStreaming?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function Reasoning(props: ReasoningProps): JSX.Element;
|
|
10
|
+
export interface ReasoningTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
+
children: JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
declare function ReasoningTrigger(props: ReasoningTriggerProps): JSX.Element;
|
|
14
|
+
export interface ReasoningContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
children: JSX.Element;
|
|
16
|
+
markdown?: boolean;
|
|
17
|
+
contentClass?: string;
|
|
18
|
+
}
|
|
19
|
+
declare function ReasoningContent(props: ReasoningContentProps): JSX.Element;
|
|
20
|
+
export { Reasoning, ReasoningTrigger, ReasoningContent };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Mode = 'typewriter' | 'fade';
|
|
2
|
+
export interface ResponseStreamProps {
|
|
3
|
+
textStream: string | AsyncIterable<string>;
|
|
4
|
+
mode?: Mode;
|
|
5
|
+
speed?: number;
|
|
6
|
+
class?: string;
|
|
7
|
+
onComplete?: () => void;
|
|
8
|
+
as?: string;
|
|
9
|
+
fadeDuration?: number;
|
|
10
|
+
segmentDelay?: number;
|
|
11
|
+
characterChunkSize?: number;
|
|
12
|
+
}
|
|
13
|
+
declare function ResponseStream(props: ResponseStreamProps): import("solid-js").JSX.Element;
|
|
14
|
+
export { ResponseStream };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ScrollButtonProps {
|
|
2
|
+
class?: string;
|
|
3
|
+
variant?: 'outline' | 'ghost' | 'default';
|
|
4
|
+
size?: 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm';
|
|
5
|
+
}
|
|
6
|
+
declare function ScrollButton(props: ScrollButtonProps): import("solid-js").JSX.Element;
|
|
7
|
+
export { ScrollButton };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SlashCommandItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
category?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SlashCommandProps {
|
|
8
|
+
commands: SlashCommandItem[];
|
|
9
|
+
activeIds?: string[];
|
|
10
|
+
onSelect: (command: SlashCommandItem) => void;
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function SlashCommand(props: SlashCommandProps): import("solid-js").JSX.Element;
|
|
15
|
+
export { SlashCommand };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface SourceProps {
|
|
3
|
+
href: string;
|
|
4
|
+
children: JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
declare function Source(props: SourceProps): JSX.Element;
|
|
7
|
+
export interface SourceTriggerProps {
|
|
8
|
+
label?: string | number;
|
|
9
|
+
showFavicon?: boolean;
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function SourceTrigger(props: SourceTriggerProps): JSX.Element;
|
|
13
|
+
export interface SourceContentProps {
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function SourceContent(props: SourceContentProps): JSX.Element;
|
|
19
|
+
declare function SourceList(props: {
|
|
20
|
+
children: JSX.Element;
|
|
21
|
+
class?: string;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
export { Source, SourceTrigger, SourceContent, SourceList };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CardEnvelope, CardHost, CardResolution } from '../primitives/card-contract';
|
|
3
|
+
export interface TasksTask {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TasksCardData {
|
|
11
|
+
mode?: 'select';
|
|
12
|
+
heading?: string;
|
|
13
|
+
tasks: TasksTask[];
|
|
14
|
+
selectAll?: boolean;
|
|
15
|
+
confirmLabel?: string;
|
|
16
|
+
allowEmpty?: boolean;
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface TasksCardResult {
|
|
21
|
+
selected: string[];
|
|
22
|
+
}
|
|
23
|
+
export type TasksCardEnvelope = CardEnvelope<'tasks', TasksCardData>;
|
|
24
|
+
export declare const TASKS_CARD_TYPE: "tasks";
|
|
25
|
+
/** De-dupe tasks by id (first wins). Returns the usable list + an optional error. */
|
|
26
|
+
export declare function normalizeTasks(tasks: unknown): {
|
|
27
|
+
tasks: TasksTask[];
|
|
28
|
+
error?: string;
|
|
29
|
+
};
|
|
30
|
+
/** The ids of the initially-checked tasks (in input order). */
|
|
31
|
+
export declare function initialSelected(tasks: TasksTask[]): string[];
|
|
32
|
+
/** The selected ids in input order (selection set ∩ tasks, preserving task order). */
|
|
33
|
+
export declare function selectedInOrder(tasks: TasksTask[], selected: Set<string>): string[];
|
|
34
|
+
/** The toggleable (non-disabled) task ids. */
|
|
35
|
+
export declare function toggleableIds(tasks: TasksTask[]): string[];
|
|
36
|
+
export type SelectAllState = 'checked' | 'unchecked' | 'indeterminate';
|
|
37
|
+
/** Select-all tri-state over the toggleable rows. */
|
|
38
|
+
export declare function selectAllState(tasks: TasksTask[], selected: Set<string>): SelectAllState;
|
|
39
|
+
/** Whether select-all should be shown: requested AND not blocked by `max` (since
|
|
40
|
+
* "all" would violate max). */
|
|
41
|
+
export declare function showSelectAll(data: TasksCardData, tasks: TasksTask[]): boolean;
|
|
42
|
+
/** Whether confirm is enabled for the current selection count. */
|
|
43
|
+
export declare function canConfirm(data: TasksCardData, count: number): boolean;
|
|
44
|
+
/** Whether an unchecked row is blocked because `max` is reached. */
|
|
45
|
+
export declare function isMaxReached(data: TasksCardData, count: number): boolean;
|
|
46
|
+
/** The disabled-reason text for confirm (for aria-describedby), or undefined. */
|
|
47
|
+
export declare function confirmReason(data: TasksCardData, count: number): string | undefined;
|
|
48
|
+
export interface TasksCardProps {
|
|
49
|
+
/** The tasks definition (CardEnvelope.data). */
|
|
50
|
+
data?: TasksCardData;
|
|
51
|
+
/** The card id used to correlate every emitted CardEvent. */
|
|
52
|
+
cardId?: string;
|
|
53
|
+
/** The envelope title rendered in the card chrome. */
|
|
54
|
+
heading?: string;
|
|
55
|
+
/** Optional explicit CardHost (otherwise read from a CardProvider, otherwise the
|
|
56
|
+
* bubbling `kai-card` CustomEvent off `hostElement`). */
|
|
57
|
+
host?: CardHost;
|
|
58
|
+
/** The custom-element host node, for the bubbling `kai-card` fallback emit. */
|
|
59
|
+
hostElement?: HTMLElement;
|
|
60
|
+
class?: string;
|
|
61
|
+
/** When set, render the chromed read-only summary instead of the interactive controls. */
|
|
62
|
+
resolution?: CardResolution;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* `TasksCard` — a selectable task/plan list (checkbox rows + optional select-all
|
|
66
|
+
* + a confirm button) inside `Card` chrome. Row toggling and select-all are local
|
|
67
|
+
* UI state; only the final confirm emits the Card contract's `submit` verb
|
|
68
|
+
* (`{ kind:'submit', cardId, data:{ selected } }`) with the checked ids in
|
|
69
|
+
* input order. Emits `ready` on mount and `error` for an unusable definition.
|
|
70
|
+
*/
|
|
71
|
+
export declare function TasksCard(props: TasksCardProps): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface TextShimmerProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
3
|
+
as?: string;
|
|
4
|
+
duration?: number;
|
|
5
|
+
spread?: number;
|
|
6
|
+
children: JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
declare function TextShimmer(props: TextShimmerProps): JSX.Element;
|
|
9
|
+
export { TextShimmer };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface ThinkingBarProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
onStop?: () => void;
|
|
6
|
+
stopLabel?: string;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare function ThinkingBar(props: ThinkingBarProps): JSX.Element;
|
|
10
|
+
export { ThinkingBar };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface ToolPart {
|
|
3
|
+
type: string;
|
|
4
|
+
state: 'input-streaming' | 'input-available' | 'output-available' | 'output-error';
|
|
5
|
+
input?: Record<string, unknown>;
|
|
6
|
+
output?: Record<string, unknown>;
|
|
7
|
+
toolCallId?: string;
|
|
8
|
+
errorText?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ToolProps {
|
|
11
|
+
toolPart: ToolPart;
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function Tool(props: ToolProps): JSX.Element;
|
|
16
|
+
export { Tool };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { CardResolution } from '../primitives/card-contract';
|
|
3
|
+
export interface ResolutionController {
|
|
4
|
+
resolution: Accessor<CardResolution | undefined>;
|
|
5
|
+
isResolved: Accessor<boolean>;
|
|
6
|
+
isOptimistic: Accessor<boolean>;
|
|
7
|
+
setLocal: (r: CardResolution) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useCardResolution(opts: {
|
|
10
|
+
prop: Accessor<CardResolution | undefined>;
|
|
11
|
+
data: Accessor<unknown>;
|
|
12
|
+
}): ResolutionController;
|