@amalgm/shell 0.1.164-preview.41762776698 → 0.1.164-preview.44386772850

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 (940) hide show
  1. package/PURPOSE.md +359 -235
  2. package/README.md +18 -0
  3. package/dist/accepted-fold.d.ts +51 -0
  4. package/dist/accepted-fold.js +106 -0
  5. package/dist/accepted-fold.js.map +1 -0
  6. package/dist/accepted-tail.d.ts +19 -9
  7. package/dist/accepted-tail.js +28 -11
  8. package/dist/accepted-tail.js.map +1 -1
  9. package/dist/accepted-view.d.ts +27 -0
  10. package/dist/accepted-view.js +8 -0
  11. package/dist/accepted-view.js.map +1 -0
  12. package/dist/apply-attempt-memory.d.ts +13 -0
  13. package/dist/apply-attempt-memory.js +26 -0
  14. package/dist/apply-attempt-memory.js.map +1 -0
  15. package/dist/apply-control.d.ts +85 -0
  16. package/dist/apply-control.js +131 -0
  17. package/dist/apply-control.js.map +1 -0
  18. package/dist/apply-displaced-tree.d.ts +63 -0
  19. package/dist/apply-displaced-tree.js +148 -0
  20. package/dist/apply-displaced-tree.js.map +1 -0
  21. package/dist/apply-durability.d.ts +33 -0
  22. package/dist/apply-durability.js +72 -0
  23. package/dist/apply-durability.js.map +1 -0
  24. package/dist/apply-enter-build.d.ts +91 -0
  25. package/dist/apply-enter-build.js +145 -0
  26. package/dist/apply-enter-build.js.map +1 -0
  27. package/dist/apply-enter-plan.d.ts +79 -0
  28. package/dist/apply-enter-plan.js +148 -0
  29. package/dist/apply-enter-plan.js.map +1 -0
  30. package/dist/apply-fingerprint.d.ts +39 -0
  31. package/dist/apply-fingerprint.js +84 -0
  32. package/dist/apply-fingerprint.js.map +1 -0
  33. package/dist/apply-git-held.d.ts +29 -0
  34. package/dist/apply-git-held.js +184 -0
  35. package/dist/apply-git-held.js.map +1 -0
  36. package/dist/apply-git-storage.d.ts +38 -0
  37. package/dist/apply-git-storage.js +110 -0
  38. package/dist/apply-git-storage.js.map +1 -0
  39. package/dist/apply-kept.d.ts +42 -0
  40. package/dist/apply-kept.js +135 -0
  41. package/dist/apply-kept.js.map +1 -0
  42. package/dist/apply-local-work.d.ts +41 -0
  43. package/dist/apply-local-work.js +72 -0
  44. package/dist/apply-local-work.js.map +1 -0
  45. package/dist/apply-map.d.ts +116 -0
  46. package/dist/apply-map.js +383 -0
  47. package/dist/apply-map.js.map +1 -0
  48. package/dist/apply-showing.d.ts +104 -0
  49. package/dist/apply-showing.js +236 -0
  50. package/dist/apply-showing.js.map +1 -0
  51. package/dist/apply-shown-again.d.ts +28 -0
  52. package/dist/apply-shown-again.js +81 -0
  53. package/dist/apply-shown-again.js.map +1 -0
  54. package/dist/apply-spelling.d.ts +35 -0
  55. package/dist/apply-spelling.js +79 -0
  56. package/dist/apply-spelling.js.map +1 -0
  57. package/dist/apply-trash-keep.d.ts +96 -0
  58. package/dist/apply-trash-keep.js +194 -0
  59. package/dist/apply-trash-keep.js.map +1 -0
  60. package/dist/apply-window-cargo.d.ts +54 -0
  61. package/dist/apply-window-cargo.js +219 -0
  62. package/dist/apply-window-cargo.js.map +1 -0
  63. package/dist/apply-window-ground.d.ts +130 -0
  64. package/dist/apply-window-ground.js +324 -0
  65. package/dist/apply-window-ground.js.map +1 -0
  66. package/dist/apply-window-host.d.ts +136 -0
  67. package/dist/apply-window-host.js +1842 -0
  68. package/dist/apply-window-host.js.map +1 -0
  69. package/dist/apply-window-lane.d.ts +30 -0
  70. package/dist/apply-window-lane.js +311 -0
  71. package/dist/apply-window-lane.js.map +1 -0
  72. package/dist/apply-window-line.d.ts +31 -0
  73. package/dist/apply-window-line.js +150 -0
  74. package/dist/apply-window-line.js.map +1 -0
  75. package/dist/apply-window-recovery.d.ts +5 -0
  76. package/dist/apply-window-recovery.js +72 -0
  77. package/dist/apply-window-recovery.js.map +1 -0
  78. package/dist/apply-window-reveal.d.ts +22 -0
  79. package/dist/apply-window-reveal.js +98 -0
  80. package/dist/apply-window-reveal.js.map +1 -0
  81. package/dist/apply-window-rows.d.ts +144 -0
  82. package/dist/apply-window-rows.js +178 -0
  83. package/dist/apply-window-rows.js.map +1 -0
  84. package/dist/apply-window-saves.d.ts +224 -0
  85. package/dist/apply-window-saves.js +674 -0
  86. package/dist/apply-window-saves.js.map +1 -0
  87. package/dist/apply-window-store.d.ts +126 -0
  88. package/dist/apply-window-store.js +312 -0
  89. package/dist/apply-window-store.js.map +1 -0
  90. package/dist/apply-window-verify.d.ts +65 -0
  91. package/dist/apply-window-verify.js +195 -0
  92. package/dist/apply-window-verify.js.map +1 -0
  93. package/dist/authority-binding.d.ts +1 -24
  94. package/dist/authority-binding.js +44 -9
  95. package/dist/authority-binding.js.map +1 -1
  96. package/dist/background-error.d.ts +4 -0
  97. package/dist/background-error.js +15 -0
  98. package/dist/background-error.js.map +1 -0
  99. package/dist/baseline-content.d.ts +12 -0
  100. package/dist/baseline-content.js +12 -0
  101. package/dist/baseline-content.js.map +1 -0
  102. package/dist/billing/cli.d.ts +18 -0
  103. package/dist/billing/cli.js +276 -0
  104. package/dist/billing/cli.js.map +1 -0
  105. package/dist/billing/mount.d.ts +12 -0
  106. package/dist/billing/mount.js +34 -0
  107. package/dist/billing/mount.js.map +1 -0
  108. package/dist/billing/tools.d.ts +57 -0
  109. package/dist/billing/tools.js +141 -0
  110. package/dist/billing/tools.js.map +1 -0
  111. package/dist/boot-identity.d.ts +1 -0
  112. package/dist/boot-identity.js +39 -0
  113. package/dist/boot-identity.js.map +1 -0
  114. package/dist/browser-host.d.ts +4 -3
  115. package/dist/browser-host.js +29 -14
  116. package/dist/browser-host.js.map +1 -1
  117. package/dist/captured-rows.d.ts +33 -0
  118. package/dist/captured-rows.js +45 -0
  119. package/dist/captured-rows.js.map +1 -0
  120. package/dist/cargo-group.d.ts +31 -17
  121. package/dist/cargo-group.js +78 -29
  122. package/dist/cargo-group.js.map +1 -1
  123. package/dist/cargo-journal.d.ts +45 -0
  124. package/dist/cargo-journal.js +130 -0
  125. package/dist/cargo-journal.js.map +1 -0
  126. package/dist/chat-composition.d.ts +4 -1
  127. package/dist/chat-composition.js +4 -1
  128. package/dist/chat-composition.js.map +1 -1
  129. package/dist/cli.d.ts +1 -0
  130. package/dist/cli.js +129 -55
  131. package/dist/cli.js.map +1 -1
  132. package/dist/construct-apply-host.d.ts +8 -7
  133. package/dist/construct-apply-host.js +20 -8
  134. package/dist/construct-apply-host.js.map +1 -1
  135. package/dist/construct-door.d.ts +2 -0
  136. package/dist/construct-door.js +4 -3
  137. package/dist/construct-door.js.map +1 -1
  138. package/dist/construct-ledger.d.ts +2 -0
  139. package/dist/construct-ledger.js +13 -1
  140. package/dist/construct-ledger.js.map +1 -1
  141. package/dist/content-cache-collection.d.ts +11 -4
  142. package/dist/content-cache-collection.js +74 -62
  143. package/dist/content-cache-collection.js.map +1 -1
  144. package/dist/content-cache-fences.d.ts +27 -0
  145. package/dist/content-cache-fences.js +116 -0
  146. package/dist/content-cache-fences.js.map +1 -0
  147. package/dist/content-cache-host.d.ts +163 -91
  148. package/dist/content-cache-host.js +531 -354
  149. package/dist/content-cache-host.js.map +1 -1
  150. package/dist/content-cache-index.d.ts +36 -7
  151. package/dist/content-cache-index.js +79 -32
  152. package/dist/content-cache-index.js.map +1 -1
  153. package/dist/content-cache-namespace.d.ts +28 -34
  154. package/dist/content-cache-namespace.js +85 -99
  155. package/dist/content-cache-namespace.js.map +1 -1
  156. package/dist/content-cache-partials.d.ts +37 -0
  157. package/dist/content-cache-partials.js +79 -0
  158. package/dist/content-cache-partials.js.map +1 -0
  159. package/dist/content-cache-retention.d.ts +27 -12
  160. package/dist/content-cache-retention.js +143 -132
  161. package/dist/content-cache-retention.js.map +1 -1
  162. package/dist/content-capture-pool.d.ts +70 -83
  163. package/dist/content-capture-pool.js +112 -82
  164. package/dist/content-capture-pool.js.map +1 -1
  165. package/dist/content-capture-worker.d.ts +3 -4
  166. package/dist/content-capture-worker.js +28 -35
  167. package/dist/content-capture-worker.js.map +1 -1
  168. package/dist/content-clock.d.ts +54 -28
  169. package/dist/content-clock.js +345 -102
  170. package/dist/content-clock.js.map +1 -1
  171. package/dist/content-direct.d.ts +0 -2
  172. package/dist/content-direct.js +53 -31
  173. package/dist/content-direct.js.map +1 -1
  174. package/dist/content-qualification.d.ts +72 -0
  175. package/dist/content-qualification.js +129 -0
  176. package/dist/content-qualification.js.map +1 -0
  177. package/dist/credentials-host.js +3 -2
  178. package/dist/credentials-host.js.map +1 -1
  179. package/dist/derived-relocation.d.ts +31 -0
  180. package/dist/derived-relocation.js +71 -0
  181. package/dist/derived-relocation.js.map +1 -0
  182. package/dist/detection/accepted-result.js +3 -3
  183. package/dist/detection/accepted-result.js.map +1 -1
  184. package/dist/detection/admission-save.d.ts +25 -14
  185. package/dist/detection/admission-save.js +34 -22
  186. package/dist/detection/admission-save.js.map +1 -1
  187. package/dist/detection/admission-units.d.ts +32 -20
  188. package/dist/detection/admission-units.js +230 -97
  189. package/dist/detection/admission-units.js.map +1 -1
  190. package/dist/detection/alias-examination.d.ts +5 -2
  191. package/dist/detection/alias-examination.js +15 -3
  192. package/dist/detection/alias-examination.js.map +1 -1
  193. package/dist/detection/apply-ownership.d.ts +70 -44
  194. package/dist/detection/apply-ownership.js +140 -132
  195. package/dist/detection/apply-ownership.js.map +1 -1
  196. package/dist/detection/basis-advanced.d.ts +4 -0
  197. package/dist/detection/basis-advanced.js +9 -0
  198. package/dist/detection/basis-advanced.js.map +1 -1
  199. package/dist/detection/cached-replay.d.ts +38 -0
  200. package/dist/detection/cached-replay.js +66 -0
  201. package/dist/detection/cached-replay.js.map +1 -0
  202. package/dist/detection/capture-outcome.js +33 -36
  203. package/dist/detection/capture-outcome.js.map +1 -1
  204. package/dist/detection/container-membership.d.ts +13 -25
  205. package/dist/detection/container-membership.js +24 -28
  206. package/dist/detection/container-membership.js.map +1 -1
  207. package/dist/detection/directory-proof.js +1 -1
  208. package/dist/detection/directory-proof.js.map +1 -1
  209. package/dist/detection/dispositions.d.ts +10 -33
  210. package/dist/detection/dispositions.js +27 -91
  211. package/dist/detection/dispositions.js.map +1 -1
  212. package/dist/detection/examinations.d.ts +33 -0
  213. package/dist/detection/examinations.js +50 -0
  214. package/dist/detection/examinations.js.map +1 -0
  215. package/dist/detection/ground-proof.d.ts +35 -11
  216. package/dist/detection/ground-proof.js +111 -52
  217. package/dist/detection/ground-proof.js.map +1 -1
  218. package/dist/detection/ground-reader.d.ts +10 -10
  219. package/dist/detection/ground-reader.js +19 -42
  220. package/dist/detection/ground-reader.js.map +1 -1
  221. package/dist/detection/identity-discovery.d.ts +1 -1
  222. package/dist/detection/identity-discovery.js +27 -35
  223. package/dist/detection/identity-discovery.js.map +1 -1
  224. package/dist/detection/maintenance-sweep.d.ts +5 -2
  225. package/dist/detection/maintenance-sweep.js +15 -5
  226. package/dist/detection/maintenance-sweep.js.map +1 -1
  227. package/dist/detection/notebook-basis.d.ts +6 -3
  228. package/dist/detection/notebook-basis.js +8 -5
  229. package/dist/detection/notebook-basis.js.map +1 -1
  230. package/dist/detection/owed-examinations.d.ts +22 -0
  231. package/dist/detection/owed-examinations.js +54 -0
  232. package/dist/detection/owed-examinations.js.map +1 -0
  233. package/dist/detection/owed-selection.d.ts +23 -20
  234. package/dist/detection/owed-selection.js +56 -43
  235. package/dist/detection/owed-selection.js.map +1 -1
  236. package/dist/detection/policy-owed.d.ts +17 -0
  237. package/dist/detection/policy-owed.js +33 -0
  238. package/dist/detection/policy-owed.js.map +1 -0
  239. package/dist/detection/repository-state.d.ts +44 -0
  240. package/dist/detection/repository-state.js +95 -0
  241. package/dist/detection/repository-state.js.map +1 -0
  242. package/dist/detection/reveal-save.d.ts +17 -0
  243. package/dist/detection/reveal-save.js +15 -0
  244. package/dist/detection/reveal-save.js.map +1 -0
  245. package/dist/detection/root-examination.d.ts +25 -13
  246. package/dist/detection/root-examination.js +273 -220
  247. package/dist/detection/root-examination.js.map +1 -1
  248. package/dist/detection/root-walk.d.ts +191 -0
  249. package/dist/detection/root-walk.js +1383 -0
  250. package/dist/detection/root-walk.js.map +1 -0
  251. package/dist/detection/runtime.d.ts +41 -53
  252. package/dist/detection/runtime.js +285 -345
  253. package/dist/detection/runtime.js.map +1 -1
  254. package/dist/detection/scope-frame.d.ts +82 -0
  255. package/dist/detection/scope-frame.js +183 -0
  256. package/dist/detection/scope-frame.js.map +1 -0
  257. package/dist/detection/scoped-identity-port.d.ts +11 -10
  258. package/dist/detection/scoped-identity-port.js +18 -25
  259. package/dist/detection/scoped-identity-port.js.map +1 -1
  260. package/dist/detection/sharing-policy.d.ts +14 -6
  261. package/dist/detection/sharing-policy.js +13 -7
  262. package/dist/detection/sharing-policy.js.map +1 -1
  263. package/dist/detection/spelled-lookup.d.ts +20 -0
  264. package/dist/detection/spelled-lookup.js +83 -0
  265. package/dist/detection/spelled-lookup.js.map +1 -0
  266. package/dist/detection/unread-content.d.ts +20 -0
  267. package/dist/detection/unread-content.js +33 -0
  268. package/dist/detection/unread-content.js.map +1 -0
  269. package/dist/detection/walk-law.d.ts +11 -21
  270. package/dist/detection/walk-law.js +14 -22
  271. package/dist/detection/walk-law.js.map +1 -1
  272. package/dist/detection/walked-roots.d.ts +17 -0
  273. package/dist/detection/walked-roots.js +27 -0
  274. package/dist/detection/walked-roots.js.map +1 -0
  275. package/dist/detection/withheld.d.ts +100 -0
  276. package/dist/detection/withheld.js +118 -0
  277. package/dist/detection/withheld.js.map +1 -0
  278. package/dist/development/profile.js +1 -1
  279. package/dist/development/profile.js.map +1 -1
  280. package/dist/drive/cloud-files/asks.d.ts +7 -0
  281. package/dist/drive/cloud-files/asks.js +181 -0
  282. package/dist/drive/cloud-files/asks.js.map +1 -0
  283. package/dist/drive/cloud-files/binding.d.ts +111 -0
  284. package/dist/drive/cloud-files/binding.js +31 -0
  285. package/dist/drive/cloud-files/binding.js.map +1 -0
  286. package/dist/drive/cloud-files/contents.d.ts +82 -0
  287. package/dist/drive/cloud-files/contents.js +204 -0
  288. package/dist/drive/cloud-files/contents.js.map +1 -0
  289. package/dist/drive/cloud-files/door.d.ts +11 -0
  290. package/dist/drive/cloud-files/door.js +118 -0
  291. package/dist/drive/cloud-files/door.js.map +1 -0
  292. package/dist/drive/cloud-files/paths.d.ts +42 -0
  293. package/dist/drive/cloud-files/paths.js +93 -0
  294. package/dist/drive/cloud-files/paths.js.map +1 -0
  295. package/dist/drive/cloud-files/populated.d.ts +15 -0
  296. package/dist/drive/cloud-files/populated.js +38 -0
  297. package/dist/drive/cloud-files/populated.js.map +1 -0
  298. package/dist/drive/cloud-files/reconcile.d.ts +17 -0
  299. package/dist/drive/cloud-files/reconcile.js +478 -0
  300. package/dist/drive/cloud-files/reconcile.js.map +1 -0
  301. package/dist/drive/cloud-files/sync-root.d.ts +34 -0
  302. package/dist/drive/cloud-files/sync-root.js +68 -0
  303. package/dist/drive/cloud-files/sync-root.js.map +1 -0
  304. package/dist/drive/cloud-files/turns.d.ts +9 -0
  305. package/dist/drive/cloud-files/turns.js +58 -0
  306. package/dist/drive/cloud-files/turns.js.map +1 -0
  307. package/dist/drive/cloud-files/writes.d.ts +27 -0
  308. package/dist/drive/cloud-files/writes.js +436 -0
  309. package/dist/drive/cloud-files/writes.js.map +1 -0
  310. package/dist/drive/computer.d.ts +19 -0
  311. package/dist/drive/computer.js +61 -0
  312. package/dist/drive/computer.js.map +1 -0
  313. package/dist/drive/fuse-opens.d.ts +32 -0
  314. package/dist/drive/fuse-opens.js +110 -0
  315. package/dist/drive/fuse-opens.js.map +1 -0
  316. package/dist/drive/fuse.d.ts +36 -0
  317. package/dist/drive/fuse.js +102 -0
  318. package/dist/drive/fuse.js.map +1 -0
  319. package/dist/drive/kept.d.ts +78 -0
  320. package/dist/drive/kept.js +263 -0
  321. package/dist/drive/kept.js.map +1 -0
  322. package/dist/drive/kernel.d.ts +17 -0
  323. package/dist/drive/kernel.js +36 -0
  324. package/dist/drive/kernel.js.map +1 -0
  325. package/dist/drive/layout.d.ts +18 -0
  326. package/dist/drive/layout.js +39 -0
  327. package/dist/drive/layout.js.map +1 -0
  328. package/dist/drive/mount.d.ts +107 -0
  329. package/dist/drive/mount.js +259 -0
  330. package/dist/drive/mount.js.map +1 -0
  331. package/dist/drive/mountpoint.d.ts +14 -0
  332. package/dist/drive/mountpoint.js +51 -0
  333. package/dist/drive/mountpoint.js.map +1 -0
  334. package/dist/drive/nfs/apple-double.d.ts +6 -0
  335. package/dist/drive/nfs/apple-double.js +140 -0
  336. package/dist/drive/nfs/apple-double.js.map +1 -0
  337. package/dist/drive/nfs/attributes.d.ts +64 -0
  338. package/dist/drive/nfs/attributes.js +97 -0
  339. package/dist/drive/nfs/attributes.js.map +1 -0
  340. package/dist/drive/nfs/handles.d.ts +44 -0
  341. package/dist/drive/nfs/handles.js +209 -0
  342. package/dist/drive/nfs/handles.js.map +1 -0
  343. package/dist/drive/nfs/mount3.d.ts +16 -0
  344. package/dist/drive/nfs/mount3.js +38 -0
  345. package/dist/drive/nfs/mount3.js.map +1 -0
  346. package/dist/drive/nfs/nfs3.d.ts +27 -0
  347. package/dist/drive/nfs/nfs3.js +516 -0
  348. package/dist/drive/nfs/nfs3.js.map +1 -0
  349. package/dist/drive/nfs/rpc.d.ts +66 -0
  350. package/dist/drive/nfs/rpc.js +122 -0
  351. package/dist/drive/nfs/rpc.js.map +1 -0
  352. package/dist/drive/nfs/server.d.ts +30 -0
  353. package/dist/drive/nfs/server.js +109 -0
  354. package/dist/drive/nfs/server.js.map +1 -0
  355. package/dist/drive/nfs/xdr.d.ts +44 -0
  356. package/dist/drive/nfs/xdr.js +111 -0
  357. package/dist/drive/nfs/xdr.js.map +1 -0
  358. package/dist/drive/nfs.d.ts +58 -0
  359. package/dist/drive/nfs.js +193 -0
  360. package/dist/drive/nfs.js.map +1 -0
  361. package/dist/drive/operations.d.ts +180 -0
  362. package/dist/drive/operations.js +358 -0
  363. package/dist/drive/operations.js.map +1 -0
  364. package/dist/drive/shelf.d.ts +9 -0
  365. package/dist/drive/shelf.js +41 -0
  366. package/dist/drive/shelf.js.map +1 -0
  367. package/dist/durability-barrier.d.ts +39 -11
  368. package/dist/durability-barrier.js +106 -41
  369. package/dist/durability-barrier.js.map +1 -1
  370. package/dist/entity-access-wire.d.ts +3 -2
  371. package/dist/entity-access-wire.js +9 -25
  372. package/dist/entity-access-wire.js.map +1 -1
  373. package/dist/entity-channel-holdings.d.ts +7 -7
  374. package/dist/entity-channel-holdings.js +49 -8
  375. package/dist/entity-channel-holdings.js.map +1 -1
  376. package/dist/entity-grant-watch.d.ts +9 -0
  377. package/dist/entity-grant-watch.js +29 -0
  378. package/dist/entity-grant-watch.js.map +1 -0
  379. package/dist/entity-record-observability.d.ts +1 -1
  380. package/dist/entity-record-observability.js +34 -29
  381. package/dist/entity-record-observability.js.map +1 -1
  382. package/dist/entity-record-saves.d.ts +34 -7
  383. package/dist/entity-record-saves.js +72 -20
  384. package/dist/entity-record-saves.js.map +1 -1
  385. package/dist/entity-record-store.d.ts +43 -15
  386. package/dist/entity-record-store.js +160 -55
  387. package/dist/entity-record-store.js.map +1 -1
  388. package/dist/error-facts.d.ts +24 -0
  389. package/dist/error-facts.js +35 -0
  390. package/dist/error-facts.js.map +1 -0
  391. package/dist/faults/drain.d.ts +27 -0
  392. package/dist/faults/drain.js +211 -0
  393. package/dist/faults/drain.js.map +1 -0
  394. package/dist/faults/queue.d.ts +46 -0
  395. package/dist/faults/queue.js +100 -0
  396. package/dist/faults/queue.js.map +1 -0
  397. package/dist/faults/show.d.ts +7 -0
  398. package/dist/faults/show.js +32 -0
  399. package/dist/faults/show.js.map +1 -0
  400. package/dist/files-mcp-host.d.ts +58 -0
  401. package/dist/files-mcp-host.js +63 -0
  402. package/dist/files-mcp-host.js.map +1 -0
  403. package/dist/files-observability.d.ts +5 -2
  404. package/dist/files-observability.js.map +1 -1
  405. package/dist/files-program/client.d.ts +136 -0
  406. package/dist/files-program/client.js +442 -0
  407. package/dist/files-program/client.js.map +1 -0
  408. package/dist/files-program/journeys.d.ts +15 -0
  409. package/dist/files-program/journeys.js +79 -0
  410. package/dist/files-program/journeys.js.map +1 -0
  411. package/dist/files-program/program.d.ts +1 -0
  412. package/dist/files-program/program.js +344 -0
  413. package/dist/files-program/program.js.map +1 -0
  414. package/dist/files-program/protocol.d.ts +180 -0
  415. package/dist/files-program/protocol.js +7 -0
  416. package/dist/files-program/protocol.js.map +1 -0
  417. package/dist/files-register-host.d.ts +18 -21
  418. package/dist/files-register-host.js +104 -94
  419. package/dist/files-register-host.js.map +1 -1
  420. package/dist/files-trace.d.ts +29 -9
  421. package/dist/files-trace.js +58 -14
  422. package/dist/files-trace.js.map +1 -1
  423. package/dist/filesystem.d.ts +27 -9
  424. package/dist/filesystem.js +94 -56
  425. package/dist/filesystem.js.map +1 -1
  426. package/dist/flush.d.ts +19 -0
  427. package/dist/flush.js +84 -0
  428. package/dist/flush.js.map +1 -0
  429. package/dist/gateway.js +5 -2
  430. package/dist/gateway.js.map +1 -1
  431. package/dist/git/ground-owners.d.ts +15 -0
  432. package/dist/git/ground-owners.js +67 -0
  433. package/dist/git/ground-owners.js.map +1 -0
  434. package/dist/git/held-package.d.ts +67 -0
  435. package/dist/git/held-package.js +95 -0
  436. package/dist/git/held-package.js.map +1 -0
  437. package/dist/git/home.d.ts +59 -0
  438. package/dist/git/home.js +132 -0
  439. package/dist/git/home.js.map +1 -0
  440. package/dist/git/marker.d.ts +21 -0
  441. package/dist/git/marker.js +30 -0
  442. package/dist/git/marker.js.map +1 -0
  443. package/dist/git/named-objects.d.ts +24 -0
  444. package/dist/git/named-objects.js +176 -0
  445. package/dist/git/named-objects.js.map +1 -0
  446. package/dist/git/objects.d.ts +30 -0
  447. package/dist/git/objects.js +88 -0
  448. package/dist/git/objects.js.map +1 -0
  449. package/dist/git/play.d.ts +30 -0
  450. package/dist/git/play.js +305 -0
  451. package/dist/git/play.js.map +1 -0
  452. package/dist/git/quarantine.d.ts +48 -0
  453. package/dist/git/quarantine.js +150 -0
  454. package/dist/git/quarantine.js.map +1 -0
  455. package/dist/git/rail.d.ts +206 -0
  456. package/dist/git/rail.js +885 -0
  457. package/dist/git/rail.js.map +1 -0
  458. package/dist/git/read-state.d.ts +49 -0
  459. package/dist/git/read-state.js +238 -0
  460. package/dist/git/read-state.js.map +1 -0
  461. package/dist/git/repository.d.ts +62 -0
  462. package/dist/git/repository.js +130 -0
  463. package/dist/git/repository.js.map +1 -0
  464. package/dist/git/write-files.d.ts +29 -0
  465. package/dist/git/write-files.js +215 -0
  466. package/dist/git/write-files.js.map +1 -0
  467. package/dist/git-binding.d.ts +37 -49
  468. package/dist/git-binding.js +262 -134
  469. package/dist/git-binding.js.map +1 -1
  470. package/dist/git-cat-file.d.ts +28 -0
  471. package/dist/git-cat-file.js +125 -0
  472. package/dist/git-cat-file.js.map +1 -0
  473. package/dist/git-command.d.ts +45 -10
  474. package/dist/git-command.js +197 -89
  475. package/dist/git-command.js.map +1 -1
  476. package/dist/git-index-entries.d.ts +10 -8
  477. package/dist/git-index-entries.js +21 -39
  478. package/dist/git-index-entries.js.map +1 -1
  479. package/dist/git-index-format.d.ts +35 -18
  480. package/dist/git-index-format.js +210 -53
  481. package/dist/git-index-format.js.map +1 -1
  482. package/dist/git-install-lines.d.ts +12 -0
  483. package/dist/git-install-lines.js +22 -0
  484. package/dist/git-install-lines.js.map +1 -0
  485. package/dist/git-launcher-process.d.ts +1 -0
  486. package/dist/git-launcher-process.js +81 -0
  487. package/dist/git-launcher-process.js.map +1 -0
  488. package/dist/git-launcher.d.ts +70 -0
  489. package/dist/git-launcher.js +178 -0
  490. package/dist/git-launcher.js.map +1 -0
  491. package/dist/graph-heads.d.ts +71 -0
  492. package/dist/graph-heads.js +90 -0
  493. package/dist/graph-heads.js.map +1 -0
  494. package/dist/ground-basis.d.ts +141 -105
  495. package/dist/ground-basis.js +367 -460
  496. package/dist/ground-basis.js.map +1 -1
  497. package/dist/ground-checkpoint-worker.js +26 -25
  498. package/dist/ground-checkpoint-worker.js.map +1 -1
  499. package/dist/ground-checkpoints.d.ts +1 -1
  500. package/dist/ground-checkpoints.js +6 -6
  501. package/dist/ground-contract.d.ts +11 -0
  502. package/dist/ground-contract.js +115 -0
  503. package/dist/ground-contract.js.map +1 -0
  504. package/dist/ground-coordination.d.ts +30 -20
  505. package/dist/ground-coordination.js +96 -51
  506. package/dist/ground-coordination.js.map +1 -1
  507. package/dist/ground-database.d.ts +11 -13
  508. package/dist/ground-database.js +283 -97
  509. package/dist/ground-database.js.map +1 -1
  510. package/dist/ground-differences.d.ts +19 -18
  511. package/dist/ground-differences.js +20 -42
  512. package/dist/ground-differences.js.map +1 -1
  513. package/dist/ground-initialization.d.ts +3 -0
  514. package/dist/ground-initialization.js.map +1 -1
  515. package/dist/ground-install-saves.d.ts +61 -20
  516. package/dist/ground-install-saves.js +56 -52
  517. package/dist/ground-install-saves.js.map +1 -1
  518. package/dist/ground-inventory-schema.d.ts +42 -2
  519. package/dist/ground-inventory-schema.js +244 -31
  520. package/dist/ground-inventory-schema.js.map +1 -1
  521. package/dist/ground-marks.d.ts +49 -0
  522. package/dist/ground-marks.js +105 -0
  523. package/dist/ground-marks.js.map +1 -0
  524. package/dist/ground-profile.d.ts +7 -0
  525. package/dist/ground-profile.js +85 -16
  526. package/dist/ground-profile.js.map +1 -1
  527. package/dist/ground-reads.d.ts +86 -0
  528. package/dist/ground-reads.js +256 -0
  529. package/dist/ground-reads.js.map +1 -0
  530. package/dist/ground-relations.d.ts +57 -0
  531. package/dist/ground-relations.js +206 -0
  532. package/dist/ground-relations.js.map +1 -0
  533. package/dist/ground-root-index.d.ts +3 -2
  534. package/dist/ground-root-index.js +4 -3
  535. package/dist/ground-root-index.js.map +1 -1
  536. package/dist/ground-row.d.ts +23 -7
  537. package/dist/ground-row.js +27 -11
  538. package/dist/ground-row.js.map +1 -1
  539. package/dist/ground-save-ops.d.ts +42 -26
  540. package/dist/ground-save-ops.js +46 -26
  541. package/dist/ground-save-ops.js.map +1 -1
  542. package/dist/ground-saver-worker.js +171 -44
  543. package/dist/ground-saver-worker.js.map +1 -1
  544. package/dist/ground-saver.d.ts +35 -7
  545. package/dist/ground-saver.js +52 -25
  546. package/dist/ground-saver.js.map +1 -1
  547. package/dist/ground-store.d.ts +51 -10
  548. package/dist/ground-store.js +439 -89
  549. package/dist/ground-store.js.map +1 -1
  550. package/dist/index.d.ts +2 -2
  551. package/dist/index.js +1 -1
  552. package/dist/index.js.map +1 -1
  553. package/dist/initial-publication.d.ts +42 -0
  554. package/dist/initial-publication.js +42 -0
  555. package/dist/initial-publication.js.map +1 -0
  556. package/dist/installation/environment.d.ts +4 -0
  557. package/dist/installation/environment.js +13 -0
  558. package/dist/installation/environment.js.map +1 -1
  559. package/dist/keychain/cli-io.d.ts +8 -0
  560. package/dist/keychain/cli-io.js +55 -0
  561. package/dist/keychain/cli-io.js.map +1 -0
  562. package/dist/keychain/cli.d.ts +12 -0
  563. package/dist/keychain/cli.js +48 -0
  564. package/dist/keychain/cli.js.map +1 -0
  565. package/dist/keychain/host.d.ts +28 -0
  566. package/dist/keychain/host.js +43 -0
  567. package/dist/keychain/host.js.map +1 -0
  568. package/dist/keychain/http-mount.d.ts +16 -0
  569. package/dist/keychain/http-mount.js +74 -0
  570. package/dist/keychain/http-mount.js.map +1 -0
  571. package/dist/keychain/key-wire.d.ts +12 -0
  572. package/dist/keychain/key-wire.js +45 -0
  573. package/dist/keychain/key-wire.js.map +1 -0
  574. package/dist/keychain/presence-mac.d.ts +8 -0
  575. package/dist/keychain/presence-mac.js +26 -0
  576. package/dist/keychain/presence-mac.js.map +1 -0
  577. package/dist/keychain/presence.d.ts +9 -0
  578. package/dist/keychain/presence.js +24 -0
  579. package/dist/keychain/presence.js.map +1 -0
  580. package/dist/keychain/rail.d.ts +19 -0
  581. package/dist/keychain/rail.js +20 -0
  582. package/dist/keychain/rail.js.map +1 -0
  583. package/dist/keychain/secret-apply.d.ts +22 -0
  584. package/dist/keychain/secret-apply.js +46 -0
  585. package/dist/keychain/secret-apply.js.map +1 -0
  586. package/dist/keychain/shelf-from-ledger.d.ts +15 -0
  587. package/dist/keychain/shelf-from-ledger.js +18 -0
  588. package/dist/keychain/shelf-from-ledger.js.map +1 -0
  589. package/dist/keychain/use-log.d.ts +7 -0
  590. package/dist/keychain/use-log.js +15 -0
  591. package/dist/keychain/use-log.js.map +1 -0
  592. package/dist/keychain/vault-file.d.ts +12 -0
  593. package/dist/keychain/vault-file.js +19 -0
  594. package/dist/keychain/vault-file.js.map +1 -0
  595. package/dist/line-judge.d.ts +39 -0
  596. package/dist/line-judge.js +177 -0
  597. package/dist/line-judge.js.map +1 -0
  598. package/dist/line-loops.d.ts +22 -0
  599. package/dist/line-loops.js +19 -0
  600. package/dist/line-loops.js.map +1 -0
  601. package/dist/link-target.d.ts +16 -0
  602. package/dist/link-target.js +81 -0
  603. package/dist/link-target.js.map +1 -0
  604. package/dist/loop-watch.d.ts +17 -0
  605. package/dist/loop-watch.js +44 -0
  606. package/dist/loop-watch.js.map +1 -0
  607. package/dist/machine-host.d.ts +93 -23
  608. package/dist/machine-host.js +344 -179
  609. package/dist/machine-host.js.map +1 -1
  610. package/dist/main.js +3 -1
  611. package/dist/main.js.map +1 -1
  612. package/dist/materialize-records.d.ts +98 -0
  613. package/dist/materialize-records.js +446 -0
  614. package/dist/materialize-records.js.map +1 -0
  615. package/dist/materialized-graph.d.ts +14 -21
  616. package/dist/materialized-graph.js +1 -135
  617. package/dist/materialized-graph.js.map +1 -1
  618. package/dist/mount.d.ts +13 -0
  619. package/dist/mount.js +33 -0
  620. package/dist/mount.js.map +1 -0
  621. package/dist/native/cloud-files.node +0 -0
  622. package/dist/native/fsevents-stream.node +0 -0
  623. package/dist/native/inotify.node +0 -0
  624. package/dist/native/windows-fs.node +0 -0
  625. package/dist/on-demand-roots.d.ts +31 -0
  626. package/dist/on-demand-roots.js +18 -0
  627. package/dist/on-demand-roots.js.map +1 -0
  628. package/dist/open-standing.d.ts +8 -0
  629. package/dist/open-standing.js +109 -0
  630. package/dist/open-standing.js.map +1 -0
  631. package/dist/own-results.d.ts +37 -0
  632. package/dist/own-results.js +98 -0
  633. package/dist/own-results.js.map +1 -0
  634. package/dist/package-pages.d.ts +41 -0
  635. package/dist/package-pages.js +76 -0
  636. package/dist/package-pages.js.map +1 -0
  637. package/dist/patient-flush.d.ts +24 -0
  638. package/dist/patient-flush.js +37 -0
  639. package/dist/patient-flush.js.map +1 -0
  640. package/dist/physical-path-witness.d.ts +2 -11
  641. package/dist/physical-path-witness.js +19 -43
  642. package/dist/physical-path-witness.js.map +1 -1
  643. package/dist/placement-owed.d.ts +28 -0
  644. package/dist/placement-owed.js +32 -0
  645. package/dist/placement-owed.js.map +1 -0
  646. package/dist/placement-tidy.d.ts +57 -0
  647. package/dist/placement-tidy.js +313 -0
  648. package/dist/placement-tidy.js.map +1 -0
  649. package/dist/platform-product-host.d.ts +12 -0
  650. package/dist/platform-product-host.js +23 -1
  651. package/dist/platform-product-host.js.map +1 -1
  652. package/dist/platform-tools.d.ts +1 -0
  653. package/dist/platform-tools.js +11 -1
  654. package/dist/platform-tools.js.map +1 -1
  655. package/dist/process-lifecycle.d.ts +7 -0
  656. package/dist/process-lifecycle.js +13 -0
  657. package/dist/process-lifecycle.js.map +1 -1
  658. package/dist/pty-host.d.ts +2 -0
  659. package/dist/pty-host.js +1 -0
  660. package/dist/pty-host.js.map +1 -1
  661. package/dist/received-state.d.ts +90 -0
  662. package/dist/received-state.js +167 -0
  663. package/dist/received-state.js.map +1 -0
  664. package/dist/reference-placement.d.ts +26 -0
  665. package/dist/reference-placement.js +121 -0
  666. package/dist/reference-placement.js.map +1 -0
  667. package/dist/registry-graph.d.ts +63 -55
  668. package/dist/registry-graph.js +291 -170
  669. package/dist/registry-graph.js.map +1 -1
  670. package/dist/registry-page-cache.d.ts +2 -4
  671. package/dist/registry-page-cache.js.map +1 -1
  672. package/dist/root-install.d.ts +72 -0
  673. package/dist/root-install.js +178 -0
  674. package/dist/root-install.js.map +1 -0
  675. package/dist/runtime-activity.d.ts +20 -0
  676. package/dist/runtime-activity.js +86 -0
  677. package/dist/runtime-activity.js.map +1 -0
  678. package/dist/runtime-argv.d.ts +8 -0
  679. package/dist/runtime-argv.js +37 -0
  680. package/dist/runtime-argv.js.map +1 -0
  681. package/dist/runtime-command-host.d.ts +9 -3
  682. package/dist/runtime-command-host.js +27 -7
  683. package/dist/runtime-command-host.js.map +1 -1
  684. package/dist/runtime-node-flags.d.ts +6 -6
  685. package/dist/runtime-node-flags.js +6 -6
  686. package/dist/runtime-wire-host.d.ts +4 -1
  687. package/dist/runtime-wire-host.js +11 -6
  688. package/dist/runtime-wire-host.js.map +1 -1
  689. package/dist/sha256.d.ts +1 -0
  690. package/dist/sha256.js +4 -0
  691. package/dist/sha256.js.map +1 -0
  692. package/dist/sharing-admission.d.ts +9 -4
  693. package/dist/sharing-admission.js +57 -98
  694. package/dist/sharing-admission.js.map +1 -1
  695. package/dist/sharing-host.d.ts +6 -11
  696. package/dist/sharing-host.js +6 -10
  697. package/dist/sharing-host.js.map +1 -1
  698. package/dist/snapshot-delivery-baseline.d.ts +23 -13
  699. package/dist/snapshot-delivery-baseline.js +37 -40
  700. package/dist/snapshot-delivery-baseline.js.map +1 -1
  701. package/dist/socket-marking.d.ts +9 -0
  702. package/dist/socket-marking.js +26 -0
  703. package/dist/socket-marking.js.map +1 -0
  704. package/dist/source-proof.d.ts +2 -15
  705. package/dist/source-proof.js +9 -4
  706. package/dist/source-proof.js.map +1 -1
  707. package/dist/source-signature.d.ts +122 -21
  708. package/dist/source-signature.js +139 -28
  709. package/dist/source-signature.js.map +1 -1
  710. package/dist/source-witness.d.ts +2 -8
  711. package/dist/source-witness.js +1 -14
  712. package/dist/source-witness.js.map +1 -1
  713. package/dist/sqlite-durability.d.ts +1 -0
  714. package/dist/sqlite-durability.js +2 -0
  715. package/dist/sqlite-durability.js.map +1 -1
  716. package/dist/sqlite.js +8 -8
  717. package/dist/sqlite.js.map +1 -1
  718. package/dist/sync-address.d.ts +0 -3
  719. package/dist/sync-address.js +1 -23
  720. package/dist/sync-address.js.map +1 -1
  721. package/dist/sync-cli.d.ts +6 -2
  722. package/dist/sync-cli.js +19 -4
  723. package/dist/sync-cli.js.map +1 -1
  724. package/dist/sync-setting.d.ts +16 -1
  725. package/dist/sync-setting.js +6 -0
  726. package/dist/sync-setting.js.map +1 -1
  727. package/dist/transfer-instrumentation.d.ts +3 -3
  728. package/dist/transfer-instrumentation.js +7 -5
  729. package/dist/transfer-instrumentation.js.map +1 -1
  730. package/dist/turns.d.ts +4 -2
  731. package/dist/turns.js +17 -15
  732. package/dist/turns.js.map +1 -1
  733. package/dist/updates/artifacts.d.ts +9 -4
  734. package/dist/updates/artifacts.js +132 -9
  735. package/dist/updates/artifacts.js.map +1 -1
  736. package/dist/updates/controller.js +4 -3
  737. package/dist/updates/controller.js.map +1 -1
  738. package/dist/updates/locked-packages.d.ts +4 -0
  739. package/dist/updates/locked-packages.js +26 -0
  740. package/dist/updates/locked-packages.js.map +1 -0
  741. package/dist/updates/store.d.ts +5 -4
  742. package/dist/updates/store.js +5 -4
  743. package/dist/updates/store.js.map +1 -1
  744. package/dist/user-ground-host.d.ts +534 -179
  745. package/dist/user-ground-host.js +3293 -5218
  746. package/dist/user-ground-host.js.map +1 -1
  747. package/dist/watching/fsevents.d.ts +22 -6
  748. package/dist/watching/fsevents.js +29 -7
  749. package/dist/watching/fsevents.js.map +1 -1
  750. package/dist/watching/git-storage.d.ts +22 -0
  751. package/dist/watching/git-storage.js +125 -0
  752. package/dist/watching/git-storage.js.map +1 -0
  753. package/dist/watching/host.d.ts +149 -23
  754. package/dist/watching/host.js +706 -206
  755. package/dist/watching/host.js.map +1 -1
  756. package/dist/watching/index.d.ts +3 -2
  757. package/dist/watching/index.js +2 -1
  758. package/dist/watching/index.js.map +1 -1
  759. package/dist/watching/inotify.d.ts +81 -0
  760. package/dist/watching/inotify.js +184 -0
  761. package/dist/watching/inotify.js.map +1 -0
  762. package/dist/windows-fs.d.ts +12 -0
  763. package/dist/windows-fs.js +19 -0
  764. package/dist/windows-fs.js.map +1 -0
  765. package/dist/windows-owner-only.d.ts +6 -0
  766. package/dist/windows-owner-only.js +84 -0
  767. package/dist/windows-owner-only.js.map +1 -0
  768. package/dist/wire-client.d.ts +13 -11
  769. package/dist/wire-client.js +51 -78
  770. package/dist/wire-client.js.map +1 -1
  771. package/dist/wire-join.d.ts +19 -0
  772. package/dist/wire-join.js +54 -0
  773. package/dist/wire-join.js.map +1 -0
  774. package/dist/wire-outbox.d.ts +3 -0
  775. package/dist/wire-outbox.js +6 -1
  776. package/dist/wire-outbox.js.map +1 -1
  777. package/dist/wire-request-scope.d.ts +2 -1
  778. package/dist/wire-request-scope.js +2 -1
  779. package/dist/wire-request-scope.js.map +1 -1
  780. package/dist/workspace-add-intent.d.ts +41 -0
  781. package/dist/workspace-add-intent.js +107 -0
  782. package/dist/workspace-add-intent.js.map +1 -0
  783. package/dist/workspace-add-staging.d.ts +78 -74
  784. package/dist/workspace-add-staging.js +131 -179
  785. package/dist/workspace-add-staging.js.map +1 -1
  786. package/dist/workspace-host.d.ts +17 -0
  787. package/dist/workspace-host.js +17 -21
  788. package/dist/workspace-host.js.map +1 -1
  789. package/examinations/fixtures/private-wire-authority.js +534 -499
  790. package/examinations/native-service.mjs +29 -4
  791. package/examinations/runtime-upgrade.native-test.mjs +16 -1
  792. package/npm-shrinkwrap.json +253 -464
  793. package/package.json +29 -33
  794. package/dist/apply-cleanup.d.ts +0 -28
  795. package/dist/apply-cleanup.js +0 -166
  796. package/dist/apply-cleanup.js.map +0 -1
  797. package/dist/apply-recovery.d.ts +0 -47
  798. package/dist/apply-recovery.js +0 -100
  799. package/dist/apply-recovery.js.map +0 -1
  800. package/dist/apply-rows.d.ts +0 -72
  801. package/dist/apply-rows.js +0 -150
  802. package/dist/apply-rows.js.map +0 -1
  803. package/dist/apply-saves.d.ts +0 -85
  804. package/dist/apply-saves.js +0 -238
  805. package/dist/apply-saves.js.map +0 -1
  806. package/dist/bounded-for-each.d.ts +0 -3
  807. package/dist/bounded-for-each.js +0 -26
  808. package/dist/bounded-for-each.js.map +0 -1
  809. package/dist/content-cache-ownership.d.ts +0 -13
  810. package/dist/content-cache-ownership.js +0 -75
  811. package/dist/content-cache-ownership.js.map +0 -1
  812. package/dist/content-stream-thread.d.ts +0 -60
  813. package/dist/content-stream-thread.js +0 -95
  814. package/dist/content-stream-thread.js.map +0 -1
  815. package/dist/content-stream-worker.d.ts +0 -7
  816. package/dist/content-stream-worker.js +0 -52
  817. package/dist/content-stream-worker.js.map +0 -1
  818. package/dist/declaration-absorption.d.ts +0 -37
  819. package/dist/declaration-absorption.js +0 -119
  820. package/dist/declaration-absorption.js.map +0 -1
  821. package/dist/declaration-chain.d.ts +0 -36
  822. package/dist/declaration-chain.js +0 -96
  823. package/dist/declaration-chain.js.map +0 -1
  824. package/dist/declaration-commit.d.ts +0 -31
  825. package/dist/declaration-commit.js +0 -49
  826. package/dist/declaration-commit.js.map +0 -1
  827. package/dist/declaration-hold.d.ts +0 -22
  828. package/dist/declaration-hold.js +0 -24
  829. package/dist/declaration-hold.js.map +0 -1
  830. package/dist/declaration-journal.d.ts +0 -62
  831. package/dist/declaration-journal.js +0 -99
  832. package/dist/declaration-journal.js.map +0 -1
  833. package/dist/declaration-save.d.ts +0 -31
  834. package/dist/declaration-save.js +0 -134
  835. package/dist/declaration-save.js.map +0 -1
  836. package/dist/detection/disposition-rows.d.ts +0 -18
  837. package/dist/detection/disposition-rows.js +0 -29
  838. package/dist/detection/disposition-rows.js.map +0 -1
  839. package/dist/detection/git-notice.d.ts +0 -88
  840. package/dist/detection/git-notice.js +0 -444
  841. package/dist/detection/git-notice.js.map +0 -1
  842. package/dist/detection/held-territory.d.ts +0 -51
  843. package/dist/detection/held-territory.js +0 -205
  844. package/dist/detection/held-territory.js.map +0 -1
  845. package/dist/detection/name-reach.d.ts +0 -12
  846. package/dist/detection/name-reach.js +0 -28
  847. package/dist/detection/name-reach.js.map +0 -1
  848. package/dist/detection/portable.d.ts +0 -66
  849. package/dist/detection/portable.js +0 -137
  850. package/dist/detection/portable.js.map +0 -1
  851. package/dist/detection/repository-publication.d.ts +0 -20
  852. package/dist/detection/repository-publication.js +0 -79
  853. package/dist/detection/repository-publication.js.map +0 -1
  854. package/dist/detection/repository-routes.d.ts +0 -43
  855. package/dist/detection/repository-routes.js +0 -98
  856. package/dist/detection/repository-routes.js.map +0 -1
  857. package/dist/detection/seal-law.d.ts +0 -66
  858. package/dist/detection/seal-law.js +0 -116
  859. package/dist/detection/seal-law.js.map +0 -1
  860. package/dist/detection/verified-content.d.ts +0 -6
  861. package/dist/detection/verified-content.js +0 -12
  862. package/dist/detection/verified-content.js.map +0 -1
  863. package/dist/entity-apply-host.d.ts +0 -80
  864. package/dist/entity-apply-host.js +0 -2316
  865. package/dist/entity-apply-host.js.map +0 -1
  866. package/dist/entity-apply-store.d.ts +0 -105
  867. package/dist/entity-apply-store.js +0 -290
  868. package/dist/entity-apply-store.js.map +0 -1
  869. package/dist/git-capture.d.ts +0 -36
  870. package/dist/git-capture.js +0 -91
  871. package/dist/git-capture.js.map +0 -1
  872. package/dist/git-card.d.ts +0 -17
  873. package/dist/git-card.js +0 -133
  874. package/dist/git-card.js.map +0 -1
  875. package/dist/git-checkpoint-construction.d.ts +0 -40
  876. package/dist/git-checkpoint-construction.js +0 -102
  877. package/dist/git-checkpoint-construction.js.map +0 -1
  878. package/dist/git-checkpoint-preparation.d.ts +0 -37
  879. package/dist/git-checkpoint-preparation.js +0 -145
  880. package/dist/git-checkpoint-preparation.js.map +0 -1
  881. package/dist/git-configuration.d.ts +0 -40
  882. package/dist/git-configuration.js +0 -217
  883. package/dist/git-configuration.js.map +0 -1
  884. package/dist/git-evidence.d.ts +0 -61
  885. package/dist/git-evidence.js +0 -181
  886. package/dist/git-evidence.js.map +0 -1
  887. package/dist/git-index-witness.d.ts +0 -33
  888. package/dist/git-index-witness.js +0 -69
  889. package/dist/git-index-witness.js.map +0 -1
  890. package/dist/git-literal-host.d.ts +0 -82
  891. package/dist/git-literal-host.js +0 -173
  892. package/dist/git-literal-host.js.map +0 -1
  893. package/dist/git-literal-read.d.ts +0 -88
  894. package/dist/git-literal-read.js +0 -170
  895. package/dist/git-literal-read.js.map +0 -1
  896. package/dist/git-literal-replay.d.ts +0 -33
  897. package/dist/git-literal-replay.js +0 -269
  898. package/dist/git-literal-replay.js.map +0 -1
  899. package/dist/git-native-file.d.ts +0 -42
  900. package/dist/git-native-file.js +0 -145
  901. package/dist/git-native-file.js.map +0 -1
  902. package/dist/git-native-index.d.ts +0 -21
  903. package/dist/git-native-index.js +0 -44
  904. package/dist/git-native-index.js.map +0 -1
  905. package/dist/git-operation-host.d.ts +0 -48
  906. package/dist/git-operation-host.js +0 -127
  907. package/dist/git-operation-host.js.map +0 -1
  908. package/dist/git-private-index.d.ts +0 -11
  909. package/dist/git-private-index.js +0 -42
  910. package/dist/git-private-index.js.map +0 -1
  911. package/dist/git-private-repository.d.ts +0 -4
  912. package/dist/git-private-repository.js +0 -69
  913. package/dist/git-private-repository.js.map +0 -1
  914. package/dist/git-private-view.d.ts +0 -57
  915. package/dist/git-private-view.js +0 -240
  916. package/dist/git-private-view.js.map +0 -1
  917. package/dist/git-ref-store.d.ts +0 -12
  918. package/dist/git-ref-store.js +0 -68
  919. package/dist/git-ref-store.js.map +0 -1
  920. package/dist/git-registration-host.d.ts +0 -38
  921. package/dist/git-registration-host.js +0 -96
  922. package/dist/git-registration-host.js.map +0 -1
  923. package/dist/git-repository-host.d.ts +0 -191
  924. package/dist/git-repository-host.js +0 -917
  925. package/dist/git-repository-host.js.map +0 -1
  926. package/dist/git-worktree-host.d.ts +0 -2
  927. package/dist/git-worktree-host.js +0 -16
  928. package/dist/git-worktree-host.js.map +0 -1
  929. package/dist/graph-publication.d.ts +0 -75
  930. package/dist/graph-publication.js +0 -203
  931. package/dist/graph-publication.js.map +0 -1
  932. package/dist/ground-territory.d.ts +0 -130
  933. package/dist/ground-territory.js +0 -511
  934. package/dist/ground-territory.js.map +0 -1
  935. package/dist/register-upload-fusion.d.ts +0 -84
  936. package/dist/register-upload-fusion.js +0 -172
  937. package/dist/register-upload-fusion.js.map +0 -1
  938. package/dist/repository-identity-steps.d.ts +0 -5
  939. package/dist/repository-identity-steps.js +0 -33
  940. package/dist/repository-identity-steps.js.map +0 -1
