wyrm-mcp 7.3.2 → 7.3.3

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 (184) hide show
  1. package/README.md +8 -14
  2. package/dist/activation.js +59 -1
  3. package/dist/agent-daemon.js +281 -4
  4. package/dist/agent-loop.js +332 -7
  5. package/dist/analytics.js +236 -13
  6. package/dist/attribution.js +49 -1
  7. package/dist/audit.js +457 -2
  8. package/dist/auto-capture.js +138 -3
  9. package/dist/auto-orchestrator.js +325 -1
  10. package/dist/autoconfig.d.ts +50 -0
  11. package/dist/autoconfig.d.ts.map +1 -1
  12. package/dist/autoconfig.js +1115 -39
  13. package/dist/autoconfig.js.map +1 -1
  14. package/dist/buddy-runner.js +109 -1
  15. package/dist/buddy.js +564 -14
  16. package/dist/build-flags.js +15 -1
  17. package/dist/capabilities.js +183 -3
  18. package/dist/capture.js +56 -1
  19. package/dist/causality.js +148 -8
  20. package/dist/cli.js +281 -20
  21. package/dist/cloud/cli.js +541 -5
  22. package/dist/cloud/client.js +221 -1
  23. package/dist/cloud/crypto.js +85 -1
  24. package/dist/cloud/machine-id.js +113 -2
  25. package/dist/cloud/recovery.js +60 -1
  26. package/dist/cloud/sync-engine.js +543 -7
  27. package/dist/cloud-backup.js +579 -5
  28. package/dist/cloud-profile.js +138 -1
  29. package/dist/cloud-sync-entrypoint.js +47 -1
  30. package/dist/cloud-sync.js +309 -2
  31. package/dist/connectors/bridge-source.d.ts +46 -0
  32. package/dist/connectors/bridge-source.d.ts.map +1 -0
  33. package/dist/connectors/bridge-source.js +77 -0
  34. package/dist/connectors/bridge-source.js.map +1 -0
  35. package/dist/connectors/index.d.ts +24 -0
  36. package/dist/connectors/index.d.ts.map +1 -0
  37. package/dist/connectors/index.js +69 -0
  38. package/dist/connectors/index.js.map +1 -0
  39. package/dist/connectors/ingest.d.ts +16 -0
  40. package/dist/connectors/ingest.d.ts.map +1 -0
  41. package/dist/connectors/ingest.js +116 -0
  42. package/dist/connectors/ingest.js.map +1 -0
  43. package/dist/connectors/types.d.ts +99 -0
  44. package/dist/connectors/types.d.ts.map +1 -0
  45. package/dist/connectors/types.js +17 -0
  46. package/dist/connectors/types.js.map +1 -0
  47. package/dist/constellation.js +168 -12
  48. package/dist/content-signature.js +45 -1
  49. package/dist/context-build-budgeted.js +144 -4
  50. package/dist/context-ranking.js +69 -1
  51. package/dist/crypto.js +179 -1
  52. package/dist/daemon-write-endpoint.js +290 -1
  53. package/dist/daemon-writer.js +406 -2
  54. package/dist/database.js +1278 -53
  55. package/dist/deprecations.js +162 -2
  56. package/dist/design.js +141 -13
  57. package/dist/event-replication.js +112 -1
  58. package/dist/events-sse.js +43 -7
  59. package/dist/events.js +238 -6
  60. package/dist/failure-patterns.d.ts +107 -0
  61. package/dist/failure-patterns.d.ts.map +1 -1
  62. package/dist/failure-patterns.js +924 -43
  63. package/dist/failure-patterns.js.map +1 -1
  64. package/dist/federation.js +236 -12
  65. package/dist/goals.js +101 -13
  66. package/dist/golden.js +355 -3
  67. package/dist/handlers/agent.js +165 -4
  68. package/dist/handlers/alias-adapters.js +129 -1
  69. package/dist/handlers/aliases.js +171 -1
  70. package/dist/handlers/audit.js +87 -1
  71. package/dist/handlers/boundary.js +221 -1
  72. package/dist/handlers/capture.js +1114 -73
  73. package/dist/handlers/causality.js +119 -9
  74. package/dist/handlers/cloud.js +382 -85
  75. package/dist/handlers/companion.js +459 -28
  76. package/dist/handlers/datalake.js +187 -7
  77. package/dist/handlers/dispatch-context.js +22 -0
  78. package/dist/handlers/entity.js +256 -25
  79. package/dist/handlers/events.js +335 -16
  80. package/dist/handlers/failure.d.ts.map +1 -1
  81. package/dist/handlers/failure.js +408 -13
  82. package/dist/handlers/failure.js.map +1 -1
  83. package/dist/handlers/goals.js +296 -4
  84. package/dist/handlers/intelligence.js +681 -126
  85. package/dist/handlers/invoicing.js +70 -1
  86. package/dist/handlers/mcpclient.js +137 -6
  87. package/dist/handlers/orchestration.js +125 -40
  88. package/dist/handlers/output-schemas.js +24 -1
  89. package/dist/handlers/presence.js +99 -3
  90. package/dist/handlers/project.js +182 -28
  91. package/dist/handlers/prompts.js +157 -6
  92. package/dist/handlers/quest.js +224 -4
  93. package/dist/handlers/recall.js +237 -13
  94. package/dist/handlers/registry.js +167 -1
  95. package/dist/handlers/resources.js +288 -1
  96. package/dist/handlers/review.js +74 -11
  97. package/dist/handlers/run.js +498 -16
  98. package/dist/handlers/search.js +338 -15
  99. package/dist/handlers/session.js +643 -31
  100. package/dist/handlers/share.js +184 -8
  101. package/dist/handlers/shims.js +464 -1
  102. package/dist/handlers/skill.js +449 -67
  103. package/dist/handlers/survivors.js +120 -1
  104. package/dist/handlers/symbols.js +109 -8
  105. package/dist/handlers/syncops.js +302 -4
  106. package/dist/handlers/types.js +27 -1
  107. package/dist/harvest.js +191 -5
  108. package/dist/hours.js +156 -7
  109. package/dist/http-auth.js +321 -3
  110. package/dist/http-fast.js +1302 -22
  111. package/dist/icons.js +47 -1
  112. package/dist/importers.js +268 -1
  113. package/dist/index.js +840 -2
  114. package/dist/indexer.js +145 -4
  115. package/dist/intelligence.js +261 -31
  116. package/dist/internal-dispatch.js +212 -3
  117. package/dist/keyset.js +110 -1
  118. package/dist/knowledge-graph.js +176 -12
  119. package/dist/license.js +441 -2
  120. package/dist/logger.js +199 -2
  121. package/dist/maintenance.js +148 -2
  122. package/dist/mcp-client.js +262 -6
  123. package/dist/memory-artifacts.js +596 -32
  124. package/dist/migrate-prompt.js +124 -2
  125. package/dist/migrations.d.ts.map +1 -1
  126. package/dist/migrations.js +799 -42
  127. package/dist/migrations.js.map +1 -1
  128. package/dist/performance.js +228 -1
  129. package/dist/presence.js +140 -11
  130. package/dist/priority-embed.js +164 -5
  131. package/dist/providers/embedding-provider.js +196 -1
  132. package/dist/readonly-gate.js +29 -1
  133. package/dist/receipt.js +43 -1
  134. package/dist/rehydration.js +157 -9
  135. package/dist/reindex.js +88 -1
  136. package/dist/render-target.js +544 -21
  137. package/dist/render.js +280 -4
  138. package/dist/repl-guard.js +173 -1
  139. package/dist/replication-daemon-entrypoint.js +31 -1
  140. package/dist/replication-daemon.js +262 -2
  141. package/dist/rerank.js +142 -1
  142. package/dist/resilience.js +591 -1
  143. package/dist/reverse-bridge.js +360 -5
  144. package/dist/security.js +244 -1
  145. package/dist/session-seen.js +51 -3
  146. package/dist/setup.js +260 -1
  147. package/dist/skill-author.js +168 -5
  148. package/dist/spec-kit.js +191 -1
  149. package/dist/sqlite-busy.js +154 -1
  150. package/dist/statusline.js +315 -11
  151. package/dist/sub-agent.js +262 -13
  152. package/dist/summarizer.js +139 -13
  153. package/dist/symbols.js +283 -7
  154. package/dist/sync.js +359 -5
  155. package/dist/tasks-dispatch.js +84 -1
  156. package/dist/tasks.js +282 -1
  157. package/dist/token-budget.js +143 -1
  158. package/dist/tool-analytics.js +129 -7
  159. package/dist/tool-annotations.js +365 -1
  160. package/dist/tool-manifest-v2.json +1 -1
  161. package/dist/tool-manifest.json +1 -1
  162. package/dist/tool-profiles.js +75 -1
  163. package/dist/trace-harvest.js +244 -6
  164. package/dist/types.js +30 -1
  165. package/dist/ui-dashboard.js +50 -41
  166. package/dist/ulid.js +81 -1
  167. package/dist/usage-tracker.js +66 -1
  168. package/dist/validate.js +129 -1
  169. package/dist/vault.js +534 -1
  170. package/dist/vector-init.js +67 -1
  171. package/dist/vectors.js +184 -3
  172. package/dist/version-check.js +136 -4
  173. package/dist/visibility.js +155 -19
  174. package/dist/wyrm-cli.js +2845 -101
  175. package/dist/wyrm-cli.js.map +1 -1
  176. package/dist/wyrm-guard.d.ts.map +1 -1
  177. package/dist/wyrm-guard.js +475 -14
  178. package/dist/wyrm-guard.js.map +1 -1
  179. package/dist/wyrm-loop.js +150 -3
  180. package/dist/wyrm-manifest.json +1 -1
  181. package/dist/wyrm-statusline-daemon.js +11 -1
  182. package/dist/wyrm-statusline.js +56 -4
  183. package/dist/wyrm-ui.js +77 -9
  184. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,20 +1,281 @@
