arcane-agents 1.2.1 → 1.2.3
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 +64 -48
- package/config.example.yaml +1 -0
- package/dist/client/assets/index-CT0NFttM.css +32 -0
- package/dist/client/assets/{index-BCnWppkv.js → index-DHyA1AST.js} +20 -20
- package/dist/client/index.html +2 -2
- package/dist/server/server/bootstrap/serverContext.js +5 -3
- package/dist/server/server/cli.js +120 -2
- package/dist/server/server/config/schema.js +5 -1
- package/dist/server/server/orchestrator/orchestratorService.test.js +1 -0
- package/dist/server/server/orchestrator/spawn/resolveSpawnPlan.test.js +1 -0
- package/dist/server/server/setup/prerequisites.js +74 -0
- package/dist/server/server/setup/prerequisites.test.js +50 -0
- package/dist/server/server/status/engine/signalContext.js +3 -2
- package/dist/server/server/status/engine/stateMachine/constants.js +1 -1
- package/dist/server/server/status/engine/stateMachine/decision.test.js +1 -0
- package/dist/server/server/status/engine/stateMachine/helpers.js +3 -0
- package/dist/server/server/status/engine/stateMachine/helpers.test.js +4 -1
- package/dist/server/server/status/engine/stateMachine/workingEvidence.js +15 -0
- package/dist/server/server/status/statusEvaluator.js +3 -2
- package/dist/server/server/status/statusMonitor.js +14 -3
- package/dist/server/server/status/statusMonitor.test.js +3 -2
- package/dist/server/server/status/statusPipeline.js +5 -3
- package/dist/server/server/tmux/tmuxAdapter.js +30 -51
- package/dist/server/server/tmux/tmuxClient.js +35 -0
- package/dist/server/server/tmux/tmuxClient.test.js +58 -0
- package/dist/server/server/ws/terminalBridge.js +5 -2
- package/dist/server/shared/mapConstants.js +4 -0
- package/package.json +4 -3
- package/dist/client/assets/index-Di_KBFPW.css +0 -32
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TmuxAdapter = void 0;
|
|
4
|
+
exports.clipboardCandidatesForEnvironment = clipboardCandidatesForEnvironment;
|
|
4
5
|
const node_child_process_1 = require("node:child_process");
|
|
5
6
|
const node_util_1 = require("node:util");
|
|
7
|
+
const tmuxClient_1 = require("./tmuxClient");
|
|
6
8
|
const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
7
9
|
class TmuxAdapter {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
this.
|
|
10
|
+
config;
|
|
11
|
+
managedDefaultsConfigured = false;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
12
14
|
}
|
|
13
15
|
async spawnWorker(input) {
|
|
14
|
-
const target = `${this.sessionName}:${input.windowName}`;
|
|
16
|
+
const target = `${this.config.sessionName}:${input.windowName}`;
|
|
15
17
|
const commandLine = input.command.map(shellQuote).join(" ");
|
|
16
18
|
const env = `ARCANE_AGENTS_WORKER_ID=${input.workerId}`;
|
|
17
19
|
if (await this.hasSession()) {
|
|
@@ -19,7 +21,7 @@ class TmuxAdapter {
|
|
|
19
21
|
"new-window",
|
|
20
22
|
"-d",
|
|
21
23
|
"-t",
|
|
22
|
-
this.sessionName,
|
|
24
|
+
this.config.sessionName,
|
|
23
25
|
"-n",
|
|
24
26
|
input.windowName,
|
|
25
27
|
"-c",
|
|
@@ -30,11 +32,12 @@ class TmuxAdapter {
|
|
|
30
32
|
]);
|
|
31
33
|
}
|
|
32
34
|
else {
|
|
35
|
+
this.managedDefaultsConfigured = false;
|
|
33
36
|
await this.runTmux([
|
|
34
37
|
"new-session",
|
|
35
38
|
"-d",
|
|
36
39
|
"-s",
|
|
37
|
-
this.sessionName,
|
|
40
|
+
this.config.sessionName,
|
|
38
41
|
"-n",
|
|
39
42
|
input.windowName,
|
|
40
43
|
"-c",
|
|
@@ -44,7 +47,7 @@ class TmuxAdapter {
|
|
|
44
47
|
commandLine
|
|
45
48
|
]);
|
|
46
49
|
}
|
|
47
|
-
await this.
|
|
50
|
+
await this.ensureManagedDefaults();
|
|
48
51
|
await this.setWindowMetadata(target, {
|
|
49
52
|
"@arcane_agents_managed": "1",
|
|
50
53
|
"@arcane_agents_worker_id": input.workerId,
|
|
@@ -63,7 +66,7 @@ class TmuxAdapter {
|
|
|
63
66
|
throw new Error(`Unable to resolve tmux pane for ${target}.`);
|
|
64
67
|
}
|
|
65
68
|
return {
|
|
66
|
-
session: this.sessionName,
|
|
69
|
+
session: this.config.sessionName,
|
|
67
70
|
window: input.windowName,
|
|
68
71
|
pane
|
|
69
72
|
};
|
|
@@ -75,23 +78,18 @@ class TmuxAdapter {
|
|
|
75
78
|
}
|
|
76
79
|
await this.stopGracefully(ref);
|
|
77
80
|
}
|
|
78
|
-
async
|
|
79
|
-
if (this.
|
|
81
|
+
async ensureManagedDefaults() {
|
|
82
|
+
if (this.managedDefaultsConfigured) {
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
82
85
|
if (!(await this.hasSession())) {
|
|
83
86
|
return;
|
|
84
87
|
}
|
|
85
88
|
const copyCommand = await detectClipboardCopyCommand();
|
|
86
|
-
|
|
87
|
-
this.
|
|
88
|
-
return;
|
|
89
|
+
for (const command of (0, tmuxClient_1.buildFriendlyTmuxDefaults)({ copyCommand })) {
|
|
90
|
+
await this.runTmux(command).catch(() => undefined);
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
this.runTmux(["set-option", "-t", this.sessionName, "set-clipboard", "external"]),
|
|
92
|
-
this.runTmux(["set-option", "-t", this.sessionName, "copy-command", copyCommand])
|
|
93
|
-
]).catch(() => undefined);
|
|
94
|
-
this.sessionClipboardConfigured = true;
|
|
92
|
+
this.managedDefaultsConfigured = true;
|
|
95
93
|
}
|
|
96
94
|
async windowExists(ref) {
|
|
97
95
|
try {
|
|
@@ -160,7 +158,8 @@ class TmuxAdapter {
|
|
|
160
158
|
throw error;
|
|
161
159
|
}
|
|
162
160
|
await new Promise((resolve, reject) => {
|
|
163
|
-
const
|
|
161
|
+
const tmuxCommand = (0, tmuxClient_1.buildTmuxCommandPrefix)(this.config);
|
|
162
|
+
const guardCommand = `${tmuxCommand} has-session -t ${shellQuote(externalSession)} >/dev/null 2>&1 || exit 0; exec ${tmuxCommand} attach-session -t ${shellQuote(externalSession)}`;
|
|
164
163
|
const child = (0, node_child_process_1.spawn)("xdg-terminal-exec", ["sh", "-lc", guardCommand], {
|
|
165
164
|
detached: true,
|
|
166
165
|
stdio: "ignore"
|
|
@@ -219,7 +218,7 @@ class TmuxAdapter {
|
|
|
219
218
|
}
|
|
220
219
|
async hasSession() {
|
|
221
220
|
try {
|
|
222
|
-
await this.runTmux(["has-session", "-t", this.sessionName]);
|
|
221
|
+
await this.runTmux(["has-session", "-t", this.config.sessionName]);
|
|
223
222
|
return true;
|
|
224
223
|
}
|
|
225
224
|
catch {
|
|
@@ -230,7 +229,7 @@ class TmuxAdapter {
|
|
|
230
229
|
return `${ref.session}:${ref.window}`;
|
|
231
230
|
}
|
|
232
231
|
async runTmux(args) {
|
|
233
|
-
const { stdout } = await execFileAsync("tmux", args, {
|
|
232
|
+
const { stdout } = await execFileAsync("tmux", (0, tmuxClient_1.buildTmuxArgs)(args, this.config), {
|
|
234
233
|
maxBuffer: 1024 * 1024
|
|
235
234
|
});
|
|
236
235
|
return stdout.trimEnd();
|
|
@@ -246,21 +245,6 @@ class TmuxAdapter {
|
|
|
246
245
|
}
|
|
247
246
|
await this.runTmux(["send-keys", "-t", target, "C-c"]).catch(() => undefined);
|
|
248
247
|
await delay(220);
|
|
249
|
-
const paneInfo = await this.runTmux([
|
|
250
|
-
"list-panes",
|
|
251
|
-
"-t",
|
|
252
|
-
target,
|
|
253
|
-
"-F",
|
|
254
|
-
"#{pane_pid}\t#{pane_current_command}\t#{pane_dead}"
|
|
255
|
-
]).catch(() => "");
|
|
256
|
-
const [panePidText = "", paneCommand = "", paneDeadFlag = "1"] = firstLine(paneInfo).split("\t");
|
|
257
|
-
const panePid = Number.parseInt(panePidText, 10);
|
|
258
|
-
const currentCommand = paneCommand.trim().toLowerCase();
|
|
259
|
-
const paneDead = paneDeadFlag === "1";
|
|
260
|
-
if (!paneDead && Number.isFinite(panePid) && panePid > 1 && currentCommand !== "bash" && currentCommand !== "zsh") {
|
|
261
|
-
await terminateProcessGroup(panePid).catch(() => undefined);
|
|
262
|
-
await delay(90);
|
|
263
|
-
}
|
|
264
248
|
await this.runTmux(["kill-window", "-t", target]).catch(() => undefined);
|
|
265
249
|
}
|
|
266
250
|
}
|
|
@@ -292,7 +276,7 @@ function normalizeOption(value) {
|
|
|
292
276
|
return value;
|
|
293
277
|
}
|
|
294
278
|
async function detectClipboardCopyCommand() {
|
|
295
|
-
const candidates =
|
|
279
|
+
const candidates = clipboardCandidatesForEnvironment(process.platform, process.env);
|
|
296
280
|
for (const candidate of candidates) {
|
|
297
281
|
if (await commandExists(candidate.binary)) {
|
|
298
282
|
return candidate.command;
|
|
@@ -300,18 +284,22 @@ async function detectClipboardCopyCommand() {
|
|
|
300
284
|
}
|
|
301
285
|
return undefined;
|
|
302
286
|
}
|
|
303
|
-
function
|
|
287
|
+
function clipboardCandidatesForEnvironment(platform, env = process.env) {
|
|
304
288
|
if (platform === "darwin") {
|
|
305
289
|
return [{ binary: "pbcopy", command: "pbcopy" }];
|
|
306
290
|
}
|
|
307
291
|
if (platform === "win32") {
|
|
308
292
|
return [{ binary: "clip.exe", command: "clip.exe" }];
|
|
309
293
|
}
|
|
310
|
-
|
|
294
|
+
const linuxCandidates = [
|
|
311
295
|
{ binary: "wl-copy", command: "wl-copy" },
|
|
312
296
|
{ binary: "xclip", command: "xclip -selection clipboard -in" },
|
|
313
297
|
{ binary: "xsel", command: "xsel --clipboard --input" }
|
|
314
298
|
];
|
|
299
|
+
if (platform === "linux" && isWslEnvironment(env)) {
|
|
300
|
+
return [{ binary: "clip.exe", command: "clip.exe" }, ...linuxCandidates];
|
|
301
|
+
}
|
|
302
|
+
return linuxCandidates;
|
|
315
303
|
}
|
|
316
304
|
async function commandExists(binary) {
|
|
317
305
|
const locator = process.platform === "win32" ? "where" : "which";
|
|
@@ -325,15 +313,6 @@ async function commandExists(binary) {
|
|
|
325
313
|
return false;
|
|
326
314
|
}
|
|
327
315
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
maxBuffer: 1024 * 64
|
|
331
|
-
});
|
|
332
|
-
const pgid = Number.parseInt(stdout.trim(), 10);
|
|
333
|
-
if (!Number.isFinite(pgid) || pgid <= 1) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
await execFileAsync("kill", ["-TERM", `-${pgid}`], { maxBuffer: 1024 * 64 }).catch(() => undefined);
|
|
337
|
-
await delay(120);
|
|
338
|
-
await execFileAsync("kill", ["-KILL", `-${pgid}`], { maxBuffer: 1024 * 64 }).catch(() => undefined);
|
|
316
|
+
function isWslEnvironment(env) {
|
|
317
|
+
return Boolean(env.WSL_DISTRO_NAME || env.WSL_INTEROP || env.WSLENV);
|
|
339
318
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildTmuxArgs = buildTmuxArgs;
|
|
4
|
+
exports.buildTmuxAttachArgs = buildTmuxAttachArgs;
|
|
5
|
+
exports.buildTmuxCommandPrefix = buildTmuxCommandPrefix;
|
|
6
|
+
exports.buildFriendlyTmuxDefaults = buildFriendlyTmuxDefaults;
|
|
7
|
+
function buildTmuxArgs(args, options) {
|
|
8
|
+
return ["-L", options.socketName, ...args];
|
|
9
|
+
}
|
|
10
|
+
function buildTmuxAttachArgs(target, options) {
|
|
11
|
+
return buildTmuxArgs(["attach-session", "-t", target], options);
|
|
12
|
+
}
|
|
13
|
+
function buildTmuxCommandPrefix(options) {
|
|
14
|
+
return `tmux -L ${shellQuote(options.socketName)}`;
|
|
15
|
+
}
|
|
16
|
+
function buildFriendlyTmuxDefaults(options = {}) {
|
|
17
|
+
const copyAction = options.copyCommand ? "copy-pipe-and-cancel" : "copy-selection-and-cancel";
|
|
18
|
+
const commands = [
|
|
19
|
+
["set-option", "-g", "mouse", "on"],
|
|
20
|
+
["set-option", "-s", "escape-time", "0"],
|
|
21
|
+
["set-window-option", "-g", "history-limit", "100000"],
|
|
22
|
+
["bind-key", "-T", "copy-mode", "MouseDragEnd1Pane", "send-keys", "-X", copyAction],
|
|
23
|
+
["bind-key", "-T", "copy-mode-vi", "MouseDragEnd1Pane", "send-keys", "-X", copyAction]
|
|
24
|
+
];
|
|
25
|
+
if (options.copyCommand) {
|
|
26
|
+
commands.splice(3, 0, ["set-option", "-s", "set-clipboard", "external"], ["set-option", "-s", "copy-command", options.copyCommand]);
|
|
27
|
+
}
|
|
28
|
+
return commands;
|
|
29
|
+
}
|
|
30
|
+
function shellQuote(value) {
|
|
31
|
+
if (value.length === 0) {
|
|
32
|
+
return "''";
|
|
33
|
+
}
|
|
34
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
35
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const tmuxClient_1 = require("./tmuxClient");
|
|
5
|
+
const tmuxAdapter_1 = require("./tmuxAdapter");
|
|
6
|
+
(0, vitest_1.describe)("tmuxClient", () => {
|
|
7
|
+
(0, vitest_1.it)("prefixes tmux commands with the managed socket name", () => {
|
|
8
|
+
(0, vitest_1.expect)((0, tmuxClient_1.buildTmuxArgs)(["list-sessions"], { socketName: "arcane-agents" })).toEqual([
|
|
9
|
+
"-L",
|
|
10
|
+
"arcane-agents",
|
|
11
|
+
"list-sessions"
|
|
12
|
+
]);
|
|
13
|
+
});
|
|
14
|
+
(0, vitest_1.it)("builds attach-session commands on the managed socket", () => {
|
|
15
|
+
(0, vitest_1.expect)((0, tmuxClient_1.buildTmuxAttachArgs)("arcane-agents:worker-1", { socketName: "arcane-agents" })).toEqual([
|
|
16
|
+
"-L",
|
|
17
|
+
"arcane-agents",
|
|
18
|
+
"attach-session",
|
|
19
|
+
"-t",
|
|
20
|
+
"arcane-agents:worker-1"
|
|
21
|
+
]);
|
|
22
|
+
});
|
|
23
|
+
(0, vitest_1.it)("builds a shell-safe tmux command prefix", () => {
|
|
24
|
+
(0, vitest_1.expect)((0, tmuxClient_1.buildTmuxCommandPrefix)({ socketName: "arcane-agents-demo" })).toBe("tmux -L 'arcane-agents-demo'");
|
|
25
|
+
});
|
|
26
|
+
(0, vitest_1.it)("enables friendly defaults with clipboard-aware copy bindings when a copy command is available", () => {
|
|
27
|
+
(0, vitest_1.expect)((0, tmuxClient_1.buildFriendlyTmuxDefaults)({ copyCommand: "wl-copy" })).toEqual([
|
|
28
|
+
["set-option", "-g", "mouse", "on"],
|
|
29
|
+
["set-option", "-s", "escape-time", "0"],
|
|
30
|
+
["set-window-option", "-g", "history-limit", "100000"],
|
|
31
|
+
["set-option", "-s", "set-clipboard", "external"],
|
|
32
|
+
["set-option", "-s", "copy-command", "wl-copy"],
|
|
33
|
+
["bind-key", "-T", "copy-mode", "MouseDragEnd1Pane", "send-keys", "-X", "copy-pipe-and-cancel"],
|
|
34
|
+
["bind-key", "-T", "copy-mode-vi", "MouseDragEnd1Pane", "send-keys", "-X", "copy-pipe-and-cancel"]
|
|
35
|
+
]);
|
|
36
|
+
});
|
|
37
|
+
(0, vitest_1.it)("falls back to tmux buffer copy bindings when no clipboard command is available", () => {
|
|
38
|
+
(0, vitest_1.expect)((0, tmuxClient_1.buildFriendlyTmuxDefaults)()).toEqual([
|
|
39
|
+
["set-option", "-g", "mouse", "on"],
|
|
40
|
+
["set-option", "-s", "escape-time", "0"],
|
|
41
|
+
["set-window-option", "-g", "history-limit", "100000"],
|
|
42
|
+
["bind-key", "-T", "copy-mode", "MouseDragEnd1Pane", "send-keys", "-X", "copy-selection-and-cancel"],
|
|
43
|
+
["bind-key", "-T", "copy-mode-vi", "MouseDragEnd1Pane", "send-keys", "-X", "copy-selection-and-cancel"]
|
|
44
|
+
]);
|
|
45
|
+
});
|
|
46
|
+
(0, vitest_1.it)("prefers the Windows clipboard bridge when running inside WSL", () => {
|
|
47
|
+
(0, vitest_1.expect)((0, tmuxAdapter_1.clipboardCandidatesForEnvironment)("linux", { WSL_DISTRO_NAME: "Ubuntu" })[0]).toEqual({
|
|
48
|
+
binary: "clip.exe",
|
|
49
|
+
command: "clip.exe"
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.it)("keeps native Linux clipboard commands first outside WSL", () => {
|
|
53
|
+
(0, vitest_1.expect)((0, tmuxAdapter_1.clipboardCandidatesForEnvironment)("linux", {})[0]).toEqual({
|
|
54
|
+
binary: "wl-copy",
|
|
55
|
+
command: "wl-copy"
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -35,12 +35,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.TerminalBridge = void 0;
|
|
37
37
|
const pty = __importStar(require("node-pty"));
|
|
38
|
+
const tmuxClient_1 = require("../tmux/tmuxClient");
|
|
38
39
|
class TerminalBridge {
|
|
39
40
|
workers;
|
|
41
|
+
tmuxConfig;
|
|
40
42
|
options;
|
|
41
43
|
lastOutputActivityAtByWorker = new Map();
|
|
42
|
-
constructor(workers, options = {}) {
|
|
44
|
+
constructor(workers, tmuxConfig, options = {}) {
|
|
43
45
|
this.workers = workers;
|
|
46
|
+
this.tmuxConfig = tmuxConfig;
|
|
44
47
|
this.options = options;
|
|
45
48
|
}
|
|
46
49
|
connect(workerId, socket) {
|
|
@@ -65,7 +68,7 @@ class TerminalBridge {
|
|
|
65
68
|
const rows = Math.max(5, control.rows);
|
|
66
69
|
if (!terminal) {
|
|
67
70
|
try {
|
|
68
|
-
terminal = pty.spawn("tmux",
|
|
71
|
+
terminal = pty.spawn("tmux", (0, tmuxClient_1.buildTmuxAttachArgs)(tmuxTarget, this.tmuxConfig), {
|
|
69
72
|
name: "xterm-256color",
|
|
70
73
|
cols,
|
|
71
74
|
rows,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arcane-agents",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Local-first visual control room for tmux-backed coding agents",
|
|
5
5
|
"bin": {
|
|
6
6
|
"arcane-agents": "dist/server/server/cli.js"
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
"node": ">=20"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"dev": "
|
|
19
|
+
"dev": "node ./dev.mjs",
|
|
20
20
|
"dev:clean": "node ./kill-dev-ports.mjs 7600 7601",
|
|
21
|
+
"dev:stack": "concurrently -k \"npm:dev:server\" \"npm:dev:client\"",
|
|
21
22
|
"dev:server": "ARCANE_AGENTS_API_PORT=7601 tsx watch src/server/index.ts",
|
|
22
|
-
"dev:client": "vite --
|
|
23
|
+
"dev:client": "vite --port 7600",
|
|
23
24
|
"build": "vite build && tsc -p tsconfig.server.json",
|
|
24
25
|
"start": "node dist/server/server/cli.js start",
|
|
25
26
|
"cli": "tsx src/server/cli.ts",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
4
|
-
* https://github.com/chjj/term.js
|
|
5
|
-
* @license MIT
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in
|
|
15
|
-
* all copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
-
* THE SOFTWARE.
|
|
24
|
-
*
|
|
25
|
-
* Originally forked from (with the author's permission):
|
|
26
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
27
|
-
* http://bellard.org/jslinux/
|
|
28
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
29
|
-
* The original design remains. The terminal itself
|
|
30
|
-
* has been extended to include xterm CSI codes, among
|
|
31
|
-
* other features.
|
|
32
|
-
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;inset:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}:root{color-scheme:dark;font-family:Trebuchet MS,Segoe UI,sans-serif;background:#0f1815;color:#e9f0df}*{box-sizing:border-box}html,body,#root{margin:0;width:100%;height:100%}body{background:radial-gradient(circle at 15% 10%,#2d5c4c,#162821 45%,#0d1412)}.app-shell{width:100%;height:100%;display:grid;grid-template-columns:minmax(380px,1.55fr) minmax(360px,1fr);gap:0;padding:10px}.layout-divider{position:relative;cursor:col-resize;touch-action:none}.layout-divider:before{content:"";position:absolute;top:8px;bottom:8px;left:50%;width:2px;border-radius:999px;transform:translate(-50%);background:#d6e6ba3d;transition:background-color .11s ease}.layout-divider:hover:before,.layout-divider.layout-divider-active:before{background:#eaf3d6ad}body.split-pane-dragging{cursor:col-resize;user-select:none}.map-column{min-height:0;display:flex;flex-direction:column;border:1px solid rgba(218,235,186,.22);border-radius:14px;overflow:hidden;background:#12221b99}.map-container{position:relative;flex:1;min-height:0}.map-canvas{width:100%;height:100%;display:block;cursor:pointer}.map-canvas:focus{outline:none}.map-tooltip{position:absolute;z-index:4;min-width:190px;max-width:280px;padding:8px 10px;font-size:12px;line-height:1.4;color:#f4f6e7;background:#0b100ee0;border:1px solid rgba(223,234,189,.22);border-radius:8px;pointer-events:none}.map-tooltip-title{font-weight:700;margin-bottom:2px}.bottom-bar{display:flex;align-items:center;gap:8px;height:74px;flex-shrink:0;padding:11px;overflow:hidden;border-top:1px solid rgba(218,235,186,.18);background:linear-gradient(180deg,#101a16eb,#0d1412f2)}.bar-btn{border:1px solid rgba(207,224,181,.34);border-radius:9px;background:#2b4336f2;color:#f0f5e3;padding:9px 13px;font-weight:600;cursor:pointer;transition:transform 90ms ease,background-color 90ms ease}.bar-btn:hover{transform:translateY(-1px);background:#3d5b49f2}.bar-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}.bar-btn.subtle{background:#202a25f2}.bar-btn.danger{background:#682c2cf2;border-color:#dc8c828c}.bar-btn.accent{font-size:20px;line-height:1;padding:7px 13px}.selected-worker-meta{margin-right:auto;min-width:0}.selected-worker-name{font-weight:700;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.selected-worker-subline{font-size:12px;color:#eef3dfcc;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.terminal-column{min-height:0;border:1px solid rgba(218,235,186,.22);border-radius:14px;overflow:hidden;display:flex;flex-direction:column;background:#0c1311eb}.terminal-column.terminal-column-selected{border-color:#ecf2d45c}.terminal-column.terminal-column-focused{border-color:#88e9ffdb;box-shadow:0 0 0 1px #37adca73,0 0 22px #1a627338}.terminal-header{min-height:52px;padding:14px 16px;font-weight:700;border-bottom:1px solid rgba(218,235,186,.18);display:flex;align-items:center;justify-content:space-between;gap:10px}.terminal-header-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.terminal-ready-chip{flex:0 0 auto;border:1px solid rgba(255,233,164,.9);border-radius:999px;background:linear-gradient(110deg,#c1922dfa,#f6d273fa,#a77d22fa);background-size:220% 100%;color:#2f2205;padding:3px 10px;font-size:11px;font-weight:700;line-height:1.25;letter-spacing:.03em;box-shadow:inset 0 1px #fff8df8c,0 0 0 1px #70501252;animation:ready-badge-sheen 1.9s linear infinite}.terminal-open-external{border:1px solid rgba(207,224,181,.34);border-radius:8px;background:#20342af2;color:#f0f5e3;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;font-size:16px;line-height:1;cursor:pointer}.terminal-open-external:hover{background:#345041f2}.terminal-open-external:disabled{opacity:.45;cursor:not-allowed}.terminal-panel{flex:1;min-height:0;padding:8px}.worker-roster{flex:1;min-height:0;padding:10px;display:flex;flex-direction:column;gap:8px;overflow:auto}.worker-roster-section-label{margin:4px 2px 2px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#e5edd3c2}.worker-roster-item{border:1px solid rgba(208,224,181,.22);border-radius:9px;background:#14221be6;color:#f1f5e6;text-align:left;padding:9px 10px;cursor:pointer;display:flex;flex-direction:column;gap:2px}.worker-roster-main{display:flex;align-items:center;gap:10px;min-width:0}.worker-roster-avatar{width:42px;height:42px;image-rendering:pixelated;object-fit:contain;flex:0 0 auto}.worker-roster-text{min-width:0;display:flex;flex-direction:column;gap:2px}.worker-roster-item:hover{background:#20352aeb;border-color:#e2edc761}.worker-roster-item.active{border-color:#eff4d4bd;background:#355040eb}.worker-roster-item.worker-roster-item-summon{background:#1c2a22e6}.worker-roster-item.worker-roster-item-summon:hover{background:#283f32eb}.worker-roster-item.worker-roster-item-summon.active{border-color:#9de5b0d6;background:#345643f0}.worker-roster-summon-avatar{border-radius:10px;border:1px solid rgba(170,227,186,.44);background:#284636f2;padding:2px}.worker-roster-summon-glyph{width:42px;height:42px;border-radius:10px;border:1px solid rgba(170,227,186,.44);background:#284636f2;color:#e8f7de;display:inline-flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;flex:0 0 auto}.worker-roster-name{min-width:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.worker-roster-name-row{min-width:0;display:flex;align-items:center;gap:6px}.worker-complete-badge{flex:0 0 auto;border-radius:999px;border:1px solid rgba(252,229,153,.88);background:linear-gradient(115deg,#b28426fa,#f4d06efa,#9e751dfa);background-size:220% 100%;color:#2d2106;display:inline-flex;align-items:center;justify-content:center;padding:1px 6px;font-size:9px;font-weight:700;letter-spacing:.05em;line-height:1.25;box-shadow:inset 0 1px #fff8df80;animation:ready-badge-sheen 2.05s linear infinite}.worker-roster-item.active .worker-complete-badge{border-color:#fff0b8f5;background:linear-gradient(115deg,#c4952cfc,#ffdd7efc,#ab8022fc);color:#2b1f05}@keyframes ready-badge-sheen{0%{background-position:200% 50%}to{background-position:-20% 50%}}.worker-roster-meta{font-size:12px;color:#e6ecd8c7}.worker-roster-activity{font-size:12px;color:#eef4e1db}.worker-roster-empty{border:1px dashed rgba(207,223,182,.28);border-radius:8px;padding:12px;color:#e8f0dad1;font-size:13px}.rally-command-card{margin-top:4px;padding:10px;border:1px solid rgba(185,225,198,.36);border-radius:10px;background:linear-gradient(180deg,#13261ff5,#0f1f1af5);display:flex;flex-direction:column;gap:8px}.rally-command-header{display:flex;align-items:center;justify-content:space-between;gap:10px}.rally-command-title{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#e4f0cfeb}.rally-command-count{font-size:11px;color:#ddeac7b8}.rally-command-input{font-family:Consolas,Monaco,Lucida Console,monospace;min-height:78px;line-height:1.35;resize:vertical}.rally-command-actions{display:flex;align-items:center;justify-content:space-between;gap:10px}.rally-command-hint{font-size:11px;color:#d9e5c2c7}.rally-command-result{font-size:12px;color:#e9f1d5e6}.overlay{position:fixed;inset:0;z-index:25;display:grid;place-items:center;background:#050a08ad;backdrop-filter:blur(2px)}.overlay-no-blur{backdrop-filter:none}.dialog{width:min(880px,calc(100vw - 34px));max-height:min(78vh,740px);overflow:auto;padding:16px;border-radius:12px;border:1px solid rgba(222,236,193,.26);background:linear-gradient(180deg,#141e1af7,#0d1311fa)}.dialog-title{margin-bottom:12px;font-size:20px;font-weight:700}.input,.palette-input{width:100%;border-radius:9px;border:1px solid rgba(218,235,186,.32);background:#090f0df2;color:#ecf3e1;padding:10px 12px;font-size:14px}.dialog-grid{margin-top:12px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.dialog-section-label{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;margin-bottom:8px;color:#e6ecd8d6}.option-list{display:flex;flex-direction:column;gap:6px;max-height:340px;overflow:auto}.option-btn,.palette-item{border:1px solid rgba(208,224,181,.22);border-radius:8px;background:#14221be6;color:#f1f5e6;text-align:left;padding:8px 10px;cursor:pointer;display:flex;flex-direction:column;gap:2px}.option-btn small,.palette-item small{color:#e2ebd2b8;font-size:11px}.option-btn.selected,.palette-item.active{border-color:#f0f3c8c7;background:#354f40eb}.dialog-actions{margin-top:14px;display:flex;justify-content:flex-end;gap:8px}.shortcuts-dialog{width:min(720px,calc(100vw - 34px))}.shortcut-grid{display:grid;grid-template-columns:1fr;gap:8px}.shortcut-row{display:grid;grid-template-columns:140px 1fr;gap:10px;align-items:center;padding:8px 10px;border-radius:8px;border:1px solid rgba(214,229,188,.16);background:#101a15d1}kbd{display:inline-block;min-width:52px;padding:4px 7px;border-radius:6px;border:1px solid rgba(233,242,206,.36);background:#0a0e0ceb;color:#edf4dd;font-size:12px;font-weight:700;text-align:center}.rename-dialog{width:min(540px,calc(100vw - 34px))}.rename-subtitle{margin-top:-2px;margin-bottom:10px;color:#e3ebd3c2;font-size:13px}.rename-form{display:flex;flex-direction:column}.confirm-dialog{width:min(520px,calc(100vw - 34px))}.confirm-copy{color:#e7eed9d9;font-size:14px;line-height:1.4}.confirm-hint{margin-top:8px;color:#d6e0c0c2;font-size:12px}.palette{width:min(760px,calc(100vw - 30px));border-radius:12px;border:1px solid rgba(222,236,193,.26);background:linear-gradient(180deg,#121e18f7,#0d1411fa);padding:12px}.palette-list{margin-top:8px;max-height:410px;overflow:auto;display:flex;flex-direction:column;gap:6px}.palette-empty{padding:12px;font-size:13px;color:#e2ebd2cc}.error-toast{position:fixed;right:14px;bottom:14px;z-index:40;max-width:420px;border:1px solid rgba(242,169,158,.58);background:#4b1713e6;border-radius:8px;padding:10px 12px;cursor:pointer}.batch-spawn-dialog{width:min(640px,calc(100vw - 34px))}.batch-spawn-config-list{margin-top:8px}.batch-spawn-config-summary{display:flex;align-items:center;gap:10px;margin-bottom:10px}.batch-spawn-config-summary small{color:#e2ebd2b8;font-size:12px}.batch-spawn-back{border:1px solid rgba(207,224,181,.34);border-radius:8px;background:#20342af2;color:#f0f5e3;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;font-size:16px;cursor:pointer}.batch-spawn-back:hover{background:#345041f2}.batch-spawn-textarea{min-height:160px;resize:vertical;font-family:Consolas,Monaco,Lucida Console,monospace;line-height:1.4}.batch-spawn-footer{margin-top:12px;display:flex;align-items:center;justify-content:space-between;gap:10px}.batch-spawn-count{font-size:13px;color:#e2ebd2c7}.batch-spawn-progress{display:flex;align-items:center;gap:10px;flex:1}.batch-spawn-progress-bar{flex:1;height:6px;border-radius:3px;background:#daebba2e;overflow:hidden}.batch-spawn-progress-fill{height:100%;border-radius:3px;background:#8cdcaad9;transition:width .15s ease}.batch-spawn-progress-text{font-size:12px;color:#e2ebd2d1;white-space:nowrap}@media(max-width:960px){.app-shell{grid-template-columns:1fr;grid-template-rows:1fr minmax(280px,38vh)}.dialog-grid{grid-template-columns:1fr}}
|