@powerhousedao/ph-cli 6.2.3-dev.58 → 6.2.3-dev.59

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 (49) hide show
  1. package/dist/{cli-connect-override-DGXyoqdV.mjs → cli-connect-override-65mFEDEB.mjs} +4 -4
  2. package/dist/{cli-connect-override-DGXyoqdV.mjs.map → cli-connect-override-65mFEDEB.mjs.map} +1 -1
  3. package/dist/cli.mjs +4 -4
  4. package/dist/{connect-build-EYGNSUc_.mjs → connect-build-D9zrBKG4.mjs} +4 -4
  5. package/dist/{connect-build-EYGNSUc_.mjs.map → connect-build-D9zrBKG4.mjs.map} +1 -1
  6. package/dist/{connect-config-BDmghUZF.mjs → connect-config-C1tf7DqD.mjs} +4 -4
  7. package/dist/{connect-config-BDmghUZF.mjs.map → connect-config-C1tf7DqD.mjs.map} +1 -1
  8. package/dist/{connect-studio-CM4t2tWz.mjs → connect-studio-BbsQuED_.mjs} +3 -3
  9. package/dist/{connect-studio-sc-e0xBI.mjs → connect-studio-Q93rzqnC.mjs} +4 -4
  10. package/dist/{connect-studio-sc-e0xBI.mjs.map → connect-studio-Q93rzqnC.mjs.map} +1 -1
  11. package/dist/{dist-BVyjAjXL.mjs → dist-D5lAfbKQ.mjs} +55 -5
  12. package/dist/dist-D5lAfbKQ.mjs.map +1 -0
  13. package/dist/explain-BHB_4rJ3.mjs +27 -0
  14. package/dist/explain-BHB_4rJ3.mjs.map +1 -0
  15. package/dist/host-schemas-CL_wFpY7-DOvIjrBA.mjs +478 -0
  16. package/dist/host-schemas-CL_wFpY7-DOvIjrBA.mjs.map +1 -0
  17. package/dist/{index-s1ABBFjB.d.mts → index-CApW1xbO.d.mts} +3 -3
  18. package/dist/{index-s1ABBFjB.d.mts.map → index-CApW1xbO.d.mts.map} +1 -1
  19. package/dist/ph-cli-commands-BxKtXZgb.mjs +4 -0
  20. package/dist/{ph-cli-commands-D5W9l8Or.mjs → ph-cli-commands-DGOKk392.mjs} +21 -8
  21. package/dist/{ph-cli-commands-D5W9l8Or.mjs.map → ph-cli-commands-DGOKk392.mjs.map} +1 -1
  22. package/dist/{host-schemas-C_MLcYX6-B2qQIdZ-.mjs → plugins-DtJUVtyg.mjs} +200 -308
  23. package/dist/plugins-DtJUVtyg.mjs.map +1 -0
  24. package/dist/reactor-env-D9p2G8jW.mjs +4 -0
  25. package/dist/{reactor-env-CtavpGtJ.mjs → reactor-env-Da_bfekg.mjs} +4 -4
  26. package/dist/{reactor-env-CtavpGtJ.mjs.map → reactor-env-Da_bfekg.mjs.map} +1 -1
  27. package/dist/{run-sugar-Dqn7up5U.mjs → run-sugar-Dq3ZrLL_.mjs} +4 -4
  28. package/dist/{run-sugar-Dqn7up5U.mjs.map → run-sugar-Dq3ZrLL_.mjs.map} +1 -1
  29. package/dist/runners/compound.d.mts +40 -3
  30. package/dist/runners/compound.d.mts.map +1 -1
  31. package/dist/runners/compound.mjs +6 -5
  32. package/dist/runners/compound.mjs.map +1 -1
  33. package/dist/runners/connect.d.mts +49 -5
  34. package/dist/runners/connect.d.mts.map +1 -1
  35. package/dist/runners/connect.mjs +57 -12
  36. package/dist/runners/connect.mjs.map +1 -1
  37. package/dist/runners/switchboard.d.mts +48 -5
  38. package/dist/runners/switchboard.d.mts.map +1 -1
  39. package/dist/runners/switchboard.mjs +62 -17
  40. package/dist/runners/switchboard.mjs.map +1 -1
  41. package/dist/{start-run-CAgkeWI1.mjs → start-run-DsZRHbM1.mjs} +4 -4
  42. package/dist/{start-run-CAgkeWI1.mjs.map → start-run-DsZRHbM1.mjs.map} +1 -1
  43. package/dist/{vetra-BY-MHg9R.mjs → vetra-BNJZ5LHN.mjs} +6 -6
  44. package/dist/{vetra-BY-MHg9R.mjs.map → vetra-BNJZ5LHN.mjs.map} +1 -1
  45. package/package.json +12 -12
  46. package/dist/dist-BVyjAjXL.mjs.map +0 -1
  47. package/dist/host-schemas-C_MLcYX6-B2qQIdZ-.mjs.map +0 -1
  48. package/dist/ph-cli-commands-DGLyiuvW.mjs +0 -4
  49. package/dist/reactor-env-BXG9PlMa.mjs +0 -4
@@ -0,0 +1,4 @@
1
+ import { t as applyReactorEnvProjection } from "./reactor-env-Da_bfekg.mjs";
2
+ export { applyReactorEnvProjection };
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="78cabacc-d0a3-536e-954c-0206bff8a590")}catch(e){}}();
4
+ //# debugId=78cabacc-d0a3-536e-954c-0206bff8a590
@@ -1,6 +1,6 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ac082bcf-ad2f-5dc2-b01f-1ade0ac5ab29")}catch(e){}}();
3
- import { a as projectReactorToSwitchboard, r as primaryBackend, t as assertProtocolConsistency } from "./dist-BVyjAjXL.mjs";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="048fd720-501c-55fc-b77c-8247d3beeb80")}catch(e){}}();
3
+ import { a as projectReactorToSwitchboard, r as primaryBackend, t as assertProtocolConsistency } from "./dist-D5lAfbKQ.mjs";
4
4
  import fs from "node:fs";
5
5
  //#region src/runners/reactor-env.ts
6
6
  /**
@@ -25,5 +25,5 @@ function applyReactorEnvProjection(reactor, hostFileLabel) {
25
25
  //#endregion
26
26
  export { applyReactorEnvProjection as t };
27
27
 
28
- //# sourceMappingURL=reactor-env-CtavpGtJ.mjs.map
29
- //# debugId=ac082bcf-ad2f-5dc2-b01f-1ade0ac5ab29
28
+ //# sourceMappingURL=reactor-env-Da_bfekg.mjs.map
29
+ //# debugId=048fd720-501c-55fc-b77c-8247d3beeb80
@@ -1 +1 @@
1
- {"version":3,"file":"reactor-env-CtavpGtJ.mjs","sources":["../src/runners/reactor-env.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport {\n assertProtocolConsistency,\n primaryBackend,\n projectReactorToSwitchboard,\n type ReactorConfig,\n} from \"@powerhousedao/host-core\";\n\n/**\n * Apply a host's reactor block to the CURRENT process env, the way the\n * in-process switchboard server reads it at boot (D2.c: env derivation\n * immediately before the member starts; sequential boots make this safe).\n * Single-sourcing teeth first: a pre-set env contradicting the protocol block\n * fails loudly. Then set-if-absent, so an operator's explicit (agreeing) env\n * still wins during the transition. Returns the non-env options (dbPath).\n *\n * Lives OUTSIDE the runner modules on purpose: every export of a runner\n * module reads as a dispatchable verb, and this is not one.\n */\nexport function applyReactorEnvProjection(\n reactor: ReactorConfig | undefined,\n hostFileLabel: string,\n): { dbPath?: string } {\n const { env, options } = projectReactorToSwitchboard(reactor);\n assertProtocolConsistency(reactor?.protocol, process.env, hostFileLabel);\n for (const [name, value] of Object.entries(env)) {\n if (process.env[name] === undefined) process.env[name] = value;\n }\n // A path-storage data dir must exist before the server boots — its own\n // mkdir is not recursive (the ph-win sidecar did this too).\n const storage = primaryBackend(reactor)?.storage;\n if (storage?.kind === \"path\" && storage.dataDir) {\n fs.mkdirSync(storage.dataDir, { recursive: true });\n }\n return options;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,0BACd,SACA,eACqB;CACrB,MAAM,EAAE,KAAK,YAAY,4BAA4B,OAAO;CAC5D,0BAA0B,SAAS,UAAU,QAAQ,KAAK,aAAa;CACvE,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,GAAG,GAC5C,IAAI,QAAQ,IAAI,UAAU,KAAA,GAAW,QAAQ,IAAI,QAAQ;CAI3D,MAAM,UAAU,eAAe,OAAO,CAAC,EAAE;CACzC,IAAI,SAAS,SAAS,UAAU,QAAQ,SACtC,GAAG,UAAU,QAAQ,SAAS,EAAE,WAAW,KAAK,CAAC;CAEnD,OAAO;AACT","debug_id":"ac082bcf-ad2f-5dc2-b01f-1ade0ac5ab29"}
1
+ {"version":3,"file":"reactor-env-Da_bfekg.mjs","sources":["../src/runners/reactor-env.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport {\n assertProtocolConsistency,\n primaryBackend,\n projectReactorToSwitchboard,\n type ReactorConfig,\n} from \"@powerhousedao/host-core\";\n\n/**\n * Apply a host's reactor block to the CURRENT process env, the way the\n * in-process switchboard server reads it at boot (D2.c: env derivation\n * immediately before the member starts; sequential boots make this safe).\n * Single-sourcing teeth first: a pre-set env contradicting the protocol block\n * fails loudly. Then set-if-absent, so an operator's explicit (agreeing) env\n * still wins during the transition. Returns the non-env options (dbPath).\n *\n * Lives OUTSIDE the runner modules on purpose: every export of a runner\n * module reads as a dispatchable verb, and this is not one.\n */\nexport function applyReactorEnvProjection(\n reactor: ReactorConfig | undefined,\n hostFileLabel: string,\n): { dbPath?: string } {\n const { env, options } = projectReactorToSwitchboard(reactor);\n assertProtocolConsistency(reactor?.protocol, process.env, hostFileLabel);\n for (const [name, value] of Object.entries(env)) {\n if (process.env[name] === undefined) process.env[name] = value;\n }\n // A path-storage data dir must exist before the server boots — its own\n // mkdir is not recursive (the ph-win sidecar did this too).\n const storage = primaryBackend(reactor)?.storage;\n if (storage?.kind === \"path\" && storage.dataDir) {\n fs.mkdirSync(storage.dataDir, { recursive: true });\n }\n return options;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,0BACd,SACA,eACqB;CACrB,MAAM,EAAE,KAAK,YAAY,4BAA4B,OAAO;CAC5D,0BAA0B,SAAS,UAAU,QAAQ,KAAK,aAAa;CACvE,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,GAAG,GAC5C,IAAI,QAAQ,IAAI,UAAU,KAAA,GAAW,QAAQ,IAAI,QAAQ;CAI3D,MAAM,UAAU,eAAe,OAAO,CAAC,EAAE;CACzC,IAAI,SAAS,SAAS,UAAU,QAAQ,SACtC,GAAG,UAAU,QAAQ,SAAS,EAAE,WAAW,KAAK,CAAC;CAEnD,OAAO;AACT","debug_id":"048fd720-501c-55fc-b77c-8247d3beeb80"}
@@ -1,6 +1,6 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="20f0ebcf-299e-52fe-920a-2be20100b012")}catch(e){}}();
3
- import { a as probeHostsFolder } from "./host-schemas-C_MLcYX6-B2qQIdZ-.mjs";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d3abb843-86e4-5e80-bbdc-d25a99e0d7d3")}catch(e){}}();
3
+ import { s as probeHostsFolder } from "./host-schemas-CL_wFpY7-DOvIjrBA.mjs";
4
4
  //#region src/utils/run-sugar.ts
