dineway 0.2.33 → 0.2.34

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 (457) hide show
  1. package/dist/{activity-CfryM8jO.mjs → activity-CZnq5YlZ.mjs} +2 -2
  2. package/dist/{activity-events-BVo9rMUz.mjs → activity-events-D-yGV7cW.mjs} +1 -1
  3. package/dist/{actor-DrJJsvy6.mjs → actor-DxUAJgQX.mjs} +20 -6
  4. package/dist/{adapters-DHt3f2lu.d.mts → adapters-BQ8CQbBm.d.mts} +5 -7
  5. package/dist/after-BVaUn7bK.mjs +24 -0
  6. package/dist/{allowed-origins-DGSyhRCz.mjs → allowed-origins-DV3LWuWW.mjs} +1 -1
  7. package/dist/api/route-utils.d.mts +10 -10
  8. package/dist/api/route-utils.mjs +23 -19
  9. package/dist/api/schemas/index.d.mts +1 -1
  10. package/dist/api/schemas/index.mjs +5 -5
  11. package/dist/{api-CTf1SLmg.mjs → api-CL4pG2zf.mjs} +55 -1215
  12. package/dist/api-tokens-D5K_Csub.mjs +3 -0
  13. package/dist/{api-tokens-CSomx-l3.mjs → api-tokens-_6tMD1W4.mjs} +1 -1
  14. package/dist/{apply-Bs2jXsms.mjs → apply-CYLUMiZg.mjs} +109 -93
  15. package/dist/astro/index.d.mts +16 -12
  16. package/dist/astro/index.mjs +50 -9
  17. package/dist/astro/middleware/auth.d.mts +9 -9
  18. package/dist/astro/middleware/auth.mjs +29 -8
  19. package/dist/astro/middleware/redirect.mjs +8 -7
  20. package/dist/astro/middleware/request-context.mjs +17 -10
  21. package/dist/astro/middleware/seed.d.mts +1 -1
  22. package/dist/astro/middleware/seed.mjs +93 -71
  23. package/dist/astro/middleware/setup.mjs +1 -1
  24. package/dist/astro/middleware/workers.d.mts +6 -0
  25. package/dist/astro/middleware/workers.mjs +8 -0
  26. package/dist/astro/middleware.mjs +288 -159
  27. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
  28. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
  29. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  30. package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
  31. package/dist/astro/routes/api/admin/briefing.mjs +25 -23
  32. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -4
  33. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +11 -10
  34. package/dist/astro/routes/api/admin/byline-fields/index.mjs +11 -10
  35. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +11 -10
  36. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -20
  37. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -20
  38. package/dist/astro/routes/api/admin/bylines/index.mjs +22 -20
  39. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +17 -16
  40. package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -7
  41. package/dist/astro/routes/api/admin/comments/bulk.mjs +14 -13
  42. package/dist/astro/routes/api/admin/comments/counts.mjs +8 -7
  43. package/dist/astro/routes/api/admin/comments/index.mjs +14 -13
  44. package/dist/astro/routes/api/admin/context/_id_/history.mjs +43 -31
  45. package/dist/astro/routes/api/admin/context/_id_/index.mjs +43 -31
  46. package/dist/astro/routes/api/admin/context/_id_/review.mjs +48 -36
  47. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +48 -36
  48. package/dist/astro/routes/api/admin/context/diff.mjs +47 -35
  49. package/dist/astro/routes/api/admin/context/index.mjs +48 -36
  50. package/dist/astro/routes/api/admin/context/stale.mjs +47 -35
  51. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +43 -31
  52. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +47 -35
  53. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +47 -35
  54. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +44 -32
  55. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  56. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +7 -7
  57. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +7 -7
  58. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +72 -66
  59. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +72 -66
  60. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +64 -58
  61. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +71 -65
  62. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +71 -65
  63. package/dist/astro/routes/api/admin/plugins/index.mjs +64 -58
  64. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  65. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +64 -58
  66. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +71 -65
  67. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +64 -58
  68. package/dist/astro/routes/api/admin/plugins/updates.mjs +64 -58
  69. package/dist/astro/routes/api/admin/review-requests/_id_/image.mjs +26 -23
  70. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +33 -25
  71. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +56 -43
  72. package/dist/astro/routes/api/admin/review-requests/_id_/revoke.mjs +10 -9
  73. package/dist/astro/routes/api/admin/review-requests/index.mjs +54 -41
  74. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +64 -58
  75. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  76. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +64 -58
  77. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +20 -12
  78. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  79. package/dist/astro/routes/api/admin/users/_id_/index.mjs +40 -32
  80. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
  81. package/dist/astro/routes/api/admin/users/index.mjs +7 -7
  82. package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -5
  83. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  84. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
  85. package/dist/astro/routes/api/auth/invite/index.mjs +9 -9
  86. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
  87. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  88. package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -11
  89. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  90. package/dist/astro/routes/api/auth/me.mjs +11 -11
  91. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  92. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +5 -4
  93. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +5 -4
  94. package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -7
  95. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  96. package/dist/astro/routes/api/auth/passkey/options.mjs +14 -13
  97. package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
  98. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
  99. package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
  100. package/dist/astro/routes/api/auth/setup-token/index.mjs +32 -23
  101. package/dist/astro/routes/api/auth/setup-token/verify.mjs +32 -26
  102. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
  103. package/dist/astro/routes/api/auth/signup/request.mjs +12 -11
  104. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  105. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +21 -18
  106. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +19 -16
  107. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  108. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +8 -7
  109. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +8 -7
  110. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +8 -7
  111. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +24 -21
  112. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +35 -22
  113. package/dist/astro/routes/api/content/_collection_/_id_/release-readiness.mjs +9 -9
  114. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +8 -7
  115. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  116. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +35 -22
  117. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +23 -19
  118. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  119. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +8 -7
  120. package/dist/astro/routes/api/content/_collection_/_id_.mjs +14 -13
  121. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  122. package/dist/astro/routes/api/content/_collection_/index.mjs +14 -13
  123. package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
  124. package/dist/astro/routes/api/dashboard.mjs +16 -11
  125. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  126. package/dist/astro/routes/api/health.mjs +1 -1
  127. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  128. package/dist/astro/routes/api/import/probe.mjs +25 -24
  129. package/dist/astro/routes/api/import/wordpress/analyze.mjs +12 -11
  130. package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
  131. package/dist/astro/routes/api/import/wordpress/execute.mjs +51 -42
  132. package/dist/astro/routes/api/import/wordpress/media.d.mts +9 -9
  133. package/dist/astro/routes/api/import/wordpress/media.mjs +14 -14
  134. package/dist/astro/routes/api/import/wordpress/prepare.mjs +52 -40
  135. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +10 -10
  136. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +50 -38
  137. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  138. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +29 -27
  139. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  140. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +9 -9
  141. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +56 -47
  142. package/dist/astro/routes/api/integration/artifact.mjs +11 -8
  143. package/dist/astro/routes/api/integration/dispatch.mjs +17 -14
  144. package/dist/astro/routes/api/integrations/_provider_.mjs +11 -8
  145. package/dist/astro/routes/api/integrations/index.mjs +10 -7
  146. package/dist/astro/routes/api/manifest.mjs +5 -5
  147. package/dist/astro/routes/api/mcp.mjs +98 -88
  148. package/dist/astro/routes/api/media/_id_/confirm.mjs +12 -12
  149. package/dist/astro/routes/api/media/_id_.mjs +9 -9
  150. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  151. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  152. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  153. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  154. package/dist/astro/routes/api/media/upload-url.mjs +13 -13
  155. package/dist/astro/routes/api/media.mjs +16 -16
  156. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +48 -36
  157. package/dist/astro/routes/api/menus/_name_/items.mjs +48 -36
  158. package/dist/astro/routes/api/menus/_name_/reorder.mjs +48 -36
  159. package/dist/astro/routes/api/menus/_name_/translations.mjs +48 -36
  160. package/dist/astro/routes/api/menus/_name_.mjs +48 -36
  161. package/dist/astro/routes/api/menus/index.mjs +48 -36
  162. package/dist/astro/routes/api/oauth/authorize.mjs +9 -7
  163. package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -6
  164. package/dist/astro/routes/api/oauth/device/code.mjs +11 -9
  165. package/dist/astro/routes/api/oauth/device/token.mjs +10 -8
  166. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  167. package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -6
  168. package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -6
  169. package/dist/astro/routes/api/oauth/token.mjs +8 -6
  170. package/dist/astro/routes/api/openapi.json.mjs +5 -5
  171. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
  172. package/dist/astro/routes/api/redirects/404s/index.mjs +15 -14
  173. package/dist/astro/routes/api/redirects/404s/summary.mjs +15 -14
  174. package/dist/astro/routes/api/redirects/_id_.mjs +48 -37
  175. package/dist/astro/routes/api/redirects/index.mjs +48 -37
  176. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  177. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  178. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +66 -60
  179. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +66 -60
  180. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +66 -60
  181. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +66 -60
  182. package/dist/astro/routes/api/schema/collections/index.mjs +66 -60
  183. package/dist/astro/routes/api/schema/index.mjs +12 -11
  184. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +64 -58
  185. package/dist/astro/routes/api/schema/orphans/index.mjs +64 -58
  186. package/dist/astro/routes/api/search/enable.mjs +15 -14
  187. package/dist/astro/routes/api/search/index.mjs +14 -13
  188. package/dist/astro/routes/api/search/rebuild.mjs +15 -14
  189. package/dist/astro/routes/api/search/stats.mjs +9 -8
  190. package/dist/astro/routes/api/search/suggest.mjs +14 -13
  191. package/dist/astro/routes/api/sections/_slug_.mjs +48 -36
  192. package/dist/astro/routes/api/sections/index.mjs +48 -36
  193. package/dist/astro/routes/api/settings/email.mjs +5 -5
  194. package/dist/astro/routes/api/settings/reviews.mjs +11 -10
  195. package/dist/astro/routes/api/settings.mjs +48 -36
  196. package/dist/astro/routes/api/setup/admin-verify.mjs +14 -14
  197. package/dist/astro/routes/api/setup/admin.mjs +12 -12
  198. package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -31
  199. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  200. package/dist/astro/routes/api/setup/index.mjs +37 -33
  201. package/dist/astro/routes/api/setup/status.mjs +3 -3
  202. package/dist/astro/routes/api/snapshot.mjs +11 -9
  203. package/dist/astro/routes/api/system/heartbeat.mjs +2 -2
  204. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +51 -39
  205. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +51 -39
  206. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +51 -39
  207. package/dist/astro/routes/api/taxonomies/index.mjs +51 -39
  208. package/dist/astro/routes/api/themes/preview.mjs +8 -6
  209. package/dist/astro/routes/api/typegen.mjs +4 -4
  210. package/dist/astro/routes/api/well-known/auth.mjs +3 -3
  211. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  212. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  213. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +47 -35
  214. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +48 -36
  215. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +48 -36
  216. package/dist/astro/routes/api/widget-areas/_name_.mjs +45 -33
  217. package/dist/astro/routes/api/widget-areas/index.mjs +48 -36
  218. package/dist/astro/routes/api/widget-components.mjs +2 -2
  219. package/dist/astro/routes/robots.txt.mjs +11 -10
  220. package/dist/astro/routes/sitemap-_collection_.xml.mjs +20 -18
  221. package/dist/astro/routes/sitemap.xml.mjs +19 -17
  222. package/dist/astro/session-driver.d.mts +1 -1
  223. package/dist/astro/session-driver.mjs +4 -4
  224. package/dist/astro/types.d.mts +13 -13
  225. package/dist/atomic-authority-CnBQJ14T.mjs +33 -0
  226. package/dist/{audit-CYjfxG9i.mjs → audit-F5iWkbcJ.mjs} +11 -4
  227. package/dist/auth/providers/github.d.mts +1 -1
  228. package/dist/auth/providers/google.d.mts +1 -1
  229. package/dist/{auth-control-guard-CITT8ZA_.mjs → auth-control-guard-D4WW-wFF.mjs} +1 -1
  230. package/dist/{authorize-KcI0pAfN.mjs → authorize-EnP57AQl.mjs} +1 -1
  231. package/dist/{briefing-r3hXCDQC.mjs → briefing-BXsVwd4P.mjs} +1 -1
  232. package/dist/{briefing-BgQTljQt.mjs → briefing-CkCi6S-W.mjs} +445 -447
  233. package/dist/{bundle-S6zx-V4D.mjs → bundle-Cgak1zGE.mjs} +3 -3
  234. package/dist/{byline-Ctil4rij.mjs → byline-DEZKlzD9.mjs} +107 -113
  235. package/dist/{byline-fields-QpmruT5r.mjs → byline-fields-BGEIA9dZ.mjs} +3 -3
  236. package/dist/{byline-fields-51ja6JDa.d.mts → byline-fields-BmkhEDFF.d.mts} +10 -10
  237. package/dist/{byline-fields-DiCyW6eQ.mjs → byline-fields-Qg8TesxL.mjs} +1 -1
  238. package/dist/{byline-registry-rkr73qSE.mjs → byline-registry-CkuVVeJJ.mjs} +46 -76
  239. package/dist/{bylines-BcuBpzVi.mjs → bylines-7BQxRGyG.mjs} +4 -4
  240. package/dist/{bylines-v_ZUQnR-.mjs → bylines-LqNRjma2.mjs} +6 -6
  241. package/dist/{cache-V2BCplaY.mjs → cache-CSTy-R-K.mjs} +2 -2
  242. package/dist/{chunks-CnuL55JE.mjs → chunks-BnG3LPMN.mjs} +1 -1
  243. package/dist/cli/index.mjs +452 -263
  244. package/dist/cli/plugin-kit.d.mts +9 -9
  245. package/dist/cli/plugin-kit.mjs +2 -2
  246. package/dist/client/external-auth-headers.d.mts +1 -1
  247. package/dist/client/index.d.mts +11 -11
  248. package/dist/client/index.mjs +2 -2
  249. package/dist/{client-factory-C-y9VZDX.mjs → client-factory-BLSkgsTg.mjs} +1 -1
  250. package/dist/{comment-_nvJSS-A.mjs → comment-Bi7cJ9SS.mjs} +2 -2
  251. package/dist/{comment-reaction-DhVgJ17S.mjs → comment-reaction-BLqIj5mx.mjs} +1 -1
  252. package/dist/{comments-D4mIDjvA.mjs → comments-Dg_gWBEB.mjs} +1 -1
  253. package/dist/content-De_XeXy_.mjs +1230 -0
  254. package/dist/{content-CVCrcuvD.mjs → content-NobcQti0.mjs} +240 -161
  255. package/dist/{content-refresh-QvBIyb_g.mjs → content-refresh-l4mPoGeX.mjs} +170 -193
  256. package/dist/{context-MftkHbWx.mjs → context-6uqzU-M9.mjs} +95 -77
  257. package/dist/{context-JjKucxBm.mjs → context-B0SG9Xkc.mjs} +2 -2
  258. package/dist/{context-route-helpers-e1APrqSm.mjs → context-route-helpers-C8s26uDT.mjs} +2 -2
  259. package/dist/{cron-mGVPQ5e6.mjs → cron-D7zB6m8i.mjs} +36 -32
  260. package/dist/d1-binding-D6HZa3ks.mjs +8 -0
  261. package/dist/d1-dialect-B1b8cmxX.mjs +48 -0
  262. package/dist/{dashboard-ZJ7sMcBI.mjs → dashboard-B-OybCMw.mjs} +5 -5
  263. package/dist/database/batch.d.mts +20 -0
  264. package/dist/database/batch.mjs +69 -0
  265. package/dist/database/d1/index.d.mts +18 -0
  266. package/dist/database/d1/index.mjs +8 -0
  267. package/dist/db/d1.d.mts +7 -0
  268. package/dist/db/d1.mjs +13 -0
  269. package/dist/db/index.d.mts +4 -4
  270. package/dist/db/index.mjs +10 -7
  271. package/dist/db/libsql.d.mts +1 -1
  272. package/dist/db/libsql.mjs +46 -3
  273. package/dist/db/postgres.d.mts +1 -1
  274. package/dist/db/sqlite.d.mts +1 -1
  275. package/dist/{device-flow-eOcL5m0Q.mjs → device-flow-DhpCzMo0.mjs} +130 -94
  276. package/dist/{dialect-helpers-fk43GbDb.mjs → dialect-helpers-C6xtO-Ui.mjs} +1 -1
  277. package/dist/{discovery-CJkuHGhZ.mjs → discovery-CqXbN0WZ.mjs} +5 -5
  278. package/dist/{enrich-KErvJOuI.mjs → enrich-BjF-J4sF.mjs} +1 -1
  279. package/dist/{evidence-6IUv9ML3.mjs → evidence-xJf8hQgH.mjs} +7 -7
  280. package/dist/{field-defs-cache-CwrIyZFT.mjs → field-defs-cache-BKKFFf_V.mjs} +5 -5
  281. package/dist/{forgeway-account-lYJ8iX3G.mjs → forgeway-account-BeKJlKh1.mjs} +1 -1
  282. package/dist/{fts-manager-DX7ZkrCa.mjs → fts-manager-BeWtB7ZD.mjs} +72 -57
  283. package/dist/{hitl-requests-CmYVunm-.mjs → hitl-requests-evSsel48.mjs} +2 -2
  284. package/dist/{hitl-route-helpers-CRm537zS.mjs → hitl-route-helpers-D2kJSOFX.mjs} +5 -5
  285. package/dist/{import-DqRAgsKr.mjs → import-Jpta-CYE.mjs} +9 -9
  286. package/dist/{index-Co7xtjkd.d.mts → index-CSUSBfdD.d.mts} +7 -4
  287. package/dist/index.d.mts +16 -16
  288. package/dist/index.mjs +104 -96
  289. package/dist/{integration-credentials-qudN6yRr.mjs → integration-credentials-BrQr0fb_.mjs} +2 -2
  290. package/dist/{jsonld-BpvnSp2m.d.mts → jsonld-CqIVIeZK.d.mts} +2 -2
  291. package/dist/{load-fCOciq0Q.mjs → load-Dc5ttyg4.mjs} +1 -1
  292. package/dist/{loader-BDje8ME2.mjs → loader-Cgsx23wU.mjs} +4 -4
  293. package/dist/{manifest-schema-CfKD0thC.mjs → manifest-schema-DG29meRy.mjs} +1 -1
  294. package/dist/{mcp-reviewed-executor-DmhM3Cy6.mjs → mcp-reviewed-executor-DAZL3Ckt.mjs} +7 -7
  295. package/dist/media/image-endpoint.mjs +1 -1
  296. package/dist/media/index.d.mts +1 -1
  297. package/dist/media/index.mjs +2 -2
  298. package/dist/media/local-runtime.d.mts +11 -11
  299. package/dist/media/local-runtime.mjs +3 -3
  300. package/dist/{media-dvRjj4po.mjs → media-3fK0u-bo.mjs} +1 -1
  301. package/dist/{media-allowlist-DaG6lNoy.mjs → media-allowlist-rN4qIF6W.mjs} +1 -1
  302. package/dist/{menus-CpuR4Qkm.mjs → menus-5liJusbp.mjs} +138 -90
  303. package/dist/{menus-CZbz5L_V.mjs → menus-CbR_J8cJ.mjs} +8 -8
  304. package/dist/migrations-CMdxWKx-.mjs +76 -0
  305. package/dist/oauth-authority-CCqo4eBm.mjs +43 -0
  306. package/dist/{oauth-authorization-Jf5e3azH.mjs → oauth-authorization--0UtTZpv.mjs} +89 -98
  307. package/dist/{oauth-clients-tovQ4D4h.mjs → oauth-clients-D4WBYaYW.mjs} +2 -2
  308. package/dist/object-cache/memory.d.mts +1 -1
  309. package/dist/{object-cache-D51qOseS.mjs → object-cache-BGjIlY9s.mjs} +1 -1
  310. package/dist/page/index.d.mts +10 -10
  311. package/dist/page/index.mjs +1 -1
  312. package/dist/{parse-IsGn-5lt.mjs → parse--7nG62_h.mjs} +1 -1
  313. package/dist/plugin-utils.d.mts +9 -9
  314. package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
  315. package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
  316. package/dist/{plugins-DXyLI3Hb.mjs → plugins-DK1wLuao.mjs} +35 -84
  317. package/dist/{policy-DKdNMv8y.mjs → policy-Dej7NJFD.mjs} +2 -2
  318. package/dist/{preview-BXmS1SXL.mjs → preview-q0pkibNO.mjs} +2 -2
  319. package/dist/{provider-loader-DDq7R_RN.d.mts → provider-loader-C0GaLwKB.d.mts} +1 -1
  320. package/dist/{public-url-Ci7UbC0W.d.mts → public-url-B9zEdO8p.d.mts} +1 -1
  321. package/dist/{public-url-BQ9vf0AS.d.mts → public-url-BV-YQ_LF.d.mts} +2 -2
  322. package/dist/{publication-authorization-C-vYPGD8.mjs → publication-authorization-BrEZ2TsE.mjs} +459 -33
  323. package/dist/{query-CrW2yI6G.mjs → query-CEn9HXnf.mjs} +15 -15
  324. package/dist/{query-DcB9uGTW.mjs → query-DAS6VbMS.mjs} +4 -4
  325. package/dist/{rate-limit-DEkoxTsP.mjs → rate-limit-Dd1TnzZP.mjs} +2 -2
  326. package/dist/{redirect-DG-o0CKV.mjs → redirect-HLI3wT5Y.mjs} +26 -14
  327. package/dist/{redirects-Bjp4iKJU.mjs → redirects-DmOdfRjI.mjs} +5 -5
  328. package/dist/{redirects-N8gmWhVM.mjs → redirects-UCXyL0lP.mjs} +3 -3
  329. package/dist/{registry-D-IV_h50.mjs → registry-RD9qTnYL.mjs} +183 -186
  330. package/dist/release-BR08Slqf.mjs +5148 -0
  331. package/dist/request-context.d.mts +8 -0
  332. package/dist/{request-meta-BW0the1R.mjs → request-meta-BOcuHAXD.mjs} +1 -1
  333. package/dist/{resolve-pZ4NQM-X.mjs → resolve-C80Pm2DW.mjs} +1 -1
  334. package/dist/{review-payload-f1L4lzQg.mjs → review-payload-DEylbssM.mjs} +52 -4
  335. package/dist/{review-requests-DICrYH2-.mjs → review-requests-BF2eEKr8.mjs} +93 -37
  336. package/dist/{review-requests-BTKfeWlS.mjs → review-requests-CyfWbJ6W.mjs} +2 -2
  337. package/dist/{review-route-helpers-DaZBBps8.mjs → review-route-helpers-lKA-CXms.mjs} +2 -2
  338. package/dist/{revision-De7OmYVD.mjs → revision-090sZyGc.mjs} +28 -22
  339. package/dist/revocation-B7GL5fMl.mjs +53 -0
  340. package/dist/{runner-DJiRFyLI.mjs → runner-CVeq0266.mjs} +594 -491
  341. package/dist/{runner-Dye73myO.d.mts → runner-JnJSGXEB.d.mts} +1 -1
  342. package/dist/{runs-DEujUDOj.mjs → runs-B5BExdKO.mjs} +5 -5
  343. package/dist/runtime-env-CQVAWHzH.mjs +19 -0
  344. package/dist/runtime.d.mts +10 -10
  345. package/dist/runtime.mjs +5 -5
  346. package/dist/schema-DLMkODQc.mjs +8 -0
  347. package/dist/{search-DxUKN9Zz.mjs → search-CRzWNfxX.mjs} +4 -4
  348. package/dist/{secrets-AdCrGg1c.mjs → secrets-Cg0D2gQW.mjs} +10 -11
  349. package/dist/{sections-BPFOEMK6.mjs → sections-BwUjOGqn.mjs} +2 -2
  350. package/dist/seed/index.d.mts +2 -2
  351. package/dist/seed/index.mjs +29 -25
  352. package/dist/seo/index.d.mts +3 -3
  353. package/dist/seo/index.mjs +11 -10
  354. package/dist/{seo-DWHdo5aW.mjs → seo-BOTuCeh-.mjs} +25 -15
  355. package/dist/{seo-GfovzqpU.mjs → seo-B_tBFyud.mjs} +1 -1
  356. package/dist/{service-DbgjHWyW.mjs → service--bQht6oN.mjs} +2 -2
  357. package/dist/{service-BrNKVCjC.mjs → service-DilVsWGD.mjs} +3 -3
  358. package/dist/{session-user-D8WwGEPH.mjs → session-user-DeqTcAmR.mjs} +1 -1
  359. package/dist/{settings-CAsQLi0N.mjs → settings-DFzevIrU.mjs} +8 -8
  360. package/dist/{settings-BKEHw6Bu.mjs → settings-Deqx3Upy.mjs} +2 -2
  361. package/dist/{setup-complete-CHCYS5KV.mjs → setup-complete-BFqudwbW.mjs} +1 -1
  362. package/dist/{site-activity-7oezuHXK.mjs → site-activity-BrN2NviL.mjs} +11 -4
  363. package/dist/{site-context-CA7rbxux.mjs → site-context-vCiDRr4H.mjs} +50 -37
  364. package/dist/{site-url-DoZf_jVj.mjs → site-url-wXFqbm9c.mjs} +1 -1
  365. package/dist/state-jyNZ6-7L.mjs +30 -0
  366. package/dist/storage/local.d.mts +1 -1
  367. package/dist/storage/local.mjs +1 -1
  368. package/dist/storage/s3.d.mts +1 -1
  369. package/dist/storage/s3.mjs +3 -3
  370. package/dist/{store-c4qx3gVh.mjs → store-C1yDxxfv.mjs} +37 -12
  371. package/dist/submission-BsHNfHc7.mjs +155 -0
  372. package/dist/{taxonomies-ALDiRQ84.mjs → taxonomies-4cnTcbD6.mjs} +3 -3
  373. package/dist/{taxonomies-93DV-1QT.mjs → taxonomies-CllxqaH0.mjs} +7 -7
  374. package/dist/{taxonomy-BOBTJ_aE.mjs → taxonomy-DWxxLpp5.mjs} +3 -3
  375. package/dist/{tokens-c-qxNqzC.mjs → tokens-Bjuf1HID.mjs} +1 -1
  376. package/dist/{trusted-proxy-CdEl6g6B.mjs → trusted-proxy-CAW9o4Dw.mjs} +4 -12
  377. package/dist/{types-BRCUO8NR.d.mts → types-7Th6Mwz3.d.mts} +1 -0
  378. package/dist/{types-BpSTdH1H.mjs → types-BqxIv8Il.mjs} +2 -2
  379. package/dist/{types-6KmeXInJ.d.mts → types-CFgTpfPk.d.mts} +1 -1
  380. package/dist/{types-CfpX1og5.d.mts → types-QjOcidFc.d.mts} +301 -173
  381. package/dist/ui/server-runtime.d.mts +13 -13
  382. package/dist/ui/server-runtime.mjs +28 -26
  383. package/dist/{user-D0NJ7gYf.mjs → user-1-YV30lf.mjs} +2 -2
  384. package/dist/{utils-BK2efsHv.mjs → utils-Cglcqpm2.mjs} +2 -2
  385. package/dist/{validate-CDWVODvc.d.mts → validate-A27peRc4.d.mts} +3 -3
  386. package/dist/{validate-C9g9iX3q.mjs → validate-Wl4MSf3V.mjs} +3 -3
  387. package/dist/version-BWxyC5s4.mjs +6 -0
  388. package/dist/{widgets-Cm5Qx2Np.mjs → widgets-Di-6yDH7.mjs} +3 -3
  389. package/dist/{wordpress-slugs-WdPZaVXf.mjs → wordpress-slugs-vOx7R1dM.mjs} +1 -1
  390. package/dist/{worker-Bhuu7eqS.mjs → worker-RpaMP71d.mjs} +76 -47
  391. package/dist/workers-build-BaQCrSmf.mjs +36 -0
  392. package/dist/{zod-generator-DS5oZNaL.mjs → zod-generator-Cylvl_SM.mjs} +2 -2
  393. package/package.json +35 -9
  394. package/dist/after-BfniwgIf.mjs +0 -9
  395. package/dist/api-tokens-CmT83Bgj.mjs +0 -3
  396. package/dist/db/libsql-http.d.mts +0 -27
  397. package/dist/db/libsql-http.mjs +0 -29
  398. package/dist/libsql-dialect-CANq6UNI.mjs +0 -47
  399. package/dist/oauth-user-lookup-B451pZmd.mjs +0 -25
  400. package/dist/revocation-CkTOhdlw.mjs +0 -42
  401. package/dist/schema-IjuRxkqq.mjs +0 -8
  402. package/dist/submission-C47cHBIg.mjs +0 -67
  403. package/dist/transaction-BGQgnwUi.mjs +0 -28
  404. package/dist/version-CJqc1mwj.mjs +0 -6
  405. /package/dist/{base64-F8-DUraK.mjs → base64-Cz-aU0X1.mjs} +0 -0
  406. /package/dist/{challenge-store-CDKfye2r.mjs → challenge-store-D-_-VavY.mjs} +0 -0
  407. /package/dist/{components-DAq_4iPX.mjs → components-BWQUCJEr.mjs} +0 -0
  408. /package/dist/{config-CVssduLe.mjs → config-XW5tMrH8.mjs} +0 -0
  409. /package/dist/{content-index-names-Bbu1FY1r.mjs → content-index-names-CDc2IQIx.mjs} +0 -0
  410. /package/dist/{context-types-CPWAJRs5.mjs → context-types-DqTo6C79.mjs} +0 -0
  411. /package/dist/{default-BeIzUa1e.mjs → default-D9zxuUU7.mjs} +0 -0
  412. /package/dist/{email-console-Bfi_exVg.mjs → email-console-BONByQiC.mjs} +0 -0
  413. /package/dist/{error-DLg1H2LT.mjs → error-Dd8LtpG5.mjs} +0 -0
  414. /package/dist/{escape-C6lkys0j.mjs → escape-BWC4s5bV.mjs} +0 -0
  415. /package/dist/{experimental-workflows-B9x8delL.mjs → experimental-workflows-M5D3RTFo.mjs} +0 -0
  416. /package/dist/{hash-jhbF98tT.mjs → hash-lNx3KJis.mjs} +0 -0
  417. /package/dist/{media-url-CL3NzgLh.mjs → media-url-B4YtTY6c.mjs} +0 -0
  418. /package/dist/{mime-CDTtL7jE.mjs → mime-D_ae-u_U.mjs} +0 -0
  419. /package/dist/{mode-DJeacFCZ.mjs → mode-CPf_KZ37.mjs} +0 -0
  420. /package/dist/{normalize-Ev3FiBMx.mjs → normalize-5rct_U0I.mjs} +0 -0
  421. /package/dist/{oauth-state-store-Do1a_o3H.mjs → oauth-state-store-CMgcimzA.mjs} +0 -0
  422. /package/dist/{options-1dBRkoCl.mjs → options-BcqHWpc-.mjs} +0 -0
  423. /package/dist/{output-8j9oltTf.mjs → output-BYpiVUBf.mjs} +0 -0
  424. /package/dist/{parser-C9rzPuSZ.mjs → parser-BV0wzQHo.mjs} +0 -0
  425. /package/dist/{passkey-config-CRN44T04.mjs → passkey-config-BG4GO4OO.mjs} +0 -0
  426. /package/dist/{patterns-3XE9bU4r.mjs → patterns-CZ7D4y_R.mjs} +0 -0
  427. /package/dist/{placeholder-D03pGvqM.d.mts → placeholder-BHTaoCYx.d.mts} +0 -0
  428. /package/dist/{portable-text-tIk9_uz_.mjs → portable-text-B9YuySom.mjs} +0 -0
  429. /package/dist/{portable-text-BdRm4uZq.d.mts → portable-text-FKf3IrPz.d.mts} +0 -0
  430. /package/dist/{process-cache-B-L-A9zg.mjs → process-cache-MHM4Sqzs.mjs} +0 -0
  431. /package/dist/{provider-loader-C4i82ll1.mjs → provider-loader-3MY1SjzA.mjs} +0 -0
  432. /package/dist/{public-discovery-CyDzK1-S.mjs → public-discovery-BAbOvKiR.mjs} +0 -0
  433. /package/dist/{public-url-oudwI7K0.mjs → public-url-C7pbmS_7.mjs} +0 -0
  434. /package/dist/{public-url-BVIjzMo3.mjs → public-url-D5Wjq0sy.mjs} +0 -0
  435. /package/dist/{redirect-Dp5u-8dH.mjs → redirect-Bx96u2nS.mjs} +0 -0
  436. /package/dist/{request-cache-BruBnFAR.mjs → request-cache-DPmV5nk4.mjs} +0 -0
  437. /package/dist/{seo-contributions-BAtRDXEQ.mjs → seo-contributions-Dt57p6Sq.mjs} +0 -0
  438. /package/dist/{service-DeX1PRNt.mjs → service-wYQ_ePZ4.mjs} +0 -0
  439. /package/dist/{setup-nonce-D-CEYlw7.mjs → setup-nonce-CAqDUxxU.mjs} +0 -0
  440. /package/dist/{sidecar-client-Bw2C0XTf.mjs → sidecar-client-CnpGTvYq.mjs} +0 -0
  441. /package/dist/{slugify-KSsVD_D3.mjs → slugify-Di8Q_MFq.mjs} +0 -0
  442. /package/dist/{ssrf-C7tTSD1r.mjs → ssrf-LN16WMip.mjs} +0 -0
  443. /package/dist/{stable-hash-DF7R5eN8.mjs → stable-hash-DEtJgcp7.mjs} +0 -0
  444. /package/dist/{status-Bba6RbkS.mjs → status-Bwkeuz8g.mjs} +0 -0
  445. /package/dist/{transport-BddGhTAI.mjs → transport-472KVGBe.mjs} +0 -0
  446. /package/dist/{transport-ktLL9r2O.d.mts → transport-C0jj-Nc8.d.mts} +0 -0
  447. /package/dist/{types-BQZFeZjd.mjs → types-BDq9t5lG.mjs} +0 -0
  448. /package/dist/{types-CKIt_jmM.d.mts → types-Bs-7Geuh.d.mts} +0 -0
  449. /package/dist/{types-CLMOusxP.d.mts → types-CwkJp6zr.d.mts} +0 -0
  450. /package/dist/{types-C0DPvhR5.mjs → types-CyBH89BS.mjs} +0 -0
  451. /package/dist/{types-BbkkkAb6.mjs → types-D17dJRht.mjs} +0 -0
  452. /package/dist/{types--3oJQ0hs.d.mts → types-DTjrkhKU.d.mts} +0 -0
  453. /package/dist/{types-CPaVj_GC.d.mts → types-DkXuBo8k.d.mts} +0 -0
  454. /package/dist/{types-CU3Wn2HC.d.mts → types-b2sq7ZDk.d.mts} +0 -0
  455. /package/dist/{url-C_pLSrGZ.mjs → url-D375-6LM.mjs} +0 -0
  456. /package/dist/{url-Dumsft7G.mjs → url-bv5i4JN0.mjs} +0 -0
  457. /package/dist/{validate-VPnKoIzW.mjs → validate-Co3j6T_K.mjs} +0 -0
