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

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 (45) hide show
  1. package/dist/build-CTvPQFMi.mjs +4 -0
  2. package/dist/{build-D0PTejWA.mjs → build-sO3PcZxl.mjs} +4 -4
  3. package/dist/{build-D0PTejWA.mjs.map → build-sO3PcZxl.mjs.map} +1 -1
  4. package/dist/{cli-connect-override-Bo7L7mwc.mjs → cli-connect-override-b4kKqgOZ.mjs} +19 -21
  5. package/dist/cli-connect-override-b4kKqgOZ.mjs.map +1 -0
  6. package/dist/cli.mjs +36 -29
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/{connect-build-BVDpTJnS.mjs → connect-build-BMaR9w4G.mjs} +5 -5
  9. package/dist/{connect-build-BVDpTJnS.mjs.map → connect-build-BMaR9w4G.mjs.map} +1 -1
  10. package/dist/{connect-config-C70IXUh6.mjs → connect-config-_kiSMsbG.mjs} +12 -9
  11. package/dist/connect-config-_kiSMsbG.mjs.map +1 -0
  12. package/dist/{connect-studio-BDkYXCvz.mjs → connect-studio-_-O1-oef.mjs} +4 -4
  13. package/dist/{connect-studio-BDkYXCvz.mjs.map → connect-studio-_-O1-oef.mjs.map} +1 -1
  14. package/dist/{connect-studio-r_ikfhOR.mjs → connect-studio-f3K1qPWd.mjs} +3 -3
  15. package/dist/{generate-piece-BHBXK1_P.mjs → generate-piece-QTt-ddt2.mjs} +8 -7
  16. package/dist/generate-piece-QTt-ddt2.mjs.map +1 -0
  17. package/dist/{generate-piece-action-Byk-BmYt.mjs → generate-piece-action-C5WTHsqu.mjs} +6 -4
  18. package/dist/generate-piece-action-C5WTHsqu.mjs.map +1 -0
  19. package/dist/{generate-piece-trigger-CmPqKZej.mjs → generate-piece-trigger-DR10CPOG.mjs} +6 -4
  20. package/dist/generate-piece-trigger-DR10CPOG.mjs.map +1 -0
  21. package/dist/{generate-processor-FprZJIKD.mjs → generate-processor-DBtTkgo5.mjs} +6 -4
  22. package/dist/generate-processor-DBtTkgo5.mjs.map +1 -0
  23. package/dist/{generate-subgraph-DNwL9vDs.mjs → generate-subgraph-Dm27O59o.mjs} +6 -4
  24. package/dist/generate-subgraph-Dm27O59o.mjs.map +1 -0
  25. package/dist/install-added-dependencies-DVSbzler.mjs +33 -0
  26. package/dist/install-added-dependencies-DVSbzler.mjs.map +1 -0
  27. package/dist/{migrate-ORExpVlJ.mjs → migrate-B6QBYDNX.mjs} +4 -4
  28. package/dist/{migrate-ORExpVlJ.mjs.map → migrate-B6QBYDNX.mjs.map} +1 -1
  29. package/dist/{switchboard-B8CCCZCB.mjs → switchboard-CgVB4U76.mjs} +12 -4
  30. package/dist/switchboard-CgVB4U76.mjs.map +1 -0
  31. package/dist/switchboard-nHCI3pha.mjs +4 -0
  32. package/dist/{vetra-DhhT9bQB.mjs → vetra-s8gWslse.mjs} +50 -15
  33. package/dist/vetra-s8gWslse.mjs.map +1 -0
  34. package/package.json +11 -11
  35. package/dist/build-BolXfpNU.mjs +0 -4
  36. package/dist/cli-connect-override-Bo7L7mwc.mjs.map +0 -1
  37. package/dist/connect-config-C70IXUh6.mjs.map +0 -1
  38. package/dist/generate-piece-BHBXK1_P.mjs.map +0 -1
  39. package/dist/generate-piece-action-Byk-BmYt.mjs.map +0 -1
  40. package/dist/generate-piece-trigger-CmPqKZej.mjs.map +0 -1
  41. package/dist/generate-processor-FprZJIKD.mjs.map +0 -1
  42. package/dist/generate-subgraph-DNwL9vDs.mjs.map +0 -1
  43. package/dist/switchboard-B8CCCZCB.mjs.map +0 -1
  44. package/dist/switchboard-C5AOMSKA.mjs +0 -4
  45. package/dist/vetra-DhhT9bQB.mjs.map +0 -1
@@ -0,0 +1,4 @@
1
+ import { n as runBuild } from "./build-sO3PcZxl.mjs";
2
+ export { runBuild };
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]="f6211701-9003-5253-a7ec-4e7588bf768f")}catch(e){}}();
4
+ //# debugId=f6211701-9003-5253-a7ec-4e7588bf768f
@@ -1,12 +1,12 @@
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]="5cc68d1d-684f-5837-9634-6c9ed8564af2")}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]="50b5ce1d-8048-5eb0-bcaf-e4e24228a0c0")}catch(e){}}();
3
3
  import { execSync } from "node:child_process";
4
+ import { detect, resolveCommand } from "package-manager-detector";
4
5
  import { browserEntry, buildBrowserBuildConfig, buildNodeBuildConfig, findBundledSharedDeps } from "@powerhousedao/shared/build-config";
5
6
  import { assertPiecesOutDir, buildPieces, expandEntryGlobs, pieceListPath, planPieces, syncDistManifest } from "@powerhousedao/shared/build-pieces";
6
7
  import { EXTERNALIZABLE_SHARED_SPECIFIERS, findSharedImports } from "@powerhousedao/shared/connect";
7
8
  import { existsSync, readFileSync, readdirSync } from "node:fs";
8
9
  import { join } from "node:path";
9
- import { detect, resolveCommand } from "package-manager-detector";
10
10
  import { readPackage } from "read-pkg";
11
11
  import { build } from "tsdown";
12
12
  //#region src/services/build.ts
