@powerhousedao/ph-cli 6.2.3-dev.3 → 6.2.3-dev.30

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 (72) 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-BolXfpNU.mjs +4 -0
  5. package/dist/build-D0PTejWA.mjs +166 -0
  6. package/dist/build-D0PTejWA.mjs.map +1 -0
  7. package/dist/{cli-connect-override-D3hh4aH_.mjs → cli-connect-override-Bo7L7mwc.mjs} +46 -9
  8. package/dist/cli-connect-override-Bo7L7mwc.mjs.map +1 -0
  9. package/dist/cli.d.mts +2 -1
  10. package/dist/cli.mjs +249 -80
  11. package/dist/cli.mjs.map +1 -1
  12. package/dist/connect-build-BVDpTJnS.mjs +153 -0
  13. package/dist/connect-build-BVDpTJnS.mjs.map +1 -0
  14. package/dist/{connect-config-BWGiW3IB.mjs → connect-config-C70IXUh6.mjs} +13 -9
  15. package/dist/connect-config-C70IXUh6.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-BDkYXCvz.mjs} +15 -10
  19. package/dist/{connect-studio-D6rfWCNB.mjs.map → connect-studio-BDkYXCvz.mjs.map} +1 -1
  20. package/dist/connect-studio-r_ikfhOR.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-BHBXK1_P.mjs +64 -0
  30. package/dist/generate-piece-BHBXK1_P.mjs.map +1 -0
  31. package/dist/generate-piece-action-Byk-BmYt.mjs +26 -0
  32. package/dist/generate-piece-action-Byk-BmYt.mjs.map +1 -0
  33. package/dist/generate-piece-trigger-CmPqKZej.mjs +27 -0
  34. package/dist/generate-piece-trigger-CmPqKZej.mjs.map +1 -0
  35. package/dist/{generate-processor-_WOx-mMe.mjs → generate-processor-FprZJIKD.mjs} +12 -7
  36. package/dist/{generate-processor-_WOx-mMe.mjs.map → generate-processor-FprZJIKD.mjs.map} +1 -1
  37. package/dist/{generate-subgraph-BsHUstpl.mjs → generate-subgraph-DNwL9vDs.mjs} +7 -5
  38. package/dist/{generate-subgraph-BsHUstpl.mjs.map → generate-subgraph-DNwL9vDs.mjs.map} +1 -1
  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/{migrate-jGKfE02L.mjs → migrate-ORExpVlJ.mjs} +3 -3
  44. package/dist/{migrate-jGKfE02L.mjs.map → migrate-ORExpVlJ.mjs.map} +1 -1
  45. package/dist/{registry-auth-DxEWCJu2.mjs → registry-auth-Bm5AR-fB.mjs} +4 -4
  46. package/dist/{registry-auth-DxEWCJu2.mjs.map → registry-auth-Bm5AR-fB.mjs.map} +1 -1
  47. package/dist/scripts/generate-commands-docs.ts +8 -0
  48. package/dist/{switchboard-CJMoMzWx.mjs → switchboard-B8CCCZCB.mjs} +8 -4
  49. package/dist/{switchboard-CJMoMzWx.mjs.map → switchboard-B8CCCZCB.mjs.map} +1 -1
  50. package/dist/switchboard-C5AOMSKA.mjs +4 -0
  51. package/dist/{switchboard-migrate-NQ7LHWSi.mjs → switchboard-migrate-7JQZM7-5.mjs} +5 -4
  52. package/dist/{switchboard-migrate-NQ7LHWSi.mjs.map → switchboard-migrate-7JQZM7-5.mjs.map} +1 -1
  53. package/dist/{switchboard-reset-BcQXlcVf.mjs → switchboard-reset-Ctegiqdm.mjs} +3 -3
  54. package/dist/{switchboard-reset-BcQXlcVf.mjs.map → switchboard-reset-Ctegiqdm.mjs.map} +1 -1
  55. package/dist/{utils-BzwczAW-.mjs → utils-C3c5YG6v.mjs} +3 -3
  56. package/dist/{utils-C4isxXSO.mjs → utils-CvmDmCVd.mjs} +3 -3
  57. package/dist/{utils-C4isxXSO.mjs.map → utils-CvmDmCVd.mjs.map} +1 -1
  58. package/dist/{vetra-DkF6EJMY.mjs → vetra-DhhT9bQB.mjs} +27 -14
  59. package/dist/vetra-DhhT9bQB.mjs.map +1 -0
  60. package/package.json +17 -16
  61. package/dist/auth-BNkN6kS9.mjs +0 -4
  62. package/dist/build-C-A5-ipO.mjs +0 -4
  63. package/dist/build-uQXq6_HU.mjs +0 -71
  64. package/dist/build-uQXq6_HU.mjs.map +0 -1
  65. package/dist/cli-connect-override-D3hh4aH_.mjs.map +0 -1
  66. package/dist/connect-build-WL4axo4z.mjs +0 -43
  67. package/dist/connect-build-WL4axo4z.mjs.map +0 -1
  68. package/dist/connect-config-BWGiW3IB.mjs.map +0 -1
  69. package/dist/connect-studio-BIQzyq5B.mjs +0 -5
  70. package/dist/inspect-DXjbQEV_.mjs.map +0 -1
  71. package/dist/switchboard-iRFugh8I.mjs +0 -4
  72. package/dist/vetra-DkF6EJMY.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
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]="3ab9cfff-6f9c-57a2-a989-3a29e9435207")}catch(e){}}();
4
4
  import { initCliTelemetry } from "@powerhousedao/shared/clis/telemetry";
