{"version":3,"file":"processes.mjs","names":[],"sources":["../../../src/cli/render/processes.ts"],"sourcesContent":["import type { PsResult } from \"../../contract\";\nimport { colors, frames, gradients, icons } from \"../../utils/theme\";\n\nexport function renderPs(result: PsResult): void {\n  console.log();\n  if (result.status === \"error\") {\n    console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n    process.exit(1);\n  }\n  const entries = result.entries ?? [];\n  if (entries.length === 0) {\n    console.log(colors.dim(\"  No tracked development processes running.\"));\n    console.log();\n    console.log(colors.dim(`  Start one with ${colors.cyan(\"bos dev\")} and it will appear here.`));\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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