@vpxa/aikit 0.1.222 → 0.1.224

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.
@@ -1,11 +1,11 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{CLAUDE_MODELS as a}from"../definitions/models.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{PROTOCOLS as s}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as c,CLAUDE_CODE_TOOL_MAP as l,IDE_CAPABILITIES as u}from"../definitions/tools.mjs";import{buildAgentTable as d,buildCompactAgentTable as f,buildHooksSection as p,buildMcpConfigJson as m,buildSkillsSection as h,lowerFirst as g}from"./_shared.mjs";import{generateHooks as _}from"./hooks.mjs";const v=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
2
- `),y=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
3
- `),b=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
4
- `);function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function S(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function C(e){let t=(u[e]||[]).flatMap(e=>l[e]||[]),n=c.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function w(e,t){let n=[];return n.push(`# aikit ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
5
- `)}function T(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function E(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&s[e.sharedBase]&&t.push(s[e.sharedBase]);for(let n of e.sharedProtocols||[])s[n]&&t.push(s[n]);return t}function D(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function O(e){return D().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
6
- `)}function k(t=d(e,a)){return[`# aikit — Claude Code Agents`,``,"This workspace keeps the root `CLAUDE.md` intentionally small. Full agent instructions are split into per-agent files under `.claude/agents/`.",``,`## MCP Server`,``,"Server name: `aikit`","Configured in `.mcp.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,O(`.claude/agents`),``,`## Commands`,``,"Slash commands live under `.claude/commands/`.",``,`## Session Protocol`,``,p(n),``].join(`
7
- `)}function A(){return[`# aikit — Claude Code Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Full sub-agent instructions live in `.claude/agents/`.","Slash commands live in `.claude/commands/`.","MCP server config lives in `.mcp.json`.",``,"Start with `AGENTS.md`, then open the specific sub-agent file you want to use.",``].join(`
8
- `)}function j(e,t,n,r){let i=C(t.toolRole),a=E(t),o=h(t.skills),s=e===`Orchestrator`?[v,y]:[b],c=[n,...a,t.bodyAddendum,o,...s].filter(Boolean).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{HOOKS as n}from"../definitions/hooks.mjs";import{MCP_SERVER_ENTRY as r,SERVER_NAME as i}from"../definitions/mcp.mjs";import{CLAUDE_MODELS as a}from"../definitions/models.mjs";import{PROMPTS as o}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as s,PLATFORM_OUTPUT_RULES_SECTION as c,PROTOCOLS as l}from"../definitions/protocols.mjs";import{AIKIT_TOOLS as u,CLAUDE_CODE_TOOL_MAP as d,IDE_CAPABILITIES as f}from"../definitions/tools.mjs";import{buildAgentTable as p,buildCompactAgentTable as m,buildHooksSection as h,buildMcpConfigJson as g,buildSkillsSection as _,lowerFirst as v}from"./_shared.mjs";import{generateHooks as y}from"./hooks.mjs";const b=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
2
+ `),x=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
3
+ `),S=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
4
+ `);function C(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function w(e){return`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function T(e){let t=(f[e]||[]).flatMap(e=>d[e]||[]),n=u.map(e=>`mcp__aikit__${e}`);return[...new Set([...t,...n])].sort((e,t)=>e.localeCompare(t))}function E(e,t){let n=[];return n.push(`# aikit ${e}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(t.content.trim()),n.push(``),n.join(`
5
+ `)}function D(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function O(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&l[e.sharedBase]&&t.push(l[e.sharedBase]);for(let n of e.sharedProtocols||[])l[n]&&t.push(l[n]);return t}function k(){let t=[];for(let[n,r]of Object.entries(e)){if(r.variants){for(let[e,i]of Object.entries(r.variants))t.push({name:`${n}-${e}`,description:i.description||r.description});continue}t.push({name:n,description:r.description})}return t}function A(e){return k().map(({name:t,description:n})=>`- \`${e}/${t}.md\` — ${n}`).join(`
6
+ `)}function j(t=p(e,a)){return[`# aikit — Claude Code Agents`,``,"This workspace keeps the root `CLAUDE.md` intentionally small. Full agent instructions are split into per-agent files under `.claude/agents/`.",``,c,``,s,``,`## MCP Server`,``,"Server name: `aikit`","Configured in `.mcp.json` (already done if scaffold was deployed).",``,`## Agents`,``,t,``,`## Agent Files`,``,A(`.claude/agents`),``,`## Commands`,``,"Slash commands live under `.claude/commands/`.",``,`## Session Protocol`,``,h(n),``].join(`
7
+ `)}function M(){return[`# aikit — Claude Code Instructions`,``,"Detailed workspace instructions live in `AGENTS.md`.","Full sub-agent instructions live in `.claude/agents/`.","Slash commands live in `.claude/commands/`.","MCP server config lives in `.mcp.json`.",``,"Start with `AGENTS.md`, then open the specific sub-agent file you want to use.",``,c,``,s,``].join(`
8
+ `)}function N(e,t,n,r){let i=T(t.toolRole),a=O(t),o=_(t.skills),s=e===`Orchestrator`?[b,x]:[S],c=[n,...a,t.bodyAddendum,o,...s].filter(Boolean).join(`
9
9
 
10
- `).trim(),l=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${g(t.description)}.`,u=[`---`,`name: ${x(e)}`,`description: ${S(t.description)}`,`allowedTools:`,...i.map(e=>` - ${e}`),`---`,``,`# ${e} - ${t.title||e}`,``,l];return c&&u.push(``,c),u.push(``),u.join(`
11
- `)}function M(){let t=[],n=d(e,a),s=f(e);t.push({path:`.mcp.json`,content:`${m({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`}),t.push({path:`CLAUDE.md`,content:A()}),t.push({path:`AGENTS.md`,content:k(n)});let c=_(`claude`,`~/.copilot/hooks/scripts`);t.push(...c.map(e=>({path:e.path,content:e.content})));for(let[e,n]of Object.entries(o))t.push({path:`.claude/commands/aikit-${e}.md`,content:w(e,n)});for(let[r,i]of Object.entries(e)){let e=T(r,s);if(i.variants){for(let[a,o]of Object.entries(i.variants)){let s=`${r}-${a}`;t.push({path:`.claude/agents/${s}.md`,content:j(s,{...i,description:o.description||i.description,identity:o.identity,bodyAddendum:o.bodyAddendum},e,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:j(r,i,e,n)})}return t}export{v as CLAUDE_FLOWS_SECTION,y as CLAUDE_ORCHESTRATOR_FLOW_ROUTING_SECTION,M as generateClaudeCode};
10
+ `).trim(),l=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${v(t.description)}.`,u=[`---`,`name: ${C(e)}`,`description: ${w(t.description)}`,`allowedTools:`,...i.map(e=>` - ${e}`),`---`,``,`# ${e} - ${t.title||e}`,``,l];return c&&u.push(``,c),u.push(``),u.join(`
11
+ `)}function P(){let t=[],n=p(e,a),s=m(e);t.push({path:`.mcp.json`,content:`${g({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`}),t.push({path:`CLAUDE.md`,content:M()}),t.push({path:`AGENTS.md`,content:j(n)});let c=y(`claude`,`~/.copilot/hooks/scripts`);t.push(...c.map(e=>({path:e.path,content:e.content})));for(let[e,n]of Object.entries(o))t.push({path:`.claude/commands/aikit-${e}.md`,content:E(e,n)});for(let[r,i]of Object.entries(e)){let e=D(r,s);if(i.variants){for(let[a,o]of Object.entries(i.variants)){let s=`${r}-${a}`;t.push({path:`.claude/agents/${s}.md`,content:N(s,{...i,description:o.description||i.description,identity:o.identity,bodyAddendum:o.bodyAddendum},e,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:N(r,i,e,n)})}return t}export{b as CLAUDE_FLOWS_SECTION,x as CLAUDE_ORCHESTRATOR_FLOW_ROUTING_SECTION,P as generateClaudeCode};
@@ -1,46 +1,46 @@
1
- import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{COPILOT_MODELS as n,VARIANT_GROUPS as r}from"../definitions/models.mjs";import{PROMPTS as i}from"../definitions/prompts.mjs";import{PROTOCOLS as a,TEMPLATES as o}from"../definitions/protocols.mjs";import{IDE_CAPABILITIES as s}from"../definitions/tools.mjs";import{buildCompactAgentTable as c}from"./_shared.mjs";import{generateHooks as l,getHookScriptFiles as u}from"./hooks.mjs";const d={terminal:`execute/runInTerminal`,problems:`read/problems`,readFile:`read/readFile`,lastCommand:`read/terminalLastCommand`,subagent:`agent/runSubagent`,createFile:`edit/createFile`,editFiles:`edit/editFiles`,rename:`edit/rename`,createDirectory:`edit/createDirectory`,search:`search/changes, search/codebase, search/usages`,web:`web/fetch, web/githubRepo`,todo:`todo`,memory:`vscode/memory`,newWorkspace:`vscode/newWorkspace`,reviewPlan:`vscode/reviewPlan`,askQuestions:`vscode/askQuestions`,resolveMemoryFileUri:`vscode/resolveMemoryFileUri`,runCommand:`vscode/runCommand`,switchAgent:`vscode/switchAgent`,killTerminal:`execute/killTerminal`,createTask:`execute/createAndRunTask`,terminalSel:`read/terminalSelection`,fileSearch:`search/fileSearch`,listDir:`search/listDirectory`,textSearch:`search/textSearch`,searchSubagent:`search/searchSubagent`};function f(e){return`[${[...(s[e]||[]).map(e=>d[e]).filter(Boolean),`aikit/*`].join(`, `)}]`}function p(e){let t=n[e];return t?Array.isArray(t)?t[0]||`Auto (copilot)`:t:`Auto (copilot)`}const m=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
2
- `),h=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
3
- `);function g(){let t=[];for(let[i,a]of Object.entries(e))if(a.variants)for(let e of r[i]||[]){let r=`${i}-${e}`,o=n[r]||n[i],s=Array.isArray(o)?o[0]:o||`Unknown`,c=(a.variants[e]||{}).description||a.description;t.push(`| **${r}** | ${c} | ${s} | ${a.category} |`)}else{let e=n[i],r=Array.isArray(e)?e[0]:e||`Unknown`;t.push(`| **${i}** | ${a.description} | ${r} | ${a.category} |`)}return`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${t.join(`
4
- `)}`}function _(e,t,n){let i=`${e}-${t}`,o=n.variants[t]||{},s=p(i),c=o.description||n.description,l=o.identity||(t===r[e]?.[0]?`, the primary ${e} agent.`:`, a variant of ${e}. Same responsibilities, different model perspective.`),u=n.sharedBase&&a[n.sharedBase]?`\n\n${a[n.sharedBase]}`:``,d=n.extraBody?`\n\n${n.extraBody}`:``,m=o.bodyAddendum?`\n\n${o.bodyAddendum}`:``,g=(n.sharedProtocols||[]).map(e=>a[e]?`\n\n${a[e]}`:``).join(``),_=n.skills?.length?`\n\n## Skills (load on demand)\n\n| Skill | When to load |\n|-------|--------------|\n${n.skills.map(([e,t])=>`| ${e} | ${t} |`).join(`
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{COPILOT_MODELS as n,VARIANT_GROUPS as r}from"../definitions/models.mjs";import{PROMPTS as i}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as a,PLATFORM_OUTPUT_RULES_SECTION as o,PROTOCOLS as s,TEMPLATES as c}from"../definitions/protocols.mjs";import{IDE_CAPABILITIES as l}from"../definitions/tools.mjs";import{buildCompactAgentTable as u}from"./_shared.mjs";import{generateHooks as d,getHookScriptFiles as f}from"./hooks.mjs";const p={terminal:`execute/runInTerminal`,problems:`read/problems`,readFile:`read/readFile`,lastCommand:`read/terminalLastCommand`,subagent:`agent/runSubagent`,createFile:`edit/createFile`,editFiles:`edit/editFiles`,rename:`edit/rename`,createDirectory:`edit/createDirectory`,search:`search/changes, search/codebase, search/usages`,web:`web/fetch, web/githubRepo`,todo:`todo`,memory:`vscode/memory`,newWorkspace:`vscode/newWorkspace`,reviewPlan:`vscode/reviewPlan`,askQuestions:`vscode/askQuestions`,resolveMemoryFileUri:`vscode/resolveMemoryFileUri`,runCommand:`vscode/runCommand`,switchAgent:`vscode/switchAgent`,killTerminal:`execute/killTerminal`,createTask:`execute/createAndRunTask`,terminalSel:`read/terminalSelection`,fileSearch:`search/fileSearch`,listDir:`search/listDirectory`,textSearch:`search/textSearch`,searchSubagent:`search/searchSubagent`};function m(e){return`[${[...(l[e]||[]).map(e=>p[e]).filter(Boolean),`aikit/*`].join(`, `)}]`}function h(e){let t=n[e];return t?Array.isArray(t)?t[0]||`Auto (copilot)`:t:`Auto (copilot)`}const g=[`## Flows`,``,"This project uses aikit's pluggable flow system. Check flow status with the `flow` MCP tool.","If a flow is active, follow the current step's skill instructions. Advance with `flow({ action: 'step', advance: 'next' })`.","Use `flow({ action: 'list' })` to see available flows and `flow({ action: 'start', name, topic })` to begin one."].join(`
2
+ `),_=[`## Flows`,``,"This project uses aikit's pluggable flow system. Use `flow({ action: 'status' })` to check if a flow is active.",`If dispatched as part of a flow, your work contributes to the current step. Do NOT advance or manage the flow — the Orchestrator handles flow lifecycle.`].join(`
3
+ `);function v(){let t=[];for(let[i,a]of Object.entries(e))if(a.variants)for(let e of r[i]||[]){let r=`${i}-${e}`,o=n[r]||n[i],s=Array.isArray(o)?o[0]:o||`Unknown`,c=(a.variants[e]||{}).description||a.description;t.push(`| **${r}** | ${c} | ${s} | ${a.category} |`)}else{let e=n[i],r=Array.isArray(e)?e[0]:e||`Unknown`;t.push(`| **${i}** | ${a.description} | ${r} | ${a.category} |`)}return`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${t.join(`
4
+ `)}`}function y(e,t,n){let i=`${e}-${t}`,a=n.variants[t]||{},o=h(i),c=a.description||n.description,l=a.identity||(t===r[e]?.[0]?`, the primary ${e} agent.`:`, a variant of ${e}. Same responsibilities, different model perspective.`),u=n.sharedBase&&s[n.sharedBase]?`\n\n${s[n.sharedBase]}`:``,d=n.extraBody?`\n\n${n.extraBody}`:``,f=a.bodyAddendum?`\n\n${a.bodyAddendum}`:``,p=(n.sharedProtocols||[]).map(e=>s[e]?`\n\n${s[e]}`:``).join(``),g=n.skills?.length?`\n\n## Skills (load on demand)\n\n| Skill | When to load |\n|-------|--------------|\n${n.skills.map(([e,t])=>`| ${e} | ${t} |`).join(`
5
5
  `)}`:``,v=n.title||e;return`---
6
6
  description: '${c}'
7
- ${n.argumentHint?`argument-hint: "${n.argumentHint}"\n`:``}tools: ${f(n.toolRole)}
8
- model: ${s}
7
+ ${n.argumentHint?`argument-hint: "${n.argumentHint}"\n`:``}tools: ${m(n.toolRole)}
8
+ model: ${o}
9
9
  ---
10
10
 
11
11
  # ${i} - ${v}
12
12
 
13
13
  You are **${i}**${l}${d}
14
- ${u}${g}${m}${_}
14
+ ${u}${p}${f}${g}
15
15
 
16
- ${h}
17
- `}function v(n,r){let i=p(n),o=typeof t[n]==`function`?t[n](c(e)):t[n]||``,s=r.sharedBase&&a[r.sharedBase]?`\n\n${a[r.sharedBase]}`:``,l=(r.sharedProtocols||[]).map(e=>a[e]?`\n\n${a[e]}`:``).join(``),u=r.title||n,d=r.skills?.length?`\n## Skills (load on demand)\n\n| Skill | When to load |\n|-------|--------------|\n${r.skills.map(([e,t])=>`| ${e} | ${t} |`).join(`
16
+ ${_}
17
+ `}function b(n,r){let i=h(n),a=typeof t[n]==`function`?t[n](u(e)):t[n]||``,o=r.sharedBase&&s[r.sharedBase]?`\n\n${s[r.sharedBase]}`:``,c=(r.sharedProtocols||[]).map(e=>s[e]?`\n\n${s[e]}`:``).join(``),l=r.title||n,d=r.skills?.length?`\n## Skills (load on demand)\n\n| Skill | When to load |\n|-------|--------------|\n${r.skills.map(([e,t])=>`| ${e} | ${t} |`).join(`
18
18
  `)}\n`:``;return`---
19
19
  description: '${r.description}'
20
- ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${f(r.toolRole)}
20
+ ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${m(r.toolRole)}
21
21
  model: ${i}
22
22
  ---
23
23
 
24
- # ${n} - ${u}
24
+ # ${n} - ${l}
25
25
 
26
26
  You are the **${n}**, ${r.description.toLowerCase().replace(/^./,e=>e.toLowerCase())}
27
27
 
28
- ${o}${s}${l}${d}
28
+ ${a}${o}${c}${d}
29
29
 
30
- ${n===`Orchestrator`?m:h}
31
- `}function y(e,t){return`---
30
+ ${n===`Orchestrator`?g:_}
31
+ `}function x(e,t){return`---
32
32
  description: "${t.description}"
33
33
  agent: "${t.agent}"
34
34
  ---
35
35
 
36
36
  ${t.content}
37
- `}function b(){return`# Agents
37
+ `}function S(){return`# Agents
38
38
 
39
39
  This directory contains AI agent definitions generated by \`@vpxa/aikit init\`.
40
40
 
41
41
  ## Agent Roster
42
42
 
43
- ${g()}
43
+ ${v()}
44
44
 
45
45
  ## Multi-Model Pattern
46
46
 
@@ -73,4 +73,5 @@ To regenerate after changing models or agent definitions:
73
73
  cd knowledge-base
74
74
  node scaffold/generate.mjs
75
75
  \`\`\`
76
- `}function x(){let t=[];if(u().length===0)throw Error(`Executable hooks are not configured.`);for(let[n,i]of Object.entries(e))if(i.variants)for(let e of r[n]||[])t.push({path:`agents/${n}-${e}.agent.md`,content:_(n,e,i)});else t.push({path:`agents/${n}.agent.md`,content:v(n,i)});for(let[e,n]of Object.entries(a))t.push({path:`agents/_shared/${e}.md`,content:`${n}\n`});for(let[e,n]of Object.entries(o))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:b()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:y(e,n)});let n=l(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...n.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{x as generateCopilot};
76
+ `}function C(){return[`# aikit Copilot Instructions`,``,"Detailed agent instructions live under `agents/`.","Prompt files live under `prompts/`.","Hook scripts live under `hooks/`.",``,`Start with this file, then open the specific agent file you want to use.`,``,o,``,a,``].join(`
77
+ `)}function w(){let t=[];if(f().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`copilot-instructions.md`,content:C()});for(let[n,i]of Object.entries(e))if(i.variants)for(let e of r[n]||[])t.push({path:`agents/${n}-${e}.agent.md`,content:y(n,e,i)});else t.push({path:`agents/${n}.agent.md`,content:b(n,i)});for(let[e,n]of Object.entries(s))t.push({path:`agents/_shared/${e}.md`,content:`${n}\n`});for(let[e,n]of Object.entries(c))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:S()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:x(e,n)});let n=d(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...n.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{w as generateCopilot};
@@ -20,7 +20,7 @@ ${e===`<PROFILE>`?`**Profile:** Check your role → implementer | documenter | r
20
20
  ---`}function t(){return"\n## Evidence Citation Protocol (tier-aware)\n\nNo FORGE `task_id` → skip `evidence_map`; use `file:line` citations only.\nDo not create your own `task_id` or run the gate.\n\n| Tier | Your responsibility |\n|------|---------------------|\n| Floor | Findings with `file.ts#Lxx` citations. No `evidence_map`. |\n| Standard | Add 2-4 CRITICAL/HIGH findings with receipts. |\n| Critical | Add all CRITICAL/HIGH findings; tag contract/security claims with `safety_gate`. |\n\n**Every response MUST include:**\n- `**FORGE Task ID:** <task_id>` (passed in by Orchestrator, or state \"not provided\")\n- `**Tier applied:** Floor | Standard | Critical`\n- `**Findings:** <list>` with `file:line` receipts\n- Verdict: `APPROVED` | `CHANGES_REQUESTED` | `BLOCKED`\n\nDo NOT create a new `evidence_map`, run `evidence_map({action:'gate'})`, or add non-critical noise."}function n(...e){return e.filter(Boolean).join(`
21
21
 
22
22
  `)}function r({title:e=`Knowledge Recall`,intro:t,commands:r,followUp:i}={}){return n(`## Pre-Task: ${e} (MANDATORY)`,t,["```",...(Array.isArray(r)?r:[r]).filter(Boolean),"```"].join(`
23
- `),i)}function i(){return n(`## Post-Task: Capture Lesson`,`**HARD RULE:** Before DONE, capture 1-2 lessons unless change is pure config/formatting.`,'Quick capture:\n```\nknowledge({ action: "lesson", subAction: "create", context: "<what situation you faced>", insight: "<what principle the solution demonstrates>", evidence: "<file:line or commit that proves it>", confidence: 65 })\n```',"If recalled lesson was confirmed/invalid, use `confirm` or `contradict`.")}const a={"code-agent-base":`# Code Agent — Shared Base Instructions
23
+ `),i)}function i(){return n(`## Post-Task: Capture Lesson`,`**HARD RULE:** Before DONE, capture 1-2 lessons unless change is pure config/formatting.`,'Quick capture:\n```\nknowledge({ action: "lesson", subAction: "create", context: "<what situation you faced>", insight: "<what principle the solution demonstrates>", evidence: "<file:line or commit that proves it>", confidence: 65 })\n```',"If recalled lesson was confirmed/invalid, use `confirm` or `contradict`.")}const a=n(`## Output Rules (HARD RULE)`,"Follow the **Presentation Priority** (1st Inline Visual → 2nd Interactive → 3rd Plain Text). Use `present` for any response longer than 3 lines, especially summaries, comparisons, reports, task plans, verdicts, and progress. Use plain text only for short confirmations, simple questions, or explicitly text-only status updates."),o=n(`## AI Kit Recovery`,"If AI Kit tools are unavailable or missing, run `npx -y @vpxa/aikit init --user`, then reload the client so the `aikit` MCP server and user instructions become available."),s={"code-agent-base":`# Code Agent — Shared Base Instructions
24
24
 
25
25
  > Shared protocol for code-writing agents. Agent-specific files should not duplicate it.
26
26
 
@@ -356,24 +356,6 @@ Verify each before returning handoff:
356
356
 
357
357
  ---
358
358
 
359
- ## User Interaction Rules
360
-
361
- **Presentation Priority (HARD RULE — applies to ALL output):**
362
-
363
- | Priority | Transport | When to use | Example |
364
- |----------|-----------|-------------|---------|
365
- | **1st — Inline Visual** | MCP App (\`present\` without \`actions[]\`) | Reports, summaries, task plans, progress, status boards, diagrams, any structured content | \`present({ ..., blocks: [...] })\` or \`present({ ..., template: "report@1", data: {...} })\` |
366
- | **2nd — Interactive** | Browser (\`present\` WITH \`actions[]\`) | ONLY when user approval/input is required: STOP gates, confirmations, selections | \`present({ ..., actions: [{ id: "approve", type: "confirm", label: "Approve?" }] })\` |
367
- | **3rd — Plain Text** | Markdown in chat | Short confirmations (≤3 sentences), simple questions, status one-liners | "Done. 3 files updated." |
368
-
369
- **Rules:**
370
- - NEVER use plain text when data fits a \`present\` template or has >3 structured items
371
- - NEVER render tables as markdown when \`present\` can show them interactively
372
- - Use registered templates when data matches: \`task-plan@1\`, \`report@1\`, \`status-board@1\`, \`timeline@1\`, \`kanban@1\`, \`data-table@1\`, \`checklist@1\`
373
- - Add \`actions[]\` when user input/approval is needed (triggers browser transport automatically)
374
- - Elicitation fields for free-form text input alongside any \`present\` call
375
- - Code-agent subagents: text-only output (Orchestrator renders visually on their behalf)
376
-
377
359
  ${e(`<PROFILE>`)}
378
360
 
379
361
  ## Handoff Format
@@ -880,7 +862,7 @@ evidence_map({ action: "gate", task_id: "add-user-api" }) → YIELD ✅
880
862
  10. **Token budgets are binding.** Per-task: 4,000 tokens. Per-session: 30,000 tokens. Surface breaches; do not silently overrun.
881
863
  11. **Checkpoint.** After every significant step, summarize what was done, what’s verified, what’s left.
882
864
  12. **Fail loud.** “Completed” is wrong if tests were skipped. Default to surfacing uncertainty over false confidence.
883
- `},o={"execution-state":`# Execution State: {Task Title}
865
+ `},c={"execution-state":`# Execution State: {Task Title}
884
866
 
885
867
  **Status:** PLANNING | IN_PROGRESS | REVIEW | COMPLETED | BLOCKED
886
868
  **Started:** {timestamp}
@@ -932,4 +914,4 @@ evidence_map({ action: "gate", task_id: "add-user-api" }) → YIELD ✅
932
914
 
933
915
  ## Alternatives Considered
934
916
  {Other approaches evaluated and why they were rejected — keeps the "why not" alongside the "why"}
935
- `};export{a as PROTOCOLS,o as TEMPLATES,i as postTaskLesson,r as preTaskKnowledgeRecall};
917
+ `};export{o as AIKIT_INSTALL_HINT_SECTION,a as PLATFORM_OUTPUT_RULES_SECTION,s as PROTOCOLS,c as TEMPLATES,i as postTaskLesson,r as preTaskKnowledgeRecall};
@@ -1,2 +0,0 @@
1
- import"node:module";import{existsSync as e,mkdirSync as t,readFileSync as n,rmSync as r,unlinkSync as i,writeFileSync as a}from"node:fs";import{dirname as o,resolve as s}from"node:path";import{pathToFileURL as c}from"node:url";import{createHash as l}from"node:crypto";var u=Object.defineProperty,d=(e,t)=>{let n={};for(var r in e)u(n,r,{get:e[r],enumerable:!0});return t||u(n,Symbol.toStringTag,{value:`Module`}),n};const f=[`inputs`,`outputs`,`requires`,`relatedSkills`],p=[`model`],m=[`category`,`domain`,`applicability`],h=new Set([`__proto__`,`constructor`,`prototype`]);function g(e,t){return e.metadata[t]??e.fields[t]}function _(e,t){let n=g(e,t);return n?y(n):[]}function v(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(h.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}h.has(a)||(t[a]=o,a===`tools`&&(r=y(o)))}return{fields:t,metadata:n,tools:r,body:i}}function y(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 b(e){return`[${e.join(`, `)}]`}function x(e,t){let n=v(e),r=v(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 p)r.fields[e]&&(i[e]=r.fields[e]);for(let e of m){let t=g(r,e);t&&(a[e]=t)}for(let e of[...m,...f])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=b(u));for(let e of f){let t=_(n,e),i=_(r,e),o=new Set(t),s=i.filter(e=>!o.has(e)),c=[...t,...s];c.length>0?a[e]=b(c):delete a[e]}let d=[`---`],h=[`name`,`description`,`argument-hint`,`tools`,`model`],y=[`category`,`domain`,`applicability`,`inputs`,`outputs`,`requires`,`relatedSkills`],x=new Set;for(let e of h)e in i&&(d.push(`${e}: ${i[e]}`),x.add(e));for(let[e,t]of Object.entries(i))x.has(e)||d.push(`${e}: ${t}`);let S=[],C=new Set;for(let e of y){let t=a[e];t&&(S.push(` ${e}: ${t}`),C.add(e))}for(let[e,t]of Object.entries(a))!C.has(e)&&t&&S.push(` ${e}: ${t}`);return S.length>0&&(d.push(`metadata:`),d.push(...S)),d.push(`---`),`${d.join(`
2
- `)}\n${n.body}`}function S(e){return l(`sha256`).update(e).digest(`hex`).slice(0,16)}function C(t){if(!e(t))return null;try{let e=n(t,`utf-8`),r=JSON.parse(e);return!r.version||!r.files?null:r}catch{return null}}function w(e,t){a(e,`${JSON.stringify(t,null,2)}\n`,`utf-8`)}function T(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 E(e,t,n){if(!e)return`new`;let r=e.files[t];return r?r.sourceHash===S(n)?`current`:`outdated`:`new`}function D(e,t,n,r){e.files[t]={sourceHash:S(n),strategy:r??T(t),updatedAt:new Date().toISOString()}}function O(e){return{version:e,generatedAt:new Date().toISOString(),files:{}}}var k=d({guideFlows:()=>R,guideScaffold:()=>F,guideSkills:()=>I,loadAdapter:()=>A,smartCopyFlows:()=>L,smartCopyFromMemory:()=>j,smartCopyScaffold:()=>N,smartCopySkills:()=>P});async function A(e,t){let n=await import(c(s(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 j(r,i,c,l,u=!1){t(i,{recursive:!0});for(let d of r){let r=l?`${l}/${d.path}`:d.path,f=s(i,d.path);if(u){t(o(f),{recursive:!0}),a(f,d.content,`utf-8`),D(c,r,d.content);continue}let p=E(c,r,d.content);if(p!==`current`){if(p===`new`&&!e(f)){t(o(f),{recursive:!0}),a(f,d.content,`utf-8`),D(c,r,d.content);continue}if(p===`new`&&e(f)){D(c,r,d.content);continue}if(T(r)===`merge-frontmatter`&&e(f)){let e=n(f,`utf-8`);a(f,x(d.content,e),`utf-8`)}else t(o(f),{recursive:!0}),a(f,d.content,`utf-8`);D(c,r,d.content)}}u&&M(i,c,l,new Set(r.map(e=>l?`${l}/${e.path}`:e.path)))}function M(t,n,r,a){let o=[];for(let c of Object.keys(n.files)){if(!c.startsWith(`${r}/`)||a.has(c))continue;let l=s(t,c.slice(r.length+1));e(l)&&(i(l),o.push(c)),delete n.files[c]}return o}async function N(e,t,n=`copilot`,r,i=!1){let a=await A(t,n),o=a.some(e=>e.path.startsWith(`.`)),c=o?e:s(e,`.github`),l=s(c,`.aikit-scaffold.json`),u=C(l)??O(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)j(t,e?s(c,e):c,u,o?`${n}/${e||`.`}`:e||`.`,i);w(l,u)}async function P(e,t,n,r,i=!1){let a=s(e,`.github`),o=s(a,`.aikit-scaffold.json`),c=C(o)??O(r);c.version=r;let l=await A(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)j(t,s(a,`skills`,e),c,`skills/${e}`,i);w(o,c)}async function F(t,r,i=`copilot`){let a=[],o=await A(r,i),c=o.some(e=>e.path.startsWith(`.`))?t:s(t,`.github`);for(let t of o){let r=s(c,t.path);if(!e(r))a.push({status:`new`,relativePath:t.path,sourcePath:``,content:t.content});else{let e=n(r,`utf-8`);t.content===e?a.push({status:`current`,relativePath:t.path,sourcePath:``}):a.push({status:`outdated`,relativePath:t.path,sourcePath:``,content:t.content})}}return a}async function I(t,r,i){let a=[],o=await A(r,`skills`),c=s(t,`.github`);for(let t of o){let r=`skills/${t.path}`,i=s(c,`skills`,t.path);if(!e(i))a.push({status:`new`,relativePath:r,sourcePath:``,content:t.content});else{let e=n(i,`utf-8`);t.content===e?a.push({status:`current`,relativePath:r,sourcePath:``}):a.push({status:`outdated`,relativePath:r,sourcePath:``,content:t.content})}}return a}async function L(t,n,i,a,o=!1){let c=s(t,`.github`),l=s(c,`.aikit-scaffold.json`),u=C(l)??O(a);u.version=a;let d=await A(n,`flows`),f=new Set,p=new Map;for(let e of d){let t=e.path.indexOf(`/`);if(t===-1)continue;let n=e.path.substring(0,t);f.add(n);let r=e.path.substring(t+1),i=p.get(n)??[];i.push({path:r,content:e.content}),p.set(n,i)}for(let t of f){let n=s(c,`flows`,t,`skills`);e(n)&&r(n,{recursive:!0,force:!0})}for(let[e,t]of p)j(t,s(c,`flows`,e),u,`flows/${e}`,o);w(l,u)}async function R(t,r,i){let a=[],o=await A(r,`flows`),c=s(t,`.github`);for(let t of o){let r=`flows/${t.path}`,i=s(c,`flows`,t.path);if(!e(i))a.push({status:`new`,relativePath:r,sourcePath:``,content:t.content});else{let e=n(i,`utf-8`);t.content===e?a.push({status:`current`,relativePath:r,sourcePath:``}):a.push({status:`outdated`,relativePath:r,sourcePath:``,content:t.content})}}return a}export{k as a,N as c,C as d,w as f,A as i,P as l,d as m,F as n,L as o,v as p,I as r,j as s,R as t,O as u};