pi-lens 4.4.1 → 4.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.
Files changed (140) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/config/dependency-cruiser-eager-allowlist.json +3 -1
  3. package/dist/{chunk-BJF25SUG.js → chunk-23WOO7TX.js} +11 -10
  4. package/dist/{chunk-WATC3IQR.js → chunk-2B73ZPOK.js} +3 -3
  5. package/dist/{chunk-N2IRDBZI.js → chunk-2BBLFX75.js} +101 -11
  6. package/dist/{chunk-TA5L5KWQ.js → chunk-2CD5RS6M.js} +2 -2
  7. package/dist/{chunk-3TTPKMEF.js → chunk-2VUQMUMT.js} +38 -37
  8. package/dist/{chunk-5JHXUETW.js → chunk-3EFKIGZN.js} +3 -3
  9. package/dist/chunk-3JNKMP3B.js +17 -0
  10. package/dist/{chunk-6P54TMWL.js → chunk-3VPVG5SU.js} +6 -6
  11. package/dist/{chunk-ZETYB3XG.js → chunk-3W7IEVVL.js} +44 -28
  12. package/dist/chunk-3YN6V5TV.js +85 -0
  13. package/dist/chunk-466Z26MG.js +30 -0
  14. package/dist/{chunk-PCHDGUKT.js → chunk-4UNXBNE2.js} +12 -11
  15. package/dist/{chunk-J7WJZ6W7.js → chunk-4W4VLAPJ.js} +12 -11
  16. package/dist/{chunk-F5VLZHUW.js → chunk-52FUZI6K.js} +4 -2
  17. package/dist/{chunk-H5EV3VMF.js → chunk-5NGR67U5.js} +2 -2
  18. package/dist/{chunk-CBD2B5CP.js → chunk-5UCAH366.js} +21 -20
  19. package/dist/{chunk-BHWHXMQ2.js → chunk-67WMNWEE.js} +9 -8
  20. package/dist/{chunk-USHG4DLH.js → chunk-6C7JWPCP.js} +7 -7
  21. package/dist/{chunk-VPWKF3GN.js → chunk-6GFRNVYR.js} +11 -10
  22. package/dist/{chunk-3JL6IFD7.js → chunk-6SDEP3AJ.js} +9 -8
  23. package/dist/{chunk-NJF2X5XF.js → chunk-6STA6Z7I.js} +19 -17
  24. package/dist/{chunk-KJCWXUUS.js → chunk-724UL2TJ.js} +6 -4
  25. package/dist/{chunk-MQA2YBAH.js → chunk-76MWC2K6.js} +3 -3
  26. package/dist/{chunk-YLN4K6WD.js → chunk-77M37OKR.js} +10 -8
  27. package/dist/{chunk-XHSCVSOL.js → chunk-7DYBLXYA.js} +3 -3
  28. package/dist/{chunk-OC7LYAU5.js → chunk-AB3YYG6N.js} +24 -10
  29. package/dist/{chunk-LD7WFTRX.js → chunk-ACXEQZOU.js} +16 -16
  30. package/dist/{chunk-VSMJK3ZJ.js → chunk-AOHZU2BM.js} +1 -1
  31. package/dist/{chunk-T4QZ6FEH.js → chunk-AW7R2GWG.js} +65 -8
  32. package/dist/{chunk-GAYGGICG.js → chunk-BKE7E7TC.js} +10 -9
  33. package/dist/{chunk-EUT3B22Y.js → chunk-BRGDSBJE.js} +13 -12
  34. package/dist/{chunk-T54VJRAD.js → chunk-C34ZXZ7O.js} +55 -11
  35. package/dist/{chunk-UGSMCQ4D.js → chunk-CHOW74WE.js} +1 -1
  36. package/dist/{chunk-H2W2AXD3.js → chunk-CMMHNUZ2.js} +66 -58
  37. package/dist/chunk-CSHFH5IN.js +17 -0
  38. package/dist/chunk-EC47DWFA.js +56 -0
  39. package/dist/{chunk-KJN4IOEJ.js → chunk-EJIUXPBX.js} +1 -1
  40. package/dist/{chunk-IQZXOZ7S.js → chunk-EU63SDCG.js} +720 -334
  41. package/dist/{chunk-LNOMA3MP.js → chunk-FCSOVF55.js} +107 -3
  42. package/dist/{chunk-CFYISHUW.js → chunk-FLKWCIZH.js} +8 -5
  43. package/dist/{chunk-OYTMZXRF.js → chunk-FMSO6RDZ.js} +16 -14
  44. package/dist/{chunk-IUKPRZER.js → chunk-GAEGEPOC.js} +2 -2
  45. package/dist/{chunk-6XX5HCLK.js → chunk-GBPP5P7X.js} +4 -4
  46. package/dist/{chunk-TQFBZVCG.js → chunk-GXW6K4YJ.js} +1 -1
  47. package/dist/{chunk-ZZUFZUQZ.js → chunk-H6MF6EVN.js} +331 -107
  48. package/dist/{chunk-3JSEWUWI.js → chunk-IBGIOBEE.js} +3 -3
  49. package/dist/chunk-IZSHAIJ7.js +26 -0
  50. package/dist/{chunk-7ELY2CSM.js → chunk-JAU72XNY.js} +16 -14
  51. package/dist/chunk-JMYYOTQG.js +77 -0
  52. package/dist/{chunk-ELVWJYRV.js → chunk-JSQFTSC6.js} +12 -11
  53. package/dist/{chunk-J6DFZDFA.js → chunk-KBG47GHP.js} +4 -4
  54. package/dist/chunk-KDERNTCQ.js +28 -0
  55. package/dist/chunk-KSX3TXSZ.js +69 -0
  56. package/dist/{chunk-XGUL4SLQ.js → chunk-L3BLXZG7.js} +2 -2
  57. package/dist/chunk-LOP6GRPH.js +31 -0
  58. package/dist/{chunk-MTDRLSI7.js → chunk-M6HSLBWY.js} +1064 -986
  59. package/dist/chunk-MQLUAEOC.js +162 -0
  60. package/dist/{chunk-3MRXIJ6I.js → chunk-MRXKYPCS.js} +2 -2
  61. package/dist/{chunk-D65GOCJB.js → chunk-MXGY6KPT.js} +19 -16
  62. package/dist/{chunk-G3RLJYA2.js → chunk-N2H3ZPZY.js} +47 -1
  63. package/dist/{chunk-HREZQCT3.js → chunk-N3X6Q4YT.js} +3 -3
  64. package/dist/{chunk-HSIRMK2D.js → chunk-OCAGUNBC.js} +15 -15
  65. package/dist/{chunk-ZOEYVXSV.js → chunk-OXXKQCSV.js} +6 -6
  66. package/dist/{chunk-S6AMWKPC.js → chunk-P7266HLM.js} +2 -2
  67. package/dist/{chunk-64LU2OVH.js → chunk-PHDMFAKM.js} +12 -2
  68. package/dist/{chunk-IMSQR4WO.js → chunk-PNQDPDRC.js} +1 -1
  69. package/dist/{chunk-IUR76K6A.js → chunk-Q7DUK4LX.js} +5 -5
  70. package/dist/{chunk-CULQYFLU.js → chunk-QGQ5CCCG.js} +2 -2
  71. package/dist/{chunk-UEAHAMEI.js → chunk-QHJ6DQ2R.js} +11 -11
  72. package/dist/{chunk-BNKLYOOO.js → chunk-QILIYSJF.js} +1 -1
  73. package/dist/{chunk-VYKKMYVT.js → chunk-QOBUHWHX.js} +11 -6
  74. package/dist/{chunk-3PNFWVHT.js → chunk-QQNQ7SJW.js} +2 -75
  75. package/dist/{chunk-7M4T5N3V.js → chunk-R3PCY3YS.js} +14 -13
  76. package/dist/{chunk-MGIWSROG.js → chunk-RPLINGVB.js} +7 -7
  77. package/dist/{chunk-CMU4RMJB.js → chunk-RWWYJ623.js} +10 -1
  78. package/dist/{chunk-3FERWMCH.js → chunk-RXCOMYPY.js} +27 -26
  79. package/dist/{chunk-7BX5DWSA.js → chunk-SAEFPSB6.js} +11 -11
  80. package/dist/{chunk-N7YNJE5R.js → chunk-SQ4TVJBR.js} +10 -10
  81. package/dist/{chunk-DMS52BEP.js → chunk-SS36ZX4J.js} +9 -7
  82. package/dist/{chunk-JONGANYH.js → chunk-T6CPIZNT.js} +32 -30
  83. package/dist/{chunk-6UYA642J.js → chunk-TYM6OUIT.js} +13 -12
  84. package/dist/{chunk-ALQRYH6O.js → chunk-UXGETRP4.js} +13 -12
  85. package/dist/{chunk-FGALODG3.js → chunk-UZ3TUTRV.js} +1 -1
  86. package/dist/{chunk-J3FZR3YY.js → chunk-VCHXCQFG.js} +3 -3
  87. package/dist/{chunk-3P4PF2BX.js → chunk-VCO24T4L.js} +34 -22
  88. package/dist/{chunk-O7HZX7CA.js → chunk-VRZP76YM.js} +1 -1
  89. package/dist/{chunk-VZHJS6DR.js → chunk-VSSBEUFT.js} +16 -15
  90. package/dist/{chunk-U52SAGRM.js → chunk-VWCXW2E7.js} +1 -1
  91. package/dist/{chunk-WW5BLB74.js → chunk-WOA4LN2R.js} +2 -2
  92. package/dist/{chunk-ZMOMPX2Z.js → chunk-WU567RSC.js} +11 -10
  93. package/dist/{chunk-N77WFUL7.js → chunk-XAGLWMJ4.js} +23 -22
  94. package/dist/{chunk-WSEWKCXU.js → chunk-XCJN5IJU.js} +4 -4
  95. package/dist/{chunk-IR6XFA5P.js → chunk-XIJZVPD5.js} +16 -14
  96. package/dist/{chunk-OYOB3ZFG.js → chunk-XMSXXAHW.js} +2 -2
  97. package/dist/{chunk-34OCDWOS.js → chunk-XTMJ7XDT.js} +1 -1
  98. package/dist/{chunk-Z6BB4JLQ.js → chunk-XVF2VVXP.js} +5 -3
  99. package/dist/{chunk-AFZYMAIV.js → chunk-YIUAVF7E.js} +37 -35
  100. package/dist/{chunk-NFXP47RV.js → chunk-YSZNHOBY.js} +85 -31
  101. package/dist/{chunk-V5MEBST3.js → chunk-YYOIQFRS.js} +21 -21
  102. package/dist/chunk-Z527N6YQ.js +28 -0
  103. package/dist/{chunk-D6YF5HKX.js → chunk-ZANLILYD.js} +22 -2
  104. package/dist/{chunk-2UMYMRI3.js → chunk-ZGDGW2V3.js} +2 -2
  105. package/dist/{chunk-6B5I6ICN.js → chunk-ZHFZWTZV.js} +12 -11
  106. package/dist/{chunk-OEX24ECI.js → chunk-ZWFS3OEF.js} +51 -41
  107. package/dist/{chunk-AXKPQ6ZI.js → chunk-ZXYDQ3TZ.js} +5 -5
  108. package/dist/index.js +73783 -71033
  109. package/dist/mcp/analyze-cli.js +18 -8
  110. package/dist/mcp/cli.js +48 -37
  111. package/dist/mcp/server.js +568 -397
  112. package/dist/mcp/worker.js +67 -55
  113. package/dist/probes/installer.js +20 -19
  114. package/docs/astplayground.md +1 -1
  115. package/docs/configuration.md +29 -0
  116. package/docs/dependencies.md +3 -0
  117. package/docs/features.md +2 -2
  118. package/docs/globalconfig.md +2 -0
  119. package/docs/language-coverage.md +2 -1
  120. package/docs/lsp-capability-matrix.md +29 -7
  121. package/docs/lsp-idle-eviction.md +38 -47
  122. package/docs/pi-lens-fixer.md +4 -0
  123. package/docs/pi-lens-merge-policy.md +17 -4
  124. package/docs/pi-lens-retro.md +2 -1
  125. package/docs/pi-lens-reviewer.md +18 -0
  126. package/docs/pi-lens-subagent.md +7 -0
  127. package/docs/real-harness.md +17 -0
  128. package/docs/schema/pi-lens-config-v1.json +37 -2
  129. package/docs/servercapabilities.md +15 -4
  130. package/docs/settings.md +2 -1
  131. package/package.json +1 -1
  132. package/dist/chunk-2FQ62SPM.js +0 -83
  133. package/dist/chunk-7AXO3ZDF.js +0 -30
  134. package/dist/chunk-KMGPUKFD.js +0 -25
  135. package/dist/chunk-OZJINN4O.js +0 -84
  136. package/dist/chunk-RJFED73B.js +0 -79
  137. package/dist/chunk-RTQNRM5X.js +0 -27
  138. package/dist/chunk-VGEVL5EQ.js +0 -29
  139. package/dist/chunk-WPE5FPGR.js +0 -54
  140. package/dist/chunk-Z7QQA2KT.js +0 -27
