@vpxa/aikit 0.1.2 → 0.1.4
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/package.json +1 -1
- package/packages/cli/dist/commands/init/constants.d.ts +3 -1
- package/packages/cli/dist/commands/init/constants.js +1 -1
- package/packages/cli/dist/commands/init/index.js +4 -4
- package/packages/cli/dist/commands/init/scaffold.d.ts +8 -1
- package/packages/cli/dist/commands/init/scaffold.js +1 -1
- package/packages/cli/dist/commands/init/user.js +4 -4
- package/packages/cli/dist/commands/upgrade.js +1 -1
- package/packages/core/dist/global-registry.js +1 -1
- package/packages/core/dist/types.d.ts +2 -0
- package/packages/flows/dist/git.js +1 -1
- package/packages/flows/dist/registry.d.ts +3 -3
- package/packages/flows/dist/registry.js +1 -1
- package/packages/flows/dist/symlinks.js +1 -1
- package/packages/indexer/dist/filesystem-crawler.js +1 -1
- package/packages/indexer/dist/hash-cache.js +1 -1
- package/packages/kb-client/dist/direct-client.d.ts +33 -34
- package/packages/kb-client/dist/index.d.ts +5 -4
- package/packages/kb-client/dist/mcp-client.d.ts +18 -18
- package/packages/kb-client/dist/parsers.d.ts +14 -11
- package/packages/kb-client/dist/types.d.ts +50 -47
- package/packages/present/dist/index.html +26 -26
- package/packages/server/dist/config.js +1 -1
- package/packages/server/dist/idle-timer.d.ts +4 -0
- package/packages/server/dist/idle-timer.js +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/memory-monitor.d.ts +2 -2
- package/packages/server/dist/memory-monitor.js +1 -1
- package/packages/server/dist/server.d.ts +1 -1
- package/packages/server/dist/server.js +2 -2
- package/packages/server/dist/tool-metadata.js +1 -1
- package/packages/server/dist/tools/config.tool.d.ts +8 -0
- package/packages/server/dist/tools/config.tool.js +12 -0
- package/packages/server/dist/tools/flow.tools.js +1 -1
- package/packages/server/dist/tools/present/browser.js +7 -7
- package/packages/server/dist/tools/present/tool.js +4 -4
- package/packages/server/dist/tools/search.tool.js +4 -4
- package/packages/server/dist/tools/status.tool.js +3 -3
- package/packages/store/dist/sqlite-graph-store.d.ts +3 -0
- package/packages/store/dist/sqlite-graph-store.js +3 -3
- package/packages/tools/dist/checkpoint.js +1 -1
- package/packages/tools/dist/evidence-map.js +2 -2
- package/packages/tools/dist/queue.js +1 -1
- package/packages/tools/dist/restore-points.js +1 -1
- package/packages/tools/dist/schema-validate.js +1 -1
- package/packages/tools/dist/snippet.js +1 -1
- package/packages/tools/dist/stash.js +1 -1
- package/packages/tools/dist/workset.js +1 -1
- package/packages/tui/dist/{App-B2-KJPt4.js → App-DpjN3iS-.js} +1 -1
- package/packages/tui/dist/App.js +1 -1
- package/packages/tui/dist/LogPanel-Db-SeZhR.js +3 -0
- package/packages/tui/dist/index.js +1 -1
- package/packages/tui/dist/panels/LogPanel.js +1 -1
- package/scaffold/general/skills/multi-agents-development/SKILL.md +435 -435
- package/scaffold/general/skills/present/SKILL.md +424 -424
- package/packages/kb-client/dist/__tests__/direct-client.test.d.ts +0 -1
- package/packages/kb-client/dist/__tests__/mcp-client.test.d.ts +0 -1
- package/packages/kb-client/dist/__tests__/parsers.test.d.ts +0 -1
- package/packages/tui/dist/LogPanel-E_1Do4-j.js +0 -3
|
@@ -1,424 +1,424 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: present
|
|
3
|
-
description: "Use the AI Kit `present` tool to display rich interactive dashboards, charts, timelines, status boards, and data visualizations in the browser or in-chat. Covers all block types, chart types, actions, composition patterns, and MCP Apps templates (list-sort, data-table, picker, flame-graph, form, timeline, kanban, tree, diff-view, dashboard). Load this skill before calling the present tool to ensure professional output."
|
|
4
|
-
argument-hint: "Content to present — data, analysis results, status report, comparison, or interactive MCP App"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Present Tool — Rich Interactive Dashboards
|
|
8
|
-
|
|
9
|
-
The `present` tool renders structured content as a professional dark-themed dashboard. It supports two output modes:
|
|
10
|
-
|
|
11
|
-
- **`html`** — Renders an embedded UIResource for MCP-UI hosts (in-chat). Best for display-only content.
|
|
12
|
-
- **`browser`** — Serves a themed dashboard on a local URL. Best when you need **user interaction** (buttons, selections, form input). The tool blocks until the user clicks an action, then returns their selection.
|
|
13
|
-
|
|
14
|
-
## Format Selection Rules (MUST FOLLOW)
|
|
15
|
-
|
|
16
|
-
| Situation | Format | Why |
|
|
17
|
-
|-----------|--------|-----|
|
|
18
|
-
| Display-only content (tables, charts, reports, status boards) | **`html`** | No interaction needed — render in-chat |
|
|
19
|
-
| Need user input back (confirmations, selections, form data) | **`browser`** | Browser supports blocking actions that return data |
|
|
20
|
-
| Rich visual dashboards without interaction | **`html`** | Prefer in-chat when no response is needed |
|
|
21
|
-
| User explicitly asks for browser | **`browser`** | Respect explicit preference |
|
|
22
|
-
|
|
23
|
-
**Rule: If no user interaction is needed, use `format: "html"`. If you need user interaction, use `format: "browser"`.**
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Browser Workflow (IMPORTANT — read carefully)
|
|
28
|
-
|
|
29
|
-
When using `format: "browser"`, the tool starts a local HTTP server and returns a URL. **You MUST open the URL** so the user can see and interact with the dashboard.
|
|
30
|
-
|
|
31
|
-
### Steps:
|
|
32
|
-
1. Call `present` with `format: "browser"` and `actions` — it returns text containing `🌐 **Dashboard opened in browser:** http://127.0.0.1:{port}`
|
|
33
|
-
2. **Extract the URL from the response**
|
|
34
|
-
3. **Call `openBrowserPage({ url: "http://127.0.0.1:{port}" })` to open it in VS Code's Simple Browser**
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
// Step 1: Call present
|
|
38
|
-
result = present({ format: "browser", title: "...", content: [...], actions: [...] })
|
|
39
|
-
|
|
40
|
-
// Step 2: MUST open in VS Code Simple Browser
|
|
41
|
-
openBrowserPage({ url: "http://127.0.0.1:{port}" })
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
> **Fallback**: The server also auto-opens the system browser as a safety net. But you should ALWAYS call `openBrowserPage` yourself so the user sees it inside VS Code.
|
|
45
|
-
|
|
46
|
-
**Note:** The HTTP server auto-closes after 5 minutes. Open the page promptly after receiving the URL.
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Content Architecture
|
|
51
|
-
|
|
52
|
-
Content is an array of **typed blocks**. Each block has `{ type, title?, value }`. All blocks compose into a single unified page — use multiple blocks for sections.
|
|
53
|
-
|
|
54
|
-
### Core Block Types
|
|
55
|
-
|
|
56
|
-
| Type | Value Shape | Renders As |
|
|
57
|
-
|------|------------|------------|
|
|
58
|
-
| `markdown` | `string` (markdown text) | Rendered HTML with full GFM support |
|
|
59
|
-
| `code` | `string` (source code) | Syntax-highlighted code block |
|
|
60
|
-
| `mermaid` | `string` (mermaid syntax) | Interactive diagram |
|
|
61
|
-
| `table` | `Array<Record<string, unknown>>` | Sortable/filterable table |
|
|
62
|
-
| `metrics` | `Array<{ label, value }>` | KPI metric cards grid |
|
|
63
|
-
| `cards` | `Array<{ title, body, badge? }>` | Card grid layout |
|
|
64
|
-
| `tree` | `Record<string, unknown>` | Expandable tree view |
|
|
65
|
-
| `graph` | `{ nodes: [], edges: [] }` | Mermaid graph diagram |
|
|
66
|
-
|
|
67
|
-
### Chart Block
|
|
68
|
-
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"type": "chart",
|
|
72
|
-
"title": "Revenue Trend",
|
|
73
|
-
"value": {
|
|
74
|
-
"chartType": "line",
|
|
75
|
-
"data": [{"month": "Jan", "revenue": 1200}, {"month": "Feb", "revenue": 1800}],
|
|
76
|
-
"xKey": "month",
|
|
77
|
-
"yKeys": ["revenue"],
|
|
78
|
-
"showLegend": true,
|
|
79
|
-
"showGrid": true,
|
|
80
|
-
"height": 300
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**Chart types:** `line`, `area`, `bar`, `horizontal-bar`, `pie`, `donut`, `sparkline`, `heatmap`
|
|
86
|
-
|
|
87
|
-
### New Block Types
|
|
88
|
-
|
|
89
|
-
| Type | Value Shape | Renders As |
|
|
90
|
-
|------|------------|------------|
|
|
91
|
-
| `timeline` | `{ items: [{ phase?, title, description?, status? }] }` | Vertical timeline with status dots (done/active/pending/error) |
|
|
92
|
-
| `checklist` | `{ items: [{ label, checked?, note? }] }` | Interactive checklist with checkmarks |
|
|
93
|
-
| `comparison` | `{ columns: [{ title, items: [string] }] }` | Side-by-side comparison grid |
|
|
94
|
-
| `status-board` | `{ items: [{ label, status, detail? }] }` | Status indicator rows (success/warning/error/info/pending) |
|
|
95
|
-
| `prompt` | `{ question, context?, placeholder? }` | Highlighted question/prompt block |
|
|
96
|
-
| `progress` | `{ items: [{ label, value, max? }] }` | Progress bars with percentages |
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Actions
|
|
101
|
-
|
|
102
|
-
Actions are interactive buttons/selects. In `browser` mode, they render as clickable elements and the tool blocks until the user clicks, returning the selection.
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"actions": [
|
|
107
|
-
{ "type": "button", "id": "approve", "label": "Approve", "variant": "primary" },
|
|
108
|
-
{ "type": "button", "id": "reject", "label": "Reject", "variant": "danger" },
|
|
109
|
-
{ "type": "select", "id": "priority", "label": "Priority", "options": ["Low", "Medium", "High"] }
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
**Variants:** `primary` (indigo), `danger` (red), `default` (neutral)
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Composition Pattern
|
|
119
|
-
|
|
120
|
-
Compose a full dashboard by combining multiple blocks in the `content` array:
|
|
121
|
-
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"format": "browser",
|
|
125
|
-
"title": "Sprint Review",
|
|
126
|
-
"content": [
|
|
127
|
-
{ "type": "metrics", "title": "Key Metrics", "value": [...] },
|
|
128
|
-
{ "type": "chart", "title": "Velocity", "value": { "chartType": "area", ... } },
|
|
129
|
-
{ "type": "timeline", "title": "Milestones", "value": { "items": [...] } },
|
|
130
|
-
{ "type": "status-board", "title": "Service Health", "value": { "items": [...] } },
|
|
131
|
-
{ "type": "table", "title": "Tasks", "value": [...] },
|
|
132
|
-
{ "type": "markdown", "value": "## Notes\n\nAdditional context..." }
|
|
133
|
-
],
|
|
134
|
-
"actions": [
|
|
135
|
-
{ "type": "button", "id": "next-sprint", "label": "Plan Next Sprint", "variant": "primary" }
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## Design System
|
|
143
|
-
|
|
144
|
-
The dashboard uses a professional dark theme:
|
|
145
|
-
- **Font:** Plus Jakarta Sans (body), JetBrains Mono (code)
|
|
146
|
-
- **Colors:** Deep navy background (`#182030`), indigo primary (`#818cf8`), no gradients
|
|
147
|
-
- **12 chart colors** for multi-series data
|
|
148
|
-
- **Status colors:** green (success), amber (warning), red (error), sky (info)
|
|
149
|
-
- Clean borders, subtle hover states, no visual noise
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## Best Practices
|
|
154
|
-
|
|
155
|
-
1. **Use `browser` format** for data-rich content — charts, tables, dashboards
|
|
156
|
-
2. **Combine block types** — metrics + charts + tables in one page
|
|
157
|
-
3. **Add titles** to every block for clear section headings
|
|
158
|
-
4. **Use actions** when you need user decisions — the tool returns the selection
|
|
159
|
-
5. **Keep markdown blocks** for narrative context between data sections
|
|
160
|
-
6. **Chart tips:**
|
|
161
|
-
- Use `area` for trends over time
|
|
162
|
-
- Use `bar` for comparisons between categories
|
|
163
|
-
- Use `donut` for proportions/distributions
|
|
164
|
-
- Use `sparkline` inline with metrics for mini trends
|
|
165
|
-
7. **Table auto-features:** Tables with 5+ rows get automatic search/filter. Columns are sortable by click.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## MCP Apps Templates (VS Code Chat Widgets)
|
|
170
|
-
|
|
171
|
-
When `chat.mcp.apps.enabled` is true in VS Code settings, the `present` tool can render **interactive widgets directly in the chat panel** using the `template` parameter. These are distinct from the browser/html dashboard modes.
|
|
172
|
-
|
|
173
|
-
**Key difference:** Templates use `template` + object `content` (not array of blocks). No `format` parameter needed. The widget renders inline in VS Code chat. User interactions (reorder, select, submit) are returned to the LLM as structured data.
|
|
174
|
-
|
|
175
|
-
### When to use MCP Apps vs Browser Dashboard
|
|
176
|
-
|
|
177
|
-
| Use Case | Mode | Why |
|
|
178
|
-
|----------|------|-----|
|
|
179
|
-
| Quick user input (pick items, reorder, fill form) | **MCP App template** | Inline in chat, no context switch |
|
|
180
|
-
| Rich multi-section dashboard with charts | **browser** | Full page layout with all block types |
|
|
181
|
-
| Simple confirmation or selection | **Actions** (browser/html) | Buttons/selects in dashboard |
|
|
182
|
-
|
|
183
|
-
### Template: `list-sort`
|
|
184
|
-
|
|
185
|
-
Drag-and-drop reorderable list. Use for priority ordering, task sequencing, or ranked preferences.
|
|
186
|
-
|
|
187
|
-
```json
|
|
188
|
-
{
|
|
189
|
-
"template": "list-sort",
|
|
190
|
-
"title": "Priority Order",
|
|
191
|
-
"content": {
|
|
192
|
-
"items": [
|
|
193
|
-
{ "id": "task-1", "label": "Fix authentication bug" },
|
|
194
|
-
{ "id": "task-2", "label": "Add search feature" },
|
|
195
|
-
{ "id": "task-3", "label": "Update documentation" }
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
**Content schema:** `{ items: Array<{ id: string, label: string }> }`
|
|
202
|
-
**Returns:** Reordered array of items after user drags to reorder and submits.
|
|
203
|
-
|
|
204
|
-
### Template: `data-table`
|
|
205
|
-
|
|
206
|
-
Filterable, sortable table with optional summary stat cards. Use for structured data review, change summaries, or audit results.
|
|
207
|
-
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"template": "data-table",
|
|
211
|
-
"title": "File Changes",
|
|
212
|
-
"content": {
|
|
213
|
-
"columns": [
|
|
214
|
-
{ "key": "file", "label": "File" },
|
|
215
|
-
{ "key": "change", "label": "Change" },
|
|
216
|
-
{ "key": "lines", "label": "Lines" }
|
|
217
|
-
],
|
|
218
|
-
"rows": [
|
|
219
|
-
{ "file": "auth.ts", "change": "Added guard", "lines": 5 },
|
|
220
|
-
{ "file": "cache.ts", "change": "Fixed bug", "lines": 12 }
|
|
221
|
-
],
|
|
222
|
-
"stats": [
|
|
223
|
-
{ "label": "Files Changed", "value": "2" },
|
|
224
|
-
{ "label": "Total Lines", "value": "17" }
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
**Content schema:** `{ columns: Array<{ key: string, label: string }>, rows: Array<Record<string, unknown>>, stats?: Array<{ label: string, value: string }> }`
|
|
231
|
-
**Returns:** Selected row(s) data when user interacts and submits.
|
|
232
|
-
|
|
233
|
-
### Template: `picker`
|
|
234
|
-
|
|
235
|
-
Multi-select with categories and tag-based search. Use for component selection, feature toggles, or module picking.
|
|
236
|
-
|
|
237
|
-
```json
|
|
238
|
-
{
|
|
239
|
-
"template": "picker",
|
|
240
|
-
"title": "Select Modules",
|
|
241
|
-
"content": {
|
|
242
|
-
"categories": [
|
|
243
|
-
{ "id": "core", "label": "Core" },
|
|
244
|
-
{ "id": "plugins", "label": "Plugins" }
|
|
245
|
-
],
|
|
246
|
-
"items": [
|
|
247
|
-
{ "id": "auth", "label": "Authentication", "category": "core", "tags": ["security"] },
|
|
248
|
-
{ "id": "cache", "label": "Cache Layer", "category": "core", "tags": ["performance"] },
|
|
249
|
-
{ "id": "sentry", "label": "Sentry Plugin", "category": "plugins", "tags": ["monitoring"] }
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**Content schema:** `{ categories: Array<{ id: string, label: string }>, items: Array<{ id: string, label: string, category: string, tags?: string[] }> }`
|
|
256
|
-
**Returns:** Array of selected item IDs after user checks items and submits.
|
|
257
|
-
|
|
258
|
-
### Template: `flame-graph`
|
|
259
|
-
|
|
260
|
-
Hierarchical zoomable visualization. Use for codebase structure, performance profiles, dependency trees, or budget breakdowns.
|
|
261
|
-
|
|
262
|
-
```json
|
|
263
|
-
{
|
|
264
|
-
"template": "flame-graph",
|
|
265
|
-
"title": "Module Hierarchy",
|
|
266
|
-
"content": {
|
|
267
|
-
"profile": {
|
|
268
|
-
"name": "root",
|
|
269
|
-
"total": 100,
|
|
270
|
-
"children": [
|
|
271
|
-
{
|
|
272
|
-
"name": "packages/tools",
|
|
273
|
-
"total": 60,
|
|
274
|
-
"children": [
|
|
275
|
-
{ "name": "search.ts", "total": 35 },
|
|
276
|
-
{ "name": "compact.ts", "total": 25 }
|
|
277
|
-
]
|
|
278
|
-
},
|
|
279
|
-
{ "name": "packages/server", "total": 40 }
|
|
280
|
-
]
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
**Content schema:** `{ profile: { name: string, total: number, children?: Array<(recursive)> } }`
|
|
287
|
-
**Returns:** Clicked node information when user interacts.
|
|
288
|
-
|
|
289
|
-
### Template: `form`
|
|
290
|
-
|
|
291
|
-
Input fields with text inputs, selects, and checkboxes. Use for configuration, parameter collection, or setup wizards.
|
|
292
|
-
|
|
293
|
-
```json
|
|
294
|
-
{
|
|
295
|
-
"template": "form",
|
|
296
|
-
"title": "Project Configuration",
|
|
297
|
-
"content": {
|
|
298
|
-
"fields": [
|
|
299
|
-
{ "name": "projectName", "label": "Project Name", "type": "text", "value": "my-app" },
|
|
300
|
-
{ "name": "framework", "label": "Framework", "type": "select", "options": ["React", "Vue", "Svelte"], "value": "React" },
|
|
301
|
-
{ "name": "typescript", "label": "Use TypeScript", "type": "checkbox", "value": true },
|
|
302
|
-
{ "name": "description", "label": "Description", "type": "text", "value": "" }
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
**Content schema:** `{ fields: Array<{ name: string, label: string, type: "text" | "select" | "checkbox", value?: string | boolean, options?: string[] }> }`
|
|
309
|
-
**Returns:** Object with field name-value pairs after user fills out and submits.
|
|
310
|
-
|
|
311
|
-
### MCP Apps Best Practices
|
|
312
|
-
|
|
313
|
-
1. **Use meaningful `id` values** — they are returned in responses and used for programmatic handling.
|
|
314
|
-
2. **Keep list-sort items under 15** — longer lists become unwieldy for drag-and-drop.
|
|
315
|
-
3. **Always provide `value` defaults** in forms — pre-fill with sensible defaults to reduce user effort.
|
|
316
|
-
4. **Use `tags` in picker** — they power the search/filter functionality.
|
|
317
|
-
5. **Flame-graph `total` values** should be consistent — parent total should equal sum of children.
|
|
318
|
-
6. **Data-table `stats`** are optional — use them for KPI summary cards above the table.
|
|
319
|
-
7. **Combine with LLM logic** — use returned values to drive next steps (e.g., form → generate config, picker → scope analysis).
|
|
320
|
-
|
|
321
|
-
#### 6. `timeline` — Vertical Event Timeline (display only)
|
|
322
|
-
|
|
323
|
-
```json
|
|
324
|
-
{
|
|
325
|
-
"events": [
|
|
326
|
-
{"title": "v1.0 Release", "description": "Initial release with core features", "timestamp": "2025-01", "status": "complete"},
|
|
327
|
-
{"title": "v2.0 Beta", "description": "MCP Apps support", "timestamp": "2025-07", "status": "active"},
|
|
328
|
-
{"title": "v3.0 Planning", "status": "pending"}
|
|
329
|
-
]
|
|
330
|
-
}
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
Fields: `title` (required), `description?`, `timestamp?`, `status?` (`'complete'|'active'|'pending'|'error'`), `icon?`, `category?`
|
|
334
|
-
|
|
335
|
-
#### 7. `kanban` — Drag-Drop Board (interactive — emits on card move)
|
|
336
|
-
|
|
337
|
-
```json
|
|
338
|
-
{
|
|
339
|
-
"columns": [
|
|
340
|
-
{"id": "todo", "label": "To Do"},
|
|
341
|
-
{"id": "in-progress", "label": "In Progress", "color": "#3b82f6"},
|
|
342
|
-
{"id": "done", "label": "Done", "color": "#22c55e"}
|
|
343
|
-
],
|
|
344
|
-
"cards": [
|
|
345
|
-
{"id": "c1", "title": "Fix auth bug", "column": "todo", "tags": ["bugfix"], "priority": "high"},
|
|
346
|
-
{"id": "c2", "title": "Add search", "column": "in-progress", "tags": ["feature"], "priority": "medium"}
|
|
347
|
-
]
|
|
348
|
-
}
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
Returns `{cardId, fromColumn, toColumn}` when a card is dragged between columns.
|
|
352
|
-
|
|
353
|
-
#### 8. `tree` — Collapsible Tree View (display only)
|
|
354
|
-
|
|
355
|
-
```json
|
|
356
|
-
{
|
|
357
|
-
"root": {
|
|
358
|
-
"label": "packages/",
|
|
359
|
-
"children": [
|
|
360
|
-
{"label": "server/", "children": [{"label": "index.ts"}, {"label": "tools/", "children": [{"label": "present.ts"}]}]},
|
|
361
|
-
{"label": "present/", "children": [{"label": "present-app.ts"}]}
|
|
362
|
-
]
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
Fields: `label` (required), `id?`, `icon?`, `children?: TreeNode[]`, `metadata?: Record<string,string>`. Accepts `root` as single node or array of nodes.
|
|
368
|
-
|
|
369
|
-
#### 9. `diff-view` — Side-by-Side Code Diff (display only)
|
|
370
|
-
|
|
371
|
-
```json
|
|
372
|
-
{
|
|
373
|
-
"files": [{
|
|
374
|
-
"path": "auth.ts",
|
|
375
|
-
"status": "modified",
|
|
376
|
-
"additions": 12,
|
|
377
|
-
"deletions": 3,
|
|
378
|
-
"hunks": [{
|
|
379
|
-
"header": "@@ -10,5 +10,14 @@",
|
|
380
|
-
"changes": [
|
|
381
|
-
{"type": "context", "content": "const auth = {};"},
|
|
382
|
-
{"type": "delete", "content": "// old validation"},
|
|
383
|
-
{"type": "add", "content": "// new JWT validation"},
|
|
384
|
-
{"type": "add", "content": "const token = verify(jwt);"}
|
|
385
|
-
]
|
|
386
|
-
}]
|
|
387
|
-
}],
|
|
388
|
-
"stats": {"additions": 12, "deletions": 3, "filesChanged": 1}
|
|
389
|
-
}
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
Status values: `'added'|'modified'|'deleted'|'renamed'`. Change types: `'add'|'delete'|'context'`.
|
|
393
|
-
|
|
394
|
-
#### 10. `dashboard` — Metric Cards Grid (display only)
|
|
395
|
-
|
|
396
|
-
```json
|
|
397
|
-
{
|
|
398
|
-
"metrics": [
|
|
399
|
-
{"label": "Uptime", "value": "99.9%", "status": "success", "trend": {"value": "+0.1%", "direction": "up"}},
|
|
400
|
-
{"label": "Build Time", "value": "4.2s", "type": "progress", "progress": 42, "status": "warning"},
|
|
401
|
-
{"label": "Top Endpoints", "type": "list", "value": "3", "items": [
|
|
402
|
-
{"label": "/api/search", "value": "1.2k/day"},
|
|
403
|
-
{"label": "/api/present", "value": "890/day"}
|
|
404
|
-
]}
|
|
405
|
-
]
|
|
406
|
-
}
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
Metric types: `'stat'` (default), `'progress'` (with bar), `'list'` (sub-items). Status: `'success'|'warning'|'error'|'info'`.
|
|
410
|
-
|
|
411
|
-
### Interaction Summary (All 10 Templates)
|
|
412
|
-
|
|
413
|
-
| Template | Trigger | Data Returned to LLM |
|
|
414
|
-
|----------|---------|---------------------|
|
|
415
|
-
| list-sort | Auto on drag-drop | Reordered ID array |
|
|
416
|
-
| data-table | Export button | Current filtered rows |
|
|
417
|
-
| picker | Apply Selection button | Selected ID array |
|
|
418
|
-
| flame-graph | Auto on node click | Clicked node object |
|
|
419
|
-
| form | Submit button | Field values object |
|
|
420
|
-
| kanban | Auto on card drag | `{cardId, fromColumn, toColumn}` |
|
|
421
|
-
| timeline | Display only | — |
|
|
422
|
-
| tree | Display only | — |
|
|
423
|
-
| diff-view | Display only | — |
|
|
424
|
-
| dashboard | Display only | — |
|
|
1
|
+
---
|
|
2
|
+
name: present
|
|
3
|
+
description: "Use the AI Kit `present` tool to display rich interactive dashboards, charts, timelines, status boards, and data visualizations in the browser or in-chat. Covers all block types, chart types, actions, composition patterns, and MCP Apps templates (list-sort, data-table, picker, flame-graph, form, timeline, kanban, tree, diff-view, dashboard). Load this skill before calling the present tool to ensure professional output."
|
|
4
|
+
argument-hint: "Content to present — data, analysis results, status report, comparison, or interactive MCP App"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Present Tool — Rich Interactive Dashboards
|
|
8
|
+
|
|
9
|
+
The `present` tool renders structured content as a professional dark-themed dashboard. It supports two output modes:
|
|
10
|
+
|
|
11
|
+
- **`html`** — Renders an embedded UIResource for MCP-UI hosts (in-chat). Best for display-only content.
|
|
12
|
+
- **`browser`** — Serves a themed dashboard on a local URL. Best when you need **user interaction** (buttons, selections, form input). The tool blocks until the user clicks an action, then returns their selection.
|
|
13
|
+
|
|
14
|
+
## Format Selection Rules (MUST FOLLOW)
|
|
15
|
+
|
|
16
|
+
| Situation | Format | Why |
|
|
17
|
+
|-----------|--------|-----|
|
|
18
|
+
| Display-only content (tables, charts, reports, status boards) | **`html`** | No interaction needed — render in-chat |
|
|
19
|
+
| Need user input back (confirmations, selections, form data) | **`browser`** | Browser supports blocking actions that return data |
|
|
20
|
+
| Rich visual dashboards without interaction | **`html`** | Prefer in-chat when no response is needed |
|
|
21
|
+
| User explicitly asks for browser | **`browser`** | Respect explicit preference |
|
|
22
|
+
|
|
23
|
+
**Rule: If no user interaction is needed, use `format: "html"`. If you need user interaction, use `format: "browser"`.**
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Browser Workflow (IMPORTANT — read carefully)
|
|
28
|
+
|
|
29
|
+
When using `format: "browser"`, the tool starts a local HTTP server and returns a URL. **You MUST open the URL** so the user can see and interact with the dashboard.
|
|
30
|
+
|
|
31
|
+
### Steps:
|
|
32
|
+
1. Call `present` with `format: "browser"` and `actions` — it returns text containing `🌐 **Dashboard opened in browser:** http://127.0.0.1:{port}`
|
|
33
|
+
2. **Extract the URL from the response**
|
|
34
|
+
3. **Call `openBrowserPage({ url: "http://127.0.0.1:{port}" })` to open it in VS Code's Simple Browser**
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
// Step 1: Call present
|
|
38
|
+
result = present({ format: "browser", title: "...", content: [...], actions: [...] })
|
|
39
|
+
|
|
40
|
+
// Step 2: MUST open in VS Code Simple Browser
|
|
41
|
+
openBrowserPage({ url: "http://127.0.0.1:{port}" })
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Fallback**: The server also auto-opens the system browser as a safety net. But you should ALWAYS call `openBrowserPage` yourself so the user sees it inside VS Code.
|
|
45
|
+
|
|
46
|
+
**Note:** The HTTP server auto-closes after 5 minutes. Open the page promptly after receiving the URL.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Content Architecture
|
|
51
|
+
|
|
52
|
+
Content is an array of **typed blocks**. Each block has `{ type, title?, value }`. All blocks compose into a single unified page — use multiple blocks for sections.
|
|
53
|
+
|
|
54
|
+
### Core Block Types
|
|
55
|
+
|
|
56
|
+
| Type | Value Shape | Renders As |
|
|
57
|
+
|------|------------|------------|
|
|
58
|
+
| `markdown` | `string` (markdown text) | Rendered HTML with full GFM support |
|
|
59
|
+
| `code` | `string` (source code) | Syntax-highlighted code block |
|
|
60
|
+
| `mermaid` | `string` (mermaid syntax) | Interactive diagram |
|
|
61
|
+
| `table` | `Array<Record<string, unknown>>` | Sortable/filterable table |
|
|
62
|
+
| `metrics` | `Array<{ label, value }>` | KPI metric cards grid |
|
|
63
|
+
| `cards` | `Array<{ title, body, badge? }>` | Card grid layout |
|
|
64
|
+
| `tree` | `Record<string, unknown>` | Expandable tree view |
|
|
65
|
+
| `graph` | `{ nodes: [], edges: [] }` | Mermaid graph diagram |
|
|
66
|
+
|
|
67
|
+
### Chart Block
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"type": "chart",
|
|
72
|
+
"title": "Revenue Trend",
|
|
73
|
+
"value": {
|
|
74
|
+
"chartType": "line",
|
|
75
|
+
"data": [{"month": "Jan", "revenue": 1200}, {"month": "Feb", "revenue": 1800}],
|
|
76
|
+
"xKey": "month",
|
|
77
|
+
"yKeys": ["revenue"],
|
|
78
|
+
"showLegend": true,
|
|
79
|
+
"showGrid": true,
|
|
80
|
+
"height": 300
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Chart types:** `line`, `area`, `bar`, `horizontal-bar`, `pie`, `donut`, `sparkline`, `heatmap`
|
|
86
|
+
|
|
87
|
+
### New Block Types
|
|
88
|
+
|
|
89
|
+
| Type | Value Shape | Renders As |
|
|
90
|
+
|------|------------|------------|
|
|
91
|
+
| `timeline` | `{ items: [{ phase?, title, description?, status? }] }` | Vertical timeline with status dots (done/active/pending/error) |
|
|
92
|
+
| `checklist` | `{ items: [{ label, checked?, note? }] }` | Interactive checklist with checkmarks |
|
|
93
|
+
| `comparison` | `{ columns: [{ title, items: [string] }] }` | Side-by-side comparison grid |
|
|
94
|
+
| `status-board` | `{ items: [{ label, status, detail? }] }` | Status indicator rows (success/warning/error/info/pending) |
|
|
95
|
+
| `prompt` | `{ question, context?, placeholder? }` | Highlighted question/prompt block |
|
|
96
|
+
| `progress` | `{ items: [{ label, value, max? }] }` | Progress bars with percentages |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Actions
|
|
101
|
+
|
|
102
|
+
Actions are interactive buttons/selects. In `browser` mode, they render as clickable elements and the tool blocks until the user clicks, returning the selection.
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"actions": [
|
|
107
|
+
{ "type": "button", "id": "approve", "label": "Approve", "variant": "primary" },
|
|
108
|
+
{ "type": "button", "id": "reject", "label": "Reject", "variant": "danger" },
|
|
109
|
+
{ "type": "select", "id": "priority", "label": "Priority", "options": ["Low", "Medium", "High"] }
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Variants:** `primary` (indigo), `danger` (red), `default` (neutral)
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Composition Pattern
|
|
119
|
+
|
|
120
|
+
Compose a full dashboard by combining multiple blocks in the `content` array:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"format": "browser",
|
|
125
|
+
"title": "Sprint Review",
|
|
126
|
+
"content": [
|
|
127
|
+
{ "type": "metrics", "title": "Key Metrics", "value": [...] },
|
|
128
|
+
{ "type": "chart", "title": "Velocity", "value": { "chartType": "area", ... } },
|
|
129
|
+
{ "type": "timeline", "title": "Milestones", "value": { "items": [...] } },
|
|
130
|
+
{ "type": "status-board", "title": "Service Health", "value": { "items": [...] } },
|
|
131
|
+
{ "type": "table", "title": "Tasks", "value": [...] },
|
|
132
|
+
{ "type": "markdown", "value": "## Notes\n\nAdditional context..." }
|
|
133
|
+
],
|
|
134
|
+
"actions": [
|
|
135
|
+
{ "type": "button", "id": "next-sprint", "label": "Plan Next Sprint", "variant": "primary" }
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Design System
|
|
143
|
+
|
|
144
|
+
The dashboard uses a professional dark theme:
|
|
145
|
+
- **Font:** Plus Jakarta Sans (body), JetBrains Mono (code)
|
|
146
|
+
- **Colors:** Deep navy background (`#182030`), indigo primary (`#818cf8`), no gradients
|
|
147
|
+
- **12 chart colors** for multi-series data
|
|
148
|
+
- **Status colors:** green (success), amber (warning), red (error), sky (info)
|
|
149
|
+
- Clean borders, subtle hover states, no visual noise
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Best Practices
|
|
154
|
+
|
|
155
|
+
1. **Use `browser` format** for data-rich content — charts, tables, dashboards
|
|
156
|
+
2. **Combine block types** — metrics + charts + tables in one page
|
|
157
|
+
3. **Add titles** to every block for clear section headings
|
|
158
|
+
4. **Use actions** when you need user decisions — the tool returns the selection
|
|
159
|
+
5. **Keep markdown blocks** for narrative context between data sections
|
|
160
|
+
6. **Chart tips:**
|
|
161
|
+
- Use `area` for trends over time
|
|
162
|
+
- Use `bar` for comparisons between categories
|
|
163
|
+
- Use `donut` for proportions/distributions
|
|
164
|
+
- Use `sparkline` inline with metrics for mini trends
|
|
165
|
+
7. **Table auto-features:** Tables with 5+ rows get automatic search/filter. Columns are sortable by click.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## MCP Apps Templates (VS Code Chat Widgets)
|
|
170
|
+
|
|
171
|
+
When `chat.mcp.apps.enabled` is true in VS Code settings, the `present` tool can render **interactive widgets directly in the chat panel** using the `template` parameter. These are distinct from the browser/html dashboard modes.
|
|
172
|
+
|
|
173
|
+
**Key difference:** Templates use `template` + object `content` (not array of blocks). No `format` parameter needed. The widget renders inline in VS Code chat. User interactions (reorder, select, submit) are returned to the LLM as structured data.
|
|
174
|
+
|
|
175
|
+
### When to use MCP Apps vs Browser Dashboard
|
|
176
|
+
|
|
177
|
+
| Use Case | Mode | Why |
|
|
178
|
+
|----------|------|-----|
|
|
179
|
+
| Quick user input (pick items, reorder, fill form) | **MCP App template** | Inline in chat, no context switch |
|
|
180
|
+
| Rich multi-section dashboard with charts | **browser** | Full page layout with all block types |
|
|
181
|
+
| Simple confirmation or selection | **Actions** (browser/html) | Buttons/selects in dashboard |
|
|
182
|
+
|
|
183
|
+
### Template: `list-sort`
|
|
184
|
+
|
|
185
|
+
Drag-and-drop reorderable list. Use for priority ordering, task sequencing, or ranked preferences.
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"template": "list-sort",
|
|
190
|
+
"title": "Priority Order",
|
|
191
|
+
"content": {
|
|
192
|
+
"items": [
|
|
193
|
+
{ "id": "task-1", "label": "Fix authentication bug" },
|
|
194
|
+
{ "id": "task-2", "label": "Add search feature" },
|
|
195
|
+
{ "id": "task-3", "label": "Update documentation" }
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Content schema:** `{ items: Array<{ id: string, label: string }> }`
|
|
202
|
+
**Returns:** Reordered array of items after user drags to reorder and submits.
|
|
203
|
+
|
|
204
|
+
### Template: `data-table`
|
|
205
|
+
|
|
206
|
+
Filterable, sortable table with optional summary stat cards. Use for structured data review, change summaries, or audit results.
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"template": "data-table",
|
|
211
|
+
"title": "File Changes",
|
|
212
|
+
"content": {
|
|
213
|
+
"columns": [
|
|
214
|
+
{ "key": "file", "label": "File" },
|
|
215
|
+
{ "key": "change", "label": "Change" },
|
|
216
|
+
{ "key": "lines", "label": "Lines" }
|
|
217
|
+
],
|
|
218
|
+
"rows": [
|
|
219
|
+
{ "file": "auth.ts", "change": "Added guard", "lines": 5 },
|
|
220
|
+
{ "file": "cache.ts", "change": "Fixed bug", "lines": 12 }
|
|
221
|
+
],
|
|
222
|
+
"stats": [
|
|
223
|
+
{ "label": "Files Changed", "value": "2" },
|
|
224
|
+
{ "label": "Total Lines", "value": "17" }
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Content schema:** `{ columns: Array<{ key: string, label: string }>, rows: Array<Record<string, unknown>>, stats?: Array<{ label: string, value: string }> }`
|
|
231
|
+
**Returns:** Selected row(s) data when user interacts and submits.
|
|
232
|
+
|
|
233
|
+
### Template: `picker`
|
|
234
|
+
|
|
235
|
+
Multi-select with categories and tag-based search. Use for component selection, feature toggles, or module picking.
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"template": "picker",
|
|
240
|
+
"title": "Select Modules",
|
|
241
|
+
"content": {
|
|
242
|
+
"categories": [
|
|
243
|
+
{ "id": "core", "label": "Core" },
|
|
244
|
+
{ "id": "plugins", "label": "Plugins" }
|
|
245
|
+
],
|
|
246
|
+
"items": [
|
|
247
|
+
{ "id": "auth", "label": "Authentication", "category": "core", "tags": ["security"] },
|
|
248
|
+
{ "id": "cache", "label": "Cache Layer", "category": "core", "tags": ["performance"] },
|
|
249
|
+
{ "id": "sentry", "label": "Sentry Plugin", "category": "plugins", "tags": ["monitoring"] }
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Content schema:** `{ categories: Array<{ id: string, label: string }>, items: Array<{ id: string, label: string, category: string, tags?: string[] }> }`
|
|
256
|
+
**Returns:** Array of selected item IDs after user checks items and submits.
|
|
257
|
+
|
|
258
|
+
### Template: `flame-graph`
|
|
259
|
+
|
|
260
|
+
Hierarchical zoomable visualization. Use for codebase structure, performance profiles, dependency trees, or budget breakdowns.
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"template": "flame-graph",
|
|
265
|
+
"title": "Module Hierarchy",
|
|
266
|
+
"content": {
|
|
267
|
+
"profile": {
|
|
268
|
+
"name": "root",
|
|
269
|
+
"total": 100,
|
|
270
|
+
"children": [
|
|
271
|
+
{
|
|
272
|
+
"name": "packages/tools",
|
|
273
|
+
"total": 60,
|
|
274
|
+
"children": [
|
|
275
|
+
{ "name": "search.ts", "total": 35 },
|
|
276
|
+
{ "name": "compact.ts", "total": 25 }
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{ "name": "packages/server", "total": 40 }
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Content schema:** `{ profile: { name: string, total: number, children?: Array<(recursive)> } }`
|
|
287
|
+
**Returns:** Clicked node information when user interacts.
|
|
288
|
+
|
|
289
|
+
### Template: `form`
|
|
290
|
+
|
|
291
|
+
Input fields with text inputs, selects, and checkboxes. Use for configuration, parameter collection, or setup wizards.
|
|
292
|
+
|
|
293
|
+
```json
|
|
294
|
+
{
|
|
295
|
+
"template": "form",
|
|
296
|
+
"title": "Project Configuration",
|
|
297
|
+
"content": {
|
|
298
|
+
"fields": [
|
|
299
|
+
{ "name": "projectName", "label": "Project Name", "type": "text", "value": "my-app" },
|
|
300
|
+
{ "name": "framework", "label": "Framework", "type": "select", "options": ["React", "Vue", "Svelte"], "value": "React" },
|
|
301
|
+
{ "name": "typescript", "label": "Use TypeScript", "type": "checkbox", "value": true },
|
|
302
|
+
{ "name": "description", "label": "Description", "type": "text", "value": "" }
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Content schema:** `{ fields: Array<{ name: string, label: string, type: "text" | "select" | "checkbox", value?: string | boolean, options?: string[] }> }`
|
|
309
|
+
**Returns:** Object with field name-value pairs after user fills out and submits.
|
|
310
|
+
|
|
311
|
+
### MCP Apps Best Practices
|
|
312
|
+
|
|
313
|
+
1. **Use meaningful `id` values** — they are returned in responses and used for programmatic handling.
|
|
314
|
+
2. **Keep list-sort items under 15** — longer lists become unwieldy for drag-and-drop.
|
|
315
|
+
3. **Always provide `value` defaults** in forms — pre-fill with sensible defaults to reduce user effort.
|
|
316
|
+
4. **Use `tags` in picker** — they power the search/filter functionality.
|
|
317
|
+
5. **Flame-graph `total` values** should be consistent — parent total should equal sum of children.
|
|
318
|
+
6. **Data-table `stats`** are optional — use them for KPI summary cards above the table.
|
|
319
|
+
7. **Combine with LLM logic** — use returned values to drive next steps (e.g., form → generate config, picker → scope analysis).
|
|
320
|
+
|
|
321
|
+
#### 6. `timeline` — Vertical Event Timeline (display only)
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"events": [
|
|
326
|
+
{"title": "v1.0 Release", "description": "Initial release with core features", "timestamp": "2025-01", "status": "complete"},
|
|
327
|
+
{"title": "v2.0 Beta", "description": "MCP Apps support", "timestamp": "2025-07", "status": "active"},
|
|
328
|
+
{"title": "v3.0 Planning", "status": "pending"}
|
|
329
|
+
]
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Fields: `title` (required), `description?`, `timestamp?`, `status?` (`'complete'|'active'|'pending'|'error'`), `icon?`, `category?`
|
|
334
|
+
|
|
335
|
+
#### 7. `kanban` — Drag-Drop Board (interactive — emits on card move)
|
|
336
|
+
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"columns": [
|
|
340
|
+
{"id": "todo", "label": "To Do"},
|
|
341
|
+
{"id": "in-progress", "label": "In Progress", "color": "#3b82f6"},
|
|
342
|
+
{"id": "done", "label": "Done", "color": "#22c55e"}
|
|
343
|
+
],
|
|
344
|
+
"cards": [
|
|
345
|
+
{"id": "c1", "title": "Fix auth bug", "column": "todo", "tags": ["bugfix"], "priority": "high"},
|
|
346
|
+
{"id": "c2", "title": "Add search", "column": "in-progress", "tags": ["feature"], "priority": "medium"}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Returns `{cardId, fromColumn, toColumn}` when a card is dragged between columns.
|
|
352
|
+
|
|
353
|
+
#### 8. `tree` — Collapsible Tree View (display only)
|
|
354
|
+
|
|
355
|
+
```json
|
|
356
|
+
{
|
|
357
|
+
"root": {
|
|
358
|
+
"label": "packages/",
|
|
359
|
+
"children": [
|
|
360
|
+
{"label": "server/", "children": [{"label": "index.ts"}, {"label": "tools/", "children": [{"label": "present.ts"}]}]},
|
|
361
|
+
{"label": "present/", "children": [{"label": "present-app.ts"}]}
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Fields: `label` (required), `id?`, `icon?`, `children?: TreeNode[]`, `metadata?: Record<string,string>`. Accepts `root` as single node or array of nodes.
|
|
368
|
+
|
|
369
|
+
#### 9. `diff-view` — Side-by-Side Code Diff (display only)
|
|
370
|
+
|
|
371
|
+
```json
|
|
372
|
+
{
|
|
373
|
+
"files": [{
|
|
374
|
+
"path": "auth.ts",
|
|
375
|
+
"status": "modified",
|
|
376
|
+
"additions": 12,
|
|
377
|
+
"deletions": 3,
|
|
378
|
+
"hunks": [{
|
|
379
|
+
"header": "@@ -10,5 +10,14 @@",
|
|
380
|
+
"changes": [
|
|
381
|
+
{"type": "context", "content": "const auth = {};"},
|
|
382
|
+
{"type": "delete", "content": "// old validation"},
|
|
383
|
+
{"type": "add", "content": "// new JWT validation"},
|
|
384
|
+
{"type": "add", "content": "const token = verify(jwt);"}
|
|
385
|
+
]
|
|
386
|
+
}]
|
|
387
|
+
}],
|
|
388
|
+
"stats": {"additions": 12, "deletions": 3, "filesChanged": 1}
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Status values: `'added'|'modified'|'deleted'|'renamed'`. Change types: `'add'|'delete'|'context'`.
|
|
393
|
+
|
|
394
|
+
#### 10. `dashboard` — Metric Cards Grid (display only)
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
{
|
|
398
|
+
"metrics": [
|
|
399
|
+
{"label": "Uptime", "value": "99.9%", "status": "success", "trend": {"value": "+0.1%", "direction": "up"}},
|
|
400
|
+
{"label": "Build Time", "value": "4.2s", "type": "progress", "progress": 42, "status": "warning"},
|
|
401
|
+
{"label": "Top Endpoints", "type": "list", "value": "3", "items": [
|
|
402
|
+
{"label": "/api/search", "value": "1.2k/day"},
|
|
403
|
+
{"label": "/api/present", "value": "890/day"}
|
|
404
|
+
]}
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Metric types: `'stat'` (default), `'progress'` (with bar), `'list'` (sub-items). Status: `'success'|'warning'|'error'|'info'`.
|
|
410
|
+
|
|
411
|
+
### Interaction Summary (All 10 Templates)
|
|
412
|
+
|
|
413
|
+
| Template | Trigger | Data Returned to LLM |
|
|
414
|
+
|----------|---------|---------------------|
|
|
415
|
+
| list-sort | Auto on drag-drop | Reordered ID array |
|
|
416
|
+
| data-table | Export button | Current filtered rows |
|
|
417
|
+
| picker | Apply Selection button | Selected ID array |
|
|
418
|
+
| flame-graph | Auto on node click | Clicked node object |
|
|
419
|
+
| form | Submit button | Field values object |
|
|
420
|
+
| kanban | Auto on card drag | `{cardId, fromColumn, toColumn}` |
|
|
421
|
+
| timeline | Display only | — |
|
|
422
|
+
| tree | Display only | — |
|
|
423
|
+
| diff-view | Display only | — |
|
|
424
|
+
| dashboard | Display only | — |
|