codedeck 0.2.0 → 0.4.0
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/README.md +45 -16
- package/dist/cli/charts/bar-chart.js +104 -0
- package/dist/cli/charts/bar-chart.js.map +1 -0
- package/dist/cli/charts/sparkline.js +18 -0
- package/dist/cli/charts/sparkline.js.map +1 -0
- package/dist/cli/charts/stacked-bar.js +59 -0
- package/dist/cli/charts/stacked-bar.js.map +1 -0
- package/dist/cli/cli-name.js +20 -0
- package/dist/cli/cli-name.js.map +1 -0
- package/dist/cli/commands/claims.js +170 -0
- package/dist/cli/commands/claims.js.map +1 -0
- package/dist/cli/commands/doctor.js +22 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/models.js +5 -5
- package/dist/cli/commands/models.js.map +1 -1
- package/dist/cli/commands/open.js +309 -315
- package/dist/cli/commands/open.js.map +1 -1
- package/dist/cli/commands/ps.js +226 -23
- package/dist/cli/commands/ps.js.map +1 -1
- package/dist/cli/commands/rename.js +29 -0
- package/dist/cli/commands/rename.js.map +1 -0
- package/dist/cli/commands/run.js +50 -18
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/setup.js +989 -72
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/usage.js +192 -0
- package/dist/cli/commands/usage.js.map +1 -0
- package/dist/cli/commands/wait.js +3 -2
- package/dist/cli/commands/wait.js.map +1 -1
- package/dist/cli/commands/web.js +224 -0
- package/dist/cli/commands/web.js.map +1 -0
- package/dist/cli/index.js +36 -21
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/picker-state.js +75 -8
- package/dist/cli/picker-state.js.map +1 -1
- package/dist/cli/picker.js +13 -3
- package/dist/cli/picker.js.map +1 -1
- package/dist/cli/ui.js +54 -4
- package/dist/cli/ui.js.map +1 -1
- package/dist/cli/usage/dashboard.js +330 -0
- package/dist/cli/usage/dashboard.js.map +1 -0
- package/dist/cli/usage/snapshot.js +112 -0
- package/dist/cli/usage/snapshot.js.map +1 -0
- package/dist/config/config.js +326 -5
- package/dist/config/config.js.map +1 -1
- package/dist/config/orchestrator-mode.js +72 -0
- package/dist/config/orchestrator-mode.js.map +1 -0
- package/dist/config/paths.js +28 -9
- package/dist/config/paths.js.map +1 -1
- package/dist/core/autocompact.js +77 -0
- package/dist/core/autocompact.js.map +1 -0
- package/dist/core/driver.js.map +1 -1
- package/dist/core/models.js +166 -3
- package/dist/core/models.js.map +1 -1
- package/dist/core/pricing.js +83 -0
- package/dist/core/pricing.js.map +1 -0
- package/dist/core/roles.js +14 -3
- package/dist/core/roles.js.map +1 -1
- package/dist/core/run-usage.js +46 -0
- package/dist/core/run-usage.js.map +1 -0
- package/dist/core/session.js +18 -0
- package/dist/core/session.js.map +1 -1
- package/dist/daemon/daemon.js +286 -8
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/ipc.js +10 -3
- package/dist/daemon/ipc.js.map +1 -1
- package/dist/drivers/antigravity/driver.js +158 -0
- package/dist/drivers/antigravity/driver.js.map +1 -0
- package/dist/drivers/antigravity/parser.js +168 -0
- package/dist/drivers/antigravity/parser.js.map +1 -0
- package/dist/drivers/claude/driver.js +13 -3
- package/dist/drivers/claude/driver.js.map +1 -1
- package/dist/drivers/opencode/driver.js +1 -114
- package/dist/drivers/opencode/driver.js.map +1 -1
- package/dist/drivers/opencode/parser.js +86 -0
- package/dist/drivers/opencode/parser.js.map +1 -0
- package/dist/drivers/registry.js +2 -0
- package/dist/drivers/registry.js.map +1 -1
- package/dist/drivers/session-driver.js +6 -4
- package/dist/drivers/session-driver.js.map +1 -1
- package/dist/drivers/session-runtime.js +1 -0
- package/dist/drivers/session-runtime.js.map +1 -1
- package/dist/git/worktree.js +1 -1
- package/dist/git/worktree.js.map +1 -1
- package/dist/open/contract.js +116 -0
- package/dist/open/contract.js.map +1 -0
- package/dist/open/injection.js +60 -0
- package/dist/open/injection.js.map +1 -0
- package/dist/open/launchers/claude.js +215 -0
- package/dist/open/launchers/claude.js.map +1 -0
- package/dist/open/launchers/opencode.js +213 -0
- package/dist/open/launchers/opencode.js.map +1 -0
- package/dist/open/orchestrator-prose.js +12 -0
- package/dist/open/orchestrator-prose.js.map +1 -0
- package/dist/open/pty.js +281 -0
- package/dist/open/pty.js.map +1 -0
- package/dist/open/runtime.js +632 -0
- package/dist/open/runtime.js.map +1 -0
- package/dist/plugin/agents/auditor.md +7 -1
- package/dist/plugin/agents/general.md +12 -1
- package/dist/plugin/agents/orchestrator-edit.md +67 -0
- package/dist/plugin/agents/orchestrator-read.md +67 -0
- package/dist/plugin/agents/orchestrator.md +74 -17
- package/dist/plugin/agents/reviewer.md +3 -0
- package/dist/plugin/commands/autonomous.md +58 -0
- package/dist/plugin/hooks/hooks.json +24 -0
- package/dist/plugin/hooks/session-id.sh +23 -0
- package/dist/plugin/hooks/session-name-lib.mjs +40 -0
- package/dist/plugin/hooks/session-name-worker.mjs +124 -0
- package/dist/plugin/hooks/session-name.mjs +66 -0
- package/dist/plugin/hooks/session-name.sh +7 -0
- package/dist/plugin/pty-shim.mjs +114 -0
- package/dist/plugin/statusline.sh +214 -22
- package/dist/plugin/themes/codedeck-rage.json +74 -0
- package/dist/plugin/themes/codedeck-ultra.json +52 -44
- package/dist/store/claims.js +152 -0
- package/dist/store/claims.js.map +1 -0
- package/dist/store/database.js +50 -15
- package/dist/store/database.js.map +1 -1
- package/dist/store/sessions.js +234 -3
- package/dist/store/sessions.js.map +1 -1
- package/dist/web/canvas-page.js +921 -0
- package/dist/web/canvas-page.js.map +1 -0
- package/package.json +3 -2
- package/dist/plugin/settings.json +0 -7
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { randomInt } from "node:crypto";
|
|
3
|
+
import { EventEmitter } from "node:events";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import { constants } from "node:os";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { getPaths } from "../config/paths.js";
|
|
9
|
+
import { getCliName } from "../cli/cli-name.js";
|
|
10
|
+
import { INDENT, LOGO, renderFarewell, renderLogo } from "../cli/ui.js";
|
|
11
|
+
import { ptyUnavailableReason, startPtySession } from "./pty.js";
|
|
12
|
+
/**
|
|
13
|
+
* "replace" drops Claude Code's own hundred-odd verbs instead of adding to
|
|
14
|
+
* them, so this list is the entire vocabulary and has to be long enough that a
|
|
15
|
+
* single session does not visibly cycle it.
|
|
16
|
+
*
|
|
17
|
+
* The verb is glyphs rather than a word because the spinner symbol itself
|
|
18
|
+
* cannot be reached. Its frames are module constants (`["·","✢","✳","✶","✻",
|
|
19
|
+
* "✽"]`, mirrored for the ping-pong) picked only by whether TERM is
|
|
20
|
+
* xterm-ghostty, and no setting touches them. The verb is the one part of that
|
|
21
|
+
* line CodeDeck owns, so the character is made there instead.
|
|
22
|
+
*
|
|
23
|
+
* Halfwidth katakana on purpose, mixed with digits. It is the one dense
|
|
24
|
+
* non-latin block that is single width, so a row of it cannot push the elapsed
|
|
25
|
+
* time and token count out of alignment the way fullwidth kana would, and the
|
|
26
|
+
* fonts that ship with a terminal carry it.
|
|
27
|
+
*
|
|
28
|
+
* Nothing is lost by dropping the words. The line still carries the elapsed
|
|
29
|
+
* seconds, the token count and the effort, which is the part anyone reads.
|
|
30
|
+
*/
|
|
31
|
+
export const SPINNER_VERBS = [
|
|
32
|
+
"ハ7ヲ2イ9キ4シ1マ8",
|
|
33
|
+
"キ0シ9マ3テ6ユ1ホ8",
|
|
34
|
+
"テ4ナ8ニ2セ7ワ0ツ5",
|
|
35
|
+
"ヲ1ア5ウ8レ2サ6ク0",
|
|
36
|
+
"オ9カ3キ7ヌ1ヨ5ヘ8",
|
|
37
|
+
"コ2サ7シ4ネ0モ6タ9",
|
|
38
|
+
"セ8ソ0タ3ハ6リ2ウ5",
|
|
39
|
+
"ネ5ハ1ヒ4ソ8ヤ0テ6",
|
|
40
|
+
"マ3ミ6ム9ス1フ5ラ8",
|
|
41
|
+
"モ7ヤ2ユ5カ9ト3レ6",
|
|
42
|
+
"リ0ワ4ヲ8ニ2ソ7メ5",
|
|
43
|
+
"ウ6エ9オ2タ5ハ8ル1",
|
|
44
|
+
"カ1キ8ケ3ヌ7フ0ヨ5",
|
|
45
|
+
"サ4シ0ス6ヘ2ラ9ニ1",
|
|
46
|
+
"ソ2タ5ツ8マ4ア7レ0",
|
|
47
|
+
"ナ9ニ3ヌ6ヒ1ヨ8エ4",
|
|
48
|
+
"ヒ6ホ1マ5ユ8ソ2キ9",
|
|
49
|
+
"ム8メ4モ7ア0ツ6リ1",
|
|
50
|
+
"ユ0ラ7リ2ウ5ミ9タ3",
|
|
51
|
+
"ア3ウ5エ8カ1ヨ6ホ0",
|
|
52
|
+
"ケ7コ2サ9テ4メ8ワ1",
|
|
53
|
+
"ス1セ9ソ3ハ6キ0ヤ5",
|
|
54
|
+
"ツ5テ0ナ4ヘ8ム2ヲ7",
|
|
55
|
+
"ヌ8ネ6ハ2ミ5カ9リ3",
|
|
56
|
+
"ヲァィゥェォ1ーャュョ2",
|
|
57
|
+
"ャュョッーア3イウエオ4",
|
|
58
|
+
"ッーアイウ5エオカキク6",
|
|
59
|
+
"ーカキクケコ7サシスセ8",
|
|
60
|
+
"サシスセソ9タチツテト0",
|
|
61
|
+
"タチツテト1ナニヌネノ2",
|
|
62
|
+
"ナニヌネノ3ハヒフヘホ4",
|
|
63
|
+
"ハヒフヘホ5マミムメモ6",
|
|
64
|
+
"マミムメモ7ヤユヨラリ8",
|
|
65
|
+
"ヤユヨラリ9ルレロワン0",
|
|
66
|
+
"ルレロワン1ヲァィゥェ2",
|
|
67
|
+
"ヲァィゥェ3ォャュョッ4",
|
|
68
|
+
"ア9ン8イ7ン6ウ5ン4",
|
|
69
|
+
"カ8ン7キ6ン5ク4ン3",
|
|
70
|
+
"サ7ン6シ5ン4ス3ン2",
|
|
71
|
+
"タ6ン5チ4ン3ツ2ン1",
|
|
72
|
+
"ナ5ン4ニ3ン2ヌ1ン0",
|
|
73
|
+
"ハ4ン3ヒ2ン1フ0ン9",
|
|
74
|
+
"マ3ン2ミ1ン0ム9ン8",
|
|
75
|
+
"ヤ2ン1ユ0ン9ヨ8ン7",
|
|
76
|
+
"ル1ン0レ9ン8ロ7ン6",
|
|
77
|
+
"アイ2ウエ3オカ4キク5",
|
|
78
|
+
"ケコ6サシ7スセ8ソタ9",
|
|
79
|
+
"チツ0テト1ナニ2ヌネ3",
|
|
80
|
+
"ノハ4ヒフ5ヘホ6マミ7",
|
|
81
|
+
"ムメ8モヤ9ユヨ0ラリ1",
|
|
82
|
+
"ルレ2ロワ3ンヲ4ァィ5",
|
|
83
|
+
"ゥェ6ォャ7ュョ8ッー9",
|
|
84
|
+
"0ア1イ2ウ3エ4オ5カ",
|
|
85
|
+
"6キ7ク8ケ9コ0サ1シ",
|
|
86
|
+
"1シ2ス3セ4ソ5タ6チ",
|
|
87
|
+
"7ツ8テ9ト0ナ1ニ2ヌ",
|
|
88
|
+
"2ヌ3ネ4ノ5ハ6ヒ7フ",
|
|
89
|
+
"8フ9ヘ0ホ1マ2ミ3ム",
|
|
90
|
+
"3ム4メ5モ6ヤ7ユ8ヨ",
|
|
91
|
+
"9ヨ0ラ1リ2ル3レ4ロ",
|
|
92
|
+
"5ロ6ワ7ン8ヲ9ァ0ワ",
|
|
93
|
+
"ィ1ゥ2ェ3ォ4ャ5ュ6",
|
|
94
|
+
"ョ7ッ8ー9ア0イ1ウエ",
|
|
95
|
+
"エ2オ3カ4キ5ク6ケオ",
|
|
96
|
+
];
|
|
97
|
+
/**
|
|
98
|
+
* Shown under the spinner as "ULTRA: <tip>". Every one of these names a command
|
|
99
|
+
* this repository actually ships, because a tip that describes a flag nobody
|
|
100
|
+
* has is worse than no tip at all.
|
|
101
|
+
*/
|
|
102
|
+
export function spinnerTips() {
|
|
103
|
+
const cli = getCliName();
|
|
104
|
+
return [
|
|
105
|
+
`${cli} run --bg hands work to another harness so this session keeps its own context.`,
|
|
106
|
+
`${cli} run --worktree gives each session its own checkout, so two of them cannot fight over a file.`,
|
|
107
|
+
`${cli} ps lists the recent sessions with the harness and model each one ran on.`,
|
|
108
|
+
`${cli} logs <id> prints what a background session actually reported.`,
|
|
109
|
+
`${cli} wait <id> --json blocks until a session reaches a terminal state.`,
|
|
110
|
+
`${cli} diff <id> shows what a worktree session changed, against its base commit.`,
|
|
111
|
+
`${cli} stop <id> interrupts a session, then escalates to SIGTERM and SIGKILL.`,
|
|
112
|
+
`${cli} send <id> continues a session with a new message instead of restarting it.`,
|
|
113
|
+
`${cli} show <id> prints one session in full: status, worktree, usage, recent events.`,
|
|
114
|
+
`${cli} open reviewer opens a session that can read and run but never edit.`,
|
|
115
|
+
`${cli} setup binds each role to a harness and a model, one screen per role.`,
|
|
116
|
+
`${cli} run --role auditor sends a one-off deep review to another harness.`,
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* statusLine.command is handed to a shell, so an install directory carrying a
|
|
121
|
+
* space, a `$`, a backtick or a quote would break the command or inject into
|
|
122
|
+
* it. Single quotes take every one of those literally, and the only character
|
|
123
|
+
* that can end them is a quote, which is why that one is spliced.
|
|
124
|
+
*/
|
|
125
|
+
export function shellQuote(value) {
|
|
126
|
+
return `'${value.replaceAll("'", `'\\''`)}'`;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Gives Claude's child sessions a `codedeck` command even when this CLI came
|
|
130
|
+
* from a checkout or an npx process that never installed a global shim.
|
|
131
|
+
*/
|
|
132
|
+
function writeShim(file, entry, cliName) {
|
|
133
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
134
|
+
// Rewriting is deliberate because the Node binary or checkout can move
|
|
135
|
+
// after a previous launch, and writeFileSync preserves an existing mode.
|
|
136
|
+
// The alias shim carries its own name so it prints right even when the
|
|
137
|
+
// parent environment did not propagate CODEDECK_CLI_NAME.
|
|
138
|
+
const rename = cliName !== undefined ? `export CODEDECK_CLI_NAME=${shellQuote(cliName)}\n` : "";
|
|
139
|
+
fs.writeFileSync(file, `#!/usr/bin/env sh\n${rename}exec ${shellQuote(process.execPath)} ${shellQuote(entry)} "$@"\n`, { mode: 0o700 });
|
|
140
|
+
fs.chmodSync(file, 0o700);
|
|
141
|
+
}
|
|
142
|
+
export function ensureCodedeckShim() {
|
|
143
|
+
try {
|
|
144
|
+
const binDir = path.join(getPaths().base, "bin");
|
|
145
|
+
const entry = fileURLToPath(new URL("../cli/index.js", import.meta.url));
|
|
146
|
+
// The shim leads PATH so a stale global install cannot take over from the
|
|
147
|
+
// CLI instance that is running this checkout.
|
|
148
|
+
writeShim(path.join(binDir, "codedeck"), entry);
|
|
149
|
+
// A renamed alias (CODEDECK_CLI_NAME) gets its own shim so workers type
|
|
150
|
+
// the same name they were launched with.
|
|
151
|
+
const alias = getCliName();
|
|
152
|
+
if (alias !== "codedeck" && /^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(alias)) {
|
|
153
|
+
writeShim(path.join(binDir, alias), entry, alias);
|
|
154
|
+
}
|
|
155
|
+
return binDir;
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
// A missing shim must not turn an otherwise valid Claude launch into a
|
|
159
|
+
// failure.
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export function sanitizeEnv(env) {
|
|
163
|
+
const sanitized = { ...env };
|
|
164
|
+
delete sanitized.CLAUDE_CODE_CHILD_SESSION;
|
|
165
|
+
// A mise shim announces the tool it resolved on every run. It costs 36ms,
|
|
166
|
+
// which nobody would notice, and one line of output, which lands on top of
|
|
167
|
+
// the boot screen. Only the line matters. A setting of the user's own is left
|
|
168
|
+
// alone, since silencing mise everywhere is not this command's call.
|
|
169
|
+
sanitized.MISE_QUIET ??= "1";
|
|
170
|
+
return sanitized;
|
|
171
|
+
}
|
|
172
|
+
export function withCodedeckOnPath(env, binDir) {
|
|
173
|
+
const currentPath = env.PATH;
|
|
174
|
+
const entries = currentPath ? currentPath.split(path.delimiter) : [];
|
|
175
|
+
if (entries[0] === binDir)
|
|
176
|
+
return { ...env };
|
|
177
|
+
return {
|
|
178
|
+
...env,
|
|
179
|
+
PATH: [binDir, ...entries].join(path.delimiter),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* What to say once the session is over, so the id is there when it is wanted
|
|
184
|
+
* rather than buried in a picker.
|
|
185
|
+
*
|
|
186
|
+
* It cannot be said any earlier. The id does not exist when the boot screen
|
|
187
|
+
* prints, and the launcher cannot read it off the session either, because
|
|
188
|
+
* stdout is inherited by the terminal so that the TUI can paint straight to it.
|
|
189
|
+
* A SessionStart hook is the one thing that sees it, and it can only leave it
|
|
190
|
+
* in a file for afterwards.
|
|
191
|
+
*/
|
|
192
|
+
/**
|
|
193
|
+
* Session ids CodeDeck prints back as resume hints: Claude UUIDs and
|
|
194
|
+
* opencode `ses_` ids (probe-session-id-2026-09-07). One check so the
|
|
195
|
+
* farewell and the sidecar cleanup agree on what counts as an id.
|
|
196
|
+
*/
|
|
197
|
+
export const SESSION_ID_PATTERN = /^(?:[0-9a-fA-F-]{8,}|ses_[A-Za-z0-9]{16,})$/;
|
|
198
|
+
export function resumeHint(role, id) {
|
|
199
|
+
if (id === undefined || !SESSION_ID_PATTERN.test(id))
|
|
200
|
+
return undefined;
|
|
201
|
+
return `${INDENT}resume: ${getCliName()} open ${role} --resume ${id}\n`;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* The way out, on the primary screen the alternate one just handed back.
|
|
205
|
+
*
|
|
206
|
+
* Drawn even when there is no id to offer, because the sign-off is the point
|
|
207
|
+
* and a session that ended without one still ended.
|
|
208
|
+
*/
|
|
209
|
+
export function renderExit(role, id) {
|
|
210
|
+
const farewell = renderFarewell()
|
|
211
|
+
.split("\n")
|
|
212
|
+
.map((line) => (line.trim() === "" ? line : blood(line)))
|
|
213
|
+
.join("\n");
|
|
214
|
+
const hint = resumeHint(role, id);
|
|
215
|
+
return hint ? `${farewell}${muted(hint)}` : farewell;
|
|
216
|
+
}
|
|
217
|
+
/** Reads what the SessionStart hook left, and takes both sidecars with it. */
|
|
218
|
+
function takeSessionId(file) {
|
|
219
|
+
let id;
|
|
220
|
+
try {
|
|
221
|
+
id = fs.readFileSync(file, "utf8").trim() || undefined;
|
|
222
|
+
return id;
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
// No file means the hook never ran: an older Claude Code, a session that
|
|
226
|
+
// died before startup, or a plugin the launch could not load. None of those
|
|
227
|
+
// are worth a diagnostic on the way out of a session that otherwise worked.
|
|
228
|
+
}
|
|
229
|
+
finally {
|
|
230
|
+
try {
|
|
231
|
+
fs.rmSync(file, { force: true });
|
|
232
|
+
}
|
|
233
|
+
catch { }
|
|
234
|
+
if (id && SESSION_ID_PATTERN.test(id)) {
|
|
235
|
+
try {
|
|
236
|
+
fs.rmSync(`${file}.${id}.name`, { force: true });
|
|
237
|
+
}
|
|
238
|
+
catch { }
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const SIGINT_ESCALATION_COUNT = 3;
|
|
243
|
+
const SIGINT_KILL_GRACE_MS = 1000;
|
|
244
|
+
/**
|
|
245
|
+
* Keeps the parent alive while Claude leaves the terminal and CodeDeck writes
|
|
246
|
+
* the resume hint.
|
|
247
|
+
*
|
|
248
|
+
* Claude inherits stdin and stays in the parent's foreground process group
|
|
249
|
+
* (`detached: false`), so a tty sends Ctrl+C to both processes. This listener
|
|
250
|
+
* absorbs only the parent's copy. Claude still receives the first Ctrl+C and
|
|
251
|
+
* can exit normally. A flood eventually escalates the child itself so a stuck
|
|
252
|
+
* session cannot prevent the hint from being written.
|
|
253
|
+
*/
|
|
254
|
+
export function installSigintGuard(getChild, signalHost = process) {
|
|
255
|
+
let signals = 0;
|
|
256
|
+
let escalationStarted = false;
|
|
257
|
+
let childClosed = false;
|
|
258
|
+
let disposed = false;
|
|
259
|
+
let killTimer;
|
|
260
|
+
const clearKillTimer = () => {
|
|
261
|
+
if (killTimer === undefined)
|
|
262
|
+
return;
|
|
263
|
+
clearTimeout(killTimer);
|
|
264
|
+
killTimer = undefined;
|
|
265
|
+
};
|
|
266
|
+
const send = (signal) => {
|
|
267
|
+
const child = getChild();
|
|
268
|
+
if (!child)
|
|
269
|
+
return;
|
|
270
|
+
try {
|
|
271
|
+
child.kill(signal);
|
|
272
|
+
}
|
|
273
|
+
catch { }
|
|
274
|
+
};
|
|
275
|
+
const onSigint = () => {
|
|
276
|
+
if (disposed || childClosed || escalationStarted)
|
|
277
|
+
return;
|
|
278
|
+
signals += 1;
|
|
279
|
+
if (signals < SIGINT_ESCALATION_COUNT || !getChild())
|
|
280
|
+
return;
|
|
281
|
+
escalationStarted = true;
|
|
282
|
+
send("SIGTERM");
|
|
283
|
+
killTimer = setTimeout(() => {
|
|
284
|
+
killTimer = undefined;
|
|
285
|
+
if (disposed || childClosed)
|
|
286
|
+
return;
|
|
287
|
+
send("SIGKILL");
|
|
288
|
+
}, SIGINT_KILL_GRACE_MS);
|
|
289
|
+
};
|
|
290
|
+
signalHost.on("SIGINT", onSigint);
|
|
291
|
+
return {
|
|
292
|
+
childClosed() {
|
|
293
|
+
childClosed = true;
|
|
294
|
+
clearKillTimer();
|
|
295
|
+
},
|
|
296
|
+
dispose() {
|
|
297
|
+
if (disposed)
|
|
298
|
+
return;
|
|
299
|
+
disposed = true;
|
|
300
|
+
clearKillTimer();
|
|
301
|
+
signalHost.removeListener("SIGINT", onSigint);
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
export function writeStdoutSync(text) {
|
|
306
|
+
try {
|
|
307
|
+
const bytes = Buffer.from(text);
|
|
308
|
+
let offset = 0;
|
|
309
|
+
while (offset < bytes.length) {
|
|
310
|
+
const written = fs.writeSync(1, bytes, offset, bytes.length - offset);
|
|
311
|
+
if (written <= 0)
|
|
312
|
+
break;
|
|
313
|
+
offset += written;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
catch { }
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Claude Code prints its own resume hint on exit
|
|
320
|
+
* ("Resume this session with: claude --resume ..."), with no setting to turn
|
|
321
|
+
* it off. It always lands right above the farewell — a leading blank line
|
|
322
|
+
* plus its two hint rows — so when there is an id to offer, which is the same
|
|
323
|
+
* condition under which Claude printed its hint, this backs the cursor over
|
|
324
|
+
* those two rows and clears down before the farewell goes out, leaving only
|
|
325
|
+
* the BYE resume line. A wrapped hint (narrow terminal, long title) leaves
|
|
326
|
+
* its top row behind, still strictly less noise than the duplicate.
|
|
327
|
+
*
|
|
328
|
+
* A pipe gets nothing: Claude skips its hint off-tty too, so there is nothing
|
|
329
|
+
* to erase and escape codes would only pollute redirected output.
|
|
330
|
+
*/
|
|
331
|
+
export const CLAUDE_RESUME_ERASE = "\x1b[2A\x1b[J";
|
|
332
|
+
/** Takes the session id, writes the farewell while the SIGINT guard is live, and returns the native session id. */
|
|
333
|
+
export function finishOpenSession(role, sessionFile, write = writeStdoutSync, stdoutIsTty = process.stdout.isTTY === true) {
|
|
334
|
+
try {
|
|
335
|
+
const id = takeSessionId(sessionFile);
|
|
336
|
+
if (resumeHint(role, id) !== undefined && stdoutIsTty)
|
|
337
|
+
write(CLAUDE_RESUME_ERASE);
|
|
338
|
+
write(renderExit(role, id));
|
|
339
|
+
return id;
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
return undefined;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* The boot screen, and it works because of the fullscreen renderer rather than
|
|
347
|
+
* in spite of it.
|
|
348
|
+
*
|
|
349
|
+
* Claude Code takes a moment to paint, and until it does the terminal shows
|
|
350
|
+
* whatever stood there. Since it opens on the alternate screen, this is drawn
|
|
351
|
+
* on the primary one, replaced the instant Claude takes over and restored,
|
|
352
|
+
* unseen, when the session ends. So it fills exactly the gap and cleans itself
|
|
353
|
+
* up, with nothing to tear down and no escape of ours left interleaved with
|
|
354
|
+
* Claude's output.
|
|
355
|
+
*
|
|
356
|
+
* Colour is written by hand here for the same reason the status line writes its
|
|
357
|
+
* own: this runs before Claude Code exists, so no theme is loaded yet.
|
|
358
|
+
*/
|
|
359
|
+
/**
|
|
360
|
+
* The logo resolving out of katakana noise, one frame at a time.
|
|
361
|
+
*
|
|
362
|
+
* Same alphabet as the spinner, so the launch and the session read as one
|
|
363
|
+
* thing. Blanks in the logo stay blank: the mark keeps its silhouette the whole
|
|
364
|
+
* way through and the noise fills only the strokes, which is what makes it look
|
|
365
|
+
* like the letters arriving rather than a rectangle of static.
|
|
366
|
+
*
|
|
367
|
+
* Pure, with the noise supplied by the caller, so a test can pin an exact frame
|
|
368
|
+
* instead of asserting around randomness.
|
|
369
|
+
*/
|
|
370
|
+
export function bootFrame(progress, noise) {
|
|
371
|
+
const width = LOGO[0].length;
|
|
372
|
+
const settled = Math.round(width * Math.min(1, Math.max(0, progress)));
|
|
373
|
+
return LOGO.map((line) => [...line]
|
|
374
|
+
.map((glyph, column) => {
|
|
375
|
+
if (column < settled || glyph === " ")
|
|
376
|
+
return glyph;
|
|
377
|
+
return noise(column);
|
|
378
|
+
})
|
|
379
|
+
.join(""));
|
|
380
|
+
}
|
|
381
|
+
const BOOT_STEPS = 18;
|
|
382
|
+
const BOOT_STEP_MS = 40;
|
|
383
|
+
const KATAKANA = [
|
|
384
|
+
...new Set([...SPINNER_VERBS.join("")].filter((glyph) => !/[0-9]/.test(glyph))),
|
|
385
|
+
];
|
|
386
|
+
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
387
|
+
/**
|
|
388
|
+
* Plays the launch animation, then leaves the finished banner on screen.
|
|
389
|
+
*
|
|
390
|
+
* It runs BEFORE the spawn, and that ordering is the whole design. Once Claude
|
|
391
|
+
* Code is spawned the two processes share one terminal, and the moment it
|
|
392
|
+
* switches to the alternate screen anything written here lands inside its TUI.
|
|
393
|
+
* There is no layer to sit on top of, so the choice is before or corrupted.
|
|
394
|
+
* The cost is honest: this animation is time added to the launch, not time
|
|
395
|
+
* borrowed from Claude Code starting up.
|
|
396
|
+
*
|
|
397
|
+
* A pipe gets the still banner. Cursor movement assumes a terminal that is
|
|
398
|
+
* showing the last thing written, which a redirect into a file is not.
|
|
399
|
+
*/
|
|
400
|
+
export async function playBoot(role, model, effort) {
|
|
401
|
+
const out = process.stdout;
|
|
402
|
+
if (!out.isTTY) {
|
|
403
|
+
out.write(renderBanner(role, model, effort));
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const noise = () => KATAKANA[randomInt(KATAKANA.length)];
|
|
407
|
+
out.write("\n");
|
|
408
|
+
for (let step = 0; step <= BOOT_STEPS; step++) {
|
|
409
|
+
if (step > 0)
|
|
410
|
+
out.write(`\x1b[${LOGO.length}A`);
|
|
411
|
+
for (const line of bootFrame(step / BOOT_STEPS, noise)) {
|
|
412
|
+
out.write(`\r\x1b[2K${INDENT}${blood(line)}\n`);
|
|
413
|
+
}
|
|
414
|
+
await delay(BOOT_STEP_MS);
|
|
415
|
+
}
|
|
416
|
+
out.write(`${INDENT}${muted(`${role} · ${model} · ${effort}`)}\n`);
|
|
417
|
+
out.write(`${INDENT}${muted("booting…")}\n`);
|
|
418
|
+
}
|
|
419
|
+
const blood = (value) => `\x1b[38;2;225;29;72m${value}\x1b[0m`;
|
|
420
|
+
const muted = (value) => `\x1b[38;2;163;139;143m${value}\x1b[0m`;
|
|
421
|
+
export function renderBanner(role, model, effort) {
|
|
422
|
+
const logo = renderLogo()
|
|
423
|
+
.split("\n")
|
|
424
|
+
.map((line) => (line.trim() === "" ? line : blood(line)))
|
|
425
|
+
.join("\n");
|
|
426
|
+
return `${logo}${INDENT}${muted(`${role} · ${model} · ${effort}`)}\n${INDENT}${muted("booting…")}\n`;
|
|
427
|
+
}
|
|
428
|
+
export function assertPluginDirectory(pluginDir) {
|
|
429
|
+
try {
|
|
430
|
+
if (fs.statSync(pluginDir).isDirectory())
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
catch { }
|
|
434
|
+
throw new Error(`CodeDeck plugin directory not found at ${pluginDir}. Rebuild or reinstall CodeDeck before running open.`);
|
|
435
|
+
}
|
|
436
|
+
export function currentWorkingDirectory() {
|
|
437
|
+
try {
|
|
438
|
+
const cwd = process.cwd();
|
|
439
|
+
if (fs.statSync(cwd).isDirectory())
|
|
440
|
+
return cwd;
|
|
441
|
+
}
|
|
442
|
+
catch { }
|
|
443
|
+
throw new Error("Cannot launch Claude Code: the current working directory no longer exists.");
|
|
444
|
+
}
|
|
445
|
+
export function errorDetails(error) {
|
|
446
|
+
if (typeof error !== "object" || error === null)
|
|
447
|
+
return { text: String(error) };
|
|
448
|
+
const value = error;
|
|
449
|
+
const text = [value.stderr, value.stdout, value.message]
|
|
450
|
+
.filter((part) => typeof part === "string" && part.length > 0)
|
|
451
|
+
.join("\n");
|
|
452
|
+
return {
|
|
453
|
+
code: typeof value.code === "string" ? value.code : undefined,
|
|
454
|
+
text: text || String(error),
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Only stderr is piped, and only because Claude Code reports an unusable model
|
|
459
|
+
* there as a tagged line rather than a distinct exit code. stdout stays
|
|
460
|
+
* inherited so the TUI paints straight to the terminal, which also means
|
|
461
|
+
* `child.stdout` is null and there is nothing to relay.
|
|
462
|
+
*/
|
|
463
|
+
function relayStderr(child, output) {
|
|
464
|
+
const stream = child.stderr;
|
|
465
|
+
if (!stream)
|
|
466
|
+
return;
|
|
467
|
+
stream.setEncoding?.("utf8");
|
|
468
|
+
stream.on("data", (chunk) => {
|
|
469
|
+
output.value += typeof chunk === "string" ? chunk : chunk.toString();
|
|
470
|
+
process.stderr.write(chunk);
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* How much of a pty session's output is kept for the entitlement check. Under
|
|
475
|
+
* a pty the harness's stderr is merged into stdout, so the tagged refusal
|
|
476
|
+
* arrives in the same stream the TUI paints with — and that stream never ends.
|
|
477
|
+
* The refusal is written before the first frame, so a small window is enough
|
|
478
|
+
* and the session does not accumulate its own transcript in memory.
|
|
479
|
+
*/
|
|
480
|
+
const PTY_SCAN_LIMIT = 64 * 1024;
|
|
481
|
+
/**
|
|
482
|
+
* The pty variant of relayStderr: bytes are written through to the terminal
|
|
483
|
+
* untouched, and only the opening window is remembered.
|
|
484
|
+
*/
|
|
485
|
+
function relayPtyOutput(child, output, stdout) {
|
|
486
|
+
child.stdout?.pipe(stdout, { end: false });
|
|
487
|
+
child.stdout?.on("data", (chunk) => {
|
|
488
|
+
if (output.value.length >= PTY_SCAN_LIMIT)
|
|
489
|
+
return;
|
|
490
|
+
output.value += typeof chunk === "string" ? chunk : chunk.toString();
|
|
491
|
+
});
|
|
492
|
+
relayStderr(child, output);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* A signalled death carries no exit code, and collapsing it to 1 tells a caller
|
|
496
|
+
* the session failed rather than that it was killed. Shells report this as
|
|
497
|
+
* 128 plus the signal number, so Ctrl+C stays 130 and a SIGKILL stays 137.
|
|
498
|
+
*/
|
|
499
|
+
export function exitCodeFor(code, signal) {
|
|
500
|
+
if (code !== null)
|
|
501
|
+
return code;
|
|
502
|
+
if (!signal)
|
|
503
|
+
return 1;
|
|
504
|
+
const number = constants.signals[signal];
|
|
505
|
+
return typeof number === "number" ? 128 + number : 1;
|
|
506
|
+
}
|
|
507
|
+
/** Left as a seam so a test can assert the fallback without a real terminal. */
|
|
508
|
+
export function ptyLaunchFor(opts) {
|
|
509
|
+
if (!opts.pty)
|
|
510
|
+
return undefined;
|
|
511
|
+
const reason = ptyUnavailableReason({
|
|
512
|
+
shim: opts.pty.shim,
|
|
513
|
+
stdinIsTty: process.stdin.isTTY === true,
|
|
514
|
+
stdoutIsTty: process.stdout.isTTY === true,
|
|
515
|
+
});
|
|
516
|
+
return reason === undefined ? opts.pty : undefined;
|
|
517
|
+
}
|
|
518
|
+
export function spawnHarness(bin, args, opts) {
|
|
519
|
+
return new Promise((resolve, reject) => {
|
|
520
|
+
let settled = false;
|
|
521
|
+
const output = { value: "" };
|
|
522
|
+
const binDir = ensureCodedeckShim();
|
|
523
|
+
const childEnv = binDir === undefined
|
|
524
|
+
? sanitizeEnv(process.env)
|
|
525
|
+
: withCodedeckOnPath(sanitizeEnv(process.env), binDir);
|
|
526
|
+
let child;
|
|
527
|
+
let pty;
|
|
528
|
+
const launch = ptyLaunchFor(opts);
|
|
529
|
+
const signalHost = opts.signalHost ?? process;
|
|
530
|
+
// Under a pty the terminal is in raw mode, so Ctrl+C never reaches this
|
|
531
|
+
// process as a signal: it is a byte on the way to the harness. The
|
|
532
|
+
// escalation that kills a wedged session is fed from that byte instead,
|
|
533
|
+
// through the same guard, so the escape hatch behaves as it always did.
|
|
534
|
+
const keyboard = launch ? new EventEmitter() : undefined;
|
|
535
|
+
const relayInterrupt = keyboard ? () => keyboard.emit("SIGINT") : undefined;
|
|
536
|
+
if (relayInterrupt)
|
|
537
|
+
signalHost.on("SIGINT", relayInterrupt);
|
|
538
|
+
const sigintGuard = installSigintGuard(() => child, keyboard ?? signalHost);
|
|
539
|
+
const releaseKeyboard = () => {
|
|
540
|
+
if (relayInterrupt)
|
|
541
|
+
signalHost.removeListener("SIGINT", relayInterrupt);
|
|
542
|
+
};
|
|
543
|
+
const fail = (error) => {
|
|
544
|
+
if (settled)
|
|
545
|
+
return;
|
|
546
|
+
settled = true;
|
|
547
|
+
pty?.dispose();
|
|
548
|
+
releaseKeyboard();
|
|
549
|
+
sigintGuard.childClosed();
|
|
550
|
+
sigintGuard.dispose();
|
|
551
|
+
reject(error);
|
|
552
|
+
};
|
|
553
|
+
const spawnChild = opts.spawnChild ?? spawn;
|
|
554
|
+
const env = { ...childEnv, CODEDECK_SESSION_FILE: opts.sessionFile, ...(opts.envExtra ?? {}) };
|
|
555
|
+
try {
|
|
556
|
+
if (launch) {
|
|
557
|
+
pty = startPtySession({
|
|
558
|
+
target: { bin, args },
|
|
559
|
+
launch,
|
|
560
|
+
cwd: opts.cwd,
|
|
561
|
+
env,
|
|
562
|
+
spawnChild,
|
|
563
|
+
onInterrupt: relayInterrupt,
|
|
564
|
+
});
|
|
565
|
+
child = pty.child;
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
child = spawnChild(bin, args, {
|
|
569
|
+
cwd: opts.cwd,
|
|
570
|
+
env,
|
|
571
|
+
// Keep Claude in the foreground process group so the terminal sends
|
|
572
|
+
// the first Ctrl+C to it as well as to this parent guard.
|
|
573
|
+
detached: false,
|
|
574
|
+
stdio: ["inherit", "inherit", "pipe"],
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
catch (error) {
|
|
579
|
+
fail(error);
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
if (opts.onSpawn && child) {
|
|
583
|
+
try {
|
|
584
|
+
const res = opts.onSpawn(child);
|
|
585
|
+
if (res && typeof res.catch === "function") {
|
|
586
|
+
res.catch(() => { });
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
catch { }
|
|
590
|
+
}
|
|
591
|
+
if (pty)
|
|
592
|
+
relayPtyOutput(child, output, process.stdout);
|
|
593
|
+
else
|
|
594
|
+
relayStderr(child, output);
|
|
595
|
+
child.once("error", (error) => {
|
|
596
|
+
if (settled)
|
|
597
|
+
return;
|
|
598
|
+
const details = errorDetails(error);
|
|
599
|
+
if (details.code === "ENOENT") {
|
|
600
|
+
fail(new Error(opts.notFoundMessage));
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
fail(error);
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
child.once("close", async (code, signal) => {
|
|
607
|
+
if (settled)
|
|
608
|
+
return;
|
|
609
|
+
settled = true;
|
|
610
|
+
pty?.dispose();
|
|
611
|
+
releaseKeyboard();
|
|
612
|
+
sigintGuard.childClosed();
|
|
613
|
+
const entitlement = opts.entitlementError?.(opts.model ?? "", output.value);
|
|
614
|
+
if (entitlement) {
|
|
615
|
+
sigintGuard.dispose();
|
|
616
|
+
reject(new Error(entitlement));
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
process.exitCode = exitCodeFor(code, signal);
|
|
620
|
+
try {
|
|
621
|
+
await opts.onClose();
|
|
622
|
+
sigintGuard.dispose();
|
|
623
|
+
resolve();
|
|
624
|
+
}
|
|
625
|
+
catch (error) {
|
|
626
|
+
sigintGuard.dispose();
|
|
627
|
+
reject(error);
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/open/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAmC,MAAM,UAAU,CAAC;AAElG;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAA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