{"version":3,"file":"lifecycle.mjs","names":[],"sources":["../../../src/cli/commands/lifecycle.ts"],"sourcesContent":["import { colors, icons } from \"../../utils/theme\";\nimport type { ResultRenderer } from \"./context\";\n\nexport const lifecycleRenderers: Record<string, ResultRenderer> = {\n  login: async (result, _ctx) => {\n    console.log();\n    console.log(colors.green(`${icons.ok} Logged in to ${result.siteUrl}`));\n    if (result.accountId) console.log(`  ${colors.dim(\"Account:\")} ${result.accountId}`);\n    if (result.expiresAt) console.log(`  ${colors.dim(\"Expires:\")} ${result.expiresAt}`);\n    if (result.warning) console.log(`  ${colors.yellow(\"⚠\")} ${result.warning}`);\n    if (result.deployKey) {\n      console.log(\n        `  ${colors.dim(\"Deploy key:\")} ${result.deployKey.account}/${result.deployKey.gateway} scope${result.publishKey ? \"\" : colors.dim(\" — upload credentials for deploys\")}`,\n      );\n      if (!process.stdout.isTTY) {\n        process.stderr.write(\n          `  ⚠ Non-interactive stdout: this API key will be captured in any log or pipe (GitHub Actions logs persist stdout).\\n`,\n        );\n      }\n      process.stdout.write(\n        `  Set this as BOS_STORAGE_API_KEY in GitHub Actions or before calling deploy:\\n`,\n      );\n      process.stdout.write(`BOS_STORAGE_API_KEY=${result.deployKey.key}\\n`);\n    }\n    if (result.publishKey) {\n      console.log(\n        `  ${colors.dim(\"Publish key:\")} ${result.publishKey.publicKey} ${colors.dim(\n          `(${result.publishKey.network}, exported to ${result.publishKey.exportedTo})`,\n        )}`,\n      );\n    }\n    if (result.custodyWallet) {\n      console.log(\n        `  ${colors.dim(\"Custody wallet:\")} ${result.custodyWallet.nearAccountId} ${colors.dim(\n          `(${result.custodyWallet.network})`,\n        )}`,\n      );\n      if (result.custodyWallet.handoffUrl) {\n        console.log(`  ${colors.dim(\"Policy & funding:\")} ${result.custodyWallet.handoffUrl}`);\n      }\n    }\n    if (result.outlayerCli?.status === \"linked\") {\n      console.log(\n        `  ${colors.dim(\"OutLayer CLI:\")} logged in on ${result.outlayerCli.network}${result.outlayerCli.detail ? ` — ${result.outlayerCli.detail.split(\"\\n\")[0]}` : \"\"}`,\n      );\n    } else if (result.outlayerCli?.status === \"cli-missing\") {\n      console.log(\n        colors.dim(\n          \"  OutLayer CLI not installed — cargo install outlayer-cli, then re-run `bos login --custody` to link it.\",\n        ),\n      );\n    }\n    console.log();\n    return;\n  },\n\n  logout: async (result, _ctx) => {\n    console.log();\n    console.log(colors.green(`${icons.ok} Logged out`));\n    if (result.revokedApiKey) console.log(`  ${colors.dim(\"Revoked API key\")}`);\n    if (result.removedPublishKey) console.log(`  ${colors.dim(\"Removed exported publish key\")}`);\n    if (result.warning) console.log(`  ${colors.yellow(\"⚠\")} ${result.warning}`);\n    console.log();\n    return;\n  },\n};\n"],"mappings":";;;AAGA,MAAa,qBAAqD;CAChE,OAAO,OAAO,QAAQ,SAAS;EAC7B,QAAQ,IAAI;EACZ,QAAQ,IAAI,OAAO,MAAM,GAAG,MAAM,GAAG,gBAAgB,OAAO,SAAS,CAAC;EACtE,IAAI,OAAO,WAAW,QAAQ,IAAI,KAAK,OAAO,IAAI,UAAU,EAAE,GAAG,OAAO,WAAW;EACnF,IAAI,OAAO,WAAW,QAAQ,IAAI,KAAK,OAAO,IAAI,UAAU,EAAE,GAAG,OAAO,WAAW;EACnF,IAAI,OAAO,SAAS,QAAQ,IAAI,KAAK,OAAO,OAAO,GAAG,EAAE,GAAG,OAAO,SAAS;EAC3E,IAAI,OAAO,WAAW;GACpB,QAAQ,IACN,KAAK,OAAO,IAAI,aAAa,EAAE,GAAG,OAAO,UAAU,QAAQ,GAAG,OAAO,UAAU,QAAQ,QAAQ,OAAO,aAAa,KAAK,OAAO,IAAI,mCAAmC,GACxK;GACA,IAAI,CAAC,QAAQ,OAAO,OAClB,QAAQ,OAAO,MACb,sHACF;GAEF,QAAQ,OAAO,MACb,iFACF;GACA,QAAQ,OAAO,MAAM,uBAAuB,OAAO,UAAU,IAAI,GAAG;EACtE;EACA,IAAI,OAAO,YACT,QAAQ,IACN,KAAK,OAAO,IAA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