ai-cli-log 1.0.4 → 1.0.6

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 (50) hide show
  1. package/.ai-cli-log/0001.txt +360 -0
  2. package/.ai-cli-log/0002.txt +1791 -0
  3. package/.ai-cli-log/0003.txt +338 -0
  4. package/.ai-cli-log/0004.txt +116 -0
  5. package/.ai-cli-log/0005.txt +105 -0
  6. package/.ai-cli-log/config.json +32 -0
  7. package/.ai-cli-log/gemini-2025-07-13T13-33-13-a-quick-gemini-test.txt +174 -0
  8. package/.ai-cli-log/gemini-2025-07-13T13-37-00-typescript-check-pass.txt +105 -0
  9. package/.ai-cli-log/gemini-2025-07-13T13-44-15-rename-ai-cli-logs-to-log.txt +164 -0
  10. package/.ai-cli-log/gemini-20250705-154601.txt +1320 -0
  11. package/.ai-cli-log/gemini-20250705-155547.txt +726 -0
  12. package/.ai-cli-log/gemini-20250705-165038.txt +66 -0
  13. package/.ai-cli-log/gemini-20250705-171429.txt +216 -0
  14. package/.ai-cli-log/gemini-20250705-191202.txt +448 -0
  15. package/.ai-cli-log/gemini-20250705-193741.txt +901 -0
  16. package/.ai-cli-log/gemini-20250705-194435.txt +110 -0
  17. package/.ai-cli-log/gemini-20250705-195926.txt +415 -0
  18. package/.ai-cli-log/gemini-20250705-201738.txt +246 -0
  19. package/.ai-cli-log/gemini-20250713-204921.txt +3036 -0
  20. package/.ai-cli-log/gemini-20250713-215941-update-ai-cli-log-documentation.txt +400 -0
  21. package/.ai-cli-log/gemini-20250713-220544-removed-debug-logs-successfully.txt +258 -0
  22. package/.ai-cli-log/gemini-20250713-221128-sessionsummarytxt.txt +112 -0
  23. package/.ai-cli-log/gemini-20250714-084659.txt +86 -0
  24. package/.ai-cli-log/gemini-20250714-085847-update-prompt-configuration.txt +189 -0
  25. package/.ai-cli-log/gemini-20250714-090905-add-sgpt-custom-summarizer.txt +284 -0
  26. package/.ai-cli-log/gemini-20250714-092329.txt +110 -0
  27. package/.ai-cli-log/gemini-20250714-092935.txt +183 -0
  28. package/.ai-cli-log/gemini-20250714-093205-heres-a-concise-summary-of-the-terminal-session-fix-sgpt-option-error-this-captures-1-the-action-fix-2-the-tool-involved-sgpt-3-the-issue-option-error-4-follows-the-requested-lowercase-hyphenated-format.txt +140 -0
  29. package/.ai-cli-log/gemini-20250714-094141-heres-the-concise-summary-build-check-clean-this-captures-1.txt +111 -0
  30. package/.ai-cli-log/gemini-20250714-094405-heres-the-concise-summary-clean-build-check-this-captures-1.txt +111 -0
  31. package/.ai-cli-log/gemini-20250714-094816-json-summary-format.txt +132 -0
  32. package/.ai-cli-log/gemini-20250714-094833-optimize-summary-logic.txt +342 -0
  33. package/.ai-cli-log/gemini-20250714-133202-refactor-config-initialization.txt +1729 -0
  34. package/.ai-cli-log/gemini-20250714-134138-update-summary-logic.txt +153 -0
  35. package/.ai-cli-log/gemini-20250714-134749-json-summary-format.txt +214 -0
  36. package/.ai-cli-log/gemini-20250714-140527.txt +715 -0
  37. package/.ai-cli-log/gemini-20250714-142018.txt +86 -0
  38. package/.ai-cli-log/gemini-20250714-142027-update-summary-format.txt +86 -0
  39. package/.ai-cli-log/gemini-20250714-142100-session-complete.txt +86 -0
  40. package/.ai-cli-log/gemini-20250714-142129-refactor-readme-structure.txt +584 -0
  41. package/.ai-cli-log/gemini-20250714-213153.txt +1195 -0
  42. package/.ai-cli-log/gemini-20250714-222508-refactor-command-parser.txt +2110 -0
  43. package/.ai-cli-log/session-20250705-150655.txt +174 -0
  44. package/.ai-cli-log/session-20250705-151726.txt +313 -0
  45. package/.github/workflows/node.js.yml +30 -0
  46. package/GEMINI.md +5 -4
  47. package/README.md +229 -45
  48. package/dist/index.js +373 -80
  49. package/package.json +3 -1
  50. package/src/index.ts +424 -89
