pi-lens 4.5.1 → 4.5.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.
Files changed (139) hide show
  1. package/CHANGELOG-USER.md +6 -6
  2. package/CHANGELOG.md +121 -0
  3. package/README.md +9 -2
  4. package/dist/{chunk-ZVQUYCBU.js → chunk-2ERVW2UF.js} +161 -100
  5. package/dist/{chunk-AFSG6YUB.js → chunk-2K7BUOKS.js} +13 -13
  6. package/dist/{chunk-BJGWP4UX.js → chunk-3JJ4OAJI.js} +10 -10
  7. package/dist/{chunk-GIK6VUCY.js → chunk-3UHGSUVL.js} +1 -1
  8. package/dist/{chunk-EKQDQPX6.js → chunk-463WN3VP.js} +1 -1
  9. package/dist/{chunk-F7BFIENK.js → chunk-4X3ML2UQ.js} +29 -32
  10. package/dist/{chunk-7JMEPY6P.js → chunk-5BI5YP57.js} +10 -10
  11. package/dist/{chunk-MKW7ZUTT.js → chunk-5Z4XLUFF.js} +3 -3
  12. package/dist/{chunk-NIZKGBOU.js → chunk-62AJH3IN.js} +12 -14
  13. package/dist/{chunk-4GLSO2EM.js → chunk-6F34GMP7.js} +12 -12
  14. package/dist/{chunk-35UJUF27.js → chunk-6LIUVGOR.js} +13 -3
  15. package/dist/{chunk-WJ7GY5WJ.js → chunk-6REF4GCO.js} +1 -1
  16. package/dist/{chunk-HFIFEH46.js → chunk-7KRR24GO.js} +3 -3
  17. package/dist/{chunk-WAK2AXQQ.js → chunk-7OMOMBEQ.js} +9 -9
  18. package/dist/{chunk-S7KUDW73.js → chunk-7ZFXICNN.js} +15 -15
  19. package/dist/{chunk-VEF3GFOL.js → chunk-ABKRQVOY.js} +28 -52
  20. package/dist/{chunk-Y2LIOCA7.js → chunk-ANSLRJBG.js} +1 -1
  21. package/dist/{chunk-ARTCVE6I.js → chunk-AWMFBPGJ.js} +9 -9
  22. package/dist/{chunk-H6DNTQ4V.js → chunk-BG7KHGNX.js} +2 -2
  23. package/dist/{chunk-FD4LJQ6Y.js → chunk-BK2R2223.js} +10 -8
  24. package/dist/{chunk-TWAQFMLW.js → chunk-BXXC6KRR.js} +31 -34
  25. package/dist/{chunk-S247BOH2.js → chunk-CKJS2AUI.js} +4 -4
  26. package/dist/{chunk-GNK2IHVG.js → chunk-COGU5KQJ.js} +15 -15
  27. package/dist/{chunk-P7EV5ISR.js → chunk-CQNXALZJ.js} +12 -6
  28. package/dist/{chunk-IO6P3NBP.js → chunk-CSZESDPP.js} +1 -1
  29. package/dist/chunk-CZ5TCJPB.js +98 -0
  30. package/dist/{chunk-DLGJYQML.js → chunk-D2LFEA5U.js} +9 -2
  31. package/dist/chunk-D3KLF5CD.js +50 -0
  32. package/dist/{chunk-W2JPGW7Q.js → chunk-ENJ2M76Y.js} +20 -20
  33. package/dist/{chunk-2DWNYVUN.js → chunk-EQKF6BAK.js} +3 -3
  34. package/dist/{chunk-KIQSNH3F.js → chunk-F2SAP2FM.js} +38 -45
  35. package/dist/{chunk-BYIEU4E4.js → chunk-F6QAJXQV.js} +2 -2
  36. package/dist/chunk-GR2QDWH5.js +25 -0
  37. package/dist/{chunk-T2D2WWP6.js → chunk-GVE5VZYQ.js} +5 -5
  38. package/dist/{chunk-HMXWZUQW.js → chunk-GWZZOJD2.js} +1 -1
  39. package/dist/chunk-GZS6VPIE.js +27 -0
  40. package/dist/chunk-H4B4SC7I.js +71 -0
  41. package/dist/{chunk-2RQREVGO.js → chunk-HA6TUJOE.js} +1 -1
  42. package/dist/{chunk-NAACKIKT.js → chunk-HKPJTI47.js} +2 -2
  43. package/dist/{chunk-NHHS5T52.js → chunk-HPKC55MA.js} +1 -1
  44. package/dist/{chunk-B2QO7GHY.js → chunk-I65CQLCG.js} +1 -1
  45. package/dist/{chunk-BQ72NQQM.js → chunk-IDKLWVKY.js} +11 -11
  46. package/dist/chunk-IUM2Q7NF.js +25 -0
  47. package/dist/{chunk-PVV27TOX.js → chunk-J24IS3KZ.js} +5 -5
  48. package/dist/{chunk-DKXIUGNA.js → chunk-J2DAHH4T.js} +2 -2
  49. package/dist/{chunk-CDAJQBKJ.js → chunk-JBDZVOFL.js} +11 -11
  50. package/dist/{chunk-T7KHGEJ5.js → chunk-JC6NFC57.js} +3 -3
  51. package/dist/{chunk-BWGNVM33.js → chunk-JTHEUTW7.js} +11 -11
  52. package/dist/{chunk-WWZLT6AM.js → chunk-JWW3ODBN.js} +2 -2
  53. package/dist/{chunk-Q32RJDYC.js → chunk-K3ZIYLHT.js} +4 -4
  54. package/dist/{chunk-LDPY22FS.js → chunk-KDPZA2UE.js} +2 -3
  55. package/dist/{chunk-YIEHUKX2.js → chunk-KMY2OU4T.js} +489 -285
  56. package/dist/{chunk-WH6O4IFD.js → chunk-KQF7VT26.js} +10 -10
  57. package/dist/{chunk-OG3UCAHV.js → chunk-KVGA7X76.js} +3 -3
  58. package/dist/{chunk-TABDCX35.js → chunk-KW7O72AK.js} +2 -2
  59. package/dist/{chunk-AOEVZXR6.js → chunk-LEQTVRSV.js} +9 -9
  60. package/dist/{chunk-7BWPQZHE.js → chunk-LKPSBM6S.js} +3 -3
  61. package/dist/{chunk-WA6U2URH.js → chunk-LKW2HFSZ.js} +6 -6
  62. package/dist/{chunk-M3QGXGY4.js → chunk-LURFD4HD.js} +624 -97
  63. package/dist/{chunk-2YQ5LI7R.js → chunk-M6ELTECW.js} +4 -4
  64. package/dist/{chunk-OHTHVILU.js → chunk-MGVVYYKW.js} +12 -12
  65. package/dist/{chunk-W2YHHNY3.js → chunk-MQBKGRSB.js} +7 -7
  66. package/dist/{chunk-MET776XM.js → chunk-MVG2ZEAO.js} +6 -6
  67. package/dist/{chunk-2XALJI2K.js → chunk-MY4XNNTX.js} +39 -41
  68. package/dist/{chunk-GFCPPCNR.js → chunk-N4AJVFRF.js} +11 -11
  69. package/dist/{chunk-UARVPNAU.js → chunk-OFKKMXWM.js} +31 -36
  70. package/dist/{chunk-DHFJS2I4.js → chunk-OFZE4ANN.js} +8 -8
  71. package/dist/chunk-OLXBUTJR.js +61 -0
  72. package/dist/{chunk-SJ2SR432.js → chunk-OZGEHOSG.js} +38 -17
  73. package/dist/{chunk-6MDWNZ7E.js → chunk-PKGOROPQ.js} +40 -2
  74. package/dist/{chunk-3IWMNN2S.js → chunk-Q6D5QKRG.js} +17 -17
  75. package/dist/{chunk-JGCBMCCS.js → chunk-QECLJFHI.js} +12 -17
  76. package/dist/{chunk-KXKM2DFP.js → chunk-QJA33VD5.js} +4 -4
  77. package/dist/{chunk-YV7XVYSJ.js → chunk-R5XVJ6AN.js} +11 -11
  78. package/dist/{chunk-62PIU4TO.js → chunk-REZL4OM4.js} +1 -1
  79. package/dist/{chunk-NNDZ7DOP.js → chunk-RK5RBREN.js} +74 -107
  80. package/dist/chunk-RP5ZQTHO.js +86 -0
  81. package/dist/{chunk-HKRESBMC.js → chunk-RURPX2YV.js} +23 -23
  82. package/dist/chunk-TB5MGZLS.js +53 -0
  83. package/dist/chunk-TC63XRYP.js +27 -0
  84. package/dist/chunk-TJOYHAXJ.js +69 -0
  85. package/dist/{chunk-NZ7NSKIW.js → chunk-TRXKDCBP.js} +13 -13
  86. package/dist/{chunk-7WAQ3K26.js → chunk-TTK37D7R.js} +22 -23
  87. package/dist/{chunk-ALTHJUZO.js → chunk-UH3QHLR5.js} +2 -2
  88. package/dist/{chunk-6MZLS6CK.js → chunk-UNTJJ7GN.js} +7 -7
  89. package/dist/{chunk-XRLZ75YY.js → chunk-UPAFSETJ.js} +54 -59
  90. package/dist/{chunk-N2U644ZW.js → chunk-UX75PTQW.js} +50 -17
  91. package/dist/{chunk-EXHSWN3P.js → chunk-V353PYMK.js} +423 -233
  92. package/dist/{chunk-SL4G67AP.js → chunk-V4TFQY5G.js} +2 -2
  93. package/dist/{chunk-YOMLAKU6.js → chunk-VC3W54G3.js} +289 -138
  94. package/dist/{chunk-KSQJBGRO.js → chunk-VSBCJVPC.js} +5 -5
  95. package/dist/{chunk-EBXCYEII.js → chunk-WAQQGXVV.js} +3 -3
  96. package/dist/{chunk-7ORBRDFY.js → chunk-WLEVWR7Y.js} +2 -2
  97. package/dist/{chunk-Q4UQNTLB.js → chunk-WPMPVP5I.js} +4 -4
  98. package/dist/{chunk-TQKWR5AZ.js → chunk-WXNLFOC2.js} +7 -7
  99. package/dist/{chunk-HOWHAKXO.js → chunk-Y3ZNOZZS.js} +6 -6
  100. package/dist/{chunk-DNJJVKJZ.js → chunk-YL6JQTWC.js} +29 -32
  101. package/dist/{chunk-HUWW77QY.js → chunk-YVE5Q2UU.js} +86 -217
  102. package/dist/{chunk-25CAONWT.js → chunk-YZNARDMM.js} +12 -9
  103. package/dist/{chunk-HERQPNY6.js → chunk-ZDWNFZJ2.js} +8 -8
  104. package/dist/{chunk-MKQFSW2Q.js → chunk-ZEUF7BIN.js} +2 -2
  105. package/dist/{chunk-AB26NAHA.js → chunk-ZIF4WLWR.js} +45 -25
  106. package/dist/{chunk-6MWX2J5H.js → chunk-ZSPVF7KI.js} +227 -24
  107. package/dist/{chunk-QQGZY2BR.js → chunk-ZX6OKBVO.js} +2 -2
  108. package/dist/index.js +6455 -5243
  109. package/dist/mcp/analyze-cli.js +8 -8
  110. package/dist/mcp/cli.js +39 -41
  111. package/dist/mcp/server.js +870 -559
  112. package/dist/mcp/worker.js +68 -59
  113. package/dist/probes/installer.js +19 -20
  114. package/docs/configuration.md +24 -10
  115. package/docs/defect-shapes.md +18 -2
  116. package/docs/environment-variables.md +18 -9
  117. package/docs/globalconfig.md +16 -0
  118. package/docs/invariants/dispatch-runners.md +7 -0
  119. package/docs/invariants/lsp-trust-exec.md +33 -3
  120. package/docs/lsp-capability-matrix.md +23 -10
  121. package/docs/lsp-idle-eviction.md +8 -3
  122. package/docs/release-qa-baseline.md +22 -17
  123. package/docs/servercapabilities.md +1 -1
  124. package/docs/settings.md +9 -2
  125. package/docs/tools.md +1 -1
  126. package/package.json +3 -3
  127. package/dist/chunk-3UTDLQWO.js +0 -88
  128. package/dist/chunk-3Z7Z3B7V.js +0 -27
  129. package/dist/chunk-4E4OCW3L.js +0 -38
  130. package/dist/chunk-5HVDD7IA.js +0 -17
  131. package/dist/chunk-BKJ6WZKP.js +0 -255
  132. package/dist/chunk-D3UQWOCB.js +0 -46
  133. package/dist/chunk-EH6EHFW2.js +0 -73
  134. package/dist/chunk-J7VNGHLN.js +0 -69
  135. package/dist/chunk-L3Q72QGQ.js +0 -25
  136. package/dist/chunk-TFSBHRL2.js +0 -25
  137. package/dist/chunk-UWBD3JMH.js +0 -56
  138. package/dist/chunk-XWWFESYZ.js +0 -27
  139. package/dist/chunk-XZSXSM4K.js +0 -27
