@vpxa/aikit 0.1.355 → 0.1.356
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/cli/dist/index.js +19 -19
- package/packages/cli/dist/init-DbMdFkrH.js +7 -0
- package/packages/cli/dist/{templates-CztsaGb2.js → templates-zHGu9MXa.js} +16 -16
- package/scaffold/dist/adapters/claude-code.mjs +7 -7
- package/scaffold/dist/adapters/copilot.mjs +3 -3
- package/scaffold/dist/adapters/hermes-agent.mjs +3 -3
- package/scaffold/dist/adapters/hooks.mjs +1 -1
- package/scaffold/dist/definitions/agents.mjs +12 -12
- package/scaffold/dist/definitions/models.mjs +1 -1
- package/scaffold/dist/definitions/prompts.mjs +18 -347
- package/scaffold/dist/definitions/tools.mjs +1 -1
- package/scaffold/vitest.config.mjs +8 -0
- package/packages/cli/dist/init-DFhk2_8C.js +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";import{readFileSync as t}from"node:fs";import{dirname as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{resolveStateDir as a,safeCwdOrHome as ee}from"../../core/dist/index.js";import{createSqliteAdapter as te,createStateStore as o}from"../../store/dist/index.js";import{mkdir as s}from"node:fs/promises";var c=class extends Error{exitCode;constructor(e,t=1){super(e),this.exitCode=t,this.name=`CliError`}};function
|
|
2
|
-
`))console.log(` ${e}`)}}function
|
|
1
|
+
import{createRequire as e}from"node:module";import{readFileSync as t}from"node:fs";import{dirname as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{resolveStateDir as a,safeCwdOrHome as ee}from"../../core/dist/index.js";import{createSqliteAdapter as te,createStateStore as o}from"../../store/dist/index.js";import{mkdir as s}from"node:fs/promises";var c=class extends Error{exitCode;constructor(e,t=1){super(e),this.exitCode=t,this.name=`CliError`}};function l(e){let t=e.indexOf(`--json`);return t===-1?!1:(e.splice(t,1),!0)}function u(e){let t=new WeakSet;console.log(JSON.stringify(e,(e,n)=>{if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return typeof n==`bigint`?String(n):n},2))}async function d(e=ee()){let t=a(r(e));return await s(t,{recursive:!0}),o(await te(r(t,`state.db`)))}function f(){let t=e(import.meta.url);try{return t.resolve(`@vpxa/aikit/package.json`)}catch{return r(i(import.meta.url),`..`,`..`,`..`,`..`,`package.json`)}}function p(){return n(f())}function ne(){try{return JSON.parse(t(f(),`utf-8`)).version??`0.0.0`}catch{return`0.0.0`}}function re(){let t=e(import.meta.url);try{return r(n(t.resolve(`@aikit/server`)),`bin.js`)}catch{return r(p(),`packages`,`server`,`dist`,`bin.js`)}}function ie(e){let t=`--disable-warning=ExperimentalWarning`;return e?e.includes(`ExperimentalWarning`)?e:`${e} ${t}`:t}function ae(e,t,n){let r=e.indexOf(t);if(r===-1||r+1>=e.length)return n;let i=Number.parseInt(e.splice(r,2)[1],10);return Number.isNaN(i)?n:i}function oe(e,t,n){let r=e.indexOf(t);return r===-1||r+1>=e.length?n:e.splice(r,2)[1]}function se(e,t){let n=e.indexOf(t);return n===-1?!1:(e.splice(n,1),!0)}async function ce(){if(process.stdin.isTTY)return``;let e=[];for await(let t of process.stdin)e.push(t);return Buffer.concat(e).toString(`utf-8`)}function le(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function ue(e){return e.map(e=>{let t=e.heading?` ${e.heading}`:``;return`${e.start}-${e.end}${t}`}).join(`, `)}function m(e){switch(e.tool){case`tsc`:case`biome`:console.log(`${e.tool} errors: ${e.errors.length}`);for(let t of e.errors){let e=[t.line,t.column].filter(e=>e!==void 0).join(`:`),n=e?`${t.file}:${e}`:t.file,r=t.code?` ${t.code}`:``;console.log(`- ${n} [${t.severity}${r}] ${t.message}`)}return;case`vitest`:console.log(`Vitest summary`),console.log(` Passed: ${e.summary.passed}`),console.log(` Failed: ${e.summary.failed}`),console.log(` Skipped: ${e.summary.skipped}`),e.summary.duration!==void 0&&console.log(` Duration: ${e.summary.duration}ms`);for(let t of e.summary.tests)t.status===`fail`&&(console.log(`- ${t.name}${t.file?` (${t.file})`:``}`),t.error&&console.log(` ${t.error}`));return;case`git-status`:console.log(`Branch: ${e.status.branch??`unknown`}`),console.log(`Staged: ${e.status.staged.length}`);for(let t of e.status.staged)console.log(` ${t.status} ${t.file}`);console.log(`Unstaged: ${e.status.unstaged.length}`);for(let t of e.status.unstaged)console.log(` ${t.status} ${t.file}`);console.log(`Untracked: ${e.status.untracked.length}`);for(let t of e.status.untracked)console.log(` ?? ${t}`);return}}function h(e){console.log(`Overall: ${e.passed?`passed`:`failed`}`),g(`tsc`,e.tsc.passed,e.tsc.errors),g(`biome`,e.biome.passed,e.biome.errors)}function g(e,t,n){console.log(`${e}: ${t?`passed`:`${n.length} issue(s)`}`);for(let e of n){let t=[e.line,e.column].filter(e=>e!==void 0).join(`:`),n=t?`${e.file}:${t}`:e.file,r=e.code?` ${e.code}`:``;console.log(` - ${n} [${e.severity}${r}] ${e.message}`)}}function _(e){console.log(`Vitest: ${e.passed?`passed`:`failed`}`),console.log(` Duration: ${e.durationMs}ms`),console.log(` Passed: ${e.summary.passed}`),console.log(` Failed: ${e.summary.failed}`),console.log(` Skipped: ${e.summary.skipped}`),e.summary.suites!==void 0&&console.log(` Suites: ${e.summary.suites}`);let t=e.summary.tests.filter(e=>e.status===`fail`);if(t.length!==0){console.log(`Failed tests:`);for(let e of t)console.log(` - ${e.name}${e.file?` (${e.file})`:``}`),e.error&&console.log(` ${e.error}`)}}function v(e){console.log(`Branch: ${e.branch}`),console.log(`Staged: ${e.status.staged.length}`);for(let t of e.status.staged)console.log(` - ${t}`);console.log(`Modified: ${e.status.modified.length}`);for(let t of e.status.modified)console.log(` - ${t}`);console.log(`Untracked: ${e.status.untracked.length}`);for(let t of e.status.untracked)console.log(` - ${t}`);if(console.log(``),console.log(`Recent commits:`),e.recentCommits.length===0)console.log(` none`);else for(let t of e.recentCommits)console.log(` - ${t.hash} ${t.message}`),console.log(` ${t.author} @ ${t.date}`);e.diff&&(console.log(``),console.log(`Diff stat:`),console.log(e.diff))}function y(e){if(e.length===0){console.log(`No diff files found.`);return}for(let t of e){let e=t.oldPath?` (from ${t.oldPath})`:``;console.log(`${t.path}${e}`),console.log(` Status: ${t.status}`),console.log(` Changes: +${t.additions} -${t.deletions}`),console.log(` Hunks: ${t.hunks.length}`);for(let e of t.hunks){let t=e.header?` ${e.header}`:``;console.log(` @@ -${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines} @@${t}`)}}}function b(e){if(console.log(`Start: ${e.start}`),console.log(`Direction: ${e.direction}`),console.log(`Depth reached: ${e.depth}`),console.log(`Nodes: ${e.nodes.length}`),e.nodes.length===0){console.log(`No trace nodes found.`);return}for(let t of e.nodes)console.log(` - [${t.relationship}] ${t.path}:${t.line} ${t.symbol}`)}function x(e){if(console.log(`Query: ${e.query}`),console.log(`Examples: ${e.examples.length} shown (${e.totalFound} total)`),e.examples.length===0){console.log(`No matching examples found.`);return}for(let t of e.examples){console.log(``),console.log(`${t.path}:${t.startLine}-${t.endLine}`),console.log(` Context: ${t.context}`),console.log(` Relevance: ${(t.relevance*100).toFixed(1)}%`);for(let e of t.content.split(`
|
|
2
|
+
`))console.log(` ${e}`)}}function S(e){console.log(e.id),console.log(` Command: ${e.command}${e.args.length>0?` ${e.args.join(` `)}`:``}`),console.log(` PID: ${e.pid??`unknown`}`),console.log(` Status: ${e.status}`),console.log(` Started: ${e.startedAt}`),e.exitCode!==void 0&&console.log(` Exit code: ${e.exitCode}`),console.log(` Logs: ${e.logs.length}`)}function C(e){if(console.log(`Exports scanned: ${e.totalExports}`),console.log(`Dead in source: ${e.totalDeadSource} (actionable)`),console.log(`Dead in docs: ${e.totalDeadDocs} (informational)`),e.totalDeadSource===0&&e.totalDeadDocs===0){console.log(`No dead symbols found.`);return}if(e.deadInSource.length>0){console.log(`
|
|
3
3
|
Dead in source (actionable):`);for(let t of e.deadInSource)console.log(` - ${t.path}:${t.line} ${t.kind} ${t.name}`)}if(e.deadInDocs.length>0){console.log(`
|
|
4
|
-
Dead in docs (informational):`);for(let t of e.deadInDocs)console.log(` - ${t.path}:${t.line} ${t.kind} ${t.name}`)}}function
|
|
5
|
-
`))console.log(` ${t}`)}function M(e,t){if(console.log(`${e}:`),t.length===0){console.log(` none`),console.log(``);return}for(let e of t)console.log(` - ${e}`);console.log(``)}function N(e){let t=e.trim();if(!t)return``;try{return JSON.parse(t)}catch{return e}}function P(e){let t=e.trim();if(!t)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))throw Error(`Checkpoint data must be a JSON object.`);return n}function se(e,t,n=60){let r=new Map;for(let t=0;t<e.length;t++){let i=e[t];r.set(i.record.id,{record:i.record,score:1/(n+t+1)})}for(let e=0;e<t.length;e++){let i=t[e],a=r.get(i.record.id);a?a.score+=1/(n+e+1):r.set(i.record.id,{record:i.record,score:1/(n+e+1)})}return[...r.values()].sort((e,t)=>t.score-e.score)}const F=[`const{spawn:s}=require('child_process')`,`const{existsSync:e,readFileSync:r}=require('fs')`,`const{join:j}=require('path')`,`const{homedir:h}=require('os')`,`const n=process.env.NODE_OPTIONS||'';if(!n.includes('ExperimentalWarning'))process.env.NODE_OPTIONS=n?(n+' --disable-warning=ExperimentalWarning'):'--disable-warning=ExperimentalWarning'`,`const l=(c,a,o={})=>{const p=s(c,a,{stdio:'inherit',env:process.env,...o});p.once('error',q=>{try{process.stderr.write('aikit: failed to start MCP server - '+q.message)}catch{}process.exit(1)});p.once('exit',(q,g)=>process.exit(g==='SIGINT'?130:g==='SIGTERM'?143:(q??1)));for(const g of ['SIGINT','SIGTERM'])process.once(g,()=>{if(!p.killed)p.kill(g)})}`,`const f=j(h(),'.aikit','current-version.json');if(e(f)){try{const{version:g}=JSON.parse(r(f,'utf-8'));const p=j(h(),'.aikit','versions','v'+g,'packages','server','dist','bin.js');if(!e(p))throw Error('Local install not found at '+p);l(process.execPath,[p,'serve'])}catch(c){try{process.stderr.write('aikit: local install failed - '+c.message+'. Run: aikit install')}catch{}process.exit(1)}}else{const c=process.platform==='win32'?'npx.cmd':'npx';l(c,['-y','@vpxa/aikit@latest','serve'],process.platform==='win32'?{shell:true}:{})}`].join(`;`),I=`aikit`,L={type:`stdio`,command:`node`,args:[`-e`,F]},R=[`aikit`,`brainstorming`,`multi-agents-development`,`session-handoff`,`requirements-clarity`,`lesson-learned`,`c4-architecture`,`adr-skill`,`present`,`frontend-design`,`react`,`typescript`,`docs`,`repo-access`],z=[`aikit-basic`,`aikit-advanced`,`_epilogue`],B={"chat.agentFilesLocations":{"~/.claude/agents":!1},"chat.useClaudeMdFile":!1,"github.copilot.chat.copilotMemory.enabled":!0,"chat.customAgentInSubagent.enabled":!0,"chat.useNestedAgentsMdFiles":!0,"chat.useAgentSkills":!0,"github.copilot.chat.switchAgent.enabled":!0,"workbench.browser.enableChatTools":!0,"chat.mcp.apps.enabled":!0,"chat.instructionsFilesLocations":{"~/.copilot/instructions":!0,".github/instructions":!0,".claude/rules":!1,"~/.claude/rules":!1}},V=[{id:`no-grep-search`,toolName:`grep_search`,description:`grep_search / semantic_search → use search`,alternative:`search({ query })`,reason:`Hybrid search across all indexed + curated content — richer results than grep`,severity:`error`,action:`redirect`},{id:`no-semantic-search`,toolName:`semantic_search`,description:`semantic_search → use search`,alternative:`search({ query })`,reason:`Hybrid search across all indexed + curated content — vector + FTS fusion`,severity:`error`,action:`redirect`},{id:`no-grep-symbol`,toolName:`grep_search`,description:`grep_search for a symbol → use symbol`,alternative:`symbol({ name })`,reason:`Definition + references with scope and call context`,severity:`error`,action:`redirect`,heuristic:`grep_search for a specific symbol name`},{id:`no-read-file-understanding`,toolName:`read_file`,description:`read_file to understand a file → use file_summary`,alternative:`file_summary({ path })`,reason:`Structure, exports, imports — 10x fewer tokens than raw file reads`,severity:`error`,action:`warn`,heuristic:`read_file with range > 50 lines and no subsequent edit`},{id:`no-read-file-find-code`,toolName:`read_file`,description:`read_file to find specific code → use compact`,alternative:`compact({ path, query })`,reason:`Fresh compression: compact({ path, query }); query is required unless ref is supplied`,severity:`error`,action:`warn`,heuristic:`read_file to locate specific code without editing`},{id:`no-read-file-multiple`,toolName:`read_file`,description:`Multiple read_file calls → use digest`,alternative:`digest({ sources, query: "<task description>" })`,reason:`Compresses multiple files into token-budgeted summary`,severity:`error`,action:`warn`,heuristic:`consecutive read_file calls on different files without edits`},{id:`no-read-file-large`,toolName:`read_file`,description:`read_file (>50 lines to understand) → use file_summary → compact → digest`,alternative:`file_summary → compact → digest`,reason:`Use compressed context, not raw reads — 10x fewer tokens`,severity:`warning`,action:`warn`,heuristic:`read_file with endLine - startLine > 50 and no subsequent edit on same file`},{id:`no-ctxc-misuse`,toolName:`compact`,description:`Cached ctxc ref to refocus prior output → use compact with ref`,alternative:`compact({ ref }) or compact({ ref, query? })`,reason:`ctxc_... values are reversible refs, not ids or file paths. Prefer enrich: true on follow-up retrieval`,severity:`error`,action:`warn`,heuristic:`using ctxc_ value as a file path instead of as a ref`},{id:`no-terminal-test`,toolName:`run_in_terminal`,description:`run_in_terminal for tests → use test_run`,alternative:`test_run({})`,reason:`Run tests with structured output — no shell needed`,severity:`error`,action:`redirect`,commandPatterns:[`vitest`,`jest`,`mocha`,`pnpm test`,`npm test`]},{id:`no-terminal-typecheck`,toolName:`run_in_terminal`,description:`run_in_terminal for tsc/lint → use check`,alternative:`check({})`,reason:`Typecheck + lint combined, summary output — no shell needed`,severity:`error`,action:`redirect`,commandPatterns:[`\\btsc\\b`,`pnpm check`,`pnpm typecheck`,`pnpm lint`,`biome`]},{id:`no-terminal-grep`,toolName:`run_in_terminal`,description:`run_in_terminal for find/grep → use find or search`,alternative:`find({ pattern }) or search({ query })`,reason:`No shell needed, richer results with AI Kit search`,severity:`error`,action:`redirect`,commandPatterns:[`\\bgrep\\b`,`\\bfind\\b`,`\\brg\\b`,`Select-String`]},{id:`no-terminal-code-edits`,toolName:`run_in_terminal`,description:`run_in_terminal for code edits → use replace_string_in_file`,alternative:`replace_string_in_file`,reason:`Avoid shell-edit loops; use native edit tool instead`,severity:`error`,action:`redirect`,commandPatterns:[`sed`,`awk`,`Set-Content`,`Out-File`,`>>`,`\\| tee`]},{id:`no-edit-without-reading`,toolName:`replace_string_in_file`,description:`Editing without reading → use file_summary then targeted read_file`,alternative:`file_summary({ path }) → read_file({ path, offset, limit })`,reason:`Safer edits: understand structure before modifying`,severity:`error`,action:`warn`,heuristic:`replace_string_in_file on a file not previously read`},{id:`no-get-changed-files`,toolName:`get_changed_files`,description:`get_changed_files → use run_in_terminal with git diff`,alternative:"run_in_terminal with `git diff <specific-file>`",reason:`Diff only target file instead of all uncommitted diffs (100K+ tokens)`,severity:`error`,action:`redirect`},{id:`no-fetch-webpage`,toolName:`fetch_webpage`,description:`fetch_webpage → use web_fetch`,alternative:`web_fetch({ url })`,reason:`Readability extract + token budget — richer output than raw fetch`,severity:`error`,action:`redirect`},{id:`no-subagent-present`,toolName:`present`,description:`present (from subagent) → return structured text`,alternative:`Return findings as structured text`,reason:`Subagent present calls are invisible to the user (only Orchestrator should present)`,severity:`error`,action:`warn`,heuristic:`present called in subagent context`},{id:`no-apply-patch`,toolName:`apply_patch`,description:`apply_patch → use native edit tool`,alternative:`edit file tool`,reason:`AI Kit does not manage apply_patch; use the host environment edit tool`,severity:`warning`,action:`warn`},{id:`no-memory-native`,toolName:`memory`,description:`memory tool → use knowledge tool`,alternative:`knowledge (remember / search / list)`,reason:`AI Kit knowledge tool provides persistent cross-session memory with categories and tags`,severity:`warning`,action:`warn`}];function H(e){let t=e.toolName;if(e.commandPatterns&&e.commandPatterns.length>0){let n=e.description.match(/^(.*?)\s*→/);n&&(t=n[1].trim())}else if(e.heuristic){let n=e.description.match(/^(.*?)\s*→/);n&&(t=n[1].trim())}return{id:e.id,forbidden:t,alternative:e.alternative,severity:e.severity,reason:e.reason,matchPattern:e.commandPatterns?null:e.toolName,commandPatterns:e.commandPatterns??null,heuristic:e.heuristic??null}}const U=V.map(H);function W(){return[`| NEVER use this | USE THIS AI Kit TOOL INSTEAD | Why |`,`|---|---|---|`,...U.filter(e=>e.severity===`error`).map(e=>`| \`${e.forbidden}\` | \`${e.alternative}\` | ${e.reason} |`)].join(`
|
|
6
|
-
`)}function
|
|
4
|
+
Dead in docs (informational):`);for(let t of e.deadInDocs)console.log(` - ${t.path}:${t.line} ${t.kind} ${t.name}`)}}function w(e){console.log(e.path),console.log(` Language: ${e.language}`),console.log(` Lines: ${e.lines}`),console.log(` Estimated tokens: ~${e.estimatedTokens}`),console.log(``),O(`Imports`,e.imports),O(`Exports`,e.exports),O(`Functions`,e.functions.map(e=>`${e.name} @ line ${e.line}${e.exported?` [exported]`:``}`)),O(`Classes`,e.classes.map(e=>`${e.name} @ line ${e.line}${e.exported?` [exported]`:``}`)),O(`Interfaces`,e.interfaces.map(e=>`${e.name} @ line ${e.line}`)),O(`Types`,e.types.map(e=>`${e.name} @ line ${e.line}`))}function T(e){if(console.log(`Symbol: ${e.name}`),e.definedIn?console.log(`Defined in: ${e.definedIn.path}:${e.definedIn.line} (${e.definedIn.kind})`):console.log(`Defined in: not found`),console.log(``),console.log(`Imported by:`),e.importedBy.length===0)console.log(` none`);else for(let t of e.importedBy)console.log(` - ${t.path}:${t.line} ${t.importStatement}`);if(console.log(``),console.log(`Referenced in:`),e.referencedIn.length===0)console.log(` none`);else for(let t of e.referencedIn)console.log(` - ${t.path}:${t.line} ${t.context}`)}function E(e){console.log(e.name),console.log(` Files: ${e.files.length}`),console.log(` Updated: ${e.updated}`),e.description&&console.log(` Description: ${e.description}`);for(let t of e.files)console.log(` - ${t}`)}function D(e){let t=Array.isArray(e.data.files)?e.data.files.filter(e=>typeof e==`string`):[];if(console.log(e.id),console.log(` Label: ${e.label}`),console.log(` Created: ${e.createdAt}`),e.notes&&console.log(` Notes: ${e.notes}`),t.length>0){console.log(` Files: ${t.length}`);for(let e of t)console.log(` - ${e}`)}console.log(` Data:`);for(let t of JSON.stringify(e.data,null,2).split(`
|
|
5
|
+
`))console.log(` ${t}`)}function O(e,t){if(console.log(`${e}:`),t.length===0){console.log(` none`),console.log(``);return}for(let e of t)console.log(` - ${e}`);console.log(``)}function k(e){let t=e.trim();if(!t)return``;try{return JSON.parse(t)}catch{return e}}function A(e){let t=e.trim();if(!t)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))throw Error(`Checkpoint data must be a JSON object.`);return n}function j(e,t,n=60){let r=new Map;for(let t=0;t<e.length;t++){let i=e[t];r.set(i.record.id,{record:i.record,score:1/(n+t+1)})}for(let e=0;e<t.length;e++){let i=t[e],a=r.get(i.record.id);a?a.score+=1/(n+e+1):r.set(i.record.id,{record:i.record,score:1/(n+e+1)})}return[...r.values()].sort((e,t)=>t.score-e.score)}const M=[`const{spawn:s}=require('child_process')`,`const{existsSync:e,readFileSync:r}=require('fs')`,`const{join:j}=require('path')`,`const{homedir:h}=require('os')`,`const n=process.env.NODE_OPTIONS||'';if(!n.includes('ExperimentalWarning'))process.env.NODE_OPTIONS=n?(n+' --disable-warning=ExperimentalWarning'):'--disable-warning=ExperimentalWarning'`,`const l=(c,a,o={})=>{const p=s(c,a,{stdio:'inherit',env:process.env,...o});p.once('error',q=>{try{process.stderr.write('aikit: failed to start MCP server - '+q.message)}catch{}process.exit(1)});p.once('exit',(q,g)=>process.exit(g==='SIGINT'?130:g==='SIGTERM'?143:(q??1)));for(const g of ['SIGINT','SIGTERM'])process.once(g,()=>{if(!p.killed)p.kill(g)})}`,`const f=j(h(),'.aikit','current-version.json');if(e(f)){try{const{version:g}=JSON.parse(r(f,'utf-8'));const p=j(h(),'.aikit','versions','v'+g,'packages','server','dist','bin.js');if(!e(p))throw Error('Local install not found at '+p);l(process.execPath,[p,'serve'])}catch(c){try{process.stderr.write('aikit: local install failed - '+c.message+'. Run: aikit install')}catch{}process.exit(1)}}else{const c=process.platform==='win32'?'npx.cmd':'npx';l(c,['-y','@vpxa/aikit@latest','serve'],process.platform==='win32'?{shell:true}:{})}`].join(`;`),N=`aikit`,P={type:`stdio`,command:`node`,args:[`-e`,M]},F=[`aikit`,`brainstorming`,`multi-agents-development`,`session-handoff`,`requirements-clarity`,`lesson-learned`,`c4-architecture`,`adr-skill`,`present`,`frontend-design`,`react`,`typescript`,`docs`,`repo-access`],I=[`aikit-basic`,`aikit-advanced`,`_epilogue`],L={"chat.agentFilesLocations":{"~/.claude/agents":!1},"chat.useClaudeMdFile":!1,"github.copilot.chat.copilotMemory.enabled":!0,"chat.customAgentInSubagent.enabled":!0,"chat.useNestedAgentsMdFiles":!0,"chat.useAgentSkills":!0,"github.copilot.chat.switchAgent.enabled":!0,"workbench.browser.enableChatTools":!0,"chat.mcp.apps.enabled":!0,"chat.instructionsFilesLocations":{"~/.copilot/instructions":!0,".github/instructions":!0,".claude/rules":!1,"~/.claude/rules":!1}},R=[`copilot`,`claude`,`copilotCli`,`hermes`],z={SessionStart:{copilot:`SessionStart`,claude:`PreToolCall`,copilotCli:`sessionStart`,hermes:`SessionStart`},PreToolUse:{copilot:`PreToolUse`,claude:`PreToolCall`,copilotCli:`preToolUse`,hermes:`PreToolUse`},PostToolUse:{copilot:`PostToolUse`,claude:`PostToolCall`,copilotCli:`postToolUse`,hermes:`PostToolUse`},SubagentStart:{copilot:`SubagentStart`,claude:`PreToolCall`,copilotCli:`subagentStart`,hermes:`SubagentStart`},PreCompact:{copilot:`PreCompact`,claude:`PreToolCall`,copilotCli:`preCompact`,hermes:`PreCompact`},Stop:{copilot:`Stop`,claude:`PostToolCall`,copilotCli:`stop`,hermes:`Stop`}},B={fileRead:{copilot:[`read_file`,`readFile`],claude:[`Read`],copilotCli:[`read_file`],hermes:[`read_file`]},fileWrite:{copilot:[`editFiles`,`replace_string_in_file`,`create_file`],claude:[`Write`,`Edit`],copilotCli:[`editFiles`,`replace_string_in_file`],hermes:[`write_file`,`patch`]},fileSearch:{copilot:[`grep_search`,`semantic_search`,`find`],claude:[`Bash`],copilotCli:[`grep_search`],hermes:[`search_files`]}},V={"privacy-guard":{id:`privacy-guard`,event:`PreToolUse`,tier:`safety`,description:`Blocks reads of secret-bearing env files, key material, SSH paths, and credential artifacts.`,script:`privacy-guard.mjs`,matcher:[`fileRead`],scope:`user`,patterns:[`.env`,`*.pem`,`*.key`,`id_rsa*`,`.ssh/*`,`*credentials*`,`*.secret`]},"scout-guard":{id:`scout-guard`,event:`PreToolUse`,tier:`safety`,description:`Blocks reads and searches inside generated, dependency, and git object directories.`,script:`scout-guard.mjs`,matcher:[`fileRead`,`fileSearch`],scope:`user`,patterns:[`node_modules/`,`dist/`,`.git/objects/`,`vendor/`,`build/`]},"subagent-context":{id:`subagent-context`,event:`SubagentStart`,tier:`efficiency`,description:`Injects compact project context into each subagent spawn to reduce repeated discovery.`,script:`subagent-context.mjs`,scope:`user`},"pre-compact-save":{id:`pre-compact-save`,event:`PreCompact`,tier:`efficiency`,description:`Persists critical state before context compaction truncates recent session history.`,script:`pre-compact-save.mjs`,scope:`user`},"post-edit-check":{id:`post-edit-check`,event:`PostToolUse`,tier:`nudge`,description:`After repeated file edits, injects a validation reminder so checks are not skipped.`,script:`post-edit-check.mjs`,matcher:[`fileWrite`],scope:`user`},"session-init":{id:`session-init`,event:`SessionStart`,tier:`nudge`,description:`Detects project stack and injects workspace metadata and environment context at startup.`,script:`session-init.mjs`,scope:`user`},"session-observer":{id:`session-observer`,event:`PostToolUse`,tier:`efficiency`,description:`Captures tool usage patterns for autonomous lesson extraction. Writes to session buffer.`,script:`session-observer.mjs`,scope:`user`},"session-learn":{id:`session-learn`,event:`Stop`,tier:`efficiency`,description:`Nudges final pattern analysis on buffered observations at session end.`,script:`session-learn.mjs`,scope:`user`}},de={PreCompact:3e3,PostToolUse:3e3},H={copilot:`hooks.json`,copilotCli:`hooks.json`,hermes:`hooks.json`},U=R;function W(e){if(!U.includes(e))throw Error(`Unknown platform: "${e}". Supported: ${U.join(`, `)}. Add it to SUPPORTED_PLATFORMS in exec-hooks.mjs first, then add entries to HOOK_EVENTS and HOOK_TOOL_MATCHERS. Add FILE_NAMES in generateHooks if file-producing.`);for(let[t,n]of Object.entries(z))if(!(e in n))throw Error(`Platform "${e}" is missing from HOOK_EVENTS.${t}. Add a "${e}" key to HOOK_EVENTS.${t} in exec-hooks.mjs.`);for(let[t,n]of Object.entries(B))if(!(e in n))throw Error(`Platform "${e}" is missing from HOOK_TOOL_MATCHERS.${t}. Add a "${e}" key to HOOK_TOOL_MATCHERS.${t} in exec-hooks.mjs.`)}function fe(e,t){return(e.matcher||[]).flatMap(e=>{let n=B[e];if(!n)throw Error(`Unknown hook matcher: ${e}`);return n[t]||[]})}function G(e,t,n,r){let i=`${n}/${e.script}`;return fe(e,r),r===`copilot`?{event:t,steps:[{type:`command`,command:`node`,args:[i],timeout:de[e.event]||5e3}]}:r===`claude`?{type:`command`,command:`node ${i}`}:{command:`node`,args:[i]}}function pe(e,t){W(e);let n={};for(let r of Object.values(V)){let i=z[r.event]?.[e];if(!i){console.warn(`[aikit] Unsupported hook event ${r.event} for ${e} — skipping`);continue}n[i]||=[],n[i].push(G(r,i,t,e))}return{hooks:n}}function me(e,t){if(W(e),e===`copilot`){let n=Object.values(V).flatMap(n=>{let r=z[n.event]?.[e];return r?G(n,r,t,e):(console.warn(`[aikit] Unsupported hook event ${n.event} for ${e} — skipping`),[])});return[{path:H[e],content:JSON.stringify({hooks:n},null,2)}]}if(e===`claude`)return[];if(!(e in H))throw Error(`Platform "${e}" is missing from FILE_NAMES. Add "${e}: '<filename>'" to FILE_NAMES in adapters/hooks.mjs.`);let n={};for(let r of Object.values(V)){let i=z[r.event]?.[e];if(!i){console.warn(`[aikit] Unsupported hook event ${r.event} for ${e} — skipping`);continue}n[i]||=[],n[i].push(G(r,i,t,e))}return[{path:H[e],content:JSON.stringify({hooks:n},null,2)}]}function he(){return[`_runtime.mjs`,...Object.values(V).map(e=>e.script)]}const ge=[{id:`no-grep-search`,toolName:`grep_search`,description:`grep_search / semantic_search → use search`,alternative:`search({ query })`,reason:`Hybrid search across all indexed + curated content — richer results than grep`,severity:`error`,action:`redirect`},{id:`no-semantic-search`,toolName:`semantic_search`,description:`semantic_search → use search`,alternative:`search({ query })`,reason:`Hybrid search across all indexed + curated content — vector + FTS fusion`,severity:`error`,action:`redirect`},{id:`no-grep-symbol`,toolName:`grep_search`,description:`grep_search for a symbol → use symbol`,alternative:`symbol({ name })`,reason:`Definition + references with scope and call context`,severity:`error`,action:`redirect`,heuristic:`grep_search for a specific symbol name`},{id:`no-read-file-understanding`,toolName:`read_file`,description:`read_file to understand a file → use file_summary`,alternative:`file_summary({ path })`,reason:`Structure, exports, imports — 10x fewer tokens than raw file reads`,severity:`error`,action:`warn`,heuristic:`read_file with range > 50 lines and no subsequent edit`},{id:`no-read-file-find-code`,toolName:`read_file`,description:`read_file to find specific code → use compact`,alternative:`compact({ path, query })`,reason:`Fresh compression: compact({ path, query }); query is required unless ref is supplied`,severity:`error`,action:`warn`,heuristic:`read_file to locate specific code without editing`},{id:`no-read-file-multiple`,toolName:`read_file`,description:`Multiple read_file calls → use digest`,alternative:`digest({ sources, query: "<task description>" })`,reason:`Compresses multiple files into token-budgeted summary`,severity:`error`,action:`warn`,heuristic:`consecutive read_file calls on different files without edits`},{id:`no-read-file-large`,toolName:`read_file`,description:`read_file (>50 lines to understand) → use file_summary → compact → digest`,alternative:`file_summary → compact → digest`,reason:`Use compressed context, not raw reads — 10x fewer tokens`,severity:`warning`,action:`warn`,heuristic:`read_file with endLine - startLine > 50 and no subsequent edit on same file`},{id:`no-ctxc-misuse`,toolName:`compact`,description:`Cached ctxc ref to refocus prior output → use compact with ref`,alternative:`compact({ ref }) or compact({ ref, query? })`,reason:`ctxc_... values are reversible refs, not ids or file paths. Prefer enrich: true on follow-up retrieval`,severity:`error`,action:`warn`,heuristic:`using ctxc_ value as a file path instead of as a ref`},{id:`no-terminal-test`,toolName:`run_in_terminal`,description:`run_in_terminal for tests → use test_run`,alternative:`test_run({})`,reason:`Run tests with structured output — no shell needed`,severity:`error`,action:`redirect`,commandPatterns:[`vitest`,`jest`,`mocha`,`pnpm test`,`npm test`]},{id:`no-terminal-typecheck`,toolName:`run_in_terminal`,description:`run_in_terminal for tsc/lint → use check`,alternative:`check({})`,reason:`Typecheck + lint combined, summary output — no shell needed`,severity:`error`,action:`redirect`,commandPatterns:[`\\btsc\\b`,`pnpm check`,`pnpm typecheck`,`pnpm lint`,`biome`]},{id:`no-terminal-grep`,toolName:`run_in_terminal`,description:`run_in_terminal for find/grep → use find or search`,alternative:`find({ pattern }) or search({ query })`,reason:`No shell needed, richer results with AI Kit search`,severity:`error`,action:`redirect`,commandPatterns:[`\\bgrep\\b`,`\\bfind\\b`,`\\brg\\b`,`Select-String`]},{id:`no-terminal-code-edits`,toolName:`run_in_terminal`,description:`run_in_terminal for code edits → use replace_string_in_file`,alternative:`replace_string_in_file`,reason:`Avoid shell-edit loops; use native edit tool instead`,severity:`error`,action:`redirect`,commandPatterns:[`sed`,`awk`,`Set-Content`,`Out-File`,`>>`,`\\| tee`]},{id:`no-edit-without-reading`,toolName:`replace_string_in_file`,description:`Editing without reading → use file_summary then targeted read_file`,alternative:`file_summary({ path }) → read_file({ path, offset, limit })`,reason:`Safer edits: understand structure before modifying`,severity:`error`,action:`warn`,heuristic:`replace_string_in_file on a file not previously read`},{id:`no-get-changed-files`,toolName:`get_changed_files`,description:`get_changed_files → use run_in_terminal with git diff`,alternative:"run_in_terminal with `git diff <specific-file>`",reason:`Diff only target file instead of all uncommitted diffs (100K+ tokens)`,severity:`error`,action:`redirect`},{id:`no-fetch-webpage`,toolName:`fetch_webpage`,description:`fetch_webpage → use web_fetch`,alternative:`web_fetch({ url })`,reason:`Readability extract + token budget — richer output than raw fetch`,severity:`error`,action:`redirect`},{id:`no-subagent-present`,toolName:`present`,description:`present (from subagent) → return structured text`,alternative:`Return findings as structured text`,reason:`Subagent present calls are invisible to the user (only Orchestrator should present)`,severity:`error`,action:`warn`,heuristic:`present called in subagent context`},{id:`no-apply-patch`,toolName:`apply_patch`,description:`apply_patch → use native edit tool`,alternative:`edit file tool`,reason:`AI Kit does not manage apply_patch; use the host environment edit tool`,severity:`warning`,action:`warn`},{id:`no-memory-native`,toolName:`memory`,description:`memory tool → use knowledge tool`,alternative:`knowledge (remember / search / list)`,reason:`AI Kit knowledge tool provides persistent cross-session memory with categories and tags`,severity:`warning`,action:`warn`}];function _e(e){let t=e.toolName;if(e.commandPatterns&&e.commandPatterns.length>0){let n=e.description.match(/^(.*?)\s*→/);n&&(t=n[1].trim())}else if(e.heuristic){let n=e.description.match(/^(.*?)\s*→/);n&&(t=n[1].trim())}return{id:e.id,forbidden:t,alternative:e.alternative,severity:e.severity,reason:e.reason,matchPattern:e.commandPatterns?null:e.toolName,commandPatterns:e.commandPatterns??null,heuristic:e.heuristic??null}}const ve=ge.map(_e);function ye(){return[`| NEVER use this | USE THIS AI Kit TOOL INSTEAD | Why |`,`|---|---|---|`,...ve.filter(e=>e.severity===`error`).map(e=>`| \`${e.forbidden}\` | \`${e.alternative}\` | ${e.reason} |`)].join(`
|
|
6
|
+
`)}function K(e){return`
|
|
7
7
|
## Flow Context Bootstrap
|
|
8
8
|
|
|
9
9
|
When dispatched as a subagent within an active flow:
|
|
@@ -22,9 +22,9 @@ When dispatched as a subagent within an active flow:
|
|
|
22
22
|
|
|
23
23
|
${e===`<PROFILE>`?`**Profile:** Check your role → implementer | documenter | reviewer | researcher | debugger`:`**Profile:** \`${e}\``}
|
|
24
24
|
|
|
25
|
-
---`}function
|
|
25
|
+
---`}function be(){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 q(...e){return e.filter(Boolean).join(`
|
|
26
26
|
|
|
27
|
-
`)}const
|
|
27
|
+
`)}const xe=Object.freeze({version:1,l0MemoriesDir:`memories`,sessionStart:{requiredCards:[`workspace-core`],maxAdditionalCards:1,activeFlowPreference:`workflow-card`,totalTokenBudget:2100},retrievalOrder:[`l0`,`l1`,`l2-on-demand`,`l3-evidence-only`],noFlowFallback:`l0-plus-l2-with-turn-local-context`,degradedFallback:`prelude-manifest-canonical-markdown`,lifecycleAuthority:`opaque-owner-capability`,autoKnowledgeMode:`observer-only`,l0Budgets:Object.freeze({"workspace-core":{min:800,max:1200},architecture:{min:600,max:900},"testing-release":{min:600,max:900},"known-issues":{min:400,max:700},"workflow:*":{min:500,max:900}})});function J(e={}){let{audience:t=`agent`}=e,n=xe,r=`## Layered Knowledge Protocol (v${n.version})
|
|
28
28
|
|
|
29
29
|
AI Kit delivers knowledge through four layers:
|
|
30
30
|
|
|
@@ -54,15 +54,15 @@ AI Kit delivers knowledge through four layers:
|
|
|
54
54
|
- Route L1 withdrawal by configured profile; never promote.
|
|
55
55
|
- Emit L3 evidence as observer-only; never navigate flow state.`:t===`flow`?r+`
|
|
56
56
|
### Step Contracts
|
|
57
|
-
Each built-in flow step declares knowledge inputs (L0 card types, L1 fields, L2 refs, L3 evidence), context updates, candidate learnings, and handoff artifacts. The step knowledge contract drives role-aware L1 projection.`:r}const
|
|
58
|
-
`).replace(/\\r/g,`\r`).replace(/\\t/g,` `).replace(/\\\\/g,`\\`)}function
|
|
57
|
+
Each built-in flow step declares knowledge inputs (L0 card types, L1 fields, L2 refs, L3 evidence), context updates, candidate learnings, and handoff artifacts. The step knowledge contract drives role-aware L1 projection.`:r}const Se=q(`## Output Rules (HARD RULE)`,`**Plain text is allowed only when ALL are true:**`,` - Response is 1-2 short sentences.`,` - No table, list, checklist, plan, report, verdict, review, summary, progress, evidence map, or batch result is being returned.`,` - No user approval, mandatory stop, or choice is needed.`,"Follow the **Presentation Priority** (1st Inline Visual - `present({ schemaVersion: 1, title, blocks })` → 2nd Interactive - `present({ schemaVersion: 1, title, blocks, actions })` → 3rd Plain Text). Only tiny status/questions that pass the gate above → plain text (Priority 3). Prefer `present` for all others, especially summaries, comparisons, reports, task plans, verdicts, and progress.");function Y(){return'## Tool Preference — AI Kit First (HARD RULE)\n\n**Never start with `read_file`, `grep_search`, `semantic_search`, or `run_in_terminal`. AI Kit tools replace all of these.**\n\n| Need | Use | NEVER |\n|------|-----|-------|\n| Structure of a file | `file_summary({ path })` | `read_file` to "understand" it |\n| Find specific code | `file_summary({ files, tier: \'T2\', query })` | `read_file` to search |\n| Multiple files | `digest({ sources, query })` | Multiple `read_file` calls |\n| Reuse previous output | `file_summary({ ref, query })` with `enrich:true` | Re-reading same file |\n| Search codebase | `search({ query })` | `grep_search` / `semantic_search` |\n| Find a symbol | `symbol({ name })` | `grep_search` |\n| Trace data flow | `trace({ items: [{start, direction}] })` | Manual code tracing |\n| Module relationships | `graph({action:\'neighbors\', node_id})` | Manual import tracing |\n| Typecheck + lint | `check({})` | `run_in_terminal tsc` / biome |\n| Run tests | `test_run({})` | `run_in_terminal vitest` |\n| Impact analysis | `blast_radius({ changed_files })` | Manual caller tracing |\n| Complexity metrics | `measure({ path })` | Line counting / wc |\n| L0 briefing card (workspace-core) | `aikit://l0/workspace-core` resource (full card), `file_summary` | Raw file discovery |\n| L0 briefing card (known issues) | `search({ query: "known issues" })` + `knowledge({ action: "lesson" })` | Manual history review |\n| Web research | `web_search({ queries })` + `web_fetch({ urls })` | `fetch_webpage` |\n\n`read_file` is ONLY acceptable when you need exact line content FOR EDITING (before `replace_string_in_file`).\n\nEven then, use `file_summary` first to identify which lines to read.'}const Ce=q(`## AI Kit Recovery`,"If AI Kit tools are unavailable or missing, run `npx -y @vpxa/aikit@latest init --user`, then reload the client so the `aikit` MCP server and user instructions become available.");`${Y()}${ye()}${be()}`,`${K(`researcher`)}${Y()}`,`${K(`reviewer`)}${Y()}`,`${K(`reviewer`)}${Y()}`,J({audience:`agent`});const we=/{\s*name:\s*'((?:\\.|[^'])*)',\s*rationale:\s*'((?:\\.|[^'])*)',\s*bitterLessonSafe:\s*(?:true|false),\s*}/g;let X=null;function Z(e){return e.replace(/\\'/g,`'`).replace(/\\n/g,`
|
|
58
|
+
`).replace(/\\r/g,`\r`).replace(/\\t/g,` `).replace(/\\\\/g,`\\`)}function Q(){if(X)return X;let e=r(p(),`scaffold`,`definitions`,`exclusions.mjs`),n=t(e,`utf8`),i=Array.from(n.matchAll(we),([,e,t])=>({name:Z(e),rationale:Z(t)}));if(i.length===0)throw Error(`Failed to parse permanent exclusions from ${e}`);return X=i,i}function $(e){return e.replace(/\|/g,`\\|`).replace(/\r?\n+/g,` `).trim()}function Te(){return`## Permanent Exclusions
|
|
59
59
|
|
|
60
60
|
These capabilities are intentionally NOT provided by aikit. Each decision follows the Bitter Lesson: leverage computation and configurable tools over hand-crafted features.
|
|
61
61
|
|
|
62
62
|
| Capability | Rationale |
|
|
63
63
|
|-----------|-----------|
|
|
64
|
-
${
|
|
65
|
-
`)}`}function
|
|
64
|
+
${Q().map(({name:e,rationale:t})=>`| ${$(e)} | ${$(t)} |`).join(`
|
|
65
|
+
`)}`}function Ee(e,t){return`# ${e} — Copilot Instructions
|
|
66
66
|
|
|
67
67
|
This project has an MCP server (\`${t}\`) providing 64 tools for search, analysis, memory, and validation.
|
|
68
68
|
**These tools REPLACE most native IDE tools.** You MUST use them.
|
|
@@ -119,7 +119,7 @@ ${J({audience:`agent`})}
|
|
|
119
119
|
4. **Validate** — \`check({})\` + \`test_run({})\` before presenting changes. \`blast_radius({ changed_files })\` for impact.
|
|
120
120
|
5. **Lifecycle** — Check \`status({})\` first. If onboard not run, run \`onboard({ path: "." })\`. After implementation, \`reindex({})\` + \`produce_knowledge({})\`. At session end, \`remember()\` checkpoint.
|
|
121
121
|
|
|
122
|
-
${
|
|
122
|
+
${Te()}
|
|
123
123
|
|
|
124
124
|
## User Interaction Rules
|
|
125
125
|
|
|
@@ -137,7 +137,7 @@ When you need to explain something or ask for user input:
|
|
|
137
137
|
- Free-form text input always goes through elicitation, even when using \`present\` for the explanation
|
|
138
138
|
- Prefer the simplest method that adequately conveys the information
|
|
139
139
|
|
|
140
|
-
${
|
|
140
|
+
${Se}
|
|
141
141
|
|
|
142
142
|
## Communication Style
|
|
143
143
|
|
|
@@ -211,8 +211,8 @@ knowledge({ action: "remember", title: "Session checkpoint: <topic>", content:
|
|
|
211
211
|
search({ query: "SESSION CHECKPOINT", origin: "curated" })
|
|
212
212
|
\`\`\`
|
|
213
213
|
|
|
214
|
-
${
|
|
215
|
-
`}function
|
|
214
|
+
${Ce}
|
|
215
|
+
`}function De(e,t){return`# ${e} — Agent Instructions
|
|
216
216
|
|
|
217
217
|
## AI Kit MCP Server (\`${t}\`)
|
|
218
218
|
|
|
@@ -328,4 +328,4 @@ Both ReactFlow viewers include an **AI Kit** attribution badge (bottom-right). A
|
|
|
328
328
|
## Full Documentation
|
|
329
329
|
|
|
330
330
|
For complete tool documentation (62 tools), workflow chains, search strategies, session protocol, and persistent memory patterns, load the \`aikit\` skill at session start.
|
|
331
|
-
`}export{
|
|
331
|
+
`}export{S as A,ie as B,D as C,w as D,x as E,E as F,ce as I,re as L,T as M,_ as N,v as O,b as P,j as R,h as S,y as T,p as _,he as a,k as b,N as c,c as d,d as f,ue as g,oe as h,me as i,m as j,u as k,F as l,ae as m,Ee as n,I as o,se as p,pe as r,P as s,De as t,L as u,ne as v,C as w,A as x,l as y,le as z};
|
|
@@ -1,8 +1,8 @@
|
|
|
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,buildFlowSection as h,buildHooksSection as g,buildMcpConfigJson as _,buildSkillsSection as v,lowerFirst as y}from"./_shared.mjs";
|
|
2
|
-
`)}function
|
|
3
|
-
`)}function
|
|
4
|
-
`)}function
|
|
5
|
-
`)}function
|
|
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,buildFlowSection as h,buildHooksSection as g,buildMcpConfigJson as _,buildSkillsSection as v,lowerFirst as y}from"./_shared.mjs";const b=h({flowTool:`flow`,isLifecycleOwner:!0}),x=h({flowTool:`flow`,isLifecycleOwner:!0}),S=h({flowTool:`flow`,isLifecycleOwner:!1});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(`
|
|
2
|
+
`)}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(`
|
|
3
|
+
`)}function j(t=p(e,a(`claude-code`))){return[`# aikit — Claude Code Agents`,``,c,``,s,``,`## MCP Server`,``,"Server name: `aikit`","Configured in `.mcp.json` (project) and `~/.claude.json` (user-global — `claude mcp add --scope user` format).","Default agent: `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator automatically.",``,`## Agents`,``,t,``,`## Agent Files`,``,A(`.claude/agents`),``,`## Commands`,``,"Slash commands live under `.claude/commands/`.",``,`## Session Protocol`,``,g(n),``].join(`
|
|
4
|
+
`)}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` (project) and `~/.claude.json` (user-global — written by `claude mcp add --scope user`).","Default agent set to `Orchestrator` in `~/.claude/settings.json` — every conversation starts as Orchestrator, no `/agent` command needed.",``,"Start with `AGENTS.md`, then open the specific sub-agent file you want to use.",``,c,``,s,``].join(`
|
|
5
|
+
`)}function N(e,t,n,r,i){let a=T(t.toolRole),o=O(t),s=v(t.skills),c=e===`Orchestrator`?[b,x]:[S],l=[n,...o,t.bodyAddendum,s,...c].filter(Boolean).join(`
|
|
6
6
|
|
|
7
|
-
`).trim(),
|
|
8
|
-
`)}function
|
|
7
|
+
`).trim(),u=t.identity?`You are the **${e}**${t.identity}`:`You are the **${e}**, ${y(t.description)}.`,d=i?.[e],f=[`---`,`name: ${C(e)}`,`description: ${w(t.description)}`,...d?[`model: ${w(d)}`]:[],`allowedTools:`,...a.map(e=>` - ${e}`),`---`,``,`# ${e} - ${t.title||e}`,``,u];return l&&f.push(``,l),f.push(``),f.join(`
|
|
8
|
+
`)}function P(){let t=[],n=a(`claude-code`),s=p(e,n),c=m(e);t.push({path:`.mcp.json`,content:`${_({serverName:i,mcpEntry:r,configKey:`mcpServers`})}\n`}),t.push({path:`CLAUDE.md`,content:M()}),t.push({path:`AGENTS.md`,content:j(s)});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,c);if(i.variants){for(let[a,o]of Object.entries(i.variants)){let c=`${r}-${a}`;t.push({path:`.claude/agents/${c}.md`,content:N(c,{...i,description:o.description||i.description,identity:o.identity,bodyAddendum:o.bodyAddendum},e,s,n)})}continue}t.push({path:`.claude/agents/${r}.md`,content:N(r,i,e,s,n)})}return t}export{b as CLAUDE_FLOWS_SECTION,x as CLAUDE_ORCHESTRATOR_FLOW_ROUTING_SECTION,P as generateClaudeCode};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{VARIANT_GROUPS as n,getPrimaryAgentModel 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,buildFlowSection as d,buildSubagentFlowSection as f}from"./_shared.mjs";import{
|
|
1
|
+
import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{VARIANT_GROUPS as n,getPrimaryAgentModel 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,buildFlowSection as d,buildSubagentFlowSection as f}from"./_shared.mjs";import{generateForbiddenTable as p}from"../definitions/policies.mjs";import{generateHooks as m,getHookScriptFiles as h}from"./hooks.mjs";const g={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 _(e){return`[${[...(l[e]||[]).map(e=>g[e]).filter(Boolean),`aikit/*`].join(`, `)}]`}function v(e){return r(`copilot`,e,`Auto (copilot)`)}const y=d({flowTool:`flow`,isLifecycleOwner:!0}),b=f({flowTool:`flow`});function x(){let t=[];for(let[i,a]of Object.entries(e))if(a.variants)for(let e of n[i]||[]){let n=`${i}-${e}`,o=r(`copilot`,n,`Unknown`),s=(a.variants[e]||{}).description||a.description;t.push(`| **${n}** | ${s} | ${o} | ${a.category} |`)}else{let e=r(`copilot`,i,`Unknown`);t.push(`| **${i}** | ${a.description} | ${e} | ${a.category} |`)}return`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${t.join(`
|
|
2
2
|
`)}`}function S(e,t,r){let i=`${e}-${t}`,a=r.variants[t]||{},o=v(i),c=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&&s[r.sharedBase]?`\n\n${s[r.sharedBase]}`:``,d=r.extraBody?`\n\n${r.extraBody}`:``,f=a.bodyAddendum?`\n\n${a.bodyAddendum}`:``,p=(r.sharedProtocols||[]).map(e=>s[e]?`\n\n${s[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(`
|
|
3
3
|
`)}`:``,h=r.title||e;return`---
|
|
4
4
|
description: '${c}'
|
|
@@ -64,5 +64,5 @@ To regenerate after changing models or agent definitions:
|
|
|
64
64
|
cd knowledge-base
|
|
65
65
|
node scaffold/generate.mjs
|
|
66
66
|
\`\`\`
|
|
67
|
-
`}function E(){return[`# aikit — Copilot Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`These rules are enforced by AI Kit compliance checking. Violations are flagged in reports and reduce your compliance score.`,``,
|
|
68
|
-
`)}function D(){let t=[];if(
|
|
67
|
+
`}function E(){return[`# aikit — Copilot Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`These rules are enforced by AI Kit compliance checking. Violations are flagged in reports and reduce your compliance score.`,``,p(),``,a,``].join(`
|
|
68
|
+
`)}function D(){let t=[];if(h().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`copilot-instructions.md`,content:E()});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:S(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:C(r,i)});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:T()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:w(e,n)});let r=m(`copilot`,`~/.copilot/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{D as generateCopilot};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{VARIANT_GROUPS as n,getPrimaryAgentModel 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,buildFlowSection as d}from"./_shared.mjs";import{
|
|
1
|
+
import{AGENTS as e}from"../definitions/agents.mjs";import{AGENT_BODIES as t}from"../definitions/bodies.mjs";import{VARIANT_GROUPS as n,getPrimaryAgentModel 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,buildFlowSection as d}from"./_shared.mjs";import{generateForbiddenTable as f}from"../definitions/policies.mjs";import{generateHooks as p,getHookScriptFiles as m}from"./hooks.mjs";const h={terminal:`terminal`,problems:`mcp_aikit_check`,readFile:`read_file`,lastCommand:`terminal`,subagent:`delegate_task`,createFile:`write_file`,editFiles:`patch`,rename:`write_file`,createDirectory:`terminal(mkdir)`,search:`search_files, mcp_aikit_search, mcp_aikit_find`,web:`web_search, web_extract, mcp_aikit_web_search, mcp_aikit_web_fetch`,todo:`todo`,memory:`memory`,newWorkspace:`terminal(cd)`,reviewPlan:`clarify`,askQuestions:`clarify`,resolveMemoryFileUri:`read_file`,runCommand:`terminal`,switchAgent:`delegate_task`,killTerminal:`process(kill)`,createTask:`todo`,terminalSel:`terminal`,fileSearch:`search_files`,listDir:`search_files(target=files)`,textSearch:`search_files(target=content)`,searchSubagent:`delegate_task`,browser:`mcp_aikit_browser, browser_navigate`};function g(e){let t=[[/`runSubagent`/g,"`delegate_task`"],[/`runSubagent\(/g,"`delegate_task("],[/\brunSubagent\b/g,`delegate_task`],[/`editFiles`/g,"`patch`"],[/`createFile`/g,"`write_file`"],[/`edit\/createFile`/g,"`write_file`"],[/`edit\/editFiles`/g,"`patch`"],[/`run_in_terminal`/g,"`terminal`"],[/`execute\/runInTerminal`/g,"`terminal`"],[/`execute\/killTerminal`/g,"`process(kill)`"],[/`grep_search`/g,"`search_files`"],[/`search\/codebase`/g,"`mcp_aikit_search`"],[/`search\/changes`/g,"`search_files`"],[/`search\/usages`/g,"`mcp_aikit_symbol` / `mcp_aikit_trace`"],[/`search\/textSearch`/g,"`search_files`"],[/`search\/searchSubagent`/g,"`delegate_task`"],[/`web\/fetch`/g,"`web_extract` / `mcp_aikit_web_fetch`"],[/`web\/githubRepo`/g,"`terminal(git ...)`"],[/`web\/webSearch`/g,"`web_search` / `mcp_aikit_web_search`"],[/`vscode\/memory`/g,"`memory`"],[/`vscode\/runCommand`/g,"`terminal`"],[/`vscode\/switchAgent`/g,"`delegate_task`"],[/`vscode\/newWorkspace`/g,"`terminal(cd)`"],[/`vscode\/reviewPlan`/g,"`clarify`"],[/`vscode\/askQuestions`/g,"`clarify`"],[/`vscode\/resolveMemoryFileUri`/g,"`read_file`"],[/`read\/readFile`/g,"`read_file`"],[/`read\/terminalLastCommand`/g,"`terminal`"],[/`read\/terminalSelection`/g,"`terminal`"],[/`read\/problems`/g,"`mcp_aikit_check`"],[/`agent\/runSubagent`/g,"`delegate_task`"],[/`execute\/createAndRunTask`/g,"`todo` / `delegate_task`"],[/`read_file` \(for understanding\)/g,"`read_file` (Hermes)"],[/\(copilot\)/g,`(hermes)`],[/runSubagent\(\{agentName:/g,`delegate_task({goal:`],[/runSubagent\(\{/g,`delegate_task({`]],n=e;for(let[e,r]of t)n=n.replace(e,r);return n}function _(e){let t=(l[e]||[]).map(e=>{let t=h[e];return t?t.split(`,`).map(e=>e.trim()):null}).filter(Boolean).flat();return`[${[...new Set(t),`aikit/*`].join(`, `)}]`}function v(e){return r(`hermes`,e,`Auto (hermes)`)}const y=d({flowTool:`mcp_aikit_flow`,isLifecycleOwner:!0}),b=d({flowTool:`mcp_aikit_flow`,isLifecycleOwner:!1});function x(){let t=[];for(let[i,a]of Object.entries(e))if(a.variants)for(let e of n[i]||[]){let n=`${i}-${e}`,o=r(`hermes`,n,`Unknown`),s=(a.variants[e]||{}).description||a.description;t.push(`| **${n}** | ${s} | ${o} | ${a.category} |`)}else{let e=r(`hermes`,i,`Unknown`);t.push(`| **${i}** | ${a.description} | ${e} | ${a.category} |`)}return`| Agent | Purpose | Model | Category |\n|-------|---------|-------|----------|\n${t.join(`
|
|
2
2
|
`)}`}function S(e,t,r){let i=`${e}-${t}`,a=r.variants[t]||{},o=v(i),c=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&&s[r.sharedBase]?`\n\n${s[r.sharedBase]}`:``;u=g(u);let d=r.extraBody?`\n\n${g(r.extraBody)}`:``,f=a.bodyAddendum?`\n\n${g(a.bodyAddendum)}`:``,p=(r.sharedProtocols||[]).map(e=>{let t=s[e];return t?`\n\n${g(t)}`:``}).join(``),m=r.skills?.length?`\n\n## Skills (load on demand)\n\n${r.skills.map(([e,t])=>`- \`${e}\`: ${t}`).join(`
|
|
3
3
|
`)}`:``,h=r.title||e;return`---
|
|
4
4
|
description: '${c}'
|
|
@@ -50,5 +50,5 @@ Hermes provides native tools (\`terminal\`, \`read_file\`, \`write_file\`, \`pat
|
|
|
50
50
|
plus AI Kit MCP tools (\`mcp_aikit_search\`, \`mcp_aikit_knowledge\`, etc.) for code analysis, memory, and context compression.
|
|
51
51
|
|
|
52
52
|
See \`AGENTS.md\` (in Hermes config directory) for complete tool usage guidance.
|
|
53
|
-
`}function E(){return[`# aikit — Hermes Agent Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`Hermes provides native tools (terminal, read_file, write_file, patch, search_files, delegate_task, etc.)`,`plus AI Kit MCP tools (mcp_aikit_*) for code analysis, memory, and context compression.`,``,`### When to Use AI Kit Tools`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search across all indexed content |","| `cat` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| Running tests in terminal | `mcp_aikit_test_run` | Structured output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,
|
|
54
|
-
`)}function D(){let t=[];if(
|
|
53
|
+
`}function E(){return[`# aikit — Hermes Agent Instructions`,``,"This file is generated from `scaffold/definitions/`. Do not edit directly.",``,o,``,`## Tool Routing Rules`,``,`Hermes provides native tools (terminal, read_file, write_file, patch, search_files, delegate_task, etc.)`,`plus AI Kit MCP tools (mcp_aikit_*) for code analysis, memory, and context compression.`,``,`### When to Use AI Kit Tools`,``,`| Instead of | Use AI Kit Tool | Why |`,`|-----------|----------------|-----|`,"| `grep` / `rg` | `mcp_aikit_search` or `mcp_aikit_find` | Hybrid search across all indexed content |","| `cat` for understanding | `mcp_aikit_file_summary` | T1=structure, T2=structure+content — 10x fewer tokens than raw file reads |","| Running tests in terminal | `mcp_aikit_test_run` | Structured output — no shell needed |","| `tsc` / `biome` in terminal | `mcp_aikit_check` | Typecheck + lint combined |","| Web search | `mcp_aikit_web_search` | Fans out to multiple keyless providers |",``,f(),``,a,``].join(`
|
|
54
|
+
`)}function D(){let t=[];if(m().length===0)throw Error(`Executable hooks are not configured.`);t.push({path:`hermes-instructions.md`,content:E()});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:S(r,e,i)});else t.push({path:`agents/${r}.agent.md`,content:C(r,i)});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:T()});for(let[e,n]of Object.entries(i))t.push({path:`prompts/aikit-${e}.prompt.md`,content:w(e,n)});let r=p(`hermes`,`~/.hermes/hooks/scripts`);return t.push(...r.map(e=>({path:`hooks/${e.path}`,content:e.content}))),t}export{D as generateHermesAgent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EXEC_HOOKS as e,HOOK_EVENTS as t,HOOK_TOOL_MATCHERS as n,SUPPORTED_PLATFORMS as r}from"../definitions/exec-hooks.mjs";const i={PreCompact:3e3,PostToolUse:3e3},a={copilot:`hooks.json`,
|
|
1
|
+
import{EXEC_HOOKS as e,HOOK_EVENTS as t,HOOK_TOOL_MATCHERS as n,SUPPORTED_PLATFORMS as r}from"../definitions/exec-hooks.mjs";const i={PreCompact:3e3,PostToolUse:3e3},a={copilot:`hooks.json`,copilotCli:`hooks.json`,hermes:`hooks.json`},o=r;function s(e){if(!o.includes(e))throw Error(`Unknown platform: "${e}". Supported: ${o.join(`, `)}. Add it to SUPPORTED_PLATFORMS in exec-hooks.mjs first, then add entries to HOOK_EVENTS and HOOK_TOOL_MATCHERS. Add FILE_NAMES in generateHooks if file-producing.`);for(let[n,r]of Object.entries(t))if(!(e in r))throw Error(`Platform "${e}" is missing from HOOK_EVENTS.${n}. Add a "${e}" key to HOOK_EVENTS.${n} in exec-hooks.mjs.`);for(let[t,r]of Object.entries(n))if(!(e in r))throw Error(`Platform "${e}" is missing from HOOK_TOOL_MATCHERS.${t}. Add a "${e}" key to HOOK_TOOL_MATCHERS.${t} in exec-hooks.mjs.`)}function c(e,t){return(e.matcher||[]).flatMap(e=>{let r=n[e];if(!r)throw Error(`Unknown hook matcher: ${e}`);return r[t]||[]})}function l(e,t,n,r){let a=`${n}/${e.script}`;return c(e,r),r===`copilot`?{event:t,steps:[{type:`command`,command:`node`,args:[a],timeout:i[e.event]||5e3}]}:r===`claude`?{type:`command`,command:`node ${a}`}:{command:`node`,args:[a]}}function u(n,r){s(n);let i={};for(let a of Object.values(e)){let e=t[a.event]?.[n];if(!e){console.warn(`[aikit] Unsupported hook event ${a.event} for ${n} — skipping`);continue}i[e]||=[],i[e].push(l(a,e,r,n))}return{hooks:i}}function d(n,r){if(s(n),n===`copilot`){let i=Object.values(e).flatMap(e=>{let i=t[e.event]?.[n];return i?l(e,i,r,n):(console.warn(`[aikit] Unsupported hook event ${e.event} for ${n} — skipping`),[])});return[{path:a[n],content:JSON.stringify({hooks:i},null,2)}]}if(n===`claude`)return[];if(!(n in a))throw Error(`Platform "${n}" is missing from FILE_NAMES. Add "${n}: '<filename>'" to FILE_NAMES in adapters/hooks.mjs.`);let i={};for(let a of Object.values(e)){let e=t[a.event]?.[n];if(!e){console.warn(`[aikit] Unsupported hook event ${a.event} for ${n} — skipping`);continue}i[e]||=[],i[e].push(l(a,e,r,n))}return[{path:a[n],content:JSON.stringify({hooks:i},null,2)}]}function f(){return[`_runtime.mjs`,...Object.values(e).map(e=>e.script)]}export{u as buildHooksBlock,d as generateHooks,f as getHookScriptFiles};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
function e(e){return e.map((e,t)=>`${t+1}. ${e}`).join(`
|
|
2
2
|
`)}function t(e){return e.map(e=>`- ${e}`).join(`
|
|
3
|
-
`)}function n({
|
|
3
|
+
`)}function n({description:e,lensName:n,lensDescription:r,lensPrompt:i,focusAreas:a,identityIntro:o=`, a variant of the Researcher agent optimized for **${r}**.`,requiredOutputSection:s,requiredOutputItems:c,variantSummary:l}){return{description:e,identity:`${o} Your thinking style is **${n}** — ${i}`,bodyAddendum:`## Required Output Section — \`## ${s}\`
|
|
4
4
|
|
|
5
|
-
Your final report MUST contain a \`## ${
|
|
6
|
-
${t(
|
|
5
|
+
Your final report MUST contain a \`## ${s}\` section with:
|
|
6
|
+
${t(c)}
|
|
7
7
|
|
|
8
|
-
## Thinking Style: ${
|
|
8
|
+
## Thinking Style: ${n}
|
|
9
9
|
|
|
10
|
-
During multi-model decision sessions, apply the **${
|
|
11
|
-
${t(
|
|
10
|
+
During multi-model decision sessions, apply the **${n}** lens:
|
|
11
|
+
${t(a)}
|
|
12
12
|
|
|
13
|
-
${
|
|
13
|
+
${l}
|
|
14
14
|
|
|
15
15
|
## Subagent Mode
|
|
16
16
|
|
|
@@ -18,12 +18,12 @@ When you are invoked via \`runSubagent\` (i.e., as a subagent of another agent l
|
|
|
18
18
|
- **Do NOT use the \`present\` tool** — your visual output is invisible to the user
|
|
19
19
|
- Return ALL findings as plain structured text in your final response
|
|
20
20
|
- Use markdown formatting (headers, tables, code blocks) for structure
|
|
21
|
-
- The calling agent will re-present your findings to the user if needed`}}function r({
|
|
21
|
+
- The calling agent will re-present your findings to the user if needed`}}function r({description:t,roleName:n,lensName:r,lensDescription:i,lensPrompt:a,focusAreas:o,instinct:s,closing:c,identityIntro:l=`, a variant of the ${n} agent.`,focusHeading:u=`Your primary focus areas (in order of priority):`}){return{description:t,identity:`${l} Your lens is **${i}** — ${a}`,bodyAddendum:`## Review Lens: ${r}
|
|
22
22
|
|
|
23
|
-
${
|
|
24
|
-
${e(
|
|
23
|
+
${u}
|
|
24
|
+
${e(o)}
|
|
25
25
|
|
|
26
|
-
${
|
|
27
|
-
${s}`}}const i={Orchestrator:{title:`The Master Conductor`,description:`Master conductor that orchestrates the full development lifecycle: Planning → Implementation → Review → Recovery → Commit`,argumentHint:null,toolRole:`orchestrator`,sharedBase:null,sharedProtocols:[`layered-knowledge-operating-policy`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit recall, flow status, search, and ctx ref reuse`],[`multi-agents-development`,`Before delegation — decomposition, dispatch envelope, review pipeline`],[`present`,`For plans, reviews, evidence maps, approvals, and non-tiny user output`],[`brainstorming`,`For design forks, trade-offs, or creative requirements`],[`requirements-clarity`,`For vague, large, or cross-team requirements before planning`],[`c4-architecture`,`For architecture diagrams, boundary questions, or structure docs`],[`adr-skill`,`For non-trivial technical decisions and ADR lifecycle`],[`docs`,`For docs-sync, durable docs, PRDs, tours, and architecture docs`],[`lesson-learned`,`After implementation/review work — persist reusable engineering lessons`],[`session-handoff`,`When context pressure rises or work must pause/resume`],[`repo-access`,`For private/self-hosted repo access failures`],[`browser-use`,`For browser auth, JS-rendered pages, visual verification, web automation`]],subagentConstraints:["Do NOT use the `present` tool — return all findings as structured text.","Do NOT call `get_changed_files` — it returns ALL uncommitted diffs (100K+ tokens). Use `git diff <file>` if needed.",`No flow advancement. Only Orchestrator advances the flow.`,"Return status: `DONE` | `DONE_WITH_CONCERNS` | `NEEDS_CONTEXT` | `BLOCKED`. ≤200 words for normal status; full detail only if BLOCKED.",`Stay inside assigned files and boundary. Do not modify files outside scope.`,"Respect `readonly: true|false` flag in dispatch envelope. When readonly=true, do NOT modify files. When readonly=false, follow normal file-modification scope."]},Planner:{title:`The Strategic Architect`,description:`Autonomous planner that researches codebases and writes comprehensive TDD implementation plans`,compactRole:`TDD implementation plans`,argumentHint:null,toolRole:`planner`,sharedBase:`code-agent-base`,sharedProtocols:[`thinking-principles`,`planning-principles`,`layered-knowledge-operating-policy`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit reading plans, recall, and compressed context reuse`],[`multi-agents-development`,`For decomposition, dependency batches, and dispatch envelopes`],[`brainstorming`,`For new feature/behavior planning and design alternatives`],[`requirements-clarity`,`For vague or large requirements before planning`],[`present`,`For plan, dependency graph, risk matrix, and approval display`],[`c4-architecture`,`For architecture changes and C4 diagrams`],[`adr-skill`,`For non-trivial technical decisions and ADRs`],[`session-handoff`,`For context pressure or session end`],[`repo-access`,`For private or self-hosted repo access`],[`browser-use`,`For auth recovery or browser workflows`]]},Implementer:{title:`The Code Builder`,description:`Persistent implementation agent that writes code following TDD practices until all tasks are complete`,compactRole:`New features, wire up, build`,argumentHint:`Implementation task, feature, or phase from plan`,toolRole:`codeAgent`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`react`,`When implementing React components, hooks, or pages`],[`lesson-learned`,`After completing non-obvious implementation work`]]},Frontend:{title:`The UI Specialist`,description:`UI/UX specialist for React, styling, responsive design, and frontend implementation`,compactRole:`UI/UX, React, styling, responsive`,argumentHint:`UI component, styling task, or frontend feature`,toolRole:`codeAgent`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`react`,`When building React components — hooks, patterns, Server Components`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`frontend-design`,`When implementing UI/UX — design systems, accessibility, responsive patterns`],[`browser-use`,`When visual/browser verification is needed`],[`lesson-learned`,`After completing non-obvious frontend implementation work`]]},Refactor:{title:`The Code Sculptor`,description:`Code refactoring specialist that improves structure, readability, and maintainability`,compactRole:`Cleanup, simplify, DRY, extract`,argumentHint:`Code, component, or pattern to refactor`,toolRole:`refactor`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When refactoring TypeScript code — type patterns, generics, utility types`],[`lesson-learned`,`After completing refactor — extract principles from before/after diff`]]},Debugger:{title:`The Problem Solver`,description:`Expert debugger that diagnoses issues, traces errors, and provides solutions using AI Kit traces and compressed context before raw file reads`,compactRole:`Bug diagnosis, error tracing`,argumentHint:`Error message, stack trace, or description of issue`,toolRole:`debugger`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`browser-use`,`For browser/UI reproduction loops and JS-rendered failures`],[`repo-access`,`When debugging depends on private or enterprise repo access`],[`lesson-learned`,`After a non-obvious root cause or fix`]]},Security:{title:`The Vulnerability Hunter`,description:`Security specialist that analyzes code for vulnerabilities and compliance`,compactRole:`Vulnerability analysis, auth hardening`,argumentHint:`Code, feature, or component to security review`,toolRole:`security`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing code — security patterns, type safety`],[`repo-access`,`When security review requires private/enterprise repo access`],[`browser-use`,`When reviewing browser auth, sessions, cookies, or web security flows`]]},Documenter:{title:`The Knowledge Keeper`,description:`Documentation specialist that creates and maintains comprehensive project documentation`,compactRole:`Project documentation`,argumentHint:`Component, API, feature, or area to document`,toolRole:`documenter`,sharedBase:`code-agent-base`,sharedProtocols:[`thinking-principles`,`documentation-principles`,`layered-knowledge-operating-policy`],category:`documentation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`docs`,`When creating or updating project documentation — docs/ convention, architecture blueprints, Diátaxis framework`],[`present`,`When presenting documentation previews or architecture visuals to the user`],[`c4-architecture`,`When documenting architecture, containers, components, or deployment`],[`adr-skill`,`When docs involve technical decisions or ADR updates`],[`typescript`,`When documenting TypeScript APIs, public types, or generated docs`],[`session-handoff`,`When docs work spans sessions or context pressure rises`]]},Explorer:{title:`The Rapid Scout`,description:`Rapid codebase exploration to find files, usages, dependencies, and structural context`,compactRole:`Rapid codebase navigation`,argumentHint:`Find files, usages, and context related to: {topic or goal}`,toolRole:`explorer`,sharedBase:null,sharedProtocols:[`thinking-principles`,`layered-knowledge-operating-policy`],category:`exploration`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`]]},Researcher:{title:`The Context Gatherer`,description:`Deep analysis, architecture review, and multi-model decision protocol participant`,compactRole:`Multi-model deep research`,argumentHint:`Research question, problem statement, or subsystem to investigate`,toolRole:`researcher`,sharedBase:`researcher-base`,sharedProtocols:[`thinking-principles`,`layered-knowledge-operating-policy`],category:`research`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`lesson-learned`,`When analyzing past changes to extract engineering principles`],[`c4-architecture`,`When researching system architecture — produce C4 diagrams`],[`adr-skill`,`When the research involves a technical decision — draft an ADR`],[`repo-access`,`When research needs private or enterprise repository access`],[`browser-use`,`When web research needs login, JS rendering, or browser automation`]],variants:{Alpha:n({description:`Primary deep research agent — also serves as default Researcher`,lensName:`Contrarian`,lensDescription:`deep research`,lensPrompt:`actively look for flaws, fatal assumptions, and hidden risks in every approach. The best ideas survive adversarial pressure.`,identityIntro:`, the primary deep research agent. During multi-model decision sessions, you provide deep reasoning and nuanced system design.`,requiredOutputSection:`Depth Analysis`,requiredOutputItems:[`Deep-dive into ONE chosen subsystem (most structurally central to the question)`,`Full evidence chain: file:line citations for every structural claim`,"At least 2 `file_summary` extracts woven into the narrative"],focusAreas:[`For every proposed approach, actively seek the fatal flaw or hidden assumption`,`Ask: "Under what conditions does this approach fail catastrophically?"`,`Prefer uncomfortable truths over comfortable consensus`],variantSummary:`You are the DEFAULT researcher. When the Orchestrator needs breadth + depth, they
|
|
26
|
+
${s}
|
|
27
|
+
${c}`}}const i={Orchestrator:{title:`The Master Conductor`,description:`Master conductor that orchestrates the full development lifecycle: Planning → Implementation → Review → Recovery → Commit`,argumentHint:null,toolRole:`orchestrator`,sharedBase:null,sharedProtocols:[`layered-knowledge-operating-policy`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit recall, flow status, search, and ctx ref reuse`],[`multi-agents-development`,`Before delegation — decomposition, dispatch envelope, review pipeline`],[`present`,`For plans, reviews, evidence maps, approvals, and non-tiny user output`],[`brainstorming`,`For design forks, trade-offs, or creative requirements`],[`requirements-clarity`,`For vague, large, or cross-team requirements before planning`],[`c4-architecture`,`For architecture diagrams, boundary questions, or structure docs`],[`adr-skill`,`For non-trivial technical decisions and ADR lifecycle`],[`docs`,`For docs-sync, durable docs, PRDs, tours, and architecture docs`],[`lesson-learned`,`After implementation/review work — persist reusable engineering lessons`],[`session-handoff`,`When context pressure rises or work must pause/resume`],[`repo-access`,`For private/self-hosted repo access failures`],[`browser-use`,`For browser auth, JS-rendered pages, visual verification, web automation`]],subagentConstraints:["Do NOT use the `present` tool — return all findings as structured text.","Do NOT call `get_changed_files` — it returns ALL uncommitted diffs (100K+ tokens). Use `git diff <file>` if needed.",`No flow advancement. Only Orchestrator advances the flow.`,"Return status: `DONE` | `DONE_WITH_CONCERNS` | `NEEDS_CONTEXT` | `BLOCKED`. ≤200 words for normal status; full detail only if BLOCKED.",`Stay inside assigned files and boundary. Do not modify files outside scope.`,"Respect `readonly: true|false` flag in dispatch envelope. When readonly=true, do NOT modify files. When readonly=false, follow normal file-modification scope."]},Planner:{title:`The Strategic Architect`,description:`Autonomous planner that researches codebases and writes comprehensive TDD implementation plans`,compactRole:`TDD implementation plans`,argumentHint:null,toolRole:`planner`,sharedBase:`code-agent-base`,sharedProtocols:[`thinking-principles`,`planning-principles`,`layered-knowledge-operating-policy`],category:`orchestration`,skills:[[`aikit`,`**Always** — AI Kit reading plans, recall, and compressed context reuse`],[`multi-agents-development`,`For decomposition, dependency batches, and dispatch envelopes`],[`brainstorming`,`For new feature/behavior planning and design alternatives`],[`requirements-clarity`,`For vague or large requirements before planning`],[`present`,`For plan, dependency graph, risk matrix, and approval display`],[`c4-architecture`,`For architecture changes and C4 diagrams`],[`adr-skill`,`For non-trivial technical decisions and ADRs`],[`session-handoff`,`For context pressure or session end`],[`repo-access`,`For private or self-hosted repo access`],[`browser-use`,`For auth recovery or browser workflows`]]},Implementer:{title:`The Code Builder`,description:`Persistent implementation agent that writes code following TDD practices until all tasks are complete`,compactRole:`New features, wire up, build`,argumentHint:`Implementation task, feature, or phase from plan`,toolRole:`codeAgent`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`react`,`When implementing React components, hooks, or pages`],[`lesson-learned`,`After completing non-obvious implementation work`]]},Frontend:{title:`The UI Specialist`,description:`UI/UX specialist for React, styling, responsive design, and frontend implementation`,compactRole:`UI/UX, React, styling, responsive`,argumentHint:`UI component, styling task, or frontend feature`,toolRole:`codeAgent`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`react`,`When building React components — hooks, patterns, Server Components`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`frontend-design`,`When implementing UI/UX — design systems, accessibility, responsive patterns`],[`browser-use`,`When visual/browser verification is needed`],[`lesson-learned`,`After completing non-obvious frontend implementation work`]]},Refactor:{title:`The Code Sculptor`,description:`Code refactoring specialist that improves structure, readability, and maintainability`,compactRole:`Cleanup, simplify, DRY, extract`,argumentHint:`Code, component, or pattern to refactor`,toolRole:`refactor`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`implementation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When refactoring TypeScript code — type patterns, generics, utility types`],[`lesson-learned`,`After completing refactor — extract principles from before/after diff`]]},Debugger:{title:`The Problem Solver`,description:`Expert debugger that diagnoses issues, traces errors, and provides solutions using AI Kit traces and compressed context before raw file reads`,compactRole:`Bug diagnosis, error tracing`,argumentHint:`Error message, stack trace, or description of issue`,toolRole:`debugger`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When writing TypeScript code — type patterns, generics, utility types`],[`browser-use`,`For browser/UI reproduction loops and JS-rendered failures`],[`repo-access`,`When debugging depends on private or enterprise repo access`],[`lesson-learned`,`After a non-obvious root cause or fix`]]},Security:{title:`The Vulnerability Hunter`,description:`Security specialist that analyzes code for vulnerabilities and compliance`,compactRole:`Vulnerability analysis, auth hardening`,argumentHint:`Code, feature, or component to security review`,toolRole:`security`,sharedBase:`code-agent-base`,sharedProtocols:[`engineering-principles`,`layered-knowledge-operating-policy`],category:`diagnostics`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing code — security patterns, type safety`],[`repo-access`,`When security review requires private/enterprise repo access`],[`browser-use`,`When reviewing browser auth, sessions, cookies, or web security flows`]]},Documenter:{title:`The Knowledge Keeper`,description:`Documentation specialist that creates and maintains comprehensive project documentation`,compactRole:`Project documentation`,argumentHint:`Component, API, feature, or area to document`,toolRole:`documenter`,sharedBase:`code-agent-base`,sharedProtocols:[`thinking-principles`,`documentation-principles`,`layered-knowledge-operating-policy`],category:`documentation`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`docs`,`When creating or updating project documentation — docs/ convention, architecture blueprints, Diátaxis framework`],[`present`,`When presenting documentation previews or architecture visuals to the user`],[`c4-architecture`,`When documenting architecture, containers, components, or deployment`],[`adr-skill`,`When docs involve technical decisions or ADR updates`],[`typescript`,`When documenting TypeScript APIs, public types, or generated docs`],[`session-handoff`,`When docs work spans sessions or context pressure rises`]]},Explorer:{title:`The Rapid Scout`,description:`Rapid codebase exploration to find files, usages, dependencies, and structural context`,compactRole:`Rapid codebase navigation`,argumentHint:`Find files, usages, and context related to: {topic or goal}`,toolRole:`explorer`,sharedBase:null,sharedProtocols:[`thinking-principles`,`layered-knowledge-operating-policy`],category:`exploration`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`]]},Researcher:{title:`The Context Gatherer`,description:`Deep analysis, architecture review, and multi-model decision protocol participant`,compactRole:`Multi-model deep research`,argumentHint:`Research question, problem statement, or subsystem to investigate`,toolRole:`researcher`,sharedBase:`researcher-base`,sharedProtocols:[`thinking-principles`,`layered-knowledge-operating-policy`],category:`research`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`lesson-learned`,`When analyzing past changes to extract engineering principles`],[`c4-architecture`,`When researching system architecture — produce C4 diagrams`],[`adr-skill`,`When the research involves a technical decision — draft an ADR`],[`repo-access`,`When research needs private or enterprise repository access`],[`browser-use`,`When web research needs login, JS rendering, or browser automation`]],variants:{Alpha:n({description:`Primary deep research agent — also serves as default Researcher`,lensName:`Contrarian`,lensDescription:`deep research`,lensPrompt:`actively look for flaws, fatal assumptions, and hidden risks in every approach. The best ideas survive adversarial pressure.`,identityIntro:`, the primary deep research agent. During multi-model decision sessions, you provide deep reasoning and nuanced system design.`,requiredOutputSection:`Depth Analysis`,requiredOutputItems:[`Deep-dive into ONE chosen subsystem (most structurally central to the question)`,`Full evidence chain: file:line citations for every structural claim`,"At least 2 `file_summary` extracts woven into the narrative"],focusAreas:[`For every proposed approach, actively seek the fatal flaw or hidden assumption`,`Ask: "Under what conditions does this approach fail catastrophically?"`,`Prefer uncomfortable truths over comfortable consensus`],variantSummary:`You are the DEFAULT researcher. When the Orchestrator needs breadth + depth, they
|
|
28
28
|
dispatch you alone. Your lens: thorough, evidence-first, exhaustive + contrarian.`}),Beta:n({description:`Research variant — pragmatic analysis with focus on trade-offs and edge cases`,lensName:`First Principles`,lensDescription:`pragmatic analysis`,lensPrompt:`strip away assumptions, decompose to ground truths, and rebuild reasoning from scratch.`,identityIntro:`, a variant of the Researcher agent optimized for **pragmatic analysis**. Focus on trade-offs, edge cases, and practical constraints. Challenge assumptions and highlight risks the primary researcher may overlook.`,requiredOutputSection:`Failure Modes & Counter-Evidence`,requiredOutputItems:[`At least 3 adversarial claims challenging your own primary finding`,`For each counter-claim: the condition under which it would be TRUE, and the
|
|
29
29
|
evidence (file:line or search receipt) that currently falsifies it`,"Any unresolved counter-evidence flagged as `⚠ UNRESOLVED`"],focusAreas:[`Strip every assumption: "Is this truly required, or just inherited convention?"`,`Decompose to ground truths, then rebuild the reasoning from scratch`,`If the current approach exists only because "that's how it's always been done", flag it`],variantSummary:"Your lens: pragmatic skepticism + first principles. Mark competing claims as `A` (Assumed)\nby default; challenge before promoting to `V`."}),Gamma:n({description:`Research variant — broad pattern matching across domains and technologies`,lensName:`Expansionist`,lensDescription:`cross-domain pattern matching`,lensPrompt:`look for the bigger opportunity, find what's undervalued, and identify patterns others dismiss.`,identityIntro:`, a variant of the Researcher agent optimized for **cross-domain pattern matching**. Draw connections from other domains, frameworks, and industries. Bring breadth where Alpha brings depth.`,requiredOutputSection:`Cross-Domain Analogies`,requiredOutputItems:[`At least 2 patterns from other tools/frameworks/domains that apply to the question`,"For each: the external source (cite via `web_search` or `web_fetch` receipt) and\n how it maps to our codebase",`One "missing pattern we should adopt" recommendation`],focusAreas:[`Ask: "What's the bigger opportunity everyone else is ignoring?"`,`Seek undervalued approaches and non-obvious connections across domains`,`Challenge narrow framing: "Is this really just an X problem, or is it also a Y problem?"`],variantSummary:"Your lens: cross-domain pattern matching + expansionist. Weight `web_search` + `web_fetch`\nhigher than peers. Assume the LLM's training data is stale — verify with fresh searches."}),Delta:n({description:`Research variant — implementation feasibility and performance implications`,lensName:`Executor`,lensDescription:`implementation feasibility`,lensPrompt:`focus on what can actually be built, the fastest path to value, and real-world constraints.`,identityIntro:`, a variant of the Researcher agent optimized for **implementation feasibility**. Focus on performance implications, scaling concerns, and concrete implementation paths. Ground theoretical proposals in practical reality.`,requiredOutputSection:`Implementation Cost & Feasibility`,requiredOutputItems:["Complexity snapshot: you MUST call `measure({ path })` on any file ≥ 50 LOC in the\n target subsystem at least once and quote the `cognitiveComplexity` result","Blast radius estimate: `blast_radius({ changed_files })` on the proposed edits",`Time/risk table: | Change | Lines | Risk | Effort |`,`Feasibility verdict: SAFE / RISKY / INFEASIBLE with one-line justification`],focusAreas:[`Ask: "Can this actually be built? What's the fastest path to a working version?"`,`Ground every proposal in concrete effort: lines of code, files changed, risk`,`Reject elegant theory that can't survive contact with the codebase`],variantSummary:'Your lens: implementation feasibility + executor. Prefer `measure` + `blast_radius` +\n`analyze({ items: [{aspect: "patterns", ...}] })` over abstract reasoning.'})}},"Code-Reviewer":{title:`The Quality Guardian`,description:`Code review specialist analyzing code for quality, security, performance, and maintainability`,compactRole:`Dual-perspective code review`,argumentHint:`File path, PR, or code to review`,toolRole:`reviewer`,sharedBase:`code-reviewer-base`,sharedProtocols:[`thinking-principles`,`review-principles`,`layered-knowledge-operating-policy`],category:`review`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`typescript`,`When reviewing TypeScript code — type patterns, best practices`],[`lesson-learned`,`When review exposes a reusable engineering lesson`]],variants:{Alpha:r({roleName:`Code-Reviewer`,description:`Primary code reviewer`,lensName:`Compliance & Red-Team`,lensDescription:`compliance and red-teaming`,lensPrompt:`you hunt for correctness bugs, security holes, and contract violations that will break in production.`,identityIntro:`, the primary Code-Reviewer agent.`,focusAreas:[`**Correctness** — Logic errors, race conditions, null/undefined paths, off-by-one`,`**Security** — OWASP Top 10, input validation, secrets, injection vectors`,`**Contract compliance** — Does this honor its type signatures, API contracts, and invariants?`,`**Error handling** — What happens on the unhappy path? Missing try/catch, swallowed errors`],instinct:`Your instinct: "How does this break?" Think like an attacker and a pessimist.`,closing:`When in doubt, flag it — false positives are cheaper than missed bugs in production.`}),Beta:r({roleName:`Code-Reviewer`,description:`Code reviewer variant — different LLM perspective for dual review`,lensName:`Quality & Engineering Excellence`,lensDescription:`quality and engineering excellence`,lensPrompt:`you focus on maintainability, performance, testing, and whether the code will age well.`,identityIntro:`, the secondary Code-Reviewer agent.`,focusAreas:[`**Maintainability** — Naming clarity, single responsibility, cognitive complexity, DRY`,`**Performance** — N+1 queries, unnecessary allocations, missing caching, O(n²) where O(n) suffices`,`**Testing** — Coverage for new/changed logic, edge cases, test readability`,`**Patterns** — Consistency with existing codebase conventions, idiomatic usage`],instinct:`Your instinct: "Will a new team member understand this in 6 months?" Think like a mentor.`,closing:`Prefer actionable suggestions over vague concerns. Show the better version when possible.`})}},"Architect-Reviewer":{title:`The Structural Guardian`,description:`Reviews architecture for pattern adherence, SOLID compliance, dependency direction, and structural integrity`,compactRole:`Architecture review`,argumentHint:`Files, PR, or subsystem to architecture-review`,toolRole:`reviewer`,sharedBase:`architect-reviewer-base`,sharedProtocols:[`thinking-principles`,`review-principles`,`layered-knowledge-operating-policy`],category:`review`,skills:[[`aikit`,`**Always** — AI Kit tool signatures, search, analysis`],[`c4-architecture`,`When reviewing architectural diagrams or boundary changes`],[`adr-skill`,`When the review involves architecture decisions — reference or create ADRs`],[`docs`,`When architecture review should update durable documentation`]],extraBody:`You are **not** the Code-Reviewer agent. Code-Reviewer handles correctness, testing, security, and code quality. You handle the big picture: service boundaries, dependency direction, pattern adherence, and structural health.`,variants:{Alpha:r({roleName:`Architect-Reviewer`,description:`Primary architecture reviewer`,lensName:`Structural Prosecutor`,lensDescription:`structural prosecution`,lensPrompt:`you challenge architectural choices, find boundary violations, and test whether the design survives growth.`,identityIntro:`, the primary Architect-Reviewer agent.`,focusHeading:`Your primary focus areas:`,focusAreas:[`**Boundary violations** — Does this cross package/module boundaries it shouldn't?`,`**Dependency direction** — Are dependencies flowing inward? Any layer leakage?`,`**Hidden coupling** — Shared mutable state, implicit contracts, temporal coupling`,`**Scalability stress** — What breaks at 10x load, 10x data, 10x features?`],instinct:`Your instinct: "This design will fail when..." Challenge every architectural assumption.`,closing:`If a boundary is crossed, require justification or block.`}),Beta:r({roleName:`Architect-Reviewer`,description:`Architecture reviewer variant — different LLM perspective for dual review`,lensName:`Pragmatic Defense`,lensDescription:`pragmatic defense`,lensPrompt:`you evaluate whether the architecture is proportional to the problem, and defend reasonable trade-offs.`,identityIntro:`, the secondary Architect-Reviewer agent.`,focusHeading:`Your primary focus areas:`,focusAreas:[`**Proportionality** — Is the architecture proportional to the problem? Over-engineering is a defect.`,`**Trade-off validity** — Are the trade-offs explicitly acknowledged and reasonable?`,`**Migration path** — Can this evolve without a rewrite? Is there a clear upgrade path?`,`**Team ergonomics** — Can the team actually maintain this? Does it match their skills?`],instinct:`Your instinct: "Is this the simplest architecture that solves the actual problem?"`,closing:`Push back on unnecessary complexity. Defend working solutions against premature abstraction.`})}}};export{i as AGENTS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={copilot:{Orchestrator:{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Auto (copilot)`]},Planner:{primary:`GPT-5.4 (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 (copilot)`,`GPT-5.3-Codex (copilot)`,`GPT-5.4 mini (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:`
|
|
1
|
+
const e={copilot:{Orchestrator:{primary:`GPT-5.4 (copilot)`,fallbacks:[`GPT-5.4 mini (copilot)`,`GPT-5.4 (copilot)`,`Auto (copilot)`]},Planner:{primary:`GPT-5.4 (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 (copilot)`,`GPT-5.3-Codex (copilot)`,`GPT-5.4 mini (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:`sonnet[1m]`},Planner:{primary:`sonnet[1m]`},Implementer:{primary:`sonnet[1m]`},Frontend:{primary:`sonnet[1m]`},Refactor:{primary:`sonnet[1m]`},Security:{primary:`sonnet[1m]`},Documenter:{primary:`sonnet[1m]`},Explorer:{primary:`haiku`},Debugger:{primary:`claude-opus-4-6`},"Researcher-Alpha":{primary:`claude-opus-4-6`},"Researcher-Beta":{primary:`claude-opus-4-6`},"Researcher-Gamma":{primary:`claude-opus-4-6`},"Researcher-Delta":{primary:`claude-opus-4-6`},"Code-Reviewer-Alpha":{primary:`claude-opus-4-6`},"Code-Reviewer-Beta":{primary:`claude-opus-4-6`},"Architect-Reviewer-Alpha":{primary:`claude-opus-4-6`},"Architect-Reviewer-Beta":{primary:`claude-opus-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`}},hermes:{Orchestrator:{primary:`Auto (hermes)`},Planner:{primary:`Auto (hermes)`},Implementer:{primary:`Auto (hermes)`},Frontend:{primary:`Auto (hermes)`},Debugger:{primary:`Auto (hermes)`},Refactor:{primary:`Auto (hermes)`},Security:{primary:`Auto (hermes)`},Documenter:{primary:`Auto (hermes)`},Explorer:{primary:`Auto (hermes)`},"Researcher-Alpha":{primary:`Auto (hermes)`},"Researcher-Beta":{primary:`Auto (hermes)`},"Researcher-Gamma":{primary:`Auto (hermes)`},"Researcher-Delta":{primary:`Auto (hermes)`},"Code-Reviewer-Alpha":{primary:`Auto (hermes)`},"Code-Reviewer-Beta":{primary:`Auto (hermes)`},"Architect-Reviewer-Alpha":{primary:`Auto (hermes)`},"Architect-Reviewer-Beta":{primary:`Auto (hermes)`}}};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};
|