everything-dev 2.0.0-rc.4 → 2.0.0-rc.6

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 (71) hide show
  1. package/dist/api-contract.cjs +3 -6
  2. package/dist/api-contract.cjs.map +1 -1
  3. package/dist/api-contract.mjs +3 -6
  4. package/dist/api-contract.mjs.map +1 -1
  5. package/dist/apps/upload/src/client.cjs +188 -0
  6. package/dist/apps/upload/src/client.cjs.map +1 -0
  7. package/dist/apps/upload/src/client.mjs +180 -0
  8. package/dist/apps/upload/src/client.mjs.map +1 -0
  9. package/dist/bundle-fs-resolve.cjs +37 -3
  10. package/dist/bundle-fs-resolve.cjs.map +1 -1
  11. package/dist/bundle-fs-resolve.mjs +37 -3
  12. package/dist/bundle-fs-resolve.mjs.map +1 -1
  13. package/dist/cdn-deploy.cjs +29 -11
  14. package/dist/cdn-deploy.cjs.map +1 -1
  15. package/dist/cdn-deploy.mjs +29 -11
  16. package/dist/cdn-deploy.mjs.map +1 -1
  17. package/dist/cli/infra.cjs +4 -2
  18. package/dist/cli/infra.cjs.map +1 -1
  19. package/dist/cli/infra.mjs +4 -2
  20. package/dist/cli/infra.mjs.map +1 -1
  21. package/dist/cli/init.cjs +0 -2
  22. package/dist/cli/init.cjs.map +1 -1
  23. package/dist/cli/init.d.cts +1 -1
  24. package/dist/cli/init.d.mts +1 -1
  25. package/dist/cli/init.mjs +0 -2
  26. package/dist/cli/init.mjs.map +1 -1
  27. package/dist/cli/sync.cjs +0 -1
  28. package/dist/cli/sync.cjs.map +1 -1
  29. package/dist/cli/sync.mjs +0 -1
  30. package/dist/cli/sync.mjs.map +1 -1
  31. package/dist/commands/deploy.cjs +0 -2
  32. package/dist/commands/deploy.cjs.map +1 -1
  33. package/dist/commands/deploy.mjs +0 -2
  34. package/dist/commands/deploy.mjs.map +1 -1
  35. package/dist/commands/upgrade.cjs +30 -7
  36. package/dist/commands/upgrade.cjs.map +1 -1
  37. package/dist/commands/upgrade.mjs +30 -7
  38. package/dist/commands/upgrade.mjs.map +1 -1
  39. package/dist/config.cjs.map +1 -1
  40. package/dist/config.mjs.map +1 -1
  41. package/dist/contract.meta.cjs +1 -1
  42. package/dist/contract.meta.cjs.map +1 -1
  43. package/dist/contract.meta.d.cts +1 -1
  44. package/dist/contract.meta.d.mts +1 -1
  45. package/dist/contract.meta.mjs +1 -1
  46. package/dist/contract.meta.mjs.map +1 -1
  47. package/dist/dev-program.cjs +2 -2
  48. package/dist/dev-program.cjs.map +1 -1
  49. package/dist/dev-program.mjs +2 -3
  50. package/dist/dev-program.mjs.map +1 -1
  51. package/dist/image-deploy.cjs +38 -14
  52. package/dist/image-deploy.cjs.map +1 -1
  53. package/dist/image-deploy.mjs +39 -15
  54. package/dist/image-deploy.mjs.map +1 -1
  55. package/dist/orchestrator.cjs +22 -18
  56. package/dist/orchestrator.cjs.map +1 -1
  57. package/dist/orchestrator.mjs +22 -18
  58. package/dist/orchestrator.mjs.map +1 -1
  59. package/dist/storage-upload.cjs +7 -68
  60. package/dist/storage-upload.cjs.map +1 -1
  61. package/dist/storage-upload.mjs +7 -68
  62. package/dist/storage-upload.mjs.map +1 -1
  63. package/dist/ui/api.cjs +11 -69
  64. package/dist/ui/api.cjs.map +1 -1
  65. package/dist/ui/api.d.cts +2 -4
  66. package/dist/ui/api.d.mts +2 -4
  67. package/dist/ui/api.mjs +11 -69
  68. package/dist/ui/api.mjs.map +1 -1
  69. package/dist/ui/auth.d.cts +43 -43
  70. package/dist/ui/auth.d.mts +43 -43
  71. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { Effect, Schema } from \"effect\";\nimport { getProcessEnv } from \"./env/process-env\";\n\nconst warnOutsideEffect = (...args: unknown[]): void => {\n console.warn(...args);\n};\n\nimport { sanitizeContainerName } from \"every-plugin/ui/manifest/contract\";\nimport { fetchApiPluginManifest } from \"./api-contract\";\nimport { manifestPluginsToNodes } from \"./dag\";\nimport { resolveApp, toConfigInput } from \"./descriptor/resolve\";\nimport { type AppDescriptor, AppDescriptorSchema } from \"./descriptor/schema\";\nimport { fetchBosConfigFromFastKv } from \"./fastkv\";\nimport { fetchJsonOrNull } from \"./http-client\";\nimport {\n type BosEnv,\n bosConfigMerger,\n isPlainObject,\n type ResolvedConfigMeta,\n rebuildOrderedConfig,\n resolveExtendsRef,\n} from \"./merge\";\nimport { getNetworkIdForAccount } from \"./network\";\nimport type {\n BosConfig,\n BosConfigInput,\n BosPluginRef,\n JsonObject,\n JsonValue,\n PluginEntryValue,\n RuntimeConfig,\n RuntimePluginConfig,\n} from \"./types\";\nimport { BosConfigSchema } from \"./types\";\nimport { type ResolvedSlotVersion, resolveSlotVersion } from \"./version-manifest-resolve\";\n\nconst LOCAL_PREFIX = \"local:\";\nconst DEFAULT_HOST_PORT = 3000;\nconst RESOLVED_CONFIG_FILENAME = \"bos.resolved-config.json\";\n\nexport const MISSING_CONFIG_MESSAGE = \"No config found (bos.app.ts or bos.config.json)\";\n\nexport const DEV_OVERLAY_FILENAME = \"bos.dev.ts\";\n\ntype RuntimeOverrideTarget = \"ui\" | \"api\" | \"plugins\" | `plugins.${string}`;\n\ninterface RuntimeTarget {\n source: \"local\" | \"remote\";\n url: string;\n localPath?: string;\n port?: number;\n}\n\ninterface ConfigWarningCapture {\n sink: string[];\n previous: ConfigWarningCapture | undefined;\n}\n\nconst warningCapture = new AsyncLocalStorage<ConfigWarningCapture | undefined>();\n\n/**\n * @internal — runs `fn` with config warnings captured into `sink` instead of\n * the console. Plumbing for the resolution session; not part of the public\n * config surface.\n */\nexport function runWithConfigWarningSink<T>(sink: string[], fn: () => T): T {\n return warningCapture.run({ sink, previous: warningCapture.getStore() }, fn);\n}\n\nfunction emitConfigWarning(message: string): void {\n const capture = warningCapture.getStore();\n if (capture) {\n capture.sink.push(message);\n } else {\n console.warn(message);\n }\n}\n\nconst configPathCache = new Map<string, string | null>();\n\n/**\n * @internal — clears the findConfigPath memo. Plumbing for tests and the\n * resolution session; not part of the public config surface.\n */\nexport function resetConfigPathCache(): void {\n configPathCache.clear();\n}\n\n/**\n * Reads the local authored config without resolving the extends chain or\n * touching the network — the build-surface factories (generated rsbuild\n * configs) consume it for their APP_NAME/APP_ACCOUNT defines.\n */\nexport async function readAuthoredConfigInput(cwd?: string): Promise<BosConfigInput | null> {\n const configPath = findConfigPath(cwd);\n if (!configPath || configPath.startsWith(\"bos://\")) return null;\n return readConfigInput(configPath, dirname(configPath));\n}\n\n/**\n * The authored config entry inside exactly `dir` — no upward walk. Unlike\n * `findConfigPath` this never escapes the given directory, for write targets\n * and nested-local-path resolution where a parent's config must not be\n * picked up. Prefers the authored `bos.app.ts` descriptor (the canonical\n * form) over a legacy `bos.config.json`.\n */\nexport function localConfigEntryPath(dir: string): string | null {\n const appPath = join(dir, \"bos.app.ts\");\n if (existsSync(appPath)) return appPath;\n const jsonPath = join(dir, \"bos.config.json\");\n return existsSync(jsonPath) ? jsonPath : null;\n}\n\n/** `localConfigEntryPath` + the form-aware read (`BosConfigInput`). */\nexport async function readLocalAuthoredConfigInput(dir: string): Promise<BosConfigInput | null> {\n const entry = localConfigEntryPath(dir);\n if (!entry) return null;\n return readConfigInput(entry, dirname(entry));\n}\n\n/**\n * The authored `bos.app.ts` descriptor is the canonical form — when both\n * forms coexist (e.g. a generated `bos.config.json` write-back beside the\n * authored descriptor), the authored file wins. JSON-form-only children are\n * unaffected: with no `bos.app.ts`, the JSON file is the entry.\n */\nexport function findConfigPath(cwd?: string): string | null {\n const cacheKey = resolve(cwd ?? process.cwd());\n const cached = configPathCache.get(cacheKey);\n if (cached !== undefined) return cached;\n\n let dir = cacheKey;\n while (true) {\n const appPath = join(dir, \"bos.app.ts\");\n if (existsSync(appPath)) {\n configPathCache.set(cacheKey, appPath);\n return appPath;\n }\n const jsonPath = join(dir, \"bos.config.json\");\n if (existsSync(jsonPath)) {\n configPathCache.set(cacheKey, jsonPath);\n return jsonPath;\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n configPathCache.set(cacheKey, null);\n return null;\n}\n\nexport function isAppDescriptorPath(configPath: string): boolean {\n return configPath.endsWith(\".app.ts\") || configPath.endsWith(\".app.js\");\n}\n\n/**\n * Materialize an authored bos.app.ts descriptor into the authoring-shape\n * `BosConfigInput` the config pipeline consumes. Import-extends is honored\n * two ways: the parent descriptor value can be imported directly (an\n * inlined parent, resolved through `resolveApp`), or `extends` can name a\n * published config (`bos://…`) / a local file, which flows into the JSON\n * extends chain unchanged.\n */\nexport async function loadAppDescriptorConfig(resolvedPath: string): Promise<BosConfigInput> {\n // webpackIgnore: the path is inherently runtime-resolved — bundlers must\n // not try to statically analyze it (rsbuild otherwise warns \"Critical\n // dependency: the request of a dependency is an expression\").\n const mod = (await import(/* webpackIgnore: true */ pathToFileURL(resolvedPath).href)) as Record<\n string,\n unknown\n >;\n return parseAppDescriptorModule(mod, resolvedPath);\n}\n\n/**\n * @internal — parses an already-imported app descriptor module into the\n * authoring-shape `BosConfigInput`. Plumbing for the resolution session's\n * injectable module loader; not part of the public config surface.\n */\nexport function parseAppDescriptorModule(\n mod: Record<string, unknown>,\n sourcePath?: string,\n): BosConfigInput {\n if (!mod.default) {\n throw new Error(\n `${sourcePath ?? \"App descriptor module\"} must default-export an App() descriptor`,\n );\n }\n const descriptor = AppDescriptorSchema.parse(mod.default);\n\n // Registry candidates: named exports that parse as App descriptors.\n const registry: Record<string, unknown> = {};\n for (const value of Object.values(mod)) {\n const parsed = AppDescriptorSchema.safeParse(value);\n if (parsed.success) registry[parsed.data.name] = parsed.data;\n }\n\n const extendsRef = descriptor.extends;\n const inRegistry = typeof extendsRef === \"string\" && registry[extendsRef] !== undefined;\n const importedParent = extendsRef !== undefined && typeof extendsRef !== \"string\";\n\n if (inRegistry || importedParent) {\n return resolveApp(descriptor.name, registry as never);\n }\n\n const input = toConfigInput(descriptor);\n if (extendsRef !== undefined) {\n input.extends = extendsRef as BosConfigInput[\"extends\"];\n }\n return input;\n}\n\n/**\n * @internal — validates an already-imported `bos.dev.ts` module as a\n * `Partial<AppDescriptor>` dev overlay. Plumbing for the resolution session's\n * injectable module loader; not part of the public config surface.\n */\nexport function parseDevOverlayModule(\n mod: Record<string, unknown>,\n sourcePath?: string,\n): Partial<AppDescriptor> {\n const source = sourcePath ?? DEV_OVERLAY_FILENAME;\n if (!mod?.default) {\n throw new DevOverlayError({\n path: source,\n message: `${source} must default-export a dev overlay (Partial<AppDescriptor>)`,\n });\n }\n const parsed = AppDescriptorSchema.partial().safeParse(mod.default);\n if (!parsed.success) {\n throw new DevOverlayError({\n path: source,\n message: `${source} is not a valid dev overlay: ${parsed.error.message}`,\n cause: parsed.error,\n });\n }\n return parsed.data;\n}\n\nexport interface ResolvedComposableReference {\n entry: BosPluginRef;\n providerBaseDir: string;\n targetPath: string;\n associatedUi?: Record<string, unknown>;\n}\n\ninterface ParsedExtendsTarget {\n configPath: string;\n targetPath?: string;\n}\n\nexport class ConfigLoadError extends Schema.TaggedError<ConfigLoadError>()(\"ConfigLoadError\", {\n path: Schema.String,\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n}) {}\n\nexport class CircularExtendsError extends Schema.TaggedError<CircularExtendsError>()(\n \"CircularExtendsError\",\n { chain: Schema.Array(Schema.String), message: Schema.String },\n) {}\n\nexport class ConfigNotfoundError extends Schema.TaggedError<ConfigNotfoundError>()(\n \"ConfigNotfoundError\",\n { message: Schema.String },\n) {}\n\nexport class ConfigExtendsError extends Schema.TaggedError<ConfigExtendsError>()(\n \"ConfigExtendsError\",\n {\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n },\n) {}\n\nexport class ConfigVersionManifestError extends Schema.TaggedError<ConfigVersionManifestError>()(\n \"ConfigVersionManifestError\",\n {\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n },\n) {}\n\nexport class DevOverlayError extends Schema.TaggedError<DevOverlayError>()(\"DevOverlayError\", {\n path: Schema.String,\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n}) {}\n\nexport function defaultConfigEnv(): BosEnv {\n return process.env.NODE_ENV === \"production\" ? \"production\" : \"development\";\n}\n\nexport function parseRuntimeOverrideTargets(value?: string | null): RuntimeOverrideTarget[] {\n if (!value) {\n return [];\n }\n\n return [\n ...new Set(\n value\n .split(\",\")\n .map((entry) => entry.trim())\n .filter(Boolean),\n ),\n ].map((entry) => {\n if (entry === \"ui\" || entry === \"api\" || entry === \"plugins\") {\n return entry;\n }\n\n if (entry.startsWith(\"plugins.\") && entry.length > \"plugins.\".length) {\n return entry as RuntimeOverrideTarget;\n }\n\n throw new ConfigExtendsError({ message: `Invalid runtime override target: ${entry}` });\n });\n}\n\nexport function isRuntimeOverrideAllowed(\n allowedTargets: ReadonlyArray<RuntimeOverrideTarget>,\n target: \"ui\" | \"api\" | \"plugins\" | `plugins.${string}`,\n): boolean {\n if (allowedTargets.includes(target as RuntimeOverrideTarget)) {\n return true;\n }\n\n if (target.startsWith(\"plugins.\")) {\n return allowedTargets.includes(\"plugins.*\");\n }\n\n return false;\n}\n\nexport async function buildRuntimePluginsForConfig(\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n remotePlugins?: string[],\n): Promise<Record<string, RuntimePluginConfig> | undefined> {\n const plugins = await resolveRuntimePlugins(config.plugins ?? {}, baseDir, env, remotePlugins);\n return Object.keys(plugins).length > 0 ? plugins : undefined;\n}\n\nfunction getEntryAssociatedUi(entry: Partial<BosPluginRef>): Record<string, unknown> | undefined {\n const flat = isPlainObject(entry.ui) ? (entry.ui as Record<string, unknown>) : undefined;\n const nested = (() => {\n if (!isPlainObject(entry.app)) return undefined;\n const app = entry.app as Record<string, unknown>;\n return isPlainObject(app.ui) ? (app.ui as Record<string, unknown>) : undefined;\n })();\n const ui = flat ?? nested;\n if (!ui) return undefined;\n\n if (\"shared\" in ui) {\n throw new ConfigExtendsError({\n message:\n \"app.ui.shared is no longer supported. Move shared deps to app.api.shared, app.auth.shared, or plugins.*.shared.\",\n });\n }\n\n return ui;\n}\n\nfunction mergeAssociatedUi(\n parentUi: Record<string, unknown> | undefined,\n childUi: Record<string, unknown> | undefined,\n): Record<string, unknown> | undefined {\n if (!parentUi) {\n return childUi ? { ...childUi } : undefined;\n }\n\n if (!childUi) {\n return { ...parentUi };\n }\n\n return bosConfigMerger({ ...childUi }, parentUi) as Record<string, unknown>;\n}\n\nfunction withAssociatedUi(\n entry: BosPluginRef,\n associatedUi?: Record<string, unknown>,\n): BosPluginRef {\n if (!associatedUi) {\n return entry;\n }\n\n const app = isPlainObject(entry.app)\n ? ({ ...(entry.app as Record<string, unknown>) } as Record<string, unknown>)\n : {};\n app.ui = mergeAssociatedUi(getEntryAssociatedUi(entry), associatedUi);\n\n return {\n ...entry,\n app,\n };\n}\n\nexport async function resolveConfigComposableEntries(\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n): Promise<BosConfig> {\n const [resolvedApi, resolvedAuth] = await Promise.all([\n resolveComposableReference(config.app.api as BosPluginRef, baseDir, env, \"app.api\"),\n config.app.auth\n ? resolveComposableReference(config.app.auth as BosPluginRef, baseDir, env, \"app.auth\")\n : Promise.resolve(undefined),\n ]);\n\n const resolvedPlugins = config.plugins\n ? Object.fromEntries(\n await Promise.all(\n Object.entries(config.plugins).map(async ([pluginId, pluginValue]) => {\n const resolvedPlugin = await resolveComposableReference(\n asComposableEntry(pluginValue),\n baseDir,\n env,\n `plugins.${pluginId}`,\n );\n\n return [\n pluginId,\n withAssociatedUi(resolvedPlugin.entry, resolvedPlugin.associatedUi),\n ] as const;\n }),\n ),\n )\n : undefined;\n\n return {\n ...config,\n app: {\n ...config.app,\n api: resolvedApi.entry,\n auth: resolvedAuth?.entry,\n },\n plugins: resolvedPlugins,\n };\n}\n\nexport function getResolvedConfigPath(configDir: string): string {\n return join(configDir, \".bos\", RESOLVED_CONFIG_FILENAME);\n}\n\nexport function loadGeneratedResolvedConfig(configDir: string): BosConfig | null {\n const resolvedPath = getResolvedConfigPath(configDir);\n if (!existsSync(resolvedPath)) return null;\n try {\n const raw = JSON.parse(readFileSync(resolvedPath, \"utf-8\"));\n if (!isPlainObject(raw)) return null;\n const { _resolved, ...configData } = raw;\n return BosConfigSchema.parse(configData);\n } catch {\n return null;\n }\n}\n\nexport function writeResolvedConfig(\n configDir: string,\n config: BosConfig,\n env: BosEnv,\n extendsChain?: string[],\n source?: string,\n): void {\n const resolvedPath = getResolvedConfigPath(configDir);\n const resolvedDir = dirname(resolvedPath);\n if (!existsSync(resolvedDir)) {\n mkdirSync(resolvedDir, { recursive: true });\n }\n\n const ordered = rebuildOrderedConfig(config);\n const meta: ResolvedConfigMeta = {\n env,\n resolvedAt: new Date().toISOString(),\n extendsChain: extendsChain ?? [],\n ...(source ? { source } : {}),\n };\n const output = {\n _resolved: meta,\n ...ordered,\n };\n\n const content = `${JSON.stringify(output, null, 2)}\\n`;\n try {\n if (readFileSync(resolvedPath, \"utf-8\") === content) return;\n } catch {\n // file doesn't exist yet\n }\n writeFileSync(resolvedPath, content);\n}\n\nexport function resolveBosConfigPath(configDir: string): string {\n const resolvedPath = getResolvedConfigPath(configDir);\n if (existsSync(resolvedPath)) return resolvedPath;\n return join(configDir, \"bos.config.json\");\n}\n\nexport async function readBosConfigForBuild(configDir: string): Promise<Record<string, unknown>> {\n const resolvedPath = getResolvedConfigPath(configDir);\n if (existsSync(resolvedPath)) {\n try {\n const raw = JSON.parse(readFileSync(resolvedPath, \"utf-8\"));\n if (isPlainObject(raw)) {\n const { _resolved, ...configData } = raw;\n return configData as Record<string, unknown>;\n }\n } catch (e) {\n console.warn(\n `[Config] Failed to parse _resolved.json, falling back to the authored config: ${String(e)}`,\n );\n }\n }\n // Form-aware fallback: the authored `bos.app.ts` descriptor is canonical —\n // a TS-form child has no committed bos.config.json to parse.\n const authored = await readLocalAuthoredConfigInput(configDir);\n if (authored) return authored as unknown as Record<string, unknown>;\n const bosConfigPath = join(configDir, \"bos.config.json\");\n return JSON.parse(readFileSync(bosConfigPath, \"utf-8\")) as Record<string, unknown>;\n}\n\n/**\n * @internal — splits an extends ref into its config path and optional\n * `#target` suffix. Plumbing for the resolution session; not part of the\n * public config surface.\n */\nexport function parseExtendsTarget(ref: string): ParsedExtendsTarget {\n const hashIndex = ref.indexOf(\"#\");\n if (hashIndex === -1) {\n return { configPath: ref };\n }\n\n const configPath = ref.slice(0, hashIndex);\n const targetPath = ref.slice(hashIndex + 1);\n return {\n configPath,\n targetPath: targetPath.length > 0 ? targetPath : undefined,\n };\n}\n\n/**\n * @internal — resolves the base directory a config path extends from.\n * Plumbing for the resolution session; not part of the public config surface.\n */\nexport function getConfigBaseDir(configPath: string, baseDir: string): string {\n if (configPath.startsWith(\"bos://\")) return baseDir;\n return dirname(isAbsolute(configPath) ? configPath : resolve(baseDir, configPath));\n}\n\nfunction asComposableEntry(value: unknown): BosPluginRef {\n if (value === undefined) {\n return {};\n }\n if (typeof value === \"string\") {\n return { extends: value };\n }\n if (!isPlainObject(value)) {\n throw new ConfigExtendsError({\n message: `Expected config entry object, received ${typeof value}`,\n });\n }\n return value as BosPluginRef;\n}\n\nfunction getTargetedEntry(config: BosConfigInput, targetPath: string): BosPluginRef {\n if (targetPath.startsWith(\"app.\")) {\n const entryKey = targetPath.slice(\"app.\".length);\n return asComposableEntry(config.app?.[entryKey]);\n }\n\n if (targetPath.startsWith(\"plugins.\")) {\n const pluginId = targetPath.slice(\"plugins.\".length);\n if (pluginId.length === 0) {\n throw new ConfigExtendsError({ message: `Invalid plugin target path: ${targetPath}` });\n }\n return asComposableEntry(config.plugins?.[pluginId]);\n }\n\n throw new ConfigExtendsError({ message: `Unsupported extends target path: ${targetPath}` });\n}\n\nfunction getAssociatedUi(\n config: BosConfigInput,\n _targetPath: string,\n): Record<string, unknown> | undefined {\n if (!isPlainObject(config.app?.ui)) {\n return undefined;\n }\n\n const ui = config.app.ui as Record<string, unknown>;\n if (\"shared\" in ui) {\n throw new ConfigExtendsError({\n message:\n \"app.ui.shared is no longer supported. Move shared deps to app.api.shared, app.auth.shared, or plugins.*.shared.\",\n });\n }\n\n return ui;\n}\n\nfunction applyNullOverrides(\n target: Record<string, unknown>,\n source: Record<string, unknown>,\n): void {\n for (const [key, value] of Object.entries(source)) {\n if (value === null) {\n target[key] = null;\n } else if (isPlainObject(value) && isPlainObject(target[key])) {\n applyNullOverrides(target[key] as Record<string, unknown>, value as Record<string, unknown>);\n }\n }\n}\n\nfunction mergeComposableEntries(\n parent: Partial<BosPluginRef>,\n child: Partial<BosPluginRef>,\n): BosPluginRef {\n const merged = bosConfigMerger({ ...child }, parent) as Record<string, unknown>;\n applyNullOverrides(merged, child as Record<string, unknown>);\n return merged as BosPluginRef;\n}\n\nfunction stripUnsafeLocalDevelopment<T extends Record<string, unknown> | undefined>(\n entry: T,\n allowLocalPaths: boolean,\n): T {\n if (!entry || allowLocalPaths) {\n return entry;\n }\n\n if (typeof entry.development === \"string\" && entry.development.startsWith(LOCAL_PREFIX)) {\n const { development: _ignored, ...rest } = entry;\n return rest as T;\n }\n\n return entry;\n}\n\nexport async function resolveComposableReference(\n source: BosPluginRef,\n baseDir: string,\n env: BosEnv,\n defaultTargetPath: string,\n): Promise<ResolvedComposableReference> {\n let resolvedEntry: BosPluginRef = {};\n let providerBaseDir = baseDir;\n let targetPath = defaultTargetPath;\n let associatedUi = getEntryAssociatedUi(source);\n let allowLocalPaths = false;\n let extendsError: unknown;\n\n const extendsRef = source.extends ? resolveExtendsRef(source.extends, env) : undefined;\n if (extendsRef) {\n const { resolveMergedConfigInput } = await import(\"./resolution/session\");\n const parsed = parseExtendsTarget(extendsRef);\n targetPath = parsed.targetPath ?? defaultTargetPath;\n const extendsBaseDir = getConfigBaseDir(parsed.configPath, baseDir);\n try {\n const extendedConfig = await resolveMergedConfigInput(parsed.configPath, {\n baseDir: extendsBaseDir,\n env,\n });\n resolvedEntry = mergeComposableEntries(\n resolvedEntry,\n getTargetedEntry(extendedConfig, targetPath),\n );\n providerBaseDir = extendsBaseDir;\n associatedUi = mergeAssociatedUi(associatedUi, getAssociatedUi(extendedConfig, targetPath));\n } catch (error) {\n extendsError = error;\n }\n }\n\n const localDevelopment =\n typeof source.development === \"string\" && source.development.startsWith(LOCAL_PREFIX)\n ? source.development\n : undefined;\n const localDevelopmentPath = localDevelopment\n ? resolve(baseDir, localDevelopment.slice(LOCAL_PREFIX.length).trim())\n : undefined;\n const hasUsableLocalDevelopment = Boolean(\n localDevelopmentPath && existsSync(localDevelopmentPath),\n );\n\n if (localDevelopmentPath) {\n const { resolveMergedConfigInput } = await import(\"./resolution/session\");\n const localPath = localDevelopmentPath;\n const localConfigPath = localConfigEntryPath(localPath);\n if (localConfigPath) {\n const localConfig = await resolveMergedConfigInput(localConfigPath, {\n baseDir: localPath,\n env,\n });\n resolvedEntry = mergeComposableEntries(\n resolvedEntry,\n getTargetedEntry(localConfig, targetPath),\n );\n providerBaseDir = localPath;\n associatedUi = mergeAssociatedUi(associatedUi, getAssociatedUi(localConfig, targetPath));\n allowLocalPaths = true;\n }\n }\n\n const sourceOverrides = { ...source };\n if (allowLocalPaths && localDevelopment) {\n delete sourceOverrides.development;\n }\n\n resolvedEntry = mergeComposableEntries(resolvedEntry, sourceOverrides);\n associatedUi = mergeAssociatedUi(associatedUi, getEntryAssociatedUi(sourceOverrides));\n\n if (extendsError && !allowLocalPaths && !hasUsableLocalDevelopment) {\n throw extendsError;\n }\n\n return {\n entry: stripUnsafeLocalDevelopment(resolvedEntry, allowLocalPaths || Boolean(localDevelopment)),\n providerBaseDir,\n targetPath,\n // A plugin's own ui lives under its local development tree — the same\n // safety argument as the entry itself: keep its local target when the\n // plugin resolves locally, or the folder-form ui surface silently\n // disappears (no BOS_UI_PORT, an unassigned ui dev server, and a\n // port collision with another plugin's ui slot).\n associatedUi: stripUnsafeLocalDevelopment(\n associatedUi,\n allowLocalPaths || Boolean(localDevelopment),\n ),\n };\n}\n\nfunction resolveDevelopmentTarget(\n development: string | undefined,\n production: string | undefined,\n baseDir: string,\n forceSource?: \"local\" | \"remote\",\n target?: string,\n extendsRef?: string,\n): RuntimeTarget {\n if (forceSource === \"remote\") {\n return resolveRuntimeTarget(production, baseDir, \"remote\");\n }\n if (!development) {\n if (production && target) {\n if (extendsRef) {\n emitConfigWarning(`[Config] Resolving \"${target}\" from ${extendsRef}`);\n } else {\n emitConfigWarning(`[Config] No development target for \"${target}\", using production`);\n }\n }\n return resolveRuntimeTarget(production, baseDir, \"remote\");\n }\n const devTarget = resolveRuntimeTarget(development, baseDir);\n if (devTarget.source === \"local\" && (!devTarget.localPath || !existsSync(devTarget.localPath))) {\n if (production && target) {\n emitConfigWarning(`[Config] Could not load local target for \"${target}\", using production`);\n }\n return resolveRuntimeTarget(production, baseDir, \"remote\");\n }\n return devTarget;\n}\n\nexport interface BuildRuntimeConfigOptions {\n plugins?: Record<string, RuntimePluginConfig>;\n hostSource?: \"local\" | \"remote\";\n uiSource?: \"local\" | \"remote\";\n apiSource?: \"local\" | \"remote\";\n authSource?: \"local\" | \"remote\";\n proxy?: string;\n}\n\nexport const buildRuntimeConfigEffect = Effect.fn(\"buildRuntimeConfig\")(function* (\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n options?: BuildRuntimeConfigOptions,\n): Effect.fn.Return<RuntimeConfig, ConfigExtendsError | ConfigVersionManifestError> {\n const uiConfig = config.app.ui;\n const apiConfig = config.app.api;\n const authConfig = config.app.auth;\n const uiRuntime =\n env === \"development\"\n ? resolveDevelopmentTarget(\n uiConfig.development,\n uiConfig.production,\n baseDir,\n options?.uiSource,\n \"app.ui\",\n )\n : resolveRuntimeTarget(uiConfig.production, baseDir, \"remote\");\n const apiRuntime =\n env === \"development\"\n ? resolveDevelopmentTarget(\n apiConfig.development,\n apiConfig.production,\n baseDir,\n options?.apiSource,\n \"app.api\",\n )\n : resolveRuntimeTarget(apiConfig.production, baseDir, \"remote\");\n const authExtendsRef = authConfig?.extends\n ? resolveExtendsRef(authConfig.extends, env)\n : undefined;\n const authRuntime = authConfig\n ? env === \"development\"\n ? resolveDevelopmentTarget(\n authConfig.development,\n authConfig.production,\n baseDir,\n options?.authSource,\n \"app.auth\",\n authExtendsRef,\n )\n : resolveRuntimeTarget(authConfig.production, baseDir, \"remote\")\n : undefined;\n\n const hostConfig = config.app.host;\n const hostRuntime =\n env === \"development\"\n ? resolveDevelopmentTarget(\n hostConfig.development,\n hostConfig.production,\n baseDir,\n options?.hostSource,\n \"app.host\",\n )\n : resolveRuntimeTarget(hostConfig.production, baseDir, \"remote\");\n\n const hostListeningUrl =\n env === \"development\"\n ? resolveDevelopmentHostUrl(hostConfig.development)\n : `http://localhost:${getProcessEnv(\"PORT\") ?? DEFAULT_HOST_PORT}`;\n\n const hostIsRemote = hostRuntime.source === \"remote\";\n const uiIsRemote = uiRuntime.source === \"remote\";\n const apiIsRemote = apiRuntime.source === \"remote\";\n const resolvedApiName = resolvePluginRuntimeName(apiConfig.name, apiRuntime.localPath, \"api\");\n\n const authEntry = yield* Effect.tryPromise({\n try: async () => {\n if (!authConfig || !authRuntime) return undefined;\n if (!authRuntime.localPath && !authRuntime.url) return undefined;\n let authName = resolvePluginRuntimeName(authConfig.name, authRuntime.localPath, \"auth\");\n if (\n authRuntime.source === \"remote\" &&\n authRuntime.url &&\n !authRuntime.localPath &&\n typeof authConfig.name !== \"string\"\n ) {\n authName = await resolveRemotePluginRuntimeName(authRuntime.url, authName);\n }\n return {\n name: authName,\n extendsRef: authExtendsRef,\n url: authRuntime.url,\n entry: authRuntime.url ? `${authRuntime.url}/mf-manifest.json` : \"/mf-manifest.json\",\n localPath: authRuntime.localPath,\n port: authRuntime.port,\n source: authRuntime.source,\n proxy: authConfig.proxy,\n variables: authConfig.variables,\n secrets: authConfig.secrets,\n integrity: authRuntime.source === \"remote\" ? authConfig.integrity : undefined,\n shared: authConfig.shared,\n ui: buildRuntimeUiConfig(\n \"auth\",\n env,\n getEntryAssociatedUi(authConfig as Partial<BosPluginRef>),\n baseDir,\n authName,\n options?.authSource,\n ),\n };\n },\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n\n const explicitPlugins =\n options?.plugins && Object.keys(options.plugins).length > 0 ? options.plugins : undefined;\n const runtimePlugins: Record<string, RuntimePluginConfig> = { ...explicitPlugins };\n if (authEntry && !runtimePlugins.auth) {\n runtimePlugins.auth = authEntry;\n }\n\n const result: RuntimeConfig = {\n env,\n account: config.account,\n domain: config.domain,\n title: config.title,\n description: config.description,\n networkId: getNetworkIdForAccount(config.account),\n repository: config.repository,\n host: {\n name: \"host\",\n url: hostListeningUrl,\n entry: `${hostListeningUrl}/mf-manifest.json`,\n localPath: hostRuntime.localPath,\n port:\n env === \"development\"\n ? parsePort(hostListeningUrl)\n : Number(getProcessEnv(\"PORT\")) || DEFAULT_HOST_PORT,\n secrets: hostConfig.secrets,\n integrity: hostIsRemote ? hostConfig.integrity : undefined,\n source: hostRuntime.source,\n remoteUrl: hostIsRemote ? hostRuntime.url : undefined,\n },\n ui: {\n name: resolvePluginRuntimeName(uiConfig.name, uiRuntime.localPath, \"ui\"),\n url: uiRuntime.url,\n entry: uiRuntime.url ? `${uiRuntime.url}/mf-manifest.json` : \"/mf-manifest.json\",\n publicUrl: typeof uiConfig.publicUrl === \"string\" ? uiConfig.publicUrl : undefined,\n localPath: uiRuntime.localPath,\n port: uiRuntime.port,\n ssrUrl: uiIsRemote ? uiConfig.ssr : undefined,\n ssrIntegrity: uiIsRemote ? uiConfig.ssrIntegrity : undefined,\n integrity: uiIsRemote ? uiConfig.integrity : undefined,\n source: uiRuntime.source,\n },\n api: {\n name: resolvedApiName,\n url: apiRuntime.url,\n entry: apiRuntime.url ? `${apiRuntime.url}/mf-manifest.json` : \"/mf-manifest.json\",\n localPath: apiRuntime.localPath,\n port: apiRuntime.port,\n source: apiRuntime.source,\n proxy: options?.proxy ?? apiConfig.proxy,\n variables: apiConfig.variables,\n secrets: apiConfig.secrets,\n integrity: apiIsRemote ? apiConfig.integrity : undefined,\n shared: apiConfig.shared,\n dependsOn: apiConfig.dependsOn ? normalizeStringArray(apiConfig.dependsOn) : undefined,\n },\n auth: authEntry,\n plugins: Object.keys(runtimePlugins).length > 0 ? runtimePlugins : undefined,\n };\n\n yield* Effect.tryPromise({\n try: async () => {\n // catch-all diagnostics: a failed discovery fetch degrades to a\n // warning, never fails the runtime config build\n try {\n if (result.api.source !== \"remote\" || !result.api.url) return;\n const manifest = await fetchApiPluginManifest(result.api.url);\n const manifestPluginEntries: Array<{ key: string; config: RuntimePluginConfig }> = [];\n if (manifest.plugins?.length) {\n for (const node of manifestPluginsToNodes(manifest.plugins)) {\n if (!result.plugins?.[node.key]) {\n manifestPluginEntries.push({\n key: node.key,\n config: {\n name: node.name,\n url: node.url,\n entry: node.entry,\n source: \"remote\",\n dependsOn: node.dependsOn,\n secrets: node.secrets,\n variables: node.variables,\n },\n });\n if (node.secrets) {\n for (const secretName of node.secrets) {\n if (!getProcessEnv(secretName)) {\n warnOutsideEffect(\n `[Config] Plugin \"${node.key}\" (discovered from manifest) expects secret \"${secretName}\" but it is not set in the environment.`,\n );\n }\n }\n }\n }\n }\n }\n if (manifest.dependsOn?.length) {\n const existing = new Set(result.api.dependsOn ?? []);\n for (const dep of manifest.dependsOn) {\n if (!existing.has(dep)) {\n result.api.dependsOn = [...(result.api.dependsOn ?? []), dep];\n }\n }\n }\n if (manifestPluginEntries.length > 0) {\n if (!result.plugins) result.plugins = {};\n for (const { key, config: pluginConfig } of manifestPluginEntries) {\n if (!result.plugins[key]) {\n result.plugins[key] = pluginConfig;\n }\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n warnOutsideEffect(`[Config] Failed to fetch API plugin manifest for discovery: ${message}`);\n }\n },\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n\n yield* Effect.tryPromise({\n try: () => deriveVersionManifestFields(result, config, env),\n catch: (cause) => new ConfigVersionManifestError({ message: String(cause), cause }),\n });\n\n return result;\n});\n\n/**\n * Version-manifest derivation (atomic-deploys 04): for every remote slot,\n * resolve its `pin` (fetch + SRI-verify the pinned manifest, process-cached\n * per pin) and stamp the derived entry-level fields — `entryUrl` (hashed\n * container entry), the browser-manifest `entry`, and entry-level\n * `integrity`/`ssrIntegrity`/`ssrEntryUrl` — so consumers load immutable\n * hashed bytes without knowing the pointer indirection.\n *\n * Hard break: outside development every remote slot MUST pin a version\n * manifest — an unpinned remote slot fails resolution loudly (the deploy\n * train pins every workspace it uploads; a manifest-less slot means a\n * pre-atomic-deploy config).\n */\nasync function deriveVersionManifestFields(\n result: RuntimeConfig,\n config: BosConfig,\n env: BosEnv,\n): Promise<void> {\n if (env === \"development\") return;\n\n const derive = async (\n label: string,\n slotConfig: { pin?: unknown } | undefined,\n slot: { url?: string; remoteUrl?: string; source?: string } | undefined,\n apply: (resolved: ResolvedSlotVersion) => void,\n ): Promise<void> => {\n if (!slot || slot.source !== \"remote\" || !slot.url) return;\n // A config without a production form (the image's baked boot fallback, or\n // a dev resolution materialized under NODE_ENV=production) has no\n // deployment artifacts to pin — the slot URL is the local listening\n // fallback. Pin enforcement is for published configs.\n const slotWithProduction = slotConfig as { production?: unknown } | undefined;\n if (!slotWithProduction || slotWithProduction.production === undefined) return;\n const rawPin = slotConfig?.pin as { manifest?: unknown; integrity?: unknown } | undefined;\n const pin =\n rawPin &&\n typeof rawPin.manifest === \"string\" &&\n rawPin.manifest &&\n typeof rawPin.integrity === \"string\" &&\n rawPin.integrity\n ? { manifest: rawPin.manifest, integrity: rawPin.integrity }\n : undefined;\n if (!pin) {\n throw new Error(\n `slot \"${label}\" (${slot.url}) pins no version manifest — remote slots must pin ` +\n `a version manifest outside development (pre-atomic-deploy config; redeploy required)`,\n );\n }\n // The pin resolves against the slot's REMOTE base — the host slot's `url`\n // is its own listening origin (the bytes it would serve don't exist\n // there); its `remoteUrl` carries the deployment bundle base.\n const resolved = await resolveSlotVersion({ base: slot.remoteUrl ?? slot.url, pin });\n apply(resolved);\n };\n\n const applyUi = (ui: RuntimePluginConfig[\"ui\"], r: ResolvedSlotVersion): void => {\n if (!ui) return;\n ui.entryUrl = r.entryUrl;\n ui.entry = r.browserManifestUrl ?? ui.entry;\n ui.browserManifestUrl = r.browserManifestUrl;\n ui.integrity = r.entryIntegrity;\n ui.ssrEntryUrl = r.ssrEntryUrl;\n ui.ssrIntegrity = r.ssrIntegrity ?? ui.ssrIntegrity;\n };\n\n await derive(\"app.host\", config.app.host, result.host, (r) => {\n result.host.entryUrl = r.entryUrl;\n result.host.integrity = r.entryIntegrity;\n });\n await derive(\"app.ui\", config.app.ui, result.ui, (r) => applyUi(result.ui, r));\n await derive(\"app.api\", config.app.api, result.api, (r) => {\n result.api.entryUrl = r.entryUrl;\n result.api.integrity = r.entryIntegrity;\n });\n if (result.auth) {\n await derive(\"app.auth\", config.app.auth, result.auth, (r) => {\n result.auth!.entryUrl = r.entryUrl;\n result.auth!.integrity = r.entryIntegrity;\n });\n await derive(\n \"app.auth.ui\",\n getEntryAssociatedUi(config.app.auth as Partial<BosPluginRef>),\n result.auth.ui,\n (r) => applyUi(result.auth!.ui, r),\n );\n }\n for (const [key, plugin] of Object.entries(result.plugins ?? {})) {\n let pluginConfig = config.plugins?.[key];\n // The auth mirror (config.ts adds plugins.auth when the authored config\n // has no plugins.auth entry) derives from the app.auth slot — it is the\n // only compose surface for the auth ui, and its pins live on app.auth.\n const isAuthMirror =\n key === \"auth\" && result.auth && (plugin === result.auth || plugin.url === result.auth.url);\n if ((!pluginConfig || typeof pluginConfig === \"string\") && isAuthMirror) {\n pluginConfig = config.app.auth;\n }\n if (!pluginConfig || typeof pluginConfig === \"string\") continue;\n await derive(`plugins.${key}`, pluginConfig, plugin, (r) => {\n plugin.entryUrl = r.entryUrl;\n plugin.integrity = r.entryIntegrity;\n });\n await derive(\n `plugins.${key}.ui`,\n getEntryAssociatedUi(pluginConfig as Partial<BosPluginRef>),\n plugin.ui,\n (r) => applyUi(plugin.ui, r),\n );\n }\n}\n\nexport async function buildRuntimeConfig(\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n options?: BuildRuntimeConfigOptions,\n): Promise<RuntimeConfig> {\n return Effect.runPromise(buildRuntimeConfigEffect(config, baseDir, env, options));\n}\n\nasync function readConfigInput(configPath: string, baseDir: string): Promise<BosConfigInput> {\n if (configPath.startsWith(\"bos://\")) {\n return fetchBosConfigFromFastKv<BosConfigInput>(configPath);\n }\n\n const resolvedPath = isAbsolute(configPath) ? configPath : resolve(baseDir, configPath);\n if (isAppDescriptorPath(resolvedPath)) {\n return loadAppDescriptorConfig(resolvedPath);\n }\n return JSON.parse(readFileSync(resolvedPath, \"utf-8\")) as BosConfigInput;\n}\n\ntype PluginOverrideValue = PluginEntryValue | null | false;\n\nfunction normalizePluginEntry(raw: PluginOverrideValue): BosPluginRef | null | false {\n if (raw === null || raw === false) return raw;\n if (typeof raw === \"string\") {\n return { extends: raw };\n }\n return raw;\n}\n\nconst resolveRuntimePluginsEffect = Effect.fn(\"resolveRuntimePlugins\")(function* (\n plugins: Record<string, PluginOverrideValue>,\n baseDir: string,\n env: BosEnv,\n remotePlugins?: string[],\n): Effect.fn.Return<Record<string, RuntimePluginConfig>, ConfigExtendsError> {\n const entries = Object.entries(plugins)\n .map(([pluginId, rawInput]) => ({\n pluginId,\n normalized: normalizePluginEntry(rawInput),\n }))\n .filter(\n (entry): entry is { pluginId: string; normalized: BosPluginRef } =>\n entry.normalized !== null && entry.normalized !== false,\n );\n\n const resolved = yield* Effect.forEach(\n entries,\n ({ pluginId, normalized }) =>\n Effect.gen(function* () {\n const resolvedReference = yield* Effect.tryPromise({\n try: () => resolveComposableReference(normalized, baseDir, env, `plugins.${pluginId}`),\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n\n const forceSource =\n remotePlugins === undefined\n ? undefined\n : remotePlugins.length === 0 || remotePlugins.includes(pluginId)\n ? (\"remote\" as const)\n : undefined;\n const pluginRuntime = buildRuntimePluginConfig(\n pluginId,\n env,\n resolvedReference,\n forceSource,\n );\n\n if (!pluginRuntime.localPath && !pluginRuntime.url) {\n if (forceSource === \"remote\") {\n emitConfigWarning(\n `[Config] Plugin \"${pluginId}\" has no production URL in bos.config.json and cannot be resolved as remote. Add a \"production\" field or remove it from --remote-plugins.`,\n );\n }\n return null;\n }\n\n if (\n pluginRuntime.source === \"remote\" &&\n pluginRuntime.url &&\n !pluginRuntime.localPath &&\n typeof resolvedReference.entry.name !== \"string\"\n ) {\n pluginRuntime.name = yield* Effect.tryPromise({\n try: () => resolveRemotePluginRuntimeName(pluginRuntime.url, pluginRuntime.name),\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n }\n\n return [pluginId, pluginRuntime] as const;\n }),\n { concurrency: \"unbounded\" },\n );\n\n const out: Record<string, RuntimePluginConfig> = {};\n for (const entry of resolved) {\n if (entry) {\n out[entry[0]] = entry[1];\n }\n }\n\n return out;\n});\n\nfunction resolveRuntimePlugins(\n plugins: Record<string, PluginOverrideValue>,\n baseDir: string,\n env: BosEnv,\n remotePlugins?: string[],\n): Promise<Record<string, RuntimePluginConfig>> {\n return Effect.runPromise(resolveRuntimePluginsEffect(plugins, baseDir, env, remotePlugins));\n}\n\nasync function resolveRemotePluginRuntimeName(baseUrl: string, fallback: string): Promise<string> {\n const manifest = await fetchJsonOrNull<{\n plugin?: { name?: unknown };\n }>(`${baseUrl.replace(/\\/$/, \"\")}/plugin.manifest.json`, { retries: 2 });\n\n return typeof manifest?.plugin?.name === \"string\" && manifest.plugin.name.length > 0\n ? manifest.plugin.name\n : fallback;\n}\n\nfunction buildRuntimePluginConfig(\n pluginId: string,\n env: BosEnv,\n resolved: ResolvedComposableReference,\n forceSource?: \"local\" | \"remote\",\n): RuntimePluginConfig {\n const source = resolved.entry;\n const development = typeof source.development === \"string\" ? source.development : undefined;\n const production = typeof source.production === \"string\" ? source.production : undefined;\n\n if (production?.startsWith(\"bos://\")) {\n throw new ConfigExtendsError({\n message: `Plugin \"${pluginId}\" has unsupported production target \"${production}\". Use extends: \"bos://account/domain\" for plugin configs or a CDN URL for production.`,\n });\n }\n\n const pluginExtendsRef = source.extends ? resolveExtendsRef(source.extends, env) : undefined;\n\n const runtimeTarget =\n env === \"development\"\n ? resolveDevelopmentTarget(\n development,\n production,\n resolved.providerBaseDir,\n forceSource,\n `plugins.${pluginId}`,\n pluginExtendsRef,\n )\n : resolveRuntimeTarget(production, resolved.providerBaseDir, \"remote\");\n const apiName = resolvePluginRuntimeName(source.name, runtimeTarget.localPath, pluginId);\n\n const ui = buildRuntimeUiConfig(\n pluginId,\n env,\n resolved.associatedUi,\n resolved.providerBaseDir,\n apiName,\n forceSource,\n );\n\n const routes = source.routes;\n\n return {\n name: apiName,\n url: runtimeTarget.url,\n entry: runtimeTarget.url\n ? `${runtimeTarget.url.replace(/\\/$/, \"\")}/mf-manifest.json`\n : \"/mf-manifest.json\",\n source: runtimeTarget.source,\n extendsRef: pluginExtendsRef,\n localPath: runtimeTarget.localPath,\n port: runtimeTarget.port,\n proxy: typeof source.proxy === \"string\" ? source.proxy : undefined,\n variables: normalizeJsonRecord(source.variables),\n secrets: normalizeStringArray(source.secrets),\n shared: source.shared,\n connectSrc: normalizeStringArray(source.connectSrc),\n integrity: runtimeTarget.source === \"remote\" ? source.integrity : undefined,\n ui,\n routes,\n dependsOn: source.dependsOn ? normalizeStringArray(source.dependsOn) : undefined,\n };\n}\n\n/**\n * Resolve a plugin entry's associated ui surface (`plugins.<id>.ui` / legacy\n * `plugins.<id>.app.ui`) into the runtime ui config. Extracted so app-slot\n * entries (app.auth) resolve their ui the same way.\n */\nfunction buildRuntimeUiConfig(\n pluginId: string,\n env: BosEnv,\n uiConfig: Record<string, unknown> | undefined,\n providerBaseDir: string,\n apiName: string,\n forceSource?: \"local\" | \"remote\",\n): RuntimePluginConfig[\"ui\"] {\n const uiDevelopment =\n typeof uiConfig?.development === \"string\" ? uiConfig.development : undefined;\n const uiProduction = typeof uiConfig?.production === \"string\" ? uiConfig.production : undefined;\n const uiRuntime =\n uiConfig && (uiDevelopment || uiProduction)\n ? env === \"development\"\n ? resolveDevelopmentTarget(\n uiDevelopment,\n uiProduction,\n providerBaseDir,\n forceSource,\n `plugins.${pluginId}.ui`,\n )\n : resolveRuntimeTarget(uiProduction, providerBaseDir, \"remote\")\n : undefined;\n if (!uiRuntime) return undefined;\n // A remote ui target with no URL is not a deployable surface (e.g. a\n // plugin ui entry with only a development key) — dropping it here keeps\n // the phantom source out of runtime resolution and client payloads.\n if (uiRuntime.source === \"remote\" && !uiRuntime.url) return undefined;\n\n return {\n name: resolveUiRuntimeName(uiConfig, uiRuntime.localPath, apiName),\n url: uiRuntime.url,\n entry: uiRuntime.url\n ? `${uiRuntime.url.replace(/\\/$/, \"\")}/mf-manifest.json`\n : \"/mf-manifest.json\",\n source: uiRuntime.source,\n publicUrl: typeof uiConfig?.publicUrl === \"string\" ? uiConfig.publicUrl : undefined,\n localPath: uiRuntime.localPath,\n port: uiRuntime.port,\n integrity:\n uiRuntime.source === \"remote\" && typeof uiConfig?.integrity === \"string\"\n ? uiConfig.integrity\n : undefined,\n ssrUrl:\n uiRuntime.source === \"remote\" && typeof uiConfig?.ssr === \"string\"\n ? uiConfig.ssr\n : uiRuntime.source === \"local\"\n ? uiRuntime.url\n : undefined,\n ssrIntegrity:\n uiRuntime.source === \"remote\" && typeof uiConfig?.ssrIntegrity === \"string\"\n ? uiConfig.ssrIntegrity\n : undefined,\n };\n}\n\n/**\n * MF container identity must match the build: folder-form plugin ui sources\n * build under the sanitized plugin workspace package name (the generated\n * rsbuild config imports the plugin's package.json), so derive the same\n * value here — an authored `ui.name` is only a fallback, and can never\n * override what the container actually registers under.\n */\nexport function resolveUiRuntimeName(\n uiConfig: Record<string, unknown> | undefined,\n localPath: string | undefined,\n apiName: string,\n): string {\n if (localPath) {\n const uiPkgPath = join(localPath, \"package.json\");\n const pkgPath = existsSync(uiPkgPath) ? uiPkgPath : join(dirname(localPath), \"package.json\");\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, \"utf-8\")) as { name?: unknown };\n if (typeof pkg.name === \"string\" && pkg.name.length > 0) {\n return sanitizeContainerName(pkg.name);\n }\n } catch (e) {\n console.warn(`[Config] Could not read package.json at ${pkgPath}: ${String(e)}`);\n }\n }\n return typeof uiConfig?.name === \"string\" ? uiConfig.name : `${apiName}-ui`;\n}\n\nexport function resolvePluginRuntimeName(\n explicitName: string | undefined,\n localPath: string | undefined,\n fallback: string,\n): string {\n if (explicitName) {\n return explicitName;\n }\n\n if (!localPath) {\n return fallback;\n }\n\n try {\n const packageJsonPath = join(localPath, \"package.json\");\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\")) as { name?: unknown };\n if (typeof packageJson.name === \"string\" && packageJson.name.length > 0) {\n return packageJson.name;\n }\n } catch (e) {\n console.warn(`[Config] Could not read package.json at ${localPath}: ${String(e)}`);\n }\n\n return fallback;\n}\n\nfunction normalizeJsonValue(value: unknown): JsonValue | undefined {\n if (\n value === null ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ) {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value\n .map((item) => normalizeJsonValue(item))\n .filter((item): item is JsonValue => item !== undefined);\n }\n\n if (isPlainObject(value)) {\n const out: JsonObject = {};\n for (const [key, raw] of Object.entries(value)) {\n const normalized = normalizeJsonValue(raw);\n if (normalized !== undefined) {\n out[key] = normalized;\n }\n }\n return out;\n }\n\n return undefined;\n}\n\nfunction normalizeJsonRecord(value: unknown): JsonObject | undefined {\n if (!isPlainObject(value)) return undefined;\n const out: JsonObject = {};\n for (const [key, raw] of Object.entries(value)) {\n const normalized = normalizeJsonValue(raw);\n if (normalized !== undefined) {\n out[key] = normalized;\n }\n }\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\nfunction normalizeStringArray(value: unknown): string[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out = value.filter((item): item is string => typeof item === \"string\" && item.length > 0);\n return out.length > 0 ? out : undefined;\n}\n\nfunction resolveRuntimeTarget(\n value: string | undefined,\n baseDir: string,\n defaultSource: \"local\" | \"remote\" = \"remote\",\n): RuntimeTarget {\n if (!value) {\n return { source: defaultSource, url: \"\" };\n }\n\n if (value.startsWith(LOCAL_PREFIX)) {\n const localTarget = value?.slice(LOCAL_PREFIX.length).trim();\n if (!localTarget) {\n throw new ConfigExtendsError({ message: `Invalid local development target: ${value}` });\n }\n\n const localPath = resolve(baseDir, localTarget);\n if (!existsSync(localPath)) {\n return { source: \"local\", url: \"\" };\n }\n\n return {\n source: \"local\",\n url: \"\",\n localPath,\n };\n }\n\n return {\n source: defaultSource,\n url: value.replace(/\\/$/, \"\"),\n port: parsePort(value),\n };\n}\n\nexport function isLocalDevelopmentTarget(\n value: string | undefined,\n): value is `${typeof LOCAL_PREFIX}${string}` {\n return typeof value === \"string\" && value.startsWith(LOCAL_PREFIX);\n}\n\nexport function resolveLocalDevelopmentPath(\n value: string | undefined,\n baseDir: string,\n): string | null {\n if (!isLocalDevelopmentTarget(value)) {\n return null;\n }\n\n const localTarget = value.slice(LOCAL_PREFIX.length).trim();\n return localTarget ? resolve(baseDir, localTarget) : null;\n}\n\nexport function resolveDevelopmentHostUrl(value: string | undefined): string {\n if (!value || isLocalDevelopmentTarget(value)) {\n return `http://localhost:${DEFAULT_HOST_PORT}`;\n }\n\n return value.replace(/\\/$/, \"\");\n}\n\nexport function getHostDevelopmentPort(value: string | undefined): number {\n return parsePort(resolveDevelopmentHostUrl(value));\n}\n\nexport function parsePort(url: string): number {\n try {\n const parsed = new URL(url);\n return parsed.port ? parseInt(parsed.port, 10) : parsed.protocol === \"https:\" ? 443 : 80;\n } catch {\n return 3000;\n }\n}\n\nexport type { BosEnv } from \"./merge\";\nexport {\n BOS_CONFIG_ORDER,\n mergeBosConfigWithExtends,\n rebuildOrderedConfig,\n resolveExtendsRef,\n} from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AA0B,OAAmC;CAC3E,IAAI,CAAC,SAAS,yBAAyB,KAAK,GAC1C,OAAO,oBAAoB;CAG7B,OAAO,MAAM,QAAQ,OAAO,EAAE;AAChC;AAEA,SAAgB,uBAAuB,OAAmC;CACxE,OAAO,UAAU,0BAA0B,KAAK,CAAC;AACnD;AAEA,SAAgB,UAAU,KAAqB;CAC7C,IAAI;EACF,MAAM,SAAS,IAAI,IAAI,GAAG;EAC1B,OAAO,OAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI,OAAO,aAAa,WAAW,MAAM;CACxF,QAAQ;EACN,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { Effect, Schema } from \"effect\";\nimport { getProcessEnv } from \"./env/process-env\";\n\nconst warnOutsideEffect = (...args: unknown[]): void => {\n console.warn(...args);\n};\n\nimport { sanitizeContainerName } from \"every-plugin/ui/manifest/contract\";\nimport { fetchApiPluginManifest } from \"./api-contract\";\nimport { manifestPluginsToNodes } from \"./dag\";\nimport { resolveApp, toConfigInput } from \"./descriptor/resolve\";\nimport { type AppDescriptor, AppDescriptorSchema } from \"./descriptor/schema\";\nimport { fetchBosConfigFromFastKv } from \"./fastkv\";\nimport { fetchJsonOrNull } from \"./http-client\";\nimport {\n type BosEnv,\n bosConfigMerger,\n isPlainObject,\n type ResolvedConfigMeta,\n rebuildOrderedConfig,\n resolveExtendsRef,\n} from \"./merge\";\nimport { getNetworkIdForAccount } from \"./network\";\nimport type {\n BosConfig,\n BosConfigInput,\n BosPluginRef,\n JsonObject,\n JsonValue,\n PluginEntryValue,\n RuntimeConfig,\n RuntimePluginConfig,\n} from \"./types\";\nimport { BosConfigSchema } from \"./types\";\nimport { type ResolvedSlotVersion, resolveSlotVersion } from \"./version-manifest-resolve\";\n\nconst LOCAL_PREFIX = \"local:\";\nconst DEFAULT_HOST_PORT = 3000;\nconst RESOLVED_CONFIG_FILENAME = \"bos.resolved-config.json\";\n\nexport const MISSING_CONFIG_MESSAGE = \"No config found (bos.app.ts or bos.config.json)\";\n\nexport const DEV_OVERLAY_FILENAME = \"bos.dev.ts\";\n\ntype RuntimeOverrideTarget = \"ui\" | \"api\" | \"plugins\" | `plugins.${string}`;\n\ninterface RuntimeTarget {\n source: \"local\" | \"remote\";\n url: string;\n localPath?: string;\n port?: number;\n}\n\ninterface ConfigWarningCapture {\n sink: string[];\n previous: ConfigWarningCapture | undefined;\n}\n\nconst warningCapture = new AsyncLocalStorage<ConfigWarningCapture | undefined>();\n\n/**\n * @internal — runs `fn` with config warnings captured into `sink` instead of\n * the console. Plumbing for the resolution session; not part of the public\n * config surface.\n */\nexport function runWithConfigWarningSink<T>(sink: string[], fn: () => T): T {\n return warningCapture.run({ sink, previous: warningCapture.getStore() }, fn);\n}\n\nfunction emitConfigWarning(message: string): void {\n const capture = warningCapture.getStore();\n if (capture) {\n capture.sink.push(message);\n } else {\n console.warn(message);\n }\n}\n\nconst configPathCache = new Map<string, string | null>();\n\n/**\n * @internal — clears the findConfigPath memo. Plumbing for tests and the\n * resolution session; not part of the public config surface.\n */\nexport function resetConfigPathCache(): void {\n configPathCache.clear();\n}\n\n/**\n * Reads the local authored config without resolving the extends chain or\n * touching the network — the build-surface factories (generated rsbuild\n * configs) consume it for their APP_NAME/APP_ACCOUNT defines.\n */\nexport async function readAuthoredConfigInput(cwd?: string): Promise<BosConfigInput | null> {\n const configPath = findConfigPath(cwd);\n if (!configPath || configPath.startsWith(\"bos://\")) return null;\n return readConfigInput(configPath, dirname(configPath));\n}\n\n/**\n * The authored config entry inside exactly `dir` — no upward walk. Unlike\n * `findConfigPath` this never escapes the given directory, for write targets\n * and nested-local-path resolution where a parent's config must not be\n * picked up. Prefers the authored `bos.app.ts` descriptor (the canonical\n * form) over a legacy `bos.config.json`.\n */\nexport function localConfigEntryPath(dir: string): string | null {\n const appPath = join(dir, \"bos.app.ts\");\n if (existsSync(appPath)) return appPath;\n const jsonPath = join(dir, \"bos.config.json\");\n return existsSync(jsonPath) ? jsonPath : null;\n}\n\n/** `localConfigEntryPath` + the form-aware read (`BosConfigInput`). */\nexport async function readLocalAuthoredConfigInput(dir: string): Promise<BosConfigInput | null> {\n const entry = localConfigEntryPath(dir);\n if (!entry) return null;\n return readConfigInput(entry, dirname(entry));\n}\n\n/**\n * The authored `bos.app.ts` descriptor is the canonical form — when both\n * forms coexist (e.g. a generated `bos.config.json` write-back beside the\n * authored descriptor), the authored file wins. JSON-form-only children are\n * unaffected: with no `bos.app.ts`, the JSON file is the entry.\n */\nexport function findConfigPath(cwd?: string): string | null {\n const cacheKey = resolve(cwd ?? process.cwd());\n const cached = configPathCache.get(cacheKey);\n if (cached !== undefined) return cached;\n\n let dir = cacheKey;\n while (true) {\n const appPath = join(dir, \"bos.app.ts\");\n if (existsSync(appPath)) {\n configPathCache.set(cacheKey, appPath);\n return appPath;\n }\n const jsonPath = join(dir, \"bos.config.json\");\n if (existsSync(jsonPath)) {\n configPathCache.set(cacheKey, jsonPath);\n return jsonPath;\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n configPathCache.set(cacheKey, null);\n return null;\n}\n\nexport function isAppDescriptorPath(configPath: string): boolean {\n return configPath.endsWith(\".app.ts\") || configPath.endsWith(\".app.js\");\n}\n\n/**\n * Materialize an authored bos.app.ts descriptor into the authoring-shape\n * `BosConfigInput` the config pipeline consumes. Import-extends is honored\n * two ways: the parent descriptor value can be imported directly (an\n * inlined parent, resolved through `resolveApp`), or `extends` can name a\n * published config (`bos://…`) / a local file, which flows into the JSON\n * extends chain unchanged.\n */\nexport async function loadAppDescriptorConfig(resolvedPath: string): Promise<BosConfigInput> {\n // webpackIgnore: the path is inherently runtime-resolved — bundlers must\n // not try to statically analyze it (rsbuild otherwise warns \"Critical\n // dependency: the request of a dependency is an expression\").\n const mod = (await import(/* webpackIgnore: true */ pathToFileURL(resolvedPath).href)) as Record<\n string,\n unknown\n >;\n return parseAppDescriptorModule(mod, resolvedPath);\n}\n\n/**\n * @internal — parses an already-imported app descriptor module into the\n * authoring-shape `BosConfigInput`. Plumbing for the resolution session's\n * injectable module loader; not part of the public config surface.\n */\nexport function parseAppDescriptorModule(\n mod: Record<string, unknown>,\n sourcePath?: string,\n): BosConfigInput {\n if (!mod.default) {\n throw new Error(\n `${sourcePath ?? \"App descriptor module\"} must default-export an App() descriptor`,\n );\n }\n const descriptor = AppDescriptorSchema.parse(mod.default);\n\n // Registry candidates: named exports that parse as App descriptors.\n const registry: Record<string, unknown> = {};\n for (const value of Object.values(mod)) {\n const parsed = AppDescriptorSchema.safeParse(value);\n if (parsed.success) registry[parsed.data.name] = parsed.data;\n }\n\n const extendsRef = descriptor.extends;\n const inRegistry = typeof extendsRef === \"string\" && registry[extendsRef] !== undefined;\n const importedParent = extendsRef !== undefined && typeof extendsRef !== \"string\";\n\n if (inRegistry || importedParent) {\n return resolveApp(descriptor.name, registry as never);\n }\n\n const input = toConfigInput(descriptor);\n if (extendsRef !== undefined) {\n input.extends = extendsRef as BosConfigInput[\"extends\"];\n }\n return input;\n}\n\n/**\n * @internal — validates an already-imported `bos.dev.ts` module as a\n * `Partial<AppDescriptor>` dev overlay. Plumbing for the resolution session's\n * injectable module loader; not part of the public config surface.\n */\nexport function parseDevOverlayModule(\n mod: Record<string, unknown>,\n sourcePath?: string,\n): Partial<AppDescriptor> {\n const source = sourcePath ?? DEV_OVERLAY_FILENAME;\n if (!mod?.default) {\n throw new DevOverlayError({\n path: source,\n message: `${source} must default-export a dev overlay (Partial<AppDescriptor>)`,\n });\n }\n const parsed = AppDescriptorSchema.partial().safeParse(mod.default);\n if (!parsed.success) {\n throw new DevOverlayError({\n path: source,\n message: `${source} is not a valid dev overlay: ${parsed.error.message}`,\n cause: parsed.error,\n });\n }\n return parsed.data;\n}\n\nexport interface ResolvedComposableReference {\n entry: BosPluginRef;\n providerBaseDir: string;\n targetPath: string;\n associatedUi?: Record<string, unknown>;\n}\n\ninterface ParsedExtendsTarget {\n configPath: string;\n targetPath?: string;\n}\n\nexport class ConfigLoadError extends Schema.TaggedError<ConfigLoadError>()(\"ConfigLoadError\", {\n path: Schema.String,\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n}) {}\n\nexport class CircularExtendsError extends Schema.TaggedError<CircularExtendsError>()(\n \"CircularExtendsError\",\n { chain: Schema.Array(Schema.String), message: Schema.String },\n) {}\n\nexport class ConfigNotfoundError extends Schema.TaggedError<ConfigNotfoundError>()(\n \"ConfigNotfoundError\",\n { message: Schema.String },\n) {}\n\nexport class ConfigExtendsError extends Schema.TaggedError<ConfigExtendsError>()(\n \"ConfigExtendsError\",\n {\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n },\n) {}\n\nexport class ConfigVersionManifestError extends Schema.TaggedError<ConfigVersionManifestError>()(\n \"ConfigVersionManifestError\",\n {\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n },\n) {}\n\nexport class DevOverlayError extends Schema.TaggedError<DevOverlayError>()(\"DevOverlayError\", {\n path: Schema.String,\n message: Schema.String,\n cause: Schema.optional(Schema.Unknown),\n}) {}\n\nexport function defaultConfigEnv(): BosEnv {\n return process.env.NODE_ENV === \"production\" ? \"production\" : \"development\";\n}\n\nexport function parseRuntimeOverrideTargets(value?: string | null): RuntimeOverrideTarget[] {\n if (!value) {\n return [];\n }\n\n return [\n ...new Set(\n value\n .split(\",\")\n .map((entry) => entry.trim())\n .filter(Boolean),\n ),\n ].map((entry) => {\n if (entry === \"ui\" || entry === \"api\" || entry === \"plugins\") {\n return entry;\n }\n\n if (entry.startsWith(\"plugins.\") && entry.length > \"plugins.\".length) {\n return entry as RuntimeOverrideTarget;\n }\n\n throw new ConfigExtendsError({ message: `Invalid runtime override target: ${entry}` });\n });\n}\n\nexport function isRuntimeOverrideAllowed(\n allowedTargets: ReadonlyArray<RuntimeOverrideTarget>,\n target: \"ui\" | \"api\" | \"plugins\" | `plugins.${string}`,\n): boolean {\n if (allowedTargets.includes(target as RuntimeOverrideTarget)) {\n return true;\n }\n\n if (target.startsWith(\"plugins.\")) {\n return allowedTargets.includes(\"plugins.*\");\n }\n\n return false;\n}\n\nexport async function buildRuntimePluginsForConfig(\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n remotePlugins?: string[],\n): Promise<Record<string, RuntimePluginConfig> | undefined> {\n const plugins = await resolveRuntimePlugins(config.plugins ?? {}, baseDir, env, remotePlugins);\n return Object.keys(plugins).length > 0 ? plugins : undefined;\n}\n\nfunction getEntryAssociatedUi(entry: Partial<BosPluginRef>): Record<string, unknown> | undefined {\n const flat = isPlainObject(entry.ui) ? (entry.ui as Record<string, unknown>) : undefined;\n const nested = (() => {\n if (!isPlainObject(entry.app)) return undefined;\n const app = entry.app as Record<string, unknown>;\n return isPlainObject(app.ui) ? (app.ui as Record<string, unknown>) : undefined;\n })();\n const ui = flat ?? nested;\n if (!ui) return undefined;\n\n if (\"shared\" in ui) {\n throw new ConfigExtendsError({\n message:\n \"app.ui.shared is no longer supported. Move shared deps to app.api.shared, app.auth.shared, or plugins.*.shared.\",\n });\n }\n\n return ui;\n}\n\nfunction mergeAssociatedUi(\n parentUi: Record<string, unknown> | undefined,\n childUi: Record<string, unknown> | undefined,\n): Record<string, unknown> | undefined {\n if (!parentUi) {\n return childUi ? { ...childUi } : undefined;\n }\n\n if (!childUi) {\n return { ...parentUi };\n }\n\n return bosConfigMerger({ ...childUi }, parentUi) as Record<string, unknown>;\n}\n\nfunction withAssociatedUi(\n entry: BosPluginRef,\n associatedUi?: Record<string, unknown>,\n): BosPluginRef {\n if (!associatedUi) {\n return entry;\n }\n\n const app = isPlainObject(entry.app)\n ? ({ ...(entry.app as Record<string, unknown>) } as Record<string, unknown>)\n : {};\n app.ui = mergeAssociatedUi(getEntryAssociatedUi(entry), associatedUi);\n\n return {\n ...entry,\n app,\n };\n}\n\nexport async function resolveConfigComposableEntries(\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n): Promise<BosConfig> {\n const [resolvedApi, resolvedAuth] = await Promise.all([\n resolveComposableReference(config.app.api as BosPluginRef, baseDir, env, \"app.api\"),\n config.app.auth\n ? resolveComposableReference(config.app.auth as BosPluginRef, baseDir, env, \"app.auth\")\n : Promise.resolve(undefined),\n ]);\n\n const resolvedPlugins = config.plugins\n ? Object.fromEntries(\n await Promise.all(\n Object.entries(config.plugins).map(async ([pluginId, pluginValue]) => {\n const resolvedPlugin = await resolveComposableReference(\n asComposableEntry(pluginValue),\n baseDir,\n env,\n `plugins.${pluginId}`,\n );\n\n return [\n pluginId,\n withAssociatedUi(resolvedPlugin.entry, resolvedPlugin.associatedUi),\n ] as const;\n }),\n ),\n )\n : undefined;\n\n return {\n ...config,\n app: {\n ...config.app,\n api: resolvedApi.entry,\n auth: resolvedAuth?.entry,\n },\n plugins: resolvedPlugins,\n };\n}\n\nexport function getResolvedConfigPath(configDir: string): string {\n return join(configDir, \".bos\", RESOLVED_CONFIG_FILENAME);\n}\n\nexport function loadGeneratedResolvedConfig(configDir: string): BosConfig | null {\n const resolvedPath = getResolvedConfigPath(configDir);\n if (!existsSync(resolvedPath)) return null;\n try {\n const raw = JSON.parse(readFileSync(resolvedPath, \"utf-8\"));\n if (!isPlainObject(raw)) return null;\n const { _resolved, ...configData } = raw;\n return BosConfigSchema.parse(configData);\n } catch {\n return null;\n }\n}\n\nexport function writeResolvedConfig(\n configDir: string,\n config: BosConfig,\n env: BosEnv,\n extendsChain?: string[],\n source?: string,\n): void {\n const resolvedPath = getResolvedConfigPath(configDir);\n const resolvedDir = dirname(resolvedPath);\n if (!existsSync(resolvedDir)) {\n mkdirSync(resolvedDir, { recursive: true });\n }\n\n const ordered = rebuildOrderedConfig(config);\n const meta: ResolvedConfigMeta = {\n env,\n resolvedAt: new Date().toISOString(),\n extendsChain: extendsChain ?? [],\n ...(source ? { source } : {}),\n };\n const output = {\n _resolved: meta,\n ...ordered,\n };\n\n const content = `${JSON.stringify(output, null, 2)}\\n`;\n try {\n if (readFileSync(resolvedPath, \"utf-8\") === content) return;\n } catch {\n // file doesn't exist yet\n }\n writeFileSync(resolvedPath, content);\n}\n\nexport function resolveBosConfigPath(configDir: string): string {\n const resolvedPath = getResolvedConfigPath(configDir);\n if (existsSync(resolvedPath)) return resolvedPath;\n return join(configDir, \"bos.config.json\");\n}\n\nexport async function readBosConfigForBuild(configDir: string): Promise<Record<string, unknown>> {\n const resolvedPath = getResolvedConfigPath(configDir);\n if (existsSync(resolvedPath)) {\n try {\n const raw = JSON.parse(readFileSync(resolvedPath, \"utf-8\"));\n if (isPlainObject(raw)) {\n const { _resolved, ...configData } = raw;\n return configData as Record<string, unknown>;\n }\n } catch (e) {\n console.warn(\n `[Config] Failed to parse _resolved.json, falling back to the authored config: ${String(e)}`,\n );\n }\n }\n // Form-aware fallback: the authored `bos.app.ts` descriptor is canonical —\n // a TS-form child has no committed bos.config.json to parse.\n const authored = await readLocalAuthoredConfigInput(configDir);\n if (authored) return authored as unknown as Record<string, unknown>;\n const bosConfigPath = join(configDir, \"bos.config.json\");\n return JSON.parse(readFileSync(bosConfigPath, \"utf-8\")) as Record<string, unknown>;\n}\n\n/**\n * @internal — splits an extends ref into its config path and optional\n * `#target` suffix. Plumbing for the resolution session; not part of the\n * public config surface.\n */\nexport function parseExtendsTarget(ref: string): ParsedExtendsTarget {\n const hashIndex = ref.indexOf(\"#\");\n if (hashIndex === -1) {\n return { configPath: ref };\n }\n\n const configPath = ref.slice(0, hashIndex);\n const targetPath = ref.slice(hashIndex + 1);\n return {\n configPath,\n targetPath: targetPath.length > 0 ? targetPath : undefined,\n };\n}\n\n/**\n * @internal — resolves the base directory a config path extends from.\n * Plumbing for the resolution session; not part of the public config surface.\n */\nexport function getConfigBaseDir(configPath: string, baseDir: string): string {\n if (configPath.startsWith(\"bos://\")) return baseDir;\n return dirname(isAbsolute(configPath) ? configPath : resolve(baseDir, configPath));\n}\n\nfunction asComposableEntry(value: unknown): BosPluginRef {\n if (value === undefined) {\n return {};\n }\n if (typeof value === \"string\") {\n return { extends: value };\n }\n if (!isPlainObject(value)) {\n throw new ConfigExtendsError({\n message: `Expected config entry object, received ${typeof value}`,\n });\n }\n return value as BosPluginRef;\n}\n\nfunction getTargetedEntry(config: BosConfigInput, targetPath: string): BosPluginRef {\n if (targetPath.startsWith(\"app.\")) {\n const entryKey = targetPath.slice(\"app.\".length);\n return asComposableEntry(config.app?.[entryKey]);\n }\n\n if (targetPath.startsWith(\"plugins.\")) {\n const pluginId = targetPath.slice(\"plugins.\".length);\n if (pluginId.length === 0) {\n throw new ConfigExtendsError({ message: `Invalid plugin target path: ${targetPath}` });\n }\n return asComposableEntry(config.plugins?.[pluginId]);\n }\n\n throw new ConfigExtendsError({ message: `Unsupported extends target path: ${targetPath}` });\n}\n\nfunction getAssociatedUi(\n config: BosConfigInput,\n _targetPath: string,\n): Record<string, unknown> | undefined {\n if (!isPlainObject(config.app?.ui)) {\n return undefined;\n }\n\n const ui = config.app.ui as Record<string, unknown>;\n if (\"shared\" in ui) {\n throw new ConfigExtendsError({\n message:\n \"app.ui.shared is no longer supported. Move shared deps to app.api.shared, app.auth.shared, or plugins.*.shared.\",\n });\n }\n\n return ui;\n}\n\nfunction applyNullOverrides(\n target: Record<string, unknown>,\n source: Record<string, unknown>,\n): void {\n for (const [key, value] of Object.entries(source)) {\n if (value === null) {\n target[key] = null;\n } else if (isPlainObject(value) && isPlainObject(target[key])) {\n applyNullOverrides(target[key] as Record<string, unknown>, value as Record<string, unknown>);\n }\n }\n}\n\nfunction mergeComposableEntries(\n parent: Partial<BosPluginRef>,\n child: Partial<BosPluginRef>,\n): BosPluginRef {\n const merged = bosConfigMerger({ ...child }, parent) as Record<string, unknown>;\n applyNullOverrides(merged, child as Record<string, unknown>);\n return merged as BosPluginRef;\n}\n\nfunction stripUnsafeLocalDevelopment<T extends Record<string, unknown> | undefined>(\n entry: T,\n allowLocalPaths: boolean,\n): T {\n if (!entry || allowLocalPaths) {\n return entry;\n }\n\n if (typeof entry.development === \"string\" && entry.development.startsWith(LOCAL_PREFIX)) {\n const { development: _ignored, ...rest } = entry;\n return rest as T;\n }\n\n return entry;\n}\n\nexport async function resolveComposableReference(\n source: BosPluginRef,\n baseDir: string,\n env: BosEnv,\n defaultTargetPath: string,\n): Promise<ResolvedComposableReference> {\n let resolvedEntry: BosPluginRef = {};\n let providerBaseDir = baseDir;\n let targetPath = defaultTargetPath;\n let associatedUi = getEntryAssociatedUi(source);\n let allowLocalPaths = false;\n let extendsError: unknown;\n\n const extendsRef = source.extends ? resolveExtendsRef(source.extends, env) : undefined;\n if (extendsRef) {\n const { resolveMergedConfigInput } = await import(\"./resolution/session\");\n const parsed = parseExtendsTarget(extendsRef);\n targetPath = parsed.targetPath ?? defaultTargetPath;\n const extendsBaseDir = getConfigBaseDir(parsed.configPath, baseDir);\n try {\n const extendedConfig = await resolveMergedConfigInput(parsed.configPath, {\n baseDir: extendsBaseDir,\n env,\n });\n resolvedEntry = mergeComposableEntries(\n resolvedEntry,\n getTargetedEntry(extendedConfig, targetPath),\n );\n providerBaseDir = extendsBaseDir;\n associatedUi = mergeAssociatedUi(associatedUi, getAssociatedUi(extendedConfig, targetPath));\n } catch (error) {\n extendsError = error;\n }\n }\n\n const localDevelopment =\n typeof source.development === \"string\" && source.development.startsWith(LOCAL_PREFIX)\n ? source.development\n : undefined;\n const localDevelopmentPath = localDevelopment\n ? resolve(baseDir, localDevelopment.slice(LOCAL_PREFIX.length).trim())\n : undefined;\n const hasUsableLocalDevelopment = Boolean(\n localDevelopmentPath && existsSync(localDevelopmentPath),\n );\n\n if (localDevelopmentPath) {\n const { resolveMergedConfigInput } = await import(\"./resolution/session\");\n const localPath = localDevelopmentPath;\n const localConfigPath = localConfigEntryPath(localPath);\n if (localConfigPath) {\n const localConfig = await resolveMergedConfigInput(localConfigPath, {\n baseDir: localPath,\n env,\n });\n resolvedEntry = mergeComposableEntries(\n resolvedEntry,\n getTargetedEntry(localConfig, targetPath),\n );\n providerBaseDir = localPath;\n associatedUi = mergeAssociatedUi(associatedUi, getAssociatedUi(localConfig, targetPath));\n allowLocalPaths = true;\n }\n }\n\n const sourceOverrides = { ...source };\n if (allowLocalPaths && localDevelopment) {\n delete sourceOverrides.development;\n }\n\n resolvedEntry = mergeComposableEntries(resolvedEntry, sourceOverrides);\n associatedUi = mergeAssociatedUi(associatedUi, getEntryAssociatedUi(sourceOverrides));\n\n if (extendsError && !allowLocalPaths && !hasUsableLocalDevelopment) {\n throw extendsError;\n }\n\n return {\n entry: stripUnsafeLocalDevelopment(resolvedEntry, allowLocalPaths || Boolean(localDevelopment)),\n providerBaseDir,\n targetPath,\n // A plugin's own ui lives under its local development tree — the same\n // safety argument as the entry itself: keep its local target when the\n // plugin resolves locally, or the folder-form ui surface silently\n // disappears (no BOS_UI_PORT, an unassigned ui dev server, and a\n // port collision with another plugin's ui slot).\n associatedUi: stripUnsafeLocalDevelopment(\n associatedUi,\n allowLocalPaths || Boolean(localDevelopment),\n ),\n };\n}\n\nfunction resolveDevelopmentTarget(\n development: string | undefined,\n production: string | undefined,\n baseDir: string,\n forceSource?: \"local\" | \"remote\",\n target?: string,\n extendsRef?: string,\n): RuntimeTarget {\n if (forceSource === \"remote\") {\n return resolveRuntimeTarget(production, baseDir, \"remote\");\n }\n if (!development) {\n if (production && target) {\n if (extendsRef) {\n emitConfigWarning(`[Config] Resolving \"${target}\" from ${extendsRef}`);\n } else {\n emitConfigWarning(`[Config] No development target for \"${target}\", using production`);\n }\n }\n return resolveRuntimeTarget(production, baseDir, \"remote\");\n }\n const devTarget = resolveRuntimeTarget(development, baseDir);\n if (devTarget.source === \"local\" && (!devTarget.localPath || !existsSync(devTarget.localPath))) {\n if (production && target) {\n emitConfigWarning(`[Config] Could not load local target for \"${target}\", using production`);\n }\n return resolveRuntimeTarget(production, baseDir, \"remote\");\n }\n return devTarget;\n}\n\nexport interface BuildRuntimeConfigOptions {\n plugins?: Record<string, RuntimePluginConfig>;\n hostSource?: \"local\" | \"remote\";\n uiSource?: \"local\" | \"remote\";\n apiSource?: \"local\" | \"remote\";\n authSource?: \"local\" | \"remote\";\n proxy?: string;\n}\n\nexport const buildRuntimeConfigEffect = Effect.fn(\"buildRuntimeConfig\")(function* (\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n options?: BuildRuntimeConfigOptions,\n): Effect.fn.Return<RuntimeConfig, ConfigExtendsError | ConfigVersionManifestError> {\n const uiConfig = config.app.ui;\n const apiConfig = config.app.api;\n const authConfig = config.app.auth;\n const uiRuntime =\n env === \"development\"\n ? resolveDevelopmentTarget(\n uiConfig.development,\n uiConfig.production,\n baseDir,\n options?.uiSource,\n \"app.ui\",\n )\n : resolveRuntimeTarget(uiConfig.production, baseDir, \"remote\");\n const apiRuntime =\n env === \"development\"\n ? resolveDevelopmentTarget(\n apiConfig.development,\n apiConfig.production,\n baseDir,\n options?.apiSource,\n \"app.api\",\n )\n : resolveRuntimeTarget(apiConfig.production, baseDir, \"remote\");\n const authExtendsRef = authConfig?.extends\n ? resolveExtendsRef(authConfig.extends, env)\n : undefined;\n const authRuntime = authConfig\n ? env === \"development\"\n ? resolveDevelopmentTarget(\n authConfig.development,\n authConfig.production,\n baseDir,\n options?.authSource,\n \"app.auth\",\n authExtendsRef,\n )\n : resolveRuntimeTarget(authConfig.production, baseDir, \"remote\")\n : undefined;\n\n const hostConfig = config.app.host;\n const hostRuntime =\n env === \"development\"\n ? resolveDevelopmentTarget(\n hostConfig.development,\n hostConfig.production,\n baseDir,\n options?.hostSource,\n \"app.host\",\n )\n : resolveRuntimeTarget(hostConfig.production, baseDir, \"remote\");\n\n const hostListeningUrl =\n env === \"development\"\n ? resolveDevelopmentHostUrl(hostConfig.development)\n : `http://localhost:${getProcessEnv(\"PORT\") ?? DEFAULT_HOST_PORT}`;\n\n const hostIsRemote = hostRuntime.source === \"remote\";\n const uiIsRemote = uiRuntime.source === \"remote\";\n const apiIsRemote = apiRuntime.source === \"remote\";\n const resolvedApiName = resolvePluginRuntimeName(apiConfig.name, apiRuntime.localPath, \"api\");\n\n const authEntry = yield* Effect.tryPromise({\n try: async () => {\n if (!authConfig || !authRuntime) return undefined;\n if (!authRuntime.localPath && !authRuntime.url) return undefined;\n let authName = resolvePluginRuntimeName(authConfig.name, authRuntime.localPath, \"auth\");\n if (\n authRuntime.source === \"remote\" &&\n authRuntime.url &&\n !authRuntime.localPath &&\n typeof authConfig.name !== \"string\"\n ) {\n authName = await resolveRemotePluginRuntimeName(authRuntime.url, authName);\n }\n return {\n name: authName,\n extendsRef: authExtendsRef,\n url: authRuntime.url,\n entry: authRuntime.url ? `${authRuntime.url}/mf-manifest.json` : \"/mf-manifest.json\",\n localPath: authRuntime.localPath,\n port: authRuntime.port,\n source: authRuntime.source,\n proxy: authConfig.proxy,\n variables: authConfig.variables,\n secrets: authConfig.secrets,\n integrity: authRuntime.source === \"remote\" ? authConfig.integrity : undefined,\n shared: authConfig.shared,\n ui: buildRuntimeUiConfig(\n \"auth\",\n env,\n getEntryAssociatedUi(authConfig as Partial<BosPluginRef>),\n baseDir,\n authName,\n options?.authSource,\n ),\n };\n },\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n\n const explicitPlugins =\n options?.plugins && Object.keys(options.plugins).length > 0 ? options.plugins : undefined;\n const runtimePlugins: Record<string, RuntimePluginConfig> = { ...explicitPlugins };\n if (authEntry && !runtimePlugins.auth) {\n runtimePlugins.auth = authEntry;\n }\n\n const result: RuntimeConfig = {\n env,\n account: config.account,\n domain: config.domain,\n title: config.title,\n description: config.description,\n networkId: getNetworkIdForAccount(config.account),\n repository: config.repository,\n host: {\n name: \"host\",\n url: hostListeningUrl,\n entry: `${hostListeningUrl}/mf-manifest.json`,\n localPath: hostRuntime.localPath,\n port:\n env === \"development\"\n ? parsePort(hostListeningUrl)\n : Number(getProcessEnv(\"PORT\")) || DEFAULT_HOST_PORT,\n secrets: hostConfig.secrets,\n integrity: hostIsRemote ? hostConfig.integrity : undefined,\n source: hostRuntime.source,\n remoteUrl: hostIsRemote ? hostRuntime.url : undefined,\n },\n ui: {\n name: resolvePluginRuntimeName(uiConfig.name, uiRuntime.localPath, \"ui\"),\n url: uiRuntime.url,\n entry: uiRuntime.url ? `${uiRuntime.url}/mf-manifest.json` : \"/mf-manifest.json\",\n publicUrl: typeof uiConfig.publicUrl === \"string\" ? uiConfig.publicUrl : undefined,\n localPath: uiRuntime.localPath,\n port: uiRuntime.port,\n ssrUrl: uiIsRemote ? uiConfig.ssr : undefined,\n ssrIntegrity: uiIsRemote ? uiConfig.ssrIntegrity : undefined,\n integrity: uiIsRemote ? uiConfig.integrity : undefined,\n source: uiRuntime.source,\n },\n api: {\n name: resolvedApiName,\n url: apiRuntime.url,\n entry: apiRuntime.url ? `${apiRuntime.url}/mf-manifest.json` : \"/mf-manifest.json\",\n localPath: apiRuntime.localPath,\n port: apiRuntime.port,\n source: apiRuntime.source,\n proxy: options?.proxy ?? apiConfig.proxy,\n variables: apiConfig.variables,\n secrets: apiConfig.secrets,\n integrity: apiIsRemote ? apiConfig.integrity : undefined,\n shared: apiConfig.shared,\n dependsOn: apiConfig.dependsOn ? normalizeStringArray(apiConfig.dependsOn) : undefined,\n },\n auth: authEntry,\n plugins: Object.keys(runtimePlugins).length > 0 ? runtimePlugins : undefined,\n };\n\n yield* Effect.tryPromise({\n try: async () => {\n // catch-all diagnostics: a failed discovery fetch degrades to a\n // warning, never fails the runtime config build\n try {\n if (result.api.source !== \"remote\" || !result.api.url) return;\n const manifest = await fetchApiPluginManifest(result.api.url);\n const manifestPluginEntries: Array<{ key: string; config: RuntimePluginConfig }> = [];\n if (manifest.plugins?.length) {\n for (const node of manifestPluginsToNodes(manifest.plugins)) {\n if (!result.plugins?.[node.key]) {\n manifestPluginEntries.push({\n key: node.key,\n config: {\n name: node.name,\n url: node.url,\n entry: node.entry,\n source: \"remote\",\n dependsOn: node.dependsOn,\n secrets: node.secrets,\n variables: node.variables,\n },\n });\n if (node.secrets) {\n for (const secretName of node.secrets) {\n if (!getProcessEnv(secretName)) {\n warnOutsideEffect(\n `[Config] Plugin \"${node.key}\" (discovered from manifest) expects secret \"${secretName}\" but it is not set in the environment.`,\n );\n }\n }\n }\n }\n }\n }\n if (manifest.dependsOn?.length) {\n const existing = new Set(result.api.dependsOn ?? []);\n for (const dep of manifest.dependsOn) {\n if (!existing.has(dep)) {\n result.api.dependsOn = [...(result.api.dependsOn ?? []), dep];\n }\n }\n }\n if (manifestPluginEntries.length > 0) {\n if (!result.plugins) result.plugins = {};\n for (const { key, config: pluginConfig } of manifestPluginEntries) {\n if (!result.plugins[key]) {\n result.plugins[key] = pluginConfig;\n }\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n warnOutsideEffect(`[Config] Failed to fetch API plugin manifest for discovery: ${message}`);\n }\n },\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n\n yield* Effect.tryPromise({\n try: () => deriveVersionManifestFields(result, config, env),\n catch: (cause) => new ConfigVersionManifestError({ message: String(cause), cause }),\n });\n\n return result;\n});\n\n/**\n * Version-manifest derivation (atomic-deploys 04): for every remote slot,\n * resolve its `pin` (fetch + SRI-verify the pinned manifest, process-cached\n * per pin) and stamp the derived entry-level fields — `entryUrl` (hashed\n * container entry), the browser-manifest `entry`, and entry-level\n * `integrity`/`ssrIntegrity`/`ssrEntryUrl` — so consumers load immutable\n * hashed bytes without knowing the pointer indirection.\n *\n * Hard break: outside development every remote slot MUST pin a version\n * manifest — an unpinned remote slot fails resolution loudly (the deploy\n * train pins every workspace it uploads; a manifest-less slot means a\n * pre-atomic-deploy config).\n */\nasync function deriveVersionManifestFields(\n result: RuntimeConfig,\n config: BosConfig,\n env: BosEnv,\n): Promise<void> {\n if (env === \"development\") return;\n\n const derive = async (\n label: string,\n slotConfig: { pin?: unknown } | undefined,\n slot: { url?: string; remoteUrl?: string; source?: string } | undefined,\n apply: (resolved: ResolvedSlotVersion) => void,\n ): Promise<void> => {\n if (!slot || slot.source !== \"remote\" || !slot.url) return;\n // A config without a production form (a dev resolution materialized\n // under NODE_ENV=production) has no deployment artifacts to pin — the\n // slot URL is the local listening fallback. Pin enforcement is for\n // published configs.\n const slotWithProduction = slotConfig as { production?: unknown } | undefined;\n if (!slotWithProduction || slotWithProduction.production === undefined) return;\n const rawPin = slotConfig?.pin as { manifest?: unknown; integrity?: unknown } | undefined;\n const pin =\n rawPin &&\n typeof rawPin.manifest === \"string\" &&\n rawPin.manifest &&\n typeof rawPin.integrity === \"string\" &&\n rawPin.integrity\n ? { manifest: rawPin.manifest, integrity: rawPin.integrity }\n : undefined;\n if (!pin) {\n throw new Error(\n `slot \"${label}\" (${slot.url}) pins no version manifest — remote slots must pin ` +\n `a version manifest outside development (pre-atomic-deploy config; redeploy required)`,\n );\n }\n // The pin resolves against the slot's REMOTE base — the host slot's `url`\n // is its own listening origin (the bytes it would serve don't exist\n // there); its `remoteUrl` carries the deployment bundle base.\n const resolved = await resolveSlotVersion({ base: slot.remoteUrl ?? slot.url, pin });\n apply(resolved);\n };\n\n const applyUi = (ui: RuntimePluginConfig[\"ui\"], r: ResolvedSlotVersion): void => {\n if (!ui) return;\n ui.entryUrl = r.entryUrl;\n ui.entry = r.browserManifestUrl ?? ui.entry;\n ui.browserManifestUrl = r.browserManifestUrl;\n ui.integrity = r.entryIntegrity;\n ui.ssrEntryUrl = r.ssrEntryUrl;\n ui.ssrIntegrity = r.ssrIntegrity ?? ui.ssrIntegrity;\n };\n\n await derive(\"app.host\", config.app.host, result.host, (r) => {\n result.host.entryUrl = r.entryUrl;\n result.host.integrity = r.entryIntegrity;\n });\n await derive(\"app.ui\", config.app.ui, result.ui, (r) => applyUi(result.ui, r));\n await derive(\"app.api\", config.app.api, result.api, (r) => {\n result.api.entryUrl = r.entryUrl;\n result.api.integrity = r.entryIntegrity;\n });\n if (result.auth) {\n await derive(\"app.auth\", config.app.auth, result.auth, (r) => {\n result.auth!.entryUrl = r.entryUrl;\n result.auth!.integrity = r.entryIntegrity;\n });\n await derive(\n \"app.auth.ui\",\n getEntryAssociatedUi(config.app.auth as Partial<BosPluginRef>),\n result.auth.ui,\n (r) => applyUi(result.auth!.ui, r),\n );\n }\n for (const [key, plugin] of Object.entries(result.plugins ?? {})) {\n let pluginConfig = config.plugins?.[key];\n // The auth mirror (config.ts adds plugins.auth when the authored config\n // has no plugins.auth entry) derives from the app.auth slot — it is the\n // only compose surface for the auth ui, and its pins live on app.auth.\n const isAuthMirror =\n key === \"auth\" && result.auth && (plugin === result.auth || plugin.url === result.auth.url);\n if ((!pluginConfig || typeof pluginConfig === \"string\") && isAuthMirror) {\n pluginConfig = config.app.auth;\n }\n if (!pluginConfig || typeof pluginConfig === \"string\") continue;\n await derive(`plugins.${key}`, pluginConfig, plugin, (r) => {\n plugin.entryUrl = r.entryUrl;\n plugin.integrity = r.entryIntegrity;\n });\n await derive(\n `plugins.${key}.ui`,\n getEntryAssociatedUi(pluginConfig as Partial<BosPluginRef>),\n plugin.ui,\n (r) => applyUi(plugin.ui, r),\n );\n }\n}\n\nexport async function buildRuntimeConfig(\n config: BosConfig,\n baseDir: string,\n env: BosEnv,\n options?: BuildRuntimeConfigOptions,\n): Promise<RuntimeConfig> {\n return Effect.runPromise(buildRuntimeConfigEffect(config, baseDir, env, options));\n}\n\nasync function readConfigInput(configPath: string, baseDir: string): Promise<BosConfigInput> {\n if (configPath.startsWith(\"bos://\")) {\n return fetchBosConfigFromFastKv<BosConfigInput>(configPath);\n }\n\n const resolvedPath = isAbsolute(configPath) ? configPath : resolve(baseDir, configPath);\n if (isAppDescriptorPath(resolvedPath)) {\n return loadAppDescriptorConfig(resolvedPath);\n }\n return JSON.parse(readFileSync(resolvedPath, \"utf-8\")) as BosConfigInput;\n}\n\ntype PluginOverrideValue = PluginEntryValue | null | false;\n\nfunction normalizePluginEntry(raw: PluginOverrideValue): BosPluginRef | null | false {\n if (raw === null || raw === false) return raw;\n if (typeof raw === \"string\") {\n return { extends: raw };\n }\n return raw;\n}\n\nconst resolveRuntimePluginsEffect = Effect.fn(\"resolveRuntimePlugins\")(function* (\n plugins: Record<string, PluginOverrideValue>,\n baseDir: string,\n env: BosEnv,\n remotePlugins?: string[],\n): Effect.fn.Return<Record<string, RuntimePluginConfig>, ConfigExtendsError> {\n const entries = Object.entries(plugins)\n .map(([pluginId, rawInput]) => ({\n pluginId,\n normalized: normalizePluginEntry(rawInput),\n }))\n .filter(\n (entry): entry is { pluginId: string; normalized: BosPluginRef } =>\n entry.normalized !== null && entry.normalized !== false,\n );\n\n const resolved = yield* Effect.forEach(\n entries,\n ({ pluginId, normalized }) =>\n Effect.gen(function* () {\n const resolvedReference = yield* Effect.tryPromise({\n try: () => resolveComposableReference(normalized, baseDir, env, `plugins.${pluginId}`),\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n\n const forceSource =\n remotePlugins === undefined\n ? undefined\n : remotePlugins.length === 0 || remotePlugins.includes(pluginId)\n ? (\"remote\" as const)\n : undefined;\n const pluginRuntime = buildRuntimePluginConfig(\n pluginId,\n env,\n resolvedReference,\n forceSource,\n );\n\n if (!pluginRuntime.localPath && !pluginRuntime.url) {\n if (forceSource === \"remote\") {\n emitConfigWarning(\n `[Config] Plugin \"${pluginId}\" has no production URL in bos.config.json and cannot be resolved as remote. Add a \"production\" field or remove it from --remote-plugins.`,\n );\n }\n return null;\n }\n\n if (\n pluginRuntime.source === \"remote\" &&\n pluginRuntime.url &&\n !pluginRuntime.localPath &&\n typeof resolvedReference.entry.name !== \"string\"\n ) {\n pluginRuntime.name = yield* Effect.tryPromise({\n try: () => resolveRemotePluginRuntimeName(pluginRuntime.url, pluginRuntime.name),\n catch: (cause) => new ConfigExtendsError({ message: String(cause), cause }),\n });\n }\n\n return [pluginId, pluginRuntime] as const;\n }),\n { concurrency: \"unbounded\" },\n );\n\n const out: Record<string, RuntimePluginConfig> = {};\n for (const entry of resolved) {\n if (entry) {\n out[entry[0]] = entry[1];\n }\n }\n\n return out;\n});\n\nfunction resolveRuntimePlugins(\n plugins: Record<string, PluginOverrideValue>,\n baseDir: string,\n env: BosEnv,\n remotePlugins?: string[],\n): Promise<Record<string, RuntimePluginConfig>> {\n return Effect.runPromise(resolveRuntimePluginsEffect(plugins, baseDir, env, remotePlugins));\n}\n\nasync function resolveRemotePluginRuntimeName(baseUrl: string, fallback: string): Promise<string> {\n const manifest = await fetchJsonOrNull<{\n plugin?: { name?: unknown };\n }>(`${baseUrl.replace(/\\/$/, \"\")}/plugin.manifest.json`, { retries: 2 });\n\n return typeof manifest?.plugin?.name === \"string\" && manifest.plugin.name.length > 0\n ? manifest.plugin.name\n : fallback;\n}\n\nfunction buildRuntimePluginConfig(\n pluginId: string,\n env: BosEnv,\n resolved: ResolvedComposableReference,\n forceSource?: \"local\" | \"remote\",\n): RuntimePluginConfig {\n const source = resolved.entry;\n const development = typeof source.development === \"string\" ? source.development : undefined;\n const production = typeof source.production === \"string\" ? source.production : undefined;\n\n if (production?.startsWith(\"bos://\")) {\n throw new ConfigExtendsError({\n message: `Plugin \"${pluginId}\" has unsupported production target \"${production}\". Use extends: \"bos://account/domain\" for plugin configs or a CDN URL for production.`,\n });\n }\n\n const pluginExtendsRef = source.extends ? resolveExtendsRef(source.extends, env) : undefined;\n\n const runtimeTarget =\n env === \"development\"\n ? resolveDevelopmentTarget(\n development,\n production,\n resolved.providerBaseDir,\n forceSource,\n `plugins.${pluginId}`,\n pluginExtendsRef,\n )\n : resolveRuntimeTarget(production, resolved.providerBaseDir, \"remote\");\n const apiName = resolvePluginRuntimeName(source.name, runtimeTarget.localPath, pluginId);\n\n const ui = buildRuntimeUiConfig(\n pluginId,\n env,\n resolved.associatedUi,\n resolved.providerBaseDir,\n apiName,\n forceSource,\n );\n\n const routes = source.routes;\n\n return {\n name: apiName,\n url: runtimeTarget.url,\n entry: runtimeTarget.url\n ? `${runtimeTarget.url.replace(/\\/$/, \"\")}/mf-manifest.json`\n : \"/mf-manifest.json\",\n source: runtimeTarget.source,\n extendsRef: pluginExtendsRef,\n localPath: runtimeTarget.localPath,\n port: runtimeTarget.port,\n proxy: typeof source.proxy === \"string\" ? source.proxy : undefined,\n variables: normalizeJsonRecord(source.variables),\n secrets: normalizeStringArray(source.secrets),\n shared: source.shared,\n connectSrc: normalizeStringArray(source.connectSrc),\n integrity: runtimeTarget.source === \"remote\" ? source.integrity : undefined,\n ui,\n routes,\n dependsOn: source.dependsOn ? normalizeStringArray(source.dependsOn) : undefined,\n };\n}\n\n/**\n * Resolve a plugin entry's associated ui surface (`plugins.<id>.ui` / legacy\n * `plugins.<id>.app.ui`) into the runtime ui config. Extracted so app-slot\n * entries (app.auth) resolve their ui the same way.\n */\nfunction buildRuntimeUiConfig(\n pluginId: string,\n env: BosEnv,\n uiConfig: Record<string, unknown> | undefined,\n providerBaseDir: string,\n apiName: string,\n forceSource?: \"local\" | \"remote\",\n): RuntimePluginConfig[\"ui\"] {\n const uiDevelopment =\n typeof uiConfig?.development === \"string\" ? uiConfig.development : undefined;\n const uiProduction = typeof uiConfig?.production === \"string\" ? uiConfig.production : undefined;\n const uiRuntime =\n uiConfig && (uiDevelopment || uiProduction)\n ? env === \"development\"\n ? resolveDevelopmentTarget(\n uiDevelopment,\n uiProduction,\n providerBaseDir,\n forceSource,\n `plugins.${pluginId}.ui`,\n )\n : resolveRuntimeTarget(uiProduction, providerBaseDir, \"remote\")\n : undefined;\n if (!uiRuntime) return undefined;\n // A remote ui target with no URL is not a deployable surface (e.g. a\n // plugin ui entry with only a development key) — dropping it here keeps\n // the phantom source out of runtime resolution and client payloads.\n if (uiRuntime.source === \"remote\" && !uiRuntime.url) return undefined;\n\n return {\n name: resolveUiRuntimeName(uiConfig, uiRuntime.localPath, apiName),\n url: uiRuntime.url,\n entry: uiRuntime.url\n ? `${uiRuntime.url.replace(/\\/$/, \"\")}/mf-manifest.json`\n : \"/mf-manifest.json\",\n source: uiRuntime.source,\n publicUrl: typeof uiConfig?.publicUrl === \"string\" ? uiConfig.publicUrl : undefined,\n localPath: uiRuntime.localPath,\n port: uiRuntime.port,\n integrity:\n uiRuntime.source === \"remote\" && typeof uiConfig?.integrity === \"string\"\n ? uiConfig.integrity\n : undefined,\n ssrUrl:\n uiRuntime.source === \"remote\" && typeof uiConfig?.ssr === \"string\"\n ? uiConfig.ssr\n : uiRuntime.source === \"local\"\n ? uiRuntime.url\n : undefined,\n ssrIntegrity:\n uiRuntime.source === \"remote\" && typeof uiConfig?.ssrIntegrity === \"string\"\n ? uiConfig.ssrIntegrity\n : undefined,\n };\n}\n\n/**\n * MF container identity must match the build: folder-form plugin ui sources\n * build under the sanitized plugin workspace package name (the generated\n * rsbuild config imports the plugin's package.json), so derive the same\n * value here — an authored `ui.name` is only a fallback, and can never\n * override what the container actually registers under.\n */\nexport function resolveUiRuntimeName(\n uiConfig: Record<string, unknown> | undefined,\n localPath: string | undefined,\n apiName: string,\n): string {\n if (localPath) {\n const uiPkgPath = join(localPath, \"package.json\");\n const pkgPath = existsSync(uiPkgPath) ? uiPkgPath : join(dirname(localPath), \"package.json\");\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, \"utf-8\")) as { name?: unknown };\n if (typeof pkg.name === \"string\" && pkg.name.length > 0) {\n return sanitizeContainerName(pkg.name);\n }\n } catch (e) {\n console.warn(`[Config] Could not read package.json at ${pkgPath}: ${String(e)}`);\n }\n }\n return typeof uiConfig?.name === \"string\" ? uiConfig.name : `${apiName}-ui`;\n}\n\nexport function resolvePluginRuntimeName(\n explicitName: string | undefined,\n localPath: string | undefined,\n fallback: string,\n): string {\n if (explicitName) {\n return explicitName;\n }\n\n if (!localPath) {\n return fallback;\n }\n\n try {\n const packageJsonPath = join(localPath, \"package.json\");\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\")) as { name?: unknown };\n if (typeof packageJson.name === \"string\" && packageJson.name.length > 0) {\n return packageJson.name;\n }\n } catch (e) {\n console.warn(`[Config] Could not read package.json at ${localPath}: ${String(e)}`);\n }\n\n return fallback;\n}\n\nfunction normalizeJsonValue(value: unknown): JsonValue | undefined {\n if (\n value === null ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ) {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value\n .map((item) => normalizeJsonValue(item))\n .filter((item): item is JsonValue => item !== undefined);\n }\n\n if (isPlainObject(value)) {\n const out: JsonObject = {};\n for (const [key, raw] of Object.entries(value)) {\n const normalized = normalizeJsonValue(raw);\n if (normalized !== undefined) {\n out[key] = normalized;\n }\n }\n return out;\n }\n\n return undefined;\n}\n\nfunction normalizeJsonRecord(value: unknown): JsonObject | undefined {\n if (!isPlainObject(value)) return undefined;\n const out: JsonObject = {};\n for (const [key, raw] of Object.entries(value)) {\n const normalized = normalizeJsonValue(raw);\n if (normalized !== undefined) {\n out[key] = normalized;\n }\n }\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\nfunction normalizeStringArray(value: unknown): string[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out = value.filter((item): item is string => typeof item === \"string\" && item.length > 0);\n return out.length > 0 ? out : undefined;\n}\n\nfunction resolveRuntimeTarget(\n value: string | undefined,\n baseDir: string,\n defaultSource: \"local\" | \"remote\" = \"remote\",\n): RuntimeTarget {\n if (!value) {\n return { source: defaultSource, url: \"\" };\n }\n\n if (value.startsWith(LOCAL_PREFIX)) {\n const localTarget = value?.slice(LOCAL_PREFIX.length).trim();\n if (!localTarget) {\n throw new ConfigExtendsError({ message: `Invalid local development target: ${value}` });\n }\n\n const localPath = resolve(baseDir, localTarget);\n if (!existsSync(localPath)) {\n return { source: \"local\", url: \"\" };\n }\n\n return {\n source: \"local\",\n url: \"\",\n localPath,\n };\n }\n\n return {\n source: defaultSource,\n url: value.replace(/\\/$/, \"\"),\n port: parsePort(value),\n };\n}\n\nexport function isLocalDevelopmentTarget(\n value: string | undefined,\n): value is `${typeof LOCAL_PREFIX}${string}` {\n return typeof value === \"string\" && value.startsWith(LOCAL_PREFIX);\n}\n\nexport function resolveLocalDevelopmentPath(\n value: string | undefined,\n baseDir: string,\n): string | null {\n if (!isLocalDevelopmentTarget(value)) {\n return null;\n }\n\n const localTarget = value.slice(LOCAL_PREFIX.length).trim();\n return localTarget ? resolve(baseDir, localTarget) : null;\n}\n\nexport function resolveDevelopmentHostUrl(value: string | undefined): string {\n if (!value || isLocalDevelopmentTarget(value)) {\n return `http://localhost:${DEFAULT_HOST_PORT}`;\n }\n\n return value.replace(/\\/$/, \"\");\n}\n\nexport function getHostDevelopmentPort(value: string | undefined): number {\n return parsePort(resolveDevelopmentHostUrl(value));\n}\n\nexport function parsePort(url: string): number {\n try {\n const parsed = new URL(url);\n return parsed.port ? parseInt(parsed.port, 10) : parsed.protocol === \"https:\" ? 443 : 80;\n } catch {\n return 3000;\n }\n}\n\nexport type { BosEnv } from \"./merge\";\nexport {\n BOS_CONFIG_ORDER,\n mergeBosConfigWithExtends,\n rebuildOrderedConfig,\n resolveExtendsRef,\n} from \"./merge\";\nexport type { BosConfig, RuntimeConfig } from \"./types\";\nexport { BosConfigSchema } from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,qBAAqB,GAAG,SAA0B;CACtD,QAAQ,KAAK,GAAG,IAAI;AACtB;AA+BA,MAAM,eAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,2BAA2B;AAEjC,MAAa,yBAAyB;AAEtC,MAAa,uBAAuB;AAgBpC,MAAM,iBAAiB,IAAI,kBAAoD;;;;;;AAO/E,SAAgB,yBAA4B,MAAgB,IAAgB;CAC1E,OAAO,eAAe,IAAI;EAAE;EAAM,UAAU,eAAe,SAAS;CAAE,GAAG,EAAE;AAC7E;AAEA,SAAS,kBAAkB,SAAuB;CAChD,MAAM,UAAU,eAAe,SAAS;CACxC,IAAI,SACF,QAAQ,KAAK,KAAK,OAAO;MAEzB,QAAQ,KAAK,OAAO;AAExB;AAEA,MAAM,kCAAkB,IAAI,IAA2B;;;;;AAMvD,SAA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AC3D,IAAI,CAAC,aACH,MAAM,IAAI,mBAAmB,EAAE,SAAS,qCAAqC,QAAQ,CAAC;EAGxF,MAAM,YAAY,QAAQ,SAAS,WAAW;EAC9C,IAAI,CAAC,WAAW,SAAS,GACvB,OAAO;GAAE,QAAQ;GAAS,KAAK;EAAG;EAGpC,OAAO;GACL,QAAQ;GACR,KAAK;GACL;EACF;CACF;CAEA,OAAO;EACL,QAAQ;EACR,KAAK,MAAM,QAAQ,OAAO,EAAE;EAC5B,MAAM,UAAU,KAAK;CACvB;AACF;AAEA,SAAgB,yBACd,OAC4C;CAC5C,OAAO,OAAO,UAAU,YAAY,MAAM,WAAW,YAAY;AACnE;AAEA,SAAgB,4BACd,OACA,SACe;CACf,IAAI,CAAC,yBAAyB,KAAK,GACjC,OAAO;CAGT,MAAM,cAAc,MAAM,MAAM,CAAmB,CAAC,CAAC,KAAK;CAC1D,OAAO,cAAc,QAAQ,SAAS,WAAW,IAAI;AACvD;AAEA,SAAgB,0BAA0B,OAAmC;CAC3E,IAAI,CAAC,SAAS,yBAAyB,KAAK,GAC1C,OAAO,oBAAoB;CAG7B,OAAO,MAAM,QAAQ,OAAO,EAAE;AAChC;AAEA,SAAgB,uBAAuB,OAAmC;CACxE,OAAO,UAAU,0BAA0B,KAAK,CAAC;AACnD;AAEA,SAAgB,UAAU,KAAqB;CAC7C,IAAI;EACF,MAAM,SAAS,IAAI,IAAI,GAAG;EAC1B,OAAO,OAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI,OAAO,aAAa,WAAW,MAAM;CACxF,QAAQ;EACN,OAAO;CACT;AACF"}