@@ -2,12 +2,16 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  getToolCommandSpec,
4
4
  shouldAutoInstallTool
5
- } from "./chunk-MGIWSROG.js";
5
+ } from "./chunk-RPLINGVB.js";
6
6
  import {
7
7
  BUILTIN_SERVER_RUNNER_COVERS,
8
8
  getServersForFileWithConfig,
9
- isAuxiliary
10
- } from "./chunk-IQZXOZ7S.js";
9
+ isAuxiliary,
10
+ resolveAnalysisRootPath
11
+ } from "./chunk-EU63SDCG.js";
12
+ import {
13
+ emitBounded
14
+ } from "./chunk-FCSOVF55.js";
11
15
  import {
12
16
  PathKeyedMap
13
17
  } from "./chunk-Z3CCVDUB.js";
@@ -20,21 +24,22 @@ import {
20
24
  isSpawnableCommand,
21
25
  logSessionStart,
22
26
  resetPathWalkMemo
23
- } from "./chunk-LD7WFTRX.js";
27
+ } from "./chunk-ACXEQZOU.js";
24
28
  import {
25
29
  resolveToolCwd
26
- } from "./chunk-IUR76K6A.js";
30
+ } from "./chunk-Q7DUK4LX.js";
27
31
  import {
28
32
  VENDOR_BIN_DIRS,
29
33
  VENV_BIN_DIRS,
30
34
  findGlobalBinary,
31
35
  findLocalBinAt,
32
- findLocalBinUpwards
33
- } from "./chunk-T4QZ6FEH.js";
36
+ findLocalBinUpwards,
37
+ localBinPath
38
+ } from "./chunk-AW7R2GWG.js";
34
39
  import {
35
40
  createAvailabilityProbeFlight,
36
41
  probeToolAsync
37
- } from "./chunk-CMU4RMJB.js";
42
+ } from "./chunk-RWWYJ623.js";
38
43
  import {
39
44
  classifyProbeFailure,
40
45
  createAvailabilityLatch,
@@ -44,25 +49,31 @@ import {
44
49
  logAvailabilityDecision,
45
50
  startHostStallSampler,
46
51
  transientRetryDelayMs
47
- } from "./chunk-O7HZX7CA.js";
52
+ } from "./chunk-VRZP76YM.js";
48
53
  import {
49
54
  createGenerationSource,
50
55
  getGlobalPiLensDir,
51
56
  isInSpawnTimeoutCooldown,
57
+ resolveWindowsCommandForEnvironment,
52
58
  safeSpawnAsync
53
- } from "./chunk-T54VJRAD.js";
59
+ } from "./chunk-C34ZXZ7O.js";
60
+ import {
61
+ getProjectTrustState
62
+ } from "./chunk-ZANLILYD.js";
54
63
  import {
55
64
  compareOrdinal,
56
65
  incrementDegradationCount
57
- } from "./chunk-7ELY2CSM.js";
66
+ } from "./chunk-JAU72XNY.js";
58
67
  import {
68
+ isUnderDir,
59
69
  normalizeEphemeralMapKey,
60
70
  normalizeMapKey
61
- } from "./chunk-G3RLJYA2.js";
71
+ } from "./chunk-N2H3ZPZY.js";
62
72
 
