@powerhousedao/ph-cli 6.2.3-dev.73 → 6.2.3-dev.75

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 (54) hide show
  1. package/dist/check-9KDSF1Wj.mjs +53 -0
  2. package/dist/check-9KDSF1Wj.mjs.map +1 -0
  3. package/dist/{cli-connect-override-CEJhQWRX.mjs → cli-connect-override-BrS-X8Rs.mjs} +4 -4
  4. package/dist/{cli-connect-override-CEJhQWRX.mjs.map → cli-connect-override-BrS-X8Rs.mjs.map} +1 -1
  5. package/dist/cli.mjs +11 -7
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/{compound-B6RZMA0Y-Cv3XMQ3Y.mjs → compound-Gjt5rBfF-BmSW1XPB.mjs} +178 -43
  8. package/dist/compound-Gjt5rBfF-BmSW1XPB.mjs.map +1 -0
  9. package/dist/{connect-build-BfhOGbha.mjs → connect-build-B5nYqlLc.mjs} +4 -4
  10. package/dist/{connect-build-BfhOGbha.mjs.map → connect-build-B5nYqlLc.mjs.map} +1 -1
  11. package/dist/{connect-config-DblqJgxR.mjs → connect-config-Bi95JhNG.mjs} +4 -4
  12. package/dist/{connect-config-DblqJgxR.mjs.map → connect-config-Bi95JhNG.mjs.map} +1 -1
  13. package/dist/{connect-plugin-configs-D2fwYpMw.mjs → connect-plugin-configs-BwYEbQSY.mjs} +4 -4
  14. package/dist/{connect-plugin-configs-D2fwYpMw.mjs.map → connect-plugin-configs-BwYEbQSY.mjs.map} +1 -1
  15. package/dist/{connect-studio-BS26pchr.mjs → connect-studio-Co_UNyEC.mjs} +3 -3
  16. package/dist/{connect-studio-B1_4TNEb.mjs → connect-studio-DGWUidCV.mjs} +4 -4
  17. package/dist/{connect-studio-B1_4TNEb.mjs.map → connect-studio-DGWUidCV.mjs.map} +1 -1
  18. package/dist/{dist-CCLkwpTS.mjs → dist-BVqNlv1z.mjs} +243 -14
  19. package/dist/dist-BVqNlv1z.mjs.map +1 -0
  20. package/dist/{explain-DUXbB9jf.mjs → explain-CPD1tzoV.mjs} +5 -5
  21. package/dist/{explain-DUXbB9jf.mjs.map → explain-CPD1tzoV.mjs.map} +1 -1
  22. package/dist/{generate-all-Dgyy_kT-.mjs → generate-all-CaAHbviS.mjs} +4 -4
  23. package/dist/{generate-all-Dgyy_kT-.mjs.map → generate-all-CaAHbviS.mjs.map} +1 -1
  24. package/dist/{generate-subgraph-BeGR9Y_k.mjs → generate-subgraph-DRrInOOv.mjs} +13 -6
  25. package/dist/generate-subgraph-DRrInOOv.mjs.map +1 -0
  26. package/dist/{index-BIbx17vt.d.mts → index-7hbcAZpm.d.mts} +17 -3
  27. package/dist/{index-BIbx17vt.d.mts.map → index-7hbcAZpm.d.mts.map} +1 -1
  28. package/dist/migrate-b38W7NH_.mjs +177 -0
  29. package/dist/migrate-b38W7NH_.mjs.map +1 -0
  30. package/dist/ph-cli-commands-BQU6lpyM.mjs +4 -0
  31. package/dist/{ph-cli-commands-CpHLMDM3.mjs → ph-cli-commands-kRpc2dhi.mjs} +36 -17
  32. package/dist/ph-cli-commands-kRpc2dhi.mjs.map +1 -0
  33. package/dist/{run-sugar-Ns53R6lU.mjs → run-sugar-BJxPKwlM.mjs} +4 -4
  34. package/dist/{run-sugar-Ns53R6lU.mjs.map → run-sugar-BJxPKwlM.mjs.map} +1 -1
  35. package/dist/runners/connect.d.mts +1 -1
  36. package/dist/runners/connect.mjs +5 -5
  37. package/dist/runners/switchboard.d.mts +3 -1
  38. package/dist/runners/switchboard.d.mts.map +1 -1
  39. package/dist/runners/switchboard.mjs +216 -11
  40. package/dist/runners/switchboard.mjs.map +1 -1
  41. package/dist/{start-run-BIaYSpHh.mjs → start-run-CDZ3YAr9.mjs} +4 -4
  42. package/dist/{start-run-BIaYSpHh.mjs.map → start-run-CDZ3YAr9.mjs.map} +1 -1
  43. package/dist/{switchboard-migrate-7JQZM7-5.mjs → switchboard-migrate-Docb8Cjv.mjs} +4 -4
  44. package/dist/{switchboard-migrate-7JQZM7-5.mjs.map → switchboard-migrate-Docb8Cjv.mjs.map} +1 -1
  45. package/dist/{vetra-UQsfYM_Q.mjs → vetra-DO5eUgAo.mjs} +6 -6
  46. package/dist/{vetra-UQsfYM_Q.mjs.map → vetra-DO5eUgAo.mjs.map} +1 -1
  47. package/package.json +14 -13
  48. package/dist/compound-B6RZMA0Y-Cv3XMQ3Y.mjs.map +0 -1
  49. package/dist/dist-CCLkwpTS.mjs.map +0 -1
  50. package/dist/generate-subgraph-BeGR9Y_k.mjs.map +0 -1
  51. package/dist/migrate-DK4HK7Dn.mjs +0 -83
  52. package/dist/migrate-DK4HK7Dn.mjs.map +0 -1
  53. package/dist/ph-cli-commands-CpHLMDM3.mjs.map +0 -1
  54. package/dist/ph-cli-commands-rrEBvLx4.mjs +0 -4
@@ -1,9 +1,9 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="97128297-70ea-5651-8716-b8d3aa32965f")}catch(e){}}();
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]="2189449f-38cd-525a-aa0a-486e715e93b2")}catch(e){}}();
3
3
  import { n as skipInstallArgs } from "./install-added-dependencies-DVSbzler.mjs";
4
4
  import { t as isUniformRunnersEnabled } from "./feature-flags-xwqcHEWC.mjs";
5
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";
6
+ import { AGENTS, accessTokenArgs, buildArgs, connectBuildArgs, connectConfigArgs, connectPreviewArgs, connectStudioArgs, debugArgs, hostCheckArgs, initArgs, inspectArgs, installArgs, listArgs, loginArgs, migrateArgs, publishArgs, registryLoginArgs, switchboardArgs, uninstallArgs, unpublishArgs, vetraArgs } from "@powerhousedao/shared/clis/args";
7
7
  import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
8
8
  import fs from "node:fs";
9
9
  import path from "node:path";
@@ -129,7 +129,7 @@ This command:
129
129
  args: connectStudioArgs,
130
130
  handler: async (args) => {
131
131
  if (args.debug) console.log(args);
132
- const { runConnectStudio } = await import("./connect-studio-BS26pchr.mjs");
132
+ const { runConnectStudio } = await import("./connect-studio-Co_UNyEC.mjs");
133
133
  await runConnectStudio(args);
134
134
  }
135
135
  });
@@ -151,7 +151,7 @@ Build has no read mode; passing only <key> without <value> errors out (use \`ph
151
151
  args: connectBuildArgs,
152
152
  handler: async (args) => {
153
153
  if (args.debug) console.log(args);
154
- const { runConnectBuild } = await import("./connect-build-BfhOGbha.mjs");
154
+ const { runConnectBuild } = await import("./connect-build-B5nYqlLc.mjs");
155
155
  await runConnectBuild(args);
156
156
  process.exit(0);
157
157
  }
@@ -188,7 +188,7 @@ Writes go to:
188
188
  `,
189
189
  args: connectConfigArgs,
190
190
  handler: async (args) => {
191
- const { runConnectConfig } = await import("./connect-config-DblqJgxR.mjs");
191
+ const { runConnectConfig } = await import("./connect-config-Bi95JhNG.mjs");
192
192
  await runConnectConfig(args);
193
193
  }
194
194
  });
@@ -213,7 +213,7 @@ const generateAllCmd = command({
213
213
  description: "Instead of generating code, write a spec for every module into specs/ (one-shot migration to documents-as-source-of-truth)"
214
214
  }) },
215
215
  handler: async (args) => {
216
- const { startGenerateAll } = await import("./generate-all-Dgyy_kT-.mjs");
216
+ const { startGenerateAll } = await import("./generate-all-CaAHbviS.mjs");
217
217
  await startGenerateAll(args, process.cwd());
218
218
  process.exit(0);
219
219
  }
@@ -717,7 +717,7 @@ const baseGenerateCmds = {
717
717
  ...debugArgs
718
718
  },
719
719
  handler: async (args) => {
720
- const { startGenerateSubgraph } = await import("./generate-subgraph-BeGR9Y_k.mjs");
720
+ const { startGenerateSubgraph } = await import("./generate-subgraph-DRrInOOv.mjs");
721
721
  await startGenerateSubgraph(args, process.cwd());
722
722
  process.exit(0);
723
723
  }
@@ -742,6 +742,24 @@ const generate = subcommands({
742
742
  cmds: buildGenerateCmds(isUniformRunnersEnabled())
743
743
  });
744
744
  //#endregion
745
+ //#region src/commands/host.ts
746
+ const check = command({
747
+ name: "check",
748
+ description: "Check a host the way `ph run` would, without starting it: every load, validation, resolution and boot issue, grouped by host file. Exits 1 on any issue. `--env <file>` checks against that file alone.",
749
+ args: hostCheckArgs,
750
+ handler: async (args) => {
751
+ const { runHostCheck } = await import("./check-9KDSF1Wj.mjs");
752
+ const { output, exitCode } = await runHostCheck(args);
753
+ console.log(output);
754
+ process.exitCode = exitCode;
755
+ }
756
+ });
757
+ const host = subcommands({
758
+ name: "host",
759
+ description: "Inspect the project's hosts/ (FEATURE_UNIFORM_RUNNERS_ENABLED): `check`.",
760
+ cmds: { check }
761
+ });
762
+ //#endregion
745
763
  //#region src/commands/init.ts
