dineway 0.2.0 → 0.2.2

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 (409) hide show
  1. package/README.md +17 -17
  2. package/dist/activity-BDMlkpYY.mjs +79 -0
  3. package/dist/{activity-events-y6eT8UW6.mjs → activity-events-DEYmJhWd.mjs} +1 -77
  4. package/dist/{actor-CrObAPV0.mjs → actor-DA7yL9Yp.mjs} +1 -1
  5. package/dist/{allowed-origins-_oeyP6x-.mjs → allowed-origins-VLgv2PL1.mjs} +1 -1
  6. package/dist/api/route-utils.d.mts +9 -10
  7. package/dist/api/route-utils.mjs +14 -14
  8. package/dist/api/schemas/index.d.mts +2 -2
  9. package/dist/api/schemas/index.mjs +5 -5
  10. package/dist/{api-ByrU2q-Z.mjs → api-DsO87Qak.mjs} +51 -23
  11. package/dist/{api-tokens-CjVMQT-X.mjs → api-tokens-C4K9eocv.mjs} +1 -1
  12. package/dist/{apply-bZswmZPm.mjs → apply-DHT0l398.mjs} +19 -19
  13. package/dist/astro/index.d.mts +10 -11
  14. package/dist/astro/index.mjs +18 -5
  15. package/dist/astro/middleware/auth.d.mts +9 -19
  16. package/dist/astro/middleware/auth.mjs +6 -6
  17. package/dist/astro/middleware/redirect.mjs +5 -5
  18. package/dist/astro/middleware/request-context.mjs +2 -2
  19. package/dist/astro/middleware/seed.d.mts +1 -1
  20. package/dist/astro/middleware/seed.mjs +1 -1
  21. package/dist/astro/middleware/setup.mjs +1 -1
  22. package/dist/astro/middleware.mjs +142 -98
  23. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
  24. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
  25. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  26. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  27. package/dist/astro/routes/api/admin/briefing.mjs +18 -18
  28. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  29. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -9
  30. package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
  31. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
  32. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +16 -16
  33. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +16 -16
  34. package/dist/astro/routes/api/admin/bylines/index.mjs +16 -16
  35. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
  36. package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
  37. package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
  38. package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
  39. package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
  40. package/dist/astro/routes/api/admin/context/_id_/history.mjs +25 -24
  41. package/dist/astro/routes/api/admin/context/_id_/index.mjs +25 -24
  42. package/dist/astro/routes/api/admin/context/_id_/review.mjs +30 -29
  43. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +30 -29
  44. package/dist/astro/routes/api/admin/context/diff.mjs +29 -28
  45. package/dist/astro/routes/api/admin/context/index.mjs +30 -29
  46. package/dist/astro/routes/api/admin/context/stale.mjs +29 -28
  47. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +25 -24
  48. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +29 -28
  49. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +29 -28
  50. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +26 -25
  51. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
  52. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
  53. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
  54. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +55 -51
  55. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +55 -51
  56. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -44
  57. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -50
  58. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +54 -50
  59. package/dist/astro/routes/api/admin/plugins/index.mjs +47 -44
  60. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  61. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +47 -44
  62. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +54 -50
  63. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -44
  64. package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -44
  65. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
  66. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +30 -65
  67. package/dist/astro/routes/api/admin/review-requests/index.d.mts +2 -1
  68. package/dist/astro/routes/api/admin/review-requests/index.mjs +58 -11
  69. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -44
  70. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  71. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +47 -44
  72. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
  73. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  74. package/dist/astro/routes/api/admin/users/_id_/index.mjs +7 -7
  75. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
  76. package/dist/astro/routes/api/admin/users/index.mjs +6 -6
  77. package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
  78. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  79. package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
  80. package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
  81. package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
  82. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  83. package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
  84. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  85. package/dist/astro/routes/api/auth/me.mjs +8 -8
  86. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  87. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
  88. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  89. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
  90. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  91. package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
  92. package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
  93. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
  94. package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
  95. package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
  96. package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
  97. package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
  98. package/dist/astro/routes/api/auth/signup/request.mjs +9 -9
  99. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  100. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +13 -13
  101. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
  102. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  103. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -5
  104. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
  105. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -5
  106. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
  107. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +49 -21
  108. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -5
  109. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  110. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +67 -33
  111. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +14 -14
  112. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  113. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -5
  114. package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
  115. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  116. package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
  117. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
  118. package/dist/astro/routes/api/dashboard.mjs +8 -8
  119. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  120. package/dist/astro/routes/api/health.mjs +1 -1
  121. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  122. package/dist/astro/routes/api/import/probe.mjs +19 -19
  123. package/dist/astro/routes/api/import/wordpress/analyze.mjs +8 -8
  124. package/dist/astro/routes/api/import/wordpress/execute.d.mts +8 -9
  125. package/dist/astro/routes/api/import/wordpress/execute.mjs +35 -34
  126. package/dist/astro/routes/api/import/wordpress/media.d.mts +8 -9
  127. package/dist/astro/routes/api/import/wordpress/media.mjs +12 -12
  128. package/dist/astro/routes/api/import/wordpress/prepare.mjs +34 -33
  129. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +9 -10
  130. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +31 -30
  131. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  132. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +22 -22
  133. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +8 -9
  134. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +40 -39
  135. package/dist/astro/routes/api/integrations/_provider_.d.mts +8 -0
  136. package/dist/astro/routes/api/integrations/_provider_.mjs +51 -0
  137. package/dist/astro/routes/api/integrations/index.d.mts +7 -0
  138. package/dist/astro/routes/api/integrations/index.mjs +24 -0
  139. package/dist/astro/routes/api/manifest.mjs +4 -4
  140. package/dist/astro/routes/api/mcp.mjs +474 -167
  141. package/dist/astro/routes/api/media/_id_/confirm.mjs +10 -10
  142. package/dist/astro/routes/api/media/_id_.mjs +8 -8
  143. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  144. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  145. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  146. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  147. package/dist/astro/routes/api/media/upload-url.mjs +11 -11
  148. package/dist/astro/routes/api/media.mjs +14 -14
  149. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +30 -29
  150. package/dist/astro/routes/api/menus/_name_/items.mjs +30 -29
  151. package/dist/astro/routes/api/menus/_name_/reorder.mjs +30 -29
  152. package/dist/astro/routes/api/menus/_name_/translations.mjs +30 -29
  153. package/dist/astro/routes/api/menus/_name_.mjs +30 -29
  154. package/dist/astro/routes/api/menus/index.mjs +30 -29
  155. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  156. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  157. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  158. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  159. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  160. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  161. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  162. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  163. package/dist/astro/routes/api/openapi.json.mjs +4 -4
  164. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +20 -5
  165. package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
  166. package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
  167. package/dist/astro/routes/api/redirects/_id_.mjs +31 -30
  168. package/dist/astro/routes/api/redirects/index.mjs +31 -30
  169. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  170. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  171. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +49 -45
  172. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +49 -45
  173. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +49 -45
  174. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +49 -45
  175. package/dist/astro/routes/api/schema/collections/index.mjs +49 -45
  176. package/dist/astro/routes/api/schema/index.mjs +8 -8
  177. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -44
  178. package/dist/astro/routes/api/schema/orphans/index.mjs +47 -44
  179. package/dist/astro/routes/api/search/enable.mjs +11 -11
  180. package/dist/astro/routes/api/search/index.mjs +10 -10
  181. package/dist/astro/routes/api/search/rebuild.mjs +11 -11
  182. package/dist/astro/routes/api/search/stats.mjs +6 -6
  183. package/dist/astro/routes/api/search/suggest.mjs +10 -10
  184. package/dist/astro/routes/api/sections/_slug_.mjs +30 -29
  185. package/dist/astro/routes/api/sections/index.mjs +30 -29
  186. package/dist/astro/routes/api/settings/email.mjs +3 -3
  187. package/dist/astro/routes/api/settings.mjs +30 -29
  188. package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
  189. package/dist/astro/routes/api/setup/admin.mjs +10 -10
  190. package/dist/astro/routes/api/setup/dev-bypass.mjs +25 -25
  191. package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
  192. package/dist/astro/routes/api/setup/index.mjs +27 -27
  193. package/dist/astro/routes/api/setup/status.mjs +3 -3
  194. package/dist/astro/routes/api/snapshot.mjs +6 -6
  195. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +33 -32
  196. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +33 -32
  197. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +33 -32
  198. package/dist/astro/routes/api/taxonomies/index.mjs +33 -32
  199. package/dist/astro/routes/api/themes/preview.mjs +4 -4
  200. package/dist/astro/routes/api/typegen.mjs +4 -4
  201. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  202. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  203. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  204. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +29 -28
  205. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +30 -29
  206. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +30 -29
  207. package/dist/astro/routes/api/widget-areas/_name_.mjs +27 -26
  208. package/dist/astro/routes/api/widget-areas/index.mjs +30 -29
  209. package/dist/astro/routes/api/widget-components.mjs +2 -2
  210. package/dist/astro/routes/robots.txt.mjs +6 -6
  211. package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
  212. package/dist/astro/routes/sitemap.xml.mjs +7 -7
  213. package/dist/astro/session-driver.d.mts +1 -1
  214. package/dist/astro/session-driver.mjs +2 -2
  215. package/dist/astro/types.d.mts +13 -12
  216. package/dist/{audit-ByVKIwWF.mjs → audit-BzhwRVym.mjs} +1 -1
  217. package/dist/auth/providers/github.d.mts +1 -1
  218. package/dist/auth/providers/google.d.mts +1 -1
  219. package/dist/{auth-control-guard-CqeUmQsv.mjs → auth-control-guard-B_Dx-epW.mjs} +1 -1
  220. package/dist/{authorize-CcBxcHtz.mjs → authorize-D6MkRtPw.mjs} +1 -1
  221. package/dist/{briefing-BJaJI8dm.mjs → briefing-Cl70iEH5.mjs} +1 -1
  222. package/dist/{briefing-CawZ59CY.mjs → briefing-GFhLTLJo.mjs} +7 -7
  223. package/dist/{bundle-7C_DpkEq.mjs → bundle-CIrUlrkQ.mjs} +2 -2
  224. package/dist/{byline-e51-fWRs.mjs → byline-BJa1MyKB.mjs} +6 -6
  225. package/dist/{byline-fields-D-N5qVIG.mjs → byline-fields-BKzA0fJU.mjs} +1 -1
  226. package/dist/{byline-fields-CUvbslGc.d.mts → byline-fields-DxMpdtsZ.d.mts} +57 -47
  227. package/dist/{byline-fields-DOJO16Gm.mjs → byline-fields-yT4herdN.mjs} +10 -4
  228. package/dist/{byline-registry-87nNnYl4.mjs → byline-registry-Ba54M74c.mjs} +2 -2
  229. package/dist/{bylines-CMQNCNFh.mjs → bylines-B53Saxdb.mjs} +3 -3
  230. package/dist/{bylines-y4LO-dTj.mjs → bylines-kixFoaRV.mjs} +5 -5
  231. package/dist/{cache-C-FNTFYK.mjs → cache-fpisdt5Q.mjs} +2 -2
  232. package/dist/{chunks-CxBt-GxR.mjs → chunks-DX_b8_4Z.mjs} +1 -1
  233. package/dist/cli/index.d.mts +29 -1
  234. package/dist/cli/index.mjs +1527 -1222
  235. package/dist/cli/plugin-kit.d.mts +75 -0
  236. package/dist/cli/plugin-kit.mjs +4 -0
  237. package/dist/client/external-auth-headers.d.mts +1 -1
  238. package/dist/client/index.d.mts +27 -52
  239. package/dist/client/index.mjs +34 -7
  240. package/dist/client-factory-DEtHApCc.mjs +323 -0
  241. package/dist/{comment-DlA4iChg.mjs → comment-B88XcvU1.mjs} +1 -1
  242. package/dist/{comment-reaction-DfFao1ST.mjs → comment-reaction-Ckn6vCmB.mjs} +1 -1
  243. package/dist/{comments-DApFGMsP.mjs → comments-BDXsbL7z.mjs} +1 -1
  244. package/dist/{content-Bh4BDjv8.mjs → content-Cbl8HbIR.mjs} +2 -2
  245. package/dist/{content-refresh-CgutSUfO.mjs → content-refresh-BmkilU5M.mjs} +5 -5
  246. package/dist/{context-CK4ym2Sf.mjs → context-AJNd0tcG.mjs} +2 -2
  247. package/dist/{context-C5W3G18y.mjs → context-DT0tIsfw.mjs} +24 -13
  248. package/dist/{context-route-helpers-MASyGgWf.mjs → context-route-helpers-DhP--tTq.mjs} +2 -2
  249. package/dist/{dashboard-DQkVT7Ei.mjs → dashboard-YvDEYbS3.mjs} +4 -4
  250. package/dist/db/index.d.mts +3 -3
  251. package/dist/db/index.mjs +1 -1
  252. package/dist/db/libsql.d.mts +1 -1
  253. package/dist/db/postgres.d.mts +1 -1
  254. package/dist/db/sqlite.d.mts +1 -1
  255. package/dist/{device-flow-BnqRH-T9.mjs → device-flow-BKKeobcV.mjs} +5 -5
  256. package/dist/{enrich-DIFIFA8O.mjs → enrich-Ck9tfMqe.mjs} +1 -1
  257. package/dist/{error-CytFlgcd.mjs → error-BW9f_ynq.mjs} +16 -2
  258. package/dist/{experimental-workflows-BMsUnIAw.mjs → experimental-workflows-CgO73K4e.mjs} +1 -1
  259. package/dist/{field-defs-cache-DRNdhBJv.mjs → field-defs-cache-CiXP3eO3.mjs} +4 -4
  260. package/dist/{fts-manager-Crzypjqu.mjs → fts-manager-Zo9uhGel.mjs} +1 -1
  261. package/dist/{hitl-requests-B4Vbcmaq.mjs → hitl-requests-Bee8Cjj8.mjs} +2 -2
  262. package/dist/{hitl-route-helpers-hEVzvP8l.mjs → hitl-route-helpers-DtHaKGgm.mjs} +5 -5
  263. package/dist/{import-Bh9biJfx.mjs → import-C-zxnT89.mjs} +7 -7
  264. package/dist/{index-D4y6NGiy.d.mts → index-DybFmYtZ.d.mts} +79 -3
  265. package/dist/index.d.mts +15 -17
  266. package/dist/index.mjs +83 -78
  267. package/dist/integration-credentials-D3ZneN0L.mjs +49 -0
  268. package/dist/{jsonld-Dq0gsnOH.d.mts → jsonld-CoTa8I1a.d.mts} +2 -2
  269. package/dist/{load-DmYeniXl.mjs → load-Cuiyh8LT.mjs} +1 -1
  270. package/dist/{loader-CjWqjweO.mjs → loader-WHf22FwU.mjs} +2 -2
  271. package/dist/{manifest-schema-BxVPYMJR.mjs → manifest-schema-DKa3ZaJL.mjs} +6 -2
  272. package/dist/{mcp-reviewed-executor-TwVbMzG6.mjs → mcp-reviewed-executor-DnlF7mIL.mjs} +6 -3
  273. package/dist/media/image-endpoint.mjs +1 -1
  274. package/dist/media/index.d.mts +1 -1
  275. package/dist/media/index.mjs +2 -2
  276. package/dist/media/local-runtime.d.mts +10 -11
  277. package/dist/media/local-runtime.mjs +2 -2
  278. package/dist/{media-DMj0grzC.mjs → media-B4m-cnmj.mjs} +1 -1
  279. package/dist/{media-allowlist-BlVCSzHx.mjs → media-allowlist-BQyIBPzd.mjs} +1 -1
  280. package/dist/{menus-TaW1gKnk.mjs → menus-LYALU2Mf.mjs} +2 -2
  281. package/dist/{menus-xvsnVZXw.mjs → menus-oYfViqfE.mjs} +6 -6
  282. package/dist/{oauth-authorization-DiaGvRVz.mjs → oauth-authorization-CX7aa8Ph.mjs} +5 -5
  283. package/dist/{oauth-clients-Dl9E8dEM.mjs → oauth-clients-D9Gg0WjF.mjs} +2 -2
  284. package/dist/object-cache/memory.d.mts +1 -1
  285. package/dist/output-13u4dvu-.mjs +68 -0
  286. package/dist/page/index.d.mts +9 -3
  287. package/dist/page/index.mjs +1 -1
  288. package/dist/{parse-CbymENaR.mjs → parse-B-Y84oJl.mjs} +1 -1
  289. package/dist/plugin-utils.d.mts +8 -9
  290. package/dist/plugins/adapt-sandbox-entry.d.mts +8 -9
  291. package/dist/plugins/adapt-sandbox-entry.mjs +3 -1
  292. package/dist/{plugins-BolVa-tl.mjs → plugins-B7-4Okii.mjs} +95 -10
  293. package/dist/portable-text-Ehqj3I_y.d.mts +45 -0
  294. package/dist/{preview-vSVg6fwG.mjs → preview-BMIReQGc.mjs} +2 -2
  295. package/dist/{provider-loader-MD8zAbnH.d.mts → provider-loader-BIbIiz0P.d.mts} +1 -1
  296. package/dist/{public-url-gsp3oUbu.d.mts → public-url-DYISdY_R.d.mts} +1 -1
  297. package/dist/publication-authorization-BVQ5rCAF.mjs +985 -0
  298. package/dist/{query-CfRCdaL3.mjs → query-C_m8sn-S.mjs} +13 -13
  299. package/dist/{query-jaAmw8E1.mjs → query-DNczixZr.mjs} +3 -3
  300. package/dist/{rate-limit-ZLdyWoZF.mjs → rate-limit-oUGexQO1.mjs} +2 -2
  301. package/dist/{redirect-BAjt4Z6b.mjs → redirect-DoDgOWIA.mjs} +2 -2
  302. package/dist/{redirects-BTdwpQtE.mjs → redirects-CrP6U4hZ.mjs} +4 -4
  303. package/dist/{redirects-CA-xylPG.mjs → redirects-E_B6hvuz.mjs} +18 -10
  304. package/dist/{registry-CtyVedcN.mjs → registry-SEJqFliS.mjs} +24 -10
  305. package/dist/{request-meta-CUypToDJ.mjs → request-meta-DHFIzWcf.mjs} +1 -1
  306. package/dist/review-payload-BysRWpxS.mjs +111 -0
  307. package/dist/{review-requests-DUyEmtmG.mjs → review-requests-CObSuTYU.mjs} +1 -1
  308. package/dist/review-requests-Cu9051_B.mjs +142 -0
  309. package/dist/review-route-helpers-Dp_7PH8r.mjs +41 -0
  310. package/dist/{runner-1tC2tIRV.d.mts → runner-Bcy5w0vj.d.mts} +1 -1
  311. package/dist/{runner-DB7CRfOF.mjs → runner-BfWbi9YY.mjs} +1166 -447
  312. package/dist/runtime.d.mts +9 -10
  313. package/dist/runtime.mjs +3 -3
  314. package/dist/schema-Dk_N31V4.mjs +8 -0
  315. package/dist/{search-DSaLgEFI.mjs → search-BXEQepxL.mjs} +3 -3
  316. package/dist/{secrets-CDZo2k8L.mjs → secrets-CpGpyGcO.mjs} +1 -1
  317. package/dist/{sections-PVVXHGfp.mjs → sections-DxvEF6Bj.mjs} +2 -2
  318. package/dist/seed/index.d.mts +2 -2
  319. package/dist/seed/index.mjs +19 -19
  320. package/dist/seo/index.d.mts +1 -1
  321. package/dist/seo/index.mjs +1 -1
  322. package/dist/{seo-CQG3GCHQ.mjs → seo-D1RiaooQ.mjs} +1 -1
  323. package/dist/service-CY0aH6eI.mjs +347 -0
  324. package/dist/{service-DiN4ZuPp.mjs → service-QdG0YHws.mjs} +2 -2
  325. package/dist/{settings-i4VPP8bT.mjs → settings-Dje-PHXo.mjs} +2 -2
  326. package/dist/{settings-BbqgHWpU.mjs → settings-SVDAB7_W.mjs} +5 -5
  327. package/dist/{site-activity-Dy3FROs0.mjs → site-activity-BVK40wCy.mjs} +1 -1
  328. package/dist/{site-context-DQiL8Fl5.mjs → site-context-CzaEGizi.mjs} +565 -129
  329. package/dist/stable-hash-DshcXvRE.mjs +19 -0
  330. package/dist/storage/local.d.mts +1 -1
  331. package/dist/storage/local.mjs +1 -1
  332. package/dist/storage/s3.d.mts +1 -1
  333. package/dist/storage/s3.mjs +1 -1
  334. package/dist/store-CCfMD6nw.mjs +262 -0
  335. package/dist/{taxonomies-9s-v03H-.mjs → taxonomies-DuhGjBa8.mjs} +3 -3
  336. package/dist/{taxonomies-DRiixp_E.mjs → taxonomies-WVnFki0o.mjs} +6 -6
  337. package/dist/{taxonomy-Dvsw6BOs.mjs → taxonomy-CCo2plmV.mjs} +2 -2
  338. package/dist/{types-DU0bU2Wu.d.mts → types-BFeoAIHl.d.mts} +596 -2
  339. package/dist/{types-Dq1qT19x.mjs → types-Bshd_6wQ.mjs} +1 -1
  340. package/dist/{runtime-BOeiQsCv.d.mts → types-CJezJeNE.d.mts} +3561 -1355
  341. package/dist/{types-4garmdWa.mjs → types-CK0r-Xq4.mjs} +5 -2
  342. package/dist/{types-C_ly5eTp.d.mts → types-GtwhHAg8.d.mts} +1 -1
  343. package/dist/{types-DW_-sFyz.d.mts → types-ywmuDETA.d.mts} +2 -0
  344. package/dist/ui/server-runtime.d.mts +12 -14
  345. package/dist/ui/server-runtime.mjs +21 -21
  346. package/dist/{user-BIZPzCb9.mjs → user-Bcvr5ihC.mjs} +2 -2
  347. package/dist/{utils-CMDhr5Xd.mjs → utils-B7gemXz5.mjs} +1 -1
  348. package/dist/{validate-CZvb-BKB.d.mts → validate-YiX3rly5.d.mts} +59 -5
  349. package/dist/{validate-DNs0pTSc.mjs → validate-qKzI3BCv.mjs} +2 -2
  350. package/dist/version-DEAV9k58.mjs +6 -0
  351. package/dist/{widgets-f0ibZUIq.mjs → widgets-DyGcotPM.mjs} +3 -3
  352. package/dist/{wordpress-slugs-BhHJX8XE.mjs → wordpress-slugs-D_LfQCan.mjs} +1 -1
  353. package/dist/{zod-generator-B7TMjyFJ.mjs → zod-generator-Cr3SiHsc.mjs} +2 -2
  354. package/package.json +16 -6
  355. package/dist/hitl-Hw1RmWOq.mjs +0 -677
  356. package/dist/review-requests-C9Ff11Vq.mjs +0 -79
  357. package/dist/schema-DXdYj4R3.mjs +0 -8
  358. package/dist/types-C46EvNdc.d.mts +0 -56
  359. package/dist/types-C8XW6L19.d.mts +0 -1468
  360. package/dist/version-BTvfRGc6.mjs +0 -6
  361. /package/dist/{adapters-NVSs4UH7.d.mts → adapters-DnMDRQ4e.d.mts} +0 -0
  362. /package/dist/{api-tokens-2r7OWi_I.mjs → api-tokens-D4tcY8R6.mjs} +0 -0
  363. /package/dist/{challenge-store-Bjlepa2E.mjs → challenge-store-BMkL2kmt.mjs} +0 -0
  364. /package/dist/{components-Bclf98Be.mjs → components-D0w9MzQe.mjs} +0 -0
  365. /package/dist/{context-types-DqTo6C79.mjs → context-types-eBuMDAg-.mjs} +0 -0
  366. /package/dist/{cron-cKcNTix_.mjs → cron-D_c3WUPN.mjs} +0 -0
  367. /package/dist/{default--K40jqm0.mjs → default-BxoI3SoK.mjs} +0 -0
  368. /package/dist/{email-console-ChgKFO8-.mjs → email-console-BEMwuxhV.mjs} +0 -0
  369. /package/dist/{escape-Bd4P_xKg.mjs → escape-smSUOb7u.mjs} +0 -0
  370. /package/dist/{hash-BPmX6P8I.mjs → hash-mxxx2oPW.mjs} +0 -0
  371. /package/dist/{media-url-lEKSrpr9.mjs → media-url-B6d-yVI6.mjs} +0 -0
  372. /package/dist/{mime-CA7Lgovc.mjs → mime-C0vOHFm7.mjs} +0 -0
  373. /package/dist/{mode-C4CIyjtR.mjs → mode-DPC7segX.mjs} +0 -0
  374. /package/dist/{normalize-5ek_z7de.mjs → normalize-Cyt7JdF7.mjs} +0 -0
  375. /package/dist/{oauth-state-store-CNoXafF7.mjs → oauth-state-store-DPVzeoyY.mjs} +0 -0
  376. /package/dist/{oauth-user-lookup-Ygw4bNyt.mjs → oauth-user-lookup-3E5jlXrr.mjs} +0 -0
  377. /package/dist/{parser-C1nYd-81.mjs → parser-DX_c5iG3.mjs} +0 -0
  378. /package/dist/{passkey-config-BUwu8BA3.mjs → passkey-config-DE_0EGEP.mjs} +0 -0
  379. /package/dist/{patterns-BhAvqO0S.mjs → patterns-CoqlXUvk.mjs} +0 -0
  380. /package/dist/{placeholder-uvNRZBX9.d.mts → placeholder-C6ZjZcmJ.d.mts} +0 -0
  381. /package/dist/{portable-text-dA_UlJwW.mjs → portable-text-BASHceim.mjs} +0 -0
  382. /package/dist/{process-cache-7xgAO9JY.mjs → process-cache-CCDgti7j.mjs} +0 -0
  383. /package/dist/{provider-loader-D0w9dqjm.mjs → provider-loader-BeQcnPN1.mjs} +0 -0
  384. /package/dist/{public-url-BEz_sM9n.mjs → public-url-BA-7LKvQ.mjs} +0 -0
  385. /package/dist/{redirect-wphRBv4y.mjs → redirect-CZFAqHLr.mjs} +0 -0
  386. /package/dist/{request-cache-D9GQBxMP.mjs → request-cache-CBFjCwSt.mjs} +0 -0
  387. /package/dist/{resolve-Cb6Dbz-C.mjs → resolve-B6BpqwAR.mjs} +0 -0
  388. /package/dist/{seo-qa7Dn0jK.mjs → seo-BLszyJxd.mjs} +0 -0
  389. /package/dist/{seo-contributions-C1EnikHB.mjs → seo-contributions-Ci8_12_r.mjs} +0 -0
  390. /package/dist/{session-user-CAKImna3.mjs → session-user-BwliEFp0.mjs} +0 -0
  391. /package/dist/{setup-complete-B8fl-mjV.mjs → setup-complete-PvF8I7Oh.mjs} +0 -0
  392. /package/dist/{setup-nonce-CoyjILvW.mjs → setup-nonce-DkpYROqg.mjs} +0 -0
  393. /package/dist/{sidecar-client-C3mqXg4C.mjs → sidecar-client-dt5fv23q.mjs} +0 -0
  394. /package/dist/{site-url-BML3GQYm.mjs → site-url-DfYDZyWl.mjs} +0 -0
  395. /package/dist/{ssrf-DWe8jwAp.mjs → ssrf-BZHvtFEv.mjs} +0 -0
  396. /package/dist/{status-DANd8ERo.mjs → status-BN40hMpr.mjs} +0 -0
  397. /package/dist/{tokens-1RK1n6ED.mjs → tokens-DIzhPT80.mjs} +0 -0
  398. /package/dist/{transaction-C2EOMTJA.mjs → transaction-0LEAAy8R.mjs} +0 -0
  399. /package/dist/{transport-CcJu3Co8.d.mts → transport-BZ3aqdu7.d.mts} +0 -0
  400. /package/dist/{transport-BNmCqLu7.mjs → transport-C46KHLMP.mjs} +0 -0
  401. /package/dist/{trusted-proxy-DTXQ2IMv.mjs → trusted-proxy-czZuby6G.mjs} +0 -0
  402. /package/dist/{types-B3t5cxhU.mjs → types-B7TDDFMG.mjs} +0 -0
  403. /package/dist/{types-CDpH6MA4.d.mts → types-BsTXSvKG.d.mts} +0 -0
  404. /package/dist/{types-DF7ZuGGk.d.mts → types-CDcuRd4z.d.mts} +0 -0
  405. /package/dist/{types-Rc3gQqqw.d.mts → types-S9VIopdY.d.mts} +0 -0
  406. /package/dist/{types-POH8PQZh.d.mts → types-YxFz4lDr.d.mts} +0 -0
  407. /package/dist/{types-C5CVgwsV.mjs → types-gvNBqijt.mjs} +0 -0
  408. /package/dist/{url-CpyFDFpO.mjs → url-D282S1Zw.mjs} +0 -0
  409. /package/dist/{url-Cac7a9QZ.mjs → url-guoXQQcV.mjs} +0 -0
