codebuff 1.0.248 → 1.0.250

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 (64) hide show
  1. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  2. package/dist/utils/terminal.js +0 -1
  3. package/dist/utils/terminal.js.map +1 -1
  4. package/package.json +1 -1
  5. package/dist/background-process-manager.d.ts +0 -50
  6. package/dist/browser-runner.d.ts +0 -35
  7. package/dist/chat-storage.d.ts +0 -2
  8. package/dist/checkpoints/checkpoint-manager.d.ts +0 -94
  9. package/dist/checkpoints/file-manager.d.ts +0 -72
  10. package/dist/checkpoints/file-manager.js +0 -311
  11. package/dist/checkpoints/file-manager.js.map +0 -1
  12. package/dist/cli-handlers/api-key.d.ts +0 -25
  13. package/dist/cli-handlers/checkpoint.d.ts +0 -18
  14. package/dist/cli-handlers/diff.d.ts +0 -2
  15. package/dist/cli-handlers/easter-egg.d.ts +0 -1
  16. package/dist/cli-handlers/easter-egg.js +0 -126
  17. package/dist/cli-handlers/easter-egg.js.map +0 -1
  18. package/dist/cli-handlers/inititalization-flow.d.ts +0 -1
  19. package/dist/cli.d.ts +0 -44
  20. package/dist/client.d.ts +0 -157
  21. package/dist/config.d.ts +0 -4
  22. package/dist/config.js +0 -12
  23. package/dist/config.js.map +0 -1
  24. package/dist/create-template-project.d.ts +0 -1
  25. package/dist/create-template-project.js +0 -107
  26. package/dist/create-template-project.js.map +0 -1
  27. package/dist/credentials.d.ts +0 -4
  28. package/dist/dev-process-manager.d.ts +0 -10
  29. package/dist/fingerprint.d.ts +0 -1
  30. package/dist/fingerprint.js +0 -48
  31. package/dist/fingerprint.js.map +0 -1
  32. package/dist/index.d.ts +0 -2
  33. package/dist/menu.d.ts +0 -3
  34. package/dist/project-files.d.ts +0 -114
  35. package/dist/startup-process-handler.d.ts +0 -2
  36. package/dist/tool-handlers.d.ts +0 -28
  37. package/dist/types.d.ts +0 -15
  38. package/dist/update-codebuff.d.ts +0 -1
  39. package/dist/update-codebuff.js +0 -160
  40. package/dist/update-codebuff.js.map +0 -1
  41. package/dist/utils/__tests__/background-process-manager.test.d.ts +0 -1
  42. package/dist/utils/__tests__/background-process-manager.test.js +0 -289
  43. package/dist/utils/__tests__/background-process-manager.test.js.map +0 -1
  44. package/dist/utils/__tests__/tool-renderers.test.d.ts +0 -1
  45. package/dist/utils/__tests__/xml-stream-parser.test.d.ts +0 -1
  46. package/dist/utils/analytics.d.ts +0 -6
  47. package/dist/utils/detect-shell.d.ts +0 -1
  48. package/dist/utils/detect-shell.js +0 -60
  49. package/dist/utils/detect-shell.js.map +0 -1
  50. package/dist/utils/logger.d.ts +0 -21
  51. package/dist/utils/spinner.d.ts +0 -11
  52. package/dist/utils/spinner.js +0 -87
  53. package/dist/utils/spinner.js.map +0 -1
  54. package/dist/utils/system-info.d.ts +0 -8
  55. package/dist/utils/system-info.js +0 -22
  56. package/dist/utils/system-info.js.map +0 -1
  57. package/dist/utils/terminal.d.ts +0 -41
  58. package/dist/utils/tool-renderers.d.ts +0 -16
  59. package/dist/utils/xml-stream-parser.d.ts +0 -9
  60. package/dist/web-scraper.d.ts +0 -3
  61. package/dist/workers/checkpoint-worker.d.ts +0 -1
  62. package/dist/workers/checkpoint-worker.js +0 -48
  63. package/dist/workers/checkpoint-worker.js.map +0 -1
  64. package/dist/workers/project-context.d.ts +0 -1
