cc-viewer 1.9.22 → 1.9.23
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/README.md +1 -1
- package/cli.js +25 -1
- package/dist/assets/{App-BN3viVRq.js → App-DEA3HoZr.js} +2 -2
- package/dist/assets/{MdxEditorPanel-CmHF9Mz1.js → MdxEditorPanel-CTAS2DJv.js} +1 -1
- package/dist/assets/{Mobile-nbI6IeX_.js → Mobile-CgVpXvs2.js} +1 -1
- package/dist/assets/{ProxyStatsModal-Ogrx3mxS.js → ProxyStatsModal-C4sl-cuB.js} +1 -1
- package/dist/assets/index-CS47d9oh.js +2 -0
- package/dist/assets/seqResourceLoaders-CORH46PN.js +2 -0
- package/dist/assets/seqResourceLoaders-v4YzKhTS.css +41 -0
- package/dist/index.html +1 -1
- package/findcc.js +4 -4
- package/node_modules/@ccv/core/src/contentFilter.js +4 -1
- package/node_modules/@ccv/core/src/ultraplanTemplates.js +199 -0
- package/package.json +1 -1
- package/server/i18n.js +4 -0
- package/server/lib/ensure-hooks.js +134 -2
- package/server/lib/im/im-bridge-core.js +16 -0
- package/server/lib/scheduled-task-executor.js +14 -2
- package/server/lib/scheduled-task-store.js +129 -18
- package/server/lib/sdk-manager.js +113 -11
- package/server/pty-manager.js +103 -4
- package/server/routes/scheduled-tasks.js +13 -0
- package/server/server.js +48 -0
- package/dist/assets/index-DoFyHmPM.js +0 -2
- package/dist/assets/seqResourceLoaders-DbccWwKz.css +0 -41
- package/dist/assets/seqResourceLoaders-n9iXZRHx.js +0 -2
package/server/server.js
CHANGED
|
@@ -1660,6 +1660,7 @@ async function _doStart() {
|
|
|
1660
1660
|
getPtyState: pmb.getPtyState,
|
|
1661
1661
|
getPtyKind: pmb.getPtyKind,
|
|
1662
1662
|
getPtySkipPermissions: pmb.getPtySkipPermissions,
|
|
1663
|
+
getPtyBootState: pmb.getPtyBootState,
|
|
1663
1664
|
isStreaming: () => streamingState.active,
|
|
1664
1665
|
getConfig: () => loadConfig(id),
|
|
1665
1666
|
// 钉钉 AI 卡片逐字流式的文本源(仅 worker 注入):对话过程中读主 agent 累计文本,
|
|
@@ -2396,6 +2397,31 @@ async function setupTerminalWebSocket(httpServer) {
|
|
|
2396
2397
|
}
|
|
2397
2398
|
}
|
|
2398
2399
|
|
|
2400
|
+
// Replay the authoritative sdk-task table so a refreshed/reconnected client can
|
|
2401
|
+
// reconcile its delta-only tracker (the active-agents strip) — a task frame lost in
|
|
2402
|
+
// a WS gap is no longer unrecoverable, and a session switch drops the table so the
|
|
2403
|
+
// prior session's agents never linger. Unlike the snapshots above, an EMPTY
|
|
2404
|
+
// `tasks: []` is authoritative (reconciles the client to "no tasks") and must be
|
|
2405
|
+
// sent. Anchor by view instance (exact) else view project — sdk-skills parity. When
|
|
2406
|
+
// the anchor resolves to no session at all, synthesize that empty frame for a bound
|
|
2407
|
+
// view so the reconcile is not silently lost; an unbound view sends nothing.
|
|
2408
|
+
if (isSdkMode && _sdkGetSdkTaskSnapshot) {
|
|
2409
|
+
const anchor = ws._ccvViewInstance
|
|
2410
|
+
? { instanceKey: ws._ccvViewInstance }
|
|
2411
|
+
: (_viewProj ? { project: _viewProj } : null);
|
|
2412
|
+
const taskSnap = anchor ? _sdkGetSdkTaskSnapshot(anchor) : _sdkGetSdkTaskSnapshot();
|
|
2413
|
+
const taskFrame = taskSnap || ((ws._ccvViewInstance || ws._ccvViewProject) ? {
|
|
2414
|
+
type: 'sdk-task-snapshot',
|
|
2415
|
+
...(ws._ccvViewProject ? { project: ws._ccvViewProject } : {}),
|
|
2416
|
+
...(ws._ccvViewInstance ? { instanceKey: ws._ccvViewInstance } : {}),
|
|
2417
|
+
sessionId: null,
|
|
2418
|
+
tasks: [],
|
|
2419
|
+
} : null);
|
|
2420
|
+
if (taskFrame && _sdkFrameForView(taskFrame)) {
|
|
2421
|
+
try { ws.send(JSON.stringify(taskFrame)); } catch {}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2399
2425
|
// Replay the chat-composer busy queue so a refreshed/reconnected page restores the
|
|
2400
2426
|
// floating queued-message bubbles (server is the source of truth in both modes).
|
|
2401
2427
|
replayQueueSnapshot();
|
|
@@ -2573,6 +2599,24 @@ async function setupTerminalWebSocket(httpServer) {
|
|
|
2573
2599
|
try { ws.send(JSON.stringify(stateSnap)); } catch (err) { reportSwallowed('sdk.session-state-replay', err); }
|
|
2574
2600
|
}
|
|
2575
2601
|
}
|
|
2602
|
+
// Replay the authoritative sdk-task table for the JUST-viewed workspace
|
|
2603
|
+
// (skills parity) so switching back to a workspace whose agent is mid-run
|
|
2604
|
+
// restores the active-agents strip immediately, and an empty table clears
|
|
2605
|
+
// a previously viewed workspace's agents. Anchor AND filter against the
|
|
2606
|
+
// freshly-stamped view — _sdkFrameForView closes over the connection-time
|
|
2607
|
+
// _viewProj, which is the departing view on a cross-workspace attach.
|
|
2608
|
+
if (_sdkGetSdkTaskSnapshot) {
|
|
2609
|
+
const taskAnchor = ws._ccvViewInstance
|
|
2610
|
+
? { instanceKey: ws._ccvViewInstance }
|
|
2611
|
+
: (ws._ccvViewProject ? { project: ws._ccvViewProject } : null);
|
|
2612
|
+
const taskSnap = taskAnchor ? _sdkGetSdkTaskSnapshot(taskAnchor) : _sdkGetSdkTaskSnapshot();
|
|
2613
|
+
if (taskSnap) {
|
|
2614
|
+
const fp = (typeof taskSnap.cwd === 'string' && taskSnap.cwd) ? (projectKeyForCwd(taskSnap.cwd) || null) : null;
|
|
2615
|
+
if (!fp || !ws._ccvViewProject || fp === ws._ccvViewProject) {
|
|
2616
|
+
try { ws.send(JSON.stringify(taskSnap)); } catch { }
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2576
2620
|
replayQueueSnapshot();
|
|
2577
2621
|
return;
|
|
2578
2622
|
}
|
|
@@ -4044,6 +4088,10 @@ export function setSdkGetMcpStatusSnapshot(fn) { _sdkGetMcpStatusSnapshot = fn;
|
|
|
4044
4088
|
let _sdkGetSessionStateSnapshot = null;
|
|
4045
4089
|
export function setSdkGetSessionStateSnapshot(fn) { _sdkGetSessionStateSnapshot = fn; }
|
|
4046
4090
|
|
|
4091
|
+
/** Reference to sdk-manager's getSdkTaskSnapshot (set by cli.js after import). */
|
|
4092
|
+
let _sdkGetSdkTaskSnapshot = null;
|
|
4093
|
+
export function setSdkGetSdkTaskSnapshot(fn) { _sdkGetSdkTaskSnapshot = fn; }
|
|
4094
|
+
|
|
4047
4095
|
/** Reference to sdk-manager's sendQueuedNow (set by cli.js after import). */
|
|
4048
4096
|
let _sdkSendQueuedNow = null;
|
|
4049
4097
|
export function setSdkSendQueuedNow(fn) { _sdkSendQueuedNow = fn; }
|