tring-chat 0.1.12 → 0.1.14

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 CHANGED
@@ -267,9 +267,29 @@ Browsers reserve `Ctrl+1`–`Ctrl+8` for tab switching, so `Shift+digit` is the
267
267
  fallback that always works in an ordinary tab. Clicking a thumbnail also focuses it,
268
268
  and right-clicking one opens the same dialog `r` does.
269
269
 
270
+ Those are picker keys. Everything else you type goes to the focused session, with one
271
+ exception: **`Ctrl+Enter` and `Shift+Enter` insert a newline** instead of submitting.
272
+ A terminal has no modifier bits for Enter — every variant is a bare `\r` on the wire —
273
+ so tring sends `ESC`+`CR` for those two chords, which is what Claude Code and other
274
+ agent CLIs read as "break the line". Native terminals need `/terminal-setup` to do the
275
+ same thing; here it works out of the box.
276
+
277
+ ## Rearranging tiles
278
+
279
+ Drag a tile onto another slot to move it there. Dropped on an empty slot it simply
280
+ moves; dropped on another session the two swap. The slot is the key, so a moved session
281
+ answers to its new number from then on. Escape abandons a drag. The order is saved with
282
+ the project and survives a restart.
283
+
284
+ `$TRING_SLOT` is fixed when a session's shell starts, so a moved session keeps reporting
285
+ its old slot until it is restarted. Nothing in tring relies on it: hooks and the API
286
+ address sessions by `$TRING_SESSION_ID`.
287
+
270
288
  ## Naming and colouring tiles
271
289
 
272
290
  Right-click a tile — or press `r` in the picker — to give it a name and a colour.
291
+ The same dialog has a **Delete** button, which kills the session and frees the slot
292
+ back to empty; `x` in the picker does the same thing.
273
293
 
274
294
  The colour is a ring *outside* the status border, never instead of it, so a tile you
275
295
  have tinted still reports whether it is busy, finished or dead. Twenty-four choices:
@@ -409,9 +429,9 @@ Two things are deliberate:
409
429
  Auto-executing whatever was there last time is how four dev servers end up fighting
410
430
  over a port.
411
431
 
412
- ## Dropping images on a terminal
432
+ ## Dropping files on a terminal
413
433
 
414
- Drag a screenshot onto the centre terminal and its path is typed into the prompt,
434
+ Drag a screenshot, a spreadsheet or any other file onto the centre terminal and its path is typed into the prompt,
415
435
  the way dropping a file on any other terminal types one. Claude Code reads the
416
436
  path from there.
417
437
 
@@ -421,10 +441,12 @@ the wrong machine's anyway whenever you have the deck open on a phone or a lapto
421
441
  across the room. So the bytes go to the daemon, which writes them down on the
422
442
  machine the shell is actually running on and answers with the path it chose.
423
443
 
424
- - PNG, JPEG, GIF and WebP, up to 10MB. The type is read from the file's first
425
- bytes, not from what the browser called it.
426
- - The daemon names every file itself, under `~/.config/tring/uploads`. Nothing
427
- a client sends reaches a filesystem path.
444
+ - Any file up to 10MB. An image (PNG, JPEG, GIF, WebP) is named by its first
445
+ bytes, not by what the browser called it; anything else keeps its own name,
446
+ cut down to letters, digits, `.`, `-` and `_`, so Claude can tell a `.xlsx`
447
+ from a `.csv`.
448
+ - Every file lands under `~/.config/tring/uploads` behind a random prefix, so
449
+ no name a client sends can point anywhere else.
428
450
  - The last 20 are kept. The directory is emptied when the daemon stops.
429
451
  - The upload goes through the same token as the rest of the API.
430
452
 
package/dist/tring.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
5
5
  import { createServer } from "node:http";
6
6
  import { createServer as createSecureServer } from "node:https";
7
- import path8 from "node:path";
7
+ import path9 from "node:path";
8
8
  import { fileURLToPath } from "node:url";
9
9
  import { WebSocketServer } from "ws";
10
10
 
