devez-vibe 1.11.18 → 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 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();
@@ -4965,6 +5000,7 @@ async function dispatch(method, params = {}) {
4965
5000
  // it has exited or released it. `sessionMissing` lets the host's stall probe
4966
5001
  // end the turn, where a bare "unknown" kept it waiting forever.
4967
5002
  if (!session) return { known: false, running: false, turnId: null, sessionMissing: true };
5003
+ probeCli(session);
4968
5004
  return { known: true, running: Boolean(session.turn), turnId: session.turn?.id ?? null };
4969
5005
  }
4970
5006
  if (method === "session/start") {
@@ -5084,16 +5120,17 @@ async function dispatch(method, params = {}) {
5084
5120
  }
5085
5121
  if (session?.turn) {
5086
5122
  const turn = session.turn;
5123
+ const query = session.query;
5087
5124
  turn.interruptRequested = true;
5088
- try {
5089
- // A plain interrupt keeps steers the CLI has queued, and they then ran as
5090
- // a new turn after the stop (measured on 0.3.309). `cancelQueued` drops
5091
- // them; the runtime has it (capability `interrupt_cancel_queued_v1`)
5092
- // though the typings do not, and older CLIs ignore the field.
5093
- await withSessionQuery(session, (query) => query.interrupt({ cancelQueued: true }));
5094
- } catch (error) {
5095
- if (session.turn === turn) delete turn.interruptRequested;
5096
- throw error;
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 {};
5097
5134
  }
5098
5135
  // Kept open for a steer whose run has not begun: nothing is running to
5099
5136
  // send the result that would close it.
@@ -6912,6 +6949,33 @@ async function runSelfTest() {
6912
6949
  process.stdout.write = steerWrite;
6913
6950
  sessions.delete(steerSession.id);
6914
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
+ }
6915
6979
  // The CLI's own session state reaches the host once per change, and a
6916
6980
  // session that closes never leaves the host spinning.
6917
6981
  const stateNotices = [];
package/package.json CHANGED
@@ -1,50 +1,50 @@
1
- {
2
- "name": "devez-vibe",
3
- "version": "1.11.18",
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
+ }