63
73
  // dist/clients/dispatch/runners/utils/runner-helpers.js
64
74
  import * as fs from "node:fs";
65
75
  import * as path from "node:path";
76
+ import { delimiter, resolve as resolveCommandPath } from "node:path";
66
77
  import { fileURLToPath } from "node:url";
67
78
  function lspPrimaryCoversFile(ctx, runnerId) {
68
79
  if (ctx.pi?.getFlag?.("no-lsp"))
@@ -185,14 +196,58 @@ async function findManagedReleaseBinary(tool, verificationArgs = ["--version"])
185
196
  const verdict = await verifyManagedCandidate(candidate, verificationArgs);
186
197
  return verdict === "ok" || verdict === "unverified" ? candidate : null;
187
198
  }
188
- function createVenvFinder(command, windowsExt = "", verificationArgs = ["--version"]) {
199
+ function resolveAdoptedRootCommand(command, ctx, cwd) {
200
+ const candidates = managedNodeToolCandidates(command);
201
+ let selected = candidates.find((candidate) => candidate && fs.existsSync(candidate));
202
+ if (!selected) {
203
+ if (process.platform === "win32") {
204
+ selected = resolveWindowsCommandForEnvironment(command, cwd, process.env)?.resolvedPath;
205
+ } else {
206
+ selected = (process.env.PATH ?? "").split(delimiter).map((dir) => resolveCommandPath(cwd, dir, command)).find((candidate) => {
207
+ try {
208
+ fs.accessSync(candidate, fs.constants.X_OK);
209
+ return fs.statSync(candidate).isFile();
210
+ } catch {
211
+ return false;
212
+ }
213
+ });
214
+ }
215
+ }
216
+ if (!selected)
217
+ return null;
218
+ try {
219
+ const binary = fs.realpathSync.native(selected);
220
+ const session = ctx.projectRoot ?? ctx.cwd;
221
+ const adopted = resolveAnalysisRootPath(ctx.filePath, session);
222
+ if (!adopted)
223
+ return null;
224
+ const roots = [adopted, session].map((root) => fs.realpathSync.native(root));
225
+ if (roots.some((root) => binary === root || isUnderDir(binary, root) || isUnderDir(selected, root))) {
226
+ emitBounded("adopted_root_binary_refused", `${ctx.filePath}:${command}:${binary}`, {
227
+ filePath: ctx.filePath,
228
+ durationMs: 0,
229
+ metadata: { command, binary }
230
+ }, {
231
+ ledgerKind: "adopted-root-binary-refused",
232
+ risingEdgePer: "identity"
233
+ });
234
+ return null;
235
+ }
236
+ return binary;
237
+ } catch {
238
+ return null;
239
+ }
240
+ }
241
+ function createVenvFinder(command, windowsExt = "", verificationArgs = ["--version"], allowProjectLocal = true) {
189
242
  return async (cwd) => {
190
- const venvBin = findLocalBinAt(command, cwd, {
191
- windowsExt,
192
- binDirs: VENV_BIN_DIRS
193
- });
194
- if (venvBin)
195
- return { path: venvBin, rung: "venv" };
243
+ if (allowProjectLocal) {
244
+ const venvBin = localBinPath(findLocalBinAt(command, cwd, {
245
+ windowsExt,
246
+ binDirs: VENV_BIN_DIRS
247
+ }));
248
+ if (venvBin)
249
+ return { path: venvBin, rung: "venv" };
250
+ }
196
251
  const managed = await findManagedNodeToolBinary(command, verificationArgs);
197
252
  if (managed)
198
253
  return { path: managed, rung: "managed-dir" };
@@ -234,6 +289,8 @@ async function getManagedToolEnvironment(_toolId, cwd) {
234
289
  }
235
290
  if (!cwd)
236
291
  return env;
292
+ if (getProjectTrustState() !== "trusted")
293
+ return env;
237
294
  const separator = process.platform === "win32" ? ";" : ":";
238
295
  const currentPath = env.PATH || env.Path || process.env.PATH || "";
239
296
  const localBin = path.join(cwd, "node_modules", ".bin");
@@ -428,7 +485,7 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
428
485
  const inFlightByCwd = new PathKeyedMap(normalizeEphemeralMapKey);
429
486
  let checkerGeneration = availabilityGeneration.current();
430
487
  let checkerFlightGeneration = 0;
431
- const findCommand = createVenvFinder(command, windowsExt, versionArgs);
488
+ const findCommand = createVenvFinder(command, windowsExt, versionArgs, options.allowProjectLocal !== false);
432
489
  function ensureCurrentGeneration() {
433
490
  if (checkerGeneration === availabilityGeneration.current())
434
491
  return;
@@ -812,10 +869,8 @@ function createCwdCachedProbe(probe, options) {
812
869
  return cached;
813
870
  }
814
871
  function resolveNodeToolCommand(cwd, toolName, windowsExt = ".cmd") {
815
- const isWin = process.platform === "win32";
816
- const binName = isWin ? `${toolName}${windowsExt}` : toolName;
817
- const local = path.join(cwd, "node_modules", ".bin", binName);
818
- if (fs.existsSync(local))
872
+ const local = localBinPath(findLocalBinAt(toolName, cwd, { windowsExt }));
873
+ if (local)
819
874
  return local;
820
875
  return toolName;
821
876
  }
@@ -826,10 +881,10 @@ function resolveToolCommand(cwd, toolId) {
826
881
  return resolveNodeToolCommand(cwd, spec.command, spec.windowsExt ?? ".cmd");
827
882
  }
828
883
  function resolveVendorToolCommand(cwd, toolName, windowsExt = ".bat") {
829
- return findLocalBinUpwards(toolName, cwd, {
884
+ return localBinPath(findLocalBinUpwards(toolName, cwd, {
830
885
  windowsExt,
831
886
  binDirs: VENDOR_BIN_DIRS
832
- }) ?? null;
887
+ })) ?? null;
833
888
  }
834
889
  async function resolveToolCommandWithInstallFallback(cwd, toolId, timeout = 5e3) {
835
890
  const spec = getToolCommandSpec(toolId);
@@ -949,14 +1004,12 @@ function getSgCommand() {
949
1004
  ensureCurrentSgGeneration();
950
1005
  return {
951
1006
  cmd: sgCmd ?? "npx",
952
- args: sgCmdArgs.length ? sgCmdArgs : ["--no", "--", "ast-grep"]
1007
+ args: sgCmdArgs.length ? sgCmdArgs : ["--no", "--package", "@ast-grep/cli", "--", "ast-grep"]
953
1008
  };
954
1009
  }
955
1010
  async function resolveLocalFirstAsync(toolName, cwd, windowsExt = ".cmd") {
956
- const isWin = process.platform === "win32";
957
- const binName = isWin ? `${toolName}${windowsExt}` : toolName;
958
- const local = path.join(cwd, "node_modules", ".bin", binName);
959
- if (fs.existsSync(local))
1011
+ const local = localBinPath(findLocalBinAt(toolName, cwd, { windowsExt }));
1012
+ if (local)
960
1013
  return { cmd: local, args: [] };
961
1014
  const globalBin = await findGlobalBinary(toolName, windowsExt);
962
1015
  if (globalBin)
@@ -980,6 +1033,7 @@ export {
980
1033
  lspPrimaryCoversFile,
981
1034
  coveringLaneAvailable,
982
1035
  findManagedNodeToolBinary,
1036
+ resolveAdoptedRootCommand,
983
1037
  resolveManagedToolClient,
984
1038
  getManagedToolEnvironment,
985
1039
  discoverManagedTool,
@@ -2,10 +2,6 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  buildSymbolId
4
4
  } from "./chunk-3MED75HT.js";
5
- import {
6
- createGitIdentityResolver,
7
- resolveGitIdentity
8
- } from "./chunk-IMSQR4WO.js";
9
5
  import {
10
6
  RUNTIME_CONFIG,
11
7
  TreeSitterSymbolExtractor,
@@ -18,7 +14,14 @@ import {
18
14
  resolveProjectReferenceImport,
19
15
  resolveWorkspacePackageImport,
20
16
  symbolExtractionGrammar
21
- } from "./chunk-MTDRLSI7.js";
17
+ } from "./chunk-M6HSLBWY.js";
18
+ import {
19
+ createGitIdentityResolver,
20
+ resolveGitIdentity
21
+ } from "./chunk-PNQDPDRC.js";
22
+ import {
23
+ readWorkerHeapStatistics
24
+ } from "./chunk-ZXYDQ3TZ.js";
22
25
  import {
23
26
  buildQualifiedName,
24
27
  findOwnerName
@@ -28,28 +31,25 @@ import {
28
31
  getSharedTreeSitterClient,
29
32
  logTreeSitterCacheStats,
30
33
  withTreeSitterRoot
31
- } from "./chunk-UEAHAMEI.js";
32
- import {
33
- readWorkerHeapStatistics
34
- } from "./chunk-AXKPQ6ZI.js";
34
+ } from "./chunk-QHJ6DQ2R.js";
35
35
  import {
36
36
  getReviewGraphMaxFilesDerived
37
- } from "./chunk-IUKPRZER.js";
37
+ } from "./chunk-GAEGEPOC.js";
38
38
  import {
39
39
  collectSourceFilesWithBudgetAsync
40
- } from "./chunk-USHG4DLH.js";
40
+ } from "./chunk-6C7JWPCP.js";
41
41
  import {
42
42
  collectUntrackedIgnoredIds,
43
43
  getProjectDataDir,
44
44
  isStaleStageFile
45
- } from "./chunk-T54VJRAD.js";
45
+ } from "./chunk-C34ZXZ7O.js";
46
46
  import {
47
47
  KIND_EXTENSIONS,
48
48
  detectFileKind
49
- } from "./chunk-64LU2OVH.js";
49
+ } from "./chunk-PHDMFAKM.js";
50
50
  import {
51
51
  detectFileRole
52
- } from "./chunk-N2IRDBZI.js";
52
+ } from "./chunk-2BBLFX75.js";
53
53
  import {
54
54
  writeFileAtomic
55
55
  } from "./chunk-2EECBNC5.js";
@@ -57,10 +57,10 @@ import {
57
57
  compareOrdinal,
58
58
  escapeRegExp,
59
59
  incrementDegradationCount
60
- } from "./chunk-7ELY2CSM.js";
60
+ } from "./chunk-JAU72XNY.js";
61
61
  import {
62
62
  logLatency
63
- } from "./chunk-3PNFWVHT.js";
63
+ } from "./chunk-QQNQ7SJW.js";
64
64
  import {
65
65
  createNdjsonLogger,
66
66
  getGlobalPiLensLogDir,
@@ -68,10 +68,10 @@ import {
68
68
  getTurnId,
69
69
  isTestMode,
70
70
  lazyEnvNumber
71
- } from "./chunk-VSMJK3ZJ.js";
71
+ } from "./chunk-AOHZU2BM.js";
72
72
  import {
73
73
  FactStore
74
- } from "./chunk-UGSMCQ4D.js";
74
+ } from "./chunk-CHOW74WE.js";
75
75
  import {
76
76
  BoundedFifoMap,
77
77
  BoundedLruCache
@@ -82,7 +82,7 @@ import {
82
82
  normalizeFilePath,
83
83
  normalizeMapKey,
84
84
  toProjectRelativePath
85
- } from "./chunk-G3RLJYA2.js";
85
+ } from "./chunk-N2H3ZPZY.js";
86
86
 
