@powerhousedao/shared 6.2.3-dev.79 → 6.2.3-dev.80

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 (224) hide show
  1. package/dist/clis/args/access-token.d.mts +14 -2
  2. package/dist/clis/args/access-token.d.mts.map +1 -0
  3. package/dist/clis/args/access-token.mjs +21 -1
  4. package/dist/clis/args/access-token.mjs.map +1 -0
  5. package/dist/clis/args/{common-Bnm859xU.d.mts → common-BpLj4peE.d.mts} +4 -4
  6. package/dist/clis/args/{common-Bnm859xU.d.mts.map → common-BpLj4peE.d.mts.map} +1 -1
  7. package/dist/clis/args/{common-CHSGBvxM.mjs → common-CBLen_yt.mjs} +3 -4
  8. package/dist/clis/args/common-CBLen_yt.mjs.map +1 -0
  9. package/dist/clis/args/common.d.mts +1 -1
  10. package/dist/clis/args/common.mjs +1 -1
  11. package/dist/clis/args/connect.d.mts +448 -2
  12. package/dist/clis/args/connect.d.mts.map +1 -0
  13. package/dist/clis/args/connect.mjs +202 -1
  14. package/dist/clis/args/connect.mjs.map +1 -0
  15. package/dist/clis/args/{generate-DLPqkD9L.mjs → generate-a36SaAn4.mjs} +2 -2
  16. package/dist/clis/args/{generate-DLPqkD9L.mjs.map → generate-a36SaAn4.mjs.map} +1 -1
  17. package/dist/clis/args/generate.d.mts +101 -2
  18. package/dist/clis/args/generate.d.mts.map +1 -0
  19. package/dist/clis/args/generate.mjs +1 -1
  20. package/dist/clis/args/{help-B16JXhxy.mjs → help-Cb66IK-J.mjs} +18 -18
  21. package/dist/clis/args/{help-B16JXhxy.mjs.map → help-Cb66IK-J.mjs.map} +1 -1
  22. package/dist/clis/args/help.mjs +14 -1
  23. package/dist/clis/args/host.d.mts +22 -2
  24. package/dist/clis/args/host.d.mts.map +1 -0
  25. package/dist/clis/args/host.mjs +34 -1
  26. package/dist/clis/args/host.mjs.map +1 -0
  27. package/dist/clis/args/index.d.mts +19 -19
  28. package/dist/clis/args/index.mjs +20 -20
  29. package/dist/clis/args/init.d.mts +53 -2
  30. package/dist/clis/args/init.d.mts.map +1 -0
  31. package/dist/clis/args/init.mjs +71 -1
  32. package/dist/clis/args/init.mjs.map +1 -0
  33. package/dist/clis/args/inspect.d.mts +11 -2
  34. package/dist/clis/args/inspect.d.mts.map +1 -0
  35. package/dist/clis/args/inspect.mjs +14 -1
  36. package/dist/clis/args/inspect.mjs.map +1 -0
  37. package/dist/clis/args/install.d.mts +35 -2
  38. package/dist/clis/args/install.d.mts.map +1 -0
  39. package/dist/clis/args/install.mjs +31 -1
  40. package/dist/clis/args/install.mjs.map +1 -0
  41. package/dist/clis/args/list.d.mts +8 -2
  42. package/dist/clis/args/list.d.mts.map +1 -0
  43. package/dist/clis/args/list.mjs +6 -1
  44. package/dist/clis/args/list.mjs.map +1 -0
  45. package/dist/clis/args/login.d.mts +23 -2
  46. package/dist/clis/args/login.d.mts.map +1 -0
  47. package/dist/clis/args/login.mjs +39 -1
  48. package/dist/clis/args/login.mjs.map +1 -0
  49. package/dist/clis/args/mcp.d.mts +14 -2
  50. package/dist/clis/args/mcp.d.mts.map +1 -0
  51. package/dist/clis/args/mcp.mjs +21 -1
  52. package/dist/clis/args/mcp.mjs.map +1 -0
  53. package/dist/clis/args/migrate.d.mts +17 -2
  54. package/dist/clis/args/migrate.d.mts.map +1 -0
  55. package/dist/clis/args/migrate.mjs +27 -1
  56. package/dist/clis/args/migrate.mjs.map +1 -0
  57. package/dist/clis/args/publish.d.mts +14 -2
  58. package/dist/clis/args/publish.d.mts.map +1 -0
  59. package/dist/clis/args/publish.mjs +18 -1
  60. package/dist/clis/args/publish.mjs.map +1 -0
  61. package/dist/clis/args/registry.d.mts +15 -2
  62. package/dist/clis/args/registry.d.mts.map +1 -0
  63. package/dist/clis/args/registry.mjs +22 -1
  64. package/dist/clis/args/registry.mjs.map +1 -0
  65. package/dist/clis/args/run.mjs +27 -1
  66. package/dist/clis/args/run.mjs.map +1 -0
  67. package/dist/clis/args/{service-DiTFThbn.d.mts → service-IZ0Aq58z.d.mts} +2 -2
  68. package/dist/clis/args/{service-DiTFThbn.d.mts.map → service-IZ0Aq58z.d.mts.map} +1 -1
  69. package/dist/clis/args/service.d.mts +1 -1
  70. package/dist/clis/args/service.mjs +10 -1
  71. package/dist/clis/args/service.mjs.map +1 -0
  72. package/dist/clis/args/switchboard.d.mts +68 -2
  73. package/dist/clis/args/switchboard.d.mts.map +1 -0
  74. package/dist/clis/args/switchboard.mjs +84 -1
  75. package/dist/clis/args/switchboard.mjs.map +1 -0
  76. package/dist/clis/args/uninstall.d.mts +26 -2
  77. package/dist/clis/args/uninstall.d.mts.map +1 -0
  78. package/dist/clis/args/uninstall.mjs +15 -1
  79. package/dist/clis/args/uninstall.mjs.map +1 -0
  80. package/dist/clis/args/unpublish.d.mts +20 -2
  81. package/dist/clis/args/unpublish.d.mts.map +1 -0
  82. package/dist/clis/args/unpublish.mjs +29 -1
  83. package/dist/clis/args/unpublish.mjs.map +1 -0
  84. package/dist/clis/args/{vetra-F4zGu_hG.mjs → vetra-DlAEC_Mv.mjs} +2 -2
  85. package/dist/clis/args/{vetra-F4zGu_hG.mjs.map → vetra-DlAEC_Mv.mjs.map} +1 -1
  86. package/dist/clis/args/vetra.d.mts +112 -2
  87. package/dist/clis/args/vetra.d.mts.map +1 -0
  88. package/dist/clis/args/vetra.mjs +1 -1
  89. package/dist/clis/{build-config-tJhHVdPm.mjs → build-config-xZgi0nyb.mjs} +3 -2
  90. package/dist/clis/build-config-xZgi0nyb.mjs.map +1 -0
  91. package/dist/clis/build-config.d.mts.map +1 -1
  92. package/dist/clis/build-config.mjs +1 -1
  93. package/dist/clis/build-pieces.d.mts +1 -1
  94. package/dist/clis/build-pieces.mjs +2 -2
  95. package/dist/clis/build-pieces.mjs.map +1 -1
  96. package/dist/clis/constants.d.mts +1 -1
  97. package/dist/clis/constants.mjs +6 -0
  98. package/dist/clis/constants.mjs.map +1 -1
  99. package/dist/clis/index.d.mts +20 -9
  100. package/dist/clis/index.d.mts.map +1 -1
  101. package/dist/clis/index.mjs +28 -8
  102. package/dist/clis/index.mjs.map +1 -1
  103. package/dist/clis/{types-BKM2kIEW.d.mts → types-DKuZRMVO.d.mts} +6 -1
  104. package/dist/clis/{types-BKM2kIEW.d.mts.map → types-DKuZRMVO.d.mts.map} +1 -1
  105. package/dist/clis/utils.d.mts.map +1 -1
  106. package/dist/clis/utils.mjs.map +1 -1
  107. package/dist/connect/config-loader.d.ts +1 -1
  108. package/dist/connect/connect-config-schema.d.ts +1 -1
  109. package/dist/connect/connect-config-schema.js +1 -1
  110. package/dist/connect/index.d.ts +2 -2
  111. package/dist/connect/origin-placeholder.d.ts +52 -0
  112. package/dist/connect/origin-placeholder.d.ts.map +1 -0
  113. package/dist/connect/origin-placeholder.js +101 -0
  114. package/dist/connect/origin-placeholder.js.map +1 -0
  115. package/dist/{connect-config-schema-hSe_84zI.d.ts → connect-config-schema-CsotSch2.d.ts} +2 -2
  116. package/dist/{connect-config-schema-hSe_84zI.d.ts.map → connect-config-schema-CsotSch2.d.ts.map} +1 -1
  117. package/dist/{constants-4Y5b-joA.d.ts → constants-5UFY_rXh.d.ts} +2 -2
  118. package/dist/constants-5UFY_rXh.d.ts.map +1 -0
  119. package/dist/constants.d.ts +1 -1
  120. package/dist/constants.js +1 -0
  121. package/dist/constants.js.map +1 -1
  122. package/dist/document-drive/index.d.ts +3 -3
  123. package/dist/document-model/dispatch.d.ts +1 -1
  124. package/dist/document-model/errors.d.ts +1 -1
  125. package/dist/document-model/errors.js.map +1 -1
  126. package/dist/document-model/index.d.ts +1 -1
  127. package/dist/host-tokens/index.d.ts +2 -2
  128. package/dist/host-tokens/index.js +2 -278
  129. package/dist/host-tokens-DOeyxqLi.js +322 -0
  130. package/dist/host-tokens-DOeyxqLi.js.map +1 -0
  131. package/dist/{index-DIM6qtzj.d.ts → index-D58WVj_E.d.ts} +21 -2
  132. package/dist/index-D58WVj_E.d.ts.map +1 -0
  133. package/dist/{index-BzueQ7B3.d.ts → index-DrmluGJD.d.ts} +2 -2
  134. package/dist/{index-BzueQ7B3.d.ts.map → index-DrmluGJD.d.ts.map} +1 -1
  135. package/dist/index.d.ts +4 -4
  136. package/dist/processors/index.d.ts +1 -1
  137. package/dist/processors/testing.d.ts +1 -1
  138. package/dist/registry/index.d.ts +2 -2
  139. package/dist/registry/index.js +13 -3
  140. package/dist/registry/index.js.map +1 -1
  141. package/dist/registry/manifest-slim.d.ts +2 -2
  142. package/dist/{types-BoYyqmJ2.d.ts → types-CZ0rTsKm.d.ts} +2 -2
  143. package/dist/{types-BoYyqmJ2.d.ts.map → types-CZ0rTsKm.d.ts.map} +1 -1
  144. package/dist/{types-B1HqOXqL.d.ts → types-VCTwbNTD.d.ts} +3 -3
  145. package/dist/{types-B1HqOXqL.d.ts.map → types-VCTwbNTD.d.ts.map} +1 -1
  146. package/package.json +1 -1
  147. package/dist/clis/args/access-token-C5sKsH2O.d.mts +0 -16
  148. package/dist/clis/args/access-token-C5sKsH2O.d.mts.map +0 -1
  149. package/dist/clis/args/access-token-D28cJ6Ov.mjs +0 -22
  150. package/dist/clis/args/access-token-D28cJ6Ov.mjs.map +0 -1
  151. package/dist/clis/args/common-CHSGBvxM.mjs.map +0 -1
  152. package/dist/clis/args/connect-CmErgUlp.mjs +0 -203
  153. package/dist/clis/args/connect-CmErgUlp.mjs.map +0 -1
  154. package/dist/clis/args/connect-DjeiqXus.d.mts +0 -450
  155. package/dist/clis/args/connect-DjeiqXus.d.mts.map +0 -1
  156. package/dist/clis/args/dist-CorQTQL-.mjs +0 -1533
  157. package/dist/clis/args/dist-CorQTQL-.mjs.map +0 -1
  158. package/dist/clis/args/generate-BPBBLeUD.d.mts +0 -103
  159. package/dist/clis/args/generate-BPBBLeUD.d.mts.map +0 -1
  160. package/dist/clis/args/host-BRXA3WP5.mjs +0 -35
  161. package/dist/clis/args/host-BRXA3WP5.mjs.map +0 -1
  162. package/dist/clis/args/host-BX7KQ0Fp.d.mts +0 -24
  163. package/dist/clis/args/host-BX7KQ0Fp.d.mts.map +0 -1
  164. package/dist/clis/args/init-CTaK80wE.d.mts +0 -55
  165. package/dist/clis/args/init-CTaK80wE.d.mts.map +0 -1
  166. package/dist/clis/args/init-DYFFSkxI.mjs +0 -72
  167. package/dist/clis/args/init-DYFFSkxI.mjs.map +0 -1
  168. package/dist/clis/args/inspect-BjRmtB86.d.mts +0 -13
  169. package/dist/clis/args/inspect-BjRmtB86.d.mts.map +0 -1
  170. package/dist/clis/args/inspect-BniSlWn2.mjs +0 -15
  171. package/dist/clis/args/inspect-BniSlWn2.mjs.map +0 -1
  172. package/dist/clis/args/install-B0tMyUMw.d.mts +0 -37
  173. package/dist/clis/args/install-B0tMyUMw.d.mts.map +0 -1
  174. package/dist/clis/args/install-sBi-hWv6.mjs +0 -32
  175. package/dist/clis/args/install-sBi-hWv6.mjs.map +0 -1
  176. package/dist/clis/args/list-DcBHE_2X.mjs +0 -7
  177. package/dist/clis/args/list-DcBHE_2X.mjs.map +0 -1
  178. package/dist/clis/args/list-DrbxA7JJ.d.mts +0 -10
  179. package/dist/clis/args/list-DrbxA7JJ.d.mts.map +0 -1
  180. package/dist/clis/args/login-C8lWLGqU.mjs +0 -40
  181. package/dist/clis/args/login-C8lWLGqU.mjs.map +0 -1
  182. package/dist/clis/args/login-CXRJXg71.d.mts +0 -25
  183. package/dist/clis/args/login-CXRJXg71.d.mts.map +0 -1
  184. package/dist/clis/args/mcp-9ETsMr71.mjs +0 -22
  185. package/dist/clis/args/mcp-9ETsMr71.mjs.map +0 -1
  186. package/dist/clis/args/mcp-Cl5PPlkl.d.mts +0 -16
  187. package/dist/clis/args/mcp-Cl5PPlkl.d.mts.map +0 -1
  188. package/dist/clis/args/migrate-39GBHGb-.mjs +0 -28
  189. package/dist/clis/args/migrate-39GBHGb-.mjs.map +0 -1
  190. package/dist/clis/args/migrate-DKG-NVd5.d.mts +0 -19
  191. package/dist/clis/args/migrate-DKG-NVd5.d.mts.map +0 -1
  192. package/dist/clis/args/publish-CeW4bOrl.d.mts +0 -16
  193. package/dist/clis/args/publish-CeW4bOrl.d.mts.map +0 -1
  194. package/dist/clis/args/publish-Rtu9dx7q.mjs +0 -19
  195. package/dist/clis/args/publish-Rtu9dx7q.mjs.map +0 -1
  196. package/dist/clis/args/registry-DNH8xuaE.d.mts +0 -17
  197. package/dist/clis/args/registry-DNH8xuaE.d.mts.map +0 -1
  198. package/dist/clis/args/registry-Pt5yN9xS.mjs +0 -23
  199. package/dist/clis/args/registry-Pt5yN9xS.mjs.map +0 -1
  200. package/dist/clis/args/run-l_LiMplO.mjs +0 -28
  201. package/dist/clis/args/run-l_LiMplO.mjs.map +0 -1
  202. package/dist/clis/args/service-B3FHLTcp.mjs +0 -11
  203. package/dist/clis/args/service-B3FHLTcp.mjs.map +0 -1
  204. package/dist/clis/args/switchboard-BXLSuEoC.mjs +0 -85
  205. package/dist/clis/args/switchboard-BXLSuEoC.mjs.map +0 -1
  206. package/dist/clis/args/switchboard-RrNb1fUH.d.mts +0 -70
  207. package/dist/clis/args/switchboard-RrNb1fUH.d.mts.map +0 -1
  208. package/dist/clis/args/uninstall-CDx7lwxn.d.mts +0 -28
  209. package/dist/clis/args/uninstall-CDx7lwxn.d.mts.map +0 -1
  210. package/dist/clis/args/uninstall-ChFF846g.mjs +0 -16
  211. package/dist/clis/args/uninstall-ChFF846g.mjs.map +0 -1
  212. package/dist/clis/args/unpublish-CEDsk6uv.d.mts +0 -22
  213. package/dist/clis/args/unpublish-CEDsk6uv.d.mts.map +0 -1
  214. package/dist/clis/args/unpublish-MW7IKVH6.mjs +0 -30
  215. package/dist/clis/args/unpublish-MW7IKVH6.mjs.map +0 -1
  216. package/dist/clis/args/vetra-CviuwTcH.d.mts +0 -114
  217. package/dist/clis/args/vetra-CviuwTcH.d.mts.map +0 -1
  218. package/dist/clis/args/vetra-ports.test.d.mts +0 -2
  219. package/dist/clis/args/vetra-ports.test.mjs +0 -14887
  220. package/dist/clis/args/vetra-ports.test.mjs.map +0 -1
  221. package/dist/clis/build-config-tJhHVdPm.mjs.map +0 -1
  222. package/dist/constants-4Y5b-joA.d.ts.map +0 -1
  223. package/dist/host-tokens/index.js.map +0 -1
  224. package/dist/index-DIM6qtzj.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-config-tJhHVdPm.mjs","names":[],"sources":["../../connect/shared-deps.ts","../../clis/build-config.mts"],"sourcesContent":["import { satisfies, validRange } from \"semver\";\n\nexport type SharedDep = { specifier: string; package: string };\n\n/**\n * The dependency set Connect and loaded packages share via the import map.\n * `@powerhousedao/connect` is deliberately absent: it is the Connect app, not\n * vendored (a host with routes compiles its files), so its exports are for a\n * host's own routes and layout. Packages share `@powerhousedao/connect-core`.\n */\nexport const SHARED_DEPS: readonly SharedDep[] = [\n { specifier: \"document-model\", package: \"document-model\" },\n {\n specifier: \"@powerhousedao/document-engineering\",\n package: \"@powerhousedao/document-engineering\",\n },\n { specifier: \"@powerhousedao/shared\", package: \"@powerhousedao/shared\" },\n {\n specifier: \"@powerhousedao/shared/registry/urls\",\n package: \"@powerhousedao/shared\",\n },\n {\n specifier: \"@powerhousedao/design-system/connect\",\n package: \"@powerhousedao/design-system\",\n },\n {\n specifier: \"@powerhousedao/reactor-browser\",\n package: \"@powerhousedao/reactor-browser\",\n },\n // Connect already vendors zod (it is in DEFAULT_VENDOR_INCLUDE, so the\n // import map publishes an entry for it) and every generated project already\n // declares it as a peerDependency -- yet it was missing from this set, so\n // each package inlined a private copy anyway. It is the single biggest\n // dependency left in a minimal package.\n { specifier: \"zod\", package: \"zod\" },\n // One core and one router: slots, routes and router context reach every package.\n {\n specifier: \"@powerhousedao/connect-core\",\n package: \"@powerhousedao/connect-core\",\n },\n { specifier: \"@tanstack/react-router\", package: \"@tanstack/react-router\" },\n];\n\nexport const SHARED_DEP_SPECIFIERS: readonly string[] = SHARED_DEPS.map(\n (d) => d.specifier,\n);\n\n/**\n * The `@powerhousedao/shared` subpaths the production vendor bundles. The\n * bare root is deliberately absent: its type barrel references node-only\n * modules (`clis/`), which the current vite/rolldown cannot bundle for the\n * browser — vendoring the root fails the build (a pre-existing latent\n * issue). A package that imports the bare root is simply not shared; it\n * bundles its own copy.\n */\nexport const SHARED_SUBPATHS: readonly string[] = [\n \"connect\",\n \"document-model\",\n \"processors\",\n \"document-drive\",\n \"registry\",\n \"registry/urls\",\n \"registry/manifest-slim\",\n];\n\n/**\n * The specifiers a package build may safely externalize onto the host's\n * import map — i.e. the ones the vendor actually publishes an entry for.\n *\n * `@powerhousedao/shared` is narrowed to SHARED_SUBPATHS rather than taken as\n * a prefix: the bare root is never vendored (see SHARED_SUBPATHS), and\n * neither are its other subpaths (`analytics`, `constants`, `clis`, ...).\n * Externalizing those would leave a bare specifier in the package's output\n * that nothing in the import map resolves, so the package would fail to load\n * at runtime instead of simply bundling its own copy.\n */\nexport const EXTERNALIZABLE_SHARED_SPECIFIERS: readonly string[] = [\n ...new Set([\n ...SHARED_DEP_SPECIFIERS.filter((s) => s !== \"@powerhousedao/shared\"),\n ...SHARED_SUBPATHS.map((s) => `@powerhousedao/shared/${s}`),\n ]),\n];\n\n/** Split a specifier into its package name and subpath (\"\" for a root). */\nexport function parseDepSpec(spec: string): { pkg: string; sub: string } {\n if (spec.startsWith(\"@\")) {\n const parts = spec.split(\"/\");\n return { pkg: parts.slice(0, 2).join(\"/\"), sub: parts.slice(2).join(\"/\") };\n }\n const i = spec.indexOf(\"/\");\n return i === -1\n ? { pkg: spec, sub: \"\" }\n : { pkg: spec.slice(0, i), sub: spec.slice(i + 1) };\n}\n\nfunction isSharedSpecifier(spec: string, specs: readonly string[]): boolean {\n return specs.some((s) => spec === s || spec.startsWith(s + \"/\"));\n}\n\n/**\n * Return the import/export specifiers in `source` that are a shared\n * specifier (or a subpath of one), sorted. Heuristic: only statement\n * positions are scanned (`from \"x\"`, `import \"x\"`, `import(\"x\")`;\n * `export … from \"x\"` is covered by the `from` pattern), so import-like\n * text inside comments or strings can be reported too. That errs toward\n * over-reporting, which is the safe direction for the advisory build\n * warning.\n */\nexport function findSharedImports(\n source: string,\n specs: readonly string[] = SHARED_DEP_SPECIFIERS,\n): string[] {\n const found = new Set<string>();\n const patterns = [\n /\\bfrom\\s+[\"']([^\"'\\\\]+)[\"']/g,\n /\\bimport\\s+[\"']([^\"'\\\\]+)[\"']/g,\n /\\bimport\\s*\\(\\s*[\"']([^\"'\\\\]+)[\"']\\s*\\)/g,\n ];\n for (const re of patterns) {\n for (const m of source.matchAll(re)) {\n const spec = m[1];\n if (isSharedSpecifier(spec, specs)) found.add(spec);\n }\n }\n return [...found].sort();\n}\n\n/**\n * Rewrite a package source for blob import in a worker context (import maps\n * don't apply there): shared specifiers become their mapped URLs, and\n * relative (`./`, `../`) specifiers become absolute against `sourceUrl`\n * (a blob URL has no directory to resolve against). `#` subpath imports are\n * deliberately left alone: they resolve via the package's own\n * `package.json` \"imports\" field, which the rewrite cannot reproduce.\n * Returns the input unchanged when nothing matched.\n */\nexport function rewritePackageSource(\n source: string,\n sourceUrl: string,\n imports: Record<string, string>,\n): string {\n if (!Object.keys(imports).length) return source;\n const base = new URL(sourceUrl);\n const map = (spec: string): string | null => {\n const mapped = imports[spec];\n if (mapped) return mapped;\n if (spec.startsWith(\"./\") || spec.startsWith(\"../\")) {\n return new URL(spec, base).href;\n }\n return null;\n };\n let out = source;\n // The quote character is captured and reused: a source that quotes its\n // specifiers with ' would otherwise never match the replacement and be\n // left un-rewritten — silently, since the specifier still maps.\n for (const re of [\n /\\bfrom\\s+([\"'])([^\"'\\\\]+)\\1/g,\n /\\bimport\\s+([\"'])([^\"'\\\\]+)\\1/g,\n /\\bimport\\s*\\(\\s*([\"'])([^\"'\\\\]+)\\1\\s*\\)/g,\n ]) {\n out = out.replace(re, (match, quote: string, spec: string) => {\n // The match contains the quoted specifier exactly once and the\n // captured group has no quotes/backslashes ([^\"'\\\\]), so a literal\n // replace is safe.\n const mapped = map(spec);\n return mapped\n ? match.replace(`${quote}${spec}${quote}`, `${quote}${mapped}${quote}`)\n : match;\n });\n }\n return out;\n}\n\nexport type SharedDepMismatch = {\n package: string;\n required: string;\n provided: string;\n};\n\nexport type PackageDeps = {\n dependencies?: Record<string, unknown>;\n peerDependencies?: Record<string, unknown>;\n};\n\n/**\n * Compare a package's declared ranges against the host's version table.\n * `hostVersions` defines the checked set (only deps present in it are\n * checked). `*`, non-semver protocols (workspace:, file:, git:, npm:, URLs)\n * and unparseable ranges never mismatch.\n */\nexport function checkSharedDeps(\n pkgJson: PackageDeps,\n hostVersions: Record<string, string>,\n): SharedDepMismatch[] {\n const out: SharedDepMismatch[] = [];\n const entries = [\n ...Object.entries(pkgJson.dependencies ?? {}),\n ...Object.entries(pkgJson.peerDependencies ?? {}),\n ];\n for (const [dep, range] of entries) {\n const provided = hostVersions[dep];\n if (provided === undefined || typeof range !== \"string\") continue;\n if (range === \"*\" || /^[a-z]+:/i.test(range)) continue;\n if (!validRange(range)) continue;\n if (!satisfies(provided, range, { includePrerelease: true })) {\n out.push({ package: dep, required: range, provided });\n }\n }\n return out;\n}\n\nexport function formatSharedDepWarnings(\n mismatches: SharedDepMismatch[],\n): string[] {\n return mismatches.map(\n (m) =>\n `${m.package}: requires ${m.required}, Connect provides ${m.provided}`,\n );\n}\n\n/**\n * Stable filename for a local package's worker model bundle under\n * `__reactor_worker__/packages/`. Shared by the tab (URL computation via the\n * manifest) and the production prebuild (emitted entry names), so the two can\n * never drift. Scoped names flatten (`@scope/name` -> `scope__name`).\n */\nexport function workerPackageFileName(packageName: string): string {\n return `${packageName.replace(/^@/, \"\").replace(/[^\\w.-]+/g, \"__\")}.js`;\n}\n","import { esmExternalRequirePlugin } from \"rolldown/plugins\";\nimport type { InlineConfig } from \"tsdown\";\nimport {\n EXTERNALIZABLE_SHARED_SPECIFIERS,\n findSharedImports,\n} from \"../connect/shared-deps.js\";\n\nconst entry = [\n \"index.ts\",\n \"document-models/index.ts\",\n \"document-models/*/index.ts\",\n \"document-models/*/module.ts\",\n \"editors/index.ts\",\n \"editors/*/index.ts\",\n \"editors/*/module.ts\",\n \"processors/index.ts\",\n];\n\n// ./pieces is node-only for the same reason ./reactor is browser-only: a piece\n// is loaded and run by a host process, never by the browser. Only the list of\n// pieces builds here; each piece is its own build (buildPieceBuildConfig), so\n// two pieces never share a chunk and each ships as one self-contained module.\nconst nodeEntry = [\n ...entry,\n // Node-only: Connect reaches processors through processors/index.ts, and\n // subgraphs only over GraphQL.\n \"processors/*/index.ts\",\n \"subgraphs/index.ts\",\n \"subgraphs/*/index.ts\",\n \"pieces/index.ts\",\n];\n\n// Where a package's pieces live, one directory per piece, as the node entry\n// glob spells it; `ph build` expands it against the project to find them.\nexport const PIECE_ENTRY_GLOB = \"pieces/*/index.ts\";\n\n// ./reactor is browser-only: the SharedWorker needs it, the node build does not.\nexport const browserEntry = [...entry, \"reactor/index.ts\"];\n\nconst alwaysBundle = [\"**\"];\n\n// React must be external so `import ... from \"react\"` stays a bare import and\n// resolves to the host's React at runtime; bundled, a chunk would carry a second\n// React. In the browser build the externals below belong to esmExternalRequirePlugin\n// alone: rolldown converts a CommonJS `require(\"react\")` into an import only for\n// externals the plugin owns, and listed in neverBundle too the top-level external\n// wins, leaving a browser bundle with a require it cannot serve. use-sync-external-store\n// under zustand, and so under @xyflow/react, is the case that found this.\nconst reactExternals = [\n \"react\",\n \"react-dom\",\n \"react/jsx-runtime\",\n \"react-dom/client\",\n];\n\nconst nodeNeverBundle = [\n // we know that we don't want connect inside connect\n \"@powerhousedao/connect\",\n \"@powerhousedao/connect-core\",\n // published code would never need the cli\n \"@powerhousedao/ph-cli\",\n // the reactor-api host must provide a single class identity for\n // BaseSubgraph/BaseProcessor — inlining a copy here breaks the\n // prototype-chain check the package loader uses to detect subgraphs.\n \"@powerhousedao/reactor-api\",\n // react is resolved from esm.sh\n \"react\",\n \"react-dom\",\n \"react/jsx-runtime\",\n \"react-dom/client\",\n // build tools\n \"tailwindcss\",\n \"vitest\",\n \"tsdown\",\n \"@tailwindcss/cli\",\n \"@vitejs/plugin-react\",\n // testing tools\n \"@testing-library/jest-dom\",\n \"@testing-library/react\",\n \"@testing-library/user-event\",\n // types\n \"@types/node\",\n \"@types/react\",\n \"@types/react-dom\",\n // exclude pglite wasm/data chunks\n \"@electric-sql/pglite\",\n \"@electric-sql/pglite-tools\",\n];\n\n// The node build keeps React in neverBundle: node has createRequire, so a\n// CommonJS require of an external resolves there without the plugin.\nconst browserNeverBundle = nodeNeverBundle.filter(\n (spec) => typeof spec !== \"string\" || !reactExternals.includes(spec),\n);\n\nconst copy = [{ from: \"powerhouse.manifest.json\", to: \"dist\" }];\n\n// Images a module imports (a route's hero, an editor's SVG) become data URLs,\n// as Vite's import of an asset is a URL string. Inline, not emitted: Connect\n// loads a package's chunks through its import map, so an emitted file's\n// relative URL would resolve against the page, not the chunk.\nexport const IMAGE_EXTENSIONS = [\n \".apng\",\n \".avif\",\n \".bmp\",\n \".gif\",\n \".ico\",\n \".jpeg\",\n \".jpg\",\n \".png\",\n \".svg\",\n \".webp\",\n] as const;\nconst loader: NonNullable<InlineConfig[\"loader\"]> = Object.fromEntries(\n IMAGE_EXTENSIONS.map((ext) => [ext, \"dataurl\"]),\n);\n\nconst config = false;\nconst clean = true;\n// types are emitted via a separate tsc command\nconst dts = false;\nconst sourcemap = true;\n\n// Shared deps are externalized from every package build: the host (Connect)\n// resolves them to one bundled copy via the import map, so a package must\n// not inline its own copy (two instances of the same dep break identity\n// checks and double the download). One regexp per specifier covers the root\n// and every subpath (rolldown `external` accepts strings and regexps, not\n// function matchers, in this toolchain).\n//\n// Only the specifiers the vendor publishes are externalized — see\n// EXTERNALIZABLE_SHARED_SPECIFIERS. Externalizing one the import map has no\n// entry for would leave an unresolvable bare specifier in the output.\nconst sharedNeverBundle = EXTERNALIZABLE_SHARED_SPECIFIERS.map(\n (s) => new RegExp(`^${s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}(/.*)?$`),\n);\n\ntype Plugin = NonNullable<InlineConfig[\"plugins\"]>;\n\nconst SWITCHBOARD_PROCESSORS_STUB = \"\\0powerhouse:switchboard-processors\";\n\n// Connect runs processors with processorApp \"connect\", so the generated\n// factory's import of ./switchboard gets an empty list in the browser build.\nfunction switchboardProcessorsStub(): Plugin {\n return {\n name: \"powerhouse:switchboard-processors-stub\",\n resolveId(source, importer) {\n if (!importer || !/^\\.\\/switchboard(\\.[cm]?[jt]s)?$/.test(source)) {\n return null;\n }\n const path = importer.replaceAll(\"\\\\\", \"/\");\n const isFactory =\n /(^|\\/)processors\\/factory\\.[cm]?[jt]s$/.test(path) &&\n !path.includes(\"/node_modules/\");\n return isFactory ? SWITCHBOARD_PROCESSORS_STUB : null;\n },\n load(id) {\n return id === SWITCHBOARD_PROCESSORS_STUB\n ? \"export const processorFactoryBuilders = [];\"\n : null;\n },\n };\n}\n\nconst baseBrowserConfig = {\n entry: browserEntry,\n platform: \"browser\" as const,\n copy,\n loader,\n config,\n clean,\n dts,\n sourcemap,\n plugins: [\n esmExternalRequirePlugin({\n external: reactExternals,\n skipDuplicateCheck: true,\n }),\n switchboardProcessorsStub(),\n ],\n inputOptions: {\n experimental: { resolveNewUrlToAsset: true },\n },\n};\n\nconst pluginList = (plugins: InlineConfig[\"plugins\"]) =>\n plugins === undefined ? [] : Array.isArray(plugins) ? plugins : [plugins];\n\nexport type BrowserBuildConfigOptions = {\n /** Externalize the shared dependency set (default: true). */\n sharedDeps?: boolean;\n /** Extra bundler plugins, such as the external dependency guard. */\n plugins?: InlineConfig[\"plugins\"];\n /** Inline every dependency (default: true), as a package Connect loads from\n * the CDN needs. False leaves declared dependencies to the app that bundles it. */\n bundleDependencies?: boolean;\n};\n\n// A dependency's stylesheet stays bundled, so `style.css` keeps the vendor CSS.\nconst stylesheets = [/\\.css$/];\n\nexport function buildBrowserBuildConfig(\n options: BrowserBuildConfigOptions = {},\n): InlineConfig {\n const sharedDeps = options.sharedDeps ?? true;\n return {\n ...baseBrowserConfig,\n plugins: [...baseBrowserConfig.plugins, ...pluginList(options.plugins)],\n deps: {\n alwaysBundle:\n (options.bundleDependencies ?? true) ? alwaysBundle : stylesheets,\n neverBundle: [\n ...browserNeverBundle,\n ...(sharedDeps ? sharedNeverBundle : []),\n ],\n },\n };\n}\n\n// Kept for existing callers: the default (shared deps externalized).\nexport const browserBuildConfig = buildBrowserBuildConfig();\n\n/**\n * Shared specs a source imports but the built output no longer references as\n * bare imports — the bundler inlined them, which is exactly what the\n * external set is meant to prevent.\n */\nexport function findBundledSharedDeps(\n importedSpecs: string[],\n outputs: readonly { path: string; content: string }[],\n): string[] {\n return importedSpecs.filter(\n (spec) =>\n !outputs.some((f) => findSharedImports(f.content, [spec]).includes(spec)),\n );\n}\n\nexport type NodeBuildConfigOptions = {\n /** Externalize the shared dependency set (default: true). */\n sharedDeps?: boolean;\n /** Extra bundler plugins, such as the external dependency detector. */\n plugins?: InlineConfig[\"plugins\"];\n};\n\n/**\n * The node build externalizes the same shared set as the browser build, for\n * the same reason the `@powerhousedao/reactor-api` entry in `nodeNeverBundle`\n * already gives: the host provides these, and a package carrying its own copy\n * is a second class identity as well as dead weight. What differs is only how\n * the import is resolved at runtime -- Connect's import map in the browser,\n * ordinary node resolution here, which works because these are declared for\n * the consumer to provide (`document-model`, `@powerhousedao/reactor-browser`\n * and `zod` are peerDependencies of every generated project).\n */\nexport function buildNodeBuildConfig(\n options: NodeBuildConfigOptions = {},\n): InlineConfig {\n const sharedDeps = options.sharedDeps ?? true;\n return {\n entry: nodeEntry,\n deps: {\n alwaysBundle,\n neverBundle: [\n ...nodeNeverBundle,\n ...(sharedDeps ? sharedNeverBundle : []),\n ],\n },\n platform: \"node\",\n ...(options.plugins ? { plugins: options.plugins } : {}),\n loader,\n config,\n clean,\n dts,\n sourcemap,\n };\n}\n\n// Kept for existing callers: the default (shared deps externalized).\nexport const nodeBuildConfig: InlineConfig = buildNodeBuildConfig();\n\nexport type PieceBuildConfigOptions = {\n /** The piece's source entry, relative to the project: `pieces/<dir>/index.ts`. */\n entry: string;\n /** Where the piece lands: `<outDir>/node/pieces/<dir>`. */\n outDir: string;\n /** Extra bundler plugins, such as the external dependency detector. */\n plugins?: InlineConfig[\"plugins\"];\n};\n\n/**\n * One piece, bundled whole. A piece runs in a forked worker with no\n * node_modules beside it, so nothing the piece imports can be left to the\n * host: the framework, its dependencies and the shared set that every other\n * module kind externalizes are all inlined here, and only node built-ins stay\n * external. Code splitting is off for the same reason, so a dynamic import is\n * inlined too and the piece directory holds exactly one module.\n */\nexport function buildPieceBuildConfig(\n options: PieceBuildConfigOptions,\n): InlineConfig {\n return {\n entry: { index: options.entry },\n outDir: options.outDir,\n platform: \"node\",\n ...(options.plugins ? { plugins: options.plugins } : {}),\n deps: {\n alwaysBundle,\n neverBundle: [],\n // Inlining dependencies is the point here, so tsdown's hint about it\n // would only be noise on every piece.\n onlyBundle: false,\n },\n outputOptions: { codeSplitting: false },\n // The worker runs without source maps, so a map would only be shipped twice\n minify: true,\n config,\n clean,\n dts,\n sourcemap: false,\n };\n}\n"],"mappings":";;AA2CA,MAAa,wBAA2C;CAhCtD;EAAE,WAAW;EAAkB,SAAS;CAAiB;CACzD;EACE,WAAW;EACX,SAAS;CACX;CACA;EAAE,WAAW;EAAyB,SAAS;CAAwB;CACvE;EACE,WAAW;EACX,SAAS;CACX;CACA;EACE,WAAW;EACX,SAAS;CACX;CACA;EACE,WAAW;EACX,SAAS;CACX;CAMA;EAAE,WAAW;EAAO,SAAS;CAAM;CAEnC;EACE,WAAW;EACX,SAAS;CACX;CACA;EAAE,WAAW;EAA0B,SAAS;CAAyB;AAGnB,CAAA,CAAY,KACjE,MAAM,EAAE,SACX;;;;;;;;;AAUA,MAAa,kBAAqC;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;AAaA,MAAa,mCAAsD,CACjE,mBAAG,IAAI,IAAI,CACT,GAAG,sBAAsB,QAAQ,MAAM,MAAM,uBAAuB,GACpE,GAAG,gBAAgB,KAAK,MAAM,yBAAyB,GAAG,CAC5D,CAAC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C,SAAS,IAAI,CAAC,CAC5E;AACF;;;;;;;;;;;AAmBA,SAAgB,qBACd,UAAkC,CAAC,GACrB;CACd,MAAM,aAAa,QAAQ,cAAc;CACzC,OAAO;EACL,OAAO;EACP,MAAM;GACJ;GACA,aAAa,CACX,GAAG,iBACH,GAAI,aAAa,oBAAoB,CAAC,CACxC;EACF;EACA,UAAU;EACV,GAAI,QAAQ,UAAU,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACtD;EACA;EACA;EACA;EACA;CACF;AACF;AAGA,MAAa,kBAAgC,qBAAqB;;;;;;;;;AAmBlE,SAAgB,sBACd,SACc;CACd,OAAO;EACL,OAAO,EAAE,OAAO,QAAQ,MAAM;EAC9B,QAAQ,QAAQ;EAChB,UAAU;EACV,GAAI,QAAQ,UAAU,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACtD,MAAM;GACJ;GACA,aAAa,CAAC;GAGd,YAAY;EACd;EACA,eAAe,EAAE,eAAe,MAAM;EAEtC,QAAQ;EACR;EACA;EACA;EACA,WAAW;CACb;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-4Y5b-joA.d.ts","names":[],"sources":["../constants.ts"],"mappings":";cACa;cAwCA;cACA;cAKA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../host-tokens/index.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Output tokens (typed-host-configs G3): plain-JSON operators a host file\n * uses to consume values another host's creation produces. An object whose\n * SOLE key is one of TOKEN_KEYS is an operator; `$$` escapes a literal\n * `$`-prefixed sole key. Host-core fields accept them through `tokenable()`\n * (declared form); host-core's `resolveHostOutputs` replaces them before a\n * verb runs, and `validateHost` rejects any that remain.\n *\n * `@powerhousedao/shared/host-tokens`: zod only, no `node:` import (a test\n * walks the import graph), so Connect's config schema (../connect/) can\n * declare token-able fields; `@powerhousedao/host-core` re-exports all of it.\n */\n\nexport type OutputPath = (string | number)[];\n\n/* The phantom brand key `\"~value\"` of `OutputToken<T>` / `ItemToken<T>` (type level\n * only; no runtime object has it). A STRING key, not a `unique symbol`: the\n * dts bundler copies this file into more than one chunk (`./schema` and\n * `.`), and two `unique symbol`s would make two unrelated brands, so an\n * `ItemToken<string>` from `outputs.d.ts` (`./schema`) would fit a boolean\n * field typed through `.`. */\n\n/** `{ $output: { host, member?, path } }` — the value at `path` in that\n * host's outputs. `T` is a phantom brand for generated `outputs.d.ts`. */\nexport interface OutputToken<T = unknown> {\n $output: { host: string; member?: string; path: OutputPath };\n readonly \"~value\"?: T;\n}\n\n/** `{ $concat: [...] }` — a string; every part resolves to string|number. */\nexport interface ConcatToken {\n $concat: (string | number | Token)[];\n}\n\n/** `$item` inside a `$map` template: the current element (innermost map, or\n * the named outer binding). */\nexport interface ItemToken<T = unknown> {\n $item: OutputPath | { as: string; path: OutputPath };\n readonly \"~value\"?: T;\n}\n\n/** `$key` inside a `$map` template: the current key (`true` = innermost). */\nexport interface KeyToken {\n $key: true | string;\n}\n\n/** `{ $map: { over, as?, to, into? } }`: `to` rendered once per element of\n * `over` (arrays in order, records key-sorted); an array, or a record\n * keeping the input keys with `into: \"record\"` (3.3). */\nexport interface MapToken<To = unknown> {\n $map: {\n over: OutputToken | ItemToken;\n as?: string;\n to: To;\n into?: \"record\";\n };\n}\n\n/** `{ $env: \"NAME\" }` or `{ $env: { name, optional: true } }`. */\nexport interface EnvToken {\n $env: string | { name: string; optional: true };\n}\n\nexport type Token =\n | OutputToken\n | ConcatToken\n | MapToken\n | ItemToken\n | KeyToken\n | EnvToken;\n\nexport const TOKEN_KEYS = [\n \"$output\",\n \"$concat\",\n \"$map\",\n \"$item\",\n \"$key\",\n \"$env\",\n] as const;\n\nexport type TokenKey = (typeof TOKEN_KEYS)[number];\n\n/** The escape key: `{ $$: { $output: … } }` is the literal object. */\nexport const TOKEN_ESCAPE_KEY = \"$$\";\n\n/* ------------------------------------------------------------- field typing */\n\n/** A value with the (untyped) tokens of its own union removed: what a\n * token in that position must produce. */\ntype Untokened<T> = Exclude<T, Token>;\n\n/** What `{ $key: true }` reads inside a `$map` template: the innermost\n * map's key, a number over an array and a string over a record. */\ntype MapKey = string | number;\n\n/** A branded array `over` (an `ItemToken<X[]>` from outputs.d.ts). */\ntype ArrayOver =\n | OutputToken<readonly unknown[]>\n | ItemToken<readonly unknown[]>;\n/** A branded record `over`. An array does not fit it (no string index). */\ntype RecordOver =\n | OutputToken<Readonly<Record<string, unknown>>>\n | ItemToken<Readonly<Record<string, unknown>>>;\n\n/**\n * `$map` producing an array of `E` (no `into`). `$key: true` in `to` reads\n * a number over an array and a string over a record, so its slot is typed\n * by the `over`: a branded array `over` keeps `$key` out of string slots.\n * A hand-written `$output` literal carries no brand and fits both forms;\n * there, a misplaced `$key` fails at resolved validation instead.\n */\nexport type ArrayMapToken<E> =\n | {\n $map: {\n over: ArrayOver;\n as?: string;\n to: Template<E, number>;\n into?: never;\n };\n }\n | {\n $map: {\n over: RecordOver;\n as?: string;\n to: Template<E, string>;\n into?: never;\n };\n };\n\n/** `$map` producing a record of `V` (`into: \"record\"`, record `over`). */\nexport interface RecordMapToken<V> {\n $map: {\n over: RecordOver;\n as?: string;\n to: Template<V, string>;\n into: \"record\";\n };\n}\n\ntype MapTokenFor<T> = T extends readonly unknown[]\n ? ArrayMapToken<T[number]>\n : T extends object\n ? string extends keyof T\n ? RecordMapToken<T[string & keyof T]>\n : never\n : never;\n\n/** `true` when some member of `K` fits `T` (else `never`). */\ntype SomeFits<K, T> = K extends T ? true : never;\n\n/** The `$key` tokens that fit `T`: `{ $key: true }` (the innermost map's\n * key, typed `K`) and `{ $key: \"<as>\" }` (a named outer map's key, whose\n * type is not tracked: a string or a number). */\ntype KeyTokenFor<T, K extends MapKey> =\n | ([SomeFits<K, T>] extends [never] ? never : { $key: true })\n | ([SomeFits<MapKey, T>] extends [never] ? never : { $key: string });\n\n/**\n * The tokens that may stand where a value of type `T` is expected:\n * `$output`/`$item` whose (branded) value fits `T` (a hand-written literal\n * carries no brand and fits anywhere; the loader checks its path),\n * `$concat`/`$env` where a string fits, `$key` where the key fits (`K`: the\n * innermost `$map`'s key type inside a template), and `$map` where `T` is\n * an array (or, `into: \"record\"`, a record).\n */\nexport type TokenFor<T, K extends MapKey = MapKey> = unknown extends T\n ? Token\n :\n | OutputToken<T>\n | ItemToken<T>\n | (string extends T ? ConcatToken | EnvToken : never)\n | KeyTokenFor<T, K>\n | MapTokenFor<T>;\n\n/**\n * A `$map` template for an element of type `T`: `T`'s shape with a fitting\n * token allowed at EVERY position (the rendered element is validated\n * against the field's schema after resolution, so non-ref fields such as a\n * drive `slug` may take `$key`/`$item` here). `K` is the type `$key: true`\n * reads (see {@link ArrayMapToken}).\n */\nexport type Template<T, K extends MapKey = MapKey> =\n | TokenFor<Untokened<T>, K>\n | TemplateShape<Untokened<T>, K>;\n\ntype TemplateShape<T, K extends MapKey> = T extends readonly unknown[]\n ? Template<T[number], K>[]\n : T extends object\n ? { [P in keyof T]: TemplateSlot<T[P], K> }\n : T;\n\n/** One property of a template. Its tokens may produce `undefined` where\n * the property is optional (a codegen'd `ItemToken<X | undefined>`: the\n * rendered property is then left out), but the property is never written\n * as a literal `undefined`: a host file is JSON, so an optional property is\n * omitted instead (enforced by the type under exactOptionalPropertyTypes,\n * which generated hosts/tsconfig.json enables). */\ntype TemplateSlot<V, K extends MapKey> =\n | TokenFor<Untokened<V>, K>\n | TemplateShape<Exclude<Untokened<V>, undefined>, K>;\n\n/* ------------------------------------------------------------------ schemas */\n\nconst outputPathSchema = z.array(z.union([z.string(), z.number().int()]));\n\nexport const outputTokenSchema = z.strictObject({\n $output: z.strictObject({\n host: z.string().min(1),\n member: z.string().min(1).optional(),\n path: outputPathSchema,\n }),\n});\n\nexport const itemTokenSchema = z.strictObject({\n $item: z.union([\n outputPathSchema,\n z.strictObject({ as: z.string().min(1), path: outputPathSchema }),\n ]),\n});\n\nexport const keyTokenSchema = z.strictObject({\n $key: z.union([z.literal(true), z.string().min(1)]),\n});\n\nexport const envTokenSchema = z.strictObject({\n $env: z.union([\n z.string().min(1),\n z.strictObject({ name: z.string().min(1), optional: z.literal(true) }),\n ]),\n});\n\nexport const mapTokenSchema = z.strictObject({\n $map: z.strictObject({\n over: z.union([outputTokenSchema, itemTokenSchema]),\n as: z.string().min(1).optional(),\n to: z.unknown(),\n into: z.literal(\"record\").optional(),\n }),\n});\n\n// $concat parts may themselves be tokens: the recursive member is lazy.\nexport const concatTokenSchema: z.ZodType<ConcatToken, ConcatToken> =\n z.strictObject({\n $concat: z.array(\n z.union([z.string(), z.number(), z.lazy(() => tokenSchema)]),\n ),\n });\n\nexport const tokenSchema: z.ZodType<Token, Token> = z.union([\n outputTokenSchema,\n concatTokenSchema,\n mapTokenSchema,\n itemTokenSchema,\n keyTokenSchema,\n envTokenSchema,\n]);\n\n/* ---------------------------------------------------------------- detection */\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n return false;\n }\n const proto: unknown = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/** The operator key of a token-shaped value (sole key among TOKEN_KEYS), or\n * undefined. Shape-level only: the operand is not validated here. */\nexport function tokenKeyOf(value: unknown): TokenKey | undefined {\n if (!isPlainObject(value)) return undefined;\n const keys = Object.keys(value);\n if (keys.length !== 1) return undefined;\n return TOKEN_KEYS.find((key) => key === keys[0]);\n}\n\nexport function isToken(value: unknown): boolean {\n return tokenKeyOf(value) !== undefined;\n}\n\n/** The path (`a.b[2].c`) of the first token in a JSON-shaped value, or\n * undefined. A `$$` escape hides its operand from the walk. */\nexport function findToken(\n value: unknown,\n trail = \"\",\n): { path: string; key: TokenKey } | undefined {\n const key = tokenKeyOf(value);\n if (key) return { path: trail || \"<root>\", key };\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const hit = findToken(value[i], `${trail}[${i}]`);\n if (hit) return hit;\n }\n return undefined;\n }\n if (!isPlainObject(value)) return undefined;\n const keys = Object.keys(value);\n if (keys.length === 1 && keys[0] === TOKEN_ESCAPE_KEY) return undefined;\n for (const [childKey, child] of Object.entries(value)) {\n const hit = findToken(child, trail ? `${trail}.${childKey}` : childKey);\n if (hit) return hit;\n }\n return undefined;\n}\n\n/* ------------------------------------------------------- $map placement */\n\n// A `$map` renders an array (a record with `into: \"record\"`), so it fits\n// only a field holding one. Token-able fields accept every token shape at\n// runtime (the field's own schema checks the rendered value at resolved\n// validation); this check catches a `$map` in a non-collection field at\n// DECLARED validation instead, inside `$map` templates too (their `to` is\n// not parsed until rendered).\n\n/** The value schema behind a token-able field (`ref` / `tokenable`), so a\n * template can be checked against what its fields hold. */\nconst tokenableValue = new WeakMap<object, unknown>();\n\ntype ZodDef = Record<string, unknown> & { type: string };\n\nfunction defOf(schema: unknown): ZodDef | undefined {\n if (schema === null || typeof schema !== \"object\") return undefined;\n const internals = (schema as { _zod?: unknown })._zod;\n if (internals === null || typeof internals !== \"object\") return undefined;\n const def = (internals as { def?: unknown }).def;\n if (def === null || typeof def !== \"object\") return undefined;\n const type = (def as { type?: unknown }).type;\n return typeof type === \"string\" ? { ...def, type } : undefined;\n}\n\nconst WRAPPERS = new Set([\n \"optional\",\n \"nullable\",\n \"default\",\n \"prefault\",\n \"readonly\",\n \"nonoptional\",\n \"catch\",\n]);\n\nconst SCALARS = new Set([\n \"string\",\n \"number\",\n \"int\",\n \"boolean\",\n \"bigint\",\n \"date\",\n \"enum\",\n \"literal\",\n \"null\",\n \"nan\",\n \"template_literal\",\n]);\n\n/** What a field holds, as far as its schema tells. */\ntype FieldShape =\n | { kind: \"array\"; element: unknown }\n | { kind: \"record\"; value: unknown }\n | { kind: \"object\"; shape: Record<string, unknown> }\n | { kind: \"scalar\"; type: string }\n | { kind: \"unknown\" };\n\n/** `schema` without wrappers: optional & co, lazy, a pipe's input, a\n * token-able field's token branch and a one-option union. */\nfunction unwrapField(schema: unknown): unknown {\n let current = schema;\n for (let guard = 0; guard < 32; guard++) {\n if (\n current !== null &&\n typeof current === \"object\" &&\n tokenableValue.has(current)\n ) {\n current = tokenableValue.get(current);\n continue;\n }\n const def = defOf(current);\n if (!def) return current;\n if (WRAPPERS.has(def.type)) current = def.innerType;\n else if (def.type === \"lazy\" && typeof def.getter === \"function\") {\n current = (def.getter as () => unknown)();\n } else if (def.type === \"pipe\") current = def.in;\n else if (\n def.type === \"union\" &&\n Array.isArray(def.options) &&\n def.options.length === 1\n ) {\n current = def.options[0];\n } else return current;\n }\n return current;\n}\n\nfunction fieldShapeOf(schema: unknown): FieldShape {\n const def = defOf(unwrapField(schema));\n if (!def) return { kind: \"unknown\" };\n if (def.type === \"array\") return { kind: \"array\", element: def.element };\n if (def.type === \"tuple\") return { kind: \"array\", element: undefined };\n if (def.type === \"record\") return { kind: \"record\", value: def.valueType };\n if (def.type === \"object\") {\n const shape = isPlainObject(def.shape) ? def.shape : {};\n const catchall = defOf(def.catchall);\n if (catchall && catchall.type !== \"never\") {\n return {\n kind: \"record\",\n value: Object.keys(shape).length === 0 ? def.catchall : undefined,\n };\n }\n return { kind: \"object\", shape };\n }\n if (SCALARS.has(def.type)) return { kind: \"scalar\", type: def.type };\n return { kind: \"unknown\" };\n}\n\ninterface PlacementIssue {\n path: (string | number)[];\n message: string;\n}\n\n/** Every `$map` in `value` (a field value, or a template inside one) that\n * renders a collection its field cannot hold. Paths end at the `$map`\n * operand (`…url.$map`), whose message the host error keeps. */\nfunction mapPlacementIssues(\n value: unknown,\n schema: unknown,\n path: (string | number)[],\n issues: PlacementIssue[],\n): void {\n const key = tokenKeyOf(value);\n if (key === \"$map\") {\n const operand = (value as { $map: unknown }).$map;\n if (!isPlainObject(operand)) return; // malformed: reported elsewhere\n const into = operand.into === \"record\";\n const field = fieldShapeOf(schema);\n const at = [...path, \"$map\"];\n const renders = into ? 'a record (into: \"record\")' : \"an array\";\n if (field.kind === \"scalar\" || field.kind === \"object\") {\n const holds = field.kind === \"object\" ? \"an object\" : `a ${field.type}`;\n issues.push({\n path: at,\n message: `a $map renders ${renders}, but this field holds ${holds}. A $map fills only a list field (or, with into: \"record\", a record field).`,\n });\n return;\n }\n if (field.kind === \"array\" && into) {\n issues.push({\n path: at,\n message:\n 'a $map with into: \"record\" renders a record, but this field holds an array. Drop into: \"record\".',\n });\n return;\n }\n if (field.kind === \"record\" && !into) {\n issues.push({\n path: at,\n message:\n 'a $map renders an array, but this field holds a record. Add into: \"record\" (and map over a record).',\n });\n return;\n }\n const element =\n field.kind === \"array\"\n ? field.element\n : field.kind === \"record\"\n ? field.value\n : undefined;\n if (element !== undefined) {\n mapPlacementIssues(operand.to, element, [...at, \"to\"], issues);\n }\n return;\n }\n if (key) return;\n if (Array.isArray(value)) {\n const field = fieldShapeOf(schema);\n if (field.kind !== \"array\" || field.element === undefined) return;\n value.forEach((item, index) =>\n mapPlacementIssues(item, field.element, [...path, index], issues),\n );\n return;\n }\n if (!isPlainObject(value)) return;\n const keys = Object.keys(value);\n if (keys.length === 1 && keys[0] === TOKEN_ESCAPE_KEY) return;\n const field = fieldShapeOf(schema);\n for (const [childKey, child] of Object.entries(value)) {\n const childSchema =\n field.kind === \"object\"\n ? field.shape[childKey]\n : field.kind === \"record\"\n ? field.value\n : undefined;\n if (childSchema !== undefined) {\n mapPlacementIssues(child, childSchema, [...path, childKey], issues);\n }\n }\n}\n\n/** Adds the `$map` placement check to a token-able field's union. Only a\n * value the union accepted reaches it, so a `$map` here came through the\n * token branch. */\nfunction withMapPlacement<U extends z.ZodType>(schema: z.ZodType, union: U): U {\n const checked = union.superRefine((value, ctx) => {\n if (tokenKeyOf(value) !== \"$map\") return;\n const issues: PlacementIssue[] = [];\n mapPlacementIssues(value, schema, [], issues);\n for (const issue of issues) {\n ctx.addIssue({\n code: \"custom\",\n path: issue.path,\n message: issue.message,\n });\n }\n });\n tokenableValue.set(checked, schema);\n return checked;\n}\n\n/* ---------------------------------------------------------------------- ref */\n\n/** A token-able field: `T | Token` (declared form). Host schemas take it\n * through `makeHostSchemas`' ref function; plugin configSchemas use it\n * directly. */\nexport function ref<S extends z.ZodType>(\n schema: S,\n): z.ZodUnion<[S, z.ZodType<Token, TokenFor<Untokened<z.input<S>>>>]> {\n // Same runtime schema; the token option's INPUT type is narrowed to the\n // tokens that fit the field (its output stays `Token`).\n const token = tokenSchema as z.ZodType<\n Token,\n TokenFor<Untokened<z.input<S>>>\n >;\n return withMapPlacement(schema, z.union([schema, token]));\n}\n\n/** Resolved form of a ref field: tokens are not accepted. */\nexport function forbidRef<S extends z.ZodType>(schema: S): S {\n return schema;\n}\n\nexport type TokenMode = \"allow\" | \"forbid\";\nexport type RefFn = typeof ref | typeof forbidRef;\n\n/** A token-able host field as runners see it: authors may write `T | Token`\n * (z.input), verbs receive `T` (z.output). */\nexport type TokenableSchema<\n S extends z.ZodType,\n K = TokenFor<Untokened<z.input<S>>>,\n> = z.ZodType<z.output<S>, z.input<S> | K>;\n\n/** A schema set's wrapper for its token-able fields: `tokenable` in the\n * declared form, a plain one-option union in the resolved form (host-core's\n * `s.tokenable`). Both share this static type: declared input, resolved\n * output. */\nexport type TokenField = <S extends z.ZodType>(schema: S) => TokenableSchema<S>;\n\n// The token branch's output is `never`, so a field's z.output stays the\n// resolved type. At runtime a token passes through untouched: declared\n// validation accepts it here, and validateHost's no-token walk (plus\n// resolveHostOutputs before it) guarantees a verb never receives one.\nconst passthrough = <K extends Token>(schema: z.ZodType<K, K>) =>\n schema.pipe(z.custom<never>());\n\n/**\n * The host-core field wrapper (declared input, resolved output): accepts\n * `T` or an output token that fits it (`TokenFor<T>`: `$output`, `$concat`,\n * `$env`, `$map` for a collection, …). Plugin\n * configSchemas keep using `ref()`; this is for schemas whose verbs must see\n * resolved types (the base host schemas every runner extends).\n */\nexport function tokenable<S extends z.ZodType>(schema: S): TokenableSchema<S> {\n // Every token passes at runtime (declared validation checks paths and\n // bindings; resolved validation the values); the static input admits only\n // the tokens that fit the field (`TokenFor`).\n const token = passthrough(tokenSchema) as z.ZodType<\n never,\n TokenFor<Untokened<z.input<S>>>\n >;\n return withMapPlacement(schema, z.union([schema, token]));\n}\n\n/** Like `tokenable`, but the only token accepted is `$env` (e.g.\n * `storage.dataDir`: a path is an environment fact, never another host's\n * output). */\nexport function envTokenable<S extends z.ZodType>(\n schema: S,\n): TokenableSchema<S, EnvToken> {\n return z.union([schema, passthrough<EnvToken>(envTokenSchema)]);\n}\n"],"mappings":";;AAyEA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;AACF;;AAKA,MAAa,mBAAmB;AAwHhC,MAAM,mBAAmB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAExE,MAAa,oBAAoB,EAAE,aAAa,EAC9C,SAAS,EAAE,aAAa;CACtB,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACtB,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CACnC,MAAM;AACR,CAAC,EACH,CAAC;AAED,MAAa,kBAAkB,EAAE,aAAa,EAC5C,OAAO,EAAE,MAAM,CACb,kBACA,EAAE,aAAa;CAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,MAAM;AAAiB,CAAC,CAClE,CAAC,EACH,CAAC;AAED,MAAa,iBAAiB,EAAE,aAAa,EAC3C,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,IAAI,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EACpD,CAAC;AAED,MAAa,iBAAiB,EAAE,aAAa,EAC3C,MAAM,EAAE,MAAM,CACZ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,GAChB,EAAE,aAAa;CAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,UAAU,EAAE,QAAQ,IAAI;AAAE,CAAC,CACvE,CAAC,EACH,CAAC;AAED,MAAa,iBAAiB,EAAE,aAAa,EAC3C,MA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