hanseol-dev 4.0.12

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 (720) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +267 -0
  3. package/dist/agents/base/base-agent.d.ts +38 -0
  4. package/dist/agents/base/base-agent.d.ts.map +1 -0
  5. package/dist/agents/base/base-agent.js +69 -0
  6. package/dist/agents/base/base-agent.js.map +1 -0
  7. package/dist/agents/docs-search/index.d.ts +33 -0
  8. package/dist/agents/docs-search/index.d.ts.map +1 -0
  9. package/dist/agents/docs-search/index.js +244 -0
  10. package/dist/agents/docs-search/index.js.map +1 -0
  11. package/dist/agents/index.d.ts +4 -0
  12. package/dist/agents/index.d.ts.map +1 -0
  13. package/dist/agents/index.js +4 -0
  14. package/dist/agents/index.js.map +1 -0
  15. package/dist/agents/planner/index.d.ts +19 -0
  16. package/dist/agents/planner/index.d.ts.map +1 -0
  17. package/dist/agents/planner/index.js +339 -0
  18. package/dist/agents/planner/index.js.map +1 -0
  19. package/dist/cli.d.ts +3 -0
  20. package/dist/cli.d.ts.map +1 -0
  21. package/dist/cli.js +205 -0
  22. package/dist/cli.js.map +1 -0
  23. package/dist/constants.d.ts +10 -0
  24. package/dist/constants.d.ts.map +1 -0
  25. package/dist/constants.js +12 -0
  26. package/dist/constants.js.map +1 -0
  27. package/dist/core/auth/oauth-login.d.ts +19 -0
  28. package/dist/core/auth/oauth-login.d.ts.map +1 -0
  29. package/dist/core/auth/oauth-login.js +197 -0
  30. package/dist/core/auth/oauth-login.js.map +1 -0
  31. package/dist/core/compact/compact-manager.d.ts +22 -0
  32. package/dist/core/compact/compact-manager.d.ts.map +1 -0
  33. package/dist/core/compact/compact-manager.js +75 -0
  34. package/dist/core/compact/compact-manager.js.map +1 -0
  35. package/dist/core/compact/compact-prompts.d.ts +11 -0
  36. package/dist/core/compact/compact-prompts.d.ts.map +1 -0
  37. package/dist/core/compact/compact-prompts.js +90 -0
  38. package/dist/core/compact/compact-prompts.js.map +1 -0
  39. package/dist/core/compact/context-tracker.d.ts +28 -0
  40. package/dist/core/compact/context-tracker.d.ts.map +1 -0
  41. package/dist/core/compact/context-tracker.js +71 -0
  42. package/dist/core/compact/context-tracker.js.map +1 -0
  43. package/dist/core/compact/index.d.ts +4 -0
  44. package/dist/core/compact/index.d.ts.map +1 -0
  45. package/dist/core/compact/index.js +4 -0
  46. package/dist/core/compact/index.js.map +1 -0
  47. package/dist/core/config/config-manager.d.ts +43 -0
  48. package/dist/core/config/config-manager.d.ts.map +1 -0
  49. package/dist/core/config/config-manager.js +254 -0
  50. package/dist/core/config/config-manager.js.map +1 -0
  51. package/dist/core/config/index.d.ts +2 -0
  52. package/dist/core/config/index.d.ts.map +1 -0
  53. package/dist/core/config/index.js +2 -0
  54. package/dist/core/config/index.js.map +1 -0
  55. package/dist/core/docs-manager.d.ts +46 -0
  56. package/dist/core/docs-manager.d.ts.map +1 -0
  57. package/dist/core/docs-manager.js +475 -0
  58. package/dist/core/docs-manager.js.map +1 -0
  59. package/dist/core/llm/index.d.ts +2 -0
  60. package/dist/core/llm/index.d.ts.map +1 -0
  61. package/dist/core/llm/index.js +2 -0
  62. package/dist/core/llm/index.js.map +1 -0
  63. package/dist/core/llm/llm-client.d.ts +98 -0
  64. package/dist/core/llm/llm-client.d.ts.map +1 -0
  65. package/dist/core/llm/llm-client.js +1024 -0
  66. package/dist/core/llm/llm-client.js.map +1 -0
  67. package/dist/core/s3-auto-updater.d.ts +44 -0
  68. package/dist/core/s3-auto-updater.d.ts.map +1 -0
  69. package/dist/core/s3-auto-updater.js +158 -0
  70. package/dist/core/s3-auto-updater.js.map +1 -0
  71. package/dist/core/session/index.d.ts +2 -0
  72. package/dist/core/session/index.d.ts.map +1 -0
  73. package/dist/core/session/index.js +2 -0
  74. package/dist/core/session/index.js.map +1 -0
  75. package/dist/core/session/session-manager.d.ts +71 -0
  76. package/dist/core/session/session-manager.d.ts.map +1 -0
  77. package/dist/core/session/session-manager.js +250 -0
  78. package/dist/core/session/session-manager.js.map +1 -0
  79. package/dist/core/slash-command-handler.d.ts +32 -0
  80. package/dist/core/slash-command-handler.d.ts.map +1 -0
  81. package/dist/core/slash-command-handler.js +455 -0
  82. package/dist/core/slash-command-handler.js.map +1 -0
  83. package/dist/core/usage-tracker.d.ts +74 -0
  84. package/dist/core/usage-tracker.d.ts.map +1 -0
  85. package/dist/core/usage-tracker.js +279 -0
  86. package/dist/core/usage-tracker.js.map +1 -0
  87. package/dist/errors/base.d.ts +22 -0
  88. package/dist/errors/base.d.ts.map +1 -0
  89. package/dist/errors/base.js +43 -0
  90. package/dist/errors/base.js.map +1 -0
  91. package/dist/errors/file.d.ts +31 -0
  92. package/dist/errors/file.d.ts.map +1 -0
  93. package/dist/errors/file.js +110 -0
  94. package/dist/errors/file.js.map +1 -0
  95. package/dist/errors/index.d.ts +12 -0
  96. package/dist/errors/index.d.ts.map +1 -0
  97. package/dist/errors/index.js +42 -0
  98. package/dist/errors/index.js.map +1 -0
  99. package/dist/errors/llm.d.ts +26 -0
  100. package/dist/errors/llm.d.ts.map +1 -0
  101. package/dist/errors/llm.js +86 -0
  102. package/dist/errors/llm.js.map +1 -0
  103. package/dist/errors/network.d.ts +19 -0
  104. package/dist/errors/network.d.ts.map +1 -0
  105. package/dist/errors/network.js +82 -0
  106. package/dist/errors/network.js.map +1 -0
  107. package/dist/errors/quota.d.ts +25 -0
  108. package/dist/errors/quota.d.ts.map +1 -0
  109. package/dist/errors/quota.js +10 -0
  110. package/dist/errors/quota.js.map +1 -0
  111. package/dist/errors/validation.d.ts +19 -0
  112. package/dist/errors/validation.d.ts.map +1 -0
  113. package/dist/errors/validation.js +62 -0
  114. package/dist/errors/validation.js.map +1 -0
  115. package/dist/eval/eval-runner.d.ts +24 -0
  116. package/dist/eval/eval-runner.d.ts.map +1 -0
  117. package/dist/eval/eval-runner.js +291 -0
  118. package/dist/eval/eval-runner.js.map +1 -0
  119. package/dist/eval/index.d.ts +3 -0
  120. package/dist/eval/index.d.ts.map +1 -0
  121. package/dist/eval/index.js +3 -0
  122. package/dist/eval/index.js.map +1 -0
  123. package/dist/eval/types.d.ts +77 -0
  124. package/dist/eval/types.d.ts.map +1 -0
  125. package/dist/eval/types.js +2 -0
  126. package/dist/eval/types.js.map +1 -0
  127. package/dist/index.d.ts +4 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +6 -0
  130. package/dist/index.js.map +1 -0
  131. package/dist/orchestration/index.d.ts +4 -0
  132. package/dist/orchestration/index.d.ts.map +1 -0
  133. package/dist/orchestration/index.js +3 -0
  134. package/dist/orchestration/index.js.map +1 -0
  135. package/dist/orchestration/plan-executor.d.ts +28 -0
  136. package/dist/orchestration/plan-executor.d.ts.map +1 -0
  137. package/dist/orchestration/plan-executor.js +376 -0
  138. package/dist/orchestration/plan-executor.js.map +1 -0
  139. package/dist/orchestration/types.d.ts +65 -0
  140. package/dist/orchestration/types.d.ts.map +1 -0
  141. package/dist/orchestration/types.js +2 -0
  142. package/dist/orchestration/types.js.map +1 -0
  143. package/dist/orchestration/utils.d.ts +13 -0
  144. package/dist/orchestration/utils.d.ts.map +1 -0
  145. package/dist/orchestration/utils.js +81 -0
  146. package/dist/orchestration/utils.js.map +1 -0
  147. package/dist/prompts/agents/docs-search-decision.d.ts +6 -0
  148. package/dist/prompts/agents/docs-search-decision.d.ts.map +1 -0
  149. package/dist/prompts/agents/docs-search-decision.js +46 -0
  150. package/dist/prompts/agents/docs-search-decision.js.map +1 -0
  151. package/dist/prompts/agents/docs-search.d.ts +4 -0
  152. package/dist/prompts/agents/docs-search.d.ts.map +1 -0
  153. package/dist/prompts/agents/docs-search.js +70 -0
  154. package/dist/prompts/agents/docs-search.js.map +1 -0
  155. package/dist/prompts/agents/planning.d.ts +4 -0
  156. package/dist/prompts/agents/planning.d.ts.map +1 -0
  157. package/dist/prompts/agents/planning.js +179 -0
  158. package/dist/prompts/agents/planning.js.map +1 -0
  159. package/dist/prompts/index.d.ts +10 -0
  160. package/dist/prompts/index.d.ts.map +1 -0
  161. package/dist/prompts/index.js +10 -0
  162. package/dist/prompts/index.js.map +1 -0
  163. package/dist/prompts/shared/codebase-rules.d.ts +4 -0
  164. package/dist/prompts/shared/codebase-rules.d.ts.map +1 -0
  165. package/dist/prompts/shared/codebase-rules.js +16 -0
  166. package/dist/prompts/shared/codebase-rules.js.map +1 -0
  167. package/dist/prompts/shared/git-rules.d.ts +2 -0
  168. package/dist/prompts/shared/git-rules.d.ts.map +1 -0
  169. package/dist/prompts/shared/git-rules.js +87 -0
  170. package/dist/prompts/shared/git-rules.js.map +1 -0
  171. package/dist/prompts/shared/language-rules.d.ts +4 -0
  172. package/dist/prompts/shared/language-rules.d.ts.map +1 -0
  173. package/dist/prompts/shared/language-rules.js +22 -0
  174. package/dist/prompts/shared/language-rules.js.map +1 -0
  175. package/dist/prompts/shared/tool-usage.d.ts +12 -0
  176. package/dist/prompts/shared/tool-usage.d.ts.map +1 -0
  177. package/dist/prompts/shared/tool-usage.js +51 -0
  178. package/dist/prompts/shared/tool-usage.js.map +1 -0
  179. package/dist/prompts/system/compact.d.ts +3 -0
  180. package/dist/prompts/system/compact.d.ts.map +1 -0
  181. package/dist/prompts/system/compact.js +73 -0
  182. package/dist/prompts/system/compact.js.map +1 -0
  183. package/dist/prompts/system/plan-execute.d.ts +3 -0
  184. package/dist/prompts/system/plan-execute.d.ts.map +1 -0
  185. package/dist/prompts/system/plan-execute.js +119 -0
  186. package/dist/prompts/system/plan-execute.js.map +1 -0
  187. package/dist/tools/browser/browser-client.d.ts +119 -0
  188. package/dist/tools/browser/browser-client.d.ts.map +1 -0
  189. package/dist/tools/browser/browser-client.js +1083 -0
  190. package/dist/tools/browser/browser-client.js.map +1 -0
  191. package/dist/tools/browser/browser-tools.d.ts +23 -0
  192. package/dist/tools/browser/browser-tools.d.ts.map +1 -0
  193. package/dist/tools/browser/browser-tools.js +1347 -0
  194. package/dist/tools/browser/browser-tools.js.map +1 -0
  195. package/dist/tools/browser/index.d.ts +7 -0
  196. package/dist/tools/browser/index.d.ts.map +1 -0
  197. package/dist/tools/browser/index.js +17 -0
  198. package/dist/tools/browser/index.js.map +1 -0
  199. package/dist/tools/index.d.ts +4 -0
  200. package/dist/tools/index.d.ts.map +1 -0
  201. package/dist/tools/index.js +4 -0
  202. package/dist/tools/index.js.map +1 -0
  203. package/dist/tools/llm/agents/docs-search-tools.d.ts +17 -0
  204. package/dist/tools/llm/agents/docs-search-tools.d.ts.map +1 -0
  205. package/dist/tools/llm/agents/docs-search-tools.js +265 -0
  206. package/dist/tools/llm/agents/docs-search-tools.js.map +1 -0
  207. package/dist/tools/llm/agents/index.d.ts +4 -0
  208. package/dist/tools/llm/agents/index.d.ts.map +1 -0
  209. package/dist/tools/llm/agents/index.js +3 -0
  210. package/dist/tools/llm/agents/index.js.map +1 -0
  211. package/dist/tools/llm/index.d.ts +3 -0
  212. package/dist/tools/llm/index.d.ts.map +1 -0
  213. package/dist/tools/llm/index.js +3 -0
  214. package/dist/tools/llm/index.js.map +1 -0
  215. package/dist/tools/llm/simple/ask-user-tool.d.ts +5 -0
  216. package/dist/tools/llm/simple/ask-user-tool.d.ts.map +1 -0
  217. package/dist/tools/llm/simple/ask-user-tool.js +7 -0
  218. package/dist/tools/llm/simple/ask-user-tool.js.map +1 -0
  219. package/dist/tools/llm/simple/background-bash-tool.d.ts +30 -0
  220. package/dist/tools/llm/simple/background-bash-tool.d.ts.map +1 -0
  221. package/dist/tools/llm/simple/background-bash-tool.js +320 -0
  222. package/dist/tools/llm/simple/background-bash-tool.js.map +1 -0
  223. package/dist/tools/llm/simple/background-powershell-tool.d.ts +30 -0
  224. package/dist/tools/llm/simple/background-powershell-tool.d.ts.map +1 -0
  225. package/dist/tools/llm/simple/background-powershell-tool.js +302 -0
  226. package/dist/tools/llm/simple/background-powershell-tool.js.map +1 -0
  227. package/dist/tools/llm/simple/bash-tool.d.ts +4 -0
  228. package/dist/tools/llm/simple/bash-tool.d.ts.map +1 -0
  229. package/dist/tools/llm/simple/bash-tool.js +167 -0
  230. package/dist/tools/llm/simple/bash-tool.js.map +1 -0
  231. package/dist/tools/llm/simple/docs-search-agent-tool.d.ts +6 -0
  232. package/dist/tools/llm/simple/docs-search-agent-tool.d.ts.map +1 -0
  233. package/dist/tools/llm/simple/docs-search-agent-tool.js +104 -0
  234. package/dist/tools/llm/simple/docs-search-agent-tool.js.map +1 -0
  235. package/dist/tools/llm/simple/file-tools.d.ts +13 -0
  236. package/dist/tools/llm/simple/file-tools.d.ts.map +1 -0
  237. package/dist/tools/llm/simple/file-tools.js +751 -0
  238. package/dist/tools/llm/simple/file-tools.js.map +1 -0
  239. package/dist/tools/llm/simple/final-response-tool.d.ts +12 -0
  240. package/dist/tools/llm/simple/final-response-tool.d.ts.map +1 -0
  241. package/dist/tools/llm/simple/final-response-tool.js +107 -0
  242. package/dist/tools/llm/simple/final-response-tool.js.map +1 -0
  243. package/dist/tools/llm/simple/index.d.ts +11 -0
  244. package/dist/tools/llm/simple/index.d.ts.map +1 -0
  245. package/dist/tools/llm/simple/index.js +20 -0
  246. package/dist/tools/llm/simple/index.js.map +1 -0
  247. package/dist/tools/llm/simple/planning-tools.d.ts +6 -0
  248. package/dist/tools/llm/simple/planning-tools.d.ts.map +1 -0
  249. package/dist/tools/llm/simple/planning-tools.js +171 -0
  250. package/dist/tools/llm/simple/planning-tools.js.map +1 -0
  251. package/dist/tools/llm/simple/powershell-tool.d.ts +4 -0
  252. package/dist/tools/llm/simple/powershell-tool.d.ts.map +1 -0
  253. package/dist/tools/llm/simple/powershell-tool.js +150 -0
  254. package/dist/tools/llm/simple/powershell-tool.js.map +1 -0
  255. package/dist/tools/llm/simple/simple-tool-executor.d.ts +38 -0
  256. package/dist/tools/llm/simple/simple-tool-executor.d.ts.map +1 -0
  257. package/dist/tools/llm/simple/simple-tool-executor.js +134 -0
  258. package/dist/tools/llm/simple/simple-tool-executor.js.map +1 -0
  259. package/dist/tools/llm/simple/todo-tools.d.ts +15 -0
  260. package/dist/tools/llm/simple/todo-tools.d.ts.map +1 -0
  261. package/dist/tools/llm/simple/todo-tools.js +145 -0
  262. package/dist/tools/llm/simple/todo-tools.js.map +1 -0
  263. package/dist/tools/llm/simple/user-interaction-tools.d.ts +22 -0
  264. package/dist/tools/llm/simple/user-interaction-tools.d.ts.map +1 -0
  265. package/dist/tools/llm/simple/user-interaction-tools.js +168 -0
  266. package/dist/tools/llm/simple/user-interaction-tools.js.map +1 -0
  267. package/dist/tools/office/common/constants.d.ts +194 -0
  268. package/dist/tools/office/common/constants.d.ts.map +1 -0
  269. package/dist/tools/office/common/constants.js +169 -0
  270. package/dist/tools/office/common/constants.js.map +1 -0
  271. package/dist/tools/office/common/index.d.ts +4 -0
  272. package/dist/tools/office/common/index.d.ts.map +1 -0
  273. package/dist/tools/office/common/index.js +3 -0
  274. package/dist/tools/office/common/index.js.map +1 -0
  275. package/dist/tools/office/common/types.d.ts +82 -0
  276. package/dist/tools/office/common/types.d.ts.map +1 -0
  277. package/dist/tools/office/common/types.js +2 -0
  278. package/dist/tools/office/common/types.js.map +1 -0
  279. package/dist/tools/office/common/utils.d.ts +14 -0
  280. package/dist/tools/office/common/utils.d.ts.map +1 -0
  281. package/dist/tools/office/common/utils.js +58 -0
  282. package/dist/tools/office/common/utils.js.map +1 -0
  283. package/dist/tools/office/excel-client.d.ts +212 -0
  284. package/dist/tools/office/excel-client.d.ts.map +1 -0
  285. package/dist/tools/office/excel-client.js +2242 -0
  286. package/dist/tools/office/excel-client.js.map +1 -0
  287. package/dist/tools/office/excel-tools/advanced.d.ts +13 -0
  288. package/dist/tools/office/excel-tools/advanced.d.ts.map +1 -0
  289. package/dist/tools/office/excel-tools/advanced.js +364 -0
  290. package/dist/tools/office/excel-tools/advanced.js.map +1 -0
  291. package/dist/tools/office/excel-tools/cells.d.ts +10 -0
  292. package/dist/tools/office/excel-tools/cells.d.ts.map +1 -0
  293. package/dist/tools/office/excel-tools/cells.js +279 -0
  294. package/dist/tools/office/excel-tools/cells.js.map +1 -0
  295. package/dist/tools/office/excel-tools/charts.d.ts +12 -0
  296. package/dist/tools/office/excel-tools/charts.d.ts.map +1 -0
  297. package/dist/tools/office/excel-tools/charts.js +373 -0
  298. package/dist/tools/office/excel-tools/charts.js.map +1 -0
  299. package/dist/tools/office/excel-tools/comments.d.ts +7 -0
  300. package/dist/tools/office/excel-tools/comments.d.ts.map +1 -0
  301. package/dist/tools/office/excel-tools/comments.js +150 -0
  302. package/dist/tools/office/excel-tools/comments.js.map +1 -0
  303. package/dist/tools/office/excel-tools/data-ops.d.ts +14 -0
  304. package/dist/tools/office/excel-tools/data-ops.d.ts.map +1 -0
  305. package/dist/tools/office/excel-tools/data-ops.js +420 -0
  306. package/dist/tools/office/excel-tools/data-ops.js.map +1 -0
  307. package/dist/tools/office/excel-tools/export.d.ts +8 -0
  308. package/dist/tools/office/excel-tools/export.d.ts.map +1 -0
  309. package/dist/tools/office/excel-tools/export.js +191 -0
  310. package/dist/tools/office/excel-tools/export.js.map +1 -0
  311. package/dist/tools/office/excel-tools/formatting.d.ts +12 -0
  312. package/dist/tools/office/excel-tools/formatting.d.ts.map +1 -0
  313. package/dist/tools/office/excel-tools/formatting.js +350 -0
  314. package/dist/tools/office/excel-tools/formatting.js.map +1 -0
  315. package/dist/tools/office/excel-tools/formulas.d.ts +11 -0
  316. package/dist/tools/office/excel-tools/formulas.d.ts.map +1 -0
  317. package/dist/tools/office/excel-tools/formulas.js +313 -0
  318. package/dist/tools/office/excel-tools/formulas.js.map +1 -0
  319. package/dist/tools/office/excel-tools/index.d.ts +21 -0
  320. package/dist/tools/office/excel-tools/index.d.ts.map +1 -0
  321. package/dist/tools/office/excel-tools/index.js +57 -0
  322. package/dist/tools/office/excel-tools/index.js.map +1 -0
  323. package/dist/tools/office/excel-tools/launch.d.ts +10 -0
  324. package/dist/tools/office/excel-tools/launch.d.ts.map +1 -0
  325. package/dist/tools/office/excel-tools/launch.js +248 -0
  326. package/dist/tools/office/excel-tools/launch.js.map +1 -0
  327. package/dist/tools/office/excel-tools/media.d.ts +10 -0
  328. package/dist/tools/office/excel-tools/media.d.ts.map +1 -0
  329. package/dist/tools/office/excel-tools/media.js +260 -0
  330. package/dist/tools/office/excel-tools/media.js.map +1 -0
  331. package/dist/tools/office/excel-tools/named-ranges.d.ts +6 -0
  332. package/dist/tools/office/excel-tools/named-ranges.d.ts.map +1 -0
  333. package/dist/tools/office/excel-tools/named-ranges.js +113 -0
  334. package/dist/tools/office/excel-tools/named-ranges.js.map +1 -0
  335. package/dist/tools/office/excel-tools/page-setup.d.ts +6 -0
  336. package/dist/tools/office/excel-tools/page-setup.d.ts.map +1 -0
  337. package/dist/tools/office/excel-tools/page-setup.js +144 -0
  338. package/dist/tools/office/excel-tools/page-setup.js.map +1 -0
  339. package/dist/tools/office/excel-tools/pivot-table.d.ts +7 -0
  340. package/dist/tools/office/excel-tools/pivot-table.d.ts.map +1 -0
  341. package/dist/tools/office/excel-tools/pivot-table.js +151 -0
  342. package/dist/tools/office/excel-tools/pivot-table.js.map +1 -0
  343. package/dist/tools/office/excel-tools/protection.d.ts +5 -0
  344. package/dist/tools/office/excel-tools/protection.d.ts.map +1 -0
  345. package/dist/tools/office/excel-tools/protection.js +75 -0
  346. package/dist/tools/office/excel-tools/protection.js.map +1 -0
  347. package/dist/tools/office/excel-tools/rows-columns.d.ts +15 -0
  348. package/dist/tools/office/excel-tools/rows-columns.d.ts.map +1 -0
  349. package/dist/tools/office/excel-tools/rows-columns.js +440 -0
  350. package/dist/tools/office/excel-tools/rows-columns.js.map +1 -0
  351. package/dist/tools/office/excel-tools/sheets.d.ts +16 -0
  352. package/dist/tools/office/excel-tools/sheets.d.ts.map +1 -0
  353. package/dist/tools/office/excel-tools/sheets.js +465 -0
  354. package/dist/tools/office/excel-tools/sheets.js.map +1 -0
  355. package/dist/tools/office/excel-tools/tables.d.ts +7 -0
  356. package/dist/tools/office/excel-tools/tables.d.ts.map +1 -0
  357. package/dist/tools/office/excel-tools/tables.js +151 -0
  358. package/dist/tools/office/excel-tools/tables.js.map +1 -0
  359. package/dist/tools/office/excel-tools/validation.d.ts +7 -0
  360. package/dist/tools/office/excel-tools/validation.d.ts.map +1 -0
  361. package/dist/tools/office/excel-tools/validation.js +175 -0
  362. package/dist/tools/office/excel-tools/validation.js.map +1 -0
  363. package/dist/tools/office/excel-tools.d.ts +3 -0
  364. package/dist/tools/office/excel-tools.d.ts.map +1 -0
  365. package/dist/tools/office/excel-tools.js +3 -0
  366. package/dist/tools/office/excel-tools.js.map +1 -0
  367. package/dist/tools/office/index.d.ts +6 -0
  368. package/dist/tools/office/index.d.ts.map +1 -0
  369. package/dist/tools/office/index.js +9 -0
  370. package/dist/tools/office/index.js.map +1 -0
  371. package/dist/tools/office/office-client-base.d.ts +31 -0
  372. package/dist/tools/office/office-client-base.d.ts.map +1 -0
  373. package/dist/tools/office/office-client-base.js +154 -0
  374. package/dist/tools/office/office-client-base.js.map +1 -0
  375. package/dist/tools/office/office-client.d.ts +196 -0
  376. package/dist/tools/office/office-client.d.ts.map +1 -0
  377. package/dist/tools/office/office-client.js +200 -0
  378. package/dist/tools/office/office-client.js.map +1 -0
  379. package/dist/tools/office/powerpoint-client.d.ts +155 -0
  380. package/dist/tools/office/powerpoint-client.d.ts.map +1 -0
  381. package/dist/tools/office/powerpoint-client.js +1359 -0
  382. package/dist/tools/office/powerpoint-client.js.map +1 -0
  383. package/dist/tools/office/powerpoint-tools/effects.d.ts +9 -0
  384. package/dist/tools/office/powerpoint-tools/effects.d.ts.map +1 -0
  385. package/dist/tools/office/powerpoint-tools/effects.js +259 -0
  386. package/dist/tools/office/powerpoint-tools/effects.js.map +1 -0
  387. package/dist/tools/office/powerpoint-tools/export.d.ts +7 -0
  388. package/dist/tools/office/powerpoint-tools/export.d.ts.map +1 -0
  389. package/dist/tools/office/powerpoint-tools/export.js +151 -0
  390. package/dist/tools/office/powerpoint-tools/export.js.map +1 -0
  391. package/dist/tools/office/powerpoint-tools/index.d.ts +13 -0
  392. package/dist/tools/office/powerpoint-tools/index.d.ts.map +1 -0
  393. package/dist/tools/office/powerpoint-tools/index.js +33 -0
  394. package/dist/tools/office/powerpoint-tools/index.js.map +1 -0
  395. package/dist/tools/office/powerpoint-tools/launch.d.ts +9 -0
  396. package/dist/tools/office/powerpoint-tools/launch.d.ts.map +1 -0
  397. package/dist/tools/office/powerpoint-tools/launch.js +214 -0
  398. package/dist/tools/office/powerpoint-tools/launch.js.map +1 -0
  399. package/dist/tools/office/powerpoint-tools/media.d.ts +8 -0
  400. package/dist/tools/office/powerpoint-tools/media.d.ts.map +1 -0
  401. package/dist/tools/office/powerpoint-tools/media.js +221 -0
  402. package/dist/tools/office/powerpoint-tools/media.js.map +1 -0
  403. package/dist/tools/office/powerpoint-tools/notes.d.ts +8 -0
  404. package/dist/tools/office/powerpoint-tools/notes.d.ts.map +1 -0
  405. package/dist/tools/office/powerpoint-tools/notes.js +181 -0
  406. package/dist/tools/office/powerpoint-tools/notes.js.map +1 -0
  407. package/dist/tools/office/powerpoint-tools/sections.d.ts +6 -0
  408. package/dist/tools/office/powerpoint-tools/sections.d.ts.map +1 -0
  409. package/dist/tools/office/powerpoint-tools/sections.js +111 -0
  410. package/dist/tools/office/powerpoint-tools/sections.js.map +1 -0
  411. package/dist/tools/office/powerpoint-tools/shapes.d.ts +24 -0
  412. package/dist/tools/office/powerpoint-tools/shapes.d.ts.map +1 -0
  413. package/dist/tools/office/powerpoint-tools/shapes.js +817 -0
  414. package/dist/tools/office/powerpoint-tools/shapes.js.map +1 -0
  415. package/dist/tools/office/powerpoint-tools/slides.d.ts +15 -0
  416. package/dist/tools/office/powerpoint-tools/slides.d.ts.map +1 -0
  417. package/dist/tools/office/powerpoint-tools/slides.js +447 -0
  418. package/dist/tools/office/powerpoint-tools/slides.js.map +1 -0
  419. package/dist/tools/office/powerpoint-tools/tables.d.ts +12 -0
  420. package/dist/tools/office/powerpoint-tools/tables.d.ts.map +1 -0
  421. package/dist/tools/office/powerpoint-tools/tables.js +362 -0
  422. package/dist/tools/office/powerpoint-tools/tables.js.map +1 -0
  423. package/dist/tools/office/powerpoint-tools/text.d.ts +13 -0
  424. package/dist/tools/office/powerpoint-tools/text.d.ts.map +1 -0
  425. package/dist/tools/office/powerpoint-tools/text.js +428 -0
  426. package/dist/tools/office/powerpoint-tools/text.js.map +1 -0
  427. package/dist/tools/office/powerpoint-tools.d.ts +3 -0
  428. package/dist/tools/office/powerpoint-tools.d.ts.map +1 -0
  429. package/dist/tools/office/powerpoint-tools.js +3 -0
  430. package/dist/tools/office/powerpoint-tools.js.map +1 -0
  431. package/dist/tools/office/word-client.d.ts +147 -0
  432. package/dist/tools/office/word-client.d.ts.map +1 -0
  433. package/dist/tools/office/word-client.js +1341 -0
  434. package/dist/tools/office/word-client.js.map +1 -0
  435. package/dist/tools/office/word-tools/bookmarks.d.ts +7 -0
  436. package/dist/tools/office/word-tools/bookmarks.d.ts.map +1 -0
  437. package/dist/tools/office/word-tools/bookmarks.js +146 -0
  438. package/dist/tools/office/word-tools/bookmarks.js.map +1 -0
  439. package/dist/tools/office/word-tools/comments.d.ts +7 -0
  440. package/dist/tools/office/word-tools/comments.d.ts.map +1 -0
  441. package/dist/tools/office/word-tools/comments.js +146 -0
  442. package/dist/tools/office/word-tools/comments.js.map +1 -0
  443. package/dist/tools/office/word-tools/content.d.ts +7 -0
  444. package/dist/tools/office/word-tools/content.d.ts.map +1 -0
  445. package/dist/tools/office/word-tools/content.js +168 -0
  446. package/dist/tools/office/word-tools/content.js.map +1 -0
  447. package/dist/tools/office/word-tools/export.d.ts +5 -0
  448. package/dist/tools/office/word-tools/export.d.ts.map +1 -0
  449. package/dist/tools/office/word-tools/export.js +73 -0
  450. package/dist/tools/office/word-tools/export.js.map +1 -0
  451. package/dist/tools/office/word-tools/find.d.ts +5 -0
  452. package/dist/tools/office/word-tools/find.d.ts.map +1 -0
  453. package/dist/tools/office/word-tools/find.js +106 -0
  454. package/dist/tools/office/word-tools/find.js.map +1 -0
  455. package/dist/tools/office/word-tools/footnotes.d.ts +9 -0
  456. package/dist/tools/office/word-tools/footnotes.d.ts.map +1 -0
  457. package/dist/tools/office/word-tools/footnotes.js +227 -0
  458. package/dist/tools/office/word-tools/footnotes.js.map +1 -0
  459. package/dist/tools/office/word-tools/formatting.d.ts +6 -0
  460. package/dist/tools/office/word-tools/formatting.d.ts.map +1 -0
  461. package/dist/tools/office/word-tools/formatting.js +129 -0
  462. package/dist/tools/office/word-tools/formatting.js.map +1 -0
  463. package/dist/tools/office/word-tools/headers-footers.d.ts +6 -0
  464. package/dist/tools/office/word-tools/headers-footers.d.ts.map +1 -0
  465. package/dist/tools/office/word-tools/headers-footers.js +117 -0
  466. package/dist/tools/office/word-tools/headers-footers.js.map +1 -0
  467. package/dist/tools/office/word-tools/index.d.ts +22 -0
  468. package/dist/tools/office/word-tools/index.d.ts.map +1 -0
  469. package/dist/tools/office/word-tools/index.js +63 -0
  470. package/dist/tools/office/word-tools/index.js.map +1 -0
  471. package/dist/tools/office/word-tools/launch.d.ts +10 -0
  472. package/dist/tools/office/word-tools/launch.d.ts.map +1 -0
  473. package/dist/tools/office/word-tools/launch.js +255 -0
  474. package/dist/tools/office/word-tools/launch.js.map +1 -0
  475. package/dist/tools/office/word-tools/lists.d.ts +5 -0
  476. package/dist/tools/office/word-tools/lists.d.ts.map +1 -0
  477. package/dist/tools/office/word-tools/lists.js +73 -0
  478. package/dist/tools/office/word-tools/lists.js.map +1 -0
  479. package/dist/tools/office/word-tools/navigation.d.ts +5 -0
  480. package/dist/tools/office/word-tools/navigation.d.ts.map +1 -0
  481. package/dist/tools/office/word-tools/navigation.js +85 -0
  482. package/dist/tools/office/word-tools/navigation.js.map +1 -0
  483. package/dist/tools/office/word-tools/page-setup.d.ts +7 -0
  484. package/dist/tools/office/word-tools/page-setup.d.ts.map +1 -0
  485. package/dist/tools/office/word-tools/page-setup.js +152 -0
  486. package/dist/tools/office/word-tools/page-setup.js.map +1 -0
  487. package/dist/tools/office/word-tools/selection.d.ts +8 -0
  488. package/dist/tools/office/word-tools/selection.d.ts.map +1 -0
  489. package/dist/tools/office/word-tools/selection.js +193 -0
  490. package/dist/tools/office/word-tools/selection.js.map +1 -0
  491. package/dist/tools/office/word-tools/tables-advanced.d.ts +8 -0
  492. package/dist/tools/office/word-tools/tables-advanced.d.ts.map +1 -0
  493. package/dist/tools/office/word-tools/tables-advanced.js +190 -0
  494. package/dist/tools/office/word-tools/tables-advanced.js.map +1 -0
  495. package/dist/tools/office/word-tools/tables.d.ts +8 -0
  496. package/dist/tools/office/word-tools/tables.d.ts.map +1 -0
  497. package/dist/tools/office/word-tools/tables.js +197 -0
  498. package/dist/tools/office/word-tools/tables.js.map +1 -0
  499. package/dist/tools/office/word-tools/text.d.ts +9 -0
  500. package/dist/tools/office/word-tools/text.d.ts.map +1 -0
  501. package/dist/tools/office/word-tools/text.js +235 -0
  502. package/dist/tools/office/word-tools/text.js.map +1 -0
  503. package/dist/tools/office/word-tools/toc.d.ts +6 -0
  504. package/dist/tools/office/word-tools/toc.d.ts.map +1 -0
  505. package/dist/tools/office/word-tools/toc.js +114 -0
  506. package/dist/tools/office/word-tools/toc.js.map +1 -0
  507. package/dist/tools/office/word-tools/track-changes.d.ts +8 -0
  508. package/dist/tools/office/word-tools/track-changes.d.ts.map +1 -0
  509. package/dist/tools/office/word-tools/track-changes.js +195 -0
  510. package/dist/tools/office/word-tools/track-changes.js.map +1 -0
  511. package/dist/tools/office/word-tools/undo-redo.d.ts +5 -0
  512. package/dist/tools/office/word-tools/undo-redo.d.ts.map +1 -0
  513. package/dist/tools/office/word-tools/undo-redo.js +73 -0
  514. package/dist/tools/office/word-tools/undo-redo.js.map +1 -0
  515. package/dist/tools/office/word-tools/watermarks.d.ts +5 -0
  516. package/dist/tools/office/word-tools/watermarks.d.ts.map +1 -0
  517. package/dist/tools/office/word-tools/watermarks.js +81 -0
  518. package/dist/tools/office/word-tools/watermarks.js.map +1 -0
  519. package/dist/tools/office/word-tools.d.ts +3 -0
  520. package/dist/tools/office/word-tools.d.ts.map +1 -0
  521. package/dist/tools/office/word-tools.js +3 -0
  522. package/dist/tools/office/word-tools.js.map +1 -0
  523. package/dist/tools/registry.d.ts +53 -0
  524. package/dist/tools/registry.d.ts.map +1 -0
  525. package/dist/tools/registry.js +282 -0
  526. package/dist/tools/registry.js.map +1 -0
  527. package/dist/tools/types.d.ts +88 -0
  528. package/dist/tools/types.d.ts.map +1 -0
  529. package/dist/tools/types.js +19 -0
  530. package/dist/tools/types.js.map +1 -0
  531. package/dist/types/index.d.ts +123 -0
  532. package/dist/types/index.d.ts.map +1 -0
  533. package/dist/types/index.js +2 -0
  534. package/dist/types/index.js.map +1 -0
  535. package/dist/ui/PlanExecuteView.d.ts +11 -0
  536. package/dist/ui/PlanExecuteView.d.ts.map +1 -0
  537. package/dist/ui/PlanExecuteView.js +27 -0
  538. package/dist/ui/PlanExecuteView.js.map +1 -0
  539. package/dist/ui/TodoPanel.d.ts +13 -0
  540. package/dist/ui/TodoPanel.d.ts.map +1 -0
  541. package/dist/ui/TodoPanel.js +135 -0
  542. package/dist/ui/TodoPanel.js.map +1 -0
  543. package/dist/ui/UpdateNotification.d.ts +13 -0
  544. package/dist/ui/UpdateNotification.d.ts.map +1 -0
  545. package/dist/ui/UpdateNotification.js +42 -0
  546. package/dist/ui/UpdateNotification.js.map +1 -0
  547. package/dist/ui/components/ActivityIndicator.d.ts +25 -0
  548. package/dist/ui/components/ActivityIndicator.d.ts.map +1 -0
  549. package/dist/ui/components/ActivityIndicator.js +115 -0
  550. package/dist/ui/components/ActivityIndicator.js.map +1 -0
  551. package/dist/ui/components/CommandBrowser.d.ts +10 -0
  552. package/dist/ui/components/CommandBrowser.d.ts.map +1 -0
  553. package/dist/ui/components/CommandBrowser.js +53 -0
  554. package/dist/ui/components/CommandBrowser.js.map +1 -0
  555. package/dist/ui/components/CustomTextInput.d.ts +13 -0
  556. package/dist/ui/components/CustomTextInput.d.ts.map +1 -0
  557. package/dist/ui/components/CustomTextInput.js +245 -0
  558. package/dist/ui/components/CustomTextInput.js.map +1 -0
  559. package/dist/ui/components/DocsSearchProgress.d.ts +13 -0
  560. package/dist/ui/components/DocsSearchProgress.d.ts.map +1 -0
  561. package/dist/ui/components/DocsSearchProgress.js +37 -0
  562. package/dist/ui/components/DocsSearchProgress.js.map +1 -0
  563. package/dist/ui/components/FileBrowser.d.ts +11 -0
  564. package/dist/ui/components/FileBrowser.d.ts.map +1 -0
  565. package/dist/ui/components/FileBrowser.js +45 -0
  566. package/dist/ui/components/FileBrowser.js.map +1 -0
  567. package/dist/ui/components/LLMSetupWizard.d.ts +8 -0
  568. package/dist/ui/components/LLMSetupWizard.d.ts.map +1 -0
  569. package/dist/ui/components/LLMSetupWizard.js +183 -0
  570. package/dist/ui/components/LLMSetupWizard.js.map +1 -0
  571. package/dist/ui/components/Logo.d.ts +21 -0
  572. package/dist/ui/components/Logo.d.ts.map +1 -0
  573. package/dist/ui/components/Logo.js +110 -0
  574. package/dist/ui/components/Logo.js.map +1 -0
  575. package/dist/ui/components/MarkdownRenderer.d.ts +9 -0
  576. package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -0
  577. package/dist/ui/components/MarkdownRenderer.js +198 -0
  578. package/dist/ui/components/MarkdownRenderer.js.map +1 -0
  579. package/dist/ui/components/ModelSelector.d.ts +8 -0
  580. package/dist/ui/components/ModelSelector.d.ts.map +1 -0
  581. package/dist/ui/components/ModelSelector.js +111 -0
  582. package/dist/ui/components/ModelSelector.js.map +1 -0
  583. package/dist/ui/components/PlanExecuteApp.d.ts +23 -0
  584. package/dist/ui/components/PlanExecuteApp.d.ts.map +1 -0
  585. package/dist/ui/components/PlanExecuteApp.js +1433 -0
  586. package/dist/ui/components/PlanExecuteApp.js.map +1 -0
  587. package/dist/ui/components/ProgressBar.d.ts +10 -0
  588. package/dist/ui/components/ProgressBar.d.ts.map +1 -0
  589. package/dist/ui/components/ProgressBar.js +26 -0
  590. package/dist/ui/components/ProgressBar.js.map +1 -0
  591. package/dist/ui/components/StatusBar.d.ts +23 -0
  592. package/dist/ui/components/StatusBar.d.ts.map +1 -0
  593. package/dist/ui/components/StatusBar.js +162 -0
  594. package/dist/ui/components/StatusBar.js.map +1 -0
  595. package/dist/ui/components/ThinkingIndicator.d.ts +14 -0
  596. package/dist/ui/components/ThinkingIndicator.d.ts.map +1 -0
  597. package/dist/ui/components/ThinkingIndicator.js +63 -0
  598. package/dist/ui/components/ThinkingIndicator.js.map +1 -0
  599. package/dist/ui/components/TodoListView.d.ts +11 -0
  600. package/dist/ui/components/TodoListView.d.ts.map +1 -0
  601. package/dist/ui/components/TodoListView.js +69 -0
  602. package/dist/ui/components/TodoListView.js.map +1 -0
  603. package/dist/ui/components/ToolSelector.d.ts +7 -0
  604. package/dist/ui/components/ToolSelector.d.ts.map +1 -0
  605. package/dist/ui/components/ToolSelector.js +112 -0
  606. package/dist/ui/components/ToolSelector.js.map +1 -0
  607. package/dist/ui/components/dialogs/ApprovalDialog.d.ts +13 -0
  608. package/dist/ui/components/dialogs/ApprovalDialog.d.ts.map +1 -0
  609. package/dist/ui/components/dialogs/ApprovalDialog.js +173 -0
  610. package/dist/ui/components/dialogs/ApprovalDialog.js.map +1 -0
  611. package/dist/ui/components/dialogs/AskUserDialog.d.ts +9 -0
  612. package/dist/ui/components/dialogs/AskUserDialog.d.ts.map +1 -0
  613. package/dist/ui/components/dialogs/AskUserDialog.js +111 -0
  614. package/dist/ui/components/dialogs/AskUserDialog.js.map +1 -0
  615. package/dist/ui/components/dialogs/DocsBrowser.d.ts +8 -0
  616. package/dist/ui/components/dialogs/DocsBrowser.d.ts.map +1 -0
  617. package/dist/ui/components/dialogs/DocsBrowser.js +127 -0
  618. package/dist/ui/components/dialogs/DocsBrowser.js.map +1 -0
  619. package/dist/ui/components/dialogs/SettingsDialog.d.ts +10 -0
  620. package/dist/ui/components/dialogs/SettingsDialog.d.ts.map +1 -0
  621. package/dist/ui/components/dialogs/SettingsDialog.js +563 -0
  622. package/dist/ui/components/dialogs/SettingsDialog.js.map +1 -0
  623. package/dist/ui/components/dialogs/index.d.ts +4 -0
  624. package/dist/ui/components/dialogs/index.d.ts.map +1 -0
  625. package/dist/ui/components/dialogs/index.js +4 -0
  626. package/dist/ui/components/dialogs/index.js.map +1 -0
  627. package/dist/ui/components/index.d.ts +12 -0
  628. package/dist/ui/components/index.d.ts.map +1 -0
  629. package/dist/ui/components/index.js +9 -0
  630. package/dist/ui/components/index.js.map +1 -0
  631. package/dist/ui/components/panels/LogPanel.d.ts +7 -0
  632. package/dist/ui/components/panels/LogPanel.d.ts.map +1 -0
  633. package/dist/ui/components/panels/LogPanel.js +280 -0
  634. package/dist/ui/components/panels/LogPanel.js.map +1 -0
  635. package/dist/ui/components/panels/SessionPanel.d.ts +8 -0
  636. package/dist/ui/components/panels/SessionPanel.d.ts.map +1 -0
  637. package/dist/ui/components/panels/SessionPanel.js +81 -0
  638. package/dist/ui/components/panels/SessionPanel.js.map +1 -0
  639. package/dist/ui/components/panels/index.d.ts +4 -0
  640. package/dist/ui/components/panels/index.d.ts.map +1 -0
  641. package/dist/ui/components/panels/index.js +4 -0
  642. package/dist/ui/components/panels/index.js.map +1 -0
  643. package/dist/ui/components/views/ChatView.d.ts +12 -0
  644. package/dist/ui/components/views/ChatView.d.ts.map +1 -0
  645. package/dist/ui/components/views/ChatView.js +289 -0
  646. package/dist/ui/components/views/ChatView.js.map +1 -0
  647. package/dist/ui/components/views/index.d.ts +2 -0
  648. package/dist/ui/components/views/index.d.ts.map +1 -0
  649. package/dist/ui/components/views/index.js +2 -0
  650. package/dist/ui/components/views/index.js.map +1 -0
  651. package/dist/ui/contexts/TokenContext.d.ts +29 -0
  652. package/dist/ui/contexts/TokenContext.d.ts.map +1 -0
  653. package/dist/ui/contexts/TokenContext.js +79 -0
  654. package/dist/ui/contexts/TokenContext.js.map +1 -0
  655. package/dist/ui/hooks/atFileProcessor.d.ts +15 -0
  656. package/dist/ui/hooks/atFileProcessor.d.ts.map +1 -0
  657. package/dist/ui/hooks/atFileProcessor.js +88 -0
  658. package/dist/ui/hooks/atFileProcessor.js.map +1 -0
  659. package/dist/ui/hooks/index.d.ts +8 -0
  660. package/dist/ui/hooks/index.d.ts.map +1 -0
  661. package/dist/ui/hooks/index.js +8 -0
  662. package/dist/ui/hooks/index.js.map +1 -0
  663. package/dist/ui/hooks/slashCommandProcessor.d.ts +21 -0
  664. package/dist/ui/hooks/slashCommandProcessor.d.ts.map +1 -0
  665. package/dist/ui/hooks/slashCommandProcessor.js +100 -0
  666. package/dist/ui/hooks/slashCommandProcessor.js.map +1 -0
  667. package/dist/ui/hooks/useCommandBrowserState.d.ts +12 -0
  668. package/dist/ui/hooks/useCommandBrowserState.d.ts.map +1 -0
  669. package/dist/ui/hooks/useCommandBrowserState.js +66 -0
  670. package/dist/ui/hooks/useCommandBrowserState.js.map +1 -0
  671. package/dist/ui/hooks/useFileBrowserState.d.ts +15 -0
  672. package/dist/ui/hooks/useFileBrowserState.d.ts.map +1 -0
  673. package/dist/ui/hooks/useFileBrowserState.js +80 -0
  674. package/dist/ui/hooks/useFileBrowserState.js.map +1 -0
  675. package/dist/ui/hooks/useFileList.d.ts +20 -0
  676. package/dist/ui/hooks/useFileList.d.ts.map +1 -0
  677. package/dist/ui/hooks/useFileList.js +57 -0
  678. package/dist/ui/hooks/useFileList.js.map +1 -0
  679. package/dist/ui/hooks/useInputHistory.d.ts +9 -0
  680. package/dist/ui/hooks/useInputHistory.d.ts.map +1 -0
  681. package/dist/ui/hooks/useInputHistory.js +68 -0
  682. package/dist/ui/hooks/useInputHistory.js.map +1 -0
  683. package/dist/ui/hooks/usePlanExecution.d.ts +8 -0
  684. package/dist/ui/hooks/usePlanExecution.d.ts.map +1 -0
  685. package/dist/ui/hooks/usePlanExecution.js +208 -0
  686. package/dist/ui/hooks/usePlanExecution.js.map +1 -0
  687. package/dist/ui/index.d.ts +7 -0
  688. package/dist/ui/index.d.ts.map +1 -0
  689. package/dist/ui/index.js +7 -0
  690. package/dist/ui/index.js.map +1 -0
  691. package/dist/ui/ink-entry.d.ts +3 -0
  692. package/dist/ui/ink-entry.d.ts.map +1 -0
  693. package/dist/ui/ink-entry.js +22 -0
  694. package/dist/ui/ink-entry.js.map +1 -0
  695. package/dist/utils/file-system.d.ts +9 -0
  696. package/dist/utils/file-system.d.ts.map +1 -0
  697. package/dist/utils/file-system.js +99 -0
  698. package/dist/utils/file-system.js.map +1 -0
  699. package/dist/utils/git-utils.d.ts +2 -0
  700. package/dist/utils/git-utils.d.ts.map +1 -0
  701. package/dist/utils/git-utils.js +16 -0
  702. package/dist/utils/git-utils.js.map +1 -0
  703. package/dist/utils/json-stream-logger.d.ts +74 -0
  704. package/dist/utils/json-stream-logger.d.ts.map +1 -0
  705. package/dist/utils/json-stream-logger.js +808 -0
  706. package/dist/utils/json-stream-logger.js.map +1 -0
  707. package/dist/utils/logger.d.ts +152 -0
  708. package/dist/utils/logger.d.ts.map +1 -0
  709. package/dist/utils/logger.js +1672 -0
  710. package/dist/utils/logger.js.map +1 -0
  711. package/dist/utils/platform-utils.d.ts +19 -0
  712. package/dist/utils/platform-utils.d.ts.map +1 -0
  713. package/dist/utils/platform-utils.js +134 -0
  714. package/dist/utils/platform-utils.js.map +1 -0
  715. package/dist/utils/wsl-utils.d.ts +4 -0
  716. package/dist/utils/wsl-utils.d.ts.map +1 -0
  717. package/dist/utils/wsl-utils.js +72 -0
  718. package/dist/utils/wsl-utils.js.map +1 -0
  719. package/package.json +148 -0
  720. package/scripts/patch-yoga.js +48 -0