@@ -1,44 +1,267 @@
1
1
  import "../../../dialect-helpers-fk43GbDb.mjs";
2
2
  import "../../../base64-F8-DUraK.mjs";
3
- import "../../../types-Dq1qT19x.mjs";
4
- import "../../../loader-CjWqjweO.mjs";
3
+ import "../../../types-Bshd_6wQ.mjs";
4
+ import "../../../loader-WHf22FwU.mjs";
5
5
  import "../../../object-cache-D51qOseS.mjs";
6
- import "../../../content-Bh4BDjv8.mjs";
7
- import "../../../media-DMj0grzC.mjs";
6
+ import "../../../content-Cbl8HbIR.mjs";
7
+ import "../../../media-B4m-cnmj.mjs";
8
8
  import "../../../options-DQPTH5n0.mjs";
9
- import "../../../site-activity-Dy3FROs0.mjs";
10
- import { t as ReviewRequestRepository } from "../../../review-requests-DUyEmtmG.mjs";
11
- import { a as ASSIGNMENT_STATUSES, i as ASSIGNMENT_PRIORITIES, l as HITL_REQUEST_PRIORITIES, r as ASSIGNMENT_ACTOR_TYPES, t as HitlRequestService, u as HITL_REQUEST_STATUSES } from "../../../hitl-Hw1RmWOq.mjs";
12
- import "../../../request-cache-D9GQBxMP.mjs";
13
- import { a as ContextRepository, i as parseSiteBriefingScope, r as formatSiteBriefingText, t as SiteBriefingAssembler } from "../../../briefing-CawZ59CY.mjs";
14
- import { t as SITE_CONTEXT_TYPES } from "../../../context-types-DqTo6C79.mjs";
15
- import "../../../content-refresh-CgutSUfO.mjs";
16
- import "../../../fts-manager-Crzypjqu.mjs";
17
- import "../../../registry-CtyVedcN.mjs";
18
- import "../../../settings-BbqgHWpU.mjs";
19
- import { n as VERSION } from "../../../version-BTvfRGc6.mjs";
20
- import "../../../query-jaAmw8E1.mjs";
21
- import "../../../zod-generator-B7TMjyFJ.mjs";
22
- import "../../../schema-DXdYj4R3.mjs";
23
- import { t as apiError } from "../../../error-CytFlgcd.mjs";
24
- import { Cn as contentBylineInputSchema, P as settingsUpdateBody, _n as bylineCreateBody, cn as contentSeoInput, xn as bylineUpdateBody } from "../../../redirects-CA-xylPG.mjs";
25
- import "../../../byline-fields-DOJO16Gm.mjs";
26
- import "../../../status-DANd8ERo.mjs";
9
+ import "../../../site-activity-BVK40wCy.mjs";
10
+ import { t as ReviewRequestRepository } from "../../../review-requests-CObSuTYU.mjs";
11
+ import { a as HITL_REQUEST_STATUSES, i as HITL_REQUEST_PRIORITIES, o as HitlRequestRepository, r as ReleasePayloadBuilder, t as PublicationAuthorizationError } from "../../../publication-authorization-BVQ5rCAF.mjs";
12
+ import { C as ASSIGNMENT_STATUSES, S as ASSIGNMENT_PRIORITIES, _ as toPublicContextDiff, a as EntityResolver, b as HitlRequestService, d as SettingsHitlPayloadBuilder, g as RiskPolicyEvaluator, h as SchemaHitlPayloadBuilder, i as ActorExpertiseService, n as AssignmentService, r as HandoffSnapshotStore, t as WorkflowHitlCoordinator, v as toPublicContextEntry, x as ASSIGNMENT_ACTOR_TYPES, y as toPublicContextEntryPage } from "../../../site-context-CzaEGizi.mjs";
13
+ import "../../../request-cache-CBFjCwSt.mjs";
14
+ import { a as ContextRepository, i as parseSiteBriefingScope, r as formatSiteBriefingText, t as SiteBriefingAssembler } from "../../../briefing-GFhLTLJo.mjs";
15
+ import { t as SITE_CONTEXT_TYPES } from "../../../context-types-eBuMDAg-.mjs";
16
+ import "../../../content-refresh-BmkilU5M.mjs";
17
+ import "../../../fts-manager-Zo9uhGel.mjs";
18
+ import "../../../registry-SEJqFliS.mjs";
19
+ import { a as getSiteSettingsWithDb } from "../../../settings-SVDAB7_W.mjs";
20
+ import { t as ReviewPayloadBuilder } from "../../../review-payload-BysRWpxS.mjs";
21
+ import { n as VERSION } from "../../../version-DEAV9k58.mjs";
22
+ import "../../../query-DNczixZr.mjs";
23
+ import "../../../zod-generator-Cr3SiHsc.mjs";
24
+ import "../../../schema-Dk_N31V4.mjs";
25
+ import { t as DinewaySecretsError } from "../../../secrets-CpGpyGcO.mjs";
26
+ import { t as IntegrationCredentialStore } from "../../../store-CCfMD6nw.mjs";
27
+ import { t as apiError } from "../../../error-BW9f_ynq.mjs";
28
+ import { Cn as contentBylineInputSchema, P as settingsUpdateBody, _n as bylineCreateBody, cn as contentSeoInput, xn as bylineUpdateBody } from "../../../redirects-E_B6hvuz.mjs";
29
+ import "../../../byline-fields-yT4herdN.mjs";
30
+ import "../../../status-BN40hMpr.mjs";
27
31
  import "../../../api/schemas/index.mjs";
