@vectorize-io/hindsight-coding-agents 0.4.1 → 0.4.2
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 +84 -4
- package/dist/antigravity-hook.js +35 -10
- package/dist/antigravity-statusline.js +24 -2
- package/dist/antigravity-stop-hook.js +48 -11
- package/dist/claude-hook.js +35 -10
- package/dist/claude-sessionstart-hook.js +62 -16
- package/dist/claude-stop-hook.js +48 -11
- package/dist/cline.js +64 -17
- package/dist/codex-hook.js +35 -10
- package/dist/codex-sessionstart-hook.js +62 -16
- package/dist/codex-stop-hook.js +48 -11
- package/dist/copilot-hook.js +35 -10
- package/dist/copilot-sessionstart-hook.js +62 -16
- package/dist/copilot-stop-hook.js +48 -11
- package/dist/cursor-hook.js +35 -10
- package/dist/cursor-sessionstart-hook.js +62 -16
- package/dist/cursor-stop-hook.js +48 -11
- package/dist/daemon-start.js +15 -3
- package/dist/deepen.js +37 -9
- package/dist/devin-hook.js +35 -10
- package/dist/devin-sessionstart-hook.js +62 -16
- package/dist/devin-stop-hook.js +48 -11
- package/dist/dsh.js +64 -17
- package/dist/grok-hook.js +35 -10
- package/dist/grok-sessionstart-hook.js +62 -16
- package/dist/grok-stop-hook.js +48 -11
- package/dist/hindsight-seed.js +26 -3
- package/dist/index.js +64 -17
- package/dist/installer.js +16 -4
- package/dist/kilo.js +64 -17
- package/dist/mcp-server.js +38 -9
- package/dist/prime-agent.js +64 -17
- package/dist/status.js +38 -9
- package/package.json +3 -2
- package/skill/SKILL.md +345 -68
package/dist/cursor-stop-hook.js
CHANGED
|
@@ -33,14 +33,36 @@ function getProjectRootFromGit(directory) {
|
|
|
33
33
|
const commonDir = execFileSync(
|
|
34
34
|
"git",
|
|
35
35
|
["rev-parse", "--path-format=absolute", "--git-common-dir"],
|
|
36
|
-
{
|
|
36
|
+
{
|
|
37
|
+
cwd: directory,
|
|
38
|
+
encoding: "utf-8",
|
|
39
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
40
|
+
timeout: 1e3,
|
|
41
|
+
windowsHide: true
|
|
42
|
+
}
|
|
37
43
|
).trim();
|
|
38
44
|
if (!commonDir) return null;
|
|
39
|
-
|
|
45
|
+
if (basename(commonDir) === ".git") return dirname(commonDir);
|
|
46
|
+
if (basename(commonDir).startsWith(".") && isBareRepository(commonDir)) {
|
|
47
|
+
return dirname(commonDir);
|
|
48
|
+
}
|
|
49
|
+
return commonDir;
|
|
40
50
|
} catch {
|
|
41
51
|
return null;
|
|
42
52
|
}
|
|
43
53
|
}
|
|
54
|
+
function isBareRepository(commonDir) {
|
|
55
|
+
try {
|
|
56
|
+
return execFileSync("git", ["-C", commonDir, "rev-parse", "--is-bare-repository"], {
|
|
57
|
+
encoding: "utf-8",
|
|
58
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
59
|
+
timeout: 1e3,
|
|
60
|
+
env: { ...process.env, GIT_DIR: void 0, GIT_WORK_TREE: void 0 }
|
|
61
|
+
}).trim() === "true";
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
44
66
|
function projectNameOf(directory, sessionRoot) {
|
|
45
67
|
return gitProjectName(directory, true, sessionRoot);
|
|
46
68
|
}
|
|
@@ -814,14 +836,16 @@ var HindsightClient = class {
|
|
|
814
836
|
return;
|
|
815
837
|
}
|
|
816
838
|
if (r.status !== 409) created++;
|
|
817
|
-
} else
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
839
|
+
} else {
|
|
840
|
+
const sourceDrift = hit.description !== page.source_query;
|
|
841
|
+
const triggerDrift = hit.trigger != null && hit.trigger.tags_match !== pageTrigger.tags_match;
|
|
842
|
+
if (!sourceDrift && !triggerDrift) continue;
|
|
843
|
+
const patch = {};
|
|
844
|
+
if (sourceDrift) {
|
|
822
845
|
patch.source_query = page.source_query;
|
|
823
846
|
patch.tags = page.tags;
|
|
824
847
|
}
|
|
848
|
+
if (triggerDrift) patch.trigger = pageTrigger;
|
|
825
849
|
const r = await this.req(
|
|
826
850
|
"PATCH",
|
|
827
851
|
this.bankUrl(`/knowledge-base/nodes/${encodeURIComponent(hit.id)}`),
|
|
@@ -1392,7 +1416,11 @@ async function isServerHealthy(baseUrl, timeoutMs = 2e3) {
|
|
|
1392
1416
|
function hasRustToolchain() {
|
|
1393
1417
|
if (process.platform !== "darwin") return true;
|
|
1394
1418
|
try {
|
|
1395
|
-
execFileSync2("cargo", ["--version"], {
|
|
1419
|
+
execFileSync2("cargo", ["--version"], {
|
|
1420
|
+
stdio: "pipe",
|
|
1421
|
+
timeout: 1e4,
|
|
1422
|
+
windowsHide: true
|
|
1423
|
+
});
|
|
1396
1424
|
return true;
|
|
1397
1425
|
} catch {
|
|
1398
1426
|
return false;
|
|
@@ -1400,7 +1428,11 @@ function hasRustToolchain() {
|
|
|
1400
1428
|
}
|
|
1401
1429
|
function hasUvx() {
|
|
1402
1430
|
try {
|
|
1403
|
-
execFileSync2("uvx", ["--version"], {
|
|
1431
|
+
execFileSync2("uvx", ["--version"], {
|
|
1432
|
+
stdio: "pipe",
|
|
1433
|
+
timeout: 1e4,
|
|
1434
|
+
windowsHide: true
|
|
1435
|
+
});
|
|
1404
1436
|
return true;
|
|
1405
1437
|
} catch {
|
|
1406
1438
|
return false;
|
|
@@ -1432,7 +1464,11 @@ function detectLlm(env = process.env) {
|
|
|
1432
1464
|
}
|
|
1433
1465
|
function onPath(bin) {
|
|
1434
1466
|
try {
|
|
1435
|
-
execFileSync2("which", [bin], {
|
|
1467
|
+
execFileSync2("which", [bin], {
|
|
1468
|
+
stdio: "pipe",
|
|
1469
|
+
timeout: 5e3,
|
|
1470
|
+
windowsHide: true
|
|
1471
|
+
});
|
|
1436
1472
|
return true;
|
|
1437
1473
|
} catch {
|
|
1438
1474
|
return false;
|
|
@@ -1443,7 +1479,8 @@ function startDaemonDetached(cfg, harness, spawnFn = realSpawn2) {
|
|
|
1443
1479
|
const starter = join6(dirname5(fileURLToPath2(import.meta.url)), "daemon-start.js");
|
|
1444
1480
|
const child = spawnFn("node", [starter, "--harness", harness], {
|
|
1445
1481
|
detached: true,
|
|
1446
|
-
stdio: "ignore"
|
|
1482
|
+
stdio: "ignore",
|
|
1483
|
+
windowsHide: true
|
|
1447
1484
|
});
|
|
1448
1485
|
child.on("error", () => {
|
|
1449
1486
|
});
|
package/dist/daemon-start.js
CHANGED
|
@@ -592,7 +592,11 @@ async function isServerHealthy(baseUrl, timeoutMs = 2e3) {
|
|
|
592
592
|
function hasRustToolchain() {
|
|
593
593
|
if (process.platform !== "darwin") return true;
|
|
594
594
|
try {
|
|
595
|
-
execFileSync2("cargo", ["--version"], {
|
|
595
|
+
execFileSync2("cargo", ["--version"], {
|
|
596
|
+
stdio: "pipe",
|
|
597
|
+
timeout: 1e4,
|
|
598
|
+
windowsHide: true
|
|
599
|
+
});
|
|
596
600
|
return true;
|
|
597
601
|
} catch {
|
|
598
602
|
return false;
|
|
@@ -600,7 +604,11 @@ function hasRustToolchain() {
|
|
|
600
604
|
}
|
|
601
605
|
function hasUvx() {
|
|
602
606
|
try {
|
|
603
|
-
execFileSync2("uvx", ["--version"], {
|
|
607
|
+
execFileSync2("uvx", ["--version"], {
|
|
608
|
+
stdio: "pipe",
|
|
609
|
+
timeout: 1e4,
|
|
610
|
+
windowsHide: true
|
|
611
|
+
});
|
|
604
612
|
return true;
|
|
605
613
|
} catch {
|
|
606
614
|
return false;
|
|
@@ -632,7 +640,11 @@ function detectLlm(env = process.env) {
|
|
|
632
640
|
}
|
|
633
641
|
function onPath(bin) {
|
|
634
642
|
try {
|
|
635
|
-
execFileSync2("which", [bin], {
|
|
643
|
+
execFileSync2("which", [bin], {
|
|
644
|
+
stdio: "pipe",
|
|
645
|
+
timeout: 5e3,
|
|
646
|
+
windowsHide: true
|
|
647
|
+
});
|
|
636
648
|
return true;
|
|
637
649
|
} catch {
|
|
638
650
|
return false;
|
package/dist/deepen.js
CHANGED
|
@@ -36,14 +36,36 @@ function getProjectRootFromGit(directory) {
|
|
|
36
36
|
const commonDir = execFileSync(
|
|
37
37
|
"git",
|
|
38
38
|
["rev-parse", "--path-format=absolute", "--git-common-dir"],
|
|
39
|
-
{
|
|
39
|
+
{
|
|
40
|
+
cwd: directory,
|
|
41
|
+
encoding: "utf-8",
|
|
42
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
43
|
+
timeout: 1e3,
|
|
44
|
+
windowsHide: true
|
|
45
|
+
}
|
|
40
46
|
).trim();
|
|
41
47
|
if (!commonDir) return null;
|
|
42
|
-
|
|
48
|
+
if (basename(commonDir) === ".git") return dirname(commonDir);
|
|
49
|
+
if (basename(commonDir).startsWith(".") && isBareRepository(commonDir)) {
|
|
50
|
+
return dirname(commonDir);
|
|
51
|
+
}
|
|
52
|
+
return commonDir;
|
|
43
53
|
} catch {
|
|
44
54
|
return null;
|
|
45
55
|
}
|
|
46
56
|
}
|
|
57
|
+
function isBareRepository(commonDir) {
|
|
58
|
+
try {
|
|
59
|
+
return execFileSync("git", ["-C", commonDir, "rev-parse", "--is-bare-repository"], {
|
|
60
|
+
encoding: "utf-8",
|
|
61
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
62
|
+
timeout: 1e3,
|
|
63
|
+
env: { ...process.env, GIT_DIR: void 0, GIT_WORK_TREE: void 0 }
|
|
64
|
+
}).trim() === "true";
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
47
69
|
function projectNameOf(directory, sessionRoot) {
|
|
48
70
|
return gitProjectName(directory, true, sessionRoot);
|
|
49
71
|
}
|
|
@@ -759,14 +781,16 @@ var HindsightClient = class {
|
|
|
759
781
|
return;
|
|
760
782
|
}
|
|
761
783
|
if (r.status !== 409) created++;
|
|
762
|
-
} else
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
784
|
+
} else {
|
|
785
|
+
const sourceDrift = hit.description !== page.source_query;
|
|
786
|
+
const triggerDrift = hit.trigger != null && hit.trigger.tags_match !== pageTrigger.tags_match;
|
|
787
|
+
if (!sourceDrift && !triggerDrift) continue;
|
|
788
|
+
const patch = {};
|
|
789
|
+
if (sourceDrift) {
|
|
767
790
|
patch.source_query = page.source_query;
|
|
768
791
|
patch.tags = page.tags;
|
|
769
792
|
}
|
|
793
|
+
if (triggerDrift) patch.trigger = pageTrigger;
|
|
770
794
|
const r = await this.req(
|
|
771
795
|
"PATCH",
|
|
772
796
|
this.bankUrl(`/knowledge-base/nodes/${encodeURIComponent(hit.id)}`),
|
|
@@ -1215,7 +1239,11 @@ import { resolve } from "path";
|
|
|
1215
1239
|
var US = "";
|
|
1216
1240
|
var RS = "";
|
|
1217
1241
|
function git(repo, ...args) {
|
|
1218
|
-
return execFileSync2("git", ["-C", repo, ...args], {
|
|
1242
|
+
return execFileSync2("git", ["-C", repo, ...args], {
|
|
1243
|
+
encoding: "utf8",
|
|
1244
|
+
maxBuffer: 1 << 28,
|
|
1245
|
+
windowsHide: true
|
|
1246
|
+
});
|
|
1219
1247
|
}
|
|
1220
1248
|
function repoNameOf(repo) {
|
|
1221
1249
|
return projectNameOf(resolve(repo));
|
|
@@ -1646,7 +1674,7 @@ async function main() {
|
|
|
1646
1674
|
const shas = execFileSync4(
|
|
1647
1675
|
"git",
|
|
1648
1676
|
["-C", REPO, "rev-list", `-n`, String(DEEPEN_DIFF_TARGET), "HEAD"],
|
|
1649
|
-
{ encoding: "utf8" }
|
|
1677
|
+
{ encoding: "utf8", windowsHide: true }
|
|
1650
1678
|
).trim().split("\n").filter(Boolean).filter((sha) => !gitIds.has(`git:${sha}`)).slice(0, DIFF_BATCH);
|
|
1651
1679
|
if (shas.length) {
|
|
1652
1680
|
const repoName = repoNameOf(REPO);
|
package/dist/devin-hook.js
CHANGED
|
@@ -33,14 +33,36 @@ function getProjectRootFromGit(directory) {
|
|
|
33
33
|
const commonDir = execFileSync(
|
|
34
34
|
"git",
|
|
35
35
|
["rev-parse", "--path-format=absolute", "--git-common-dir"],
|
|
36
|
-
{
|
|
36
|
+
{
|
|
37
|
+
cwd: directory,
|
|
38
|
+
encoding: "utf-8",
|
|
39
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
40
|
+
timeout: 1e3,
|
|
41
|
+
windowsHide: true
|
|
42
|
+
}
|
|
37
43
|
).trim();
|
|
38
44
|
if (!commonDir) return null;
|
|
39
|
-
|
|
45
|
+
if (basename(commonDir) === ".git") return dirname(commonDir);
|
|
46
|
+
if (basename(commonDir).startsWith(".") && isBareRepository(commonDir)) {
|
|
47
|
+
return dirname(commonDir);
|
|
48
|
+
}
|
|
49
|
+
return commonDir;
|
|
40
50
|
} catch {
|
|
41
51
|
return null;
|
|
42
52
|
}
|
|
43
53
|
}
|
|
54
|
+
function isBareRepository(commonDir) {
|
|
55
|
+
try {
|
|
56
|
+
return execFileSync("git", ["-C", commonDir, "rev-parse", "--is-bare-repository"], {
|
|
57
|
+
encoding: "utf-8",
|
|
58
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
59
|
+
timeout: 1e3,
|
|
60
|
+
env: { ...process.env, GIT_DIR: void 0, GIT_WORK_TREE: void 0 }
|
|
61
|
+
}).trim() === "true";
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
44
66
|
var PROJECT_ROOT_ENV = ["CLAUDE_PROJECT_DIR"];
|
|
45
67
|
function nearestExistingDir(directory) {
|
|
46
68
|
let current2 = directory;
|
|
@@ -157,7 +179,8 @@ function startBackgroundSeed(repoDir, opts = {}) {
|
|
|
157
179
|
],
|
|
158
180
|
{
|
|
159
181
|
detached: true,
|
|
160
|
-
stdio: "ignore"
|
|
182
|
+
stdio: "ignore",
|
|
183
|
+
windowsHide: true
|
|
161
184
|
}
|
|
162
185
|
);
|
|
163
186
|
child.on("error", () => {
|
|
@@ -837,14 +860,16 @@ var HindsightClient = class {
|
|
|
837
860
|
return;
|
|
838
861
|
}
|
|
839
862
|
if (r.status !== 409) created++;
|
|
840
|
-
} else
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
863
|
+
} else {
|
|
864
|
+
const sourceDrift = hit.description !== page.source_query;
|
|
865
|
+
const triggerDrift = hit.trigger != null && hit.trigger.tags_match !== pageTrigger.tags_match;
|
|
866
|
+
if (!sourceDrift && !triggerDrift) continue;
|
|
867
|
+
const patch = {};
|
|
868
|
+
if (sourceDrift) {
|
|
845
869
|
patch.source_query = page.source_query;
|
|
846
870
|
patch.tags = page.tags;
|
|
847
871
|
}
|
|
872
|
+
if (triggerDrift) patch.trigger = pageTrigger;
|
|
848
873
|
const r = await this.req(
|
|
849
874
|
"PATCH",
|
|
850
875
|
this.bankUrl(`/knowledge-base/nodes/${encodeURIComponent(hit.id)}`),
|
|
@@ -1245,9 +1270,9 @@ var TOOL_GUIDE = `- hindsight_search_knowledge_pages(query) \u2014 FIRST STOP fo
|
|
|
1245
1270
|
- hindsight_reflect(query) \u2014 when pages are too shallow and you need the WHY: deep reasoning over the repo's full memory for the past decision and exact values that explain a behavior or bug (slower \u2014 use deliberately, and credit results with a blockquote header "> \u{1F9E0} **From Hindsight memory** \u2014 <summary>").
|
|
1246
1271
|
- hindsight_capture_initiative(title, summary) \u2014 right after the user approves a plan or finishes brainstorming a new feature/capability and you are about to start implementing (BEFORE you write any code), call this to record it as a tracked page; then call it AGAIN with relates_to_page_id set to that page whenever the goal, scope, or rationale materially changes mid-work, so the page tracks the current plan and not the opening one. Skip bug fixes, small tweaks, chores, and trivial course-corrections.
|
|
1247
1272
|
- hindsight_ingest_document(title, content) \u2014 save an external document or durable notes/findings you want remembered (not the current conversation \u2014 that is captured automatically at session end).`;
|
|
1248
|
-
var
|
|
1273
|
+
var PAGES_FIRST_ON_GOALS = "- The user just set a NEW task or goal \u2192 search the knowledge pages FIRST with hindsight_search_knowledge_pages. No synthesis is injected automatically in this configuration; call hindsight_reflect only when those pages are too shallow and deeper reasoning is needed.\n";
|
|
1249
1274
|
function toolGuide(opts) {
|
|
1250
|
-
return (opts?.reflectOnNewGoals ?
|
|
1275
|
+
return (opts?.reflectOnNewGoals ? PAGES_FIRST_ON_GOALS : "") + TOOL_GUIDE;
|
|
1251
1276
|
}
|
|
1252
1277
|
function buildRosterRefresh(pages, opts) {
|
|
1253
1278
|
const rosterBlock = pages.length ? `Current Hindsight knowledge pages (may have changed):
|
|
@@ -33,14 +33,36 @@ function getProjectRootFromGit(directory) {
|
|
|
33
33
|
const commonDir = execFileSync(
|
|
34
34
|
"git",
|
|
35
35
|
["rev-parse", "--path-format=absolute", "--git-common-dir"],
|
|
36
|
-
{
|
|
36
|
+
{
|
|
37
|
+
cwd: directory,
|
|
38
|
+
encoding: "utf-8",
|
|
39
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
40
|
+
timeout: 1e3,
|
|
41
|
+
windowsHide: true
|
|
42
|
+
}
|
|
37
43
|
).trim();
|
|
38
44
|
if (!commonDir) return null;
|
|
39
|
-
|
|
45
|
+
if (basename(commonDir) === ".git") return dirname(commonDir);
|
|
46
|
+
if (basename(commonDir).startsWith(".") && isBareRepository(commonDir)) {
|
|
47
|
+
return dirname(commonDir);
|
|
48
|
+
}
|
|
49
|
+
return commonDir;
|
|
40
50
|
} catch {
|
|
41
51
|
return null;
|
|
42
52
|
}
|
|
43
53
|
}
|
|
54
|
+
function isBareRepository(commonDir) {
|
|
55
|
+
try {
|
|
56
|
+
return execFileSync("git", ["-C", commonDir, "rev-parse", "--is-bare-repository"], {
|
|
57
|
+
encoding: "utf-8",
|
|
58
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
59
|
+
timeout: 1e3,
|
|
60
|
+
env: { ...process.env, GIT_DIR: void 0, GIT_WORK_TREE: void 0 }
|
|
61
|
+
}).trim() === "true";
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
44
66
|
function projectNameOf(directory, sessionRoot) {
|
|
45
67
|
return gitProjectName(directory, true, sessionRoot);
|
|
46
68
|
}
|
|
@@ -160,7 +182,8 @@ function startBackgroundSeed(repoDir, opts = {}) {
|
|
|
160
182
|
],
|
|
161
183
|
{
|
|
162
184
|
detached: true,
|
|
163
|
-
stdio: "ignore"
|
|
185
|
+
stdio: "ignore",
|
|
186
|
+
windowsHide: true
|
|
164
187
|
}
|
|
165
188
|
);
|
|
166
189
|
child.on("error", () => {
|
|
@@ -826,14 +849,16 @@ var HindsightClient = class {
|
|
|
826
849
|
return;
|
|
827
850
|
}
|
|
828
851
|
if (r.status !== 409) created++;
|
|
829
|
-
} else
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
852
|
+
} else {
|
|
853
|
+
const sourceDrift = hit.description !== page.source_query;
|
|
854
|
+
const triggerDrift = hit.trigger != null && hit.trigger.tags_match !== pageTrigger.tags_match;
|
|
855
|
+
if (!sourceDrift && !triggerDrift) continue;
|
|
856
|
+
const patch = {};
|
|
857
|
+
if (sourceDrift) {
|
|
834
858
|
patch.source_query = page.source_query;
|
|
835
859
|
patch.tags = page.tags;
|
|
836
860
|
}
|
|
861
|
+
if (triggerDrift) patch.trigger = pageTrigger;
|
|
837
862
|
const r = await this.req(
|
|
838
863
|
"PATCH",
|
|
839
864
|
this.bankUrl(`/knowledge-base/nodes/${encodeURIComponent(hit.id)}`),
|
|
@@ -1205,9 +1230,9 @@ var TOOL_GUIDE = `- hindsight_search_knowledge_pages(query) \u2014 FIRST STOP fo
|
|
|
1205
1230
|
- hindsight_reflect(query) \u2014 when pages are too shallow and you need the WHY: deep reasoning over the repo's full memory for the past decision and exact values that explain a behavior or bug (slower \u2014 use deliberately, and credit results with a blockquote header "> \u{1F9E0} **From Hindsight memory** \u2014 <summary>").
|
|
1206
1231
|
- hindsight_capture_initiative(title, summary) \u2014 right after the user approves a plan or finishes brainstorming a new feature/capability and you are about to start implementing (BEFORE you write any code), call this to record it as a tracked page; then call it AGAIN with relates_to_page_id set to that page whenever the goal, scope, or rationale materially changes mid-work, so the page tracks the current plan and not the opening one. Skip bug fixes, small tweaks, chores, and trivial course-corrections.
|
|
1207
1232
|
- hindsight_ingest_document(title, content) \u2014 save an external document or durable notes/findings you want remembered (not the current conversation \u2014 that is captured automatically at session end).`;
|
|
1208
|
-
var
|
|
1233
|
+
var PAGES_FIRST_ON_GOALS = "- The user just set a NEW task or goal \u2192 search the knowledge pages FIRST with hindsight_search_knowledge_pages. No synthesis is injected automatically in this configuration; call hindsight_reflect only when those pages are too shallow and deeper reasoning is needed.\n";
|
|
1209
1234
|
function toolGuide(opts) {
|
|
1210
|
-
return (opts?.reflectOnNewGoals ?
|
|
1235
|
+
return (opts?.reflectOnNewGoals ? PAGES_FIRST_ON_GOALS : "") + TOOL_GUIDE;
|
|
1211
1236
|
}
|
|
1212
1237
|
function buildKnowledgePreamble(pages, opts) {
|
|
1213
1238
|
const body = pages.length ? `Knowledge pages currently in this repository:
|
|
@@ -1291,7 +1316,11 @@ async function isServerHealthy(baseUrl, timeoutMs = 2e3) {
|
|
|
1291
1316
|
function hasRustToolchain() {
|
|
1292
1317
|
if (process.platform !== "darwin") return true;
|
|
1293
1318
|
try {
|
|
1294
|
-
execFileSync2("cargo", ["--version"], {
|
|
1319
|
+
execFileSync2("cargo", ["--version"], {
|
|
1320
|
+
stdio: "pipe",
|
|
1321
|
+
timeout: 1e4,
|
|
1322
|
+
windowsHide: true
|
|
1323
|
+
});
|
|
1295
1324
|
return true;
|
|
1296
1325
|
} catch {
|
|
1297
1326
|
return false;
|
|
@@ -1299,7 +1328,11 @@ function hasRustToolchain() {
|
|
|
1299
1328
|
}
|
|
1300
1329
|
function hasUvx() {
|
|
1301
1330
|
try {
|
|
1302
|
-
execFileSync2("uvx", ["--version"], {
|
|
1331
|
+
execFileSync2("uvx", ["--version"], {
|
|
1332
|
+
stdio: "pipe",
|
|
1333
|
+
timeout: 1e4,
|
|
1334
|
+
windowsHide: true
|
|
1335
|
+
});
|
|
1303
1336
|
return true;
|
|
1304
1337
|
} catch {
|
|
1305
1338
|
return false;
|
|
@@ -1331,7 +1364,11 @@ function detectLlm(env = process.env) {
|
|
|
1331
1364
|
}
|
|
1332
1365
|
function onPath(bin) {
|
|
1333
1366
|
try {
|
|
1334
|
-
execFileSync2("which", [bin], {
|
|
1367
|
+
execFileSync2("which", [bin], {
|
|
1368
|
+
stdio: "pipe",
|
|
1369
|
+
timeout: 5e3,
|
|
1370
|
+
windowsHide: true
|
|
1371
|
+
});
|
|
1335
1372
|
return true;
|
|
1336
1373
|
} catch {
|
|
1337
1374
|
return false;
|
|
@@ -1342,7 +1379,8 @@ function startDaemonDetached(cfg, harness, spawnFn = realSpawn2) {
|
|
|
1342
1379
|
const starter = join6(dirname5(fileURLToPath2(import.meta.url)), "daemon-start.js");
|
|
1343
1380
|
const child = spawnFn("node", [starter, "--harness", harness], {
|
|
1344
1381
|
detached: true,
|
|
1345
|
-
stdio: "ignore"
|
|
1382
|
+
stdio: "ignore",
|
|
1383
|
+
windowsHide: true
|
|
1346
1384
|
});
|
|
1347
1385
|
child.on("error", () => {
|
|
1348
1386
|
});
|
|
@@ -1541,7 +1579,11 @@ import { readFileSync as readFileSync6 } from "fs";
|
|
|
1541
1579
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
1542
1580
|
import { resolve } from "path";
|
|
1543
1581
|
function git(repo, ...args) {
|
|
1544
|
-
return execFileSync3("git", ["-C", repo, ...args], {
|
|
1582
|
+
return execFileSync3("git", ["-C", repo, ...args], {
|
|
1583
|
+
encoding: "utf8",
|
|
1584
|
+
maxBuffer: 1 << 28,
|
|
1585
|
+
windowsHide: true
|
|
1586
|
+
});
|
|
1545
1587
|
}
|
|
1546
1588
|
function gitHeadSha(dir) {
|
|
1547
1589
|
try {
|
|
@@ -1752,6 +1794,7 @@ function startCodebaseSurvey(repoDir, opts = {}) {
|
|
|
1752
1794
|
cwd: repoDir,
|
|
1753
1795
|
detached: true,
|
|
1754
1796
|
stdio: "ignore",
|
|
1797
|
+
windowsHide: true,
|
|
1755
1798
|
env: plan.env
|
|
1756
1799
|
});
|
|
1757
1800
|
child.on("error", () => {
|
|
@@ -1818,7 +1861,10 @@ async function gitSyncNote(args) {
|
|
|
1818
1861
|
try {
|
|
1819
1862
|
const { execFileSync: execFileSync5 } = await import("child_process");
|
|
1820
1863
|
const n = Number(
|
|
1821
|
-
execFileSync5("git", ["-C", cwd, "rev-list", "--count", "HEAD"], {
|
|
1864
|
+
execFileSync5("git", ["-C", cwd, "rev-list", "--count", "HEAD"], {
|
|
1865
|
+
encoding: "utf8",
|
|
1866
|
+
windowsHide: true
|
|
1867
|
+
}).trim()
|
|
1822
1868
|
);
|
|
1823
1869
|
if (n > 0) target = Math.min(DEEPEN_DIFF_TARGET, n);
|
|
1824
1870
|
} catch {
|
package/dist/devin-stop-hook.js
CHANGED
|
@@ -33,14 +33,36 @@ function getProjectRootFromGit(directory) {
|
|
|
33
33
|
const commonDir = execFileSync(
|
|
34
34
|
"git",
|
|
35
35
|
["rev-parse", "--path-format=absolute", "--git-common-dir"],
|
|
36
|
-
{
|
|
36
|
+
{
|
|
37
|
+
cwd: directory,
|
|
38
|
+
encoding: "utf-8",
|
|
39
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
40
|
+
timeout: 1e3,
|
|
41
|
+
windowsHide: true
|
|
42
|
+
}
|
|
37
43
|
).trim();
|
|
38
44
|
if (!commonDir) return null;
|
|
39
|
-
|
|
45
|
+
if (basename(commonDir) === ".git") return dirname(commonDir);
|
|
46
|
+
if (basename(commonDir).startsWith(".") && isBareRepository(commonDir)) {
|
|
47
|
+
return dirname(commonDir);
|
|
48
|
+
}
|
|
49
|
+
return commonDir;
|
|
40
50
|
} catch {
|
|
41
51
|
return null;
|
|
42
52
|
}
|
|
43
53
|
}
|
|
54
|
+
function isBareRepository(commonDir) {
|
|
55
|
+
try {
|
|
56
|
+
return execFileSync("git", ["-C", commonDir, "rev-parse", "--is-bare-repository"], {
|
|
57
|
+
encoding: "utf-8",
|
|
58
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
59
|
+
timeout: 1e3,
|
|
60
|
+
env: { ...process.env, GIT_DIR: void 0, GIT_WORK_TREE: void 0 }
|
|
61
|
+
}).trim() === "true";
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
44
66
|
function projectNameOf(directory, sessionRoot) {
|
|
45
67
|
return gitProjectName(directory, true, sessionRoot);
|
|
46
68
|
}
|
|
@@ -814,14 +836,16 @@ var HindsightClient = class {
|
|
|
814
836
|
return;
|
|
815
837
|
}
|
|
816
838
|
if (r.status !== 409) created++;
|
|
817
|
-
} else
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
839
|
+
} else {
|
|
840
|
+
const sourceDrift = hit.description !== page.source_query;
|
|
841
|
+
const triggerDrift = hit.trigger != null && hit.trigger.tags_match !== pageTrigger.tags_match;
|
|
842
|
+
if (!sourceDrift && !triggerDrift) continue;
|
|
843
|
+
const patch = {};
|
|
844
|
+
if (sourceDrift) {
|
|
822
845
|
patch.source_query = page.source_query;
|
|
823
846
|
patch.tags = page.tags;
|
|
824
847
|
}
|
|
848
|
+
if (triggerDrift) patch.trigger = pageTrigger;
|
|
825
849
|
const r = await this.req(
|
|
826
850
|
"PATCH",
|
|
827
851
|
this.bankUrl(`/knowledge-base/nodes/${encodeURIComponent(hit.id)}`),
|
|
@@ -1392,7 +1416,11 @@ async function isServerHealthy(baseUrl, timeoutMs = 2e3) {
|
|
|
1392
1416
|
function hasRustToolchain() {
|
|
1393
1417
|
if (process.platform !== "darwin") return true;
|
|
1394
1418
|
try {
|
|
1395
|
-
execFileSync2("cargo", ["--version"], {
|
|
1419
|
+
execFileSync2("cargo", ["--version"], {
|
|
1420
|
+
stdio: "pipe",
|
|
1421
|
+
timeout: 1e4,
|
|
1422
|
+
windowsHide: true
|
|
1423
|
+
});
|
|
1396
1424
|
return true;
|
|
1397
1425
|
} catch {
|
|
1398
1426
|
return false;
|
|
@@ -1400,7 +1428,11 @@ function hasRustToolchain() {
|
|
|
1400
1428
|
}
|
|
1401
1429
|
function hasUvx() {
|
|
1402
1430
|
try {
|
|
1403
|
-
execFileSync2("uvx", ["--version"], {
|
|
1431
|
+
execFileSync2("uvx", ["--version"], {
|
|
1432
|
+
stdio: "pipe",
|
|
1433
|
+
timeout: 1e4,
|
|
1434
|
+
windowsHide: true
|
|
1435
|
+
});
|
|
1404
1436
|
return true;
|
|
1405
1437
|
} catch {
|
|
1406
1438
|
return false;
|
|
@@ -1432,7 +1464,11 @@ function detectLlm(env = process.env) {
|
|
|
1432
1464
|
}
|
|
1433
1465
|
function onPath(bin) {
|
|
1434
1466
|
try {
|
|
1435
|
-
execFileSync2("which", [bin], {
|
|
1467
|
+
execFileSync2("which", [bin], {
|
|
1468
|
+
stdio: "pipe",
|
|
1469
|
+
timeout: 5e3,
|
|
1470
|
+
windowsHide: true
|
|
1471
|
+
});
|
|
1436
1472
|
return true;
|
|
1437
1473
|
} catch {
|
|
1438
1474
|
return false;
|
|
@@ -1443,7 +1479,8 @@ function startDaemonDetached(cfg, harness, spawnFn = realSpawn2) {
|
|
|
1443
1479
|
const starter = join6(dirname5(fileURLToPath2(import.meta.url)), "daemon-start.js");
|
|
1444
1480
|
const child = spawnFn("node", [starter, "--harness", harness], {
|
|
1445
1481
|
detached: true,
|
|
1446
|
-
stdio: "ignore"
|
|
1482
|
+
stdio: "ignore",
|
|
1483
|
+
windowsHide: true
|
|
1447
1484
|
});
|
|
1448
1485
|
child.on("error", () => {
|
|
1449
1486
|
});
|