5
5
  /**
6
6
  * `ph <host-name> [verb]` sugar: when the first arg is not a registered
@@ -35,5 +35,5 @@ function applyRunSugar(args, knownCommands, projectRoot) {
35
35
  //#endregion
36
36
  export { applyRunSugar };
37
37
 
38
- //# sourceMappingURL=run-sugar-Dqn7up5U.mjs.map
39
- //# debugId=20f0ebcf-299e-52fe-920a-2be20100b012
38
+ //# sourceMappingURL=run-sugar-Dq3ZrLL_.mjs.map
39
+ //# debugId=d3abb843-86e4-5e80-bbdc-d25a99e0d7d3
@@ -1 +1 @@
1
- {"version":3,"file":"run-sugar-Dqn7up5U.mjs","sources":["../src/utils/run-sugar.ts"],"sourcesContent":["import { probeHostsFolder } from \"@powerhousedao/host-core\";\n\nexport interface RunSugarResult {\n args: string[];\n /** Set when hosts/ exists but is empty — the guard state: warn loudly, stay legacy. */\n warning?: string;\n}\n\n/**\n * `ph <host-name> [verb]` sugar: when the first arg is not a registered\n * command and names a host in the project's hosts/ folder, splice in `run`\n * (mirrors the connect→`connect studio` default-subcommand rewrite).\n * Built-in commands win collisions by construction — the known-command check\n * runs first. Callers only invoke this when the uniform-runners flag is on.\n */\n/** Classic commands that route through `ph run` in a hosts project — BARE\n * invocations only: extra flags are not representable on `ph run` yet, and\n * the classic path calls the same service, so flagged invocations stay\n * classic until the host-core compound takes over (phase 1). */\nconst CLASSIC_ALIASES = new Set([\"vetra\"]);\n\nexport function applyRunSugar(\n args: string[],\n knownCommands: ReadonlySet<string>,\n projectRoot: string,\n): RunSugarResult {\n const first = args[0];\n if (!first || first.startsWith(\"-\")) {\n return { args };\n }\n if (knownCommands.has(first)) {\n if (CLASSIC_ALIASES.has(first) && args.length === 1) {\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", first] };\n }\n }\n return { args };\n }\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"empty\") {\n return {\n args,\n warning:\n `hosts/ exists at ${probe.dir} but contains no <name>/host.js — ` +\n \"uniform-runners stays inactive (legacy command handling).\",\n };\n }\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", ...args] };\n }\n return { args };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAM,kCAAkB,IAAI,IAAI,CAAC,OAAO,CAAC;AAEzC,SAAgB,cACd,MACA,eACA,aACgB;CAChB,MAAM,QAAQ,KAAK;CACnB,IAAI,CAAC,SAAS,MAAM,WAAW,GAAG,GAChC,OAAO,EAAE,KAAK;CAEhB,IAAI,cAAc,IAAI,KAAK,GAAG;EAC5B,IAAI,gBAAgB,IAAI,KAAK,KAAK,KAAK,WAAW,GAAG;GACnD,MAAM,QAAQ,iBAAiB,WAAW;GAC1C,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,EAAE;EAElC;EACA,OAAO,EAAE,KAAK;CAChB;CACA,MAAM,QAAQ,iBAAiB,WAAW;CAC1C,IAAI,MAAM,SAAS,SACjB,OAAO;EACL;EACA,SACE,oBAAoB,MAAM,IAAI;CAElC;CAEF,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,EAAE;CAElC,OAAO,EAAE,KAAK;AAChB","debug_id":"20f0ebcf-299e-52fe-920a-2be20100b012"}
1
+ {"version":3,"file":"run-sugar-Dq3ZrLL_.mjs","sources":["../src/utils/run-sugar.ts"],"sourcesContent":["import { probeHostsFolder } from \"@powerhousedao/host-core\";\n\nexport interface RunSugarResult {\n args: string[];\n /** Set when hosts/ exists but is empty — the guard state: warn loudly, stay legacy. */\n warning?: string;\n}\n\n/**\n * `ph <host-name> [verb]` sugar: when the first arg is not a registered\n * command and names a host in the project's hosts/ folder, splice in `run`\n * (mirrors the connect→`connect studio` default-subcommand rewrite).\n * Built-in commands win collisions by construction — the known-command check\n * runs first. Callers only invoke this when the uniform-runners flag is on.\n */\n/** Classic commands that route through `ph run` in a hosts project — BARE\n * invocations only: extra flags are not representable on `ph run` yet, and\n * the classic path calls the same service, so flagged invocations stay\n * classic until the host-core compound takes over (phase 1). */\nconst CLASSIC_ALIASES = new Set([\"vetra\"]);\n\nexport function applyRunSugar(\n args: string[],\n knownCommands: ReadonlySet<string>,\n projectRoot: string,\n): RunSugarResult {\n const first = args[0];\n if (!first || first.startsWith(\"-\")) {\n return { args };\n }\n if (knownCommands.has(first)) {\n if (CLASSIC_ALIASES.has(first) && args.length === 1) {\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", first] };\n }\n }\n return { args };\n }\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"empty\") {\n return {\n args,\n warning:\n `hosts/ exists at ${probe.dir} but contains no <name>/host.js — ` +\n \"uniform-runners stays inactive (legacy command handling).\",\n };\n }\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", ...args] };\n }\n return { args };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAM,kCAAkB,IAAI,IAAI,CAAC,OAAO,CAAC;AAEzC,SAAgB,cACd,MACA,eACA,aACgB;CAChB,MAAM,QAAQ,KAAK;CACnB,IAAI,CAAC,SAAS,MAAM,WAAW,GAAG,GAChC,OAAO,EAAE,KAAK;CAEhB,IAAI,cAAc,IAAI,KAAK,GAAG;EAC5B,IAAI,gBAAgB,IAAI,KAAK,KAAK,KAAK,WAAW,GAAG;GACnD,MAAM,QAAQ,iBAAiB,WAAW;GAC1C,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,EAAE;EAElC;EACA,OAAO,EAAE,KAAK;CAChB;CACA,MAAM,QAAQ,iBAAiB,WAAW;CAC1C,IAAI,MAAM,SAAS,SACjB,OAAO;EACL;EACA,SACE,oBAAoB,MAAM,IAAI;CAElC;CAEF,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,EAAE;CAElC,OAAO,EAAE,KAAK;AAChB","debug_id":"d3abb843-86e4-5e80-bbdc-d25a99e0d7d3"}
@@ -1,4 +1,4 @@
1
- import { a as ZodBoolean, c as ZodObject, d as ZodString, f as $loose, i as ZodArray, l as ZodOptional, n as RunnerContext, o as ZodEnum, p as $strict, r as external_d_exports, t as HostDefinition, u as ZodRecord } from "../index-s1ABBFjB.mjs";
1
+ import { a as ZodBoolean, c as ZodNumber, d as ZodRecord, f as ZodString, g as $strict, h as $loose, i as ZodArray, l as ZodObject, n as RunnerContext, o as ZodEnum, p as ZodUnion, r as external_d_exports, s as ZodLiteral, t as HostDefinition, u as ZodOptional } from "../index-CApW1xbO.mjs";
2
2
  //#region src/runners/compound.d.ts