@@ -1,61 +1,71 @@
1
1
  #!/usr/bin/env node
2
- import { i as runMigrations, n as getMigrationStatus, t as getMigrationFingerprint } from "../runner-DJiRFyLI.mjs";
2
+ import { a as runMigrations, n as getMigrationFingerprint, r as getMigrationStatus } from "../runner-CVeq0266.mjs";
3
3
  import { t as createDatabase } from "../connection-DJ3GzHVH.mjs";
4
- import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
5
- import { l as listTablesLike } from "../dialect-helpers-fk43GbDb.mjs";
6
- import { n as getI18nConfig, r as isI18nEnabled } from "../config-CVssduLe.mjs";
7
- import { i as encodeBase64url } from "../base64-F8-DUraK.mjs";
8
- import "../types-BpSTdH1H.mjs";
9
- import { o as isMissingTableError } from "../loader-BDje8ME2.mjs";
10
- import "../object-cache-D51qOseS.mjs";
11
- import { n as slugify } from "../slugify-KSsVD_D3.mjs";
12
- import "../revision-De7OmYVD.mjs";
13
- import { t as ContentRepository } from "../content-CVCrcuvD.mjs";
14
- import { t as MediaRepository } from "../media-dvRjj4po.mjs";
15
- import { t as TaxonomyRepository } from "../taxonomy-BOBTJ_aE.mjs";
16
- import { t as OptionsRepository } from "../options-1dBRkoCl.mjs";
17
- import "../redirect-DG-o0CKV.mjs";
18
- import "../request-cache-BruBnFAR.mjs";
19
- import "../byline-registry-rkr73qSE.mjs";
20
- import "../field-defs-cache-CwrIyZFT.mjs";
21
- import { t as BylineRepository } from "../byline-Ctil4rij.mjs";
22
- import "../content-refresh-QvBIyb_g.mjs";
23
- import "../fts-manager-DX7ZkrCa.mjs";
24
- import "../public-discovery-CyDzK1-S.mjs";
25
- import { n as SchemaRegistry } from "../registry-D-IV_h50.mjs";
26
- import "../settings-CAsQLi0N.mjs";
27
- import { n as DinewayToolsService, r as integrationResponse, t as DinewayToolsError } from "../service-DeX1PRNt.mjs";
28
- import { i as parseEncryptionKeys, n as fingerprintKey, r as generateEncryptionKey, t as DinewaySecretsError } from "../secrets-AdCrGg1c.mjs";
29
- import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../ssrf-C7tTSD1r.mjs";
30
- import { n as VERSION } from "../version-CJqc1mwj.mjs";
31
- import { t as IntegrationCredentialStore } from "../store-c4qx3gVh.mjs";
32
- import { a as reconcileManifestAccess, i as pluginManifestSchema } from "../manifest-schema-CfKD0thC.mjs";
33
- import { t as validateSeed } from "../validate-C9g9iX3q.mjs";
34
- import { t as applySeed } from "../apply-Bs2jXsms.mjs";
35
- import { a as createForgewayAccountClient, c as normalizeForgewayApiUrl, d as refreshForgewayAccountCredentials, f as removeStoredForgewayAccount, g as writeForgewayCredentials, h as readForgewayCredentials, i as completeForgewayAccountLogin, l as normalizeForgewayEmail, m as listForgewayCredentials, n as DEFAULT_FORGEWAY_API_BASE_URL, o as getForgewayDinewayAccount, p as sendForgewayAccountLoginLink, r as InvalidForgewayAccountCredentialsError, s as normalizeDinewayWebUrl, t as DEFAULT_DINEWAY_WEB_URL, u as readStoredForgewayAccount } from "../forgeway-account-lYJ8iX3G.mjs";
36
- import { n as output, t as configureOutputMode } from "../output-8j9oltTf.mjs";
4
+ import "../d1-binding-D6HZa3ks.mjs";
5
+ import { AtomicWriteConflict, atomicBatch, rowUnchanged } from "../database/batch.mjs";
6
+ import { t as validateIdentifier } from "../validate-Co3j6T_K.mjs";
7
+ import { l as listTablesLike } from "../dialect-helpers-C6xtO-Ui.mjs";
8
+ import { n as getI18nConfig, r as isI18nEnabled } from "../config-XW5tMrH8.mjs";
9
+ import { i as encodeBase64url } from "../base64-Cz-aU0X1.mjs";
10
+ import "../types-BqxIv8Il.mjs";
11
+ import { o as isMissingTableError } from "../loader-Cgsx23wU.mjs";
12
+ import "../actor-DxUAJgQX.mjs";
13
+ import "../atomic-authority-CnBQJ14T.mjs";
14
+ import "../after-BVaUn7bK.mjs";
15
+ import "../object-cache-BGjIlY9s.mjs";
16
+ import { n as slugify } from "../slugify-Di8Q_MFq.mjs";
17
+ import "../revision-090sZyGc.mjs";
18
+ import { t as ContentRepository } from "../content-NobcQti0.mjs";
19
+ import { t as MediaRepository } from "../media-3fK0u-bo.mjs";
20
+ import { t as TaxonomyRepository } from "../taxonomy-DWxxLpp5.mjs";
21
+ import { t as OptionsRepository } from "../options-BcqHWpc-.mjs";
22
+ import "../redirect-HLI3wT5Y.mjs";
23
+ import "../request-cache-DPmV5nk4.mjs";
24
+ import "../byline-registry-CkuVVeJJ.mjs";
25
+ import "../field-defs-cache-BKKFFf_V.mjs";
26
+ import { t as BylineRepository } from "../byline-DEZKlzD9.mjs";
27
+ import { n as DinewayToolsService, r as integrationResponse, t as DinewayToolsError } from "../service-wYQ_ePZ4.mjs";
28
+ import "../runtime-env-CQVAWHzH.mjs";
29
+ import { i as parseEncryptionKeys, n as fingerprintKey, r as generateEncryptionKey, t as DinewaySecretsError } from "../secrets-Cg0D2gQW.mjs";
30
+ import "../content-refresh-l4mPoGeX.mjs";
31
+ import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../ssrf-LN16WMip.mjs";
32
+ import "../fts-manager-BeWtB7ZD.mjs";
33
+ import "../public-discovery-BAbOvKiR.mjs";
34
+ import { n as SchemaRegistry } from "../registry-RD9qTnYL.mjs";
35
+ import "../settings-DFzevIrU.mjs";
36
+ import { n as VERSION } from "../version-BWxyC5s4.mjs";
37
+ import { t as IntegrationCredentialStore } from "../store-C1yDxxfv.mjs";
38
+ import { a as reconcileManifestAccess, i as pluginManifestSchema } from "../manifest-schema-DG29meRy.mjs";
39
+ import "../migrations-CMdxWKx-.mjs";
40
+ import { t as validateSeed } from "../validate-Wl4MSf3V.mjs";
41
+ import { t as applySeed } from "../apply-CYLUMiZg.mjs";
42
+ import { n as validateWorkersBindings, t as WORKERS_BUILD_METADATA } from "../workers-build-BaQCrSmf.mjs";
43
+ import { n as d1ReleaseRevision } from "../state-jyNZ6-7L.mjs";
44
+ import { a as createForgewayAccountClient, c as normalizeForgewayApiUrl, d as refreshForgewayAccountCredentials, f as removeStoredForgewayAccount, g as writeForgewayCredentials, h as readForgewayCredentials, i as completeForgewayAccountLogin, l as normalizeForgewayEmail, m as listForgewayCredentials, n as DEFAULT_FORGEWAY_API_BASE_URL, o as getForgewayDinewayAccount, p as sendForgewayAccountLoginLink, r as InvalidForgewayAccountCredentialsError, s as normalizeDinewayWebUrl, t as DEFAULT_DINEWAY_WEB_URL, u as readStoredForgewayAccount } from "../forgeway-account-BeKJlKh1.mjs";
45
+ import { n as output, t as configureOutputMode } from "../output-BYpiVUBf.mjs";
37
46
  import { createHeaderAwareFetch, isRedirectResponse, resolveCustomHeaders } from "../client/external-auth-headers.mjs";
