sideby 0.43.0 → 0.45.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/build.json +1 -1
- package/dist/src/cli/commands.d.ts +4 -0
- package/dist/src/cli/commands.js +9 -8
- package/dist/src/cli/json-schemas.js +58 -0
- package/dist/src/core/cli-commands.js +0 -10
- package/dist/src/core/egress.d.ts +1 -7
- package/dist/src/core/egress.js +7 -36
- package/dist/src/core/file-memo.d.ts +2 -0
- package/dist/src/core/file-memo.js +20 -0
- package/dist/src/core/handoff.d.ts +9 -0
- package/dist/src/core/handoff.js +10 -0
- package/dist/src/core/history.d.ts +1 -1
- package/dist/src/core/history.js +2 -2
- package/dist/src/core/memo-store.js +32 -8
- package/dist/src/core/network.d.ts +5 -35
- package/dist/src/core/network.js +18 -54
- package/dist/src/core/themes.js +0 -7
- package/dist/src/core/update.d.ts +1 -1
- package/dist/src/core/update.js +4 -12
- package/dist/src/families/claude/quota-fetch.js +2 -2
- package/dist/src/families/claude/tuning.d.ts +0 -1
- package/dist/src/families/claude/tuning.js +1 -1
- package/dist/src/families/quota-watch.d.ts +12 -0
- package/dist/src/families/quota-watch.js +24 -0
- package/dist/src/network/hook.js +1 -1
- package/dist/src/network/page.d.ts +1 -1
- package/dist/src/network/page.js +15 -181
- package/dist/src/panel/changes.d.ts +57 -0
- package/dist/src/panel/changes.js +178 -0
- package/dist/src/panel/handler.d.ts +38 -0
- package/dist/src/panel/handler.js +263 -93
- package/dist/src/panel/i18n.d.ts +23 -0
- package/dist/src/panel/i18n.js +46 -0
- package/dist/src/panel/page-logic.d.ts +22 -29
- package/dist/src/panel/page-logic.js +22 -33
- package/dist/src/panel/page-script.js +114 -45
- package/dist/src/panel/page-styles.js +26 -26
- package/dist/src/panel/page.js +3 -1
- package/dist/src/quota/claude-statusline.js +1 -1
- package/dist/src/runtime.d.ts +13 -1
- package/dist/src/runtime.js +14 -8
- package/dist/src/types.d.ts +2 -2
- package/dist/src/unattended/hook.js +0 -1
- package/dist/testing/index.js +1 -1
- package/package.json +2 -1
- package/schemas/network-diagnose.json +239 -0
- package/schemas/next.json +25 -0
- package/skills/sideby/SKILL.md +2 -2
- package/skills/sideby/references/handoff.md +2 -0
- package/skills/sideby/references/network.md +5 -3
- package/dist/src/network/page-script.d.ts +0 -40
- package/dist/src/network/page-script.js +0 -270
|
@@ -111,7 +111,7 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
111
111
|
.ver-pill.has-update { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
|
|
112
112
|
.ver-pill.has-update::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
|
|
113
113
|
.logo { display: inline-flex; flex: none; width: 40px; height: 40px; border-radius: var(--radius-xl); background: var(--logo-bg); box-shadow: inset 0 0 0 1px var(--logo-line); }
|
|
114
|
-
/* The painted mark (core/brand-mark.ts),
|
|
114
|
+
/* The painted mark (core/brand-mark.ts), 4 px in from the tile's edge; desktop/icon.ts insets the app icon by MARK_INSET (3 of 40 px) instead. */
|
|
115
115
|
.logo img { display: block; width: 100%; height: 100%; padding: 4px; box-sizing: border-box; object-fit: contain; }
|
|
116
116
|
.top-actions { display: flex; align-items: center; gap: 8px; }
|
|
117
117
|
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
|
|
@@ -141,7 +141,7 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
141
141
|
.theme-bad { color: var(--fail); }
|
|
142
142
|
.theme-fade, .theme-fade * { transition: background-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), fill var(--duration-base) var(--ease-out) !important; }
|
|
143
143
|
@media (prefers-reduced-motion: reduce) { .theme-fade, .theme-fade * { transition: none !important; } }
|
|
144
|
-
/* Summary: four quiet numbers in one surface. */
|
|
144
|
+
/* Summary: the account to use now on a line of its own, then four quiet numbers, in one surface. */
|
|
145
145
|
.summary[hidden], #checkup[hidden] { display: none; }
|
|
146
146
|
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
|
|
147
147
|
.stat { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-width: 0; padding: 16px 20px; border-left: 1px solid var(--border); text-align: left; }
|
|
@@ -155,9 +155,15 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
155
155
|
.stat-btn[aria-pressed=true] { background: var(--selected); color: var(--brand); }
|
|
156
156
|
.stat-warn .stat-value { color: var(--warn); }
|
|
157
157
|
.stat-ok .stat-value { color: var(--ok); }
|
|
158
|
+
.stat-pick { grid-column: 1 / -1; align-items: center; min-height: 56px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
|
|
159
|
+
.stat-pick + .stat { border-left: 0; }
|
|
160
|
+
.stat-pick .stat-text { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
|
|
161
|
+
.stat-pick .stat-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
162
|
+
.stat-acct .stat-value { font-family: var(--mono); font-size: 18px; letter-spacing: 0; }
|
|
163
|
+
.stat-pick .stat-act { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
|
|
164
|
+
.sk-pick { height: 24px; width: 45%; }
|
|
158
165
|
.label-tip { display: inline-flex; align-items: center; gap: 8px; }
|
|
159
166
|
|
|
160
|
-
/* Toolbar */
|
|
161
167
|
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
|
|
162
168
|
.search { position: relative; flex: 1 1 160px; min-width: 120px; display: block; }
|
|
163
169
|
.search-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
|
|
@@ -192,7 +198,6 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
192
198
|
.acct-head h2 { display: flex; align-items: baseline; gap: 12px; }
|
|
193
199
|
#acct-count { font-weight: 400; }
|
|
194
200
|
|
|
195
|
-
/* Family groups */
|
|
196
201
|
.group { margin-bottom: 16px; min-width: 0; }
|
|
197
202
|
.group-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
|
|
198
203
|
.group-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; min-height: 48px; flex-wrap: wrap; }
|
|
@@ -325,8 +330,8 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
325
330
|
.row-toggle[aria-expanded=true]:not(:hover) { background: transparent; color: var(--muted); }
|
|
326
331
|
.fold-hit:hover .row-toggle[aria-expanded=true] { background: var(--hover); color: var(--text); }
|
|
327
332
|
/* The details under a row's name (a Same Login's after a dashed line). Their left edge is the name's: the open arrow (--ctl-h-sm,
|
|
328
|
-
less its
|
|
329
|
-
.row-detail { grid-area: detail; display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 12px 0 4px calc(var(--ctl-h-sm) +
|
|
333
|
+
less its 16px of negative margins), 12px, the 26px mark, 12px and the pin's 20px. */
|
|
334
|
+
.row-detail { grid-area: detail; display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 12px 0 4px calc(var(--ctl-h-sm) + 54px); padding-top: 12px; border-top: 1px dashed var(--border); cursor: default; }
|
|
330
335
|
.rd-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
|
|
331
336
|
/* An open account's details sit in one bordered panel under the name: four cells side by side (how it runs, its web
|
|
332
337
|
sign-in, tokens, health), each a label above its value, with the same widths in every row. Without browser
|
|
@@ -430,7 +435,8 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
430
435
|
.ctx-anchor { position: fixed; width: 0; height: 0; pointer-events: none; }
|
|
431
436
|
.row-notes { grid-area: notes; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
|
|
432
437
|
|
|
433
|
-
/* Quota meters: percent and countdown over a bar colored by level (
|
|
438
|
+
/* Quota meters: percent and countdown over a bar colored by level (core/quota-levels.ts: warn at 60%, fail at 85% used;
|
|
439
|
+
long windows warn at 85%, fail at 95%). */
|
|
434
440
|
.quota { display: grid; grid-template-columns: repeat(var(--qr, var(--qn)), minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 4px; min-width: 0; }
|
|
435
441
|
.row > .quota { grid-template-columns: repeat(var(--qn), var(--q-w)); }
|
|
436
442
|
.meter { min-width: 0; }
|
|
@@ -490,7 +496,6 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
490
496
|
/* In the wide list the column titles name the windows; elsewhere each meter carries its label. */
|
|
491
497
|
.rows .m-label, .rows .m-unit { display: none; }
|
|
492
498
|
|
|
493
|
-
/* Chips and badges */
|
|
494
499
|
.badge { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-xl); color: var(--on-badge); font-weight: 600; font-size: 12px; letter-spacing: .02em; }
|
|
495
500
|
.badge-logo { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
|
|
496
501
|
.badge svg { display: block; width: 20px; height: 20px; fill: currentColor; }
|
|
@@ -526,7 +531,6 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
|
|
|
526
531
|
.dot-ok { background: var(--ok-bar); } .dot-fail { background: var(--fail-bar); } .dot-warn { background: var(--warn-bar); }
|
|
527
532
|
.title-logo { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
528
533
|
|
|
529
|
-
/* Cards view */
|
|
530
534
|
/* Cards in a row share one height, so their foot lines and buttons line up; the foot sits at the bottom. */
|
|
531
535
|
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
|
|
532
536
|
.panel, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
|
|
@@ -606,7 +610,6 @@ a.btn:hover { text-decoration: none; }
|
|
|
606
610
|
.btn:focus-visible { border-color: var(--focus); }
|
|
607
611
|
.note a, .banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
|
|
608
612
|
|
|
609
|
-
/* Notes and banners */
|
|
610
613
|
.note { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
|
|
611
614
|
.note b { color: inherit; }
|
|
612
615
|
.note-read .read-why { overflow-wrap: anywhere; }
|
|
@@ -743,7 +746,6 @@ a.btn:hover { text-decoration: none; }
|
|
|
743
746
|
.copy { display: flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
|
|
744
747
|
.copy code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px 8px; overflow-x: auto; white-space: nowrap; color: var(--text); min-width: 0; }
|
|
745
748
|
|
|
746
|
-
/* Health check */
|
|
747
749
|
.diff { margin: 0; max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 0; font-family: var(--mono); font-size: 12px; line-height: 1.55; }
|
|
748
750
|
.diff span { display: block; padding: 0 12px; white-space: pre; }
|
|
749
751
|
.diff .add { background: var(--ok-soft); color: var(--ok); } .diff .del { background: var(--fail-soft); color: var(--fail); } .diff .hunk { color: var(--faint); }
|
|
@@ -763,7 +765,6 @@ a.btn:hover { text-decoration: none; }
|
|
|
763
765
|
.fix-result.is-ok { background: var(--ok-soft); color: var(--ok); } .fix-result.is-warn { background: var(--warn-soft); color: var(--warn); }
|
|
764
766
|
.fix-result ul { margin: 8px 0 0; padding-left: 20px; }
|
|
765
767
|
|
|
766
|
-
/* Forms */
|
|
767
768
|
.form { display: flex; flex-direction: column; gap: 16px; }
|
|
768
769
|
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
|
|
769
770
|
/* A picker's wrapper (.select-wrap) is a span too, but no label: its button and menu keep their own type. */
|
|
@@ -859,8 +860,8 @@ ${UI_CSS}
|
|
|
859
860
|
.app-row:first-child { border-top: 0; }
|
|
860
861
|
.app-row > .ident { flex: 1; }
|
|
861
862
|
.app-actions { flex: none; justify-content: flex-end; }
|
|
862
|
-
/* The open arrow of an account row is --ctl-h-sm wide less its
|
|
863
|
-
.app-gap { flex: none; width: calc(var(--ctl-h-sm) -
|
|
863
|
+
/* The open arrow of an account row is --ctl-h-sm wide less its 16px of negative margins. */
|
|
864
|
+
.app-gap { flex: none; width: calc(var(--ctl-h-sm) - 16px); }
|
|
864
865
|
.app-foot { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 12px; border-top: 1px solid var(--border); }
|
|
865
866
|
.app-foot > .btn { align-self: flex-start; }
|
|
866
867
|
.app-new { display: flex; gap: 8px; align-items: center; max-width: 420px; }
|
|
@@ -886,7 +887,6 @@ ${UI_CSS}
|
|
|
886
887
|
.steps li { min-width: 0; }
|
|
887
888
|
.steps li > span:not(.copy) { display: block; margin-bottom: 4px; }
|
|
888
889
|
|
|
889
|
-
/* Dialog */
|
|
890
890
|
.dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); box-shadow: var(--float-shadow); }
|
|
891
891
|
.dialog[open] { display: flex; }
|
|
892
892
|
.dialog::backdrop { background: var(--scrim); }
|
|
@@ -899,7 +899,6 @@ ${UI_CSS}
|
|
|
899
899
|
.dlg-body { padding: 12px 20px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
|
|
900
900
|
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
|
|
901
901
|
|
|
902
|
-
/* Menu, tooltips, toasts */
|
|
903
902
|
.menu { position: fixed; z-index: 40; min-width: 230px; max-width: min(380px, calc(100vw - 16px)); padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--float-shadow); overflow-y: auto; overscroll-behavior: contain; }
|
|
904
903
|
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
|
|
905
904
|
.menu-item .ic { flex: none; color: var(--muted); }
|
|
@@ -1016,7 +1015,6 @@ ${UI_CSS}
|
|
|
1016
1015
|
@keyframes toast-bump { 50% { transform: scale(1.03); } }
|
|
1017
1016
|
.conn { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 55; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 8px 16px; border-radius: var(--radius-pill); background: var(--warn-soft); color: var(--warn); border: 1px solid var(--border); box-shadow: var(--float-shadow); font-size: 13px; font-weight: 600; }
|
|
1018
1017
|
|
|
1019
|
-
/* Empty, loading and filtered states */
|
|
1020
1018
|
.empty { text-align: center; padding: 36px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-xl); display: flex; flex-direction: column; align-items: center; gap: 12px; }
|
|
1021
1019
|
.empty-sm { padding: 28px 20px; }
|
|
1022
1020
|
/* The empty state is a block of its own, apart from what follows it (Grok Bot windows). */
|
|
@@ -1034,7 +1032,8 @@ ${UI_CSS}
|
|
|
1034
1032
|
.sk-title { height: 12px; width: 22%; }
|
|
1035
1033
|
.sk-bar { height: 8px; flex: 1; max-width: 160px; margin-left: auto; }
|
|
1036
1034
|
.sk-line { height: 12px; margin: 8px 0; }
|
|
1037
|
-
|
|
1035
|
+
/* As tall as a card's label, number and line under it, so the summary keeps its height when the numbers land. */
|
|
1036
|
+
.sk-stat { height: 47px; margin: 8px 0; }
|
|
1038
1037
|
.w50 { width: 50%; } .w70 { width: 70%; }
|
|
1039
1038
|
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
|
|
1040
1039
|
.view-in > * { animation: view-in var(--duration-base) var(--ease-out) both; }
|
|
@@ -1085,8 +1084,8 @@ ${UI_CSS}
|
|
|
1085
1084
|
.toolbar > .btn-primary { width: var(--ctl-h); padding: 0; justify-content: center; }
|
|
1086
1085
|
.toolbar > .btn-primary > span { display: none; }
|
|
1087
1086
|
.summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
1088
|
-
.stat:nth-child(
|
|
1089
|
-
.stat:nth-child(n+
|
|
1087
|
+
.stat:nth-child(4) { border-left: 0; }
|
|
1088
|
+
.stat:nth-child(n+4) { border-top: 1px solid var(--border); }
|
|
1090
1089
|
}
|
|
1091
1090
|
:root[data-width=phone] { --gutter: 14px; }
|
|
1092
1091
|
:where(:root[data-width=phone]) {
|
|
@@ -1119,10 +1118,11 @@ ${UI_CSS}
|
|
|
1119
1118
|
#accounts { --col-gap: 14px; }
|
|
1120
1119
|
/* One window per line, so the reset time is never cut off. */
|
|
1121
1120
|
.row > .quota { grid-template-columns: 1fr; row-gap: 12px; max-width: none; }
|
|
1122
|
-
/* On a phone the summary keeps what needs a look and the next reset. */
|
|
1123
|
-
.stat:nth-child(
|
|
1124
|
-
.stat:nth-child(
|
|
1125
|
-
.stat:nth-child(
|
|
1121
|
+
/* On a phone the summary keeps the account to use now, what needs a look and the next reset. */
|
|
1122
|
+
.stat:nth-child(2), .stat:nth-child(4) { display: none; }
|
|
1123
|
+
.stat:nth-child(3) { border-left: 0; }
|
|
1124
|
+
.stat:nth-child(5) { border-left: 1px solid var(--border); border-top: 0; }
|
|
1125
|
+
.stat-pick { flex-direction: row; align-items: center; padding: 12px 12px; }
|
|
1126
1126
|
.row-end .icon-btn { width: 36px; height: 36px; }
|
|
1127
1127
|
.sess-row { grid-template-columns: auto minmax(0, 1fr); row-gap: 12px; }
|
|
1128
1128
|
.sess-actions { grid-column: 2; }
|
|
@@ -1135,8 +1135,8 @@ ${UI_CSS}
|
|
|
1135
1135
|
.dlg-head { padding: 16px 16px 4px; } .dlg-body { padding: 12px 16px 16px; } .dlg-foot { padding: 12px 16px; flex-wrap: wrap; }
|
|
1136
1136
|
}
|
|
1137
1137
|
/* A change of layout band runs as a short View Transition (page-script.ts followWidth): each block below moves and
|
|
1138
|
-
resizes to its new place while its old and new look cross-fade; the rest of the page cross-fades as one.
|
|
1139
|
-
|
|
1138
|
+
resizes to its new place while its old and new look cross-fade; the rest of the page cross-fades as one. It runs
|
|
1139
|
+
for --duration-slow with --ease-out (quick start, soft landing). */
|
|
1140
1140
|
::view-transition-group(*) { animation-duration: var(--duration-slow); animation-timing-function: var(--ease-out); }
|
|
1141
1141
|
/* Old and new looks keep their own size (pinned top left) instead of stretching to the moving box, so text never
|
|
1142
1142
|
grows or shrinks on the way. */
|
package/dist/src/panel/page.js
CHANGED
|
@@ -35,6 +35,8 @@ function attr(value) {
|
|
|
35
35
|
// layout; the page script then follows the width as it changes.
|
|
36
36
|
const SKELETON_ROW = `<div class="sk-row"><span class="sk sk-badge"></span><span class="sk sk-title"></span><span class="sk sk-bar"></span><span class="sk sk-bar"></span></div>`;
|
|
37
37
|
const SKELETON_STAT = `<div class="stat"><span class="sk sk-stat w70"></span></div>`;
|
|
38
|
+
/** The "Best to use now" card's place (spec §3.45), so the summary opens at its final size. */
|
|
39
|
+
const SKELETON_PICK = `<div class="stat stat-pick"><span class="sk sk-pick"></span></div>`;
|
|
38
40
|
export function renderPage(opts) {
|
|
39
41
|
const nonce = opts.nonce ? ` nonce="${attr(opts.nonce)}"` : '';
|
|
40
42
|
const theme = opts.theme ?? resolveTheme(undefined);
|
|
@@ -108,7 +110,7 @@ export function renderPage(opts) {
|
|
|
108
110
|
<main class="wrap">
|
|
109
111
|
<div id="banners"></div>
|
|
110
112
|
<nav id="pages" class="pages" role="tablist" hidden></nav>
|
|
111
|
-
<section id="summary" class="summary" aria-busy="true">${SKELETON_STAT.repeat(4)}</section>
|
|
113
|
+
<section id="summary" class="summary" aria-busy="true">${SKELETON_PICK}${SKELETON_STAT.repeat(4)}</section>
|
|
112
114
|
<section id="handoff-page" class="block page" aria-labelledby="h-handoff" hidden></section>
|
|
113
115
|
<section id="tuning-page" class="block page" aria-labelledby="h-tuning" hidden></section>
|
|
114
116
|
<section id="sessions-page" class="block page" aria-labelledby="h-sessions" hidden></section>
|
|
@@ -127,7 +127,7 @@ async function analyze(ctx) {
|
|
|
127
127
|
/**
|
|
128
128
|
* Adds `refreshInterval` to a status line sideby wrapped earlier (ADR-0056). The backup's wrapped hash follows the new
|
|
129
129
|
* bytes only while it named the file as it was, so teardown still restores the original; otherwise it stays as it is
|
|
130
|
-
* and teardown refuses
|
|
130
|
+
* and teardown still refuses.
|
|
131
131
|
*/
|
|
132
132
|
async function applyUpgrade(ctx, a, mode) {
|
|
133
133
|
const { upgrade: _, ...plan } = a.plan;
|
package/dist/src/runtime.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { type HandoffDecision, type UsedAccount } from './core/handoff-select.ts
|
|
|
13
13
|
import { type DoctorHistory } from './core/last-doctor.ts';
|
|
14
14
|
import { type HostLaunch, type PreparedLaunch } from './core/launch.ts';
|
|
15
15
|
import { type LimitResetPlan, type LimitResetResult } from './core/limit-reset.ts';
|
|
16
|
-
import { type ListenerProbe, type NetworkDiagnosis, type NetworkOverview } from './core/network.ts';
|
|
16
|
+
import { type ListenerProbe, type NetworkDiagnosis, type NetworkOverview, type NetworkSystemDeps } from './core/network.ts';
|
|
17
17
|
import { type Paths } from './core/paths.ts';
|
|
18
18
|
import { type PickChoice } from './core/pick-commands.ts';
|
|
19
19
|
import { type ProgressView } from './core/progress.ts';
|
|
@@ -279,6 +279,17 @@ export interface Runtime {
|
|
|
279
279
|
family: string;
|
|
280
280
|
choice: PickChoice;
|
|
281
281
|
}>;
|
|
282
|
+
/**
|
|
283
|
+
* The Account a start in `family` makes now, by the rules of a Pick Command of that Family (`pickChoice`), whether
|
|
284
|
+
* or not it has one: the Panel's "Best to use now" card (spec §3.45). `record` as in `pickChoice`.
|
|
285
|
+
*/
|
|
286
|
+
familyPick(family: string, opts?: {
|
|
287
|
+
record?: boolean;
|
|
288
|
+
recorded?: (rec: PickRecord) => void;
|
|
289
|
+
}): Promise<{
|
|
290
|
+
family: string;
|
|
291
|
+
choice: PickChoice;
|
|
292
|
+
}>;
|
|
282
293
|
/**
|
|
283
294
|
* The Pick Command to offer for a Family: the existing one, else a free name following its Aliases (or cc, cx, gk),
|
|
284
295
|
* with the command on PATH it would hide, or `name: null` when no such name is free (the user types one); null when
|
|
@@ -597,6 +608,7 @@ export declare function createRuntime(opts?: {
|
|
|
597
608
|
fetcher?: TraceFetcher;
|
|
598
609
|
print?: string;
|
|
599
610
|
probe?: ListenerProbe;
|
|
611
|
+
system?: NetworkSystemDeps;
|
|
600
612
|
};
|
|
601
613
|
/**
|
|
602
614
|
* Internal, for tests: how long a Limit Reset request may take before it counts as unanswered (spec §3.40), so a
|
package/dist/src/runtime.js
CHANGED
|
@@ -66,8 +66,9 @@ async function readIdentity(f, account) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* An Account's Login Key (ADR-0028),
|
|
70
|
-
*
|
|
69
|
+
* An Account's Login Key (ADR-0028), for grouping a Same Login (`groupsOf`) and for a Limit Reset's login check
|
|
70
|
+
* (`loginKeyNow`, ADR-0072). It stays inside the Runtime and never reaches an output, an error, a log or a cache.
|
|
71
|
+
* Undefined for a Family without a reader, or on any problem.
|
|
71
72
|
*/
|
|
72
73
|
async function readLoginKey(account) {
|
|
73
74
|
const read = LOGIN_KEY_READERS.get(account.family);
|
|
@@ -259,8 +260,8 @@ export async function createRuntime(opts = {}) {
|
|
|
259
260
|
p.args = beforeDashes(p.args, args);
|
|
260
261
|
};
|
|
261
262
|
/**
|
|
262
|
-
* Network Guard, Unattended Mode
|
|
263
|
-
* (`run`).
|
|
263
|
+
* Network Guard, Unattended Mode, Progress Reminders and Shared Project Memory on a prepared Launch, in that order;
|
|
264
|
+
* all but Network Guard only for a session (`run`).
|
|
264
265
|
*/
|
|
265
266
|
const sessionReady = async (p, session, o) => {
|
|
266
267
|
const parts = [];
|
|
@@ -721,7 +722,7 @@ export async function createRuntime(opts = {}) {
|
|
|
721
722
|
};
|
|
722
723
|
};
|
|
723
724
|
// The Live Sessions of each Account, for spreading picks (ADR-0083). A listing that fails counts none: the pick
|
|
724
|
-
// still happens, ranked as
|
|
725
|
+
// still happens, ranked as if no Account had a Live Session.
|
|
725
726
|
const liveSessionCounts = async () => {
|
|
726
727
|
if (opts.picks?.liveSessions)
|
|
727
728
|
return opts.picks.liveSessions();
|
|
@@ -1060,6 +1061,9 @@ export async function createRuntime(opts = {}) {
|
|
|
1060
1061
|
const family = rt.pickCommandFamily(name);
|
|
1061
1062
|
if (family === undefined)
|
|
1062
1063
|
throw new UserError(`no pick command "${name}"; add one with \`sideby alias add ${name} --pick <family>\``);
|
|
1064
|
+
return { name, ...(await rt.familyPick(family, po)) };
|
|
1065
|
+
},
|
|
1066
|
+
async familyPick(family, po = {}) {
|
|
1063
1067
|
const f = familyOf(family);
|
|
1064
1068
|
// API Accounts are never picked, also not as the fallback (ADR-0035).
|
|
1065
1069
|
const subs = (await accounts()).filter((a) => a.family === f.id && a.kind !== 'api');
|
|
@@ -1084,13 +1088,13 @@ export async function createRuntime(opts = {}) {
|
|
|
1084
1088
|
})),
|
|
1085
1089
|
}), (r) => r, po.recorded);
|
|
1086
1090
|
}
|
|
1087
|
-
return {
|
|
1091
|
+
return { family, choice: { ref, reason: 'no-quota-data' } };
|
|
1088
1092
|
}
|
|
1089
1093
|
const plan = await rt.handoff(f.id, {
|
|
1090
1094
|
picks: po.record ? (p) => choosePick(p, main).ref : 'read',
|
|
1091
1095
|
...(po.recorded ? { recorded: po.recorded } : {}),
|
|
1092
1096
|
});
|
|
1093
|
-
return {
|
|
1097
|
+
return { family, choice: choosePick(plan, main) };
|
|
1094
1098
|
},
|
|
1095
1099
|
async pickSuggestion(familyId, given) {
|
|
1096
1100
|
const f = families.get(familyId);
|
|
@@ -1166,7 +1170,8 @@ export async function createRuntime(opts = {}) {
|
|
|
1166
1170
|
...inputs,
|
|
1167
1171
|
// Claude Code's advisor (spec §3.41, ADR-0074): unlocked in Claude subscription sessions while config says so.
|
|
1168
1172
|
...(config.advisor?.unlock === true ? { advisorUnlock: true } : {}),
|
|
1169
|
-
// Claude API Accounts get the variable that turns experimental betas off
|
|
1173
|
+
// Claude API Accounts get the variable that turns experimental betas off at Launch, so a settings file that
|
|
1174
|
+
// Subscription Accounts share never carries it (ADR-0074).
|
|
1170
1175
|
...(config.claude?.apiBetasOff === true ? { apiBetasOff: true } : {}),
|
|
1171
1176
|
// Config `ask.permissions: account` (ADR-0070): the AI Task keeps the Account's own arguments, as `run` does.
|
|
1172
1177
|
...(opts.aiTask && aiTaskPermissions(config) === 'checked' ? { aiTask: true } : {}),
|
|
@@ -1221,6 +1226,7 @@ export async function createRuntime(opts = {}) {
|
|
|
1221
1226
|
env,
|
|
1222
1227
|
envFor: async (a) => accountEnv(familyOf(a.family), a, env),
|
|
1223
1228
|
...(opts.network?.probe ? { probe: opts.network.probe } : {}),
|
|
1229
|
+
...(opts.network?.system ? { system: opts.network.system } : {}),
|
|
1224
1230
|
now,
|
|
1225
1231
|
});
|
|
1226
1232
|
},
|
package/dist/src/types.d.ts
CHANGED
|
@@ -341,8 +341,8 @@ export interface HandoffEligibility {
|
|
|
341
341
|
export interface FamilyHandoff {
|
|
342
342
|
/**
|
|
343
343
|
* What this Family can start: `quota` before the limit (prepare and threshold, from its Quota), `limit` after a
|
|
344
|
-
* turn failed at the limit. Empty: it can only receive. Plugin Families can only receive
|
|
345
|
-
*
|
|
344
|
+
* turn failed at the limit. Empty: it can only receive. Plugin Families can only receive: the hook entry loads
|
|
345
|
+
* built-in readers only.
|
|
346
346
|
*/
|
|
347
347
|
starts: readonly ('quota' | 'limit')[];
|
|
348
348
|
/** Host arguments that load sideby's hooks for one run; omitted when the hooks come from `hookSetup`. */
|
|
@@ -275,7 +275,6 @@ const FILE_TOOLS = {
|
|
|
275
275
|
MultiEdit: 'file_path',
|
|
276
276
|
NotebookEdit: 'notebook_path',
|
|
277
277
|
};
|
|
278
|
-
/** Words that run the next word as the command: the program is the word after them (and their options). */
|
|
279
278
|
/** Programs that run another one, each with its options that take a value of their own (`sudo -u root`, `nice -n 10`). */
|
|
280
279
|
const WRAPPERS = {
|
|
281
280
|
sudo: ['-u', '-g', '-C', '-h', '-p', '-U', '-r', '-t', '-T', '-D', '--user', '--group'],
|
package/dist/testing/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export async function withFakeHome(fn) {
|
|
|
19
19
|
XDG_STATE_HOME: join(home, '.local', 'state'),
|
|
20
20
|
PATH: `${bin}:/usr/bin:/bin`,
|
|
21
21
|
NO_COLOR: '1',
|
|
22
|
-
// No Update Check from tests (spec §3.23): it is sideby's
|
|
22
|
+
// No Update Check from tests (spec §3.23): it is a network request of sideby's own. Delete it to test checks.
|
|
23
23
|
SIDEBY_NO_UPDATE_NOTIFIER: '1',
|
|
24
24
|
};
|
|
25
25
|
const h = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sideby",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "Run work, personal and API-key accounts at the same time, without their configs drifting apart.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Adonis0123 (https://github.com/Adonis0123)",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"postpublish": "node scripts/pin-english-npm-readme.ts --restore"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
+
"network-portal": "0.1.0",
|
|
79
80
|
"typebox": "^1.3.34"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
"required": [
|
|
6
6
|
"schemaVersion",
|
|
7
7
|
"checkedAt",
|
|
8
|
+
"system",
|
|
9
|
+
"localProxyCandidates",
|
|
8
10
|
"targets"
|
|
9
11
|
],
|
|
10
12
|
"properties": {
|
|
@@ -16,6 +18,243 @@
|
|
|
16
18
|
"type": "string",
|
|
17
19
|
"description": "When this offline diagnosis ran (ISO), not the Guard cache time."
|
|
18
20
|
},
|
|
21
|
+
"system": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"required": [
|
|
24
|
+
"warp",
|
|
25
|
+
"proxy",
|
|
26
|
+
"dns",
|
|
27
|
+
"route"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"warp": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"required": [
|
|
33
|
+
"status",
|
|
34
|
+
"state"
|
|
35
|
+
],
|
|
36
|
+
"properties": {
|
|
37
|
+
"status": {
|
|
38
|
+
"anyOf": [
|
|
39
|
+
{
|
|
40
|
+
"type": "string",
|
|
41
|
+
"const": "available"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "string",
|
|
45
|
+
"const": "unavailable"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "string",
|
|
49
|
+
"const": "error"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"state": {
|
|
54
|
+
"anyOf": [
|
|
55
|
+
{
|
|
56
|
+
"type": "string",
|
|
57
|
+
"const": "connected"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "string",
|
|
61
|
+
"const": "disconnected"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"type": "string",
|
|
65
|
+
"const": "unknown"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"networkHealthy": {
|
|
70
|
+
"type": "boolean"
|
|
71
|
+
},
|
|
72
|
+
"error": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"proxy": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"required": [
|
|
80
|
+
"status",
|
|
81
|
+
"pacEnabled",
|
|
82
|
+
"autoDiscoveryEnabled",
|
|
83
|
+
"protocols"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"status": {
|
|
87
|
+
"anyOf": [
|
|
88
|
+
{
|
|
89
|
+
"type": "string",
|
|
90
|
+
"const": "available"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "string",
|
|
94
|
+
"const": "unavailable"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "string",
|
|
98
|
+
"const": "error"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"pacEnabled": {
|
|
103
|
+
"type": "boolean"
|
|
104
|
+
},
|
|
105
|
+
"autoDiscoveryEnabled": {
|
|
106
|
+
"type": "boolean"
|
|
107
|
+
},
|
|
108
|
+
"protocols": {
|
|
109
|
+
"type": "array",
|
|
110
|
+
"items": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"required": [
|
|
113
|
+
"protocol",
|
|
114
|
+
"enabled"
|
|
115
|
+
],
|
|
116
|
+
"properties": {
|
|
117
|
+
"protocol": {
|
|
118
|
+
"anyOf": [
|
|
119
|
+
{
|
|
120
|
+
"type": "string",
|
|
121
|
+
"const": "http"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"type": "string",
|
|
125
|
+
"const": "https"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "string",
|
|
129
|
+
"const": "socks"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"enabled": {
|
|
134
|
+
"type": "boolean"
|
|
135
|
+
},
|
|
136
|
+
"host": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"description": "Loopback only; every other host is redacted."
|
|
139
|
+
},
|
|
140
|
+
"port": {
|
|
141
|
+
"type": "integer"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"exceptionCount": {
|
|
147
|
+
"type": "integer"
|
|
148
|
+
},
|
|
149
|
+
"error": {
|
|
150
|
+
"type": "string"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"dns": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"required": [
|
|
157
|
+
"status",
|
|
158
|
+
"nameservers"
|
|
159
|
+
],
|
|
160
|
+
"properties": {
|
|
161
|
+
"status": {
|
|
162
|
+
"anyOf": [
|
|
163
|
+
{
|
|
164
|
+
"type": "string",
|
|
165
|
+
"const": "available"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"type": "string",
|
|
169
|
+
"const": "unavailable"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "string",
|
|
173
|
+
"const": "error"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"nameservers": {
|
|
178
|
+
"type": "array",
|
|
179
|
+
"items": {
|
|
180
|
+
"type": "string"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"error": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"route": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"required": [
|
|
191
|
+
"status"
|
|
192
|
+
],
|
|
193
|
+
"properties": {
|
|
194
|
+
"status": {
|
|
195
|
+
"anyOf": [
|
|
196
|
+
{
|
|
197
|
+
"type": "string",
|
|
198
|
+
"const": "available"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"type": "string",
|
|
202
|
+
"const": "unavailable"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"type": "string",
|
|
206
|
+
"const": "error"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"interface": {
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
"gateway": {
|
|
214
|
+
"type": "string"
|
|
215
|
+
},
|
|
216
|
+
"error": {
|
|
217
|
+
"type": "string"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"localProxyCandidates": {
|
|
224
|
+
"type": "array",
|
|
225
|
+
"items": {
|
|
226
|
+
"type": "object",
|
|
227
|
+
"required": [
|
|
228
|
+
"label",
|
|
229
|
+
"protocol",
|
|
230
|
+
"host",
|
|
231
|
+
"port",
|
|
232
|
+
"reachable"
|
|
233
|
+
],
|
|
234
|
+
"properties": {
|
|
235
|
+
"label": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"description": "The common configuration for this port, not an identified process."
|
|
238
|
+
},
|
|
239
|
+
"protocol": {
|
|
240
|
+
"type": "string"
|
|
241
|
+
},
|
|
242
|
+
"host": {
|
|
243
|
+
"type": "string"
|
|
244
|
+
},
|
|
245
|
+
"port": {
|
|
246
|
+
"type": "integer"
|
|
247
|
+
},
|
|
248
|
+
"reachable": {
|
|
249
|
+
"type": "boolean",
|
|
250
|
+
"description": "TCP connect only; not proof of upstream connectivity."
|
|
251
|
+
},
|
|
252
|
+
"error": {
|
|
253
|
+
"type": "string"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
19
258
|
"targets": {
|
|
20
259
|
"type": "array",
|
|
21
260
|
"items": {
|
package/schemas/next.json
CHANGED
|
@@ -156,6 +156,31 @@
|
|
|
156
156
|
},
|
|
157
157
|
"description": "The window closest to its own Takeover Limit; absent when none is open."
|
|
158
158
|
},
|
|
159
|
+
"windows": {
|
|
160
|
+
"type": "array",
|
|
161
|
+
"items": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"required": [
|
|
164
|
+
"label",
|
|
165
|
+
"usedPercent",
|
|
166
|
+
"resetsAt"
|
|
167
|
+
],
|
|
168
|
+
"properties": {
|
|
169
|
+
"label": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "Such as `5h` or `7d`."
|
|
172
|
+
},
|
|
173
|
+
"usedPercent": {
|
|
174
|
+
"type": "number",
|
|
175
|
+
"description": "Rounded; what is left is 100 minus it."
|
|
176
|
+
},
|
|
177
|
+
"resetsAt": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"description": "Every counted window (no model name) that has not reset yet, so a caller can show what the pick has left; absent when none is open."
|
|
183
|
+
},
|
|
159
184
|
"resetsAt": {
|
|
160
185
|
"type": "string",
|
|
161
186
|
"description": "For full: when it is usable again. With a window used up, when those windows reset; otherwise when every window is under its Takeover Limit again."
|