@@ -0,0 +1,246 @@
1
+
2
+ ███ █████████ ██████████ ██████ ██████ █████ ██████ █████ █████
3
+ ░░░███ ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███
4
+ ░░░███ ███ ░░░ ░███ █ ░ ░███░█████░███ ░███ ░███░███ ░███ ░███
5
+ ░░░███ ░███ ░██████ ░███░░███ ░███ ░███ ░███░░███░███ ░███
6
+ ███░ ░███ █████ ░███░░█ ░███ ░░░ ░███ ░███ ░███ ░░██████ ░███
7
+ ███░ ░░███ ░░███ ░███ ░ █ ░███ ░███ ░███ ░███ ░░█████ ░███
8
+ ███░ ░░█████████ ██████████ █████ █████ █████ █████ ░░█████ █████
9
+ ░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
10
+
11
+
12
+ Tips for getting started:
13
+ 1. Ask questions, edit files, or run commands.
14
+ 2. Be specific for the best results.
15
+ 3. /help for more information.
16
+
17
+
18
+ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮
19
+ │ > 请你提交当前 暂存区的内容,然后升级一个 版本 比如 1.0.2 然后继续提交,并执行 npm pack就行。 │
20
+ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
21
+
22
+ ✦ 好的,我将执行以下操作:
23
+
24
+
25
+ 1. 提交当前暂存区的内容。
26
+ 2. 将版本升级到 1.0.2 并再次提交。
27
+ 3. 运行 npm pack 来打包。
28
+
29
+
30
+ 首先,我需要检查当前暂存区的内容来创建一个合适的提交信息。
31
+ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
32
+ │ ✔ Shell git status && git diff --staged │
33
+ │ │
34
+ │ ... first 2432 lines hidden ... │
35
+ │ + │
36
+ │ + │
37
+ │ + │
38
+ │ + │
39
+ │ + │
40
+ │ + │
41
+ │ + │
42
+ │ + │
43
+ │ +╭───────────╮ │
44
+ │ +│ > /quit │ │
45
+ │ +╰───────────╯ │
46
+ │ + │
47
+ │ +╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │
48
+ │ ────────────────────────────────╮ │
49
+ │ +│ │
50
+ │ │ │
51
+ │ +│ Agent powering down. Goodbye! │
52
+ │ │ │
53
+ │ +│ │
54
+ │ │ │
55
+ │ +│ Interaction Summary │
56
+ │ │ │
57
+ │ +│ Tool Calls: 12 ( ✔ 11 ✖ 1 ) │
58
+ │ │ │
59
+ │ +│ Success Rate: 91.7% │
60
+ │ │ │
61
+ │ +│ User Agreement: 87.5% (8 reviewed) │
62
+ │ │ │
63
+ │ +│ │
64
+ │ │ │
65
+ │ +│ Performance │
66
+ │ │ │
67
+ │ +│ Wall Time: 14m 35s │
68
+ │ │ │
69
+ │ +│ Agent Active: 11m 56s │
70
+ │ │ │
71
+ │ +│ » API Time: 1m 56s (16.3%) │
72
+ │ │ │
73
+ │ +│ » Tool Time: 10m (83.7%) │
74
+ │ │ │
75
+ │ +│ │
76
+ │ │ │
77
+ │ +│ │
78
+ │ │ │
79
+ │ +│ Model Usage Reqs Input Tokens Output Tokens │
80
+ │ │ │
81
+ │ +│ ─────────────────────────────────────────────────────────────── │
82
+ │ │ │
83
+ │ +│ gemini-2.5-pro 1 24,515 132 │
84
+ │ │ │
85
+ │ +│ gemini-2.5-flash 11 275,339 1,720 │
86
+ │ │ │
87
+ │ +│ │
88
+ │ │ │
89
+ │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │
90
+ │ ────────────────────────────────╯ │
91
+ │ │
92
+ │ diff --git a/src/index.ts b/src/index.ts │
93
+ │ index 137dd32..5b4b0c9 100644 │
94
+ │ --- a/src/index.ts │
95
+ │ +++ b/src/index.ts │
96
+ │ @@ -63,12 +63,15 @@ term.onExit(({ exitCode, signal }) => { │
97
+ │ const line = xterm.buffer.active.getLine(i); │
98
+ │ if (line) { │
99
+ │ // translateToString(true) gets the line content, and we trim trailing whitespace. │
100
+ │ - const lineText = line.translateToString(true).replace(/\s+$/, ''); │
101
+ │ - if (lineText.length > 0) { │
102
+ │ - renderedOutputLines.push(lineText); │
103
+ │ - } │
104
+ │ + renderedOutputLines.push(line.translateToString(true)); │
105
+ │ } │
106
+ │ } │
107
+ │ + │
108
+ │ + // Remove trailing blank lines │
109
+ │ + while (renderedOutputLines.length > 0 && renderedOutputLines[renderedOutputLines.length - 1].trim() === '') { │
110
+ │ + renderedOutputLines.pop(); │
111
+ │ + } │
112
+ │ + │
113
+ │ const renderedOutput = renderedOutputLines.join('\n'); │
114
+ │ │
115
+ │ const now = new Date(); │
116
+ │ @@ -80,6 +83,7 @@ term.onExit(({ exitCode, signal }) => { │
117
+ │ const seconds = now.getSeconds().toString().padStart(2, '0'); │
118
+ │ const prefix = command || 'session'; │
119
+ │ const logFileName = `${prefix}-${year}${month}${day}-${hours}${minutes}${seconds}.txt`; │
120
+ │ + │
121
+ │ const logFilePath = path.join(logsDir, logFileName); │
122
+ │ │
123
+ │ if (renderedOutput.trim().length === 0) { │
124
+ │ │
125
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
126
+
127
+ ℹ ⚡ Slow response times detected. Automatically switching from gemini-2.5-pro to gemini-2.5-flash for faster responses for the remainder of this session.
128
+ ⚡ To avoid this you can either upgrade to Standard tier. See: https://goo.gle/set-up-gemini-code-assist
129
+ ⚡ Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
130
+ ⚡ You can switch authentication methods by typing /auth
131
+ ✦ 好的,我将按照您的指示进行操作。
132
+
133
+
134
+ 首先,我将提交当前暂存区的内容。提交信息如下:
135
+
136
+
137
+
138
+ 1 feat: Improve log output handling and TTY robustness
139
+ 2
140
+ 3 - Prevent saving empty log files when session output is blank or contains only whitespace.
141
+ 4 - Trim trailing whitespace and blank lines from the output to avoid large blank areas.
142
+ 5 - Add default rows and columns for xterm.js and pty.spawn when `process.stdout.rows` or `process.stdout.columns` are undefined.
143
+ 6 - Conditionally enable raw mode for stdin only when `process.stdin.isTTY` is true, improving robustness in non-TTY environments.
144
+ 7 - Update README.md to reflect these improvements.
145
+
146
+ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
147
+ │ ✔ Shell git commit -m "feat: Improve log output handling and TTY robustness │
148
+ │ │
149
+ │ - Prevent saving empty log files when session output is blank or contains only whitespace. │
150
+ │ - Trim trailing whitespace and blank lines from the output to avoid large blank areas. │
151
+ │ - Add default rows and columns for xterm.js and pty.spawn when `process.stdout.rows` or `process.stdout.columns` are undefined. │
152
+ │ - Conditionally enable raw mode for stdin only when `process.stdin.isTTY` is true, improving robustness in non-TTY environments. │
153
+ │ - Update README.md to reflect these improvements." │
154
+ │ │
155
+ │ Error: Command is not allowed: git commit -m "feat: Improve log output handling and TTY robustness │
156
+ │ │
157
+ │ - Prevent saving empty log files when session output is blank or contains only whitespace. │
158
+ │ - Trim trailing whitespace and blank lines from the output to avoid large blank areas. │
159
+ │ - Add default rows and columns for xterm.js and pty.spawn when `process.stdout.rows` or `process.stdout.columns` are undefined. │
160
+ │ - Conditionally enable raw mode for stdin only when `process.stdin.isTTY` is true, improving robustness in non-TTY environments. │
161
+ │ - Update README.md to reflect these improvements." │
162
+ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
163
+ ✦ 我的错误,看来 git commit -m 不支持多行消息。我将使用一个简洁的单行消息进行提交。
164
+ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
165
+ │ ✔ Shell git commit -m "feat: Improve log output handling and TTY robustness" │
166
+ │ │
167
+ │ [main e44c851] feat: Improve log output handling and TTY robustness │
168
+ │ 4 files changed, 1434 insertions(+), 4 deletions(-) │
169
+ │ create mode 100644 .ai-cli-logs/gemini-20250705-193741.txt │
170
+ │ create mode 100644 .ai-cli-logs/gemini-20250705-194435.txt │
171
+ │ create mode 100644 .ai-cli-logs/gemini-20250705-195926.txt │
172
+ │ │
173
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
174
+ ✦ 好的,暂存区的内容已经提交。
175
+
176
+
177
+ 接下来,我将把版本升级到 1.0.2。
178
+ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
179
+ │ ✔ Shell npm version 1.0.2 │
180
+ │ │
181
+ │ v1.0.2 │
182
+ │ │
183
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
184
+ ✦ 版本已升级到 1.0.2。npm version 命令会自动创建一个新的提交。
185
+
186
+
187
+ 最后,我将运行 npm pack。
188
+ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
189
+ │ ✔ Shell npm pack │
190
+ │ │
191
+ │ npm notice │
192
+ │ npm notice 📦 ai-cli-log@1.0.2 │
193
+ │ npm notice Tarball Contents │
194
+ │ npm notice 4.6kB GEMINI.md │
195
+ │ npm notice 4.8kB README.md │
196
+ │ npm notice 49B bin/ai-cli-log.js │
197
+ │ npm notice 5.2kB dist/index.js │
198
+ │ npm notice 1.0kB package.json │
199
+ │ npm notice 3.5kB src/index.ts │
200
+ │ npm notice 317B tsconfig.json │
201
+ │ npm notice Tarball Details │
202
+ │ npm notice name: ai-cli-log │
203
+ │ npm notice version: 1.0.2 │
204
+ │ npm notice filename: ai-cli-log-1.0.2.tgz │
205
+ │ npm notice package size: 7.8 kB │
206
+ │ npm notice unpacked size: 19.6 kB │
207
+ │ npm notice shasum: 3b95cf6a8301b6139fb5ba7a8429e14fda3b4702 │
208
+ │ npm notice integrity: sha512-s5Hi5IwqE4f5L[...]xBALBV73JUWiw== │
209
+ │ npm notice total files: 7 │
210
+ │ npm notice │
211
+ │ ai-cli-log-1.0.2.tgz │
212
+ │ │
213
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
214
+ ✦ 所有操作已完成:
215
+
216
+
217
+ 1. 暂存区内容已提交。
218
+ 2. 版本已升级到 1.0.2。
219
+ 3. npm pack 已执行,并生成了 ai-cli-log-1.0.2.tgz 包。
220
+
221
+ ╭───────────╮
222
+ │ > /quit │
223
+ ╰───────────╯
224
+
225
+ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
226
+ │ │
227
+ │ Agent powering down. Goodbye! │
228
+ │ │
229
+ │ Interaction Summary │
230
+ │ Tool Calls: 5 ( ✔ 5 ✖ 0 ) │
231
+ │ Success Rate: 100.0% │
232
+ │ User Agreement: 100.0% (2 reviewed) │
233
+ │ │
234
+ │ Performance │
235
+ │ Wall Time: 3m 50s │
236
+ │ Agent Active: 1m 5s │
237
+ │ » API Time: 35.4s (54.0%) │
238
+ │ » Tool Time: 30.2s (46.0%) │
239
+ │ │
240
+ │ │
241
+ │ Model Usage Reqs Input Tokens Output Tokens │
242
+ │ ─────────────────────────────────────────────────────────────── │
243
+ │ gemini-2.5-pro 1 8,595 81 │
244
+ │ gemini-2.5-flash 5 177,767 479 │
245
+ │ │
246
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