@@ -162,5 +162,5 @@ function readDistBrowserFiles(dir) {
162
162
  //#endregion
163
163
  export { runBuild as n, assertManifestNameMatchesPackage as t };
164
164
 
165
- //# sourceMappingURL=build-D0PTejWA.mjs.map
166
- //# debugId=5cc68d1d-684f-5837-9634-6c9ed8564af2
165
+ //# sourceMappingURL=build-sO3PcZxl.mjs.map
166
+ //# debugId=50b5ce1d-8048-5eb0-bcaf-e4e24228a0c0
@@ -1 +1 @@
1
- {"version":3,"file":"build-D0PTejWA.mjs","sources":["../src/services/build.ts"],"sourcesContent":["import {\n browserEntry,\n buildBrowserBuildConfig,\n buildNodeBuildConfig,\n findBundledSharedDeps,\n} from \"@powerhousedao/shared/build-config\";\nimport type { BuiltPiece } from \"@powerhousedao/shared/build-pieces\";\nimport {\n assertPiecesOutDir,\n buildPieces,\n expandEntryGlobs,\n pieceListPath,\n planPieces,\n syncDistManifest,\n} from \"@powerhousedao/shared/build-pieces\";\nimport {\n findSharedImports,\n EXTERNALIZABLE_SHARED_SPECIFIERS,\n} from \"@powerhousedao/shared/connect\";\nimport { execSync } from \"node:child_process\";\nimport { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { detect, resolveCommand, type Agent } from \"package-manager-detector\";\nimport { readPackage } from \"read-pkg\";\nimport { build as tsdownBuild } from \"tsdown\";\nimport type { BuildArgs } from \"../types.js\";\n\n/**\n * A Powerhouse package's `powerhouse.manifest.json` \"name\" must match its\n * `package.json` \"name\" — Connect and the registry resolve installed versions\n * by treating the manifest name as the npm package name, so a mismatch silently\n * breaks resolution. Fail the build early if they diverge. No-op when the\n * project has no manifest (nothing to compare).\n */\nexport async function assertManifestNameMatchesPackage(projectPath: string) {\n const manifestPath = join(projectPath, \"powerhouse.manifest.json\");\n if (!existsSync(manifestPath)) return;\n\n const { name: packageName } = await readPackage({ cwd: projectPath });\n\n let manifestName: unknown;\n try {\n manifestName = (\n JSON.parse(readFileSync(manifestPath, \"utf-8\")) as { name?: unknown }\n ).name;\n } catch {\n throw new Error(\n `Failed to parse \"powerhouse.manifest.json\" at ${manifestPath}. Make sure it is valid JSON.`,\n );\n }\n\n if (manifestName !== packageName) {\n throw new Error(\n `Package name mismatch — \"package.json\" and \"powerhouse.manifest.json\" must have the same \"name\":\\n` +\n ` package.json \"name\": ${JSON.stringify(packageName)}\\n` +\n ` powerhouse.manifest.json \"name\": ${JSON.stringify(manifestName)}\\n\\n` +\n `Update one so they match, then run the build again.`,\n );\n }\n}\n\nexport async function runBuild(args: BuildArgs) {\n const { outDir } = args;\n const projectRoot = process.cwd();\n\n // Fail fast if the manifest name and package.json name have drifted apart.\n await assertManifestNameMatchesPackage(projectRoot);\n\n const target = {\n projectRoot,\n outDir,\n pieces: planPieces(projectRoot, outDir),\n };\n // Before any bundler runs: an out-dir a host will never read from is worth\n // nothing built, and the failure names what the contract is.\n assertPiecesOutDir(target);\n const sharedDeps = !args.noSharedDeps;\n\n const detectResult = await detect();\n const agent = detectResult?.agent ?? \"npm\";\n\n // Before any bundler runs, so declining leaves nothing half built.\n const typesOk = emitTypes(agent, outDir);\n if (!typesOk && !args.ignoreTypeErrors) {\n await confirmBuildDespiteTypeErrors();\n }\n\n await tsdownBuild({\n ...buildBrowserBuildConfig({ sharedDeps }),\n outDir: join(outDir, \"browser\"),\n });\n\n // Advisory: a shared dep the source imports but the output no longer\n // references as a bare import was inlined despite the external set.\n if (sharedDeps) {\n const imported = findSharedImportsInSources(projectRoot, browserEntry);\n const bundled = findBundledSharedDeps(\n imported,\n readDistBrowserFiles(join(outDir, \"browser\")),\n );\n if (bundled.length > 0) {\n console.warn(\n `⚠ shared deps bundled instead of externalized: ${bundled.join(\", \")} — check your neverBundle config`,\n );\n }\n }\n\n await tsdownBuild({\n ...buildNodeBuildConfig({ sharedDeps }),\n outDir: join(outDir, \"node\"),\n });\n\n // After the node build: it cleans <outDir>/node, where the pieces land. The\n // built list is the gate, so a `bundle:` entry is validated with no piece dir.\n let built: BuiltPiece[] = [];\n if (existsSync(pieceListPath(target))) {\n const pkg = await readPackage({ cwd: projectRoot });\n built = await buildPieces(\n target,\n {\n name: pkg.name,\n version: pkg.version,\n license: typeof pkg.license === \"string\" ? pkg.license : undefined,\n },\n { bundle: tsdownBuild },\n );\n }\n syncDistManifest(target, built);\n\n const executeLocalCommand = resolveCommand(agent, \"execute-local\", [\n \"tailwindcss\",\n \"-i\",\n \"./style.css\",\n \"-o\",\n \"./dist/style.css\",\n ]);\n if (executeLocalCommand === null) {\n console.error(\n \"You need to have tailwindcss installed to use the `build` command.\",\n );\n process.exit(1);\n }\n execSync(\n `${executeLocalCommand.command} ${executeLocalCommand.args.join(\" \")}`,\n );\n\n // Last, so it is the line a finished build leaves on screen.\n if (!typesOk) console.warn(`\\n${UNSAFE_BUILD_WARNING}`);\n}\n\n// Runs tsc, which checks the project and writes its declarations either way.\n// Returns whether it reported no type errors.\nfunction emitTypes(agent: Agent, outDir: string): boolean {\n const tscCommand = resolveCommand(agent, \"execute-local\", [\"tsc\", \"--build\"]);\n if (tscCommand === null) {\n console.error(\n \"You need to have typescript installed to use the `build` command.\",\n );\n process.exit(1);\n }\n console.log(\"\\n▶ Type-checking and emitting types via tsc...\");\n try {\n execSync(`${tscCommand.command} ${tscCommand.args.join(\" \")}`, {\n stdio: \"inherit\",\n });\n console.log(\"✔ Types emitted to\", join(outDir, \"types\"));\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isInteractive(): boolean {\n return Boolean(process.stdin.isTTY) && !process.env.CI;\n}\n\nconst TYPE_ERROR_RISK =\n \"A package built with type errors can load and still fail at runtime.\";\n\nconst UNSAFE_BUILD_WARNING =\n \"⚠ Built despite type errors. \" +\n TYPE_ERROR_RISK +\n \" Fix them before you publish or deploy it.\";\n\nasync function confirmBuildDespiteTypeErrors(): Promise<void> {\n const hint =\n \"Fix them and build again. --ignore-type-errors skips this check, at the risk of shipping that failure.\";\n if (!isInteractive()) {\n console.error(\n `\\n✘ tsc reported the type errors above. ${TYPE_ERROR_RISK}\\n${hint}`,\n );\n process.exit(1);\n }\n const enquirer = await import(\"enquirer\");\n let confirmed: boolean;\n try {\n const answer = await enquirer.default.prompt<{ confirmed: boolean }>({\n type: \"confirm\",\n name: \"confirmed\",\n message: `tsc reported the type errors above. ${TYPE_ERROR_RISK} Build anyway?`,\n initial: false,\n });\n confirmed = answer.confirmed;\n } catch {\n // Ctrl-C at the prompt is a decline.\n confirmed = false;\n }\n if (!confirmed) {\n console.error(`Build cancelled. ${hint}`);\n process.exit(1);\n }\n}\n\n/**\n * Every shared specifier imported from the entry sources; the post-build\n * scan compares these against the built output.\n *\n * Scoped to the specifiers the build actually externalizes: a specifier the\n * vendor does not publish (the bare `@powerhousedao/shared` root, an\n * unvendored subpath) is deliberately bundled, so reporting it as \"bundled\n * instead of externalized\" would be a false alarm.\n */\nfunction findSharedImportsInSources(root: string, globs: string[]): string[] {\n const found = new Set<string>();\n for (const file of expandEntryGlobs(root, globs)) {\n const src = readFileSync(file, \"utf8\");\n for (const spec of findSharedImports(\n src,\n EXTERNALIZABLE_SHARED_SPECIFIERS,\n )) {\n found.add(spec);\n }\n }\n return [...found].sort();\n}\n\n/**\n * The built JS outputs of a browser build (entry files and chunks).\n */\nfunction readDistBrowserFiles(\n dir: string,\n): { path: string; content: string }[] {\n const out: { path: string; content: string }[] = [];\n if (!existsSync(dir)) return out;\n const walk = (d: string) => {\n for (const e of readdirSync(d, { withFileTypes: true })) {\n const p = join(d, e.name);\n if (e.isDirectory()) walk(p);\n else if (e.isFile() && e.name.endsWith(\".js\")) {\n out.push({ path: p, content: readFileSync(p, \"utf8\") });\n }\n }\n };\n walk(dir);\n return out;\n}\n"],"names":["tsdownBuild"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,iCAAiC,aAAqB;CAC1E,MAAM,eAAe,KAAK,aAAa,0BAA0B;CACjE,IAAI,CAAC,WAAW,YAAY,GAAG;CAE/B,MAAM,EAAE,MAAM,gBAAgB,MAAM,YAAY,EAAE,KAAK,YAAY,CAAC;CAEpE,IAAI;CACJ,IAAI;EACF,eACE,KAAK,MAAM,aAAa,cAAc,OAAO,CAAC,CAAC,CAC/C;CACJ,QAAQ;EACN,MAAM,IAAI,MACR,iDAAiD,aAAa,8BAChE;CACF;CAEA,IAAI,iBAAiB,aACnB,MAAM,IAAI,MACR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AAS,2BAA2B,MAAc,OAA2B;CAC3E,MAAM,wBAAQ,IAAI,IAAY;CAC9B,KAAK,MAAM,QAAQ,iBAAiB,MAAM,KAAK,GAAG;EAChD,MAAM,MAAM,aAAa,MAAM,MAAM;EACrC,KAAK,MAAM,QAAQ,kBACjB,KACA,gCACF,GACE,MAAM,IAAI,IAAI;CAElB;CACA,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK;AACzB;;;;AAKA,SAAS,qBACP,KACqC;CACrC,MAAM,MAA2C,CAAC;CAClD,IAAI,CAAC,WAAW,GAAG,GAAG,OAAO;CAC7B,MAAM,QAAQ,MAAc;EAC1B,KAAK,MAAM,KAAK,YAAY,GAAG,EAAE,eAAe,KAAK,CAAC,GAAG;GACvD,MAAM,IAAI,KAAK,GAAG,EAAE,IAAI;GACxB,IAAI,EAAE,YAAY,GAAG,KAAK,CAAC;QACtB,IAAI,EAAE,OAAO,KAAK,EAAE,KAAK,SAAS,KAAK,GAC1C,IAAI,KAAK;IAAE,MAAM;IAAG,SAAS,aAAa,GAAG,MAAM;GAAE,CAAC;EAE1D;CACF;CACA,KAAK,GAAG;CACR,OAAO;AACT","debug_id":"5cc68d1d-684f-5837-9634-6c9ed8564af2"}
1
+ {"version":3,"file":"build-sO3PcZxl.mjs","sources":["../src/services/build.ts"],"sourcesContent":["import {\n browserEntry,\n buildBrowserBuildConfig,\n buildNodeBuildConfig,\n findBundledSharedDeps,\n} from \"@powerhousedao/shared/build-config\";\nimport type { BuiltPiece } from \"@powerhousedao/shared/build-pieces\";\nimport {\n assertPiecesOutDir,\n buildPieces,\n expandEntryGlobs,\n pieceListPath,\n planPieces,\n syncDistManifest,\n} from \"@powerhousedao/shared/build-pieces\";\nimport {\n findSharedImports,\n EXTERNALIZABLE_SHARED_SPECIFIERS,\n} from \"@powerhousedao/shared/connect\";\nimport { execSync } from \"node:child_process\";\nimport { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { detect, resolveCommand, type Agent } from \"package-manager-detector\";\nimport { readPackage } from \"read-pkg\";\nimport { build as tsdownBuild } from \"tsdown\";\nimport type { BuildArgs } from \"../types.js\";\n\n/**\n * A Powerhouse package's `powerhouse.manifest.json` \"name\" must match its\n * `package.json` \"name\" — Connect and the registry resolve installed versions\n * by treating the manifest name as the npm package name, so a mismatch silently\n * breaks resolution. Fail the build early if they diverge. No-op when the\n * project has no manifest (nothing to compare).\n */\nexport async function assertManifestNameMatchesPackage(projectPath: string) {\n const manifestPath = join(projectPath, \"powerhouse.manifest.json\");\n if (!existsSync(manifestPath)) return;\n\n const { name: packageName } = await readPackage({ cwd: projectPath });\n\n let manifestName: unknown;\n try {\n manifestName = (\n JSON.parse(readFileSync(manifestPath, \"utf-8\")) as { name?: unknown }\n ).name;\n } catch {\n throw new Error(\n `Failed to parse \"powerhouse.manifest.json\" at ${manifestPath}. Make sure it is valid JSON.`,\n );\n }\n\n if (manifestName !== packageName) {\n throw new Error(\n `Package name mismatch — \"package.json\" and \"powerhouse.manifest.json\" must have the same \"name\":\\n` +\n ` package.json \"name\": ${JSON.stringify(packageName)}\\n` +\n ` powerhouse.manifest.json \"name\": ${JSON.stringify(manifestName)}\\n\\n` +\n `Update one so they match, then run the build again.`,\n );\n }\n}\n\nexport async function runBuild(args: BuildArgs) {\n const { outDir } = args;\n const projectRoot = process.cwd();\n\n // Fail fast if the manifest name and package.json name have drifted apart.\n await assertManifestNameMatchesPackage(projectRoot);\n\n const target = {\n projectRoot,\n outDir,\n pieces: planPieces(projectRoot, outDir),\n };\n // Before any bundler runs: an out-dir a host will never read from is worth\n // nothing built, and the failure names what the contract is.\n assertPiecesOutDir(target);\n const sharedDeps = !args.noSharedDeps;\n\n const detectResult = await detect();\n const agent = detectResult?.agent ?? \"npm\";\n\n // Before any bundler runs, so declining leaves nothing half built.\n const typesOk = emitTypes(agent, outDir);\n if (!typesOk && !args.ignoreTypeErrors) {\n await confirmBuildDespiteTypeErrors();\n }\n\n await tsdownBuild({\n ...buildBrowserBuildConfig({ sharedDeps }),\n outDir: join(outDir, \"browser\"),\n });\n\n // Advisory: a shared dep the source imports but the output no longer\n // references as a bare import was inlined despite the external set.\n if (sharedDeps) {\n const imported = findSharedImportsInSources(projectRoot, browserEntry);\n const bundled = findBundledSharedDeps(\n imported,\n readDistBrowserFiles(join(outDir, \"browser\")),\n );\n if (bundled.length > 0) {\n console.warn(\n `⚠ shared deps bundled instead of externalized: ${bundled.join(\", \")} — check your neverBundle config`,\n );\n }\n }\n\n await tsdownBuild({\n ...buildNodeBuildConfig({ sharedDeps }),\n outDir: join(outDir, \"node\"),\n });\n\n // After the node build: it cleans <outDir>/node, where the pieces land. The\n // built list is the gate, so a `bundle:` entry is validated with no piece dir.\n let built: BuiltPiece[] = [];\n if (existsSync(pieceListPath(target))) {\n const pkg = await readPackage({ cwd: projectRoot });\n built = await buildPieces(\n target,\n {\n name: pkg.name,\n version: pkg.version,\n license: typeof pkg.license === \"string\" ? pkg.license : undefined,\n },\n { bundle: tsdownBuild },\n );\n }\n syncDistManifest(target, built);\n\n const executeLocalCommand = resolveCommand(agent, \"execute-local\", [\n \"tailwindcss\",\n \"-i\",\n \"./style.css\",\n \"-o\",\n \"./dist/style.css\",\n ]);\n if (executeLocalCommand === null) {\n console.error(\n \"You need to have tailwindcss installed to use the `build` command.\",\n );\n process.exit(1);\n }\n execSync(\n `${executeLocalCommand.command} ${executeLocalCommand.args.join(\" \")}`,\n );\n\n // Last, so it is the line a finished build leaves on screen.\n if (!typesOk) console.warn(`\\n${UNSAFE_BUILD_WARNING}`);\n}\n\n// Runs tsc, which checks the project and writes its declarations either way.\n// Returns whether it reported no type errors.\nfunction emitTypes(agent: Agent, outDir: string): boolean {\n const tscCommand = resolveCommand(agent, \"execute-local\", [\"tsc\", \"--build\"]);\n if (tscCommand === null) {\n console.error(\n \"You need to have typescript installed to use the `build` command.\",\n );\n process.exit(1);\n }\n console.log(\"\\n▶ Type-checking and emitting types via tsc...\");\n try {\n execSync(`${tscCommand.command} ${tscCommand.args.join(\" \")}`, {\n stdio: \"inherit\",\n });\n console.log(\"✔ Types emitted to\", join(outDir, \"types\"));\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isInteractive(): boolean {\n return Boolean(process.stdin.isTTY) && !process.env.CI;\n}\n\nconst TYPE_ERROR_RISK =\n \"A package built with type errors can load and still fail at runtime.\";\n\nconst UNSAFE_BUILD_WARNING =\n \"⚠ Built despite type errors. \" +\n TYPE_ERROR_RISK +\n \" Fix them before you publish or deploy it.\";\n\nasync function confirmBuildDespiteTypeErrors(): Promise<void> {\n const hint =\n \"Fix them and build again. --ignore-type-errors skips this check, at the risk of shipping that failure.\";\n if (!isInteractive()) {\n console.error(\n `\\n✘ tsc reported the type errors above. ${TYPE_ERROR_RISK}\\n${hint}`,\n );\n process.exit(1);\n }\n const enquirer = await import(\"enquirer\");\n let confirmed: boolean;\n try {\n const answer = await enquirer.default.prompt<{ confirmed: boolean }>({\n type: \"confirm\",\n name: \"confirmed\",\n message: `tsc reported the type errors above. ${TYPE_ERROR_RISK} Build anyway?`,\n initial: false,\n });\n confirmed = answer.confirmed;\n } catch {\n // Ctrl-C at the prompt is a decline.\n confirmed = false;\n }\n if (!confirmed) {\n console.error(`Build cancelled. ${hint}`);\n process.exit(1);\n }\n}\n\n/**\n * Every shared specifier imported from the entry sources; the post-build\n * scan compares these against the built output.\n *\n * Scoped to the specifiers the build actually externalizes: a specifier the\n * vendor does not publish (the bare `@powerhousedao/shared` root, an\n * unvendored subpath) is deliberately bundled, so reporting it as \"bundled\n * instead of externalized\" would be a false alarm.\n */\nfunction findSharedImportsInSources(root: string, globs: string[]): string[] {\n const found = new Set<string>();\n for (const file of expandEntryGlobs(root, globs)) {\n const src = readFileSync(file, \"utf8\");\n for (const spec of findSharedImports(\n src,\n EXTERNALIZABLE_SHARED_SPECIFIERS,\n )) {\n found.add(spec);\n }\n }\n return [...found].sort();\n}\n\n/**\n * The built JS outputs of a browser build (entry files and chunks).\n */\nfunction readDistBrowserFiles(\n dir: string,\n): { path: string; content: string }[] {\n const out: { path: string; content: string }[] = [];\n if (!existsSync(dir)) return out;\n const walk = (d: string) => {\n for (const e of readdirSync(d, { withFileTypes: true })) {\n const p = join(d, e.name);\n if (e.isDirectory()) walk(p);\n else if (e.isFile() && e.name.endsWith(\".js\")) {\n out.push({ path: p, content: readFileSync(p, \"utf8\") });\n }\n }\n };\n walk(dir);\n return out;\n}\n"],"names":["tsdownBuild"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,iCAAiC,aAAqB;CAC1E,MAAM,eAAe,KAAK,aAAa,0BAA0B;CACjE,IAAI,CAAC,WAAW,YAAY,GAAG;CAE/B,MAAM,EAAE,MAAM,gBAAgB,MAAM,YAAY,EAAE,KAAK,YAAY,CAAC;CAEpE,IAAI;CACJ,IAAI;EACF,eACE,KAAK,MAAM,aAAa,cAAc,OAAO,CAAC,CAAC,CAC/C;CACJ,QAAQ;EACN,MAAM,IAAI,MACR,iDAAiD,aAAa,8BAChE;CACF;CAEA,IAAI,iBAAiB,aACnB,MAAM,IAAI,MACR,wIACwC,KAAK,UAAU,WAAW,EAAE,uCAC5B,KAAK,UAAU,YAAY,EAAE,wDAEvE;AAEJ;AAEA,eAAsB,SAAS,MAAiB;CAC9C,MAAM,EAAE,WAAW;CACnB,MAAM,cAAc,QAAQ,IAAI;CAGhC,MAAM,iCAAiC,WAAW;CAElD,MAAM,SAAS;EACb;EACA;EACA,QAAQ,WAAW,aAAa,MAAM;CACxC;CAGA,mBAAmB,MAAM;CACzB,MAAM,aAAa,CAAC,KAAK;CAGzB,MAAM,SAAQ,MADa,OAAO,EAAA,EACN,SAAS;CAGrC,MAAM,UAAU,UAAU,OAAO,MAAM;CACvC,IAAI,CAAC,WAAW,CAAC,KAAK,kBACpB,MAAM,8BAA8B;CAGtC,MAAMA,MAAY;EAChB,GAAG,wBAAwB,EAAE,WAAW,CAAC;EACzC,QAAQ,KAAK,QAAQ,SAAS;CAChC,CAAC;CAID,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I,EAAE,OAAO,KAAK,EAAE,KAAK,SAAS,KAAK,GAC1C,IAAI,KAAK;IAAE,MAAM;IAAG,SAAS,aAAa,GAAG,MAAM;GAAE,CAAC;EAE1D;CACF;CACA,KAAK,GAAG;CACR,OAAO;AACT","debug_id":"50b5ce1d-8048-5eb0-bcaf-e4e24228a0c0"}
@@ -1,5 +1,5 @@
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]="57ffa55f-aaac-5b19-ab6f-ff7466e18c5a")}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]="e9d67427-1c35-5d4b-85d5-4bf380d60b94")}catch(e){}}();
3
3
  import { deepMerge, phConnectRuntimeConfigSchema } from "@powerhousedao/shared/connect";
