@vectorize-io/hindsight-coding-agents 0.4.1 → 0.4.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.
@@ -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
- { cwd: directory, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], timeout: 1e3 }
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
- return basename(commonDir) === ".git" ? dirname(commonDir) : commonDir;
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 if (hit.description !== page.source_query || hit.trigger?.tags_match !== pageTrigger.tags_match) {
830
- const patch = {
831
- trigger: pageTrigger
832
- };
833
- if (hit.description !== page.source_query) {
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 REFLECT_ON_GOALS = "- The user just set a NEW task or goal \u2192 call hindsight_reflect with that goal FIRST, before planning: no memory is injected automatically in this configuration, so this call is the only way past decisions, constraints, and failed attempts relevant to the goal reach you.\n";
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 ? REFLECT_ON_GOALS : "") + TOOL_GUIDE;
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"], { stdio: "pipe", timeout: 1e4 });
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"], { stdio: "pipe", timeout: 1e4 });
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], { stdio: "pipe", timeout: 5e3 });
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], { encoding: "utf8", maxBuffer: 1 << 28 });
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"], { encoding: "utf8" }).trim()
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 {
@@ -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
- { cwd: directory, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], timeout: 1e3 }
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
- return basename(commonDir) === ".git" ? dirname(commonDir) : commonDir;
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 if (hit.description !== page.source_query || hit.trigger?.tags_match !== pageTrigger.tags_match) {
818
- const patch = {
819
- trigger: pageTrigger
820
- };
821
- if (hit.description !== page.source_query) {
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"], { stdio: "pipe", timeout: 1e4 });
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"], { stdio: "pipe", timeout: 1e4 });
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], { stdio: "pipe", timeout: 5e3 });
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
  });
@@ -27,7 +27,8 @@ function startBackgroundSeed(repoDir, opts = {}) {
27
27
  ],
28
28
  {
29
29
  detached: true,
30
- stdio: "ignore"
30
+ stdio: "ignore",
31
+ windowsHide: true
31
32
  }
32
33
  );
33
34
  child.on("error", () => {
@@ -77,14 +78,36 @@ function getProjectRootFromGit(directory) {
77
78
  const commonDir = execFileSync(
78
79
  "git",
79
80
  ["rev-parse", "--path-format=absolute", "--git-common-dir"],
80
- { cwd: directory, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], timeout: 1e3 }
81
+ {
82
+ cwd: directory,
83
+ encoding: "utf-8",
84
+ stdio: ["ignore", "pipe", "ignore"],
85
+ timeout: 1e3,
86
+ windowsHide: true
87
+ }
81
88
  ).trim();
82
89
  if (!commonDir) return null;
83
- return basename(commonDir) === ".git" ? dirname2(commonDir) : commonDir;
90
+ if (basename(commonDir) === ".git") return dirname2(commonDir);
91
+ if (basename(commonDir).startsWith(".") && isBareRepository(commonDir)) {
92
+ return dirname2(commonDir);
93
+ }
94
+ return commonDir;
84
95
  } catch {
85
96
  return null;
86
97
  }
87
98
  }
99
+ function isBareRepository(commonDir) {
100
+ try {
101
+ return execFileSync("git", ["-C", commonDir, "rev-parse", "--is-bare-repository"], {
102
+ encoding: "utf-8",
103
+ stdio: ["ignore", "pipe", "ignore"],
104
+ timeout: 1e3,
105
+ env: { ...process.env, GIT_DIR: void 0, GIT_WORK_TREE: void 0 }
106
+ }).trim() === "true";
107
+ } catch {
108
+ return false;
109
+ }
110
+ }
88
111
  var PROJECT_ROOT_ENV = ["CLAUDE_PROJECT_DIR"];
89
112
  function nearestExistingDir(directory) {
90
113
  let current2 = directory;
package/dist/index.js CHANGED
@@ -34,7 +34,8 @@ function startBackgroundSeed(repoDir, opts = {}) {
34
34
  ],
35
35
  {
36
36
  detached: true,
37
- stdio: "ignore"
37
+ stdio: "ignore",
38
+ windowsHide: true
38
39
  }
39
40
  );
