@homeflare/alchemy 0.7.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/README.md +45 -45
  2. package/dist/caddy/config-lifecycle.d.ts +49 -3
  3. package/dist/caddy/config-lifecycle.d.ts.map +1 -1
  4. package/dist/caddy/config.d.ts +6 -2
  5. package/dist/caddy/config.d.ts.map +1 -1
  6. package/dist/caddy/fake-caddy.d.ts +11 -0
  7. package/dist/caddy/fake-caddy.d.ts.map +1 -1
  8. package/dist/caddy/index.d.ts +2 -1
  9. package/dist/caddy/index.d.ts.map +1 -1
  10. package/dist/caddy/index.js +270 -44
  11. package/dist/caddy/index.js.map +15 -11
  12. package/dist/caddy/with-file.d.ts +7 -3
  13. package/dist/caddy/with-file.d.ts.map +1 -1
  14. package/dist/launchd/fake-runner.d.ts +1 -0
  15. package/dist/launchd/fake-runner.d.ts.map +1 -1
  16. package/dist/launchd/fake-sudo.d.ts +51 -0
  17. package/dist/launchd/fake-sudo.d.ts.map +1 -0
  18. package/dist/launchd/host-effect.d.ts +1 -1
  19. package/dist/launchd/host-file-form.d.ts +5 -0
  20. package/dist/launchd/host-file-form.d.ts.map +1 -1
  21. package/dist/launchd/host-file-lifecycle.d.ts +14 -1
  22. package/dist/launchd/host-file-lifecycle.d.ts.map +1 -1
  23. package/dist/launchd/host-file.d.ts +2 -1
  24. package/dist/launchd/host-file.d.ts.map +1 -1
  25. package/dist/launchd/index.d.ts +2 -0
  26. package/dist/launchd/index.d.ts.map +1 -1
  27. package/dist/launchd/index.js +642 -49
  28. package/dist/launchd/index.js.map +24 -14
  29. package/dist/launchd/job-lifecycle.d.ts +8 -1
  30. package/dist/launchd/job-lifecycle.d.ts.map +1 -1
  31. package/dist/launchd/job-preflight.d.ts +13 -1
  32. package/dist/launchd/job-preflight.d.ts.map +1 -1
  33. package/dist/launchd/job-validate.d.ts +2 -0
  34. package/dist/launchd/job-validate.d.ts.map +1 -1
  35. package/dist/launchd/job.d.ts +2 -1
  36. package/dist/launchd/job.d.ts.map +1 -1
  37. package/dist/launchd/local-runner.d.ts +2 -0
  38. package/dist/launchd/local-runner.d.ts.map +1 -1
  39. package/dist/launchd/providers.d.ts +2 -1
  40. package/dist/launchd/providers.d.ts.map +1 -1
  41. package/dist/launchd/runner.d.ts +14 -5
  42. package/dist/launchd/runner.d.ts.map +1 -1
  43. package/dist/launchd/sudo-acl.d.ts +25 -0
  44. package/dist/launchd/sudo-acl.d.ts.map +1 -0
  45. package/dist/launchd/sudo-allowlist.d.ts +47 -0
  46. package/dist/launchd/sudo-allowlist.d.ts.map +1 -0
  47. package/dist/launchd/sudo-guard.d.ts +83 -0
  48. package/dist/launchd/sudo-guard.d.ts.map +1 -0
  49. package/dist/launchd/sudo-runner.d.ts +60 -0
  50. package/dist/launchd/sudo-runner.d.ts.map +1 -0
  51. package/dist/launchd/sudo-said.d.ts +10 -0
  52. package/dist/launchd/sudo-said.d.ts.map +1 -0
  53. package/dist/launchd/sudo-stage.d.ts +7 -0
  54. package/dist/launchd/sudo-stage.d.ts.map +1 -0
  55. package/dist/openbao/auth-method-reconcile.d.ts +6 -2
  56. package/dist/openbao/auth-method-reconcile.d.ts.map +1 -1
  57. package/dist/openbao/auth-method.d.ts.map +1 -1
  58. package/dist/openbao/auth-role-form.d.ts +0 -9
  59. package/dist/openbao/auth-role-form.d.ts.map +1 -1
  60. package/dist/openbao/auth-role.d.ts +3 -2
  61. package/dist/openbao/auth-role.d.ts.map +1 -1
  62. package/dist/openbao/cloudflare-role.d.ts.map +1 -1
  63. package/dist/openbao/fake-bao.d.ts +18 -0
  64. package/dist/openbao/fake-bao.d.ts.map +1 -1
  65. package/dist/openbao/fake-core.d.ts +39 -0
  66. package/dist/openbao/fake-core.d.ts.map +1 -0
  67. package/dist/openbao/fake-engines-roles.d.ts +32 -0
  68. package/dist/openbao/fake-engines-roles.d.ts.map +1 -0
  69. package/dist/openbao/fake-engines.d.ts +8 -2
  70. package/dist/openbao/fake-engines.d.ts.map +1 -1
  71. package/dist/openbao/fake-families.d.ts +52 -0
  72. package/dist/openbao/fake-families.d.ts.map +1 -0
  73. package/dist/openbao/fake-mounts.d.ts +16 -0
  74. package/dist/openbao/fake-mounts.d.ts.map +1 -0
  75. package/dist/openbao/fake-stack.d.ts +5 -1
  76. package/dist/openbao/fake-stack.d.ts.map +1 -1
  77. package/dist/openbao/host-approles.d.ts.map +1 -1
  78. package/dist/openbao/index.js +709 -359
  79. package/dist/openbao/index.js.map +32 -25
  80. package/dist/openbao/jwt-config.d.ts +5 -0
  81. package/dist/openbao/jwt-config.d.ts.map +1 -1
  82. package/dist/openbao/jwt-role.d.ts +2 -1
  83. package/dist/openbao/jwt-role.d.ts.map +1 -1
  84. package/dist/openbao/kubernetes-role.d.ts +2 -1
  85. package/dist/openbao/kubernetes-role.d.ts.map +1 -1
  86. package/dist/openbao/mfa-enforcement.d.ts +12 -5
  87. package/dist/openbao/mfa-enforcement.d.ts.map +1 -1
  88. package/dist/openbao/mfa-totp.d.ts +6 -2
  89. package/dist/openbao/mfa-totp.d.ts.map +1 -1
  90. package/dist/openbao/mount-reconcile.d.ts +5 -1
  91. package/dist/openbao/mount-reconcile.d.ts.map +1 -1
  92. package/dist/openbao/mount.d.ts.map +1 -1
  93. package/dist/openbao/pki-role.d.ts.map +1 -1
  94. package/dist/openbao/plugin-reconcile.d.ts +6 -2
  95. package/dist/openbao/plugin-reconcile.d.ts.map +1 -1
  96. package/dist/openbao/plugin.d.ts.map +1 -1
  97. package/dist/openbao/policy.d.ts.map +1 -1
  98. package/dist/openbao/proxmox-role.d.ts.map +1 -1
  99. package/dist/openbao/rename-identity.d.ts +69 -0
  100. package/dist/openbao/rename-identity.d.ts.map +1 -0
  101. package/dist/openbao/rename.d.ts +13 -12
  102. package/dist/openbao/rename.d.ts.map +1 -1
  103. package/dist/openbao/role-reconcile.d.ts +11 -1
  104. package/dist/openbao/role-reconcile.d.ts.map +1 -1
  105. package/dist/openbao/ssh-role-erase.d.ts +11 -0
  106. package/dist/openbao/ssh-role-erase.d.ts.map +1 -0
  107. package/dist/openbao/ssh-role.d.ts.map +1 -1
  108. package/dist/ownership/adopt.d.ts +52 -0
  109. package/dist/ownership/adopt.d.ts.map +1 -0
  110. package/dist/ownership/probe.d.ts +13 -0
  111. package/dist/ownership/probe.d.ts.map +1 -0
  112. package/dist/ownership/resume.d.ts +40 -0
  113. package/dist/ownership/resume.d.ts.map +1 -0
  114. package/dist/ownership/rows.d.ts +33 -0
  115. package/dist/ownership/rows.d.ts.map +1 -0
  116. package/dist/ownership/whole.d.ts +14 -0
  117. package/dist/ownership/whole.d.ts.map +1 -0
  118. package/dist/proxmox/ceph-pool-form.d.ts +3 -3
  119. package/dist/proxmox/ceph-pool.d.ts.map +1 -1
  120. package/dist/proxmox/fake-bao-env.d.ts +3 -0
  121. package/dist/proxmox/fake-bao-env.d.ts.map +1 -0
  122. package/dist/proxmox/fake-pve-lxc.d.ts +42 -0
  123. package/dist/proxmox/fake-pve-lxc.d.ts.map +1 -0
  124. package/dist/proxmox/fake-pve.d.ts +38 -0
  125. package/dist/proxmox/fake-pve.d.ts.map +1 -0
  126. package/dist/proxmox/index.d.ts +6 -2
  127. package/dist/proxmox/index.d.ts.map +1 -1
  128. package/dist/proxmox/index.js +970 -186
  129. package/dist/proxmox/index.js.map +22 -9
  130. package/dist/proxmox/lxc-create-form.d.ts +6 -0
  131. package/dist/proxmox/lxc-create-form.d.ts.map +1 -0
  132. package/dist/proxmox/lxc-harness.d.ts +34 -0
  133. package/dist/proxmox/lxc-harness.d.ts.map +1 -0
  134. package/dist/proxmox/lxc-identity.d.ts +18 -0
  135. package/dist/proxmox/lxc-identity.d.ts.map +1 -0
  136. package/dist/proxmox/lxc-judge.d.ts +46 -0
  137. package/dist/proxmox/lxc-judge.d.ts.map +1 -0
  138. package/dist/proxmox/lxc-lifecycle.d.ts +68 -0
  139. package/dist/proxmox/lxc-lifecycle.d.ts.map +1 -0
  140. package/dist/proxmox/lxc-props.d.ts +139 -0
  141. package/dist/proxmox/lxc-props.d.ts.map +1 -0
  142. package/dist/proxmox/lxc-volume.d.ts +29 -0
  143. package/dist/proxmox/lxc-volume.d.ts.map +1 -0
  144. package/dist/proxmox/lxc-wire.d.ts +51 -0
  145. package/dist/proxmox/lxc-wire.d.ts.map +1 -0
  146. package/dist/proxmox/lxc.d.ts +27 -47
  147. package/dist/proxmox/lxc.d.ts.map +1 -1
  148. package/dist/proxmox/network-apply-read.d.ts +1 -1
  149. package/dist/proxmox/network-apply-read.d.ts.map +1 -1
  150. package/dist/proxmox/pbs-datastore.d.ts.map +1 -1
  151. package/dist/proxmox/resource.d.ts.map +1 -1
  152. package/dist/proxmox/update-guard.d.ts +27 -0
  153. package/dist/proxmox/update-guard.d.ts.map +1 -0
  154. package/dist/verify/args.d.ts +16 -0
  155. package/dist/verify/args.d.ts.map +1 -0
  156. package/dist/verify/cli.d.ts +3 -0
  157. package/dist/verify/cli.d.ts.map +1 -0
  158. package/dist/verify/cli.js +320 -0
  159. package/dist/verify/cli.js.map +15 -0
  160. package/dist/verify/fake-engine.d.ts +57 -0
  161. package/dist/verify/fake-engine.d.ts.map +1 -0
  162. package/dist/verify/index.d.ts +16 -0
  163. package/dist/verify/index.d.ts.map +1 -0
  164. package/dist/verify/index.js +297 -0
  165. package/dist/verify/index.js.map +14 -0
  166. package/dist/verify/report.d.ts +6 -0
  167. package/dist/verify/report.d.ts.map +1 -0
  168. package/dist/verify/rows.d.ts +57 -0
  169. package/dist/verify/rows.d.ts.map +1 -0
  170. package/dist/verify/spy.d.ts +31 -0
  171. package/dist/verify/spy.d.ts.map +1 -0
  172. package/dist/verify/verify.d.ts +43 -0
  173. package/dist/verify/verify.d.ts.map +1 -0
  174. package/docs/adopt-verify.md +108 -0
  175. package/docs/adopted-deploys.md +85 -0
  176. package/docs/caddy-admin.md +24 -0
  177. package/docs/caddy.md +73 -54
  178. package/docs/credentials.md +15 -0
  179. package/docs/launchd-sudo.md +147 -0
  180. package/docs/launchd.md +14 -7
  181. package/docs/ownership.md +113 -0
  182. package/docs/peers.md +39 -0
  183. package/docs/proxmox-lxc.md +196 -0
  184. package/docs/proxmox.md +12 -0
  185. package/package.json +9 -2
  186. package/src/caddy/adopt-scope.test.ts +82 -0
  187. package/src/caddy/config-adopt.test.ts +235 -0
  188. package/src/caddy/config-lifecycle.test.ts +31 -53
  189. package/src/caddy/config-lifecycle.ts +98 -7
  190. package/src/caddy/config.ts +48 -10
  191. package/src/caddy/fake-caddy.ts +19 -0
  192. package/src/caddy/index.ts +2 -1
  193. package/src/caddy/providers.test.ts +8 -23
  194. package/src/caddy/with-file.ts +7 -3
  195. package/src/launchd/adopt-apply.test.ts +166 -0
  196. package/src/launchd/fake-runner.ts +26 -4
  197. package/src/launchd/fake-sudo.ts +136 -0
  198. package/src/launchd/host-effect.ts +1 -1
  199. package/src/launchd/host-file-form.ts +10 -2
  200. package/src/launchd/host-file-lifecycle.ts +41 -15
  201. package/src/launchd/host-file.ts +13 -4
  202. package/src/launchd/index.ts +2 -0
  203. package/src/launchd/job-lifecycle.ts +22 -14
  204. package/src/launchd/job-preflight.ts +21 -3
  205. package/src/launchd/job-validate.ts +1 -1
  206. package/src/launchd/job.ts +13 -4
  207. package/src/launchd/local-runner.ts +6 -3
  208. package/src/launchd/providers.test.ts +3 -0
  209. package/src/launchd/providers.ts +2 -1
  210. package/src/launchd/runner.ts +14 -5
  211. package/src/launchd/sudo-acl.ts +68 -0
  212. package/src/launchd/sudo-allowlist.test.ts +191 -0
  213. package/src/launchd/sudo-allowlist.ts +213 -0
  214. package/src/launchd/sudo-chain.test.ts +121 -0
  215. package/src/launchd/sudo-guard.test.ts +100 -0
  216. package/src/launchd/sudo-guard.ts +230 -0
  217. package/src/launchd/sudo-lifecycle.test.ts +172 -0
  218. package/src/launchd/sudo-modes.test.ts +135 -0
  219. package/src/launchd/sudo-runner-files.test.ts +240 -0
  220. package/src/launchd/sudo-runner.test.ts +126 -0
  221. package/src/launchd/sudo-runner.ts +216 -0
  222. package/src/launchd/sudo-said.ts +58 -0
  223. package/src/launchd/sudo-stage.ts +28 -0
  224. package/src/openbao/README.md +11 -2
  225. package/src/openbao/REPLACE.md +67 -37
  226. package/src/openbao/adopt-core.test.ts +119 -0
  227. package/src/openbao/adopt-families.test.ts +97 -0
  228. package/src/openbao/adopt-holes.test.ts +168 -0
  229. package/src/openbao/adopt-recovery.test.ts +71 -0
  230. package/src/openbao/auth-method-reconcile.ts +15 -3
  231. package/src/openbao/auth-method.ts +15 -6
  232. package/src/openbao/auth-role-form.test.ts +2 -16
  233. package/src/openbao/auth-role-form.ts +0 -11
  234. package/src/openbao/auth-role.ts +48 -17
  235. package/src/openbao/cloudflare-role.ts +23 -18
  236. package/src/openbao/fake-bao.ts +52 -0
  237. package/src/openbao/fake-core.ts +141 -0
  238. package/src/openbao/fake-engines-roles.ts +114 -0
  239. package/src/openbao/fake-engines.ts +18 -11
  240. package/src/openbao/fake-families.ts +188 -0
  241. package/src/openbao/fake-mounts.ts +74 -0
  242. package/src/openbao/fake-stack.ts +17 -4
  243. package/src/openbao/host-approles.test.ts +15 -2
  244. package/src/openbao/host-approles.ts +19 -4
  245. package/src/openbao/jwt-config.ts +35 -11
  246. package/src/openbao/jwt-role.ts +33 -14
  247. package/src/openbao/kubernetes-role.ts +32 -14
  248. package/src/openbao/mfa-enforcement.ts +42 -13
  249. package/src/openbao/mfa-totp.ts +42 -14
  250. package/src/openbao/mount-move.test.ts +2 -35
  251. package/src/openbao/mount-reconcile.ts +13 -2
  252. package/src/openbao/mount.ts +15 -6
  253. package/src/openbao/pki-role.ts +33 -10
  254. package/src/openbao/plugin-reconcile.ts +16 -5
  255. package/src/openbao/plugin.ts +57 -20
  256. package/src/openbao/policy.ts +24 -11
  257. package/src/openbao/proxmox-role.ts +20 -20
  258. package/src/openbao/rename-adoption.test.ts +95 -0
  259. package/src/openbao/rename-families.test.ts +122 -0
  260. package/src/openbao/rename-identity.test.ts +129 -0
  261. package/src/openbao/rename-identity.ts +117 -0
  262. package/src/openbao/rename.ts +19 -15
  263. package/src/openbao/role-reconcile.ts +23 -0
  264. package/src/openbao/ssh-role-erase.ts +50 -0
  265. package/src/openbao/ssh-role.ts +29 -57
  266. package/src/ownership/adopt.ts +122 -0
  267. package/src/ownership/ownership.test.ts +200 -0
  268. package/src/ownership/probe.ts +65 -0
  269. package/src/ownership/resume.ts +118 -0
  270. package/src/ownership/rows.ts +117 -0
  271. package/src/ownership/whole.test.ts +39 -0
  272. package/src/ownership/whole.ts +60 -0
  273. package/src/proxmox/adopt-noop.test.ts +112 -0
  274. package/src/proxmox/ceph-pool-adopt.test.ts +88 -0
  275. package/src/proxmox/ceph-pool-form.ts +3 -3
  276. package/src/proxmox/ceph-pool.ts +10 -3
  277. package/src/proxmox/fake-bao-env.ts +28 -0
  278. package/src/proxmox/fake-pve-lxc.ts +210 -0
  279. package/src/proxmox/fake-pve.ts +75 -0
  280. package/src/proxmox/index.test.ts +6 -6
  281. package/src/proxmox/index.ts +6 -2
  282. package/src/proxmox/lxc-adopt.test.ts +170 -0
  283. package/src/proxmox/lxc-create-form.ts +76 -0
  284. package/src/proxmox/lxc-create.test.ts +126 -0
  285. package/src/proxmox/lxc-guards.test.ts +158 -0
  286. package/src/proxmox/lxc-harness.ts +150 -0
  287. package/src/proxmox/lxc-identity.ts +43 -0
  288. package/src/proxmox/lxc-judge.test.ts +175 -0
  289. package/src/proxmox/lxc-judge.ts +196 -0
  290. package/src/proxmox/lxc-lifecycle.ts +200 -0
  291. package/src/proxmox/lxc-ownership.test.ts +159 -0
  292. package/src/proxmox/lxc-props.ts +215 -0
  293. package/src/proxmox/lxc-read.test.ts +60 -0
  294. package/src/proxmox/lxc-volume.test.ts +96 -0
  295. package/src/proxmox/lxc-volume.ts +153 -0
  296. package/src/proxmox/lxc-wire.ts +210 -0
  297. package/src/proxmox/lxc.ts +216 -93
  298. package/src/proxmox/network-apply-read.ts +3 -1
  299. package/src/proxmox/pbs-datastore.ts +4 -3
  300. package/src/proxmox/resource.ts +7 -7
  301. package/src/proxmox/update-guard.ts +31 -0
  302. package/src/verify/args.ts +82 -0
  303. package/src/verify/cli.test.ts +86 -0
  304. package/src/verify/cli.ts +49 -0
  305. package/src/verify/fake-engine.ts +158 -0
  306. package/src/verify/index.ts +36 -0
  307. package/src/verify/report.ts +52 -0
  308. package/src/verify/rows.ts +169 -0
  309. package/src/verify/spy.test.ts +141 -0
  310. package/src/verify/spy.ts +149 -0
  311. package/src/verify/verify.test.ts +124 -0
  312. package/src/verify/verify.ts +172 -0