4
4
  import AjvNs from "ajv";
5
5
  import { isPlainObject, stringToPath } from "remeda";
@@ -60,7 +60,10 @@ function normalizeKey(key) {
60
60
  function formatErrors(errors) {
61
61
  if (!errors || errors.length === 0) return "unknown validation error";
62
62
  return errors.map((e) => {
63
- return ` ${e.instancePath || "(root)"} ${e.message ?? ""}`.trim();
63
+ const path = e.instancePath || "(root)";
64
+ const extra = e.params?.additionalProperty;
65
+ const suffix = extra === void 0 ? "" : ` (${JSON.stringify(extra)})`;
66
+ return ` ${path} ${e.message ?? ""}${suffix}`.trim();
64
67
  }).join("\n");
65
68
  }
66
69
  /**
@@ -87,22 +90,29 @@ function validateConnectKeyValue(key, rawValue) {
87
90
  * `connect.*` schema). If present in the payload, it is extracted before
88
91
  * validation so the connect-only blob can be checked against the schema,
89
92
  * then re-attached on the returned object so the caller can route it.
93
+ *
94
+ * `command` prefixes error messages (e.g. "ph connect build").
90
95
  */
91
- function validateConnectPatch(raw) {
96
+ function validateConnectPatch(raw, command = "ph connect config") {
97
+ const label = `${command} --json`;
92
98
  let parsed;
93
99
  try {
94
100
  parsed = JSON.parse(raw);
95
101
  } catch (e) {
96
102
  const msg = e instanceof Error ? e.message : String(e);
97
- throw new Error(`ph connect config --json: invalid JSON (${msg}). Expected a partial connect.* blob, e.g. --json '{"renown":{"url":"..."}}'.`, { cause: e });
103
+ throw new Error(`${label}: invalid JSON (${msg}). Expected a partial connect.* blob, e.g. --json '{"renown":{"url":"..."}}'.`, { cause: e });
104
+ }
105
+ if (!isPlainObject(parsed)) throw new Error(`${label}: payload must be a JSON object, got ${typeof parsed}.`);
106
+ if (Object.prototype.hasOwnProperty.call(parsed, "connect")) {
107
+ const inner = JSON.stringify(parsed.connect);
108
+ throw new Error(`${label}: pass the connect.* block without the "connect" wrapper, e.g. --json '${inner}'.`);
98
109
  }
99
- if (!isPlainObject(parsed)) throw new Error(`ph connect config --json: payload must be a JSON object, got ${typeof parsed}.`);
100
110
  const top = parsed;
101
111
  const hasPackageRegistryUrl = Object.prototype.hasOwnProperty.call(top, "packageRegistryUrl");
102
112
  const packageRegistryUrl = top.packageRegistryUrl;
103
113
  const connectOnly = { ...top };
104
114
  delete connectOnly.packageRegistryUrl;
105
- if (!validateConnect(connectOnly)) throw new Error(`ph connect config --json: validation failed:\n${formatErrors(validateConnect.errors)}`);
115
+ if (!validateConnect(connectOnly)) throw new Error(`${label}: validation failed:\n${formatErrors(validateConnect.errors)}\nExpected a partial connect.* blob with nested keys, e.g. --json '{"app":{"workflowsEnabled":true}}'.`);
106
116
  return hasPackageRegistryUrl ? {
107
117
  ...connectOnly,
108
118
  packageRegistryUrl
@@ -123,21 +133,9 @@ const parseDefaultDrivesUrl = (v) => v.split(",").map((s) => s.trim()).filter(Bo
123
133
  }));
124
134
  //#endregion
125
135
  //#region src/utils/cli-connect-override.ts
126
- /**
127
- * Parse the `--json` payload (if any). Throws on malformed JSON or on a
128
- * non-object root with a clear, command-line-visible error.
129
- */
130
136
  function parseJsonOverride(raw) {
131
137
  if (raw === void 0 || raw === "") return {};
132
- let parsed;
133
- try {
134
- parsed = JSON.parse(raw);
135
- } catch (e) {
136
- const msg = e instanceof Error ? e.message : String(e);
137
- throw new Error(`--json: invalid JSON (${msg}). Expected a partial 'connect.*' blob, e.g. --json '{"renown":{"url":"..."}}'.`, { cause: e });
138
- }
139
- if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error(`--json: payload must be a JSON object, got ${typeof parsed}.`);
140
- return parsed;
138
+ return validateConnectPatch(raw, "ph connect build");
141
139
  }
142
140
  function setIfDefined(target, key, value) {
143
141
  if (value !== void 0) target[key] = value;
@@ -314,5 +312,5 @@ function buildStudioConnectOverride(args, callerOverride) {
314
312
  //#endregion
315
313
  export { parseDefaultDrivesUrl as a, validateConnectKeyValue as c, wasFlagExplicitlyPassed as i, validateConnectPatch as l, buildConnectFlagPatch as n, normalizeKey as o, buildStudioConnectOverride as r, parseCliValue as s, buildCliConnectOverride as t, mergeDefaultDrives as u };
316
314
 
317
- //# sourceMappingURL=cli-connect-override-Bo7L7mwc.mjs.map
318
- //# debugId=57ffa55f-aaac-5b19-ab6f-ff7466e18c5a
315
+ //# sourceMappingURL=cli-connect-override-b4kKqgOZ.mjs.map
316
+ //# debugId=e9d67427-1c35-5d4b-85d5-4bf380d60b94
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-connect-override-b4kKqgOZ.mjs","sources":["../src/utils/merge-default-drives.ts","../src/utils/connect-config-validation.ts","../src/utils/parse-default-drives.ts","../src/utils/cli-connect-override.ts"],"sourcesContent":["import type { PHConnectDefaultDrive } from \"@powerhousedao/shared/clis\";\n\nfunction isLocalDrive(\n drive: PHConnectDefaultDrive,\n): drive is Extract<PHConnectDefaultDrive, { local: true }> {\n return \"local\" in drive;\n}\n\n// Identity key for de-duplication: remote entries are keyed by URL; local\n// entries are keyed by `local:<id>` so a local drive id can never collide\n// with a remote URL that happens to be the same string.\nconst driveKey = (drive: PHConnectDefaultDrive): string =>\n isLocalDrive(drive) ? `local:${drive.id}` : drive.url;\n\n/**\n * Concatenate groups of `connect.drives.defaultDrives` in the order given,\n * de-duplicating by drive identity (URL for remote entries, id for local\n * ones). The first occurrence of a drive wins, so earlier groups keep their\n * position and metadata — e.g. the Vetra drive `ph vetra` starts stays first\n * even when the project's `powerhouse.config.json` lists the same drive.\n */\nexport function mergeDefaultDrives(\n ...groups: PHConnectDefaultDrive[][]\n): PHConnectDefaultDrive[] {\n const seen = new Set<string>();\n const out: PHConnectDefaultDrive[] = [];\n for (const group of groups) {\n for (const drive of group) {\n const key = driveKey(drive);\n if (seen.has(key)) continue;\n seen.add(key);\n out.push(drive);\n }\n }\n return out;\n}\n","// Ajv-backed validation for `ph connect config` writes.\n//\n// Two entry points:\n//\n// - validateConnectKeyValue(key, value)\n// For the `<key> <value>` form. Sets the value at the dotted path inside a\n// stub connect block, then validates the result against the runtime schema.\n// Catches both invalid paths (key doesn't map to a real field) and invalid\n// types (e.g. `connect.renown.chainId \"abc\"` — schema says number).\n//\n// - validateConnectPatch(patch)\n// For the `--json` form. Validates the whole patch as a partial connect.*\n// blob. Same schema, but we only check the keys actually present in the\n// patch (additional keys still fail per `additionalProperties: false`).\n//\n// Both return a typed `connect.*` partial on success or throw with a multi-\n// line, actionable message on failure.\n\nimport { phConnectRuntimeConfigSchema } from \"@powerhousedao/shared/connect\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport AjvNs from \"ajv\";\nimport { isPlainObject, stringToPath } from \"remeda\";\n\ntype PlainObject = Record<string, unknown>;\ntype ConnectPartial = Partial<PHConnectRuntimeConfig>;\n\n// Ajv ships as CJS — under NodeNext ESM the default lands on `.default` while\n// types still point at the class on the namespace. Normalize the constructor.\ntype AjvCtor = new (opts?: Record<string, unknown>) => {\n compile: (schema: unknown) => AjvValidate;\n};\ntype AjvError = {\n instancePath?: string;\n message?: string;\n params?: { additionalProperty?: string };\n};\ntype AjvValidate = ((data: unknown) => boolean) & {\n errors?: AjvError[] | null;\n};\n\nconst Ajv = ((AjvNs as unknown as { default?: AjvCtor }).default ??\n (AjvNs as unknown as AjvCtor)) as AjvCtor;\n\nconst ajv = new Ajv({ allErrors: true, strict: false });\nconst validateConnect: AjvValidate = ajv.compile(phConnectRuntimeConfigSchema);\n\n/**\n * Parse the CLI-supplied value. Tries JSON first so `true`, `42`, `\"a\"`,\n * `null`, `[1,2]` coerce; falls back to the raw string for unquoted text.\n *\n * Examples:\n * \"true\" -> true (boolean)\n * \"42\" -> 42 (number)\n * '\"x\"' -> \"x\" (string, quoted)\n * \"x\" -> \"x\" (string, bare)\n * \"[1,2]\" -> [1, 2] (array)\n */\nexport function parseCliValue(raw: string): unknown {\n try {\n return JSON.parse(raw);\n } catch {\n return raw;\n }\n}\n\n/**\n * Strip the optional leading \"connect.\" prefix so callers can pass either\n * \"connect.renown.url\" or \"renown.url\" interchangeably.\n */\nexport function normalizeKey(key: string): string {\n return key.startsWith(\"connect.\") ? key.slice(\"connect.\".length) : key;\n}\n\nfunction formatErrors(errors: AjvError[] | null | undefined): string {\n if (!errors || errors.length === 0) return \"unknown validation error\";\n return errors\n .map((e) => {\n const path = e.instancePath || \"(root)\";\n const extra = e.params?.additionalProperty;\n const suffix = extra === undefined ? \"\" : ` (${JSON.stringify(extra)})`;\n return ` ${path} ${e.message ?? \"\"}${suffix}`.trim();\n })\n .join(\"\\n\");\n}\n\n/**\n * Validate a single `<key> <value>` pair. Returns the parsed connect-partial\n * that, when deep-merged into the existing config, applies the change.\n *\n * Throws on:\n * - Empty key\n * - Path that doesn't exist in the schema\n * - Value whose type doesn't match the schema at the leaf path\n */\nexport function validateConnectKeyValue(\n key: string,\n rawValue: string,\n): ConnectPartial {\n const normalized = normalizeKey(key);\n if (!normalized) {\n throw new Error(\n \"ph connect config: key cannot be empty. Pass a dotted path inside connect.* (e.g. connect.renown.url).\",\n );\n }\n const parsed = parseCliValue(rawValue);\n // Build a nested-stub object from the dotted path so Ajv can validate\n // the value's shape against the schema (e.g. \"renown.url\" + parsed →\n // { renown: { url: parsed } }). Remeda's `setPath` requires the path\n // to exist; this is the sparse-creation case, so we fold the parts.\n const stub = stringToPath(normalized).reduceRight<unknown>(\n (acc, key) => ({ [String(key)]: acc }),\n parsed,\n ) as PlainObject;\n if (!validateConnect(stub)) {\n throw new Error(\n `ph connect config: validation failed for key=\"${normalized}\" value=${JSON.stringify(parsed)} (parsed as ${typeof parsed}):\\n${formatErrors(validateConnect.errors)}`,\n );\n }\n return stub;\n}\n\n/**\n * Validate a `--json` bulk override. Returns the parsed partial.\n *\n * `packageRegistryUrl` is a top-level runtime field (not part of the\n * `connect.*` schema). If present in the payload, it is extracted before\n * validation so the connect-only blob can be checked against the schema,\n * then re-attached on the returned object so the caller can route it.\n *\n * `command` prefixes error messages (e.g. \"ph connect build\").\n */\nexport function validateConnectPatch(\n raw: string,\n command = \"ph connect config\",\n): ConnectPartial & {\n packageRegistryUrl?: unknown;\n} {\n const label = `${command} --json`;\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n throw new Error(\n `${label}: invalid JSON (${msg}). Expected a partial connect.* blob, e.g. --json '{\"renown\":{\"url\":\"...\"}}'.`,\n { cause: e },\n );\n }\n if (!isPlainObject(parsed)) {\n throw new Error(\n `${label}: payload must be a JSON object, got ${typeof parsed}.`,\n );\n }\n if (Object.prototype.hasOwnProperty.call(parsed, \"connect\")) {\n const inner = JSON.stringify((parsed as PlainObject).connect);\n throw new Error(\n `${label}: pass the connect.* block without the \"connect\" wrapper, e.g. --json '${inner}'.`,\n );\n }\n // Extract `packageRegistryUrl` (top-level field, not in the connect schema)\n // before validating, so a payload like `{\"packageRegistryUrl\":\"…\"}` doesn't\n // fail the `additionalProperties: false` check on the connect schema.\n const top = parsed as PlainObject;\n const hasPackageRegistryUrl = Object.prototype.hasOwnProperty.call(\n top,\n \"packageRegistryUrl\",\n );\n const packageRegistryUrl = top.packageRegistryUrl;\n const connectOnly: PlainObject = { ...top };\n delete connectOnly.packageRegistryUrl;\n if (!validateConnect(connectOnly)) {\n throw new Error(\n `${label}: validation failed:\\n${formatErrors(validateConnect.errors)}\\nExpected a partial connect.* blob with nested keys, e.g. --json '{\"app\":{\"workflowsEnabled\":true}}'.`,\n );\n }\n return hasPackageRegistryUrl\n ? ({ ...connectOnly, packageRegistryUrl } as ConnectPartial & {\n packageRegistryUrl?: unknown;\n })\n : (connectOnly as ConnectPartial);\n}\n","/**\n * Comma-separated URL string → array of `{url, name: null, icon: null}`\n * entries suitable for `connect.drives.defaultDrives`. Used by ph-cli's\n * CLI-override builders and by `ph vetra` when forwarding the local\n * switchboard's drive URLs into the runtime config.\n */\nexport const parseDefaultDrivesUrl = (\n v: string,\n): Array<{ url: string; name: null; icon: null }> =>\n v\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean)\n .map((url) => ({ url, name: null, icon: null }));\n","// Builds a `connectOverride` partial from CLI flags. Shared by:\n//\n// - `ph connect build` — uses `buildCliConnectOverride` to produce the\n// `cliConnectOverride` patch the Vite plugin applies at the top of the\n// precedence ladder:\n//\n// DEFAULT_CONNECT_CONFIG < env-var seeds < source connect.* < --json < individual --flag\n//\n// - `ph connect config` — uses `buildConnectFlagPatch` (the per-field\n// partial builder) to translate flag-set values into the patch that\n// gets dual-written to source + dist `powerhouse.config.json`.\n//\n// `--json` parses as a partial `connect.*` blob and merges in first; then any\n// individual --flag values merge on top, so a flag beats a conflicting --json\n// value.\n\nimport type {\n PHConnectDefaultDrive,\n PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport { deepMerge } from \"@powerhousedao/shared/connect\";\nimport { mergeDefaultDrives } from \"./merge-default-drives.js\";\nimport type { ConnectBuildArgs, ConnectStudioArgs } from \"../types.js\";\nimport {\n normalizeKey,\n parseCliValue,\n validateConnectKeyValue,\n validateConnectPatch,\n} from \"./connect-config-validation.js\";\nimport { parseDefaultDrivesUrl } from \"./parse-default-drives.js\";\n\ntype PlainObject = Record<string, unknown>;\n\n/**\n * Structural input shape consumed by `buildConnectFlagPatch`. Every property\n * is strict-optional — `undefined` means \"user did not pass this flag\" and\n * the path is excluded from the patch.\n *\n * Callers with cmd-ts-typed args where some flags have built-in defaults\n * (e.g. the 4 commonArgs flags `--base` / `--log-level` /\n * `--default-drives-url` / `--drive-preserve-strategy`) must filter through\n * `wasFlagExplicitlyPassed` BEFORE building this input — otherwise default\n * values like `\"info\"` will silently clobber source `powerhouse.config.json`\n * values.\n */\nexport type ConnectFlagInput = {\n // Strict-optional flags from connectRuntimeOverrideArgs (excluding\n // `packagesRegistry`, which is a top-level runtime field — see\n // `buildCliConnectOverride`).\n json?: string | undefined;\n renownUrl?: string | undefined;\n renownNetworkId?: string | undefined;\n renownChainId?: number | undefined;\n renownNamespace?: string | undefined;\n renownSwitchboardUrl?: string | undefined;\n allowAddDrive?: boolean | undefined;\n externalPackages?: boolean | undefined;\n workflows?: boolean | undefined;\n remoteDrivesEnabled?: boolean | undefined;\n remoteDrivesAllowAdd?: boolean | undefined;\n remoteDrivesAllowDelete?: boolean | undefined;\n localDrivesEnabled?: boolean | undefined;\n localDrivesAllowAdd?: boolean | undefined;\n localDrivesAllowDelete?: boolean | undefined;\n appName?: string | undefined;\n homeBackground?: string | undefined;\n sentryDsn?: string | undefined;\n sentryEnv?: string | undefined;\n sentryTracingEnabled?: boolean | undefined;\n // commonArgs flags. Callers must apply `wasFlagExplicitlyPassed`\n // filtering (see above).\n basePath?: string | undefined;\n logLevel?: string | undefined;\n defaultDrivesUrl?: string | undefined;\n drivesPreserveStrategy?: string | undefined;\n};\n\n// Schema-validates `--json` so unknown keys, a `connect` wrapper or wrong\n// types fail instead of being dropped from the dist config.\nfunction parseJsonOverride(raw: string | undefined): PlainObject {\n if (raw === undefined || raw === \"\") return {};\n return validateConnectPatch(raw, \"ph connect build\") as PlainObject;\n}\n\nfunction setIfDefined<V>(\n target: PlainObject,\n key: string,\n value: V | undefined,\n): void {\n if (value !== undefined) target[key] = value;\n}\n\n/**\n * Detect whether the user literally typed `--<longName>` on the command\n * line. Used to gate the 4 commonArgs flags through `cliConnectOverride` —\n * those flags have cmd-ts defaults, so their parsed value is always\n * defined, and a naive merge would silently clobber source values with the\n * default on every build.\n *\n * Handles both `--flag value` and `--flag=value` forms.\n */\nexport function wasFlagExplicitlyPassed(longName: string): boolean {\n const dashed = `--${longName}`;\n return process.argv.some(\n (arg) => arg === dashed || arg.startsWith(`${dashed}=`),\n );\n}\n\n/**\n * Build a `connect.*` partial from the 20 field flags. Only includes paths\n * the user explicitly set (undefined values are excluded).\n *\n * Single source of truth for the flag → JSON-path mapping; consumed by both\n * `ph connect build` and `ph connect config`.\n */\nexport function buildConnectFlagPatch(args: ConnectFlagInput): PlainObject {\n const out: PlainObject = {};\n\n const app: PlainObject = {};\n setIfDefined(app, \"basePath\", args.basePath);\n setIfDefined(app, \"logLevel\", args.logLevel);\n setIfDefined(app, \"workflowsEnabled\", args.workflows);\n if (Object.keys(app).length > 0) out.app = app;\n\n const renown: PlainObject = {};\n setIfDefined(renown, \"url\", args.renownUrl);\n setIfDefined(renown, \"networkId\", args.renownNetworkId);\n setIfDefined(renown, \"chainId\", args.renownChainId);\n setIfDefined(renown, \"namespace\", args.renownNamespace);\n setIfDefined(renown, \"switchboardUrl\", args.renownSwitchboardUrl);\n if (Object.keys(renown).length > 0) out.renown = renown;\n\n const packages: PlainObject = {};\n setIfDefined(packages, \"externalEnabled\", args.externalPackages);\n if (Object.keys(packages).length > 0) out.packages = packages;\n\n // --home-background: empty string is the explicit \"set null\" form\n // (cmd-ts can't pass `null` directly through a string option).\n const branding: PlainObject = {};\n setIfDefined(branding, \"appName\", args.appName);\n if (args.homeBackground !== undefined) {\n branding.homeBackground =\n args.homeBackground === \"\" ? null : args.homeBackground;\n }\n if (Object.keys(branding).length > 0) out.branding = branding;\n\n // --sentry-dsn: empty string is the explicit \"set null\" form (disables\n // Sentry). Same pattern as --home-background.\n const sentry: PlainObject = {};\n if (args.sentryDsn !== undefined) {\n sentry.dsn = args.sentryDsn === \"\" ? null : args.sentryDsn;\n }\n setIfDefined(sentry, \"env\", args.sentryEnv);\n setIfDefined(sentry, \"tracing\", args.sentryTracingEnabled);\n if (Object.keys(sentry).length > 0) out.sentry = sentry;\n\n const drives: PlainObject = {};\n setIfDefined(drives, \"allowAddDrive\", args.allowAddDrive);\n setIfDefined(drives, \"preserveStrategy\", args.drivesPreserveStrategy);\n if (args.defaultDrivesUrl !== undefined && args.defaultDrivesUrl !== \"\") {\n drives.defaultDrives = parseDefaultDrivesUrl(args.defaultDrivesUrl);\n }\n\n const remote: PlainObject = {};\n setIfDefined(remote, \"enabled\", args.remoteDrivesEnabled);\n setIfDefined(remote, \"allowAdd\", args.remoteDrivesAllowAdd);\n setIfDefined(remote, \"allowDelete\", args.remoteDrivesAllowDelete);\n\n const local: PlainObject = {};\n setIfDefined(local, \"enabled\", args.localDrivesEnabled);\n setIfDefined(local, \"allowAdd\", args.localDrivesAllowAdd);\n setIfDefined(local, \"allowDelete\", args.localDrivesAllowDelete);\n\n const sections: PlainObject = {};\n if (Object.keys(remote).length > 0) sections.remote = remote;\n if (Object.keys(local).length > 0) sections.local = local;\n if (Object.keys(sections).length > 0) drives.sections = sections;\n if (Object.keys(drives).length > 0) out.drives = drives;\n\n return out;\n}\n\n/**\n * Combine `--json` and the individual flag values into the two override\n * inputs `ph connect build` forwards to the Vite plugin:\n *\n * - `connectOverride`: a partial `connect.*` patch (deep-merged at the top\n * of the runtime-config precedence ladder).\n * - `packageRegistryUrl`: a separate top-level override; mirrors the\n * source-config top-level field (the SPA reads it directly).\n *\n * `--packages-registry` and `--json` containing a top-level\n * `packageRegistryUrl` both flow into `packageRegistryUrl`; the flag wins on\n * collision. Returns `undefined` for whichever override was not supplied.\n *\n * The 4 commonArgs flags (`--base`, `--log-level`, `--default-drives-url`,\n * `--drive-preserve-strategy`) are gated through `wasFlagExplicitlyPassed`\n * because they carry cmd-ts defaults that would otherwise leak into the\n * override on every build.\n */\nexport function buildCliConnectOverride(args: ConnectBuildArgs): {\n connectOverride: PHConnectRuntimeConfig | undefined;\n packageRegistryUrl: string | undefined;\n} {\n const fromJson = parseJsonOverride(args.json);\n\n const input: ConnectFlagInput = {\n renownUrl: args.renownUrl,\n renownNetworkId: args.renownNetworkId,\n renownChainId: args.renownChainId,\n renownNamespace: args.renownNamespace,\n renownSwitchboardUrl: args.renownSwitchboardUrl,\n allowAddDrive: args.allowAddDrive,\n externalPackages: args.externalPackages,\n workflows: args.workflows,\n remoteDrivesEnabled: args.remoteDrivesEnabled,\n remoteDrivesAllowAdd: args.remoteDrivesAllowAdd,\n remoteDrivesAllowDelete: args.remoteDrivesAllowDelete,\n localDrivesEnabled: args.localDrivesEnabled,\n localDrivesAllowAdd: args.localDrivesAllowAdd,\n localDrivesAllowDelete: args.localDrivesAllowDelete,\n appName: args.appName,\n homeBackground: args.homeBackground,\n sentryDsn: args.sentryDsn,\n sentryEnv: args.sentryEnv,\n sentryTracingEnabled: args.sentryTracingEnabled,\n // commonArgs flags — only forward when the user explicitly passed them.\n basePath: wasFlagExplicitlyPassed(\"base\")\n ? args.connectBasePath\n : undefined,\n logLevel: wasFlagExplicitlyPassed(\"log-level\") ? args.logLevel : undefined,\n defaultDrivesUrl: wasFlagExplicitlyPassed(\"default-drives-url\")\n ? args.defaultDrivesUrl\n : undefined,\n drivesPreserveStrategy: wasFlagExplicitlyPassed(\"drive-preserve-strategy\")\n ? args.drivesPreserveStrategy\n : undefined,\n };\n\n const fromFlags = buildConnectFlagPatch(input);\n\n // Positional `<key> <value>` override (only set when both are present;\n // `runConnectBuild` rejects the 1-positional case up front because build\n // has no read mode). Layered on top of --json + flags so a positional\n // override wins on collision — matches the user's literal command line.\n let positionalRegistry: string | undefined;\n let fromPositional: PlainObject = {};\n if (args.keyPositional !== undefined && args.valuePositional !== undefined) {\n const normalized = normalizeKey(args.keyPositional);\n if (!normalized) {\n throw new Error(\n \"ph connect build: positional <key> cannot be empty. Pass a dotted path inside connect.* (e.g. connect.renown.url).\",\n );\n }\n if (normalized === \"packageRegistryUrl\") {\n const parsed = parseCliValue(args.valuePositional);\n if (typeof parsed !== \"string\") {\n throw new Error(\n `ph connect build: positional packageRegistryUrl must be a string (got ${typeof parsed}).`,\n );\n }\n positionalRegistry = parsed;\n } else {\n fromPositional = validateConnectKeyValue(\n normalized,\n args.valuePositional,\n );\n }\n }\n\n // Top-level `packageRegistryUrl` can come from --json (top-level),\n // --packages-registry flag, or positional `packageRegistryUrl <value>`.\n // Precedence (highest → lowest): positional > flag > --json.\n const jsonRegistry =\n typeof fromJson.packageRegistryUrl === \"string\"\n ? (fromJson.packageRegistryUrl as string)\n : undefined;\n const packageRegistryUrl =\n positionalRegistry ?? args.packagesRegistry ?? jsonRegistry;\n // Strip the top-level field from the JSON patch before deep-merging into\n // the connect partial — it isn't a `connect.*` field.\n const jsonConnect = { ...fromJson };\n delete jsonConnect.packageRegistryUrl;\n\n const hasJsonConnect = Object.keys(jsonConnect).length > 0;\n const hasFlags = Object.keys(fromFlags).length > 0;\n const hasPositional = Object.keys(fromPositional).length > 0;\n const connectOverride =\n !hasJsonConnect && !hasFlags && !hasPositional\n ? undefined\n : deepMerge(\n deepMerge(\n jsonConnect as PHConnectRuntimeConfig,\n fromFlags as PHConnectRuntimeConfig,\n ),\n fromPositional as PHConnectRuntimeConfig,\n );\n\n return { connectOverride, packageRegistryUrl };\n}\n\n/**\n * Parallel of `buildCliConnectOverride` for `ph connect studio` / `ph vetra`.\n * Studio only exposes the 4 commonArgs flags (`--base`, `--log-level`,\n * `--default-drives-url`, `--drive-preserve-strategy`); each is gated through\n * `wasFlagExplicitlyPassed` so cmd-ts defaults don't leak into the override.\n *\n * `callerOverride` is supplied by wrappers around studio (notably `ph vetra`,\n * which sets default drives + preserveStrategy directly). The flag override\n * deep-merges on top of it: caller choices apply for every flag the user\n * didn't type, and an explicitly passed flag wins for its own field —\n * except `drives.defaultDrives`, which merges additively: a flag's drives\n * are appended to the caller's list (de-duplicated by drive identity) rather\n * than replacing it, so vetra's own drives stay in Connect's default set.\n * Without a caller override (plain `ph connect studio`) only the flag can\n * carry defaultDrives, so that command's behavior is unchanged.\n */\nexport function buildStudioConnectOverride(\n args: ConnectStudioArgs,\n callerOverride: PHConnectRuntimeConfig | undefined,\n): PHConnectRuntimeConfig | undefined {\n const flagOverride = buildConnectFlagPatch({\n basePath: wasFlagExplicitlyPassed(\"base\")\n ? args.connectBasePath\n : undefined,\n logLevel: wasFlagExplicitlyPassed(\"log-level\") ? args.logLevel : undefined,\n defaultDrivesUrl: wasFlagExplicitlyPassed(\"default-drives-url\")\n ? args.defaultDrivesUrl\n : undefined,\n drivesPreserveStrategy: wasFlagExplicitlyPassed(\"drive-preserve-strategy\")\n ? args.drivesPreserveStrategy\n : undefined,\n renownNamespace: args.renownNamespace,\n }) as PHConnectRuntimeConfig;\n\n // Studio commands (`ph connect studio`, `ph vetra`) always run in studio\n // mode: Connect loads the vetra package and offers builder document types.\n const studioOverride: PHConnectRuntimeConfig = { app: { studioMode: true } };\n const layers = [callerOverride, flagOverride, studioOverride].filter(\n (o): o is PHConnectRuntimeConfig =>\n o !== undefined && Object.keys(o).length > 0,\n );\n const merged = layers.reduce(\n (acc, o) => deepMerge(acc, o),\n {} as PHConnectRuntimeConfig,\n );\n\n // `deepMerge` replaces arrays, so the flag's defaultDrives would clobber\n // the caller's list; re-apply them as the de-duplicated union instead.\n // Only needed when two or more layers contribute default drives (the\n // plain-studio single-layer case is already exactly the flag's list).\n const driveGroups = layers\n .map((l) => l.drives?.defaultDrives)\n .filter(\n (d): d is PHConnectDefaultDrive[] => Array.isArray(d) && d.length > 0,\n );\n if (driveGroups.length > 1) {\n merged.drives = {\n ...merged.drives,\n defaultDrives: mergeDefaultDrives(...driveGroups),\n };\n }\n return merged;\n}\n"],"names":[],"mappings":";;;;;;AAEA,SAAS,a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,OAAO,KAAK,WAAW,CAAC,CAAC,SAAS;CACzD,MAAM,WAAW,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS;CACjD,MAAM,gBAAgB,OAAO,KAAK,cAAc,CAAC,CAAC,SAAS;CAY3D,OAAO;EAAE,iBAVP,CAAC,kBAAkB,CAAC,YAAY,CAAC,gBAC7B,KAAA,IACA,UACE,UACE,aACA,SACF,GACA,cACF;EAEoB;CAAmB;AAC/C;;;;;;;;;;;;;;;;;AAkBA,SAAgB,2BACd,MACA,gBACoC;CAkBpC,MAAM,SAAS;EAAC;EAjBK,sBAAsB;GACzC,UAAU,wBAAwB,MAAM,IACpC,KAAK,kBACL,KAAA;GACJ,UAAU,wBAAwB,WAAW,IAAI,KAAK,WAAW,KAAA;GACjE,kBAAkB,wBAAwB,oBAAoB,IAC1D,KAAK,mBACL,KAAA;GACJ,wBAAwB,wBAAwB,yBAAyB,IACrE,KAAK,yBACL,KAAA;GACJ,iBAAiB,KAAK;EACxB,CAK2C;EAAG,EADG,KAAK,EAAE,YAAY,KAAK,EACd;CAAC,CAAC,CAAC,QAC3D,MACC,MAAM,KAAA,KAAa,OAAO,KAAK,CAAC,CAAC,CAAC,SAAS,CAC/C;CACA,MAAM,SAAS,OAAO,QACnB,KAAK,MAAM,UAAU,KAAK,CAAC,GAC5B,CAAC,CACH;CAMA,MAAM,cAAc,OACjB,KAAK,MAAM,EAAE,QAAQ,aAAa,CAAC,CACnC,QACE,MAAoC,MAAM,QAAQ,CAAC,KAAK,EAAE,SAAS,CACtE;CACF,IAAI,YAAY,SAAS,GACvB,OAAO,SAAS;EACd,GAAG,OAAO;EACV,eAAe,mBAAmB,GAAG,WAAW;CAClD;CAEF,OAAO;AACT","debug_id":"e9d67427-1c35-5d4b-85d5-4bf380d60b94"}
package/dist/cli.mjs CHANGED
@@ -1,6 +1,7 @@
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]="3ab9cfff-6f9c-57a2-a989-3a29e9435207")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c3a1dfab-bfc7-5154-b9b2-43ce4f1fcb86")}catch(e){}}();
4
+ import { n as skipInstallArgs } from "./install-added-dependencies-DVSbzler.mjs";
4
5
  import { initCliTelemetry } from "@powerhousedao/shared/clis/telemetry";
