@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.
Files changed (131) hide show
  1. package/dist/{auth-AR3VxAIk.mjs → auth-BFUq7CvE.mjs} +3 -3
  2. package/dist/{auth-AR3VxAIk.mjs.map → auth-BFUq7CvE.mjs.map} +1 -1
  3. package/dist/auth-CNhbN5UM.mjs +4 -0
  4. package/dist/build-C78yPntL.mjs +4 -0
  5. package/dist/build-Dj8qfSSe.mjs +349 -0
  6. package/dist/build-Dj8qfSSe.mjs.map +1 -0
  7. package/dist/{cli-connect-override-D3hh4aH_.mjs → cli-connect-override-Cf7WutqU.mjs} +38 -26
  8. package/dist/cli-connect-override-Cf7WutqU.mjs.map +1 -0
  9. package/dist/cli.d.mts +2 -1
  10. package/dist/cli.mjs +31 -1175
  11. package/dist/cli.mjs.map +1 -1
  12. package/dist/connect-build-BtKpvcQK.mjs +253 -0
  13. package/dist/connect-build-BtKpvcQK.mjs.map +1 -0
  14. package/dist/{connect-config-BWGiW3IB.mjs → connect-config-9EZB_0H_.mjs} +19 -12
  15. package/dist/connect-config-9EZB_0H_.mjs.map +1 -0
  16. package/dist/connect-preview-8-qLgWKt.mjs +215 -0
  17. package/dist/connect-preview-8-qLgWKt.mjs.map +1 -0
  18. package/dist/connect-studio-BehPZzN7.mjs +4 -0
  19. package/dist/{connect-studio-D6rfWCNB.mjs → connect-studio-Bhlc77WI.mjs} +17 -11
  20. package/dist/connect-studio-Bhlc77WI.mjs.map +1 -0
  21. package/dist/dist-BqeDFgEy.mjs +223 -0
  22. package/dist/dist-BqeDFgEy.mjs.map +1 -0
  23. package/dist/explain-BDHmXgw3.mjs +27 -0
  24. package/dist/explain-BDHmXgw3.mjs.map +1 -0
  25. package/dist/feature-flags-xwqcHEWC.mjs +4 -0
  26. package/dist/{generate-all-DrT4ZxHX.mjs → generate-all-C_sPGBuk.mjs} +5 -3
  27. package/dist/generate-all-C_sPGBuk.mjs.map +1 -0
  28. package/dist/{generate-app-DNNqA-H3.mjs → generate-app-BTs1u-9l.mjs} +7 -5
  29. package/dist/{generate-app-DNNqA-H3.mjs.map → generate-app-BTs1u-9l.mjs.map} +1 -1
  30. package/dist/generate-desktop-shell-BBSGpmud.mjs +212 -0
  31. package/dist/generate-desktop-shell-BBSGpmud.mjs.map +1 -0
  32. package/dist/{generate-document-model-BJXyODfm.mjs → generate-document-model-BfFIQ35q.mjs} +19 -7
  33. package/dist/generate-document-model-BfFIQ35q.mjs.map +1 -0
  34. package/dist/{generate-editor-BejvaVVT.mjs → generate-editor-CW7Do69u.mjs} +7 -5
  35. package/dist/{generate-editor-BejvaVVT.mjs.map → generate-editor-CW7Do69u.mjs.map} +1 -1
  36. package/dist/generate-piece-QTt-ddt2.mjs +65 -0
  37. package/dist/generate-piece-QTt-ddt2.mjs.map +1 -0
  38. package/dist/generate-piece-action-DbxrzfKY.mjs +29 -0
  39. package/dist/generate-piece-action-DbxrzfKY.mjs.map +1 -0
  40. package/dist/generate-piece-trigger-CqVOcL9g.mjs +30 -0
  41. package/dist/generate-piece-trigger-CqVOcL9g.mjs.map +1 -0
  42. package/dist/{generate-processor-_WOx-mMe.mjs → generate-processor-DBtTkgo5.mjs} +15 -8
  43. package/dist/generate-processor-DBtTkgo5.mjs.map +1 -0
  44. package/dist/{generate-subgraph-BsHUstpl.mjs → generate-subgraph-CVlTo7qk.mjs} +12 -6
  45. package/dist/generate-subgraph-CVlTo7qk.mjs.map +1 -0
  46. package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs +493 -0
  47. package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs.map +1 -0
  48. package/dist/index-CspiP73o.d.mts +4295 -0
  49. package/dist/index-CspiP73o.d.mts.map +1 -0
  50. package/dist/{init-BZP6gvYd.mjs → init-ScuT3z7P.mjs} +7 -5
  51. package/dist/init-ScuT3z7P.mjs.map +1 -0
  52. package/dist/{inspect-DXjbQEV_.mjs → inspect-zWJnBDMJ.mjs} +11 -4
  53. package/dist/inspect-zWJnBDMJ.mjs.map +1 -0
  54. package/dist/install-added-dependencies-DVSbzler.mjs +33 -0
  55. package/dist/install-added-dependencies-DVSbzler.mjs.map +1 -0
  56. package/dist/{migrate-jGKfE02L.mjs → migrate-DK4HK7Dn.mjs} +4 -4
  57. package/dist/{migrate-jGKfE02L.mjs.map → migrate-DK4HK7Dn.mjs.map} +1 -1
  58. package/dist/ph-cli-commands-3ptdQ0NI.mjs +1476 -0
  59. package/dist/ph-cli-commands-3ptdQ0NI.mjs.map +1 -0
  60. package/dist/ph-cli-commands-Dx8hNj6W.mjs +4 -0
  61. package/dist/plugins-CHVv4qup.mjs +91 -0
  62. package/dist/plugins-CHVv4qup.mjs.map +1 -0
  63. package/dist/precompress-P6cJDPVC.mjs +77 -0
  64. package/dist/precompress-P6cJDPVC.mjs.map +1 -0
  65. package/dist/reactor-env-BbR86_Li.mjs +29 -0
  66. package/dist/reactor-env-BbR86_Li.mjs.map +1 -0
  67. package/dist/reactor-env-D_EvBtLB.mjs +4 -0
  68. package/dist/{registry-auth-DxEWCJu2.mjs → registry-auth-Bm5AR-fB.mjs} +4 -4
  69. package/dist/{registry-auth-DxEWCJu2.mjs.map → registry-auth-Bm5AR-fB.mjs.map} +1 -1
  70. package/dist/run-sugar-BdjKTPGO.mjs +39 -0
  71. package/dist/run-sugar-BdjKTPGO.mjs.map +1 -0
  72. package/dist/runners/compound.d.mts +127 -0
  73. package/dist/runners/compound.d.mts.map +1 -0
  74. package/dist/runners/compound.mjs +72 -0
  75. package/dist/runners/compound.mjs.map +1 -0
  76. package/dist/runners/connect.d.mts +145 -0
  77. package/dist/runners/connect.d.mts.map +1 -0
  78. package/dist/runners/connect.mjs +198 -0
  79. package/dist/runners/connect.mjs.map +1 -0
  80. package/dist/runners/switchboard.d.mts +198 -0
  81. package/dist/runners/switchboard.d.mts.map +1 -0
  82. package/dist/runners/switchboard.mjs +172 -0
  83. package/dist/runners/switchboard.mjs.map +1 -0
  84. package/dist/schemas-BQSPev1x.mjs +5537 -0
  85. package/dist/schemas-BQSPev1x.mjs.map +1 -0
  86. package/dist/scripts/generate-commands-docs.ts +8 -0
  87. package/dist/scripts/manage-environment +0 -0
  88. package/dist/scripts/setup.sh +0 -0
  89. package/dist/start-run-CmDxyMw0.mjs +36 -0
  90. package/dist/start-run-CmDxyMw0.mjs.map +1 -0
  91. package/dist/superseded-config-9D7BdLvd.mjs +53 -0
  92. package/dist/superseded-config-9D7BdLvd.mjs.map +1 -0
  93. package/dist/switchboard-C5zgkRl2.mjs +4 -0
  94. package/dist/switchboard-h4-XgP1h.mjs +129 -0
  95. package/dist/switchboard-h4-XgP1h.mjs.map +1 -0
  96. package/dist/{switchboard-migrate-NQ7LHWSi.mjs → switchboard-migrate-7JQZM7-5.mjs} +5 -4
  97. package/dist/{switchboard-migrate-NQ7LHWSi.mjs.map → switchboard-migrate-7JQZM7-5.mjs.map} +1 -1
  98. package/dist/{switchboard-reset-BcQXlcVf.mjs → switchboard-reset-MtTB_GAI.mjs} +8 -6
  99. package/dist/switchboard-reset-MtTB_GAI.mjs.map +1 -0
  100. package/dist/{utils-C4isxXSO.mjs → utils-9KyRM0mf.mjs} +6 -34
  101. package/dist/{utils-C4isxXSO.mjs.map → utils-9KyRM0mf.mjs.map} +1 -1
  102. package/dist/utils-TO9lB8Xs.mjs +4 -0
  103. package/dist/{vetra-DkF6EJMY.mjs → vetra-BD-34wGs.mjs} +68 -33
  104. package/dist/vetra-BD-34wGs.mjs.map +1 -0
  105. package/dist/warn-subgraph-type-conflicts-BOHBmThq.mjs +19 -0
  106. package/dist/warn-subgraph-type-conflicts-BOHBmThq.mjs.map +1 -0
  107. package/package.json +43 -17
  108. package/dist/auth-BNkN6kS9.mjs +0 -4
  109. package/dist/build-C-A5-ipO.mjs +0 -4
  110. package/dist/build-uQXq6_HU.mjs +0 -71
  111. package/dist/build-uQXq6_HU.mjs.map +0 -1
  112. package/dist/cli-connect-override-D3hh4aH_.mjs.map +0 -1
  113. package/dist/connect-build-WL4axo4z.mjs +0 -43
  114. package/dist/connect-build-WL4axo4z.mjs.map +0 -1
  115. package/dist/connect-config-BWGiW3IB.mjs.map +0 -1
  116. package/dist/connect-preview-D7ypzFDc.mjs +0 -28
  117. package/dist/connect-preview-D7ypzFDc.mjs.map +0 -1
  118. package/dist/connect-studio-BIQzyq5B.mjs +0 -5
  119. package/dist/connect-studio-D6rfWCNB.mjs.map +0 -1
  120. package/dist/generate-all-DrT4ZxHX.mjs.map +0 -1
  121. package/dist/generate-document-model-BJXyODfm.mjs.map +0 -1
  122. package/dist/generate-processor-_WOx-mMe.mjs.map +0 -1
  123. package/dist/generate-subgraph-BsHUstpl.mjs.map +0 -1
  124. package/dist/init-BZP6gvYd.mjs.map +0 -1
  125. package/dist/inspect-DXjbQEV_.mjs.map +0 -1
  126. package/dist/switchboard-CJMoMzWx.mjs +0 -75
  127. package/dist/switchboard-CJMoMzWx.mjs.map +0 -1
  128. package/dist/switchboard-iRFugh8I.mjs +0 -4
  129. package/dist/switchboard-reset-BcQXlcVf.mjs.map +0 -1
  130. package/dist/utils-BzwczAW-.mjs +0 -4
  131. package/dist/vetra-DkF6EJMY.mjs.map +0 -1