746
764
  const init = command({
747
765
  name: "init",
@@ -1042,7 +1060,7 @@ const migrate = command({
1042
1060
  description: "Run migrations",
1043
1061
  handler: async (args) => {
1044
1062
  if (args.debug) console.log(args);
1045
- const { startMigrate } = await import("./migrate-DK4HK7Dn.mjs");
1063
+ const { startMigrate } = await import("./migrate-b38W7NH_.mjs");
1046
1064
  await startMigrate(args);
1047
1065
  process.exit(0);
1048
1066
  }
@@ -1224,14 +1242,14 @@ const runHost = command({
1224
1242
  },
1225
1243
  handler: async (args) => {
1226
1244
  if (args.explain !== void 0) {
1227
- const { explainHost } = await import("./explain-DUXbB9jf.mjs");
1245
+ const { explainHost } = await import("./explain-CPD1tzoV.mjs");
1228
1246
  await explainHost({
1229
1247
  host: args.host,
1230
1248
  topic: args.explain
1231
1249
  });
1232
1250
  return;
1233
1251
  }
1234
- const { startRun } = await import("./start-run-BIaYSpHh.mjs");
1252
+ const { startRun } = await import("./start-run-CDZ3YAr9.mjs");
1235
1253
  await startRun({
1236
1254
  host: args.host,
1237
1255
  verb: args.verb,
@@ -1269,7 +1287,7 @@ This command:
1269
1287
  process.exit(0);
1270
1288
  }
1271
1289
  if (migrate || migrateStatus) {
1272
- const { runSwitchboardMigrations } = await import("./switchboard-migrate-7JQZM7-5.mjs");
1290
+ const { runSwitchboardMigrations } = await import("./switchboard-migrate-Docb8Cjv.mjs");
1273
1291
  await runSwitchboardMigrations({
1274
1292
  dbPath,
1275
1293
  statusOnly: migrateStatus
@@ -1463,7 +1481,7 @@ it never replaces the Vetra drive.
1463
1481
  args: vetraArgs,
1464
1482
  handler: async (args) => {
1465
1483
  if (args.debug) console.log(args);
1466
- const { startVetra } = await import("./vetra-UQsfYM_Q.mjs");
1484
+ const { startVetra } = await import("./vetra-DO5eUgAo.mjs");
1467
1485
  await startVetra(args);
1468
1486
  }
1469
1487
  }),
@@ -1482,17 +1500,18 @@ it never replaces the Vetra drive.
1482
1500
  install,
1483
1501
  uninstall
1484
1502
  };
1485
- /** Exported for tests; the flag decides whether `run` is registered at all,
1486
- * so flag-off keeps the command surface byte-identical to before. */
1503
+ /** Exported for tests; the flag decides whether `run` and `host` are
1504
+ * registered at all, so flag-off keeps the command surface byte-identical. */
1487
1505
  function buildPhCliCommands(uniformRunners) {
1488
1506
  return uniformRunners ? {
1489
1507
  ...baseCommands,
1490
- run: runHost
1508
+ run: runHost,
1509
+ host
1491
1510
  } : baseCommands;
1492
1511
  }
1493
1512
  const phCliCommands = buildPhCliCommands(isUniformRunnersEnabled());
1494
1513
  //#endregion
1495
1514
  export { phCliCommands as n, buildPhCliCommands as t };
1496
1515
 
1497
- //# sourceMappingURL=ph-cli-commands-CpHLMDM3.mjs.map
1498
- //# debugId=97128297-70ea-5651-8716-b8d3aa32965f
1516
+ //# sourceMappingURL=ph-cli-commands-kRpc2dhi.mjs.map
1517
+ //# debugId=2189449f-38cd-525a-aa0a-486e715e93b2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ph-cli-commands-kRpc2dhi.mjs","sources":["../src/commands/access-token.ts","../src/commands/build.ts","../src/commands/connect.ts","../src/commands/generate-all.ts","../src/utils/fs-args.ts","../src/utils/comma-separated.ts","../src/commands/generate-app.ts","../src/commands/generate-desktop-shell.ts","../src/commands/generate-document-model.ts","../src/commands/generate-editor.ts","../src/commands/generate-hosts.ts","../src/commands/generate-migration-file.ts","../src/commands/generate-piece-action.ts","../src/commands/generate-piece-trigger.ts","../src/commands/generate-piece.ts","../src/commands/generate-processor.ts","../src/commands/generate-subgraph.ts","../src/commands/generate.ts","../src/commands/host.ts","../src/commands/init.ts","../src/commands/inspect.ts","../src/commands/install.ts","../src/commands/list.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/migrate.ts","../src/commands/publish.ts","../src/commands/registry-login.ts","../src/commands/run.ts","../src/commands/switchboard.ts","../src/commands/uninstall.ts","../src/commands/unpublish.ts","../src/commands/vetra.ts","../src/commands/ph-cli-commands.ts"],"sourcesContent":["import { accessTokenArgs } from \"@powerhousedao/shared/clis/args\";\nimport { DEFAULT_EXPIRY_SECONDS } from \"@powerhousedao/shared/clis/constants\";\nimport { command } from \"cmd-ts\";\n\nexport const accessToken = command({\n name: \"access-token\",\n description: `\nThe access-token command generates a bearer token for API authentication. This token\ncan be used to authenticate requests to Powerhouse APIs like reactor-api (Switchboard).\n\nThis command:\n1. Uses your CLI's cryptographic identity (DID) to sign a verifiable credential\n2. Creates a JWT bearer token with configurable expiration\n3. Outputs the token to stdout (info to stderr) for easy piping\n\nPrerequisites:\n You must have a cryptographic identity. Run 'ph login' first to:\n - Generate a keypair (stored in .ph/.keypair.json)\n - Optionally link your Ethereum address (stored in .ph/.renown.json)\n\nToken Details:\n The generated token is a JWT (JSON Web Token) containing:\n - Issuer (iss): Your CLI's DID (did:key:...)\n - Subject (sub): Your CLI's DID\n - Credential Subject: Chain ID, network ID, and address (if authenticated)\n - Expiration (exp): Based on --expiry option\n - Audience (aud): If --audience is specified\n\nOutput:\n- Token information (DID, address, expiry) is printed to stderr\n- The token itself is printed to stdout for easy piping/copying\n\nThis allows you to use the command in scripts:\n TOKEN=$(ph access-token)\n curl -H \"Authorization: Bearer $TOKEN\" http://localhost:4001/graphql\n\nUsage with APIs:\n Generate token and use with curl\n TOKEN=$(ph access-token --expiry 1d)\n curl -X POST http://localhost:4001/graphql \\\\\n -H \"Content-Type: application/json\" \\\\\n -H \"Authorization: Bearer $TOKEN\" \\\\\n -d '{\"query\": \"{ drives { id name } }\"}'\n\n Export as environment variable\n export PH_ACCESS_TOKEN=$(ph access-token)\n\nNotes:\n - Tokens are self-signed using your CLI's private key\n - No network request is made; tokens are generated locally\n - The recipient API must trust your CLI's DID to accept the token\n - For reactor-api, ensure AUTH_ENABLED=true to require authentication\n`,\n args: accessTokenArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const { generateAccessToken, parseExpiry, formatExpiry } =\n await import(\"@renown/sdk/node\");\n const { getRenown } = await import(\"../services/auth.js\");\n const renown = await getRenown();\n\n let expiresIn = DEFAULT_EXPIRY_SECONDS;\n if (args.expiry) expiresIn = parseExpiry(args.expiry);\n\n const result = await generateAccessToken(renown, {\n expiresIn,\n aud: args.audience,\n });\n\n // Output token info to stderr, token itself to stdout for piping\n console.error(`CLI DID: ${result.did}`);\n console.error(`ETH Address: ${result.address}`);\n console.error(`Token expires in: ${formatExpiry(expiresIn)}`);\n console.error(\"\");\n\n console.log(result.token);\n process.exit(0);\n },\n});\n","import { buildArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const build = command({\n name: \"build\",\n description: `\nBuild a Powerhouse package for publishing: a browser bundle and a node bundle of its\ndocument models, editors, subgraphs and processors, type declarations, and its stylesheet.\n\nPieces under pieces/ are built too, each into its own self-contained module under\ndist/node/pieces/<name>, with a descriptor.json and package.json written beside it and\nthe piece listed in dist/powerhouse.manifest.json. A piece takes the package's version: an\nentry in pieces/index.ts that declares version fails the build. A package that ships only\npieces is an ordinary package: it carries the same boilerplate, and every step above runs\nfor it too.\n\ntsc runs first. If it reports type errors the build asks whether to go ahead, and stops\nwhere it can't ask. --ignore-type-errors builds without asking; a package built that way\ncan load and still fail at runtime, so don't publish it.`,\n args: buildArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n try {\n const { runBuild } = await import(\"../services/build.js\");\n await runBuild(args);\n } catch (error) {\n // The message includes its cause; --debug adds the stack and the cause again.\n console.error(\n args.debug || !(error instanceof Error) ? error : error.message,\n );\n process.exit(1);\n }\n },\n});\n","import {\n connectBuildArgs,\n connectConfigArgs,\n connectPreviewArgs,\n connectStudioArgs,\n} from \"@powerhousedao/shared/clis/args\";\nimport { command, subcommands } from \"cmd-ts\";\nexport const studio = command({\n name: \"studio\",\n description: `The studio command starts the Connect Studio, a development environment for building\nand testing Powerhouse applications. It provides a visual interface for working with\nyour project.\n\nThis command:\n1. Starts a local Connect Studio server\n2. Provides a web interface for development\n3. Allows you to interact with your project components\n4. Supports various configuration options for customization\n`,\n args: connectStudioArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n const { runConnectStudio } = await import(\"../services/connect-studio.js\");\n await runConnectStudio(args);\n },\n});\n\nexport const build = command({\n name: \"build\",\n description: `The Connect build command creates a production build with the project's local and\nexternal packages included.\n\nRuntime-config overrides (all combinable — last wins on collision):\n ph connect build Build with the current source config.\n ph connect build <key> <value> Build with a positional override applied (e.g. ph connect build connect.renown.url https://renown.staging).\n ph connect build --<field> <value> Build with a per-field flag override (e.g. --renown-url https://renown.staging).\n ph connect build --json '{\"app\":{\"workflowsEnabled\":true}}'\n Build with a bulk override. The payload is the connect.* block\n without the \"connect\" wrapper; unknown keys are rejected.\n\nBuild has no read mode; passing only <key> without <value> errors out (use \\`ph connect config <key>\\` to read).\n`,\n args: connectBuildArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const { runConnectBuild } = await import(\"../services/connect-build.js\");\n await runConnectBuild(args);\n process.exit(0);\n },\n});\n\nexport const preview = command({\n name: \"preview\",\n description: `The Connect preview command previews a built Connect project.\nNOTE: You must run \\`ph connect build\\` first\n`,\n args: connectPreviewArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n const { runConnectPreview } =\n await import(\"../services/connect-preview.js\");\n await runConnectPreview(args);\n },\n});\n\nexport const config = command({\n name: \"config\",\n description: `Read or update Connect's runtime configuration (powerhouse.config.json).\n\nModes (mutually exclusive — positional, --get, --json, and field flags cannot be combined):\n ph connect config List the effective connect.* block (defaults < source).\n ph connect config <key> Get the value at the dotted path (e.g. ph connect config connect.renown.url).\n ph connect config --get <dotted.path> Same as positional <key> (kept for backward compat).\n ph connect config <key> <value> Set a single field and dual-write to source + dist (positional).\n ph connect config --<field> <value> Set a single field via per-field flag (e.g. --renown-url https://renown.id).\n ph connect config --json '{\"renown\":{\"url\":\"…\"}}'\n Bulk-set multiple fields and dual-write. The payload is the connect.*\n block without the \"connect\" wrapper; unknown keys are rejected.\n\nWrites go to:\n - <project>/powerhouse.config.json (source — picked up by the next build)\n - <dist-dir>/powerhouse.config.json (if it exists — the currently-served SPA picks it up on refresh)\n`,\n args: connectConfigArgs,\n handler: async (args) => {\n const { runConnectConfig } = await import(\"../services/connect-config.js\");\n await runConnectConfig(args);\n },\n});\n\nexport const connect = subcommands({\n name: \"connect\",\n description: `Powerhouse Connect commands. Use with \\`studio\\`, \\`build\\`, \\`preview\\`, or \\`config\\`. Defaults to \\`studio\\` if not specified.`,\n cmds: {\n studio,\n build,\n preview,\n config,\n },\n});\n","import { command, flag } from \"cmd-ts\";\n\nexport const generateAllCmd = command({\n name: \"all\",\n description: \"Re-generate all modules in the current project\",\n args: {\n extract: flag({\n long: \"extract\",\n short: \"x\",\n description:\n \"Instead of generating code, write a spec for every module into specs/ (one-shot migration to documents-as-source-of-truth)\",\n }),\n },\n handler: async (args) => {\n const { startGenerateAll } = await import(\"../services/generate-all.js\");\n await startGenerateAll(args, process.cwd());\n process.exit(0);\n },\n});\n","import { extendType, string, type Type } from \"cmd-ts\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\n// cmd-ts's `batteries/fs`, rebuilt on the root entry so bun never loads its CJS build.\n\nconst ExistingPath: Type<string, string> = extendType(string, {\n displayName: \"path\",\n description: \"An existing path\",\n from(str) {\n const resolved = path.resolve(str);\n if (!fs.existsSync(resolved)) {\n return Promise.reject(new Error(\"Path doesn't exist\"));\n }\n return Promise.resolve(resolved);\n },\n});\n\n/** A directory, or the directory of a given file. */\nexport const Directory: Type<string, string> = extendType(ExistingPath, {\n displayName: \"dir\",\n description: \"A path to a directory or a file within a directory\",\n from(resolved) {\n return Promise.resolve(\n fs.statSync(resolved).isDirectory() ? resolved : path.dirname(resolved),\n );\n },\n});\n\n/** An existing file. */\nexport const File: Type<string, string> = extendType(ExistingPath, {\n displayName: \"file\",\n description: \"A file in the file system\",\n from(resolved) {\n if (!fs.statSync(resolved).isFile()) {\n return Promise.reject(new Error(\"Provided path is not a file\"));\n }\n return Promise.resolve(resolved);\n },\n});\n\n/** A module's directory name or path, resolved by the command against the project. */\nexport const ModuleDir: Type<string, string> = extendType(string, {\n displayName: \"dir\",\n description: \"A module's directory name or path\",\n from: (dir) => Promise.resolve(dir),\n});\n","import type { Type } from \"cmd-ts\";\n\n/** Splits comma-separated values so `-t \"a,b\"` means the same as `-t a -t b`\n * instead of yielding the single value `\"a,b\"`, which matches nothing. */\nexport function splitCommaSeparated(values: string[]): string[] {\n return values\n .flatMap((value) => value.split(\",\"))\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n}\n\n/** `multioption` type accepting repeated and/or comma-separated values. */\nexport const CommaSeparatedStrings: Type<string[], string[]> = {\n from: (values) => Promise.resolve(splitCommaSeparated(values)),\n};\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport {\n boolean,\n command,\n flag,\n multioption,\n option,\n optional,\n string,\n} from \"cmd-ts\";\nimport { File, ModuleDir } from \"../utils/fs-args.js\";\nimport { CommaSeparatedStrings } from \"../utils/comma-separated.js\";\n\nexport const generateAppCmd = command({\n name: \"app\",\n description: \"Generate a drive app\",\n args: {\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description: \"The name of the drive app to generate\",\n }),\n allowedDocumentTypes: multioption({\n type: optional(CommaSeparatedStrings),\n long: \"document-types\",\n short: \"t\",\n description:\n \"The document types allowed by the new app (repeatable or comma-separated)\",\n }),\n document: option({\n type: optional(File),\n long: \"document\",\n short: \"d\",\n description:\n \"Path to a powerhouse/app spec file (.phd or .json) to drive codegen\",\n }),\n dir: option({\n type: optional(ModuleDir),\n long: \"dir\",\n description:\n \"Name of the directory of an existing app to re-generate (my-app or editors/my-app)\",\n }),\n disableDragAndDrop: flag({\n type: boolean,\n long: \"disable-drag-and-drop\",\n description: \"Do not allow drag and drop in this drive app.\",\n defaultValue: () => false as const,\n defaultValueIsSerializable: true,\n }),\n all: flag({\n long: \"all\",\n short: \"a\",\n description: \"Re-generate all existing apps in the current project\",\n }),\n extract: flag({\n long: \"extract\",\n short: \"x\",\n description:\n \"Write a powerhouse/app spec for each existing drive app into specs/apps/\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGenerateApp } = await import(\"../services/generate-app.js\");\n await startGenerateApp(args, process.cwd());\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, flag, option, optional, string } from \"cmd-ts\";\n\nexport const generateDesktopShellCmd = command({\n name: \"desktop-shell\",\n description:\n \"Scaffold a builder-owned desktop identity (hosts/desktop/app.json + icon). \" +\n \"`ph run desktop dev|build` then projects it into a native Tauri shell — no Rust.\",\n args: {\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description:\n \"Product name (window title + macOS app name). Default: the project's package name.\",\n }),\n identifier: option({\n type: optional(string),\n long: \"identifier\",\n short: \"i\",\n description:\n \"Reverse-DNS app identifier, e.g. com.acme.app. Default: inc.powerhouse.desktop.<project>.\",\n }),\n force: flag({\n long: \"force\",\n short: \"f\",\n description:\n \"Overwrite an existing app.json (protects edits by default).\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGenerateDesktopShell } =\n await import(\"../services/generate-desktop-shell.js\");\n startGenerateDesktopShell(args, process.cwd());\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, flag, option, optional } from \"cmd-ts\";\nimport { File, ModuleDir } from \"../utils/fs-args.js\";\nexport const generateDocumentModelCmd = command({\n name: \"document-model\",\n aliases: [\"doc\"],\n description: \"Generate a document model\",\n args: {\n document: option({\n type: optional(File),\n long: \"document\",\n short: \"d\",\n description:\n \"Path to a document model spec (.phd or .json) to generate from\",\n }),\n dir: option({\n type: optional(ModuleDir),\n long: \"dir\",\n description:\n \"Name of the directory of an existing document model to re-generate (my-document-model or document-models/my-document-model)\",\n }),\n all: flag({\n long: \"all\",\n short: \"a\",\n description:\n \"Re-generate all existing document models in the current project\",\n }),\n extract: flag({\n long: \"extract\",\n short: \"x\",\n description:\n \"Write a powerhouse/document-model spec for each existing document model into specs/document-models/\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGenerateDocumentModel } =\n await import(\"../services/generate-document-model.js\");\n await startGenerateDocumentModel(args, process.cwd());\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, flag, option, optional, string } from \"cmd-ts\";\nimport { File, ModuleDir } from \"../utils/fs-args.js\";\n\nexport const generateEditorCmd = command({\n name: \"editor\",\n description: \"Generate a document editor\",\n args: {\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description: \"The name of the document editor to generate\",\n }),\n documentType: option({\n type: optional(string),\n long: \"document-type\",\n short: \"t\",\n description: \"The document type for the new editor\",\n }),\n document: option({\n type: optional(File),\n long: \"document\",\n short: \"d\",\n description:\n \"Path to a powerhouse/document-editor spec file (.phd or .json) to drive codegen\",\n }),\n dir: option({\n type: optional(ModuleDir),\n long: \"dir\",\n description:\n \"Name of the directory of an existing editor to re-generate (my-editor or editors/my-editor)\",\n }),\n all: flag({\n long: \"all\",\n short: \"a\",\n description: \"Re-generate all existing editors in the current project\",\n }),\n extract: flag({\n long: \"extract\",\n short: \"x\",\n description:\n \"Write a powerhouse/document-editor spec for each existing editor into specs/editors/\",\n }),\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGenerateEditor } =\n await import(\"../services/generate-editor.js\");\n await startGenerateEditor(args, process.cwd());\n process.exit(0);\n },\n});\n","import { command } from \"cmd-ts\";\n\nexport const generateHostsCmd = command({\n name: \"hosts\",\n description:\n \"Generate hosts/<name>/outputs.js + outputs.d.ts (typed $output token trees) for every host whose runner declares outputs, and refresh hosts/types.d.ts. Rerun after changing a producer's runner or declared drives: a stale outputs.js fails the load.\",\n args: {},\n handler: async () => {\n const { startGenerateHosts } =\n await import(\"../services/generate-hosts.js\");\n const ok = await startGenerateHosts(process.cwd());\n process.exit(ok ? 0 : 1);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, option, optional, string } from \"cmd-ts\";\nimport path from \"path\";\n\nexport const generateMigrationFileCmd = command({\n name: \"migration-file\",\n description: \"Generate a migration file\",\n args: {\n migrationFile: option({\n type: string,\n long: \"path\",\n short: \"p\",\n description: \"Path to the migration file\",\n }),\n schemaFile: option({\n type: optional(string),\n long: \"schema-file\",\n description: \"Path to the output file. Defaults to './schema.ts'\",\n }),\n ...debugArgs,\n },\n handler: async ({ migrationFile, schemaFile }) => {\n const { generateDBSchema } = await import(\"@powerhousedao/codegen\");\n await generateDBSchema({\n migrationFile: path.join(process.cwd(), migrationFile),\n schemaFile: schemaFile ? path.join(process.cwd(), schemaFile) : undefined,\n });\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, oneOf, option, optional, positional, string } from \"cmd-ts\";\nimport { skipInstallArgs } from \"../utils/install-added-dependencies.js\";\n\nexport const generatePieceActionCmd = command({\n name: \"piece-action\",\n description: \"Generate an action inside an existing piece\",\n args: {\n namePositional: positional({\n type: optional(string),\n displayName: \"name\",\n description: \"The name of the action, e.g. get-record\",\n }),\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description: \"The name of the action to generate\",\n }),\n piece: option({\n type: optional(string),\n long: \"piece\",\n short: \"p\",\n description:\n \"The piece directory under pieces/ to add the action to. Optional when the project ships exactly one piece.\",\n }),\n requireReactor: option({\n type: optional(oneOf([\"read\", \"write\"] as const)),\n long: \"require-reactor\",\n description:\n \"Declare reactor access for the action: read, or write (which includes read). The action then gets context.reactor\",\n }),\n ...skipInstallArgs,\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGeneratePieceAction } =\n await import(\"../services/generate-piece-action.js\");\n await startGeneratePieceAction(args, process.cwd());\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, oneOf, option, optional, positional, string } from \"cmd-ts\";\nimport { skipInstallArgs } from \"../utils/install-added-dependencies.js\";\n\nexport const generatePieceTriggerCmd = command({\n name: \"piece-trigger\",\n description: \"Generate a trigger inside an existing piece\",\n args: {\n namePositional: positional({\n type: optional(string),\n displayName: \"name\",\n description: \"The name of the trigger, e.g. new-record\",\n }),\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description: \"The name of the trigger to generate\",\n }),\n piece: option({\n type: optional(string),\n long: \"piece\",\n short: \"p\",\n description:\n \"The piece directory under pieces/ to add the trigger to. Optional when the project ships exactly one piece.\",\n }),\n strategy: option({\n type: oneOf([\"polling\", \"webhook\"] as const),\n long: \"strategy\",\n description:\n \"How the trigger fires: polled on a schedule, or delivered to a webhook\",\n defaultValue: () => \"polling\" as const,\n defaultValueIsSerializable: true,\n }),\n requireReactor: option({\n type: optional(oneOf([\"read\", \"write\"] as const)),\n long: \"require-reactor\",\n description:\n \"Declare reactor access for the trigger: read, or write (which includes read). Its hooks then get context.reactor\",\n }),\n ...skipInstallArgs,\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGeneratePieceTrigger } =\n await import(\"../services/generate-piece-trigger.js\");\n await startGeneratePieceTrigger(args, process.cwd());\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport {\n command,\n flag,\n oneOf,\n option,\n optional,\n positional,\n string,\n} from \"cmd-ts\";\nimport { ModuleDir } from \"../utils/fs-args.js\";\nimport { skipInstallArgs } from \"../utils/install-added-dependencies.js\";\n\nexport const generatePieceCmd = command({\n name: \"piece\",\n description:\n \"Generate a piece: a connector whose actions and triggers a workflow can call\",\n args: {\n namePositional: positional({\n type: optional(string),\n displayName: \"name\",\n description:\n \"The name of the piece to generate. Its directory is the kebab-case of this.\",\n }),\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description: \"The name of the piece to generate\",\n }),\n id: option({\n type: optional(string),\n long: \"id\",\n description:\n \"The piece id, the pieceName a workflow step holds, e.g. @acme/piece-crm. Defaults to one derived from the package name.\",\n }),\n auth: option({\n type: oneOf([\"none\", \"secret\", \"custom\"] as const),\n long: \"auth\",\n description: \"The kind of connection the piece asks for\",\n defaultValue: () => \"custom\" as const,\n defaultValueIsSerializable: true,\n }),\n description: option({\n type: optional(string),\n long: \"description\",\n description: \"One line describing what the piece connects to\",\n }),\n dir: option({\n type: optional(ModuleDir),\n long: \"dir\",\n description:\n \"Name of the directory of an existing piece to re-register (my-piece or pieces/my-piece)\",\n }),\n all: flag({\n long: \"all\",\n short: \"a\",\n description:\n \"Re-register every piece in pieces/: refresh the pieces list and the manifest, and prune what is gone\",\n }),\n ...skipInstallArgs,\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGeneratePiece } =\n await import(\"../services/generate-piece.js\");\n await startGeneratePiece(args, process.cwd());\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { PROCESSOR_APPS } from \"@powerhousedao/shared/processors\";\nimport type { Type } from \"cmd-ts\";\nimport {\n command,\n flag,\n multioption,\n oneOf,\n option,\n optional,\n string,\n} from \"cmd-ts\";\nimport { File, ModuleDir } from \"../utils/fs-args.js\";\nimport {\n CommaSeparatedStrings,\n splitCommaSeparated,\n} from \"../utils/comma-separated.js\";\nimport { skipInstallArgs } from \"../utils/install-added-dependencies.js\";\n\nconst ProcessorAppType: Type<string[], (\"connect\" | \"switchboard\")[]> = {\n from(rawProcessorApps) {\n const processorApps = splitCommaSeparated(rawProcessorApps);\n if (processorApps.length === 0) {\n throw new Error(\n `No arguments provided for processor apps. Must be \"connect\" and/or \"switchboard\"`,\n );\n }\n if (processorApps.length > 2) {\n throw new Error(\n `Too many arguments provided for processor apps. Must be \"connect\" and/or \"switchboard\"`,\n );\n }\n const allowed = new Set(PROCESSOR_APPS);\n if (\n !processorApps.every((p) => allowed.has(p as \"connect\" | \"switchboard\"))\n ) {\n throw new Error(\n `Processor apps can only be \"connect\" and/or \"switchboard\".`,\n );\n }\n return Promise.resolve(processorApps as (\"connect\" | \"switchboard\")[]);\n },\n};\nexport const generateProcessorCmd = command({\n name: \"processor\",\n description: \"Generate a processor\",\n args: {\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description: \"The name of the processor to generate\",\n }),\n type: option({\n type: oneOf([\"analytics\", \"relationalDb\"] as const),\n long: \"type\",\n description: \"The type of processor to generate\",\n defaultValue: () => \"analytics\" as const,\n defaultValueIsSerializable: true,\n }),\n documentTypes: multioption({\n type: CommaSeparatedStrings,\n long: \"document-types\",\n short: \"t\",\n description:\n \"The document types the processor will run on (repeatable or comma-separated)\",\n defaultValue: () => [],\n defaultValueIsSerializable: true,\n }),\n apps: multioption({\n long: \"apps\",\n type: ProcessorAppType,\n description:\n \"Whether the processor will run in switchboard (nodejs), connect (browser), or both\",\n defaultValue: () => [\"switchboard\" as const, \"connect\" as const],\n defaultValueIsSerializable: true,\n }),\n document: option({\n type: optional(File),\n long: \"document\",\n short: \"d\",\n description:\n \"Path to a powerhouse/processor spec file (.phd or .json) to drive codegen\",\n }),\n dir: option({\n type: optional(ModuleDir),\n long: \"dir\",\n description:\n \"Name of the directory of an existing processor to re-generate (my-processor or processors/my-processor)\",\n }),\n all: flag({\n long: \"all\",\n short: \"a\",\n description: \"Re-generate all existing processors in the current project\",\n }),\n extract: flag({\n long: \"extract\",\n short: \"x\",\n description:\n \"Write a powerhouse/processor spec for each existing processor into specs/processors/\",\n }),\n ...skipInstallArgs,\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGenerateProcessor } =\n await import(\"../services/generate-processor.js\");\n await startGenerateProcessor(args, process.cwd());\n process.exit(0);\n },\n});\n","import { debugArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, flag, option, optional, string } from \"cmd-ts\";\nimport { File, ModuleDir } from \"../utils/fs-args.js\";\nimport { skipInstallArgs } from \"../utils/install-added-dependencies.js\";\n\nexport const generateSubgraphCmd = command({\n name: \"subgraph\",\n description: \"Generate a subgraph\",\n args: {\n name: option({\n type: optional(string),\n long: \"name\",\n short: \"n\",\n description: \"The name of the subgraph to generate\",\n }),\n document: option({\n type: optional(File),\n long: \"document\",\n short: \"d\",\n description:\n \"Path to a powerhouse/subgraph spec file (.phd or .json) to drive codegen\",\n }),\n dir: option({\n type: optional(ModuleDir),\n long: \"dir\",\n description:\n \"Name of the directory of an existing subgraph to re-generate (my-subgraph or subgraphs/my-subgraph)\",\n }),\n all: flag({\n long: \"all\",\n short: \"a\",\n description: \"Re-generate all existing subgraphs in the current project\",\n }),\n extract: flag({\n long: \"extract\",\n short: \"x\",\n description:\n \"Write a powerhouse/subgraph spec for each existing subgraph into specs/subgraphs/\",\n }),\n ...skipInstallArgs,\n ...debugArgs,\n },\n handler: async (args) => {\n const { startGenerateSubgraph } =\n await import(\"../services/generate-subgraph.js\");\n await startGenerateSubgraph(args, process.cwd());\n process.exit(0);\n },\n});\n","import { subcommands } from \"cmd-ts\";\nimport { generateAllCmd } from \"./generate-all.js\";\nimport { generateAppCmd } from \"./generate-app.js\";\nimport { generateDesktopShellCmd } from \"./generate-desktop-shell.js\";\nimport { generateDocumentModelCmd } from \"./generate-document-model.js\";\nimport { generateEditorCmd } from \"./generate-editor.js\";\nimport { generateHostsCmd } from \"./generate-hosts.js\";\nimport { generateMigrationFileCmd } from \"./generate-migration-file.js\";\nimport { generatePieceActionCmd } from \"./generate-piece-action.js\";\nimport { generatePieceTriggerCmd } from \"./generate-piece-trigger.js\";\nimport { generatePieceCmd } from \"./generate-piece.js\";\nimport { generateProcessorCmd } from \"./generate-processor.js\";\nimport { generateSubgraphCmd } from \"./generate-subgraph.js\";\nimport { isUniformRunnersEnabled } from \"../utils/feature-flags.js\";\n\nconst baseGenerateCmds = {\n all: generateAllCmd,\n \"document-model\": generateDocumentModelCmd,\n editor: generateEditorCmd,\n app: generateAppCmd,\n processor: generateProcessorCmd,\n subgraph: generateSubgraphCmd,\n piece: generatePieceCmd,\n \"piece-action\": generatePieceActionCmd,\n \"piece-trigger\": generatePieceTriggerCmd,\n \"migration-file\": generateMigrationFileCmd,\n \"desktop-shell\": generateDesktopShellCmd,\n} as const;\n\n/** Exported for tests; `hosts` exists only with uniform runners enabled, so\n * flag-off keeps the command surface unchanged. */\nexport function buildGenerateCmds(uniformRunners: boolean) {\n return uniformRunners\n ? { ...baseGenerateCmds, hosts: generateHostsCmd }\n : baseGenerateCmds;\n}\n\nexport const generate = subcommands({\n name: \"generate\",\n 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.`,\n cmds: buildGenerateCmds(isUniformRunnersEnabled()),\n});\n","import { hostCheckArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command, subcommands } from \"cmd-ts\";\n\nexport const check = command({\n name: \"check\",\n description:\n \"Check a host the way `ph run` would, without starting it: every load, \" +\n \"validation, resolution and boot issue, grouped by host file. Exits 1 \" +\n \"on any issue. `--env <file>` checks against that file alone.\",\n args: hostCheckArgs,\n handler: async (args) => {\n const { runHostCheck } = await import(\"../services/host/check.js\");\n const { output, exitCode } = await runHostCheck(args);\n console.log(output);\n // Not process.exit: on macOS a piped stdout is async and would be cut.\n process.exitCode = exitCode;\n },\n});\n\nexport const host = subcommands({\n name: \"host\",\n description:\n \"Inspect the project's hosts/ (FEATURE_UNIFORM_RUNNERS_ENABLED): `check`.\",\n cmds: { check },\n});\n","import { initArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const init = command({\n name: \"init\",\n description: \"Initialize a new project\",\n args: initArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log({ args });\n }\n const { startInit } = await import(\"../services/init.js\");\n await startInit(args);\n process.exit(0);\n },\n});\n","import { inspectArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const inspect = command({\n name: \"inspect\",\n description: `\nThe inspect command examines and provides detailed information about a Powerhouse package.\nIt helps you understand the structure, dependencies, and configuration of packages in\nyour project.\n\nThis command:\n1. Analyzes the specified package\n2. Retrieves detailed information about its structure and configuration\n3. Displays package metadata, dependencies, and other relevant information\n4. Helps troubleshoot package-related issues`,\n aliases: [\"is\"],\n args: inspectArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n const { startInspect } = await import(\"../services/inspect.js\");\n startInspect(args);\n process.exit(0);\n },\n});\n","import { installArgs } from \"@powerhousedao/shared/clis/args\";\nimport { execSync } from \"child_process\";\nimport { command } from \"cmd-ts\";\n\nconst MANIFEST_TIMEOUT_MS = 10_000;\n\n// The external packages a registry package's manifest lists; none when unreadable.\nexport async function fetchExternalDependencies(\n registryUrl: string,\n dependency: { name: string; version?: string },\n): Promise<string[]> {\n const base = registryUrl.endsWith(\"/\") ? registryUrl : `${registryUrl}/`;\n const spec = dependency.version\n ? `${dependency.name}@${dependency.version}`\n : dependency.name;\n try {\n const response = await fetch(\n `${base}-/cdn/${spec}/powerhouse.manifest.json`,\n { signal: AbortSignal.timeout(MANIFEST_TIMEOUT_MS) },\n );\n if (!response.ok) return [];\n const manifest = (await response.json()) as {\n externalDependencies?: unknown;\n };\n const external = manifest.externalDependencies;\n return typeof external === \"object\" && external !== null\n ? Object.keys(external).sort()\n : [];\n } catch {\n return [];\n }\n}\n\nexport async function warnAboutExternalDependencies(\n registryUrl: string,\n dependencies: { name: string; version?: string }[],\n): Promise<void> {\n // Fetched together: each manifest may take the whole timeout.\n const found = await Promise.all(\n dependencies.map((dependency) =>\n fetchExternalDependencies(registryUrl, dependency),\n ),\n );\n for (const [i, dependency] of dependencies.entries()) {\n const external = found[i];\n if (external.length === 0) continue;\n console.warn(\n `⚠ ${dependency.name}: its subgraphs and processors need packages with native addons or WebAssembly modules (${external.join(\", \")}) ` +\n `and only run when the package is installed locally: ph install --local ${dependency.name}\\n` +\n ` Its pieces work either way.`,\n );\n }\n}\n\nexport const install = command({\n name: \"install\",\n aliases: [\"add\", \"i\"],\n description: `\nThe install command adds Powerhouse dependencies to your project.\n\nBy default it only registers the package in powerhouse.config.json with\nprovider \"registry\" — Connect will load it from the registry CDN at runtime.\n\nWith --local, the package is also installed into node_modules and marked\nas provider \"local\" — it will be bundled into ph connect build so the\npreview works without the registry being reachable.\n\nResolution order for the registry URL:\n --registry flag > PH_REGISTRY_URL env > powerhouse.config.json > default\n `,\n args: installArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const { getPowerhouseProjectInfo, makeDependenciesWithVersions } =\n await import(\"@powerhousedao/shared/clis\");\n\n const {\n projectPath,\n localProjectPath,\n globalProjectPath,\n packageManager,\n isGlobal,\n } = await getPowerhouseProjectInfo(args);\n\n if (!projectPath) {\n throw new Error(`Could not find project path to install from.`);\n }\n\n const { resolveRegistryUrl } =\n await import(\"@powerhousedao/shared/registry\");\n const registryUrl = resolveRegistryUrl({\n registry: args.registry,\n projectPath,\n });\n\n if (args.debug) {\n console.log(\">>> registryUrl\", registryUrl);\n }\n\n const dependenciesWithVersions = await makeDependenciesWithVersions(\n args.dependencies,\n registryUrl,\n );\n\n if (args.debug) {\n console.log(\">>> parsedDependencies\", dependenciesWithVersions);\n console.log(\"\\n>>> projectInfo\", {\n localProjectPath,\n globalProjectPath,\n packageManager,\n isGlobal,\n });\n }\n\n if (args.local) {\n if (dependenciesWithVersions.length === 0) {\n throw new Error(\n \"--local requires at least one package name (e.g. ph install --local @scope/pkg)\",\n );\n }\n try {\n const specs = dependenciesWithVersions.map((d) =>\n d.version ? `${d.name}@${d.version}` : d.name,\n );\n\n // Route only the scopes of the packages being installed to the\n // resolved registry, leaving transitive deps from other scopes\n // (and unscoped packages) on the package manager's default. This\n // avoids requiring a project-level .npmrc when the user already\n // has packageRegistryUrl in powerhouse.config.json.\n const scopes = new Set<string>();\n for (const dep of dependenciesWithVersions) {\n if (dep.name.startsWith(\"@\")) {\n const scope = dep.name.split(\"/\")[0];\n scopes.add(scope);\n }\n }\n const scopeRegistryArgs = Array.from(scopes).map(\n (scope) => `--${scope}:registry=${registryUrl}`,\n );\n\n const minReleaseAgeArgs =\n packageManager === \"pnpm\" ? [\"--config.minimum-release-age=0\"] : [];\n\n const allowBuildArgs =\n packageManager === \"pnpm\" && args.allowBuild.length > 0\n ? [`--allow-build=${args.allowBuild.join(\",\")}`]\n : [];\n\n const { resolveCommand } = await import(\"package-manager-detector\");\n const resolved = resolveCommand(packageManager, \"add\", [\n ...specs,\n ...scopeRegistryArgs,\n ...minReleaseAgeArgs,\n ...allowBuildArgs,\n ]);\n if (!resolved) {\n throw new Error(\n `Failed to resolve install command for package manager \"${packageManager}\".`,\n );\n }\n const installCommand = `${resolved.command} ${resolved.args.join(\" \")}`;\n if (scopeRegistryArgs.length > 0) {\n console.log(\n `Installing dependencies 📦 (routing ${Array.from(scopes).join(\", \")} → ${registryUrl})...`,\n );\n } else {\n console.log(\"Installing dependencies 📦...\");\n }\n console.log(`> ${installCommand}`);\n execSync(installCommand, {\n stdio: \"inherit\",\n cwd: projectPath,\n });\n console.log(\"Dependency installed successfully 🎉\");\n } catch (error) {\n console.error(\"❌ Failed to install dependencies\");\n throw error;\n }\n }\n\n const { updateConfigFile } = await import(\"../utils.js\");\n\n try {\n console.log(\"⚙️ Updating powerhouse config file...\");\n updateConfigFile(\n dependenciesWithVersions,\n projectPath,\n \"install\",\n args.local ? \"local\" : \"registry\",\n registryUrl,\n args.registry !== undefined,\n );\n console.log(\"Config file updated successfully 🎉\");\n } catch (error) {\n console.error(\"❌ Failed to update config file\");\n throw error;\n }\n\n if (!args.local) {\n await warnAboutExternalDependencies(\n registryUrl,\n dependenciesWithVersions,\n );\n }\n\n process.exit(0);\n },\n});\n","import { listArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const list = command({\n name: \"list\",\n description: `\nThe list command displays information about installed Powerhouse packages in your project.\nIt reads the powerhouse.config.json file and shows the packages that are currently installed.\n\nThis command:\n1. Examines your project configuration\n2. Lists all installed Powerhouse packages\n3. Provides a clear overview of your project's dependencies\n4. Helps you manage and track your Powerhouse components\n`,\n aliases: [\"l\"],\n args: listArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n try {\n const { getPowerhouseProjectInfo } =\n await import(\"@powerhousedao/shared/clis\");\n const projectInfo = await getPowerhouseProjectInfo();\n\n const { getConfig } = await import(\"@powerhousedao/config/node\");\n const phConfig = getConfig(\n projectInfo.projectPath + \"/powerhouse.config.json\",\n );\n\n if (!phConfig.packages || phConfig.packages.length === 0) {\n console.log(\"No packages found in the project\");\n return;\n }\n\n console.log(\"Installed Packages:\\n\");\n phConfig.packages.forEach((pkg) => {\n console.log(\n pkg.version ? `${pkg.packageName}@${pkg.version}` : pkg.packageName,\n );\n });\n } catch (_e) {\n console.log(\"No packages found in the project\");\n }\n process.exit(0);\n },\n});\n","import { loginArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const login = command({\n name: \"login\",\n description: `\nThe login command authenticates you with Renown using your Ethereum wallet. This enables\nthe CLI to act on behalf of your Ethereum identity for authenticated operations.\n\nThis command:\n1. Generates or loads a cryptographic identity (DID) for the CLI\n2. Opens your browser to the Renown authentication page\n3. You authorize the CLI's DID to act on behalf of your Ethereum address\n4. Stores the credentials locally in .ph/.renown.json\n `,\n args: loginArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const { getRenown } = await import(\"../services/auth.js\");\n const renown = await getRenown(args.renownUrl);\n\n if (args.showDid) {\n console.log(renown.did);\n process.exit(0);\n }\n\n if (args.status) {\n const { getAuthStatus } = await import(\"@renown/sdk/node\");\n const status = getAuthStatus(renown);\n if (!status.authenticated || !status.address) {\n console.log(\"Not authenticated with an Ethereum address.\");\n console.log('Run \"ph login\" to authenticate.');\n } else {\n console.log(\"Authenticated\");\n console.log(` ETH Address: ${status.address}`);\n console.log(` User DID: ${status.userDid}`);\n console.log(` Chain ID: ${status.chainId}`);\n console.log(` CLI DID: ${status.cliDid}`);\n console.log(\n ` Authenticated at: ${status.authenticatedAt?.toLocaleString()}`,\n );\n console.log(` Renown URL: ${status.baseUrl}`);\n }\n process.exit(0);\n }\n\n if (args.logout) {\n await handleLogout();\n process.exit(0);\n }\n\n const { browserLogin } = await import(\"@renown/sdk/node\");\n\n console.debug(\"Initializing cryptographic identity...\");\n console.log(`CLI DID: ${renown.did}`);\n\n try {\n const timeoutMs = args.timeout ? args.timeout * 1000 : undefined;\n\n const result = await browserLogin(renown, {\n renownUrl: args.renownUrl,\n timeoutMs,\n onLoginUrl: (url, sessionId) => {\n console.log(\"Opening browser for authentication...\");\n console.log(`Session ID: ${sessionId.slice(0, 8)}...`);\n console.log(`Login URL: ${url}`);\n console.log();\n console.log(\"Waiting for authentication in browser\");\n console.log(`(timeout in ${(timeoutMs ?? 300_000) / 1000} seconds)`);\n console.log();\n console.log(\n \"Please connect your wallet and authorize this CLI to act on your behalf.\",\n );\n console.log();\n process.stdout.write(\"Waiting\");\n },\n onPollTick: () => process.stdout.write(\".\"),\n onBrowserOpenFailed: (url) => {\n console.error(\"Failed to open browser automatically.\");\n console.log(`Please open this URL manually: ${url}`);\n },\n });\n\n console.log(); // New line after dots\n console.log();\n console.log(\"Successfully authenticated!\");\n console.log(` ETH Address: ${result.user.address}`);\n console.log(` User DID: ${result.user.did}`);\n console.log(` CLI DID: ${result.cliDid}`);\n console.log();\n console.log(\"The CLI can now act on behalf of your Ethereum identity.\");\n } catch (error) {\n console.log(); // New line after dots\n throw error;\n }\n\n process.exit(0);\n },\n});\n\nexport async function handleLogout() {\n const { getRenown } = await import(\"../services/auth.js\");\n const renown = await getRenown();\n if (!renown.user) {\n console.log(\"Not currently authenticated.\");\n return;\n }\n\n try {\n await renown.logout();\n console.log(\"Successfully logged out.\");\n } catch (error) {\n console.error(\"Failed to clear credentials.\");\n console.debug(error);\n }\n}\n","import { command } from \"cmd-ts\";\nimport { handleLogout } from \"./login.js\";\n\nexport const logout = command({\n name: \"logout\",\n description: `\nThe logout command removes an existing session created with 'ph login'`,\n args: {},\n handler: async () => {\n await handleLogout();\n process.exit(0);\n },\n});\n","import { migrateArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const migrate = command({\n name: \"migrate\",\n args: migrateArgs,\n description: \"Run migrations\",\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n const { startMigrate } = await import(\"../services/migrate.js\");\n await startMigrate(args);\n process.exit(0);\n },\n});\n","import { publishArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nfunction hasTagFlag(args: string[]): boolean {\n return args.some((a) => a === \"--tag\" || a.startsWith(\"--tag=\"));\n}\n\nfunction isInteractive(): boolean {\n return Boolean(process.stdin.isTTY) && !process.env.CI;\n}\n\nasync function readPrereleaseTag(projectPath: string): Promise<{\n version: string;\n tag: string;\n} | null> {\n try {\n const [{ readPackageSync }, { prerelease }] = await Promise.all([\n import(\"read-pkg\"),\n import(\"semver\"),\n ]);\n const pkg = readPackageSync({ cwd: projectPath });\n if (!pkg.version) return null;\n const parts = prerelease(pkg.version);\n if (!parts || parts.length === 0) return null;\n const label = String(parts[0]);\n // semver may surface numeric-only prerelease ids (e.g. `1.0.0-0`);\n // npm requires an alphanumeric dist-tag, so skip those.\n if (!/^[a-z][a-z0-9-]*$/i.test(label)) return null;\n return { version: pkg.version, tag: label };\n } catch {\n return null;\n }\n}\n\nexport const publish = command({\n name: \"publish\",\n description: `\nPublish a package to the Powerhouse registry. This is a thin wrapper around npm publish\nthat automatically sets the registry URL.\n\nThis command:\n1. Resolves the registry URL (--registry flag > PH_REGISTRY_URL env > powerhouse.config.json > default)\n2. Checks authentication with the registry via npm whoami\n3. Forwards all additional arguments to npm publish\n `,\n args: publishArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const { getPowerhouseProjectInfo } =\n await import(\"@powerhousedao/shared/clis\");\n const { projectPath } = await getPowerhouseProjectInfo();\n\n if (!projectPath) {\n throw new Error(\"Could not find project path.\");\n }\n\n const { checkNpmAuth, npmPublish, resolveRegistryUrl } =\n await import(\"@powerhousedao/shared/registry\");\n const { mintRegistryAuthToken } =\n await import(\"../services/registry-auth.js\");\n\n const registryUrl = resolveRegistryUrl({\n registry: args.registry,\n projectPath,\n });\n\n if (args.debug) {\n console.log(\">>> registryUrl\", registryUrl);\n }\n\n // Try Renown auth first: if the user is logged in via `ph login`, mint a\n // short-lived registry-bound bearer token. Falling back to the legacy\n // `npm adduser` (htpasswd) path keeps existing flows working until the\n // grace period ends.\n let authToken: string | undefined;\n try {\n authToken = await mintRegistryAuthToken(registryUrl, 5 * 60);\n if (args.debug) {\n console.error(`>>> minted renown token for ${registryUrl} (5m TTL)`);\n }\n } catch (err) {\n if (args.debug) {\n console.error(\n `>>> renown token mint skipped: ${(err as Error).message}`,\n );\n }\n try {\n await checkNpmAuth(registryUrl);\n } catch {\n console.error(`Not authenticated with registry: ${registryUrl}`);\n console.error(\n `Run: ph login (recommended) or npm adduser --registry ${registryUrl}`,\n );\n process.exit(1);\n }\n }\n\n let forwardedArgs = args.forwardedArgs;\n\n if (!hasTagFlag(forwardedArgs)) {\n const prereleaseInfo = await readPrereleaseTag(projectPath);\n if (prereleaseInfo) {\n const { version, tag } = prereleaseInfo;\n if (!isInteractive()) {\n console.error(\n `Detected prerelease version ${version}. npm requires an explicit dist-tag for prerelease publishes.`,\n );\n console.error(\n `Re-run with --tag <label> (e.g. --tag ${tag}) to proceed.`,\n );\n process.exit(1);\n }\n\n const enquirer = await import(\"enquirer\");\n\n let confirmed: boolean;\n try {\n const answer = await enquirer.default.prompt<{ confirmed: boolean }>({\n type: \"confirm\",\n name: \"confirmed\",\n message: `Detected prerelease version ${version}. Publish with --tag ${tag}?`,\n initial: true,\n });\n confirmed = answer.confirmed;\n } catch {\n // user aborted the prompt (Ctrl-C); treat as decline\n confirmed = false;\n }\n\n if (!confirmed) {\n console.error(\n `Aborted. To publish manually: npm publish --registry ${registryUrl} --tag <label>`,\n );\n process.exit(1);\n }\n\n forwardedArgs = [\"--tag\", tag, ...forwardedArgs];\n }\n }\n\n if (args.debug) {\n console.log(\n \">>> command\",\n `npm publish --registry ${registryUrl} ${forwardedArgs.join(\" \")}`,\n );\n }\n\n console.log(`Publishing to ${registryUrl}...`);\n const result = await npmPublish({\n registryUrl,\n cwd: projectPath,\n args: forwardedArgs,\n authToken,\n });\n if (result.stdout) {\n console.log(result.stdout);\n }\n\n process.exit(0);\n },\n});\n","import { registryLoginArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const registryLogin = command({\n name: \"registry-login\",\n description: `\nLog in to a Powerhouse registry using your Renown identity. Mints a longer-lived\nbearer token (default 30 days) bound to the registry's audience and writes the\ntoken into ~/.npmrc so raw 'npm publish' / 'npm install' work without further\nsetup.\n\nPrerequisites:\n Run 'ph login' first to establish a Renown identity.\n\nUsage:\n ph registry-login # uses powerhouse.config.json / PH_REGISTRY_URL\n ph registry-login --registry https://registry.vetra.io\n ph registry-login --expiry 7d\n `,\n args: registryLoginArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const { getPowerhouseProjectInfo } =\n await import(\"@powerhousedao/shared/clis\");\n const projectInfo = await getPowerhouseProjectInfo().catch(() => null);\n const projectPath = projectInfo?.projectPath ?? process.cwd();\n\n const [\n { resolveRegistryUrl, writeRegistryAuthToken },\n { mintRegistryAuthToken },\n { parseExpiry, formatExpiry },\n ] = await Promise.all([\n import(\"@powerhousedao/shared/registry\"),\n import(\"../services/registry-auth.js\"),\n import(\"@renown/sdk/node\"),\n ]);\n\n const registryUrl = resolveRegistryUrl({\n registry: args.registry,\n projectPath,\n });\n\n const expiresIn = parseExpiry(args.expiry);\n\n const token = await mintRegistryAuthToken(registryUrl, expiresIn);\n const npmrcPath = await writeRegistryAuthToken(registryUrl, token);\n\n console.log(`Logged in to ${registryUrl}`);\n console.log(` Token expires in: ${formatExpiry(expiresIn)}`);\n console.log(` Wrote: ${npmrcPath}`);\n process.exit(0);\n },\n});\n","import {\n boolean,\n command,\n flag,\n option,\n optional,\n positional,\n string,\n} from \"cmd-ts\";\n\nexport const runHost = command({\n name: \"run\",\n description:\n \"Run a host from the project's hosts/ folder: `ph run <host> [verb]`. \" +\n \"The host's own host.js names the runner module; the verb defaults to `run`. \" +\n \"Part of uniform-runners (FEATURE_UNIFORM_RUNNERS_ENABLED).\",\n args: {\n host: positional({\n type: string,\n displayName: \"host\",\n description: \"Folder name under hosts/ (e.g. vetra, connect).\",\n }),\n verb: positional({\n type: optional(string),\n displayName: \"verb\",\n description: \"Runner verb (default: run; e.g. dev, build, serve).\",\n }),\n debug: flag({\n type: optional(boolean),\n long: \"debug\",\n description: \"Print resolved host/runner/verb before dispatch.\",\n }),\n explain: option({\n type: optional(string),\n long: \"explain\",\n description:\n \"Explain a resolved aspect instead of running: `--explain drives` \" +\n \"prints the merged drive plan with provenance; `--explain outputs` \" +\n \"prints what each host produces, the output tokens it reads and \" +\n \"the start order they imply.\",\n }),\n },\n handler: async (args) => {\n if (args.explain !== undefined) {\n const { explainHost } = await import(\"../services/run/explain.js\");\n await explainHost({ host: args.host, topic: args.explain });\n return;\n }\n const { startRun } = await import(\"../services/run/start-run.js\");\n await startRun({ host: args.host, verb: args.verb, debug: args.debug });\n },\n});\n","import { switchboardArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const switchboard = command({\n name: \"switchboard\",\n aliases: [\"reactor\"],\n description: `\nThe switchboard command starts a local Switchboard instance, which acts as the document\nprocessing engine for Powerhouse projects. It provides the infrastructure for document\nmodels, processors, and real-time updates.\n\nThis command:\n1. Starts a local switchboard server\n2. Loads document models and processors\n3. Provides an API for document operations\n4. Enables real-time document processing\n5. Can authenticate with remote services using your identity from 'ph login'`,\n args: switchboardArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n const { basePath, dbPath, migrate, migrateStatus, reset, yes } = args;\n if (basePath) {\n process.env.BASE_PATH = basePath;\n }\n\n if (reset) {\n const { resetSwitchboardDatabase } =\n await import(\"../services/switchboard-reset.js\");\n await resetSwitchboardDatabase({ dbPath, yes });\n process.exit(0);\n }\n\n if (migrate || migrateStatus) {\n const { runSwitchboardMigrations } =\n await import(\"../services/switchboard-migrate.js\");\n await runSwitchboardMigrations({\n dbPath,\n statusOnly: migrateStatus,\n });\n process.exit(0);\n }\n\n const { startSwitchboard } = await import(\"../services/switchboard.js\");\n const { defaultDriveUrl, renown } = await startSwitchboard(args);\n console.log(\" ➜ Switchboard:\", defaultDriveUrl);\n if (renown) {\n console.log(\" ➜ Identity:\", renown.did);\n }\n },\n});\n","import { AGENTS, uninstallArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\nimport { execSync } from \"node:child_process\";\n\nexport const uninstall = command({\n name: \"uninstall\",\n aliases: [\"remove\"],\n description: `\nThe uninstall command removes Powerhouse dependencies from your project. It handles the\nremoval of packages, updates configuration files, and ensures proper cleanup.\n\nThis command:\n1. Uninstalls specified Powerhouse dependencies using your package manager\n2. Updates powerhouse.config.json to remove the dependencies\n3. Supports various uninstallation options and configurations\n4. Works with ${AGENTS.join(\", \")} package managers\n`,\n args: uninstallArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const {\n getPowerhouseProjectInfo,\n getPowerhouseProjectUninstallCommand,\n makeDependenciesWithVersions,\n } = await import(\"@powerhousedao/shared/clis\");\n\n const {\n projectPath,\n localProjectPath,\n globalProjectPath,\n packageManager,\n isGlobal,\n } = await getPowerhouseProjectInfo(args);\n\n if (!projectPath) {\n throw new Error(`Could not find project path to uninstall from`);\n }\n\n const dependenciesWithVersions = await makeDependenciesWithVersions(\n args.dependencies,\n );\n\n if (args.debug) {\n console.log(\">>> parsedDependencies\", dependenciesWithVersions);\n }\n\n if (args.debug) {\n console.log(\"\\n>>> projectInfo\", {\n localProjectPath,\n globalProjectPath,\n packageManager,\n isGlobal,\n });\n }\n\n try {\n console.log(\"Uninstalling dependencies 📦 ...\");\n const uninstallCommand = await getPowerhouseProjectUninstallCommand(\n packageManager,\n args.dependencies,\n );\n execSync(uninstallCommand, {\n stdio: \"inherit\",\n cwd: projectPath,\n });\n console.log(\"Dependency uninstalled successfully 🎉\");\n } catch (error) {\n console.error(\"❌ Failed to uninstall dependencies\");\n throw error;\n }\n\n const { removeStylesImports, updateConfigFile } =\n await import(\"../utils.js\");\n\n try {\n console.log(\"⚙️ Updating powerhouse config file...\");\n updateConfigFile(dependenciesWithVersions, projectPath, \"uninstall\");\n console.log(\"Config file updated successfully 🎉\");\n } catch (error) {\n console.error(\"❌ Failed to update config file\");\n throw error;\n }\n\n try {\n console.log(\"⚙️ Updating styles.css file...\");\n removeStylesImports(dependenciesWithVersions, projectPath);\n console.log(\"Styles file updated successfully 🎉\");\n } catch (error) {\n console.error(\"❌ Failed to update styles file\");\n throw error;\n }\n\n process.exit(0);\n },\n});\n","import { unpublishArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\nimport { createInterface } from \"node:readline/promises\";\n\nexport const unpublish = command({\n name: \"unpublish\",\n description: `\nUnpublish a package from the Powerhouse registry. This is a thin wrapper around\nnpm unpublish that automatically targets the Powerhouse registry and never\nreaches npmjs.org.\n\nForms:\n ph unpublish # unpublish <name>@<version> from cwd's package.json\n ph unpublish <name> # unpublish the whole package (all versions)\n ph unpublish <name>@<version> # unpublish a single version\n\nFlags:\n --registry <url> # override registry URL\n --yes, -y # skip the confirmation prompt\n `,\n args: unpublishArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n\n const { getPowerhouseProjectInfo } =\n await import(\"@powerhousedao/shared/clis\");\n const { projectPath } = await getPowerhouseProjectInfo();\n\n if (!projectPath) {\n throw new Error(\"Could not find project path.\");\n }\n\n const { checkNpmAuth, npmUnpublish, resolveRegistryUrl } =\n await import(\"@powerhousedao/shared/registry\");\n\n const registryUrl = resolveRegistryUrl({\n registry: args.registry,\n projectPath,\n });\n\n const spec = await resolveSpec(args.spec, projectPath);\n if (!spec) {\n console.error(\n \"No package spec provided and could not read name/version from package.json.\",\n );\n process.exit(1);\n }\n\n if (args.debug) {\n console.log(\">>> registryUrl\", registryUrl);\n console.log(\">>> spec\", spec);\n }\n\n try {\n await checkNpmAuth(registryUrl);\n } catch {\n console.error(`Not authenticated with registry: ${registryUrl}`);\n console.error(`Run: npm adduser --registry ${registryUrl}`);\n process.exit(1);\n }\n\n if (!args.yes) {\n const confirmed = await confirm(\n `Unpublish ${spec} from ${registryUrl}? [y/N] `,\n );\n if (!confirmed) {\n console.log(\"Aborted.\");\n process.exit(0);\n }\n }\n\n if (args.debug) {\n console.log(\n \">>> command\",\n `npm unpublish ${spec} --registry ${registryUrl} --force ${args.forwardedArgs.join(\" \")}`,\n );\n }\n\n console.log(`Unpublishing ${spec} from ${registryUrl}...`);\n try {\n const result = await npmUnpublish({\n registryUrl,\n cwd: projectPath,\n spec,\n args: args.forwardedArgs,\n });\n if (result.stdout) {\n console.log(result.stdout);\n }\n process.exit(0);\n } catch (err) {\n console.error(err instanceof Error ? err.message : String(err));\n process.exit(1);\n }\n },\n});\n\nasync function resolveSpec(\n explicit: string | undefined,\n projectPath: string,\n): Promise<string | null> {\n if (explicit) return explicit;\n try {\n const { readPackageSync } = await import(\"read-pkg\");\n const pkg = readPackageSync({ cwd: projectPath });\n if (!pkg.name) return null;\n return pkg.version ? `${pkg.name}@${pkg.version}` : pkg.name;\n } catch {\n return null;\n }\n}\n\nasync function confirm(prompt: string): Promise<boolean> {\n const rl = createInterface({ input: process.stdin, output: process.stdout });\n try {\n const answer = await rl.question(prompt);\n return /^y(es)?$/i.test(answer.trim());\n } finally {\n rl.close();\n }\n}\n","import { vetraArgs } from \"@powerhousedao/shared/clis/args\";\nimport { command } from \"cmd-ts\";\n\nexport const vetra = command({\n name: \"vetra\",\n description: `\nThe vetra command sets up a Vetra development environment for working with Vetra projects.\nIt starts a Vetra Switchboard and optionally Connect Studio, enabling document collaboration \nand real-time processing with a \"Vetra\" drive or connection to remote drives.\n\nThis command:\n1. Starts a Vetra Switchboard with a \"Vetra\" drive for document storage\n2. Optionally connects to remote drives instead of creating a local drive\n3. Starts Connect Studio pointing to the Switchboard for user interaction (unless disabled)\n4. Enables real-time updates, collaboration, and code generation\n\nDefault drives:\nConnect's default drives resolve to the Vetra drive (and the preview drive\nwhen using --watch), plus any drives configured under\nconnect.drives.defaultDrives in powerhouse.config.json - de-duplicated by\nURL, so configuring project drives does not cost you the Vetra drive.\nAn explicit --default-drives-url is appended to that list (de-duplicated);\nit never replaces the Vetra drive.\n`,\n args: vetraArgs,\n handler: async (args) => {\n if (args.debug) {\n console.log(args);\n }\n const { startVetra } = await import(\"../services/vetra.js\");\n await startVetra(args);\n },\n});\n","import { accessToken } from \"./access-token.js\";\nimport { build } from \"./build.js\";\nimport { connect } from \"./connect.js\";\nimport { generate } from \"./generate.js\";\nimport { host } from \"./host.js\";\nimport { init } from \"./init.js\";\nimport { inspect } from \"./inspect.js\";\nimport { install } from \"./install.js\";\nimport { list } from \"./list.js\";\nimport { login } from \"./login.js\";\nimport { logout } from \"./logout.js\";\nimport { migrate } from \"./migrate.js\";\nimport { publish } from \"./publish.js\";\nimport { registryLogin } from \"./registry-login.js\";\nimport { runHost } from \"./run.js\";\nimport { switchboard } from \"./switchboard.js\";\nimport { uninstall } from \"./uninstall.js\";\nimport { unpublish } from \"./unpublish.js\";\nimport { vetra } from \"./vetra.js\";\nimport { isUniformRunnersEnabled } from \"../utils/feature-flags.js\";\n\nconst baseCommands = {\n init,\n generate,\n vetra,\n connect,\n build,\n publish,\n unpublish,\n \"access-token\": accessToken,\n \"registry-login\": registryLogin,\n inspect,\n list,\n migrate,\n switchboard,\n login,\n logout,\n install,\n uninstall,\n} as const;\n\n/** Exported for tests; the flag decides whether `run` and `host` are\n * registered at all, so flag-off keeps the command surface byte-identical. */\nexport function buildPhCliCommands(uniformRunners: boolean) {\n return uniformRunners\n ? { ...baseCommands, run: runHost, host }\n : baseCommands;\n}\n\nexport const phCliCommands = buildPhCliCommands(isUniformRunnersEnabled());\n"],"names":["build","path"],"mappings":";;;;;;;;;;;;;;;AAIA,MAAa,cAAc,QAAQ;CACjC,MAAM;CACN,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Cb,MAAM;CACN,SAAS,OAAO,SAAS;EACvB,IAAI,KAAK,OACP,QAAQ,IAAI,IAAI;EAGlB,MAAM,EAAE,qBAAqB,aAAa,iBACxC,MAAM,OAAO;EACf,MAAM,EAAE,cAAc,MAAM,OAAO;EACnC,MAAM,SAAS,MAAM,UAAU;EAE/B,IAAI,YAAY;EAChB,IAAI,KAAK,QAAQ,YAAY,YAAY,KAAK,MAAM;EAEpD,MAAM,SAAS,MAAM,oBAAoB,QAAQ;GAC/C;GACA,KAAK,KAAK;EACZ,CAAC;EAGD,QAAQ,MAAM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ACA,aACwB;CACxB,IAAI,UAAU,OAAO;CACrB,IAAI;EACF,MAAM,EAAE,oBAAoB,MAAM,OAAO;EACzC,MAAM,MAAM,gBAAgB,EAAE,KAAK,YAAY,CAAC;EAChD,IAAI,CAAC,IAAI,MAAM,OAAO;EACtB,OAAO,IAAI,UAAU,GAAG,IAAI,KAAK,GAAG,IAAI,YAAY,IAAI;CAC1D,QAAQ;EACN,OAAO;CACT;AACF;AAEA,eAAe,QAAQ,QAAkC;CACvD,MAAM,KAAK,gBAAgB;EAAE,OAAO,QAAQ;EAAO,QAAQ,QAAQ;CAAO,CAAC;CAC3E,IAAI;EACF,MAAM,SAAS,MAAM,GAAG,SAAS,MAAM;EACvC,OAAO,YAAY,KAAK,OAAO,KAAK,CAAC;CACvC,UAAU;EACR,GAAG,MAAM;CACX;AACF;;;AErGA,MAAM,eAAe;CACnB;CACA;CACA,ODrBmB,QAAQ;EAC3B,MAAM;EACN,aAAa;;;;;;;;;;;;;;;;;;;EAmBb,MAAM;EACN,SAAS,OAAO,SAAS;GACvB,IAAI,KAAK,OACP,QAAQ,IAAI,IAAI;GAElB,MAAM,EAAE,eAAe,MAAM,OAAO;GACpC,MAAM,WAAW,IAAI;EACvB;CACF,CCRE;CACA;CACA,OAAA;CACA;CACA;CACA,gBAAgB;CAChB,kBAAkB;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;AAIA,SAAgB,mBAAmB,gBAAyB;CAC1D,OAAO,iBACH;EAAE,GAAG;EAAc,KAAK;EAAS;CAAK,IACtC;AACN;AAEA,MAAa,gBAAgB,mBAAmB,wBAAwB,CAAC","debug_id":"2189449f-38cd-525a-aa0a-486e715e93b2"}
@@ -1,6 +1,6 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1bd5695b-e1c9-5711-975b-0a5d9be79379")}catch(e){}}();
3
- import { T as probeHostsFolder } from "./compound-B6RZMA0Y-Cv3XMQ3Y.mjs";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1cc76a3a-699a-5bdc-91c2-3c74288af30d")}catch(e){}}();
3
+ import { I as probeHostsFolder } from "./compound-Gjt5rBfF-BmSW1XPB.mjs";
4
4
  //#region src/utils/run-sugar.ts
5
5
  /**
6
6
  * `ph <host-name> [verb]` sugar: when the first arg is not a registered
@@ -35,5 +35,5 @@ function applyRunSugar(args, knownCommands, projectRoot) {
35
35
  //#endregion
36
36
  export { applyRunSugar };
37
37
 
38
- //# sourceMappingURL=run-sugar-Ns53R6lU.mjs.map
39
- //# debugId=1bd5695b-e1c9-5711-975b-0a5d9be79379
38
+ //# sourceMappingURL=run-sugar-BJxPKwlM.mjs.map
39
+ //# debugId=1cc76a3a-699a-5bdc-91c2-3c74288af30d
@@ -1 +1 @@
1
- {"version":3,"file":"run-sugar-Ns53R6lU.mjs","sources":["../src/utils/run-sugar.ts"],"sourcesContent":["import { probeHostsFolder } from \"@powerhousedao/host-core\";\n\nexport interface RunSugarResult {\n args: string[];\n /** Set when hosts/ exists but is empty — the guard state: warn loudly, stay legacy. */\n warning?: string;\n}\n\n/**\n * `ph <host-name> [verb]` sugar: when the first arg is not a registered\n * command and names a host in the project's hosts/ folder, splice in `run`\n * (mirrors the connect→`connect studio` default-subcommand rewrite).\n * Built-in commands win collisions by construction — the known-command check\n * runs first. Callers only invoke this when the uniform-runners flag is on.\n */\n/** Classic commands that route through `ph run` in a hosts project — BARE\n * invocations only: extra flags are not representable on `ph run` yet, and\n * the classic path calls the same service, so flagged invocations stay\n * classic until the host-core compound takes over (phase 1). */\nconst CLASSIC_ALIASES = new Set([\"vetra\"]);\n\nexport function applyRunSugar(\n args: string[],\n knownCommands: ReadonlySet<string>,\n projectRoot: string,\n): RunSugarResult {\n const first = args[0];\n if (!first || first.startsWith(\"-\")) {\n return { args };\n }\n if (knownCommands.has(first)) {\n if (CLASSIC_ALIASES.has(first) && args.length === 1) {\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", first] };\n }\n }\n return { args };\n }\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"empty\") {\n return {\n args,\n warning:\n `hosts/ exists at ${probe.dir} but contains no <name>/host.js — ` +\n \"uniform-runners stays inactive (legacy command handling).\",\n };\n }\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", ...args] };\n }\n return { args };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAM,kCAAkB,IAAI,IAAI,CAAC,OAAO,CAAC;AAEzC,SAAgB,cACd,MACA,eACA,aACgB;CAChB,MAAM,QAAQ,KAAK;CACnB,IAAI,CAAC,SAAS,MAAM,WAAW,GAAG,GAChC,OAAO,EAAE,KAAK;CAEhB,IAAI,cAAc,IAAI,KAAK,GAAG;EAC5B,IAAI,gBAAgB,IAAI,KAAK,KAAK,KAAK,WAAW,GAAG;GACnD,MAAM,QAAQ,iBAAiB,WAAW;GAC1C,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,EAAE;EAElC;EACA,OAAO,EAAE,KAAK;CAChB;CACA,MAAM,QAAQ,iBAAiB,WAAW;CAC1C,IAAI,MAAM,SAAS,SACjB,OAAO;EACL;EACA,SACE,oBAAoB,MAAM,IAAI;CAElC;CAEF,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,EAAE;CAElC,OAAO,EAAE,KAAK;AAChB","debug_id":"1bd5695b-e1c9-5711-975b-0a5d9be79379"}
1
+ {"version":3,"file":"run-sugar-BJxPKwlM.mjs","sources":["../src/utils/run-sugar.ts"],"sourcesContent":["import { probeHostsFolder } from \"@powerhousedao/host-core\";\n\nexport interface RunSugarResult {\n args: string[];\n /** Set when hosts/ exists but is empty — the guard state: warn loudly, stay legacy. */\n warning?: string;\n}\n\n/**\n * `ph <host-name> [verb]` sugar: when the first arg is not a registered\n * command and names a host in the project's hosts/ folder, splice in `run`\n * (mirrors the connect→`connect studio` default-subcommand rewrite).\n * Built-in commands win collisions by construction — the known-command check\n * runs first. Callers only invoke this when the uniform-runners flag is on.\n */\n/** Classic commands that route through `ph run` in a hosts project — BARE\n * invocations only: extra flags are not representable on `ph run` yet, and\n * the classic path calls the same service, so flagged invocations stay\n * classic until the host-core compound takes over (phase 1). */\nconst CLASSIC_ALIASES = new Set([\"vetra\"]);\n\nexport function applyRunSugar(\n args: string[],\n knownCommands: ReadonlySet<string>,\n projectRoot: string,\n): RunSugarResult {\n const first = args[0];\n if (!first || first.startsWith(\"-\")) {\n return { args };\n }\n if (knownCommands.has(first)) {\n if (CLASSIC_ALIASES.has(first) && args.length === 1) {\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", first] };\n }\n }\n return { args };\n }\n const probe = probeHostsFolder(projectRoot);\n if (probe.kind === \"empty\") {\n return {\n args,\n warning:\n `hosts/ exists at ${probe.dir} but contains no <name>/host.js — ` +\n \"uniform-runners stays inactive (legacy command handling).\",\n };\n }\n if (probe.kind === \"present\" && probe.hosts.includes(first)) {\n return { args: [\"run\", ...args] };\n }\n return { args };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAM,kCAAkB,IAAI,IAAI,CAAC,OAAO,CAAC;AAEzC,SAAgB,cACd,MACA,eACA,aACgB;CAChB,MAAM,QAAQ,KAAK;CACnB,IAAI,CAAC,SAAS,MAAM,WAAW,GAAG,GAChC,OAAO,EAAE,KAAK;CAEhB,IAAI,cAAc,IAAI,KAAK,GAAG;EAC5B,IAAI,gBAAgB,IAAI,KAAK,KAAK,KAAK,WAAW,GAAG;GACnD,MAAM,QAAQ,iBAAiB,WAAW;GAC1C,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,EAAE;EAElC;EACA,OAAO,EAAE,KAAK;CAChB;CACA,MAAM,QAAQ,iBAAiB,WAAW;CAC1C,IAAI,MAAM,SAAS,SACjB,OAAO;EACL;EACA,SACE,oBAAoB,MAAM,IAAI;CAElC;CAEF,IAAI,MAAM,SAAS,aAAa,MAAM,MAAM,SAAS,KAAK,GACxD,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,EAAE;CAElC,OAAO,EAAE,KAAK;AAChB","debug_id":"1cc76a3a-699a-5bdc-91c2-3c74288af30d"}
@@ -1,4 +1,4 @@
1
- import { C as ZodUnknown, E as $strict, S as ZodUnion, T as $loose, _ as ZodObject, a as RunnerContext, b as ZodString, c as external_d_exports, d as ZodArray, f as ZodBoolean, g as ZodNumber, h as ZodNullable, i as OutputToken, l as input, m as ZodLiteral, n as EnvToken, o as RunnerHandle, p as ZodEnum, r as ItemToken, s as TokenableSchema, t as ConcatToken, u as output, v as ZodOptional, w as output$1, x as ZodURL, y as ZodRecord } from "../index-BIbx17vt.mjs";
1
+ import { C as ZodURL, D as $loose, E as output$1, O as $strict, S as ZodString, T as ZodUnknown, _ as ZodNullable, a as ItemToken, b as ZodOptional, c as RunnerHandle, d as input, f as output, g as ZodLiteral, h as ZodEnum, i as EnvToken, l as TokenableSchema, m as ZodBoolean, o as OutputToken, p as ZodArray, r as ConcatToken, s as RunnerContext, u as external_d_exports, v as ZodNumber, w as ZodUnion, x as ZodRecord, y as ZodObject } from "../index-7hbcAZpm.mjs";
2
2
  import { PHConnectRuntimeConfig } from "@powerhousedao/shared/clis";
