@homeflare/alchemy 0.1.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 (417) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/dist/cloudflare/client.d.ts +45 -0
  4. package/dist/cloudflare/client.d.ts.map +1 -0
  5. package/dist/cloudflare/index.d.ts +11 -0
  6. package/dist/cloudflare/index.d.ts.map +1 -0
  7. package/dist/cloudflare/index.js +129 -0
  8. package/dist/cloudflare/index.js.map +13 -0
  9. package/dist/cloudflare/lock-rules.d.ts +50 -0
  10. package/dist/cloudflare/lock-rules.d.ts.map +1 -0
  11. package/dist/cloudflare/providers.d.ts +19 -0
  12. package/dist/cloudflare/providers.d.ts.map +1 -0
  13. package/dist/cloudflare/r2-bucket-lock.d.ts +100 -0
  14. package/dist/cloudflare/r2-bucket-lock.d.ts.map +1 -0
  15. package/dist/forgejo/branch-protection-form.d.ts +19 -0
  16. package/dist/forgejo/branch-protection-form.d.ts.map +1 -0
  17. package/dist/forgejo/branch-protection.d.ts +47 -0
  18. package/dist/forgejo/branch-protection.d.ts.map +1 -0
  19. package/dist/forgejo/client.d.ts +37 -0
  20. package/dist/forgejo/client.d.ts.map +1 -0
  21. package/dist/forgejo/index.d.ts +18 -0
  22. package/dist/forgejo/index.d.ts.map +1 -0
  23. package/dist/forgejo/index.js +479 -0
  24. package/dist/forgejo/index.js.map +21 -0
  25. package/dist/forgejo/org-actions-secrets.d.ts +45 -0
  26. package/dist/forgejo/org-actions-secrets.d.ts.map +1 -0
  27. package/dist/forgejo/org-label.d.ts +46 -0
  28. package/dist/forgejo/org-label.d.ts.map +1 -0
  29. package/dist/forgejo/org-team.d.ts +42 -0
  30. package/dist/forgejo/org-team.d.ts.map +1 -0
  31. package/dist/forgejo/repo-webhook-form.d.ts +27 -0
  32. package/dist/forgejo/repo-webhook-form.d.ts.map +1 -0
  33. package/dist/forgejo/repo-webhook.d.ts +46 -0
  34. package/dist/forgejo/repo-webhook.d.ts.map +1 -0
  35. package/dist/forgejo/repository.d.ts +45 -0
  36. package/dist/forgejo/repository.d.ts.map +1 -0
  37. package/dist/forgejo/resource.d.ts +83 -0
  38. package/dist/forgejo/resource.d.ts.map +1 -0
  39. package/dist/forgejo/team-member.d.ts +39 -0
  40. package/dist/forgejo/team-member.d.ts.map +1 -0
  41. package/dist/forgejo/values.d.ts +24 -0
  42. package/dist/forgejo/values.d.ts.map +1 -0
  43. package/dist/index.d.ts +18 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +3 -0
  46. package/dist/index.js.map +9 -0
  47. package/dist/openbao/auth-role-form.d.ts +38 -0
  48. package/dist/openbao/auth-role-form.d.ts.map +1 -0
  49. package/dist/openbao/auth-role.d.ts +20 -0
  50. package/dist/openbao/auth-role.d.ts.map +1 -0
  51. package/dist/openbao/bao-address.d.ts +72 -0
  52. package/dist/openbao/bao-address.d.ts.map +1 -0
  53. package/dist/openbao/bao-http.d.ts +71 -0
  54. package/dist/openbao/bao-http.d.ts.map +1 -0
  55. package/dist/openbao/bao-status.d.ts +74 -0
  56. package/dist/openbao/bao-status.d.ts.map +1 -0
  57. package/dist/openbao/cloudflare-group-scope.d.ts +73 -0
  58. package/dist/openbao/cloudflare-group-scope.d.ts.map +1 -0
  59. package/dist/openbao/cloudflare-parity-catalog.d.ts +28 -0
  60. package/dist/openbao/cloudflare-parity-catalog.d.ts.map +1 -0
  61. package/dist/openbao/cloudflare-parity-snapshot.d.ts +31 -0
  62. package/dist/openbao/cloudflare-parity-snapshot.d.ts.map +1 -0
  63. package/dist/openbao/cloudflare-parity.d.ts +14 -0
  64. package/dist/openbao/cloudflare-parity.d.ts.map +1 -0
  65. package/dist/openbao/cloudflare-permission-groups-solve.d.ts +85 -0
  66. package/dist/openbao/cloudflare-permission-groups-solve.d.ts.map +1 -0
  67. package/dist/openbao/cloudflare-permission-groups.d.ts +87 -0
  68. package/dist/openbao/cloudflare-permission-groups.d.ts.map +1 -0
  69. package/dist/openbao/cloudflare-policy.d.ts +65 -0
  70. package/dist/openbao/cloudflare-policy.d.ts.map +1 -0
  71. package/dist/openbao/cloudflare-role-form.d.ts +110 -0
  72. package/dist/openbao/cloudflare-role-form.d.ts.map +1 -0
  73. package/dist/openbao/cloudflare-role-wire.d.ts +27 -0
  74. package/dist/openbao/cloudflare-role-wire.d.ts.map +1 -0
  75. package/dist/openbao/cloudflare-role.d.ts +35 -0
  76. package/dist/openbao/cloudflare-role.d.ts.map +1 -0
  77. package/dist/openbao/cloudflare-roles-config.d.ts +67 -0
  78. package/dist/openbao/cloudflare-roles-config.d.ts.map +1 -0
  79. package/dist/openbao/cloudflare-roles-expand.d.ts +76 -0
  80. package/dist/openbao/cloudflare-roles-expand.d.ts.map +1 -0
  81. package/dist/openbao/digest.d.ts +24 -0
  82. package/dist/openbao/digest.d.ts.map +1 -0
  83. package/dist/openbao/fake-bao.d.ts +40 -0
  84. package/dist/openbao/fake-bao.d.ts.map +1 -0
  85. package/dist/openbao/forgejo-bootstrap-parse.d.ts +46 -0
  86. package/dist/openbao/forgejo-bootstrap-parse.d.ts.map +1 -0
  87. package/dist/openbao/forgejo-bootstrap.d.ts +29 -0
  88. package/dist/openbao/forgejo-bootstrap.d.ts.map +1 -0
  89. package/dist/openbao/index.d.ts +18 -0
  90. package/dist/openbao/index.d.ts.map +1 -0
  91. package/dist/openbao/index.js +1158 -0
  92. package/dist/openbao/index.js.map +33 -0
  93. package/dist/openbao/mount-form.d.ts +60 -0
  94. package/dist/openbao/mount-form.d.ts.map +1 -0
  95. package/dist/openbao/mount-wire.d.ts +24 -0
  96. package/dist/openbao/mount-wire.d.ts.map +1 -0
  97. package/dist/openbao/mount.d.ts +20 -0
  98. package/dist/openbao/mount.d.ts.map +1 -0
  99. package/dist/openbao/pki-role-form.d.ts +118 -0
  100. package/dist/openbao/pki-role-form.d.ts.map +1 -0
  101. package/dist/openbao/pki-role.d.ts +50 -0
  102. package/dist/openbao/pki-role.d.ts.map +1 -0
  103. package/dist/openbao/policy-assembly.d.ts +13 -0
  104. package/dist/openbao/policy-assembly.d.ts.map +1 -0
  105. package/dist/openbao/policy-wire.d.ts +41 -0
  106. package/dist/openbao/policy-wire.d.ts.map +1 -0
  107. package/dist/openbao/policy.d.ts +83 -0
  108. package/dist/openbao/policy.d.ts.map +1 -0
  109. package/dist/openbao/proxmox-role-form.d.ts +92 -0
  110. package/dist/openbao/proxmox-role-form.d.ts.map +1 -0
  111. package/dist/openbao/proxmox-role.d.ts +47 -0
  112. package/dist/openbao/proxmox-role.d.ts.map +1 -0
  113. package/dist/openbao/ssh-role-form.d.ts +99 -0
  114. package/dist/openbao/ssh-role-form.d.ts.map +1 -0
  115. package/dist/openbao/ssh-role.d.ts +43 -0
  116. package/dist/openbao/ssh-role.d.ts.map +1 -0
  117. package/dist/proxmox/acl.d.ts +72 -0
  118. package/dist/proxmox/acl.d.ts.map +1 -0
  119. package/dist/proxmox/api-token-form.d.ts +59 -0
  120. package/dist/proxmox/api-token-form.d.ts.map +1 -0
  121. package/dist/proxmox/api-token.d.ts +159 -0
  122. package/dist/proxmox/api-token.d.ts.map +1 -0
  123. package/dist/proxmox/backup-job.d.ts +112 -0
  124. package/dist/proxmox/backup-job.d.ts.map +1 -0
  125. package/dist/proxmox/ceph-daemon-form.d.ts +70 -0
  126. package/dist/proxmox/ceph-daemon-form.d.ts.map +1 -0
  127. package/dist/proxmox/ceph-daemon.d.ts +162 -0
  128. package/dist/proxmox/ceph-daemon.d.ts.map +1 -0
  129. package/dist/proxmox/ceph-flag.d.ts +131 -0
  130. package/dist/proxmox/ceph-flag.d.ts.map +1 -0
  131. package/dist/proxmox/ceph-fs-wire.d.ts +106 -0
  132. package/dist/proxmox/ceph-fs-wire.d.ts.map +1 -0
  133. package/dist/proxmox/ceph-fs.d.ts +124 -0
  134. package/dist/proxmox/ceph-fs.d.ts.map +1 -0
  135. package/dist/proxmox/ceph-osd-tree.d.ts +154 -0
  136. package/dist/proxmox/ceph-osd-tree.d.ts.map +1 -0
  137. package/dist/proxmox/ceph-osd-write.d.ts +36 -0
  138. package/dist/proxmox/ceph-osd-write.d.ts.map +1 -0
  139. package/dist/proxmox/ceph-osd.d.ts +102 -0
  140. package/dist/proxmox/ceph-osd.d.ts.map +1 -0
  141. package/dist/proxmox/ceph-pool-form.d.ts +217 -0
  142. package/dist/proxmox/ceph-pool-form.d.ts.map +1 -0
  143. package/dist/proxmox/ceph-pool-settle.d.ts +39 -0
  144. package/dist/proxmox/ceph-pool-settle.d.ts.map +1 -0
  145. package/dist/proxmox/ceph-pool.d.ts +48 -0
  146. package/dist/proxmox/ceph-pool.d.ts.map +1 -0
  147. package/dist/proxmox/client.d.ts +64 -0
  148. package/dist/proxmox/client.d.ts.map +1 -0
  149. package/dist/proxmox/credentials.d.ts +153 -0
  150. package/dist/proxmox/credentials.d.ts.map +1 -0
  151. package/dist/proxmox/firewall-alias-form.d.ts +98 -0
  152. package/dist/proxmox/firewall-alias-form.d.ts.map +1 -0
  153. package/dist/proxmox/firewall-alias.d.ts +141 -0
  154. package/dist/proxmox/firewall-alias.d.ts.map +1 -0
  155. package/dist/proxmox/generated/pbs.d.ts +388 -0
  156. package/dist/proxmox/generated/pbs.d.ts.map +1 -0
  157. package/dist/proxmox/generated/pve.d.ts +4713 -0
  158. package/dist/proxmox/generated/pve.d.ts.map +1 -0
  159. package/dist/proxmox/group.d.ts +104 -0
  160. package/dist/proxmox/group.d.ts.map +1 -0
  161. package/dist/proxmox/ha-resource.d.ts +104 -0
  162. package/dist/proxmox/ha-resource.d.ts.map +1 -0
  163. package/dist/proxmox/ha-rule-form.d.ts +103 -0
  164. package/dist/proxmox/ha-rule-form.d.ts.map +1 -0
  165. package/dist/proxmox/ha-rule.d.ts +156 -0
  166. package/dist/proxmox/ha-rule.d.ts.map +1 -0
  167. package/dist/proxmox/index.d.ts +43 -0
  168. package/dist/proxmox/index.d.ts.map +1 -0
  169. package/dist/proxmox/index.js +2322 -0
  170. package/dist/proxmox/index.js.map +70 -0
  171. package/dist/proxmox/lease-cache.d.ts +98 -0
  172. package/dist/proxmox/lease-cache.d.ts.map +1 -0
  173. package/dist/proxmox/lxc.d.ts +59 -0
  174. package/dist/proxmox/lxc.d.ts.map +1 -0
  175. package/dist/proxmox/members.d.ts +56 -0
  176. package/dist/proxmox/members.d.ts.map +1 -0
  177. package/dist/proxmox/metric-server-form.d.ts +53 -0
  178. package/dist/proxmox/metric-server-form.d.ts.map +1 -0
  179. package/dist/proxmox/metric-server-otel.d.ts +49 -0
  180. package/dist/proxmox/metric-server-otel.d.ts.map +1 -0
  181. package/dist/proxmox/metric-server.d.ts +123 -0
  182. package/dist/proxmox/metric-server.d.ts.map +1 -0
  183. package/dist/proxmox/network-apply-read.d.ts +93 -0
  184. package/dist/proxmox/network-apply-read.d.ts.map +1 -0
  185. package/dist/proxmox/network-apply.d.ts +102 -0
  186. package/dist/proxmox/network-apply.d.ts.map +1 -0
  187. package/dist/proxmox/node-network-form.d.ts +128 -0
  188. package/dist/proxmox/node-network-form.d.ts.map +1 -0
  189. package/dist/proxmox/node-network.d.ts +173 -0
  190. package/dist/proxmox/node-network.d.ts.map +1 -0
  191. package/dist/proxmox/notification-target-form.d.ts +44 -0
  192. package/dist/proxmox/notification-target-form.d.ts.map +1 -0
  193. package/dist/proxmox/notification-target.d.ts +146 -0
  194. package/dist/proxmox/notification-target.d.ts.map +1 -0
  195. package/dist/proxmox/pbs-datastore-form.d.ts +147 -0
  196. package/dist/proxmox/pbs-datastore-form.d.ts.map +1 -0
  197. package/dist/proxmox/pbs-datastore-guard.d.ts +55 -0
  198. package/dist/proxmox/pbs-datastore-guard.d.ts.map +1 -0
  199. package/dist/proxmox/pbs-datastore.d.ts +140 -0
  200. package/dist/proxmox/pbs-datastore.d.ts.map +1 -0
  201. package/dist/proxmox/pbs-prune-job-form.d.ts +97 -0
  202. package/dist/proxmox/pbs-prune-job-form.d.ts.map +1 -0
  203. package/dist/proxmox/pbs-prune-job.d.ts +168 -0
  204. package/dist/proxmox/pbs-prune-job.d.ts.map +1 -0
  205. package/dist/proxmox/pbs-sync-job-form.d.ts +83 -0
  206. package/dist/proxmox/pbs-sync-job-form.d.ts.map +1 -0
  207. package/dist/proxmox/pbs-sync-job.d.ts +246 -0
  208. package/dist/proxmox/pbs-sync-job.d.ts.map +1 -0
  209. package/dist/proxmox/pbs-verify-job-form.d.ts +114 -0
  210. package/dist/proxmox/pbs-verify-job-form.d.ts.map +1 -0
  211. package/dist/proxmox/pbs-verify-job.d.ts +145 -0
  212. package/dist/proxmox/pbs-verify-job.d.ts.map +1 -0
  213. package/dist/proxmox/pool.d.ts +42 -0
  214. package/dist/proxmox/pool.d.ts.map +1 -0
  215. package/dist/proxmox/qemu.d.ts +46 -0
  216. package/dist/proxmox/qemu.d.ts.map +1 -0
  217. package/dist/proxmox/replication-job-form.d.ts +71 -0
  218. package/dist/proxmox/replication-job-form.d.ts.map +1 -0
  219. package/dist/proxmox/replication-job.d.ts +162 -0
  220. package/dist/proxmox/replication-job.d.ts.map +1 -0
  221. package/dist/proxmox/resource.d.ts +157 -0
  222. package/dist/proxmox/resource.d.ts.map +1 -0
  223. package/dist/proxmox/role.d.ts +97 -0
  224. package/dist/proxmox/role.d.ts.map +1 -0
  225. package/dist/proxmox/sdn-apply-read.d.ts +80 -0
  226. package/dist/proxmox/sdn-apply-read.d.ts.map +1 -0
  227. package/dist/proxmox/sdn-apply.d.ts +63 -0
  228. package/dist/proxmox/sdn-apply.d.ts.map +1 -0
  229. package/dist/proxmox/sdn-subnet-form.d.ts +111 -0
  230. package/dist/proxmox/sdn-subnet-form.d.ts.map +1 -0
  231. package/dist/proxmox/sdn-subnet.d.ts +161 -0
  232. package/dist/proxmox/sdn-subnet.d.ts.map +1 -0
  233. package/dist/proxmox/sdn-vnet.d.ts +113 -0
  234. package/dist/proxmox/sdn-vnet.d.ts.map +1 -0
  235. package/dist/proxmox/sdn-zone.d.ts +126 -0
  236. package/dist/proxmox/sdn-zone.d.ts.map +1 -0
  237. package/dist/proxmox/storage.d.ts +120 -0
  238. package/dist/proxmox/storage.d.ts.map +1 -0
  239. package/dist/proxmox/user.d.ts +107 -0
  240. package/dist/proxmox/user.d.ts.map +1 -0
  241. package/dist/proxmox/values.d.ts +134 -0
  242. package/dist/proxmox/values.d.ts.map +1 -0
  243. package/dist/proxmox/zfs-pool-write.d.ts +76 -0
  244. package/dist/proxmox/zfs-pool-write.d.ts.map +1 -0
  245. package/dist/proxmox/zfs-pool.d.ts +146 -0
  246. package/dist/proxmox/zfs-pool.d.ts.map +1 -0
  247. package/dist/talos/credentials.d.ts +30 -0
  248. package/dist/talos/credentials.d.ts.map +1 -0
  249. package/dist/talos/index.d.ts +15 -0
  250. package/dist/talos/index.d.ts.map +1 -0
  251. package/dist/talos/index.js +392 -0
  252. package/dist/talos/index.js.map +16 -0
  253. package/dist/talos/kubeconfig.d.ts +53 -0
  254. package/dist/talos/kubeconfig.d.ts.map +1 -0
  255. package/dist/talos/resource.d.ts +32 -0
  256. package/dist/talos/resource.d.ts.map +1 -0
  257. package/dist/talos/talos-bootstrap.d.ts +27 -0
  258. package/dist/talos/talos-bootstrap.d.ts.map +1 -0
  259. package/dist/talos/talos-cluster-health.d.ts +36 -0
  260. package/dist/talos/talos-cluster-health.d.ts.map +1 -0
  261. package/dist/talos/talos-machine-config.d.ts +41 -0
  262. package/dist/talos/talos-machine-config.d.ts.map +1 -0
  263. package/dist/talos/talosctl.d.ts +29 -0
  264. package/dist/talos/talosctl.d.ts.map +1 -0
  265. package/dist/talos/values.d.ts +20 -0
  266. package/dist/talos/values.d.ts.map +1 -0
  267. package/package.json +57 -0
  268. package/src/cloudflare/client.ts +76 -0
  269. package/src/cloudflare/index.ts +10 -0
  270. package/src/cloudflare/lock-rules.ts +60 -0
  271. package/src/cloudflare/providers.ts +23 -0
  272. package/src/cloudflare/r2-bucket-lock.ts +220 -0
  273. package/src/forgejo/branch-protection-form.ts +29 -0
  274. package/src/forgejo/branch-protection.ts +101 -0
  275. package/src/forgejo/client.ts +136 -0
  276. package/src/forgejo/index.ts +17 -0
  277. package/src/forgejo/org-actions-secrets.ts +99 -0
  278. package/src/forgejo/org-label.ts +100 -0
  279. package/src/forgejo/org-team.ts +105 -0
  280. package/src/forgejo/repo-webhook-form.ts +47 -0
  281. package/src/forgejo/repo-webhook.ts +118 -0
  282. package/src/forgejo/repository.ts +126 -0
  283. package/src/forgejo/resource.ts +171 -0
  284. package/src/forgejo/team-member.ts +97 -0
  285. package/src/forgejo/values.test.ts +48 -0
  286. package/src/forgejo/values.ts +61 -0
  287. package/src/index.ts +18 -0
  288. package/src/openbao/auth-role-form.ts +112 -0
  289. package/src/openbao/auth-role.ts +101 -0
  290. package/src/openbao/bao-address.test.ts +89 -0
  291. package/src/openbao/bao-address.ts +97 -0
  292. package/src/openbao/bao-http-gate.test.ts +88 -0
  293. package/src/openbao/bao-http-unix.test.ts +70 -0
  294. package/src/openbao/bao-http.test.ts +161 -0
  295. package/src/openbao/bao-http.ts +185 -0
  296. package/src/openbao/bao-status.test.ts +114 -0
  297. package/src/openbao/bao-status.ts +137 -0
  298. package/src/openbao/cloudflare-group-scope.test.ts +103 -0
  299. package/src/openbao/cloudflare-group-scope.ts +83 -0
  300. package/src/openbao/cloudflare-parity-catalog.ts +104 -0
  301. package/src/openbao/cloudflare-parity-snapshot.ts +84 -0
  302. package/src/openbao/cloudflare-parity.ts +152 -0
  303. package/src/openbao/cloudflare-permission-groups-solve.test.ts +171 -0
  304. package/src/openbao/cloudflare-permission-groups-solve.ts +197 -0
  305. package/src/openbao/cloudflare-permission-groups.test.ts +369 -0
  306. package/src/openbao/cloudflare-permission-groups.ts +299 -0
  307. package/src/openbao/cloudflare-policy.ts +180 -0
  308. package/src/openbao/cloudflare-role-form.test.ts +177 -0
  309. package/src/openbao/cloudflare-role-form.ts +183 -0
  310. package/src/openbao/cloudflare-role-wire.test.ts +132 -0
  311. package/src/openbao/cloudflare-role-wire.ts +41 -0
  312. package/src/openbao/cloudflare-role.ts +189 -0
  313. package/src/openbao/cloudflare-roles-config.ts +230 -0
  314. package/src/openbao/cloudflare-roles-expand-bucket.test.ts +134 -0
  315. package/src/openbao/cloudflare-roles-expand.ts +231 -0
  316. package/src/openbao/digest.ts +26 -0
  317. package/src/openbao/fake-bao.ts +84 -0
  318. package/src/openbao/forgejo-bootstrap-parse.test.ts +76 -0
  319. package/src/openbao/forgejo-bootstrap-parse.ts +90 -0
  320. package/src/openbao/forgejo-bootstrap.ts +181 -0
  321. package/src/openbao/index.ts +17 -0
  322. package/src/openbao/mount-form.ts +147 -0
  323. package/src/openbao/mount-wire.test.ts +108 -0
  324. package/src/openbao/mount-wire.ts +79 -0
  325. package/src/openbao/mount.ts +132 -0
  326. package/src/openbao/pki-role-form.ts +248 -0
  327. package/src/openbao/pki-role.ts +202 -0
  328. package/src/openbao/policy-assembly.test.ts +28 -0
  329. package/src/openbao/policy-assembly.ts +13 -0
  330. package/src/openbao/policy-wire.test.ts +90 -0
  331. package/src/openbao/policy-wire.ts +53 -0
  332. package/src/openbao/policy.ts +212 -0
  333. package/src/openbao/proxmox-role-form.ts +174 -0
  334. package/src/openbao/proxmox-role.ts +214 -0
  335. package/src/openbao/ssh-role-form.ts +248 -0
  336. package/src/openbao/ssh-role.ts +240 -0
  337. package/src/proxmox/acl.ts +267 -0
  338. package/src/proxmox/api-token-form.ts +122 -0
  339. package/src/proxmox/api-token.ts +222 -0
  340. package/src/proxmox/backup-job.ts +213 -0
  341. package/src/proxmox/ceph-daemon-form.ts +84 -0
  342. package/src/proxmox/ceph-daemon.ts +243 -0
  343. package/src/proxmox/ceph-flag.ts +249 -0
  344. package/src/proxmox/ceph-fs-wire.ts +246 -0
  345. package/src/proxmox/ceph-fs.ts +249 -0
  346. package/src/proxmox/ceph-osd-tree.ts +193 -0
  347. package/src/proxmox/ceph-osd-write.ts +76 -0
  348. package/src/proxmox/ceph-osd.ts +244 -0
  349. package/src/proxmox/ceph-pool-form.ts +249 -0
  350. package/src/proxmox/ceph-pool-settle.ts +70 -0
  351. package/src/proxmox/ceph-pool.ts +212 -0
  352. package/src/proxmox/client.test.ts +185 -0
  353. package/src/proxmox/client.ts +240 -0
  354. package/src/proxmox/credentials.test.ts +144 -0
  355. package/src/proxmox/credentials.ts +254 -0
  356. package/src/proxmox/firewall-alias-form.ts +112 -0
  357. package/src/proxmox/firewall-alias.ts +208 -0
  358. package/src/proxmox/generated/pbs.ts +461 -0
  359. package/src/proxmox/generated/pve.ts +7344 -0
  360. package/src/proxmox/group.ts +199 -0
  361. package/src/proxmox/ha-resource.ts +169 -0
  362. package/src/proxmox/ha-rule-form.ts +185 -0
  363. package/src/proxmox/ha-rule.ts +240 -0
  364. package/src/proxmox/index.ts +42 -0
  365. package/src/proxmox/lease-cache.test.ts +163 -0
  366. package/src/proxmox/lease-cache.ts +131 -0
  367. package/src/proxmox/lxc.ts +117 -0
  368. package/src/proxmox/members.test.ts +54 -0
  369. package/src/proxmox/members.ts +174 -0
  370. package/src/proxmox/metric-server-form.ts +128 -0
  371. package/src/proxmox/metric-server-otel.ts +99 -0
  372. package/src/proxmox/metric-server.ts +214 -0
  373. package/src/proxmox/network-apply-read.ts +228 -0
  374. package/src/proxmox/network-apply.ts +244 -0
  375. package/src/proxmox/node-network-form.ts +213 -0
  376. package/src/proxmox/node-network.ts +243 -0
  377. package/src/proxmox/notification-target-form.ts +104 -0
  378. package/src/proxmox/notification-target.ts +222 -0
  379. package/src/proxmox/pbs-datastore-form.ts +248 -0
  380. package/src/proxmox/pbs-datastore-guard.ts +105 -0
  381. package/src/proxmox/pbs-datastore.ts +271 -0
  382. package/src/proxmox/pbs-prune-job-form.ts +208 -0
  383. package/src/proxmox/pbs-prune-job.ts +227 -0
  384. package/src/proxmox/pbs-sync-job-form.ts +234 -0
  385. package/src/proxmox/pbs-sync-job.ts +258 -0
  386. package/src/proxmox/pbs-verify-job-form.ts +131 -0
  387. package/src/proxmox/pbs-verify-job.ts +227 -0
  388. package/src/proxmox/pool.test.ts +42 -0
  389. package/src/proxmox/pool.ts +80 -0
  390. package/src/proxmox/qemu.ts +89 -0
  391. package/src/proxmox/replication-job-form.ts +89 -0
  392. package/src/proxmox/replication-job.ts +248 -0
  393. package/src/proxmox/resource.ts +257 -0
  394. package/src/proxmox/role.ts +161 -0
  395. package/src/proxmox/sdn-apply-read.test.ts +152 -0
  396. package/src/proxmox/sdn-apply-read.ts +189 -0
  397. package/src/proxmox/sdn-apply.ts +154 -0
  398. package/src/proxmox/sdn-subnet-form.ts +156 -0
  399. package/src/proxmox/sdn-subnet.ts +238 -0
  400. package/src/proxmox/sdn-vnet.ts +228 -0
  401. package/src/proxmox/sdn-zone.ts +246 -0
  402. package/src/proxmox/storage.ts +245 -0
  403. package/src/proxmox/user.ts +214 -0
  404. package/src/proxmox/values.test.ts +193 -0
  405. package/src/proxmox/values.ts +203 -0
  406. package/src/proxmox/zfs-pool-write.ts +130 -0
  407. package/src/proxmox/zfs-pool.ts +253 -0
  408. package/src/talos/credentials.ts +136 -0
  409. package/src/talos/index.ts +14 -0
  410. package/src/talos/kubeconfig.ts +170 -0
  411. package/src/talos/resource.ts +31 -0
  412. package/src/talos/talos-bootstrap.ts +109 -0
  413. package/src/talos/talos-cluster-health.ts +119 -0
  414. package/src/talos/talos-machine-config.ts +146 -0
  415. package/src/talos/talosctl.ts +94 -0
  416. package/src/talos/values.test.ts +80 -0
  417. package/src/talos/values.ts +70 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Timothy Schneider <tim@taslabs.net>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @homeflare/alchemy
