@codemieai/code 0.0.23 → 0.0.25

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 (304) hide show
  1. package/README.md +41 -80
  2. package/dist/agents/codemie-code/config.d.ts.map +1 -1
  3. package/dist/agents/codemie-code/config.js +7 -3
  4. package/dist/agents/codemie-code/config.js.map +1 -1
  5. package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
  6. package/dist/agents/codemie-code/tools/index.js +6 -5
  7. package/dist/agents/codemie-code/tools/index.js.map +1 -1
  8. package/dist/agents/codemie-code/types.d.ts +4 -0
  9. package/dist/agents/codemie-code/types.d.ts.map +1 -1
  10. package/dist/agents/codemie-code/types.js.map +1 -1
  11. package/dist/agents/core/AgentCLI.d.ts.map +1 -1
  12. package/dist/agents/core/AgentCLI.js +21 -0
  13. package/dist/agents/core/AgentCLI.js.map +1 -1
  14. package/dist/agents/core/BaseAgentAdapter.d.ts +54 -3
  15. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  16. package/dist/agents/core/BaseAgentAdapter.js +162 -30
  17. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  18. package/dist/agents/core/BaseMetricsAdapter.d.ts +88 -6
  19. package/dist/agents/core/BaseMetricsAdapter.d.ts.map +1 -1
  20. package/dist/agents/core/BaseMetricsAdapter.js +174 -16
  21. package/dist/agents/core/BaseMetricsAdapter.js.map +1 -1
  22. package/dist/agents/core/lifecycle-helpers.d.ts +111 -0
  23. package/dist/agents/core/lifecycle-helpers.d.ts.map +1 -0
  24. package/dist/agents/core/lifecycle-helpers.js +189 -0
  25. package/dist/agents/core/lifecycle-helpers.js.map +1 -0
  26. package/dist/{metrics → agents/core/metrics}/MetricsOrchestrator.d.ts +12 -0
  27. package/dist/agents/core/metrics/MetricsOrchestrator.d.ts.map +1 -0
  28. package/dist/{metrics → agents/core/metrics}/MetricsOrchestrator.js +142 -23
  29. package/dist/agents/core/metrics/MetricsOrchestrator.js.map +1 -0
  30. package/dist/agents/core/metrics/core/DeltaWriter.d.ts.map +1 -0
  31. package/dist/{metrics → agents/core/metrics}/core/DeltaWriter.js +13 -7
  32. package/dist/agents/core/metrics/core/DeltaWriter.js.map +1 -0
  33. package/dist/agents/core/metrics/core/FileSnapshotter.d.ts.map +1 -0
  34. package/dist/{metrics → agents/core/metrics}/core/FileSnapshotter.js +1 -1
  35. package/dist/agents/core/metrics/core/FileSnapshotter.js.map +1 -0
  36. package/dist/agents/core/metrics/core/SessionCorrelator.d.ts.map +1 -0
  37. package/dist/agents/core/metrics/core/SessionCorrelator.js +157 -0
  38. package/dist/agents/core/metrics/core/SessionCorrelator.js.map +1 -0
  39. package/dist/agents/core/metrics/core/SyncStateManager.d.ts.map +1 -0
  40. package/dist/{metrics → agents/core/metrics}/core/SyncStateManager.js +2 -2
  41. package/dist/agents/core/metrics/core/SyncStateManager.js.map +1 -0
  42. package/dist/agents/core/metrics/index.d.ts.map +1 -0
  43. package/dist/agents/core/metrics/index.js.map +1 -0
  44. package/dist/agents/core/metrics/session/SessionStore.d.ts.map +1 -0
  45. package/dist/{metrics → agents/core/metrics}/session/SessionStore.js +9 -5
  46. package/dist/agents/core/metrics/session/SessionStore.js.map +1 -0
  47. package/dist/agents/core/metrics/types.d.ts.map +1 -0
  48. package/dist/agents/core/metrics/types.js.map +1 -0
  49. package/dist/{metrics/config.d.ts → agents/core/metrics-config.d.ts} +1 -1
  50. package/dist/agents/core/metrics-config.d.ts.map +1 -0
  51. package/dist/{metrics/config.js → agents/core/metrics-config.js} +13 -4
  52. package/dist/agents/core/metrics-config.js.map +1 -0
  53. package/dist/agents/core/types.d.ts +112 -6
  54. package/dist/agents/core/types.d.ts.map +1 -1
  55. package/dist/agents/plugins/claude.metrics.d.ts +4 -2
  56. package/dist/agents/plugins/claude.metrics.d.ts.map +1 -1
  57. package/dist/agents/plugins/claude.metrics.js +33 -11
  58. package/dist/agents/plugins/claude.metrics.js.map +1 -1
  59. package/dist/agents/plugins/claude.plugin.d.ts +1 -1
  60. package/dist/agents/plugins/claude.plugin.d.ts.map +1 -1
  61. package/dist/agents/plugins/claude.plugin.js +3 -33
  62. package/dist/agents/plugins/claude.plugin.js.map +1 -1
  63. package/dist/agents/plugins/codemie-code.plugin.d.ts.map +1 -1
  64. package/dist/agents/plugins/codemie-code.plugin.js +12 -5
  65. package/dist/agents/plugins/codemie-code.plugin.js.map +1 -1
  66. package/dist/agents/plugins/codex.plugin.d.ts.map +1 -1
  67. package/dist/agents/plugins/codex.plugin.js +133 -33
  68. package/dist/agents/plugins/codex.plugin.js.map +1 -1
  69. package/dist/agents/plugins/gemini.metrics.d.ts +10 -3
  70. package/dist/agents/plugins/gemini.metrics.d.ts.map +1 -1
  71. package/dist/agents/plugins/gemini.metrics.js +69 -17
  72. package/dist/agents/plugins/gemini.metrics.js.map +1 -1
  73. package/dist/agents/plugins/gemini.plugin.d.ts +1 -1
  74. package/dist/agents/plugins/gemini.plugin.d.ts.map +1 -1
  75. package/dist/agents/plugins/gemini.plugin.js +15 -24
  76. package/dist/agents/plugins/gemini.plugin.js.map +1 -1
  77. package/dist/agents/plugins/history-parser.d.ts +1 -1
  78. package/dist/agents/plugins/history-parser.d.ts.map +1 -1
  79. package/dist/cli/commands/analytics/data-loader.d.ts +1 -1
  80. package/dist/cli/commands/analytics/data-loader.d.ts.map +1 -1
  81. package/dist/cli/commands/analytics/types.d.ts +2 -2
  82. package/dist/cli/commands/analytics/types.d.ts.map +1 -1
  83. package/dist/cli/commands/analytics/types.js +1 -1
  84. package/dist/cli/commands/profile/auth.d.ts +5 -0
  85. package/dist/cli/commands/profile/auth.d.ts.map +1 -0
  86. package/dist/cli/commands/profile/auth.js +120 -0
  87. package/dist/cli/commands/profile/auth.js.map +1 -0
  88. package/dist/cli/commands/{profile.d.ts → profile/index.d.ts} +1 -1
  89. package/dist/cli/commands/profile/index.d.ts.map +1 -0
  90. package/dist/cli/commands/{profile.js → profile/index.js} +81 -46
  91. package/dist/cli/commands/profile/index.js.map +1 -0
  92. package/dist/cli/index.js +1 -3
  93. package/dist/cli/index.js.map +1 -1
  94. package/dist/providers/core/auth-validation.d.ts +20 -0
  95. package/dist/providers/core/auth-validation.d.ts.map +1 -0
  96. package/dist/providers/core/auth-validation.js +27 -0
  97. package/dist/providers/core/auth-validation.js.map +1 -0
  98. package/dist/providers/core/types.d.ts +51 -0
  99. package/dist/providers/core/types.d.ts.map +1 -1
  100. package/dist/providers/plugins/sso/index.d.ts +3 -0
  101. package/dist/providers/plugins/sso/index.d.ts.map +1 -1
  102. package/dist/providers/plugins/sso/index.js +4 -0
  103. package/dist/providers/plugins/sso/index.js.map +1 -1
  104. package/dist/{metrics/sync/jsonl-writer.d.ts → providers/plugins/sso/metrics/sync/sso.jsonl-writer.d.ts} +2 -2
  105. package/dist/providers/plugins/sso/metrics/sync/sso.jsonl-writer.d.ts.map +1 -0
  106. package/dist/{metrics/sync/jsonl-writer.js → providers/plugins/sso/metrics/sync/sso.jsonl-writer.js} +2 -2
  107. package/dist/providers/plugins/sso/metrics/sync/sso.jsonl-writer.js.map +1 -0
  108. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.d.ts +62 -0
  109. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.d.ts.map +1 -0
  110. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.js +157 -0
  111. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.js.map +1 -0
  112. package/dist/{metrics/sync/aggregator.d.ts → providers/plugins/sso/metrics/sync/sso.metrics-aggregator.d.ts} +4 -4
  113. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-aggregator.d.ts.map +1 -0
  114. package/dist/{metrics/sync/aggregator.js → providers/plugins/sso/metrics/sync/sso.metrics-aggregator.js} +5 -4
  115. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-aggregator.js.map +1 -0
  116. package/dist/{metrics/sync/MetricsApiClient.d.ts → providers/plugins/sso/metrics/sync/sso.metrics-api-client.d.ts} +2 -2
  117. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-api-client.d.ts.map +1 -0
  118. package/dist/{metrics/sync/MetricsApiClient.js → providers/plugins/sso/metrics/sync/sso.metrics-api-client.js} +9 -5
  119. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-api-client.js.map +1 -0
  120. package/dist/{metrics/sync/post-processor.d.ts → providers/plugins/sso/metrics/sync/sso.metrics-post-processor.d.ts} +3 -3
  121. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-post-processor.d.ts.map +1 -0
  122. package/dist/{metrics/sync/post-processor.js → providers/plugins/sso/metrics/sync/sso.metrics-post-processor.js} +3 -3
  123. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-post-processor.js.map +1 -0
  124. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sender.d.ts +104 -0
  125. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sender.d.ts.map +1 -0
  126. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sender.js +258 -0
  127. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sender.js.map +1 -0
  128. package/dist/{proxy/plugins/metrics-sync.plugin.d.ts → providers/plugins/sso/metrics/sync/sso.metrics-sync.plugin.d.ts} +9 -6
  129. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sync.plugin.d.ts.map +1 -0
  130. package/dist/{proxy/plugins/metrics-sync.plugin.js → providers/plugins/sso/metrics/sync/sso.metrics-sync.plugin.js} +42 -60
  131. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sync.plugin.js.map +1 -0
  132. package/dist/{metrics/sync/types.d.ts → providers/plugins/sso/metrics/sync/sso.metrics-types.d.ts} +6 -2
  133. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-types.d.ts.map +1 -0
  134. package/dist/{metrics/sync/types.js → providers/plugins/sso/metrics/sync/sso.metrics-types.js} +1 -1
  135. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-types.js.map +1 -0
  136. package/dist/providers/plugins/sso/proxy/plugins/endpoint-blocker.plugin.d.ts.map +1 -0
  137. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/endpoint-blocker.plugin.js +1 -1
  138. package/dist/providers/plugins/sso/proxy/plugins/endpoint-blocker.plugin.js.map +1 -0
  139. package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.d.ts.map +1 -0
  140. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/header-injection.plugin.js +2 -2
  141. package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js.map +1 -0
  142. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/index.d.ts +2 -2
  143. package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -0
  144. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/index.js +4 -3
  145. package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -0
  146. package/dist/providers/plugins/sso/proxy/plugins/logging.plugin.d.ts.map +1 -0
  147. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/logging.plugin.js +1 -1
  148. package/dist/providers/plugins/sso/proxy/plugins/logging.plugin.js.map +1 -0
  149. package/dist/providers/plugins/sso/proxy/plugins/registry.d.ts.map +1 -0
  150. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/registry.js +1 -1
  151. package/dist/providers/plugins/sso/proxy/plugins/registry.js.map +1 -0
  152. package/dist/providers/plugins/sso/proxy/plugins/sso-auth.plugin.d.ts.map +1 -0
  153. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/sso-auth.plugin.js +1 -1
  154. package/dist/providers/plugins/sso/proxy/plugins/sso-auth.plugin.js.map +1 -0
  155. package/dist/{proxy → providers/plugins/sso/proxy}/plugins/types.d.ts +4 -4
  156. package/dist/providers/plugins/sso/proxy/plugins/types.d.ts.map +1 -0
  157. package/dist/providers/plugins/sso/proxy/plugins/types.js.map +1 -0
  158. package/dist/{proxy/errors.d.ts → providers/plugins/sso/proxy/proxy-errors.d.ts} +1 -1
  159. package/dist/providers/plugins/sso/proxy/proxy-errors.d.ts.map +1 -0
  160. package/dist/{proxy/errors.js → providers/plugins/sso/proxy/proxy-errors.js} +1 -1
  161. package/dist/providers/plugins/sso/proxy/proxy-errors.js.map +1 -0
  162. package/dist/{proxy/http-client.d.ts → providers/plugins/sso/proxy/proxy-http-client.d.ts} +1 -1
  163. package/dist/providers/plugins/sso/proxy/proxy-http-client.d.ts.map +1 -0
  164. package/dist/{proxy/http-client.js → providers/plugins/sso/proxy/proxy-http-client.js} +3 -3
  165. package/dist/providers/plugins/sso/proxy/proxy-http-client.js.map +1 -0
  166. package/dist/{proxy/types.d.ts → providers/plugins/sso/proxy/proxy-types.d.ts} +2 -2
  167. package/dist/providers/plugins/sso/proxy/proxy-types.d.ts.map +1 -0
  168. package/dist/{proxy/types.js → providers/plugins/sso/proxy/proxy-types.js} +1 -1
  169. package/dist/providers/plugins/sso/proxy/proxy-types.js.map +1 -0
  170. package/dist/{utils/codemie-proxy.d.ts → providers/plugins/sso/proxy/sso.proxy.d.ts} +3 -3
  171. package/dist/providers/plugins/sso/proxy/sso.proxy.d.ts.map +1 -0
  172. package/dist/{utils/codemie-proxy.js → providers/plugins/sso/proxy/sso.proxy.js} +11 -11
  173. package/dist/providers/plugins/sso/proxy/sso.proxy.js.map +1 -0
  174. package/dist/providers/plugins/sso/sso.auth.d.ts +7 -3
  175. package/dist/providers/plugins/sso/sso.auth.d.ts.map +1 -1
  176. package/dist/providers/plugins/sso/sso.auth.js +40 -7
  177. package/dist/providers/plugins/sso/sso.auth.js.map +1 -1
  178. package/dist/providers/plugins/sso/sso.health.js +3 -3
  179. package/dist/providers/plugins/sso/sso.health.js.map +1 -1
  180. package/dist/providers/plugins/sso/sso.models.js +1 -1
  181. package/dist/providers/plugins/sso/sso.models.js.map +1 -1
  182. package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
  183. package/dist/providers/plugins/sso/sso.setup-steps.js +116 -1
  184. package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
  185. package/dist/providers/plugins/sso/sso.template.d.ts.map +1 -1
  186. package/dist/providers/plugins/sso/sso.template.js +51 -0
  187. package/dist/providers/plugins/sso/sso.template.js.map +1 -1
  188. package/dist/utils/credential-store.d.ts +9 -3
  189. package/dist/utils/credential-store.d.ts.map +1 -1
  190. package/dist/utils/credential-store.js +43 -18
  191. package/dist/utils/credential-store.js.map +1 -1
  192. package/dist/utils/error-context.d.ts +90 -0
  193. package/dist/utils/error-context.d.ts.map +1 -0
  194. package/dist/utils/error-context.js +338 -0
  195. package/dist/utils/error-context.js.map +1 -0
  196. package/dist/utils/exec.d.ts +1 -1
  197. package/dist/utils/exec.d.ts.map +1 -1
  198. package/dist/utils/exec.js +9 -5
  199. package/dist/utils/exec.js.map +1 -1
  200. package/dist/utils/first-time.js +1 -1
  201. package/dist/utils/first-time.js.map +1 -1
  202. package/dist/{metrics/utils → utils}/git.d.ts +1 -1
  203. package/dist/utils/git.d.ts.map +1 -0
  204. package/dist/{metrics/utils → utils}/git.js +2 -2
  205. package/dist/utils/git.js.map +1 -0
  206. package/dist/utils/npm.d.ts.map +1 -1
  207. package/dist/utils/npm.js +16 -5
  208. package/dist/utils/npm.js.map +1 -1
  209. package/dist/utils/path-utils.d.ts +195 -0
  210. package/dist/utils/path-utils.d.ts.map +1 -0
  211. package/dist/utils/path-utils.js +267 -0
  212. package/dist/utils/path-utils.js.map +1 -0
  213. package/dist/utils/profile-display.d.ts +41 -0
  214. package/dist/utils/profile-display.d.ts.map +1 -0
  215. package/dist/utils/profile-display.js +90 -0
  216. package/dist/utils/profile-display.js.map +1 -0
  217. package/dist/utils/profile.d.ts +46 -1
  218. package/dist/utils/profile.d.ts.map +1 -1
  219. package/dist/utils/profile.js +138 -9
  220. package/dist/utils/profile.js.map +1 -1
  221. package/dist/utils/which.d.ts.map +1 -1
  222. package/dist/utils/which.js +4 -2
  223. package/dist/utils/which.js.map +1 -1
  224. package/package.json +1 -1
  225. package/dist/cli/commands/auth.d.ts +0 -3
  226. package/dist/cli/commands/auth.d.ts.map +0 -1
  227. package/dist/cli/commands/auth.js +0 -184
  228. package/dist/cli/commands/auth.js.map +0 -1
  229. package/dist/cli/commands/profile.d.ts.map +0 -1
  230. package/dist/cli/commands/profile.js.map +0 -1
  231. package/dist/metrics/MetricsOrchestrator.d.ts.map +0 -1
  232. package/dist/metrics/MetricsOrchestrator.js.map +0 -1
  233. package/dist/metrics/config.d.ts.map +0 -1
  234. package/dist/metrics/config.js.map +0 -1
  235. package/dist/metrics/core/DeltaWriter.d.ts.map +0 -1
  236. package/dist/metrics/core/DeltaWriter.js.map +0 -1
  237. package/dist/metrics/core/FileSnapshotter.d.ts.map +0 -1
  238. package/dist/metrics/core/FileSnapshotter.js.map +0 -1
  239. package/dist/metrics/core/SessionCorrelator.d.ts.map +0 -1
  240. package/dist/metrics/core/SessionCorrelator.js +0 -115
  241. package/dist/metrics/core/SessionCorrelator.js.map +0 -1
  242. package/dist/metrics/core/SyncStateManager.d.ts.map +0 -1
  243. package/dist/metrics/core/SyncStateManager.js.map +0 -1
  244. package/dist/metrics/index.d.ts.map +0 -1
  245. package/dist/metrics/index.js.map +0 -1
  246. package/dist/metrics/session/SessionStore.d.ts.map +0 -1
  247. package/dist/metrics/session/SessionStore.js.map +0 -1
  248. package/dist/metrics/sync/MetricsApiClient.d.ts.map +0 -1
  249. package/dist/metrics/sync/MetricsApiClient.js.map +0 -1
  250. package/dist/metrics/sync/aggregator.d.ts.map +0 -1
  251. package/dist/metrics/sync/aggregator.js.map +0 -1
  252. package/dist/metrics/sync/index.d.ts +0 -10
  253. package/dist/metrics/sync/index.d.ts.map +0 -1
  254. package/dist/metrics/sync/index.js +0 -10
  255. package/dist/metrics/sync/index.js.map +0 -1
  256. package/dist/metrics/sync/jsonl-writer.d.ts.map +0 -1
  257. package/dist/metrics/sync/jsonl-writer.js.map +0 -1
  258. package/dist/metrics/sync/post-processor.d.ts.map +0 -1
  259. package/dist/metrics/sync/post-processor.js.map +0 -1
  260. package/dist/metrics/sync/types.d.ts.map +0 -1
  261. package/dist/metrics/sync/types.js.map +0 -1
  262. package/dist/metrics/types.d.ts.map +0 -1
  263. package/dist/metrics/types.js.map +0 -1
  264. package/dist/metrics/utils/git.d.ts.map +0 -1
  265. package/dist/metrics/utils/git.js.map +0 -1
  266. package/dist/proxy/errors.d.ts.map +0 -1
  267. package/dist/proxy/errors.js.map +0 -1
  268. package/dist/proxy/http-client.d.ts.map +0 -1
  269. package/dist/proxy/http-client.js.map +0 -1
  270. package/dist/proxy/plugins/endpoint-blocker.plugin.d.ts.map +0 -1
  271. package/dist/proxy/plugins/endpoint-blocker.plugin.js.map +0 -1
  272. package/dist/proxy/plugins/header-injection.plugin.d.ts.map +0 -1
  273. package/dist/proxy/plugins/header-injection.plugin.js.map +0 -1
  274. package/dist/proxy/plugins/index.d.ts.map +0 -1
  275. package/dist/proxy/plugins/index.js.map +0 -1
  276. package/dist/proxy/plugins/logging.plugin.d.ts.map +0 -1
  277. package/dist/proxy/plugins/logging.plugin.js.map +0 -1
  278. package/dist/proxy/plugins/metrics-sync.plugin.d.ts.map +0 -1
  279. package/dist/proxy/plugins/metrics-sync.plugin.js.map +0 -1
  280. package/dist/proxy/plugins/registry.d.ts.map +0 -1
  281. package/dist/proxy/plugins/registry.js.map +0 -1
  282. package/dist/proxy/plugins/sso-auth.plugin.d.ts.map +0 -1
  283. package/dist/proxy/plugins/sso-auth.plugin.js.map +0 -1
  284. package/dist/proxy/plugins/types.d.ts.map +0 -1
  285. package/dist/proxy/plugins/types.js.map +0 -1
  286. package/dist/proxy/types.d.ts.map +0 -1
  287. package/dist/proxy/types.js.map +0 -1
  288. package/dist/utils/codemie-proxy.d.ts.map +0 -1
  289. package/dist/utils/codemie-proxy.js.map +0 -1
  290. /package/dist/{metrics → agents/core/metrics}/core/DeltaWriter.d.ts +0 -0
  291. /package/dist/{metrics → agents/core/metrics}/core/FileSnapshotter.d.ts +0 -0
  292. /package/dist/{metrics → agents/core/metrics}/core/SessionCorrelator.d.ts +0 -0
  293. /package/dist/{metrics → agents/core/metrics}/core/SyncStateManager.d.ts +0 -0
  294. /package/dist/{metrics → agents/core/metrics}/index.d.ts +0 -0
  295. /package/dist/{metrics → agents/core/metrics}/index.js +0 -0
  296. /package/dist/{metrics → agents/core/metrics}/session/SessionStore.d.ts +0 -0
  297. /package/dist/{metrics → agents/core/metrics}/types.d.ts +0 -0
  298. /package/dist/{metrics → agents/core/metrics}/types.js +0 -0
  299. /package/dist/{proxy → providers/plugins/sso/proxy}/plugins/endpoint-blocker.plugin.d.ts +0 -0
  300. /package/dist/{proxy → providers/plugins/sso/proxy}/plugins/header-injection.plugin.d.ts +0 -0
  301. /package/dist/{proxy → providers/plugins/sso/proxy}/plugins/logging.plugin.d.ts +0 -0
  302. /package/dist/{proxy → providers/plugins/sso/proxy}/plugins/registry.d.ts +0 -0
  303. /package/dist/{proxy → providers/plugins/sso/proxy}/plugins/sso-auth.plugin.d.ts +0 -0
  304. /package/dist/{proxy → providers/plugins/sso/proxy}/plugins/types.js +0 -0
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Cross-Platform Path Utilities
3
+ *
4
+ * Provides platform-agnostic path operations that work consistently
5
+ * across Windows, macOS, and Linux by normalizing all paths to forward slashes.
6
+ *
7
+ * This module consolidates all path-related logic including:
8
+ * - Path normalization and splitting
9
+ * - Path structure validation
10
+ * - Security checks (directory traversal prevention)
11
+ * - UUID validation for session files
12
+ * - File extension validation
13
+ */
14
+ /**
15
+ * Normalize path separators to forward slashes for cross-platform consistency
16
+ *
17
+ * This function converts all backslashes to forward slashes, allowing the code
18
+ * to handle both Windows (C:\path\to\file) and Unix (/path/to/file) paths
19
+ * uniformly on any platform.
20
+ *
21
+ * @param filePath - Path with either forward slashes or backslashes
22
+ * @returns Path with only forward slashes
23
+ *
24
+ * @example
25
+ * normalizePathSeparators('C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl')
26
+ * // Returns: 'C:/Users/john/.claude/projects/abc/file.jsonl'
27
+ *
28
+ * @example
29
+ * normalizePathSeparators('/home/user/.claude/projects/abc/file.jsonl')
30
+ * // Returns: '/home/user/.claude/projects/abc/file.jsonl' (unchanged)
31
+ */
32
+ export declare function normalizePathSeparators(filePath: string): string;
33
+ /**
34
+ * Split path into parts using forward slash as separator
35
+ *
36
+ * Works consistently across all platforms by first normalizing separators.
37
+ *
38
+ * @param filePath - Path with either forward slashes or backslashes
39
+ * @returns Array of path segments
40
+ *
41
+ * @example
42
+ * splitPath('C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl')
43
+ * // Returns: ['C:', 'Users', 'john', '.claude', 'projects', 'abc', 'file.jsonl']
44
+ *
45
+ * @example
46
+ * splitPath('/home/user/.claude/projects/abc/file.jsonl')
47
+ * // Returns: ['', 'home', 'user', '.claude', 'projects', 'abc', 'file.jsonl']
48
+ */
49
+ export declare function splitPath(filePath: string): string[];
50
+ /**
51
+ * Get the filename from a path (last segment)
52
+ *
53
+ * @param filePath - Full path
54
+ * @returns Filename with extension
55
+ *
56
+ * @example
57
+ * getFilename('C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl')
58
+ * // Returns: 'file.jsonl'
59
+ */
60
+ export declare function getFilename(filePath: string): string;
61
+ /**
62
+ * Check if a path matches a specific structure
63
+ *
64
+ * Validates that a path follows the pattern: {prefix}/{dir1}/{dir2}/{...}/{filename}
65
+ * where the structure is relative to a base directory.
66
+ *
67
+ * @param filePath - Path to validate
68
+ * @param baseDirName - Base directory name to find (e.g., '.claude')
69
+ * @param expectedStructure - Array of directory names that should follow the base directory
70
+ * @returns true if path matches structure, false otherwise
71
+ *
72
+ * @example
73
+ * matchesPathStructure(
74
+ * 'C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl',
75
+ * '.claude',
76
+ * ['projects'] // expects: .claude/projects/{hash}/{file}
77
+ * )
78
+ * // Returns: true (has .claude/projects structure)
79
+ *
80
+ * @example
81
+ * matchesPathStructure(
82
+ * '/home/user/.claude/sessions/abc/file.jsonl',
83
+ * '.claude',
84
+ * ['projects']
85
+ * )
86
+ * // Returns: false (has 'sessions' instead of 'projects')
87
+ */
88
+ export declare function matchesPathStructure(filePath: string, baseDirName: string, expectedStructure: string[]): boolean;
89
+ /**
90
+ * Validate path depth relative to a base directory
91
+ *
92
+ * Checks that there are exactly N segments after the base directory.
93
+ *
94
+ * @param filePath - Path to validate
95
+ * @param baseDirName - Base directory name
96
+ * @param expectedDepth - Number of segments expected after base directory
97
+ * @returns true if depth matches, false otherwise
98
+ *
99
+ * @example
100
+ * validatePathDepth(
101
+ * 'C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl',
102
+ * '.claude',
103
+ * 3 // expects: .claude/{dir1}/{dir2}/{file}
104
+ * )
105
+ * // Returns: true (has 'projects', 'abc', 'file.jsonl' = 3 segments after .claude)
106
+ */
107
+ export declare function validatePathDepth(filePath: string, baseDirName: string, expectedDepth: number): boolean;
108
+ /**
109
+ * Check if a resolved path is within a working directory boundary
110
+ *
111
+ * Uses path.relative() to prevent directory traversal attacks.
112
+ * This is safer than simple string prefix matching which can be bypassed
113
+ * by paths like: /home/user/project-attacker when checking /home/user/project
114
+ *
115
+ * @param workingDir - The working directory boundary
116
+ * @param resolvedPath - The resolved absolute path to check
117
+ * @returns true if path is within workingDir, false otherwise
118
+ *
119
+ * @example
120
+ * isPathWithinDirectory('/home/user/project', '/home/user/project/file.txt')
121
+ * // Returns: true
122
+ *
123
+ * @example
124
+ * isPathWithinDirectory('/home/user/project', '/home/user/project-other/file.txt')
125
+ * // Returns: false (prevented directory traversal)
126
+ *
127
+ * @example
128
+ * isPathWithinDirectory('C:\\Users\\project', 'C:\\Users\\project\\..\\..\\etc\\passwd')
129
+ * // Returns: false (prevented traversal attack)
130
+ */
131
+ export declare function isPathWithinDirectory(workingDir: string, resolvedPath: string): boolean;
132
+ /**
133
+ * Validate if a string matches UUID format (any version)
134
+ *
135
+ * Supports all UUID versions (v1, v2, v3, v4, v5) with case-insensitive matching.
136
+ *
137
+ * @param str - String to validate
138
+ * @returns true if valid UUID, false otherwise
139
+ *
140
+ * @example
141
+ * isValidUuid('f52d1386-9d4c-4671-a31e-62dd6600a759')
142
+ * // Returns: true
143
+ *
144
+ * @example
145
+ * isValidUuid('F52D1386-9D4C-4671-A31E-62DD6600A759')
146
+ * // Returns: true (case-insensitive)
147
+ *
148
+ * @example
149
+ * isValidUuid('not-a-uuid')
150
+ * // Returns: false
151
+ */
152
+ export declare function isValidUuid(str: string): boolean;
153
+ /**
154
+ * Validate if a filename has a valid UUID format with specific extension
155
+ *
156
+ * Checks that the filename (without extension) is a valid UUID.
157
+ *
158
+ * @param filename - Filename to validate (e.g., 'abc123.jsonl')
159
+ * @param extension - Required extension (e.g., '.jsonl')
160
+ * @returns true if filename is UUID with correct extension, false otherwise
161
+ *
162
+ * @example
163
+ * isValidUuidFilename('f52d1386-9d4c-4671-a31e-62dd6600a759.jsonl', '.jsonl')
164
+ * // Returns: true
165
+ *
166
+ * @example
167
+ * isValidUuidFilename('f52d1386-9d4c-4671-a31e-62dd6600a759.json', '.jsonl')
168
+ * // Returns: false (wrong extension)
169
+ *
170
+ * @example
171
+ * isValidUuidFilename('not-a-uuid.jsonl', '.jsonl')
172
+ * // Returns: false (invalid UUID)
173
+ */
174
+ export declare function isValidUuidFilename(filename: string, extension: string): boolean;
175
+ /**
176
+ * Resolve a path relative to the user's home directory
177
+ *
178
+ * Joins the user's home directory with the provided relative path.
179
+ * Useful for agent data directories like '.claude', '.codex', '.gemini', etc.
180
+ *
181
+ * @param relativePath - Relative path from home directory (e.g., '.claude', '.codex')
182
+ * @returns Absolute path in user's home directory
183
+ *
184
+ * @example
185
+ * resolveHomeDir('.claude')
186
+ * // Returns: '/Users/john/.claude' (on macOS)
187
+ * // Returns: 'C:\\Users\\john\\.claude' (on Windows)
188
+ * // Returns: '/home/user/.claude' (on Linux)
189
+ *
190
+ * @example
191
+ * resolveHomeDir('.codex/auth.json')
192
+ * // Returns: '/Users/john/.codex/auth.json'
193
+ */
194
+ export declare function resolveHomeDir(relativePath: string): string;
195
+ //# sourceMappingURL=path-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../src/utils/path-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAGpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpD;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,MAAM,EAAE,GAC1B,OAAO,CAiBT;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GACpB,OAAO,CAUT;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAIvF;AAaD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAMhF;AAOD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -0,0 +1,267 @@
1
+ /**
2
+ * Cross-Platform Path Utilities
3
+ *
4
+ * Provides platform-agnostic path operations that work consistently
5
+ * across Windows, macOS, and Linux by normalizing all paths to forward slashes.
6
+ *
7
+ * This module consolidates all path-related logic including:
8
+ * - Path normalization and splitting
9
+ * - Path structure validation
10
+ * - Security checks (directory traversal prevention)
11
+ * - UUID validation for session files
12
+ * - File extension validation
13
+ */
14
+ import path from 'path';
15
+ import { homedir } from 'os';
16
+ /**
17
+ * Normalize path separators to forward slashes for cross-platform consistency
18
+ *
19
+ * This function converts all backslashes to forward slashes, allowing the code
20
+ * to handle both Windows (C:\path\to\file) and Unix (/path/to/file) paths
21
+ * uniformly on any platform.
22
+ *
23
+ * @param filePath - Path with either forward slashes or backslashes
24
+ * @returns Path with only forward slashes
25
+ *
26
+ * @example
27
+ * normalizePathSeparators('C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl')
28
+ * // Returns: 'C:/Users/john/.claude/projects/abc/file.jsonl'
29
+ *
30
+ * @example
31
+ * normalizePathSeparators('/home/user/.claude/projects/abc/file.jsonl')
32
+ * // Returns: '/home/user/.claude/projects/abc/file.jsonl' (unchanged)
33
+ */
34
+ export function normalizePathSeparators(filePath) {
35
+ return filePath.replaceAll('\\', '/');
36
+ }
37
+ /**
38
+ * Split path into parts using forward slash as separator
39
+ *
40
+ * Works consistently across all platforms by first normalizing separators.
41
+ *
42
+ * @param filePath - Path with either forward slashes or backslashes
43
+ * @returns Array of path segments
44
+ *
45
+ * @example
46
+ * splitPath('C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl')
47
+ * // Returns: ['C:', 'Users', 'john', '.claude', 'projects', 'abc', 'file.jsonl']
48
+ *
49
+ * @example
50
+ * splitPath('/home/user/.claude/projects/abc/file.jsonl')
51
+ * // Returns: ['', 'home', 'user', '.claude', 'projects', 'abc', 'file.jsonl']
52
+ */
53
+ export function splitPath(filePath) {
54
+ const normalized = normalizePathSeparators(filePath);
55
+ return normalized.split('/');
56
+ }
57
+ /**
58
+ * Get the filename from a path (last segment)
59
+ *
60
+ * @param filePath - Full path
61
+ * @returns Filename with extension
62
+ *
63
+ * @example
64
+ * getFilename('C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl')
65
+ * // Returns: 'file.jsonl'
66
+ */
67
+ export function getFilename(filePath) {
68
+ const parts = splitPath(filePath);
69
+ return parts.at(-1) || '';
70
+ }
71
+ /**
72
+ * Find the index of a base directory in a path (internal helper)
73
+ *
74
+ * @param parts - Path segments from splitPath()
75
+ * @param baseDirName - Base directory name to find
76
+ * @returns Index of the directory, or -1 if not found
77
+ * @internal
78
+ */
79
+ function findBaseIndex(parts, baseDirName) {
80
+ return parts.findIndex(part => part === baseDirName);
81
+ }
82
+ /**
83
+ * Check if a path matches a specific structure
84
+ *
85
+ * Validates that a path follows the pattern: {prefix}/{dir1}/{dir2}/{...}/{filename}
86
+ * where the structure is relative to a base directory.
87
+ *
88
+ * @param filePath - Path to validate
89
+ * @param baseDirName - Base directory name to find (e.g., '.claude')
90
+ * @param expectedStructure - Array of directory names that should follow the base directory
91
+ * @returns true if path matches structure, false otherwise
92
+ *
93
+ * @example
94
+ * matchesPathStructure(
95
+ * 'C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl',
96
+ * '.claude',
97
+ * ['projects'] // expects: .claude/projects/{hash}/{file}
98
+ * )
99
+ * // Returns: true (has .claude/projects structure)
100
+ *
101
+ * @example
102
+ * matchesPathStructure(
103
+ * '/home/user/.claude/sessions/abc/file.jsonl',
104
+ * '.claude',
105
+ * ['projects']
106
+ * )
107
+ * // Returns: false (has 'sessions' instead of 'projects')
108
+ */
109
+ export function matchesPathStructure(filePath, baseDirName, expectedStructure) {
110
+ const parts = splitPath(filePath);
111
+ const baseIndex = findBaseIndex(parts, baseDirName);
112
+ if (baseIndex === -1) {
113
+ return false;
114
+ }
115
+ // Check if expected directories follow the base directory
116
+ for (let i = 0; i < expectedStructure.length; i++) {
117
+ const expectedIndex = baseIndex + 1 + i;
118
+ if (expectedIndex >= parts.length || parts[expectedIndex] !== expectedStructure[i]) {
119
+ return false;
120
+ }
121
+ }
122
+ return true;
123
+ }
124
+ /**
125
+ * Validate path depth relative to a base directory
126
+ *
127
+ * Checks that there are exactly N segments after the base directory.
128
+ *
129
+ * @param filePath - Path to validate
130
+ * @param baseDirName - Base directory name
131
+ * @param expectedDepth - Number of segments expected after base directory
132
+ * @returns true if depth matches, false otherwise
133
+ *
134
+ * @example
135
+ * validatePathDepth(
136
+ * 'C:\\Users\\john\\.claude\\projects\\abc\\file.jsonl',
137
+ * '.claude',
138
+ * 3 // expects: .claude/{dir1}/{dir2}/{file}
139
+ * )
140
+ * // Returns: true (has 'projects', 'abc', 'file.jsonl' = 3 segments after .claude)
141
+ */
142
+ export function validatePathDepth(filePath, baseDirName, expectedDepth) {
143
+ const parts = splitPath(filePath);
144
+ const baseIndex = findBaseIndex(parts, baseDirName);
145
+ if (baseIndex === -1) {
146
+ return false;
147
+ }
148
+ const actualDepth = parts.length - baseIndex - 1;
149
+ return actualDepth === expectedDepth;
150
+ }
151
+ // ============================================================================
152
+ // Security Utilities
153
+ // ============================================================================
154
+ /**
155
+ * Check if a resolved path is within a working directory boundary
156
+ *
157
+ * Uses path.relative() to prevent directory traversal attacks.
158
+ * This is safer than simple string prefix matching which can be bypassed
159
+ * by paths like: /home/user/project-attacker when checking /home/user/project
160
+ *
161
+ * @param workingDir - The working directory boundary
162
+ * @param resolvedPath - The resolved absolute path to check
163
+ * @returns true if path is within workingDir, false otherwise
164
+ *
165
+ * @example
166
+ * isPathWithinDirectory('/home/user/project', '/home/user/project/file.txt')
167
+ * // Returns: true
168
+ *
169
+ * @example
170
+ * isPathWithinDirectory('/home/user/project', '/home/user/project-other/file.txt')
171
+ * // Returns: false (prevented directory traversal)
172
+ *
173
+ * @example
174
+ * isPathWithinDirectory('C:\\Users\\project', 'C:\\Users\\project\\..\\..\\etc\\passwd')
175
+ * // Returns: false (prevented traversal attack)
176
+ */
177
+ export function isPathWithinDirectory(workingDir, resolvedPath) {
178
+ const relative = path.relative(workingDir, resolvedPath);
179
+ // If path starts with '..' or is an absolute path, it's outside workingDir
180
+ return !relative.startsWith('..') && !path.isAbsolute(relative);
181
+ }
182
+ // ============================================================================
183
+ // UUID Validation Utilities
184
+ // ============================================================================
185
+ /**
186
+ * UUID regex pattern (any version)
187
+ * Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
188
+ * where x is any hexadecimal digit
189
+ */
190
+ const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
191
+ /**
192
+ * Validate if a string matches UUID format (any version)
193
+ *
194
+ * Supports all UUID versions (v1, v2, v3, v4, v5) with case-insensitive matching.
195
+ *
196
+ * @param str - String to validate
197
+ * @returns true if valid UUID, false otherwise
198
+ *
199
+ * @example
200
+ * isValidUuid('f52d1386-9d4c-4671-a31e-62dd6600a759')
201
+ * // Returns: true
202
+ *
203
+ * @example
204
+ * isValidUuid('F52D1386-9D4C-4671-A31E-62DD6600A759')
205
+ * // Returns: true (case-insensitive)
206
+ *
207
+ * @example
208
+ * isValidUuid('not-a-uuid')
209
+ * // Returns: false
210
+ */
211
+ export function isValidUuid(str) {
212
+ return UUID_PATTERN.test(str);
213
+ }
214
+ /**
215
+ * Validate if a filename has a valid UUID format with specific extension
216
+ *
217
+ * Checks that the filename (without extension) is a valid UUID.
218
+ *
219
+ * @param filename - Filename to validate (e.g., 'abc123.jsonl')
220
+ * @param extension - Required extension (e.g., '.jsonl')
221
+ * @returns true if filename is UUID with correct extension, false otherwise
222
+ *
223
+ * @example
224
+ * isValidUuidFilename('f52d1386-9d4c-4671-a31e-62dd6600a759.jsonl', '.jsonl')
225
+ * // Returns: true
226
+ *
227
+ * @example
228
+ * isValidUuidFilename('f52d1386-9d4c-4671-a31e-62dd6600a759.json', '.jsonl')
229
+ * // Returns: false (wrong extension)
230
+ *
231
+ * @example
232
+ * isValidUuidFilename('not-a-uuid.jsonl', '.jsonl')
233
+ * // Returns: false (invalid UUID)
234
+ */
235
+ export function isValidUuidFilename(filename, extension) {
236
+ if (!filename.endsWith(extension)) {
237
+ return false;
238
+ }
239
+ const nameWithoutExt = filename.slice(0, -extension.length);
240
+ return isValidUuid(nameWithoutExt);
241
+ }
242
+ // ============================================================================
243
+ // Home Directory Utilities
244
+ // ============================================================================
245
+ /**
246
+ * Resolve a path relative to the user's home directory
247
+ *
248
+ * Joins the user's home directory with the provided relative path.
249
+ * Useful for agent data directories like '.claude', '.codex', '.gemini', etc.
250
+ *
251
+ * @param relativePath - Relative path from home directory (e.g., '.claude', '.codex')
252
+ * @returns Absolute path in user's home directory
253
+ *
254
+ * @example
255
+ * resolveHomeDir('.claude')
256
+ * // Returns: '/Users/john/.claude' (on macOS)
257
+ * // Returns: 'C:\\Users\\john\\.claude' (on Windows)
258
+ * // Returns: '/home/user/.claude' (on Linux)
259
+ *
260
+ * @example
261
+ * resolveHomeDir('.codex/auth.json')
262
+ * // Returns: '/Users/john/.codex/auth.json'
263
+ */
264
+ export function resolveHomeDir(relativePath) {
265
+ return path.join(homedir(), relativePath);
266
+ }
267
+ //# sourceMappingURL=path-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../src/utils/path-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,SAAS,CAAC,QAAgB;IACxC,MAAM,UAAU,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACrD,OAAO,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D,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,cAAc,CAAC,YAAoB;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Profile Display Utility
3
+ *
4
+ * Reusable profile formatting for consistent display across commands.
5
+ */
6
+ import type { CodeMieConfigOptions } from '../env/types.js';
7
+ import type { AuthStatus } from '../providers/core/types.js';
8
+ /**
9
+ * Profile information for display
10
+ */
11
+ export interface ProfileInfo {
12
+ name: string;
13
+ active: boolean;
14
+ profile: CodeMieConfigOptions;
15
+ }
16
+ /**
17
+ * Profile display utility class
18
+ */
19
+ export declare class ProfileDisplay {
20
+ /**
21
+ * Format a single profile
22
+ *
23
+ * @param info - Profile information
24
+ * @returns Formatted string
25
+ */
26
+ static format(info: ProfileInfo): string;
27
+ /**
28
+ * Display list of profiles
29
+ *
30
+ * @param profiles - Array of profile information
31
+ */
32
+ static formatList(profiles: ProfileInfo[]): void;
33
+ /**
34
+ * Display profile with authentication status
35
+ *
36
+ * @param info - Profile information
37
+ * @param authStatus - Authentication status (optional)
38
+ */
39
+ static formatStatus(info: ProfileInfo, authStatus?: AuthStatus): void;
40
+ }
41
+ //# sourceMappingURL=profile-display.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-display.d.ts","sourceRoot":"","sources":["../../src/utils/profile-display.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAGD;;GAEG;AACH,qBAAa,cAAc;IACzB;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM;IAYxC;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IA6BhD;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI;CAgCtE"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Profile Display Utility
3
+ *
4
+ * Reusable profile formatting for consistent display across commands.
5
+ */
6
+ import chalk from 'chalk';
7
+ import { renderProfileInfo } from './profile.js';
8
+ /**
9
+ * Profile display utility class
10
+ */
11
+ export class ProfileDisplay {
12
+ /**
13
+ * Format a single profile
14
+ *
15
+ * @param info - Profile information
16
+ * @returns Formatted string
17
+ */
18
+ static format(info) {
19
+ const { name, active, profile } = info;
20
+ return renderProfileInfo({
21
+ profile: name,
22
+ provider: profile.provider || 'N/A',
23
+ model: profile.model || 'N/A',
24
+ codeMieUrl: profile.codeMieUrl,
25
+ isActive: active
26
+ });
27
+ }
28
+ /**
29
+ * Display list of profiles
30
+ *
31
+ * @param profiles - Array of profile information
32
+ */
33
+ static formatList(profiles) {
34
+ if (profiles.length === 0) {
35
+ console.log(chalk.yellow('\nNo profiles found. Run "codemie setup" to create one.\n'));
36
+ return;
37
+ }
38
+ console.log(chalk.bold.cyan('\n📋 All Profiles:\n'));
39
+ profiles.forEach((profile, index) => {
40
+ const formatted = this.format(profile);
41
+ console.log(formatted);
42
+ // Add separator between profiles except for the last one
43
+ if (index < profiles.length - 1) {
44
+ console.log(chalk.dim('─'.repeat(50)));
45
+ }
46
+ });
47
+ console.log(chalk.dim('─'.repeat(50)));
48
+ console.log(chalk.bold(' Next Steps:'));
49
+ console.log('');
50
+ console.log(' ' + chalk.white('• Switch active profile:') + ' ' + chalk.cyan('codemie profile switch'));
51
+ console.log(' ' + chalk.white('• View profile status:') + ' ' + chalk.cyan('codemie profile status'));
52
+ console.log(' ' + chalk.white('• Create new profile:') + ' ' + chalk.cyan('codemie setup'));
53
+ console.log(' ' + chalk.white('• Remove a profile:') + ' ' + chalk.cyan('codemie profile delete'));
54
+ console.log(' ' + chalk.white('• Explore more:') + ' ' + chalk.cyan('codemie --help'));
55
+ console.log('');
56
+ }
57
+ /**
58
+ * Display profile with authentication status
59
+ *
60
+ * @param info - Profile information
61
+ * @param authStatus - Authentication status (optional)
62
+ */
63
+ static formatStatus(info, authStatus) {
64
+ console.log(chalk.bold.cyan('\n📋 Profile Status:\n'));
65
+ const { name, active, profile } = info;
66
+ // Convert AuthStatus to AuthStatusDisplay
67
+ const authStatusDisplay = authStatus
68
+ ? {
69
+ authenticated: authStatus.authenticated,
70
+ expiresAt: authStatus.expiresAt,
71
+ apiUrl: authStatus.apiUrl
72
+ }
73
+ : undefined;
74
+ const formatted = renderProfileInfo({
75
+ profile: name,
76
+ provider: profile.provider || 'N/A',
77
+ model: profile.model || 'N/A',
78
+ codeMieUrl: profile.codeMieUrl,
79
+ authStatus: authStatusDisplay,
80
+ isActive: active
81
+ });
82
+ console.log(formatted);
83
+ // Show login hint if not authenticated
84
+ if (authStatus && !authStatus.authenticated) {
85
+ console.log(chalk.yellow('💡 Run: codemie profile login'));
86
+ console.log('');
87
+ }
88
+ }
89
+ }
90
+ //# sourceMappingURL=profile-display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-display.js","sourceRoot":"","sources":["../../src/utils/profile-display.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,cAAc,CAAC;AAYzE;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,IAAiB;QAC7B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,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Ed,MAAM,SAAS,GAAG,iBAAiB,CAAC;YAClC,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;YACnC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;YAC7B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,UAAU,EAAE,iBAAiB;YAC7B,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAEvB,uCAAuC;QACvC,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC;YAC3D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CAEF"}
@@ -1,12 +1,57 @@
1
+ import { type ErrorContext } from './error-context.js';
1
2
  /**
2
- * Renders the CodeMie ASCII logo with configuration details
3
+ * Authentication status for display
4
+ */
5
+ export interface AuthStatusDisplay {
6
+ authenticated: boolean;
7
+ expiresAt?: number;
8
+ apiUrl?: string;
9
+ }
10
+ /**
11
+ * Renders the CodeMie profile information in a unified table format
3
12
  */
