cc-viewer 1.9.26 → 1.9.28
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/assets/{App-CkbwkH74.js → App-Bnrz7GjB.js} +2 -2
- package/dist/assets/{ArchivePreview-1XAr8LvB.js → ArchivePreview-CmHAqt4q.js} +1 -1
- package/dist/assets/{AudioPreview-DGcbrJjl.js → AudioPreview-Eob3pVak.js} +1 -1
- package/dist/assets/{MdxEditorPanel-DFGSL5OM.js → MdxEditorPanel-DJdf6Eul.js} +1 -1
- package/dist/assets/{Mobile-DFu8Kn5W.js → Mobile-B3Xlg4aV.js} +1 -1
- package/dist/assets/{ProxyStatsModal-BU9liIIO.js → ProxyStatsModal-Dcwav2dJ.js} +1 -1
- package/dist/assets/{SubtitlePreview-Ca_dpMFL.js → SubtitlePreview-BdALHsYe.js} +1 -1
- package/dist/assets/index-CINNXEHT.js +2 -0
- package/dist/assets/seqResourceLoaders-C49bGFb6.js +2 -0
- package/dist/assets/{seqResourceLoaders-CjAnOisT.css → seqResourceLoaders-CcT9nd09.css} +2 -2
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/lib/attach-buffer.js +52 -13
- package/server/lib/wire-compress.js +8 -4
- package/server/lib/ws-mux.js +193 -64
- package/server/routes/events.js +45 -18
- package/server/server.js +26 -2
- package/dist/assets/index-Dn7twftJ.js +0 -2
- package/dist/assets/seqResourceLoaders-L-Fzax-z.js +0 -2
package/server/server.js
CHANGED
|
@@ -4066,6 +4066,28 @@ async function _doStop() {
|
|
|
4066
4066
|
// are intentionally no pushSdkEntry/setSdkStreamingState shortcuts anymore.
|
|
4067
4067
|
|
|
4068
4068
|
/** Broadcast a message to all terminal WS clients (for SDK canUseTool). */
|
|
4069
|
+
// Approval TERMINAL frames: id-addressed "this pending is over" events. Every client handler
|
|
4070
|
+
// clears ONLY the pending whose id matches (an unmatched id is a no-op), so cross-workspace
|
|
4071
|
+
// delivery adds no state. Routing these through view-narrowing turns a display-scoping
|
|
4072
|
+
// optimization into a correctness dependency: a connection stamp that diverges from the frame's
|
|
4073
|
+
// cwd/instanceKey at fire time silently drops the ONLY close signal — the server-side pending
|
|
4074
|
+
// entry is already deleted, so no reconnect replay can recover it and the modal hangs forever.
|
|
4075
|
+
// Precedents that already deliver these globally: PTY hook frames (routes/ask-perm.js),
|
|
4076
|
+
// _broadcastApprovalCloses, and the client-answer relays (server.js:2888+, 2931+, 3123+).
|
|
4077
|
+
// `ask-hook-cancelled` is deliberately EXCLUDED (it flushes a user message parked behind the
|
|
4078
|
+
// ask). *-auto-cancel and pending/state frames stay narrowed.
|
|
4079
|
+
const ID_ADDRESSED_APPROVAL_CLEARS = new Set([
|
|
4080
|
+
'sdk-plan-resolved', 'sdk-ask-resolved', 'perm-hook-resolved',
|
|
4081
|
+
'sdk-ask-timeout', 'perm-hook-timeout',
|
|
4082
|
+
'ask-hook-resolved', 'ask-hook-timeout', // future-proof: currently direct-sent
|
|
4083
|
+
]);
|
|
4084
|
+
function isIdAddressedApprovalClear(msg) {
|
|
4085
|
+
return !!msg && typeof msg === 'object'
|
|
4086
|
+
&& typeof msg.type === 'string'
|
|
4087
|
+
&& ID_ADDRESSED_APPROVAL_CLEARS.has(msg.type)
|
|
4088
|
+
&& msg.id != null; // raw check: a no-id legacy perm-hook-timeout clears ALL — must stay scoped
|
|
4089
|
+
}
|
|
4090
|
+
|
|
4069
4091
|
export function broadcastWsMessage(msg) { if (terminalWss) {
|
|
4070
4092
|
// SDK multi-session (2026-10-12): a cwd-tagged frame belongs to one workspace's session.
|
|
4071
4093
|
// Route it only to clients viewing that workspace (or the bound view with no ?project=),
|
|
@@ -4086,11 +4108,13 @@ export function broadcastWsMessage(msg) { if (terminalWss) {
|
|
|
4086
4108
|
// killing the surviving twin viewer's spinner and queue bubbles). Untagged/cwd-only
|
|
4087
4109
|
// frames keep the historical project-level behavior.
|
|
4088
4110
|
const frameInstance = (msg && typeof msg === 'object' && typeof msg.instanceKey === 'string' && msg.instanceKey) ? msg.instanceKey : null;
|
|
4111
|
+
// Id-addressed approval terminal frames bypass the narrowing (see the block above).
|
|
4112
|
+
const clearAcrossViews = isIdAddressedApprovalClear(msg);
|
|
4089
4113
|
const str = typeof msg === 'string' ? msg : JSON.stringify(msg);
|
|
4090
4114
|
terminalWss.clients.forEach((c) => {
|
|
4091
4115
|
if (c.readyState !== 1) return;
|
|
4092
|
-
if (frameProj && c._ccvViewProject && c._ccvViewProject !== frameProj) return; // other workspace's frame
|
|
4093
|
-
if (frameInstance && c._ccvViewInstance && c._ccvViewInstance !== frameInstance) return; // other instance of the same project
|
|
4116
|
+
if (!clearAcrossViews && frameProj && c._ccvViewProject && c._ccvViewProject !== frameProj) return; // other workspace's frame
|
|
4117
|
+
if (!clearAcrossViews && frameInstance && c._ccvViewInstance && c._ccvViewInstance !== frameInstance) return; // other instance of the same project
|
|
4094
4118
|
try { c.send(str); } catch {}
|
|
4095
4119
|
});
|
|
4096
4120
|
}
|