87
87
  // dist/clients/review-graph/builder.js
88
88
  import { createHash as createHash2 } from "node:crypto";
@@ -2451,8 +2451,8 @@ async function ensureReviewGraphFacts(filePath, cwd, facts, contentOverride) {
2451
2451
  }
2452
2452
  try {
2453
2453
  const [{ importFactProvider }, { functionFactProvider }] = await Promise.all([
2454
- import("./chunk-VGEVL5EQ.js"),
2455
- import("./chunk-7AXO3ZDF.js")
2454
+ import("./chunk-466Z26MG.js"),
2455
+ import("./chunk-LOP6GRPH.js")
2456
2456
  ]);
2457
2457
  await importFactProvider.run(ctx, facts);
2458
2458
  await functionFactProvider.run(ctx, facts);
@@ -0,0 +1,28 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ GoClient,
4
+ goClient,
5
+ resetGoAvailability
6
+ } from "./chunk-XMSXXAHW.js";
7
+ import "./chunk-7DYBLXYA.js";
8
+ import "./chunk-RWWYJ623.js";
9
+ import "./chunk-VRZP76YM.js";
10
+ import "./chunk-C34ZXZ7O.js";
11
+ import "./chunk-BW5KFIQC.js";
12
+ import "./chunk-2BBLFX75.js";
13
+ import "./chunk-XVF2VVXP.js";
14
+ import "./chunk-2EECBNC5.js";
15
+ import "./chunk-JAU72XNY.js";
16
+ import "./chunk-XTMJ7XDT.js";
17
+ import "./chunk-JMYYOTQG.js";
18
+ import "./chunk-QQNQ7SJW.js";
19
+ import "./chunk-AOHZU2BM.js";
20
+ import "./chunk-LJDODBBZ.js";
21
+ import "./chunk-ABBOA7UD.js";
22
+ import "./chunk-N2H3ZPZY.js";
23
+ import "./chunk-NXL4FFQQ.js";
24
+ export {
25
+ GoClient,
26
+ goClient,
27
+ resetGoAvailability
28
+ };
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  recordDegradation
4
- } from "./chunk-7ELY2CSM.js";
4
+ } from "./chunk-JAU72XNY.js";
5
5
  import {
6
6
  logExtension
7
- } from "./chunk-34OCDWOS.js";
7
+ } from "./chunk-XTMJ7XDT.js";
8
8
 
