@cstart/coldstart 2.2.10 → 2.2.12
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/README.md +4 -2
- package/dist/index-manager.d.ts +17 -0
- package/dist/index-manager.d.ts.map +1 -1
- package/dist/index-manager.js +35 -0
- package/dist/index-manager.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/init.d.ts +43 -7
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +114 -48
- package/dist/init.js.map +1 -1
- package/dist/kb/alias-repair.d.ts +37 -0
- package/dist/kb/alias-repair.d.ts.map +1 -0
- package/dist/kb/alias-repair.js +108 -0
- package/dist/kb/alias-repair.js.map +1 -0
- package/dist/kb/cli.d.ts.map +1 -1
- package/dist/kb/cli.js +90 -11
- package/dist/kb/cli.js.map +1 -1
- package/dist/kb/fold.d.ts +45 -2
- package/dist/kb/fold.d.ts.map +1 -1
- package/dist/kb/fold.js +71 -9
- package/dist/kb/fold.js.map +1 -1
- package/dist/kb/render.d.ts.map +1 -1
- package/dist/kb/render.js +10 -2
- package/dist/kb/render.js.map +1 -1
- package/dist/kb/repair.d.ts +67 -0
- package/dist/kb/repair.d.ts.map +1 -0
- package/dist/kb/repair.js +178 -0
- package/dist/kb/repair.js.map +1 -0
- package/dist/kb/search.d.ts +3 -2
- package/dist/kb/search.d.ts.map +1 -1
- package/dist/kb/search.js +101 -10
- package/dist/kb/search.js.map +1 -1
- package/dist/kb/session-worklist.d.ts +10 -0
- package/dist/kb/session-worklist.d.ts.map +1 -0
- package/dist/kb/session-worklist.js +92 -0
- package/dist/kb/session-worklist.js.map +1 -0
- package/dist/kb/types.d.ts +7 -2
- package/dist/kb/types.d.ts.map +1 -1
- package/dist/kb/view.js +1 -1
- package/dist/kb/view.js.map +1 -1
- package/dist/kb/write-guide.d.ts +44 -1
- package/dist/kb/write-guide.d.ts.map +1 -1
- package/dist/kb/write-guide.js +70 -25
- package/dist/kb/write-guide.js.map +1 -1
- package/dist/kb/write.d.ts +2 -1
- package/dist/kb/write.d.ts.map +1 -1
- package/dist/kb/write.js +13 -2
- package/dist/kb/write.js.map +1 -1
- package/dist/server/find.d.ts.map +1 -1
- package/dist/server/find.js +5 -3
- package/dist/server/find.js.map +1 -1
- package/dist/server/mcp.d.ts +24 -1
- package/dist/server/mcp.d.ts.map +1 -1
- package/dist/server/mcp.js +69 -5
- package/dist/server/mcp.js.map +1 -1
- package/dist/unwire.d.ts.map +1 -1
- package/dist/unwire.js +8 -2
- package/dist/unwire.js.map +1 -1
- package/hooks/capture-payload.mjs +87 -21
- package/hooks/note-shape.d.mts +63 -0
- package/hooks/note-shape.mjs +316 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,6 +89,8 @@ coldstart kb lookup src/models.py Tile # everything known at one exact addres
|
|
|
89
89
|
coldstart kb write spec.json # the write gate (two-phase dedup)
|
|
90
90
|
coldstart kb commit # publish notes to git, nothing else rides along
|
|
91
91
|
coldstart kb view # open a single-file HTML browser of the notebook
|
|
92
|
+
coldstart kb repair # worklist of notes that are written but unfindable
|
|
93
|
+
coldstart kb repair-aliases # worklist of aliases that may no longer be true
|
|
92
94
|
coldstart kb status / lint / render / init / migrate
|
|
93
95
|
```
|
|
94
96
|
|
|
@@ -108,7 +110,7 @@ coldstart kb status / lint / render / init / migrate
|
|
|
108
110
|
- **Concurrent sessions are safe.** Multiple agents can write at once: per-note append-only logs, exclusive creation for new note ids (a same-moment duplicate becomes two visible notes, never a silent merge), lossless merging for shared file notes, and atomic renders (a reader never sees a half-written note).
|
|
109
111
|
- **Corrections happen in-session.** If an agent finds a note wrong while the evidence is in its context, the guidance tells it to fix or retract the note right then — no better-placed future agent exists.
|
|
110
112
|
|
|
111
|
-
**Setup:** the notebook comes with `coldstart init` — no separate step. It creates the notebook skeleton, sets union-merge for the logs, and (on Claude Code, Codex and Cursor) wires the two hooks — capture at session end, recall at prompt time. (`coldstart kb init` still exists as an alias if you want to (re-)wire just the notebook.) Other hosts can drive the notebook without the hooks: via the full `kb` CLI, or — for no-shell clients — the `kb_search` / `kb_lookup` / `kb_write` / `kb_status` MCP tools.
|
|
113
|
+
**Setup:** the notebook comes with `coldstart init` — no separate step. It creates the notebook skeleton, sets union-merge for the logs, and (on Claude Code, Codex and Cursor) wires the two hooks — capture at session end, recall at prompt time. (`coldstart kb init` still exists as an alias if you want to (re-)wire just the notebook.) Other hosts can drive the notebook without the hooks: via the full `kb` CLI, or — for no-shell clients — the `kb_search` / `kb_lookup` / `kb_write` / `kb_status` / `kb_repair` / `kb_repair_aliases` MCP tools.
|
|
112
114
|
|
|
113
115
|
**Language-agnostic.** The notebook's freshness machinery is content-hash based, so it works on any codebase — including languages the navigation index doesn't parse. Where the index does parse, notes additionally get symbol-level freshness.
|
|
114
116
|
|
|
@@ -171,7 +173,7 @@ coldstart find auth; coldstart find 'session cookie'; coldstart gs src/auth/serv
|
|
|
171
173
|
coldstart ships as one binary with two front doors:
|
|
172
174
|
|
|
173
175
|
- **CLI (primary)** — `coldstart find …` / `coldstart gs …` / `coldstart kb …`. For any shell-capable agent (Claude Code, Cursor, terminal use). This is the fast path.
|
|
174
|
-
- **MCP (for no-shell clients)** — the `find` and `gs` tools, plus the notebook as `kb_search` / `kb_lookup` / `kb_write` / `kb_status`, all byte-identical to the CLI. For clients like Claude Desktop that have no shell. (`kb commit` stays CLI/human-only — publishing notes to git is never an agent action.)
|
|
176
|
+
- **MCP (for no-shell clients)** — the `find` and `gs` tools, plus the notebook as `kb_search` / `kb_lookup` / `kb_write` / `kb_status` / `kb_repair` / `kb_repair_aliases`, all byte-identical to the CLI. For clients like Claude Desktop that have no shell. (`kb commit` stays CLI/human-only — publishing notes to git is never an agent action.)
|
|
175
177
|
|
|
176
178
|
Same engine, same index, same results. Pick whichever your agent can reach.
|
|
177
179
|
|
package/dist/index-manager.d.ts
CHANGED
|
@@ -61,6 +61,23 @@ export declare class IndexManager {
|
|
|
61
61
|
private refreshingKb;
|
|
62
62
|
private kbRefreshQueued;
|
|
63
63
|
private refreshKbNotesIndex;
|
|
64
|
+
/**
|
|
65
|
+
* Auto-backfill new single-file notes' anchor symbols right after the
|
|
66
|
+
* sidecar they depend on is rebuilt, so an agent's `kb write` gets its
|
|
67
|
+
* symbols filled within this same debounce cycle instead of waiting for the
|
|
68
|
+
* next `kb repair`/`init`. Passes the just-built `kb` in memory — no
|
|
69
|
+
* redundant disk read of the file this process just wrote.
|
|
70
|
+
*
|
|
71
|
+
* Self-triggering by construction: a fix appends to a note's `.raw`, which
|
|
72
|
+
* re-fires the watcher, which re-enters this refresh. That should converge
|
|
73
|
+
* in one extra no-op pass (the anchor now has symbols, nothing left to fix),
|
|
74
|
+
* but MAX_AUTO_REPAIR_STREAK is a hard backstop in case it doesn't — a pass
|
|
75
|
+
* that fixes nothing resets the streak, so the common (idle) case never
|
|
76
|
+
* pays this cost at all.
|
|
77
|
+
*/
|
|
78
|
+
private mechanicalRepairStreak;
|
|
79
|
+
private static readonly MAX_AUTO_REPAIR_STREAK;
|
|
80
|
+
private autoMechanicalSymbolRepair;
|
|
64
81
|
/**
|
|
65
82
|
* Keep an already-generated notebook `index.html` current. `kb view` is
|
|
66
83
|
* opt-in (generate-and-open); once the user has opened it, the browser tab
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-manager.d.ts","sourceRoot":"","sources":["../src/index-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAchD,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,sFAAsF;IACtF,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,YAAY;IAerB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAA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128
128
|
const kb = await buildKbNotesIndex(this.activeIndex, this.activeIndex.rootDir);
|
|
129
129
|
await saveKbNotesIndex(this.activeIndex.rootDir, kb, this.cacheDir);
|
|
130
130
|
this.log(`[coldstart] KB notes index refreshed (${Object.keys(kb.anchors).length} anchors, ${Object.keys(kb.absence).length} absence stamps, ${Object.keys(kb.renames).length} renames)`);
|
|
131
|
+
await this.autoMechanicalSymbolRepair(kb);
|
|
131
132
|
this.regenerateKbViewIfPresent();
|
|
132
133
|
}
|
|
133
134
|
catch (err) {
|
|
@@ -141,6 +142,40 @@ export class IndexManager {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Auto-backfill new single-file notes' anchor symbols right after the
|
|
147
|
+
* sidecar they depend on is rebuilt, so an agent's `kb write` gets its
|
|
148
|
+
* symbols filled within this same debounce cycle instead of waiting for the
|
|
149
|
+
* next `kb repair`/`init`. Passes the just-built `kb` in memory — no
|
|
150
|
+
* redundant disk read of the file this process just wrote.
|
|
151
|
+
*
|
|
152
|
+
* Self-triggering by construction: a fix appends to a note's `.raw`, which
|
|
153
|
+
* re-fires the watcher, which re-enters this refresh. That should converge
|
|
154
|
+
* in one extra no-op pass (the anchor now has symbols, nothing left to fix),
|
|
155
|
+
* but MAX_AUTO_REPAIR_STREAK is a hard backstop in case it doesn't — a pass
|
|
156
|
+
* that fixes nothing resets the streak, so the common (idle) case never
|
|
157
|
+
* pays this cost at all.
|
|
158
|
+
*/
|
|
159
|
+
mechanicalRepairStreak = 0;
|
|
160
|
+
static MAX_AUTO_REPAIR_STREAK = 3;
|
|
161
|
+
async autoMechanicalSymbolRepair(kb) {
|
|
162
|
+
if (this.mechanicalRepairStreak >= IndexManager.MAX_AUTO_REPAIR_STREAK)
|
|
163
|
+
return;
|
|
164
|
+
try {
|
|
165
|
+
const { mechanicalSymbolRepair } = await import('./kb/repair.js');
|
|
166
|
+
const { fixed } = await mechanicalSymbolRepair(this.activeIndex.rootDir, this.cacheDir, kb);
|
|
167
|
+
if (fixed.length) {
|
|
168
|
+
this.mechanicalRepairStreak++;
|
|
169
|
+
this.log(`[coldstart] auto-backfilled anchor symbols on ${fixed.length} note(s) (streak ${this.mechanicalRepairStreak}/${IndexManager.MAX_AUTO_REPAIR_STREAK})`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.mechanicalRepairStreak = 0;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
this.log(`[coldstart] auto symbol repair failed: ${err}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
144
179
|
/**
|
|
145
180
|
* Keep an already-generated notebook `index.html` current. `kb view` is
|
|
146
181
|
* opt-in (generate-and-open); once the user has opened it, the browser tab
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-manager.js","sourceRoot":"","sources":["../src/index-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAW,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC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BACtE,sEAAsE;oBACtE,uEAAuE;oBACvE,gEAAgE;oBAChE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;wBAC1B,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,gBAAgB,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW;4BAAE,OAAO;wBAClF,IAAI,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;wBACrE,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;oBAC7B,CAAC;gBACH,CAAC,EAAE,GAAG,CAAC,CAAC;YACV,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;YAC1D,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,aAAa;gBAAE,YAAY,CAAC,aAAa,CAAC,CAAC;YAC/C,OAAO,EAAE,KAAK,EAAE,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -619,7 +619,7 @@ Navigation
|
|
|
619
619
|
index build/refresh the index for this repo
|
|
620
620
|
|
|
621
621
|
Notebook
|
|
622
|
-
kb <sub> search | lookup | write | commit | status | lint | render | view | init
|
|
622
|
+
kb <sub> search | lookup | write | commit | status | lint | repair | render | view | init
|
|
623
623
|
|
|
624
624
|
Lifecycle
|
|
625
625
|
init wire coldstart into this repo (asks experience + client)
|
package/dist/init.d.ts
CHANGED
|
@@ -110,19 +110,55 @@ export declare function wireCursorRule(cwd: string, mode: 'cli' | 'mcp'): 'creat
|
|
|
110
110
|
* the invocation is identical across hosts; only each host's wrapper differs.
|
|
111
111
|
* The install path is absolute and tracks npm updates (see installRoot). */
|
|
112
112
|
export declare const CAPTURE_COMMAND = "capture-notes";
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
113
|
+
/** The user-invoked repair command (`/repair-notes`).
|
|
114
|
+
*
|
|
115
|
+
* Notes written before the required-field shape was frozen are missing fields
|
|
116
|
+
* their writer was never asked for — correct, but unreachable. `kb repair`
|
|
117
|
+
* finds them and prints a worklist; the agent does the fixing, because every
|
|
118
|
+
* gap needs a judgement about the code. Detection runs inside the command, so
|
|
119
|
+
* a clean notebook produces one line and no work. */
|
|
120
|
+
export declare const REPAIR_COMMAND = "repair-notes";
|
|
121
|
+
/** The user-invoked alias-reconciliation command (`/repair-aliases`).
|
|
122
|
+
*
|
|
123
|
+
* A different problem from REPAIR_COMMAND: that one finds notes with NO
|
|
124
|
+
* identityAliases at all (a missing-field gap, fixed at ordinary write time).
|
|
125
|
+
* This one is for aliases that EXIST but no longer describe the file/flow —
|
|
126
|
+
* a note rewritten several times can carry identity-shaped words that were
|
|
127
|
+
* really symptom words for an earlier write. Needs the same code-reading
|
|
128
|
+
* judgement `kb repair` never automates, so it stays a worklist, never a
|
|
129
|
+
* write, same as REPAIR_COMMAND. Paginated — see `kb repair-aliases`. */
|
|
130
|
+
export declare const REPAIR_ALIASES_COMMAND = "repair-aliases";
|
|
131
|
+
/** Every user-invoked command is the same three files with different text.
|
|
132
|
+
* Keeping them in one table is what stops a host from quietly having only some
|
|
133
|
+
* of them — `unwire` sweeps the same list. */
|
|
134
|
+
export interface UserCommand {
|
|
135
|
+
name: string;
|
|
136
|
+
/** The shell command each host's wrapper runs. */
|
|
137
|
+
invocation: () => string;
|
|
138
|
+
/** One line for the Claude front-matter and the init output. */
|
|
139
|
+
description: string;
|
|
140
|
+
/** Codex skills need a longer, trigger-oriented description. */
|
|
141
|
+
skillDescription: string;
|
|
142
|
+
/** What the agent should do with the output. */
|
|
143
|
+
instructions: string;
|
|
144
|
+
}
|
|
145
|
+
export declare const USER_COMMANDS: Record<'capture' | 'repair' | 'repairAliases', UserCommand>;
|
|
146
|
+
/** Claude Code: `.claude/commands/<name>.md` → `/<name>`.
|
|
147
|
+
* Claude expands a leading `!` at submit time, so the output is injected
|
|
115
148
|
* straight into the prompt and the agent acts on it in the same turn. */
|
|
116
|
-
export declare function
|
|
117
|
-
/** Cursor: `.cursor/commands
|
|
149
|
+
export declare function wireClaudeCommand(cwd: string, cmd: UserCommand): 'created' | 'updated';
|
|
150
|
+
/** Cursor: `.cursor/commands/<name>.md` → `/<name>`.
|
|
118
151
|
* Cursor commands are plain prompt templates with no `!` expansion, so the
|
|
119
152
|
* body asks the agent to run the command itself. */
|
|
120
|
-
export declare function
|
|
121
|
-
/** Codex: `.agents/skills
|
|
153
|
+
export declare function wireCursorCommand(cwd: string, cmd: UserCommand): 'created' | 'updated';
|
|
154
|
+
/** Codex: `.agents/skills/<name>/SKILL.md` → `$<name>`.
|
|
122
155
|
* Codex custom prompts are global (`~/.codex/prompts`) AND deprecated, so they
|
|
123
156
|
* can't carry a repo-scoped command. Skills are the supported path and ARE
|
|
124
157
|
* repo-scoped — Codex walks `.agents/skills` from the cwd up to the repo root. */
|
|
125
|
-
export declare function
|
|
158
|
+
export declare function wireCodexSkill(cwd: string, cmd: UserCommand): 'created' | 'updated';
|
|
159
|
+
export declare const wireClaudeCaptureCommand: (cwd: string) => "updated" | "created";
|
|
160
|
+
export declare const wireCursorCaptureCommand: (cwd: string) => "updated" | "created";
|
|
161
|
+
export declare const wireCodexCaptureSkill: (cwd: string) => "updated" | "created";
|
|
126
162
|
export declare const AGENTS_START = "<!-- coldstart:start -->";
|
|
127
163
|
export declare const AGENTS_END = "<!-- coldstart:end -->";
|
|
128
164
|
/** Ensure AGENTS.md carries the FULL coldstart guidance inline.
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAaH,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAsB3C,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,G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O,CAAC,IAAI,CAAC,CA+F7C"}
|
package/dist/init.js
CHANGED
|
@@ -564,73 +564,123 @@ ${coldstartMd(mode)}`;
|
|
|
564
564
|
* the invocation is identical across hosts; only each host's wrapper differs.
|
|
565
565
|
* The install path is absolute and tracks npm updates (see installRoot). */
|
|
566
566
|
export const CAPTURE_COMMAND = 'capture-notes';
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
567
|
+
/** The user-invoked repair command (`/repair-notes`).
|
|
568
|
+
*
|
|
569
|
+
* Notes written before the required-field shape was frozen are missing fields
|
|
570
|
+
* their writer was never asked for — correct, but unreachable. `kb repair`
|
|
571
|
+
* finds them and prints a worklist; the agent does the fixing, because every
|
|
572
|
+
* gap needs a judgement about the code. Detection runs inside the command, so
|
|
573
|
+
* a clean notebook produces one line and no work. */
|
|
574
|
+
export const REPAIR_COMMAND = 'repair-notes';
|
|
575
|
+
/** The user-invoked alias-reconciliation command (`/repair-aliases`).
|
|
576
|
+
*
|
|
577
|
+
* A different problem from REPAIR_COMMAND: that one finds notes with NO
|
|
578
|
+
* identityAliases at all (a missing-field gap, fixed at ordinary write time).
|
|
579
|
+
* This one is for aliases that EXIST but no longer describe the file/flow —
|
|
580
|
+
* a note rewritten several times can carry identity-shaped words that were
|
|
581
|
+
* really symptom words for an earlier write. Needs the same code-reading
|
|
582
|
+
* judgement `kb repair` never automates, so it stays a worklist, never a
|
|
583
|
+
* write, same as REPAIR_COMMAND. Paginated — see `kb repair-aliases`. */
|
|
584
|
+
export const REPAIR_ALIASES_COMMAND = 'repair-aliases';
|
|
585
|
+
export const USER_COMMANDS = {
|
|
586
|
+
capture: {
|
|
587
|
+
name: CAPTURE_COMMAND,
|
|
588
|
+
invocation: () => `node ${path.join(resolveHooksDir(), 'kb-elicit.mjs')} --manual`,
|
|
589
|
+
description: 'Capture notebook notes for the work done so far',
|
|
590
|
+
skillDescription: 'Capture coldstart notebook notes for the work done so far in this session. Use when the '
|
|
591
|
+
+ 'user asks to capture notes, save what was learned, or write up findings before moving on.',
|
|
592
|
+
instructions: 'Follow the notebook-capture checklist it prints, exactly as you would for an automatic '
|
|
593
|
+
+ 'capture: decide what (if anything) is worth writing, and never write a note for a file '
|
|
594
|
+
+ 'that is not on the worklist. If nothing about the present code is worth recording, write '
|
|
595
|
+
+ 'nothing and say so.',
|
|
596
|
+
},
|
|
597
|
+
repair: {
|
|
598
|
+
name: REPAIR_COMMAND,
|
|
599
|
+
// The CLI, not a hook: repair reads the notebook and nothing else, so it
|
|
600
|
+
// needs no session and no index. `--root .` keeps it repo-agnostic.
|
|
601
|
+
invocation: () => `node ${path.join(installRoot(), 'dist', 'index.js')} kb repair --root .`,
|
|
602
|
+
description: 'Repair notebook notes that are written but unfindable',
|
|
603
|
+
skillDescription: 'Repair coldstart notebook notes that are missing the fields which make them findable '
|
|
604
|
+
+ '(identityAliases, anchor symbols, a flow\'s verified paths). Use when the user asks to repair, '
|
|
605
|
+
+ 'fix, or clean up the notebook, or when notes are not turning up in search.',
|
|
606
|
+
// Deliberately thin: the worklist carries its own instructions, so that the
|
|
607
|
+
// CLI, the MCP tool and all three hosts say the same thing. Repeating them
|
|
608
|
+
// here is how they drift.
|
|
609
|
+
instructions: 'It prints a worklist and changes nothing. Follow the instructions it prints, and work '
|
|
610
|
+
+ 'through every note it lists. If it prints "Nothing to repair here.", stop — there is '
|
|
611
|
+
+ 'no work.',
|
|
612
|
+
},
|
|
613
|
+
repairAliases: {
|
|
614
|
+
name: REPAIR_ALIASES_COMMAND,
|
|
615
|
+
invocation: () => `node ${path.join(installRoot(), 'dist', 'index.js')} kb repair-aliases --root .`,
|
|
616
|
+
description: 'Reconcile identityAliases that no longer describe the file/flow',
|
|
617
|
+
skillDescription: 'Reconcile coldstart notebook identityAliases against the current code — catches aliases that '
|
|
618
|
+
+ 'were accurate when written but are now stale or were really symptom words for an earlier '
|
|
619
|
+
+ 'write. Use when the user asks to clean up, audit, or reconcile notebook aliases; not for '
|
|
620
|
+
+ 'notes missing aliases entirely (that\'s /repair-notes).',
|
|
621
|
+
// Deliberately thin, same reasoning as `repair` above: the worklist carries
|
|
622
|
+
// its own instructions and pagination pointer, so CLI/MCP/all three hosts
|
|
623
|
+
// say the same thing.
|
|
624
|
+
instructions: 'It prints a PAGINATED worklist (10 notes at a time) and changes nothing. Follow the '
|
|
625
|
+
+ 'instructions it prints for each note, then if it says more notes remain, re-run the same '
|
|
626
|
+
+ 'command with the `--offset` it gives you and continue until none remain. If it prints "No '
|
|
627
|
+
+ 'file/flow notes to reconcile.", stop.',
|
|
628
|
+
},
|
|
629
|
+
};
|
|
630
|
+
/** Claude Code: `.claude/commands/<name>.md` → `/<name>`.
|
|
631
|
+
* Claude expands a leading `!` at submit time, so the output is injected
|
|
576
632
|
* straight into the prompt and the agent acts on it in the same turn. */
|
|
577
|
-
export function
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const existed = fs.existsSync(filePath);
|
|
581
|
-
const body = `---
|
|
582
|
-
description: Capture notebook notes for the work done so far
|
|
633
|
+
export function wireClaudeCommand(cwd, cmd) {
|
|
634
|
+
return writeOwnedFile(path.join(cwd, '.claude', 'commands', `${cmd.name}.md`), `---
|
|
635
|
+
description: ${cmd.description}
|
|
583
636
|
allowed-tools: Bash(node:*)
|
|
584
637
|
---
|
|
585
638
|
|
|
586
|
-
!\`${
|
|
639
|
+
!\`${cmd.invocation()}\`
|
|
587
640
|
|
|
588
|
-
${
|
|
589
|
-
|
|
590
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
591
|
-
fs.writeFileSync(filePath, body);
|
|
592
|
-
return existed ? 'updated' : 'created';
|
|
641
|
+
${cmd.instructions}
|
|
642
|
+
`);
|
|
593
643
|
}
|
|
594
|
-
/** Cursor: `.cursor/commands
|
|
644
|
+
/** Cursor: `.cursor/commands/<name>.md` → `/<name>`.
|
|
595
645
|
* Cursor commands are plain prompt templates with no `!` expansion, so the
|
|
596
646
|
* body asks the agent to run the command itself. */
|
|
597
|
-
export function
|
|
598
|
-
|
|
599
|
-
const filePath = path.join(dir, `${CAPTURE_COMMAND}.md`);
|
|
600
|
-
const existed = fs.existsSync(filePath);
|
|
601
|
-
const body = `Run this in the terminal:
|
|
647
|
+
export function wireCursorCommand(cwd, cmd) {
|
|
648
|
+
return writeOwnedFile(path.join(cwd, '.cursor', 'commands', `${cmd.name}.md`), `Run this in the terminal:
|
|
602
649
|
|
|
603
|
-
\`${
|
|
650
|
+
\`${cmd.invocation()}\`
|
|
604
651
|
|
|
605
|
-
${
|
|
606
|
-
|
|
607
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
608
|
-
fs.writeFileSync(filePath, body);
|
|
609
|
-
return existed ? 'updated' : 'created';
|
|
652
|
+
${cmd.instructions}
|
|
653
|
+
`);
|
|
610
654
|
}
|
|
611
|
-
/** Codex: `.agents/skills
|
|
655
|
+
/** Codex: `.agents/skills/<name>/SKILL.md` → `$<name>`.
|
|
612
656
|
* Codex custom prompts are global (`~/.codex/prompts`) AND deprecated, so they
|
|
613
657
|
* can't carry a repo-scoped command. Skills are the supported path and ARE
|
|
614
658
|
* repo-scoped — Codex walks `.agents/skills` from the cwd up to the repo root. */
|
|
615
|
-
export function
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
const body = `---
|
|
620
|
-
name: ${CAPTURE_COMMAND}
|
|
621
|
-
description: Capture coldstart notebook notes for the work done so far in this session. Use when the user asks to capture notes, save what was learned, or write up findings before moving on.
|
|
659
|
+
export function wireCodexSkill(cwd, cmd) {
|
|
660
|
+
return writeOwnedFile(path.join(cwd, '.agents', 'skills', cmd.name, 'SKILL.md'), `---
|
|
661
|
+
name: ${cmd.name}
|
|
662
|
+
description: ${cmd.skillDescription}
|
|
622
663
|
---
|
|
623
664
|
|
|
624
665
|
Run this in the terminal:
|
|
625
666
|
|
|
626
|
-
\`${
|
|
667
|
+
\`${cmd.invocation()}\`
|
|
627
668
|
|
|
628
|
-
${
|
|
629
|
-
|
|
630
|
-
|
|
669
|
+
${cmd.instructions}
|
|
670
|
+
`);
|
|
671
|
+
}
|
|
672
|
+
/** These files are coldstart-owned end to end, so a re-run overwrites rather
|
|
673
|
+
* than merges — that is how guidance edits reach an already-inited repo. */
|
|
674
|
+
function writeOwnedFile(filePath, body) {
|
|
675
|
+
const existed = fs.existsSync(filePath);
|
|
676
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
631
677
|
fs.writeFileSync(filePath, body);
|
|
632
678
|
return existed ? 'updated' : 'created';
|
|
633
679
|
}
|
|
680
|
+
// Back-compat wrappers — the capture command predates the table above.
|
|
681
|
+
export const wireClaudeCaptureCommand = (cwd) => wireClaudeCommand(cwd, USER_COMMANDS.capture);
|
|
682
|
+
export const wireCursorCaptureCommand = (cwd) => wireCursorCommand(cwd, USER_COMMANDS.capture);
|
|
683
|
+
export const wireCodexCaptureSkill = (cwd) => wireCodexSkill(cwd, USER_COMMANDS.capture);
|
|
634
684
|
export const AGENTS_START = '<!-- coldstart:start -->';
|
|
635
685
|
export const AGENTS_END = '<!-- coldstart:end -->';
|
|
636
686
|
/** Ensure AGENTS.md carries the FULL coldstart guidance inline.
|
|
@@ -769,7 +819,9 @@ function setupClaude(cwd, exp) {
|
|
|
769
819
|
out(typeof kb === 'object'
|
|
770
820
|
? ` settings.json — notebook hooks NOT wired: ${kb.error}`
|
|
771
821
|
: ` settings.json — ${kb} notebook recall + capture hooks (UserPromptSubmit + Stop/SubagentStop)`);
|
|
772
|
-
out(` commands/ — ${
|
|
822
|
+
out(` commands/ — ${wireClaudeCommand(cwd, USER_COMMANDS.capture)} /${CAPTURE_COMMAND} (capture notes on demand)`);
|
|
823
|
+
out(` commands/ — ${wireClaudeCommand(cwd, USER_COMMANDS.repair)} /${REPAIR_COMMAND} (fix notes that can't be found)`);
|
|
824
|
+
out(` commands/ — ${wireClaudeCommand(cwd, USER_COMMANDS.repairAliases)} /${REPAIR_ALIASES_COMMAND} (reconcile stale aliases)`);
|
|
773
825
|
}
|
|
774
826
|
function setupCodex(cwd, exp) {
|
|
775
827
|
out(` AGENTS.md — ${wireCodexAgents(cwd, exp)} coldstart navigation section (full ${FLAVOR(exp)} guidance inlined)`);
|
|
@@ -782,7 +834,9 @@ function setupCodex(cwd, exp) {
|
|
|
782
834
|
out(typeof hooks === 'object'
|
|
783
835
|
? ` hooks.json — Codex hooks NOT wired: ${hooks.error}`
|
|
784
836
|
: ` hooks.json — ${hooks} Codex navigation + notebook hooks`);
|
|
785
|
-
out(` .agents/skills — ${
|
|
837
|
+
out(` .agents/skills — ${wireCodexSkill(cwd, USER_COMMANDS.capture)} $${CAPTURE_COMMAND} skill (capture notes on demand)`);
|
|
838
|
+
out(` .agents/skills — ${wireCodexSkill(cwd, USER_COMMANDS.repair)} $${REPAIR_COMMAND} skill (fix notes that can't be found)`);
|
|
839
|
+
out(` .agents/skills — ${wireCodexSkill(cwd, USER_COMMANDS.repairAliases)} $${REPAIR_ALIASES_COMMAND} skill (reconcile stale aliases)`);
|
|
786
840
|
if (typeof hooks !== 'object') {
|
|
787
841
|
out('');
|
|
788
842
|
out(' ⚠ Codex won\'t run these hooks until you trust them — untrusted hooks');
|
|
@@ -807,7 +861,9 @@ function setupCursor(cwd, exp) {
|
|
|
807
861
|
out(typeof hooks === 'object'
|
|
808
862
|
? ` hooks.json — Cursor hooks NOT wired: ${hooks.error}`
|
|
809
863
|
: ` hooks.json — ${hooks} Cursor navigation + notebook hooks`);
|
|
810
|
-
out(` commands/ — ${
|
|
864
|
+
out(` commands/ — ${wireCursorCommand(cwd, USER_COMMANDS.capture)} /${CAPTURE_COMMAND} (capture notes on demand)`);
|
|
865
|
+
out(` commands/ — ${wireCursorCommand(cwd, USER_COMMANDS.repair)} /${REPAIR_COMMAND} (fix notes that can't be found)`);
|
|
866
|
+
out(` commands/ — ${wireCursorCommand(cwd, USER_COMMANDS.repairAliases)} /${REPAIR_ALIASES_COMMAND} (reconcile stale aliases)`);
|
|
811
867
|
}
|
|
812
868
|
function setupOther(cwd, exp) {
|
|
813
869
|
out(` coldstart.md — ${writeColdstartMd(cwd, exp)} (${FLAVOR(exp)})`);
|
|
@@ -928,6 +984,16 @@ export async function runInit() {
|
|
|
928
984
|
const waited = await waitForKeeperCache(cwd, undefined, 180_000, (m) => out(m));
|
|
929
985
|
if (waited === 'ready') {
|
|
930
986
|
out('Index ready.');
|
|
987
|
+
// Existing notebook (a re-init / upgrade), now that the sidecar the backfill
|
|
988
|
+
// reads is guaranteed built. Fresh notebooks have nothing to fix (no-op).
|
|
989
|
+
// Same mechanism `kb repair` runs — see repair.ts for why this is safe to
|
|
990
|
+
// do without agent judgment (single-character notes only, never overrides
|
|
991
|
+
// existing symbols).
|
|
992
|
+
const { mechanicalSymbolRepair } = await import('./kb/repair.js');
|
|
993
|
+
const backfilled = await mechanicalSymbolRepair(cwd);
|
|
994
|
+
if (backfilled.fixed.length) {
|
|
995
|
+
out(`Backfilled anchor symbols on ${backfilled.fixed.length} existing note${backfilled.fixed.length === 1 ? '' : 's'} from the code index.`);
|
|
996
|
+
}
|
|
931
997
|
}
|
|
932
998
|
else if (waited === 'no-keeper') {
|
|
933
999
|
out('Could not start the background indexer — your first lookup will build it instead.');
|