3
3
  /**
4
4
  * BRIDGE compound runner (uniform-runners phase 0): args derivation, not
@@ -20,7 +20,6 @@ export declare const hostSchema: ZodObject<{
20
20
  }, $loose>;
21
21
  children: ZodRecord<ZodString, ZodObject<{
22
22
  host: ZodString;
23
- plugins: ZodOptional<ZodArray<ZodString>>;
24
23
  runner: ZodOptional<ZodObject<{}, $loose>>;
25
24
  config: ZodOptional<ZodObject<{}, $loose>>;
26
25
  reactor: ZodOptional<ZodObject<{
@@ -52,12 +51,18 @@ export declare const hostSchema: ZodObject<{
52
51
  host: ZodOptional<ZodString>;
53
52
  url: ZodOptional<ZodString>;
54
53
  }, $strict>>;
54
+ projection: ZodOptional<ZodObject<{
55
+ enabled: ZodOptional<ZodBoolean>;
56
+ dbPoolSize: ZodOptional<ZodNumber>;
57
+ }, $strict>>;
58
+ executors: ZodOptional<ZodObject<{
59
+ numWorkers: ZodOptional<ZodUnion<readonly [ZodNumber, ZodLiteral<"auto">]>>;
60
+ }, $strict>>;
55
61
  }, $strict>>>;
56
62
  placement: ZodOptional<ZodObject<{
57
63
  primary: ZodOptional<ZodString>;
58
64
  default: ZodOptional<ZodObject<{}, $loose>>;
59
65
  }, $strict>>;
60
- workflows: ZodOptional<ZodBoolean>;
61
66
  protocol: ZodOptional<ZodObject<{
62
67
  featureFlags: ZodOptional<ZodObject<{
63
68
  documentDecisions: ZodOptional<ZodBoolean>;
@@ -74,6 +79,38 @@ export declare const hostSchema: ZodObject<{
74
79
  refuse: "refuse";
75
80
  }>>;
76
81
  }, $strict>>;
82
+ workflows: ZodOptional<ZodBoolean>;
83
+ renown: ZodOptional<ZodObject<{
84
+ url: ZodOptional<ZodString>;
85
+ networkId: ZodOptional<ZodString>;
86
+ chainId: ZodOptional<ZodNumber>;
87
+ }, $strict>>;
88
+ packages: ZodOptional<ZodObject<{
89
+ registryUrl: ZodOptional<ZodString>;
90
+ }, $strict>>;
91
+ namespace: ZodOptional<ZodString>;
92
+ auth: ZodOptional<ZodObject<{
93
+ enabled: ZodOptional<ZodBoolean>;
94
+ admins: ZodOptional<ZodArray<ZodString>>;
95
+ renown: ZodOptional<ZodObject<{}, $loose>>;
96
+ }, $strict>>;
97
+ drives: ZodOptional<ZodArray<ZodObject<{
98
+ slug: ZodString;
99
+ id: ZodOptional<ZodString>;
100
+ projectHash: ZodOptional<ZodBoolean>;
101
+ name: ZodOptional<ZodString>;
102
+ icon: ZodOptional<ZodString>;
103
+ preferredEditor: ZodOptional<ZodString>;
104
+ sharingType: ZodOptional<ZodEnum<{
105
+ private: "private";
106
+ public: "public";
107
+ shared: "shared";
108
+ }>>;
109
+ availableOffline: ZodOptional<ZodBoolean>;
110
+ remote: ZodOptional<ZodObject<{
111
+ url: ZodString;
112
+ }, $strict>>;
113
+ }, $strict>>>;
77
114
  }, $strict>>;
78
115
  }, $strict>>;
79
116
  config: ZodOptional<ZodObject<{}, $loose>>;
@@ -1 +1 @@
1
- {"version":3,"file":"compound.d.mts","names":[],"sources":["../../src/runners/compound.ts"],"mappings":";;;;;;;;;;;qBAqBa;;;qBAIA,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASrB;wBAkCoB,IACpB,MAAM,gBACN,KAAK,gBACJ"}
1
+ {"version":3,"file":"compound.d.mts","names":[],"sources":["../../src/runners/compound.ts"],"mappings":";;;;;;;;;;;qBAqBa;;;qBAIA,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASrB;wBAkCoB,IACpB,MAAM,gBACN,KAAK,gBACJ"}
@@ -1,6 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="84efd84c-d630-5c0b-a6a9-168f56fe18a6")}catch(e){}}();
3
- import { h as string, o as profileSchema, p as looseObject, r as loadHost, t as childrenSchema } from "../host-schemas-C_MLcYX6-B2qQIdZ-.mjs";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="33908ac1-e0c2-5b7a-b255-a5d71dbe11d6")}catch(e){}}();
3
+ import { m as string, u as looseObject } from "../plugins-DtJUVtyg.mjs";
4
+ import { c as profileSchema, i as loadHost, t as childrenSchema } from "../host-schemas-CL_wFpY7-DOvIjrBA.mjs";
4
5
  //#region src/runners/compound.ts
5
6
  /**
6
7
  * BRIDGE compound runner (uniform-runners phase 0): args derivation, not
@@ -55,17 +56,17 @@ async function run(host, ctx) {
55
56
  ...sbMember.host.reactor ?? {},
56
57
  ...sbWrapper?.reactor ?? {}
57
58
  };
58
- const { applyReactorEnvProjection } = await import("../reactor-env-BXG9PlMa.mjs");
59
+ const { applyReactorEnvProjection } = await import("../reactor-env-D9p2G8jW.mjs");
59
60
  applyReactorEnvProjection(sbReactor, `hosts/${switchboardRef.host}/host.js`);
60
61
  const args = {
61
62
  connectPort,
62
63
  switchboardPort
63
64
  };
64
- const { startVetra } = await import("../vetra-BY-MHg9R.mjs");
65
+ const { startVetra } = await import("../vetra-BNJZ5LHN.mjs");
65
66
  await startVetra(args);
66
67
  }
67
68
  //#endregion
68
69
  export { hostSchema, kind, run };
69
70
 
70
71
  //# sourceMappingURL=compound.mjs.map
71
- //# debugId=84efd84c-d630-5c0b-a6a9-168f56fe18a6
72
+ //# debugId=33908ac1-e0c2-5b7a-b255-a5d71dbe11d6
@@ -1 +1 @@
1
- {"version":3,"file":"compound.mjs","sources":["../../src/runners/compound.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n childrenSchema,\n loadHost,\n profileSchema,\n type HostDefinition,\n type ReactorConfig,\n type RunnerContext,\n} from \"@powerhousedao/host-core\";\nimport type { VetraArgs } from \"../types.js\";\n\n/**\n * BRIDGE compound runner (uniform-runners phase 0): args derivation, not\n * supervision. It reads the compound's member wrappers plus the member host\n * files they reference, derives exactly the args today's `startVetra` takes,\n * and calls it — so `ph run vetra` and classic `ph vetra` share one code\n * path. Real supervision (members started via their own runners, instance-\n * fact projection, .ph/run records) is the phase-1 generic compound in\n * @powerhousedao/host-core; this file is deleted when that lands.\n */\n\nexport const kind = \"compound\";\n\n/** Phase-2 schema (D2.d): children member shapes + profile come from\n * host-core — member reactor overrides now validate strictly. */\nexport const hostSchema = z.looseObject({\n name: z.string().min(1),\n runner: z.looseObject({\n module: z.string(),\n defaultVerb: z.string().optional(),\n }),\n children: childrenSchema,\n config: z.looseObject({}).optional(),\n profile: profileSchema,\n});\n\ninterface MemberRef {\n name: string;\n host: string;\n runnerPort?: number;\n}\n\nfunction members(host: HostDefinition): MemberRef[] {\n return Object.entries(host.children ?? {}).map(([name, wrapper]) => {\n const w = wrapper as {\n host: string;\n runner?: { port?: unknown };\n };\n return {\n name,\n host: w.host,\n runnerPort:\n typeof w.runner?.port === \"number\" ? w.runner.port : undefined,\n };\n });\n}\n\nasync function memberPort(\n projectRoot: string,\n ref: MemberRef,\n): Promise<number | undefined> {\n // wrapper override wins; otherwise the member host's own runner.port\n if (ref.runnerPort !== undefined) return ref.runnerPort;\n const member = await loadHost(projectRoot, ref.host);\n const port = member.host.runner.port;\n return typeof port === \"number\" ? port : undefined;\n}\n\nexport async function run(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<void> {\n const defaultVerb = (host.runner.defaultVerb as string | undefined) ?? \"run\";\n if (defaultVerb !== \"dev\") {\n throw new Error(\n `The phase-0 compound bridge only supports defaultVerb \"dev\" (vetra semantics); ` +\n `got \"${defaultVerb}\". Other member verbs arrive with the host-core compound.`,\n );\n }\n\n const refs = members(host);\n const connectRef = refs.find((r) => r.host === \"connect\");\n const switchboardRef = refs.find((r) => r.host === \"switchboard\");\n if (!connectRef || !switchboardRef) {\n throw new Error(\n `The phase-0 compound bridge expects children wrapping the \"connect\" and ` +\n `\"switchboard\" hosts (vetra shape); found members for: ${\n refs.map((r) => r.host).join(\", \") || \"<none>\"\n }.`,\n );\n }\n\n const connectPort = await memberPort(ctx.projectRoot, connectRef);\n const switchboardPort = await memberPort(ctx.projectRoot, switchboardRef);\n if (connectPort === undefined || switchboardPort === undefined) {\n throw new Error(\n `Cannot derive member ports: connect=${connectPort}, switchboard=${switchboardPort}. ` +\n `Set runner.port in the member host files or override it in the compound's wrappers.`,\n );\n }\n\n // The switchboard member's reactor block applies on this path too: startVetra\n // boots the switchboard in-process without going through the switchboard\n // runner's verbs, so project the block onto env HERE (P2.4 via the vetra\n // path). Wrapper override wins over the member host file, as everywhere.\n const sbMember = await loadHost(ctx.projectRoot, switchboardRef.host);\n const sbWrapper = (host.children ?? {})[switchboardRef.name] as\n | { reactor?: Record<string, unknown> }\n | undefined;\n const sbReactor = {\n ...((sbMember.host.reactor as Record<string, unknown> | undefined) ?? {}),\n ...(sbWrapper?.reactor ?? {}),\n } as ReactorConfig;\n const { applyReactorEnvProjection } = await import(\"./reactor-env.js\");\n applyReactorEnvProjection(sbReactor, `hosts/${switchboardRef.host}/host.js`);\n\n // Classic `ph vetra` resolves these through flag>env>.env>config>constant;\n // a hosts project carries the values in its host files (the projection\n // already resolved powerhouse.config.json references), so the derived args\n // land on the same numbers. The equivalence suite pins this.\n const args: Partial<VetraArgs> = {\n connectPort,\n switchboardPort,\n };\n const { startVetra } = await import(\"../services/vetra.js\");\n await startVetra(args as VetraArgs);\n}\n"],"names":["z.looseObject","z.string"],"mappings":";;;;;;;;;;;;;AAqBA,MAAa,OAAO;;;AAI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AA,GACnD,MAAM,IAAI,MACR,uCAAuC,YAAY,gBAAgB,gBAAgB,sFAErF;CAOF,MAAM,WAAW,MAAM,SAAS,IAAI,aAAa,eAAe,IAAI;CACpE,MAAM,aAAa,KAAK,YAAY,CAAC,EAAA,CAAG,eAAe;CAGvD,MAAM,YAAY;EAChB,GAAK,SAAS,KAAK,WAAmD,CAAC;EACvE,GAAI,WAAW,WAAW,CAAC;CAC7B;CACA,MAAM,EAAE,8BAA8B,MAAM,OAAO;CACnD,0BAA0B,WAAW,SAAS,eAAe,KAAK,SAAS;CAM3E,MAAM,OAA2B;EAC/B;EACA;CACF;CACA,MAAM,EAAE,eAAe,MAAM,OAAO;CACpC,MAAM,WAAW,IAAiB;AACpC","debug_id":"84efd84c-d630-5c0b-a6a9-168f56fe18a6"}
1
+ {"version":3,"file":"compound.mjs","sources":["../../src/runners/compound.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n childrenSchema,\n loadHost,\n profileSchema,\n type HostDefinition,\n type ReactorConfig,\n type RunnerContext,\n} from \"@powerhousedao/host-core\";\nimport type { VetraArgs } from \"../types.js\";\n\n/**\n * BRIDGE compound runner (uniform-runners phase 0): args derivation, not\n * supervision. It reads the compound's member wrappers plus the member host\n * files they reference, derives exactly the args today's `startVetra` takes,\n * and calls it — so `ph run vetra` and classic `ph vetra` share one code\n * path. Real supervision (members started via their own runners, instance-\n * fact projection, .ph/run records) is the phase-1 generic compound in\n * @powerhousedao/host-core; this file is deleted when that lands.\n */\n\nexport const kind = \"compound\";\n\n/** Phase-2 schema (D2.d): children member shapes + profile come from\n * host-core — member reactor overrides now validate strictly. */\nexport const hostSchema = z.looseObject({\n name: z.string().min(1),\n runner: z.looseObject({\n module: z.string(),\n defaultVerb: z.string().optional(),\n }),\n children: childrenSchema,\n config: z.looseObject({}).optional(),\n profile: profileSchema,\n});\n\ninterface MemberRef {\n name: string;\n host: string;\n runnerPort?: number;\n}\n\nfunction members(host: HostDefinition): MemberRef[] {\n return Object.entries(host.children ?? {}).map(([name, wrapper]) => {\n const w = wrapper as {\n host: string;\n runner?: { port?: unknown };\n };\n return {\n name,\n host: w.host,\n runnerPort:\n typeof w.runner?.port === \"number\" ? w.runner.port : undefined,\n };\n });\n}\n\nasync function memberPort(\n projectRoot: string,\n ref: MemberRef,\n): Promise<number | undefined> {\n // wrapper override wins; otherwise the member host's own runner.port\n if (ref.runnerPort !== undefined) return ref.runnerPort;\n const member = await loadHost(projectRoot, ref.host);\n const port = member.host.runner.port;\n return typeof port === \"number\" ? port : undefined;\n}\n\nexport async function run(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<void> {\n const defaultVerb = (host.runner.defaultVerb as string | undefined) ?? \"run\";\n if (defaultVerb !== \"dev\") {\n throw new Error(\n `The phase-0 compound bridge only supports defaultVerb \"dev\" (vetra semantics); ` +\n `got \"${defaultVerb}\". Other member verbs arrive with the host-core compound.`,\n );\n }\n\n const refs = members(host);\n const connectRef = refs.find((r) => r.host === \"connect\");\n const switchboardRef = refs.find((r) => r.host === \"switchboard\");\n if (!connectRef || !switchboardRef) {\n throw new Error(\n `The phase-0 compound bridge expects children wrapping the \"connect\" and ` +\n `\"switchboard\" hosts (vetra shape); found members for: ${\n refs.map((r) => r.host).join(\", \") || \"<none>\"\n }.`,\n );\n }\n\n const connectPort = await memberPort(ctx.projectRoot, connectRef);\n const switchboardPort = await memberPort(ctx.projectRoot, switchboardRef);\n if (connectPort === undefined || switchboardPort === undefined) {\n throw new Error(\n `Cannot derive member ports: connect=${connectPort}, switchboard=${switchboardPort}. ` +\n `Set runner.port in the member host files or override it in the compound's wrappers.`,\n );\n }\n\n // The switchboard member's reactor block applies on this path too: startVetra\n // boots the switchboard in-process without going through the switchboard\n // runner's verbs, so project the block onto env HERE (P2.4 via the vetra\n // path). Wrapper override wins over the member host file, as everywhere.\n const sbMember = await loadHost(ctx.projectRoot, switchboardRef.host);\n const sbWrapper = (host.children ?? {})[switchboardRef.name] as\n | { reactor?: Record<string, unknown> }\n | undefined;\n const sbReactor = {\n ...((sbMember.host.reactor as Record<string, unknown> | undefined) ?? {}),\n ...(sbWrapper?.reactor ?? {}),\n } as ReactorConfig;\n const { applyReactorEnvProjection } = await import(\"./reactor-env.js\");\n applyReactorEnvProjection(sbReactor, `hosts/${switchboardRef.host}/host.js`);\n\n // Classic `ph vetra` resolves these through flag>env>.env>config>constant;\n // a hosts project carries the values in its host files (the projection\n // already resolved powerhouse.config.json references), so the derived args\n // land on the same numbers. The equivalence suite pins this.\n const args: Partial<VetraArgs> = {\n connectPort,\n switchboardPort,\n };\n const { startVetra } = await import(\"../services/vetra.js\");\n await startVetra(args as VetraArgs);\n}\n"],"names":["z.looseObject","z.string"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAa,OAAO;;;AAIpB,MAAa,aAAaA,YAAc;CACtC,MAAMC,OAAS,CAAC,CAAC,IAAI,CAAC;CACtB,QAAQD,YAAc;EACpB,QAAQC,OAAS;EACjB,aAAaA,OAAS,CAAC,CAAC,SAAS;CACnC,CAAC;CACD,UAAU;CACV,QAAQD,YAAc,CAAC,CAAC,CAAC,CAAC,SAAS;CACnC,SAAS;AACX,CAAC;AAQD,SAAS,QAAQ,MAAmC;CAClD,OAAO,OAAO,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,aAAa;EAClE,MAAM,IAAI;EAIV,OAAO;GACL;GACA,MAAM,EAAE;GACR,YACE,OAAO,EAAE,QAAQ,SAAS,WAAW,EAAE,OAAO,OAAO,KAAA;EACzD;CACF,CAAC;AACH;AAEA,eAAe,WACb,aACA,KAC6B;CAE7B,IAAI,IAAI,eAAe,KAAA,GAAW,OAAO,IAAI;CAE7C,MAAM,QAAO,MADQ,SAAS,aAAa,IAAI,IAAI,EAAA,CAC/B,KAAK,OAAO;CAChC,OAAO,OAAO,SAAS,WAAW,OAAO,KAAA;AAC3C;AAEA,eAAsB,IACpB,MACA,KACe;CACf,MAAM,cAAe,KAAK,OAAO,eAAsC;CACvE,IAAI,gBAAgB,OAClB,MAAM,IAAI,MACR,uFACU,YAAY,0DACxB;CAGF,MAAM,OAAO,QAAQ,IAAI;CACzB,MAAM,aAAa,KAAK,MAAM,MAAM,EAAE,SAAS,SAAS;CACxD,MAAM,iBAAiB,KAAK,MAAM,MAAM,EAAE,SAAS,aAAa;CAChE,IAAI,CAAC,cAAc,CAAC,gBAClB,MAAM,IAAI,MACR,iIAEI,KAAK,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,SACvC,EACL;CAGF,MAAM,cAAc,MAAM,WAAW,IAAI,aAAa,UAAU;CAChE,MAAM,kBAAkB,MAAM,WAAW,IAAI,aAAa,cAAc;CACxE,IAAI,gBAAgB,KAAA,KAAa,oBAAoB,KAAA,GACnD,MAAM,IAAI,MACR,uCAAuC,YAAY,gBAAgB,gBAAgB,sFAErF;CAOF,MAAM,WAAW,MAAM,SAAS,IAAI,aAAa,eAAe,IAAI;CACpE,MAAM,aAAa,KAAK,YAAY,CAAC,EAAA,CAAG,eAAe;CAGvD,MAAM,YAAY;EAChB,GAAK,SAAS,KAAK,WAAmD,CAAC;EACvE,GAAI,WAAW,WAAW,CAAC;CAC7B;CACA,MAAM,EAAE,8BAA8B,MAAM,OAAO;CACnD,0BAA0B,WAAW,SAAS,eAAe,KAAK,SAAS;CAM3E,MAAM,OAA2B;EAC/B;EACA;CACF;CACA,MAAM,EAAE,eAAe,MAAM,OAAO;CACpC,MAAM,WAAW,IAAiB;AACpC","debug_id":"33908ac1-e0c2-5b7a-b255-a5d71dbe11d6"}
@@ -1,4 +1,4 @@
1
- import { a as ZodBoolean, c as ZodObject, d as ZodString, f as $loose, i as ZodArray, l as ZodOptional, n as RunnerContext, o as ZodEnum, p as $strict, r as external_d_exports, s as ZodNumber, t as HostDefinition, u as ZodRecord } from "../index-s1ABBFjB.mjs";
1
+ import { a as ZodBoolean, c as ZodNumber, d as ZodRecord, f as ZodString, g as $strict, h as $loose, i as ZodArray, l as ZodObject, m as ZodUnknown, n as RunnerContext, o as ZodEnum, p as ZodUnion, r as external_d_exports, s as ZodLiteral, t as HostDefinition, u as ZodOptional } from "../index-CApW1xbO.mjs";
2
2
  //#region src/runners/connect.d.ts
3
3
  /**
4
4
  * BRIDGE runner for Connect hosts (uniform-runners phase 0): maps a
@@ -16,9 +16,15 @@ export declare const hostSchema: ZodObject<{
16
16
  runner: ZodObject<{
17
17
  module: ZodString;
18
18
  port: ZodOptional<ZodNumber>;
19
+ host: ZodOptional<ZodString>;
19
20
  https: ZodOptional<ZodBoolean>;
20
21
  openBrowser: ZodOptional<ZodBoolean>;
21
- plugins: ZodOptional<ZodString>;
22
+ plugins: ZodOptional<ZodArray<ZodUnion<readonly [ZodString, ZodObject<{
23
+ module: ZodString;
24
+ enabled: ZodOptional<ZodBoolean>;
25
+ verbs: ZodOptional<ZodUnion<readonly [ZodLiteral<"*">, ZodArray<ZodString>]>>;
26
+ config: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
27
+ }, $strict>]>>>;
22
28
  }, $loose>;
23
29
  config: ZodOptional<ZodObject<{}, $loose>>;
24
30
  profile: ZodOptional<ZodObject<{
@@ -56,12 +62,18 @@ export declare const hostSchema: ZodObject<{
56
62
  host: ZodOptional<ZodString>;
57
63
  url: ZodOptional<ZodString>;
58
64
  }, $strict>>;
65
+ projection: ZodOptional<ZodObject<{
66
+ enabled: ZodOptional<ZodBoolean>;
67
+ dbPoolSize: ZodOptional<ZodNumber>;
68
+ }, $strict>>;
69
+ executors: ZodOptional<ZodObject<{
70
+ numWorkers: ZodOptional<ZodUnion<readonly [ZodNumber, ZodLiteral<"auto">]>>;
71
+ }, $strict>>;
59
72
  }, $strict>>>;
60
73
  placement: ZodOptional<ZodObject<{
61
74
  primary: ZodOptional<ZodString>;
62
75
  default: ZodOptional<ZodObject<{}, $loose>>;
63
76
  }, $strict>>;
64
- workflows: ZodOptional<ZodBoolean>;
65
77
  protocol: ZodOptional<ZodObject<{
66
78
  featureFlags: ZodOptional<ZodObject<{
67
79
  documentDecisions: ZodOptional<ZodBoolean>;
@@ -78,9 +90,41 @@ export declare const hostSchema: ZodObject<{
78
90
  refuse: "refuse";
79
91
  }>>;
80
92
  }, $strict>>;
93
+ workflows: ZodOptional<ZodBoolean>;
94
+ renown: ZodOptional<ZodObject<{
95
+ url: ZodOptional<ZodString>;
96
+ networkId: ZodOptional<ZodString>;
97
+ chainId: ZodOptional<ZodNumber>;
98
+ }, $strict>>;
99
+ packages: ZodOptional<ZodObject<{
100
+ registryUrl: ZodOptional<ZodString>;
101
+ }, $strict>>;
102
+ namespace: ZodOptional<ZodString>;
103
+ auth: ZodOptional<ZodObject<{
104
+ enabled: ZodOptional<ZodBoolean>;
105
+ admins: ZodOptional<ZodArray<ZodString>>;
106
+ renown: ZodOptional<ZodObject<{}, $loose>>;
107
+ }, $strict>>;
108
+ drives: ZodOptional<ZodArray<ZodObject<{
109
+ slug: ZodString;
110
+ id: ZodOptional<ZodString>;
111
+ projectHash: ZodOptional<ZodBoolean>;
112
+ name: ZodOptional<ZodString>;
113
+ icon: ZodOptional<ZodString>;
114
+ preferredEditor: ZodOptional<ZodString>;
115
+ sharingType: ZodOptional<ZodEnum<{
116
+ private: "private";
117
+ public: "public";
118
+ shared: "shared";
119
+ }>>;
120
+ availableOffline: ZodOptional<ZodBoolean>;
121
+ remote: ZodOptional<ZodObject<{
122
+ url: ZodString;
123
+ }, $strict>>;
124
+ }, $strict>>>;
81
125
  }, $strict>>;
82
126
  }, $loose>;
83
- export declare function dev(host: HostDefinition, _ctx: RunnerContext): Promise<void>;
127
+ export declare function dev(host: HostDefinition, ctx: RunnerContext): Promise<void>;
84
128
  /** `run` is dev-studio until the plugin phases give hosts a production
85
129
  * runtime; `serve` (below) is the static production server. */
86
130
  export declare const run: typeof dev;
@@ -94,7 +138,7 @@ export declare function build(host: HostDefinition, _ctx: RunnerContext): Promis
94
138
  * `runner.cspRegistrySync` (set by the compound's wiring) patches the baked
95
139
  * CSP's script-src for the runtime registry — together these replace the
96
140
  * ph-win-desktop sidecar's hand-rolled static server (desktop shape). */
97
- export declare function serve(host: HostDefinition, _ctx: RunnerContext): Promise<void>;
141
+ export declare function serve(host: HostDefinition, ctx: RunnerContext): Promise<void>;
98
142
  //#endregion
99
143
  export {};
100
144
  //# sourceMappingURL=connect.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.mts","names":[],"sources":["../../src/runners/connect.ts"],"mappings":";;;;;;;;;qBA8Ba;;;;qBAKA,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAYrB;wBAiEoB,IACpB,MAAM,gBACN,MAAM,gBACL;;;qBAOU,YAAG;;wBAGM,MACpB,MAAM,gBACN,MAAM,gBACL;;;;;;;;;wBAiBmB,MACpB,MAAM,gBACN,MAAM,gBACL"}
1
+ {"version":3,"file":"connect.d.mts","names":[],"sources":["../../src/runners/connect.ts"],"mappings":";;;;;;;;;qBAuCa;;;;qBAKA,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAcrB;wBAmIoB,IACpB,MAAM,gBACN,KAAK,gBACJ;;;qBAWU,YAAG;;wBAGM,MACpB,MAAM,gBACN,MAAM,gBACL;;;;;;;;;wBAiBmB,MACpB,MAAM,gBACN,KAAK,gBACJ"}
@@ -1,7 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6fb9c616-bc5a-5744-8e61-012c2da6a7a3")}catch(e){}}();
3
- import { c as reactorSchema, f as boolean, h as string, m as number, o as profileSchema, p as looseObject, s as projectDrivesIntoConnect } from "../host-schemas-C_MLcYX6-B2qQIdZ-.mjs";
4
- import { i as projectReactorToConnect, n as isStructuralMultiReactor, o as remoteBackendUrls } from "../dist-BVyjAjXL.mjs";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5b86c164-98a1-51be-b822-87396489d626")}catch(e){}}();
3
+ import { a as pluginEntrySchema, c as boolean, d as number, i as normalizePluginEntries, m as string, n as entryActiveForVerb, s as array, u as looseObject } from "../plugins-DtJUVtyg.mjs";
4
+ import { a as mergeDefaultDrives, c as profileSchema, f as resolveDriveDeclaration, l as projectDrivesIntoConnect, u as reactorSchema } from "../host-schemas-CL_wFpY7-DOvIjrBA.mjs";
5
+ import { i as projectReactorToConnect, n as isStructuralMultiReactor, o as remoteBackendUrls } from "../dist-D5lAfbKQ.mjs";
5
6
  import { DEFAULT_CONNECT_STUDIO_PORT } from "@powerhousedao/shared/clis";
6
7
  //#region src/runners/connect.ts
7
8
  /**
@@ -20,9 +21,10 @@ const hostSchema = looseObject({
20
21
  runner: looseObject({
21
22
  module: string(),
22
23
  port: number().int().positive().optional(),
24
+ host: string().optional(),
23
25
  https: boolean().optional(),
24
26
  openBrowser: boolean().optional(),
25
- plugins: string().optional()
27
+ plugins: array(pluginEntrySchema).optional()
26
28
  }),
27
29
  config: looseObject({}).optional(),
28
30
  profile: profileSchema,
@@ -49,9 +51,52 @@ function toStudioArgs(host) {
49
51
  * a local one IS the intent, so it beats a scaffold-default
50
52
  * instance.multiReactor: false, and the remote's drive url merges FIRST into
51
53
  * drives.defaultDrives (the first url entry is what the routing client dials). */
52
- function callerOverride(host) {
54
+ /** host.js reactor.drives -> the served drives.defaultDrives shapes: locals
55
+ * carry id/name/icon and the preferredEditor under its Connect alias `app`;
56
+ * remotes carry their URL. */
57
+ function declaredDrivesToDefaults(projectRoot, declarations) {
58
+ return declarations.map((declaration) => {
59
+ const drive = resolveDriveDeclaration(projectRoot, declaration);
60
+ if (drive.kind === "remote") return {
61
+ url: drive.remoteUrl,
62
+ name: drive.name,
63
+ icon: drive.icon ?? null
64
+ };
65
+ return {
66
+ local: true,
67
+ id: drive.id,
68
+ name: drive.name,
69
+ icon: drive.icon ?? null,
70
+ ...drive.preferredEditor ? { app: drive.preferredEditor } : {}
71
+ };
72
+ });
73
+ }
74
+ function callerOverride(host, ctx, verb = "dev") {
53
75
  const base = host.config ?? {};
54
76
  const reactor = host.reactor;
77
+ const entries = host.runner.plugins;
78
+ const composition = entries === void 0 ? void 0 : normalizePluginEntries(entries, `hosts/${host.name}/host.js`).filter((entry) => entryActiveForVerb(entry, verb)).map((entry) => ({
79
+ module: entry.module,
80
+ config: entry.config
81
+ }));
82
+ const declared = reactor?.drives;
83
+ const declaredDefaults = declared && ctx ? declaredDrivesToDefaults(ctx.projectRoot, declared) : void 0;
84
+ const reactorRenown = reactor?.renown;
85
+ const reactorNamespace = reactor?.namespace;
86
+ base.drives = declaredDefaults ? {
87
+ ...base.drives,
88
+ defaultDrives: mergeDefaultDrives(declaredDefaults, base.drives?.defaultDrives ?? []),
89
+ preserveStrategy: base.drives?.preserveStrategy ?? "preserve-all"
90
+ } : base.drives;
91
+ if (composition) base.composition = composition;
92
+ if (reactorRenown) base.renown = {
93
+ ...reactorRenown,
94
+ ...base.renown
95
+ };
96
+ if (reactorNamespace !== void 0) base.instance = {
97
+ ...base.instance,
98
+ namespace: base.instance?.namespace ?? reactorNamespace
99
+ };
55
100
  const { connect } = projectReactorToConnect(reactor);
56
101
  const structural = isStructuralMultiReactor(reactor);
57
102
  if (!connect.reactor && !connect.instance && !connect.app && !structural) return host.config;
@@ -84,16 +129,16 @@ function callerOverride(host) {
84
129
  } } : {}
85
130
  };
86
131
  }
87
- async function dev(host, _ctx) {
88
- const { runConnectStudio } = await import("../connect-studio-CM4t2tWz.mjs");
89
- await runConnectStudio(toStudioArgs(host), void 0, callerOverride(host));
132
+ async function dev(host, ctx) {
133
+ const { runConnectStudio } = await import("../connect-studio-BbsQuED_.mjs");
134
+ await runConnectStudio(toStudioArgs(host), void 0, callerOverride(host, ctx, ctx.verb ?? "dev"));
90
135
  }
91
136
  /** `run` is dev-studio until the plugin phases give hosts a production
92
137
  * runtime; `serve` (below) is the static production server. */
93
138
  const run = dev;
94
139
  /** P3.3 — `build`: the SAME service as classic `ph connect build`. */
95
140
  async function build(host, _ctx) {
96
- const { runConnectBuild } = await import("../connect-build-EYGNSUc_.mjs");
141
+ const { runConnectBuild } = await import("../connect-build-D9zrBKG4.mjs");
97
142
  const runner = host.runner;
98
143
  await runConnectBuild({ outDir: typeof runner.outDir === "string" ? runner.outDir : "dist" });
99
144
  }
@@ -105,7 +150,7 @@ async function build(host, _ctx) {
105
150
  * `runner.cspRegistrySync` (set by the compound's wiring) patches the baked
106
151
  * CSP's script-src for the runtime registry — together these replace the
107
152
  * ph-win-desktop sidecar's hand-rolled static server (desktop shape). */
108
- async function serve(host, _ctx) {
153
+ async function serve(host, ctx) {
109
154
  const { runConnectPreview } = await import("../connect-preview-Clue7SVp.mjs");
110
155
  const runner = host.runner;
111
156
  await runConnectPreview({
@@ -118,7 +163,7 @@ async function serve(host, _ctx) {
118
163
  bindCLIShortcuts: false,
119
164
  host: typeof runner.host === "string" ? runner.host : "127.0.0.1"
120
165
  }, {
121
- connect: callerOverride(host),
166
+ connect: callerOverride(host, ctx, ctx.verb ?? "serve"),
122
167
  cspRegistrySync: runner.cspRegistrySync === true
123
168
  });
124
169
  }
@@ -126,4 +171,4 @@ async function serve(host, _ctx) {
126
171
  export { build, dev, hostSchema, kind, run, serve };
127
172
 
128
173
  //# sourceMappingURL=connect.mjs.map
129
- //# debugId=6fb9c616-bc5a-5744-8e61-012c2da6a7a3
174
+ //# debugId=5b86c164-98a1-51be-b822-87396489d626
@@ -1 +1 @@
1
- {"version":3,"file":"connect.mjs","sources":["../../src/runners/connect.ts"],"sourcesContent":["import {\n DEFAULT_CONNECT_STUDIO_PORT,\n type PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport {\n isStructuralMultiReactor,\n profileSchema,\n projectDrivesIntoConnect,\n projectReactorToConnect,\n reactorSchema,\n remoteBackendUrls,\n type HostDefinition,\n type ReactorConfig,\n type RunnerContext,\n} from \"@powerhousedao/host-core\";\nimport { z } from \"zod\";\nimport type {\n ConnectBuildArgs,\n ConnectPreviewArgs,\n ConnectStudioArgs,\n} from \"../types.js\";\n\n/**\n * BRIDGE runner for Connect hosts (uniform-runners phase 0): maps a\n * hosts/connect/host.js definition onto the SAME service the classic\n * `ph connect studio` command calls — no forked behavior. Real verbs\n * (`build`, `serve`) arrive with later phases; their absence here is\n * deliberate and surfaces through the verb-listing error.\n */\n\nexport const kind = \"reactor\";\n\n/** Phase-2 schema (D2.d): `reactor` and `profile` validate strictly via the\n * shared host-core schemas — a typo'd protocol key fails instead of silently\n * not applying. `config` stays loose: it is runner-defined by design. */\nexport const hostSchema = z.looseObject({\n name: z.string().min(1),\n runner: z.looseObject({\n module: z.string(),\n port: z.number().int().positive().optional(),\n https: z.boolean().optional(),\n openBrowser: z.boolean().optional(),\n plugins: z.string().optional(),\n }),\n config: z.looseObject({}).optional(),\n profile: profileSchema,\n reactor: reactorSchema.optional(),\n});\n\n/** The studio arg surface is wide (commonArgs + server args); the service only\n * reads a known subset, and the repo's own tests build these objects the same\n * way (Partial + cast — see connect-build.test.ts `mk()`). */\nfunction toStudioArgs(host: HostDefinition): ConnectStudioArgs {\n const runner = host.runner;\n const args: Partial<ConnectStudioArgs> = {\n port:\n typeof runner.port === \"number\"\n ? runner.port\n : DEFAULT_CONNECT_STUDIO_PORT,\n open: runner.openBrowser === true,\n strictPort: runner.strictPort === true,\n printUrls: true,\n bindCLIShortcuts: false,\n };\n return args as ConnectStudioArgs;\n}\n\n/** Merge the reactor-block projection (protocol → connect.reactor,\n * backend kind → instance.reactorWorker, workflows → app.workflowsEnabled)\n * into the host's connect config, which rides the studio caller-override.\n * The host config wins on conflict (an explicit connect.* value is intent) —\n * EXCEPT structural multi-reactor (P4.2): declaring a remote backend next to\n * a local one IS the intent, so it beats a scaffold-default\n * instance.multiReactor: false, and the remote's drive url merges FIRST into\n * drives.defaultDrives (the first url entry is what the routing client dials). */\nfunction callerOverride(\n host: HostDefinition,\n): PHConnectRuntimeConfig | undefined {\n const base = (host.config ?? {}) as PHConnectRuntimeConfig;\n const reactor = host.reactor as ReactorConfig | undefined;\n const { connect } = projectReactorToConnect(reactor);\n const structural = isStructuralMultiReactor(reactor);\n if (!connect.reactor && !connect.instance && !connect.app && !structural) {\n return host.config as PHConnectRuntimeConfig | undefined;\n }\n const drives = structural\n ? projectDrivesIntoConnect({\n createdDriveUrls: remoteBackendUrls(reactor),\n configuredDefaultDrives: base.drives?.defaultDrives,\n }).drives\n : base.drives;\n // When the host DECLARES backends, instance facts derive from them and win\n // over config defaults (declaring `kind: \"worker\"` is more explicit intent\n // than a scaffold's `reactorWorker: false`); without backends the P2 rule\n // stands — an explicit connect.* value wins over descriptive projection.\n const declaresBackends = Object.keys(reactor?.backends ?? {}).length > 0;\n const instance = declaresBackends\n ? {\n ...base.instance,\n ...connect.instance,\n ...(structural ? { multiReactor: true } : {}),\n }\n : { ...connect.instance, ...base.instance };\n return {\n ...base,\n reactor: { ...connect.reactor, ...base.reactor },\n instance: instance as never,\n app: { ...connect.app, ...base.app },\n ...(drives ? { drives: { ...base.drives, ...drives } } : {}),\n };\n}\n\nexport async function dev(\n host: HostDefinition,\n _ctx: RunnerContext,\n): Promise<void> {\n const { runConnectStudio } = await import(\"../services/connect-studio.js\");\n await runConnectStudio(toStudioArgs(host), undefined, callerOverride(host));\n}\n\n/** `run` is dev-studio until the plugin phases give hosts a production\n * runtime; `serve` (below) is the static production server. */\nexport const run = dev;\n\n/** P3.3 — `build`: the SAME service as classic `ph connect build`. */\nexport async function build(\n host: HostDefinition,\n _ctx: RunnerContext,\n): Promise<void> {\n const { runConnectBuild } = await import(\"../services/connect-build.js\");\n const runner = host.runner;\n const args: Partial<ConnectBuildArgs> = {\n outDir: typeof runner.outDir === \"string\" ? runner.outDir : \"dist\",\n };\n await runConnectBuild(args as ConnectBuildArgs);\n}\n\n/** P3.3 — `serve`: the SAME vite preview server as classic\n * `ph connect preview` (static serve of a built Connect; run `build` first).\n * The host's connect config (including a supervising compound's projected\n * drives and the reactor projection) rides a serve override: the baked\n * powerhouse.config.json merges with it at request time, and\n * `runner.cspRegistrySync` (set by the compound's wiring) patches the baked\n * CSP's script-src for the runtime registry — together these replace the\n * ph-win-desktop sidecar's hand-rolled static server (desktop shape). */\nexport async function serve(\n host: HostDefinition,\n _ctx: RunnerContext,\n): Promise<void> {\n const { runConnectPreview } = await import(\"../services/connect-preview.js\");\n const runner = host.runner;\n const args: Partial<ConnectPreviewArgs> = {\n port:\n typeof runner.port === \"number\"\n ? runner.port\n : DEFAULT_CONNECT_STUDIO_PORT,\n outDir: typeof runner.outDir === \"string\" ? runner.outDir : \"dist\",\n open: runner.openBrowser === true,\n strictPort: runner.strictPort === true,\n cors: true,\n printUrls: true,\n bindCLIShortcuts: false,\n // Explicit IPv4 loopback (runner.host overrides): vite's default\n // \"localhost\" can bind ::1 only on Windows, and a supervising shell\n // (ph-win) probes 127.0.0.1 — the sidecar this replaces bound 127.0.0.1.\n host: typeof runner.host === \"string\" ? runner.host : \"127.0.0.1\",\n };\n const override = callerOverride(host);\n await runConnectPreview(args as ConnectPreviewArgs, {\n connect: override,\n cspRegistrySync: runner.cspRegistrySync === true,\n });\n}\n"],"names":["z.looseObject","z.string","z.number","z.boolean"],"mappings":";;;;;;;;;;;;;AA8BA,MAAa,OAAO;;;;AAKpB,MAAa,aAAaA,YAAc;CACtC,MAAMC,OAAS,CAAC,CAAC,IAAI,CAAC;CACtB,QAAQD,YAAc;EACpB,QAAQC,OAAS;EACjB,MAAMC,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,S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AO,EAAE,IAAI,CAAC;CAC5D;AACF;AAEA,eAAsB,IACpB,MACA,MACe;CACf,MAAM,EAAE,qBAAqB,MAAM,OAAO;CAC1C,MAAM,iBAAiB,aAAa,IAAI,GAAG,KAAA,GAAW,eAAe,IAAI,CAAC;AAC5E;;;AAIA,MAAa,MAAM;;AAGnB,eAAsB,MACpB,MACA,MACe;CACf,MAAM,EAAE,oBAAoB,MAAM,OAAO;CACzC,MAAM,SAAS,KAAK;CAIpB,MAAM,gBAAgB,EAFpB,QAAQ,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS,OAErC,CAAqB;AAChD;;;;;;;;;AAUA,eAAsB,MACpB,MACA,MACe;CACf,MAAM,EAAE,sBAAsB,MAAM,OAAO;CAC3C,MAAM,SAAS,KAAK;CAkBpB,MAAM,kBAAkB;EAhBtB,MACE,OAAO,OAAO,SAAS,WACnB,OAAO,OACP;EACN,QAAQ,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS;EAC5D,MAAM,OAAO,gBAAgB;EAC7B,YAAY,OAAO,eAAe;EAClC,MAAM;EACN,WAAW;EACX,kBAAkB;EAIlB,MAAM,OAAO,OAAO,SAAS,WAAW,OAAO,OAAO;CAG7B,GAAyB;EAClD,SAFe,eAAe,IAEd;EAChB,iBAAiB,OAAO,oBAAoB;CAC9C,CAAC;AACH","debug_id":"6fb9c616-bc5a-5744-8e61-012c2da6a7a3"}
1
+ {"version":3,"file":"connect.mjs","sources":["../../src/runners/connect.ts"],"sourcesContent":["import {\n DEFAULT_CONNECT_STUDIO_PORT,\n type PHConnectCompositionEntry,\n type PHConnectDefaultDrive,\n type PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport {\n entryActiveForVerb,\n isStructuralMultiReactor,\n mergeDefaultDrives,\n normalizePluginEntries,\n pluginEntrySchema,\n profileSchema,\n resolveDriveDeclaration,\n type DriveDeclaration,\n type PluginEntry,\n projectDrivesIntoConnect,\n projectReactorToConnect,\n reactorSchema,\n remoteBackendUrls,\n type HostDefinition,\n type ReactorConfig,\n type RunnerContext,\n} from \"@powerhousedao/host-core\";\nimport { z } from \"zod\";\nimport type {\n ConnectBuildArgs,\n ConnectPreviewArgs,\n ConnectStudioArgs,\n} from \"../types.js\";\n\n/**\n * BRIDGE runner for Connect hosts (uniform-runners phase 0): maps a\n * hosts/connect/host.js definition onto the SAME service the classic\n * `ph connect studio` command calls — no forked behavior. Real verbs\n * (`build`, `serve`) arrive with later phases; their absence here is\n * deliberate and surfaces through the verb-listing error.\n */\n\nexport const kind = \"reactor\";\n\n/** Phase-2 schema (D2.d): `reactor` and `profile` validate strictly via the\n * shared host-core schemas — a typo'd protocol key fails instead of silently\n * not applying. `config` stays loose: it is runner-defined by design. */\nexport const hostSchema = z.looseObject({\n name: z.string().min(1),\n runner: z.looseObject({\n module: z.string(),\n port: z.number().int().positive().optional(),\n host: z.string().optional(),\n https: z.boolean().optional(),\n openBrowser: z.boolean().optional(),\n // THE COMPOSITION (rewire R3): plugin entries, presence is activation.\n plugins: z.array(pluginEntrySchema).optional(),\n }),\n config: z.looseObject({}).optional(),\n profile: profileSchema,\n reactor: reactorSchema.optional(),\n});\n\n/** The studio arg surface is wide (commonArgs + server args); the service only\n * reads a known subset, and the repo's own tests build these objects the same\n * way (Partial + cast — see connect-build.test.ts `mk()`). */\nfunction toStudioArgs(host: HostDefinition): ConnectStudioArgs {\n const runner = host.runner;\n const args: Partial<ConnectStudioArgs> = {\n port:\n typeof runner.port === \"number\"\n ? runner.port\n : DEFAULT_CONNECT_STUDIO_PORT,\n open: runner.openBrowser === true,\n strictPort: runner.strictPort === true,\n printUrls: true,\n bindCLIShortcuts: false,\n };\n return args as ConnectStudioArgs;\n}\n\n/** Merge the reactor-block projection (protocol → connect.reactor,\n * backend kind → instance.reactorWorker, workflows → app.workflowsEnabled)\n * into the host's connect config, which rides the studio caller-override.\n * The host config wins on conflict (an explicit connect.* value is intent) —\n * EXCEPT structural multi-reactor (P4.2): declaring a remote backend next to\n * a local one IS the intent, so it beats a scaffold-default\n * instance.multiReactor: false, and the remote's drive url merges FIRST into\n * drives.defaultDrives (the first url entry is what the routing client dials). */\n/** host.js reactor.drives -> the served drives.defaultDrives shapes: locals\n * carry id/name/icon and the preferredEditor under its Connect alias `app`;\n * remotes carry their URL. */\nfunction declaredDrivesToDefaults(\n projectRoot: string,\n declarations: readonly DriveDeclaration[],\n): PHConnectDefaultDrive[] {\n return declarations.map((declaration) => {\n const drive = resolveDriveDeclaration(projectRoot, declaration);\n if (drive.kind === \"remote\") {\n return {\n url: drive.remoteUrl!,\n name: drive.name,\n icon: drive.icon ?? null,\n };\n }\n return {\n local: true as const,\n id: drive.id,\n name: drive.name,\n icon: drive.icon ?? null,\n ...(drive.preferredEditor ? { app: drive.preferredEditor } : {}),\n };\n });\n}\n\nfunction callerOverride(\n host: HostDefinition,\n ctx?: RunnerContext,\n verb = \"dev\",\n): PHConnectRuntimeConfig | undefined {\n const base = (host.config ?? {}) as PHConnectRuntimeConfig;\n const reactor = host.reactor as ReactorConfig | undefined;\n\n // R3: the composition (verb-filtered, projected as DATA — the browser\n // pipeline resolves and runs the entries), declared drives, and the\n // reactor-core identity/namespace keys.\n const entries = (host.runner as { plugins?: PluginEntry[] }).plugins;\n const composition: PHConnectCompositionEntry[] | undefined =\n entries === undefined\n ? undefined\n : normalizePluginEntries(entries, `hosts/${host.name}/host.js`)\n .filter((entry) => entryActiveForVerb(entry, verb))\n .map((entry) => ({ module: entry.module, config: entry.config }));\n const declared = (reactor as { drives?: DriveDeclaration[] } | undefined)\n ?.drives;\n const declaredDefaults =\n declared && ctx\n ? declaredDrivesToDefaults(ctx.projectRoot, declared)\n : undefined;\n const reactorRenown = (reactor as { renown?: unknown } | undefined)?.renown;\n const reactorNamespace = (reactor as { namespace?: string } | undefined)\n ?.namespace;\n base.drives = declaredDefaults\n ? {\n ...base.drives,\n defaultDrives: mergeDefaultDrives(\n declaredDefaults,\n base.drives?.defaultDrives ?? [],\n ),\n preserveStrategy: base.drives?.preserveStrategy ?? \"preserve-all\",\n }\n : base.drives;\n if (composition) base.composition = composition;\n if (reactorRenown)\n base.renown = { ...(reactorRenown as object), ...base.renown };\n if (reactorNamespace !== undefined)\n base.instance = {\n ...base.instance,\n namespace: base.instance?.namespace ?? reactorNamespace,\n } as typeof base.instance;\n const { connect } = projectReactorToConnect(reactor);\n const structural = isStructuralMultiReactor(reactor);\n if (!connect.reactor && !connect.instance && !connect.app && !structural) {\n return host.config as PHConnectRuntimeConfig | undefined;\n }\n const drives = structural\n ? projectDrivesIntoConnect({\n createdDriveUrls: remoteBackendUrls(reactor),\n configuredDefaultDrives: base.drives?.defaultDrives,\n }).drives\n : base.drives;\n // When the host DECLARES backends, instance facts derive from them and win\n // over config defaults (declaring `kind: \"worker\"` is more explicit intent\n // than a scaffold's `reactorWorker: false`); without backends the P2 rule\n // stands — an explicit connect.* value wins over descriptive projection.\n const declaresBackends = Object.keys(reactor?.backends ?? {}).length > 0;\n const instance = declaresBackends\n ? {\n ...base.instance,\n ...connect.instance,\n ...(structural ? { multiReactor: true } : {}),\n }\n : { ...connect.instance, ...base.instance };\n return {\n ...base,\n reactor: { ...connect.reactor, ...base.reactor },\n instance: instance as never,\n app: { ...connect.app, ...base.app },\n ...(drives ? { drives: { ...base.drives, ...drives } } : {}),\n };\n}\n\nexport async function dev(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<void> {\n const { runConnectStudio } = await import(\"../services/connect-studio.js\");\n await runConnectStudio(\n toStudioArgs(host),\n undefined,\n callerOverride(host, ctx, ctx.verb ?? \"dev\"),\n );\n}\n\n/** `run` is dev-studio until the plugin phases give hosts a production\n * runtime; `serve` (below) is the static production server. */\nexport const run = dev;\n\n/** P3.3 — `build`: the SAME service as classic `ph connect build`. */\nexport async function build(\n host: HostDefinition,\n _ctx: RunnerContext,\n): Promise<void> {\n const { runConnectBuild } = await import(\"../services/connect-build.js\");\n const runner = host.runner;\n const args: Partial<ConnectBuildArgs> = {\n outDir: typeof runner.outDir === \"string\" ? runner.outDir : \"dist\",\n };\n await runConnectBuild(args as ConnectBuildArgs);\n}\n\n/** P3.3 — `serve`: the SAME vite preview server as classic\n * `ph connect preview` (static serve of a built Connect; run `build` first).\n * The host's connect config (including a supervising compound's projected\n * drives and the reactor projection) rides a serve override: the baked\n * powerhouse.config.json merges with it at request time, and\n * `runner.cspRegistrySync` (set by the compound's wiring) patches the baked\n * CSP's script-src for the runtime registry — together these replace the\n * ph-win-desktop sidecar's hand-rolled static server (desktop shape). */\nexport async function serve(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<void> {\n const { runConnectPreview } = await import(\"../services/connect-preview.js\");\n const runner = host.runner;\n const args: Partial<ConnectPreviewArgs> = {\n port:\n typeof runner.port === \"number\"\n ? runner.port\n : DEFAULT_CONNECT_STUDIO_PORT,\n outDir: typeof runner.outDir === \"string\" ? runner.outDir : \"dist\",\n open: runner.openBrowser === true,\n strictPort: runner.strictPort === true,\n cors: true,\n printUrls: true,\n bindCLIShortcuts: false,\n // Explicit IPv4 loopback (runner.host overrides): vite's default\n // \"localhost\" can bind ::1 only on Windows, and a supervising shell\n // (ph-win) probes 127.0.0.1 — the sidecar this replaces bound 127.0.0.1.\n host: typeof runner.host === \"string\" ? runner.host : \"127.0.0.1\",\n };\n const override = callerOverride(host, ctx, ctx.verb ?? \"serve\");\n await runConnectPreview(args as ConnectPreviewArgs, {\n connect: override,\n cspRegistrySync: runner.cspRegistrySync === true,\n });\n}\n"],"names":["z.looseObject","z.string","z.number","z.boolean","z.array"],"mappings":";;;;;;;;;;;;;;AAuCA,MAAa,OAAO;;;;AAKpB,MAAa,aAAaA,YAAc;CACtC,MAAMC,OAAS,CAAC,CAAC,IAAI,CAAC;CACtB,QAAQD,YAAc;EACpB,QAAQC,OAAS;EACjB,MAAMC,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAC3C,MAAMD,OAAS,CAAC,CAAC,SAAS;EAC1B,OAAOE,QAAU,CA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a,IAAI,GACjB,KAAA,GACA,eAAe,MAAM,KAAK,IAAI,QAAQ,KAAK,CAC7C;AACF;;;AAIA,MAAa,MAAM;;AAGnB,eAAsB,MACpB,MACA,MACe;CACf,MAAM,EAAE,oBAAoB,MAAM,OAAO;CACzC,MAAM,SAAS,KAAK;CAIpB,MAAM,gBAAgB,EAFpB,QAAQ,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS,OAErC,CAAqB;AAChD;;;;;;;;;AAUA,eAAsB,MACpB,MACA,KACe;CACf,MAAM,EAAE,sBAAsB,MAAM,OAAO;CAC3C,MAAM,SAAS,KAAK;CAkBpB,MAAM,kBAAkB;EAhBtB,MACE,OAAO,OAAO,SAAS,WACnB,OAAO,OACP;EACN,QAAQ,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS;EAC5D,MAAM,OAAO,gBAAgB;EAC7B,YAAY,OAAO,eAAe;EAClC,MAAM;EACN,WAAW;EACX,kBAAkB;EAIlB,MAAM,OAAO,OAAO,SAAS,WAAW,OAAO,OAAO;CAG7B,GAAyB;EAClD,SAFe,eAAe,MAAM,KAAK,IAAI,QAAQ,OAErC;EAChB,iBAAiB,OAAO,oBAAoB;CAC9C,CAAC;AACH","debug_id":"5b86c164-98a1-51be-b822-87396489d626"}
@@ -1,4 +1,4 @@
1
- import { a as ZodBoolean, c as ZodObject, d as ZodString, f as $loose, i as ZodArray, l as ZodOptional, n as RunnerContext, o as ZodEnum, p as $strict, r as external_d_exports, s as ZodNumber, t as HostDefinition, u as ZodRecord } from "../index-s1ABBFjB.mjs";
1
+ import { a as ZodBoolean, c as ZodNumber, d as ZodRecord, f as ZodString, g as $strict, h as $loose, i as ZodArray, l as ZodObject, m as ZodUnknown, n as RunnerContext, o as ZodEnum, p as ZodUnion, r as external_d_exports, s as ZodLiteral, t as HostDefinition, u as ZodOptional } from "../index-CApW1xbO.mjs";
2
2
  //#region src/runners/switchboard.d.ts
3
3
  /**
4
4
  * BRIDGE runner for Switchboard hosts (uniform-runners phase 0): maps a
@@ -15,7 +15,12 @@ export declare const hostSchema: ZodObject<{
15
15
  module: ZodString;
16
16
  port: ZodOptional<ZodNumber>;
17
17
  https: ZodOptional<ZodBoolean>;
18
- plugins: ZodOptional<ZodString>;
18
+ plugins: ZodOptional<ZodArray<ZodUnion<readonly [ZodString, ZodObject<{
19
+ module: ZodString;
20
+ enabled: ZodOptional<ZodBoolean>;
21
+ verbs: ZodOptional<ZodUnion<readonly [ZodLiteral<"*">, ZodArray<ZodString>]>>;
22
+ config: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
23
+ }, $strict>]>>>;
19
24
  }, $loose>;
20
25
  config: ZodOptional<ZodObject<{}, $loose>>;
21
26
  profile: ZodOptional<ZodObject<{
@@ -53,12 +58,18 @@ export declare const hostSchema: ZodObject<{
53
58
  host: ZodOptional<ZodString>;
54
59
  url: ZodOptional<ZodString>;
55
60
  }, $strict>>;
61
+ projection: ZodOptional<ZodObject<{
62
+ enabled: ZodOptional<ZodBoolean>;
63
+ dbPoolSize: ZodOptional<ZodNumber>;
64
+ }, $strict>>;
65
+ executors: ZodOptional<ZodObject<{
66
+ numWorkers: ZodOptional<ZodUnion<readonly [ZodNumber, ZodLiteral<"auto">]>>;
67
+ }, $strict>>;
56
68
  }, $strict>>>;
57
69
  placement: ZodOptional<ZodObject<{
58
70
  primary: ZodOptional<ZodString>;
59
71
  default: ZodOptional<ZodObject<{}, $loose>>;
60
72
  }, $strict>>;
61
- workflows: ZodOptional<ZodBoolean>;
62
73
  protocol: ZodOptional<ZodObject<{
63
74
  featureFlags: ZodOptional<ZodObject<{
64
75
  documentDecisions: ZodOptional<ZodBoolean>;
@@ -75,6 +86,38 @@ export declare const hostSchema: ZodObject<{
75
86
  refuse: "refuse";
76
87
  }>>;
77
88
  }, $strict>>;
89
+ workflows: ZodOptional<ZodBoolean>;
90
+ renown: ZodOptional<ZodObject<{
91
+ url: ZodOptional<ZodString>;
92
+ networkId: ZodOptional<ZodString>;
93
+ chainId: ZodOptional<ZodNumber>;
94
+ }, $strict>>;
95
+ packages: ZodOptional<ZodObject<{
96
+ registryUrl: ZodOptional<ZodString>;
97
+ }, $strict>>;
98
+ namespace: ZodOptional<ZodString>;
99
+ auth: ZodOptional<ZodObject<{
100
+ enabled: ZodOptional<ZodBoolean>;
101
+ admins: ZodOptional<ZodArray<ZodString>>;
102
+ renown: ZodOptional<ZodObject<{}, $loose>>;
103
+ }, $strict>>;
104
+ drives: ZodOptional<ZodArray<ZodObject<{
105
+ slug: ZodString;
106
+ id: ZodOptional<ZodString>;
107
+ projectHash: ZodOptional<ZodBoolean>;
108
+ name: ZodOptional<ZodString>;
109
+ icon: ZodOptional<ZodString>;
110
+ preferredEditor: ZodOptional<ZodString>;
111
+ sharingType: ZodOptional<ZodEnum<{
112
+ private: "private";
113
+ public: "public";
114
+ shared: "shared";
115
+ }>>;
116
+ availableOffline: ZodOptional<ZodBoolean>;
117
+ remote: ZodOptional<ZodObject<{
118
+ url: ZodString;
119
+ }, $strict>>;
120
+ }, $strict>>>;
78
121
  }, $strict>>;
79
122
  }, $loose>;
80
123
  /** What a started switchboard reports to a supervising compound: its port and
@@ -85,8 +128,8 @@ export interface SwitchboardHandle {
85
128
  endpoints: Record<string, string>;
86
129
  ready: Promise<void>;
87
130
  }
88
- export declare function run(host: HostDefinition, _ctx: RunnerContext): Promise<SwitchboardHandle>;
89
- export declare function dev(host: HostDefinition, _ctx: RunnerContext): Promise<SwitchboardHandle>;
131
+ export declare function run(host: HostDefinition, ctx: RunnerContext): Promise<SwitchboardHandle>;
132
+ export declare function dev(host: HostDefinition, ctx: RunnerContext): Promise<SwitchboardHandle>;
90
133
  //#endregion
91
134
  export {};
92
135
  //# sourceMappingURL=switchboard.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switchboard.d.mts","names":[],"sources":["../../src/runners/switchboard.ts"],"mappings":";;;;;;;;;qBAuBa;;qBAGA,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAWrB;;;iBAiDe;EACf;EACA;EACA,WAAW;EACX,OAAO;;wBA0Ca,IACpB,MAAM,gBACN,MAAM,gBACL,QAAQ;wBAIW,IACpB,MAAM,gBACN,MAAM,gBACL,QAAQ"}
1
+ {"version":3,"file":"switchboard.d.mts","names":[],"sources":["../../src/runners/switchboard.ts"],"mappings":";;;;;;;;;qBAgCa;;qBAGA,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAcrB;;;iBAoDe;EACf;EACA;EACA,WAAW;EACX,OAAO;;wBAqIa,IACpB,MAAM,gBACN,KAAK,gBACJ,QAAQ;wBAIW,IACpB,MAAM,gBACN,KAAK,gBACJ,QAAQ"}