@slexkit/mcp 0.4.0 → 0.5.2
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 +25 -85
- package/dist/data/llms-authoring.txt +2 -45
- package/dist/data/llms-capabilities.txt +2 -125
- package/dist/data/llms-components.txt +176 -603
- package/dist/data/llms-full.txt +1721 -8264
- package/dist/data/llms-runtime.txt +83 -1716
- package/dist/data/llms-toolhost.txt +2 -300
- package/dist/data/llms.txt +79 -74
- package/dist/data/slexkit-ai-manifest.json +1828 -3077
- package/dist/data/standard/slex-custom-elements.catalog.json +1134 -0
- package/dist/data/standard/slex-html-conformance.json +156 -0
- package/dist/data/standard/slex-html-profile.json +34 -0
- package/dist/data/standard/slex-sandbox-sdk.json +39 -0
- package/dist/data/standard/slex-standard-manifest.json +22 -24
- package/dist/data/standard/slex-static-policy.json +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13030 -2676
- package/dist/index.js.map +23 -5
- package/package.json +47 -47
- package/dist/data/standard/slex-capabilities.catalog.json +0 -413
- package/dist/data/standard/slex-component-catalog.json +0 -4475
- package/dist/data/standard/slex-conformance.json +0 -248
- package/dist/data/standard/slex-expression.schema.json +0 -2116
- package/dist/data/standard/slex-logic-profile.json +0 -130
|
@@ -1,301 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ToolHost
|
|
2
2
|
|
|
3
|
-
ToolHost
|
|
4
|
-
|
|
5
|
-
## ToolHost
|
|
6
|
-
|
|
7
|
-
Raw Markdown: /docs/reference/toolhost.md
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
title: ToolHost
|
|
11
|
-
category: Reference
|
|
12
|
-
status: ready
|
|
13
|
-
order: 70
|
|
14
|
-
summary: "Structured user-input UI for confirmations, choices, forms, and templates."
|
|
15
|
-
slexkitRenderMode: component
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# ToolHost
|
|
19
|
-
|
|
20
|
-
ToolHost bridges tool calls to interactive UI. When a model asks for confirmation, a choice, or form input, ToolHost renders the structured UI in the browser and returns the user's response as a `ToolResult`.
|
|
21
|
-
|
|
22
|
-
## Concepts
|
|
23
|
-
|
|
24
|
-
When a model emits a tool call such as `confirm-action` or `fill-form`, ToolHost compiles it into a standard `SlexExpression` and mounts it using the core runtime. The mounted UI uses `submit:actions` to submit the user's input and settle a Promise.
|
|
25
|
-
|
|
26
|
-
ToolHost is **separate from display-oriented `slex` fences**. Display components render information; ToolHost components collect structured user input and return it programmatically.
|
|
27
|
-
|
|
28
|
-
### Submit
|
|
29
|
-
|
|
30
|
-
`submit:actions` reads the fields listed in `returnKeys`, calls the ToolHost runtime, and resolves the `ToolRenderHandle.promise` with a `ToolResult`.
|
|
31
|
-
|
|
32
|
-
Do not use `submit` in display fences or component demos. Use `button` for ordinary interactions; use `submit:actions` only when the host is waiting for a structured tool result.
|
|
33
|
-
|
|
34
|
-
## Public API
|
|
35
|
-
|
|
36
|
-
### `renderToolCall(call, container) → ToolRenderHandle`
|
|
37
|
-
|
|
38
|
-
Compiles a tool call into a SlexExpression, mounts it, and returns a handle.
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
function renderToolCall(call: ToolCall, container: HTMLElement): ToolRenderHandle;
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
type ToolRenderHandle = {
|
|
46
|
-
promise: Promise<ToolResult>; // Resolves when user submits or ignores
|
|
47
|
-
dispose: () => void; // Clean up the rendered UI
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
type ToolResult =
|
|
51
|
-
| { toolCallId?: string; toolName: string; status: "submitted"; value: Record<string, unknown> }
|
|
52
|
-
| { toolCallId?: string; toolName: string; status: "ignored"; value: null };
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Usage:**
|
|
56
|
-
|
|
57
|
-
```js
|
|
58
|
-
import { renderToolCall } from "slexkit";
|
|
59
|
-
|
|
60
|
-
const handle = renderToolCall(
|
|
61
|
-
{
|
|
62
|
-
id: "call_001",
|
|
63
|
-
name: "confirm-action",
|
|
64
|
-
arguments: {
|
|
65
|
-
title: "Delete file?",
|
|
66
|
-
description: "This action cannot be undone.",
|
|
67
|
-
confirmLabel: "Delete",
|
|
68
|
-
requireReason: true,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
document.getElementById("tool-container"),
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
handle.promise.then((result) => {
|
|
75
|
-
console.log(result.status); // "submitted" or "ignored"
|
|
76
|
-
console.log(result.value); // { confirmed: true, reason: "Obsolete file" }
|
|
77
|
-
handle.dispose();
|
|
78
|
-
});
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### `registerToolTemplate(name, compiler)`
|
|
82
|
-
|
|
83
|
-
Register a custom tool template. The compiler function receives the tool arguments and returns a `SlexExpression`.
|
|
84
|
-
|
|
85
|
-
```ts
|
|
86
|
-
function registerToolTemplate(name: string, compiler: ToolTemplateCompiler): void;
|
|
87
|
-
|
|
88
|
-
type ToolTemplateCompiler<TArgs = Record<string, unknown>> = (
|
|
89
|
-
args: TArgs,
|
|
90
|
-
runtime: ToolRuntime,
|
|
91
|
-
call: ToolCall,
|
|
92
|
-
) => SlexExpression;
|
|
93
|
-
|
|
94
|
-
type ToolRuntime = {
|
|
95
|
-
submit: (value: Record<string, unknown>) => void;
|
|
96
|
-
ignore: () => void;
|
|
97
|
-
};
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Built-in templates
|
|
101
|
-
|
|
102
|
-
### `confirm-action`
|
|
103
|
-
|
|
104
|
-
Yes/no confirmation dialog. Supports an optional reason field.
|
|
105
|
-
|
|
106
|
-
**Arguments (`ConfirmActionArguments`):**
|
|
107
|
-
|
|
108
|
-
| Field | Type | Default | Description |
|
|
109
|
-
|-------|------|---------|-------------|
|
|
110
|
-
| `title` | `string` | `"Confirm action"` | Dialog title |
|
|
111
|
-
| `description` | `string` | — | Optional explanation text |
|
|
112
|
-
| `confirmLabel` | `string` | `"Confirm"` | Submit button label |
|
|
113
|
-
| `ignoreLabel` | `string` | `"Ignore"` | Cancel button label |
|
|
114
|
-
| `requireReason` | `boolean` | `false` | Show a reason text input |
|
|
115
|
-
| `reasonLabel` | `string` | `"Reason"` | Label for the reason input |
|
|
116
|
-
| `reasonPlaceholder` | `string` | `"Add a reason"` | Placeholder for the reason input |
|
|
117
|
-
|
|
118
|
-
**Result value:**
|
|
119
|
-
|
|
120
|
-
| Key | Type | Description |
|
|
121
|
-
|-----|------|-------------|
|
|
122
|
-
| `confirmed` | `boolean` | Always `true` when submitted |
|
|
123
|
-
| `reason` | `string` | User's reason text (only if `requireReason: true`) |
|
|
124
|
-
|
|
125
|
-
**Example:**
|
|
126
|
-
|
|
127
|
-
```js
|
|
128
|
-
renderToolCall({
|
|
129
|
-
name: "confirm-action",
|
|
130
|
-
arguments: {
|
|
131
|
-
title: "Delete project?",
|
|
132
|
-
description: "This will permanently delete all files.",
|
|
133
|
-
confirmLabel: "Delete",
|
|
134
|
-
requireReason: true,
|
|
135
|
-
},
|
|
136
|
-
}, container);
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### `choose-options` / `option-list`
|
|
140
|
-
|
|
141
|
-
Single or multi-select option list. `option-list` is an alias for `choose-options` — behavior is identical.
|
|
142
|
-
|
|
143
|
-
**Arguments (`ChooseOptionsArguments` / `OptionListArguments`):**
|
|
144
|
-
|
|
145
|
-
| Field | Type | Default | Description |
|
|
146
|
-
|-------|------|---------|-------------|
|
|
147
|
-
| `title` | `string` | `"Choose options"` | Dialog title |
|
|
148
|
-
| `description` | `string` | — | Optional explanation text |
|
|
149
|
-
| `options` / `items` | `OptionListItem[]` | `[]` | List of selectable items |
|
|
150
|
-
| `multiple` | `boolean` | `true` | Allow multiple selection |
|
|
151
|
-
| `selected` | `string[]` | auto | Pre-selected item IDs |
|
|
152
|
-
| `minSelected` | `number` | `0` | Minimum required selections |
|
|
153
|
-
| `maxSelected` | `number` | `Infinity` | Maximum allowed selections |
|
|
154
|
-
| `submitLabel` | `string` | `"Submit"` | Submit button label |
|
|
155
|
-
| `ignoreLabel` | `string` | `"Ignore"` | Cancel button label |
|
|
156
|
-
|
|
157
|
-
**OptionListItem:**
|
|
158
|
-
|
|
159
|
-
| Field | Type | Description |
|
|
160
|
-
|-------|------|-------------|
|
|
161
|
-
| `label` | `string` | Display text (required) |
|
|
162
|
-
| `id` | `string` | Unique identifier (defaults to `value` or index) |
|
|
163
|
-
| `value` | `string` | Submitted value (defaults to `id`) |
|
|
164
|
-
| `description` | `string` | Secondary text shown after label |
|
|
165
|
-
| `selected` | `boolean` | Pre-selected state |
|
|
166
|
-
| `disabled` | `boolean` | Disabled state |
|
|
167
|
-
|
|
168
|
-
**Rendering:**
|
|
169
|
-
- When `multiple: true` (default): renders **checkboxes**
|
|
170
|
-
- When `multiple: false`: renders a **radio group**
|
|
171
|
-
|
|
172
|
-
**Result value:**
|
|
173
|
-
|
|
174
|
-
| Key | Type | Description |
|
|
175
|
-
|-----|------|-------------|
|
|
176
|
-
| `selected` | `string[]` | IDs of selected items |
|
|
177
|
-
|
|
178
|
-
**Example:**
|
|
179
|
-
|
|
180
|
-
```js
|
|
181
|
-
renderToolCall({
|
|
182
|
-
name: "choose-options",
|
|
183
|
-
arguments: {
|
|
184
|
-
title: "Select dependencies",
|
|
185
|
-
options: [
|
|
186
|
-
{ id: "react", label: "React", description: "UI library" },
|
|
187
|
-
{ id: "vue", label: "Vue", description: "Progressive framework" },
|
|
188
|
-
{ id: "svelte", label: "Svelte", description: "Compiled framework", selected: true },
|
|
189
|
-
],
|
|
190
|
-
multiple: true,
|
|
191
|
-
minSelected: 1,
|
|
192
|
-
maxSelected: 2,
|
|
193
|
-
},
|
|
194
|
-
}, container);
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### `fill-form`
|
|
198
|
-
|
|
199
|
-
Multi-field form with various field types.
|
|
200
|
-
|
|
201
|
-
**Arguments (`FillFormArguments`):**
|
|
202
|
-
|
|
203
|
-
| Field | Type | Default | Description |
|
|
204
|
-
|-------|------|---------|-------------|
|
|
205
|
-
| `title` | `string` | `"Fill form"` | Form title |
|
|
206
|
-
| `description` | `string` | — | Optional explanation text |
|
|
207
|
-
| `fields` | `FormField[]` | `[]` | Form field definitions |
|
|
208
|
-
| `values` | `Record<string, unknown>` | — | Initial field values |
|
|
209
|
-
| `submitLabel` | `string` | `"Submit"` | Submit button label |
|
|
210
|
-
| `ignoreLabel` | `string` | `"Ignore"` | Cancel button label |
|
|
211
|
-
|
|
212
|
-
**FormField:**
|
|
213
|
-
|
|
214
|
-
| Field | Type | Default | Description |
|
|
215
|
-
|-------|------|---------|-------------|
|
|
216
|
-
| `name` | `string` | (required) | Field name (used as key in result value) |
|
|
217
|
-
| `type` | `FormFieldType` | `"text"` | Field type |
|
|
218
|
-
| `label` | `string` | `name` | Display label |
|
|
219
|
-
| `description` | `string` | — | Help text below the field |
|
|
220
|
-
| `placeholder` | `string` | — | Input placeholder |
|
|
221
|
-
| `required` | `boolean` | `false` | Require non-empty value to submit |
|
|
222
|
-
| `disabled` | `boolean` | `false` | Disable the field |
|
|
223
|
-
| `value` | `unknown` | — | Initial value |
|
|
224
|
-
| `options` | `Array<{label, value}>` | — | Options for `select` type |
|
|
225
|
-
|
|
226
|
-
**FormFieldType:**
|
|
227
|
-
|
|
228
|
-
| Type | Renders | Description |
|
|
229
|
-
|------|---------|-------------|
|
|
230
|
-
| `text` | `<input>` | Free-form text |
|
|
231
|
-
| `number` | `<input type="number">` | Numeric input, value is `number \| null` |
|
|
232
|
-
| `engineering` | `<input>` with SI prefix parsing | Accepts values like `"10kΩ"`, `"100nF"`, `"1.5MegHz"`. Parsed with `parseEngineeringNumber()`. State includes `raw`, `number`, `valid`, `prefix`, `unit`, `normalized` |
|
|
233
|
-
| `select` | `<select>` | Dropdown from `options` array |
|
|
234
|
-
| `checkbox` | Checkbox | Boolean toggle |
|
|
235
|
-
| `switch` | Switch toggle | Boolean toggle (switch style) |
|
|
236
|
-
|
|
237
|
-
**Result value:**
|
|
238
|
-
|
|
239
|
-
An object with a key for each field name, containing the submitted value. For `engineering` fields, the raw input string is submitted. For `checkbox`/`switch` fields, a boolean is submitted. For `number` fields, a number or `null` is submitted.
|
|
240
|
-
|
|
241
|
-
**Example:**
|
|
242
|
-
|
|
243
|
-
```js
|
|
244
|
-
renderToolCall({
|
|
245
|
-
name: "fill-form",
|
|
246
|
-
arguments: {
|
|
247
|
-
title: "New project",
|
|
248
|
-
fields: [
|
|
249
|
-
{ name: "name", type: "text", label: "Project name", required: true },
|
|
250
|
-
{ name: "framework", type: "select", label: "Framework", options: [
|
|
251
|
-
{ label: "React", value: "react" },
|
|
252
|
-
{ label: "Svelte", value: "svelte" },
|
|
253
|
-
]},
|
|
254
|
-
{ name: "resistance", type: "engineering", label: "Target resistance", placeholder: "e.g. 10kΩ" },
|
|
255
|
-
{ name: "typescript", type: "checkbox", label: "Use TypeScript", value: true },
|
|
256
|
-
],
|
|
257
|
-
},
|
|
258
|
-
}, container);
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
## Writing a custom template
|
|
262
|
-
|
|
263
|
-
Implement the `ToolTemplateCompiler` function and register it:
|
|
264
|
-
|
|
265
|
-
```js
|
|
266
|
-
import { registerToolTemplate, renderToolCall } from "slexkit";
|
|
267
|
-
|
|
268
|
-
registerToolTemplate("greet-user", (args, runtime, call) => ({
|
|
269
|
-
namespace: `tool_greet_${Date.now()}`,
|
|
270
|
-
g: {
|
|
271
|
-
__slexkitTool: runtime,
|
|
272
|
-
name: args.name || "World",
|
|
273
|
-
},
|
|
274
|
-
layout: {
|
|
275
|
-
"card:tool": {
|
|
276
|
-
title: "Greeting",
|
|
277
|
-
"text:message": { "$content": "'Hello, ' + g.name + '!'" },
|
|
278
|
-
"submit:actions": {
|
|
279
|
-
returnKeys: ["name"],
|
|
280
|
-
submitLabel: args.submitLabel || "OK",
|
|
281
|
-
ignoreLabel: args.ignoreLabel || "Cancel",
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
}));
|
|
286
|
-
|
|
287
|
-
renderToolCall(
|
|
288
|
-
{ name: "greet-user", arguments: { name: "Alice" } },
|
|
289
|
-
container,
|
|
290
|
-
);
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Key patterns
|
|
294
|
-
|
|
295
|
-
1. **`__slexkitTool`** — Set `g.__slexkitTool = runtime` to give expressions access to `submit()` and `ignore()`
|
|
296
|
-
2. **`submit:actions`** — Always include a `submit:actions` component to submit the result. Set `returnKeys` to the property names that should be included in the result value
|
|
297
|
-
3. **`canSubmit`** — Add a `g.canSubmit()` method to control the submit button's disabled state
|
|
298
|
-
4. **Unique namespace** — Use a timestamp-based namespace to avoid collisions with other tool calls
|
|
299
|
-
5. **Validation** — Implement validation logic in `g` methods and wire `$disabled` on the submit button
|
|
300
|
-
|
|
301
|
-
---
|
|
3
|
+
ToolHost renders structured tool requests such as confirmation, option selection, and form filling. It is a host-controlled workflow and remains separate from ordinary display-oriented `slex` HTML. Tool results cross an explicit submit/ignore boundary; do not imitate tool submission with arbitrary artifact code.
|
package/dist/data/llms.txt
CHANGED
|
@@ -1,96 +1,101 @@
|
|
|
1
1
|
# SlexKit > Markdown-friendly reactive UI runtime for AI output
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- [Component reference](/llms-components.txt): component docs index plus generated props/state reference.
|
|
7
|
-
- [Runtime docs](/llms-runtime.txt): runtime, host integration, and secure rendering docs.
|
|
8
|
-
- [Capabilities](/llms-capabilities.txt): expression context, `std.*` standard library, and policy-gated `api.*`.
|
|
9
|
-
- [ToolHost docs](/llms-toolhost.txt): structured user-input UI docs.
|
|
10
|
-
- [Authoring rules](/llms-authoring.txt): concise rules for Markdown `slex` fences.
|
|
11
|
-
- [AI manifest](/slexkit-ai-manifest.json): structured page, component, and hash metadata.
|
|
12
|
-
- [Standard manifest](/standard/slex-standard-manifest.json): schema, component catalog, logic profile, capabilities, and conformance metadata.
|
|
13
|
-
- [Logic profile](/standard/slex-logic-profile.json): `$` read-pipes, `on*` write-pipes, directives, context, and secure-mode guidance.
|
|
14
|
-
- [Component catalog](/standard/slex-component-catalog.json): public component props, state modes, children, examples, docs, and hashes.
|
|
5
|
+
## Machine-readable documentation
|
|
15
6
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
- [Complete documentation](/llms-full.txt)
|
|
8
|
+
- [Custom-element catalog and examples](/llms-components.txt)
|
|
9
|
+
- [Runtime reference](/llms-runtime.txt)
|
|
10
|
+
- [Sandbox SDK and capabilities](/llms-capabilities.txt)
|
|
11
|
+
- [ToolHost reference](/llms-toolhost.txt)
|
|
12
|
+
- [HTML authoring rules](/llms-authoring.txt)
|
|
13
|
+
- [AI documentation manifest](/slexkit-ai-manifest.json)
|
|
14
|
+
- [Standard manifest](/standard/slex-standard-manifest.json)
|
|
15
|
+
- [HTML profile](/standard/slex-html-profile.json)
|
|
16
|
+
- [Custom-element catalog](/standard/slex-custom-elements.catalog.json)
|
|
17
|
+
- [Sandbox SDK](/standard/slex-sandbox-sdk.json)
|
|
18
|
+
- [Static policy](/standard/slex-static-policy.json)
|
|
19
|
+
- [HTML conformance fixtures](/standard/slex-html-conformance.json)
|
|
21
20
|
|
|
22
21
|
### Guides
|
|
23
|
-
|
|
24
|
-
- [SlexKit Introduction](/docs/guides/intro.md): What SlexKit is and where it fits.
|
|
25
|
-
- [Quick Start](/docs/guides/quick-start.md): Install SlexKit and render a first Markdown-friendly Slex source.
|
|
26
|
-
- [Integration](/docs/guides/integration.md): Streamdown, Tiptap, Obsidian, and custom Markdown hosts for explicit Slex fences.
|
|
27
|
-
- [Design Guidelines](/docs/guides/design.md): Design and authoring guidelines for SlexKit components and docs.
|
|
28
|
-
- [Secure Runtime Setup](/docs/guides/security-runtime.md): Decision and setup guide for rendering untrusted or agent-generated Slex source.
|
|
22
|
+
|
|
29
23
|
- [AI / Agents](/docs/guides/ai-agents.md): LLM docs, MCP server, skills, and authoring rules for SlexKit agents.
|
|
24
|
+
- [Design Philosophy](/docs/guides/design.md): Design principles for live Markdown, components, and agent-generated UI.
|
|
25
|
+
- [Getting Started](/docs/guides/quick-start.md): Install SlexKit, mount a first fragment, and keep readable Markdown fallback.
|
|
26
|
+
- [Integration](/docs/guides/integration.md): Connect SlexKit to assistant-ui, Streamdown, Tiptap, Obsidian, or a custom Markdown renderer.
|
|
27
|
+
- [Secure Runtime Setup](/docs/guides/security-runtime.md): Run unreviewed user input, third-party Markdown, or agent output in the isolated HTML document host.
|
|
28
|
+
- [SlexKit Introduction](/docs/guides/intro.md): Markdown-friendly reactive UI runtime for explicit slex fences.
|
|
30
29
|
|
|
31
30
|
### Examples
|
|
32
|
-
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
31
|
+
|
|
32
|
+
- [Artifact Shared State Lab](/docs/examples/cross-doc-state-lab.md): Synchronize JSON state between three independent fences in the same artifact.
|
|
33
|
+
- [assistant-ui Integration](/docs/examples/assistant-ui-host.md): assistant-ui adapter for rendering explicit slex fences inside Streamdown text message parts.
|
|
34
|
+
- [Baud Rate Error Calculator](/docs/examples/baud-rate-calculator.md): Enter crystal frequency and target baud rate to calculate UART baud rate error percentage and judge communication reliability.
|
|
35
|
+
- [Branching: Mode Selector](/docs/examples/tabs-and-branching.md): Use select to switch the mode state and render different inputs and results.
|
|
36
|
+
- [Build vs Buy Decision](/docs/examples/roi-estimator.md): A build-vs-buy decision matrix — four-dimension evaluation across feature coverage, cost, timeline, and risk with automatic recommendation.
|
|
37
|
+
- [First Interaction: Button Counter](/docs/examples/first-interaction.md): A button updates a stat through native click handling and live component properties.
|
|
38
|
+
- [First SlexKit Card](/docs/examples/hello-slexkit.md): A static card with text and badge custom elements; no script is required.
|
|
39
|
+
- [JSONPlaceholder Network Request Lab](/docs/examples/network-policy-fetch-card.md): Uses JSONPlaceholder to demonstrate how the secure runtime delegates user-triggered network requests to host policy for review and proxying.
|
|
40
|
+
- [Multi-Input Coordination](/docs/examples/multi-input-coordination.md): An input and slider feed one JavaScript calculation through native input events.
|
|
41
|
+
- [Project Dashboard](/docs/examples/project-dashboard.md): Build an information dashboard with section + grid — covering Sprint progress, quality metrics, and team health with multi-card coordination.
|
|
42
|
+
- [RC Low-Pass Filter](/docs/examples/rc-low-pass-filter.md): A frequency-selective circuit built with a resistor and capacitor — calculate cutoff frequency and gain attenuation at any frequency.
|
|
43
|
+
- [Search and Filter Table](/docs/examples/search-filter-table.md): A search input filters table rows in real time and uses collapsible for row details.
|
|
44
|
+
- [Social Insurance Calculator](/docs/examples/salary-calculator.md): Enter a salary and city to calculate China's social insurance breakdown — showing personal contributions, employer contributions, and take-home pay.
|
|
45
|
+
- [Software Project Cost Estimator](/docs/examples/project-cost-estimator.md): Enter team size, development timeline, and per-person cost to calculate total project cost and monthly burn rate.
|
|
46
|
+
- [Streamdown Integration](/docs/examples/streamdown-host.md): A React/Streamdown adapter that takes over explicit slex fences and leaves ordinary Markdown and code blocks to Streamdown.
|
|
47
|
+
- [Technology Selection Evaluator](/docs/examples/tech-selection-evaluator.md): Compare example technology scores across performance, ecosystem, learning, and maintenance.
|
|
48
|
+
- [Tiptap Editor Integration](/docs/examples/tiptap-host.md): A Tiptap CodeBlock adapter that previews explicit slex blocks while preserving ordinary code blocks and Markdown import/export.
|
|
49
|
+
- [ToolHost Form Question](/docs/examples/form-wizard-steps.md): ToolHost renders a form card during a conversation, collects project fields, and submits structured results.
|
|
50
|
+
- [ToolHost Tool Call UI](/docs/examples/toolhost-demo.md): Render a function_call as an inline tool card, then write the submitted result back as function_call_output.
|
|
51
|
+
- [Voltage Divider Calculator](/docs/examples/voltage-divider.md): Enter input voltage and two resistor values to calculate divider output voltage and evaluate load effect error.
|
|
52
52
|
|
|
53
53
|
### Components
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
- [Accordion](/docs/components/accordion.md): Multi-panel collapse for FAQs or grouped details.
|
|
55
56
|
- [Badge](/docs/components/badge.md): Compact label for status or classification.
|
|
56
|
-
- [Button](/docs/components/button.md): Action trigger.
|
|
57
|
-
- [Callout](/docs/components/callout.md): Highlighted contextual message.
|
|
57
|
+
- [Button](/docs/components/button.md): Action trigger button.
|
|
58
|
+
- [Callout](/docs/components/callout.md): Highlighted contextual message for notes, warnings, and tips.
|
|
58
59
|
- [Card](/docs/components/card.md): Grouping container for related content.
|
|
59
|
-
- [Checkbox](/docs/components/checkbox.md): Boolean checkbox
|
|
60
|
-
- [Code Block](/docs/components/code-block.md):
|
|
61
|
-
- [Collapsible](/docs/components/collapsible.md): Single expandable
|
|
62
|
-
- [Column](/docs/components/column.md): Vertical layout container.
|
|
63
|
-
- [Divider](/docs/components/divider.md):
|
|
60
|
+
- [Checkbox](/docs/components/checkbox.md): Boolean checkbox for confirmations and multi-select.
|
|
61
|
+
- [Code Block](/docs/components/code-block.md): Code or configuration snippet display.
|
|
62
|
+
- [Collapsible](/docs/components/collapsible.md): Single expandable content area.
|
|
63
|
+
- [Column](/docs/components/column.md): Vertical layout container for forms, text, and control groups.
|
|
64
|
+
- [Divider](/docs/components/divider.md): Separator line, optionally with label.
|
|
64
65
|
- [Formula](/docs/components/formula.md): Reactive KaTeX formula display.
|
|
65
|
-
- [Grid](/docs/components/grid.md): Responsive grid
|
|
66
|
-
- [Icon](/docs/components/icon.md): Shared icon field capability.
|
|
67
|
-
- [Input](/docs/components/input.md):
|
|
68
|
-
- [Link](/docs/components/link.md):
|
|
69
|
-
- [Playground](/docs/components/playground.md):
|
|
66
|
+
- [Grid](/docs/components/grid.md): Responsive equal-width grid for sibling cards, metrics, and field groups.
|
|
67
|
+
- [Icon](/docs/components/icon.md): Shared icon field capability used by all icon-supporting components.
|
|
68
|
+
- [Input](/docs/components/input.md): Single-line text or engineering value input.
|
|
69
|
+
- [Link](/docs/components/link.md): Navigation or lightweight jump action.
|
|
70
|
+
- [Playground](/docs/components/playground.md): Optional HTML editor and isolated preview registered explicitly from slexkit/tooling.
|
|
70
71
|
- [Progress](/docs/components/progress.md): Progress bar.
|
|
71
|
-
- [Radio Group](/docs/components/radio-group.md):
|
|
72
|
-
- [Row](/docs/components/row.md): Horizontal layout container.
|
|
73
|
-
- [Section](/docs/components/section.md): Page section with optional
|
|
74
|
-
- [Select](/docs/components/select.md):
|
|
72
|
+
- [Radio Group](/docs/components/radio-group.md): Mutually exclusive radio selection.
|
|
73
|
+
- [Row](/docs/components/row.md): Horizontal layout container for toolbars, status lines, and button groups.
|
|
74
|
+
- [Section](/docs/components/section.md): Page section with title, subtitle, optional action, and content area.
|
|
75
|
+
- [Select](/docs/components/select.md): Single-select dropdown.
|
|
75
76
|
- [Slider](/docs/components/slider.md): Numeric range input.
|
|
76
|
-
- [Stat](/docs/components/stat.md): Metric display.
|
|
77
|
-
- [
|
|
78
|
-
- [
|
|
77
|
+
- [Stat](/docs/components/stat.md): Metric display with label, value, unit, and semantic tone.
|
|
78
|
+
- [Submit](/docs/components/submit.md): ToolHost-only submit action that returns current selection or form values to the host.
|
|
79
|
+
- [Switch](/docs/components/switch.md): Boolean toggle input for instant settings.
|
|
80
|
+
- [Table](/docs/components/table.md): Structured table with columns and rows.
|
|
79
81
|
- [Tabs](/docs/components/tabs.md): Tabbed view switcher.
|
|
80
|
-
- [Text](/docs/components/text.md):
|
|
81
|
-
- [Toast](/docs/components/toast.md): Transient notification.
|
|
82
|
+
- [Text](/docs/components/text.md): Short text output for status, description, and results.
|
|
83
|
+
- [Toast](/docs/components/toast.md): Transient notification with semantic type.
|
|
84
|
+
- [ToolHost Step](/docs/components/step.md): ToolHost-only step page for collecting multiple human inputs inside one function call.
|
|
82
85
|
|
|
83
86
|
### Reference
|
|
84
|
-
|
|
85
|
-
- [
|
|
86
|
-
- [
|
|
87
|
-
- [
|
|
88
|
-
- [
|
|
89
|
-
- [
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
92
|
-
- [
|
|
93
|
-
- [
|
|
87
|
+
|
|
88
|
+
- [Design Rationale](/docs/reference/rationale.md): Why SlexKit uses standards-based HTML/JavaScript with an isolated document lifecycle.
|
|
89
|
+
- [Host Integration](/docs/reference/integration.md): HTML document host integration for Streamdown, assistant-ui, Tiptap, note hosts, and custom adapters.
|
|
90
|
+
- [Icon System](/docs/reference/icons.md): Phosphor icons, custom icon registration, Iconify fallback, and component icon usage.
|
|
91
|
+
- [Packages](/docs/reference/packages.md): SlexKit npm package roles, install combinations, publish contents, and release checks.
|
|
92
|
+
- [Runtime Model](/docs/reference/runtime.md): HTML mounting, artifact updates, isolated lifecycle hooks, snapshots, shared JSON state, and static inspection.
|
|
93
|
+
- [Security Runtime Contract](/docs/reference/security.md): Threat model, sandbox iframe deployment, host policy, postMessage bridge, and fail-closed behavior.
|
|
94
|
+
- [Slex HTML Profile html-1](/docs/reference/spec.md): HTML source profile, sandbox SDK, update identity, lifecycle, and static inspection contract.
|
|
95
|
+
- [Slex Standard Artifacts](/docs/reference/standard.md): Generated metadata for the html-1 profile, custom elements, sandbox SDK, static policy, conformance fixtures, and hashes.
|
|
96
|
+
- [Slex Usage Reference](/docs/reference/usage.md): HTML source structure, attributes, live properties, native events, slots, theming, and lifecycle hooks.
|
|
97
|
+
- [ToolHost](/docs/reference/toolhost.md): Structured user-input UI for confirmations, choices, forms, and templates.
|
|
94
98
|
|
|
95
99
|
### Releases
|
|
100
|
+
|
|
96
101
|
- [Changelog](/docs/releases/changelog.md): Release notes and notable changes for SlexKit.
|