@bendyline/docblocks 2.0.0 → 2.1.1

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 (278) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-2D7Y4IR3.js → chunk-4437YWLE.js} +123 -67
  3. package/dist/{chunk-5MYAICRE.js → chunk-45T5AFCN.js} +44 -57
  4. package/dist/{chunk-PGR7LK6D.js → chunk-6L3JRDE7.js} +14 -6
  5. package/dist/{chunk-RVQHY3XU.js → chunk-6XHOOBYF.js} +0 -1
  6. package/dist/chunk-73OOROXH.js +8 -0
  7. package/dist/{chunk-SI2LU2RP.js → chunk-AYWKIZLD.js} +1 -1
  8. package/dist/{chunk-GCPBEMMH.js → chunk-BVY7GGNV.js} +10 -21
  9. package/dist/{chunk-AEHCVWU5.js → chunk-DZB666V7.js} +0 -1
  10. package/dist/{chunk-75UUF6C4.js → chunk-HI7QEWL6.js} +18 -10
  11. package/dist/chunk-KQ6756AJ.js +28 -0
  12. package/dist/chunk-LMMOFRGQ.js +148 -0
  13. package/dist/{chunk-FNW556FN.js → chunk-M2PUNKHS.js} +0 -1
  14. package/dist/chunk-M5ZNQGR5.js +19 -0
  15. package/dist/chunk-M62ZGJ5I.js +51 -0
  16. package/dist/chunk-OQCPBOQA.js +168 -0
  17. package/dist/{chunk-EGNDADXB.js → chunk-QI6YKTQV.js} +2 -3
  18. package/dist/chunk-SJBB5OD7.js +227 -0
  19. package/dist/{chunk-EZKJZUNJ.js → chunk-XAMILHQP.js} +0 -1
  20. package/dist/{chunk-J32GU3F3.js → chunk-YM7O3PWO.js} +249 -222
  21. package/dist/{chunk-RQJRQF46.js → chunk-ZO7G53QP.js} +41 -49
  22. package/dist/document/index.d.ts +358 -6
  23. package/dist/document/index.js +24 -4
  24. package/dist/filesystem/electron.d.ts +73 -4
  25. package/dist/filesystem/electron.js +16 -4
  26. package/dist/filesystem/index.d.ts +228 -22
  27. package/dist/filesystem/index.js +133 -20
  28. package/dist/filesystem/indexeddb.d.ts +284 -5
  29. package/dist/filesystem/indexeddb.js +22 -5
  30. package/dist/filesystem/memory.d.ts +152 -4
  31. package/dist/filesystem/memory.js +12 -4
  32. package/dist/filesystem/native.d.ts +136 -4
  33. package/dist/filesystem/native.js +27 -4
  34. package/dist/host/index.d.ts +32 -9
  35. package/dist/host/index.js +26 -30
  36. package/dist/index.d.ts +14 -10
  37. package/dist/index.js +204 -10
  38. package/dist/mcp/index.d.ts +33 -4
  39. package/dist/mcp/index.js +31 -4
  40. package/dist/mcp/zod.d.ts +645 -643
  41. package/dist/mcp/zod.js +700 -885
  42. package/dist/share/index.d.ts +43 -0
  43. package/dist/share/index.js +12 -0
  44. package/dist/{types-CsX6EN2t.d.ts → types-BEg5SQ1_.d.ts} +1 -1
  45. package/dist/{types-eOlt9J7n.d.ts → types-CueK0tvU.d.ts} +34 -11
  46. package/dist/vscode/index.d.ts +225 -3
  47. package/dist/vscode/index.js +389 -3
  48. package/dist/workspace/index.d.ts +141 -4
  49. package/dist/workspace/index.js +28 -3
  50. package/package.json +10 -5
  51. package/dist/chunk-2D7Y4IR3.js.map +0 -1
  52. package/dist/chunk-5MYAICRE.js.map +0 -1
  53. package/dist/chunk-75UUF6C4.js.map +0 -1
  54. package/dist/chunk-AEHCVWU5.js.map +0 -1
  55. package/dist/chunk-AYZ4HN5M.js +0 -20
  56. package/dist/chunk-AYZ4HN5M.js.map +0 -1
  57. package/dist/chunk-EGNDADXB.js.map +0 -1
  58. package/dist/chunk-EZKJZUNJ.js.map +0 -1
  59. package/dist/chunk-FNW556FN.js.map +0 -1
  60. package/dist/chunk-GCPBEMMH.js.map +0 -1
  61. package/dist/chunk-J32GU3F3.js.map +0 -1
  62. package/dist/chunk-PGR7LK6D.js.map +0 -1
  63. package/dist/chunk-RQJRQF46.js.map +0 -1
  64. package/dist/chunk-RVQHY3XU.js.map +0 -1
  65. package/dist/chunk-SI2LU2RP.js.map +0 -1
  66. package/dist/chunk-W5UUUII5.js +0 -142
  67. package/dist/chunk-W5UUUII5.js.map +0 -1
  68. package/dist/document/document-session.d.ts +0 -127
  69. package/dist/document/document-session.d.ts.map +0 -1
  70. package/dist/document/document-session.js +0 -749
  71. package/dist/document/document-session.js.map +0 -1
  72. package/dist/document/filesystem-target.d.ts +0 -17
  73. package/dist/document/filesystem-target.d.ts.map +0 -1
  74. package/dist/document/filesystem-target.js +0 -70
  75. package/dist/document/filesystem-target.js.map +0 -1
  76. package/dist/document/index.d.ts.map +0 -1
  77. package/dist/document/index.js.map +0 -1
  78. package/dist/document/recovery-journal.d.ts +0 -125
  79. package/dist/document/recovery-journal.d.ts.map +0 -1
  80. package/dist/document/recovery-journal.js +0 -385
  81. package/dist/document/recovery-journal.js.map +0 -1
  82. package/dist/document/types.d.ts +0 -89
  83. package/dist/document/types.d.ts.map +0 -1
  84. package/dist/document/types.js +0 -9
  85. package/dist/document/types.js.map +0 -1
  86. package/dist/filesystem/commit-lock.d.ts +0 -3
  87. package/dist/filesystem/commit-lock.d.ts.map +0 -1
  88. package/dist/filesystem/commit-lock.js +0 -20
  89. package/dist/filesystem/commit-lock.js.map +0 -1
  90. package/dist/filesystem/dbk-workspace.d.ts +0 -34
  91. package/dist/filesystem/dbk-workspace.d.ts.map +0 -1
  92. package/dist/filesystem/dbk-workspace.js +0 -85
  93. package/dist/filesystem/dbk-workspace.js.map +0 -1
  94. package/dist/filesystem/electron-provider-v2.d.ts +0 -36
  95. package/dist/filesystem/electron-provider-v2.d.ts.map +0 -1
  96. package/dist/filesystem/electron-provider-v2.js +0 -503
  97. package/dist/filesystem/electron-provider-v2.js.map +0 -1
  98. package/dist/filesystem/electron-provider.d.ts +0 -35
  99. package/dist/filesystem/electron-provider.d.ts.map +0 -1
  100. package/dist/filesystem/electron-provider.js +0 -69
  101. package/dist/filesystem/electron-provider.js.map +0 -1
  102. package/dist/filesystem/electron.d.ts.map +0 -1
  103. package/dist/filesystem/electron.js.map +0 -1
  104. package/dist/filesystem/file-media-provider.d.ts +0 -23
  105. package/dist/filesystem/file-media-provider.d.ts.map +0 -1
  106. package/dist/filesystem/file-media-provider.js +0 -85
  107. package/dist/filesystem/file-media-provider.js.map +0 -1
  108. package/dist/filesystem/filesystem-content-container.d.ts +0 -24
  109. package/dist/filesystem/filesystem-content-container.d.ts.map +0 -1
  110. package/dist/filesystem/filesystem-content-container.js +0 -153
  111. package/dist/filesystem/filesystem-content-container.js.map +0 -1
  112. package/dist/filesystem/fs-error.d.ts +0 -46
  113. package/dist/filesystem/fs-error.d.ts.map +0 -1
  114. package/dist/filesystem/fs-error.js +0 -170
  115. package/dist/filesystem/fs-error.js.map +0 -1
  116. package/dist/filesystem/index.d.ts.map +0 -1
  117. package/dist/filesystem/index.js.map +0 -1
  118. package/dist/filesystem/indexeddb-content-container.d.ts +0 -22
  119. package/dist/filesystem/indexeddb-content-container.d.ts.map +0 -1
  120. package/dist/filesystem/indexeddb-content-container.js +0 -100
  121. package/dist/filesystem/indexeddb-content-container.js.map +0 -1
  122. package/dist/filesystem/indexeddb-provider-v2.d.ts +0 -96
  123. package/dist/filesystem/indexeddb-provider-v2.d.ts.map +0 -1
  124. package/dist/filesystem/indexeddb-provider-v2.js +0 -1241
  125. package/dist/filesystem/indexeddb-provider-v2.js.map +0 -1
  126. package/dist/filesystem/indexeddb-provider.d.ts +0 -39
  127. package/dist/filesystem/indexeddb-provider.d.ts.map +0 -1
  128. package/dist/filesystem/indexeddb-provider.js +0 -145
  129. package/dist/filesystem/indexeddb-provider.js.map +0 -1
  130. package/dist/filesystem/indexeddb-store.d.ts +0 -34
  131. package/dist/filesystem/indexeddb-store.d.ts.map +0 -1
  132. package/dist/filesystem/indexeddb-store.js +0 -165
  133. package/dist/filesystem/indexeddb-store.js.map +0 -1
  134. package/dist/filesystem/indexeddb.d.ts.map +0 -1
  135. package/dist/filesystem/indexeddb.js.map +0 -1
  136. package/dist/filesystem/legacy-v2-adapter.d.ts +0 -62
  137. package/dist/filesystem/legacy-v2-adapter.d.ts.map +0 -1
  138. package/dist/filesystem/legacy-v2-adapter.js +0 -499
  139. package/dist/filesystem/legacy-v2-adapter.js.map +0 -1
  140. package/dist/filesystem/memory-provider-v2.d.ts +0 -92
  141. package/dist/filesystem/memory-provider-v2.d.ts.map +0 -1
  142. package/dist/filesystem/memory-provider-v2.js +0 -615
  143. package/dist/filesystem/memory-provider-v2.js.map +0 -1
  144. package/dist/filesystem/memory-provider.d.ts +0 -54
  145. package/dist/filesystem/memory-provider.d.ts.map +0 -1
  146. package/dist/filesystem/memory-provider.js +0 -132
  147. package/dist/filesystem/memory-provider.js.map +0 -1
  148. package/dist/filesystem/memory.d.ts.map +0 -1
  149. package/dist/filesystem/memory.js.map +0 -1
  150. package/dist/filesystem/move-entry.d.ts +0 -9
  151. package/dist/filesystem/move-entry.d.ts.map +0 -1
  152. package/dist/filesystem/move-entry.js +0 -103
  153. package/dist/filesystem/move-entry.js.map +0 -1
  154. package/dist/filesystem/move-error.d.ts +0 -53
  155. package/dist/filesystem/move-error.d.ts.map +0 -1
  156. package/dist/filesystem/move-error.js +0 -99
  157. package/dist/filesystem/move-error.js.map +0 -1
  158. package/dist/filesystem/native-provider-v2.d.ts +0 -75
  159. package/dist/filesystem/native-provider-v2.d.ts.map +0 -1
  160. package/dist/filesystem/native-provider-v2.js +0 -849
  161. package/dist/filesystem/native-provider-v2.js.map +0 -1
  162. package/dist/filesystem/native-provider.d.ts +0 -53
  163. package/dist/filesystem/native-provider.d.ts.map +0 -1
  164. package/dist/filesystem/native-provider.js +0 -471
  165. package/dist/filesystem/native-provider.js.map +0 -1
  166. package/dist/filesystem/native.d.ts.map +0 -1
  167. package/dist/filesystem/native.js.map +0 -1
  168. package/dist/filesystem/types.d.ts +0 -83
  169. package/dist/filesystem/types.d.ts.map +0 -1
  170. package/dist/filesystem/types.js +0 -16
  171. package/dist/filesystem/types.js.map +0 -1
  172. package/dist/filesystem/v2.d.ts +0 -172
  173. package/dist/filesystem/v2.d.ts.map +0 -1
  174. package/dist/filesystem/v2.js +0 -16
  175. package/dist/filesystem/v2.js.map +0 -1
  176. package/dist/filesystem/workspace-path.d.ts +0 -21
  177. package/dist/filesystem/workspace-path.d.ts.map +0 -1
  178. package/dist/filesystem/workspace-path.js +0 -80
  179. package/dist/filesystem/workspace-path.js.map +0 -1
  180. package/dist/host/filesystem-v2.d.ts +0 -45
  181. package/dist/host/filesystem-v2.d.ts.map +0 -1
  182. package/dist/host/filesystem-v2.js +0 -13
  183. package/dist/host/filesystem-v2.js.map +0 -1
  184. package/dist/host/git.d.ts +0 -200
  185. package/dist/host/git.d.ts.map +0 -1
  186. package/dist/host/git.js +0 -15
  187. package/dist/host/git.js.map +0 -1
  188. package/dist/host/index.d.ts.map +0 -1
  189. package/dist/host/index.js.map +0 -1
  190. package/dist/host/types.d.ts +0 -232
  191. package/dist/host/types.d.ts.map +0 -1
  192. package/dist/host/types.js +0 -10
  193. package/dist/host/types.js.map +0 -1
  194. package/dist/host/wire-policy.d.ts +0 -22
  195. package/dist/host/wire-policy.d.ts.map +0 -1
  196. package/dist/host/wire-policy.js +0 -92
  197. package/dist/host/wire-policy.js.map +0 -1
  198. package/dist/index.d.ts.map +0 -1
  199. package/dist/index.js.map +0 -1
  200. package/dist/mcp/index.d.ts.map +0 -1
  201. package/dist/mcp/index.js.map +0 -1
  202. package/dist/mcp/types.d.ts +0 -466
  203. package/dist/mcp/types.d.ts.map +0 -1
  204. package/dist/mcp/types.js +0 -25
  205. package/dist/mcp/types.js.map +0 -1
  206. package/dist/mcp/wire.d.ts +0 -29
  207. package/dist/mcp/wire.d.ts.map +0 -1
  208. package/dist/mcp/wire.js +0 -1046
  209. package/dist/mcp/wire.js.map +0 -1
  210. package/dist/mcp/zod.d.ts.map +0 -1
  211. package/dist/mcp/zod.js.map +0 -1
  212. package/dist/vscode/index.d.ts.map +0 -1
  213. package/dist/vscode/index.js.map +0 -1
  214. package/dist/vscode/messages.d.ts +0 -204
  215. package/dist/vscode/messages.d.ts.map +0 -1
  216. package/dist/vscode/messages.js +0 -494
  217. package/dist/vscode/messages.js.map +0 -1
  218. package/dist/workspace/index.d.ts.map +0 -1
  219. package/dist/workspace/index.js.map +0 -1
  220. package/dist/workspace/reconcile-electron.d.ts +0 -19
  221. package/dist/workspace/reconcile-electron.d.ts.map +0 -1
  222. package/dist/workspace/reconcile-electron.js +0 -42
  223. package/dist/workspace/reconcile-electron.js.map +0 -1
  224. package/dist/workspace/types.d.ts +0 -69
  225. package/dist/workspace/types.d.ts.map +0 -1
  226. package/dist/workspace/types.js +0 -2
  227. package/dist/workspace/types.js.map +0 -1
  228. package/dist/workspace/workspace-manager.d.ts +0 -47
  229. package/dist/workspace/workspace-manager.d.ts.map +0 -1
  230. package/dist/workspace/workspace-manager.js +0 -126
  231. package/dist/workspace/workspace-manager.js.map +0 -1
  232. package/src/document/document-session.ts +0 -834
  233. package/src/document/filesystem-target.ts +0 -109
  234. package/src/document/index.ts +0 -41
  235. package/src/document/recovery-journal.ts +0 -536
  236. package/src/document/types.ts +0 -116
  237. package/src/filesystem/commit-lock.ts +0 -29
  238. package/src/filesystem/dbk-workspace.ts +0 -135
  239. package/src/filesystem/electron-provider-v2.ts +0 -630
  240. package/src/filesystem/electron-provider.ts +0 -99
  241. package/src/filesystem/electron.ts +0 -3
  242. package/src/filesystem/file-media-provider.ts +0 -103
  243. package/src/filesystem/filesystem-content-container.ts +0 -164
  244. package/src/filesystem/fs-error.ts +0 -234
  245. package/src/filesystem/index.ts +0 -143
  246. package/src/filesystem/indexeddb-content-container.ts +0 -112
  247. package/src/filesystem/indexeddb-provider-v2.ts +0 -1740
  248. package/src/filesystem/indexeddb-provider.ts +0 -171
  249. package/src/filesystem/indexeddb-store.ts +0 -207
  250. package/src/filesystem/indexeddb.ts +0 -12
  251. package/src/filesystem/legacy-v2-adapter.ts +0 -779
  252. package/src/filesystem/memory-provider-v2.ts +0 -896
  253. package/src/filesystem/memory-provider.ts +0 -180
  254. package/src/filesystem/memory.ts +0 -15
  255. package/src/filesystem/move-entry.ts +0 -142
  256. package/src/filesystem/move-error.ts +0 -159
  257. package/src/filesystem/native-provider-v2.ts +0 -1165
  258. package/src/filesystem/native-provider.ts +0 -537
  259. package/src/filesystem/native.ts +0 -16
  260. package/src/filesystem/types.ts +0 -114
  261. package/src/filesystem/v2.ts +0 -231
  262. package/src/filesystem/workspace-path.ts +0 -92
  263. package/src/host/filesystem-v2.ts +0 -104
  264. package/src/host/git.ts +0 -246
  265. package/src/host/index.ts +0 -93
  266. package/src/host/types.ts +0 -274
  267. package/src/host/wire-policy.ts +0 -103
  268. package/src/index.ts +0 -10
  269. package/src/mcp/index.ts +0 -3
  270. package/src/mcp/types.ts +0 -594
  271. package/src/mcp/wire.ts +0 -1280
  272. package/src/mcp/zod.ts +0 -1000
  273. package/src/vscode/index.ts +0 -2
  274. package/src/vscode/messages.ts +0 -704
  275. package/src/workspace/index.ts +0 -17
  276. package/src/workspace/reconcile-electron.ts +0 -65
  277. package/src/workspace/types.ts +0 -67
  278. package/src/workspace/workspace-manager.ts +0 -151