3
3
  //#region src/runners/connect.d.ts
4
4
  /**
@@ -1,8 +1,8 @@
1
1
 
2
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]="7cd9d76a-0126-553f-ac1f-1cdb2d9cc69e")}catch(e){}}();
3
3
  import { c as strictObject, f as url, i as literal, l as string, r as boolean, u as union } from "../schemas-D5N5U_Mf.mjs";
4
- import { c as defineHostSchemas, d as entryActiveForVerb, p as findDeadConnectConfig, x as normalizePluginEntries } from "../compound-B6RZMA0Y-Cv3XMQ3Y.mjs";
5
- import { c as projectReactorToConnect, d as remoteBackendUrls, f as resolveDriveDeclaration, i as mergeDefaultDrives, r as isStructuralMultiReactor, s as projectDrivesIntoConnect } from "../dist-CCLkwpTS.mjs";
4
+ import { _ as findDeadConnectConfig, f as defineHostSchemas, h as entryActiveForVerb, j as normalizePluginEntries } from "../compound-Gjt5rBfF-BmSW1XPB.mjs";
5
+ import { a as mergeDefaultDrives, c as projectDrivesIntoConnect, i as isStructuralMultiReactor, l as projectReactorToConnect, m as resolveDriveDeclaration, p as remoteBackendUrls } from "../dist-BVqNlv1z.mjs";
6
6
  import { join } from "node:path";
7
7
  import { DEFAULT_CONNECT_OUTDIR, DEFAULT_CONNECT_STUDIO_PORT } from "@powerhousedao/shared/clis";
8
8
  import { connectConfigSchemaWith } from "@powerhousedao/shared/connect/connect-config-schema";
@@ -193,7 +193,7 @@ async function startUnderSupervisor(ctx, start) {
193
193
  /** Fail at `ph run`, naming the plugin and key, when a composed Connect
194
194
  * plugin's entry config does not match its schema. */
