@powerhousedao/shared 6.2.3 → 6.3.0-dev.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 (326) hide show
  1. package/dist/action-id-DON1WCeY.d.ts +19 -0
  2. package/dist/action-id-DON1WCeY.d.ts.map +1 -0
  3. package/dist/clis/args/access-token.d.mts +14 -2
  4. package/dist/clis/args/access-token.d.mts.map +1 -0
  5. package/dist/clis/args/access-token.mjs +21 -1
  6. package/dist/clis/args/access-token.mjs.map +1 -0
  7. package/dist/clis/args/{common-BXabdhiO.mjs → common-DG_SF8fN.mjs} +39 -8
  8. package/dist/clis/args/common-DG_SF8fN.mjs.map +1 -0
  9. package/dist/clis/args/{common-Bnm859xU.d.mts → common-DmerPWXo.d.mts} +8 -4
  10. package/dist/clis/args/common-DmerPWXo.d.mts.map +1 -0
  11. package/dist/clis/args/common.d.mts +1 -1
  12. package/dist/clis/args/common.mjs +1 -1
  13. package/dist/clis/args/connect.d.mts +448 -2
  14. package/dist/clis/args/connect.d.mts.map +1 -0
  15. package/dist/clis/args/connect.mjs +202 -1
  16. package/dist/clis/args/connect.mjs.map +1 -0
  17. package/dist/clis/args/{generate-BOItUNvP.mjs → generate-DMKgc6et.mjs} +2 -21
  18. package/dist/clis/args/generate-DMKgc6et.mjs.map +1 -0
  19. package/dist/clis/args/generate.d.mts +92 -2
  20. package/dist/clis/args/generate.d.mts.map +1 -0
  21. package/dist/clis/args/generate.mjs +1 -1
  22. package/dist/clis/args/{help-DVPTARGn.d.mts → help-BnD14eCa.d.mts} +62 -2
  23. package/dist/clis/args/help-BnD14eCa.d.mts.map +1 -0
  24. package/dist/clis/args/{help-DS1NlcJQ.mjs → help-Cjoe-b7d.mjs} +55 -15
  25. package/dist/clis/args/help-Cjoe-b7d.mjs.map +1 -0
  26. package/dist/clis/args/help.d.mts +1 -1
  27. package/dist/clis/args/help.mjs +16 -1
  28. package/dist/clis/args/host.d.mts +23 -0
  29. package/dist/clis/args/host.d.mts.map +1 -0
  30. package/dist/clis/args/host.mjs +35 -0
  31. package/dist/clis/args/host.mjs.map +1 -0
  32. package/dist/clis/args/index.d.mts +23 -19
  33. package/dist/clis/args/index.mjs +23 -19
  34. package/dist/clis/args/init.d.mts +53 -2
  35. package/dist/clis/args/init.d.mts.map +1 -0
  36. package/dist/clis/args/init.mjs +77 -1
  37. package/dist/clis/args/init.mjs.map +1 -0
  38. package/dist/clis/args/inspect.d.mts +11 -2
  39. package/dist/clis/args/inspect.d.mts.map +1 -0
  40. package/dist/clis/args/inspect.mjs +14 -1
  41. package/dist/clis/args/inspect.mjs.map +1 -0
  42. package/dist/clis/args/install.d.mts +35 -2
  43. package/dist/clis/args/install.d.mts.map +1 -0
  44. package/dist/clis/args/install.mjs +31 -1
  45. package/dist/clis/args/install.mjs.map +1 -0
  46. package/dist/clis/args/{login-CXRJXg71.d.mts → keyframes.d.mts} +13 -13
  47. package/dist/clis/args/keyframes.d.mts.map +1 -0
  48. package/dist/clis/args/keyframes.mjs +42 -0
  49. package/dist/clis/args/keyframes.mjs.map +1 -0
  50. package/dist/clis/args/list.d.mts +8 -2
  51. package/dist/clis/args/list.d.mts.map +1 -0
  52. package/dist/clis/args/list.mjs +6 -1
  53. package/dist/clis/args/list.mjs.map +1 -0
  54. package/dist/clis/args/login.d.mts +23 -2
  55. package/dist/clis/args/login.d.mts.map +1 -0
  56. package/dist/clis/args/login.mjs +39 -1
  57. package/dist/clis/args/login.mjs.map +1 -0
  58. package/dist/clis/args/{access-token-C5sKsH2O.d.mts → mcp.d.mts} +6 -7
  59. package/dist/clis/args/mcp.d.mts.map +1 -0
  60. package/dist/clis/args/mcp.mjs +22 -0
  61. package/dist/clis/args/mcp.mjs.map +1 -0
  62. package/dist/clis/args/migrate.d.mts +26 -2
  63. package/dist/clis/args/migrate.d.mts.map +1 -0
  64. package/dist/clis/args/migrate.mjs +43 -1
  65. package/dist/clis/args/migrate.mjs.map +1 -0
  66. package/dist/clis/args/{uninstall-CDx7lwxn.d.mts → model.d.mts} +28 -17
  67. package/dist/clis/args/model.d.mts.map +1 -0
  68. package/dist/clis/args/model.mjs +51 -0
  69. package/dist/clis/args/model.mjs.map +1 -0
  70. package/dist/clis/args/publish.d.mts +18 -2
  71. package/dist/clis/args/publish.d.mts.map +1 -0
  72. package/dist/clis/args/publish.mjs +26 -1
  73. package/dist/clis/args/publish.mjs.map +1 -0
  74. package/dist/clis/args/registry.d.mts +15 -2
  75. package/dist/clis/args/registry.d.mts.map +1 -0
  76. package/dist/clis/args/registry.mjs +22 -1
  77. package/dist/clis/args/registry.mjs.map +1 -0
  78. package/dist/clis/args/{unpublish-CEDsk6uv.d.mts → run.d.mts} +11 -12
  79. package/dist/clis/args/run.d.mts.map +1 -0
  80. package/dist/clis/args/run.mjs +33 -0
  81. package/dist/clis/args/run.mjs.map +1 -0
  82. package/dist/clis/args/{service-BBx5GDTc.d.mts → service-CLCvH3kf.d.mts} +4 -4
  83. package/dist/clis/args/service-CLCvH3kf.d.mts.map +1 -0
  84. package/dist/clis/args/service.d.mts +1 -1
  85. package/dist/clis/args/service.mjs +10 -1
  86. package/dist/clis/args/service.mjs.map +1 -0
  87. package/dist/clis/args/switchboard.d.mts +68 -2
  88. package/dist/clis/args/switchboard.d.mts.map +1 -0
  89. package/dist/clis/args/switchboard.mjs +84 -1
  90. package/dist/clis/args/switchboard.mjs.map +1 -0
  91. package/dist/clis/args/uninstall.d.mts +26 -2
  92. package/dist/clis/args/uninstall.d.mts.map +1 -0
  93. package/dist/clis/args/uninstall.mjs +15 -1
  94. package/dist/clis/args/uninstall.mjs.map +1 -0
  95. package/dist/clis/args/unpublish.d.mts +20 -2
  96. package/dist/clis/args/unpublish.d.mts.map +1 -0
  97. package/dist/clis/args/unpublish.mjs +29 -1
  98. package/dist/clis/args/unpublish.mjs.map +1 -0
  99. package/dist/clis/args/{vetra-BUNlAAPp.mjs → vetra-BqjDopAP.mjs} +18 -2
  100. package/dist/clis/args/vetra-BqjDopAP.mjs.map +1 -0
  101. package/dist/clis/args/vetra.d.mts +112 -2
  102. package/dist/clis/args/vetra.d.mts.map +1 -0
  103. package/dist/clis/args/vetra.mjs +1 -1
  104. package/dist/clis/{build-config-CmdMi_wu.mjs → build-config-BM1RL4u_.mjs} +87 -8
  105. package/dist/clis/build-config-BM1RL4u_.mjs.map +1 -0
  106. package/dist/clis/build-config.d.mts +26 -1
  107. package/dist/clis/build-config.d.mts.map +1 -1
  108. package/dist/clis/build-config.mjs +2 -2
  109. package/dist/clis/build-pieces.d.mts +71 -4
  110. package/dist/clis/build-pieces.d.mts.map +1 -1
  111. package/dist/clis/build-pieces.mjs +249 -26
  112. package/dist/clis/build-pieces.mjs.map +1 -1
  113. package/dist/clis/command-names.d.mts +3 -1
  114. package/dist/clis/command-names.d.mts.map +1 -1
  115. package/dist/clis/command-names.mjs +8 -1
  116. package/dist/clis/command-names.mjs.map +1 -1
  117. package/dist/clis/constants.d.mts +2 -2
  118. package/dist/clis/constants.mjs +92 -20
  119. package/dist/clis/constants.mjs.map +1 -1
  120. package/dist/clis/definition-sources.d.mts +26 -0
  121. package/dist/clis/definition-sources.d.mts.map +1 -0
  122. package/dist/clis/definition-sources.mjs +27 -0
  123. package/dist/clis/definition-sources.mjs.map +1 -0
  124. package/dist/clis/deprecations.d.mts +73 -0
  125. package/dist/clis/deprecations.d.mts.map +1 -0
  126. package/dist/clis/deprecations.mjs +121 -0
  127. package/dist/clis/deprecations.mjs.map +1 -0
  128. package/dist/clis/{index-6CZwrmQi.d.mts → index-DnZYG-8g.d.mts} +2 -2
  129. package/dist/clis/{index-6CZwrmQi.d.mts.map → index-DnZYG-8g.d.mts.map} +1 -1
  130. package/dist/clis/index.d.mts +2584 -901
  131. package/dist/clis/index.d.mts.map +1 -1
  132. package/dist/clis/index.mjs +1540 -919
  133. package/dist/clis/index.mjs.map +1 -1
  134. package/dist/clis/package-style.d.mts +32 -0
  135. package/dist/clis/package-style.d.mts.map +1 -0
  136. package/dist/clis/package-style.mjs +102 -0
  137. package/dist/clis/package-style.mjs.map +1 -0
  138. package/dist/clis/ph-dir.d.mts +26 -0
  139. package/dist/clis/ph-dir.d.mts.map +1 -0
  140. package/dist/clis/ph-dir.mjs +37 -0
  141. package/dist/clis/ph-dir.mjs.map +1 -0
  142. package/dist/clis/project-env.d.mts +6 -0
  143. package/dist/clis/project-env.d.mts.map +1 -1
  144. package/dist/clis/project-env.mjs +16 -1
  145. package/dist/clis/project-env.mjs.map +1 -1
  146. package/dist/clis/real-paths.d.mts +14 -0
  147. package/dist/clis/real-paths.d.mts.map +1 -0
  148. package/dist/clis/real-paths.mjs +36 -0
  149. package/dist/clis/real-paths.mjs.map +1 -0
  150. package/dist/clis/retired-flags.d.mts +45 -0
  151. package/dist/clis/retired-flags.d.mts.map +1 -0
  152. package/dist/clis/retired-flags.mjs +55 -0
  153. package/dist/clis/retired-flags.mjs.map +1 -0
  154. package/dist/clis/rolldown-runtime-B4iAMlE-.mjs +35 -0
  155. package/dist/clis/types-CZU17kAm.d.mts +2510 -0
  156. package/dist/clis/types-CZU17kAm.d.mts.map +1 -0
  157. package/dist/clis/utils.d.mts.map +1 -1
  158. package/dist/clis/utils.mjs.map +1 -1
  159. package/dist/{config-loader-C6dZB_iX.js → config-loader-B7SqNz8z.js} +24 -6
  160. package/dist/config-loader-B7SqNz8z.js.map +1 -0
  161. package/dist/connect/app-shell.d.ts +48 -0
  162. package/dist/connect/app-shell.d.ts.map +1 -0
  163. package/dist/connect/app-shell.js +90 -0
  164. package/dist/connect/app-shell.js.map +1 -0
  165. package/dist/connect/config-loader.d.ts +8 -1
  166. package/dist/connect/config-loader.d.ts.map +1 -1
  167. package/dist/connect/config-loader.js +2 -2
  168. package/dist/connect/connect-config-schema.d.ts +3 -0
  169. package/dist/connect/connect-config-schema.js +486 -0
  170. package/dist/connect/connect-config-schema.js.map +1 -0
  171. package/dist/connect/image-ref.d.ts +32 -0
  172. package/dist/connect/image-ref.d.ts.map +1 -0
  173. package/dist/connect/image-ref.js +80 -0
  174. package/dist/connect/image-ref.js.map +1 -0
  175. package/dist/connect/index.d.ts +84 -635
  176. package/dist/connect/index.d.ts.map +1 -1
  177. package/dist/connect/index.js +216 -553
  178. package/dist/connect/index.js.map +1 -1
  179. package/dist/connect/origin-placeholder.d.ts +52 -0
  180. package/dist/connect/origin-placeholder.d.ts.map +1 -0
  181. package/dist/connect/origin-placeholder.js +101 -0
  182. package/dist/connect/origin-placeholder.js.map +1 -0
  183. package/dist/connect-config-schema-cBfkNo1b.d.ts +1872 -0
  184. package/dist/connect-config-schema-cBfkNo1b.d.ts.map +1 -0
  185. package/dist/constants-5UFY_rXh.d.ts +9 -0
  186. package/dist/constants-5UFY_rXh.d.ts.map +1 -0
  187. package/dist/constants.d.ts +1 -1
  188. package/dist/constants.js +22 -6
  189. package/dist/constants.js.map +1 -1
  190. package/dist/document-drive/index.d.ts +3 -4
  191. package/dist/document-drive/index.d.ts.map +1 -1
  192. package/dist/document-drive/index.js +2 -13
  193. package/dist/document-drive/index.js.map +1 -1
  194. package/dist/document-model/action-id.d.ts +3 -0
  195. package/dist/document-model/action-id.js +59 -0
  196. package/dist/document-model/action-id.js.map +1 -0
  197. package/dist/document-model/dispatch.d.ts +25 -0
  198. package/dist/document-model/dispatch.d.ts.map +1 -0
  199. package/dist/document-model/dispatch.js +0 -0
  200. package/dist/document-model/errors.d.ts +3 -0
  201. package/dist/document-model/errors.js +214 -0
  202. package/dist/document-model/errors.js.map +1 -0
  203. package/dist/document-model/index.d.ts +5 -4
  204. package/dist/document-model/index.js +7 -5521
  205. package/dist/document-model/utils.d.ts +3 -2
  206. package/dist/document-model/utils.js +3 -2
  207. package/dist/document-model/version.d.ts +3 -0
  208. package/dist/document-model/version.js +8 -0
  209. package/dist/document-model/version.js.map +1 -0
  210. package/dist/document-model-CqySIaKV.js +5805 -0
  211. package/dist/document-model-CqySIaKV.js.map +1 -0
  212. package/dist/host-tokens/index.d.ts +3 -0
  213. package/dist/host-tokens/index.js +2 -0
  214. package/dist/host-tokens-DOeyxqLi.js +322 -0
  215. package/dist/host-tokens-DOeyxqLi.js.map +1 -0
  216. package/dist/{index-5gwOhPG5.d.ts → index-CUZ8eWun.d.ts} +2 -2
  217. package/dist/{index-5gwOhPG5.d.ts.map → index-CUZ8eWun.d.ts.map} +1 -1
  218. package/dist/index-D58WVj_E.d.ts +246 -0
  219. package/dist/index-D58WVj_E.d.ts.map +1 -0
  220. package/dist/index.d.ts +5 -5
  221. package/dist/processors/index.d.ts +2 -2
  222. package/dist/processors/index.js +177 -68
  223. package/dist/processors/index.js.map +1 -1
  224. package/dist/processors/testing.d.ts +22 -0
  225. package/dist/processors/testing.d.ts.map +1 -0
  226. package/dist/processors/testing.js +77 -0
  227. package/dist/processors/testing.js.map +1 -0
  228. package/dist/purge-CbAV5DVh.js +631 -0
  229. package/dist/purge-CbAV5DVh.js.map +1 -0
  230. package/dist/registry/index.d.ts +3 -3
  231. package/dist/registry/index.js +52 -9
  232. package/dist/registry/index.js.map +1 -1
  233. package/dist/registry/manifest-slim.d.ts +2 -2
  234. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  235. package/dist/types-CV2j3BvH.d.ts +5709 -0
  236. package/dist/types-CV2j3BvH.d.ts.map +1 -0
  237. package/dist/{types-CI3ren9F.d.ts → types-D_6ZcaJj.d.ts} +20 -12
  238. package/dist/types-D_6ZcaJj.d.ts.map +1 -0
  239. package/dist/{utils-CSF716ux.js → utils-DiV32YIj.js} +45 -2
  240. package/dist/utils-DiV32YIj.js.map +1 -0
  241. package/dist/utils-MrLmLEVr.js +78 -0
  242. package/dist/utils-MrLmLEVr.js.map +1 -0
  243. package/dist/version-BxLITo9P.d.ts +6 -0
  244. package/dist/version-BxLITo9P.d.ts.map +1 -0
  245. package/package.json +37 -3
  246. package/dist/clis/args/access-token-3Hqv_U8I.mjs +0 -22
  247. package/dist/clis/args/access-token-3Hqv_U8I.mjs.map +0 -1
  248. package/dist/clis/args/access-token-C5sKsH2O.d.mts.map +0 -1
  249. package/dist/clis/args/common-BXabdhiO.mjs.map +0 -1
  250. package/dist/clis/args/common-Bnm859xU.d.mts.map +0 -1
  251. package/dist/clis/args/connect-BG3HkYBk.mjs +0 -203
  252. package/dist/clis/args/connect-BG3HkYBk.mjs.map +0 -1
  253. package/dist/clis/args/connect-DjeiqXus.d.mts +0 -450
  254. package/dist/clis/args/connect-DjeiqXus.d.mts.map +0 -1
  255. package/dist/clis/args/generate-BOItUNvP.mjs.map +0 -1
  256. package/dist/clis/args/generate-BPBBLeUD.d.mts +0 -103
  257. package/dist/clis/args/generate-BPBBLeUD.d.mts.map +0 -1
  258. package/dist/clis/args/help-DS1NlcJQ.mjs.map +0 -1
  259. package/dist/clis/args/help-DVPTARGn.d.mts.map +0 -1
  260. package/dist/clis/args/init-CFeTq4Cq.d.mts +0 -52
  261. package/dist/clis/args/init-CFeTq4Cq.d.mts.map +0 -1
  262. package/dist/clis/args/init-Dvb42Y87.mjs +0 -67
  263. package/dist/clis/args/init-Dvb42Y87.mjs.map +0 -1
  264. package/dist/clis/args/inspect-BjRmtB86.d.mts +0 -13
  265. package/dist/clis/args/inspect-BjRmtB86.d.mts.map +0 -1
  266. package/dist/clis/args/inspect-UNQgtuR0.mjs +0 -15
  267. package/dist/clis/args/inspect-UNQgtuR0.mjs.map +0 -1
  268. package/dist/clis/args/install-B0tMyUMw.d.mts +0 -37
  269. package/dist/clis/args/install-B0tMyUMw.d.mts.map +0 -1
  270. package/dist/clis/args/install-F-27kF6m.mjs +0 -32
  271. package/dist/clis/args/install-F-27kF6m.mjs.map +0 -1
  272. package/dist/clis/args/list-Bkfn8Yuo.mjs +0 -7
  273. package/dist/clis/args/list-Bkfn8Yuo.mjs.map +0 -1
  274. package/dist/clis/args/list-DrbxA7JJ.d.mts +0 -10
  275. package/dist/clis/args/list-DrbxA7JJ.d.mts.map +0 -1
  276. package/dist/clis/args/login-CIFkQExi.mjs +0 -40
  277. package/dist/clis/args/login-CIFkQExi.mjs.map +0 -1
  278. package/dist/clis/args/login-CXRJXg71.d.mts.map +0 -1
  279. package/dist/clis/args/magic-string.es-BWtG0AyA.mjs +0 -1019
  280. package/dist/clis/args/magic-string.es-BWtG0AyA.mjs.map +0 -1
  281. package/dist/clis/args/migrate-DkCQRL2D.d.mts +0 -19
  282. package/dist/clis/args/migrate-DkCQRL2D.d.mts.map +0 -1
  283. package/dist/clis/args/migrate-DwJGhc2d.mjs +0 -29
  284. package/dist/clis/args/migrate-DwJGhc2d.mjs.map +0 -1
  285. package/dist/clis/args/publish-CeW4bOrl.d.mts +0 -16
  286. package/dist/clis/args/publish-CeW4bOrl.d.mts.map +0 -1
  287. package/dist/clis/args/publish-DHqlGWmL.mjs +0 -19
  288. package/dist/clis/args/publish-DHqlGWmL.mjs.map +0 -1
  289. package/dist/clis/args/registry-DIwES3l2.mjs +0 -23
  290. package/dist/clis/args/registry-DIwES3l2.mjs.map +0 -1
  291. package/dist/clis/args/registry-DNH8xuaE.d.mts +0 -17
  292. package/dist/clis/args/registry-DNH8xuaE.d.mts.map +0 -1
  293. package/dist/clis/args/service-BBx5GDTc.d.mts.map +0 -1
  294. package/dist/clis/args/service-Cpjlyeu5.mjs +0 -11
  295. package/dist/clis/args/service-Cpjlyeu5.mjs.map +0 -1
  296. package/dist/clis/args/switchboard-CCaAtU56.mjs +0 -85
  297. package/dist/clis/args/switchboard-CCaAtU56.mjs.map +0 -1
  298. package/dist/clis/args/switchboard-RrNb1fUH.d.mts +0 -70
  299. package/dist/clis/args/switchboard-RrNb1fUH.d.mts.map +0 -1
  300. package/dist/clis/args/uninstall-3U0B8g5c.mjs +0 -16
  301. package/dist/clis/args/uninstall-3U0B8g5c.mjs.map +0 -1
  302. package/dist/clis/args/uninstall-CDx7lwxn.d.mts.map +0 -1
  303. package/dist/clis/args/unpublish-CEDsk6uv.d.mts.map +0 -1
  304. package/dist/clis/args/unpublish-s9zUh6Gw.mjs +0 -30
  305. package/dist/clis/args/unpublish-s9zUh6Gw.mjs.map +0 -1
  306. package/dist/clis/args/vetra-BUNlAAPp.mjs.map +0 -1
  307. package/dist/clis/args/vetra-DkDaWFPi.d.mts +0 -111
  308. package/dist/clis/args/vetra-DkDaWFPi.d.mts.map +0 -1
  309. package/dist/clis/args/vetra-ports.test.d.mts +0 -2
  310. package/dist/clis/args/vetra-ports.test.mjs +0 -13354
  311. package/dist/clis/args/vetra-ports.test.mjs.map +0 -1
  312. package/dist/clis/build-config-CmdMi_wu.mjs.map +0 -1
  313. package/dist/clis/types-nzer4WIr.d.mts +0 -541
  314. package/dist/clis/types-nzer4WIr.d.mts.map +0 -1
  315. package/dist/config-loader-C6dZB_iX.js.map +0 -1
  316. package/dist/constants-DO4IYxuR.d.ts +0 -9
  317. package/dist/constants-DO4IYxuR.d.ts.map +0 -1
  318. package/dist/document-model/index.js.map +0 -1
  319. package/dist/index-D6833Siv.d.ts +0 -939
  320. package/dist/index-D6833Siv.d.ts.map +0 -1
  321. package/dist/types-CI3ren9F.d.ts.map +0 -1
  322. package/dist/types-CmeoQg_J.d.ts +0 -3337
  323. package/dist/types-CmeoQg_J.d.ts.map +0 -1
  324. package/dist/utils-BrKxCmKx.d.ts +0 -18
  325. package/dist/utils-BrKxCmKx.d.ts.map +0 -1
  326. package/dist/utils-CSF716ux.js.map +0 -1