38
- import { t as convertDataForRead } from "../portable-text-tIk9_uz_.mjs";
39
- import { _ as saveMarketplaceCredential, a as ensureProjectGitignoreDinewayLocalState, c as resolveDinewayBaseUrl, d as getCredentials, f as getMarketplaceCredential, g as saveCredentials, h as resolveCredentialKey, i as DEFAULT_DINEWAY_URL, l as resolveDinewayToken, m as removeMarketplaceCredential, n as connectionArgs, o as ensureProjectGitignoreEntry, p as removeCredentials, r as createClientFromArgs, s as readProjectEnv, u as upsertProjectEnv } from "../client-factory-C-y9VZDX.mjs";
47
+ import { t as convertDataForRead } from "../portable-text-B9YuySom.mjs";
48
+ import { _ as saveMarketplaceCredential, a as ensureProjectGitignoreDinewayLocalState, c as resolveDinewayBaseUrl, d as getCredentials, f as getMarketplaceCredential, g as saveCredentials, h as resolveCredentialKey, i as DEFAULT_DINEWAY_URL, l as resolveDinewayToken, m as removeMarketplaceCredential, n as connectionArgs, o as ensureProjectGitignoreEntry, p as removeCredentials, r as createClientFromArgs, s as readProjectEnv, u as upsertProjectEnv } from "../client-factory-BLSkgsTg.mjs";
49
+ import { t as migrateD1Release } from "../release-BR08Slqf.mjs";
50
+ import { t as createD1Dialect } from "../d1-dialect-B1b8cmxX.mjs";
40
51
  import { LocalStorage } from "../storage/local.mjs";
