@mulmoclaude/core 7.7.1 → 7.8.0

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 (191) hide show
  1. package/README.md +1 -1
  2. package/assets/helps/error-recovery.md +23 -2
  3. package/assets/helps/sandbox.md +4 -2
  4. package/assets/helps/spreadsheet.md +8 -7
  5. package/dist/{atomic-C3NMg6-j.js → atomic-Dw7dV4TL.js} +1 -1
  6. package/dist/{atomic-C3NMg6-j.js.map → atomic-Dw7dV4TL.js.map} +1 -1
  7. package/dist/{atomic-cqafMWEI.cjs → atomic-bzFw4-ix.cjs} +3 -3
  8. package/dist/atomic-bzFw4-ix.cjs.map +1 -0
  9. package/dist/collection/index.cjs +6 -6
  10. package/dist/collection/index.js +6 -6
  11. package/dist/collection/paths.cjs +1 -1
  12. package/dist/collection/paths.js +1 -1
  13. package/dist/collection/registry/index.cjs +1 -1
  14. package/dist/collection/registry/index.js +1 -1
  15. package/dist/collection/registry/server/index.cjs +11 -11
  16. package/dist/collection/registry/server/index.cjs.map +1 -1
  17. package/dist/collection/registry/server/index.js +10 -10
  18. package/dist/collection/server/index.cjs +5 -5
  19. package/dist/collection/server/index.js +5 -5
  20. package/dist/collection-watchers/index.cjs +6 -6
  21. package/dist/collection-watchers/index.cjs.map +1 -1
  22. package/dist/collection-watchers/index.js +6 -6
  23. package/dist/collection-watchers/index.js.map +1 -1
  24. package/dist/{containment-Dc3gO4wD.cjs → containment-NZYJbiaa.cjs} +2 -2
  25. package/dist/{containment-Dc3gO4wD.cjs.map → containment-NZYJbiaa.cjs.map} +1 -1
  26. package/dist/{containment-D_vAa6eT.js → containment-Ne0w06jN.js} +1 -1
  27. package/dist/{containment-D_vAa6eT.js.map → containment-Ne0w06jN.js.map} +1 -1
  28. package/dist/{discovery-D1cjgQRo.cjs → discovery-Cu35oXeW.cjs} +14 -14
  29. package/dist/discovery-Cu35oXeW.cjs.map +1 -0
  30. package/dist/{discovery-c5OKO0dI.js → discovery-DTOodl_M.js} +11 -11
  31. package/dist/discovery-DTOodl_M.js.map +1 -0
  32. package/dist/{dist--k7dcIzm.cjs → dist-DK0zTPR1.cjs} +2 -2
  33. package/dist/dist-DK0zTPR1.cjs.map +1 -0
  34. package/dist/{dist-Cb-KNFRA.js → dist-wmt60Ec-.js} +2 -2
  35. package/dist/dist-wmt60Ec-.js.map +1 -0
  36. package/dist/errorMessage-CEWGPYzN.js +1 -0
  37. package/dist/errorMessage-DCZuXjO4.cjs +1 -0
  38. package/dist/{errors-D-LZwNSI.js → errors-DfW0e2uv.js} +2 -2
  39. package/dist/{errors-D-LZwNSI.js.map → errors-DfW0e2uv.js.map} +1 -1
  40. package/dist/{errors-DVKixTWx.cjs → errors-WLfupg-H.cjs} +2 -2
  41. package/dist/{errors-DVKixTWx.cjs.map → errors-WLfupg-H.cjs.map} +1 -1
  42. package/dist/feeds/index.cjs +2 -2
  43. package/dist/feeds/index.js +2 -2
  44. package/dist/feeds/paths.cjs +1 -1
  45. package/dist/feeds/server/index.cjs +14 -14
  46. package/dist/feeds/server/index.cjs.map +1 -1
  47. package/dist/feeds/server/index.js +12 -12
  48. package/dist/feeds/server/index.js.map +1 -1
  49. package/dist/file-change/index.cjs +2 -2
  50. package/dist/file-change/index.js +1 -1
  51. package/dist/files/index.cjs +9 -9
  52. package/dist/files/index.js +7 -7
  53. package/dist/global-config/index.cjs +1 -1
  54. package/dist/global-config/index.js +1 -1
  55. package/dist/google/index.cjs +16 -16
  56. package/dist/google/index.cjs.map +1 -1
  57. package/dist/google/index.js +14 -14
  58. package/dist/google/index.js.map +1 -1
  59. package/dist/{graph-DBbzemby.js → graph-CVoiWp8B.js} +2 -2
  60. package/dist/{graph-DBbzemby.js.map → graph-CVoiWp8B.js.map} +1 -1
  61. package/dist/{graph-BvVMZfDV.cjs → graph-RyHEgm-F.cjs} +2 -2
  62. package/dist/{graph-BvVMZfDV.cjs.map → graph-RyHEgm-F.cjs.map} +1 -1
  63. package/dist/{iconGlyph-CFOiFsmq.cjs → iconGlyph-BhtU1a9P.cjs} +1 -1
  64. package/dist/{iconGlyph-CFOiFsmq.cjs.map → iconGlyph-BhtU1a9P.cjs.map} +1 -1
  65. package/dist/{iconGlyph-D9h__VaM.js → iconGlyph-DjE_HLf4.js} +1 -1
  66. package/dist/{iconGlyph-D9h__VaM.js.map → iconGlyph-DjE_HLf4.js.map} +1 -1
  67. package/dist/{ingestTypes-CLDvn7kw.cjs → ingestTypes-CmO3SNaO.cjs} +2 -2
  68. package/dist/{ingestTypes-CLDvn7kw.cjs.map → ingestTypes-CmO3SNaO.cjs.map} +1 -1
  69. package/dist/{ingestTypes-DuXuSBSn.js → ingestTypes-V3bHEQ2i.js} +2 -2
  70. package/dist/{ingestTypes-DuXuSBSn.js.map → ingestTypes-V3bHEQ2i.js.map} +1 -1
  71. package/dist/{itemId-D2XAQ8RU.cjs → itemId-D3mJhGu0.cjs} +1 -1
  72. package/dist/{itemId-D2XAQ8RU.cjs.map → itemId-D3mJhGu0.cjs.map} +1 -1
  73. package/dist/{itemId-D_pSpa3U.js → itemId-D7pPwaX6.js} +1 -1
  74. package/dist/{itemId-D_pSpa3U.js.map → itemId-D7pPwaX6.js.map} +1 -1
  75. package/dist/{json-BizOSThv.js → json-C23c3t1W.js} +2 -2
  76. package/dist/{json-BizOSThv.js.map → json-C23c3t1W.js.map} +1 -1
  77. package/dist/{json-BGdV2cz6.cjs → json-CWiVjlka.cjs} +2 -2
  78. package/dist/{json-BGdV2cz6.cjs.map → json-CWiVjlka.cjs.map} +1 -1
  79. package/dist/{listen-CPZX9gpR.js → listen-DFP9Lrbd.js} +2 -2
  80. package/dist/{listen-CPZX9gpR.js.map → listen-DFP9Lrbd.js.map} +1 -1
  81. package/dist/{listen-Bu1QX69l.cjs → listen-jSwqWZfE.cjs} +2 -2
  82. package/dist/{listen-Bu1QX69l.cjs.map → listen-jSwqWZfE.cjs.map} +1 -1
  83. package/dist/notifier/index.cjs +1 -1
  84. package/dist/notifier/index.js +1 -1
  85. package/dist/{notifier-B3cqvwts.js → notifier-BkIAgskG.js} +3 -3
  86. package/dist/{notifier-B3cqvwts.js.map → notifier-BkIAgskG.js.map} +1 -1
  87. package/dist/{notifier-Cq2UbCTW.cjs → notifier-nv9c1r6T.cjs} +3 -3
  88. package/dist/{notifier-Cq2UbCTW.cjs.map → notifier-nv9c1r6T.cjs.map} +1 -1
  89. package/dist/{paths-DUHAueEv.cjs → paths-D0WRbJTV.cjs} +2 -2
  90. package/dist/{paths-DUHAueEv.cjs.map → paths-D0WRbJTV.cjs.map} +1 -1
  91. package/dist/{paths-BMQNHdaJ.js → paths-qvo3SsnP.js} +2 -2
  92. package/dist/{paths-BMQNHdaJ.js.map → paths-qvo3SsnP.js.map} +1 -1
  93. package/dist/plugin-vue/i18n.cjs +1 -1
  94. package/dist/plugin-vue/i18n.cjs.map +1 -1
  95. package/dist/plugin-vue/i18n.js +1 -1
  96. package/dist/plugin-vue/index.cjs +3 -3
  97. package/dist/plugin-vue/index.cjs.map +1 -1
  98. package/dist/plugin-vue/index.js +3 -3
  99. package/dist/plugin-vue/index.js.map +1 -1
  100. package/dist/{project-mU6-xLfy.js → project-CSx7gqgs.js} +1 -1
  101. package/dist/{project-mU6-xLfy.js.map → project-CSx7gqgs.js.map} +1 -1
  102. package/dist/{project-DDTIVEMU.cjs → project-sS_ltoWz.cjs} +1 -1
  103. package/dist/{project-DDTIVEMU.cjs.map → project-sS_ltoWz.cjs.map} +1 -1
  104. package/dist/prompt-files/index.cjs +3 -3
  105. package/dist/prompt-files/index.cjs.map +1 -1
  106. package/dist/prompt-files/index.js +1 -1
  107. package/dist/{promptSafety-Ctl7rOvA.cjs → promptSafety-BkFiS7El.cjs} +3 -3
  108. package/dist/{promptSafety-Ctl7rOvA.cjs.map → promptSafety-BkFiS7El.cjs.map} +1 -1
  109. package/dist/{promptSafety-B_Jbtlcb.js → promptSafety-Dp9Zga_t.js} +3 -3
  110. package/dist/{promptSafety-B_Jbtlcb.js.map → promptSafety-Dp9Zga_t.js.map} +1 -1
  111. package/dist/{relPath-CZiP2S_a.cjs → relPath-B-c9FUkm.cjs} +2 -2
  112. package/dist/{relPath-CZiP2S_a.cjs.map → relPath-B-c9FUkm.cjs.map} +1 -1
  113. package/dist/{relPath-BkKmqiiF.js → relPath-DV2ZrxF_.js} +1 -1
  114. package/dist/{relPath-BkKmqiiF.js.map → relPath-DV2ZrxF_.js.map} +1 -1
  115. package/dist/remote-host/index.cjs +1 -1
  116. package/dist/remote-host/index.js +1 -1
  117. package/dist/remote-host/server/index.cjs +4 -4
  118. package/dist/remote-host/server/index.cjs.map +1 -1
  119. package/dist/remote-host/server/index.js +4 -4
  120. package/dist/remote-host/server/index.js.map +1 -1
  121. package/dist/{remote-host-gvsvPRli.cjs → remote-host-B6r8BkA1.cjs} +2 -2
  122. package/dist/{remote-host-gvsvPRli.cjs.map → remote-host-B6r8BkA1.cjs.map} +1 -1
  123. package/dist/{remote-host-DyAlq52o.js → remote-host-BI_3SnK1.js} +2 -2
  124. package/dist/{remote-host-DyAlq52o.js.map → remote-host-BI_3SnK1.js.map} +1 -1
  125. package/dist/remote-view/index.cjs +2 -2
  126. package/dist/remote-view/index.js +2 -2
  127. package/dist/{rolldown-runtime-CmQyd0Gu.cjs → rolldown-runtime-C5rMTSut.cjs} +8 -6
  128. package/dist/{root-s0MUUMQU.js → root-DDMQu5hb.js} +1 -1
  129. package/dist/{root-s0MUUMQU.js.map → root-DDMQu5hb.js.map} +1 -1
  130. package/dist/{root-Ccgd3H5S.cjs → root-kKYFqEMf.cjs} +2 -2
  131. package/dist/{root-Ccgd3H5S.cjs.map → root-kKYFqEMf.cjs.map} +1 -1
  132. package/dist/runtime-plugins/index.cjs +104 -15
  133. package/dist/runtime-plugins/index.cjs.map +1 -1
  134. package/dist/runtime-plugins/index.d.ts +1 -0
  135. package/dist/runtime-plugins/index.js +99 -15
  136. package/dist/runtime-plugins/index.js.map +1 -1
  137. package/dist/runtime-plugins/ledgerLock.d.ts +16 -0
  138. package/dist/scheduler/index.cjs +5 -5
  139. package/dist/scheduler/index.js +4 -4
  140. package/dist/{server-B6usmOfY.cjs → server-BNmwQGcq.cjs} +15 -15
  141. package/dist/server-BNmwQGcq.cjs.map +1 -0
  142. package/dist/{server-CtghuxhH.js → server-BpCUehxP.js} +14 -14
  143. package/dist/{server-CtghuxhH.js.map → server-BpCUehxP.js.map} +1 -1
  144. package/dist/skill-bridge/index.cjs +3 -3
  145. package/dist/skill-bridge/index.cjs.map +1 -1
  146. package/dist/skill-bridge/index.js +2 -2
  147. package/dist/{slug-DVkuPjIv.cjs → slug-BRj6KEiN.cjs} +1 -1
  148. package/dist/{slug-DVkuPjIv.cjs.map → slug-BRj6KEiN.cjs.map} +1 -1
  149. package/dist/{slug-D24AYqCZ.js → slug-X5tnZoc-.js} +1 -1
  150. package/dist/{slug-D24AYqCZ.js.map → slug-X5tnZoc-.js.map} +1 -1
  151. package/dist/{templatePath-CB3wtVpe.js → templatePath-B5mHTFDX.js} +1 -1
  152. package/dist/{templatePath-CB3wtVpe.js.map → templatePath-B5mHTFDX.js.map} +1 -1
  153. package/dist/{templatePath-BIh7wqgS.cjs → templatePath-DSawCKNy.cjs} +1 -1
  154. package/dist/{templatePath-BIh7wqgS.cjs.map → templatePath-DSawCKNy.cjs.map} +1 -1
  155. package/dist/{text-BQAuwKVj.js → text-BpGv7qxC.js} +1 -1
  156. package/dist/{text-BQAuwKVj.js.map → text-BpGv7qxC.js.map} +1 -1
  157. package/dist/{text-BQiyo5R9.cjs → text-CPK6ABnv.cjs} +1 -1
  158. package/dist/{text-BQiyo5R9.cjs.map → text-CPK6ABnv.cjs.map} +1 -1
  159. package/dist/{types-DPycxnDf.cjs → types-Bmk0fWDr.cjs} +1 -1
  160. package/dist/{types-DPycxnDf.cjs.map → types-Bmk0fWDr.cjs.map} +1 -1
  161. package/dist/{types-BLCZTGW2.js → types-CuiYCIof.js} +1 -1
  162. package/dist/{types-BLCZTGW2.js.map → types-CuiYCIof.js.map} +1 -1
  163. package/dist/utils/index.cjs +3 -3
  164. package/dist/utils/index.js +3 -3
  165. package/dist/whisper/client.cjs.map +1 -1
  166. package/dist/whisper/client.js.map +1 -1
  167. package/dist/whisper/index.cjs +7 -7
  168. package/dist/whisper/index.cjs.map +1 -1
  169. package/dist/whisper/index.js +5 -5
  170. package/dist/wiki/index.cjs +3 -3
  171. package/dist/wiki/index.js +3 -3
  172. package/dist/wiki/paths.cjs +2 -2
  173. package/dist/wiki/paths.js +1 -1
  174. package/dist/wiki/server/index.cjs +7 -7
  175. package/dist/wiki/server/index.js +5 -5
  176. package/dist/{withinRoot-CheaBWt0.js → withinRoot-Dc756J5K.js} +2 -2
  177. package/dist/{withinRoot-CheaBWt0.js.map → withinRoot-Dc756J5K.js.map} +1 -1
  178. package/dist/{withinRoot-CHPN9eHD.cjs → withinRoot-OaOVCBHa.cjs} +2 -2
  179. package/dist/withinRoot-OaOVCBHa.cjs.map +1 -0
  180. package/dist/workspace-setup/index.js +2 -2
  181. package/dist/workspace-setup/index.js.map +1 -1
  182. package/package.json +5 -5
  183. package/dist/atomic-cqafMWEI.cjs.map +0 -1
  184. package/dist/discovery-D1cjgQRo.cjs.map +0 -1
  185. package/dist/discovery-c5OKO0dI.js.map +0 -1
  186. package/dist/dist--k7dcIzm.cjs.map +0 -1
  187. package/dist/dist-Cb-KNFRA.js.map +0 -1
  188. package/dist/errorMessage-BDEhi5qf.cjs +0 -1
  189. package/dist/errorMessage-BFkRmkyh.js +0 -1
  190. package/dist/server-B6usmOfY.cjs.map +0 -1
  191. package/dist/withinRoot-CHPN9eHD.cjs.map +0 -1