@@ -28,7 +28,14 @@ export declare const readJob: (runner: HostRunner, props: Identity) => Promise<L
28
28
  */
29
29
  export declare const replaceDiff: (runner: HostRunner, next: Identity, full: LaunchdJobProps | undefined, output: LaunchdJobAttributes) => Promise<Diff>;
30
30
  export declare const diffJob: (runner: HostRunner, news: LaunchdJobProps, output: LaunchdJobAttributes) => Promise<Diff>;
31
- export declare const reconcileJob: (runner: HostRunner, props: LaunchdJobProps, output: LaunchdJobAttributes | undefined) => Promise<LaunchdJobAttributes>;
31
+ /**
32
+ * `adopt` is whether adoption is on AND this apply is a create or an unfinished generation of our
33
+ * own (ownership/adopt.ts adoptsAtApply): it lets such a generation take over a job already on the
34
+ * host, as the plan's probe would have. A rename onto an occupied label stays refused, as it is at
35
+ * plan time (assertReplaceable) — including a label taken between that plan and a fresh replace's
36
+ * new generation, which the caller never marks adoptable.
37
+ */
38
+ export declare const reconcileJob: (runner: HostRunner, props: LaunchdJobProps, output: LaunchdJobAttributes | undefined, adopt?: boolean) => Promise<LaunchdJobAttributes>;
32
39
  /** Boot out, then remove the plist. Idempotent: an absent job and an absent file are success. */