41
- import { r as fileExists$11, t as bundleCommand } from "../bundle-S6zx-V4D.mjs";
52
+ import { r as fileExists$11, t as bundleCommand } from "../bundle-Cgak1zGE.mjs";
42
53
  import { createRequire } from "node:module";
43
54
  import { createHash } from "node:crypto";
44
- import { sql } from "kysely";
55
+ import { Kysely, sql } from "kysely";
45
56
  import { z } from "zod";
46
57
  import { createGzipDecoder, unpackTar } from "modern-tar";
47
- import { createReadStream, createWriteStream, existsSync, readFileSync, writeFileSync } from "node:fs";
58
+ import { createReadStream, existsSync, readFileSync, writeFileSync } from "node:fs";
48
59
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
49
60
  import sax from "sax";
50
61
  import { pathToFileURL } from "node:url";
62
+ import { access, mkdir, mkdtemp, readFile, readdir, realpath, rm, stat, writeFile } from "node:fs/promises";
51
63
  import { defineCommand, runCommand, runMain } from "citty";
52
64
  import { createInterface } from "node:readline/promises";
53
65
  import consola, { consola as consola$1 } from "consola";
54
66
  import pc from "picocolors";
55
- import { access, cp, lstat, mkdir, mkdtemp, readFile, readdir, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
56
- import { pipeline } from "node:stream/promises";
57
- import { createGzip } from "node:zlib";
58
- import { packTar } from "modern-tar/fs";
67
+ import { tmpdir } from "node:os";
68
+ import { createJiti } from "jiti";
59
69
  import { spawn } from "node:child_process";
60
70
  import { parse } from "parse5";
61
71
 
@@ -858,6 +868,257 @@ const contentCommand = defineCommand({
858
868
  }
859
869
  });
