@vpxa/aikit 0.1.345 → 0.1.347

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.
Files changed (28) hide show
  1. package/package.json +1 -1
  2. package/packages/cli/dist/index.js +3 -3
  3. package/packages/cli/dist/{init-XINdWZ5p.js → init-BZHwK5rv.js} +1 -1
  4. package/packages/cli/dist/{templates-Cjsh5cLs.js → templates-DxyYPlMl.js} +3 -3
  5. package/packages/core/dist/index.d.ts +27 -1
  6. package/packages/core/dist/index.js +1 -1
  7. package/packages/server/dist/bin.js +1 -1
  8. package/packages/server/dist/index.js +1 -1
  9. package/packages/server/dist/prelude-B58MO48q.js +1 -0
  10. package/packages/server/dist/prelude-HRPwDugi.js +2 -0
  11. package/packages/server/dist/sampling-DvrIzeWt.js +1 -0
  12. package/packages/server/dist/sampling-lH0Mam1_.js +2 -0
  13. package/packages/server/dist/{server--QWu4dF1.js → server-B9PIl5SY.js} +172 -169
  14. package/packages/server/dist/{server-Cv8aM3Xx.js → server-Bme4eBy1.js} +172 -169
  15. package/packages/server/dist/{server-http-DoIPqaqk.js → server-http-C7PO0D_V.js} +1 -1
  16. package/packages/server/dist/{server-http-BF6fnIQ0.js → server-http-rK25FoUm.js} +1 -1
  17. package/packages/server/dist/{server-stdio-CFH9BET5.js → server-stdio-BVxXXgvL.js} +1 -1
  18. package/packages/server/dist/{server-stdio-CXF39-d2.js → server-stdio-OQL2grn7.js} +1 -1
  19. package/packages/tools/dist/import-resolver-nPrVzU5s.js +2 -0
  20. package/packages/tools/dist/index.d.ts +6 -1
  21. package/packages/tools/dist/index.js +99 -99
  22. package/scaffold/dist/definitions/protocols.mjs +3 -3
  23. package/scaffold/dist/definitions/skills/aikit.mjs +3 -3
  24. package/packages/server/dist/prelude-DYBTvrwz.js +0 -2
  25. package/packages/server/dist/prelude-V2gaMyeg.js +0 -1
  26. package/packages/server/dist/sampling-0YAQqixD.js +0 -1
  27. package/packages/server/dist/sampling-BQmYJ4pz.js +0 -2
  28. package/packages/tools/dist/import-resolver-BjraRSaz.js +0 -2
