@william_jin/autobrowse 0.8.16 → 0.8.18
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/assets/live-view/hub.html +107 -25
- package/assets/overlay/bin/win32-arm64/overlay-host.exe +0 -0
- package/assets/overlay/bin/win32-x64/overlay-host.exe +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<!-- The live hub's page (designs/2026-11-25-live-view.md §Hub), served by `overlay-host hub` at abhub://localhost/.
|
|
7
7
|
A sidebar of sessions and panes; each pane is an iframe of its session's viewer. Talks only to the app (ipc). -->
|
|
8
8
|
<style>
|
|
9
|
-
:root{color-scheme:light;--accent:#6a5a93;--hair:color-mix(in srgb,var(--fg) 11%,transparent);--fill:color-mix(in srgb,var(--fg) 5%,transparent);--raise:0 0 0 1px var(--hair),0 1px 2px rgb(14 14 14/.04),0 4px 14px -6px rgb(40 30 70/.10);--bg:#ecebe8;--bar:#e3e2de;--side:#e7e6e2;--fg:#1d1d1b;--mut:#65635e;--rowh:color-mix(in srgb,var(--side),#000 5%);--rowon:color-mix(in srgb,var(--side),#000 8%);--line:rgba(0,0,0,.09);--needs:#fbefd2;--needsfg:#5c4307;--needsbtn:rgba(0,0,0,.08);--ring:var(--accent);--brand:var(--accent);--held:#8a5a00;--heldt:rgba(214,150,20,.17);--btn:rgba(0,0,0,.06);--btnh:rgba(0,0,0,.1);--seg:rgba(0,0,0,.06);--segon:#fbfbfa;--pane:#dcdbd7;--mkf:#fff;--mkt:#6b4ee6;--drop:color-mix(in srgb,var(--accent) 14%,transparent);--scrim:rgba(0,0,0,.3);--lift:0 12px 40px rgba(0,0,0,.25)}
|
|
10
|
-
:root[data-theme=dark],:root[data-look=dark]{color-scheme:dark;--accent:#a596d6;--raise:0 0 0 1px var(--hair),0 6px 18px -8px rgb(0 0 0/.6);--bg:#1c1c1b;--bar:#1f1f1e;--side:#212120;--fg:#ecebe6;--mut:#9b998f;--rowh:color-mix(in srgb,var(--side),#fff 5%);--rowon:color-mix(in srgb,var(--side),#fff 8%);--line:rgba(255,255,255,.08);--needs:#3e3216;--needsfg:#f3dfa8;--needsbtn:rgba(0,0,0,.08);--ring:var(--accent);--brand:var(--accent);--held:#f0c060;--heldt:rgba(240,192,96,.15);--btn:rgba(255,255,255,.07);--btnh:rgba(255,255,255,.12);--seg:rgba(255,255,255,.06);--segon:#3a3a38;--pane:#161615;--mkf:#16161a;--mkt:#a996ff;--drop:color-mix(in srgb,var(--accent) 16%,transparent);--scrim:rgba(0,0,0,.55)}
|
|
9
|
+
:root{color-scheme:light;--accent:#6a5a93;--hair:color-mix(in srgb,var(--fg) 11%,transparent);--fill:color-mix(in srgb,var(--fg) 5%,transparent);--raise:0 0 0 1px var(--hair),0 1px 2px rgb(14 14 14/.04),0 4px 14px -6px rgb(40 30 70/.10);--bg:#ecebe8;--bar:#e3e2de;--side:#e7e6e2;--fg:#1d1d1b;--mut:#65635e;--rowh:color-mix(in srgb,var(--side),#000 5%);--rowon:color-mix(in srgb,var(--side),#000 8%);--line:rgba(0,0,0,.09);--needs:#fbefd2;--needsfg:#5c4307;--needsbtn:rgba(0,0,0,.08);--ring:var(--accent);--brand:var(--accent);--held:#8a5a00;--heldt:rgba(214,150,20,.17);--btn:rgba(0,0,0,.06);--btnh:rgba(0,0,0,.1);--seg:rgba(0,0,0,.06);--segon:#fbfbfa;--pane:#dcdbd7;--mkf:#fff;--mkt:#6b4ee6;--drop:color-mix(in srgb,var(--accent) 14%,transparent);--scrim:rgba(0,0,0,.3);--lift:0 12px 40px rgba(0,0,0,.25);--tbar:#f7f6f3;--frame:0 0 0 1px rgba(0,0,0,.13),0 1px 2px rgba(0,0,0,.06),0 8px 22px -10px rgb(40 30 70/.22)}
|
|
10
|
+
:root[data-theme=dark],:root[data-look=dark]{color-scheme:dark;--accent:#a596d6;--raise:0 0 0 1px var(--hair),0 6px 18px -8px rgb(0 0 0/.6);--bg:#1c1c1b;--bar:#1f1f1e;--side:#212120;--fg:#ecebe6;--mut:#9b998f;--rowh:color-mix(in srgb,var(--side),#fff 5%);--rowon:color-mix(in srgb,var(--side),#fff 8%);--line:rgba(255,255,255,.08);--needs:#3e3216;--needsfg:#f3dfa8;--needsbtn:rgba(0,0,0,.08);--ring:var(--accent);--brand:var(--accent);--held:#f0c060;--heldt:rgba(240,192,96,.15);--btn:rgba(255,255,255,.07);--btnh:rgba(255,255,255,.12);--seg:rgba(255,255,255,.06);--segon:#3a3a38;--pane:#161615;--mkf:#16161a;--mkt:#a996ff;--drop:color-mix(in srgb,var(--accent) 16%,transparent);--scrim:rgba(0,0,0,.55);--tbar:#2a2a28;--frame:0 0 0 1px rgba(255,255,255,.10),0 10px 28px -10px rgb(0 0 0/.75)}
|
|
11
11
|
*{box-sizing:border-box}
|
|
12
12
|
html,body{margin:0;height:100%;overflow:clip;background:var(--bg);color:var(--fg);font:13px/1.3 -apple-system,system-ui,sans-serif;-webkit-user-select:none;user-select:none;cursor:default}
|
|
13
13
|
button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:default}
|
|
@@ -22,8 +22,10 @@ button:focus-visible,.row:focus-visible{outline:2px solid var(--ring);outline-of
|
|
|
22
22
|
#seg{display:flex;flex:none;margin:0;border:0;padding:2px;border-radius:8px;background:var(--seg)}
|
|
23
23
|
#seg button{display:grid;place-items:center;width:30px;height:22px;padding:0;border-radius:6px;color:var(--mut);font-size:12px;font-weight:500;transition:background-color .15s,color .15s}
|
|
24
24
|
#seg button[aria-pressed=true]{background:var(--segon);color:var(--fg);box-shadow:0 1px 2px rgba(0,0,0,.12)}
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
/* §Hub motion: Restore sits over the drag space left of the layout switch, so nothing moves; it fades and slides 6 px */
|
|
26
|
+
#segs{position:relative;display:flex;flex:none}
|
|
27
|
+
#unmax{position:absolute;right:calc(100% + 6px);top:0;padding:0 8px 0 6px;opacity:0;transform:translateX(6px);white-space:nowrap;font-size:12px;font-weight:500;pointer-events:none;transition:opacity .15s cubic-bezier(.16,1,.3,1),transform .15s cubic-bezier(.16,1,.3,1),background-color .15s,color .15s}
|
|
28
|
+
.maxed #unmax{opacity:1;transform:none;pointer-events:auto}
|
|
27
29
|
#pauseall{flex-direction:column;gap:0;padding:0 10px;font-size:12px;font-weight:500;background:var(--btn);color:var(--fg)}
|
|
28
30
|
/* sizer: the longer label, never seen */
|
|
29
31
|
#pauseall::after{content:"Resume all";height:0;overflow:hidden;visibility:hidden}
|
|
@@ -32,16 +34,22 @@ button:focus-visible,.row:focus-visible{outline:2px solid var(--ring);outline-of
|
|
|
32
34
|
@media (max-width:759px){#top{gap:4px}#seg button{width:26px}#pauseall{padding:0 8px}}
|
|
33
35
|
#main{position:absolute;inset:38px 0 0 0;display:flex}
|
|
34
36
|
#list{position:relative;list-style:none;margin:0;flex:1;overflow-y:auto;padding:2px 6px 44px;scrollbar-width:thin}
|
|
35
|
-
/* §Sidebar collapse: #side holds the room in the layout (full, rail or none); #sidein is the panel, --sidew wide, clipped to
|
|
36
|
-
|
|
37
|
+
/* §Sidebar collapse: #side holds the room in the layout (full, rail or none); #sidein is the panel, --sidew wide, clipped to --vis. The flyout unclips it over the stage, so the stage never resizes.
|
|
38
|
+
§Hub motion: the room takes its width at once (the panes sweep); the clip edge moves by two opposite translateXs, #sideclip and #sidein, so no layout and no clip repaint */
|
|
39
|
+
#main{background:var(--pane)}
|
|
40
|
+
#side{position:relative;z-index:3;flex:none;width:var(--sidew,248px)}
|
|
37
41
|
.m-rail #side{width:52px}
|
|
38
42
|
.m-hidden #side{width:0}
|
|
39
|
-
#
|
|
40
|
-
|
|
41
|
-
.m-
|
|
43
|
+
#sideclip{--vis:var(--sidew,248px);position:absolute;inset:0 auto 0 0;width:calc(var(--sidew,248px) + 60px);overflow:hidden;transform:translateX(calc(var(--vis) - var(--sidew,248px) - 60px));transition:transform .2s cubic-bezier(.16,1,.3,1)}
|
|
44
|
+
#sidein{position:absolute;inset:0 auto 0 0;width:var(--sidew,248px);display:flex;flex-direction:column;background:var(--side);overflow:hidden;transform:translateX(calc(var(--sidew,248px) + 60px - var(--vis)));transition:transform .2s cubic-bezier(.16,1,.3,1),box-shadow .2s cubic-bezier(.16,1,.3,1)}
|
|
45
|
+
.m-rail #sideclip{--vis:52px}
|
|
46
|
+
.m-hidden #sideclip{--vis:0px}
|
|
47
|
+
.m-hidden #sidein{pointer-events:none}
|
|
42
48
|
/* the flyout: unclipped, room on the right for its shadow */
|
|
43
|
-
.m-rail.peek #
|
|
44
|
-
.
|
|
49
|
+
.m-rail.peek #sideclip{--vis:calc(var(--sidew,248px) + 60px)}
|
|
50
|
+
.m-rail.peek #sidein{box-shadow:0 0 0 1px var(--hair),var(--lift)}
|
|
51
|
+
.m-rail.peek :is(#sideclip,#sidein){transition-duration:.18s}
|
|
52
|
+
.unpeek #side :is(#sideclip,#sidein){transition-duration:.15s}
|
|
45
53
|
/* a leaving row or label: out of the flow, fading, while the rest slide up */
|
|
46
54
|
#list>.gone{position:absolute;left:6px;right:6px;opacity:0;pointer-events:none;transition:opacity .15s}
|
|
47
55
|
.sec{position:sticky;top:0;z-index:1;background:var(--side);transition:opacity .15s,transform .2s cubic-bezier(.16,1,.3,1)}
|
|
@@ -142,16 +150,20 @@ button:focus-visible,.row:focus-visible{outline:2px solid var(--ring);outline-of
|
|
|
142
150
|
kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;border-radius:5px;background:var(--fill);box-shadow:inset 0 0 0 1px var(--hair);font:500 11px/1 -apple-system,system-ui,sans-serif;color:var(--fg);white-space:nowrap}
|
|
143
151
|
.ks{display:inline-flex;gap:3px}
|
|
144
152
|
#stage{position:relative;flex:1;min-width:0;background:var(--pane)}
|
|
145
|
-
|
|
153
|
+
/* §Hub motion: the box sweeps by transform (sweep()); .pin counter-scales, so bar and page stay 1:1 */
|
|
154
|
+
.pane{position:absolute;overflow:hidden;background:var(--bg);opacity:0;transform-origin:0 0;transition:opacity .15s cubic-bezier(.16,1,.3,1)}
|
|
155
|
+
.pin{display:flex;flex-direction:column;width:100%;height:100%;transform-origin:0 0}
|
|
146
156
|
.pane.in{opacity:1}
|
|
147
157
|
.pane.off{visibility:hidden;pointer-events:none}
|
|
148
|
-
|
|
158
|
+
/* §Hub windows: each run in Grid or Split is a window: frame, shadow, a raised title bar over the darker desk */
|
|
159
|
+
.grid .pane{border-radius:10px;box-shadow:var(--frame)}
|
|
149
160
|
.pane::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 1.5px var(--ring);pointer-events:none;opacity:0;transition:opacity .15s}
|
|
150
161
|
.pane.cur::after{opacity:1}
|
|
151
162
|
.single .pane.cur::after{display:none}
|
|
152
163
|
.pane.drop::before{content:"";position:absolute;inset:0;background:var(--drop);z-index:2;pointer-events:none}
|
|
153
164
|
.ph{flex:none;height:28px;display:flex;align-items:center;gap:6px;padding:0 4px 0 10px;background:var(--bar);font-size:12px}
|
|
154
165
|
.single .ph{display:none}
|
|
166
|
+
.grid .ph{background:var(--tbar);box-shadow:inset 0 -1px 0 var(--line)}
|
|
155
167
|
.ph .nm{font-weight:600;white-space:nowrap;flex:0 1 auto;min-width:0;overflow:hidden}
|
|
156
168
|
.ph .sw{flex:none;color:var(--mut);white-space:nowrap}
|
|
157
169
|
.ph .nm.cut{-webkit-mask-image:linear-gradient(90deg,#000 80%,transparent)}
|
|
@@ -221,11 +233,10 @@ kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px
|
|
|
221
233
|
.m-hidden #grip,.peek #grip,.narrow #grip{display:none}
|
|
222
234
|
/* a drag: 1:1 with the pointer, so no tweens; frames take no pointer */
|
|
223
235
|
.sizing,.sizing *{cursor:col-resize}
|
|
224
|
-
.sizing #side
|
|
236
|
+
.sizing #side :is(#sideclip,#sidein),.sizing #stage .pane{transition:none}
|
|
225
237
|
.sizing iframe{pointer-events:none}
|
|
226
238
|
/* a snap mid-drag (rail, hidden, back): the edge leaves the pointer, so it eases */
|
|
227
|
-
.sizing.snap #side{transition:
|
|
228
|
-
.sizing.snap #side #sidein{transition:clip-path .12s cubic-bezier(.16,1,.3,1)}
|
|
239
|
+
.sizing.snap #side :is(#sideclip,#sidein){transition:transform .12s cubic-bezier(.16,1,.3,1)}
|
|
229
240
|
/* compact rows: one line; a needs-you reason stays */
|
|
230
241
|
#list .row .meta,#list .row .title{transition:opacity .1s}
|
|
231
242
|
.compacting .row :is(.meta,.job,.flow,.title,.tabs){opacity:0}
|
|
@@ -237,18 +248,19 @@ kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px
|
|
|
237
248
|
<div id="top">
|
|
238
249
|
<button type="button" class="nb" id="sidebtn" title="Sessions (⌘\)" aria-label="Collapse or expand the sidebar (⌘\)" aria-pressed="true"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="2"/><path d="M6 3v10"/></svg></button>
|
|
239
250
|
<div class="sp" id="drag"></div>
|
|
251
|
+
<span id="segs">
|
|
240
252
|
<button type="button" class="nb" id="unmax" title="Restore the layout (⌘⇧↩)" tabindex="-1"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 6.5h-4v-4M2.5 9.5h4v4M9.5 6.5l4-4M6.5 9.5l-4 4"/></svg>Restore</button>
|
|
241
253
|
<fieldset id="seg" aria-label="Layout">
|
|
242
254
|
<button type="button" data-l="focus" title="Focus: one pane (⌃⌘1)" aria-label="Focus: one pane" aria-pressed="true"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="2"/></svg></button>
|
|
243
255
|
<button type="button" data-l="split" title="Split: two panes (⌃⌘2)" aria-label="Split: two panes" aria-pressed="false"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="2"/><path d="M8 3v10"/></svg></button>
|
|
244
256
|
<button type="button" data-l="grid" title="Grid: up to 9 panes (⌃⌘3)" aria-label="Grid: up to 9 panes" aria-pressed="false"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="2"/><path d="M8 3v10M2 8h12"/></svg></button>
|
|
245
|
-
</fieldset>
|
|
257
|
+
</fieldset></span>
|
|
246
258
|
<button type="button" class="nb" id="pauseall" title="Pause every agent (⌘⇧P)" disabled>Pause all</button>
|
|
247
259
|
<button type="button" class="nb" id="keysbtn" title="Keys" aria-label="Keys" aria-expanded="false"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><rect x="1.5" y="4" width="13" height="8.5" rx="1.8"/><path d="M4.5 7h.01M7 7h.01M9.5 7h.01M12 7h.01M5 10h6"/></svg></button>
|
|
248
260
|
</div>
|
|
249
261
|
<div id="main">
|
|
250
|
-
<nav id="side" aria-label="Sessions"><div id="sidein"><ul id="list"></ul>
|
|
251
|
-
<div id="bar" class="off"><span id="barl"></span><span class="sp"></span><button type="button" id="barkeys" title="Keys (⌘/)">Keys <span class="ks"><kbd>⌘</kbd><kbd>/</kbd></span></button><button type="button" id="more" title="Sidebar actions" aria-label="Sidebar actions" aria-haspopup="menu" aria-expanded="false" aria-controls="menu" popovertarget="menu"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h.01M8 8h.01M12.5 8h.01" stroke-width="2.4"/></svg></button></div></div>
|
|
262
|
+
<nav id="side" aria-label="Sessions"><div id="sideclip"><div id="sidein"><ul id="list"></ul>
|
|
263
|
+
<div id="bar" class="off"><span id="barl"></span><span class="sp"></span><button type="button" id="barkeys" title="Keys (⌘/)">Keys <span class="ks"><kbd>⌘</kbd><kbd>/</kbd></span></button><button type="button" id="more" title="Sidebar actions" aria-label="Sidebar actions" aria-haspopup="menu" aria-expanded="false" aria-controls="menu" popovertarget="menu"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h.01M8 8h.01M12.5 8h.01" stroke-width="2.4"/></svg></button></div></div></div>
|
|
252
264
|
<!-- biome-ignore lint/a11y/useSemanticElements: a focusable splitter (WAI-ARIA window splitter); <hr> is a static rule -->
|
|
253
265
|
<div id="grip" role="separator" tabindex="0" aria-orientation="vertical" aria-label="Sidebar width" aria-valuemin="0" aria-valuemax="420" aria-valuenow="248" title="Drag to resize; double-click to reset"></div>
|
|
254
266
|
</nav>
|
|
@@ -465,6 +477,53 @@ function rects(n, W = stage.clientWidth, H = stage.clientHeight) {
|
|
|
465
477
|
}
|
|
466
478
|
return out;
|
|
467
479
|
}
|
|
480
|
+
// --- §Hub motion: FLIP --------------------------------------------------------------
|
|
481
|
+
// a pane takes its new box at once (one layout, one page resize); a transform plays from the old box
|
|
482
|
+
const SWEEP_MS = 200, KF = 20;
|
|
483
|
+
/** keyframe times where cubic-bezier(.16,1,.3,1) reaches k/KF: even steps in scale, so .pin's counter-scale stays near exact between keyframes */
|
|
484
|
+
const SWEEP_AT = (() => {
|
|
485
|
+
const bz = (a, b, u) => 3 * a * u * (1 - u) ** 2 + 3 * b * u * u * (1 - u) + u ** 3;
|
|
486
|
+
return Array.from({ length: KF + 1 }, (_, k) => {
|
|
487
|
+
if (k === 0 || k === KF) return k / KF;
|
|
488
|
+
let lo = 0, hi = 1;
|
|
489
|
+
for (let j = 0; j < 30; j++) { const m = (lo + hi) / 2; if (bz(1, 1, m) < k / KF) lo = m; else hi = m; }
|
|
490
|
+
return bz(.16, .3, (lo + hi) / 2);
|
|
491
|
+
});
|
|
492
|
+
})();
|
|
493
|
+
let stageWH = '', roomMoved = false, roomFrom = null, roomAt = 0;
|
|
494
|
+
/** each shown pane's box on screen now (mid-sweep: where it is); a sidebar change captured it first */
|
|
495
|
+
function sweepFrom() {
|
|
496
|
+
const pre = roomFrom && performance.now() - roomAt < 100 ? roomFrom : null;
|
|
497
|
+
roomFrom = null;
|
|
498
|
+
return pre ?? new Map([...panes].filter(([, p]) => p.el.classList.contains('in') && !p.el.classList.contains('off')).map(([k, p]) => [k, p.el.getBoundingClientRect()]));
|
|
499
|
+
}
|
|
500
|
+
const EASE = 'cubic-bezier(.16,1,.3,1)';
|
|
501
|
+
/** a pane comes in (150 ms) or leaves (120 ms: exit faster); a later fade replaces it */
|
|
502
|
+
function fade(p, show) {
|
|
503
|
+
p.fade?.cancel();
|
|
504
|
+
const v = 'visible';
|
|
505
|
+
p.fade = p.el.animate(show ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1, visibility: v }, { opacity: 0, visibility: v }], { duration: show ? 150 : 120, easing: EASE });
|
|
506
|
+
}
|
|
507
|
+
function stopSweep(p) { for (const a of p.sweep ?? []) a.cancel(); p.sweep = null; }
|
|
508
|
+
function sweep(p, o, n) {
|
|
509
|
+
stopSweep(p);
|
|
510
|
+
const sx = o.width / n.width, sy = o.height / n.height, dx = o.left - n.left, dy = o.top - n.top;
|
|
511
|
+
if (Math.abs(dx) < .5 && Math.abs(dy) < .5 && Math.abs(sx - 1) < .002 && Math.abs(sy - 1) < .002) return;
|
|
512
|
+
const box = [], pin = [], r = parseFloat(getComputedStyle(p.el).borderTopLeftRadius) || 0;
|
|
513
|
+
SWEEP_AT.forEach((offset, k) => {
|
|
514
|
+
const e = k / KF, x = sx + (1 - sx) * e, y = sy + (1 - sy) * e;
|
|
515
|
+
const f = { offset, transform: `translate(${dx * (1 - e)}px,${dy * (1 - e)}px) scale(${x},${y})` };
|
|
516
|
+
// the window's corners stay round mid-scale
|
|
517
|
+
if (r) f.borderRadius = `${r / x}px / ${r / y}px`;
|
|
518
|
+
box.push(f);
|
|
519
|
+
pin.push({ offset, transform: `scale(${1 / x},${1 / y})` });
|
|
520
|
+
});
|
|
521
|
+
const t = { duration: SWEEP_MS, easing: 'linear' };
|
|
522
|
+
p.sweep = [p.el.animate(box, t), p.el.firstChild.animate(pin, t)];
|
|
523
|
+
p.sweep[0].onfinish = () => { p.sweep = null; };
|
|
524
|
+
}
|
|
525
|
+
/** desk between windows (§Hub windows) */
|
|
526
|
+
const GAP = 10;
|
|
468
527
|
/** a cell in px: each edge rounds once, so neighbours share it and every gap is exactly `gap` */
|
|
469
528
|
function boxOf([x, y, w, h], W, H, gap) {
|
|
470
529
|
const l = Math.round(x * W), t = Math.round(y * H), r = Math.round((x + w) * W), b = Math.round((y + h) * H);
|
|
@@ -489,7 +548,7 @@ function pane(key) {
|
|
|
489
548
|
if (p) return p;
|
|
490
549
|
const el = document.createElement('div');
|
|
491
550
|
el.className = 'pane';
|
|
492
|
-
el.innerHTML = `<div class="ph" draggable="true"><span class="dot idle"></span><span class="nm"></span><span class="sw"></span><span class="tt"></span><button type="button" class="rb ico" data-a="max" title="Maximize (⌘⇧↩)" aria-label="Maximize (⌘⇧↩)">${icon('max')}</button><button type="button" class="rb ico" data-a="tear" title="Own window (⌘⇧T)" aria-label="Own window (⌘⇧T)">${icon('tear')}</button><button type="button" class="rb ico" data-a="x" title="Close pane" aria-label="Close pane">${icon('x')}</button></div>`;
|
|
551
|
+
el.innerHTML = `<div class="pin"><div class="ph" draggable="true"><span class="dot idle"></span><span class="nm"></span><span class="sw"></span><span class="tt"></span><button type="button" class="rb ico" data-a="max" title="Maximize (⌘⇧↩)" aria-label="Maximize (⌘⇧↩)">${icon('max')}</button><button type="button" class="rb ico" data-a="tear" title="Own window (⌘⇧T)" aria-label="Own window (⌘⇧T)">${icon('tear')}</button><button type="button" class="rb ico" data-a="x" title="Close pane" aria-label="Close pane">${icon('x')}</button></div></div>`;
|
|
493
552
|
const frame = document.createElement('iframe');
|
|
494
553
|
// the viewer keeps its own token, Host and Origin checks: the frame's origin is the session's
|
|
495
554
|
const u = new URL(r.url);
|
|
@@ -498,7 +557,7 @@ function pane(key) {
|
|
|
498
557
|
frame.src = u.href;
|
|
499
558
|
frame.title = r.site;
|
|
500
559
|
frame.addEventListener('load', () => frame.contentWindow?.postMessage({ hub: embedOf(key) }, '*'));
|
|
501
|
-
el.append(frame);
|
|
560
|
+
el.firstChild.append(frame);
|
|
502
561
|
el.querySelector('.ph').addEventListener('click', (e) => {
|
|
503
562
|
const a = e.target.closest('button')?.dataset.a;
|
|
504
563
|
const i = cells.indexOf(key);
|
|
@@ -561,7 +620,9 @@ function target(e) {
|
|
|
561
620
|
|
|
562
621
|
// --- render --------------------------------------------------------------------------
|
|
563
622
|
function render() {
|
|
623
|
+
const was = sweepFrom();
|
|
564
624
|
applySide();
|
|
625
|
+
roomFrom = null;
|
|
565
626
|
for (const b of $('seg').children) b.setAttribute('aria-pressed', String(b.dataset.l === layout));
|
|
566
627
|
const single = max || (cells.length <= 1 && layout === 'focus');
|
|
567
628
|
stage.classList.toggle('single', single);
|
|
@@ -576,8 +637,14 @@ function render() {
|
|
|
576
637
|
$('pauseall').title = `${allHeld ? 'Resume' : 'Pause'} every agent (⌘⇧P)`;
|
|
577
638
|
renderRows();
|
|
578
639
|
// panes
|
|
579
|
-
const W = stage.clientWidth, H = stage.clientHeight, gap = single ? 0 :
|
|
640
|
+
const W = stage.clientWidth, H = stage.clientHeight, gap = single ? 0 : GAP;
|
|
580
641
|
const R = rects(cells.length);
|
|
642
|
+
// a window resize or a grip drag tracks the hand: no sweep; a sidebar mode change sweeps
|
|
643
|
+
const resized = `${W}x${H}` !== stageWH; stageWH = `${W}x${H}`;
|
|
644
|
+
// reduced motion: no sweep; a moved pane fades in at its new box
|
|
645
|
+
const morph = (!resized || roomMoved) && !sizing && booted && motionOn(), moves = morph && !reduceQ.matches;
|
|
646
|
+
roomMoved = false;
|
|
647
|
+
const at = moves ? stage.getBoundingClientRect() : null;
|
|
581
648
|
cells.forEach((key, i) => {
|
|
582
649
|
const p = pane(key);
|
|
583
650
|
const r = rows.get(idOf(key));
|
|
@@ -592,15 +659,28 @@ function render() {
|
|
|
592
659
|
p.el.querySelector('.ph').title = `${r.site || 'session'} · ${p.title || r.state?.title || ''}`;
|
|
593
660
|
const nm = p.el.querySelector('.nm'); nm.classList.toggle('cut', nm.scrollWidth > nm.clientWidth);
|
|
594
661
|
p.el.classList.toggle('cur', i === cur && cells.length > 1);
|
|
595
|
-
const hidden = max && i !== cur;
|
|
662
|
+
const off = p.el.classList.contains('off'), hidden = max && i !== cur, back = off && !hidden;
|
|
596
663
|
p.el.classList.toggle('off', hidden);
|
|
664
|
+
if (morph && (back || (hidden && !off))) fade(p, back);
|
|
597
665
|
p.el.querySelector('[data-a=max]').innerHTML = icon(max ? 'min' : 'max');
|
|
598
666
|
const [left, top, width, height] = boxOf(max ? [0, 0, 1, 1] : R[i], W, H, gap);
|
|
599
|
-
|
|
667
|
+
p.el.style.zIndex = i === cur ? 1 : 0;
|
|
668
|
+
const box = `${left},${top},${width},${height}`;
|
|
669
|
+
if (p.box !== box) {
|
|
670
|
+
p.box = box;
|
|
671
|
+
Object.assign(p.el.style, { left: `${left}px`, top: `${top}px`, width: `${width}px`, height: `${height}px` });
|
|
672
|
+
const o = moves && !hidden && !back ? was.get(key) : null;
|
|
673
|
+
if (o) sweep(p, o, { left: at.left + left, top: at.top + top, width, height });
|
|
674
|
+
else stopSweep(p);
|
|
675
|
+
if (morph && !moves && !hidden && !back && was.has(key)) fade(p, true);
|
|
676
|
+
}
|
|
600
677
|
});
|
|
601
678
|
// panes out of the layout: hidden and off screen, the oldest go
|
|
602
679
|
const out = [...panes.entries()].filter(([k]) => !cells.includes(k)).sort((a, b) => b[1].at - a[1].at);
|
|
603
|
-
out.forEach(([k, p], i) => {
|
|
680
|
+
out.forEach(([k, p], i) => {
|
|
681
|
+
if (i >= KEEP || !placeable(idOf(k))) drop(k);
|
|
682
|
+
else if (!p.el.classList.contains('off')) { p.el.classList.add('off'); if (morph) fade(p, false); }
|
|
683
|
+
});
|
|
604
684
|
for (const [k, p] of panes) p.frame.contentWindow?.postMessage({ hub: embedOf(k) }, '*');
|
|
605
685
|
$('empty').classList.toggle('on', cells.length === 0);
|
|
606
686
|
$('empty').querySelector('.h').textContent = rows.size ? 'Pick a session' : 'No sessions';
|
|
@@ -1076,6 +1156,8 @@ function flipRows(change, ms) {
|
|
|
1076
1156
|
}
|
|
1077
1157
|
function applySide() {
|
|
1078
1158
|
const m = sizing ? sizing.m : shownMode(), open = m === 'rail' && (peek || pin);
|
|
1159
|
+
// the room changes width: the panes sweep from where they are now (§Hub motion)
|
|
1160
|
+
if (!sizing && booted && !root.classList.contains(`m-${m}`)) { roomFrom = sweepFrom(); roomAt = performance.now(); roomMoved = true; }
|
|
1079
1161
|
for (const k of ['full', 'rail', 'hidden']) root.classList.toggle(`m-${k}`, m === k);
|
|
1080
1162
|
root.classList.toggle('narrow', narrowQ.matches);
|
|
1081
1163
|
root.classList.toggle('peek', open);
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export { eyesOf } from "./browser/captcha/llm-eyes.js";
|
|
|
19
19
|
export { type CodeCall, CodeFailed, type CodeResult, runCode } from "./browser/code.js";
|
|
20
20
|
export type { ActOptions, BrowserFlow, FlowPage, FlowRunner, Op, RunnerOptions, Site, } from "./browser/flow.js";
|
|
21
21
|
export { defineFlow, flowRunner, SITES } from "./browser/flow.js";
|
|
22
|
+
/** The runner's `pace` (RunnerOptions.pace): `brisk(HUMAN_PACE, k)` runs k times faster. */
|
|
23
|
+
export { brisk, FILM_PACE, HUMAN_PACE, type Pace } from "./browser/human/index.js";
|
|
22
24
|
export { type Hints, type LocatorPlan, locate, planLocator } from "./browser/locate.js";
|
|
23
25
|
export { PoolFull, ProfileGate, ProfilePool } from "./browser/profile-pool.js";
|
|
24
26
|
export { type RecordsOp, type Row, records } from "./browser/records.js";
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,8 @@ export { findCaptcha, solveCaptcha, } from "./browser/captcha/index.js";
|
|
|
18
18
|
export { eyesOf } from "./browser/captcha/llm-eyes.js";
|
|
19
19
|
export { CodeFailed, runCode } from "./browser/code.js";
|
|
20
20
|
export { defineFlow, flowRunner, SITES } from "./browser/flow.js";
|
|
21
|
+
/** The runner's `pace` (RunnerOptions.pace): `brisk(HUMAN_PACE, k)` runs k times faster. */
|
|
22
|
+
export { brisk, FILM_PACE, HUMAN_PACE } from "./browser/human/index.js";
|
|
21
23
|
export { locate, planLocator } from "./browser/locate.js";
|
|
22
24
|
export { PoolFull, ProfileGate, ProfilePool } from "./browser/profile-pool.js";
|
|
23
25
|
export { records } from "./browser/records.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qEAAqE;AACrE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAqB,MAAM,WAAW,CAAC;AACzE;;;GAGG;AACH,OAAO,EAEL,WAAW,EAEX,YAAY,EACZ,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,WAAW,EACX,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,wFAAwF;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAiB,UAAU,EAAmB,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAUxF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAgC,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAA4B,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,WAAW,EACX,UAAU,EAGV,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,aAAa,GAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE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ACpC,OAAO,EAML,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/llms.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Signed-in browser and site-API automation for agents: stored logins, official APIs behind one facade, and a journaled browser whose acts compile into workflows.
|
|
4
4
|
|
|
5
|
-
Version 0.8.
|
|
5
|
+
Version 0.8.18. Every command takes `--help --json`; `autobrowse list <words> --json` finds a route, flow or workflow. Errors are one JSON shape: `{code, message, hint, retryable, outcome?, artifact?}`.
|
|
6
6
|
|
|
7
7
|
## Skill
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@william_jin/autobrowse",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.18",
|
|
4
4
|
"description": "Browser and account automation: recorded flows where no API exists, official API shapes where one does, a person in the loop for money, accounts and consent.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|