@powerhousedao/shared 6.2.2-dev.2 → 6.2.2-dev.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/clis/args/access-token.mjs +1 -1
  2. package/dist/clis/args/{common-C5n5ai5C.d.mts → common-B_LcTLHX.d.mts} +5 -2
  3. package/dist/clis/args/{common-C5n5ai5C.d.mts.map → common-B_LcTLHX.d.mts.map} +1 -1
  4. package/dist/clis/args/{common-dbsvksvf.mjs → common-CcYbXrBx.mjs} +7 -2
  5. package/dist/clis/args/common-CcYbXrBx.mjs.map +1 -0
  6. package/dist/clis/args/common.d.mts +2 -2
  7. package/dist/clis/args/common.mjs +2 -2
  8. package/dist/clis/args/connect.d.mts +9 -0
  9. package/dist/clis/args/connect.d.mts.map +1 -1
  10. package/dist/clis/args/connect.mjs +2 -1
  11. package/dist/clis/args/connect.mjs.map +1 -1
  12. package/dist/clis/args/{generate-Cs5okckF.mjs → generate-CQ78RxVS.mjs} +2 -2
  13. package/dist/clis/args/{generate-Cs5okckF.mjs.map → generate-CQ78RxVS.mjs.map} +1 -1
  14. package/dist/clis/args/generate.mjs +1 -1
  15. package/dist/clis/args/{help-BkF9Cxud.mjs → help-Dk-d57W1.mjs} +3 -3
  16. package/dist/clis/args/{help-BkF9Cxud.mjs.map → help-Dk-d57W1.mjs.map} +1 -1
  17. package/dist/clis/args/help.mjs +1 -1
  18. package/dist/clis/args/index.d.mts +2 -2
  19. package/dist/clis/args/index.mjs +4 -4
  20. package/dist/clis/args/init.mjs +1 -1
  21. package/dist/clis/args/inspect.mjs +1 -1
  22. package/dist/clis/args/install.mjs +1 -1
  23. package/dist/clis/args/list.mjs +1 -1
  24. package/dist/clis/args/login.mjs +1 -1
  25. package/dist/clis/args/migrate.mjs +1 -1
  26. package/dist/clis/args/publish.mjs +1 -1
  27. package/dist/clis/args/registry.mjs +1 -1
  28. package/dist/clis/args/service.mjs +1 -1
  29. package/dist/clis/args/switchboard.mjs +1 -1
  30. package/dist/clis/args/uninstall.mjs +1 -1
  31. package/dist/clis/args/unpublish.mjs +1 -1
  32. package/dist/clis/args/vetra.mjs +1 -1
  33. package/dist/clis/build-config.d.mts +1 -1
  34. package/dist/clis/build-config.d.mts.map +1 -1
  35. package/dist/clis/constants.d.mts +156 -49
  36. package/dist/clis/constants.d.mts.map +1 -1
  37. package/dist/clis/constants.mjs +6 -2
  38. package/dist/clis/constants.mjs.map +1 -1
  39. package/dist/clis/index.d.mts +422 -4
  40. package/dist/clis/index.d.mts.map +1 -1
  41. package/dist/clis/index.mjs +258 -3
  42. package/dist/clis/index.mjs.map +1 -1
  43. package/dist/connect/config-loader.d.ts +2 -1
  44. package/dist/connect/config-loader.d.ts.map +1 -1
  45. package/dist/connect/index.d.ts +399 -2
  46. package/dist/connect/index.d.ts.map +1 -1
  47. package/dist/connect/index.js +465 -1
  48. package/dist/connect/index.js.map +1 -1
  49. package/dist/connect/json-adapter.d.ts.map +1 -1
  50. package/dist/{constants-C_EQX4DY.d.ts → constants-BP_gjn8g.d.ts} +1 -1
  51. package/dist/constants-BP_gjn8g.d.ts.map +1 -0
  52. package/dist/constants.d.ts +1 -1
  53. package/dist/document-drive/index.d.ts +2 -2
  54. package/dist/document-drive/index.d.ts.map +1 -1
  55. package/dist/document-model/index.d.ts +5 -5
  56. package/dist/document-model/index.js +702 -122
  57. package/dist/document-model/index.js.map +1 -1
  58. package/dist/document-model/mock.d.ts +1 -1
  59. package/dist/document-model/mock.js +32 -3
  60. package/dist/document-model/mock.js.map +1 -1
  61. package/dist/document-model/utils.d.ts +2 -2
  62. package/dist/document-model/utils.js +1 -1
  63. package/dist/{index-CQDIrK1k.d.ts → index-BJU79_T5.d.ts} +1 -1
  64. package/dist/index-BJU79_T5.d.ts.map +1 -0
  65. package/dist/{index-DLx4nU83.d.ts → index-T2LTMq8r.d.ts} +205 -3
  66. package/dist/index-T2LTMq8r.d.ts.map +1 -0
  67. package/dist/index.d.ts +5 -6
  68. package/dist/mock-BcFWPQyK.d.ts +22 -0
  69. package/dist/mock-BcFWPQyK.d.ts.map +1 -0
  70. package/dist/processors/index.d.ts +1 -1
  71. package/dist/registry/index.d.ts +5 -4
  72. package/dist/registry/index.d.ts.map +1 -1
  73. package/dist/registry/index.js +5 -4
  74. package/dist/registry/index.js.map +1 -1
  75. package/dist/registry/manifest-slim.d.ts +1 -1
  76. package/dist/registry/manifest-slim.d.ts.map +1 -1
  77. package/dist/registry/urls.d.ts +11 -0
  78. package/dist/registry/urls.d.ts.map +1 -0
  79. package/dist/registry/urls.js +15 -0
  80. package/dist/registry/urls.js.map +1 -0
  81. package/dist/{types-Bo4Rb8Yf.d.ts → types-CKsl6Smi.d.ts} +364 -11
  82. package/dist/types-CKsl6Smi.d.ts.map +1 -0
  83. package/dist/{types-CgGSyOl6.d.ts → types-DN7Z4Qjw.d.ts} +32 -3
  84. package/dist/{types-CgGSyOl6.d.ts.map → types-DN7Z4Qjw.d.ts.map} +1 -1
  85. package/dist/{utils-BEByNOHo.d.ts → utils-1EXU6Qr1.d.ts} +1 -1
  86. package/dist/utils-1EXU6Qr1.d.ts.map +1 -0
  87. package/dist/{utils-DKOFCM0Q.js → utils-CTt1XRn-.js} +36 -2
  88. package/dist/utils-CTt1XRn-.js.map +1 -0
  89. package/package.json +1 -1
  90. package/dist/clis/args/common-dbsvksvf.mjs.map +0 -1
  91. package/dist/constants-C_EQX4DY.d.ts.map +0 -1
  92. package/dist/index-CQDIrK1k.d.ts.map +0 -1
  93. package/dist/index-DLx4nU83.d.ts.map +0 -1
  94. package/dist/mock-CBcf78ra.d.ts +0 -7
  95. package/dist/mock-CBcf78ra.d.ts.map +0 -1
  96. package/dist/types-Bo4Rb8Yf.d.ts.map +0 -1
  97. package/dist/types-D0NNBVGA.d.ts +0 -167
  98. package/dist/types-D0NNBVGA.d.ts.map +0 -1
  99. package/dist/utils-BEByNOHo.d.ts.map +0 -1
  100. package/dist/utils-DKOFCM0Q.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["fs"],"sources":["../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.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.dev.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 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\";\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.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n },\n} as const satisfies Record<\n string,\n { peerVersioned: readonly string[]; peerExternal: Record<string, PeerSpec> }\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 \"esbuild\",\n \"protobufjs\",\n] as const;\n\n// pnpm `overrides` written into the generated project's pnpm-workspace.yaml to\n// force a single chosen version of each, avoiding duplicates from coexisting\n// version ranges. Generated-project only — never change the monorepo catalog\n// for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_PNPM_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];\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 browser: \"./dist/browser/subgraphs/index.js\",\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 \"./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\": \"4.1.1\",\n oxfmt: \"0.55.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"^5.9.3\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"4.1.1\",\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 { spawn } from \"node:child_process\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const cmd =\n process.platform === \"win32\" && command === \"npm\" ? \"npm.cmd\" : command;\n\n const child = spawn(cmd, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.dev.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \"--force\",\n ...tokenArg,\n ...args,\n ];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":["fs"],"sources":["../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.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\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\";\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.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n },\n} as const satisfies Record<\n string,\n { peerVersioned: readonly string[]; peerExternal: Record<string, PeerSpec> }\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// pnpm `overrides` written into the generated project's pnpm-workspace.yaml to\n// force a single chosen version of each, avoiding duplicates from coexisting\n// version ranges. Generated-project only — never change the monorepo catalog\n// for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_PNPM_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];\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 browser: \"./dist/browser/subgraphs/index.js\",\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 \"./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\": \"4.1.1\",\n oxfmt: \"0.55.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"^5.9.3\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"4.1.1\",\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 { spawn } from \"node:child_process\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const cmd =\n process.platform === \"win32\" && command === \"npm\" ? \"npm.cmd\" : command;\n\n const child = spawn(cmd, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \"--force\",\n ...tokenArg,\n ...args,\n ];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { Xt as Manifest } from "../types-Bo4Rb8Yf.js";
1
+ import { An as Manifest } from "../types-CKsl6Smi.js";
2
2
  //#region registry/manifest-slim.d.ts
3
3
  /**
4
4
  * Reduce a manifest to the summary fields the package-listing surfaces
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-slim.d.ts","names":[],"sources":["../../registry/manifest-slim.ts"],"mappings":";;;;;;;AAiDA;;;;;;iBAAgB,YAAA,CACd,QAAA,EAAU,QAAA,sBACT,QAAA"}
1
+ {"version":3,"file":"manifest-slim.d.ts","names":[],"sources":["../../registry/manifest-slim.ts"],"mappings":";;;;;;;;AAiDA;;;;;iBAAgB,YAAA,CACd,QAAA,EAAU,QAAA,sBACT,QAAA"}
@@ -0,0 +1,11 @@
1
+ //#region registry/urls.d.ts
2
+ /**
3
+ * Derive the package-CDN base from a registry URL: `/-/cdn` is appended
4
+ * unless the URL already points at the CDN. Packages are then served at
5
+ * `<cdn>/<name[@version]>/...` — both Connect's runtime package manager and
6
+ * the Connect build's PWA-fragment collection resolve packages this way.
7
+ */
8
+ declare function toCdnUrl(registryUrl: string): string;
9
+ //#endregion
10
+ export { toCdnUrl };
11
+ //# sourceMappingURL=urls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls.d.ts","names":[],"sources":["../../registry/urls.ts"],"mappings":";;AASA;;;;;iBAAgB,QAAA,CAAS,WAAA"}
@@ -0,0 +1,15 @@
1
+ //#region registry/urls.ts
2
+ /**
3
+ * Derive the package-CDN base from a registry URL: `/-/cdn` is appended
4
+ * unless the URL already points at the CDN. Packages are then served at
5
+ * `<cdn>/<name[@version]>/...` — both Connect's runtime package manager and
6
+ * the Connect build's PWA-fragment collection resolve packages this way.
7
+ */
8
+ function toCdnUrl(registryUrl) {
9
+ if (registryUrl.includes("/-/cdn")) return registryUrl;
10
+ return `${registryUrl.endsWith("/") ? registryUrl.slice(0, -1) : registryUrl}/-/cdn`;
11
+ }
12
+ //#endregion
13
+ export { toCdnUrl };
14
+
15
+ //# sourceMappingURL=urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls.js","names":[],"sources":["../../registry/urls.ts"],"sourcesContent":["// Pure URL helpers, kept free of Node imports so the browser SPA can import\n// them directly (like ./manifest-slim.js) without pulling in ./registry.js.\n\n/**\n * Derive the package-CDN base from a registry URL: `/-/cdn` is appended\n * unless the URL already points at the CDN. Packages are then served at\n * `<cdn>/<name[@version]>/...` — both Connect's runtime package manager and\n * the Connect build's PWA-fragment collection resolve packages this way.\n */\nexport function toCdnUrl(registryUrl: string): string {\n if (registryUrl.includes(\"/-/cdn\")) return registryUrl;\n const base = registryUrl.endsWith(\"/\")\n ? registryUrl.slice(0, -1)\n : registryUrl;\n return `${base}/-/cdn`;\n}\n"],"mappings":";;;;;;;AASA,SAAgB,SAAS,aAA6B;AACpD,KAAI,YAAY,SAAS,SAAS,CAAE,QAAO;AAI3C,QAAO,GAHM,YAAY,SAAS,IAAI,GAClC,YAAY,MAAM,GAAG,GAAG,GACxB,YACW"}
@@ -1,21 +1,52 @@
1
1
  import { f as IAnalyticsStore } from "./types-C1in4fl3.js";
2
2
  import { z } from "zod";
3
3
  import { Draft } from "mutative";
4
+ import * as cmd_ts_dist_cjs_argparser_js0 from "cmd-ts/dist/cjs/argparser.js";
5
+ import { ArgParser } from "cmd-ts/dist/cjs/argparser.js";
6
+ import * as cmd_ts_dist_cjs_helpdoc_js0 from "cmd-ts/dist/cjs/helpdoc.js";
7
+ import * as cmd_ts_dist_cjs_runner_js0 from "cmd-ts/dist/cjs/runner.js";
8
+ import { Agent } from "package-manager-detector";
4
9
  import { OperationWithContext } from "@powerhousedao/shared/document-model";
5
10
  import { Kysely, QueryCreator } from "kysely";
6
11
  import { FC, ReactNode } from "react";
7
12
 
13
+ //#region clis/args/common.d.ts
14
+ declare const getPackageManagerCommand: Partial<cmd_ts_dist_cjs_argparser_js0.Register> & {
15
+ parse(context: cmd_ts_dist_cjs_argparser_js0.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js0.ParsingResult<{
16
+ packageManager: Agent | undefined;
17
+ npm: boolean | undefined;
18
+ pnpm: boolean | undefined;
19
+ yarn: boolean | undefined;
20
+ bun: boolean | undefined;
21
+ }>>;
22
+ } & cmd_ts_dist_cjs_helpdoc_js0.PrintHelp & cmd_ts_dist_cjs_helpdoc_js0.ProvidesHelp & cmd_ts_dist_cjs_helpdoc_js0.Named & Partial<cmd_ts_dist_cjs_helpdoc_js0.Versioned> & cmd_ts_dist_cjs_argparser_js0.Register & cmd_ts_dist_cjs_runner_js0.Handling<{
23
+ packageManager: Agent | undefined;
24
+ npm: boolean | undefined;
25
+ pnpm: boolean | undefined;
26
+ yarn: boolean | undefined;
27
+ bun: boolean | undefined;
28
+ }, {
29
+ packageManager: Agent | undefined;
30
+ npm: boolean | undefined;
31
+ pnpm: boolean | undefined;
32
+ yarn: boolean | undefined;
33
+ bun: boolean | undefined;
34
+ }> & {
35
+ run(context: cmd_ts_dist_cjs_argparser_js0.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js0.ParsingResult<{
36
+ packageManager: Agent | undefined;
37
+ npm: boolean | undefined;
38
+ pnpm: boolean | undefined;
39
+ yarn: boolean | undefined;
40
+ bun: boolean | undefined;
41
+ }>>;
42
+ } & Partial<cmd_ts_dist_cjs_helpdoc_js0.Versioned & cmd_ts_dist_cjs_helpdoc_js0.Descriptive & cmd_ts_dist_cjs_helpdoc_js0.Aliased>;
43
+ //#endregion
8
44
  //#region processors/constants.d.ts
9
45
  declare const PROCESSOR_APPS: readonly ["connect", "switchboard"];
10
46
  declare const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = "relational-db";
11
47
  declare const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = "analytics-db";
12
48
  //#endregion
13
49
  //#region document-model/signatures.d.ts
14
- /**
15
- * A signature of an action.
16
- *
17
- * This will be refactored in a future release.
18
- */
19
50
  type Signature = [string, string, string, string, string];
20
51
  /**
21
52
  * A user action signer.
@@ -84,6 +115,11 @@ declare function createDocumentState(document?: Partial<PHDocumentState>): PHDoc
84
115
  * Creates a PHBaseState with the given auth and document properties
85
116
  */
86
117
  declare function createBaseState(auth?: Partial<PHAuthState>, document?: Partial<PHDocumentState>): PHBaseState;
118
+ /**
119
+ * Backfills the auth scope to the default for legacy documents serialized with
120
+ * an empty `auth`. Replaces only `state.auth`. Idempotent.
121
+ */
122
+ declare function backfillAuthState<TState extends PHBaseState>(state: TState): TState;
87
123
  /**
88
124
  * The document state of the document.
89
125
  */
@@ -101,11 +137,92 @@ type PHDocumentState = {
101
137
  deletionReason?: string;
102
138
  };
103
139
  /**
104
- * The authentication state of the document.
105
- *
106
- * This has yet to be implemented.
140
+ * The document's authorization policy: an ordered, stacked list of grants,
141
+ * where the last matching grant wins. `{ version: 0, grants: [] }` is
142
+ * uninitialized and leaves the document open.
107
143
  */
108
- type PHAuthState = {};
144
+ type PHAuthState = {
145
+ /**
146
+ * Policy language version. 0 is the uninitialized state; INITIALIZE_AUTH
147
+ * sets an integer >= 1.
148
+ */
149
+ version: number;
150
+ grants: Grant[];
151
+ /**
152
+ * The did:key of the auth-policy creator, captured from the INITIALIZE_AUTH
153
+ * signer. The creator may always administer the auth scope, so a grant policy
154
+ * can never lock administration out of itself. Absent for an unsigned genesis.
155
+ */
156
+ creator?: string;
157
+ };
158
+ type Grant = {
159
+ /** Stable id. */id: string;
160
+ description: string;
161
+ effect: "allow" | "deny";
162
+ principal: Principal;
163
+ capability: Capability;
164
+ /**
165
+ * The grant applies only when this condition holds. Until conditions are
166
+ * evaluated, a grant carrying one never applies.
167
+ */
168
+ where?: Condition;
169
+ };
170
+ type Principal = {
171
+ anyone: true;
172
+ } | {
173
+ address: string;
174
+ } | {
175
+ group: string;
176
+ } | {
177
+ match: Condition;
178
+ };
179
+ type Capability = {
180
+ can: "read";
181
+ scope?: string;
182
+ } | {
183
+ can: "execute";
184
+ scope?: string;
185
+ operation?: string[];
186
+ };
187
+ /**
188
+ * Boolean condition language for grants: deterministic, total, and
189
+ * JSON-serializable, versioned by `PHAuthState.version`. Defined now but not
190
+ * yet evaluated or enforced.
191
+ */
192
+ type Condition = {
193
+ eq: [Operand, Operand];
194
+ } | {
195
+ ne: [Operand, Operand];
196
+ } | {
197
+ in: [Operand, Operand[]];
198
+ } | {
199
+ notIn: [Operand, Operand[]];
200
+ } | {
201
+ lt: [Operand, Operand];
202
+ } | {
203
+ lte: [Operand, Operand];
204
+ } | {
205
+ gt: [Operand, Operand];
206
+ } | {
207
+ gte: [Operand, Operand];
208
+ } | {
209
+ exists: Operand;
210
+ } | {
211
+ and: Condition[];
212
+ } | {
213
+ or: Condition[];
214
+ } | {
215
+ not: Condition;
216
+ };
217
+ /**
218
+ * A condition operand: `attr` is a dotted path into the decision context
219
+ * (e.g. "doc.global.status", "subject.address"); `lit` is a constant value.
220
+ */
221
+ type Operand = {
222
+ attr: string;
223
+ } | {
224
+ lit: string | number | boolean | null;
225
+ };
109
226
  /**
110
227
  * The base state of the document.
111
228
  */
@@ -1236,10 +1353,12 @@ declare const ConfigEntrySchema: z.ZodObject<{
1236
1353
  required: z.ZodOptional<z.ZodBoolean>;
1237
1354
  default: z.ZodOptional<z.ZodBoolean>;
1238
1355
  }, z.core.$strip>;
1356
+ declare const PwaConfigSchema: z.ZodType<PHConnectPwa>;
1239
1357
  declare const ManifestSchema: z.ZodObject<{
1240
1358
  name: z.ZodString;
1241
1359
  description: z.ZodOptional<z.ZodString>;
1242
1360
  category: z.ZodOptional<z.ZodString>;
1361
+ image: z.ZodOptional<z.ZodString>;
1243
1362
  publisher: z.ZodOptional<z.ZodObject<{
1244
1363
  name: z.ZodOptional<z.ZodString>;
1245
1364
  url: z.ZodOptional<z.ZodString>;
@@ -1276,6 +1395,7 @@ declare const ManifestSchema: z.ZodObject<{
1276
1395
  required: z.ZodOptional<z.ZodBoolean>;
1277
1396
  default: z.ZodOptional<z.ZodBoolean>;
1278
1397
  }, z.core.$strip>>>;
1398
+ pwa: z.ZodOptional<z.ZodType<PHConnectPwa, unknown, z.core.$ZodTypeInternals<PHConnectPwa, unknown>>>;
1279
1399
  }, z.core.$strip>;
1280
1400
  //#endregion
1281
1401
  //#region document-model/upgrades.d.ts
@@ -2488,5 +2608,238 @@ type PowerhouseModule = z.infer<typeof PowerhouseModuleSchema>;
2488
2608
  type Publisher = z.infer<typeof PublisherSchema>;
2489
2609
  type Manifest = z.infer<typeof ManifestSchema>;
2490
2610
  //#endregion
2491
- export { DocumentModelDocumentModelModule as $, RedoActionSchema as $a, merge as $c, UpdateChangeLogItemInput as $i, OperationSpecification as $n, IRelationalQueryBuilder as $o, SetModelIdInput as $r, reorderOperationExamples as $s, MinimalBackupData as $t, CreateDocument as A, DeleteOperationInputSchema as Aa, PHDocument as Ac, SetPreferredEditorActionInput as Ai, createDocumentState as Al, MutationSetModelExtensionArgs as An, SetPreferredEditorActionSchema as Ao, RevisionsFilter as Ar, buildSignedAction as As, IAction as At, DeleteModuleAction as B, ManifestSchema as Ba, filterDuplicatedOperations as Bc, SignalType as Bi, ActionSigner as Bl, MutationSetOperationErrorTemplateArgs as Bn, UpdateStateExampleInputSchema as Bo, SchemaUndoAction as Br, moveOperation as Bs, IsStateOfType as Bt, CodeExample as C, CodeExampleSchema as Ca, undo as Cc, SetOperationSchemaAction as Ci, undoOperation as Cl, MutationReorderOperationErrorsArgs as Cn, SetOperationErrorTemplateInputSchema as Co, ReorderOperationErrorsAction as Cr, addModule as Cs, ENSInfo as Ct, CopyChildDocumentSignal as D, DeleteModuleInputSchema as Da, verifyOperationSignature as Dc, SetOperationTemplateAction as Di, PHDocumentState as Dl, MutationSetAuthorWebsiteArgs as Dn, SetOperationScopeInputSchema as Do, ReorderStateExamplesAction as Dr, addStateExample as Ds, Exact as Dt, CopyChildDocumentInput as E, DeleteChangeLogItemInputSchema as Ea, updateStateExample as Ec, SetOperationScopeInput as Ei, PHBaseState as El, MutationSetAuthorNameArgs as En, SetOperationSchemaInputSchema as Eo, ReorderOperationExamplesInput as Er, addOperationExample as Es, EditorProps as Et, DeleteChangeLogItemInput as F, DocumentSpecificationSchema as Fa, baseCreateDocument as Fc, Set_PreferredEditor as Fi, defaultBaseState as Fl, MutationSetNameArgs as Fn, UndoActionInputSchema as Fo, SchemaNOOPAction as Fr, deleteOperationError as Fs, ISignalResult as Ft, DeleteOperationExampleAction as G, OperationSpecificationSchema as Ga, groupOperationsByScope as Gc, State as Gi, UserActionSigner as Gl, MutationSetStateSchemaArgs as Gn, createRelationalDb as Go, SetAuthorWebsiteInput as Gr, operationWithContext as Gs, LoadStateActionStateInput as Gt, DeleteOperationAction as H, MoveOperationInputSchema as Ha, garbageCollectDocumentOperations as Hc, SigningParameters as Hi, HashConfig as Hl, MutationSetOperationReducerArgs as Hn, isDefinedNonNullAny as Ho, SetAuthorNameAction as Hr, operationExampleCreators as Hs, LoadFromInput as Ht, DeleteChildDocumentInput as I, LoadStateActionInputSchema as Ia, checkCleanedOperationsIntegrity as Ic, Signal as Ii, defaultDocumentState as Il, MutationSetOperationDescriptionArgs as In, UndoActionSchema as Io, SchemaPruneAction as Ir, deleteOperationExample as Is, ISigner as It, DeleteStateExampleAction as J, PruneActionInputSchema as Ja, isNoopOperation as Jc, Undo as Ji, PROCESSOR_APPS as Jl, MutationUpdateOperationExampleArgs as Jn, ExtractProcessorSchemaOrSelf as Jo, SetModelDescriptionAction as Jr, releaseNewVersion as Js, MakeMaybe as Jt, DeleteOperationExampleInput as K, PowerhouseModuleSchema as Ka, hashDocumentStateForScope as Kc, StateReducer as Ki, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as Kl, MutationUndoArgs as Kn, hashNamespace as Ko, SetInitialStateAction as Kr, prune as Ks, Load_State as Kt, DeleteChildDocumentSignal as L, LoadStateActionSchema as La, checkOperationsIntegrity as Lc, SignalDispatch as Li, defaultGlobalState as Ll, MutationSetOperationErrorCodeArgs as Ln, UndoSchema as Lo, SchemaRedoAction as Lr, deleteStateExample as Ls, Incremental as Lt, CreateDocumentActionInput as M, DocumentActionSchema as Ma, PHDocumentMeta as Mc, SetStateSchemaAction as Mi, createLocalState as Ml, MutationSetModelNameArgs as Mn, Set_NameSchema as Mo, SaveToFileHandle as Mr, deleteChangeLogItem as Ms, IDocument as Mt, CreateState as N, DocumentModelGlobalStateSchema as Na, addUndo as Nc, SetStateSchemaInput as Ni, createState as Nl, MutationSetModuleDescriptionArgs as Nn, Set_PreferredEditorSchema as No, Scalars as Nr, deleteModule as Ns, IOperation as Nt, CreateChildDocumentInput as O, DeleteOperationErrorInputSchema as Oa, IntegrityIssueSubType as Oc, SetOperationTemplateInput as Oi, createAuthState as Ol, MutationSetInitialStateArgs as On, SetOperationTemplateInputSchema as Oo, ReorderStateExamplesInput as Or, baseActions as Os, FileInput as Ot, DeleteChangeLogItemAction as P, DocumentModelInputSchema as Pa, attachBranch as Pc, Set_Name as Pi, defaultAuthState as Pl, MutationSetModuleNameArgs as Pn, StateSchema as Po, SchemaLoadStateAction as Pr, deleteOperation as Ps, ISignal as Pt, DocumentModelDocument as Q, RedoActionInputSchema as Qa, mapSkippedOperationsV2 as Qc, UpdateChangeLogItemAction as Qi, OperationIndex as Qn, IRelationalDbProcessor as Qo, SetModelIdAction as Qr, reorderOperationErrors as Qs, Maybe as Qt, DeleteDocumentAction as R, LoadStateActionStateInputSchema as Ra, diffOperations as Rc, SignalResult as Ri, defaultLocalState as Rl, MutationSetOperationErrorDescriptionArgs as Rn, UpdateChangeLogItemInputSchema as Ro, SchemaSetNameAction as Rr, documentModelActions as Rs, InputMaybe as Rt, Author as S, AuthorSchema as Sa, setStateSchema as Sc, SetOperationReducerInput as Si, setPreferredEditorOperation as Sl, MutationReorderModulesArgs as Sn, SetOperationErrorNameInputSchema as So, ReorderModulesInput as Sr, addChangeLogItem as Ss, DocumentSpecification as St, ConfigEntryType as T, ConfigEntryTypeSchema as Ta, updateOperationExample as Tc, SetOperationScopeAction as Ti, PHAuthState as Tl, MutationReorderStateExamplesArgs as Tn, SetOperationReducerInputSchema as To, ReorderOperationExamplesAction as Tr, addOperationError as Ts, EditorModule as Tt, DeleteOperationErrorAction as U, OperationErrorSchema as Ua, garbageCollectV2 as Uc, SkipHeaderOperationIndex as Ui, PHDocumentSignatureInfo as Ul, MutationSetOperationSchemaArgs as Un, createNamespacedDb as Uo, SetAuthorNameInput as Ur, operationFromAction as Us, LoadStateAction as Ut, DeleteModuleInput as V, ModuleSchema as Va, garbageCollect as Vc, SignatureVerificationHandler as Vi, AppActionSigner as Vl, MutationSetOperationNameArgs as Vn, definedNonNullAnySchema as Vo, ScopeState as Vr, noop as Vs, LoadFromFile as Vt, DeleteOperationErrorInput as W, OperationScopeSchema as Wa, getDocumentLastModified as Wc, SkipHeaderOperations as Wi, Signature as Wl, MutationSetOperationTemplateArgs as Wn, createNamespacedQueryBuilder as Wo, SetAuthorWebsiteAction as Wr, operationFromOperation as Ws, LoadStateActionInput as Wt, DocumentAction as X, PruneSchema as Xa, isUndoRedo as Xc, UndoActionInput as Xi, NOOPAction as Xn, IBaseRelationalDb as Xo, SetModelExtensionAction as Xr, reorderModuleOperations as Xs, Manifest as Xt, DeleteStateExampleInput as Y, PruneActionSchema as Ya, isUndo as Yc, UndoAction as Yi, MutationUpdateStateExampleArgs as Yn, HashAlgorithms as Yo, SetModelDescriptionInput as Yr, reorderChangeLogItems as Ys, MakeOptional as Yt, DocumentModelAction as Z, PublisherSchema as Za, mapSkippedOperations as Zc, UndoRedoAction as Zi, OperationErrorSpecification as Zn, IRelationalDb as Zo, SetModelExtensionInput as Zr, reorderModules as Zs, MappedOperation as Zt, AddRelationshipActionInput as _, AddModuleInputSchema as _a, setOperationReducer as _c, SetOperationErrorTemplateAction as _i, OperationContext as _l, MutationMoveOperationArgs as _n, SetNameActionInputSchema as _o, ReorderChangeLogItemsAction as _r, ActionContext as _s, DocumentModelStateOperations as _t, Actions as a, UpdateStateExampleInput as aa, setModelExtension as ac, SetModuleNameInput as ai, readOnly as al, MutationAddModuleArgs as an, ReorderOperationExamplesInputSchema as ao, PruneAction as ar, IProcessorHostModule as as, DocumentModelLocalState as at, AssertIsDocumentOfType as b, AddOperationInputSchema as ba, setOperationTemplate as bc, SetOperationNameInput as bi, redoOperation as bl, MutationReorderChangeLogItemsInputArgs as bn, SetOperationErrorCodeInputSchema as bo, ReorderModuleOperationsInput as br, actionSigner as bs, DocumentModelVersioningOperations as bt, AddModuleAction as c, User as ca, setModuleDescription as cc, SetNameOperation as ci, reshuffleByTimestamp as cl, MutationAddOperationExampleArgs as cn, SetAuthorNameInputSchema as co, Query as cr, ProcessorApps as cs, DocumentModelModuleOperations as ct, AddOperationErrorAction as d, UpgradeReducer as da, setOperationDescription as dc, SetOperationErrorCodeAction as di, sortMappedOperations as dl, MutationDeleteModuleArgs as dn, SetModelDescriptionInputSchema as do, RedoActionInput as dr, ProcessorFactoryBuilder as ds, DocumentModelOperationErrorOperations as dt, UpdateOperationExampleAction as ea, reorderStateExamples as ec, SetModelNameAction as ei, nextSkipNumber as el, ModuleSpecification as en, RedoSchema as eo, OperationsByScope as er, IRelationalQueryMethods as es, DocumentModelGlobalState as et, AddOperationErrorInput as f, UpgradeTransition as fa, setOperationErrorCode as fc, SetOperationErrorCodeInput as fi, sortOperations as fl, MutationDeleteOperationArgs as fn, SetModelExtensionInputSchema as fo, Reducer as fr, ProcessorFilter as fs, DocumentModelOperationExampleAction as ft, AddRelationshipAction as g, AddChangeLogItemInputSchema as ga, setOperationName as gc, SetOperationErrorNameInput as gi, Operation as gl, MutationLoadStateArgs as gn, SetModuleNameInputSchema as go, RemoveRelationshipActionInput as gr, Action as gs, DocumentModelStateAction as gt, AddOperationInput as h, computeUpgradeTransitions as ha, setOperationErrorTemplate as hc, SetOperationErrorNameAction as hi, DocumentOperations as hl, MutationDeleteStateExampleArgs as hn, SetModuleDescriptionInputSchema as ho, RemoveRelationshipAction as hr, TrackedProcessor as hs, DocumentModelPHState as ht, ActionVerificationHandler as i, UpdateStateExampleAction as ia, setModelDescription as ic, SetModuleNameAction as ii, prepareOperations as il, MutationAddChangeLogItemInputArgs as in, ReorderOperationErrorsInputSchema as io, Prune as ir, IProcessorDispatch as is, DocumentModelLib as it, CreateDocumentAction as j, DeleteStateExampleInputSchema as ja, PHDocumentHeader as jc, SetPreferredEditorOperation as ji, createGlobalState as jl, MutationSetModelIdArgs as jn, SetStateSchemaInputSchema as jo, SaveToFile as jr, createAction as js, ID as jt, CreateChildDocumentSignal as k, DeleteOperationExampleInputSchema as ka, IntegrityIssueType as kc, SetPreferredEditorAction as ki, createBaseState as kl, MutationSetModelDescriptionArgs as kn, SetPreferredEditorActionInputSchema as ko, ReplayDocumentOptions as kr, buildOperationSignature as ks, GetDocumentOptions as kt, AddModuleInput as l, ValidationError as la, setModuleName as lc, SetOperationDescriptionAction as li, reshuffleByTimestampAndIndex as ll, MutationAddStateExampleArgs as ln, SetAuthorWebsiteInputSchema as lo, Redo as lr, ProcessorDispatchResult as ls, DocumentModelOperationAction as lt, AddOperationExampleInput as m, applyUpgradeDocumentAction as ma, setOperationErrorName as mc, SetOperationErrorDescriptionInput as mi, updateHeaderRevision as ml, MutationDeleteOperationExampleArgs as mn, SetModelNameInputSchema as mo, ReleaseNewVersionAction as mr, ProcessorStatus as ms, DocumentModelOperationOperations as mt, ActionSignatureContext as n, UpdateRelationshipAction as na, setAuthorWebsite as nc, SetModuleDescriptionAction as ni, parseResultingState as nl, MoveOperationInput as nn, ReorderModuleOperationsInputSchema as no, PartialState as nr, RelationalDbProcessorClass as ns, DocumentModelHeaderOperations as nt, AddChangeLogItemAction as o, UpgradeDocumentAction as oa, setModelId as oc, SetNameAction as oi, removeExistingOperations as ol, MutationAddOperationArgs as on, ReorderStateExamplesInputSchema as oo, PruneActionInput as or, IProcessorManager as os, DocumentModelModule as ot, AddOperationExampleAction as p, applyDeleteDocumentAction as pa, setOperationErrorDescription as pc, SetOperationErrorDescriptionAction as pi, split as pl, MutationDeleteOperationErrorArgs as pn, SetModelIdInputSchema as po, ReducerOptions as pr, ProcessorRecord as ps, DocumentModelOperationExampleOperations as pt, DeleteOperationInput as q, PowerhouseModulesSchema as qa, isDocumentAction as qc, SubgraphModule as qi, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as ql, MutationUpdateChangeLogItemInputArgs as qn, relationalDbToQueryBuilder as qo, SetInitialStateInput as qr, redo as qs, MakeEmpty as qt, ActionSigningHandler as r, UpdateRelationshipActionInput as ra, setInitialState as rc, SetModuleDescriptionInput as ri, precedes as rl, Mutation as rn, ReorderModulesInputSchema as ro, PowerhouseModule as rr, IProcessor as rs, DocumentModelInput as rt, AddChangeLogItemInput as s, UpgradeDocumentActionInput as sa, setModelName as sc, SetNameActionInput as si, replayDocument as sl, MutationAddOperationErrorArgs as sn, ScopeStateSchema as so, Publisher as sr, ProcessorApp as ss, DocumentModelModuleAction as st, ActionErrorCallback as t, UpdateOperationExampleInput as ta, setAuthorName as tc, SetModelNameInput as ti, operationsAreEqual as tl, MoveOperationAction as tn, ReorderChangeLogItemsInputSchema as to, PartialRecord as tr, RelationalDbProcessor as ts, DocumentModelHeaderAction as tt, AddOperationAction as u, UpgradeManifest as ua, setName as uc, SetOperationDescriptionInput as ui, skipHeaderOperations as ul, MutationDeleteChangeLogItemInputArgs as un, SetInitialStateInputSchema as uo, RedoAction as ur, ProcessorFactory as us, DocumentModelOperationErrorAction as ut, AddStateExampleAction as v, AddOperationErrorInputSchema as va, setOperationSchema as vc, SetOperationErrorTemplateInput as vi, OperationWithContext$1 as vl, MutationPruneArgs as vn, SetNameActionSchema as vo, ReorderChangeLogItemsInput as vr, actionContext as vs, DocumentModelUtils as vt, ConfigEntry as w, ConfigEntrySchema as wa, updateChangeLogItem as wc, SetOperationSchemaInput as wi, undoOperationV2 as wl, MutationReorderOperationExamplesArgs as wn, SetOperationNameInputSchema as wo, ReorderOperationErrorsInput as wr, addOperation as ws, EditorDispatch as wt, AssertIsStateOfType as x, AddStateExampleInputSchema as xa, setPreferredEditor as xc, SetOperationReducerAction as xi, setNameOperation as xl, MutationReorderModuleOperationsArgs as xn, SetOperationErrorDescriptionInputSchema as xo, ReorderModulesAction as xr, actions as xs, DocumentOperationsIgnoreMap as xt, AddStateExampleInput as y, AddOperationExampleInputSchema as ya, setOperationScope as yc, SetOperationNameAction as yi, loadStateOperation as yl, MutationRedoArgs as yn, SetOperationDescriptionInputSchema as yo, ReorderModuleOperationsAction as yr, actionFromAction as ys, DocumentModelVersioningAction as yt, DeleteDocumentActionInput as z, Load_StateSchema as za, filterDocumentOperationsResultingState as zc, SignalResults as zi, defaultPHState as zl, MutationSetOperationErrorNameArgs as zn, UpdateOperationExampleInputSchema as zo, SchemaSetPreferredEditorAction as zr, loadState as zs, IsDocumentOfType as zt };
2492
- //# sourceMappingURL=types-Bo4Rb8Yf.d.ts.map
2611
+ //#region clis/constants.d.ts
2612
+ declare const SERVICE_ACTIONS: readonly ["start", "stop", "status", "setup", "restart"];
2613
+ declare const DRIVES_PRESERVE_STRATEGIES: readonly ["preserve-all", "preserve-by-url-and-detach"];
2614
+ declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error", "verbose"];
2615
+ declare const DEFAULT_REGISTRY_URL: "https://registry.vetra.io";
2616
+ //#endregion
2617
+ //#region clis/types.d.ts
2618
+ type ServiceActions = typeof SERVICE_ACTIONS;
2619
+ type ServiceAction = ServiceActions[number];
2620
+ type DrivePreserveStrategies = typeof DRIVES_PRESERVE_STRATEGIES;
2621
+ type DrivePreserveStrategy = DrivePreserveStrategies[number];
2622
+ type LogLevels = typeof LOG_LEVELS;
2623
+ type LogLevel = LogLevels[number];
2624
+ type ParsedCmdResult<P> = P extends ArgParser<infer Out> ? Out : never;
2625
+ type PackageManagerArgs = ParsedCmdResult<typeof getPackageManagerCommand>;
2626
+ type PHPackageProvider = "npm" | "github" | "local" | "registry";
2627
+ type PathValidation = (dir: string) => boolean;
2628
+ type PowerhousePackage = {
2629
+ packageName: string;
2630
+ version?: string;
2631
+ provider?: PHPackageProvider;
2632
+ url?: string;
2633
+ };
2634
+ type PHConnectBranding = {
2635
+ appName?: string;
2636
+ homeBackground?: string | null;
2637
+ };
2638
+ type PHConnectDefaultDrive = {
2639
+ url: string;
2640
+ name?: string | null;
2641
+ icon?: string | null;
2642
+ };
2643
+ type PHConnectDriveSection = {
2644
+ enabled?: boolean;
2645
+ allowAdd?: boolean;
2646
+ allowDelete?: boolean;
2647
+ };
2648
+ type PHConnectDriveSections = {
2649
+ remote?: PHConnectDriveSection;
2650
+ local?: PHConnectDriveSection;
2651
+ };
2652
+ type PHConnectDrives = {
2653
+ allowAddDrive?: boolean;
2654
+ defaultDrives?: PHConnectDefaultDrive[];
2655
+ preserveStrategy?: DrivePreserveStrategy;
2656
+ sections?: PHConnectDriveSections;
2657
+ };
2658
+ type PHConnectApp = {
2659
+ logLevel?: "debug" | "info" | "warn" | "error";
2660
+ basePath?: string;
2661
+ offline?: boolean;
2662
+ studioMode?: boolean;
2663
+ };
2664
+ type PHConnectPackages = {
2665
+ externalEnabled?: boolean; /** Subscribe to the static-mode `/__packages` SSE channel for live reload. */
2666
+ liveReload?: boolean;
2667
+ };
2668
+ type PHRenownRainbowAdapterConfig = {
2669
+ /** WalletConnect project id; required for the rainbow adapter to function. */walletConnectProjectId?: string; /** Optional Infura project id used to build RPC transports. */
2670
+ infuraProjectId?: string;
2671
+ };
2672
+ type PHRenownPrivyAdapterConfig = {
2673
+ /** Privy application id; required for the privy adapter to function. */appId?: string; /** Optional Privy client id. */
2674
+ clientId?: string; /** Login methods this adapter offers; defaults per adapter when omitted. */
2675
+ methods?: string[];
2676
+ };
2677
+ type PHConnectRenownAdapters = {
2678
+ rainbow?: PHRenownRainbowAdapterConfig;
2679
+ privy?: PHRenownPrivyAdapterConfig;
2680
+ };
2681
+ type PHConnectRenown = {
2682
+ url?: string;
2683
+ networkId?: string;
2684
+ chainId?: number; /** Renown localStorage namespace; share it across Connects to share login. */
2685
+ namespace?: string; /** Switchboard GraphQL URL; when set, enables in-page (no-redirect) auth. */
2686
+ switchboardUrl?: string; /** Per-adapter wallet config; presence of a key enables that adapter. */
2687
+ adapters?: PHConnectRenownAdapters;
2688
+ };
2689
+ type PHConnectSentry = {
2690
+ /** Sentry DSN URL. `null` disables Sentry entirely. */dsn?: string | null; /** Sentry environment label. */
2691
+ env?: string; /** Enable Sentry performance tracing. */
2692
+ tracing?: boolean;
2693
+ };
2694
+ type PHConnectInstance = {
2695
+ namespace: string | null;
2696
+ reactorWorker: boolean;
2697
+ };
2698
+ /**
2699
+ * A URL-matching pattern for a service-worker runtime-caching rule, in
2700
+ * JSON-serialisable form. A plain string is handed to Workbox verbatim (exact
2701
+ * URL or same-origin path match). `{ source, flags }` is reconstructed into a
2702
+ * `RegExp` at build time — use it for prefix/suffix/origin matches (e.g.
2703
+ * `{ source: "^https://api\\.acme\\.io/" }`). Function-valued patterns aren't
2704
+ * expressible here; regex covers the realistic package cases.
2705
+ */
2706
+ type PHConnectPwaUrlPattern = string | {
2707
+ source: string;
2708
+ flags?: string;
2709
+ };
2710
+ type PHConnectPwaCacheStrategy = "CacheFirst" | "CacheOnly" | "NetworkFirst" | "NetworkOnly" | "StaleWhileRevalidate";
2711
+ /** Serialisable subset of a Workbox `RuntimeCaching` rule. */
2712
+ type PHConnectPwaRuntimeCaching = {
2713
+ urlPattern: PHConnectPwaUrlPattern;
2714
+ handler: PHConnectPwaCacheStrategy;
2715
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "PATCH";
2716
+ options?: {
2717
+ cacheName?: string;
2718
+ /** Seconds a NetworkFirst rule waits for the network before falling back
2719
+ * to the cache. */
2720
+ networkTimeoutSeconds?: number;
2721
+ expiration?: {
2722
+ maxEntries?: number;
2723
+ maxAgeSeconds?: number;
2724
+ };
2725
+ cacheableResponse?: {
2726
+ statuses?: number[];
2727
+ headers?: Record<string, string>;
2728
+ };
2729
+ };
2730
+ };
2731
+ type PHConnectPwaIcon = {
2732
+ src: string;
2733
+ sizes?: string;
2734
+ type?: string;
2735
+ purpose?: string;
2736
+ };
2737
+ /**
2738
+ * A File Handling API entry a package or project contributes: the OS-level
2739
+ * file types the installed Connect PWA offers to open. There is deliberately
2740
+ * no `action` field — consuming launched files requires runtime code that
2741
+ * lives in Connect itself, so every handler (built-in or contributed) opens
2742
+ * at Connect's app root, injected at build time.
2743
+ */
2744
+ type PHConnectPwaFileHandler = {
2745
+ /** MIME type → file extensions (each must start with "."). */accept: Record<string, string[]>; /** OS-level file-type icons. */
2746
+ icons?: PHConnectPwaIcon[];
2747
+ launch_type?: "single-client" | "multiple-clients";
2748
+ };
2749
+ /** Web-app-manifest fields a package or project may override. */
2750
+ type PHConnectPwaManifest = {
2751
+ name?: string;
2752
+ short_name?: string;
2753
+ description?: string;
2754
+ theme_color?: string;
2755
+ background_color?: string;
2756
+ display?: "fullscreen" | "standalone" | "minimal-ui" | "browser";
2757
+ start_url?: string;
2758
+ scope?: string;
2759
+ icons?: PHConnectPwaIcon[]; /** Extra file associations, appended after Connect's built-in `.phd`/`.phdm` handler. */
2760
+ file_handlers?: PHConnectPwaFileHandler[]; /** How the OS launches the app for handled files/links. */
2761
+ launch_handler?: {
2762
+ client_mode: "auto" | "focus-existing" | "navigate-existing" | "navigate-new";
2763
+ };
2764
+ /** App-store-style categories. NOT authored under `connect.pwa` — derived at
2765
+ * build/runtime from the `category` field of every contributing
2766
+ * `powerhouse.manifest.json` (project + packages), unioned across them. */
2767
+ categories?: string[];
2768
+ };
2769
+ /**
2770
+ * PWA / service-worker overrides contributed by a package or the project.
2771
+ * Layered on top of Connect's hardcoded PWA defaults at build time. Scalar
2772
+ * fields deep-merge (later layer wins); every array member — the manifest
2773
+ * arrays (`icons`, `file_handlers`, and the derived `categories`) plus the
2774
+ * top-level `globPatterns`, `globIgnores`, `runtimeCaching` and
2775
+ * `navigateFallbackDenylist` — is additive (concatenated/unioned);
2776
+ * `maximumFileSizeToCacheInBytes` takes the max across contributors.
2777
+ * Precedence: defaults < package fragments < project config.
2778
+ */
2779
+ type PHConnectPwa = {
2780
+ manifest?: PHConnectPwaManifest; /** Extra Workbox precache globs, unioned with the built-in patterns. */
2781
+ globPatterns?: string[]; /** Extra Workbox precache ignore globs, unioned with the built-in list. */
2782
+ globIgnores?: string[]; /** Raise the precache file-size ceiling; the max across contributors wins. */
2783
+ maximumFileSizeToCacheInBytes?: number; /** Additional runtime-caching rules, appended after the built-in rules. */
2784
+ runtimeCaching?: PHConnectPwaRuntimeCaching[]; /** Extra SPA-fallback denylist patterns, unioned with the built-in list. */
2785
+ navigateFallbackDenylist?: PHConnectPwaUrlPattern[];
2786
+ };
2787
+ type PHConnectRuntimeConfig = {
2788
+ branding?: PHConnectBranding;
2789
+ app?: PHConnectApp;
2790
+ packages?: PHConnectPackages;
2791
+ drives?: PHConnectDrives;
2792
+ renown?: PHConnectRenown;
2793
+ sentry?: PHConnectSentry;
2794
+ instance?: PHConnectInstance;
2795
+ pwa?: PHConnectPwa;
2796
+ };
2797
+ type PowerhouseConfig = {
2798
+ logLevel: LogLevel;
2799
+ documentModelsDir: string;
2800
+ editorsDir: string;
2801
+ processorsDir: string;
2802
+ subgraphsDir: string;
2803
+ importScriptsDir: string;
2804
+ skipFormat: boolean;
2805
+ interactive?: boolean;
2806
+ watch?: boolean;
2807
+ reactor?: {
2808
+ port?: number;
2809
+ https?: undefined | boolean | {
2810
+ keyPath: string;
2811
+ certPath: string;
2812
+ };
2813
+ storage?: {
2814
+ type: "filesystem" | "memory" | "postgres" | "browser";
2815
+ filesystemPath?: string;
2816
+ postgresUrl?: string;
2817
+ };
2818
+ };
2819
+ auth?: {
2820
+ enabled?: boolean;
2821
+ admins: string[];
2822
+ };
2823
+ switchboard?: {
2824
+ database?: {
2825
+ url?: string;
2826
+ };
2827
+ port?: number;
2828
+ };
2829
+ studio?: {
2830
+ port?: number;
2831
+ host?: string;
2832
+ https: boolean;
2833
+ openBrowser?: boolean;
2834
+ };
2835
+ packages?: PowerhousePackage[];
2836
+ vetra?: {
2837
+ driveId: string;
2838
+ driveUrl: string;
2839
+ };
2840
+ packageRegistryUrl?: string;
2841
+ connect?: PHConnectRuntimeConfig;
2842
+ };
2843
+ //#endregion
2844
+ export { AddStateExampleInput as $, AddOperationExampleInputSchema as $a, setOperationSchema as $c, SetOperationNameAction as $i, OperationWithContext$1 as $l, MutationRedoArgs as $n, SetNameActionSchema as $o, ReorderModuleOperationsAction as $r, actionContext as $s, DocumentModelVersioningAction as $t, PowerhouseConfig as A, UndoActionInput as Aa, reorderChangeLogItems as Ac, SetModelExtensionAction as Ai, isUndo as Al, Manifest as An, PruneSchema as Ao, NOOPAction as Ar, HashAlgorithms as As, DocumentAction as At, PHDocumentSignatureInfo as Au, AddChangeLogItemAction as B, UpgradeDocumentAction as Ba, setModelExtension as Bc, SetNameAction as Bi, readOnly as Bl, MutationAddOperationArgs as Bn, ReorderOperationExamplesInputSchema as Bo, PruneActionInput as Br, IProcessorHostModule as Bs, DocumentModelModule as Bt, PHConnectSentry as C, SkipHeaderOperationIndex as Ca, operationExampleCreators as Cc, SetAuthorNameInput as Ci, garbageCollectDocumentOperations as Cl, LoadStateAction as Cn, OperationErrorSchema as Co, MutationSetOperationSchemaArgs as Cr, isDefinedNonNullAny as Cs, DeleteOperationErrorAction as Ct, defaultDocumentState as Cu, PackageManagerArgs as D, SubgraphModule as Da, prune as Dc, SetInitialStateInput as Di, hashDocumentStateForScope as Dl, MakeEmpty as Dn, PowerhouseModulesSchema as Do, MutationUpdateChangeLogItemInputArgs as Dr, hashNamespace as Ds, DeleteOperationInput as Dt, ActionSigner as Du, PHRenownRainbowAdapterConfig as E, StateReducer as Ea, operationWithContext as Ec, SetInitialStateAction as Ei, groupOperationsByScope as El, Load_State as En, PowerhouseModuleSchema as Eo, MutationUndoArgs as Er, createRelationalDb as Es, DeleteOperationExampleInput as Et, defaultPHState as Eu, ActionErrorCallback as F, UpdateOperationExampleInput as Fa, reorderStateExamples as Fc, SetModelNameInput as Fi, nextSkipNumber as Fl, MoveOperationAction as Fn, RedoSchema as Fo, PartialRecord as Fr, IRelationalQueryMethods as Fs, DocumentModelHeaderAction as Ft, PROCESSOR_APPS as Fu, AddOperationErrorAction as G, UpgradeReducer as Ga, setName as Gc, SetOperationErrorCodeAction as Gi, skipHeaderOperations as Gl, MutationDeleteModuleArgs as Gn, SetInitialStateInputSchema as Go, RedoActionInput as Gr, ProcessorFactory as Gs, DocumentModelOperationErrorOperations as Gt, AddModuleAction as H, User as Ha, setModelName as Hc, SetNameOperation as Hi, replayDocument as Hl, MutationAddOperationExampleArgs as Hn, ScopeStateSchema as Ho, Query as Hr, ProcessorApp as Hs, DocumentModelModuleOperations as Ht, ActionSignatureContext as I, UpdateRelationshipAction as Ia, setAuthorName as Ic, SetModuleDescriptionAction as Ii, operationsAreEqual as Il, MoveOperationInput as In, ReorderChangeLogItemsInputSchema as Io, PartialState as Ir, RelationalDbProcessor as Is, DocumentModelHeaderOperations as It, AddOperationExampleInput as J, applyUpgradeDocumentAction as Ja, setOperationErrorDescription as Jc, SetOperationErrorDescriptionInput as Ji, split as Jl, MutationDeleteOperationExampleArgs as Jn, SetModelIdInputSchema as Jo, ReleaseNewVersionAction as Jr, ProcessorRecord as Js, DocumentModelOperationOperations as Jt, AddOperationErrorInput as K, UpgradeTransition as Ka, setOperationDescription as Kc, SetOperationErrorCodeInput as Ki, sortMappedOperations as Kl, MutationDeleteOperationArgs as Kn, SetModelDescriptionInputSchema as Ko, Reducer as Kr, ProcessorFactoryBuilder as Ks, DocumentModelOperationExampleAction as Kt, ActionSigningHandler as L, UpdateRelationshipActionInput as La, setAuthorWebsite as Lc, SetModuleDescriptionInput as Li, parseResultingState as Ll, Mutation as Ln, ReorderModuleOperationsInputSchema as Lo, PowerhouseModule as Lr, RelationalDbProcessorClass as Ls, DocumentModelInput as Lt, ServiceAction as M, UpdateChangeLogItemAction as Ma, reorderModules as Mc, SetModelIdAction as Mi, mapSkippedOperations as Ml, Maybe as Mn, PwaConfigSchema as Mo, OperationIndex as Mr, IRelationalDb as Ms, DocumentModelDocument as Mt, UserActionSigner as Mu, ServiceActions as N, UpdateChangeLogItemInput as Na, reorderOperationErrors as Nc, SetModelIdInput as Ni, mapSkippedOperationsV2 as Nl, MinimalBackupData as Nn, RedoActionInputSchema as No, OperationSpecification as Nr, IRelationalDbProcessor as Ns, DocumentModelDocumentModelModule as Nt, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as Nu, ParsedCmdResult as O, Undo as Oa, redo as Oc, SetModelDescriptionAction as Oi, isDocumentAction as Ol, MakeMaybe as On, PruneActionInputSchema as Oo, MutationUpdateOperationExampleArgs as Or, relationalDbToQueryBuilder as Os, DeleteStateExampleAction as Ot, AppActionSigner as Ou, DEFAULT_REGISTRY_URL as P, UpdateOperationExampleAction as Pa, reorderOperationExamples as Pc, SetModelNameAction as Pi, merge as Pl, ModuleSpecification as Pn, RedoActionSchema as Po, OperationsByScope as Pr, IRelationalQueryBuilder as Ps, DocumentModelGlobalState as Pt, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as Pu, AddStateExampleAction as Q, AddOperationErrorInputSchema as Qa, setOperationReducer as Qc, SetOperationErrorTemplateInput as Qi, OperationContext as Ql, MutationPruneArgs as Qn, SetNameActionInputSchema as Qo, ReorderChangeLogItemsInput as Qr, ActionContext as Qs, DocumentModelUtils as Qt, ActionVerificationHandler as R, UpdateStateExampleAction as Ra, setInitialState as Rc, SetModuleNameAction as Ri, precedes as Rl, MutationAddChangeLogItemInputArgs as Rn, ReorderModulesInputSchema as Ro, Prune as Rr, IProcessor as Rs, DocumentModelLib as Rt, PHConnectRuntimeConfig as S, SigningParameters as Sa, noop as Sc, SetAuthorNameAction as Si, garbageCollect as Sl, LoadFromInput as Sn, MoveOperationInputSchema as So, MutationSetOperationReducerArgs as Sr, definedNonNullAnySchema as Ss, DeleteOperationAction as St, defaultBaseState as Su, PHRenownPrivyAdapterConfig as T, State as Ta, operationFromOperation as Tc, SetAuthorWebsiteInput as Ti, getDocumentLastModified as Tl, LoadStateActionStateInput as Tn, OperationSpecificationSchema as To, MutationSetStateSchemaArgs as Tr, createNamespacedQueryBuilder as Ts, DeleteOperationExampleAction as Tt, defaultLocalState as Tu, AddModuleInput as U, ValidationError as Ua, setModuleDescription as Uc, SetOperationDescriptionAction as Ui, reshuffleByTimestamp as Ul, MutationAddStateExampleArgs as Un, SetAuthorNameInputSchema as Uo, Redo as Ur, ProcessorApps as Us, DocumentModelOperationAction as Ut, AddChangeLogItemInput as V, UpgradeDocumentActionInput as Va, setModelId as Vc, SetNameActionInput as Vi, removeExistingOperations as Vl, MutationAddOperationErrorArgs as Vn, ReorderStateExamplesInputSchema as Vo, Publisher as Vr, IProcessorManager as Vs, DocumentModelModuleAction as Vt, AddOperationAction as W, UpgradeManifest as Wa, setModuleName as Wc, SetOperationDescriptionInput as Wi, reshuffleByTimestampAndIndex as Wl, MutationDeleteChangeLogItemInputArgs as Wn, SetAuthorWebsiteInputSchema as Wo, RedoAction as Wr, ProcessorDispatchResult as Ws, DocumentModelOperationErrorAction as Wt, AddRelationshipAction as X, AddChangeLogItemInputSchema as Xa, setOperationErrorTemplate as Xc, SetOperationErrorNameInput as Xi, DocumentOperations as Xl, MutationLoadStateArgs as Xn, SetModuleDescriptionInputSchema as Xo, RemoveRelationshipActionInput as Xr, TrackedProcessor as Xs, DocumentModelStateAction as Xt, AddOperationInput as Y, computeUpgradeTransitions as Ya, setOperationErrorName as Yc, SetOperationErrorNameAction as Yi, updateHeaderRevision as Yl, MutationDeleteStateExampleArgs as Yn, SetModelNameInputSchema as Yo, RemoveRelationshipAction as Yr, ProcessorStatus as Ys, DocumentModelPHState as Yt, AddRelationshipActionInput as Z, AddModuleInputSchema as Za, setOperationName as Zc, SetOperationErrorTemplateAction as Zi, Operation as Zl, MutationMoveOperationArgs as Zn, SetModuleNameInputSchema as Zo, ReorderChangeLogItemsAction as Zr, Action as Zs, DocumentModelStateOperations as Zt, PHConnectPwaManifest as _, SignalDispatch as _a, deleteOperationExample as _c, SchemaRedoAction as _i, checkCleanedOperationsIntegrity as _l, Incremental as _n, LoadStateActionSchema as _o, MutationSetOperationErrorCodeArgs as _r, UndoActionSchema as _s, DeleteChildDocumentSignal as _t, createDocumentState as _u, PHConnectApp as a, SetOperationScopeAction as aa, addOperation as ac, ReorderOperationExamplesAction as ai, updateChangeLogItem as al, EditorModule as an, ConfigEntryTypeSchema as ao, MutationReorderStateExamplesArgs as ar, SetOperationNameInputSchema as as, ConfigEntryType as at, undoOperationV2 as au, PHConnectRenown as b, SignalType as ba, loadState as bc, SchemaUndoAction as bi, filterDocumentOperationsResultingState as bl, IsStateOfType as bn, ManifestSchema as bo, MutationSetOperationErrorTemplateArgs as br, UpdateOperationExampleInputSchema as bs, DeleteModuleAction as bt, createState as bu, PHConnectDriveSection as c, SetOperationTemplateInput as ca, addStateExample as cc, ReorderStateExamplesInput as ci, verifyOperationSignature as cl, FileInput as cn, DeleteOperationErrorInputSchema as co, MutationSetInitialStateArgs as cr, SetOperationScopeInputSchema as cs, CreateChildDocumentInput as ct, Grant as cu, PHConnectInstance as d, SetPreferredEditorOperation as da, buildSignedAction as dc, SaveToFile as di, PHDocument as dl, ID as dn, DeleteStateExampleInputSchema as do, MutationSetModelIdArgs as dr, SetPreferredEditorActionSchema as ds, CreateDocumentAction as dt, PHBaseState as du, SetOperationNameInput as ea, actionFromAction as ec, ReorderModuleOperationsInput as ei, setOperationScope as el, DocumentModelVersioningOperations as en, AddOperationInputSchema as eo, MutationReorderChangeLogItemsInputArgs as er, SetOperationDescriptionInputSchema as es, AssertIsDocumentOfType as et, loadStateOperation as eu, PHConnectPackages as f, SetStateSchemaAction as fa, createAction as fc, SaveToFileHandle as fi, PHDocumentHeader as fl, IDocument as fn, DocumentActionSchema as fo, MutationSetModelNameArgs as fr, SetStateSchemaInputSchema as fs, CreateDocumentActionInput as ft, PHDocumentState as fu, PHConnectPwaIcon as g, Signal as ga, deleteOperationError as gc, SchemaPruneAction as gi, baseCreateDocument as gl, ISigner as gn, LoadStateActionInputSchema as go, MutationSetOperationDescriptionArgs as gr, UndoActionInputSchema as gs, DeleteChildDocumentInput as gt, createBaseState as gu, PHConnectPwaFileHandler as h, Set_PreferredEditor as ha, deleteOperation as hc, SchemaNOOPAction as hi, attachBranch as hl, ISignalResult as hn, DocumentSpecificationSchema as ho, MutationSetNameArgs as hr, StateSchema as hs, DeleteChangeLogItemInput as ht, createAuthState as hu, LogLevels as i, SetOperationSchemaInput as ia, addModule as ic, ReorderOperationErrorsInput as ii, undo as il, EditorDispatch as in, ConfigEntrySchema as io, MutationReorderOperationExamplesArgs as ir, SetOperationErrorTemplateInputSchema as is, ConfigEntry as it, undoOperation as iu, PowerhousePackage as j, UndoRedoAction as ja, reorderModuleOperations as jc, SetModelExtensionInput as ji, isUndoRedo as jl, MappedOperation as jn, PublisherSchema as jo, OperationErrorSpecification as jr, IBaseRelationalDb as js, DocumentModelAction as jt, Signature as ju, PathValidation as k, UndoAction as ka, releaseNewVersion as kc, SetModelDescriptionInput as ki, isNoopOperation as kl, MakeOptional as kn, PruneActionSchema as ko, MutationUpdateStateExampleArgs as kr, ExtractProcessorSchemaOrSelf as ks, DeleteStateExampleInput as kt, HashConfig as ku, PHConnectDriveSections as l, SetPreferredEditorAction as la, baseActions as lc, ReplayDocumentOptions as li, IntegrityIssueSubType as ll, GetDocumentOptions as ln, DeleteOperationExampleInputSchema as lo, MutationSetModelDescriptionArgs as lr, SetOperationTemplateInputSchema as ls, CreateChildDocumentSignal as lt, Operand as lu, PHConnectPwaCacheStrategy as m, Set_Name as ma, deleteModule as mc, SchemaLoadStateAction as mi, addUndo as ml, ISignal as mn, DocumentModelInputSchema as mo, MutationSetModuleNameArgs as mr, Set_PreferredEditorSchema as ms, DeleteChangeLogItemAction as mt, backfillAuthState as mu, DrivePreserveStrategy as n, SetOperationReducerInput as na, actions as nc, ReorderModulesInput as ni, setPreferredEditor as nl, DocumentSpecification as nn, AuthorSchema as no, MutationReorderModulesArgs as nr, SetOperationErrorDescriptionInputSchema as ns, Author as nt, setNameOperation as nu, PHConnectBranding as o, SetOperationScopeInput as oa, addOperationError as oc, ReorderOperationExamplesInput as oi, updateOperationExample as ol, EditorProps as on, DeleteChangeLogItemInputSchema as oo, MutationSetAuthorNameArgs as or, SetOperationReducerInputSchema as os, CopyChildDocumentInput as ot, Capability as ou, PHConnectPwa as p, SetStateSchemaInput as pa, deleteChangeLogItem as pc, Scalars as pi, PHDocumentMeta as pl, IOperation as pn, DocumentModelGlobalStateSchema as po, MutationSetModuleDescriptionArgs as pr, Set_NameSchema as ps, CreateState as pt, Principal as pu, AddOperationExampleAction as q, applyDeleteDocumentAction as qa, setOperationErrorCode as qc, SetOperationErrorDescriptionAction as qi, sortOperations as ql, MutationDeleteOperationErrorArgs as qn, SetModelExtensionInputSchema as qo, ReducerOptions as qr, ProcessorFilter as qs, DocumentModelOperationExampleOperations as qt, LogLevel as r, SetOperationSchemaAction as ra, addChangeLogItem as rc, ReorderOperationErrorsAction as ri, setStateSchema as rl, ENSInfo as rn, CodeExampleSchema as ro, MutationReorderOperationErrorsArgs as rr, SetOperationErrorNameInputSchema as rs, CodeExample as rt, setPreferredEditorOperation as ru, PHConnectDefaultDrive as s, SetOperationTemplateAction as sa, addOperationExample as sc, ReorderStateExamplesAction as si, updateStateExample as sl, Exact as sn, DeleteModuleInputSchema as so, MutationSetAuthorWebsiteArgs as sr, SetOperationSchemaInputSchema as ss, CopyChildDocumentSignal as st, Condition as su, DrivePreserveStrategies as t, SetOperationReducerAction as ta, actionSigner as tc, ReorderModulesAction as ti, setOperationTemplate as tl, DocumentOperationsIgnoreMap as tn, AddStateExampleInputSchema as to, MutationReorderModuleOperationsArgs as tr, SetOperationErrorCodeInputSchema as ts, AssertIsStateOfType as tt, redoOperation as tu, PHConnectDrives as u, SetPreferredEditorActionInput as ua, buildOperationSignature as uc, RevisionsFilter as ui, IntegrityIssueType as ul, IAction as un, DeleteOperationInputSchema as uo, MutationSetModelExtensionArgs as ur, SetPreferredEditorActionInputSchema as us, CreateDocument as ut, PHAuthState as uu, PHConnectPwaRuntimeCaching as v, SignalResult as va, deleteStateExample as vc, SchemaSetNameAction as vi, checkOperationsIntegrity as vl, InputMaybe as vn, LoadStateActionStateInputSchema as vo, MutationSetOperationErrorDescriptionArgs as vr, UndoSchema as vs, DeleteDocumentAction as vt, createGlobalState as vu, PHPackageProvider as w, SkipHeaderOperations as wa, operationFromAction as wc, SetAuthorWebsiteAction as wi, garbageCollectV2 as wl, LoadStateActionInput as wn, OperationScopeSchema as wo, MutationSetOperationTemplateArgs as wr, createNamespacedDb as ws, DeleteOperationErrorInput as wt, defaultGlobalState as wu, PHConnectRenownAdapters as x, SignatureVerificationHandler as xa, moveOperation as xc, ScopeState as xi, filterDuplicatedOperations as xl, LoadFromFile as xn, ModuleSchema as xo, MutationSetOperationNameArgs as xr, UpdateStateExampleInputSchema as xs, DeleteModuleInput as xt, defaultAuthState as xu, PHConnectPwaUrlPattern as y, SignalResults as ya, documentModelActions as yc, SchemaSetPreferredEditorAction as yi, diffOperations as yl, IsDocumentOfType as yn, Load_StateSchema as yo, MutationSetOperationErrorNameArgs as yr, UpdateChangeLogItemInputSchema as ys, DeleteDocumentActionInput as yt, createLocalState as yu, Actions as z, UpdateStateExampleInput as za, setModelDescription as zc, SetModuleNameInput as zi, prepareOperations as zl, MutationAddModuleArgs as zn, ReorderOperationErrorsInputSchema as zo, PruneAction as zr, IProcessorDispatch as zs, DocumentModelLocalState as zt };
2845
+ //# sourceMappingURL=types-CKsl6Smi.d.ts.map