@amalgm/shell 0.1.164-preview.36072132286 → 0.1.164-preview.36809057014

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 (475) hide show
  1. package/PURPOSE.md +642 -128
  2. package/README.md +10 -8
  3. package/dist/accepted-tail.d.ts +26 -0
  4. package/dist/accepted-tail.js +37 -0
  5. package/dist/accepted-tail.js.map +1 -0
  6. package/dist/agent-execution.d.ts +16 -1
  7. package/dist/agent-execution.js +13 -5
  8. package/dist/agent-execution.js.map +1 -1
  9. package/dist/apply-cleanup.d.ts +28 -0
  10. package/dist/apply-cleanup.js +166 -0
  11. package/dist/apply-cleanup.js.map +1 -0
  12. package/dist/apply-recovery.d.ts +47 -0
  13. package/dist/apply-recovery.js +99 -0
  14. package/dist/apply-recovery.js.map +1 -0
  15. package/dist/apply-rows.d.ts +72 -0
  16. package/dist/apply-rows.js +150 -0
  17. package/dist/apply-rows.js.map +1 -0
  18. package/dist/apply-saves.d.ts +85 -0
  19. package/dist/apply-saves.js +238 -0
  20. package/dist/apply-saves.js.map +1 -0
  21. package/dist/boot.js +2 -1
  22. package/dist/boot.js.map +1 -1
  23. package/dist/capture-work.d.ts +8 -0
  24. package/dist/capture-work.js +67 -0
  25. package/dist/capture-work.js.map +1 -0
  26. package/dist/cargo-group.d.ts +45 -0
  27. package/dist/cargo-group.js +88 -0
  28. package/dist/cargo-group.js.map +1 -0
  29. package/dist/channel-session.d.ts +4 -2
  30. package/dist/channel-session.js +4 -3
  31. package/dist/channel-session.js.map +1 -1
  32. package/dist/chat-composition.d.ts +2 -0
  33. package/dist/chat-composition.js +1 -0
  34. package/dist/chat-composition.js.map +1 -1
  35. package/dist/cli.js +20 -1
  36. package/dist/cli.js.map +1 -1
  37. package/dist/construct-apply-host.d.ts +4 -2
  38. package/dist/construct-apply-host.js +8 -3
  39. package/dist/construct-apply-host.js.map +1 -1
  40. package/dist/construct-door.js +1 -1
  41. package/dist/construct-door.js.map +1 -1
  42. package/dist/construct-ledger.d.ts +6 -1
  43. package/dist/construct-ledger.js +21 -33
  44. package/dist/construct-ledger.js.map +1 -1
  45. package/dist/content-cache-collection.d.ts +18 -0
  46. package/dist/content-cache-collection.js +99 -0
  47. package/dist/content-cache-collection.js.map +1 -0
  48. package/dist/content-cache-host.d.ts +83 -17
  49. package/dist/content-cache-host.js +335 -95
  50. package/dist/content-cache-host.js.map +1 -1
  51. package/dist/content-cache-namespace.d.ts +59 -0
  52. package/dist/content-cache-namespace.js +210 -0
  53. package/dist/content-cache-namespace.js.map +1 -0
  54. package/dist/content-cache-ownership.d.ts +13 -0
  55. package/dist/content-cache-ownership.js +75 -0
  56. package/dist/content-cache-ownership.js.map +1 -0
  57. package/dist/content-cache-retention.d.ts +23 -0
  58. package/dist/content-cache-retention.js +195 -0
  59. package/dist/content-cache-retention.js.map +1 -0
  60. package/dist/content-capture-pool.d.ts +287 -0
  61. package/dist/content-capture-pool.js +461 -0
  62. package/dist/content-capture-pool.js.map +1 -0
  63. package/dist/content-capture-worker.d.ts +8 -0
  64. package/dist/content-capture-worker.js +109 -0
  65. package/dist/content-capture-worker.js.map +1 -0
  66. package/dist/content-clock.d.ts +42 -0
  67. package/dist/content-clock.js +166 -0
  68. package/dist/content-clock.js.map +1 -0
  69. package/dist/content-direct.d.ts +2 -0
  70. package/dist/content-direct.js +12 -0
  71. package/dist/content-direct.js.map +1 -1
  72. package/dist/content-failure.d.ts +18 -0
  73. package/dist/content-failure.js +38 -0
  74. package/dist/content-failure.js.map +1 -0
  75. package/dist/content-stream-thread.d.ts +60 -0
  76. package/dist/content-stream-thread.js +95 -0
  77. package/dist/content-stream-thread.js.map +1 -0
  78. package/dist/content-stream-worker.d.ts +7 -0
  79. package/dist/content-stream-worker.js +52 -0
  80. package/dist/content-stream-worker.js.map +1 -0
  81. package/dist/declaration-absorption.d.ts +37 -0
  82. package/dist/declaration-absorption.js +119 -0
  83. package/dist/declaration-absorption.js.map +1 -0
  84. package/dist/declaration-chain.d.ts +36 -0
  85. package/dist/declaration-chain.js +96 -0
  86. package/dist/declaration-chain.js.map +1 -0
  87. package/dist/declaration-commit.d.ts +31 -0
  88. package/dist/declaration-commit.js +49 -0
  89. package/dist/declaration-commit.js.map +1 -0
  90. package/dist/declaration-hold.d.ts +22 -0
  91. package/dist/declaration-hold.js +24 -0
  92. package/dist/declaration-hold.js.map +1 -0
  93. package/dist/declaration-journal.d.ts +62 -0
  94. package/dist/declaration-journal.js +99 -0
  95. package/dist/declaration-journal.js.map +1 -0
  96. package/dist/declaration-save.d.ts +31 -0
  97. package/dist/declaration-save.js +134 -0
  98. package/dist/declaration-save.js.map +1 -0
  99. package/dist/detection/accepted-result.d.ts +19 -1
  100. package/dist/detection/accepted-result.js +36 -5
  101. package/dist/detection/accepted-result.js.map +1 -1
  102. package/dist/detection/admission-save.d.ts +55 -0
  103. package/dist/detection/admission-save.js +48 -0
  104. package/dist/detection/admission-save.js.map +1 -0
  105. package/dist/detection/admission-units.d.ts +66 -0
  106. package/dist/detection/admission-units.js +322 -0
  107. package/dist/detection/admission-units.js.map +1 -0
  108. package/dist/detection/alias-discovery.d.ts +12 -0
  109. package/dist/detection/alias-discovery.js +80 -0
  110. package/dist/detection/alias-discovery.js.map +1 -0
  111. package/dist/detection/alias-examination.d.ts +30 -0
  112. package/dist/detection/alias-examination.js +49 -0
  113. package/dist/detection/alias-examination.js.map +1 -0
  114. package/dist/detection/apply-ownership.d.ts +81 -0
  115. package/dist/detection/apply-ownership.js +232 -0
  116. package/dist/detection/apply-ownership.js.map +1 -0
  117. package/dist/detection/basis-advanced.d.ts +11 -0
  118. package/dist/detection/basis-advanced.js +26 -0
  119. package/dist/detection/basis-advanced.js.map +1 -0
  120. package/dist/detection/capture-outcome.d.ts +16 -0
  121. package/dist/detection/capture-outcome.js +92 -0
  122. package/dist/detection/capture-outcome.js.map +1 -0
  123. package/dist/detection/container-membership.d.ts +32 -0
  124. package/dist/detection/container-membership.js +49 -0
  125. package/dist/detection/container-membership.js.map +1 -0
  126. package/dist/detection/detect-cancelled.d.ts +6 -0
  127. package/dist/detection/detect-cancelled.js +10 -0
  128. package/dist/detection/detect-cancelled.js.map +1 -0
  129. package/dist/detection/directory-proof.d.ts +47 -0
  130. package/dist/detection/directory-proof.js +77 -0
  131. package/dist/detection/directory-proof.js.map +1 -0
  132. package/dist/detection/disposition-rows.d.ts +18 -0
  133. package/dist/detection/disposition-rows.js +29 -0
  134. package/dist/detection/disposition-rows.js.map +1 -0
  135. package/dist/detection/dispositions.d.ts +130 -0
  136. package/dist/detection/dispositions.js +248 -0
  137. package/dist/detection/dispositions.js.map +1 -0
  138. package/dist/detection/git-notice.d.ts +88 -0
  139. package/dist/detection/git-notice.js +444 -0
  140. package/dist/detection/git-notice.js.map +1 -0
  141. package/dist/detection/ground-proof.d.ts +130 -0
  142. package/dist/detection/ground-proof.js +274 -0
  143. package/dist/detection/ground-proof.js.map +1 -0
  144. package/dist/detection/ground-reader.d.ts +29 -0
  145. package/dist/detection/ground-reader.js +102 -0
  146. package/dist/detection/ground-reader.js.map +1 -0
  147. package/dist/detection/held-territory.d.ts +51 -0
  148. package/dist/detection/held-territory.js +205 -0
  149. package/dist/detection/held-territory.js.map +1 -0
  150. package/dist/detection/identity-discovery.d.ts +45 -0
  151. package/dist/detection/identity-discovery.js +287 -0
  152. package/dist/detection/identity-discovery.js.map +1 -0
  153. package/dist/detection/maintenance-sweep.d.ts +108 -0
  154. package/dist/detection/maintenance-sweep.js +325 -0
  155. package/dist/detection/maintenance-sweep.js.map +1 -0
  156. package/dist/detection/name-reach.d.ts +12 -0
  157. package/dist/detection/name-reach.js +28 -0
  158. package/dist/detection/name-reach.js.map +1 -0
  159. package/dist/detection/notebook-basis.d.ts +5 -7
  160. package/dist/detection/notebook-basis.js +6 -7
  161. package/dist/detection/notebook-basis.js.map +1 -1
  162. package/dist/detection/owed-selection.d.ts +51 -0
  163. package/dist/detection/owed-selection.js +169 -0
  164. package/dist/detection/owed-selection.js.map +1 -0
  165. package/dist/detection/portable.d.ts +34 -34
  166. package/dist/detection/portable.js +67 -93
  167. package/dist/detection/portable.js.map +1 -1
  168. package/dist/detection/reconciliation-coverage.d.ts +7 -0
  169. package/dist/detection/reconciliation-coverage.js +16 -0
  170. package/dist/detection/reconciliation-coverage.js.map +1 -0
  171. package/dist/detection/repository-publication.d.ts +20 -0
  172. package/dist/detection/repository-publication.js +79 -0
  173. package/dist/detection/repository-publication.js.map +1 -0
  174. package/dist/detection/repository-routes.d.ts +43 -0
  175. package/dist/detection/repository-routes.js +97 -0
  176. package/dist/detection/repository-routes.js.map +1 -0
  177. package/dist/detection/root-examination.d.ts +94 -0
  178. package/dist/detection/root-examination.js +523 -0
  179. package/dist/detection/root-examination.js.map +1 -0
  180. package/dist/detection/runtime.d.ts +131 -64
  181. package/dist/detection/runtime.js +808 -1103
  182. package/dist/detection/runtime.js.map +1 -1
  183. package/dist/detection/scoped-identity-port.d.ts +34 -0
  184. package/dist/detection/scoped-identity-port.js +81 -0
  185. package/dist/detection/scoped-identity-port.js.map +1 -0
  186. package/dist/detection/seal-law.d.ts +66 -0
  187. package/dist/detection/seal-law.js +116 -0
  188. package/dist/detection/seal-law.js.map +1 -0
  189. package/dist/detection/sharing-policy.d.ts +11 -0
  190. package/dist/detection/sharing-policy.js +32 -0
  191. package/dist/detection/sharing-policy.js.map +1 -0
  192. package/dist/detection/thread-database.d.ts +4 -0
  193. package/dist/detection/thread-database.js +30 -0
  194. package/dist/detection/thread-database.js.map +1 -0
  195. package/dist/detection/unreadable.d.ts +11 -0
  196. package/dist/detection/unreadable.js +9 -0
  197. package/dist/detection/unreadable.js.map +1 -0
  198. package/dist/detection/verified-content.d.ts +6 -0
  199. package/dist/detection/verified-content.js +12 -0
  200. package/dist/detection/verified-content.js.map +1 -0
  201. package/dist/detection/walk-law.d.ts +34 -0
  202. package/dist/detection/walk-law.js +55 -0
  203. package/dist/detection/walk-law.js.map +1 -0
  204. package/dist/development/fly-guest.js +2 -1
  205. package/dist/development/fly-guest.js.map +1 -1
  206. package/dist/entity-apply-host.d.ts +29 -13
  207. package/dist/entity-apply-host.js +1426 -461
  208. package/dist/entity-apply-host.js.map +1 -1
  209. package/dist/entity-apply-store.d.ts +77 -30
  210. package/dist/entity-apply-store.js +221 -516
  211. package/dist/entity-apply-store.js.map +1 -1
  212. package/dist/entity-record-observability.js +2 -0
  213. package/dist/entity-record-observability.js.map +1 -1
  214. package/dist/entity-record-saves.d.ts +20 -0
  215. package/dist/entity-record-saves.js +91 -0
  216. package/dist/entity-record-saves.js.map +1 -0
  217. package/dist/entity-record-store.d.ts +15 -7
  218. package/dist/entity-record-store.js +57 -117
  219. package/dist/entity-record-store.js.map +1 -1
  220. package/dist/files-register-host.d.ts +22 -3
  221. package/dist/files-register-host.js +70 -31
  222. package/dist/files-register-host.js.map +1 -1
  223. package/dist/filesystem.js +3 -2
  224. package/dist/filesystem.js.map +1 -1
  225. package/dist/git-binding.d.ts +65 -0
  226. package/dist/git-binding.js +220 -0
  227. package/dist/git-binding.js.map +1 -0
  228. package/dist/git-capture.d.ts +39 -0
  229. package/dist/git-capture.js +86 -0
  230. package/dist/git-capture.js.map +1 -0
  231. package/dist/git-card.d.ts +12 -0
  232. package/dist/git-card.js +123 -0
  233. package/dist/git-card.js.map +1 -0
  234. package/dist/git-checkpoint-construction.d.ts +41 -0
  235. package/dist/git-checkpoint-construction.js +96 -0
  236. package/dist/git-checkpoint-construction.js.map +1 -0
  237. package/dist/git-checkpoint-preparation.d.ts +37 -0
  238. package/dist/git-checkpoint-preparation.js +145 -0
  239. package/dist/git-checkpoint-preparation.js.map +1 -0
  240. package/dist/git-command.d.ts +61 -8
  241. package/dist/git-command.js +217 -63
  242. package/dist/git-command.js.map +1 -1
  243. package/dist/git-configuration.d.ts +40 -0
  244. package/dist/git-configuration.js +217 -0
  245. package/dist/git-configuration.js.map +1 -0
  246. package/dist/git-evidence.d.ts +61 -0
  247. package/dist/git-evidence.js +181 -0
  248. package/dist/git-evidence.js.map +1 -0
  249. package/dist/git-index-entries.d.ts +15 -0
  250. package/dist/git-index-entries.js +44 -0
  251. package/dist/git-index-entries.js.map +1 -0
  252. package/dist/git-index-format.d.ts +35 -0
  253. package/dist/git-index-format.js +293 -0
  254. package/dist/git-index-format.js.map +1 -0
  255. package/dist/git-index-witness.d.ts +33 -0
  256. package/dist/git-index-witness.js +69 -0
  257. package/dist/git-index-witness.js.map +1 -0
  258. package/dist/git-literal-host.d.ts +82 -0
  259. package/dist/git-literal-host.js +172 -0
  260. package/dist/git-literal-host.js.map +1 -0
  261. package/dist/git-literal-read.d.ts +88 -0
  262. package/dist/git-literal-read.js +170 -0
  263. package/dist/git-literal-read.js.map +1 -0
  264. package/dist/git-literal-replay.d.ts +33 -0
  265. package/dist/git-literal-replay.js +268 -0
  266. package/dist/git-literal-replay.js.map +1 -0
  267. package/dist/git-native-file.d.ts +42 -0
  268. package/dist/git-native-file.js +145 -0
  269. package/dist/git-native-file.js.map +1 -0
  270. package/dist/git-native-index.d.ts +21 -0
  271. package/dist/git-native-index.js +44 -0
  272. package/dist/git-native-index.js.map +1 -0
  273. package/dist/git-operation-host.d.ts +48 -0
  274. package/dist/git-operation-host.js +127 -0
  275. package/dist/git-operation-host.js.map +1 -0
  276. package/dist/git-private-index.d.ts +11 -0
  277. package/dist/git-private-index.js +42 -0
  278. package/dist/git-private-index.js.map +1 -0
  279. package/dist/git-private-repository.d.ts +4 -0
  280. package/dist/git-private-repository.js +69 -0
  281. package/dist/git-private-repository.js.map +1 -0
  282. package/dist/git-private-view.d.ts +39 -0
  283. package/dist/git-private-view.js +162 -0
  284. package/dist/git-private-view.js.map +1 -0
  285. package/dist/git-ref-store.d.ts +12 -0
  286. package/dist/git-ref-store.js +68 -0
  287. package/dist/git-ref-store.js.map +1 -0
  288. package/dist/git-registration-host.d.ts +20 -30
  289. package/dist/git-registration-host.js +86 -249
  290. package/dist/git-registration-host.js.map +1 -1
  291. package/dist/git-repository-host.d.ts +148 -22
  292. package/dist/git-repository-host.js +633 -650
  293. package/dist/git-repository-host.js.map +1 -1
  294. package/dist/git-worktree-host.d.ts +2 -0
  295. package/dist/git-worktree-host.js +16 -0
  296. package/dist/git-worktree-host.js.map +1 -0
  297. package/dist/graph-publication.d.ts +75 -0
  298. package/dist/graph-publication.js +203 -0
  299. package/dist/graph-publication.js.map +1 -0
  300. package/dist/ground-basis.d.ts +242 -0
  301. package/dist/ground-basis.js +1023 -0
  302. package/dist/ground-basis.js.map +1 -0
  303. package/dist/ground-checkpoint-worker.d.ts +1 -0
  304. package/dist/ground-checkpoint-worker.js +84 -0
  305. package/dist/ground-checkpoint-worker.js.map +1 -0
  306. package/dist/ground-checkpoints.d.ts +16 -0
  307. package/dist/ground-checkpoints.js +45 -0
  308. package/dist/ground-checkpoints.js.map +1 -0
  309. package/dist/ground-coordination.d.ts +107 -3
  310. package/dist/ground-coordination.js +249 -24
  311. package/dist/ground-coordination.js.map +1 -1
  312. package/dist/ground-database.d.ts +42 -0
  313. package/dist/ground-database.js +290 -0
  314. package/dist/ground-database.js.map +1 -0
  315. package/dist/ground-differences.d.ts +23 -0
  316. package/dist/ground-differences.js +47 -0
  317. package/dist/ground-differences.js.map +1 -0
  318. package/dist/ground-holders.d.ts +4 -0
  319. package/dist/ground-holders.js +15 -0
  320. package/dist/ground-holders.js.map +1 -0
  321. package/dist/ground-initialization-worker.d.ts +1 -0
  322. package/dist/ground-initialization-worker.js +20 -0
  323. package/dist/ground-initialization-worker.js.map +1 -0
  324. package/dist/ground-initialization.d.ts +35 -0
  325. package/dist/ground-initialization.js +102 -0
  326. package/dist/ground-initialization.js.map +1 -0
  327. package/dist/ground-install-saves.d.ts +63 -0
  328. package/dist/ground-install-saves.js +139 -0
  329. package/dist/ground-install-saves.js.map +1 -0
  330. package/dist/ground-inventory-schema.d.ts +18 -0
  331. package/dist/ground-inventory-schema.js +168 -0
  332. package/dist/ground-inventory-schema.js.map +1 -0
  333. package/dist/ground-profile.d.ts +7 -0
  334. package/dist/ground-profile.js +52 -0
  335. package/dist/ground-profile.js.map +1 -0
  336. package/dist/ground-root-index.d.ts +2 -1
  337. package/dist/ground-root-index.js +16 -14
  338. package/dist/ground-root-index.js.map +1 -1
  339. package/dist/ground-row.d.ts +62 -0
  340. package/dist/ground-row.js +70 -0
  341. package/dist/ground-row.js.map +1 -0
  342. package/dist/ground-save-ops.d.ts +44 -0
  343. package/dist/ground-save-ops.js +41 -0
  344. package/dist/ground-save-ops.js.map +1 -0
  345. package/dist/ground-saver-worker.d.ts +1 -0
  346. package/dist/ground-saver-worker.js +156 -0
  347. package/dist/ground-saver-worker.js.map +1 -0
  348. package/dist/ground-saver.d.ts +75 -0
  349. package/dist/ground-saver.js +216 -0
  350. package/dist/ground-saver.js.map +1 -0
  351. package/dist/ground-store.d.ts +84 -0
  352. package/dist/ground-store.js +473 -0
  353. package/dist/ground-store.js.map +1 -0
  354. package/dist/ground-territory.d.ts +130 -0
  355. package/dist/ground-territory.js +511 -0
  356. package/dist/ground-territory.js.map +1 -0
  357. package/dist/index.d.ts +1 -1
  358. package/dist/index.js.map +1 -1
  359. package/dist/installation/ownership.d.ts +0 -2
  360. package/dist/installation/ownership.js +3 -15
  361. package/dist/installation/ownership.js.map +1 -1
  362. package/dist/machine-host.d.ts +3 -2
  363. package/dist/machine-host.js +28 -16
  364. package/dist/machine-host.js.map +1 -1
  365. package/dist/materialized-graph.d.ts +7 -7
  366. package/dist/materialized-graph.js +11 -23
  367. package/dist/materialized-graph.js.map +1 -1
  368. package/dist/module-thread.d.ts +9 -0
  369. package/dist/module-thread.js +10 -0
  370. package/dist/module-thread.js.map +1 -0
  371. package/dist/native/fsevents-stream.node +0 -0
  372. package/dist/physical-path-witness.d.ts +64 -0
  373. package/dist/physical-path-witness.js +168 -0
  374. package/dist/physical-path-witness.js.map +1 -0
  375. package/dist/register-upload-fusion.d.ts +5 -4
  376. package/dist/register-upload-fusion.js +9 -6
  377. package/dist/register-upload-fusion.js.map +1 -1
  378. package/dist/registry-graph.d.ts +3 -2
  379. package/dist/registry-graph.js +9 -6
  380. package/dist/registry-graph.js.map +1 -1
  381. package/dist/registry-page-cache.d.ts +5 -2
  382. package/dist/registry-page-cache.js.map +1 -1
  383. package/dist/repository-identity-steps.d.ts +5 -0
  384. package/dist/repository-identity-steps.js +33 -0
  385. package/dist/repository-identity-steps.js.map +1 -0
  386. package/dist/runtime-node-flags.d.ts +10 -0
  387. package/dist/runtime-node-flags.js +11 -0
  388. package/dist/runtime-node-flags.js.map +1 -0
  389. package/dist/service/adapter.d.ts +1 -1
  390. package/dist/service/adapter.js +1 -1
  391. package/dist/service/adapter.js.map +1 -1
  392. package/dist/service/cli.js +16 -20
  393. package/dist/service/cli.js.map +1 -1
  394. package/dist/service/control.d.ts +2 -2
  395. package/dist/service/keepalive.d.ts +4 -11
  396. package/dist/service/keepalive.js +65 -118
  397. package/dist/service/keepalive.js.map +1 -1
  398. package/dist/service/policy.d.ts +36 -0
  399. package/dist/service/policy.js +25 -0
  400. package/dist/service/policy.js.map +1 -0
  401. package/dist/service/portable.d.ts +1 -1
  402. package/dist/service/portable.js +1 -1
  403. package/dist/service/portable.js.map +1 -1
  404. package/dist/service/recovery.d.ts +10 -9
  405. package/dist/service/recovery.js +29 -19
  406. package/dist/service/recovery.js.map +1 -1
  407. package/dist/service/windows-action.d.ts +5 -3
  408. package/dist/service/windows-action.js +6 -9
  409. package/dist/service/windows-action.js.map +1 -1
  410. package/dist/service/windows-task.js +5 -5
  411. package/dist/service/windows-task.js.map +1 -1
  412. package/dist/sharing-admission.d.ts +17 -0
  413. package/dist/sharing-admission.js +128 -0
  414. package/dist/sharing-admission.js.map +1 -0
  415. package/dist/snapshot-delivery-baseline.d.ts +12 -3
  416. package/dist/snapshot-delivery-baseline.js +41 -42
  417. package/dist/snapshot-delivery-baseline.js.map +1 -1
  418. package/dist/source-proof.d.ts +36 -0
  419. package/dist/source-proof.js +70 -0
  420. package/dist/source-proof.js.map +1 -0
  421. package/dist/source-signature.d.ts +56 -0
  422. package/dist/source-signature.js +56 -0
  423. package/dist/source-signature.js.map +1 -0
  424. package/dist/source-witness.d.ts +15 -0
  425. package/dist/source-witness.js +29 -0
  426. package/dist/source-witness.js.map +1 -0
  427. package/dist/sqlite-durability.d.ts +31 -0
  428. package/dist/sqlite-durability.js +28 -0
  429. package/dist/sqlite-durability.js.map +1 -0
  430. package/dist/sqlite.d.ts +8 -2
  431. package/dist/sqlite.js +27 -4
  432. package/dist/sqlite.js.map +1 -1
  433. package/dist/sync-address.d.ts +19 -0
  434. package/dist/sync-address.js +52 -0
  435. package/dist/sync-address.js.map +1 -0
  436. package/dist/sync-setting.d.ts +15 -0
  437. package/dist/sync-setting.js +13 -0
  438. package/dist/sync-setting.js.map +1 -1
  439. package/dist/turns.d.ts +42 -0
  440. package/dist/turns.js +112 -0
  441. package/dist/turns.js.map +1 -0
  442. package/dist/updates/bootstrap.d.ts +53 -7
  443. package/dist/updates/bootstrap.js +224 -137
  444. package/dist/updates/bootstrap.js.map +1 -1
  445. package/dist/updates/controller.d.ts +8 -0
  446. package/dist/updates/controller.js +27 -3
  447. package/dist/updates/controller.js.map +1 -1
  448. package/dist/updates/store.d.ts +3 -0
  449. package/dist/updates/store.js +12 -0
  450. package/dist/updates/store.js.map +1 -1
  451. package/dist/user-ground-host.d.ts +364 -69
  452. package/dist/user-ground-host.js +5231 -3366
  453. package/dist/user-ground-host.js.map +1 -1
  454. package/dist/watching/fsevents.d.ts +52 -1
  455. package/dist/watching/fsevents.js +60 -25
  456. package/dist/watching/fsevents.js.map +1 -1
  457. package/dist/watching/host.d.ts +129 -5
  458. package/dist/watching/host.js +433 -80
  459. package/dist/watching/host.js.map +1 -1
  460. package/dist/watching/index.d.ts +1 -1
  461. package/dist/wire-binary.d.ts +3 -2
  462. package/dist/wire-binary.js +10 -8
  463. package/dist/wire-binary.js.map +1 -1
  464. package/dist/wire-client.d.ts +3 -4
  465. package/dist/wire-client.js +18 -44
  466. package/dist/wire-client.js.map +1 -1
  467. package/dist/wire-outbox.d.ts +34 -0
  468. package/dist/wire-outbox.js +127 -0
  469. package/dist/wire-outbox.js.map +1 -0
  470. package/dist/workspace-host.d.ts +4 -0
  471. package/dist/workspace-host.js +12 -1
  472. package/dist/workspace-host.js.map +1 -1
  473. package/examinations/fixtures/private-wire-authority.js +133 -10
  474. package/npm-shrinkwrap.json +43 -56
  475. package/package.json +26 -13
