@william_jin/autobrowse 0.8.18 → 0.8.19
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 +80 -50
- package/assets/live-view/viewer.html +9 -3
- package/assets/overlay/bin/darwin-arm64/overlay-host +0 -0
- package/assets/overlay/bin/darwin-x64/overlay-host +0 -0
- package/assets/overlay/bin/win32-arm64/overlay-host.exe +0 -0
- package/assets/overlay/bin/win32-x64/overlay-host.exe +0 -0
- package/dist/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -156,7 +156,7 @@ kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px
|
|
|
156
156
|
.pane.in{opacity:1}
|
|
157
157
|
.pane.off{visibility:hidden;pointer-events:none}
|
|
158
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:
|
|
159
|
+
.grid .pane{border-radius:var(--win-r);box-shadow:var(--frame)}
|
|
160
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}
|
|
161
161
|
.pane.cur::after{opacity:1}
|
|
162
162
|
.single .pane.cur::after{display:none}
|
|
@@ -367,7 +367,7 @@ window.hub = {
|
|
|
367
367
|
hubOn = !!m.visible;
|
|
368
368
|
fill(); render();
|
|
369
369
|
break;
|
|
370
|
-
case 'row': put(m.row); fill();
|
|
370
|
+
case 'row': put(m.row); fill(); soon(); break;
|
|
371
371
|
case 'gone': end(m.id); break;
|
|
372
372
|
case 'show': show(m.id); break;
|
|
373
373
|
case 'visible': hubOn = !!m.on; fill(); render(); break;
|
|
@@ -382,6 +382,8 @@ window.hub = {
|
|
|
382
382
|
};
|
|
383
383
|
function put(r) {
|
|
384
384
|
const was = rows.get(r.id);
|
|
385
|
+
// icons come only when they change (WA-1494): a row without them keeps the ones it had
|
|
386
|
+
if (was && r.state && !('icons' in r.state)) r.state = { ...r.state, icon: was.state?.icon, icons: was.state?.icons };
|
|
385
387
|
if (!was) order.push(r.id);
|
|
386
388
|
rows.set(r.id, r);
|
|
387
389
|
if (r.url || r.ended) auto.delete(r.id);
|
|
@@ -505,11 +507,11 @@ function fade(p, show) {
|
|
|
505
507
|
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
508
|
}
|
|
507
509
|
function stopSweep(p) { for (const a of p.sweep ?? []) a.cancel(); p.sweep = null; }
|
|
508
|
-
function sweep(p, o, n) {
|
|
510
|
+
function sweep(p, o, n, r) {
|
|
509
511
|
stopSweep(p);
|
|
510
512
|
const sx = o.width / n.width, sy = o.height / n.height, dx = o.left - n.left, dy = o.top - n.top;
|
|
511
513
|
if (Math.abs(dx) < .5 && Math.abs(dy) < .5 && Math.abs(sx - 1) < .002 && Math.abs(sy - 1) < .002) return;
|
|
512
|
-
const box = [], pin = []
|
|
514
|
+
const box = [], pin = [];
|
|
513
515
|
SWEEP_AT.forEach((offset, k) => {
|
|
514
516
|
const e = k / KF, x = sx + (1 - sx) * e, y = sy + (1 - sy) * e;
|
|
515
517
|
const f = { offset, transform: `translate(${dx * (1 - e)}px,${dy * (1 - e)}px) scale(${x},${y})` };
|
|
@@ -522,8 +524,9 @@ function sweep(p, o, n) {
|
|
|
522
524
|
p.sweep = [p.el.animate(box, t), p.el.firstChild.animate(pin, t)];
|
|
523
525
|
p.sweep[0].onfinish = () => { p.sweep = null; };
|
|
524
526
|
}
|
|
525
|
-
/** desk between windows (§Hub windows) */
|
|
526
|
-
const GAP = 10;
|
|
527
|
+
/** desk between windows and their corners (§Hub windows); the CSS reads `--win-r` */
|
|
528
|
+
const GAP = 10, RADIUS = 10;
|
|
529
|
+
document.documentElement.style.setProperty('--win-r', `${RADIUS}px`);
|
|
527
530
|
/** a cell in px: each edge rounds once, so neighbours share it and every gap is exactly `gap` */
|
|
528
531
|
function boxOf([x, y, w, h], W, H, gap) {
|
|
529
532
|
const l = Math.round(x * W), t = Math.round(y * H), r = Math.round((x + w) * W), b = Math.round((y + h) * H);
|
|
@@ -619,23 +622,34 @@ function target(e) {
|
|
|
619
622
|
}
|
|
620
623
|
|
|
621
624
|
// --- render --------------------------------------------------------------------------
|
|
625
|
+
// writes only on change: a same-value write still dirties layout, and the next read forces one (WA-1494)
|
|
626
|
+
function txt(el, s) { if (el.textContent !== s) el.textContent = s; }
|
|
627
|
+
function cls(el, s) { if (el.className !== s) el.className = s; }
|
|
628
|
+
function attr(el, k, v) { if (el.getAttribute(k) !== v) el.setAttribute(k, v); }
|
|
629
|
+
let renderRaf = 0;
|
|
630
|
+
/** state lines come in bursts (url, title, icon per navigation, per run): one render a frame */
|
|
631
|
+
function soon() { if (!renderRaf) renderRaf = requestAnimationFrame(() => { renderRaf = 0; render(); }); }
|
|
632
|
+
/** each list item's place now, read before any write */
|
|
633
|
+
const rowTops = () => new Map(live().map((el) => [el.dataset.k, { top: el.getBoundingClientRect().top, off: el.offsetTop }]));
|
|
622
634
|
function render() {
|
|
623
|
-
|
|
635
|
+
if (renderRaf) { cancelAnimationFrame(renderRaf); renderRaf = 0; }
|
|
636
|
+
// reads first: after a frame, layout is clean and they cost nothing
|
|
637
|
+
const was = sweepFrom(), rowsWas = rowTops();
|
|
624
638
|
applySide();
|
|
625
639
|
roomFrom = null;
|
|
626
|
-
for (const b of $('seg').children) b
|
|
640
|
+
for (const b of $('seg').children) attr(b, 'aria-pressed', String(b.dataset.l === layout));
|
|
627
641
|
const single = max || (cells.length <= 1 && layout === 'focus');
|
|
628
642
|
stage.classList.toggle('single', single);
|
|
629
643
|
document.documentElement.classList.toggle('maxed', max);
|
|
630
|
-
$('unmax').tabIndex = max ? 0 : -1;
|
|
644
|
+
if ($('unmax').tabIndex !== (max ? 0 : -1)) $('unmax').tabIndex = max ? 0 : -1;
|
|
631
645
|
stage.classList.toggle('grid', !single);
|
|
632
646
|
// the app toggles: it holds every agent unless all are held
|
|
633
647
|
const agents = [...rows.values()].filter((r) => canPause(r) && !r.ended && !r.moved);
|
|
634
648
|
const allHeld = agents.length > 0 && agents.every((r) => r.state?.held);
|
|
635
|
-
$('pauseall').disabled = !agents.length;
|
|
649
|
+
if ($('pauseall').disabled !== !agents.length) $('pauseall').disabled = !agents.length;
|
|
636
650
|
swapText($('pauseall'), allHeld ? 'Resume all' : 'Pause all');
|
|
637
|
-
$('pauseall')
|
|
638
|
-
renderRows();
|
|
651
|
+
attr($('pauseall'), 'title', `${allHeld ? 'Resume' : 'Pause'} every agent (⌘⇧P)`);
|
|
652
|
+
renderRows(rowsWas);
|
|
639
653
|
// panes
|
|
640
654
|
const W = stage.clientWidth, H = stage.clientHeight, gap = single ? 0 : GAP;
|
|
641
655
|
const R = rects(cells.length);
|
|
@@ -644,46 +658,57 @@ function render() {
|
|
|
644
658
|
// reduced motion: no sweep; a moved pane fades in at its new box
|
|
645
659
|
const morph = (!resized || roomMoved) && !sizing && booted && motionOn(), moves = morph && !reduceQ.matches;
|
|
646
660
|
roomMoved = false;
|
|
647
|
-
const at = moves ? stage.getBoundingClientRect() : null;
|
|
661
|
+
const at = moves ? stage.getBoundingClientRect() : null, cuts = [];
|
|
648
662
|
cells.forEach((key, i) => {
|
|
649
663
|
const p = pane(key);
|
|
650
664
|
const r = rows.get(idOf(key));
|
|
651
665
|
p.at = Date.now();
|
|
652
|
-
p.el.querySelector('.nm')
|
|
666
|
+
const nm = p.el.querySelector('.nm');
|
|
667
|
+
txt(nm, r.site || 'session');
|
|
653
668
|
const [pd, pw] = stateOf(r);
|
|
654
|
-
p.el.querySelector('.ph .dot')
|
|
669
|
+
cls(p.el.querySelector('.ph .dot'), `dot ${pd}`);
|
|
655
670
|
swapText(p.el.querySelector('.sw'), pw);
|
|
656
671
|
p.w = max ? W : Math.round(R[i][2] * W);
|
|
657
|
-
p.el.querySelector('.tt')
|
|
672
|
+
txt(p.el.querySelector('.tt'), p.title || r.state?.title || '');
|
|
658
673
|
// the bar is one line: the whole name and title on hover
|
|
659
|
-
p.el.querySelector('.ph')
|
|
660
|
-
const nm = p.el.querySelector('.nm'); nm.classList.toggle('cut', nm.scrollWidth > nm.clientWidth);
|
|
674
|
+
attr(p.el.querySelector('.ph'), 'title', `${r.site || 'session'} · ${p.title || r.state?.title || ''}`);
|
|
661
675
|
p.el.classList.toggle('cur', i === cur && cells.length > 1);
|
|
662
676
|
const off = p.el.classList.contains('off'), hidden = max && i !== cur, back = off && !hidden;
|
|
663
677
|
p.el.classList.toggle('off', hidden);
|
|
664
678
|
if (morph && (back || (hidden && !off))) fade(p, back);
|
|
665
|
-
p.el.querySelector('[data-a=max]')
|
|
679
|
+
const mb = p.el.querySelector('[data-a=max]'), mi = max ? 'min' : 'max';
|
|
680
|
+
if (mb.dataset.i !== mi) { mb.dataset.i = mi; mb.innerHTML = icon(mi); }
|
|
666
681
|
const [left, top, width, height] = boxOf(max ? [0, 0, 1, 1] : R[i], W, H, gap);
|
|
667
|
-
|
|
682
|
+
const z = i === cur ? '1' : '0';
|
|
683
|
+
if (p.el.style.zIndex !== z) p.el.style.zIndex = z;
|
|
668
684
|
const box = `${left},${top},${width},${height}`;
|
|
685
|
+
// the name fades when cut: measured after every write, and only when name, word or width changed
|
|
686
|
+
const ck = `${nm.textContent}|${pw}|${width}`;
|
|
687
|
+
if (p.cutKey !== ck) cuts.push([p, nm, ck]);
|
|
669
688
|
if (p.box !== box) {
|
|
670
689
|
p.box = box;
|
|
671
690
|
Object.assign(p.el.style, { left: `${left}px`, top: `${top}px`, width: `${width}px`, height: `${height}px` });
|
|
672
691
|
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 });
|
|
692
|
+
if (o) sweep(p, o, { left: at.left + left, top: at.top + top, width, height }, single ? 0 : RADIUS);
|
|
674
693
|
else stopSweep(p);
|
|
675
694
|
if (morph && !moves && !hidden && !back && was.has(key)) fade(p, true);
|
|
676
695
|
}
|
|
677
696
|
});
|
|
697
|
+
const cut = cuts.map(([, nm]) => nm.scrollWidth > nm.clientWidth);
|
|
698
|
+
cuts.forEach(([p, nm, ck], i) => { p.cutKey = ck; nm.classList.toggle('cut', cut[i]); });
|
|
678
699
|
// panes out of the layout: hidden and off screen, the oldest go
|
|
679
700
|
const out = [...panes.entries()].filter(([k]) => !cells.includes(k)).sort((a, b) => b[1].at - a[1].at);
|
|
680
701
|
out.forEach(([k, p], i) => {
|
|
681
702
|
if (i >= KEEP || !placeable(idOf(k))) drop(k);
|
|
682
703
|
else if (!p.el.classList.contains('off')) { p.el.classList.add('off'); if (morph) fade(p, false); }
|
|
683
704
|
});
|
|
684
|
-
|
|
705
|
+
// a viewer hears only a change (each message makes it re-send `visible` to its session)
|
|
706
|
+
for (const [k, p] of panes) {
|
|
707
|
+
const e = embedOf(k), j = JSON.stringify(e);
|
|
708
|
+
if (p.embed !== j) { p.embed = j; p.frame.contentWindow?.postMessage({ hub: e }, '*'); }
|
|
709
|
+
}
|
|
685
710
|
$('empty').classList.toggle('on', cells.length === 0);
|
|
686
|
-
$('empty').querySelector('.h')
|
|
711
|
+
txt($('empty').querySelector('.h'), rows.size ? 'Pick a session' : 'No sessions');
|
|
687
712
|
const es = $('empty').querySelector('.s'), want = rows.size ? 'pick' : 'none';
|
|
688
713
|
if (es.dataset.k !== want) {
|
|
689
714
|
es.dataset.k = want;
|
|
@@ -822,8 +847,8 @@ function fillRow(el, r, onIds) {
|
|
|
822
847
|
el.classList.toggle('needs', !!r.needs && !r.ended);
|
|
823
848
|
el.classList.toggle('ended', !!r.ended);
|
|
824
849
|
el.classList.toggle('on', onIds.has(r.id) && hubOn);
|
|
825
|
-
el.querySelector('.ico .dot')
|
|
826
|
-
el.querySelector('.lt')
|
|
850
|
+
cls(el.querySelector('.ico .dot'), `dot ${dot}`);
|
|
851
|
+
txt(el.querySelector('.lt'), letterOf(r.site));
|
|
827
852
|
const img = el.querySelector('img'), src = typeof r.state?.icon === 'string' ? r.state.icon : '';
|
|
828
853
|
if (!src) { el.querySelector('.ico').classList.remove('has'); img.removeAttribute('src'); }
|
|
829
854
|
else if (img.getAttribute('src') !== src) img.src = src;
|
|
@@ -845,7 +870,7 @@ function fillRow(el, r, onIds) {
|
|
|
845
870
|
meta.innerHTML = `${r.torn ? icon('tear') : ''}${w ? '<span class="w"></span>' : ''}${w && since ? '<span>·</span>' : ''}${since ? `<span class="t"></span>` : ''}${kw ? '<span class="k"></span>' : ''}`;
|
|
846
871
|
}
|
|
847
872
|
if (w) swapText(meta.querySelector('.w'), w);
|
|
848
|
-
if (since) { const t = meta.querySelector('.t'); t.dataset.since
|
|
873
|
+
if (since) { const t = meta.querySelector('.t'); if (t.dataset.since !== String(since)) t.dataset.since = since; txt(t, ago(since)); }
|
|
849
874
|
if (kw) swapText(meta.querySelector('.k'), kw);
|
|
850
875
|
// a scheduled job: clock, name, schedule, next tick
|
|
851
876
|
const job = r.job && typeof r.job.name === 'string' && r.job.name.trim() ? r.job : null;
|
|
@@ -858,10 +883,10 @@ function fillRow(el, r, onIds) {
|
|
|
858
883
|
const fk = f ? `${f.name}\n${label}` : '';
|
|
859
884
|
if (f && fl.dataset.k === fk) swapText(fl.querySelector('.s'), at);
|
|
860
885
|
else lineTo(fl, f ? `${icon('flow')}<span class="n">${esc(f.name)}</span>${label ? ` · <span class="l">${esc(label)}</span>` : ''} <span class="s">${esc(at)}</span>` : '');
|
|
861
|
-
fl.dataset.k = fk;
|
|
862
|
-
el.querySelector('.why')
|
|
886
|
+
if (fl.dataset.k !== fk) fl.dataset.k = fk;
|
|
887
|
+
txt(el.querySelector('.why'), r.needs && !r.ended ? r.needs : '');
|
|
863
888
|
const tl = !r.ended && !r.moved && Array.isArray(r.state?.tabs) && r.state.tabs.length > 1 ? r.state.tabs : [];
|
|
864
|
-
el.querySelector('.title')
|
|
889
|
+
txt(el.querySelector('.title'), tl.length ? '' : r.state?.title || '');
|
|
865
890
|
fillTabs(el.querySelector('.tabs'), tl, Array.isArray(r.state?.icons) ? r.state.icons : [], r.site, r.id);
|
|
866
891
|
const acts = el.querySelector('.acts');
|
|
867
892
|
let html = '';
|
|
@@ -913,15 +938,15 @@ function fillTabs(box, tabs, icons, site, rid) {
|
|
|
913
938
|
if (live[i] !== b) box.insertBefore(b, live[i] ?? null);
|
|
914
939
|
const on = !!t.on, title = (typeof t.title === 'string' && t.title.trim()) || hostOf(t.url) || 'New tab';
|
|
915
940
|
b.classList.toggle('on', on);
|
|
916
|
-
if (on) b
|
|
941
|
+
if (on) attr(b, 'aria-current', 'true'); else b.removeAttribute('aria-current');
|
|
917
942
|
const pop = t.opener != null, k = `${pop ? 1 : 0}\n${title}`;
|
|
918
943
|
if (b.dataset.k !== k) {
|
|
919
944
|
b.dataset.k = k; b.querySelector('.tl').textContent = title;
|
|
920
945
|
const ti = b.querySelector('.ti'), g = ti.querySelector('.ic');
|
|
921
946
|
if (pop && !g) ti.insertAdjacentHTML('beforeend', icon('pop')); else if (!pop) g?.remove();
|
|
922
947
|
}
|
|
923
|
-
b
|
|
924
|
-
b.querySelector('.lt')
|
|
948
|
+
attr(b, 'title', pop ? `Popup: ${t.url || title}` : t.url || title);
|
|
949
|
+
txt(b.querySelector('.lt'), letterOf(hostOf(t.url) || site));
|
|
925
950
|
const img = b.querySelector('img'), src = Number.isInteger(t.ic) && typeof icons[t.ic] === 'string' ? icons[t.ic] : '';
|
|
926
951
|
if (!src) { b.querySelector('.ti').classList.remove('has'); img.removeAttribute('src'); }
|
|
927
952
|
else if (img.getAttribute('src') !== src) img.src = src;
|
|
@@ -933,13 +958,13 @@ function fillTabs(box, tabs, icons, site, rid) {
|
|
|
933
958
|
mb.type = 'button'; mb.className = 'tab more'; mb.dataset.more = '1';
|
|
934
959
|
mb.innerHTML = `<span class="ti">${icon('caret')}</span><span class="tl"></span>`;
|
|
935
960
|
}
|
|
936
|
-
box.append(mb);
|
|
937
|
-
mb.querySelector('.tl')
|
|
938
|
-
mb
|
|
961
|
+
if (box.lastElementChild !== mb) box.append(mb);
|
|
962
|
+
txt(mb.querySelector('.tl'), more);
|
|
963
|
+
attr(mb, 'aria-expanded', String(!cut));
|
|
939
964
|
}
|
|
940
965
|
/** the list's live items: rows and labels not on their way out */
|
|
941
966
|
const live = () => [...list.children].filter((el) => !el.classList.contains('gone'));
|
|
942
|
-
function renderRows() {
|
|
967
|
+
function renderRows(was = rowTops()) {
|
|
943
968
|
const gl = groupList(), groups = new Map(gl.map((g) => [g.k, g.ids]));
|
|
944
969
|
// the list as it should be: a label per non-empty group, then its rows unless folded
|
|
945
970
|
const want = [];
|
|
@@ -949,14 +974,13 @@ function renderRows() {
|
|
|
949
974
|
if (!folded(sec, ids.length)) for (const id of ids) want.push({ k: id, id });
|
|
950
975
|
}
|
|
951
976
|
const keep = new Set(want.map((w) => w.k));
|
|
952
|
-
// FLIP: what stays slides from where it was
|
|
953
|
-
const before = new Map(live().map((el) => [el.dataset.k, el.getBoundingClientRect().top]));
|
|
977
|
+
// FLIP: what stays slides from where it was (`was`, read before any write)
|
|
954
978
|
for (const el of live()) {
|
|
955
979
|
if (keep.has(el.dataset.k)) continue;
|
|
956
980
|
const r = rows.get(el.dataset.k);
|
|
957
981
|
// a folded row, or one that already faded (ended): out at once; a label fades out of the flow
|
|
958
982
|
if (el.classList.contains('row') && (el.classList.contains('out') || (r && folded(secOf(r), groups.get(secOf(r))?.length ?? 0)))) { el.remove(); continue; }
|
|
959
|
-
const top = el.
|
|
983
|
+
const top = was.get(el.dataset.k)?.off ?? 0;
|
|
960
984
|
el.classList.add('gone'); el.style.top = `${top}px`;
|
|
961
985
|
list.append(el);
|
|
962
986
|
setTimeout(() => el.remove(), 150);
|
|
@@ -968,18 +992,23 @@ function renderRows() {
|
|
|
968
992
|
if (list.children[i] !== el) list.insertBefore(el, list.children[i] ?? null);
|
|
969
993
|
if (w.id) fillRow(el, rows.get(w.id), onIds);
|
|
970
994
|
else {
|
|
971
|
-
el.dataset.n = w.n;
|
|
995
|
+
if (el.dataset.n !== String(w.n)) el.dataset.n = w.n;
|
|
972
996
|
swapText(el.querySelector('.n'), String(w.n));
|
|
973
997
|
const nn = el.querySelector('.nn');
|
|
974
|
-
if (nn) nn
|
|
975
|
-
el.querySelector('button')
|
|
998
|
+
if (nn) txt(nn, w.nn ? `${w.nn} need${w.nn > 1 ? '' : 's'} you` : '');
|
|
999
|
+
const fb = el.querySelector('button');
|
|
1000
|
+
if (fb) attr(fb, 'aria-expanded', String(!folded(w.sec, w.n)));
|
|
976
1001
|
}
|
|
977
1002
|
});
|
|
1003
|
+
// all reads, then all writes: one layout, not one per moved row
|
|
1004
|
+
const moved = [];
|
|
978
1005
|
for (const el of live()) {
|
|
979
|
-
const t0 =
|
|
1006
|
+
const t0 = was.get(el.dataset.k);
|
|
980
1007
|
if (t0 === undefined) continue;
|
|
981
|
-
const d = t0 - el.getBoundingClientRect().top;
|
|
982
|
-
if (
|
|
1008
|
+
const d = t0.top - el.getBoundingClientRect().top;
|
|
1009
|
+
if (d) moved.push([el, d]);
|
|
1010
|
+
}
|
|
1011
|
+
for (const [el, d] of moved) {
|
|
983
1012
|
el.style.transition = 'none'; el.style.transform = `translateY(${d}px)`;
|
|
984
1013
|
requestAnimationFrame(() => { el.style.transition = ''; el.style.transform = ''; });
|
|
985
1014
|
}
|
|
@@ -1028,8 +1057,8 @@ function swapHtml(el, html, text = false) {
|
|
|
1028
1057
|
}
|
|
1029
1058
|
const swapText = (el, text) => swapHtml(el, text, true);
|
|
1030
1059
|
setInterval(() => {
|
|
1031
|
-
for (const t of list.querySelectorAll('.t[data-since]')) t
|
|
1032
|
-
for (const x of list.querySelectorAll('.x[data-next]')) x
|
|
1060
|
+
for (const t of list.querySelectorAll('.t[data-since]')) txt(t, ago(Number(t.dataset.since)));
|
|
1061
|
+
for (const x of list.querySelectorAll('.x[data-next]')) txt(x, `next ${until(Number(x.dataset.next))}`);
|
|
1033
1062
|
}, 1000);
|
|
1034
1063
|
|
|
1035
1064
|
// --- actions -------------------------------------------------------------------------
|
|
@@ -1162,11 +1191,12 @@ function applySide() {
|
|
|
1162
1191
|
root.classList.toggle('narrow', narrowQ.matches);
|
|
1163
1192
|
root.classList.toggle('peek', open);
|
|
1164
1193
|
root.classList.toggle('compact', compact);
|
|
1165
|
-
|
|
1194
|
+
const sw = `${sizing ? sizing.w : sidew}px`;
|
|
1195
|
+
if (root.style.getPropertyValue('--sidew') !== sw) root.style.setProperty('--sidew', sw);
|
|
1166
1196
|
railRows(m === 'rail' && !open);
|
|
1167
|
-
$('sidebtn')
|
|
1197
|
+
attr($('sidebtn'), 'aria-pressed', String(m === 'full' || open));
|
|
1168
1198
|
const now = m === 'full' ? Math.round(sizing ? sizing.w : sidew) : m === 'rail' ? RAIL : 0;
|
|
1169
|
-
grip
|
|
1199
|
+
attr(grip, 'aria-valuenow', String(now));
|
|
1170
1200
|
}
|
|
1171
1201
|
/** rows turn to icons once the panel has clipped to the rail; back to full rows at once, under the opening clip */
|
|
1172
1202
|
function railRows(on) {
|
|
@@ -229,7 +229,7 @@ const tx = (m) => { if (ws && ws.readyState === 1) ws.send(JSON.stringify(m)); }
|
|
|
229
229
|
function connect() {
|
|
230
230
|
ws = new WebSocket(`ws://${location.host}/?k=${encodeURIComponent(k)}`);
|
|
231
231
|
ws.binaryType = 'arraybuffer';
|
|
232
|
-
ws.onopen = () => { if (own) tx({ t: 'own' }); if (placed) { size(true); seen(); } };
|
|
232
|
+
ws.onopen = () => { if (own) tx({ t: 'own' }); if (placed) { size(true); seen(true); } };
|
|
233
233
|
ws.onmessage = (e) => (typeof e.data === 'string' ? msg(JSON.parse(e.data)) : frame(e.data));
|
|
234
234
|
ws.onclose = () => { gone = true; closeSheet(); agentState({ off: true }); $('field').classList.remove('loading'); cover('The session ended', 'ended'); ended(); };
|
|
235
235
|
}
|
|
@@ -297,8 +297,14 @@ function size(now) {
|
|
|
297
297
|
if (now) send(); else sizeT = setTimeout(send, 150);
|
|
298
298
|
}
|
|
299
299
|
new ResizeObserver(() => size(false)).observe(stage);
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
/** the last `visible` sent: each one restarts the session's stream check; a new socket sends again */
|
|
301
|
+
let seenOn = null;
|
|
302
|
+
const seen = (force = false) => {
|
|
303
|
+
const on = !document.hidden && onScreen;
|
|
304
|
+
if (!force && on === seenOn) return;
|
|
305
|
+
seenOn = on; tx({ t: 'visible', on });
|
|
306
|
+
};
|
|
307
|
+
document.addEventListener('visibilitychange', () => seen());
|
|
302
308
|
// the hub page: tile or not, on screen or not; the app's clipboard answer
|
|
303
309
|
window.addEventListener('message', (e) => {
|
|
304
310
|
if (!embed || e.source !== parent || !e.data || typeof e.data !== 'object' || !e.data.hub) return;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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.19. 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.19",
|
|
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",
|