@builtbyfriends/bwf 0.0.0-stage → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/AGENTS_TEMPLATE.md +4 -0
  2. package/LICENSE +22 -0
  3. package/README.md +48 -2
  4. package/dist/account-cmd-Cj0I2_bJ.mjs +45 -0
  5. package/dist/agents-BLiMq9E1.mjs +113 -0
  6. package/dist/application-analysis-C9Ck2Yeg.mjs +1498 -0
  7. package/dist/application-routing-DbR-W5lG.mjs +25 -0
  8. package/dist/atomic-write-DA6eD1Kp.mjs +17 -0
  9. package/dist/auth-BKsUmWbT.d.mts +77 -0
  10. package/dist/auth-DkvoW5hB.mjs +33 -0
  11. package/dist/auth-aKyIWkdS.mjs +1 -0
  12. package/dist/auth-client-6-Ft9i9T.d.mts +5 -0
  13. package/dist/auth-client-DwCdwKbw.mjs +5 -0
  14. package/dist/auth-client-react-CJdeErvM.mjs +5 -0
  15. package/dist/auth-client-react-DvQLe5Zb.d.mts +5 -0
  16. package/dist/auth-link-D-DddkCQ.mjs +26 -0
  17. package/dist/auth-migrations-DDeifS3v.mjs +206 -0
  18. package/dist/auth-router-tWzIwf8f.mjs +66 -0
  19. package/dist/auth-xnkmpZUl.mjs +311 -0
  20. package/dist/base64-ikl9yBy3.mjs +15 -0
  21. package/dist/better-auth-shared-Br6TNaYJ.mjs +473 -0
  22. package/dist/better-auth-shared-CsBNvPOU.d.mts +56 -0
  23. package/dist/build-cmd-BnZezraT.mjs +153 -0
  24. package/dist/build-output-dir-Clj_unKN.mjs +402 -0
  25. package/dist/cancel-deploy-DKAj5U1Z.mjs +57 -0
  26. package/dist/cf-access-Bhz9wX6p.mjs +131 -0
  27. package/dist/cf-access-CUP5L08W.mjs +67 -0
  28. package/dist/cf-build-output-DA6uJomQ.mjs +1 -0
  29. package/dist/cf-build-output-DNQTwMNU.mjs +438 -0
  30. package/dist/cf-command-values-2kOtxMo1.mjs +26 -0
  31. package/dist/cf-config-migrate-COOCi4Ge.mjs +330 -0
  32. package/dist/cf-worker-settings-CIh4t_yG.mjs +41 -0
  33. package/dist/cli/cli.d.mts +1 -0
  34. package/dist/cli/cli.mjs +88 -0
  35. package/dist/cli/cloudflare-operation-process.d.mts +1 -0
  36. package/dist/cli/cloudflare-operation-process.mjs +1284 -0
  37. package/dist/cli/env-schema-probe.d.mts +43 -0
  38. package/dist/cli/env-schema-probe.mjs +165 -0
  39. package/dist/cli-main-HeXRQml6.mjs +1846 -0
  40. package/dist/client-D3D5RM5h.mjs +940 -0
  41. package/dist/client-VF2Nzc7Z.mjs +1 -0
  42. package/dist/cloudflare-auth-jb-1e43r.mjs +152 -0
  43. package/dist/cloudflare-cmd-B62t8Fm-.mjs +59 -0
  44. package/dist/cloudflare-config-i8yanry0.mjs +186 -0
  45. package/dist/cloudflare-connect-x7IsYghw.mjs +55 -0
  46. package/dist/cloudflare-operations-BeK7bhnP.mjs +627 -0
  47. package/dist/cloudflare-operations-C3Uu0Emj.mjs +1 -0
  48. package/dist/cloudflare-process-Cc6oiJqk.mjs +309 -0
  49. package/dist/cloudflare-user-output-CqONaAbP.mjs +19 -0
  50. package/dist/collect-8i0wU63d.mjs +1 -0
  51. package/dist/collect-C6Blu9yw.mjs +48 -0
  52. package/dist/config-CN_RFRkS.mjs +86 -0
  53. package/dist/config-D5G-Tx6o.mjs +1 -0
  54. package/dist/config-DOaFIK3w.mjs +88 -0
  55. package/dist/config-entry.d.mts +202 -0
  56. package/dist/config-entry.mjs +6 -0
  57. package/dist/config-tNx0HlFv.mjs +516 -0
  58. package/dist/connect-hLPNppu3.mjs +84 -0
  59. package/dist/create-project-B35ux-LA.mjs +126 -0
  60. package/dist/create-project-tJ1KwNss.mjs +1 -0
  61. package/dist/database-provider-DkZo4VwN.mjs +5 -0
  62. package/dist/database-provider.d.mts +25 -0
  63. package/dist/database-provider.mjs +1 -0
  64. package/dist/db-BH_md90k.mjs +1735 -0
  65. package/dist/delete-BSKI7V23.mjs +65 -0
  66. package/dist/deploy-C8KHBNsh.mjs +6512 -0
  67. package/dist/deploy-DCZBr7Ey.mjs +2 -0
  68. package/dist/deploy.d.mts +31 -0
  69. package/dist/deploy.mjs +118 -0
  70. package/dist/dev-inbox-I0nqTCdf.mjs +216 -0
  71. package/dist/discover-DJPmQcL5.mjs +36 -0
  72. package/dist/discover-EVuydEoM.mjs +1 -0
  73. package/dist/dist-B6eN80gc.mjs +1612 -0
  74. package/dist/dist-Cp4b1_T9.mjs +1 -0
  75. package/dist/dist-DMYe8CZJ.mjs +48 -0
  76. package/dist/dist-STQXl8ck.mjs +1878 -0
  77. package/dist/domain-C4ZhEiFG.mjs +149 -0
  78. package/dist/dotenv-4NdUCXbB.mjs +156 -0
  79. package/dist/drizzle-DqVFXtlc.mjs +306 -0
  80. package/dist/drizzle-Ds5P0n-S.mjs +1 -0
  81. package/dist/edge.d.mts +2 -0
  82. package/dist/edge.mjs +1 -0
  83. package/dist/email-B3TWga7x.mjs +742 -0
  84. package/dist/email-C_ATvNIG.mjs +2865 -0
  85. package/dist/email-cloudflare-DuAc9zny.mjs +854 -0
  86. package/dist/email-protocol-CZ0bAkI8.mjs +81 -0
  87. package/dist/env-CTAo8ifZ.mjs +73 -0
  88. package/dist/env-DUyTzroe.mjs +88 -0
  89. package/dist/env-Dl4Wggec.mjs +71 -0
  90. package/dist/env-helpers-BX0APszT.mjs +135 -0
  91. package/dist/env-helpers-U56xuFgL.d.mts +20 -0
  92. package/dist/env-mask-BsHxq3R8.mjs +46 -0
  93. package/dist/env-public-Cw_xPi1D.d.mts +119 -0
  94. package/dist/env-raw-Bo6TtrHU.mjs +41 -0
  95. package/dist/env-types-Bg-dTh8u.mjs +56 -0
  96. package/dist/env-validation-BufZConV.mjs +488 -0
  97. package/dist/env-validation-DPqDo4DU.mjs +1 -0
  98. package/dist/fetch-CBgyyhzm.d.mts +87 -0
  99. package/dist/fetch-error-DmlRM6e4.mjs +264 -0
  100. package/dist/fetch-stream-2GUN3YN1.mjs +102 -0
  101. package/dist/fetch-stream-bUXynOyZ.d.mts +32 -0
  102. package/dist/fetch-tpPiSK10.mjs +25 -0
  103. package/dist/gen-dc13IRXh.mjs +509 -0
  104. package/dist/gen-kQqhFyOP.mjs +1 -0
  105. package/dist/generate-BgtlYpKg.mjs +1 -0
  106. package/dist/generate-Da9mWKzU.mjs +80 -0
  107. package/dist/generated-wrangler-config-CoDaaFsA.mjs +17 -0
  108. package/dist/git-metadata-Cukp5kV5.mjs +82 -0
  109. package/dist/github-cmd-DT5Onu6E.mjs +690 -0
  110. package/dist/handler-CJ7DiiRF.mjs +161 -0
  111. package/dist/handler-CVsIfRv7.d.mts +279 -0
  112. package/dist/help-Bpv6Qeqn.mjs +1946 -0
  113. package/dist/help-CfZ4Bsw5.mjs +1 -0
  114. package/dist/inbound-CqubE-9T.d.mts +311 -0
  115. package/dist/inbound-lHugZPuK.mjs +509 -0
  116. package/dist/index.d.mts +64 -0
  117. package/dist/index.mjs +4163 -0
  118. package/dist/info-CLQoCenb.mjs +109 -0
  119. package/dist/init-DRUR0j8C.mjs +2486 -0
  120. package/dist/limits-CMmYT2l8.d.mts +16 -0
  121. package/dist/limits-D27Lp6FP.mjs +46 -0
  122. package/dist/link-DinwJnon.mjs +52 -0
  123. package/dist/list-B84t4BhW.mjs +130 -0
  124. package/dist/live-Dui0-aj_.d.mts +105 -0
  125. package/dist/live-saC8barp.mjs +410 -0
  126. package/dist/load-user-env-g0ahkZcj.mjs +34 -0
  127. package/dist/local-d1-C3EeOV7-.mjs +103 -0
  128. package/dist/log-JDnPc0cF.mjs +23 -0
  129. package/dist/login-Bl5lH8nH.mjs +87 -0
  130. package/dist/login-DoI7AsbY.mjs +1 -0
  131. package/dist/logs-CaT2N2f7.mjs +129 -0
  132. package/dist/migrate-CbGscX-V.mjs +125 -0
  133. package/dist/migrate-Ce3JKLVs.mjs +1 -0
  134. package/dist/migration-handler-22qiuWPq.mjs +469 -0
  135. package/dist/migration-handler-Bb2BJh6g.d.mts +38 -0
  136. package/dist/mime-BMUN_QKG.mjs +1004 -0
  137. package/dist/mysql-migration-sql-CNuBSqdx.mjs +239 -0
  138. package/dist/neon-CJzQSycr.mjs +52 -0
  139. package/dist/node-tfv-3v0V.mjs +64 -0
  140. package/dist/operator-ai-logging-Ay7M4KWw.mjs +121 -0
  141. package/dist/operator-args-BFg32YyY.mjs +722 -0
  142. package/dist/operator-auth-DdYZYEkO.mjs +47 -0
  143. package/dist/operator-client-DBujdELO.mjs +82 -0
  144. package/dist/operator-cmd-C73WWJBl.mjs +443 -0
  145. package/dist/operator-cmd-CdZytuAF.mjs +1 -0
  146. package/dist/output-Bb34lF0w.mjs +173 -0
  147. package/dist/output-CVolXKC1.mjs +1 -0
  148. package/dist/package-DO4d3Qz5.mjs +1444 -0
  149. package/dist/package-json-DvS6IFRv.mjs +43 -0
  150. package/dist/pg-DoyPxa_X.mjs +15 -0
  151. package/dist/picocolors-D1NxSLw-.mjs +71 -0
  152. package/dist/plan-BHNt1QhK.mjs +1 -0
  153. package/dist/plan-DX4_-OM5.mjs +58 -0
  154. package/dist/platform-args-NI_vfWvD.mjs +538 -0
  155. package/dist/platform-args-ZC1-A1N9.mjs +1 -0
  156. package/dist/platform-auth-config-d-lY5-aY.mjs +371 -0
  157. package/dist/platform-auth-protection-Dhw7lUCk.mjs +231 -0
  158. package/dist/platform-auth-recovery-DaCc0tlx.mjs +309 -0
  159. package/dist/platform-cmd-5Ry-C9im.mjs +193 -0
  160. package/dist/platform-cmd-5oZq91lI.mjs +1 -0
  161. package/dist/platform-discovery-Bxg9aZXU.mjs +40 -0
  162. package/dist/platform-domain-DLVdGvGG.mjs +256 -0
  163. package/dist/platform-lifecycle-CUgjipXO.mjs +1 -0
  164. package/dist/platform-lifecycle-fRt5VMls.mjs +8928 -0
  165. package/dist/platform-management-5hEsRfR2.mjs +1 -0
  166. package/dist/platform-management-Djh1hzLP.mjs +1607 -0
  167. package/dist/platform-plans-config-CkbUKFpm.mjs +447 -0
  168. package/dist/platform-recovery-Cghx7FCR.mjs +96 -0
  169. package/dist/platform-registry-x1m9HBxf.mjs +450 -0
  170. package/dist/platform-runtime-logs-kkoiYFpF.mjs +72 -0
  171. package/dist/platform-setup-SfwCwnZg.mjs +306 -0
  172. package/dist/prepare-B9mB47T5.mjs +84 -0
  173. package/dist/prepare-DNIq07so.mjs +13 -0
  174. package/dist/prepare-LHkyJqxi.mjs +1 -0
  175. package/dist/project-CC7eN00D.mjs +141 -0
  176. package/dist/project-DcSd4BeI.mjs +1 -0
  177. package/dist/project-cmd-DTF19-fC.mjs +109 -0
  178. package/dist/project-paths-iXHKRTTQ.mjs +159 -0
  179. package/dist/project-slug-BUy0lmyR.mjs +1 -0
  180. package/dist/project-slug-CO6ci9XG.mjs +7 -0
  181. package/dist/project-team-CvdLhDF2.mjs +129 -0
  182. package/dist/project-token-CwZdUEGu.mjs +70 -0
  183. package/dist/project-tsconfig-P9X952KG.mjs +98 -0
  184. package/dist/project-zero-trust-CKDoPdN1.mjs +64 -0
  185. package/dist/providers-Cd3c7wi0.mjs +64 -0
  186. package/dist/providers-Df69hb_X.d.mts +5 -0
  187. package/dist/provision-DGlFJ3T9.mjs +1 -0
  188. package/dist/provision-mYVLuQiy.mjs +1814 -0
  189. package/dist/queues-Bc3FsBQT.d.mts +5 -0
  190. package/dist/r2-conditions-DSLmkiR5.mjs +60 -0
  191. package/dist/requests-DNhfyF3l.mjs +52 -0
  192. package/dist/resolve-project-BCsAMDRA.mjs +47 -0
  193. package/dist/resolve-project-DhU9_lIo.mjs +1 -0
  194. package/dist/resource-name-DlJ9QXzg.mjs +10 -0
  195. package/dist/response-HmNjB30w.mjs +29 -0
  196. package/dist/rollback-BvCHol52.mjs +150 -0
  197. package/dist/rolldown-runtime-uD8oG6U2.mjs +24 -0
  198. package/dist/route-types-CRWhr93D.mjs +592 -0
  199. package/dist/route-url-BIDZT78M.mjs +58 -0
  200. package/dist/route-url-Bla3Upsy.d.mts +42 -0
  201. package/dist/routes-stub.d.mts +24 -0
  202. package/dist/routes-stub.mjs +1 -0
  203. package/dist/routing-assets-CSheDWWM.mjs +54 -0
  204. package/dist/rpc-DcByS_q0.d.mts +39 -0
  205. package/dist/rpc-DtxIN9Tv.mjs +19 -0
  206. package/dist/runner-CPerdjIl.mjs +163 -0
  207. package/dist/runner-CUNtS5x7.mjs +1 -0
  208. package/dist/runner-mysql-7aA5hGoM.mjs +145 -0
  209. package/dist/runner-mysql-DrMKw203.mjs +1 -0
  210. package/dist/runner-pg-2pjltt0t.mjs +1 -0
  211. package/dist/runner-pg-mYc75KfH.mjs +61 -0
  212. package/dist/runtime/ai.d.mts +50 -0
  213. package/dist/runtime/ai.mjs +455 -0
  214. package/dist/runtime/auth-client-react.d.mts +2 -0
  215. package/dist/runtime/auth-client-react.mjs +1 -0
  216. package/dist/runtime/auth-client.d.mts +2 -0
  217. package/dist/runtime/auth-client.mjs +1 -0
  218. package/dist/runtime/auth.d.mts +2 -0
  219. package/dist/runtime/auth.mjs +1 -0
  220. package/dist/runtime/better-auth-mysql.d.mts +5 -0
  221. package/dist/runtime/better-auth-mysql.mjs +21 -0
  222. package/dist/runtime/better-auth-pg.d.mts +5 -0
  223. package/dist/runtime/better-auth-pg.mjs +21 -0
  224. package/dist/runtime/better-auth.d.mts +6 -0
  225. package/dist/runtime/better-auth.mjs +22 -0
  226. package/dist/runtime/client-react.d.mts +5 -0
  227. package/dist/runtime/client-react.mjs +5 -0
  228. package/dist/runtime/client.d.mts +5 -0
  229. package/dist/runtime/client.mjs +5 -0
  230. package/dist/runtime/db-mysql.d.mts +2 -0
  231. package/dist/runtime/db-mysql.mjs +1 -0
  232. package/dist/runtime/db-pg.d.mts +2 -0
  233. package/dist/runtime/db-pg.mjs +1 -0
  234. package/dist/runtime/db.d.mts +17 -0
  235. package/dist/runtime/db.mjs +36 -0
  236. package/dist/runtime/drizzle-arktype.d.mts +1 -0
  237. package/dist/runtime/drizzle-arktype.mjs +2 -0
  238. package/dist/runtime/drizzle-valibot.d.mts +1 -0
  239. package/dist/runtime/drizzle-valibot.mjs +2 -0
  240. package/dist/runtime/drizzle-zod.d.mts +1 -0
  241. package/dist/runtime/drizzle-zod.mjs +2 -0
  242. package/dist/runtime/durable.d.mts +64 -0
  243. package/dist/runtime/durable.mjs +165 -0
  244. package/dist/runtime/email/testing.d.mts +108 -0
  245. package/dist/runtime/email/testing.mjs +268 -0
  246. package/dist/runtime/email-protocol.d.mts +25 -0
  247. package/dist/runtime/email-protocol.mjs +1 -0
  248. package/dist/runtime/email.d.mts +26 -0
  249. package/dist/runtime/email.mjs +524 -0
  250. package/dist/runtime/env-public-client.d.mts +19 -0
  251. package/dist/runtime/env-public-client.mjs +55 -0
  252. package/dist/runtime/env-public.d.mts +4 -0
  253. package/dist/runtime/env-public.mjs +277 -0
  254. package/dist/runtime/env.d.mts +12 -0
  255. package/dist/runtime/env.mjs +1 -0
  256. package/dist/runtime/fetch-server.d.mts +6 -0
  257. package/dist/runtime/fetch-server.mjs +29 -0
  258. package/dist/runtime/fetch-stream.d.mts +3 -0
  259. package/dist/runtime/fetch-stream.mjs +3 -0
  260. package/dist/runtime/fetch.d.mts +2 -0
  261. package/dist/runtime/fetch.mjs +3 -0
  262. package/dist/runtime/handler.d.mts +3 -0
  263. package/dist/runtime/handler.mjs +1 -0
  264. package/dist/runtime/kv.d.mts +45 -0
  265. package/dist/runtime/kv.mjs +103 -0
  266. package/dist/runtime/limits.d.mts +2 -0
  267. package/dist/runtime/limits.mjs +1 -0
  268. package/dist/runtime/live-client.d.mts +40 -0
  269. package/dist/runtime/live-client.mjs +282 -0
  270. package/dist/runtime/live-server.d.mts +11 -0
  271. package/dist/runtime/live-server.mjs +419 -0
  272. package/dist/runtime/live.d.mts +3 -0
  273. package/dist/runtime/live.mjs +1 -0
  274. package/dist/runtime/log.d.mts +24 -0
  275. package/dist/runtime/log.mjs +57 -0
  276. package/dist/runtime/migration-handler-mysql.d.mts +2 -0
  277. package/dist/runtime/migration-handler-mysql.mjs +111 -0
  278. package/dist/runtime/migration-handler-pg.d.mts +2 -0
  279. package/dist/runtime/migration-handler-pg.mjs +94 -0
  280. package/dist/runtime/migration-handler.d.mts +2 -0
  281. package/dist/runtime/migration-handler.mjs +1 -0
  282. package/dist/runtime/procedure.d.mts +27 -0
  283. package/dist/runtime/procedure.mjs +36 -0
  284. package/dist/runtime/procedures.d.mts +24 -0
  285. package/dist/runtime/procedures.mjs +56 -0
  286. package/dist/runtime/queues.d.mts +2 -0
  287. package/dist/runtime/queues.mjs +8 -0
  288. package/dist/runtime/remote/binding-handler.d.mts +11 -0
  289. package/dist/runtime/remote/binding-handler.mjs +227 -0
  290. package/dist/runtime/remote/index.d.mts +12 -0
  291. package/dist/runtime/remote/index.mjs +467 -0
  292. package/dist/runtime/response.d.mts +11 -0
  293. package/dist/runtime/response.mjs +1 -0
  294. package/dist/runtime/route-url.d.mts +2 -0
  295. package/dist/runtime/route-url.mjs +1 -0
  296. package/dist/runtime/routing.d.mts +53 -0
  297. package/dist/runtime/routing.mjs +425 -0
  298. package/dist/runtime/rpc-react.d.mts +16 -0
  299. package/dist/runtime/rpc-react.mjs +50 -0
  300. package/dist/runtime/rpc.d.mts +2 -0
  301. package/dist/runtime/rpc.mjs +1 -0
  302. package/dist/runtime/sandbox-container.d.mts +3 -0
  303. package/dist/runtime/sandbox-container.mjs +1 -0
  304. package/dist/runtime/sandbox.d.mts +5 -0
  305. package/dist/runtime/sandbox.mjs +196 -0
  306. package/dist/runtime/schema-d1.d.mts +1 -0
  307. package/dist/runtime/schema-d1.mjs +2 -0
  308. package/dist/runtime/schema-mysql.d.mts +1 -0
  309. package/dist/runtime/schema-mysql.mjs +2 -0
  310. package/dist/runtime/schema-pg.d.mts +1 -0
  311. package/dist/runtime/schema-pg.mjs +2 -0
  312. package/dist/runtime/seed.d.mts +34 -0
  313. package/dist/runtime/seed.mjs +5 -0
  314. package/dist/runtime/sse-client.d.mts +31 -0
  315. package/dist/runtime/sse-client.mjs +42 -0
  316. package/dist/runtime/sse.d.mts +32 -0
  317. package/dist/runtime/sse.mjs +1 -0
  318. package/dist/runtime/storage.d.mts +4 -0
  319. package/dist/runtime/storage.mjs +13 -0
  320. package/dist/runtime/validator.d.mts +2 -0
  321. package/dist/runtime/validator.mjs +1 -0
  322. package/dist/runtime/ws-server.d.mts +26 -0
  323. package/dist/runtime/ws-server.mjs +297 -0
  324. package/dist/runtime/ws.d.mts +2 -0
  325. package/dist/runtime/ws.mjs +108 -0
  326. package/dist/sandbox-CWDjoEG2.d.mts +50 -0
  327. package/dist/sandbox-container-BqamdFCx.d.mts +73 -0
  328. package/dist/sandbox-container-d1AHLpgn.mjs +291 -0
  329. package/dist/secret-DCF9RXTc.mjs +146 -0
  330. package/dist/skills-Dr3AjuBF.mjs +63 -0
  331. package/dist/sqlite-validation-CLJXXN93.mjs +24 -0
  332. package/dist/sse-CxR30yMF.mjs +174 -0
  333. package/dist/standard-schema-CuDawHOC.d.mts +40 -0
  334. package/dist/static-asset-marker-mWMX2dLa.mjs +38 -0
  335. package/dist/subcommand-prompt-B9yUo--u.mjs +370 -0
  336. package/dist/terminal-log-text-DNsWJREL.mjs +31 -0
  337. package/dist/types-D7-4tBu7.d.mts +1 -0
  338. package/dist/untrusted-env-lL7RkYiC.mjs +50 -0
  339. package/dist/validate-B-zsjhiz.mjs +162 -0
  340. package/dist/validate-DbqGdPPY.mjs +1 -0
  341. package/dist/validator-8-NZs2Xr.mjs +168 -0
  342. package/dist/version-metadata-DsSoNsKJ.mjs +23 -0
  343. package/dist/wrangler-DU784Dkf.mjs +1452 -0
  344. package/dist/wrangler-Rr9_76DQ.mjs +1 -0
  345. package/dist/ws-Q_osq9VK.d.mts +137 -0
  346. package/dist/yarn-pnp-DgWbE7z5.mjs +91 -0
  347. package/docs/guide/ai.md +273 -0
  348. package/docs/guide/app-types.md +101 -0
  349. package/docs/guide/auth.md +255 -0
  350. package/docs/guide/database/d1.md +86 -0
  351. package/docs/guide/database/mysql.md +72 -0
  352. package/docs/guide/database/postgresql.md +94 -0
  353. package/docs/guide/database.md +454 -0
  354. package/docs/guide/deployment.md +124 -0
  355. package/docs/guide/durable-state.md +192 -0
  356. package/docs/guide/edge/headers.md +47 -0
  357. package/docs/guide/edge/redirects.md +85 -0
  358. package/docs/guide/edge/rewrites.md +119 -0
  359. package/docs/guide/edge/static-assets.md +94 -0
  360. package/docs/guide/email/domains.md +119 -0
  361. package/docs/guide/email/receiving.md +142 -0
  362. package/docs/guide/email/sending.md +262 -0
  363. package/docs/guide/email.md +23 -0
  364. package/docs/guide/env-vars.md +115 -0
  365. package/docs/guide/index.md +37 -0
  366. package/docs/guide/jobs.md +80 -0
  367. package/docs/guide/kv.md +100 -0
  368. package/docs/guide/live.md +181 -0
  369. package/docs/guide/platform/administration/access.md +165 -0
  370. package/docs/guide/platform/administration/connected-apps.md +84 -0
  371. package/docs/guide/platform/administration/email.md +169 -0
  372. package/docs/guide/platform/administration/operations.md +100 -0
  373. package/docs/guide/platform/administration/plans.md +156 -0
  374. package/docs/guide/platform/administration/projects.md +74 -0
  375. package/docs/guide/platform/administration/zero-trust.md +205 -0
  376. package/docs/guide/platform/development/local.md +122 -0
  377. package/docs/guide/platform/development/runtime.md +115 -0
  378. package/docs/guide/platform/development/schema-ci.md +44 -0
  379. package/docs/guide/platform/installation/ci.md +62 -0
  380. package/docs/guide/platform/installation/credentials.md +140 -0
  381. package/docs/guide/platform/installation/domains.md +120 -0
  382. package/docs/guide/platform/installation/first-deployment.md +95 -0
  383. package/docs/guide/platform/installation/maintenance.md +250 -0
  384. package/docs/guide/platform/installation/prerequisites.md +176 -0
  385. package/docs/guide/platform/installation/setup.md +300 -0
  386. package/docs/guide/platform/installation/uninstall.md +110 -0
  387. package/docs/guide/platform-administration.md +19 -0
  388. package/docs/guide/platform-development.md +16 -0
  389. package/docs/guide/procedures.md +48 -0
  390. package/docs/guide/project-collaboration.md +99 -0
  391. package/docs/guide/queues.md +149 -0
  392. package/docs/guide/quickstart.md +129 -0
  393. package/docs/guide/remote-dev.md +67 -0
  394. package/docs/guide/sandboxes.md +134 -0
  395. package/docs/guide/self-hosted-platform.md +45 -0
  396. package/docs/guide/server-routing.md +283 -0
  397. package/docs/guide/sse.md +174 -0
  398. package/docs/guide/storage.md +82 -0
  399. package/docs/guide/testing.md +64 -0
  400. package/docs/guide/type-safety.md +270 -0
  401. package/docs/guide/typed-fetch.md +98 -0
  402. package/docs/guide/websockets.md +230 -0
  403. package/docs/index.md +102 -0
  404. package/docs/integrations/agents.md +38 -0
  405. package/docs/integrations/cloudflare.md +241 -0
  406. package/docs/integrations/hono.md +127 -0
  407. package/docs/reference/api/auth.md +195 -0
  408. package/docs/reference/api/client.md +90 -0
  409. package/docs/reference/api/database.md +118 -0
  410. package/docs/reference/api/deploy.md +63 -0
  411. package/docs/reference/api/durable.md +47 -0
  412. package/docs/reference/api/env.md +51 -0
  413. package/docs/reference/api/handlers.md +189 -0
  414. package/docs/reference/api/plugin.md +40 -0
  415. package/docs/reference/api/resources.md +116 -0
  416. package/docs/reference/api/rewrites.md +111 -0
  417. package/docs/reference/api/types.md +126 -0
  418. package/docs/reference/api.md +71 -0
  419. package/docs/reference/cli/auth.md +87 -0
  420. package/docs/reference/cli/database.md +159 -0
  421. package/docs/reference/cli/deploy.md +117 -0
  422. package/docs/reference/cli/domains.md +42 -0
  423. package/docs/reference/cli/email.md +145 -0
  424. package/docs/reference/cli/generate.md +113 -0
  425. package/docs/reference/cli/github.md +181 -0
  426. package/docs/reference/cli/platform-config.md +93 -0
  427. package/docs/reference/cli/platform-email.md +81 -0
  428. package/docs/reference/cli/platform-installation.md +166 -0
  429. package/docs/reference/cli/platform-operations.md +90 -0
  430. package/docs/reference/cli/platform-users.md +159 -0
  431. package/docs/reference/cli/platform-zero-trust.md +60 -0
  432. package/docs/reference/cli/platform.md +78 -0
  433. package/docs/reference/cli/project.md +208 -0
  434. package/docs/reference/cli/secrets.md +79 -0
  435. package/docs/reference/cli/setup.md +88 -0
  436. package/docs/reference/cli.md +115 -0
  437. package/docs/reference/config.md +478 -0
  438. package/docs/reference/resource-inference.md +72 -0
  439. package/docs/reference/structure.md +138 -0
  440. package/package.json +389 -3
  441. package/sandbox.Dockerfile +4 -0
  442. package/schema.json +353 -0
  443. package/skills/bwf/SKILL.md +100 -0
  444. package/skills/migrate-vite-cloudflare-to-bwf/SKILL.md +53 -0
  445. package/templates/assets/bwf.svg +5 -0
  446. package/templates/assets/icons.svg +49 -0
  447. package/templates/assets/react.svg +1 -0
  448. package/templates/assets/stack.svg +35 -0