195
195
  async function validateComposition(host, ctx) {
196
- const { validateConnectPluginConfigs } = await import("../connect-plugin-configs-D2fwYpMw.mjs");
196
+ const { validateConnectPluginConfigs } = await import("../connect-plugin-configs-BwYEbQSY.mjs");
197
197
  await validateConnectPluginConfigs(ctx.projectRoot, host.runner.plugins, ctx.verb, `hosts/${host.name}/host.js`);
198
198
  }
199
199
  /** A project file the build resolved: the built dist has it (as icon.ico or
@@ -216,7 +216,7 @@ function withoutBuiltImages(config) {
216
216
  const viteCacheOf = (host, ctx) => join(ctx.projectRoot, "node_modules", `.vite-${host.name.replace(/[^\w.-]/g, "_")}`);
217
217
  async function dev(host, ctx) {
218
218
  await validateComposition(host, ctx);
219
- const { runConnectStudio } = await import("../connect-studio-BS26pchr.mjs");
219
+ const { runConnectStudio } = await import("../connect-studio-Co_UNyEC.mjs");
220
220
  const args = toStudioArgs(host);
221
221
  return connectHandle(await startUnderSupervisor(ctx, () => runConnectStudio(args, void 0, callerOverride(host, ctx, ctx.verb), {
222
222
  routes: host.runner.routes,
@@ -232,7 +232,7 @@ const run = dev;
232
232
  /** P3.3 — `build`: the SAME service as classic `ph connect build`. */