package/README.md CHANGED
@@ -55,8 +55,8 @@ compatibility `filesystem` barrel still re-exports every provider, but eagerly
55
55
  constructing from that barrel puts mutually exclusive backends in one startup
56
56
  bundle.
57
57
 
58
- Mutation behavior is explicit: `writeFile` requires a `create`, `replace`, or
59
- `upsert` mode; `remove` distinguishes an empty-directory removal from a
58
+ Mutation behavior is explicit: `writeFile` accepts a `create`, `replace`, or
59
+ `upsert` mode and defaults to `upsert` when omitted; `remove` distinguishes an empty-directory removal from a
60
60
  recursive tree removal; and `move` never overwrites its destination. Missing
61
61
  entries are returned as `null` only by `stat` and `readFile`. Permission,
62
62
  wrong-kind, conflict, quota, and I/O failures remain typed `FsError`s.
@@ -1,9 +1,19 @@
1
1
  import {
2
2
  withFileCommitLock
3
- } from "./chunk-AEHCVWU5.js";
3
+ } from "./chunk-DZB666V7.js";
4
4
  import {
5
+ parentChain
6
+ } from "./chunk-KQ6756AJ.js";
7
+ import {
8
+ bytesEqual,
9
+ compareSnapshotsByName,
10
+ compareText,
11
+ copyBytes,
5
12
  parseFileSystemVersion
6
- } from "./chunk-AYZ4HN5M.js";
13
+ } from "./chunk-M62ZGJ5I.js";
14
+ import {
15
+ decodeUtf8Text
16
+ } from "./chunk-M5ZNQGR5.js";
7
17
  import {
8
18
  FsError,
9
19
  WORKSPACE_ROOT,
@@ -13,7 +23,7 @@ import {
13
23
  workspacePathContains,
14
24
  workspacePathDirname,
15
25
  workspacePathJoin
16
- } from "./chunk-SI2LU2RP.js";
26
+ } from "./chunk-AYWKIZLD.js";
17
27
 