@@ -0,0 +1,205 @@
1
+ ---
2
+ description: 'Require Cloudflare Access sign-in on project hostnames, including custom domains, before visitors reach an app.'
3
+ outline: deep
4
+ ---
5
+
6
+ # Project Zero Trust
7
+
8
+ Project Zero Trust puts Cloudflare Access in front of the hostnames of projects deployed to your platform, including custom domains. Visitors sign in with one of your identity providers before they reach a protected project. Each project can still be made public.
9
+
10
+ This is separate from the Access login and protection for the platform API. Projects deployed directly to Cloudflare are not affected.
11
+
12
+ Choose app access during `bwf platform install`, or configure it later using this page. The installer reuses the platform policy or helps you select separate company rules, and finishes setup before opening traffic.
13
+
14
+ If you choose public apps in an account with Default-Deny, bwf manages scoped
15
+ public rules instead. New projects and custom domains remain public automatically.
16
+ Keep these rules enabled while Default-Deny is on; removing them can block traffic.
17
+ Public-only installations need no identity providers or company policies until you
18
+ choose to protect apps. To renew their token in Admin, leave the policy fields blank.
19
+
20
+ ## Requirements
21
+
22
+ - A Cloudflare Zero Trust organization in the account that hosts the platform, with the identity providers and reusable Access policies you want to use. Select at least one Allow policy that matches people by identity. bwf rejects Bypass and Service Auth policies, and rules that allow Everyone or any service token.
23
+ - A Cloudflare API token for that account with **Access: Apps and Policies Write** and **Access: Organizations, Identity Providers, and Groups Read**. bwf keeps it separate from the platform runtime token, stores it encrypted, and never shows it again.
24
+ - Free Access applications in the account. Cloudflare's default limit is 500 per account. Count the applications you already manage outside bwf, then add the ones bwf needs, as described in [Access Applications bwf Creates](#access-applications-nosam-creates).
25
+ - Platform API, proxy, and email gateway hostnames outside the project application domain. Configuration is rejected when project protection would cover one of them. Any other hostname under the project application domain also asks for sign-in, except the `/health` path of `void-platform-health.<your domain>`, which bwf keeps open for its health checks and never serves from a project. New projects cannot use that name. A project that already uses it keeps every other path, protected or public like any other project.
26
+
27
+ ## Enable Zero Trust
28
+
29
+ Open **Zero Trust** in the administrator UI, or use the operator CLI:
30
+
31
+ ```sh
32
+ printf '%s' "$ACCESS_API_TOKEN" | bwf platform zero-trust configure \
33
+ --identity-providers <id[,id...]> \
34
+ --policies <id[,id...]> \
35
+ --existing-projects public \
36
+ --protect-new-projects \
37
+ --token-stdin \
38
+ --yes
39
+ ```
40
+
41
+ - `--existing-projects protected|public` decides what happens to the projects that already exist. It is required when you enable Zero Trust.
42
+ - `--protect-new-projects` protects projects created from now on. Omit it to make new projects public.
43
+ - Use `--plan` instead of `--yes` to check the change without applying it.
44
+
45
+ To change the identity providers, policies, token, or new-project default later, run the same command without `--existing-projects`. Existing projects keep their protection; use the project overrides below to change one project.
46
+
47
+ ## Check Status
48
+
49
+ ```sh
50
+ bwf platform zero-trust status
51
+ bwf platform zero-trust status --check
52
+ ```
53
+
54
+ `status` shows the saved settings, the current operation, and how many projects are protected, public, or waiting. `--check` also compares the settings with Cloudflare Access. In the administrator UI, use **Check with Cloudflare**.
55
+
56
+ ## Project Overrides
57
+
58
+ Project owners and project administrators can protect a project or make it public. Readers can see its state.
59
+
60
+ ```sh
61
+ bwf project zero-trust status
62
+ bwf project zero-trust protect
63
+ bwf project zero-trust public
64
+ bwf project zero-trust reconcile
65
+ ```
66
+
67
+ `status` also tells you whether protection can be changed right now. Making a project public does not change the default for new projects.
68
+
69
+ Installation administrators can do the same from the project page in the administrator UI or with `bwf platform zero-trust project-status|project-protect|project-public|project-reconcile <project-id>`.
70
+
71
+ Deploys and rollbacks wait until a project's protection change is finished. If one is refused, run `bwf project zero-trust status` to see why; the owner or a project administrator can run `bwf project zero-trust reconcile` before you try again. A protected project can have up to 100 custom domains.
72
+
73
+ ## Disable Zero Trust
74
+
75
+ ```sh
76
+ bwf platform zero-trust disable
77
+ ```
78
+
79
+ This removes the Access applications bwf created and makes all projects public. On large installations it runs in steps; run it again, or check `bwf platform zero-trust status`, until Zero Trust shows as disabled with no operation running.
80
+
81
+ Disable Zero Trust and wait for its applications to be removed before [uninstalling the platform](/guide/platform/installation/uninstall). If project deletion stopped partway, retry `bwf project delete` for that project.
82
+
83
+ ## How Protection Works
84
+
85
+ Cloudflare Access handles sign-in and applies your policies. bwf also verifies the token before serving a protected project. Public projects allow visitors without sign-in.
86
+
87
+ ### What Visitors See
88
+
89
+ A protected project asks visitors to sign in with one of the identity providers you selected. If you selected exactly one, visitors go straight to it. Otherwise, they pick one of the selected providers. A sign-in lasts 12 hours. After that, Access asks again.
90
+
91
+ Protection follows the project to every hostname it answers on:
92
+
93
+ | Hostname | Protected project | Public project |
94
+ | ----------------------------------------- | ----------------- | -------------- |
95
+ | `<slug>.<your domain>` | Sign-in required | Open to anyone |
96
+ | The project's `workers.dev` testing URL | Sign-in required | Open to anyone |
97
+ | Custom domains, such as `app.example.com` | Sign-in required | Open to anyone |
98
+
99
+ bwf only covers the `workers.dev` testing URLs of this installation. Other Workers in the account are not affected. On an installation without a domain, the `workers.dev` testing URL is the only project URL, and the shared project application covers only those URLs.
100
+
101
+ #### The 403 Page
102
+
103
+ A request without a valid token receives `403 Cloudflare Access authentication required`. Page requests show an HTML error; API and asset requests receive plain text. These responses are never cached.
104
+
105
+ Visitors who went through the sign-in page normally never see it. They can see it:
106
+
107
+ - for a short time while the project is switching between protected and public;
108
+ - while a Zero Trust change is still being applied to the project;
109
+ - when a Nosam-managed Access application was deleted, or its hostnames were changed, in the Cloudflare dashboard. See [Editing Applications in the Dashboard](#editing-applications-in-the-dashboard).
110
+
111
+ #### Every Path Is Covered
112
+
113
+ Protection applies to the whole hostname. There are no path exceptions. `/api/*` routes, static files, hashed assets, `robots.txt`, `favicon.ico`, server-sent events, and WebSockets all require a signed-in visitor.
114
+
115
+ #### Webhooks and Other Non-Browser Clients
116
+
117
+ Project protection requires a person’s identity. Webhooks, CI jobs, uptime checks, and unauthenticated `curl` calls receive the sign-in page or a 403.
118
+
119
+ If a project must accept such requests:
120
+
121
+ - make the project public with `bwf project zero-trust public` and check callers in your own code, or
122
+ - move the endpoints that machines call into a separate project, and make only that project public.
123
+
124
+ ### Access Applications bwf Creates
125
+
126
+ bwf creates and owns these self-hosted applications in your Zero Trust organization:
127
+
128
+ | Application | Covers | Policy | Exists |
129
+ | --------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------ |
130
+ | Shared project application | `*.<your domain>` and this installation's `workers.dev` testing URLs | Your selected policies and identity providers | Once for protected-app configurations |
131
+ | Public app management check | A reserved, unused dispatch check path | Deny Everyone; verifies management permissions without opening hostnames | Once, instead of the shared wildcard in public-only mode |
132
+ | Public exception | One public project's `<slug>.<your domain>` and `workers.dev` testing URL | A Bypass policy for Everyone, named `bwf project is public` | One for each public project |
133
+ | Custom domain application | All managed custom domains of one project | Company policies for protected projects; Bypass for public ones | One for each project with managed custom domains |
134
+ | Health check exception | `void-platform-health.<your domain>/health` | A Bypass policy for Everyone, named `bwf platform health check` | Once, while Zero Trust is enabled on an installation with a domain |
135
+
136
+ Installations configured through the installer also manage public custom-domain
137
+ rules. Their custom-domain application changes policy when a project switches
138
+ between public and protected access.
139
+
140
+ If the installer already configured the same health-check exception, Zero Trust
141
+ reuses it. Disabling project Zero Trust leaves that existing exception in place
142
+ so platform health checks continue to work.
143
+
144
+ The number of applications bwf needs is:
145
+
146
+ ```text
147
+ 1 + health-check applications + public projects + projects with managed custom domains
148
+ ```
149
+
150
+ The first application is the shared company policy or the public-app management check. Count a health exception once, including when it is shared with the installer. For example, 40 projects with one health exception, 10 public projects, and 5 projects with managed custom domains need 1 + 1 + 10 + 5 = 17 applications. bwf stops with an error when the account has more than 500 Access applications.
151
+
152
+ #### Recognizing bwf's Applications
153
+
154
+ Run `bwf platform zero-trust status` for the shared and health-check applications, or `bwf platform zero-trust project-status <project-id>` for a project's applications. These commands show their exact names and IDs.
155
+
156
+ ### Editing Applications in the Dashboard
157
+
158
+ Manage bwf’s applications through `bwf platform zero-trust configure` and the project commands. Editing or deleting them in Cloudflare can block access until you reconcile. Dashboard edits may be replaced the next time bwf updates an application.
159
+
160
+ You can edit a selected reusable policy’s rules in Cloudflare. Changes affect every project using that policy. Keep an identity-based Allow policy without Everyone or service tokens, then check it with:
161
+
162
+ ```sh
163
+ bwf platform zero-trust status --check
164
+ ```
165
+
166
+ - `drifted: true`: run `bwf platform zero-trust reconcile`.
167
+ - `present: false`: check the token, application, identity providers, and policies, then reconcile.
168
+
169
+ This checks the shared and health-check applications. For a public exception or custom-domain application, use the project's reconcile command.
170
+
171
+ #### Repair Commands
172
+
173
+ | Command | Scope | Who can run it |
174
+ | -------------------------------------------------------- | ------------------------------------- | ---------------------------------------- |
175
+ | `bwf platform zero-trust reconcile` | Platform and all projects | Installation administrators |
176
+ | `bwf platform zero-trust project-reconcile <project-id>` | One project | Installation administrators |
177
+ | `bwf project zero-trust reconcile` | Linked project, or `--project <slug>` | Project owner and project administrators |
178
+
179
+ Project reconciliation requires platform status `ready`. Otherwise, reconcile the platform first.
180
+
181
+ If an application was renamed, restore its recorded name before reconciling. Remove duplicate copies yourself. Deleting the shared application temporarily blocks protected projects; deleting the health-check exception can block upgrades and repair until it is restored.
182
+
183
+ ### What Happens During Changes
184
+
185
+ Protection changes can temporarily return a 403. If a step fails, a protected project stays protected or refuses visitors until the change finishes.
186
+
187
+ Protecting or making a project public usually finishes before the command returns. If it is still running or reports an error, inspect `bwf project zero-trust status`, fix the reported cause, and run `bwf project zero-trust reconcile`.
188
+
189
+ Platform-wide changes run in steps. During initial setup, custom domains stay public until bwf reaches their project. During disable, hostnames can become public at different times. Follow progress with `bwf platform zero-trust status`.
190
+
191
+ A new custom domain becomes reachable only after its project’s protection is ready.
192
+
193
+ ### Caching
194
+
195
+ Requests carrying an Access token bypass the [static asset edge cache](/guide/edge/static-assets#non-hashed-assets), which can increase latency and request usage. Public projects keep their shared caches.
196
+
197
+ ## Recovery
198
+
199
+ - **Status stays `configuring` or `disabling`.** Large changes run in steps. Scheduled maintenance continues them within a few minutes, or run `bwf platform zero-trust reconcile`.
200
+ - **Status shows an error.** Fix the cause shown, such as token permissions or the application limit, then run `bwf platform zero-trust reconcile`. Otherwise bwf retries every hour.
201
+ - **One project shows an error.** The rest of the change still finishes. bwf retries the project every hour, or its owner or a project administrator can run `bwf project zero-trust reconcile`. Until then, a project that was already protected stays protected, and a project being newly protected is never more open than before.
202
+ - **Adding a domain stays pending because of a project.** bwf publishes the new domain only after every project is ready for it. Platform status shows an error that names the projects it could not update. Check each one with `bwf platform zero-trust project-status <project-id>`, fix the cause, then run `bwf platform zero-trust reconcile` or rerun the domain command. bwf also retries every hour. Your `workers.dev` URLs keep working meanwhile.
203
+ - **A new project could not be set up.** Creating the project still succeeds with a warning. bwf retries every hour, or run `bwf project zero-trust reconcile`.
204
+ - **The saved API token expired or was revoked.** Run `bwf platform zero-trust configure --token-stdin` with a replacement token and the same identity providers, policies, and `--protect-new-projects` choice. Omit `--existing-projects`. bwf continues the unfinished change, including an unfinished disable. Finish it before changing other settings.
205
+ - **A selected identity provider or policy was deleted.** Run `bwf platform zero-trust disable` to stop the unfinished setup and remove its applications. This makes projects public. Then configure Zero Trust again with the new selections.
@@ -0,0 +1,122 @@
1
+ ---
2
+ description: 'Clone the repository, install workspace dependencies, and run the platform locally with Vite+.'
3
+ outline: deep
4
+ ---
5
+
6
+ # Local Development
7
+
8
+ ## Setting Up the Repository
9
+
10
+ Clone your fork and install the workspace dependencies with Vite+:
11
+
12
+ ```sh
13
+ git clone https://github.com/your-org/nosam.git
14
+ cd void
15
+ vp install
16
+ vpr install:bwf-dev
17
+ bwf-dev --help
18
+ ```
19
+
20
+ Use the Node.js version recorded in `.node-version`.
21
+
22
+ `install:bwf-dev` builds the CLI, shared packages, and platform runtime, then makes this checkout's built CLI globally available as `bwf-dev`. Public packages export their built files, so run `vp run build:core` after later source changes to refresh the alias. The installer refuses to replace an unrelated global command. Remove only this checkout's alias with `vpr uninstall:bwf-dev`. The commands on these development pages run from the repository root.
23
+
24
+ ## Finding the Implementation
25
+
26
+ | Directory | Purpose |
27
+ | ---------------------------------------------------- | -------------------------------------------------------------------- |
28
+ | `packages/bwf` | Framework, application runtime, and CLI |
29
+ | `packages/platform` | Installer contracts, packaged Workers, and platform migrations |
30
+ | `packages/deploy-core`, `packages/deploy-cloudflare` | Shared deployment contracts and Cloudflare upload code |
31
+ | `platform/packages/api` | Users, projects, deployments, provisioning, and administrator API/UI |
32
+ | `platform/packages/dispatch` | Application routing and static assets |
33
+ | `platform/packages/proxy` | AI and remote bindings |
34
+ | `platform/packages/email-gateway` | Inbound mail routing and tenant delivery |
35
+ | `platform/packages/tail` | Runtime log ingestion |
36
+ | `platform/packages/dashboard` | Dashboard source and local UI components in `ui/` |
37
+
38
+ The `@nosamcloud/*` names identify workspace implementation packages. Their `private: true` flags prevent publishing those packages to npm. Deployable core Workers are bundled into the public `@builtbyfriends/platform` package.
39
+
40
+ The core installer creates the API, dispatch, proxy, tail, and email gateway Workers. The dashboard and managed GitHub build services are available in the source tree but are not included in that installation. Adding an optional service requires its infrastructure, bindings, authentication, and capability configuration together.
41
+
42
+ ## Running the API Locally
43
+
44
+ Start a local PostgreSQL server and make `psql` and `pg_isready` available on your path. Then create the development database, apply its migrations, and seed an administrator:
45
+
46
+ ```sh
47
+ vp run --filter @nosamcloud/api setup --admin-email dev@example.com
48
+ vp run --filter @nosamcloud/api dev:admin
49
+ ```
50
+
51
+ The command disables the optional build containers, so basic API and admin work
52
+ does not require Docker. To develop managed builds, install Docker and run the
53
+ API with containers enabled.
54
+
55
+ Open `http://localhost:8787/admin/`. Setup writes the API's local database connection and development authentication bypass to `platform/packages/api/.dev.vars`. It configures `platform/packages/dashboard/.env` for the separate dashboard. Both files are ignored by Git. Production installations get separate credentials through the installer.
56
+
57
+ The API's development bypass lets you work on the browser admin UI without setting up OAuth. Operator CLI sessions still require administrator authentication; they do not use the browser bypass.
58
+
59
+ `dev:admin` watches source files and automatically reloads the browser after edits. Keep it running while working on the admin dashboard's React components and styles; no platform deployment is needed. The setup includes sample users, projects, and deployments for trying each view locally.
60
+
61
+ ## Running the Dashboard Locally
62
+
63
+ The dashboard is a separate source app. After API setup, start it in another terminal:
64
+
65
+ ```sh
66
+ vp run --filter @nosamcloud/dashboard dev
67
+ ```
68
+
69
+ Setup points the dashboard's local `.env` at the API you started:
70
+
71
+ ```dotenv
72
+ API_URL=http://localhost:8787
73
+ SITE_DOMAIN=apps.example.com
74
+ ```
75
+
76
+ Open the Vite URL and choose **Dev login (local API)**. That button appears for a localhost API and uses the local development sign-in endpoint.
77
+
78
+ You can also point the dashboard at an API that you operate. If Cloudflare Access protects that API, install `cloudflared` and opt into the dashboard's local token helper with matching origins:
79
+
80
+ ```dotenv
81
+ API_URL=https://platform.example.com
82
+ CF_ACCESS_APP_URL=https://platform.example.com
83
+ SITE_DOMAIN=apps.example.com
84
+ ```
85
+
86
+ The helper refreshes an Access session before the dev server starts. Human
87
+ dashboard requests require the user's Access session as well as their bwf login;
88
+ a service token does not represent that user. Service-token pairs are for scoped
89
+ machine operations. This is dashboard development configuration; Access
90
+ credentials are separate from platform login credentials.
91
+
92
+ For a deployed dashboard, bind its `API` service to your platform API, configure
93
+ `DASHBOARD_URL` on both the dashboard and API, and include that exact dashboard origin in the
94
+ platform's Access protection application. The dashboard passes the browser's
95
+ company identity to the API using that service binding. Its login page shows
96
+ the platform's currently enabled methods, and **Account** supports adding an
97
+ additional login identity.
98
+
99
+ ## Testing Changes
100
+
101
+ Run tests for the area you changed while developing:
102
+
103
+ ```sh
104
+ vp test run platform/packages/api/test/integration/operator-auth.test.ts
105
+ vp run check
106
+ ```
107
+
108
+ Before preparing a release, build the packages and run the complete checks:
109
+
110
+ ```sh
111
+ vp run build:all
112
+ vp run check
113
+ vp lint
114
+ vp run lint:platform
115
+ vp fmt --check
116
+ vp test run
117
+ vp run build:docs
118
+ ```
119
+
120
+ Platform integration tests use their local test database by default. To test against PostgreSQL, set `BWF_TEST_DATABASE_URL` to a disposable database: these tests clear tables between cases.
121
+
122
+ To exercise a deployed application, deploy a disposable copy of `playground/kitchen-sink` and pass its URL as `SMOKE_URL` to the smoke test described in `platform/scripts/kitchen-sink-smoke-test.md`. That test creates and removes application data.
@@ -0,0 +1,115 @@
1
+ ---
2
+ description: 'Build a platform runtime from your checkout and deploy that build into your Cloudflare account.'
3
+ outline: deep
4
+ ---
5
+
6
+ # Runtime and Source Builds
7
+
8
+ ## Deploying Your Runtime
9
+
10
+ Build the runtime. From a Git checkout, the build automatically records the current commit in the runtime manifest. An uncommitted checkout is recorded with a `-dirty` suffix:
11
+
12
+ ```sh
13
+ vp run build:core
14
+ ```
15
+
16
+ Build systems may set `NOSAM_PLATFORM_SOURCE_REVISION` when they need to override automatic detection with another immutable revision. A source archive without Git metadata builds normally but leaves the revision unrecorded.
17
+
18
+ The runtime is written to `packages/platform/dist/runtime`. Use the built CLI to preview a new installation from those files:
19
+
20
+ ```sh
21
+ bwf-dev platform install \
22
+ --name my-team \
23
+ --application-domain example.app \
24
+ --zone example.app \
25
+ --runtime packages/platform/dist/runtime \
26
+ --plan
27
+ ```
28
+
29
+ Before applying the plan, complete the [installation guides](/guide/self-hosted-platform). Run the command without `--plan` to install. For testing before your domain is ready, replace `--application-domain` and `--zone` with `--workers-dev`; PostgreSQL and the runtime, login-provider, and R2 credentials are still needed. Use `bwf-dev` in place of `bwf` and keep `--runtime packages/platform/dist/runtime` on install and resume commands. For an interrupted installation, keep that runtime build available until it completes.
30
+
31
+ Later, run `bwf-dev platform domain set example.app`. Domain setup uses the existing installed runtime and needs no `--runtime`, rebuild, or app redeploy. It keeps the platform API URL and original workers.dev app URLs available.
32
+
33
+ For an existing installation, preview an upgrade using its connection ID:
34
+
35
+ ```sh
36
+ bwf-dev platform upgrade <installation-id> \
37
+ --runtime packages/platform/dist/runtime --plan
38
+ ```
39
+
40
+ Then run it without `--plan` to apply the upgrade. Source-built runtimes go through the same artifact, database, ownership, and health checks as released runtimes. The CLI preserves a disabled installation's state and records the source revision in its installation checkpoint.
41
+
42
+ ## Optional GitHub Webhook Ingress for Access-Protected APIs
43
+
44
+ The core installer does not deploy the dashboard, GitHub App, build Containers,
45
+ or webhook ingress. Passing a source build with `--runtime` does not provision
46
+ their infrastructure, bindings, credentials, or platform capabilities. The
47
+ repository's hosted deployment scripts target bwf Cloud; they are not a
48
+ general setup procedure for adding these services to a self-hosted platform.
49
+ Use the core CLI deployment workflow unless your fork supplies and maintains
50
+ that optional integration.
51
+
52
+ If your fork has added managed GitHub builds and Cloudflare Access protects its API hostname, GitHub cannot deliver directly
53
+ to `/webhooks/github`: GitHub does not present your Access credentials. Do not add
54
+ an Everyone or bypass policy to the API application.
55
+
56
+ Deploy the optional webhook ingress at a separate public hostname. It accepts signed GitHub deliveries at `POST /github` and forwards them to your API through a service binding. Without Access protection, use the API’s `/webhooks/github` endpoint directly.
57
+
58
+ To deploy the optional ingress:
59
+
60
+ 1. Provision the GitHub App, build executors, API bindings, credentials, and
61
+ managed-build capability in your fork, then deploy its source API runtime
62
+ with the internal operation. A core install or upgrade alone does not add
63
+ managed builds.
64
+ 2. Edit `platform/packages/api/wrangler.github-webhook-ingress.jsonc`. Give the
65
+ ingress a name unique to the installation and set its `API` service binding to
66
+ the exact installed API Worker name. Keep its public hostname separate from
67
+ every human/API hostname covered by Access.
68
+ 3. Deploy it from the repository root:
69
+
70
+ ```sh
71
+ vp run --filter @nosamcloud/api deploy:github-webhook-ingress --env production
72
+ ```
73
+
74
+ Use `--env staging` for the staging entries in the same config.
75
+
76
+ 4. In the Cloudflare dashboard, add encrypted Worker secrets. Set the GitHub
77
+ App's existing `GITHUB_WEBHOOK_SECRET` on both the API and ingress Workers.
78
+ Generate a separate high-entropy value, such as `openssl rand -base64 32`,
79
+ and set it as `GITHUB_WEBHOOK_INGRESS_SECRET` on both Workers. Do not reuse a
80
+ platform management, JWT, Access, or GitHub webhook credential for that value.
81
+ 5. In the GitHub App settings, keep **Content type** set to `application/json`,
82
+ keep the same webhook secret, and change **Webhook URL** to the isolated
83
+ ingress URL ending in `/github`. Use GitHub's test delivery and confirm a 2xx
84
+ response before relying on push builds.
85
+
86
+ The ingress accepts payloads up to 25 MiB. See [GitHub’s payload limit](https://docs.github.com/en/webhooks/webhook-events-and-payloads#payload-cap).
87
+
88
+ ## Deploying Source Builds from CI
89
+
90
+ Build `@builtbyfriends/platform` from your checkout and pass its runtime directory to `install`, `upgrade`, `repair`, `enable`, or `rollback` with `--runtime`. Custom runtimes get the same integrity, migration, health, and rollback checks as packaged releases.
91
+
92
+ Use a clean Git checkout or set `NOSAM_PLATFORM_SOURCE_REVISION` to identify the revision you deploy.
93
+
94
+ A fresh CI runner can discover the installation each time. Set `CLOUDFLARE_API_TOKEN` and `NOSAM_PLATFORM_DATABASE_URL` through its protected environment, then:
95
+
96
+ ::: details CI commands and recovery inputs
97
+
98
+ ```sh
99
+ vp run build:core
100
+
101
+ export NOSAM_PLATFORM_REGISTRY_DIR="$RUNNER_TEMP/nosam-platform-registry"
102
+ export NOSAM_PLATFORM_RECOVERY_KEY="$(openssl rand -base64 32)"
103
+ node packages/bwf/dist/cli/cli.mjs platform discover --account "$CLOUDFLARE_ACCOUNT_ID" \
104
+ --installation "$NOSAM_PLATFORM_INSTALLATION"
105
+ node packages/bwf/dist/cli/cli.mjs platform upgrade "$NOSAM_PLATFORM_INSTALLATION" \
106
+ --runtime packages/platform/dist/runtime --plan
107
+ node packages/bwf/dist/cli/cli.mjs platform upgrade "$NOSAM_PLATFORM_INSTALLATION" \
108
+ --runtime packages/platform/dist/runtime --yes
109
+ ```
110
+
111
+ Omit the installation selector only if the account has one discoverable installation. Run one deployment per installation at a time, and let it finish before starting the next. Cancelling during migrations or Worker rollout can leave an installation waiting for recovery.
112
+
113
+ Keep the management token, database URL, JWT signing secret, email signing secret for email-enabled installations, and complete project-encryption keyring in a protected CI environment. Upgrades inherit deployed Worker secrets. The original values are needed when recreating a missing Worker; configuration credentials are also needed when explicitly rotating them.
114
+
115
+ :::
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: 'Change the platform database schema, generate a migration, and see how CI checks that schema.'
3
+ outline: deep
4
+ ---
5
+
6
+ # Schema and CI
7
+
8
+ ## Changing the Platform Schema
9
+
10
+ The schema lives in `platform/packages/api/src/schema.ts`. Generate a migration after changing it:
11
+
12
+ ```sh
13
+ vp run --filter @nosamcloud/api db:generate
14
+ ```
15
+
16
+ Review the generated SQL and migration journal before committing them. Released migrations are append-only. An upgrade applies new migrations while the previous Workers may still serve requests, so schema changes must remain compatible with that code.
17
+
18
+ `platform/packages/api/drizzle/compatibility.json` records which earlier runtimes have been verified against the new schema. Add an edge only after testing that compatibility. The runtime build checks that the migration files and recorded schema history agree.
19
+
20
+ ## Runtime artifact contract
21
+
22
+ `@builtbyfriends/platform` contains installation manifests, resource naming, discovery contracts, Worker configuration, and deployable bundles under the `./installer` export. Platform source lives in `platform/packages/`.
23
+
24
+ Runtime artifacts include migration SQL, its journal, and a rollback compatibility manifest. Drizzle authoring snapshots remain in the source tree.
25
+
26
+ ## CI in a Fork
27
+
28
+ The uncredentialed test workflows use GitHub-hosted runners in forks. They build and test the workspace without requiring bwf Cloud accounts, tokens, or deployment access.
29
+
30
+ If your fork has a released platform version, set the repository variable
31
+ `NOSAM_PLATFORM_PRODUCTION_REF` to its immutable 40-character commit SHA. Platform
32
+ pull requests then create that version's database, seed representative user,
33
+ project, and encrypted-secret records, and apply the proposed migrations. The
34
+ check verifies existing data and runs the previous runtime against the upgraded
35
+ schema. Mutable branch or tag names are rejected.
36
+
37
+ Without an explicit SHA, required compatibility checks use the latest successful
38
+ GitHub deployment to `Prod` (or `NOSAM_PLATFORM_PRODUCTION_ENV`). They require
39
+ read access to deployment history and stop if no completed deployment is found.
40
+ Advancing the production branch does not change the selected baseline. Fork
41
+ workflows that call platform CI must grant `deployments: read` alongside
42
+ `contents: read`.
43
+
44
+ The upstream repository also contains workflows for deploying bwf Cloud and publishing the official npm packages. Forks should configure their own release workflow around the built CLI and `platform upgrade --runtime`; the [source-build CI example](/guide/platform/development/runtime#deploying-source-builds-from-ci) shows the required inputs. Keep production credentials in protected environments restricted to the appropriate release refs.
@@ -0,0 +1,62 @@
1
+ ---
2
+ description: 'Install or update a bwf platform from CI after you have configured it once interactively.'
3
+ outline: deep
4
+ ---
5
+
6
+ # Install from CI
7
+
8
+ For your first installation, follow the [interactive setup](/guide/platform/installation/setup). Use this page when automating a configured installation.
9
+
10
+ ::: details Non-interactive inputs
11
+
12
+ Inject the following values from protected CI secrets. Do not commit them in a workflow or a plaintext secrets file.
13
+
14
+ | Environment variable | Value from the interactive setup |
15
+ | --------------------------------------------- | ------------------------------------------------------------------------------------------- |
16
+ | `CLOUDFLARE_API_TOKEN` | Management API token |
17
+ | `NOSAM_PLATFORM_RUNTIME_CLOUDFLARE_API_TOKEN` | Runtime API token |
18
+ | `NOSAM_PLATFORM_DATABASE_URL` | Dedicated PostgreSQL URL |
19
+ | `NOSAM_PLATFORM_HYPERDRIVE_ID` | Existing externally managed Hyperdrive ID, when applicable |
20
+ | `NOSAM_PLATFORM_HYPERDRIVE_ORIGIN_HOST` | Origin host of that Hyperdrive; set with its ID and user |
21
+ | `NOSAM_PLATFORM_HYPERDRIVE_ORIGIN_USER` | Runtime database user of that Hyperdrive; set with its ID and host (or service ID) |
22
+ | `NOSAM_PLATFORM_HYPERDRIVE_ORIGIN_SERVICE_ID` | For a Workers VPC origin, set the service ID in place of the origin host |
23
+ | `NOSAM_PLATFORM_R2_ACCESS_KEY_ID` | R2 Access Key ID |
24
+ | `NOSAM_PLATFORM_R2_SECRET_ACCESS_KEY` | R2 Secret Access Key |
25
+ | `NOSAM_PLATFORM_JWT_SECRET` | Original JWT signing secret |
26
+ | `NOSAM_PLATFORM_EMAIL_SIGNING_SECRET` | Dedicated email signing secret when email is enabled |
27
+ | `NOSAM_PLATFORM_PROJECT_SECRET_KEY` | Original base64-encoded project-encryption key |
28
+ | `NOSAM_PLATFORM_RECOVERY_KEY` | Base64-encoded 32-byte key for local encrypted recovery state when no keychain is available |
29
+ | `NOSAM_EMAIL_SENDER_DOMAIN` | Optional shared mail domain; requires `NOSAM_EMAIL_SHARED_ZONE_ID` |
30
+ | `NOSAM_EMAIL_SHARED_ZONE_ID` | Cloudflare zone ID for that mail domain; requires `NOSAM_EMAIL_SENDER_DOMAIN` |
31
+
32
+ For the default GitHub-only login, also set `NOSAM_PLATFORM_GITHUB_CLIENT_ID`,
33
+ `NOSAM_PLATFORM_GITHUB_CLIENT_SECRET`, and `NOSAM_PLATFORM_ADMIN_GITHUB_LOGIN`.
34
+ For Google, OIDC, or Access login, pass `--auth-config <path>` using the
35
+ [configuration format](/guide/platform/installation/setup#choose-login-methods).
36
+ Inject each `clientSecretEnv` named in that file from your CI secret manager.
37
+ Automatic Access protection may also need `NOSAM_PLATFORM_ACCESS_SETUP_TOKEN`
38
+ with the [setup permissions](/guide/platform/installation/setup#cloudflare-access).
39
+
40
+ Use that installation's saved signing and encryption keys on every resume or repair that needs them. After a keyring rotation, use the [complete keyring recovery inputs](/guide/platform/installation/maintenance#manage-an-installation-from-another-machine). The database claim and tables remain after uninstall; use a fresh database for a different installation.
41
+
42
+ Set both email values to enable email during install or upgrade. Later upgrades reuse the recorded values. If an email-enabled installation has no recorded values, supply both before upgrading.
43
+
44
+ ```sh
45
+ bwf platform install \
46
+ --name team \
47
+ --display-name "Team bwf" \
48
+ --account <account-id> \
49
+ --application-domain example.app \
50
+ --zone example.app \
51
+ --yes
52
+ ```
53
+
54
+ Mutations require `--yes` in CI; a read-only `--plan` does not. Custom runtimes also require `--runtime <directory>`. For a new installation, run `--plan` with the same account, name, and domain options as the unattended install. If you use `--auth-config`, pass the same file to both commands. Register `<platform-api-url>/auth/callback` when creating a login provider's OAuth or OIDC client manually; automatic Access setup manages its own application. A custom API hostname is optional.
55
+
56
+ In CI, `upgrade`, `repair`, `enable`, `rollback`, and `install --resume` stop before they change a platform Worker or pause traffic when a platform Worker was changed in the Cloudflare dashboard or with the Cloudflare API, or has an active version without a bwf deployment record. See [Platform Workers changed outside bwf](/guide/platform/installation/maintenance#workers-changed-outside-nosam).
57
+
58
+ :::
59
+
60
+ ## Customize the Platform
61
+
62
+ To change the platform's implementation or deploy your own build, follow [Platform Development](/guide/platform-development). It covers local development, source builds, and CI for a fork.