@@ -0,0 +1,63 @@
1
+ import { type FingerprintClock, type FingerprintOptions } from "./apply-fingerprint.js";
2
+ import { type Remainder } from "./apply-kept.js";
3
+ import type { ContentStamp } from "./content-clock.js";
4
+ import type { GroundRow } from "./ground-row.js";
5
+ export interface DisplacedTreeManifest {
6
+ readonly contract: "amalgm.apply-displaced-tree@2";
7
+ /** The clock the fingerprint was taken under. */
8
+ readonly clock: FingerprintClock | null;
9
+ /** Every name beneath the directory but `aside` (apply-fingerprint.ts). */
10
+ readonly digest: string;
11
+ /** What a matching Verify keeps rather than lets go: the topmost local
12
+ * remainder and each computer-only directory, with the shared container
13
+ * it belongs to. */
14
+ readonly aside: readonly Remainder[];
15
+ }
16
+ export type DisplacedTreeProof = {
17
+ readonly kind: "proved";
18
+ readonly manifest: DisplacedTreeManifest;
19
+ } | {
20
+ readonly kind: "differs";
21
+ readonly reason: string;
22
+ };
23
+ type Reads = Pick<FingerprintOptions, "onRead" | "onBytes">;
24
+ /**
25
+ * Proves the directory at `source`, O's `owner`, holds exactly O's `rows`
26
+ * beneath it, and takes its manifest under `stamp`, the clock stamped before
27
+ * the walk. `aside` is its topmost local remainder; `shows` reads whether a
28
+ * leaf, link, reference or repository stands as its O row says.
29
+ */
30
+ export declare function proveDisplacedTree(input: {
31
+ readonly source: string;
32
+ readonly owner: string;
33
+ readonly rows: readonly GroundRow[];
34
+ readonly aside: readonly Remainder[];
35
+ readonly stamp: ContentStamp;
36
+ readonly shows: (row: GroundRow, path: string) => Promise<boolean>;
37
+ } & Reads): Promise<DisplacedTreeProof>;
38
+ /** Whether the copy at `displaced`, taken from `source`, still holds every
39
+ * name its manifest signed, read under the clock it was signed under, whose
40
+ * qualification the caller proves still stands. Nothing displaced has
41
+ * nothing to lose. */
42
+ export declare function displacedTreeShows(displaced: string, source: string, manifest: DisplacedTreeManifest, reads?: Reads): Promise<boolean>;
43
+ /**
44
+ * Brings a source its member set aside home: to `home` when nothing stands
45
+ * there and `homeFree` holds, since the member's own reveal no longer holds
46
+ * it. Otherwise a person's object holds its home, and each name beneath a
47
+ * directory is kept for `owner`, the container it was (apply-kept.ts); a
48
+ * file or link set aside is O, which its final guard proved, and goes with
49
+ * the window. Names the directories owed a flush, and whether anything was
50
+ * kept; nothing displaced has nothing to bring.
51
+ */
52
+ export declare function bringDisplacedHome(input: {
53
+ readonly displaced: string;
54
+ readonly home: string;
55
+ readonly homeFree: boolean;
56
+ readonly root: string;
57
+ readonly owner: string;
58
+ readonly attemptId: string;
59
+ }): {
60
+ readonly flush: readonly string[];
61
+ readonly kept: boolean;
62
+ };
63
+ export {};
@@ -0,0 +1,148 @@
1
+ /** The directory a received result displaces whole: a Leave's container, or
2
+ * a container a leaf, link or reference replaces. It moves aside into its
3
+ * window's control tree and goes only at the durability point, so Apply
4
+ * deletes nothing beneath it that a person wrote.
5
+ *
6
+ * - The final guard stamps its root's content clock, then walks every name
7
+ * beneath it by Detect's walk law (src/detection/root-examination.ts) and
8
+ * proves each is O: a name O does not hold, a row O holds that stands
9
+ * nowhere, a parent, type or object that differs, or a leaf, link,
10
+ * reference or repository whose ground shows another result is a person's
11
+ * change, which Detect records before Apply looks again.
12
+ * - The same walk takes the tree's fingerprint (apply-fingerprint.ts), which
13
+ * the receipt binds before any effect. Each name joins it before its
14
+ * ground is read, so a write after that read differs from it.
15
+ * - The reveal only takes the directory aside. Its member's Verify takes the
16
+ * copy's fingerprint again before it judges anything else, and the copy
17
+ * goes only when that member's Verify matches. Every other answer brings
18
+ * it home first (bringDisplacedHome), so Verify's next read finds the
19
+ * person's version, which Detect records as the newest result.
20
+ * - Local remainder (apply-kept.ts) and each computer-only `.amalgm` or
21
+ * `.private` beneath it are set aside: the walk neither compares nor
22
+ * digests them, and only a matching Verify keeps them.
23
+ *
24
+ * Residuals: a writer holding a file open, or a shell whose working
25
+ * directory is inside the copy, can still write after Verify's read and
26
+ * before the durability point. A root that leaves between the reveal and
27
+ * Verify keeps the copy in its own control tree, which nothing reads until
28
+ * the root returns. */
29
+ import { basename, dirname, join, relative } from "node:path";
30
+ import { isLocalOnlyPath } from "@amalgm/core/identity";
31
+ import { classifyDirectory, CONTAINERS, isRepositoryMetadataEntry } from "@amalgm/live";
32
+ import { clockBoundary, fingerprintClock, fingerprintTree } from "./apply-fingerprint.js";
33
+ import { keepAside } from "./apply-kept.js";
34
+ import { moveWithoutReplacing } from "./apply-spelling.js";
35
+ import { listAgain, railChanged } from "./detection/walk-law.js";
36
+ import { marksRepository, observeGitMarker } from "./git/marker.js";
37
+ import { optionalLstat } from "./physical-path-witness.js";
38
+ import { physicalKey } from "./source-signature.js";
39
+ /**
40
+ * Proves the directory at `source`, O's `owner`, holds exactly O's `rows`
41
+ * beneath it, and takes its manifest under `stamp`, the clock stamped before
42
+ * the walk. `aside` is its topmost local remainder; `shows` reads whether a
43
+ * leaf, link, reference or repository stands as its O row says.
44
+ */
45
+ export async function proveDisplacedTree(input) {
46
+ const aside = [...input.aside];
47
+ const skipped = new Set(aside.map(({ path }) => relative(input.source, path)));
48
+ const byPath = new Map(input.rows.map(row => [row.absolutePath, row]));
49
+ const reached = new Set();
50
+ // The O container each walked directory is; Git's own storage beneath a
51
+ // repository is digested but never compared.
52
+ const owners = new Map([[input.source, input.owner]]);
53
+ const skips = (relativePath, parent) => {
54
+ if (skipped.has(relativePath))
55
+ return true;
56
+ const owner = owners.get(parent);
57
+ if (!owner || !isLocalOnlyPath(basename(relativePath)))
58
+ return false;
59
+ aside.push({ owner, path: join(input.source, relativePath) });
60
+ skipped.add(relativePath);
61
+ return true;
62
+ };
63
+ const clock = fingerprintClock(input.stamp);
64
+ const walked = await fingerprintTree(input.source, { clock: clockBoundary(clock), skips, onRead: input.onRead,
65
+ onBytes: input.onBytes, visit: async ({ path, parent, stats }) => {
66
+ const owner = owners.get(parent);
67
+ if (!owner || isRepositoryMetadataEntry(basename(path))) {
68
+ if (stats.isDirectory())
69
+ owners.set(path, null);
70
+ return null;
71
+ }
72
+ const supported = stats.isDirectory() || stats.isFile() || stats.isSymbolicLink();
73
+ const row = byPath.get(path);
74
+ if (!row)
75
+ return supported ? `${path} is a name O does not hold` : null;
76
+ if (row.parentUUID !== owner)
77
+ return `${path} stands under another parent`;
78
+ if (!supported)
79
+ return `${path} is no longer a file, folder or link`;
80
+ const type = stats.isDirectory() ? classifyDirectory({ repository: marksRepository(observeGitMarker(path)) }) : row.type;
81
+ if (railChanged(row.type, type))
82
+ return `${path} changed type`;
83
+ reached.add(row.uuid);
84
+ if (stats.isDirectory() && CONTAINERS.has(row.type)) {
85
+ if (physicalKey(stats) !== row.physicalKey)
86
+ return `${path} is another directory`;
87
+ if (row.type === "repo.git" && !await input.shows(row, path))
88
+ return `${path} shows another repository state`;
89
+ owners.set(path, row.uuid);
90
+ return null;
91
+ }
92
+ return await input.shows(row, path) ? null : `${path} shows another result`;
93
+ } });
94
+ if ("differs" in walked)
95
+ return { kind: "differs", reason: walked.differs };
96
+ const kept = (path) => {
97
+ for (let at = relative(input.source, path); at !== "." && at !== ""; at = dirname(at))
98
+ if (skipped.has(at))
99
+ return true;
100
+ return false;
101
+ };
102
+ const absent = input.rows.find(row => !reached.has(row.uuid) && !kept(row.absolutePath));
103
+ if (absent)
104
+ return { kind: "differs", reason: `${absent.absolutePath} is gone` };
105
+ return { kind: "proved", manifest: { contract: "amalgm.apply-displaced-tree@2", clock, digest: walked.digest, aside } };
106
+ }
107
+ /** Whether the copy at `displaced`, taken from `source`, still holds every
108
+ * name its manifest signed, read under the clock it was signed under, whose
109
+ * qualification the caller proves still stands. Nothing displaced has
110
+ * nothing to lose. */
111
+ export async function displacedTreeShows(displaced, source, manifest, reads = {}) {
112
+ // A manifest of another contract proves nothing.
113
+ if (manifest.contract !== "amalgm.apply-displaced-tree@2")
114
+ return false;
115
+ if (!optionalLstat(displaced)?.isDirectory())
116
+ return true;
117
+ const skipped = new Set(manifest.aside.map(({ path }) => relative(source, path)));
118
+ const walked = await fingerprintTree(displaced, { clock: clockBoundary(manifest.clock),
119
+ skips: relativePath => skipped.has(relativePath), ...reads });
120
+ return "digest" in walked && walked.digest === manifest.digest;
121
+ }
122
+ /**
123
+ * Brings a source its member set aside home: to `home` when nothing stands
124
+ * there and `homeFree` holds, since the member's own reveal no longer holds
125
+ * it. Otherwise a person's object holds its home, and each name beneath a
126
+ * directory is kept for `owner`, the container it was (apply-kept.ts); a
127
+ * file or link set aside is O, which its final guard proved, and goes with
128
+ * the window. Names the directories owed a flush, and whether anything was
129
+ * kept; nothing displaced has nothing to bring.
130
+ */
131
+ export function bringDisplacedHome(input) {
132
+ const stats = optionalLstat(input.displaced);
133
+ if (!stats)
134
+ return { flush: [], kept: false };
135
+ if (input.homeFree && moveWithoutReplacing(input.displaced, input.home)) {
136
+ return { flush: [dirname(input.displaced), dirname(input.home)], kept: false };
137
+ }
138
+ if (!stats.isDirectory())
139
+ return { flush: [], kept: false };
140
+ const flush = new Set();
141
+ for (const name of listAgain(input.displaced) ?? []) {
142
+ for (const directory of keepAside({ root: input.root, attemptId: input.attemptId, owner: input.owner,
143
+ from: join(input.displaced, name), name }))
144
+ flush.add(directory);
145
+ }
146
+ return { flush: [...flush], kept: true };
147
+ }
148
+ //# sourceMappingURL=apply-displaced-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-displaced-tree.js","sourceRoot":"","sources":["../src/apply-displaced-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA2BuB;AACvB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,c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pD,KAAK,MAAM,SAAS,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK;YAClG,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type TrashStep } from "./apply-trash-keep.js";
2
+ /** The members one point may owe before it runs early. */
3
+ export declare const DURABILITY_CAP: {
4
+ readonly members: 4096;
5
+ };
6
+ /** What one ended window owes the point. */
7
+ export interface OwedWindow {
8
+ readonly attemptId: string;
9
+ readonly files: readonly string[];
10
+ readonly directories: readonly string[];
11
+ /** Control trees the window may let go once durable. */
12
+ readonly controls: readonly string[];
13
+ /** What its Trash keeps take from those trees, or release, first. */
14
+ readonly trash: readonly TrashStep[];
15
+ readonly members: number;
16
+ }
17
+ export interface ApplyDurabilityOptions {
18
+ readonly databaseFile: string;
19
+ readonly onError?: (error: Error) => void;
20
+ }
21
+ export declare class ApplyDurability {
22
+ #private;
23
+ constructor(options: ApplyDurabilityOptions);
24
+ /** How many windows wait for the point. */
25
+ get owed(): number;
26
+ /** An ended window joins the next point; at the cap the point runs now. */
27
+ owe(window: OwedWindow): void;
28
+ /** The point: every owed object persists, then one strict save. A failed
29
+ * flush leaves its windows owed for the next point and reports. */
30
+ point(): Promise<void>;
31
+ /** Resolves once no point runs. */
32
+ idle(): Promise<void>;
33
+ }
@@ -0,0 +1,72 @@
1
+ /** The window's durability point. A window's end is an ordered commit: it
2
+ * answers before the drive holds where its members placed their results.
3
+ * Their bytes persisted before their receipts bound (apply-window-store.ts
4
+ * bindWindow), so the point owes placement only. At idle or at the cap,
5
+ * for every window ended since the last point, each touched directory and
6
+ * revealed file is flushed, in parallel, and then one strict save marks
7
+ * those windows durable, which also lets their control trees go, once their
8
+ * Trash keeps have taken what they keep (apply-trash-keep.ts). The hot
9
+ * path per window owes no placement flush. */
10
+ import { rm } from "node:fs/promises";
11
+ import { parallelForEach } from "@amalgm/live";
12
+ import { settleTrash } from "./apply-trash-keep.js";
13
+ import { flushEach } from "./flush.js";
14
+ import { save } from "./ground-saver.js";
15
+ /** The members one point may owe before it runs early. */
16
+ export const DURABILITY_CAP = { members: 4096 };
17
+ export class ApplyDurability {
18
+ #file;
19
+ #onError;
20
+ #owed = [];
21
+ #members = 0;
22
+ #running = null;
23
+ constructor(options) {
24
+ this.#file = options.databaseFile;
25
+ this.#onError = options.onError ?? (() => undefined);
26
+ }
27
+ /** How many windows wait for the point. */
28
+ get owed() {
29
+ return this.#owed.length;
30
+ }
31
+ /** An ended window joins the next point; at the cap the point runs now. */
32
+ owe(window) {
33
+ this.#owed.push(window);
34
+ this.#members += window.members;
35
+ if (this.#members >= DURABILITY_CAP.members)
36
+ void this.point();
37
+ }
38
+ /** The point: every owed object persists, then one strict save. A failed
39
+ * flush leaves its windows owed for the next point and reports. */
40
+ point() {
41
+ if (this.#running)
42
+ return this.#running;
43
+ if (this.#owed.length === 0)
44
+ return Promise.resolve();
45
+ const run = this.#run().catch(error => { this.#onError(error instanceof Error ? error : new Error(String(error))); })
46
+ .finally(() => { this.#running = null; });
47
+ this.#running = run;
48
+ return run;
49
+ }
50
+ /** Resolves once no point runs. */
51
+ idle() {
52
+ return this.#running ?? Promise.resolve();
53
+ }
54
+ async #run() {
55
+ const windows = this.#owed;
56
+ this.#owed = [];
57
+ this.#members = 0;
58
+ try {
59
+ await flushEach(windows.flatMap(window => window.files), windows.flatMap(window => window.directories));
60
+ await save(this.#file, "apply.durable", { attemptIds: windows.map(window => window.attemptId) });
61
+ }
62
+ catch (error) {
63
+ this.#owed.unshift(...windows);
64
+ for (const window of windows)
65
+ this.#members += window.members;
66
+ throw error;
67
+ }
68
+ await settleTrash(windows.flatMap(window => window.trash));
69
+ await parallelForEach(windows.flatMap(window => window.controls), 16, control => rm(control, { recursive: true, force: true }));
70
+ }
71
+ }
72
+ //# sourceMappingURL=apply-durability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-durability.js","sourceRoot":"","sources":["../src/apply-durability.ts"],"names":[],"mappings":"AAAA;;;;;;;;8CAQ8C;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAkB,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,IAAI,EAAW,CAAC;AAmBzD,MAAM,OAAO,eAAe;IACjB,KAAK,CAAS;IACd,QAAQ,CAAyB;IAC1C,KAAK,GAAiB,EAAE,CAAC;IACzB,QAAQ,GAAG,CAAC,CAAC;IACb,QAAQ,GAAyB,IAAI,CAAC;IAEtC,YAAY,OAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;IAED,2CAA2C;IAC3C,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,2EAA2E;IAC3E,GAAG,CAAC,MAAkB;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,CA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KAAK,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACnG,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;YAC/B,KAAK,MAAM,MAAM,IAAI,OAAO;gBAAE,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC;YAC9D,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3D,MAAM,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,EAClE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -0,0 +1,91 @@
1
+ import type { CloudEntityRecord, TransferArtifact } from "@amalgm/live";
2
+ import type { GitLine } from "./materialized-graph.js";
3
+ import type { EnterClosure } from "./apply-enter-plan.js";
4
+ import type { ContentBoundary } from "./content-clock.js";
5
+ import type { GitOwners } from "./git/home.js";
6
+ import { type GitLines, type LocalArtifactFile } from "./materialize-records.js";
7
+ import type { AddStagingRouting } from "./workspace-add-staging.js";
8
+ declare const CONTRACT = "amalgm.apply-enter@3";
9
+ /** One row the landing saves, addressed relative to the tree. The target's
10
+ * own row has the empty path. */
11
+ export interface SealedEnterRow {
12
+ readonly record: CloudEntityRecord;
13
+ readonly relativePath: string;
14
+ readonly physicalKey: string;
15
+ readonly sourceSignature: string | null;
16
+ readonly filesystemMode: number;
17
+ }
18
+ export interface EnterSeal {
19
+ readonly contract: typeof CONTRACT;
20
+ /** The accepted target version the tree shows. */
21
+ readonly targetVersion: string;
22
+ /** The delivery position the closure was read at. */
23
+ readonly position: number;
24
+ /** Members left out, sorted: what this computer shows, and what a later
25
+ * row places. */
26
+ readonly leftOut: readonly string[];
27
+ /** The tree root's physical key: the object the landing moves. */
28
+ readonly root: string;
29
+ /** Where the tree lands. Reference link text was computed from it. */
30
+ readonly targetPath: string;
31
+ readonly rows: readonly SealedEnterRow[];
32
+ /** Each repository the build played onto its line, with that line
33
+ * (git-install-lines.ts). */
34
+ readonly lines?: readonly {
35
+ readonly uuid: string;
36
+ readonly line: GitLine;
37
+ }[];
38
+ }
39
+ export interface PreparedEnter {
40
+ readonly tree: string;
41
+ readonly seal: EnterSeal;
42
+ /** Content proofs by UUID, taken by this process's build. */
43
+ readonly proofs: ReadonlyMap<string, string>;
44
+ readonly contentBoundary: ContentBoundary | null;
45
+ }
46
+ /** What a build must show; an existing seal is adopted only when it agrees. */
47
+ export interface EnterExpectation {
48
+ readonly target: CloudEntityRecord;
49
+ readonly position: number;
50
+ readonly leftOut: readonly string[];
51
+ readonly targetPath: string;
52
+ }
53
+ /** One Enter's staging directory inside its window's control directory.
54
+ * Every member of a window shares that directory, so each Enter takes its own
55
+ * slot, numbered in the order its window first builds it. The slot is the
56
+ * shortest name that keeps two Enters apart: Git for Windows refuses a
57
+ * repository past about 259 characters, and Git builds every repository
58
+ * entering beneath this slot, however deep it will stand (git/rail.ts
59
+ * GitClone.buildIn). */
60
+ export declare const enterStaging: (control: string, slot: number) => string;
61
+ /** Whether a seal shows exactly what the expectation asks for. */
62
+ export declare const sealShows: (seal: EnterSeal, expected: EnterExpectation) => boolean;
63
+ /** The seal an intent's staging holds, or null when it was never sealed. */
64
+ export declare function readEnterSeal(staging: string): EnterSeal | null;
65
+ /** The seal a bound Enter depends on, found beside the tree its receipt
66
+ * names. The tree may already have landed, so only the seal is read. */
67
+ export declare function boundEnter(tree: string): PreparedEnter;
68
+ /**
69
+ * Build, or adopt, the tree an unbound Enter lands. A sealed tree this attempt
70
+ * built that still stands and shows what is expected is adopted. Anything
71
+ * else in the staging directory was never exposed, so it is deleted and the
72
+ * closure is built again.
73
+ */
74
+ export declare function prepareEnter(input: {
75
+ readonly control: string;
76
+ /** This Enter's slot in its window (enterStaging). */
77
+ readonly slot: number;
78
+ readonly closure: EnterClosure;
79
+ readonly expected: EnterExpectation;
80
+ /** The binding root whose content clock qualifies the rows. */
81
+ readonly clockRoot: string;
82
+ readonly databaseFile: string;
83
+ readonly bindingDir: string;
84
+ /** The repositories this computer already holds, where a worktree or
85
+ * submodule entering finds its home. */
86
+ readonly held: GitOwners;
87
+ /** Each repository's line (materialize-records.ts `GitLines`). */
88
+ readonly gitLines?: GitLines;
89
+ readContent(artifacts: readonly TransferArtifact[], staged?: AddStagingRouting): Promise<ReadonlyMap<string, LocalArtifactFile>>;
90
+ }): Promise<PreparedEnter>;
91
+ export {};
@@ -0,0 +1,145 @@
1
+ /**
2
+ * A container Enter's staged install (docs/entity-apply.md, Container Enter).
3
+ *
4
+ * The closure is built off to one side, inside its intent's control
5
+ * directory, as Add builds its hidden staging: each cold file downloads once,
6
+ * straight to its place in the tree, and is handed to the tree's barrier
7
+ * (workspace-add-staging.ts). Then its seal is written beside it, and that
8
+ * one durability barrier makes the tree and the seal's bytes persist
9
+ * together, since nothing names either yet. A tree
10
+ * is complete only once its sealed `install.json` exists. A tree without a
11
+ * seal is scrap and is built again. Within one running attempt a sealed tree
12
+ * is adopted; a crash before the bind leaves only private work, which the
13
+ * next start sweeps away (src/apply-window-host.ts, recoverStart).
14
+ *
15
+ * The seal is what keeps Apply's result apart from a person's later work
16
+ * across a crash. It holds every row the landing will save, relative to the
17
+ * tree, with the fingerprints the build took. After the landing, a person's
18
+ * edit to a member changes that member's fingerprint against its sealed row,
19
+ * so Detect records it; nothing is re-read to make the row.
20
+ *
21
+ * Content proofs (`sighting`) are process facts. They stay in memory
22
+ * with the clock epoch they were taken in, and an adopted seal has none.
23
+ */
24
+ import { readFileSync, renameSync, writeFileSync } from "node:fs";
25
+ import { rm } from "node:fs/promises";
26
+ import { dirname, join } from "node:path";
27
+ import { flushEach } from "./flush.js";
28
+ import { ensureApplyPrivate } from "./apply-control.js";
29
+ import { holds, standing } from "./apply-spelling.js";
30
+ import { durabilityBarrier } from "./durability-barrier.js";
31
+ import { materializeRecords } from "./materialize-records.js";
32
+ import { isPhysicalKey, physicalKey } from "./source-signature.js";
33
+ const CONTRACT = "amalgm.apply-enter@3";
34
+ /** One Enter's staging directory inside its window's control directory.
35
+ * Every member of a window shares that directory, so each Enter takes its own
36
+ * slot, numbered in the order its window first builds it. The slot is the
37
+ * shortest name that keeps two Enters apart: Git for Windows refuses a
38
+ * repository past about 259 characters, and Git builds every repository
39
+ * entering beneath this slot, however deep it will stand (git/rail.ts
40
+ * GitClone.buildIn). */
41
+ export const enterStaging = (control, slot) => join(control, "enter", String(slot));
42
+ const treeOf = (staging) => join(staging, "tree");
43
+ const sealOf = (staging) => join(staging, "install.json");
44
+ const sameList = (left, right) => left.length === right.length && left.every((value, index) => value === right[index]);
45
+ /** Whether a seal shows exactly what the expectation asks for. */
46
+ export const sealShows = (seal, expected) => seal.targetVersion === expected.target.version && seal.position === expected.position
47
+ && seal.targetPath === expected.targetPath && sameList(seal.leftOut, expected.leftOut);
48
+ /** The seal an intent's staging holds, or null when it was never sealed. */
49
+ export function readEnterSeal(staging) {
50
+ let encoded;
51
+ try {
52
+ encoded = readFileSync(sealOf(staging), "utf8");
53
+ }
54
+ catch (error) {
55
+ if (error.code === "ENOENT")
56
+ return null;
57
+ throw error;
58
+ }
59
+ const seal = JSON.parse(encoded);
60
+ if (seal.contract !== CONTRACT)
61
+ throw new Error(`Apply Enter seal contract ${String(seal.contract)} is superseded`);
62
+ if (typeof seal.targetVersion !== "string" || !Number.isSafeInteger(seal.position)
63
+ || !Array.isArray(seal.leftOut) || !isPhysicalKey(seal.root)
64
+ || typeof seal.targetPath !== "string" || !Array.isArray(seal.rows)
65
+ || seal.rows.filter(row => row.relativePath === "").length !== 1) {
66
+ throw new Error("Apply Enter seal is malformed");
67
+ }
68
+ return seal;
69
+ }
70
+ /** An adopted seal: the rows stand, and no process proof survives. */
71
+ const adopted = (staging, seal) => ({ tree: treeOf(staging), seal, proofs: new Map(), contentBoundary: null });
72
+ /** The seal a bound Enter depends on, found beside the tree its receipt
73
+ * names. The tree may already have landed, so only the seal is read. */
74
+ export function boundEnter(tree) {
75
+ const staging = dirname(tree);
76
+ const seal = readEnterSeal(staging);
77
+ if (!seal)
78
+ throw new Error(`bound Apply Enter has no sealed install at ${staging}`);
79
+ return adopted(staging, seal);
80
+ }
81
+ /**
82
+ * Build, or adopt, the tree an unbound Enter lands. A sealed tree this attempt
83
+ * built that still stands and shows what is expected is adopted. Anything
84
+ * else in the staging directory was never exposed, so it is deleted and the
85
+ * closure is built again.
86
+ */
87
+ export async function prepareEnter(input) {
88
+ const { expected } = input;
89
+ const staging = enterStaging(input.control, input.slot), tree = treeOf(staging);
90
+ const existing = readEnterSeal(staging);
91
+ if (existing && sealShows(existing, expected) && holds(tree, existing.root))
92
+ return adopted(staging, existing);
93
+ await rm(staging, { recursive: true, force: true });
94
+ ensureApplyPrivate(input.control, staging);
95
+ const built = await materializeRecords({
96
+ records: input.closure.records,
97
+ rootPath: tree,
98
+ database: input.databaseFile,
99
+ boundaryUUID: expected.target.uuid,
100
+ bindingDir: input.bindingDir,
101
+ clockRoot: input.clockRoot,
102
+ revealedAt: expected.targetPath,
103
+ leftOut: new Set(expected.leftOut),
104
+ held: input.held,
105
+ gitStorage: input.held.storage,
106
+ ...(input.gitLines ? { gitLines: input.gitLines } : {}),
107
+ staged: true,
108
+ readContent: (artifacts, staged) => input.readContent(artifacts, staged),
109
+ });
110
+ const { rows } = built;
111
+ const root = standing(tree);
112
+ if (!root?.isDirectory())
113
+ throw new Error(`Apply Enter tree did not stand at ${tree}`);
114
+ const seal = {
115
+ contract: CONTRACT,
116
+ targetVersion: expected.target.version,
117
+ position: expected.position,
118
+ leftOut: [...expected.leftOut],
119
+ root: physicalKey(root),
120
+ targetPath: expected.targetPath,
121
+ rows: rows.map(row => ({
122
+ record: row.record, relativePath: row.relativePath, physicalKey: row.physicalKey,
123
+ sourceSignature: row.sourceSignature, filesystemMode: row.filesystemMode,
124
+ })),
125
+ ...rows.some(row => row.gitLine) ? { lines: rows.flatMap(({ record, gitLine }) => gitLine ? [{ uuid: record.uuid, line: gitLine }] : []) } : {},
126
+ };
127
+ await writeSeal(staging, seal, (await built.durable).files);
128
+ return {
129
+ tree,
130
+ seal,
131
+ proofs: new Map(rows.flatMap(row => row.sighting === null ? [] : [[row.record.uuid, row.sighting]])),
132
+ contentBoundary: built.contentBoundary,
133
+ };
134
+ }
135
+ /** The seal makes the tree complete, so it lands whole or not at all. Its
136
+ * bytes persist with the tree's before the rename that names it, and that
137
+ * name before the build is answered: a bound window reads its seal. */
138
+ async function writeSeal(staging, seal, durable) {
139
+ const file = sealOf(staging), pending = `${file}.pending`;
140
+ writeFileSync(pending, `${JSON.stringify(seal)}\n`, { mode: 0o600 });
141
+ await Promise.all([durabilityBarrier(treeOf(staging), durable), flushEach([pending], [])]);
142
+ renameSync(pending, file);
143
+ await flushEach([], [staging]);
144
+ }
145
+ //# sourceMappingURL=apply-enter-build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-enter-build.js","sourceRoot":"","sources":["../src/apply-enter-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAI1C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,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