5
6
  import { assertNodeVersion } from "@powerhousedao/shared/clis/utils";
6
7
  import { boolean, command, flag, multioption, oneOf, option, optional, positional, run, string, subcommands } from "cmd-ts";
@@ -8,14 +9,14 @@ import { AGENTS, accessTokenArgs, buildArgs, connectBuildArgs, connectConfigArgs
8
9
  import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
9
10
  import { Directory, File } from "cmd-ts/dist/cjs/batteries/fs.js";
10
11
  import path from "path";
12
+ import { execSync } from "node:child_process";
11
13
  import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
12
- import { execSync } from "child_process";
13
- import { execSync as execSync$1 } from "node:child_process";
14
+ import { execSync as execSync$1 } from "child_process";
14
15
  import { createInterface } from "node:readline/promises";
15
16
  import { bold, yellow } from "colorette";
16
17
  //#region src/get-version.ts
17
18
  function getVersion() {
18
- return "6.2.3-dev.30";
19
+ return "6.2.3-dev.31";
19
20
  }
20
21
  //#endregion
21
22
  //#region src/utils/constants.ts
@@ -110,8 +111,10 @@ document models, editors, subgraphs and processors, type declarations, and its s
110
111
 
111
112
  Pieces under pieces/ are built too, each into its own self-contained module under
112
113
  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.
114
+ the piece listed in dist/powerhouse.manifest.json. A piece takes the package's version: an
115
+ entry in pieces/index.ts that declares version fails the build. A package that ships only
116
+ pieces is an ordinary package: it carries the same boilerplate, and every step above runs
117
+ for it too.
115
118
 
116
119
  tsc runs first. If it reports type errors the build asks whether to go ahead, and stops
117
120
  where it can't ask. --ignore-type-errors builds without asking; a package built that way
@@ -120,7 +123,7 @@ can load and still fail at runtime, so don't publish it.`,
120
123
  handler: async (args) => {
121
124
  if (args.debug) console.log(args);
122
125
  try {
123
- const { runBuild } = await import("./build-BolXfpNU.mjs");
126
+ const { runBuild } = await import("./build-CTvPQFMi.mjs");
124
127
  await runBuild(args);
125
128
  } catch (error) {
126
129
  console.error(error);
@@ -145,7 +148,7 @@ This command:
145
148
  args: connectStudioArgs,
146
149
  handler: async (args) => {
147
150
  if (args.debug) console.log(args);
148
- const { runConnectStudio } = await import("./connect-studio-r_ikfhOR.mjs");
151
+ const { runConnectStudio } = await import("./connect-studio-f3K1qPWd.mjs");
149
152
  await runConnectStudio(args);
150
153
  }
151
154
  });
@@ -158,14 +161,16 @@ Runtime-config overrides (all combinable — last wins on collision):
158
161
  ph connect build Build with the current source config.
159
162
  ph connect build <key> <value> Build with a positional override applied (e.g. ph connect build connect.renown.url https://renown.staging).
160
163
  ph connect build --<field> <value> Build with a per-field flag override (e.g. --renown-url https://renown.staging).
161
- ph connect build --json '{"…":"…"}' Build with a bulk override.
164
+ ph connect build --json '{"app":{"workflowsEnabled":true}}'
165
+ Build with a bulk override. The payload is the connect.* block
166
+ without the "connect" wrapper; unknown keys are rejected.
162
167
 
163
168
  Build has no read mode; passing only <key> without <value> errors out (use \`ph connect config <key>\` to read).
164
169
  `,
165
170
  args: connectBuildArgs,
166
171
  handler: async (args) => {
167
172
  if (args.debug) console.log(args);
168
- const { runConnectBuild } = await import("./connect-build-BVDpTJnS.mjs");
173
+ const { runConnectBuild } = await import("./connect-build-BMaR9w4G.mjs");
169
174
  await runConnectBuild(args);
170
175
  process.exit(0);
171
176
  }
@@ -192,7 +197,9 @@ Modes (mutually exclusive — positional, --get, --json, and field flags cannot
192
197
  ph connect config --get <dotted.path> Same as positional <key> (kept for backward compat).
193
198
  ph connect config <key> <value> Set a single field and dual-write to source + dist (positional).
194
199
  ph connect config --<field> <value> Set a single field via per-field flag (e.g. --renown-url https://renown.id).
195
- ph connect config --json '{"…":"…"}' Bulk-set multiple fields and dual-write.
200
+ ph connect config --json '{"renown":{"url":"…"}}'
201
+ Bulk-set multiple fields and dual-write. The payload is the connect.*
202
+ block without the "connect" wrapper; unknown keys are rejected.
196
203
 
197
204
  Writes go to:
198
205
  - <project>/powerhouse.config.json (source — picked up by the next build)
@@ -200,7 +207,7 @@ Writes go to:
200
207
  `,
201
208
  args: connectConfigArgs,
202
209
  handler: async (args) => {
203
- const { runConnectConfig } = await import("./connect-config-C70IXUh6.mjs");
210
+ const { runConnectConfig } = await import("./connect-config-_kiSMsbG.mjs");
204
211
  await runConnectConfig(args);
205
212
  }
206
213
  });
@@ -427,10 +434,11 @@ const generatePieceActionCmd = command({
427
434
  short: "p",
428
435
  description: "The piece directory under pieces/ to add the action to. Optional when the project ships exactly one piece."
429
436
  }),
437
+ ...skipInstallArgs,
430
438
  ...debugArgs
431
439
  },
432
440
  handler: async (args) => {
433
- const { startGeneratePieceAction } = await import("./generate-piece-action-Byk-BmYt.mjs");
441
+ const { startGeneratePieceAction } = await import("./generate-piece-action-C5WTHsqu.mjs");
434
442
  await startGeneratePieceAction(args, process.cwd());
435
443
  process.exit(0);
436
444
  }
@@ -465,10 +473,11 @@ const generatePieceTriggerCmd = command({
465
473
  defaultValue: () => "polling",
466
474
  defaultValueIsSerializable: true
467
475
  }),
476
+ ...skipInstallArgs,
468
477
  ...debugArgs
469
478
  },
470
479
  handler: async (args) => {
471
- const { startGeneratePieceTrigger } = await import("./generate-piece-trigger-CmPqKZej.mjs");
480
+ const { startGeneratePieceTrigger } = await import("./generate-piece-trigger-DR10CPOG.mjs");
472
481
  await startGeneratePieceTrigger(args, process.cwd());
473
482
  process.exit(0);
474
483
  }
@@ -493,12 +502,7 @@ const generatePieceCmd = command({
493
502
  id: option({
494
503
  type: optional(string),
495
504
  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."
505
+ description: "The piece id, the pieceName a workflow step holds, e.g. @acme/piece-crm. Defaults to one derived from the package name."
502
506
  }),
503
507
  auth: option({
504
508
  type: oneOf([
@@ -526,10 +530,11 @@ const generatePieceCmd = command({
526
530
  short: "a",
527
531
  description: "Re-register every piece in pieces/: refresh the pieces list and the manifest, and prune what is gone"
528
532
  }),
533
+ ...skipInstallArgs,
529
534
  ...debugArgs
530
535
  },
531
536
  handler: async (args) => {
532
- const { startGeneratePiece } = await import("./generate-piece-BHBXK1_P.mjs");
537
+ const { startGeneratePiece } = await import("./generate-piece-QTt-ddt2.mjs");
533
538
  await startGeneratePiece(args, process.cwd());
534
539
  process.exit(0);
535
540
  }
@@ -594,10 +599,11 @@ const generateProcessorCmd = command({
594
599
  short: "x",
595
600
  description: "Write a powerhouse/processor spec for each existing processor into specs/processors/"
596
601
  }),
602
+ ...skipInstallArgs,
597
603
  ...debugArgs
598
604
  },
599
605
  handler: async (args) => {
600
- const { startGenerateProcessor } = await import("./generate-processor-FprZJIKD.mjs");
606
+ const { startGenerateProcessor } = await import("./generate-processor-DBtTkgo5.mjs");
601
607
  await startGenerateProcessor(args, process.cwd());
602
608
  process.exit(0);
603
609
  }
@@ -635,10 +641,11 @@ const generateSubgraphCmd = command({
635
641
  short: "x",
636
642
  description: "Write a powerhouse/subgraph spec for each existing subgraph into specs/subgraphs/"
637
643
  }),
644
+ ...skipInstallArgs,
638
645
  ...debugArgs
639
646
  },
640
647
  handler: async (args) => {
641
- const { startGenerateSubgraph } = await import("./generate-subgraph-DNwL9vDs.mjs");
648
+ const { startGenerateSubgraph } = await import("./generate-subgraph-Dm27O59o.mjs");
642
649
  await startGenerateSubgraph(args, process.cwd());
643
650
  process.exit(0);
644
651
  }
@@ -761,7 +768,7 @@ Resolution order for the registry URL:
761
768
  if (scopeRegistryArgs.length > 0) console.log(`Installing dependencies 📦 (routing ${Array.from(scopes).join(", ")} → ${registryUrl})...`);
762
769
  else console.log("Installing dependencies 📦...");
763
770
  console.log(`> ${installCommand}`);
764
- execSync(installCommand, {
771
+ execSync$1(installCommand, {
765
772
  stdio: "inherit",
766
773
  cwd: projectPath
767
774
  });
@@ -948,7 +955,7 @@ const migrate = command({
948
955
  description: "Run migrations",
949
956
  handler: async (args) => {
950
957
  if (args.debug) console.log(args);
951
- const { startMigrate } = await import("./migrate-ORExpVlJ.mjs");
958
+ const { startMigrate } = await import("./migrate-B6QBYDNX.mjs");
952
959
  await startMigrate(args);
953
960
  process.exit(0);
954
961
  }
@@ -1138,7 +1145,7 @@ This command:
1138
1145
  });
1139
1146
  process.exit(0);
1140
1147
  }
1141
- const { startSwitchboard } = await import("./switchboard-C5AOMSKA.mjs");
1148
+ const { startSwitchboard } = await import("./switchboard-nHCI3pha.mjs");
1142
1149
  const { defaultDriveUrl, renown } = await startSwitchboard(args);
1143
1150
  console.log(" ➜ Switchboard:", defaultDriveUrl);
1144
1151
  if (renown) console.log(" ➜ Identity:", renown.did);
@@ -1176,7 +1183,7 @@ This command:
1176
1183
  try {
1177
1184
  console.log("Uninstalling dependencies 📦 ...");
1178
1185
  const uninstallCommand = await getPowerhouseProjectUninstallCommand(packageManager, args.dependencies);
1179
- execSync$1(uninstallCommand, {
1186
+ execSync(uninstallCommand, {
1180
1187
  stdio: "inherit",
1181
1188
  cwd: projectPath
1182
1189
  });
@@ -1325,7 +1332,7 @@ it never replaces the Vetra drive.
1325
1332
  args: vetraArgs,
1326
1333
  handler: async (args) => {
1327
1334
  if (args.debug) console.log(args);
1328
- const { startVetra } = await import("./vetra-DhhT9bQB.mjs");
1335
+ const { startVetra } = await import("./vetra-s8gWslse.mjs");
1329
1336
  await startVetra(args);
1330
1337
  }
1331
1338
  }),
@@ -1453,4 +1460,4 @@ await main().catch(async (error) => {
1453
1460
  export {};
1454
1461
 
1455
1462
  //# sourceMappingURL=cli.mjs.map
1456
- //# debugId=3ab9cfff-6f9c-57a2-a989-3a29e9435207
1463
+ //# debugId=c3a1dfab-bfc7-5154-b9b2-43ce4f1fcb86