package/README.md CHANGED
@@ -30,7 +30,7 @@ rather than imported, which is what lets the same code run under either.
30
30
  `./collection/firestore` and `./remote-host/server`. Every
31
31
  other entry must LOAD with the package absent — a host that uses no Firestore
32
32
  installs nothing — under `import` and `require` alike.
33
- `test/workspace/collections/test_optionalFirebasePeer.ts` in the MulmoClaude
33
+ `packages/mulmoclaude/test/workspace/collections/test_optionalFirebasePeer.ts` in the MulmoClaude
34
34
  repository holds that line: it loads every entry in the exports map, under both
35
35
  conditions, with `firebase` made unresolvable. It is a sweep, not a static
36
36
  guarantee — an import added to a module an entry reaches is caught by running
@@ -972,7 +972,7 @@ layouts cause that:
972
972
 
973
973
  1. **Windows source checkout.** `yarn` links workspace packages into `node_modules/` as **NTFS
974
974
  junctions**; their absolute Windows target (`C:\Users\…`) does not exist in the Linux container,
975
- so every junction dangles. `server/agent/config.ts` bind-mounts a junction-free copy of each
975
+ so every junction dangles. `packages/mulmoclaude/server/agent/config.ts` bind-mounts a junction-free copy of each
976
976
  workspace package at `/app/pkg_modules/<name>`; a package missing from that list is invisible.
977
977
  2. **npx install with nested `node_modules`.** npm sometimes places a dep in the nested