5
5
  import { assertNodeVersion } from "@powerhousedao/shared/clis/utils";
6
- import { boolean, command, flag, multioption, oneOf, option, optional, run, string, subcommands } from "cmd-ts";
6
+ import { boolean, command, flag, multioption, oneOf, option, optional, positional, run, string, subcommands } from "cmd-ts";
7
7
  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
8
  import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
9
9
  import { Directory, File } from "cmd-ts/dist/cjs/batteries/fs.js";
@@ -15,15 +15,18 @@ import { createInterface } from "node:readline/promises";
15
15
  import { bold, yellow } from "colorette";
16
16
  //#region src/get-version.ts
17
17
  function getVersion() {
18
- return "6.2.3-dev.3";
18
+ return "6.2.3-dev.30";
19
19
  }
20
20
  //#endregion
21
21
  //#region src/utils/constants.ts
22
22
  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.";
23
+ //#endregion
24
+ //#region src/commands/ph-cli-help.ts
25
+ const version$1 = getVersion();
23
26
  const phCliHelp = subcommands({
24
27
  name: "ph-cli",
25
28
  description: PH_CLI_DESCRIPTION,
26
- version: getVersion(),
29
+ version: version$1,
27
30
  cmds: phCliHelpCommands
28
31
  });
29
32
  //#endregion
