cc-viewer 1.7.1 → 1.7.3
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/cli.js +21 -3
- package/dist/assets/{App-gUSmU6Ny.js → App-DRsuJXEw.js} +1 -1
- package/dist/assets/{MdxEditorPanel-DAR39A3S.js → MdxEditorPanel-D_dewIIc.js} +1 -1
- package/dist/assets/{Mobile-qfRsRth0.js → Mobile-BIzb7vpA.js} +1 -1
- package/dist/assets/{index-B51Ci0GL.js → index-DidP9FCD.js} +2 -2
- package/dist/assets/{seqResourceLoaders-DZJxMMaR.js → seqResourceLoaders-BtGpfGRW.js} +2 -2
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/i18n.js +20 -0
- package/server/interceptor.js +45 -1
- package/server/lib/ensure-hooks.js +28 -2
- package/server/lib/log-management.js +1 -0
- package/server/lib/log-watcher.js +8 -0
- package/server/lib/pid-alive.js +15 -0
- package/server/lib/session-start-bridge.js +121 -0
- package/server/lib/settings-merge.js +170 -0
- package/server/lib/stats-worker.js +21 -2
- package/server/lib/v2/adapter.js +52 -12
- package/server/lib/v2/journal.js +9 -5
- package/server/lib/v2/jsonl-read.js +127 -0
- package/server/lib/v2/live-feed.js +302 -66
- package/server/lib/v2/meta-rows.js +22 -21
- package/server/lib/v2/replay.js +5 -5
- package/server/lib/v2/session-owner.js +135 -0
- package/server/lib/v2/session-select.js +84 -4
- package/server/lib/v2/v2-writer.js +181 -6
- package/server/pty-manager.js +28 -4
- package/server/routes/events.js +44 -0
- package/server/routes/im.js +1 -1
- package/server/server.js +4 -1
- package/server/workspace-registry.js +5 -0
package/server/routes/im.js
CHANGED
|
@@ -259,7 +259,7 @@ function imLogs(req, res, parsedUrl, isLocal, deps) {
|
|
|
259
259
|
try {
|
|
260
260
|
// wire-v2: prefer the newest v2 session (by meta.startTs, journal mtime as
|
|
261
261
|
// tie-break); fall back to legacy v1 files until they are migrated.
|
|
262
|
-
const sessions = listV2Sessions(join(LOG_DIR, project)).filter((s) => !s.leader);
|
|
262
|
+
const sessions = listV2Sessions(join(LOG_DIR, project)).filter((s) => !s.leader && !s.discard);
|
|
263
263
|
if (sessions.length > 0) {
|
|
264
264
|
sessions.sort((a, b) => (a.startTs < b.startTs ? 1 : a.startTs > b.startTs ? -1 : 0));
|
|
265
265
|
latest = `v2:${project}/${sessions[0].sid}`; // 直接喂给 /api/local-log?file=
|
package/server/server.js
CHANGED
|
@@ -76,7 +76,7 @@ function execWithStdin(cmd, args, input, options) {
|
|
|
76
76
|
child.stdin.end();
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
import { _initPromise, _projectName, _logDir, _v2Writer, streamingState, resetStreamingState, PROFILE_PATH, setLivePort, getImLiveText, resetImLiveText } from './interceptor.js';
|
|
79
|
+
import { _initPromise, _projectName, _logDir, _v2Writer, streamingState, resetStreamingState, PROFILE_PATH, setLivePort, getImLiveText, resetImLiveText, markSessionStart } from './interceptor.js';
|
|
80
80
|
import { V2LiveFeed } from './lib/v2/live-feed.js';
|
|
81
81
|
import { sanitizePathComponent } from './lib/v2/layout.js';
|
|
82
82
|
import { maybeResumeConvert } from './lib/v2/convert-manager.js';
|
|
@@ -554,6 +554,9 @@ const deps = {
|
|
|
554
554
|
startLogWatch,
|
|
555
555
|
stopLogWatch,
|
|
556
556
|
scheduleTurnEndBroadcast: _scheduleTurnEndBroadcast,
|
|
557
|
+
// SessionStart hook notify → conversation-switch signal (in-terminal
|
|
558
|
+
// /resume). The source gate + V2Writer re-bind live in the interceptor.
|
|
559
|
+
onSessionStartNotify: markSessionStart,
|
|
557
560
|
ensureImWatch: _ensureImWatch,
|
|
558
561
|
maskProfiles: _maskProfiles,
|
|
559
562
|
maskApiKey: _maskApiKey,
|
|
@@ -4,6 +4,7 @@ import { readdir, stat } from 'node:fs/promises';
|
|
|
4
4
|
import { renameSyncWithRetry } from './lib/file-api.js';
|
|
5
5
|
import { withFileLockAsync } from './lib/async-file-lock.js';
|
|
6
6
|
import { dirSizeSync } from './lib/v2/layout.js';
|
|
7
|
+
import { isDiscardableSession } from './lib/v2/session-select.js';
|
|
7
8
|
import { join, basename, resolve } from 'node:path';
|
|
8
9
|
import { randomBytes } from 'node:crypto';
|
|
9
10
|
import { LOG_DIR } from '../findcc.js';
|
|
@@ -117,6 +118,10 @@ export async function getWorkspaces() {
|
|
|
117
118
|
const sessionDir = join(logDir, 'sessions', e.name);
|
|
118
119
|
try {
|
|
119
120
|
await stat(join(sessionDir, 'journal.jsonl'));
|
|
121
|
+
// Quota-probe orphans must not count: logCount>0 drives the
|
|
122
|
+
// auto -c heuristic, and a probe-only workspace would auto-continue
|
|
123
|
+
// into a conversation that does not exist (2026-07-16).
|
|
124
|
+
if (isDiscardableSession(sessionDir)) continue;
|
|
120
125
|
// Folder size, not journal size — conv/blob/response files carry
|
|
121
126
|
// most of a session's bytes (journal alone undercounts ~12x).
|
|
122
127
|
totalSize += dirSizeSync(sessionDir);
|