9
9
  // dist/clients/project-trust.js
10
10
  var trustState = "unknown";
@@ -14,6 +14,25 @@ var trustGeneration = 0;
14
14
  function getProjectTrustGeneration() {
15
15
  return trustGeneration;
16
16
  }
17
+ function latchProjectTrustState(next) {
18
+ if (next === trustState)
19
+ return;
20
+ trustState = next;
21
+ installRefusalWarnings.clear();
22
+ trustGeneration += 1;
23
+ }
24
+ function setProjectTrustState(next) {
25
+ const previous = trustState;
26
+ latchProjectTrustState(next);
27
+ if (previous !== next) {
28
+ logExtension({
29
+ subsystem: "project-trust",
30
+ level: "debug",
31
+ message: `project trust state transitioned: ${previous} -> ${next}`,
32
+ metadata: { previous, next }
33
+ });
34
+ }
35
+ }
17
36
  function getProjectTrustState() {
18
37
  return trustState;
19
38
  }
@@ -51,6 +70,7 @@ function projectTrustDenialReason() {
51
70
 
52
71
  export {
53
72
  getProjectTrustGeneration,
73
+ setProjectTrustState,
54
74
  getProjectTrustState,
55
75
  isToolInstallAllowedByTrust,
56
76
  assertInstallAllowed,
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  isMutatingToolName
4
- } from "./chunk-3JSEWUWI.js";
4
+ } from "./chunk-IBGIOBEE.js";
5
5
  import {
6
6
  normalizeMapKey
7
- } from "./chunk-G3RLJYA2.js";
7
+ } from "./chunk-N2H3ZPZY.js";
8
8
 
