@cstart/coldstart 2.0.1 → 2.0.3
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 +27 -26
- package/dist/index-manager.js +1 -1
- package/dist/index-manager.js.map +1 -1
- package/dist/indexer/git.d.ts +17 -0
- package/dist/indexer/git.d.ts.map +1 -1
- package/dist/indexer/git.js +48 -0
- package/dist/indexer/git.js.map +1 -1
- package/dist/init.d.ts +21 -12
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +25 -23
- package/dist/init.js.map +1 -1
- package/dist/kb/cli.js +1 -1
- package/dist/kb/cli.js.map +1 -1
- package/dist/kb/freshness.d.ts +28 -2
- package/dist/kb/freshness.d.ts.map +1 -1
- package/dist/kb/freshness.js +35 -5
- package/dist/kb/freshness.js.map +1 -1
- package/dist/kb/notes-index.d.ts +8 -1
- package/dist/kb/notes-index.d.ts.map +1 -1
- package/dist/kb/notes-index.js +0 -0
- package/dist/kb/notes-index.js.map +1 -1
- package/dist/kb/search.d.ts +6 -1
- package/dist/kb/search.d.ts.map +1 -1
- package/dist/kb/search.js +33 -16
- package/dist/kb/search.js.map +1 -1
- package/dist/kb/types.d.ts +5 -1
- package/dist/kb/types.d.ts.map +1 -1
- package/hooks/codex-kb-elicit.mjs +20 -8
- package/hooks/cursor-kb-elicit.mjs +20 -8
- package/hooks/kb-elicit.mjs +20 -8
- package/package.json +1 -1
|
@@ -152,11 +152,20 @@ function filesBlock(root, files) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
// --- The capture prompt (kept identical to the Codex/Claude capture prompt) ----
|
|
155
|
-
function buildCapturePrompt(root, block, sid) {
|
|
155
|
+
function buildCapturePrompt(root, block, sid, isSubagent) {
|
|
156
156
|
return `You have completed a task now and have gathered knowledge as a part of that task or \
|
|
157
|
-
process
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
process — knowledge another agent in future could make use of.
|
|
158
|
+
|
|
159
|
+
But before writing any notes, we need to decide whether the task you completed deserves a note. \
|
|
160
|
+
If you were investigating on an older branch or doing a PR review, we may not need to save notes \
|
|
161
|
+
because that code is not in the present — it's in the past or it's in the future. The notes that \
|
|
162
|
+
we write are backed by the code in the present. This was an example to explain to you. As an \
|
|
163
|
+
agent who worked on the current task, you know its exact intent and are best suited to decide \
|
|
164
|
+
whether this task deserves a note. And if nothing about the current code is worth recording, \
|
|
165
|
+
then no note is the right answer.
|
|
166
|
+
|
|
167
|
+
Once you decide the task does deserve a note, we store it in a notebook format, and this \
|
|
168
|
+
notebook has to be backed by the codebase you are working on.
|
|
160
169
|
|
|
161
170
|
We need to save only the working knowledge of the codebase in a specific format so that it can \
|
|
162
171
|
be searched and served to future cold agents. We don't need to store any general interaction you \
|
|
@@ -167,8 +176,9 @@ below format —
|
|
|
167
176
|
|
|
168
177
|
THE NOTEBOOK HAS THREE CONTAINERS. Put each piece of knowledge in its one home:
|
|
169
178
|
|
|
170
|
-
1. FILE notes
|
|
171
|
-
judgment call about whether it seems obvious.
|
|
179
|
+
1. FILE notes (if you decided to write a note for the entire task) — write one for EVERY file \
|
|
180
|
+
you actually read and understood this session. No judgment call about whether it seems obvious. \
|
|
181
|
+
First decide the file's CHARACTER:
|
|
172
182
|
- hub = the file has no single purpose (models.py, helpers, utils). Knowledge lives per \
|
|
173
183
|
SYMBOL, as facets: one facet for each symbol you worked with this session. Only symbols you \
|
|
174
184
|
have firsthand knowledge of — never enumerate the rest.
|
|
@@ -245,7 +255,9 @@ Spec shapes (only include fields you actually have):
|
|
|
245
255
|
"body":"what you looked for + that it is not there",
|
|
246
256
|
"scope":{"terms":["search","terms"]}} (the search that proved it)
|
|
247
257
|
|
|
248
|
-
|
|
258
|
+
${isSubagent
|
|
259
|
+
? `Once you have handled the notebook — whether you wrote notes or decided none were needed — remember you were spawned as a subagent. The coordinator that spawned you receives ONLY your final message, so your last message must repeat, in full, the result you produced for it — your findings, not the notebook decision.`
|
|
260
|
+
: `When your notes are written, stop.`}`;
|
|
249
261
|
}
|
|
250
262
|
|
|
251
263
|
// --- stdin + guards -------------------------------------------------------------
|
|
@@ -324,7 +336,7 @@ process.on("unhandledRejection", (e) => { log(`unhandled ${e?.stack || e}`); pro
|
|
|
324
336
|
process.exit(0);
|
|
325
337
|
}
|
|
326
338
|
|
|
327
|
-
const prompt = buildCapturePrompt(root, filesBlock(root, files), sid);
|
|
339
|
+
const prompt = buildCapturePrompt(root, filesBlock(root, files), sid, event === "subagentStop");
|
|
328
340
|
logCaptureEvent(root, { event: "elicit", session: sid, agent: aid, touched: files.length, hook: event });
|
|
329
341
|
log(`ELICIT session=${sid} agent=${aid} touched=${files.length} promptBytes=${prompt.length} event=${event || "?"}`);
|
|
330
342
|
process.stdout.write(JSON.stringify({ followup_message: prompt }));
|
package/hooks/kb-elicit.mjs
CHANGED
|
@@ -147,11 +147,20 @@ function filesBlock(root, files) {
|
|
|
147
147
|
|
|
148
148
|
// --- The capture prompt (v4, 2026-07-07 — user-authored opening; validation-run
|
|
149
149
|
// configuration: gates off via --force, capture-only) ---------------------------
|
|
150
|
-
function buildCapturePrompt(root, block, sid) {
|
|
150
|
+
function buildCapturePrompt(root, block, sid, isSubagent) {
|
|
151
151
|
return `You have completed a task now and have gathered knowledge as a part of that task or \
|
|
152
|
-
process
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
process — knowledge another agent in future could make use of.
|
|
153
|
+
|
|
154
|
+
But before writing any notes, we need to decide whether the task you completed deserves a note. \
|
|
155
|
+
If you were investigating on an older branch or doing a PR review, we may not need to save notes \
|
|
156
|
+
because that code is not in the present — it's in the past or it's in the future. The notes that \
|
|
157
|
+
we write are backed by the code in the present. This was an example to explain to you. As an \
|
|
158
|
+
agent who worked on the current task, you know its exact intent and are best suited to decide \
|
|
159
|
+
whether this task deserves a note. And if nothing about the current code is worth recording, \
|
|
160
|
+
then no note is the right answer.
|
|
161
|
+
|
|
162
|
+
Once you decide the task does deserve a note, we store it in a notebook format, and this \
|
|
163
|
+
notebook has to be backed by the codebase you are working on.
|
|
155
164
|
|
|
156
165
|
We need to save only the working knowledge of the codebase in a specific format so that it can \
|
|
157
166
|
be searched and served to future cold agents. We don't need to store any general interaction you \
|
|
@@ -162,8 +171,9 @@ below format —
|
|
|
162
171
|
|
|
163
172
|
THE NOTEBOOK HAS THREE CONTAINERS. Put each piece of knowledge in its one home:
|
|
164
173
|
|
|
165
|
-
1. FILE notes
|
|
166
|
-
judgment call about whether it seems obvious.
|
|
174
|
+
1. FILE notes (if you decided to write a note for the entire task) — write one for EVERY file \
|
|
175
|
+
you actually read and understood this session. No judgment call about whether it seems obvious. \
|
|
176
|
+
First decide the file's CHARACTER:
|
|
167
177
|
- hub = the file has no single purpose (models.py, helpers, utils). Knowledge lives per \
|
|
168
178
|
SYMBOL, as facets: one facet for each symbol you worked with this session. Only symbols you \
|
|
169
179
|
have firsthand knowledge of — never enumerate the rest.
|
|
@@ -239,7 +249,9 @@ Spec shapes (only include fields you actually have):
|
|
|
239
249
|
"body":"what you looked for + that it is not there",
|
|
240
250
|
"scope":{"terms":["search","terms"]}} (the search that proved it)
|
|
241
251
|
|
|
242
|
-
|
|
252
|
+
${isSubagent
|
|
253
|
+
? `Once you have handled the notebook — whether you wrote notes or decided none were needed — remember you were spawned as a subagent. The coordinator that spawned you receives ONLY your final message, so your last message must repeat, in full, the result you produced for it — your findings, not the notebook decision.`
|
|
254
|
+
: `When your notes are written, stop.`}`;
|
|
243
255
|
}
|
|
244
256
|
|
|
245
257
|
// --- stdin + guards -------------------------------------------------------------
|
|
@@ -323,7 +335,7 @@ process.on("unhandledRejection", (e) => { log(`unhandled ${e?.stack || e}`); pro
|
|
|
323
335
|
process.exit(0);
|
|
324
336
|
}
|
|
325
337
|
|
|
326
|
-
const prompt = buildCapturePrompt(root, filesBlock(root, files), sid);
|
|
338
|
+
const prompt = buildCapturePrompt(root, filesBlock(root, files), sid, input.hook_event_name === "SubagentStop");
|
|
327
339
|
logCaptureEvent(root, { event: "elicit", session: sid, agent: aid, touched: files.length, hook: input.hook_event_name });
|
|
328
340
|
log(`ELICIT session=${sid} agent=${aid} touched=${files.length} promptBytes=${prompt.length} event=${input.hook_event_name || "?"}`);
|
|
329
341
|
process.stdout.write(JSON.stringify({ decision: "block", reason: prompt }));
|