28
- import { i as hasScope } from "../../../api-tokens-2r7OWi_I.mjs";
29
- import { r as registerPluginMcpRegistry, t as createReviewedPluginMcpCommandExecutor } from "../../../mcp-reviewed-executor-TwVbMzG6.mjs";
30
- import { t as resolveActorIdentity } from "../../../actor-CrObAPV0.mjs";
31
- import { d as logSchemaActivity, o as logContentActivity, p as logSiteActivitySafely, r as contentMcpToolSource, t as activityChangedKeys, x as schemaMcpToolSource } from "../../../activity-events-y6eT8UW6.mjs";
32
- import "../../../utils-CMDhr5Xd.mjs";
33
- import "../../../search-DSaLgEFI.mjs";
34
- import { n as convertDataForWrite, t as convertDataForRead } from "../../../portable-text-dA_UlJwW.mjs";
35
- import { _ as ReviewPayloadBuilder, a as EntityResolver, b as toPublicContextEntryPage, d as SettingsHitlPayloadBuilder, g as RiskPolicyEvaluator, h as SchemaHitlPayloadBuilder, i as ActorExpertiseService, n as AssignmentService, r as HandoffSnapshotStore, t as WorkflowHitlCoordinator, v as toPublicContextDiff, y as toPublicContextEntry } from "../../../site-context-DQiL8Fl5.mjs";
32
+ import { i as hasScope } from "../../../api-tokens-D4tcY8R6.mjs";
33
+ import { r as registerPluginMcpRegistry, t as createReviewedPluginMcpCommandExecutor } from "../../../mcp-reviewed-executor-DnlF7mIL.mjs";
34
+ import { n as resolveActorIdentity } from "../../../actor-DA7yL9Yp.mjs";
35
+ import "../../../activity-BDMlkpYY.mjs";
36
+ import { d as logSchemaActivity, o as logContentActivity, p as logSiteActivitySafely, r as contentMcpToolSource, t as activityChangedKeys, x as schemaMcpToolSource } from "../../../activity-events-DEYmJhWd.mjs";
37
+ import "../../../utils-B7gemXz5.mjs";
38
+ import "../../../search-BXEQepxL.mjs";
39
+ import { n as convertDataForWrite, t as convertDataForRead } from "../../../portable-text-BASHceim.mjs";
40
+ import { f as readStoredForgewayAccount, n as DinewayToolsService, p as refreshForgewayAccountCredentials, s as createForgewayAccountClient, t as DinewayToolsError, u as normalizeForgewayApiUrl } from "../../../service-CY0aH6eI.mjs";
36
41
  import { z } from "zod";