233
233
  async function build(host, ctx) {
234
234
  await validateComposition(host, ctx);
235
- const { runConnectBuild } = await import("../connect-build-BfhOGbha.mjs");
235
+ const { runConnectBuild } = await import("../connect-build-B5nYqlLc.mjs");
236
236
  await runConnectBuild({ outDir: host.runner.outDir ?? DEFAULT_CONNECT_OUTDIR }, callerOverride(host, ctx, ctx.verb), { routes: host.runner.routes });
237
237
  }
238
238
  /** P3.3 — `serve`: the SAME vite preview server as classic
@@ -1,4 +1,4 @@
1
- import { C as ZodUnknown, E as $strict, S as ZodUnion, T as $loose, _ as ZodObject, a as RunnerContext, b as ZodString, c as external_d_exports, d as ZodArray, f as ZodBoolean, g as ZodNumber, l as input, m as ZodLiteral, n as EnvToken, o as RunnerHandle, p as ZodEnum, s as TokenableSchema, u as output, v as ZodOptional, w as output$1, x as ZodURL, y as ZodRecord } from "../index-BIbx17vt.mjs";
1
+ import { C as ZodURL, D as $loose, E as output$1, O as $strict, S as ZodString, T as ZodUnknown, b as ZodOptional, c as RunnerHandle, d as input, f as output, g as ZodLiteral, h as ZodEnum, i as EnvToken, l as TokenableSchema, m as ZodBoolean, n as BootIssue, p as ZodArray, s as RunnerContext, t as BootCheckContext, u as external_d_exports, v as ZodNumber, w as ZodUnion, x as ZodRecord, y as ZodObject } from "../index-7hbcAZpm.mjs";
2
2
  import { ParsedCmdResult } from "@powerhousedao/shared/clis";
3
3
  //#region src/commands/switchboard.d.ts
4
4
  declare const switchboard: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
@@ -332,6 +332,8 @@ export type SwitchboardHandle = RunnerHandle<SwitchboardOutputs>;
332
332
  export declare function run(host: SwitchboardHostParsed, ctx: RunnerContext): Promise<SwitchboardHandle>;
333
333
  export declare const serve: typeof run;
334
334
  export declare function dev(host: SwitchboardHostParsed, ctx: RunnerContext): Promise<SwitchboardHandle>;
335
+ /** What the server would refuse at boot for this host, `ctx.verb` and `ctx.env` (`ph host check`). */
336
+ export declare function checkBoot(host: SwitchboardHostParsed, ctx: BootCheckContext): Promise<BootIssue[]>;
335
337
  /** Build the project's reactor package (the SAME service as `ph build`) — what
336
338
  * this switchboard serves. Starts no server; orthogonal to run/serve/dev. */