9
9
  // dist/clients/agent-behavior-client.js
10
10
  var READ_OPS = /* @__PURE__ */ new Set(["read", "bash", "grep", "glob", "find", "rg"]);
@@ -12,21 +12,22 @@ import {
12
12
  isStartupScanVerdictFresh,
13
13
  resolveStartupScanContext,
14
14
  resolveStartupScanContextAsync
15
- } from "./chunk-6P54TMWL.js";
16
- import "./chunk-IUKPRZER.js";
17
- import "./chunk-H5EV3VMF.js";
18
- import "./chunk-T54VJRAD.js";
15
+ } from "./chunk-3VPVG5SU.js";
16
+ import "./chunk-GAEGEPOC.js";
17
+ import "./chunk-5NGR67U5.js";
18
+ import "./chunk-C34ZXZ7O.js";
19
19
  import "./chunk-QYF5S6P6.js";
20
- import "./chunk-N2IRDBZI.js";
21
- import "./chunk-Z6BB4JLQ.js";
20
+ import "./chunk-2BBLFX75.js";
21
+ import "./chunk-XVF2VVXP.js";
22
22
  import "./chunk-2EECBNC5.js";
23
- import "./chunk-7ELY2CSM.js";
24
- import "./chunk-34OCDWOS.js";
25
- import "./chunk-3PNFWVHT.js";
26
- import "./chunk-VSMJK3ZJ.js";
23
+ import "./chunk-JAU72XNY.js";
24
+ import "./chunk-XTMJ7XDT.js";
25
+ import "./chunk-JMYYOTQG.js";
26
+ import "./chunk-QQNQ7SJW.js";
27
+ import "./chunk-AOHZU2BM.js";
27
28
  import "./chunk-LJDODBBZ.js";
