codebuff 1.0.294 → 1.0.296

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 (133) hide show
  1. package/dist/background-process-manager.d.ts +50 -0
  2. package/dist/background-process-manager.js +3 -3
  3. package/dist/browser-runner.d.ts +35 -0
  4. package/dist/browser-runner.js +4 -4
  5. package/dist/chat-storage.d.ts +2 -0
  6. package/dist/chat-storage.js +2 -2
  7. package/dist/chat-storage.js.map +1 -1
  8. package/dist/checkpoints/checkpoint-manager.d.ts +94 -0
  9. package/dist/checkpoints/checkpoint-manager.js +1 -1
  10. package/dist/checkpoints/file-manager.d.ts +72 -0
  11. package/dist/checkpoints/file-manager.js +294 -0
  12. package/dist/checkpoints/file-manager.js.map +1 -0
  13. package/dist/cli-definitions.d.ts +9 -0
  14. package/dist/cli-definitions.js +54 -0
  15. package/dist/cli-definitions.js.map +1 -0
  16. package/dist/cli-handlers/api-key.d.ts +25 -0
  17. package/dist/cli-handlers/api-key.js +1 -1
  18. package/dist/cli-handlers/checkpoint.d.ts +18 -0
  19. package/dist/cli-handlers/diff.d.ts +2 -0
  20. package/dist/cli-handlers/diff.js +31 -0
  21. package/dist/cli-handlers/diff.js.map +1 -0
  22. package/dist/cli-handlers/easter-egg.d.ts +1 -0
  23. package/dist/cli-handlers/easter-egg.js +126 -0
  24. package/dist/cli-handlers/easter-egg.js.map +1 -0
  25. package/dist/cli-handlers/inititalization-flow.d.ts +1 -0
  26. package/dist/cli-handlers/inititalization-flow.js +1 -1
  27. package/dist/cli.d.ts +66 -0
  28. package/dist/cli.js +87 -30
  29. package/dist/cli.js.map +1 -1
  30. package/dist/client.d.ts +10 -7
  31. package/dist/client.js +71 -12
  32. package/dist/client.js.map +1 -1
  33. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  34. package/dist/common/actions.d.ts +3 -0
  35. package/dist/common/actions.js +1 -0
  36. package/dist/common/actions.js.map +1 -1
  37. package/dist/common/analytics.d.ts +1 -0
  38. package/dist/common/analytics.js +7 -0
  39. package/dist/common/analytics.js.map +1 -1
  40. package/dist/common/browser-actions.d.ts +234 -234
  41. package/dist/common/credit-delegation.d.ts +19 -0
  42. package/dist/common/credit-delegation.js +97 -0
  43. package/dist/common/credit-delegation.js.map +1 -0
  44. package/dist/common/types/organization.d.ts +102 -0
  45. package/dist/common/types/organization.js +3 -0
  46. package/dist/common/types/organization.js.map +1 -0
  47. package/dist/common/util/changes.d.ts +1 -0
  48. package/dist/common/util/changes.js +13 -4
  49. package/dist/common/util/changes.js.map +1 -1
  50. package/dist/common/websockets/websocket-schema.d.ts +10 -0
  51. package/dist/config.d.ts +4 -0
  52. package/dist/config.js +12 -0
  53. package/dist/config.js.map +1 -0
  54. package/dist/create-template-project.d.ts +1 -0
  55. package/dist/create-template-project.js +107 -0
  56. package/dist/create-template-project.js.map +1 -0
  57. package/dist/credentials.d.ts +4 -0
  58. package/dist/credentials.js +2 -2
  59. package/dist/dev-process-manager.d.ts +10 -0
  60. package/dist/dev-process-manager.js +1 -1
  61. package/dist/display.d.ts +11 -0
  62. package/dist/display.js +85 -0
  63. package/dist/display.js.map +1 -0
  64. package/dist/fingerprint.d.ts +1 -0
  65. package/dist/fingerprint.js +48 -0
  66. package/dist/fingerprint.js.map +1 -0
  67. package/dist/index.d.ts +2 -0
  68. package/dist/index.js +2 -2
  69. package/dist/menu.d.ts +14 -0
  70. package/dist/menu.js +319 -0
  71. package/dist/menu.js.map +1 -0
  72. package/dist/organization-context.d.ts +47 -0
  73. package/dist/organization-context.js +170 -0
  74. package/dist/organization-context.js.map +1 -0
  75. package/dist/project-files.d.ts +4 -3
  76. package/dist/project-files.js +17 -8
  77. package/dist/project-files.js.map +1 -1
  78. package/dist/slash-commands.d.ts +7 -0
  79. package/dist/slash-commands.js +21 -0
  80. package/dist/slash-commands.js.map +1 -0
  81. package/dist/startup-process-handler.d.ts +2 -0
  82. package/dist/tool-handlers.d.ts +2 -2
  83. package/dist/tool-handlers.js +9 -6
  84. package/dist/tool-handlers.js.map +1 -1
  85. package/dist/types.d.ts +15 -0
  86. package/dist/types.js +3 -0
  87. package/dist/types.js.map +1 -0
  88. package/dist/update-codebuff.d.ts +1 -0
  89. package/dist/update-codebuff.js +7 -4
  90. package/dist/update-codebuff.js.map +1 -1
  91. package/dist/utils/__tests__/background-process-manager.test.d.ts +1 -0
  92. package/dist/utils/__tests__/background-process-manager.test.js +327 -0
  93. package/dist/utils/__tests__/background-process-manager.test.js.map +1 -0
  94. package/dist/utils/__tests__/tool-renderers.test.d.ts +1 -0
  95. package/dist/utils/__tests__/tool-renderers.test.js +2 -2
  96. package/dist/utils/__tests__/xml-stream-parser.test.d.ts +1 -0
  97. package/dist/utils/__tests__/xml-stream-parser.test.js +1 -1
  98. package/dist/utils/analytics.d.ts +7 -0
  99. package/dist/utils/analytics.js +8 -0
  100. package/dist/utils/analytics.js.map +1 -1
  101. package/dist/utils/detect-shell.d.ts +1 -0
  102. package/dist/utils/detect-shell.js +60 -0
  103. package/dist/utils/detect-shell.js.map +1 -0
  104. package/dist/utils/git.d.ts +10 -0
  105. package/dist/utils/git.js +112 -0
  106. package/dist/utils/git.js.map +1 -0
  107. package/dist/utils/image.d.ts +4 -0
  108. package/dist/utils/image.js +67 -0
  109. package/dist/utils/image.js.map +1 -0
  110. package/dist/utils/logger.d.ts +21 -0
  111. package/dist/utils/logger.js +14 -7
  112. package/dist/utils/logger.js.map +1 -1
  113. package/dist/utils/spinner.d.ts +12 -0
  114. package/dist/utils/spinner.js +94 -0
  115. package/dist/utils/spinner.js.map +1 -0
  116. package/dist/utils/system-info.d.ts +8 -0
  117. package/dist/utils/system-info.js +22 -0
  118. package/dist/utils/system-info.js.map +1 -0
  119. package/dist/utils/terminal.d.ts +44 -0
  120. package/dist/utils/terminal.js +11 -7
  121. package/dist/utils/terminal.js.map +1 -1
  122. package/dist/utils/tool-renderers.d.ts +16 -0
  123. package/dist/utils/tool-renderers.js +2 -2
  124. package/dist/utils/xml-stream-parser.d.ts +1 -1
  125. package/dist/utils/xml-stream-parser.js +2 -2
  126. package/dist/web-scraper.d.ts +3 -0
  127. package/dist/web-scraper.js +1 -1
  128. package/dist/workers/checkpoint-worker.d.ts +1 -0
  129. package/dist/workers/checkpoint-worker.js +48 -0
  130. package/dist/workers/checkpoint-worker.js.map +1 -0
  131. package/dist/workers/project-context.d.ts +1 -0
  132. package/dist/workers/project-context.js +1 -1
  133. package/package.json +5 -4
