#!/usr/bin/env node
import {c,g,h}from'./chunk-J32OPJEX.js';import'./chunk-XHJ27CER.js';import o from'chalk';async function y(r){let n=c();if(r.json){console.log(JSON.stringify(n,null,2));return}if(n.length===0){console.log(o.yellow('No trusted peers. Run "paradigm symphony serve" to accept connections.'));return}console.log(o.cyan(`
  Trusted Peers (${n.length})
`)),console.log(o.gray(`  ${"PEER ID".padEnd(20)} ${"ADDRESS".padEnd(22)} ${"STATUS".padEnd(10)} ${"AGENTS".padEnd(8)} LAST SEEN`)),console.log(o.gray(`  ${"\u2500".repeat(20)} ${"\u2500".repeat(22)} ${"\u2500".repeat(10)} ${"\u2500".repeat(8)} ${"\u2500".repeat(20)}`));for(let e of n){let t=e.revoked?o.red("revoked"):o.green("trusted"),g=(e.agents||[]).length.toString(),i=e.lastSeen?p(e.lastSeen):o.gray("never");if(console.log(`  ${o.white(e.id.padEnd(20))} ${e.address.padEnd(22)} ${t.padEnd(10)} ${g.padEnd(8)} ${i}`),e.agents&&e.agents.length>0)for(let l of e.agents){let d=l.status==="awake"?o.green("awake"):o.yellow("asleep");console.log(o.gray(`    \u2514 ${l.id} [${d}]`));}}console.log();}async function m(r){if(g(r))console.log(o.green(`\u2713 Revoked peer ${o.bold(r)}`)),console.log(o.gray("  Peer will be disconnected and cannot reconnect until re-paired."));else {console.log(o.red(`Peer "${r}" not found.`));let e=c();if(e.length>0){console.log(o.gray(`
  Available peers:`));for(let t of e)console.log(o.gray(`    ${t.id} (${t.address})`));}}}async function $(r){let n=c();if(n.length===0){console.log(o.yellow("No peers to forget."));return}if(!r.force){console.log(o.yellow(`This will remove all ${n.length} trusted peer(s). Use --force to confirm.`));return}let e=h();console.log(o.green(`\u2713 Forgot ${e} peer${e!==1?"s":""}`)),console.log(o.gray("  All peer trust records deleted. Re-pairing required for remote connections."));}function p(r){let n=Date.now()-new Date(r).getTime(),e=Math.floor(n/1e3);return e<60?"just now":e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}export{y as symphonyPeersCommand,$ as symphonyPeersForgetCommand,m as symphonyPeersRevokeCommand};