33
40
  export declare const deleteJob: (runner: HostRunner, output: LaunchdJobAttributes) => Promise<void>;
34
41
  //# sourceMappingURL=job-lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"job-lifecycle.d.ts","sourceRoot":"","sources":["../../src/launchd/job-lifecycle.ts"],"names":[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,WACV,UAAU,SACX,QAAQ,KACd,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAM1C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,WACd,UAAU,QACZ,QAAQ,QACR,eAAe,GAAG,SAAS,UACzB,oBAAoB,KAC3B,OAAO,CAAC,IAAI,CAMd,CAAC;AAEF,eAAO,MAAM,OAAO,WACV,UAAU,QACZ,eAAe,UACb,oBAAoB,KAC3B,OAAO,CAAC,IAAI,CAiBd,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,WACf,UAAU,SACX,eAAe,UACd,oBAAoB,GAAG,SAAS,sBAEvC,OAAO,CAAC,oBAAoB,CAgE9B,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,SAAS,WACZ,UAAU,UACV,oBAAoB,KAC3B,OAAO,CAAC,IAAI,CAQd,CAAC"}
@@ -12,13 +12,25 @@
12
12
  */
13
13
  import { type LaunchdJobAttributes, type LaunchdJobProps, type ParsedDomain } from './job-form.ts';
14
14
  import { type ServiceStatus } from './launchctl.ts';
15
- import { type HostRunner } from './runner.ts';
15
+ import { type HostRunner, type WriteOptions } from './runner.ts';
16
16
  export type Location = {
17
17
  readonly domain: ParsedDomain;
18
18
  readonly plistPath: string;
19
19
  readonly target: string;
20
20
  };
