@vpxa/aikit 0.1.127 → 0.1.129
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/aikit-client/dist/index.js +2 -2
- package/packages/analyzers/dist/index.js +1 -1
- package/packages/chunker/dist/index.d.ts +26 -1
- package/packages/chunker/dist/index.js +6 -6
- package/packages/cli/dist/index.js +3 -3
- package/packages/cli/dist/{init-BOydG2Kn.js → init-BaoAINTV.js} +4 -4
- package/packages/cli/dist/scaffold-DLYsn1Qg.js +2 -0
- package/packages/cli/dist/user-B4T28cUl.js +6 -0
- package/packages/core/dist/index.js +1 -1
- package/packages/dashboard/dist/assets/{index-CxrC6OtB.js → index-CULYiVQu.js} +2 -2
- package/packages/dashboard/dist/index.html +1 -1
- package/packages/embeddings/dist/index.d.ts +14 -0
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/enterprise-bridge/dist/index.js +1 -1
- package/packages/flows/dist/index.js +2 -2
- package/packages/indexer/dist/index.js +1 -1
- package/packages/present/dist/index.html +323 -298
- package/packages/server/dist/{curated-manager-CXSPygmJ.js → curated-manager-BkSgtNC2.js} +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/{server-C9WbXuAi.js → server-GAK3m_Kn.js} +223 -205
- package/packages/settings-ui/dist/assets/{index-BlJqzH2g.js → index-DSTxXokO.js} +2 -2
- package/scaffold/dist/adapters/skills.mjs +1 -1
- package/scaffold/dist/definitions/prompts.mjs +126 -1
- package/scaffold/dist/definitions/skills/c4-architecture.mjs +26 -2
- package/scaffold/dist/definitions/skills/docs.mjs +7 -3
- package/scaffold/dist/definitions/skills/present.mjs +3 -47
- package/scaffold/dist/generated/block-docs.mjs +81 -0
- package/scaffold/generated/block-docs.mjs +13 -0
- package/packages/cli/dist/rolldown-runtime-BbypZo7q.js +0 -1
- package/packages/cli/dist/scaffold--Z8D_CTu.js +0 -2
- package/packages/cli/dist/user-B4yBNdYR.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function e({blockDocs:e}={}){return[{file:`SKILL.md`,content:`---
|
|
2
2
|
name: present
|
|
3
3
|
description: "Use the AI Kit \`present\` tool to display rich interactive dashboards, charts, timelines, status boards, and data visualizations in the browser or in-chat. Covers all block types, chart types, actions, composition patterns, and MCP Apps templates (list-sort, data-table, picker, flame-graph, form, timeline, kanban, tree, diff-view, dashboard). Load this skill before calling the present tool to ensure professional output."
|
|
4
4
|
metadata:
|
|
@@ -61,51 +61,7 @@ openBrowserPage({ url: "http://127.0.0.1:{port}" }) // Playwright MCP - opens UR
|
|
|
61
61
|
|
|
62
62
|
Content is an array of **typed blocks**. Each block has \`{ type, title?, value }\`. All blocks compose into a single unified page — use multiple blocks for sections.
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
| Type | Value Shape | Renders As |
|
|
67
|
-
|------|------------|------------|
|
|
68
|
-
| \`markdown\` | \`string\` (markdown text) | Rendered HTML with full GFM support |
|
|
69
|
-
| \`code\` | \`string\` (source code) | Syntax-highlighted code block |
|
|
70
|
-
| \`mermaid\` | \`string\` (mermaid syntax) | Interactive diagram |
|
|
71
|
-
| \`table\` | \`Array<Record<string, unknown>>\` | Sortable/filterable table |
|
|
72
|
-
| \`metrics\` | \`Array<{ label, value }>\` | KPI metric cards grid |
|
|
73
|
-
| \`cards\` | \`Array<{ title, body, badge? }>\` | Card grid layout |
|
|
74
|
-
| \`tree\` | \`Record<string, unknown>\` | Expandable tree view |
|
|
75
|
-
| \`graph\` | \`{ nodes: [], edges: [] }\` | Mermaid graph diagram |
|
|
76
|
-
|
|
77
|
-
### Chart Block
|
|
78
|
-
|
|
79
|
-
\`\`\`json
|
|
80
|
-
{
|
|
81
|
-
"type": "chart",
|
|
82
|
-
"title": "Revenue Trend",
|
|
83
|
-
"value": {
|
|
84
|
-
"chartType": "line",
|
|
85
|
-
"data": [{"month": "Jan", "revenue": 1200}, {"month": "Feb", "revenue": 1800}],
|
|
86
|
-
"xKey": "month",
|
|
87
|
-
"yKeys": ["revenue"],
|
|
88
|
-
"showLegend": true,
|
|
89
|
-
"showGrid": true,
|
|
90
|
-
"height": 300
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
\`\`\`
|
|
94
|
-
|
|
95
|
-
**Chart types:** \`line\`, \`area\`, \`bar\`, \`horizontal-bar\`, \`pie\`, \`donut\`, \`sparkline\`, \`heatmap\`
|
|
96
|
-
|
|
97
|
-
> **⚠️ Chart Format**: Always use the ChartValue format shown above (\`chartType\`, \`data\`, \`xKey\`, \`yKeys\`). Do **NOT** use Chart.js format (\`labels\`, \`datasets\`) — while it will be auto-converted, the native ChartValue format is required for reliable rendering.
|
|
98
|
-
|
|
99
|
-
### New Block Types
|
|
100
|
-
|
|
101
|
-
| Type | Value Shape | Renders As |
|
|
102
|
-
|------|------------|------------|
|
|
103
|
-
| \`timeline\` | \`{ items: [{ phase?, title, description?, status? }] }\` | Vertical timeline with status dots (done/active/pending/error) |
|
|
104
|
-
| \`checklist\` | \`{ items: [{ label, checked?, note? }] }\` | Interactive checklist with checkmarks |
|
|
105
|
-
| \`comparison\` | \`{ columns: [{ title, items: [string] }] }\` | Side-by-side comparison grid |
|
|
106
|
-
| \`status-board\` | \`{ items: [{ label, status, detail? }] }\` | Status indicator rows (success/warning/error/info/pending) |
|
|
107
|
-
| \`prompt\` | \`{ question, context?, placeholder? }\` | Highlighted question/prompt block |
|
|
108
|
-
| \`progress\` | \`{ items: [{ label, value, max? }] }\` | Progress bars with percentages |
|
|
64
|
+
${e?.bySkill?.present||``}
|
|
109
65
|
|
|
110
66
|
---
|
|
111
67
|
|
|
@@ -614,4 +570,4 @@ Metric types: \`'stat'\` (default), \`'progress'\` (with bar), \`'list'\` (sub-i
|
|
|
614
570
|
| tree | Display only | — |
|
|
615
571
|
| diff-view | Display only | — |
|
|
616
572
|
| dashboard | Display only | — |
|
|
617
|
-
`}]
|
|
573
|
+
`}]}export{e as default};
|
|
@@ -0,0 +1,81 @@
|
|
|
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| `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| `viewer-link` | Styled card linking to a standalone interactive viewer. | `{ viewerType: string; label: string; description?: string; url?: string; icon?: string }` |\n| `docs-browser` | Collapsible file tree with markdown content for documentation browsing. | `{ 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\n### Usage Examples\n\n#### `viewer-link`\n\n```typescript\n{\n type: 'viewer-link',\n value: {\n viewerType: 'c4',\n label: 'Open Interactive C4 Diagram',\n description: 'Drag, zoom, and pan with ELK auto-layout',\n icon: '🏗️',\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
|
+
- type:"code" → value: string
|
|
3
|
+
- type:"mermaid" → value: string
|
|
4
|
+
- type:"table" → value: Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }
|
|
5
|
+
- type:"metrics" → value: Array<{ label: string; value: string | number; trend?: string | number; status?: string }>
|
|
6
|
+
- type:"cards" → value: Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>
|
|
7
|
+
- type:"tree" → value: { name: string; children?: unknown[] } | Record<string, unknown>
|
|
8
|
+
- type:"graph" → value: { nodes: Array<{ id: string; label?: string }>; edges: Array<{ from: string; to: string; label?: string }> }
|
|
9
|
+
- type:"chart" → value: { chartType: string; data: Record<string, unknown>[]; xKey: string; yKeys: string[] }
|
|
10
|
+
- type:"timeline" → value: Array<{ title: string; description?: string; timestamp?: string; status?: string }>
|
|
11
|
+
- type:"checklist" → value: Array<{label, checked}> | {items: Array<{label, checked}>}
|
|
12
|
+
- type:"comparison" → value: Array<{title, items}> | {columns: Array<{title, items}>}
|
|
13
|
+
- type:"status-board" → value: Array<{category, items}> | {items: Array<{category, items}>}
|
|
14
|
+
- type:"prompt" → value: unknown
|
|
15
|
+
- type:"progress" → value: {label, value, max?} | {items: Array<{label, value, max?, color?}>}
|
|
16
|
+
- type:"viewer-link" → value: { viewerType: string; label: string; description?: string; url?: string; icon?: string }
|
|
17
|
+
- type:"docs-browser" → value: { files: Array<{ path: string; title?: string; content?: string; status?: "current" | "stale" | "missing" }>; title?: string }
|
|
18
|
+
- type:"text" → value: string
|
|
19
|
+
- type:"heading" → value: string
|
|
20
|
+
- type:"paragraph" → value: string
|
|
21
|
+
- type:"separator" → value: undefined
|
|
22
|
+
- type:"actions" → value: Array<{ type: string; id: string; label: string; variant?: string; options?: Array<string | { label: string; value: string }> }>`,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| `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| `viewer-link` | Styled card linking to a standalone interactive viewer. | `{ viewerType: string; label: string; description?: string; url?: string; icon?: string }` |\n| `docs-browser` | Collapsible file tree with markdown content for documentation browsing. | `{ files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }` |\n\n### Usage Examples\n\n#### `viewer-link`\n\n```typescript\n{\n type: 'viewer-link',\n value: {\n viewerType: 'c4',\n label: 'Open Interactive C4 Diagram',\n description: 'Drag, zoom, and pan with ELK auto-layout',\n icon: '🏗️',\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 |
|
|
23
|
+
|------|-------------|-------------|
|
|
24
|
+
| \`markdown\` | Markdown content rendered with the marked parser. | \`string\` |
|
|
25
|
+
| \`code\` | Formatted code block rendered inside pre/code tags. | \`string\` |
|
|
26
|
+
| \`mermaid\` | Mermaid diagram source rendered in a mermaid pre block. | \`string\` |
|
|
27
|
+
| \`table\` | Tabular data rendered from records or explicit headers and rows. | \`Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }\` |
|
|
28
|
+
| \`cards\` | Card grid for titled items with optional body, badge, and status. | \`Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>\` |
|
|
29
|
+
| \`viewer-link\` | Styled card linking to a standalone interactive viewer. | \`{ viewerType: string; label: string; description?: string; url?: string; icon?: string }\` |
|
|
30
|
+
| \`docs-browser\` | Collapsible file tree with markdown content for documentation browsing. | \`{ files: Array<{ path: string; title?: string; content?: string; status?: "current" | "stale" | "missing" }>; title?: string }\` |
|
|
31
|
+
|
|
32
|
+
### Usage Examples
|
|
33
|
+
|
|
34
|
+
#### \`viewer-link\`
|
|
35
|
+
|
|
36
|
+
\`\`\`typescript
|
|
37
|
+
{
|
|
38
|
+
type: 'viewer-link',
|
|
39
|
+
value: {
|
|
40
|
+
viewerType: 'c4',
|
|
41
|
+
label: 'Open Interactive C4 Diagram',
|
|
42
|
+
description: 'Drag, zoom, and pan with ELK auto-layout',
|
|
43
|
+
icon: '🏗️',
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
#### \`docs-browser\`
|
|
49
|
+
|
|
50
|
+
\`\`\`typescript
|
|
51
|
+
{
|
|
52
|
+
type: 'docs-browser',
|
|
53
|
+
value: {
|
|
54
|
+
title: 'Project Docs',
|
|
55
|
+
files: [
|
|
56
|
+
{ path: 'docs/README.md', title: 'Overview', status: 'current' },
|
|
57
|
+
{ path: 'docs/api.md', title: 'API Reference', status: 'stale' },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
\`\`\``,"c4-architecture":`| Type | Description | Value Shape |
|
|
62
|
+
|------|-------------|-------------|
|
|
63
|
+
| \`mermaid\` | Mermaid diagram source rendered in a mermaid pre block. | \`string\` |
|
|
64
|
+
| \`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 }> }\` |
|
|
65
|
+
| \`viewer-link\` | Styled card linking to a standalone interactive viewer. | \`{ viewerType: string; label: string; description?: string; url?: string; icon?: string }\` |
|
|
66
|
+
|
|
67
|
+
### Usage Examples
|
|
68
|
+
|
|
69
|
+
#### \`viewer-link\`
|
|
70
|
+
|
|
71
|
+
\`\`\`typescript
|
|
72
|
+
{
|
|
73
|
+
type: 'viewer-link',
|
|
74
|
+
value: {
|
|
75
|
+
viewerType: 'c4',
|
|
76
|
+
label: 'Open Interactive C4 Diagram',
|
|
77
|
+
description: 'Drag, zoom, and pan with ELK auto-layout',
|
|
78
|
+
icon: '🏗️',
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
\`\`\``};export{e as ALL_BLOCK_DOCS,n as BLOCK_DOCS_BY_SKILL,t as BLOCK_TYPE_LIST};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// AUTO-GENERATED - do not edit manually.
|
|
2
|
+
// Source: packages/server/src/tools/present/block-registry.ts
|
|
3
|
+
// Generated at: 2026-05-09T23:23:08.325Z
|
|
4
|
+
|
|
5
|
+
export const ALL_BLOCK_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| `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| `viewer-link` | Styled card linking to a standalone interactive viewer. | `{ viewerType: string; label: string; description?: string; url?: string; icon?: string }` |\n| `docs-browser` | Collapsible file tree with markdown content for documentation browsing. | `{ 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\n### Usage Examples\n\n#### `viewer-link`\n\n```typescript\n{\n type: 'viewer-link',\n value: {\n viewerType: 'c4',\n label: 'Open Interactive C4 Diagram',\n description: 'Drag, zoom, and pan with ELK auto-layout',\n icon: '🏗️',\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```";
|
|
6
|
+
|
|
7
|
+
export const BLOCK_TYPE_LIST = " - type:\"markdown\" → value: string\n - type:\"code\" → value: string\n - type:\"mermaid\" → value: string\n - type:\"table\" → value: Record<string, unknown>[] | { headers: string[]; rows: unknown[][] }\n - type:\"metrics\" → value: Array<{ label: string; value: string | number; trend?: string | number; status?: string }>\n - type:\"cards\" → value: Array<{ title: string; body?: string; badge?: string; status?: string; description?: string }>\n - type:\"tree\" → value: { name: string; children?: unknown[] } | Record<string, unknown>\n - type:\"graph\" → value: { nodes: Array<{ id: string; label?: string }>; edges: Array<{ from: string; to: string; label?: string }> }\n - type:\"chart\" → value: { chartType: string; data: Record<string, unknown>[]; xKey: string; yKeys: string[] }\n - type:\"timeline\" → value: Array<{ title: string; description?: string; timestamp?: string; status?: string }>\n - type:\"checklist\" → value: Array<{label, checked}> | {items: Array<{label, checked}>}\n - type:\"comparison\" → value: Array<{title, items}> | {columns: Array<{title, items}>}\n - type:\"status-board\" → value: Array<{category, items}> | {items: Array<{category, items}>}\n - type:\"prompt\" → value: unknown\n - type:\"progress\" → value: {label, value, max?} | {items: Array<{label, value, max?, color?}>}\n - type:\"viewer-link\" → value: { viewerType: string; label: string; description?: string; url?: string; icon?: string }\n - type:\"docs-browser\" → value: { files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }\n - type:\"text\" → value: string\n - type:\"heading\" → value: string\n - type:\"paragraph\" → value: string\n - type:\"separator\" → value: undefined\n - type:\"actions\" → value: Array<{ type: string; id: string; label: string; variant?: string; options?: Array<string | { label: string; value: string }> }>";
|
|
8
|
+
|
|
9
|
+
export const BLOCK_DOCS_BY_SKILL = {
|
|
10
|
+
"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| `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| `viewer-link` | Styled card linking to a standalone interactive viewer. | `{ viewerType: string; label: string; description?: string; url?: string; icon?: string }` |\n| `docs-browser` | Collapsible file tree with markdown content for documentation browsing. | `{ files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }` |\n\n### Usage Examples\n\n#### `viewer-link`\n\n```typescript\n{\n type: 'viewer-link',\n value: {\n viewerType: 'c4',\n label: 'Open Interactive C4 Diagram',\n description: 'Drag, zoom, and pan with ELK auto-layout',\n icon: '🏗️',\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```",
|
|
11
|
+
"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| `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| `viewer-link` | Styled card linking to a standalone interactive viewer. | `{ viewerType: string; label: string; description?: string; url?: string; icon?: string }` |\n| `docs-browser` | Collapsible file tree with markdown content for documentation browsing. | `{ files: Array<{ path: string; title?: string; content?: string; status?: \"current\" | \"stale\" | \"missing\" }>; title?: string }` |\n\n### Usage Examples\n\n#### `viewer-link`\n\n```typescript\n{\n type: 'viewer-link',\n value: {\n viewerType: 'c4',\n label: 'Open Interactive C4 Diagram',\n description: 'Drag, zoom, and pan with ELK auto-layout',\n icon: '🏗️',\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```",
|
|
12
|
+
"c4-architecture": "| Type | Description | Value Shape |\n|------|-------------|-------------|\n| `mermaid` | Mermaid diagram source rendered in a mermaid pre block. | `string` |\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| `viewer-link` | Styled card linking to a standalone interactive viewer. | `{ viewerType: string; label: string; description?: string; url?: string; icon?: string }` |\n\n### Usage Examples\n\n#### `viewer-link`\n\n```typescript\n{\n type: 'viewer-link',\n value: {\n viewerType: 'c4',\n label: 'Open Interactive C4 Diagram',\n description: 'Drag, zoom, and pan with ELK auto-layout',\n icon: '🏗️',\n },\n}\n```"
|
|
13
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};export{t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-BbypZo7q.js";import{existsSync as t,mkdirSync as n,readFileSync as r,rmSync as i,unlinkSync as a,writeFileSync as o}from"node:fs";import{dirname as s,resolve as c}from"node:path";import{pathToFileURL as l}from"node:url";import{createHash as u}from"node:crypto";function d(e){return u(`sha256`).update(e).digest(`hex`).slice(0,16)}function f(e){if(!t(e))return null;try{let t=r(e,`utf-8`),n=JSON.parse(t);return!n.version||!n.files?null:n}catch{return null}}function p(e,t){o(e,`${JSON.stringify(t,null,2)}\n`,`utf-8`)}function m(e){return e.endsWith(`.agent.md`)&&!e.startsWith(`_shared/`)&&!e.startsWith(`agents/_shared/`)&&!e.startsWith(`templates/`)||e.endsWith(`SKILL.md`)&&!e.startsWith(`_shared/`)&&!e.startsWith(`templates/`)?`merge-frontmatter`:`overwrite`}function h(e,t,n){if(!e)return`new`;let r=e.files[t];return r?r.sourceHash===d(n)?`current`:`outdated`:`new`}function g(e,t,n,r){e.files[t]={sourceHash:d(n),strategy:r??m(t),updatedAt:new Date().toISOString()}}function _(e){return{version:e,generatedAt:new Date().toISOString(),files:{}}}const v=[`inputs`,`outputs`,`requires`,`relatedSkills`],y=[`model`],b=[`category`,`domain`,`applicability`],x=new Set([`__proto__`,`constructor`,`prototype`]);function S(e,t){return e.metadata[t]??e.fields[t]}function C(e,t){let n=S(e,t);return n?T(n):[]}function w(e){let t=Object.create(null),n=Object.create(null),r=[],i=e,a=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!a)return{fields:t,metadata:n,tools:r,body:i};let o=a[1];i=a[2];let s=!1;for(let e of o.split(/\r?\n/)){if(s){if(e.trim()===``)continue;let t=e.match(/^\s{2,}(\S+?):\s*(.*)$/);if(t){let[,e,r]=t;if(x.has(e))continue;n[e]=r;continue}s=!1}let i=e.match(/^(\S+?):\s*(.*)$/);if(!i)continue;let[,a,o]=i;if(a===`metadata`&&o.trim()===``){s=!0;continue}x.has(a)||(t[a]=o,a===`tools`&&(r=T(o)))}return{fields:t,metadata:n,tools:r,body:i}}function T(e){let t=e.trim();if(!t.startsWith(`[`)||!t.endsWith(`]`))return[];let n=t.slice(1,-1).trim();return n?n.split(`,`).map(e=>e.trim()).filter(Boolean):[]}function E(e){return`[${e.join(`, `)}]`}function D(e,t){let n=w(e),r=w(t),i={...n.fields},a={...n.metadata};for(let[e,t]of Object.entries(r.metadata))e in a||(a[e]=t);for(let e of y)r.fields[e]&&(i[e]=r.fields[e]);for(let e of b){let t=S(r,e);t&&(a[e]=t)}for(let e of[...b,...v])delete i[e];delete i.metadata;let o=n.tools,s=r.tools,c=new Set(o),l=s.filter(e=>!c.has(e)),u=[...o,...l];u.length>0&&(i.tools=E(u));for(let e of v){let t=C(n,e),i=C(r,e),o=new Set(t),s=i.filter(e=>!o.has(e)),c=[...t,...s];c.length>0?a[e]=E(c):delete a[e]}let d=[`---`],f=[`name`,`description`,`argument-hint`,`tools`,`model`],p=[`category`,`domain`,`applicability`,`inputs`,`outputs`,`requires`,`relatedSkills`],m=new Set;for(let e of f)e in i&&(d.push(`${e}: ${i[e]}`),m.add(e));for(let[e,t]of Object.entries(i))m.has(e)||d.push(`${e}: ${t}`);let h=[],g=new Set;for(let e of p){let t=a[e];t&&(h.push(` ${e}: ${t}`),g.add(e))}for(let[e,t]of Object.entries(a))!g.has(e)&&t&&h.push(` ${e}: ${t}`);return h.length>0&&(d.push(`metadata:`),d.push(...h)),d.push(`---`),`${d.join(`
|
|
2
|
-
`)}\n${n.body}`}var O=e({guideFlows:()=>L,guideScaffold:()=>P,guideSkills:()=>F,loadAdapter:()=>k,smartCopyFlows:()=>I,smartCopyFromMemory:()=>A,smartCopyScaffold:()=>M,smartCopySkills:()=>N});async function k(e,t){let n=await import(l(c(e,`scaffold`,`dist`,`adapters`,`${t}.mjs`)).href),r=n[`generate${t.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}`]??n.generate??n.default;if(typeof r!=`function`)throw Error(`Adapter ${t} does not export a generate function`);return r()}function A(e,i,a,l,u=!1){n(i,{recursive:!0});for(let d of e){let e=l?`${l}/${d.path}`:d.path,f=c(i,d.path);if(u){n(s(f),{recursive:!0}),o(f,d.content,`utf-8`),g(a,e,d.content);continue}let p=h(a,e,d.content);if(p!==`current`){if(p===`new`&&!t(f)){n(s(f),{recursive:!0}),o(f,d.content,`utf-8`),g(a,e,d.content);continue}if(p===`new`&&t(f)){g(a,e,d.content);continue}if(m(e)===`merge-frontmatter`&&t(f)){let e=r(f,`utf-8`);o(f,D(d.content,e),`utf-8`)}else n(s(f),{recursive:!0}),o(f,d.content,`utf-8`);g(a,e,d.content)}}u&&j(i,a,l,new Set(e.map(e=>l?`${l}/${e.path}`:e.path)))}function j(e,n,r,i){let o=[];for(let s of Object.keys(n.files)){if(!s.startsWith(`${r}/`)||i.has(s))continue;let l=c(e,s.slice(r.length+1));t(l)&&(a(l),o.push(s)),delete n.files[s]}return o}async function M(e,t,n=`copilot`,r,i=!1){let a=await k(t,n),o=a.some(e=>e.path.startsWith(`.`)),s=o?e:c(e,`.github`),l=c(s,`.aikit-scaffold.json`),u=f(l)??_(r);u.version=r;let d=new Map;for(let e of a){let t=e.path.indexOf(`/`);if(t===-1){let t=d.get(``)??[];t.push({path:e.path,content:e.content}),d.set(``,t);continue}let n=e.path.substring(0,t),r=e.path.substring(t+1),i=d.get(n)??[];i.push({path:r,content:e.content}),d.set(n,i)}for(let[e,t]of d)A(t,e?c(s,e):s,u,o?`${n}/${e||`.`}`:e||`.`,i);p(l,u)}async function N(e,t,n,r,i=!1){let a=c(e,`.github`),o=c(a,`.aikit-scaffold.json`),s=f(o)??_(r);s.version=r;let l=await k(t,`skills`),u=new Map;for(let e of l){let t=e.path.indexOf(`/`);if(t===-1)continue;let n=e.path.substring(0,t),r=e.path.substring(t+1),i=u.get(n)??[];i.push({path:r,content:e.content}),u.set(n,i)}for(let[e,t]of u)A(t,c(a,`skills`,e),s,`skills/${e}`,i);p(o,s)}async function P(e,n,i=`copilot`){let a=[],o=await k(n,i),s=o.some(e=>e.path.startsWith(`.`))?e:c(e,`.github`);for(let e of o){let n=c(s,e.path);if(!t(n))a.push({status:`new`,relativePath:e.path,sourcePath:``,content:e.content});else{let t=r(n,`utf-8`);e.content===t?a.push({status:`current`,relativePath:e.path,sourcePath:``}):a.push({status:`outdated`,relativePath:e.path,sourcePath:``,content:e.content})}}return a}async function F(e,n,i){let a=[],o=await k(n,`skills`),s=c(e,`.github`);for(let e of o){let n=`skills/${e.path}`,i=c(s,`skills`,e.path);if(!t(i))a.push({status:`new`,relativePath:n,sourcePath:``,content:e.content});else{let t=r(i,`utf-8`);e.content===t?a.push({status:`current`,relativePath:n,sourcePath:``}):a.push({status:`outdated`,relativePath:n,sourcePath:``,content:e.content})}}return a}async function I(e,n,r,a,o=!1){let s=c(e,`.github`),l=c(s,`.aikit-scaffold.json`),u=f(l)??_(a);u.version=a;let d=await k(n,`flows`),m=new Set,h=new Map;for(let e of d){let t=e.path.indexOf(`/`);if(t===-1)continue;let n=e.path.substring(0,t);m.add(n);let r=e.path.substring(t+1),i=h.get(n)??[];i.push({path:r,content:e.content}),h.set(n,i)}for(let e of m){let n=c(s,`flows`,e,`skills`);t(n)&&i(n,{recursive:!0,force:!0})}for(let[e,t]of h)A(t,c(s,`flows`,e),u,`flows/${e}`,o);p(l,u)}async function L(e,n,i){let a=[],o=await k(n,`flows`),s=c(e,`.github`);for(let e of o){let n=`flows/${e.path}`,i=c(s,`flows`,e.path);if(!t(i))a.push({status:`new`,relativePath:n,sourcePath:``,content:e.content});else{let t=r(i,`utf-8`);e.content===t?a.push({status:`current`,relativePath:n,sourcePath:``}):a.push({status:`outdated`,relativePath:n,sourcePath:``,content:e.content})}}return a}export{O as a,M as c,f as d,p as f,k as i,N as l,P as n,I as o,F as r,A as s,L as t,_ as u};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-BbypZo7q.js";import{a as t,i as n,n as r,s as i,t as a}from"./templates-CKn2AmTo.js";import{d as o,f as s,i as c,s as l,u}from"./scaffold--Z8D_CTu.js";import{existsSync as d,mkdirSync as f,readFileSync as p,readdirSync as m,rmSync as ee,unlinkSync as h,writeFileSync as g}from"node:fs";import{dirname as _,join as v,posix as y,resolve as b,win32 as x}from"node:path";import{fileURLToPath as S}from"node:url";import{mkdir as C,readFile as w,rename as T,unlink as E,writeFile as D}from"node:fs/promises";import{randomUUID as O}from"node:crypto";import{homedir as k}from"node:os";import{execFileSync as A}from"node:child_process";import{getGlobalDataDir as j,saveRegistry as M}from"../../core/dist/index.js";function N(e){let t=``,n=0,r=e.length;for(;n<r;)if(e[n]===`"`){for(t+=`"`,n++;n<r&&e[n]!==`"`;)e[n]===`\\`&&(t+=e[n++]),n<r&&(t+=e[n++]);n<r&&(t+=e[n++])}else if(e[n]===`/`&&n+1<r&&e[n+1]===`/`)for(n+=2;n<r&&e[n]!==`
|
|
2
|
-
`;)n++;else if(e[n]===`/`&&n+1<r&&e[n+1]===`*`){for(n+=2;n+1<r&&!(e[n]===`*`&&e[n+1]===`/`);)n++;n+=2}else t+=e[n++];return t.replace(/,(\s*[}\]])/g,`$1`)}var P=class{isPlatformSupported(){return this.platforms.includes(process.platform)}async readConfig(e){let t=this.getConfigPath(e);if(!d(t))return{};let n=await w(t,`utf-8`);try{return JSON.parse(N(n))}catch{throw Error(`Invalid JSON in ${t}. Please fix or remove the file before retrying.`)}}async writeConfig(e,t){let n=this.getConfigPath(t),r=_(n),i=v(r,`.aikit-tmp-${O()}.json`);await C(r,{recursive:!0});try{await D(i,`${JSON.stringify(e,null,2)}\n`,`utf-8`),await T(i,n)}catch(e){try{await E(i)}catch{}throw e}}async registerMcp(e,t,n){let r=await this.readConfig(n);r[this.configKey]||(r[this.configKey]={}),r[this.configKey][e]=t,await this.writeConfig(r,n)}async unregisterMcp(e,t){let n=await this.readConfig(t);n[this.configKey]&&(delete n[this.configKey][e],await this.writeConfig(n,t))}getScaffoldRoot(e){return null}getInstructionsRoot(e){return null}getScaffoldPaths(e){return{agents:null,skills:null,prompts:null,flows:null,commands:null,instructions:null,manifest:null}}buildInstructionContent(e,t){return`${e}\n---\n\n${t}`}},F=class extends P{id=`claude-code`;name=`Claude Code`;family=`claude`;platforms=[`win32`,`darwin`,`linux`];scope=`user`;configKey=`mcpServers`;async detect(){return this.isPlatformSupported()?d(this.getPathModule().resolve(k(),`.claude`)):!1}getConfigPath(){return this.getPathModule().resolve(k(),`.claude`,`mcp.json`)}getScaffoldRoot(){return this.getPathModule().resolve(k(),`.claude`)}getScaffoldPaths(){let e=this.getPathModule(),t=e.resolve(k(),`.claude`);return{agents:e.resolve(t,`agents`),skills:e.resolve(t,`skills`),prompts:null,flows:e.resolve(t,`flows`),commands:e.resolve(t,`commands`),instructions:e.resolve(t,`CLAUDE.md`),manifest:e.resolve(t,`.aikit-scaffold.json`)}}buildInstructionContent(e,t){return`${e}\n---\n\n${t}`}getPathModule(){return process.platform===`win32`?x:y}},I=class extends P{id=`codex-cli`;name=`Codex CLI`;family=`codex`;platforms=[`win32`,`darwin`,`linux`];scope=`user`;configKey=`mcpServers`;async detect(){return this.isPlatformSupported()?d(this.getPathModule().resolve(k(),`.codex`)):!1}getConfigPath(){return this.getPathModule().resolve(k(),`.codex`,`config.json`)}getScaffoldRoot(){return this.getPathModule().resolve(k(),`.codex`)}getScaffoldPaths(){let e=this.getPathModule(),t=e.resolve(k(),`.codex`);return{agents:e.resolve(t,`agents`),skills:e.resolve(t,`skills`),prompts:null,flows:e.resolve(t,`flows`),commands:null,instructions:e.resolve(t,`AGENTS.md`),manifest:e.resolve(t,`.aikit-scaffold.json`)}}getPathModule(){return process.platform===`win32`?x:y}},L=class extends P{family=`copilot`;platforms=[`win32`,`darwin`,`linux`];scope=`user`;hasInstructions=!1;async detect(){if(!this.isPlatformSupported())return!1;let e=this.getConfigDir();if(process.platform===`darwin`){let t=this.getMacAppPath();return d(e)||t!==null&&d(t)}return d(e)}getConfigPath(){return this.getPathModule().resolve(this.getConfigDir(),`mcp.json`)}getScaffoldRoot(){return this.getPathModule().resolve(k(),this.scaffoldBase)}getInstructionsRoot(){let e=this.getInstructionFilePath();return e?this.getPathModule().dirname(e):null}getScaffoldPaths(){let e=this.getPathModule(),t=e.resolve(k(),this.scaffoldBase);return{agents:e.resolve(t,`agents`),skills:e.resolve(t,`skills`),prompts:e.resolve(this.getConfigDir(),`prompts`),flows:e.resolve(t,`flows`),commands:null,instructions:this.getInstructionFilePath(),manifest:e.resolve(t,`.aikit-scaffold.json`)}}getConfigDir(){let e=this.getPathModule(),t=k();if(process.platform===`win32`){let n=process.env.APPDATA??e.resolve(t,`AppData`,`Roaming`);return e.resolve(n,this.configDirName,`User`)}if(process.platform===`darwin`)return e.resolve(t,`Library`,`Application Support`,this.configDirName,`User`);let n=process.env.XDG_CONFIG_HOME??e.resolve(t,`.config`);return e.resolve(n,this.configDirName,`User`)}getMacAppPath(){return null}getInstructionFilePath(){return null}getPathModule(){return process.platform===`win32`?x:y}},R=class extends P{id=`copilot-cli`;name=`Copilot CLI`;family=`copilot`;platforms=[`win32`,`darwin`,`linux`];scope=`user`;configKey=`mcpServers`;async detect(){return this.isPlatformSupported()?d(b(k(),`.copilot`)):!1}getConfigPath(){return b(k(),`.copilot`,`mcp-config.json`)}async registerMcp(e,t,n){let r={...t,tools:[`*`]},i=await this.readConfig(n);i[this.configKey]||(i[this.configKey]={}),i[this.configKey][e]=r,await this.writeConfig(i,n)}getScaffoldRoot(){return b(k(),`.copilot`)}getInstructionsRoot(){return null}getScaffoldPaths(){let e=b(k(),`.copilot`);return{agents:b(e,`agents`),skills:b(e,`skills`),prompts:null,flows:b(e,`flows`),commands:null,instructions:b(k(),`.github`,`copilot-instructions.md`),manifest:b(e,`.aikit-scaffold.json`)}}},z=class extends L{id=`cursor`;name=`Cursor`;configKey=`mcpServers`;configDirName=`Cursor`;scaffoldBase=`.cursor`;getMacAppPath(){return`/Applications/Cursor.app`}getInstructionFilePath(){return this.getPathModule().resolve(k(),this.scaffoldBase,`rules`,`aikit.mdc`)}},B=class extends L{id=`cursor-nightly`;name=`Cursor Nightly`;configKey=`mcpServers`;configDirName=`Cursor Nightly`;scaffoldBase=`.cursor`;getMacAppPath(){return`/Applications/Cursor Nightly.app`}getInstructionFilePath(){return this.getPathModule().resolve(k(),this.scaffoldBase,`rules`,`aikit.mdc`)}},V=class e extends P{id=`intellij`;name=`IntelliJ IDEA`;family=`copilot`;platforms=[`win32`,`darwin`,`linux`];scope=`user`;configKey=`servers`;static PRODUCTS=[`IntelliJIdea`,`IdeaIC`,`WebStorm`,`PyCharm`,`PyCharmCE`,`GoLand`,`PhpStorm`,`CLion`,`Rider`,`RubyMine`,`RustRover`,`DataGrip`];async detect(){if(!this.isPlatformSupported())return!1;if(d(this.getCopilotConfigDir()))return!0;let t=this.getJetBrainsBaseDir();if(!d(t))return!1;try{return m(t,{withFileTypes:!0}).some(t=>t.isDirectory()&&e.PRODUCTS.some(e=>t.name.startsWith(e)))}catch{return!1}}getConfigPath(){return b(this.getCopilotConfigDir(),`mcp.json`)}async registerMcp(e,t,n){let r=this.getCopilotConfigDir();await C(r,{recursive:!0});let i=t.args??[],a=i.indexOf(`-e`),o;if(a!==-1&&a+1<i.length){let t=i[a+1],n=b(r,`${e}-launcher.js`);await D(n,t,`utf-8`),o=[...i.slice(0,a),n,...i.slice(a+2)]}else o=[...i];let s={type:`stdio`,...t,args:o};await super.registerMcp(e,s,n)}getScaffoldRoot(e){return null}getInstructionsRoot(e){return null}getScaffoldPaths(e){return{agents:null,skills:null,prompts:null,flows:null,commands:null,instructions:null,manifest:null}}buildInstructionContent(e,t){return t}getCopilotConfigDir(){let e=k();return process.platform===`win32`?b(process.env.LOCALAPPDATA??b(e,`AppData`,`Local`),`github-copilot`,`intellij`):process.platform===`darwin`?b(e,`Library`,`Application Support`,`github-copilot`,`intellij`):b(process.env.XDG_CONFIG_HOME??b(e,`.config`),`github-copilot`,`intellij`)}getJetBrainsBaseDir(){let e=k();return process.platform===`win32`?b(process.env.APPDATA??b(e,`AppData`,`Roaming`),`JetBrains`):process.platform===`darwin`?b(e,`Library`,`Application Support`,`JetBrains`):b(process.env.XDG_CONFIG_HOME??b(e,`.config`),`JetBrains`)}},H=class extends L{id=`trae`;name=`Trae`;configKey=`servers`;configDirName=`Trae`;scaffoldBase=`.trae`;getMacAppPath(){return`/Applications/Trae.app`}getInstructionFilePath(){return this.getPathModule().resolve(k(),this.scaffoldBase,`rules`,`aikit.md`)}},U=class extends L{id=`vscode`;name=`VS Code`;configKey=`servers`;configDirName=`Code`;scaffoldBase=`.copilot`;hasInstructions=!0;getMacAppPath(){return`/Applications/Visual Studio Code.app`}getInstructionFilePath(){return this.hasInstructions?this.getPathModule().resolve(k(),this.scaffoldBase,`instructions`,`copilot-instructions.md`):null}buildInstructionContent(e,t){return`---\napplyTo: "**"\n---\n\n${e}\n---\n\n${t}`}},W=class extends L{id=`vscode-insiders`;name=`VS Code Insiders`;configKey=`servers`;configDirName=`Code - Insiders`;scaffoldBase=`.copilot`;hasInstructions=!0;getMacAppPath(){return`/Applications/Visual Studio Code - Insiders.app`}getInstructionFilePath(){return this.hasInstructions?this.getPathModule().resolve(k(),this.scaffoldBase,`instructions`,`copilot-instructions.md`):null}buildInstructionContent(e,t){return`---\napplyTo: "**"\n---\n\n${e}\n---\n\n${t}`}},G=class extends L{id=`vscodium`;name=`VSCodium`;configKey=`servers`;configDirName=`VSCodium`;scaffoldBase=`.copilot`;hasInstructions=!0;getMacAppPath(){return`/Applications/VSCodium.app`}getInstructionFilePath(){return this.hasInstructions?this.getPathModule().resolve(k(),this.scaffoldBase,`instructions`,`copilot-instructions.md`):null}buildInstructionContent(e,t){return`---\napplyTo: "**"\n---\n\n${e}\n---\n\n${t}`}},K=class extends L{id=`windsurf`;name=`Windsurf`;configKey=`servers`;configDirName=`Windsurf`;scaffoldBase=`.windsurf`;getMacAppPath(){return`/Applications/Windsurf.app`}getInstructionFilePath(){return this.getPathModule().resolve(k(),this.scaffoldBase,`rules`,`aikit.md`)}},q=class extends P{id=`gemini-cli`;name=`Gemini CLI`;family=`gemini`;platforms=[`win32`,`darwin`,`linux`];scope=`user`;configKey=`mcpServers`;async detect(){return this.isPlatformSupported()?d(this.getPathModule().resolve(k(),`.gemini`)):!1}getConfigPath(){return this.getPathModule().resolve(k(),`.gemini`,`settings.json`)}getScaffoldRoot(){return this.getPathModule().resolve(k(),`.gemini`)}getScaffoldPaths(){let e=this.getPathModule(),t=e.resolve(k(),`.gemini`);return{agents:e.resolve(t,`agents`),skills:e.resolve(t,`skills`),prompts:null,flows:e.resolve(t,`flows`),commands:null,instructions:e.resolve(t,`AGENTS.md`),manifest:e.resolve(t,`.aikit-scaffold.json`)}}getPathModule(){return process.platform===`win32`?x:y}},te=class extends P{id=`zed`;name=`Zed`;family=`zed`;platforms=[`win32`,`darwin`,`linux`];scope=`user`;configKey=`context_servers`;async detect(){return this.isPlatformSupported()?d(this.getConfigDir()):!1}getConfigPath(){return this.getPathModule().resolve(this.getConfigDir(),`settings.json`)}async registerMcp(e,t){let{type:n,...r}=t,i={...r,env:r.env??{}};await super.registerMcp(e,i)}getScaffoldRoot(){return this.getConfigDir()}getScaffoldPaths(){let e=this.getPathModule(),t=this.getConfigDir();return{agents:e.resolve(t,`prompts`),skills:null,prompts:e.resolve(t,`prompts`),flows:null,commands:null,instructions:null,manifest:e.resolve(t,`.aikit-scaffold.json`)}}getConfigDir(){let e=this.getPathModule();return process.platform===`win32`?e.resolve(process.env.APPDATA||k(),`Zed`):e.resolve(k(),`.config`,`zed`)}getPathModule(){return process.platform===`win32`?x:y}};const J=[new U,new W,new G,new z,new B,new K,new H,new R,new V,new F,new q,new I,new te];function ne(){return[...J]}async function Y(e){let t=e?.scope?J.filter(t=>t.scope===e.scope):J;return(await Promise.allSettled(t.map(async e=>await e.detect()?e:null))).flatMap(e=>e.status!==`fulfilled`||e.value===null?[]:[e.value])}var re=e({initUser:()=>oe,installGlobalScaffold:()=>$,resolveMcpServerEntry:()=>X,writeVscodeSettings:()=>Q});function ie(e){let t=e;for(let e=0;e<10;e++){try{let e=v(t,`package.json`);if(d(e)&&JSON.parse(p(e,`utf8`)).name===`@vpxa/aikit`)return t}catch{}let e=_(t);if(e===t)break;t=e}return b(e,`..`,`..`,`..`)}function X(){let e={command:n.command,args:n.args?[...n.args]:void 0,type:n.type};if(process.platform!==`win32`){let t=process.env.PATH;t&&(e.env={PATH:t});try{let t=A(`which`,[`node`],{encoding:`utf-8`,timeout:3e3}).trim();t&&d(t)&&(e.command=t)}catch{}}return e}const Z=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`]);function Q(e,t=!1){if(!Z.has(e.name))return;let n=b(_(e.getConfigPath()),`settings.json`),r={};if(d(n))try{let e=p(n,`utf-8`);r=JSON.parse(e)}catch{console.log(` ${e.name}: skipped settings.json (invalid JSON)`);return}let a=!1;for(let[e,n]of Object.entries(i))if(typeof n==`object`&&n){let t=typeof r[e]==`object`&&r[e]!==null?r[e]:{},i={...t,...n};JSON.stringify(i)!==JSON.stringify(t)&&(r[e]=i,a=!0)}else (t||!(e in r))&&(r[e]=n,a=!0);a&&(g(n,`${JSON.stringify(r,null,2)}\n`,`utf-8`),console.log(` ${e.name}: updated settings.json`))}async function $(e,t,n,i,p=!1){let m=new Map;for(let e of t)e.getScaffoldRoot()!==null&&m.set(e.id,e);if(t.some(e=>Z.has(e.name))){let e=ne().find(e=>e.id===`copilot-cli`);e&&m.set(e.id,e)}if(m.size===0){console.log(` No IDEs with global scaffold support detected.`);return}let h=await c(e,`copilot`),v=new Map;for(let e of h){let t=e.path.indexOf(`/`);if(t===-1)continue;let n=e.path.substring(0,t);if(n!==`agents`&&n!==`prompts`)continue;let r=v.get(n)??[];r.push({path:e.path.substring(t+1),content:e.content}),v.set(n,r)}let y=await c(e,`skills`),x=new Set;for(let e of y){let t=e.path.indexOf(`/`);t!==-1&&x.add(e.path.substring(0,t))}let S=await c(e,`flows`),C=new Set;for(let e of S){let t=e.path.indexOf(`/`);t!==-1&&C.add(e.path.substring(0,t))}let w=await c(e,`claude-code`),T=new Set,E=new Set,D=new Set,O=(e,t,n)=>{let r=v.get(n);if(!e||!t||!r||r.length===0)return;let a=`${n}:${t}:${e}`;if(T.has(a))return;T.add(a);let c=o(t)??u(i);c.version=i,l(r,e,c,n,p),s(t,c),D.add(_(t))},k=(e,t,n,r)=>{if(!e||!t||r.length===0)return;let a=`${n}:${t}:${e}`;if(T.has(a))return;if(T.add(a),n===`flows`&&!E.has(e)){for(let n of C){let r=b(e,n,`skills`);d(r)&&(ee(r,{recursive:!0,force:!0}),console.log(` ${_(t)}: migrated ${n} flow to steps/ layout`))}E.add(e)}let c=o(t)??u(i);c.version=i,l(r,e,c,n,p),s(t,c),D.add(_(t))};for(let e of m.values()){let t=e.getScaffoldPaths();O(t.agents,t.manifest,`agents`),O(t.prompts,t.manifest,`prompts`),k(t.skills,t.manifest,`skills`,y),k(t.flows,t.manifest,`flows`,S),k(t.commands,t.manifest,`commands`,w)}for(let e of D)console.log(` ${e}: scaffold updated (${x.size} skills)`);let A=new Set,j=r(`aikit`,n),M=a(`aikit`,n);for(let e of m.values()){let t=e.getScaffoldPaths().instructions;!t||A.has(t)||(f(_(t),{recursive:!0}),g(t,e.buildInstructionContent(j,M),`utf-8`),A.add(t))}A.size>0&&console.log(` Instruction files: ${[...A].join(`, `)}`)}function ae(e){let t=[];for(let n of e){let e=n.getScaffoldRoot();if(e)if(Z.has(n.name)){let r=n.getInstructionsRoot()??e;t.push(b(r,`kb.instructions.md`)),t.push(b(r,`aikit.instructions.md`))}else n.name===`Cursor`||n.name===`Cursor Nightly`?t.push(b(e,`rules`,`kb.mdc`)):n.name===`Windsurf`&&t.push(b(e,`rules`,`kb.md`))}for(let e of t)d(e)&&(h(e),console.log(` Removed legacy file: ${e}`))}async function oe(e){let n=t,r=ie(_(S(import.meta.url))),i=JSON.parse(p(b(r,`package.json`),`utf-8`)).version;console.log(`Initializing @vpxa/aikit v${i}...\n`);let a=j();f(a,{recursive:!0}),console.log(` Global data store: ${a}`),M({version:1,workspaces:{}}),console.log(` Created registry.json`);let o=await Y({scope:`user`});if(o.length===0)console.log(`
|
|
3
|
-
No supported IDEs detected. You can manually add the MCP server config.`);else{console.log(`\n Detected ${o.length} IDE(s):`);let t=X();for(let e of o)try{await e.registerMcp(n,t),console.log(` ${e.name}: configured ${n}`)}catch(t){console.log(` ${e.name}: failed to configure (${t.message})`)}for(let t of o)Q(t,e.force)}console.log(`
|
|
4
|
-
Installing scaffold files:`),await $(r,o,n,i,e.force),ae(o),console.log(`
|
|
5
|
-
User-level AI Kit installation complete!`),console.log(`
|
|
6
|
-
Next steps:`),console.log(` 1. Open any workspace in your IDE`),console.log(` 2. The AI Kit server will auto-start and index the workspace`),console.log(` 3. Agents, prompts, skills & instructions are available globally`),console.log(` 4. No per-workspace init needed — just open a project and start coding`)}export{Y as a,Q as i,X as n,re as r,$ as t};
|