@cortexkit/opencode-magic-context 0.49.0 → 0.49.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 (195) hide show
  1. package/dist/{announcement-fp14dw0n.js → announcement-hdbkt8v5.js} +1 -1
  2. package/dist/auto-search-worker.js +3 -3
  3. package/dist/config/{mural-model-deprecation.d.ts → deprecated-config.d.ts} +4 -1
  4. package/dist/config/deprecated-config.d.ts.map +1 -0
  5. package/dist/config/index.d.ts.map +1 -1
  6. package/dist/config/project-security.d.ts +2 -2
  7. package/dist/config/schema/magic-context.d.ts +4 -4
  8. package/dist/config/schema/magic-context.d.ts.map +1 -1
  9. package/dist/{conflict-warning-hook-kzx4dmk1.js → conflict-warning-hook-asnt6hfc.js} +3 -3
  10. package/dist/{context-nj5f293n.js → context-tfyhtdcs.js} +111 -45
  11. package/dist/{derive-budgets-qz5rrr08.js → derive-budgets-j4ry8j8n.js} +1 -1
  12. package/dist/{embedding-backfill-aetxv1vt.js → embedding-backfill-wyc3ykyf.js} +7 -7
  13. package/dist/embedding-worker-process.js +30 -0
  14. package/dist/embedding-worker.js +5 -5
  15. package/dist/features/magic-context/dreamer/task-registry.d.ts +2 -3
  16. package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
  17. package/dist/features/magic-context/memory/embedding-worker-client.d.ts +8 -1
  18. package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
  19. package/dist/features/magic-context/memory/embedding-worker-process.d.ts +2 -0
  20. package/dist/features/magic-context/memory/embedding-worker-process.d.ts.map +1 -0
  21. package/dist/features/magic-context/memory/onnx-telemetry.d.ts +3 -0
  22. package/dist/features/magic-context/memory/onnx-telemetry.d.ts.map +1 -0
  23. package/dist/features/magic-context/overflow-detection.d.ts +1 -2
  24. package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
  25. package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
  26. package/dist/features/magic-context/transform-decision-log.d.ts +1 -1
  27. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  28. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +1 -0
  29. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
  30. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  31. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +1 -0
  32. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
  33. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  34. package/dist/hooks/magic-context/hook.d.ts +1 -0
  35. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  36. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  37. package/dist/hooks/magic-context/lkg-measured-request.d.ts +3 -1
  38. package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
  39. package/dist/hooks/magic-context/lkg-persist.d.ts +8 -14
  40. package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
  41. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +62 -0
  42. package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -0
  43. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts +38 -0
  44. package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts.map +1 -0
  45. package/dist/hooks/magic-context/lkg-replay.d.ts +3 -1
  46. package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
  47. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  48. package/dist/hooks/magic-context/opaque-thinking.d.ts +12 -0
  49. package/dist/hooks/magic-context/opaque-thinking.d.ts.map +1 -0
  50. package/dist/hooks/magic-context/pass-outcome.d.ts +2 -2
  51. package/dist/hooks/magic-context/pending-materialization.d.ts +8 -0
  52. package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -0
  53. package/dist/hooks/magic-context/read-session-db.d.ts +3 -0
  54. package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
  55. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  56. package/dist/hooks/magic-context/rust-mode-transform.d.ts +1 -0
  57. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  58. package/dist/hooks/magic-context/strip-content.d.ts +5 -2
  59. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  60. package/dist/hooks/magic-context/system-date-refresh.d.ts +29 -0
  61. package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -0
  62. package/dist/hooks/magic-context/system-prompt-dates.d.ts +6 -0
  63. package/dist/hooks/magic-context/system-prompt-dates.d.ts.map +1 -0
  64. package/dist/hooks/magic-context/system-prompt-delivery.d.ts +47 -0
  65. package/dist/hooks/magic-context/system-prompt-delivery.d.ts.map +1 -0
  66. package/dist/hooks/magic-context/system-prompt-hash.d.ts +4 -0
  67. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  68. package/dist/hooks/magic-context/tag-messages.d.ts +8 -0
  69. package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
  70. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +2 -0
  71. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  72. package/dist/hooks/magic-context/transform.d.ts +6 -0
  73. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  74. package/dist/{index-9qjqq45k.js → index-0pjvpfkf.js} +21 -1
  75. package/dist/index-6m7rdv7y.js +733 -0
  76. package/dist/{index-1r0k9js3.js → index-6tfxmc4n.js} +10 -10
  77. package/dist/{index-gzcmtmar.js → index-7w18gg78.js} +25 -1
  78. package/dist/{index-nm6a8xpd.js → index-att4bfan.js} +1 -1
  79. package/dist/{index-ezmszwbd.js → index-eypn4ba6.js} +7 -4
  80. package/dist/{index-ha87j7a8.js → index-fdtkt5r1.js} +6 -6
  81. package/dist/{index-kp5qe690.js → index-fg00p1cg.js} +38 -36
  82. package/dist/{index-1bc61ans.js → index-fvnzcnww.js} +44 -1
  83. package/dist/index-gbmqa9x9.js +1170 -0
  84. package/dist/{index-pxwp2hjk.js → index-gzky5rva.js} +30 -53
  85. package/dist/{index-kq57tdf0.js → index-k6xvbj2e.js} +255 -1075
  86. package/dist/{index-0w56v4fm.js → index-mw7c950g.js} +1 -1
  87. package/dist/{index-1g30axtz.js → index-p0n5ryq8.js} +82 -900
  88. package/dist/{index-b7mv1jx3.js → index-p1hnwfd8.js} +1 -1
  89. package/dist/{index-peshmj6h.js → index-r2zcs71c.js} +6 -4
  90. package/dist/{index-kmpvemph.js → index-rafsaxac.js} +2 -2
  91. package/dist/{index-stbr4ce6.js → index-s7fc0fkn.js} +1 -1
  92. package/dist/{index-hj2q50k0.js → index-sfhndpcb.js} +463 -6
  93. package/dist/index-sv0bb7vg.js +6972 -0
  94. package/dist/{index-57mrqed8.js → index-w23dh319.js} +17 -258
  95. package/dist/{index-9rt53q79.js → index-xgrwmj82.js} +1 -1
  96. package/dist/{index-h2py7207.js → index-xnanvj3w.js} +765 -1255
  97. package/dist/{index-2jcbj7r1.js → index-zfzdpeq2.js} +2269 -3802
  98. package/dist/{index-s4j7t92z.js → index-zg8yq4ya.js} +29 -744
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +209 -61
  101. package/dist/{message-index-bounded-h0mrd4pr.js → message-index-bounded-hqktkhdy.js} +7 -6
  102. package/dist/migration-worker.js +6 -5
  103. package/dist/plugin/hooks/create-session-hooks.d.ts +3 -1
  104. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  105. package/dist/plugin/messages-transform.d.ts.map +1 -1
  106. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  107. package/dist/{project-embedding-registry-rtt0djyb.js → project-embedding-registry-0gv3h6y8.js} +6 -6
  108. package/dist/raw-ordinal-warmup-worker.js +1 -1
  109. package/dist/{read-session-chunk-ty89v75e.js → read-session-chunk-5mh0bh8y.js} +5 -4
  110. package/dist/{recomp-orchestrator-4f1yyd1q.js → recomp-orchestrator-kpkhkjhq.js} +20 -19
  111. package/dist/{search-pz4f4wge.js → search-p9w39qv4.js} +15 -14
  112. package/dist/{send-session-notification-38cd5dqt.js → send-session-notification-xffh3bbe.js} +2 -2
  113. package/dist/shared/models-dev-cache.d.ts.map +1 -1
  114. package/dist/shared/storage-file-mutex.d.ts +9 -0
  115. package/dist/shared/storage-file-mutex.d.ts.map +1 -0
  116. package/dist/shared/storage-permissions.d.ts +6 -0
  117. package/dist/shared/storage-permissions.d.ts.map +1 -1
  118. package/dist/shared/window-geometry.d.ts +9 -66
  119. package/dist/shared/window-geometry.d.ts.map +1 -1
  120. package/dist/standalone-plugin-marker.d.ts +8 -0
  121. package/dist/standalone-plugin-marker.d.ts.map +1 -0
  122. package/dist/tools/ctx-reduce/constants.d.ts +1 -2
  123. package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
  124. package/dist/tools/ctx-reduce/tools.d.ts +1 -1
  125. package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
  126. package/dist/{transform-postprocess-phase-tck4g20s.js → transform-postprocess-phase-481j5a7z.js} +20 -19
  127. package/dist/v2/auto-search-worker.js +3 -3
  128. package/dist/v2/{context-crbt6p1y.js → context-gsdtha5v.js} +873 -2122
  129. package/dist/v2/{derive-budgets-fgej9j46.js → derive-budgets-enckmg7y.js} +2 -2
  130. package/dist/v2/{embedding-backfill-ph1qfyn3.js → embedding-backfill-dbvjbcmm.js} +8 -9
  131. package/dist/v2/embedding-worker-process.js +29 -0
  132. package/dist/v2/embedding-worker.js +3 -4
  133. package/dist/v2/hooks/context.d.ts.map +1 -1
  134. package/dist/v2/hooks/copied-tag-notation.d.ts +19 -0
  135. package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -0
  136. package/dist/v2/hooks/payload.d.ts.map +1 -1
  137. package/dist/v2/hooks/system-prompt-response.d.ts +5 -0
  138. package/dist/v2/hooks/system-prompt-response.d.ts.map +1 -0
  139. package/dist/v2/{message-index-bounded-xwqdywxg.js → message-index-bounded-p6v0n8qh.js} +8 -7
  140. package/dist/v2/migration-worker.js +6 -5
  141. package/dist/v2/{project-embedding-registry-d6m7tyxr.js → project-embedding-registry-nyq7z8y6.js} +7 -8
  142. package/dist/v2/raw-ordinal-warmup-worker.js +2 -2
  143. package/dist/v2/{read-session-chunk-8p5mdryx.js → read-session-chunk-fhyfe4qa.js} +6 -5
  144. package/dist/v2/{recomp-orchestrator-ckfgt6wq.js → recomp-orchestrator-5xy7w136.js} +22 -22
  145. package/dist/v2/{search-ym8rehhz.js → search-j7bakcwa.js} +17 -17
  146. package/dist/v2/{send-session-notification-5m0yapqx.js → send-session-notification-f6v698r5.js} +2 -2
  147. package/dist/v2/{server-jvxzm1jy.js → server-1fszbabv.js} +28 -28
  148. package/dist/v2/{server-3j4d00kf.js → server-2htmbqbv.js} +25 -1
  149. package/dist/v2/{server-c5rrgrcd.js → server-4c7jt8gq.js} +25 -1
  150. package/dist/v2/{server-ycw9qqcy.js → server-4enr7s6x.js} +1 -1
  151. package/dist/v2/{server-v4mewb78.js → server-6tcrjfw8.js} +1 -1
  152. package/dist/v2/{server-x4hscabv.js → server-7spkq1y6.js} +2257 -3746
  153. package/dist/v2/{server-sa8jvrfc.js → server-7vkj6zhb.js} +29 -744
  154. package/dist/v2/{server-xwz4dqh9.js → server-8xmq9h3f.js} +30 -53
  155. package/dist/v2/{server-1tk82krw.js → server-bgzy0phk.js} +463 -6
  156. package/dist/v2/server-c7n2ftng.js +6860 -0
  157. package/dist/v2/server-cvgn49tr.js +733 -0
  158. package/dist/v2/{server-zm570tr2.js → server-cw6521wn.js} +232 -7
  159. package/dist/v2/{server-pj4pjv02.js → server-czb2rkpk.js} +21 -1
  160. package/dist/v2/{server-19zjmn02.js → server-d6g4whc2.js} +20 -14
  161. package/dist/v2/{server-1bc61ans.js → server-fvnzcnww.js} +44 -1
  162. package/dist/v2/{server-w32kmdez.js → server-kh958yj8.js} +3 -3
  163. package/dist/v2/{server-q4ph9bwn.js → server-mqvtz7wz.js} +7 -7
  164. package/dist/v2/{server-2s6ayq3t.js → server-ras2sxnc.js} +133 -13
  165. package/dist/v2/{server-ss95ky04.js → server-s2st631p.js} +1 -1
  166. package/dist/v2/{server-2s9qz6n7.js → server-t528t8qm.js} +1 -1
  167. package/dist/v2/{server-8k2agx29.js → server-vb7pbd9p.js} +17 -258
  168. package/dist/v2/{server-zp53y8js.js → server-zbxjj2mz.js} +2 -2
  169. package/dist/v2/server.d.ts.map +1 -1
  170. package/dist/v2/server.js +149 -5
  171. package/dist/v2/{storage-tags-8vw924zn.js → storage-tags-5yxrvkaf.js} +1 -1
  172. package/dist/v2/{wrapup-orchestrator-a7efxaax.js → wrapup-orchestrator-yem5422s.js} +28 -28
  173. package/dist/{wrapup-orchestrator-barbc6h9.js → wrapup-orchestrator-xvrr27ws.js} +21 -20
  174. package/package.json +4 -4
  175. package/src/config/{mural-model-deprecation.ts → deprecated-config.ts} +19 -0
  176. package/src/config/index.test.ts +15 -37
  177. package/src/config/index.ts +2 -3
  178. package/src/config/project-security.ts +3 -3
  179. package/src/config/schema/magic-context.ts +11 -7
  180. package/src/features/magic-context/dreamer/task-registry.ts +2 -3
  181. package/src/shared/models-dev-cache.ts +1 -7
  182. package/src/shared/sqlite-640-review.test.ts +5 -1
  183. package/src/shared/storage-file-mutex-review.test.ts +162 -0
  184. package/src/shared/storage-file-mutex.ts +130 -0
  185. package/src/shared/storage-permissions.ts +46 -0
  186. package/src/shared/window-geometry.test.ts +102 -236
  187. package/src/shared/window-geometry.ts +23 -413
  188. package/dist/config/mural-model-deprecation.d.ts.map +0 -1
  189. package/dist/index-2jgwttpt.js +0 -3269
  190. package/dist/index-mfkzp7qj.js +0 -229
  191. package/dist/v2/server-4ez8mntn.js +0 -3213
  192. package/dist/v2/server-mfkzp7qj.js +0 -229
  193. package/src/shared/__fixtures__/window-overlay.v1.json +0 -337
  194. /package/dist/{index-2pp04pmg.js → index-69vas84q.js} +0 -0
  195. /package/dist/v2/{index-2pp04pmg.js → index-69vas84q.js} +0 -0