1
- const t={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m"},a={bold:e=>`${t.bold}${e}${t.reset}`,dim:e=>`${t.dim}${e}${t.reset}`,red:e=>`${t.red}${e}${t.reset}`,green:e=>`${t.green}${e}${t.reset}`,yellow:e=>`${t.yellow}${e}${t.reset}`,blue:e=>`${t.blue}${e}${t.reset}`,magenta:e=>`${t.magenta}${e}${t.reset}`,cyan:e=>`${t.cyan}${e}${t.reset}`,primary:e=>`${t.brightMagenta}${e}${t.reset}`,success:e=>`${t.brightGreen}${e}${t.reset}`,warning:e=>`${t.brightYellow}${e}${t.reset}`,error:e=>`${t.brightRed}${e}${t.reset}`},m={dragon:"\u{F115D}",fire:"\u{1F525}",scroll:"\u{1F4DC}",sword:"\u2694\uFE0F",shield:"\u{1F6E1}\uFE0F",treasure:"\u{1F48E}",quest:"\u{1F3AF}",check:"\u2713",cross:"\u2717",arrow:"\u2192",bullet:"\u2022",star:"\u2605",warning:"\u26A0\uFE0F",error:"\u274C",success:"\u2705",info:"\u2139\uFE0F",clock:"\u{1F550}",folder:"\u{1F4C1}",file:"\u{1F4C4}",lock:"\u{1F512}",unlock:"\u{1F513}",sync:"\u{1F504}",search:"\u{1F50D}",sparkle:"\u2728"},b={critical:"\u{1F534}",high:"\u{1F7E0}",medium:"\u{1F7E1}",low:"\u{1F7E2}"},u=`
2
- ${t.brightMagenta}\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557${t.reset}
3
- ${t.brightMagenta}\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551${t.reset}
4
- ${t.brightMagenta}\u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551${t.reset}
5
- ${t.brightMagenta}\u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2554\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551${t.reset}
6
- ${t.brightMagenta}\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551${t.reset}
7
- ${t.brightMagenta} \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D${t.reset}
8
- ${t.dim} Persistent AI Memory System v3.0.0${t.reset}
9
- ${t.dim} ghosts.lk${t.reset}
10
- `,x=`${t.brightMagenta}\u{F115D} Wyrm v3.0.0${t.reset}`;class f{frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];current=0;interval=null;text;constructor(r="Loading..."){this.text=r}start(){this.interval=setInterval(()=>{process.stdout.write(`\r${t.cyan}${this.frames[this.current]}${t.reset} ${this.text}`),this.current=(this.current+1)%this.frames.length},80)}update(r){this.text=r}succeed(r){this.stop(),console.log(`\r${a.success("\u2713")} ${r||this.text}`)}fail(r){this.stop(),console.log(`\r${a.error("\u2717")} ${r||this.text}`)}warn(r){this.stop(),console.log(`\r${a.warning("!")} ${r||this.text}`)}stop(){this.interval&&(clearInterval(this.interval),this.interval=null,process.stdout.write("\r\x1B[K"))}}class M{total;current=0;width;label;constructor(r,n="Progress",s=30){this.total=r,this.width=s,this.label=n}update(r,n){this.current=r,n&&(this.label=n),this.render()}increment(r){this.update(this.current+1,r)}render(){const r=Math.min(100,Math.floor(this.current/this.total*100)),n=Math.floor(this.current/this.total*this.width),s=this.width-n,o=`${t.brightMagenta}${"\u2588".repeat(n)}${t.dim}${"\u2591".repeat(s)}${t.reset}`,i=`${r}%`.padStart(4);process.stdout.write(`\r${this.label} ${o} ${i} (${this.current}/${this.total})`)}complete(){this.update(this.total),console.log()}}function w(e,r,n={}){const{padding:s=2,border:o=!0}=n,i=e.map(($,l)=>{const g=Math.max(...r.map(p=>(p[l]||"").length));return Math.max($.length,g)}),c=($,l)=>$.padEnd(l),d=i.map($=>"\u2500".repeat($+s)).join(o?"\u253C":" ");let h="";o&&(h+=`${t.dim}\u250C${i.map($=>"\u2500".repeat($+s)).join("\u252C")}\u2510${t.reset}
11
- `),h+=(o?`${t.dim}\u2502${t.reset}`:"")+e.map(($,l)=>` ${a.bold(c($,i[l]))} `).join(o?`${t.dim}\u2502${t.reset}`:"")+(o?`${t.dim}\u2502${t.reset}`:"")+`
12
- `,o&&(h+=`${t.dim}\u251C${d}\u2524${t.reset}
13
- `);for(const $ of r)h+=(o?`${t.dim}\u2502${t.reset}`:"")+$.map((l,g)=>` ${c(l||"",i[g])} `).join(o?`${t.dim}\u2502${t.reset}`:"")+(o?`${t.dim}\u2502${t.reset}`:"")+`
14
- `;return o&&(h+=`${t.dim}\u2514${i.map($=>"\u2500".repeat($+s)).join("\u2534")}\u2518${t.reset}`),h}function y(e,r,n=50){const s=r.split(`
15
- `),o=Math.max(e.length,...s.map(c=>c.length),n);let i=`${t.dim}\u256D${"\u2500".repeat(o+2)}\u256E${t.reset}
16
- `;i+=`${t.dim}\u2502${t.reset} ${a.bold(e.padEnd(o))} ${t.dim}\u2502${t.reset}
17
- `,i+=`${t.dim}\u251C${"\u2500".repeat(o+2)}\u2524${t.reset}
18
- `;for(const c of s)i+=`${t.dim}\u2502${t.reset} ${c.padEnd(o)} ${t.dim}\u2502${t.reset}
19
- `;return i+=`${t.dim}\u2570${"\u2500".repeat(o+2)}\u256F${t.reset}`,i}function B(e){if(e===0)return"0 B";const r=1024,n=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(r));return`${(e/Math.pow(r,s)).toFixed(2)} ${n[s]}`}function v(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`:`${Math.floor(e/36e5)}h ${Math.floor(e%36e5/6e4)}m`}function k(e){console.log(`
20
- ${a.bold(a.primary(`\u25B6 ${e}`))}`),console.log(`${t.dim}${"\u2500".repeat(e.length+4)}${t.reset}`)}function I(e){console.log(`${m.success} ${a.success(e)}`)}function E(e){console.log(`${m.error} ${a.error(e)}`)}function R(e){console.log(`${m.warning} ${a.warning(e)}`)}function S(e){console.log(`${m.info} ${e}`)}export{u as BANNER,x as MINI_BANNER,M as ProgressBar,f as Spinner,a as c,t as colors,y as formatBox,B as formatBytes,v as formatDuration,w as formatTable,m as icons,E as printError,S as printInfo,k as printSection,I as printSuccess,R as printWarning,b as priorityIcons};
1
+ /**
2
+ * Wyrm CLI - Beautiful command-line interface
3
+ *
4
+ * @copyright 2026 Ghost Protocol (Pvt) Ltd.
5
+ * @license Proprietary — (c) 2026 Ghost Protocol (Pvt) Ltd. All rights reserved. See LICENSE.
6
+ * @module cli
7
+ * @version 3.0.0
8
+ */
9
+ // ANSI color codes
10
+ export const colors = {
11
+ // Reset
12
+ reset: '\x1b[0m',
13
+ // Styles
14
+ bold: '\x1b[1m',
15
+ dim: '\x1b[2m',
16
+ italic: '\x1b[3m',
17
+ underline: '\x1b[4m',
18
+ // Colors
19
+ black: '\x1b[30m',
20
+ red: '\x1b[31m',
21
+ green: '\x1b[32m',
22
+ yellow: '\x1b[33m',
23
+ blue: '\x1b[34m',
24
+ magenta: '\x1b[35m',
25
+ cyan: '\x1b[36m',
26
+ white: '\x1b[37m',
27
+ // Bright colors
28
+ brightRed: '\x1b[91m',
29
+ brightGreen: '\x1b[92m',
30
+ brightYellow: '\x1b[93m',
31
+ brightBlue: '\x1b[94m',
32
+ brightMagenta: '\x1b[95m',
33
+ brightCyan: '\x1b[96m',
34
+ // Background
35
+ bgRed: '\x1b[41m',
36
+ bgGreen: '\x1b[42m',
37
+ bgYellow: '\x1b[43m',
38
+ bgBlue: '\x1b[44m',
39
+ bgMagenta: '\x1b[45m',
40
+ bgCyan: '\x1b[46m',
41
+ };
42
+ // Helper functions
43
+ export const c = {
44
+ bold: (s) => `${colors.bold}${s}${colors.reset}`,
45
+ dim: (s) => `${colors.dim}${s}${colors.reset}`,
46
+ red: (s) => `${colors.red}${s}${colors.reset}`,
47
+ green: (s) => `${colors.green}${s}${colors.reset}`,
48
+ yellow: (s) => `${colors.yellow}${s}${colors.reset}`,
49
+ blue: (s) => `${colors.blue}${s}${colors.reset}`,
50
+ magenta: (s) => `${colors.magenta}${s}${colors.reset}`,
51
+ cyan: (s) => `${colors.cyan}${s}${colors.reset}`,
52
+ primary: (s) => `${colors.brightMagenta}${s}${colors.reset}`,
53
+ success: (s) => `${colors.brightGreen}${s}${colors.reset}`,
54
+ warning: (s) => `${colors.brightYellow}${s}${colors.reset}`,
55
+ error: (s) => `${colors.brightRed}${s}${colors.reset}`,
56
+ };
57
+ // Icons
58
+ export const icons = {
59
+ dragon: '󱅝',
60
+ fire: '🔥',
61
+ scroll: '📜',
62
+ sword: '⚔️',
63
+ shield: '🛡️',
64
+ treasure: '💎',
65
+ quest: '🎯',
66
+ check: '✓',
67
+ cross: '✗',
68
+ arrow: '→',
69
+ bullet: '•',
70
+ star: '★',
71
+ warning: '⚠️',
72
+ error: '❌',
73
+ success: '✅',
74
+ info: 'ℹ️',
75
+ clock: '🕐',
76
+ folder: '📁',
77
+ file: '📄',
78
+ lock: '🔒',
79
+ unlock: '🔓',
80
+ sync: '🔄',
81
+ search: '🔍',
82
+ sparkle: '✨',
83
+ };
84
+ // Priority icons
85
+ export const priorityIcons = {
86
+ critical: '🔴',
87
+ high: '🟠',
88
+ medium: '🟡',
89
+ low: '🟢',
90
+ };
91
+ // ASCII art banner
92
+ export const BANNER = `
93
+ ${colors.brightMagenta}██╗ ██╗██╗ ██╗██████╗ ███╗ ███╗${colors.reset}
94
+ ${colors.brightMagenta}██║ ██║╚██╗ ██╔╝██╔══██╗████╗ ████║${colors.reset}
95
+ ${colors.brightMagenta}██║ █╗ ██║ ╚████╔╝ ██████╔╝██╔████╔██║${colors.reset}
96
+ ${colors.brightMagenta}██║███╗██║ ╚██╔╝ ██╔══██╗██║╚██╔╝██║${colors.reset}
97
+ ${colors.brightMagenta}╚███╔███╔╝ ██║ ██║ ██║██║ ╚═╝ ██║${colors.reset}
98
+ ${colors.brightMagenta} ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝${colors.reset}
99
+ ${colors.dim} Persistent AI Memory System v3.0.0${colors.reset}
100
+ ${colors.dim} ghosts.lk${colors.reset}
101
+ `;
102
+ export const MINI_BANNER = `${colors.brightMagenta}󱅝 Wyrm v3.0.0${colors.reset}`;
103
+ /**
104
+ * Progress spinner
105
+ */
106
+ export class Spinner {
107
+ frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
108
+ current = 0;
109
+ interval = null;
110
+ text;
111
+ constructor(text = 'Loading...') {
112
+ this.text = text;
113
+ }
114
+ start() {
115
+ this.interval = setInterval(() => {
116
+ process.stdout.write(`\r${colors.cyan}${this.frames[this.current]}${colors.reset} ${this.text}`);
117
+ this.current = (this.current + 1) % this.frames.length;
118
+ }, 80);
119
+ }
120
+ update(text) {
121
+ this.text = text;
122
+ }
123
+ succeed(text) {
124
+ this.stop();
125
+ console.log(`\r${c.success('✓')} ${text || this.text}`);
126
+ }
127
+ fail(text) {
128
+ this.stop();
129
+ console.log(`\r${c.error('✗')} ${text || this.text}`);
130
+ }
131
+ warn(text) {
132
+ this.stop();
133
+ console.log(`\r${c.warning('!')} ${text || this.text}`);
134
+ }
135
+ stop() {
136
+ if (this.interval) {
137
+ clearInterval(this.interval);
138
+ this.interval = null;
139
+ process.stdout.write('\r\x1b[K'); // Clear line
140
+ }
141
+ }
142
+ }
143
+ /**
144
+ * Progress bar
145
+ */
146
+ export class ProgressBar {
147
+ total;
148
+ current = 0;
149
+ width;
150
+ label;
151
+ constructor(total, label = 'Progress', width = 30) {
152
+ this.total = total;
153
+ this.width = width;
154
+ this.label = label;
155
+ }
156
+ update(current, label) {
157
+ this.current = current;
158
+ if (label)
159
+ this.label = label;
160
+ this.render();
161
+ }
162
+ increment(label) {
163
+ this.update(this.current + 1, label);
164
+ }
165
+ render() {
166
+ const percent = Math.min(100, Math.floor((this.current / this.total) * 100));
167
+ const filled = Math.floor((this.current / this.total) * this.width);
168
+ const empty = this.width - filled;
169
+ const bar = `${colors.brightMagenta}${'█'.repeat(filled)}${colors.dim}${'░'.repeat(empty)}${colors.reset}`;
170
+ const percentStr = `${percent}%`.padStart(4);
171
+ process.stdout.write(`\r${this.label} ${bar} ${percentStr} (${this.current}/${this.total})`);
172
+ }
173
+ complete() {
174
+ this.update(this.total);
175
+ console.log(); // New line
176
+ }
177
+ }
178
+ /**
179
+ * Table formatter
180
+ */
181
+ export function formatTable(headers, rows, options = {}) {
182
+ const { padding = 2, border = true } = options;
183
+ // Calculate column widths
184
+ const widths = headers.map((h, i) => {
185
+ const maxRow = Math.max(...rows.map(r => (r[i] || '').length));
186
+ return Math.max(h.length, maxRow);
187
+ });
188
+ const pad = (s, w) => s.padEnd(w);
189
+ const sep = widths.map(w => '─'.repeat(w + padding)).join(border ? '┼' : ' ');
190
+ let output = '';
191
+ // Header
192
+ if (border) {
193
+ output += `${colors.dim}┌${widths.map(w => '─'.repeat(w + padding)).join('┬')}┐${colors.reset}\n`;
194
+ }
195
+ output += (border ? `${colors.dim}│${colors.reset}` : '') +
196
+ headers.map((h, i) => ` ${c.bold(pad(h, widths[i]))} `).join(border ? `${colors.dim}│${colors.reset}` : '') +
197
+ (border ? `${colors.dim}│${colors.reset}` : '') + '\n';
198
+ if (border) {
199
+ output += `${colors.dim}├${sep}┤${colors.reset}\n`;
200
+ }
201
+ // Rows
202
+ for (const row of rows) {
203
+ output += (border ? `${colors.dim}│${colors.reset}` : '') +
204
+ row.map((cell, i) => ` ${pad(cell || '', widths[i])} `).join(border ? `${colors.dim}│${colors.reset}` : '') +
205
+ (border ? `${colors.dim}│${colors.reset}` : '') + '\n';
206
+ }
207
+ if (border) {
208
+ output += `${colors.dim}└${widths.map(w => '─'.repeat(w + padding)).join('┴')}┘${colors.reset}`;
209
+ }
210
+ return output;
211
+ }
212
+ /**
213
+ * Box formatter
214
+ */
215
+ export function formatBox(title, content, width = 50) {
216
+ const lines = content.split('\n');
217
+ const maxLen = Math.max(title.length, ...lines.map(l => l.length), width);
218
+ let output = `${colors.dim}╭${'─'.repeat(maxLen + 2)}╮${colors.reset}\n`;
219
+ output += `${colors.dim}│${colors.reset} ${c.bold(title.padEnd(maxLen))} ${colors.dim}│${colors.reset}\n`;
220
+ output += `${colors.dim}├${'─'.repeat(maxLen + 2)}┤${colors.reset}\n`;
221
+ for (const line of lines) {
222
+ output += `${colors.dim}│${colors.reset} ${line.padEnd(maxLen)} ${colors.dim}│${colors.reset}\n`;
223
+ }
224
+ output += `${colors.dim}╰${'─'.repeat(maxLen + 2)}╯${colors.reset}`;
225
+ return output;
226
+ }
227
+ /**
228
+ * Format bytes to human readable
229
+ */
230
+ export function formatBytes(bytes) {
231
+ if (bytes === 0)
232
+ return '0 B';
233
+ const k = 1024;
234
+ const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
235
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
236
+ return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;
237
+ }
238
+ /**
239
+ * Format duration
240
+ */
241
+ export function formatDuration(ms) {
242
+ if (ms < 1000)
243
+ return `${ms}ms`;
244
+ if (ms < 60000)
245
+ return `${(ms / 1000).toFixed(1)}s`;
246
+ if (ms < 3600000)
247
+ return `${Math.floor(ms / 60000)}m ${Math.floor((ms % 60000) / 1000)}s`;
248
+ return `${Math.floor(ms / 3600000)}h ${Math.floor((ms % 3600000) / 60000)}m`;
249
+ }
250
+ /**
251
+ * Print section header
252
+ */
253
+ export function printSection(title) {
254
+ console.log(`\n${c.bold(c.primary(`▶ ${title}`))}`);
255
+ console.log(`${colors.dim}${'─'.repeat(title.length + 4)}${colors.reset}`);
256
+ }
257
+ /**
258
+ * Print success message
259
+ */
260
+ export function printSuccess(message) {
261
+ console.log(`${icons.success} ${c.success(message)}`);
262
+ }
263
+ /**
264
+ * Print error message
265
+ */
266
+ export function printError(message) {
267
+ console.log(`${icons.error} ${c.error(message)}`);
268
+ }
269
+ /**
270
+ * Print warning message
271
+ */
272
+ export function printWarning(message) {
273
+ console.log(`${icons.warning} ${c.warning(message)}`);
274
+ }
275
+ /**
276
+ * Print info message
277
+ */
278
+ export function printInfo(message) {
279
+ console.log(`${icons.info} ${message}`);
280
+ }
281
+ //# sourceMappingURL=cli.js.map