@@ -0,0 +1,1476 @@
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]="fd34b469-65d9-5f9f-adcd-509ea7febba7")}catch(e){}}();
3
+ import { n as skipInstallArgs } from "./install-added-dependencies-DVSbzler.mjs";
4
+ import { t as isUniformRunnersEnabled } from "./feature-flags-xwqcHEWC.mjs";
5
+ import { boolean, command, extendType, flag, multioption, oneOf, option, optional, positional, string, subcommands } from "cmd-ts";
6
+ import { AGENTS, accessTokenArgs, buildArgs, connectBuildArgs, connectConfigArgs, connectPreviewArgs, connectStudioArgs, debugArgs, initArgs, inspectArgs, installArgs, listArgs, loginArgs, migrateArgs, publishArgs, registryLoginArgs, switchboardArgs, uninstallArgs, unpublishArgs, vetraArgs } from "@powerhousedao/shared/clis/args";
7
+ import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
8
+ import fs from "node:fs";
9
+ import path from "node:path";
10
+ import path$1 from "path";
11
+ import { execSync } from "node:child_process";
12
+ import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
13
+ import { execSync as execSync$1 } from "child_process";
14
+ import { createInterface } from "node:readline/promises";
15
+ //#region src/commands/access-token.ts
16
+ const accessToken = command({
17
+ name: "access-token",
18
+ description: `
19
+ The access-token command generates a bearer token for API authentication. This token
20
+ can be used to authenticate requests to Powerhouse APIs like reactor-api (Switchboard).
21
+
22
+ This command:
23
+ 1. Uses your CLI's cryptographic identity (DID) to sign a verifiable credential
24
+ 2. Creates a JWT bearer token with configurable expiration
25
+ 3. Outputs the token to stdout (info to stderr) for easy piping
26
+
27
+ Prerequisites:
28
+ You must have a cryptographic identity. Run 'ph login' first to:
29
+ - Generate a keypair (stored in .ph/.keypair.json)
30
+ - Optionally link your Ethereum address (stored in .ph/.renown.json)
31
+
32
+ Token Details:
33
+ The generated token is a JWT (JSON Web Token) containing:
34
+ - Issuer (iss): Your CLI's DID (did:key:...)
35
+ - Subject (sub): Your CLI's DID
36
+ - Credential Subject: Chain ID, network ID, and address (if authenticated)
37
+ - Expiration (exp): Based on --expiry option
38
+ - Audience (aud): If --audience is specified
39
+
40
+ Output:
41
+ - Token information (DID, address, expiry) is printed to stderr
42
+ - The token itself is printed to stdout for easy piping/copying
43
+
44
+ This allows you to use the command in scripts:
45
+ TOKEN=$(ph access-token)
46
+ curl -H "Authorization: Bearer $TOKEN" http://localhost:4001/graphql
47
+
48
+ Usage with APIs:
49
+ Generate token and use with curl
50
+ TOKEN=$(ph access-token --expiry 1d)
51
+ curl -X POST http://localhost:4001/graphql \\
52
+ -H "Content-Type: application/json" \\
53
+ -H "Authorization: Bearer $TOKEN" \\
54
+ -d '{"query": "{ drives { id name } }"}'
55
+
56
+ Export as environment variable
57
+ export PH_ACCESS_TOKEN=$(ph access-token)
58
+
59
+ Notes:
60
+ - Tokens are self-signed using your CLI's private key
61
+ - No network request is made; tokens are generated locally
62
+ - The recipient API must trust your CLI's DID to accept the token
63
+ - For reactor-api, ensure AUTH_ENABLED=true to require authentication
64
+ `,
65
+ args: accessTokenArgs,
66
+ handler: async (args) => {
67
+ if (args.debug) console.log(args);
68
+ const { generateAccessToken, parseExpiry, formatExpiry } = await import("@renown/sdk/node");
69
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
70
+ const renown = await getRenown();
71
+ let expiresIn = DEFAULT_EXPIRY_SECONDS;
72
+ if (args.expiry) expiresIn = parseExpiry(args.expiry);
73
+ const result = await generateAccessToken(renown, {
74
+ expiresIn,
75
+ aud: args.audience
76
+ });
77
+ console.error(`CLI DID: ${result.did}`);
78
+ console.error(`ETH Address: ${result.address}`);
79
+ console.error(`Token expires in: ${formatExpiry(expiresIn)}`);
80
+ console.error("");
81
+ console.log(result.token);
82
+ process.exit(0);
83
+ }
84
+ });
85
+ //#endregion
86
+ //#region src/commands/build.ts
87
+ const build$1 = command({
88
+ name: "build",
89
+ description: `
90
+ Build a Powerhouse package for publishing: a browser bundle and a node bundle of its
91
+ document models, editors, subgraphs and processors, type declarations, and its stylesheet.
92
+
93
+ Pieces under pieces/ are built too, each into its own self-contained module under
94
+ dist/node/pieces/<name>, with a descriptor.json and package.json written beside it and
95
+ the piece listed in dist/powerhouse.manifest.json. A piece takes the package's version: an
96
+ entry in pieces/index.ts that declares version fails the build. A package that ships only
97
+ pieces is an ordinary package: it carries the same boilerplate, and every step above runs
98
+ for it too.
99
+
100
+ tsc runs first. If it reports type errors the build asks whether to go ahead, and stops
101
+ where it can't ask. --ignore-type-errors builds without asking; a package built that way
102
+ can load and still fail at runtime, so don't publish it.`,
103
+ args: buildArgs,
104
+ handler: async (args) => {
105
+ if (args.debug) console.log(args);
106
+ try {
107
+ const { runBuild } = await import("./build-C78yPntL.mjs");
108
+ await runBuild(args);
109
+ } catch (error) {
110
+ console.error(error);
111
+ process.exit(1);
112
+ }
113
+ }
114
+ });
115
+ //#endregion
116
+ //#region src/commands/connect.ts
117
+ const studio = command({
118
+ name: "studio",
119
+ description: `The studio command starts the Connect Studio, a development environment for building
120
+ and testing Powerhouse applications. It provides a visual interface for working with
121
+ your project.
122
+
123
+ This command:
124
+ 1. Starts a local Connect Studio server
125
+ 2. Provides a web interface for development
126
+ 3. Allows you to interact with your project components
127
+ 4. Supports various configuration options for customization
128
+ `,
129
+ args: connectStudioArgs,
130
+ handler: async (args) => {
131
+ if (args.debug) console.log(args);
132
+ const { runConnectStudio } = await import("./connect-studio-BehPZzN7.mjs");
133
+ await runConnectStudio(args);
134
+ }
135
+ });
136
+ const build = command({
137
+ name: "build",
138
+ description: `The Connect build command creates a production build with the project's local and
139
+ external packages included.
140
+
141
+ Runtime-config overrides (all combinable — last wins on collision):
142
+ ph connect build Build with the current source config.
143
+ ph connect build <key> <value> Build with a positional override applied (e.g. ph connect build connect.renown.url https://renown.staging).
144
+ ph connect build --<field> <value> Build with a per-field flag override (e.g. --renown-url https://renown.staging).
145
+ ph connect build --json '{"app":{"workflowsEnabled":true}}'
146
+ Build with a bulk override. The payload is the connect.* block
147
+ without the "connect" wrapper; unknown keys are rejected.
148
+
149
+ Build has no read mode; passing only <key> without <value> errors out (use \`ph connect config <key>\` to read).
150
+ `,
151
+ args: connectBuildArgs,
152
+ handler: async (args) => {
153
+ if (args.debug) console.log(args);
154
+ const { runConnectBuild } = await import("./connect-build-BtKpvcQK.mjs");
155
+ await runConnectBuild(args);
156
+ process.exit(0);
157
+ }
158
+ });
159
+ const preview = command({
160
+ name: "preview",
161
+ description: `The Connect preview command previews a built Connect project.
162
+ NOTE: You must run \`ph connect build\` first
163
+ `,
164
+ args: connectPreviewArgs,
165
+ handler: async (args) => {
166
+ if (args.debug) console.log(args);
167
+ const { runConnectPreview } = await import("./connect-preview-8-qLgWKt.mjs");
168
+ await runConnectPreview(args);
169
+ }
170
+ });
171
+ const config = command({
172
+ name: "config",
173
+ description: `Read or update Connect's runtime configuration (powerhouse.config.json).
174
+
175
+ Modes (mutually exclusive — positional, --get, --json, and field flags cannot be combined):
176
+ ph connect config List the effective connect.* block (defaults < source).
177
+ ph connect config <key> Get the value at the dotted path (e.g. ph connect config connect.renown.url).
178
+ ph connect config --get <dotted.path> Same as positional <key> (kept for backward compat).
179
+ ph connect config <key> <value> Set a single field and dual-write to source + dist (positional).
180
+ ph connect config --<field> <value> Set a single field via per-field flag (e.g. --renown-url https://renown.id).
181
+ ph connect config --json '{"renown":{"url":"…"}}'
182
+ Bulk-set multiple fields and dual-write. The payload is the connect.*
183
+ block without the "connect" wrapper; unknown keys are rejected.
184
+
185
+ Writes go to:
186
+ - <project>/powerhouse.config.json (source — picked up by the next build)
187
+ - <dist-dir>/powerhouse.config.json (if it exists — the currently-served SPA picks it up on refresh)
188
+ `,
189
+ args: connectConfigArgs,
190
+ handler: async (args) => {
191
+ const { runConnectConfig } = await import("./connect-config-9EZB_0H_.mjs");
192
+ await runConnectConfig(args);
193
+ }
194
+ });
195
+ const connect = subcommands({
196
+ name: "connect",
197
+ description: `Powerhouse Connect commands. Use with \`studio\`, \`build\`, \`preview\`, or \`config\`. Defaults to \`studio\` if not specified.`,
198
+ cmds: {
199
+ studio,
200
+ build,
201
+ preview,
202
+ config
203
+ }
204
+ });
205
+ //#endregion
206
+ //#region src/commands/generate-all.ts
207
+ const generateAllCmd = command({
208
+ name: "all",
209
+ description: "Re-generate all modules in the current project",
210
+ args: { extract: flag({
211
+ long: "extract",
212
+ short: "x",
213
+ description: "Instead of generating code, write a spec for every module into specs/ (one-shot migration to documents-as-source-of-truth)"
214
+ }) },
215
+ handler: async (args) => {
216
+ const { startGenerateAll } = await import("./generate-all-C_sPGBuk.mjs");
217
+ await startGenerateAll(args, process.cwd());
218
+ process.exit(0);
219
+ }
220
+ });
221
+ //#endregion
222
+ //#region src/utils/fs-args.ts
223
+ const ExistingPath = extendType(string, {
224
+ displayName: "path",
225
+ description: "An existing path",
226
+ from(str) {
227
+ const resolved = path.resolve(str);
228
+ if (!fs.existsSync(resolved)) return Promise.reject(/* @__PURE__ */ new Error("Path doesn't exist"));
229
+ return Promise.resolve(resolved);
230
+ }
231
+ });
232
+ /** A directory, or the directory of a given file. */
233
+ const Directory = extendType(ExistingPath, {
234
+ displayName: "dir",
235
+ description: "A path to a directory or a file within a directory",
236
+ from(resolved) {
237
+ return Promise.resolve(fs.statSync(resolved).isDirectory() ? resolved : path.dirname(resolved));
238
+ }
239
+ });
240
+ /** An existing file. */
241
+ const File = extendType(ExistingPath, {
242
+ displayName: "file",
243
+ description: "A file in the file system",
244
+ from(resolved) {
245
+ if (!fs.statSync(resolved).isFile()) return Promise.reject(/* @__PURE__ */ new Error("Provided path is not a file"));
246
+ return Promise.resolve(resolved);
247
+ }
248
+ });
249
+ //#endregion
250
+ //#region src/utils/comma-separated.ts
251
+ /** Splits comma-separated values so `-t "a,b"` means the same as `-t a -t b`
252
+ * instead of yielding the single value `"a,b"`, which matches nothing. */
253
+ function splitCommaSeparated(values) {
254
+ return values.flatMap((value) => value.split(",")).map((value) => value.trim()).filter((value) => value.length > 0);
255
+ }
256
+ /** `multioption` type accepting repeated and/or comma-separated values. */
257
+ const CommaSeparatedStrings = { from: (values) => Promise.resolve(splitCommaSeparated(values)) };
258
+ //#endregion
259
+ //#region src/commands/generate-app.ts
260
+ const generateAppCmd = command({
261
+ name: "app",
262
+ description: "Generate a drive app",
263
+ args: {
264
+ name: option({
265
+ type: optional(string),
266
+ long: "name",
267
+ short: "n",
268
+ description: "The name of the drive app to generate"
269
+ }),
270
+ allowedDocumentTypes: multioption({
271
+ type: optional(CommaSeparatedStrings),
272
+ long: "document-types",
273
+ short: "t",
274
+ description: "The document types allowed by the new app (repeatable or comma-separated)"
275
+ }),
276
+ document: option({
277
+ type: optional(File),
278
+ long: "document",
279
+ short: "d",
280
+ description: "Path to a powerhouse/app spec file (.phd or .json) to drive codegen"
281
+ }),
282
+ dir: option({
283
+ type: optional(Directory),
284
+ long: "dir",
285
+ description: "Name of the directory of an existing app to re-generate"
286
+ }),
287
+ disableDragAndDrop: flag({
288
+ type: boolean,
289
+ long: "disable-drag-and-drop",
290
+ description: "Do not allow drag and drop in this drive app.",
291
+ defaultValue: () => false,
292
+ defaultValueIsSerializable: true
293
+ }),
294
+ all: flag({
295
+ long: "all",
296
+ short: "a",
297
+ description: "Re-generate all existing apps in the current project"
298
+ }),
299
+ extract: flag({
300
+ long: "extract",
301
+ short: "x",
302
+ description: "Write a powerhouse/app spec for each existing drive app into specs/apps/"
303
+ }),
304
+ ...debugArgs
305
+ },
306
+ handler: async (args) => {
307
+ const { startGenerateApp } = await import("./generate-app-BTs1u-9l.mjs");
308
+ await startGenerateApp(args, process.cwd());
309
+ process.exit(0);
310
+ }
311
+ });
312
+ //#endregion
313
+ //#region src/commands/generate-desktop-shell.ts
314
+ const generateDesktopShellCmd = command({
315
+ name: "desktop-shell",
316
+ description: "Scaffold a builder-owned desktop identity (hosts/desktop/app.json + icon). `ph run desktop dev|build` then projects it into a native Tauri shell — no Rust.",
317
+ args: {
318
+ name: option({
319
+ type: optional(string),
320
+ long: "name",
321
+ short: "n",
322
+ description: "Product name (window title + macOS app name). Default: the project's package name."
323
+ }),
324
+ identifier: option({
325
+ type: optional(string),
326
+ long: "identifier",
327
+ short: "i",
328
+ description: "Reverse-DNS app identifier, e.g. com.acme.app. Default: inc.powerhouse.desktop.<project>."
329
+ }),
330
+ force: flag({
331
+ long: "force",
332
+ short: "f",
333
+ description: "Overwrite an existing app.json (protects edits by default)."
334
+ }),
335
+ ...debugArgs
336
+ },
337
+ handler: async (args) => {
338
+ const { startGenerateDesktopShell } = await import("./generate-desktop-shell-BBSGpmud.mjs");
339
+ startGenerateDesktopShell(args, process.cwd());
340
+ process.exit(0);
341
+ }
342
+ });
343
+ //#endregion
344
+ //#region src/commands/generate-document-model.ts
345
+ const generateDocumentModelCmd = command({
346
+ name: "document-model",
347
+ aliases: ["doc"],
348
+ description: "Generate a document model",
349
+ args: {
350
+ document: option({
351
+ type: optional(File),
352
+ long: "document",
353
+ short: "d",
354
+ description: "Path to a document model spec (.phd or .json) to generate from"
355
+ }),
356
+ dir: option({
357
+ type: optional(Directory),
358
+ long: "dir",
359
+ description: "Name of the directory of an existing document model to re-generate"
360
+ }),
361
+ all: flag({
362
+ long: "all",
363
+ short: "a",
364
+ description: "Re-generate all existing document models in the current project"
365
+ }),
366
+ extract: flag({
367
+ long: "extract",
368
+ short: "x",
369
+ description: "Write a powerhouse/document-model spec for each existing document model into specs/document-models/"
370
+ }),
371
+ ...debugArgs
372
+ },
373
+ handler: async (args) => {
374
+ const { startGenerateDocumentModel } = await import("./generate-document-model-BfFIQ35q.mjs");
375
+ await startGenerateDocumentModel(args, process.cwd());
376
+ process.exit(0);
377
+ }
378
+ });
379
+ //#endregion
380
+ //#region src/commands/generate-editor.ts
381
+ const generateEditorCmd = command({
382
+ name: "editor",
383
+ description: "Generate a document editor",
384
+ args: {
385
+ name: option({
386
+ type: optional(string),
387
+ long: "name",
388
+ short: "n",
389
+ description: "The name of the document editor to generate"
390
+ }),
391
+ documentType: option({
392
+ type: optional(string),
393
+ long: "document-type",
394
+ short: "t",
395
+ description: "The document type for the new editor"
396
+ }),
397
+ document: option({
398
+ type: optional(File),
399
+ long: "document",
400
+ short: "d",
401
+ description: "Path to a powerhouse/document-editor spec file (.phd or .json) to drive codegen"
402
+ }),
403
+ dir: option({
404
+ type: optional(Directory),
405
+ long: "dir",
406
+ description: "Name of the directory of an existing editor to re-generate"
407
+ }),
408
+ all: flag({
409
+ long: "all",
410
+ short: "a",
411
+ description: "Re-generate all existing editors in the current project"
412
+ }),
413
+ extract: flag({
414
+ long: "extract",
415
+ short: "x",
416
+ description: "Write a powerhouse/document-editor spec for each existing editor into specs/editors/"
417
+ }),
418
+ ...debugArgs
419
+ },
420
+ handler: async (args) => {
421
+ const { startGenerateEditor } = await import("./generate-editor-CW7Do69u.mjs");
422
+ await startGenerateEditor(args, process.cwd());
423
+ process.exit(0);
424
+ }
425
+ });
426
+ //#endregion
427
+ //#region src/commands/generate-migration-file.ts
428
+ const generateMigrationFileCmd = command({
429
+ name: "migration-file",
430
+ description: "Generate a migration file",
431
+ args: {
432
+ migrationFile: option({
433
+ type: string,
434
+ long: "path",
435
+ short: "p",
436
+ description: "Path to the migration file"
437
+ }),
438
+ schemaFile: option({
439
+ type: optional(string),
440
+ long: "schema-file",
441
+ description: "Path to the output file. Defaults to './schema.ts'"
442
+ }),
443
+ ...debugArgs
444
+ },
445
+ handler: async ({ migrationFile, schemaFile }) => {
446
+ const { generateDBSchema } = await import("@powerhousedao/codegen");
447
+ await generateDBSchema({
448
+ migrationFile: path$1.join(process.cwd(), migrationFile),
449
+ schemaFile: schemaFile ? path$1.join(process.cwd(), schemaFile) : void 0
450
+ });
451
+ process.exit(0);
452
+ }
453
+ });
454
+ //#endregion
455
+ //#region src/commands/generate-piece-action.ts
456
+ const generatePieceActionCmd = command({
457
+ name: "piece-action",
458
+ description: "Generate an action inside an existing piece",
459
+ args: {
460
+ namePositional: positional({
461
+ type: optional(string),
462
+ displayName: "name",
463
+ description: "The name of the action, e.g. get-record"
464
+ }),
465
+ name: option({
466
+ type: optional(string),
467
+ long: "name",
468
+ short: "n",
469
+ description: "The name of the action to generate"
470
+ }),
471
+ piece: option({
472
+ type: optional(string),
473
+ long: "piece",
474
+ short: "p",
475
+ description: "The piece directory under pieces/ to add the action to. Optional when the project ships exactly one piece."
476
+ }),
477
+ requireReactor: option({
478
+ type: optional(oneOf(["read", "write"])),
479
+ long: "require-reactor",
480
+ description: "Declare reactor access for the action: read, or write (which includes read). The action then gets context.reactor"
481
+ }),
482
+ ...skipInstallArgs,
483
+ ...debugArgs
484
+ },
485
+ handler: async (args) => {
486
+ const { startGeneratePieceAction } = await import("./generate-piece-action-DbxrzfKY.mjs");
487
+ await startGeneratePieceAction(args, process.cwd());
488
+ process.exit(0);
489
+ }
490
+ });
491
+ //#endregion
492
+ //#region src/commands/generate-piece-trigger.ts
493
+ const generatePieceTriggerCmd = command({
494
+ name: "piece-trigger",
495
+ description: "Generate a trigger inside an existing piece",
496
+ args: {
497
+ namePositional: positional({
498
+ type: optional(string),
499
+ displayName: "name",
500
+ description: "The name of the trigger, e.g. new-record"
501
+ }),
502
+ name: option({
503
+ type: optional(string),
504
+ long: "name",
505
+ short: "n",
506
+ description: "The name of the trigger to generate"
507
+ }),
508
+ piece: option({
509
+ type: optional(string),
510
+ long: "piece",
511
+ short: "p",
512
+ description: "The piece directory under pieces/ to add the trigger to. Optional when the project ships exactly one piece."
513
+ }),
514
+ strategy: option({
515
+ type: oneOf(["polling", "webhook"]),
516
+ long: "strategy",
517
+ description: "How the trigger fires: polled on a schedule, or delivered to a webhook",
518
+ defaultValue: () => "polling",
519
+ defaultValueIsSerializable: true
520
+ }),
521
+ requireReactor: option({
522
+ type: optional(oneOf(["read", "write"])),
523
+ long: "require-reactor",
524
+ description: "Declare reactor access for the trigger: read, or write (which includes read). Its hooks then get context.reactor"
525
+ }),
526
+ ...skipInstallArgs,
527
+ ...debugArgs
528
+ },
529
+ handler: async (args) => {
530
+ const { startGeneratePieceTrigger } = await import("./generate-piece-trigger-CqVOcL9g.mjs");
531
+ await startGeneratePieceTrigger(args, process.cwd());
532
+ process.exit(0);
533
+ }
534
+ });
535
+ //#endregion
536
+ //#region src/commands/generate-piece.ts
537
+ const generatePieceCmd = command({
538
+ name: "piece",
539
+ description: "Generate a piece: a connector whose actions and triggers a workflow can call",
540
+ args: {
541
+ namePositional: positional({
542
+ type: optional(string),
543
+ displayName: "name",
544
+ description: "The name of the piece to generate. Its directory is the kebab-case of this."
545
+ }),
546
+ name: option({
547
+ type: optional(string),
548
+ long: "name",
549
+ short: "n",
550
+ description: "The name of the piece to generate"
551
+ }),
552
+ id: option({
553
+ type: optional(string),
554
+ long: "id",
555
+ description: "The piece id, the pieceName a workflow step holds, e.g. @acme/piece-crm. Defaults to one derived from the package name."
556
+ }),
557
+ auth: option({
558
+ type: oneOf([
559
+ "none",
560
+ "secret",
561
+ "custom"
562
+ ]),
563
+ long: "auth",
564
+ description: "The kind of connection the piece asks for",
565
+ defaultValue: () => "custom",
566
+ defaultValueIsSerializable: true
567
+ }),
568
+ description: option({
569
+ type: optional(string),
570
+ long: "description",
571
+ description: "One line describing what the piece connects to"
572
+ }),
573
+ dir: option({
574
+ type: optional(Directory),
575
+ long: "dir",
576
+ description: "Name of the directory of an existing piece to re-register"
577
+ }),
578
+ all: flag({
579
+ long: "all",
580
+ short: "a",
581
+ description: "Re-register every piece in pieces/: refresh the pieces list and the manifest, and prune what is gone"
582
+ }),
583
+ ...skipInstallArgs,
584
+ ...debugArgs
585
+ },
586
+ handler: async (args) => {
587
+ const { startGeneratePiece } = await import("./generate-piece-QTt-ddt2.mjs");
588
+ await startGeneratePiece(args, process.cwd());
589
+ process.exit(0);
590
+ }
591
+ });
592
+ const generateProcessorCmd = command({
593
+ name: "processor",
594
+ description: "Generate a processor",
595
+ args: {
596
+ name: option({
597
+ type: optional(string),
598
+ long: "name",
599
+ short: "n",
600
+ description: "The name of the processor to generate"
601
+ }),
602
+ type: option({
603
+ type: oneOf(["analytics", "relationalDb"]),
604
+ long: "type",
605
+ description: "The type of processor to generate",
606
+ defaultValue: () => "analytics",
607
+ defaultValueIsSerializable: true
608
+ }),
609
+ documentTypes: multioption({
610
+ type: CommaSeparatedStrings,
611
+ long: "document-types",
612
+ short: "t",
613
+ description: "The document types the processor will run on (repeatable or comma-separated)",
614
+ defaultValue: () => [],
615
+ defaultValueIsSerializable: true
616
+ }),
617
+ apps: multioption({
618
+ long: "apps",
619
+ type: { from(rawProcessorApps) {
620
+ const processorApps = splitCommaSeparated(rawProcessorApps);
621
+ if (processorApps.length === 0) throw new Error(`No arguments provided for processor apps. Must be "connect" and/or "switchboard"`);
622
+ if (processorApps.length > 2) throw new Error(`Too many arguments provided for processor apps. Must be "connect" and/or "switchboard"`);
623
+ const allowed = new Set(PROCESSOR_APPS);
624
+ if (!processorApps.every((p) => allowed.has(p))) throw new Error(`Processor apps can only be "connect" and/or "switchboard".`);
625
+ return Promise.resolve(processorApps);
626
+ } },
627
+ description: "Whether the processor will run in switchboard (nodejs), connect (browser), or both",
628
+ defaultValue: () => ["switchboard", "connect"],
629
+ defaultValueIsSerializable: true
630
+ }),
631
+ document: option({
632
+ type: optional(File),
633
+ long: "document",
634
+ short: "d",
635
+ description: "Path to a powerhouse/processor spec file (.phd or .json) to drive codegen"
636
+ }),
637
+ dir: option({
638
+ type: optional(Directory),
639
+ long: "dir",
640
+ description: "Name of the directory of an existing processor to re-generate"
641
+ }),
642
+ all: flag({
643
+ long: "all",
644
+ short: "a",
645
+ description: "Re-generate all existing processors in the current project"
646
+ }),
647
+ extract: flag({
648
+ long: "extract",
649
+ short: "x",
650
+ description: "Write a powerhouse/processor spec for each existing processor into specs/processors/"
651
+ }),
652
+ ...skipInstallArgs,
653
+ ...debugArgs
654
+ },
655
+ handler: async (args) => {
656
+ const { startGenerateProcessor } = await import("./generate-processor-DBtTkgo5.mjs");
657
+ await startGenerateProcessor(args, process.cwd());
658
+ process.exit(0);
659
+ }
660
+ });
661
+ //#endregion
662
+ //#region src/commands/generate-subgraph.ts
663
+ const generateSubgraphCmd = command({
664
+ name: "subgraph",
665
+ description: "Generate a subgraph",
666
+ args: {
667
+ name: option({
668
+ type: optional(string),
669
+ long: "name",
670
+ short: "n",
671
+ description: "The name of the subgraph to generate"
672
+ }),
673
+ document: option({
674
+ type: optional(File),
675
+ long: "document",
676
+ short: "d",
677
+ description: "Path to a powerhouse/subgraph spec file (.phd or .json) to drive codegen"
678
+ }),
679
+ dir: option({
680
+ type: optional(Directory),
681
+ long: "dir",
682
+ description: "Name of the directory of an existing subgraph to re-generate"
683
+ }),
684
+ all: flag({
685
+ long: "all",
686
+ short: "a",
687
+ description: "Re-generate all existing subgraphs in the current project"
688
+ }),
689
+ extract: flag({
690
+ long: "extract",
691
+ short: "x",
692
+ description: "Write a powerhouse/subgraph spec for each existing subgraph into specs/subgraphs/"
693
+ }),
694
+ ...skipInstallArgs,
695
+ ...debugArgs
696
+ },
697
+ handler: async (args) => {
698
+ const { startGenerateSubgraph } = await import("./generate-subgraph-CVlTo7qk.mjs");
699
+ await startGenerateSubgraph(args, process.cwd());
700
+ process.exit(0);
701
+ }
702
+ });
703
+ //#endregion
704
+ //#region src/commands/generate.ts
705
+ const generate = subcommands({
706
+ name: "generate",
707
+ description: `The generate command creates code for Powerhouse modules. It helps you create new code from scratch, or to re-generate existing code in your project.`,
708
+ cmds: {
709
+ all: generateAllCmd,
710
+ "document-model": generateDocumentModelCmd,
711
+ editor: generateEditorCmd,
712
+ app: generateAppCmd,
713
+ processor: generateProcessorCmd,
714
+ subgraph: generateSubgraphCmd,
715
+ piece: generatePieceCmd,
716
+ "piece-action": generatePieceActionCmd,
717
+ "piece-trigger": generatePieceTriggerCmd,
718
+ "migration-file": generateMigrationFileCmd,
719
+ "desktop-shell": generateDesktopShellCmd
720
+ }
721
+ });
722
+ //#endregion
723
+ //#region src/commands/init.ts
724
+ const init = command({
725
+ name: "init",
726
+ description: "Initialize a new project",
727
+ args: initArgs,
728
+ handler: async (args) => {
729
+ if (args.debug) console.log({ args });
730
+ const { startInit } = await import("./init-ScuT3z7P.mjs");
731
+ await startInit(args);
732
+ process.exit(0);
733
+ }
734
+ });
735
+ //#endregion
736
+ //#region src/commands/inspect.ts
737
+ const inspect = command({
738
+ name: "inspect",
739
+ description: `
740
+ The inspect command examines and provides detailed information about a Powerhouse package.
741
+ It helps you understand the structure, dependencies, and configuration of packages in
742
+ your project.
743
+
744
+ This command:
745
+ 1. Analyzes the specified package
746
+ 2. Retrieves detailed information about its structure and configuration
747
+ 3. Displays package metadata, dependencies, and other relevant information
748
+ 4. Helps troubleshoot package-related issues`,
749
+ aliases: ["is"],
750
+ args: inspectArgs,
751
+ handler: async (args) => {
752
+ if (args.debug) console.log(args);
753
+ const { startInspect } = await import("./inspect-zWJnBDMJ.mjs");
754
+ startInspect(args);
755
+ process.exit(0);
756
+ }
757
+ });
758
+ //#endregion
759
+ //#region src/commands/install.ts
760
+ const MANIFEST_TIMEOUT_MS = 1e4;
761
+ async function fetchExternalDependencies(registryUrl, dependency) {
762
+ const base = registryUrl.endsWith("/") ? registryUrl : `${registryUrl}/`;
763
+ const spec = dependency.version ? `${dependency.name}@${dependency.version}` : dependency.name;
764
+ try {
765
+ const response = await fetch(`${base}-/cdn/${spec}/powerhouse.manifest.json`, { signal: AbortSignal.timeout(MANIFEST_TIMEOUT_MS) });
766
+ if (!response.ok) return [];
767
+ const external = (await response.json()).externalDependencies;
768
+ return typeof external === "object" && external !== null ? Object.keys(external).sort() : [];
769
+ } catch {
770
+ return [];
771
+ }
772
+ }
773
+ async function warnAboutExternalDependencies(registryUrl, dependencies) {
774
+ const found = await Promise.all(dependencies.map((dependency) => fetchExternalDependencies(registryUrl, dependency)));
775
+ for (const [i, dependency] of dependencies.entries()) {
776
+ const external = found[i];
777
+ if (external.length === 0) continue;
778
+ console.warn(`⚠ ${dependency.name}: its subgraphs and processors need packages with native addons or WebAssembly modules (${external.join(", ")}) and only run when the package is installed locally: ph install --local ${dependency.name}\n Its pieces work either way.`);
779
+ }
780
+ }
781
+ const install = command({
782
+ name: "install",
783
+ aliases: ["add", "i"],
784
+ description: `
785
+ The install command adds Powerhouse dependencies to your project.
786
+
787
+ By default it only registers the package in powerhouse.config.json with
788
+ provider "registry" — Connect will load it from the registry CDN at runtime.
789
+
790
+ With --local, the package is also installed into node_modules and marked
791
+ as provider "local" — it will be bundled into ph connect build so the
792
+ preview works without the registry being reachable.
793
+
794
+ Resolution order for the registry URL:
795
+ --registry flag > PH_REGISTRY_URL env > powerhouse.config.json > default
796
+ `,
797
+ args: installArgs,
798
+ handler: async (args) => {
799
+ if (args.debug) console.log(args);
800
+ const { getPowerhouseProjectInfo, makeDependenciesWithVersions } = await import("@powerhousedao/shared/clis");
801
+ const { projectPath, localProjectPath, globalProjectPath, packageManager, isGlobal } = await getPowerhouseProjectInfo(args);
802
+ if (!projectPath) throw new Error(`Could not find project path to install from.`);
803
+ const { resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
804
+ const registryUrl = resolveRegistryUrl({
805
+ registry: args.registry,
806
+ projectPath
807
+ });
808
+ if (args.debug) console.log(">>> registryUrl", registryUrl);
809
+ const dependenciesWithVersions = await makeDependenciesWithVersions(args.dependencies, registryUrl);
810
+ if (args.debug) {
811
+ console.log(">>> parsedDependencies", dependenciesWithVersions);
812
+ console.log("\n>>> projectInfo", {
813
+ localProjectPath,
814
+ globalProjectPath,
815
+ packageManager,
816
+ isGlobal
817
+ });
818
+ }
819
+ if (args.local) {
820
+ if (dependenciesWithVersions.length === 0) throw new Error("--local requires at least one package name (e.g. ph install --local @scope/pkg)");
821
+ try {
822
+ const specs = dependenciesWithVersions.map((d) => d.version ? `${d.name}@${d.version}` : d.name);
823
+ const scopes = /* @__PURE__ */ new Set();
824
+ for (const dep of dependenciesWithVersions) if (dep.name.startsWith("@")) {
825
+ const scope = dep.name.split("/")[0];
826
+ scopes.add(scope);
827
+ }
828
+ const scopeRegistryArgs = Array.from(scopes).map((scope) => `--${scope}:registry=${registryUrl}`);
829
+ const minReleaseAgeArgs = packageManager === "pnpm" ? ["--config.minimum-release-age=0"] : [];
830
+ const allowBuildArgs = packageManager === "pnpm" && args.allowBuild.length > 0 ? [`--allow-build=${args.allowBuild.join(",")}`] : [];
831
+ const { resolveCommand } = await import("package-manager-detector");
832
+ const resolved = resolveCommand(packageManager, "add", [
833
+ ...specs,
834
+ ...scopeRegistryArgs,
835
+ ...minReleaseAgeArgs,
836
+ ...allowBuildArgs
837
+ ]);
838
+ if (!resolved) throw new Error(`Failed to resolve install command for package manager "${packageManager}".`);
839
+ const installCommand = `${resolved.command} ${resolved.args.join(" ")}`;
840
+ if (scopeRegistryArgs.length > 0) console.log(`Installing dependencies 📦 (routing ${Array.from(scopes).join(", ")} → ${registryUrl})...`);
841
+ else console.log("Installing dependencies 📦...");
842
+ console.log(`> ${installCommand}`);
843
+ execSync$1(installCommand, {
844
+ stdio: "inherit",
845
+ cwd: projectPath
846
+ });
847
+ console.log("Dependency installed successfully 🎉");
848
+ } catch (error) {
849
+ console.error("❌ Failed to install dependencies");
850
+ throw error;
851
+ }
852
+ }
853
+ const { updateConfigFile } = await import("./utils-TO9lB8Xs.mjs");
854
+ try {
855
+ console.log("⚙️ Updating powerhouse config file...");
856
+ updateConfigFile(dependenciesWithVersions, projectPath, "install", args.local ? "local" : "registry", registryUrl, args.registry !== void 0);
857
+ console.log("Config file updated successfully 🎉");
858
+ } catch (error) {
859
+ console.error("❌ Failed to update config file");
860
+ throw error;
861
+ }
862
+ if (!args.local) await warnAboutExternalDependencies(registryUrl, dependenciesWithVersions);
863
+ process.exit(0);
864
+ }
865
+ });
866
+ //#endregion
867
+ //#region src/commands/list.ts
868
+ const list = command({
869
+ name: "list",
870
+ description: `
871
+ The list command displays information about installed Powerhouse packages in your project.
872
+ It reads the powerhouse.config.json file and shows the packages that are currently installed.
873
+
874
+ This command:
875
+ 1. Examines your project configuration
876
+ 2. Lists all installed Powerhouse packages
877
+ 3. Provides a clear overview of your project's dependencies
878
+ 4. Helps you manage and track your Powerhouse components
879
+ `,
880
+ aliases: ["l"],
881
+ args: listArgs,
882
+ handler: async (args) => {
883
+ if (args.debug) console.log(args);
884
+ try {
885
+ const { getPowerhouseProjectInfo } = await import("@powerhousedao/shared/clis");
886
+ const projectInfo = await getPowerhouseProjectInfo();
887
+ const { getConfig } = await import("@powerhousedao/config/node");
888
+ const phConfig = getConfig(projectInfo.projectPath + "/powerhouse.config.json");
889
+ if (!phConfig.packages || phConfig.packages.length === 0) {
890
+ console.log("No packages found in the project");
891
+ return;
892
+ }
893
+ console.log("Installed Packages:\n");
894
+ phConfig.packages.forEach((pkg) => {
895
+ console.log(pkg.version ? `${pkg.packageName}@${pkg.version}` : pkg.packageName);
896
+ });
897
+ } catch (_e) {
898
+ console.log("No packages found in the project");
899
+ }
900
+ process.exit(0);
901
+ }
902
+ });
903
+ //#endregion
904
+ //#region src/commands/login.ts
905
+ const login = command({
906
+ name: "login",
907
+ description: `
908
+ The login command authenticates you with Renown using your Ethereum wallet. This enables
909
+ the CLI to act on behalf of your Ethereum identity for authenticated operations.
910
+
911
+ This command:
912
+ 1. Generates or loads a cryptographic identity (DID) for the CLI
913
+ 2. Opens your browser to the Renown authentication page
914
+ 3. You authorize the CLI's DID to act on behalf of your Ethereum address
915
+ 4. Stores the credentials locally in .ph/.renown.json
916
+ `,
917
+ args: loginArgs,
918
+ handler: async (args) => {
919
+ if (args.debug) console.log(args);
920
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
921
+ const renown = await getRenown(args.renownUrl);
922
+ if (args.showDid) {
923
+ console.log(renown.did);
924
+ process.exit(0);
925
+ }
926
+ if (args.status) {
927
+ const { getAuthStatus } = await import("@renown/sdk/node");
928
+ const status = getAuthStatus(renown);
929
+ if (!status.authenticated || !status.address) {
930
+ console.log("Not authenticated with an Ethereum address.");
931
+ console.log("Run \"ph login\" to authenticate.");
932
+ } else {
933
+ console.log("Authenticated");
934
+ console.log(` ETH Address: ${status.address}`);
935
+ console.log(` User DID: ${status.userDid}`);
936
+ console.log(` Chain ID: ${status.chainId}`);
937
+ console.log(` CLI DID: ${status.cliDid}`);
938
+ console.log(` Authenticated at: ${status.authenticatedAt?.toLocaleString()}`);
939
+ console.log(` Renown URL: ${status.baseUrl}`);
940
+ }
941
+ process.exit(0);
942
+ }
943
+ if (args.logout) {
944
+ await handleLogout();
945
+ process.exit(0);
946
+ }
947
+ const { browserLogin } = await import("@renown/sdk/node");
948
+ console.debug("Initializing cryptographic identity...");
949
+ console.log(`CLI DID: ${renown.did}`);
950
+ try {
951
+ const timeoutMs = args.timeout ? args.timeout * 1e3 : void 0;
952
+ const result = await browserLogin(renown, {
953
+ renownUrl: args.renownUrl,
954
+ timeoutMs,
955
+ onLoginUrl: (url, sessionId) => {
956
+ console.log("Opening browser for authentication...");
957
+ console.log(`Session ID: ${sessionId.slice(0, 8)}...`);
958
+ console.log(`Login URL: ${url}`);
959
+ console.log();
960
+ console.log("Waiting for authentication in browser");
961
+ console.log(`(timeout in ${(timeoutMs ?? 3e5) / 1e3} seconds)`);
962
+ console.log();
963
+ console.log("Please connect your wallet and authorize this CLI to act on your behalf.");
964
+ console.log();
965
+ process.stdout.write("Waiting");
966
+ },
967
+ onPollTick: () => process.stdout.write("."),
968
+ onBrowserOpenFailed: (url) => {
969
+ console.error("Failed to open browser automatically.");
970
+ console.log(`Please open this URL manually: ${url}`);
971
+ }
972
+ });
973
+ console.log();
974
+ console.log();
975
+ console.log("Successfully authenticated!");
976
+ console.log(` ETH Address: ${result.user.address}`);
977
+ console.log(` User DID: ${result.user.did}`);
978
+ console.log(` CLI DID: ${result.cliDid}`);
979
+ console.log();
980
+ console.log("The CLI can now act on behalf of your Ethereum identity.");
981
+ } catch (error) {
982
+ console.log();
983
+ throw error;
984
+ }
985
+ process.exit(0);
986
+ }
987
+ });
988
+ async function handleLogout() {
989
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
990
+ const renown = await getRenown();
991
+ if (!renown.user) {
992
+ console.log("Not currently authenticated.");
993
+ return;
994
+ }
995
+ try {
996
+ await renown.logout();
997
+ console.log("Successfully logged out.");
998
+ } catch (error) {
999
+ console.error("Failed to clear credentials.");
1000
+ console.debug(error);
1001
+ }
1002
+ }
1003
+ //#endregion
1004
+ //#region src/commands/logout.ts
1005
+ const logout = command({
1006
+ name: "logout",
1007
+ description: `
1008
+ The logout command removes an existing session created with 'ph login'`,
1009
+ args: {},
1010
+ handler: async () => {
1011
+ await handleLogout();
1012
+ process.exit(0);
1013
+ }
1014
+ });
1015
+ //#endregion
1016
+ //#region src/commands/migrate.ts
1017
+ const migrate = command({
1018
+ name: "migrate",
1019
+ args: migrateArgs,
1020
+ description: "Run migrations",
1021
+ handler: async (args) => {
1022
+ if (args.debug) console.log(args);
1023
+ const { startMigrate } = await import("./migrate-DK4HK7Dn.mjs");
1024
+ await startMigrate(args);
1025
+ process.exit(0);
1026
+ }
1027
+ });
1028
+ //#endregion
1029
+ //#region src/commands/publish.ts
1030
+ function hasTagFlag(args) {
1031
+ return args.some((a) => a === "--tag" || a.startsWith("--tag="));
1032
+ }
1033
+ function isInteractive() {
1034
+ return Boolean(process.stdin.isTTY) && !process.env.CI;
1035
+ }
1036
+ async function readPrereleaseTag(projectPath) {
1037
+ try {
1038
+ const [{ readPackageSync }, { prerelease }] = await Promise.all([import("read-pkg"), import("semver")]);
1039
+ const pkg = readPackageSync({ cwd: projectPath });
1040
+ if (!pkg.version) return null;
1041
+ const parts = prerelease(pkg.version);
1042
+ if (!parts || parts.length === 0) return null;
1043
+ const label = String(parts[0]);
1044
+ if (!/^[a-z][a-z0-9-]*$/i.test(label)) return null;
1045
+ return {
1046
+ version: pkg.version,
1047
+ tag: label
1048
+ };
1049
+ } catch {
1050
+ return null;
1051
+ }
1052
+ }
1053
+ const publish = command({
1054
+ name: "publish",
1055
+ description: `
1056
+ Publish a package to the Powerhouse registry. This is a thin wrapper around npm publish
1057
+ that automatically sets the registry URL.
1058
+
1059
+ This command:
1060
+ 1. Resolves the registry URL (--registry flag > PH_REGISTRY_URL env > powerhouse.config.json > default)
1061
+ 2. Checks authentication with the registry via npm whoami
1062
+ 3. Forwards all additional arguments to npm publish
1063
+ `,
1064
+ args: publishArgs,
1065
+ handler: async (args) => {
1066
+ if (args.debug) console.log(args);
1067
+ const { getPowerhouseProjectInfo } = await import("@powerhousedao/shared/clis");
1068
+ const { projectPath } = await getPowerhouseProjectInfo();
1069
+ if (!projectPath) throw new Error("Could not find project path.");
1070
+ const { checkNpmAuth, npmPublish, resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
1071
+ const { mintRegistryAuthToken } = await import("./registry-auth-Bm5AR-fB.mjs");
1072
+ const registryUrl = resolveRegistryUrl({
1073
+ registry: args.registry,
1074
+ projectPath
1075
+ });
1076
+ if (args.debug) console.log(">>> registryUrl", registryUrl);
1077
+ let authToken;
1078
+ try {
1079
+ authToken = await mintRegistryAuthToken(registryUrl, 300);
1080
+ if (args.debug) console.error(`>>> minted renown token for ${registryUrl} (5m TTL)`);
1081
+ } catch (err) {
1082
+ if (args.debug) console.error(`>>> renown token mint skipped: ${err.message}`);
1083
+ try {
1084
+ await checkNpmAuth(registryUrl);
1085
+ } catch {
1086
+ console.error(`Not authenticated with registry: ${registryUrl}`);
1087
+ console.error(`Run: ph login (recommended) or npm adduser --registry ${registryUrl}`);
1088
+ process.exit(1);
1089
+ }
1090
+ }
1091
+ let forwardedArgs = args.forwardedArgs;
1092
+ if (!hasTagFlag(forwardedArgs)) {
1093
+ const prereleaseInfo = await readPrereleaseTag(projectPath);
1094
+ if (prereleaseInfo) {
1095
+ const { version, tag } = prereleaseInfo;
1096
+ if (!isInteractive()) {
1097
+ console.error(`Detected prerelease version ${version}. npm requires an explicit dist-tag for prerelease publishes.`);
1098
+ console.error(`Re-run with --tag <label> (e.g. --tag ${tag}) to proceed.`);
1099
+ process.exit(1);
1100
+ }
1101
+ const enquirer = await import("enquirer");
1102
+ let confirmed;
1103
+ try {
1104
+ confirmed = (await enquirer.default.prompt({
1105
+ type: "confirm",
1106
+ name: "confirmed",
1107
+ message: `Detected prerelease version ${version}. Publish with --tag ${tag}?`,
1108
+ initial: true
1109
+ })).confirmed;
1110
+ } catch {
1111
+ confirmed = false;
1112
+ }
1113
+ if (!confirmed) {
1114
+ console.error(`Aborted. To publish manually: npm publish --registry ${registryUrl} --tag <label>`);
1115
+ process.exit(1);
1116
+ }
1117
+ forwardedArgs = [
1118
+ "--tag",
1119
+ tag,
1120
+ ...forwardedArgs
1121
+ ];
1122
+ }
1123
+ }
1124
+ if (args.debug) console.log(">>> command", `npm publish --registry ${registryUrl} ${forwardedArgs.join(" ")}`);
1125
+ console.log(`Publishing to ${registryUrl}...`);
1126
+ const result = await npmPublish({
1127
+ registryUrl,
1128
+ cwd: projectPath,
1129
+ args: forwardedArgs,
1130
+ authToken
1131
+ });
1132
+ if (result.stdout) console.log(result.stdout);
1133
+ process.exit(0);
1134
+ }
1135
+ });
1136
+ //#endregion
1137
+ //#region src/commands/registry-login.ts
1138
+ const registryLogin = command({
1139
+ name: "registry-login",
1140
+ description: `
1141
+ Log in to a Powerhouse registry using your Renown identity. Mints a longer-lived
1142
+ bearer token (default 30 days) bound to the registry's audience and writes the
1143
+ token into ~/.npmrc so raw 'npm publish' / 'npm install' work without further
1144
+ setup.
1145
+
1146
+ Prerequisites:
1147
+ Run 'ph login' first to establish a Renown identity.
1148
+
1149
+ Usage:
1150
+ ph registry-login # uses powerhouse.config.json / PH_REGISTRY_URL
1151
+ ph registry-login --registry https://registry.vetra.io
1152
+ ph registry-login --expiry 7d
1153
+ `,
1154
+ args: registryLoginArgs,
1155
+ handler: async (args) => {
1156
+ if (args.debug) console.log(args);
1157
+ const { getPowerhouseProjectInfo } = await import("@powerhousedao/shared/clis");
1158
+ const projectPath = (await getPowerhouseProjectInfo().catch(() => null))?.projectPath ?? process.cwd();
1159
+ const [{ resolveRegistryUrl, writeRegistryAuthToken }, { mintRegistryAuthToken }, { parseExpiry, formatExpiry }] = await Promise.all([
1160
+ import("@powerhousedao/shared/registry"),
1161
+ import("./registry-auth-Bm5AR-fB.mjs"),
1162
+ import("@renown/sdk/node")
1163
+ ]);
1164
+ const registryUrl = resolveRegistryUrl({
1165
+ registry: args.registry,
1166
+ projectPath
1167
+ });
1168
+ const expiresIn = parseExpiry(args.expiry);
1169
+ const npmrcPath = await writeRegistryAuthToken(registryUrl, await mintRegistryAuthToken(registryUrl, expiresIn));
1170
+ console.log(`Logged in to ${registryUrl}`);
1171
+ console.log(` Token expires in: ${formatExpiry(expiresIn)}`);
1172
+ console.log(` Wrote: ${npmrcPath}`);
1173
+ process.exit(0);
1174
+ }
1175
+ });
1176
+ //#endregion
1177
+ //#region src/commands/run.ts
1178
+ const runHost = command({
1179
+ name: "run",
1180
+ description: "Run a host from the project's hosts/ folder: `ph run <host> [verb]`. The host's own host.js names the runner module; the verb defaults to `run`. Part of uniform-runners (FEATURE_UNIFORM_RUNNERS_ENABLED).",
1181
+ args: {
1182
+ host: positional({
1183
+ type: string,
1184
+ displayName: "host",
1185
+ description: "Folder name under hosts/ (e.g. vetra, connect)."
1186
+ }),
1187
+ verb: positional({
1188
+ type: optional(string),
1189
+ displayName: "verb",
1190
+ description: "Runner verb (default: run; e.g. dev, build, serve)."
1191
+ }),
1192
+ debug: flag({
1193
+ type: optional(boolean),
1194
+ long: "debug",
1195
+ description: "Print resolved host/runner/verb before dispatch."
1196
+ }),
1197
+ explain: option({
1198
+ type: optional(string),
1199
+ long: "explain",
1200
+ description: "Explain a resolved aspect instead of running: `--explain drives` prints the merged drive plan with provenance."
1201
+ })
1202
+ },
1203
+ handler: async (args) => {
1204
+ if (args.explain !== void 0) {
1205
+ const { explainHost } = await import("./explain-BDHmXgw3.mjs");
1206
+ await explainHost({
1207
+ host: args.host,
1208
+ topic: args.explain
1209
+ });
1210
+ return;
1211
+ }
1212
+ const { startRun } = await import("./start-run-CmDxyMw0.mjs");
1213
+ await startRun({
1214
+ host: args.host,
1215
+ verb: args.verb,
1216
+ debug: args.debug
1217
+ });
1218
+ }
1219
+ });
1220
+ //#endregion
1221
+ //#region src/commands/switchboard.ts
1222
+ const switchboard = command({
1223
+ name: "switchboard",
1224
+ aliases: ["reactor"],
1225
+ description: `
1226
+ The switchboard command starts a local Switchboard instance, which acts as the document
1227
+ processing engine for Powerhouse projects. It provides the infrastructure for document
1228
+ models, processors, and real-time updates.
1229
+
1230
+ This command:
1231
+ 1. Starts a local switchboard server
1232
+ 2. Loads document models and processors
1233
+ 3. Provides an API for document operations
1234
+ 4. Enables real-time document processing
1235
+ 5. Can authenticate with remote services using your identity from 'ph login'`,
1236
+ args: switchboardArgs,
1237
+ handler: async (args) => {
1238
+ if (args.debug) console.log(args);
1239
+ const { basePath, dbPath, migrate, migrateStatus, reset, yes } = args;
1240
+ if (basePath) process.env.BASE_PATH = basePath;
1241
+ if (reset) {
1242
+ const { resetSwitchboardDatabase } = await import("./switchboard-reset-MtTB_GAI.mjs");
1243
+ await resetSwitchboardDatabase({
1244
+ dbPath,
1245
+ yes
1246
+ });
1247
+ process.exit(0);
1248
+ }
1249
+ if (migrate || migrateStatus) {
1250
+ const { runSwitchboardMigrations } = await import("./switchboard-migrate-7JQZM7-5.mjs");
1251
+ await runSwitchboardMigrations({
1252
+ dbPath,
1253
+ statusOnly: migrateStatus
1254
+ });
1255
+ process.exit(0);
1256
+ }
1257
+ const { startSwitchboard } = await import("./switchboard-C5zgkRl2.mjs");
1258
+ const { defaultDriveUrl, renown } = await startSwitchboard(args);
1259
+ console.log(" ➜ Switchboard:", defaultDriveUrl);
1260
+ if (renown) console.log(" ➜ Identity:", renown.did);
1261
+ }
1262
+ });
1263
+ //#endregion
1264
+ //#region src/commands/uninstall.ts
1265
+ const uninstall = command({
1266
+ name: "uninstall",
1267
+ aliases: ["remove"],
1268
+ description: `
1269
+ The uninstall command removes Powerhouse dependencies from your project. It handles the
1270
+ removal of packages, updates configuration files, and ensures proper cleanup.
1271
+
1272
+ This command:
1273
+ 1. Uninstalls specified Powerhouse dependencies using your package manager
1274
+ 2. Updates powerhouse.config.json to remove the dependencies
1275
+ 3. Supports various uninstallation options and configurations
1276
+ 4. Works with ${AGENTS.join(", ")} package managers
1277
+ `,
1278
+ args: uninstallArgs,
1279
+ handler: async (args) => {
1280
+ if (args.debug) console.log(args);
1281
+ const { getPowerhouseProjectInfo, getPowerhouseProjectUninstallCommand, makeDependenciesWithVersions } = await import("@powerhousedao/shared/clis");
1282
+ const { projectPath, localProjectPath, globalProjectPath, packageManager, isGlobal } = await getPowerhouseProjectInfo(args);
1283
+ if (!projectPath) throw new Error(`Could not find project path to uninstall from`);
1284
+ const dependenciesWithVersions = await makeDependenciesWithVersions(args.dependencies);
1285
+ if (args.debug) console.log(">>> parsedDependencies", dependenciesWithVersions);
1286
+ if (args.debug) console.log("\n>>> projectInfo", {
1287
+ localProjectPath,
1288
+ globalProjectPath,
1289
+ packageManager,
1290
+ isGlobal
1291
+ });
1292
+ try {
1293
+ console.log("Uninstalling dependencies 📦 ...");
1294
+ const uninstallCommand = await getPowerhouseProjectUninstallCommand(packageManager, args.dependencies);
1295
+ execSync(uninstallCommand, {
1296
+ stdio: "inherit",
1297
+ cwd: projectPath
1298
+ });
1299
+ console.log("Dependency uninstalled successfully 🎉");
1300
+ } catch (error) {
1301
+ console.error("❌ Failed to uninstall dependencies");
1302
+ throw error;
1303
+ }
1304
+ const { removeStylesImports, updateConfigFile } = await import("./utils-TO9lB8Xs.mjs");
1305
+ try {
1306
+ console.log("⚙️ Updating powerhouse config file...");
1307
+ updateConfigFile(dependenciesWithVersions, projectPath, "uninstall");
1308
+ console.log("Config file updated successfully 🎉");
1309
+ } catch (error) {
1310
+ console.error("❌ Failed to update config file");
1311
+ throw error;
1312
+ }
1313
+ try {
1314
+ console.log("⚙️ Updating styles.css file...");
1315
+ removeStylesImports(dependenciesWithVersions, projectPath);
1316
+ console.log("Styles file updated successfully 🎉");
1317
+ } catch (error) {
1318
+ console.error("❌ Failed to update styles file");
1319
+ throw error;
1320
+ }
1321
+ process.exit(0);
1322
+ }
1323
+ });
1324
+ //#endregion
1325
+ //#region src/commands/unpublish.ts
1326
+ const unpublish = command({
1327
+ name: "unpublish",
1328
+ description: `
1329
+ Unpublish a package from the Powerhouse registry. This is a thin wrapper around
1330
+ npm unpublish that automatically targets the Powerhouse registry and never
1331
+ reaches npmjs.org.
1332
+
1333
+ Forms:
1334
+ ph unpublish # unpublish <name>@<version> from cwd's package.json
1335
+ ph unpublish <name> # unpublish the whole package (all versions)
1336
+ ph unpublish <name>@<version> # unpublish a single version
1337
+
1338
+ Flags:
1339
+ --registry <url> # override registry URL
1340
+ --yes, -y # skip the confirmation prompt
1341
+ `,
1342
+ args: unpublishArgs,
1343
+ handler: async (args) => {
1344
+ if (args.debug) console.log(args);
1345
+ const { getPowerhouseProjectInfo } = await import("@powerhousedao/shared/clis");
1346
+ const { projectPath } = await getPowerhouseProjectInfo();
1347
+ if (!projectPath) throw new Error("Could not find project path.");
1348
+ const { checkNpmAuth, npmUnpublish, resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
1349
+ const registryUrl = resolveRegistryUrl({
1350
+ registry: args.registry,
1351
+ projectPath
1352
+ });
1353
+ const spec = await resolveSpec(args.spec, projectPath);
1354
+ if (!spec) {
1355
+ console.error("No package spec provided and could not read name/version from package.json.");
1356
+ process.exit(1);
1357
+ }
1358
+ if (args.debug) {
1359
+ console.log(">>> registryUrl", registryUrl);
1360
+ console.log(">>> spec", spec);
1361
+ }
1362
+ try {
1363
+ await checkNpmAuth(registryUrl);
1364
+ } catch {
1365
+ console.error(`Not authenticated with registry: ${registryUrl}`);
1366
+ console.error(`Run: npm adduser --registry ${registryUrl}`);
1367
+ process.exit(1);
1368
+ }
1369
+ if (!args.yes) {
1370
+ if (!await confirm(`Unpublish ${spec} from ${registryUrl}? [y/N] `)) {
1371
+ console.log("Aborted.");
1372
+ process.exit(0);
1373
+ }
1374
+ }
1375
+ if (args.debug) console.log(">>> command", `npm unpublish ${spec} --registry ${registryUrl} --force ${args.forwardedArgs.join(" ")}`);
1376
+ console.log(`Unpublishing ${spec} from ${registryUrl}...`);
1377
+ try {
1378
+ const result = await npmUnpublish({
1379
+ registryUrl,
1380
+ cwd: projectPath,
1381
+ spec,
1382
+ args: args.forwardedArgs
1383
+ });
1384
+ if (result.stdout) console.log(result.stdout);
1385
+ process.exit(0);
1386
+ } catch (err) {
1387
+ console.error(err instanceof Error ? err.message : String(err));
1388
+ process.exit(1);
1389
+ }
1390
+ }
1391
+ });
1392
+ async function resolveSpec(explicit, projectPath) {
1393
+ if (explicit) return explicit;
1394
+ try {
1395
+ const { readPackageSync } = await import("read-pkg");
1396
+ const pkg = readPackageSync({ cwd: projectPath });
1397
+ if (!pkg.name) return null;
1398
+ return pkg.version ? `${pkg.name}@${pkg.version}` : pkg.name;
1399
+ } catch {
1400
+ return null;
1401
+ }
1402
+ }
1403
+ async function confirm(prompt) {
1404
+ const rl = createInterface({
1405
+ input: process.stdin,
1406
+ output: process.stdout
1407
+ });
1408
+ try {
1409
+ const answer = await rl.question(prompt);
1410
+ return /^y(es)?$/i.test(answer.trim());
1411
+ } finally {
1412
+ rl.close();
1413
+ }
1414
+ }
1415
+ //#endregion
1416
+ //#region src/commands/ph-cli-commands.ts
1417
+ const baseCommands = {
1418
+ init,
1419
+ generate,
1420
+ vetra: command({
1421
+ name: "vetra",
1422
+ description: `
1423
+ The vetra command sets up a Vetra development environment for working with Vetra projects.
1424
+ It starts a Vetra Switchboard and optionally Connect Studio, enabling document collaboration
1425
+ and real-time processing with a "Vetra" drive or connection to remote drives.
1426
+
1427
+ This command:
1428
+ 1. Starts a Vetra Switchboard with a "Vetra" drive for document storage
1429
+ 2. Optionally connects to remote drives instead of creating a local drive
1430
+ 3. Starts Connect Studio pointing to the Switchboard for user interaction (unless disabled)
1431
+ 4. Enables real-time updates, collaboration, and code generation
1432
+
1433
+ Default drives:
1434
+ Connect's default drives resolve to the Vetra drive (and the preview drive
1435
+ when using --watch), plus any drives configured under
1436
+ connect.drives.defaultDrives in powerhouse.config.json - de-duplicated by
1437
+ URL, so configuring project drives does not cost you the Vetra drive.
1438
+ An explicit --default-drives-url is appended to that list (de-duplicated);
1439
+ it never replaces the Vetra drive.
1440
+ `,
1441
+ args: vetraArgs,
1442
+ handler: async (args) => {
1443
+ if (args.debug) console.log(args);
1444
+ const { startVetra } = await import("./vetra-BD-34wGs.mjs");
1445
+ await startVetra(args);
1446
+ }
1447
+ }),
1448
+ connect,
1449
+ build: build$1,
1450
+ publish,
1451
+ unpublish,
1452
+ "access-token": accessToken,
1453
+ "registry-login": registryLogin,
1454
+ inspect,
1455
+ list,
1456
+ migrate,
1457
+ switchboard,
1458
+ login,
1459
+ logout,
1460
+ install,
1461
+ uninstall
1462
+ };
1463
+ /** Exported for tests; the flag decides whether `run` is registered at all,
1464
+ * so flag-off keeps the command surface byte-identical to before. */
1465
+ function buildPhCliCommands(uniformRunners) {
1466
+ return uniformRunners ? {
1467
+ ...baseCommands,
1468
+ run: runHost
1469
+ } : baseCommands;
1470
+ }
1471
+ const phCliCommands = buildPhCliCommands(isUniformRunnersEnabled());
1472
+ //#endregion
1473
+ export { phCliCommands as n, buildPhCliCommands as t };
1474
+
1475
+ //# sourceMappingURL=ph-cli-commands-3ptdQ0NI.mjs.map
1476
+ //# debugId=fd34b469-65d9-5f9f-adcd-509ea7febba7