@vpxa/aikit 0.1.365 → 0.1.367
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 +245 -49
- package/packages/claude-desktop/dist/manifest.json +1 -1
- package/packages/core/dist/index.d.ts +10 -3
- package/packages/core/dist/index.js +1 -1
- package/packages/embeddings/dist/index.d.ts +2 -0
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/indexer/dist/index.js +2 -2
- package/packages/present/dist/index.html +287 -91
- package/packages/server/dist/bin.js +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/prelude-BT_YGKcG.js +2 -0
- package/packages/server/dist/prelude-CHJaVPEe.js +1 -0
- package/packages/server/dist/sampling-CC7xHN-4.js +1 -0
- package/packages/server/dist/sampling-DRMRPVW6.js +2 -0
- package/packages/server/dist/{server-DUWF6mtP.js → server-B3Wy5oMX.js} +17 -4
- package/packages/server/dist/{server-Bsceh-AT.js → server-DBLXa2HM.js} +17 -4
- package/packages/server/dist/{server-http-BGcKUn5y.js → server-http-CytJq5BC.js} +1 -1
- package/packages/server/dist/{server-http-Cx4tvbmK.js → server-http-Do9kvXVq.js} +1 -1
- package/packages/server/dist/server-stdio-BJ7pjrh7.js +1 -0
- package/packages/server/dist/server-stdio-bxxYSAHg.js +2 -0
- package/packages/server/dist/version-check-CRvtGBDG.js +2 -0
- package/packages/server/dist/version-check-DNe43rCZ.js +1 -0
- package/packages/server/viewers/canvas.html +288 -92
- package/packages/server/viewers/report-template.html +258 -62
- package/packages/server/viewers/tour-viewer.html +260 -64
- package/scaffold/dist/definitions/skills/c4-architecture.mjs +1 -1
- package/scaffold/dist/definitions/skills/docs.mjs +1 -1
- package/scaffold/dist/definitions/skills/present.mjs +4 -72
- package/scaffold/dist/generated/block-docs.mjs +5 -3
- package/packages/server/dist/prelude-BgvW6Hp5.js +0 -2
- package/packages/server/dist/prelude-Di-ZDdDk.js +0 -1
- package/packages/server/dist/sampling-CFWUnzbA.js +0 -1
- package/packages/server/dist/sampling-lcC_v6KY.js +0 -2
- package/packages/server/dist/server-stdio-BmGuXkkF.js +0 -1
- package/packages/server/dist/server-stdio-C66e05P_.js +0 -2
- package/packages/server/dist/version-check-B6bui-YI.js +0 -1
- package/packages/server/dist/version-check-CZ5hY6R2.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
import{BLOCK_CATALOG as e}from"../../generated/block-docs.mjs";function t(){return[{file:`SKILL.md`,content:`---
|
|
2
2
|
name: present
|
|
3
3
|
description: "Use the AI Kit present tool for rich dashboards, charts, timelines, status boards, data tables, reviews, approvals, and interactive MCP App surfaces. Load before calling present so output uses the right block/template/action contract and stays readable."
|
|
4
4
|
metadata:
|
|
@@ -18,7 +18,7 @@ Use present for complex user-facing output: reports, dashboards, evidence maps,
|
|
|
18
18
|
## Authoring Model
|
|
19
19
|
|
|
20
20
|
Choose one:
|
|
21
|
-
- blocks: direct markdown/heading/table/chart/cards/metrics/checklist/timeline/status-board/etc.
|
|
21
|
+
- blocks: direct markdown/heading/table/chart/cards/metrics/checklist/timeline/status-board/stat-group/alert/etc.
|
|
22
22
|
- template + data: report, task-plan, review, dashboard, diff, checklist, picker, form.
|
|
23
23
|
- raw JSON: complex surfaces where hand-authored object is clearer.
|
|
24
24
|
|
|
@@ -99,75 +99,7 @@ If validation fails, fix schema shape first. Use schema/preset/template resource
|
|
|
99
99
|
Load on demand:
|
|
100
100
|
- references/block-catalog.md — Complete 32-block type catalog with value shapes, best block for each data type, and rules.
|
|
101
101
|
- references/presets-templates.md — Preset contracts (8 presets), viewer templates (7), MCP App templates (14), diagram renderers (5), and error recovery patterns.
|
|
102
|
-
`},{file:`references/block-catalog.md`,content:`#
|
|
103
|
-
|
|
104
|
-
Pass content as blocks array of { type, title?, value } objects.
|
|
105
|
-
|
|
106
|
-
## Content Blocks
|
|
107
|
-
|
|
108
|
-
| Type | Value shape | Use for |
|
|
109
|
-
|------|-------------|---------|
|
|
110
|
-
| prompt | string | Prompt or callout text |
|
|
111
|
-
| text | string | Plain text without markdown parsing |
|
|
112
|
-
| heading | string | Standalone section headings |
|
|
113
|
-
| paragraph | string | Standalone paragraph copy |
|
|
114
|
-
| markdown | string | Prose, headings, code snippets |
|
|
115
|
-
| code | string | Code or diff excerpts |
|
|
116
|
-
| list | string[] | Bullet list items |
|
|
117
|
-
| separator | none | Visual divider |
|
|
118
|
-
| diff | { files: [{ path, hunks }] } | File diffs with +/- highlights |
|
|
119
|
-
| finding | { label, description?, severity? } | Finding with severity pill |
|
|
120
|
-
|
|
121
|
-
## Data Blocks
|
|
122
|
-
|
|
123
|
-
| Type | Value shape | Use for |
|
|
124
|
-
|------|-------------|---------|
|
|
125
|
-
| table | Record[] or { headers, rows } | Tabular data |
|
|
126
|
-
| metrics | [{ label, value, trend?, status? }] | KPI cards |
|
|
127
|
-
| kv | Record<string, string> | Key-value pairs |
|
|
128
|
-
| tags | string[] | Tag pills |
|
|
129
|
-
| data-table-schema | { fields: [{ name, type, required? }] } | Schema table |
|
|
130
|
-
| chart | { chartType, data, xKey?, yKeys? } | line/area/bar/horizontal-bar/pie/donut/sparkline/heatmap |
|
|
131
|
-
|
|
132
|
-
## Visualization Blocks
|
|
133
|
-
|
|
134
|
-
| Type | Value shape | Use for |
|
|
135
|
-
|------|-------------|---------|
|
|
136
|
-
| cards | [{ title, body?, badge?, status? }] | Summary cards |
|
|
137
|
-
| tree | { name, children? } | Hierarchies |
|
|
138
|
-
| timeline | [{ title, description?, timestamp?, status? }] | Event sequences |
|
|
139
|
-
| mermaid | string | Diagrams |
|
|
140
|
-
| graph | { nodes, edges } | Network graphs |
|
|
141
|
-
| comparison | [{title, items}] or {columns} | Side-by-side comparisons |
|
|
142
|
-
| lifecycle-flow | { nodes, edges } | SVG flow diagram |
|
|
143
|
-
| component-detail | { name, type?, description? } | Component detail view |
|
|
144
|
-
|
|
145
|
-
## Interactive / Layout
|
|
146
|
-
|
|
147
|
-
| Type | Value shape | Use for |
|
|
148
|
-
|------|-------------|---------|
|
|
149
|
-
| checklist | [{ label, checked }] | Task lists |
|
|
150
|
-
| status-board | [{category, items}] | Service health |
|
|
151
|
-
| progress | {label, value, max?} | Progress bars |
|
|
152
|
-
| docs-browser | { files } | Documentation indexes |
|
|
153
|
-
| annotation | { items } | Annotation groups |
|
|
154
|
-
| approval | { options, comment? } | Approval with options/textarea |
|
|
155
|
-
| docs-hub | { title, items } | Doc hub card grid |
|
|
156
|
-
| actions | [{ type, id, label }] | Inline action group |
|
|
157
|
-
|
|
158
|
-
## Data-to-Block Quick Reference
|
|
159
|
-
|
|
160
|
-
| Your data looks like... | Use this block type |
|
|
161
|
-
|---|---|
|
|
162
|
-
| Array of strings | list or markdown |
|
|
163
|
-
| Key-value pairs | kv or table (2 columns) |
|
|
164
|
-
| Rows x columns | table |
|
|
165
|
-
| Done/not-done state | checklist |
|
|
166
|
-
| Hierarchical items | tree |
|
|
167
|
-
| Numeric KPIs | metrics |
|
|
168
|
-
| Before/after or A vs B | comparison |
|
|
169
|
-
| Findings with severity | finding |
|
|
170
|
-
`},{file:`references/presets-templates.md`,content:`# Presets, Templates, and Error Recovery
|
|
102
|
+
`},{file:`references/block-catalog.md`,content:e},{file:`references/presets-templates.md`,content:`# Presets, Templates, and Error Recovery
|
|
171
103
|
|
|
172
104
|
## 8 Named Presets
|
|
173
105
|
|
|
@@ -508,4 +440,4 @@ For RENDER_FAILED errors: data is valid but rendering failed. Simplify surface o
|
|
|
508
440
|
Use raw JSON string field for complex payloads — auto-repair handles unescaped newlines and trailing commas.
|
|
509
441
|
|
|
510
442
|
A Feedback text-submit action is automatically appended to every actions array.
|
|
511
|
-
`}]}export{
|
|
443
|
+
`}]}export{t as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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| `stat-group` | Colored stat/gauge cards with label, value, and tone. Ideal for summary counts, KPI dashboards, and status overviews. | `Array<{ label: string; value: string | number; color?: string }>` |\n| `alert` | Alert/callout box with icon, title, and body text. Tone supports: info (default), success, warning, danger, accent. | `string | { title?: string; value?: string; tone?: string; severity?: string }` |\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#### `stat-group`\n\n```typescript\n{\n type: 'stat-group',\n title: 'Status Overview',\n value: [\n { label: 'Passed', value: '42', color: 'green' },\n { label: 'Failed', value: '3', color: 'red' },\n { label: 'Pending', value: '7', color: 'yellow' },\n ],\n}\n```\n\n#### `alert`\n\n```typescript\n{\n type: 'alert',\n title: 'Critical Path — Complete',\n value: 'All delivery stages are wired end-to-end.',\n tone: 'success',\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
4
|
- type:"architecture-diagram" → value: object ({ components, connections, boundaries? })
|
|
@@ -16,6 +16,8 @@ const e="| Type | Description | Value Shape |\n|------|-------------|-----------
|
|
|
16
16
|
- type:"checklist" → value: Array<{label, checked}> | {items: Array<{label, checked}>}
|
|
17
17
|
- type:"comparison" → value: Array<{title, items}> | {columns: Array<{title, items}>}
|
|
18
18
|
- type:"status-board" → value: Array<{category, items}> | {items: Array<{category, items}>}
|
|
19
|
+
- type:"stat-group" → value: Array<{ label: string; value: string | number; color?: string }>
|
|
20
|
+
- type:"alert" → value: string | { title?: string; value?: string; tone?: string; severity?: string }
|
|
19
21
|
- type:"prompt" → value: unknown
|
|
20
22
|
- type:"progress" → value: {label, value, max?} | {items: Array<{label, value, max?, color?}>}
|
|
21
23
|
- type:"docs-browser" → value: { files: Array<{ path: string; title?: string; content?: string; status?: "current" | "stale" | "missing" }>; title?: string }
|
|
@@ -34,7 +36,7 @@ const e="| Type | Description | Value Shape |\n|------|-------------|-----------
|
|
|
34
36
|
- 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 }> }
|
|
35
37
|
- type:"annotation" → value: Array<{ id: string; type: "COMMENT" | "DELETION" | "GLOBAL_COMMENT"; body: string; author?: string; createdAt?: string }>
|
|
36
38
|
- type:"approval" → value: { prompt: string; options: Array<{ id: string; label: string; description?: string }>; requireComment?: boolean }
|
|
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 |
|
|
39
|
+
- 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='# Block Catalog — 39 Content Blocks\n\nPass content as blocks array of { type, title?, value } objects.\n\n## Content Blocks\n\n| Type | Value shape | Use for |\n|------|-------------|---------|\n| markdown | `string` | Markdown content rendered with the marked parser. |\n| code | `string` | Formatted code block rendered inside pre/code tags. |\n| alert | `string | { title?: string; value?: string; tone?: string; severity?: string }` | Alert/callout box with icon, title, and body text. Tone supports: info (default), success, warning, danger, accent. |\n| text | `string` | Plain text content rendered through the markdown parser. |\n| heading | `string` | Single heading with configurable level from h1 to h6. |\n| paragraph | `string` | Single paragraph rendered inside a p tag. |\n| diff | `string | { content: string } | { before: string; after: string }` | Diff view with +/- lines for showing changes between text. |\n| finding | `{ title?: string; severity?: string; detail?: unknown }` | Finding with severity pill showing title, severity, and detail. |\n| list | `string[]` | Bullet list items rendered as an unordered list. |\n| docs-hub | `{ title?: string; description?: string; pages?: Array<{ title: string; description?: string; href?: string; icon?: string; category?: string; status?: "draft" | "published" | "deprecated" }> }` | Doc hub card grid with titled pages, descriptions, categories, and statuses. |\n\n## Data Blocks\n\n| Type | Value shape | Use for |\n|------|-------------|---------|\n| table | `Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }` | Tabular data rendered from records or explicit headers and rows. |\n| metrics | `Array<{ label: string; value: string | number; trend?: string | number; status?: string }>` | Metric cards showing label/value pairs with optional trend and status. |\n| chart | `{ chartType: string; data: Record<string, unknown>[]; xKey: string; yKeys: string[] }` | Structured chart definition rendered as SVG. |\n| stat-group | `Array<{ label: string; value: string | number; color?: string }>` | Colored stat/gauge cards with label, value, and tone. Ideal for summary counts, KPI dashboards, and status overviews. |\n| kv | `Array<{ key: string; value: unknown }> | Record<string, unknown>` | Key-value pairs rendered as labeled entries. |\n| tags | `Array<string | { text?: string; label?: string; status?: string; tone?: string; color?: string }> | { items: Array<...> }` | Tag pills rendered with optional tone/color. |\n| data-table-schema | `{ 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 }> }` | Schema table with field names, types, constraints, and indexes. |\n\n## Visualization Blocks\n\n| Type | Value shape | Use for |\n|------|-------------|---------|\n| mermaid | `string` | Mermaid diagram source rendered in a mermaid pre block. |\n| architecture-diagram | `object ({ components, connections, boundaries? })` | Architecture diagram with positioned components, connections, and boundary groups. Produces SVG with mermaid rendering. |\n| workflow-diagram | `object ({ lanes, nodes, edges })` | Workflow/pipeline diagram with lane-based columns, typed nodes, and edges. Produces SVG with mermaid rendering. |\n| sequence-diagram | `object ({ participants, messages })` | Sequence diagram with participants and time-ordered messages. Produces SVG with mermaid rendering. |\n| dataflow-diagram | `object ({ stages, nodes, flows })` | Data flow diagram with stage-based columns, nodes, and classification-colored edges. Produces SVG with mermaid rendering. |\n| lifecycle-diagram | `object ({ lanes, states, transitions })` | Lifecycle state machine with lanes, states, and transitions. Produces SVG with mermaid rendering. |\n| cards | `Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>` | Card grid for titled items with optional body, badge, and status. |\n| tree | `{ name: string; children?: unknown[] } | Record<string, unknown>` | Hierarchical object or name/children tree rendered recursively. |\n| graph | `{ nodes: Array<{ id: string; label?: string }>; edges: Array<{ from: string; to: string; label?: string }> }` | Node and edge graph rendered as a Mermaid flow graph in HTML mode. |\n| lifecycle-flow | `{ title?: string; steps: Array<{ id: string; label: string; type?: string; status?: string; description?: string }>; edges?: Array<{ from: string; to: string; label?: string }> }` | SVG flow diagram with labeled steps, edges, and status colors. |\n| component-detail | `{ 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 }> }` | Component detail view with name, type, technology, responsibilities, interfaces, dependencies, metrics, and code links. |\n\n## Interactive / Layout\n\n| Type | Value shape | Use for |\n|------|-------------|---------|\n| timeline | `Array<{ title: string; description?: string; timestamp?: string; status?: string }>` | Timeline entries rendered as a vertical sequence of events. |\n| checklist | `Array<{label, checked}> | {items: Array<{label, checked}>}` | Checklist items with boolean checked state. |\n| comparison | `Array<{title, items}> | {columns: Array<{title, items}>}` | Side-by-side comparison columns with titled item lists. |\n| status-board | `Array<{category, items}> | {items: Array<{category, items}>}` | Status categories containing labeled status items. |\n| prompt | `unknown` | Prompt payload rendered through the prompt display helper. |\n| progress | `{label, value, max?} | {items: Array<{label, value, max?, color?}>}` | Progress bar with current value and optional maximum. |\n| docs-browser | `{ files: Array<{ path: string; title?: string; content?: string; status?: "current" | "stale" | "missing" }>; title?: string }` | Documentation file list with inline content previews for chat-safe rendering. |\n| separator | `undefined` | Horizontal rule used to separate adjacent blocks. |\n| actions | `Array<{ type: string; id: string; label: string; variant?: string; options?: Array<string | { label: string; value: string }> }>` | Action bar containing button and select action definitions. |\n| annotation | `Array<{ id: string; type: "COMMENT" | "DELETION" | "GLOBAL_COMMENT"; body: string; author?: string; createdAt?: string }>` | Annotation groups with COMMENT, DELETION, and GLOBAL_COMMENT types. |\n| approval | `{ prompt: string; options: Array<{ id: string; label: string; description?: string }>; requireComment?: boolean }` | Approval widget with radio options and optional comment textarea. |\n\n## Data-to-Block Quick Reference\n\n| Your data looks like... | Use this block type |\n|-------------------------|---------------------|\n| Array of strings | list or markdown |\n| Key-value pairs | kv or table (2 columns) |\n| Rows x columns | table |\n| Colored status counts / KPIs with labels | stat-group or metrics |\n| Status update / callout message | alert |\n| Done/not-done state | checklist |\n| Hierarchical items | tree |\n| Numeric KPIs | metrics |\n| Before/after or A vs B | comparison |\n| Findings with severity | finding |\n',r={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| `stat-group` | Colored stat/gauge cards with label, value, and tone. Ideal for summary counts, KPI dashboards, and status overviews. | `Array<{ label: string; value: string | number; color?: string }>` |\n| `alert` | Alert/callout box with icon, title, and body text. Tone supports: info (default), success, warning, danger, accent. | `string | { title?: string; value?: string; tone?: string; severity?: string }` |\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#### `stat-group`\n\n```typescript\n{\n type: 'stat-group',\n title: 'Status Overview',\n value: [\n { label: 'Passed', value: '42', color: 'green' },\n { label: 'Failed', value: '3', color: 'red' },\n { label: 'Pending', value: '7', color: 'yellow' },\n ],\n}\n```\n\n#### `alert`\n\n```typescript\n{\n type: 'alert',\n title: 'Critical Path — Complete',\n value: 'All delivery stages are wired end-to-end.',\n tone: 'success',\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 |
|
|
38
40
|
|------|-------------|-------------|
|
|
39
41
|
| \`mermaid\` | Mermaid diagram source rendered in a mermaid pre block. | \`string\` |
|
|
40
42
|
| \`architecture-diagram\` | Architecture diagram with positioned components, connections, and boundary groups. Produces SVG with mermaid rendering. | \`object ({ components, connections, boundaries? })\` |
|
|
@@ -79,4 +81,4 @@ const e="| Type | Description | Value Shape |\n|------|-------------|-----------
|
|
|
79
81
|
]
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
|
-
\`\`\``};export{e as ALL_BLOCK_DOCS,n as BLOCK_DOCS_BY_SKILL,t as BLOCK_TYPE_LIST};
|
|
84
|
+
\`\`\``};export{e as ALL_BLOCK_DOCS,n as BLOCK_CATALOG,r as BLOCK_DOCS_BY_SKILL,t as BLOCK_TYPE_LIST};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./server-Bsceh-AT.js";export{t as buildPreludeInjection,e as generatePrelude};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./server-Bsceh-AT.js";export{e as createSamplingClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./workspace-bootstrap-B57Oz40_.js";import{n as t,t as n}from"./startup-maintenance-DX1yTfBa.js";import{t as r}from"./repair-json-B6Q_HRoP.js";import{createLogger as i,serializeError as a,setDetailedErrorLoggingEnabled as o}from"../../core/dist/index.js";const s=i(`server`);var c=class{buffer;append(e){this.buffer=this.buffer?Buffer.concat([this.buffer,e]):e}readMessage(){if(!this.buffer)return null;for(let e=0;e<this.buffer.length;e++){if(this.buffer[e]!==10)continue;let t=this.buffer.toString(`utf8`,0,e).replace(/\r$/,``),n=e+1;try{let e=JSON.parse(t);return this.buffer=this.buffer.subarray(n),e}catch{try{let e=r(t);return s.warn(`JSON parse failed on MCP message — repair succeeded`,{preview:t.slice(0,80)}),this.buffer=this.buffer.subarray(n),e}catch{}}}return null}clear(){this.buffer=void 0}};async function l(r){let[{loadConfig:i,reconfigureForWorkspace:l,resolveIndexMode:u},{createLazyServer:d},{checkForUpdates:f,autoUpgradeScaffold:p},{RootsListChangedNotificationSchema:m}]=await Promise.all([import(`./config-D3rRPB9X.js`),import(`./server-Bsceh-AT.js`),import(`./version-check-B6bui-YI.js`),import(`@modelcontextprotocol/sdk/types.js`)]),h=i();o(h.logging?.errorDetails===!0),h.configError&&s.warn(`Config load failure`,{error:h.configError}),s.info(`Config loaded`,{sourceCount:h.sources.length,storePath:h.store.path}),p(),setInterval(f,1440*60*1e3).unref();let g=u(h),_=d(h,g),{server:v,startInit:y,ready:b,runInitialIndex:x}=_,{StdioServerTransport:S}=await import(`@modelcontextprotocol/sdk/server/stdio.js`),C=new S;if(typeof C._readBuffer?.readMessage!=`function`)throw Error(`Cannot install JSON repair: StdioServerTransport._readBuffer has unexpected shape`);C._readBuffer=new c,s.debug(`JSON repair installed on stdio transport`),await v.connect(C),s.debug(`MCP server started`,{transport:`stdio`}),await e({config:h,indexMode:g,log:s,rootsChangedNotificationSchema:m,reconfigureForWorkspace:l,runInitialIndex:x,server:v,startInit:y,version:r});let w=null,T=null,E=!1,D=async e=>{E||(E=!0,s.info(`Shutdown signal received`,{signal:e}),w&&=(clearTimeout(w),null),T?.stop(),await import(`../../tools/dist/index.js`).then(({processStopAll:e})=>e()).catch(()=>{}),await C.close().catch(()=>void 0),await v.close().catch(()=>void 0),_.aikit&&await Promise.all([_.aikit.embedder.shutdown?.().catch(()=>{})??Promise.resolve(),_.aikit.graphStore.close().catch(()=>{}),_.aikit.closeStateStore?.().catch(()=>{})??Promise.resolve(),_.aikit.store.close().catch(()=>{})]),process.exit(0))},O=()=>{w&&clearTimeout(w),w=setTimeout(async()=>{s.info(`Auto-shutdown: no activity for 30 minutes — releasing resources`);try{let e=_.aikit;e&&(e.embedder.shutdown?.().catch(()=>{}),e.store.releaseMemory?.(),e.graphStore.releaseMemory?.())}catch(e){s.warn(`Resource release failed during shutdown`,a(e))}},18e5),w.unref&&w.unref()};O(),process.stdin.on(`data`,()=>O()),process.stdin.on(`end`,()=>void D(`stdin-end`)),process.stdin.on(`close`,()=>void D(`stdin-close`)),process.stdin.on(`error`,()=>void D(`stdin-error`)),process.on(`SIGINT`,()=>void D(`SIGINT`)),process.on(`SIGTERM`,()=>void D(`SIGTERM`)),b.catch(e=>{s.error(`Initialization failed — server will continue with limited tools`,t(r,e))}),g===`smart`?b.then(async()=>{try{if(!_.aikit)throw Error(`AI Kit components are not available after initialization`);let{SmartIndexScheduler:e}=await import(`../../indexer/dist/index.js`),t=new e(_.aikit.indexer,h,_.aikit.store);T=t;let n=_.aikit.store;t.start(),n.onBeforeClose&&n.onBeforeClose(()=>t.stop()),_.setSmartScheduler(t),s.debug(`Smart index scheduler started (stdio mode)`)}catch(e){s.error(`Failed to start smart index scheduler`,t(r,e))}}).catch(e=>s.error(`AI Kit init failed for smart scheduler`,t(r,e))):s.warn(`Initial full indexing skipped; use aikit_reindex to index manually`,{indexMode:g}),n(b,()=>_.aikit?{curated:_.aikit.curated,stateStore:_.aikit.stateStore}:null,r)}export{l as startStdioMode};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./bin.js";import{n as t,t as n}from"./startup-maintenance-CBJWiJ7p.js";import{t as r}from"./repair-json-D4mft_HA.js";import{createLogger as i,serializeError as a,setDetailedErrorLoggingEnabled as o}from"../../core/dist/index.js";const s=i(`server`);var c=class{buffer;append(e){this.buffer=this.buffer?Buffer.concat([this.buffer,e]):e}readMessage(){if(!this.buffer)return null;for(let e=0;e<this.buffer.length;e++){if(this.buffer[e]!==10)continue;let t=this.buffer.toString(`utf8`,0,e).replace(/\r$/,``),n=e+1;try{let e=JSON.parse(t);return this.buffer=this.buffer.subarray(n),e}catch{try{let e=r(t);return s.warn(`JSON parse failed on MCP message — repair succeeded`,{preview:t.slice(0,80)}),this.buffer=this.buffer.subarray(n),e}catch{}}}return null}clear(){this.buffer=void 0}};async function l(r){let[{loadConfig:i,reconfigureForWorkspace:l,resolveIndexMode:u},{createLazyServer:d},{checkForUpdates:f,autoUpgradeScaffold:p},{RootsListChangedNotificationSchema:m}]=await Promise.all([import(`./config-B4klhHVp.js`),import(`./server-DUWF6mtP.js`),import(`./version-check-CZ5hY6R2.js`),import(`@modelcontextprotocol/sdk/types.js`)]),h=i();o(h.logging?.errorDetails===!0),h.configError&&s.warn(`Config load failure`,{error:h.configError}),s.info(`Config loaded`,{sourceCount:h.sources.length,storePath:h.store.path}),p(),setInterval(f,1440*60*1e3).unref();let g=u(h),_=d(h,g),{server:v,startInit:y,ready:b,runInitialIndex:x}=_,{StdioServerTransport:S}=await import(`@modelcontextprotocol/sdk/server/stdio.js`),C=new S;if(typeof C._readBuffer?.readMessage!=`function`)throw Error(`Cannot install JSON repair: StdioServerTransport._readBuffer has unexpected shape`);C._readBuffer=new c,s.debug(`JSON repair installed on stdio transport`),await v.connect(C),s.debug(`MCP server started`,{transport:`stdio`}),await e({config:h,indexMode:g,log:s,rootsChangedNotificationSchema:m,reconfigureForWorkspace:l,runInitialIndex:x,server:v,startInit:y,version:r});let w=null,T=null,E=!1,D=async e=>{E||(E=!0,s.info(`Shutdown signal received`,{signal:e}),w&&=(clearTimeout(w),null),T?.stop(),await import(`../../tools/dist/index.js`).then(({processStopAll:e})=>e()).catch(()=>{}),await C.close().catch(()=>void 0),await v.close().catch(()=>void 0),_.aikit&&await Promise.all([_.aikit.embedder.shutdown?.().catch(()=>{})??Promise.resolve(),_.aikit.graphStore.close().catch(()=>{}),_.aikit.closeStateStore?.().catch(()=>{})??Promise.resolve(),_.aikit.store.close().catch(()=>{})]),process.exit(0))},O=()=>{w&&clearTimeout(w),w=setTimeout(async()=>{s.info(`Auto-shutdown: no activity for 30 minutes — releasing resources`);try{let e=_.aikit;e&&(e.embedder.shutdown?.().catch(()=>{}),e.store.releaseMemory?.(),e.graphStore.releaseMemory?.())}catch(e){s.warn(`Resource release failed during shutdown`,a(e))}},18e5),w.unref&&w.unref()};O(),process.stdin.on(`data`,()=>O()),process.stdin.on(`end`,()=>void D(`stdin-end`)),process.stdin.on(`close`,()=>void D(`stdin-close`)),process.stdin.on(`error`,()=>void D(`stdin-error`)),process.on(`SIGINT`,()=>void D(`SIGINT`)),process.on(`SIGTERM`,()=>void D(`SIGTERM`)),b.catch(e=>{s.error(`Initialization failed — server will continue with limited tools`,t(r,e))}),g===`smart`?b.then(async()=>{try{if(!_.aikit)throw Error(`AI Kit components are not available after initialization`);let{SmartIndexScheduler:e}=await import(`../../indexer/dist/index.js`),t=new e(_.aikit.indexer,h,_.aikit.store);T=t;let n=_.aikit.store;t.start(),n.onBeforeClose&&n.onBeforeClose(()=>t.stop()),_.setSmartScheduler(t),s.debug(`Smart index scheduler started (stdio mode)`)}catch(e){s.error(`Failed to start smart index scheduler`,t(r,e))}}).catch(e=>s.error(`AI Kit init failed for smart scheduler`,t(r,e))):s.warn(`Initial full indexing skipped; use aikit_reindex to index manually`,{indexMode:g}),n(b,()=>_.aikit?{curated:_.aikit.curated,stateStore:_.aikit.stateStore}:null,r)}export{l as startStdioMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fileURLToPath as e}from"node:url";import{INSTALL_ARGS as t,cleanupOldVersions as n,createLogger as r,safeCwd as i}from"../../core/dist/index.js";import{existsSync as a,mkdirSync as o,readFileSync as s,renameSync as c,rmSync as l,writeFileSync as u}from"node:fs";import{dirname as d,join as f,resolve as p}from"node:path";import{execFile as m,execSync as h,spawn as g}from"node:child_process";import{homedir as _}from"node:os";const v=`@vpxa/aikit`,y=`https://registry.npmjs.org/${v}/latest`,b=r(`server`);function x(){let t=d(e(import.meta.url));return[p(t,`..`,`..`,`..`,`bin`,`aikit.mjs`),p(t,`..`,`bin`,`aikit.mjs`),...process.argv[1]?[p(d(process.argv[1]),`aikit.mjs`)]:[]].find(e=>a(e))??null}const S=f(_(),`.aikit`),C=f(S,`current-version.json`),w=f(S,`versions`),T=/^\d+\.\d+\.\d+(-[\w.+]+)?(\+[\w.]+)?$/;function E(e){if(!T.test(e))throw Error(`Invalid semver version: ${JSON.stringify(e)}`)}function D(){let t=p(d(e(import.meta.url)),`..`,`..`,`..`,`package.json`);try{return JSON.parse(s(t,`utf-8`)).version??`0.0.0`}catch{return`0.0.0`}}function O(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t>0?1:-1}return 0}function k(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){if((n[e]??0)>(r[e]??0))return!0;if((n[e]??0)<(r[e]??0))return!1}return!1}async function A(e){E(e);let n=`v${e}`,r=f(w,`${n}-staging`),i=f(w,n);try{a(r)&&l(r,{recursive:!0,force:!0}),o(r,{recursive:!0}),h(`tar -xzf "${h(`npm pack ${v}@${e} 2>${process.platform===`win32`?`NUL`:`/dev/null`}`,{cwd:r,encoding:`utf-8`,timeout:6e4,windowsHide:!0}).trim()}"`,{cwd:r,encoding:`utf-8`,stdio:`pipe`,timeout:3e4,windowsHide:!0});let n=f(r,`package`);h(`npm ${t.join(` `)}`,{cwd:n,encoding:`utf-8`,stdio:`pipe`,timeout:12e4,windowsHide:!0});let s=f(n,`packages`,`server`,`dist`,`bin.js`);if(!a(s))throw Error(`Server entry not found at ${s}`);if(!a(f(n,`node_modules`)))throw Error(`node_modules not found — npm install may have failed`);a(i)&&l(i,{recursive:!0,force:!0}),c(n,i);let d=`${C}.tmp`;u(d,JSON.stringify({version:e,installedAt:new Date().toISOString()},null,2)),c(d,C),M(e)}finally{a(r)&&l(r,{recursive:!0,force:!0})}}function j(e){b.debug(`Updated to v${e}. Restarting server...`),setTimeout(()=>{process.exit(0)},300).unref()}function M(e){n(w,e??D())}async function N(){try{let e=s(C,`utf-8`),{version:t}=JSON.parse(e),n=await fetch(y,{signal:AbortSignal.timeout(1e4)});if(!n.ok)return;let r=(await n.json()).version;if(!r||r===t||!k(r,t))return;if(a(f(w,`v${r}`))){let e=`${C}.tmp`;u(e,JSON.stringify({version:r,installedAt:new Date().toISOString()},null,2)),c(e,C),b.debug(`Re-activated existing version v${r} — no download needed`),j(r);return}b.debug(`New version available: ${r}. Installing...`),await A(r),j(r)}catch(e){b.error(`Background update check failed: ${e instanceof Error?e.message:String(e)}`)}}let P=null;function F(){return P||(P=I().finally(()=>{P=null}),P)}async function I(){if(a(C)){await N();return}let e=D();try{let t=await fetch(y,{signal:AbortSignal.timeout(1e4)});if(!t.ok)return;let n=(await t.json()).version;if(!n)return;if(O(e,n)<0){b.debug(`Newer version available — installing`,{currentVersion:e,latestVersion:n});try{await A(n),j(n)}catch(e){b.warn(`Auto-install failed`,{error:e instanceof Error?e.message:String(e),latestVersion:n})}}}catch{}}function L(){try{let e=p(_(),`.copilot`,`.aikit-scaffold.json`);return a(e)?JSON.parse(s(e,`utf-8`)).version??null:null}catch{return null}}function R(){try{let e=i();if(!e)return null;let t=p(e,`.github`,`.aikit-scaffold.json`);return a(t)?JSON.parse(s(t,`utf-8`)).version??null:null}catch{return null}}let z=`idle`,B=null,V=null,H=!1;function U(){return{state:z,error:B}}function W(){z=`idle`,B=null}function G(){try{let e=D();if(F(),!H){H=!0;try{let e=x();e&&g(process.execPath,[e,`migrate-launcher`],{cwd:_(),stdio:`ignore`,timeout:15e3,windowsHide:!0}).unref()}catch{}}let t=L(),n=R();if(!(t!=null&&t!==e)&&!(n!=null&&n!==e)||(V!==e&&(W(),V=e),z!==`idle`))return;z=`pending`,B=null,b.debug(`Scaffold version mismatch — auto-upgrading`,{serverVersion:e,userScaffoldVersion:t,workspaceScaffoldVersion:n});let r=x();if(!r){z=`failed`,B=`aikit CLI binary not found`,b.warn(`Cannot auto-upgrade: aikit CLI binary not found`);return}let i=_();m(process.execPath,[r,`upgrade`],{cwd:i,timeout:3e4,windowsHide:!0},(t,n,a)=>{t?(z=`failed`,B=t.message,b.warn(`Auto-upgrade failed`,{error:t.message,stack:t.stack,code:t.code,stdout:n?.slice(0,500),stderr:a?.slice(0,500),cwd:i,binPath:r,platform:process.platform})):(z=`success`,B=null,b.debug(`Auto-upgrade completed to version ${e}`))}).unref()}catch(e){z=`failed`,B=e instanceof Error?e.message:String(e),b.warn(`Auto-upgrade check failed`,{error:B})}}export{G as autoUpgradeScaffold,F as checkForUpdates,M as cleanupOldVersions,D as getCurrentVersion,U as getUpgradeState};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{fileURLToPath as e}from"node:url";import{INSTALL_ARGS as t,cleanupOldVersions as n,createLogger as r,safeCwd as i}from"../../core/dist/index.js";import{existsSync as a,mkdirSync as o,readFileSync as s,renameSync as c,rmSync as l,writeFileSync as u}from"node:fs";import{dirname as d,join as f,resolve as p}from"node:path";import{homedir as m}from"node:os";import{execFile as h,execSync as g,spawn as _}from"node:child_process";const v=`@vpxa/aikit`,y=`https://registry.npmjs.org/${v}/latest`,b=r(`server`);function x(){let t=d(e(import.meta.url));return[p(t,`..`,`..`,`..`,`bin`,`aikit.mjs`),p(t,`..`,`bin`,`aikit.mjs`),...process.argv[1]?[p(d(process.argv[1]),`aikit.mjs`)]:[]].find(e=>a(e))??null}const S=f(m(),`.aikit`),C=f(S,`current-version.json`),w=f(S,`versions`),T=/^\d+\.\d+\.\d+(-[\w.+]+)?(\+[\w.]+)?$/;function E(e){if(!T.test(e))throw Error(`Invalid semver version: ${JSON.stringify(e)}`)}function D(){let t=p(d(e(import.meta.url)),`..`,`..`,`..`,`package.json`);try{return JSON.parse(s(t,`utf-8`)).version??`0.0.0`}catch{return`0.0.0`}}function O(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t>0?1:-1}return 0}function k(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++){if((n[e]??0)>(r[e]??0))return!0;if((n[e]??0)<(r[e]??0))return!1}return!1}async function A(e){E(e);let n=`v${e}`,r=f(w,`${n}-staging`),i=f(w,n);try{a(r)&&l(r,{recursive:!0,force:!0}),o(r,{recursive:!0}),g(`tar -xzf "${g(`npm pack ${v}@${e} 2>${process.platform===`win32`?`NUL`:`/dev/null`}`,{cwd:r,encoding:`utf-8`,timeout:6e4,windowsHide:!0}).trim()}"`,{cwd:r,encoding:`utf-8`,stdio:`pipe`,timeout:3e4,windowsHide:!0});let n=f(r,`package`);g(`npm ${t.join(` `)}`,{cwd:n,encoding:`utf-8`,stdio:`pipe`,timeout:12e4,windowsHide:!0});let s=f(n,`packages`,`server`,`dist`,`bin.js`);if(!a(s))throw Error(`Server entry not found at ${s}`);if(!a(f(n,`node_modules`)))throw Error(`node_modules not found — npm install may have failed`);a(i)&&l(i,{recursive:!0,force:!0}),c(n,i);let d=`${C}.tmp`;u(d,JSON.stringify({version:e,installedAt:new Date().toISOString()},null,2)),c(d,C),M(e)}finally{a(r)&&l(r,{recursive:!0,force:!0})}}function j(e){b.debug(`Updated to v${e}. Restarting server...`),setTimeout(()=>{process.exit(0)},300).unref()}function M(e){n(w,e??D())}async function N(){try{let e=s(C,`utf-8`),{version:t}=JSON.parse(e),n=await fetch(y,{signal:AbortSignal.timeout(1e4)});if(!n.ok)return;let r=(await n.json()).version;if(!r||r===t||!k(r,t))return;if(a(f(w,`v${r}`))){let e=`${C}.tmp`;u(e,JSON.stringify({version:r,installedAt:new Date().toISOString()},null,2)),c(e,C),b.debug(`Re-activated existing version v${r} — no download needed`),j(r);return}b.debug(`New version available: ${r}. Installing...`),await A(r),j(r)}catch(e){b.error(`Background update check failed: ${e instanceof Error?e.message:String(e)}`)}}let P=null;function F(){return P||(P=I().finally(()=>{P=null}),P)}async function I(){if(a(C)){await N();return}let e=D();try{let t=await fetch(y,{signal:AbortSignal.timeout(1e4)});if(!t.ok)return;let n=(await t.json()).version;if(!n)return;if(O(e,n)<0){b.debug(`Newer version available — installing`,{currentVersion:e,latestVersion:n});try{await A(n),j(n)}catch(e){b.warn(`Auto-install failed`,{error:e instanceof Error?e.message:String(e),latestVersion:n})}}}catch{}}function L(){try{let e=p(m(),`.copilot`,`.aikit-scaffold.json`);return a(e)?JSON.parse(s(e,`utf-8`)).version??null:null}catch{return null}}function R(){try{let e=i();if(!e)return null;let t=p(e,`.github`,`.aikit-scaffold.json`);return a(t)?JSON.parse(s(t,`utf-8`)).version??null:null}catch{return null}}let z=`idle`,B=null,V=null,H=!1;function U(){return{state:z,error:B}}function W(){z=`idle`,B=null}function G(){try{let e=D();if(F(),!H){H=!0;try{let e=x();e&&_(process.execPath,[e,`migrate-launcher`],{cwd:m(),stdio:`ignore`,timeout:15e3,windowsHide:!0}).unref()}catch{}}let t=L(),n=R();if(!(t!=null&&t!==e)&&!(n!=null&&n!==e)||(V!==e&&(W(),V=e),z!==`idle`))return;z=`pending`,B=null,b.debug(`Scaffold version mismatch — auto-upgrading`,{serverVersion:e,userScaffoldVersion:t,workspaceScaffoldVersion:n});let r=x();if(!r){z=`failed`,B=`aikit CLI binary not found`,b.warn(`Cannot auto-upgrade: aikit CLI binary not found`);return}let i=m();h(process.execPath,[r,`upgrade`],{cwd:i,timeout:3e4,windowsHide:!0},(t,n,a)=>{t?(z=`failed`,B=t.message,b.warn(`Auto-upgrade failed`,{error:t.message,stack:t.stack,code:t.code,stdout:n?.slice(0,500),stderr:a?.slice(0,500),cwd:i,binPath:r,platform:process.platform})):(z=`success`,B=null,b.debug(`Auto-upgrade completed to version ${e}`))}).unref()}catch(e){z=`failed`,B=e instanceof Error?e.message:String(e),b.warn(`Auto-upgrade check failed`,{error:B})}}export{G as autoUpgradeScaffold,F as checkForUpdates,M as cleanupOldVersions,D as getCurrentVersion,U as getUpgradeState};
|