@@ -7,17 +7,17 @@ import {
7
7
  loadCallGraph,
8
8
  parseSymbolKey,
9
9
  saveCallGraph
10
- } from "./chunk-MKW7ZUTT.js";
10
+ } from "./chunk-5Z4XLUFF.js";
11
11
  import "./chunk-3MED75HT.js";
12
- import "./chunk-M3QGXGY4.js";
13
- import "./chunk-N2U644ZW.js";
14
- import "./chunk-DLGJYQML.js";
15
- import "./chunk-EKQDQPX6.js";
16
- import "./chunk-P7EV5ISR.js";
12
+ import "./chunk-LURFD4HD.js";
13
+ import "./chunk-UX75PTQW.js";
14
+ import "./chunk-D2LFEA5U.js";
15
+ import "./chunk-463WN3VP.js";
16
+ import "./chunk-CQNXALZJ.js";
17
17
  import "./chunk-S26LC76R.js";
18
- import "./chunk-HUWW77QY.js";
18
+ import "./chunk-YVE5Q2UU.js";
19
19
  import "./chunk-LJDODBBZ.js";
20
- import "./chunk-6MWX2J5H.js";
20
+ import "./chunk-ZSPVF7KI.js";
21
21
  import "./chunk-NXL4FFQQ.js";
