@powerhousedao/ph-cli 6.2.3-dev.9 → 6.2.3-staging.0

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 (77) 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-CTvPQFMi.mjs +4 -0
  5. package/dist/build-sO3PcZxl.mjs +166 -0
  6. package/dist/build-sO3PcZxl.mjs.map +1 -0
  7. package/dist/{cli-connect-override-D3hh4aH_.mjs → cli-connect-override-b4kKqgOZ.mjs} +62 -27
  8. package/dist/cli-connect-override-b4kKqgOZ.mjs.map +1 -0
  9. package/dist/cli.d.mts +2 -1
  10. package/dist/cli.mjs +261 -85
  11. package/dist/cli.mjs.map +1 -1
  12. package/dist/connect-build-BMaR9w4G.mjs +153 -0
  13. package/dist/connect-build-BMaR9w4G.mjs.map +1 -0
  14. package/dist/{connect-config-BWGiW3IB.mjs → connect-config-_kiSMsbG.mjs} +19 -12
  15. package/dist/connect-config-_kiSMsbG.mjs.map +1 -0
  16. package/dist/{connect-preview-D7ypzFDc.mjs → connect-preview-CzDqR-JN.mjs} +12 -8
  17. package/dist/{connect-preview-D7ypzFDc.mjs.map → connect-preview-CzDqR-JN.mjs.map} +1 -1
  18. package/dist/{connect-studio-D6rfWCNB.mjs → connect-studio-_-O1-oef.mjs} +15 -10
  19. package/dist/{connect-studio-D6rfWCNB.mjs.map → connect-studio-_-O1-oef.mjs.map} +1 -1
  20. package/dist/connect-studio-f3K1qPWd.mjs +4 -0
  21. package/dist/{generate-all-DrT4ZxHX.mjs → generate-all-CIwP-3aa.mjs} +3 -3
  22. package/dist/{generate-all-DrT4ZxHX.mjs.map → generate-all-CIwP-3aa.mjs.map} +1 -1
  23. package/dist/{generate-app-DNNqA-H3.mjs → generate-app-BTs1u-9l.mjs} +7 -5
  24. package/dist/{generate-app-DNNqA-H3.mjs.map → generate-app-BTs1u-9l.mjs.map} +1 -1
  25. package/dist/{generate-document-model-BJXyODfm.mjs → generate-document-model-DhDQ_06X.mjs} +17 -7
  26. package/dist/{generate-document-model-BJXyODfm.mjs.map → generate-document-model-DhDQ_06X.mjs.map} +1 -1
  27. package/dist/{generate-editor-BejvaVVT.mjs → generate-editor-CW7Do69u.mjs} +7 -5
  28. package/dist/{generate-editor-BejvaVVT.mjs.map → generate-editor-CW7Do69u.mjs.map} +1 -1
  29. package/dist/generate-piece-QTt-ddt2.mjs +65 -0
  30. package/dist/generate-piece-QTt-ddt2.mjs.map +1 -0
  31. package/dist/generate-piece-action-C5WTHsqu.mjs +28 -0
  32. package/dist/generate-piece-action-C5WTHsqu.mjs.map +1 -0
  33. package/dist/generate-piece-trigger-DR10CPOG.mjs +29 -0
  34. package/dist/generate-piece-trigger-DR10CPOG.mjs.map +1 -0
  35. package/dist/{generate-processor-_WOx-mMe.mjs → generate-processor-DBtTkgo5.mjs} +15 -8
  36. package/dist/generate-processor-DBtTkgo5.mjs.map +1 -0
  37. package/dist/{generate-subgraph-BsHUstpl.mjs → generate-subgraph-Dm27O59o.mjs} +10 -6
  38. package/dist/generate-subgraph-Dm27O59o.mjs.map +1 -0
  39. package/dist/{init-BZP6gvYd.mjs → init-CIEMyAug.mjs} +4 -4
  40. package/dist/{init-BZP6gvYd.mjs.map → init-CIEMyAug.mjs.map} +1 -1
  41. package/dist/{inspect-DXjbQEV_.mjs → inspect-BpCB0TPo.mjs} +11 -4
  42. package/dist/inspect-BpCB0TPo.mjs.map +1 -0
  43. package/dist/install-added-dependencies-DVSbzler.mjs +33 -0
  44. package/dist/install-added-dependencies-DVSbzler.mjs.map +1 -0
  45. package/dist/{migrate-jGKfE02L.mjs → migrate-B6QBYDNX.mjs} +4 -4
  46. package/dist/{migrate-jGKfE02L.mjs.map → migrate-B6QBYDNX.mjs.map} +1 -1
  47. package/dist/{registry-auth-DxEWCJu2.mjs → registry-auth-Bm5AR-fB.mjs} +4 -4
  48. package/dist/{registry-auth-DxEWCJu2.mjs.map → registry-auth-Bm5AR-fB.mjs.map} +1 -1
  49. package/dist/scripts/generate-commands-docs.ts +8 -0
  50. package/dist/{switchboard-CJMoMzWx.mjs → switchboard-CgVB4U76.mjs} +17 -5
  51. package/dist/switchboard-CgVB4U76.mjs.map +1 -0
  52. package/dist/{switchboard-migrate-NQ7LHWSi.mjs → switchboard-migrate-7JQZM7-5.mjs} +5 -4
  53. package/dist/{switchboard-migrate-NQ7LHWSi.mjs.map → switchboard-migrate-7JQZM7-5.mjs.map} +1 -1
  54. package/dist/switchboard-nHCI3pha.mjs +4 -0
  55. package/dist/{switchboard-reset-BcQXlcVf.mjs → switchboard-reset-Ctegiqdm.mjs} +3 -3
  56. package/dist/{switchboard-reset-BcQXlcVf.mjs.map → switchboard-reset-Ctegiqdm.mjs.map} +1 -1
  57. package/dist/{utils-BzwczAW-.mjs → utils-C3c5YG6v.mjs} +3 -3
  58. package/dist/{utils-C4isxXSO.mjs → utils-CvmDmCVd.mjs} +3 -3
  59. package/dist/{utils-C4isxXSO.mjs.map → utils-CvmDmCVd.mjs.map} +1 -1
  60. package/dist/{vetra-DkF6EJMY.mjs → vetra-s8gWslse.mjs} +62 -14
  61. package/dist/vetra-s8gWslse.mjs.map +1 -0
  62. package/package.json +17 -16
  63. package/dist/auth-BNkN6kS9.mjs +0 -4
  64. package/dist/build-C-A5-ipO.mjs +0 -4
  65. package/dist/build-uQXq6_HU.mjs +0 -71
  66. package/dist/build-uQXq6_HU.mjs.map +0 -1
  67. package/dist/cli-connect-override-D3hh4aH_.mjs.map +0 -1
  68. package/dist/connect-build-WL4axo4z.mjs +0 -43
  69. package/dist/connect-build-WL4axo4z.mjs.map +0 -1
  70. package/dist/connect-config-BWGiW3IB.mjs.map +0 -1
  71. package/dist/connect-studio-BIQzyq5B.mjs +0 -5
  72. package/dist/generate-processor-_WOx-mMe.mjs.map +0 -1
  73. package/dist/generate-subgraph-BsHUstpl.mjs.map +0 -1
  74. package/dist/inspect-DXjbQEV_.mjs.map +0 -1
  75. package/dist/switchboard-CJMoMzWx.mjs.map +0 -1
  76. package/dist/switchboard-iRFugh8I.mjs +0 -4
  77. package/dist/vetra-DkF6EJMY.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,29 +1,33 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ab6e0f84-63f5-57ba-a18e-7091ccbf13c6")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c3a1dfab-bfc7-5154-b9b2-43ce4f1fcb86")}catch(e){}}();
