@ccpocket/bridge 1.50.0 → 1.51.0

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.
package/dist/websocket.js CHANGED
@@ -13,7 +13,7 @@ import { getAllRecentSessions, getCodexSessionHistory, getSessionHistory, findSe
13
13
  import { ArchiveStore } from "./archive-store.js";
14
14
  import { WorktreeStore } from "./worktree-store.js";
15
15
  import { listWorktrees, removeWorktree, worktreeExists, getMainBranch, } from "./worktree.js";
16
- import { stageFiles, stageHunks, unstageFiles, unstageHunks, gitCommit, gitPush, listGitFiles, listBranches, createBranch, checkoutBranch, revertFiles, revertHunks, gitFetch, gitPull, gitRemoteStatus, } from "./git-operations.js";
16
+ import { stageFiles, stageHunks, unstageFiles, unstageHunks, gitCommit, gitPush, listGitFiles, listBranches, createBranch, checkoutBranch, revertFiles, revertHunks, gitFetch, gitPull, gitRemoteStatus, gitStatus, } from "./git-operations.js";
17
17
  import { generateCommitMessage } from "./git-assist.js";
18
18
  import { listWindows, takeScreenshot } from "./screenshot.js";
19
19
  import { DebugTraceStore } from "./debug-trace-store.js";
@@ -2877,6 +2877,65 @@ export class BridgeWebSocketServer {
2877
2877
  }
2878
2878
  break;
2879
2879
  }
2880
+ case "git_status": {
2881
+ if (!this.isPathAllowed(msg.projectPath)) {
2882
+ this.send(ws, {
2883
+ type: "git_status_result",
2884
+ sessionId: msg.sessionId,
2885
+ projectPath: msg.projectPath,
2886
+ hasUncommittedChanges: false,
2887
+ stagedCount: 0,
2888
+ unstagedCount: 0,
2889
+ untrackedCount: 0,
2890
+ remoteStatusIncluded: false,
2891
+ hasRemoteChanges: false,
2892
+ commitsAhead: 0,
2893
+ commitsBehind: 0,
2894
+ hasUpstream: false,
2895
+ error: `Path not allowed: ${msg.projectPath}`,
2896
+ });
2897
+ break;
2898
+ }
2899
+ try {
2900
+ const result = gitStatus(msg.projectPath, {
2901
+ includeRemote: msg.includeRemote,
2902
+ });
2903
+ this.send(ws, {
2904
+ type: "git_status_result",
2905
+ sessionId: msg.sessionId,
2906
+ projectPath: msg.projectPath,
2907
+ hasUncommittedChanges: result.hasUncommittedChanges,
2908
+ stagedCount: result.stagedCount,
2909
+ unstagedCount: result.unstagedCount,
2910
+ untrackedCount: result.untrackedCount,
2911
+ remoteStatusIncluded: result.remoteStatusIncluded,
2912
+ hasRemoteChanges: result.hasRemoteChanges,
2913
+ commitsAhead: result.commitsAhead,
2914
+ commitsBehind: result.commitsBehind,
2915
+ hasUpstream: result.hasUpstream,
2916
+ branch: result.branch,
2917
+ remoteError: result.remoteError,
2918
+ });
2919
+ }
2920
+ catch (err) {
2921
+ this.send(ws, {
2922
+ type: "git_status_result",
2923
+ sessionId: msg.sessionId,
2924
+ projectPath: msg.projectPath,
2925
+ hasUncommittedChanges: false,
2926
+ stagedCount: 0,
2927
+ unstagedCount: 0,
2928
+ untrackedCount: 0,
2929
+ remoteStatusIncluded: false,
2930
+ hasRemoteChanges: false,
2931
+ commitsAhead: 0,
2932
+ commitsBehind: 0,
2933
+ hasUpstream: false,
2934
+ error: String(err),
2935
+ });
2936
+ }
2937
+ break;
2938
+ }
2880
2939
  case "git_remote_status": {
2881
2940
  if (!this.isPathAllowed(msg.projectPath)) {
2882
2941
  this.send(ws, this.buildPathNotAllowedError(msg.projectPath));