28
29
  import "./chunk-ABBOA7UD.js";
29
- import "./chunk-G3RLJYA2.js";
30
+ import "./chunk-N2H3ZPZY.js";
30
31
  import "./chunk-NXL4FFQQ.js";
31
32
  export {
32
33
  MAX_STARTUP_SCAN_ENTRIES,
@@ -1,67 +1,72 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  resolveManagedToolClient
4
- } from "./chunk-NFXP47RV.js";
4
+ } from "./chunk-YSZNHOBY.js";
5
5
  import {
6
6
  biomeConfigArgs
7
- } from "./chunk-MGIWSROG.js";
8
- import "./chunk-IQZXOZ7S.js";
9
- import "./chunk-LNOMA3MP.js";
10
- import "./chunk-U52SAGRM.js";
11
- import "./chunk-KJCWXUUS.js";
7
+ } from "./chunk-RPLINGVB.js";
8
+ import "./chunk-EU63SDCG.js";
9
+ import "./chunk-VWCXW2E7.js";
10
+ import "./chunk-FCSOVF55.js";
11
+ import "./chunk-PNQDPDRC.js";
12
+ import "./chunk-ZXYDQ3TZ.js";
13
+ import "./chunk-724UL2TJ.js";
12
14
  import "./chunk-QOZXJ4NA.js";
13
- import "./chunk-S6AMWKPC.js";
14
- import "./chunk-F5VLZHUW.js";
15
- import "./chunk-AXKPQ6ZI.js";
16
- import "./chunk-7BX5DWSA.js";
17
- import "./chunk-IUKPRZER.js";
15
+ import "./chunk-P7266HLM.js";
16
+ import "./chunk-52FUZI6K.js";
17
+ import "./chunk-SAEFPSB6.js";
18
+ import "./chunk-GAEGEPOC.js";
18
19
  import "./chunk-Z3CCVDUB.js";
19
20
  import "./chunk-2BEMIWEW.js";
20
- import "./chunk-LD7WFTRX.js";
21
+ import "./chunk-ACXEQZOU.js";
21
22
  import {
22
23
  resolveToolCwd
23
- } from "./chunk-IUR76K6A.js";
24
+ } from "./chunk-Q7DUK4LX.js";
24
25
  import {
25
- findGlobalBinary
26
- } from "./chunk-T4QZ6FEH.js";
27
- import "./chunk-D6YF5HKX.js";
26
+ findGlobalBinary,
27
+ findLocalBinAt,
28
+ localBinPath
29
+ } from "./chunk-AW7R2GWG.js";
28
30
  import {
31
+ getIsolatedNpxSpawnOptions,
29
32
  probeToolAsync
30
- } from "./chunk-CMU4RMJB.js";
33
+ } from "./chunk-RWWYJ623.js";
31
34
  import {
32
35
  classifyProbeFailure,
33
36
  createAvailabilityLatch,
34
37
  describeInstallAttempt,
35
38
  logAvailabilityDecision,
36
39
  startHostStallSampler
37
- } from "./chunk-O7HZX7CA.js";
38
- import "./chunk-VYKKMYVT.js";
39
- import "./chunk-BNKLYOOO.js";
40
- import "./chunk-USHG4DLH.js";
41
- import "./chunk-H5EV3VMF.js";
40
+ } from "./chunk-VRZP76YM.js";
41
+ import "./chunk-QOBUHWHX.js";
42
+ import "./chunk-QILIYSJF.js";
43
+ import "./chunk-6C7JWPCP.js";
44
+ import "./chunk-5NGR67U5.js";
42
45
  import {
43
46
  getGlobalPiLensDir,
44
47
  safeSpawnAsync
45
- } from "./chunk-T54VJRAD.js";
48
+ } from "./chunk-C34ZXZ7O.js";
46
49
  import {
47
50
  createSingleFlight
48
51
  } from "./chunk-BW5KFIQC.js";
