@mks2508/better-logger 0.14.0-alpha.2 → 0.18.2-alpha.1

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 (454) hide show
  1. package/README.md +289 -185
  2. package/dist/Logger.d.ts +576 -205
  3. package/dist/Logger.d.ts.map +1 -1
  4. package/dist/ScopedLogger.d.ts +48 -292
  5. package/dist/ScopedLogger.d.ts.map +1 -1
  6. package/dist/chunks/HookBridge-CiRfR67f.cjs +190 -0
  7. package/dist/chunks/HookBridge-CiRfR67f.cjs.map +1 -0
  8. package/dist/chunks/HookBridge-SgMmbXZB.js +173 -0
  9. package/dist/chunks/HookBridge-SgMmbXZB.js.map +1 -0
  10. package/dist/chunks/LogContext-Cwn-1Zzb.js +85 -0
  11. package/dist/chunks/LogContext-Cwn-1Zzb.js.map +1 -0
  12. package/dist/chunks/LogContext-L7HzynFw.cjs +90 -0
  13. package/dist/chunks/LogContext-L7HzynFw.cjs.map +1 -0
  14. package/dist/chunks/SerializerBridge-BaOQOb8q.cjs +166 -0
  15. package/dist/chunks/SerializerBridge-BaOQOb8q.cjs.map +1 -0
  16. package/dist/chunks/SerializerBridge-BkpQu5c9.js +149 -0
  17. package/dist/chunks/SerializerBridge-BkpQu5c9.js.map +1 -0
  18. package/dist/chunks/StyleManager-CIpd6wbO.cjs +92 -0
  19. package/dist/chunks/StyleManager-CIpd6wbO.cjs.map +1 -0
  20. package/dist/chunks/StyleManager-LCvVlVdx.js +87 -0
  21. package/dist/chunks/StyleManager-LCvVlVdx.js.map +1 -0
  22. package/dist/chunks/core-Dzz7agGa.cjs +39 -0
  23. package/dist/chunks/core-Dzz7agGa.cjs.map +1 -0
  24. package/dist/chunks/core-PoT7RrTK.js +34 -0
  25. package/dist/chunks/core-PoT7RrTK.js.map +1 -0
  26. package/dist/chunks/environment-detector-CI3TrWK_.js +110 -0
  27. package/dist/chunks/environment-detector-CI3TrWK_.js.map +1 -0
  28. package/dist/chunks/environment-detector-Cnn6wr6O.cjs +163 -0
  29. package/dist/chunks/environment-detector-Cnn6wr6O.cjs.map +1 -0
  30. package/dist/chunks/server-fallback-BUKjdLS7.cjs +42 -0
  31. package/dist/chunks/server-fallback-BUKjdLS7.cjs.map +1 -0
  32. package/dist/chunks/server-fallback-BsuWH1Dk.js +37 -0
  33. package/dist/chunks/server-fallback-BsuWH1Dk.js.map +1 -0
  34. package/dist/chunks/spinner-D3FsF78o.js +700 -0
  35. package/dist/chunks/spinner-D3FsF78o.js.map +1 -0
  36. package/dist/chunks/spinner-DNvxbM9a.cjs +747 -0
  37. package/dist/chunks/spinner-DNvxbM9a.cjs.map +1 -0
  38. package/dist/chunks/styling-84N8T97t.js +941 -0
  39. package/dist/chunks/styling-84N8T97t.js.map +1 -0
  40. package/dist/chunks/styling-Cg5saQ46.cjs +994 -0
  41. package/dist/chunks/styling-Cg5saQ46.cjs.map +1 -0
  42. package/dist/chunks/transports-BiDk345e.js +715 -0
  43. package/dist/chunks/transports-BiDk345e.js.map +1 -0
  44. package/dist/chunks/transports-COPWmlF1.cjs +756 -0
  45. package/dist/chunks/transports-COPWmlF1.cjs.map +1 -0
  46. package/dist/chunks/utils-BqlFYocD.cjs +698 -0
  47. package/dist/chunks/utils-BqlFYocD.cjs.map +1 -0
  48. package/dist/chunks/utils-VETbVpkR.js +579 -0
  49. package/dist/chunks/utils-VETbVpkR.js.map +1 -0
  50. package/dist/cli/commands/ExportCommand.d.ts +8 -26
  51. package/dist/cli/commands/ExportCommand.d.ts.map +1 -1
  52. package/dist/cli/index.d.ts +1 -2
  53. package/dist/cli/index.d.ts.map +1 -1
  54. package/dist/cli-module.d.ts +13 -0
  55. package/dist/cli-module.d.ts.map +1 -0
  56. package/dist/cli.cjs +11 -0
  57. package/dist/cli.js +3 -0
  58. package/dist/constants.d.ts +16 -47
  59. package/dist/constants.d.ts.map +1 -1
  60. package/dist/context/LogContext.d.ts +146 -0
  61. package/dist/context/LogContext.d.ts.map +1 -0
  62. package/dist/context/index.d.ts +6 -0
  63. package/dist/context/index.d.ts.map +1 -0
  64. package/dist/context-module.d.ts +6 -0
  65. package/dist/context-module.d.ts.map +1 -0
  66. package/dist/context.cjs +3 -0
  67. package/dist/context.js +2 -0
  68. package/dist/core.cjs +281 -2
  69. package/dist/core.cjs.map +1 -1
  70. package/dist/core.d.ts +6 -7
  71. package/dist/core.d.ts.map +1 -1
  72. package/dist/core.js +258 -314
  73. package/dist/core.js.map +1 -1
  74. package/dist/example.d.ts.map +1 -1
  75. package/dist/hooks/HookBridge.d.ts +26 -0
  76. package/dist/hooks/HookBridge.d.ts.map +1 -0
  77. package/dist/hooks/HookManager.d.ts +26 -0
  78. package/dist/hooks/HookManager.d.ts.map +1 -0
  79. package/dist/hooks/index.d.ts +7 -0
  80. package/dist/hooks/index.d.ts.map +1 -0
  81. package/dist/hooks-module.d.ts +7 -0
  82. package/dist/hooks-module.d.ts.map +1 -0
  83. package/dist/hooks.cjs +5 -0
  84. package/dist/hooks.js +2 -0
  85. package/dist/index.cjs +2522 -2
  86. package/dist/index.cjs.map +1 -1
  87. package/dist/index.d.ts +42 -130
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +2447 -158
  90. package/dist/index.js.map +1 -1
  91. package/dist/node-module.d.ts +10 -0
  92. package/dist/node-module.d.ts.map +1 -0
  93. package/dist/node.cjs +13 -0
  94. package/dist/node.cjs.map +1 -0
  95. package/dist/node.js +12 -0
  96. package/dist/node.js.map +1 -0
  97. package/dist/playground/TerminalBridge.d.ts +46 -0
  98. package/dist/playground/TerminalBridge.d.ts.map +1 -0
  99. package/dist/playground/box.d.ts +14 -0
  100. package/dist/playground/box.d.ts.map +1 -0
  101. package/dist/playground/cli-table.d.ts +14 -0
  102. package/dist/playground/cli-table.d.ts.map +1 -0
  103. package/dist/playground/divider.d.ts +10 -0
  104. package/dist/playground/divider.d.ts.map +1 -0
  105. package/dist/playground/header.d.ts +11 -0
  106. package/dist/playground/header.d.ts.map +1 -0
  107. package/dist/playground/index.d.ts +11 -0
  108. package/dist/playground/index.d.ts.map +1 -0
  109. package/dist/playground/server-fallback.d.ts +27 -0
  110. package/dist/playground/server-fallback.d.ts.map +1 -0
  111. package/dist/playground/spinner.d.ts +48 -0
  112. package/dist/playground/spinner.d.ts.map +1 -0
  113. package/dist/playground/step.d.ts +14 -0
  114. package/dist/playground/step.d.ts.map +1 -0
  115. package/dist/playground-module.d.ts +11 -0
  116. package/dist/playground-module.d.ts.map +1 -0
  117. package/dist/playground.cjs +9 -0
  118. package/dist/playground.js +2 -0
  119. package/dist/serializers/SerializerBridge.d.ts +21 -0
  120. package/dist/serializers/SerializerBridge.d.ts.map +1 -0
  121. package/dist/serializers/SerializerRegistry.d.ts +16 -0
  122. package/dist/serializers/SerializerRegistry.d.ts.map +1 -0
  123. package/dist/serializers/index.d.ts +7 -0
  124. package/dist/serializers/index.d.ts.map +1 -0
  125. package/dist/serializers-module.d.ts +7 -0
  126. package/dist/serializers-module.d.ts.map +1 -0
  127. package/dist/serializers.cjs +5 -0
  128. package/dist/serializers.js +2 -0
  129. package/dist/styles/StyleManager.d.ts +83 -0
  130. package/dist/styles/StyleManager.d.ts.map +1 -0
  131. package/dist/styles/index.d.ts +7 -0
  132. package/dist/styles/index.d.ts.map +1 -0
  133. package/dist/styles-module.d.ts +7 -0
  134. package/dist/styles-module.d.ts.map +1 -0
  135. package/dist/styles.cjs +7 -0
  136. package/dist/styles.js +3 -0
  137. package/dist/styling/banners.d.ts +6 -2
  138. package/dist/styling/banners.d.ts.map +1 -1
  139. package/dist/styling/index.d.ts +8 -3
  140. package/dist/styling/index.d.ts.map +1 -1
  141. package/dist/terminal/color-converter.d.ts +73 -0
  142. package/dist/terminal/color-converter.d.ts.map +1 -0
  143. package/dist/terminal/formatter.d.ts +23 -0
  144. package/dist/terminal/formatter.d.ts.map +1 -0
  145. package/dist/transports/ConsoleTransport.d.ts +9 -0
  146. package/dist/transports/ConsoleTransport.d.ts.map +1 -0
  147. package/dist/transports/FileTransport.d.ts +56 -0
  148. package/dist/transports/FileTransport.d.ts.map +1 -0
  149. package/dist/transports/HttpTransport.d.ts +67 -0
  150. package/dist/transports/HttpTransport.d.ts.map +1 -0
  151. package/dist/transports/OtlpTransport.d.ts +148 -0
  152. package/dist/transports/OtlpTransport.d.ts.map +1 -0
  153. package/dist/transports/TransportBridge.d.ts +37 -0
  154. package/dist/transports/TransportBridge.d.ts.map +1 -0
  155. package/dist/transports/TransportManager.d.ts +36 -0
  156. package/dist/transports/TransportManager.d.ts.map +1 -0
  157. package/dist/transports/index.d.ts +6 -0
  158. package/dist/transports/index.d.ts.map +1 -0
  159. package/dist/transports-module.d.ts +10 -0
  160. package/dist/transports-module.d.ts.map +1 -0
  161. package/dist/transports.cjs +7 -0
  162. package/dist/transports.js +2 -0
  163. package/dist/types/core.d.ts +188 -6
  164. package/dist/types/core.d.ts.map +1 -1
  165. package/dist/types/handlers.d.ts +0 -67
  166. package/dist/types/handlers.d.ts.map +1 -1
  167. package/dist/types/hooks.d.ts +60 -0
  168. package/dist/types/hooks.d.ts.map +1 -0
  169. package/dist/types/index.d.ts +7 -3
  170. package/dist/types/index.d.ts.map +1 -1
  171. package/dist/types/serializers.d.ts +25 -0
  172. package/dist/types/serializers.d.ts.map +1 -0
  173. package/dist/types/transports.d.ts +127 -0
  174. package/dist/types/transports.d.ts.map +1 -0
  175. package/dist/utils/ansi-colors.d.ts +115 -0
  176. package/dist/utils/ansi-colors.d.ts.map +1 -0
  177. package/dist/utils/environment-detector.d.ts +53 -0
  178. package/dist/utils/environment-detector.d.ts.map +1 -0
  179. package/dist/utils/formatting.d.ts +1 -0
  180. package/dist/utils/formatting.d.ts.map +1 -1
  181. package/dist/utils/index.d.ts +3 -2
  182. package/dist/utils/index.d.ts.map +1 -1
  183. package/dist/utils/output.d.ts +8 -11
  184. package/dist/utils/output.d.ts.map +1 -1
  185. package/dist/utils/stackTrace.d.ts.map +1 -1
  186. package/dist/utils/timestamps.d.ts +0 -12
  187. package/dist/utils/timestamps.d.ts.map +1 -1
  188. package/package.json +96 -21
  189. package/.claude/settings.local.json +0 -39
  190. package/.github/workflows/ci-quality.yml +0 -357
  191. package/.github/workflows/docs-demo.yml +0 -119
  192. package/.github/workflows/releases-core.yml +0 -512
  193. package/.github/workflows/releases-full.yml +0 -582
  194. package/.github/workflows-backup/ci.yml +0 -221
  195. package/.github/workflows-backup/nightly.yml +0 -196
  196. package/.github/workflows-backup/release-optimized.yml +0 -373
  197. package/.github/workflows-backup/release.yml +0 -269
  198. package/.release-notes-0.2.0.md +0 -129
  199. package/.yamllint +0 -28
  200. package/CHANGELOG.json +0 -865
  201. package/CLAUDE.md +0 -204
  202. package/bun.lock +0 -323
  203. package/demo.html +0 -847
  204. package/dist/.tsbuildinfo +0 -1
  205. package/dist/Logger.js +0 -1124
  206. package/dist/ScopedLogger.js +0 -426
  207. package/dist/chunks/Logger-Crw1woqR.js +0 -3464
  208. package/dist/chunks/Logger-Crw1woqR.js.map +0 -1
  209. package/dist/chunks/Logger-D_p3xnbq.js +0 -2
  210. package/dist/chunks/Logger-D_p3xnbq.js.map +0 -1
  211. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +0 -33
  212. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +0 -1
  213. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +0 -2
  214. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +0 -1
  215. package/dist/chunks/environment-Bxbnw4pd.js +0 -544
  216. package/dist/chunks/environment-Bxbnw4pd.js.map +0 -1
  217. package/dist/chunks/environment-Dm66zOML.js +0 -4
  218. package/dist/chunks/environment-Dm66zOML.js.map +0 -1
  219. package/dist/chunks/formatting-C0riPC5_.js +0 -95
  220. package/dist/chunks/formatting-C0riPC5_.js.map +0 -1
  221. package/dist/chunks/formatting-DNCAV66-.js +0 -2
  222. package/dist/chunks/formatting-DNCAV66-.js.map +0 -1
  223. package/dist/cli/CommandProcessor.js +0 -184
  224. package/dist/cli/commands/ConfigCommand.js +0 -88
  225. package/dist/cli/commands/ExportCommand.js +0 -243
  226. package/dist/cli/commands/HistoryCommand.d.ts +0 -50
  227. package/dist/cli/commands/HistoryCommand.d.ts.map +0 -1
  228. package/dist/cli/commands/HistoryCommand.js +0 -96
  229. package/dist/cli/commands/StatusCommand.d.ts +0 -33
  230. package/dist/cli/commands/StatusCommand.d.ts.map +0 -1
  231. package/dist/cli/commands/StatusCommand.js +0 -93
  232. package/dist/cli/commands/ThemeCommand.js +0 -79
  233. package/dist/cli/help.js +0 -118
  234. package/dist/cli/index.js +0 -46
  235. package/dist/constants.js +0 -159
  236. package/dist/example.js +0 -154
  237. package/dist/exports-module.d.ts +0 -203
  238. package/dist/exports-module.d.ts.map +0 -1
  239. package/dist/exports-module.js +0 -260
  240. package/dist/exports.cjs +0 -2
  241. package/dist/exports.cjs.map +0 -1
  242. package/dist/exports.js +0 -238
  243. package/dist/exports.js.map +0 -1
  244. package/dist/handlers/AnalyticsLogHandler.d.ts +0 -11
  245. package/dist/handlers/AnalyticsLogHandler.d.ts.map +0 -1
  246. package/dist/handlers/AnalyticsLogHandler.js +0 -19
  247. package/dist/handlers/ExportLogHandler.d.ts +0 -103
  248. package/dist/handlers/ExportLogHandler.d.ts.map +0 -1
  249. package/dist/handlers/ExportLogHandler.js +0 -516
  250. package/dist/handlers/FileLogHandler.d.ts +0 -36
  251. package/dist/handlers/FileLogHandler.d.ts.map +0 -1
  252. package/dist/handlers/FileLogHandler.js +0 -156
  253. package/dist/handlers/RemoteLogHandler.d.ts +0 -14
  254. package/dist/handlers/RemoteLogHandler.d.ts.map +0 -1
  255. package/dist/handlers/RemoteLogHandler.js +0 -37
  256. package/dist/handlers/index.d.ts +0 -8
  257. package/dist/handlers/index.d.ts.map +0 -1
  258. package/dist/handlers/index.js +0 -7
  259. package/dist/main.js +0 -139
  260. package/dist/styling/LogStyleBuilder.d.ts +0 -149
  261. package/dist/styling/LogStyleBuilder.d.ts.map +0 -1
  262. package/dist/styling/LogStyleBuilder.js +0 -289
  263. package/dist/styling/SemanticStyles.d.ts +0 -181
  264. package/dist/styling/SemanticStyles.d.ts.map +0 -1
  265. package/dist/styling/SemanticStyles.js +0 -339
  266. package/dist/styling/SmartPresets.js +0 -276
  267. package/dist/styling/StyleBuilder.js +0 -280
  268. package/dist/styling/banners.js +0 -155
  269. package/dist/styling/index.js +0 -9
  270. package/dist/styling/themes.js +0 -231
  271. package/dist/styling-module.d.ts +0 -185
  272. package/dist/styling-module.d.ts.map +0 -1
  273. package/dist/styling-module.js +0 -199
  274. package/dist/styling.cjs +0 -2
  275. package/dist/styling.cjs.map +0 -1
  276. package/dist/styling.js +0 -146
  277. package/dist/styling.js.map +0 -1
  278. package/dist/types/Logger.d.ts +0 -700
  279. package/dist/types/Logger.d.ts.map +0 -1
  280. package/dist/types/ScopedLogger.d.ts +0 -310
  281. package/dist/types/ScopedLogger.d.ts.map +0 -1
  282. package/dist/types/cli/CommandProcessor.d.ts +0 -100
  283. package/dist/types/cli/CommandProcessor.d.ts.map +0 -1
  284. package/dist/types/cli/commands/ConfigCommand.d.ts +0 -14
  285. package/dist/types/cli/commands/ConfigCommand.d.ts.map +0 -1
  286. package/dist/types/cli/commands/ExportCommand.d.ts +0 -48
  287. package/dist/types/cli/commands/ExportCommand.d.ts.map +0 -1
  288. package/dist/types/cli/commands/HistoryCommand.d.ts +0 -47
  289. package/dist/types/cli/commands/HistoryCommand.d.ts.map +0 -1
  290. package/dist/types/cli/commands/StatusCommand.d.ts +0 -30
  291. package/dist/types/cli/commands/StatusCommand.d.ts.map +0 -1
  292. package/dist/types/cli/commands/ThemeCommand.d.ts +0 -30
  293. package/dist/types/cli/commands/ThemeCommand.d.ts.map +0 -1
  294. package/dist/types/cli/help.d.ts +0 -12
  295. package/dist/types/cli/help.d.ts.map +0 -1
  296. package/dist/types/cli/index.d.ts +0 -15
  297. package/dist/types/cli/index.d.ts.map +0 -1
  298. package/dist/types/constants.d.ts +0 -119
  299. package/dist/types/constants.d.ts.map +0 -1
  300. package/dist/types/core.js +0 -28
  301. package/dist/types/example.d.ts +0 -18
  302. package/dist/types/example.d.ts.map +0 -1
  303. package/dist/types/exports-module.d.ts +0 -196
  304. package/dist/types/exports-module.d.ts.map +0 -1
  305. package/dist/types/handlers/AnalyticsLogHandler.d.ts +0 -8
  306. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +0 -1
  307. package/dist/types/handlers/ExportLogHandler.d.ts +0 -100
  308. package/dist/types/handlers/ExportLogHandler.d.ts.map +0 -1
  309. package/dist/types/handlers/FileLogHandler.d.ts +0 -33
  310. package/dist/types/handlers/FileLogHandler.d.ts.map +0 -1
  311. package/dist/types/handlers/RemoteLogHandler.d.ts +0 -11
  312. package/dist/types/handlers/RemoteLogHandler.d.ts.map +0 -1
  313. package/dist/types/handlers/index.d.ts +0 -8
  314. package/dist/types/handlers/index.d.ts.map +0 -1
  315. package/dist/types/handlers.js +0 -4
  316. package/dist/types/index.js +0 -4
  317. package/dist/types/main.d.ts +0 -2
  318. package/dist/types/main.d.ts.map +0 -1
  319. package/dist/types/styling/LogStyleBuilder.d.ts +0 -146
  320. package/dist/types/styling/LogStyleBuilder.d.ts.map +0 -1
  321. package/dist/types/styling/SemanticStyles.d.ts +0 -178
  322. package/dist/types/styling/SemanticStyles.d.ts.map +0 -1
  323. package/dist/types/styling/SmartPresets.d.ts +0 -22
  324. package/dist/types/styling/SmartPresets.d.ts.map +0 -1
  325. package/dist/types/styling/StyleBuilder.d.ts +0 -140
  326. package/dist/types/styling/StyleBuilder.d.ts.map +0 -1
  327. package/dist/types/styling/banners.d.ts +0 -42
  328. package/dist/types/styling/banners.d.ts.map +0 -1
  329. package/dist/types/styling/index.d.ts +0 -10
  330. package/dist/types/styling/index.d.ts.map +0 -1
  331. package/dist/types/styling/themes.d.ts +0 -7
  332. package/dist/types/styling/themes.d.ts.map +0 -1
  333. package/dist/types/styling-module.d.ts +0 -178
  334. package/dist/types/styling-module.d.ts.map +0 -1
  335. package/dist/types/types/core.d.ts +0 -221
  336. package/dist/types/types/core.d.ts.map +0 -1
  337. package/dist/types/types/handlers.d.ts +0 -85
  338. package/dist/types/types/handlers.d.ts.map +0 -1
  339. package/dist/types/types/index.d.ts +0 -7
  340. package/dist/types/types/index.d.ts.map +0 -1
  341. package/dist/types/utils/environment.d.ts +0 -47
  342. package/dist/types/utils/environment.d.ts.map +0 -1
  343. package/dist/types/utils/formatting.d.ts +0 -37
  344. package/dist/types/utils/formatting.d.ts.map +0 -1
  345. package/dist/types/utils/index.d.ts +0 -7
  346. package/dist/types/utils/index.d.ts.map +0 -1
  347. package/dist/types/utils/opentui-detection.d.ts +0 -34
  348. package/dist/types/utils/opentui-detection.d.ts.map +0 -1
  349. package/dist/types/utils/output.d.ts +0 -41
  350. package/dist/types/utils/output.d.ts.map +0 -1
  351. package/dist/types/utils/stackTrace.d.ts +0 -6
  352. package/dist/types/utils/stackTrace.d.ts.map +0 -1
  353. package/dist/types/utils/timestamps.d.ts +0 -20
  354. package/dist/types/utils/timestamps.d.ts.map +0 -1
  355. package/dist/utils/environment.d.ts +0 -47
  356. package/dist/utils/environment.d.ts.map +0 -1
  357. package/dist/utils/environment.js +0 -85
  358. package/dist/utils/formatting.js +0 -117
  359. package/dist/utils/index.js +0 -6
  360. package/dist/utils/opentui-detection.d.ts +0 -34
  361. package/dist/utils/opentui-detection.d.ts.map +0 -1
  362. package/dist/utils/opentui-detection.js +0 -116
  363. package/dist/utils/output.js +0 -150
  364. package/dist/utils/stackTrace.js +0 -81
  365. package/dist/utils/timestamps.js +0 -71
  366. package/dist/vite.svg +0 -1
  367. package/docs/API.md +0 -691
  368. package/docs/CORE.md +0 -264
  369. package/docs/DEVELOPMENT.md +0 -731
  370. package/docs/EXPORTS.md +0 -467
  371. package/docs/PACKAGES.md +0 -244
  372. package/docs/STYLING.md +0 -405
  373. package/docs/_config.yml +0 -36
  374. package/docs/index.md +0 -179
  375. package/examples/README.md +0 -208
  376. package/examples/basic-logging.js +0 -75
  377. package/examples/data-export.js +0 -234
  378. package/examples/package.json +0 -16
  379. package/examples/performance-timing.js +0 -170
  380. package/examples/simplified-api.js +0 -124
  381. package/examples/styling-themes.js +0 -207
  382. package/index.html +0 -358
  383. package/packages/core/package.json +0 -57
  384. package/packages/exports/package.json +0 -41
  385. package/packages/nodejs-opentui/README.md +0 -232
  386. package/packages/nodejs-opentui/package.json +0 -72
  387. package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
  388. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
  389. package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
  390. package/packages/nodejs-opentui/src/index.ts +0 -133
  391. package/packages/nodejs-opentui/src/types.ts +0 -158
  392. package/packages/nodejs-opentui/tsconfig.json +0 -20
  393. package/packages/styling/package.json +0 -41
  394. package/project-utils/README.md +0 -172
  395. package/project-utils/auto-release-gemini.ts +0 -1193
  396. package/project-utils/auto-release-ui.ts +0 -1329
  397. package/project-utils/commit-generator.ts +0 -1385
  398. package/project-utils/commit-ui.ts +0 -264
  399. package/project-utils/git-utils.ts +0 -199
  400. package/project-utils/github-release-manager.ts +0 -466
  401. package/project-utils/project-config.ts +0 -260
  402. package/project-utils/prompt-templates.js +0 -345
  403. package/project-utils/prompt-templates.ts +0 -422
  404. package/project-utils/version-manager.ts +0 -1078
  405. package/public/vite.svg +0 -1
  406. package/src/Logger.ts +0 -1276
  407. package/src/ScopedLogger.ts +0 -454
  408. package/src/cli/CommandProcessor.ts +0 -248
  409. package/src/cli/commands/ConfigCommand.ts +0 -93
  410. package/src/cli/commands/ExportCommand.ts +0 -276
  411. package/src/cli/commands/HistoryCommand.ts +0 -117
  412. package/src/cli/commands/StatusCommand.ts +0 -112
  413. package/src/cli/commands/ThemeCommand.ts +0 -88
  414. package/src/cli/help.ts +0 -127
  415. package/src/cli/index.ts +0 -71
  416. package/src/constants.ts +0 -171
  417. package/src/core.ts +0 -393
  418. package/src/example.ts +0 -210
  419. package/src/exports-module.ts +0 -311
  420. package/src/handlers/AnalyticsLogHandler.ts +0 -22
  421. package/src/handlers/ExportLogHandler.ts +0 -609
  422. package/src/handlers/FileLogHandler.ts +0 -169
  423. package/src/handlers/RemoteLogHandler.ts +0 -42
  424. package/src/handlers/index.ts +0 -8
  425. package/src/index.ts +0 -209
  426. package/src/main.ts +0 -196
  427. package/src/style.css +0 -96
  428. package/src/styling/LogStyleBuilder.ts +0 -355
  429. package/src/styling/SemanticStyles.ts +0 -380
  430. package/src/styling/SmartPresets.ts +0 -288
  431. package/src/styling/StyleBuilder.ts +0 -319
  432. package/src/styling/banners.ts +0 -168
  433. package/src/styling/index.ts +0 -27
  434. package/src/styling/themes.ts +0 -235
  435. package/src/styling-module.ts +0 -244
  436. package/src/types/core.ts +0 -236
  437. package/src/types/handlers.ts +0 -95
  438. package/src/types/index.ts +0 -35
  439. package/src/typescript.svg +0 -1
  440. package/src/utils/environment.ts +0 -94
  441. package/src/utils/formatting.ts +0 -142
  442. package/src/utils/index.ts +0 -21
  443. package/src/utils/opentui-detection.ts +0 -138
  444. package/src/utils/output.ts +0 -185
  445. package/src/utils/stackTrace.ts +0 -95
  446. package/src/utils/timestamps.ts +0 -80
  447. package/src/vite-env.d.ts +0 -1
  448. package/test-core-browser.html +0 -237
  449. package/test-core-node.js +0 -63
  450. package/tests/test-conflict-resolution.ts +0 -391
  451. package/tests/validate-workflows.sh +0 -131
  452. package/tests/yaml-autofix.sh +0 -146
  453. package/tsconfig.json +0 -50
  454. package/vite.config.ts +0 -223