@@ -0,0 +1,50 @@
1
+ import { ChildProcessByStdio, ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio } from 'child_process';
2
+ import { ToolResult } from './common/types/agent-state';
3
+ /**
4
+ * Interface describing the information stored for each background process.
5
+ */
6
+ export interface BackgroundProcessInfo {
7
+ pid: number;
8
+ toolCallId: string;
9
+ command: string;
10
+ process: ChildProcessByStdio<any, any, any>;
11
+ stdoutBuffer: string[];
12
+ stderrBuffer: string[];
13
+ status: 'running' | 'completed' | 'error';
14
+ startTime: number;
15
+ endTime: number | null;
16
+ lastReportedStdoutLength: number;
17
+ lastReportedStderrLength: number;
18
+ lastReportedStatus: 'running' | 'completed' | 'error' | null;
19
+ stdoutFile?: string;
20
+ stderrFile?: string;
21
+ }
22
+ /**
23
+ * Global map storing information about active and completed background processes.
24
+ * Keyed by the OS-assigned Process ID (PID).
25
+ */
26
+ export declare const backgroundProcesses: Map<number, BackgroundProcessInfo>;
27
+ /**
28
+ * Formats a single background process's info into a string
29
+ */
30
+ export declare function getBackgroundProcessInfoString(info: BackgroundProcessInfo): string;
31
+ /**
32
+ * Gets updates from all background processes and updates tracking info
33
+ */
34
+ export declare function getBackgroundProcessUpdates(): ToolResult[];
35
+ export declare function spawnAndTrack(command: string, args: string[] | undefined, options: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
36
+ export declare function sendKillSignalToAllBackgroundProcesses(): void;
37
+ export declare function killAllBackgroundProcesses(): Promise<void>;
38
+ /**
39
+ * Cleans up stale lock files and attempts to kill orphaned processes found in the lock directory.
40
+ * This function is intended to run on startup to handle cases where the application might have
41
+ * exited uncleanly, leaving orphaned processes or lock files.
42
+ *
43
+ * @returns Object containing:
44
+ * - shouldStartNewProcesses: boolean indicating if it's safe to start new processes
45
+ * - cleanUpPromise: Promise that resolves when cleanup is complete
46
+ */
47
+ export declare function cleanupStoredProcesses(): {
48
+ separateCodebuffInstanceRunning: boolean;
49
+ cleanUpPromise: Promise<any>;
50
+ };
@@ -15,9 +15,9 @@ const child_process_1 = require("child_process");
15
15
  const fs_1 = require("fs");
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const process_1 = __importDefault(require("process"));
18
- const analytics_events_1 = require("common/constants/analytics-events");
19
- const array_1 = require("common/util/array");
20
- const string_1 = require("common/util/string");
18
+ const analytics_events_1 = require("./common/constants/analytics-events");
19
+ const array_1 = require("./common/util/array");
20
+ const string_1 = require("./common/util/string");
21
21
  const picocolors_1 = require("picocolors");
22
22
  const zod_1 = require("zod");
23
23
  const credentials_1 = require("./credentials");
@@ -0,0 +1,35 @@
1
+ import { BrowserAction, BrowserResponse } from './common/browser-actions';
2
+ export declare class BrowserRunner {
3
+ getLogs(): BrowserResponse['logs'];
4
+ getNetworkEvents(): BrowserResponse['networkEvents'];
5
+ private browser;
6
+ private page;
7
+ private logs;
8
+ private jsErrorCount;
9
+ private retryCount;
10
+ private startTime;
11
+ private consecutiveErrors;
12
+ private totalErrors;
13
+ constructor();
14
+ private maxConsecutiveErrors;
15
+ private totalErrorThreshold;
16
+ private performanceMetrics;
17
+ private networkEvents;
18
+ private executeWithRetry;
19
+ private executeAction;
20
+ private logErrorForAnalysis;
21
+ private getBrowser;
22
+ private startBrowser;
23
+ private navigate;
24
+ private typeText;
25
+ private scroll;
26
+ private takeScreenshot;
27
+ private attachPageListeners;
28
+ private collectPerformanceMetrics;
29
+ private collectMetrics;
30
+ private filterLogs;
31
+ execute(action: BrowserAction): Promise<BrowserResponse>;
32
+ shutdown(): Promise<void>;
33
+ }
34
+ export declare const handleBrowserInstruction: (action: BrowserAction) => Promise<BrowserResponse>;
35
+ export declare const activeBrowserRunner: BrowserRunner;
@@ -28,13 +28,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.activeBrowserRunner = exports.handleBrowserInstruction = exports.BrowserRunner = void 0;
30
30
  const puppeteer_core_1 = __importDefault(require("puppeteer-core"));
31
- const promise_1 = require("common/util/promise");
32
- const string_1 = require("common/util/string");
33
- const browser_actions_1 = require("common/browser-actions");
31
+ const promise_1 = require("./common/util/promise");
32
+ const string_1 = require("./common/util/string");
33
+ const browser_actions_1 = require("./common/browser-actions");
34
34
  const fs = __importStar(require("fs"));
35
35
  const path = __importStar(require("path"));
36
36
  const project_files_1 = require("./project-files");
37
- const file_1 = require("common/util/file");
37
+ const file_1 = require("./common/util/file");
38
38
  class BrowserRunner {
39
39
  // Add getter methods for diagnostic loop
40
40
  getLogs() {
@@ -0,0 +1,2 @@
1
+ import { Message } from './common/types/message';
2
+ export declare function setMessages(messages: Message[]): void;
@@ -27,7 +27,7 @@ exports.setMessages = setMessages;
27
27
  const path = __importStar(require("path"));
28
28
  const fs = __importStar(require("fs"));
29
29
  const project_files_1 = require("./project-files");
30
- const string_1 = require("common/util/string");
30
+ const string_1 = require("./common/util/string");
31
31
  const ts_pattern_1 = require("ts-pattern");
32
32
  function setMessages(messages) {
33
33
  // Clean up any screenshots and logs in previous messages
@@ -80,7 +80,7 @@ function setMessages(messages) {
80
80
  const chatDir = (0, project_files_1.getCurrentChatDir)();
81
81
  const messagesPath = path.join(chatDir, 'messages.json');
82
82
  const messagesData = {
83
- id: project_files_1.currentChatId,
83
+ id: (0, project_files_1.getCurrentChatId)(),
84
84
  messages: cleanedMessages,
85
85
  updatedAt: new Date().toISOString(),
86
86
  };
@@ -1 +1 @@
1
- {"version":3,"file":"chat-storage.js","sourceRoot":"","sources":["../src/chat-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;A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IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;QAExD,MAAM,YAAY,GAAG;YACnB,EAAE,EAAE,IAAA,gCAAgB,GAAE;YACtB,QAAQ,EAAE,eAAe;YACzB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAA;QAED,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAA;IAC1D,CAAC;AACH,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { AgentState, ToolResult } from '../common/types/agent-state';
2
+ export declare class CheckpointsDisabledError extends Error {
3
+ constructor(message?: string, options?: ErrorOptions);
4
+ }
5
+ /**
6
+ * Interface representing a checkpoint of agent state
7
+ */
8
+ export interface Checkpoint {
9
+ agentStateString: string;
10
+ lastToolResultsString: string;
11
+ /** Promise resolving to the git commit hash for this checkpoint */
12
+ fileStateIdPromise: Promise<string>;
13
+ /** Number of messages in the agent's history at checkpoint time */
14
+ historyLength: number;
15
+ id: number;
16
+ parentId: number;
17
+ timestamp: number;
18
+ /** User input that triggered this checkpoint */
19
+ userInput: string;
20
+ }
21
+ /**
22
+ * Manages checkpoints of agent state and file state using git operations in a worker thread.
23
+ * Each checkpoint contains both the agent's conversation state and a git commit
24
+ * representing the state of all tracked files at that point.
25
+ */
26
+ export declare class CheckpointManager {
27
+ checkpoints: Array<Checkpoint>;
28
+ currentCheckpointId: number;
29
+ disabledReason: string | null;
30
+ private bareRepoPath;
31
+ /** Stores the undo chain (leaf node first, current node last) */
32
+ private undoIds;
33
+ /** Worker thread for git operations */
34
+ private worker;
35
+ /**
36
+ * Initialize or return the existing worker thread
37
+ * @returns The worker thread instance
38
+ */
39
+ private initWorker;
40
+ /**
41
+ * Execute an operation in the worker thread with timeout handling
42
+ * @param message - The message describing the operation to perform
43
+ * @returns A promise that resolves with the operation result
44
+ * @throws {Error} if the operation fails or times out
45
+ */
46
+ private runWorkerOperation;
47
+ /**
48
+ * Get the path to the bare git repository used for storing file states
49
+ * @returns The bare repo path
50
+ */
51
+ private getBareRepoPath;
52
+ /**
53
+ * Add a new checkpoint of the current agent and file state
54
+ * @param agentState - The current agent state to checkpoint
55
+ * @param lastToolResults - The tool results from the last assistant turn
56
+ * @param userInput - The user input that triggered this checkpoint
57
+ * @returns The latest checkpoint and whether that checkpoint was created (or already existed)
58
+ * @throws {Error} If the checkpoint cannot be added
59
+ */
60
+ addCheckpoint(agentState: AgentState, lastToolResults: ToolResult[], userInput: string, saveWithNoChanges?: boolean): Promise<{
61
+ checkpoint: Checkpoint;
62
+ created: boolean;
63
+ }>;
64
+ /**
65
+ * Get the most recent checkpoint
66
+ * @returns The most recent checkpoint or null if none exist
67
+ * @throws {CheckpointsDisabledError} If checkpoints are disabled
68
+ * @throws {ReferenceError} If no checkpoints exist
69
+ */
70
+ getLatestCheckpoint(): Checkpoint;
71
+ /**
72
+ * Restore the file state from a specific checkpoint
73
+ * @param id - The ID of the checkpoint to restore
74
+ * @param resetUndoIds - Whether to reset the chain of undo/redo ids
75
+ * @throws {Error} If the file state cannot be restored
76
+ */
77
+ restoreCheckointFileState({ id, resetUndoIds, }: {
78
+ id: number;
79
+ resetUndoIds?: boolean;
80
+ }): Promise<void>;
81
+ restoreUndoCheckpoint(): Promise<void>;
82
+ restoreRedoCheckpoint(): Promise<void>;
83
+ /**
84
+ * Clear all checkpoints
85
+ */
86
+ clearCheckpoints(resetBareRepoPath?: boolean): void;
87
+ /**
88
+ * Get a formatted string representation of all checkpoints
89
+ * @param detailed Whether to include detailed information about each checkpoint
90
+ * @returns A formatted string representation of all checkpoints
91
+ */
92
+ getCheckpointsAsString(detailed?: boolean): string;
93
+ }
94
+ export declare const checkpointManager: CheckpointManager;
@@ -8,7 +8,7 @@ const assert_1 = __importDefault(require("assert"));
8
8
  const os_1 = __importDefault(require("os"));
9
9
  const path_1 = require("path");
10
10
  const worker_threads_1 = require("worker_threads");
11
- const project_file_tree_1 = require("common/project-file-tree");
11
+ const project_file_tree_1 = require("../common/project-file-tree");
12
12
  const picocolors_1 = require("picocolors");
13
13
  const project_files_1 = require("../project-files");
14
14
  const file_manager_1 = require("./file-manager");
@@ -0,0 +1,72 @@
1
+ import fs from 'fs';
2
+ /**
3
+ * Generates a unique path for storing the bare git repository based on the project directory.
4
+ * Uses SHA-256 hashing to create a unique identifier.
5
+ * @param dir - The project directory path to hash
6
+ * @returns The full path where the bare repo should be stored
7
+ */
8
+ export declare function getBareRepoPath(dir: string): string;
9
+ /**
10
+ * Checks if there are any uncommitted changes in the working directory.
11
+ * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
12
+ * @param projectDir - The working tree directory path
13
+ * @param bareRepoPath - The bare git repository path
14
+ * @param relativeFilepaths - Array of file paths relative to projectDir to check
15
+ * @returns Promise resolving to true if there are uncommitted changes, false otherwise
16
+ */
17
+ export declare function hasUnsavedChanges({ projectDir, bareRepoPath, relativeFilepaths, }: {
18
+ projectDir: string;
19
+ bareRepoPath: string;
20
+ relativeFilepaths: Array<string>;
21
+ }): Promise<boolean>;
22
+ /**
23
+ * Gets the hash of the latest commit in the repository.
24
+ * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
25
+ * @param bareRepoPath - The bare git repository path
26
+ * @returns Promise resolving to the commit hash
27
+ */
28
+ export declare function getLatestCommit({ bareRepoPath, }: {
29
+ bareRepoPath: string;
30
+ }): Promise<string>;
31
+ /**
32
+ * Initializes a bare git repository for tracking file changes.
33
+ * Creates the repository if it doesn't exist, otherwise uses the existing one.
34
+ * Makes an initial commit of the current file state.
35
+ * @param projectDir - The working tree directory path
36
+ * @param relativeFilepaths - Array of file paths relative to projectDir to track
37
+ */
38
+ export declare function initializeCheckpointFileManager({ projectDir, relativeFilepaths, }: {
39
+ projectDir: string;
40
+ relativeFilepaths: Array<string>;
41
+ }): Promise<void>;
42
+ /**
43
+ * Creates a new commit with the current state of all tracked files.
44
+ * Stages all changes and creates a commit with the specified message.
45
+ * @param projectDir - The working tree directory path
46
+ * @param bareRepoPath - The bare git repository path
47
+ * @param message - The commit message
48
+ * @param relativeFilepaths - Array of file paths relative to projectDir to commit
49
+ * @returns Promise resolving to the new commit's hash
50
+ */
51
+ export declare function storeFileState({ projectDir, bareRepoPath, message, relativeFilepaths: relativeFilepaths, }: {
52
+ projectDir: string;
53
+ bareRepoPath: string;
54
+ message: string;
55
+ relativeFilepaths: Array<string>;
56
+ }): Promise<string>;
57
+ /**
58
+ * Restores the working directory and index to match the specified commit.
59
+ * Equivalent to `git reset --hard`
60
+ * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
61
+ * @param projectDir - The working tree directory path
62
+ * @param bareRepoPath - The bare git repository path
63
+ * @param commit - The commit hash to restore to
64
+ * @param relativeFilepaths - Array of file paths relative to projectDir to restore
65
+ */
66
+ export declare function restoreFileState({ projectDir, bareRepoPath, commit, relativeFilepaths, }: {
67
+ projectDir: string;
68
+ bareRepoPath: string;
69
+ commit: string;
70
+ relativeFilepaths: Array<string>;
71
+ }): Promise<void>;
72
+ export { fs };
@@ -0,0 +1,294 @@
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
+ const git_1 = require("../utils/git");
22
+ /**
23
+ * Generates a unique path for storing the bare git repository based on the project directory.
24
+ * Uses SHA-256 hashing to create a unique identifier.
25
+ * @param dir - The project directory path to hash
26
+ * @returns The full path where the bare repo should be stored
27
+ */
28
+ function getBareRepoPath(dir) {
29
+ const bareRepoName = (0, crypto_1.createHash)('sha256').update(dir).digest('hex');
30
+ return (0, path_1.join)((0, project_files_1.getProjectDataDir)(), bareRepoName);
31
+ }
32
+ /**
33
+ * Checks if there are any uncommitted changes in the working directory.
34
+ * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
35
+ * @param projectDir - The working tree directory path
36
+ * @param bareRepoPath - The bare git repository path
37
+ * @param relativeFilepaths - Array of file paths relative to projectDir to check
38
+ * @returns Promise resolving to true if there are uncommitted changes, false otherwise
39
+ */
40
+ async function hasUnsavedChanges({ projectDir, bareRepoPath, relativeFilepaths, }) {
41
+ if ((0, git_1.gitCommandIsAvailable)()) {
42
+ try {
43
+ const output = (0, child_process_1.execFileSync)('git', [
44
+ '--git-dir',
45
+ bareRepoPath,
46
+ '--work-tree',
47
+ projectDir,
48
+ 'status',
49
+ '--porcelain',
50
+ ], { stdio: ['ignore', 'pipe', 'ignore'] }).toString();
51
+ return output.trim().length > 0;
52
+ }
53
+ catch (error) {
54
+ // error running git
55
+ }
56
+ }
57
+ for (const [, , workdirStatus, stageStatus] of await (0, isomorphic_git_1.statusMatrix)({
58
+ fs: fs_1.default,
59
+ dir: projectDir,
60
+ gitdir: bareRepoPath,
61
+ filepaths: relativeFilepaths,
62
+ })) {
63
+ if (workdirStatus !== stageStatus) {
64
+ return true;
65
+ }
66
+ }
67
+ return false;
68
+ }
69
+ /**
70
+ * Gets the hash of the latest commit in the repository.
71
+ * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
72
+ * @param bareRepoPath - The bare git repository path
73
+ * @returns Promise resolving to the commit hash
74
+ */
75
+ async function getLatestCommit({ bareRepoPath, }) {
76
+ if ((0, git_1.gitCommandIsAvailable)()) {
77
+ try {
78
+ return (0, child_process_1.execFileSync)('git', ['--git-dir', bareRepoPath, 'rev-parse', 'HEAD'], { stdio: ['ignore', 'pipe', 'ignore'] })
79
+ .toString()
80
+ .trim();
81
+ }
82
+ catch (error) {
83
+ // unable to get head
84
+ }
85
+ }
86
+ return await (0, isomorphic_git_1.resolveRef)({
87
+ fs: fs_1.default,
88
+ gitdir: bareRepoPath,
89
+ ref: 'HEAD',
90
+ });
91
+ }
92
+ /**
93
+ * Initializes a bare git repository for tracking file changes.
94
+ * Creates the repository if it doesn't exist, otherwise uses the existing one.
95
+ * Makes an initial commit of the current file state.
96
+ * @param projectDir - The working tree directory path
97
+ * @param relativeFilepaths - Array of file paths relative to projectDir to track
98
+ */
99
+ async function initializeCheckpointFileManager({ projectDir, relativeFilepaths, }) {
100
+ if (projectDir === os_1.default.homedir()) {
101
+ return;
102
+ }
103
+ const bareRepoPath = getBareRepoPath(projectDir);
104
+ // Create the bare repo directory if it doesn't exist
105
+ fs_1.default.mkdirSync(bareRepoPath, { recursive: true });
106
+ try {
107
+ // Check if it's already a valid Git repo
108
+ await (0, isomorphic_git_1.resolveRef)({ fs: fs_1.default, gitdir: bareRepoPath, ref: 'HEAD' });
109
+ }
110
+ catch (error) {
111
+ // Bare repo doesn't exist yet
112
+ await (0, isomorphic_git_1.init)({
113
+ fs: fs_1.default,
114
+ dir: projectDir,
115
+ gitdir: bareRepoPath,
116
+ bare: true,
117
+ defaultBranch: 'master',
118
+ });
119
+ }
120
+ // Commit the files in the bare repo
121
+ await storeFileState({
122
+ projectDir,
123
+ bareRepoPath,
124
+ message: 'Initial Commit',
125
+ relativeFilepaths,
126
+ });
127
+ }
128
+ /**
129
+ * Stages all changes in the working directory.
130
+ * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
131
+ * @param projectDir - The working tree directory path
132
+ * @param bareRepoPath - The bare git repository path
133
+ * @param relativeFilepaths - Array of file paths relative to projectDir to stage
134
+ */
135
+ async function gitAddAll({ projectDir, bareRepoPath, relativeFilepaths, }) {
136
+ if ((0, git_1.gitCommandIsAvailable)()) {
137
+ try {
138
+ (0, child_process_1.execFileSync)('git', [
139
+ '--git-dir',
140
+ bareRepoPath,
141
+ '--work-tree',
142
+ projectDir,
143
+ '-C',
144
+ projectDir,
145
+ 'add',
146
+ '.',
147
+ ], { stdio: 'ignore' });
148
+ return;
149
+ }
150
+ catch (error) {
151
+ // Failed to `git add .`
152
+ }
153
+ }
154
+ // Stage files with isomorphic-git
155
+ // Get status of all files in the project directory
156
+ const currStatusMatrix = (await (0, isomorphic_git_1.statusMatrix)({
157
+ fs: fs_1.default,
158
+ dir: projectDir,
159
+ gitdir: bareRepoPath,
160
+ filepaths: relativeFilepaths,
161
+ })) ?? [];
162
+ for (const [filepath, , workdirStatus, stageStatus] of currStatusMatrix) {
163
+ if (workdirStatus === stageStatus) {
164
+ continue;
165
+ }
166
+ if (workdirStatus === 2) {
167
+ // Existing file different from HEAD
168
+ try {
169
+ await (0, isomorphic_git_1.add)({ fs: fs_1.default, dir: projectDir, gitdir: bareRepoPath, filepath });
170
+ }
171
+ catch (error) {
172
+ // error adding files
173
+ }
174
+ }
175
+ else if (workdirStatus === 0) {
176
+ // Deleted file
177
+ try {
178
+ await (0, isomorphic_git_1.remove)({ fs: fs_1.default, dir: projectDir, gitdir: bareRepoPath, filepath });
179
+ }
180
+ catch (error) {
181
+ // error removing file
182
+ }
183
+ }
184
+ }
185
+ }
186
+ async function gitCommit({ projectDir, bareRepoPath, message, }) {
187
+ if ((0, git_1.gitCommandIsAvailable)()) {
188
+ try {
189
+ (0, child_process_1.execFileSync)('git', [
190
+ '--git-dir',
191
+ bareRepoPath,
192
+ '--work-tree',
193
+ projectDir,
194
+ 'commit',
195
+ '-m',
196
+ message,
197
+ ], { stdio: 'ignore' });
198
+ return await getLatestCommit({ bareRepoPath });
199
+ }
200
+ catch (error) {
201
+ // Failed to commit, continue to isomorphic-git implementation
202
+ }
203
+ }
204
+ const commitHash = await (0, isomorphic_git_1.commit)({
205
+ fs: fs_1.default,
206
+ dir: projectDir,
207
+ gitdir: bareRepoPath,
208
+ author: { name: 'Codebuff' },
209
+ message,
210
+ ref: '/refs/heads/master',
211
+ });
212
+ if ((0, git_1.gitCommandIsAvailable)()) {
213
+ try {
214
+ (0, child_process_1.execFileSync)('git', [
215
+ '--git-dir',
216
+ bareRepoPath,
217
+ '--work-tree',
218
+ projectDir,
219
+ 'checkout',
220
+ 'master',
221
+ ], { stdio: 'ignore' });
222
+ return commitHash;
223
+ }
224
+ catch (error) {
225
+ // Unable to checkout with git
226
+ }
227
+ }
228
+ await (0, isomorphic_git_1.checkout)({ fs: fs_1.default, dir: projectDir, gitdir: bareRepoPath, ref: 'master' });
229
+ return commitHash;
230
+ }
231
+ /**
232
+ * Creates a new commit with the current state of all tracked files.
233
+ * Stages all changes and creates a commit with the specified message.
234
+ * @param projectDir - The working tree directory path
235
+ * @param bareRepoPath - The bare git repository path
236
+ * @param message - The commit message
237
+ * @param relativeFilepaths - Array of file paths relative to projectDir to commit
238
+ * @returns Promise resolving to the new commit's hash
239
+ */
240
+ async function storeFileState({ projectDir, bareRepoPath, message, relativeFilepaths: relativeFilepaths, }) {
241
+ await gitAddAll({
242
+ projectDir,
243
+ bareRepoPath,
244
+ relativeFilepaths,
245
+ });
246
+ return await gitCommit({ projectDir, bareRepoPath, message });
247
+ }
248
+ /**
249
+ * Restores the working directory and index to match the specified commit.
250
+ * Equivalent to `git reset --hard`
251
+ * First attempts to use native git commands, falling back to isomorphic-git if unavailable.
252
+ * @param projectDir - The working tree directory path
253
+ * @param bareRepoPath - The bare git repository path
254
+ * @param commit - The commit hash to restore to
255
+ * @param relativeFilepaths - Array of file paths relative to projectDir to restore
256
+ */
257
+ async function restoreFileState({ projectDir, bareRepoPath, commit, relativeFilepaths, }) {
258
+ let resetDone = false;
259
+ if ((0, git_1.gitCommandIsAvailable)()) {
260
+ try {
261
+ (0, child_process_1.execFileSync)('git', [
262
+ '--git-dir',
263
+ bareRepoPath,
264
+ '--work-tree',
265
+ projectDir,
266
+ 'reset',
267
+ '--hard',
268
+ commit,
269
+ ]);
270
+ return;
271
+ }
272
+ catch (error) {
273
+ // Failed to use git, continue to isomorphic-git implementation
274
+ }
275
+ }
276
+ // Update the working directory to reflect the specified commit
277
+ await (0, isomorphic_git_1.checkout)({
278
+ fs: fs_1.default,
279
+ dir: projectDir,
280
+ gitdir: bareRepoPath,
281
+ ref: commit,
282
+ filepaths: relativeFilepaths,
283
+ force: true,
284
+ });
285
+ // Reset the index to match the specified commit
286
+ await Promise.all(relativeFilepaths.map((filepath) => (0, isomorphic_git_1.resetIndex)({
287
+ fs: fs_1.default,
288
+ dir: projectDir,
289
+ gitdir: bareRepoPath,
290
+ filepath,
291
+ ref: commit,
292
+ })));
293
+ }
294
+ //# sourceMappingURL=file-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-manager.js","sourceRoot":"","sources":["../../src/checkpoints/file-manager.ts"],"names":[],"mappings":";;;;;;AA0BA,0CAGC;AAUD,8CAwCC;AAQD,0CAuBC;AASD,0EAoCC;AAmJD,wCAkBC;AAWD,4CAmDC;AA9XD,iDAA4C;AAC5C,mCAAmC;AACnC,4CAAmB;AA+XV,aA/XF,YAAE,CA+XE;AA9XX,4CAAmB;AACnB,+BAA2B;AAE3B,mDASuB;AAEvB,oDAAoD;AACpD,sCAAoD;AAEpD;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,YAAY,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACnE,OAAO,IAAA,WAAI,EAAC,IAAA,iCAAiB,GAAE,EAAE,YAAY,CAAC,CAAA;AAChD,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,iBAAiB,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rC;IACC,MAAM,SAAS,CAAC;QACd,UAAU;QACV,YAAY;QACZ,iBAAiB;KAClB,CAAC,CAAA;IAEF,OAAO,MAAM,SAAS,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,gBAAgB,CAAC,EACrC,UAAU,EACV,YAAY,EACZ,MAAM,EACN,iBAAiB,GAMlB;IACC,IAAI,SAAS,GAAG,KAAK,CAAA;IACrB,IAAI,IAAA,2BAAqB,GAAE,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,IAAA,4BAAY,EAAC,KAAK,EAAE;gBAClB,WAAW;gBACX,YAAY;gBACZ,aAAa;gBACb,UAAU;gBACV,OAAO;gBACP,QAAQ;gBACR,MAAM;aACP,CAAC,CAAA;YACF,OAAM;QACR,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,+DAA+D;QACjE,CAAC;IACH,CAAC;IAED,+DAA+D;IAC/D,MAAM,IAAA,yBAAQ,EAAC;QACb,EAAE,EAAF,YAAE;QACF,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,YAAY;QACpB,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,iBAAiB;QAC5B,KAAK,EAAE,IAAI;KACZ,CAAC,CAAA;IAEF,gDAAgD;IAChD,MAAM,OAAO,CAAC,GAAG,CACf,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,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"}
@@ -0,0 +1,9 @@
1
+ export interface CliParam {
2
+ flags: string;
3
+ description: string;
4
+ menuDescription?: string;
5
+ menuDetails?: string[];
6
+ hidden?: boolean;
7
+ }
8
+ export declare const cliArguments: CliParam[];
9
+ export declare const cliOptions: CliParam[];