4
13
  export declare function renderProfileInfo(config: {
5
14
  profile?: string;
6
15
  provider?: string;
7
16
  model?: string;
17
+ codeMieUrl?: string;
18
+ authStatus?: AuthStatusDisplay;
8
19
  agent?: string;
9
20
  cliVersion?: string;
10
21
  sessionId?: string;
22
+ isActive?: boolean;
11
23
  }): string;
24
+ /**
25
+ * Display a non-blocking warning message after profile info
26
+ *
27
+ * @param title - Warning title (e.g., "Metrics Collection Failed")
28
+ * @param error - The error that occurred
29
+ * @param sessionContext - Optional session context for error details
30
+ * @param options - Display options
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * console.log(renderProfileInfo(config));
35
+ * displayWarningMessage('Metrics Collection Failed', error, { sessionId, agent: 'claude' });
36
+ * ```
37
+ */
38
+ export declare function displayWarningMessage(title: string, error: unknown, sessionContext?: ErrorContext['session'], options?: {
39
+ showInProduction?: boolean;
40
+ severity?: 'warning' | 'error' | 'info';
41
+ }): void;
42
+ /**
43
+ * Display a simple info message after profile info
44
+ *
45
+ * @param message - Message to display
46
+ * @param details - Optional additional details
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * displayInfoMessage('Metrics collection is disabled for this provider', {
51
+ * provider: 'openai',
52
+ * reason: 'Not supported'
53
+ * });
54
+ * ```
55
+ */
56
+ export declare function displayInfoMessage(message: string, details?: Record<string, string>): void;
12
57
  //# sourceMappingURL=profile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CA6BT"}
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UA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