@vpxa/aikit 0.1.351 → 0.1.353
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/blocks-core/dist/index.mjs +949 -118
- package/packages/core/dist/index.d.ts +3 -0
- package/packages/core/dist/index.js +1 -1
- package/packages/present/dist/annotation-layer.js +48 -74
- package/packages/present/dist/index.html +977 -153
- package/packages/server/dist/bin.js +1 -1
- package/packages/server/dist/index.js +288 -109
- package/packages/server/dist/prelude-DetbWo8R.js +1 -0
- package/packages/server/dist/prelude-hfAEi93R.js +2 -0
- package/packages/server/dist/sampling-CWjnUevo.js +2 -0
- package/packages/server/dist/sampling-CnE3owSt.js +1 -0
- package/packages/server/dist/{server-Dc2XtS92.js → server-D5eu57oU.js} +150 -148
- package/packages/server/dist/{server-Ct4BK2hi.js → server-D7gZ4K_H.js} +150 -148
- package/packages/server/dist/{server-http-DBmzukZH.js → server-http-AarbD3gm.js} +1 -1
- package/packages/server/dist/{server-http-BNC9qZBj.js → server-http-wnYmWFkC.js} +1 -1
- package/packages/server/dist/{server-stdio-JHWimdo9.js → server-stdio-BWoMqXU8.js} +1 -1
- package/packages/server/dist/{server-stdio-DkDdZI98.js → server-stdio-CBGO6XiO.js} +1 -1
- package/packages/server/viewers/canvas.html +944 -127
- package/packages/server/viewers/code-review-viewer.html +352 -0
- package/packages/server/viewers/report-template.html +918 -101
- package/packages/server/viewers/task-plan-static.html +1 -1
- package/packages/server/viewers/tour-viewer.html +919 -102
- package/packages/tools/dist/index.js +82 -82
- package/scaffold/dist/definitions/skills/c4-architecture.mjs +1 -1
- package/scaffold/dist/definitions/skills/docs.mjs +19 -3
- package/scaffold/dist/definitions/skills/present.mjs +317 -13
- package/scaffold/dist/generated/block-docs.mjs +18 -64
- package/packages/server/dist/prelude-Clxlztkk.js +0 -1
- package/packages/server/dist/prelude-Dn7jTsqe.js +0 -2
- package/packages/server/dist/sampling-giGWyrcO.js +0 -1
- package/packages/server/dist/sampling-nivAea83.js +0 -2
|
@@ -27,12 +27,16 @@ Always include schemaVersion: 1 and title. Use concise description when helpful.
|
|
|
27
27
|
## Selection Guide
|
|
28
28
|
|
|
29
29
|
| Need | Shape |
|
|
30
|
-
|
|
30
|
+
|---|---|---|
|
|
31
31
|
| Summary/report | report template or heading + markdown/table |
|
|
32
32
|
| Plan/progress | task-plan/checklist/status-board |
|
|
33
33
|
| Metrics/trends | metrics + chart |
|
|
34
34
|
| Compare options | table + kv + recommendation |
|
|
35
|
-
| Review/approval | review template + approval action |
|
|
35
|
+
| Review/approval | review template + approval action, or code-review@1 viewer for per-file diffs |
|
|
36
|
+
| Code review (per-file) | code-review@1 viewer — diff grid + risk map + review bubbles + annotations |
|
|
37
|
+
| Architecture diagram | c4@1 / c4-static@1 viewers |
|
|
38
|
+
| Process diagram | process-flow@1 / process-flow-static@1 viewers |
|
|
39
|
+
| Guided tour | tour@1 viewer |
|
|
36
40
|
| Logs/errors | code/error block |
|
|
37
41
|
| Choice | actions select/confirm/button |
|
|
38
42
|
|
|
@@ -55,8 +59,28 @@ Always include schemaVersion: 1 and title. Use concise description when helpful.
|
|
|
55
59
|
- Use \`preferBrowser: true\` when user explicitly requests "open in browser", "external window", or "browser transport"
|
|
56
60
|
- Templates \`c4@1\`, \`tour@1\`, \`process-flow@1\` are browser-only (interactive) — always open in browser
|
|
57
61
|
- Templates \`c4-static@1\`, \`task-plan-static@1\`, \`process-flow-static@1\` are mcp-app-only — inline by default, use \`preferBrowser\` to force browser
|
|
62
|
+
- Template \`code-review@1\` supports both transports: inline for reading, browser for annotated review with actions (Approve/Request Changes). Text selection annotations auto-activate in browser transport when actions are present.
|
|
58
63
|
- Block-only surfaces (no template) respond to \`preferBrowser\` as expected
|
|
59
64
|
|
|
65
|
+
## Diagram Renderers vs Viewer Templates
|
|
66
|
+
|
|
67
|
+
Two separate paths for diagram/visual output — choose based on use case:
|
|
68
|
+
|
|
69
|
+
**Diagram renderers** (programmatic API — NOT present tool):
|
|
70
|
+
- Import from \`@aikit/server/diagram\`: \`renderToResult\`, \`renderHtml\`, \`renderDiagram\`
|
|
71
|
+
- 5 types: \`architecture\`, \`workflow\`, \`sequence\`, \`dataflow\`, \`lifecycle\`
|
|
72
|
+
- Standalone HTML (not wrapped in present shell) — embed in docs, write to disk
|
|
73
|
+
- All 5 now use warm clay/olive/gold design system, serif headings, dark/light mode, responsive
|
|
74
|
+
- All 5 now support click-to-detail card interaction on SVG nodes
|
|
75
|
+
- Invoke: \`renderToResult({ diagram_type: 'architecture', meta: {title}, components, connections })\`
|
|
76
|
+
- Use when diagrams go to files, docs, or you don't need present tool's action/annotation system
|
|
77
|
+
|
|
78
|
+
**Viewer templates** (present tool — \`present({ template: '...', data: {...} })\`):
|
|
79
|
+
- 7 templates listed below — rendered inside present shell with header/footer/theme toggle
|
|
80
|
+
- Support actions (approve, confirm, select) and annotation layer for code-review@1
|
|
81
|
+
- Invoke: \`present({ template: 'code-review@1', data: {...}, actions: [...] })\`
|
|
82
|
+
- Use when you need interactive UI, user actions, annotations, or present workflow integration
|
|
83
|
+
|
|
60
84
|
## Quality Bar
|
|
61
85
|
|
|
62
86
|
- One clear title, no giant unstructured markdown dumps.
|
|
@@ -74,7 +98,7 @@ If validation fails, fix schema shape first. Use schema/preset/template resource
|
|
|
74
98
|
|
|
75
99
|
Load on demand:
|
|
76
100
|
- references/block-catalog.md — Complete 32-block type catalog with value shapes, best block for each data type, and rules.
|
|
77
|
-
- references/presets-templates.md — Preset contracts (8 presets), viewer templates (
|
|
101
|
+
- references/presets-templates.md — Preset contracts (8 presets), viewer templates (7), MCP App templates (14), diagram renderers (5), and error recovery patterns.
|
|
78
102
|
`},{file:`references/block-catalog.md`,content:`# Block Catalog — 32 Content Blocks
|
|
79
103
|
|
|
80
104
|
Pass content as blocks array of { type, title?, value } objects.
|
|
@@ -160,16 +184,296 @@ Pass content as blocks array of { type, title?, value } objects.
|
|
|
160
184
|
|
|
161
185
|
Each preset supplies inputSchema (JSON Schema), example (JSON), and expandsTo (block description) via aikit://present/presets.
|
|
162
186
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
|
187
|
+
Viewer templates also supply inputSchema programmatically — query via aikit://present/templates resource or call registerViewer() definitions.
|
|
188
|
+
|
|
189
|
+
## 7 Viewer Templates
|
|
190
|
+
|
|
191
|
+
Viewer templates are self-contained HTML pages rendered inside the present tool shell. Each has a specific data contract. Pass as \`present({ template: '<id>', data: {...} })\`.
|
|
192
|
+
|
|
193
|
+
| Template | Transport | When to use | Required fields |
|
|
194
|
+
|----------|-----------|-------------|----------------|
|
|
195
|
+
| c4@1 | browser | Interactive C4 architecture with zoom/pan/ELK auto-layout | nodes: [{ id, type, label }] |
|
|
196
|
+
| c4-static@1 | mcp-app | Static SVG architecture diagram inline (no interaction) | nodes: [{ id, type, label }] |
|
|
197
|
+
| process-flow@1 | browser | Interactive process flow with ReactFlow drag/zoom | nodes: [{ id, label }] |
|
|
198
|
+
| process-flow-static@1 | mcp-app | Static SVG process flow inline | nodes: [{ id, label }] |
|
|
199
|
+
| tour@1 | browser | Guided walkthrough with step nav + dependency graph | steps: [{ id, title, file?, code? }] |
|
|
200
|
+
| task-plan-static@1 | mcp-app | Task execution plan with phases/batches/agents | phases: [{ id, label, batches }] |
|
|
201
|
+
| code-review@1 | mcp-app, browser | Per-file diff code review with risk map, bubbles, annotations | files: [{ path }] |
|
|
202
|
+
|
|
203
|
+
### c4@1 / c4-static@1 Data Contract
|
|
204
|
+
|
|
205
|
+
{
|
|
206
|
+
title: "System Context — Acme Web",
|
|
207
|
+
description: "Top-level system context diagram",
|
|
208
|
+
layout: { direction: "TB", spacing: 60, layerSpacing: 80 },
|
|
209
|
+
nodes: [
|
|
210
|
+
{ id: "user", type: "person", label: "User", icon: "person" },
|
|
211
|
+
{ id: "web", type: "container", label: "Web App", technology: "React",
|
|
212
|
+
description: "Single-page application" },
|
|
213
|
+
{ id: "api", type: "container", label: "API Server", technology: "Hono" },
|
|
214
|
+
{ id: "db", type: "database", label: "Postgres", technology: "RDS" }
|
|
215
|
+
],
|
|
216
|
+
edges: [
|
|
217
|
+
{ source: "user", target: "web", label: "browses", style: "sync" },
|
|
218
|
+
{ source: "web", target: "api", label: "fetch /api", style: "sync" },
|
|
219
|
+
{ source: "api", target: "db", label: "query", style: "async" }
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
- \`nodes[].type\`: \`person\` | \`system\` | \`container\` | \`component\` | \`database\` | \`queue\` | \`external\` | \`boundary\`
|
|
224
|
+
- \`edges[].style\`: \`sync\` | \`async\` | \`dashed\` | \`dotted\` | \`solid\`
|
|
225
|
+
- c4@1 = interactive (browser-only), c4-static@1 = static SVG (mcp-app inline)
|
|
226
|
+
|
|
227
|
+
### process-flow@1 / process-flow-static@1 Data Contract
|
|
228
|
+
|
|
229
|
+
{
|
|
230
|
+
nodes: [
|
|
231
|
+
{ id: "start", label: "Start", type: "start-end" },
|
|
232
|
+
{ id: "review", label: "Code Review", type: "manual",
|
|
233
|
+
description: "Peer review required before merge" },
|
|
234
|
+
{ id: "deploy", label: "Deploy", type: "automated" },
|
|
235
|
+
{ id: "approve?", label: "Approved?", type: "decision" }
|
|
236
|
+
],
|
|
237
|
+
edges: [
|
|
238
|
+
{ source: "start", target: "review", label: "assign" },
|
|
239
|
+
{ source: "review", target: "approve?", type: "standard" },
|
|
240
|
+
{ source: "approve?", target: "deploy", label: "yes", type: "standard" },
|
|
241
|
+
{ source: "approve?", target: "review", label: "no", type: "loop-back" }
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
- \`nodes[].type\`: \`start-end\` | \`manual\` | \`automated\` | \`integration\` | \`decision\` | \`prerequisite\`
|
|
246
|
+
- \`edges[].type\`: \`standard\` | \`loop-back\` | \`exception\`
|
|
247
|
+
- process-flow@1 = interactive (browser), process-flow-static@1 = static SVG (mcp-app)
|
|
248
|
+
|
|
249
|
+
### tour@1 Data Contract
|
|
250
|
+
|
|
251
|
+
{
|
|
252
|
+
title: "Scaffold Build Pipeline",
|
|
253
|
+
description: "How the scaffold generation pipeline works",
|
|
254
|
+
estimatedTime: "10 min",
|
|
255
|
+
steps: [
|
|
256
|
+
{ stepNumber: 1, id: "intro", title: "Overview",
|
|
257
|
+
file: "scaffold/generate.mjs",
|
|
258
|
+
explanation: "The scaffold reads definitions from scaffold/definitions/...",
|
|
259
|
+
description: "Entry point for the entire pipeline",
|
|
260
|
+
learnsConcept: "pipeline architecture",
|
|
261
|
+
duration: "2 min",
|
|
262
|
+
code: "export async function generate() { ... }"
|
|
263
|
+
},
|
|
264
|
+
{ stepNumber: 2, id: "definitions", title: "Source of Truth",
|
|
265
|
+
file: "scaffold/definitions/agents.mjs" }
|
|
266
|
+
],
|
|
267
|
+
dependencies: [
|
|
268
|
+
{ source: "intro", target: "definitions" }
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
### task-plan-static@1 Data Contract
|
|
273
|
+
|
|
274
|
+
{
|
|
275
|
+
title: "Implement Auth Module",
|
|
276
|
+
description: "Task breakdown for adding auth",
|
|
277
|
+
phases: [{
|
|
278
|
+
id: "phase-1", label: "Research",
|
|
279
|
+
outcome: "Selected auth strategy",
|
|
280
|
+
batches: [{
|
|
281
|
+
id: "batch-1", order: 1, parallel: false,
|
|
282
|
+
label: "Analyze options",
|
|
283
|
+
tasks: [{ id: "t1", title: "Compare JWT vs session",
|
|
284
|
+
agent: "Researcher-Alpha", status: "done",
|
|
285
|
+
files: ["docs/auth-comparison.md"] }]
|
|
286
|
+
}]
|
|
287
|
+
}]
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
- \`batches[].tasks[].agent\`: any agent name (e.g. Implementer, Researcher-Alpha)
|
|
291
|
+
- \`batches[].tasks[].status\`: \`pending\` | \`in-progress\` | \`done\` | \`blocked\`
|
|
292
|
+
- Supports \`dependsOn\` array for task dependencies
|
|
293
|
+
|
|
294
|
+
### code-review@1 Data Contract
|
|
295
|
+
|
|
296
|
+
{
|
|
297
|
+
title: "PR #247 — Add optimistic updates",
|
|
298
|
+
repo: "acme/web",
|
|
299
|
+
author: "Mira Okafor",
|
|
300
|
+
additions: 142, deletions: 38,
|
|
301
|
+
files: [{
|
|
302
|
+
path: "src/hooks/useOptimisticTasks.ts",
|
|
303
|
+
risk: "attention", // "safe" | "medium" | "attention"
|
|
304
|
+
collapsed: true, // wrap in <details>
|
|
305
|
+
diff: [
|
|
306
|
+
{ t: "add", n: 1, c: "import { useMutation } from '...'" },
|
|
307
|
+
{ t: "del", n: 43, c: "const [pending, setPending] = useState(null)" },
|
|
308
|
+
{ t: "ctx", n: 50, c: "return <ul className='tasks'>" },
|
|
309
|
+
{ t: "hunk", c: "@@ -42,14 +42,17 @@" }
|
|
310
|
+
],
|
|
311
|
+
comments: [
|
|
312
|
+
{ line: 11, text: "Missing cancelQueries()", blocking: true }
|
|
313
|
+
]
|
|
314
|
+
}],
|
|
315
|
+
conclusion: ["Fix the cancelQueries gap before merging."]
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
- \`files[].risk\`: safe=green chip, medium=gold chip, attention=terracotta chip
|
|
319
|
+
- \`diff[].t\`: add=green bg, del=red bg, ctx=neutral, hunk=dim header row
|
|
320
|
+
- \`comments[].blocking\`: true=red left border, false=gray left border
|
|
321
|
+
- Add \`actions\` array (e.g. approve, request-changes) to auto-activate browser transport + annotation layer
|
|
322
|
+
- Annotations: user selects diff text -> comment popover -> stored in \`__annotationLayer\` -> bundled with action callback
|
|
323
|
+
- Viewer uses warm clay/olive/gold design, serif headings, dark/light toggle, responsive layout
|
|
324
|
+
|
|
325
|
+
## 5 Diagram Renderers (programmatic — NOT present tool)
|
|
326
|
+
|
|
327
|
+
Diagram renderers produce standalone HTML with warm design system, dark/light mode, and click-to-detail interaction on all SVG nodes. Invoke via:
|
|
328
|
+
|
|
329
|
+
import { renderToResult, renderHtml, renderDiagram } from '@aikit/server/diagram'
|
|
330
|
+
const { html } = renderToResult({ diagram_type: 'architecture', meta: {title: '...'}, ... })
|
|
331
|
+
// or for HTML string only:
|
|
332
|
+
const html = renderHtml({ diagram_type: 'workflow', meta: {title: '...'}, ... })
|
|
333
|
+
|
|
334
|
+
All renderers accept \`meta: { palette: 'warm' | 'technical', title: string, subtitle?: string }\`. Default palette is warm.
|
|
335
|
+
|
|
336
|
+
### architecture Data Contract
|
|
337
|
+
|
|
338
|
+
{
|
|
339
|
+
diagram_type: 'architecture',
|
|
340
|
+
meta: { title: "System Architecture", subtitle: "High-level overview", palette: "warm" },
|
|
341
|
+
components: [
|
|
342
|
+
{ id: "web", type: "frontend", label: "React SPA", sublabel: "Vite",
|
|
343
|
+
pos: { x: 40, y: 60 }, size: [140, 70] },
|
|
344
|
+
{ id: "api", type: "backend", label: "API Server", sublabel: "Hono",
|
|
345
|
+
pos: { x: 240, y: 60 } },
|
|
346
|
+
{ id: "db", type: "database", label: "Postgres",
|
|
347
|
+
pos: { x: 440, y: 60 } }
|
|
348
|
+
],
|
|
349
|
+
connections: [
|
|
350
|
+
{ from: "web", to: "api", label: "fetch /v1", variant: "emphasis" },
|
|
351
|
+
{ from: "api", to: "db", label: "query", variant: "dashed" }
|
|
352
|
+
],
|
|
353
|
+
boundaries: [
|
|
354
|
+
{ kind: "region", label: "AWS", wraps: ["api", "db"] }
|
|
355
|
+
],
|
|
356
|
+
cards: [{ dot: "green", title: "Key", items: ["SPA served from edge"] }]
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
- \`components[].type\`: \`frontend\` | \`backend\` | \`database\` | \`cloud\` | \`security\` | \`messagebus\` | \`external\`
|
|
360
|
+
- \`connections[].variant\`: \`default\` | \`emphasis\` | \`security\` | \`dashed\` | \`animated\`
|
|
361
|
+
- \`connections[].route\`: \`straight\` | \`drop\` | \`auto\` (bent elbow)
|
|
362
|
+
- Components auto-wrapped in \`<g class="node" data-k="[id]">\` for click-to-detail interaction
|
|
363
|
+
|
|
364
|
+
### workflow Data Contract
|
|
365
|
+
|
|
366
|
+
{
|
|
367
|
+
diagram_type: 'workflow',
|
|
368
|
+
meta: { title: "Deploy Pipeline" },
|
|
369
|
+
lanes: [{ id: "dev", label: "Developer" }, { id: "ci", label: "CI/CD" }],
|
|
370
|
+
nodes: [
|
|
371
|
+
{ id: "push", lane: "dev", col: 1, type: "frontend",
|
|
372
|
+
label: "git push", sublabel: "main branch" },
|
|
373
|
+
{ id: "lint", lane: "ci", col: 2, type: "backend",
|
|
374
|
+
label: "Lint + Typecheck" },
|
|
375
|
+
{ id: "test", lane: "ci", col: 3, type: "backend",
|
|
376
|
+
label: "Unit tests", tag: "3 shards" },
|
|
377
|
+
{ id: "deploy", lane: "ci", col: 4, type: "cloud",
|
|
378
|
+
label: "Deploy", sublabel: "Argo" }
|
|
379
|
+
],
|
|
380
|
+
edges: [
|
|
381
|
+
{ from: "push", to: "lint", label: "trigger" },
|
|
382
|
+
{ from: "lint", to: "test" },
|
|
383
|
+
{ from: "test", to: "deploy", variant: "emphasis" }
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
- \`nodes[].col\`: 1-based column position within lane (1-6 max)
|
|
388
|
+
- \`nodes[].type\`: same component types as architecture
|
|
389
|
+
- Auto-wrapped in \`<g class="node" data-k="[id]">\`
|
|
390
|
+
|
|
391
|
+
### sequence Data Contract
|
|
392
|
+
|
|
393
|
+
{
|
|
394
|
+
diagram_type: 'sequence',
|
|
395
|
+
meta: { title: "Auth Flow" },
|
|
396
|
+
participants: [
|
|
397
|
+
{ id: "user", type: "frontend", label: "User" },
|
|
398
|
+
{ id: "spa", type: "frontend", label: "SPA" },
|
|
399
|
+
{ id: "api", type: "backend", label: "API" },
|
|
400
|
+
{ id: "db", type: "database", label: "DB" }
|
|
401
|
+
],
|
|
402
|
+
messages: [
|
|
403
|
+
{ from: "user", to: "spa", y: 180, label: "click login", variant: "emphasis" },
|
|
404
|
+
{ from: "spa", to: "api", y: 240, label: "POST /auth/login" },
|
|
405
|
+
{ from: "api", to: "db", y: 300, label: "SELECT user" },
|
|
406
|
+
{ from: "api", to: "spa", y: 360, label: "200 { token }", variant: "return" }
|
|
407
|
+
],
|
|
408
|
+
activations: [
|
|
409
|
+
{ participant: "api", from: 220, to: 380, type: "backend" }
|
|
410
|
+
],
|
|
411
|
+
segments: [
|
|
412
|
+
{ from: 160, to: 220, label: "User input" }
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
- \`messages[].y\`: absolute Y coordinate in SVG (descending = later in time)
|
|
417
|
+
- \`messages[].variant\`: \`default\` | \`emphasis\` | \`security\` | \`return\` | \`dashed\`
|
|
418
|
+
- Participants auto-wrapped in \`<g class="node" data-k="[id]">\`
|
|
419
|
+
|
|
420
|
+
### dataflow Data Contract
|
|
421
|
+
|
|
422
|
+
{
|
|
423
|
+
diagram_type: 'dataflow',
|
|
424
|
+
meta: { title: "User Registration Flow" },
|
|
425
|
+
stages: [
|
|
426
|
+
{ label: "Client" }, { label: "Edge" }, { label: "Services" }, { label: "Storage" }
|
|
427
|
+
],
|
|
428
|
+
nodes: [
|
|
429
|
+
{ id: "browser", type: "frontend", label: "Browser", stage: 0, row: 0 },
|
|
430
|
+
{ id: "cdn", type: "cloud", label: "CDN", stage: 1, row: 0, tag: "cache" },
|
|
431
|
+
{ id: "auth", type: "backend", label: "Auth Service", stage: 2, row: 0 },
|
|
432
|
+
{ id: "db", type: "database", label: "Postgres", stage: 3, row: 0 }
|
|
433
|
+
],
|
|
434
|
+
flows: [
|
|
435
|
+
{ from: "browser", to: "cdn", label: "GET /login", classification: "public" },
|
|
436
|
+
{ from: "cdn", to: "auth", label: "forward", variant: "emphasis" },
|
|
437
|
+
{ from: "auth", to: "db", label: "SELECT", classification: "PII" }
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
- \`stages\`: vertical columns (left to right)
|
|
442
|
+
- \`nodes[].stage\`: 0-based index into stages array
|
|
443
|
+
- \`nodes[].row\`: vertical position within stage
|
|
444
|
+
- \`flows[].classification\`: \`public\` | \`internal\` | \`PII\` (controls edge color)
|
|
445
|
+
- Auto-wrapped in \`<g class="node" data-k="[id]">\`
|
|
446
|
+
|
|
447
|
+
### lifecycle Data Contract
|
|
448
|
+
|
|
449
|
+
{
|
|
450
|
+
diagram_type: 'lifecycle',
|
|
451
|
+
meta: { title: "Order State Machine" },
|
|
452
|
+
lanes: [
|
|
453
|
+
{ id: "phase", label: "Phase" },
|
|
454
|
+
{ id: "event", label: "Event" },
|
|
455
|
+
{ id: "outcome", label: "Outcome" }
|
|
456
|
+
],
|
|
457
|
+
states: [
|
|
458
|
+
{ id: "created", lane: "phase", col: 1, type: "active", label: "Created" },
|
|
459
|
+
{ id: "paid", lane: "phase", col: 2, type: "active", label: "Paid", step: "1" },
|
|
460
|
+
{ id: "shipped", lane: "phase", col: 3, type: "active", label: "Shipped", step: "2" },
|
|
461
|
+
{ id: "delivered", lane: "outcome", col: 4, type: "success", label: "Delivered" },
|
|
462
|
+
{ id: "cancelled", lane: "outcome", col: 2, type: "failure", label: "Cancelled" }
|
|
463
|
+
],
|
|
464
|
+
transitions: [
|
|
465
|
+
{ from: "created", to: "paid", label: "charge" },
|
|
466
|
+
{ from: "paid", to: "shipped", label: "fulfill" },
|
|
467
|
+
{ from: "paid", to: "cancelled", label: "refund", variant: "dashed" },
|
|
468
|
+
{ from: "shipped", to: "delivered", label: "confirm" }
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
- \`states[].type\`: \`start\` | \`active\` | \`waiting\` | \`decision\` | \`success\` | \`failure\` | \`neutral\` | \`external\`
|
|
473
|
+
- \`states[].col\`: 1-based column position
|
|
474
|
+
- \`states[].step\`: optional step number badge
|
|
475
|
+
- \`transitions[].variant\`: \`default\` | \`emphasis\` | \`dashed\` | \`security\`
|
|
476
|
+
- Auto-wrapped in \`<g class="node" data-k="[id]">\`
|
|
173
477
|
|
|
174
478
|
## 14 MCP App Templates
|
|
175
479
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
const e="| Type | Description | Value Shape |\n|------|-------------|-------------|\n| `markdown` | Markdown content rendered with the marked parser. | `string` |\n| `code` | Formatted code block rendered inside pre/code tags. | `string` |\n| `mermaid` | Mermaid diagram source rendered in a mermaid pre block. | `string` |\n| `diagram` |
|
|
1
|
+
const e="| Type | Description | Value Shape |\n|------|-------------|-------------|\n| `markdown` | Markdown content rendered with the marked parser. | `string` |\n| `code` | Formatted code block rendered inside pre/code tags. | `string` |\n| `mermaid` | Mermaid diagram source rendered in a mermaid pre block. | `string` |\n| `architecture-diagram` | Architecture diagram with positioned components, connections, and boundary groups. Produces SVG with mermaid rendering. | `object ({ components, connections, boundaries? })` |\n| `workflow-diagram` | Workflow/pipeline diagram with lane-based columns, typed nodes, and edges. Produces SVG with mermaid rendering. | `object ({ lanes, nodes, edges })` |\n| `sequence-diagram` | Sequence diagram with participants and time-ordered messages. Produces SVG with mermaid rendering. | `object ({ participants, messages })` |\n| `dataflow-diagram` | Data flow diagram with stage-based columns, nodes, and classification-colored edges. Produces SVG with mermaid rendering. | `object ({ stages, nodes, flows })` |\n| `lifecycle-diagram` | Lifecycle state machine with lanes, states, and transitions. Produces SVG with mermaid rendering. | `object ({ lanes, states, transitions })` |\n| `table` | Tabular data rendered from records or explicit headers and rows. | `Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }` |\n| `metrics` | Metric cards showing label/value pairs with optional trend and status. | `Array<{ label: string; value: string | number; trend?: string | number; status?: string }>` |\n| `cards` | Card grid for titled items with optional body, badge, and status. | `Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>` |\n| `tree` | Hierarchical object or name/children tree rendered recursively. | `{ name: string; children?: unknown[] } | Record<string, unknown>` |\n| `graph` | Node and edge graph rendered as a Mermaid flow graph in HTML mode. | `{ nodes: Array<{ id: string; label?: string }>; edges: Array<{ from: string; to: string; label?: string }> }` |\n| `chart` | Structured chart definition rendered as SVG. | `{ chartType: string; data: Record<string, unknown>[]; xKey: string; yKeys: string[] }` |\n| `timeline` | Timeline entries rendered as a vertical sequence of events. | `Array<{ title: string; description?: string; timestamp?: string; status?: string }>` |\n| `checklist` | Checklist items with boolean checked state. | `Array<{label, checked}> | {items: Array<{label, checked}>}` |\n| `comparison` | Side-by-side comparison columns with titled item lists. | `Array<{title, items}> | {columns: Array<{title, items}>}` |\n| `status-board` | Status categories containing labeled status items. | `Array<{category, items}> | {items: Array<{category, items}>}` |\n| `prompt` | Prompt payload rendered through the prompt display helper. | `unknown` |\n| `progress` | Progress bar with current value and optional maximum. | `{label, value, max?} | {items: Array<{label, value, max?, color?}>}` |\n| `docs-browser` | Documentation file list with inline content previews for chat-safe rendering. | `{ files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }` |\n| `text` | Plain text content rendered through the markdown parser. | `string` |\n| `heading` | Single heading with configurable level from h1 to h6. | `string` |\n| `paragraph` | Single paragraph rendered inside a p tag. | `string` |\n| `separator` | Horizontal rule used to separate adjacent blocks. | `undefined` |\n| `actions` | Action bar containing button and select action definitions. | `Array<{ type: string; id: string; label: string; variant?: string; options?: Array<string | { label: string; value: string }> }>` |\n| `diff` | Diff view with +/- lines for showing changes between text. | `string | { content: string } | { before: string; after: string }` |\n| `finding` | Finding with severity pill showing title, severity, and detail. | `{ title?: string; severity?: string; detail?: unknown }` |\n| `kv` | Key-value pairs rendered as labeled entries. | `Array<{ key: string; value: unknown }> | Record<string, unknown>` |\n| `tags` | Tag pills rendered with optional tone/color. | `Array<string | { text?: string; label?: string; status?: string; tone?: string; color?: string }> | { items: Array<...> }` |\n| `list` | Bullet list items rendered as an unordered list. | `string[]` |\n| `lifecycle-flow` | SVG flow diagram with labeled steps, edges, and status colors. | `{ title?: string; steps: Array<{ id: string; label: string; type?: string; status?: string; description?: string }>; edges?: Array<{ from: string; to: string; label?: string }> }` |\n| `component-detail` | Component detail view with name, type, technology, responsibilities, interfaces, dependencies, metrics, and code links. | `{ name: string; description?: string; type?: string; technology?: string; responsibilities?: string[]; interfaces?: Array<{ name: string; type: string; description?: string }>; dependencies?: Array<{ name: string; relationship?: string }>; metrics?: Record<string, string | number>; codeLinks?: Array<{ href: string; label: string }> }` |\n| `data-table-schema` | Schema table with field names, types, constraints, and indexes. | `{ name: string; description?: string; fields: Array<{ name: string; type: string; required?: boolean; default?: unknown; constraints?: string[]; description?: string }>; indexes?: Array<{ name: string; columns: string[]; unique?: boolean }> }` |\n| `annotation` | Annotation groups with COMMENT, DELETION, and GLOBAL_COMMENT types. | `Array<{ id: string; type: \"COMMENT\" | \"DELETION\" | \"GLOBAL_COMMENT\"; body: string; author?: string; createdAt?: string }>` |\n| `approval` | Approval widget with radio options and optional comment textarea. | `{ prompt: string; options: Array<{ id: string; label: string; description?: string }>; requireComment?: boolean }` |\n| `docs-hub` | Doc hub card grid with titled pages, descriptions, categories, and statuses. | `{ title?: string; description?: string; pages?: Array<{ title: string; description?: string; href?: string; icon?: string; category?: string; status?: \"draft\" | \"published\" | \"deprecated\" }> }` |\n\n### Usage Examples\n\n#### `architecture-diagram`\n\n```typescript\n{\n type: 'architecture-diagram',\n value: {\n components: [\n { id: 'api', label: 'API Server', type: 'backend' },\n { id: 'web', label: 'Web App', type: 'frontend' }\n ],\n connections: [\n { from: 'web', to: 'api', label: 'HTTPS' }\n ]\n }\n}\n```\n\n#### `docs-browser`\n\n```typescript\n{\n type: 'docs-browser',\n value: {\n title: 'Project Docs',\n files: [\n { path: 'docs/README.md', title: 'Overview', status: 'current' },\n { path: 'docs/api.md', title: 'API Reference', status: 'stale' },\n ],\n },\n}\n```",t=` - type:"markdown" → value: string
|
|
2
2
|
- type:"code" → value: string
|
|
3
3
|
- type:"mermaid" → value: string
|
|
4
|
-
- type:"diagram" → value: object (
|
|
4
|
+
- type:"architecture-diagram" → value: object ({ components, connections, boundaries? })
|
|
5
|
+
- type:"workflow-diagram" → value: object ({ lanes, nodes, edges })
|
|
6
|
+
- type:"sequence-diagram" → value: object ({ participants, messages })
|
|
7
|
+
- type:"dataflow-diagram" → value: object ({ stages, nodes, flows })
|
|
8
|
+
- type:"lifecycle-diagram" → value: object ({ lanes, states, transitions })
|
|
5
9
|
- type:"table" → value: Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }
|
|
6
10
|
- type:"metrics" → value: Array<{ label: string; value: string | number; trend?: string | number; status?: string }>
|
|
7
11
|
- type:"cards" → value: Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>
|
|
@@ -30,71 +34,23 @@ const e="| Type | Description | Value Shape |\n|------|-------------|-----------
|
|
|
30
34
|
- type:"data-table-schema" → value: { name: string; description?: string; fields: Array<{ name: string; type: string; required?: boolean; default?: unknown; constraints?: string[]; description?: string }>; indexes?: Array<{ name: string; columns: string[]; unique?: boolean }> }
|
|
31
35
|
- type:"annotation" → value: Array<{ id: string; type: "COMMENT" | "DELETION" | "GLOBAL_COMMENT"; body: string; author?: string; createdAt?: string }>
|
|
32
36
|
- type:"approval" → value: { prompt: string; options: Array<{ id: string; label: string; description?: string }>; requireComment?: boolean }
|
|
33
|
-
- type:"docs-hub" → value: { title?: string; description?: string; pages?: Array<{ title: string; description?: string; href?: string; icon?: string; category?: string; status?: "draft" | "published" | "deprecated" }> }`,n={present:"| Type | Description | Value Shape |\n|------|-------------|-------------|\n| `markdown` | Markdown content rendered with the marked parser. | `string` |\n| `code` | Formatted code block rendered inside pre/code tags. | `string` |\n| `mermaid` | Mermaid diagram source rendered in a mermaid pre block. | `string` |\n| `diagram` |
|
|
37
|
+
- type:"docs-hub" → value: { title?: string; description?: string; pages?: Array<{ title: string; description?: string; href?: string; icon?: string; category?: string; status?: "draft" | "published" | "deprecated" }> }`,n={present:"| Type | Description | Value Shape |\n|------|-------------|-------------|\n| `markdown` | Markdown content rendered with the marked parser. | `string` |\n| `code` | Formatted code block rendered inside pre/code tags. | `string` |\n| `mermaid` | Mermaid diagram source rendered in a mermaid pre block. | `string` |\n| `architecture-diagram` | Architecture diagram with positioned components, connections, and boundary groups. Produces SVG with mermaid rendering. | `object ({ components, connections, boundaries? })` |\n| `workflow-diagram` | Workflow/pipeline diagram with lane-based columns, typed nodes, and edges. Produces SVG with mermaid rendering. | `object ({ lanes, nodes, edges })` |\n| `sequence-diagram` | Sequence diagram with participants and time-ordered messages. Produces SVG with mermaid rendering. | `object ({ participants, messages })` |\n| `dataflow-diagram` | Data flow diagram with stage-based columns, nodes, and classification-colored edges. Produces SVG with mermaid rendering. | `object ({ stages, nodes, flows })` |\n| `lifecycle-diagram` | Lifecycle state machine with lanes, states, and transitions. Produces SVG with mermaid rendering. | `object ({ lanes, states, transitions })` |\n| `table` | Tabular data rendered from records or explicit headers and rows. | `Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }` |\n| `metrics` | Metric cards showing label/value pairs with optional trend and status. | `Array<{ label: string; value: string | number; trend?: string | number; status?: string }>` |\n| `cards` | Card grid for titled items with optional body, badge, and status. | `Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>` |\n| `tree` | Hierarchical object or name/children tree rendered recursively. | `{ name: string; children?: unknown[] } | Record<string, unknown>` |\n| `graph` | Node and edge graph rendered as a Mermaid flow graph in HTML mode. | `{ nodes: Array<{ id: string; label?: string }>; edges: Array<{ from: string; to: string; label?: string }> }` |\n| `chart` | Structured chart definition rendered as SVG. | `{ chartType: string; data: Record<string, unknown>[]; xKey: string; yKeys: string[] }` |\n| `timeline` | Timeline entries rendered as a vertical sequence of events. | `Array<{ title: string; description?: string; timestamp?: string; status?: string }>` |\n| `checklist` | Checklist items with boolean checked state. | `Array<{label, checked}> | {items: Array<{label, checked}>}` |\n| `comparison` | Side-by-side comparison columns with titled item lists. | `Array<{title, items}> | {columns: Array<{title, items}>}` |\n| `status-board` | Status categories containing labeled status items. | `Array<{category, items}> | {items: Array<{category, items}>}` |\n| `prompt` | Prompt payload rendered through the prompt display helper. | `unknown` |\n| `progress` | Progress bar with current value and optional maximum. | `{label, value, max?} | {items: Array<{label, value, max?, color?}>}` |\n| `docs-browser` | Documentation file list with inline content previews for chat-safe rendering. | `{ files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }` |\n\n### Usage Examples\n\n#### `architecture-diagram`\n\n```typescript\n{\n type: 'architecture-diagram',\n value: {\n components: [\n { id: 'api', label: 'API Server', type: 'backend' },\n { id: 'web', label: 'Web App', type: 'frontend' }\n ],\n connections: [\n { from: 'web', to: 'api', label: 'HTTPS' }\n ]\n }\n}\n```\n\n#### `docs-browser`\n\n```typescript\n{\n type: 'docs-browser',\n value: {\n title: 'Project Docs',\n files: [\n { path: 'docs/README.md', title: 'Overview', status: 'current' },\n { path: 'docs/api.md', title: 'API Reference', status: 'stale' },\n ],\n },\n}\n```",docs:"| Type | Description | Value Shape |\n|------|-------------|-------------|\n| `markdown` | Markdown content rendered with the marked parser. | `string` |\n| `code` | Formatted code block rendered inside pre/code tags. | `string` |\n| `mermaid` | Mermaid diagram source rendered in a mermaid pre block. | `string` |\n| `workflow-diagram` | Workflow/pipeline diagram with lane-based columns, typed nodes, and edges. Produces SVG with mermaid rendering. | `object ({ lanes, nodes, edges })` |\n| `sequence-diagram` | Sequence diagram with participants and time-ordered messages. Produces SVG with mermaid rendering. | `object ({ participants, messages })` |\n| `lifecycle-diagram` | Lifecycle state machine with lanes, states, and transitions. Produces SVG with mermaid rendering. | `object ({ lanes, states, transitions })` |\n| `table` | Tabular data rendered from records or explicit headers and rows. | `Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }` |\n| `cards` | Card grid for titled items with optional body, badge, and status. | `Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>` |\n| `docs-browser` | Documentation file list with inline content previews for chat-safe rendering. | `{ files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }` |\n\n### Usage Examples\n\n#### `docs-browser`\n\n```typescript\n{\n type: 'docs-browser',\n value: {\n title: 'Project Docs',\n files: [\n { path: 'docs/README.md', title: 'Overview', status: 'current' },\n { path: 'docs/api.md', title: 'API Reference', status: 'stale' },\n ],\n },\n}\n```","c4-architecture":`| Type | Description | Value Shape |
|
|
34
38
|
|------|-------------|-------------|
|
|
35
|
-
| \`markdown\` | Markdown content rendered with the marked parser. | \`string\` |
|
|
36
|
-
| \`code\` | Formatted code block rendered inside pre/code tags. | \`string\` |
|
|
37
39
|
| \`mermaid\` | Mermaid diagram source rendered in a mermaid pre block. | \`string\` |
|
|
38
|
-
| \`diagram\` |
|
|
39
|
-
| \`table\` | Tabular data rendered from records or explicit headers and rows. | \`Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }\` |
|
|
40
|
-
| \`cards\` | Card grid for titled items with optional body, badge, and status. | \`Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>\` |
|
|
41
|
-
| \`docs-browser\` | Documentation file list with inline content previews for chat-safe rendering. | \`{ files: Array<{ path: string; title?: string; content?: string; status?: "current" | "stale" | "missing" }>; title?: string }\` |
|
|
42
|
-
|
|
43
|
-
### Usage Examples
|
|
44
|
-
|
|
45
|
-
#### \`diagram\`
|
|
46
|
-
|
|
47
|
-
\`\`\`typescript
|
|
48
|
-
{
|
|
49
|
-
type: 'diagram',
|
|
50
|
-
value: {
|
|
51
|
-
schema_version: 1,
|
|
52
|
-
diagram_type: 'architecture',
|
|
53
|
-
meta: { title: 'System Architecture' },
|
|
54
|
-
components: [
|
|
55
|
-
{ id: 'api', type: 'backend', label: 'API Server', pos: [400, 200] },
|
|
56
|
-
{ id: 'web', type: 'frontend', label: 'Web App', pos: [200, 200] }
|
|
57
|
-
],
|
|
58
|
-
connections: [
|
|
59
|
-
{ from: 'web', to: 'api', label: 'HTTPS' }
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
\`\`\`
|
|
64
|
-
|
|
65
|
-
#### \`docs-browser\`
|
|
66
|
-
|
|
67
|
-
\`\`\`typescript
|
|
68
|
-
{
|
|
69
|
-
type: 'docs-browser',
|
|
70
|
-
value: {
|
|
71
|
-
title: 'Project Docs',
|
|
72
|
-
files: [
|
|
73
|
-
{ path: 'docs/README.md', title: 'Overview', status: 'current' },
|
|
74
|
-
{ path: 'docs/api.md', title: 'API Reference', status: 'stale' },
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
}
|
|
78
|
-
\`\`\``,"c4-architecture":`| Type | Description | Value Shape |
|
|
79
|
-
|------|-------------|-------------|
|
|
80
|
-
| \`mermaid\` | Mermaid diagram source rendered in a mermaid pre block. | \`string\` |
|
|
81
|
-
| \`diagram\` | Structured diagram JSON rendered through the centralized diagram engine. Supports architecture, workflow, sequence, dataflow, and lifecycle types. Produces SVG with dark/light theming, export toolbar, and markdown output. | \`object (ArchitectureDiagram | WorkflowDiagram | SequenceDiagram | DataFlowDiagram | LifecycleDiagram)\` |
|
|
40
|
+
| \`architecture-diagram\` | Architecture diagram with positioned components, connections, and boundary groups. Produces SVG with mermaid rendering. | \`object ({ components, connections, boundaries? })\` |
|
|
82
41
|
| \`graph\` | Node and edge graph rendered as a Mermaid flow graph in HTML mode. | \`{ nodes: Array<{ id: string; label?: string }>; edges: Array<{ from: string; to: string; label?: string }> }\` |
|
|
83
42
|
|
|
84
43
|
### Usage Examples
|
|
85
44
|
|
|
86
|
-
#### \`diagram\`
|
|
45
|
+
#### \`architecture-diagram\`
|
|
87
46
|
|
|
88
47
|
\`\`\`typescript
|
|
89
48
|
{
|
|
90
|
-
type: 'diagram',
|
|
49
|
+
type: 'architecture-diagram',
|
|
91
50
|
value: {
|
|
92
|
-
schema_version: 1,
|
|
93
|
-
diagram_type: 'architecture',
|
|
94
|
-
meta: { title: 'System Architecture' },
|
|
95
51
|
components: [
|
|
96
|
-
{ id: 'api',
|
|
97
|
-
{ id: 'web',
|
|
52
|
+
{ id: 'api', label: 'API Server', type: 'backend' },
|
|
53
|
+
{ id: 'web', label: 'Web App', type: 'frontend' }
|
|
98
54
|
],
|
|
99
55
|
connections: [
|
|
100
56
|
{ from: 'web', to: 'api', label: 'HTTPS' }
|
|
@@ -103,22 +59,20 @@ const e="| Type | Description | Value Shape |\n|------|-------------|-----------
|
|
|
103
59
|
}
|
|
104
60
|
\`\`\``,onboard:`| Type | Description | Value Shape |
|
|
105
61
|
|------|-------------|-------------|
|
|
106
|
-
| \`diagram\` |
|
|
62
|
+
| \`architecture-diagram\` | Architecture diagram with positioned components, connections, and boundary groups. Produces SVG with mermaid rendering. | \`object ({ components, connections, boundaries? })\` |
|
|
63
|
+
| \`dataflow-diagram\` | Data flow diagram with stage-based columns, nodes, and classification-colored edges. Produces SVG with mermaid rendering. | \`object ({ stages, nodes, flows })\` |
|
|
107
64
|
|
|
108
65
|
### Usage Examples
|
|
109
66
|
|
|
110
|
-
#### \`diagram\`
|
|
67
|
+
#### \`architecture-diagram\`
|
|
111
68
|
|
|
112
69
|
\`\`\`typescript
|
|
113
70
|
{
|
|
114
|
-
type: 'diagram',
|
|
71
|
+
type: 'architecture-diagram',
|
|
115
72
|
value: {
|
|
116
|
-
schema_version: 1,
|
|
117
|
-
diagram_type: 'architecture',
|
|
118
|
-
meta: { title: 'System Architecture' },
|
|
119
73
|
components: [
|
|
120
|
-
{ id: 'api',
|
|
121
|
-
{ id: 'web',
|
|
74
|
+
{ id: 'api', label: 'API Server', type: 'backend' },
|
|
75
|
+
{ id: 'web', label: 'Web App', type: 'frontend' }
|
|
122
76
|
],
|
|
123
77
|
connections: [
|
|
124
78
|
{ from: 'web', to: 'api', label: 'HTTPS' }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./server-Dc2XtS92.js";export{t as buildPreludeInjection,e as generatePrelude};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./server-Dc2XtS92.js";export{e as createSamplingClient};
|