@vpxa/aikit 0.1.1 → 0.1.3

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.
Files changed (150) hide show
  1. package/README.md +8 -8
  2. package/package.json +1 -1
  3. package/packages/aikit-client/dist/types.d.ts +3 -3
  4. package/packages/cli/dist/aikit-init.d.ts +1 -1
  5. package/packages/cli/dist/aikit-init.js +1 -1
  6. package/packages/cli/dist/commands/context-cmds.js +1 -1
  7. package/packages/cli/dist/commands/environment.js +1 -1
  8. package/packages/cli/dist/commands/init/config.d.ts +1 -1
  9. package/packages/cli/dist/commands/init/config.js +2 -2
  10. package/packages/cli/dist/commands/init/constants.d.ts +3 -3
  11. package/packages/cli/dist/commands/init/index.d.ts +4 -4
  12. package/packages/cli/dist/commands/init/index.js +4 -4
  13. package/packages/cli/dist/commands/init/templates.js +12 -12
  14. package/packages/cli/dist/commands/init/user.d.ts +3 -3
  15. package/packages/cli/dist/commands/init/user.js +2 -2
  16. package/packages/cli/dist/commands/search.js +1 -1
  17. package/packages/cli/dist/commands/system.js +4 -4
  18. package/packages/cli/dist/commands/upgrade.js +1 -1
  19. package/packages/cli/dist/commands/workspace.js +1 -1
  20. package/packages/cli/dist/helpers.js +1 -1
  21. package/packages/cli/dist/index.d.ts +1 -1
  22. package/packages/core/dist/constants.d.ts +3 -3
  23. package/packages/core/dist/global-registry.d.ts +7 -1
  24. package/packages/core/dist/global-registry.js +1 -1
  25. package/packages/core/dist/index.d.ts +2 -2
  26. package/packages/core/dist/index.js +1 -1
  27. package/packages/core/dist/types.d.ts +6 -2
  28. package/packages/dashboard/dist/assets/{index-BjA4YODs.js → index-CO2S9BKY.js} +2 -2
  29. package/packages/dashboard/dist/assets/index-CO2S9BKY.js.map +1 -0
  30. package/packages/dashboard/dist/index.html +2 -2
  31. package/packages/enterprise-bridge/dist/er-client.d.ts +1 -1
  32. package/packages/flows/dist/git.js +1 -1
  33. package/packages/flows/dist/registry.d.ts +3 -3
  34. package/packages/flows/dist/registry.js +1 -1
  35. package/packages/flows/dist/symlinks.js +1 -1
  36. package/packages/indexer/dist/filesystem-crawler.js +1 -1
  37. package/packages/indexer/dist/hash-cache.js +1 -1
  38. package/packages/indexer/dist/incremental-indexer.js +1 -1
  39. package/packages/kb-client/dist/direct-client.d.ts +37 -0
  40. package/packages/kb-client/dist/direct-client.js +1 -0
  41. package/packages/kb-client/dist/index.d.ts +5 -0
  42. package/packages/kb-client/dist/index.js +1 -0
  43. package/packages/kb-client/dist/mcp-client.d.ts +19 -0
  44. package/packages/kb-client/dist/mcp-client.js +4 -0
  45. package/packages/kb-client/dist/parsers.d.ts +35 -0
  46. package/packages/kb-client/dist/parsers.js +2 -0
  47. package/packages/kb-client/dist/types.d.ts +62 -0
  48. package/packages/kb-client/dist/types.js +1 -0
  49. package/packages/present/dist/index.html +28 -28
  50. package/packages/server/dist/background-task.d.ts +47 -0
  51. package/packages/server/dist/background-task.js +1 -0
  52. package/packages/server/dist/config.js +1 -1
  53. package/packages/server/dist/idle-timer.d.ts +33 -0
  54. package/packages/server/dist/idle-timer.js +1 -0
  55. package/packages/server/dist/index.js +1 -1
  56. package/packages/server/dist/memory-monitor.d.ts +37 -0
  57. package/packages/server/dist/memory-monitor.js +1 -0
  58. package/packages/server/dist/prompts.js +5 -5
  59. package/packages/server/dist/resource-links.d.ts +1 -1
  60. package/packages/server/dist/resource-links.js +1 -1
  61. package/packages/server/dist/resources/curated-resources.d.ts +2 -2
  62. package/packages/server/dist/resources/curated-resources.js +2 -2
  63. package/packages/server/dist/resources/resource-notifier.d.ts +1 -1
  64. package/packages/server/dist/resources/resource-notifier.js +1 -1
  65. package/packages/server/dist/resources/resources.js +1 -1
  66. package/packages/server/dist/server.d.ts +4 -2
  67. package/packages/server/dist/server.js +3 -3
  68. package/packages/server/dist/tool-metadata.d.ts +1 -1
  69. package/packages/server/dist/tool-metadata.js +1 -1
  70. package/packages/server/dist/tool-timeout.d.ts +27 -0
  71. package/packages/server/dist/tool-timeout.js +1 -0
  72. package/packages/server/dist/tools/bridge.tools.d.ts +1 -1
  73. package/packages/server/dist/tools/bridge.tools.js +3 -3
  74. package/packages/server/dist/tools/config.tool.d.ts +8 -0
  75. package/packages/server/dist/tools/config.tool.js +12 -0
  76. package/packages/server/dist/tools/evolution.tools.js +1 -1
  77. package/packages/server/dist/tools/flow.tools.js +1 -1
  78. package/packages/server/dist/tools/infra.tools.js +1 -1
  79. package/packages/server/dist/tools/onboard.tool.js +1 -1
  80. package/packages/server/dist/tools/present/browser.js +9 -9
  81. package/packages/server/dist/tools/present/tool.js +4 -4
  82. package/packages/server/dist/tools/reindex.tool.js +1 -1
  83. package/packages/server/dist/tools/search.tool.js +4 -4
  84. package/packages/server/dist/tools/status.tool.d.ts +1 -1
  85. package/packages/server/dist/tools/status.tool.js +3 -3
  86. package/packages/store/dist/sqlite-graph-store.d.ts +3 -0
  87. package/packages/store/dist/sqlite-graph-store.js +3 -3
  88. package/packages/tools/dist/checkpoint.js +1 -1
  89. package/packages/tools/dist/config-extractor.js +1 -1
  90. package/packages/tools/dist/evidence-map.js +1 -1
  91. package/packages/tools/dist/find.d.ts +1 -1
  92. package/packages/tools/dist/forge-ground.d.ts +1 -1
  93. package/packages/tools/dist/guide.js +1 -1
  94. package/packages/tools/dist/lane.js +1 -1
  95. package/packages/tools/dist/onboard.d.ts +2 -2
  96. package/packages/tools/dist/onboard.js +2 -2
  97. package/packages/tools/dist/queue.js +1 -1
  98. package/packages/tools/dist/replay.js +1 -1
  99. package/packages/tools/dist/response-envelope.d.ts +1 -1
  100. package/packages/tools/dist/restore-points.js +1 -1
  101. package/packages/tools/dist/schema-validate.js +1 -1
  102. package/packages/tools/dist/snippet.js +1 -1
  103. package/packages/tools/dist/stash.js +1 -1
  104. package/packages/tools/dist/synthesis-engine.js +2 -2
  105. package/packages/tools/dist/workset.js +1 -1
  106. package/packages/tui/dist/{App-DU2KEylW.js → App-DpjN3iS-.js} +1 -1
  107. package/packages/tui/dist/App.d.ts +1 -1
  108. package/packages/tui/dist/App.js +1 -1
  109. package/packages/tui/dist/LogPanel-Db-SeZhR.js +3 -0
  110. package/packages/tui/dist/hooks/useKBClient.d.ts +1 -1
  111. package/packages/tui/dist/{index-BXafekwr.d.ts → index-MXJeXmCf.d.ts} +3 -3
  112. package/packages/tui/dist/index.d.ts +1 -1
  113. package/packages/tui/dist/index.js +1 -1
  114. package/packages/tui/dist/panels/LogPanel.js +1 -1
  115. package/scaffold/README.md +192 -192
  116. package/scaffold/definitions/bodies.mjs +16 -16
  117. package/scaffold/definitions/plugins.mjs +1 -1
  118. package/scaffold/definitions/prompts.mjs +6 -6
  119. package/scaffold/definitions/protocols.mjs +12 -12
  120. package/scaffold/definitions/tools.mjs +1 -1
  121. package/scaffold/flows/aikit-advanced/skills/execute/SKILL.md +124 -124
  122. package/scaffold/flows/aikit-advanced/skills/plan/SKILL.md +100 -100
  123. package/scaffold/flows/aikit-advanced/skills/spec/SKILL.md +100 -100
  124. package/scaffold/flows/aikit-advanced/skills/task/SKILL.md +99 -99
  125. package/scaffold/flows/aikit-advanced/skills/verify/SKILL.md +122 -122
  126. package/scaffold/flows/aikit-basic/skills/assess/SKILL.md +82 -82
  127. package/scaffold/flows/aikit-basic/skills/implement/SKILL.md +105 -105
  128. package/scaffold/flows/aikit-basic/skills/verify/SKILL.md +96 -96
  129. package/scaffold/general/agents/Debugger.agent.md +2 -2
  130. package/scaffold/general/agents/Documenter.agent.md +2 -2
  131. package/scaffold/general/agents/Explorer.agent.md +2 -2
  132. package/scaffold/general/agents/Frontend.agent.md +1 -1
  133. package/scaffold/general/agents/Implementer.agent.md +2 -2
  134. package/scaffold/general/agents/Orchestrator.agent.md +1 -1
  135. package/scaffold/general/agents/Planner.agent.md +2 -2
  136. package/scaffold/general/agents/Refactor.agent.md +2 -2
  137. package/scaffold/general/agents/Security.agent.md +2 -2
  138. package/scaffold/general/agents/_shared/architect-reviewer-base.md +1 -1
  139. package/scaffold/general/agents/_shared/code-agent-base.md +6 -6
  140. package/scaffold/general/agents/_shared/code-reviewer-base.md +1 -1
  141. package/scaffold/general/agents/_shared/forge-protocol.md +1 -1
  142. package/scaffold/general/agents/_shared/researcher-base.md +3 -3
  143. package/scaffold/general/prompts/ask.prompt.md +4 -4
  144. package/scaffold/general/prompts/debug.prompt.md +1 -1
  145. package/scaffold/general/prompts/plan.prompt.md +1 -1
  146. package/scaffold/general/skills/aikit/SKILL.md +5 -5
  147. package/scaffold/general/skills/multi-agents-development/SKILL.md +435 -435
  148. package/scaffold/general/skills/present/SKILL.md +424 -424
  149. package/packages/dashboard/dist/assets/index-BjA4YODs.js.map +0 -1
  150. package/packages/tui/dist/LogPanel-Bo8a8QXB.js +0 -3
@@ -1,424 +1,424 @@
1
- ---
2
- name: present
3
- description: "Use the KB `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 | — |