@@ -24,13 +24,13 @@ ${e===`<PROFILE>`?`**Profile:** Check your role → implementer | documenter | r
24
24
 
25
25
  AI Kit delivers knowledge through four layers:
26
26
 
27
- - **L0 — Generated Briefing Cards**: Fast, task-ready workspace setup. \`workspace-core\` auto-injected via \`status({ includePrelude: true })\`. If a flow is active, \`workflow:<flow>\` loaded via flow context (replaces task card). Total budget: ${n.sessionStart.totalTokenBudget} tokens.
27
+ - **L0 — Generated Briefing Cards**: Fast, task-ready workspace setup. \`workspace-core\` available as local resource \`aikit://l0/workspace-core\` (full card content, live-updated after onboard) and auto-injected via \`status({ includePrelude: true })\` (compact summary). If a flow is active, \`workflow:<flow>\` loaded via flow context (replaces task card). Total budget: ${n.sessionStart.totalTokenBudget} tokens.
28
28
  - **L1 — Flow Working Context**: Active run state, current step, and role-filtered dispatch context. Withdraw via \`knowledge({ action: 'withdraw', scope: 'flow', profile: '<role>', budget: 6000 })\`.
29
29
  - **L2 — Canonical Curated Knowledge**: Durable workspace archive managed by CuratedKnowledgeManager. Retrieve on demand via \`search()\` or \`knowledge({ action: 'read' })\`.
30
30
  - **L3 — Evidence Archive**: Auto-knowledge observations and tool-output evidence. Inspect only for provenance, conflict review, or promotion assessment. Never auto-injected.
31
31
 
32
32
  ### Hot Path
33
- 1. Session start → \`status({ includePrelude: true })\` auto-injects \`workspace-core\`. If flow active, \`workflow:<flow>\` loaded via flow context. If no flow, may add one task card via \`stratum_card\`.
33
+ 1. Session start → fetch \`aikit://l0/workspace-core\` resource for full workspace briefing card (structure, deps, entry points). \`status({ includePrelude: true })\` also auto-injects compact summary. If flow active, \`workflow:<flow>\` loaded via flow context. If no flow, may add one task card via \`stratum_card\`.
34
34
  2. Active flow → use L1 snapshot + dispatch refs before broad retrieval.
35
35
  3. Retrieve L2 on demand.
36
36
  4. Inspect L3 only for evidence, provenance, or promotion.
@@ -50,7 +50,7 @@ AI Kit delivers knowledge through four layers:
50
50
  - Route L1 withdrawal by configured profile; never promote.
51
51
  - Emit L3 evidence as observer-only; never navigate flow state.`:t===`flow`?r+`
52
52
  ### Step Contracts
53
- 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 l=r(`## 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 u(){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 | `compact({ path, query })` | `read_file` to search |\n| Multiple files | `digest({ sources, query })` | Multiple `read_file` calls |\n| Reuse previous output | `compact({ 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) | `stratum_card`, `file_summary`, `compact` | 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 d=r(`## 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."),f={"code-agent-base":`# Code Agent - Shared Kernel
53
+ 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 l=r(`## 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 u(){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 | `compact({ path, query })` | `read_file` to search |\n| Multiple files | `digest({ sources, query })` | Multiple `read_file` calls |\n| Reuse previous output | `compact({ 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), `stratum_card`, `file_summary`, `compact` | 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 d=r(`## 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."),f={"code-agent-base":`# Code Agent - Shared Kernel
54
54
 
55
55
  > Shared protocol for code-writing agents. Role files add only role-specific behavior.
56
56
 
@@ -18,7 +18,7 @@ Use AI Kit as compression, memory, validation, and coordination layer. Each call
18
18
 
19
19
  Start:
20
20
  1. status({ includePrelude: true }); onboard if missing.
21
- 2. **L0 session start**: \`status({ includePrelude: true })\` auto-injects workspace-core. If a flow is active, workflow card loaded via flow context. ≤ 2,100 tokens.
21
+ 2. **L0 session start**: Fetch \`aikit://l0/workspace-core\` resource (full card) or \`status({ includePrelude: true })\` (compact summary). If a flow is active, workflow card loaded via flow context. ≤ 2,100 tokens.
22
22
  3. search({ query: "SESSION CHECKPOINT", origin: "curated" }).
23
23
  4. flow({ action: 'status' }) when active flow may exist — use L1 snapshot before broad retrieval.
24
24
  5. scope_map({ task }) for non-trivial work.
@@ -39,7 +39,7 @@ End:
39
39
 
40
40
  | Layer | Need | Tool |
41
41
  |-------|------|------|
42
- | **L0** | Session briefing (auto) | \`status({ includePrelude: true })\` workspace-core pre-injected, no manual load needed |
42
+ | **L0** | Session briefing (auto) | Resource \`aikit://l0/workspace-core\` (full card) or \`status({ includePrelude: true })\` (compact summary) |
43
43
  | **L0** | Architecture overview | \`architecture\` briefing card |
44
44
  | **L0** | Known issues | \`known-issues\` briefing card |
45
45
  | **L0** | Flow-specific context | \`workflow:<flow>\` briefing card |
@@ -84,7 +84,7 @@ Review decayed/stale entries periodically with knowledge({ action: 'flagged' }).
84
84
  Flows guide multi-step work. Read active step before acting. FORGE handles tiering/evidence/gates; load references only when main skill is too thin.
85
85
 
86
86
  ### Layered Knowledge Protocol
87
- - **L0** → Generated briefing cards: always load \`workspace-core\` at session start; add \`workflow:<flow>\` if flow active, or one task card if no flow. Use \`stratum_card\` / \`compact\` for content. Token-bounded.
87
+ - **L0** → Generated briefing cards: always load \`workspace-core\` at session start via \`aikit://l0/workspace-core\` resource (full card, live-updated). Add \`workflow:<flow>\` if flow active, or one task card if no flow. Use \`stratum_card\` / \`compact\` for content. Token-bounded.
88
88
  - **L1** → Flow working context. Withdraw before dispatch; reuse before broad retrieval.
89
89
  - **L2** → Canonical curated knowledge. Retrieve on demand; never preload broadly.
90
90
  - **L3** → Evidence/auto-knowledge. Inspect only for provenance, conflict, or promotion assessment.
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e,t}from"./server--QWu4dF1.js";export{t as buildPreludeInjection,e as generatePrelude};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./server-Cv8aM3Xx.js";export{t as buildPreludeInjection,e as generatePrelude};
@@ -1 +0,0 @@
1
- import{r as e}from"./server-Cv8aM3Xx.js";export{e as createSamplingClient};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./server--QWu4dF1.js";export{e as createSamplingClient};
@@ -1,2 +0,0 @@
1
- import{createRequire as e}from"node:module";import{readFile as t}from"node:fs/promises";import{dirname as n,extname as r,resolve as i}from"node:path";import{existsSync as a}from"node:fs";var o=Object.defineProperty,s=(e,t)=>{let n={};for(var r in e)o(n,r,{get:e[r],enumerable:!0});return t||o(n,Symbol.toStringTag,{value:`Module`}),n},c=e(import.meta.url),l=s({buildExportMap:()=>v,buildImportMap:()=>g,extractImports:()=>f,resolveImportPath:()=>m});const u=new Set([`.ts`,`.tsx`,`.mts`,`.cts`,`.js`,`.jsx`,`.mjs`,`.cjs`]),d=[`.ts`,`.tsx`,`.d.ts`,`.js`,`.jsx`,`.mjs`,`.cjs`,`/index.ts`,`/index.tsx`,`/index.js`,`/index.jsx`,`/index.d.ts`];function f(e){let t=new Set,n=/(?:import|export)\s+(?:(?:type\s+)?\{[^}]*\}\s*|default\s+\w+\s*|\*\s+as\s+\w+\s*|\*\s*|type\s+\{[^}]*\}\s*|\w+(?:\s*,\s*\{[^}]*\})?\s*)?from\s+['"]([^'"]+)['"]/g,r;for(;(r=n.exec(e))!==null;)t.add(r[1]);let i=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(;(r=i.exec(e))!==null;)t.add(r[1]);let a=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(;(r=a.exec(e))!==null;)t.add(r[1]);let o=/export\s+(?:\{[^}]*\}|\*\s+as\s+\w+|\*)\s+from\s+['"]([^'"]+)['"]/g;for(;(r=o.exec(e))!==null;)t.add(r[1]);return[...t]}function p(e){let t=e.startsWith(`.`),n=e.startsWith(`node:`);return{isLocal:t,isPackage:!t&&!n,isBuiltin:n}}function m(e,t,o){let{isLocal:s,isPackage:c,isBuiltin:l}=p(e);if(l||c||!s)return null;let u=i(n(t),e);if(!r(u)){for(let e of d){let t=u+e;if(a(t))return t}return u}return a(u)?u:null}function h(e){let t=r(e).toLowerCase();return u.has(t)}async function g(e,n){let i={};for(let a of n)if(!(a.category!==`source`&&a.category!==`test`)&&h(a.path))try{let n=f(await t(a.path,`utf-8`));i[a.path]=n.map(t=>{let{isLocal:n,isPackage:i,isBuiltin:o}=p(t),s=m(t,a.path,e);return{specifier:t,resolvedPath:s,isLocal:n,isPackage:i,isBuiltin:o,fileExtension:(s?r(s):null)||null}})}catch{i[a.path]=[]}return i}const _=[/^export\s+(?:default\s+)?(?:const|let|var|function|class|interface|type|enum|abstract\s+class)\s+(\w+)/gm,/^export\s+\{([^}]+)\}/gm,/^export\s+default\s+(?:class|function)\s+(\w+)/gm];async function v(e,n){let r={};for(let e of n)if(e.category===`source`&&h(e.path))try{let n=await t(e.path,`utf-8`);for(let t of _){let i;for(;(i=t.exec(n))!==null;){let t=i[1]?.trim();if(t&&!t.includes(`*`)&&!t.includes(`{`)&&!t.includes(`}`)){r[t]=e.path;continue}if(i[1]?.includes(`,`)||i[1]?.includes(` as `)){let t=i[1].split(`,`).map(e=>e.trim());for(let n of t){let t=n.match(/(\w+)\s+as\s+(\w+)/);t?r[t[2]]=e.path:n&&!n.includes(`*`)&&(r[n]=e.path)}}}}let i=n.match(/export\s+default\s+(?!class\s|function\s)(\w+|\{)/);i&&!i[1]?.startsWith(`{`)||n.includes(`export default `)&&(n.match(/export\s+default\s+(?:(?!class|function)\S+\s*)?\(/)||n.match(/export\s+default\s+(?:class|function)\s+\w+/));let a=n.match(/export\s+default\s+(?:class|function)\s+(\w+)/);if(a&&(r[a[1]]=e.path),!a&&n.includes(`export default `)){let t=n.split(`
2
- `);for(let n=0;n<t.length;n++){let i=t[n].trim();if(i.startsWith(`export default `)){let t=i.slice(15).trim().replace(/;$/,``);if(/^\w+$/.test(t))r[t]=e.path;else if(/^export\s+default\s+\w+/.test(i)){let n=t.split(/\s+/)[0];n&&/^\w+$/.test(n)&&(r[n]=e.path)}}}}let o=n.match(/export\s*=\s*(\w+)/);o&&(r[o[1]]=e.path)}catch{}return r}export{m as a,l as i,g as n,s as o,f as r,c as s,v as t};