40
41
  child.on("error", () => {
@@ -74,14 +75,36 @@ function getProjectRootFromGit(directory) {
74
75
  const commonDir = execFileSync(
75
76
  "git",
76
77
  ["rev-parse", "--path-format=absolute", "--git-common-dir"],
77
- { cwd: directory, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], timeout: 1e3 }
78
+ {
79
+ cwd: directory,
80
+ encoding: "utf-8",
81
+ stdio: ["ignore", "pipe", "ignore"],
82
+ timeout: 1e3,
83
+ windowsHide: true
84
+ }
78
85
  ).trim();
79
86
  if (!commonDir) return null;
80
- return basename(commonDir) === ".git" ? dirname2(commonDir) : commonDir;
87
+ if (basename(commonDir) === ".git") return dirname2(commonDir);
88
+ if (basename(commonDir).startsWith(".") && isBareRepository(commonDir)) {
89
+ return dirname2(commonDir);
90
+ }
91
+ return commonDir;
81
92
  } catch {
82
93
  return null;
83
94
  }
84
95
  }
96
+ function isBareRepository(commonDir) {
97
+ try {
98
+ return execFileSync("git", ["-C", commonDir, "rev-parse", "--is-bare-repository"], {
99
+ encoding: "utf-8",
100
+ stdio: ["ignore", "pipe", "ignore"],
101
+ timeout: 1e3,
102
+ env: { ...process.env, GIT_DIR: void 0, GIT_WORK_TREE: void 0 }
103
+ }).trim() === "true";
104
+ } catch {
105
+ return false;
106
+ }
107
+ }
85
108
  function projectNameOf(directory, sessionRoot) {
86
109
  return gitProjectName(directory, true, sessionRoot);
87
110
  }
@@ -844,14 +867,16 @@ var HindsightClient = class {
844
867
  return;
845
868
  }
846
869
  if (r.status !== 409) created++;
