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,107 @@
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.createTemplateProject = createTemplateProject;
27
+ const child_process_1 = require("child_process");
28
+ const path_1 = require("path");
29
+ const fs = __importStar(require("fs"));
30
+ const os = __importStar(require("os"));
31
+ const picocolors_1 = require("picocolors");
32
+ async function createTemplateProject(template, projectDir, projectName = template) {
33
+ console.log(`Creating project from ${template} template in ${projectDir}/${projectName}`);
34
+ // Validate template name contains only alphanumeric chars, dash and underscore
35
+ if (!/^[a-zA-Z0-9-_]+$/.test(template)) {
36
+ console.error('Template name can only contain letters, numbers, dash and underscore');
37
+ process.exit(1);
38
+ }
39
+ // Validate project name
40
+ if (!/^[a-zA-Z0-9-_]+$/.test(projectName)) {
41
+ console.error('Project name can only contain letters, numbers, dash and underscore');
42
+ process.exit(1);
43
+ }
44
+ const projectPath = (0, path_1.join)(projectDir, projectName);
45
+ // Check if directory already exists
46
+ if (fs.existsSync(projectPath)) {
47
+ console.error(`Directory ${projectPath} already exists`);
48
+ process.exit(1);
49
+ }
50
+ try {
51
+ console.log('\nDownloading template...');
52
+ // Clone the community repo to a temp directory
53
+ const tempDir = fs.mkdtempSync((0, path_1.join)(os.tmpdir(), 'codebuff-starter-'));
54
+ (0, child_process_1.execSync)('git clone --depth 1 https://github.com/CodebuffAI/codebuff-community.git .', {
55
+ cwd: tempDir,
56
+ stdio: 'pipe',
57
+ });
58
+ // Check if template exists in starter-templates or showcase directory
59
+ const starterTemplateDir = (0, path_1.join)(tempDir, 'starter-templates', template);
60
+ const showcaseDir = (0, path_1.join)(tempDir, 'showcase', template);
61
+ let templateDir;
62
+ if (fs.existsSync(starterTemplateDir)) {
63
+ templateDir = starterTemplateDir;
64
+ }
65
+ else if (fs.existsSync(showcaseDir)) {
66
+ templateDir = showcaseDir;
67
+ }
68
+ else {
69
+ console.error(`Template ${template} not found in starter-templates/ or showcase/`);
70
+ fs.rmSync(tempDir, { recursive: true, force: true });
71
+ process.exit(1);
72
+ }
73
+ // Create parent directory if it doesn't exist
74
+ if (projectDir) {
75
+ fs.mkdirSync(projectDir, { recursive: true });
76
+ }
77
+ // Copy template to new directory
78
+ fs.mkdirSync(projectPath);
79
+ fs.cpSync(templateDir, projectPath, { recursive: true });
80
+ // Remove .git directory if it exists
81
+ const gitDir = (0, path_1.join)(projectPath, '.git');
82
+ if (fs.existsSync(gitDir)) {
83
+ fs.rmSync(gitDir, { recursive: true, force: true });
84
+ }
85
+ // Initialize new git repo
86
+ console.log('\nInitializing git repo...');
87
+ (0, child_process_1.execSync)('git init', { cwd: projectPath, stdio: 'pipe' });
88
+ // Clean up temp directory
89
+ fs.rmSync(tempDir, { recursive: true, force: true });
90
+ // Install dependencies
91
+ if (fs.existsSync((0, path_1.join)(projectPath, 'package-lock.json'))) {
92
+ console.log('\nInstalling dependencies...');
93
+ (0, child_process_1.execSync)('npm install', { cwd: projectPath, stdio: 'inherit' });
94
+ }
95
+ console.log((0, picocolors_1.green)(`\nSuccessfully created new project in ${projectPath}\n`));
96
+ // Change into the new project directory and run codebuff
97
+ process.chdir(projectPath);
98
+ console.log('Starting Codebuff in the new project...\n');
99
+ console.log('--------------------------------\n');
100
+ (0, child_process_1.execSync)('codebuff', { stdio: 'inherit' });
101
+ }
102
+ catch (error) {
103
+ console.error('Failed to initialize project:', error);
104
+ process.exit(1);
105
+ }
106
+ }
107
+ //# sourceMappingURL=create-template-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-template-project.js","sourceRoot":"","sources":["../src/create-template-project.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,sDAqGC;AA3GD,iDAAwC;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,4BAA4B,CAAC,CAAA;QACzC,IAAA,wBAAQ,EAAC,UAAU,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;QAEzD,0BAA0B;QAC1B,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QAEpD,uBAAuB;QACvB,IAAI,EAAE,CAAC,UAAU,CAAC,IAAA,WAAI,EAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;YAC3C,IAAA,wBAAQ,EAAC,aAAa,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;QACjE,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,IAAA,kBAAK,EAAC,yCAAyC,WAAW,IAAI,CAAC,CAAC,CAAA;QAE5E,yDAAyD;QACzD,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAC1B,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAA;QACxD,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;QACjD,IAAA,wBAAQ,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { User } from './common/util/credentials';
2
+ export declare const userFromJson: (json: string, profileName?: string) => User | undefined;
3
+ export declare const CONFIG_DIR: string;
4
+ export declare const CREDENTIALS_PATH: string;
@@ -0,0 +1,10 @@
1
+ import { StartupProcess } from './common/json-config/constants';
2
+ /**
3
+ * Starts background development processes defined in the config file.
4
+ * Processes are started asynchronously and their output is tracked.
5
+ * Only enabled processes are started.
6
+ *
7
+ * @param processes - Array of startup process configurations
8
+ * @param projectPath - Base path of the project
9
+ */
10
+ export declare function startDevProcesses(processes: StartupProcess[], projectPath: string): void;
@@ -0,0 +1 @@
1
+ export declare function calculateFingerprint(): Promise<string>;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ // Modified from: https://github.com/andsmedeiros/hw-fingerprint
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.calculateFingerprint = calculateFingerprint;
5
+ const node_crypto_1 = require("node:crypto");
6
+ const node_os_1 = require("node:os");
7
+ const systeminformation_1 = require("systeminformation");
8
+ const getFingerprintInfo = async () => {
9
+ const { manufacturer, model, serial, uuid } = await (0, systeminformation_1.system)();
10
+ const { vendor, version: biosVersion, releaseDate } = await (0, systeminformation_1.bios)();
11
+ const { manufacturer: boardManufacturer, model: boardModel, serial: boardSerial, } = await (0, systeminformation_1.baseboard)();
12
+ const { manufacturer: cpuManufacturer, brand, speedMax, cores, physicalCores, socket, } = await (0, systeminformation_1.cpu)();
13
+ const { platform, arch } = await (0, systeminformation_1.osInfo)();
14
+ return {
15
+ EOL: node_os_1.EOL,
16
+ endianness: (0, node_os_1.endianness)(),
17
+ manufacturer,
18
+ model,
19
+ serial,
20
+ uuid,
21
+ vendor,
22
+ biosVersion,
23
+ releaseDate,
24
+ boardManufacturer,
25
+ boardModel,
26
+ boardSerial,
27
+ cpuManufacturer,
28
+ brand,
29
+ speedMax: speedMax.toFixed(2),
30
+ cores,
31
+ physicalCores,
32
+ socket,
33
+ platform,
34
+ arch,
35
+ };
36
+ };
37
+ async function calculateFingerprint() {
38
+ const fingerprintInfo = await getFingerprintInfo();
39
+ const fingerprintString = JSON.stringify(fingerprintInfo);
40
+ const fingerprintHash = (0, node_crypto_1.createHash)('sha256')
41
+ .update(fingerprintString)
42
+ .digest()
43
+ .toString('base64url');
44
+ // Add 8 random characters to make the fingerprint unique even on identical hardware
45
+ const randomSuffix = (0, node_crypto_1.randomBytes)(6).toString('base64url').substring(0, 8);
46
+ return `${fingerprintHash}-${randomSuffix}`;
47
+ }
48
+ //# sourceMappingURL=fingerprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../src/fingerprint.ts"],"names":[],"mappings":";AAAA,gEAAgE;;AAsDhE,oDAYC;AAhED,6CAAqD;AACrD,qCAAyC;AACzC,yDAO0B;AAE1B,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;IACpC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,0BAAM,GAAE,CAAA;IAC5D,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,wBAAI,GAAE,CAAA;IAClE,MAAM,EACJ,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,GACpB,GAAG,MAAM,IAAA,6BAAS,GAAE,CAAA;IACrB,MAAM,EACJ,YAAY,EAAE,eAAe,EAC7B,KAAK,EACL,QAAQ,EACR,KAAK,EACL,aAAa,EACb,MAAM,GACP,GAAG,MAAM,IAAA,uBAAG,GAAE,CAAA;IACf,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,0BAAM,GAAE,CAAA;IAEzC,OAAO;QACL,GAAG,EAAH,aAAG;QACH,UAAU,EAAE,IAAA,oBAAU,GAAE;QACxB,YAAY;QACZ,KAAK;QACL,MAAM;QACN,IAAI;QACJ,MAAM;QACN,WAAW;QACX,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW;QACX,eAAe;QACf,KAAK;QACL,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,KAAK;QACL,aAAa;QACb,MAAM;QACN,QAAQ;QACR,IAAI;KACkB,CAAA;AAC1B,CAAC,CAAA;AACM,KAAK,UAAU,oBAAoB;IACxC,MAAM,eAAe,GAAG,MAAM,kBAAkB,EAAE,CAAA;IAClD,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IACzD,MAAM,eAAe,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC;SACzC,MAAM,CAAC,iBAAiB,CAAC;SACzB,MAAM,EAAE;SACR,QAAQ,CAAC,WAAW,CAAC,CAAA;IAExB,oFAAoF;IACpF,MAAM,YAAY,GAAG,IAAA,yBAAW,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEzE,OAAO,GAAG,eAAe,IAAI,YAAY,EAAE,CAAA;AAC7C,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/menu.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { CostMode } from './common/constants';
2
+ export declare function displayGreeting(costMode: CostMode, username: string | null): void;
3
+ export declare function displayMenu(): void;
@@ -0,0 +1,114 @@
1
+ export declare const currentChatId: string;
2
+ export declare function isDir(p: string): boolean;
3
+ export declare function getProjectDataDir(): string;
4
+ export declare function getCurrentChatDir(): string;
5
+ export declare function setProjectRoot(dir: string | undefined): string;
6
+ export declare function getProjectRoot(): string;
7
+ export declare function initProjectFileContextWithWorker(dir: string): Promise<{
8
+ currentWorkingDirectory: string;
9
+ fileTree: import("./common/util/file").FileTreeNode[];
10
+ fileTokenScores: Record<string, Record<string, number>>;
11
+ knowledgeFiles: Record<string, string>;
12
+ gitChanges: {
13
+ status: string;
14
+ diff: string;
15
+ diffCached: string;
16
+ lastCommitMessages: string;
17
+ };
18
+ changesSinceLastChat: Record<string, string>;
19
+ shellConfigFiles: Record<string, string>;
20
+ systemInfo: {
21
+ platform: string;
22
+ shell: string;
23
+ nodeVersion: string;
24
+ arch: string;
25
+ homedir: string;
26
+ cpus: number;
27
+ };
28
+ userKnowledgeFiles?: Record<string, string> | undefined;
29
+ fileVersions?: {
30
+ path: string;
31
+ content: string;
32
+ }[][] | undefined;
33
+ }>;
34
+ /**
35
+ * Retrieves or updates the project file context for a given project.
36
+ *
37
+ * This function gathers comprehensive information about the project's files, structure,
38
+ * and state. It either creates a new context if one doesn't exist for the specified
39
+ * project root, or updates an existing cached context with new information.
40
+ *
41
+ * The context includes:
42
+ * - File tree structure
43
+ * - Token scores for code analysis
44
+ * - Knowledge files (project-specific documentation)
45
+ * - User knowledge files (from home directory)
46
+ * - Git changes and status
47
+ * - Changes since the last file version
48
+ * - Shell configuration files
49
+ * - System information
50
+ *
51
+ * @param {string} projectRoot - The root directory path of the project
52
+ * @param {Record<string, string>} lastFileVersion - Record of the last known file versions
53
+ * @param {FileVersion[][]} newFileVersions - Array of file version arrays, representing the history of file changes
54
+ * @returns {Promise<ProjectFileContext>} A promise that resolves to the project file context object
55
+ */
56
+ export declare const getProjectFileContext: (projectRoot: string, lastFileVersion: Record<string, string>) => Promise<{
57
+ currentWorkingDirectory: string;
58
+ fileTree: import("./common/util/file").FileTreeNode[];
59
+ fileTokenScores: Record<string, Record<string, number>>;
60
+ knowledgeFiles: Record<string, string>;
61
+ gitChanges: {
62
+ status: string;
63
+ diff: string;
64
+ diffCached: string;
65
+ lastCommitMessages: string;
66
+ };
67
+ changesSinceLastChat: Record<string, string>;
68
+ shellConfigFiles: Record<string, string>;
69
+ systemInfo: {
70
+ platform: string;
71
+ shell: string;
72
+ nodeVersion: string;
73
+ arch: string;
74
+ homedir: string;
75
+ cpus: number;
76
+ };
77
+ userKnowledgeFiles?: Record<string, string> | undefined;
78
+ fileVersions?: {
79
+ path: string;
80
+ content: string;
81
+ }[][] | undefined;
82
+ }>;
83
+ /**
84
+ * Identifies changes between the last known version of files and their current state on disk.
85
+ *
86
+ * This function compares each file in the provided lastFileVersion record with its current
87
+ * content on disk. For files that have changed, it generates a patch using the diff library's
88
+ * createPatch function. Files that haven't changed or can't be read are filtered out from
89
+ * the result.
90
+ *
91
+ * The function is used to track changes made to files since the last interaction or session,
92
+ * which helps maintain context about what has changed in the project over time.
93
+ *
94
+ * @param {Record<string, string>} lastFileVersion - A record mapping file paths to their
95
+ * content as of the last known version
96
+ * @returns {Record<string, string>} A record mapping file paths to patch strings for files
97
+ * that have changed since the last version. Files that haven't changed or couldn't
98
+ * be read are not included in the result.
99
+ */
100
+ export declare function getChangesSinceLastFileVersion(lastFileVersion: Record<string, string>): {
101
+ [k: string]: string;
102
+ };
103
+ export declare function getFiles(filePaths: string[]): Record<string, string | null>;
104
+ export declare function getFilesOrNull(filePaths: string[]): {
105
+ [k: string]: string | null;
106
+ };
107
+ export declare function getExistingFiles(filePaths: string[]): Record<string, string>;
108
+ export declare function addScrapedContentToFiles(files: Record<string, string>): Promise<{
109
+ [x: string]: string;
110
+ }>;
111
+ export declare function getFilesAbsolutePath(filePaths: string[]): Record<string, string | null>;
112
+ export declare function setFiles(files: Record<string, string>): void;
113
+ export declare function getFileBlocks(filePaths: string[]): string;
114
+ export declare const deleteFile: (fullPath: string) => boolean;
@@ -0,0 +1,2 @@
1
+ import { CodebuffConfig } from './common/json-config/constants';
2
+ export declare function logAndHandleStartup(projectRoot: string, config: CodebuffConfig | null): Promise<any>;
@@ -0,0 +1,28 @@
1
+ import { BrowserResponse } from './common/browser-actions';
2
+ import { RawToolCall } from './common/types/tools';
3
+ export type ToolHandler<T extends Record<string, any>> = (parameters: T, id: string, projectPath: string) => Promise<string | BrowserResponse>;
4
+ export declare const handleWriteFile: ToolHandler<{
5
+ path: string;
6
+ content: string;
7
+ type: 'patch' | 'file';
8
+ }>;
9
+ export declare const handleScrapeWebPage: ToolHandler<{
10
+ url: string;
11
+ }>;
12
+ export declare const handleRunTerminalCommand: (parameters: {
13
+ command: string;
14
+ mode?: "user" | "assistant";
15
+ process_type: "SYNC" | "BACKGROUND";
16
+ }, id: string, projectPath: string) => Promise<{
17
+ result: string;
18
+ stdout: string;
19
+ }>;
20
+ export declare const handleCodeSearch: ToolHandler<{
21
+ pattern: string;
22
+ }>;
23
+ export declare const toolHandlers: Record<string, ToolHandler<any>>;
24
+ export declare const handleToolCall: (toolCall: RawToolCall, projectPath: string) => Promise<{
25
+ name: string;
26
+ result: string;
27
+ id: string;
28
+ }>;
@@ -0,0 +1,15 @@
1
+ import { CostMode } from './common/constants';
2
+ export type GitCommand = 'stage' | undefined;
3
+ export interface CliOptions {
4
+ initialInput?: string;
5
+ git: GitCommand;
6
+ costMode: CostMode;
7
+ runInitFlow?: boolean;
8
+ model?: string;
9
+ }
10
+ /**
11
+ * Utility type to make specific properties nullable
12
+ */
13
+ export type MakeNullable<T, K extends keyof T> = {
14
+ [P in keyof T]: P extends K ? T[P] | null : T[P];
15
+ };
@@ -0,0 +1 @@
1
+ export declare function updateCodebuff(): Promise<void>;
@@ -0,0 +1,160 @@
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.updateCodebuff = updateCodebuff;
7
+ const child_process_1 = require("child_process");
8
+ const picocolors_1 = require("picocolors");
9
+ const package_json_1 = __importDefault(require("../package.json"));
10
+ const background_process_manager_1 = require("./background-process-manager");
11
+ const config_1 = require("./config");
12
+ const analytics_1 = require("./utils/analytics");
13
+ const web_scraper_1 = require("./web-scraper");
14
+ async function updateCodebuff() {
15
+ if (!config_1.isProduction)
16
+ return;
17
+ const latestVersion = await getCodebuffNpmVersion();
18
+ const isUpToDate = isNpmUpToDate(package_json_1.default.version, latestVersion);
19
+ if (!isUpToDate) {
20
+ const installerInfo = detectInstaller();
21
+ if (!installerInfo) {
22
+ console.log((0, picocolors_1.yellow)("There's a new version available! Please update Codebuff to prevent errors (run `npm install -g codebuff` to update)."));
23
+ return;
24
+ }
25
+ console.log((0, picocolors_1.green)(`Updating Codebuff using ${installerInfo.installer}...`));
26
+ try {
27
+ runUpdateCodebuff(installerInfo);
28
+ await (0, background_process_manager_1.killAllBackgroundProcesses)();
29
+ (0, analytics_1.flushAnalytics)();
30
+ console.log((0, picocolors_1.green)('Codebuff updated successfully.'));
31
+ console.log((0, picocolors_1.green)('Please restart by running `codebuff` to use the new version.'));
32
+ process.exit(0);
33
+ }
34
+ catch (error) {
35
+ console.error('Failed to update Codebuff.');
36
+ }
37
+ }
38
+ }
39
+ async function getCodebuffNpmVersion() {
40
+ try {
41
+ const result = (0, child_process_1.execSync)('npm view codebuff version', {
42
+ encoding: 'utf-8',
43
+ stdio: 'pipe', // Suppress all output
44
+ });
45
+ const versionMatch = result.match(/(\d+\.\d+\.\d+)/);
46
+ if (versionMatch) {
47
+ return versionMatch[1];
48
+ }
49
+ }
50
+ catch (error) { }
51
+ // Fallback to web scraping if npm command fails
52
+ const url = 'https://www.npmjs.com/package/codebuff';
53
+ const content = await (0, web_scraper_1.scrapeWebPage)(url);
54
+ const latestVersionRegex = /"latest":"(\d+\.\d+\.\d+)"/;
55
+ const match = content.match(latestVersionRegex);
56
+ return match ? match[1] : '';
57
+ }
58
+ function isNpmUpToDate(currentVersion, latestVersion) {
59
+ const current = currentVersion.split('.').map(Number);
60
+ const latest = latestVersion.split('.').map(Number);
61
+ for (let i = 0; i < 3; i++) {
62
+ if (current[i] < latest[i])
63
+ return false;
64
+ if (current[i] > latest[i])
65
+ return true;
66
+ }
67
+ return true;
68
+ }
69
+ function detectInstaller() {
70
+ let codebuffLocation = '';
71
+ try {
72
+ if (process.platform === 'win32') {
73
+ codebuffLocation = (0, child_process_1.execSync)('where codebuff').toString().trim();
74
+ }
75
+ else {
76
+ codebuffLocation = (0, child_process_1.execSync)('which codebuff').toString().trim();
77
+ }
78
+ }
79
+ catch (error) {
80
+ // Continue with empty location - could be a local installation
81
+ }
82
+ const binPath = (codebuffLocation.split('\n')[0] ?? '').replace(/\\/g, '/');
83
+ const npmUserAgent = process.env.npm_config_user_agent ?? '';
84
+ // Check for package manager script environments
85
+ const isYarnScript = process.env.npm_lifecycle_script?.includes('yarn');
86
+ const isPnpmScript = process.env.npm_lifecycle_script?.includes('pnpm');
87
+ const isBunScript = process.env.npm_lifecycle_script?.includes('bun');
88
+ const isNpmScript = process.env.npm_execpath?.endsWith('npm-cli.js') ||
89
+ npmUserAgent.includes('npm');
90
+ // Mac: /Users/jahooma/.yarn/bin/codebuff
91
+ if (isYarnScript || binPath.includes('.yarn')) {
92
+ return {
93
+ installer: 'yarn',
94
+ scope: binPath.includes('.yarn') ? 'global' : 'local',
95
+ };
96
+ }
97
+ // Windows: ~/AppData/Local/pnpm/store
98
+ // macOS: ~/Library/pnpm/store
99
+ // Linux: ~/.local/share/pnpm/store
100
+ if (isPnpmScript || binPath.includes('pnpm')) {
101
+ return {
102
+ installer: 'pnpm',
103
+ scope: binPath.includes('pnpm') ? 'global' : 'local',
104
+ };
105
+ }
106
+ // Mac: /Users/jahooma/.bun/install/cache
107
+ if (isBunScript || binPath.includes('.bun')) {
108
+ return {
109
+ installer: 'bun',
110
+ scope: binPath.includes('.bun') ? 'global' : 'local',
111
+ };
112
+ }
113
+ // /usr/local/lib/node_modules on macOS/Linux or %AppData%\npm/node_modules on Windows
114
+ // OR: .nvm/versions/node/v18.17.0/bin/codebuff on mac
115
+ // OR /Users/stefan/Library/Application Support/Herd/config/nvm/versions/node/v22.9.0/bin/codebuff
116
+ // OR ~/.config/nvm/versions/node/v22.11.0/bin/codebuff
117
+ // OR /opt/homebrew/bin/codebuff
118
+ const isGlobalNpmPath = binPath.includes('npm') ||
119
+ binPath.startsWith('/usr/') ||
120
+ binPath.includes('nvm/') ||
121
+ binPath.includes('homebrew/bin');
122
+ if (isNpmScript || isGlobalNpmPath) {
123
+ return {
124
+ installer: 'npm',
125
+ scope: isGlobalNpmPath ? 'global' : 'local',
126
+ };
127
+ }
128
+ return undefined;
129
+ }
130
+ function runUpdateCodebuff(installerInfo) {
131
+ let command;
132
+ const isGlobal = installerInfo.scope === 'global';
133
+ switch (installerInfo.installer) {
134
+ case 'npm':
135
+ command = `npm ${isGlobal ? 'install -g' : 'install'} codebuff@latest`;
136
+ break;
137
+ case 'yarn':
138
+ command = `yarn ${isGlobal ? 'global add' : 'add'} codebuff@latest`;
139
+ break;
140
+ case 'pnpm':
141
+ command = `pnpm add ${isGlobal ? '-g' : ''} codebuff@latest`;
142
+ break;
143
+ case 'bun':
144
+ command = `bun add ${isGlobal ? '-g' : ''} codebuff@latest`;
145
+ break;
146
+ default:
147
+ throw new Error(`Unsupported installer: ${installerInfo.installer} ${installerInfo.scope}`);
148
+ }
149
+ (0, child_process_1.execSync)(command, { stdio: 'inherit' });
150
+ }
151
+ function restartCodebuff() {
152
+ const child = (0, child_process_1.spawn)('codebuff', [...process.argv.slice(2), '--post-update'], {
153
+ detached: false,
154
+ stdio: 'inherit',
155
+ });
156
+ child.on('exit', (code) => {
157
+ process.exit(code ?? 0);
158
+ });
159
+ }
160
+ //# sourceMappingURL=update-codebuff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-codebuff.js","sourceRoot":"","sources":["../src/update-codebuff.ts"],"names":[],"mappings":";;;;;AAUA,wCA8BC;AAxCD,iDAA+C;AAE/C,2CAA0C;AAE1C,mEAAyC;AACzC,6EAAyE;AACzE,qCAAuC;AACvC,iDAAkD;AAClD,+CAA6C;AAEtC,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC,qBAAY;QAAE,OAAM;IAEzB,MAAM,aAAa,GAAG,MAAM,qBAAqB,EAAE,CAAA;IACnD,MAAM,UAAU,GAAG,aAAa,CAAC,sBAAW,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;IACpE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,aAAa,GAAG,eAAe,EAAE,CAAA;QACvC,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CACT,IAAA,mBAAM,EACJ,sHAAsH,CACvH,CACF,CAAA;YAC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