@ccpocket/bridge 1.40.0 → 1.42.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/codex-process.d.ts +8 -0
- package/dist/codex-process.js +58 -7
- package/dist/codex-process.js.map +1 -1
- package/dist/parser.d.ts +5 -0
- package/dist/parser.js +9 -0
- package/dist/parser.js.map +1 -1
- package/dist/session.d.ts +2 -0
- package/dist/session.js +4 -0
- package/dist/session.js.map +1 -1
- package/dist/sessions-index.d.ts +1 -0
- package/dist/sessions-index.js +15 -0
- package/dist/sessions-index.js.map +1 -1
- package/dist/websocket.js +29 -5
- package/dist/websocket.js.map +1 -1
- package/package.json +1 -1
package/dist/websocket.js
CHANGED
|
@@ -257,7 +257,7 @@ export class BridgeWebSocketServer {
|
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
buildSessionCreatedMessage(params) {
|
|
260
|
-
const { sessionId, provider, projectPath, session, permissionMode, executionMode, planMode, sandboxMode, slashCommands, skills, skillMetadata, apps, appMetadata, sourceSessionId, } = params;
|
|
260
|
+
const { sessionId, provider, projectPath, session, permissionMode, executionMode, planMode, approvalsReviewer, sandboxMode, slashCommands, skills, skillMetadata, apps, appMetadata, sourceSessionId, } = params;
|
|
261
261
|
const msg = {
|
|
262
262
|
type: "system",
|
|
263
263
|
subtype: "session_created",
|
|
@@ -269,6 +269,11 @@ export class BridgeWebSocketServer {
|
|
|
269
269
|
permissionMode: permissionMode,
|
|
270
270
|
}
|
|
271
271
|
: {}),
|
|
272
|
+
...((approvalsReviewer ?? session?.codexSettings?.approvalsReviewer)
|
|
273
|
+
? {
|
|
274
|
+
approvalsReviewer: approvalsReviewer ?? session?.codexSettings?.approvalsReviewer,
|
|
275
|
+
}
|
|
276
|
+
: {}),
|
|
272
277
|
...((executionMode ??
|
|
273
278
|
(session?.process instanceof SdkProcess
|
|
274
279
|
? session.process.permissionMode === "bypassPermissions"
|
|
@@ -541,6 +546,7 @@ export class BridgeWebSocketServer {
|
|
|
541
546
|
normalizeCodexApprovalPolicy(executionMode === "fullAccess"
|
|
542
547
|
? "never"
|
|
543
548
|
: "on-request"),
|
|
549
|
+
approvalsReviewer: msg.approvalsReviewer,
|
|
544
550
|
sandboxMode: sandboxModeToInternal(msg.sandboxMode),
|
|
545
551
|
model: msg.model,
|
|
546
552
|
modelReasoningEffort: msg.modelReasoningEffort ?? undefined,
|
|
@@ -573,6 +579,7 @@ export class BridgeWebSocketServer {
|
|
|
573
579
|
: executionMode,
|
|
574
580
|
planMode: provider === "claude" ? effectivePlanMode : planMode,
|
|
575
581
|
sandboxMode: msg.sandboxMode,
|
|
582
|
+
approvalsReviewer: createdSession?.codexSettings?.approvalsReviewer,
|
|
576
583
|
...(cached
|
|
577
584
|
? {
|
|
578
585
|
slashCommands: cached.slashCommands,
|
|
@@ -898,9 +905,13 @@ export class BridgeWebSocketServer {
|
|
|
898
905
|
: "default";
|
|
899
906
|
const currentApproval = session.process
|
|
900
907
|
.approvalPolicy;
|
|
908
|
+
const currentReviewer = session.process
|
|
909
|
+
.approvalsReviewer;
|
|
910
|
+
const newReviewer = msg.approvalsReviewer ?? currentReviewer;
|
|
901
911
|
const currentCollaboration = session.process
|
|
902
912
|
.collaborationMode;
|
|
903
913
|
if (newApproval === currentApproval &&
|
|
914
|
+
newReviewer === currentReviewer &&
|
|
904
915
|
newCollaboration === currentCollaboration) {
|
|
905
916
|
break; // No change needed
|
|
906
917
|
}
|
|
@@ -910,6 +921,9 @@ export class BridgeWebSocketServer {
|
|
|
910
921
|
if (newApproval !== currentApproval) {
|
|
911
922
|
process.setApprovalPolicy(newApproval);
|
|
912
923
|
}
|
|
924
|
+
if (newReviewer !== currentReviewer) {
|
|
925
|
+
process.setApprovalsReviewer(newReviewer);
|
|
926
|
+
}
|
|
913
927
|
if (newCollaboration !== currentCollaboration) {
|
|
914
928
|
process.setCollaborationMode(newCollaboration);
|
|
915
929
|
}
|
|
@@ -921,6 +935,7 @@ export class BridgeWebSocketServer {
|
|
|
921
935
|
permissionMode: legacyPermissionMode,
|
|
922
936
|
executionMode,
|
|
923
937
|
approvalPolicy: newApproval,
|
|
938
|
+
approvalsReviewer: newReviewer,
|
|
924
939
|
planMode,
|
|
925
940
|
});
|
|
926
941
|
this.broadcastSessionList();
|
|
@@ -928,12 +943,12 @@ export class BridgeWebSocketServer {
|
|
|
928
943
|
direction: "internal",
|
|
929
944
|
channel: "bridge",
|
|
930
945
|
type: "permission_mode_changed",
|
|
931
|
-
detail: `mode=${msg.mode} approval=${newApproval} collaboration=${newCollaboration} applied=in-place`,
|
|
946
|
+
detail: `mode=${msg.mode} approval=${newApproval} reviewer=${newReviewer} collaboration=${newCollaboration} applied=in-place`,
|
|
932
947
|
});
|
|
933
|
-
console.log(`[ws] set_permission_mode(codex): execution=${executionMode} plan=${planMode} → approval=${newApproval}, collaboration=${newCollaboration} (in-place)`);
|
|
948
|
+
console.log(`[ws] set_permission_mode(codex): execution=${executionMode} plan=${planMode} → approval=${newApproval}, reviewer=${newReviewer}, collaboration=${newCollaboration} (in-place)`);
|
|
934
949
|
break;
|
|
935
950
|
}
|
|
936
|
-
console.log(`[ws] set_permission_mode(codex): execution=${executionMode} plan=${planMode} → approval=${newApproval}, collaboration=${newCollaboration} (restart)`);
|
|
951
|
+
console.log(`[ws] set_permission_mode(codex): execution=${executionMode} plan=${planMode} → approval=${newApproval}, reviewer=${newReviewer}, collaboration=${newCollaboration} (restart)`);
|
|
937
952
|
const oldSessionId = session.id;
|
|
938
953
|
const threadId = session.claudeSessionId;
|
|
939
954
|
const projectPath = session.projectPath;
|
|
@@ -950,6 +965,7 @@ export class BridgeWebSocketServer {
|
|
|
950
965
|
? { existingWorktreePath: worktreePath, worktreeBranch }
|
|
951
966
|
: undefined, "codex", {
|
|
952
967
|
approvalPolicy: newApproval,
|
|
968
|
+
approvalsReviewer: newReviewer,
|
|
953
969
|
sandboxMode: oldSettings.sandboxMode,
|
|
954
970
|
model: oldSettings.model,
|
|
955
971
|
modelReasoningEffort: oldSettings.modelReasoningEffort,
|
|
@@ -971,6 +987,7 @@ export class BridgeWebSocketServer {
|
|
|
971
987
|
sandboxMode: oldSettings.sandboxMode
|
|
972
988
|
? sandboxModeToExternal(oldSettings.sandboxMode)
|
|
973
989
|
: undefined,
|
|
990
|
+
approvalsReviewer: newReviewer,
|
|
974
991
|
sourceSessionId: oldSessionId,
|
|
975
992
|
}));
|
|
976
993
|
this.broadcastSessionList();
|
|
@@ -1006,6 +1023,7 @@ export class BridgeWebSocketServer {
|
|
|
1006
1023
|
const newId = this.sessionManager.create(effectiveProjectPath, undefined, pastMessages, worktreeOpts, "codex", {
|
|
1007
1024
|
threadId,
|
|
1008
1025
|
approvalPolicy: newApproval,
|
|
1026
|
+
approvalsReviewer: newReviewer,
|
|
1009
1027
|
sandboxMode: oldSettings.sandboxMode,
|
|
1010
1028
|
model: oldSettings.model,
|
|
1011
1029
|
modelReasoningEffort: oldSettings.modelReasoningEffort,
|
|
@@ -1029,6 +1047,7 @@ export class BridgeWebSocketServer {
|
|
|
1029
1047
|
sandboxMode: oldSettings.sandboxMode
|
|
1030
1048
|
? sandboxModeToExternal(oldSettings.sandboxMode)
|
|
1031
1049
|
: undefined,
|
|
1050
|
+
approvalsReviewer: newReviewer,
|
|
1032
1051
|
sourceSessionId: oldSessionId,
|
|
1033
1052
|
}));
|
|
1034
1053
|
this.broadcastSessionList();
|
|
@@ -1038,7 +1057,7 @@ export class BridgeWebSocketServer {
|
|
|
1038
1057
|
direction: "internal",
|
|
1039
1058
|
channel: "bridge",
|
|
1040
1059
|
type: "permission_mode_changed",
|
|
1041
|
-
detail: `mode=${msg.mode} approval=${newApproval} collaboration=${newCollaboration} thread=${threadId} oldSession=${oldSessionId}`,
|
|
1060
|
+
detail: `mode=${msg.mode} approval=${newApproval} reviewer=${newReviewer} collaboration=${newCollaboration} thread=${threadId} oldSession=${oldSessionId}`,
|
|
1042
1061
|
});
|
|
1043
1062
|
console.log(`[ws] Permission mode change: created new session ${newId} (thread=${threadId}, mode=${msg.mode})`);
|
|
1044
1063
|
})
|
|
@@ -1675,6 +1694,7 @@ export class BridgeWebSocketServer {
|
|
|
1675
1694
|
profile: msg.profile,
|
|
1676
1695
|
approvalPolicy: codexApprovalPolicy ??
|
|
1677
1696
|
normalizeCodexApprovalPolicy(executionMode === "fullAccess" ? "never" : "on-request"),
|
|
1697
|
+
approvalsReviewer: msg.approvalsReviewer,
|
|
1678
1698
|
sandboxMode: sandboxModeToInternal(msg.sandboxMode),
|
|
1679
1699
|
model: msg.model,
|
|
1680
1700
|
modelReasoningEffort: msg.modelReasoningEffort ?? undefined,
|
|
@@ -1695,6 +1715,7 @@ export class BridgeWebSocketServer {
|
|
|
1695
1715
|
sandboxMode: createdSession?.codexSettings?.sandboxMode
|
|
1696
1716
|
? sandboxModeToExternal(createdSession.codexSettings.sandboxMode)
|
|
1697
1717
|
: undefined,
|
|
1718
|
+
approvalsReviewer: createdSession?.codexSettings?.approvalsReviewer,
|
|
1698
1719
|
permissionMode: legacyPermissionMode,
|
|
1699
1720
|
executionMode,
|
|
1700
1721
|
planMode,
|
|
@@ -3763,6 +3784,9 @@ export class BridgeWebSocketServer {
|
|
|
3763
3784
|
if (session.codexSettings.approvalPolicy !== undefined) {
|
|
3764
3785
|
msg.approvalPolicy = session.codexSettings.approvalPolicy;
|
|
3765
3786
|
}
|
|
3787
|
+
if (session.codexSettings.approvalsReviewer !== undefined) {
|
|
3788
|
+
msg.approvalsReviewer = session.codexSettings.approvalsReviewer;
|
|
3789
|
+
}
|
|
3766
3790
|
if (session.codexSettings.sandboxMode !== undefined) {
|
|
3767
3791
|
msg.sandboxMode = session.codexSettings.sandboxMode;
|
|
3768
3792
|
}
|