860
870
 
871
+ //#endregion
872
+ //#region src/cli/d1-project.ts
873
+ const BINDING_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
874
+ const pluginDescriptor = z.object({
875
+ id: z.string(),
876
+ version: z.string(),
877
+ entrypoint: z.string(),
878
+ format: z.enum(["native", "standard"]).optional(),
879
+ options: z.unknown().optional()
880
+ });
881
+ const integrationSchema = z.object({
882
+ name: z.literal("dineway"),
883
+ api: z.object({ dinewayConfig: z.object({
884
+ database: z.object({
885
+ entrypoint: z.string(),
886
+ config: z.unknown()
887
+ }).optional(),
888
+ plugins: z.array(pluginDescriptor).default([])
889
+ }) })
890
+ });
891
+ async function firstExisting(cwd, files) {
892
+ for (const file of files) {
893
+ const path = resolve(cwd, file);
894
+ try {
895
+ await access(path);
896
+ return path;
897
+ } catch (error) {
898
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
899
+ }
900
+ }
901
+ }
902
+ /** Read the public integration API without running Astro hooks or writing a bundled config. */
903
+ async function readProjectDinewayConfig(cwd) {
904
+ const path = await firstExisting(cwd, [
905
+ "astro.config.mjs",
906
+ "astro.config.ts",
907
+ "astro.config.js",
908
+ "astro.config.mts",
909
+ "astro.config.cjs"
910
+ ]);
911
+ if (!path) return void 0;
912
+ const jiti = createJiti(join(cwd, "package.json"), {
913
+ fsCache: false,
914
+ moduleCache: false,
915
+ nativeModules: [
916
+ "@astrojs/cloudflare",
917
+ "wrangler",
918
+ "miniflare"
919
+ ]
920
+ });
921
+ const config = z.object({ integrations: z.array(z.unknown()).default([]) }).parse(await jiti.import(path, { default: true }));
922
+ const found = (await Promise.all(config.integrations.flat(Infinity))).flatMap((integration) => {
923
+ const parsed = integrationSchema.safeParse(integration);
924
+ return parsed.success ? [parsed.data.api.dinewayConfig] : [];
925
+ });
926
+ if (found.length > 1) throw new Error("Configure exactly one Dineway integration.");
927
+ return found[0];
928
+ }
929
+ async function readD1Project(cwd) {
930
+ const config = await readProjectDinewayConfig(cwd);
931
+ if (config?.database?.entrypoint !== "dineway/db/d1") throw new Error("Configure database: d1({ binding: 'DB' }) in this project's Dineway integration.");
932
+ const { binding } = z.object({ binding: z.string().regex(BINDING_NAME) }).parse(config.database.config);
933
+ const jiti = createJiti(join(cwd, "package.json"), {
934
+ fsCache: false,
935
+ moduleCache: false,
936
+ nativeModules: [
937
+ "@astrojs/cloudflare",
938
+ "wrangler",
939
+ "miniflare"
940
+ ]
941
+ });
942
+ const plugins = [];
943
+ for (const descriptor of config.plugins) {
944
+ if (descriptor.format === "standard") throw new Error(`Plugin ${descriptor.id} must provide a verified native D1 migration plan.`);
945
+ const module = await jiti.import(descriptor.entrypoint);
946
+ if (typeof module.createPlugin !== "function") throw new Error(`Plugin ${descriptor.id} does not export createPlugin.`);
947
+ const createPlugin = module.createPlugin;
948
+ const plugin = createPlugin(descriptor.options ?? {});
949
+ if (plugin.id !== descriptor.id || plugin.version !== descriptor.version) throw new Error(`Plugin ${descriptor.id} descriptor and runtime versions differ. Rebuild the plugin before migrating.`);
950
+ plugins.push(plugin);
951
+ }
952
+ return {
953
+ binding,
954
+ plugins
955
+ };
956
+ }
957
+ const wranglerDatabaseSchema = z.object({
958
+ account_id: z.string().optional(),
959
+ compatibility_date: z.string().optional(),
960
+ d1_databases: z.array(z.object({
961
+ binding: z.string(),
962
+ database_name: z.string().optional(),
963
+ database_id: z.string().min(1)
964
+ }))
965
+ });
966
+ async function loadProjectWrangler(cwd, config, environment) {
967
+ const configPath = config ? resolve(cwd, config) : await firstExisting(cwd, [
968
+ "wrangler.jsonc",
969
+ "wrangler.json",
970
+ "wrangler.toml"
971
+ ]);
972
+ if (!configPath) throw new Error("Add a Wrangler configuration with the site's D1 binding before migrating.");
973
+ const require = createRequire(join(cwd, "package.json"));
974
+ let entry;
975
+ try {
976
+ entry = require.resolve("wrangler");
977
+ } catch (cause) {
978
+ throw new Error("Install Wrangler in this project before migrating D1.", { cause });
979
+ }
980
+ const module = await import(pathToFileURL(entry).href);
981
+ if (!module || typeof module !== "object" || !("getPlatformProxy" in module) || !("unstable_readConfig" in module)) throw new Error("This Wrangler version does not expose the required configuration and D1 proxy APIs.");
982
+ const api = module;
983
+ return {
984
+ api,
985
+ configPath,
986
+ config: wranglerDatabaseSchema.parse(api.unstable_readConfig({
987
+ config: configPath,
988
+ env: environment
989
+ }, { hideWarnings: true }))
990
+ };
991
+ }
992
+
993
+ //#endregion
994
+ //#region src/cli/commands/database.ts
995
+ async function migrateProjectD1(options) {
996
+ if (options.local === options.remote) throw new Error("Choose exactly one target: --local or --remote.");
997
+ const cwd = resolve(options.cwd);
998
+ const project = await readD1Project(cwd);
999
+ const wrangler = await loadProjectWrangler(cwd, options.config, options.environment);
1000
+ const bindings = wrangler.config.d1_databases.filter((item) => item.binding === project.binding);
1001
+ if (bindings.length !== 1) throw new Error(`Wrangler must define exactly one D1 binding named ${project.binding}.`);
1002
+ const selected = bindings[0];
1003
+ const accountId = wrangler.config.account_id ?? process.env.CLOUDFLARE_ACCOUNT_ID;
1004
+ if (options.remote && !accountId) throw new Error("Set account_id in Wrangler or CLOUDFLARE_ACCOUNT_ID to select the remote account explicitly.");
1005
+ const revision = d1ReleaseRevision(project.plugins);
1006
+ const target = {
1007
+ binding: project.binding,
1008
+ databaseId: selected.database_id,
1009
+ accountId: options.remote ? accountId : void 0,
1010
+ location: options.remote ? "remote" : "local",
1011
+ revision
1012
+ };
1013
+ if (options.dryRun) return {
1014
+ ...target,
1015
+ dryRun: true,
1016
+ message: "Would verify and apply core and configured plugin migrations. No database connection was opened."
1017
+ };
1018
+ const directory = await mkdtemp(join(tmpdir(), "dineway-d1-"));
1019
+ let proxy;
1020
+ let db;
1021
+ try {
1022
+ const configPath = join(directory, "wrangler.json");
1023
+ await writeFile(configPath, JSON.stringify({
1024
+ name: "dineway-migration",
1025
+ account_id: accountId,
1026
+ compatibility_date: wrangler.config.compatibility_date ?? "2026-09-01",
1027
+ d1_databases: [{
1028
+ ...selected,
1029
+ remote: options.remote
1030
+ }]
1031
+ }));
1032
+ proxy = await wrangler.api.getPlatformProxy({
1033
+ configPath,
1034
+ remoteBindings: options.remote,
1035
+ persist: options.remote ? false : { path: join(cwd, ".wrangler/state/v3") }
1036
+ });
1037
+ const binding = proxy.env[project.binding];
1038
+ if (!binding || typeof binding.batch !== "function" || typeof binding.prepare !== "function") throw new Error(`Wrangler did not provide D1 binding ${project.binding}.`);
1039
+ db = new Kysely({ dialect: createD1Dialect(binding) });
1040
+ const applied = await migrateD1Release(db, project.plugins, { adopt: options.adopt });
1041
+ return {
1042
+ ...target,
1043
+ dryRun: false,
1044
+ applied
1045
+ };
1046
+ } finally {
1047
+ try {
1048
+ await db?.destroy();
1049
+ } finally {
1050
+ try {
1051
+ await proxy?.dispose();
1052
+ } finally {
1053
+ await rm(directory, {
1054
+ recursive: true,
1055
+ force: true
1056
+ });
1057
+ }
1058
+ }
1059
+ }
1060
+ }
1061
+ const migrateCommand = defineCommand({
1062
+ meta: {
1063
+ name: "migrate",
1064
+ description: "Install or upgrade D1 before starting or deploying the site"
1065
+ },
1066
+ args: {
1067
+ cwd: {
1068
+ type: "string",
1069
+ default: process.cwd(),
1070
+ description: "Project directory"
1071
+ },
1072
+ local: {
1073
+ type: "boolean",
1074
+ default: false,
1075
+ description: "Migrate local Wrangler D1 state"
1076
+ },
1077
+ remote: {
1078
+ type: "boolean",
1079
+ default: false,
1080
+ description: "Migrate the explicitly configured Cloudflare account and D1 database"
1081
+ },
1082
+ "dry-run": {
1083
+ type: "boolean",
1084
+ default: false,
1085
+ description: "Validate configuration without connecting to D1 or writing files"
1086
+ },
1087
+ adopt: {
1088
+ type: "boolean",
1089
+ default: false,
1090
+ description: "Verify and adopt an imported, upgraded Node database"
1091
+ },
1092
+ config: {
1093
+ type: "string",
1094
+ description: "Wrangler configuration path"
1095
+ },
1096
+ env: {
1097
+ type: "string",
1098
+ description: "Wrangler environment"
1099
+ }
1100
+ },
1101
+ async run({ args }) {
1102
+ const result = await migrateProjectD1({
1103
+ cwd: args.cwd,
1104
+ local: args.local,
1105
+ remote: args.remote,
1106
+ dryRun: args["dry-run"],
1107
+ adopt: args.adopt,
1108
+ config: args.config,
1109
+ environment: args.env
1110
+ });
1111
+ consola.log(JSON.stringify(result, null, 2));
1112
+ }
1113
+ });
1114
+ const databaseCommand = defineCommand({
1115
+ meta: {
1116
+ name: "database",
1117
+ description: "Explicit database maintenance"
1118
+ },
1119
+ subCommands: { migrate: migrateCommand }
1120
+ });
1121
+
861
1122
  //#endregion