2
+
3
+ Custom [Alchemy](https://alchemy.run) providers for gaps the vendor SDK leaves.
4
+
5
+ ```sh
6
+ bun add @homeflare/alchemy alchemy cloudflare effect
7
+ ```
8
+
9
+ ★ **Why a custom provider at all.** When Alchemy has no property for something, the
10
+ alternative is a runbook step a human runs once — and a plan can never show a missing
11
+ runbook step. Covering the gap with a resource means the drift is visible in `plan` like
12
+ everything else.
13
+
14
+ ## R2BucketLock
15
+
16
+ An R2 bucket's lock rules, declared rather than applied by hand. A lock rule is a
17
+ **retention floor**: while a rule covers an object, no API call, no lifecycle rule and no
18
+ credential can delete it.
19
+
20
+ ```ts
21
+ import { R2BucketLock } from '@homeflare/alchemy';
22
+ import { providers } from '@homeflare/alchemy/providers';
23
+
24
+ export class BackupLock extends R2BucketLock('backup-lock', {
25
+ bucketName: 'my-backups',
26
+ jurisdiction: 'default',
27
+ rules: [{ id: 'keep-30d', enabled: true, condition: { type: 'Age', maxAgeSeconds: 2_592_000 } }],
28
+ }) {}
29
+ ```
30
+
31
+ Add the provider layer to your stack:
32
+
33
+ ```ts
34
+ import { providers } from '@homeflare/alchemy/providers';
35
+ // …then provide `providers()` alongside Cloudflare.providers()
36
+ ```
37
+
38
+ ⚠️ **The rule set is REPLACE, not merge.** The API `PUT`s the whole set, so a rule omitted
39
+ from `rules` is a rule deleted. That is the same shape as the Cloudflare API itself.
40
+
41
+ ⛔ **Deletion is refused by design.** Removing a lock is removing a retention floor, which
42
+ is the one operation this resource exists to make hard. It retains on destroy.
43
+
44
+ ## Credentials
45
+
46
+ `CLOUDFLARE_API_TOKEN` is read from the environment at call time, never at module scope.
47
+
48
+ ⛔ **Mint a short-lived, scoped token** — do not reuse a long-lived one, and never a Global
49
+ API Key. An empty value fails closed with a message saying so, because an empty render is
50
+ a denied grant rather than a missing file, and `Bearer ` + nothing 401s in a way that reads
51
+ like a bad credential.
52
+
53
+ ## Peers
54
+
55
+ `alchemy` >= 2.0.0-beta.77 · `cloudflare` >= 4.5.0 · `effect` >= 4.0.0-rc.112
56
+
57
+ ⚠️ Peers, not dependencies: Alchemy's resource registry and Effect's context both break if
58
+ two copies load in one process.
59
+
60
+ ## License
61
+
62
+ MIT © Timothy Schneider
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The Cloudflare REST API as an Effect service, over `cloudflare-typescript`. Codex standard 5:
3
+ * the vendor's SDK, never a hand-rolled client — and never a hand-rolled `fetch` either.
4
+ *
5
+ * ⛔ THE SDK WAS ALREADY IN THE STORE AND DECLARED BY NOBODY. Measured 2026-09-15:
6
+ * `node_modules/.pnpm/cloudflare@4.5.0` exists as a transitive dependency of `alchemy`, and
7
+ * `pnpm ls cloudflare --depth 0` at the root and in every workspace package returns nothing.
8
+ * `house/local/scripts/vendor-sdk-ratchet.ts` row R2 says exactly that — "not declared anywhere
9
+ * in the workspace yet … the row adds the dependency once, then converts the TS callers" — so
10
+ * this package is that row's first half, and the twenty ratcheted offences keep their rows.
11
+ *
12
+ * ⛔ AND IT IS PINNED EXACTLY, NOT `catalog:`. There is no catalog entry for `cloudflare`, and the
13
+ * version that resolves today is the one alchemy pulls in. Pinning `4.5.0` means a future
14
+ * alchemy bump moves alchemy's copy and not this package's contract — the alternative is a
15
+ * provider whose request shape changes because an unrelated dependency was upgraded.
16
+ *
17
+ * ⚠️ `fetch` IS A SEAM, NOT A CONVENIENCE — the same argument `packages/litellm-client` makes. The
18
+ * SDK hands its custom fetch the URL and init it built, so a test double conforming to
19
+ * `Core.Fetch` exercises the real path assembly, the real body serialisation and the real header
20
+ * set. A test that stubbed `client.r2.buckets.locks.update` would prove only that a stub was
21
+ * called, which is precisely the class of check this estate keeps finding green over nothing.
22
+ */
23
+ import Cloudflare from 'cloudflare';
24
+ import * as Context from 'effect/Context';
25
+ import * as Layer from 'effect/Layer';
26
+ /** What the SDK accepts for `fetch`, restated so tests can name it without importing SDK internals. */
27
+ export type ClientFetch = (url: string | URL | Request, init?: RequestInit) => Promise<Response>;
28
+ declare const CloudflareApi_base: Context.ServiceClass<CloudflareApi, "homeflare/CloudflareApi", Cloudflare>;
29
+ export declare class CloudflareApi extends CloudflareApi_base {
30
+ }
31
+ /**
32
+ * ⚠️ THE FAKE FETCH IS THE ONLY REASON THIS TAKES OPTIONS AT ALL. Everything else the SDK reads
33
+ * from the environment the estate CLI already populates.
34
+ */
35
+ export declare const makeClient: (options: {
36
+ apiToken: string;
37
+ fetch?: ClientFetch;
38
+ }) => Cloudflare;
39
+ /**
40
+ * ⛔ A LAYER'S ERROR CHANNEL MUST BE `never`, so a ConfigError becomes a defect carrying a sentence
41
+ * rather than a type error pushed up into `Stack`. Same decision, same words, as `LiteLLMLive`.
42
+ */
43
+ export declare const CloudflareApiLive: Layer.Layer<CloudflareApi, never, never>;
44
+ export {};
45
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/cloudflare/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,uGAAuG;AACvG,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;;AAEjG,qBAAa,aAAc,SAAQ,kBAElC;CAAG;AAEJ;;;GAGG;AACH,eAAO,MAAM,UAAU,YAAa;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,WAAW,CAAA;CAAE,KAAG,UAI5E,CAAC;AAiBL;;;GAGG;AACH,eAAO,MAAM,iBAAiB,0CAU7B,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Cloudflare providers for Alchemy — the gaps the vendor SDK leaves.
3
+ *
4
+ * ★ Built on the official `cloudflare` SDK, not hand-rolled HTTP: it already has
5
+ * `r2.buckets.locks.update/get` over the documented endpoints, so there is no path
6
+ * string this package invents.
7
+ */
8
+ export type { R2LockRule } from './lock-rules.ts';
9
+ export { R2BucketLock, type R2BucketLockProps } from './r2-bucket-lock.ts';
10
+ export { providers } from './providers.ts';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,129 @@
1
+ // src/cloudflare/r2-bucket-lock.ts
2
+ import { Unowned } from "alchemy/AdoptPolicy";
3
+ import * as Provider from "alchemy/Provider";
4
+ import { Resource } from "alchemy/Resource";
5
+ import { NotFoundError } from "cloudflare";
6
+ import * as Effect2 from "effect/Effect";
7
+
8
+ // src/cloudflare/client.ts
9
+ import Cloudflare from "cloudflare";
10
+ import * as Config from "effect/Config";
11
+ import * as Context from "effect/Context";
12
+ import * as Effect from "effect/Effect";
13
+ import * as Layer from "effect/Layer";
14
+ import * as Redacted from "effect/Redacted";
15
+
16
+ class CloudflareApi extends Context.Service()("homeflare/CloudflareApi") {
17
+ }
18
+ var makeClient = (options) => new Cloudflare({
19
+ apiToken: options.apiToken,
20
+ ...options.fetch === undefined ? {} : { fetch: options.fetch }
21
+ });
22
+ var MISSING_TOKEN = "CLOUDFLARE_API_TOKEN is not set. Mint a short-lived, scoped token and export it before " + "role named in estate.stack.ts; running `alchemy` directly skips that and there is no default.";
23
+ var EMPTY_TOKEN = "CLOUDFLARE_API_TOKEN is set but EMPTY. That is a denied or missing OpenBao grant on the " + "stack’s role, not a rotated token — re-mint it rather than rotating anything at Cloudflare.";
24
+ var CloudflareApiLive = Layer.effect(CloudflareApi, Effect.gen(function* () {
25
+ const token = yield* Config.redacted("CLOUDFLARE_API_TOKEN").pipe(Effect.catchTag("ConfigError", () => Effect.die(new Error(MISSING_TOKEN))));
26
+ const value2 = Redacted.value(token);
27
+ if (value2.length === 0)
28
+ return yield* Effect.die(new Error(EMPTY_TOKEN));
29
+ return makeClient({ apiToken: value2 });
30
+ }));
31
+
32
+ // src/cloudflare/lock-rules.ts
33
+ var jurisdictionOf = (props) => props.jurisdiction ?? "default";
34
+ function rulesEqual(a, b) {
35
+ if (a.length !== b.length)
36
+ return false;
37
+ return a.every((left, index) => {
38
+ const right = b[index];
39
+ if (right === undefined)
40
+ return false;
41
+ if (left.id !== right.id || left.enabled !== right.enabled)
42
+ return false;
43
+ if ((left.prefix ?? "") !== (right.prefix ?? ""))
44
+ return false;
45
+ const [lc, rc] = [left.condition, right.condition];
46
+ if (lc.type !== rc.type)
47
+ return false;
48
+ if (lc.type === "Age")
49
+ return rc.type === "Age" && lc.maxAgeSeconds === rc.maxAgeSeconds;
50
+ if (lc.type === "Date")
51
+ return rc.type === "Date" && lc.date === rc.date;
52
+ return true;
53
+ });
54
+ }
55
+ var toBody = (rules) => ({
56
+ rules: rules.map((rule) => ({ ...rule }))
57
+ });
58
+
59
+ // src/cloudflare/r2-bucket-lock.ts
60
+ var R2BucketLock = Resource("Cloudflare.R2BucketLock", {
61
+ defaultRemovalPolicy: "retain"
62
+ });
63
+ var readLock = (client, props, written) => Effect2.gen(function* () {
64
+ const jurisdiction = jurisdictionOf(props);
65
+ const live = yield* Effect2.tryPromise({
66
+ try: () => client.r2.buckets.locks.get(props.bucketName, {
67
+ account_id: props.accountId,
68
+ jurisdiction
69
+ }),
70
+ catch: (cause) => cause
71
+ }).pipe(Effect2.catchIf((cause) => cause instanceof NotFoundError, () => Effect2.succeed(undefined)), Effect2.orDie);
72
+ if (live === undefined)
73
+ return;
74
+ const rules = live.rules ?? [];
75
+ if (rules.length === 0)
76
+ return;
77
+ const attributes = {
78
+ bucketName: props.bucketName,
79
+ jurisdiction,
80
+ rules
81
+ };
82
+ return written ? attributes : Unowned(attributes);
83
+ });
84
+ var reconcileLock = (client, news, output) => Effect2.gen(function* () {
85
+ const jurisdiction = jurisdictionOf(news);
86
+ if (output !== undefined && rulesEqual(output.rules, news.rules))
87
+ return output;
88
+ yield* Effect2.promise(() => client.r2.buckets.locks.update(news.bucketName, {
89
+ account_id: news.accountId,
90
+ jurisdiction,
91
+ ...toBody(news.rules)
92
+ }));
93
+ return { bucketName: news.bucketName, jurisdiction, rules: news.rules };
94
+ });
95
+ var deleteLock = (client, output, accountId) => Effect2.gen(function* () {
96
+ yield* Effect2.promise(() => client.r2.buckets.locks.update(output.bucketName, {
97
+ account_id: accountId,
98
+ jurisdiction: output.jurisdiction,
99
+ rules: []
100
+ }));
101
+ });
102
+ var R2BucketLockProvider = () => Provider.effect(R2BucketLock, Effect2.gen(function* () {
103
+ const client = yield* CloudflareApi;
104
+ return R2BucketLock.Provider.of({
105
+ list: () => Effect2.succeed([]),
106
+ nuke: { singleton: true },
107
+ read: Effect2.fn(function* ({ olds, output }) {
108
+ const props = olds ?? undefined;
109
+ if (props === undefined)
110
+ return;
111
+ return yield* readLock(client, props, output !== undefined);
112
+ }),
113
+ reconcile: Effect2.fn(({ news, output }) => reconcileLock(client, news, output)),
114
+ delete: Effect2.fn(({ olds, output }) => deleteLock(client, output, olds.accountId))
115
+ });
116
+ }));
117
+ // src/cloudflare/providers.ts
118
+ import * as Provider2 from "alchemy/Provider";
119
+ import * as Layer2 from "effect/Layer";
120
+ class Providers extends Provider2.ProviderCollection()("HomeflareCloudflare") {
121
+ }
122
+ var providers = () => Layer2.effect(Providers, Provider2.collection([R2BucketLock])).pipe(Layer2.provide(R2BucketLockProvider()), Layer2.provideMerge(CloudflareApiLive));
123
+ export {
124
+ R2BucketLock,
125
+ providers
126
+ };
127
+
128
+ //# debugId=DE23078825F2DFD564756E2164756E21
129
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cloudflare/r2-bucket-lock.ts", "../src/cloudflare/client.ts", "../src/cloudflare/lock-rules.ts", "../src/cloudflare/providers.ts"],
4
+ "sourcesContent": [
5
+ "import { Unowned } from 'alchemy/AdoptPolicy';\nimport * as Provider from 'alchemy/Provider';\nimport { Resource, type ResourceClass } from 'alchemy/Resource';\n/**\n * `Cloudflare.R2BucketLock` — the lock rule set on one R2 bucket, declared rather than applied by\n * hand. A bucket lock is a RETENTION FLOOR: while a rule covers an object, no API call, no\n * lifecycle rule and no credential can delete it.\n *\n * 🔴 WHY THIS EXISTS AT ALL, AND WHAT IT REPLACES. a consuming stack shipped the retention floor as a\n * documented `wrangler r2 bucket lock add …` step in the runbook, on the measured ground that\n * `alchemy@2.0.0-beta.77` has no lock property anywhere in its R2 namespace. That measurement is\n * still true and it was the wrong conclusion: a step a human runs once is a step an Alchemy plan\n * can never show missing, so removing the floor by hand leaves that stack, its plan and\n * every gate completely green. The operator's rule (2026-09-15) is to cover such a gap with a\n * custom resource over the vendor's SDK, which is what this is.\n *\n * ⛔ THE SDK ALREADY HAD IT, AND THAT IS WORTH SAYING BECAUSE IT DECIDED THE SHAPE. Measured\n * 2026-09-15 in `cloudflare@4.5.0`, `resources/r2/buckets/locks.d.ts`:\n *\n * update(bucketName: string, params: LockUpdateParams, options?): APIPromise<…>\n * get(bucketName: string, params: LockGetParams, options?): APIPromise<LockGetResponse>\n *\n * over `PUT`/`GET /accounts/{account_id}/r2/buckets/{bucket_name}/lock` with the jurisdiction\n * carried as the `cf-r2-jurisdiction` header (`locks.mjs:17` and `:41`). So there is no raw\n * `client.put` fallback here and no path string this package invented — the fallback the rule\n * allows was not needed.\n *\n * ⚠️ THE RULE SET IS A REPLACE, NOT A MERGE. `PUT` takes the WHOLE list, exactly like R2's\n * lifecycle rules — which is the trap a consuming stack records for\n * `homeflare-git`. Declaring this resource on a bucket whose live rules nobody has read would\n * drop them, so `read` fetches them first and `reconcile` refuses to write when they already\n * match.\n */\nimport type Cloudflare from 'cloudflare';\nimport { NotFoundError } from 'cloudflare';\nimport * as Effect from 'effect/Effect';\nimport { CloudflareApi } from './client.ts';\nimport {\n type Jurisdiction,\n type R2LockRule,\n jurisdictionOf,\n rulesEqual,\n toBody,\n} from './lock-rules.ts';\nimport type { Providers } from './providers.ts';\n\nexport interface R2BucketLockProps {\n readonly accountId: string;\n readonly bucketName: string;\n /** ⚠️ Part of the bucket's IDENTITY, not a preference — a bucket in another jurisdiction is another bucket. */\n readonly jurisdiction?: Jurisdiction;\n /**\n * ⛔ REQUIRED, AND ITS EMPTY VALUE IS THE DANGEROUS ONE. `rules: []` means NO FLOOR: it is what\n * `delete` sends to take a lock off deliberately. An optional property would let a declaration\n * that simply forgot it send `[]` and silently unlock the repository, reporting success — the\n * same reasoning `LiteLLM.McpServer.allowedTools` is required for.\n */\n readonly rules: readonly R2LockRule[];\n}\n\nexport type R2BucketLockAttributes = {\n readonly bucketName: string;\n readonly jurisdiction: Jurisdiction;\n readonly rules: readonly R2LockRule[];\n};\n\nexport interface R2BucketLock extends Resource<\n 'Cloudflare.R2BucketLock',\n R2BucketLockProps,\n R2BucketLockAttributes,\n never,\n Providers\n> {}\n\n// ⚠️ EXPLICIT ANNOTATION, REQUIRED BY isolatedDeclarations. This file was internal to a\n// monorepo before it was published; a published package emits its .d.ts from a separate\n// tsc pass, so every exported symbol must state its type rather than infer it.\nexport const R2BucketLock: ResourceClass<R2BucketLock> = Resource<R2BucketLock>(\n 'Cloudflare.R2BucketLock',\n {\n /**\n * ⛔ RETAIN, AND ON THIS RESOURCE IT IS NOT THE ESTATE'S HABIT BUT THE WHOLE POINT. A lock is a\n * safety floor: removing the declaration must not remove the floor, because the state it\n * protects is the only physical backup of the estate's one Postgres. `delete` below is\n * implemented — a provider that cannot delete cannot be tested or corrected — and it is\n * reachable only by an operator running the CLI directly, past a deploy wrapper.\n */\n defaultRemovalPolicy: 'retain',\n },\n);\n\n/**\n * 🔴 A 404 HERE IS \"NOTHING TO ADOPT\", AND THE FIRST PLAN PROVED IT IS THE ORDINARY CASE.\n * Measured 2026-09-15, an alchemy plan --detailed on a bucket that does not\n * exist yet: `404 {\"success\":false,\"errors\":[{\"code\":10006,\"message\":\"The specified bucket does\n * not exist.\"}]}` — raised from `read`, during PLANNING, before anything is created. Alchemy\n * calls `read` for a resource with no prior state, so on every first deploy the lock is asked\n * about a bucket the same plan is about to create. Letting that throw makes the resource\n * impossible to plan; swallowing it with `catchAll` would also hide a 403 from a mis-scoped\n * token, which is the failure this estate spends the most time on. So: 404 → absent, everything\n * else propagates.\n *\n * ⛔ AN EMPTY LIVE RULE SET IS \"NO LOCK\", NOT \"A LOCK WITH NOTHING IN IT\", so it reads as absent\n * and the resource CREATES. The API answers `{}` for a bucket that has never been locked and\n * `{ rules: [] }` for one whose rules were removed; both mean the floor is gone.\n * ⚠️ `Unowned` UNTIL THIS STACK HAS WRITTEN IT. A lock someone applied by hand — which is exactly\n * what the retired runbook step did — must not be silently rewritten by a mistyped declaration;\n * the planner refuses until the resource is piped through `adopt(true)`, which is one line an\n * operator reads in the diff. An adopted rule set that already MATCHES then costs no request at\n * all, because `reconcile` below returns before writing.\n */\nexport const readLock = (\n client: Cloudflare,\n props: { accountId: string; bucketName: string; jurisdiction?: Jurisdiction },\n written: boolean,\n): Effect.Effect<R2BucketLockAttributes | undefined> =>\n Effect.gen(function* () {\n const jurisdiction = jurisdictionOf(props);\n const live = yield* Effect.tryPromise({\n try: () =>\n client.r2.buckets.locks.get(props.bucketName, {\n account_id: props.accountId,\n jurisdiction,\n }),\n catch: (cause) => cause,\n }).pipe(\n Effect.catchIf(\n (cause) => cause instanceof NotFoundError,\n () => Effect.succeed(undefined),\n ),\n Effect.orDie,\n );\n if (live === undefined) return undefined;\n const rules = (live.rules ?? []) as readonly R2LockRule[];\n if (rules.length === 0) return undefined;\n const attributes: R2BucketLockAttributes = {\n bucketName: props.bucketName,\n jurisdiction,\n rules,\n };\n return written ? attributes : Unowned(attributes);\n });\n\n/**\n * ⛔ A NO-OP MAKES NO REQUEST, AND ON A LOCK THAT MATTERS MORE THAN TIDINESS. `PUT` replaces the\n * rule set; re-sending an identical one on every deploy is a write against the only thing\n * standing between this repository and a delete, for no change. `output` is what the last deploy\n * persisted (or what `read` just adopted), so the comparison costs nothing either.\n */\nexport const reconcileLock = (\n client: Cloudflare,\n news: R2BucketLockProps,\n output: R2BucketLockAttributes | undefined,\n): Effect.Effect<R2BucketLockAttributes> =>\n Effect.gen(function* () {\n const jurisdiction = jurisdictionOf(news);\n if (output !== undefined && rulesEqual(output.rules, news.rules)) return output;\n yield* Effect.promise(() =>\n client.r2.buckets.locks.update(news.bucketName, {\n account_id: news.accountId,\n jurisdiction,\n ...toBody(news.rules),\n }),\n );\n return { bucketName: news.bucketName, jurisdiction, rules: news.rules };\n });\n\n/**\n * ⛔ DELETING THIS RESOURCE MEANS PUTTING AN EMPTY RULE SET, WHICH IS UNLOCKING THE BUCKET. It is\n * implemented because the retirement path is real — R2 refuses to empty a bucket while any lock\n * rule is configured, so retiring the repository has to start here — and it is behind\n * `defaultRemovalPolicy: 'retain'` and the estate CLI's refusal of `destroy` precisely because\n * no ordinary deploy should ever reach it.\n */\nexport const deleteLock = (\n client: Cloudflare,\n output: R2BucketLockAttributes,\n accountId: string,\n): Effect.Effect<void> =>\n Effect.gen(function* () {\n yield* Effect.promise(() =>\n client.r2.buckets.locks.update(output.bucketName, {\n account_id: accountId,\n jurisdiction: output.jurisdiction,\n rules: [],\n }),\n );\n });\n\nexport const R2BucketLockProvider = () =>\n Provider.effect(\n R2BucketLock,\n Effect.gen(function* () {\n const client = yield* CloudflareApi;\n return R2BucketLock.Provider.of({\n /**\n * ⛔ EMPTY, AND ALCHEMY'S OWN CONTRACT ASKS FOR EXACTLY THAT. `ProviderService.list`:\n * \"Resources with no native enumeration API (… sub-resources keyed entirely by a parent)\n * should return an empty array rather than throwing.\" There is no list-locks endpoint —\n * a lock is reachable only through the bucket that owns it — so enumerating would mean\n * listing every bucket in the account and GETting each one's lock.\n * ⛔⛔ AND `nuke.singleton` IS WHY THAT IS NOT MERELY UNAVAILABLE BUT UNWANTED. `list`\n * feeds `alchemy unsafe nuke`, which lists and then deletes; `delete` here is an UNLOCK.\n * A working enumeration would hand one command the ability to strip the retention floor\n * off every bucket in the account — the precise event a floor exists to make impossible.\n * `singleton` is the documented word for it: always-present configuration whose delete\n * resets rather than removes.\n */\n list: () => Effect.succeed([]),\n nuke: { singleton: true },\n read: Effect.fn(function* ({ olds, output }) {\n const props = olds ?? undefined;\n if (props === undefined) return undefined;\n return yield* readLock(client, props, output !== undefined);\n }),\n reconcile: Effect.fn(({ news, output }) => reconcileLock(client, news, output)),\n delete: Effect.fn(({ olds, output }) => deleteLock(client, output, olds.accountId)),\n });\n }),\n );\n",
6
+ "/**\n * The Cloudflare REST API as an Effect service, over `cloudflare-typescript`. Codex standard 5:\n * the vendor's SDK, never a hand-rolled client — and never a hand-rolled `fetch` either.\n *\n * ⛔ THE SDK WAS ALREADY IN THE STORE AND DECLARED BY NOBODY. Measured 2026-09-15:\n * `node_modules/.pnpm/cloudflare@4.5.0` exists as a transitive dependency of `alchemy`, and\n * `pnpm ls cloudflare --depth 0` at the root and in every workspace package returns nothing.\n * `house/local/scripts/vendor-sdk-ratchet.ts` row R2 says exactly that — \"not declared anywhere\n * in the workspace yet … the row adds the dependency once, then converts the TS callers\" — so\n * this package is that row's first half, and the twenty ratcheted offences keep their rows.\n *\n * ⛔ AND IT IS PINNED EXACTLY, NOT `catalog:`. There is no catalog entry for `cloudflare`, and the\n * version that resolves today is the one alchemy pulls in. Pinning `4.5.0` means a future\n * alchemy bump moves alchemy's copy and not this package's contract — the alternative is a\n * provider whose request shape changes because an unrelated dependency was upgraded.\n *\n * ⚠️ `fetch` IS A SEAM, NOT A CONVENIENCE — the same argument `packages/litellm-client` makes. The\n * SDK hands its custom fetch the URL and init it built, so a test double conforming to\n * `Core.Fetch` exercises the real path assembly, the real body serialisation and the real header\n * set. A test that stubbed `client.r2.buckets.locks.update` would prove only that a stub was\n * called, which is precisely the class of check this estate keeps finding green over nothing.\n */\nimport Cloudflare from 'cloudflare';\nimport * as Config from 'effect/Config';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Redacted from 'effect/Redacted';\n\n/** What the SDK accepts for `fetch`, restated so tests can name it without importing SDK internals. */\nexport type ClientFetch = (url: string | URL | Request, init?: RequestInit) => Promise<Response>;\n\nexport class CloudflareApi extends Context.Service<CloudflareApi, Cloudflare>()(\n 'homeflare/CloudflareApi',\n) {}\n\n/**\n * ⚠️ THE FAKE FETCH IS THE ONLY REASON THIS TAKES OPTIONS AT ALL. Everything else the SDK reads\n * from the environment the estate CLI already populates.\n */\nexport const makeClient = (options: { apiToken: string; fetch?: ClientFetch }): Cloudflare =>\n new Cloudflare({\n apiToken: options.apiToken,\n ...(options.fetch === undefined ? {} : { fetch: options.fetch }),\n });\n\n/**\n * ⛔ FAIL CLOSED ON THE VALUE, NEVER ON THE VARIABLE EXISTING. AGENTS.md \"the four that cost the\n * most\" §4: a denied OpenBao path renders the template EMPTY rather than erroring, and every\n * Cloudflare call then answers 403 exactly like a revoked token — which sends the operator to\n * Cloudflare to rotate a credential that was fine. Your deploy wrapper should write\n * CLOUDFLARE_API_TOKEN from the stack's declared role, short-lived and scoped.\n */\nconst MISSING_TOKEN =\n 'CLOUDFLARE_API_TOKEN is not set. Mint a short-lived, scoped token and export it before ' +\n 'role named in estate.stack.ts; running `alchemy` directly skips that and there is no default.';\n\nconst EMPTY_TOKEN =\n 'CLOUDFLARE_API_TOKEN is set but EMPTY. That is a denied or missing OpenBao grant on the ' +\n 'stack’s role, not a rotated token — re-mint it rather than rotating anything at Cloudflare.';\n\n/**\n * ⛔ A LAYER'S ERROR CHANNEL MUST BE `never`, so a ConfigError becomes a defect carrying a sentence\n * rather than a type error pushed up into `Stack`. Same decision, same words, as `LiteLLMLive`.\n */\nexport const CloudflareApiLive = Layer.effect(\n CloudflareApi,\n Effect.gen(function* () {\n const token = yield* Config.redacted('CLOUDFLARE_API_TOKEN').pipe(\n Effect.catchTag('ConfigError', () => Effect.die(new Error(MISSING_TOKEN))),\n );\n const value = Redacted.value(token);\n if (value.length === 0) return yield* Effect.die(new Error(EMPTY_TOKEN));\n return makeClient({ apiToken: value });\n }),\n);\n",
7
+ "/**\n * The vocabulary of an R2 lock rule, and the comparison that decides whether to write one.\n *\n * ★ ITS OWN MODULE FOR THE REASON `house/litellm/src/equal.ts` IS ONE: the comparison is the\n * riskiest function in the provider and it deserves to be readable and testable without the\n * lifecycle around it. An equality that returned true for everything would make every reconcile\n * a no-op and the resource would silently never write anything — which looks exactly like a\n * converged stack.\n */\n/** Jurisdictions the API accepts, as the SDK declares them. */\nexport type Jurisdiction = 'default' | 'eu' | 'fedramp';\n\n/**\n * One lock rule. ⚠️ `prefix` OMITTED MEANS THE WHOLE BUCKET — the SDK documents an empty prefix as\n * the way to scope a rule to every object, and omitting the key is how that is spelled on the wire.\n */\nexport type R2LockRule = {\n readonly id: string;\n readonly enabled: boolean;\n readonly prefix?: string;\n readonly condition:\n | { readonly type: 'Age'; readonly maxAgeSeconds: number }\n | { readonly type: 'Date'; readonly date: string }\n | { readonly type: 'Indefinite' };\n};\n\n/** ⚠️ `undefined` and `'default'` are the same jurisdiction; normalise so a diff never sees both. */\nexport const jurisdictionOf = (props: { readonly jurisdiction?: Jurisdiction }): Jurisdiction =>\n props.jurisdiction ?? 'default';\n\n/**\n * ⛔ FIELD BY FIELD, IN ORDER, AND NOT `JSON.stringify` OF EITHER SIDE. The API returns rules in\n * its own key order and omits `prefix` where this repo may spell it `''`; a stringify compare\n * would report drift on every plan and PUT an identical body each deploy. Order across the list\n * IS compared, because the rule set is a replace and the list is what gets sent.\n */\nexport function rulesEqual(a: readonly R2LockRule[], b: readonly R2LockRule[]): boolean {\n if (a.length !== b.length) return false;\n return a.every((left, index) => {\n const right = b[index];\n if (right === undefined) return false;\n if (left.id !== right.id || left.enabled !== right.enabled) return false;\n if ((left.prefix ?? '') !== (right.prefix ?? '')) return false;\n const [lc, rc] = [left.condition, right.condition];\n if (lc.type !== rc.type) return false;\n if (lc.type === 'Age') return rc.type === 'Age' && lc.maxAgeSeconds === rc.maxAgeSeconds;\n if (lc.type === 'Date') return rc.type === 'Date' && lc.date === rc.date;\n return true;\n });\n}\n\n/**\n * The body the SDK sends. Split out so the test can assert the wire shape against one function.\n *\n * ⚠️ IT TAKES THE RULES, NOT THE PROPS, so this module names nothing from the resource — the\n * comparison and the vocabulary stay readable without the lifecycle around them.\n */\nexport const toBody = (rules: readonly R2LockRule[]): { rules: R2LockRule[] } => ({\n rules: rules.map((rule) => ({ ...rule })),\n});\n",
8
+ "/**\n * The HomeFlare Cloudflare provider collection, in the shape `LiteLLM.providers()` has.\n *\n * ★ ONE LAYER, BUILT ONCE, so the single `Config.redacted('CLOUDFLARE_API_TOKEN')` read is shared\n * by every resource in the stack rather than repeated per resource.\n *\n * ⚠️ THIS IS NOT `alchemy/Cloudflare`'s COLLECTION AND DOES NOT REPLACE IT. A stack that declares\n * both a `Cloudflare.R2.Bucket` and this lock merges the two:\n * `Layer.mergeAll(Cloudflare.providers(), HomeflareCloudflare.providers())` — the shape\n * a consuming stack names for one talking to more than one account.\n */\nimport * as Provider from 'alchemy/Provider';\nimport * as Layer from 'effect/Layer';\nimport { CloudflareApiLive } from './client.ts';\nimport { R2BucketLock, R2BucketLockProvider } from './r2-bucket-lock.ts';\n\nexport class Providers extends Provider.ProviderCollection<Providers>()('HomeflareCloudflare') {}\n\nexport const providers = () =>\n Layer.effect(Providers, Provider.collection([R2BucketLock])).pipe(\n Layer.provide(R2BucketLockProvider()),\n Layer.provideMerge(CloudflareApiLive),\n );\n"
9
+ ],
10
+ "mappings": "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",
11
+ "debugId": "DE23078825F2DFD564756E2164756E21",
12
+ "names": []
13
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The vocabulary of an R2 lock rule, and the comparison that decides whether to write one.
3
+ *
4
+ * ★ ITS OWN MODULE FOR THE REASON `house/litellm/src/equal.ts` IS ONE: the comparison is the
5
+ * riskiest function in the provider and it deserves to be readable and testable without the
6
+ * lifecycle around it. An equality that returned true for everything would make every reconcile
7
+ * a no-op and the resource would silently never write anything — which looks exactly like a
8
+ * converged stack.
9
+ */
10
+ /** Jurisdictions the API accepts, as the SDK declares them. */
11
+ export type Jurisdiction = 'default' | 'eu' | 'fedramp';
12
+ /**
13
+ * One lock rule. ⚠️ `prefix` OMITTED MEANS THE WHOLE BUCKET — the SDK documents an empty prefix as
14
+ * the way to scope a rule to every object, and omitting the key is how that is spelled on the wire.
15
+ */
16
+ export type R2LockRule = {
17
+ readonly id: string;
18
+ readonly enabled: boolean;
19
+ readonly prefix?: string;
20
+ readonly condition: {
21
+ readonly type: 'Age';
22
+ readonly maxAgeSeconds: number;
23
+ } | {
24
+ readonly type: 'Date';
25
+ readonly date: string;
26
+ } | {
27
+ readonly type: 'Indefinite';
28
+ };
29
+ };
30
+ /** ⚠️ `undefined` and `'default'` are the same jurisdiction; normalise so a diff never sees both. */
31
+ export declare const jurisdictionOf: (props: {
32
+ readonly jurisdiction?: Jurisdiction;
33
+ }) => Jurisdiction;
34
+ /**
35
+ * ⛔ FIELD BY FIELD, IN ORDER, AND NOT `JSON.stringify` OF EITHER SIDE. The API returns rules in
36
+ * its own key order and omits `prefix` where this repo may spell it `''`; a stringify compare
37
+ * would report drift on every plan and PUT an identical body each deploy. Order across the list
38
+ * IS compared, because the rule set is a replace and the list is what gets sent.
39
+ */
40
+ export declare function rulesEqual(a: readonly R2LockRule[], b: readonly R2LockRule[]): boolean;
41
+ /**
42
+ * The body the SDK sends. Split out so the test can assert the wire shape against one function.
43
+ *
44
+ * ⚠️ IT TAKES THE RULES, NOT THE PROPS, so this module names nothing from the resource — the
45
+ * comparison and the vocabulary stay readable without the lifecycle around them.
46
+ */
47
+ export declare const toBody: (rules: readonly R2LockRule[]) => {
48
+ rules: R2LockRule[];
49
+ };
50
+ //# sourceMappingURL=lock-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-rules.d.ts","sourceRoot":"","sources":["../../src/cloudflare/lock-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EACd;QAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GACxD;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAChD;QAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC;CACrC,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,cAAc,UAAW;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAE,KAAG,YAChD,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,UAAU,EAAE,EAAE,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAatF;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM,UAAW,SAAS,UAAU,EAAE,KAAG;IAAE,KAAK,EAAE,UAAU,EAAE,CAAA;CAEzE,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The HomeFlare Cloudflare provider collection, in the shape `LiteLLM.providers()` has.
3
+ *
4
+ * ★ ONE LAYER, BUILT ONCE, so the single `Config.redacted('CLOUDFLARE_API_TOKEN')` read is shared
5
+ * by every resource in the stack rather than repeated per resource.
6
+ *
7
+ * ⚠️ THIS IS NOT `alchemy/Cloudflare`'s COLLECTION AND DOES NOT REPLACE IT. A stack that declares
8
+ * both a `Cloudflare.R2.Bucket` and this lock merges the two:
9
+ * `Layer.mergeAll(Cloudflare.providers(), HomeflareCloudflare.providers())` — the shape
10
+ * a consuming stack names for one talking to more than one account.
11
+ */
12
+ import * as Provider from 'alchemy/Provider';
13
+ import * as Layer from 'effect/Layer';
14
+ declare const Providers_base: Provider.ProviderCollection<Providers, "HomeflareCloudflare">;
15
+ export declare class Providers extends Providers_base {
16
+ }
17
+ export declare const providers: () => Layer.Layer<import("./client.ts").CloudflareApi | Providers, never, never>;
18
+ export {};
19
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/cloudflare/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;;AAItC,qBAAa,SAAU,SAAQ,cAA+D;CAAG;AAEjG,eAAO,MAAM,SAAS,kFAInB,CAAC"}
@@ -0,0 +1,100 @@
1
+ import * as Provider from 'alchemy/Provider';
2
+ import { Resource, type ResourceClass } from 'alchemy/Resource';
3
+ /**
4
+ * `Cloudflare.R2BucketLock` — the lock rule set on one R2 bucket, declared rather than applied by
5
+ * hand. A bucket lock is a RETENTION FLOOR: while a rule covers an object, no API call, no
6
+ * lifecycle rule and no credential can delete it.
7
+ *
8
+ * 🔴 WHY THIS EXISTS AT ALL, AND WHAT IT REPLACES. a consuming stack shipped the retention floor as a
9
+ * documented `wrangler r2 bucket lock add …` step in the runbook, on the measured ground that
10
+ * `alchemy@2.0.0-beta.77` has no lock property anywhere in its R2 namespace. That measurement is
11
+ * still true and it was the wrong conclusion: a step a human runs once is a step an Alchemy plan
12
+ * can never show missing, so removing the floor by hand leaves that stack, its plan and
13
+ * every gate completely green. The operator's rule (2026-09-15) is to cover such a gap with a
14
+ * custom resource over the vendor's SDK, which is what this is.
15
+ *
16
+ * ⛔ THE SDK ALREADY HAD IT, AND THAT IS WORTH SAYING BECAUSE IT DECIDED THE SHAPE. Measured
17
+ * 2026-09-15 in `cloudflare@4.5.0`, `resources/r2/buckets/locks.d.ts`:
18
+ *
19
+ * update(bucketName: string, params: LockUpdateParams, options?): APIPromise<…>
20
+ * get(bucketName: string, params: LockGetParams, options?): APIPromise<LockGetResponse>
21
+ *
22
+ * over `PUT`/`GET /accounts/{account_id}/r2/buckets/{bucket_name}/lock` with the jurisdiction
23
+ * carried as the `cf-r2-jurisdiction` header (`locks.mjs:17` and `:41`). So there is no raw
24
+ * `client.put` fallback here and no path string this package invented — the fallback the rule
25
+ * allows was not needed.
26
+ *
27
+ * ⚠️ THE RULE SET IS A REPLACE, NOT A MERGE. `PUT` takes the WHOLE list, exactly like R2's
28
+ * lifecycle rules — which is the trap a consuming stack records for
29
+ * `homeflare-git`. Declaring this resource on a bucket whose live rules nobody has read would
30
+ * drop them, so `read` fetches them first and `reconcile` refuses to write when they already
31
+ * match.
32
+ */
33
+ import type Cloudflare from 'cloudflare';
34
+ import * as Effect from 'effect/Effect';
35
+ import { CloudflareApi } from './client.ts';
36
+ import { type Jurisdiction, type R2LockRule } from './lock-rules.ts';
37
+ import type { Providers } from './providers.ts';
38
+ export interface R2BucketLockProps {
39
+ readonly accountId: string;
40
+ readonly bucketName: string;
41
+ /** ⚠️ Part of the bucket's IDENTITY, not a preference — a bucket in another jurisdiction is another bucket. */
42
+ readonly jurisdiction?: Jurisdiction;
43
+ /**
44
+ * ⛔ REQUIRED, AND ITS EMPTY VALUE IS THE DANGEROUS ONE. `rules: []` means NO FLOOR: it is what
45
+ * `delete` sends to take a lock off deliberately. An optional property would let a declaration
46
+ * that simply forgot it send `[]` and silently unlock the repository, reporting success — the
47
+ * same reasoning `LiteLLM.McpServer.allowedTools` is required for.
48
+ */
49
+ readonly rules: readonly R2LockRule[];
50
+ }
51
+ export type R2BucketLockAttributes = {
52
+ readonly bucketName: string;
53
+ readonly jurisdiction: Jurisdiction;
54
+ readonly rules: readonly R2LockRule[];
55
+ };
56
+ export interface R2BucketLock extends Resource<'Cloudflare.R2BucketLock', R2BucketLockProps, R2BucketLockAttributes, never, Providers> {
57
+ }
58
+ export declare const R2BucketLock: ResourceClass<R2BucketLock>;
59
+ /**
60
+ * 🔴 A 404 HERE IS "NOTHING TO ADOPT", AND THE FIRST PLAN PROVED IT IS THE ORDINARY CASE.
61
+ * Measured 2026-09-15, an alchemy plan --detailed on a bucket that does not
62
+ * exist yet: `404 {"success":false,"errors":[{"code":10006,"message":"The specified bucket does
63
+ * not exist."}]}` — raised from `read`, during PLANNING, before anything is created. Alchemy
64
+ * calls `read` for a resource with no prior state, so on every first deploy the lock is asked
65
+ * about a bucket the same plan is about to create. Letting that throw makes the resource
66
+ * impossible to plan; swallowing it with `catchAll` would also hide a 403 from a mis-scoped
67
+ * token, which is the failure this estate spends the most time on. So: 404 → absent, everything
68
+ * else propagates.
69
+ *
70
+ * ⛔ AN EMPTY LIVE RULE SET IS "NO LOCK", NOT "A LOCK WITH NOTHING IN IT", so it reads as absent
71
+ * and the resource CREATES. The API answers `{}` for a bucket that has never been locked and
72
+ * `{ rules: [] }` for one whose rules were removed; both mean the floor is gone.
73
+ * ⚠️ `Unowned` UNTIL THIS STACK HAS WRITTEN IT. A lock someone applied by hand — which is exactly
74
+ * what the retired runbook step did — must not be silently rewritten by a mistyped declaration;
75
+ * the planner refuses until the resource is piped through `adopt(true)`, which is one line an
76
+ * operator reads in the diff. An adopted rule set that already MATCHES then costs no request at
77
+ * all, because `reconcile` below returns before writing.
78
+ */
79
+ export declare const readLock: (client: Cloudflare, props: {
80
+ accountId: string;
81
+ bucketName: string;
82
+ jurisdiction?: Jurisdiction;
83
+ }, written: boolean) => Effect.Effect<R2BucketLockAttributes | undefined>;
84
+ /**
85
+ * ⛔ A NO-OP MAKES NO REQUEST, AND ON A LOCK THAT MATTERS MORE THAN TIDINESS. `PUT` replaces the
86
+ * rule set; re-sending an identical one on every deploy is a write against the only thing
87
+ * standing between this repository and a delete, for no change. `output` is what the last deploy
88
+ * persisted (or what `read` just adopted), so the comparison costs nothing either.
89
+ */
90
+ export declare const reconcileLock: (client: Cloudflare, news: R2BucketLockProps, output: R2BucketLockAttributes | undefined) => Effect.Effect<R2BucketLockAttributes>;
91
+ /**
92
+ * ⛔ DELETING THIS RESOURCE MEANS PUTTING AN EMPTY RULE SET, WHICH IS UNLOCKING THE BUCKET. It is
93
+ * implemented because the retirement path is real — R2 refuses to empty a bucket while any lock
94
+ * rule is configured, so retiring the repository has to start here — and it is behind
95
+ * `defaultRemovalPolicy: 'retain'` and the estate CLI's refusal of `destroy` precisely because
96
+ * no ordinary deploy should ever reach it.
97
+ */
98
+ export declare const deleteLock: (client: Cloudflare, output: R2BucketLockAttributes, accountId: string) => Effect.Effect<void>;
99
+ export declare const R2BucketLockProvider: () => import("effect/Layer").Layer<Provider.Provider<R2BucketLock>, never, CloudflareApi>;
100
+ //# sourceMappingURL=r2-bucket-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"r2-bucket-lock.d.ts","sourceRoot":"","sources":["../../src/cloudflare/r2-bucket-lock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EAIhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+GAA+G;IAC/G,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;CACvC;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;CACvC,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,QAAQ,CAC5C,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,EACL,SAAS,CACV;CAAG;AAKJ,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,YAAY,CAYpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,QAAQ,WACX,UAAU,SACX;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAE,WACpE,OAAO,KACf,MAAM,CAAC,MAAM,CAAC,sBAAsB,GAAG,SAAS,CA0B/C,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,aAAa,WAChB,UAAU,QACZ,iBAAiB,UACf,sBAAsB,GAAG,SAAS,KACzC,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAYnC,CAAC;AAEL;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,WACb,UAAU,UACV,sBAAsB,aACnB,MAAM,KAChB,MAAM,CAAC,MAAM,CAAC,IAAI,CASjB,CAAC;AAEL,eAAO,MAAM,oBAAoB,2FA8B9B,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Create/PATCH bodies for `Forgejo.BranchProtection` — extracted for the 250-line cap.
3
+ *
4
+ * ★ READ OFF `house/mcp-servers/docs/api/upstream/forgejo.json` — create posts
5
+ * `CreateBranchProtectionOption`; update sends `EditBranchProtectionOption` fields only.
6
+ */
7
+ import type { BranchProtectionProps } from './branch-protection.ts';
8
+ export declare const branchProtectionForm: (props: BranchProtectionProps) => {
9
+ apply_to_admins?: boolean;
10
+ dismiss_stale_approvals?: boolean;
11
+ enable_push?: boolean;
12
+ enable_status_check?: boolean;
13
+ ignore_stale_approvals?: boolean;
14
+ require_signed_commits?: boolean;
15
+ required_approvals?: number;
16
+ status_check_contexts?: string[];
17
+ rule_name: string;
18
+ };
19
+ //# sourceMappingURL=branch-protection-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch-protection-form.d.ts","sourceRoot":"","sources":["../../src/forgejo/branch-protection-form.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,eAAO,MAAM,oBAAoB,UAAW,qBAAqB;;;;;;;;;;CAoB/D,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * `Forgejo.BranchProtection` — one rule at `/repos/{owner}/{repo}/branch_protections/{name}`.
3
+ *
4
+ * ★ READ OFF `house/mcp-servers/docs/api/upstream/forgejo.json`: create is POST collection;
5
+ * read/update/delete use the branch/rule name in the path segment `{name}`. Response carries
6
+ * `rule_name` (preferred) and deprecated `branch_name`.
7
+ *
8
+ * ⛔ `defaultRemovalPolicy: 'retain'` — dropping a protection rule from the stack must not silently
9
+ * unprotect a branch; opt into `.pipe(RemovalPolicy.destroy())` to DELETE.
10
+ *
11
+ * ⛔ TOKEN NEEDS `write:repository` TO CREATE OR PATCH — get needs `read:repository`.
12
+ */
13
+ import { Resource } from 'alchemy';
14
+ import * as Provider from 'alchemy/Provider';
15
+ import { type ForgejoRequirements } from './resource.ts';
16
+ export interface BranchProtectionProps {
17
+ owner: string;
18
+ repo: string;
19
+ /** Branch or rule name — path key and `rule_name` on the wire. */
20
+ branchName: string;
21
+ requiredApprovals?: number;
22
+ enablePush?: boolean;
23
+ enableStatusCheck?: boolean;
24
+ requireSignedCommits?: boolean;
25
+ dismissStaleApprovals?: boolean;
26
+ ignoreStaleApprovals?: boolean;
27
+ applyToAdmins?: boolean;
28
+ statusCheckContexts?: string[];
29
+ }
30
+ export interface BranchProtectionAttributes {
31
+ owner: string;
32
+ repo: string;
33
+ branchName: string;
34
+ requiredApprovals: number;
35
+ enablePush: boolean;
36
+ enableStatusCheck: boolean;
37
+ requireSignedCommits: boolean;
38
+ dismissStaleApprovals: boolean;
39
+ ignoreStaleApprovals: boolean;
40
+ applyToAdmins: boolean;
41
+ statusCheckContexts: string[];
42
+ }
43
+ export interface ForgejoBranchProtection extends Resource<'Forgejo.BranchProtection', BranchProtectionProps, BranchProtectionAttributes, never, ForgejoRequirements> {
44
+ }
45
+ export declare const ForgejoBranchProtection: import("alchemy").ResourceClass<ForgejoBranchProtection>;
46
+ export declare const ForgejoBranchProtectionProvider: () => import("effect/Layer").Layer<Provider.Provider<ForgejoBranchProtection>, never, import("effect/unstable/http/HttpClient").HttpClient>;
47
+ //# sourceMappingURL=branch-protection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch-protection.d.ts","sourceRoot":"","sources":["../../src/forgejo/branch-protection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,KAAK,mBAAmB,EAAmB,MAAM,eAAe,CAAC;AAG1E,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,CACvD,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,EACL,mBAAmB,CACpB;CAAG;AAEJ,eAAO,MAAM,uBAAuB,0DAGnC,CAAC;AAqCF,eAAO,MAAM,+BAA+B,6IAIzC,CAAC"}