@@ -117,7 +117,7 @@ const cliCommandMeta = {
117
117
  },
118
118
  deploy: {
119
119
  commandPath: ["deploy"],
120
- summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (pull-only)",
120
+ summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (image-backed, no build)",
121
121
  interactive: false,
122
122
  fields: {
123
123
  env: { description: "Environment: production or staging" },
@@ -1 +1 @@
1
- {"version":3,"file":"contract.meta.cjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n fields: {\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to force remote (e.g. --remote-plugins auth,registry)\",\n },\n logLevel: {\n description:\n \"Log tail level: error, warn (default), info, or debug (overrides BOS_LOG_LEVEL; the file always gets everything)\",\n },\n },\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n configPath: {\n description:\n \"Boot from a local bos config file — skips FastKV resolution and SRI integrity verification\",\n },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n fields: {\n full: { description: \"Print the fully resolved configuration\" },\n },\n },\n registryUse: {\n commandPath: [\"registry\", \"use\"],\n summary:\n \"Compose app.ui/app.host/app.api/plugins.<key> sections from a published runtime into bos.config.json\",\n interactive: false,\n fields: {\n from: {\n positional: true,\n description:\n \"Published runtime (account/gateway or bos:// URL), e.g. v1.citynode.near/citynode.app\",\n },\n sections: {\n description: \"Comma-separated sections to compose, e.g. app.ui,plugins.apps\",\n },\n dryRun: { description: \"Preview the merged config without writing\" },\n },\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary:\n \"Publish the current workspace configuration (no build — use bos deploy for the full train)\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview what would be published without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n rollback: {\n commandPath: [\"rollback\"],\n summary: \"Republish an earlier config snapshot from the registry publish history\",\n interactive: true,\n fields: {\n version: { description: \"Block height (or timestamp) of the snapshot from the listing\" },\n previous: { description: \"Roll back to the write immediately before the current one\" },\n force: {\n description:\n \"Allow pre-Phase-A snapshots without verifiable manifest pins (their bytes were overwritten in place)\",\n },\n limit: { description: \"Listing depth (1-200, default 20)\" },\n dryRun: { description: \"Preview the rollback without publishing\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n deploy: {\n commandPath: [\"deploy\"],\n summary:\n \"Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (pull-only)\",\n interactive: false,\n fields: {\n env: { description: \"Environment: production or staging\" },\n build: { description: \"Build and deploy workspaces before publish (default: true)\" },\n dryRun: { description: \"Preview what would be deployed without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n service: { description: \"Override Railway service name from config\" },\n imageDigest: {\n description:\n \"Digest of a pre-pushed runtime image (sha256:…) — skips the local image build/push; Railway pins this digest\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n login: {\n commandPath: [\"login\"],\n summary:\n \"Sign in with your NEAR account via the hosted site (wallet, passkey, or social login)\",\n interactive: true,\n fields: {\n key: { description: \"Also mint and export a scoped publish key for headless/CI use\" },\n site: { description: \"Override site URL hosting the CLI login page\" },\n device: { description: \"Device label recorded on the credential (default: hostname)\" },\n expiresIn: { description: \"Session lifetime in seconds (default: 90 days)\" },\n env: { description: \"Environment: production (default) or staging\" },\n },\n },\n logout: {\n commandPath: [\"logout\"],\n summary: \"Revoke the stored CLI session and delete the exported publish key\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"generate\"],\n summary: \"Generate a publish access key\",\n interactive: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n allowance: { description: \"NEAR allowance for the key (default: 1NEAR, min: 0.3NEAR)\" },\n removeOldKeys: {\n description:\n \"Remove existing publish key(s) without prompting (default: ask on a TTY, yes when non-interactive)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to customize locally: ui,api,host,plugins\",\n },\n level: {\n description:\n \"Starter complexity: simple (public shell) or advanced (adds dashboard, orgs, admin)\",\n },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n noInstall: { description: \"Skip pnpm install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to fetch contract types remotely (e.g. --remote-plugins auth,registry)\",\n },\n },\n },\n typecheck: {\n commandPath: [\"typecheck\"],\n summary: \"Run TypeScript type checking across all local workspaces\",\n interactive: false,\n fields: {\n packages: {\n positional: true,\n description: \"Comma-separated workspace list (default: all)\",\n },\n },\n },\n mfCheck: {\n commandPath: [\"mf\", \"check\"],\n summary:\n \"Verify Module Federation runtime compatibility across published host + plugin bundles\",\n interactive: false,\n },\n dbStudio: {\n commandPath: [\"db\", \"studio\"],\n summary: \"Open Drizzle Studio for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name (default: api)\",\n },\n },\n },\n dbDoctor: {\n commandPath: [\"db\", \"doctor\"],\n summary: \"Diagnose migration health for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n },\n },\n dbRepair: {\n commandPath: [\"db\", \"repair\"],\n summary: \"Reset migration history and reapply migrations for a plugin\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n mode: {\n description: \"Repair mode: history-reset (default) or recreate (not yet supported)\",\n },\n yes: {\n description: \"Skip confirmation prompt\",\n },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n ps: {\n commandPath: [\"ps\"],\n summary: \"List tracked development processes\",\n interactive: false,\n },\n logs: {\n commandPath: [\"logs\"],\n summary: \"Read dev session logs (.bos/logs/dev-latest.log)\",\n interactive: false,\n fields: {\n service: {\n description: \"Filter by service name (e.g. host, api, auth, ui, plugin:votes)\",\n },\n tail: { description: \"Show only the last N lines\" },\n follow: { description: \"Stream the log as lines are appended\" },\n },\n },\n kill: {\n commandPath: [\"kill\"],\n summary: \"Stop tracked development processes\",\n interactive: false,\n fields: {\n configDir: { description: \"Kill processes owned by a config directory (defaults to cwd)\" },\n signal: { description: \"Signal: SIGTERM (default) or SIGKILL\" },\n all: { description: \"Kill processes across all config directories\" },\n },\n },\n infraExport: {\n commandPath: [\"infra\", \"export\"],\n summary: \"Emit the resolved CI infra plan (env + services) for the current runtime\",\n interactive: false,\n fields: {\n target: { description: \"Export target: ci (default) or local\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n configDir: { description: \"Override config directory\" },\n },\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";;AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,KAAK;EACnB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ;GACN,eAAe,EACb,aACE,mFACJ;GACA,UAAU,EACR,aACE,mHACJ;EACF;CACF;CACA,OAAO;EACL,aA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Q;GACN,YAAY;GACZ,aAAa;EACf,EACF;CACF;CACA,UAAU;EACR,aAAa,CAAC,MAAM,QAAQ;EAC5B,SAAS;EACT,QAAQ,EACN,QAAQ;GACN,YAAY;GACZ,aAAa;EACf,EACF;CACF;CACA,UAAU;EACR,aAAa,CAAC,MAAM,QAAQ;EAC5B,SAAS;EACT,QAAQ;GACN,QAAQ;IACN,YAAY;IACZ,aAAa;GACf;GACA,MAAM,EACJ,aAAa,uEACf;GACA,KAAK,EACH,aAAa,2BACf;EACF;CACF;CACA,QAAQ;EACN,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;CACf;CACA,IAAI;EACF,aAAa,CAAC,IAAI;EAClB,SAAS;EACT,aAAa;CACf;CACA,MAAM;EACJ,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,SAAS,EACP,aAAa,kEACf;GACA,MAAM,EAAE,aAAa,6BAA6B;GAClD,QAAQ,EAAE,aAAa,uCAAuC;EAChE;CACF;CACA,MAAM;EACJ,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,WAAW,EAAE,aAAa,+DAA+D;GACzF,QAAQ,EAAE,aAAa,uCAAuC;GAC9D,KAAK,EAAE,aAAa,+CAA+C;EACrE;CACF;CACA,aAAa;EACX,aAAa,CAAC,SAAS,QAAQ;EAC/B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,aAAa,uCAAuC;GAC9D,SAAS,EAAE,aAAa,mCAAmC;GAC3D,WAAW,EAAE,aAAa,4BAA4B;EACxD;CACF;AACF"}
1
+ {"version":3,"file":"contract.meta.cjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n fields: {\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to force remote (e.g. --remote-plugins auth,registry)\",\n },\n logLevel: {\n description:\n \"Log tail level: error, warn (default), info, or debug (overrides BOS_LOG_LEVEL; the file always gets everything)\",\n },\n },\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n configPath: {\n description:\n \"Boot from a local bos config file — skips FastKV resolution and SRI integrity verification\",\n },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n fields: {\n full: { description: \"Print the fully resolved configuration\" },\n },\n },\n registryUse: {\n commandPath: [\"registry\", \"use\"],\n summary:\n \"Compose app.ui/app.host/app.api/plugins.<key> sections from a published runtime into bos.config.json\",\n interactive: false,\n fields: {\n from: {\n positional: true,\n description:\n \"Published runtime (account/gateway or bos:// URL), e.g. v1.citynode.near/citynode.app\",\n },\n sections: {\n description: \"Comma-separated sections to compose, e.g. app.ui,plugins.apps\",\n },\n dryRun: { description: \"Preview the merged config without writing\" },\n },\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary:\n \"Publish the current workspace configuration (no build — use bos deploy for the full train)\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview what would be published without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n rollback: {\n commandPath: [\"rollback\"],\n summary: \"Republish an earlier config snapshot from the registry publish history\",\n interactive: true,\n fields: {\n version: { description: \"Block height (or timestamp) of the snapshot from the listing\" },\n previous: { description: \"Roll back to the write immediately before the current one\" },\n force: {\n description:\n \"Allow pre-Phase-A snapshots without verifiable manifest pins (their bytes were overwritten in place)\",\n },\n limit: { description: \"Listing depth (1-200, default 20)\" },\n dryRun: { description: \"Preview the rollback without publishing\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n deploy: {\n commandPath: [\"deploy\"],\n summary:\n \"Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (image-backed, no build)\",\n interactive: false,\n fields: {\n env: { description: \"Environment: production or staging\" },\n build: { description: \"Build and deploy workspaces before publish (default: true)\" },\n dryRun: { description: \"Preview what would be deployed without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n service: { description: \"Override Railway service name from config\" },\n imageDigest: {\n description:\n \"Digest of a pre-pushed runtime image (sha256:…) — skips the local image build/push; Railway pins this digest\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n login: {\n commandPath: [\"login\"],\n summary:\n \"Sign in with your NEAR account via the hosted site (wallet, passkey, or social login)\",\n interactive: true,\n fields: {\n key: { description: \"Also mint and export a scoped publish key for headless/CI use\" },\n site: { description: \"Override site URL hosting the CLI login page\" },\n device: { description: \"Device label recorded on the credential (default: hostname)\" },\n expiresIn: { description: \"Session lifetime in seconds (default: 90 days)\" },\n env: { description: \"Environment: production (default) or staging\" },\n },\n },\n logout: {\n commandPath: [\"logout\"],\n summary: \"Revoke the stored CLI session and delete the exported publish key\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"generate\"],\n summary: \"Generate a publish access key\",\n interactive: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n allowance: { description: \"NEAR allowance for the key (default: 1NEAR, min: 0.3NEAR)\" },\n removeOldKeys: {\n description:\n \"Remove existing publish key(s) without prompting (default: ask on a TTY, yes when non-interactive)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to customize locally: ui,api,host,plugins\",\n },\n level: {\n description:\n \"Starter complexity: simple (public shell) or advanced (adds dashboard, orgs, admin)\",\n },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n noInstall: { description: \"Skip pnpm install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to fetch contract types remotely (e.g. --remote-plugins auth,registry)\",\n },\n },\n },\n typecheck: {\n commandPath: [\"typecheck\"],\n summary: \"Run TypeScript type checking across all local workspaces\",\n interactive: false,\n fields: {\n packages: {\n positional: true,\n description: \"Comma-separated workspace list (default: all)\",\n },\n },\n },\n mfCheck: {\n commandPath: [\"mf\", \"check\"],\n summary:\n \"Verify Module Federation runtime compatibility across published host + plugin bundles\",\n interactive: false,\n },\n dbStudio: {\n commandPath: [\"db\", \"studio\"],\n summary: \"Open Drizzle Studio for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name (default: api)\",\n },\n },\n },\n dbDoctor: {\n commandPath: [\"db\", \"doctor\"],\n summary: \"Diagnose migration health for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n },\n },\n dbRepair: {\n commandPath: [\"db\", \"repair\"],\n summary: \"Reset migration history and reapply migrations for a plugin\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n mode: {\n description: \"Repair mode: history-reset (default) or recreate (not yet supported)\",\n },\n yes: {\n description: \"Skip confirmation prompt\",\n },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n ps: {\n commandPath: [\"ps\"],\n summary: \"List tracked development processes\",\n interactive: false,\n },\n logs: {\n commandPath: [\"logs\"],\n summary: \"Read dev session logs (.bos/logs/dev-latest.log)\",\n interactive: false,\n fields: {\n service: {\n description: \"Filter by service name (e.g. host, api, auth, ui, plugin:votes)\",\n },\n tail: { description: \"Show only the last N lines\" },\n follow: { description: \"Stream the log as lines are appended\" },\n },\n },\n kill: {\n commandPath: [\"kill\"],\n summary: \"Stop tracked development processes\",\n interactive: false,\n fields: {\n configDir: { description: \"Kill processes owned by a config directory (defaults to cwd)\" },\n signal: { description: \"Signal: SIGTERM (default) or SIGKILL\" },\n all: { description: \"Kill processes across all config directories\" },\n },\n },\n infraExport: {\n commandPath: [\"infra\", \"export\"],\n summary: \"Emit the resolved CI infra plan (env + services) for the current runtime\",\n interactive: false,\n fields: {\n target: { description: \"Export target: ci (default) or local\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n configDir: { description: \"Override config directory\" },\n },\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";;AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,KAAK;EACnB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ;GACN,eAAe,EACb,aACE,mFACJ;GACA,UAAU,EACR,aACE,mHACJ;EACF;CACF;CACA,OAAO;EACL,aAAa,CAAC,OAAO;EACrB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ;GACN,KAAK,EAAE,aAAa,qCAAqC;GACzD,UAAU,EACR,aACE,uGACJ;GACA,YAAY,EACV,aACE,6FACJ;EACF;CACF;CACA,OAAO;EACL,aAAa,CAAC,OAAO;EACrB,SAAS;EACT,aAAa;EACb,QAAQ,EACN,UAAU;GAAE,YAAY;GAAM,aAAa;EAA+B,EAC5E;CACF;C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a,uEACf;GACA,KAAK,EACH,aAAa,2BACf;EACF;CACF;CACA,QAAQ;EACN,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;CACf;CACA,IAAI;EACF,aAAa,CAAC,IAAI;EAClB,SAAS;EACT,aAAa;CACf;CACA,MAAM;EACJ,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,SAAS,EACP,aAAa,kEACf;GACA,MAAM,EAAE,aAAa,6BAA6B;GAClD,QAAQ,EAAE,aAAa,uCAAuC;EAChE;CACF;CACA,MAAM;EACJ,aAAa,CAAC,MAAM;EACpB,SAAS;EACT,aAAa;EACb,QAAQ;GACN,WAAW,EAAE,aAAa,+DAA+D;GACzF,QAAQ,EAAE,aAAa,uCAAuC;GAC9D,KAAK,EAAE,aAAa,+CAA+C;EACrE;CACF;CACA,aAAa;EACX,aAAa,CAAC,SAAS,QAAQ;EAC/B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,aAAa,uCAAuC;GAC9D,SAAS,EAAE,aAAa,mCAAmC;GAC3D,WAAW,EAAE,aAAa,4BAA4B;EACxD;CACF;AACF"}
@@ -186,7 +186,7 @@ declare const cliCommandMeta: {
186
186
  };
187
187
  readonly deploy: {
188
188
  readonly commandPath: ["deploy"];
189
- readonly summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (pull-only)";
189
+ readonly summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (image-backed, no build)";
190
190
  readonly interactive: false;
191
191
  readonly fields: {
192
192
  readonly env: {
@@ -186,7 +186,7 @@ declare const cliCommandMeta: {
186
186
  };
187
187
  readonly deploy: {
188
188
  readonly commandPath: ["deploy"];
189
- readonly summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (pull-only)";
189
+ readonly summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (image-backed, no build)";
190
190
  readonly interactive: false;
191
191
  readonly fields: {
192
192
  readonly env: {
@@ -116,7 +116,7 @@ const cliCommandMeta = {
116
116
  },
117
117
  deploy: {
118
118
  commandPath: ["deploy"],
119
- summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (pull-only)",
119
+ summary: "Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (image-backed, no build)",
120
120
  interactive: false,
121
121
  fields: {
122
122
  env: { description: "Environment: production or staging" },
@@ -1 +1 @@
1
- {"version":3,"file":"contract.meta.mjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n fields: {\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to force remote (e.g. --remote-plugins auth,registry)\",\n },\n logLevel: {\n description:\n \"Log tail level: error, warn (default), info, or debug (overrides BOS_LOG_LEVEL; the file always gets everything)\",\n },\n },\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n configPath: {\n description:\n \"Boot from a local bos config file — skips FastKV resolution and SRI integrity verification\",\n },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n fields: {\n full: { description: \"Print the fully resolved configuration\" },\n },\n },\n registryUse: {\n commandPath: [\"registry\", \"use\"],\n summary:\n \"Compose app.ui/app.host/app.api/plugins.<key> sections from a published runtime into bos.config.json\",\n interactive: false,\n fields: {\n from: {\n positional: true,\n description:\n \"Published runtime (account/gateway or bos:// URL), e.g. v1.citynode.near/citynode.app\",\n },\n sections: {\n description: \"Comma-separated sections to compose, e.g. app.ui,plugins.apps\",\n },\n dryRun: { description: \"Preview the merged config without writing\" },\n },\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary:\n \"Publish the current workspace configuration (no build — use bos deploy for the full train)\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview what would be published without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n rollback: {\n commandPath: [\"rollback\"],\n summary: \"Republish an earlier config snapshot from the registry publish history\",\n interactive: true,\n fields: {\n version: { description: \"Block height (or timestamp) of the snapshot from the listing\" },\n previous: { description: \"Roll back to the write immediately before the current one\" },\n force: {\n description:\n \"Allow pre-Phase-A snapshots without verifiable manifest pins (their bytes were overwritten in place)\",\n },\n limit: { description: \"Listing depth (1-200, default 20)\" },\n dryRun: { description: \"Preview the rollback without publishing\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n deploy: {\n commandPath: [\"deploy\"],\n summary:\n \"Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (pull-only)\",\n interactive: false,\n fields: {\n env: { description: \"Environment: production or staging\" },\n build: { description: \"Build and deploy workspaces before publish (default: true)\" },\n dryRun: { description: \"Preview what would be deployed without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n service: { description: \"Override Railway service name from config\" },\n imageDigest: {\n description:\n \"Digest of a pre-pushed runtime image (sha256:…) — skips the local image build/push; Railway pins this digest\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n login: {\n commandPath: [\"login\"],\n summary:\n \"Sign in with your NEAR account via the hosted site (wallet, passkey, or social login)\",\n interactive: true,\n fields: {\n key: { description: \"Also mint and export a scoped publish key for headless/CI use\" },\n site: { description: \"Override site URL hosting the CLI login page\" },\n device: { description: \"Device label recorded on the credential (default: hostname)\" },\n expiresIn: { description: \"Session lifetime in seconds (default: 90 days)\" },\n env: { description: \"Environment: production (default) or staging\" },\n },\n },\n logout: {\n commandPath: [\"logout\"],\n summary: \"Revoke the stored CLI session and delete the exported publish key\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"generate\"],\n summary: \"Generate a publish access key\",\n interactive: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n allowance: { description: \"NEAR allowance for the key (default: 1NEAR, min: 0.3NEAR)\" },\n removeOldKeys: {\n description:\n \"Remove existing publish key(s) without prompting (default: ask on a TTY, yes when non-interactive)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to customize locally: ui,api,host,plugins\",\n },\n level: {\n description:\n \"Starter complexity: simple (public shell) or advanced (adds dashboard, orgs, admin)\",\n },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n noInstall: { description: \"Skip pnpm install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to fetch contract types remotely (e.g. --remote-plugins auth,registry)\",\n },\n },\n },\n typecheck: {\n commandPath: [\"typecheck\"],\n summary: \"Run TypeScript type checking across all local workspaces\",\n interactive: false,\n fields: {\n packages: {\n positional: true,\n description: \"Comma-separated workspace list (default: all)\",\n },\n },\n },\n mfCheck: {\n commandPath: [\"mf\", \"check\"],\n summary:\n \"Verify Module Federation runtime compatibility across published host + plugin bundles\",\n interactive: false,\n },\n dbStudio: {\n commandPath: [\"db\", \"studio\"],\n summary: \"Open Drizzle Studio for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name (default: api)\",\n },\n },\n },\n dbDoctor: {\n commandPath: [\"db\", \"doctor\"],\n summary: \"Diagnose migration health for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n },\n },\n dbRepair: {\n commandPath: [\"db\", \"repair\"],\n summary: \"Reset migration history and reapply migrations for a plugin\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n mode: {\n description: \"Repair mode: history-reset (default) or recreate (not yet supported)\",\n },\n yes: {\n description: \"Skip confirmation prompt\",\n },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n ps: {\n commandPath: [\"ps\"],\n summary: \"List tracked development processes\",\n interactive: false,\n },\n logs: {\n commandPath: [\"logs\"],\n summary: \"Read dev session logs (.bos/logs/dev-latest.log)\",\n interactive: false,\n fields: {\n service: {\n description: \"Filter by service name (e.g. host, api, auth, ui, plugin:votes)\",\n },\n tail: { description: \"Show only the last N lines\" },\n follow: { description: \"Stream the log as lines are appended\" },\n },\n },\n kill: {\n commandPath: [\"kill\"],\n summary: \"Stop tracked development processes\",\n interactive: false,\n fields: {\n configDir: { description: \"Kill processes owned by a config directory (defaults to cwd)\" },\n signal: { description: \"Signal: SIGTERM (default) or SIGKILL\" },\n all: { description: \"Kill processes across all config directories\" },\n },\n },\n infraExport: {\n commandPath: [\"infra\", \"export\"],\n summary: \"Emit the resolved CI infra plan (env + services) for the current runtime\",\n interactive: false,\n fields: {\n target: { description: \"Export target: ci (default) or local\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n configDir: { description: \"Override config directory\" },\n },\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,KAAK;EACnB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ;GACN,eAAe,EACb,aACE,mFACJ;GACA,UAAU,EACR,aACE,mHACJ;EACF;CACF;CACA,OAAO;EACL,aAAa,CAAC,OAAO;EACrB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ;GACN,KAAK,EAAE,aAAa,qCAAqC;GACzD,UAAU,EACR,aACE,uGACJ;GACA,YAAY,EACV,aACE,6FACJ;EACF;CACF;CACA,OAAO;EACL,aAAa,CAAC,OAAO;EACrB,SAAS;EACT,aAAa;EACb,QAAQ,EACN,UAAU;GAAE,YAAY;GAAM,aAAa;EAA+B,EAC5E;CACF;CACA,QAAQ;EACN,aAAa,CAAC,QAAQ;EACtB,SAAS;EACT,aAAa;EACb,QAAQ,EACN,MAAM,EAAE,aAAa,yCAAyC,EAChE;CACF;CACA,aAAa;EACX,aAAa,CAAC,YAAY,KAAK;EAC/B,SACE;EACF,aAAa;EACb,QAAQ;GACN,MAAM;IACJ,YAAY;IACZ,aACE;GACJ;GACA,UAAU,EACR,aAAa,gEACf;GACA,QAAQ,EAAE,aAAa,4CAA4C;EACrE;CACF;CACA,WAAW;EACT,aAAa,CAAC,UAAU,KAAK;EAC7B,SAAS;EACT,aAAa;EACb,QAAQ;GACN,QAAQ;IACN,YAAY;IACZ,aAAa;GACf;GACA,IAAI,EAAE,aAAa,eAAe;GAClC,YAAY,EAAE,aAAa,0BAA0B;EACvD;CACF;CACA,cAAc;EACZ,aAAa,CAAC,UAAU,QAAQ;EAChC,SAAS;EACT,aAAa;EACb,QAAQ,EAAE,KAAK;GAAE,YAAY;GAAM,aAAa;EAAa,EAAE;CACjE;CACA,YAAY;EACV,aAAa,CAAC,U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,EAAE,aAAa,mCAAmC;GAC3D,WAAW,EAAE,aAAa,4BAA4B;EACxD;CACF;AACF"}
1
+ {"version":3,"file":"contract.meta.mjs","names":[],"sources":["../src/contract.meta.ts"],"sourcesContent":["export type CliCommandMeta = {\n commandPath?: string[];\n summary: string;\n description?: string;\n examples?: string[];\n interactive?: boolean;\n longRunning?: boolean;\n fields?: Record<string, { positional?: boolean; description?: string }>;\n};\n\nexport const cliCommandMeta = {\n dev: {\n commandPath: [\"dev\"],\n summary: \"Start a development session\",\n interactive: true,\n longRunning: true,\n fields: {\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to force remote (e.g. --remote-plugins auth,registry)\",\n },\n logLevel: {\n description:\n \"Log tail level: error, warn (default), info, or debug (overrides BOS_LOG_LEVEL; the file always gets everything)\",\n },\n },\n },\n start: {\n commandPath: [\"start\"],\n summary: \"Start the production host\",\n interactive: false,\n longRunning: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n configPath: {\n description:\n \"Boot from a local bos config file — skips FastKV resolution and SRI integrity verification\",\n },\n },\n },\n build: {\n commandPath: [\"build\"],\n summary: \"Build selected workspaces\",\n interactive: false,\n fields: {\n packages: { positional: true, description: \"Comma-separated package list\" },\n },\n },\n config: {\n commandPath: [\"config\"],\n summary: \"Print the loaded BOS configuration\",\n interactive: false,\n fields: {\n full: { description: \"Print the fully resolved configuration\" },\n },\n },\n registryUse: {\n commandPath: [\"registry\", \"use\"],\n summary:\n \"Compose app.ui/app.host/app.api/plugins.<key> sections from a published runtime into bos.config.json\",\n interactive: false,\n fields: {\n from: {\n positional: true,\n description:\n \"Published runtime (account/gateway or bos:// URL), e.g. v1.citynode.near/citynode.app\",\n },\n sections: {\n description: \"Comma-separated sections to compose, e.g. app.ui,plugins.apps\",\n },\n dryRun: { description: \"Preview the merged config without writing\" },\n },\n },\n pluginAdd: {\n commandPath: [\"plugin\", \"add\"],\n summary: \"Add a plugin attachment\",\n interactive: false,\n fields: {\n source: {\n positional: true,\n description: \"Plugin source (local:path, bos://account/domain, or URL)\",\n },\n as: { description: \"Plugin alias\" },\n production: { description: \"Production URL override\" },\n },\n },\n pluginRemove: {\n commandPath: [\"plugin\", \"remove\"],\n summary: \"Remove a plugin attachment\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n pluginList: {\n commandPath: [\"plugin\", \"list\"],\n summary: \"List configured plugins\",\n interactive: false,\n },\n pluginPublish: {\n commandPath: [\"plugin\", \"publish\"],\n summary: \"Publish a single plugin\",\n interactive: false,\n fields: { key: { positional: true, description: \"Plugin key\" } },\n },\n publish: {\n commandPath: [\"publish\"],\n summary:\n \"Publish the current workspace configuration (no build — use bos deploy for the full train)\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview what would be published without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n rollback: {\n commandPath: [\"rollback\"],\n summary: \"Republish an earlier config snapshot from the registry publish history\",\n interactive: true,\n fields: {\n version: { description: \"Block height (or timestamp) of the snapshot from the listing\" },\n previous: { description: \"Roll back to the write immediately before the current one\" },\n force: {\n description:\n \"Allow pre-Phase-A snapshots without verifiable manifest pins (their bytes were overwritten in place)\",\n },\n limit: { description: \"Listing depth (1-200, default 20)\" },\n dryRun: { description: \"Preview the rollback without publishing\" },\n env: { description: \"Environment: production or staging\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n wallet: {\n description:\n \"Publish gaslessly with a one-time wallet approval (NEP-366 delegate action relayed by the platform relayer)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n deploy: {\n commandPath: [\"deploy\"],\n summary:\n \"Deploy train: preflight → build → upload bundles → publish config → runtime image (pre-pushed digest or local docker build) → Railway (image-backed, no build)\",\n interactive: false,\n fields: {\n env: { description: \"Environment: production or staging\" },\n build: { description: \"Build and deploy workspaces before publish (default: true)\" },\n dryRun: { description: \"Preview what would be deployed without writing\" },\n verbose: { description: \"Show full build output instead of clean summary\" },\n service: { description: \"Override Railway service name from config\" },\n imageDigest: {\n description:\n \"Digest of a pre-pushed runtime image (sha256:…) — skips the local image build/push; Railway pins this digest\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n login: {\n commandPath: [\"login\"],\n summary:\n \"Sign in with your NEAR account via the hosted site (wallet, passkey, or social login)\",\n interactive: true,\n fields: {\n key: { description: \"Also mint and export a scoped publish key for headless/CI use\" },\n site: { description: \"Override site URL hosting the CLI login page\" },\n device: { description: \"Device label recorded on the credential (default: hostname)\" },\n expiresIn: { description: \"Session lifetime in seconds (default: 90 days)\" },\n env: { description: \"Environment: production (default) or staging\" },\n },\n },\n logout: {\n commandPath: [\"logout\"],\n summary: \"Revoke the stored CLI session and delete the exported publish key\",\n interactive: false,\n },\n keyPublish: {\n commandPath: [\"key\", \"generate\"],\n summary: \"Generate a publish access key\",\n interactive: true,\n fields: {\n env: { description: \"Environment: production or staging\" },\n allowance: { description: \"NEAR allowance for the key (default: 1NEAR, min: 0.3NEAR)\" },\n removeOldKeys: {\n description:\n \"Remove existing publish key(s) without prompting (default: ask on a TTY, yes when non-interactive)\",\n },\n registry: {\n description:\n \"Override FastKV registry contract account (defaults: dev.everything.near / dev.allthethings.testnet)\",\n },\n },\n },\n init: {\n commandPath: [\"init\"],\n summary: \"Scaffold a new project by extending a deployed app or template\",\n interactive: true,\n fields: {\n domain: {\n positional: true,\n description: \"New project domain (e.g. myapp.everything.dev)\",\n },\n extends: {\n description: \"Parent to extend from (e.g. bos://account/gateway or account/gateway)\",\n },\n account: { description: \"New project NEAR account (auto-derived from extends)\" },\n directory: { description: \"Target directory (auto-derived from domain)\" },\n source: { description: \"Local source dir (skips GitHub download)\" },\n plugins: {\n description: \"Comma-separated plugin keys to include (requires --overrides=plugins)\",\n },\n overrides: {\n description: \"Comma-separated sections to customize locally: ui,api,host,plugins\",\n },\n level: {\n description:\n \"Starter complexity: simple (public shell) or advanced (adds dashboard, orgs, admin)\",\n },\n noInteractive: { description: \"Skip prompts, use flags only\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n sync: {\n commandPath: [\"sync\"],\n summary: \"Sync template files from parent project\",\n interactive: false,\n fields: {\n dryRun: { description: \"Preview changes without writing files\" },\n noInstall: { description: \"Skip pnpm install\" },\n },\n },\n upgrade: {\n commandPath: [\"upgrade\"],\n summary: \"Upgrade framework packages and sync template files\",\n interactive: true,\n fields: {\n dryRun: { description: \"Preview changes without writing\" },\n noInstall: { description: \"Skip pnpm install\" },\n noSync: { description: \"Only upgrade packages, skip template sync\" },\n },\n },\n typesGen: {\n commandPath: [\"types\", \"gen\"],\n summary: \"Generate type definitions from configured API and plugin contracts\",\n interactive: false,\n fields: {\n env: { description: \"Environment: development (default) or production\" },\n dryRun: { description: \"Preview what would be fetched without writing files\" },\n remotePlugins: {\n description:\n \"Comma-separated plugin IDs to fetch contract types remotely (e.g. --remote-plugins auth,registry)\",\n },\n },\n },\n typecheck: {\n commandPath: [\"typecheck\"],\n summary: \"Run TypeScript type checking across all local workspaces\",\n interactive: false,\n fields: {\n packages: {\n positional: true,\n description: \"Comma-separated workspace list (default: all)\",\n },\n },\n },\n mfCheck: {\n commandPath: [\"mf\", \"check\"],\n summary:\n \"Verify Module Federation runtime compatibility across published host + plugin bundles\",\n interactive: false,\n },\n dbStudio: {\n commandPath: [\"db\", \"studio\"],\n summary: \"Open Drizzle Studio for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name (default: api)\",\n },\n },\n },\n dbDoctor: {\n commandPath: [\"db\", \"doctor\"],\n summary: \"Diagnose migration health for a plugin's database\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n },\n },\n dbRepair: {\n commandPath: [\"db\", \"repair\"],\n summary: \"Reset migration history and reapply migrations for a plugin\",\n fields: {\n plugin: {\n positional: true,\n description: \"Plugin key: api, auth, or a plugin name\",\n },\n mode: {\n description: \"Repair mode: history-reset (default) or recreate (not yet supported)\",\n },\n yes: {\n description: \"Skip confirmation prompt\",\n },\n },\n },\n status: {\n commandPath: [\"status\"],\n summary: \"Show project health, versions, and update availability\",\n interactive: false,\n },\n ps: {\n commandPath: [\"ps\"],\n summary: \"List tracked development processes\",\n interactive: false,\n },\n logs: {\n commandPath: [\"logs\"],\n summary: \"Read dev session logs (.bos/logs/dev-latest.log)\",\n interactive: false,\n fields: {\n service: {\n description: \"Filter by service name (e.g. host, api, auth, ui, plugin:votes)\",\n },\n tail: { description: \"Show only the last N lines\" },\n follow: { description: \"Stream the log as lines are appended\" },\n },\n },\n kill: {\n commandPath: [\"kill\"],\n summary: \"Stop tracked development processes\",\n interactive: false,\n fields: {\n configDir: { description: \"Kill processes owned by a config directory (defaults to cwd)\" },\n signal: { description: \"Signal: SIGTERM (default) or SIGKILL\" },\n all: { description: \"Kill processes across all config directories\" },\n },\n },\n infraExport: {\n commandPath: [\"infra\", \"export\"],\n summary: \"Emit the resolved CI infra plan (env + services) for the current runtime\",\n interactive: false,\n fields: {\n target: { description: \"Export target: ci (default) or local\" },\n network: { description: \"NEAR network: mainnet or testnet\" },\n configDir: { description: \"Override config directory\" },\n },\n },\n} as const satisfies Record<string, CliCommandMeta>;\n"],"mappings":";AAUA,MAAa,iBAAiB;CAC5B,KAAK;EACH,aAAa,CAAC,KAAK;EACnB,SAAS;EACT,aAAa;EACb,aAAa;EACb,QAAQ;GACN,eAAe,EACb,aACE,mFACJ;GACA,UAAU,EACR,aACE,mHACJ;EACF;CAC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