37
42
  import { Role, canActOnOwn, hasPermission } from "@dineway-ai/auth";
38
43
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
39
44
  import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
45
+ import { ForgewayClient } from "@forgeway/sdk";
40
46
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
41
47
 
48
+ //#region src/dineway-tools/runtime.ts
49
+ async function createDinewayToolsRuntimeService(options = {}) {
50
+ const platformApiUrl = normalizeForgewayApiUrl(options.platformApiUrl ?? readEnv("DINEWAY_API_BASE_URL", "DINEWAY_FORGEWAY_API_URL", "FORGEWAY_API_URL"));
51
+ const accessToken = options.accessToken ?? readEnv("DINEWAY_FORGEWAY_ACCESS_TOKEN");
52
+ if (accessToken) return new DinewayToolsService(createForgewayAccountClient(platformApiUrl, accessToken).integration);
53
+ const apiKey = options.apiKey ?? readEnv("DINEWAY_API_KEY", "FORGEWAY_API_KEY");
54
+ if (apiKey) return new DinewayToolsService(new ForgewayClient({
55
+ baseUrl: platformApiUrl,
56
+ isServerMode: true,
57
+ headers: { "X-API-Key": apiKey },
58
+ auth: { detectOAuthCallback: false }
59
+ }).integration);
60
+ const stored = await readStoredForgewayAccount({ platformApiUrl });
61
+ if (!stored) throw new DinewayToolsError("Dineway Tools requires a Forgeway account or DINEWAY_API_KEY in this runtime.", "FORGEWAY_ACCOUNT_REQUIRED");
62
+ const refreshed = await refreshForgewayAccountCredentials(stored);
63
+ return new DinewayToolsService(createForgewayAccountClient(refreshed.platformApiUrl, refreshed.accessToken).integration);
64
+ }
65
+ function readEnv(...names) {
66
+ const meta = import.meta.env ?? {};
67
+ const proc = typeof process !== "undefined" && process.env ? process.env : {};
68
+ for (const name of names) {
69
+ const value = meta[name] ?? proc[name];
70
+ if (value) return value;
71
+ }
72
+ }
73
+
74
+ //#endregion
75
+ //#region src/mcp/dineway-tools.ts
76
+ const readAnnotations = {
77
+ readOnlyHint: true,
78
+ destructiveHint: false,
79
+ idempotentHint: true,
80
+ openWorldHint: true
81
+ };
82
+ const runAnnotations = {
83
+ readOnlyHint: false,
84
+ destructiveHint: true,
85
+ idempotentHint: false,
86
+ openWorldHint: true
87
+ };
88
+ const stopAnnotations = {
89
+ readOnlyHint: false,
90
+ destructiveHint: true,
91
+ idempotentHint: true,
92
+ openWorldHint: true
93
+ };
94
+ const billingModeSchema = z.enum(["site_byok", "hosted"]).default("site_byok").describe("Billing mode. Defaults to site_byok; hosted credits are used only when explicitly selected.");
95
+ const jsonValueSchema = z.json();
96
+ const jsonObjectSchema = z.record(z.string(), jsonValueSchema);
97
+ const endpointInputSchema = z.object({
98
+ body: jsonValueSchema.optional(),
99
+ query_params: jsonObjectSchema.optional(),
100
+ path_params: jsonObjectSchema.optional(),
101
+ header_params: jsonObjectSchema.optional(),
102
+ body_type: z.string().trim().min(1).optional()
103
+ }).strict();
104
+ async function serviceOrThrow(options) {
105
+ const service = options.service ?? await options.resolveService?.();
106
+ if (!service) throw new DinewayToolsError("Dineway Tools is unavailable in this runtime.", "TOOLS_UNAVAILABLE");
107
+ return service;
108
+ }
109
+ function result(data) {
110
+ const structuredContent = isRecord(data) ? data : { result: data };
111
+ return {
112
+ content: [{
113
+ type: "text",
114
+ text: JSON.stringify(data, null, 2)
115
+ }],
116
+ structuredContent
117
+ };
118
+ }
119
+ function isRecord(value) {
120
+ return typeof value === "object" && value !== null && !Array.isArray(value);
121
+ }
122
+ function errorResult$1(error) {
123
+ return {
124
+ content: [{
125
+ type: "text",
126
+ text: error instanceof DinewayToolsError || error instanceof DinewaySecretsError ? error.message : "Dineway Tools request failed. Check the endpoint input and try again."
127
+ }],
128
+ isError: true
129
+ };
130
+ }
131
+ async function credentialFor(provider, billingMode, extra, options) {
132
+ if (billingMode === "hosted") return void 0;
133
+ const credential = await options.resolveCredential(provider, options.getContext(extra));
134
+ if (!credential) throw new DinewayToolsError(`No site BYOK credential is configured for provider ${provider}. Configure it in Settings > Integrations or explicitly select hosted billing.`, "SITE_BYOK_CREDENTIAL_MISSING");
135
+ return credential;
136
+ }
137
+ function mapInput(input) {
138
+ if (!input) return {};
139
+ return {
140
+ body: input.body,
141
+ queryParams: input.query_params,
142
+ pathParams: input.path_params,
143
+ headerParams: input.header_params,
144
+ bodyType: input.body_type
145
+ };
146
+ }
147
+ function registerDinewayTools(server, options) {
148
+ server.registerTool("tools_discover", {
149
+ title: "Discover Dineway Tools",
150
+ description: "Search hundreds of Forgeway integration endpoints using natural language. Use inspect before run.",
151
+ inputSchema: z.object({
152
+ query: z.string().trim().min(1).max(500),
153
+ limit: z.number().int().min(1).max(100).default(10),
154
+ min_score: z.number().min(0).max(1).optional()
155
+ }),
156
+ annotations: readAnnotations
157
+ }, async (args, extra) => {
158
+ options.authorizeRead(extra);
159
+ try {
160
+ return result(await (await serviceOrThrow(options)).discover({
161
+ query: args.query,
162
+ limit: args.limit,
163
+ minScore: args.min_score
164
+ }));
165
+ } catch (error) {
166
+ return errorResult$1(error);
167
+ }
168
+ });
169
+ server.registerTool("tools_inspect", {
170
+ title: "Inspect a Dineway Tool",
171
+ description: "Inspect one integration endpoint's input schema, output shape, risk policy, and credit price before running it.",
172
+ inputSchema: z.object({
173
+ provider: z.string().trim().min(1).max(100),
174
+ endpoint: z.string().trim().min(1).max(500)
175
+ }),
176
+ annotations: readAnnotations
177
+ }, async (args, extra) => {
178
+ options.authorizeRead(extra);
179
+ try {
180
+ return result(await (await serviceOrThrow(options)).inspect(args));
181
+ } catch (error) {
182
+ return errorResult$1(error);
183
+ }
184
+ });
185
+ server.registerTool("tools_run", {
186
+ title: "Run a Dineway Tool",
187
+ description: "Start one inspected integration endpoint. Site BYOK is the safe default; hosted credits require explicit selection.",
188
+ inputSchema: z.object({
189
+ provider: z.string().trim().min(1).max(100),
190
+ endpoint: z.string().trim().min(1).max(500),
191
+ input: endpointInputSchema.optional(),
192
+ billing_mode: billingModeSchema,
193
+ force_refresh: z.boolean().default(false),
194
+ confirm_side_effect: z.boolean().default(false),
195
+ idempotency_key: z.string().trim().min(1).max(500).optional()
196
+ }),
197
+ annotations: runAnnotations
198
+ }, async (args, extra) => {
199
+ options.authorizeRun(extra);
200
+ try {
201
+ if (args.confirm_side_effect && !args.idempotency_key) throw new DinewayToolsError("An idempotency key is required when confirming an endpoint with side effects.", "IDEMPOTENCY_KEY_REQUIRED");
202
+ const credential = await credentialFor(args.provider, args.billing_mode, extra, options);
203
+ return result(await (await serviceOrThrow(options)).run({
204
+ provider: args.provider,
205
+ endpoint: args.endpoint,
206
+ input: mapInput(args.input),
207
+ credential,
208
+ forceRefresh: args.force_refresh,
209
+ confirmSideEffect: args.confirm_side_effect
210
+ }, { idempotencyKey: args.idempotency_key }));
211
+ } catch (error) {
212
+ return errorResult$1(error);
213
+ }
214
+ });
215
+ server.registerTool("tools_get_run", {
216
+ title: "Get a Dineway Tools Run",
217
+ description: "Read the current state and result of one integration run.",
218
+ inputSchema: z.object({ run_id: z.string().uuid() }),
219
+ annotations: readAnnotations
220
+ }, async (args, extra) => {
221
+ options.authorizeRead(extra);
222
+ try {
223
+ return result(await (await serviceOrThrow(options)).getRun(args.run_id));
224
+ } catch (error) {
225
+ return errorResult$1(error);
226
+ }
227
+ });
228
+ server.registerTool("tools_list_runs", {
229
+ title: "List Dineway Tools Runs",
230
+ description: "List recent integration runs with cursor pagination.",
231
+ inputSchema: z.object({
232
+ limit: z.number().int().min(1).max(100).default(20),
233
+ cursor: z.string().trim().min(1).optional()
234
+ }),
235
+ annotations: readAnnotations
236
+ }, async (args, extra) => {
237
+ options.authorizeRead(extra);
238
+ try {
239
+ return result(await (await serviceOrThrow(options)).listRuns(args));
240
+ } catch (error) {
241
+ return errorResult$1(error);
242
+ }
243
+ });
244
+ server.registerTool("tools_stop_run", {
245
+ title: "Stop a Dineway Tools Run",
246
+ description: "Stop one cancellable integration run. Site BYOK is the safe default; hosted credits require explicit selection.",
247
+ inputSchema: z.object({
248
+ run_id: z.string().uuid(),
249
+ billing_mode: billingModeSchema
250
+ }),
251
+ annotations: stopAnnotations
252
+ }, async (args, extra) => {
253
+ options.authorizeRun(extra);
254
+ try {
255
+ const service = await serviceOrThrow(options);
256
+ const credential = await credentialFor((await service.getRun(args.run_id)).provider, args.billing_mode, extra, options);
257
+ return result(await service.stopRun(args.run_id, { credential }));
258
+ } catch (error) {
259
+ return errorResult$1(error);
260
+ }
261
+ });
262
+ }
263
+
264
+ //#endregion
42
265
  //#region src/mcp/server.ts
43
266
  const COLLECTION_SLUG_PATTERN = /^[a-z][a-z0-9_]*$/;
