devez-vibe 1.11.17 → 1.11.19
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 +83 -9
- package/package.json +50 -50
package/bin/dvz.exe
CHANGED
|
Binary file
|
|
@@ -2045,6 +2045,41 @@ function isClaudeCliCrash(error) {
|
|
|
2045
2045
|
return Number(code) >= 0xC0000000;
|
|
2046
2046
|
}
|
|
2047
2047
|
|
|
2048
|
+
// 충돌한 CLI(PCFILTER 후킹 DLL)가 종료 단계에서 멈추거나 출력 파이프를 남기고 끝나면
|
|
2049
|
+
// SDK는 끝을 몰라 턴이 영원히 실행 중이고 제어 요청에도 답이 없다. 정상 CLI는 1초 안팎에 답한다.
|
|
2050
|
+
// 호스트가 20초 정적 뒤 묻기 시작하므로 마지막 진행에서 100초 뒤에 끊는다.
|
|
2051
|
+
const CLI_PROBE_TIMEOUT_MS = 80_000;
|
|
2052
|
+
const CLI_INTERRUPT_TIMEOUT_MS = 5_000;
|
|
2053
|
+
|
|
2054
|
+
// 시한 안에 성공으로 답했는지. 거절도 false다: 프로세스가 이미 끝나 쓰기가 막힌 경우다.
|
|
2055
|
+
async function cliAnswers(request, ms) {
|
|
2056
|
+
let timer;
|
|
2057
|
+
const expired = new Promise((resolve) => { timer = setTimeout(resolve, ms, false); });
|
|
2058
|
+
try {
|
|
2059
|
+
return await Promise.race([request.then(() => true, () => false), expired]);
|
|
2060
|
+
} finally {
|
|
2061
|
+
clearTimeout(timer);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
// 답하지 않는 CLI를 버린다. 다음 입력은 세션 없음으로 실패해 호스트가 기록에서 다시 연다.
|
|
2066
|
+
function dropUnresponsiveCli(session, query) {
|
|
2067
|
+
if (session.closed || session.query !== query) return;
|
|
2068
|
+
finishTurn(session, new Error("Claude CLI가 응답하지 않아 연결을 끊었습니다. 다음 입력에서 세션을 다시 엽니다."));
|
|
2069
|
+
closeLiveSession(session);
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
// 호스트가 조용한 턴을 물어 올 때 CLI가 살아 있는지도 확인한다.
|
|
2073
|
+
function probeCli(session) {
|
|
2074
|
+
const query = session.query;
|
|
2075
|
+
if (!session.turn || !query || session.cliProbe) return;
|
|
2076
|
+
session.cliProbe = cliAnswers(query.mcpServerStatus(), CLI_PROBE_TIMEOUT_MS).then((alive) => {
|
|
2077
|
+
session.cliProbe = null;
|
|
2078
|
+
if (!alive) dropUnresponsiveCli(session, query);
|
|
2079
|
+
});
|
|
2080
|
+
return session.cliProbe;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2048
2083
|
async function createSession(params, resumeId) {
|
|
2049
2084
|
const id = resumeId || randomUUID();
|
|
2050
2085
|
const queue = new AsyncQueue();
|
|
@@ -4038,7 +4073,9 @@ async function consumeMessage(session, message) {
|
|
|
4038
4073
|
notify("claude/promptSuggestion", { threadId: session.id, suggestion: message.suggestion });
|
|
4039
4074
|
}
|
|
4040
4075
|
} else if (message.type === "rate_limit_event") {
|
|
4076
|
+
// Monitor 등 자동 실행은 첫 응답에서 턴이 열리므로 그 전에 온 한도는 그 턴에 넘긴다.
|
|
4041
4077
|
if (session.turn) session.turn.rateLimitInfo = message.rate_limit_info;
|
|
4078
|
+
else session.pendingRateLimitInfo = message.rate_limit_info;
|
|
4042
4079
|
notify("claude/account/updated", { threadId: session.id, rateLimitInfo: message.rate_limit_info });
|
|
4043
4080
|
} else if (message.type === "system" && message.subtype === "api_retry") {
|
|
4044
4081
|
notify("warning", { threadId: session.id, provider: "Claude", message: `Claude API 재시도 ${message.attempt}/${message.max_retries}` });
|
|
@@ -4293,7 +4330,9 @@ function beginTurn(session, input) {
|
|
|
4293
4330
|
sawStreamText: false,
|
|
4294
4331
|
sawVisibleText: false,
|
|
4295
4332
|
koreanRequest,
|
|
4333
|
+
rateLimitInfo: input === undefined ? session.pendingRateLimitInfo : undefined,
|
|
4296
4334
|
};
|
|
4335
|
+
session.pendingRateLimitInfo = null;
|
|
4297
4336
|
session.lastContextUsage = null;
|
|
4298
4337
|
notify("turn/started", { threadId: session.id, turn: { id: turnId } });
|
|
4299
4338
|
return turnId;
|
|
@@ -4961,6 +5000,7 @@ async function dispatch(method, params = {}) {
|
|
|
4961
5000
|
// it has exited or released it. `sessionMissing` lets the host's stall probe
|
|
4962
5001
|
// end the turn, where a bare "unknown" kept it waiting forever.
|
|
4963
5002
|
if (!session) return { known: false, running: false, turnId: null, sessionMissing: true };
|
|
5003
|
+
probeCli(session);
|
|
4964
5004
|
return { known: true, running: Boolean(session.turn), turnId: session.turn?.id ?? null };
|
|
4965
5005
|
}
|
|
4966
5006
|
if (method === "session/start") {
|
|
@@ -5080,16 +5120,17 @@ async function dispatch(method, params = {}) {
|
|
|
5080
5120
|
}
|
|
5081
5121
|
if (session?.turn) {
|
|
5082
5122
|
const turn = session.turn;
|
|
5123
|
+
const query = session.query;
|
|
5083
5124
|
turn.interruptRequested = true;
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5125
|
+
// A plain interrupt keeps steers the CLI has queued, and they then ran as
|
|
5126
|
+
// a new turn after the stop (measured on 0.3.309). `cancelQueued` drops
|
|
5127
|
+
// them; the runtime has it (capability `interrupt_cancel_queued_v1`)
|
|
5128
|
+
// though the typings do not, and older CLIs ignore the field.
|
|
5129
|
+
const interrupt = withSessionQuery(session, (current) => current.interrupt({ cancelQueued: true }));
|
|
5130
|
+
// 답 없는 중단을 기다리면 호스트 화면이 요청 상한(10분)까지 멈춘다.
|
|
5131
|
+
if (!await cliAnswers(interrupt, CLI_INTERRUPT_TIMEOUT_MS)) {
|
|
5132
|
+
dropUnresponsiveCli(session, query);
|
|
5133
|
+
return {};
|
|
5093
5134
|
}
|
|
5094
5135
|
// Kept open for a steer whose run has not begun: nothing is running to
|
|
5095
5136
|
// send the result that would close it.
|
|
@@ -6908,6 +6949,33 @@ async function runSelfTest() {
|
|
|
6908
6949
|
process.stdout.write = steerWrite;
|
|
6909
6950
|
sessions.delete(steerSession.id);
|
|
6910
6951
|
}
|
|
6952
|
+
// A CLI that stopped answering (hung on exit, or gone with its pipe held) ends
|
|
6953
|
+
// its turn on the quiet-turn probe or Esc instead of leaving the host spinning.
|
|
6954
|
+
if (await cliAnswers(new Promise(() => {}), 10) || !await cliAnswers(Promise.resolve(), 10)) {
|
|
6955
|
+
throw new Error("Claude CLI answer timeout self-test failed");
|
|
6956
|
+
}
|
|
6957
|
+
const deadNotices = [];
|
|
6958
|
+
const deadWrite = process.stdout.write;
|
|
6959
|
+
process.stdout.write = (chunk) => { deadNotices.push(JSON.parse(String(chunk))); return true; };
|
|
6960
|
+
try {
|
|
6961
|
+
const gone = () => Promise.reject(new Error("ProcessTransport is not ready for writing"));
|
|
6962
|
+
for (const [method, query] of [
|
|
6963
|
+
["session/turnStatus", { mcpServerStatus: gone, close() {} }],
|
|
6964
|
+
["session/interrupt", { interrupt: gone, close() {} }],
|
|
6965
|
+
]) {
|
|
6966
|
+
const deadSession = { ...steerSession, id: `dead-cli-${method}`, turn: null, query, pendingPrompts: [] };
|
|
6967
|
+
sessions.set(deadSession.id, deadSession);
|
|
6968
|
+
beginTurn(deadSession);
|
|
6969
|
+
await dispatch(method, { sessionId: deadSession.id });
|
|
6970
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
6971
|
+
const failed = deadNotices.findLast((notice) => notice.method === "turn/completed")?.params?.turn;
|
|
6972
|
+
if (deadSession.turn || sessions.has(deadSession.id) || failed?.status !== "failed") {
|
|
6973
|
+
throw new Error(`Claude unresponsive CLI kept its turn after ${method}: ${JSON.stringify(failed)}`);
|
|
6974
|
+
}
|
|
6975
|
+
}
|
|
6976
|
+
} finally {
|
|
6977
|
+
process.stdout.write = deadWrite;
|
|
6978
|
+
}
|
|
6911
6979
|
// The CLI's own session state reaches the host once per change, and a
|
|
6912
6980
|
// session that closes never leaves the host spinning.
|
|
6913
6981
|
const stateNotices = [];
|
|
@@ -6976,6 +7044,12 @@ async function runSelfTest() {
|
|
|
6976
7044
|
await new Promise((resolve) => setTimeout(resolve, 1100));
|
|
6977
7045
|
if (limitSession.usageLimitWait || retryInputs.length !== beforeSleep + 2) throw new Error("Usage limit timer did not resume");
|
|
6978
7046
|
finishTurn(limitSession, null);
|
|
7047
|
+
// Monitor 이벤트 실행은 init 뒤 첫 응답에서 턴이 열려도 앞서 온 한도로 대기한다.
|
|
7048
|
+
await consumeMessage(limitSession, { type: "system", subtype: "init" });
|
|
7049
|
+
await rejectLimit();
|
|
7050
|
+
await consumeMessage(limitSession, failedResult);
|
|
7051
|
+
if (!limitSession.usageLimitWait || !limitSession.turn) throw new Error("Automatic run dropped its usage limit");
|
|
7052
|
+
finishTurn(limitSession, null);
|
|
6979
7053
|
beginTurn(limitSession);
|
|
6980
7054
|
await rejectLimit();
|
|
6981
7055
|
await consumeMessage(limitSession, failedResult);
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "devez-vibe",
|
|
3
|
-
"version": "1.11.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Stable terminal UI for Codex and Claude Agent SDK",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"codex",
|
|
8
|
-
"cli",
|
|
9
|
-
"tui",
|
|
10
|
-
"terminal",
|
|
11
|
-
"app-server",
|
|
12
|
-
"claude-agent-sdk"
|
|
13
|
-
],
|
|
14
|
-
"homepage": "https://github.com/MrHoje/Devez-vibe#readme",
|
|
15
|
-
"bugs": "https://github.com/MrHoje/Devez-vibe/issues",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/MrHoje/Devez-vibe.git"
|
|
19
|
-
},
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"bin": {
|
|
22
|
-
"dvz": "bin/dvz.js"
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"bin/dvz.js",
|
|
26
|
-
"bin/dvz.exe",
|
|
27
|
-
"bridge/claude-agent-sdk-bridge.mjs",
|
|
28
|
-
"install-skills.mjs",
|
|
29
|
-
"prepare-search-deps.mjs",
|
|
30
|
-
"skills/luna-loop/",
|
|
31
|
-
"skills/insane-search/",
|
|
32
|
-
"README.md",
|
|
33
|
-
"LICENSE"
|
|
34
|
-
],
|
|
35
|
-
"os": [
|
|
36
|
-
"win32"
|
|
37
|
-
],
|
|
38
|
-
"cpu": [
|
|
39
|
-
"x64"
|
|
40
|
-
],
|
|
41
|
-
"engines": {
|
|
42
|
-
"node": ">=18.14.0"
|
|
43
|
-
},
|
|
44
|
-
"scripts": {
|
|
45
|
-
"postinstall": "node install-skills.mjs && node prepare-search-deps.mjs"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.327"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "devez-vibe",
|
|
3
|
+
"version": "1.11.19",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Stable terminal UI for Codex and Claude Agent SDK",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"codex",
|
|
8
|
+
"cli",
|
|
9
|
+
"tui",
|
|
10
|
+
"terminal",
|
|
11
|
+
"app-server",
|
|
12
|
+
"claude-agent-sdk"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/MrHoje/Devez-vibe#readme",
|
|
15
|
+
"bugs": "https://github.com/MrHoje/Devez-vibe/issues",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/MrHoje/Devez-vibe.git"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"bin": {
|
|
22
|
+
"dvz": "bin/dvz.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin/dvz.js",
|
|
26
|
+
"bin/dvz.exe",
|
|
27
|
+
"bridge/claude-agent-sdk-bridge.mjs",
|
|
28
|
+
"install-skills.mjs",
|
|
29
|
+
"prepare-search-deps.mjs",
|
|
30
|
+
"skills/luna-loop/",
|
|
31
|
+
"skills/insane-search/",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"os": [
|
|
36
|
+
"win32"
|
|
37
|
+
],
|
|
38
|
+
"cpu": [
|
|
39
|
+
"x64"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.14.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"postinstall": "node install-skills.mjs && node prepare-search-deps.mjs"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.327"
|
|
49
|
+
}
|
|
50
|
+
}
|