4
+ import { n as skipInstallArgs } from "./install-added-dependencies-DVSbzler.mjs";
4
5
  import { initCliTelemetry } from "@powerhousedao/shared/clis/telemetry";
5
6
  import { assertNodeVersion } from "@powerhousedao/shared/clis/utils";
6
- import { boolean, command, flag, multioption, oneOf, option, optional, run, string, subcommands } from "cmd-ts";
7
+ import { boolean, command, flag, multioption, oneOf, option, optional, positional, run, string, subcommands } from "cmd-ts";
7
8
  import { AGENTS, accessTokenArgs, buildArgs, connectBuildArgs, connectConfigArgs, connectPreviewArgs, connectStudioArgs, debugArgs, initArgs, inspectArgs, installArgs, listArgs, loginArgs, migrateArgs, phCliHelpCommands, publishArgs, registryLoginArgs, switchboardArgs, uninstallArgs, unpublishArgs, vetraArgs } from "@powerhousedao/shared/clis/args";
8
9
  import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
9
10
  import { Directory, File } from "cmd-ts/dist/cjs/batteries/fs.js";
10
11
  import path from "path";
12
+ import { execSync } from "node:child_process";
11
13
  import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
12
- import { execSync } from "child_process";
13
- import { execSync as execSync$1 } from "node:child_process";
14
+ import { execSync as execSync$1 } from "child_process";
14
15
  import { createInterface } from "node:readline/promises";
15
16
  import { bold, yellow } from "colorette";
16
17
  //#region src/get-version.ts
17
18
  function getVersion() {
18
- return "6.2.3-dev.9";
19
+ return "6.2.3-staging.0";
19
20
  }
20
21
  //#endregion
21
22
  //#region src/utils/constants.ts
