devez-vibe 1.9.35 → 1.9.36
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 +63 -0
- package/package.json +1 -1
package/bin/dvz.exe
CHANGED
|
Binary file
|
|
@@ -1485,11 +1485,41 @@ async function createSession(params, resumeId) {
|
|
|
1485
1485
|
session.model = visibleModel(capabilities.value);
|
|
1486
1486
|
}
|
|
1487
1487
|
session.effort = supportedEffort(capabilities, params.effort);
|
|
1488
|
+
watchMcpStartup(session);
|
|
1488
1489
|
const account = initialization.account || await safeAccount(agentQuery);
|
|
1489
1490
|
const usage = await safeUsage(agentQuery);
|
|
1490
1491
|
return { session, initialization, account, usage };
|
|
1491
1492
|
}
|
|
1492
1493
|
|
|
1494
|
+
// Claude connects MCP servers in the background and reports a failure only
|
|
1495
|
+
// through mcpServerStatus(). Once nothing is pending, each failed or signed-out
|
|
1496
|
+
// server goes to the host as Codex's startup notification, so both providers
|
|
1497
|
+
// warn the same way. The first look waits a second so the host already knows
|
|
1498
|
+
// this thread when the notice arrives.
|
|
1499
|
+
async function watchMcpStartup(session, attempts = 30, delay = 1000) {
|
|
1500
|
+
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
1501
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1502
|
+
if (sessions.get(session.id) !== session) return;
|
|
1503
|
+
let statuses;
|
|
1504
|
+
try { statuses = await session.query.mcpServerStatus(); } catch { return; }
|
|
1505
|
+
if (!Array.isArray(statuses)) return;
|
|
1506
|
+
if (statuses.some((server) => server?.status === "pending")) continue;
|
|
1507
|
+
for (const server of statuses) {
|
|
1508
|
+
if (server?.status !== "failed" && server?.status !== "needs-auth") continue;
|
|
1509
|
+
const source = server.source || server.scope;
|
|
1510
|
+
notify("mcpServer/startupStatus/updated", {
|
|
1511
|
+
threadId: session.id,
|
|
1512
|
+
name: String(server.name || "MCP"),
|
|
1513
|
+
status: "failed",
|
|
1514
|
+
...(server.status === "needs-auth" ? { failureReason: "authenticationRequired" } : {}),
|
|
1515
|
+
...(server.error ? { error: String(server.error) } : {}),
|
|
1516
|
+
...(source ? { source: String(source) } : {}),
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1493
1523
|
async function safeAccount(agentQuery) {
|
|
1494
1524
|
try { return await agentQuery.accountInfo(); } catch { return null; }
|
|
1495
1525
|
}
|
|
@@ -4252,6 +4282,39 @@ async function runSelfTest() {
|
|
|
4252
4282
|
if (reconnected.join(",") !== "connected,disabled") {
|
|
4253
4283
|
throw new Error(`Claude MCP reconnect self-test failed: ${reconnected.join(",")}`);
|
|
4254
4284
|
}
|
|
4285
|
+
// Startup failures wait out pending servers, then go out once each.
|
|
4286
|
+
const startupPolls = [
|
|
4287
|
+
[{ name: "slow", status: "pending" }],
|
|
4288
|
+
[
|
|
4289
|
+
{ name: "ok", status: "connected" },
|
|
4290
|
+
{ name: "broken", status: "failed", error: "HTTP 401: token_expired" },
|
|
4291
|
+
{ name: "claude.ai Notion", status: "needs-auth", scope: "claudeai" },
|
|
4292
|
+
],
|
|
4293
|
+
];
|
|
4294
|
+
const startupSession = {
|
|
4295
|
+
id: "mcp-startup-self-test",
|
|
4296
|
+
query: { mcpServerStatus: async () => startupPolls.shift() || [] },
|
|
4297
|
+
};
|
|
4298
|
+
sessions.set(startupSession.id, startupSession);
|
|
4299
|
+
const startupNotices = [];
|
|
4300
|
+
const startupWrite = process.stdout.write;
|
|
4301
|
+
process.stdout.write = (chunk) => { startupNotices.push(JSON.parse(String(chunk))); return true; };
|
|
4302
|
+
try {
|
|
4303
|
+
await watchMcpStartup(startupSession, 3, 0);
|
|
4304
|
+
} finally {
|
|
4305
|
+
process.stdout.write = startupWrite;
|
|
4306
|
+
sessions.delete(startupSession.id);
|
|
4307
|
+
}
|
|
4308
|
+
const startupNames = startupNotices.map((notice) => notice.params?.name).join(",");
|
|
4309
|
+
if (startupNames !== "broken,claude.ai Notion"
|
|
4310
|
+
|| startupNotices.some((notice) => notice.method !== "mcpServer/startupStatus/updated"
|
|
4311
|
+
|| notice.params?.threadId !== startupSession.id
|
|
4312
|
+
|| notice.params?.status !== "failed")
|
|
4313
|
+
|| startupNotices[0].params.error !== "HTTP 401: token_expired"
|
|
4314
|
+
|| startupNotices[1].params.failureReason !== "authenticationRequired"
|
|
4315
|
+
|| startupNotices[1].params.source !== "claudeai") {
|
|
4316
|
+
throw new Error(`Claude MCP startup self-test failed: ${JSON.stringify(startupNotices)}`);
|
|
4317
|
+
}
|
|
4255
4318
|
const user = (uuid, text) => ({
|
|
4256
4319
|
type: "user",
|
|
4257
4320
|
uuid,
|