@@ -0,0 +1,1672 @@
1
+ import chalk from 'chalk';
2
+ import { getJsonStreamLogger } from './json-stream-logger.js';
3
+ import * as path from 'path';
4
+ export var LogLevel;
5
+ (function (LogLevel) {
6
+ LogLevel[LogLevel["ERROR"] = 0] = "ERROR";
7
+ LogLevel[LogLevel["WARN"] = 1] = "WARN";
8
+ LogLevel[LogLevel["INFO"] = 2] = "INFO";
9
+ LogLevel[LogLevel["DEBUG"] = 3] = "DEBUG";
10
+ LogLevel[LogLevel["VERBOSE"] = 4] = "VERBOSE";
11
+ })(LogLevel || (LogLevel = {}));
12
+ let llmLogEnabled = false;
13
+ export function enableLLMLog() {
14
+ llmLogEnabled = true;
15
+ }
16
+ export function disableLLMLog() {
17
+ llmLogEnabled = false;
18
+ }
19
+ export function isLLMLogEnabled() {
20
+ return llmLogEnabled;
21
+ }
22
+ export class Logger {
23
+ level;
24
+ prefix;
25
+ showTimestamp;
26
+ showLocation;
27
+ showPid;
28
+ traceId = null;
29
+ timers = new Map();
30
+ constructor(options = {}) {
31
+ this.level = options.level ?? LogLevel.INFO;
32
+ this.prefix = options.prefix ?? '';
33
+ this.showTimestamp = options.timestamp ?? true;
34
+ this.showLocation = options.showLocation ?? true;
35
+ this.showPid = options.showPid ?? false;
36
+ }
37
+ setLevel(level) {
38
+ this.level = level;
39
+ }
40
+ setTraceId(traceId) {
41
+ this.traceId = traceId;
42
+ }
43
+ clearTraceId() {
44
+ this.traceId = null;
45
+ }
46
+ getTraceId() {
47
+ return this.traceId;
48
+ }
49
+ getCallLocation(depth = 3) {
50
+ try {
51
+ const stack = new Error().stack;
52
+ if (!stack)
53
+ return null;
54
+ const lines = stack.split('\n');
55
+ if (lines.length <= depth)
56
+ return null;
57
+ const line = lines[depth];
58
+ if (!line)
59
+ return null;
60
+ const match = line.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?/);
61
+ if (!match)
62
+ return null;
63
+ const [, functionName, file, lineNum, column] = match;
64
+ if (!file || !lineNum || !column)
65
+ return null;
66
+ return {
67
+ file: path.basename(file),
68
+ line: parseInt(lineNum),
69
+ column: parseInt(column),
70
+ function: functionName?.trim() || '<anonymous>',
71
+ };
72
+ }
73
+ catch {
74
+ return null;
75
+ }
76
+ }
77
+ getTimestamp() {
78
+ if (!this.showTimestamp)
79
+ return '';
80
+ const now = new Date();
81
+ return chalk.gray(`[${now.toISOString()}]`);
82
+ }
83
+ getPrefix() {
84
+ if (!this.prefix)
85
+ return '';
86
+ return chalk.cyan(`[${this.prefix}]`);
87
+ }
88
+ getPid() {
89
+ if (!this.showPid)
90
+ return '';
91
+ return chalk.dim(`[PID:${process.pid}]`);
92
+ }
93
+ getTraceIdStr() {
94
+ if (!this.traceId)
95
+ return '';
96
+ return chalk.magenta(`[Trace:${this.traceId.slice(0, 8)}]`);
97
+ }
98
+ getLocation(location) {
99
+ if (!this.showLocation || !location)
100
+ return '';
101
+ return chalk.dim(`[${location.file}:${location.line}:${location.function}]`);
102
+ }
103
+ formatVariable(variable) {
104
+ const type = variable.type || typeof variable.value;
105
+ const valueStr = this.formatValue(variable.value);
106
+ return chalk.yellow(variable.name) + chalk.gray('=') + chalk.white(valueStr) + chalk.dim(` (${type})`);
107
+ }
108
+ formatValue(value) {
109
+ if (value === null)
110
+ return 'null';
111
+ if (value === undefined)
112
+ return 'undefined';
113
+ if (typeof value === 'string')
114
+ return `"${value}"`;
115
+ if (typeof value === 'number' || typeof value === 'boolean')
116
+ return String(value);
117
+ if (typeof value === 'function')
118
+ return '[Function]';
119
+ if (Array.isArray(value))
120
+ return `Array(${value.length})`;
121
+ if (value instanceof Error)
122
+ return `Error: ${value.message}`;
123
+ try {
124
+ const json = JSON.stringify(value);
125
+ return json.length > 100 ? json.slice(0, 100) + '...' : json;
126
+ }
127
+ catch {
128
+ return '[Object]';
129
+ }
130
+ }
131
+ error(message, error) {
132
+ const jsonLogger = getJsonStreamLogger();
133
+ if (jsonLogger?.isActive()) {
134
+ jsonLogger.logError(error || new Error(message), this.prefix || 'logger');
135
+ }
136
+ if (this.level < LogLevel.ERROR)
137
+ return;
138
+ const location = this.getCallLocation();
139
+ const timestamp = this.getTimestamp();
140
+ const prefix = this.getPrefix();
141
+ const pid = this.getPid();
142
+ const traceId = this.getTraceIdStr();
143
+ const loc = this.getLocation(location);
144
+ console.error(timestamp, prefix, pid, traceId, loc, chalk.red('❌ ERROR:'), message);
145
+ if (error) {
146
+ if (error instanceof Error) {
147
+ console.error(chalk.red(' Message:'), error.message);
148
+ if (error.stack) {
149
+ console.error(chalk.gray(' Stack:'));
150
+ console.error(chalk.gray(error.stack));
151
+ }
152
+ if (error.cause) {
153
+ console.error(chalk.red(' Cause:'), error.cause);
154
+ }
155
+ if (error.details) {
156
+ console.error(chalk.yellow(' Details:'), JSON.stringify(error.details, null, 2));
157
+ }
158
+ }
159
+ else {
160
+ console.error(chalk.red(' Error:'), error);
161
+ }
162
+ }
163
+ }
164
+ warn(message, data) {
165
+ const jsonLogger = getJsonStreamLogger();
166
+ if (jsonLogger?.isActive()) {
167
+ jsonLogger.logInfo(`[WARN] ${message}`, data);
168
+ }
169
+ if (this.level < LogLevel.WARN)
170
+ return;
171
+ const location = this.getCallLocation();
172
+ const timestamp = this.getTimestamp();
173
+ const prefix = this.getPrefix();
174
+ const pid = this.getPid();
175
+ const traceId = this.getTraceIdStr();
176
+ const loc = this.getLocation(location);
177
+ console.warn(timestamp, prefix, pid, traceId, loc, chalk.yellow('⚠️ WARN:'), message);
178
+ if (data) {
179
+ console.warn(chalk.yellow(' Data:'), JSON.stringify(data, null, 2));
180
+ }
181
+ }
182
+ info(message, data) {
183
+ const jsonLogger = getJsonStreamLogger();
184
+ if (jsonLogger?.isActive()) {
185
+ jsonLogger.logInfo(message, data);
186
+ }
187
+ if (this.level < LogLevel.INFO)
188
+ return;
189
+ const location = this.getCallLocation();
190
+ const timestamp = this.getTimestamp();
191
+ const prefix = this.getPrefix();
192
+ const pid = this.getPid();
193
+ const traceId = this.getTraceIdStr();
194
+ const loc = this.getLocation(location);
195
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('ℹ️ INFO:'), message);
196
+ if (data) {
197
+ console.log(chalk.blue(' Data:'), JSON.stringify(data, null, 2));
198
+ }
199
+ }
200
+ debug(message, data) {
201
+ const jsonLogger = getJsonStreamLogger();
202
+ if (jsonLogger?.isActive()) {
203
+ jsonLogger.logDebug(message, data);
204
+ }
205
+ if (this.level < LogLevel.DEBUG)
206
+ return;
207
+ const location = this.getCallLocation();
208
+ const timestamp = this.getTimestamp();
209
+ const prefix = this.getPrefix();
210
+ const pid = this.getPid();
211
+ const traceId = this.getTraceIdStr();
212
+ const loc = this.getLocation(location);
213
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.magenta('🐛 DEBUG:'), message);
214
+ if (data) {
215
+ console.log(chalk.magenta(' Data:'), JSON.stringify(data, null, 2));
216
+ }
217
+ }
218
+ verbose(message, data) {
219
+ const jsonLogger = getJsonStreamLogger();
220
+ if (jsonLogger?.isActive()) {
221
+ jsonLogger.logDebug(`[VERBOSE] ${message}`, data);
222
+ }
223
+ if (this.level < LogLevel.VERBOSE)
224
+ return;
225
+ const location = this.getCallLocation();
226
+ const timestamp = this.getTimestamp();
227
+ const prefix = this.getPrefix();
228
+ const pid = this.getPid();
229
+ const traceId = this.getTraceIdStr();
230
+ const loc = this.getLocation(location);
231
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.gray('🔍 VERBOSE:'), message);
232
+ if (data) {
233
+ console.log(chalk.gray(' Data:'), JSON.stringify(data, null, 2));
234
+ }
235
+ }
236
+ flow(message, context) {
237
+ const jsonLogger = getJsonStreamLogger();
238
+ if (jsonLogger?.isActive()) {
239
+ jsonLogger.logDebug(`[FLOW] ${message}`, context);
240
+ }
241
+ if (this.level < LogLevel.DEBUG)
242
+ return;
243
+ const location = this.getCallLocation();
244
+ const timestamp = this.getTimestamp();
245
+ const prefix = this.getPrefix();
246
+ const pid = this.getPid();
247
+ const traceId = this.getTraceIdStr();
248
+ const loc = this.getLocation(location);
249
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.green('➜ FLOW:'), message);
250
+ if (context) {
251
+ console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
252
+ }
253
+ }
254
+ vars(...variables) {
255
+ const jsonLogger = getJsonStreamLogger();
256
+ if (jsonLogger?.isActive()) {
257
+ const varsData = variables.reduce((acc, v) => {
258
+ acc[v.name] = v.value;
259
+ return acc;
260
+ }, {});
261
+ jsonLogger.logDebug('[VARS]', varsData);
262
+ }
263
+ if (this.level < LogLevel.DEBUG)
264
+ return;
265
+ const location = this.getCallLocation();
266
+ const timestamp = this.getTimestamp();
267
+ const prefix = this.getPrefix();
268
+ const pid = this.getPid();
269
+ const traceId = this.getTraceIdStr();
270
+ const loc = this.getLocation(location);
271
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('📦 VARS:'));
272
+ variables.forEach(variable => {
273
+ console.log(' ', this.formatVariable(variable));
274
+ });
275
+ }
276
+ enter(functionName, args) {
277
+ const jsonLogger = getJsonStreamLogger();
278
+ if (jsonLogger?.isActive()) {
279
+ jsonLogger.logDebug(`[ENTER] ${functionName}`, args);
280
+ }
281
+ if (this.level < LogLevel.DEBUG)
282
+ return;
283
+ const location = this.getCallLocation();
284
+ const timestamp = this.getTimestamp();
285
+ const prefix = this.getPrefix();
286
+ const pid = this.getPid();
287
+ const traceId = this.getTraceIdStr();
288
+ const loc = this.getLocation(location);
289
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.green('↓ ENTER:'), chalk.bold(functionName));
290
+ if (args) {
291
+ console.log(chalk.green(' Args:'), JSON.stringify(args, null, 2));
292
+ }
293
+ }
294
+ exit(functionName, result) {
295
+ const jsonLogger = getJsonStreamLogger();
296
+ if (jsonLogger?.isActive()) {
297
+ jsonLogger.logDebug(`[EXIT] ${functionName}`, { result });
298
+ }
299
+ if (this.level < LogLevel.DEBUG)
300
+ return;
301
+ const location = this.getCallLocation();
302
+ const timestamp = this.getTimestamp();
303
+ const prefix = this.getPrefix();
304
+ const pid = this.getPid();
305
+ const traceId = this.getTraceIdStr();
306
+ const loc = this.getLocation(location);
307
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.green('↑ EXIT:'), chalk.bold(functionName));
308
+ if (result !== undefined) {
309
+ console.log(chalk.green(' Result:'), this.formatValue(result));
310
+ }
311
+ }
312
+ state(description, before, after) {
313
+ const jsonLogger = getJsonStreamLogger();
314
+ if (jsonLogger?.isActive()) {
315
+ jsonLogger.logDebug(`[STATE] ${description}`, { before, after });
316
+ }
317
+ if (this.level < LogLevel.DEBUG)
318
+ return;
319
+ const location = this.getCallLocation();
320
+ const timestamp = this.getTimestamp();
321
+ const prefix = this.getPrefix();
322
+ const pid = this.getPid();
323
+ const traceId = this.getTraceIdStr();
324
+ const loc = this.getLocation(location);
325
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.yellow('🔄 STATE:'), description);
326
+ console.log(chalk.red(' Before:'), this.formatValue(before));
327
+ console.log(chalk.green(' After:'), this.formatValue(after));
328
+ }
329
+ startTimer(label) {
330
+ const jsonLogger = getJsonStreamLogger();
331
+ if (jsonLogger?.isActive()) {
332
+ jsonLogger.logDebug(`[TIMER] Start: ${label}`);
333
+ }
334
+ this.timers.set(label, Date.now());
335
+ if (this.level >= LogLevel.DEBUG) {
336
+ const location = this.getCallLocation();
337
+ const timestamp = this.getTimestamp();
338
+ const prefix = this.getPrefix();
339
+ const pid = this.getPid();
340
+ const traceId = this.getTraceIdStr();
341
+ const loc = this.getLocation(location);
342
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('⏱️ TIMER START:'), label);
343
+ }
344
+ }
345
+ endTimer(label) {
346
+ const startTime = this.timers.get(label);
347
+ if (!startTime) {
348
+ this.warn(`Timer "${label}" was not started`);
349
+ return 0;
350
+ }
351
+ const elapsed = Date.now() - startTime;
352
+ this.timers.delete(label);
353
+ const jsonLogger = getJsonStreamLogger();
354
+ if (jsonLogger?.isActive()) {
355
+ jsonLogger.logDebug(`[TIMER] End: ${label}`, { elapsed });
356
+ }
357
+ if (this.level >= LogLevel.DEBUG) {
358
+ const location = this.getCallLocation();
359
+ const timestamp = this.getTimestamp();
360
+ const prefix = this.getPrefix();
361
+ const pid = this.getPid();
362
+ const traceId = this.getTraceIdStr();
363
+ const loc = this.getLocation(location);
364
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('⏱️ TIMER END:'), label, chalk.bold(`${elapsed}ms`));
365
+ }
366
+ return elapsed;
367
+ }
368
+ httpRequest(method, url, body) {
369
+ const jsonLogger = getJsonStreamLogger();
370
+ if (jsonLogger?.isActive()) {
371
+ jsonLogger.logDebug(`HTTP ${method} ${url}`, { body });
372
+ }
373
+ if (this.level < LogLevel.DEBUG)
374
+ return;
375
+ const location = this.getCallLocation();
376
+ const timestamp = this.getTimestamp();
377
+ const prefix = this.getPrefix();
378
+ const pid = this.getPid();
379
+ const traceId = this.getTraceIdStr();
380
+ const loc = this.getLocation(location);
381
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('→ HTTP REQUEST:'), chalk.bold(method), url);
382
+ if (body) {
383
+ console.log(chalk.cyan(' Body:'), JSON.stringify(body, null, 2));
384
+ }
385
+ }
386
+ httpResponse(status, statusText, data) {
387
+ const jsonLogger = getJsonStreamLogger();
388
+ if (jsonLogger?.isActive()) {
389
+ jsonLogger.logDebug(`HTTP Response ${status} ${statusText}`, { status, statusText, data });
390
+ }
391
+ if (this.level < LogLevel.DEBUG)
392
+ return;
393
+ const location = this.getCallLocation();
394
+ const timestamp = this.getTimestamp();
395
+ const prefix = this.getPrefix();
396
+ const pid = this.getPid();
397
+ const traceId = this.getTraceIdStr();
398
+ const loc = this.getLocation(location);
399
+ const statusColor = status >= 400 ? chalk.red : status >= 300 ? chalk.yellow : chalk.green;
400
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('← HTTP RESPONSE:'), statusColor(`${status} ${statusText}`));
401
+ if (data && this.level >= LogLevel.VERBOSE) {
402
+ console.log(chalk.cyan(' Data:'), JSON.stringify(data, null, 2));
403
+ }
404
+ }
405
+ toolExecution(toolName, args, result, error) {
406
+ const jsonLogger = getJsonStreamLogger();
407
+ if (jsonLogger?.isActive()) {
408
+ jsonLogger.logToolCall(toolName, args, result, error);
409
+ }
410
+ if (this.level < LogLevel.DEBUG)
411
+ return;
412
+ const location = this.getCallLocation();
413
+ const timestamp = this.getTimestamp();
414
+ const prefix = this.getPrefix();
415
+ const pid = this.getPid();
416
+ const traceId = this.getTraceIdStr();
417
+ const loc = this.getLocation(location);
418
+ if (error) {
419
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.red('🔧 TOOL FAILED:'), chalk.bold(toolName));
420
+ console.log(chalk.red(' Args:'), JSON.stringify(args, null, 2));
421
+ console.log(chalk.red(' Error:'), error.message);
422
+ }
423
+ else {
424
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.green('🔧 TOOL SUCCESS:'), chalk.bold(toolName));
425
+ console.log(chalk.green(' Args:'), JSON.stringify(args, null, 2));
426
+ if (result && this.level >= LogLevel.VERBOSE) {
427
+ console.log(chalk.green(' Result:'), JSON.stringify(result, null, 2));
428
+ }
429
+ }
430
+ }
431
+ bashExecution(formattedDisplay) {
432
+ const jsonLogger = getJsonStreamLogger();
433
+ if (jsonLogger?.isActive()) {
434
+ jsonLogger.logDebug('[BASH] Execution', { output: formattedDisplay });
435
+ }
436
+ if (this.level < LogLevel.INFO)
437
+ return;
438
+ const lines = formattedDisplay.split('\n');
439
+ lines.forEach((line) => {
440
+ if (line.startsWith('●')) {
441
+ console.log(chalk.cyan(line));
442
+ }
443
+ else if (line.includes('Error:')) {
444
+ console.log(chalk.red(line));
445
+ }
446
+ else {
447
+ console.log(line);
448
+ }
449
+ });
450
+ console.log();
451
+ }
452
+ llmRequest(messages, model, tools) {
453
+ const jsonLogger = getJsonStreamLogger();
454
+ if (jsonLogger?.isActive()) {
455
+ jsonLogger.logDebug('[LLM] Request', { model, messageCount: messages?.length, toolCount: tools?.length });
456
+ }
457
+ if (!llmLogEnabled)
458
+ return;
459
+ const timestamp = this.getTimestamp();
460
+ console.log();
461
+ console.log(chalk.cyan('─'.repeat(80)));
462
+ console.log(chalk.cyan.bold(`[${timestamp}] 📤 LLM REQUEST`));
463
+ console.log(chalk.gray(`Model: ${model}`));
464
+ if (tools && Array.isArray(tools) && tools.length > 0) {
465
+ console.log(chalk.gray(`Tools: ${tools.length} available`));
466
+ }
467
+ console.log(chalk.cyan('─'.repeat(40)));
468
+ if (Array.isArray(messages)) {
469
+ messages.forEach((msg, idx) => {
470
+ const role = msg.role || 'unknown';
471
+ const content = msg.content || '';
472
+ const roleColor = role === 'user' ? chalk.green : role === 'assistant' ? chalk.blue : chalk.yellow;
473
+ console.log(roleColor.bold(`[${role.toUpperCase()}]`));
474
+ if (content) {
475
+ const displayContent = content.length > 2000
476
+ ? content.substring(0, 2000) + chalk.gray(`\n... (${content.length - 2000} more chars)`)
477
+ : content;
478
+ console.log(displayContent);
479
+ }
480
+ if (msg.tool_calls && msg.tool_calls.length > 0) {
481
+ console.log(chalk.yellow(` Tool calls: ${msg.tool_calls.map((tc) => tc.function?.name).join(', ')}`));
482
+ }
483
+ if (idx < messages.length - 1)
484
+ console.log();
485
+ });
486
+ }
487
+ console.log(chalk.cyan('─'.repeat(80)));
488
+ }
489
+ llmResponse(response, toolCalls) {
490
+ const jsonLogger = getJsonStreamLogger();
491
+ if (jsonLogger?.isActive()) {
492
+ jsonLogger.logDebug('[LLM] Response', { responseLength: response?.length, toolCallCount: toolCalls?.length });
493
+ }
494
+ if (!llmLogEnabled)
495
+ return;
496
+ const timestamp = this.getTimestamp();
497
+ console.log();
498
+ console.log(chalk.green('─'.repeat(80)));
499
+ console.log(chalk.green.bold(`[${timestamp}] 📥 LLM RESPONSE`));
500
+ console.log(chalk.green('─'.repeat(40)));
501
+ const displayResponse = response.length > 3000
502
+ ? response.substring(0, 3000) + chalk.gray(`\n... (${response.length - 3000} more chars)`)
503
+ : response;
504
+ console.log(displayResponse);
505
+ if (toolCalls && Array.isArray(toolCalls) && toolCalls.length > 0) {
506
+ console.log();
507
+ console.log(chalk.yellow.bold('Tool Calls:'));
508
+ toolCalls.forEach((tc) => {
509
+ console.log(chalk.yellow(` - ${tc.function?.name}:`));
510
+ try {
511
+ const args = JSON.parse(tc.function?.arguments || '{}');
512
+ console.log(chalk.gray(JSON.stringify(args, null, 2)));
513
+ }
514
+ catch {
515
+ console.log(chalk.gray(tc.function?.arguments || '(no arguments)'));
516
+ }
517
+ });
518
+ }
519
+ console.log(chalk.green('─'.repeat(80)));
520
+ }
521
+ llmToolResult(toolName, result, success) {
522
+ const jsonLogger = getJsonStreamLogger();
523
+ if (jsonLogger?.isActive()) {
524
+ jsonLogger.logDebug(`[LLM] Tool Result: ${toolName}`, { success, resultLength: result?.length });
525
+ }
526
+ if (!llmLogEnabled)
527
+ return;
528
+ const timestamp = this.getTimestamp();
529
+ const color = success ? chalk.cyan : chalk.red;
530
+ console.log();
531
+ console.log(color('─'.repeat(80)));
532
+ console.log(color.bold(`[${timestamp}] 🔧 TOOL: ${toolName} ${success ? '✓' : '✗'}`));
533
+ console.log(color('─'.repeat(40)));
534
+ const displayResult = result.length > 1000
535
+ ? result.substring(0, 1000) + chalk.gray(`\n... (${result.length - 1000} more chars)`)
536
+ : result;
537
+ console.log(displayResult);
538
+ console.log(color('─'.repeat(80)));
539
+ }
540
+ httpError(url, error) {
541
+ const jsonLogger = getJsonStreamLogger();
542
+ if (jsonLogger?.isActive()) {
543
+ jsonLogger.logError(error instanceof Error ? error : new Error(String(error)), `HTTP ${url}`);
544
+ }
545
+ if (this.level < LogLevel.DEBUG)
546
+ return;
547
+ const location = this.getCallLocation();
548
+ const timestamp = this.getTimestamp();
549
+ const prefix = this.getPrefix();
550
+ const pid = this.getPid();
551
+ const traceId = this.getTraceIdStr();
552
+ const loc = this.getLocation(location);
553
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.red('✗ HTTP ERROR:'), url);
554
+ if (error instanceof Error) {
555
+ console.log(chalk.red(' Message:'), error.message);
556
+ }
557
+ else {
558
+ console.log(chalk.red(' Error:'), error);
559
+ }
560
+ }
561
+ httpStreamStart(method, url) {
562
+ const jsonLogger = getJsonStreamLogger();
563
+ if (jsonLogger?.isActive()) {
564
+ jsonLogger.logDebug(`HTTP Stream Start: ${method} ${url}`);
565
+ }
566
+ if (this.level < LogLevel.DEBUG)
567
+ return;
568
+ const location = this.getCallLocation();
569
+ const timestamp = this.getTimestamp();
570
+ const prefix = this.getPrefix();
571
+ const pid = this.getPid();
572
+ const traceId = this.getTraceIdStr();
573
+ const loc = this.getLocation(location);
574
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('⇢ HTTP STREAM START:'), chalk.bold(method), url);
575
+ }
576
+ httpStreamChunk(data) {
577
+ const chunkSize = typeof data === 'string' ? data.length : JSON.stringify(data).length;
578
+ const jsonLogger = getJsonStreamLogger();
579
+ if (jsonLogger?.isActive()) {
580
+ jsonLogger.logDebug('[HTTP] Stream Chunk', { bytes: chunkSize });
581
+ }
582
+ if (this.level < LogLevel.VERBOSE)
583
+ return;
584
+ const location = this.getCallLocation();
585
+ const timestamp = this.getTimestamp();
586
+ const prefix = this.getPrefix();
587
+ const pid = this.getPid();
588
+ const traceId = this.getTraceIdStr();
589
+ const loc = this.getLocation(location);
590
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.gray('⇨ HTTP STREAM CHUNK:'), `${chunkSize} bytes`);
591
+ }
592
+ httpStreamEnd(totalBytes, duration) {
593
+ const jsonLogger = getJsonStreamLogger();
594
+ if (jsonLogger?.isActive()) {
595
+ jsonLogger.logDebug(`HTTP Stream End`, { totalBytes, duration });
596
+ }
597
+ if (this.level < LogLevel.DEBUG)
598
+ return;
599
+ const location = this.getCallLocation();
600
+ const timestamp = this.getTimestamp();
601
+ const prefix = this.getPrefix();
602
+ const pid = this.getPid();
603
+ const traceId = this.getTraceIdStr();
604
+ const loc = this.getLocation(location);
605
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('⇠ HTTP STREAM END:'), `${totalBytes} bytes in ${duration}ms`);
606
+ }
607
+ toolStart(name, args, reason) {
608
+ const jsonLogger = getJsonStreamLogger();
609
+ if (jsonLogger?.isActive()) {
610
+ jsonLogger.logToolStart(name, args, reason);
611
+ }
612
+ if (this.level < LogLevel.DEBUG)
613
+ return;
614
+ const location = this.getCallLocation();
615
+ const timestamp = this.getTimestamp();
616
+ const prefix = this.getPrefix();
617
+ const pid = this.getPid();
618
+ const traceId = this.getTraceIdStr();
619
+ const loc = this.getLocation(location);
620
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('🔧 TOOL START:'), chalk.bold(name));
621
+ if (reason) {
622
+ console.log(chalk.blue(' Reason:'), reason);
623
+ }
624
+ if (args && this.level >= LogLevel.VERBOSE) {
625
+ console.log(chalk.blue(' Args:'), JSON.stringify(args, null, 2));
626
+ }
627
+ }
628
+ toolSuccess(name, _args, result, duration) {
629
+ const jsonLogger = getJsonStreamLogger();
630
+ if (jsonLogger?.isActive()) {
631
+ jsonLogger.logToolEnd(name, true, result, undefined, duration);
632
+ }
633
+ if (this.level < LogLevel.DEBUG)
634
+ return;
635
+ const location = this.getCallLocation();
636
+ const timestamp = this.getTimestamp();
637
+ const prefix = this.getPrefix();
638
+ const pid = this.getPid();
639
+ const traceId = this.getTraceIdStr();
640
+ const loc = this.getLocation(location);
641
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.green('✓ TOOL SUCCESS:'), chalk.bold(name), chalk.dim(`(${duration}ms)`));
642
+ if (result && this.level >= LogLevel.VERBOSE) {
643
+ console.log(chalk.green(' Result:'), this.formatValue(result));
644
+ }
645
+ }
646
+ toolError(name, args, error, duration) {
647
+ const jsonLogger = getJsonStreamLogger();
648
+ if (jsonLogger?.isActive()) {
649
+ jsonLogger.logToolEnd(name, false, undefined, error.message, duration);
650
+ }
651
+ if (this.level < LogLevel.ERROR)
652
+ return;
653
+ const location = this.getCallLocation();
654
+ const timestamp = this.getTimestamp();
655
+ const prefix = this.getPrefix();
656
+ const pid = this.getPid();
657
+ const traceId = this.getTraceIdStr();
658
+ const loc = this.getLocation(location);
659
+ console.log(timestamp, prefix, pid, traceId, loc, chalk.red('✗ TOOL ERROR:'), chalk.bold(name), chalk.dim(`(${duration}ms)`));
660
+ console.log(chalk.red(' Error:'), error.message);
661
+ if (args) {
662
+ console.log(chalk.red(' Args:'), JSON.stringify(args, null, 2));
663
+ }
664
+ }
665
+ userClick(element, context) {
666
+ const jsonLogger = getJsonStreamLogger();
667
+ if (jsonLogger?.isActive()) {
668
+ jsonLogger.logDebug(`[UI] User Click: ${element}`, context);
669
+ }
670
+ if (this.level < LogLevel.DEBUG)
671
+ return;
672
+ const location = this.getCallLocation();
673
+ const timestamp = this.getTimestamp();
674
+ const prefix = this.getPrefix();
675
+ const loc = this.getLocation(location);
676
+ console.log(timestamp, prefix, loc, chalk.yellow('👆 USER CLICK:'), element);
677
+ if (Object.keys(context).length > 0) {
678
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
679
+ }
680
+ }
681
+ userKeyboard(type, context) {
682
+ const jsonLogger = getJsonStreamLogger();
683
+ if (jsonLogger?.isActive()) {
684
+ jsonLogger.logDebug(`[UI] User Keyboard: ${type}`, context);
685
+ }
686
+ if (this.level < LogLevel.DEBUG)
687
+ return;
688
+ const location = this.getCallLocation();
689
+ const timestamp = this.getTimestamp();
690
+ const prefix = this.getPrefix();
691
+ const loc = this.getLocation(location);
692
+ console.log(timestamp, prefix, loc, chalk.yellow('⌨️ USER KEYBOARD:'), type);
693
+ if (Object.keys(context).length > 0) {
694
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
695
+ }
696
+ }
697
+ userScroll(context) {
698
+ const jsonLogger = getJsonStreamLogger();
699
+ if (jsonLogger?.isActive()) {
700
+ jsonLogger.logDebug('[UI] User Scroll', context);
701
+ }
702
+ if (this.level < LogLevel.VERBOSE)
703
+ return;
704
+ const location = this.getCallLocation();
705
+ const timestamp = this.getTimestamp();
706
+ const prefix = this.getPrefix();
707
+ const loc = this.getLocation(location);
708
+ console.log(timestamp, prefix, loc, chalk.gray('📜 USER SCROLL'));
709
+ if (Object.keys(context).length > 0) {
710
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
711
+ }
712
+ }
713
+ userDragStart(element, context) {
714
+ const jsonLogger = getJsonStreamLogger();
715
+ if (jsonLogger?.isActive()) {
716
+ jsonLogger.logDebug(`[UI] User Drag Start: ${element}`, context);
717
+ }
718
+ if (this.level < LogLevel.DEBUG)
719
+ return;
720
+ const location = this.getCallLocation();
721
+ const timestamp = this.getTimestamp();
722
+ const prefix = this.getPrefix();
723
+ const loc = this.getLocation(location);
724
+ console.log(timestamp, prefix, loc, chalk.yellow('🖱️ USER DRAG START:'), element);
725
+ if (Object.keys(context).length > 0) {
726
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
727
+ }
728
+ }
729
+ userDragEnd(element, context) {
730
+ const jsonLogger = getJsonStreamLogger();
731
+ if (jsonLogger?.isActive()) {
732
+ jsonLogger.logDebug(`[UI] User Drag End: ${element}`, context);
733
+ }
734
+ if (this.level < LogLevel.DEBUG)
735
+ return;
736
+ const location = this.getCallLocation();
737
+ const timestamp = this.getTimestamp();
738
+ const prefix = this.getPrefix();
739
+ const loc = this.getLocation(location);
740
+ console.log(timestamp, prefix, loc, chalk.yellow('🖱️ USER DRAG END:'), element);
741
+ if (Object.keys(context).length > 0) {
742
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
743
+ }
744
+ }
745
+ componentMount(name, context) {
746
+ const jsonLogger = getJsonStreamLogger();
747
+ if (jsonLogger?.isActive()) {
748
+ jsonLogger.logDebug(`[COMPONENT] Mount: ${name}`, context);
749
+ }
750
+ if (this.level < LogLevel.DEBUG)
751
+ return;
752
+ const location = this.getCallLocation();
753
+ const timestamp = this.getTimestamp();
754
+ const prefix = this.getPrefix();
755
+ const loc = this.getLocation(location);
756
+ console.log(timestamp, prefix, loc, chalk.green('📦 COMPONENT MOUNT:'), name);
757
+ if (Object.keys(context).length > 0) {
758
+ console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
759
+ }
760
+ }
761
+ componentUnmount(name, context) {
762
+ const jsonLogger = getJsonStreamLogger();
763
+ if (jsonLogger?.isActive()) {
764
+ jsonLogger.logDebug(`[COMPONENT] Unmount: ${name}`, context);
765
+ }
766
+ if (this.level < LogLevel.DEBUG)
767
+ return;
768
+ const location = this.getCallLocation();
769
+ const timestamp = this.getTimestamp();
770
+ const prefix = this.getPrefix();
771
+ const loc = this.getLocation(location);
772
+ console.log(timestamp, prefix, loc, chalk.red('📦 COMPONENT UNMOUNT:'), name);
773
+ if (Object.keys(context).length > 0) {
774
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
775
+ }
776
+ }
777
+ componentRender(name, context) {
778
+ const jsonLogger = getJsonStreamLogger();
779
+ if (jsonLogger?.isActive()) {
780
+ jsonLogger.logDebug(`[COMPONENT] Render: ${name}`, context);
781
+ }
782
+ if (this.level < LogLevel.VERBOSE)
783
+ return;
784
+ const location = this.getCallLocation();
785
+ const timestamp = this.getTimestamp();
786
+ const prefix = this.getPrefix();
787
+ const loc = this.getLocation(location);
788
+ console.log(timestamp, prefix, loc, chalk.blue('📦 COMPONENT RENDER:'), name);
789
+ if (Object.keys(context).length > 0) {
790
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
791
+ }
792
+ }
793
+ componentRenderComplete(name, context) {
794
+ const jsonLogger = getJsonStreamLogger();
795
+ if (jsonLogger?.isActive()) {
796
+ jsonLogger.logDebug(`[COMPONENT] Render Complete: ${name}`, context);
797
+ }
798
+ if (this.level < LogLevel.VERBOSE)
799
+ return;
800
+ const location = this.getCallLocation();
801
+ const timestamp = this.getTimestamp();
802
+ const prefix = this.getPrefix();
803
+ const loc = this.getLocation(location);
804
+ console.log(timestamp, prefix, loc, chalk.green('✓ COMPONENT RENDER COMPLETE:'), name);
805
+ if (Object.keys(context).length > 0) {
806
+ console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
807
+ }
808
+ }
809
+ componentStateChange(name, field, context) {
810
+ const jsonLogger = getJsonStreamLogger();
811
+ if (jsonLogger?.isActive()) {
812
+ jsonLogger.logDebug(`[COMPONENT] State Change: ${name}.${field}`, context);
813
+ }
814
+ if (this.level < LogLevel.DEBUG)
815
+ return;
816
+ const location = this.getCallLocation();
817
+ const timestamp = this.getTimestamp();
818
+ const prefix = this.getPrefix();
819
+ const loc = this.getLocation(location);
820
+ console.log(timestamp, prefix, loc, chalk.yellow('🔄 COMPONENT STATE:'), `${name}.${field}`);
821
+ if (Object.keys(context).length > 0) {
822
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
823
+ }
824
+ }
825
+ screenChange(to, context) {
826
+ const jsonLogger = getJsonStreamLogger();
827
+ if (jsonLogger?.isActive()) {
828
+ jsonLogger.logDebug(`[SCREEN] Change: ${to}`, context);
829
+ }
830
+ if (this.level < LogLevel.DEBUG)
831
+ return;
832
+ const location = this.getCallLocation();
833
+ const timestamp = this.getTimestamp();
834
+ const prefix = this.getPrefix();
835
+ const loc = this.getLocation(location);
836
+ console.log(timestamp, prefix, loc, chalk.magenta('📱 SCREEN CHANGE:'), to);
837
+ if (Object.keys(context).length > 0) {
838
+ console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
839
+ }
840
+ }
841
+ tabChange(container, context) {
842
+ const jsonLogger = getJsonStreamLogger();
843
+ if (jsonLogger?.isActive()) {
844
+ jsonLogger.logDebug(`[TAB] Change: ${container}`, context);
845
+ }
846
+ if (this.level < LogLevel.DEBUG)
847
+ return;
848
+ const location = this.getCallLocation();
849
+ const timestamp = this.getTimestamp();
850
+ const prefix = this.getPrefix();
851
+ const loc = this.getLocation(location);
852
+ console.log(timestamp, prefix, loc, chalk.magenta('🗂️ TAB CHANGE:'), container);
853
+ if (Object.keys(context).length > 0) {
854
+ console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
855
+ }
856
+ }
857
+ routeChange(context) {
858
+ const jsonLogger = getJsonStreamLogger();
859
+ if (jsonLogger?.isActive()) {
860
+ jsonLogger.logDebug(`[ROUTE] Change`, context);
861
+ }
862
+ if (this.level < LogLevel.DEBUG)
863
+ return;
864
+ const location = this.getCallLocation();
865
+ const timestamp = this.getTimestamp();
866
+ const prefix = this.getPrefix();
867
+ const loc = this.getLocation(location);
868
+ console.log(timestamp, prefix, loc, chalk.magenta('🛤️ ROUTE CHANGE'));
869
+ if (Object.keys(context).length > 0) {
870
+ console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
871
+ }
872
+ }
873
+ formStart(formId, context) {
874
+ const jsonLogger = getJsonStreamLogger();
875
+ if (jsonLogger?.isActive()) {
876
+ jsonLogger.logDebug(`[FORM] Start: ${formId}`, context);
877
+ }
878
+ if (this.level < LogLevel.DEBUG)
879
+ return;
880
+ const location = this.getCallLocation();
881
+ const timestamp = this.getTimestamp();
882
+ const prefix = this.getPrefix();
883
+ const loc = this.getLocation(location);
884
+ console.log(timestamp, prefix, loc, chalk.blue('📝 FORM START:'), formId);
885
+ if (Object.keys(context).length > 0) {
886
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
887
+ }
888
+ }
889
+ formSubmit(formId, context) {
890
+ const jsonLogger = getJsonStreamLogger();
891
+ if (jsonLogger?.isActive()) {
892
+ jsonLogger.logDebug(`[FORM] Submit: ${formId}`, context);
893
+ }
894
+ if (this.level < LogLevel.DEBUG)
895
+ return;
896
+ const location = this.getCallLocation();
897
+ const timestamp = this.getTimestamp();
898
+ const prefix = this.getPrefix();
899
+ const loc = this.getLocation(location);
900
+ console.log(timestamp, prefix, loc, chalk.blue('📤 FORM SUBMIT:'), formId);
901
+ if (Object.keys(context).length > 0) {
902
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
903
+ }
904
+ }
905
+ formResult(formId, context) {
906
+ const jsonLogger = getJsonStreamLogger();
907
+ if (jsonLogger?.isActive()) {
908
+ jsonLogger.logDebug(`[FORM] Result: ${formId}`, context);
909
+ }
910
+ if (this.level < LogLevel.DEBUG)
911
+ return;
912
+ const location = this.getCallLocation();
913
+ const timestamp = this.getTimestamp();
914
+ const prefix = this.getPrefix();
915
+ const loc = this.getLocation(location);
916
+ console.log(timestamp, prefix, loc, chalk.green('✓ FORM RESULT:'), formId);
917
+ if (Object.keys(context).length > 0) {
918
+ console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
919
+ }
920
+ }
921
+ formError(formId, context) {
922
+ const jsonLogger = getJsonStreamLogger();
923
+ if (jsonLogger?.isActive()) {
924
+ jsonLogger.logDebug(`[FORM] Error: ${formId}`, context);
925
+ }
926
+ if (this.level < LogLevel.DEBUG)
927
+ return;
928
+ const location = this.getCallLocation();
929
+ const timestamp = this.getTimestamp();
930
+ const prefix = this.getPrefix();
931
+ const loc = this.getLocation(location);
932
+ console.log(timestamp, prefix, loc, chalk.red('✗ FORM ERROR:'), formId);
933
+ if (Object.keys(context).length > 0) {
934
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
935
+ }
936
+ }
937
+ fieldChange(formId, field, context) {
938
+ const jsonLogger = getJsonStreamLogger();
939
+ if (jsonLogger?.isActive()) {
940
+ jsonLogger.logDebug(`[FORM] Field Change: ${formId}.${field}`, context);
941
+ }
942
+ if (this.level < LogLevel.VERBOSE)
943
+ return;
944
+ const location = this.getCallLocation();
945
+ const timestamp = this.getTimestamp();
946
+ const prefix = this.getPrefix();
947
+ const loc = this.getLocation(location);
948
+ console.log(timestamp, prefix, loc, chalk.gray('📝 FIELD CHANGE:'), `${formId}.${field}`);
949
+ if (Object.keys(context).length > 0) {
950
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
951
+ }
952
+ }
953
+ fieldValidation(formId, field, context) {
954
+ const jsonLogger = getJsonStreamLogger();
955
+ if (jsonLogger?.isActive()) {
956
+ jsonLogger.logDebug(`[FORM] Field Validation: ${formId}.${field}`, context);
957
+ }
958
+ if (this.level < LogLevel.DEBUG)
959
+ return;
960
+ const location = this.getCallLocation();
961
+ const timestamp = this.getTimestamp();
962
+ const prefix = this.getPrefix();
963
+ const loc = this.getLocation(location);
964
+ console.log(timestamp, prefix, loc, chalk.yellow('✓ FIELD VALIDATION:'), `${formId}.${field}`);
965
+ if (Object.keys(context).length > 0) {
966
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
967
+ }
968
+ }
969
+ modalOpen(id, context) {
970
+ const jsonLogger = getJsonStreamLogger();
971
+ if (jsonLogger?.isActive()) {
972
+ jsonLogger.logDebug(`[MODAL] Open: ${id}`, context);
973
+ }
974
+ if (this.level < LogLevel.DEBUG)
975
+ return;
976
+ const location = this.getCallLocation();
977
+ const timestamp = this.getTimestamp();
978
+ const prefix = this.getPrefix();
979
+ const loc = this.getLocation(location);
980
+ console.log(timestamp, prefix, loc, chalk.cyan('📭 MODAL OPEN:'), id);
981
+ if (Object.keys(context).length > 0) {
982
+ console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
983
+ }
984
+ }
985
+ modalClose(id, context) {
986
+ const jsonLogger = getJsonStreamLogger();
987
+ if (jsonLogger?.isActive()) {
988
+ jsonLogger.logDebug(`[MODAL] Close: ${id}`, context);
989
+ }
990
+ if (this.level < LogLevel.DEBUG)
991
+ return;
992
+ const location = this.getCallLocation();
993
+ const timestamp = this.getTimestamp();
994
+ const prefix = this.getPrefix();
995
+ const loc = this.getLocation(location);
996
+ console.log(timestamp, prefix, loc, chalk.cyan('📪 MODAL CLOSE:'), id);
997
+ if (Object.keys(context).length > 0) {
998
+ console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
999
+ }
1000
+ }
1001
+ dialogShow(type, context) {
1002
+ const jsonLogger = getJsonStreamLogger();
1003
+ if (jsonLogger?.isActive()) {
1004
+ jsonLogger.logDebug(`[DIALOG] Show: ${type}`, context);
1005
+ }
1006
+ if (this.level < LogLevel.DEBUG)
1007
+ return;
1008
+ const location = this.getCallLocation();
1009
+ const timestamp = this.getTimestamp();
1010
+ const prefix = this.getPrefix();
1011
+ const loc = this.getLocation(location);
1012
+ console.log(timestamp, prefix, loc, chalk.cyan('💬 DIALOG SHOW:'), type);
1013
+ if (Object.keys(context).length > 0) {
1014
+ console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
1015
+ }
1016
+ }
1017
+ dialogResult(type, context) {
1018
+ const jsonLogger = getJsonStreamLogger();
1019
+ if (jsonLogger?.isActive()) {
1020
+ jsonLogger.logDebug(`[DIALOG] Result: ${type}`, context);
1021
+ }
1022
+ if (this.level < LogLevel.DEBUG)
1023
+ return;
1024
+ const location = this.getCallLocation();
1025
+ const timestamp = this.getTimestamp();
1026
+ const prefix = this.getPrefix();
1027
+ const loc = this.getLocation(location);
1028
+ console.log(timestamp, prefix, loc, chalk.cyan('💬 DIALOG RESULT:'), type);
1029
+ if (Object.keys(context).length > 0) {
1030
+ console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
1031
+ }
1032
+ }
1033
+ toastShow(context) {
1034
+ const jsonLogger = getJsonStreamLogger();
1035
+ if (jsonLogger?.isActive()) {
1036
+ jsonLogger.logDebug(`[TOAST] Show`, context);
1037
+ }
1038
+ if (this.level < LogLevel.DEBUG)
1039
+ return;
1040
+ const location = this.getCallLocation();
1041
+ const timestamp = this.getTimestamp();
1042
+ const prefix = this.getPrefix();
1043
+ const loc = this.getLocation(location);
1044
+ console.log(timestamp, prefix, loc, chalk.yellow('🔔 TOAST SHOW'));
1045
+ if (Object.keys(context).length > 0) {
1046
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
1047
+ }
1048
+ }
1049
+ toastDismiss(context) {
1050
+ const jsonLogger = getJsonStreamLogger();
1051
+ if (jsonLogger?.isActive()) {
1052
+ jsonLogger.logDebug(`[TOAST] Dismiss`, context);
1053
+ }
1054
+ if (this.level < LogLevel.DEBUG)
1055
+ return;
1056
+ const location = this.getCallLocation();
1057
+ const timestamp = this.getTimestamp();
1058
+ const prefix = this.getPrefix();
1059
+ const loc = this.getLocation(location);
1060
+ console.log(timestamp, prefix, loc, chalk.gray('🔕 TOAST DISMISS'));
1061
+ if (Object.keys(context).length > 0) {
1062
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
1063
+ }
1064
+ }
1065
+ loadingStart(id, context) {
1066
+ const jsonLogger = getJsonStreamLogger();
1067
+ if (jsonLogger?.isActive()) {
1068
+ jsonLogger.logDebug(`[LOADING] Start: ${id}`, context);
1069
+ }
1070
+ if (this.level < LogLevel.DEBUG)
1071
+ return;
1072
+ const location = this.getCallLocation();
1073
+ const timestamp = this.getTimestamp();
1074
+ const prefix = this.getPrefix();
1075
+ const loc = this.getLocation(location);
1076
+ console.log(timestamp, prefix, loc, chalk.blue('⏳ LOADING START:'), id);
1077
+ if (Object.keys(context).length > 0) {
1078
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
1079
+ }
1080
+ }
1081
+ loadingEnd(id, context) {
1082
+ const jsonLogger = getJsonStreamLogger();
1083
+ if (jsonLogger?.isActive()) {
1084
+ jsonLogger.logDebug(`[LOADING] End: ${id}`, context);
1085
+ }
1086
+ if (this.level < LogLevel.DEBUG)
1087
+ return;
1088
+ const location = this.getCallLocation();
1089
+ const timestamp = this.getTimestamp();
1090
+ const prefix = this.getPrefix();
1091
+ const loc = this.getLocation(location);
1092
+ console.log(timestamp, prefix, loc, chalk.green('✓ LOADING END:'), id);
1093
+ if (Object.keys(context).length > 0) {
1094
+ console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
1095
+ }
1096
+ }
1097
+ loadingError(id, context) {
1098
+ const jsonLogger = getJsonStreamLogger();
1099
+ if (jsonLogger?.isActive()) {
1100
+ jsonLogger.logDebug(`[LOADING] Error: ${id}`, context);
1101
+ }
1102
+ if (this.level < LogLevel.DEBUG)
1103
+ return;
1104
+ const location = this.getCallLocation();
1105
+ const timestamp = this.getTimestamp();
1106
+ const prefix = this.getPrefix();
1107
+ const loc = this.getLocation(location);
1108
+ console.log(timestamp, prefix, loc, chalk.red('✗ LOADING ERROR:'), id);
1109
+ if (Object.keys(context).length > 0) {
1110
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
1111
+ }
1112
+ }
1113
+ skeletonShow(id, context) {
1114
+ const jsonLogger = getJsonStreamLogger();
1115
+ if (jsonLogger?.isActive()) {
1116
+ jsonLogger.logDebug(`[UI] Skeleton Show: ${id}`, context);
1117
+ }
1118
+ if (this.level < LogLevel.VERBOSE)
1119
+ return;
1120
+ const location = this.getCallLocation();
1121
+ const timestamp = this.getTimestamp();
1122
+ const prefix = this.getPrefix();
1123
+ const loc = this.getLocation(location);
1124
+ console.log(timestamp, prefix, loc, chalk.gray('💀 SKELETON SHOW:'), id);
1125
+ if (Object.keys(context).length > 0) {
1126
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
1127
+ }
1128
+ }
1129
+ skeletonHide(id, context) {
1130
+ const jsonLogger = getJsonStreamLogger();
1131
+ if (jsonLogger?.isActive()) {
1132
+ jsonLogger.logDebug(`[UI] Skeleton Hide: ${id}`, context);
1133
+ }
1134
+ if (this.level < LogLevel.VERBOSE)
1135
+ return;
1136
+ const location = this.getCallLocation();
1137
+ const timestamp = this.getTimestamp();
1138
+ const prefix = this.getPrefix();
1139
+ const loc = this.getLocation(location);
1140
+ console.log(timestamp, prefix, loc, chalk.gray('💀 SKELETON HIDE:'), id);
1141
+ if (Object.keys(context).length > 0) {
1142
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
1143
+ }
1144
+ }
1145
+ progressStart(id, context) {
1146
+ const jsonLogger = getJsonStreamLogger();
1147
+ if (jsonLogger?.isActive()) {
1148
+ jsonLogger.logDebug(`[PROGRESS] Start: ${id}`, context);
1149
+ }
1150
+ if (this.level < LogLevel.DEBUG)
1151
+ return;
1152
+ const location = this.getCallLocation();
1153
+ const timestamp = this.getTimestamp();
1154
+ const prefix = this.getPrefix();
1155
+ const loc = this.getLocation(location);
1156
+ console.log(timestamp, prefix, loc, chalk.blue('📊 PROGRESS START:'), id);
1157
+ if (Object.keys(context).length > 0) {
1158
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
1159
+ }
1160
+ }
1161
+ progressUpdate(id, context) {
1162
+ const jsonLogger = getJsonStreamLogger();
1163
+ if (jsonLogger?.isActive()) {
1164
+ jsonLogger.logDebug(`[PROGRESS] Update: ${id}`, context);
1165
+ }
1166
+ if (this.level < LogLevel.VERBOSE)
1167
+ return;
1168
+ const location = this.getCallLocation();
1169
+ const timestamp = this.getTimestamp();
1170
+ const prefix = this.getPrefix();
1171
+ const loc = this.getLocation(location);
1172
+ console.log(timestamp, prefix, loc, chalk.blue('📊 PROGRESS UPDATE:'), id);
1173
+ if (Object.keys(context).length > 0) {
1174
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
1175
+ }
1176
+ }
1177
+ progressComplete(id, context) {
1178
+ const jsonLogger = getJsonStreamLogger();
1179
+ if (jsonLogger?.isActive()) {
1180
+ jsonLogger.logDebug(`[PROGRESS] Complete: ${id}`, context);
1181
+ }
1182
+ if (this.level < LogLevel.DEBUG)
1183
+ return;
1184
+ const location = this.getCallLocation();
1185
+ const timestamp = this.getTimestamp();
1186
+ const prefix = this.getPrefix();
1187
+ const loc = this.getLocation(location);
1188
+ console.log(timestamp, prefix, loc, chalk.green('✓ PROGRESS COMPLETE:'), id);
1189
+ if (Object.keys(context).length > 0) {
1190
+ console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
1191
+ }
1192
+ }
1193
+ progressError(id, context) {
1194
+ const jsonLogger = getJsonStreamLogger();
1195
+ if (jsonLogger?.isActive()) {
1196
+ jsonLogger.logDebug(`[PROGRESS] Error: ${id}`, context);
1197
+ }
1198
+ if (this.level < LogLevel.DEBUG)
1199
+ return;
1200
+ const location = this.getCallLocation();
1201
+ const timestamp = this.getTimestamp();
1202
+ const prefix = this.getPrefix();
1203
+ const loc = this.getLocation(location);
1204
+ console.log(timestamp, prefix, loc, chalk.red('✗ PROGRESS ERROR:'), id);
1205
+ if (Object.keys(context).length > 0) {
1206
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
1207
+ }
1208
+ }
1209
+ animationStart(name, context) {
1210
+ const jsonLogger = getJsonStreamLogger();
1211
+ if (jsonLogger?.isActive()) {
1212
+ jsonLogger.logDebug(`[UI] Animation Start: ${name}`, context);
1213
+ }
1214
+ if (this.level < LogLevel.VERBOSE)
1215
+ return;
1216
+ const location = this.getCallLocation();
1217
+ const timestamp = this.getTimestamp();
1218
+ const prefix = this.getPrefix();
1219
+ const loc = this.getLocation(location);
1220
+ console.log(timestamp, prefix, loc, chalk.magenta('🎬 ANIMATION START:'), name);
1221
+ if (Object.keys(context).length > 0) {
1222
+ console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
1223
+ }
1224
+ }
1225
+ animationEnd(name, context) {
1226
+ const jsonLogger = getJsonStreamLogger();
1227
+ if (jsonLogger?.isActive()) {
1228
+ jsonLogger.logDebug(`[UI] Animation End: ${name}`, context);
1229
+ }
1230
+ if (this.level < LogLevel.VERBOSE)
1231
+ return;
1232
+ const location = this.getCallLocation();
1233
+ const timestamp = this.getTimestamp();
1234
+ const prefix = this.getPrefix();
1235
+ const loc = this.getLocation(location);
1236
+ console.log(timestamp, prefix, loc, chalk.magenta('🎬 ANIMATION END:'), name);
1237
+ if (Object.keys(context).length > 0) {
1238
+ console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
1239
+ }
1240
+ }
1241
+ transitionStart(name, context) {
1242
+ const jsonLogger = getJsonStreamLogger();
1243
+ if (jsonLogger?.isActive()) {
1244
+ jsonLogger.logDebug(`[UI] Transition Start: ${name}`, context);
1245
+ }
1246
+ if (this.level < LogLevel.VERBOSE)
1247
+ return;
1248
+ const location = this.getCallLocation();
1249
+ const timestamp = this.getTimestamp();
1250
+ const prefix = this.getPrefix();
1251
+ const loc = this.getLocation(location);
1252
+ console.log(timestamp, prefix, loc, chalk.magenta('🔀 TRANSITION START:'), name);
1253
+ if (Object.keys(context).length > 0) {
1254
+ console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
1255
+ }
1256
+ }
1257
+ transitionEnd(name, context) {
1258
+ const jsonLogger = getJsonStreamLogger();
1259
+ if (jsonLogger?.isActive()) {
1260
+ jsonLogger.logDebug(`[UI] Transition End: ${name}`, context);
1261
+ }
1262
+ if (this.level < LogLevel.VERBOSE)
1263
+ return;
1264
+ const location = this.getCallLocation();
1265
+ const timestamp = this.getTimestamp();
1266
+ const prefix = this.getPrefix();
1267
+ const loc = this.getLocation(location);
1268
+ console.log(timestamp, prefix, loc, chalk.magenta('🔀 TRANSITION END:'), name);
1269
+ if (Object.keys(context).length > 0) {
1270
+ console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
1271
+ }
1272
+ }
1273
+ hoverEnter(element, context) {
1274
+ const jsonLogger = getJsonStreamLogger();
1275
+ if (jsonLogger?.isActive()) {
1276
+ jsonLogger.logDebug(`[UI] Hover Enter: ${element}`, context);
1277
+ }
1278
+ if (this.level < LogLevel.VERBOSE)
1279
+ return;
1280
+ const location = this.getCallLocation();
1281
+ const timestamp = this.getTimestamp();
1282
+ const prefix = this.getPrefix();
1283
+ const loc = this.getLocation(location);
1284
+ console.log(timestamp, prefix, loc, chalk.gray('🖱️ HOVER ENTER:'), element);
1285
+ if (Object.keys(context).length > 0) {
1286
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
1287
+ }
1288
+ }
1289
+ hoverLeave(element, context) {
1290
+ const jsonLogger = getJsonStreamLogger();
1291
+ if (jsonLogger?.isActive()) {
1292
+ jsonLogger.logDebug(`[UI] Hover Leave: ${element}`, context);
1293
+ }
1294
+ if (this.level < LogLevel.VERBOSE)
1295
+ return;
1296
+ const location = this.getCallLocation();
1297
+ const timestamp = this.getTimestamp();
1298
+ const prefix = this.getPrefix();
1299
+ const loc = this.getLocation(location);
1300
+ console.log(timestamp, prefix, loc, chalk.gray('🖱️ HOVER LEAVE:'), element);
1301
+ if (Object.keys(context).length > 0) {
1302
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
1303
+ }
1304
+ }
1305
+ viewportResize(context) {
1306
+ const jsonLogger = getJsonStreamLogger();
1307
+ if (jsonLogger?.isActive()) {
1308
+ jsonLogger.logDebug(`[LAYOUT] Viewport Resize`, context);
1309
+ }
1310
+ if (this.level < LogLevel.DEBUG)
1311
+ return;
1312
+ const location = this.getCallLocation();
1313
+ const timestamp = this.getTimestamp();
1314
+ const prefix = this.getPrefix();
1315
+ const loc = this.getLocation(location);
1316
+ console.log(timestamp, prefix, loc, chalk.blue('📐 VIEWPORT RESIZE'));
1317
+ if (Object.keys(context).length > 0) {
1318
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
1319
+ }
1320
+ }
1321
+ breakpointChange(context) {
1322
+ const jsonLogger = getJsonStreamLogger();
1323
+ if (jsonLogger?.isActive()) {
1324
+ jsonLogger.logDebug(`[LAYOUT] Breakpoint Change`, context);
1325
+ }
1326
+ if (this.level < LogLevel.DEBUG)
1327
+ return;
1328
+ const location = this.getCallLocation();
1329
+ const timestamp = this.getTimestamp();
1330
+ const prefix = this.getPrefix();
1331
+ const loc = this.getLocation(location);
1332
+ console.log(timestamp, prefix, loc, chalk.blue('📐 BREAKPOINT CHANGE'));
1333
+ if (Object.keys(context).length > 0) {
1334
+ console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
1335
+ }
1336
+ }
1337
+ layoutShift(context) {
1338
+ const jsonLogger = getJsonStreamLogger();
1339
+ if (jsonLogger?.isActive()) {
1340
+ jsonLogger.logDebug(`[LAYOUT] Shift`, context);
1341
+ }
1342
+ if (this.level < LogLevel.DEBUG)
1343
+ return;
1344
+ const location = this.getCallLocation();
1345
+ const timestamp = this.getTimestamp();
1346
+ const prefix = this.getPrefix();
1347
+ const loc = this.getLocation(location);
1348
+ console.log(timestamp, prefix, loc, chalk.yellow('📐 LAYOUT SHIFT'));
1349
+ if (Object.keys(context).length > 0) {
1350
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
1351
+ }
1352
+ }
1353
+ scrollPosition(context) {
1354
+ const jsonLogger = getJsonStreamLogger();
1355
+ if (jsonLogger?.isActive()) {
1356
+ jsonLogger.logDebug('[UI] Scroll Position', context);
1357
+ }
1358
+ if (this.level < LogLevel.VERBOSE)
1359
+ return;
1360
+ const location = this.getCallLocation();
1361
+ const timestamp = this.getTimestamp();
1362
+ const prefix = this.getPrefix();
1363
+ const loc = this.getLocation(location);
1364
+ console.log(timestamp, prefix, loc, chalk.gray('📜 SCROLL POSITION'));
1365
+ if (Object.keys(context).length > 0) {
1366
+ console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
1367
+ }
1368
+ }
1369
+ errorBoundary(context) {
1370
+ const jsonLogger = getJsonStreamLogger();
1371
+ if (jsonLogger?.isActive()) {
1372
+ jsonLogger.logError(new Error('Error Boundary'), 'errorBoundary');
1373
+ }
1374
+ if (this.level < LogLevel.ERROR)
1375
+ return;
1376
+ const location = this.getCallLocation();
1377
+ const timestamp = this.getTimestamp();
1378
+ const prefix = this.getPrefix();
1379
+ const loc = this.getLocation(location);
1380
+ console.log(timestamp, prefix, loc, chalk.red('🛡️ ERROR BOUNDARY'));
1381
+ if (Object.keys(context).length > 0) {
1382
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
1383
+ }
1384
+ }
1385
+ unhandledRejection(context) {
1386
+ const jsonLogger = getJsonStreamLogger();
1387
+ if (jsonLogger?.isActive()) {
1388
+ jsonLogger.logError(new Error('Unhandled Rejection'), 'unhandledRejection');
1389
+ }
1390
+ if (this.level < LogLevel.ERROR)
1391
+ return;
1392
+ const location = this.getCallLocation();
1393
+ const timestamp = this.getTimestamp();
1394
+ const prefix = this.getPrefix();
1395
+ const loc = this.getLocation(location);
1396
+ console.log(timestamp, prefix, loc, chalk.red('⚠️ UNHANDLED REJECTION'));
1397
+ if (Object.keys(context).length > 0) {
1398
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
1399
+ }
1400
+ }
1401
+ globalError(context) {
1402
+ const jsonLogger = getJsonStreamLogger();
1403
+ if (jsonLogger?.isActive()) {
1404
+ jsonLogger.logError(new Error('Global Error'), 'globalError');
1405
+ }
1406
+ if (this.level < LogLevel.ERROR)
1407
+ return;
1408
+ const location = this.getCallLocation();
1409
+ const timestamp = this.getTimestamp();
1410
+ const prefix = this.getPrefix();
1411
+ const loc = this.getLocation(location);
1412
+ console.log(timestamp, prefix, loc, chalk.red('💥 GLOBAL ERROR'));
1413
+ if (Object.keys(context).length > 0) {
1414
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
1415
+ }
1416
+ }
1417
+ sessionStart(context) {
1418
+ const jsonLogger = getJsonStreamLogger();
1419
+ if (jsonLogger?.isActive()) {
1420
+ jsonLogger.logInfo(`Session Start`, context);
1421
+ }
1422
+ if (this.level < LogLevel.INFO)
1423
+ return;
1424
+ const location = this.getCallLocation();
1425
+ const timestamp = this.getTimestamp();
1426
+ const prefix = this.getPrefix();
1427
+ const loc = this.getLocation(location);
1428
+ console.log(timestamp, prefix, loc, chalk.green('🚀 SESSION START'));
1429
+ if (Object.keys(context).length > 0) {
1430
+ console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
1431
+ }
1432
+ }
1433
+ sessionEnd(context) {
1434
+ const jsonLogger = getJsonStreamLogger();
1435
+ if (jsonLogger?.isActive()) {
1436
+ jsonLogger.logInfo(`Session End`, context);
1437
+ }
1438
+ if (this.level < LogLevel.INFO)
1439
+ return;
1440
+ const location = this.getCallLocation();
1441
+ const timestamp = this.getTimestamp();
1442
+ const prefix = this.getPrefix();
1443
+ const loc = this.getLocation(location);
1444
+ console.log(timestamp, prefix, loc, chalk.red('🏁 SESSION END'));
1445
+ if (Object.keys(context).length > 0) {
1446
+ console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
1447
+ }
1448
+ }
1449
+ userMilestone(name, context) {
1450
+ const jsonLogger = getJsonStreamLogger();
1451
+ if (jsonLogger?.isActive()) {
1452
+ jsonLogger.logInfo(`User Milestone: ${name}`, context);
1453
+ }
1454
+ if (this.level < LogLevel.INFO)
1455
+ return;
1456
+ const location = this.getCallLocation();
1457
+ const timestamp = this.getTimestamp();
1458
+ const prefix = this.getPrefix();
1459
+ const loc = this.getLocation(location);
1460
+ console.log(timestamp, prefix, loc, chalk.yellow('🏆 USER MILESTONE:'), name);
1461
+ if (Object.keys(context).length > 0) {
1462
+ console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
1463
+ }
1464
+ }
1465
+ featureUsage(name, context) {
1466
+ const jsonLogger = getJsonStreamLogger();
1467
+ if (jsonLogger?.isActive()) {
1468
+ jsonLogger.logDebug(`Feature Usage: ${name}`, context);
1469
+ }
1470
+ if (this.level < LogLevel.DEBUG)
1471
+ return;
1472
+ const location = this.getCallLocation();
1473
+ const timestamp = this.getTimestamp();
1474
+ const prefix = this.getPrefix();
1475
+ const loc = this.getLocation(location);
1476
+ console.log(timestamp, prefix, loc, chalk.cyan('📊 FEATURE USAGE:'), name);
1477
+ if (Object.keys(context).length > 0) {
1478
+ console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
1479
+ }
1480
+ }
1481
+ updateCheckStart() {
1482
+ const jsonLogger = getJsonStreamLogger();
1483
+ if (jsonLogger?.isActive()) {
1484
+ jsonLogger.logInfo('Update Check Start', {});
1485
+ }
1486
+ if (this.level < LogLevel.INFO)
1487
+ return;
1488
+ const location = this.getCallLocation();
1489
+ const timestamp = this.getTimestamp();
1490
+ const prefix = this.getPrefix();
1491
+ const loc = this.getLocation(location);
1492
+ console.log(timestamp, prefix, loc, chalk.cyan('🔄 UPDATE CHECK START'));
1493
+ }
1494
+ updateAvailable(context) {
1495
+ const jsonLogger = getJsonStreamLogger();
1496
+ if (jsonLogger?.isActive()) {
1497
+ jsonLogger.logInfo('Update Available', context);
1498
+ }
1499
+ if (this.level < LogLevel.INFO)
1500
+ return;
1501
+ const location = this.getCallLocation();
1502
+ const timestamp = this.getTimestamp();
1503
+ const prefix = this.getPrefix();
1504
+ const loc = this.getLocation(location);
1505
+ console.log(timestamp, prefix, loc, chalk.green('✨ UPDATE AVAILABLE'));
1506
+ if (Object.keys(context).length > 0) {
1507
+ console.log(chalk.green(' Version:'), context['version']);
1508
+ }
1509
+ }
1510
+ updateDownloadStart(context) {
1511
+ const jsonLogger = getJsonStreamLogger();
1512
+ if (jsonLogger?.isActive()) {
1513
+ jsonLogger.logInfo('Update Download Start', context);
1514
+ }
1515
+ if (this.level < LogLevel.INFO)
1516
+ return;
1517
+ const location = this.getCallLocation();
1518
+ const timestamp = this.getTimestamp();
1519
+ const prefix = this.getPrefix();
1520
+ const loc = this.getLocation(location);
1521
+ console.log(timestamp, prefix, loc, chalk.cyan('⬇️ UPDATE DOWNLOAD START'));
1522
+ if (Object.keys(context).length > 0) {
1523
+ console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
1524
+ }
1525
+ }
1526
+ updateDownloadProgress(context) {
1527
+ const jsonLogger = getJsonStreamLogger();
1528
+ if (jsonLogger?.isActive()) {
1529
+ jsonLogger.logDebug('Update Download Progress', context);
1530
+ }
1531
+ if (this.level < LogLevel.DEBUG)
1532
+ return;
1533
+ const location = this.getCallLocation();
1534
+ const timestamp = this.getTimestamp();
1535
+ const prefix = this.getPrefix();
1536
+ const loc = this.getLocation(location);
1537
+ console.log(timestamp, prefix, loc, chalk.cyan('⬇️ DOWNLOAD PROGRESS:'), `${context['percent']}%`);
1538
+ }
1539
+ updateDownloadComplete(context) {
1540
+ const jsonLogger = getJsonStreamLogger();
1541
+ if (jsonLogger?.isActive()) {
1542
+ jsonLogger.logInfo('Update Download Complete', context);
1543
+ }
1544
+ if (this.level < LogLevel.INFO)
1545
+ return;
1546
+ const location = this.getCallLocation();
1547
+ const timestamp = this.getTimestamp();
1548
+ const prefix = this.getPrefix();
1549
+ const loc = this.getLocation(location);
1550
+ console.log(timestamp, prefix, loc, chalk.green('✅ UPDATE DOWNLOAD COMPLETE'));
1551
+ if (Object.keys(context).length > 0) {
1552
+ console.log(chalk.green(' Version:'), context['version']);
1553
+ }
1554
+ }
1555
+ updateInstalling() {
1556
+ const jsonLogger = getJsonStreamLogger();
1557
+ if (jsonLogger?.isActive()) {
1558
+ jsonLogger.logInfo('Update Installing', {});
1559
+ }
1560
+ if (this.level < LogLevel.INFO)
1561
+ return;
1562
+ const location = this.getCallLocation();
1563
+ const timestamp = this.getTimestamp();
1564
+ const prefix = this.getPrefix();
1565
+ const loc = this.getLocation(location);
1566
+ console.log(timestamp, prefix, loc, chalk.yellow('🔧 UPDATE INSTALLING'));
1567
+ }
1568
+ updateInstalled(context) {
1569
+ const jsonLogger = getJsonStreamLogger();
1570
+ if (jsonLogger?.isActive()) {
1571
+ jsonLogger.logInfo('Update Installed', context);
1572
+ }
1573
+ if (this.level < LogLevel.INFO)
1574
+ return;
1575
+ const location = this.getCallLocation();
1576
+ const timestamp = this.getTimestamp();
1577
+ const prefix = this.getPrefix();
1578
+ const loc = this.getLocation(location);
1579
+ console.log(timestamp, prefix, loc, chalk.green('🎉 UPDATE INSTALLED'));
1580
+ if (Object.keys(context).length > 0) {
1581
+ console.log(chalk.green(' Version:'), context['version']);
1582
+ }
1583
+ }
1584
+ updateError(context) {
1585
+ const jsonLogger = getJsonStreamLogger();
1586
+ if (jsonLogger?.isActive()) {
1587
+ jsonLogger.logError(new Error(String(context['error'] || 'Unknown error')), 'updateError');
1588
+ }
1589
+ if (this.level < LogLevel.ERROR)
1590
+ return;
1591
+ const location = this.getCallLocation();
1592
+ const timestamp = this.getTimestamp();
1593
+ const prefix = this.getPrefix();
1594
+ const loc = this.getLocation(location);
1595
+ console.log(timestamp, prefix, loc, chalk.red('❌ UPDATE ERROR'));
1596
+ if (Object.keys(context).length > 0) {
1597
+ console.log(chalk.red(' Error:'), context['error']);
1598
+ }
1599
+ }
1600
+ }
1601
+ export const logger = new Logger({
1602
+ level: LogLevel.ERROR,
1603
+ prefix: '한설',
1604
+ timestamp: true,
1605
+ showLocation: false,
1606
+ showPid: false,
1607
+ });
1608
+ export function setLogLevel(level) {
1609
+ logger.setLevel(level);
1610
+ if (level >= LogLevel.DEBUG) {
1611
+ logger['showLocation'] = true;
1612
+ }
1613
+ }
1614
+ export function enableVerbose() {
1615
+ logger.setLevel(LogLevel.VERBOSE);
1616
+ }
1617
+ export function disableVerbose() {
1618
+ logger.setLevel(LogLevel.INFO);
1619
+ }
1620
+ export function enableDebug() {
1621
+ logger.setLevel(LogLevel.DEBUG);
1622
+ }
1623
+ export function createLogger(prefix, options) {
1624
+ return new Logger({
1625
+ level: logger['level'],
1626
+ prefix,
1627
+ timestamp: true,
1628
+ showLocation: logger['showLocation'],
1629
+ showPid: logger['showPid'],
1630
+ ...options,
1631
+ });
1632
+ }
1633
+ export function generateTraceId() {
1634
+ return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
1635
+ }
1636
+ export async function setupLogging(options) {
1637
+ const { initializeJsonStreamLogger, closeJsonStreamLogger } = await import('./json-stream-logger.js');
1638
+ const { sessionManager } = await import('../core/session/session-manager.js');
1639
+ const isVerboseMode = options.verbose || options.debug;
1640
+ const sessionId = options.sessionId || sessionManager.getCurrentSessionId();
1641
+ const jsonLogger = await initializeJsonStreamLogger(sessionId, false, isVerboseMode);
1642
+ if (options.llmLog) {
1643
+ enableLLMLog();
1644
+ }
1645
+ if (options.debug) {
1646
+ setLogLevel(LogLevel.VERBOSE);
1647
+ logger.debug('🔍 Debug mode enabled - maximum logging with location tracking');
1648
+ }
1649
+ else if (options.verbose) {
1650
+ setLogLevel(LogLevel.DEBUG);
1651
+ logger.debug('📝 Verbose mode enabled - detailed logging');
1652
+ }
1653
+ else if (options.llmLog) {
1654
+ console.log(chalk.cyan('📡 LLM Log mode enabled - showing LLM requests/responses only'));
1655
+ }
1656
+ let cleanupCalled = false;
1657
+ const cleanup = async () => {
1658
+ if (cleanupCalled) {
1659
+ return;
1660
+ }
1661
+ cleanupCalled = true;
1662
+ await closeJsonStreamLogger();
1663
+ };
1664
+ const exitHandler = async (signal) => {
1665
+ logger.debug(`Received ${signal}, cleaning up...`);
1666
+ await cleanup();
1667
+ process.exit(0);
1668
+ };
1669
+ process.once('SIGTERM', () => exitHandler('SIGTERM'));
1670
+ return { cleanup, jsonLogger };
1671
+ }
1672
+ //# sourceMappingURL=logger.js.map