847
- } else if (hit.description !== page.source_query || hit.trigger?.tags_match !== pageTrigger.tags_match) {
848
- const patch = {
849
- trigger: pageTrigger
850
- };
851
- if (hit.description !== page.source_query) {
870
+ } else {
871
+ const sourceDrift = hit.description !== page.source_query;
872
+ const triggerDrift = hit.trigger != null && hit.trigger.tags_match !== pageTrigger.tags_match;
873
+ if (!sourceDrift && !triggerDrift) continue;
874
+ const patch = {};
875
+ if (sourceDrift) {
852
876
  patch.source_query = page.source_query;
853
877
  patch.tags = page.tags;
854
878
  }
879
+ if (triggerDrift) patch.trigger = pageTrigger;
855
880
  const r = await this.req(
856
881
  "PATCH",
857
882
  this.bankUrl(`/knowledge-base/nodes/${encodeURIComponent(hit.id)}`),
@@ -1234,7 +1259,11 @@ async function isServerHealthy(baseUrl, timeoutMs = 2e3) {
1234
1259
  function hasRustToolchain() {
1235
1260
  if (process.platform !== "darwin") return true;
1236
1261
  try {
1237
- execFileSync2("cargo", ["--version"], { stdio: "pipe", timeout: 1e4 });
1262
+ execFileSync2("cargo", ["--version"], {
1263
+ stdio: "pipe",
1264
+ timeout: 1e4,
1265
+ windowsHide: true
1266
+ });
1238
1267
  return true;
1239
1268
  } catch {
1240
1269
  return false;
@@ -1242,7 +1271,11 @@ function hasRustToolchain() {
1242
1271
  }
1243
1272
  function hasUvx() {
1244
1273
  try {
1245
- execFileSync2("uvx", ["--version"], { stdio: "pipe", timeout: 1e4 });
1274
+ execFileSync2("uvx", ["--version"], {
1275
+ stdio: "pipe",
1276
+ timeout: 1e4,
1277
+ windowsHide: true
1278
+ });
1246
1279
  return true;
1247
1280
  } catch {
1248
1281
  return false;
@@ -1274,7 +1307,11 @@ function detectLlm(env = process.env) {
1274
1307
  }
1275
1308
  function onPath(bin) {
1276
1309
  try {
1277
- execFileSync2("which", [bin], { stdio: "pipe", timeout: 5e3 });
1310
+ execFileSync2("which", [bin], {
1311
+ stdio: "pipe",
1312
+ timeout: 5e3,
1313
+ windowsHide: true
1314
+ });
1278
1315
  return true;
1279
1316
  } catch {
1280
1317
  return false;
@@ -1285,7 +1322,8 @@ function startDaemonDetached(cfg, harness, spawnFn = realSpawn2) {
1285
1322
  const starter = join5(dirname4(fileURLToPath2(import.meta.url)), "daemon-start.js");
1286
1323
  const child = spawnFn("node", [starter, "--harness", harness], {
1287
1324
  detached: true,
1288
- stdio: "ignore"
1325
+ stdio: "ignore",
1326
+ windowsHide: true
1289
1327
  });
1290
1328
  child.on("error", () => {
1291
1329
  });
@@ -15860,7 +15898,11 @@ import { execFileSync as execFileSync4 } from "child_process";
15860
15898
  import { execFileSync as execFileSync3 } from "child_process";
15861
15899
  import { resolve } from "path";
15862
15900
  function git(repo, ...args) {
15863
- return execFileSync3("git", ["-C", repo, ...args], { encoding: "utf8", maxBuffer: 1 << 28 });
15901
+ return execFileSync3("git", ["-C", repo, ...args], {
15902
+ encoding: "utf8",
15903
+ maxBuffer: 1 << 28,
15904
+ windowsHide: true
15905
+ });
15864
15906
  }
15865
15907
  function repoNameOf(repo) {
15866
15908
  return projectNameOf(resolve(repo));
@@ -15908,9 +15950,9 @@ var TOOL_GUIDE = `- hindsight_search_knowledge_pages(query) \u2014 FIRST STOP fo
15908
15950
  - 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>").
15909
15951
  - 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.
15910
15952
  - 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).`;
15911
- var REFLECT_ON_GOALS = "- The user just set a NEW task or goal \u2192 call hindsight_reflect with that goal FIRST, before planning: no memory is injected automatically in this configuration, so this call is the only way past decisions, constraints, and failed attempts relevant to the goal reach you.\n";
15953
+ 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";
15912
15954
  function toolGuide(opts) {
15913
- return (opts?.reflectOnNewGoals ? REFLECT_ON_GOALS : "") + TOOL_GUIDE;
15955
+ return (opts?.reflectOnNewGoals ? PAGES_FIRST_ON_GOALS : "") + TOOL_GUIDE;
15914
15956
  }
15915
15957
  function buildKnowledgePreamble(pages, opts) {
15916
15958
  const body = pages.length ? `Knowledge pages currently in this repository:
@@ -16126,6 +16168,7 @@ function startCodebaseSurvey(repoDir, opts = {}) {
16126
16168
  cwd: repoDir,
16127
16169
  detached: true,
16128
16170
  stdio: "ignore",
16171
+ windowsHide: true,
16129
16172
  env: plan.env
16130
16173
  });
16131
16174
  child.on("error", () => {
@@ -16142,7 +16185,8 @@ var DEEPEN_DIFF_TARGET = 300;
16142
16185
  function commitCount(repoDir) {
16143
16186
  try {
16144
16187
  const out = execFileSync4("git", ["-C", repoDir, "rev-list", "--count", "HEAD"], {
16145
- encoding: "utf8"
16188
+ encoding: "utf8",
16189
+ windowsHide: true
16146
16190
  });
16147
16191
  return Number(out.trim()) || 0;
16148
16192
  } catch {
@@ -16651,7 +16695,10 @@ async function gitSyncNote(args) {
16651
16695
  try {
16652
16696
  const { execFileSync: execFileSync5 } = await import("child_process");
16653
16697
  const n = Number(
16654
- execFileSync5("git", ["-C", cwd, "rev-list", "--count", "HEAD"], { encoding: "utf8" }).trim()
16698
+ execFileSync5("git", ["-C", cwd, "rev-list", "--count", "HEAD"], {
16699
+ encoding: "utf8",
16700
+ windowsHide: true
16701
+ }).trim()
16655
16702
  );
16656
16703
  if (n > 0) target = Math.min(DEEPEN_DIFF_TARGET, n);
16657
16704
  } catch {
package/dist/installer.js CHANGED
@@ -127,7 +127,11 @@ import { fileURLToPath as fileURLToPath2 } from "url";
127
127
  function hasRustToolchain() {
128
128
  if (process.platform !== "darwin") return true;
129
129
  try {
130
- execFileSync2("cargo", ["--version"], { stdio: "pipe", timeout: 1e4 });
130
+ execFileSync2("cargo", ["--version"], {
131
+ stdio: "pipe",
132
+ timeout: 1e4,
133
+ windowsHide: true
134
+ });
131
135
  return true;
132
136
  } catch {
133
137
  return false;
@@ -135,7 +139,11 @@ function hasRustToolchain() {
135
139
  }
136
140
  function hasUvx() {
137
141
  try {
138
- execFileSync2("uvx", ["--version"], { stdio: "pipe", timeout: 1e4 });
142
+ execFileSync2("uvx", ["--version"], {
143
+ stdio: "pipe",
144
+ timeout: 1e4,
145
+ windowsHide: true
146
+ });
139
147
  return true;
140
148
  } catch {
141
149
  return false;
@@ -167,7 +175,11 @@ function detectLlm(env = process.env) {
167
175
  }
168
176
  function onPath(bin) {
169
177
  try {
170
- execFileSync2("which", [bin], { stdio: "pipe", timeout: 5e3 });
178
+ execFileSync2("which", [bin], {
179
+ stdio: "pipe",
180
+ timeout: 5e3,
181
+ windowsHide: true
182
+ });
171
183
  return true;
172
184
  } catch {
173
185
  return false;
@@ -985,7 +997,7 @@ function zstdDecompressFrames(buffer) {
985
997
 
986
998
  // src/core/history.ts
987
999
  function claudeProjectDir(repoDir, home = homedir7()) {
988
- return join11(home, ".claude", "projects", repoDir.replace(/[/.]/g, "-"));
1000
+ return join11(home, ".claude", "projects", repoDir.replace(/[^a-zA-Z0-9]/g, "-"));
989
1001
  }
990
1002
  function withinRepo(dir, repoDir) {
991
1003
  return !!dir && (dir === repoDir || dir.startsWith(repoDir.endsWith("/") ? repoDir : repoDir + "/"));
@@ -1026,15 +1038,21 @@ function firstLine(path, cap = 1e6) {
1026
1038
  closeSync2(fd);
1027
1039
  }
1028
1040
  }
1041
+ function listDir(dir) {
1042
+ try {
1043
+ return readdirSync2(dir);
1044
+ } catch {
1045
+ return [];
1046
+ }
1047
+ }
1029
1048
  function jsonlFiles(dir) {
1030
- if (!existsSync7(dir)) return [];
1031
- return readdirSync2(dir).filter((f) => f.endsWith(".jsonl")).map((f) => join11(dir, f));
1049
+ return listDir(dir).filter((f) => f.endsWith(".jsonl")).map((f) => join11(dir, f));
1032
1050
  }
1033
1051
  function claudeHistory(repoDir, home) {
1034
1052
  const root = join11(home, ".claude", "projects");
1035
1053
  const exact = claudeProjectDir(repoDir, home);
1036
1054
  const prefix = exact + "-";
1037
- const dirs = existsSync7(root) ? readdirSync2(root).map((d) => join11(root, d)).filter((d) => d === exact || d.startsWith(prefix)) : [];
1055
+ const dirs = listDir(root).map((d) => join11(root, d)).filter((d) => d === exact || d.startsWith(prefix));
1038
1056
  const sessions = [];
1039
1057
  let unattributed = 0;
1040
1058
  for (const file of dirs.flatMap(jsonlFiles)) {
@@ -1530,18 +1548,21 @@ var primeAgent = {
1530
1548
  const exts = Array.isArray(cfg.extensions) ? cfg.extensions : [];
1531
1549
  cfg.extensions = [...exts.filter((p) => !String(p).includes(MARKER)), entry];
1532
1550
  writeJson(path, cfg);
1551
+ installSkill(c, "prime-agent", join13(c.home, ".prime", "agent", "skills"));
1533
1552
  c.log?.(`prime-agent: extension registered in ${path}`);
1534
1553
  },
1535
1554
  uninstall(c) {
1536
1555
  const path = join13(c.home, ".prime", "agent", "settings.json");
1537
- if (!existsSync9(path)) return;
1538
- const cfg = readJson(path);
1539
- if (Array.isArray(cfg.extensions)) {
1540
- cfg.extensions = cfg.extensions.filter((p) => !String(p).includes(MARKER));
1541
- if (!cfg.extensions.length) delete cfg.extensions;
1542
- writeJson(path, cfg);
1556
+ if (existsSync9(path)) {
1557
+ const cfg = readJson(path);
1558
+ if (Array.isArray(cfg.extensions)) {
1559
+ cfg.extensions = cfg.extensions.filter((p) => !String(p).includes(MARKER));
1560
+ if (!cfg.extensions.length) delete cfg.extensions;
1561
+ writeJson(path, cfg);
1562
+ }
1543
1563
  }
1544
- c.log?.("prime-agent: extension entry removed");
1564
+ uninstallSkill(c, join13(c.home, ".prime", "agent", "skills"));
1565
+ c.log?.("prime-agent: extension entry + skill removed");
1545
1566
  }
1546
1567
  };
1547
1568
  var KILO_CONFIG_CANDIDATES = ["kilo.jsonc", "kilo.json", "opencode.json"];