@@ -1,454 +0,0 @@
1
- /**
2
- * @fileoverview ScopedLogger con badges y logging contextual
3
- * @version 0.3.0
4
- * @since 2024
5
- *
6
- * Proporciona loggers especializados con contexto, badges automáticos
7
- * y características avanzadas para componentes y APIs.
8
- */
9
-
10
- import { Logger } from './Logger.js';
11
- import type { LoggerConfig, LogLevel, Verbosity, BannerType, StyleOptions, ILogHandler } from './types/index.js';
12
-
13
- /**
14
- * Logger con scope mejorado con badges y API simplificada
15
- *
16
- * @class ScopedLogger
17
- * @extends Logger
18
- * @description Logger contextual que añade prefijos y badges automáticamente
19
- *
20
- * @example
21
- * const dbLogger = logger.scope('Database');
22
- * dbLogger.info('Conectando...'); // [Database] Conectando...
23
- *
24
- * // Con badges personalizados
25
- * dbLogger.badge('SLOW').warn('Query lenta detectada');
26
- * // [SLOW] [Database] Query lenta detectada
27
- *
28
- * @since 0.3.0
29
- */
30
- export class ScopedLogger extends Logger {
31
- private parentLogger: Logger;
32
- private scopeName: string;
33
- private badgeList: string[] = [];
34
- private contextStack: string[] = [];
35
-
36
- constructor(parentLogger: Logger, scopeName: string, config?: Partial<LoggerConfig>) {
37
- // Initialize with parent's config plus any overrides
38
- super({ ...parentLogger.getConfig(), ...config });
39
- this.parentLogger = parentLogger;
40
- this.scopeName = scopeName;
41
-
42
- // Inherit parent's handlers
43
- const parentHandlers = parentLogger.getHandlers();
44
- parentHandlers.forEach(handler => this.addHandler(handler));
45
- }
46
-
47
- /**
48
- * Añade múltiples badges a este logger con scope
49
- *
50
- * @param {string[]} badges - Array de badges a añadir
51
- * @returns {ScopedLogger} Esta instancia para encadenamiento
52
- *
53
- * @example
54
- * const api = logger.scope('API');
55
- * api.badges(['v2', 'beta', 'cached'])
56
- * .info('Respuesta desde caché');
57
- * // [v2] [beta] [cached] [API] Respuesta desde caché
58
- *
59
- * @since 0.3.0
60
- */
61
- badges(badges: string[]): ScopedLogger {
62
- this.badgeList = [...badges];
63
- return this;
64
- }
65
-
66
- /**
67
- * Añade un badge individual
68
- *
69
- * @param {string} badge - Badge a añadir
70
- * @returns {ScopedLogger} Esta instancia para encadenamiento
71
- *
72
- * @example
73
- * dbLogger.badge('SLOW').warn('Query tardó 3s');
74
- * // [SLOW] [Database] Query tardó 3s
75
- *
76
- * @since 0.3.0
77
- */
78
- badge(badge: string): ScopedLogger {
79
- if (!this.badgeList.includes(badge)) {
80
- this.badgeList.push(badge);
81
- }
82
- return this;
83
- }
84
-
85
- /**
86
- * Elimina todos los badges
87
- *
88
- * @returns {ScopedLogger} Esta instancia para encadenamiento
89
- *
90
- * @example
91
- * api.clearBadges().info('Sin badges');
92
- * // [API] Sin badges
93
- *
94
- * @since 0.3.0
95
- */
96
- clearBadges(): ScopedLogger {
97
- this.badgeList = [];
98
- return this;
99
- }
100
-
101
- /**
102
- * Establece un preset de estilo para este logger con scope
103
- *
104
- * @param {string} presetName - Nombre del preset a aplicar
105
- * @returns {ScopedLogger} Esta instancia para encadenamiento
106
- *
107
- * @example
108
- * const errorLogger = logger.scope('ErrorHandler')
109
- * .style('cyberpunk');
110
- *
111
- * @since 0.3.0
112
- */
113
- style(presetName: string): ScopedLogger {
114
- this.setTheme(presetName as any); // Will be updated when we implement presets
115
- return this;
116
- }
117
-
118
- /**
119
- * Crea un contexto temporal que se limpia automáticamente
120
- *
121
- * @param {string} contextName - Nombre del contexto
122
- * @returns {ContextLogger} Logger con contexto temporal
123
- *
124
- * @example
125
- * const db = logger.scope('Database');
126
- *
127
- * // Contexto temporal para una operación
128
- * db.context('Migration').run(() => {
129
- * db.info('Iniciando migración');
130
- * db.success('Tablas creadas');
131
- * });
132
- * // Contexto automáticamente limpiado
133
- *
134
- * @since 0.3.0
135
- */
136
- context(contextName: string): ContextLogger {
137
- return new ContextLogger(this, contextName);
138
- }
139
-
140
- /**
141
- * Sobrescribe el logging principal para incluir badges
142
- * @protected
143
- * @param {LogLevel} level - Nivel del log
144
- * @param {...any} args - Argumentos del log
145
- */
146
- protected log(level: LogLevel, ...args: any[]): void {
147
- // Build the enhanced message with badges
148
- const badges = this.getBadgeString();
149
- const scopePrefix = this.getScopePrefix();
150
-
151
- let enhancedMessage = '';
152
- if (badges) enhancedMessage += badges + ' ';
153
- if (scopePrefix) enhancedMessage += `[${scopePrefix}] `;
154
-
155
- if (args.length > 0) {
156
- enhancedMessage += String(args[0]);
157
- // Replace the first argument with our enhanced message
158
- args[0] = enhancedMessage;
159
- }
160
-
161
- // Call parent's log method
162
- super.log(level, ...args);
163
- }
164
-
165
- /**
166
- * Obtiene la cadena de badges formateada
167
- * @private
168
- * @returns {string} Badges formateados como [BADGE1][BADGE2]
169
- */
170
- private getBadgeString(): string {
171
- if (this.badgeList.length === 0) return '';
172
- return this.badgeList.map(badge => `[${badge}]`).join('');
173
- }
174
-
175
- /**
176
- * Obtiene el prefijo del scope (incluye stack de contexto)
177
- * @private
178
- * @returns {string} Prefijo completo con contextos
179
- */
180
- private getScopePrefix(): string {
181
- const parts = [this.scopeName, ...this.contextStack].filter(Boolean);
182
- return parts.join(':');
183
- }
184
-
185
- /**
186
- * Método interno para añadir contexto
187
- * @internal
188
- */
189
- _pushContext(context: string): void {
190
- this.contextStack.push(context);
191
- }
192
-
193
- /**
194
- * Método interno para eliminar contexto
195
- * @internal
196
- */
197
- _popContext(): void {
198
- this.contextStack.pop();
199
- }
200
- }
201
-
202
- /**
203
- * Logger específico para APIs con badges comunes de API
204
- *
205
- * @class APILogger
206
- * @extends ScopedLogger
207
- * @description Logger especializado para endpoints y servicios API
208
- *
209
- * @example
210
- * const api = logger.api('REST');
211
- * api.info('GET /users');
212
- * // [API] [REST] GET /users
213
- *
214
- * api.slow('Query lenta', 3500);
215
- * // [API] [SLOW] [REST] Query lenta (3500ms)
216
- *
217
- * @since 0.3.0
218
- */
219
- export class APILogger extends ScopedLogger {
220
- constructor(parentLogger: Logger, apiName: string, config?: Partial<LoggerConfig>) {
221
- super(parentLogger, `API:${apiName}`, config);
222
- this.badge('API');
223
- }
224
-
225
- /**
226
- * Registra operaciones lentas
227
- *
228
- * @param {string} message - Mensaje sobre la operación lenta
229
- * @param {number} duration - Duración en milisegundos (opcional)
230
- *
231
- * @example
232
- * api.slow('Query compleja', 5000);
233
- * api.slow('Procesamiento pesado');
234
- *
235
- * @since 0.3.0
236
- */
237
- slow(message: string, duration?: number): void {
238
- this.badge('SLOW');
239
- const msg = duration ? `${message} (${duration}ms)` : message;
240
- this.warn(msg);
241
- }
242
-
243
- /**
244
- * Registra límites de tasa alcanzados
245
- *
246
- * @param {string} message - Mensaje sobre el límite
247
- *
248
- * @example
249
- * api.rateLimit('Límite excedido: 100 req/min');
250
- *
251
- * @since 0.3.0
252
- */
253
- rateLimit(message: string): void {
254
- this.badge('RATE_LIMIT');
255
- this.warn(message);
256
- }
257
-
258
- /**
259
- * Registra problemas de autenticación
260
- *
261
- * @param {string} message - Mensaje de autenticación
262
- *
263
- * @example
264
- * api.auth('Token inválido o expirado');
265
- * api.auth('Credenciales incorrectas');
266
- *
267
- * @since 0.3.0
268
- */
269
- auth(message: string): void {
270
- this.badge('AUTH');
271
- this.error(message);
272
- }
273
-
274
- /**
275
- * Registra advertencias de deprecación
276
- *
277
- * @param {string} message - Mensaje de deprecación
278
- *
279
- * @example
280
- * api.deprecated('Este endpoint será eliminado en v2.0');
281
- * api.deprecated('Usar /v2/users en lugar de /users');
282
- *
283
- * @since 0.3.0
284
- */
285
- deprecated(message: string): void {
286
- this.badge('DEPRECATED');
287
- this.warn(message);
288
- }
289
- }
290
-
291
- /**
292
- * Logger específico para componentes de UI
293
- *
294
- * @class ComponentLogger
295
- * @extends ScopedLogger
296
- * @description Logger especializado para componentes con eventos de ciclo de vida
297
- *
298
- * @example
299
- * const authForm = logger.component('AuthForm');
300
- * authForm.lifecycle('mounted');
301
- * authForm.stateChange('idle', 'loading');
302
- *
303
- * @since 0.3.0
304
- */
305
- export class ComponentLogger extends ScopedLogger {
306
- constructor(parentLogger: Logger, componentName: string, config?: Partial<LoggerConfig>) {
307
- super(parentLogger, componentName, config);
308
- this.badge('COMPONENT');
309
- }
310
-
311
- /**
312
- * Registra eventos del ciclo de vida del componente
313
- *
314
- * @param {string} event - Nombre del evento (mounted, unmounted, updated, etc)
315
- * @param {string} message - Mensaje adicional (opcional)
316
- *
317
- * @example
318
- * component.lifecycle('mounted', 'Componente listo');
319
- * component.lifecycle('beforeDestroy');
320
- *
321
- * @since 0.3.0
322
- */
323
- lifecycle(event: string, message?: string): void {
324
- this.badge('LIFECYCLE');
325
- const msg = message ? `${event}: ${message}` : event;
326
- this.info(msg);
327
- }
328
-
329
- /**
330
- * Registra cambios de estado
331
- *
332
- * @param {string} from - Estado anterior
333
- * @param {string} to - Estado nuevo
334
- * @param {any} data - Datos adicionales (opcional)
335
- *
336
- * @example
337
- * component.stateChange('idle', 'loading');
338
- * component.stateChange('loading', 'error', { code: 404 });
339
- *
340
- * @since 0.3.0
341
- */
342
- stateChange(from: string, to: string, data?: any): void {
343
- this.badge('STATE');
344
- const msg = `${from} → ${to}`;
345
- if (data) {
346
- this.info(msg, data);
347
- } else {
348
- this.info(msg);
349
- }
350
- }
351
-
352
- /**
353
- * Registra cambios en las propiedades
354
- *
355
- * @param {Record<string, any>} changes - Objeto con los cambios
356
- *
357
- * @example
358
- * component.propsChange({
359
- * user: newUser,
360
- * isActive: true
361
- * });
362
- *
363
- * @since 0.3.0
364
- */
365
- propsChange(changes: Record<string, any>): void {
366
- this.badge('PROPS');
367
- this.debug('Props changed:', changes);
368
- }
369
- }
370
-
371
- /**
372
- * Logger de contexto temporal que se limpia automáticamente
373
- *
374
- * @class ContextLogger
375
- * @description Proporciona un contexto temporal para operaciones agrupadas
376
- *
377
- * @example
378
- * const db = logger.scope('Database');
379
- *
380
- * // El contexto se limpia automáticamente al finalizar
381
- * db.context('Transaction').run(() => {
382
- * db.info('Iniciando transacción');
383
- * db.success('Transacción completada');
384
- * });
385
- *
386
- * @since 0.3.0
387
- */
388
- export class ContextLogger {
389
- private parentLogger: ScopedLogger;
390
- private contextName: string;
391
-
392
- constructor(parentLogger: ScopedLogger, contextName: string) {
393
- this.parentLogger = parentLogger;
394
- this.contextName = contextName;
395
- }
396
-
397
- /**
398
- * Ejecuta una función con este contexto activo
399
- *
400
- * @template T - Tipo de retorno de la función
401
- * @param {Function} fn - Función a ejecutar
402
- * @returns {T} Resultado de la función
403
- *
404
- * @example
405
- * const result = logger.context('Process').run(() => {
406
- * logger.info('Procesando...');
407
- * return processData();
408
- * });
409
- *
410
- * @since 0.3.0
411
- */
412
- run<T>(fn: () => T): T {
413
- this.parentLogger._pushContext(this.contextName);
414
- try {
415
- return fn();
416
- } finally {
417
- this.parentLogger._popContext();
418
- }
419
- }
420
-
421
- /**
422
- * Run an async function with this context active
423
- */
424
- async runAsync<T>(fn: () => Promise<T>): Promise<T> {
425
- this.parentLogger._pushContext(this.contextName);
426
- try {
427
- return await fn();
428
- } finally {
429
- this.parentLogger._popContext();
430
- }
431
- }
432
-
433
- /**
434
- * Start the context (manual mode)
435
- */
436
- start(): void {
437
- this.parentLogger._pushContext(this.contextName);
438
- }
439
-
440
- /**
441
- * End the context (manual mode)
442
- */
443
- end(): void {
444
- this.parentLogger._popContext();
445
- }
446
-
447
- // Delegate logging methods to parent with context
448
- debug(...args: any[]): void { this.parentLogger.debug(...args); }
449
- info(...args: any[]): void { this.parentLogger.info(...args); }
450
- warn(...args: any[]): void { this.parentLogger.warn(...args); }
451
- error(...args: any[]): void { this.parentLogger.error(...args); }
452
- success(...args: any[]): void { this.parentLogger.success(...args); }
453
- critical(...args: any[]): void { this.parentLogger.critical(...args); }
454
- }
@@ -1,248 +0,0 @@
1
- /**
2
- * @fileoverview CLI Command processor for Advanced Logger
3
- */
4
-
5
- import type { Logger } from '../Logger.js';
6
-
7
- /**
8
- * Base interface for CLI commands
9
- */
10
- export interface ICommand {
11
- name: string;
12
- description: string;
13
- usage: string;
14
- category?: string;
15
- aliases?: string[];
16
- execute(args: string, logger: Logger): void | Promise<void>;
17
- }
18
-
19
- /**
20
- * Plugin interface for extending CLI functionality
21
- */
22
- export interface ICLIPlugin {
23
- name: string;
24
- version: string;
25
- description: string;
26
- commands: ICommand[];
27
- initialize?(processor: CommandProcessor, logger: Logger): void;
28
- cleanup?(): void;
29
- }
30
-
31
- /**
32
- * Command history entry
33
- */
34
- interface HistoryEntry {
35
- command: string;
36
- timestamp: Date;
37
- success: boolean;
38
- }
39
-
40
- /**
41
- * CLI command processor
42
- */
43
- export class CommandProcessor {
44
- private commands: Map<string, ICommand> = new Map();
45
- private aliases: Map<string, string> = new Map();
46
- private plugins: Map<string, ICLIPlugin> = new Map();
47
- private history: HistoryEntry[] = [];
48
- private maxHistorySize: number = 100;
49
- private isInteractiveMode: boolean = false;
50
-
51
- /**
52
- * Register a command
53
- */
54
- registerCommand(command: ICommand): void {
55
- this.commands.set(command.name, command);
56
-
57
- // Register aliases
58
- if (command.aliases) {
59
- for (const alias of command.aliases) {
60
- this.aliases.set(alias, command.name);
61
- }
62
- }
63
- }
64
-
65
- /**
66
- * Register a plugin
67
- */
68
- registerPlugin(plugin: ICLIPlugin, logger?: Logger): void {
69
- if (this.plugins.has(plugin.name)) {
70
- throw new Error(`Plugin ${plugin.name} is already registered`);
71
- }
72
-
73
- this.plugins.set(plugin.name, plugin);
74
-
75
- // Register plugin commands
76
- for (const command of plugin.commands) {
77
- this.registerCommand(command);
78
- }
79
-
80
- // Initialize plugin
81
- if (plugin.initialize && logger) {
82
- plugin.initialize(this, logger);
83
- }
84
- }
85
-
86
- /**
87
- * Unregister a plugin
88
- */
89
- unregisterPlugin(pluginName: string): void {
90
- const plugin = this.plugins.get(pluginName);
91
- if (!plugin) return;
92
-
93
- // Remove plugin commands
94
- for (const command of plugin.commands) {
95
- this.commands.delete(command.name);
96
- if (command.aliases) {
97
- for (const alias of command.aliases) {
98
- this.aliases.delete(alias);
99
- }
100
- }
101
- }
102
-
103
- // Cleanup plugin
104
- if (plugin.cleanup) {
105
- plugin.cleanup();
106
- }
107
-
108
- this.plugins.delete(pluginName);
109
- }
110
-
111
- /**
112
- * Get all registered commands
113
- */
114
- getCommands(): ICommand[] {
115
- return Array.from(this.commands.values());
116
- }
117
-
118
- /**
119
- * Get a specific command
120
- */
121
- getCommand(name: string): ICommand | undefined {
122
- // Check direct command name
123
- let command = this.commands.get(name);
124
- if (command) return command;
125
-
126
- // Check aliases
127
- const aliasTarget = this.aliases.get(name);
128
- if (aliasTarget) {
129
- return this.commands.get(aliasTarget);
130
- }
131
-
132
- return undefined;
133
- }
134
-
135
- /**
136
- * Get command history
137
- */
138
- getHistory(): HistoryEntry[] {
139
- return [...this.history];
140
- }
141
-
142
- /**
143
- * Clear command history
144
- */
145
- clearHistory(): void {
146
- this.history = [];
147
- }
148
-
149
- /**
150
- * Get registered plugins
151
- */
152
- getPlugins(): ICLIPlugin[] {
153
- return Array.from(this.plugins.values());
154
- }
155
-
156
- /**
157
- * Enter interactive mode
158
- */
159
- enterInteractiveMode(logger: Logger): void {
160
- this.isInteractiveMode = true;
161
- logger.info('🔧 Interactive CLI mode activated. Type /exit to quit, /help for commands.');
162
-
163
- // Set up browser console listener for interactive commands
164
- if (typeof window !== 'undefined') {
165
- this.setupBrowserInteractiveMode(logger);
166
- }
167
- }
168
-
169
- /**
170
- * Exit interactive mode
171
- */
172
- exitInteractiveMode(): void {
173
- this.isInteractiveMode = false;
174
- }
175
-
176
- /**
177
- * Setup browser interactive mode
178
- */
179
- private setupBrowserInteractiveMode(logger: Logger): void {
180
- // Add global CLI function for browser usage
181
- (window as any).cli = (commandString: string) => {
182
- return this.processCommand(`/${commandString}`, logger);
183
- };
184
-
185
- logger.info('💡 Use cli("command") to execute CLI commands in browser console.');
186
- }
187
-
188
- /**
189
- * Process a CLI command
190
- */
191
- async processCommand(commandString: string, logger: Logger): Promise<void> {
192
- if (!commandString.startsWith('/')) {
193
- logger.error('Invalid command. Commands must start with /');
194
- this.addToHistory(commandString, false);
195
- return;
196
- }
197
-
198
- const parts = commandString.slice(1).split(' ');
199
- const commandName = parts[0] || '';
200
- const args = parts.slice(1).join(' ');
201
-
202
- const command = this.getCommand(commandName);
203
- if (!command) {
204
- logger.error(`Unknown command: ${commandName}. Type /help for available commands.`);
205
-
206
- // Suggest similar commands
207
- const suggestions = this.getSuggestions(commandName);
208
- if (suggestions.length > 0) {
209
- logger.info(`📋 Did you mean: ${suggestions.slice(0, 3).join(', ')}?`);
210
- }
211
-
212
- this.addToHistory(commandString, false);
213
- return;
214
- }
215
-
216
- try {
217
- await command.execute(args || '', logger);
218
- this.addToHistory(commandString, true);
219
- } catch (error) {
220
- logger.error(`Command '${commandName}' failed:`, error);
221
- this.addToHistory(commandString, false);
222
- }
223
- }
224
-
225
- /**
226
- * Add command to history
227
- */
228
- private addToHistory(command: string, success: boolean): void {
229
- this.history.unshift({
230
- command,
231
- timestamp: new Date(),
232
- success
233
- });
234
-
235
- // Limit history size
236
- if (this.history.length > this.maxHistorySize) {
237
- this.history = this.history.slice(0, this.maxHistorySize);
238
- }
239
- }
240
-
241
- /**
242
- * Get command suggestions for partial matches
243
- */
244
- getSuggestions(partial: string): string[] {
245
- const commandNames = Array.from(this.commands.keys());
246
- return commandNames.filter(name => name.startsWith(partial));
247
- }
248
- }