@@ -2,50 +2,27 @@ import {
2
2
  getMagicContextStorageDir,
3
3
  log2
4
4
  } from "./server-t4k4qexw.js";
5
+ import {
6
+ projectDirectoryKey
7
+ } from "./server-2htmbqbv.js";
5
8
  import {
6
9
  writeStorageFileAtomicSync
7
- } from "./server-1bc61ans.js";
10
+ } from "./server-fvnzcnww.js";
8
11
 
9
12
  // src/features/magic-context/memory/project-identity.ts
10
13
  import { execFileSync } from "node:child_process";
11
14
  import { createHash as createHash2 } from "node:crypto";
12
- import { existsSync, realpathSync as realpathSync2, statSync } from "node:fs";
15
+ import { existsSync, realpathSync, statSync } from "node:fs";
13
16
  import { homedir } from "node:os";
14
- import path3 from "node:path";
17
+ import path2 from "node:path";
15
18
 
16
19
  // src/features/magic-context/memory/project-identity-cache.ts
17
20
  import { createHash } from "node:crypto";
18
21
  import { readFileSync } from "node:fs";
19
- import path2 from "node:path";
20
-
21
- // src/shared/project-directory-key.ts
22
- import { realpathSync } from "node:fs";
23
22
  import path from "node:path";
