codebuff 1.0.250 → 1.0.252

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 (62) hide show
  1. package/dist/background-process-manager.d.ts +50 -0
  2. package/dist/browser-runner.d.ts +35 -0
  3. package/dist/chat-storage.d.ts +2 -0
  4. package/dist/checkpoints/checkpoint-manager.d.ts +94 -0
  5. package/dist/checkpoints/file-manager.d.ts +72 -0
  6. package/dist/checkpoints/file-manager.js +311 -0
  7. package/dist/checkpoints/file-manager.js.map +1 -0
  8. package/dist/cli-handlers/api-key.d.ts +25 -0
  9. package/dist/cli-handlers/checkpoint.d.ts +18 -0
  10. package/dist/cli-handlers/diff.d.ts +2 -0
  11. package/dist/cli-handlers/easter-egg.d.ts +1 -0
  12. package/dist/cli-handlers/easter-egg.js +126 -0
  13. package/dist/cli-handlers/easter-egg.js.map +1 -0
  14. package/dist/cli-handlers/inititalization-flow.d.ts +1 -0
  15. package/dist/cli.d.ts +44 -0
  16. package/dist/client.d.ts +157 -0
  17. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  18. package/dist/config.d.ts +4 -0
  19. package/dist/config.js +12 -0
  20. package/dist/config.js.map +1 -0
  21. package/dist/create-template-project.d.ts +1 -0
  22. package/dist/create-template-project.js +107 -0
  23. package/dist/create-template-project.js.map +1 -0
  24. package/dist/credentials.d.ts +4 -0
  25. package/dist/dev-process-manager.d.ts +10 -0
  26. package/dist/fingerprint.d.ts +1 -0
  27. package/dist/fingerprint.js +48 -0
  28. package/dist/fingerprint.js.map +1 -0
  29. package/dist/index.d.ts +2 -0
  30. package/dist/menu.d.ts +3 -0
  31. package/dist/project-files.d.ts +114 -0
  32. package/dist/startup-process-handler.d.ts +2 -0
  33. package/dist/tool-handlers.d.ts +28 -0
  34. package/dist/types.d.ts +15 -0
  35. package/dist/update-codebuff.d.ts +1 -0
  36. package/dist/update-codebuff.js +160 -0
  37. package/dist/update-codebuff.js.map +1 -0
  38. package/dist/utils/__tests__/background-process-manager.test.d.ts +1 -0
  39. package/dist/utils/__tests__/background-process-manager.test.js +289 -0
  40. package/dist/utils/__tests__/background-process-manager.test.js.map +1 -0
  41. package/dist/utils/__tests__/tool-renderers.test.d.ts +1 -0
  42. package/dist/utils/__tests__/xml-stream-parser.test.d.ts +1 -0
  43. package/dist/utils/analytics.d.ts +6 -0
  44. package/dist/utils/detect-shell.d.ts +1 -0
  45. package/dist/utils/detect-shell.js +60 -0
  46. package/dist/utils/detect-shell.js.map +1 -0
  47. package/dist/utils/logger.d.ts +21 -0
  48. package/dist/utils/spinner.d.ts +11 -0
  49. package/dist/utils/spinner.js +87 -0
  50. package/dist/utils/spinner.js.map +1 -0
  51. package/dist/utils/system-info.d.ts +8 -0
  52. package/dist/utils/system-info.js +22 -0
  53. package/dist/utils/system-info.js.map +1 -0
  54. package/dist/utils/terminal.d.ts +41 -0
  55. package/dist/utils/tool-renderers.d.ts +16 -0
  56. package/dist/utils/xml-stream-parser.d.ts +9 -0
  57. package/dist/web-scraper.d.ts +3 -0
  58. package/dist/workers/checkpoint-worker.d.ts +1 -0
  59. package/dist/workers/checkpoint-worker.js +48 -0
  60. package/dist/workers/checkpoint-worker.js.map +1 -0
  61. package/dist/workers/project-context.d.ts +1 -0
  62. package/package.json +1 -1