@@ -1,311 +0,0 @@
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.fs = void 0;
7
- exports.getBareRepoPath = getBareRepoPath;
8
- exports.hasUnsavedChanges = hasUnsavedChanges;
9
- exports.getLatestCommit = getLatestCommit;
10
- exports.initializeCheckpointFileManager = initializeCheckpointFileManager;
11
- exports.storeFileState = storeFileState;
12
- exports.restoreFileState = restoreFileState;
13
- const child_process_1 = require("child_process");
14
- const crypto_1 = require("crypto");
15
- const fs_1 = __importDefault(require("fs"));
16
- exports.fs = fs_1.default;
17
- const os_1 = __importDefault(require("os"));
18
- const path_1 = require("path");
19
- const isomorphic_git_1 = require("isomorphic-git");
20
- const project_files_1 = require("../project-files");
21
- /**
22
- * Checks if the native git command is available on the system.
23
- * Caches the result to avoid repeated checks.
24
- * @returns boolean indicating if git command is available
25
- */
26
- let cachedGitAvailable = null;
27
- function gitCommandIsAvailable() {
28
- if (cachedGitAvailable === null) {
29
- try {
30
- (0, child_process_1.execFileSync)('git', ['--version'], { stdio: 'ignore' });
31
- cachedGitAvailable = true;
32
- }
33
- catch (error) {
34
- cachedGitAvailable = false;
35
- }
36
- }
37
- return cachedGitAvailable;
38
- }
39
- /**
40
- * Generates a unique path for storing the bare git repository based on the project directory.
41
- * Uses SHA-256 hashing to create a unique identifier.
42
- * @param dir - The project directory path to hash
43
- * @returns The full path where the bare repo should be stored
44
- */
45
- function getBareRepoPath(dir) {
46
- const bareRepoName = (0, crypto_1.createHash)('sha256').update(dir).digest('hex');
47
- return (0, path_1.join)((0, project_files_1.getProjectDataDir)(), bareRepoName);
48
- }
49
- /**
50
- * Checks if there are any uncommitted changes in the working directory.
51
- * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
52
- * @param projectDir - The working tree directory path
53
- * @param bareRepoPath - The bare git repository path
54
- * @param relativeFilepaths - Array of file paths relative to projectDir to check
55
- * @returns Promise resolving to true if there are uncommitted changes, false otherwise
56
- */
57
- async function hasUnsavedChanges({ projectDir, bareRepoPath, relativeFilepaths, }) {
58
- if (gitCommandIsAvailable()) {
59
- try {
60
- const output = (0, child_process_1.execFileSync)('git', [
61
- '--git-dir',
62
- bareRepoPath,
63
- '--work-tree',
64
- projectDir,
65
- 'status',
66
- '--porcelain',
67
- ], { stdio: ['ignore', 'pipe', 'ignore'] }).toString();
68
- return output.trim().length > 0;
69
- }
70
- catch (error) {
71
- // error running git
72
- }
73
- }
74
- for (const [, , workdirStatus, stageStatus] of await (0, isomorphic_git_1.statusMatrix)({
75
- fs: fs_1.default,
76
- dir: projectDir,
77
- gitdir: bareRepoPath,
78
- filepaths: relativeFilepaths,
79
- })) {
80
- if (workdirStatus !== stageStatus) {
81
- return true;
82
- }
83
- }
84
- return false;
85
- }
86
- /**
87
- * Gets the hash of the latest commit in the repository.
88
- * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
89
- * @param bareRepoPath - The bare git repository path
90
- * @returns Promise resolving to the commit hash
91
- */
92
- async function getLatestCommit({ bareRepoPath, }) {
93
- if (gitCommandIsAvailable()) {
94
- try {
95
- return (0, child_process_1.execFileSync)('git', ['--git-dir', bareRepoPath, 'rev-parse', 'HEAD'], { stdio: ['ignore', 'pipe', 'ignore'] })
96
- .toString()
97
- .trim();
98
- }
99
- catch (error) {
100
- // unable to get head
101
- }
102
- }
103
- return await (0, isomorphic_git_1.resolveRef)({
104
- fs: fs_1.default,
105
- gitdir: bareRepoPath,
106
- ref: 'HEAD',
107
- });
108
- }
109
- /**
110
- * Initializes a bare git repository for tracking file changes.
111
- * Creates the repository if it doesn't exist, otherwise uses the existing one.
112
- * Makes an initial commit of the current file state.
113
- * @param projectDir - The working tree directory path
114
- * @param relativeFilepaths - Array of file paths relative to projectDir to track
115
- */
116
- async function initializeCheckpointFileManager({ projectDir, relativeFilepaths, }) {
117
- if (projectDir === os_1.default.homedir()) {
118
- return;
119
- }
120
- const bareRepoPath = getBareRepoPath(projectDir);
121
- // Create the bare repo directory if it doesn't exist
122
- fs_1.default.mkdirSync(bareRepoPath, { recursive: true });
123
- try {
124
- // Check if it's already a valid Git repo
125
- await (0, isomorphic_git_1.resolveRef)({ fs: fs_1.default, gitdir: bareRepoPath, ref: 'HEAD' });
126
- }
127
- catch (error) {
128
- // Bare repo doesn't exist yet
129
- await (0, isomorphic_git_1.init)({
130
- fs: fs_1.default,
131
- dir: projectDir,
132
- gitdir: bareRepoPath,
133
- bare: true,
134
- defaultBranch: 'master',
135
- });
136
- }
137
- // Commit the files in the bare repo
138
- await storeFileState({
139
- projectDir,
140
- bareRepoPath,
141
- message: 'Initial Commit',
142
- relativeFilepaths,
143
- });
144
- }
145
- /**
146
- * Stages all changes in the working directory.
147
- * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
148
- * @param projectDir - The working tree directory path
149
- * @param bareRepoPath - The bare git repository path
150
- * @param relativeFilepaths - Array of file paths relative to projectDir to stage
151
- */
152
- async function gitAddAll({ projectDir, bareRepoPath, relativeFilepaths, }) {
153
- if (gitCommandIsAvailable()) {
154
- try {
155
- (0, child_process_1.execFileSync)('git', [
156
- '--git-dir',
157
- bareRepoPath,
158
- '--work-tree',
159
- projectDir,
160
- '-C',
161
- projectDir,
162
- 'add',
163
- '.',
164
- ], { stdio: 'ignore' });
165
- return;
166
- }
167
- catch (error) {
168
- // Failed to `git add .`
169
- }
170
- }
171
- // Stage files with isomorphic-git
172
- // Get status of all files in the project directory
173
- const currStatusMatrix = (await (0, isomorphic_git_1.statusMatrix)({
174
- fs: fs_1.default,
175
- dir: projectDir,
176
- gitdir: bareRepoPath,
177
- filepaths: relativeFilepaths,
178
- })) ?? [];
179
- for (const [filepath, , workdirStatus, stageStatus] of currStatusMatrix) {
180
- if (workdirStatus === stageStatus) {
181
- continue;
182
- }
183
- if (workdirStatus === 2) {
184
- // Existing file different from HEAD
185
- try {
186
- await (0, isomorphic_git_1.add)({ fs: fs_1.default, dir: projectDir, gitdir: bareRepoPath, filepath });
187
- }
188
- catch (error) {
189
- // error adding files
190
- }
191
- }
192
- else if (workdirStatus === 0) {
193
- // Deleted file
194
- try {
195
- await (0, isomorphic_git_1.remove)({ fs: fs_1.default, dir: projectDir, gitdir: bareRepoPath, filepath });
196
- }
197
- catch (error) {
198
- // error removing file
199
- }
200
- }
201
- }
202
- }
203
- async function gitCommit({ projectDir, bareRepoPath, message, }) {
204
- if (gitCommandIsAvailable()) {
205
- try {
206
- (0, child_process_1.execFileSync)('git', [
207
- '--git-dir',
208
- bareRepoPath,
209
- '--work-tree',
210
- projectDir,
211
- 'commit',
212
- '-m',
213
- message,
214
- ], { stdio: 'ignore' });
215
- return await getLatestCommit({ bareRepoPath });
216
- }
217
- catch (error) {
218
- // Failed to commit, continue to isomorphic-git implementation
219
- }
220
- }
221
- const commitHash = await (0, isomorphic_git_1.commit)({
222
- fs: fs_1.default,
223
- dir: projectDir,
224
- gitdir: bareRepoPath,
225
- author: { name: 'Codebuff' },
226
- message,
227
- ref: '/refs/heads/master',
228
- });
229
- if (gitCommandIsAvailable()) {
230
- try {
231
- (0, child_process_1.execFileSync)('git', [
232
- '--git-dir',
233
- bareRepoPath,
234
- '--work-tree',
235
- projectDir,
236
- 'checkout',
237
- 'master',
238
- ], { stdio: 'ignore' });
239
- return commitHash;
240
- }
241
- catch (error) {
242
- // Unable to checkout with git
243
- }
244
- }
245
- await (0, isomorphic_git_1.checkout)({ fs: fs_1.default, dir: projectDir, gitdir: bareRepoPath, ref: 'master' });
246
- return commitHash;
247
- }
248
- /**
249
- * Creates a new commit with the current state of all tracked files.
250
- * Stages all changes and creates a commit with the specified message.
251
- * @param projectDir - The working tree directory path
252
- * @param bareRepoPath - The bare git repository path
253
- * @param message - The commit message
254
- * @param relativeFilepaths - Array of file paths relative to projectDir to commit
255
- * @returns Promise resolving to the new commit's hash
256
- */
257
- async function storeFileState({ projectDir, bareRepoPath, message, relativeFilepaths: relativeFilepaths, }) {
258
- await gitAddAll({
259
- projectDir,
260
- bareRepoPath,
261
- relativeFilepaths,
262
- });
263
- return await gitCommit({ projectDir, bareRepoPath, message });
264
- }
265
- /**
266
- * Restores the working directory and index to match the specified commit.
267
- * Equivalent to `git reset --hard`
268
- * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
269
- * @param projectDir - The working tree directory path
270
- * @param bareRepoPath - The bare git repository path
271
- * @param commit - The commit hash to restore to
272
- * @param relativeFilepaths - Array of file paths relative to projectDir to restore
273
- */
274
- async function restoreFileState({ projectDir, bareRepoPath, commit, relativeFilepaths, }) {
275
- let resetDone = false;
276
- if (gitCommandIsAvailable()) {
277
- try {
278
- (0, child_process_1.execFileSync)('git', [
279
- '--git-dir',
280
- bareRepoPath,
281
- '--work-tree',
282
- projectDir,
283
- 'reset',
284
- '--hard',
285
- commit,
286
- ]);
287
- return;
288
- }
289
- catch (error) {
290
- // Failed to use git, continue to isomorphic-git implementation
291
- }
292
- }
293
- // Update the working directory to reflect the specified commit
294
- await (0, isomorphic_git_1.checkout)({
295
- fs: fs_1.default,
296
- dir: projectDir,
297
- gitdir: bareRepoPath,
298
- ref: commit,
299
- filepaths: relativeFilepaths,
300
- force: true,
301
- });
302
- // Reset the index to match the specified commit
303
- await Promise.all(relativeFilepaths.map((filepath) => (0, isomorphic_git_1.resetIndex)({
304
- fs: fs_1.default,
305
- dir: projectDir,
306
- gitdir: bareRepoPath,
307
- filepath,
308
- ref: commit,
309
- })));
310
- }
311
- //# sourceMappingURL=file-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-manager.js","sourceRoot":"","sources":["../../src/checkpoints/file-manager.ts"],"names":[],"mappings":";;;;;;AA4CA,0CAGC;AAUD,8CAwCC;AAQD,0CAuBC;AASD,0EAoCC;AAmJD,wCAkBC;AAWD,4CAmDC;AAhZD,iDAA4C;AAC5C,mCAAmC;AACnC,4CAAmB;AAiZV,aAjZF,YAAE,CAiZE;AAhZX,4CAAmB;AACnB,+BAA2B;AAE3B,mDASuB;AAEvB,oDAAoD;AAEpD;;;;GAIG;AACH,IAAI,kBAAkB,GAAmB,IAAI,CAAA;AAC7C,SAAS,qBAAqB;IAC5B,IAAI,kBAAkB,KAAK,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,IAAA,4BAAY,EAAC,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;YACvD,kBAAkB,GAAG,IAAI,CAAA;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,kBAAkB,GAAG,KAAK,CAAA;QAC5B,CAA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E,CACjC,IAAA,2BAAU,EAAC;QACT,EAAE,EAAF,YAAE;QACF,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,YAAY;QACpB,QAAQ;QACR,GAAG,EAAE,MAAM;KACZ,CAAC,CACH,CACF,CAAA;AACH,CAAC"}
@@ -1,25 +0,0 @@
1
- import { Client } from '../client';
2
- import { ApiKeyType } from '../common/api-keys/constants';
3
- export type ApiKeyDetectionResult = {
4
- status: 'found';
5
- type: ApiKeyType;
6
- key: string;
7
- } | {
8
- status: 'prefix_only';
9
- type: ApiKeyType;
10
- prefix: string;
11
- length: number;
12
- } | {
13
- status: 'not_found';
14
- };
15
- /**
16
- * Detects if the user input contains a known API key pattern.
17
- * Returns information about the detected key or prefix.
18
- */
19
- export declare function detectApiKey(userInput: string): ApiKeyDetectionResult;
20
- /**
21
- * Handles the result of API key detection.
22
- */
23
- export declare function handleApiKeyInput(client: Client, detectionResult: Exclude<ApiKeyDetectionResult, {
24
- status: 'not_found';
25
- }>, readyPromise: Promise<any>, returnControlToUser: () => void): Promise<void>;
@@ -1,18 +0,0 @@
1
- import { Interface as ReadlineInterface } from 'readline';
2
- import type { Client } from '../client';
3
- export declare const checkpointCommands: {
4
- readonly save: readonly [readonly ["checkpoint"], "Save current state as a new checkpoint"];
5
- readonly list: readonly [readonly ["checkpoint list", "checkpoints"], "List all saved checkpoints"];
6
- readonly clear: readonly [readonly ["checkpoint clear"], "Clear all checkpoints"];
7
- readonly undo: readonly [readonly ["undo", "u"], "Undo to previous checkpoint"];
8
- readonly redo: readonly [readonly ["redo", "r"], "Redo previously undone checkpoint"];
9
- readonly restore: readonly [readonly [RegExp], "Restore to checkpoint number <n>"];
10
- };
11
- export declare function displayCheckpointMenu(): void;
12
- export declare function isCheckpointCommand(userInput: string, type?: keyof typeof checkpointCommands | null): boolean | RegExpMatchArray;
13
- export declare function listCheckpoints(): Promise<void>;
14
- export declare function handleUndo(client: Client, rl: ReadlineInterface): Promise<string>;
15
- export declare function handleRedo(client: Client, rl: ReadlineInterface): Promise<string>;
16
- export declare function handleRestoreCheckpoint(id: number, client: Client, rl: ReadlineInterface): Promise<string>;
17
- export declare function handleClearCheckpoints(): void;
18
- export declare function saveCheckpoint(userInput: string, client: Client, readyPromise: Promise<any>, saveWithNoChanges?: boolean): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { FileChange } from '../common/actions';
2
- export declare function handleDiff(lastChanges: FileChange[]): void;
@@ -1 +0,0 @@
1
- export declare function showEasterEgg(complete: () => void): Promise<void>;
@@ -1,126 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.showEasterEgg = showEasterEgg;
4
- const picocolors_1 = require("picocolors");
5
- // Utility: clear the terminal screen
6
- function clearScreen() {
7
- process.stdout.write('\u001b[2J\u001b[0;0H');
8
- }
9
- // Utility: Generate a set of points tracing a "C" shape using an arc.
10
- function generateCPath(cx, cy, r, steps) {
11
- const points = [];
12
- // A typical "C" opens to the right: from 45° to 315° (in radians)
13
- const startAngle = Math.PI / 4;
14
- const endAngle = (7 * Math.PI) / 4;
15
- const angleStep = (endAngle - startAngle) / steps;
16
- for (let i = 0; i <= steps; i++) {
17
- const angle = startAngle + i * angleStep;
18
- const x = Math.floor(cx + r * Math.cos(angle));
19
- const y = Math.floor(cy + r * Math.sin(angle));
20
- points.push({ x, y });
21
- }
22
- return points;
23
- }
24
- // Utility: Generate points along a quadratic Bézier curve.
25
- function quadraticBezier(P0, P1, P2, steps) {
26
- const points = [];
27
- for (let i = 0; i <= steps; i++) {
28
- const t = i / steps;
29
- const x = Math.round((1 - t) ** 2 * P0.x + 2 * (1 - t) * t * P1.x + t ** 2 * P2.x);
30
- const y = Math.round((1 - t) ** 2 * P0.y + 2 * (1 - t) * t * P1.y + t ** 2 * P2.y);
31
- points.push({ x, y });
32
- }
33
- return points;
34
- }
35
- // Generate a vertical line from startY to endY at a given x.
36
- function generateVerticalLine(x, startY, endY) {
37
- const points = [];
38
- const step = startY < endY ? 1 : -1;
39
- for (let y = startY; y !== endY; y += step) {
40
- points.push({ x, y });
41
- }
42
- points.push({ x, y: endY });
43
- return points;
44
- }
45
- // Generate a path approximating a B shape using two quadratic Bézier curves
46
- // for the rounded bubbles, and then closing the shape with a vertical spine.
47
- function generateBPath(bX, bYTop, bYBottom, bWidth, bGap, stepsPerCurve) {
48
- let points = [];
49
- const middle = Math.floor((bYTop + bYBottom) / 2);
50
- // Upper bubble: from top-left (spine) out then back to the spine at the middle.
51
- const upperStart = { x: bX, y: bYTop };
52
- const upperControl = {
53
- x: bX + bWidth + bGap - 10,
54
- y: Math.floor((bYTop + middle) / 2),
55
- };
56
- const upperEnd = { x: bX, y: middle };
57
- const upperCurve = quadraticBezier(upperStart, upperControl, upperEnd, stepsPerCurve);
58
- // Lower bubble: from the middle to the bottom.
59
- const lowerStart = { x: bX, y: middle };
60
- const lowerControl = {
61
- x: bX + bWidth + bGap,
62
- y: Math.floor((middle + bYBottom) / 2),
63
- };
64
- const lowerEnd = { x: bX, y: bYBottom };
65
- const lowerCurve = quadraticBezier(lowerStart, lowerControl, lowerEnd, stepsPerCurve);
66
- // Combine the curves.
67
- points = points.concat(upperCurve, lowerCurve);
68
- // Add a vertical line from the bottom of the B back up to the top.
69
- const closingLine = generateVerticalLine(bX, bYBottom, bYTop);
70
- points = points.concat(closingLine);
71
- return points;
72
- }
73
- // Array of picocolors functions for random colors.
74
- const colors = [picocolors_1.red, picocolors_1.green, picocolors_1.yellow, picocolors_1.blue, picocolors_1.magenta, picocolors_1.cyan];
75
- function getRandomColor() {
76
- return colors[Math.floor(Math.random() * colors.length)];
77
- }
78
- async function showEasterEgg(complete) {
79
- const text = 'codebuffy';
80
- const termWidth = process.stdout.columns;
81
- const termHeight = process.stdout.rows;
82
- const baselineWidth = 80;
83
- const baselineHeight = 24;
84
- const scaleFactor = Math.min(termWidth / baselineWidth, termHeight / baselineHeight);
85
- // Dynamically scale parameters for the shapes.
86
- // Use Math.max to ensure values don't get too small.
87
- const cCenterX = Math.floor(termWidth * 0.3);
88
- const cCenterY = Math.floor(termHeight / 2);
89
- const cRadius = Math.max(2, Math.floor(8 * scaleFactor));
90
- const cSteps = Math.max(10, Math.floor(30 * scaleFactor));
91
- const bX = Math.floor(termWidth * 0.55);
92
- const bYTop = Math.floor(termHeight / 2 - 7 * scaleFactor);
93
- const bYBottom = Math.floor(termHeight / 2 + 7 * scaleFactor);
94
- const bWidth = Math.max(2, Math.floor(8 * scaleFactor));
95
- const bGap = Math.max(1, Math.floor(35 * scaleFactor));
96
- const bStepsPerCurve = Math.max(10, Math.floor(20 * scaleFactor));
97
- // Generate the paths.
98
- const fullPath = [
99
- ...generateCPath(cCenterX, cCenterY, cRadius, cSteps),
100
- ...generateBPath(bX, bYTop, bYBottom, bWidth, bGap, bStepsPerCurve),
101
- ];
102
- // Animation state: index into the fullPath.
103
- let index = 0;
104
- let completedCycle = false;
105
- // Main animation function
106
- function animate() {
107
- if (index >= fullPath.length) {
108
- completedCycle = true;
109
- return;
110
- }
111
- const { x, y } = fullPath[index];
112
- const cursorPosition = `\u001b[${y + 1};${x + 1}H`;
113
- process.stdout.write(cursorPosition + getRandomColor()(text));
114
- index++;
115
- }
116
- clearScreen();
117
- const interval = setInterval(() => {
118
- animate();
119
- if (completedCycle) {
120
- clearInterval(interval);
121
- clearScreen();
122
- complete();
123
- }
124
- }, 100);
125
- }
126
- //# sourceMappingURL=easter-egg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"easter-egg.js","sourceRoot":"","sources":["../../src/cli-handlers/easter-egg.ts"],"names":[],"mappings":";;AAgHA,sCA2DC;AA3KD,2CAAoE;AAEpE,qCAAqC;AACrC,SAAS,WAAW;IAClB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC9C,CAAC;AAED,sEAAsE;AACtE,SAAS,aAAa,CAAC,EAAU,EAAE,EAAU,EAAE,CAAS,EAAE,KAAa;IACrE,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,k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;QACT,IAAI,cAAc,EAAE,CAAC;YACnB,aAAa,CAAC,QAAQ,CAAC,CAAA;YACvB,WAAW,EAAE,CAAA;YACb,QAAQ,EAAE,CAAA;QACZ,CAAC;IACH,CAAC,EAAE,GAAG,CAAC,CAAA;AACT,CAAC"}
@@ -1 +0,0 @@
1
- export declare function handleInitializationFlowLocally(): void;
package/dist/cli.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import { ProjectFileContext } from './common/util/file';
2
- import { CliOptions } from './types';
3
- export declare class CLI {
4
- private client;
5
- private readyPromise;
6
- private git;
7
- private costMode;
8
- private rl;
9
- private isReceivingResponse;
10
- private stopResponse;
11
- private lastSigintTime;
12
- private lastInputTime;
13
- private consecutiveFastInputs;
14
- private pastedContent;
15
- private isPasting;
16
- private shouldReconnectWhenIdle;
17
- constructor(readyPromise: Promise<[ProjectFileContext, void, void]>, { git, costMode, model }: CliOptions);
18
- private setupSignalHandlers;
19
- private initReadlineInterface;
20
- private filePathCompleter;
21
- private setPrompt;
22
- /**
23
- * Prompts the user with a clean prompt state
24
- */
25
- private freshPrompt;
26
- printInitialPrompt({ initialInput, runInitFlow, }: {
27
- initialInput?: string;
28
- runInitFlow?: boolean;
29
- }): Promise<void>;
30
- printDiff(): Promise<void>;
31
- private handleLine;
32
- private handleUserInput;
33
- private processCommand;
34
- private forwardUserInput;
35
- private reconnectWhenNextIdle;
36
- private onWebSocketError;
37
- private onWebSocketReconnect;
38
- private handleKeyPress;
39
- private handleSigint;
40
- private handleEscKey;
41
- private handleStopResponse;
42
- private handleExit;
43
- private detectPasting;
44
- }