@codemieai/code 0.0.36 → 0.0.37

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 (203) hide show
  1. package/README.md +33 -0
  2. package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +1 -1
  3. package/dist/agents/codemie-code/tools/assistant-invocation.js +2 -2
  4. package/dist/agents/codemie-code/tools/assistant-invocation.js.map +1 -1
  5. package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -1
  6. package/dist/agents/core/extension/BaseExtensionInstaller.js +11 -4
  7. package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -1
  8. package/dist/agents/core/session/BaseProcessor.d.ts +22 -1
  9. package/dist/agents/core/session/BaseProcessor.d.ts.map +1 -1
  10. package/dist/agents/plugins/claude/claude-acp.plugin.d.ts +5 -0
  11. package/dist/agents/plugins/claude/claude-acp.plugin.d.ts.map +1 -1
  12. package/dist/agents/plugins/claude/claude-acp.plugin.js +12 -2
  13. package/dist/agents/plugins/claude/claude-acp.plugin.js.map +1 -1
  14. package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
  15. package/dist/agents/plugins/claude/claude.plugin.js +4 -0
  16. package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
  17. package/dist/agents/plugins/claude/claude.session.d.ts +5 -0
  18. package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
  19. package/dist/agents/plugins/claude/claude.session.js +101 -2
  20. package/dist/agents/plugins/claude/claude.session.js.map +1 -1
  21. package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
  22. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts +0 -1
  23. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
  24. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +13 -19
  25. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
  26. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
  27. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +29 -4
  28. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
  29. package/dist/cli/commands/assistants/chat.js +9 -6
  30. package/dist/cli/commands/assistants/chat.js.map +1 -1
  31. package/dist/cli/commands/assistants/constants.d.ts +2 -6
  32. package/dist/cli/commands/assistants/constants.d.ts.map +1 -1
  33. package/dist/cli/commands/assistants/constants.js +2 -5
  34. package/dist/cli/commands/assistants/constants.js.map +1 -1
  35. package/dist/cli/commands/assistants/index.d.ts.map +1 -1
  36. package/dist/cli/commands/assistants/index.js +1 -11
  37. package/dist/cli/commands/assistants/index.js.map +1 -1
  38. package/dist/cli/commands/assistants/setup/configuration/actions.d.ts +30 -0
  39. package/dist/cli/commands/assistants/setup/configuration/actions.d.ts.map +1 -0
  40. package/dist/cli/commands/assistants/setup/configuration/actions.js +63 -0
  41. package/dist/cli/commands/assistants/setup/configuration/actions.js.map +1 -0
  42. package/dist/cli/commands/assistants/setup/configuration/constants.d.ts +49 -0
  43. package/dist/cli/commands/assistants/setup/configuration/constants.d.ts.map +1 -0
  44. package/dist/cli/commands/assistants/setup/configuration/constants.js +56 -0
  45. package/dist/cli/commands/assistants/setup/configuration/constants.js.map +1 -0
  46. package/dist/cli/commands/assistants/setup/configuration/index.d.ts +9 -0
  47. package/dist/cli/commands/assistants/setup/configuration/index.d.ts.map +1 -0
  48. package/dist/cli/commands/assistants/setup/configuration/index.js +8 -0
  49. package/dist/cli/commands/assistants/setup/configuration/index.js.map +1 -0
  50. package/dist/cli/commands/assistants/setup/configuration/selection.d.ts +12 -0
  51. package/dist/cli/commands/assistants/setup/configuration/selection.d.ts.map +1 -0
  52. package/dist/cli/commands/assistants/setup/configuration/selection.js +94 -0
  53. package/dist/cli/commands/assistants/setup/configuration/selection.js.map +1 -0
  54. package/dist/cli/commands/assistants/setup/configuration/types.d.ts +22 -0
  55. package/dist/cli/commands/assistants/setup/configuration/types.d.ts.map +1 -0
  56. package/dist/cli/commands/assistants/setup/configuration/types.js +2 -0
  57. package/dist/cli/commands/assistants/setup/configuration/types.js.map +1 -0
  58. package/dist/cli/commands/assistants/setup/configuration/ui.d.ts +9 -0
  59. package/dist/cli/commands/assistants/setup/configuration/ui.d.ts.map +1 -0
  60. package/dist/cli/commands/assistants/setup/configuration/ui.js +86 -0
  61. package/dist/cli/commands/assistants/setup/configuration/ui.js.map +1 -0
  62. package/dist/cli/commands/assistants/setup/constants.d.ts +26 -0
  63. package/dist/cli/commands/assistants/setup/constants.d.ts.map +1 -0
  64. package/dist/cli/commands/assistants/setup/constants.js +21 -0
  65. package/dist/cli/commands/assistants/setup/constants.js.map +1 -0
  66. package/dist/cli/commands/assistants/setup/data.d.ts +30 -0
  67. package/dist/cli/commands/assistants/setup/data.d.ts.map +1 -0
  68. package/dist/cli/commands/assistants/setup/data.js +125 -0
  69. package/dist/cli/commands/assistants/setup/data.js.map +1 -0
  70. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts.map +1 -0
  71. package/dist/cli/commands/assistants/{generators → setup/generators}/claude-agent-generator.js +6 -2
  72. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js.map +1 -0
  73. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts +12 -0
  74. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts.map +1 -0
  75. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +94 -0
  76. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js.map +1 -0
  77. package/dist/cli/commands/assistants/setup/helpers.d.ts +27 -0
  78. package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -0
  79. package/dist/cli/commands/assistants/setup/helpers.js +94 -0
  80. package/dist/cli/commands/assistants/setup/helpers.js.map +1 -0
  81. package/dist/cli/commands/assistants/setup/index.d.ts +17 -0
  82. package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -0
  83. package/dist/cli/commands/assistants/setup/index.js +193 -0
  84. package/dist/cli/commands/assistants/setup/index.js.map +1 -0
  85. package/dist/cli/commands/assistants/setup/manualConfiguration/actions.d.ts +47 -0
  86. package/dist/cli/commands/assistants/setup/manualConfiguration/actions.d.ts.map +1 -0
  87. package/dist/cli/commands/assistants/setup/manualConfiguration/actions.js +140 -0
  88. package/dist/cli/commands/assistants/setup/manualConfiguration/actions.js.map +1 -0
  89. package/dist/cli/commands/assistants/setup/manualConfiguration/constants.d.ts +56 -0
  90. package/dist/cli/commands/assistants/setup/manualConfiguration/constants.d.ts.map +1 -0
  91. package/dist/cli/commands/assistants/setup/manualConfiguration/constants.js +61 -0
  92. package/dist/cli/commands/assistants/setup/manualConfiguration/constants.js.map +1 -0
  93. package/dist/cli/commands/assistants/setup/manualConfiguration/index.d.ts +12 -0
  94. package/dist/cli/commands/assistants/setup/manualConfiguration/index.d.ts.map +1 -0
  95. package/dist/cli/commands/assistants/setup/manualConfiguration/index.js +48 -0
  96. package/dist/cli/commands/assistants/setup/manualConfiguration/index.js.map +1 -0
  97. package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.d.ts +6 -0
  98. package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.d.ts.map +1 -0
  99. package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.js +90 -0
  100. package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.js.map +1 -0
  101. package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts +37 -0
  102. package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts.map +1 -0
  103. package/dist/cli/commands/assistants/setup/manualConfiguration/types.js +2 -0
  104. package/dist/cli/commands/assistants/setup/manualConfiguration/types.js.map +1 -0
  105. package/dist/cli/commands/assistants/setup/manualConfiguration/ui.d.ts +6 -0
  106. package/dist/cli/commands/assistants/setup/manualConfiguration/ui.d.ts.map +1 -0
  107. package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js +103 -0
  108. package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js.map +1 -0
  109. package/dist/cli/commands/assistants/setup/selection/actions.d.ts +31 -0
  110. package/dist/cli/commands/assistants/setup/selection/actions.d.ts.map +1 -0
  111. package/dist/cli/commands/assistants/setup/selection/actions.js +321 -0
  112. package/dist/cli/commands/assistants/setup/selection/actions.js.map +1 -0
  113. package/dist/cli/commands/assistants/setup/selection/constants.d.ts +79 -0
  114. package/dist/cli/commands/assistants/setup/selection/constants.d.ts.map +1 -0
  115. package/dist/cli/commands/assistants/setup/selection/constants.js +90 -0
  116. package/dist/cli/commands/assistants/setup/selection/constants.js.map +1 -0
  117. package/dist/cli/commands/assistants/setup/selection/index.d.ts +25 -0
  118. package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -0
  119. package/dist/cli/commands/assistants/setup/selection/index.js +127 -0
  120. package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -0
  121. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts +20 -0
  122. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -0
  123. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +328 -0
  124. package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -0
  125. package/dist/cli/commands/assistants/setup/selection/types.d.ts +27 -0
  126. package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -0
  127. package/dist/cli/commands/assistants/setup/selection/types.js +2 -0
  128. package/dist/cli/commands/assistants/setup/selection/types.js.map +1 -0
  129. package/dist/cli/commands/assistants/setup/selection/ui.d.ts +11 -0
  130. package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -0
  131. package/dist/cli/commands/assistants/setup/selection/ui.js +189 -0
  132. package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -0
  133. package/dist/cli/commands/assistants/setup/selection/utils.d.ts +36 -0
  134. package/dist/cli/commands/assistants/setup/selection/utils.d.ts.map +1 -0
  135. package/dist/cli/commands/assistants/setup/selection/utils.js +55 -0
  136. package/dist/cli/commands/assistants/setup/selection/utils.js.map +1 -0
  137. package/dist/cli/commands/assistants/setup/summary/index.d.ts +16 -0
  138. package/dist/cli/commands/assistants/setup/summary/index.d.ts.map +1 -0
  139. package/dist/cli/commands/assistants/setup/summary/index.js +48 -0
  140. package/dist/cli/commands/assistants/setup/summary/index.js.map +1 -0
  141. package/dist/cli/commands/log/cleaner.d.ts +33 -0
  142. package/dist/cli/commands/log/cleaner.d.ts.map +1 -0
  143. package/dist/cli/commands/log/cleaner.js +214 -0
  144. package/dist/cli/commands/log/cleaner.js.map +1 -0
  145. package/dist/cli/commands/log/filter.d.ts +55 -0
  146. package/dist/cli/commands/log/filter.d.ts.map +1 -0
  147. package/dist/cli/commands/log/filter.js +128 -0
  148. package/dist/cli/commands/log/filter.js.map +1 -0
  149. package/dist/cli/commands/log/follower.d.ts +36 -0
  150. package/dist/cli/commands/log/follower.d.ts.map +1 -0
  151. package/dist/cli/commands/log/follower.js +151 -0
  152. package/dist/cli/commands/log/follower.js.map +1 -0
  153. package/dist/cli/commands/log/formatter.d.ts +76 -0
  154. package/dist/cli/commands/log/formatter.d.ts.map +1 -0
  155. package/dist/cli/commands/log/formatter.js +261 -0
  156. package/dist/cli/commands/log/formatter.js.map +1 -0
  157. package/dist/cli/commands/log/index.d.ts +6 -0
  158. package/dist/cli/commands/log/index.d.ts.map +1 -0
  159. package/dist/cli/commands/log/index.js +398 -0
  160. package/dist/cli/commands/log/index.js.map +1 -0
  161. package/dist/cli/commands/log/parser.d.ts +20 -0
  162. package/dist/cli/commands/log/parser.d.ts.map +1 -0
  163. package/dist/cli/commands/log/parser.js +111 -0
  164. package/dist/cli/commands/log/parser.js.map +1 -0
  165. package/dist/cli/commands/log/reader.d.ts +61 -0
  166. package/dist/cli/commands/log/reader.d.ts.map +1 -0
  167. package/dist/cli/commands/log/reader.js +327 -0
  168. package/dist/cli/commands/log/reader.js.map +1 -0
  169. package/dist/cli/commands/log/types.d.ts +100 -0
  170. package/dist/cli/commands/log/types.d.ts.map +1 -0
  171. package/dist/cli/commands/log/types.js +5 -0
  172. package/dist/cli/commands/log/types.js.map +1 -0
  173. package/dist/cli/commands/setup.d.ts.map +1 -1
  174. package/dist/cli/commands/setup.js +2 -0
  175. package/dist/cli/commands/setup.js.map +1 -1
  176. package/dist/cli/index.js +2 -0
  177. package/dist/cli/index.js.map +1 -1
  178. package/dist/env/types.d.ts +1 -0
  179. package/dist/env/types.d.ts.map +1 -1
  180. package/dist/env/types.js.map +1 -1
  181. package/dist/providers/plugins/sso/session/SessionSyncer.d.ts +5 -0
  182. package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
  183. package/dist/providers/plugins/sso/session/SessionSyncer.js +102 -3
  184. package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
  185. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts +0 -1
  186. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts.map +1 -1
  187. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js +25 -48
  188. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js.map +1 -1
  189. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts.map +1 -1
  190. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js +8 -34
  191. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
  192. package/dist/utils/native-installer.d.ts +1 -0
  193. package/dist/utils/native-installer.d.ts.map +1 -1
  194. package/dist/utils/native-installer.js +21 -7
  195. package/dist/utils/native-installer.js.map +1 -1
  196. package/package.json +2 -2
  197. package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts.map +0 -1
  198. package/dist/cli/commands/assistants/generators/claude-agent-generator.js.map +0 -1
  199. package/dist/cli/commands/assistants/list.d.ts +0 -11
  200. package/dist/cli/commands/assistants/list.d.ts.map +0 -1
  201. package/dist/cli/commands/assistants/list.js +0 -323
  202. package/dist/cli/commands/assistants/list.js.map +0 -1
  203. /package/dist/cli/commands/assistants/{generators → setup/generators}/claude-agent-generator.d.ts +0 -0
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Log filter engine - Chainable filtering for log entries
3
+ */
4
+ import type { LogEntry, LogFilter, LogLevel } from './types.js';
5
+ /**
6
+ * Chainable filter engine for log entries
7
+ */
8
+ export declare class LogFilterEngine {
9
+ private filters;
10
+ /**
11
+ * Filter by session ID
12
+ */
13
+ bySession(sessionId: string): this;
14
+ /**
15
+ * Filter by agent name
16
+ */
17
+ byAgent(agent: string): this;
18
+ /**
19
+ * Filter by profile name
20
+ */
21
+ byProfile(profile: string): this;
22
+ /**
23
+ * Filter by log level (includes specified level and above)
24
+ */
25
+ byLevel(level: LogLevel): this;
26
+ /**
27
+ * Filter by date range
28
+ */
29
+ byDateRange(from?: Date, to?: Date): this;
30
+ /**
31
+ * Filter by pattern (string or regex)
32
+ */
33
+ byPattern(pattern: string, isRegex?: boolean): this;
34
+ /**
35
+ * Apply all filters to an entry
36
+ */
37
+ apply(entry: LogEntry): boolean;
38
+ /**
39
+ * Apply filters to an array of entries
40
+ */
41
+ applyAll(entries: LogEntry[]): LogEntry[];
42
+ /**
43
+ * Create filter from LogFilter object
44
+ */
45
+ static fromFilter(filter?: LogFilter): LogFilterEngine;
46
+ /**
47
+ * Check if filter has any active filters
48
+ */
49
+ hasFilters(): boolean;
50
+ /**
51
+ * Get count of active filters
52
+ */
53
+ getFilterCount(): number;
54
+ }
55
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/log/filter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhE;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAA2C;IAE1D;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAKlC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKhC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAY9B;;OAEG;IACH,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI;IAUzC;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,IAAI;IAwBjD;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;IAI/B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE;IAIzC;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe;IAetD;;OAEG;IACH,UAAU,IAAI,OAAO;IAIrB;;OAEG;IACH,cAAc,IAAI,MAAM;CAGzB"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Log filter engine - Chainable filtering for log entries
3
+ */
4
+ /**
5
+ * Chainable filter engine for log entries
6
+ */
7
+ export class LogFilterEngine {
8
+ filters = [];
9
+ /**
10
+ * Filter by session ID
11
+ */
12
+ bySession(sessionId) {
13
+ this.filters.push(entry => entry.sessionId === sessionId);
14
+ return this;
15
+ }
16
+ /**
17
+ * Filter by agent name
18
+ */
19
+ byAgent(agent) {
20
+ this.filters.push(entry => entry.agent === agent);
21
+ return this;
22
+ }
23
+ /**
24
+ * Filter by profile name
25
+ */
26
+ byProfile(profile) {
27
+ this.filters.push(entry => entry.profile === profile);
28
+ return this;
29
+ }
30
+ /**
31
+ * Filter by log level (includes specified level and above)
32
+ */
33
+ byLevel(level) {
34
+ const levels = { debug: 0, info: 1, warn: 2, error: 3 };
35
+ const filterLevel = levels[level] || 0;
36
+ this.filters.push(entry => {
37
+ const entryLevel = levels[entry.level] || 0;
38
+ return entryLevel >= filterLevel;
39
+ });
40
+ return this;
41
+ }
42
+ /**
43
+ * Filter by date range
44
+ */
45
+ byDateRange(from, to) {
46
+ if (from) {
47
+ this.filters.push(entry => entry.timestamp >= from);
48
+ }
49
+ if (to) {
50
+ this.filters.push(entry => entry.timestamp <= to);
51
+ }
52
+ return this;
53
+ }
54
+ /**
55
+ * Filter by pattern (string or regex)
56
+ */
57
+ byPattern(pattern, isRegex = false) {
58
+ if (isRegex) {
59
+ try {
60
+ const regex = new RegExp(pattern, 'i');
61
+ this.filters.push(entry => {
62
+ const searchText = `${entry.agent} ${entry.message}`;
63
+ return regex.test(searchText);
64
+ });
65
+ }
66
+ catch {
67
+ // Invalid regex, fallback to string search
68
+ this.filters.push(entry => {
69
+ const searchText = `${entry.agent} ${entry.message}`.toLowerCase();
70
+ return searchText.includes(pattern.toLowerCase());
71
+ });
72
+ }
73
+ }
74
+ else {
75
+ this.filters.push(entry => {
76
+ const searchText = `${entry.agent} ${entry.message}`.toLowerCase();
77
+ return searchText.includes(pattern.toLowerCase());
78
+ });
79
+ }
80
+ return this;
81
+ }
82
+ /**
83
+ * Apply all filters to an entry
84
+ */
85
+ apply(entry) {
86
+ return this.filters.every(filter => filter(entry));
87
+ }
88
+ /**
89
+ * Apply filters to an array of entries
90
+ */
91
+ applyAll(entries) {
92
+ return entries.filter(entry => this.apply(entry));
93
+ }
94
+ /**
95
+ * Create filter from LogFilter object
96
+ */
97
+ static fromFilter(filter) {
98
+ const engine = new LogFilterEngine();
99
+ if (!filter)
100
+ return engine;
101
+ if (filter.sessionId)
102
+ engine.bySession(filter.sessionId);
103
+ if (filter.agent)
104
+ engine.byAgent(filter.agent);
105
+ if (filter.profile)
106
+ engine.byProfile(filter.profile);
107
+ if (filter.level)
108
+ engine.byLevel(filter.level);
109
+ if (filter.fromDate || filter.toDate)
110
+ engine.byDateRange(filter.fromDate, filter.toDate);
111
+ if (filter.pattern)
112
+ engine.byPattern(filter.pattern, filter.isRegex);
113
+ return engine;
114
+ }
115
+ /**
116
+ * Check if filter has any active filters
117
+ */
118
+ hasFilters() {
119
+ return this.filters.length > 0;
120
+ }
121
+ /**
122
+ * Get count of active filters
123
+ */
124
+ getFilterCount() {
125
+ return this.filters.length;
126
+ }
127
+ }
128
+ //# sourceMappingURL=filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/cli/commands/log/filter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,OAAO,eAAe;IAClB,OAAO,GAAwC,EAAE,CAAC;IAE1D;;OAEG;IACH,SAAS,CAAC,SAAiB;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,OAAe;QACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAAe;QACrB,MAAM,MAAM,GAA2B,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAChF,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,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,CAAC,CAAC;QAC/C,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,MAAM;YAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACzF,IAAI,MAAM,CAAC,OAAO;YAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAErE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Log follower - Real-time log following (tail -f style)
3
+ */
4
+ import { LogFormatter } from './formatter.js';
5
+ import type { LogFilter } from './types.js';
6
+ /**
7
+ * Follow logs in real-time
8
+ */
9
+ export declare class LogFollower {
10
+ private watcher;
11
+ private lastPosition;
12
+ private formatter;
13
+ private filter?;
14
+ constructor(formatter: LogFormatter, filter?: LogFilter);
15
+ /**
16
+ * Start following log file
17
+ */
18
+ follow(logFilePath: string): Promise<void>;
19
+ /**
20
+ * Read new lines from log file
21
+ */
22
+ private readNewLines;
23
+ /**
24
+ * Read log file from specific position
25
+ */
26
+ private readFromPosition;
27
+ /**
28
+ * Check if entry matches filter
29
+ */
30
+ private matchesFilter;
31
+ /**
32
+ * Stop following
33
+ */
34
+ stop(): void;
35
+ }
36
+ //# sourceMappingURL=follower.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"follower.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/log/follower.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,YAAY,CAAC;AAEtD;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,SAAS,CAAe;IAChC,OAAO,CAAC,MAAM,CAAC,CAAY;gBAEf,SAAS,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,SAAS;IAKvD;;OAEG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBhD;;OAEG;YACW,YAAY;IA+B1B;;OAEG;YACW,gBAAgB;IAuB9B;;OAEG;IACH,OAAO,CAAC,aAAa;IA+CrB;;OAEG;IACH,IAAI,IAAI,IAAI;CAMb"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Log follower - Real-time log following (tail -f style)
3
+ */
4
+ import { watch, statSync } from 'fs';
5
+ import { createInterface } from 'readline';
6
+ import { createReadStream } from 'fs';
7
+ import { parseLogLine } from './parser.js';
8
+ /**
9
+ * Follow logs in real-time
10
+ */
11
+ export class LogFollower {
12
+ watcher = null;
13
+ lastPosition = 0;
14
+ formatter;
15
+ filter;
16
+ constructor(formatter, filter) {
17
+ this.formatter = formatter;
18
+ this.filter = filter;
19
+ }
20
+ /**
21
+ * Start following log file
22
+ */
23
+ async follow(logFilePath) {
24
+ // Read existing content first
25
+ await this.readNewLines(logFilePath, true);
26
+ // Watch for changes
27
+ this.watcher = watch(logFilePath, async (eventType) => {
28
+ if (eventType === 'change') {
29
+ await this.readNewLines(logFilePath, false);
30
+ }
31
+ });
32
+ // Handle graceful shutdown
33
+ process.on('SIGINT', () => {
34
+ this.stop();
35
+ console.log('\nStopped following logs');
36
+ process.exit(0);
37
+ });
38
+ // Keep process alive
39
+ return new Promise(() => {
40
+ // Never resolves - runs until interrupted
41
+ });
42
+ }
43
+ /**
44
+ * Read new lines from log file
45
+ */
46
+ async readNewLines(logFilePath, _isInitial) {
47
+ try {
48
+ const stats = statSync(logFilePath);
49
+ const currentSize = stats.size;
50
+ // If file was truncated, reset position
51
+ if (currentSize < this.lastPosition) {
52
+ this.lastPosition = 0;
53
+ }
54
+ // Read from last position
55
+ if (currentSize > this.lastPosition) {
56
+ const entries = await this.readFromPosition(logFilePath, this.lastPosition);
57
+ // Apply filter
58
+ const filtered = this.filter
59
+ ? entries.filter(entry => this.matchesFilter(entry))
60
+ : entries;
61
+ // Output entries
62
+ for (const entry of filtered) {
63
+ console.log(this.formatter['formatLogEntry'](entry));
64
+ }
65
+ this.lastPosition = currentSize;
66
+ }
67
+ }
68
+ catch {
69
+ // File might not exist yet or can't be read
70
+ }
71
+ }
72
+ /**
73
+ * Read log file from specific position
74
+ */
75
+ async readFromPosition(logFilePath, start) {
76
+ const entries = [];
77
+ try {
78
+ const fileStream = createReadStream(logFilePath, { start });
79
+ const rl = createInterface({
80
+ input: fileStream,
81
+ crlfDelay: Infinity
82
+ });
83
+ for await (const line of rl) {
84
+ const entry = parseLogLine(line);
85
+ if (entry) {
86
+ entries.push(entry);
87
+ }
88
+ }
89
+ }
90
+ catch {
91
+ // Error reading file
92
+ }
93
+ return entries;
94
+ }
95
+ /**
96
+ * Check if entry matches filter
97
+ */
98
+ matchesFilter(entry) {
99
+ if (!this.filter)
100
+ return true;
101
+ if (this.filter.sessionId && entry.sessionId !== this.filter.sessionId) {
102
+ return false;
103
+ }
104
+ if (this.filter.agent && entry.agent !== this.filter.agent) {
105
+ return false;
106
+ }
107
+ if (this.filter.profile && entry.profile !== this.filter.profile) {
108
+ return false;
109
+ }
110
+ if (this.filter.level) {
111
+ const levels = { debug: 0, info: 1, warn: 2, error: 3 };
112
+ const entryLevel = levels[entry.level] || 0;
113
+ const filterLevel = levels[this.filter.level] || 0;
114
+ if (entryLevel < filterLevel) {
115
+ return false;
116
+ }
117
+ }
118
+ if (this.filter.pattern) {
119
+ const searchText = `${entry.agent} ${entry.message}`.toLowerCase();
120
+ if (this.filter.isRegex) {
121
+ try {
122
+ const regex = new RegExp(this.filter.pattern, 'i');
123
+ if (!regex.test(searchText)) {
124
+ return false;
125
+ }
126
+ }
127
+ catch {
128
+ if (!searchText.includes(this.filter.pattern.toLowerCase())) {
129
+ return false;
130
+ }
131
+ }
132
+ }
133
+ else {
134
+ if (!searchText.includes(this.filter.pattern.toLowerCase())) {
135
+ return false;
136
+ }
137
+ }
138
+ }
139
+ return true;
140
+ }
141
+ /**
142
+ * Stop following
143
+ */
144
+ stop() {
145
+ if (this.watcher) {
146
+ this.watcher.close();
147
+ this.watcher = null;
148
+ }
149
+ }
150
+ }
151
+ //# sourceMappingURL=follower.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"follower.js","sourceRoot":"","sources":["../../../../src/cli/commands/log/follower.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C;;GAEG;AACH,MAAM,OAAO,WAAW;IACd,OAAO,GAAqB,IAAI,CAAC;IACjC,YAAY,GAAG,CAAC,CAAC;IACjB,SAAS,CAAe;IACxB,MAAM,CAAa;IAE3B,YAAY,SAAuB,EAAE,MAAkB;QACrD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,WAAmB;QAC9B,8BAA8B;QAC9B,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAE3C,oBAAoB;QACpB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;YACpD,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;gBAC3B,MAAM,IAAI,C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CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;oBAC5D,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,IAAI;QACF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Log formatter - Output formatting for logs and sessions
3
+ */
4
+ import type { LogEntry, SessionMetadata, SessionListEntry, OutputFormat, CleanupStats } from './types.js';
5
+ /**
6
+ * Format log entries for console output
7
+ */
8
+ export declare class LogFormatter {
9
+ private format;
10
+ constructor(format?: Partial<OutputFormat>);
11
+ /**
12
+ * Format log entries as text
13
+ */
14
+ formatText(entries: LogEntry[]): string;
15
+ /**
16
+ * Format a single log entry
17
+ */
18
+ private formatLogEntry;
19
+ /**
20
+ * Format timestamp
21
+ */
22
+ private formatTimestamp;
23
+ /**
24
+ * Format log level with color
25
+ */
26
+ private formatLevel;
27
+ /**
28
+ * Format log entries as JSON
29
+ */
30
+ formatJSON(entries: LogEntry[]): string;
31
+ /**
32
+ * Format log entries as JSONL
33
+ */
34
+ formatJSONL(entries: LogEntry[]): string;
35
+ /**
36
+ * Format session metadata for display
37
+ */
38
+ formatSession(session: SessionMetadata, conversation?: Array<Record<string, unknown>>): string;
39
+ /**
40
+ * Format session list as table
41
+ */
42
+ formatSessionList(sessions: SessionListEntry[]): string;
43
+ /**
44
+ * Format cleanup statistics
45
+ */
46
+ formatCleanupStats(stats: CleanupStats, isDryRun: boolean): string;
47
+ /**
48
+ * Format key-value pair
49
+ */
50
+ private formatKeyValue;
51
+ /**
52
+ * Format status with color
53
+ */
54
+ private formatStatus;
55
+ /**
56
+ * Format duration in milliseconds to human-readable string
57
+ */
58
+ private formatDuration;
59
+ /**
60
+ * Format bytes to human-readable string
61
+ */
62
+ private formatBytes;
63
+ /**
64
+ * Truncate path to max length
65
+ */
66
+ private truncatePath;
67
+ /**
68
+ * Apply colorization conditionally
69
+ */
70
+ private colorize;
71
+ /**
72
+ * Strip ANSI color codes
73
+ */
74
+ private stripAnsi;
75
+ }
76
+ //# sourceMappingURL=formatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/log/formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1G;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAe;gBAEjB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAQ1C;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM;IAcvC;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB;;OAEG;IACH,OAAO,CAAC,WAAW;IAgBnB;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM;IAavC;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM;IAgBxC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM;IAkC9F;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,MAAM;IAoCvD;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM;IA+BlE;;OAEG;IACH,OAAO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