44
267
  const ENTITY_RESOLVE_TYPES = [
@@ -109,7 +332,7 @@ function getDineway(extra) {
109
332
  }
110
333
  async function getCollectionFields(dineway, collection) {
111
334
  try {
112
- const { SchemaRegistry } = await import("../../../schema-DXdYj4R3.mjs").then((n) => n.t);
335
+ const { SchemaRegistry } = await import("../../../schema-Dk_N31V4.mjs").then((n) => n.t);
113
336
  return (await new SchemaRegistry(dineway.db).getCollectionWithFields(collection))?.fields ?? null;
114
337
  } catch {
115
338
  return null;
@@ -126,7 +349,7 @@ async function applyReadMarkdown(dineway, collection, items) {
126
349
  for (const item of items) if (item.data && typeof item.data === "object") item.data = convertDataForRead(item.data, fields, false);
127
350
  }
128
351
  async function invalidateBylines() {
129
- const { invalidateBylineCache } = await import("../../../bylines-y4LO-dTj.mjs").then((n) => n.t);
352
+ const { invalidateBylineCache } = await import("../../../bylines-kixFoaRV.mjs").then((n) => n.t);
130
353
  invalidateBylineCache();
131
354
  }
132
355
  function canReadDrafts(extra) {
@@ -304,27 +527,83 @@ function allowedEntityResolveTypes(payload, requestedTypes) {
304
527
  if (disallowed.length > 0) throw new McpError(ErrorCode.InvalidRequest, `Insufficient scope or role for entity types: ${disallowed.join(", ")}`);
305
528
  return requestedTypes;
306
529
  }
307
- function contentPublishReviewRequired(extra) {
308
- const payload = getExtra(extra);
309
- const actor = resolveActorIdentity(actorLocals(payload));
310
- return new RiskPolicyEvaluator({
311
- db: payload.dineway.db,
312
- handlers: payload.dineway
313
- }).requiresContentPublishReview(actor);
530
+ function contentPublicationService(payload) {
531
+ return payload.dineway.createPublicationAuthorizationService();
314
532
  }
315
- async function requireApprovedContentPublishReview(extra, collection, id, reviewRequestId) {
316
- const payload = getExtra(extra);
533
+ function contentPublicationError(error) {
534
+ return error instanceof PublicationAuthorizationError ? errorResult(`[${error.code}] ${error.message}`) : errorResult(error);
535
+ }
536
+ async function ensureContentReleaseRequest(payload, input) {
317
537
  const actor = resolveActorIdentity(actorLocals(payload));
318
- const decision = await new RiskPolicyEvaluator({
319
- db: payload.dineway.db,
320
- handlers: payload.dineway
321
- }).evaluateContentPublishReview({
322
- actor,
323
- collection,
324
- id,
325
- reviewRequestId
538
+ const settings = await getSiteSettingsWithDb(payload.dineway.db);
539
+ const release = await new ReleasePayloadBuilder({
540
+ handlers: payload.dineway,
541
+ reviewRequests: new ReviewRequestRepository(payload.dineway.db)
542
+ }).buildContentReleasePayload({
543
+ collection: input.collection,
544
+ id: input.id,
545
+ operation: input.operation,
546
+ editorialReviewRequestId: input.editorialReviewRequestId,
547
+ publishedAt: input.publishedAt,
548
+ scheduledAt: input.scheduledAt,
549
+ siteTimezone: settings.timezone?.trim() || "UTC"
550
+ });
551
+ const repository = new HitlRequestRepository(payload.dineway.db);
552
+ const existing = (await repository.list({
553
+ scope: release.scope,
554
+ statuses: ["pending", "approved"],
555
+ actionType: release.actionType,
556
+ targetRefType: "content",
557
+ targetRefId: release.entryId,
558
+ requestedByActorType: actor.actorType,
559
+ requestedByActorId: actor.actorId,
560
+ limit: 100
561
+ })).items.find((request) => request.metadata.actionHash === release.actionHash);
562
+ if (existing) return {
563
+ created: false,
564
+ request: existing
565
+ };
566
+ const request = await repository.create({
567
+ scope: release.scope,
568
+ actionType: release.actionType,
569
+ title: `${input.operation === "publish" ? "Publish" : "Schedule"} ${release.collection}/${release.entryId}`,
570
+ summary: `Authorize exact ${input.operation} release for reviewed Draft`,
571
+ riskReason: "Agent-authenticated content release requires explicit approval.",
572
+ reviewPayload: release.releasePayload,
573
+ targetRefType: "content",
574
+ targetRefId: release.entryId,
575
+ requestedByActorType: actor.actorType,
576
+ requestedByActorId: actor.actorId,
577
+ requestedAuthMetadata: actor.authMetadata,
578
+ metadata: {
579
+ actionHash: release.actionHash,
580
+ editorialReviewRequestId: release.editorialReviewRequestId,
581
+ operation: release.operation,
582
+ scheduledAt: release.scheduledAt,
583
+ publishedAt: release.publishedAt
584
+ }
585
+ });
586
+ await logSiteActivitySafely(payload.dineway.db, actorLocals(payload), {
587
+ actionType: "hitl.submitted",
588
+ subjectType: "hitl_request",
589
+ subjectId: request.id,
590
+ scope: request.scope,
591
+ sourceType: "mcp_tool",
592
+ sourceName: "content_release_request",
593
+ resultStatus: "pending",
594
+ summary: `Submitted release request for ${release.actionType}`,
595
+ detail: {
596
+ collection: release.collection,
597
+ entryId: release.entryId,
598
+ operation: release.operation,
599
+ editorialReviewRequestId: release.editorialReviewRequestId,
600
+ actionHash: release.actionHash
601
+ }
326
602
  });
327
- if (!decision.allowed) throw new McpError(ErrorCode.InvalidRequest, decision.message);
603
+ return {
604
+ created: true,
605
+ request
606
+ };
328
607
  }
329
608
  async function ensureWorkflowHitlRequest(extra, action) {
330
609
  const payload = getExtra(extra);
@@ -460,6 +739,20 @@ function createMcpServer(options = {}) {
460
739
  name: "dineway",
461
740
  version: VERSION
462
741
  }, { capabilities: { logging: {} } });
742
+ registerDinewayTools(server, {
743
+ service: options.dinewayToolsService,
744
+ resolveService: options.resolveDinewayToolsService,
745
+ authorizeRead: (extra) => {
746
+ requireScope(extra, "tools:read");
747
+ requireRole(extra, Role.AUTHOR);
748
+ },
749
+ authorizeRun: (extra) => {
750
+ requireScope(extra, "tools:run");
751
+ requireRole(extra, Role.AUTHOR);
752
+ },
753
+ getContext: (extra) => getDineway(extra),
754
+ resolveCredential: async (provider, dineway) => await options.resolveDinewayToolsCredential?.(provider, dineway) ?? null
755
+ });
463
756
  server.registerTool("site_briefing_get", {
464
757
  title: "Get Site Briefing",
465
758
  description: "Build a read-only Site Context Engine briefing for a site, collection, content item, plugin, taxonomy, or menu scope. The briefing includes inherited scopes, authorized schema, recent activity, active plugin capabilities, curated settings/SEO, and forward-compatible context/review/staleness sections.",
@@ -889,7 +1182,7 @@ function createMcpServer(options = {}) {
889
1182
  });
890
1183
  server.registerTool("assignment_create", {
891
1184
  title: "Create Assignment",
892
- description: experimentalWorkflowDescription("Create a workflow assignment attached to a Dineway scope. Assignments are durable human-agent handoffs and must use explicit lifecycle transitions instead of ad hoc status patches."),
1185
+ description: "Create a workflow assignment attached to a Dineway scope. Assignments are durable human-agent handoffs and must use explicit lifecycle transitions instead of ad hoc status patches.",
893
1186
  inputSchema: z.object({
894
1187
  scope: z.string().describe("Assignment scope string."),
895
1188
  assignment_type: z.string().describe("Workflow-specific assignment type label."),
@@ -941,7 +1234,7 @@ function createMcpServer(options = {}) {
941
1234
  });
942
1235
  server.registerTool("assignment_get", {
943
1236
  title: "Get Assignment",
944
- description: experimentalWorkflowDescription("Fetch one workflow assignment by id."),
1237
+ description: "Fetch one workflow assignment by id.",
945
1238
  inputSchema: z.object({ id: z.string().describe("Assignment id.") }),
946
1239
  annotations: { readOnlyHint: true }
947
1240
  }, async (args, extra) => {
@@ -956,7 +1249,7 @@ function createMcpServer(options = {}) {
956
1249
  });
957
1250
  server.registerTool("assignment_list", {
958
1251
  title: "List Assignments",
959
- description: experimentalWorkflowDescription("List workflow assignments visible to the current actor. Non-editor actors are automatically limited to assignments they assigned or were assigned."),
1252
+ description: "List workflow assignments visible to the current actor. Non-editor actors are automatically limited to assignments they assigned or were assigned.",
960
1253
  inputSchema: z.object({
961
1254
  scope: z.string().optional().describe("Optional exact scope filter."),
962
1255
  statuses: z.array(z.enum(ASSIGNMENT_STATUSES)).optional().describe("Optional assignment status filters."),
@@ -990,7 +1283,7 @@ function createMcpServer(options = {}) {
990
1283
  });
991
1284
  server.registerTool("assignment_accept", {
992
1285
  title: "Accept Assignment",
993
- description: experimentalWorkflowDescription("Accept a pending workflow assignment."),
1286
+ description: "Accept a pending workflow assignment.",
994
1287
  inputSchema: z.object({ id: z.string().describe("Assignment id.") })
995
1288
  }, async (args, extra) => {
996
1289
  requireWorkflowWrite(extra);
@@ -1022,7 +1315,7 @@ function createMcpServer(options = {}) {
1022
1315
  });
1023
1316
  server.registerTool("assignment_start", {
1024
1317
  title: "Start Assignment",
1025
- description: experimentalWorkflowDescription("Move an assignment into in_progress. When the assignment is currently blocked, this acts as the validated resume transition."),
1318
+ description: "Move an assignment into in_progress. When the assignment is currently blocked, this acts as the validated resume transition.",
1026
1319
  inputSchema: z.object({ id: z.string().describe("Assignment id.") })
1027
1320
  }, async (args, extra) => {
1028
1321
  requireWorkflowWrite(extra);
@@ -1054,7 +1347,7 @@ function createMcpServer(options = {}) {
1054
1347
  });
1055
1348
  server.registerTool("assignment_complete", {
1056
1349
  title: "Complete Assignment",
1057
- description: experimentalWorkflowDescription("Mark a workflow assignment complete."),
1350
+ description: "Mark a workflow assignment complete.",
1058
1351
  inputSchema: z.object({
1059
1352
  id: z.string().describe("Assignment id."),
1060
1353
  completion_note: z.string().optional().describe("Optional completion note.")
@@ -1091,7 +1384,7 @@ function createMcpServer(options = {}) {
1091
1384
  });
1092
1385
  server.registerTool("assignment_decline", {
1093
1386
  title: "Decline Assignment",
1094
- description: experimentalWorkflowDescription("Decline a workflow assignment."),
1387
+ description: "Decline a workflow assignment.",
1095
1388
  inputSchema: z.object({
1096
1389
  id: z.string().describe("Assignment id."),
1097
1390
  reason: z.string().optional().describe("Optional decline reason.")
@@ -1128,7 +1421,7 @@ function createMcpServer(options = {}) {
1128
1421
  });
1129
1422
  server.registerTool("assignment_block", {
1130
1423
  title: "Block Assignment",
1131
- description: experimentalWorkflowDescription("Mark a workflow assignment blocked and record why."),
1424
+ description: "Mark a workflow assignment blocked and record why.",
1132
1425
  inputSchema: z.object({
1133
1426
  id: z.string().describe("Assignment id."),
1134
1427
  reason: z.string().optional().describe("Optional blocking reason.")
@@ -1165,7 +1458,7 @@ function createMcpServer(options = {}) {
1165
1458
  });
1166
1459
  server.registerTool("assignment_cancel", {
1167
1460
  title: "Cancel Assignment",
1168
- description: experimentalWorkflowDescription("Cancel a workflow assignment that should no longer continue."),
1461
+ description: "Cancel a workflow assignment that should no longer continue.",
1169
1462
  inputSchema: z.object({
1170
1463
  id: z.string().describe("Assignment id."),
1171
1464
  reason: z.string().optional().describe("Optional cancellation reason.")
@@ -1408,7 +1701,7 @@ function createMcpServer(options = {}) {
1408
1701
  });
1409
1702
  server.registerTool("agent_handoff_capture", {
1410
1703
  title: "Capture Agent Handoff",
1411
- description: experimentalWorkflowDescription("Capture the current agent objective, reasoning, findings, touched objects, and pending actions before pausing or handing work off."),
1704
+ description: "Capture the current agent objective, reasoning, findings, touched objects, and pending actions before pausing or handing work off.",
1412
1705
  inputSchema: z.object({
1413
1706
  scope: z.string().describe("Scope string: site, collection:{slug}, content:{collection}:{id}, or plugin:{id}."),
1414
1707
  objective: z.string().min(1).describe("Current objective or outcome the agent was pursuing."),
@@ -1513,7 +1806,7 @@ function createMcpServer(options = {}) {
1513
1806
  });
1514
1807
  server.registerTool("agent_handoff_resume", {
1515
1808
  title: "Resume Agent Handoff",
1516
- description: experimentalWorkflowDescription("Resume from a stored handoff snapshot and return a deterministic diff of activity, context, and review changes since capture time."),
1809
+ description: "Resume from a stored handoff snapshot and return a deterministic diff of activity, context, and review changes since capture time.",
1517
1810
  inputSchema: z.object({
1518
1811
  snapshot_id: z.string().describe("Handoff snapshot id returned by agent_handoff_capture."),
1519
1812
  activity_limit: z.number().int().min(1).max(100).optional().describe("Maximum activity rows to include in the diff. Defaults to 25."),
@@ -1619,7 +1912,7 @@ function createMcpServer(options = {}) {
1619
1912
  collection: z.string().describe("Collection slug (e.g. 'posts', 'pages')"),
1620
1913
  data: z.record(z.string(), z.unknown()).describe("Field values as key-value pairs matching the collection schema"),
1621
1914
  slug: z.string().optional().describe("URL slug (auto-generated from title if omitted)"),
1622
- status: z.enum(["draft", "published"]).optional().describe("Initial status (default 'draft'). Requires publish permission."),
1915
+ status: z.literal("draft").optional().describe("Initial status. Content creation is draft-only."),
1623
1916
  locale: z.string().optional().describe("Locale for this content (e.g. 'fr'). Defaults to default locale."),
1624
1917
  translationOf: z.string().optional().describe("ID of the content item this is a translation of. Links items in the same translation group."),
1625
1918
  bylines: z.array(contentBylineInputSchema).optional().describe("Bylines to credit. Each entry references an existing byline by id, with an optional roleLabel. The first entry becomes the primary byline.")
@@ -1637,35 +1930,6 @@ function createMcpServer(options = {}) {
1637
1930
  requireOwnership(extra, extractContentAuthorId(source.data), "content:edit_own", "content:edit_any");
1638
1931
  }
1639
1932
  const data = await convertWriteData(dineway, args.collection, args.data);
1640
- if (args.status === "published") {
1641
- if (!hasPermission({
1642
- id: userId,
1643
- role: getExtra(extra).userRole
1644
- }, "content:publish_own")) throw new McpError(ErrorCode.InvalidRequest, "Insufficient permissions: publishing requires content:publish_own");
1645
- if (contentPublishReviewRequired(extra)) throw new McpError(ErrorCode.InvalidRequest, "Token-authenticated content creation with immediate publish is review-gated. Create a draft first, submit review_request_submit, resolve it as approved, then call content_publish with review_request_id.");
1646
- const result = await dineway.handleContentCreate(args.collection, {
1647
- data,
1648
- slug: args.slug,
1649
- authorId: userId,
1650
- locale: args.locale,
1651
- translationOf: args.translationOf,
1652
- bylines: args.bylines
1653
- });
1654
- if (!result.success) return unwrap(result);
1655
- const itemId = extractContentId(result.data);
1656
- if (itemId) {
1657
- await logMcpContentActivity(dineway, locals, args.collection, itemId, "created", "content_create", {
1658
- changedFields: activityChangedKeys(args.data),
1659
- slugProvided: args.slug !== void 0,
1660
- locale: args.locale ?? null,
1661
- translationOf: args.translationOf ?? null
1662
- });
1663
- const publishResult = await dineway.handleContentPublish(args.collection, itemId);
1664
- if (publishResult.success) await logMcpContentActivity(dineway, locals, args.collection, itemId, "published", "content_create");
1665
- return unwrap(publishResult);
1666
- }
1667
- return unwrap(result);
1668
- }
1669
1933
  const result = await dineway.handleContentCreate(args.collection, {
1670
1934
  data,
1671
1935
  slug: args.slug,
@@ -1694,15 +1958,14 @@ function createMcpServer(options = {}) {
1694
1958
  locale: z.string().optional().describe("Locale to scope slug lookup. Only affects slug resolution; IDs are globally unique."),
1695
1959
  data: z.record(z.string(), z.unknown()).optional().describe("Field values to update (only include changed fields)"),
1696
1960
  slug: z.string().optional().describe("New URL slug"),
1697
- status: z.enum(["draft", "published"]).optional().describe("New status. Setting to 'published' requires publish permission. Setting to 'draft' unpublishes the item and also requires publish permission."),
1961
+ status: z.literal("draft").optional().describe("Set to 'draft' to unpublish the item. Publishing uses content_publish."),
1698
1962
  seo: contentSeoInput.optional().describe("Per-content SEO metadata. Only valid for collections with SEO enabled."),
1699
1963
  bylines: z.array(contentBylineInputSchema).optional().describe("Replace the byline list for this item. The first entry becomes the primary byline."),
1700
1964
  publishedAt: z.iso.datetime({
1701
1965
  offset: true,
1702
1966
  message: "must be an ISO 8601 datetime"
1703
1967
  }).nullish().describe("Override the publication timestamp. Requires content:publish_any permission. Pass null to clear."),
1704
- _rev: z.string().optional().describe("Revision token from content_get for conflict detection"),
1705
- review_request_id: z.string().optional().describe("Approved review request id required for token-authenticated content.publish actions.")
1968
+ _rev: z.string().optional().describe("Revision token from content_get for conflict detection")
1706
1969
  })
1707
1970
  }, async (args, extra) => {
1708
1971
  requireScope(extra, "content:write");
@@ -1723,34 +1986,6 @@ function createMcpServer(options = {}) {
1723
1986
  }
1724
1987
  const hasInlineUpdates = args.data || args.slug || args.seo !== void 0 || args.bylines !== void 0 || args.publishedAt !== void 0;
1725
1988
  const data = args.data ? await convertWriteData(dineway, args.collection, args.data) : args.data;
1726
- if (args.status === "published") {
1727
- requireOwnership(extra, ownerId, "content:publish_own", "content:publish_any");
1728
- if (contentPublishReviewRequired(extra) && hasInlineUpdates) throw new McpError(ErrorCode.InvalidRequest, "Token-authenticated publish with inline content changes is review-gated. Save the draft first, submit review_request_submit, resolve it as approved, then publish with review_request_id.");
1729
- if (hasInlineUpdates) {
1730
- const updateResult = await dineway.handleContentUpdate(args.collection, resolvedId, {
1731
- data,
1732
- slug: args.slug,
1733
- authorId: userId,
1734
- locale: args.locale,
1735
- seo: args.seo,
1736
- bylines: args.bylines,
1737
- publishedAt: args.publishedAt,
1738
- _rev: args._rev
1739
- });
1740
- if (!updateResult.success) return unwrap(updateResult);
1741
- await logMcpContentActivity(dineway, locals, args.collection, resolvedId, "updated", "content_update", {
1742
- changedFields: activityChangedKeys(args.data),
1743
- slugChanged: args.slug !== void 0,
1744
- seoChanged: args.seo !== void 0,
1745
- bylinesChanged: args.bylines !== void 0,
1746
- publishedAtChanged: args.publishedAt !== void 0
1747
- });
1748
- }
1749
- await requireApprovedContentPublishReview(extra, args.collection, resolvedId, args.review_request_id);
1750
- const publishResult = await dineway.handleContentPublish(args.collection, resolvedId);
1751
- if (publishResult.success) await logMcpContentActivity(dineway, locals, args.collection, resolvedId, "published", "content_update", { reviewRequestId: args.review_request_id ?? null });
1752
- return unwrap(publishResult);
1753
- }
1754
1989
  if (args.status === "draft") {
1755
1990
  requireOwnership(extra, ownerId, "content:publish_own", "content:publish_any");
1756
1991
  if (hasInlineUpdates) {
@@ -1859,6 +2094,43 @@ function createMcpServer(options = {}) {
1859
2094
  if (result.success) await logMcpContentActivity(ec, locals, args.collection, resolvedId, "permanently_deleted", "content_permanent_delete");
1860
2095
  return unwrap(result);
1861
2096
  });
2097
+ server.registerTool("content_release_request", {
2098
+ title: "Request Content Release Authorization",
2099
+ description: "Create or reuse an exact HITL request for publishing or scheduling an approved Draft. The server derives the action hash from current content, review, time, Site Settings, and policies.",
2100
+ inputSchema: z.object({
2101
+ collection: z.string().describe("Collection slug"),
2102
+ id: z.string().describe("Content item ID or slug"),
2103
+ operation: z.enum(["publish", "schedule"]).describe("Release operation"),
2104
+ review_request_id: z.string().describe("Approved editorial Review Request bound to the exact Draft"),
2105
+ publishedAt: z.iso.datetime({
2106
+ offset: true,
2107
+ message: "must be an ISO 8601 datetime"
2108
+ }).optional().describe("Optional publication timestamp for a publish release"),
2109
+ scheduledAt: z.iso.datetime({
2110
+ offset: true,
2111
+ message: "must be an ISO 8601 datetime"
2112
+ }).optional().describe("Required exact publication time for a schedule release")
2113
+ }).strict()
2114
+ }, async (args, extra) => {
2115
+ requireScope(extra, "content:write");
2116
+ requireRole(extra, Role.AUTHOR);
2117
+ const payload = getExtra(extra);
2118
+ const existing = await payload.dineway.handleContentGet(args.collection, args.id);
2119
+ if (!existing.success) return unwrap(existing);
2120
+ requireOwnership(extra, extractContentAuthorId(existing.data), "content:publish_own", "content:publish_any");
2121
+ try {
2122
+ return jsonResult(await ensureContentReleaseRequest(payload, {
2123
+ collection: args.collection,
2124
+ id: extractContentId(existing.data) ?? args.id,
2125
+ operation: args.operation,
2126
+ editorialReviewRequestId: args.review_request_id,
2127
+ publishedAt: args.publishedAt,
2128
+ scheduledAt: args.scheduledAt
2129
+ }));
2130
+ } catch (error) {
2131
+ return contentPublicationError(error);
2132
+ }
2133
+ });
1862
2134
  server.registerTool("content_publish", {
1863
2135
  title: "Publish Content",
1864
2136
  description: "Publish a content item, making it live on the site. Creates a published revision from the current draft. Further edits create a new draft without affecting the live version until re-published. Pass `publishedAt` to backdate imported or historical content; this requires content:publish_any.",
@@ -1869,7 +2141,8 @@ function createMcpServer(options = {}) {
1869
2141
  offset: true,
1870
2142
  message: "must be an ISO 8601 datetime"
1871
2143
  }).optional().describe("Override publication timestamp. Requires content:publish_any permission."),
1872
- review_request_id: z.string().optional().describe("Approved review request id required for token-authenticated publish actions.")
2144
+ review_request_id: z.string().describe("Approved editorial Review Request bound to the exact Draft."),
2145
+ release_authorization_id: z.string().optional().describe("Approved exact release HITL request required for token actors.")
1873
2146
  })
1874
2147
  }, async (args, extra) => {
1875
2148
  requireScope(extra, "content:write");
@@ -1887,13 +2160,20 @@ function createMcpServer(options = {}) {
1887
2160
  role: userRole
1888
2161
  }, "content:publish_any")) return errorResult("[INSUFFICIENT_PERMISSIONS] Setting publishedAt requires content:publish_any permission");
1889
2162
  }
1890
- await requireApprovedContentPublishReview(extra, args.collection, resolvedId, args.review_request_id);
1891
- const result = await ec.handleContentPublish(args.collection, resolvedId, { publishedAt: args.publishedAt });
1892
- if (result.success) await logMcpContentActivity(ec, locals, args.collection, resolvedId, "published", "content_publish", {
1893
- reviewRequestId: args.review_request_id ?? null,
1894
- publishedAt: args.publishedAt ?? null
1895
- });
1896
- return unwrap(result);
2163
+ try {
2164
+ return unwrap((await contentPublicationService(payload).publishAuthorizedContent({
2165
+ actor: resolveActorIdentity(locals),
2166
+ collection: args.collection,
2167
+ id: resolvedId,
2168
+ editorialReviewRequestId: args.review_request_id,
2169
+ releaseHitlRequestId: args.release_authorization_id,
2170
+ publishedAt: args.publishedAt,
2171
+ sourceType: "mcp_tool",
2172
+ sourceName: "content_publish"
2173
+ })).result);
2174
+ } catch (error) {
2175
+ return contentPublicationError(error);
2176
+ }
1897
2177
  });
1898
2178
  server.registerTool("content_unpublish", {
1899
2179
  title: "Unpublish Content",
@@ -1922,7 +2202,9 @@ function createMcpServer(options = {}) {
1922
2202
  inputSchema: z.object({
1923
2203
  collection: z.string().describe("Collection slug"),
1924
2204
  id: z.string().describe("Content item ID or slug"),
1925
- scheduledAt: z.string().describe("ISO 8601 datetime for publication (e.g. '2025-06-01T09:00:00Z')")
2205
+ scheduledAt: z.string().describe("ISO 8601 datetime for publication (e.g. '2025-06-01T09:00:00Z')"),
2206
+ review_request_id: z.string().describe("Approved editorial Review Request bound to the exact Draft."),
2207
+ release_authorization_id: z.string().optional().describe("Approved exact release HITL request required for token actors.")
1926
2208
  })
1927
2209
  }, async (args, extra) => {
1928
2210
  requireScope(extra, "content:write");
@@ -1934,9 +2216,20 @@ function createMcpServer(options = {}) {
1934
2216
  if (!existing.success) return unwrap(existing);
1935
2217
  requireOwnership(extra, extractContentAuthorId(existing.data), "content:publish_own", "content:publish_any");
1936
2218
  const resolvedId = extractContentId(existing.data) ?? args.id;
1937
- const result = await ec.handleContentSchedule(args.collection, resolvedId, args.scheduledAt);
1938
- if (result.success) await logMcpContentActivity(ec, locals, args.collection, resolvedId, "scheduled", "content_schedule", { scheduledAt: args.scheduledAt });
1939
- return unwrap(result);
2219
+ try {
2220
+ return unwrap((await contentPublicationService(payload).scheduleAuthorizedContent({
2221
+ actor: resolveActorIdentity(locals),
2222
+ collection: args.collection,
2223
+ id: resolvedId,
2224
+ editorialReviewRequestId: args.review_request_id,
2225
+ releaseHitlRequestId: args.release_authorization_id,
2226
+ scheduledAt: args.scheduledAt,
2227
+ sourceType: "mcp_tool",
2228
+ sourceName: "content_schedule"
2229
+ })).result);
2230
+ } catch (error) {
2231
+ return contentPublicationError(error);
2232
+ }
1940
2233
  });
1941
2234
  server.registerTool("content_unschedule", {
1942
2235
  title: "Cancel Scheduled Publication",
@@ -1955,9 +2248,17 @@ function createMcpServer(options = {}) {
1955
2248
  if (!existing.success) return unwrap(existing);
1956
2249
  requireOwnership(extra, extractContentAuthorId(existing.data), "content:publish_own", "content:publish_any");
1957
2250
  const resolvedId = extractContentId(existing.data) ?? args.id;
1958
- const result = await ec.handleContentUnschedule(args.collection, resolvedId);
1959
- if (result.success) await logMcpContentActivity(ec, locals, args.collection, resolvedId, "unscheduled", "content_unschedule");
1960
- return unwrap(result);
2251
+ try {
2252
+ return unwrap((await contentPublicationService(payload).unscheduleAuthorizedContent({
2253
+ actor: resolveActorIdentity(locals),
2254
+ collection: args.collection,
2255
+ id: resolvedId,
2256
+ sourceType: "mcp_tool",
2257
+ sourceName: "content_unschedule"
2258
+ })).result);
2259
+ } catch (error) {
2260
+ return contentPublicationError(error);
2261
+ }
1961
2262
  });
1962
2263
  server.registerTool("content_compare", {
1963
2264
  title: "Compare Live vs Draft",
@@ -2065,7 +2366,7 @@ function createMcpServer(options = {}) {
2065
2366
  requireRole(extra, Role.EDITOR);
2066
2367
  const ec = getDineway(extra);
2067
2368
  try {
2068
- const { SchemaRegistry } = await import("../../../schema-DXdYj4R3.mjs").then((n) => n.t);
2369
+ const { SchemaRegistry } = await import("../../../schema-Dk_N31V4.mjs").then((n) => n.t);
2069
2370
  return jsonResult({ items: await new SchemaRegistry(ec.db).listCollections() });
2070
2371
  } catch (error) {
2071
2372
  return errorResult(error);
@@ -2081,7 +2382,7 @@ function createMcpServer(options = {}) {
2081
2382
  requireRole(extra, Role.EDITOR);
2082
2383
  const ec = getDineway(extra);
2083
2384
  try {
2084
- const { SchemaRegistry } = await import("../../../schema-DXdYj4R3.mjs").then((n) => n.t);
2385
+ const { SchemaRegistry } = await import("../../../schema-Dk_N31V4.mjs").then((n) => n.t);
2085
2386
  const collection = await new SchemaRegistry(ec.db).getCollectionWithFields(args.slug);
2086
2387
  if (!collection) return errorResult(`Collection '${args.slug}' not found`);
2087
2388
  return jsonResult(collection);
@@ -2111,7 +2412,7 @@ function createMcpServer(options = {}) {
2111
2412
  requireRole(extra, Role.ADMIN);
2112
2413
  const ec = getDineway(extra);
2113
2414
  try {
2114
- const { SchemaRegistry } = await import("../../../schema-DXdYj4R3.mjs").then((n) => n.t);
2415
+ const { SchemaRegistry } = await import("../../../schema-Dk_N31V4.mjs").then((n) => n.t);
2115
2416
  const collection = await new SchemaRegistry(ec.db).createCollection({
2116
2417
  slug: args.slug,
2117
2418
  label: args.label,
@@ -2175,7 +2476,7 @@ function createMcpServer(options = {}) {
2175
2476
  request
2176
2477
  });
2177
2478
  }
2178
- const { SchemaRegistry } = await import("../../../schema-DXdYj4R3.mjs").then((n) => n.t);
2479
+ const { SchemaRegistry } = await import("../../../schema-Dk_N31V4.mjs").then((n) => n.t);
2179
2480
  await new SchemaRegistry(ec.db).deleteCollection(args.slug, { force: args.force });
2180
2481
  ec.invalidateManifest();
2181
2482
  await logSchemaActivity(ec.db, locals, {
@@ -2239,7 +2540,7 @@ function createMcpServer(options = {}) {
2239
2540
  requireRole(extra, Role.ADMIN);
2240
2541
  const ec = getDineway(extra);
2241
2542
  try {
2242
- const { SchemaRegistry } = await import("../../../schema-DXdYj4R3.mjs").then((n) => n.t);
2543
+ const { SchemaRegistry } = await import("../../../schema-Dk_N31V4.mjs").then((n) => n.t);
2243
2544
  const field = await new SchemaRegistry(ec.db).createField(args.collection, {
2244
2545
  slug: args.slug,
2245
2546
  label: args.label,
@@ -2308,7 +2609,7 @@ function createMcpServer(options = {}) {
2308
2609
  request
2309
2610
  });
2310
2611
  }
2311
- const { SchemaRegistry } = await import("../../../schema-DXdYj4R3.mjs").then((n) => n.t);
2612
+ const { SchemaRegistry } = await import("../../../schema-Dk_N31V4.mjs").then((n) => n.t);
2312
2613
  await new SchemaRegistry(ec.db).deleteField(args.collection, args.fieldSlug);
2313
2614
  ec.invalidateManifest();
2314
2615
  await logSchemaActivity(ec.db, locals, {
@@ -2441,7 +2742,7 @@ function createMcpServer(options = {}) {
2441
2742
  requireScope(extra, "content:read");
2442
2743
  const ec = getDineway(extra);
2443
2744
  try {
2444
- const { searchWithDb } = await import("../../../search-DSaLgEFI.mjs").then((n) => n.t);
2745
+ const { searchWithDb } = await import("../../../search-BXEQepxL.mjs").then((n) => n.t);
2445
2746
  return jsonResult(await searchWithDb(ec.db, args.query, {
2446
2747
  collections: args.collections,
2447
2748
  locale: args.locale,
@@ -2467,7 +2768,7 @@ function createMcpServer(options = {}) {
2467
2768
  requireScope(extra, "content:read");
2468
2769
  const ec = getDineway(extra);
2469
2770
  try {
2470
- const { BylineRepository } = await import("../../../byline-e51-fWRs.mjs").then((n) => n.n);
2771
+ const { BylineRepository } = await import("../../../byline-BJa1MyKB.mjs").then((n) => n.n);
2471
2772
  return jsonResult(await new BylineRepository(ec.db).findMany({
2472
2773
  search: args.search,
2473
2774
  isGuest: args.isGuest,
@@ -2489,7 +2790,7 @@ function createMcpServer(options = {}) {
2489
2790
  requireScope(extra, "content:read");
2490
2791
  const ec = getDineway(extra);
2491
2792
  try {
2492
- const { BylineRepository } = await import("../../../byline-e51-fWRs.mjs").then((n) => n.n);
2793
+ const { BylineRepository } = await import("../../../byline-BJa1MyKB.mjs").then((n) => n.n);
2493
2794
  const byline = await new BylineRepository(ec.db).findById(args.id);
2494
2795
  if (!byline) return errorResult(`Byline '${args.id}' not found`);
2495
2796
  return jsonResult(byline);
@@ -2507,7 +2808,7 @@ function createMcpServer(options = {}) {
2507
2808
  requireRole(extra, Role.EDITOR);
2508
2809
  const ec = getDineway(extra);
2509
2810
  try {
2510
- const { handleBylineCreate } = await import("../../../bylines-CMQNCNFh.mjs").then((n) => n.t);
2811
+ const { handleBylineCreate } = await import("../../../bylines-B53Saxdb.mjs").then((n) => n.t);
2511
2812
  const result = await handleBylineCreate(ec.db, args);
2512
2813
  if (result.success) await invalidateBylines();
2513
2814
  return unwrap(result);
@@ -2527,7 +2828,7 @@ function createMcpServer(options = {}) {
2527
2828
  requireRole(extra, Role.EDITOR);
2528
2829
  const ec = getDineway(extra);
2529
2830
  try {
2530
- const { handleBylineUpdate } = await import("../../../bylines-CMQNCNFh.mjs").then((n) => n.t);
2831
+ const { handleBylineUpdate } = await import("../../../bylines-B53Saxdb.mjs").then((n) => n.t);
2531
2832
  const { id, ...input } = args;
2532
2833
  const result = await handleBylineUpdate(ec.db, id, input);
2533
2834
  if (result.success) await invalidateBylines();
@@ -2546,7 +2847,7 @@ function createMcpServer(options = {}) {
2546
2847
  requireRole(extra, Role.EDITOR);
2547
2848
  const ec = getDineway(extra);
2548
2849
  try {
2549
- const { BylineRepository } = await import("../../../byline-e51-fWRs.mjs").then((n) => n.n);
2850
+ const { BylineRepository } = await import("../../../byline-BJa1MyKB.mjs").then((n) => n.n);
2550
2851
  if (!await new BylineRepository(ec.db).delete(args.id)) return errorResult(`Byline '${args.id}' not found`);
2551
2852
  await invalidateBylines();
2552
2853
  return jsonResult({ deleted: args.id });
@@ -2563,7 +2864,7 @@ function createMcpServer(options = {}) {
2563
2864
  requireScope(extra, "content:read");
2564
2865
  const ec = getDineway(extra);
2565
2866
  try {
2566
- const { handleBylineTranslations } = await import("../../../bylines-CMQNCNFh.mjs").then((n) => n.t);
2867
+ const { handleBylineTranslations } = await import("../../../bylines-B53Saxdb.mjs").then((n) => n.t);
2567
2868
  return unwrap(await handleBylineTranslations(ec.db, args.id));
2568
2869
  } catch (error) {
2569
2870
  return errorResult(error);
@@ -2578,7 +2879,7 @@ function createMcpServer(options = {}) {
2578
2879
  requireScope(extra, "content:read");
2579
2880
  const ec = getDineway(extra);
2580
2881
  try {
2581
- const { handleTaxonomyList } = await import("../../../taxonomies-9s-v03H-.mjs").then((n) => n.l);
2882
+ const { handleTaxonomyList } = await import("../../../taxonomies-DuhGjBa8.mjs").then((n) => n.l);
2582
2883
  return unwrap(await handleTaxonomyList(ec.db, { locale: args.locale }));
2583
2884
  } catch (error) {
2584
2885
  return errorResult(error);
@@ -2598,12 +2899,12 @@ function createMcpServer(options = {}) {
2598
2899
  requireScope(extra, "content:read");
2599
2900
  const ec = getDineway(extra);
2600
2901
  try {
2601
- const { handleTaxonomyList } = await import("../../../taxonomies-9s-v03H-.mjs").then((n) => n.l);
2902
+ const { handleTaxonomyList } = await import("../../../taxonomies-DuhGjBa8.mjs").then((n) => n.l);
2602
2903
  const listResult = await handleTaxonomyList(ec.db, { locale: args.locale });
2603
2904
  if (!listResult.success) return unwrap(listResult);
2604
2905
  if (!listResult.data.taxonomies.find((t) => t.name === args.taxonomy)) return errorResult(`Taxonomy '${args.taxonomy}' not found`);
2605
- const { TaxonomyRepository } = await import("../../../taxonomy-Dvsw6BOs.mjs").then((n) => n.n);
2606
- const { decodeCursor, encodeCursor } = await import("../../../types-Dq1qT19x.mjs").then((n) => n.a);
2906
+ const { TaxonomyRepository } = await import("../../../taxonomy-CCo2plmV.mjs").then((n) => n.n);
2907
+ const { decodeCursor, encodeCursor } = await import("../../../types-Bshd_6wQ.mjs").then((n) => n.a);
2607
2908
  const repo = new TaxonomyRepository(ec.db);
2608
2909
  const limit = Math.min(args.limit ?? 50, 100);
2609
2910
  const terms = await repo.findByName(args.taxonomy, { locale: args.locale });
@@ -2652,7 +2953,7 @@ function createMcpServer(options = {}) {
2652
2953
  requireRole(extra, Role.EDITOR);
2653
2954
  const ec = getDineway(extra);
2654
2955
  try {
2655
- const { handleTermCreate } = await import("../../../taxonomies-9s-v03H-.mjs").then((n) => n.l);
2956
+ const { handleTermCreate } = await import("../../../taxonomies-DuhGjBa8.mjs").then((n) => n.l);
2656
2957
  return unwrap(await handleTermCreate(ec.db, args.taxonomy, {
2657
2958
  slug: args.slug,
2658
2959
  label: args.label,
@@ -2682,7 +2983,7 @@ function createMcpServer(options = {}) {
2682
2983
  requireRole(extra, Role.EDITOR);
2683
2984
  const ec = getDineway(extra);
2684
2985
  try {
2685
- const { handleTermUpdate } = await import("../../../taxonomies-9s-v03H-.mjs").then((n) => n.l);
2986
+ const { handleTermUpdate } = await import("../../../taxonomies-DuhGjBa8.mjs").then((n) => n.l);
2686
2987
  return unwrap(await handleTermUpdate(ec.db, args.taxonomy, args.termSlug, {
2687
2988
  slug: args.slug,
2688
2989
  label: args.label,
@@ -2707,7 +3008,7 @@ function createMcpServer(options = {}) {
2707
3008
  requireRole(extra, Role.EDITOR);
2708
3009
  const ec = getDineway(extra);
2709
3010
  try {
2710
- const { handleTermDelete } = await import("../../../taxonomies-9s-v03H-.mjs").then((n) => n.l);
3011
+ const { handleTermDelete } = await import("../../../taxonomies-DuhGjBa8.mjs").then((n) => n.l);
2711
3012
  return unwrap(await handleTermDelete(ec.db, args.taxonomy, args.termSlug, { locale: args.locale }));
2712
3013
  } catch (error) {
2713
3014
  return errorResult(error);
@@ -2722,7 +3023,7 @@ function createMcpServer(options = {}) {
2722
3023
  requireScope(extra, "content:read");
2723
3024
  const ec = getDineway(extra);
2724
3025
  try {
2725
- const { handleTermTranslations } = await import("../../../taxonomies-9s-v03H-.mjs").then((n) => n.l);
3026
+ const { handleTermTranslations } = await import("../../../taxonomies-DuhGjBa8.mjs").then((n) => n.l);
2726
3027
  return unwrap(await handleTermTranslations(ec.db, args.id));
2727
3028
  } catch (error) {
2728
3029
  return errorResult(error);
@@ -2737,7 +3038,7 @@ function createMcpServer(options = {}) {
2737
3038
  requireScope(extra, "content:read");
2738
3039
  const ec = getDineway(extra);
2739
3040
  try {
2740
- const { handleMenuList } = await import("../../../menus-TaW1gKnk.mjs").then((n) => n.d);
3041
+ const { handleMenuList } = await import("../../../menus-LYALU2Mf.mjs").then((n) => n.d);
2741
3042
  return unwrap(await handleMenuList(ec.db, { locale: args.locale }));
2742
3043
  } catch (error) {
2743
3044
  return errorResult(error);
@@ -2755,7 +3056,7 @@ function createMcpServer(options = {}) {
2755
3056
  requireScope(extra, "content:read");
2756
3057
  const ec = getDineway(extra);
2757
3058
  try {
2758
- const { handleMenuGet } = await import("../../../menus-TaW1gKnk.mjs").then((n) => n.d);
3059
+ const { handleMenuGet } = await import("../../../menus-LYALU2Mf.mjs").then((n) => n.d);
2759
3060
  return unwrap(await handleMenuGet(ec.db, args.name, { locale: args.locale }));
2760
3061
  } catch (error) {
2761
3062
  return errorResult(error);
@@ -2770,7 +3071,7 @@ function createMcpServer(options = {}) {
2770
3071
  requireScope(extra, "content:read");
2771
3072
  const ec = getDineway(extra);
2772
3073
  try {
2773
- const { handleMenuTranslations } = await import("../../../menus-TaW1gKnk.mjs").then((n) => n.d);
3074
+ const { handleMenuTranslations } = await import("../../../menus-LYALU2Mf.mjs").then((n) => n.d);
2774
3075
  return unwrap(await handleMenuTranslations(ec.db, args.id));
2775
3076
  } catch (error) {
2776
3077
  return errorResult(error);
@@ -2790,7 +3091,7 @@ function createMcpServer(options = {}) {
2790
3091
  requireRole(extra, Role.EDITOR);
2791
3092
  const ec = getDineway(extra);
2792
3093
  try {
2793
- const { handleMenuCreate } = await import("../../../menus-TaW1gKnk.mjs").then((n) => n.d);
3094
+ const { handleMenuCreate } = await import("../../../menus-LYALU2Mf.mjs").then((n) => n.d);
2794
3095
  return unwrap(await handleMenuCreate(ec.db, {
2795
3096
  name: args.name,
2796
3097
  label: args.label,
@@ -2814,7 +3115,7 @@ function createMcpServer(options = {}) {
2814
3115
  requireRole(extra, Role.EDITOR);
2815
3116
  const ec = getDineway(extra);
2816
3117
  try {
2817
- const { handleMenuUpdate } = await import("../../../menus-TaW1gKnk.mjs").then((n) => n.d);
3118
+ const { handleMenuUpdate } = await import("../../../menus-LYALU2Mf.mjs").then((n) => n.d);
2818
3119
  return unwrap(await handleMenuUpdate(ec.db, args.name, {
2819
3120
  label: args.label,
2820
3121
  locale: args.locale
@@ -2836,7 +3137,7 @@ function createMcpServer(options = {}) {
2836
3137
  requireRole(extra, Role.EDITOR);
2837
3138
  const ec = getDineway(extra);
2838
3139
  try {
2839
- const { handleMenuDelete } = await import("../../../menus-TaW1gKnk.mjs").then((n) => n.d);
3140
+ const { handleMenuDelete } = await import("../../../menus-LYALU2Mf.mjs").then((n) => n.d);
2840
3141
  return unwrap(await handleMenuDelete(ec.db, args.name, { locale: args.locale }));
2841
3142
  } catch (error) {
2842
3143
  return errorResult(error);
@@ -2871,7 +3172,7 @@ function createMcpServer(options = {}) {
2871
3172
  requireRole(extra, Role.EDITOR);
2872
3173
  const ec = getDineway(extra);
2873
3174
  try {
2874
- const { handleMenuSetItems } = await import("../../../menus-TaW1gKnk.mjs").then((n) => n.d);
3175
+ const { handleMenuSetItems } = await import("../../../menus-LYALU2Mf.mjs").then((n) => n.d);
2875
3176
  return unwrap(await handleMenuSetItems(ec.db, args.name, args.items, { locale: args.locale }));
2876
3177
  } catch (error) {
2877
3178
  return errorResult(error);
@@ -2918,7 +3219,7 @@ function createMcpServer(options = {}) {
2918
3219
  requireRole(extra, Role.ADMIN);
2919
3220
  const ec = getDineway(extra);
2920
3221
  try {
2921
- const { handleSettingsGet } = await import("../../../settings-i4VPP8bT.mjs").then((n) => n.r);
3222
+ const { handleSettingsGet } = await import("../../../settings-Dje-PHXo.mjs").then((n) => n.r);
2922
3223
  return unwrap(await handleSettingsGet(ec.db, ec.storage));
2923
3224
  } catch (error) {
2924
3225
  return errorResult(error);
@@ -2955,7 +3256,7 @@ function createMcpServer(options = {}) {
2955
3256
  request
2956
3257
  });
2957
3258
  }
2958
- const { handleSettingsUpdate } = await import("../../../settings-i4VPP8bT.mjs").then((n) => n.r);
3259
+ const { handleSettingsUpdate } = await import("../../../settings-Dje-PHXo.mjs").then((n) => n.r);
2959
3260
  const result = await handleSettingsUpdate(ec.db, ec.storage, settingsInput);
2960
3261
  if (!result.success) return unwrap(result);
2961
3262
  await logSiteActivitySafely(ec.db, locals, {
@@ -3027,7 +3328,13 @@ const POST = async ({ request, locals }) => {
3027
3328
  const { dineway, user } = locals;
3028
3329
  if (!dineway) return apiError("NOT_CONFIGURED", "Dineway is not initialized", 500);
3029
3330
  if (!user) return apiError("UNAUTHORIZED", "Authentication required", 401);
3331
+ let toolsService;
3030
3332
  const server = createMcpServer({
3333
+ resolveDinewayToolsService: () => {
3334
+ toolsService ??= createDinewayToolsRuntimeService();
3335
+ return toolsService;
3336
+ },
3337
+ resolveDinewayToolsCredential: (provider, handlers) => new IntegrationCredentialStore(handlers.db).resolveForRuntime(provider),
3031
3338
  pluginMcpRegistry: dineway.getPluginMcpRegistry(),
3032
3339
  executePluginMcpCommand: createReviewedPluginMcpCommandExecutor()
3033
3340
  });