@powerhousedao/ph-cli 6.2.3-dev.7 → 6.2.3-dev.70
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.
- package/dist/{auth-AR3VxAIk.mjs → auth-BFUq7CvE.mjs} +3 -3
- package/dist/{auth-AR3VxAIk.mjs.map → auth-BFUq7CvE.mjs.map} +1 -1
- package/dist/auth-CNhbN5UM.mjs +4 -0
- package/dist/build-C78yPntL.mjs +4 -0
- package/dist/build-Dj8qfSSe.mjs +349 -0
- package/dist/build-Dj8qfSSe.mjs.map +1 -0
- package/dist/{cli-connect-override-D3hh4aH_.mjs → cli-connect-override-Cf7WutqU.mjs} +38 -26
- package/dist/cli-connect-override-Cf7WutqU.mjs.map +1 -0
- package/dist/cli.d.mts +2 -1
- package/dist/cli.mjs +31 -1175
- package/dist/cli.mjs.map +1 -1
- package/dist/connect-build-BtKpvcQK.mjs +253 -0
- package/dist/connect-build-BtKpvcQK.mjs.map +1 -0
- package/dist/{connect-config-BWGiW3IB.mjs → connect-config-9EZB_0H_.mjs} +19 -12
- package/dist/connect-config-9EZB_0H_.mjs.map +1 -0
- package/dist/connect-preview-8-qLgWKt.mjs +215 -0
- package/dist/connect-preview-8-qLgWKt.mjs.map +1 -0
- package/dist/connect-studio-BehPZzN7.mjs +4 -0
- package/dist/{connect-studio-D6rfWCNB.mjs → connect-studio-Bhlc77WI.mjs} +17 -11
- package/dist/connect-studio-Bhlc77WI.mjs.map +1 -0
- package/dist/dist-BqeDFgEy.mjs +223 -0
- package/dist/dist-BqeDFgEy.mjs.map +1 -0
- package/dist/explain-BDHmXgw3.mjs +27 -0
- package/dist/explain-BDHmXgw3.mjs.map +1 -0
- package/dist/feature-flags-xwqcHEWC.mjs +4 -0
- package/dist/{generate-all-DrT4ZxHX.mjs → generate-all-C_sPGBuk.mjs} +5 -3
- package/dist/generate-all-C_sPGBuk.mjs.map +1 -0
- package/dist/{generate-app-DNNqA-H3.mjs → generate-app-BTs1u-9l.mjs} +7 -5
- package/dist/{generate-app-DNNqA-H3.mjs.map → generate-app-BTs1u-9l.mjs.map} +1 -1
- package/dist/generate-desktop-shell-BBSGpmud.mjs +212 -0
- package/dist/generate-desktop-shell-BBSGpmud.mjs.map +1 -0
- package/dist/{generate-document-model-BJXyODfm.mjs → generate-document-model-BfFIQ35q.mjs} +19 -7
- package/dist/generate-document-model-BfFIQ35q.mjs.map +1 -0
- package/dist/{generate-editor-BejvaVVT.mjs → generate-editor-CW7Do69u.mjs} +7 -5
- package/dist/{generate-editor-BejvaVVT.mjs.map → generate-editor-CW7Do69u.mjs.map} +1 -1
- package/dist/generate-piece-QTt-ddt2.mjs +65 -0
- package/dist/generate-piece-QTt-ddt2.mjs.map +1 -0
- package/dist/generate-piece-action-DbxrzfKY.mjs +29 -0
- package/dist/generate-piece-action-DbxrzfKY.mjs.map +1 -0
- package/dist/generate-piece-trigger-CqVOcL9g.mjs +30 -0
- package/dist/generate-piece-trigger-CqVOcL9g.mjs.map +1 -0
- package/dist/{generate-processor-_WOx-mMe.mjs → generate-processor-DBtTkgo5.mjs} +15 -8
- package/dist/generate-processor-DBtTkgo5.mjs.map +1 -0
- package/dist/{generate-subgraph-BsHUstpl.mjs → generate-subgraph-CVlTo7qk.mjs} +12 -6
- package/dist/generate-subgraph-CVlTo7qk.mjs.map +1 -0
- package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs +493 -0
- package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs.map +1 -0
- package/dist/index-CspiP73o.d.mts +4295 -0
- package/dist/index-CspiP73o.d.mts.map +1 -0
- package/dist/{init-BZP6gvYd.mjs → init-ScuT3z7P.mjs} +7 -5
- package/dist/init-ScuT3z7P.mjs.map +1 -0
- package/dist/{inspect-DXjbQEV_.mjs → inspect-zWJnBDMJ.mjs} +11 -4
- package/dist/inspect-zWJnBDMJ.mjs.map +1 -0
- package/dist/install-added-dependencies-DVSbzler.mjs +33 -0
- package/dist/install-added-dependencies-DVSbzler.mjs.map +1 -0
- package/dist/{migrate-jGKfE02L.mjs → migrate-DK4HK7Dn.mjs} +4 -4
- package/dist/{migrate-jGKfE02L.mjs.map → migrate-DK4HK7Dn.mjs.map} +1 -1
- package/dist/ph-cli-commands-3ptdQ0NI.mjs +1476 -0
- package/dist/ph-cli-commands-3ptdQ0NI.mjs.map +1 -0
- package/dist/ph-cli-commands-Dx8hNj6W.mjs +4 -0
- package/dist/plugins-CHVv4qup.mjs +91 -0
- package/dist/plugins-CHVv4qup.mjs.map +1 -0
- package/dist/precompress-P6cJDPVC.mjs +77 -0
- package/dist/precompress-P6cJDPVC.mjs.map +1 -0
- package/dist/reactor-env-BbR86_Li.mjs +29 -0
- package/dist/reactor-env-BbR86_Li.mjs.map +1 -0
- package/dist/reactor-env-D_EvBtLB.mjs +4 -0
- package/dist/{registry-auth-DxEWCJu2.mjs → registry-auth-Bm5AR-fB.mjs} +4 -4
- package/dist/{registry-auth-DxEWCJu2.mjs.map → registry-auth-Bm5AR-fB.mjs.map} +1 -1
- package/dist/run-sugar-BdjKTPGO.mjs +39 -0
- package/dist/run-sugar-BdjKTPGO.mjs.map +1 -0
- package/dist/runners/compound.d.mts +127 -0
- package/dist/runners/compound.d.mts.map +1 -0
- package/dist/runners/compound.mjs +72 -0
- package/dist/runners/compound.mjs.map +1 -0
- package/dist/runners/connect.d.mts +145 -0
- package/dist/runners/connect.d.mts.map +1 -0
- package/dist/runners/connect.mjs +198 -0
- package/dist/runners/connect.mjs.map +1 -0
- package/dist/runners/switchboard.d.mts +198 -0
- package/dist/runners/switchboard.d.mts.map +1 -0
- package/dist/runners/switchboard.mjs +172 -0
- package/dist/runners/switchboard.mjs.map +1 -0
- package/dist/schemas-BQSPev1x.mjs +5537 -0
- package/dist/schemas-BQSPev1x.mjs.map +1 -0
- package/dist/scripts/generate-commands-docs.ts +8 -0
- package/dist/scripts/manage-environment +0 -0
- package/dist/scripts/setup.sh +0 -0
- package/dist/start-run-CmDxyMw0.mjs +36 -0
- package/dist/start-run-CmDxyMw0.mjs.map +1 -0
- package/dist/superseded-config-9D7BdLvd.mjs +53 -0
- package/dist/superseded-config-9D7BdLvd.mjs.map +1 -0
- package/dist/switchboard-C5zgkRl2.mjs +4 -0
- package/dist/switchboard-h4-XgP1h.mjs +129 -0
- package/dist/switchboard-h4-XgP1h.mjs.map +1 -0
- package/dist/{switchboard-migrate-NQ7LHWSi.mjs → switchboard-migrate-7JQZM7-5.mjs} +5 -4
- package/dist/{switchboard-migrate-NQ7LHWSi.mjs.map → switchboard-migrate-7JQZM7-5.mjs.map} +1 -1
- package/dist/{switchboard-reset-BcQXlcVf.mjs → switchboard-reset-MtTB_GAI.mjs} +8 -6
- package/dist/switchboard-reset-MtTB_GAI.mjs.map +1 -0
- package/dist/{utils-C4isxXSO.mjs → utils-9KyRM0mf.mjs} +6 -34
- package/dist/{utils-C4isxXSO.mjs.map → utils-9KyRM0mf.mjs.map} +1 -1
- package/dist/utils-TO9lB8Xs.mjs +4 -0
- package/dist/{vetra-DkF6EJMY.mjs → vetra-BD-34wGs.mjs} +68 -33
- package/dist/vetra-BD-34wGs.mjs.map +1 -0
- package/dist/warn-subgraph-type-conflicts-BOHBmThq.mjs +19 -0
- package/dist/warn-subgraph-type-conflicts-BOHBmThq.mjs.map +1 -0
- package/package.json +43 -17
- package/dist/auth-BNkN6kS9.mjs +0 -4
- package/dist/build-C-A5-ipO.mjs +0 -4
- package/dist/build-uQXq6_HU.mjs +0 -71
- package/dist/build-uQXq6_HU.mjs.map +0 -1
- package/dist/cli-connect-override-D3hh4aH_.mjs.map +0 -1
- package/dist/connect-build-WL4axo4z.mjs +0 -43
- package/dist/connect-build-WL4axo4z.mjs.map +0 -1
- package/dist/connect-config-BWGiW3IB.mjs.map +0 -1
- package/dist/connect-preview-D7ypzFDc.mjs +0 -28
- package/dist/connect-preview-D7ypzFDc.mjs.map +0 -1
- package/dist/connect-studio-BIQzyq5B.mjs +0 -5
- package/dist/connect-studio-D6rfWCNB.mjs.map +0 -1
- package/dist/generate-all-DrT4ZxHX.mjs.map +0 -1
- package/dist/generate-document-model-BJXyODfm.mjs.map +0 -1
- package/dist/generate-processor-_WOx-mMe.mjs.map +0 -1
- package/dist/generate-subgraph-BsHUstpl.mjs.map +0 -1
- package/dist/init-BZP6gvYd.mjs.map +0 -1
- package/dist/inspect-DXjbQEV_.mjs.map +0 -1
- package/dist/switchboard-CJMoMzWx.mjs +0 -75
- package/dist/switchboard-CJMoMzWx.mjs.map +0 -1
- package/dist/switchboard-iRFugh8I.mjs +0 -4
- package/dist/switchboard-reset-BcQXlcVf.mjs.map +0 -1
- package/dist/utils-BzwczAW-.mjs +0 -4
- package/dist/vetra-DkF6EJMY.mjs.map +0 -1
|
@@ -0,0 +1,198 @@
|
|
|
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-CspiP73o.mjs";
|
|
2
|
+
import { ParsedCmdResult } from "@powerhousedao/shared/clis";
|
|
3
|
+
//#region src/commands/switchboard.d.ts
|
|
4
|
+
declare const switchboard: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
5
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
6
|
+
debug: boolean | undefined;
|
|
7
|
+
https: boolean | undefined;
|
|
8
|
+
httpsKeyFile: string | undefined;
|
|
9
|
+
httpsCertFile: string | undefined;
|
|
10
|
+
dev: boolean | undefined;
|
|
11
|
+
remoteDrives: string[];
|
|
12
|
+
disableLocalPackages: boolean;
|
|
13
|
+
packages: string | undefined;
|
|
14
|
+
port: number;
|
|
15
|
+
basePath: string | undefined;
|
|
16
|
+
keypairPath: string | undefined;
|
|
17
|
+
vetraDriveId: string;
|
|
18
|
+
dbPath: string | undefined;
|
|
19
|
+
useIdentity: boolean | undefined;
|
|
20
|
+
requireIdentity: boolean | undefined;
|
|
21
|
+
migrate: boolean | undefined;
|
|
22
|
+
migrateStatus: boolean | undefined;
|
|
23
|
+
reset: boolean | undefined;
|
|
24
|
+
yes: boolean | undefined;
|
|
25
|
+
mcp: boolean;
|
|
26
|
+
useVetraDrive: boolean;
|
|
27
|
+
}>>;
|
|
28
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
29
|
+
debug: boolean | undefined;
|
|
30
|
+
https: boolean | undefined;
|
|
31
|
+
httpsKeyFile: string | undefined;
|
|
32
|
+
httpsCertFile: string | undefined;
|
|
33
|
+
dev: boolean | undefined;
|
|
34
|
+
remoteDrives: string[];
|
|
35
|
+
disableLocalPackages: boolean;
|
|
36
|
+
packages: string | undefined;
|
|
37
|
+
port: number;
|
|
38
|
+
basePath: string | undefined;
|
|
39
|
+
keypairPath: string | undefined;
|
|
40
|
+
vetraDriveId: string;
|
|
41
|
+
dbPath: string | undefined;
|
|
42
|
+
useIdentity: boolean | undefined;
|
|
43
|
+
requireIdentity: boolean | undefined;
|
|
44
|
+
migrate: boolean | undefined;
|
|
45
|
+
migrateStatus: boolean | undefined;
|
|
46
|
+
reset: boolean | undefined;
|
|
47
|
+
yes: boolean | undefined;
|
|
48
|
+
mcp: boolean;
|
|
49
|
+
useVetraDrive: boolean;
|
|
50
|
+
}, Promise<void>> & {
|
|
51
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<Promise<void>>>;
|
|
52
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/types.d.ts
|
|
55
|
+
type SwitchboardArgs = ParsedCmdResult<typeof switchboard>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/runners/switchboard.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* BRIDGE runner for Switchboard hosts (uniform-runners phase 0): maps a
|
|
60
|
+
* hosts/switchboard/host.js definition onto the SAME `startSwitchboard`
|
|
61
|
+
* service the classic command calls. `run` = production loaders, `dev` =
|
|
62
|
+
* Vite package loader (worker pools refused by the server, as always).
|
|
63
|
+
* There is deliberately no `build` verb — the switchboard has none.
|
|
64
|
+
*/
|
|
65
|
+
export declare const kind = "reactor";
|
|
66
|
+
/** Phase-2 schema (D2.d): `reactor`/`profile` strict via host-core. */
|
|
67
|
+
export declare const hostSchema: ZodObject<{
|
|
68
|
+
name: ZodString;
|
|
69
|
+
runner: ZodObject<{
|
|
70
|
+
module: ZodString;
|
|
71
|
+
port: ZodOptional<ZodNumber>;
|
|
72
|
+
https: ZodOptional<ZodBoolean>;
|
|
73
|
+
plugins: ZodOptional<ZodArray<ZodUnion<readonly [ZodString, ZodObject<{
|
|
74
|
+
module: ZodString;
|
|
75
|
+
enabled: ZodOptional<ZodBoolean>;
|
|
76
|
+
verbs: ZodOptional<ZodUnion<readonly [ZodLiteral<"*">, ZodArray<ZodString>]>>;
|
|
77
|
+
config: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
|
|
78
|
+
}, $strict>]>>>;
|
|
79
|
+
}, $loose>;
|
|
80
|
+
config: ZodOptional<ZodObject<{}, $loose>>;
|
|
81
|
+
profile: ZodOptional<ZodObject<{
|
|
82
|
+
appId: ZodOptional<ZodString>;
|
|
83
|
+
name: ZodOptional<ZodString>;
|
|
84
|
+
description: ZodOptional<ZodString>;
|
|
85
|
+
icon: ZodOptional<ZodString>;
|
|
86
|
+
}, $strict>>;
|
|
87
|
+
reactor: ZodOptional<ZodObject<{
|
|
88
|
+
backends: ZodOptional<ZodRecord<ZodString, ZodObject<{
|
|
89
|
+
kind: ZodOptional<ZodEnum<{
|
|
90
|
+
"in-process": "in-process";
|
|
91
|
+
remote: "remote";
|
|
92
|
+
worker: "worker";
|
|
93
|
+
}>>;
|
|
94
|
+
storage: ZodOptional<ZodObject<{
|
|
95
|
+
kind: ZodEnum<{
|
|
96
|
+
idb: "idb";
|
|
97
|
+
memory: "memory";
|
|
98
|
+
path: "path";
|
|
99
|
+
postgres: "postgres";
|
|
100
|
+
}>;
|
|
101
|
+
dataDir: ZodOptional<ZodString>;
|
|
102
|
+
url: ZodOptional<ZodString>;
|
|
103
|
+
}, $strict>>;
|
|
104
|
+
readModel: ZodOptional<ZodObject<{
|
|
105
|
+
url: ZodOptional<ZodString>;
|
|
106
|
+
}, $strict>>;
|
|
107
|
+
packages: ZodOptional<ZodObject<{
|
|
108
|
+
cdnUrl: ZodOptional<ZodString>;
|
|
109
|
+
specs: ZodOptional<ZodArray<ZodString>>;
|
|
110
|
+
dynamic: ZodOptional<ZodBoolean>;
|
|
111
|
+
}, $strict>>;
|
|
112
|
+
remote: ZodOptional<ZodObject<{
|
|
113
|
+
host: ZodOptional<ZodString>;
|
|
114
|
+
url: ZodOptional<ZodString>;
|
|
115
|
+
}, $strict>>;
|
|
116
|
+
projection: ZodOptional<ZodObject<{
|
|
117
|
+
enabled: ZodOptional<ZodBoolean>;
|
|
118
|
+
dbPoolSize: ZodOptional<ZodNumber>;
|
|
119
|
+
}, $strict>>;
|
|
120
|
+
executors: ZodOptional<ZodObject<{
|
|
121
|
+
numWorkers: ZodOptional<ZodUnion<readonly [ZodNumber, ZodLiteral<"auto">]>>;
|
|
122
|
+
}, $strict>>;
|
|
123
|
+
}, $strict>>>;
|
|
124
|
+
placement: ZodOptional<ZodObject<{
|
|
125
|
+
primary: ZodOptional<ZodString>;
|
|
126
|
+
default: ZodOptional<ZodObject<{}, $loose>>;
|
|
127
|
+
}, $strict>>;
|
|
128
|
+
protocol: ZodOptional<ZodObject<{
|
|
129
|
+
featureFlags: ZodOptional<ZodObject<{
|
|
130
|
+
documentDecisions: ZodOptional<ZodBoolean>;
|
|
131
|
+
authEnforcement: ZodOptional<ZodBoolean>;
|
|
132
|
+
authGroups: ZodOptional<ZodBoolean>;
|
|
133
|
+
authConditions: ZodOptional<ZodBoolean>;
|
|
134
|
+
}, $strict>>;
|
|
135
|
+
createSignaturePolicy: ZodOptional<ZodEnum<{
|
|
136
|
+
legacy: "legacy";
|
|
137
|
+
"v2-required": "v2-required";
|
|
138
|
+
}>>;
|
|
139
|
+
unsupportedStoredDocuments: ZodOptional<ZodEnum<{
|
|
140
|
+
"read-only": "read-only";
|
|
141
|
+
refuse: "refuse";
|
|
142
|
+
}>>;
|
|
143
|
+
}, $strict>>;
|
|
144
|
+
workflows: ZodOptional<ZodBoolean>;
|
|
145
|
+
renown: ZodOptional<ZodObject<{
|
|
146
|
+
url: ZodOptional<ZodString>;
|
|
147
|
+
networkId: ZodOptional<ZodString>;
|
|
148
|
+
chainId: ZodOptional<ZodNumber>;
|
|
149
|
+
}, $strict>>;
|
|
150
|
+
packages: ZodOptional<ZodObject<{
|
|
151
|
+
registryUrl: ZodOptional<ZodString>;
|
|
152
|
+
}, $strict>>;
|
|
153
|
+
namespace: ZodOptional<ZodString>;
|
|
154
|
+
auth: ZodOptional<ZodObject<{
|
|
155
|
+
enabled: ZodOptional<ZodBoolean>;
|
|
156
|
+
admins: ZodOptional<ZodArray<ZodString>>;
|
|
157
|
+
renown: ZodOptional<ZodObject<{}, $loose>>;
|
|
158
|
+
}, $strict>>;
|
|
159
|
+
drives: ZodOptional<ZodArray<ZodObject<{
|
|
160
|
+
slug: ZodString;
|
|
161
|
+
id: ZodOptional<ZodString>;
|
|
162
|
+
projectHash: ZodOptional<ZodBoolean>;
|
|
163
|
+
name: ZodOptional<ZodString>;
|
|
164
|
+
icon: ZodOptional<ZodString>;
|
|
165
|
+
preferredEditor: ZodOptional<ZodString>;
|
|
166
|
+
sharingType: ZodOptional<ZodEnum<{
|
|
167
|
+
private: "private";
|
|
168
|
+
public: "public";
|
|
169
|
+
shared: "shared";
|
|
170
|
+
}>>;
|
|
171
|
+
availableOffline: ZodOptional<ZodBoolean>;
|
|
172
|
+
remote: ZodOptional<ZodObject<{
|
|
173
|
+
url: ZodString;
|
|
174
|
+
}, $strict>>;
|
|
175
|
+
}, $strict>>>;
|
|
176
|
+
}, $strict>>;
|
|
177
|
+
}, $loose>;
|
|
178
|
+
/** The classic arg shape with the one switch a composition may leave unset. */
|
|
179
|
+
export type SwitchboardRunnerArgs = Omit<SwitchboardArgs, "mcp"> & {
|
|
180
|
+
mcp: boolean | undefined;
|
|
181
|
+
};
|
|
182
|
+
/** What a started switchboard reports to a supervising compound: its port and
|
|
183
|
+
* the drive it serves (projected into a connect member's defaultDrives). */
|
|
184
|
+
export interface SwitchboardHandle {
|
|
185
|
+
port: number;
|
|
186
|
+
driveUrls: string[];
|
|
187
|
+
endpoints: Record<string, string>;
|
|
188
|
+
ready: Promise<void>;
|
|
189
|
+
}
|
|
190
|
+
export declare function run(host: HostDefinition, ctx: RunnerContext): Promise<SwitchboardHandle>;
|
|
191
|
+
export declare const serve: typeof run;
|
|
192
|
+
export declare function dev(host: HostDefinition, ctx: RunnerContext): Promise<SwitchboardHandle>;
|
|
193
|
+
/** Build the project's reactor package (the SAME service as `ph build`) — what
|
|
194
|
+
* this switchboard serves. Starts no server; orthogonal to run/serve/dev. */
|
|
195
|
+
export declare function build(host: HostDefinition, _ctx: RunnerContext): Promise<void>;
|
|
196
|
+
//#endregion
|
|
197
|
+
export {};
|
|
198
|
+
//# sourceMappingURL=switchboard.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switchboard.d.mts","names":[],"sources":["../../src/commands/switchboard.ts","../../src/types.ts","../../src/runners/switchboard.ts"],"mappings":";;;cAGa,aAAW,+CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDtB,6CAAA,iDAAA,mDAAA;;;KCWU,kBAAkB,uBAAuB;;;;;;;;;;qBCjCxC;;qBAGA,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAcrB;;YAGU,wBAAwB,KAAK;EACvC;;;;iBA+De;EACf;EACA;EACA,WAAW;EACX,OAAO;;wBAgJa,IACpB,MAAM,gBACN,KAAK,gBACJ,QAAQ;qBAIE,cAAK;wBAEI,IACpB,MAAM,gBACN,KAAK,gBACJ,QAAQ;;;wBAMW,MACpB,MAAM,gBACN,MAAM,gBACL"}
|
|
@@ -0,0 +1,172 @@
|
|
|
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]="ad7a5128-0c7d-5e23-800d-238273f138ce")}catch(e){}}();
|
|
3
|
+
import { a as looseObject, l as string$1, n as array, o as number, r as boolean$1 } from "../schemas-BQSPev1x.mjs";
|
|
4
|
+
import { a as pluginEntrySchema } from "../plugins-CHVv4qup.mjs";
|
|
5
|
+
import { c as profileSchema, f as resolveDriveDeclaration, m as seedDrives, u as reactorSchema } from "../host-schemas-CtPNRr5v-BQyKKFbS.mjs";
|
|
6
|
+
import { s as resolveHostPlugins } from "../dist-BqeDFgEy.mjs";
|
|
7
|
+
import { t as applyReactorEnvProjection } from "../reactor-env-BbR86_Li.mjs";
|
|
8
|
+
import { command, runSafely } from "cmd-ts";
|
|
9
|
+
import { switchboardArgs } from "@powerhousedao/shared/clis/args";
|
|
10
|
+
//#region src/services/classic-args.ts
|
|
11
|
+
/**
|
|
12
|
+
* The classic `ph switchboard` argument shape, produced by the SAME cmd-ts
|
|
13
|
+
* definitions the classic command parses — not re-derived by hand. A runner
|
|
14
|
+
* starts from this object and overlays only the keys its host file owns, so
|
|
15
|
+
* every key the classic command carries (including the ones it carries as
|
|
16
|
+
* `undefined`, e.g. `dbPath`) reaches the service exactly as it does on the
|
|
17
|
+
* classic path. The uniform-runners switchboard runner once hand-built a
|
|
18
|
+
* partial object that omitted `dbPath`; the service's then-default
|
|
19
|
+
* `.ph/read-model.db` became both the reactor and the read-model PGlite dir —
|
|
20
|
+
* two instances on one PGDATA (see uniform-runners-plan/legacy-parity-rectification.md).
|
|
21
|
+
*/
|
|
22
|
+
const classicSwitchboard = command({
|
|
23
|
+
name: "switchboard",
|
|
24
|
+
args: switchboardArgs,
|
|
25
|
+
handler: (args) => args
|
|
26
|
+
});
|
|
27
|
+
async function classicSwitchboardArgs(argv = []) {
|
|
28
|
+
const result = await runSafely(classicSwitchboard, argv);
|
|
29
|
+
if (result._tag === "error") throw new Error(`classic switchboard args did not parse: ${result.error.config.message}`);
|
|
30
|
+
return result.value;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/runners/switchboard.ts
|
|
34
|
+
/**
|
|
35
|
+
* BRIDGE runner for Switchboard hosts (uniform-runners phase 0): maps a
|
|
36
|
+
* hosts/switchboard/host.js definition onto the SAME `startSwitchboard`
|
|
37
|
+
* service the classic command calls. `run` = production loaders, `dev` =
|
|
38
|
+
* Vite package loader (worker pools refused by the server, as always).
|
|
39
|
+
* There is deliberately no `build` verb — the switchboard has none.
|
|
40
|
+
*/
|
|
41
|
+
const kind = "reactor";
|
|
42
|
+
/** Phase-2 schema (D2.d): `reactor`/`profile` strict via host-core. */
|
|
43
|
+
const hostSchema = looseObject({
|
|
44
|
+
name: string$1().min(1),
|
|
45
|
+
runner: looseObject({
|
|
46
|
+
module: string$1(),
|
|
47
|
+
port: number().int().positive().optional(),
|
|
48
|
+
https: boolean$1().optional(),
|
|
49
|
+
plugins: array(pluginEntrySchema).optional()
|
|
50
|
+
}),
|
|
51
|
+
config: looseObject({}).optional(),
|
|
52
|
+
profile: profileSchema,
|
|
53
|
+
reactor: reactorSchema.optional()
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Start from the classic `ph switchboard` args (parsed by the classic
|
|
57
|
+
* definitions, no flags) and overlay ONLY the keys the host file owns. Every
|
|
58
|
+
* other key — including the ones the classic command carries as `undefined`,
|
|
59
|
+
* such as `dbPath` — reaches the service exactly as on the classic path. No
|
|
60
|
+
* cast: a key the classic shape has and this object lacks is a type error.
|
|
61
|
+
*/
|
|
62
|
+
async function toSwitchboardArgs(host, devMode, dbPath, composed) {
|
|
63
|
+
const classic = await classicSwitchboardArgs();
|
|
64
|
+
const runner = host.runner;
|
|
65
|
+
return {
|
|
66
|
+
...classic,
|
|
67
|
+
port: typeof runner.port === "number" ? runner.port : classic.port,
|
|
68
|
+
dev: devMode || runner.dev === true ? true : classic.dev,
|
|
69
|
+
mcp: composed ? void 0 : classic.mcp,
|
|
70
|
+
dbPath: dbPath ?? classic.dbPath
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** The slug of the drive the switchboard creates by default
|
|
74
|
+
* (apps/switchboard config); `runner.driveSlug` overrides. */
|
|
75
|
+
const DEFAULT_DRIVE_SLUG = "powerhouse";
|
|
76
|
+
/** Poll the default drive endpoint until the server answers — the compound's
|
|
77
|
+
* readiness gate: Connect auto-connects the drive on first load, so the drive
|
|
78
|
+
* must answer before the connect member serves (the sidecar's
|
|
79
|
+
* waitForSwitchboard, moved behind the handle contract). */
|
|
80
|
+
async function waitForDrive(url, timeoutMs) {
|
|
81
|
+
const deadline = Date.now() + timeoutMs;
|
|
82
|
+
for (;;) {
|
|
83
|
+
try {
|
|
84
|
+
if ((await fetch(url, { signal: AbortSignal.timeout(3e3) })).ok) return;
|
|
85
|
+
} catch {}
|
|
86
|
+
if (Date.now() > deadline) throw new Error(`Switchboard drive ${url} did not answer within ${timeoutMs}ms.`);
|
|
87
|
+
await new Promise((resolve) => setTimeout(resolve, 400));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Adapter from the switchboard's reactor client onto the host-core seeder.
|
|
91
|
+
* addDefaultDrive is slug-idempotent itself, so findDriveBySlug delegates. */
|
|
92
|
+
function seederClient(reactor, port) {
|
|
93
|
+
return {
|
|
94
|
+
findDriveBySlug: () => Promise.resolve(void 0),
|
|
95
|
+
createDrive: async (drive) => {
|
|
96
|
+
const { addDefaultDrive } = await import("@powerhousedao/switchboard/utils");
|
|
97
|
+
await addDefaultDrive(reactor, {
|
|
98
|
+
id: drive.id,
|
|
99
|
+
slug: drive.slug,
|
|
100
|
+
global: {
|
|
101
|
+
name: drive.name,
|
|
102
|
+
icon: drive.icon
|
|
103
|
+
},
|
|
104
|
+
...drive.preferredEditor ? { preferredEditor: drive.preferredEditor } : {},
|
|
105
|
+
local: {
|
|
106
|
+
availableOffline: drive.availableOffline,
|
|
107
|
+
listeners: [],
|
|
108
|
+
sharingType: drive.sharingType,
|
|
109
|
+
triggers: []
|
|
110
|
+
}
|
|
111
|
+
}, port);
|
|
112
|
+
},
|
|
113
|
+
attachRemoteDrive: () => Promise.resolve()
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
async function start(host, ctx, devMode) {
|
|
117
|
+
const options = applyReactorEnvProjection(host.reactor, `hosts/${host.name}/host.js`);
|
|
118
|
+
const { startSwitchboard } = await import("../switchboard-C5zgkRl2.mjs");
|
|
119
|
+
const entriesDeclared = host.runner.plugins !== void 0;
|
|
120
|
+
const args = await toSwitchboardArgs(host, devMode, options.dbPath, entriesDeclared);
|
|
121
|
+
const entries = host.runner.plugins;
|
|
122
|
+
let pluginComposition;
|
|
123
|
+
if (entries !== void 0) {
|
|
124
|
+
process.env.FEATURE_PLUGIN_HOST_ENABLED = "1";
|
|
125
|
+
pluginComposition = await resolveHostPlugins(ctx.projectRoot, "switchboard", ctx.verb ?? (devMode ? "dev" : "run"), entries, `hosts/${host.name}/host.js`);
|
|
126
|
+
}
|
|
127
|
+
const resolvedDrives = (host.reactor?.drives ?? []).map((declaration) => resolveDriveDeclaration(ctx.projectRoot, declaration));
|
|
128
|
+
const switchboard = await startSwitchboard({
|
|
129
|
+
...args,
|
|
130
|
+
...pluginComposition ? { pluginComposition } : {},
|
|
131
|
+
...resolvedDrives.length > 0 ? {
|
|
132
|
+
drive: void 0,
|
|
133
|
+
remoteDrives: resolvedDrives.filter((d) => d.kind === "remote").map((d) => d.remoteUrl)
|
|
134
|
+
} : {}
|
|
135
|
+
});
|
|
136
|
+
const port = args.port;
|
|
137
|
+
const localDrives = resolvedDrives.filter((d) => d.kind === "local");
|
|
138
|
+
if (localDrives.length > 0 && switchboard) await seedDrives(seederClient(switchboard.reactor, port), localDrives);
|
|
139
|
+
const driveUrl = `http://localhost:${port}/d/${localDrives.length > 0 ? localDrives[0].slug : typeof host.runner.driveSlug === "string" ? host.runner.driveSlug : DEFAULT_DRIVE_SLUG}`;
|
|
140
|
+
const driveUrls = localDrives.length > 0 ? localDrives.map((d) => `http://localhost:${port}/d/${d.slug}`) : [driveUrl];
|
|
141
|
+
if (switchboard?.workflowsEnabled) {
|
|
142
|
+
const { seedWorkflowsDrive } = await import("../vetra-BD-34wGs.mjs");
|
|
143
|
+
driveUrls.push(await seedWorkflowsDrive(switchboard.reactor, port));
|
|
144
|
+
}
|
|
145
|
+
const ready = waitForDrive(driveUrl, 18e4);
|
|
146
|
+
ready.catch(() => void 0);
|
|
147
|
+
return {
|
|
148
|
+
port,
|
|
149
|
+
driveUrls,
|
|
150
|
+
endpoints: { graphql: `http://localhost:${port}/graphql` },
|
|
151
|
+
ready
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async function run(host, ctx) {
|
|
155
|
+
return start(host, ctx, false);
|
|
156
|
+
}
|
|
157
|
+
const serve = run;
|
|
158
|
+
async function dev(host, ctx) {
|
|
159
|
+
return start(host, ctx, true);
|
|
160
|
+
}
|
|
161
|
+
/** Build the project's reactor package (the SAME service as `ph build`) — what
|
|
162
|
+
* this switchboard serves. Starts no server; orthogonal to run/serve/dev. */
|
|
163
|
+
async function build(host, _ctx) {
|
|
164
|
+
const { runBuild } = await import("../build-C78yPntL.mjs");
|
|
165
|
+
const runner = host.runner;
|
|
166
|
+
await runBuild({ outDir: typeof runner.outDir === "string" ? runner.outDir : "dist" });
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
export { build, dev, hostSchema, kind, run, serve };
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=switchboard.mjs.map
|
|
172
|
+
//# debugId=ad7a5128-0c7d-5e23-800d-238273f138ce
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switchboard.mjs","sources":["../../src/services/classic-args.ts","../../src/runners/switchboard.ts"],"sourcesContent":["import { switchboardArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, runSafely } from \"cmd-ts\";\nimport type { SwitchboardArgs } from \"../types.js\";\n\n/**\n * The classic `ph switchboard` argument shape, produced by the SAME cmd-ts\n * definitions the classic command parses — not re-derived by hand. A runner\n * starts from this object and overlays only the keys its host file owns, so\n * every key the classic command carries (including the ones it carries as\n * `undefined`, e.g. `dbPath`) reaches the service exactly as it does on the\n * classic path. The uniform-runners switchboard runner once hand-built a\n * partial object that omitted `dbPath`; the service's then-default\n * `.ph/read-model.db` became both the reactor and the read-model PGlite dir —\n * two instances on one PGDATA (see uniform-runners-plan/legacy-parity-rectification.md).\n */\nconst classicSwitchboard = command({\n name: \"switchboard\",\n args: switchboardArgs,\n handler: (args) => args,\n});\n\nexport async function classicSwitchboardArgs(\n argv: string[] = [],\n): Promise<SwitchboardArgs> {\n const result = await runSafely(classicSwitchboard, argv);\n if (result._tag === \"error\") {\n throw new Error(\n `classic switchboard args did not parse: ${result.error.config.message}`,\n );\n }\n return result.value;\n}\n","import {\n profileSchema,\n reactorSchema,\n type HostDefinition,\n type ReactorConfig,\n type RunnerContext,\n} from \"@powerhousedao/host-core\";\nimport {\n pluginEntrySchema,\n resolveDriveDeclaration,\n resolveHostPlugins,\n seedDrives,\n type DriveDeclaration,\n type DriveSeederClient,\n type ResolvedDrive,\n} from \"@powerhousedao/host-core\";\nimport { applyReactorEnvProjection } from \"./reactor-env.js\";\nimport { z } from \"zod\";\nimport { classicSwitchboardArgs } from \"../services/classic-args.js\";\nimport type { BuildArgs, SwitchboardArgs } from \"../types.js\";\n\n/**\n * BRIDGE runner for Switchboard hosts (uniform-runners phase 0): maps a\n * hosts/switchboard/host.js definition onto the SAME `startSwitchboard`\n * service the classic command calls. `run` = production loaders, `dev` =\n * Vite package loader (worker pools refused by the server, as always).\n * There is deliberately no `build` verb — the switchboard has none.\n */\n\nexport const kind = \"reactor\";\n\n/** Phase-2 schema (D2.d): `reactor`/`profile` strict via host-core. */\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 // THE COMPOSITION (rewire R2): plugin entries, presence is activation.\n // (The classic packages-CSV meaning of this field is retired — packages\n // load via reactor.backends.*.packages / the package manager.)\n plugins: z.array(pluginEntrySchema).optional(),\n }),\n config: z.looseObject({}).optional(),\n profile: profileSchema,\n reactor: reactorSchema.optional(),\n});\n\n/** The classic arg shape with the one switch a composition may leave unset. */\nexport type SwitchboardRunnerArgs = Omit<SwitchboardArgs, \"mcp\"> & {\n mcp: boolean | undefined;\n};\n\n/**\n * Start from the classic `ph switchboard` args (parsed by the classic\n * definitions, no flags) and overlay ONLY the keys the host file owns. Every\n * other key — including the ones the classic command carries as `undefined`,\n * such as `dbPath` — reaches the service exactly as on the classic path. No\n * cast: a key the classic shape has and this object lacks is a type error.\n */\nasync function toSwitchboardArgs(\n host: HostDefinition,\n devMode: boolean,\n dbPath: string | undefined,\n composed: boolean,\n): Promise<SwitchboardRunnerArgs> {\n const classic = await classicSwitchboardArgs();\n const runner = host.runner;\n return {\n ...classic,\n port: typeof runner.port === \"number\" ? runner.port : classic.port,\n // The verb owns dev mode; `runner.dev` is the host-file spelling of it.\n dev: devMode || runner.dev === true ? true : classic.dev,\n // A declared composition owns the carved switches (R2): the mcp plugin's\n // presence sets it, its absence must deactivate. Classic path: classic.\n mcp: composed ? undefined : classic.mcp,\n // The host file's readModel.url. Absent, the key stays present and\n // undefined exactly as the classic command carries it, so the server's\n // own split defaults (.ph/reactor-storage + .ph/read-storage) apply.\n // Omitting the key resurrected a dead service default and put the\n // reactor and the read model on ONE PGlite dir (two writers, one PGDATA).\n dbPath: dbPath ?? classic.dbPath,\n };\n}\n\n/** The slug of the drive the switchboard creates by default\n * (apps/switchboard config); `runner.driveSlug` overrides. */\nconst DEFAULT_DRIVE_SLUG = \"powerhouse\";\n\n/** Poll the default drive endpoint until the server answers — the compound's\n * readiness gate: Connect auto-connects the drive on first load, so the drive\n * must answer before the connect member serves (the sidecar's\n * waitForSwitchboard, moved behind the handle contract). */\nasync function waitForDrive(url: string, timeoutMs: number): Promise<void> {\n const deadline = Date.now() + timeoutMs;\n for (;;) {\n try {\n const res = await fetch(url, { signal: AbortSignal.timeout(3000) });\n if (res.ok) return;\n } catch {\n // not listening yet\n }\n if (Date.now() > deadline) {\n throw new Error(\n `Switchboard drive ${url} did not answer within ${timeoutMs}ms.`,\n );\n }\n await new Promise((resolve) => setTimeout(resolve, 400));\n }\n}\n\n/** What a started switchboard reports to a supervising compound: its port and\n * the drive it serves (projected into a connect member's defaultDrives). */\nexport interface SwitchboardHandle {\n port: number;\n driveUrls: string[];\n endpoints: Record<string, string>;\n ready: Promise<void>;\n}\n\n/** Adapter from the switchboard's reactor client onto the host-core seeder.\n * addDefaultDrive is slug-idempotent itself, so findDriveBySlug delegates. */\nfunction seederClient(reactor: unknown, port: number): DriveSeederClient {\n return {\n findDriveBySlug: () => Promise.resolve(undefined),\n createDrive: async (drive: ResolvedDrive) => {\n const { addDefaultDrive } =\n await import(\"@powerhousedao/switchboard/utils\");\n await addDefaultDrive(\n reactor as Parameters<typeof addDefaultDrive>[0],\n {\n id: drive.id,\n slug: drive.slug,\n global: { name: drive.name, icon: drive.icon },\n ...(drive.preferredEditor\n ? { preferredEditor: drive.preferredEditor }\n : {}),\n local: {\n availableOffline: drive.availableOffline,\n listeners: [],\n sharingType: drive.sharingType,\n triggers: [],\n },\n } as Parameters<typeof addDefaultDrive>[1],\n port,\n );\n },\n attachRemoteDrive: () => Promise.resolve(), // remotes ride options.remoteDrives\n };\n}\n\nasync function start(\n host: HostDefinition,\n ctx: RunnerContext,\n devMode: boolean,\n): Promise<SwitchboardHandle> {\n const options = applyReactorEnvProjection(\n host.reactor as ReactorConfig | undefined,\n `hosts/${host.name}/host.js`,\n );\n const { startSwitchboard } = await import(\"../services/switchboard.js\");\n const entriesDeclared =\n (host.runner as { plugins?: unknown }).plugins !== undefined;\n const args = await toSwitchboardArgs(\n host,\n devMode,\n options.dbPath,\n entriesDeclared,\n );\n\n // R2 step 2: a declared composition activates the plugin pipeline — the\n // runner resolves the entries against the PROJECT dependency tree and the\n // flag drives server-side activation. No plugins key = classic path.\n const entries = (host.runner as { plugins?: unknown }).plugins as\n | Parameters<typeof resolveHostPlugins>[3]\n | undefined;\n let pluginComposition;\n if (entries !== undefined) {\n process.env.FEATURE_PLUGIN_HOST_ENABLED = \"1\";\n pluginComposition = await resolveHostPlugins(\n ctx.projectRoot,\n \"switchboard\",\n ctx.verb ?? (devMode ? \"dev\" : \"run\"),\n entries,\n `hosts/${host.name}/host.js`,\n );\n }\n\n // Core drive declarations (reactor.drives): locals seed after boot via the\n // host-core seeder; remotes ride the existing remoteDrives option; the\n // implicit default powerhouse drive is replaced by the declared set.\n const declarations = (\n host.reactor as { drives?: DriveDeclaration[] } | undefined\n )?.drives;\n const resolvedDrives = (declarations ?? []).map((declaration) =>\n resolveDriveDeclaration(ctx.projectRoot, declaration),\n );\n const serverArgs = {\n ...args,\n ...(pluginComposition ? { pluginComposition } : {}),\n ...(resolvedDrives.length > 0\n ? {\n drive: undefined,\n remoteDrives: resolvedDrives\n .filter((d) => d.kind === \"remote\")\n .map((d) => d.remoteUrl!),\n }\n : {}),\n };\n\n const switchboard = await startSwitchboard(serverArgs);\n const port = args.port;\n\n const localDrives = resolvedDrives.filter((d) => d.kind === \"local\");\n if (localDrives.length > 0 && switchboard) {\n await seedDrives(seederClient(switchboard.reactor, port), localDrives);\n }\n\n const slug =\n localDrives.length > 0\n ? localDrives[0].slug\n : typeof host.runner.driveSlug === \"string\"\n ? host.runner.driveSlug\n : DEFAULT_DRIVE_SLUG;\n const driveUrl = `http://localhost:${port}/d/${slug}`;\n const driveUrls =\n localDrives.length > 0\n ? localDrives.map((d) => `http://localhost:${port}/d/${d.slug}`)\n : [driveUrl];\n\n // Workflows on → seed the SAME project-hashed workflows drive the vetra\n // path seeds (opens in Workflow Studio); it rides the handle so a\n // supervising compound projects it into the connect member's drives.\n if (switchboard?.workflowsEnabled) {\n const { seedWorkflowsDrive } = await import(\"../services/vetra.js\");\n driveUrls.push(await seedWorkflowsDrive(switchboard.reactor, port));\n }\n\n const ready = waitForDrive(driveUrl, 180_000);\n // A supervisor awaits `ready` and sees the rejection; an unsupervised caller\n // (or a test with the service mocked) must not die of an unhandled one.\n ready.catch(() => undefined);\n return {\n port,\n driveUrls,\n endpoints: { graphql: `http://localhost:${port}/graphql` },\n ready,\n };\n}\n\n// The four verbs are orthogonal: each does ONE job.\n// - `run`/`serve`: START the server in production mode (serves the built\n// project package). `serve` is run's alias — a server IS its served stack,\n// and it lets the compound forward one `serve` verb to every member.\n// - `dev`: START the server in dev mode (watch / the Vite package loader).\n// - `build`: PRODUCE the project package this switchboard serves, and start\n// NOTHING. The analog of `ph connect build` on the server side: legacy\n// `ph switchboard build` never existed, but the project still has a build.\n// `build` is what lets a compound forward a single `build` verb to all members\n// (desktop/cli) without the switchboard member failing on an unknown verb.\n\nexport async function run(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<SwitchboardHandle> {\n return start(host, ctx, false);\n}\n\nexport const serve = run;\n\nexport async function dev(\n host: HostDefinition,\n ctx: RunnerContext,\n): Promise<SwitchboardHandle> {\n return start(host, ctx, true);\n}\n\n/** Build the project's reactor package (the SAME service as `ph build`) — what\n * this switchboard serves. Starts no server; orthogonal to run/serve/dev. */\nexport async function build(\n host: HostDefinition,\n _ctx: RunnerContext,\n): Promise<void> {\n const { runBuild } = await import(\"../services/build.js\");\n const runner = host.runner;\n const args: Partial<BuildArgs> = {\n outDir: typeof runner.outDir === \"string\" ? runner.outDir : \"dist\",\n };\n await runBuild(args as BuildArgs);\n}\n"],"names":["z.looseObject","z.string","z.number","z.boolean","z.array"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,qBAAqB,QAAQ;CACjC,MAAM;CACN,MAAM;CACN,UAAU,SAAS;AACrB,CAAC;AAED,eAAsB,uBACpB,OAAiB,CAAC,GACQ;CAC1B,MAAM,SAAS,MAAM,UAAU,oBAAoB,IAAI;CACvD,IAAI,OAAO,SAAS,SAClB,MAAM,IAAI,MACR,2CAA2C,OAAO,MAAM,OAAO,SACjE;CAEF,OAAO,OAAO;AAChB;;;;;;;;;;ACFA,MAAa,OAAO;;AAGpB,MAAa,aAAaA,YAAc;CACtC,MAAMC,SAAS,CAAC,CAAC,IAAI,CAAC;CACtB,QAAQD,YAAc;EACpB,QAAQC,SAAS;EACjB,MAAMC,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAC3C,OAAOC,UAAU,CAAC,CAAC,SAAS;EAI5B,SAASC,MAAQ,iBAAiB,CAAC,CAAC,SAAS;CAC/C,CAAC;CACD,QAAQJ,YAAc,CAAC,CAAC,CAAC,CAAC,SAAS;CACnC,SAAS;CACT,SAAS,cAAc,SAAS;AAClC,CAAC;;;;;;;;AAcD,eAAe,kBACb,MACA,SACA,QACA,UACgC;CAChC,MAAM,UAAU,MAAM,uBAAuB;CAC7C,MAAM,SAAS,KAAK;CACpB,OAAO;EACL,GAAG;EACH,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