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