22
22
  export {
23
23
  CALL_GRAPH_CACHE_VERSION,
@@ -4,8 +4,8 @@ import {
4
4
  MAX_SESSION_FACT_RECORDS,
5
5
  getFactStoreEvictionReporter,
6
6
  setFactStoreEvictionReporter
7
- } from "./chunk-NHHS5T52.js";
8
- import "./chunk-6MWX2J5H.js";
7
+ } from "./chunk-HPKC55MA.js";
8
+ import "./chunk-ZSPVF7KI.js";
9
9
  import "./chunk-NXL4FFQQ.js";
10
10
  export {
11
11
  FactStore,
@@ -1,27 +1,28 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  parseJsonc
4
- } from "./chunk-H6DNTQ4V.js";
4
+ } from "./chunk-BG7KHGNX.js";
5
5
  import {
6
6
  resolveLanguage
7
- } from "./chunk-NAACKIKT.js";
7
+ } from "./chunk-HKPJTI47.js";
8
8
  import {
9
9
  extractTomlTableSection,
10
10
  hasTomlTable,
11
11
  parseTomlScalarString,
12
12
  parseTomlStringArray
13
- } from "./chunk-DKXIUGNA.js";
13
+ } from "./chunk-J2DAHH4T.js";
14
14
  import {
15
15
  getProjectTrustState
16
- } from "./chunk-EKQDQPX6.js";
16
+ } from "./chunk-463WN3VP.js";
17
17
  import {
18
18
  incrementDegradationCount,
19
19
  logExtension,
20
20
  recordDegradationOnce
21
- } from "./chunk-P7EV5ISR.js";
21
+ } from "./chunk-CQNXALZJ.js";
22
22
  import {
23
+ isTestMode,
23
24
  logLatency
24
- } from "./chunk-HUWW77QY.js";
25
+ } from "./chunk-YVE5Q2UU.js";
25
26
  import {
26
27
  UV_WORKSPACE_EXCLUDE_DIALECT,
27
28
  UV_WORKSPACE_MEMBERS_DIALECT,
@@ -29,7 +30,16 @@ import {
29
30
  realpathOrResolve,
30
31
  relativeInside,
31
32
  walkUpDirs
32
- } from "./chunk-6MWX2J5H.js";
33
+ } from "./chunk-ZSPVF7KI.js";
34
+
35
+ // dist/clients/scanner-temp-root.js
36
+ import * as os from "node:os";
37
+ function scannerReportParentDir() {
38
+ if (!isTestMode() && process.env.PI_LENS_TEST_SCANNER_HARNESS !== "1")
39
+ return os.tmpdir();
40
+ const override = process.env.PI_LENS_TEST_SCANNER_TMPDIR?.trim();
41
+ return override && override.length > 0 ? override : os.tmpdir();
42
+ }
33
43
 
