@powerhousedao/shared 6.2.3-dev.56 → 6.2.3-dev.58
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.
- package/dist/clis/args/common-BXabdhiO.mjs.map +1 -1
- package/dist/clis/args/{help-DVPTARGn.d.mts → help-KuqI-EEG.d.mts} +16 -3
- package/dist/clis/args/help-KuqI-EEG.d.mts.map +1 -0
- package/dist/clis/args/{help-DS1NlcJQ.mjs → help-bzmA6Muf.mjs} +29 -2
- package/dist/clis/args/help-bzmA6Muf.mjs.map +1 -0
- package/dist/clis/args/help.d.mts +1 -1
- package/dist/clis/args/help.mjs +1 -1
- package/dist/clis/args/index.d.mts +1 -1
- package/dist/clis/args/index.mjs +1 -1
- package/dist/clis/args/run-Yw1lziWC.mjs +23 -0
- package/dist/clis/args/run-Yw1lziWC.mjs.map +1 -0
- package/dist/clis/args/run.d.mts +15 -0
- package/dist/clis/args/run.d.mts.map +1 -0
- package/dist/clis/args/run.mjs +2 -0
- package/dist/clis/command-names.d.mts +1 -1
- package/dist/clis/command-names.mjs +1 -0
- package/dist/clis/command-names.mjs.map +1 -1
- package/dist/clis/constants.mjs +3 -1
- package/dist/clis/constants.mjs.map +1 -1
- package/dist/clis/feature-flags.d.mts +17 -0
- package/dist/clis/feature-flags.d.mts.map +1 -0
- package/dist/clis/feature-flags.mjs +21 -0
- package/dist/clis/feature-flags.mjs.map +1 -0
- package/dist/clis/index.d.mts +15 -2
- package/dist/clis/index.d.mts.map +1 -1
- package/dist/clis/index.mjs +51 -2
- package/dist/clis/index.mjs.map +1 -1
- package/dist/clis/types-BZBiwi6I.d.mts.map +1 -1
- package/dist/constants-DVJon33y.d.ts +9 -0
- package/dist/constants-DVJon33y.d.ts.map +1 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/registry/index.js.map +1 -1
- package/package.json +5 -1
- package/dist/clis/args/help-DS1NlcJQ.mjs.map +0 -1
- package/dist/clis/args/help-DVPTARGn.d.mts.map +0 -1
- package/dist/constants-HBAa-ako.d.ts +0 -9
- package/dist/constants-HBAa-ako.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-BXabdhiO.mjs","names":["AGENTS","_AGENTS"],"sources":["../../../clis/constants.ts","../../../clis/file-system/get-config.ts","../../../clis/args/common.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\n/**\n * Icon for the drives switchboard creates by default, inlined as a data URI.\n *\n * A remote URL is the wrong shape for this: the value is baked into the drive\n * document and rendered by every Connect that opens it, so the icon only\n * appears when that client can reach that host. A desktop or air-gapped install\n * cannot, and the ipfs.io gateway this previously pointed at now answers 403\n * regardless.\n *\n * The mark is drawn dark-on-light so it stays legible against either theme.\n */\nexport const DEFAULT_DRIVE_ICON =\n \"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23F3F5F7'/%3E%3Cpath%20fill='%23343839'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0059%200L3.41636%205.45646C2.44979%206.25682%202.3795%207.71452%203.26456%208.60418L5.54425%2010.8957C6.21311%2011.568%206.35783%2012.6012%205.89944%2013.4314L4.48126%2016H2.13333C0.955126%2016%200%2015.0449%200%2013.8667V2.13333C0%200.955126%200.955126%200%202.13333%200H10.0059ZM11.2436%200L10.0128%202.24221C9.55899%203.06891%209.70183%204.09549%2010.3641%204.7669L12.7825%207.21868C13.6656%208.11402%2013.5866%209.57512%2012.612%2010.37L5.70922%2016H13.8667C15.0449%2016%2016%2015.0449%2016%2013.8667V2.13333C16%200.955126%2015.0449%200%2013.8667%200H11.2436Z'/%3E%3C/svg%3E\" as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\nexport const PIECES_FRAMEWORK_PACKAGE = \"@powerhousedao/pieces-framework\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required. `devVersioned`\n// is for a workspace package the build inlines, which no consumer provides.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n devVersioned: [],\n },\n // Each piece is bundled whole (build-pieces.mts), framework included, so the\n // framework is only ever needed to compile the piece's own source.\n piece: {\n peerVersioned: [],\n peerExternal: {},\n devVersioned: [PIECES_FRAMEWORK_PACKAGE],\n },\n} as const satisfies Record<\n string,\n {\n peerVersioned: readonly string[];\n peerExternal: Record<string, PeerSpec>;\n devVersioned: readonly string[];\n }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n // uniform-runners: the generic compound runner the scaffolded\n // hosts/desktop/host.js names; dormant in classic projects until the\n // feature flag defaults on.\n \"@powerhousedao/host-core\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"5.0.3\",\n oxfmt: \"0.68.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"~7.0.2\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"5.0.3\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import {\n array,\n boolean,\n command,\n flag,\n multioption,\n number,\n oneOf,\n option,\n optional,\n string,\n} from \"cmd-ts\";\n// Sub-path: avoids pulling the package-manager-detector runtime here,\n// which `oneOf(AGENTS)` below would force at module load.\nimport type { Agent } from \"package-manager-detector\";\nimport { AGENTS as _AGENTS } from \"package-manager-detector/constants\";\nimport {\n DEFAULT_TIMEOUT,\n DRIVES_PRESERVE_STRATEGIES,\n LOG_LEVELS,\n} from \"../constants.js\";\nimport { getConfig } from \"../file-system/get-config.js\";\n\nexport const AGENTS: Agent[] = _AGENTS;\n\nexport const debugArgs = {\n debug: flag({\n type: optional(boolean),\n long: \"debug\",\n description: \"Log arguments passed to this command\",\n }),\n};\n\nexport const buildArgs = {\n outDir: option({\n type: string,\n long: \"out-dir\",\n description: \"Where to output the bundled code\",\n defaultValue: () => \"dist\" as const,\n defaultValueIsSerializable: true,\n }),\n noSharedDeps: flag({\n type: boolean,\n long: \"no-shared-deps\",\n description:\n \"Bundle the shared dependency set instead of externalizing it (default: externalize)\",\n defaultValue: () => false as const,\n defaultValueIsSerializable: true,\n }),\n ignoreTypeErrors: flag({\n type: boolean,\n long: \"ignore-type-errors\",\n description:\n \"Unsafe: build even when tsc reports type errors, without asking. The package can load and still fail at runtime\",\n defaultValue: () => false as const,\n defaultValueIsSerializable: true,\n }),\n ...debugArgs,\n};\n\nexport const packageManagerArgs = {\n packageManager: option({\n type: optional(oneOf(AGENTS)),\n long: \"package-manager\",\n short: \"p\",\n description:\n \"Specify the package manager to use for your project. Can be one of: `npm`, `pnpm`, `yarn`, or `bun`. Defaults to your environment package manager.\",\n }),\n npm: flag({\n type: optional(boolean),\n long: \"npm\",\n description: \"Use 'npm' as package manager\",\n }),\n pnpm: flag({\n type: optional(boolean),\n long: \"pnpm\",\n description: \"Use 'pnpm' as package manager\",\n }),\n yarn: flag({\n type: optional(boolean),\n long: \"yarn\",\n description: \"Use 'yarn' as package manager\",\n }),\n bun: flag({\n type: optional(boolean),\n long: \"bun\",\n description: \"Use 'bun' as package manager\",\n }),\n};\nexport const getPackageManagerCommand = command({\n name: \"get-package-manager\",\n args: packageManagerArgs,\n handler: (args) => args,\n});\nexport const packages = option({\n type: optional(string),\n long: \"packages\",\n description: \"Comma-separated list of package names to load\",\n env: \"PH_PACKAGES\" as const,\n});\n\nexport const localPackage = option({\n type: optional(string),\n long: \"local-package\",\n description: \"Path to local package to load during development\",\n env: \"PH_LOCAL_PACKAGE\" as const,\n});\n\nexport const disableLocalPackages = flag({\n type: boolean,\n long: \"ignore-local\",\n description: \"Do not load local packages from this project\",\n defaultValue: () => false,\n});\n\nexport const httpsKeyFile = option({\n type: optional(string),\n long: \"https-key-file\",\n description: \"path to the ssl key file\",\n defaultValue: () => {\n const baseConfig = getConfig();\n const https = baseConfig.reactor?.https;\n if (https === undefined) return undefined;\n if (typeof https === \"boolean\") return undefined;\n return https.keyPath;\n },\n});\n\nexport const httpsCertFile = option({\n type: optional(string),\n long: \"https-cert-file\",\n description: \"path to the ssl cert file\",\n defaultValue: () => {\n const baseConfig = getConfig();\n const https = baseConfig.reactor?.https;\n if (https === undefined) return undefined;\n if (typeof https === \"boolean\") return undefined;\n return https.certPath;\n },\n});\n\nexport const https = flag({\n type: optional(boolean),\n long: \"https\",\n description: \"Use https\",\n defaultValue: () => {\n const baseConfig = getConfig();\n const https = baseConfig.reactor?.https;\n if (typeof https === \"boolean\") return https;\n return undefined;\n },\n});\n\nexport const vetraSwitchboardArgs = {\n https,\n httpsKeyFile,\n httpsCertFile,\n dev: flag({\n type: optional(boolean),\n long: \"dev\",\n description: \"enable development mode to load local packages\",\n }),\n remoteDrives: multioption({\n type: array(string),\n long: \"remote-drives\",\n description: \"Specify remote drive URLs to use\",\n defaultValue: () => [],\n }),\n disableLocalPackages,\n ...debugArgs,\n};\n\nexport const defaultDrivesUrl = option({\n type: optional(string),\n long: \"default-drives-url\",\n description: \"Comma-separated drive URLs to use as Connect's default drives.\",\n defaultValue: () => \"\",\n});\n\nexport const logLevel = option({\n type: oneOf(LOG_LEVELS),\n long: \"log-level\",\n description: \"Log level for the application\",\n defaultValue: () => \"info\" as const,\n defaultValueIsSerializable: true,\n env: \"PH_CONNECT_LOG_LEVEL\" as const,\n});\n\nexport const connectBasePath = option({\n long: \"base\",\n type: string,\n description: \"Base path for the app\",\n defaultValue: () => \"/\",\n});\n\nexport const renownNamespace = option({\n type: optional(string),\n long: \"renown-namespace\",\n description:\n \"Renown localStorage namespace; share it across Connects to share login.\",\n});\n\nexport const renownSwitchboardUrl = option({\n type: optional(string),\n long: \"renown-switchboard-url\",\n description:\n \"Override connect.renown.switchboardUrl. When set, enables in-page Renown sign-in.\",\n});\n\nexport const drivesPreserveStrategy = option({\n type: oneOf(DRIVES_PRESERVE_STRATEGIES),\n long: \"drive-preserve-strategy\",\n description: \"The preservation strategy to use on default drives\",\n defaultValue: () => \"preserve-by-url-and-detach\" as const,\n defaultValueIsSerializable: true,\n});\n\nexport const force = flag({\n type: optional(boolean),\n long: \"force\",\n description:\n \"Force dep pre-optimization regardless of whether deps have changed.\",\n});\n\nexport const commonArgs = {\n connectBasePath,\n logLevel,\n packages,\n localPackage,\n disableLocalPackages,\n defaultDrivesUrl,\n drivesPreserveStrategy,\n force,\n ...debugArgs,\n};\n\nexport const commonServerArgs = {\n host: option({\n type: optional(string),\n long: \"host\",\n description:\n \"Expose the server to the network. Pass an IP (e.g. 0.0.0.0) to bind to a specific address.\",\n }),\n open: flag({\n type: optional(boolean),\n long: \"open\",\n description: \"Open browser on startup\",\n }),\n cors: flag({\n type: optional(boolean),\n long: \"cors\",\n description: \"Enable CORS\",\n }),\n strictPort: flag({\n type: optional(boolean),\n long: \"strictPort\",\n description: \"Exit if specified port is already in use\",\n }),\n printUrls: flag({\n type: boolean,\n long: \"print-urls\",\n description: \"Print server urls\",\n defaultValue: () => true,\n defaultValueIsSerializable: true,\n }),\n bindCLIShortcuts: flag({\n type: boolean,\n long: \"bind-cli-shortcuts\",\n description: \"Bind CLI shortcuts\",\n defaultValue: () => true,\n defaultValueIsSerializable: true,\n }),\n watchTimeout: option({\n type: number,\n long: \"watch-timeout\",\n description: \"Amount of time to wait before a file is considered changed\",\n defaultValue: () => DEFAULT_TIMEOUT,\n defaultValueIsSerializable: true,\n }),\n};\n"],"mappings":";;;;;;AAKA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;AACF;AAMA,MAAa,6BAA6B,CACxC,gBACA,4BACF;AAEA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,8BAA8B;AAE3C,MAAa,6BAA6B;AAE1C,MAAa,+BAA+B;AAE5C,MAAa,yBAAyB;AAEtC,MAAa,qBAAqB;AAIlC,MAAa,2BAA2B;AAwCxC,MAAa,yBAAyB;AAStC,MAAa,WAAW,QAAQ;AAEK,KAAK,UAAA,KAA4B;AAGtE,MAAa,8BAA8B,CACzC,kBACA,gCACF;AA2BA,MAAa,uBAAuB;CAClC,oBAAoB;EAClB,eAAe,CAAC,sCAA6B;EAC7C,cAAc,CAAC;EACf,cAAc,CAAC;CACjB;CAGA,OAAO;EACL,eAAe,CAAC;EAChB,cAAc,CAAC;EACf,cAAc,CAAC,iCAAwB;CACzC;AACF;AASsC,CACpC,GAAG,6BACH,GAAG,qBAAqB,mBAAmB,aAC7C;AA0MA,MAAa,iBAAmC;CAC9C,mBAAmB;CACnB,YAAY;CACZ,eAAe;C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ACN,MAAM;EACN,aAAa;EACb,oBAAA;EACA,4BAA4B;CAC9B,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"common-BXabdhiO.mjs","names":["AGENTS","_AGENTS"],"sources":["../../../clis/constants.ts","../../../clis/file-system/get-config.ts","../../../clis/args/common.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\n/**\n * Icon for the drives switchboard creates by default, inlined as a data URI.\n *\n * A remote URL is the wrong shape for this: the value is baked into the drive\n * document and rendered by every Connect that opens it, so the icon only\n * appears when that client can reach that host. A desktop or air-gapped install\n * cannot, and the ipfs.io gateway this previously pointed at now answers 403\n * regardless.\n *\n * The mark is drawn dark-on-light so it stays legible against either theme.\n */\nexport const DEFAULT_DRIVE_ICON =\n \"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23F3F5F7'/%3E%3Cpath%20fill='%23343839'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0059%200L3.41636%205.45646C2.44979%206.25682%202.3795%207.71452%203.26456%208.60418L5.54425%2010.8957C6.21311%2011.568%206.35783%2012.6012%205.89944%2013.4314L4.48126%2016H2.13333C0.955126%2016%200%2015.0449%200%2013.8667V2.13333C0%200.955126%200.955126%200%202.13333%200H10.0059ZM11.2436%200L10.0128%202.24221C9.55899%203.06891%209.70183%204.09549%2010.3641%204.7669L12.7825%207.21868C13.6656%208.11402%2013.5866%209.57512%2012.612%2010.37L5.70922%2016H13.8667C15.0449%2016%2016%2015.0449%2016%2013.8667V2.13333C16%200.955126%2015.0449%200%2013.8667%200H11.2436Z'/%3E%3C/svg%3E\" as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\nexport const PIECES_FRAMEWORK_PACKAGE = \"@powerhousedao/pieces-framework\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required. `devVersioned`\n// is for a workspace package the build inlines, which no consumer provides.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n devVersioned: [],\n },\n // Each piece is bundled whole (build-pieces.mts), framework included, so the\n // framework is only ever needed to compile the piece's own source.\n piece: {\n peerVersioned: [],\n peerExternal: {},\n devVersioned: [PIECES_FRAMEWORK_PACKAGE],\n },\n} as const satisfies Record<\n string,\n {\n peerVersioned: readonly string[];\n peerExternal: Record<string, PeerSpec>;\n devVersioned: readonly string[];\n }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n // uniform-runners: the runner modules the scaffolded hosts/*/host.js\n // files name (desktop runner, clint-runner/mastra-runner, and the generic\n // compound they build on); dormant in classic projects until the feature\n // flag defaults on.\n \"@powerhousedao/host-core\",\n \"@powerhousedao/clint\",\n \"@powerhousedao/desktop\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"5.0.3\",\n oxfmt: \"0.68.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"~7.0.2\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"5.0.3\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import {\n array,\n boolean,\n command,\n flag,\n multioption,\n number,\n oneOf,\n option,\n optional,\n string,\n} from \"cmd-ts\";\n// Sub-path: avoids pulling the package-manager-detector runtime here,\n// which `oneOf(AGENTS)` below would force at module load.\nimport type { Agent } from \"package-manager-detector\";\nimport { AGENTS as _AGENTS } from \"package-manager-detector/constants\";\nimport {\n DEFAULT_TIMEOUT,\n DRIVES_PRESERVE_STRATEGIES,\n LOG_LEVELS,\n} from \"../constants.js\";\nimport { getConfig } from \"../file-system/get-config.js\";\n\nexport const AGENTS: Agent[] = _AGENTS;\n\nexport const debugArgs = {\n debug: flag({\n type: optional(boolean),\n long: \"debug\",\n description: \"Log arguments passed to this command\",\n }),\n};\n\nexport const buildArgs = {\n outDir: option({\n type: string,\n long: \"out-dir\",\n description: \"Where to output the bundled code\",\n defaultValue: () => \"dist\" as const,\n defaultValueIsSerializable: true,\n }),\n noSharedDeps: flag({\n type: boolean,\n long: \"no-shared-deps\",\n description:\n \"Bundle the shared dependency set instead of externalizing it (default: externalize)\",\n defaultValue: () => false as const,\n defaultValueIsSerializable: true,\n }),\n ignoreTypeErrors: flag({\n type: boolean,\n long: \"ignore-type-errors\",\n description:\n \"Unsafe: build even when tsc reports type errors, without asking. The package can load and still fail at runtime\",\n defaultValue: () => false as const,\n defaultValueIsSerializable: true,\n }),\n ...debugArgs,\n};\n\nexport const packageManagerArgs = {\n packageManager: option({\n type: optional(oneOf(AGENTS)),\n long: \"package-manager\",\n short: \"p\",\n description:\n \"Specify the package manager to use for your project. Can be one of: `npm`, `pnpm`, `yarn`, or `bun`. Defaults to your environment package manager.\",\n }),\n npm: flag({\n type: optional(boolean),\n long: \"npm\",\n description: \"Use 'npm' as package manager\",\n }),\n pnpm: flag({\n type: optional(boolean),\n long: \"pnpm\",\n description: \"Use 'pnpm' as package manager\",\n }),\n yarn: flag({\n type: optional(boolean),\n long: \"yarn\",\n description: \"Use 'yarn' as package manager\",\n }),\n bun: flag({\n type: optional(boolean),\n long: \"bun\",\n description: \"Use 'bun' as package manager\",\n }),\n};\nexport const getPackageManagerCommand = command({\n name: \"get-package-manager\",\n args: packageManagerArgs,\n handler: (args) => args,\n});\nexport const packages = option({\n type: optional(string),\n long: \"packages\",\n description: \"Comma-separated list of package names to load\",\n env: \"PH_PACKAGES\" as const,\n});\n\nexport const localPackage = option({\n type: optional(string),\n long: \"local-package\",\n description: \"Path to local package to load during development\",\n env: \"PH_LOCAL_PACKAGE\" as const,\n});\n\nexport const disableLocalPackages = flag({\n type: boolean,\n long: \"ignore-local\",\n description: \"Do not load local packages from this project\",\n defaultValue: () => false,\n});\n\nexport const httpsKeyFile = option({\n type: optional(string),\n long: \"https-key-file\",\n description: \"path to the ssl key file\",\n defaultValue: () => {\n const baseConfig = getConfig();\n const https = baseConfig.reactor?.https;\n if (https === undefined) return undefined;\n if (typeof https === \"boolean\") return undefined;\n return https.keyPath;\n },\n});\n\nexport const httpsCertFile = option({\n type: optional(string),\n long: \"https-cert-file\",\n description: \"path to the ssl cert file\",\n defaultValue: () => {\n const baseConfig = getConfig();\n const https = baseConfig.reactor?.https;\n if (https === undefined) return undefined;\n if (typeof https === \"boolean\") return undefined;\n return https.certPath;\n },\n});\n\nexport const https = flag({\n type: optional(boolean),\n long: \"https\",\n description: \"Use https\",\n defaultValue: () => {\n const baseConfig = getConfig();\n const https = baseConfig.reactor?.https;\n if (typeof https === \"boolean\") return https;\n return undefined;\n },\n});\n\nexport const vetraSwitchboardArgs = {\n https,\n httpsKeyFile,\n httpsCertFile,\n dev: flag({\n type: optional(boolean),\n long: \"dev\",\n description: \"enable development mode to load local packages\",\n }),\n remoteDrives: multioption({\n type: array(string),\n long: \"remote-drives\",\n description: \"Specify remote drive URLs to use\",\n defaultValue: () => [],\n }),\n disableLocalPackages,\n ...debugArgs,\n};\n\nexport const defaultDrivesUrl = option({\n type: optional(string),\n long: \"default-drives-url\",\n description: \"Comma-separated drive URLs to use as Connect's default drives.\",\n defaultValue: () => \"\",\n});\n\nexport const logLevel = option({\n type: oneOf(LOG_LEVELS),\n long: \"log-level\",\n description: \"Log level for the application\",\n defaultValue: () => \"info\" as const,\n defaultValueIsSerializable: true,\n env: \"PH_CONNECT_LOG_LEVEL\" as const,\n});\n\nexport const connectBasePath = option({\n long: \"base\",\n type: string,\n description: \"Base path for the app\",\n defaultValue: () => \"/\",\n});\n\nexport const renownNamespace = option({\n type: optional(string),\n long: \"renown-namespace\",\n description:\n \"Renown localStorage namespace; share it across Connects to share login.\",\n});\n\nexport const renownSwitchboardUrl = option({\n type: optional(string),\n long: \"renown-switchboard-url\",\n description:\n \"Override connect.renown.switchboardUrl. When set, enables in-page Renown sign-in.\",\n});\n\nexport const drivesPreserveStrategy = option({\n type: oneOf(DRIVES_PRESERVE_STRATEGIES),\n long: \"drive-preserve-strategy\",\n description: \"The preservation strategy to use on default drives\",\n defaultValue: () => \"preserve-by-url-and-detach\" as const,\n defaultValueIsSerializable: true,\n});\n\nexport const force = flag({\n type: optional(boolean),\n long: \"force\",\n description:\n \"Force dep pre-optimization regardless of whether deps have changed.\",\n});\n\nexport const commonArgs = {\n connectBasePath,\n logLevel,\n packages,\n localPackage,\n disableLocalPackages,\n defaultDrivesUrl,\n drivesPreserveStrategy,\n force,\n ...debugArgs,\n};\n\nexport const commonServerArgs = {\n host: option({\n type: optional(string),\n long: \"host\",\n description:\n \"Expose the server to the network. Pass an IP (e.g. 0.0.0.0) to bind to a specific address.\",\n }),\n open: flag({\n type: optional(boolean),\n long: \"open\",\n description: \"Open browser on startup\",\n }),\n cors: flag({\n type: optional(boolean),\n long: \"cors\",\n description: \"Enable CORS\",\n }),\n strictPort: flag({\n type: optional(boolean),\n long: \"strictPort\",\n description: \"Exit if specified port is already in use\",\n }),\n printUrls: flag({\n type: boolean,\n long: \"print-urls\",\n description: \"Print server urls\",\n defaultValue: () => true,\n defaultValueIsSerializable: true,\n }),\n bindCLIShortcuts: flag({\n type: boolean,\n long: \"bind-cli-shortcuts\",\n description: \"Bind CLI shortcuts\",\n defaultValue: () => true,\n defaultValueIsSerializable: true,\n }),\n watchTimeout: option({\n type: number,\n long: \"watch-timeout\",\n description: \"Amount of time to wait before a file is considered changed\",\n defaultValue: () => DEFAULT_TIMEOUT,\n defaultValueIsSerializable: true,\n }),\n};\n"],"mappings":";;;;;;AAKA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;AACF;AAMA,MAAa,6BAA6B,CACxC,gBACA,4BACF;AAEA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,8BAA8B;AAE3C,MAAa,6BAA6B;AAE1C,MAAa,+BAA+B;AAE5C,MAAa,yBAAyB;AAEtC,MAAa,qBAAqB;AAIlC,MAAa,2BAA2B;AAwCxC,MAAa,yBAAyB;AAStC,MAAa,WAAW,QAAQ;AAEK,KAAK,UAAA,KAA4B;AAGtE,MAAa,8BAA8B,CACzC,kBACA,gCACF;AA2BA,MAAa,uBAAuB;CAClC,oBAAoB;EAClB,eAAe,CAAC,sCAA6B;EAC7C,cAAc,CAAC;EACf,cAAc,CAAC;CACjB;CAGA,OAAO;EACL,eAAe,CAAC;EAChB,cAAc,CAAC;EACf,cAAc,CAAC,iCAAwB;CACzC;AACF;AASsC,CACpC,GAAG,6BACH,GAAG,qBAAqB,mBAAmB,aAC7C;AA6MA,MAAa,iBAAmC;CAC9C,mBAAmB;CACnB,YAAY;CACZ,eAAe;CACf,cAAc;CACd,k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AAa;EACb,oBAAA;EACA,4BAA4B;CAC9B,CAAC;AACH"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
//#region clis/command-names.d.ts
|
|
2
|
-
declare const phCliCommandNames: readonly ["generate", "vetra", "connect", "build", "publish", "list", "l", "access-token", "registry-login", "inspect", "is", "migrate", "switchboard", "reactor", "login", "logout", "install", "add", "i", "uninstall", "remove"];
|
|
2
|
+
declare const phCliCommandNames: readonly ["run", "generate", "vetra", "connect", "build", "publish", "list", "l", "access-token", "registry-login", "inspect", "is", "migrate", "switchboard", "reactor", "login", "logout", "install", "add", "i", "uninstall", "remove"];
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region clis/args/help.d.ts
|
|
5
|
-
declare const
|
|
5
|
+
declare const allPhCliHelpCommands: {
|
|
6
|
+
run: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
7
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
}>>;
|
|
10
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
}, any> & {
|
|
13
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<any>>;
|
|
14
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased> & {
|
|
15
|
+
readonly name: "run";
|
|
16
|
+
readonly aliases: readonly [];
|
|
17
|
+
};
|
|
6
18
|
generate: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
7
19
|
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
8
20
|
[x: string]: any;
|
|
@@ -184,7 +196,8 @@ declare const phCliHelpCommands: {
|
|
|
184
196
|
readonly aliases: ["remove"];
|
|
185
197
|
};
|
|
186
198
|
};
|
|
199
|
+
declare const phCliHelpCommands: typeof allPhCliHelpCommands;
|
|
187
200
|
//#endregion
|
|
188
201
|
export { phCliCommandNames as n, phCliHelpCommands as t };
|
|
189
202
|
export {};
|
|
190
|
-
//# sourceMappingURL=help-
|
|
203
|
+
//# sourceMappingURL=help-KuqI-EEG.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-KuqI-EEG.d.mts","names":[],"sources":["../../../clis/command-names.ts","../../../clis/args/help.ts"],"mappings":";cAEa;;;cCqCP;EACJ,KAAG,+CAAA;;;;;;;;;;;;EAMH,UAAQ,+CAAA;;;;;;;;;;;;EAMR,OAAK,+CAAA;;;;;;;;;;;;EAOL,SAAO,+CAAA;;;;;;;;;;;;EAMP,OAAK,+CAAA;;;;;;;;;;;;EAML,SAAO,+CAAA;;;;;;;;;;;;EAMP,MAAI,+CAAA;;;;;;;;;;;;EAOJ,gBAAc,+CAAA;;;;;;;;;;;;EAMd,kBAAgB,+CAAA;;;;;;;;;;;;EAOhB,SAAO,+CAAA;;;;;;;;;;;;EAOP,SAAO,+CAAA;;;;;;;;;;;;EAMP,aAAW,+CAAA;;;;;;;;;;;;EAOX,OAAK,+CAAA;;;;;;;;;;;;EAML,QAAM,+CAAA;;;;;;;;;;;;EAMN,SAAO,+CAAA;;;;;;;;;;;;EAOP,WAAS,+CAAA;;;;;;;;;;;;;cAaE,0BAID"}
|
|
@@ -9,12 +9,32 @@ import { t as loginArgs } from "./login-CIFkQExi.mjs";
|
|
|
9
9
|
import { t as migrateArgs } from "./migrate-DwJGhc2d.mjs";
|
|
10
10
|
import { t as publishArgs } from "./publish-DHqlGWmL.mjs";
|
|
11
11
|
import { n as registryLoginArgs } from "./registry-DIwES3l2.mjs";
|
|
12
|
+
import { t as runArgs } from "./run-Yw1lziWC.mjs";
|
|
12
13
|
import { t as switchboardArgs } from "./switchboard-CCaAtU56.mjs";
|
|
13
14
|
import { t as uninstallArgs } from "./uninstall-3U0B8g5c.mjs";
|
|
14
15
|
import { r as vetraArgs } from "./vetra-BUNlAAPp.mjs";
|
|
15
16
|
import { command } from "cmd-ts";
|
|
17
|
+
//#region clis/feature-flags.ts
|
|
18
|
+
/**
|
|
19
|
+
* Feature toggles shared by the CLIs (ph-cli and ph-cmd's dispatch/help).
|
|
20
|
+
* Hand-rolled env predicates by the CLI convention — deliberately no
|
|
21
|
+
* OpenFeature dependency here; that stack belongs to the runtime apps.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Gates the uniform-runners surface: the `ph run` command (registration,
|
|
25
|
+
* help listing, and ph-cmd forwarding), host-name sugar, and the `ph init`
|
|
26
|
+
* hosts/ scaffold. Off by default; set to `1` or `true` to enable. Rollout
|
|
27
|
+
* plan: docs/plans/2026-10-13-uniform-runners.md.
|
|
28
|
+
*/
|
|
29
|
+
const UNIFORM_RUNNERS_FLAG = "FEATURE_UNIFORM_RUNNERS_ENABLED";
|
|
30
|
+
function isUniformRunnersEnabled(env = process.env) {
|
|
31
|
+
const value = env[UNIFORM_RUNNERS_FLAG]?.trim().toLowerCase();
|
|
32
|
+
return value === "1" || value === "true";
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
16
35
|
//#region clis/command-names.ts
|
|
17
36
|
const phCliCommandNames = [
|
|
37
|
+
"run",
|
|
18
38
|
"generate",
|
|
19
39
|
"vetra",
|
|
20
40
|
"connect",
|
|
@@ -49,7 +69,13 @@ function helpCommand(config) {
|
|
|
49
69
|
aliases
|
|
50
70
|
});
|
|
51
71
|
}
|
|
52
|
-
const
|
|
72
|
+
const allPhCliHelpCommands = {
|
|
73
|
+
run: helpCommand({
|
|
74
|
+
name: "run",
|
|
75
|
+
args: runArgs,
|
|
76
|
+
description: "Run a host from hosts/ with its runner",
|
|
77
|
+
handler: () => {}
|
|
78
|
+
}),
|
|
53
79
|
generate: helpCommand({
|
|
54
80
|
name: "generate",
|
|
55
81
|
args: generateArgs,
|
|
@@ -146,7 +172,8 @@ const phCliHelpCommands = {
|
|
|
146
172
|
handler: () => {}
|
|
147
173
|
})
|
|
148
174
|
};
|
|
175
|
+
const phCliHelpCommands = isUniformRunnersEnabled() ? allPhCliHelpCommands : (({ run: _run, ...rest }) => rest)(allPhCliHelpCommands);
|
|
149
176
|
//#endregion
|
|
150
177
|
export { phCliCommandNames as n, phCliHelpCommands as t };
|
|
151
178
|
|
|
152
|
-
//# sourceMappingURL=help-
|
|
179
|
+
//# sourceMappingURL=help-bzmA6Muf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-bzmA6Muf.mjs","names":[],"sources":["../../../clis/feature-flags.ts","../../../clis/command-names.ts","../../../clis/args/help.ts"],"sourcesContent":["/**\n * Feature toggles shared by the CLIs (ph-cli and ph-cmd's dispatch/help).\n * Hand-rolled env predicates by the CLI convention — deliberately no\n * OpenFeature dependency here; that stack belongs to the runtime apps.\n */\n\n/**\n * Gates the uniform-runners surface: the `ph run` command (registration,\n * help listing, and ph-cmd forwarding), host-name sugar, and the `ph init`\n * hosts/ scaffold. Off by default; set to `1` or `true` to enable. Rollout\n * plan: docs/plans/2026-10-13-uniform-runners.md.\n */\nexport const UNIFORM_RUNNERS_FLAG = \"FEATURE_UNIFORM_RUNNERS_ENABLED\";\n\nexport function isUniformRunnersEnabled(\n env: Record<string, string | undefined> = process.env,\n): boolean {\n const value = env[UNIFORM_RUNNERS_FLAG]?.trim().toLowerCase();\n return value === \"1\" || value === \"true\";\n}\n","// Hardcoded so ph-cmd's dispatch doesn't have to evaluate phCliHelpCommands.\n// The compile-time guard in args/help.ts catches drift.\nexport const phCliCommandNames = [\n \"run\",\n \"generate\",\n \"vetra\",\n \"connect\",\n \"build\",\n \"publish\",\n \"list\",\n \"l\",\n \"access-token\",\n \"registry-login\",\n \"inspect\",\n \"is\",\n \"migrate\",\n \"switchboard\",\n \"reactor\",\n \"login\",\n \"logout\",\n \"install\",\n \"add\",\n \"i\",\n \"uninstall\",\n \"remove\",\n] as const;\n","import { command } from \"cmd-ts\";\nimport { isUniformRunnersEnabled } from \"../feature-flags.js\";\nimport type { phCliCommandNames } from \"../command-names.js\";\nimport { accessTokenArgs } from \"./access-token.js\";\nimport { debugArgs } from \"./common.js\";\nimport { connectArgs } from \"./connect.js\";\nimport { generateArgs } from \"./generate.js\";\nimport { inspectArgs } from \"./inspect.js\";\nimport { installArgs } from \"./install.js\";\nimport { listArgs } from \"./list.js\";\nimport { loginArgs } from \"./login.js\";\nimport { migrateArgs } from \"./migrate.js\";\nimport { publishArgs } from \"./publish.js\";\nimport { registryLoginArgs } from \"./registry.js\";\nimport { runArgs } from \"./run.js\";\nimport { switchboardArgs } from \"./switchboard.js\";\nimport { uninstallArgs } from \"./uninstall.js\";\nimport { vetraArgs } from \"./vetra.js\";\n\n// Thin wrapper around `command()` that preserves the literal types of\n// `name` and `aliases` on the return value.\nfunction helpCommand<\n const N extends string,\n const A extends readonly string[] = readonly [],\n>(\n config: Parameters<typeof command>[0] & { name: N; aliases?: A },\n): ReturnType<typeof command> & { readonly name: N; readonly aliases: A } {\n const aliases = (config.aliases ?? ([] as readonly string[])) as A;\n // Forward the original config (with the normalized aliases) through cmd-ts\n // and re-attach the literal types via a localized cast.\n return Object.assign(command({ ...config, aliases: [...aliases] }), {\n name: config.name,\n aliases,\n }) as ReturnType<typeof command> & {\n readonly name: N;\n readonly aliases: A;\n };\n}\n\nconst allPhCliHelpCommands = {\n run: helpCommand({\n name: \"run\",\n args: runArgs,\n description: \"Run a host from hosts/ with its runner\",\n handler: () => {},\n }),\n generate: helpCommand({\n name: \"generate\",\n args: generateArgs,\n description: \"Generate powerhouse code\",\n handler: () => {},\n }),\n vetra: helpCommand({\n name: \"vetra\",\n args: vetraArgs,\n description:\n \"Starts Vetra development environment with switchboard, reactor, and connect\",\n handler: () => {},\n }),\n connect: helpCommand({\n name: \"connect\",\n args: connectArgs,\n description: \"Powerhouse Connect commands\",\n handler: () => {},\n }),\n build: helpCommand({\n name: \"build\",\n args: debugArgs,\n description: \"Build your project for publishing to the registry\",\n handler: () => {},\n }),\n publish: helpCommand({\n name: \"publish\",\n args: publishArgs,\n description: \"Publish a package to the Powerhouse registry\",\n handler: () => {},\n }),\n list: helpCommand({\n name: \"list\",\n aliases: [\"l\"],\n args: listArgs,\n description: \"List installed packages\",\n handler: () => {},\n }),\n \"access-token\": helpCommand({\n name: \"access-token\",\n args: accessTokenArgs,\n description: \"Generate a bearer token for API authentication\",\n handler: () => {},\n }),\n \"registry-login\": helpCommand({\n name: \"registry-login\",\n args: registryLoginArgs,\n description:\n \"Log in to a Powerhouse registry (writes a Renown bearer token to ~/.npmrc)\",\n handler: () => {},\n }),\n inspect: helpCommand({\n name: \"inspect\",\n aliases: [\"is\"],\n args: inspectArgs,\n description: \"Inspect a package\",\n handler: () => {},\n }),\n migrate: helpCommand({\n name: \"migrate\",\n args: migrateArgs,\n description: \"Run migrations\",\n handler: () => {},\n }),\n switchboard: helpCommand({\n name: \"switchboard\",\n aliases: [\"reactor\"],\n args: switchboardArgs,\n description: \"Starts local Switchboard\",\n handler: () => {},\n }),\n login: helpCommand({\n name: \"login\",\n args: loginArgs,\n description: \"Authenticate with Renown using your Ethereum wallet\",\n handler: () => {},\n }),\n logout: helpCommand({\n name: \"logout\",\n args: loginArgs,\n description: \"Deletes an existing session created with 'ph login'\",\n handler: () => {},\n }),\n install: helpCommand({\n name: \"install\",\n aliases: [\"add\", \"i\"],\n args: installArgs,\n description: \"Install a Powerhouse dependency\",\n handler: () => {},\n }),\n uninstall: helpCommand({\n name: \"uninstall\",\n aliases: [\"remove\"],\n args: uninstallArgs,\n description: \"Uninstall a Powerhouse dependency\",\n handler: () => {},\n }),\n};\n\n// `run` is flag-gated: with uniform-runners off it must not surface in help\n// or dispatch at all (ph-cli also skips its registration). The cast keeps the\n// FULL compile-time shape so the drift guard below still pairs the name lists\n// while the runtime object simply lacks the key.\nexport const phCliHelpCommands = (\n isUniformRunnersEnabled()\n ? allPhCliHelpCommands\n : (({ run: _run, ...rest }) => rest)(allPhCliHelpCommands)\n) as typeof allPhCliHelpCommands;\n\nexport { phCliCommandNames } from \"../command-names.js\";\n\n// Compile-time drift guard: phCliCommandNames must match the names+aliases\n// declared above. If you add or rename a command/alias, the type of\n// `_DerivedNames` changes and the assignment below errors until\n// `command-names.ts` is updated to match. Costs nothing at runtime.\ntype _DerivedNames = {\n [K in keyof typeof phCliHelpCommands]:\n | (typeof phCliHelpCommands)[K][\"name\"]\n | (typeof phCliHelpCommands)[K][\"aliases\"][number];\n}[keyof typeof phCliHelpCommands];\n\ntype _Names = (typeof phCliCommandNames)[number];\n\ntype _Equal<A, B> =\n (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2\n ? true\n : false;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst _phCliCommandNamesInSync: _Equal<_DerivedNames, _Names> extends true\n ? true\n : never = true;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,uBAAuB;AAEpC,SAAgB,wBACd,MAA0C,QAAQ,KACzC;CACT,MAAM,QAAQ,IAAI,qBAAqB,EAAE,KAAK,CAAC,CAAC,YAAY;CAC5D,OAAO,UAAU,OAAO,UAAU;AACpC;;;ACjBA,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;ACJA,SAAS,YAIP,QACwE;CACxE,MAAM,UAAW,OAAO,WAAY,CAAC;CAGrC,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AAe,CAAC;CAClB,CAAC;CACD,QAAQ,YAAY;EAClB,MAAM;EACN,MAAM;EACN,aAAa;EACb,eAAe,CAAC;CAClB,CAAC;CACD,SAAS,YAAY;EACnB,MAAM;EACN,SAAS,CAAC,OAAO,GAAG;EACpB,MAAM;EACN,aAAa;EACb,eAAe,CAAC;CAClB,CAAC;CACD,WAAW,YAAY;EACrB,MAAM;EACN,SAAS,CAAC,QAAQ;EAClB,MAAM;EACN,aAAa;EACb,eAAe,CAAC;CAClB,CAAC;AACH;AAMA,MAAa,oBACX,wBAAwB,IACpB,yBACE,EAAE,KAAK,MAAM,GAAG,WAAW,KAAA,CAAM,oBAAoB"}
|
package/dist/clis/args/help.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as phCliCommandNames, t as phCliHelpCommands } from "./help-
|
|
1
|
+
import { n as phCliCommandNames, t as phCliHelpCommands } from "./help-bzmA6Muf.mjs";
|
|
2
2
|
export { phCliCommandNames, phCliHelpCommands };
|
|
@@ -2,7 +2,7 @@ import { t as accessTokenArgs } from "./access-token-C5sKsH2O.mjs";
|
|
|
2
2
|
import { _ as packageManagerArgs, a as connectBasePath, b as renownSwitchboardUrl, c as disableLocalPackages, d as getPackageManagerCommand, f as https, g as logLevel, h as localPackage, i as commonServerArgs, l as drivesPreserveStrategy, m as httpsKeyFile, n as buildArgs, o as debugArgs, p as httpsCertFile, r as commonArgs, s as defaultDrivesUrl, t as AGENTS, u as force, v as packages, x as vetraSwitchboardArgs, y as renownNamespace } from "./common-Bnm859xU.mjs";
|
|
3
3
|
import { a as connectStudioArgs, i as connectPreviewArgs, n as connectBuildArgs, r as connectConfigArgs, t as connectArgs } from "./connect-DjeiqXus.mjs";
|
|
4
4
|
import { t as generateArgs } from "./generate-BPBBLeUD.mjs";
|
|
5
|
-
import { n as phCliCommandNames, t as phCliHelpCommands } from "./help-
|
|
5
|
+
import { n as phCliCommandNames, t as phCliHelpCommands } from "./help-KuqI-EEG.mjs";
|
|
6
6
|
import { t as initArgs } from "./init-CTaK80wE.mjs";
|
|
7
7
|
import { t as inspectArgs } from "./inspect-BjRmtB86.mjs";
|
|
8
8
|
import { t as installArgs } from "./install-B0tMyUMw.mjs";
|
package/dist/clis/args/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { _ as packageManagerArgs, a as connectBasePath, b as renownSwitchboardUr
|
|
|
2
2
|
import { t as accessTokenArgs } from "./access-token-3Hqv_U8I.mjs";
|
|
3
3
|
import { a as connectStudioArgs, i as connectPreviewArgs, n as connectBuildArgs, r as connectConfigArgs, t as connectArgs } from "./connect-BG3HkYBk.mjs";
|
|
4
4
|
import { t as generateArgs } from "./generate-BOItUNvP.mjs";
|
|
5
|
+
import { n as phCliCommandNames, t as phCliHelpCommands } from "./help-bzmA6Muf.mjs";
|
|
5
6
|
import { t as inspectArgs } from "./inspect-UNQgtuR0.mjs";
|
|
6
7
|
import { t as installArgs } from "./install-F-27kF6m.mjs";
|
|
7
8
|
import { t as listArgs } from "./list-Bkfn8Yuo.mjs";
|
|
@@ -12,7 +13,6 @@ import { n as registryLoginArgs, t as DEFAULT_REGISTRY_LOGIN_EXPIRY } from "./re
|
|
|
12
13
|
import { t as switchboardArgs } from "./switchboard-CCaAtU56.mjs";
|
|
13
14
|
import { t as uninstallArgs } from "./uninstall-3U0B8g5c.mjs";
|
|
14
15
|
import { n as resolveSwitchboardPortDefault, r as vetraArgs, t as resolveConnectPortDefault } from "./vetra-BUNlAAPp.mjs";
|
|
15
|
-
import { n as phCliCommandNames, t as phCliHelpCommands } from "./help-DS1NlcJQ.mjs";
|
|
16
16
|
import { t as initArgs } from "./init-xlCNZ8Oe.mjs";
|
|
17
17
|
import { t as serviceArgs } from "./service-Cpjlyeu5.mjs";
|
|
18
18
|
import { t as unpublishArgs } from "./unpublish-s9zUh6Gw.mjs";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { boolean, flag, optional, positional, string } from "cmd-ts";
|
|
2
|
+
//#region clis/args/run.ts
|
|
3
|
+
const runArgs = {
|
|
4
|
+
host: positional({
|
|
5
|
+
type: string,
|
|
6
|
+
displayName: "host",
|
|
7
|
+
description: "the host to run (a directory under hosts/)"
|
|
8
|
+
}),
|
|
9
|
+
verb: positional({
|
|
10
|
+
type: optional(string),
|
|
11
|
+
displayName: "verb",
|
|
12
|
+
description: "optional verb the runner forwards (dev, build, serve, …)"
|
|
13
|
+
}),
|
|
14
|
+
debug: flag({
|
|
15
|
+
type: optional(boolean),
|
|
16
|
+
long: "debug",
|
|
17
|
+
description: "verbose runner diagnostics"
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { runArgs as t };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=run-Yw1lziWC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-Yw1lziWC.mjs","names":[],"sources":["../../../clis/args/run.ts"],"sourcesContent":["import { boolean, flag, optional, positional, string } from \"cmd-ts\";\n\n// Mirrors clis/ph-cli/src/commands/run.ts — the uniform-runners entry point.\n// Kept here so ph-cmd's help/dispatch (phCliHelpCommands) can describe it;\n// the command itself stays flag-gated in ph-cli (FEATURE_UNIFORM_RUNNERS_ENABLED).\nexport const runArgs = {\n host: positional({\n type: string,\n displayName: \"host\",\n description: \"the host to run (a directory under hosts/)\",\n }),\n verb: positional({\n type: optional(string),\n displayName: \"verb\",\n description: \"optional verb the runner forwards (dev, build, serve, …)\",\n }),\n debug: flag({\n type: optional(boolean),\n long: \"debug\",\n description: \"verbose runner diagnostics\",\n }),\n};\n"],"mappings":";;AAKA,MAAa,UAAU;CACrB,MAAM,WAAW;EACf,MAAM;EACN,aAAa;EACb,aAAa;CACf,CAAC;CACD,MAAM,WAAW;EACf,MAAM,SAAS,MAAM;EACrB,aAAa;EACb,aAAa;CACf,CAAC;CACD,OAAO,KAAK;EACV,MAAM,SAAS,OAAO;EACtB,MAAM;EACN,aAAa;CACf,CAAC;AACH"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region clis/args/run.d.ts
|
|
2
|
+
export declare const runArgs: {
|
|
3
|
+
host: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
4
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<string>>;
|
|
5
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Descriptive>;
|
|
6
|
+
verb: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
7
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<string | undefined>>;
|
|
8
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Descriptive>;
|
|
9
|
+
debug: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
10
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<boolean | undefined>>;
|
|
11
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/argparser.js").Register & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Descriptive>;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=run.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.mts","names":[],"sources":["../../../clis/args/run.ts"],"mappings":";qBAKa;EACX,MAAI,+CAAA;;;EAKJ,MAAI,+CAAA;;;EAKJ,OAAK,+CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region clis/command-names.d.ts
|
|
2
|
-
export declare const phCliCommandNames: readonly ["generate", "vetra", "connect", "build", "publish", "list", "l", "access-token", "registry-login", "inspect", "is", "migrate", "switchboard", "reactor", "login", "logout", "install", "add", "i", "uninstall", "remove"];
|
|
2
|
+
export declare const phCliCommandNames: readonly ["run", "generate", "vetra", "connect", "build", "publish", "list", "l", "access-token", "registry-login", "inspect", "is", "migrate", "switchboard", "reactor", "login", "logout", "install", "add", "i", "uninstall", "remove"];
|
|
3
3
|
//#endregion
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=command-names.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-names.mjs","names":[],"sources":["../../clis/command-names.ts"],"sourcesContent":["// Hardcoded so ph-cmd's dispatch doesn't have to evaluate phCliHelpCommands.\n// The compile-time guard in args/help.ts catches drift.\nexport const phCliCommandNames = [\n \"generate\",\n \"vetra\",\n \"connect\",\n \"build\",\n \"publish\",\n \"list\",\n \"l\",\n \"access-token\",\n \"registry-login\",\n \"inspect\",\n \"is\",\n \"migrate\",\n \"switchboard\",\n \"reactor\",\n \"login\",\n \"logout\",\n \"install\",\n \"add\",\n \"i\",\n \"uninstall\",\n \"remove\",\n] as const;\n"],"mappings":";AAEA,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
1
|
+
{"version":3,"file":"command-names.mjs","names":[],"sources":["../../clis/command-names.ts"],"sourcesContent":["// Hardcoded so ph-cmd's dispatch doesn't have to evaluate phCliHelpCommands.\n// The compile-time guard in args/help.ts catches drift.\nexport const phCliCommandNames = [\n \"run\",\n \"generate\",\n \"vetra\",\n \"connect\",\n \"build\",\n \"publish\",\n \"list\",\n \"l\",\n \"access-token\",\n \"registry-login\",\n \"inspect\",\n \"is\",\n \"migrate\",\n \"switchboard\",\n \"reactor\",\n \"login\",\n \"logout\",\n \"install\",\n \"add\",\n \"i\",\n \"uninstall\",\n \"remove\",\n] as const;\n"],"mappings":";AAEA,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
package/dist/clis/constants.mjs
CHANGED
|
@@ -114,7 +114,9 @@ const VERSIONED_DEV_DEPENDENCIES = [
|
|
|
114
114
|
"@powerhousedao/shared",
|
|
115
115
|
"@powerhousedao/connect",
|
|
116
116
|
"@powerhousedao/design-system",
|
|
117
|
-
"@powerhousedao/host-core"
|
|
117
|
+
"@powerhousedao/host-core",
|
|
118
|
+
"@powerhousedao/clint",
|
|
119
|
+
"@powerhousedao/desktop"
|
|
118
120
|
];
|
|
119
121
|
const packageJsonExports = {
|
|
120
122
|
".": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":[],"sources":["../../clis/constants.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\n/**\n * Icon for the drives switchboard creates by default, inlined as a data URI.\n *\n * A remote URL is the wrong shape for this: the value is baked into the drive\n * document and rendered by every Connect that opens it, so the icon only\n * appears when that client can reach that host. A desktop or air-gapped install\n * cannot, and the ipfs.io gateway this previously pointed at now answers 403\n * regardless.\n *\n * The mark is drawn dark-on-light so it stays legible against either theme.\n */\nexport const DEFAULT_DRIVE_ICON =\n \"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23F3F5F7'/%3E%3Cpath%20fill='%23343839'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0059%200L3.41636%205.45646C2.44979%206.25682%202.3795%207.71452%203.26456%208.60418L5.54425%2010.8957C6.21311%2011.568%206.35783%2012.6012%205.89944%2013.4314L4.48126%2016H2.13333C0.955126%2016%200%2015.0449%200%2013.8667V2.13333C0%200.955126%200.955126%200%202.13333%200H10.0059ZM11.2436%200L10.0128%202.24221C9.55899%203.06891%209.70183%204.09549%2010.3641%204.7669L12.7825%207.21868C13.6656%208.11402%2013.5866%209.57512%2012.612%2010.37L5.70922%2016H13.8667C15.0449%2016%2016%2015.0449%2016%2013.8667V2.13333C16%200.955126%2015.0449%200%2013.8667%200H11.2436Z'/%3E%3C/svg%3E\" as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\nexport const PIECES_FRAMEWORK_PACKAGE = \"@powerhousedao/pieces-framework\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required. `devVersioned`\n// is for a workspace package the build inlines, which no consumer provides.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n devVersioned: [],\n },\n // Each piece is bundled whole (build-pieces.mts), framework included, so the\n // framework is only ever needed to compile the piece's own source.\n piece: {\n peerVersioned: [],\n peerExternal: {},\n devVersioned: [PIECES_FRAMEWORK_PACKAGE],\n },\n} as const satisfies Record<\n string,\n {\n peerVersioned: readonly string[];\n peerExternal: Record<string, PeerSpec>;\n devVersioned: readonly string[];\n }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n // uniform-runners: the generic compound runner the scaffolded\n // hosts/desktop/host.js names; dormant in classic projects until the\n // feature flag defaults on.\n \"@powerhousedao/host-core\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"5.0.3\",\n oxfmt: \"0.68.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"~7.0.2\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"5.0.3\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n"],"mappings":";;;AAKA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,iBAAiB;AAC9B,MAAa,sBAAsB;AACnC,MAAa,yBAAA,IAA+C;AAE5D,MAAa,6BAA6B,CACxC,gBACA,4BACF;AAEA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,kBAAkB;AAE/B,MAAa,8BAA8B;AAE3C,MAAa,6BAA6B;AAE1C,MAAa,+BAA+B;AAE5C,MAAa,yBAAyB;AAEtC,MAAa,qBAAqB;AAElC,MAAa,uBAAuB;AAEpC,MAAa,2BAA2B;AAqBxC,MAAa,yBAAyB;AACtC,MAAa,gCAAgC;AAC7C,MAAa,2BAA2B;AACxC,MAAa,kCAAkC;;;;;;;;;;;;AAa/C,MAAa,qBACX;AAEF,MAAa,yBAAyB;AAEtC,MAAa,uBAAuB;AACpC,MAAa,SAAS;AACtB,MAAa,yBAAyB;AACtC,MAAa,qBAAqB;AAElC,MAAa,yBAAA;AAEb,MAAa,WAAW,QAAQ;AAEhC,MAAa,wBAAwB,KAAK,UAAA,KAA4B;AAGtE,MAAa,8BAA8B,CACzC,kBACA,gCACF;AAIA,MAAa,sBAAsB;AACnC,MAAa,gCACX;AACF,MAAa,kBAAkB;AAC/B,MAAa,sBAAsB;AACnC,MAAa,2BAA2B;AAQxC,MAAa,6BAA6B;EACvC,kBAAkB;EAAE,MAAM;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;CACL,aAAa;CACb,UAAU;CACV,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,mBACE;CACF,qBACE;AACJ;AAEA,MAAa,uBAAuB,CAAC;AAIrC,MAAa,kCAAkC;CAC7C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,2BAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,0BAA0B;CACrC,wBAAwB;CACxB,8BAA8B;CAC9B,uCAAuC;CACvC,oBAAoB;CACpB,qBAAqB;CACrB,eAAe;CACf,gBAAgB;CAChB,oBAAoB;CACpB,wBAAwB;CACxB,uBAAuB;CACvB,OAAO;CACP,QAAQ;CACR,mBAAmB;CACnB,aAAa;CACb,YAAY;CACZ,MAAM;CACN,uBAAuB;CACvB,QAAQ;AACV;AAEA,MAAa,kBAA4B;CACvC,MAAM;CACN,aAAa;CACb,UAAU;CACV,WAAW;EACT,MAAM;EACN,KAAK;CACP;CACA,gBAAgB,CAAC;CACjB,SAAS,CAAC;CACV,MAAM,CAAC;CACP,WAAW,CAAC;CACZ,YAAY,CAAC;AACf;AAUA,MAAa,iBAAmC;CAC9C,mBAAmB;CACnB,YAAY;CACZ,eAAe;CACf,cAAc;CACd,kBAAkB;CAClB,YAAY;CACZ,UAAU;CACV,MAAM;EACJ,SAAS;EACT,QAAQ,CAAC;CACX;AACF"}
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../clis/constants.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\n// Per-project dev-server port bands. `ph init` assigns each project a port\n// triple derived from its name, so two projects never collide and an agent's\n// MCP URL can be baked into .mcp.json before a session starts.\n//\n// Two hard constraints picked these bands, both below 10000:\n//\n// 1. Below the OS ephemeral range. Linux allocates outbound source ports\n// from 32768-60999 (`/proc/sys/net/ipv4/ip_local_port_range`); macOS and\n// Windows start at 49152. A listener parked in that window can lose a\n// race to a transient outbound socket, which would surface as a\n// `--strictPort` failure blaming a project conflict that does not exist.\n// 2. Below 10000, which is where ph-clint starts. ph-clint derives its own\n// per-CLI ports by hashing into 10000-59900, so staying under 10000\n// keeps the two schemes from ever contending.\n//\n// Within those limits the blocks were chosen by measuring which ports the\n// Powerhouse repos actually reference: 2000-2999 has none, 7000-7999 has one,\n// 6000-6999 has five. See PROJECT_PORT_DENYLIST in project-ports.ts for the\n// individual ports skipped inside them.\nexport const PROJECT_PORT_BAND_SIZE = 1000 as const;\nexport const PROJECT_PORT_BAND_SWITCHBOARD = 7000 as const;\nexport const PROJECT_PORT_BAND_STUDIO = 6000 as const;\nexport const PROJECT_PORT_BAND_VETRA_CONNECT = 2000 as const;\n\n/**\n * Icon for the drives switchboard creates by default, inlined as a data URI.\n *\n * A remote URL is the wrong shape for this: the value is baked into the drive\n * document and rendered by every Connect that opens it, so the icon only\n * appears when that client can reach that host. A desktop or air-gapped install\n * cannot, and the ipfs.io gateway this previously pointed at now answers 403\n * regardless.\n *\n * The mark is drawn dark-on-light so it stays legible against either theme.\n */\nexport const DEFAULT_DRIVE_ICON =\n \"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Crect%20width='16'%20height='16'%20rx='3'%20fill='%23F3F5F7'/%3E%3Cpath%20fill='%23343839'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.0059%200L3.41636%205.45646C2.44979%206.25682%202.3795%207.71452%203.26456%208.60418L5.54425%2010.8957C6.21311%2011.568%206.35783%2012.6012%205.89944%2013.4314L4.48126%2016H2.13333C0.955126%2016%200%2015.0449%200%2013.8667V2.13333C0%200.955126%200.955126%200%202.13333%200H10.0059ZM11.2436%200L10.0128%202.24221C9.55899%203.06891%209.70183%204.09549%2010.3641%204.7669L12.7825%207.21868C13.6656%208.11402%2013.5866%209.57512%2012.612%2010.37L5.70922%2016H13.8667C15.0449%2016%2016%2015.0449%2016%2013.8667V2.13333C16%200.955126%2015.0449%200%2013.8667%200H11.2436Z'/%3E%3C/svg%3E\" as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\nexport const PIECES_FRAMEWORK_PACKAGE = \"@powerhousedao/pieces-framework\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required. `devVersioned`\n// is for a workspace package the build inlines, which no consumer provides.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n devVersioned: [],\n },\n // Each piece is bundled whole (build-pieces.mts), framework included, so the\n // framework is only ever needed to compile the piece's own source.\n piece: {\n peerVersioned: [],\n peerExternal: {},\n devVersioned: [PIECES_FRAMEWORK_PACKAGE],\n },\n} as const satisfies Record<\n string,\n {\n peerVersioned: readonly string[];\n peerExternal: Record<string, PeerSpec>;\n devVersioned: readonly string[];\n }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// Single-version pins the boilerplate enforces on generated projects,\n// avoiding duplicates from coexisting version ranges. Rendered as pnpm\n// `overrides` (pnpm-workspace.yaml) and as yarn v1 `resolutions`\n// (package.json). Generated-project only — never change the monorepo\n// catalog for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_DEPENDENCY_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n // uniform-runners: the runner modules the scaffolded hosts/*/host.js\n // files name (desktop runner, clint-runner/mastra-runner, and the generic\n // compound they build on); dormant in classic projects until the feature\n // flag defaults on.\n \"@powerhousedao/host-core\",\n \"@powerhousedao/clint\",\n \"@powerhousedao/desktop\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n // Node only, as the build is: a piece is loaded by a host process, never by\n // the browser. Without these a package can build a piece and still fail the\n // `packageName/pieces` import a host resolves it through.\n \"./pieces\": {\n types: \"./dist/types/pieces/index.d.ts\",\n node: \"./dist/node/pieces/index.mjs\",\n },\n \"./pieces/*\": {\n types: \"./dist/types/pieces/*/index.d.ts\",\n node: \"./dist/node/pieces/*/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"5.0.3\",\n oxfmt: \"0.68.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"~7.0.2\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"5.0.3\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n"],"mappings":";;;AAKA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,iBAAiB;AAC9B,MAAa,sBAAsB;AACnC,MAAa,yBAAA,IAA+C;AAE5D,MAAa,6BAA6B,CACxC,gBACA,4BACF;AAEA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,kBAAkB;AAE/B,MAAa,8BAA8B;AAE3C,MAAa,6BAA6B;AAE1C,MAAa,+BAA+B;AAE5C,MAAa,yBAAyB;AAEtC,MAAa,qBAAqB;AAElC,MAAa,uB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M;CACR;CACA,aAAa;EACX,OAAO;EACP,SAAS;CACX;CACA,qBAAqB;EACnB,OAAO;EACP,SAAS;EACT,MAAM;CACR;CACA,uBAAuB;EACrB,OAAO;EACP,SAAS;EACT,MAAM;CACR;CACA,aAAa;EACX,OAAO;EACP,SAAS;EACT,MAAM;CACR;CACA,eAAe;EACb,OAAO;EACP,SAAS;EACT,MAAM;CACR;CACA,eAAe;EACb,OAAO;EACP,MAAM;CACR;CACA,gBAAgB;EACd,OAAO;EACP,SAAS;EACT,MAAM;CACR;CAIA,YAAY;EACV,OAAO;EACP,MAAM;CACR;CACA,cAAc;EACZ,OAAO;EACP,MAAM;CACR;CACA,cAAc;CACd,eAAe;AACjB;AAEA,MAAa,iBAAiB;CAC5B,cAAc;CACd,MAAM;CACN,YAAY;CACZ,QAAQ;CACR,gBAAgB;CAChB,KAAK;CACL,aAAa;CACb,UAAU;CACV,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,mBACE;CACF,qBACE;AACJ;AAEA,MAAa,uBAAuB,CAAC;AAIrC,MAAa,kCAAkC;CAC7C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,2BAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,0BAA0B;CACrC,wBAAwB;CACxB,8BAA8B;CAC9B,uCAAuC;CACvC,oBAAoB;CACpB,qBAAqB;CACrB,eAAe;CACf,gBAAgB;CAChB,oBAAoB;CACpB,wBAAwB;CACxB,uBAAuB;CACvB,OAAO;CACP,QAAQ;CACR,mBAAmB;CACnB,aAAa;CACb,YAAY;CACZ,MAAM;CACN,uBAAuB;CACvB,QAAQ;AACV;AAEA,MAAa,kBAA4B;CACvC,MAAM;CACN,aAAa;CACb,UAAU;CACV,WAAW;EACT,MAAM;EACN,KAAK;CACP;CACA,gBAAgB,CAAC;CACjB,SAAS,CAAC;CACV,MAAM,CAAC;CACP,WAAW,CAAC;CACZ,YAAY,CAAC;AACf;AAUA,MAAa,iBAAmC;CAC9C,mBAAmB;CACnB,YAAY;CACZ,eAAe;CACf,cAAc;CACd,kBAAkB;CAClB,YAAY;CACZ,UAAU;CACV,MAAM;EACJ,SAAS;EACT,QAAQ,CAAC;CACX;AACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region clis/feature-flags.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Feature toggles shared by the CLIs (ph-cli and ph-cmd's dispatch/help).
|
|
4
|
+
* Hand-rolled env predicates by the CLI convention — deliberately no
|
|
5
|
+
* OpenFeature dependency here; that stack belongs to the runtime apps.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Gates the uniform-runners surface: the `ph run` command (registration,
|
|
9
|
+
* help listing, and ph-cmd forwarding), host-name sugar, and the `ph init`
|
|
10
|
+
* hosts/ scaffold. Off by default; set to `1` or `true` to enable. Rollout
|
|
11
|
+
* plan: docs/plans/2026-10-13-uniform-runners.md.
|
|
12
|
+
*/
|
|
13
|
+
export declare const UNIFORM_RUNNERS_FLAG = "FEATURE_UNIFORM_RUNNERS_ENABLED";
|
|
14
|
+
export declare function isUniformRunnersEnabled(env?: Record<string, string | undefined>): boolean;
|
|
15
|
+
//#endregion
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=feature-flags.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-flags.d.mts","names":[],"sources":["../../clis/feature-flags.ts"],"mappings":";;;;;;;;;;;;qBAYa;wBAEG,wBACd,MAAK"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region clis/feature-flags.ts
|
|
2
|
+
/**
|
|
3
|
+
* Feature toggles shared by the CLIs (ph-cli and ph-cmd's dispatch/help).
|
|
4
|
+
* Hand-rolled env predicates by the CLI convention — deliberately no
|
|
5
|
+
* OpenFeature dependency here; that stack belongs to the runtime apps.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Gates the uniform-runners surface: the `ph run` command (registration,
|
|
9
|
+
* help listing, and ph-cmd forwarding), host-name sugar, and the `ph init`
|
|
10
|
+
* hosts/ scaffold. Off by default; set to `1` or `true` to enable. Rollout
|
|
11
|
+
* plan: docs/plans/2026-10-13-uniform-runners.md.
|
|
12
|
+
*/
|
|
13
|
+
const UNIFORM_RUNNERS_FLAG = "FEATURE_UNIFORM_RUNNERS_ENABLED";
|
|
14
|
+
function isUniformRunnersEnabled(env = process.env) {
|
|
15
|
+
const value = env[UNIFORM_RUNNERS_FLAG]?.trim().toLowerCase();
|
|
16
|
+
return value === "1" || value === "true";
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { UNIFORM_RUNNERS_FLAG, isUniformRunnersEnabled };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=feature-flags.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-flags.mjs","names":[],"sources":["../../clis/feature-flags.ts"],"sourcesContent":["/**\n * Feature toggles shared by the CLIs (ph-cli and ph-cmd's dispatch/help).\n * Hand-rolled env predicates by the CLI convention — deliberately no\n * OpenFeature dependency here; that stack belongs to the runtime apps.\n */\n\n/**\n * Gates the uniform-runners surface: the `ph run` command (registration,\n * help listing, and ph-cmd forwarding), host-name sugar, and the `ph init`\n * hosts/ scaffold. Off by default; set to `1` or `true` to enable. Rollout\n * plan: docs/plans/2026-10-13-uniform-runners.md.\n */\nexport const UNIFORM_RUNNERS_FLAG = \"FEATURE_UNIFORM_RUNNERS_ENABLED\";\n\nexport function isUniformRunnersEnabled(\n env: Record<string, string | undefined> = process.env,\n): boolean {\n const value = env[UNIFORM_RUNNERS_FLAG]?.trim().toLowerCase();\n return value === \"1\" || value === \"true\";\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,uBAAuB;AAEpC,SAAgB,wBACd,MAA0C,QAAQ,KACzC;CACT,MAAM,QAAQ,IAAI,qBAAqB,EAAE,KAAK,CAAC,CAAC,YAAY;CAC5D,OAAO,UAAU,OAAO,UAAU;AACpC"}
|
package/dist/clis/index.d.mts
CHANGED
|
@@ -748,10 +748,22 @@ export declare const generateArgs: {
|
|
|
748
748
|
};
|
|
749
749
|
//#endregion
|
|
750
750
|
//#region clis/command-names.d.ts
|
|
751
|
-
export declare const phCliCommandNames: readonly ["generate", "vetra", "connect", "build", "publish", "list", "l", "access-token", "registry-login", "inspect", "is", "migrate", "switchboard", "reactor", "login", "logout", "install", "add", "i", "uninstall", "remove"];
|
|
751
|
+
export declare const phCliCommandNames: readonly ["run", "generate", "vetra", "connect", "build", "publish", "list", "l", "access-token", "registry-login", "inspect", "is", "migrate", "switchboard", "reactor", "login", "logout", "install", "add", "i", "uninstall", "remove"];
|
|
752
752
|
//#endregion
|
|
753
753
|
//#region clis/args/help.d.ts
|
|
754
|
-
|
|
754
|
+
declare const allPhCliHelpCommands: {
|
|
755
|
+
run: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
756
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
757
|
+
[x: string]: any;
|
|
758
|
+
}>>;
|
|
759
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
760
|
+
[x: string]: any;
|
|
761
|
+
}, any> & {
|
|
762
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<any>>;
|
|
763
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased> & {
|
|
764
|
+
readonly name: "run";
|
|
765
|
+
readonly aliases: readonly [];
|
|
766
|
+
};
|
|
755
767
|
generate: Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
756
768
|
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
757
769
|
[x: string]: any;
|
|
@@ -933,6 +945,7 @@ export declare const phCliHelpCommands: {
|
|
|
933
945
|
readonly aliases: ["remove"];
|
|
934
946
|
};
|
|
935
947
|
};
|
|
948
|
+
export declare const phCliHelpCommands: typeof allPhCliHelpCommands;
|
|
936
949
|
//#endregion
|
|
937
950
|
//#region clis/args/init.d.ts
|
|
938
951
|
export declare const initArgs: {
|