862
1123
  //#region src/cli/paywall.ts
863
1124
  const PAYWALL_MESSAGE_PATTERN = /\b(quota|credit|credits|upgrade|plan|billing|subscription|slot)\b/i;
@@ -1016,6 +1277,97 @@ async function handleCliPaywall(input) {
1016
1277
  return true;
1017
1278
  }
1018
1279
 
1280
+ //#endregion
1281
+ //#region src/cli/commands/deploy/utils/spawn.ts
1282
+ async function runCommand$1(command, args, options) {
1283
+ return new Promise((resolve, reject) => {
1284
+ const child = spawn(command, args, {
1285
+ cwd: options.cwd,
1286
+ env: {
1287
+ ...process.env,
1288
+ ...options.env
1289
+ },
1290
+ stdio: options.stdio === "inherit" ? "inherit" : [
1291
+ "ignore",
1292
+ "pipe",
1293
+ "pipe"
1294
+ ],
1295
+ shell: false
1296
+ });
1297
+ let stdout = "";
1298
+ let stderr = "";
1299
+ if (options.stdio !== "inherit") {
1300
+ child.stdout?.on("data", (chunk) => {
1301
+ stdout += chunk.toString();
1302
+ });
1303
+ child.stderr?.on("data", (chunk) => {
1304
+ stderr += chunk.toString();
1305
+ });
1306
+ }
1307
+ child.on("error", reject);
1308
+ child.on("close", (code) => {
1309
+ resolve({
1310
+ code: code ?? 0,
1311
+ stdout,
1312
+ stderr
1313
+ });
1314
+ });
1315
+ });
1316
+ }
1317
+ async function runCommandOrThrow(command, args, options) {
1318
+ const result = await runCommand$1(command, args, options);
1319
+ if (result.code !== 0) {
1320
+ const detail = result.stderr.trim() || result.stdout.trim() || `exit code ${result.code}`;
1321
+ throw new Error(`${command} ${args.join(" ")} failed: ${detail}`);
1322
+ }
1323
+ return result;
1324
+ }
1325
+
1326
+ //#endregion
1327
+ //#region src/cli/commands/deploy/utils/cli-resolver.ts
1328
+ async function confirm(message) {
1329
+ if (!process.stdin.isTTY) return false;
1330
+ const rl = createInterface({
1331
+ input: process.stdin,
1332
+ output: process.stdout
1333
+ });
1334
+ try {
1335
+ const answer = await rl.question(`${message} [y/N] `);
1336
+ return answer.trim().toLowerCase() === "y" || answer.trim().toLowerCase() === "yes";
1337
+ } finally {
1338
+ rl.close();
1339
+ }
1340
+ }
1341
+ function resolveProviderCli(cwd, binary) {
1342
+ const local = join(cwd, "node_modules", ".bin", process.platform === "win32" ? `${binary}.cmd` : binary);
1343
+ return existsSync(local) ? local : binary;
1344
+ }
1345
+ async function ensureTargetCli(target, cwd, options = {}) {
1346
+ if (!target.cli) return;
1347
+ if ((await runCommand$1(resolveProviderCli(cwd, target.cli.versionCommand.command), target.cli.versionCommand.args, { cwd }).catch(() => ({
1348
+ code: 1,
1349
+ stdout: "",
1350
+ stderr: ""
1351
+ }))).code === 0) return;
1352
+ if (options.dryRun) {
1353
+ consola.info(`[dry-run] Would verify ${target.cli.binary} CLI with ${target.cli.versionCommand.command} ${target.cli.versionCommand.args.join(" ")}`);
1354
+ if (target.cli.npmPackage) consola.info(`[dry-run] Would offer to install ${target.cli.npmPackage}`);
1355
+ else consola.info(`[dry-run] ${target.cli.installHint ?? `Install ${target.cli.binary} before deploying.`}`);
1356
+ return;
1357
+ }
1358
+ if (!target.cli.npmPackage) throw new Error(`${target.label} CLI is required. ${target.cli.installHint ?? `Install ${target.cli.binary} and try again.`}`);
1359
+ if (options.yes) throw new Error(`Install ${target.cli.npmPackage} and run this command again. The --yes flag does not approve global CLI installation.`);
1360
+ if (!await confirm(`${target.label} CLI is not installed. Install ${target.cli.npmPackage} globally now?`)) throw new Error(`Install ${target.cli.npmPackage} and run this command again.`);
1361
+ await runCommandOrThrow("npm", [
1362
+ "install",
1363
+ "--global",
1364
+ target.cli.npmPackage
1365
+ ], {
1366
+ cwd,
1367
+ stdio: "inherit"
1368
+ });
1369
+ }
1370
+
1019
1371
  //#endregion
1020
1372
  //#region src/cli/commands/deploy/utils/astro-adapter.ts
1021
1373
  const CLOUDFLARE_ADAPTER_PACKAGE = "@astrojs/cloudflare";