337
339
  export declare function build(host: SwitchboardHostParsed, _ctx: RunnerContext): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"switchboard.d.mts","names":[],"sources":["../../src/commands/switchboard.ts","../../src/types.ts","../../src/runners/switchboard.ts"],"mappings":";;;cAGa,aAAW,+CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDtB,6CAAA,iDAAA,mDAAA;;;KCWU,kBAAkB,uBAAuB;;;;;;;;;qBCrCxC;qBAqBA,oBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6B;qBAC/C,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAqB;;YAGhC,kBAAkB,aAAe;;YAEjC,wBAAwB,cAAgB;;qBAGvC,8BAA4B;;;GAGvC;;;;;;;qBAQW,eAAa;;;;;;;;;;GAOxB;YACU,qBAAqB,gBAAe;QAExC;YACI;IACR;MACE,MAAM;MACN,SAAS;;;;;YAMH,wBAAwB,KAAK;EACvC;;;YAwHU,oBAAoB,aAAa;wBAoNvB,IACpB,MAAM,uBACN,KAAK,gBACJ,QAAQ;qBAIE,cAAK;wBAEI,IACpB,MAAM,uBACN,KAAK,gBACJ,QAAQ;;;wBAMW,MACpB,MAAM,uBACN,MAAM,gBACL"}