21
21
  export type Identity = Pick<LaunchdJobProps, 'label' | 'domain'>;
22
+ /**
23
+ * ⚠️ launchd refuses a daemon plist that is not root:wheel or is group/world-writable ("bad
24
+ * ownership/permissions"), so the system domain always writes 0644 root:wheel. An agent's plist
25
+ * belongs to its user. REASONED from launchd's documented behaviour, not measured here (no
26
+ * bootstrap was run to write this); the nix-darwin daemons on the reference host are 0644 root.
27
+ */
28
+ export declare const plistWriteOptions: (domain: ParsedDomain) => WriteOptions;
29
+ /**
30
+ * PLAN TIME, for a plan that will write the plist: the runner's own pre-write refusals
31
+ * (HostRunner.checkWrite — sudoRunner's directory and mode checks), reading only.
32
+ */
33
+ export declare const checkPlistWrite: (runner: HostRunner, location: Location) => Promise<void>;
22
34
  export declare const refuse: (label: string, message: string) => Error;
23
35
  /** Throw every refusal at once, so one plan shows the whole list. */
24
36
  export declare const assertValid: (props: LaunchdJobProps) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"job-preflight.d.ts","sourceRoot":"","sources":["../../src/launchd/job-preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,YAAY,EAKlB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,aAAa,EAA4B,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,aAAa,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;AAEjE,eAAO,MAAM,MAAM,UAAW,MAAM,WAAW,MAAM,KAAG,KACT,CAAC;AAEhD,qEAAqE;AACrE,eAAO,MAAM,WAAW,UAAW,eAAe,KAAG,IAGpD,CAAC;AAEF,eAAO,MAAM,MAAM,WAAkB,UAAU,SAAS,QAAQ,KAAG,OAAO,CAAC,QAAQ,CAUlF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,WAAY,UAAU,SAAS,MAAM,UAAU,YAAY,KAAG,IAgBxF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,SAAS,WACZ,UAAU,SACX,QAAQ,KACd,OAAO,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAwBvD,CAAC;AAEF;;;;;;GAMG;AACH,e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AAS,QAAQ,KAAG,OAAO,CAAC,QAAQ,CAUlF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,WAAY,UAAU,SAAS,MAAM,UAAU,YAAY,KAAG,IAiBxF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,SAAS,WACZ,UAAU,SACX,QAAQ,KACd,OAAO,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAwBvD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,WAClB,UAAU,SACX,MAAM,YACH,QAAQ,UACV,aAAa,kBACL,MAAM,GAAG,SAAS,KACjC,OAAO,CAAC,IAAI,CAWd,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,WACpB,UAAU,QACZ,QAAQ,QACR,eAAe,GAAG,SAAS,OAC5B,oBAAoB,kBACT,MAAM,GAAG,SAAS,KACjC,OAAO,CAAC,IAAI,CASd,CAAC"}
@@ -7,6 +7,8 @@
7
7
  * declaration says; a plan that fails is cheaper than a job that quietly does nothing.
8
8
  */
9
9
  import { type LaunchdJobProps } from './job-form.ts';
10
+ /** ★ Labels become file names: no `/`, no leading dot, nothing a path could re-interpret. */
11
+ export declare const LABEL: RegExp;
10
12
  /**
11
13
  * ⛔ LABELS OTHER TOOLS OWN ARE NEVER DECLARED HERE. nix-darwin (`org.nixos.*`) rewrites its plists
12
14
  * on every activation and unloads any it no longer lists; macOS owns `com.apple.*`; `brew
@@ -1 +1 @@
1
- {"version":3,"file":"job-validate.d.ts","sourceRoot":"","sources":["../../src/launchd/job-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,eAAe,CAAC;AAMvB;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAIpD,CAAC;AAkCF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,cAAc,MAAM,KAAG,MAAM,EAY1E,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,eAAe,KAAG,MAAM,EAkD1D,CAAC"}
1
+ {"version":3,"file":"job-validate.d.ts","sourceRoot":"","sources":["../../src/launchd/job-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,eAAe,CAAC;AAGvB,6FAA6F;AAC7F,eAAO,MAAM,KAAK,QAAuC,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAIpD,CAAC;AAkCF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,cAAc,MAAM,KAAG,MAAM,EAY1E,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,eAAe,KAAG,MAAM,EAkD1D,CAAC"}
@@ -18,7 +18,8 @@
18
18
  * ⛔ ENVIRONMENT IS NON-SECRET ONLY — see the ⛔ on LaunchdJobProps.environment.
19
19
  * ⛔ NO SILENT SUDO — see assertMayWrite in job-preflight.ts.
20
20
  * ⚠️ NOTHING IS ADOPTED WITHOUT `--adopt`. A label already loaded, or a plist already on disk, reads
21
- * as `Unowned`, so Alchemy refuses to take it over unless asked. Labels under `org.nixos.`,
21
+ * as `Unowned`, so Alchemy refuses to take it over unless asked — and reconcile, where the plan
22
+ * never asked, honours the same `--adopt` / `adopt(…)` (docs/ownership.md). Labels under `org.nixos.`,
22
23
  * `com.apple.` and `homebrew.mxcl.` are refused outright (job-validate.ts) — declare a new label
23
24
  * and cut over instead (docs/launchd.md).
24
25
  */
@@ -1 +1 @@
1
- {"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../src/launchd/job.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,YAAY,EACV,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,UAAW,SAAQ,QAAQ,CAC1C,aAAa,EACb,eAAe,EACf,oBAAoB,CACrB;CAAG;AAEJ,eAAO,MAAM,UAAU,6CAAsC,CAAC;AAE9D,eAAO,MAAM,kBAAkB,6FA6C5B,CAAC"}
1
+ {"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../src/launchd/job.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAK7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,YAAY,EACV,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,UAAW,SAAQ,QAAQ,CAC1C,aAAa,EACb,eAAe,EACf,oBAAoB,CACrB;CAAG;AAEJ,eAAO,MAAM,UAAU,6CAAsC,CAAC;AAE9D,eAAO,MAAM,kBAAkB,6FAmD5B,CAAC"}
@@ -3,5 +3,7 @@ export type LocalRunnerOptions = {
3
3
  /** Kill a spawned program after this long. @default 120_000 */
4
4
  readonly execTimeoutMs?: number;
5
5
  };
6
+ /** The errno code of a thrown fs error (`ENOENT`, `EACCES`, …), if it has one. */
7
+ export declare const errnoCode: (cause: unknown) => string | undefined;
6
8
  export declare const localRunner: (options?: LocalRunnerOptions) => HostRunner;
7
9
  //# sourceMappingURL=local-runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../src/launchd/local-runner.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAwB,UAAU,EAAgB,MAAM,aAAa,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAyEF,eAAO,MAAM,WAAW,aAAa,kBAAkB,KAAQ,UAgD9D,CAAC"}
1
+ {"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../src/launchd/local-runner.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAwB,UAAU,EAAgB,MAAM,aAAa,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,SAAS,UAAW,OAAO,KAAG,MAAM,GAAG,SAGrC,CAAC;AAqEhB,eAAO,MAAM,WAAW,aAAa,kBAAkB,KAAQ,UAgD9D,CAAC"}
@@ -7,7 +7,8 @@
7
7
  * written by the same identity on the same host — a stack cannot write the file as one user and
8
8
  * bootstrap the job as another by accident.
9
9
  * ⚠️ The default is localRunner(): this process, never elevated. A system-domain job therefore
10
- * needs the deploy itself started as root, or a runner passed here with `privileged: true`.
10
+ * needs the deploy itself started as root, or a runner passed here with `privileged: true` —
11
+ * `launchdProviders(sudoRunner({ prefixes }))` is the kit's own (sudo-runner.ts).
11
12
  */
12
13
  import * as Layer from 'effect/Layer';