@@ -81,7 +84,7 @@ Notes:
81
84
  handler: async (args) => {
82
85
  if (args.debug) console.log(args);
83
86
  const { generateAccessToken, parseExpiry, formatExpiry } = await import("@renown/sdk/node");
84
- const { getRenown } = await import("./auth-BNkN6kS9.mjs");
87
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
85
88
  const renown = await getRenown();
86
89
  let expiresIn = DEFAULT_EXPIRY_SECONDS;
87
90
  if (args.expiry) expiresIn = parseExpiry(args.expiry);
@@ -101,11 +104,23 @@ Notes:
101
104
  //#region src/commands/build.ts
102
105
  const build$1 = command({
103
106
  name: "build",
107
+ description: `
108
+ Build a Powerhouse package for publishing: a browser bundle and a node bundle of its
109
+ document models, editors, subgraphs and processors, type declarations, and its stylesheet.
110
+
111
+ Pieces under pieces/ are built too, each into its own self-contained module under
112
+ dist/node/pieces/<name>, with a descriptor.json and package.json written beside it and
113
+ the piece listed in dist/powerhouse.manifest.json. A package that ships only pieces is an
114
+ ordinary package: it carries the same boilerplate, and every step above runs for it too.
115
+
116
+ tsc runs first. If it reports type errors the build asks whether to go ahead, and stops
117
+ where it can't ask. --ignore-type-errors builds without asking; a package built that way
118
+ can load and still fail at runtime, so don't publish it.`,
104
119
  args: buildArgs,
105
120
  handler: async (args) => {
106
121
  if (args.debug) console.log(args);
107
122
  try {
108
- const { runBuild } = await import("./build-C-A5-ipO.mjs");
123
+ const { runBuild } = await import("./build-BolXfpNU.mjs");
109
124
  await runBuild(args);
110
125
  } catch (error) {
111
126
  console.error(error);
@@ -113,13 +128,11 @@ const build$1 = command({
113
128
  }
114
129
  }
115
130
  });
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
131
+ //#endregion
132
+ //#region src/commands/connect.ts
133
+ const studio = command({
134
+ name: "studio",
135
+ description: `The studio command starts the Connect Studio, a development environment for building
123
136
  and testing Powerhouse applications. It provides a visual interface for working with
124
137
  your project.
125
138
 
@@ -129,16 +142,16 @@ This command:
129
142
  3. Allows you to interact with your project components
130
143
  4. Supports various configuration options for customization
131
144
  `,
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
145
+ args: connectStudioArgs,
146
+ handler: async (args) => {
147
+ if (args.debug) console.log(args);
148
+ const { runConnectStudio } = await import("./connect-studio-r_ikfhOR.mjs");
149
+ await runConnectStudio(args);
150
+ }
151
+ });
152
+ const build = command({
153
+ name: "build",
154
+ description: `The Connect build command creates a production build with the project's local and
142
155
  external packages included.
143
156
 
144
157
  Runtime-config overrides (all combinable — last wins on collision):
@@ -149,29 +162,29 @@ Runtime-config overrides (all combinable — last wins on collision):
149
162
 
150
163
  Build has no read mode; passing only <key> without <value> errors out (use \`ph connect config <key>\` to read).
151
164
  `,
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.
165
+ args: connectBuildArgs,
166
+ handler: async (args) => {
167
+ if (args.debug) console.log(args);
168
+ const { runConnectBuild } = await import("./connect-build-BVDpTJnS.mjs");
169
+ await runConnectBuild(args);
170
+ process.exit(0);
171
+ }
172
+ });
173
+ const preview = command({
174
+ name: "preview",
175
+ description: `The Connect preview command previews a built Connect project.
163
176
  NOTE: You must run \`ph connect build\` first
164
177
  `,
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).
178
+ args: connectPreviewArgs,
179
+ handler: async (args) => {
180
+ if (args.debug) console.log(args);
181
+ const { runConnectPreview } = await import("./connect-preview-CzDqR-JN.mjs");
182
+ await runConnectPreview(args);
183
+ }
184
+ });
185
+ const config = command({
186
+ name: "config",
187
+ description: `Read or update Connect's runtime configuration (powerhouse.config.json).
175
188
 
176
189
  Modes (mutually exclusive — positional, --get, --json, and field flags cannot be combined):
177
190
  ph connect config List the effective connect.* block (defaults < source).
@@ -185,12 +198,20 @@ Writes go to:
185
198
  - <project>/powerhouse.config.json (source — picked up by the next build)
186
199
  - <dist-dir>/powerhouse.config.json (if it exists — the currently-served SPA picks it up on refresh)
187
200
  `,
188
- args: connectConfigArgs,
189
- handler: async (args) => {
190
- const { runConnectConfig } = await import("./connect-config-BWGiW3IB.mjs");
191
- await runConnectConfig(args);
192
- }
193
- })
201
+ args: connectConfigArgs,
202
+ handler: async (args) => {
203
+ const { runConnectConfig } = await import("./connect-config-C70IXUh6.mjs");
204
+ await runConnectConfig(args);
205
+ }
206
+ });
207
+ const connect = subcommands({
208
+ name: "connect",
209
+ description: `Powerhouse Connect commands. Use with \`studio\`, \`build\`, \`preview\`, or \`config\`. Defaults to \`studio\` if not specified.`,
210
+ cmds: {
211
+ studio,
212
+ build,
213
+ preview,
214
+ config
194
215
  }
195
216
  });