18
28
  // src/filesystem/native-provider-v2.ts
19
29
  var NativeFileSystemMoveRecoveryError = class extends FsError {
@@ -102,7 +112,7 @@ var NativeFileSystemProviderV2 = class {
102
112
  withoutData((await this.scanMetadataHandle(childPath, childHandle, "list")).root)
103
113
  );
104
114
  }
105
- children.sort(compareSnapshots);
115
+ children.sort(compareSnapshotsByName);
106
116
  return Object.freeze(children);
107
117
  });
108
118
  }
@@ -141,7 +151,7 @@ var NativeFileSystemProviderV2 = class {
141
151
  await this.writeBytes(canonical, ownedData);
142
152
  writeCompleted = true;
143
153
  const written = await this.requireSnapshot(canonical, "write");
144
- if (written.root.kind !== "file" || !equalBytes(written.root.data, ownedData)) {
154
+ if (written.root.kind !== "file" || !bytesEqual(written.root.data, ownedData)) {
145
155
  throw this.error(
146
156
  "conflict",
147
157
  "write",
@@ -282,7 +292,7 @@ var NativeFileSystemProviderV2 = class {
282
292
  }
283
293
  const createdParents = await this.createDirectories(missingParents);
284
294
  let destinationVersion = null;
285
- let sourceDeleted = false;
295
+ let sourceDeleteAttempted = false;
286
296
  try {
287
297
  await this.writeTree(source, sourcePath, destinationPath);
288
298
  const copied = await this.requireSnapshot(destinationPath, "move");
@@ -302,8 +312,15 @@ var NativeFileSystemProviderV2 = class {
302
312
  destinationPath
303
313
  });
304
314
  }
315
+ if (!await this.matchesCapturedSource(sourcePath, source)) {
316
+ throw new FsError("conflict", "Source changed while the move was copied.", {
317
+ operation: "move",
318
+ path: sourcePath,
319
+ destinationPath
320
+ });
321
+ }
322
+ sourceDeleteAttempted = true;
305
323
  await this.removeEntry(sourcePath, source.root.kind === "directory");
306
- sourceDeleted = true;
307
324
  const [sourceAfter, destinationAfter] = await Promise.all([
308
325
  this.tryScanMetadata(sourcePath, "move"),
309
326
  this.tryScanMetadata(destinationPath, "move")
@@ -323,7 +340,7 @@ var NativeFileSystemProviderV2 = class {
323
340
  source,
324
341
  createdParents,
325
342
  destinationVersion,
326
- sourceDeleted,
343
+ sourceDeleteAttempted,
327
344
  error
328
345
  );
329
346
  }
@@ -513,7 +530,7 @@ var NativeFileSystemProviderV2 = class {
513
530
  await this.scanHandle(workspacePathJoin(path, name), childHandle, operation, scanFile)
514
531
  );
515
532
  }
516
- const childRoots = children.map((child) => child.root).sort(compareSnapshots);
533
+ const childRoots = children.map((child) => child.root).sort(compareSnapshotsByName);
517
534
  const version = await metadataVersion(
518
535
  "directory",
519
536
  new TextEncoder().encode(
@@ -574,6 +591,25 @@ var NativeFileSystemProviderV2 = class {
574
591
  kind: "file",
575
592
  path,
576
593
  name: workspacePathBasename(path),
594
+ // Derived from size + mtime, never from content. This keeps stat/list
595
+ // proportional to entry count instead of bytes (see scanMetadataHandle),
596
+ // which is what makes large workspaces listable in a browser tab at all.
597
+ //
598
+ // The cost is a real blind spot: an external same-size rewrite inside one
599
+ // mtime tick is invisible here. FAT/exFAT stamp mtime at 2-second
600
+ // granularity, and network shares can be coarser, so this is reachable on
601
+ // removable and mounted volumes rather than merely theoretical. Two
602
+ // consequences follow, and neither is hypothetical:
603
+ // - a conditional write guarded on expectedVersion accepts, silently
604
+ // overwriting the external edit;
605
+ // - move() re-checks this version to prove the source is unchanged
606
+ // before deleting it, so it can delete a source whose bytes it never
607
+ // copied, losing the edit outright.
608
+ // `conditionalWrite: 'process'` declares the first (expectedVersion binds
609
+ // only against writers in this process). The second is a provider-internal
610
+ // check that the token cannot actually support; closing it means
611
+ // byte-comparing the captured source before the delete, not hashing
612
+ // content here, which would undo the scan-by-metadata property above.
577
613
  size: file.size,
578
614
  version: await metadataVersion(
579
615
  "file",
@@ -663,28 +699,44 @@ var NativeFileSystemProviderV2 = class {
663
699
  if (entry.kind === "file") await this.writeBytes(path, entry.data);
664
700
  }
665
701
  }
666
- async rollbackMoveAndThrow(sourcePath, destinationPath, source, createdParents, destinationVersion, sourceDeleted, primary) {
702
+ async rollbackMoveAndThrow(sourcePath, destinationPath, source, createdParents, destinationVersion, sourceDeleteAttempted, primary) {
667
703
  const primaryError = this.translateError(primary, "move", sourcePath, destinationPath);
668
704
  const recoveryErrors = [];
669
- const sourceCurrent = await this.probeScan(sourcePath);
670
- if (sourceCurrent === null && sourceDeleted) {
671
- try {
672
- await this.writeTree(source, sourcePath, sourcePath);
673
- const restored = await this.probeSnapshot(sourcePath);
674
- if (!restored || !equalTreeContents(source, sourcePath, restored, sourcePath)) {
675
- throw new FsError("conflict", "Restored source does not match its captured state.", {
676
- operation: "move",
677
- path: sourcePath,
678
- destinationPath
679
- });
705
+ let sourceWhole = true;
706
+ if (sourceDeleteAttempted) {
707
+ sourceWhole = await this.matchesCapturedSource(sourcePath, source);
708
+ if (!sourceWhole) {
709
+ try {
710
+ await this.writeTree(source, sourcePath, sourcePath);
711
+ const restored = await this.probeSnapshot(sourcePath);
712
+ if (!restored || !equalTreeContents(source, sourcePath, restored, sourcePath)) {
713
+ throw new FsError("conflict", "Restored source does not match its captured state.", {
714
+ operation: "move",
715
+ path: sourcePath,
716
+ destinationPath
717
+ });
718
+ }
719
+ sourceWhole = true;
720
+ } catch (error) {
721
+ recoveryErrors.push(this.translateError(error, "move", sourcePath, destinationPath));
680
722
  }
681
- } catch (error) {
682
- recoveryErrors.push(this.translateError(error, "move", sourcePath, destinationPath));
683
723
  }
684
724
  }
685
725
  const destinationCurrent = await this.probeScan(destinationPath);
686
726
  if (destinationCurrent) {
687
- if (destinationVersion && destinationCurrent.root.version !== destinationVersion) {
727
+ if (!sourceWhole) {
728
+ recoveryErrors.push(
729
+ new FsError(
730
+ "conflict",
731
+ "Source is incomplete; rollback kept the copy at the destination.",
732
+ {
733
+ operation: "move",
734
+ path: sourcePath,
735
+ destinationPath
736
+ }
737
+ )
738
+ );
739
+ } else if (destinationVersion && destinationCurrent.root.version !== destinationVersion) {
688
740
  recoveryErrors.push(
689
741
  new FsError("conflict", "Destination changed; rollback will not delete it.", {
690
742
  operation: "move",
@@ -716,6 +768,18 @@ var NativeFileSystemProviderV2 = class {
716
768
  state
717
769
  );
718
770
  }
771
+ /**
772
+ * Whether the source still holds exactly the bytes the move captured.
773
+ *
774
+ * A probe that fails answers "no": rollback must never treat an unverifiable
775
+ * source as whole, because that is precisely what licenses deleting the copy
776
+ * at the destination.
777
+ */
778
+ async matchesCapturedSource(sourcePath, source) {
779
+ const current = await this.probeSnapshot(sourcePath);
780
+ if (!current) return false;
781
+ return equalTreeContents(source, sourcePath, current, sourcePath);
782
+ }
719
783
  async probeScan(path) {
720
784
  try {
721
785
  return await this.tryScanMetadata(path, "move");
@@ -784,15 +848,6 @@ async function metadataVersion(kind, metadata, operation, path) {
784
848
  const hex = [...new Uint8Array(digest)].map((value) => value.toString(16).padStart(2, "0")).join("");
785
849
  return parseFileSystemVersion(`sha256:${hex}`);
786
850
  }
787
- function parentChain(path) {
788
- const parents = [];
789
- let current = workspacePathDirname(path);
790
- while (current) {
791
- parents.unshift(current);
792
- current = workspacePathDirname(current);
793
- }
794
- return parents;
795
- }
796
851
  function pathDepth(path) {
797
852
  return path ? path.split("/").length : 0;
798
853
  }
@@ -805,17 +860,6 @@ function isMissingOrKindError(error) {
805
860
  const name = errorName(error);
806
861
  return name === "NotFoundError" || name === "TypeMismatchError";
807
862
  }
808
- function copyBytes(data) {
809
- const source = ArrayBuffer.isView(data) ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength) : new Uint8Array(data);
810
- const copy = new Uint8Array(source.byteLength);
811
- copy.set(source);
812
- return copy.buffer;
813
- }
814
- function equalBytes(left, right) {
815
- const leftBytes = new Uint8Array(left);
816
- const rightBytes = new Uint8Array(right);
817
- return leftBytes.byteLength === rightBytes.byteLength && leftBytes.every((value, index) => value === rightBytes[index]);
818
- }
819
863
  function equalTreeContents(left, leftRoot, right, rightRoot) {
820
864
  if (left.entries.length !== right.entries.length) return false;
821
865
  const rightByRelativePath = /* @__PURE__ */ new Map();
@@ -830,7 +874,7 @@ function equalTreeContents(left, leftRoot, right, rightRoot) {
830
874
  const counterpart = rightByRelativePath.get(relativePath);
831
875
  if (!counterpart || counterpart.kind !== entry.kind) return false;
832
876
  if (entry.kind === "file") {
833
- if (counterpart.kind !== "file" || !equalBytes(entry.data, counterpart.data)) return false;
877
+ if (counterpart.kind !== "file" || !bytesEqual(entry.data, counterpart.data)) return false;
834
878
  }
835
879
  }
836
880
  return true;
@@ -871,13 +915,6 @@ function newestLastModified(children) {
871
915
  }
872
916
  return newest ? new Date(newest).toISOString() : EPOCH;
873
917
  }
874
- function compareSnapshots(left, right) {
875
- if (left.kind !== right.kind) return left.kind === "directory" ? -1 : 1;
876
- return compareText(left.name, right.name);
877
- }
878
- function compareText(left, right) {
879
- return left < right ? -1 : left > right ? 1 : 0;
880
- }
881
918
 
882
919
  // src/filesystem/native-provider.ts
883
920
  function isNativeFileSystemSupported() {
@@ -950,6 +987,21 @@ function isMissingEntryError(error) {
950
987
  const name = errorName2(error);
951
988
  return name === "NotFoundError" || name === "TypeMismatchError";
952
989
  }
990
+ function isKindMismatchError(error) {
991
+ return errorName2(error) === "TypeMismatchError";
992
+ }
993
+ function rootIsNotAMutationTarget(operation, path) {
994
+ return new FsError("invalid-path", "The workspace root is not a file entry.", {
995
+ operation,
996
+ path
997
+ });
998
+ }
999
+ function notAFile(operation, path) {
1000
+ return new FsError("type-mismatch", "Expected a file but found a directory.", {
1001
+ operation,
1002
+ path
1003
+ });
1004
+ }
953
1005
  function isPermissionError(error) {
954
1006
  const name = errorName2(error);
955
1007
  return name === "NotAllowedError" || name === "SecurityError";
@@ -1036,22 +1088,16 @@ var NativeFileSystemProvider = class {
1036
1088
  }
1037
1089
  async readFile(path) {
1038
1090
  const p = normalisePath(path);
1039
- const dir = await resolveDir(this.root, parentDir(p));
1040
- if (!dir) return null;
1041
- try {
1042
- const fileHandle = await dir.getFileHandle(baseName(p));
1043
- const file = await fileHandle.getFile();
1044
- return file.text();
1045
- } catch (error) {
1046
- if (isMissingEntryError(error)) return null;
1047
- throw error;
1048
- }
1091
+ const data = await this.readBinary(p);
1092
+ if (data === null) return null;
1093
+ return decodeUtf8Text(data, { label: "The file", operation: "read", path: p });
1049
1094
  }
1050
1095
  async writeFile(path, content) {
1051
1096
  return this.withMutationLock(() => this.writeFileUnlocked(path, content));
1052
1097
  }
1053
1098
  async writeFileUnlocked(path, content) {
1054
1099
  const p = normalisePath(path);
1100
+ if (!p) throw rootIsNotAMutationTarget("write", path);
1055
1101
  const dir = await resolveDirCreate(this.root, parentDir(p));
1056
1102
  const fileHandle = await dir.getFileHandle(baseName(p), { create: true });
1057
1103
  const writable = await fileHandle.createWritable();
@@ -1079,7 +1125,7 @@ var NativeFileSystemProvider = class {
1079
1125
  }
1080
1126
  async deleteUnlocked(path) {
1081
1127
  const p = normalisePath(path);
1082
- if (!p) throw new Error("Cannot delete the filesystem root");
1128
+ if (!p) throw rootIsNotAMutationTarget("remove", path);
1083
1129
  const parent = parentDir(p);
1084
1130
  const name = baseName(p);
1085
1131
  const dir = await resolveDir(this.root, parent);
@@ -1098,9 +1144,7 @@ var NativeFileSystemProvider = class {
1098
1144
  const op = normalisePath(oldPath);
1099
1145
  const np = normalisePath(newPath);
1100
1146
  if (op === np) return;
1101
- if (!op || !np) {
1102
- throw new Error("Cannot rename the filesystem root");
1103
- }
1147
+ if (!op || !np) throw rootIsNotAMutationTarget("move", !op ? oldPath : newPath);
1104
1148
  if (np.startsWith(op + "/")) {
1105
1149
  throw new Error("Cannot move a directory into itself");
1106
1150
  }
@@ -1154,6 +1198,14 @@ var NativeFileSystemProvider = class {
1154
1198
  try {
1155
1199
  await this.deleteUnlocked(op);
1156
1200
  } catch (error) {
1201
+ try {
1202
+ await this.copyDirectory(np, op);
1203
+ } catch (restoreError) {
1204
+ throw new NativeMoveRecoveryError(
1205
+ `Move partially deleted the source and it could not be restored; the copy at ${newPath} was kept: ${oldPath} -> ${newPath}`,
1206
+ [error, restoreError]
1207
+ );
1208
+ }
1157
1209
  try {
1158
1210
  await this.deleteUnlocked(np);
1159
1211
  } catch (rollbackError) {
@@ -1186,6 +1238,7 @@ var NativeFileSystemProvider = class {
1186
1238
  }
1187
1239
  async exists(path) {
1188
1240
  const p = normalisePath(path);
1241
+ if (!p) return true;
1189
1242
  const parent = parentDir(p);
1190
1243
  const name = baseName(p);
1191
1244
  const dir = await resolveDir(this.root, parent);
@@ -1212,6 +1265,7 @@ var NativeFileSystemProvider = class {
1212
1265
  }
1213
1266
  async stat(path) {
1214
1267
  const p = normalisePath(path);
1268
+ if (!p) return null;
1215
1269
  const dir = await resolveDir(this.root, parentDir(p));
1216
1270
  if (!dir) return null;
1217
1271
  try {
@@ -1230,6 +1284,7 @@ var NativeFileSystemProvider = class {
1230
1284
  }
1231
1285
  async readBinary(path) {
1232
1286
  const p = normalisePath(path);
1287
+ if (!p) throw notAFile("read", p);
1233
1288
  const dir = await resolveDir(this.root, parentDir(p));
1234
1289
  if (!dir) return null;
1235
1290
  try {
@@ -1237,6 +1292,7 @@ var NativeFileSystemProvider = class {
1237
1292
  const file = await fileHandle.getFile();
1238
1293
  return file.arrayBuffer();
1239
1294
  } catch (error) {
1295
+ if (isKindMismatchError(error)) throw notAFile("read", p);
1240
1296
  if (isMissingEntryError(error)) return null;
1241
1297
  throw error;
1242
1298
  }
@@ -1246,6 +1302,7 @@ var NativeFileSystemProvider = class {
1246
1302
  }
1247
1303
  async writeBinaryUnlocked(path, data) {
1248
1304
  const p = normalisePath(path);
1305
+ if (!p) throw rootIsNotAMutationTarget("write", path);
1249
1306
  const dir = await resolveDirCreate(this.root, parentDir(p));
1250
1307
  const fileHandle = await dir.getFileHandle(baseName(p), { create: true });
1251
1308
  const writable = await fileHandle.createWritable();
@@ -1290,4 +1347,3 @@ export {
1290
1347
  openNativeFolder,
1291
1348
  restoreNativeFolder
1292
1349
  };
1293
- //# sourceMappingURL=chunk-2D7Y4IR3.js.map
@@ -1,12 +1,19 @@
1
1
  import {
2
+ guessMimeType
3
+ } from "./chunk-YM7O3PWO.js";
4
+ import {
5
+ bytesEqual,
6
+ compareSnapshotsByName,
7
+ compareText,
8
+ copyBytes,
2
9
  parseFileSystemVersion
3
- } from "./chunk-AYZ4HN5M.js";
10
+ } from "./chunk-M62ZGJ5I.js";
4
11
  import {
5
12
  FileSystemMoveRecoveryError,
6
13
  FileSystemPartialMoveError,
7
14
  describeEntryMove,
8
15
  describePartialMove
9
- } from "./chunk-EGNDADXB.js";
16
+ } from "./chunk-QI6YKTQV.js";
10
17
  import {
11
18
  FsError,
12
19
  WORKSPACE_ROOT,
@@ -17,10 +24,10 @@ import {
17
24
  workspacePathDirname,
18
25
  workspacePathJoin,
19
26
  workspacePathToLegacy
20
- } from "./chunk-SI2LU2RP.js";
27
+ } from "./chunk-AYWKIZLD.js";
21
28
  import {
22
29
  getFileSystemProviderV2
23
- } from "./chunk-EZKJZUNJ.js";
30
+ } from "./chunk-XAMILHQP.js";
24
31
 
25
32
  // src/filesystem/legacy-v2-adapter.ts
26
33
  var EPOCH = (/* @__PURE__ */ new Date(0)).toISOString();
@@ -76,7 +83,7 @@ var LegacyFileSystemProviderV2Adapter = class {
76
83
  if (entry.kind !== "directory") {
77
84
  throw this.error("type-mismatch", "list", canonical, "Expected a directory, found a file.");
78
85
  }
79
- const children = [...tree.entries.entries()].filter(([entryPath]) => entryPath && workspacePathDirname(entryPath) === canonical).map(([, child]) => copyEntrySnapshot(child)).sort(compareSnapshots);
86
+ const children = [...tree.entries.entries()].filter(([entryPath]) => entryPath && workspacePathDirname(entryPath) === canonical).map(([, child]) => copyEntrySnapshot(child)).sort(compareSnapshotsByName);
80
87
  return Object.freeze(children);
81
88
  });
82
89
  }
@@ -109,7 +116,7 @@ var LegacyFileSystemProviderV2Adapter = class {
109
116
  canonical
110
117
  );
111
118
  const written = (await this.captureTree("write")).entries.get(canonical);
112
- if (written?.kind !== "file" || !equalBytes(written.data, ownedData)) {
119
+ if (written?.kind !== "file" || !bytesEqual(written.data, ownedData)) {
113
120
  throw this.error(
114
121
  "io",
115
122
  "write",
@@ -435,7 +442,7 @@ var LegacyFileSystemProviderV2Adapter = class {
435
442
  children.push(file);
436
443
  }
437
444
  }
438
- children.sort(compareSnapshots);
445
+ children.sort(compareSnapshotsByName);
439
446
  const version = await contentVersion(
440
447
  "directory",
441
448
  new TextEncoder().encode(
@@ -543,17 +550,6 @@ function isLegacyEntry(value) {
543
550
  const candidate = value;
544
551
  return (candidate.kind === "file" || candidate.kind === "directory") && typeof candidate.name === "string" && typeof candidate.path === "string";
545
552
  }
546
- function copyBytes(data) {
547
- const source = ArrayBuffer.isView(data) ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength) : new Uint8Array(data);
548
- const copy = new Uint8Array(source.byteLength);
549
- copy.set(source);
550
- return copy.buffer;
551
- }
552
- function equalBytes(left, right) {
553
- const leftBytes = new Uint8Array(left);
554
- const rightBytes = new Uint8Array(right);
555
- return leftBytes.byteLength === rightBytes.byteLength && leftBytes.every((value, index) => value === rightBytes[index]);
556
- }
557
553
  function fileMetadata(file) {
558
554
  return Object.freeze({
559
555
  kind: "file",
@@ -581,13 +577,6 @@ function newestLastModified(children) {
581
577
  }
582
578
  return newest ? new Date(newest).toISOString() : EPOCH;
583
579
  }
584
- function compareSnapshots(left, right) {
585
- if (left.kind !== right.kind) return left.kind === "directory" ? -1 : 1;
586
- return compareText(left.name, right.name);
587
- }
588
- function compareText(left, right) {
589
- return left < right ? -1 : left > right ? 1 : 0;
590
- }
591
580
 
592
581
  // src/filesystem/move-entry.ts
593
582
  function normalisePath(path) {
@@ -690,7 +679,10 @@ async function moveFileSystemEntry(provider, oldPath, newPath, kind) {
690
679
 
691
680
  // src/filesystem/dbk-workspace.ts
692
681
  function normaliseRelativePath(path, label) {
693
- if (path.includes("\\") || path.includes("\0")) {
682
+ if (path.includes("\\") || /^[a-zA-Z]:/u.test(path) || [...path].some((character) => {
683
+ const codePoint = character.codePointAt(0) ?? 0;
684
+ return codePoint <= 31 || codePoint === 127;
685
+ })) {
694
686
  throw new Error(`DBK ${label} must use a safe forward-slash path: ${path}`);
695
687
  }
696
688
  const normalized = path.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/");
@@ -700,6 +692,18 @@ function normaliseRelativePath(path, label) {
700
692
  }
701
693
  return segments.join("/");
702
694
  }
695
+ function decodeMarkdownFile(data, path) {
696
+ let content;
697
+ try {
698
+ content = new TextDecoder("utf-8", { fatal: true }).decode(data);
699
+ } catch {
700
+ throw new Error(`The external DBK contains invalid UTF-8 Markdown: ${path}`);
701
+ }
702
+ if (content.includes("\0")) {
703
+ throw new Error(`The external DBK contains a NUL character in Markdown: ${path}`);
704
+ }
705
+ return content;
706
+ }
703
707
  function joinPath(parent, child) {
704
708
  return `${parent.replace(/\/+$/g, "")}/${child.replace(/^\/+/, "")}`;
705
709
  }
@@ -721,6 +725,7 @@ async function createDbkWorkspaceSnapshot(source, options) {
721
725
  const listed = await source.listFiles();
722
726
  const entries = [...listed].sort((a, b) => a.path.localeCompare(b.path));
723
727
  const seenSourcePaths = /* @__PURE__ */ new Set();
728
+ const validatedEntries = [];
724
729
  const files = [];
725
730
  let documentContent = null;
726
731
  for (const entry of entries) {
@@ -729,21 +734,27 @@ async function createDbkWorkspaceSnapshot(source, options) {
729
734
  throw new Error(`The external DBK contains duplicate paths: ${sourcePath}`);
730
735
  }
731
736
  seenSourcePaths.add(sourcePath);
732
- const data = await source.readFile(entry.path);
737
+ if (!/\.md$/iu.test(sourcePath)) {
738
+ throw new Error(
739
+ `The external DBK is corrupt: only Markdown (.md) files are allowed (${sourcePath}).`
740
+ );
741
+ }
742
+ validatedEntries.push({ sourcePath, containerPath: entry.path });
743
+ }
744
+ for (const entry of validatedEntries) {
745
+ const { sourcePath } = entry;
746
+ const data = await source.readFile(entry.containerPath);
733
747
  if (data === null) {
734
748
  throw new Error(`The external DBK changed while reading: ${sourcePath}`);
735
749
  }
750
+ const content = decodeMarkdownFile(data, sourcePath);
736
751
  if (sourcePath === sourceDocumentPath) {
737
- documentContent = new TextDecoder().decode(data);
752
+ documentContent = content;
738
753
  files.push({ kind: "text", path: targetDocumentPath, content: documentContent });
739
754
  continue;
740
755
  }
741
756
  const targetPath = assetLayout === "preserve" ? sourcePath : joinPath(companionPath, sourcePath);
742
- if (/\.(?:md|mdx|txt)$/i.test(sourcePath)) {
743
- files.push({ kind: "text", path: targetPath, content: new TextDecoder().decode(data) });
744
- } else {
745
- files.push({ kind: "binary", path: targetPath, data });
746
- }
757
+ files.push({ kind: "text", path: targetPath, content });
747
758
  }
748
759
  if (documentContent === null) {
749
760
  throw new Error(`The external DBK did not include its primary document: ${sourceDocumentPath}`);
@@ -765,29 +776,6 @@ async function replaceMemoryWorkspaceFromDbk(provider, source, options) {
765
776
 
766
777
  // src/filesystem/filesystem-content-container.ts
767
778
  import { findDocumentPath } from "@bendyline/squisq/storage";
768
- var EXTENSION_MIME_MAP = {
769
- ".md": "text/markdown",
770
- ".txt": "text/plain",
771
- ".json": "application/json",
772
- ".jpg": "image/jpeg",
773
- ".jpeg": "image/jpeg",
774
- ".png": "image/png",
775
- ".gif": "image/gif",
776
- ".svg": "image/svg+xml",
777
- ".webp": "image/webp",
778
- ".avif": "image/avif",
779
- ".mp4": "video/mp4",
780
- ".webm": "video/webm",
781
- ".mp3": "audio/mpeg",
782
- ".wav": "audio/wav",
783
- ".ogg": "audio/ogg"
784
- };
785
- function guessMimeType(path) {
786
- const dot = path.lastIndexOf(".");
787
- if (dot === -1) return "application/octet-stream";
788
- const ext = path.slice(dot).toLowerCase();
789
- return EXTENSION_MIME_MAP[ext] ?? "application/octet-stream";
790
- }
791
779
  function joinPrefix(prefix, p) {
792
780
  return workspacePathJoin(parseWorkspacePath(prefix), p);
793
781
  }
@@ -954,4 +942,3 @@ export {
954
942
  FileSystemContentContainer,
955
943
  createFileMediaProvider
956
944
  };
957
- //# sourceMappingURL=chunk-5MYAICRE.js.map
@@ -1,13 +1,16 @@
1
1
  import {
2
2
  isFileSystemMoveStateError
3
- } from "./chunk-EGNDADXB.js";
3
+ } from "./chunk-QI6YKTQV.js";
4
+ import {
5
+ decodeUtf8Text
6
+ } from "./chunk-M5ZNQGR5.js";
4
7
  import {
5
8
  FsError,
6
9
  parseWorkspacePath
7
- } from "./chunk-SI2LU2RP.js";
10
+ } from "./chunk-AYWKIZLD.js";
8
11
  import {
9
12
  getFileSystemProviderV2
10
- } from "./chunk-EZKJZUNJ.js";
13
+ } from "./chunk-XAMILHQP.js";
11
14
 
12
15
  // src/document/document-session.ts
13
16
  var DEFAULT_AUTO_SAVE_RETRY_DELAYS_MS = [1e3, 3e3, 1e4];
@@ -668,7 +671,10 @@ function createFileSystemDocumentTarget(provider, path, options = {}) {
668
671
  async commit(request) {
669
672
  if (providerV2 && providerV2.capabilities.conditionalWrite !== "none") {
670
673
  const current = await providerV2.readFile(canonicalPath);
671
- const currentContent = current ? new TextDecoder().decode(current.data) : null;
674
+ const currentContent = current ? decodeUtf8Text(current.data, {
675
+ label: "The external document",
676
+ path: canonicalPath
677
+ }) : null;
672
678
  if (currentContent !== request.persistedContent && currentContent !== request.content) {
673
679
  throw new DocumentCommitConflictError(
674
680
  "The document changed outside DocBlocks: " + path,
@@ -697,7 +703,10 @@ function createFileSystemDocumentTarget(provider, path, options = {}) {
697
703
  const external = await providerV2.readFile(canonicalPath);
698
704
  throw new DocumentCommitConflictError(
699
705
  "The document changed outside DocBlocks: " + path,
700
- external ? new TextDecoder().decode(external.data) : null,
706
+ external ? decodeUtf8Text(external.data, {
707
+ label: "The external document",
708
+ path: canonicalPath
709
+ }) : null,
701
710
  external?.entry.version ?? null
702
711
  );
703
712
  }
@@ -1059,4 +1068,3 @@ export {
1059
1068
  DocumentRecoveryJournal,
1060
1069
  getDefaultDocumentRecoveryStorage
1061
1070
  };
1062
- //# sourceMappingURL=chunk-PGR7LK6D.js.map
@@ -34,4 +34,3 @@ export {
34
34
  getDocBlocksHost,
35
35
  maybeGetDocBlocksHost
36
36
  };
37
- //# sourceMappingURL=chunk-RVQHY3XU.js.map
@@ -0,0 +1,8 @@
1
+ // src/filesystem/internal/records.ts
2
+ function isRecord(value) {
3
+ return typeof value === "object" && value !== null;
4
+ }
5
+
6
+ export {
7
+ isRecord
8
+ };
@@ -8,6 +8,7 @@ var FS_ERROR_CODES = /* @__PURE__ */ new Set([
8
8
  "not-empty",
9
9
  "permission-denied",
10
10
  "conflict",
11
+ "corrupt",
11
12
  "quota-exceeded",
12
13
  "not-supported",
13
14
  "busy",
@@ -221,4 +222,3 @@ export {
221
222
  workspacePathBasename,
222
223
  workspacePathContains
223
224
  };
224
- //# sourceMappingURL=chunk-SI2LU2RP.js.map