13
14
  import { type HostRunner } from './runner.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/launchd/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAE/D,eAAO,MAAM,gBAAgB,YAAY,UAAU,yJAGhD,CAAC"}
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/launchd/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAE/D,eAAO,MAAM,gBAAgB,YAAY,UAAU,yJAGhD,CAAC"}
@@ -47,13 +47,15 @@ export type HostUser = {
47
47
  };
48
48
  export interface HostRunner {
49
49
  /**
50
- * ⛔ DECLARED, NEVER INFERRED. `true` only when every call this runner makes already runs with
51
- * root's authority — a runner that talks to a root helper, say. The providers refuse
50
+ * ⛔ DECLARED, NEVER INFERRED. `true` only when this runner can do every root-needing call the
51
+ * providers make of it: every call already runs as root (a runner that talks to a root helper,
52
+ * say), or the runner elevates exactly those calls (sudoRunner). The providers refuse
52
53
  * system-domain writes unless `effectiveUid()` is 0 or this is `true`, so claiming it falsely
53
54
  * turns that refusal into an EACCES halfway through a deploy.
54
- * ⛔ THE KIT NEVER ELEVATES. No runner here calls `sudo`: a deploy that prompts for a password
55
- * mid-plan, or silently uses a cached sudo ticket, is exactly the "no silent sudo" failure. A
56
- * consumer who wants elevation writes that runner deliberately and sets this flag.
55
+ * ⛔ THE KIT NEVER ELEVATES SILENTLY. localRunner() never calls `sudo`: a deploy that prompts for
56
+ * a password mid-plan, or quietly borrows a cached sudo ticket, is exactly the "no silent sudo"
57
+ * failure. sudoRunner() does call `sudo -n`, but only when a stack passes it explicitly, only
58
+ * for the argv shapes in sudo-allowlist.ts, and logging each one (decided 2026-09-21).
57
59
  */
58
60
  readonly privileged: boolean;
59
61
  /** The uid file writes and launchctl calls run as. */
@@ -70,6 +72,13 @@ export interface HostRunner {
70
72
  * ⚠️ The parent directory must exist; creating it would invent an owner and mode nobody declared.
71
73
  */
72
74
  writeFileAtomic(path: string, bytes: Uint8Array, options: WriteOptions): Promise<void>;
75
+ /**
76
+ * PLAN TIME: refuse, reading only and writing nothing, a write this runner would refuse at
77
+ * apply — so the plan shows it before any resource is applied. Optional: a runner without it
78
+ * refuses at the write. ★ sudoRunner implements it with the checks it makes before `sudo -n`;
79
+ * ⛔ it never elevates, so a plan still never calls sudo.
80
+ */
81
+ checkWrite?(path: string, options: WriteOptions): Promise<void>;
73
82
  /** Remove a file. Idempotent: nothing at `path` is success. */
74
83
  removeFile(path: string): Promise<void>;
75
84
  /** A user by name or numeric id, or `undefined` when the host has none. */
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/launchd/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,sGAAsG;AACtG,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1D,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EA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FAA0F;AAC1F,eAAO,MAAM,eAAe,WAAY,UAAU,KAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CACxC,CAAC;AAE3C,oFAAoF;AACpF,eAAO,MAAM,YAAY,WAAY,UAAU,KAAG,OACA,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The ACL half of sudo-guard.ts: mode bits say a directory is root's alone, and an ACL can say
3
+ * otherwise. On macOS an `allow add_file,add_subdirectory,delete_child` entry lets its holder swap
4
+ * what lies under a root-owned `0755` directory — a symlink where the file was — between the
5
+ * guard's lstat checks and the privileged call, exactly as group write would. An inheritable
6
+ * `allow write` hands every file root installs there to its holder.
7
+ *
8
+ * ★ READ WITH `ls -lden`, AS THE OPERATOR — no sudo, and the same read at plan time and before the
9
+ * write. MEASURED 2026-09-21 on macOS 27.2: each entry prints on its own line after the path's,
10
+ * as ` 0: <qualifier> [inherited ]allow|deny <perms>`; `-n` makes the qualifier a UUID, never a
11
+ * name with a space in it. The `+` flag after the mode is NOT reliable — `@` (extended
12
+ * attributes) replaces it in the listing — so the entries are what is read.
13
+ * ⚠️ A DENY ENTRY GRANTS NOTHING (macOS puts `everyone deny delete` on home folders), and an allow
14
+ * of read-only rights (`list`, `search`, `readattr` …) swaps nothing, so neither refuses.
15
+ */
16
+ import type { HostRunner } from './runner.ts';
17
+ export declare const LS = "/bin/ls";
18
+ /** The allow entries in `ls -lden` output that grant a write right, as printed. */
19
+ export declare const aclGrants: (listing: string) => string[];
20
+ /**
21
+ * ⛔ Refuse when any directory in `chain` carries an ACL entry that lets someone write it, or when
22
+ * the ACLs cannot be read at all (fail closed). `path` names the file in the refusal.
23
+ */
24
+ export declare const assertNoAclGrants: (base: HostRunner, path: string, chain: readonly string[]) => Promise<void>;
25
+ //# sourceMappingURL=sudo-acl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sudo-acl.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-acl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,eAAO,MAAM,EAAE,YAAY,CAAC;AAgB5B,mFAAmF;AACnF,eAAO,MAAM,SAAS,YAAa,MAAM,KAAG,MAAM,EAOnB,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SACtB,UAAU,QACV,MAAM,SACL,SAAS,MAAM,EAAE,KACvB,OAAO,CAAC,IAAI,CAed,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * A privileged call that was refused before it ran: by the allowlist, by a host check
3
+ * (sudo-guard.ts), or by sudo itself. ★ Here, beside the allowlist, so the guard and the runner
4
+ * throw the same class and a caller can tell "nothing ran as root" from "it ran and failed".
5
+ */
6
+ export declare class SudoRefusedError extends Error {
7
+ constructor(message: string);
8
+ }
9
+ /** ★ Absolute program paths, so neither sudo nor the command is looked up on the caller's PATH. */
10
+ export declare const SUDO = "/usr/bin/sudo";
11
+ export declare const INSTALL = "/usr/bin/install";
12
+ export declare const RM = "/bin/rm";
13
+ /** A mode as `install -m` takes it: four octal digits, so `0644` and `4755` are both exact. */
14
+ export declare const octalMode: (mode: number) => string | undefined;
15
+ /** Validate the stack's prefixes once, when the runner is built. */
16
+ export declare const checkPrefixes: (prefixes: readonly string[]) => readonly string[];
17
+ /**
18
+ * The declared prefix `path` is strictly under, or `undefined`.
19
+ * ⚠️ `${prefix}/`, never a bare startsWith: `/opt/example` must not admit `/opt/example-other`.
20
+ */
21
+ export declare const prefixOf: (path: string, prefixes: readonly string[]) => string | undefined;
22
+ /** The one source `install` may copy and the prefixes, for the call being checked. */
23
+ export type AllowContext = {
24
+ readonly prefixes: readonly string[];
25
+ readonly staged?: string;
26
+ };
27
+ /** `undefined` when `argv` is exactly an allowed privileged shape, else the reason it is not. */
28
+ export declare const privilegedProblem: (argv: readonly string[], context: AllowContext) => string | undefined;
29
+ /** Where one exec goes: run as the deploying user, run as root through the allowlist, or refused. */
30
+ export type Route = {
31
+ readonly as: 'operator';
32
+ } | {
33
+ readonly as: 'root';
34
+ } | {
35
+ readonly refuse: string;
36
+ };
37
+ /**
38
+ * ★ WHY THIS REFUSES AS WELL AS ROUTES. sudoRunner reports `privileged: true`, which switches off
39
+ * the providers' own "another user's gui domain needs root" refusal (job-preflight.ts). This
40
+ * runner elevates only the system domain, so it gives that refusal back itself. (A write into
41
+ * another user's LaunchAgents is refused by the writer first: outside every prefix, a foreign
42
+ * owner needs root. This covers the delete, which reaches launchctl before any file.)
43
+ * ⚠️ Reads (`print`, `print-disabled`) always run as the deploying user: launchctl(1) says anyone
44
+ * may read or query the system domain, and launchctl.ts measured it on 2026-09-21.
45
+ */
46
+ export declare const routeExec: (argv: readonly string[], operatorUid: number) => Route;
47
+ //# sourceMappingURL=sudo-allowlist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sudo-allowlist.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-allowlist.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,mGAAmG;AACnG,eAAO,MAAM,IAAI,kBAAkB,CAAC;AACpC,eAAO,MAAM,OAAO,qBAAqB,CAAC;AAC1C,eAAO,MAAM,EAAE,YAAY,CAAC;AAK5B,+FAA+F;AAC/F,eAAO,MAAM,SAAS,SAAU,MAAM,KAAG,MAAM,GAAG,SAGnC,CAAC;AAEhB,oEAAoE;AACpE,eAAO,MAAM,aAAa,aAAc,SAAS,MAAM,EAAE,KAAG,SAAS,MAAM,EAa1E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,SAAU,MAAM,YAAY,SAAS,MAAM,EAAE,KAAG,MAAM,GAAG,SAGhB,CAAC;AA6E/D,sFAAsF;AACtF,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9F,iGAAiG;AACjG,eAAO,MAAM,iBAAiB,SACtB,SAAS,MAAM,EAAE,WACd,YAAY,KACpB,MAAM,GAAG,SAyBX,CAAC;AAEF,qGAAqG;AACrG,MAAM,MAAM,KAAK,GACb;IAAE,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACvB;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhC;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,SAAU,SAAS,MAAM,EAAE,eAAe,MAAM,KAAG,KAiBxE,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The checks sudo-runner.ts makes against the host, as the deploying user, before it runs anything
3
+ * as root. sudo-allowlist.ts checks the argv; this checks what the paths in it actually are.
4
+ *
5
+ * ⛔ WHAT IS LOGGED IS WHAT IS WRITTEN. A symlinked directory under a prefix would make
6
+ * `install` or `rm`, running as root, act on a path the log never named. So every directory
7
+ * between the prefix and the file must be a real directory.
8
+ * ⛔ EVERY DIRECTORY FROM THE PREFIX DOWN IS ROOT'S ALONE (decided 2026-09-21). A directory below
9
+ * the prefix that another user owns, or that group or other may write, lets that user swap what
10
+ * lies under it — a symlink where the file was — between these checks and the privileged call.
11
+ * So each one must be owned by root and not group/other-writable (rootOnlyProblem), exactly as
12
+ * the prefix itself must.
13
+ * ⛔ AND EVERY DIRECTORY ABOVE THE PREFIX (red team, 2026-09-21). Whoever may write the prefix's
14
+ * parent may rename the prefix away and put a symlink in its place between these checks and the
15
+ * privileged call — the same swap one level up. So `/` down to the prefix's parent must be
16
+ * root-only too (a root-owned symlink among them, `/etc` -> `private/etc`, is root's own and is
17
+ * followed; its target is root's choice, and not walked).
18
+ * ⛔ AND NO ACL THAT SAYS OTHERWISE (sudo-acl.ts): mode bits are not the whole answer on macOS.
19
+ * ⚠️ These checks run before the privileged call, as the deploying user. They guard against a
20
+ * mistaken declaration and against every user but root; root itself could still change a path
21
+ * in that window.
22
+ */
23
+ import type { HostRunner, WriteOptions } from './runner.ts';
24
+ /** The directories strictly between `prefix` and the file at `path`. */
25
+ export declare const betweenDirs: (prefix: string, path: string) => string[];
26
+ /** The directories strictly above `prefix`: `/`, then each one down to the prefix's parent. */
27
+ export declare const aboveDirs: (prefix: string) => string[];
28
+ /**
29
+ * What must be at `path` itself: a regular file, or (for a write or a remove) nothing yet.
30
+ * ⚠️ A DIRECTORY AT THE DESTINATION IS THE TRAP: `install src dir` copies INTO the directory
31
+ * (install(1)), and install decides that with stat, so a symlink to a directory does the same.
32
+ */
33
+ export type Expect = 'file' | 'file-or-absent';
34
+ /**
35
+ * Refuse a prefix that is not a root-only directory, a symlink or a non-directory between the
36
+ * prefix and `path`, and anything but a file at it.
37
+ */
38
+ export declare const assertPlainPath: (base: HostRunner, prefix: string, path: string, expect: Expect) => Promise<'file' | 'absent'>;
39
+ /**
40
+ * ⛔ A ROOT-OWNED FILE UNDER A PREFIX IS ROOT'S TO CHANGE, AND ONLY ROOT'S (decided 2026-09-21).
41
+ * Group- or world-writable, anyone in that class rewrites a file root installed — a daemon's
42
+ * config, a script a LaunchDaemon runs as root — which is root by another name. Setuid or setgid,
43
+ * it runs as root (or its group) for whoever executes it. install(1) would apply either, as root.
44
+ * ★ Root-owned is an omitted owner (the runner installs as root under a prefix) or uid 0. A file
45
+ * handed to another user is that user's to change; the sticky bit changes nothing on a file.
46
+ */
47
+ export declare const modeProblem: (options: WriteOptions) => string | undefined;
48
+ /**
49
+ * Every check a write under `prefix` meets before anything is staged or run as root: the mode, the
50
+ * path (assertPlainPath) and the read-back (assertReadableBack). ★ Reads only, as the deploying
51
+ * user — so sudoRunner's `checkWrite` runs it at PLAN time too, and a plan still never calls sudo.
52
+ */
53
+ export declare const assertInstallable: (base: HostRunner, prefix: string, path: string, options: WriteOptions, groups: readonly number[] | undefined) => Promise<void>;
54
+ /**
55
+ * POSIX read permission for one uid: owner class, else group class, else other. `undefined` when
56
+ * only group membership could decide and the groups are unknown.
57
+ * ⚠️ EXACTLY ONE CLASS APPLIES. A group member gets the group bits even when the other bits are
58
+ * wider (`0604` hides a file from its group), so "other can read" is not enough on its own.
59
+ */
60
+ export declare const canRead: (file: {
61
+ readonly uid: number;
62
+ readonly gid: number;
63
+ readonly mode: number;
64
+ }, uid: number, groups: readonly number[] | undefined) => boolean | undefined;
65
+ /**
66
+ * ⛔ REFUSE A FILE THE DEPLOYING USER COULD NOT READ BACK, before writing it. Both providers read
67
+ * every write back to verify it (host-file-lifecycle.ts, job-lifecycle.ts) and read it again at
68
+ * every plan, as the deploying user; this runner elevates writes, never reads. A root-only
69
+ * `0600` would be installed, then fail the read-back with EACCES and stay on disk with no state,
70
+ * so every later plan would fail too.
71
+ * ★ An omitted owner is root (under a prefix the runner writes as root). An omitted group is the
72
+ * parent directory's, which is the group a new file gets on macOS.
73
+ * ⚠️ Unknown groups never refuse: the read-back after the write stays the final judge.
74
+ */
75
+ export declare const assertReadableBack: (base: HostRunner, path: string, options: WriteOptions, groups: readonly number[] | undefined) => Promise<void>;
76
+ /**
77
+ * The deploying user's groups, from `id -G`; `undefined` when that fails.
78
+ * ⚠️ NOT process.getgroups(). MEASURED 2026-09-21 on macOS 27.2: getgroups() returned 16 groups
79
+ * where `id -G` returned 18, because macOS caps a process's own list at 16. A group past the
80
+ * 16th would read as "not a member" and refuse a file the user can in fact read.
81
+ */
82
+ export declare const operatorGroups: (base: HostRunner) => Promise<readonly number[] | undefined>;
83
+ //# sourceMappingURL=sudo-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sudo-guard.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAY,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAA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need root go through `sudo -n`, in the exact shapes sudo-allowlist.ts names:
4
+ *
5
+ * - `launchctl bootstrap | bootout | kickstart` in the system domain;
6
+ * - a file under a prefix the stack declared: staged in a private temp file as the operator, then
7
+ * `sudo -n install -S -m <mode> [-o <uid>] [-g <gid>] <staged> <path>`; removed with
8
+ * `sudo -n rm -f -- <path>`.
9
+ *
10
+ * Everything else (reads, lookups, the operator's own files and gui domain) goes to localRunner().
11
+ *
12
+ * ★ DECIDED 2026-09-21. A host stack deploys as the operator rather than as root, so a provider bug
13
+ * or a wrong declaration can do no more than this list. It is an explicit opt-in,
14
+ * `launchdProviders(sudoRunner({ prefixes }))`, and nothing ever falls back to it: localRunner()
15
+ * stays the default and never elevates.
16
+ * ⛔ `sudo -n`, NEVER A PROMPT. A deploy that stops mid-apply to ask for a password is the failure
17
+ * "no silent sudo" exists to prevent. With -n, sudo fails at once, and that failure becomes an
18
+ * error saying what to do.
19
+ * ⛔ EVERY PRIVILEGED ARGV IS LOGGED BEFORE IT RUNS, and it is only ever an argv: a file's bytes
20
+ * travel through the staged file, never through argv, so a log line cannot carry content.
21
+ * ★ `install -S`: install(1) on macOS 27.2 (read 2026-09-21) always writes a temp file in the
22
+ * target directory and renames it, so the file is never torn, and -S adds the fsync that
23
+ * localRunner's `handle.sync()` does.
24
+ * ⚠️ REASONED, NOT MEASURED: sudo's failure text (sudo-said.ts has the strings and their sources).
25
+ * ⛔ EVERY CHECK BEFORE SUDO ALSO RUNS AT PLAN TIME (`checkWrite`, 2026-09-21): the mode, the
26
+ * directories from the prefix down, the read-back. Reads only, as the operator — never sudo.
27
+ */
28
+ import { type LocalRunnerOptions } from './local-runner.ts';
29
+ import type { HostRunner } from './runner.ts';
30
+ import { SudoRefusedError } from './sudo-allowlist.ts';
31
+ import { type Staged } from './sudo-stage.ts';
32
+ export { SudoRefusedError };
33
+ export type SudoRunnerOptions = LocalRunnerOptions & {
34
+ /**
35
+ * The directories root may install into and remove from: `/Library/LaunchDaemons` for system
36
+ * jobs (bootstrap and bootout are refused without it), plus wherever the stack's root-owned
37
+ * HostFiles live. ⛔ Required: absolute, normalised, never `/`; and at every privileged call a
38
+ * real directory that root owns and only root may write (sudo-guard.ts). Outside every prefix a
39
+ * file is written as the deploying user, or refused when that needs root.
40
+ */
41
+ readonly prefixes: readonly string[];
42
+ /** Receives one line per privileged argv, before it runs. @default a line on stderr */
43
+ readonly log?: (line: string) => void;
44
+ };
45
+ /** What a sudo runner is built from. ★ Split out so the tests swap the host, never the logic. */
46
+ export type SudoDeps = {
47
+ /** Runs everything, including `sudo` itself. localRunner() for the real one. */
48
+ readonly base: HostRunner;
49
+ readonly stage: (bytes: Uint8Array) => Promise<Staged>;
50
+ /** The deploying user's groups, for the read-back check; `undefined` when unknown. */
51
+ readonly groups: () => Promise<readonly number[] | undefined>;
52
+ readonly log: (line: string) => void;
53
+ };
54
+ export declare const makeSudoRunner: (prefixList: readonly string[], deps: SudoDeps) => HostRunner;
55
+ /**
56
+ * The real sudo runner: localRunner() for everything, `/usr/bin/sudo -n` for the allowlist.
57
+ * Pass it explicitly: `launchdProviders(sudoRunner({ prefixes: ['/Library/LaunchDaemons'] }))`.
58
+ */
59
+ export declare const sudoRunner: (options: SudoRunnerOptions) => HostRunner;
60
+ //# sourceMappingURL=sudo-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sudo-runner.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAc,UAAU,EAAgB,MAAM,aAAa,CAAC;AACxE,OAAO,EAIL,gBAAgB,EAMjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,uFAAuF;IACvF,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,iGAAiG;AACjG,MAAM,MAAM,QAAQ,GAAG;IACrB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,sFAAsF;IACtF,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IAC9D,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,cAAc,eAAgB,SAAS,MAAM,EAAE,QAAQ,QAAQ,KAAG,UAgI9E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,YAAa,iBAAiB,KAAG,UAYvD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ExecResult } from './runner.ts';
2
+ import { SudoRefusedError } from './sudo-allowlist.ts';
3
+ /** ★ An EACCES outside every prefix is almost always a directory the stack forgot to declare. */
4
+ export declare const undeclared: (path: string, prefixes: readonly string[]) => (cause: unknown) => never;
5
+ /**
6
+ * The refusal sudo itself answered for `shown` (the argv as JSON), or `undefined` when the command
7
+ * ran — whatever its own exit code. ★ `SudoRefusedError` always means nothing ran as root.
8
+ */
9
+ export declare const sudoRefusal: (shown: string, result: ExecResult) => SudoRefusedError | undefined;
10
+ //# sourceMappingURL=sudo-said.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sudo-said.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-said.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAcvD,iGAAiG;AACjG,eAAO,MAAM,UAAU,SACd,MAAM,YAAY,SAAS,MAAM,EAAE,aAClC,OAAO,KAAG,KAQjB,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,WAAW,UAAW,MAAM,UAAU,UAAU,KAAG,gBAAgB,GAAG,SAelF,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** A file staged for `install`, and how to remove it again. */
2
+ export type Staged = {
3
+ readonly path: string;
4
+ readonly dispose: () => Promise<void>;
5
+ };
6
+ export declare const stageFile: (bytes: Uint8Array) => Promise<Staged>;
7
+ //# sourceMappingURL=sudo-stage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sudo-stage.d.ts","sourceRoot":"","sources":["../../src/launchd/sudo-stage.ts"],"names":[],"mappings":"AAaA,+DAA+D;AAC/D,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAEtF,eAAO,MAAM,SAAS,UAAiB,UAAU,KAAG,OAAO,CAAC,MAAM,CAWjE,CAAC"}
@@ -6,10 +6,14 @@
6
6
  */
7
7
  import * as Effect from 'effect/Effect';
8
8
  import type * as HttpClient from 'effect/unstable/http/HttpClient';
9
+ import type { Claim } from '../ownership/adopt.ts';
9
10
  import { type BaoAuthMethodAttributes, type BaoAuthMethodProps } from './auth-method-form.ts';
10
11
  import type { BaoError } from './bao-status.ts';
11
12
  import type { RemountError, RemountOptions } from './remount-wire.ts';
12
13
  export declare const readMethod: (props: BaoAuthMethodProps) => Effect.Effect<BaoAuthMethodAttributes | undefined, BaoError, HttpClient.HttpClient>;
13
- /** Converge one auth method. `stated` is the path in Alchemy's state, if any. */
14
- export declare const reconcileAuthMethod: (news: BaoAuthMethodProps, stated: string | undefined, options?: RemountOptions) => Effect.Effect<BaoAuthMethodAttributes, BaoError | RemountError, HttpClient.HttpClient>;
14
+ /**
15
+ * Converge one auth method. `stated` is the path in Alchemy's state, if any.
16
+ * ⛔ `claim`: the same first-reconcile takeover refusal as reconcileMount's (auth-method.ts passes it).
17
+ */
18
+ export declare const reconcileAuthMethod: (news: BaoAuthMethodProps, stated: string | undefined, options?: RemountOptions, claim?: Claim) => Effect.Effect<BaoAuthMethodAttributes, BaoError | RemountError, HttpClient.HttpClient>;
15
19
  //# sourceMappingURL=auth-method-reconcile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-method-reconcile.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-method-reconcile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EAKxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtE,eAAO,MAAM,UAAU,UACd,kBAAkB,KACxB,MAAM,CAAC,MAAM,CAAC,uBAAuB,GAAG,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAKjF,CAAC;AAUL,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,SACxB,kBAAkB,UAChB,MAAM,GAAG,SAAS,YAChB,cAAc,KACvB,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,CAAC,UAAU,CA8BpF,CAAC"}
1
+ {"version":3,"file":"auth-method-reconcile.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-method-reconcile.ts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,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,aAAa,gDAExB,CAAC;AAEH,eAAO,MAAM,qBAAqB,oGAqD/B,CAAC"}
1
+ {"version":3,"file":"auth-method.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-method.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAInE,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAK/B,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,CAAC;AAE5D,MAAM,WAAW,aAAc,SAAQ,QAAQ,CAC7C,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,aAAa,gDAExB,CAAC;AAEH,eAAO,MAAM,qBAAqB,oGA2D/B,CAAC"}
@@ -33,15 +33,6 @@ export declare const readPath: (name: string) => string;
33
33
  * ★ ALL STRINGS, EXACTLY THE `k=v` PAIRS `bao write` USED TO SEND — see `baoWrite` in bao-http.ts.
34
34
  */
35
35
  export declare const writeBody: (props: BaoAuthRoleProps) => Record<string, string>;
36
- /**
37
- * Whether a changed `name` names a DIFFERENT role — the diff's `replace` question.
38
- *
39
- * ⚠️ CASE-INSENSITIVELY, BECAUSE THE SERVER IS. AppRole stores `role/<lowercased name>` (openbao
40
- * v2.6.2 builtin/credential/approle/path_role.go:1485, and roleEntry reads the same key, :1537),
41
- * so `Host` → `host` is the SAME role: a `replace` there would write it, then — under `destroy` —
42
- * delete the old generation, which is that same role.
43
- */
44
- export declare const isRename: (from: string, to: string) => boolean;
45
36
  /** True when live already matches the declaration on every managed field. */
46
37
  export declare const matches: (attributes: BaoAuthRoleAttributes, props: BaoAuthRoleProps) => boolean;
47
38
  //# sourceMappingURL=auth-role-form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-form.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAwBD,eAAO,MAAM,YAAY,UAChB,gBAAgB,QACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBAWF,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAAgC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAW,gBAAgB,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAYxE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,SAAU,MAAM,MAAM,MAAM,KAAG,OACX,CAAC;AAW1C,6EAA6E;AAC7E,eAAO,MAAM,OAAO,eAAgB,qBAAqB,SAAS,gBAAgB,YAUjF,CAAC"}
1
+ {"version":3,"file":"auth-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-form.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAwBD,eAAO,MAAM,YAAY,UAChB,gBAAgB,QACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBAWF,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAAgC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAW,gBAAgB,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAYxE,CAAC;AAWF,6EAA6E;AAC7E,eAAO,MAAM,OAAO,eAAgB,qBAAqB,SAAS,gBAAgB,YAUjF,CAAC"}
@@ -5,8 +5,9 @@
5
5
  * are credential issuance, not configuration, and are OUT OF SCOPE. This declares the
6
6
  * role shape an approle login inherits — policy names and TTL strings only.
7
7
  *
8
- * ★ `defaultRemovalPolicy: 'retain'` — deleting a role revokes every token bound to it.
9
- * Opt in with `.pipe(RemovalPolicy.destroy())`; see resource.ts in house/proxmox.
8
+ * ★ `defaultRemovalPolicy: 'retain'` — deleting a role locks out every host that logs in with it:
9
+ * its secret_ids go with it (the ⚠️ on `delete` below). Opt in with
10
+ * `.pipe(RemovalPolicy.destroy())`; see resource.ts in house/proxmox.
10
11
  */
11
12
  import { Resource } from 'alchemy';
12
13
  import * as Provider from 'alchemy/Provider';
@@ -1 +1 @@
1
- {"version":3,"file":"auth-role.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAMtB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC;AAExD,MAAM,WAAW,WAAY,SAAQ,QAAQ,CAC3C,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,WAAW,8CAEtB,CAAC;AASH,eAAO,MAAM,mBAAmB,kGAiE7B,CAAC"}
1
+ {"version":3,"file":"auth-role.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAInE,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAKtB,MAAM,qBAAqB,CAAC;AAI7B,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC;AAExD,MAAM,WAAW,WAAY,SAAQ,QAAQ,CAC3C,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,WAAW,8CAEtB,CAAC;AAiBH,eAAO,MAAM,mBAAmB,kGAoF7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cloudflare-role.d.ts","sourceRoot":"","sources":["../../src/openbao/cloudflare-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,0BAA0B,EAAiB,MAAM,mCAAmC,CAAC;AAE9F,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAM5B,MAAM,2BAA2B,CAAC;AAcnC,YAAY,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CACjD,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,iBAAiB,oDAE5B,CAAC;AAEH,eAAO,MAAM,yBAAyB,qIA8InC,CAAC"}
1
+ {"version":3,"file":"cloudflare-role.d.ts","sourceRoot":"","sources":["../../src/openbao/cloudflare-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAKnE,OAAO,EAAE,0BAA0B,EAAiB,MAAM,mCAAmC,CAAC;AAE9F,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAM5B,MAAM,2BAA2B,CAAC;AAQnC,YAAY,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CACjD,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,iBAAiB,oDAE5B,CAAC;AAKH,eAAO,MAAM,yBAAyB,qIAmJnC,CAAC"}
@@ -36,5 +36,23 @@ export declare const withFake: (answer: Answer, body: (bao: Fake) => Promise<voi
36
36
  export declare const run: <A, E>(env: BaoEnvironment, effect: Effect.Effect<A, E, HttpClient.HttpClient>) => Promise<A>;
37
37
  /** The effect's failure — rejects if it succeeded. */
38
38
  export declare const runFailure: <A, E>(env: BaoEnvironment, effect: Effect.Effect<A, E, HttpClient.HttpClient>) => Promise<E>;
39
+ /**
40
+ * An injected crash between a write and its commit. Once armed, `crashNext()` fails the first read
41
+ * that follows a write with a 500 — a reconcile whose write landed and whose read-back, and so the
42
+ * engine's commit, never did — and `crashNext('write')` lands the next write and then answers it
43
+ * 500, for a reconcile that reads nothing back (Bao.Policy). Either leaves the `creating` /
44
+ * `replacing` row a killed deploy leaves.
45
+ */
46
+ export declare const crashAfterWrite: () => {
47
+ crashNext: (at?: 'read-back' | 'write') => void;
48
+ wrap: (answer: (seen: Seen) => Reply) => (seen: Seen) => Reply;
49
+ };
50
+ /**
51
+ * A deploy killed BEFORE a resource's reconcile ran: the first write to a path ending in `suffix` is
52
+ * refused (500) without landing. Aimed at an upstream, it fails every create waiting on it after
53
+ * Apply has committed their `creating` rows — rows whose create never asked whose object sat at
54
+ * its identity (ownership/whole.ts).
55
+ */
56
+ export declare const refuseWriteOnce: (suffix: string) => (answer: (seen: Seen) => Reply) => (seen: Seen) => Reply;
39
57
  export {};
40
58
  //# sourceMappingURL=fake-bao.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fake-bao.d.ts","sourceRoot":"","sources":["../../src/openbao/fake-bao.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,qCAAqC;AACrC,MAAM,MAAM,IAAI,GAAG;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iGAAiG;AACjG,MAAM,MAAM,KAAK,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjG,MAAM,MAAM,IAAI,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IAAC,IAAI,IAAI,IAAI,CAAA;CAAE,CAAC;AAErF,6FAA6F;AAC7F,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAErD,eAAO,MAAM,OAAO,WAAY,MAAM,SAAS,MAAM,KAAG,IAwBvD,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,QAAQ,WACX,MAAM,QACR,CAAC,GAAG,EAAE,IAAI,KAAK,O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