claude-yes 1.135.1 → 1.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SUPPORTED_CLIS-lVtK6ikD.js → SUPPORTED_CLIS-B9Vuzzba.js} +2 -2
- package/dist/SUPPORTED_CLIS-CJobpQld.js +8 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{schedule-BBboMYK-.js → schedule-C_eeRqKl.js} +4 -4
- package/dist/{serve-DvhV2OKW.js → serve-DZZAjj5z.js} +5 -5
- package/dist/{setup-Bta72ntv.js → setup-C9YZk0-b.js} +2 -2
- package/dist/{subcommands-CHzEfUpK.js → subcommands-Cppv0tFw.js} +4 -4
- package/dist/{subcommands-DQLxXJRA.js → subcommands-sBF6Q92w.js} +1 -1
- package/dist/{ts-BurepTpP.js → ts-7ZIbLUAs.js} +2 -2
- package/dist/{versionChecker-BQqv1OP1.js → versionChecker-DQHJdATh.js} +2 -2
- package/lab/ui/index.html +144 -31
- package/package.json +1 -1
- package/dist/SUPPORTED_CLIS-CSpn1swb.js +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-7ZIbLUAs.js";
|
|
2
2
|
|
|
3
3
|
//#region ts/SUPPORTED_CLIS.ts
|
|
4
4
|
const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
5
5
|
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SUPPORTED_CLIS as t };
|
|
8
|
-
//# sourceMappingURL=SUPPORTED_CLIS-
|
|
8
|
+
//# sourceMappingURL=SUPPORTED_CLIS-B9Vuzzba.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ts-7ZIbLUAs.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-DQHJdATh.js";
|
|
4
|
+
import "./pidStore-fqXqTKkh.js";
|
|
5
|
+
import "./globalPidIndex-DlmmJlO8.js";
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-B9Vuzzba.js";
|
|
7
|
+
|
|
8
|
+
export { SUPPORTED_CLIS };
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { t as invokedCliName } from "./invokedCli-zdFbz1ST.js";
|
|
3
3
|
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
4
|
-
import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-
|
|
4
|
+
import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-DQHJdATh.js";
|
|
5
5
|
import { argv } from "process";
|
|
6
6
|
import { execFileSync, spawn } from "child_process";
|
|
7
7
|
import ms from "ms";
|
|
@@ -480,7 +480,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
480
480
|
const rawArg = process.argv[2];
|
|
481
481
|
const managerCommands = !invokedCliName(process.argv);
|
|
482
482
|
const isHelpFlag = rawArg === "-h" || rawArg === "--help";
|
|
483
|
-
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-
|
|
483
|
+
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-sBF6Q92w.js");
|
|
484
484
|
if (isHelpFlag && process.argv.length === 3) {
|
|
485
485
|
cmdHelp(managerCommands);
|
|
486
486
|
process.exit(0);
|
|
@@ -513,7 +513,7 @@ if (config.useRust) {
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
if (rustBinary) {
|
|
516
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
516
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CJobpQld.js");
|
|
517
517
|
const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
|
|
518
518
|
if (config.verbose) {
|
|
519
519
|
console.log(`[rust] Using binary: ${rustBinary}`);
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-7ZIbLUAs.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DQHJdATh.js";
|
|
4
4
|
import "./pidStore-fqXqTKkh.js";
|
|
5
5
|
import "./globalPidIndex-DlmmJlO8.js";
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-7ZIbLUAs.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DQHJdATh.js";
|
|
4
4
|
import "./pidStore-fqXqTKkh.js";
|
|
5
5
|
import "./globalPidIndex-DlmmJlO8.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-B9Vuzzba.js";
|
|
7
7
|
import { n as resolveSpawnCwd } from "./workspaceConfig-BCOqRBEW.js";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
|
|
@@ -141,4 +141,4 @@ async function cmdSchedule(rest) {
|
|
|
141
141
|
|
|
142
142
|
//#endregion
|
|
143
143
|
export { cmdSchedule };
|
|
144
|
-
//# sourceMappingURL=schedule-
|
|
144
|
+
//# sourceMappingURL=schedule-C_eeRqKl.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-7ZIbLUAs.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
3
|
+
import { r as getInstalledPackage } from "./versionChecker-DQHJdATh.js";
|
|
4
4
|
import "./pidStore-fqXqTKkh.js";
|
|
5
5
|
import { a as updateGlobalPidStatus } from "./globalPidIndex-DlmmJlO8.js";
|
|
6
6
|
import { t as pgidForWrapper } from "./reaper-C-eWAxIj.js";
|
|
7
7
|
import "./configShared-C1C04bbq.js";
|
|
8
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
8
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-B9Vuzzba.js";
|
|
9
9
|
import "./remotes-PKKjfTI1.js";
|
|
10
|
-
import { d as listRecords, g as resolveOne, i as controlCodeFromName, m as renderRawLog, p as readNotes, s as extractTaskCounts, x as writeToIpc, y as snapshotStatus } from "./subcommands-
|
|
10
|
+
import { d as listRecords, g as resolveOne, i as controlCodeFromName, m as renderRawLog, p as readNotes, s as extractTaskCounts, x as writeToIpc, y as snapshotStatus } from "./subcommands-Cppv0tFw.js";
|
|
11
11
|
import yargs from "yargs";
|
|
12
12
|
import { mkdir, open, readFile, stat, writeFile } from "fs/promises";
|
|
13
13
|
import { homedir, hostname, userInfo } from "os";
|
|
@@ -1171,4 +1171,4 @@ Options:
|
|
|
1171
1171
|
|
|
1172
1172
|
//#endregion
|
|
1173
1173
|
export { cmdServe };
|
|
1174
|
-
//# sourceMappingURL=serve-
|
|
1174
|
+
//# sourceMappingURL=serve-DZZAjj5z.js.map
|
|
@@ -32,7 +32,7 @@ async function cmdSetup(rest) {
|
|
|
32
32
|
if (!existsSync(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
|
|
33
33
|
if (noShare) return 0;
|
|
34
34
|
process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
|
|
35
|
-
const { cmdServe } = await import("./serve-
|
|
35
|
+
const { cmdServe } = await import("./serve-DZZAjj5z.js");
|
|
36
36
|
return cmdServe([
|
|
37
37
|
"install",
|
|
38
38
|
"--share",
|
|
@@ -42,4 +42,4 @@ async function cmdSetup(rest) {
|
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
44
|
export { cmdSetup };
|
|
45
|
-
//# sourceMappingURL=setup-
|
|
45
|
+
//# sourceMappingURL=setup-C9YZk0-b.js.map
|
|
@@ -533,15 +533,15 @@ async function runSubcommand(argv) {
|
|
|
533
533
|
case "restart": return await cmdRestart(rest);
|
|
534
534
|
case "note": return await cmdNote(rest);
|
|
535
535
|
case "serve": {
|
|
536
|
-
const { cmdServe } = await import("./serve-
|
|
536
|
+
const { cmdServe } = await import("./serve-DZZAjj5z.js");
|
|
537
537
|
return cmdServe(rest);
|
|
538
538
|
}
|
|
539
539
|
case "setup": {
|
|
540
|
-
const { cmdSetup } = await import("./setup-
|
|
540
|
+
const { cmdSetup } = await import("./setup-C9YZk0-b.js");
|
|
541
541
|
return cmdSetup(rest);
|
|
542
542
|
}
|
|
543
543
|
case "schedule": {
|
|
544
|
-
const { cmdSchedule } = await import("./schedule-
|
|
544
|
+
const { cmdSchedule } = await import("./schedule-C_eeRqKl.js");
|
|
545
545
|
return cmdSchedule(rest);
|
|
546
546
|
}
|
|
547
547
|
case "remote": {
|
|
@@ -2428,4 +2428,4 @@ async function cmdResultSet(rest) {
|
|
|
2428
2428
|
|
|
2429
2429
|
//#endregion
|
|
2430
2430
|
export { resolveReadWindow as _, cursorAbs as a, stopTipForCli as b, finalizedLines as c, listRecords as d, matchKeyword as f, resolveOne as g, renderRawLogLines as h, controlCodeFromName as i, isPidAlive as l, renderRawLog as m, READ_PAGE_DEFAULT as n, extractNeedsInput as o, readNotes as p, cmdHelp as r, extractTaskCounts as s, GRACEFUL_EXIT_COMMANDS as t, isSubcommand as u, runSubcommand as v, writeToIpc as x, snapshotStatus as y };
|
|
2431
|
-
//# sourceMappingURL=subcommands-
|
|
2431
|
+
//# sourceMappingURL=subcommands-Cppv0tFw.js.map
|
|
@@ -2,6 +2,6 @@ import "./logger-CDIsZ-Pp.js";
|
|
|
2
2
|
import "./globalPidIndex-DlmmJlO8.js";
|
|
3
3
|
import "./configShared-C1C04bbq.js";
|
|
4
4
|
import "./remotes-PKKjfTI1.js";
|
|
5
|
-
import { _ as resolveReadWindow, a as cursorAbs, b as stopTipForCli, c as finalizedLines, d as listRecords, f as matchKeyword, g as resolveOne, h as renderRawLogLines, i as controlCodeFromName, l as isPidAlive, m as renderRawLog, n as READ_PAGE_DEFAULT, o as extractNeedsInput, p as readNotes, r as cmdHelp, s as extractTaskCounts, t as GRACEFUL_EXIT_COMMANDS, u as isSubcommand, v as runSubcommand, x as writeToIpc, y as snapshotStatus } from "./subcommands-
|
|
5
|
+
import { _ as resolveReadWindow, a as cursorAbs, b as stopTipForCli, c as finalizedLines, d as listRecords, f as matchKeyword, g as resolveOne, h as renderRawLogLines, i as controlCodeFromName, l as isPidAlive, m as renderRawLog, n as READ_PAGE_DEFAULT, o as extractNeedsInput, p as readNotes, r as cmdHelp, s as extractTaskCounts, t as GRACEFUL_EXIT_COMMANDS, u as isSubcommand, v as runSubcommand, x as writeToIpc, y as snapshotStatus } from "./subcommands-Cppv0tFw.js";
|
|
6
6
|
|
|
7
7
|
export { cmdHelp, isSubcommand, runSubcommand };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logger, t as addTransport } from "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
2
|
+
import { r as getInstalledPackage } from "./versionChecker-DQHJdATh.js";
|
|
3
3
|
import { t as agentYesHome } from "./agentYesHome-_eJa3DaX.js";
|
|
4
4
|
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-V4qvXgAw.js";
|
|
5
5
|
import { t as PidStore } from "./pidStore-fqXqTKkh.js";
|
|
@@ -1788,4 +1788,4 @@ function sleep(ms) {
|
|
|
1788
1788
|
|
|
1789
1789
|
//#endregion
|
|
1790
1790
|
export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
|
|
1791
|
-
//# sourceMappingURL=ts-
|
|
1791
|
+
//# sourceMappingURL=ts-7ZIbLUAs.js.map
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
|
|
|
7
7
|
|
|
8
8
|
//#region package.json
|
|
9
9
|
var name = "claude-yes";
|
|
10
|
-
var version = "1.
|
|
10
|
+
var version = "1.137.0";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ts/versionChecker.ts
|
|
@@ -215,4 +215,4 @@ async function displayVersion() {
|
|
|
215
215
|
|
|
216
216
|
//#endregion
|
|
217
217
|
export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
|
|
218
|
-
//# sourceMappingURL=versionChecker-
|
|
218
|
+
//# sourceMappingURL=versionChecker-DQHJdATh.js.map
|
package/lab/ui/index.html
CHANGED
|
@@ -970,6 +970,13 @@
|
|
|
970
970
|
}
|
|
971
971
|
.log .xterm {
|
|
972
972
|
height: 100%;
|
|
973
|
+
/* Shared-canvas: when we're a WATCHER rendering at another viewer's
|
|
974
|
+
(the driver's) grid size, scale the whole grid to fit our pane instead
|
|
975
|
+
of reflowing. transform-origin keeps the scaled grid pinned top-left so
|
|
976
|
+
the peer-selection overlay (which uses grid coords) still lines up.
|
|
977
|
+
For the driver / single viewer the grid already fits, so no transform
|
|
978
|
+
is applied (see applyCanvasScale). */
|
|
979
|
+
transform-origin: top left;
|
|
973
980
|
}
|
|
974
981
|
/* Other viewers' selection ranges, drawn over our grid (slice 2 of
|
|
975
982
|
multi-peer presence). Approximate — peer coords are mapped proportionally
|
|
@@ -2335,6 +2342,10 @@
|
|
|
2335
2342
|
// The last winsize the agent's PTY reported (from /api/size), so the tooltip
|
|
2336
2343
|
// can show OUR viewport vs the agent's render size. Reset on agent switch.
|
|
2337
2344
|
let agentSize = null;
|
|
2345
|
+
// When WE last drove the grid size (pushed our size to the agent). For a
|
|
2346
|
+
// short lease after that, the heartbeat won't follow/override — so our own
|
|
2347
|
+
// push isn't fought while the agent's /api/size is still catching up.
|
|
2348
|
+
let lastDroveAt = 0;
|
|
2338
2349
|
|
|
2339
2350
|
function isDarkColor(c) {
|
|
2340
2351
|
try {
|
|
@@ -2475,11 +2486,16 @@
|
|
|
2475
2486
|
let selR = null;
|
|
2476
2487
|
try {
|
|
2477
2488
|
// xterm 5.x: getSelectionPosition() returns { start:{x,y}, end:{x,y} }
|
|
2478
|
-
//
|
|
2479
|
-
//
|
|
2489
|
+
// with y = ABSOLUTE buffer-line index. Viewers connect at different times,
|
|
2490
|
+
// so their buffer-line indices don't line up — but the live-tail CONTENT
|
|
2491
|
+
// is identical, so "lines from the BOTTOM" (length-1 - y) IS a shared
|
|
2492
|
+
// coordinate. We emit fromBottom for rows; the receiver maps it back into
|
|
2493
|
+
// its own buffer + viewport. cols stay as-is.
|
|
2480
2494
|
const s = term.getSelectionPosition && term.getSelectionPosition();
|
|
2481
|
-
if (s && s.start && s.end)
|
|
2482
|
-
|
|
2495
|
+
if (s && s.start && s.end) {
|
|
2496
|
+
const last = (term.buffer.active.length || 1) - 1;
|
|
2497
|
+
selR = `${last - s.start.y},${s.start.x}-${last - s.end.y},${s.end.x}`;
|
|
2498
|
+
}
|
|
2483
2499
|
} catch {}
|
|
2484
2500
|
cur.tx
|
|
2485
2501
|
.post("/api/presence", {
|
|
@@ -2507,12 +2523,19 @@
|
|
|
2507
2523
|
}
|
|
2508
2524
|
renderPeerSelections();
|
|
2509
2525
|
}
|
|
2510
|
-
// 3s heartbeat (< the host's 12s TTL): refresh our presence + read others'
|
|
2526
|
+
// 3s heartbeat (< the host's 12s TTL): refresh our presence + read others',
|
|
2527
|
+
// and follow the canonical grid size (resize+scale, never reflow) so all
|
|
2528
|
+
// viewers stay on one shared canvas and selections line up.
|
|
2511
2529
|
setInterval(() => {
|
|
2512
|
-
if (sel)
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2530
|
+
if (!sel) return;
|
|
2531
|
+
sendPresence();
|
|
2532
|
+
pollPresence();
|
|
2533
|
+
const cur = presenceTarget();
|
|
2534
|
+
if (cur)
|
|
2535
|
+
cur.tx
|
|
2536
|
+
.fetchJSON("/api/size/" + encodeURIComponent(cur.e.pid))
|
|
2537
|
+
.then(followAgentSize)
|
|
2538
|
+
.catch(() => {});
|
|
2516
2539
|
}, 3000);
|
|
2517
2540
|
|
|
2518
2541
|
// ---- slice 2: draw each peer's selection range as an overlay in OUR grid.
|
|
@@ -2524,16 +2547,36 @@
|
|
|
2524
2547
|
for (const ch of String(s)) h = (h * 31 + ch.charCodeAt(0)) >>> 0;
|
|
2525
2548
|
return h % 360;
|
|
2526
2549
|
}
|
|
2527
|
-
|
|
2550
|
+
// Parse "fbRow,col-fbRow,col" where the rows are LINES-FROM-THE-BOTTOM of the
|
|
2551
|
+
// peer's buffer (a coordinate shared across viewers — see sendPresence).
|
|
2552
|
+
function parseSel(selStr) {
|
|
2528
2553
|
const m = /^(\d+),(\d+)-(\d+),(\d+)$/.exec(selStr || "");
|
|
2529
2554
|
if (!m) return null;
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2555
|
+
return { fa: +m[1], ca: +m[2], fb: +m[3], cb: +m[4] };
|
|
2556
|
+
}
|
|
2557
|
+
// Per-row spans for a peer selection, in OUR buffer rows. fromBottom is mapped
|
|
2558
|
+
// against OUR buffer bottom (myLast) so the same live-tail line matches even
|
|
2559
|
+
// though absolute indices differ between viewers; only the rows visible in our
|
|
2560
|
+
// viewport [vy, vy+myRows) are emitted (so a giant selection stays cheap). A
|
|
2561
|
+
// selection is per-row: top row cA→edge, full-width middle, bottom row 0→cB.
|
|
2562
|
+
// Columns are EXACT when widths match, proportional only as a fallback.
|
|
2563
|
+
function selSegments(sel, myLast, vy, myRows, peerCols, myCols) {
|
|
2564
|
+
const sameW = (peerCols || myCols) === myCols;
|
|
2565
|
+
const mapC = (c) => (sameW ? c : Math.round((c / (peerCols || myCols)) * myCols));
|
|
2566
|
+
let rA = myLast - sel.fa,
|
|
2567
|
+
rB = myLast - sel.fb,
|
|
2568
|
+
cA = sel.ca,
|
|
2569
|
+
cB = sel.cb;
|
|
2570
|
+
if (rA > rB) ([rA, rB] = [rB, rA]), ([cA, cB] = [cB, cA]); // rA = top row
|
|
2571
|
+
const segs = [];
|
|
2572
|
+
const from = Math.max(rA, vy),
|
|
2573
|
+
to = Math.min(rB, vy + myRows - 1);
|
|
2574
|
+
for (let r = from; r <= to; r++) {
|
|
2575
|
+
const a = r === rA ? cA : 0;
|
|
2576
|
+
const b = r === rB ? cB : myCols;
|
|
2577
|
+
segs.push({ row: r, a: Math.min(mapC(a), mapC(b)), b: Math.max(mapC(a), mapC(b)) });
|
|
2578
|
+
}
|
|
2579
|
+
return segs;
|
|
2537
2580
|
}
|
|
2538
2581
|
function renderPeerSelections() {
|
|
2539
2582
|
const logEl = $("log");
|
|
@@ -2560,19 +2603,78 @@
|
|
|
2560
2603
|
oy = sr.top - lr.top;
|
|
2561
2604
|
const cw = sr.width / term.cols,
|
|
2562
2605
|
ch = sr.height / term.rows;
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
.
|
|
2606
|
+
// Anchor to OUR buffer: viewportY = top visible buffer line, myLast = bottom
|
|
2607
|
+
// buffer line. A peer's fromBottom row maps to our buffer row (myLast − fb)
|
|
2608
|
+
// then to our viewport row (− viewportY). Re-rendered on term.onScroll so the
|
|
2609
|
+
// box tracks as we move through scrollback, and clips when out of view.
|
|
2610
|
+
const ba = term.buffer && term.buffer.active;
|
|
2611
|
+
const vy = (ba && ba.viewportY) || 0;
|
|
2612
|
+
const myLast = ((ba && ba.length) || 1) - 1;
|
|
2613
|
+
const html = [];
|
|
2614
|
+
for (const p of peers) {
|
|
2615
|
+
const sel = parseSel(p.sel);
|
|
2616
|
+
if (!sel) continue;
|
|
2617
|
+
const hue = hashHue(p.viewer);
|
|
2618
|
+
const tag = esc(String(p.viewer).slice(0, 4)) + " " + (p.cols || "?") + "×" + (p.rows || "?");
|
|
2619
|
+
let tagged = false;
|
|
2620
|
+
for (const seg of selSegments(sel, myLast, vy, term.rows, p.cols || term.cols, term.cols)) {
|
|
2621
|
+
const vr = seg.row - vy; // our buffer row → our viewport row
|
|
2622
|
+
if (vr < 0 || vr > term.rows - 1) continue; // safety (selSegments already clips)
|
|
2623
|
+
const left = ox + seg.a * cw;
|
|
2624
|
+
const w = Math.max(cw, (seg.b - seg.a) * cw);
|
|
2625
|
+
const top = oy + vr * ch;
|
|
2626
|
+
const tagEl = tagged ? "" : ((tagged = true), `<span class="peer-tag">${tag}</span>`);
|
|
2627
|
+
html.push(
|
|
2628
|
+
`<div class="peer-sel" style="--ph:${hue};top:${top.toFixed(1)}px;left:${left.toFixed(1)}px;width:${w.toFixed(1)}px;height:${ch.toFixed(1)}px">${tagEl}</div>`,
|
|
2629
|
+
);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
ov.innerHTML = html.join("");
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
// ---- shared canvas: scale (don't reflow) the grid to fit our pane --------
|
|
2636
|
+
// When we render at the canonical (driver/agent) grid size and it doesn't
|
|
2637
|
+
// match our pane, CSS-scale the whole .xterm to fit — so every viewer shows
|
|
2638
|
+
// identical content and selections/overlays line up. For the driver / single
|
|
2639
|
+
// viewer the grid already fits the pane (scale ≈ 1) → no transform, so the
|
|
2640
|
+
// common path is byte-for-byte unchanged. Best-effort + guarded.
|
|
2641
|
+
function applyCanvasScale() {
|
|
2642
|
+
try {
|
|
2643
|
+
const logEl = $("log");
|
|
2644
|
+
const xt = logEl && logEl.querySelector(".xterm");
|
|
2645
|
+
if (!xt) return;
|
|
2646
|
+
xt.style.transform = "none"; // measure the natural (unscaled) grid
|
|
2647
|
+
const screen = xt.querySelector(".xterm-screen");
|
|
2648
|
+
if (!screen) return;
|
|
2649
|
+
const gw = screen.offsetWidth,
|
|
2650
|
+
gh = screen.offsetHeight;
|
|
2651
|
+
if (!gw || !gh) return;
|
|
2652
|
+
const cs = getComputedStyle(logEl);
|
|
2653
|
+
const pw = logEl.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight);
|
|
2654
|
+
const ph = logEl.clientHeight - parseFloat(cs.paddingTop) - parseFloat(cs.paddingBottom);
|
|
2655
|
+
if (pw <= 0 || ph <= 0) return;
|
|
2656
|
+
const s = Math.min(pw / gw, ph / gh);
|
|
2657
|
+
// Near-1 (driver / single viewer): keep it crisp, no transform.
|
|
2658
|
+
xt.style.transform = s > 0.985 && s < 1.04 ? "none" : "scale(" + s.toFixed(4) + ")";
|
|
2659
|
+
} catch {}
|
|
2660
|
+
}
|
|
2661
|
+
// Follow the canonical grid: resize our xterm to the agent's size (set by the
|
|
2662
|
+
// active driver / local owner) WITHOUT reflowing to our pane, then scale to
|
|
2663
|
+
// fit. No-op when we already match (we're the driver, or sizes agree).
|
|
2664
|
+
function followAgentSize(sz) {
|
|
2665
|
+
if (!term || !sz || !sz.cols || !sz.rows) return;
|
|
2666
|
+
// While our own recent push is still settling, don't fight it.
|
|
2667
|
+
if (Date.now() - lastDroveAt < 6000) {
|
|
2668
|
+
applyCanvasScale();
|
|
2669
|
+
return;
|
|
2670
|
+
}
|
|
2671
|
+
if (sz.cols !== term.cols || sz.rows !== term.rows) {
|
|
2672
|
+
agentSize = sz;
|
|
2673
|
+
try {
|
|
2674
|
+
term.resize(sz.cols, sz.rows);
|
|
2675
|
+
} catch {}
|
|
2676
|
+
}
|
|
2677
|
+
applyCanvasScale();
|
|
2576
2678
|
}
|
|
2577
2679
|
|
|
2578
2680
|
// Wire the ⋯ overflow menu and restore the saved HUD preference.
|
|
@@ -3223,13 +3325,18 @@
|
|
|
3223
3325
|
// one-shot "push only if the agent is out of sync" check.
|
|
3224
3326
|
let suppressPush = true;
|
|
3225
3327
|
const pushSize = () => {
|
|
3226
|
-
if (term && sel === e._key && !suppressPush)
|
|
3328
|
+
if (term && sel === e._key && !suppressPush) {
|
|
3329
|
+
lastDroveAt = Date.now(); // we're driving the size now (lease the grid)
|
|
3227
3330
|
tx.post("/api/resize/" + encodeURIComponent(pid), {
|
|
3228
3331
|
cols: term.cols,
|
|
3229
3332
|
rows: term.rows,
|
|
3230
3333
|
}).catch(() => {});
|
|
3334
|
+
}
|
|
3231
3335
|
};
|
|
3232
3336
|
term.onResize(pushSize);
|
|
3337
|
+
// Scrolling through OUR scrollback moves the viewport over the buffer, so
|
|
3338
|
+
// re-place peer-selection overlays (they're anchored to absolute buffer rows).
|
|
3339
|
+
term.onScroll(() => renderPeerSelections());
|
|
3233
3340
|
// Forward everything the terminal emits to the agent stdin (raw, no
|
|
3234
3341
|
// trailing Enter): keystrokes, paste, and — when a TUI enables mouse
|
|
3235
3342
|
// tracking — click / drag-motion / wheel as SGR mouse reports. onBinary
|
|
@@ -3264,12 +3371,14 @@
|
|
|
3264
3371
|
fit.fit();
|
|
3265
3372
|
} catch {}
|
|
3266
3373
|
if (!sz || sz.cols !== term.cols || sz.rows !== term.rows) {
|
|
3374
|
+
lastDroveAt = Date.now(); // adopting our size on open = we drive (lease)
|
|
3267
3375
|
tx.post("/api/resize/" + encodeURIComponent(pid), {
|
|
3268
3376
|
cols: term.cols,
|
|
3269
3377
|
rows: term.rows,
|
|
3270
3378
|
}).catch(() => {});
|
|
3271
3379
|
}
|
|
3272
3380
|
suppressPush = false;
|
|
3381
|
+
applyCanvasScale(); // driver: grid == pane → no-op; otherwise letterbox
|
|
3273
3382
|
};
|
|
3274
3383
|
// Fit + sync now, and on every later tab re-activation: re-measure our pane
|
|
3275
3384
|
// and re-assert our size to the agent so the stream always reflows to OUR
|
|
@@ -3378,10 +3487,14 @@
|
|
|
3378
3487
|
renderList();
|
|
3379
3488
|
});
|
|
3380
3489
|
window.addEventListener("resize", () => {
|
|
3490
|
+
// Resizing our window is strong intent → re-fit to our pane (we become the
|
|
3491
|
+
// size driver; the push rides term.onResize). applyCanvasScale then clears
|
|
3492
|
+
// the transform since our grid now matches our pane.
|
|
3381
3493
|
if (fit)
|
|
3382
3494
|
try {
|
|
3383
3495
|
fit.fit();
|
|
3384
3496
|
} catch {}
|
|
3497
|
+
applyCanvasScale();
|
|
3385
3498
|
renderPeerSelections(); // cell size changed → reposition peer-selection overlays
|
|
3386
3499
|
});
|
|
3387
3500
|
// iOS overlays the soft keyboard ON TOP of the layout viewport rather than
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./ts-BurepTpP.js";
|
|
2
|
-
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-BQqv1OP1.js";
|
|
4
|
-
import "./pidStore-fqXqTKkh.js";
|
|
5
|
-
import "./globalPidIndex-DlmmJlO8.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-lVtK6ikD.js";
|
|
7
|
-
|
|
8
|
-
export { SUPPORTED_CLIS };
|