devez-vibe 1.3.24 → 1.3.26
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/bin/dvz.exe +0 -0
- package/bridge/claude-agent-sdk-bridge.mjs +41 -12
- package/package.json +1 -1
package/bin/dvz.exe
CHANGED
|
Binary file
|
|
@@ -1847,6 +1847,30 @@ async function processResult(session, message) {
|
|
|
1847
1847
|
await runPendingPrompt(session);
|
|
1848
1848
|
}
|
|
1849
1849
|
|
|
1850
|
+
// Compaction ends the turn's only assistant message, so the context figure would
|
|
1851
|
+
// stay at its pre-compact value until the next turn answers. `post_tokens` is the
|
|
1852
|
+
// window right after the summary replaced the history: publish it at once.
|
|
1853
|
+
function noteCompactBoundary(session, metadata) {
|
|
1854
|
+
const post = Number(metadata?.post_tokens);
|
|
1855
|
+
if (!Number.isFinite(post) || post <= 0) return;
|
|
1856
|
+
session.lastContextUsage = {
|
|
1857
|
+
inputTokens: post,
|
|
1858
|
+
cachedInputTokens: 0,
|
|
1859
|
+
cacheWriteInputTokens: 0,
|
|
1860
|
+
outputTokens: 0,
|
|
1861
|
+
totalTokens: post,
|
|
1862
|
+
};
|
|
1863
|
+
notify("thread/tokenUsage/updated", {
|
|
1864
|
+
threadId: session.id,
|
|
1865
|
+
// No `total`: the running tally belongs to billing and compaction spends
|
|
1866
|
+
// nothing on it.
|
|
1867
|
+
tokenUsage: {
|
|
1868
|
+
last: session.lastContextUsage,
|
|
1869
|
+
modelContextWindow: session.lastContextWindow || undefined,
|
|
1870
|
+
},
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1850
1874
|
function rememberPermissionDenial(session, denial) {
|
|
1851
1875
|
const toolUseId = String(denial.toolUseId || "");
|
|
1852
1876
|
const existing = toolUseId
|
|
@@ -1910,6 +1934,7 @@ async function consume(session) {
|
|
|
1910
1934
|
else if (message.type === "user") processUser(session, message);
|
|
1911
1935
|
else if (message.type === "result") await processResult(session, message);
|
|
1912
1936
|
else if (message.type === "system" && message.subtype === "compact_boundary") {
|
|
1937
|
+
noteCompactBoundary(session, message.compact_metadata);
|
|
1913
1938
|
notify("thread/compacted", { threadId: session.id });
|
|
1914
1939
|
} else if (message.type === "system" && message.subtype === "permission_denied") {
|
|
1915
1940
|
rememberPermissionDenial(session, {
|
|
@@ -2097,18 +2122,22 @@ function historyState(messages) {
|
|
|
2097
2122
|
const userText = message.type === "user"
|
|
2098
2123
|
? stripInternalTags(stripHandoff(blocks.filter((block) => block.type === "text").map((block) => block.text || "").join("\n")))
|
|
2099
2124
|
: "";
|
|
2100
|
-
if (userText
|
|
2101
|
-
&& !blocks.some((block) => block.type === "tool_result")
|
|
2102
|
-
&& !isInternalHistoryText(message, userText)) {
|
|
2103
|
-
turn = {
|
|
2104
|
-
id: `claude-turn-${message.uuid}`,
|
|
2105
|
-
status: "completed",
|
|
2106
|
-
items: [{ id: `claude-user-${message.uuid}`, type: "userMessage", content: [{ type: "text", text: userText }] }],
|
|
2107
|
-
};
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2125
|
+
if (userText
|
|
2126
|
+
&& !blocks.some((block) => block.type === "tool_result")
|
|
2127
|
+
&& !isInternalHistoryText(message, userText)) {
|
|
2128
|
+
turn = {
|
|
2129
|
+
id: `claude-turn-${message.uuid}`,
|
|
2130
|
+
status: "completed",
|
|
2131
|
+
items: [{ id: `claude-user-${message.uuid}`, type: "userMessage", content: [{ type: "text", text: userText }] }],
|
|
2132
|
+
};
|
|
2133
|
+
const startedAt = messageTime(message);
|
|
2134
|
+
if (startedAt != null) turn.startedAt = Math.floor(startedAt / 1000);
|
|
2135
|
+
turns.push(turn);
|
|
2136
|
+
}
|
|
2137
|
+
if (!turn) continue;
|
|
2138
|
+
const completedAt = messageTime(message);
|
|
2139
|
+
if (completedAt != null) turn.completedAt = Math.floor(completedAt / 1000);
|
|
2140
|
+
if (message.type === "assistant") {
|
|
2112
2141
|
if (message.message?.model === "<synthetic>") {
|
|
2113
2142
|
turn.synthetic = true;
|
|
2114
2143
|
continue;
|