1
+ {"version":3,"file":"switchboard.d.mts","names":[],"sources":["../../src/commands/switchboard.ts","../../src/types.ts","../../src/runners/switchboard.ts"],"mappings":";;;cAGa,aAAW,+CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDtB,6CAAA,iDAAA,mDAAA;;;KCWU,kBAAkB,uBAAuB;;;;;;;;;qBCzBxC;qBAqBA,oBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6B;qBAC/C,YAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAqB;;YAGhC,kBAAkB,aAAe;;YAEjC,wBAAwB,cAAgB;;qBAGvC,8BAA4B;;;GAGvC;;;;;;;qBAQW,eAAa;;;;;;;;;;GAOxB;YACU,qBAAqB,gBAAe;QAExC;YACI;IACR;MACE,MAAM;MACN,SAAS;;;;;YAMH,wBAAwB,KAAK;EACvC;;;YAuHU,oBAAoB,aAAa;wBAgOvB,IACpB,MAAM,uBACN,KAAK,gBACJ,QAAQ;qBAIE,cAAK;wBAEI,IACpB,MAAM,uBACN,KAAK,gBACJ,QAAQ;;wBAKW,UACpB,MAAM,uBACN,KAAK,mBACJ,QAAQ;;;wBA6BW,MACpB,MAAM,uBACN,MAAM,gBACL"}