@@ -0,0 +1,289 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-ignore: bun:test types aren't available
4
+ const bun_test_1 = require("bun:test");
5
+ // @ts-ignore: bun:test types aren't available
6
+ const bun_test_2 = require("bun:test");
7
+ const background_process_manager_1 = require("../../background-process-manager");
8
+ // Mock the child process
9
+ const mockChildProcess = {
10
+ exitCode: null,
11
+ signalCode: null,
12
+ };
13
+ (0, bun_test_2.describe)('getBackgroundProcessInfoString', () => {
14
+ let dateNowSpy;
15
+ const currentTime = 3000;
16
+ (0, bun_test_2.beforeEach)(() => {
17
+ (0, bun_test_2.spyOn)(Date, 'now').mockReturnValue(currentTime);
18
+ });
19
+ (0, bun_test_2.afterEach)(() => {
20
+ bun_test_2.mock.restore();
21
+ });
22
+ (0, bun_test_1.test)('formats a running process correctly', () => {
23
+ const startTime = 1000;
24
+ const info = {
25
+ pid: 123,
26
+ toolCallId: 'toolCall123',
27
+ command: 'npm test',
28
+ process: mockChildProcess,
29
+ stdoutBuffer: ['test output'],
30
+ stderrBuffer: ['test error'],
31
+ status: 'running',
32
+ startTime,
33
+ endTime: null,
34
+ lastReportedStdoutLength: 0,
35
+ lastReportedStderrLength: 0,
36
+ lastReportedStatus: null,
37
+ };
38
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
39
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
40
+ });
41
+ (0, bun_test_1.test)('formats a completed process correctly', () => {
42
+ const startTime = 1000;
43
+ const endTime = 2000;
44
+ const mockCompletedProcess = {
45
+ ...mockChildProcess,
46
+ exitCode: 0,
47
+ };
48
+ const info = {
49
+ pid: 456,
50
+ toolCallId: 'toolCall456',
51
+ command: 'npm build',
52
+ process: mockCompletedProcess,
53
+ stdoutBuffer: ['build successful'],
54
+ stderrBuffer: [],
55
+ status: 'completed',
56
+ startTime,
57
+ endTime,
58
+ lastReportedStdoutLength: 0,
59
+ lastReportedStderrLength: 0,
60
+ lastReportedStatus: null,
61
+ };
62
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
63
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
64
+ });
65
+ (0, bun_test_1.test)('formats an errored process correctly', () => {
66
+ const startTime = 1000;
67
+ const endTime = 2500;
68
+ const mockErroredProcess = {
69
+ ...mockChildProcess,
70
+ exitCode: 1,
71
+ signalCode: 'SIGTERM',
72
+ };
73
+ const info = {
74
+ pid: 789,
75
+ toolCallId: 'toolCall789',
76
+ command: 'invalid-command',
77
+ process: mockErroredProcess,
78
+ stdoutBuffer: [],
79
+ stderrBuffer: ['command not found'],
80
+ status: 'error',
81
+ startTime,
82
+ endTime,
83
+ lastReportedStdoutLength: 0,
84
+ lastReportedStderrLength: 0,
85
+ lastReportedStatus: null,
86
+ };
87
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
88
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
89
+ });
90
+ (0, bun_test_1.test)('returns empty string for completed process with no changes', () => {
91
+ const startTime = 1000;
92
+ const endTime = 2000;
93
+ const info = {
94
+ pid: 101,
95
+ toolCallId: 'toolCall101',
96
+ command: 'echo test',
97
+ process: mockChildProcess,
98
+ stdoutBuffer: ['test'],
99
+ stderrBuffer: [],
100
+ status: 'completed',
101
+ startTime,
102
+ endTime,
103
+ lastReportedStdoutLength: 4, // Length of 'test'
104
+ lastReportedStderrLength: 0,
105
+ lastReportedStatus: 'completed',
106
+ };
107
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
108
+ (0, bun_test_2.expect)(result).toBe('');
109
+ });
110
+ (0, bun_test_1.test)('handles new output since last report', () => {
111
+ const startTime = 1000;
112
+ const endTime = 2000;
113
+ const info = {
114
+ pid: 102,
115
+ toolCallId: 'toolCall102',
116
+ command: 'echo test',
117
+ process: mockChildProcess,
118
+ stdoutBuffer: ['test', ' more output'],
119
+ stderrBuffer: [],
120
+ status: 'completed',
121
+ startTime,
122
+ endTime,
123
+ lastReportedStdoutLength: 4, // Only 'test' was reported
124
+ lastReportedStderrLength: 0,
125
+ lastReportedStatus: 'completed',
126
+ };
127
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
128
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
129
+ });
130
+ (0, bun_test_1.test)('handles no new content', () => {
131
+ const startTime = 1000;
132
+ const endTime = 2000;
133
+ const info = {
134
+ pid: 103,
135
+ toolCallId: 'toolCall103',
136
+ command: 'echo test',
137
+ process: mockChildProcess,
138
+ stdoutBuffer: ['test'],
139
+ stderrBuffer: [],
140
+ status: 'running',
141
+ startTime,
142
+ endTime,
143
+ lastReportedStdoutLength: 4, // All content reported
144
+ lastReportedStderrLength: 0,
145
+ lastReportedStatus: 'running',
146
+ };
147
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
148
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
149
+ });
150
+ (0, bun_test_1.test)('handles new stderr without when no previous stderr', () => {
151
+ const startTime = 1000;
152
+ const endTime = 2000;
153
+ const info = {
154
+ pid: 104,
155
+ toolCallId: 'toolCall104',
156
+ command: 'echo test',
157
+ process: mockChildProcess,
158
+ stdoutBuffer: [],
159
+ stderrBuffer: ['new error'],
160
+ status: 'error',
161
+ startTime,
162
+ endTime,
163
+ lastReportedStdoutLength: 0,
164
+ lastReportedStderrLength: 0, // No previous stderr
165
+ lastReportedStatus: null,
166
+ };
167
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
168
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
169
+ });
170
+ (0, bun_test_1.test)('handles new stdout without when no previous stdout', () => {
171
+ const startTime = 1000;
172
+ const info = {
173
+ pid: 105,
174
+ toolCallId: 'toolCall105',
175
+ command: 'echo test',
176
+ process: mockChildProcess,
177
+ stdoutBuffer: ['first output'],
178
+ stderrBuffer: [],
179
+ status: 'running',
180
+ startTime,
181
+ endTime: null,
182
+ lastReportedStdoutLength: 0, // No previous stdout
183
+ lastReportedStderrLength: 0,
184
+ lastReportedStatus: null,
185
+ };
186
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
187
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
188
+ });
189
+ (0, bun_test_1.test)('reports completed process with new stderr even if stdout unchanged', () => {
190
+ const startTime = 1000;
191
+ const endTime = 2000;
192
+ const info = {
193
+ pid: 106,
194
+ toolCallId: 'toolCall106',
195
+ command: 'echo test',
196
+ process: mockChildProcess,
197
+ stdoutBuffer: ['test'],
198
+ stderrBuffer: ['new error'],
199
+ status: 'completed',
200
+ startTime,
201
+ endTime,
202
+ lastReportedStdoutLength: 4, // All stdout reported
203
+ lastReportedStderrLength: 0, // No stderr reported
204
+ lastReportedStatus: 'completed',
205
+ };
206
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
207
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
208
+ });
209
+ (0, bun_test_1.test)('reports completed process with new stdout even if stderr unchanged', () => {
210
+ const startTime = 1000;
211
+ const endTime = 2000;
212
+ const info = {
213
+ pid: 107,
214
+ toolCallId: 'toolCall107',
215
+ command: 'echo test',
216
+ process: mockChildProcess,
217
+ stdoutBuffer: ['test', ' more'],
218
+ stderrBuffer: ['error'],
219
+ status: 'completed',
220
+ startTime,
221
+ endTime,
222
+ lastReportedStdoutLength: 4, // Only 'test' reported
223
+ lastReportedStderrLength: 5, // All stderr reported
224
+ lastReportedStatus: 'completed',
225
+ };
226
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
227
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
228
+ });
229
+ (0, bun_test_1.test)('reports process when status changes even without output changes', () => {
230
+ const startTime = 1000;
231
+ const endTime = 2000;
232
+ const info = {
233
+ pid: 108,
234
+ toolCallId: 'toolCall108',
235
+ command: 'echo test',
236
+ process: mockChildProcess,
237
+ stdoutBuffer: ['test'],
238
+ stderrBuffer: [],
239
+ status: 'completed',
240
+ startTime,
241
+ endTime,
242
+ lastReportedStdoutLength: 4, // All output reported
243
+ lastReportedStderrLength: 0,
244
+ lastReportedStatus: 'running', // Status changed from running to completed
245
+ };
246
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
247
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
248
+ });
249
+ (0, bun_test_1.test)('calculates duration from endTime when available', () => {
250
+ const startTime = 1000;
251
+ const endTime = 2500;
252
+ const info = {
253
+ pid: 109,
254
+ toolCallId: 'toolCall109',
255
+ command: 'echo test',
256
+ process: mockChildProcess,
257
+ stdoutBuffer: ['test'],
258
+ stderrBuffer: [],
259
+ status: 'completed',
260
+ startTime,
261
+ endTime,
262
+ lastReportedStdoutLength: 0,
263
+ lastReportedStderrLength: 0,
264
+ lastReportedStatus: null,
265
+ };
266
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
267
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
268
+ });
269
+ (0, bun_test_1.test)('calculates duration from current time when no endTime', () => {
270
+ const startTime = 1000;
271
+ const info = {
272
+ pid: 110,
273
+ toolCallId: 'toolCall110',
274
+ command: 'echo test',
275
+ process: mockChildProcess,
276
+ stdoutBuffer: ['test'],
277
+ stderrBuffer: [],
278
+ status: 'running',
279
+ startTime,
280
+ endTime: null,
281
+ lastReportedStdoutLength: 0,
282
+ lastReportedStderrLength: 0,
283
+ lastReportedStatus: null,
284
+ };
285
+ const result = (0, background_process_manager_1.getBackgroundProcessInfoString)(info);
286
+ (0, bun_test_2.expect)(result).toMatchSnapshot();
287
+ });
288
+ });
289
+ //# sourceMappingURL=background-process-manager.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-process-manager.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/background-process-manager.test.ts"],"names":[],"mappings":";;AAAA,8CAA8C;AAC9C,uCAA+B;AAC/B,8CAA8C;AAC9C,uCAA+E;AAE/E,iFAGyC;AAEzC,yBAAyB;AACzB,MAAM,gBAAgB,GAAG;IACvB,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;CACV,CAAA;AAER,IAAA,mBAAQ,EAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,IAAI,UAAoC,CAAA;IACxC,MAAM,WAAW,GAAG,IAAI,CAAA;IAExB,IAAA,qBAAU,EAAC,GAAG,EAAE;QACd,IAAA,gBAAK,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IAEF,IAAA,oBAAS,EAAC,GAAG,EAAE;QACb,eAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,IAAA,eAAI,EAAC,qCAAqC,EAAE,GAAG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nD,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,IAAA,eAAI,EAAC,uDAAuD,EAAE,GAAG,EAAE;QACjE,MAAM,SAAS,GAAG,IAAI,CAAA;QAEtB,MAAM,IAAI,GAA0B;YAClC,GAAG,EAAE,GAAG;YACR,UAAU,EAAE,aAAa;YACzB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,gBAAgB;YACzB,YAAY,EAAE,CAAC,MAAM,CAAC;YACtB,YAAY,EAAE,EAAE;YAChB,MAAM,EAAE,SAAS;YACjB,SAAS;YACT,OAAO,EAAE,IAAI;YACb,wBAAwB,EAAE,CAAC;YAC3B,wBAAwB,EAAE,CAAC;YAC3B,kBAAkB,EAAE,IAAI;SACzB,CAAA;QAED,MAAM,MAAM,GAAG,IAAA,2DAA8B,EAAC,IAAI,CAAC,CAAA;QAEnD,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { AnalyticsEvent } from '../common/constants/analytics-events';
2
+ export declare let identified: boolean;
3
+ export declare function initAnalytics(): void;
4
+ export declare function flushAnalytics(): Promise<void>;
5
+ export declare function trackEvent(event: AnalyticsEvent, properties?: Record<string, any>): void;
6
+ export declare function identifyUser(userId: string, properties?: Record<string, any>): void;
@@ -0,0 +1 @@
1
+ export declare function detectShell(): 'bash' | 'zsh' | 'fish' | 'cmd.exe' | 'powershell' | 'unknown' | string;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.detectShell = detectShell;
4
+ const os_1 = require("os");
5
+ const child_process_1 = require("child_process");
6
+ function detectShell() {
7
+ // Get the parent process environment
8
+ const shell = process.env.SHELL || process.env.COMSPEC || process.env.PSModulePath;
9
+ try {
10
+ // Handle Windows detection
11
+ if ((0, os_1.platform)() === 'win32') {
12
+ try {
13
+ // Check if running in PowerShell
14
+ (0, child_process_1.execSync)('$PSVersionTable', { stdio: 'pipe' });
15
+ return 'powershell';
16
+ }
17
+ catch {
18
+ // Check explicit CMD environment
19
+ if (process.env.COMSPEC?.toLowerCase().includes('cmd.exe')) {
20
+ return 'cmd.exe';
21
+ }
22
+ // Check parent process as final Windows check
23
+ const parentProcess = (0, child_process_1.execSync)('wmic process get ParentProcessId,CommandLine', { stdio: 'pipe' })
24
+ .toString()
25
+ .toLowerCase();
26
+ if (parentProcess.includes('powershell'))
27
+ return 'powershell';
28
+ if (parentProcess.includes('cmd.exe'))
29
+ return 'cmd.exe';
30
+ }
31
+ }
32
+ // Handle Unix-like systems
33
+ if (shell) {
34
+ const shellLower = shell.toLowerCase();
35
+ if (shellLower.includes('bash'))
36
+ return 'bash';
37
+ if (shellLower.includes('zsh'))
38
+ return 'zsh';
39
+ if (shellLower.includes('fish'))
40
+ return 'fish';
41
+ }
42
+ // Try to get the parent process name on Unix systems
43
+ if ((0, os_1.platform)() !== 'win32') {
44
+ const ppid = process.ppid;
45
+ const parentProcess = (0, child_process_1.execSync)(`ps -p ${ppid} -o comm=`, {
46
+ stdio: 'pipe',
47
+ })
48
+ .toString()
49
+ .trim();
50
+ if (parentProcess)
51
+ return parentProcess;
52
+ }
53
+ }
54
+ catch (error) {
55
+ // Log error if needed
56
+ // console.error('Error detecting shell:', error);
57
+ }
58
+ return 'unknown';
59
+ }
60
+ //# sourceMappingURL=detect-shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-shell.js","sourceRoot":"","sources":["../../src/utils/detect-shell.ts"],"names":[],"mappings":";;AAGA,kCA6DC;AAhED,2BAA6B;AAC7B,iDAAwC;AAExC,SAAgB,WAAW;IAQzB,qCAAqC;IACrC,MAAM,KAAK,GACT,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,OAAO,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,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;YACzB,MAAM,aAAa,GAAG,IAAA,wBAAQ,EAAC,SAAS,IAAI,WAAW,EAAE;gBACvD,KAAK,EAAE,MAAM;aACd,CAAC;iBACC,QAAQ,EAAE;iBACV,IAAI,EAAE,CAAA;YACT,IAAI,aAAa;gBAAE,OAAO,aAAa,CAAA;QACzC,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,sBAAsB;QACtB,kDAAkD;IACpD,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import pino from 'pino';
2
+ export interface LoggerContext {
3
+ userId?: string;
4
+ userEmail?: string;
5
+ clientSessionId?: string;
6
+ fingerprintId?: string;
7
+ clientRequestId?: string;
8
+ [key: string]: any;
9
+ }
10
+ export declare const loggerContext: LoggerContext;
11
+ declare const loggingLevels: readonly ["info", "debug", "warn", "error", "fatal"];
12
+ type LogLevel = (typeof loggingLevels)[number];
13
+ /**
14
+ * Wrapper around Pino logger.
15
+ *
16
+ * To also send to Posthog, set data.eventId to type AnalyticsEvent
17
+ *
18
+ * e.g. logger.info({eventId: AnalyticsEvent.SOME_EVENT, field: value}, 'some message')
19
+ */
20
+ export declare const logger: Record<LogLevel, pino.LogFn>;
21
+ export {};
@@ -0,0 +1,11 @@
1
+ export declare class Spinner {
2
+ private static instance;
3
+ private loadingInterval;
4
+ private constructor();
5
+ static get(): Spinner;
6
+ start(): void;
7
+ stop(): void;
8
+ restoreCursor(): void;
9
+ log(message: string): void;
10
+ private rewriteLine;
11
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Spinner = void 0;
27
+ const picocolors_1 = require("picocolors");
28
+ const readline = __importStar(require("readline"));
29
+ const chars = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
30
+ class Spinner {
31
+ static instance = null;
32
+ loadingInterval = null;
33
+ constructor() { }
34
+ static get() {
35
+ if (!Spinner.instance) {
36
+ Spinner.instance = new Spinner();
37
+ }
38
+ return Spinner.instance;
39
+ }
40
+ start() {
41
+ if (this.loadingInterval) {
42
+ return;
43
+ }
44
+ let i = 0;
45
+ // Hide cursor while spinner is active
46
+ process.stdout.write('\u001B[?25l');
47
+ this.loadingInterval = setInterval(() => {
48
+ this.rewriteLine((0, picocolors_1.green)(`${chars[i]} Thinking...`));
49
+ i = (i + 1) % chars.length;
50
+ }, 100);
51
+ }
52
+ stop() {
53
+ if (!this.loadingInterval) {
54
+ return;
55
+ }
56
+ clearInterval(this.loadingInterval);
57
+ this.loadingInterval = null;
58
+ this.rewriteLine(''); // Clear the spinner line
59
+ this.restoreCursor(); // Show cursor after spinner stops
60
+ }
61
+ restoreCursor() {
62
+ process.stdout.write('\u001B[?25h');
63
+ }
64
+ log(message) {
65
+ // Temporarily clear the spinner line
66
+ this.rewriteLine('');
67
+ // Write the log message
68
+ console.log(message);
69
+ // If spinner is active, redraw it on the next line
70
+ if (this.loadingInterval) {
71
+ const i = Math.floor(Math.random() * chars.length);
72
+ this.rewriteLine((0, picocolors_1.green)(`${chars[i]} Thinking...`));
73
+ }
74
+ }
75
+ rewriteLine(line) {
76
+ if (process.stdout.isTTY) {
77
+ readline.clearLine(process.stdout, 0);
78
+ readline.cursorTo(process.stdout, 0);
79
+ process.stdout.write(line);
80
+ }
81
+ else {
82
+ process.stdout.write(line + '\n');
83
+ }
84
+ }
85
+ }
86
+ exports.Spinner = Spinner;
87
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/utils/spinner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAkC;AAClC,mDAAoC;AAEpC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAEhE,MAAa,OAAO;IACV,MAAM,CAAC,QAAQ,GAAmB,IAAI,CAAA;IACtC,eAAe,GAA0B,IAAI,CAAA;IAErD,gBAAuB,CAAC;IAEjB,MAAM,CAAC,GAAG;QACf,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAA;QAClC,CAAC;QACD,OAAO,OAAO,CAAC,QAAQ,CAAA;IACzB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,sCAAsC;QACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QACnC,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,GAAG,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,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;YACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;;AA9DH,0BA+DC"}
@@ -0,0 +1,8 @@
1
+ export declare const getSystemInfo: () => {
2
+ platform: NodeJS.Platform;
3
+ shell: string;
4
+ nodeVersion: string;
5
+ arch: NodeJS.Architecture;
6
+ homedir: string;
7
+ cpus: number;
8
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getSystemInfo = void 0;
7
+ const process_1 = require("process");
8
+ const path_1 = __importDefault(require("path"));
9
+ const os_1 = __importDefault(require("os"));
10
+ const getSystemInfo = () => {
11
+ const shell = process.env.SHELL || process.env.COMSPEC || 'unknown';
12
+ return {
13
+ platform: process_1.platform,
14
+ shell: path_1.default.basename(shell),
15
+ nodeVersion: process.version,
16
+ arch: process.arch,
17
+ homedir: os_1.default.homedir(),
18
+ cpus: os_1.default.cpus().length,
19
+ };
20
+ };
21
+ exports.getSystemInfo = getSystemInfo;
22
+ //# sourceMappingURL=system-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-info.js","sourceRoot":"","sources":["../../src/utils/system-info.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAkC;AAClC,gDAAuB;AACvB,4CAAmB;AAEZ,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,SAAS,CAAA;IAEnE,OAAO;QACL,QAAQ,EAAR,kBAAQ;QACR,KAAK,EAAE,cAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,OAAO,CAAC,OAAO;QAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,YAAE,CAAC,OAAO,EAAE;QACrB,IAAI,EAAE,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM;KACvB,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,aAAa,iBAWzB"}
@@ -0,0 +1,41 @@
1
+ import { ChildProcessWithoutNullStreams } from 'child_process';
2
+ import type { IPty } from '@homebridge/node-pty-prebuilt-multiarch';
3
+ type PersistentProcess = {
4
+ type: 'pty';
5
+ shell: 'pty';
6
+ pty: IPty;
7
+ timerId: NodeJS.Timeout | null;
8
+ } | {
9
+ type: 'process';
10
+ shell: 'bash' | 'cmd.exe' | 'powershell.exe';
11
+ childProcess: ChildProcessWithoutNullStreams | null;
12
+ timerId: NodeJS.Timeout | null;
13
+ };
14
+ declare const createPersistantProcess: (dir: string) => PersistentProcess;
15
+ export declare let persistentProcess: ReturnType<typeof createPersistantProcess> | null;
16
+ export declare const isCommandRunning: () => boolean;
17
+ export declare const recreateShell: (projectPath: string) => void;
18
+ export declare const resetShell: (projectPath: string) => void;
19
+ export declare function runBackgroundCommand(options: {
20
+ toolCallId: string;
21
+ command: string;
22
+ mode: 'user' | 'assistant';
23
+ projectPath: string;
24
+ stdoutFile?: string;
25
+ stderrFile?: string;
26
+ }, resolveCommand: (value: {
27
+ result: string;
28
+ stdout: string;
29
+ }) => void): void;
30
+ export declare const runTerminalCommand: (toolCallId: string, command: string, mode: "user" | "assistant", projectPath: string, processType: "SYNC" | "BACKGROUND", stdoutFile?: string, stderrFile?: string) => Promise<{
31
+ result: string;
32
+ stdout: string;
33
+ }>;
34
+ export declare const runCommandPty: (persistentProcess: PersistentProcess & {
35
+ type: "pty";
36
+ }, command: string, mode: "user" | "assistant", resolve: (value: {
37
+ result: string;
38
+ stdout: string;
39
+ }) => void, projectPath: string) => void;
40
+ export declare function killAndResetPersistentProcess(): void;
41
+ export {};
@@ -0,0 +1,16 @@
1
+ import { ToolName } from '../common/constants/tools';
2
+ /**
3
+ * Interface for handling tool call rendering
4
+ */
5
+ export interface ToolCallRenderer {
6
+ onToolStart?: (toolName: string, attributes: Record<string, string>) => string | null;
7
+ onParamStart?: (paramName: string, toolName: string) => string | null;
8
+ onParamChunk?: (content: string, paramName: string, toolName: string) => string | null;
9
+ onParamEnd?: (paramName: string, toolName: string, content: string) => string | null;
10
+ onToolEnd?: (toolName: string, params: Record<string, string>) => string | null;
11
+ }
12
+ /**
13
+ * Default renderer for tool calls that formats them nicely for the console
14
+ */
15
+ export declare const defaultToolCallRenderer: ToolCallRenderer;
16
+ export declare const toolRenderers: Record<ToolName, ToolCallRenderer>;
@@ -0,0 +1,9 @@
1
+ import { Saxy } from '../common/util/saxy';
2
+ import { ToolCallRenderer } from './tool-renderers';
3
+ /**
4
+ * Creates a transform stream that processes XML tool calls
5
+ * @param renderer Custom renderer for tool calls or a map of renderers per tool
6
+ * @param callback Optional callback function to receive processed chunks
7
+ * @returns Transform stream
8
+ */
9
+ export declare function createXMLStreamParser(renderer: Record<string, ToolCallRenderer>, callback?: (chunk: string) => void): Saxy;
@@ -0,0 +1,3 @@
1
+ export declare function scrapeWebPage(url: string): Promise<string>;
2
+ export declare function parseUrlsFromContent(content: string): string[];
3
+ export declare function getScrapedContentBlocks(urls: string[]): Promise<string[]>;
@@ -0,0 +1 @@
1
+ export {};