@@ -436,7 +436,7 @@ function snapshot(term) {
436
436
  const line = buf.getLine(buf.viewportY + y);
437
437
  const out = [];
438
438
  if (line) {
439
- let run = null;
439
+ let run2 = null;
440
440
  for (let x = 0; x < term.cols; x++) {
441
441
  const cell = line.getCell(x);
442
442
  if (!cell) break;
@@ -445,11 +445,11 @@ function snapshot(term) {
445
445
  const fg = cell.isFgDefault() ? -1 : cell.getFgColor();
446
446
  const bg = cell.isBgDefault() ? -1 : cell.getBgColor();
447
447
  const bold = cell.isBold() !== 0;
448
- if (run && run.fg === fg && run.bg === bg && run.bold === bold) {
449
- run.text += text2;
448
+ if (run2 && run2.fg === fg && run2.bg === bg && run2.bold === bold) {
449
+ run2.text += text2;
450
450
  } else {
451
- run = { text: text2, fg, bg, bold };
452
- out.push(run);
451
+ run2 = { text: text2, fg, bg, bold };
452
+ out.push(run2);
453
453
  }
454
454
  }
455
455
  while (out.length > 0) {
@@ -517,6 +517,7 @@ var CWD_ENFORCE_MS = 400;
517
517
  var Session = class {
518
518
  id;
519
519
  projectId;
520
+ /** Changes only through SessionManager.move; `$TRING_SLOT` keeps the spawn-time value. */
520
521
  slot;
521
522
  command;
522
523
  name;
@@ -829,6 +830,26 @@ var SessionManager = class {
829
830
  s.color = color !== null && HEX.test(color) ? color : null;
830
831
  this.structureChanged();
831
832
  }
833
+ /**
834
+ * Drags a session to another slot, swapping with whatever already holds it.
835
+ * One structure change for the pair, so no client ever sees both sessions
836
+ * claiming a slot, or one of them nowhere.
837
+ */
838
+ move(id, slot) {
839
+ const s = this.byId.get(id);
840
+ if (!s || !Number.isInteger(slot) || slot < 1 || slot > SLOT_COUNT) return;
841
+ if (s.slot === slot) return;
842
+ const other = this.bySlot.get(slot);
843
+ const from = s.slot;
844
+ this.bySlot.delete(from);
845
+ if (other) {
846
+ other.slot = from;
847
+ this.bySlot.set(from, other);
848
+ }
849
+ s.slot = slot;
850
+ this.bySlot.set(slot, s);
851
+ this.structureChanged();
852
+ }
832
853
  kill(id) {
833
854
  const s = this.byId.get(id);
834
855
  if (!s) return;
@@ -1068,7 +1089,7 @@ var ProjectManager = class _ProjectManager {
1068
1089
  import { createReadStream } from "node:fs";
1069
1090
  import { readdir as readdir3, realpath, stat as stat3 } from "node:fs/promises";
1070
1091
  import os4 from "node:os";
1071
- import path6 from "node:path";
1092
+ import path7 from "node:path";
1072
1093
 
1073
1094
  // src/security.ts
1074
1095
  import { createHash, timingSafeEqual } from "node:crypto";
@@ -1290,7 +1311,7 @@ function parseLimits(text2) {
1290
1311
  }
1291
1312
  function readLimits(timeoutMs = 3e4) {
1292
1313
  const args = ["-p", "/usage", "--output-format", "json"];
1293
- const run = (cmd) => new Promise((resolve, reject) => {
1314
+ const run2 = (cmd) => new Promise((resolve, reject) => {
1294
1315
  const child = spawn2(cmd, args, { stdio: ["ignore", "pipe", "ignore"] });
1295
1316
  let out = "";
1296
1317
  let settled = false;
@@ -1320,8 +1341,8 @@ function readLimits(timeoutMs = 3e4) {
1320
1341
  }, 50);
1321
1342
  });
1322
1343
  });
1323
- return run("claude").catch(
1324
- (err) => process.platform === "win32" && err.code === "ENOENT" ? run("claude.cmd") : Promise.reject(err)
1344
+ return run2("claude").catch(
1345
+ (err) => process.platform === "win32" && err.code === "ENOENT" ? run2("claude.cmd") : Promise.reject(err)
1325
1346
  );
1326
1347
  }
1327
1348
  async function collectUsage(dir, now) {
@@ -1356,22 +1377,25 @@ function sniffImage(bytes) {
1356
1377
  if (at(0, [82, 73, 70, 70]) && at(8, [87, 69, 66, 80])) return ".webp";
1357
1378
  return null;
1358
1379
  }
1359
- var NotAnImage = class extends Error {
1360
- constructor() {
1361
- super("only PNG, JPEG, GIF and WebP images can be dropped on a terminal");
1362
- }
1363
- };
1364
1380
  var UploadStore = class {
1365
1381
  constructor(dir, keep = KEEP) {
1366
1382
  this.dir = dir;
1367
1383
  this.keep = keep;
1368
1384
  }
1369
- /** Writes the bytes and returns the absolute path to type into the prompt. */
1370
- async save(bytes) {
1385
+ /**
1386
+ * Writes the bytes and returns the absolute path to type into the prompt.
1387
+ *
1388
+ * An image is named by its bytes. Anything else — a spreadsheet, a PDF, a
1389
+ * log — keeps its own name, since that is how Claude tells a .xlsx from a
1390
+ * .csv, cut down to word characters, dots and dashes: no separator survives,
1391
+ * so the random prefix always stays the first segment and traversal has
1392
+ * nothing to work with.
1393
+ */
1394
+ async save(bytes, name = "") {
1371
1395
  const ext = sniffImage(bytes);
1372
- if (!ext) throw new NotAnImage();
1396
+ const tail = ext ?? "-" + (name.replace(/[^\w.-]+/g, "_").slice(-80) || "file");
1373
1397
  await mkdir3(this.dir, { recursive: true, mode: 448 });
1374
- const file = path5.join(this.dir, randomBytes2(8).toString("hex") + ext);
1398
+ const file = path5.join(this.dir, randomBytes2(8).toString("hex") + tail);
1375
1399
  await writeFile3(file, bytes, { mode: 384 });
1376
1400
  await this.prune();
1377
1401
  return file;
@@ -1400,6 +1424,134 @@ var UploadStore = class {
1400
1424
  }
1401
1425
  };
1402
1426
 
1427
+ // src/git-diff.ts
1428
+ import { execFile } from "node:child_process";
1429
+ import { lstat, readFile as readFile4 } from "node:fs/promises";
1430
+ import path6 from "node:path";
1431
+ import { promisify } from "node:util";
1432
+ var run = promisify(execFile);
1433
+ var MAX_PATCH_BYTES = 1 << 20;
1434
+ var EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
1435
+ var SAFE = ["-c", "core.fsmonitor=false", "-c", "core.quotePath=false"];
1436
+ async function git(cwd, args) {
1437
+ const { stdout } = await run("git", [...SAFE, ...args], {
1438
+ cwd,
1439
+ encoding: "utf8",
1440
+ maxBuffer: 64 << 20
1441
+ });
1442
+ return stdout;
1443
+ }
1444
+ async function filtersOff(root) {
1445
+ const keys = await git(root, ["config", "--name-only", "--get-regexp", "^filter\\."]).catch(() => "");
1446
+ const drivers = new Set(keys.split("\n").filter(Boolean).map((k) => k.slice(0, k.lastIndexOf("."))));
1447
+ return [...drivers].flatMap((d) => [
1448
+ "-c",
1449
+ `${d}.clean=`,
1450
+ "-c",
1451
+ `${d}.smudge=`,
1452
+ "-c",
1453
+ `${d}.process=`,
1454
+ "-c",
1455
+ `${d}.required=false`
1456
+ ]);
1457
+ }
1458
+ var pathOf = (line) => line.slice(6).replace(/\t$/, "");
1459
+ function splitPatch(text2) {
1460
+ const out = [];
1461
+ for (const chunk of text2.split(/^(?=diff --git )/m)) {
1462
+ if (!chunk.startsWith("diff --git ")) continue;
1463
+ const lines = chunk.replace(/\n$/, "").split("\n");
1464
+ const plus = lines.find((l) => l.startsWith("+++ "));
1465
+ const minus = lines.find((l) => l.startsWith("--- "));
1466
+ const header = /^diff --git a\/(.*) b\/(.*)$/.exec(lines[0]);
1467
+ const file = plus && plus !== "+++ /dev/null" ? pathOf(plus) : minus && minus !== "--- /dev/null" ? pathOf(minus) : header?.[2] ?? lines[0];
1468
+ if (lines.some((l) => l.startsWith("Binary files "))) {
1469
+ out.push({ path: file, added: 0, removed: 0, patch: "", note: "binary" });
1470
+ continue;
1471
+ }
1472
+ const start = lines.findIndex((l) => l.startsWith("@@"));
1473
+ const hunks = start < 0 ? [] : lines.slice(start);
1474
+ let added = 0;
1475
+ let removed = 0;
1476
+ for (const l of hunks) {
1477
+ if (l.startsWith("+")) added++;
1478
+ else if (l.startsWith("-")) removed++;
1479
+ }
1480
+ out.push({ path: file, added, removed, patch: hunks.join("\n") });
1481
+ }
1482
+ return out;
1483
+ }
1484
+ async function untracked(root, rel, budget) {
1485
+ const full = path6.join(root, rel);
1486
+ let bytes;
1487
+ try {
1488
+ const st = await lstat(full);
1489
+ if (!st.isFile()) return { path: rel, added: 0, removed: 0, patch: "", note: "not a regular file" };
1490
+ if (st.size > budget) return { path: rel, added: 0, removed: 0, patch: "", note: "too large" };
1491
+ bytes = await readFile4(full);
1492
+ } catch (err) {
1493
+ if (err.code === "ENOENT") return null;
1494
+ return { path: rel, added: 0, removed: 0, patch: "", note: "unreadable" };
1495
+ }
1496
+ if (bytes.length === 0) return { path: rel, added: 0, removed: 0, patch: "" };
1497
+ if (bytes.subarray(0, 8e3).includes(0)) return { path: rel, added: 0, removed: 0, patch: "", note: "binary" };
1498
+ const lines = bytes.toString("utf8").replace(/\n$/, "").split("\n");
1499
+ return {
1500
+ path: rel,
1501
+ added: lines.length,
1502
+ removed: 0,
1503
+ patch: [`@@ -0,0 +1,${lines.length} @@`, ...lines.map((l) => `+${l}`)].join("\n")
1504
+ };
1505
+ }
1506
+ async function gitDiff(cwd) {
1507
+ let root;
1508
+ try {
1509
+ root = (await git(cwd, ["rev-parse", "--show-toplevel"])).trim();
1510
+ } catch {
1511
+ return { cwd, error: "not a git repository" };
1512
+ }
1513
+ try {
1514
+ const base2 = await git(root, ["rev-parse", "--verify", "-q", "HEAD"]).then(() => "HEAD", () => EMPTY_TREE);
1515
+ const tracked = splitPatch(await git(root, [
1516
+ ...await filtersOff(root),
1517
+ "diff",
1518
+ base2,
1519
+ "--no-ext-diff",
1520
+ "--no-textconv",
1521
+ "--no-color",
1522
+ "--no-renames",
1523
+ // Whatever diff.noprefix / diff.mnemonicPrefix the user has set.
1524
+ "--src-prefix=a/",
1525
+ "--dst-prefix=b/"
1526
+ ]));
1527
+ const names = (await git(root, ["ls-files", "--others", "--exclude-standard", "-z"])).split("\0").filter(Boolean).sort();
1528
+ const loose = [];
1529
+ let readBudget = MAX_PATCH_BYTES;
1530
+ for (const n of names) {
1531
+ const f = await untracked(root, n, readBudget);
1532
+ if (!f) continue;
1533
+ readBudget = Math.max(0, readBudget - Buffer.byteLength(f.patch));
1534
+ loose.push(f);
1535
+ }
1536
+ const files = [...tracked, ...loose].sort((a, b) => a.path.localeCompare(b.path));
1537
+ let budget = MAX_PATCH_BYTES;
1538
+ let truncated = files.some((f) => f.note === "too large");
1539
+ for (const f of files) {
1540
+ const size = Buffer.byteLength(f.patch);
1541
+ if (size <= budget) {
1542
+ budget -= size;
1543
+ continue;
1544
+ }
1545
+ f.patch = "";
1546
+ f.note = "too large";
1547
+ truncated = true;
1548
+ }
1549
+ return { cwd, files, truncated };
1550
+ } catch (err) {
1551
+ return { cwd, error: `cannot read the changes: ${err.message.split("\n")[0]}` };
1552
+ }
1553
+ }
1554
+
1403
1555
  // src/http.ts
1404
1556
  var MIME = {
1405
1557
  ".html": "text/html; charset=utf-8",
@@ -1472,14 +1624,14 @@ function createHandler(opts) {
1472
1624
  let usage = null;
1473
1625
  const homeDir = () => process.env["HOME"] ?? os4.homedir();
1474
1626
  const within = (root, dir) => {
1475
- const rel = path6.relative(path6.resolve(root), dir);
1476
- return rel === "" || !rel.startsWith("..") && !path6.isAbsolute(rel);
1627
+ const rel = path7.relative(path7.resolve(root), dir);
1628
+ return rel === "" || !rel.startsWith("..") && !path7.isAbsolute(rel);
1477
1629
  };
1478
1630
  const real = async (p) => {
1479
1631
  try {
1480
1632
  return await realpath(p);
1481
1633
  } catch {
1482
- return path6.resolve(p);
1634
+ return path7.resolve(p);
1483
1635
  }
1484
1636
  };
1485
1637
  const browsable = async (dir) => {
@@ -1523,14 +1675,20 @@ function createHandler(opts) {
1523
1675
  else return json(res, 400, { error: 'status must be "busy" or "done"' });
1524
1676
  return json(res, 200, { ok: true });
1525
1677
  }
1678
+ const diff = url.pathname.match(/^\/api\/sessions\/([^/]+)\/diff$/);
1679
+ if (diff && req.method === "GET") {
1680
+ const s = pm.findSession(decodeURIComponent(diff[1]));
1681
+ if (!s) return json(res, 404, { error: "no such session" });
1682
+ return json(res, 200, await gitDiff(s.cwd));
1683
+ }
1526
1684
  if (url.pathname === "/api/fs" && req.method === "GET") {
1527
1685
  const raw = url.searchParams.get("path")?.trim();
1528
- const dir = raw ? path6.resolve(raw) : homeDir();
1686
+ const dir = raw ? path7.resolve(raw) : homeDir();
1529
1687
  if (!await browsable(dir)) return json(res, 403, { error: "outside the browsable roots" });
1530
1688
  try {
1531
1689
  const found = await readdir3(dir, { withFileTypes: true });
1532
- const entries = found.filter((e) => (e.isDirectory() || e.isSymbolicLink()) && !e.name.startsWith(".")).map((e) => ({ name: e.name, path: path6.join(dir, e.name) })).sort((a, b) => a.name.localeCompare(b.name));
1533
- const parent = path6.dirname(dir);
1690
+ const entries = found.filter((e) => (e.isDirectory() || e.isSymbolicLink()) && !e.name.startsWith(".")).map((e) => ({ name: e.name, path: path7.join(dir, e.name) })).sort((a, b) => a.name.localeCompare(b.name));
1691
+ const parent = path7.dirname(dir);
1534
1692
  const up = parent !== dir && await browsable(parent) ? parent : null;
1535
1693
  return json(res, 200, { path: dir, parent: up, entries });
1536
1694
  } catch {
@@ -1554,18 +1712,17 @@ function createHandler(opts) {
1554
1712
  if (!store) return json(res, 503, { error: "uploads are not configured" });
1555
1713
  const declared = Number(req.headers["content-length"] ?? "0");
1556
1714
  if (declared > MAX_UPLOAD_BYTES) {
1557
- return json(res, 413, { error: `images are limited to ${MAX_UPLOAD_BYTES >> 20}MB` });
1715
+ return json(res, 413, { error: `uploads are limited to ${MAX_UPLOAD_BYTES >> 20}MB` });
1558
1716
  }
1559
1717
  const bytes = await readBytes(req, MAX_UPLOAD_BYTES);
1560
1718
  if (bytes === null) {
1561
- return tooLarge(req, res, `images are limited to ${MAX_UPLOAD_BYTES >> 20}MB`);
1719
+ return tooLarge(req, res, `uploads are limited to ${MAX_UPLOAD_BYTES >> 20}MB`);
1562
1720
  }
1563
1721
  if (bytes.length === 0) return json(res, 400, { error: "empty upload" });
1564
1722
  try {
1565
- return json(res, 200, { path: await store.save(bytes) });
1566
- } catch (err) {
1567
- if (err instanceof NotAnImage) return json(res, 415, { error: err.message });
1568
- return json(res, 500, { error: "cannot write the dropped image" });
1723
+ return json(res, 200, { path: await store.save(bytes, url.searchParams.get("name") ?? "") });
1724
+ } catch {
1725
+ return json(res, 500, { error: "cannot write the dropped file" });
1569
1726
  }
1570
1727
  }
1571
1728
  if (url.pathname === "/api/sessions" && req.method === "GET") {
@@ -1578,15 +1735,15 @@ function createHandler(opts) {
1578
1735
  }
1579
1736
  async function serveStatic(res, pathname) {
1580
1737
  const rel = pathname === "/" ? "index.html" : pathname.replace(/^\/+/, "");
1581
- const file = path6.resolve(webRoot, rel);
1582
- if (file !== webRoot && !file.startsWith(webRoot + path6.sep)) {
1738
+ const file = path7.resolve(webRoot, rel);
1739
+ if (file !== webRoot && !file.startsWith(webRoot + path7.sep)) {
1583
1740
  text(res, 403, "forbidden");
1584
1741
  return;
1585
1742
  }
1586
1743
  try {
1587
1744
  const info = await stat3(file);
1588
1745
  if (!info.isFile()) throw new Error("not a file");
1589
- head(res, 200, MIME[path6.extname(file)] ?? "application/octet-stream");
1746
+ head(res, 200, MIME[path7.extname(file)] ?? "application/octet-stream");
1590
1747
  createReadStream(file).pipe(res);
1591
1748
  } catch {
1592
1749
  if (rel === "index.html") {
@@ -1723,6 +1880,9 @@ var Hub = class {
1723
1880
  case "color":
1724
1881
  pm.findManager(msg.id)?.setColor(msg.id, msg.color);
1725
1882
  break;
1883
+ case "move":
1884
+ pm.findManager(msg.id)?.move(msg.id, msg.slot);
1885
+ break;
1726
1886
  case "ack":
1727
1887
  pm.findSession(msg.id)?.ack();
1728
1888
  break;
@@ -1926,25 +2086,25 @@ import {
1926
2086
  readdirSync
1927
2087
  } from "node:fs";
1928
2088
  import { createRequire as createRequire3 } from "node:module";
1929
- import path7 from "node:path";
2089
+ import path8 from "node:path";
1930
2090
  var EXEC = 73;
1931
2091
  function nodePtyRoot() {
1932
2092
  try {
1933
- return path7.dirname(createRequire3(import.meta.url).resolve("node-pty/package.json"));
2093
+ return path8.dirname(createRequire3(import.meta.url).resolve("node-pty/package.json"));
1934
2094
  } catch {
1935
2095
  return null;
1936
2096
  }
1937
2097
  }
1938
2098
  function spawnHelperPaths(root) {
1939
- const found = [path7.join(root, "build", "Release", "spawn-helper")];
2099
+ const found = [path8.join(root, "build", "Release", "spawn-helper")];
1940
2100
  let prebuilds;
1941
2101
  try {
1942
- prebuilds = readdirSync(path7.join(root, "prebuilds"), { withFileTypes: true });
2102
+ prebuilds = readdirSync(path8.join(root, "prebuilds"), { withFileTypes: true });
1943
2103
  } catch {
1944
2104
  return found;
1945
2105
  }
1946
2106
  for (const entry of prebuilds) {
1947
- if (entry.isDirectory()) found.push(path7.join(root, "prebuilds", entry.name, "spawn-helper"));
2107
+ if (entry.isDirectory()) found.push(path8.join(root, "prebuilds", entry.name, "spawn-helper"));
1948
2108
  }
1949
2109
  return found;
1950
2110
  }
@@ -2007,11 +2167,11 @@ async function main() {
2007
2167
  const tls = args.tlsCert && args.tlsKey ? loadTls(args.tlsCert, args.tlsKey) : null;
2008
2168
  const url = `${tls ? "https" : "http"}://${args.host}:${args.port}`;
2009
2169
  const cleartextOffBox = !tls && !isLoopbackBind(args.host);
2010
- const here = path8.dirname(fileURLToPath(import.meta.url));
2170
+ const here = path9.dirname(fileURLToPath(import.meta.url));
2011
2171
  const webRoot = [
2012
- path8.resolve(here, "web"),
2013
- path8.resolve(here, "../../web/dist")
2014
- ].find((p) => existsSync2(p)) ?? path8.resolve(here, "web");
2172
+ path9.resolve(here, "web"),
2173
+ path9.resolve(here, "../../web/dist")
2174
+ ].find((p) => existsSync2(p)) ?? path9.resolve(here, "web");
2015
2175
  for (const file of fixSpawnHelper()) console.log(`made ${file} executable`);
2016
2176
  const pm = await ProjectManager.open({
2017
2177
  url,
@@ -2023,7 +2183,7 @@ async function main() {
2023
2183
  ...args.shell ? { shell: args.shell } : {}
2024
2184
  });
2025
2185
  const sameOrigin = createOriginCheck({ host: args.host, allow: args.allowOrigin });
2026
- const uploads = new UploadStore(path8.join(path8.dirname(pm.statePath), "uploads"));
2186
+ const uploads = new UploadStore(path9.join(path9.dirname(pm.statePath), "uploads"));
2027
2187
  const handle = createHandler({
2028
2188
  pm,
2029
2189
  webRoot,
@@ -2052,7 +2212,7 @@ async function main() {
2052
2212
  console.warn(`warning: ${url} is plain http \u2014 the token, every keystroke and all terminal output cross the network in clear. Use an encrypted overlay (Tailscale, WireGuard) or pass --tls-cert/--tls-key.`);
2053
2213
  }
2054
2214
  if (args.updateCheck) {
2055
- void checkForUpdate(path8.join(path8.dirname(pm.statePath), "update-check.json")).then((latest) => {
2215
+ void checkForUpdate(path9.join(path9.dirname(pm.statePath), "update-check.json")).then((latest) => {
2056
2216
  if (!latest) return;
2057
2217
  hub.setUpdate({ current: currentVersion(), latest });
2058
2218
  console.log(`update available: ${currentVersion()} -> ${latest} (npm i -g tring-chat)`);
@@ -29,4 +29,4 @@
29
29
  * The original design remains. The terminal itself
30
30
  * has been extended to include xterm CSI codes, among
31
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;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.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;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.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}:root{--bg: #040c0a;--bg-2: #071411;--panel: rgba(255, 255, 255, .028);--panel-2: rgba(255, 255, 255, .05);--line: rgba(110, 240, 195, .11);--line-2: rgba(110, 240, 195, .2);--text: #dceee7;--muted: #8aa79d;--dim: #5d7a71;--mint: #3ee9a4;--emerald: #0fae7c;--deep: #0a3a2e;--amber: #f5b642;--red: #f2545b;--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;--bar-h: 36px;color-scheme:dark}.st-idle{--status: var(--dim)}.st-busy{--status: var(--amber)}.st-done{--status: var(--mint)}.st-exited{--status: var(--red)}*{box-sizing:border-box}[hidden]{display:none!important}html,body,#app{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:13px;overflow:hidden}#app{display:flex;flex-direction:column}#bar{height:var(--bar-h);flex:0 0 var(--bar-h);display:flex;align-items:stretch;gap:4px;padding:0 8px;background:var(--bg-2);border-bottom:1px solid var(--line);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}.logo{display:grid;grid-template:repeat(3,5px) / repeat(3,5px);gap:2px;width:19px;height:19px;flex:0 0 19px;align-self:center;margin-right:8px}.logo i{background:var(--deep);border-radius:1px}.logo i:nth-child(5){background:var(--mint);box-shadow:0 0 6px #3ee9a499}.tab{display:flex;align-items:center;gap:7px;padding:0 12px;min-width:92px;max-width:220px;border:none;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font:inherit;white-space:nowrap;cursor:pointer}.tab:hover{color:var(--text);background:var(--panel)}.tab.active{color:var(--text);border-bottom-color:var(--emerald)}.tab .nm{overflow:hidden;text-overflow:ellipsis}.badge{flex:0 0 auto;min-width:17px;padding:1px 5px;border-radius:9px;background:var(--mint);color:#04231a;font:600 10px/1.5 var(--mono);text-align:center}.add{flex:0 0 28px;border:none;background:transparent;color:var(--dim);font-size:18px;cursor:pointer}.add:hover{color:var(--mint)}#ring{flex:1;min-height:0;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(5,1fr);gap:6px;padding:6px}.focus-cell{grid-area:2 / 2 / 5 / 5;min-width:0;min-height:0;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);overflow:hidden;padding:4px}.focus-cell .xterm{height:100%}.focus-cell{touch-action:none;overscroll-behavior:none}.focus-cell.dropping{border-color:var(--mint);box-shadow:inset 0 0 0 2px var(--mint),0 0 24px #3ee9a440}.tile{position:relative;min-width:0;min-height:0;container-type:size;border:2px solid var(--status, var(--line));border-radius:5px;background:var(--bg-2);overflow:hidden;cursor:pointer;padding:0;font:inherit;color:inherit;text-align:left}.tile canvas{display:block;width:100%;height:100%;transition:opacity .3s,filter .3s}.tile .label{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-content:center;justify-items:center;gap:4px;padding:0 8%;pointer-events:none;text-align:center}.tile .big-nm{font:600 clamp(12px,9cqw,34px)/1.15 var(--sans);color:var(--text);opacity:.6;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 4px rgba(4,12,10,.9);transition:opacity .3s,filter .3s}.tile .slot-badge{display:none;width:clamp(26px,22cqh,64px);aspect-ratio:1;border-radius:50%;place-items:center;background:var(--mint);color:var(--bg);font:700 clamp(13px,11cqh,32px)/1 var(--mono);box-shadow:0 0 0 3px #040c0ad9,0 0 18px #3ee9a473}.tile.st-done .slot-badge{display:grid}.tile.st-busy canvas,.tile.st-busy .big-nm{opacity:.35;filter:grayscale(.8)}.tile.empty{border-style:dashed;border-color:var(--line);color:var(--dim);display:grid;place-items:center;font-size:11px}.tile.empty:hover{border-color:var(--emerald);color:var(--muted)}.tile.viewing{box-shadow:inset 0 0 0 1px var(--emerald)}.tile.st-busy{animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{50%{border-color:#f5b64259}}.tile .meta{position:absolute;inset:auto 0 0 0;z-index:1;display:flex;gap:6px;align-items:baseline;padding:2px 5px;background:linear-gradient(transparent,#040c0aeb 45%);font:10px/1.4 var(--mono);pointer-events:none}.tile .key{color:var(--status, var(--dim));font-weight:700}.tile .nm{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tile .cwd{color:var(--dim);margin-left:auto}#overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;background:#040c0ab8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:10}.panel{width:min(560px,92vw);max-height:82vh;overflow:auto;padding:16px;border:1px solid var(--line-2);border-radius:10px;background:var(--bg-2);box-shadow:0 24px 70px #0009}.panel h2{margin:0 0 4px;font-size:14px;font-weight:600}.panel .hint{margin:0 0 14px;color:var(--muted);font-size:11.5px}.rows{display:grid;gap:3px}.row{display:flex;gap:9px;align-items:baseline;padding:5px 8px;border-radius:5px;border-left:2px solid var(--status, transparent);background:var(--panel);font:12px/1.5 var(--mono);cursor:pointer}.row:hover{background:var(--panel-2)}.row.dim{opacity:.45}.row .key{color:var(--emerald);font-weight:700;min-width:76px}.row .nm{color:var(--text)}.row .tag{margin-left:auto;color:var(--status, var(--dim));font-size:11px}.field{display:block;margin-bottom:10px}.field span{display:block;margin-bottom:4px;color:var(--muted);font-size:11.5px}.field input{width:100%;padding:8px 10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:12.5px var(--mono)}.field input:focus{outline:none;border-color:var(--emerald)}.actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}.btn{padding:7px 14px;border:1px solid var(--line-2);border-radius:6px;background:transparent;color:var(--text);font:inherit;cursor:pointer}.btn:hover{border-color:var(--emerald)}.btn.primary{background:var(--emerald);border-color:var(--emerald);color:#04231a;font-weight:600}.btn.primary:hover{background:var(--mint);border-color:var(--mint)}.legend{margin-top:14px;padding-top:10px;border-top:1px solid var(--line);color:var(--dim);font:11px/1.7 var(--mono)}.legend b{color:var(--muted);font-weight:600}#toast{position:fixed;left:50%;bottom:18px;transform:translate(-50%);padding:7px 14px;border:1px solid var(--red);border-radius:6px;background:var(--bg-2);color:var(--text);font:12px var(--mono);z-index:20}.browser{margin:-4px 0 12px;border:1px solid var(--line);border-radius:6px;background:var(--bg);overflow:hidden}.crumb{display:flex;padding:5px 8px;border-bottom:1px solid var(--line);font:11px var(--mono);color:var(--dim)}.crumb .up{border:none;background:transparent;color:var(--emerald);font:inherit;cursor:pointer;padding:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crumb .up:hover{color:var(--mint)}.dirlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:1px;max-height:168px;overflow-y:auto;padding:5px}.dirlist button{border:none;border-radius:4px;background:transparent;color:var(--text);font:11.5px/1.9 var(--mono);text-align:left;padding:1px 7px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dirlist button:before{content:"▸ ";color:var(--dim)}.dirlist button:hover{background:var(--panel-2);color:var(--mint)}.dirnote{padding:4px 7px;color:var(--dim);font:11px var(--mono)}.tile-action{position:absolute;top:4px;right:4px;width:20px;height:20px;display:grid;place-items:center;border:1px solid var(--status, var(--line-2));border-radius:4px;background:#040c0ad1;color:var(--status, var(--text));font:12px/1 var(--mono);cursor:pointer;opacity:0;transition:opacity .12s}.tile:hover .tile-action,.tile:focus-within .tile-action{opacity:1}.tile.st-exited .tile-action{opacity:1}.tile-action:hover{background:var(--deep);color:var(--mint);border-color:var(--mint)}.btn.danger{border-color:#f2545b80;color:var(--red)}.btn.danger:hover{background:#f2545b1f;border-color:var(--red)}.update{align-self:center;margin-left:auto;flex:0 0 auto;padding:3px 10px;border:1px solid var(--line-2);border-radius:10px;background:transparent;color:var(--muted);font:11px var(--mono);white-space:nowrap;cursor:pointer}.update:hover{border-color:var(--emerald);color:var(--text)}.cmd{margin:0 0 12px;padding:9px 11px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:12.5px var(--mono);-webkit-user-select:all;user-select:all}.iconbtn{align-self:center;flex:0 0 auto;display:grid;place-items:center;width:26px;height:22px;margin-right:2px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--dim);cursor:pointer}.iconbtn:hover{color:var(--text);border-color:var(--line-2)}.iconbtn.on{color:var(--emerald)}.iconbtn.on:hover{color:var(--mint)}.choices{display:flex;gap:6px}.choice{flex:1;display:grid;gap:1px;padding:8px 4px;border:1px solid var(--line-2);border-radius:6px;background:transparent;color:var(--muted);font:inherit;cursor:pointer}.choice b{color:var(--text);font:700 15px/1.2 var(--mono)}.choice span{font-size:10.5px;color:var(--dim)}.choice:hover{border-color:var(--emerald);color:var(--text)}.choice.active{border-color:var(--emerald);background:var(--panel-2)}.choice.active b{color:var(--emerald)}.tile{outline:2px solid var(--tint, transparent)}.swatches{display:grid;grid-template-columns:repeat(auto-fill,24px);gap:6px}.swatch{width:24px;height:24px;padding:0;border:2px solid transparent;border-radius:50%;background:var(--tint, transparent);cursor:pointer;outline-offset:2px}.swatch.none{background:transparent;border-color:var(--line-2);position:relative}.swatch.none:after{content:"";position:absolute;top:3px;right:9px;bottom:3px;left:9px;border-top:1px solid var(--dim);transform:rotate(-45deg);transform-origin:center}.swatch:hover{outline:1px solid var(--line-2)}.swatch.active{outline:2px solid var(--text)}#usage{flex:1;min-height:0;overflow-y:auto;padding:18px;display:grid;place-items:start center}.usage{width:min(620px,100%);padding:18px 20px 16px;border:1px solid var(--line-2);border-radius:10px;background:var(--bg-2)}.usage h2{margin:0 0 4px;font-size:14px;font-weight:600}.usage h3{margin:20px 0 8px;font:600 11px/1.4 var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}.usage .hint{margin:14px 0 0;color:var(--dim);font-size:11.5px}.usage .source{margin:12px 0 0;padding-top:10px;border-top:1px solid var(--line);color:var(--dim);font:11px var(--mono)}.urow+.urow{margin-top:16px}.uhead{display:flex;align-items:baseline;gap:8px}.ulabel{color:var(--text);font-size:12.5px}.upct{margin-left:auto;font:700 15px/1 var(--mono);color:var(--text)}.ufoot{display:flex;gap:8px;margin-top:4px;font:11px var(--mono);color:var(--muted)}.unote{margin-left:auto;color:var(--dim);font-style:normal}.meter{height:8px;margin-top:6px;border-radius:4px;background:var(--panel-2);overflow:hidden}.meter i{display:block;height:100%;background:var(--emerald)}.meter i.warm{background:var(--amber)}.meter i.hot{background:var(--red)}.utotals{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:1px;margin-top:20px;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--line)}.ucell{display:grid;gap:2px;padding:10px 12px;background:var(--bg-2)}.ucell b{font:700 15px/1.2 var(--mono);color:var(--text)}.ucell span{font-size:10.5px;color:var(--dim)}.uprojects{display:grid;gap:7px}.uproject{display:grid;grid-template-columns:128px 1fr 56px;gap:10px;align-items:center;font:11.5px var(--mono)}.uproject .nm{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uproject .meter{margin-top:0;height:6px}.uproject .tag{color:var(--text);text-align:right}.tab.pinned{min-width:0;color:var(--dim)}.tab.pinned.active{color:var(--text);border-bottom-color:var(--emerald)}.field.toggle{display:flex;align-items:center;gap:8px;margin:18px 0 10px;padding-top:14px;border-top:1px solid var(--line);cursor:pointer}.field.toggle span{margin:0;color:var(--text);font-size:12.5px}.field.toggle input{width:15px;height:15px;accent-color:var(--emerald)}#switcher{flex:0 0 auto;display:flex;gap:6px;padding:6px;background:var(--bg-2);border-bottom:1px solid var(--line)}#switcher button{height:44px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:13px/1 var(--mono);cursor:pointer}#switcher .current{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:10px;padding:0 12px;border-left:3px solid var(--status, var(--line-2));text-align:left}#switcher .current .key{color:var(--emerald);font-weight:700}#switcher .current .nm{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#switcher .current .tag{color:var(--status, var(--dim));font-size:11px}#switcher .current .chev{display:grid;color:var(--muted)}#switcher .next,#switcher .paste,#switcher .copy{flex:0 0 64px;display:flex;align-items:center;justify-content:center;gap:6px;color:var(--muted)}#switcher .paste,#switcher .copy{flex-basis:52px}#switcher .next:disabled,#switcher .paste:disabled,#switcher .copy:disabled{color:var(--dim);opacity:.5;cursor:default}#switcher .next svg,#switcher .paste svg,#switcher .copy svg{display:block}.paste-box{display:block;width:100%;min-height:96px;padding:10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:14px/1.4 var(--mono);resize:vertical}.paste-box:focus{outline:none;border-color:var(--emerald)}.copy-sheet .links{display:grid;gap:4px;margin-bottom:14px}.copy-sheet .link{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 0 0 10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg)}.copy-sheet .link .url{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:12px var(--mono);color:var(--text)}.copy-sheet .link .btn{flex:0 0 auto;height:44px;border:none;border-left:1px solid var(--line-2);border-radius:0 6px 6px 0}.copy-box{margin:0;max-height:38vh;overflow:auto;padding:10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:12px/1.4 var(--mono);white-space:pre;-webkit-user-select:text;user-select:text}.picker-actions{display:none}@media (max-width: 720px){#ring{display:flex;flex-direction:column;padding:6px}#ring .tile{display:none}.focus-cell{flex:1 1 auto}#overlay{place-items:end stretch}.panel{width:100%;max-height:78vh;border-bottom:none;border-radius:10px 10px 0 0;padding-bottom:max(24px,env(safe-area-inset-bottom))}.panel.picker{display:flex;flex-direction:column}.panel.picker .rows{flex:1 1 auto;min-height:0;overflow:hidden auto}.row{min-height:44px;align-items:center;padding:0 12px;font-size:13px}.row .key{min-width:20px}.row .nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .tag{flex:0 0 auto}.btn:disabled{opacity:.45;cursor:default}.picker-actions{display:flex;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}.picker-actions .btn{flex:1 1 auto;height:44px}.legend,.ring-size{display:none}}
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;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.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;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.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}:root{--bg: #040c0a;--bg-2: #071411;--panel: rgba(255, 255, 255, .028);--panel-2: rgba(255, 255, 255, .05);--line: rgba(110, 240, 195, .11);--line-2: rgba(110, 240, 195, .2);--text: #dceee7;--muted: #8aa79d;--dim: #5d7a71;--mint: #3ee9a4;--emerald: #0fae7c;--deep: #0a3a2e;--amber: #f5b642;--red: #f2545b;--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;--bar-h: 36px;color-scheme:dark}.st-idle{--status: var(--dim)}.st-busy{--status: var(--amber)}.st-done{--status: var(--mint)}.st-exited{--status: var(--red)}*{box-sizing:border-box}[hidden]{display:none!important}html,body,#app{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:13px;overflow:hidden}#app{display:flex;flex-direction:column}#bar{height:var(--bar-h);flex:0 0 var(--bar-h);display:flex;align-items:stretch;gap:4px;padding:0 8px;background:var(--bg-2);border-bottom:1px solid var(--line);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}.logo{display:grid;grid-template:repeat(3,5px) / repeat(3,5px);gap:2px;width:19px;height:19px;flex:0 0 19px;align-self:center;margin-right:8px}.logo i{background:var(--deep);border-radius:1px}.logo i:nth-child(5){background:var(--mint);box-shadow:0 0 6px #3ee9a499}.tab{display:flex;align-items:center;gap:7px;padding:0 12px;min-width:92px;max-width:220px;border:none;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font:inherit;white-space:nowrap;cursor:pointer}.tab:hover{color:var(--text);background:var(--panel)}.tab.active{color:var(--text);border-bottom-color:var(--emerald)}.tab .nm{overflow:hidden;text-overflow:ellipsis}.badge{flex:0 0 auto;min-width:17px;padding:1px 5px;border-radius:9px;background:var(--mint);color:#04231a;font:600 10px/1.5 var(--mono);text-align:center}.add{flex:0 0 28px;border:none;background:transparent;color:var(--dim);font-size:18px;cursor:pointer}.add:hover{color:var(--mint)}#ring{flex:1;min-height:0;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(5,1fr);gap:6px;padding:6px}.focus-cell{grid-area:2 / 2 / 5 / 5;min-width:0;min-height:0;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);overflow:hidden;padding:4px}.focus-cell .xterm{height:100%}.focus-cell{touch-action:none;overscroll-behavior:none}.focus-cell.dropping{border-color:var(--mint);box-shadow:inset 0 0 0 2px var(--mint),0 0 24px #3ee9a440}.focus-cell{display:flex}.term-host{flex:1 1 auto;min-width:0;height:100%}.diff-handle{flex:0 0 5px;margin:0 3px;border-radius:3px;background:var(--line);cursor:col-resize;touch-action:none}.diff-handle:hover,.diff-handle.dragging{background:var(--emerald)}.diff-panel{flex:0 0 auto;min-width:0;max-width:75%;display:flex;flex-direction:column;color:var(--text);font:11.5px/1.55 var(--mono)}.diff-head{display:flex;gap:8px;align-items:baseline;padding:2px 4px 6px;border-bottom:1px solid var(--line)}.diff-title{font-weight:700}.diff-plus{color:var(--mint)}.diff-minus{color:var(--red)}.diff-close{margin-left:auto;border:none;background:transparent;color:var(--dim);font:inherit;cursor:pointer}.diff-close:hover{color:var(--text)}.diff-scroll{flex:1 1 auto;min-height:0;overflow:auto}.diff-files{padding:4px 0;border-bottom:1px solid var(--line)}.diff-file-row{display:flex;gap:8px;width:100%;padding:1px 4px;border:none;background:transparent;color:var(--muted);font:inherit;text-align:left;cursor:pointer}.diff-file-row:hover{background:var(--panel-2);color:var(--text)}.diff-file-row .path{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.diff-file-head{position:sticky;top:0;padding:4px;background:var(--bg-2);border-bottom:1px solid var(--line);font-weight:700}.dl{display:grid;grid-template-columns:5ch 5ch 1fr;white-space:pre}.dl .ln{padding-right:1ch;color:var(--dim);text-align:right;-webkit-user-select:none;user-select:none}.dl-add{background:#3ee9a41f}.dl-del{background:#f2545b1f}.dl-hunk{display:block;padding:2px 4px;color:var(--dim)}.diff-note{padding:6px 4px;color:var(--dim)}.tile{position:relative;min-width:0;min-height:0;container-type:size;border:2px solid var(--status, var(--line));border-radius:5px;background:var(--bg-2);overflow:hidden;cursor:pointer;padding:0;font:inherit;color:inherit;text-align:left}.tile canvas{display:block;width:100%;height:100%;transition:opacity .3s,filter .3s}.tile .label{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-content:center;justify-items:center;gap:4px;padding:0 8%;pointer-events:none;text-align:center}.tile .big-nm{font:600 clamp(12px,9cqw,34px)/1.15 var(--sans);color:var(--text);opacity:.6;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 4px rgba(4,12,10,.9);transition:opacity .3s,filter .3s}.tile .slot-badge{display:none;width:clamp(26px,22cqh,64px);aspect-ratio:1;border-radius:50%;place-items:center;background:var(--mint);color:var(--bg);font:700 clamp(13px,11cqh,32px)/1 var(--mono);box-shadow:0 0 0 3px #040c0ad9,0 0 18px #3ee9a473}.tile.st-done .slot-badge{display:grid}.tile.st-busy canvas,.tile.st-busy .big-nm{opacity:.35;filter:grayscale(.8)}.tile.empty{border-style:dashed;border-color:var(--line);color:var(--dim);display:grid;place-items:center;font-size:11px}.tile.empty:hover{border-color:var(--emerald);color:var(--muted)}.tile.viewing{box-shadow:inset 0 0 0 1px var(--emerald)}.tile.dragging{opacity:.45}.tile.drop-target{border-color:var(--emerald);border-style:solid;box-shadow:inset 0 0 0 2px var(--emerald)}body.tile-dragging,body.tile-dragging .tile{cursor:grabbing}.tile.st-busy{animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{50%{border-color:#f5b64259}}.tile .meta{position:absolute;inset:auto 0 0 0;z-index:1;display:flex;gap:6px;align-items:baseline;padding:2px 5px;background:linear-gradient(transparent,#040c0aeb 45%);font:10px/1.4 var(--mono);pointer-events:none}.tile .key{color:var(--status, var(--dim));font-weight:700}.tile .nm{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tile .cwd{color:var(--dim);margin-left:auto}#overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;background:#040c0ab8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:10}.panel{width:min(560px,92vw);max-height:82vh;overflow:auto;padding:16px;border:1px solid var(--line-2);border-radius:10px;background:var(--bg-2);box-shadow:0 24px 70px #0009}.panel h2{margin:0 0 4px;font-size:14px;font-weight:600}.panel .hint{margin:0 0 14px;color:var(--muted);font-size:11.5px}.rows{display:grid;gap:3px}.row{display:flex;gap:9px;align-items:baseline;padding:5px 8px;border-radius:5px;border-left:2px solid var(--status, transparent);background:var(--panel);font:12px/1.5 var(--mono);cursor:pointer}.row:hover{background:var(--panel-2)}.row.dim{opacity:.45}.row .key{color:var(--emerald);font-weight:700;min-width:76px}.row .nm{color:var(--text)}.row .tag{margin-left:auto;color:var(--status, var(--dim));font-size:11px}.field{display:block;margin-bottom:10px}.field span{display:block;margin-bottom:4px;color:var(--muted);font-size:11.5px}.field input{width:100%;padding:8px 10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:12.5px var(--mono)}.field input:focus{outline:none;border-color:var(--emerald)}.actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}.btn{padding:7px 14px;border:1px solid var(--line-2);border-radius:6px;background:transparent;color:var(--text);font:inherit;cursor:pointer}.btn:hover{border-color:var(--emerald)}.btn.primary{background:var(--emerald);border-color:var(--emerald);color:#04231a;font-weight:600}.btn.primary:hover{background:var(--mint);border-color:var(--mint)}.legend{margin-top:14px;padding-top:10px;border-top:1px solid var(--line);color:var(--dim);font:11px/1.7 var(--mono)}.legend b{color:var(--muted);font-weight:600}#toast{position:fixed;left:50%;bottom:18px;transform:translate(-50%);padding:7px 14px;border:1px solid var(--red);border-radius:6px;background:var(--bg-2);color:var(--text);font:12px var(--mono);z-index:20}.browser{margin:-4px 0 12px;border:1px solid var(--line);border-radius:6px;background:var(--bg);overflow:hidden}.crumb{display:flex;padding:5px 8px;border-bottom:1px solid var(--line);font:11px var(--mono);color:var(--dim)}.crumb .up{border:none;background:transparent;color:var(--emerald);font:inherit;cursor:pointer;padding:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crumb .up:hover{color:var(--mint)}.dirlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:1px;max-height:168px;overflow-y:auto;padding:5px}.dirlist button{border:none;border-radius:4px;background:transparent;color:var(--text);font:11.5px/1.9 var(--mono);text-align:left;padding:1px 7px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dirlist button:before{content:"▸ ";color:var(--dim)}.dirlist button:hover{background:var(--panel-2);color:var(--mint)}.dirnote{padding:4px 7px;color:var(--dim);font:11px var(--mono)}.tile-action{position:absolute;top:4px;right:4px;width:20px;height:20px;display:grid;place-items:center;border:1px solid var(--status, var(--line-2));border-radius:4px;background:#040c0ad1;color:var(--status, var(--text));font:12px/1 var(--mono);cursor:pointer;opacity:0;transition:opacity .12s}.tile:hover .tile-action,.tile:focus-within .tile-action{opacity:1}.tile.st-exited .tile-action{opacity:1}.tile-action:hover{background:var(--deep);color:var(--mint);border-color:var(--mint)}.btn.danger{border-color:#f2545b80;color:var(--red)}.btn.danger:hover{background:#f2545b1f;border-color:var(--red)}.update{align-self:center;margin-left:auto;flex:0 0 auto;padding:3px 10px;border:1px solid var(--line-2);border-radius:10px;background:transparent;color:var(--muted);font:11px var(--mono);white-space:nowrap;cursor:pointer}.update:hover{border-color:var(--emerald);color:var(--text)}.cmd{margin:0 0 12px;padding:9px 11px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:12.5px var(--mono);-webkit-user-select:all;user-select:all}.iconbtn{align-self:center;flex:0 0 auto;display:grid;place-items:center;width:26px;height:22px;margin-right:2px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--dim);cursor:pointer}.iconbtn:hover{color:var(--text);border-color:var(--line-2)}.iconbtn.on{color:var(--emerald)}.iconbtn.on:hover{color:var(--mint)}.choices{display:flex;gap:6px}.choice{flex:1;display:grid;gap:1px;padding:8px 4px;border:1px solid var(--line-2);border-radius:6px;background:transparent;color:var(--muted);font:inherit;cursor:pointer}.choice b{color:var(--text);font:700 15px/1.2 var(--mono)}.choice span{font-size:10.5px;color:var(--dim)}.choice:hover{border-color:var(--emerald);color:var(--text)}.choice.active{border-color:var(--emerald);background:var(--panel-2)}.choice.active b{color:var(--emerald)}.tile{outline:2px solid var(--tint, transparent)}.swatches{display:grid;grid-template-columns:repeat(auto-fill,24px);gap:6px}.swatch{width:24px;height:24px;padding:0;border:2px solid transparent;border-radius:50%;background:var(--tint, transparent);cursor:pointer;outline-offset:2px}.swatch.none{background:transparent;border-color:var(--line-2);position:relative}.swatch.none:after{content:"";position:absolute;top:3px;right:9px;bottom:3px;left:9px;border-top:1px solid var(--dim);transform:rotate(-45deg);transform-origin:center}.swatch:hover{outline:1px solid var(--line-2)}.swatch.active{outline:2px solid var(--text)}#usage{flex:1;min-height:0;overflow-y:auto;padding:18px;display:grid;place-items:start center}.usage{width:min(620px,100%);padding:18px 20px 16px;border:1px solid var(--line-2);border-radius:10px;background:var(--bg-2)}.usage h2{margin:0 0 4px;font-size:14px;font-weight:600}.usage h3{margin:20px 0 8px;font:600 11px/1.4 var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}.usage .hint{margin:14px 0 0;color:var(--dim);font-size:11.5px}.usage .source{margin:12px 0 0;padding-top:10px;border-top:1px solid var(--line);color:var(--dim);font:11px var(--mono)}.urow+.urow{margin-top:16px}.uhead{display:flex;align-items:baseline;gap:8px}.ulabel{color:var(--text);font-size:12.5px}.upct{margin-left:auto;font:700 15px/1 var(--mono);color:var(--text)}.ufoot{display:flex;gap:8px;margin-top:4px;font:11px var(--mono);color:var(--muted)}.unote{margin-left:auto;color:var(--dim);font-style:normal}.meter{height:8px;margin-top:6px;border-radius:4px;background:var(--panel-2);overflow:hidden}.meter i{display:block;height:100%;background:var(--emerald)}.meter i.warm{background:var(--amber)}.meter i.hot{background:var(--red)}.utotals{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:1px;margin-top:20px;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--line)}.ucell{display:grid;gap:2px;padding:10px 12px;background:var(--bg-2)}.ucell b{font:700 15px/1.2 var(--mono);color:var(--text)}.ucell span{font-size:10.5px;color:var(--dim)}.uprojects{display:grid;gap:7px}.uproject{display:grid;grid-template-columns:128px 1fr 56px;gap:10px;align-items:center;font:11.5px var(--mono)}.uproject .nm{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uproject .meter{margin-top:0;height:6px}.uproject .tag{color:var(--text);text-align:right}.tab.pinned{min-width:0;color:var(--dim)}.tab.pinned.active{color:var(--text);border-bottom-color:var(--emerald)}.field.toggle{display:flex;align-items:center;gap:8px;margin:18px 0 10px;padding-top:14px;border-top:1px solid var(--line);cursor:pointer}.field.toggle span{margin:0;color:var(--text);font-size:12.5px}.field.toggle input{width:15px;height:15px;accent-color:var(--emerald)}#switcher{flex:0 0 auto;display:flex;gap:6px;padding:6px;background:var(--bg-2);border-bottom:1px solid var(--line)}#switcher button{height:44px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:13px/1 var(--mono);cursor:pointer}#switcher .current{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:10px;padding:0 12px;border-left:3px solid var(--status, var(--line-2));text-align:left}#switcher .current .key{color:var(--emerald);font-weight:700}#switcher .current .nm{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#switcher .current .tag{color:var(--status, var(--dim));font-size:11px}#switcher .current .chev{display:grid;color:var(--muted)}#switcher .next,#switcher .paste,#switcher .copy{flex:0 0 64px;display:flex;align-items:center;justify-content:center;gap:6px;color:var(--muted)}#switcher .paste,#switcher .copy{flex-basis:52px}#switcher .next:disabled,#switcher .paste:disabled,#switcher .copy:disabled{color:var(--dim);opacity:.5;cursor:default}#switcher .next svg,#switcher .paste svg,#switcher .copy svg{display:block}.paste-box{display:block;width:100%;min-height:96px;padding:10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:14px/1.4 var(--mono);resize:vertical}.paste-box:focus{outline:none;border-color:var(--emerald)}.copy-sheet .links{display:grid;gap:4px;margin-bottom:14px}.copy-sheet .link{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 0 0 10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg)}.copy-sheet .link .url{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:12px var(--mono);color:var(--text)}.copy-sheet .link .btn{flex:0 0 auto;height:44px;border:none;border-left:1px solid var(--line-2);border-radius:0 6px 6px 0}.copy-box{margin:0;max-height:38vh;overflow:auto;padding:10px;border:1px solid var(--line-2);border-radius:6px;background:var(--bg);color:var(--text);font:12px/1.4 var(--mono);white-space:pre;-webkit-user-select:text;user-select:text}.picker-actions{display:none}@media (max-width: 720px){.diff-panel,.diff-handle,.diff-toggle{display:none!important}#ring{display:flex;flex-direction:column;padding:6px}#ring .tile{display:none}.focus-cell{flex:1 1 auto}#overlay{place-items:end stretch}.panel{width:100%;max-height:78vh;border-bottom:none;border-radius:10px 10px 0 0;padding-bottom:max(24px,env(safe-area-inset-bottom))}.panel.picker{display:flex;flex-direction:column}.panel.picker .rows{flex:1 1 auto;min-height:0;overflow:hidden auto}.row{min-height:44px;align-items:center;padding:0 12px;font-size:13px}.row .key{min-width:20px}.row .nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .tag{flex:0 0 auto}.btn:disabled{opacity:.45;cursor:default}.picker-actions{display:flex;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}.picker-actions .btn{flex:1 1 auto;height:44px}.legend,.ring-size{display:none}}