@@ -1348,6 +1700,9 @@ async function readWorkersBuild(cwd) {
1348
1700
  const config = workerBuildSchema.parse(JSON.parse(await readFile(configPath, "utf-8")));
1349
1701
  if (!config.compatibility_flags.includes("nodejs_compat")) throw new Error("Dineway Workers require compatibility_flags: [\"nodejs_compat\"].");
1350
1702
  const serverDir = dirname(configPath);
1703
+ if (!await exists(join(serverDir, WORKERS_BUILD_METADATA))) throw new Error("Missing Dineway build metadata. Rebuild the Cloudflare application before deploying.");
1704
+ await assertInsideDirectory(serverDir, join(serverDir, WORKERS_BUILD_METADATA));
1705
+ await validateWorkersBindings(serverDir, config);
1351
1706
  const entrypoint = resolve(serverDir, config.main);
1352
1707
  const assetsDir = resolve(serverDir, config.assets.directory);
1353
1708
  await assertInsideDirectory(serverDir, entrypoint);
@@ -1363,203 +1718,12 @@ async function readWorkersBuild(cwd) {
1363
1718
  };
1364
1719
  }
1365
1720
 
1366
- //#endregion
1367
- //#region src/cli/commands/deploy/targets/chatgpt-sites.ts
1368
- const HOSTING_PATH = ".openai/hosting.json";
1369
- const externalPersistence = z.unknown().refine((value) => value == null, "This Dineway Sites target uses external HTTP libSQL and S3; native D1/R2 bindings are not supported.");
1370
- const hostingSchema = z.object({
1371
- project_id: z.string().min(1),
1372
- static: z.null().optional(),
1373
- d1: externalPersistence.optional(),
1374
- r2: externalPersistence.optional(),
1375
- capabilities: z.array(z.string()).optional()
1376
- }).strict();
1377
- const NON_RUNTIME_ENTRIES = new Set([
1378
- ".prerender",
1379
- ".vite",
1380
- "wrangler.json",
1381
- ".dev.vars",
1382
- ".env"
1383
- ]);
1384
- const BINDING_KEYS = [
1385
- "kv_namespaces",
1386
- "d1_databases",
1387
- "r2_buckets",
1388
- "services",
1389
- "hyperdrive",
1390
- "vectorize",
1391
- "workflows",
1392
- "worker_loaders",
1393
- "queues",
1394
- "durable_objects",
1395
- "images",
1396
- "ai"
1397
- ];
1398
- async function readHosting(cwd, projectId) {
1399
- await assertInsideDirectory(cwd, join(cwd, HOSTING_PATH));
1400
- if (!(await lstat(join(cwd, HOSTING_PATH))).isFile()) throw new Error("Sites hosting.json must be a regular file.");
1401
- const config = hostingSchema.parse(JSON.parse(await readFile(join(cwd, HOSTING_PATH), "utf-8")));
1402
- if (projectId && projectId !== config.project_id) throw new Error("--site does not match .openai/hosting.json. Reuse the existing Sites project ID.");
1403
- return config;
1404
- }
1405
- async function assertRegularTree(path) {
1406
- const stat = await lstat(path);
1407
- if (stat.isDirectory()) for (const entry of await readdir(path)) await assertRegularTree(join(path, entry));
1408
- else if (!stat.isFile()) throw new Error("Sites build output must not contain symlinks or special files.");
1409
- }
1410
- function hasBinding(value) {
1411
- if (Array.isArray(value)) return value.length > 0;
1412
- if (value && typeof value === "object") return Object.values(value).some(hasBinding);
1413
- return value !== void 0 && value !== null && value !== false && value !== "";
1414
- }
1415
- const chatgptSitesTarget = {
1416
- name: "chatgpt-sites",
1417
- label: "ChatGPT Sites",
1418
- description: "Prepare an Astro Worker archive for publishing through the Sites connector.",
1419
- supportLevel: "experimental",
1420
- async generateConfig(cwd, options) {
1421
- if (await exists(join(cwd, HOSTING_PATH))) await readHosting(cwd, options.site);
1422
- else if (!options.site && !options.dryRun) throw new Error("Register or select a Site with the Sites connector first, then pass its exact project ID with --site or save it in .openai/hosting.json.");
1423
- const files = await generateWorkersConfig(cwd, options.dryRun);
1424
- files.push(await writeNewFile(cwd, HOSTING_PATH, JSON.stringify({ project_id: options.site }, null, " ") + "\n", options.dryRun));
1425
- return files;
1426
- },
1427
- async deploy(cwd, options) {
1428
- if (options.dryRun) return { message: "[dry-run] Would prepare dist/server/index.js and dist/.openai/hosting.json for the Sites hosting skill. Publishing uses the Sites connector." };
1429
- const hosting = await readHosting(cwd, options.site);
1430
- if (await exists(join(cwd, "drizzle")) || await exists(join(cwd, "dist/.openai/drizzle"))) throw new Error("This Dineway Sites target does not support Drizzle/D1 migrations. Use external HTTP libSQL with Dineway's runtime migrations.");
1431
- const build = await readWorkersBuild(cwd);
1432
- const unsupported = BINDING_KEYS.filter((key) => hasBinding(build.config[key]));
1433
- if (unsupported.length) throw new Error(`Sites cannot provision this Worker's Wrangler bindings: ${unsupported.join(", ")}. Use Dineway database sessions, libsqlHttp(), and S3 storage. Manage Sites bindings with the Sites connector.`);
1434
- await assertRegularTree(build.serverDir);
1435
- await assertRegularTree(build.assetsDir);
1436
- await mkdir(join(cwd, ".dineway"), { recursive: true });
1437
- await assertInsideDirectory(cwd, join(cwd, ".dineway"));
1438
- const stage = await mkdtemp(join(cwd, ".dineway/sites-"));
1439
- try {
1440
- const dist = join(stage, "upload/dist");
1441
- await mkdir(join(dist, ".openai"), { recursive: true });
1442
- await cp(build.serverDir, join(dist, "server"), {
1443
- recursive: true,
1444
- filter: (path) => !NON_RUNTIME_ENTRIES.has(basename(path))
1445
- });
1446
- await cp(build.assetsDir, join(dist, "client"), { recursive: true });
1447
- if (build.entrypoint !== join(build.serverDir, "index.js")) {
1448
- const entry = "./" + relative(build.serverDir, build.entrypoint).split(sep).join("/");
1449
- await writeFile(join(dist, "server/index.js"), `export { default } from ${JSON.stringify(entry)};\n`);
1450
- }
1451
- await writeFile(join(dist, ".openai/hosting.json"), JSON.stringify(hosting, null, " ") + "\n");
1452
- const archivePath = join(cwd, ".dineway/sites-deploy.tar.gz");
1453
- const preparedArchive = join(stage, "site.tar.gz");
1454
- await pipeline(packTar(join(stage, "upload")), createGzip(), createWriteStream(preparedArchive, { mode: 384 }));
1455
- await rename(preparedArchive, archivePath);
1456
- return { message: `Sites archive prepared: ${archivePath}. Not published yet. Use the sites-hosting skill to push the matching source, save this version, and deploy through the Sites connector.` };
1457
- } finally {
1458
- await rm(stage, {
1459
- recursive: true,
1460
- force: true
1461
- });
1462
- }
1463
- }
1464
- };
1465
-
1466
- //#endregion
1467
- //#region src/cli/commands/deploy/utils/spawn.ts
1468
- async function runCommand$1(command, args, options) {
1469
- return new Promise((resolve, reject) => {
1470
- const child = spawn(command, args, {
1471
- cwd: options.cwd,
1472
- env: {
1473
- ...process.env,
1474
- ...options.env
1475
- },
1476
- stdio: options.stdio === "inherit" ? "inherit" : [
1477
- "ignore",
1478
- "pipe",
1479
- "pipe"
1480
- ],
1481
- shell: false
1482
- });
1483
- let stdout = "";
1484
- let stderr = "";
1485
- if (options.stdio !== "inherit") {
1486
- child.stdout?.on("data", (chunk) => {
1487
- stdout += chunk.toString();
1488
- });
1489
- child.stderr?.on("data", (chunk) => {
1490
- stderr += chunk.toString();
1491
- });
1492
- }
1493
- child.on("error", reject);
1494
- child.on("close", (code) => {
1495
- resolve({
1496
- code: code ?? 0,
1497
- stdout,
1498
- stderr
1499
- });
1500
- });
1501
- });
1502
- }
1503
- async function runCommandOrThrow(command, args, options) {
1504
- const result = await runCommand$1(command, args, options);
1505
- if (result.code !== 0) {
1506
- const detail = result.stderr.trim() || result.stdout.trim() || `exit code ${result.code}`;
1507
- throw new Error(`${command} ${args.join(" ")} failed: ${detail}`);
1508
- }
1509
- return result;
1510
- }
1511
-
1512
- //#endregion
1513
- //#region src/cli/commands/deploy/utils/cli-resolver.ts
1514
- async function confirm(message) {
1515
- if (!process.stdin.isTTY) return false;
1516
- const rl = createInterface({
1517
- input: process.stdin,
1518
- output: process.stdout
1519
- });
1520
- try {
1521
- const answer = await rl.question(`${message} [y/N] `);
1522
- return answer.trim().toLowerCase() === "y" || answer.trim().toLowerCase() === "yes";
1523
- } finally {
1524
- rl.close();
1525
- }
1526
- }
1527
- function resolveProviderCli(cwd, binary) {
1528
- const local = join(cwd, "node_modules", ".bin", process.platform === "win32" ? `${binary}.cmd` : binary);
1529
- return existsSync(local) ? local : binary;
1530
- }
1531
- async function ensureTargetCli(target, cwd, options = {}) {
1532
- if (!target.cli) return;
1533
- if ((await runCommand$1(resolveProviderCli(cwd, target.cli.versionCommand.command), target.cli.versionCommand.args, { cwd }).catch(() => ({
1534
- code: 1,
1535
- stdout: "",
1536
- stderr: ""
1537
- }))).code === 0) return;
1538
- if (options.dryRun) {
1539
- consola.info(`[dry-run] Would verify ${target.cli.binary} CLI with ${target.cli.versionCommand.command} ${target.cli.versionCommand.args.join(" ")}`);
1540
- if (target.cli.npmPackage) consola.info(`[dry-run] Would offer to install ${target.cli.npmPackage}`);
1541
- else consola.info(`[dry-run] ${target.cli.installHint ?? `Install ${target.cli.binary} before deploying.`}`);
1542
- return;
1543
- }
1544
- if (!target.cli.npmPackage) throw new Error(`${target.label} CLI is required. ${target.cli.installHint ?? `Install ${target.cli.binary} and try again.`}`);
1545
- if (options.yes) throw new Error(`Install ${target.cli.npmPackage} and run this command again. The --yes flag does not approve global CLI installation.`);
1546
- if (!await confirm(`${target.label} CLI is not installed. Install ${target.cli.npmPackage} globally now?`)) throw new Error(`Install ${target.cli.npmPackage} and run this command again.`);
1547
- await runCommandOrThrow("npm", [
1548
- "install",
1549
- "--global",
1550
- target.cli.npmPackage
1551
- ], {
1552
- cwd,
1553
- stdio: "inherit"
1554
- });
1555
- }
1556
-
1557
1721
  //#endregion