22
23
  const PH_CLI_DESCRIPTION = "The Powerhouse CLI (ph-cli) is a command-line interface tool that provides essential commands for managing Powerhouse projects. The tool and it's commands are fundamental for creating, building, and running Document Models as a builder in studio mode.";
24
+ //#endregion
25
+ //#region src/commands/ph-cli-help.ts
26
+ const version$1 = getVersion();
23
27
  const phCliHelp = subcommands({
24
28
  name: "ph-cli",
25
29
  description: PH_CLI_DESCRIPTION,
26
- version: getVersion(),
30
+ version: version$1,
27
31
  cmds: phCliHelpCommands
28
32
  });
29
33
  //#endregion
@@ -81,7 +85,7 @@ Notes:
81
85
  handler: async (args) => {
82
86
  if (args.debug) console.log(args);
83
87
  const { generateAccessToken, parseExpiry, formatExpiry } = await import("@renown/sdk/node");
84
- const { getRenown } = await import("./auth-BNkN6kS9.mjs");
88
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
85
89
  const renown = await getRenown();
86
90
  let expiresIn = DEFAULT_EXPIRY_SECONDS;
87
91
  if (args.expiry) expiresIn = parseExpiry(args.expiry);
@@ -101,11 +105,25 @@ Notes:
101
105
  //#region src/commands/build.ts
102
106
  const build$1 = command({
103
107
  name: "build",
108
+ description: `
109
+ Build a Powerhouse package for publishing: a browser bundle and a node bundle of its
110
+ document models, editors, subgraphs and processors, type declarations, and its stylesheet.
111
+
112
+ Pieces under pieces/ are built too, each into its own self-contained module under
113
+ dist/node/pieces/<name>, with a descriptor.json and package.json written beside it and
114
+ the piece listed in dist/powerhouse.manifest.json. A piece takes the package's version: an
115
+ entry in pieces/index.ts that declares version fails the build. A package that ships only
116
+ pieces is an ordinary package: it carries the same boilerplate, and every step above runs
117
+ for it too.
118
+
119
+ tsc runs first. If it reports type errors the build asks whether to go ahead, and stops
120
+ where it can't ask. --ignore-type-errors builds without asking; a package built that way
121
+ can load and still fail at runtime, so don't publish it.`,
104
122
  args: buildArgs,
105
123
  handler: async (args) => {
106
124
  if (args.debug) console.log(args);
107
125
  try {
108
- const { runBuild } = await import("./build-C-A5-ipO.mjs");
126
+ const { runBuild } = await import("./build-CTvPQFMi.mjs");
109
127
  await runBuild(args);
110
128
  } catch (error) {
111
129
  console.error(error);
@@ -113,13 +131,11 @@ const build$1 = command({
113
131
  }
114
132
  }
115
133
  });
116
- const connect = subcommands({
117
- name: "connect",
118
- description: `Powerhouse Connect commands. Use with \`studio\`, \`build\`, \`preview\`, or \`config\`. Defaults to \`studio\` if not specified.`,
119
- cmds: {
120
- studio: command({
121
- name: "studio",
122
- description: `The studio command starts the Connect Studio, a development environment for building
134
+ //#endregion
135
+ //#region src/commands/connect.ts
136
+ const studio = command({
137
+ name: "studio",
138
+ description: `The studio command starts the Connect Studio, a development environment for building
123
139
  and testing Powerhouse applications. It provides a visual interface for working with
124
140
  your project.
125
141
 
@@ -129,49 +145,51 @@ This command:
129
145
  3. Allows you to interact with your project components
130
146
  4. Supports various configuration options for customization
131
147
  `,
132
- args: connectStudioArgs,
133
- handler: async (args) => {
134
- if (args.debug) console.log(args);
135
- const { runConnectStudio } = await import("./connect-studio-BIQzyq5B.mjs");
136
- await runConnectStudio(args);
137
- }
138
- }),
139
- build: command({
140
- name: "build",
141
- description: `The Connect build command creates a production build with the project's local and
148
+ args: connectStudioArgs,
149
+ handler: async (args) => {
150
+ if (args.debug) console.log(args);
151
+ const { runConnectStudio } = await import("./connect-studio-f3K1qPWd.mjs");
152
+ await runConnectStudio(args);
153
+ }
154
+ });
155
+ const build = command({
156
+ name: "build",
157
+ description: `The Connect build command creates a production build with the project's local and
142
158
  external packages included.
143
159
 
144
160
  Runtime-config overrides (all combinable — last wins on collision):
145
161
  ph connect build Build with the current source config.
146
162
  ph connect build <key> <value> Build with a positional override applied (e.g. ph connect build connect.renown.url https://renown.staging).
147
163
  ph connect build --<field> <value> Build with a per-field flag override (e.g. --renown-url https://renown.staging).
148
- ph connect build --json '{"…":"…"}' Build with a bulk override.
164
+ ph connect build --json '{"app":{"workflowsEnabled":true}}'
165
+ Build with a bulk override. The payload is the connect.* block
166
+ without the "connect" wrapper; unknown keys are rejected.
149
167
 
150
168
  Build has no read mode; passing only <key> without <value> errors out (use \`ph connect config <key>\` to read).
151
169
  `,
152
- args: connectBuildArgs,
153
- handler: async (args) => {
154
- if (args.debug) console.log(args);
155
- const { runConnectBuild } = await import("./connect-build-WL4axo4z.mjs");
156
- await runConnectBuild(args);
157
- process.exit(0);
158
- }
159
- }),
160
- preview: command({
161
- name: "preview",
162
- description: `The Connect preview command previews a built Connect project.
170
+ args: connectBuildArgs,
171
+ handler: async (args) => {
172
+ if (args.debug) console.log(args);
173
+ const { runConnectBuild } = await import("./connect-build-BMaR9w4G.mjs");
174
+ await runConnectBuild(args);
175
+ process.exit(0);
176
+ }
177
+ });
178
+ const preview = command({
179
+ name: "preview",
180
+ description: `The Connect preview command previews a built Connect project.
163
181
  NOTE: You must run \`ph connect build\` first
164
182
  `,
165
- args: connectPreviewArgs,
166
- handler: async (args) => {
167
- if (args.debug) console.log(args);
168
- const { runConnectPreview } = await import("./connect-preview-D7ypzFDc.mjs");
169
- await runConnectPreview(args);
170
- }
171
- }),
172
- config: command({
173
- name: "config",
174
- description: `Read or update Connect's runtime configuration (powerhouse.config.json).
183
+ args: connectPreviewArgs,
184
+ handler: async (args) => {
185
+ if (args.debug) console.log(args);
186
+ const { runConnectPreview } = await import("./connect-preview-CzDqR-JN.mjs");
187
+ await runConnectPreview(args);
188
+ }
189
+ });
190
+ const config = command({
191
+ name: "config",
192
+ description: `Read or update Connect's runtime configuration (powerhouse.config.json).
175
193
 
176
194
  Modes (mutually exclusive — positional, --get, --json, and field flags cannot be combined):
177
195
  ph connect config List the effective connect.* block (defaults < source).
@@ -179,18 +197,28 @@ Modes (mutually exclusive — positional, --get, --json, and field flags cannot
179
197
  ph connect config --get <dotted.path> Same as positional <key> (kept for backward compat).
180
198
  ph connect config <key> <value> Set a single field and dual-write to source + dist (positional).
181
199
  ph connect config --<field> <value> Set a single field via per-field flag (e.g. --renown-url https://renown.id).
182
- ph connect config --json '{"…":"…"}' Bulk-set multiple fields and dual-write.
200
+ ph connect config --json '{"renown":{"url":"…"}}'
201
+ Bulk-set multiple fields and dual-write. The payload is the connect.*
202
+ block without the "connect" wrapper; unknown keys are rejected.
183
203
 
184
204
  Writes go to:
185
205
  - <project>/powerhouse.config.json (source — picked up by the next build)
186
206
  - <dist-dir>/powerhouse.config.json (if it exists — the currently-served SPA picks it up on refresh)
187
207
  `,
188
- args: connectConfigArgs,
189
- handler: async (args) => {
190
- const { runConnectConfig } = await import("./connect-config-BWGiW3IB.mjs");
191
- await runConnectConfig(args);
192
- }
193
- })
208
+ args: connectConfigArgs,
209
+ handler: async (args) => {
210
+ const { runConnectConfig } = await import("./connect-config-_kiSMsbG.mjs");
211
+ await runConnectConfig(args);
212
+ }
213
+ });
214
+ const connect = subcommands({
215
+ name: "connect",
216
+ description: `Powerhouse Connect commands. Use with \`studio\`, \`build\`, \`preview\`, or \`config\`. Defaults to \`studio\` if not specified.`,
217
+ cmds: {
218
+ studio,
219
+ build,
220
+ preview,
221
+ config
194
222
  }
195
223
  });
196
224
  //#endregion
@@ -204,7 +232,7 @@ const generateAllCmd = command({
204
232
  description: "Instead of generating code, write a spec for every module into specs/ (one-shot migration to documents-as-source-of-truth)"
205
233
  }) },
206
234
  handler: async (args) => {
207
- const { startGenerateAll } = await import("./generate-all-DrT4ZxHX.mjs");
235
+ const { startGenerateAll } = await import("./generate-all-CIwP-3aa.mjs");
208
236
  await startGenerateAll(args, process.cwd());
209
237
  process.exit(0);
210
238
  }
@@ -267,7 +295,7 @@ const generateAppCmd = command({
267
295
  ...debugArgs
268
296
  },
269
297
  handler: async (args) => {
270
- const { startGenerateApp } = await import("./generate-app-DNNqA-H3.mjs");
298
+ const { startGenerateApp } = await import("./generate-app-BTs1u-9l.mjs");
271
299
  await startGenerateApp(args, process.cwd());
272
300
  process.exit(0);
273
301
  }
@@ -303,7 +331,7 @@ const generateDocumentModelCmd = command({
303
331
  ...debugArgs
304
332
  },
305
333
  handler: async (args) => {
306
- const { startGenerateDocumentModel } = await import("./generate-document-model-BJXyODfm.mjs");
334
+ const { startGenerateDocumentModel } = await import("./generate-document-model-DhDQ_06X.mjs");
307
335
  await startGenerateDocumentModel(args, process.cwd());
308
336
  process.exit(0);
309
337
  }
@@ -350,7 +378,7 @@ const generateEditorCmd = command({
350
378
  ...debugArgs
351
379
  },
352
380
  handler: async (args) => {
353
- const { startGenerateEditor } = await import("./generate-editor-BejvaVVT.mjs");
381
+ const { startGenerateEditor } = await import("./generate-editor-CW7Do69u.mjs");
354
382
  await startGenerateEditor(args, process.cwd());
355
383
  process.exit(0);
356
384
  }
@@ -383,6 +411,134 @@ const generateMigrationFileCmd = command({
383
411
  process.exit(0);
384
412
  }
385
413
  });
414
+ //#endregion
415
+ //#region src/commands/generate-piece-action.ts
416
+ const generatePieceActionCmd = command({
417
+ name: "piece-action",
418
+ description: "Generate an action inside an existing piece",
419
+ args: {
420
+ namePositional: positional({
421
+ type: optional(string),
422
+ displayName: "name",
423
+ description: "The name of the action, e.g. get-record"
424
+ }),
425
+ name: option({
426
+ type: optional(string),
427
+ long: "name",
428
+ short: "n",
429
+ description: "The name of the action to generate"
430
+ }),
431
+ piece: option({
432
+ type: optional(string),
433
+ long: "piece",
434
+ short: "p",
435
+ description: "The piece directory under pieces/ to add the action to. Optional when the project ships exactly one piece."
436
+ }),
437
+ ...skipInstallArgs,
438
+ ...debugArgs
439
+ },
440
+ handler: async (args) => {
441
+ const { startGeneratePieceAction } = await import("./generate-piece-action-C5WTHsqu.mjs");
442
+ await startGeneratePieceAction(args, process.cwd());
443
+ process.exit(0);
444
+ }
445
+ });
446
+ //#endregion
447
+ //#region src/commands/generate-piece-trigger.ts
448
+ const generatePieceTriggerCmd = command({
449
+ name: "piece-trigger",
450
+ description: "Generate a trigger inside an existing piece",
451
+ args: {
452
+ namePositional: positional({
453
+ type: optional(string),
454
+ displayName: "name",
455
+ description: "The name of the trigger, e.g. new-record"
456
+ }),
457
+ name: option({
458
+ type: optional(string),
459
+ long: "name",
460
+ short: "n",
461
+ description: "The name of the trigger to generate"
462
+ }),
463
+ piece: option({
464
+ type: optional(string),
465
+ long: "piece",
466
+ short: "p",
467
+ description: "The piece directory under pieces/ to add the trigger to. Optional when the project ships exactly one piece."
468
+ }),
469
+ strategy: option({
470
+ type: oneOf(["polling", "webhook"]),
471
+ long: "strategy",
472
+ description: "How the trigger fires: polled on a schedule, or delivered to a webhook",
473
+ defaultValue: () => "polling",
474
+ defaultValueIsSerializable: true
475
+ }),
476
+ ...skipInstallArgs,
477
+ ...debugArgs
478
+ },
479
+ handler: async (args) => {
480
+ const { startGeneratePieceTrigger } = await import("./generate-piece-trigger-DR10CPOG.mjs");
481
+ await startGeneratePieceTrigger(args, process.cwd());
482
+ process.exit(0);
483
+ }
484
+ });
485
+ //#endregion
486
+ //#region src/commands/generate-piece.ts
487
+ const generatePieceCmd = command({
488
+ name: "piece",
489
+ description: "Generate a piece: a connector whose actions and triggers a workflow can call",
490
+ args: {
491
+ namePositional: positional({
492
+ type: optional(string),
493
+ displayName: "name",
494
+ description: "The name of the piece to generate. Its directory is the kebab-case of this."
495
+ }),
496
+ name: option({
497
+ type: optional(string),
498
+ long: "name",
499
+ short: "n",
500
+ description: "The name of the piece to generate"
501
+ }),
502
+ id: option({
503
+ type: optional(string),
504
+ long: "id",
505
+ description: "The piece id, the pieceName a workflow step holds, e.g. @acme/piece-crm. Defaults to one derived from the package name."
506
+ }),
507
+ auth: option({
508
+ type: oneOf([
509
+ "none",
510
+ "secret",
511
+ "custom"
512
+ ]),
513
+ long: "auth",
514
+ description: "The kind of connection the piece asks for",
515
+ defaultValue: () => "custom",
516
+ defaultValueIsSerializable: true
517
+ }),
518
+ description: option({
519
+ type: optional(string),
520
+ long: "description",
521
+ description: "One line describing what the piece connects to"
522
+ }),
523
+ dir: option({
524
+ type: optional(Directory),
525
+ long: "dir",
526
+ description: "Name of the directory of an existing piece to re-register"
527
+ }),
528
+ all: flag({
529
+ long: "all",
530
+ short: "a",
531
+ description: "Re-register every piece in pieces/: refresh the pieces list and the manifest, and prune what is gone"
532
+ }),
533
+ ...skipInstallArgs,
534
+ ...debugArgs
535
+ },
536
+ handler: async (args) => {
537
+ const { startGeneratePiece } = await import("./generate-piece-QTt-ddt2.mjs");
538
+ await startGeneratePiece(args, process.cwd());
539
+ process.exit(0);
540
+ }
541
+ });
386
542
  const generateProcessorCmd = command({
387
543
  name: "processor",
388
544
  description: "Generate a processor",
@@ -443,10 +599,11 @@ const generateProcessorCmd = command({
443
599
  short: "x",
444
600
  description: "Write a powerhouse/processor spec for each existing processor into specs/processors/"
445
601
  }),
602
+ ...skipInstallArgs,
446
603
  ...debugArgs
447
604
  },
448
605
  handler: async (args) => {
449
- const { startGenerateProcessor } = await import("./generate-processor-_WOx-mMe.mjs");
606
+ const { startGenerateProcessor } = await import("./generate-processor-DBtTkgo5.mjs");
450
607
  await startGenerateProcessor(args, process.cwd());
451
608
  process.exit(0);
452
609
  }
@@ -484,10 +641,11 @@ const generateSubgraphCmd = command({
484
641
  short: "x",
485
642
  description: "Write a powerhouse/subgraph spec for each existing subgraph into specs/subgraphs/"
486
643
  }),
644
+ ...skipInstallArgs,
487
645
  ...debugArgs
488
646
  },
489
647
  handler: async (args) => {
490
- const { startGenerateSubgraph } = await import("./generate-subgraph-BsHUstpl.mjs");
648
+ const { startGenerateSubgraph } = await import("./generate-subgraph-Dm27O59o.mjs");
491
649
  await startGenerateSubgraph(args, process.cwd());
492
650
  process.exit(0);
493
651
  }
@@ -504,6 +662,9 @@ const generate = subcommands({
504
662
  app: generateAppCmd,
505
663
  processor: generateProcessorCmd,
506
664
  subgraph: generateSubgraphCmd,
665
+ piece: generatePieceCmd,
666
+ "piece-action": generatePieceActionCmd,
667
+ "piece-trigger": generatePieceTriggerCmd,
507
668
  "migration-file": generateMigrationFileCmd
508
669
  }
509
670
  });
@@ -515,7 +676,7 @@ const init = command({
515
676
  args: initArgs,
516
677
  handler: async (args) => {
517
678
  if (args.debug) console.log({ args });
518
- const { startInit } = await import("./init-BZP6gvYd.mjs");
679
+ const { startInit } = await import("./init-CIEMyAug.mjs");
519
680
  await startInit(args);
520
681
  process.exit(0);
521
682
  }
@@ -538,7 +699,7 @@ This command:
538
699
  args: inspectArgs,
539
700
  handler: async (args) => {
540
701
  if (args.debug) console.log(args);
541
- const { startInspect } = await import("./inspect-DXjbQEV_.mjs");
702
+ const { startInspect } = await import("./inspect-BpCB0TPo.mjs");
542
703
  startInspect(args);
543
704
  process.exit(0);
544
705
  }
@@ -607,7 +768,7 @@ Resolution order for the registry URL:
607
768
  if (scopeRegistryArgs.length > 0) console.log(`Installing dependencies 📦 (routing ${Array.from(scopes).join(", ")} → ${registryUrl})...`);
608
769
  else console.log("Installing dependencies 📦...");
609
770
  console.log(`> ${installCommand}`);
610
- execSync(installCommand, {
771
+ execSync$1(installCommand, {
611
772
  stdio: "inherit",
612
773
  cwd: projectPath
613
774
  });
@@ -617,7 +778,7 @@ Resolution order for the registry URL:
617
778
  throw error;
618
779
  }
619
780
  }
620
- const { updateConfigFile, updateStylesFile } = await import("./utils-BzwczAW-.mjs");
781
+ const { updateConfigFile, updateStylesFile } = await import("./utils-C3c5YG6v.mjs");
621
782
  try {
622
783
  console.log("⚙️ Updating powerhouse config file...");
623
784
  updateConfigFile(dependenciesWithVersions, projectPath, "install", args.local ? "local" : "registry", registryUrl, args.registry !== void 0);
@@ -691,7 +852,7 @@ This command:
691
852
  args: loginArgs,
692
853
  handler: async (args) => {
693
854
  if (args.debug) console.log(args);
694
- const { getRenown } = await import("./auth-BNkN6kS9.mjs");
855
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
695
856
  const renown = await getRenown(args.renownUrl);
696
857
  if (args.showDid) {
697
858
  console.log(renown.did);
@@ -760,7 +921,7 @@ This command:
760
921
  }
761
922
  });
762
923
  async function handleLogout() {
763
- const { getRenown } = await import("./auth-BNkN6kS9.mjs");
924
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
764
925
  const renown = await getRenown();
765
926
  if (!renown.user) {
766
927
  console.log("Not currently authenticated.");
@@ -794,7 +955,7 @@ const migrate = command({
794
955
  description: "Run migrations",
795
956
  handler: async (args) => {
796
957
  if (args.debug) console.log(args);
797
- const { startMigrate } = await import("./migrate-jGKfE02L.mjs");
958
+ const { startMigrate } = await import("./migrate-B6QBYDNX.mjs");
798
959
  await startMigrate(args);
799
960
  process.exit(0);
800
961
  }
@@ -842,7 +1003,7 @@ This command:
842
1003
  const { projectPath } = await getPowerhouseProjectInfo();
843
1004
  if (!projectPath) throw new Error("Could not find project path.");
844
1005
  const { checkNpmAuth, npmPublish, resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
845
- const { mintRegistryAuthToken } = await import("./registry-auth-DxEWCJu2.mjs");
1006
+ const { mintRegistryAuthToken } = await import("./registry-auth-Bm5AR-fB.mjs");
846
1007
  const registryUrl = resolveRegistryUrl({
847
1008
  registry: args.registry,
848
1009
  projectPath
@@ -932,7 +1093,7 @@ Usage:
932
1093
  const projectPath = (await getPowerhouseProjectInfo().catch(() => null))?.projectPath ?? process.cwd();
933
1094
  const [{ resolveRegistryUrl, writeRegistryAuthToken }, { mintRegistryAuthToken }, { parseExpiry, formatExpiry }] = await Promise.all([
934
1095
  import("@powerhousedao/shared/registry"),
935
- import("./registry-auth-DxEWCJu2.mjs"),
1096
+ import("./registry-auth-Bm5AR-fB.mjs"),
936
1097
  import("@renown/sdk/node")
937
1098
  ]);
938
1099
  const registryUrl = resolveRegistryUrl({
@@ -969,7 +1130,7 @@ This command:
969
1130
  const { basePath, dbPath, migrate, migrateStatus, reset, yes } = args;
970
1131
  if (basePath) process.env.BASE_PATH = basePath;
971
1132
  if (reset) {
972
- const { resetSwitchboardDatabase } = await import("./switchboard-reset-BcQXlcVf.mjs");
1133
+ const { resetSwitchboardDatabase } = await import("./switchboard-reset-Ctegiqdm.mjs");
973
1134
  await resetSwitchboardDatabase({
974
1135
  dbPath,
975
1136
  yes
@@ -977,14 +1138,14 @@ This command:
977
1138
  process.exit(0);
978
1139
  }
979
1140
  if (migrate || migrateStatus) {
980
- const { runSwitchboardMigrations } = await import("./switchboard-migrate-NQ7LHWSi.mjs");
1141
+ const { runSwitchboardMigrations } = await import("./switchboard-migrate-7JQZM7-5.mjs");
981
1142
  await runSwitchboardMigrations({
982
1143
  dbPath,
983
1144
  statusOnly: migrateStatus
984
1145
  });
985
1146
  process.exit(0);
986
1147
  }
987
- const { startSwitchboard } = await import("./switchboard-iRFugh8I.mjs");
1148
+ const { startSwitchboard } = await import("./switchboard-nHCI3pha.mjs");
988
1149
  const { defaultDriveUrl, renown } = await startSwitchboard(args);
989
1150
  console.log(" ➜ Switchboard:", defaultDriveUrl);
990
1151
  if (renown) console.log(" ➜ Identity:", renown.did);
@@ -1021,7 +1182,8 @@ This command:
1021
1182
  });
1022
1183
  try {
1023
1184
  console.log("Uninstalling dependencies 📦 ...");
1024
- execSync$1(await getPowerhouseProjectUninstallCommand(packageManager, args.dependencies), {
1185
+ const uninstallCommand = await getPowerhouseProjectUninstallCommand(packageManager, args.dependencies);
1186
+ execSync(uninstallCommand, {
1025
1187
  stdio: "inherit",
1026
1188
  cwd: projectPath
1027
1189
  });
@@ -1030,7 +1192,7 @@ This command:
1030
1192
  console.error("❌ Failed to uninstall dependencies");
1031
1193
  throw error;
1032
1194
  }
1033
- const { removeStylesImports, updateConfigFile } = await import("./utils-BzwczAW-.mjs");
1195
+ const { removeStylesImports, updateConfigFile } = await import("./utils-C3c5YG6v.mjs");
1034
1196
  try {
1035
1197
  console.log("⚙️ Updating powerhouse config file...");
1036
1198
  updateConfigFile(dependenciesWithVersions, projectPath, "uninstall");
@@ -1157,11 +1319,20 @@ This command:
1157
1319
  1. Starts a Vetra Switchboard with a "Vetra" drive for document storage
1158
1320
  2. Optionally connects to remote drives instead of creating a local drive
1159
1321
  3. Starts Connect Studio pointing to the Switchboard for user interaction (unless disabled)
1160
- 4. Enables real-time updates, collaboration, and code generation`,
1322
+ 4. Enables real-time updates, collaboration, and code generation
1323
+
1324
+ Default drives:
1325
+ Connect's default drives resolve to the Vetra drive (and the preview drive
1326
+ when using --watch), plus any drives configured under
1327
+ connect.drives.defaultDrives in powerhouse.config.json - de-duplicated by
1328
+ URL, so configuring project drives does not cost you the Vetra drive.
1329
+ An explicit --default-drives-url is appended to that list (de-duplicated);
1330
+ it never replaces the Vetra drive.
1331
+ `,
1161
1332
  args: vetraArgs,
1162
1333
  handler: async (args) => {
1163
1334
  if (args.debug) console.log(args);
1164
- const { startVetra } = await import("./vetra-DkF6EJMY.mjs");
1335
+ const { startVetra } = await import("./vetra-s8gWslse.mjs");
1165
1336
  await startVetra(args);
1166
1337
  }
1167
1338
  }),
@@ -1180,10 +1351,13 @@ This command:
1180
1351
  install,
1181
1352
  uninstall
1182
1353
  };
1354
+ //#endregion
1355
+ //#region src/commands/ph-cli.ts
1356
+ const version = getVersion();
1183
1357
  const phCli = subcommands({
1184
1358
  name: "ph-cli",
1185
1359
  description: PH_CLI_DESCRIPTION,
1186
- version: getVersion(),
1360
+ version,
1187
1361
  cmds: phCliCommands
1188
1362
  });
1189
1363
  //#endregion
@@ -1231,7 +1405,7 @@ function printDbRecoveryHint(err) {
1231
1405
  //#endregion
1232
1406
  //#region src/cli.ts
1233
1407
  let sentryClient = void 0;
1234
- const COMMANDS_WITH_SUBCOMMANDS = new Set(["connect", "vetra"]);
1408
+ const COMMANDS_WITH_SUBCOMMANDS = /* @__PURE__ */ new Set(["connect", "vetra"]);
1235
1409
  function detectPackageManager() {
1236
1410
  const ua = process.env.npm_config_user_agent;
1237
1411
  if (!ua) return void 0;
@@ -1263,12 +1437,14 @@ async function main() {
1263
1437
  "build",
1264
1438
  "preview",
1265
1439
  "config"
1266
- ].includes(args[1]) && !isHelp) await run(cli, [
1267
- "connect",
1268
- "studio",
1269
- ...restArgs
1270
- ]);
1271
- else await run(cli, args);
1440
+ ].includes(args[1]) && !isHelp) {
1441
+ const argsWithDefaultConnectSubCommand = [
1442
+ "connect",
1443
+ "studio",
1444
+ ...restArgs
1445
+ ];
1446
+ await run(cli, argsWithDefaultConnectSubCommand);
1447
+ } else await run(cli, args);
1272
1448
  }
1273
1449
  await main().catch(async (error) => {
1274
1450
  const isDebug = process.argv.slice(2).includes("--debug");
@@ -1284,4 +1460,4 @@ await main().catch(async (error) => {
1284
1460
  export {};
1285
1461
 
1286
1462
  //# sourceMappingURL=cli.mjs.map
1287
- //# debugId=ab6e0f84-63f5-57ba-a18e-7091ccbf13c6
1463
+ //# debugId=c3a1dfab-bfc7-5154-b9b2-43ce4f1fcb86