cc-viewer 1.6.14 → 1.6.16
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/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Claude Code Viewer</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico?v=1">
|
|
8
8
|
<link rel="shortcut icon" href="/favicon.ico?v=1">
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-D6AEj7Mx.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-CVCiS6Zl.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/lib/interceptor-core.js
CHANGED
|
@@ -32,7 +32,8 @@ export function isMainAgentRequest(body) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
// v2.1.81+: 轻量 MainAgent 初始请求工具数可能 < 10,降低阈值兼容
|
|
36
|
+
if (body.tools.length > 5) {
|
|
36
37
|
const hasEdit = body.tools.some(t => t.name === 'Edit');
|
|
37
38
|
const hasBash = body.tools.some(t => t.name === 'Bash');
|
|
38
39
|
const hasTaskOrAgent = body.tools.some(t => t.name === 'Task' || t.name === 'Agent');
|
package/lib/kv-cache-analyzer.js
CHANGED
|
@@ -50,8 +50,8 @@ export function isMainAgentEntry(entry) {
|
|
|
50
50
|
if (firstMsgContent.includes('<available-deferred-tools>')) return true;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
//
|
|
54
|
-
if (body.tools.length >
|
|
53
|
+
// v2.1.81+: lightweight MainAgent may have < 10 tools, lowered threshold
|
|
54
|
+
if (body.tools.length > 5) {
|
|
55
55
|
const hasEdit = body.tools.some(t => t.name === 'Edit');
|
|
56
56
|
const hasBash = body.tools.some(t => t.name === 'Bash');
|
|
57
57
|
const hasTaskOrAgent = body.tools.some(t => t.name === 'Task' || t.name === 'Agent');
|
|
@@ -77,12 +77,12 @@ export function extractToolResultText(toolResult) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* Extract cached content from a single MainAgent
|
|
81
|
-
* Returns null if the entry
|
|
80
|
+
* Extract cached content from a single log entry (MainAgent or SubAgent).
|
|
81
|
+
* Returns null if the entry has no body; returns object with empty arrays
|
|
82
|
+
* if no cache_control markers are found.
|
|
82
83
|
*/
|
|
83
84
|
export function extractCachedContent(entry) {
|
|
84
|
-
if (!
|
|
85
|
-
if (!entry.body) return null;
|
|
85
|
+
if (!entry?.body) return null;
|
|
86
86
|
|
|
87
87
|
const body = entry.body;
|
|
88
88
|
const usage = entry.response?.body?.usage;
|
|
@@ -104,7 +104,7 @@ export function extractCachedContent(entry) {
|
|
|
104
104
|
if (lastCacheIndex >= 0) {
|
|
105
105
|
for (let i = 0; i <= lastCacheIndex; i++) {
|
|
106
106
|
const block = body.system[i];
|
|
107
|
-
if (block.type === 'text' && block.text
|
|
107
|
+
if (block.type === 'text' && block.text) result.system.push(block.text);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|