devez-vibe 1.7.90 → 1.7.91
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 -0
- package/package.json +1 -1
package/bin/dvz.exe
CHANGED
|
Binary file
|
|
@@ -1634,6 +1634,19 @@ function processAssistant(session, message) {
|
|
|
1634
1634
|
message.message?.model,
|
|
1635
1635
|
session.model,
|
|
1636
1636
|
);
|
|
1637
|
+
// Usage used to reach the host only with the turn's result, so a session's
|
|
1638
|
+
// first turn read 0k on screen for its whole run. The assistant message
|
|
1639
|
+
// already names the window it occupies, so publish it as it lands. No
|
|
1640
|
+
// `total`: the billing tally is only whole at the result.
|
|
1641
|
+
if (session.lastContextUsage) {
|
|
1642
|
+
notify("thread/tokenUsage/updated", {
|
|
1643
|
+
threadId: session.id,
|
|
1644
|
+
tokenUsage: {
|
|
1645
|
+
last: session.lastContextUsage,
|
|
1646
|
+
modelContextWindow: session.lastContextWindow || undefined,
|
|
1647
|
+
},
|
|
1648
|
+
});
|
|
1649
|
+
}
|
|
1637
1650
|
const content = Array.isArray(message.message?.content) ? message.message.content : [];
|
|
1638
1651
|
// Without partial SDK events, replay completed text before tool items so the
|
|
1639
1652
|
// visible order still matches the assistant content order.
|
|
@@ -4656,6 +4669,34 @@ async function runSelfTest() {
|
|
|
4656
4669
|
if (openingMessageIndex >= 0 || openingToolIndex < 0) {
|
|
4657
4670
|
throw new Error(`Claude tool-first turn self-test failed: ${JSON.stringify(openingEvents)}`);
|
|
4658
4671
|
}
|
|
4672
|
+
const contextCaptured = [];
|
|
4673
|
+
process.stdout.write = (chunk) => {
|
|
4674
|
+
contextCaptured.push(String(chunk));
|
|
4675
|
+
return true;
|
|
4676
|
+
};
|
|
4677
|
+
try {
|
|
4678
|
+
processAssistant(openingSession, {
|
|
4679
|
+
message: {
|
|
4680
|
+
model: "claude-opus-5[1m]",
|
|
4681
|
+
usage: { input_tokens: 400, cache_read_input_tokens: 96_000, output_tokens: 0 },
|
|
4682
|
+
content: [],
|
|
4683
|
+
},
|
|
4684
|
+
});
|
|
4685
|
+
} finally {
|
|
4686
|
+
process.stdout.write = stdoutWrite;
|
|
4687
|
+
}
|
|
4688
|
+
const contextEvent = contextCaptured
|
|
4689
|
+
.join("")
|
|
4690
|
+
.trim()
|
|
4691
|
+
.split("\n")
|
|
4692
|
+
.filter(Boolean)
|
|
4693
|
+
.map((line) => JSON.parse(line))
|
|
4694
|
+
.find((event) => event.method === "thread/tokenUsage/updated");
|
|
4695
|
+
if (contextEvent?.params?.tokenUsage?.last?.totalTokens !== 96_400
|
|
4696
|
+
|| contextEvent.params.tokenUsage.modelContextWindow !== 1_000_000
|
|
4697
|
+
|| contextEvent.params.tokenUsage.total !== undefined) {
|
|
4698
|
+
throw new Error(`Claude mid-turn context self-test failed: ${JSON.stringify(contextEvent)}`);
|
|
4699
|
+
}
|
|
4659
4700
|
const languageCaptured = [];
|
|
4660
4701
|
process.stdout.write = (chunk) => {
|
|
4661
4702
|
languageCaptured.push(String(chunk));
|