{"version":3,"file":"cli.cjs","names":["colors","frames","icons","gradients","formatDuration","sumPhaseDurations","findConfigPath","findCommandDescriptor","resolveFrameworkPackage","bosPlugin","parseCommandInput","p","consumeDevSession","promptInitBasic","fetchParentConfig","promptInitOverrides","runDockerComposeUp"],"sources":["../src/cli.ts"],"sourcesContent":["import { dirname, resolve } from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport { findCommandDescriptor } from \"./cli/catalog\";\nimport { resolveFrameworkPackage } from \"./cli/framework-version\";\nimport { printHelp } from \"./cli/help\";\nimport { loadProjectEnv } from \"./cli/infra\";\nimport { fetchParentConfig, runDockerComposeUp } from \"./cli/init\";\nimport { parseCommandInput } from \"./cli/parse\";\nimport { promptInitBasic, promptInitOverrides } from \"./cli/prompts\";\nimport { formatDuration, sumPhaseDurations } from \"./cli/timing\";\nimport { findConfigPath } from \"./config\";\nimport type {\n  DevOptions,\n  DevResult,\n  InitOptions,\n  InitResult,\n  KillOptions,\n  KillResult,\n  OverrideSection,\n  PsResult,\n  StartOptions,\n  StartResult,\n} from \"./contract\";\nimport type { ProgressEvent, StartSummary } from \"./plugin\";\nimport bosPlugin, { consumeDevSession, pluginEvents } from \"./plugin\";\nimport { createPluginRuntime } from \"./sdk\";\nimport { printBanner } from \"./utils/banner\";\nimport { colors, frames, gradients, icons } from \"./utils/theme\";\n\nfunction printConfigView(result: {\n  account: string;\n  domain?: string;\n  staging?: { domain: string };\n  app?: {\n    host: { name?: string; development: string; production?: string };\n    ui: { name?: string; development?: string; production?: string; ssr?: string };\n    api: { name?: string; development?: string; production?: string; proxy?: string };\n  };\n}) {\n  console.log();\n  console.log(colors.cyan(frames.top(52)));\n  console.log(`  ${icons.app} ${gradients.cyber(\"CONFIG\")}`);\n  console.log(colors.cyan(frames.bottom(52)));\n  console.log();\n\n  console.log(`  ${colors.dim(\"Account\")}  ${colors.cyan(result.account)}`);\n  console.log(`  ${colors.dim(\"Domain\")}   ${colors.white(result.domain ?? \"not configured\")}`);\n  if (result.staging) {\n    console.log(`  ${colors.dim(\"Staging\")}  ${colors.magenta(result.staging.domain)}`);\n  }\n  console.log();\n}\n\nfunction formatTimeAgo(isoTimestamp: string): string {\n  const now = Date.now();\n  const then = new Date(isoTimestamp).getTime();\n  const diffMs = now - then;\n  const diffMins = Math.floor(diffMs / 60_000);\n  if (diffMins < 1) return \"just now\";\n  if (diffMins < 60) return `${diffMins} minute${diffMins > 1 ? \"s\" : \"\"} ago`;\n  const diffHours = Math.floor(diffMins / 60);\n  if (diffHours < 24) return `${diffHours} hour${diffHours > 1 ? \"s\" : \"\"} ago`;\n  const diffDays = Math.floor(diffHours / 24);\n  if (diffDays < 30) return `${diffDays} day${diffDays > 1 ? \"s\" : \"\"} ago`;\n  return isoTimestamp.split(\"T\")[0] ?? isoTimestamp;\n}\n\nfunction normalizeVersion(v: string): string {\n  return v.replace(/^[\\^~>=v]+/, \"\").trim();\n}\n\nfunction printTimingSummary(timings: Array<{ name: string; durationMs: number }> | undefined) {\n  if (!timings || timings.length === 0) return;\n\n  console.log(`  ${colors.dim(\"Timings:\")}`);\n  for (const timing of timings) {\n    console.log(`    ${colors.dim(timing.name.padEnd(22))} ${formatDuration(timing.durationMs)}`);\n  }\n  console.log(\n    `    ${colors.dim(\"total\".padEnd(22))} ${formatDuration(sumPhaseDurations(timings))}`,\n  );\n}\n\nfunction printStartSummary(summary: StartSummary) {\n  console.log();\n  console.log(`  ${colors.dim(\"Config Source:\")}  ${summary.configSource}`);\n  if (summary.configSourceHttp) {\n    console.log(`                  ${colors.dim(summary.configSourceHttp)}`);\n  }\n  console.log(`  ${colors.dim(\"Account:\")}        ${summary.account}`);\n  console.log(`  ${colors.dim(\"Domain:\")}         ${summary.domain ?? \"not configured\"}`);\n  console.log();\n  console.log(`  ${colors.dim(\"Modules:\")}`);\n  console.log(`    ${colors.dim(\"HOST\")}  → ${summary.modules.host ?? \"local\"}`);\n  console.log(`    ${colors.dim(\"UI\")}   → ${summary.modules.ui ?? \"local\"}`);\n  console.log(`    ${colors.dim(\"API\")}  → ${summary.modules.api ?? \"local\"}`);\n  if (summary.modules.auth) {\n    console.log(`    ${colors.dim(\"AUTH\")}  → ${summary.modules.auth}`);\n  }\n  if (summary.warnings.length > 0) {\n    console.log();\n    for (const w of summary.warnings) {\n      console.log(`  ${colors.yellow(w)}`);\n    }\n  }\n  console.log();\n}\n\nfunction clearSpinnerStopLine() {\n  if (!process.stdout.isTTY) return;\n  process.stdout.write(\"\\u001B[1A\\u001B[2K\\u001B[1G\");\n}\n\nasync function warnIfOutdated(client: any, command: string): Promise<void> {\n  if (![\"dev\", \"build\", \"start\"].includes(command)) return;\n\n  try {\n    const status = await client.status();\n    if (status.status === \"error\" || !status.packages) return;\n\n    const frameworkPackages = [\"everything-dev\", \"every-plugin\"];\n\n    const linked = status.packages.filter((p: { isLinked?: boolean }) => p.isLinked);\n    const outdated = status.packages.filter(\n      (p: { name: string; installed?: string; latest?: string; isLinked?: boolean }) =>\n        !p.isLinked &&\n        p.installed &&\n        p.latest &&\n        normalizeVersion(p.installed) !== normalizeVersion(p.latest) &&\n        frameworkPackages.includes(p.name),\n    );\n\n    if (linked.length > 0) {\n      for (const pkg of linked) {\n        console.log(colors.dim(`    ${pkg.name} is linked locally (v${pkg.installed})`));\n      }\n    }\n\n    if (outdated.length === 0) return;\n\n    console.log();\n    console.log(colors.yellow(`  ! Outdated packages detected:`));\n    for (const pkg of outdated) {\n      console.log(colors.dim(`    ${pkg.name}  ${pkg.installed} → ${pkg.latest}`));\n    }\n    console.log(\n      colors.dim(\n        `    Run ${colors.cyan(\"bos upgrade\")} to update packages and sync template files.`,\n      ),\n    );\n    console.log();\n  } catch {\n    // silently ignore if status check fails\n  }\n}\n\nasync function main() {\n  const args = process.argv.slice(2);\n\n  if (args.includes(\"--help\") || args.includes(\"-h\")) {\n    printHelp();\n    return;\n  }\n\n  const invocationArgs = args.length > 0 ? args : [\"dev\"];\n  const command = invocationArgs[0] ?? \"dev\";\n  const configPath = findConfigPath();\n\n  const commandMatch = findCommandDescriptor(invocationArgs);\n  if (!commandMatch) {\n    console.error(`Unknown command: ${command}`);\n    process.exit(1);\n  }\n\n  const { descriptor, consumed } = commandMatch;\n  const commandArgs = invocationArgs.slice(consumed);\n\n  const projectDir = configPath ? dirname(configPath) : undefined;\n  const edResolved = projectDir ? resolveFrameworkPackage(projectDir, \"everything-dev\") : undefined;\n  const displayVersion = edResolved?.installedVersion\n    ? `${edResolved.installedVersion}${edResolved.isLinked ? \" (linked)\" : \"\"}`\n    : undefined;\n  printBanner(\"everything-dev\", displayVersion);\n\n  const runtime = createPluginRuntime({\n    registry: {\n      bos: { module: bosPlugin },\n    },\n    secrets: {},\n  });\n\n  const pluginRuntime: any = runtime;\n  const loadPlugin = pluginRuntime.usePlugin.bind(pluginRuntime);\n  const plugin = await loadPlugin(\"bos\", {\n    variables: {\n      configPath: configPath ?? undefined,\n    },\n    secrets: {},\n  });\n\n  const client = plugin.createClient();\n\n  const outdatedWarning = warnIfOutdated(client, command);\n\n  try {\n    const input = parseCommandInput(descriptor, commandArgs);\n\n    if (descriptor.key === \"dev\") {\n      const devSpinner = p.spinner();\n      devSpinner.start(\"Starting dev environment\");\n\n      const devPhaseLabels: Record<string, string> = {\n        \"shared deps\": \"Preparing config...\",\n        install: \"Installing dependencies...\",\n        build: \"Building...\",\n        \"resolve config\": \"Resolving config...\",\n        ports: \"Finding available ports...\",\n        \"generate artifacts\": \"Generating code artifacts...\",\n      };\n\n      const onDevProgress = (event: ProgressEvent) => {\n        const label = devPhaseLabels[event.phase] ?? event.phase;\n        if (event.status === \"running\") {\n          devSpinner.message(label);\n        }\n      };\n      pluginEvents.on(\"progress\", onDevProgress);\n\n      let result: DevResult;\n      try {\n        result = await client.dev(input as DevOptions);\n      } finally {\n        pluginEvents.off(\"progress\", onDevProgress);\n      }\n\n      if (result.status === \"error\") {\n        devSpinner.stop(\"Failed\");\n        console.error(`[CLI] ${result.description}`);\n        process.exit(1);\n      }\n\n      devSpinner.stop();\n      clearSpinnerStopLine();\n\n      const session = consumeDevSession();\n      await outdatedWarning;\n      if (session) {\n        const { devApp } = await import(\"./dev-session\");\n        devApp(session.orchestrator, session.services, session.runtimeConfig);\n      }\n      return;\n    }\n\n    if (descriptor.key === \"start\") {\n      const startSpinner = p.spinner();\n      startSpinner.start(\"Starting production environment\");\n\n      const startPhaseLabels: Record<string, string> = {\n        config: \"Preparing config...\",\n        \"generate artifacts\": \"Generating code artifacts...\",\n      };\n\n      const onStartProgress = (event: ProgressEvent) => {\n        const label = startPhaseLabels[event.phase] ?? event.phase;\n        if (event.status === \"running\") {\n          startSpinner.message(label);\n        }\n      };\n      pluginEvents.on(\"progress\", onStartProgress);\n\n      let result: StartResult;\n      try {\n        result = await client.start(input as StartOptions);\n      } finally {\n        pluginEvents.off(\"progress\", onStartProgress);\n      }\n\n      if (result.status === \"error\") {\n        startSpinner.stop(\"Failed\");\n        console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n\n      startSpinner.stop(\"Ready\");\n\n      const session = consumeDevSession();\n      await outdatedWarning;\n      if (session) {\n        const summary = session.summary;\n        if (summary) {\n          printStartSummary(summary);\n        }\n        const { startApp } = await import(\"./dev-session\");\n        startApp(session.orchestrator, session.services, session.runtimeConfig);\n      }\n      return;\n    }\n\n    if (descriptor.key === \"init\") {\n      let initInput: InitOptions = { ...(input as InitOptions) };\n\n      if (!initInput.noInteractive) {\n        const basic = await promptInitBasic({\n          extends: initInput.extends,\n          account: initInput.account,\n          domain: initInput.domain,\n        });\n\n        let parentPluginKeys: string[] = [];\n        let parentConfig: {\n          title?: string;\n          description?: string;\n          plugins?: Record<string, unknown>;\n        } | null = null;\n\n        const fetchSpinner = p.spinner();\n        fetchSpinner.start(\"Fetching parent config\");\n        try {\n          parentConfig = await fetchParentConfig(basic.extendsAccount, basic.extendsGateway);\n          if (parentConfig?.plugins && typeof parentConfig.plugins === \"object\") {\n            parentPluginKeys = Object.keys(parentConfig.plugins);\n          }\n        } catch {\n          fetchSpinner.stop(\"Config not found\");\n          console.error(\n            `[CLI] No config found at bos://${basic.extendsAccount}/${basic.extendsGateway}`,\n          );\n          process.exit(1);\n        }\n        fetchSpinner.stop(\"Config fetched\");\n\n        if (\n          typeof parentConfig?.title === \"string\" &&\n          parentConfig.title.trim() &&\n          typeof parentConfig?.description === \"string\" &&\n          parentConfig.description.trim()\n        ) {\n          const shouldContinue = await p.confirm({\n            message: `You will be extending ${parentConfig.title} - ${parentConfig.description}. Continue?`,\n            initialValue: true,\n          });\n\n          if (p.isCancel(shouldContinue) || !shouldContinue) {\n            process.exit(0);\n          }\n        }\n\n        const overrides = await promptInitOverrides({\n          parentPluginKeys,\n          plugins: initInput.plugins,\n          overrides: initInput.overrides as OverrideSection[] | undefined,\n        });\n\n        const directory = initInput.directory || basic.domain || basic.extendsGateway;\n\n        initInput = {\n          ...initInput,\n          extends: `bos://${basic.extendsAccount}/${basic.extendsGateway}`,\n          directory,\n          account: basic.account,\n          domain: basic.domain || undefined,\n          plugins: overrides.plugins,\n          overrides: overrides.overrides,\n          noInteractive: true,\n        };\n      }\n\n      const initSpinner = p.spinner();\n      initSpinner.start(\"Initializing project\");\n\n      const phaseLabels: Record<string, string> = {\n        \"parent config\": \"Fetching parent config...\",\n        \"template source\": \"Resolving template source...\",\n        \"scaffold project\": \"Creating project scaffold...\",\n        \"copy files\": \"Copying template files...\",\n        \"personalize config\": \"Personalizing config...\",\n        \"write snapshot\": \"Writing snapshot...\",\n        \"resolve config\": \"Resolving config...\",\n        \"generate env/docker\": \"Generating environment config...\",\n        \"create env file\": \"Creating .env file...\",\n        \"install dependencies\": \"Installing dependencies...\",\n        \"generate types\": \"Generating types...\",\n        \"generate migrations\": \"Generating database migrations...\",\n        \"generate code artifacts\": \"Generating code artifacts...\",\n      };\n\n      const onProgress = (event: ProgressEvent) => {\n        const label = phaseLabels[event.phase] ?? event.phase;\n        if (event.status === \"running\") {\n          initSpinner.message(label);\n        }\n      };\n      pluginEvents.on(\"progress\", onProgress);\n\n      let result: InitResult;\n      try {\n        result = await client.init(initInput);\n      } finally {\n        pluginEvents.off(\"progress\", onProgress);\n      }\n\n      if (result.status === \"error\") {\n        initSpinner.stop(\"Failed\");\n        console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n\n      initSpinner.stop(\"Project initialized\");\n\n      console.log(`  ${colors.dim(\"Extends:\")} ${result.extends}`);\n      console.log(`  ${colors.dim(\"Directory:\")} ${result.directory}`);\n      if (result.account) console.log(`  ${colors.dim(\"Account:\")} ${result.account}`);\n      if (result.domain) console.log(`  ${colors.dim(\"Domain:\")} ${result.domain}`);\n      if (result.overrides && result.overrides.length > 0)\n        console.log(`  ${colors.dim(\"Overrides:\")} ${result.overrides.join(\", \")}`);\n      if (result.plugins && result.plugins.length > 0)\n        console.log(`  ${colors.dim(\"Plugins:\")} ${result.plugins.join(\", \")}`);\n      console.log(`  ${colors.dim(\"Files copied:\")} ${result.filesCopied}`);\n      printTimingSummary(result.timings);\n      console.log();\n      console.log(colors.dim(\"  Next steps:\"));\n      console.log(colors.dim(`    cd ${result.directory}`));\n      if (!initInput.noInstall) {\n        console.log(colors.dim(\"    docker compose up -d --wait\"));\n        console.log(colors.dim(\"    bun run dev\"));\n      } else {\n        console.log(colors.dim(\"    bun install\"));\n        console.log(colors.dim(\"    docker compose up -d --wait\"));\n        console.log(colors.dim(\"    bun run dev\"));\n      }\n      console.log();\n\n      if (initInput.noInteractive !== true && !initInput.noInstall && result.targetDir) {\n        const shouldStartDocker = await p.confirm({\n          message: \"Run docker compose up -d --wait?\",\n          initialValue: true,\n        });\n\n        if (shouldStartDocker === true) {\n          const dockerSpinner = p.spinner();\n          dockerSpinner.start(\"Starting Docker services\");\n          try {\n            await runDockerComposeUp(result.targetDir);\n            dockerSpinner.stop(\"Docker services ready\");\n          } catch (error) {\n            dockerSpinner.stop(\"Docker services not started\");\n            p.log.warn(\n              `docker compose up -d --wait failed: ${error instanceof Error ? error.message : error}`,\n            );\n          }\n        }\n      }\n\n      return;\n    }\n\n    await outdatedWarning;\n\n    const result = await (client as any)[descriptor.key](input);\n\n    if (descriptor.key === \"dbStudio\") {\n      if (result.status === \"error\") {\n        console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n\n      const configPath = findConfigPath();\n      if (configPath) loadProjectEnv(dirname(configPath));\n\n      const { runStudioLocal, runStudioRemote } = await import(\"./cli/db-studio\");\n      const info = {\n        key: result.plugin as string,\n        source: result.source as \"local\" | \"remote\",\n        section: result.section as \"app.api\" | \"app.auth\" | \"plugins\",\n        databaseSecret: result.databaseSecret as string,\n        databaseUrl: result.databaseUrl as string,\n        workspaceDir: result.workspaceDir as string | undefined,\n        projectDir: dirname(configPath ?? process.cwd()),\n      };\n\n      try {\n        if (info.source === \"local\" && info.workspaceDir) {\n          await runStudioLocal(info);\n        } else {\n          await runStudioRemote(info);\n        }\n      } catch (error) {\n        console.error(`[CLI] ${error instanceof Error ? error.message : String(error)}`);\n        process.exit(1);\n      }\n      return;\n    }\n\n    if (descriptor.key === \"dbDoctor\") {\n      if (result.status === \"error\") {\n        console.error(`[CLI] ${result.error || \"Diagnosis failed\"}`);\n        process.exit(1);\n      }\n\n      const statusIcon = (() => {\n        switch (result.diagnosis) {\n          case \"healthy\":\n            return \"✓\";\n          case \"empty\":\n            return \"○\";\n          case \"unapplied\":\n            return \"○\";\n          case \"untracked-existing-schema\":\n            return \"○\";\n          case \"drift-safe-repair\":\n            return \"⚠\";\n          case \"drift-manual\":\n            return \"✗\";\n          default:\n            return \"?\";\n        }\n      })();\n\n      console.log(`\\n${statusIcon}  ${result.plugin}`);\n      console.log(`  ${colors.dim(`Journal:`)} ${result.journalSchema}.${result.journalTable}`);\n      console.log(`  ${colors.dim(`Local migrations:`)} ${result.localMigrationCount}`);\n      console.log(`  ${colors.dim(`Applied hashes:`)} ${result.appliedHashCount}`);\n      if (result.expectedTables.length > 0) {\n        console.log(`  ${colors.dim(`Expected tables:`)} ${result.expectedTables.join(\", \")}`);\n      }\n      if (result.missingTables.length > 0) {\n        console.log(`  ${colors.yellow(`Missing tables:`)} ${result.missingTables.join(\", \")}`);\n      }\n      console.log(`  ${colors.dim(`Diagnosis:`)} ${result.diagnosis}`);\n      if (result.workspaceDir) {\n        console.log(`  ${colors.dim(`Workspace:`)} ${result.workspaceDir}`);\n      }\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"dbRepair\") {\n      if (result.status === \"refused\") {\n        console.log(\n          `\\n${colors.yellow(\"!\")}  Repair refused for ${result.diagnosis?.plugin ?? result.message}`,\n        );\n        console.log(`  ${result.message}`);\n        console.log();\n        process.exit(0);\n      }\n\n      if (result.status === \"error\") {\n        console.error(`\\n${colors.error(\"✗\")}  Repair failed`);\n        console.error(`  ${result.message}`);\n        console.error();\n        process.exit(1);\n      }\n\n      console.log(`\\n${colors.green(\"✓\")}  Repair complete`);\n      console.log(`  ${result.message}`);\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"config\") {\n      if (!result.config) {\n        console.error(\"No bos.config.json found\");\n        process.exit(1);\n      }\n\n      printConfigView(result.config);\n      process.stdout.write(`${JSON.stringify(result.config, null, 2)}\\n`);\n      return;\n    }\n\n    if (descriptor.key === \"sync\") {\n      console.log();\n      if (result.status === \"error\") {\n        console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n      if (result.status === \"dry-run\") {\n        console.log(colors.cyan(`${icons.ok} Dry run — no files written`));\n      } else {\n        console.log(colors.green(`${icons.ok} Template synced`));\n      }\n      if (result.updated.length > 0) {\n        console.log(`  ${colors.dim(\"Updated:\")} ${result.updated.length} file(s)`);\n        for (const f of result.updated) console.log(`    ${colors.dim(f)}`);\n      }\n      if (result.added.length > 0) {\n        console.log(`  ${colors.dim(\"Added:\")} ${result.added.length} file(s)`);\n        for (const f of result.added) console.log(`    ${colors.dim(f)}`);\n      }\n      if (result.skipped.length > 0) {\n        console.log(\n          `  ${colors.yellow(\"Skipped:\")} ${result.skipped.length} file(s) (locally modified, use --force to overwrite)`,\n        );\n        for (const f of result.skipped) console.log(`    ${colors.dim(f)}`);\n      }\n      if (result.updated.length === 0 && result.added.length === 0 && result.skipped.length === 0) {\n        console.log(`  ${colors.dim(\"Already up to date\")}`);\n      }\n      if (result.status !== \"dry-run\" && result.updated.length > 0) {\n        console.log();\n        console.log(colors.dim(\"  Review changes — your customizations take priority:\"));\n        console.log(\n          colors.dim(\n            \"    • api/src/contract.ts, api/src/index.ts, api/src/db/schema.ts — never overwritten\",\n          ),\n        );\n        console.log(\n          colors.dim(\"    • ui/src/components/**, ui/src/styles.css — never overwritten\"),\n        );\n        console.log(\n          colors.dim(\n            \"    • Other updated files — accept framework improvements, then restore your changes\",\n          ),\n        );\n        console.log(colors.dim(\"    • Skipped files — yours already, only update with --force\"));\n      }\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"upgrade\") {\n      console.log();\n      if (result.status === \"error\") {\n        console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n      if (result.status === \"dry-run\") {\n        console.log(colors.cyan(`${icons.ok} Dry run — no changes applied`));\n      } else {\n        console.log(colors.green(`${icons.ok} Upgrade successful`));\n      }\n      for (const pkg of result.packages) {\n        if (pkg.from && pkg.from !== pkg.to) {\n          console.log(`  ${colors.dim(`${pkg.name}:`)} ${pkg.from} → ${pkg.to}`);\n        } else if (!pkg.from) {\n          console.log(`  ${colors.dim(`${pkg.name}:`)} ${pkg.to} (new)`);\n        } else {\n          console.log(`  ${colors.dim(`${pkg.name}:`)} ${pkg.to} (up to date)`);\n        }\n      }\n      if (result.changelogUrl) {\n        console.log(`  ${colors.dim(\"Changelog:\")} ${result.changelogUrl}`);\n      }\n      if (result.availablePlugins && result.availablePlugins.length > 0) {\n        console.log(`  ${colors.dim(\"New parent plugins:\")} ${result.availablePlugins.join(\", \")}`);\n      }\n      if (result.selectedPlugins && result.selectedPlugins.length > 0) {\n        console.log(`  ${colors.dim(\"Added plugins:\")} ${result.selectedPlugins.join(\", \")}`);\n      }\n      printTimingSummary(result.timings);\n      if (result.sync) {\n        const sync = result.sync;\n        if (sync.updated.length > 0) {\n          console.log(`  ${colors.dim(\"Updated:\")} ${sync.updated.length} file(s)`);\n          for (const f of sync.updated) console.log(`    ${colors.dim(f)}`);\n        }\n        if (sync.added.length > 0) {\n          console.log(`  ${colors.dim(\"Added:\")} ${sync.added.length} file(s)`);\n          for (const f of sync.added) console.log(`    ${colors.dim(f)}`);\n        }\n        if (sync.skipped.length > 0) {\n          console.log(\n            `  ${colors.yellow(\"Skipped:\")} ${sync.skipped.length} file(s) (locally modified, use --force to overwrite)`,\n          );\n          for (const f of sync.skipped) console.log(`    ${colors.dim(f)}`);\n        }\n        if (\n          result.status !== \"dry-run\" &&\n          (sync.updated.length > 0 || sync.added.length > 0 || sync.skipped.length > 0)\n        ) {\n          console.log();\n          console.log(colors.dim(\"  Resolve differences — your code takes priority:\"));\n          console.log();\n          console.log(colors.dim(\"  Never overwritten (safe):\"));\n          console.log(\n            colors.dim(\"    • api/src/contract.ts, api/src/index.ts, api/src/db/schema.ts\"),\n          );\n          console.log(colors.dim(\"    • ui/src/components/**, ui/src/styles.css\"));\n          console.log();\n          console.log(colors.dim(\"  Replaced — review and keep your changes:\"));\n          console.log(\n            colors.dim(\n              \"    • api/drizzle.config.ts, api/tsconfig.json, api/tsconfig.contract.json\",\n            ),\n          );\n          console.log(colors.dim(\"    • api/plugin.dev.ts, api/rspack.config.js\"));\n          console.log(colors.dim(\"    • ui/src/routes/* (core routes only)\"));\n          console.log();\n          console.log(colors.dim(\"  Merged — your deps preserved:\"));\n          console.log(colors.dim(\"    • package.json, api/package.json, ui/package.json\"));\n          console.log();\n          console.log(colors.dim(\"  Skipped — already yours:\"));\n          console.log(colors.dim(\"    • Use --force only if you want framework updates\"));\n        }\n      }\n      if (result.migrated && result.migrated.length > 0) {\n        console.log(`  ${colors.yellow(\"Removed:\")} ${result.migrated.length} obsolete file(s)`);\n        for (const f of result.migrated) console.log(`    ${colors.dim(f)}`);\n      }\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"status\") {\n      console.log();\n      if (result.status === \"error\") {\n        console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n      console.log(colors.cyan(frames.top(52)));\n      console.log(`  ${icons.app} ${gradients.cyber(\"STATUS\")}`);\n      console.log(colors.cyan(frames.bottom(52)));\n      console.log();\n      if (result.extends) console.log(`  ${colors.dim(\"Extends:\")}     ${result.extends}`);\n      if (result.account) console.log(`  ${colors.dim(\"Account:\")}     ${result.account}`);\n      if (result.domain) console.log(`  ${colors.dim(\"Domain:\")}      ${result.domain}`);\n      console.log();\n      console.log(`  ${colors.dim(\"Packages:\")}`);\n      for (const pkg of result.packages) {\n        const hasUpdate =\n          pkg.installed &&\n          pkg.latest &&\n          normalizeVersion(pkg.installed) !== normalizeVersion(pkg.latest);\n        const versionStr = hasUpdate\n          ? `${pkg.installed}  →  ${pkg.latest}`\n          : pkg.installed || \"not installed\";\n        const label = hasUpdate ? colors.yellow(versionStr) : colors.dim(versionStr);\n        console.log(`    ${colors.dim(`${pkg.name}`)}  ${label}`);\n      }\n      console.log();\n      if (result.lastSync) {\n        const ago = formatTimeAgo(result.lastSync);\n        console.log(`  ${colors.dim(\"Last sync:\")}   ${ago}`);\n      } else {\n        console.log(`  ${colors.dim(\"Last sync:\")}   never`);\n      }\n      const envLabel =\n        result.envFile === \"found\"\n          ? colors.green(\"found\")\n          : result.envFile === \"example-only\"\n            ? colors.yellow(\"missing (only .env.example found)\")\n            : colors.error(\"missing\");\n      console.log(`  ${colors.dim(\".env:\")}         ${envLabel}`);\n      if (result.parentReachable !== undefined) {\n        const parentLabel = result.parentReachable\n          ? colors.green(\"reachable\")\n          : colors.error(\"unreachable\");\n        console.log(`  ${colors.dim(\"Parent:\")}      ${parentLabel}`);\n      }\n      const hasUpdates = result.packages.some(\n        (p: { installed?: string; latest?: string }) =>\n          p.installed && p.latest && normalizeVersion(p.installed) !== normalizeVersion(p.latest),\n      );\n      if (hasUpdates) {\n        console.log();\n        console.log(\n          colors.dim(\n            `  Run ${colors.cyan(\"bos upgrade\")} to update packages and sync template files.`,\n          ),\n        );\n      }\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"ps\") {\n      const psResult = result as PsResult;\n      console.log();\n      if (psResult.status === \"error\") {\n        console.error(`[CLI] ${psResult.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n      const entries = psResult.entries ?? [];\n      if (entries.length === 0) {\n        console.log(colors.dim(\"  No tracked development processes running.\"));\n        console.log();\n        console.log(\n          colors.dim(`  Start one with ${colors.cyan(\"bos dev\")} and it will appear here.`),\n        );\n        console.log();\n        return;\n      }\n      console.log(colors.cyan(frames.top(60)));\n      console.log(`  ${icons.app} ${gradients.cyber(\"PROCESSES\")}`);\n      console.log(colors.cyan(frames.bottom(60)));\n      console.log();\n      for (const entry of entries) {\n        const ageMs = Date.now() - entry.startedAt;\n        const ageStr =\n          ageMs < 60_000\n            ? `${Math.floor(ageMs / 1000)}s`\n            : ageMs < 3_600_000\n              ? `${Math.floor(ageMs / 60_000)}m`\n              : `${Math.floor(ageMs / 3_600_000)}h`;\n        const roleTag =\n          entry.role === \"workspace-parent\"\n            ? colors.magenta(\"parent\")\n            : entry.role === \"workspace-child\"\n              ? colors.blue(\"child\")\n              : colors.dim(\"dev\");\n        console.log(`  ${colors.green(`pid ${entry.pid}`)}  ${roleTag}  ${colors.dim(ageStr)}`);\n        console.log(`    ${colors.dim(\"dir:\")}    ${entry.configDir}`);\n        if (entry.parentPid !== undefined) {\n          console.log(`    ${colors.dim(\"parent:\")} ${entry.parentPid}`);\n        }\n        const portPairs = Object.entries(entry.ports ?? {})\n          .filter(([, p]) => typeof p === \"number\")\n          .map(([k, v]) => `${k}=${v}`);\n        if (portPairs.length > 0) {\n          console.log(`    ${colors.dim(\"ports:\")}  ${portPairs.join(\"  \")}`);\n        }\n        if (entry.budget) {\n          console.log(`    ${colors.dim(\"budget:\")} [${entry.budget.min}, ${entry.budget.max}]`);\n        }\n        console.log(`    ${colors.dim(\"desc:\")}   ${entry.description}`);\n        console.log();\n      }\n      return;\n    }\n\n    if (descriptor.key === \"kill\") {\n      const killResult = result as KillResult;\n      console.log();\n      if (killResult.status === \"error\") {\n        console.error(`[CLI] ${killResult.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n      if (killResult.killed.length > 0) {\n        console.log(colors.green(`${icons.ok} Sent ${killResult.killed.length} kill signal(s)`));\n        for (const k of killResult.killed) {\n          console.log(`  ${colors.dim(\"pid\")} ${k.pid}  ${colors.dim(k.configDir)}`);\n        }\n      }\n      if (killResult.skipped.length > 0) {\n        console.log(colors.yellow(`${icons.err} ${killResult.skipped.length} skipped`));\n        for (const s of killResult.skipped) {\n          console.log(`  ${colors.dim(\"pid\")} ${s.pid}  ${colors.dim(s.reason)}`);\n        }\n      }\n      if (killResult.killed.length === 0 && killResult.skipped.length === 0) {\n        const opts = input as KillOptions;\n        if (opts.all) {\n          console.log(colors.dim(\"  No tracked processes to kill.\"));\n        } else {\n          const configPath = findConfigPath();\n          const dir = opts.configDir ?? (configPath ? resolve(dirname(configPath)) : process.cwd());\n          console.log(colors.dim(`  No tracked processes for ${dir}`));\n          console.log(colors.dim(`  Use ${colors.cyan(\"--all\")} to kill across all directories.`));\n        }\n      }\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"typesGen\") {\n      console.log();\n      if (result.status === \"error\") {\n        console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n        process.exit(1);\n      }\n      console.log(colors.green(`${icons.ok} Types generated`));\n      if (result.source) {\n        console.log(\n          `  ${colors.dim(\"Mode:\")} ${result.source === \"remote\" ? colors.cyan(\"remote\") : colors.dim(\"local\")}`,\n        );\n      }\n      if (result.generated.length > 0) {\n        console.log(`  ${colors.dim(\"Generated:\")}`);\n        for (const f of result.generated) console.log(`    ${colors.dim(f)}`);\n      }\n      if (result.fetched.length > 0) {\n        console.log(`  ${colors.dim(\"Fetched (remote):\")}`);\n        for (const url of result.fetched) console.log(`    ${colors.dim(url)}`);\n      }\n      if (result.skipped.length > 0) {\n        console.log(`  ${colors.dim(\"Skipped:\")}`);\n        for (const s of result.skipped) console.log(`    ${colors.dim(s)}`);\n      }\n      if (result.failed.length > 0) {\n        console.log(`  ${colors.yellow(\"Failed:\")}`);\n        for (const f of result.failed) console.log(`    ${colors.error(f)}`);\n      }\n      console.log();\n      return;\n    }\n\n    if (result?.status === \"error\" && descriptor.key !== \"publish\" && descriptor.key !== \"deploy\") {\n      console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n      process.exit(1);\n    }\n\n    if (descriptor.key === \"keyPublish\") {\n      process.stdout.write(`Generated publish key for ${result.account}\\n`);\n      process.stdout.write(`  Network: ${result.network}\\n`);\n      process.stdout.write(`  Allowance: ${result.allowance}\\n`);\n      process.stdout.write(`\\n`);\n      process.stdout.write(\n        `  Set this as NEAR_PRIVATE_KEY in GitHub Actions or before calling publish:\\n`,\n      );\n      process.stdout.write(`  NEAR_PRIVATE_KEY=${result.privateKey}\\n`);\n    }\n\n    if (descriptor.key === \"pluginAdd\") {\n      console.log();\n      console.log(colors.green(`${icons.ok} Added plugin ${result.key}`));\n      if (result.development) console.log(`  ${colors.dim(\"Development:\")} ${result.development}`);\n      if (result.production) console.log(`  ${colors.dim(\"Production:\")} ${result.production}`);\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"pluginRemove\") {\n      console.log();\n      console.log(colors.green(`${icons.ok} Removed plugin ${result.key}`));\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"pluginList\") {\n      console.log();\n      console.log(colors.cyan(frames.top(52)));\n      console.log(`  ${icons.config} ${gradients.cyber(\"PLUGINS\")}`);\n      console.log(colors.cyan(frames.bottom(52)));\n      console.log();\n      if (result.plugins.length === 0) {\n        console.log(colors.dim(\"  No plugins configured\"));\n      } else {\n        for (const pluginItem of result.plugins) {\n          console.log(`  ${colors.cyan(pluginItem.key)}`);\n          if (pluginItem.development)\n            console.log(`    ${colors.dim(\"Development:\")} ${pluginItem.development}`);\n          if (pluginItem.production)\n            console.log(`    ${colors.dim(\"Production:\")} ${pluginItem.production}`);\n        }\n      }\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"pluginPublish\") {\n      console.log();\n      console.log(colors.green(`${icons.ok} Published plugin ${result.key}`));\n      if (result.path) console.log(`  ${colors.dim(\"Path:\")} ${result.path}`);\n      if (result.script) console.log(`  ${colors.dim(\"Script:\")} bun run ${result.script}`);\n      if (result.production) console.log(`  ${colors.dim(\"Production:\")} ${result.production}`);\n      console.log();\n      return;\n    }\n\n    if (descriptor.key === \"publish\") {\n      if (result.status === \"dry-run\") {\n        console.log();\n        console.log(colors.cyan(`${icons.ok} Dry run complete`));\n        console.log(`  ${colors.dim(\"Registry URL:\")} ${result.registryUrl}`);\n        console.log();\n        return;\n      }\n\n      if (result.status === \"error\") {\n        console.log();\n        console.log(colors.error(`${icons.err} Publish failed`));\n        if (result.error) {\n          console.log(`  ${colors.dim(\"Error:\")} ${result.error}`);\n        }\n        if (result.deployResults && result.deployResults.length > 0) {\n          const failures = result.deployResults.filter((r: any) => !r.success);\n          if (failures.length > 0) {\n            console.log();\n            for (const f of failures) {\n              const errorLine = (f.error ?? \"Failed\").split(\"\\n\")[0];\n              console.log(`  ${colors.error(icons.err)} ${f.key}: ${errorLine}`);\n            }\n          }\n        }\n        console.log();\n        process.exit(1);\n      }\n\n      if (result.status === \"published\") {\n        console.log();\n        console.log(colors.green(`${icons.ok} Published successfully`));\n        console.log(`  ${colors.dim(\"Registry URL:\")} ${result.registryUrl}`);\n        if (result.txHash) {\n          console.log(`  ${colors.dim(\"Transaction:\")} ${result.txHash}`);\n        }\n        if (result.built && result.built.length > 0) {\n          console.log(`  ${colors.dim(\"Built:\")} ${result.built.join(\", \")}`);\n        }\n        if (result.skipped && result.skipped.length > 0) {\n          console.log(`  ${colors.dim(\"Skipped:\")} ${result.skipped.join(\", \")}`);\n        }\n        if (result.deployResults) {\n          const warnings = result.deployResults.flatMap((r: any) => r.warnings ?? []);\n          if (warnings.length > 0) {\n            console.log();\n            console.log(`  ${colors.yellow(\"⚠\")} Build warnings:`);\n            for (const w of warnings) {\n              console.log(`    ${colors.dim(w)}`);\n            }\n          }\n        }\n        console.log();\n        return;\n      }\n    }\n\n    if (descriptor.key === \"deploy\") {\n      const deployResult = result as any;\n      if (deployResult.status === \"dry-run\") {\n        console.log();\n        console.log(colors.cyan(`${icons.ok} Dry run complete`));\n        console.log(`  ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n        console.log();\n        return;\n      }\n\n      if (deployResult.status === \"error\") {\n        console.log();\n        console.log(colors.error(`${icons.err} Deploy failed`));\n        if (deployResult.error) {\n          console.log(`  ${colors.dim(\"Error:\")} ${deployResult.error}`);\n        }\n        if (deployResult.deployResults && deployResult.deployResults.length > 0) {\n          const failures = deployResult.deployResults.filter((r: any) => !r.success);\n          if (failures.length > 0) {\n            console.log();\n            for (const f of failures) {\n              const errorLine = (f.error ?? \"Failed\").split(\"\\n\")[0];\n              console.log(`  ${colors.error(icons.err)} ${f.key}: ${errorLine}`);\n            }\n          }\n        }\n        console.log();\n        process.exit(1);\n      }\n\n      if (deployResult.status === \"deployed\") {\n        console.log();\n        console.log(colors.green(`${icons.ok} Deployed successfully`));\n        console.log(`  ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n        if (deployResult.txHash) {\n          console.log(`  ${colors.dim(\"Transaction:\")} ${deployResult.txHash}`);\n        }\n        if (deployResult.built && deployResult.built.length > 0) {\n          console.log(`  ${colors.dim(\"Built:\")} ${deployResult.built.join(\", \")}`);\n        }\n        if (deployResult.skipped && deployResult.skipped.length > 0) {\n          console.log(`  ${colors.dim(\"Skipped:\")} ${deployResult.skipped.join(\", \")}`);\n        }\n        if (deployResult.deployResults) {\n          const warnings = deployResult.deployResults.flatMap((r: any) => r.warnings ?? []);\n          if (warnings.length > 0) {\n            console.log();\n            console.log(`  ${colors.yellow(\"⚠\")} Build warnings:`);\n            for (const w of warnings) {\n              console.log(`    ${colors.dim(w)}`);\n            }\n          }\n        }\n        if (deployResult.redeployed) {\n          console.log(\n            `  ${colors.dim(\"Railway:\")} redeployed ${deployResult.service ?? \"service\"}`,\n          );\n        } else if (!process.env.RAILWAY_TOKEN) {\n          console.log(`  ${colors.yellow(\"Railway:\")} skipped (RAILWAY_TOKEN not set)`);\n        }\n        console.log();\n        return;\n      }\n\n      if (deployResult.status === \"published\") {\n        console.log();\n        console.log(colors.yellow(`${icons.err} Config published, but Railway redeploy failed`));\n        console.log(`  ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n        if (deployResult.txHash) {\n          console.log(`  ${colors.dim(\"Transaction:\")} ${deployResult.txHash}`);\n        }\n        if (deployResult.error) {\n          console.log(`  ${colors.dim(\"Railway:\")} ${deployResult.error}`);\n        }\n        console.log();\n        process.exit(1);\n      }\n    }\n  } catch (error) {\n    console.error(`[CLI] ${error instanceof Error ? error.message : String(error)}`);\n    process.exit(1);\n  }\n}\n\nvoid main().catch((error) => {\n  console.error(\"[CLI] Fatal error:\", error);\n  process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA,SAAS,gBAAgB,QAStB;CACD,QAAQ,IAAI;CACZ,QAAQ,IAAIA,qBAAO,KAAKC,qBAAO,IAAI,EAAE,CAAC,CAAC;CACvC,QAAQ,IAAI,KAAKC,oBAAM,IAAI,GAAGC,wBAAU,MAAM,QAAQ,GAAG;CACzD,QAAQ,IAAIH,qBAAO,KAAKC,qBAAO,OAAO,EAAE,CAAC,CAAC;CAC1C,QAAQ,IAAI;CAEZ,QAAQ,IAAI,KAAKD,qBAAO,IAAI,SAAS,EAAE,IAAIA,qBAAO,KAAK,OAAO,OAAO,GAAG;CACxE,QAAQ,IAAI,KAAKA,qBAAO,IAAI,QAAQ,EAAE,KAAKA,qBAAO,MAAM,OAAO,UAAU,gBAAgB,GAAG;CAC5F,IAAI,OAAO,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