@@ -1,3337 +0,0 @@
1
- import { f as IAnalyticsStore } from "./types-Bsp8VL2y.js";
2
- import { ZodRawShape, z } from "zod";
3
- import { Draft } from "mutative";
4
- import { ArgParser } from "cmd-ts/dist/cjs/argparser.js";
5
- import { Agent } from "package-manager-detector";
6
- import { OperationWithContext } from "@powerhousedao/shared/document-model";
7
- import { Kysely, QueryCreator } from "kysely";
8
- import { IncomingMessage, ServerResponse } from "node:http";
9
- import { FC, ReactNode } from "react";
10
- //#region clis/args/common.d.ts
11
- declare const getPackageManagerCommand: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
12
- parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
13
- packageManager: Agent | undefined;
14
- npm: boolean | undefined;
15
- pnpm: boolean | undefined;
16
- yarn: boolean | undefined;
17
- bun: boolean | undefined;
18
- }>>;
19
- } & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
20
- packageManager: Agent | undefined;
21
- npm: boolean | undefined;
22
- pnpm: boolean | undefined;
23
- yarn: boolean | undefined;
24
- bun: boolean | undefined;
25
- }, {
26
- packageManager: Agent | undefined;
27
- npm: boolean | undefined;
28
- pnpm: boolean | undefined;
29
- yarn: boolean | undefined;
30
- bun: boolean | undefined;
31
- }> & {
32
- run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
33
- packageManager: Agent | undefined;
34
- npm: boolean | undefined;
35
- pnpm: boolean | undefined;
36
- yarn: boolean | undefined;
37
- bun: boolean | undefined;
38
- }>>;
39
- } & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
40
- //#endregion
41
- //#region processors/constants.d.ts
42
- declare const PROCESSOR_APPS: readonly ["connect", "switchboard"];
43
- declare const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = "relational-db";
44
- declare const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = "analytics-db";
45
- //#endregion
46
- //#region document-model/signatures.d.ts
47
- type Signature = [string, string, string, string, string];
48
- /**
49
- * A user action signer.
50
- */
51
- type UserActionSigner = {
52
- address: string;
53
- networkId: string;
54
- chainId: number;
55
- };
56
- /**
57
- * An app action signer.
58
- */
59
- type AppActionSigner = {
60
- name: string;
61
- key: string;
62
- };
63
- /**
64
- * An action signer.
65
- */
66
- type ActionSigner = {
67
- user: UserActionSigner;
68
- app: AppActionSigner;
69
- signatures: Signature[];
70
- };
71
- /**
72
- * Information to verify the document creator.
73
- */
74
- type PHDocumentSignatureInfo = {
75
- /**
76
- * The public key of the document creator.
77
- **/
78
- publicKey: JsonWebKey;
79
- /** The nonce that was appended to the message to create the signature. */
80
- nonce: string;
81
- };
82
- /** Joins a signature's params for transport. Already-joined input passes through. */
83
- declare function serializeSignature(signature: Signature | string): string;
84
- /**
85
- * Splits a transported signature back into its params. A tuple passes through.
86
- *
87
- * Short input is padded rather than refused: verification reads the params by
88
- * position and fails on a wrong one, which says more than a length complaint
89
- * raised here would.
90
- */
91
- declare function deserializeSignature(signature: Signature | string): Signature;
92
- /**
93
- * Configuration for hashing document state in operations.
94
- */
95
- type HashConfig = {
96
- /** The hashing algorithm to use (e.g., "sha1", "sha256") */
97
- algorithm: string;
98
- /** The encoding format for the hash output (e.g., "base64", "hex") */
99
- encoding: string;
100
- /** Optional algorithm-specific parameters */
101
- params?: Record<string, unknown>;
102
- };
103
- //#endregion
104
- //#region document-model/operations.d.ts
105
- declare function setNameOperation<TDocument extends PHDocument>(document: TDocument, input: {
106
- name: string;
107
- }): TDocument & {
108
- header: {
109
- name: string;
110
- id: string;
111
- sig: PHDocumentSignatureInfo;
112
- documentType: string;
113
- createdAtUtcIso: string;
114
- slug: string;
115
- branch: string;
116
- revision: {
117
- [scope: string]: number;
118
- };
119
- lastModifiedAtUtcIso: string;
120
- protocolVersions?: {
121
- [key: string]: number;
122
- };
123
- meta?: PHDocumentMeta;
124
- };
125
- };
126
- declare function setPreferredEditorOperation<TDocument extends PHDocument>(document: TDocument, input: {
127
- preferredEditor: string | null;
128
- }): TDocument;
129
- declare function undoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
130
- document: TDocument;
131
- action: Action;
132
- skip: number;
133
- reuseLastOperationIndex: boolean;
134
- };
135
- /**
136
- * V2 of undoOperation for protocol version 2+.
137
- * Key differences from undoOperation:
138
- * - Never reuses operation index (always increments)
139
- * - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)
140
- * - No complex skip calculation - simpler model where each UNDO is independent
141
- */
142
- declare function undoOperationV2<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
143
- document: TDocument;
144
- action: Action;
145
- skip: number;
146
- reuseLastOperationIndex: false;
147
- };
148
- declare function redoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
149
- document: TDocument;
150
- action: Action;
151
- skip: number;
152
- reuseLastOperationIndex: boolean;
153
- };
154
- /**
155
- * An operation that was applied to a {@link BaseDocument}.
156
- *
157
- * @remarks
158
- * Wraps an action with an index, to be added to the operations history of a Document.
159
- * The `index` field is used to keep all operations in order and enable replaying the
160
- * document's history from the beginning. Note that indices and skips are relative to
161
- * a specific reactor. Example below:
162
- *
163
- * For (index, skip, ts, action)
164
- * A - [(0, 0, 1, "A0"), (1, 0, 2, "A1")]
165
- * B - [(0, 0, 0, "B0"), (1, 0, 3, "B1")]
166
- * ...
167
- * B gets A's Operations Scenario:
168
- * B' - [(0, 0, 0, "B0"), (1, 0, 3, "B1"), (2, 1, 1, "A0"), (3, 0, 2, "A1"), (4, 0, 3, "B1")]
169
- * Then A needs to end up with:
170
- * A' - [(0, 0, 1, "A0"), (1, 0, 2, "A1"), (2, 2, 0, "B0"), (3, 0, 1, "A0"), (4, 0, 2, "A1"), (5, 0, 3, "B1")]
171
- * So that both A and B end up with the stream of actions (action):
172
- * [("B0"), ("A0"), ("A1"), ("B1")]
173
- *
174
- * @typeParam A - The type of the action.
175
- */
176
- type Operation = {
177
- /**
178
- * This is a stable id, derived from various document and action properties
179
- * in deriveOperationId().
180
- *
181
- * It _cannot_ be an arbitrary string.
182
- *
183
- * It it also not unique per operation, as reshuffled operations will keep'
184
- * the same id they had before they were reshuffled. This means that the
185
- * IOperationStore may have multiple operations with the same operation id.
186
- **/
187
- id: string;
188
- /** Position of the operation in the history. This is relative to a specific reactor -- they may not all agree on this value. */
189
- index: number;
190
- /** The number of operations skipped with this Operation. This is relative to a specific reactor -- they may not all agree on this value. */
191
- skip: number;
192
- /** Timestamp of when the operation was added */
193
- timestampUtcMs: string;
194
- /** Hash of the resulting document data after the operation */
195
- hash: string;
196
- /** Error message for a failed action */
197
- error?: string;
198
- /**
199
- * If authorization rejected the action, this records the reason why.
200
- */
201
- deniedReason?: string;
202
- /** The resulting state after the operation */
203
- resultingState?: string;
204
- /**
205
- * The action that was applied to the document to produce this operation.
206
- */
207
- action: Action;
208
- };
209
- /**
210
- * The operations history of the document by scope.
211
- *
212
- * This will be removed in a future release.
213
- *
214
- * TODO: Type should be Partial<Record<string, Operation[]>>,
215
- * but that is a breaking change for codegen + external doc models.
216
- */
217
- type DocumentOperations = Record<string, Operation[]>;
218
- /**
219
- * What happened to an operation. An operation that is not `applied` still
220
- * occupies its index but contributes nothing to the document's state.
221
- */
222
- type OperationOutcome = {
223
- kind: "applied";
224
- } | {
225
- kind: "reducer-error";
226
- message: string;
227
- } | {
228
- kind: "denied";
229
- reason: string;
230
- };
231
- /**
232
- * Reads an operation's outcome. A denial takes precedence over a reducer
233
- * error, since a denied operation never reaches its reducer.
234
- */
235
- declare function operationOutcome(operation: Operation): OperationOutcome;
236
- type OperationContext = {
237
- documentId: string;
238
- documentType: string;
239
- scope: string;
240
- branch: string;
241
- resultingState?: string;
242
- ordinal: number;
243
- };
244
- type OperationWithContext$1 = {
245
- operation: Operation;
246
- context: OperationContext;
247
- };
248
- //#endregion
249
- //#region document-model/signature-policy.d.ts
250
- /** The `protocolVersions` key that fixes a document's signature requirement. */
251
- declare const SIGNATURE_PROTOCOL = "signature";
252
- /** `protocolVersions.signature` of a document that requires v2 tuples. */
253
- declare const SIGNATURE_PROTOCOL_V2 = 2;
254
- /** `v2-required`: v2 tuples only and a content-addressed id. */
255
- type SignaturePolicy$1 = "legacy" | "v2-required";
256
- /** What a new document is created as unless the caller or host says otherwise. */
257
- declare const DEFAULT_SIGNATURE_POLICY: SignaturePolicy$1;
258
- declare function isSignaturePolicy(value: unknown): value is SignaturePolicy$1;
259
- type ProtocolVersions = {
260
- [protocol: string]: number;
261
- };
262
- /** Read from a header, a CREATE_DOCUMENT input or a bare map. */
263
- declare function signaturePolicyOf(source: {
264
- protocolVersions?: ProtocolVersions | null;
265
- } | ProtocolVersions | null | undefined): SignaturePolicy$1;
266
- /** `protocolVersions` for a new v2-required document. */
267
- declare function v2RequiredProtocolVersions(base?: ProtocolVersions): ProtocolVersions;
268
- /**
269
- * The policy a create call asks for: `signaturePolicy`, else the `signature`
270
- * key of its `protocolVersions`, else `fallback`, the host's default.
271
- */
272
- declare function requestedSignaturePolicy(request: {
273
- signaturePolicy?: SignaturePolicy$1;
274
- protocolVersions?: ProtocolVersions;
275
- } | undefined, fallback: SignaturePolicy$1): SignaturePolicy$1;
276
- /** `protocolVersions` for a new document under `policy`, over `base`. */
277
- declare function protocolVersionsFor(policy: SignaturePolicy$1, base?: ProtocolVersions): ProtocolVersions;
278
- /** What the id of a v2-required document is a hash of. */
279
- type DocumentIdParams = {
280
- documentType: string;
281
- createdAtUtcIso: string;
282
- nonce: string;
283
- protocolVersions: ProtocolVersions;
284
- };
285
- /** `base64url(sha256(canonicalJson(params)))`, unpadded. */
286
- declare function deriveDocumentId(params: DocumentIdParams): string;
287
- /** Whether `id` has the shape `deriveDocumentId` produces. */
288
- declare function isDerivedDocumentId(id: string): boolean;
289
- //#endregion
290
- //#region document-model/state.d.ts
291
- /**
292
- * Creates a default PHAuthState
293
- */
294
- declare function defaultAuthState(): PHAuthState;
295
- /**
296
- * Creates a default PHDocumentState
297
- */
298
- declare function defaultDocumentState(): PHDocumentState;
299
- /**
300
- * Creates a default PHBaseState with auth and document properties
301
- */
302
- declare function defaultBaseState(): PHBaseState;
303
- /**
304
- * Creates a PHAuthState with the given properties
305
- */
306
- declare function createAuthState(auth?: Partial<PHAuthState>): PHAuthState;
307
- /**
308
- * Creates a PHDocumentState with the given properties
309
- */
310
- declare function createDocumentState(document?: Partial<PHDocumentState>): PHDocumentState;
311
- /**
312
- * Creates a PHBaseState with the given auth and document properties
313
- */
314
- declare function createBaseState(auth?: Partial<PHAuthState>, document?: Partial<PHDocumentState>): PHBaseState;
315
- /**
316
- * Backfills the auth scope to the default for legacy documents serialized with
317
- * an empty `auth`. Replaces only `state.auth`. Idempotent.
318
- */
319
- declare function backfillAuthState<TState extends PHBaseState>(state: TState): TState;
320
- /**
321
- * The document state of the document.
322
- */
323
- type PHDocumentState = {
324
- /**
325
- * The current document model schema version of the document. This is used
326
- * with the UPGRADE_DOCUMENT operation to specify the DocumentModelModule
327
- * version to use for reducer execution.
328
- */
329
- version: number;
330
- /** Hash configuration for operation state verification */
331
- hash: HashConfig;
332
- /** True if and only if the document has been deleted */
333
- isDeleted?: boolean;
334
- /** The timestamp when the document was deleted, in UTC ISO format */
335
- deletedAtUtcIso?: string;
336
- /** Optional: who deleted the document */
337
- deletedBy?: string;
338
- /** Optional: reason for deletion */
339
- deletionReason?: string;
340
- };
341
- /**
342
- * The document's authorization policy: an ordered, stacked list of grants,
343
- * where the last matching grant wins. `{ version: 0, grants: [] }` is
344
- * uninitialized and leaves the document open.
345
- */
346
- type PHAuthState = {
347
- /**
348
- * Policy language version. 0 is the uninitialized state; INITIALIZE_AUTH
349
- * sets an integer >= 1.
350
- */
351
- version: number;
352
- grants: Grant[];
353
- /**
354
- * The did:key of the auth-policy creator, captured from the INITIALIZE_AUTH
355
- * signer. The creator may always administer the auth scope, so a grant policy
356
- * can never lock administration out of itself. Absent for an unsigned genesis.
357
- */
358
- creator?: string;
359
- };
360
- type Grant = {
361
- /** Stable id. */
362
- id: string;
363
- description: string;
364
- effect: "allow" | "deny";
365
- principal: Principal;
366
- capability: Capability;
367
- /**
368
- * The grant applies only when this condition holds. Until conditions are
369
- * evaluated, a grant carrying one never applies.
370
- */
371
- where?: Condition;
372
- };
373
- type Principal = {
374
- anyone: true;
375
- } | {
376
- address: string;
377
- } | {
378
- group: string;
379
- } | {
380
- match: Condition;
381
- };
382
- /**
383
- * The folded global state of a PHGroup (powerhouse/reactor-group) document,
384
- * narrowed to what auth evaluation reads. Membership is matched
385
- * case-insensitively against the subject's address.
386
- */
387
- type PHGroupState = {
388
- members: string[];
389
- };
390
- /**
391
- * Folded group states keyed by group document id, as the groups projection
392
- * provides them. A group id a policy names but the map does not hold fails
393
- * closed: the principal does not match.
394
- */
395
- type AuthGroups = Record<string, PHGroupState>;
396
- type Capability = {
397
- can: "read";
398
- scope?: string;
399
- } | {
400
- can: "execute";
401
- scope?: string;
402
- operation?: string[];
403
- };
404
- /**
405
- * Boolean condition language for grants: deterministic, total, and
406
- * JSON-serializable, versioned by `PHAuthState.version`. Defined now but not
407
- * yet evaluated or enforced.
408
- */
409
- type Condition = {
410
- eq: [Operand, Operand];
411
- } | {
412
- ne: [Operand, Operand];
413
- } | {
414
- in: [Operand, Operand[]];
415
- } | {
416
- notIn: [Operand, Operand[]];
417
- } | {
418
- lt: [Operand, Operand];
419
- } | {
420
- lte: [Operand, Operand];
421
- } | {
422
- gt: [Operand, Operand];
423
- } | {
424
- gte: [Operand, Operand];
425
- } | {
426
- exists: Operand;
427
- } | {
428
- and: Condition[];
429
- } | {
430
- or: Condition[];
431
- } | {
432
- not: Condition;
433
- };
434
- /**
435
- * A condition operand: `attr` is a dotted path into the decision context
436
- * (e.g. "doc.global.status", "subject.address"); `lit` is a constant value.
437
- */
438
- type Operand = {
439
- attr: string;
440
- } | {
441
- lit: string | number | boolean | null;
442
- };
443
- /**
444
- * The base state of the document.
445
- */
446
- type PHBaseState = {
447
- /** Carries authentication information. */
448
- auth: PHAuthState;
449
- /** Carries information about the document. */
450
- document: PHDocumentState;
451
- };
452
- declare function defaultGlobalState(): DocumentModelGlobalState;
453
- declare function defaultLocalState(): DocumentModelLocalState;
454
- declare function defaultPHState(): DocumentModelPHState;
455
- declare function createGlobalState(state?: Partial<DocumentModelGlobalState>): DocumentModelGlobalState;
456
- declare function createLocalState(state?: Partial<DocumentModelLocalState>): DocumentModelLocalState;
457
- declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<DocumentModelGlobalState>, localState?: Partial<DocumentModelLocalState>): DocumentModelPHState;
458
- //#endregion
459
- //#region document-model/documents.d.ts
460
- /** Meta information about the document. */
461
- type PHDocumentMeta = {
462
- /** The preferred editor for the document. */
463
- preferredEditor?: string;
464
- };
465
- /**
466
- * The header of a document.
467
- */
468
- type PHDocumentHeader = {
469
- /**
470
- * The id of the document.
471
- *
472
- * This is a Ed25519 signature and is immutable.
473
- **/
474
- id: string;
475
- /**
476
- * Information to verify the document creator.
477
- *
478
- * This is immutable.
479
- **/
480
- sig: PHDocumentSignatureInfo;
481
- /**
482
- * The type of the document.
483
- *
484
- * This is used as part of the signature payload and thus, cannot be changed
485
- * after the document header has been created.
486
- **/
487
- documentType: string;
488
- /**
489
- * The timestamp of the creation date of the document, in UTC ISO format.
490
- *
491
- * This is used as part of the signature payload and thus, cannot be changed
492
- * after the document header has been created.
493
- **/
494
- createdAtUtcIso: string;
495
- /** The slug of the document. */
496
- slug: string;
497
- /** The name of the document. */
498
- name: string;
499
- /** The branch of this document. */
500
- branch: string;
501
- /**
502
- * The revision of each scope of the document. This object is updated every
503
- * time any _other_ scope is updated.
504
- */
505
- revision: {
506
- [scope: string]: number;
507
- };
508
- /**
509
- * The timestamp of the last change in the document, in UTC ISO format.
510
- **/
511
- lastModifiedAtUtcIso: string;
512
- /**
513
- * This is a map from protocol name to version. A protocol can be any set of
514
- * rules that are applied to the document.
515
- *
516
- * Examples of protocols include:
517
- *
518
- * - "base-reducer"
519
- */
520
- protocolVersions?: {
521
- [key: string]: number;
522
- };
523
- /** Meta information about the document. */
524
- meta?: PHDocumentMeta;
525
- };
526
- /**
527
- * The base type of a document model.
528
- *
529
- * @remarks
530
- * This type is extended by all Document models.
531
- *
532
- * @typeParam TState - The type of the document state.
533
- */
534
- type PHDocument<TState extends PHBaseState = PHBaseState> = {
535
- /** The header of the document. */
536
- header: PHDocumentHeader;
537
- /** The document model specific state. */
538
- state: TState;
539
- /**
540
- * The initial state of the document, enabling replaying operations.
541
- *
542
- * This will be removed in a future release.
543
- */
544
- initialState: TState;
545
- /**
546
- * The operations history of the document.
547
- *
548
- * This will be removed in a future release.
549
- */
550
- operations: DocumentOperations;
551
- /**
552
- * A list of undone operations
553
- *
554
- * This will be removed in a future release.
555
- */
556
- clipboard: Operation[];
557
- };
558
- declare function isNoopOperation<TOp extends {
559
- type: string;
560
- skip: number;
561
- hash: string;
562
- }>(op: Partial<TOp>): boolean;
563
- declare function isUndoRedo(action: Action): action is UndoRedoAction;
564
- declare function isUndo(action: Action): action is UndoAction;
565
- declare function isDocumentAction(action: Action): action is DocumentAction;
566
- /**
567
- * Creates a new document. When `documentType` is given the header is stamped
568
- * with it and the document-scope operations are seeded. Without
569
- * `protocolVersions` the document is v2-required and takes a derived id; with
570
- * them it is v2-required only if they say so (see {@link protocolVersionsFor}).
571
- */
572
- declare function baseCreateDocument<TState extends PHBaseState = PHBaseState>(createState: CreateState<TState>, initialState?: Partial<TState>, documentType?: string, protocolVersions?: ProtocolVersions): PHDocument<TState>;
573
- /**
574
- * `document`, not yet created, under a fresh header for `policy`. A legacy
575
- * header takes `id` when given; a v2-required one ignores `id` and derives its
576
- * own, so a caller that needs a fixed id must ask for legacy.
577
- * `protocolVersions` are merged over the document's. Name, slug, branch and
578
- * meta carry over. A document already under `policy` is returned as is unless
579
- * a legacy `id` or `protocolVersions` are given.
580
- */
581
- declare function withSignaturePolicy<TDocument extends PHDocument>(document: TDocument, policy: SignaturePolicy$1, options?: {
582
- id?: string;
583
- protocolVersions?: ProtocolVersions;
584
- }): TDocument;
585
- declare function hashDocumentStateForScope(document: {
586
- state: {
587
- [key: string]: unknown;
588
- };
589
- }, scope?: string): string;
590
- declare function readOnly<T>(value: T): Readonly<T>;
591
- /**
592
- * Maps skipped operations in an array of operations.
593
- * Skipped operations are operations that are ignored during processing.
594
- * @param operations - The array of operations to map.
595
- * @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.
596
- * @returns An array of mapped operations with ignore flag indicating if the operation is skipped.
597
- * @throws Error if the operation index is invalid and there are missing operations.
598
- */
599
- declare function mapSkippedOperations(operations: Operation[], skippedHeadOperations?: number): MappedOperation[];
600
- /**
601
- * V2 version of mapSkippedOperations for protocol version 2+.
602
- * In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.
603
- * N consecutive NOOPs at any point skip N preceding content operations.
604
- *
605
- * Algorithm: Process from end to start
606
- * - When hitting a NOOP: increment chain length, mark as ignored
607
- * - When hitting a non-NOOP:
608
- * - If chain > 0: decrement chain, mark as ignored (this op was undone)
609
- * - If chain == 0: mark as not ignored (apply this op)
610
- */
611
- declare function mapSkippedOperationsV2(operations: Operation[]): MappedOperation[];
612
- /**
613
- * V2 garbage collect that returns only operations that should be applied for state.
614
- * Uses the V2 model where consecutive NOOPs form chains.
615
- * Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.
616
- */
617
- /**
618
- * The base-reducer protocol version a document is written against. Every
619
- * document carries one, set from the CREATE_DOCUMENT input. A header without
620
- * one was built outside that path, and choosing a version on its behalf would
621
- * replay the document through a reducer it was not written for, so it is an
622
- * error rather than a default.
623
- */
624
- declare function baseReducerVersion(header: PHDocumentHeader): number;
625
- declare function garbageCollectV2<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
626
- declare function sortMappedOperations(operations: DocumentOperationsIgnoreMap): MappedOperation[];
627
- /**
628
- * Records an operation in the history without applying it, which is what a
629
- * denied operation needs: it occupies its index and contributes no state.
630
- *
631
- * The scope defaults to the action's own, and is passed explicitly by a rebuild
632
- * that is walking one stream and does not want to trust the action's copy.
633
- */
634
- declare function appendWithoutApplying<TState extends PHBaseState>(document: PHDocument<TState>, operation: Operation, scope?: string): PHDocument<TState>;
635
- declare function replayDocument<TState extends PHBaseState = PHBaseState>(initialState: TState, operations: DocumentOperations, reducer: Reducer<TState>, header: PHDocumentHeader, dispatch?: SignalDispatch, skipHeaderOperations?: SkipHeaderOperations, options?: ReplayDocumentOptions): PHDocument<TState>;
636
- declare function parseResultingState<TState>(state: string | null | undefined): TState;
637
- declare enum IntegrityIssueType {
638
- UNEXPECTED_INDEX = "UNEXPECTED_INDEX"
639
- }
640
- declare enum IntegrityIssueSubType {
641
- DUPLICATED_INDEX = "DUPLICATED_INDEX",
642
- MISSING_INDEX = "MISSING_INDEX"
643
- }
644
- type IntegrityIssue = {
645
- operation: OperationIndex;
646
- issue: IntegrityIssueType;
647
- category: IntegrityIssueSubType;
648
- message: string;
649
- };
650
- type Reshuffle = (startIndex: OperationIndex, opsA: Operation[], opsB: Operation[]) => Operation[];
651
- declare function checkCleanedOperationsIntegrity(sortedOperations: OperationIndex[]): IntegrityIssue[];
652
- declare function garbageCollect<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
653
- declare function addUndo(sortedOperations: Operation[]): Operation[];
654
- declare function sortOperations<TOpIndex extends OperationIndex>(operations: TOpIndex[]): TOpIndex[];
655
- declare function reshuffleByTimestamp<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
656
- declare function reshuffleByTimestampAndIndex<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
657
- declare function operationsAreEqual<TOp extends {
658
- index: number;
659
- skip: number;
660
- type?: string;
661
- scope?: string;
662
- input?: unknown;
663
- }>(op1: TOp, op2: TOp): boolean;
664
- declare function attachBranch(trunk: Operation[], newBranch: Operation[]): [Operation[], Operation[]];
665
- declare function precedes(op1: OperationIndex, op2: OperationIndex): boolean;
666
- declare function split(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[]): [Operation[], Operation[], Operation[]];
667
- declare function merge(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[], reshuffle: Reshuffle): Operation[];
668
- declare function nextSkipNumber(sortedOperations: OperationIndex[]): number;
669
- declare function checkOperationsIntegrity(operations: Operation[]): IntegrityIssue[];
670
- declare function groupOperationsByScope(operations: Operation[]): Partial<Record<string, Operation[]>>;
671
- type PrepareOperationsResult = {
672
- validOperations: Operation[];
673
- invalidOperations: Operation[];
674
- duplicatedOperations: Operation[];
675
- integrityIssues: IntegrityIssue[];
676
- };
677
- declare function prepareOperations(operationsHistory: Operation[], newOperations: Operation[]): PrepareOperationsResult;
678
- declare function removeExistingOperations(newOperations: Operation[], operationsHistory: Operation[]): Operation[];
679
- /**
680
- * Skips header operations and returns the remaining operations.
681
- *
682
- * @param operations - The array of operations.
683
- * @param skipHeaderOperation - The skip header operation index.
684
- * @returns The remaining operations after skipping header operations.
685
- */
686
- declare function skipHeaderOperations(operations: Operation[], skipHeaderOperation: SkipHeaderOperationIndex): Operation[];
687
- declare function garbageCollectDocumentOperations(documentOperations: DocumentOperations): DocumentOperations;
688
- /**
689
- * Filters out duplicated operations from the target operations array based on their IDs.
690
- * If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.
691
- * If an operation does not have an ID, it is considered unique and will not be filtered out.
692
- * @param targetOperations - The array of target operations to filter.
693
- * @param sourceOperations - The array of source operations to compare against.
694
- * @returns An array of operations with duplicates filtered out.
695
- */
696
- declare function filterDuplicatedOperations<T extends {
697
- id?: string | number;
698
- }>(targetOperations: T[], sourceOperations: T[]): T[];
699
- declare function filterDocumentOperationsResultingState(documentOperations?: DocumentOperations): {
700
- [x: string]: Operation[] | {
701
- id: string;
702
- index: number;
703
- skip: number;
704
- timestampUtcMs: string;
705
- hash: string;
706
- error?: string;
707
- deniedReason?: string;
708
- action: Action;
709
- }[];
710
- };
711
- /**
712
- * Calculates the difference between two arrays of operations.
713
- * Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.
714
- *
715
- * @template TOp - The type of the operations.
716
- * @param {TOp[]} clearedOperationsA - The first array of operations.
717
- * @param {TOp[]} clearedOperationsB - The second array of operations.
718
- * @returns {TOp[]} - The difference between the two arrays of operations.
719
- */
720
- declare function diffOperations<TOp extends OperationIndex>(clearedOperationsA: TOp[], clearedOperationsB: TOp[]): TOp[];
721
- declare function getDocumentLastModified(document: PHDocument): string;
722
- /**
723
- * Updates the document header with the latest revision number and
724
- * date of last modification.
725
- *
726
- * @param document The current state of the document.
727
- * @param scope The scope of the operation.
728
- * @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.
729
- * @returns The updated document state.
730
- */
731
- declare function updateHeaderRevision(document: PHDocument, scope: string, lastModifiedTimestamp?: string): PHDocument;
732
- //#endregion
733
- //#region document-model/actions.d.ts
734
- /**
735
- * Cancels the last `count` operations.
736
- *
737
- * @param count - Number of operations to cancel
738
- * @category Actions
739
- */
740
- declare const undo: (count?: number, scope?: string) => UndoAction;
741
- /**
742
- * Cancels the last `count` {@link undo | UNDO} operations.
743
- *
744
- * @param count - Number of UNDO operations to cancel
745
- * @category Actions
746
- */
747
- declare const redo: (count?: number, scope?: string) => RedoAction;
748
- declare const noop: (scope?: string) => NOOPAction;
749
- /**
750
- * Helper function to be used by action creators.
751
- *
752
- * @remarks
753
- * Creates an action with the given type and input properties. The input
754
- * properties default to an empty object.
755
- *
756
- * @typeParam A - Type of the action to be returned.
757
- *
758
- * @param type - The type of the action.
759
- * @param input - The input properties of the action.
760
- * @param _attachments - Deprecated and ignored. Retained so action creators
761
- * generated before the attachment-system removal keep their 5-argument shape.
762
- * @param validator - The validator to use for the input properties.
763
- * @param scope - The scope of the action, can either be 'global' or 'local'.
764
- *
765
- * @throws Error if the type is empty or not a string.
766
- *
767
- * @returns The new action.
768
- */
769
- declare function createAction<TAction extends Action>(type: TAction["type"], input?: TAction["input"], _attachments?: unknown, validator?: () => {
770
- parse(v: unknown): TAction["input"];
771
- }, scope?: Action["scope"]): TAction;
772
- /**
773
- * This function should be used instead of { ...action } to ensure
774
- * that extra properties are not included in the action.
775
- */
776
- declare const actionFromAction: (action: Action) => Action;
777
- declare const operationFromAction: (action: Action, index: number, skip: number, context: OperationContext) => Operation;
778
- declare const operationFromOperation: (operation: Operation, index: number, skip: number, context: OperationContext) => Operation;
779
- declare const operationWithContext: (operation: Operation, context: ActionContext) => Operation;
780
- declare const actionContext: () => ActionContext;
781
- declare const actionSigner: (user: UserActionSigner, app: AppActionSigner, signatures?: Signature[]) => ActionSigner;
782
- declare function buildOperationSignature(context: ActionSignatureContext, signMethod: ActionSigningHandler): Promise<Signature>;
783
- /** @deprecated Emits a legacy SHA-1 tuple; sign through `ISigner.signAction`. */
784
- declare function buildSignedAction<TState extends PHBaseState = PHBaseState>(action: Action, reducer: Reducer<TState>, document: PHDocument<TState>, signer: ActionSigner, signHandler: ActionSigningHandler): Promise<Operation>;
785
- /** @deprecated Use `verifyActionSignature` from `@powerhousedao/reactor`. */
786
- declare function verifyOperationSignature(signature: Signature, signer: Omit<ActionSigner, "signatures">, verifyHandler: ActionVerificationHandler): Promise<boolean>;
787
- /**
788
- * Changes the name of the document.
789
- *
790
- * @param name - The name to be set in the document.
791
- * @category Actions
792
- */
793
- declare const setName: (name: string | {
794
- name: string;
795
- }) => SetNameAction;
796
- /**
797
- * Changes the preferred editor recorded in the document header meta.
798
- *
799
- * Passing `null` clears the preferred editor.
800
- *
801
- * @category Actions
802
- */
803
- declare const setPreferredEditor: (input: string | null | {
804
- preferredEditor: string | null;
805
- }) => SetPreferredEditorAction;
806
- declare const setModelName: (input: SetModelNameInput) => SetModelNameAction;
807
- declare const setModelId: (input: SetModelIdInput) => SetModelIdAction;
808
- declare const setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
809
- declare const setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
810
- declare const setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
811
- declare const setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
812
- declare const addModule: (input: AddModuleInput) => AddModuleAction;
813
- declare const setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
814
- declare const setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
815
- declare const deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
816
- declare const reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
817
- declare const addOperation: (input: AddOperationInput) => AddOperationAction;
818
- declare const setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
819
- declare const setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
820
- declare const setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
821
- declare const setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
822
- declare const setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
823
- declare const setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
824
- declare const moveOperation: (input: MoveOperationInput) => MoveOperationAction;
825
- declare const deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
826
- declare const reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
827
- declare const addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
828
- declare const setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
829
- declare const setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
830
- declare const setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
831
- declare const setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
832
- declare const deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
833
- declare const reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
834
- declare const addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
835
- declare const updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
836
- declare const deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
837
- declare const reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
838
- declare const operationExampleCreators: {
839
- addOperationExample: typeof addOperationExample;
840
- updateOperationExample: typeof updateOperationExample;
841
- deleteOperationExample: typeof deleteOperationExample;
842
- reorderOperationExamples: typeof reorderOperationExamples;
843
- };
844
- declare const setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
845
- declare const setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
846
- declare const addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
847
- declare const updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
848
- declare const deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
849
- declare const reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
850
- declare const addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
851
- declare const updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
852
- declare const deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
853
- declare const reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
854
- declare const releaseNewVersion: () => ReleaseNewVersionAction;
855
- declare const baseActions: {
856
- setName: typeof setName;
857
- setPreferredEditor: typeof setPreferredEditor;
858
- undo: typeof undo;
859
- redo: typeof redo;
860
- noop: typeof noop;
861
- };
862
- declare const documentModelActions: {
863
- setModelName: typeof setModelName;
864
- setModelId: typeof setModelId;
865
- setModelExtension: typeof setModelExtension;
866
- setModelDescription: typeof setModelDescription;
867
- setAuthorName: typeof setAuthorName;
868
- setAuthorWebsite: typeof setAuthorWebsite;
869
- addModule: typeof addModule;
870
- setModuleName: typeof setModuleName;
871
- setModuleDescription: typeof setModuleDescription;
872
- deleteModule: typeof deleteModule;
873
- reorderModules: typeof reorderModules;
874
- addOperation: typeof addOperation;
875
- setOperationName: typeof setOperationName;
876
- setOperationScope: typeof setOperationScope;
877
- setOperationSchema: typeof setOperationSchema;
878
- setOperationDescription: typeof setOperationDescription;
879
- setOperationTemplate: typeof setOperationTemplate;
880
- setOperationReducer: typeof setOperationReducer;
881
- moveOperation: typeof moveOperation;
882
- deleteOperation: typeof deleteOperation;
883
- reorderModuleOperations: typeof reorderModuleOperations;
884
- addOperationError: typeof addOperationError;
885
- setOperationErrorCode: typeof setOperationErrorCode;
886
- setOperationErrorName: typeof setOperationErrorName;
887
- setOperationErrorDescription: typeof setOperationErrorDescription;
888
- setOperationErrorTemplate: typeof setOperationErrorTemplate;
889
- deleteOperationError: typeof deleteOperationError;
890
- reorderOperationErrors: typeof reorderOperationErrors;
891
- addOperationExample: typeof addOperationExample;
892
- updateOperationExample: typeof updateOperationExample;
893
- deleteOperationExample: typeof deleteOperationExample;
894
- reorderOperationExamples: typeof reorderOperationExamples;
895
- setStateSchema: typeof setStateSchema;
896
- setInitialState: typeof setInitialState;
897
- addStateExample: typeof addStateExample;
898
- updateStateExample: typeof updateStateExample;
899
- deleteStateExample: typeof deleteStateExample;
900
- reorderStateExamples: typeof reorderStateExamples;
901
- addChangeLogItem: typeof addChangeLogItem;
902
- updateChangeLogItem: typeof updateChangeLogItem;
903
- deleteChangeLogItem: typeof deleteChangeLogItem;
904
- reorderChangeLogItems: typeof reorderChangeLogItems;
905
- releaseNewVersion: typeof releaseNewVersion;
906
- };
907
- declare const actions: {
908
- setName: typeof setName;
909
- setPreferredEditor: typeof setPreferredEditor;
910
- undo: typeof undo;
911
- redo: typeof redo;
912
- noop: typeof noop;
913
- setModelName: typeof setModelName;
914
- setModelId: typeof setModelId;
915
- setModelExtension: typeof setModelExtension;
916
- setModelDescription: typeof setModelDescription;
917
- setAuthorName: typeof setAuthorName;
918
- setAuthorWebsite: typeof setAuthorWebsite;
919
- addModule: typeof addModule;
920
- setModuleName: typeof setModuleName;
921
- setModuleDescription: typeof setModuleDescription;
922
- deleteModule: typeof deleteModule;
923
- reorderModules: typeof reorderModules;
924
- addOperation: typeof addOperation;
925
- setOperationName: typeof setOperationName;
926
- setOperationScope: typeof setOperationScope;
927
- setOperationSchema: typeof setOperationSchema;
928
- setOperationDescription: typeof setOperationDescription;
929
- setOperationTemplate: typeof setOperationTemplate;
930
- setOperationReducer: typeof setOperationReducer;
931
- moveOperation: typeof moveOperation;
932
- deleteOperation: typeof deleteOperation;
933
- reorderModuleOperations: typeof reorderModuleOperations;
934
- addOperationError: typeof addOperationError;
935
- setOperationErrorCode: typeof setOperationErrorCode;
936
- setOperationErrorName: typeof setOperationErrorName;
937
- setOperationErrorDescription: typeof setOperationErrorDescription;
938
- setOperationErrorTemplate: typeof setOperationErrorTemplate;
939
- deleteOperationError: typeof deleteOperationError;
940
- reorderOperationErrors: typeof reorderOperationErrors;
941
- addOperationExample: typeof addOperationExample;
942
- updateOperationExample: typeof updateOperationExample;
943
- deleteOperationExample: typeof deleteOperationExample;
944
- reorderOperationExamples: typeof reorderOperationExamples;
945
- setStateSchema: typeof setStateSchema;
946
- setInitialState: typeof setInitialState;
947
- addStateExample: typeof addStateExample;
948
- updateStateExample: typeof updateStateExample;
949
- deleteStateExample: typeof deleteStateExample;
950
- reorderStateExamples: typeof reorderStateExamples;
951
- addChangeLogItem: typeof addChangeLogItem;
952
- updateChangeLogItem: typeof updateChangeLogItem;
953
- deleteChangeLogItem: typeof deleteChangeLogItem;
954
- reorderChangeLogItems: typeof reorderChangeLogItems;
955
- releaseNewVersion: typeof releaseNewVersion;
956
- };
957
- /**
958
- * The context of an action.
959
- */
960
- type ActionContext = {
961
- /** The index of the previous operation, showing intended ordering. */
962
- prevOpIndex?: number;
963
- /** The hash of the previous operation, showing intended state. */
964
- prevOpHash?: string;
965
- /** A nonce, to cover specific signing attacks and to prevent replay attacks from no-ops. */
966
- nonce?: string;
967
- /** The signer of the action. */
968
- signer?: ActionSigner;
969
- };
970
- /**
971
- * Defines the basic structure of an action.
972
- */
973
- type Action = {
974
- /** The id of the action. This is distinct from the operation id. */
975
- id: string;
976
- /** The name of the action. */
977
- type: string;
978
- /** The timestamp of the action. */
979
- timestampUtcMs: string;
980
- /** The payload of the action. */
981
- input: unknown;
982
- /** The scope of the action */
983
- scope: string;
984
- /** The context of the action. */
985
- context?: ActionContext;
986
- };
987
- //#endregion
988
- //#region processors/http.d.ts
989
- /** Methods a package route may bind. OPTIONS belongs to the CORS layer. */
990
- type RouteMethod = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
991
- interface RouteUser {
992
- address: string;
993
- chainId: number;
994
- networkId: string;
995
- appKey: string;
996
- }
997
- type RouteActor = {
998
- user: RouteUser | undefined;
999
- authEnabled: boolean;
1000
- };
1001
- type AuthorizerResult = {
1002
- authorized: true;
1003
- } |
1004
- /** Refused; the scope answers with its own JSON error envelope. */
1005
- {
1006
- authorized: false;
1007
- status: number;
1008
- message: string;
1009
- } | {
1010
- authorized: false;
1011
- response: Response;
1012
- };
1013
- /** A route-specific gate, for policies the standard modes cannot express. */
1014
- type RouteAuthorizer = (req: IncomingMessage) => Promise<AuthorizerResult> | AuthorizerResult;
1015
- /** How a route authenticates. */
1016
- type RouteAuth =
1017
- /** Default. A verifiable bearer is required; a caller without one gets 401. */
1018
- "renown" | "renown-optional" | "public" | RouteAuthorizer;
1019
- /** How the request body reaches the handler. */
1020
- type RouteBody =
1021
- /** Default. Buffered, and readable through the Fetch Request. */
1022
- "parsed" |
1023
- /** Buffered and also handed over as `ctx.rawBody`, byte for byte. */
1024
- "raw" |
1025
- /** Not buffered; the Fetch Request body is the live request stream. */
1026
- "stream" |
1027
- /** The body is not read at all. */
1028
- "none";
1029
- interface RouteOptions {
1030
- auth?: RouteAuth;
1031
- body?: RouteBody;
1032
- /** Refuse a body larger than this with 413. Ignored when body is `stream`. */
1033
- maxBodyBytes?: number;
1034
- /** Serve sub-paths too, not just an exact match. */
1035
- prefix?: boolean;
1036
- }
1037
- /** Where the request reached the host, resolved through any reverse proxy. */
1038
- interface RouteTransport {
1039
- proto: string;
1040
- host: string;
1041
- prefix: string;
1042
- baseUrl: string;
1043
- }
1044
- interface RouteContext {
1045
- /** Decoded path params. */
1046
- params: Record<string, string>;
1047
- user: RouteUser | undefined;
1048
- authEnabled: boolean;
1049
- /** The exact octets received. Present only when body is `raw`. */
1050
- rawBody: Buffer | undefined;
1051
- /** Aborts when the client disconnects. */
1052
- signal: AbortSignal;
1053
- transport: RouteTransport;
1054
- }
1055
- type RouteHandler = (request: Request, ctx: RouteContext) => Response | Promise<Response>;
1056
- interface RouteSpec extends RouteOptions {
1057
- method: RouteMethod | RouteMethod[];
1058
- /** Relative to the scope: "runs/:id", never "/api/@scope/pkg/runs/:id". */
1059
- path: string;
1060
- handler: RouteHandler;
1061
- }
1062
- interface NodeRouteSpec extends Omit<RouteOptions, "body" | "maxBodyBytes"> {
1063
- method: RouteMethod | RouteMethod[];
1064
- path: string;
1065
- handler: (req: IncomingMessage, res: ServerResponse, ctx: Omit<RouteContext, "rawBody" | "signal">) => void | Promise<void>;
1066
- }
1067
- interface ScopedRouteHandle {
1068
- /** The absolute public URL this route answers on. */
1069
- readonly url: string;
1070
- dispose(): void;
1071
- }
1072
- type WebhookScheme = "none" |
1073
- /** A shared secret presented verbatim. No digest, so no digest options. */
1074
- "token" |
1075
- /** The digest of the body, alone. */
1076
- "hmac" |
1077
- /** That digest behind a label, `sha256=<digest>`. */
1078
- "hmac-prefixed" | "hmac-timestamped";
1079
- /** Hashes a sender may compute the digest with. */
1080
- type WebhookHashAlgorithm = "sha1" | "sha256" | "sha512";
1081
- /** How the digest is written into the header. */
1082
- type WebhookSignatureEncoding = "hex" | "base64";
1083
- interface WebhookVerification {
1084
- scheme: WebhookScheme;
1085
- /** Resolved value, never a reference — the caller resolves refs. */
1086
- secret?: string;
1087
- /** Overrides the scheme's conventional header. */
1088
- header?: string;
1089
- /** Replay window for timestamped schemes. */
1090
- toleranceSeconds?: number;
1091
- algorithm?: WebhookHashAlgorithm;
1092
- /** Defaults to `hex`. Base64 comparison is case-sensitive; hex is not. */
1093
- encoding?: WebhookSignatureEncoding;
1094
- prefix?: string;
1095
- }
1096
- type WebhookField = string | {
1097
- header: string;
1098
- } |
1099
- /** Dot-separated path into the parsed body, e.g. `data.object.id`. */
1100
- {
1101
- body: string;
1102
- };
1103
- interface WebhookRequest {
1104
- /** The caller's own key for this endpoint, e.g. a document id. */
1105
- key: string;
1106
- method: string;
1107
- path: string;
1108
- queryParams: Record<string, string>;
1109
- /** Lowercased, with credentials redacted. */
1110
- headers: Record<string, string>;
1111
- /** The exact bytes received. */
1112
- raw: Buffer;
1113
- /** JSON and form bodies decoded; anything else as text. */
1114
- body: unknown;
1115
- }
1116
- interface WebhookReply {
1117
- status: number;
1118
- body?: string;
1119
- contentType?: string;
1120
- }
1121
- interface WebhookPolicy {
1122
- verify?: WebhookVerification;
1123
- /** Uppercase. Undefined accepts every method. */
1124
- methods?: string[];
1125
- dedupe?: {
1126
- field: WebhookField;
1127
- ttlSeconds?: number;
1128
- };
1129
- challengeField?: WebhookField;
1130
- maxBodyBytes?: number;
1131
- }
1132
- interface WebhookSpec {
1133
- /** Distinguishes several endpoint families within one package. */
1134
- name: string;
1135
- defaults?: WebhookPolicy;
1136
- onRequest: (request: WebhookRequest) => Promise<WebhookReply> | WebhookReply;
1137
- policyFor?: (key: string) => Promise<WebhookPolicy | undefined> | WebhookPolicy | undefined;
1138
- }
1139
- interface WebhookEndpointInfo {
1140
- key: string;
1141
- token: string;
1142
- url: string;
1143
- createdAt: string;
1144
- }
1145
- interface IWebhookEndpoints {
1146
- endpointFor(key: string): Promise<Omit<WebhookEndpointInfo, "key">>;
1147
- revoke(key: string): Promise<void>;
1148
- list(): Promise<WebhookEndpointInfo[]>;
1149
- }
1150
- interface IWebhookScope {
1151
- register(spec: WebhookSpec): Promise<IWebhookEndpoints>;
1152
- readonly hasPublicOrigin: boolean;
1153
- }
1154
- interface IHttpScope {
1155
- readonly owner: string;
1156
- readonly baseUrl: string;
1157
- get(path: string, handler: RouteHandler): ScopedRouteHandle;
1158
- get(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1159
- post(path: string, handler: RouteHandler): ScopedRouteHandle;
1160
- post(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1161
- put(path: string, handler: RouteHandler): ScopedRouteHandle;
1162
- put(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1163
- patch(path: string, handler: RouteHandler): ScopedRouteHandle;
1164
- patch(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1165
- delete(path: string, handler: RouteHandler): ScopedRouteHandle;
1166
- delete(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1167
- /** Registered independently of GET: a HEAD response is not a bodyless GET. */
1168
- head(path: string, handler: RouteHandler): ScopedRouteHandle;
1169
- head(path: string, options: RouteOptions, handler: RouteHandler): ScopedRouteHandle;
1170
- route(spec: RouteSpec): ScopedRouteHandle;
1171
- nodeRoute(spec: NodeRouteSpec): ScopedRouteHandle;
1172
- readonly webhooks: IWebhookScope;
1173
- /** Release every route this scope registered. Called on package teardown. */
1174
- dispose(): void;
1175
- }
1176
- //#endregion
1177
- //#region processors/types.d.ts
1178
- type ProcessorDispatchResult = {
1179
- id: string;
1180
- status: string;
1181
- };
1182
- interface IProcessorDispatch {
1183
- execute(docId: string, branch: string, actions: Action[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<ProcessorDispatchResult>;
1184
- }
1185
- interface IProcessorHostModuleBase {
1186
- analyticsStore: IAnalyticsStore;
1187
- relationalDb: IRelationalDb;
1188
- processorApp: ProcessorApp;
1189
- dispatch: IProcessorDispatch;
1190
- getReadModel<T>(name: string): T;
1191
- config?: Map<string, unknown>;
1192
- /**
1193
- * The package's slice of the HTTP surface, bound to its own namespace.
1194
- *
1195
- * Declared on the host-agnostic base rather than on each host's module so
1196
- * the two cannot drift: codegen types generated processors against
1197
- * reactor-browser's `IProcessorHostModule`, and the same source has to
1198
- * compile against reactor-api's.
1199
- *
1200
- * Absent whenever the host has no HTTP server — processors also run in the
1201
- * browser — and on the reactor when the package's name cannot be resolved to
1202
- * a routable namespace, so a caller must always check before using it.
1203
- */
1204
- http?: IHttpScope;
1205
- }
1206
- /**
1207
- * Filter for matching operations to processors.
1208
- * All fields are optional arrays - when provided, operations must match at least one value in each specified field.
1209
- * When a field is undefined or empty, it matches all values for that field.
1210
- */
1211
- type ProcessorFilter = {
1212
- documentType?: string[];
1213
- scope?: string[];
1214
- branch?: string[];
1215
- documentId?: string[];
1216
- };
1217
- /**
1218
- * Describes an object that can process operations.
1219
- */
1220
- interface IProcessor {
1221
- /**
1222
- * Processes a list of operations with context.
1223
- * Called when operations match this processor's filter.
1224
- *
1225
- * Delivery is at-least-once. Within a document's scope and branch, each
1226
- * call is in ordinal order, and an operation delivered late comes with
1227
- * every later operation of its stream this processor was already given.
1228
- * Across documents there is no ordering guarantee. A processor receives one
1229
- * `onOperations` call at a time; the next call begins after the previous
1230
- * resolves.
1231
- */
1232
- onOperations(operations: OperationWithContext[]): Promise<void>;
1233
- /**
1234
- * Called when the processor is disconnected.
1235
- * Used to clean up any resources allocated during processor creation.
1236
- */
1237
- onDisconnect(): Promise<void>;
1238
- }
1239
- /**
1240
- * Relates a processor to its filter configuration.
1241
- */
1242
- type ProcessorRecord = {
1243
- processor: IProcessor;
1244
- filter: ProcessorFilter;
1245
- startFrom?: "beginning" | "current";
1246
- id?: string;
1247
- };
1248
- /**
1249
- * A factory function that creates processor records for a given drive.
1250
- * Called once per drive when the drive is first detected or when the factory is registered.
1251
- */
1252
- type ProcessorFactory = (driveHeader: PHDocumentHeader, processorApp?: ProcessorApp) => Promise<ProcessorRecord[]> | ProcessorRecord[];
1253
- /** Takes a processor host module and builds processor factories using its context. */
1254
- type ProcessorFactoryBuilder<TModule extends IProcessorHostModuleBase = IProcessorHostModuleBase> = {
1255
- bivarianceHack(module: TModule): Promise<ProcessorFactory> | ProcessorFactory;
1256
- }["bivarianceHack"];
1257
- type ProcessorStatus = "active" | "errored";
1258
- type TrackedProcessor = {
1259
- processorId: string;
1260
- factoryId: string;
1261
- driveId: string;
1262
- processorIndex: number;
1263
- record: ProcessorRecord;
1264
- lastOrdinal: number;
1265
- status: ProcessorStatus;
1266
- lastError: string | undefined;
1267
- lastErrorTimestamp: Date | undefined;
1268
- /**
1269
- * Clears the error and resolves once the replay from the cursor completes.
1270
- * Safe from anywhere, but awaiting it from this processor's own
1271
- * `onOperations` waits on itself: the replay runs after that call returns.
1272
- * A no-op once the processor has been removed.
1273
- */
1274
- retry: () => Promise<void>;
1275
- };
1276
- /**
1277
- * Manages processor creation and destruction based on drive operations.
1278
- */
1279
- interface IProcessorManager {
1280
- /**
1281
- * Registers a processor factory.
1282
- * Immediately creates processors for all existing drives and resolves once
1283
- * every factory run has completed and its processors are bound. Their
1284
- * backfills run afterwards, on each processor's own queue. If processors
1285
- * from an earlier registration under the same identifier are still
1286
- * draining, or a call of the previous factory is still in flight, the
1287
- * factory runs after they have settled, so awaiting a re-registration of
1288
- * a factory from inside that factory or one of its processors'
1289
- * `onOperations` waits on itself.
1290
- */
1291
- registerFactory(identifier: string, factory: ProcessorFactory): Promise<void>;
1292
- /**
1293
- * Unregisters a processor factory. Resolves once its processors receive no
1294
- * new deliveries and their cursors are deleted; each one's in-flight
1295
- * delivery finishes first, then `onDisconnect` runs. Safe to call from
1296
- * inside a processor's own `onOperations`.
1297
- */
1298
- unregisterFactory(identifier: string): Promise<void>;
1299
- /**
1300
- * Gets a tracked processor by its ID.
1301
- */
1302
- get(processorId: string): TrackedProcessor | undefined;
1303
- /**
1304
- * Gets all tracked processors.
1305
- */
1306
- getAll(): TrackedProcessor[];
1307
- }
1308
- type ProcessorApp = (typeof PROCESSOR_APPS)[number];
1309
- type ProcessorApps = readonly ProcessorApp[];
1310
- //#endregion
1311
- //#region processors/relational/types.d.ts
1312
- type IRelationalQueryMethods = "selectFrom" | "selectNoFrom" | "with" | "withRecursive";
1313
- type IRelationalQueryBuilder<Schema = unknown> = Pick<QueryCreator<Schema>, IRelationalQueryMethods> & {
1314
- withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;
1315
- };
1316
- type HashAlgorithms = "fnv1a";
1317
- type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;
1318
- /**
1319
- * The standardized relational database interface for relational db processors.
1320
- * This abstraction provides type-safe database operations while hiding the underlying
1321
- * database framework implementation details.
1322
- **/
1323
- type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {
1324
- createNamespace<NamespaceSchema>(namespace: string): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;
1325
- queryNamespace<NamespaceSchema>(namespace: string): IRelationalQueryBuilder<NamespaceSchema>;
1326
- };
1327
- type ExtractProcessorSchemaOrSelf<TProcessor> = TProcessor extends RelationalDbProcessor<infer TSchema> ? TSchema : TProcessor;
1328
- type RelationalDbProcessorClass<TSchema> = typeof RelationalDbProcessor<TSchema>;
1329
- interface IRelationalDbProcessor<TDatabaseSchema = unknown> extends IProcessor {
1330
- namespace: string;
1331
- query: IRelationalQueryBuilder<TDatabaseSchema>;
1332
- filter: ProcessorFilter;
1333
- initAndUpgrade(): Promise<void>;
1334
- }
1335
- declare const IS_RELATIONAL_DB_PROCESSOR: unique symbol;
1336
- /**
1337
- * Base class for relational db processors that require a relational database storage.
1338
- * This class abstracts database initialization, migration management, and resource cleanup,
1339
- * allowing derived classes to focus on business logic.
1340
- */
1341
- declare abstract class RelationalDbProcessor<TDatabaseSchema = unknown> implements IRelationalDbProcessor<TDatabaseSchema> {
1342
- protected _namespace: string;
1343
- protected _filter: ProcessorFilter;
1344
- protected relationalDb: IRelationalDb<TDatabaseSchema>;
1345
- constructor(_namespace: string, _filter: ProcessorFilter, relationalDb: IRelationalDb<TDatabaseSchema>);
1346
- static [IS_RELATIONAL_DB_PROCESSOR]: boolean;
1347
- /**
1348
- * Returns the namespace for a given drive id.
1349
- * This method can be overridden by derived classes to provide a custom namespace.
1350
- */
1351
- static getNamespace(driveId: string): string;
1352
- static query<Schema>(this: RelationalDbProcessorClass<Schema>, driveId: string, db: IRelationalDb<any>): IRelationalQueryBuilder<Schema>;
1353
- /**
1354
- * Processes a list of operations with context.
1355
- * Called when operations match this processor's filter.
1356
- */
1357
- abstract onOperations(operations: OperationWithContext[]): Promise<void>;
1358
- /**
1359
- * Returns the filter for the processor.
1360
- * This method can be overridden by derived classes to provide a custom filter.
1361
- */
1362
- get filter(): ProcessorFilter;
1363
- /**
1364
- * Returns the namespace used by the processor.
1365
- */
1366
- get namespace(): string;
1367
- get query(): IRelationalQueryBuilder<TDatabaseSchema>;
1368
- /**
1369
- * Abstract method that derived classes must implement.
1370
- * This method is meant to be called on subclasses to initialize and upgrade the database.
1371
- */
1372
- abstract initAndUpgrade(): Promise<void>;
1373
- /**
1374
- * Called when the processor is disconnected.
1375
- * This method is meant to be overridden by subclasses to clean up resources.
1376
- */
1377
- abstract onDisconnect(): Promise<void>;
1378
- }
1379
- //#endregion
1380
- //#region processors/relational/utils.d.ts
1381
- /**
1382
- * Hashes a string to a lowercase base-26 string.
1383
- * @param str The string to hash.
1384
- * @param length The length of the hash. Defaults to 10.
1385
- * @param algorithm The hashing algorithm to use. Defaults to "fnv1a".
1386
- * @returns The hashed string.
1387
- */
1388
- declare function hashNamespace(str: string, length?: number): string;
1389
- /**
1390
- * Creates a RelationalDb instance with namespace support.
1391
- * @param baseDb The base RelationalDb instance to enhance.
1392
- * @param baseOptions The default options for namespace creation. Hashes namespace by default.
1393
- * @returns The enhanced RelationalDb instance.
1394
- */
1395
- declare function createRelationalDb<Schema>(baseDb: IBaseRelationalDb<Schema>, baseOptions?: NamespaceOptions): IRelationalDb<Schema>;
1396
- type NamespaceOptions = {
1397
- hashNamespace?: boolean;
1398
- };
1399
- declare function createNamespacedDb<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): Promise<IRelationalDb<Schema>>;
1400
- declare function createNamespacedQueryBuilder<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): IRelationalQueryBuilder<Schema>;
1401
- /**
1402
- * Returns a query builder for a RelationalDb instance.
1403
- * @param query The RelationalDb instance to convert.
1404
- * @returns The IRelationalQueryBuilder instance.
1405
- */
1406
- declare function relationalDbToQueryBuilder<TSchema>(query: IBaseRelationalDb<TSchema>): IRelationalQueryBuilder<TSchema>;
1407
- //#endregion
1408
- //#region document-model/action-signature.d.ts
1409
- declare const ACTION_SIGNATURE_V2_PREFIX = "v2:";
1410
- /** The log an operation is stored in, which a v2 tuple is bound to. */
1411
- type ActionSigningTarget = {
1412
- documentId: string;
1413
- branch: string;
1414
- };
1415
- /** Who a v2 tuple attributes the action to; both halves are in the preimage. */
1416
- type ActionSignerIdentity = {
1417
- user: UserActionSigner;
1418
- app: AppActionSigner;
1419
- };
1420
- /** A value that would not survive a JSON store round trip unchanged. */
1421
- declare class CanonicalJsonError extends Error {
1422
- constructor(path: string, detail: string);
1423
- }
1424
- /** Sorted-key JSON, as the state hash encodes; drops `undefined` properties. */
1425
- declare function canonicalJson(value: unknown, label?: string): string;
1426
- /** Actions the reactor reduces itself, onto the document scope. */
1427
- declare const DOCUMENT_SCOPE_ACTION_TYPES: ReadonlySet<string>;
1428
- /** Where a document-scope action writes: `sourceId` or `documentId`. */
1429
- declare function targetDocumentId(action: {
1430
- type: string;
1431
- input: unknown;
1432
- }, fallback: string): string;
1433
- /** The log an action submitted to a job on `documentId` is stored in. */
1434
- declare function actionSigningTarget(action: {
1435
- type: string;
1436
- input: unknown;
1437
- }, documentId: string, branch: string): ActionSigningTarget;
1438
- /** The identity a signer writes into `context.signer`, and signs over. */
1439
- declare function actionSignerIdentity(signer: {
1440
- user?: UserActionSigner;
1441
- app?: AppActionSigner;
1442
- }): ActionSignerIdentity;
1443
- /** The v2 preimage; throws `CanonicalJsonError` on an unsignable action. */
1444
- declare function actionPreimageV2(action: Action, target: ActionSigningTarget, signer: ActionSignerIdentity): string;
1445
- /** `"v2:" + base64url(sha256(preimage))`, unpadded. */
1446
- declare function hashActionV2(action: Action, target: ActionSigningTarget, signer: ActionSignerIdentity): Promise<string>;
1447
- /** Signs `action` as a v2 tuple; the message layout is the legacy one. */
1448
- declare function signActionV2(params: {
1449
- action: Action;
1450
- target: ActionSigningTarget;
1451
- signer: ActionSignerIdentity;
1452
- sign: ActionSigningHandler;
1453
- previousStateHash?: string;
1454
- }): Promise<Signature>;
1455
- /** Element [2] carries the v2 prefix, whether or not it is well formed. */
1456
- declare function isV2ActionHash(hash: string): boolean;
1457
- /** The strict shape of a v2 tuple, apart from what its hash covers. */
1458
- declare function v2TupleProblem(tuple: Signature): string | undefined;
1459
- //#endregion
1460
- //#region document-model/schemas.d.ts
1461
- type definedNonNullAny = {};
1462
- declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
1463
- declare const definedNonNullAnySchema: z.ZodAny & z.ZodType<definedNonNullAny, any, z.core.$ZodTypeInternals<definedNonNullAny, any>>;
1464
- declare const RedoSchema: z.ZodEnum<{
1465
- REDO: "REDO";
1466
- }>;
1467
- declare const Set_NameSchema: z.ZodEnum<{
1468
- SET_NAME: "SET_NAME";
1469
- }>;
1470
- declare const Set_PreferredEditorSchema: z.ZodEnum<{
1471
- SET_PREFERRED_EDITOR: "SET_PREFERRED_EDITOR";
1472
- }>;
1473
- declare const UndoSchema: z.ZodEnum<{
1474
- UNDO: "UNDO";
1475
- }>;
1476
- declare function OperationScopeSchema(): z.ZodString;
1477
- declare function DocumentActionSchema(): z.ZodUnion<readonly [z.ZodObject<Required<{
1478
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1479
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1480
- input: z.ZodType<RedoActionInput, RedoActionInput, z.core.$ZodTypeInternals<RedoActionInput, RedoActionInput>>;
1481
- type: z.ZodType<"REDO", "REDO", z.core.$ZodTypeInternals<"REDO", "REDO">>;
1482
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1483
- }>, z.core.$strip>, z.ZodObject<Required<{
1484
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1485
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1486
- input: z.ZodType<SetNameActionInput, SetNameActionInput, z.core.$ZodTypeInternals<SetNameActionInput, SetNameActionInput>>;
1487
- type: z.ZodType<"SET_NAME", "SET_NAME", z.core.$ZodTypeInternals<"SET_NAME", "SET_NAME">>;
1488
- scope: z.ZodType<"global", "global", z.core.$ZodTypeInternals<"global", "global">>;
1489
- }>, z.core.$strip>, z.ZodObject<Required<{
1490
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1491
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1492
- input: z.ZodType<SetPreferredEditorActionInput, SetPreferredEditorActionInput, z.core.$ZodTypeInternals<SetPreferredEditorActionInput, SetPreferredEditorActionInput>>;
1493
- type: z.ZodType<"SET_PREFERRED_EDITOR", "SET_PREFERRED_EDITOR", z.core.$ZodTypeInternals<"SET_PREFERRED_EDITOR", "SET_PREFERRED_EDITOR">>;
1494
- scope: z.ZodType<"header", "header", z.core.$ZodTypeInternals<"header", "header">>;
1495
- }>, z.core.$strip>, z.ZodObject<Required<{
1496
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1497
- timestampUtcMs: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1498
- input: z.ZodType<UndoActionInput, UndoActionInput, z.core.$ZodTypeInternals<UndoActionInput, UndoActionInput>>;
1499
- type: z.ZodType<"UNDO", "UNDO", z.core.$ZodTypeInternals<"UNDO", "UNDO">>;
1500
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1501
- }>, z.core.$strip>]>;
1502
- declare function RedoActionInputSchema(): z.ZodObject<{
1503
- count: z.ZodNumber;
1504
- }, z.core.$strip>;
1505
- declare function RedoActionSchema(): z.ZodObject<Properties<SchemaRedoAction>>;
1506
- declare function SetNameActionInputSchema(): z.ZodObject<{
1507
- name: z.ZodString;
1508
- }, z.core.$strip>;
1509
- declare function SetNameActionSchema(): z.ZodObject<Properties<SchemaSetNameAction>>;
1510
- declare function SetPreferredEditorActionInputSchema(): z.ZodObject<{
1511
- preferredEditor: z.ZodNullable<z.ZodString>;
1512
- }, z.core.$strip>;
1513
- declare function SetPreferredEditorActionSchema(): z.ZodObject<Properties<SchemaSetPreferredEditorAction>>;
1514
- declare function UndoActionInputSchema(): z.ZodObject<{
1515
- count: z.ZodNumber;
1516
- }, z.core.$strip>;
1517
- declare function UndoActionSchema(): z.ZodObject<Properties<SchemaUndoAction>>;
1518
- type Properties<T> = Required<{ [K in keyof T]: z.ZodType<T[K], T[K]>; }>;
1519
- declare function AddChangeLogItemInputSchema(): z.ZodObject<Properties<AddChangeLogItemInput>>;
1520
- declare function AddModuleInputSchema(): z.ZodObject<Properties<AddModuleInput>>;
1521
- declare function AddOperationErrorInputSchema(): z.ZodObject<Properties<AddOperationErrorInput>>;
1522
- declare function AddOperationExampleInputSchema(): z.ZodObject<Properties<AddOperationExampleInput>>;
1523
- declare function AddOperationInputSchema(): z.ZodObject<Properties<AddOperationInput>>;
1524
- declare function AddStateExampleInputSchema(): z.ZodObject<Properties<AddStateExampleInput>>;
1525
- declare function AuthorSchema(): z.ZodObject<Properties<Author>>;
1526
- declare function CodeExampleSchema(): z.ZodObject<Properties<CodeExample>>;
1527
- declare function DeleteChangeLogItemInputSchema(): z.ZodObject<Properties<DeleteChangeLogItemInput>>;
1528
- declare function DeleteModuleInputSchema(): z.ZodObject<Properties<DeleteModuleInput>>;
1529
- declare function DeleteOperationErrorInputSchema(): z.ZodObject<Properties<DeleteOperationErrorInput>>;
1530
- declare function DeleteOperationExampleInputSchema(): z.ZodObject<Properties<DeleteOperationExampleInput>>;
1531
- declare function DeleteOperationInputSchema(): z.ZodObject<Properties<DeleteOperationInput>>;
1532
- declare function DeleteStateExampleInputSchema(): z.ZodObject<Properties<DeleteStateExampleInput>>;
1533
- declare function DocumentModelInputSchema(): z.ZodUnion<readonly [z.ZodObject<Required<{
1534
- __typename?: z.ZodType<"AddChangeLogItemInput" | undefined, "AddChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"AddChangeLogItemInput" | undefined, "AddChangeLogItemInput" | undefined>> | undefined;
1535
- content: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1536
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1537
- insertBefore: z.ZodType<Maybe<string>, Maybe<string>, z.core.$ZodTypeInternals<Maybe<string>, Maybe<string>>>;
1538
- }>, z.core.$strip>, z.ZodObject<Required<{
1539
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1540
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1541
- name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1542
- }>, z.core.$strip>, z.ZodObject<Required<{
1543
- errorCode?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1544
- errorDescription?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1545
- errorName?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1546
- errorTemplate?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1547
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1548
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1549
- }>, z.core.$strip>, z.ZodObject<Required<{
1550
- example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1551
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1552
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1553
- }>, z.core.$strip>, z.ZodObject<Required<{
1554
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1555
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1556
- moduleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1557
- name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1558
- reducer?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1559
- schema?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1560
- template?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1561
- scope?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1562
- }>, z.core.$strip>, z.ZodObject<Required<{
1563
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1564
- example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1565
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1566
- insertBefore?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1567
- }>, z.core.$strip>, z.ZodObject<Required<{
1568
- __typename?: z.ZodType<"DeleteChangeLogItemInput" | undefined, "DeleteChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"DeleteChangeLogItemInput" | undefined, "DeleteChangeLogItemInput" | undefined>> | undefined;
1569
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1570
- }>, z.core.$strip>, z.ZodObject<Required<{
1571
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1572
- }>, z.core.$strip>, z.ZodObject<Required<{
1573
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1574
- }>, z.core.$strip>, z.ZodObject<Required<{
1575
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1576
- }>, z.core.$strip>, z.ZodObject<Required<{
1577
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1578
- }>, z.core.$strip>, z.ZodObject<Required<{
1579
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1580
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1581
- }>, z.core.$strip>, z.ZodObject<Required<{
1582
- newModuleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1583
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1584
- }>, z.core.$strip>, z.ZodObject<Required<{
1585
- __typename?: z.ZodType<"ReorderChangeLogItemsInput" | undefined, "ReorderChangeLogItemsInput" | undefined, z.core.$ZodTypeInternals<"ReorderChangeLogItemsInput" | undefined, "ReorderChangeLogItemsInput" | undefined>> | undefined;
1586
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1587
- }>, z.core.$strip>, z.ZodObject<Required<{
1588
- moduleId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1589
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1590
- }>, z.core.$strip>, z.ZodObject<Required<{
1591
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1592
- }>, z.core.$strip>, z.ZodObject<Required<{
1593
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1594
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1595
- }>, z.core.$strip>, z.ZodObject<Required<{
1596
- operationId: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1597
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1598
- }>, z.core.$strip>, z.ZodObject<Required<{
1599
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1600
- order: z.ZodType<string[], string[], z.core.$ZodTypeInternals<string[], string[]>>;
1601
- }>, z.core.$strip>, z.ZodObject<Required<{
1602
- authorName: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1603
- }>, z.core.$strip>, z.ZodObject<Required<{
1604
- authorWebsite: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1605
- }>, z.core.$strip>, z.ZodObject<Required<{
1606
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1607
- initialValue: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1608
- }>, z.core.$strip>, z.ZodObject<Required<{
1609
- description: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1610
- }>, z.core.$strip>, z.ZodObject<Required<{
1611
- extension: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1612
- }>, z.core.$strip>, z.ZodObject<Required<{
1613
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1614
- }>, z.core.$strip>, z.ZodObject<Required<{
1615
- name: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1616
- }>, z.core.$strip>, z.ZodObject<Required<{
1617
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1618
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1619
- }>, z.core.$strip>, z.ZodObject<Required<{
1620
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1621
- name?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1622
- }>, z.core.$strip>, z.ZodObject<Required<{
1623
- description?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1624
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1625
- }>, z.core.$strip>, z.ZodObject<Required<{
1626
- errorCode?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1627
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1628
- }>, z.core.$strip>, z.ZodObject<Required<{
1629
- errorDescription?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1630
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1631
- }>, z.core.$strip>, z.ZodObject<Required<{
1632
- errorName?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1633
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1634
- }>, z.core.$strip>, z.ZodObject<Required<{
1635
- errorTemplate?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1636
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1637
- }>, z.core.$strip>, z.ZodObject<Required<{
1638
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1639
- name?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1640
- }>, z.core.$strip>, z.ZodObject<Required<{
1641
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1642
- reducer?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1643
- }>, z.core.$strip>, z.ZodObject<Required<{
1644
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1645
- schema?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1646
- }>, z.core.$strip>, z.ZodObject<Required<{
1647
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1648
- template?: z.ZodType<InputMaybe<string>, InputMaybe<string>, z.core.$ZodTypeInternals<InputMaybe<string>, InputMaybe<string>>> | undefined;
1649
- }>, z.core.$strip>, z.ZodObject<Required<{
1650
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1651
- schema: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1652
- }>, z.core.$strip>, z.ZodObject<Required<{
1653
- __typename?: z.ZodType<"UpdateChangeLogItemInput" | undefined, "UpdateChangeLogItemInput" | undefined, z.core.$ZodTypeInternals<"UpdateChangeLogItemInput" | undefined, "UpdateChangeLogItemInput" | undefined>> | undefined;
1654
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1655
- newContent: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1656
- }>, z.core.$strip>, z.ZodObject<Required<{
1657
- example: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1658
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1659
- }>, z.core.$strip>, z.ZodObject<Required<{
1660
- scope: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1661
- id: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1662
- newExample: z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1663
- }>, z.core.$strip>]>;
1664
- declare function DocumentModelGlobalStateSchema(): z.ZodObject<Properties<DocumentModelGlobalState>>;
1665
- declare function DocumentSpecificationSchema(): z.ZodObject<Properties<DocumentSpecification>>;
1666
- declare function ModuleSchema(): z.ZodObject<Properties<ModuleSpecification>>;
1667
- declare function MoveOperationInputSchema(): z.ZodObject<Properties<MoveOperationInput>>;
1668
- declare function OperationSpecificationSchema(): z.ZodObject<Properties<OperationSpecification>>;
1669
- declare function OperationErrorSchema(): z.ZodObject<Properties<OperationErrorSpecification>>;
1670
- declare function ReorderChangeLogItemsInputSchema(): z.ZodObject<Properties<ReorderChangeLogItemsInput>>;
1671
- declare function ReorderModuleOperationsInputSchema(): z.ZodObject<Properties<ReorderModuleOperationsInput>>;
1672
- declare function ReorderModulesInputSchema(): z.ZodObject<Properties<ReorderModulesInput>>;
1673
- declare function ReorderOperationErrorsInputSchema(): z.ZodObject<Properties<ReorderOperationErrorsInput>>;
1674
- declare function ReorderOperationExamplesInputSchema(): z.ZodObject<Properties<ReorderOperationExamplesInput>>;
1675
- declare function ReorderStateExamplesInputSchema(): z.ZodObject<Properties<ReorderStateExamplesInput>>;
1676
- declare function SetAuthorNameInputSchema(): z.ZodObject<Properties<SetAuthorNameInput>>;
1677
- declare function SetAuthorWebsiteInputSchema(): z.ZodObject<Properties<SetAuthorWebsiteInput>>;
1678
- declare function SetInitialStateInputSchema(): z.ZodObject<Properties<SetInitialStateInput>>;
1679
- declare function SetModelDescriptionInputSchema(): z.ZodObject<Properties<SetModelDescriptionInput>>;
1680
- declare function SetModelExtensionInputSchema(): z.ZodObject<Properties<SetModelExtensionInput>>;
1681
- declare function SetModelIdInputSchema(): z.ZodObject<Properties<SetModelIdInput>>;
1682
- declare function SetModelNameInputSchema(): z.ZodObject<Properties<SetModelNameInput>>;
1683
- declare function SetModuleDescriptionInputSchema(): z.ZodObject<Properties<SetModuleDescriptionInput>>;
1684
- declare function SetModuleNameInputSchema(): z.ZodObject<Properties<SetModuleNameInput>>;
1685
- declare function SetOperationDescriptionInputSchema(): z.ZodObject<Properties<SetOperationDescriptionInput>>;
1686
- declare function SetOperationErrorCodeInputSchema(): z.ZodObject<Properties<SetOperationErrorCodeInput>>;
1687
- declare function SetOperationErrorDescriptionInputSchema(): z.ZodObject<Properties<SetOperationErrorDescriptionInput>>;
1688
- declare function SetOperationErrorNameInputSchema(): z.ZodObject<Properties<SetOperationErrorNameInput>>;
1689
- declare function SetOperationErrorTemplateInputSchema(): z.ZodObject<Properties<SetOperationErrorTemplateInput>>;
1690
- declare function SetOperationNameInputSchema(): z.ZodObject<Properties<SetOperationNameInput>>;
1691
- declare function SetOperationScopeInputSchema(): z.ZodObject<Properties<SetOperationScopeInput>>;
1692
- declare function SetOperationReducerInputSchema(): z.ZodObject<Properties<SetOperationReducerInput>>;
1693
- declare function SetOperationSchemaInputSchema(): z.ZodObject<Properties<SetOperationSchemaInput>>;
1694
- declare function SetOperationTemplateInputSchema(): z.ZodObject<Properties<SetOperationTemplateInput>>;
1695
- declare function SetStateSchemaInputSchema(): z.ZodObject<Properties<SetStateSchemaInput>>;
1696
- declare function StateSchema(): z.ZodObject<Properties<State>>;
1697
- declare function ScopeStateSchema(): z.ZodObject<Properties<ScopeState>>;
1698
- declare function UpdateChangeLogItemInputSchema(): z.ZodObject<Properties<UpdateChangeLogItemInput>>;
1699
- declare function UpdateOperationExampleInputSchema(): z.ZodObject<Properties<UpdateOperationExampleInput>>;
1700
- declare function UpdateStateExampleInputSchema(): z.ZodObject<Properties<UpdateStateExampleInput>>;
1701
- declare const PowerhouseModuleSchema: z.ZodObject<{
1702
- id: z.ZodString;
1703
- name: z.ZodString;
1704
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1705
- }, z.core.$strip>;
1706
- declare const PowerhouseModulesSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
1707
- id: z.ZodString;
1708
- name: z.ZodString;
1709
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1710
- }, z.core.$strip>>>;
1711
- declare const PieceModuleSchema: z.ZodObject<{
1712
- id: z.ZodString;
1713
- name: z.ZodString;
1714
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1715
- version: z.ZodOptional<z.ZodString>;
1716
- description: z.ZodOptional<z.ZodString>;
1717
- bundle: z.ZodOptional<z.ZodString>;
1718
- descriptor: z.ZodOptional<z.ZodString>;
1719
- }, z.core.$strip>;
1720
- declare const PieceModulesSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
1721
- id: z.ZodString;
1722
- name: z.ZodString;
1723
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1724
- version: z.ZodOptional<z.ZodString>;
1725
- description: z.ZodOptional<z.ZodString>;
1726
- bundle: z.ZodOptional<z.ZodString>;
1727
- descriptor: z.ZodOptional<z.ZodString>;
1728
- }, z.core.$strip>>>;
1729
- declare const PublisherSchema: z.ZodObject<{
1730
- name: z.ZodOptional<z.ZodString>;
1731
- url: z.ZodOptional<z.ZodString>;
1732
- }, z.core.$strip>;
1733
- declare const ConfigEntryTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
1734
- declare const ConfigEntrySchema: z.ZodObject<{
1735
- name: z.ZodString;
1736
- type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
1737
- description: z.ZodOptional<z.ZodString>;
1738
- required: z.ZodOptional<z.ZodBoolean>;
1739
- default: z.ZodOptional<z.ZodString>;
1740
- }, z.core.$strip>;
1741
- declare const PwaConfigSchema: z.ZodType<PHConnectPwa>;
1742
- declare const ManifestSchema: z.ZodObject<{
1743
- name: z.ZodString;
1744
- description: z.ZodOptional<z.ZodString>;
1745
- category: z.ZodOptional<z.ZodString>;
1746
- image: z.ZodOptional<z.ZodString>;
1747
- publisher: z.ZodOptional<z.ZodObject<{
1748
- name: z.ZodOptional<z.ZodString>;
1749
- url: z.ZodOptional<z.ZodString>;
1750
- }, z.core.$strip>>;
1751
- documentModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
1752
- id: z.ZodString;
1753
- name: z.ZodString;
1754
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1755
- }, z.core.$strip>>>;
1756
- apps: z.ZodOptional<z.ZodArray<z.ZodObject<{
1757
- id: z.ZodString;
1758
- name: z.ZodString;
1759
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1760
- }, z.core.$strip>>>;
1761
- editors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1762
- id: z.ZodString;
1763
- name: z.ZodString;
1764
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1765
- }, z.core.$strip>>>;
1766
- processors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1767
- id: z.ZodString;
1768
- name: z.ZodString;
1769
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1770
- }, z.core.$strip>>>;
1771
- subgraphs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1772
- id: z.ZodString;
1773
- name: z.ZodString;
1774
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1775
- }, z.core.$strip>>>;
1776
- pieces: z.ZodOptional<z.ZodArray<z.ZodObject<{
1777
- id: z.ZodString;
1778
- name: z.ZodString;
1779
- documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1780
- version: z.ZodOptional<z.ZodString>;
1781
- description: z.ZodOptional<z.ZodString>;
1782
- bundle: z.ZodOptional<z.ZodString>;
1783
- descriptor: z.ZodOptional<z.ZodString>;
1784
- }, z.core.$strip>>>;
1785
- config: z.ZodOptional<z.ZodArray<z.ZodObject<{
1786
- name: z.ZodString;
1787
- type: z.ZodUnion<readonly [z.ZodLiteral<"var">, z.ZodLiteral<"secret">]>;
1788
- description: z.ZodOptional<z.ZodString>;
1789
- required: z.ZodOptional<z.ZodBoolean>;
1790
- default: z.ZodOptional<z.ZodString>;
1791
- }, z.core.$strip>>>;
1792
- pwa: z.ZodOptional<z.ZodType<PHConnectPwa, unknown, z.core.$ZodTypeInternals<PHConnectPwa, unknown>>>;
1793
- }, z.core.$strip>;
1794
- //#endregion
1795
- //#region document-model/upgrades.d.ts
1796
- /** Upgrade reducer transforms a document from one version to another */
1797
- type UpgradeReducer<TFrom extends PHBaseState, TTo extends PHBaseState> = (document: PHDocument<TFrom>, action: Action) => PHDocument<TTo>;
1798
- type ModelVersion = number;
1799
- /** Metadata about a version transition */
1800
- type UpgradeTransition = {
1801
- toVersion: ModelVersion;
1802
- upgradeReducer: UpgradeReducer<any, any>;
1803
- description?: string;
1804
- };
1805
- type TupleMember<T extends readonly unknown[]> = T[number];
1806
- /** Manifest declaring all supported versions and upgrade paths */
1807
- type UpgradeManifest<TVersions extends readonly number[]> = {
1808
- documentType: string;
1809
- latestVersion: TupleMember<TVersions>;
1810
- supportedVersions: TVersions;
1811
- upgrades: { [V in Exclude<TupleMember<TVersions>, 1> as `v${V}`]: UpgradeTransition; };
1812
- };
1813
- /**
1814
- * Canonical document-model version normalization: documents stamped with 0
1815
- * or nothing at all predate versioning and are treated as version 1, the
1816
- * same version the registry assigns unversioned modules. Every consumer
1817
- * that resolves a module or compares versions must use this rule; resolving
1818
- * 0 to "latest" instead re-pins a legacy document's history to whichever
1819
- * module happens to be newest.
1820
- */
1821
- declare function normalizeDocumentModelVersion(version: number | undefined | null): number;
1822
- /**
1823
- * Applies an UPGRADE_DOCUMENT action to a document.
1824
- * Handles all upgrade scenarios including initial upgrades, no-ops, and multi-step upgrades.
1825
- *
1826
- * Behavior based on fromVersion/toVersion:
1827
- * - fromVersion === toVersion (and fromVersion > 0): No-op - return unchanged document
1828
- * - fromVersion > toVersion: Throw DowngradeNotSupportedError
1829
- * - All other cases: Apply upgradePath transitions (if provided), then apply initialState, set version
1830
- */
1831
- declare function applyUpgradeDocumentAction(document: PHDocument, action: UpgradeDocumentAction, upgradePath?: UpgradeTransition[]): PHDocument;
1832
- /** CREATE_DOCUMENT fixes `protocolVersions`; this puts them back after a reducer. */
1833
- declare function withProtocolVersions<TDocument extends PHDocument>(document: TDocument, protocolVersions: PHDocument["header"]["protocolVersions"]): TDocument;
1834
- /**
1835
- * Applies a DELETE_DOCUMENT action to a document.
1836
- * Marks the document as deleted in the document scope state.
1837
- */
1838
- declare function applyDeleteDocumentAction(document: PHDocument, action: DeleteDocumentAction): PHDocument;
1839
- /**
1840
- * Computes the ordered list of upgrade transitions needed to move from
1841
- * fromVersion to toVersion using the provided manifest.
1842
- * Walks keys v(fromVersion+1)..v(toVersion) and throws a descriptive Error
1843
- * if the manifest is absent or any step is missing.
1844
- */
1845
- declare function computeUpgradeTransitions(manifest: UpgradeManifest<readonly number[]> | undefined, fromVersion: number, toVersion: number): UpgradeTransition[];
1846
- //#endregion
1847
- //#region document-model/types.d.ts
1848
- type State = {
1849
- examples: CodeExample[];
1850
- initialValue: string;
1851
- schema: string;
1852
- };
1853
- type ScopeState = {
1854
- global: State;
1855
- local: State;
1856
- };
1857
- type Author = {
1858
- name: string;
1859
- website: string | null;
1860
- };
1861
- type OperationErrorSpecification = {
1862
- code: string | null;
1863
- description: string | null;
1864
- id: ID;
1865
- name: string | null;
1866
- template: string | null;
1867
- };
1868
- type CodeExample = {
1869
- id: ID;
1870
- value: string;
1871
- };
1872
- type OperationSpecification = {
1873
- description: string | null;
1874
- errors: OperationErrorSpecification[];
1875
- examples: CodeExample[];
1876
- id: ID;
1877
- name: string | null;
1878
- reducer: string | null;
1879
- schema: string | null;
1880
- template: string | null;
1881
- scope: string;
1882
- };
1883
- type ModuleSpecification = {
1884
- description: string | null;
1885
- id: ID;
1886
- name: string;
1887
- operations: OperationSpecification[];
1888
- };
1889
- type DocumentSpecification = {
1890
- changeLog: string[];
1891
- modules: ModuleSpecification[];
1892
- state: ScopeState;
1893
- version: number;
1894
- };
1895
- type DocumentModelGlobalState = {
1896
- author: Author;
1897
- description: string;
1898
- extension: string;
1899
- id: string;
1900
- name: string;
1901
- specifications: DocumentSpecification[];
1902
- };
1903
- type DocumentModelLocalState = {};
1904
- type DocumentModelPHState = PHBaseState & {
1905
- global: DocumentModelGlobalState;
1906
- local: DocumentModelLocalState;
1907
- };
1908
- type DocumentModelDocument = PHDocument<DocumentModelPHState>;
1909
- type DocumentModelAction = DocumentModelHeaderAction | DocumentModelVersioningAction | DocumentModelModuleAction | DocumentModelOperationErrorAction | DocumentModelOperationExampleAction | DocumentModelOperationAction | DocumentModelStateAction;
1910
- type AddChangeLogItemInput = {
1911
- __typename?: "AddChangeLogItemInput";
1912
- content: Scalars["String"]["output"];
1913
- id: Scalars["ID"]["output"];
1914
- insertBefore: Maybe<Scalars["ID"]["output"]>;
1915
- };
1916
- type AddModuleInput = {
1917
- description?: InputMaybe<Scalars["String"]["input"]>;
1918
- id: Scalars["ID"]["input"];
1919
- name: Scalars["String"]["input"];
1920
- };
1921
- type AddOperationErrorInput = {
1922
- errorCode?: InputMaybe<Scalars["String"]["input"]>;
1923
- errorDescription?: InputMaybe<Scalars["String"]["input"]>;
1924
- errorName?: InputMaybe<Scalars["String"]["input"]>;
1925
- errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
1926
- id: Scalars["ID"]["input"];
1927
- operationId: Scalars["ID"]["input"];
1928
- };
1929
- type AddOperationExampleInput = {
1930
- example: Scalars["String"]["input"];
1931
- id: Scalars["ID"]["input"];
1932
- operationId: Scalars["ID"]["input"];
1933
- };
1934
- type AddOperationInput = {
1935
- description?: InputMaybe<Scalars["String"]["input"]>;
1936
- id: Scalars["ID"]["input"];
1937
- moduleId: Scalars["ID"]["input"];
1938
- name: Scalars["String"]["input"];
1939
- reducer?: InputMaybe<Scalars["String"]["input"]>;
1940
- schema?: InputMaybe<Scalars["String"]["input"]>;
1941
- template?: InputMaybe<Scalars["String"]["input"]>;
1942
- scope?: InputMaybe<string>;
1943
- };
1944
- type AddStateExampleInput = {
1945
- scope: Scalars["String"]["input"];
1946
- example: Scalars["String"]["input"];
1947
- id: Scalars["ID"]["input"];
1948
- insertBefore?: InputMaybe<Scalars["ID"]["input"]>;
1949
- };
1950
- type DeleteChangeLogItemInput = {
1951
- __typename?: "DeleteChangeLogItemInput";
1952
- id: Scalars["ID"]["output"];
1953
- };
1954
- type DeleteModuleInput = {
1955
- id: Scalars["ID"]["input"];
1956
- };
1957
- type DeleteOperationErrorInput = {
1958
- id: Scalars["ID"]["input"];
1959
- };
1960
- type DeleteOperationExampleInput = {
1961
- id: Scalars["ID"]["input"];
1962
- };
1963
- type DeleteOperationInput = {
1964
- id: Scalars["ID"]["input"];
1965
- };
1966
- type DeleteStateExampleInput = {
1967
- scope: Scalars["String"]["input"];
1968
- id: Scalars["ID"]["input"];
1969
- };
1970
- type DocumentModelInput = AddChangeLogItemInput | AddModuleInput | AddOperationErrorInput | AddOperationExampleInput | AddOperationInput | AddStateExampleInput | DeleteChangeLogItemInput | DeleteModuleInput | DeleteOperationErrorInput | DeleteOperationExampleInput | DeleteOperationInput | DeleteStateExampleInput | MoveOperationInput | ReorderChangeLogItemsInput | ReorderModuleOperationsInput | ReorderModulesInput | ReorderOperationErrorsInput | ReorderOperationExamplesInput | ReorderStateExamplesInput | SetAuthorNameInput | SetAuthorWebsiteInput | SetInitialStateInput | SetModelDescriptionInput | SetModelExtensionInput | SetModelIdInput | SetModelNameInput | SetModuleDescriptionInput | SetModuleNameInput | SetOperationDescriptionInput | SetOperationErrorCodeInput | SetOperationErrorDescriptionInput | SetOperationErrorNameInput | SetOperationErrorTemplateInput | SetOperationNameInput | SetOperationReducerInput | SetOperationSchemaInput | SetOperationTemplateInput | SetStateSchemaInput | UpdateChangeLogItemInput | UpdateOperationExampleInput | UpdateStateExampleInput;
1971
- type MoveOperationInput = {
1972
- newModuleId: Scalars["ID"]["input"];
1973
- operationId: Scalars["ID"]["input"];
1974
- };
1975
- type Mutation = {
1976
- __typename?: "Mutation";
1977
- addChangeLogItemInput: DocumentModelGlobalState;
1978
- addModule: DocumentModelGlobalState;
1979
- addOperation: DocumentModelGlobalState;
1980
- addOperationError: DocumentModelGlobalState;
1981
- addOperationExample: DocumentModelGlobalState;
1982
- addStateExample: DocumentModelGlobalState;
1983
- deleteChangeLogItemInput: DocumentModelGlobalState;
1984
- deleteModule: DocumentModelGlobalState;
1985
- deleteOperation: DocumentModelGlobalState;
1986
- deleteOperationError: DocumentModelGlobalState;
1987
- deleteOperationExample: DocumentModelGlobalState;
1988
- deleteStateExample: DocumentModelGlobalState;
1989
- moveOperation: DocumentModelGlobalState;
1990
- releaseNewVersion: DocumentModelGlobalState;
1991
- reorderChangeLogItemsInput: DocumentModelGlobalState;
1992
- reorderModuleOperations: DocumentModelGlobalState;
1993
- reorderModules: DocumentModelGlobalState;
1994
- reorderOperationErrors: DocumentModelGlobalState;
1995
- reorderOperationExamples: DocumentModelGlobalState;
1996
- reorderStateExamples: DocumentModelGlobalState;
1997
- setAuthorName: DocumentModelGlobalState;
1998
- setAuthorWebsite: DocumentModelGlobalState;
1999
- setInitialState: DocumentModelGlobalState;
2000
- setModelDescription: DocumentModelGlobalState;
2001
- setModelExtension: DocumentModelGlobalState;
2002
- setModelId: DocumentModelGlobalState;
2003
- setModelName: DocumentModelGlobalState;
2004
- setModuleDescription: DocumentModelGlobalState;
2005
- setModuleName: DocumentModelGlobalState;
2006
- setOperationDescription: DocumentModelGlobalState;
2007
- setOperationErrorCode: DocumentModelGlobalState;
2008
- setOperationErrorDescription: DocumentModelGlobalState;
2009
- setOperationErrorName: DocumentModelGlobalState;
2010
- setOperationErrorTemplate: DocumentModelGlobalState;
2011
- setOperationName: DocumentModelGlobalState;
2012
- setOperationReducer: DocumentModelGlobalState;
2013
- setOperationSchema: DocumentModelGlobalState;
2014
- setOperationTemplate: DocumentModelGlobalState;
2015
- setStateSchema: DocumentModelGlobalState;
2016
- updateChangeLogItemInput: DocumentModelGlobalState;
2017
- updateOperationExample: DocumentModelGlobalState;
2018
- updateStateExample: DocumentModelGlobalState;
2019
- };
2020
- type MutationAddChangeLogItemInputArgs = {
2021
- input?: InputMaybe<AddChangeLogItemInput>;
2022
- };
2023
- type MutationAddModuleArgs = {
2024
- input: AddModuleInput;
2025
- };
2026
- type MutationAddOperationArgs = {
2027
- input: AddOperationInput;
2028
- };
2029
- type MutationAddOperationErrorArgs = {
2030
- input: AddOperationErrorInput;
2031
- };
2032
- type MutationAddOperationExampleArgs = {
2033
- input: AddOperationExampleInput;
2034
- };
2035
- type MutationAddStateExampleArgs = {
2036
- input: AddStateExampleInput;
2037
- };
2038
- type MutationDeleteChangeLogItemInputArgs = {
2039
- input?: InputMaybe<DeleteChangeLogItemInput>;
2040
- };
2041
- type MutationDeleteModuleArgs = {
2042
- input: DeleteModuleInput;
2043
- };
2044
- type MutationDeleteOperationArgs = {
2045
- input: DeleteOperationInput;
2046
- };
2047
- type MutationDeleteOperationErrorArgs = {
2048
- input: DeleteOperationErrorInput;
2049
- };
2050
- type MutationDeleteOperationExampleArgs = {
2051
- input: DeleteOperationExampleInput;
2052
- };
2053
- type MutationDeleteStateExampleArgs = {
2054
- input: DeleteStateExampleInput;
2055
- };
2056
- type MutationMoveOperationArgs = {
2057
- input: MoveOperationInput;
2058
- };
2059
- type MutationReorderChangeLogItemsInputArgs = {
2060
- input?: InputMaybe<ReorderChangeLogItemsInput>;
2061
- };
2062
- type MutationReorderModuleOperationsArgs = {
2063
- input: ReorderModuleOperationsInput;
2064
- };
2065
- type MutationReorderModulesArgs = {
2066
- input: ReorderModulesInput;
2067
- };
2068
- type MutationReorderOperationErrorsArgs = {
2069
- input: ReorderOperationErrorsInput;
2070
- };
2071
- type MutationReorderOperationExamplesArgs = {
2072
- input: ReorderOperationExamplesInput;
2073
- };
2074
- type MutationReorderStateExamplesArgs = {
2075
- input: ReorderStateExamplesInput;
2076
- };
2077
- type MutationSetAuthorNameArgs = {
2078
- input: SetAuthorNameInput;
2079
- };
2080
- type MutationSetAuthorWebsiteArgs = {
2081
- input: SetAuthorWebsiteInput;
2082
- };
2083
- type MutationSetInitialStateArgs = {
2084
- input: SetInitialStateInput;
2085
- };
2086
- type MutationSetModelDescriptionArgs = {
2087
- input: SetModelDescriptionInput;
2088
- };
2089
- type MutationSetModelExtensionArgs = {
2090
- input: SetModelExtensionInput;
2091
- };
2092
- type MutationSetModelIdArgs = {
2093
- input: SetModelIdInput;
2094
- };
2095
- type MutationSetModelNameArgs = {
2096
- input: SetModelNameInput;
2097
- };
2098
- type MutationSetModuleDescriptionArgs = {
2099
- input: SetModuleDescriptionInput;
2100
- };
2101
- type MutationSetModuleNameArgs = {
2102
- input: SetModuleNameInput;
2103
- };
2104
- type MutationSetOperationDescriptionArgs = {
2105
- input: SetOperationDescriptionInput;
2106
- };
2107
- type MutationSetOperationErrorCodeArgs = {
2108
- input: SetOperationErrorCodeInput;
2109
- };
2110
- type MutationSetOperationErrorDescriptionArgs = {
2111
- input: SetOperationErrorDescriptionInput;
2112
- };
2113
- type MutationSetOperationErrorNameArgs = {
2114
- input: SetOperationErrorNameInput;
2115
- };
2116
- type MutationSetOperationErrorTemplateArgs = {
2117
- input: SetOperationErrorTemplateInput;
2118
- };
2119
- type MutationSetOperationNameArgs = {
2120
- input: SetOperationNameInput;
2121
- };
2122
- type MutationSetOperationReducerArgs = {
2123
- input: SetOperationReducerInput;
2124
- };
2125
- type MutationSetOperationSchemaArgs = {
2126
- input: SetOperationSchemaInput;
2127
- };
2128
- type MutationSetOperationTemplateArgs = {
2129
- input: SetOperationTemplateInput;
2130
- };
2131
- type MutationSetStateSchemaArgs = {
2132
- input: SetStateSchemaInput;
2133
- };
2134
- type MutationUpdateChangeLogItemInputArgs = {
2135
- input?: InputMaybe<UpdateChangeLogItemInput>;
2136
- };
2137
- type MutationUpdateOperationExampleArgs = {
2138
- input: UpdateOperationExampleInput;
2139
- };
2140
- type MutationUpdateStateExampleArgs = {
2141
- input: UpdateStateExampleInput;
2142
- };
2143
- type ReorderChangeLogItemsInput = {
2144
- __typename?: "ReorderChangeLogItemsInput";
2145
- order: Array<Scalars["ID"]["output"]>;
2146
- };
2147
- type ReorderModuleOperationsInput = {
2148
- moduleId: Scalars["ID"]["input"];
2149
- order: Array<Scalars["ID"]["input"]>;
2150
- };
2151
- type ReorderModulesInput = {
2152
- order: Array<Scalars["ID"]["input"]>;
2153
- };
2154
- type ReorderOperationErrorsInput = {
2155
- operationId: Scalars["ID"]["input"];
2156
- order: Array<Scalars["ID"]["input"]>;
2157
- };
2158
- type ReorderOperationExamplesInput = {
2159
- operationId: Scalars["ID"]["input"];
2160
- order: Array<Scalars["ID"]["input"]>;
2161
- };
2162
- type ReorderStateExamplesInput = {
2163
- scope: Scalars["String"]["input"];
2164
- order: Array<Scalars["ID"]["input"]>;
2165
- };
2166
- type SetAuthorNameInput = {
2167
- authorName: Scalars["String"]["input"];
2168
- };
2169
- type SetAuthorWebsiteInput = {
2170
- authorWebsite: Scalars["String"]["input"];
2171
- };
2172
- type SetInitialStateInput = {
2173
- scope: Scalars["String"]["input"];
2174
- initialValue: Scalars["String"]["input"];
2175
- };
2176
- type SetModelDescriptionInput = {
2177
- description: Scalars["String"]["input"];
2178
- };
2179
- type SetModelExtensionInput = {
2180
- extension: Scalars["String"]["input"];
2181
- };
2182
- type SetModelIdInput = {
2183
- id: Scalars["String"]["input"];
2184
- };
2185
- type SetModelNameInput = {
2186
- name: Scalars["String"]["input"];
2187
- };
2188
- type SetModuleDescriptionInput = {
2189
- description?: InputMaybe<Scalars["String"]["input"]>;
2190
- id: Scalars["ID"]["input"];
2191
- };
2192
- type SetModuleNameInput = {
2193
- id: Scalars["ID"]["input"];
2194
- name?: InputMaybe<Scalars["String"]["input"]>;
2195
- };
2196
- type SetOperationDescriptionInput = {
2197
- description?: InputMaybe<Scalars["String"]["input"]>;
2198
- id: Scalars["ID"]["input"];
2199
- };
2200
- type SetOperationErrorCodeInput = {
2201
- errorCode?: InputMaybe<Scalars["String"]["input"]>;
2202
- id: Scalars["ID"]["input"];
2203
- };
2204
- type SetOperationErrorDescriptionInput = {
2205
- errorDescription?: InputMaybe<Scalars["String"]["input"]>;
2206
- id: Scalars["ID"]["input"];
2207
- };
2208
- type SetOperationErrorNameInput = {
2209
- errorName?: InputMaybe<Scalars["String"]["input"]>;
2210
- id: Scalars["ID"]["input"];
2211
- };
2212
- type SetOperationErrorTemplateInput = {
2213
- errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
2214
- id: Scalars["ID"]["input"];
2215
- };
2216
- type SetOperationNameInput = {
2217
- id: Scalars["ID"]["input"];
2218
- name?: InputMaybe<Scalars["String"]["input"]>;
2219
- };
2220
- type SetOperationScopeInput = {
2221
- id: Scalars["ID"]["input"];
2222
- scope?: InputMaybe<string>;
2223
- };
2224
- type SetOperationReducerInput = {
2225
- id: Scalars["ID"]["input"];
2226
- reducer?: InputMaybe<Scalars["String"]["input"]>;
2227
- };
2228
- type SetOperationSchemaInput = {
2229
- id: Scalars["ID"]["input"];
2230
- schema?: InputMaybe<Scalars["String"]["input"]>;
2231
- };
2232
- type SetOperationTemplateInput = {
2233
- id: Scalars["ID"]["input"];
2234
- template?: InputMaybe<Scalars["String"]["input"]>;
2235
- };
2236
- type SetStateSchemaInput = {
2237
- scope: Scalars["String"]["input"];
2238
- schema: Scalars["String"]["input"];
2239
- };
2240
- type UpdateChangeLogItemInput = {
2241
- __typename?: "UpdateChangeLogItemInput";
2242
- id: Scalars["ID"]["output"];
2243
- newContent: Scalars["String"]["output"];
2244
- };
2245
- type UpdateOperationExampleInput = {
2246
- example: Scalars["String"]["input"];
2247
- id: Scalars["ID"]["input"];
2248
- };
2249
- type UpdateStateExampleInput = {
2250
- scope: Scalars["String"]["input"];
2251
- id: Scalars["ID"]["input"];
2252
- newExample: Scalars["String"]["input"];
2253
- };
2254
- type SetModelNameAction = Action & {
2255
- type: "SET_MODEL_NAME";
2256
- input: SetModelNameInput;
2257
- };
2258
- type SetModelIdAction = Action & {
2259
- type: "SET_MODEL_ID";
2260
- input: SetModelIdInput;
2261
- };
2262
- type SetModelExtensionAction = Action & {
2263
- type: "SET_MODEL_EXTENSION";
2264
- input: SetModelExtensionInput;
2265
- };
2266
- type SetModelDescriptionAction = Action & {
2267
- type: "SET_MODEL_DESCRIPTION";
2268
- input: SetModelDescriptionInput;
2269
- };
2270
- type SetAuthorNameAction = Action & {
2271
- type: "SET_AUTHOR_NAME";
2272
- input: SetAuthorNameInput;
2273
- };
2274
- type SetAuthorWebsiteAction = Action & {
2275
- type: "SET_AUTHOR_WEBSITE";
2276
- input: SetAuthorWebsiteInput;
2277
- };
2278
- type DocumentModelHeaderAction = SetModelNameAction | SetModelIdAction | SetModelExtensionAction | SetModelDescriptionAction | SetAuthorNameAction | SetAuthorWebsiteAction;
2279
- type AddModuleAction = Action & {
2280
- type: "ADD_MODULE";
2281
- input: AddModuleInput;
2282
- };
2283
- type SetModuleNameAction = Action & {
2284
- type: "SET_MODULE_NAME";
2285
- input: SetModuleNameInput;
2286
- };
2287
- type SetModuleDescriptionAction = Action & {
2288
- type: "SET_MODULE_DESCRIPTION";
2289
- input: SetModuleDescriptionInput;
2290
- };
2291
- type DeleteModuleAction = Action & {
2292
- type: "DELETE_MODULE";
2293
- input: DeleteModuleInput;
2294
- };
2295
- type ReorderModulesAction = Action & {
2296
- type: "REORDER_MODULES";
2297
- input: ReorderModulesInput;
2298
- };
2299
- type DocumentModelModuleAction = AddModuleAction | SetModuleNameAction | SetModuleDescriptionAction | DeleteModuleAction | ReorderModulesAction;
2300
- type AddOperationAction = Action & {
2301
- type: "ADD_OPERATION";
2302
- input: AddOperationInput;
2303
- };
2304
- type SetOperationNameAction = Action & {
2305
- type: "SET_OPERATION_NAME";
2306
- input: SetOperationNameInput;
2307
- };
2308
- type SetOperationScopeAction = Action & {
2309
- type: "SET_OPERATION_SCOPE";
2310
- input: SetOperationScopeInput;
2311
- };
2312
- type SetOperationSchemaAction = Action & {
2313
- type: "SET_OPERATION_SCHEMA";
2314
- input: SetOperationSchemaInput;
2315
- };
2316
- type SetOperationDescriptionAction = Action & {
2317
- type: "SET_OPERATION_DESCRIPTION";
2318
- input: SetOperationDescriptionInput;
2319
- };
2320
- type SetOperationTemplateAction = Action & {
2321
- type: "SET_OPERATION_TEMPLATE";
2322
- input: SetOperationTemplateInput;
2323
- };
2324
- type SetOperationReducerAction = Action & {
2325
- type: "SET_OPERATION_REDUCER";
2326
- input: SetOperationReducerInput;
2327
- };
2328
- type MoveOperationAction = Action & {
2329
- type: "MOVE_OPERATION";
2330
- input: MoveOperationInput;
2331
- };
2332
- type DeleteOperationAction = Action & {
2333
- type: "DELETE_OPERATION";
2334
- input: DeleteOperationInput;
2335
- };
2336
- type ReorderModuleOperationsAction = Action & {
2337
- type: "REORDER_MODULE_OPERATIONS";
2338
- input: ReorderModuleOperationsInput;
2339
- };
2340
- type DocumentModelOperationAction = AddOperationAction | SetOperationNameAction | SetOperationScopeAction | SetOperationSchemaAction | SetOperationDescriptionAction | SetOperationTemplateAction | SetOperationReducerAction | MoveOperationAction | DeleteOperationAction | ReorderModuleOperationsAction;
2341
- type AddOperationErrorAction = Action & {
2342
- type: "ADD_OPERATION_ERROR";
2343
- input: AddOperationErrorInput;
2344
- };
2345
- type SetOperationErrorCodeAction = Action & {
2346
- type: "SET_OPERATION_ERROR_CODE";
2347
- input: SetOperationErrorCodeInput;
2348
- };
2349
- type SetOperationErrorNameAction = Action & {
2350
- type: "SET_OPERATION_ERROR_NAME";
2351
- input: SetOperationErrorNameInput;
2352
- };
2353
- type SetOperationErrorDescriptionAction = Action & {
2354
- type: "SET_OPERATION_ERROR_DESCRIPTION";
2355
- input: SetOperationErrorDescriptionInput;
2356
- };
2357
- type SetOperationErrorTemplateAction = Action & {
2358
- type: "SET_OPERATION_ERROR_TEMPLATE";
2359
- input: SetOperationErrorTemplateInput;
2360
- };
2361
- type DeleteOperationErrorAction = Action & {
2362
- type: "DELETE_OPERATION_ERROR";
2363
- input: DeleteOperationErrorInput;
2364
- };
2365
- type ReorderOperationErrorsAction = Action & {
2366
- type: "REORDER_OPERATION_ERRORS";
2367
- input: ReorderOperationErrorsInput;
2368
- };
2369
- type DocumentModelOperationErrorAction = AddOperationErrorAction | SetOperationErrorCodeAction | SetOperationErrorNameAction | SetOperationErrorDescriptionAction | SetOperationErrorTemplateAction | DeleteOperationErrorAction | ReorderOperationErrorsAction;
2370
- type AddOperationExampleAction = Action & {
2371
- type: "ADD_OPERATION_EXAMPLE";
2372
- input: AddOperationExampleInput;
2373
- };
2374
- type UpdateOperationExampleAction = Action & {
2375
- type: "UPDATE_OPERATION_EXAMPLE";
2376
- input: UpdateOperationExampleInput;
2377
- };
2378
- type DeleteOperationExampleAction = Action & {
2379
- type: "DELETE_OPERATION_EXAMPLE";
2380
- input: DeleteOperationExampleInput;
2381
- };
2382
- type ReorderOperationExamplesAction = Action & {
2383
- type: "REORDER_OPERATION_EXAMPLES";
2384
- input: ReorderOperationExamplesInput;
2385
- };
2386
- type DocumentModelOperationExampleAction = AddOperationExampleAction | UpdateOperationExampleAction | DeleteOperationExampleAction | ReorderOperationExamplesAction;
2387
- type SetStateSchemaAction = Action & {
2388
- type: "SET_STATE_SCHEMA";
2389
- input: SetStateSchemaInput;
2390
- };
2391
- type SetInitialStateAction = Action & {
2392
- type: "SET_INITIAL_STATE";
2393
- input: SetInitialStateInput;
2394
- };
2395
- type AddStateExampleAction = Action & {
2396
- type: "ADD_STATE_EXAMPLE";
2397
- input: AddStateExampleInput;
2398
- };
2399
- type UpdateStateExampleAction = Action & {
2400
- type: "UPDATE_STATE_EXAMPLE";
2401
- input: UpdateStateExampleInput;
2402
- };
2403
- type DeleteStateExampleAction = Action & {
2404
- type: "DELETE_STATE_EXAMPLE";
2405
- input: DeleteStateExampleInput;
2406
- };
2407
- type ReorderStateExamplesAction = Action & {
2408
- type: "REORDER_STATE_EXAMPLES";
2409
- input: ReorderStateExamplesInput;
2410
- };
2411
- type DocumentModelStateAction = SetStateSchemaAction | SetInitialStateAction | AddStateExampleAction | UpdateStateExampleAction | DeleteStateExampleAction | ReorderStateExamplesAction;
2412
- type AddChangeLogItemAction = Action & {
2413
- type: "ADD_CHANGE_LOG_ITEM";
2414
- input: AddChangeLogItemInput;
2415
- };
2416
- type UpdateChangeLogItemAction = Action & {
2417
- type: "UPDATE_CHANGE_LOG_ITEM";
2418
- input: UpdateChangeLogItemInput;
2419
- };
2420
- type DeleteChangeLogItemAction = Action & {
2421
- type: "DELETE_CHANGE_LOG_ITEM";
2422
- input: DeleteChangeLogItemInput;
2423
- };
2424
- type ReorderChangeLogItemsAction = Action & {
2425
- type: "REORDER_CHANGE_LOG_ITEMS";
2426
- input: ReorderChangeLogItemsInput;
2427
- };
2428
- type ReleaseNewVersionAction = Action & {
2429
- type: "RELEASE_NEW_VERSION";
2430
- input: {};
2431
- };
2432
- type DocumentModelVersioningAction = AddChangeLogItemAction | UpdateChangeLogItemAction | DeleteChangeLogItemAction | ReorderChangeLogItemsAction | ReleaseNewVersionAction;
2433
- interface DocumentModelHeaderOperations {
2434
- setModelNameOperation: (state: DocumentModelGlobalState, action: SetModelNameAction) => void;
2435
- setModelIdOperation: (state: DocumentModelGlobalState, action: SetModelIdAction) => void;
2436
- setModelExtensionOperation: (state: DocumentModelGlobalState, action: SetModelExtensionAction) => void;
2437
- setModelDescriptionOperation: (state: DocumentModelGlobalState, action: SetModelDescriptionAction) => void;
2438
- setAuthorNameOperation: (state: DocumentModelGlobalState, action: SetAuthorNameAction) => void;
2439
- setAuthorWebsiteOperation: (state: DocumentModelGlobalState, action: SetAuthorWebsiteAction) => void;
2440
- }
2441
- interface DocumentModelModuleOperations {
2442
- addModuleOperation: (state: DocumentModelGlobalState, action: AddModuleAction) => void;
2443
- setModuleNameOperation: (state: DocumentModelGlobalState, action: SetModuleNameAction) => void;
2444
- setModuleDescriptionOperation: (state: DocumentModelGlobalState, action: SetModuleDescriptionAction) => void;
2445
- deleteModuleOperation: (state: DocumentModelGlobalState, action: DeleteModuleAction) => void;
2446
- reorderModulesOperation: (state: DocumentModelGlobalState, action: ReorderModulesAction) => void;
2447
- }
2448
- type DocumentModelOperationOperations = {
2449
- addOperationOperation: (state: DocumentModelGlobalState, action: AddOperationAction) => void;
2450
- setOperationNameOperation: (state: DocumentModelGlobalState, action: SetOperationNameAction) => void;
2451
- setOperationScopeOperation: (state: DocumentModelGlobalState, action: SetOperationScopeAction) => void;
2452
- setOperationSchemaOperation: (state: DocumentModelGlobalState, action: SetOperationSchemaAction) => void;
2453
- setOperationDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationDescriptionAction) => void;
2454
- setOperationTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationTemplateAction) => void;
2455
- setOperationReducerOperation: (state: DocumentModelGlobalState, action: SetOperationReducerAction) => void;
2456
- moveOperationOperation: (state: DocumentModelGlobalState, action: MoveOperationAction) => void;
2457
- deleteOperationOperation: (state: DocumentModelGlobalState, action: DeleteOperationAction) => void;
2458
- reorderModuleOperationsOperation: (state: DocumentModelGlobalState, action: ReorderModuleOperationsAction) => void;
2459
- };
2460
- interface DocumentModelOperationErrorOperations {
2461
- addOperationErrorOperation: (state: DocumentModelGlobalState, action: AddOperationErrorAction) => void;
2462
- setOperationErrorCodeOperation: (state: DocumentModelGlobalState, action: SetOperationErrorCodeAction) => void;
2463
- setOperationErrorNameOperation: (state: DocumentModelGlobalState, action: SetOperationErrorNameAction) => void;
2464
- setOperationErrorDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationErrorDescriptionAction) => void;
2465
- setOperationErrorTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationErrorTemplateAction) => void;
2466
- deleteOperationErrorOperation: (state: DocumentModelGlobalState, action: DeleteOperationErrorAction) => void;
2467
- reorderOperationErrorsOperation: (state: DocumentModelGlobalState, action: ReorderOperationErrorsAction) => void;
2468
- }
2469
- interface DocumentModelOperationExampleOperations {
2470
- addOperationExampleOperation: (state: DocumentModelGlobalState, action: AddOperationExampleAction) => void;
2471
- updateOperationExampleOperation: (state: DocumentModelGlobalState, action: UpdateOperationExampleAction) => void;
2472
- deleteOperationExampleOperation: (state: DocumentModelGlobalState, action: DeleteOperationExampleAction) => void;
2473
- reorderOperationExamplesOperation: (state: DocumentModelGlobalState, action: ReorderOperationExamplesAction) => void;
2474
- }
2475
- interface DocumentModelStateOperations {
2476
- setStateSchemaOperation: (state: DocumentModelGlobalState, action: SetStateSchemaAction) => void;
2477
- setInitialStateOperation: (state: DocumentModelGlobalState, action: SetInitialStateAction) => void;
2478
- addStateExampleOperation: (state: DocumentModelGlobalState, action: AddStateExampleAction) => void;
2479
- updateStateExampleOperation: (state: DocumentModelGlobalState, action: UpdateStateExampleAction) => void;
2480
- deleteStateExampleOperation: (state: DocumentModelGlobalState, action: DeleteStateExampleAction) => void;
2481
- reorderStateExamplesOperation: (state: DocumentModelGlobalState, action: ReorderStateExamplesAction) => void;
2482
- }
2483
- interface DocumentModelVersioningOperations {
2484
- addChangeLogItemOperation: (state: DocumentModelGlobalState, action: AddChangeLogItemAction) => void;
2485
- updateChangeLogItemOperation: (state: DocumentModelGlobalState, action: UpdateChangeLogItemAction) => void;
2486
- deleteChangeLogItemOperation: (state: DocumentModelGlobalState, action: DeleteChangeLogItemAction) => void;
2487
- reorderChangeLogItemsOperation: (state: DocumentModelGlobalState, action: ReorderChangeLogItemsAction) => void;
2488
- releaseNewVersionOperation: (state: DocumentModelGlobalState, action: ReleaseNewVersionAction) => void;
2489
- }
2490
- type Maybe<T> = T | null;
2491
- type InputMaybe<T> = T | null | undefined;
2492
- type Exact<T extends Record<string, unknown>> = { [K in keyof T]: T[K]; };
2493
- type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]>; };
2494
- type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]>; };
2495
- type MakeEmpty<T extends Record<string, unknown>, K extends keyof T> = { [_ in K]?: never; };
2496
- type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; };
2497
- /** All built-in and custom scalars, mapped to their actual values */
2498
- type Scalars = {
2499
- ID: {
2500
- input: string;
2501
- output: string;
2502
- };
2503
- String: {
2504
- input: string;
2505
- output: string;
2506
- };
2507
- Boolean: {
2508
- input: boolean;
2509
- output: boolean;
2510
- };
2511
- Int: {
2512
- input: number;
2513
- output: number;
2514
- };
2515
- Float: {
2516
- input: number;
2517
- output: number;
2518
- };
2519
- Address: {
2520
- input: `${string}:0x${string}`;
2521
- output: `${string}:0x${string}`;
2522
- };
2523
- AttachmentRef: {
2524
- input: `attachment://v${number}:${string}`;
2525
- output: `attachment://v${number}:${string}`;
2526
- };
2527
- DateTime: {
2528
- input: string;
2529
- output: string;
2530
- };
2531
- Unknown: {
2532
- input: unknown;
2533
- output: unknown;
2534
- };
2535
- };
2536
- type ID = string;
2537
- type OperationsByScope = Partial<Record<string, Operation[]>>;
2538
- type SkipHeaderOperationIndex = Partial<Pick<OperationIndex, "index">> & Pick<OperationIndex, "skip">;
2539
- type UndoRedoAction = SchemaRedoAction | SchemaUndoAction;
2540
- type IAction = {
2541
- type: Scalars["String"]["output"];
2542
- };
2543
- type IDocument = {
2544
- created: Scalars["DateTime"]["output"];
2545
- documentType: Scalars["String"]["output"];
2546
- lastModified: Scalars["DateTime"]["output"];
2547
- name: Scalars["String"]["output"];
2548
- operations: Array<IOperation>;
2549
- revision: Scalars["Int"]["output"];
2550
- };
2551
- type IOperation = {
2552
- hash: Scalars["String"]["output"];
2553
- index: Scalars["Int"]["output"];
2554
- timestampUtcMs: Scalars["DateTime"]["output"];
2555
- type: Scalars["String"]["output"];
2556
- };
2557
- type MutationRedoArgs = {
2558
- input: SchemaRedoAction;
2559
- };
2560
- type MutationSetNameArgs = {
2561
- input: SchemaSetNameAction;
2562
- };
2563
- type MutationUndoArgs = {
2564
- input: SchemaUndoAction;
2565
- };
2566
- type Query = {
2567
- __typename?: "Query";
2568
- document: Maybe<IDocument>;
2569
- };
2570
- type Redo = "REDO";
2571
- type RedoActionInput = {
2572
- count: Scalars["Int"]["input"];
2573
- };
2574
- type SchemaRedoAction = {
2575
- id: Scalars["String"]["output"];
2576
- timestampUtcMs: Scalars["DateTime"]["output"];
2577
- input: RedoActionInput;
2578
- type: Redo;
2579
- scope: string;
2580
- };
2581
- type Set_Name = "SET_NAME";
2582
- type SetNameActionInput = {
2583
- name: Scalars["String"]["input"];
2584
- };
2585
- type SchemaSetNameAction = {
2586
- id: Scalars["String"]["output"];
2587
- timestampUtcMs: Scalars["DateTime"]["output"];
2588
- input: SetNameActionInput;
2589
- type: Set_Name;
2590
- scope: "global";
2591
- };
2592
- type SetNameOperation = IOperation & {
2593
- __typename?: "SetNameOperation";
2594
- hash: Scalars["String"]["output"];
2595
- index: Scalars["Int"]["output"];
2596
- input: Scalars["String"]["output"];
2597
- timestamp: Scalars["DateTime"]["output"];
2598
- type: Scalars["String"]["output"];
2599
- };
2600
- type Set_PreferredEditor = "SET_PREFERRED_EDITOR";
2601
- type SetPreferredEditorActionInput = {
2602
- preferredEditor: Scalars["String"]["input"] | null;
2603
- };
2604
- type SchemaSetPreferredEditorAction = {
2605
- id: Scalars["String"]["output"];
2606
- timestampUtcMs: Scalars["DateTime"]["output"];
2607
- input: SetPreferredEditorActionInput;
2608
- type: Set_PreferredEditor;
2609
- scope: "header";
2610
- };
2611
- type SetPreferredEditorOperation = IOperation & {
2612
- __typename?: "SetPreferredEditorOperation";
2613
- hash: Scalars["String"]["output"];
2614
- index: Scalars["Int"]["output"];
2615
- input: SetPreferredEditorActionInput;
2616
- timestamp: Scalars["DateTime"]["output"];
2617
- type: Scalars["String"]["output"];
2618
- };
2619
- type Undo = "UNDO";
2620
- type UndoActionInput = {
2621
- count: Scalars["Int"]["input"];
2622
- };
2623
- type SchemaUndoAction = {
2624
- id: Scalars["String"]["output"];
2625
- timestampUtcMs: Scalars["DateTime"]["output"];
2626
- input: UndoActionInput;
2627
- type: Undo;
2628
- scope: string;
2629
- };
2630
- type SchemaNOOPAction = {
2631
- id: Scalars["String"]["output"];
2632
- input: Scalars["Unknown"]["input"];
2633
- scope: string;
2634
- timestampUtcMs: Scalars["DateTime"]["output"];
2635
- type: "NOOP";
2636
- };
2637
- type RedoAction = Action & {
2638
- type: "REDO";
2639
- input: SchemaRedoAction["input"];
2640
- };
2641
- type SetNameAction = Action & {
2642
- type: "SET_NAME";
2643
- input: SchemaSetNameAction["input"];
2644
- };
2645
- type SetPreferredEditorAction = Action & {
2646
- type: "SET_PREFERRED_EDITOR";
2647
- input: SchemaSetPreferredEditorAction["input"];
2648
- };
2649
- type UndoAction = Action & {
2650
- type: "UNDO";
2651
- input: SchemaUndoAction["input"];
2652
- };
2653
- type NOOPAction = Action & {
2654
- type: "NOOP";
2655
- input: SchemaNOOPAction["input"];
2656
- };
2657
- type CreateDocumentActionInput = {
2658
- model: string;
2659
- version: 0;
2660
- documentId: string;
2661
- signing?: {
2662
- signature: string;
2663
- publicKey: JsonWebKey;
2664
- nonce: string;
2665
- createdAtUtcIso: string;
2666
- documentType: string;
2667
- };
2668
- slug?: string;
2669
- name?: string;
2670
- branch?: string;
2671
- meta?: Record<string, unknown>;
2672
- protocolVersions?: {
2673
- [key: string]: number;
2674
- };
2675
- };
2676
- type UpgradeDocumentActionInput = {
2677
- model: string;
2678
- fromVersion: number;
2679
- toVersion: number;
2680
- documentId: string;
2681
- initialState?: object;
2682
- /**
2683
- * Per-scope next-operation-index snapshot at the moment the upgrade executes.
2684
- * Absent on legacy operations; loaders fall back to timestamp ordering when missing.
2685
- * Stamped CLIENT-SIDE at action creation (before signing), NEVER at execution.
2686
- */
2687
- revision?: Record<string, number>;
2688
- };
2689
- type DeleteDocumentActionInput = {
2690
- documentId: string;
2691
- propagate?: "none" | "cascade";
2692
- };
2693
- type AddRelationshipActionInput = {
2694
- sourceId: string;
2695
- targetId: string;
2696
- relationshipType: string;
2697
- metadata?: Record<string, unknown>;
2698
- };
2699
- type RemoveRelationshipActionInput = {
2700
- sourceId: string;
2701
- targetId: string;
2702
- relationshipType: string;
2703
- };
2704
- type UpdateRelationshipActionInput = {
2705
- sourceId: string;
2706
- targetId: string;
2707
- relationshipType: string;
2708
- metadata: Record<string, unknown> | null;
2709
- };
2710
- type CreateDocumentAction = Action & {
2711
- type: "CREATE_DOCUMENT";
2712
- input: CreateDocumentActionInput;
2713
- };
2714
- type UpgradeDocumentAction = Action & {
2715
- type: "UPGRADE_DOCUMENT";
2716
- input: UpgradeDocumentActionInput;
2717
- };
2718
- type DeleteDocumentAction = Action & {
2719
- type: "DELETE_DOCUMENT";
2720
- input: DeleteDocumentActionInput;
2721
- };
2722
- type AddRelationshipAction = Action & {
2723
- type: "ADD_RELATIONSHIP";
2724
- input: AddRelationshipActionInput;
2725
- };
2726
- type RemoveRelationshipAction = Action & {
2727
- type: "REMOVE_RELATIONSHIP";
2728
- input: RemoveRelationshipActionInput;
2729
- };
2730
- type UpdateRelationshipAction = Action & {
2731
- type: "UPDATE_RELATIONSHIP";
2732
- input: UpdateRelationshipActionInput;
2733
- };
2734
- type DocumentAction = RedoAction | SetNameAction | SetPreferredEditorAction | UndoAction | NOOPAction;
2735
- interface ISignal<TType extends string, TInput> {
2736
- type: TType;
2737
- input: TInput;
2738
- }
2739
- type ISignalResult<TTYpe, TInput, TResult> = {
2740
- signal: {
2741
- type: TTYpe;
2742
- input: TInput;
2743
- };
2744
- result: TResult;
2745
- };
2746
- type CreateChildDocumentInput = {
2747
- id: string;
2748
- documentType: string;
2749
- };
2750
- type CreateChildDocumentSignal = ISignal<"CREATE_CHILD_DOCUMENT", CreateChildDocumentInput>;
2751
- type DeleteChildDocumentInput = {
2752
- id: string;
2753
- };
2754
- type DeleteChildDocumentSignal = ISignal<"DELETE_CHILD_DOCUMENT", DeleteChildDocumentInput>;
2755
- type CopyChildDocumentInput = {
2756
- id: string;
2757
- newId: string;
2758
- };
2759
- type CopyChildDocumentSignal = ISignal<"COPY_CHILD_DOCUMENT", CopyChildDocumentInput>;
2760
- type Signal = CreateChildDocumentSignal | CopyChildDocumentSignal | DeleteChildDocumentSignal;
2761
- type SignalDispatch = (signal: Signal) => void;
2762
- type SignalResult = ISignalResult<CreateChildDocumentSignal["type"], CreateChildDocumentSignal["input"], PHDocument> | ISignalResult<CopyChildDocumentSignal["type"], CopyChildDocumentSignal["input"], boolean> | ISignalResult<DeleteChildDocumentSignal["type"], DeleteChildDocumentSignal["input"], PHDocument>;
2763
- type SignalResults = {
2764
- CREATE_CHILD_DOCUMENT: PHDocument;
2765
- COPY_CHILD_DOCUMENT: PHDocument;
2766
- DELETE_CHILD_DOCUMENT: boolean;
2767
- };
2768
- type SignalType<T extends Signal> = T["type"];
2769
- type FileInput = string | number[] | Uint8Array | ArrayBuffer | Blob;
2770
- type ReducerOptions = {
2771
- /** The number of operations to skip before this new action is applied. This overrides the skip count in the operation. */
2772
- skip?: number;
2773
- /** When true the skip count is ignored and the action is applied regardless of the skip count */
2774
- ignoreSkipOperations?: boolean;
2775
- /** if true reuses the provided action resulting state instead of replaying it */
2776
- reuseOperationResultingState?: boolean;
2777
- /** if true checks the hashes of the operations */
2778
- checkHashes?: boolean;
2779
- /** Options for performing a replay. */
2780
- replayOptions?: {
2781
- /** The previously created operation to verify against. */
2782
- operation: Operation;
2783
- };
2784
- /** Optional parser for the operation resulting state, uses JSON.parse by default */
2785
- operationResultingStateParser?: <TState>(state: string | null | undefined) => TState;
2786
- /**
2787
- * When true (default), the reducer will prune operations (garbage collect) when processing a skip.
2788
- * When false, it will recompute state for the skip but preserve the existing operations history.
2789
- */
2790
- pruneOnSkip?: boolean;
2791
- /** The branch being operated on. Defaults to "main". */
2792
- branch?: string;
2793
- /**
2794
- * Protocol version controlling undo/redo behavior.
2795
- * - Version 1 (default): Legacy behavior with index reuse
2796
- * - Version 2: Reactor behavior with monotonic indices
2797
- */
2798
- protocolVersion?: number;
2799
- /**
2800
- * When true, skip index contiguity validation during replay.
2801
- * Used for V2 state rebuild where gapped indices are expected.
2802
- */
2803
- skipIndexValidation?: boolean;
2804
- };
2805
- /**
2806
- * A pure function that takes an action and the previous state
2807
- * of the document and returns the new state.
2808
- */
2809
- type Reducer<TState extends PHBaseState = PHBaseState> = (document: PHDocument<TState>, action: Action, dispatch?: SignalDispatch, options?: ReducerOptions) => PHDocument<TState>;
2810
- type StateReducer<TState extends PHBaseState = PHBaseState> = (state: Draft<TState>, action: Action, dispatch?: SignalDispatch) => TState | undefined;
2811
- type MappedOperation = {
2812
- ignore: boolean;
2813
- operation: Operation;
2814
- };
2815
- type DocumentOperationsIgnoreMap = Record<string, MappedOperation[]>;
2816
- type ActionSignatureContext = {
2817
- documentId: string;
2818
- signer: ActionSigner;
2819
- action: Action;
2820
- previousStateHash: string;
2821
- };
2822
- type ActionSigningHandler = (message: Uint8Array) => Promise<Uint8Array>;
2823
- type ActionVerificationHandler = (publicKey: string, signature: Uint8Array, data: Uint8Array) => Promise<boolean>;
2824
- /**
2825
- * Handler for verifying operation signatures.
2826
- *
2827
- * @param operation - The operation to verify
2828
- * @param publicKey - The public key to verify against (from signer.app.key)
2829
- * @returns Promise that resolves to true if signature is valid, false otherwise
2830
- */
2831
- type SignatureVerificationHandler = (operation: Operation, publicKey: string) => Promise<boolean>;
2832
- type ENSInfo = {
2833
- name?: string;
2834
- avatarUrl?: string;
2835
- };
2836
- type User = {
2837
- address: `0x${string}`;
2838
- networkId: string;
2839
- chainId: number;
2840
- ens?: ENSInfo;
2841
- };
2842
- type PartialRecord<K extends keyof any, T> = { [P in K]?: T; };
2843
- type RevisionsFilter = PartialRecord<string, number>;
2844
- type GetDocumentOptions = ReducerOptions & {
2845
- revisions?: RevisionsFilter;
2846
- checkHashes?: boolean;
2847
- };
2848
- type ActionErrorCallback = (error: unknown) => void;
2849
- type EditorDispatch = (action: Action, onErrorCallback?: ActionErrorCallback) => void;
2850
- type EditorProps = {
2851
- children?: ReactNode;
2852
- className?: string;
2853
- document?: PHDocument;
2854
- };
2855
- type SubgraphModule = {
2856
- id: string;
2857
- name: string;
2858
- gql: string;
2859
- endpoint: string;
2860
- };
2861
- type EditorModule<TProps = any> = {
2862
- Component: FC<EditorProps & TProps>;
2863
- documentTypes: string[];
2864
- config: {
2865
- id: string;
2866
- name: string;
2867
- };
2868
- };
2869
- type ValidationError = {
2870
- message: string;
2871
- details: object;
2872
- };
2873
- type SkipHeaderOperations = Partial<Record<string, number>>;
2874
- type ReplayDocumentOptions = {
2875
- checkHashes?: boolean;
2876
- reuseOperationResultingState?: boolean;
2877
- operationResultingStateParser?: <TState>(state: string) => TState;
2878
- skipIndexValidation?: boolean;
2879
- };
2880
- type OperationIndex = {
2881
- index: number;
2882
- skip: number;
2883
- id?: string;
2884
- timestampUtcMs?: string;
2885
- };
2886
- /**
2887
- * Parameters used in a document signature.
2888
- */
2889
- type SigningParameters = {
2890
- documentType: string;
2891
- createdAtUtcIso: string;
2892
- /**
2893
- * The nonce can act as both a salt and a typical nonce.
2894
- */
2895
- nonce: string;
2896
- };
2897
- /**
2898
- * Describes a signer that can sign both document headers and actions.
2899
- */
2900
- interface ISigner {
2901
- /** The user associated with the signer */
2902
- user?: UserActionSigner;
2903
- /** The app associated with the signer */
2904
- app?: AppActionSigner;
2905
- /** The corresponding public key */
2906
- publicKey: CryptoKey;
2907
- /**
2908
- * Signs raw data (used for document header signing).
2909
- *
2910
- * @param data - The data to sign.
2911
- * @returns The signature of the data.
2912
- */
2913
- sign: (data: Uint8Array) => Promise<Uint8Array>;
2914
- /**
2915
- * Verifies a signature.
2916
- *
2917
- * @param data - The data to verify.
2918
- * @param signature - The signature to verify.
2919
- */
2920
- verify: (data: Uint8Array, signature: Uint8Array) => Promise<void>;
2921
- /**
2922
- * Signs an action for the log it is written to.
2923
- *
2924
- * @param action - The action to sign.
2925
- * @param target - The document and branch whose log stores the action.
2926
- * @param abortSignal - Optional abort signal to cancel the signing.
2927
- * @returns The signature tuple.
2928
- */
2929
- signAction: (action: Action, target: ActionSigningTarget, abortSignal?: AbortSignal) => Promise<Signature>;
2930
- }
2931
- type IsStateOfType<TState> = (state: unknown) => state is TState;
2932
- type AssertIsStateOfType<TState> = (state: unknown) => asserts state is TState;
2933
- type IsDocumentOfType<TState extends PHBaseState> = (document: unknown) => document is PHDocument<TState>;
2934
- type AssertIsDocumentOfType<TState extends PHBaseState> = (document: unknown) => asserts document is PHDocument<TState>;
2935
- type PartialState<TState> = TState | Partial<TState>;
2936
- type CreateState<TState extends PHBaseState = PHBaseState> = (state?: PartialState<TState>) => TState;
2937
- type SaveToFileHandle = (document: PHDocument, input: FileSystemFileHandle) => void | Promise<void>;
2938
- type SaveToFile = (document: PHDocument, path: string, name?: string) => string | Promise<string>;
2939
- type LoadFromInput<TState extends PHBaseState = PHBaseState> = (input: FileInput) => PHDocument<TState> | Promise<PHDocument<TState>>;
2940
- type LoadFromFile<TState extends PHBaseState = PHBaseState> = (path: string) => PHDocument<TState> | Promise<PHDocument<TState>>;
2941
- type CreateDocument<TState extends PHBaseState = PHBaseState> = (initialState?: Partial<TState>, createState?: CreateState<TState>) => PHDocument<TState>;
2942
- type MinimalBackupData = {
2943
- documentId: string;
2944
- documentType: string;
2945
- branch: string;
2946
- state: PHBaseState;
2947
- name: string;
2948
- protocolVersions?: {
2949
- [key: string]: number;
2950
- };
2951
- };
2952
- type DocumentModelUtils<TState extends PHBaseState = PHBaseState> = {
2953
- fileExtension: string;
2954
- createState: CreateState<TState>;
2955
- createDocument: CreateDocument<TState>;
2956
- loadFromInput: LoadFromInput<TState>;
2957
- saveToFileHandle: SaveToFileHandle;
2958
- isStateOfType: IsStateOfType<TState>;
2959
- assertIsStateOfType: AssertIsStateOfType<TState>;
2960
- isDocumentOfType: IsDocumentOfType<TState>;
2961
- assertIsDocumentOfType: AssertIsDocumentOfType<TState>;
2962
- };
2963
- type Actions = Record<string, (...args: any[]) => Action>;
2964
- /** MCP-compatible annotation hints; structural, no MCP SDK dependency. */
2965
- type PhAiToolAnnotations = {
2966
- title?: string;
2967
- readOnlyHint?: boolean;
2968
- destructiveHint?: boolean;
2969
- idempotentHint?: boolean;
2970
- openWorldHint?: boolean;
2971
- };
2972
- /**
2973
- * Provider-agnostic tool descriptor a package can offer to the in-browser
2974
- * AI assistant (see `DocumentModelLib.aiTools`).
2975
- *
2976
- * Structurally compatible with the MCP tool records produced by
2977
- * `createReactorMcpProvider`: the callback parameter is `never` so any
2978
- * per-tool-args function type is assignable, and the result is `unknown`
2979
- * because the envelope shape (MCP `CallToolResult`) is unwrapped at the
2980
- * adapter boundary.
2981
- */
2982
- type PhAiToolDescriptor = {
2983
- name: string;
2984
- description?: string;
2985
- inputSchema: ZodRawShape;
2986
- annotations?: PhAiToolAnnotations;
2987
- callback: (args: never) => Promise<unknown>;
2988
- };
2989
- type DocumentModelModule<TState extends PHBaseState = PHBaseState> = {
2990
- /** optional version field, should be made required */
2991
- version?: number;
2992
- reducer: Reducer<TState>;
2993
- actions: Actions;
2994
- utils: DocumentModelUtils<TState>;
2995
- documentModel: DocumentModelPHState;
2996
- };
2997
- type DocumentModelLib<TState extends PHBaseState = PHBaseState> = {
2998
- manifest: Manifest;
2999
- documentModels: readonly DocumentModelModule<TState>[];
3000
- editors: readonly EditorModule[];
3001
- subgraphs?: readonly SubgraphModule[];
3002
- upgradeManifests?: readonly UpgradeManifest<readonly number[]>[] | undefined;
3003
- processorFactory?: ProcessorFactoryBuilder;
3004
- /**
3005
- * Optional: tool descriptors this package offers to the in-browser AI
3006
- * assistant (merged into the chat agent's tool set by the host app).
3007
- */
3008
- aiTools?: readonly PhAiToolDescriptor[];
3009
- };
3010
- type DocumentModelDocumentModelModule = DocumentModelModule<DocumentModelPHState>;
3011
- type ConfigEntryType = z.infer<typeof ConfigEntryTypeSchema>;
3012
- type ConfigEntry = z.infer<typeof ConfigEntrySchema>;
3013
- type PowerhouseModule = z.infer<typeof PowerhouseModuleSchema>;
3014
- type PieceModule = z.infer<typeof PieceModuleSchema>;
3015
- type Publisher = z.infer<typeof PublisherSchema>;
3016
- type Manifest = z.infer<typeof ManifestSchema>;
3017
- //#endregion
3018
- //#region clis/constants.d.ts
3019
- declare const SERVICE_ACTIONS: readonly ["start", "stop", "status", "setup", "restart"];
3020
- declare const DRIVES_PRESERVE_STRATEGIES: readonly ["preserve-all", "preserve-by-url-and-detach"];
3021
- declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error", "verbose"];
3022
- declare const DEFAULT_REGISTRY_URL: "https://registry.vetra.io";
3023
- //#endregion
3024
- //#region clis/types.d.ts
3025
- type ServiceActions = typeof SERVICE_ACTIONS;
3026
- type ServiceAction = ServiceActions[number];
3027
- type DrivePreserveStrategies = typeof DRIVES_PRESERVE_STRATEGIES;
3028
- type DrivePreserveStrategy = DrivePreserveStrategies[number];
3029
- type LogLevels = typeof LOG_LEVELS;
3030
- type LogLevel = LogLevels[number];
3031
- type ParsedCmdResult<P> = P extends ArgParser<infer Out> ? Out : never;
3032
- type PackageManagerArgs = ParsedCmdResult<typeof getPackageManagerCommand>;
3033
- type PHPackageProvider = "npm" | "github" | "local" | "registry";
3034
- type PathValidation = (dir: string) => boolean;
3035
- type PowerhousePackage = {
3036
- packageName: string;
3037
- version?: string;
3038
- provider?: PHPackageProvider;
3039
- url?: string;
3040
- };
3041
- type PHConnectBranding = {
3042
- appName?: string;
3043
- homeBackground?: string | null;
3044
- };
3045
- type PHConnectDefaultDriveRemote = {
3046
- url: string;
3047
- name?: string | null;
3048
- icon?: string | null;
3049
- };
3050
- type PHConnectDefaultDriveLocal = {
3051
- /** Discriminator: this entry is a local drive created on first boot. */
3052
- local: true;
3053
- /** Stable drive id; the drive is not re-created on later boots. */
3054
- id: string;
3055
- name?: string | null;
3056
- icon?: string | null;
3057
- /** Drive app (preferred editor) to open on the drive. */
3058
- app?: string;
3059
- };
3060
- type PHConnectDefaultDrive = PHConnectDefaultDriveRemote | PHConnectDefaultDriveLocal;
3061
- type PHConnectDriveSection = {
3062
- enabled?: boolean;
3063
- allowAdd?: boolean;
3064
- allowDelete?: boolean;
3065
- };
3066
- type PHConnectDriveSections = {
3067
- remote?: PHConnectDriveSection;
3068
- local?: PHConnectDriveSection;
3069
- };
3070
- type PHConnectDrives = {
3071
- allowAddDrive?: boolean;
3072
- defaultDrives?: PHConnectDefaultDrive[];
3073
- preserveStrategy?: DrivePreserveStrategy;
3074
- sections?: PHConnectDriveSections;
3075
- };
3076
- type PHConnectApp = {
3077
- logLevel?: "debug" | "info" | "warn" | "error";
3078
- basePath?: string;
3079
- offline?: boolean;
3080
- studioMode?: boolean;
3081
- workflowsEnabled?: boolean;
3082
- };
3083
- type PHConnectAi = {
3084
- /** Enables the in-browser AI assistant (chat FAB + window). Off by default. */
3085
- assistantEnabled?: boolean;
3086
- };
3087
- type PHConnectPackages = {
3088
- externalEnabled?: boolean;
3089
- /** Subscribe to the static-mode `/__packages` SSE channel for live reload. */
3090
- liveReload?: boolean;
3091
- };
3092
- type PHRenownRainbowAdapterConfig = {
3093
- /** WalletConnect project id; required for the rainbow adapter to function. */
3094
- walletConnectProjectId?: string;
3095
- /** Optional Infura project id used to build RPC transports. */
3096
- infuraProjectId?: string;
3097
- };
3098
- type PHRenownPrivyAdapterConfig = {
3099
- /** Privy application id; required for the privy adapter to function. */
3100
- appId?: string;
3101
- /** Optional Privy client id. */
3102
- clientId?: string;
3103
- /** Login methods this adapter offers; defaults per adapter when omitted. */
3104
- methods?: string[];
3105
- };
3106
- type PHConnectRenownAdapters = {
3107
- rainbow?: PHRenownRainbowAdapterConfig;
3108
- privy?: PHRenownPrivyAdapterConfig;
3109
- };
3110
- type PHConnectRenown = {
3111
- url?: string;
3112
- networkId?: string;
3113
- chainId?: number;
3114
- /** Renown localStorage namespace; share it across Connects to share login. */
3115
- namespace?: string;
3116
- /** Switchboard GraphQL URL; when set, enables in-page (no-redirect) auth. */
3117
- switchboardUrl?: string;
3118
- /** Per-adapter wallet config; presence of a key enables that adapter. */
3119
- adapters?: PHConnectRenownAdapters;
3120
- };
3121
- type PHConnectSentry = {
3122
- /** Sentry DSN URL. `null` disables Sentry entirely. */
3123
- dsn?: string | null;
3124
- /** Sentry environment label. */
3125
- env?: string;
3126
- /** Enable Sentry performance tracing. */
3127
- tracing?: boolean;
3128
- };
3129
- type PHConnectOpenPanel = {
3130
- /** OpenPanel client id. Empty string (the default) disables OpenPanel. */
3131
- clientId?: string;
3132
- /** OpenPanel API URL, for self-hosted instances. */
3133
- apiUrl?: string;
3134
- /** Track UI events. */
3135
- trackUiEvents?: boolean;
3136
- /** Track document operations. */
3137
- trackOperations?: boolean;
3138
- };
3139
- type PHConnectInstance = {
3140
- namespace: string | null;
3141
- reactorWorker: boolean;
3142
- };
3143
- /** Each flag implies its predecessors, and must match the fleet Connect syncs
3144
- * with or the two compute different replay outcomes. */
3145
- type PHConnectReactorFeatureFlags = {
3146
- /** Decide writes from the document stream instead of the meta cache. */
3147
- documentDecisions?: boolean;
3148
- /** Enforce the auth scope's policy at admission, replay, and read. */
3149
- authEnforcement?: boolean;
3150
- /** Let `{ group }` principals match, via the group documents' rosters. */
3151
- authGroups?: boolean;
3152
- /** Evaluate `where` / `match` conditions on grants. */
3153
- authConditions?: boolean;
3154
- };
3155
- type PHConnectReactor = {
3156
- featureFlags?: PHConnectReactorFeatureFlags;
3157
- /** What new documents are created as; `legacy` while peers predate v2-required documents. */
3158
- createSignaturePolicy?: "legacy" | "v2-required";
3159
- /** Stored documents at protocol versions this build does not run: refuse to boot, or keep them read-only. */
3160
- unsupportedStoredDocuments?: "refuse" | "read-only";
3161
- };
3162
- /**
3163
- * A URL-matching pattern for a service-worker runtime-caching rule, in
3164
- * JSON-serialisable form. A plain string is handed to Workbox verbatim (exact
3165
- * URL or same-origin path match). `{ source, flags }` is reconstructed into a
3166
- * `RegExp` at build time — use it for prefix/suffix/origin matches (e.g.
3167
- * `{ source: "^https://api\\.acme\\.io/" }`). Function-valued patterns aren't
3168
- * expressible here; regex covers the realistic package cases.
3169
- */
3170
- type PHConnectPwaUrlPattern = string | {
3171
- source: string;
3172
- flags?: string;
3173
- };
3174
- type PHConnectPwaCacheStrategy = "CacheFirst" | "CacheOnly" | "NetworkFirst" | "NetworkOnly" | "StaleWhileRevalidate";
3175
- /** Serialisable subset of a Workbox `RuntimeCaching` rule. */
3176
- type PHConnectPwaRuntimeCaching = {
3177
- urlPattern: PHConnectPwaUrlPattern;
3178
- handler: PHConnectPwaCacheStrategy;
3179
- method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "PATCH";
3180
- options?: {
3181
- cacheName?: string;
3182
- /** Seconds a NetworkFirst rule waits for the network before falling back
3183
- * to the cache. */
3184
- networkTimeoutSeconds?: number;
3185
- expiration?: {
3186
- maxEntries?: number;
3187
- maxAgeSeconds?: number;
3188
- };
3189
- cacheableResponse?: {
3190
- statuses?: number[];
3191
- headers?: Record<string, string>;
3192
- };
3193
- };
3194
- };
3195
- type PHConnectPwaIcon = {
3196
- src: string;
3197
- sizes?: string;
3198
- type?: string;
3199
- purpose?: string;
3200
- };
3201
- /**
3202
- * A File Handling API entry a package or project contributes: the OS-level
3203
- * file types the installed Connect PWA offers to open. There is deliberately
3204
- * no `action` field — consuming launched files requires runtime code that
3205
- * lives in Connect itself, so every handler (built-in or contributed) opens
3206
- * at Connect's app root, injected at build time.
3207
- */
3208
- type PHConnectPwaFileHandler = {
3209
- /** MIME type → file extensions (each must start with "."). */
3210
- accept: Record<string, string[]>;
3211
- /** OS-level file-type icons. */
3212
- icons?: PHConnectPwaIcon[];
3213
- launch_type?: "single-client" | "multiple-clients";
3214
- };
3215
- /** Web-app-manifest fields a package or project may override. */
3216
- type PHConnectPwaManifest = {
3217
- name?: string;
3218
- short_name?: string;
3219
- description?: string;
3220
- theme_color?: string;
3221
- background_color?: string;
3222
- display?: "fullscreen" | "standalone" | "minimal-ui" | "browser";
3223
- start_url?: string;
3224
- scope?: string;
3225
- icons?: PHConnectPwaIcon[];
3226
- /** Extra file associations, appended after Connect's built-in `.phd`/`.phdm` handler. */
3227
- file_handlers?: PHConnectPwaFileHandler[];
3228
- /** How the OS launches the app for handled files/links. */
3229
- launch_handler?: {
3230
- client_mode: "auto" | "focus-existing" | "navigate-existing" | "navigate-new";
3231
- };
3232
- /** App-store-style categories. NOT authored under `connect.pwa` — derived at
3233
- * build/runtime from the `category` field of every contributing
3234
- * `powerhouse.manifest.json` (project + packages), unioned across them. */
3235
- categories?: string[];
3236
- };
3237
- /**
3238
- * PWA / service-worker overrides contributed by a package or the project.
3239
- * Layered on top of Connect's hardcoded PWA defaults at build time. Scalar
3240
- * fields deep-merge (later layer wins); every array member — the manifest
3241
- * arrays (`icons`, `file_handlers`, and the derived `categories`) plus the
3242
- * top-level `globPatterns`, `globIgnores`, `runtimeCaching` and
3243
- * `navigateFallbackDenylist` — is additive (concatenated/unioned);
3244
- * `maximumFileSizeToCacheInBytes` takes the max across contributors.
3245
- * Precedence: defaults < package fragments < project config.
3246
- */
3247
- type PHConnectPwa = {
3248
- manifest?: PHConnectPwaManifest;
3249
- /** Extra Workbox precache globs, unioned with the built-in patterns. */
3250
- globPatterns?: string[];
3251
- /** Extra Workbox precache ignore globs, unioned with the built-in list. */
3252
- globIgnores?: string[];
3253
- /** Raise the precache file-size ceiling; the max across contributors wins. */
3254
- maximumFileSizeToCacheInBytes?: number;
3255
- /** Additional runtime-caching rules, appended after the built-in rules. */
3256
- runtimeCaching?: PHConnectPwaRuntimeCaching[];
3257
- /** Extra SPA-fallback denylist patterns, unioned with the built-in list. */
3258
- navigateFallbackDenylist?: PHConnectPwaUrlPattern[];
3259
- };
3260
- type PHConnectRuntimeConfig = {
3261
- branding?: PHConnectBranding;
3262
- app?: PHConnectApp;
3263
- ai?: PHConnectAi;
3264
- packages?: PHConnectPackages;
3265
- drives?: PHConnectDrives;
3266
- renown?: PHConnectRenown;
3267
- sentry?: PHConnectSentry;
3268
- openPanel?: PHConnectOpenPanel;
3269
- instance?: PHConnectInstance;
3270
- reactor?: PHConnectReactor;
3271
- pwa?: PHConnectPwa;
3272
- };
3273
- /** Which Renown instance a reactor authenticates against, server-side. */
3274
- type PHReactorRenown = {
3275
- /** "self" reads this reactor's own renown read model; "remote" (default)
3276
- * queries a Renown or Switchboard instance. */
3277
- source?: "remote" | "self";
3278
- /** Renown base URL; also the instance this reactor's own identity uses. */
3279
- url?: string;
3280
- /** Switchboard GraphQL endpoint to read credentials from directly. */
3281
- switchboardUrl?: string;
3282
- };
3283
- type PowerhouseConfig = {
3284
- logLevel: LogLevel;
3285
- documentModelsDir: string;
3286
- editorsDir: string;
3287
- processorsDir: string;
3288
- subgraphsDir: string;
3289
- importScriptsDir: string;
3290
- skipFormat: boolean;
3291
- interactive?: boolean;
3292
- watch?: boolean;
3293
- reactor?: {
3294
- port?: number;
3295
- https?: undefined | boolean | {
3296
- keyPath: string;
3297
- certPath: string;
3298
- };
3299
- storage?: {
3300
- type: "filesystem" | "memory" | "postgres" | "browser";
3301
- filesystemPath?: string;
3302
- postgresUrl?: string;
3303
- };
3304
- };
3305
- auth?: {
3306
- enabled?: boolean;
3307
- admins: string[];
3308
- renown?: PHReactorRenown;
3309
- };
3310
- switchboard?: {
3311
- database?: {
3312
- url?: string;
3313
- };
3314
- port?: number;
3315
- };
3316
- studio?: {
3317
- port?: number;
3318
- host?: string;
3319
- https: boolean;
3320
- openBrowser?: boolean;
3321
- };
3322
- packages?: PowerhousePackage[];
3323
- vetra?: {
3324
- driveId?: string;
3325
- driveUrl?: string;
3326
- connectPort?: number;
3327
- };
3328
- workflows?: {
3329
- enabled?: boolean;
3330
- };
3331
- packageRegistryUrl?: string;
3332
- connect?: PHConnectRuntimeConfig;
3333
- };
3334
- //#endregion
3335
- export { AddOperationErrorInput as $, AddOperationErrorInputSchema as $a, deleteOperationError as $c, SetOperationNameInput as $i, baseReducerVersion as $l, MutationMoveOperationArgs as $n, SetOperationErrorNameInputSchema as $o, ReorderChangeLogItemsInput as $r, ProcessorApps as $s, DocumentModelOperationExampleAction as $t, defaultDocumentState as $u, PHPackageProvider as A, UndoRedoAction as Aa, WebhookScheme as Ac, PHDocumentSignatureInfo as Ad, SetModelExtensionInput as Ai, setOperationErrorName as Al, MakeEmpty as An, RedoActionSchema as Ao, MutationUpdateStateExampleArgs as Ar, isV2ActionHash as As, DeleteOperationErrorAction as At, sortOperations as Au, ServiceActions as B, UpgradeDocumentActionInput as Ba, addChangeLogItem as Bc, SetNameActionInput as Bi, updateChangeLogItem as Bl, Mutation as Bn, SetAuthorWebsiteInputSchema as Bo, PieceModule as Br, HashAlgorithms as Bs, DocumentModelDocumentModelModule as Bt, PHBaseState as Bu, PHConnectPwaUrlPattern as C, SkipHeaderOperations as Ca, ScopedRouteHandle as Cc, setNameOperation as Cd, SetAuthorWebsiteAction as Ci, setModelName as Cl, ISigner as Cn, PieceModuleSchema as Co, MutationSetOperationReducerArgs as Cr, CanonicalJsonError as Cs, DeleteChildDocumentInput as Ct, readOnly as Cu, PHConnectRenownAdapters as D, Undo as Da, WebhookPolicy as Dc, ActionSigner as Dd, SetModelDescriptionAction as Di, setOperationDescription as Dl, IsStateOfType as Dn, PublisherSchema as Do, MutationUndoArgs as Dr, actionSigningTarget as Ds, DeleteModuleAction as Dt, reshuffleByTimestampAndIndex as Du, PHConnectRenown as E, SubgraphModule as Ea, WebhookHashAlgorithm as Ec, undoOperationV2 as Ed, SetInitialStateInput as Ei, setName as El, IsDocumentOfType as En, PowerhouseModulesSchema as Eo, MutationSetStateSchemaArgs as Er, actionSignerIdentity as Es, DeleteDocumentActionInput as Et, reshuffleByTimestamp as Eu, ParsedCmdResult as F, UpdateRelationshipAction as Fa, ActionContext as Fc, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as Fd, SetModuleDescriptionAction as Fi, setOperationScope as Fl, Maybe as Fn, ReorderOperationErrorsInputSchema as Fo, OperationsByScope as Fr, createNamespacedQueryBuilder as Fs, DeleteStateExampleAction as Ft, Capability as Fu, ActionVerificationHandler as G, UpgradeTransition as Ga, addStateExample as Gc, SetOperationErrorCodeInput as Gi, IntegrityIssueType as Gl, MutationAddOperationExampleArgs as Gn, SetModelNameInputSchema as Go, RedoAction as Gr, IRelationalQueryMethods as Gs, DocumentModelLib as Gt, createAuthState as Gu, ActionErrorCallback as H, ValidationError as Ha, addOperation as Hc, SetOperationDescriptionAction as Hi, updateStateExample as Hl, MutationAddModuleArgs as Hn, SetModelDescriptionInputSchema as Ho, Publisher as Hr, IRelationalDb as Hs, DocumentModelHeaderAction as Ht, PHGroupState as Hu, PathValidation as I, UpdateRelationshipActionInput as Ia, actionContext as Ic, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as Id, SetModuleDescriptionInput as Ii, setOperationTemplate as Il, MinimalBackupData as In, ReorderOperationExamplesInputSchema as Io, PartialRecord as Ir, createRelationalDb as Is, DeleteStateExampleInput as It, Condition as Iu, AddChangeLogItemInput as J, computeUpgradeTransitions as Ja, buildSignedAction as Jc, SetOperationErrorNameAction as Ji, PHDocumentMeta as Jl, MutationDeleteModuleArgs as Jn, SetNameActionInputSchema as Jo, ReducerOptions as Jr, IProcessor as Js, DocumentModelModuleAction as Jt, createGlobalState as Ju, Actions as K, applyDeleteDocumentAction as Ka, baseActions as Kc, SetOperationErrorDescriptionAction as Ki, PHDocument as Kl, MutationAddStateExampleArgs as Kn, SetModuleDescriptionInputSchema as Ko, RedoActionInput as Kr, RelationalDbProcessor as Ks, DocumentModelLocalState as Kt, createBaseState as Ku, PowerhouseConfig as L, UpdateStateExampleAction as La, actionFromAction as Lc, PROCESSOR_APPS as Ld, SetModuleNameAction as Li, setPreferredEditor as Ll, ModuleSpecification as Ln, ReorderStateExamplesInputSchema as Lo, PartialState as Lr, hashNamespace as Ls, DocumentAction as Lt, Grant as Lu, PHRenownPrivyAdapterConfig as M, UpdateChangeLogItemInput as Ma, WebhookSpec as Mc, UserActionSigner as Md, SetModelIdInput as Mi, setOperationName as Ml, MakeOptional as Mn, ReorderChangeLogItemsInputSchema as Mo, OperationErrorSpecification as Mr, targetDocumentId as Ms, DeleteOperationExampleAction as Mt, updateHeaderRevision as Mu, PHRenownRainbowAdapterConfig as N, UpdateOperationExampleAction as Na, WebhookVerification as Nc, deserializeSignature as Nd, SetModelNameAction as Ni, setOperationReducer as Nl, Manifest as Nn, ReorderModuleOperationsInputSchema as No, OperationIndex as Nr, v2TupleProblem as Ns, DeleteOperationExampleInput as Nt, withSignaturePolicy as Nu, PHConnectRuntimeConfig as O, UndoAction as Oa, WebhookReply as Oc, AppActionSigner as Od, SetModelDescriptionInput as Oi, setOperationErrorCode as Ol, LoadFromFile as On, PwaConfigSchema as Oo, MutationUpdateChangeLogItemInputArgs as Or, canonicalJson as Os, DeleteModuleInput as Ot, skipHeaderOperations as Ou, PackageManagerArgs as P, UpdateOperationExampleInput as Pa, Action as Pc, serializeSignature as Pd, SetModelNameInput as Pi, setOperationSchema as Pl, MappedOperation as Pn, ReorderModulesInputSchema as Po, OperationSpecification as Pr, createNamespacedDb as Ps, DeleteOperationInput as Pt, AuthGroups as Pu, AddOperationErrorAction as Q, AddModuleInputSchema as Qa, deleteOperation as Qc, SetOperationNameAction as Qi, baseCreateDocument as Ql, MutationDeleteStateExampleArgs as Qn, SetOperationErrorDescriptionInputSchema as Qo, ReorderChangeLogItemsAction as Qr, ProcessorApp as Qs, DocumentModelOperationErrorOperations as Qt, defaultBaseState as Qu, PowerhousePackage as R, UpdateStateExampleInput as Ra, actionSigner as Rc, SetModuleNameInput as Ri, setStateSchema as Rl, MoveOperationAction as Rn, ScopeStateSchema as Ro, PhAiToolAnnotations as Rr, relationalDbToQueryBuilder as Rs, DocumentModelAction as Rt, Operand as Ru, PHConnectPwaRuntimeCaching as S, SkipHeaderOperationIndex as Sa, RouteUser as Sc, redoOperation as Sd, SetAuthorNameInput as Si, setModelId as Sl, ISignalResult as Sn, OperationSpecificationSchema as So, MutationSetOperationNameArgs as Sr, ActionSigningTarget as Ss, DeleteChangeLogItemInput as St, prepareOperations as Su, PHConnectReactorFeatureFlags as T, StateReducer as Ta, WebhookField as Tc, undoOperation as Td, SetInitialStateAction as Ti, setModuleName as Tl, InputMaybe as Tn, PowerhouseModuleSchema as To, MutationSetOperationTemplateArgs as Tr, actionPreimageV2 as Ts, DeleteDocumentAction as Tt, replayDocument as Tu, ActionSignatureContext as U, UpgradeManifest as Ua, addOperationError as Uc, SetOperationDescriptionInput as Ui, verifyOperationSignature as Ul, MutationAddOperationArgs as Un, SetModelExtensionInputSchema as Uo, Query as Ur, IRelationalDbProcessor as Us, DocumentModelHeaderOperations as Ut, Principal as Uu, DEFAULT_REGISTRY_URL as V, User as Va, addModule as Vc, SetNameOperation as Vi, updateOperationExample as Vl, MutationAddChangeLogItemInputArgs as Vn, SetInitialStateInputSchema as Vo, PowerhouseModule as Vr, IBaseRelationalDb as Vs, DocumentModelGlobalState as Vt, PHDocumentState as Vu, ActionSigningHandler as W, UpgradeReducer as Wa, addOperationExample as Wc, SetOperationErrorCodeAction as Wi, IntegrityIssueSubType as Wl, MutationAddOperationErrorArgs as Wn, SetModelIdInputSchema as Wo, Redo as Wr, IRelationalQueryBuilder as Ws, DocumentModelInput as Wt, backfillAuthState as Wu, AddModuleInput as X, withProtocolVersions as Xa, deleteChangeLogItem as Xc, SetOperationErrorTemplateAction as Xi, appendWithoutApplying as Xl, MutationDeleteOperationErrorArgs as Xn, SetOperationDescriptionInputSchema as Xo, RemoveRelationshipAction as Xr, IProcessorHostModuleBase as Xs, DocumentModelOperationAction as Xt, createState as Xu, AddModuleAction as Y, normalizeDocumentModelVersion as Ya, createAction as Yc, SetOperationErrorNameInput as Yi, addUndo as Yl, MutationDeleteOperationArgs as Yn, SetNameActionSchema as Yo, ReleaseNewVersionAction as Yr, IProcessorDispatch as Ys, DocumentModelModuleOperations as Yt, createLocalState as Yu, AddOperationAction as Z, AddChangeLogItemInputSchema as Za, deleteModule as Zc, SetOperationErrorTemplateInput as Zi, attachBranch as Zl, MutationDeleteOperationExampleArgs as Zn, SetOperationErrorCodeInputSchema as Zo, RemoveRelationshipActionInput as Zr, IProcessorManager as Zs, DocumentModelOperationErrorAction as Zt, defaultAuthState as Zu, PHConnectPwa as _, SignalResult as _a, RouteHandler as _c, Operation as _d, SchemaSetNameAction as _i, setAuthorName as _l, IAction as _n, ManifestSchema as _o, MutationSetOperationDescriptionArgs as _r, UpdateStateExampleInputSchema as _s, CreateDocument as _t, merge as _u, PHConnectAi as a, SetOperationScopeInput as aa, ProcessorStatus as ac, ProtocolVersions as ad, ReorderOperationErrorsInput as ai, operationExampleCreators as al, DocumentModelUtils as an, ConfigEntrySchema as ao, MutationReorderOperationExamplesArgs as ar, SetOperationTemplateInputSchema as as, AddStateExampleAction as at, garbageCollect as au, PHConnectPwaIcon as b, SignatureVerificationHandler as ba, RouteSpec as bc, OperationWithContext$1 as bd, ScopeState as bi, setModelDescription as bl, IOperation as bn, OperationErrorSchema as bo, MutationSetOperationErrorNameArgs as br, ACTION_SIGNATURE_V2_PREFIX as bs, CreateState as bt, parseResultingState as bu, PHConnectDefaultDrive as c, SetPreferredEditorAction as ca, IHttpScope as cc, SignaturePolicy$1 as cd, ReorderStateExamplesAction as ci, operationWithContext as cl, DocumentOperationsIgnoreMap as cn, DeleteModuleInputSchema as co, MutationSetAuthorWebsiteArgs as cr, SetStateSchemaInputSchema as cs, AssertIsStateOfType as ct, getDocumentLastModified as cu, PHConnectDriveSection as d, SetStateSchemaAction as da, NodeRouteSpec as dc, isSignaturePolicy as dd, RevisionsFilter as di, reorderChangeLogItems as dl, EditorDispatch as dn, DeleteOperationInputSchema as do, MutationSetModelExtensionArgs as dr, StateSchema as ds, ConfigEntry as dt, isDocumentAction as du, SetOperationReducerAction as ea, ProcessorDispatchResult as ec, defaultGlobalState as ed, ReorderModuleOperationsAction as ei, deleteOperationExample as el, DocumentModelOperationExampleOperations as en, AddOperationExampleInputSchema as eo, MutationRedoArgs as er, SetOperationErrorTemplateInputSchema as es, AddOperationExampleAction as et, checkCleanedOperationsIntegrity as eu, PHConnectDriveSections as f, SetStateSchemaInput as fa, RouteActor as fc, protocolVersionsFor as fd, SaveToFile as fi, reorderModuleOperations as fl, EditorModule as fn, DeleteStateExampleInputSchema as fo, MutationSetModelIdArgs as fr, UndoActionInputSchema as fs, ConfigEntryType as ft, isNoopOperation as fu, PHConnectPackages as g, SignalDispatch as ga, RouteContext as gc, DocumentOperations as gd, SchemaRedoAction as gi, reorderStateExamples as gl, GetDocumentOptions as gn, DocumentSpecificationSchema as go, MutationSetNameArgs as gr, UpdateOperationExampleInputSchema as gs, CreateChildDocumentSignal as gt, mapSkippedOperationsV2 as gu, PHConnectOpenPanel as h, Signal as ha, RouteBody as hc, v2RequiredProtocolVersions as hd, SchemaNOOPAction as hi, reorderOperationExamples as hl, FileInput as hn, DocumentModelInputSchema as ho, MutationSetModuleNameArgs as hr, UpdateChangeLogItemInputSchema as hs, CreateChildDocumentInput as ht, mapSkippedOperations as hu, LogLevels as i, SetOperationScopeAction as ia, ProcessorRecord as ic, DocumentIdParams as id, ReorderOperationErrorsAction as ii, noop as il, DocumentModelStateOperations as in, CodeExampleSchema as io, MutationReorderOperationErrorsArgs as ir, SetOperationScopeInputSchema as is, AddRelationshipActionInput as it, filterDuplicatedOperations as iu, PHReactorRenown as j, UpdateChangeLogItemAction as ja, WebhookSignatureEncoding as jc, Signature as jd, SetModelIdAction as ji, setOperationErrorTemplate as jl, MakeMaybe as jn, RedoSchema as jo, NOOPAction as jr, signActionV2 as js, DeleteOperationErrorInput as jt, split as ju, PHConnectSentry as k, UndoActionInput as ka, WebhookRequest as kc, HashConfig as kd, SetModelExtensionAction as ki, setOperationErrorDescription as kl, LoadFromInput as kn, RedoActionInputSchema as ko, MutationUpdateOperationExampleArgs as kr, hashActionV2 as ks, DeleteOperationAction as kt, sortMappedOperations as ku, PHConnectDefaultDriveLocal as l, SetPreferredEditorActionInput as la, IWebhookEndpoints as lc, deriveDocumentId as ld, ReorderStateExamplesInput as li, redo as ll, DocumentSpecification as ln, DeleteOperationErrorInputSchema as lo, MutationSetInitialStateArgs as lr, Set_NameSchema as ls, Author as lt, groupOperationsByScope as lu, PHConnectInstance as m, Set_PreferredEditor as ma, RouteAuthorizer as mc, signaturePolicyOf as md, Scalars as mi, reorderOperationErrors as ml, Exact as mn, DocumentModelGlobalStateSchema as mo, MutationSetModuleDescriptionArgs as mr, UndoSchema as ms, CopyChildDocumentSignal as mt, isUndoRedo as mu, DrivePreserveStrategy as n, SetOperationSchemaAction as na, ProcessorFactoryBuilder as nc, defaultPHState as nd, ReorderModulesAction as ni, documentModelActions as nl, DocumentModelPHState as nn, AddStateExampleInputSchema as no, MutationReorderModuleOperationsArgs as nr, SetOperationReducerInputSchema as ns, AddOperationInput as nt, diffOperations as nu, PHConnectApp as o, SetOperationTemplateAction as oa, TrackedProcessor as oc, SIGNATURE_PROTOCOL as od, ReorderOperationExamplesAction as oi, operationFromAction as ol, DocumentModelVersioningAction as on, ConfigEntryTypeSchema as oo, MutationReorderStateExamplesArgs as or, SetPreferredEditorActionInputSchema as os, AddStateExampleInput as ot, garbageCollectDocumentOperations as ou, PHConnectDrives as p, Set_Name as pa, RouteAuth as pc, requestedSignaturePolicy as pd, SaveToFileHandle as pi, reorderModules as pl, EditorProps as pn, DocumentActionSchema as po, MutationSetModelNameArgs as pr, UndoActionSchema as ps, CopyChildDocumentInput as pt, isUndo as pu, AddChangeLogItemAction as q, applyUpgradeDocumentAction as qa, buildOperationSignature as qc, SetOperationErrorDescriptionInput as qi, PHDocumentHeader as ql, MutationDeleteChangeLogItemInputArgs as qn, SetModuleNameInputSchema as qo, Reducer as qr, RelationalDbProcessorClass as qs, DocumentModelModule as qt, createDocumentState as qu, LogLevel as r, SetOperationSchemaInput as ra, ProcessorFilter as rc, DEFAULT_SIGNATURE_POLICY as rd, ReorderModulesInput as ri, moveOperation as rl, DocumentModelStateAction as rn, AuthorSchema as ro, MutationReorderModulesArgs as rr, SetOperationSchemaInputSchema as rs, AddRelationshipAction as rt, filterDocumentOperationsResultingState as ru, PHConnectBranding as s, SetOperationTemplateInput as sa, AuthorizerResult as sc, SIGNATURE_PROTOCOL_V2 as sd, ReorderOperationExamplesInput as si, operationFromOperation as sl, DocumentModelVersioningOperations as sn, DeleteChangeLogItemInputSchema as so, MutationSetAuthorNameArgs as sr, SetPreferredEditorActionSchema as ss, AssertIsDocumentOfType as st, garbageCollectV2 as su, DrivePreserveStrategies as t, SetOperationReducerInput as ta, ProcessorFactory as tc, defaultLocalState as td, ReorderModuleOperationsInput as ti, deleteStateExample as tl, DocumentModelOperationOperations as tn, AddOperationInputSchema as to, MutationReorderChangeLogItemsInputArgs as tr, SetOperationNameInputSchema as ts, AddOperationExampleInput as tt, checkOperationsIntegrity as tu, PHConnectDefaultDriveRemote as u, SetPreferredEditorOperation as ua, IWebhookScope as uc, isDerivedDocumentId as ud, ReplayDocumentOptions as ui, releaseNewVersion as ul, ENSInfo as un, DeleteOperationExampleInputSchema as uo, MutationSetModelDescriptionArgs as ur, Set_PreferredEditorSchema as us, CodeExample as ut, hashDocumentStateForScope as uu, PHConnectPwaCacheStrategy as v, SignalResults as va, RouteMethod as vc, OperationContext as vd, SchemaSetPreferredEditorAction as vi, setAuthorWebsite as vl, ID as vn, ModuleSchema as vo, MutationSetOperationErrorCodeArgs as vr, definedNonNullAnySchema as vs, CreateDocumentAction as vt, nextSkipNumber as vu, PHConnectReactor as w, State as wa, WebhookEndpointInfo as wc, setPreferredEditorOperation as wd, SetAuthorWebsiteInput as wi, setModuleDescription as wl, Incremental as wn, PieceModulesSchema as wo, MutationSetOperationSchemaArgs as wr, DOCUMENT_SCOPE_ACTION_TYPES as ws, DeleteChildDocumentSignal as wt, removeExistingOperations as wu, PHConnectPwaManifest as x, SigningParameters as xa, RouteTransport as xc, operationOutcome as xd, SetAuthorNameAction as xi, setModelExtension as xl, ISignal as xn, OperationScopeSchema as xo, MutationSetOperationErrorTemplateArgs as xr, ActionSignerIdentity as xs, DeleteChangeLogItemAction as xt, precedes as xu, PHConnectPwaFileHandler as y, SignalType as ya, RouteOptions as yc, OperationOutcome as yd, SchemaUndoAction as yi, setInitialState as yl, IDocument as yn, MoveOperationInputSchema as yo, MutationSetOperationErrorDescriptionArgs as yr, isDefinedNonNullAny as ys, CreateDocumentActionInput as yt, operationsAreEqual as yu, ServiceAction as z, UpgradeDocumentAction as za, actions as zc, SetNameAction as zi, undo as zl, MoveOperationInput as zn, SetAuthorNameInputSchema as zo, PhAiToolDescriptor as zr, ExtractProcessorSchemaOrSelf as zs, DocumentModelDocument as zt, PHAuthState as zu };
3336
- export {};
3337
- //# sourceMappingURL=types-CmeoQg_J.d.ts.map