196
217
  //#endregion
@@ -204,7 +225,7 @@ const generateAllCmd = command({
204
225
  description: "Instead of generating code, write a spec for every module into specs/ (one-shot migration to documents-as-source-of-truth)"
205
226
  }) },
206
227
  handler: async (args) => {
207
- const { startGenerateAll } = await import("./generate-all-DrT4ZxHX.mjs");
228
+ const { startGenerateAll } = await import("./generate-all-CIwP-3aa.mjs");
208
229
  await startGenerateAll(args, process.cwd());
209
230
  process.exit(0);
210
231
  }
@@ -267,7 +288,7 @@ const generateAppCmd = command({
267
288
  ...debugArgs
268
289
  },
269
290
  handler: async (args) => {
270
- const { startGenerateApp } = await import("./generate-app-DNNqA-H3.mjs");
291
+ const { startGenerateApp } = await import("./generate-app-BTs1u-9l.mjs");
271
292
  await startGenerateApp(args, process.cwd());
272
293
  process.exit(0);
273
294
  }
@@ -303,7 +324,7 @@ const generateDocumentModelCmd = command({
303
324
  ...debugArgs
304
325
  },
305
326
  handler: async (args) => {
306
- const { startGenerateDocumentModel } = await import("./generate-document-model-BJXyODfm.mjs");
327
+ const { startGenerateDocumentModel } = await import("./generate-document-model-DhDQ_06X.mjs");
307
328
  await startGenerateDocumentModel(args, process.cwd());
308
329
  process.exit(0);
309
330
  }
@@ -350,7 +371,7 @@ const generateEditorCmd = command({
350
371
  ...debugArgs
351
372
  },
352
373
  handler: async (args) => {
353
- const { startGenerateEditor } = await import("./generate-editor-BejvaVVT.mjs");
374
+ const { startGenerateEditor } = await import("./generate-editor-CW7Do69u.mjs");
354
375
  await startGenerateEditor(args, process.cwd());
355
376
  process.exit(0);
356
377
  }
@@ -383,6 +404,136 @@ const generateMigrationFileCmd = command({
383
404
  process.exit(0);
384
405
  }
385
406
  });
407
+ //#endregion
408
+ //#region src/commands/generate-piece-action.ts
409
+ const generatePieceActionCmd = command({
410
+ name: "piece-action",
411
+ description: "Generate an action inside an existing piece",
412
+ args: {
413
+ namePositional: positional({
414
+ type: optional(string),
415
+ displayName: "name",
416
+ description: "The name of the action, e.g. get-record"
417
+ }),
418
+ name: option({
419
+ type: optional(string),
420
+ long: "name",
421
+ short: "n",
422
+ description: "The name of the action to generate"
423
+ }),
424
+ piece: option({
425
+ type: optional(string),
426
+ long: "piece",
427
+ short: "p",
428
+ description: "The piece directory under pieces/ to add the action to. Optional when the project ships exactly one piece."
429
+ }),
430
+ ...debugArgs
431
+ },
432
+ handler: async (args) => {
433
+ const { startGeneratePieceAction } = await import("./generate-piece-action-Byk-BmYt.mjs");
434
+ await startGeneratePieceAction(args, process.cwd());
435
+ process.exit(0);
436
+ }
437
+ });
438
+ //#endregion
439
+ //#region src/commands/generate-piece-trigger.ts
440
+ const generatePieceTriggerCmd = command({
441
+ name: "piece-trigger",
442
+ description: "Generate a trigger inside an existing piece",
443
+ args: {
444
+ namePositional: positional({
445
+ type: optional(string),
446
+ displayName: "name",
447
+ description: "The name of the trigger, e.g. new-record"
448
+ }),
449
+ name: option({
450
+ type: optional(string),
451
+ long: "name",
452
+ short: "n",
453
+ description: "The name of the trigger to generate"
454
+ }),
455
+ piece: option({
456
+ type: optional(string),
457
+ long: "piece",
458
+ short: "p",
459
+ description: "The piece directory under pieces/ to add the trigger to. Optional when the project ships exactly one piece."
460
+ }),
461
+ strategy: option({
462
+ type: oneOf(["polling", "webhook"]),
463
+ long: "strategy",
464
+ description: "How the trigger fires: polled on a schedule, or delivered to a webhook",
465
+ defaultValue: () => "polling",
466
+ defaultValueIsSerializable: true
467
+ }),
468
+ ...debugArgs
469
+ },
470
+ handler: async (args) => {
471
+ const { startGeneratePieceTrigger } = await import("./generate-piece-trigger-CmPqKZej.mjs");
472
+ await startGeneratePieceTrigger(args, process.cwd());
473
+ process.exit(0);
474
+ }
475
+ });
476
+ //#endregion
477
+ //#region src/commands/generate-piece.ts
478
+ const generatePieceCmd = command({
479
+ name: "piece",
480
+ description: "Generate a piece: a connector whose actions and triggers a workflow can call",
481
+ args: {
482
+ namePositional: positional({
483
+ type: optional(string),
484
+ displayName: "name",
485
+ description: "The name of the piece to generate. Its directory is the kebab-case of this."
486
+ }),
487
+ name: option({
488
+ type: optional(string),
489
+ long: "name",
490
+ short: "n",
491
+ description: "The name of the piece to generate"
492
+ }),
493
+ id: option({
494
+ type: optional(string),
495
+ long: "id",
496
+ description: "The piece id a workflow block type names, e.g. @acme/piece-crm. Defaults to one derived from the package name."
497
+ }),
498
+ pieceVersion: option({
499
+ type: optional(string),
500
+ long: "piece-version",
501
+ description: "The version the pieces list declares. Defaults to the package version when the piece is named after the package, else 1.0.0."
502
+ }),
503
+ auth: option({
504
+ type: oneOf([
505
+ "none",
506
+ "secret",
507
+ "custom"
508
+ ]),
509
+ long: "auth",
510
+ description: "The kind of connection the piece asks for",
511
+ defaultValue: () => "custom",
512
+ defaultValueIsSerializable: true
513
+ }),
514
+ description: option({
515
+ type: optional(string),
516
+ long: "description",
517
+ description: "One line describing what the piece connects to"
518
+ }),
519
+ dir: option({
520
+ type: optional(Directory),
521
+ long: "dir",
522
+ description: "Name of the directory of an existing piece to re-register"
523
+ }),
524
+ all: flag({
525
+ long: "all",
526
+ short: "a",
527
+ description: "Re-register every piece in pieces/: refresh the pieces list and the manifest, and prune what is gone"
528
+ }),
529
+ ...debugArgs
530
+ },
531
+ handler: async (args) => {
532
+ const { startGeneratePiece } = await import("./generate-piece-BHBXK1_P.mjs");
533
+ await startGeneratePiece(args, process.cwd());
534
+ process.exit(0);
535
+ }
536
+ });
386
537
  const generateProcessorCmd = command({
387
538
  name: "processor",
388
539
  description: "Generate a processor",
@@ -446,7 +597,7 @@ const generateProcessorCmd = command({
446
597
  ...debugArgs
447
598
  },
448
599
  handler: async (args) => {
449
- const { startGenerateProcessor } = await import("./generate-processor-_WOx-mMe.mjs");
600
+ const { startGenerateProcessor } = await import("./generate-processor-FprZJIKD.mjs");
450
601
  await startGenerateProcessor(args, process.cwd());
451
602
  process.exit(0);
452
603
  }
@@ -487,7 +638,7 @@ const generateSubgraphCmd = command({
487
638
  ...debugArgs
488
639
  },
489
640
  handler: async (args) => {
490
- const { startGenerateSubgraph } = await import("./generate-subgraph-BsHUstpl.mjs");
641
+ const { startGenerateSubgraph } = await import("./generate-subgraph-DNwL9vDs.mjs");
491
642
  await startGenerateSubgraph(args, process.cwd());
492
643
  process.exit(0);
493
644
  }
@@ -504,6 +655,9 @@ const generate = subcommands({
504
655
  app: generateAppCmd,
505
656
  processor: generateProcessorCmd,
506
657
  subgraph: generateSubgraphCmd,
658
+ piece: generatePieceCmd,
659
+ "piece-action": generatePieceActionCmd,
660
+ "piece-trigger": generatePieceTriggerCmd,
507
661
  "migration-file": generateMigrationFileCmd
508
662
  }
509
663
  });
@@ -515,7 +669,7 @@ const init = command({
515
669
  args: initArgs,
516
670
  handler: async (args) => {
517
671
  if (args.debug) console.log({ args });
518
- const { startInit } = await import("./init-BZP6gvYd.mjs");
672
+ const { startInit } = await import("./init-CIEMyAug.mjs");
519
673
  await startInit(args);
520
674
  process.exit(0);
521
675
  }
@@ -538,7 +692,7 @@ This command:
538
692
  args: inspectArgs,
539
693
  handler: async (args) => {
540
694
  if (args.debug) console.log(args);
541
- const { startInspect } = await import("./inspect-DXjbQEV_.mjs");
695
+ const { startInspect } = await import("./inspect-BpCB0TPo.mjs");
542
696
  startInspect(args);
543
697
  process.exit(0);
544
698
  }
@@ -617,7 +771,7 @@ Resolution order for the registry URL:
617
771
  throw error;
618
772
  }
619
773
  }
620
- const { updateConfigFile, updateStylesFile } = await import("./utils-BzwczAW-.mjs");
774
+ const { updateConfigFile, updateStylesFile } = await import("./utils-C3c5YG6v.mjs");
621
775
  try {
622
776
  console.log("⚙️ Updating powerhouse config file...");
623
777
  updateConfigFile(dependenciesWithVersions, projectPath, "install", args.local ? "local" : "registry", registryUrl, args.registry !== void 0);
@@ -691,7 +845,7 @@ This command:
691
845
  args: loginArgs,
692
846
  handler: async (args) => {
693
847
  if (args.debug) console.log(args);
694
- const { getRenown } = await import("./auth-BNkN6kS9.mjs");
848
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
695
849
  const renown = await getRenown(args.renownUrl);
696
850
  if (args.showDid) {
697
851
  console.log(renown.did);
@@ -760,7 +914,7 @@ This command:
760
914
  }
761
915
  });
762
916
  async function handleLogout() {
763
- const { getRenown } = await import("./auth-BNkN6kS9.mjs");
917
+ const { getRenown } = await import("./auth-CNhbN5UM.mjs");
764
918
  const renown = await getRenown();
765
919
  if (!renown.user) {
766
920
  console.log("Not currently authenticated.");
@@ -794,7 +948,7 @@ const migrate = command({
794
948
  description: "Run migrations",
795
949
  handler: async (args) => {
796
950
  if (args.debug) console.log(args);
797
- const { startMigrate } = await import("./migrate-jGKfE02L.mjs");
951
+ const { startMigrate } = await import("./migrate-ORExpVlJ.mjs");
798
952
  await startMigrate(args);
799
953
  process.exit(0);
800
954
  }
@@ -842,7 +996,7 @@ This command:
842
996
  const { projectPath } = await getPowerhouseProjectInfo();
843
997
  if (!projectPath) throw new Error("Could not find project path.");
844
998
  const { checkNpmAuth, npmPublish, resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
845
- const { mintRegistryAuthToken } = await import("./registry-auth-DxEWCJu2.mjs");
999
+ const { mintRegistryAuthToken } = await import("./registry-auth-Bm5AR-fB.mjs");
846
1000
  const registryUrl = resolveRegistryUrl({
847
1001
  registry: args.registry,
848
1002
  projectPath
@@ -932,7 +1086,7 @@ Usage:
932
1086
  const projectPath = (await getPowerhouseProjectInfo().catch(() => null))?.projectPath ?? process.cwd();
933
1087
  const [{ resolveRegistryUrl, writeRegistryAuthToken }, { mintRegistryAuthToken }, { parseExpiry, formatExpiry }] = await Promise.all([
934
1088
  import("@powerhousedao/shared/registry"),
935
- import("./registry-auth-DxEWCJu2.mjs"),
1089
+ import("./registry-auth-Bm5AR-fB.mjs"),
936
1090
  import("@renown/sdk/node")
937
1091
  ]);
938
1092
  const registryUrl = resolveRegistryUrl({
@@ -969,7 +1123,7 @@ This command:
969
1123
  const { basePath, dbPath, migrate, migrateStatus, reset, yes } = args;
970
1124
  if (basePath) process.env.BASE_PATH = basePath;
971
1125
  if (reset) {
972
- const { resetSwitchboardDatabase } = await import("./switchboard-reset-BcQXlcVf.mjs");
1126
+ const { resetSwitchboardDatabase } = await import("./switchboard-reset-Ctegiqdm.mjs");
973
1127
  await resetSwitchboardDatabase({
974
1128
  dbPath,
975
1129
  yes
@@ -977,14 +1131,14 @@ This command:
977
1131
  process.exit(0);
978
1132
  }
979
1133
  if (migrate || migrateStatus) {
980
- const { runSwitchboardMigrations } = await import("./switchboard-migrate-NQ7LHWSi.mjs");
1134
+ const { runSwitchboardMigrations } = await import("./switchboard-migrate-7JQZM7-5.mjs");
981
1135
  await runSwitchboardMigrations({
982
1136
  dbPath,
983
1137
  statusOnly: migrateStatus
984
1138
  });
985
1139
  process.exit(0);
986
1140
  }
987
- const { startSwitchboard } = await import("./switchboard-iRFugh8I.mjs");
1141
+ const { startSwitchboard } = await import("./switchboard-C5AOMSKA.mjs");
988
1142
  const { defaultDriveUrl, renown } = await startSwitchboard(args);
989
1143
  console.log(" ➜ Switchboard:", defaultDriveUrl);
990
1144
  if (renown) console.log(" ➜ Identity:", renown.did);
@@ -1021,7 +1175,8 @@ This command:
1021
1175
  });
1022
1176
  try {
1023
1177
  console.log("Uninstalling dependencies 📦 ...");
1024
- execSync$1(await getPowerhouseProjectUninstallCommand(packageManager, args.dependencies), {
1178
+ const uninstallCommand = await getPowerhouseProjectUninstallCommand(packageManager, args.dependencies);
1179
+ execSync$1(uninstallCommand, {
1025
1180
  stdio: "inherit",
1026
1181
  cwd: projectPath
1027
1182
  });
@@ -1030,7 +1185,7 @@ This command:
1030
1185
  console.error("❌ Failed to uninstall dependencies");
1031
1186
  throw error;
1032
1187
  }
1033
- const { removeStylesImports, updateConfigFile } = await import("./utils-BzwczAW-.mjs");
1188
+ const { removeStylesImports, updateConfigFile } = await import("./utils-C3c5YG6v.mjs");
1034
1189
  try {
1035
1190
  console.log("⚙️ Updating powerhouse config file...");
1036
1191
  updateConfigFile(dependenciesWithVersions, projectPath, "uninstall");
@@ -1157,11 +1312,20 @@ This command:
1157
1312
  1. Starts a Vetra Switchboard with a "Vetra" drive for document storage
1158
1313
  2. Optionally connects to remote drives instead of creating a local drive
1159
1314
  3. Starts Connect Studio pointing to the Switchboard for user interaction (unless disabled)
1160
- 4. Enables real-time updates, collaboration, and code generation`,
1315
+ 4. Enables real-time updates, collaboration, and code generation
1316
+
1317
+ Default drives:
1318
+ Connect's default drives resolve to the Vetra drive (and the preview drive
1319
+ when using --watch), plus any drives configured under
1320
+ connect.drives.defaultDrives in powerhouse.config.json - de-duplicated by
1321
+ URL, so configuring project drives does not cost you the Vetra drive.
1322
+ An explicit --default-drives-url is appended to that list (de-duplicated);
1323
+ it never replaces the Vetra drive.
1324
+ `,
1161
1325
  args: vetraArgs,
1162
1326
  handler: async (args) => {
1163
1327
  if (args.debug) console.log(args);
1164
- const { startVetra } = await import("./vetra-DkF6EJMY.mjs");
1328
+ const { startVetra } = await import("./vetra-DhhT9bQB.mjs");
1165
1329
  await startVetra(args);
1166
1330
  }
1167
1331
  }),
@@ -1180,10 +1344,13 @@ This command:
1180
1344
  install,
1181
1345
  uninstall
1182
1346
  };
1347
+ //#endregion
1348
+ //#region src/commands/ph-cli.ts
1349
+ const version = getVersion();
1183
1350
  const phCli = subcommands({
1184
1351
  name: "ph-cli",
1185
1352
  description: PH_CLI_DESCRIPTION,
1186
- version: getVersion(),
1353
+ version,
1187
1354
  cmds: phCliCommands
1188
1355
  });
1189
1356
  //#endregion
@@ -1231,7 +1398,7 @@ function printDbRecoveryHint(err) {
1231
1398
  //#endregion
1232
1399
  //#region src/cli.ts
1233
1400
  let sentryClient = void 0;
1234
- const COMMANDS_WITH_SUBCOMMANDS = new Set(["connect", "vetra"]);
1401
+ const COMMANDS_WITH_SUBCOMMANDS = /* @__PURE__ */ new Set(["connect", "vetra"]);
1235
1402
  function detectPackageManager() {
1236
1403
  const ua = process.env.npm_config_user_agent;
1237
1404
  if (!ua) return void 0;
@@ -1263,12 +1430,14 @@ async function main() {
1263
1430
  "build",
1264
1431
  "preview",
1265
1432
  "config"
1266
- ].includes(args[1]) && !isHelp) await run(cli, [
1267
- "connect",
1268
- "studio",
1269
- ...restArgs
1270
- ]);
1271
- else await run(cli, args);
1433
+ ].includes(args[1]) && !isHelp) {
1434
+ const argsWithDefaultConnectSubCommand = [
1435
+ "connect",
1436
+ "studio",
1437
+ ...restArgs
1438
+ ];
1439
+ await run(cli, argsWithDefaultConnectSubCommand);
1440
+ } else await run(cli, args);
1272
1441
  }
1273
1442
  await main().catch(async (error) => {
1274
1443
  const isDebug = process.argv.slice(2).includes("--debug");
@@ -1284,4 +1453,4 @@ await main().catch(async (error) => {
1284
1453
  export {};
1285
1454
 
1286
1455
  //# sourceMappingURL=cli.mjs.map
1287
- //# debugId=ab6e0f84-63f5-57ba-a18e-7091ccbf13c6
1456
+ //# debugId=3ab9cfff-6f9c-57a2-a989-3a29e9435207