1558
1722
  //#region src/cli/commands/deploy/targets/cloudflare.ts
1559
1723
  const cloudflareTarget = {
1560
1724
  name: "cloudflare",
1561
1725
  label: "Cloudflare Workers",
1562
- description: "Deploy an Astro Worker with Wrangler and remote libSQL/object storage.",
1726
+ description: "Deploy an Astro Worker with Wrangler, D1, and object storage.",
1563
1727
  supportLevel: "experimental",
1564
1728
  cli: {
1565
1729
  npmPackage: null,
@@ -1568,7 +1732,7 @@ const cloudflareTarget = {
1568
1732
  command: "wrangler",
1569
1733
  args: ["--version"]
1570
1734
  },
1571
- installHint: "Install wrangler in this project (for example: pnpm add -D wrangler@^4.131.1)."
1735
+ installHint: "Install wrangler in this project (for example: pnpm add -D wrangler@^4.156.1)."
1572
1736
  },
1573
1737
  async checkAuth(cwd) {
1574
1738
  return (await runCommand$1(resolveProviderCli(cwd, "wrangler"), ["whoami", "--json"], { cwd })).code === 0;
@@ -3480,8 +3644,7 @@ const targets = [
3480
3644
  dockerTarget,
3481
3645
  flyTarget,
3482
3646
  gcpTarget,
3483
- cloudflareTarget,
3484
- chatgptSitesTarget
3647
+ cloudflareTarget
3485
3648
  ];
3486
3649
  const DEFAULT_TARGET = "forgeway";
3487
3650
  function getTarget(name) {
@@ -3567,7 +3730,7 @@ const deployCommand = defineCommand({
3567
3730
  },
3568
3731
  site: {
3569
3732
  type: "string",
3570
- description: "Forgeway site ID/slug or exact ChatGPT Sites project ID",
3733
+ description: "Forgeway site ID/slug",
3571
3734
  required: false
3572
3735
  },
3573
3736
  "place-id": {
@@ -3756,7 +3919,7 @@ async function fileExists$3(path) {
3756
3919
  const devCommand = defineCommand({
3757
3920
  meta: {
3758
3921
  name: "dev",
3759
- description: "Start dev server with local database"
3922
+ description: "Start the development server"
3760
3923
  },
3761
3924
  args: {
3762
3925
  database: {
@@ -3790,26 +3953,28 @@ const devCommand = defineCommand({
3790
3953
  consola.error("No package.json found");
3791
3954
  process.exit(1);
3792
3955
  }
3793
- const database = resolveCliDatabaseTarget(cwd, args.database);
3794
- consola.info(`Database: ${database.display}`);
3795
- if (database.localPath && !await fileExists$3(database.localPath)) consola.start("Database not found, initializing...");
3796
- const db = createDatabase({ url: database.url });
3797
- try {
3798
- consola.start("Checking database migrations...");
3799
- const { applied } = await runMigrations(db);
3800
- if (applied.length > 0) consola.success(`Applied ${applied.length} migrations`);
3801
- else consola.info("Database up to date");
3802
- } catch (error) {
3803
- consola.error("Migration failed:", error);
3956
+ const database = (await readProjectDinewayConfig(cwd))?.database?.entrypoint === "dineway/db/d1" ? void 0 : resolveCliDatabaseTarget(cwd, args.database);
3957
+ if (database) {
3958
+ consola.info(`Database: ${database.display}`);
3959
+ if (database.localPath && !await fileExists$3(database.localPath)) consola.start("Database not found, initializing...");
3960
+ const db = createDatabase({ url: database.url });
3961
+ try {
3962
+ consola.start("Checking database migrations...");
3963
+ const { applied } = await runMigrations(db);
3964
+ if (applied.length > 0) consola.success(`Applied ${applied.length} migrations`);
3965
+ else consola.info("Database up to date");
3966
+ } catch (error) {
3967
+ consola.error("Migration failed:", error);
3968
+ await db.destroy();
3969
+ process.exit(1);
3970
+ }
3804
3971
  await db.destroy();
3805
- process.exit(1);
3806
- }
3807
- await db.destroy();
3972
+ } else consola.info("Using the configured D1 binding. Run dineway database migrate --local before starting a fresh database.");
3808
3973
  if (args.types) {
3809
3974
  const remoteUrl = pkg.dineway?.url || process.env.DINEWAY_URL;
3810
3975
  if (!remoteUrl) consola.warn("No remote URL configured. Set DINEWAY_URL or dineway.url in package.json");
3811
3976
  else try {
3812
- const { createClientFromArgs } = await import("../client-factory-C-y9VZDX.mjs").then((n) => n.t);
3977
+ const { createClientFromArgs } = await import("../client-factory-BLSkgsTg.mjs").then((n) => n.t);
3813
3978
  const client = createClientFromArgs({ url: remoteUrl });
3814
3979
  const schema = await client.schemaExport();
3815
3980
  const types = await client.schemaTypes();
@@ -3851,7 +4016,7 @@ const devCommand = defineCommand({
3851
4016
  stdio: "inherit",
3852
4017
  env: {
3853
4018
  ...process.env,
3854
- DINEWAY_DATABASE_URL: database.url
4019
+ ...database ? { DINEWAY_DATABASE_URL: database.url } : {}
3855
4020
  }
3856
4021
  });
3857
4022
  child.on("error", (error) => {
@@ -4539,21 +4704,44 @@ const INTEGRATION_TOKEN_ENV_SOURCES = [
4539
4704
  ["tikhub", "TIKHUB_API_KEY"]
4540
4705
  ];
4541
4706
  async function importIntegrationCredentialsFromEnvironment(db, env) {
4542
- if (await new OptionsRepository(db).exists(INTEGRATION_CREDENTIAL_IMPORT_MARKER)) return {
4707
+ const options = new OptionsRepository(db);
4708
+ if (await options.exists(INTEGRATION_CREDENTIAL_IMPORT_MARKER)) return {
4543
4709
  status: "already_completed",
4544
4710
  providers: []
4545
4711
  };
4546
4712
  const credentials = collectEnvironmentCredentials(env);
4547
4713
  const keys = await parseEncryptionKeys(env.DINEWAY_ENCRYPTION_KEY);
4548
4714
  if (credentials.length > 0 && (!keys || keys.length === 0)) throw new DinewaySecretsError("DINEWAY_ENCRYPTION_KEY is required to import Integration credentials.", "ENCRYPTION_KEY_REQUIRED");
4549
- await db.transaction().execute(async (trx) => {
4550
- const store = new IntegrationCredentialStore(trx, { keys: keys ?? [] });
4551
- for (const entry of credentials) if (!await store.status(entry.provider)) await store.set(entry.provider, entry.credential, "environment");
4552
- await new OptionsRepository(trx).set(INTEGRATION_CREDENTIAL_IMPORT_MARKER, {
4715
+ const store = new IntegrationCredentialStore(db, { keys: keys ?? [] });
4716
+ const checks = [sql`NOT EXISTS (SELECT 1 FROM options WHERE name = ${INTEGRATION_CREDENTIAL_IMPORT_MARKER})`];
4717
+ const statements = [];
4718
+ for (const entry of credentials) {
4719
+ const existing = await db.selectFrom("_dineway_integration_credentials").selectAll().where("provider", "=", entry.provider).executeTakeFirst();
4720
+ if (existing) checks.push(rowUnchanged("_dineway_integration_credentials", existing));
4721
+ else {
4722
+ checks.push(sql`NOT EXISTS (SELECT 1 FROM _dineway_integration_credentials WHERE provider = ${entry.provider})`);
4723
+ statements.push(await store.prepareSet(entry.provider, entry.credential, "environment"));
4724
+ }
4725
+ }
4726
+ statements.push(db.insertInto("options").values({
4727
+ name: INTEGRATION_CREDENTIAL_IMPORT_MARKER,
4728
+ value: JSON.stringify({
4553
4729
  completedAt: (/* @__PURE__ */ new Date()).toISOString(),
4554
4730
  providerCount: credentials.length
4731
+ })
4732
+ }).compile());
4733
+ try {
4734
+ await atomicBatch(db, {
4735
+ checks,
4736
+ statements
4555
4737
  });
4556
- });
4738
+ } catch (error) {
4739
+ if (error instanceof AtomicWriteConflict && await options.exists(INTEGRATION_CREDENTIAL_IMPORT_MARKER)) return {
4740
+ status: "already_completed",
4741
+ providers: []
4742
+ };
4743
+ throw error;
4744
+ }
4557
4745
  return {
4558
4746
  status: credentials.length > 0 ? "imported" : "completed_empty",
4559
4747
  providers: credentials.map((entry) => entry.provider)
@@ -5807,7 +5995,7 @@ const publishCommand = defineCommand({
5807
5995
  const pluginDir = resolve(args.dir);
5808
5996
  try {
5809
5997
  const { runCommand } = await import("citty");
5810
- const { bundleCommand } = await import("../bundle-S6zx-V4D.mjs").then((n) => n.n);
5998
+ const { bundleCommand } = await import("../bundle-Cgak1zGE.mjs").then((n) => n.n);
5811
5999
  await runCommand(bundleCommand, { rawArgs: ["--dir", pluginDir] });
5812
6000
  } catch {
5813
6001
  consola.error("Build failed");
@@ -8291,6 +8479,7 @@ function isFileNotFound(error) {
8291
8479
  */
8292
8480
  const builtInCommands = {
8293
8481
  init: initCommand,
8482
+ database: databaseCommand,
8294
8483
  account: accountCommand,
8295
8484
  types: typesCommand,
8296
8485
  dev: devCommand,