978
978
  `<packageRoot>/node_modules` (a version conflict, or a half-deduped npx cache from repeated
@@ -1061,7 +1061,7 @@ shipped builders produce, and asserts `handlePermission` comes back over the MCP
1061
1061
  ### Cause
1062
1062
 
1063
1063
  The image freezes whichever CLI was current when it was built, and
1064
- `ensureSandboxImage()` (`server/system/docker.ts`) rebuilds only when the **Dockerfile's SHA**
1064
+ `ensureSandboxImage()` (`packages/mulmoclaude/server/system/docker.ts`) rebuilds only when the **Dockerfile's SHA**
1065
1065
  changes. A new CLI release upstream doesn't change that SHA, so nothing retriggers the build.
1066
1066
 
1067
1067
  ### Fix
@@ -1760,3 +1760,24 @@ bridges in-process bridges running { transports: [ 'telegram' ] }
1760
1760
  ```
1761
1761
 
1762
1762
  Absence of that line means nothing started.
1763
+
1764
+ ## A plugin install fails because the ledger is busy, a writer "is no longer running", or the plugin "changed in the ledger"
1765
+
1766
+ ### Symptom
1767
+
1768
+ - Installing or removing a plugin (Settings → Installed plugins, `npx mulmoclaude plugin`, or MulmoTerminal) fails with "another install or removal is editing …/plugins/plugins.json".
1769
+ - Or it fails with "…/plugins/plugins.json.lock was left by a writer that is no longer running (pid N); remove it and try again".
1770
+ - Or an install fails with "<name> changed in the ledger while this install ran; check it again".
1771
+
1772
+ ### Cause
1773
+
1774
+ Every edit of the plugin ledger holds `plugins/plugins.json.lock` for the few milliseconds it takes. The lock keeps MulmoClaude's server, its `plugin` command and MulmoTerminal from overwriting each other's changes. A writer waits a while for the lock and then gives up. Nothing removes another writer's lock automatically. A lock that stays behind therefore means a writer crashed in the middle of an edit.
1775
+
1776
+ ### Fix
1777
+
1778
+ - **"another install or removal is editing"** — another change was running. Try again once it finishes.
1779
+ - **"no longer running (pid N)"** — that writer is gone. Delete the named `plugins.json.lock` and try again. Check `plugins/plugins.json` afterwards: the crashed edit may not have been written.
1780
+
1781
+ - **"changed in the ledger while this install ran"** — another host installed, replaced or removed that same plugin between the check and the write. Nothing was written. List the plugins again (`npx mulmoclaude plugin list`, or reopen Settings → Installed plugins) to see what is installed now, then decide whether to install again.
1782
+
1783
+ Do not delete the lock while an install or removal is in progress.
@@ -14,11 +14,13 @@ MulmoClaude runs the Claude Code agent inside a **Docker sandbox** when Docker i
14
14
  |---|---|---|
15
15
  | Workspace | `/home/node/mulmoclaude` | read-write |
16
16
  | `node_modules/` | `/app/node_modules` | read-only |
17
- | `server/` | `/app/server` | read-only |
18
- | `src/` | `/app/src` | read-only |
17
+ | App `server/` | `/app/server` | read-only |
18
+ | App `src/` | `/app/src` | read-only |
19
19
  | `~/.claude/` | `/home/node/.claude` | read-write |
20
20
  | `~/.claude.json` | `/home/node/.claude.json` | read-write |
21
21
 
22
+ The app's `server/` and `src/` are `packages/mulmoclaude/server/` and `packages/mulmoclaude/src/` in a source checkout, and `dist/server/` and `dist/src/` inside the installed `mulmoclaude` package.
23
+
22
24
  The container runs with `--cap-drop ALL` and as the host user's UID/GID, so it has no elevated privileges.
23
25
 
24
26
  ## Disabling the Sandbox
@@ -24,13 +24,14 @@ Never pre-calculate — let the spreadsheet compute using cell refs, functions,
24
24
 
25
25
  Only these are available, plus any the workbook defines in its `functions` field. A formula that calls any other function shows an error (such as `#NAME?`) instead of a result.
26
26
 
27
- - Statistical: ANOVA.TEST, AUTOCORREL, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BETA.DIST, BETA.INV, BETAINV, BINOM.DIST, BINOM.INV, BINOMDIST, CHIDIST, CHIINV, CHISQ.DIST, CHISQ.DIST.RT, CHISQ.INV, CHISQ.INV.RT, CHISQ.TEST, CHITEST, CONFIDENCE.NORM, CONFIDENCE.T, CORREL, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COVARIANCE.P, COVARIANCE.S, CRITBINOM, DECOMPOSE, DEVSQ, EMA, EXPON.DIST, EXPONDIST, F.DIST, F.DIST.RT, F.INV, F.INV.RT, F.TEST, FDIST, FINV, FISHER, FISHERINV, FORECAST, FORECAST.ETS, FORECAST.ETS.CONFINT, FORECAST.ETS.SEASONALITY, FORECAST.LINEAR, FREQUENCY, FTEST, GAMMA.DIST, GAMMA.INV, GAMMADIST, GAMMAINV, GAMMALN, GAMMALN.PRECISE, GAUSS, GEOMEAN, GROWTH, HARMEAN, HYPGEOM.DIST, INTERCEPT, KENDALL, KS.TEST, KURT, LARGE, LINEST, LOGEST, LOGINV, LOGNORM.DIST, LOGNORM.INV, MANNWHITNEY.TEST, MAX, MAXA, MAXIFS, MEDIAN, MIN, MINA, MINIFS, MODE, MODE.SNGL, NEGBINOM.DIST, NORM.DIST, NORM.INV, NORM.S.DIST, NORM.S.INV, PEARSON, PERCENTILE, PERCENTILE.EXC, PERCENTILE.INC, PERCENTRANK, PERCENTRANK.EXC, PERCENTRANK.INC, PHI, POISSON, POISSON.DIST, PROB, QUARTILE, QUARTILE.EXC, QUARTILE.INC, RANK, RANK.AVG, RANK.EQ, RSQ, SHAPIRO.TEST, SKEW, SKEW.P, SLOPE, SMALL, SPEARMAN, STANDARDIZE, STDEV, STDEV.P, STDEV.S, STDEVP, STEYX, SUM, SUMIF, SUMIFS, T.DIST, T.DIST.2T, T.DIST.RT, T.INV, T.INV.2T, T.TEST, TREND, TRIMMEAN, TTEST, VAR, VAR.P, VAR.S, VARP, WEIBULL, WEIBULL.DIST, WILCOXON.TEST, Z.TEST, ZTEST
28
- - Mathematical: ABS, CEILING, EXP, FLOOR, INT, LN, LOG, LOG10, MDETERM, MINVERSE, MMULT, MOD, MUNIT, PI, POWER, RAND, RANDARRAY, RANDBETWEEN, ROUND, ROUNDDOWN, ROUNDUP, SEQUENCE, SIGN, SQRT, SUMPRODUCT, TRUNC
29
- - Logical: AND, BYCOL, BYROW, FALSE, IF, IFERROR, IFNA, IFS, LAMBDA, LET, MAP, NOT, OR, REDUCE, TRUE
30
- - Text: CONCAT, CONCATENATE, EXACT, FIND, LEFT, LEN, LOWER, MID, PROPER, REPLACE, RIGHT, SEARCH, SUBSTITUTE, TEXT, TRIM, UPPER, VALUE
31
- - Financial: FV, IPMT, IRR, NPER, NPV, PMT, PPMT, PV, RATE
32
- - Lookup & Reference: CHOOSECOLS, CHOOSEROWS, COLUMN, COLUMNS, DROP, FILTER, GROUPBY, HLOOKUP, HSTACK, INDEX, MATCH, PIVOTBY, ROW, ROWS, SORT, SORTBY, TAKE, TRANSPOSE, UNIQUE, VLOOKUP, VSTACK, XLOOKUP, XMATCH
33
- - Date & Time: DATE, DATEDIF, DAY, DAYS, EDATE, EOMONTH, HOUR, MINUTE, MONTH, NETWORKDAYS, NOW, SECOND, TIME, TODAY, WEEKDAY, WORKDAY, YEAR
27
+ - Statistical: ANOVA.TEST, AUTOCORREL, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BETA.DIST, BETA.INV, BETADIST, BETAINV, BINOM.DIST, BINOM.DIST.RANGE, BINOM.INV, BINOMDIST, CHIDIST, CHIINV, CHISQ.DIST, CHISQ.DIST.RT, CHISQ.INV, CHISQ.INV.RT, CHISQ.TEST, CHITEST, CONFIDENCE, CONFIDENCE.NORM, CONFIDENCE.T, CORREL, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COVAR, COVARIANCE.P, COVARIANCE.S, CRITBINOM, DECOMPOSE, DEVSQ, DIFF, EMA, EXPON.DIST, EXPONDIST, F.DIST, F.DIST.RT, F.INV, F.INV.RT, F.TEST, FDIST, FINV, FISHER, FISHERINV, FORECAST, FORECAST.ETS, FORECAST.ETS.CONFINT, FORECAST.ETS.SEASONALITY, FORECAST.LINEAR, FREQUENCY, FTEST, GAMMA, GAMMA.DIST, GAMMA.INV, GAMMADIST, GAMMAINV, GAMMALN, GAMMALN.PRECISE, GAUSS, GEOMEAN, GROWTH, HARMEAN, HYPGEOM.DIST, HYPGEOMDIST, INTERCEPT, KENDALL, KS.TEST, KURT, LARGE, LINEST, LOGEST, LOGINV, LOGNORM.DIST, LOGNORM.INV, LOGNORMDIST, MANNWHITNEY.TEST, MAX, MAXA, MAXIFS, MEDIAN, MIN, MINA, MINIFS, MODE, MODE.MULT, MODE.SNGL, NEGBINOM.DIST, NEGBINOMDIST, NORM.DIST, NORM.INV, NORM.S.DIST, NORM.S.INV, NORMDIST, NORMINV, NORMSDIST, NORMSINV, OUTLIERS, PCTCHANGE, PEARSON, PERCENTILE, PERCENTILE.EXC, PERCENTILE.INC, PERCENTRANK, PERCENTRANK.EXC, PERCENTRANK.INC, PERMUTATIONA, PHI, POISSON, POISSON.DIST, PROB, QUARTILE, QUARTILE.EXC, QUARTILE.INC, RANK, RANK.AVG, RANK.EQ, ROLLING, RSQ, SHAPIRO.TEST, SKEW, SKEW.P, SLOPE, SMALL, SPEARMAN, STANDARDIZE, STDEV, STDEV.P, STDEV.S, STDEVA, STDEVP, STDEVPA, STEYX, SUM, SUMIF, SUMIFS, T.DIST, T.DIST.2T, T.DIST.RT, T.INV, T.INV.2T, T.TEST, TDIST, TINV, TREND, TRIMMEAN, TTEST, VAR, VAR.P, VAR.S, VARA, VARP, VARPA, WEIBULL, WEIBULL.DIST, WILCOXON.TEST, Z.TEST, ZSCORE, ZTEST
28
+ - Mathematical: ABS, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, ARABIC, ASIN, ASINH, ATAN, ATAN2, ATANH, BASE, CEILING, CEILING.MATH, CEILING.PRECISE, COMBIN, COMBINA, COS, COSH, COT, COTH, CSC, CSCH, DECIMAL, DEGREES, EVEN, EXP, FACT, FACTDOUBLE, FLOOR, FLOOR.MATH, FLOOR.PRECISE, GCD, INT, ISO.CEILING, LCM, LN, LOG, LOG10, MDETERM, MINVERSE, MMULT, MOD, MROUND, MULTINOMIAL, MUNIT, ODD, PERMUT, PI, POWER, PRODUCT, QUOTIENT, RADIANS, RAND, RANDARRAY, RANDBETWEEN, ROMAN, ROUND, ROUNDDOWN, ROUNDUP, SEC, SECH, SEQUENCE, SERIESSUM, SIGN, SIN, SINH, SQRT, SQRTPI, SUBTOTAL, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, TAN, TANH, TRUNC
29
+ - Logical: AND, BYCOL, BYROW, FALSE, IF, IFERROR, IFNA, IFS, ISOMITTED, LAMBDA, LET, MAKEARRAY, MAP, NOT, OR, REDUCE, SCAN, SWITCH, TRUE, XOR
30
+ - Text: CHAR, CLEAN, CODE, CONCAT, CONCATENATE, DOLLAR, EXACT, FIND, FIXED, LEFT, LEN, LOWER, MID, NUMBERVALUE, PROPER, REGEXEXTRACT, REGEXREPLACE, REGEXTEST, REPLACE, REPT, RIGHT, SEARCH, SUBSTITUTE, TEXT, TEXTAFTER, TEXTBEFORE, TEXTJOIN, TEXTSPLIT, TRIM, UNICHAR, UNICODE, UPPER, VALUE
31
+ - Financial: CUMIPMT, CUMPRINC, DB, DDB, EFFECT, FV, IPMT, IRR, MIRR, NOMINAL, NPER, NPV, PMT, PPMT, PV, RATE, SLN, SYD, XIRR, XNPV
32
+ - Lookup & Reference: ADDRESS, AREAS, CHOOSE, CHOOSECOLS, CHOOSEROWS, COLUMN, COLUMNS, DROP, EXPAND, FILTER, GROUPBY, HLOOKUP, HSTACK, INDEX, INDIRECT, LOOKUP, MATCH, OFFSET, PIVOTBY, QUERY, ROW, ROWS, SORT, SORTBY, TAKE, TOCOL, TOROW, TRANSPOSE, UNIQUE, VLOOKUP, VSTACK, WRAPCOLS, WRAPROWS, XLOOKUP, XMATCH
33
+ - Date & Time: DATE, DATEDIF, DATEVALUE, DAY, DAYS, DAYS360, EDATE, EOMONTH, HOUR, ISOWEEKNUM, MINUTE, MONTH, NETWORKDAYS, NETWORKDAYS.INTL, NOW, SECOND, TIME, TIMEVALUE, TODAY, WEEKDAY, WEEKNUM, WORKDAY, WORKDAY.INTL, YEAR, YEARFRAC
34
+ - Information: ERROR.TYPE, ISBLANK, ISERR, ISERROR, ISEVEN, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISODD, ISTEXT, N, NA, T, TYPE
34
35
 
35
36
  ## Dates
36
37
 
@@ -95,4 +95,4 @@ function writeFileAtomicSync(filePath, content, opts = {}) {
95
95
  }
96
96
  export { writeFileAtomic as n, writeFileAtomicSync as r, renameWithWindowsRetry as t };
97
97
 
98
- //# sourceMappingURL=atomic-C3NMg6-j.js.map
98
+ //# sourceMappingURL=atomic-Dw7dV4TL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"atomic-C3NMg6-j.js","names":[],"sources":["../src/files/atomic.ts"],"sourcesContent":["// rename(2) is atomic on POSIX; Node's Windows fallback (copy+unlink) is still safer than truncating in place.\n// Readers always see either the old file or the new — never a half-written one.\n//\n// Single source of truth for atomic file writes across the whole monorepo\n// (host, core, plugins). Previously copy-pasted four times, so a Windows retry\n// fix landed in only one (#2399, precedent #2222).\n\nimport { mkdirSync, promises, renameSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { randomBytes } from \"node:crypto\";\n\nexport interface WriteAtomicOptions {\n mode?: number;\n /** Give the staging file a random suffix so concurrent writers to the same\n * destination can't collide at the OS layer.\n *\n * Defaults to `true`, and opting out is almost always wrong. A shared\n * `${filePath}.tmp` means two writers of one file race: the second write\n * overwrites the first's staging file, or one rename/unlink pulls it out\n * from under the other, surfacing as `ENOENT … rename '<file>.tmp'`. That is\n * not theoretical — it fired in production on session meta, where ten\n * distinct callers (`setClaudeSessionId`, `backfillOrigin`,\n * `incrementUserQueryCount`, …) all write the same `<sessionId>.json`\n * (#2222).\n *\n * Pass `false` only when you specifically need the staging path to be\n * predictable (e.g. a single-writer token file, or a test that pre-creates\n * it to force a write failure). */\n uniqueTmp?: boolean;\n}\n\n// Unique staging names are the safe default: the cost is a random suffix, the\n// cost of the alternative is a lost update under concurrency (#2222).\nconst DEFAULT_UNIQUE_TMP = true;\n\nfunction tmpPathFor(filePath: string, uniqueTmp: boolean | undefined): string {\n return (uniqueTmp ?? DEFAULT_UNIQUE_TMP) ? `${filePath}.${randomBytes(6).toString(\"hex\")}.tmp` : `${filePath}.tmp`;\n}\n\n// On Windows, AV / Search Indexer / Defender briefly hold handles and rename trips EPERM/EBUSY/EACCES. Retry loop is\n// gated to Windows because POSIX EPERM means a real perm problem (read-only fs, sticky, cross-device) — retrying\n// just adds latency before the inevitable throw.\nconst IS_WINDOWS = process.platform === \"win32\";\n// The ASYNC ladder is generous because waiting is nearly free there — the call\n// yields, and a write that would otherwise throw is worth a few seconds. The\n// previous ~430 ms budget was not enough on a loaded Windows CI runner: the\n// notifier's `active.json` write lost the rename and threw, and the listener\n// waiting on it timed out ten seconds later, so the operation failed while the\n// contention it was retrying through had long since cleared (#2972 follow-up).\nconst RENAME_RETRY_DELAYS_MS = [30, 100, 300, 600, 1000, 2000] as const;\n// The SYNC ladder stays short on purpose. `sleepSync` parks the whole thread,\n// so a long budget here does not delay one write — it freezes the process. A\n// caller that cannot afford to yield cannot afford to wait either; failing\n// after ~430 ms and letting the caller decide beats a four-second stall.\nconst RENAME_RETRY_DELAYS_SYNC_MS = [30, 100, 300] as const;\n\nfunction hasErrnoCode(err: unknown): err is { code: string } {\n return typeof err === \"object\" && err !== null && \"code\" in err && typeof err.code === \"string\";\n}\n\n// `isWindows` is a parameter (defaulting to the real platform) so the safety-critical decision is testable on any OS.\n/** The retry budgets, exported so a test can assert what they cost rather than\n * hard-coding a second copy of the numbers. */\nexport const RENAME_RETRY_BUDGET_MS = RENAME_RETRY_DELAYS_MS.reduce((total, delay) => total + delay, 0);\nexport const RENAME_RETRY_BUDGET_SYNC_MS = RENAME_RETRY_DELAYS_SYNC_MS.reduce((total, delay) => total + delay, 0);\n\nexport function isTransientRenameError(err: unknown, isWindows: boolean = IS_WINDOWS): boolean {\n if (!isWindows || !hasErrnoCode(err)) return false;\n return err.code === \"EPERM\" || err.code === \"EBUSY\" || err.code === \"EACCES\";\n}\n\n// Injectable so a test can drive the retry path (fail-then-succeed rename, no-op sleep, isWindows=true) on any OS.\nexport interface RenameRetryDeps {\n rename: (fromPath: string, toPath: string) => Promise<void>;\n sleep: (millis: number) => Promise<void>;\n isWindows: boolean;\n}\n\nconst defaultRenameRetryDeps: RenameRetryDeps = {\n rename: (fromPath, toPath) => promises.rename(fromPath, toPath),\n sleep: (millis) => new Promise((resolve) => setTimeout(resolve, millis)),\n isWindows: IS_WINDOWS,\n};\n\nexport async function renameWithWindowsRetry(fromPath: string, toPath: string, deps: RenameRetryDeps = defaultRenameRetryDeps): Promise<void> {\n for (const delayMs of RENAME_RETRY_DELAYS_MS) {\n try {\n await deps.rename(fromPath, toPath);\n return;\n } catch (err) {\n if (!isTransientRenameError(err, deps.isWindows)) throw err;\n await deps.sleep(delayMs);\n }\n }\n // Final attempt — let any error propagate.\n await deps.rename(fromPath, toPath);\n}\n\n// Atomics.wait parks the thread instead of busy-spinning. Only on the Windows-rename retry path, and only on the SYNC\n// ladder, whose budget is capped at ~430ms precisely because this blocks everything.\nconst SYNC_SLEEP_BUF = new Int32Array(new SharedArrayBuffer(4));\nfunction sleepSync(millis: number): void {\n Atomics.wait(SYNC_SLEEP_BUF, 0, 0, millis);\n}\n\n// Deliberate async/sync twin of RenameRetryDeps: `sleep` blocks the thread instead of returning a Promise.\nexport interface RenameRetryDepsSync {\n rename: (fromPath: string, toPath: string) => void;\n sleep: (millis: number) => void;\n isWindows: boolean;\n}\n\nconst defaultRenameRetryDepsSync: RenameRetryDepsSync = {\n rename: (fromPath, toPath) => renameSync(fromPath, toPath),\n sleep: sleepSync,\n isWindows: IS_WINDOWS,\n};\n\nexport function renameSyncWithWindowsRetry(fromPath: string, toPath: string, deps: RenameRetryDepsSync = defaultRenameRetryDepsSync): void {\n for (const delayMs of RENAME_RETRY_DELAYS_SYNC_MS) {\n try {\n deps.rename(fromPath, toPath);\n return;\n } catch (err) {\n if (!isTransientRenameError(err, deps.isWindows)) throw err;\n deps.sleep(delayMs);\n }\n }\n deps.rename(fromPath, toPath);\n}\n\n// Forcing utf-8 on a Uint8Array would re-encode the bytes — wrong for PNGs and other binary blobs.\nfunction writeOptionsFor(content: string | Uint8Array, mode: number | undefined): { encoding?: \"utf-8\" | undefined; mode?: number | undefined } {\n return typeof content === \"string\" ? { encoding: \"utf-8\", mode } : { mode };\n}\n\nexport async function writeFileAtomic(filePath: string, content: string | Uint8Array, opts: WriteAtomicOptions = {}): Promise<void> {\n const tmp = tmpPathFor(filePath, opts.uniqueTmp);\n await promises.mkdir(path.dirname(filePath), { recursive: true });\n try {\n await promises.writeFile(tmp, content, writeOptionsFor(content, opts.mode));\n await renameWithWindowsRetry(tmp, filePath);\n } catch (err) {\n await promises.unlink(tmp).catch(() => {});\n throw err;\n }\n}\n\nexport function writeFileAtomicSync(filePath: string, content: string | Uint8Array, opts: WriteAtomicOptions = {}): void {\n const tmp = tmpPathFor(filePath, opts.uniqueTmp);\n mkdirSync(path.dirname(filePath), { recursive: true });\n try {\n writeFileSync(tmp, content, writeOptionsFor(content, opts.mode));\n renameSyncWithWindowsRetry(tmp, filePath);\n } catch (err) {\n try {\n unlinkSync(tmp);\n } catch {\n // best-effort cleanup\n }\n throw err;\n }\n}\n"],"mappings":";;;;AAiCA,IAAM,qBAAqB;AAE3B,SAAS,WAAW,UAAkB,WAAwC;CAC5E,OAAQ,aAAa,qBAAsB,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,QAAQ,GAAG,SAAS;AA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4BAAkC;CACzI,KAAK,MAAM,WAAW,6BACpB,IAAI;EACF,KAAK,OAAO,UAAU,MAAM;EAC5B;CACF,SAAS,KAAK;EACZ,IAAI,CAAC,uBAAuB,KAAK,KAAK,SAAS,GAAG,MAAM;EACxD,KAAK,MAAM,OAAO;CACpB;CAEF,KAAK,OAAO,UAAU,MAAM;AAC9B;AAGA,SAAS,gBAAgB,SAA8B,MAAyF;CAC9I,OAAO,OAAO,YAAY,WAAW;EAAE,UAAU;EAAS;CAAK,IAAI,EAAE,KAAK;AAC5E;AAEA,eAAsB,gBAAgB,UAAkB,SAA8B,OAA2B,CAAC,GAAkB;CAClI,MAAM,MAAM,WAAW,UAAU,KAAK,SAAS;CAC/C,MAAM,SAAS,MAAM,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;CAChE,IAAI;EACF,MAAM,SAAS,UAAU,KAAK,SAAS,gBAAgB,SAAS,KAAK,IAAI,CAAC;EAC1E,MAAM,uBAAuB,KAAK,QAAQ;CAC5C,SAAS,KAAK;EACZ,MAAM,SAAS,OAAO,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;EACzC,MAAM;CACR;AACF;AAEA,SAAgB,oBAAoB,UAAkB,SAA8B,OAA2B,CAAC,GAAS;CACvH,MAAM,MAAM,WAAW,UAAU,KAAK,SAAS;CAC/C,UAAU,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;CACrD,IAAI;EACF,cAAc,KAAK,SAAS,gBAAgB,SAAS,KAAK,IAAI,CAAC;EAC/D,2BAA2B,KAAK,QAAQ;CAC1C,SAAS,KAAK;EACZ,IAAI;GACF,WAAW,GAAG;EAChB,QAAQ,CAER;EACA,MAAM;CACR;AACF"}
1
+ {"version":3,"file":"atomic-Dw7dV4TL.js","names":[],"sources":["../src/files/atomic.ts"],"sourcesContent":["// rename(2) is atomic on POSIX; Node's Windows fallback (copy+unlink) is still safer than truncating in place.\n// Readers always see either the old file or the new — never a half-written one.\n//\n// Single source of truth for atomic file writes across the whole monorepo\n// (host, core, plugins). Previously copy-pasted four times, so a Windows retry\n// fix landed in only one (#2399, precedent #2222).\n\nimport { mkdirSync, promises, renameSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { randomBytes } from \"node:crypto\";\n\nexport interface WriteAtomicOptions {\n mode?: number;\n /** Give the staging file a random suffix so concurrent writers to the same\n * destination can't collide at the OS layer.\n *\n * Defaults to `true`, and opting out is almost always wrong. A shared\n * `${filePath}.tmp` means two writers of one file race: the second write\n * overwrites the first's staging file, or one rename/unlink pulls it out\n * from under the other, surfacing as `ENOENT … rename '<file>.tmp'`. That is\n * not theoretical — it fired in production on session meta, where ten\n * distinct callers (`setClaudeSessionId`, `backfillOrigin`,\n * `incrementUserQueryCount`, …) all write the same `<sessionId>.json`\n * (#2222).\n *\n * Pass `false` only when you specifically need the staging path to be\n * predictable (e.g. a single-writer token file, or a test that pre-creates\n * it to force a write failure). */\n uniqueTmp?: boolean;\n}\n\n// Unique staging names are the safe default: the cost is a random suffix, the\n// cost of the alternative is a lost update under concurrency (#2222).\nconst DEFAULT_UNIQUE_TMP = true;\n\nfunction tmpPathFor(filePath: string, uniqueTmp: boolean | undefined): string {\n return (uniqueTmp ?? DEFAULT_UNIQUE_TMP) ? `${filePath}.${randomBytes(6).toString(\"hex\")}.tmp` : `${filePath}.tmp`;\n}\n\n// On Windows, AV / Search Indexer / Defender briefly hold handles and rename trips EPERM/EBUSY/EACCES. Retry loop is\n// gated to Windows because POSIX EPERM means a real perm problem (read-only fs, sticky, cross-device) — retrying\n// just adds latency before the inevitable throw.\nconst IS_WINDOWS = process.platform === \"win32\";\n// The ASYNC ladder is generous because waiting is nearly free there — the call\n// yields, and a write that would otherwise throw is worth a few seconds. The\n// previous ~430 ms budget was not enough on a loaded Windows CI runner: the\n// notifier's `active.json` write lost the rename and threw, and the listener\n// waiting on it timed out ten seconds later, so the operation failed while the\n// contention it was retrying through had long since cleared (#2972 follow-up).\nconst RENAME_RETRY_DELAYS_MS = [30, 100, 300, 600, 1000, 2000] as const;\n// The SYNC ladder stays short on purpose. `sleepSync` parks the whole thread,\n// so a long budget here does not delay one write — it freezes the process. A\n// caller that cannot afford to yield cannot afford to wait either; failing\n// after ~430 ms and letting the caller decide beats a four-second stall.\nconst RENAME_RETRY_DELAYS_SYNC_MS = [30, 100, 300] as const;\n\nfunction hasErrnoCode(err: unknown): err is { code: string } {\n return typeof err === \"object\" && err !== null && \"code\" in err && typeof err.code === \"string\";\n}\n\n// `isWindows` is a parameter (defaulting to the real platform) so the safety-critical decision is testable on any OS.\n/** The retry budgets, exported so a test can assert what they cost rather than\n * hard-coding a second copy of the numbers. */\nexport const RENAME_RETRY_BUDGET_MS = RENAME_RETRY_DELAYS_MS.reduce((total, delay) => total + delay, 0);\nexport const RENAME_RETRY_BUDGET_SYNC_MS = RENAME_RETRY_DELAYS_SYNC_MS.reduce((total, delay) => total + delay, 0);\n\nexport function isTransientRenameError(err: unknown, isWindows: boolean = IS_WINDOWS): boolean {\n if (!isWindows || !hasErrnoCode(err)) return false;\n return err.code === \"EPERM\" || err.code === \"EBUSY\" || err.code === \"EACCES\";\n}\n\n// Injectable so a test can drive the retry path (fail-then-succeed rename, no-op sleep, isWindows=true) on any OS.\nexport interface RenameRetryDeps {\n rename: (fromPath: string, toPath: string) => Promise<void>;\n sleep: (millis: number) => Promise<void>;\n isWindows: boolean;\n}\n\nconst defaultRenameRetryDeps: RenameRetryDeps = {\n rename: (fromPath, toPath) => promises.rename(fromPath, toPath),\n sleep: (millis) => new Promise((resolve) => setTimeout(resolve, millis)),\n isWindows: IS_WINDOWS,\n};\n\nexport async function renameWithWindowsRetry(fromPath: string, toPath: string, deps: RenameRetryDeps = defaultRenameRetryDeps): Promise<void> {\n for (const delayMs of RENAME_RETRY_DELAYS_MS) {\n try {\n await deps.rename(fromPath, toPath);\n return;\n } catch (err) {\n if (!isTransientRenameError(err, deps.isWindows)) throw err;\n await deps.sleep(delayMs);\n }\n }\n // Final attempt — let any error propagate.\n await deps.rename(fromPath, toPath);\n}\n\n// Atomics.wait parks the thread instead of busy-spinning. Only on the Windows-rename retry path, and only on the SYNC\n// ladder, whose budget is capped at ~430ms precisely because this blocks everything.\nconst SYNC_SLEEP_BUF = new Int32Array(new SharedArrayBuffer(4));\nfunction sleepSync(millis: number): void {\n Atomics.wait(SYNC_SLEEP_BUF, 0, 0, millis);\n}\n\n// Deliberate async/sync twin of RenameRetryDeps: `sleep` blocks the thread instead of returning a Promise.\nexport interface RenameRetryDepsSync {\n rename: (fromPath: string, toPath: string) => void;\n sleep: (millis: number) => void;\n isWindows: boolean;\n}\n\nconst defaultRenameRetryDepsSync: RenameRetryDepsSync = {\n rename: (fromPath, toPath) => renameSync(fromPath, toPath),\n sleep: sleepSync,\n isWindows: IS_WINDOWS,\n};\n\nexport function renameSyncWithWindowsRetry(fromPath: string, toPath: string, deps: RenameRetryDepsSync = defaultRenameRetryDepsSync): void {\n for (const delayMs of RENAME_RETRY_DELAYS_SYNC_MS) {\n try {\n deps.rename(fromPath, toPath);\n return;\n } catch (err) {\n if (!isTransientRenameError(err, deps.isWindows)) throw err;\n deps.sleep(delayMs);\n }\n }\n deps.rename(fromPath, toPath);\n}\n\n// Forcing utf-8 on a Uint8Array would re-encode the bytes — wrong for PNGs and other binary blobs.\nfunction writeOptionsFor(content: string | Uint8Array, mode: number | undefined): { encoding?: \"utf-8\" | undefined; mode?: number | undefined } {\n return typeof content === \"string\" ? { encoding: \"utf-8\", mode } : { mode };\n}\n\nexport async function writeFileAtomic(filePath: string, content: string | Uint8Array, opts: WriteAtomicOptions = {}): Promise<void> {\n const tmp = tmpPathFor(filePath, opts.uniqueTmp);\n await promises.mkdir(path.dirname(filePath), { recursive: true });\n try {\n await promises.writeFile(tmp, content, writeOptionsFor(content, opts.mode));\n await renameWithWindowsRetry(tmp, filePath);\n } catch (err) {\n await promises.unlink(tmp).catch(() => {});\n throw err;\n }\n}\n\nexport function writeFileAtomicSync(filePath: string, content: string | Uint8Array, opts: WriteAtomicOptions = {}): void {\n const tmp = tmpPathFor(filePath, opts.uniqueTmp);\n mkdirSync(path.dirname(filePath), { recursive: true });\n try {\n writeFileSync(tmp, content, writeOptionsFor(content, opts.mode));\n renameSyncWithWindowsRetry(tmp, filePath);\n } catch (err) {\n try {\n unlinkSync(tmp);\n } catch {\n // best-effort cleanup\n }\n throw err;\n }\n}\n"],"mappings":";;;;AAiCA,IAAM,qBAAqB;AAE3B,SAAS,WAAW,UAAkB,WAAwC;CAC5E,OAAQ,aAAa,qBAAsB,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,QAAQ,GAAG,SAAS;AAC/G;AAKA,IAAM,aAAa,QAAQ,aAAa;AAOxC,IAAM,yBAAyB;CAAC;CAAI;CAAK;CAAK;CAAK;CAAM;AAAI;AAK7D,IAAM,8BAA8B;CAAC;CAAI;CAAK;AAAG;AAEjD,SAAS,aAAa,KAAuC;CAC3D,OAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,UAAU,OAAO,OAAO,IAAI,SAAS;AACzF;AAKsC,uBAAuB,QAAQ,OAAO,UAAU,QAAQ,OAAO,CAAC;AAC3D,4BAA4B,QAAQ,OAAO,UAAU,QAAQ,OAAO,CAAC;AAEhH,SAAgB,uBAAuB,KAAc,YAAqB,YAAqB;CAC7F,IAAI,CAAC,aAAa,CAAC,aAAa,GAAG,GAAG,OAAO;CAC7C,OAAO,IAAI,SAAS,WAAW,IAAI,SAAS,WAAW,IAAI,SAAS;AACtE;AASA,IAAM,yBAA0C;CAC9C,SAAS,UAAU,WAAW,SAAS,OAAO,UAAU,MAAM;CAC9D,QAAQ,WAAW,IAAI,SAAS,YAAY,WAAW,SAAS,MAAM,CAAC;CACvE,WAAW;AACb;AAEA,eAAsB,uBAAuB,UAAkB,QAAgB,OAAwB,wBAAuC;CAC5I,KAAK,MAAM,WAAW,wBACpB,IAAI;EACF,MAAM,KAAK,OAAO,UAAU,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AAM,WAAW,UAAU,KAAK,SAAS;CAC/C,UAAU,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;CACrD,IAAI;EACF,cAAc,KAAK,SAAS,gBAAgB,SAAS,KAAK,IAAI,CAAC;EAC/D,2BAA2B,KAAK,QAAQ;CAC1C,SAAS,KAAK;EACZ,IAAI;GACF,WAAW,GAAG;EAChB,QAAQ,CAER;EACA,MAAM;CACR;AACF"}
@@ -1,8 +1,8 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C5rMTSut.cjs");
2
2
  let node_fs = require("node:fs");
3
3
  let node_path = require("node:path");
4
- node_path = require_rolldown_runtime.__toESM(node_path, 1);
5
4
  let node_crypto = require("node:crypto");
5
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
6
6
  // src/files/atomic.ts
7
7
  var DEFAULT_UNIQUE_TMP = true;
8
8
  function tmpPathFor(filePath, uniqueTmp) {
@@ -114,4 +114,4 @@ Object.defineProperty(exports, "writeFileAtomicSync", {
114
114
  }
115
115
  });
116
116
 
117
- //# sourceMappingURL=atomic-cqafMWEI.cjs.map
117
+ //# sourceMappingURL=atomic-bzFw4-ix.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomic-bzFw4-ix.cjs","names":["randomBytes","promises","renameSync","path","mkdirSync","writeFileSync","unlinkSync"],"sources":["../src/files/atomic.ts"],"sourcesContent":["// rename(2) is atomic on POSIX; Node's Windows fallback (copy+unlink) is still safer than truncating in place.\n// Readers always see either the old file or the new — never a half-written one.\n//\n// Single source of truth for atomic file writes across the whole monorepo\n// (host, core, plugins). Previously copy-pasted four times, so a Windows retry\n// fix landed in only one (#2399, precedent #2222).\n\nimport { mkdirSync, promises, renameSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { randomBytes } from \"node:crypto\";\n\nexport interface WriteAtomicOptions {\n mode?: number;\n /** Give the staging file a random suffix so concurrent writers to the same\n * destination can't collide at the OS layer.\n *\n * Defaults to `true`, and opting out is almost always wrong. A shared\n * `${filePath}.tmp` means two writers of one file race: the second write\n * overwrites the first's staging file, or one rename/unlink pulls it out\n * from under the other, surfacing as `ENOENT … rename '<file>.tmp'`. That is\n * not theoretical — it fired in production on session meta, where ten\n * distinct callers (`setClaudeSessionId`, `backfillOrigin`,\n * `incrementUserQueryCount`, …) all write the same `<sessionId>.json`\n * (#2222).\n *\n * Pass `false` only when you specifically need the staging path to be\n * predictable (e.g. a single-writer token file, or a test that pre-creates\n * it to force a write failure). */\n uniqueTmp?: boolean;\n}\n\n// Unique staging names are the safe default: the cost is a random suffix, the\n// cost of the alternative is a lost update under concurrency (#2222).\nconst DEFAULT_UNIQUE_TMP = true;\n\nfunction tmpPathFor(filePath: string, uniqueTmp: boolean | undefined): string {\n return (uniqueTmp ?? DEFAULT_UNIQUE_TMP) ? `${filePath}.${randomBytes(6).toString(\"hex\")}.tmp` : `${filePath}.tmp`;\n}\n\n// On Windows, AV / Search Indexer / Defender briefly hold handles and rename trips EPERM/EBUSY/EACCES. Retry loop is\n// gated to Windows because POSIX EPERM means a real perm problem (read-only fs, sticky, cross-device) — retrying\n// just adds latency before the inevitable throw.\nconst IS_WINDOWS = process.platform === \"win32\";\n// The ASYNC ladder is generous because waiting is nearly free there — the call\n// yields, and a write that would otherwise throw is worth a few seconds. The\n// previous ~430 ms budget was not enough on a loaded Windows CI runner: the\n// notifier's `active.json` write lost the rename and threw, and the listener\n// waiting on it timed out ten seconds later, so the operation failed while the\n// contention it was retrying through had long since cleared (#2972 follow-up).\nconst RENAME_RETRY_DELAYS_MS = [30, 100, 300, 600, 1000, 2000] as const;\n// The SYNC ladder stays short on purpose. `sleepSync` parks the whole thread,\n// so a long budget here does not delay one write — it freezes the process. A\n// caller that cannot afford to yield cannot afford to wait either; failing\n// after ~430 ms and letting the caller decide beats a four-second stall.\nconst RENAME_RETRY_DELAYS_SYNC_MS = [30, 100, 300] as const;\n\nfunction hasErrnoCode(err: unknown): err is { code: string } {\n return typeof err === \"object\" && err !== null && \"code\" in err && typeof err.code === \"string\";\n}\n\n// `isWindows` is a parameter (defaulting to the real platform) so the safety-critical decision is testable on any OS.\n/** The retry budgets, exported so a test can assert what they cost rather than\n * hard-coding a second copy of the numbers. */\nexport const RENAME_RETRY_BUDGET_MS = RENAME_RETRY_DELAYS_MS.reduce((total, delay) => total + delay, 0);\nexport const RENAME_RETRY_BUDGET_SYNC_MS = RENAME_RETRY_DELAYS_SYNC_MS.reduce((total, delay) => total + delay, 0);\n\nexport function isTransientRenameError(err: unknown, isWindows: boolean = IS_WINDOWS): boolean {\n if (!isWindows || !hasErrnoCode(err)) return false;\n return err.code === \"EPERM\" || err.code === \"EBUSY\" || err.code === \"EACCES\";\n}\n\n// Injectable so a test can drive the retry path (fail-then-succeed rename, no-op sleep, isWindows=true) on any OS.\nexport interface RenameRetryDeps {\n rename: (fromPath: string, toPath: string) => Promise<void>;\n sleep: (millis: number) => Promise<void>;\n isWindows: boolean;\n}\n\nconst defaultRenameRetryDeps: RenameRetryDeps = {\n rename: (fromPath, toPath) => promises.rename(fromPath, toPath),\n sleep: (millis) => new Promise((resolve) => setTimeout(resolve, millis)),\n isWindows: IS_WINDOWS,\n};\n\nexport async function renameWithWindowsRetry(fromPath: string, toPath: string, deps: RenameRetryDeps = defaultRenameRetryDeps): Promise<void> {\n for (const delayMs of RENAME_RETRY_DELAYS_MS) {\n try {\n await deps.rename(fromPath, toPath);\n return;\n } catch (err) {\n if (!isTransientRenameError(err, deps.isWindows)) throw err;\n await deps.sleep(delayMs);\n }\n }\n // Final attempt — let any error propagate.\n await deps.rename(fromPath, toPath);\n}\n\n// Atomics.wait parks the thread instead of busy-spinning. Only on the Windows-rename retry path, and only on the SYNC\n// ladder, whose budget is capped at ~430ms precisely because this blocks everything.\nconst SYNC_SLEEP_BUF = new Int32Array(new SharedArrayBuffer(4));\nfunction sleepSync(millis: number): void {\n Atomics.wait(SYNC_SLEEP_BUF, 0, 0, millis);\n}\n\n// Deliberate async/sync twin of RenameRetryDeps: `sleep` blocks the thread instead of returning a Promise.\nexport interface RenameRetryDepsSync {\n rename: (fromPath: string, toPath: string) => void;\n sleep: (millis: number) => void;\n isWindows: boolean;\n}\n\nconst defaultRenameRetryDepsSync: RenameRetryDepsSync = {\n rename: (fromPath, toPath) => renameSync(fromPath, toPath),\n sleep: sleepSync,\n isWindows: IS_WINDOWS,\n};\n\nexport function renameSyncWithWindowsRetry(fromPath: string, toPath: string, deps: RenameRetryDepsSync = defaultRenameRetryDepsSync): void {\n for (const delayMs of RENAME_RETRY_DELAYS_SYNC_MS) {\n try {\n deps.rename(fromPath, toPath);\n return;\n } catch (err) {\n if (!isTransientRenameError(err, deps.isWindows)) throw err;\n deps.sleep(delayMs);\n }\n }\n deps.rename(fromPath, toPath);\n}\n\n// Forcing utf-8 on a Uint8Array would re-encode the bytes — wrong for PNGs and other binary blobs.\nfunction writeOptionsFor(content: string | Uint8Array, mode: number | undefined): { encoding?: \"utf-8\" | undefined; mode?: number | undefined } {\n return typeof content === \"string\" ? { encoding: \"utf-8\", mode } : { mode };\n}\n\nexport async function writeFileAtomic(filePath: string, content: string | Uint8Array, opts: WriteAtomicOptions = {}): Promise<void> {\n const tmp = tmpPathFor(filePath, opts.uniqueTmp);\n await promises.mkdir(path.dirname(filePath), { recursive: true });\n try {\n await promises.writeFile(tmp, content, writeOptionsFor(content, opts.mode));\n await renameWithWindowsRetry(tmp, filePath);\n } catch (err) {\n await promises.unlink(tmp).catch(() => {});\n throw err;\n }\n}\n\nexport function writeFileAtomicSync(filePath: string, content: string | Uint8Array, opts: WriteAtomicOptions = {}): void {\n const tmp = tmpPathFor(filePath, opts.uniqueTmp);\n mkdirSync(path.dirname(filePath), { recursive: true });\n try {\n writeFileSync(tmp, content, writeOptionsFor(content, opts.mode));\n renameSyncWithWindowsRetry(tmp, filePath);\n } catch (err) {\n try {\n unlinkSync(tmp);\n } catch {\n // best-eff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EACFE,CAAAA,GAAAA,QAAAA,cAAAA,CAAc,KAAK,SAAS,gBAAgB,SAAS,KAAK,IAAI,CAAC;EAC/D,2BAA2B,KAAK,QAAQ;CAC1C,SAAS,KAAK;EACZ,IAAI;GACFC,CAAAA,GAAAA,QAAAA,WAAAA,CAAW,GAAG;EAChB,QAAQ,CAER;EACA,MAAM;CACR;AACF"}
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_itemId = require("../itemId-D2XAQ8RU.cjs");
3
- const require_promptSafety = require("../promptSafety-Ctl7rOvA.cjs");
4
- const require_project = require("../project-DDTIVEMU.cjs");
5
- const require_dist = require("../dist--k7dcIzm.cjs");
6
- const require_iconGlyph = require("../iconGlyph-CFOiFsmq.cjs");
7
- require("../errorMessage-BDEhi5qf.cjs");
2
+ const require_itemId = require("../itemId-D3mJhGu0.cjs");
3
+ const require_promptSafety = require("../promptSafety-BkFiS7El.cjs");
4
+ const require_project = require("../project-sS_ltoWz.cjs");
5
+ const require_dist = require("../dist-DK0zTPR1.cjs");
6
+ const require_iconGlyph = require("../iconGlyph-BhtU1a9P.cjs");
7
+ require("../errorMessage-DCZuXjO4.cjs");
8
8
  // src/collection/core/presentCollection.ts
9
9
  var TOOL_NAME = "presentCollection";
10
10
  /** Stamp a host's opaque project scope onto a card payload. The ONLY way a
@@ -1,9 +1,9 @@
1
- import { $ as fieldText, A as collectionKeyId, B as SAFE_SLUG_PATTERN, C as decodeRecordTimes, D as isCanonicalServerTime, E as encodeServerTime, F as localCollectionKeyOf, G as AGENT_INGEST_KIND, H as isSafeRecordId, I as parseCollectionKeyId, J as INGEST_KINDS, K as COMPUTED_TYPES, L as sameCollectionKey, M as isLocalCollectionKey, N as isSharedCollectionKey, O as serverTimeMillis, P as isValidCollectionName, Q as storageKindFor, R as sharedCollectionKey, S as isAccentColor, T as encodeRecordTimes, U as isSafeSlug, V as generateUniqueId, W as nextUniqueItemId, X as isFieldDrivenEvery, Y as embedTargetId, Z as isReadOnlySchema, _ as spanOptionsFor, a as bucketRecords, b as ACCENT_COLORS, c as dateOf, d as monthAnchorDate, et as fieldTextOrNull, f as parseIsoDate, g as spanCoversDay, h as recordSpan, i as assignLanes, j as collectionKeyName, k as serverTimeOf, l as daySlice, m as parseTimeRange, n as shortHexId, o as buildMonthGrid, p as parseIsoDateTime, q as FEED_SCHEDULES, r as MINUTES_PER_DAY, s as compareYmd, t as newItemId, u as endsAtDayBoundary, v as withExclusiveEnd, w as decodeServerTime, x as accentChipClasses, y as ymdKey, z as SAFE_RECORD_ID_PATTERN } from "../itemId-D_pSpa3U.js";
2
- import { A as schemaDefaults, C as viaMatches, D as whenMatches, E as fieldVisible, O as fieldDefaultValue, S as rollupValue, T as agentActionRunKey, _ as uniqueEmbedTargets, a as evaluateDerived, b as coerceNumeric, c as selectDynamicRecord, d as flagFieldValue, f as itemIsDone, g as uniqueBacklinkSources, h as linkedSlugsForFields, k as firstUnknownDefault, l as chipMatches, m as matchesWhere, n as deriveAll, o as firstDateField, p as toggleChecked, r as resolveRowRefs, s as resolveIcon, t as defangForPrompt, u as completionCoveredByFieldChip, v as uniqueRefTargets, w as actionVisible, x as projectBacklinkRow, y as backlinkRows } from "../promptSafety-B_Jbtlcb.js";
3
- import { n as projectRecordFields, t as mergeIntoExisting } from "../project-mU6-xLfy.js";
4
- import { c as isRecord, t as errorMessage, u as isUnknownArray } from "../dist-Cb-KNFRA.js";
5
- import { n as resolveIconGlyph, t as DEFAULT_ICON } from "../iconGlyph-D9h__VaM.js";
6
- import "../errorMessage-BFkRmkyh.js";
1
+ import { $ as fieldText, A as collectionKeyId, B as SAFE_SLUG_PATTERN, C as decodeRecordTimes, D as isCanonicalServerTime, E as encodeServerTime, F as localCollectionKeyOf, G as AGENT_INGEST_KIND, H as isSafeRecordId, I as parseCollectionKeyId, J as INGEST_KINDS, K as COMPUTED_TYPES, L as sameCollectionKey, M as isLocalCollectionKey, N as isSharedCollectionKey, O as serverTimeMillis, P as isValidCollectionName, Q as storageKindFor, R as sharedCollectionKey, S as isAccentColor, T as encodeRecordTimes, U as isSafeSlug, V as generateUniqueId, W as nextUniqueItemId, X as isFieldDrivenEvery, Y as embedTargetId, Z as isReadOnlySchema, _ as spanOptionsFor, a as bucketRecords, b as ACCENT_COLORS, c as dateOf, d as monthAnchorDate, et as fieldTextOrNull, f as parseIsoDate, g as spanCoversDay, h as recordSpan, i as assignLanes, j as collectionKeyName, k as serverTimeOf, l as daySlice, m as parseTimeRange, n as shortHexId, o as buildMonthGrid, p as parseIsoDateTime, q as FEED_SCHEDULES, r as MINUTES_PER_DAY, s as compareYmd, t as newItemId, u as endsAtDayBoundary, v as withExclusiveEnd, w as decodeServerTime, x as accentChipClasses, y as ymdKey, z as SAFE_RECORD_ID_PATTERN } from "../itemId-D7pPwaX6.js";
2
+ import { A as schemaDefaults, C as viaMatches, D as whenMatches, E as fieldVisible, O as fieldDefaultValue, S as rollupValue, T as agentActionRunKey, _ as uniqueEmbedTargets, a as evaluateDerived, b as coerceNumeric, c as selectDynamicRecord, d as flagFieldValue, f as itemIsDone, g as uniqueBacklinkSources, h as linkedSlugsForFields, k as firstUnknownDefault, l as chipMatches, m as matchesWhere, n as deriveAll, o as firstDateField, p as toggleChecked, r as resolveRowRefs, s as resolveIcon, t as defangForPrompt, u as completionCoveredByFieldChip, v as uniqueRefTargets, w as actionVisible, x as projectBacklinkRow, y as backlinkRows } from "../promptSafety-Dp9Zga_t.js";
3
+ import { n as projectRecordFields, t as mergeIntoExisting } from "../project-CSx7gqgs.js";
4
+ import { c as isRecord, t as errorMessage, u as isUnknownArray } from "../dist-wmt60Ec-.js";
5
+ import { n as resolveIconGlyph, t as DEFAULT_ICON } from "../iconGlyph-DjE_HLf4.js";
6
+ import "../errorMessage-CEWGPYzN.js";
7
7
  // src/collection/core/presentCollection.ts
8
8
  var TOOL_NAME = "presentCollection";
9
9
  /** Stamp a host's opaque project scope onto a card payload. The ONLY way a
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_templatePath = require("../templatePath-BIh7wqgS.cjs");
2
+ const require_templatePath = require("../templatePath-DSawCKNy.cjs");
3
3
  exports.isSafeActionTemplatePath = require_templatePath.isSafeActionTemplatePath;
4
4
  exports.isSafeCustomViewI18nPath = require_templatePath.isSafeCustomViewI18nPath;
5
5
  exports.isSafeCustomViewPath = require_templatePath.isSafeCustomViewPath;
@@ -1 +1 @@
1
- export { t as isSafeActionTemplatePath, n as isSafeCustomViewI18nPath, r as isSafeCustomViewPath, i as isSafeTemplatePath } from "../templatePath-CB3wtVpe.js";
1
+ export { t as isSafeActionTemplatePath, n as isSafeCustomViewI18nPath, r as isSafeCustomViewPath, i as isSafeTemplatePath } from "../templatePath-B5mHTFDX.js";
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_types = require("../../types-DPycxnDf.cjs");
2
+ const require_types = require("../../types-Bmk0fWDr.cjs");
3
3
  exports.OFFICIAL_REGISTRY_NAME = require_types.OFFICIAL_REGISTRY_NAME;
4
4
  exports.parseRegistryIndex = require_types.parseRegistryIndex;
@@ -1 +1 @@
1
- export { t as OFFICIAL_REGISTRY_NAME, n as parseRegistryIndex } from "../../types-BLCZTGW2.js";
1
+ export { t as OFFICIAL_REGISTRY_NAME, n as parseRegistryIndex } from "../../types-CuiYCIof.js";
@@ -1,19 +1,19 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../../../rolldown-runtime-CmQyd0Gu.cjs");
2
+ const require_rolldown_runtime = require("../../../rolldown-runtime-C5rMTSut.cjs");
3
3
  const require_utils_fetch = require("../../../utils/fetch.cjs");
4
- const require_server = require("../../../server-B6usmOfY.cjs");
5
- const require_discovery = require("../../../discovery-D1cjgQRo.cjs");
6
- const require_types = require("../../../types-DPycxnDf.cjs");
7
- const require_skill_bridge_index = require("../../../skill-bridge/index.cjs");
8
- const require_atomic = require("../../../atomic-cqafMWEI.cjs");
9
- const require_templatePath = require("../../../templatePath-BIh7wqgS.cjs");
10
- const require_containment = require("../../../containment-Dc3gO4wD.cjs");
11
- const require_dist = require("../../../dist--k7dcIzm.cjs");
12
- const require_relPath = require("../../../relPath-CZiP2S_a.cjs");
4
+ const require_server = require("../../../server-BNmwQGcq.cjs");
5
+ const require_discovery = require("../../../discovery-Cu35oXeW.cjs");
6
+ const require_types = require("../../../types-Bmk0fWDr.cjs");
13
7
  let node_fs = require("node:fs");
8
+ let node_fs_promises = require("node:fs/promises");
14
9
  let node_path = require("node:path");
10
+ const require_skill_bridge_index = require("../../../skill-bridge/index.cjs");
11
+ const require_atomic = require("../../../atomic-bzFw4-ix.cjs");
12
+ const require_templatePath = require("../../../templatePath-DSawCKNy.cjs");
13
+ const require_containment = require("../../../containment-NZYJbiaa.cjs");
14
+ const require_dist = require("../../../dist-DK0zTPR1.cjs");
15
+ const require_relPath = require("../../../relPath-B-c9FUkm.cjs");
15
16
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
16
- let node_fs_promises = require("node:fs/promises");
17
17
  // src/collection/registry/server/registriesConfig.ts
18
18
  var NAME_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$/;
19
19
  function isValidHttpsUrl(value) {