@vpxa/aikit 0.1.250 → 0.1.251

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.
@@ -149,7 +149,7 @@ import{postTaskLesson as e,preTaskKnowledgeRecall as t}from"./protocols.mjs";con
149
149
  **Subagent prompt template:**
150
150
  1. **Scope** — exact files + boundary
151
151
  2. **Goal** — acceptance criteria, testable
152
- 3. **Arch Context** — pick by \`config.tokenBudget\`: efficient → \`stratum_card({ files: ['<path>'], query: '<what matters>', tier: 'T1' })\`, normal → \`compact({path, query})\`, full → \`digest({ sources: [...], query: '<what matters>' })\`. Default to efficient.
152
+ 3. **Arch Context** — pick by \`config.tokenBudget\`: efficient → \`stratum_card({ files: ['<path>'], query: '<what matters>', tier: 'T1' })\`, normal → \`compact({path, query})\` or \`compact({ref, query?})\`, full → \`digest({ sources: [...], query: '<what matters>' })\`. Default to efficient.
153
153
  4. **Constraints** — patterns, conventions
154
154
  5. **Prior Knowledge** — Fetch topic-scoped knowledge: \`knowledge({ action: "lesson", subAction: "list-lessons", topic: "<2-3 task keywords>", minConfidence: 70 })\` + \`search({ query: "<task area>", category: "conventions", limit: 3 })\`. Include HIGH-confidence results (≥70) under \`## Prior Knowledge\`. Skip if none.
155
155
  6. **Artifacts Path** — the active flow's run directory and artifacts path from \`flow({ action: 'status' })\` (e.g. \`.flows/add-authentication/.spec/\`)
@@ -188,7 +188,7 @@ import{postTaskLesson as e,preTaskKnowledgeRecall as t}from"./protocols.mjs";con
188
188
 
189
189
  ### Context Gathering for Subagent Prompts
190
190
 
191
- Default to \`stratum_card({ files: ['<path>'], query: '<what matters>', tier: 'T1' })\`; upgrade to \`compact\` or \`digest\`; use \`read_file\` only for exact edit lines.
191
+ Default to \`stratum_card({ files: ['<path>'], query: '<what matters>', tier: 'T1' })\`; upgrade to \`compact({ path, query })\`, \`compact({ ref, query? })\`, or \`digest\`; use \`read_file\` only for exact edit lines.
192
192
 
193
193
  **Knowledge injection (MANDATORY for Standard+ tier):** Before any subagent prompt, call:
194
194
  - \`knowledge({ action: "lesson", subAction: "list-lessons", topic: "<task keywords>", minConfidence: 70 })\`
@@ -415,7 +415,7 @@ import{postTaskLesson as e,preTaskKnowledgeRecall as t}from"./protocols.mjs";con
415
415
  ## Pre-Edit Checklist
416
416
 
417
417
  1. **Understand consumers** — \`graph({action:'find_nodes', name_pattern:'<target>'})\` → \`graph({action:'neighbors', node_id, direction:'incoming'})\`
418
- 2. **Compress, don't raw-read** — \`file_summary\` then \`compact({path, query})\`; \`read_file\` only for exact edit lines
418
+ 2. **Compress, don't raw-read** — \`file_summary\` then \`compact({path, query})\` or \`compact({ref, query?})\`; \`read_file\` only for exact edit lines
419
419
  3. **Snapshot risky edits** — \`checkpoint({action:'save', label:'pre-<scope>'})\` before cross-cutting changes
420
420
  4. **Estimate blast radius** — run \`blast_radius\` before and after shared/public symbol changes
421
421
  5. **TDD when tests exist** — failing test first, then minimum code
@@ -10,7 +10,7 @@ Follow \`multi-agents-development\` dispatch patterns:
10
10
  2. **Subagent Context**:
11
11
  - **Scope**: exact files + do NOT touch boundary
12
12
  - **Goal**: testable acceptance criteria
13
- - **Arch Context**: code via \`compact()\`/\`digest()\`
13
+ - **Arch Context**: code via \`compact()\`/\`digest()\` or a cached ref via \`compact({ ref, query? })\`
14
14
  - **Constraints**: patterns, conventions, anti-patterns
15
15
  - **Self-Review**: checklist before DONE
16
16
 
@@ -52,6 +52,7 @@ Use AI Kit retrieval/compression first. Native tools are fallback only.
52
52
  | \`read_file\` to understand a file | \`file_summary({ path })\` | Structure first |
53
53
  | \`read_file\` to find code | \`compact({ path, query })\` | Focused extract |
54
54
  | Multiple \`read_file\` calls | \`digest({ sources, query: "<task description>" })\` | Compress multi-file context |
55
+ | Cached ref to refocus prior output | \`compact({ ref, query? })\` | Reuse reversible text artifacts |
55
56
  | \`grep_search\` / \`semantic_search\` | \`search({ query })\` | Indexed search |
56
57
  | \`grep_search\` for a symbol | \`symbol({ name })\` | Def + refs |
57
58
  | \`run_in_terminal\` for tsc/lint | \`check({})\` | Narrow validation |
@@ -196,6 +197,7 @@ Use targeted searches before expensive work:
196
197
  | \`symbol({ name })\` | Definition + refs |
197
198
  | \`trace({ start, direction })\` | Call/data flow |
198
199
  | \`compact({ path, query })\` | Read specific section of a file |
200
+ | \`compact({ ref, query? })\` | Reuse cached search/find/knowledge/compact output |
199
201
  | \`read_file\` | **ONLY** when you need exact lines for a pending edit |
200
202
 
201
203
  ### Step 4: Tool Discovery
@@ -155,9 +155,9 @@ Every tool call passes through extractors that capture reusable facts:
155
155
  | **Research results** | \`web_search\`, \`web_fetch\`, \`search\`, \`find\` | Search findings, web content, code discoveries |
156
156
  | **Behavioral patterns** | ALL tools (ring buffer) | Tool preferences, search→edit sequences, error-fix cycles |
157
157
 
158
- **Retrieval:** Use \`enrich: true\` on any tool that supports it — the server automatically surfaces previously captured facts relevant to your query. Or search directly: \`search({ query: "...", origin: "curated" })\`
158
+ **Retrieval:** Use \`enrich: true\` on any tool that supports it — the server automatically surfaces previously captured facts relevant to your query. Search/find/knowledge responses can also emit reusable refs; feed those into \`compact({ ref, query })\` instead of reopening the source.
159
159
 
160
- **Best practice:** Before re-reading a file you've already explored, try \`search({ query: "file-path-or-topic" })\` — auto-knowledge may already have what you need.
160
+ **Best practice:** Before re-reading a file you've already explored, try \`search({ query: "file-path-or-topic" })\` — auto-knowledge may already have what you need, or reuse an existing \`ref\` with \`compact({ ref, query })\`.
161
161
 
162
162
  ### Retention & Tier Promotion
163
163
  - Memories start at **working** tier → promote on repeated access: episodic (2) → semantic (5) → procedural (10)