@@ -0,0 +1,79 @@
1
+ /** One selected repository result, assembled from observed or retained bytes.
2
+ * Both Detect lanes use this host effect after Live has selected the graph. */
3
+ import { createHash } from "node:crypto";
4
+ import { join } from "node:path";
5
+ import { classifyFile, repositoryPayloadVersion, } from "@amalgm/live";
6
+ import { sealContent } from "../content-capture-pool.js";
7
+ import { captureObservedRepository, captureSelectedRepository, inspectRepositoryTransportFile, prepareRepositoryFiles, readCachedRepositoryIdentity, readPriorRepositoryTransport, sealCachedRepositoryIdentity, } from "../git-repository-host.js";
8
+ const sha = (bytes) => createHash("sha256").update(bytes).digest("hex");
9
+ const ordinary = (entry) => ["file.text", "file.binary", "link"].includes(entry.type);
10
+ export async function publishRepository(input) {
11
+ const { cacheDir, repository, before, observed, observedIdentity, identity, retained, lane } = input;
12
+ const prior = await readPriorRepositoryTransport(cacheDir, before);
13
+ const previousIdentity = prior ? await readCachedRepositoryIdentity(cacheDir, prior.transportVersion) : null;
14
+ let preparation;
15
+ try {
16
+ if (identity.some(entry => retained.has(entry.uuid) && ordinary(entry))) {
17
+ if (!prior)
18
+ throw new Error("selected retained members need their complete immutable repository head");
19
+ const chain = [], seen = new Set();
20
+ let version = prior.transportVersion;
21
+ while (version) {
22
+ if (seen.has(version))
23
+ throw new Error("retained repository chain has a cycle");
24
+ seen.add(version);
25
+ const file = join(cacheDir, `${version}.bin`);
26
+ chain.push({ file, transportVersion: version });
27
+ version = (await inspectRepositoryTransportFile(file)).parentTransportVersion;
28
+ }
29
+ preparation = await prepareRepositoryFiles(chain.reverse());
30
+ }
31
+ const members = identity.filter(ordinary);
32
+ const sameObserved = retained.size === 0 && members.length === observed.view.leaves.size
33
+ && members.every(entry => observed.view.leaves.has(entry.path));
34
+ const retainedByUuid = new Map(preparation?.identity.map(entry => [entry.uuid, entry]) ?? []);
35
+ // Retained members come from their immutable head in one Git batch. Their
36
+ // bytes must reproduce the Git object that head names.
37
+ const format = observed.view.format;
38
+ const retainedLeaves = new Map();
39
+ if (preparation) {
40
+ const paths = new Set(identity.filter(entry => retained.has(entry.uuid)).map(entry => entry.path));
41
+ await preparation.checkpoint.readLeaves((leaf, content) => {
42
+ if (!["100644", "100755", "120000"].includes(leaf.mode))
43
+ return;
44
+ const objectId = createHash(format).update(`blob ${content.length}\0`).update(content).digest("hex");
45
+ if (objectId !== leaf.objectId)
46
+ throw new Error(`retained repository member does not reproduce its object: ${leaf.path}`);
47
+ retainedLeaves.set(leaf.path, { mode: leaf.mode, objectId, content,
48
+ sha256: sha(content), type: leaf.mode === "120000" ? "link" : classifyFile({ binary: content.includes(0) }) });
49
+ }, paths);
50
+ }
51
+ for (const entry of members)
52
+ if (retained.has(entry.uuid)) {
53
+ if (retainedByUuid.get(entry.uuid)?.path !== entry.path) {
54
+ throw new Error("selected retained repository identity changed owner or address");
55
+ }
56
+ if (!retainedLeaves.has(entry.path))
57
+ throw new Error("retained repository member is unavailable");
58
+ }
59
+ const captured = sameObserved
60
+ ? await captureObservedRepository(observed, identity, observedIdentity, prior, previousIdentity)
61
+ : await captureSelectedRepository(observed, identity, retainedLeaves, lane, prior, previousIdentity);
62
+ if (captured.bytes)
63
+ await sealContent(cacheDir, {
64
+ entityId: repository.uuid, entityType: "repo.git", kind: "git", contentHash: captured.transportVersion,
65
+ }, captured.bytes, "repository");
66
+ const layout = await inspectRepositoryTransportFile(join(cacheDir, `${captured.transportVersion}.bin`));
67
+ await sealCachedRepositoryIdentity(cacheDir, captured.transportVersion, captured.identity, layout.identityHash);
68
+ return { row: { ...repository, payloadVersion: repositoryPayloadVersion(captured, sha),
69
+ transportVersion: captured.transportVersion }, proof: captured.proof,
70
+ replay: { kind: "repo.git", stateId: layout.stateId, cardId: layout.cardId,
71
+ checkpointId: layout.checkpointId, identityHash: layout.identityHash,
72
+ resultPayloadVersion: repositoryPayloadVersion(layout, sha),
73
+ parentTransportVersion: layout.parentTransportVersion, transportVersion: captured.transportVersion } };
74
+ }
75
+ finally {
76
+ await preparation?.close();
77
+ }
78
+ }
79
+ //# sourceMappingURL=repository-publication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-publication.js","sourceRoot":"","sources":["../../src/detection/repository-publication.ts"],"names":[],"mappings":"AAAA;+EAC+E;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,YAAY,EAAE,wBAAwB,GACvC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAoB,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EACL,yBAAyB,EAAE,yBAAyB,EAAE,8BAA8B,EACpF,sBAAsB,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,4BAA4B,GAEjH,MAAM,2BAA2B,CAAC;AAInC,MAAM,GAAG,GAAG,CAAC,KAA0B,EAAU,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrG,MAAM,QAAQ,GAAG,CAAC,KAAwB,EAAW,EAAE,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAElH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAUvC;IACC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACrG,MAAM,KAAK,GAAG,MAAM,4BAA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AAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,gBAAgB;aACvG,EAAE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,8BAA8B,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,gBAAgB,MAAM,CAAC,CAAC,CAAC;QACxG,MAAM,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAChH,OAAO,EAAE,GAAG,EAAE,EAAE,GAAG,UAAU,EAAE,cAAc,EAAE,wBAAwB,CAAC,QAAQ,EAAE,GAAG,CAAC;gBACpF,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK;YACpE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM;gBACxE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY;gBACpE,oBAAoB,EAAE,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC;gBAC3D,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,EAAE,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,EAAE,EAAE,CAAC;IAC7G,CAAC;YAAS,CAAC;QAAC,MAAM,WAAW,EAAE,KAAK,EAAE,CAAC;IAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type Database from "better-sqlite3";
2
+ import type { SourceProof } from "../source-proof.js";
3
+ import type { GitNoticeBindings } from "./git-notice.js";
4
+ /** Where a root's escalated names belong: each outermost enrolled repository
5
+ * they reach, with its names, or the wider proof they need and why. */
6
+ export type RepositoryRoutes = {
7
+ readonly kind: "repositories";
8
+ readonly rootUUID: string;
9
+ readonly repositories: readonly {
10
+ readonly uuid: string;
11
+ readonly directory: string;
12
+ /** The addresses this repository answers for, relative to the root:
13
+ * worktree names, `<address>/.git` for each repository whose Git
14
+ * storage rang, and the address of each nested repository whose own
15
+ * address rang. Null when its own address rang: every address within
16
+ * it is suspect. */
17
+ readonly paths: readonly string[] | null;
18
+ }[];
19
+ /** Worktree names outside every enrolled repository, relative to the
20
+ * root: each is examined by the root's folder scope. */
21
+ readonly folders: readonly string[];
22
+ /** Closes the Git bindings the routes consumed. */
23
+ readonly proof: SourceProof;
24
+ } | {
25
+ readonly kind: "wider";
26
+ readonly scope: "root" | "domain";
27
+ readonly reason: string;
28
+ };
29
+ /** Route names by the same Git bindings a named proof reads. A name in
30
+ * private Git storage belongs to its one consumer and names no address: an
31
+ * ordinary domain O certifies keeps its named Git state, any other owes its
32
+ * complete examination. A repository's own address belongs to that
33
+ * repository's complete examination while its binding stands over the
34
+ * directory O holds. Any other name owes ordinary ground examined whole,
35
+ * unless it reaches a consumer that ground does not hold, which needs a
36
+ * wider proof. Once every name is routed, an answer inside a checkout Git
37
+ * does not bind owes that checkout's whole address. Ordinary ground belongs
38
+ * to the innermost repository strictly enclosing it, or else to the root's
39
+ * folder scope, except the root's own address and its enrollment policy,
40
+ * which are its boundary and always need the whole root. A nested
41
+ * repository rides the outermost repository enclosing it with the same
42
+ * names, which reach it there (name-reach.ts). */
43
+ export declare function repositoryRoutes(database: Database.Database, bindings: GitNoticeBindings, directory: string, paths: readonly string[]): Promise<RepositoryRoutes>;
@@ -0,0 +1,97 @@
1
+ import { join, relative, sep } from "node:path";
2
+ import { groundStore } from "../ground-store.js";
3
+ import { turnBoundary } from "../turns.js";
4
+ const pathWithin = (parent, path) => path === parent || path.startsWith(`${parent}${sep}`);
5
+ /** Route names by the same Git bindings a named proof reads. A name in
6
+ * private Git storage belongs to its one consumer and names no address: an
7
+ * ordinary domain O certifies keeps its named Git state, any other owes its
8
+ * complete examination. A repository's own address belongs to that
9
+ * repository's complete examination while its binding stands over the
10
+ * directory O holds. Any other name owes ordinary ground examined whole,
11
+ * unless it reaches a consumer that ground does not hold, which needs a
12
+ * wider proof. Once every name is routed, an answer inside a checkout Git
13
+ * does not bind owes that checkout's whole address. Ordinary ground belongs
14
+ * to the innermost repository strictly enclosing it, or else to the root's
15
+ * folder scope, except the root's own address and its enrollment policy,
16
+ * which are its boundary and always need the whole root. A nested
17
+ * repository rides the outermost repository enclosing it with the same
18
+ * names, which reach it there (name-reach.ts). */
19
+ export async function repositoryRoutes(database, bindings, directory, paths) {
20
+ const { value } = groundStore(database).readSnapshot(reader => {
21
+ const members = reader.repositoryMembers();
22
+ return {
23
+ members,
24
+ roots: reader.rootsAtPath("entities", directory),
25
+ rows: new Map(members.map(member => [member.uuid, reader.physical(member.uuid)])),
26
+ };
27
+ });
28
+ if (value.roots.length !== 1)
29
+ return { kind: "wider", scope: "root", reason: "unindexed-root" };
30
+ // The snapshot is retained input: routing continues from it at boundaries.
31
+ await turnBoundary();
32
+ const rootUUID = value.roots[0].uuid;
33
+ const own = value.members.filter(member => member.rootUUID === rootUUID);
34
+ const view = await bindings.observe(value.members, uuid => value.rows.get(uuid));
35
+ const routed = new Map();
36
+ const folders = [];
37
+ const claim = (member, path, whole = false) => {
38
+ const entry = routed.get(member.uuid) ?? { uuid: member.uuid, directory: member.absolutePath, paths: [] };
39
+ if (whole)
40
+ entry.paths = null;
41
+ else if (path !== null)
42
+ entry.paths?.push(path);
43
+ routed.set(member.uuid, entry);
44
+ };
45
+ const answers = [];
46
+ for (const path of paths) {
47
+ await turnBoundary();
48
+ const absolute = join(directory, path);
49
+ const self = absolute === directory ? null : view.own(absolute);
50
+ const route = self === null ? view.route(absolute) : { kind: "single", uuid: self, whole: true };
51
+ if (route.kind === "reconcile") {
52
+ return { kind: "wider", scope: route.rootUUIDs.some(uuid => uuid !== rootUUID) ? "domain" : "root",
53
+ reason: `git-notice-consumer:${path}` };
54
+ }
55
+ if (route.kind === "worktree") {
56
+ answers.push({ path, address: route.address });
57
+ continue;
58
+ }
59
+ const member = own.find(candidate => candidate.uuid === route.uuid);
60
+ if (!member)
61
+ return { kind: "wider", scope: "domain", reason: `git-notice-consumer:${path}` };
62
+ answers.push({ path, address: member.absolutePath, repository: { member, whole: route.whole } });
63
+ }
64
+ const enclosing = (address) => own
65
+ .filter(member => member.absolutePath !== address && pathWithin(member.absolutePath, address));
66
+ for (const { path, address, repository } of answers) {
67
+ const ground = view.held(address);
68
+ if (repository && ground === address) {
69
+ const at = relative(directory, address).split(sep).join("/");
70
+ claim(repository.member, at ? `${at}/.git` : ".git", repository.whole);
71
+ continue;
72
+ }
73
+ if (!pathWithin(directory, ground))
74
+ return { kind: "wider", scope: "domain", reason: `git-notice-ground:${path}` };
75
+ const relativeGround = relative(directory, ground).split(sep).join("/");
76
+ const owner = enclosing(ground).reduce((inner, member) => !inner || member.absolutePath.length > inner.absolutePath.length ? member : inner, undefined);
77
+ if (owner)
78
+ claim(owner, relativeGround);
79
+ else if (relativeGround === "" || relativeGround === ".amalgmignore") {
80
+ return { kind: "wider", scope: "root", reason: `root-boundary:${relativeGround}` };
81
+ }
82
+ else
83
+ folders.push(relativeGround);
84
+ }
85
+ for (const repository of [...routed.values()]) {
86
+ const outer = enclosing(repository.directory).reduce((outermost, member) => !outermost || member.absolutePath.length < outermost.absolutePath.length ? member : outermost, undefined);
87
+ if (!outer)
88
+ continue;
89
+ routed.delete(repository.uuid);
90
+ if (repository.paths === null)
91
+ claim(outer, relative(directory, repository.directory).split(sep).join("/"));
92
+ for (const path of repository.paths ?? [])
93
+ claim(outer, path);
94
+ }
95
+ return { kind: "repositories", rootUUID, repositories: [...routed.values()], folders, proof: view.proof };
96
+ }
97
+ //# sourceMappingURL=repository-routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-routes.js","sourceRoot":"","sources":["../../src/detection/repository-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IA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readonly database: string;
5
+ readonly resourceId: string;
6
+ readonly rootPath: string;
7
+ /** Core ground's portable name and every materialized binding it must
8
+ * reference; null for a bound root. */
9
+ readonly core: {
10
+ readonly name: string;
11
+ readonly bindings: readonly string[];
12
+ } | null;
13
+ }
14
+ /** Admission: prove the root equal to O and O's selection standing in B,
15
+ * naming only what differs, or fall back. */
16
+ export interface RootExamination extends RootGround {
17
+ readonly purpose: "admission";
18
+ /** The root's content-clock stamp, taken before this examination's reads. */
19
+ readonly clock: ContentBoundary | null;
20
+ }
21
+ /** Maintenance: name what differs from O for the scoped lanes to serve. */
22
+ export interface RootMaintenance extends RootGround {
23
+ readonly purpose: "maintenance";
24
+ }
25
+ export interface RootExaminationTimings {
26
+ readonly sqlMs: number;
27
+ readonly walkMs: number;
28
+ readonly gitMs: number;
29
+ /** Git re-answering each repository's semantic prerequisites. */
30
+ readonly proofMs: number;
31
+ readonly closeMs: number;
32
+ }
33
+ /** One address this walk could not prove unchanged against O. `subtree`
34
+ * leaves everything beneath it, on disk and in O, unexamined. */
35
+ export interface GroundDifference {
36
+ readonly path: string;
37
+ /** Evidence only: every reason has one answer, a fresh observation. */
38
+ readonly reason: string;
39
+ /** O's identity at this address, or null where O held none. */
40
+ readonly uuid: string | null;
41
+ readonly parentUUID: string | null;
42
+ /** Disk's physical identity; O's for an absence. */
43
+ readonly physicalKey: string;
44
+ readonly subtree: boolean;
45
+ }
46
+ /** A repository whose Card and Checkpoint this walk did not answer. */
47
+ export interface RepositoryInvalidation {
48
+ readonly uuid: string;
49
+ readonly path: string;
50
+ readonly reason: string;
51
+ }
52
+ export type RootExaminationResult = {
53
+ readonly kind: "examined";
54
+ readonly rootUUID: string;
55
+ /** The root's committed O/B revision this examination compared against. */
56
+ readonly revision: string;
57
+ readonly sequence: string;
58
+ readonly entries: number;
59
+ readonly differences: readonly GroundDifference[];
60
+ readonly invalidated: readonly RepositoryInvalidation[];
61
+ readonly repositories: readonly string[];
62
+ readonly footprints: readonly string[];
63
+ readonly physical: BigInt64Array;
64
+ readonly timings: RootExaminationTimings;
65
+ } | {
66
+ readonly kind: "fallback";
67
+ readonly reason: string;
68
+ readonly timings: RootExaminationTimings;
69
+ };
70
+ /** One address maintenance saw differ from O. The root, "", stands for O
71
+ * this walk could not trust; only the complete lane serves it. */
72
+ export interface RootFinding {
73
+ readonly path: string;
74
+ readonly cause: MaintenanceCause;
75
+ /** What stood there: a leaf's signature, a directory's physical key,
76
+ * "absent", or a repository's seal answer. */
77
+ readonly observed: string;
78
+ }
79
+ export interface RootMaintenanceResult {
80
+ readonly kind: "maintained";
81
+ /** The root O names at this directory, or null when it names none. */
82
+ readonly rootUUID: string | null;
83
+ /** S0 and the root's revision the findings were compared against. */
84
+ readonly basis: string;
85
+ readonly entries: number;
86
+ readonly findings: readonly RootFinding[];
87
+ /** Ground this visit could not read. A gap is never a finding. */
88
+ readonly gaps: readonly MaintenanceGap[];
89
+ readonly timings: RootExaminationTimings;
90
+ }
91
+ export declare function examineRoot(job: RootExamination): Promise<RootExaminationResult>;
92
+ export declare function examineRoot(job: RootMaintenance): Promise<RootMaintenanceResult>;
93
+ export declare function examineRoot(job: RootExamination | RootMaintenance): Promise<RootExaminationResult | RootMaintenanceResult>;
94
+ export {};