@vpxa/aikit 0.1.248 → 0.1.250

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{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(`
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{getPlatformPrimaryModelMap 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
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
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
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
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`,``,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(`
6
+ `)}function j(t=p(e,a(`claude-code`))){return[`# aikit — Claude Code 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
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
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
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};
11
+ `)}function P(){let t=[],n=p(e,a(`claude-code`)),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,3 +1,5 @@
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{PROMPTS as a}from"../definitions/prompts.mjs";import{PROTOCOLS as o}from"../definitions/protocols.mjs";import{buildAgentTable as s,buildCompactAgentTable as c,buildHooksSection as l,buildInlineAgentSection as u,buildPromptSections as d}from"./_shared.mjs";function f(e,t){let n=t.args.map(e=>JSON.stringify(e)).join(`, `);return`[mcp_servers.${e}]\ncommand = ${JSON.stringify(t.command)}\nargs = [${n}]\n`}function p(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function m(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&o[e.sharedBase]&&t.push(o[e.sharedBase]);for(let n of e.sharedProtocols||[])o[n]&&t.push(o[n]);return t}function h(t){let n=[];for(let[r,i]of Object.entries(e)){let e=p(r,t),a=m(i);if(i.variants){for(let[t,o]of Object.entries(i.variants))n.push(u({name:`${r}-${t}`,title:i.title,description:o.description||i.description,body:e,skills:i.skills,additionalSections:[...a,o.bodyAddendum].filter(Boolean)}));continue}n.push(u({name:r,title:i.title,description:i.description,body:e,skills:i.skills,additionalSections:a}))}return n.join(`
2
- `)}function g(){return[`# aikit Codex CLI Instructions`,``,"This project uses an MCP server (`aikit`) providing tools for search, analysis, memory, and validation.",``,`## MCP Server`,``,"Server name: `aikit`",``,`## Agents`,``,s(e),``,`## Agent Instructions`,``,h(c(e)),`## Prompts`,``,d(a),``,`## Session Protocol`,``,l(n),``].join(`
3
- `)}function _(){return[{path:`.codex/config.toml`,content:f(i,r)},{path:`codex.md`,content:g()}]}export{_ as generateCodex};
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{MCP_SERVER_ENTRY as n,SERVER_NAME as r}from"../definitions/mcp.mjs";import{getAgentModelConfig as i}from"../definitions/models.mjs";import{PROTOCOLS as a}from"../definitions/protocols.mjs";import{buildCompactAgentTable as o,buildSkillsSection as s,lowerFirst as c}from"./_shared.mjs";function l(e,t){let n=t.args.map(e=>JSON.stringify(e)).join(`, `);return`[mcp_servers.${e}]\ncommand = ${JSON.stringify(t.command)}\nargs = [${n}]\n`}function u(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()}function d(e){return JSON.stringify(String(e))}function f(e){let t=String(e).replace(/\r\n/g,`
2
+ `).trim();return t?`"""\n${t}\n"""`:`""`}function p(e,n){let r=t[e];return typeof r==`function`?r(n):r||``}function m(e){let t=[];e.extraBody&&t.push(e.extraBody),e.sharedBase&&a[e.sharedBase]&&t.push(a[e.sharedBase]);for(let n of e.sharedProtocols||[])a[n]&&t.push(a[n]);return t}function h({name:e,description:t,identity:n,body:r,skills:i,additionalSections:a}){return[n?`You are the **${e}**${n}`:`You are the **${e}**, ${c(t)}.`,r,...a||[],s(i)].filter(Boolean).join(`
3
+
4
+ `).trim()}function g({name:e,description:t,developerInstructions:n,modelConfig:r}){let i=[`name = ${d(e)}`,`description = ${d(t)}`];return r?.primary&&i.push(`model = ${d(r.primary)}`),r?.reasoningEffort&&i.push(`model_reasoning_effort = ${d(r.reasoningEffort)}`),i.push(`developer_instructions = ${f(n)}`,``),i.join(`
5
+ `)}function _(){let t=[],n=o(e);for(let[r,a]of Object.entries(e)){let e=p(r,n),o=m(a);if(a.variants){for(let[n,s]of Object.entries(a.variants)){let c=`${r}-${n}`,l=u(c),d=s.description||a.description;t.push({path:`.codex/agents/${l}.toml`,content:g({name:l,description:d,modelConfig:i(`codex`,c),developerInstructions:h({name:c,description:d,identity:s.identity,body:e,skills:a.skills,additionalSections:[...o,s.bodyAddendum].filter(Boolean)})})})}continue}let s=u(r);t.push({path:`.codex/agents/${s}.toml`,content:g({name:s,description:a.description,modelConfig:i(`codex`,r),developerInstructions:h({name:r,description:a.description,identity:a.identity,body:e,skills:a.skills,additionalSections:o})})})}return t}function v(){return[{path:`.codex/config.toml`,content:l(r,n)},..._()]}export{v as generateCodex};
@@ -1,23 +1,23 @@
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
- `)}`:``,v=n.title||e;return`---
6
- description: '${c}'
7
- ${n.argumentHint?`argument-hint: "${n.argumentHint}"\n`:``}tools: ${m(n.toolRole)}
1
+ import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{VARIANT_GROUPS as n,getFallbackAgentModels as r,getPrimaryAgentModel as i}from"../definitions/models.mjs";import{PROMPTS as a}from"../definitions/prompts.mjs";import{AIKIT_INSTALL_HINT_SECTION as o,PLATFORM_OUTPUT_RULES_SECTION as s,PROTOCOLS as c,TEMPLATES as l}from"../definitions/protocols.mjs";import{IDE_CAPABILITIES as u}from"../definitions/tools.mjs";import{buildCompactAgentTable as d}from"./_shared.mjs";import{generateHooks as f,getHookScriptFiles as p}from"./hooks.mjs";const m={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 h(e){return`[${[...(u[e]||[]).map(e=>m[e]).filter(Boolean),`aikit/*`].join(`, `)}]`}function g(e){let t=r(`copilot`,e);return t.length===0?`Auto (copilot)`:t[0]||`Auto (copilot)`}const _=[`## 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
+ `),v=[`## 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 y(){let t=[];for(let[r,a]of Object.entries(e))if(a.variants)for(let e of n[r]||[]){let n=`${r}-${e}`,o=i(`copilot`,n,`Unknown`),s=(a.variants[e]||{}).description||a.description;t.push(`| **${n}** | ${s} | ${o} | ${a.category} |`)}else{let e=i(`copilot`,r,`Unknown`);t.push(`| **${r}** | ${a.description} | ${e} | ${a.category} |`)}return`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${t.join(`
4
+ `)}`}function b(e,t,r){let i=`${e}-${t}`,a=r.variants[t]||{},o=g(i),s=a.description||r.description,l=a.identity||(t===n[e]?.[0]?`, the primary ${e} agent.`:`, a variant of ${e}. Same responsibilities, different model perspective.`),u=r.sharedBase&&c[r.sharedBase]?`\n\n${c[r.sharedBase]}`:``,d=r.extraBody?`\n\n${r.extraBody}`:``,f=a.bodyAddendum?`\n\n${a.bodyAddendum}`:``,p=(r.sharedProtocols||[]).map(e=>c[e]?`\n\n${c[e]}`:``).join(``),m=r.skills?.length?`\n\n## Skills (load on demand)\n\n| Skill | When to load |\n|-------|--------------|\n${r.skills.map(([e,t])=>`| ${e} | ${t} |`).join(`
5
+ `)}`:``,_=r.title||e;return`---
6
+ description: '${s}'
7
+ ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${h(r.toolRole)}
8
8
  model: ${o}
9
9
  ---
10
10
 
11
- # ${i} - ${v}
11
+ # ${i} - ${_}
12
12
 
13
13
  You are **${i}**${l}${d}
14
- ${u}${p}${f}${g}
14
+ ${u}${p}${f}${m}
15
15
 
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(`
16
+ ${v}
17
+ `}function x(n,r){let i=g(n),a=typeof t[n]==`function`?t[n](d(e)):t[n]||``,o=r.sharedBase&&c[r.sharedBase]?`\n\n${c[r.sharedBase]}`:``,s=(r.sharedProtocols||[]).map(e=>c[e]?`\n\n${c[e]}`:``).join(``),l=r.title||n,u=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: ${m(r.toolRole)}
20
+ ${r.argumentHint?`argument-hint: "${r.argumentHint}"\n`:``}tools: ${h(r.toolRole)}
21
21
  model: ${i}
22
22
  ---
23
23
 
@@ -25,28 +25,28 @@ model: ${i}
25
25
 
26
26
  You are the **${n}**, ${r.description.toLowerCase().replace(/^./,e=>e.toLowerCase())}
27
27
 
28
- ${a}${o}${c}${d}
28
+ ${a}${o}${s}${u}
29
29
 
30
- ${n===`Orchestrator`?g:_}
31
- `}function x(e,t){return`---
30
+ ${n===`Orchestrator`?_:v}
31
+ `}function S(e,t){return`---
32
32
  description: "${t.description}"
33
33
  agent: "${t.agent}"
34
34
  ---
35
35
 
36
36
  ${t.content}
37
- `}function S(){return`# Agents
37
+ `}function C(){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
- ${v()}
43
+ ${y()}
44
44
 
45
45
  ## Multi-Model Pattern
46
46
 
47
47
  Variant agents (Researcher-Alpha/Beta/Gamma/Delta, Code-Reviewer-Alpha/Beta, Architect-Reviewer-Alpha/Beta) share the same methodology via files in \`_shared/\`. They differ only in which LLM model backs them — enabling multi-model decision analysis and dual-review workflows.
48
48
 
49
- **Agent names are model-agnostic.** The model behind Alpha/Beta/Gamma/Delta can be changed in \`scaffold/definitions/models.mjs\` without renaming any agent files.
49
+ **Agent names are model-agnostic.** The backing model can vary by platform in \`scaffold/definitions/models.mjs\` without renaming any agent files.
50
50
 
51
51
  ## Structure
52
52
 
@@ -73,5 +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 C(){return[`# aikit — Copilot Instructions`,``,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};
76
+ `}function w(){return[`# aikit — Copilot Instructions`,``,s,``,o,``].join(`
77
+ `)}function T(){let t=[];if(p().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`copilot-instructions.md`,content:w()});for(let[r,i]of Object.entries(e))if(i.variants)for(let e of n[r]||[])t.push({path:`agents/${r}-${e}.agent.md`,content:b(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:x(r,i)});for(let[e,n]of Object.entries(c))t.push({path:`agents/_shared/${e}.md`,content:`${n}\n`});for(let[e,n]of Object.entries(l))t.push({path:`agents/templates/${e}.md`,content:`${n}\n`});t.push({path:`agents/README.md`,content:C()});for(let[e,n]of Object.entries(a))t.push({path:`prompts/aikit-${e}.prompt.md`,content:S(e,n)});let r=f(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{T as generateCopilot};
@@ -530,6 +530,8 @@ ${e()}
530
530
 
531
531
  ### Phase 2: Reproduce
532
532
 
533
+ Tag filters are exact labels, not substring search.
534
+
533
535
  1. \`search({ query: "<error-keywords>", tags: ["observation"] })\`
534
536
  2. \`search({ query: "error patterns" })\`
535
537
  3. \`knowledge({ action: "list", tag: "errors" })\`
@@ -1 +1 @@
1
- const e={Orchestrator:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Auto (copilot)`],Planner:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Claude Opus 4.6 (copilot)`,`Auto (copilot)`],Implementer:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`GPT-5.3-Codex (copilot)`,`Auto (copilot)`],Frontend:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Gemini 3.1 Pro (Preview) (copilot)`,`GPT-5.3-Codex (copilot)`,`Auto (copilot)`],Debugger:[`GPT-5.4 (copilot)`,`GPT-5.3-Codex (copilot)`,`Claude Opus 4.6 (copilot)`,`Auto (copilot)`],Refactor:[`GPT-5.4 (copilot)`,`GPT-5.3-Codex (copilot)`,`Auto (copilot)`],Security:[`GPT-5.4 (copilot)`,`Claude Opus 4.6 (copilot)`,`Auto (copilot)`],Documenter:[`GPT-5.4 mini (copilot)`,`GPT-5 mini (copilot)`,`Auto (copilot)`],Explorer:[`GPT-5 mini (copilot)`,`Gemini 3 Flash (Preview) (copilot)`,`Auto (copilot)`],"Researcher-Alpha":[`Claude Opus 4.6 (copilot)`,`Auto (copilot)`],"Researcher-Beta":[`Claude Sonnet 4.6 (copilot)`,`Auto (copilot)`],"Researcher-Gamma":[`GPT-5.4 (copilot)`,`Auto (copilot)`],"Researcher-Delta":[`Gemini 3.5 Flash (copilot)`,`Auto (copilot)`],"Code-Reviewer-Alpha":[`GPT-5.4 (copilot)`,`Auto (copilot)`],"Code-Reviewer-Beta":[`Claude Opus 4.6 (copilot)`,`Auto (copilot)`],"Architect-Reviewer-Alpha":[`GPT-5.4 (copilot)`,`Auto (copilot)`],"Architect-Reviewer-Beta":[`Claude Opus 4.6 (copilot)`,`Auto (copilot)`]},t=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(Array.isArray(t)?t[0]:t)?.replace(/ \(copilot\)$/,``)||`Auto`])),n={Researcher:[`Alpha`,`Beta`,`Gamma`,`Delta`],"Code-Reviewer":[`Alpha`,`Beta`],"Architect-Reviewer":[`Alpha`,`Beta`]},r={Researcher:`Alpha`,"Code-Reviewer":`Alpha`,"Architect-Reviewer":`Alpha`};export{t as CLAUDE_MODELS,e as COPILOT_MODELS,r as PRIMARY_VARIANT,n as VARIANT_GROUPS};
1
+ const e={copilot:{Orchestrator:{primary:`GPT-5.4 mini (copilot)`,fallbacks:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Auto (copilot)`]},Planner:{primary:`GPT-5.4 mini (copilot)`,fallbacks:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Claude Opus 4.6 (copilot)`,`Auto (copilot)`]},Implementer:{primary:`GPT-5.4 mini (copilot)`,fallbacks:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`GPT-5.3-Codex (copilot)`,`Auto (copilot)`]},Frontend:{primary:`GPT-5.4 mini (copilot)`,fallbacks:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Gemini 3.1 Pro (Preview) (copilot)`,`GPT-5.3-Codex (copilot)`,`Auto (copilot)`]},Debugger:{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 (copilot)`,`GPT-5.3-Codex (copilot)`,`Claude Opus 4.6 (copilot)`,`Auto (copilot)`]},Refactor:{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 (copilot)`,`GPT-5.3-Codex (copilot)`,`Auto (copilot)`]},Security:{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 (copilot)`,`Claude Opus 4.6 (copilot)`,`Auto (copilot)`]},Documenter:{primary:`GPT-5.4 mini (copilot)`,fallbacks:[`GPT-5.4 mini (copilot)`,`GPT-5 mini (copilot)`,`Auto (copilot)`]},Explorer:{primary:`GPT-5 mini (copilot)`,fallbacks:[`GPT-5 mini (copilot)`,`Gemini 3 Flash (Preview) (copilot)`,`Auto (copilot)`]},"Researcher-Alpha":{primary:`Claude Opus 4.6 (copilot)`,fallbacks:[`Claude Opus 4.6 (copilot)`,`Auto (copilot)`]},"Researcher-Beta":{primary:`Claude Sonnet 4.6 (copilot)`,fallbacks:[`Claude Sonnet 4.6 (copilot)`,`Auto (copilot)`]},"Researcher-Gamma":{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 (copilot)`,`Auto (copilot)`]},"Researcher-Delta":{primary:`Gemini 3.5 Flash (copilot)`,fallbacks:[`Gemini 3.5 Flash (copilot)`,`Auto (copilot)`]},"Code-Reviewer-Alpha":{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 (copilot)`,`Auto (copilot)`]},"Code-Reviewer-Beta":{primary:`Claude Opus 4.6 (copilot)`,fallbacks:[`Claude Opus 4.6 (copilot)`,`Auto (copilot)`]},"Architect-Reviewer-Alpha":{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 (copilot)`,`Auto (copilot)`]},"Architect-Reviewer-Beta":{primary:`Claude Opus 4.6 (copilot)`,fallbacks:[`Claude Opus 4.6 (copilot)`,`Auto (copilot)`]}},"claude-code":{Orchestrator:{primary:`Claude Sonnet 4.6`},Planner:{primary:`Claude Opus 4.6`},Implementer:{primary:`Claude Sonnet 4.6`},Frontend:{primary:`Claude Sonnet 4.6`},Debugger:{primary:`Claude Opus 4.6`},Refactor:{primary:`Claude Sonnet 4.6`},Security:{primary:`Claude Opus 4.6`},Documenter:{primary:`Claude Sonnet 4.6`},Explorer:{primary:`Claude Sonnet 4.6`},"Researcher-Alpha":{primary:`Claude Opus 4.6`},"Researcher-Beta":{primary:`Claude Sonnet 4.6`},"Researcher-Gamma":{primary:`Claude Opus 4.6`},"Researcher-Delta":{primary:`Claude Sonnet 4.6`},"Code-Reviewer-Alpha":{primary:`Claude Opus 4.6`},"Code-Reviewer-Beta":{primary:`Claude Sonnet 4.6`},"Architect-Reviewer-Alpha":{primary:`Claude Opus 4.6`},"Architect-Reviewer-Beta":{primary:`Claude Sonnet 4.6`}},codex:{Orchestrator:{primary:`gpt-5.4-mini`,reasoningEffort:`high`},Planner:{primary:`gpt-5.4`,reasoningEffort:`high`},Implementer:{primary:`gpt-5.3-codex`,reasoningEffort:`high`},Frontend:{primary:`gpt-5.4`,reasoningEffort:`high`},Debugger:{primary:`gpt-5.3-codex`,reasoningEffort:`high`},Refactor:{primary:`gpt-5.3-codex`,reasoningEffort:`high`},Security:{primary:`gpt-5.4`,reasoningEffort:`high`},Documenter:{primary:`gpt-5.4-mini`,reasoningEffort:`high`},Explorer:{primary:`gpt-5.4-mini`,reasoningEffort:`high`},"Researcher-Alpha":{primary:`gpt-5.4`,reasoningEffort:`high`},"Researcher-Beta":{primary:`gpt-5.3-codex`,reasoningEffort:`high`},"Researcher-Gamma":{primary:`gpt-5.4-mini`,reasoningEffort:`high`},"Researcher-Delta":{primary:`gpt-5.4`,reasoningEffort:`high`},"Code-Reviewer-Alpha":{primary:`gpt-5.4`,reasoningEffort:`high`},"Code-Reviewer-Beta":{primary:`gpt-5.3-codex`,reasoningEffort:`high`},"Architect-Reviewer-Alpha":{primary:`gpt-5.4`,reasoningEffort:`high`},"Architect-Reviewer-Beta":{primary:`gpt-5.3-codex`,reasoningEffort:`high`}}};function t(t,n){return e[t]?.[n]||null}function n(e,n,r=null){return t(e,n)?.primary||r}function r(e,n){return t(e,n)?.fallbacks||[]}function i(t){return Object.fromEntries(Object.entries(e[t]||{}).map(([e,t])=>[e,t.primary]))}const a={Researcher:[`Alpha`,`Beta`,`Gamma`,`Delta`],"Code-Reviewer":[`Alpha`,`Beta`],"Architect-Reviewer":[`Alpha`,`Beta`]},o={Researcher:`Alpha`,"Code-Reviewer":`Alpha`,"Architect-Reviewer":`Alpha`};export{e as PLATFORM_AGENT_MODELS,o as PRIMARY_VARIANT,a as VARIANT_GROUPS,t as getAgentModelConfig,r as getFallbackAgentModels,i as getPlatformPrimaryModelMap,n as getPrimaryAgentModel};
@@ -1 +0,0 @@
1
- import{EMBEDDING_DEFAULTS as e,SEARCH_DEFAULTS as t,STORE_DEFAULTS as n,createLogger as r,serializeError as i,sourceTypeContentTypes as a}from"../../core/dist/index.js";import{Index as o,connect as s}from"@lancedb/lancedb";function c(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}const l=/^[\w.\-/ ]+$/,u=r(`store`);function d(e,t){if(!l.test(e))throw Error(`Invalid ${t} filter value: contains disallowed characters`);return e.replace(/'/g,`''`)}var f=class r{db=null;table=null;dbPath;tableName;_draining=!1;_priorityQueue=[];_normalQueue=[];_ftsReady=!1;_ftsRecoveryAttemptAt=0;static FTS_RECOVERY_COOLDOWN_MS=300*1e3;enqueueWrite(e,t=!1){return new Promise((n,r)=>{let i=async()=>{try{n(await e())}catch(e){r(e)}};t?this._priorityQueue.push(i):this._normalQueue.push(i),this._drain()})}async _drain(){if(!this._draining){this._draining=!0;try{for(;this._priorityQueue.length>0||this._normalQueue.length>0;){let e=this._priorityQueue.shift()??this._normalQueue.shift();e&&await e()}}finally{this._draining=!1}}}constructor(e){this.dbPath=e?.path??n.path,this.tableName=e?.tableName??n.tableName}async initialize(){this.db=await s(this.dbPath),(await this.db.tableNames()).includes(this.tableName)&&(this.table=await this.db.openTable(this.tableName),await this.createFtsIndex())}async upsert(e,t){if(e.length!==0){if(e.length!==t.length)throw Error(`Record count (${e.length}) does not match vector count (${t.length})`);for(let n=0;n<t.length;n++)if(t[n].length===0)throw Error(`Zero-length vector at index ${n} for record ${e[n].sourcePath}`);return this.enqueueWrite(()=>this._upsertImpl(e,t))}}async upsertInteractive(e,t){if(e.length!==0){if(e.length!==t.length)throw Error(`Record count (${e.length}) does not match vector count (${t.length})`);for(let n=0;n<t.length;n++)if(t[n].length===0)throw Error(`Zero-length vector at index ${n} for record ${e[n].sourcePath}`);return this.enqueueWrite(()=>this._upsertImpl(e,t),!0)}}async _upsertImpl(e,t){let n=e.map((e,n)=>({id:e.id,vector:Array.from(t[n]),content:e.content,sourcePath:e.sourcePath,contentType:e.contentType,headingPath:e.headingPath??``,chunkIndex:e.chunkIndex,totalChunks:e.totalChunks,startLine:e.startLine,endLine:e.endLine,fileHash:e.fileHash,indexedAt:e.indexedAt,origin:e.origin,tags:JSON.stringify(e.tags),category:e.category??``,version:e.version}));if(this.table){let t=[...new Set(e.map(e=>e.sourcePath))];for(let e of t)try{await this.table.delete(`sourcePath = '${d(e,`sourcePath`)}'`)}catch{}await this.table.add(n)}else try{this.table=await this.db?.createTable(this.tableName,n)??null}catch(e){if(String(e).includes(`already exists`)&&this.db)this.table=await this.db.openTable(this.tableName),await this.table.add(n);else throw e}}async search(e,n){if(e.length===0||!this.table)return[];let r=n?.limit??t.maxResults,i=n?.minScore??t.minScore,a=this.table.search(e).limit(r*2),o=this.buildFilterString(n);return o&&(a=a.where(o)),(await a.toArray()).map(e=>({record:this.fromLanceRecord(e),score:1-(e._distance??1)})).filter(e=>e.score>=i).slice(0,r)}async createFtsIndex(){return this.enqueueWrite(()=>this._createFtsIndexImpl())}async _createFtsIndexImpl(){if(this.table)try{await this.table.createIndex(`content`,{config:o.fts({withPosition:!0}),replace:!0}),this._ftsReady=!0,this._ftsRecoveryAttemptAt=0,u.info(`FTS index created/updated`,{column:`content`})}catch(e){u.warn(`FTS index creation failed`,i(e))}}async ftsSearch(e,n){if(!this.table)return[];if(!this._ftsReady){let e=Date.now();if(e-this._ftsRecoveryAttemptAt<r.FTS_RECOVERY_COOLDOWN_MS)return[];this._ftsRecoveryAttemptAt=e;try{await this.createFtsIndex()}catch{return[]}if(!this._ftsReady)return[]}let a=n?.limit??t.maxResults;try{let t=this.table.search(e).limit(a*2),r=this.buildFilterString(n);return r&&(t=t.where(r)),(await t.toArray()).map(e=>({record:this.fromLanceRecord(e),score:e._score??e._relevance_score??0}))}catch(e){return(e instanceof Error?e.message:String(e)).includes(`INVERTED index`)?(u.debug(`FTS search skipped — index not yet available`),this._ftsReady=!1):u.warn(`FTS search failed`,i(e)),[]}}async getById(e){if(!this.table)return null;let t=await this.table.query().where(`id = '${d(e,`id`)}'`).limit(1).toArray();return t.length===0?null:this.fromLanceRecord(t[0])}async deleteBySourcePath(e){return this.enqueueWrite(()=>this._deleteBySourcePathImpl(e))}async _deleteBySourcePathImpl(e){if(!this.table)return 0;let t=await this.getBySourcePath(e);return t.length===0?0:(await this.table.delete(`sourcePath = '${d(e,`sourcePath`)}'`),t.length)}async deleteById(e){return this.enqueueWrite(()=>this._deleteByIdImpl(e))}async deleteByIdInteractive(e){return this.enqueueWrite(()=>this._deleteByIdImpl(e),!0)}async _deleteByIdImpl(e){return!this.table||!await this.getById(e)?!1:(await this.table.delete(`id = '${d(e,`id`)}'`),!0)}async getBySourcePath(e){return this.table?(await this.table.query().where(`sourcePath = '${d(e,`sourcePath`)}'`).limit(1e3).toArray()).map(e=>this.fromLanceRecord(e)):[]}async getStats(){if(!this.table)return{totalRecords:0,totalFiles:0,contentTypeBreakdown:{},lastIndexedAt:null,storeBackend:`lancedb`,embeddingModel:e.model};let t=await this.table.countRows(),n=await this.table.query().select([`sourcePath`,`contentType`,`indexedAt`]).limit(1e5).toArray(),r={},i=new Set,a=null;for(let e of n){let t=e;r[t.contentType]=(r[t.contentType]??0)+1,i.add(t.sourcePath),(!a||t.indexedAt>a)&&(a=t.indexedAt)}return{totalRecords:t,totalFiles:i.size,contentTypeBreakdown:r,lastIndexedAt:a,storeBackend:`lancedb`,embeddingModel:e.model}}async listSourcePaths(){if(!this.table)return[];let e=await this.table.query().select([`sourcePath`]).limit(1e5).toArray();return[...new Set(e.map(e=>e.sourcePath))]}async dropTable(){return this.enqueueWrite(()=>this._dropTableImpl())}async _dropTableImpl(){if(this.db&&(await this.db.tableNames()).includes(this.tableName))for(let e=1;e<=3;e++)try{await this.db.dropTable(this.tableName);break}catch(t){if(e===3)throw t;let n=e*500;u.warn(`dropTable attempt failed, retrying`,{attempt:e,delayMs:n}),await new Promise(e=>setTimeout(e,n))}this.table=null}async close(){try{this.db&&typeof this.db.close==`function`&&await this.db.close()}catch{}this.table=null,this.db=null}buildFilterString(e){let t=[];if(e?.contentType&&t.push(`contentType = '${d(e.contentType,`contentType`)}'`),e?.sourceType){let n=a(e.sourceType);if(n.length>0){let e=n.map(e=>`'${d(e,`sourceType`)}'`).join(`, `);t.push(`contentType IN (${e})`)}}if(e?.origin&&t.push(`origin = '${d(e.origin,`origin`)}'`),e?.category&&t.push(`category = '${d(e.category,`category`)}'`),e?.tags&&e.tags.length>0){let n=e.tags.map(e=>`tags LIKE '%${d(e,`tag`)}%'`);t.push(`(${n.join(` OR `)})`)}return t.length>0?t.join(` AND `):null}fromLanceRecord(e){return{id:e.id,content:e.content,sourcePath:e.sourcePath,contentType:e.contentType,headingPath:e.headingPath||void 0,chunkIndex:e.chunkIndex,totalChunks:e.totalChunks,startLine:e.startLine,endLine:e.endLine,fileHash:e.fileHash,indexedAt:e.indexedAt,origin:e.origin,tags:c(e.tags),category:e.category||void 0,version:e.version}}};export{f as LanceStore};