49
52
  import "./chunk-QYF5S6P6.js";
50
53
  import {
51
54
  isFileKind
52
- } from "./chunk-64LU2OVH.js";
53
- import "./chunk-N2IRDBZI.js";
54
- import "./chunk-Z6BB4JLQ.js";
55
+ } from "./chunk-PHDMFAKM.js";
56
+ import "./chunk-2BBLFX75.js";
57
+ import "./chunk-XVF2VVXP.js";
58
+ import "./chunk-ZANLILYD.js";
55
59
  import "./chunk-2EECBNC5.js";
56
- import "./chunk-7ELY2CSM.js";
60
+ import "./chunk-JAU72XNY.js";
57
61
  import {
58
62
  createSubsystemLogger
59
- } from "./chunk-34OCDWOS.js";
60
- import "./chunk-3PNFWVHT.js";
61
- import "./chunk-VSMJK3ZJ.js";
63
+ } from "./chunk-XTMJ7XDT.js";
64
+ import "./chunk-JMYYOTQG.js";
65
+ import "./chunk-QQNQ7SJW.js";
66
+ import "./chunk-AOHZU2BM.js";
62
67
  import "./chunk-LJDODBBZ.js";
63
68
  import "./chunk-ABBOA7UD.js";
64
- import "./chunk-G3RLJYA2.js";
69
+ import "./chunk-N2H3ZPZY.js";
65
70
  import "./chunk-NXL4FFQQ.js";
66
71
 
67
72
  // dist/clients/biome-client.js
@@ -126,15 +131,13 @@ var BiomeClient = class {
126
131
  return { cmd: cached, args: [] };
127
132
  const isWin = process.platform === "win32";
128
133
  const piLensBin = path.join(getGlobalPiLensDir(), "tools", "node_modules", ".bin");
129
- const candidates = isWin ? [
130
- path.join(resolveCwd, "node_modules", ".bin", "biome.cmd"),
131
- path.join(resolveCwd, "node_modules", ".bin", "biome")
132
- ] : [path.join(resolveCwd, "node_modules", ".bin", "biome")];
133
- for (const p of candidates) {
134
- if (fs.existsSync(p)) {
135
- this.localBinaryByCwd.set(resolveCwd, p);
136
- return { cmd: p, args: [] };
137
- }
134
+ const localBiome = localBinPath(findLocalBinAt("biome", resolveCwd, {
135
+ windowsExt: ".cmd",
136
+ isWindows: isWin
137
+ }));
138
+ if (localBiome) {
139
+ this.localBinaryByCwd.set(resolveCwd, localBiome);
140
+ return { cmd: localBiome, args: [] };
138
141
  }
139
142
  if (this.autoInstalledBinaryPath) {
140
143
  return { cmd: this.autoInstalledBinaryPath, args: [] };
@@ -155,7 +158,14 @@ var BiomeClient = class {
155
158
  }
156
159
  async spawnBiomeAsync(args, timeout = 15e3, cwd) {
157
160
  const { cmd, args: prefix } = await this.getBiomeBinary(cwd);
158
- return safeSpawnAsync(cmd, [...prefix, ...args], { timeout, cwd });
161
+ return safeSpawnAsync(cmd, [...prefix, ...args], {
162
+ timeout,
163
+ cwd,
164
+ // ONE neutral-cwd seam for npx/bunx fallbacks (#4193, #4268 acceptance 3),
165
+ // so a project `.npmrc` is never read; a resolved binary keeps the
166
+ // project cwd it was given (biome.json discovery).
167
+ ...cmd === "npx" || cmd === "bunx" ? getIsolatedNpxSpawnOptions() : {}
168
+ });
159
169
  }
160
170
  /**
161
171
  * Ensure Biome is available, auto-installing if necessary.
@@ -3,7 +3,7 @@ import {
3
3
  deserializeWordIndex,
4
4
  recordPersistedWordIndexWireBytes,
5
5
  serializeWordIndex
6
- } from "./chunk-7BX5DWSA.js";
6
+ } from "./chunk-SAEFPSB6.js";
7
7
  import {
8
8
  fingerprintProjectSnapshotJson
9
9
  } from "./chunk-2BEMIWEW.js";
@@ -11,22 +11,22 @@ import {
11
11
  getProjectDataDir,
12
12
  isStaleStageFile,
13
13
  withGenerationLockSync
14
- } from "./chunk-T54VJRAD.js";
14
+ } from "./chunk-C34ZXZ7O.js";
15
15
  import {
16
16
  writeFileAtomic
17
17
  } from "./chunk-2EECBNC5.js";
18
18
  import {
19
19
  incrementDegradationCount
20
- } from "./chunk-7ELY2CSM.js";
20
+ } from "./chunk-JAU72XNY.js";
21
21
  import {
22
22
  logLatency
23
- } from "./chunk-3PNFWVHT.js";
23
+ } from "./chunk-QQNQ7SJW.js";
24
24
  import {
25
25
  BoundedFifoMap
26
26
  } from "./chunk-ABBOA7UD.js";
27
27
  import {
28
28
  normalizeMapKey
29
- } from "./chunk-G3RLJYA2.js";
29
+ } from "./chunk-N2H3ZPZY.js";
30
30
 
31
31
  // dist/clients/project-snapshot.js
32
32
  import * as fs3 from "node:fs";