34
44
  // dist/clients/bounded-telemetry.js
35
45
  var MAX_TRACKED_TURN_CAPS = 64;
@@ -105,8 +115,25 @@ function resetBoundedTelemetry() {
105
115
 
106
116
  // dist/clients/python-environment.js
107
117
  import { access, readFile } from "node:fs/promises";
108
- import os from "node:os";
109
- import path, { dirname, join } from "node:path";
118
+ import os2 from "node:os";
119
+ import path, { dirname, join as join2 } from "node:path";
120
+
121
+ // dist/clients/python-ambient-environment.js
122
+ import { join, posix, win32 } from "node:path";
123
+ var AMBIENT_ENVIRONMENT_VARIABLES = {
124
+ "uv-project-environment": "UV_PROJECT_ENVIRONMENT",
125
+ "virtual-env": "VIRTUAL_ENV",
126
+ conda: "CONDA_PREFIX"
127
+ };
128
+ var AMBIENT_PYTHON_ENVIRONMENT_VARIABLES = Object.values(AMBIENT_ENVIRONMENT_VARIABLES);
129
+ function hasAmbientPythonEnvironment(env = process.env) {
130
+ return AMBIENT_PYTHON_ENVIRONMENT_VARIABLES.some((name) => Boolean(env[name]));
131
+ }
132
+ function pythonEnvironmentBinDir(root, platform = process.platform) {
133
+ return join(root, platform === "win32" ? "Scripts" : "bin");
134
+ }
135
+
136
+ // dist/clients/python-environment.js
110
137
  var UV_WORKSPACE_TABLE = "tool\\.uv\\.workspace";
111
138
  async function findUvWorkspace(startDir, homeDir) {
112
139
  let walkStart;
@@ -163,15 +190,7 @@ var PROJECT_VENV_DIRS = [
163
190
  { dir: "venv", source: "project-venv" }
164
191
  ];
165
192
  var PROJECT_VENV_DIR_NAMES = PROJECT_VENV_DIRS.map((venv) => venv.dir);
166
- var AMBIENT_ENVIRONMENT_VARIABLES = {
167
- "uv-project-environment": "UV_PROJECT_ENVIRONMENT",
168
- "virtual-env": "VIRTUAL_ENV",
169
- conda: "CONDA_PREFIX"
170
- };
171
- function hasAmbientPythonEnvironment(env = process.env) {
172
- return Object.values(AMBIENT_ENVIRONMENT_VARIABLES).some((name) => Boolean(env[name]));
173
- }
174
- async function detectPythonEnvironment(projectRoot, homeDir = os.homedir(), options = {}) {
193
+ async function detectPythonEnvironment(projectRoot, homeDir = os2.homedir(), options = {}) {
175
194
  const root = realpathOrResolve(projectRoot);
176
195
  const uvWorkspace = await findUvWorkspace(root, homeDir);
177
196
  const isProjectRoot = uvWorkspace?.isStartDir === true;
@@ -224,7 +243,7 @@ async function detectPythonEnvironment(projectRoot, homeDir = os.homedir(), opti
224
243
  }
225
244
  continue;
226
245
  }
227
- const binDir = path.join(candidate.root, process.platform === "win32" ? "Scripts" : "bin");
246
+ const binDir = pythonEnvironmentBinDir(candidate.root);
228
247
  const pythonPath = path.join(binDir, process.platform === "win32" ? "python.exe" : "python");
229
248
  try {
230
249
  await access(pythonPath);
@@ -376,7 +395,7 @@ async function readRuffTier(dir, pyproject, pyprojectPath) {
376
395
  let configPath;
377
396
  let config;
378
397
  for (const name of [".ruff.toml", "ruff.toml"]) {
379
- const candidatePath = join(dir, name);
398
+ const candidatePath = join2(dir, name);
380
399
  config = await readDeclarationFile(candidatePath);
381
400
  if (config !== void 0) {
382
401
  configPath = candidatePath;
@@ -400,7 +419,7 @@ async function readRuffTier(dir, pyproject, pyprojectPath) {
400
419
  };
401
420
  }
402
421
  async function readPyrightTier(dir, pyproject, pyprojectPath) {
403
- const configPath = join(dir, "pyrightconfig.json");
422
+ const configPath = join2(dir, "pyrightconfig.json");
404
423
  const config = await readDeclarationFile(configPath);
405
424
  if (config !== void 0) {
406
425
  return {
@@ -430,7 +449,7 @@ function readRequiresPythonTier(pyproject, pyprojectPath) {
430
449
  };
431
450
  }
432
451
  async function readVersionFileTier(dir) {
433
- const levelFilePath = join(dir, ".python-version");
452
+ const levelFilePath = join2(dir, ".python-version");
434
453
  const content = await readDeclarationFile(levelFilePath);
435
454
  if (content === void 0)
436
455
  return { declaration: void 0, owned: false };
@@ -447,7 +466,7 @@ var PYTHON_DECLARATION_SOURCES = [
447
466
  "python-version-file"
448
467
  ];
449
468
  async function readPythonDeclarationInDirectory(dir, open) {
450
- const pyprojectPath = join(dir, "pyproject.toml");
469
+ const pyprojectPath = join2(dir, "pyproject.toml");
451
470
  const pyproject = await readDeclarationFile(pyprojectPath);
452
471
  const tiers = [
453
472
  ["ruff-target-version", () => readRuffTier(dir, pyproject, pyprojectPath)],
@@ -473,7 +492,7 @@ async function readPythonDeclarationInDirectory(dir, open) {
473
492
  }
474
493
  return { declaration: void 0, closed };
475
494
  }
476
- async function detectPythonTargetVersion(filePath, homeDir = os.homedir()) {
495
+ async function detectPythonTargetVersion(filePath, homeDir = os2.homedir()) {
477
496
  if (resolveLanguage(filePath)?.id !== "python")
478
497
  return void 0;
479
498
  const open = new Set(PYTHON_DECLARATION_SOURCES);
@@ -492,10 +511,11 @@ async function detectPythonTargetVersion(filePath, homeDir = os.homedir()) {
492
511
  }
493
512
 
494
513
  export {
514
+ scannerReportParentDir,
495
515
  emitBounded,
496
516
  resetBoundedTelemetry,
497
- PROJECT_VENV_DIR_NAMES,
498
517
  hasAmbientPythonEnvironment,
518
+ PROJECT_VENV_DIR_NAMES,
499
519
  detectPythonEnvironment,
500
520
  augmentPythonEnvironment,
501
521
  pythonEnvironmentToolCandidates,
@@ -1280,14 +1280,22 @@ var assertValidPattern = (pattern) => {
1280
1280
 
1281
1281
  // node_modules/minimatch/dist/esm/escape.js
1282
1282
  var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
1283
- if (magicalBraces) {
1284
- return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
1283
+ const e = magicalBraces ? windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&") : windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
1284
+ const c = e.charAt(0);
1285
+ if (c === "#") {
1286
+ return (windowsPathsNoEscape ? "[#]" : "\\#") + e.slice(1);
1287
+ }
1288
+ if (c === "!") {
1289
+ return (windowsPathsNoEscape ? "@(!)" : "\\!") + e.slice(1);
1285
1290
  }
1286
- return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
1291
+ return e;
1287
1292
  };
1288
1293
 
1289
1294
  // node_modules/minimatch/dist/esm/unescape.js
1290
1295
  var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
1296
+ if (windowsPathsNoEscape && s.startsWith("@(!)")) {
1297
+ return "!" + unescape(s.slice(4), { windowsPathsNoEscape, magicalBraces });
1298
+ }
1291
1299
  if (magicalBraces) {
1292
1300
  return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
1293
1301
  }
@@ -1295,27 +1303,131 @@ var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {})
1295
1303
  };
1296
1304
 
1297
1305
  // node_modules/minimatch/dist/esm/index.js
1298
- var minimatch = (p, pattern, options = {}) => {
1306
+ var DEFAULT_BRACE_EXPAND_MAX = 1e5;
1307
+ var DEFAULT_GLOB_STAR_RECURSION_MAX = 200;
1308
+ var AWE_KEY = "allowWindowsEscape";
1309
+ var minimatch = (p, pattern, options) => {
1299
1310
  assertValidPattern(pattern);
1300
- if (!options.nocomment && pattern.charAt(0) === "#") {
1311
+ if (!options?.nocomment && pattern.charAt(0) === "#") {
1301
1312
  return false;
1302
1313
  }
1303
1314
  return cachedMinimatch(pattern, options).match(p);
1304
1315
  };
1305
1316
  var cache = /* @__PURE__ */ new Map();
1317
+ var oldCache = /* @__PURE__ */ new Map();
1318
+ var cacheSize = 0;
1319
+ var cacheTotalWeight = 0;
1306
1320
  var cacheMax = 256;
1307
- var cachedMinimatch = (pattern, options) => {
1308
- const key = pattern + "\0" + JSON.stringify(options);
1309
- let mm = cache.get(key);
1310
- if (mm) {
1311
- cache.delete(key);
1312
- } else {
1313
- mm = new Minimatch(pattern, { ...options });
1314
- if (cache.size >= cacheMax) {
1315
- cache.delete(cache.keys().next().value);
1321
+ var cacheMaxWeight = 1 << 15;
1322
+ var cacheMaxEntryWeight = 1 << 12;
1323
+ var cacheWeight = (mm) => {
1324
+ let w = mm.pattern.length;
1325
+ for (const s of mm.globSet) {
1326
+ w += s.length + 1;
1327
+ if (w > cacheMaxEntryWeight)
1328
+ break;
1329
+ }
1330
+ return w;
1331
+ };
1332
+ var tri = (v) => v === void 0 ? 0 : v ? 2 : 1;
1333
+ var booleanWeights = new Map(Object.keys({
1334
+ nobrace: 0,
1335
+ nocomment: 0,
1336
+ nonegate: 0,
1337
+ noglobstar: 0,
1338
+ noext: 0,
1339
+ nonull: 0,
1340
+ partial: 0,
1341
+ dot: 0,
1342
+ nocase: 0,
1343
+ nocaseMagicOnly: 0,
1344
+ magicalBraces: 0,
1345
+ matchBase: 0,
1346
+ flipNegate: 0,
1347
+ preserveMultipleSlashes: 0,
1348
+ windowsNoMagicRoot: 0
1349
+ }).map((k, i) => [k, 24 * 3 ** i]));
1350
+ var optionsKey = (o) => {
1351
+ let n = 0;
1352
+ let wpe = false;
1353
+ for (const k in o) {
1354
+ const v = o[k];
1355
+ switch (k) {
1356
+ // the same test as the Minimatch constructor
1357
+ case "windowsPathsNoEscape":
1358
+ if (v)
1359
+ wpe = true;
1360
+ break;
1361
+ case AWE_KEY:
1362
+ if (v === false)
1363
+ wpe = true;
1364
+ break;
1365
+ case "platform": {
1366
+ const p = v || defaultPlatform;
1367
+ if (p === defaultPlatform)
1368
+ break;
1369
+ if (p === "darwin")
1370
+ n += 3;
1371
+ else if (p === "win32")
1372
+ n += 6;
1373
+ else if (p === "linux")
1374
+ n += 9;
1375
+ else
1376
+ return JSON.stringify(o);
1377
+ break;
1378
+ }
1379
+ case "optimizationLevel":
1380
+ if (v === void 0)
1381
+ break;
1382
+ n += v >= 2 ? 1 : v >= 1 ? 0 : 2;
1383
+ break;
1384
+ case "braceExpandMax":
1385
+ if (v !== void 0 && v !== DEFAULT_BRACE_EXPAND_MAX) {
1386
+ return JSON.stringify(o);
1387
+ }
1388
+ break;
1389
+ case "maxGlobstarRecursion":
1390
+ if (v !== void 0 && v !== DEFAULT_GLOB_STAR_RECURSION_MAX) {
1391
+ return JSON.stringify(o);
1392
+ }
1393
+ break;
1394
+ case "normalize":
1395
+ if (v !== void 0)
1396
+ return JSON.stringify(o);
1397
+ break;
1398
+ default:
1399
+ n += (booleanWeights.get(k) ?? 0) * tri(v);
1316
1400
  }
1317
1401
  }
1318
- cache.set(key, mm);
1402
+ return wpe ? n + 12 : n;
1403
+ };
1404
+ var copyOptions = (o) => {
1405
+ const copy = {};
1406
+ for (const k in o)
1407
+ copy[k] = o[k];
1408
+ return copy;
1409
+ };
1410
+ var cachedMinimatch = (pattern, options) => {
1411
+ const key = options ? optionsKey(options) : 0;
1412
+ let mm = cache.get(key)?.get(pattern);
1413
+ if (mm)
1414
+ return mm;
1415
+ mm = oldCache.get(key)?.get(pattern) ?? new Minimatch(pattern, copyOptions(options));
1416
+ const weight = cacheWeight(mm);
1417
+ if (weight > cacheMaxEntryWeight)
1418
+ return mm;
1419
+ if (cacheSize >= cacheMax || cacheTotalWeight + weight > cacheMaxWeight) {
1420
+ oldCache = cache;
1421
+ cache = /* @__PURE__ */ new Map();
1422
+ cacheSize = 0;
1423
+ cacheTotalWeight = 0;
1424
+ }
1425
+ let byPattern = cache.get(key);
1426
+ if (!byPattern)
1427
+ cache.set(key, byPattern = /* @__PURE__ */ new Map());
1428
+ byPattern.set(pattern, mm);
1429
+ cacheSize++;
1430
+ cacheTotalWeight += weight;
1319
1431
  return mm;
1320
1432
  };
1321
1433
  var defaultPlatform = typeof process === "object" && process ? process.env?.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
@@ -1327,7 +1439,10 @@ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
1327
1439
  minimatch.sep = sep;
1328
1440
  var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
1329
1441
  minimatch.GLOBSTAR = GLOBSTAR;
1330
- var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
1442
+ var filter = (pattern, options) => {
1443
+ let mm;
1444
+ return (p) => (mm ??= cachedMinimatch(pattern, options)).match(p);
1445
+ };
1331
1446
  minimatch.filter = filter;
1332
1447
  var ext = (a, b = {}) => Object.assign({}, a, b);
1333
1448
  var defaults = (def) => {
@@ -1361,7 +1476,11 @@ var braceExpand = (pattern, options = {}) => {
1361
1476
  if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
1362
1477
  return [pattern];
1363
1478
  }
1364
- return expand(pattern, { max: options.braceExpandMax });
1479
+ let p = pattern.replace(/\\\\/g, "\\\\\\\\");
1480
+ if (options.windowsPathsNoEscape || options[AWE_KEY] === false) {
1481
+ p = p.replace(/\[([{}])\]/g, "[\\$1]");
1482
+ }
1483
+ return expand(p, { max: options.braceExpandMax });
1365
1484
  };
1366
1485
  minimatch.braceExpand = braceExpand;
1367
1486
  var RANGE_MIN = 100;
@@ -1423,6 +1542,25 @@ var literal = (pattern, noext) => {
1423
1542
  }
1424
1543
  return lit2;
1425
1544
  };
1545
+ var MAX_EXTGLOBS = 256;
1546
+ var extglobCount = (pattern) => {
1547
+ let n = 0;
1548
+ for (let i = 0; i < pattern.length - 1; i++) {
1549
+ const c = pattern.charAt(i);
1550
+ if (c === "\\") {
1551
+ i++;
1552
+ } else if ("+@!?*".includes(c) && pattern.charAt(i + 1) === "(") {
1553
+ n++;
1554
+ i++;
1555
+ }
1556
+ }
1557
+ return n;
1558
+ };
1559
+ var assertValidExtglobs = (pattern) => {
1560
+ if (extglobCount(pattern) > MAX_EXTGLOBS) {
1561
+ throw new TypeError("pattern has too many extglobs");
1562
+ }
1563
+ };
1426
1564
  var extSafe = (pattern) => {
1427
1565
  if (/^[?*+@]\(\)$/.test(pattern) || pattern.includes("[:"))
1428
1566
  return false;
@@ -1537,12 +1675,11 @@ var Minimatch = class {
1537
1675
  assertValidPattern(pattern);
1538
1676
  options = options || {};
1539
1677
  this.options = options;
1540
- this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
1678
+ this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? DEFAULT_GLOB_STAR_RECURSION_MAX;
1541
1679
  this.pattern = pattern;
1542
1680
  this.platform = options.platform || defaultPlatform;
1543
1681
  this.isWindows = this.platform === "win32";
1544
- const awe = "allowWindowsEscape";
1545
- this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false;
1682
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[AWE_KEY] === false;
1546
1683
  if (this.windowsPathsNoEscape) {
1547
1684
  this.pattern = this.pattern.replace(/\\/g, "/");
1548
1685
  }
@@ -1687,16 +1824,19 @@ var Minimatch = class {
1687
1824
  let merged = true;
1688
1825
  while (merged) {
1689
1826
  merged = false;
1827
+ if (this.set.length < 2)
1828
+ return;
1829
+ let keys = this.#mergeKeys();
1690
1830
  const len = Math.max(0, ...this.set.map((r) => r.length));
1691
1831
  for (let k = 0; k < len; k++) {
1692
1832
  const groups = /* @__PURE__ */ new Map();
1833
+ const R = this.set.length + 1;
1693
1834
  this.set.forEach((row, i) => {
1694
1835
  if (!(row[k] instanceof Matcher || row[k] === PENDING) || !extSafe(this.globParts[i][k])) {
1695
1836
  return;
1696
1837
  }
1697
- const parts = [...this.globParts[i]];
1698
- parts[k] = "";
1699
- const key = `${row.length}/${parts.join("/")}`;
1838
+ const { pre, suf } = keys[i];
1839
+ const key = pre[k] * R + suf[k + 1];
1700
1840
  const g = groups.get(key);
1701
1841
  if (g)
1702
1842
  g.push(i);
@@ -1710,6 +1850,8 @@ var Minimatch = class {
1710
1850
  const [first, ...rest] = g;
1711
1851
  const alts = g.map((i) => this.globParts[i][k]);
1712
1852
  const glob = `@(${alts.join("|")})`;
1853
+ if (extglobCount(glob) > MAX_EXTGLOBS)
1854
+ continue;
1713
1855
  this.globParts[first][k] = glob;
1714
1856
  this.set[first][k] = this.parse(glob);
1715
1857
  for (const i of rest)
@@ -1719,10 +1861,60 @@ var Minimatch = class {
1719
1861
  merged = true;
1720
1862
  this.set = this.set.filter((_, i) => !drop.has(i));
1721
1863
  this.globParts = this.globParts.filter((_, i) => !drop.has(i));
1864
+ if (this.set.length < 2)
1865
+ return;
1866
+ keys = this.#mergeKeys();
1722
1867
  }
1723
1868
  }
1724
1869
  }
1725
1870
  }
1871
+ // For each row, number ids for its prefixes and suffixes, such that
1872
+ // pre[k] identifies parts[0..k) and suf[k] identifies parts[k..n).
1873
+ // Two rows are the same other than at portion k exactly when they
1874
+ // have the same pre[k] and suf[k + 1]. This is linear in the size of
1875
+ // the rows, where joining the whole row for every k was quadratic.
1876
+ #mergeKeys() {
1877
+ const partIds = /* @__PURE__ */ new Map();
1878
+ const ids = this.globParts.map((parts) => parts.map((s) => {
1879
+ let id = partIds.get(s);
1880
+ if (id === void 0)
1881
+ partIds.set(s, id = partIds.size);
1882
+ return id;
1883
+ }));
1884
+ const P = partIds.size;
1885
+ const len = Math.max(0, ...ids.map((r) => r.length));
1886
+ const keys = ids.map((r) => ({
1887
+ pre: [0],
1888
+ suf: new Array(r.length + 1).fill(0)
1889
+ }));
1890
+ for (let k = 0; k < len; k++) {
1891
+ const m = /* @__PURE__ */ new Map();
1892
+ ids.forEach((r, i) => {
1893
+ if (k >= r.length)
1894
+ return;
1895
+ const { pre } = keys[i];
1896
+ const key = pre[k] * P + r[k];
1897
+ let id = m.get(key);
1898
+ if (id === void 0)
1899
+ m.set(key, id = m.size + 1);
1900
+ pre.push(id);
1901
+ });
1902
+ }
1903
+ for (let k = len - 1; k >= 0; k--) {
1904
+ const m = /* @__PURE__ */ new Map();
1905
+ ids.forEach((r, i) => {
1906
+ if (k >= r.length)
1907
+ return;
1908
+ const { suf } = keys[i];
1909
+ const key = suf[k + 1] * P + r[k];
1910
+ let id = m.get(key);
1911
+ if (id === void 0)
1912
+ m.set(key, id = m.size + 1);
1913
+ suf[k] = id;
1914
+ });
1915
+ }
1916
+ return keys;
1917
+ }
1726
1918
  // various transforms to equivalent pattern sets that are
1727
1919
  // faster to process in a filesystem walk. The goal is to
1728
1920
  // eliminate what we can, and push all ** patterns as far
@@ -2019,7 +2211,7 @@ var Minimatch = class {
2019
2211
  // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
2020
2212
  // this WOULD be allowed if ** did follow symlinks, or * didn't
2021
2213
  firstPhasePreProcess(globParts) {
2022
- const { braceExpandMax = 1e5 } = this.options;
2214
+ const { braceExpandMax = DEFAULT_BRACE_EXPAND_MAX } = this.options;
2023
2215
  let splitCells = 0;
2024
2216
  const maxSplitCells = 1e6;
2025
2217
  let didSomething = false;
@@ -2401,6 +2593,8 @@ var Minimatch = class {
2401
2593
  return PENDING;
2402
2594
  let m = this.#matchers.get(pattern);
2403
2595
  if (!m) {
2596
+ if (!noext)
2597
+ assertValidExtglobs(pattern);
2404
2598
  m = new Matcher(pattern, {
2405
2599
  nocase,
2406
2600
  noext,
@@ -2865,13 +3059,22 @@ function homeRelativePath(filePath, homeDir = os.homedir()) {
2865
3059
  return `~${candidate.slice(home.length)}`;
2866
3060
  }
2867
3061
  function isUnderDir(child, parent) {
3062
+ if (backslashIsNameChar(child, parent)) {
3063
+ return isWithinForm(path2.resolve(child), path2.resolve(parent)) || isWithinIdentity(child, parent);
3064
+ }
2868
3065
  if (isWithinForm(normalizePathSpelling(child), normalizePathSpelling(parent)))
2869
3066
  return true;
2870
3067
  if (process.platform === "win32")
2871
3068
  return false;
2872
3069
  return isWithinIdentity(child, parent);
2873
3070
  }
3071
+ function backslashIsNameChar(child, parent) {
3072
+ return process.platform !== "win32" && (child.includes("\\") || parent.includes("\\")) && !isWindowsPath(child) && !isWindowsPath(parent);
3073
+ }
2874
3074
  function isWithinIdentity(child, parent) {
3075
+ if (backslashIsNameChar(child, parent)) {
3076
+ return isWithinForm(realpathOrResolve(child), realpathOrResolve(parent));
3077
+ }
2875
3078
  return isWithinForm(normalizeFilePath(child), normalizeFilePath(parent));
2876
3079
  }
2877
3080
  function isWithinForm(child, parent) {
@@ -6,12 +6,12 @@ import {
6
6
  } from "./chunk-2APSZHHI.js";
7
7
  import {
8
8
  truncatedByOutputCap
9
- } from "./chunk-EKQDQPX6.js";
9
+ } from "./chunk-463WN3VP.js";
10
10
  import {
11
11
  LEDGER_FIELD_MAX,
12
12
  incrementDegradationCount,
13
13
  truncateForLedger
14
- } from "./chunk-P7EV5ISR.js";
14
+ } from "./chunk-CQNXALZJ.js";
15
15
 
16
16
  // dist/clients/dispatch/runners/utils/spawn-outcome.js
17
17
  function firstOutputLine(text, max = LEDGER_FIELD_MAX) {