@kitnai/chat 0.7.0 → 0.8.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 -9
- package/dist/custom-elements.json +1626 -883
- package/dist/kitn-chat.es.js +36 -36
- package/dist/llms/llms-full.txt +303 -142
- package/dist/llms/llms.txt +18 -18
- package/dist/schemas/card-envelope.schema.json +14 -0
- package/dist/schemas/card-event.schema.json +12 -0
- package/dist/schemas/confirm.schema.json +65 -0
- package/dist/schemas/embed.schema.json +65 -0
- package/dist/schemas/form.result.schema.json +7 -0
- package/dist/schemas/form.schema.json +33 -0
- package/dist/schemas/link.schema.json +56 -0
- package/dist/schemas/task-list.result.schema.json +16 -0
- package/dist/schemas/task-list.schema.json +78 -0
- package/dist/theme.tokens.css +65 -65
- package/dist/tsx-B8rCNbgL.js +1 -0
- package/dist/typescript-RycA9KXf.js +1 -0
- package/frameworks/react/index.tsx +356 -189
- package/frameworks/react/runtime.tsx +2 -2
- package/llms-full.txt +303 -142
- package/llms.txt +18 -18
- package/package.json +5 -2
- package/src/components/artifact.stories.tsx +138 -0
- package/src/components/artifact.tsx +581 -0
- package/src/components/attachments.stories.tsx +7 -8
- package/src/components/attachments.tsx +2 -2
- package/src/components/card.tsx +110 -0
- package/src/components/chain-of-thought.stories.tsx +7 -8
- package/src/components/chat-container.stories.tsx +7 -8
- package/src/components/chat-container.tsx +4 -0
- package/src/components/checkpoint.stories.tsx +7 -8
- package/src/components/code-block.stories.tsx +8 -9
- package/src/components/component-meta.json +3411 -0
- package/src/components/confirm-card.stories.tsx +74 -0
- package/src/components/confirm-card.tsx +299 -0
- package/src/components/context.stories.tsx +7 -8
- package/src/components/conversation-item.stories.tsx +7 -8
- package/src/components/conversation-item.tsx +2 -2
- package/src/components/conversation-list.stories.tsx +7 -8
- package/src/components/conversation-list.tsx +1 -1
- package/src/components/embed.tsx +196 -0
- package/src/components/empty.stories.tsx +8 -9
- package/src/components/feedback-bar.stories.tsx +7 -8
- package/src/components/file-tree.stories.tsx +73 -0
- package/src/components/file-tree.tsx +383 -0
- package/src/components/file-upload.stories.tsx +7 -8
- package/src/components/form-widgets.tsx +461 -0
- package/src/components/form.tsx +796 -0
- package/src/components/image.stories.tsx +7 -8
- package/src/components/link-card.tsx +194 -0
- package/src/components/loader.stories.tsx +7 -8
- package/src/components/markdown.stories.tsx +7 -8
- package/src/components/message-narrow.stories.tsx +12 -13
- package/src/components/message-skills.stories.tsx +16 -17
- package/src/components/message.stories.tsx +17 -18
- package/src/components/model-switcher.stories.tsx +7 -8
- package/src/components/prompt-input.stories.tsx +8 -9
- package/src/components/prompt-suggestion.stories.tsx +7 -8
- package/src/components/prompt-suggestion.tsx +3 -3
- package/src/components/reasoning.stories.tsx +7 -8
- package/src/components/scroll-button.stories.tsx +7 -8
- package/src/components/slash-command.stories.tsx +8 -9
- package/src/components/slash-command.tsx +2 -2
- package/src/components/source.stories.tsx +7 -8
- package/src/components/source.tsx +1 -1
- package/src/components/task-list-card.stories.tsx +78 -0
- package/src/components/task-list-card.tsx +388 -0
- package/src/components/text-shimmer.stories.tsx +7 -8
- package/src/components/thinking-bar.stories.tsx +7 -8
- package/src/components/tool.stories.tsx +7 -8
- package/src/components/tool.tsx +2 -2
- package/src/components/voice-input.stories.tsx +7 -8
- package/src/elements/artifact.stories.tsx +291 -0
- package/src/elements/artifact.tsx +72 -0
- package/src/elements/{kitn-attachments.stories.tsx → attachments.stories.tsx} +11 -20
- package/src/elements/attachments.tsx +4 -4
- package/src/elements/card.stories.tsx +118 -0
- package/src/elements/card.tsx +40 -0
- package/src/elements/catalog.stories.tsx +491 -0
- package/src/elements/{kitn-chain-of-thought.stories.tsx → chain-of-thought.stories.tsx} +13 -22
- package/src/elements/chain-of-thought.tsx +3 -3
- package/src/elements/{kitn-chat-scope-picker.stories.tsx → chat-scope-picker.stories.tsx} +10 -19
- package/src/elements/chat-scope-picker.tsx +4 -4
- package/src/elements/{kitn-chat-workspace.stories.tsx → chat-workspace.stories.tsx} +15 -23
- package/src/elements/chat-workspace.tsx +2 -2
- package/src/elements/{kitn-chat.stories.tsx → chat.stories.tsx} +12 -20
- package/src/elements/chat.tsx +2 -2
- package/src/elements/{kitn-checkpoint.stories.tsx → checkpoint.stories.tsx} +11 -20
- package/src/elements/checkpoint.tsx +4 -4
- package/src/elements/{kitn-code-block.stories.tsx → code-block.stories.tsx} +10 -19
- package/src/elements/code-block.tsx +3 -3
- package/src/elements/compiled.css +1 -1
- package/src/elements/composed-shell.stories.tsx +316 -0
- package/src/elements/confirm-card.stories.tsx +186 -0
- package/src/elements/confirm-card.tsx +45 -0
- package/src/elements/{kitn-context-meter.stories.tsx → context-meter.stories.tsx} +10 -19
- package/src/elements/context-meter.tsx +3 -3
- package/src/elements/{kitn-conversation-list.stories.tsx → conversation-list.stories.tsx} +12 -20
- package/src/elements/conversation-list.tsx +2 -2
- package/src/elements/css.ts +1 -1
- package/src/elements/define.tsx +10 -10
- package/src/elements/element-meta.json +1379 -733
- package/src/elements/element-types.d.ts +251 -125
- package/src/elements/embed.stories.tsx +197 -0
- package/src/elements/embed.tsx +35 -0
- package/src/elements/{kitn-empty.stories.tsx → empty.stories.tsx} +12 -21
- package/src/elements/empty.tsx +3 -3
- package/src/elements/{kitn-feedback-bar.stories.tsx → feedback-bar.stories.tsx} +11 -20
- package/src/elements/feedback-bar.tsx +4 -4
- package/src/elements/file-tree.stories.tsx +133 -0
- package/src/elements/file-tree.tsx +52 -0
- package/src/elements/{kitn-file-upload.stories.tsx → file-upload.stories.tsx} +12 -21
- package/src/elements/file-upload.tsx +4 -4
- package/src/elements/form.stories.tsx +204 -0
- package/src/elements/form.tsx +37 -0
- package/src/elements/{kitn-image.stories.tsx → image.stories.tsx} +10 -19
- package/src/elements/image.tsx +3 -3
- package/src/elements/link-card.stories.tsx +193 -0
- package/src/elements/link-card.tsx +34 -0
- package/src/elements/{kitn-loader.stories.tsx → loader.stories.tsx} +11 -20
- package/src/elements/loader.tsx +3 -3
- package/src/elements/{kitn-markdown.stories.tsx → markdown.stories.tsx} +10 -19
- package/src/elements/markdown.tsx +3 -3
- package/src/elements/{kitn-message-skills.stories.tsx → message-skills.stories.tsx} +10 -19
- package/src/elements/message-skills.tsx +3 -3
- package/src/elements/{kitn-message.stories.tsx → message.stories.tsx} +12 -21
- package/src/elements/message.tsx +5 -5
- package/src/elements/{kitn-model-switcher.stories.tsx → model-switcher.stories.tsx} +10 -19
- package/src/elements/model-switcher.tsx +5 -5
- package/src/elements/{kitn-prompt-input.stories.tsx → prompt-input.stories.tsx} +14 -22
- package/src/elements/prompt-input.tsx +3 -3
- package/src/elements/{kitn-prompt-suggestions.stories.tsx → prompt-suggestions.stories.tsx} +13 -22
- package/src/elements/prompt-suggestions.tsx +4 -4
- package/src/elements/{kitn-reasoning.stories.tsx → reasoning.stories.tsx} +10 -19
- package/src/elements/reasoning.tsx +4 -4
- package/src/elements/register.ts +11 -1
- package/src/elements/resizable.stories.tsx +200 -0
- package/src/elements/resizable.tsx +264 -0
- package/src/elements/{kitn-response-stream.stories.tsx → response-stream.stories.tsx} +10 -19
- package/src/elements/response-stream.tsx +4 -4
- package/src/elements/{kitn-source-list.stories.tsx → source-list.stories.tsx} +11 -20
- package/src/elements/{kitn-source.stories.tsx → source.stories.tsx} +12 -21
- package/src/elements/source.tsx +5 -5
- package/src/elements/styles.css +140 -1
- package/src/elements/task-list-card.stories.tsx +194 -0
- package/src/elements/task-list-card.tsx +40 -0
- package/src/elements/{kitn-text-shimmer.stories.tsx → text-shimmer.stories.tsx} +10 -19
- package/src/elements/text-shimmer.tsx +3 -3
- package/src/elements/{kitn-thinking-bar.stories.tsx → thinking-bar.stories.tsx} +11 -20
- package/src/elements/thinking-bar.tsx +5 -5
- package/src/elements/{kitn-tool.stories.tsx → tool.stories.tsx} +10 -19
- package/src/elements/tool.tsx +3 -3
- package/src/elements/{kitn-voice-input.stories.tsx → voice-input.stories.tsx} +10 -19
- package/src/elements/voice-input.tsx +4 -4
- package/src/index.ts +94 -2
- package/src/primitives/card-contract.ts +60 -0
- package/src/primitives/card-host.tsx +35 -0
- package/src/primitives/card-routing.ts +79 -0
- package/src/primitives/card-schemas/card-envelope.schema.json +14 -0
- package/src/primitives/card-schemas/card-event.schema.json +12 -0
- package/src/primitives/card-schemas/confirm.schema.json +65 -0
- package/src/primitives/card-schemas/embed.schema.json +65 -0
- package/src/primitives/card-schemas/form.result.schema.json +7 -0
- package/src/primitives/card-schemas/form.schema.json +33 -0
- package/src/primitives/card-schemas/link.schema.json +56 -0
- package/src/primitives/card-schemas/task-list.result.schema.json +16 -0
- package/src/primitives/card-schemas/task-list.schema.json +78 -0
- package/src/primitives/card-validate.ts +95 -0
- package/src/primitives/embed-providers.ts +254 -0
- package/src/primitives/highlighter.ts +4 -0
- package/src/primitives/link-preview.ts +87 -0
- package/src/primitives/pdf-preview.ts +121 -0
- package/src/stories/chat-panel-layout.stories.tsx +2 -1
- package/src/stories/chat-scene.tsx +22 -21
- package/src/stories/checkpoint-restore.stories.tsx +10 -10
- package/src/stories/conversation-with-reasoning.stories.tsx +4 -4
- package/src/stories/conversation-with-sources.stories.tsx +7 -7
- package/src/stories/docs/Accessibility.mdx +2 -2
- package/src/stories/docs/ForAIAgents.mdx +3 -3
- package/src/stories/docs/GettingStarted.mdx +2 -2
- package/src/stories/docs/Installation.mdx +2 -2
- package/src/stories/docs/Integrations.mdx +29 -29
- package/src/stories/docs/Introduction.mdx +3 -3
- package/src/stories/docs/Theming.mdx +2 -2
- package/src/stories/docs/element-controls.ts +32 -0
- package/src/stories/docs/theme-editor/theme-editor.tsx +1 -0
- package/src/stories/examples/ChoosingComponents.mdx +94 -0
- package/src/stories/examples/sample-data.ts +79 -0
- package/src/stories/message-actions.stories.tsx +13 -13
- package/src/stories/pattern-centered-conversation.stories.tsx +3 -3
- package/src/stories/pattern-docked-widget.stories.tsx +1 -1
- package/src/stories/pattern-empty-state.stories.tsx +3 -3
- package/src/stories/prompt-input-variants.stories.tsx +13 -13
- package/src/stories/streaming-response.stories.tsx +3 -3
- package/src/stories/typography.stories.tsx +4 -4
- package/src/ui/avatar.stories.tsx +7 -8
- package/src/ui/badge.stories.tsx +7 -8
- package/src/ui/button.stories.tsx +8 -9
- package/src/ui/button.tsx +1 -0
- package/src/ui/collapsible.stories.tsx +6 -7
- package/src/ui/dropdown.stories.tsx +6 -7
- package/src/ui/hover-card.stories.tsx +6 -7
- package/src/ui/resizable.stories.tsx +74 -9
- package/src/ui/resizable.tsx +351 -71
- package/src/ui/scroll-area.stories.tsx +6 -7
- package/src/ui/scroll-area.tsx +3 -1
- package/src/ui/separator.stories.tsx +7 -8
- package/src/ui/skeleton.stories.tsx +7 -8
- package/src/ui/textarea.stories.tsx +6 -7
- package/src/ui/tooltip.stories.tsx +8 -9
- package/theme.css +65 -65
- package/src/stories/docs/element-spec.tsx +0 -86
package/dist/llms/llms-full.txt
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @kitnai/chat
|
|
5
5
|
|
|
6
|
-
> Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML.
|
|
6
|
+
> Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. 38 `kitn-*` custom elements: streaming responses, markdown + code rendering, reasoning/tool panels, attachments, conversation sidebar, voice input. Zero framework dependency for consumers; the SolidJS runtime it is authored in is bundled in, so the host needs nothing.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -18,11 +18,11 @@ npm install solid-js
|
|
|
18
18
|
This is the single most common mistake. Arrays and objects (`messages`, `models`, `context`, `suggestions`, `slashCommands`, …) MUST be assigned as JavaScript properties on the element. They CANNOT be passed as HTML attributes — an HTML attribute is always a string and will be ignored or mis-parsed.
|
|
19
19
|
|
|
20
20
|
```js
|
|
21
|
-
const chat = document.querySelector('
|
|
21
|
+
const chat = document.querySelector('kc-chat');
|
|
22
22
|
chat.messages = [{ id: '1', role: 'assistant', content: 'Hi!' }]; // ✅ property
|
|
23
23
|
```
|
|
24
24
|
```html
|
|
25
|
-
<
|
|
25
|
+
<kc-chat messages="[...]"></kc-chat> <!-- ❌ never works -->
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
Only scalar values (string/number/boolean) work as attributes (e.g. `placeholder`, `loading`, `theme`).
|
|
@@ -32,12 +32,12 @@ Only scalar values (string/number/boolean) work as attributes (e.g. `placeholder
|
|
|
32
32
|
**Layer 1 — batteries-included web components** (`import '@kitnai/chat/elements'`):
|
|
33
33
|
Drop an element into any framework (React, Vue, plain HTML). Data in via JS properties; interactions out via non-bubbling CustomEvents.
|
|
34
34
|
|
|
35
|
-
- `<
|
|
36
|
-
- `<
|
|
37
|
-
- `<
|
|
35
|
+
- `<kc-chat>` — full chat UI (message list + prompt input). The primary starting point.
|
|
36
|
+
- `<kc-conversations>` — sidebar conversation browser with group support.
|
|
37
|
+
- `<kc-prompt-input>` — standalone composer with send button.
|
|
38
38
|
|
|
39
39
|
**Layer 2 — composable primitives** (`import { … } from '@kitnai/chat'`):
|
|
40
|
-
All
|
|
40
|
+
All 38 elements are also exported individually. Use them for custom layouts or features `<kc-chat>` does not expose (ChainOfThought, FeedbackBar, ThinkingBar, VoiceInput, …). Your bundler tree-shakes the rest.
|
|
41
41
|
|
|
42
42
|
## Key rules for the web components
|
|
43
43
|
|
|
@@ -45,9 +45,9 @@ All 28 elements are also exported individually. Use them for custom layouts or f
|
|
|
45
45
|
2. **Events are non-bubbling `CustomEvent`s** — listen directly on the element:
|
|
46
46
|
`chat.addEventListener('submit', (e) => console.log(e.detail.value))`
|
|
47
47
|
3. **`theme` attribute** (`'light' | 'dark' | 'auto'`) works on every element. Default `auto` follows `prefers-color-scheme`.
|
|
48
|
-
4. **Theming via CSS custom properties** — override `--
|
|
48
|
+
4. **Theming via CSS custom properties** — override `--kc-color-*` tokens on `:root`; they pierce Shadow DOM.
|
|
49
49
|
|
|
50
|
-
## ChatMessage schema (required for `<
|
|
50
|
+
## ChatMessage schema (required for `<kc-chat>`)
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
53
|
interface ChatMessage {
|
|
@@ -66,31 +66,31 @@ interface ChatMessage {
|
|
|
66
66
|
**Plain HTML / CDN**
|
|
67
67
|
```html
|
|
68
68
|
<script type="module" src="https://unpkg.com/@kitnai/chat/elements"></script>
|
|
69
|
-
<
|
|
69
|
+
<kc-chat style="display:block;height:100vh"></kc-chat>
|
|
70
70
|
<script type="module">
|
|
71
|
-
const chat = document.querySelector('
|
|
71
|
+
const chat = document.querySelector('kc-chat');
|
|
72
72
|
chat.messages = [];
|
|
73
73
|
</script>
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
**React** — typed wrappers auto-set properties and expose `on<Event>` props:
|
|
77
77
|
```tsx
|
|
78
|
-
import {
|
|
79
|
-
<
|
|
78
|
+
import { KcChat } from '@kitnai/chat/react';
|
|
79
|
+
<KcChat messages={messages} onSubmit={(e) => send(e.detail.value)} />
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
**Vue** — use the element directly; pass arrays via `.prop`:
|
|
83
83
|
```vue
|
|
84
|
-
<
|
|
84
|
+
<kc-chat :messages.prop="messages" @submit="send" />
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
## Theming
|
|
88
88
|
|
|
89
89
|
```css
|
|
90
90
|
:root {
|
|
91
|
-
--
|
|
92
|
-
--
|
|
93
|
-
--
|
|
91
|
+
--kc-color-background: #0f0f0f;
|
|
92
|
+
--kc-color-primary: #7c3aed;
|
|
93
|
+
--kc-color-muted: #1e1e1e;
|
|
94
94
|
}
|
|
95
95
|
```
|
|
96
96
|
|
|
@@ -99,7 +99,7 @@ For Tailwind builds: `@import "@kitnai/chat/theme.css"` in your CSS.
|
|
|
99
99
|
|
|
100
100
|
## Docs
|
|
101
101
|
|
|
102
|
-
- Full element reference (all
|
|
102
|
+
- Full element reference (all 38 elements, every prop/event): ./llms-full.txt — https://kitn.dev/llms-full.txt
|
|
103
103
|
- Machine-readable Custom Elements Manifest: https://unpkg.com/@kitnai/chat/dist/custom-elements.json
|
|
104
104
|
- Working examples: https://github.com/kitn-ai/chat/tree/main/examples
|
|
105
105
|
- Storybook: https://storybook.kitn.dev
|
|
@@ -115,13 +115,13 @@ npm install @kitnai/chat
|
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
### 2 — Pick your layer
|
|
118
|
-
Drop-in: use `<
|
|
119
|
-
Composable: combine `<
|
|
118
|
+
Drop-in: use `<kc-chat>` for a full chat UI in one tag (`import '@kitnai/chat/elements'`).
|
|
119
|
+
Composable: combine `<kc-message>`, `<kc-prompt-input>`, `<kc-reasoning>`, … in your own markup.
|
|
120
120
|
|
|
121
121
|
### 3 — Handle `submit` and stream
|
|
122
122
|
```js
|
|
123
123
|
import '@kitnai/chat/elements';
|
|
124
|
-
const chat = document.querySelector('
|
|
124
|
+
const chat = document.querySelector('kc-chat');
|
|
125
125
|
chat.messages = [];
|
|
126
126
|
|
|
127
127
|
chat.addEventListener('submit', async (e) => {
|
|
@@ -150,10 +150,10 @@ chat.addEventListener('submit', async (e) => {
|
|
|
150
150
|
- Tool calls: add `tools: [{ type: 'search', state: 'output-available', input: {…}, output: {…} }]`.
|
|
151
151
|
- Model switcher: `chat.models = [{ id: 'gpt-4o', name: 'GPT-4o' }]; chat.currentModel = 'gpt-4o';` — listen for `modelchange`.
|
|
152
152
|
- Token meter: `chat.context = { usedTokens: 1200, maxTokens: 128000 };`.
|
|
153
|
-
- History sidebar: add `<
|
|
153
|
+
- History sidebar: add `<kc-conversations>`; listen for `select` and `newchat`.
|
|
154
154
|
|
|
155
155
|
### 5 — Theme
|
|
156
|
-
Override `--
|
|
156
|
+
Override `--kc-color-*` tokens on `:root` (they pierce Shadow DOM).
|
|
157
157
|
|
|
158
158
|
---
|
|
159
159
|
|
|
@@ -173,11 +173,34 @@ The same rule applies to every array/object property (`models`, `context`, `sugg
|
|
|
173
173
|
|
|
174
174
|
---
|
|
175
175
|
|
|
176
|
-
## Element reference (
|
|
176
|
+
## Element reference (38 elements, generated from custom-elements.json)
|
|
177
177
|
|
|
178
178
|
Every element also accepts the `theme` attribute. Array/object properties are marked with a `—` attribute: they must be set as JS properties.
|
|
179
179
|
|
|
180
|
-
### `
|
|
180
|
+
### `kc-artifact` / `KcArtifact`
|
|
181
|
+
|
|
182
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
183
|
+
|
|
184
|
+
| Property | Attribute | Type | Description |
|
|
185
|
+
|---|---|---|---|
|
|
186
|
+
| `src` | `src` | `undefined \| string` | URL the preview iframe frames. Consumer-controlled. |
|
|
187
|
+
| `files` | — | `{ path: string; url?: undefined \| string; code?: undefined \| string; language?: undefined \| string; type?: undefined \| "html" \| "pdf" \| "image" \| "other" }[]` | Files for the Code tab tree + each file's preview `url`. Set as a JS property (array). |
|
|
188
|
+
| `tab` | `tab` | `undefined \| "preview" \| "code"` | Active tab: `preview` (default) or `code`. |
|
|
189
|
+
| `activeFile` | `active-file` | `undefined \| string` | Selected file path — syncs the tree highlight, Code source, and preview. |
|
|
190
|
+
| `sandbox` | `sandbox` | `undefined \| string` | iframe `sandbox` override. Secure default `allow-scripts allow-forms` (NOT `allow-same-origin`). |
|
|
191
|
+
| `iframeTitle` | `iframe-title` | `undefined \| string` | Accessible title for the preview iframe. |
|
|
192
|
+
|
|
193
|
+
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
194
|
+
|
|
195
|
+
| Event | `detail` type | Description |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| `fileselect` | `CustomEvent<{ path: string }>` | Fired when a file is selected. `detail.path`. |
|
|
198
|
+
| `navigate` | `CustomEvent<{ url: string }>` | Fired when the preview navigates. `detail.url` = the new location. |
|
|
199
|
+
| `tabchange` | `CustomEvent<{ tab: "preview" \| "code" }>` | Fired when the Preview\|Code tab changes. `detail.tab`. |
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### `kc-attachments` / `KcAttachments`
|
|
181
204
|
|
|
182
205
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
183
206
|
|
|
@@ -198,7 +221,22 @@ Every element also accepts the `theme` attribute. Array/object properties are ma
|
|
|
198
221
|
|
|
199
222
|
---
|
|
200
223
|
|
|
201
|
-
### `
|
|
224
|
+
### `kc-card` / `KcCard`
|
|
225
|
+
|
|
226
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
227
|
+
|
|
228
|
+
| Property | Attribute | Type | Description |
|
|
229
|
+
|---|---|---|---|
|
|
230
|
+
| `heading` | `heading` | `undefined \| string` | Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. |
|
|
231
|
+
| `description` | `description` | `undefined \| string` | Supporting text under the heading. Attribute: `description`. |
|
|
232
|
+
| `errorMessage` | `error-message` | `undefined \| string` | When set, the card renders its inline error state instead of the body. Attribute: `error-message`. |
|
|
233
|
+
| `dense` | `dense` | `undefined \| false \| true` | Compact spacing for dense lists. Attribute: `dense`. |
|
|
234
|
+
|
|
235
|
+
_No events._
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### `kc-chain-of-thought` / `KcChainOfThought`
|
|
202
240
|
|
|
203
241
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
204
242
|
|
|
@@ -210,7 +248,7 @@ _No events._
|
|
|
210
248
|
|
|
211
249
|
---
|
|
212
250
|
|
|
213
|
-
### `
|
|
251
|
+
### `kc-chat` / `KcChat`
|
|
214
252
|
|
|
215
253
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
216
254
|
|
|
@@ -251,76 +289,7 @@ _No events._
|
|
|
251
289
|
|
|
252
290
|
---
|
|
253
291
|
|
|
254
|
-
### `
|
|
255
|
-
|
|
256
|
-
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
257
|
-
|
|
258
|
-
| Property | Attribute | Type | Description |
|
|
259
|
-
|---|---|---|---|
|
|
260
|
-
| `availableAuthors` | — | `string[]` | Authors to offer as scope filters. Set as a JS property. |
|
|
261
|
-
| `availableTags` | — | `string[]` | Tags to offer as scope filters. Set as a JS property. |
|
|
262
|
-
| `currentLabel` | `current-label` | `undefined \| string` | The label shown on the trigger for the active scope. |
|
|
263
|
-
|
|
264
|
-
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
265
|
-
|
|
266
|
-
| Event | `detail` type | Description |
|
|
267
|
-
|---|---|---|
|
|
268
|
-
| `scopechange` | `CustomEvent<{ filters: undefined \| { tags?: undefined \| string[]; authors?: undefined \| string[]; contentType?: undefined \| "transcript" \| "markdown"; dateRange?: undefined \| { from: string; to: string } } }>` | A scope was chosen (`undefined` filters = "All Content"). |
|
|
269
|
-
|
|
270
|
-
---
|
|
271
|
-
|
|
272
|
-
### `kitn-chat-workspace` / `KitnChatWorkspace`
|
|
273
|
-
|
|
274
|
-
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
275
|
-
|
|
276
|
-
| Property | Attribute | Type | Description |
|
|
277
|
-
|---|---|---|---|
|
|
278
|
-
| `groups` | — | `{ id: string; userId?: undefined \| string; teamId?: undefined \| string; name: string; sortOrder: number; createdAt: string }[]` | Pre-bucketed conversation groups for the sidebar. Set as a JS property. |
|
|
279
|
-
| `conversations` | — | `{ id: string; title: string; groupId?: undefined \| string; scope: { type: "document" \| "collection"; documentId?: undefined \| string; filters?: undefined \| { tags?: undefined \| string[]; authors?: undefined \| string[]; contentType?: undefined \| "transcript" \| "markdown"; dateRange?: undefined \| { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string }[]` | Flat conversation list (auto-bucketed if `groups` is empty). Set as a JS property. |
|
|
280
|
-
| `activeId` | `active-id` | `undefined \| string` | Id of the open conversation, highlighted in the sidebar. |
|
|
281
|
-
| `messages` | — | `{ id: string; role: "user" \| "assistant"; content: string; reasoning?: undefined \| { text: string; label?: undefined \| string }; tools?: undefined \| { type: string; state: "input-streaming" \| "input-available" \| "output-available" \| "output-error"; input?: undefined \| Record<string, unknown>; output?: undefined \| Record<string, unknown>; toolCallId?: undefined \| string; errorText?: undefined \| string }[]; attachments?: undefined \| { id: string; type: "file" \| "source-document"; filename?: undefined \| string; mediaType?: undefined \| string; url?: undefined \| string; title?: undefined \| string }[]; actions?: undefined \| ("copy" \| "like" \| "dislike" \| "regenerate" \| "edit")[] }[]` | The active conversation's message thread, newest last. Set as a JS property. |
|
|
282
|
-
| `value` | `value` | `undefined \| string` | |
|
|
283
|
-
| `placeholder` | `placeholder` | `undefined \| string` | |
|
|
284
|
-
| `loading` | `loading` | `undefined \| false \| true` | |
|
|
285
|
-
| `suggestions` | — | `undefined \| string[]` | |
|
|
286
|
-
| `suggestionMode` | `suggestion-mode` | `undefined \| "submit" \| "fill"` | |
|
|
287
|
-
| `proseSize` | `prose-size` | `undefined \| "xs" \| "sm" \| "base" \| "lg"` | |
|
|
288
|
-
| `codeTheme` | `code-theme` | `undefined \| string` | |
|
|
289
|
-
| `codeHighlight` | `code-highlight` | `undefined \| false \| true` | |
|
|
290
|
-
| `chatTitle` | `chat-title` | `undefined \| string` | |
|
|
291
|
-
| `models` | — | `undefined \| { id: string; name: string; provider?: undefined \| string }[]` | |
|
|
292
|
-
| `currentModel` | `current-model` | `undefined \| string` | |
|
|
293
|
-
| `context` | — | `undefined \| { usedTokens: number; maxTokens: number; inputTokens?: undefined \| number; outputTokens?: undefined \| number; estimatedCost?: undefined \| number }` | |
|
|
294
|
-
| `scrollButton` | `scroll-button` | `undefined \| false \| true` | |
|
|
295
|
-
| `search` | `search` | `undefined \| false \| true` | |
|
|
296
|
-
| `voice` | `voice` | `undefined \| false \| true` | |
|
|
297
|
-
| `slashCommands` | — | `undefined \| { id: string; label: string; description?: undefined \| string; category?: undefined \| string }[]` | |
|
|
298
|
-
| `slashActiveIds` | — | `undefined \| string[]` | |
|
|
299
|
-
| `slashCompact` | `slash-compact` | `undefined \| false \| true` | |
|
|
300
|
-
| `sidebarWidth` | `sidebar-width` | `undefined \| number` | Sidebar default width as a percent of the workspace (default 22). |
|
|
301
|
-
| `sidebarMinWidth` | `sidebar-min-width` | `undefined \| number` | Sidebar min width in px (default 200). |
|
|
302
|
-
| `sidebarMaxWidth` | `sidebar-max-width` | `undefined \| number` | Sidebar max width in px (default 420). |
|
|
303
|
-
| `sidebarCollapsed` | `sidebar-collapsed` | `undefined \| false \| true` | Initial collapsed state of the sidebar (default false). |
|
|
304
|
-
|
|
305
|
-
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
306
|
-
|
|
307
|
-
| Event | `detail` type | Description |
|
|
308
|
-
|---|---|---|
|
|
309
|
-
| `conversationselect` | `CustomEvent<{ id: string }>` | A conversation was selected in the sidebar. |
|
|
310
|
-
| `messageaction` | `CustomEvent<{ messageId: string; action: "copy" \| "like" \| "dislike" \| "regenerate" \| "edit" }>` | An action button on a message was clicked. |
|
|
311
|
-
| `modelchange` | `CustomEvent<{ modelId: string }>` | The header model switcher changed. |
|
|
312
|
-
| `newchat` | `CustomEvent<Record<string, never>>` | The "New chat" button was clicked. |
|
|
313
|
-
| `search` | `CustomEvent<Record<string, never>>` | The Search button was clicked. |
|
|
314
|
-
| `sidebartoggle` | `CustomEvent<{ collapsed: false \| true }>` | The sidebar was collapsed or expanded. |
|
|
315
|
-
| `slashselect` | `CustomEvent<{ command: { id: string; label: string; description?: undefined \| string; category?: undefined \| string } }>` | A slash command was chosen from the palette. |
|
|
316
|
-
| `submit` | `CustomEvent<{ value: string; attachments: { id: string; type: "file" \| "source-document"; filename?: undefined \| string; mediaType?: undefined \| string; url?: undefined \| string; title?: undefined \| string }[] }>` | User submitted a message. |
|
|
317
|
-
| `suggestionclick` | `CustomEvent<{ value: string }>` | A suggestion chip was clicked (only in `suggestion-mode="fill"`). |
|
|
318
|
-
| `valuechange` | `CustomEvent<{ value: string }>` | Fired on every input change. |
|
|
319
|
-
| `voice` | `CustomEvent<Record<string, never>>` | The Mic / voice button was clicked. |
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
### `kitn-checkpoint` / `KitnCheckpoint`
|
|
292
|
+
### `kc-checkpoint` / `KcCheckpoint`
|
|
324
293
|
|
|
325
294
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
326
295
|
|
|
@@ -339,7 +308,7 @@ _No events._
|
|
|
339
308
|
|
|
340
309
|
---
|
|
341
310
|
|
|
342
|
-
### `
|
|
311
|
+
### `kc-code-block` / `KcCodeBlock`
|
|
343
312
|
|
|
344
313
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
345
314
|
|
|
@@ -355,7 +324,22 @@ _No events._
|
|
|
355
324
|
|
|
356
325
|
---
|
|
357
326
|
|
|
358
|
-
### `
|
|
327
|
+
### `kc-confirm` / `KcConfirm`
|
|
328
|
+
|
|
329
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
330
|
+
|
|
331
|
+
| Property | Attribute | Type | Description |
|
|
332
|
+
|---|---|---|---|
|
|
333
|
+
| `data` | — | `undefined \| Record<string, unknown>` | The confirm definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { body, tone, actions:[…] }`. Import `ConfirmCardData` from `@kitnai/chat` for the full shape. |
|
|
334
|
+
| `cardId` | `card-id` | `undefined \| string` | Stable card id correlating every emitted CardEvent. Attribute: `card-id`. |
|
|
335
|
+
| `heading` | `heading` | `undefined \| string` | Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. |
|
|
336
|
+
| `autofocus` | `autofocus` | `undefined \| false \| true` | Focus the default action on mount (off by default — no focus-stealing). Attribute: `autofocus`. |
|
|
337
|
+
|
|
338
|
+
_No events._
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
### `kc-context` / `KcContext`
|
|
359
343
|
|
|
360
344
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
361
345
|
|
|
@@ -367,7 +351,7 @@ _No events._
|
|
|
367
351
|
|
|
368
352
|
---
|
|
369
353
|
|
|
370
|
-
### `
|
|
354
|
+
### `kc-conversations` / `KcConversations`
|
|
371
355
|
|
|
372
356
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
373
357
|
|
|
@@ -387,7 +371,20 @@ _No events._
|
|
|
387
371
|
|
|
388
372
|
---
|
|
389
373
|
|
|
390
|
-
### `
|
|
374
|
+
### `kc-embed` / `KcEmbed`
|
|
375
|
+
|
|
376
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
377
|
+
|
|
378
|
+
| Property | Attribute | Type | Description |
|
|
379
|
+
|---|---|---|---|
|
|
380
|
+
| `cardId` | `card-id` | `undefined \| string` | Stable card id correlating every emitted event. Set as an attribute or property. |
|
|
381
|
+
| `data` | — | `undefined \| { provider: "youtube" \| "vimeo" \| "generic"; id?: undefined \| string; url?: undefined \| string; title?: undefined \| string; poster?: undefined \| string; start?: undefined \| number; aspectRatio?: undefined \| "16:9" \| "4:3" \| "1:1" \| "9:16" }` | The embed payload (provider + id/url + options). Set as a JS **property** (object). |
|
|
382
|
+
|
|
383
|
+
_No events._
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
### `kc-empty` / `KcEmpty`
|
|
391
388
|
|
|
392
389
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
393
390
|
|
|
@@ -400,7 +397,7 @@ _No events._
|
|
|
400
397
|
|
|
401
398
|
---
|
|
402
399
|
|
|
403
|
-
### `
|
|
400
|
+
### `kc-feedback-bar` / `KcFeedbackBar`
|
|
404
401
|
|
|
405
402
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
406
403
|
|
|
@@ -418,7 +415,25 @@ _No events._
|
|
|
418
415
|
|
|
419
416
|
---
|
|
420
417
|
|
|
421
|
-
### `
|
|
418
|
+
### `kc-file-tree` / `KcFileTree`
|
|
419
|
+
|
|
420
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
421
|
+
|
|
422
|
+
| Property | Attribute | Type | Description |
|
|
423
|
+
|---|---|---|---|
|
|
424
|
+
| `files` | — | `{ path: string; url?: undefined \| string; code?: undefined \| string; language?: undefined \| string; type?: undefined \| "html" \| "pdf" \| "image" \| "other" }[]` | The files to render. Set as a JS property (array of `{ path, url?, code?, language?, type? }`). |
|
|
425
|
+
| `activeFile` | `active-file` | `undefined \| string` | Selected file path — highlighted in the tree. |
|
|
426
|
+
| `defaultExpanded` | — | `undefined \| string[]` | Folder paths expanded initially. Omit to start with all folders open. |
|
|
427
|
+
|
|
428
|
+
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
429
|
+
|
|
430
|
+
| Event | `detail` type | Description |
|
|
431
|
+
|---|---|---|
|
|
432
|
+
| `select` | `CustomEvent<{ path: string }>` | Fired when a file is selected. `detail.path` = the file's path. |
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
### `kc-file-upload` / `KcFileUpload`
|
|
422
437
|
|
|
423
438
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
424
439
|
|
|
@@ -437,7 +452,21 @@ _No events._
|
|
|
437
452
|
|
|
438
453
|
---
|
|
439
454
|
|
|
440
|
-
### `
|
|
455
|
+
### `kc-form` / `KcForm`
|
|
456
|
+
|
|
457
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
458
|
+
|
|
459
|
+
| Property | Attribute | Type | Description |
|
|
460
|
+
|---|---|---|---|
|
|
461
|
+
| `data` | — | `undefined \| Record<string, unknown>` | The form definition — a JSON Schema (`type:'object'`) + `x-kc-*` UI hints (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { type:'object', properties:{…} }`. Import the `FormDefinition` type from `@kitnai/chat` for the full shape (it is self-referential, so the element types it loosely). |
|
|
462
|
+
| `cardId` | `card-id` | `undefined \| string` | Stable card id correlating every emitted CardEvent. Attribute: `card-id`. |
|
|
463
|
+
| `heading` | `heading` | `undefined \| string` | Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. |
|
|
464
|
+
|
|
465
|
+
_No events._
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
### `kc-image` / `KcImage`
|
|
441
470
|
|
|
442
471
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
443
472
|
|
|
@@ -452,7 +481,20 @@ _No events._
|
|
|
452
481
|
|
|
453
482
|
---
|
|
454
483
|
|
|
455
|
-
### `
|
|
484
|
+
### `kc-link-card` / `KcLinkCard`
|
|
485
|
+
|
|
486
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
487
|
+
|
|
488
|
+
| Property | Attribute | Type | Description |
|
|
489
|
+
|---|---|---|---|
|
|
490
|
+
| `cardId` | `card-id` | `undefined \| string` | Stable card id correlating every emitted event. Set as an attribute or property. |
|
|
491
|
+
| `data` | — | `undefined \| { url: string; title?: undefined \| string; description?: undefined \| string; image?: undefined \| string; imageAlt?: undefined \| string; favicon?: undefined \| string; domain?: undefined \| string; siteName?: undefined \| string }` | The link payload (OG metadata). Set as a JS **property** (object). |
|
|
492
|
+
|
|
493
|
+
_No events._
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
### `kc-loader` / `KcLoader`
|
|
456
498
|
|
|
457
499
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
458
500
|
|
|
@@ -466,7 +508,7 @@ _No events._
|
|
|
466
508
|
|
|
467
509
|
---
|
|
468
510
|
|
|
469
|
-
### `
|
|
511
|
+
### `kc-markdown` / `KcMarkdown`
|
|
470
512
|
|
|
471
513
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
472
514
|
|
|
@@ -481,7 +523,7 @@ _No events._
|
|
|
481
523
|
|
|
482
524
|
---
|
|
483
525
|
|
|
484
|
-
### `
|
|
526
|
+
### `kc-message` / `KcMessage`
|
|
485
527
|
|
|
486
528
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
487
529
|
|
|
@@ -503,19 +545,7 @@ _No events._
|
|
|
503
545
|
|
|
504
546
|
---
|
|
505
547
|
|
|
506
|
-
### `
|
|
507
|
-
|
|
508
|
-
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
509
|
-
|
|
510
|
-
| Property | Attribute | Type | Description |
|
|
511
|
-
|---|---|---|---|
|
|
512
|
-
| `skills` | — | `{ id: string; name: string }[]` | The active skills to badge. Set as a JS property. |
|
|
513
|
-
|
|
514
|
-
_No events._
|
|
515
|
-
|
|
516
|
-
---
|
|
517
|
-
|
|
518
|
-
### `kitn-model-switcher` / `KitnModelSwitcher`
|
|
548
|
+
### `kc-model-switcher` / `KcModelSwitcher`
|
|
519
549
|
|
|
520
550
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
521
551
|
|
|
@@ -532,7 +562,7 @@ _No events._
|
|
|
532
562
|
|
|
533
563
|
---
|
|
534
564
|
|
|
535
|
-
### `
|
|
565
|
+
### `kc-prompt-input` / `KcPromptInput`
|
|
536
566
|
|
|
537
567
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
538
568
|
|
|
@@ -564,47 +594,63 @@ _No events._
|
|
|
564
594
|
|
|
565
595
|
---
|
|
566
596
|
|
|
567
|
-
### `
|
|
597
|
+
### `kc-reasoning` / `KcReasoning`
|
|
568
598
|
|
|
569
599
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
570
600
|
|
|
571
601
|
| Property | Attribute | Type | Description |
|
|
572
602
|
|---|---|---|---|
|
|
573
|
-
| `
|
|
574
|
-
| `
|
|
575
|
-
| `
|
|
576
|
-
| `
|
|
577
|
-
| `
|
|
603
|
+
| `text` | `text` | `string` | The reasoning text to display. |
|
|
604
|
+
| `label` | `label` | `undefined \| string` | Trigger label. |
|
|
605
|
+
| `open` | `open` | `undefined \| false \| true` | Controlled open state — set as a property (`el.open = true`). Omit for uncontrolled (the trigger toggles it). |
|
|
606
|
+
| `streaming` | `streaming` | `undefined \| false \| true` | While true, auto-expands (and re-collapses when it flips false). |
|
|
607
|
+
| `markdown` | `markdown` | `undefined \| false \| true` | Render `text` as markdown. |
|
|
578
608
|
|
|
579
609
|
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
580
610
|
|
|
581
611
|
| Event | `detail` type | Description |
|
|
582
612
|
|---|---|---|
|
|
583
|
-
| `
|
|
613
|
+
| `openchange` | `CustomEvent<{ open: false \| true }>` | Open state changed (via the trigger or streaming auto-open). |
|
|
584
614
|
|
|
585
615
|
---
|
|
586
616
|
|
|
587
|
-
### `
|
|
617
|
+
### `kc-resizable` / `KcResizable`
|
|
588
618
|
|
|
589
619
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
590
620
|
|
|
591
621
|
| Property | Attribute | Type | Description |
|
|
592
622
|
|---|---|---|---|
|
|
593
|
-
| `
|
|
594
|
-
| `label` | `label` | `undefined \| string` | Trigger label. |
|
|
595
|
-
| `open` | `open` | `undefined \| false \| true` | Controlled open state — set as a property (`el.open = true`). Omit for uncontrolled (the trigger toggles it). |
|
|
596
|
-
| `streaming` | `streaming` | `undefined \| false \| true` | While true, auto-expands (and re-collapses when it flips false). |
|
|
597
|
-
| `markdown` | `markdown` | `undefined \| false \| true` | Render `text` as markdown. |
|
|
623
|
+
| `orientation` | `orientation` | `undefined \| "horizontal" \| "vertical"` | Layout axis: `horizontal` (row, default) or `vertical` (column). |
|
|
598
624
|
|
|
599
625
|
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
600
626
|
|
|
601
627
|
| Event | `detail` type | Description |
|
|
602
628
|
|---|---|---|
|
|
603
|
-
| `
|
|
629
|
+
| `change` | `CustomEvent<{ sizes: number[] }>` | Fired on drag-end / keyboard resize / visibility change. `detail.sizes` = panel sizes in percent. |
|
|
604
630
|
|
|
605
631
|
---
|
|
606
632
|
|
|
607
|
-
### `
|
|
633
|
+
### `kc-resizable-item` / `KcResizableItem`
|
|
634
|
+
|
|
635
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
636
|
+
|
|
637
|
+
| Property | Attribute | Type | Description |
|
|
638
|
+
|---|---|---|---|
|
|
639
|
+
| `size` | `size` | `undefined \| string` | Initial main-axis size: `"280px"` (fixed) or `"25%"`/`25` (percent). Omitted → flexible. |
|
|
640
|
+
| `min` | `min` | `undefined \| string` | Minimum size during resize (px or %). |
|
|
641
|
+
| `max` | `max` | `undefined \| string` | Maximum size during resize (px or %). |
|
|
642
|
+
| `locked` | `locked` | `undefined \| false \| true` | Fix this panel's size; adjacent dividers become non-draggable. |
|
|
643
|
+
| `hidden` | `hidden` | `undefined \| false \| true` | Hide this panel; its divider is dropped and the rest reflow. |
|
|
644
|
+
|
|
645
|
+
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
646
|
+
|
|
647
|
+
| Event | `detail` type | Description |
|
|
648
|
+
|---|---|---|
|
|
649
|
+
| `change` | `CustomEvent<unknown>` | |
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
653
|
+
### `kc-response-stream` / `KcResponseStream`
|
|
608
654
|
|
|
609
655
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
610
656
|
|
|
@@ -623,7 +669,37 @@ _No events._
|
|
|
623
669
|
|
|
624
670
|
---
|
|
625
671
|
|
|
626
|
-
### `
|
|
672
|
+
### `kc-scope-picker` / `KcScopePicker`
|
|
673
|
+
|
|
674
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
675
|
+
|
|
676
|
+
| Property | Attribute | Type | Description |
|
|
677
|
+
|---|---|---|---|
|
|
678
|
+
| `availableAuthors` | — | `string[]` | Authors to offer as scope filters. Set as a JS property. |
|
|
679
|
+
| `availableTags` | — | `string[]` | Tags to offer as scope filters. Set as a JS property. |
|
|
680
|
+
| `currentLabel` | `current-label` | `undefined \| string` | The label shown on the trigger for the active scope. |
|
|
681
|
+
|
|
682
|
+
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
683
|
+
|
|
684
|
+
| Event | `detail` type | Description |
|
|
685
|
+
|---|---|---|
|
|
686
|
+
| `scopechange` | `CustomEvent<{ filters: undefined \| { tags?: undefined \| string[]; authors?: undefined \| string[]; contentType?: undefined \| "transcript" \| "markdown"; dateRange?: undefined \| { from: string; to: string } } }>` | A scope was chosen (`undefined` filters = "All Content"). |
|
|
687
|
+
|
|
688
|
+
---
|
|
689
|
+
|
|
690
|
+
### `kc-skills` / `KcSkills`
|
|
691
|
+
|
|
692
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
693
|
+
|
|
694
|
+
| Property | Attribute | Type | Description |
|
|
695
|
+
|---|---|---|---|
|
|
696
|
+
| `skills` | — | `{ id: string; name: string }[]` | The active skills to badge. Set as a JS property. |
|
|
697
|
+
|
|
698
|
+
_No events._
|
|
699
|
+
|
|
700
|
+
---
|
|
701
|
+
|
|
702
|
+
### `kc-source` / `KcSource`
|
|
627
703
|
|
|
628
704
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
629
705
|
|
|
@@ -639,7 +715,7 @@ _No events._
|
|
|
639
715
|
|
|
640
716
|
---
|
|
641
717
|
|
|
642
|
-
### `
|
|
718
|
+
### `kc-sources` / `KcSources`
|
|
643
719
|
|
|
644
720
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
645
721
|
|
|
@@ -652,7 +728,41 @@ _No events._
|
|
|
652
728
|
|
|
653
729
|
---
|
|
654
730
|
|
|
655
|
-
### `
|
|
731
|
+
### `kc-suggestions` / `KcSuggestions`
|
|
732
|
+
|
|
733
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
734
|
+
|
|
735
|
+
| Property | Attribute | Type | Description |
|
|
736
|
+
|---|---|---|---|
|
|
737
|
+
| `suggestions` | — | `(string \| { label: string; value?: undefined \| string })[]` | The suggestions. Strings, or `{ label, value }` when the displayed text and the emitted value differ. Set as a JS property. |
|
|
738
|
+
| `variant` | `variant` | `undefined \| "ghost" \| "default" \| "outline"` | Chip style: `'outline'` (default), `'ghost'`, or `'default'` (filled). |
|
|
739
|
+
| `size` | `size` | `undefined \| "sm" \| "lg" \| "md" \| "icon" \| "icon-sm"` | Size preset for each chip. Defaults to the pill default (`'lg'`); pass `'sm'` for smaller pills (or `'md'`). |
|
|
740
|
+
| `block` | `block` | `undefined \| false \| true` | Full-width left-aligned rows instead of pills. |
|
|
741
|
+
| `highlight` | `highlight` | `undefined \| string` | Substring to highlight within each suggestion. |
|
|
742
|
+
|
|
743
|
+
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
744
|
+
|
|
745
|
+
| Event | `detail` type | Description |
|
|
746
|
+
|---|---|---|
|
|
747
|
+
| `select` | `CustomEvent<{ value: string }>` | A suggestion was clicked. |
|
|
748
|
+
|
|
749
|
+
---
|
|
750
|
+
|
|
751
|
+
### `kc-task-list` / `KcTaskList`
|
|
752
|
+
|
|
753
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
754
|
+
|
|
755
|
+
| Property | Attribute | Type | Description |
|
|
756
|
+
|---|---|---|---|
|
|
757
|
+
| `data` | — | `undefined \| Record<string, unknown>` | The task-list definition (the CardEnvelope.data). Set as a JS PROPERTY: `el.data = { tasks:[…], selectAll, confirmLabel, … }`. Import `TaskListCardData` from `@kitnai/chat` for the full shape. |
|
|
758
|
+
| `cardId` | `card-id` | `undefined \| string` | Stable card id correlating every emitted CardEvent. Attribute: `card-id`. |
|
|
759
|
+
| `heading` | `heading` | `undefined \| string` | Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`. |
|
|
760
|
+
|
|
761
|
+
_No events._
|
|
762
|
+
|
|
763
|
+
---
|
|
764
|
+
|
|
765
|
+
### `kc-text-shimmer` / `KcTextShimmer`
|
|
656
766
|
|
|
657
767
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
658
768
|
|
|
@@ -667,7 +777,7 @@ _No events._
|
|
|
667
777
|
|
|
668
778
|
---
|
|
669
779
|
|
|
670
|
-
### `
|
|
780
|
+
### `kc-thinking-bar` / `KcThinkingBar`
|
|
671
781
|
|
|
672
782
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
673
783
|
|
|
@@ -685,7 +795,7 @@ _No events._
|
|
|
685
795
|
|
|
686
796
|
---
|
|
687
797
|
|
|
688
|
-
### `
|
|
798
|
+
### `kc-tool` / `KcTool`
|
|
689
799
|
|
|
690
800
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
691
801
|
|
|
@@ -698,7 +808,7 @@ _No events._
|
|
|
698
808
|
|
|
699
809
|
---
|
|
700
810
|
|
|
701
|
-
### `
|
|
811
|
+
### `kc-voice-input` / `KcVoiceInput`
|
|
702
812
|
|
|
703
813
|
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
704
814
|
|
|
@@ -716,3 +826,54 @@ _No events._
|
|
|
716
826
|
|
|
717
827
|
---
|
|
718
828
|
|
|
829
|
+
### `kc-workspace` / `KcWorkspace`
|
|
830
|
+
|
|
831
|
+
**Properties** (every element also accepts `theme="light|dark|auto"`; only scalar props work as HTML attributes):
|
|
832
|
+
|
|
833
|
+
| Property | Attribute | Type | Description |
|
|
834
|
+
|---|---|---|---|
|
|
835
|
+
| `groups` | — | `{ id: string; userId?: undefined \| string; teamId?: undefined \| string; name: string; sortOrder: number; createdAt: string }[]` | Pre-bucketed conversation groups for the sidebar. Set as a JS property. |
|
|
836
|
+
| `conversations` | — | `{ id: string; title: string; groupId?: undefined \| string; scope: { type: "document" \| "collection"; documentId?: undefined \| string; filters?: undefined \| { tags?: undefined \| string[]; authors?: undefined \| string[]; contentType?: undefined \| "transcript" \| "markdown"; dateRange?: undefined \| { from: string; to: string } } }; messageCount: number; lastMessageAt: string; updatedAt: string }[]` | Flat conversation list (auto-bucketed if `groups` is empty). Set as a JS property. |
|
|
837
|
+
| `activeId` | `active-id` | `undefined \| string` | Id of the open conversation, highlighted in the sidebar. |
|
|
838
|
+
| `messages` | — | `{ id: string; role: "user" \| "assistant"; content: string; reasoning?: undefined \| { text: string; label?: undefined \| string }; tools?: undefined \| { type: string; state: "input-streaming" \| "input-available" \| "output-available" \| "output-error"; input?: undefined \| Record<string, unknown>; output?: undefined \| Record<string, unknown>; toolCallId?: undefined \| string; errorText?: undefined \| string }[]; attachments?: undefined \| { id: string; type: "file" \| "source-document"; filename?: undefined \| string; mediaType?: undefined \| string; url?: undefined \| string; title?: undefined \| string }[]; actions?: undefined \| ("copy" \| "like" \| "dislike" \| "regenerate" \| "edit")[] }[]` | The active conversation's message thread, newest last. Set as a JS property. |
|
|
839
|
+
| `value` | `value` | `undefined \| string` | |
|
|
840
|
+
| `placeholder` | `placeholder` | `undefined \| string` | |
|
|
841
|
+
| `loading` | `loading` | `undefined \| false \| true` | |
|
|
842
|
+
| `suggestions` | — | `undefined \| string[]` | |
|
|
843
|
+
| `suggestionMode` | `suggestion-mode` | `undefined \| "submit" \| "fill"` | |
|
|
844
|
+
| `proseSize` | `prose-size` | `undefined \| "xs" \| "sm" \| "base" \| "lg"` | |
|
|
845
|
+
| `codeTheme` | `code-theme` | `undefined \| string` | |
|
|
846
|
+
| `codeHighlight` | `code-highlight` | `undefined \| false \| true` | |
|
|
847
|
+
| `chatTitle` | `chat-title` | `undefined \| string` | |
|
|
848
|
+
| `models` | — | `undefined \| { id: string; name: string; provider?: undefined \| string }[]` | |
|
|
849
|
+
| `currentModel` | `current-model` | `undefined \| string` | |
|
|
850
|
+
| `context` | — | `undefined \| { usedTokens: number; maxTokens: number; inputTokens?: undefined \| number; outputTokens?: undefined \| number; estimatedCost?: undefined \| number }` | |
|
|
851
|
+
| `scrollButton` | `scroll-button` | `undefined \| false \| true` | |
|
|
852
|
+
| `search` | `search` | `undefined \| false \| true` | |
|
|
853
|
+
| `voice` | `voice` | `undefined \| false \| true` | |
|
|
854
|
+
| `slashCommands` | — | `undefined \| { id: string; label: string; description?: undefined \| string; category?: undefined \| string }[]` | |
|
|
855
|
+
| `slashActiveIds` | — | `undefined \| string[]` | |
|
|
856
|
+
| `slashCompact` | `slash-compact` | `undefined \| false \| true` | |
|
|
857
|
+
| `sidebarWidth` | `sidebar-width` | `undefined \| number` | Sidebar default width as a percent of the workspace (default 22). |
|
|
858
|
+
| `sidebarMinWidth` | `sidebar-min-width` | `undefined \| number` | Sidebar min width in px (default 200). |
|
|
859
|
+
| `sidebarMaxWidth` | `sidebar-max-width` | `undefined \| number` | Sidebar max width in px (default 420). |
|
|
860
|
+
| `sidebarCollapsed` | `sidebar-collapsed` | `undefined \| false \| true` | Initial collapsed state of the sidebar (default false). |
|
|
861
|
+
|
|
862
|
+
**Events** (non-bubbling `CustomEvent`s — listen directly on the element):
|
|
863
|
+
|
|
864
|
+
| Event | `detail` type | Description |
|
|
865
|
+
|---|---|---|
|
|
866
|
+
| `conversationselect` | `CustomEvent<{ id: string }>` | A conversation was selected in the sidebar. |
|
|
867
|
+
| `messageaction` | `CustomEvent<{ messageId: string; action: "copy" \| "like" \| "dislike" \| "regenerate" \| "edit" }>` | An action button on a message was clicked. |
|
|
868
|
+
| `modelchange` | `CustomEvent<{ modelId: string }>` | The header model switcher changed. |
|
|
869
|
+
| `newchat` | `CustomEvent<Record<string, never>>` | The "New chat" button was clicked. |
|
|
870
|
+
| `search` | `CustomEvent<Record<string, never>>` | The Search button was clicked. |
|
|
871
|
+
| `sidebartoggle` | `CustomEvent<{ collapsed: false \| true }>` | The sidebar was collapsed or expanded. |
|
|
872
|
+
| `slashselect` | `CustomEvent<{ command: { id: string; label: string; description?: undefined \| string; category?: undefined \| string } }>` | A slash command was chosen from the palette. |
|
|
873
|
+
| `submit` | `CustomEvent<{ value: string; attachments: { id: string; type: "file" \| "source-document"; filename?: undefined \| string; mediaType?: undefined \| string; url?: undefined \| string; title?: undefined \| string }[] }>` | User submitted a message. |
|
|
874
|
+
| `suggestionclick` | `CustomEvent<{ value: string }>` | A suggestion chip was clicked (only in `suggestion-mode="fill"`). |
|
|
875
|
+
| `valuechange` | `CustomEvent<{ value: string }>` | Fired on every input change. |
|
|
876
|
+
| `voice` | `CustomEvent<Record<string, never>>` | The Mic / voice button was clicked. |
|
|
877
|
+
|
|
878
|
+
---
|
|
879
|
+
|