24
- function projectDirectoryKey(directory) {
25
- const slashed = directory.replaceAll("\\", "/").replace(/^\/\/\?\/UNC\//i, "//").replace(/^\/\/\?\//, "");
26
- if (/^[a-z]:\//i.test(slashed) || slashed.startsWith("//")) {
27
- return path.win32.normalize(slashed).replaceAll("\\", "/").replace(/\/$/, "").toLowerCase();
28
- }
29
- return path.resolve(directory);
30
- }
31
- function sameProjectDirectory(a, b) {
32
- if (a.length === 0 || b.length === 0)
33
- return false;
34
- return projectDirectoryKey(a) === projectDirectoryKey(b);
35
- }
36
- var realpathForCanonicalDirectory = (directory) => realpathSync.native(directory);
37
- function canonicalProjectDirectory(directory) {
38
- let resolved = directory;
39
- try {
40
- resolved = realpathForCanonicalDirectory(directory);
41
- } catch {}
42
- return projectDirectoryKey(resolved);
43
- }
44
-
45
- // src/features/magic-context/memory/project-identity-cache.ts
46
23
  function cachePath(directory, storageDir = getMagicContextStorageDir()) {
47
24
  const hash = createHash("sha256").update(projectDirectoryKey(directory)).digest("hex");
48
- return path2.join(storageDir, "project-identities", `${hash}.json`);
25
+ return path.join(storageDir, "project-identities", `${hash}.json`);
49
26
  }
50
27
  function rememberGitIdentity(directory, identity) {
51
28
  try {
@@ -151,7 +128,7 @@ function getErrorStderr(error) {
151
128
  return "";
152
129
  }
153
130
  function directoryFallback(directory) {
154
- const canonical = path3.resolve(directory);
131
+ const canonical = path2.resolve(directory);
155
132
  const hash = createHash2("md5").update(canonical, "utf8").digest("hex").slice(0, 12);
156
133
  return `dir:${hash}`;
157
134
  }
@@ -223,7 +200,7 @@ function classifyGitError(error, rawDirectory) {
223
200
  }
224
201
  function resolveProjectIdentityStrict(directory, allowHomeProject = homeProjectPermission) {
225
202
  assertProjectAllowed(directory, allowHomeProject);
226
- const canonical = path3.resolve(directory);
203
+ const canonical = path2.resolve(directory);
227
204
  const cached = identityCache.get(canonical);
228
205
  if (cached !== undefined) {
229
206
  return cached;
@@ -290,9 +267,9 @@ function nearestLastKnownGitIdentity(canonical) {
290
267
  const cached = lastKnownGitIdentity(current);
291
268
  if (cached !== undefined)
292
269
  return { identity: cached, source: current };
293
- if (existsSync(path3.join(current, ".git")))
270
+ if (existsSync(path2.join(current, ".git")))
294
271
  break;
295
- const parent = path3.dirname(current);
272
+ const parent = path2.dirname(current);
296
273
  if (parent === current)
297
274
  break;
298
275
  current = parent;
@@ -303,7 +280,7 @@ function nearestLastKnownGitIdentity(canonical) {
303
280
  if (exactOrAncestor)
304
281
  return exactOrAncestor;
305
282
  try {
306
- const realCanonical = realpathSync2.native(canonical);
283
+ const realCanonical = realpathSync.native(canonical);
307
284
  if (realCanonical !== canonical)
308
285
  return walk(realCanonical);
309
286
  } catch {}
@@ -331,7 +308,7 @@ function recordDubiousOwnershipFallback(canonical) {
331
308
  log2(`[magic-context] ${formatDubiousOwnershipWarning(canonical)}`);
332
309
  }
333
310
  function takeDubiousOwnershipProjectIdentityWarning(directory) {
334
- const canonical = path3.resolve(directory);
311
+ const canonical = path2.resolve(directory);
335
312
  if (!dubiousOwnershipFallbackDirectories.has(canonical))
336
313
  return null;
337
314
  if (dubiousOwnershipWarnedDirectories.has(canonical))
@@ -342,7 +319,7 @@ function takeDubiousOwnershipProjectIdentityWarning(directory) {
342
319
  function canonicalUserHomeDirectory() {
343
320
  const homeDirectory = userHomeDirectoryForIdentity();
344
321
  try {
345
- return realpathSync2.native(homeDirectory);
322
+ return realpathSync.native(homeDirectory);
346
323
  } catch {
347
324
  return homeDirectory;
348
325
  }
@@ -351,20 +328,20 @@ function isUserHomeDirectory(directory) {
351
328
  if (projectDirectoryKey(directory) === projectDirectoryKey(userHomeDirectoryForIdentity()))
352
329
  return true;
353
330
  try {
354
- return projectDirectoryKey(realpathSync2.native(path3.resolve(directory))) === projectDirectoryKey(canonicalUserHomeDirectory());
331
+ return projectDirectoryKey(realpathSync.native(path2.resolve(directory))) === projectDirectoryKey(canonicalUserHomeDirectory());
355
332
  } catch {
356
333
  return false;
357
334
  }
358
335
  }
359
336
  function assertProjectAllowed(directory, allowHomeProject) {
360
- const canonical = path3.resolve(directory);
337
+ const canonical = path2.resolve(directory);
361
338
  if (!allowHomeProject && (isUserHomeDirectory(directory) || isUserHomeDirectory(gitRootDirectory(canonical) ?? canonical))) {
362
339
  throw new ProjectIdentityError("home_project_disabled", directory, "Home project memory is disabled; set allow_home_project to opt in");
363
340
  }
364
341
  }
365
342
  function resolveProjectIdentity(directory, allowHomeProject = homeProjectPermission) {
366
343
  assertProjectAllowed(directory, allowHomeProject);
367
- const canonical = path3.resolve(directory);
344
+ const canonical = path2.resolve(directory);
368
345
  const cachedFallback = directoryFallbackCache.get(canonical);
369
346
  if (cachedFallback !== undefined) {
370
347
  if (!hasGitDir(canonical)) {
@@ -412,7 +389,7 @@ function resolveProjectIdentityOrFallback(directory, allowHomeProject = homeProj
412
389
  try {
413
390
  return resolveProjectIdentity(directory, allowHomeProject);
414
391
  } catch (error) {
415
- const canonical = path3.resolve(directory);
392
+ const canonical = path2.resolve(directory);
416
393
  if (hasGitDir(canonical) || error instanceof ProjectIdentityError && error.errorClass === "home_project_disabled")
417
394
  throw error;
418
395
  const fallback = rememberedIdentityOrDirectoryFallback(canonical);
@@ -426,7 +403,7 @@ function hasGitDir(canonical) {
426
403
  return true;
427
404
  }
428
405
  try {
429
- const realCanonical = realpathSync2.native(canonical);
406
+ const realCanonical = realpathSync.native(canonical);
430
407
  return realCanonical !== canonical && hasGitDirInAncestorChain(realCanonical);
431
408
  } catch {
432
409
  return false;
@@ -435,14 +412,14 @@ function hasGitDir(canonical) {
435
412
  function gitRootInAncestorChain(startDirectory) {
436
413
  let current = startDirectory;
437
414
  while (true) {
438
- if (existsSync(path3.join(current, ".git"))) {
415
+ if (existsSync(path2.join(current, ".git"))) {
439
416
  try {
440
- return realpathSync2.native(current);
417
+ return realpathSync.native(current);
441
418
  } catch {
442
- return path3.resolve(current);
419
+ return path2.resolve(current);
443
420
  }
444
421
  }
445
- const parent = path3.dirname(current);
422
+ const parent = path2.dirname(current);
446
423
  if (parent === current) {
447
424
  return null;
448
425
  }
@@ -457,21 +434,21 @@ function gitRootDirectory(canonical) {
457
434
  if (direct)
458
435
  return direct;
459
436
  try {
460
- const realCanonical = realpathSync2.native(canonical);
437
+ const realCanonical = realpathSync.native(canonical);
461
438
  return realCanonical === canonical ? null : gitRootInAncestorChain(realCanonical);
462
439
  } catch {
463
440
  return null;
464
441
  }
465
442
  }
466
443
  function directoryHasGitMetadata(directory) {
467
- return gitRootDirectory(path3.resolve(directory)) !== null;
444
+ return gitRootDirectory(path2.resolve(directory)) !== null;
468
445
  }
469
446
  function describeUnresolvedProjectIdentity(directory) {
470
- const resolvedDirectory = path3.resolve(directory);
447
+ const resolvedDirectory = path2.resolve(directory);
471
448
  const canonicalHome = canonicalUserHomeDirectory();
472
449
  const canonicalDirectory = (() => {
473
450
  try {
474
- return realpathSync2.native(resolvedDirectory);
451
+ return realpathSync.native(resolvedDirectory);
475
452
  } catch {
476
453
  return resolvedDirectory;
477
454
  }
@@ -487,7 +464,7 @@ function isUsableProjectIdentity(identity) {
487
464
  return typeof identity === "string" && identity.trim().length > 0;
488
465
  }
489
466
  function resolveProjectIdentityForSession(directory, allowHomeProject = homeProjectPermission) {
490
- const resolvedDirectory = path3.resolve(directory);
467
+ const resolvedDirectory = path2.resolve(directory);
491
468
  const cacheKey = `${allowHomeProject ? "1" : "0"}\x00${resolvedDirectory}`;
492
469
  const cached = sessionIdentityCache.get(cacheKey);
493
470
  if (cached && (cached.revalidateAt === null || nowMs() < cached.revalidateAt) && !(cached.identity?.startsWith("dir:") && hasGitDir(resolvedDirectory))) {
@@ -498,7 +475,7 @@ function resolveProjectIdentityForSession(directory, allowHomeProject = homeProj
498
475
  const canonicalDirectory = (() => {
499
476
  try {
500
477
  filesystemProbeObserverForTests?.();
501
- return realpathSync2.native(resolvedDirectory);
478
+ return realpathSync.native(resolvedDirectory);
502
479
  } catch {
503
480
  return resolvedDirectory;
504
481
  }
@@ -566,4 +543,4 @@ function setBootQuietPeriodForTests(startAtMs) {
566
543
  bootQuietUntilMs = startAtMs === null ? 0 : startAtMs + BOOT_QUIET_MS;
567
544
  }
568
545
 
569
- export { sameProjectDirectory, canonicalProjectDirectory, setHomeProjectPermission, shouldSkipHomeProjectMemory, ProjectIdentityError, takeDubiousOwnershipProjectIdentityWarning, isUserHomeDirectory, resolveProjectIdentity, directoryHasGitMetadata, describeUnresolvedProjectIdentity, isUsableProjectIdentity, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, beginBootQuietPeriod, bootQuietRemainingMs, scheduleAfterBootQuiet, setBootQuietPeriodForTests };
546
+ export { setHomeProjectPermission, shouldSkipHomeProjectMemory, ProjectIdentityError, takeDubiousOwnershipProjectIdentityWarning, isUserHomeDirectory, resolveProjectIdentity, directoryHasGitMetadata, describeUnresolvedProjectIdentity, isUsableProjectIdentity, resolveProjectIdentityForSession, normalizeStoredProjectPath, storedPathBelongsToIdentity, beginBootQuietPeriod, bootQuietRemainingMs, scheduleAfterBootQuiet, setBootQuietPeriodForTests };