sideby 0.21.0 → 0.22.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.
Files changed (73) hide show
  1. package/README.md +1 -0
  2. package/dist/build.json +1 -1
  3. package/dist/src/cli/commands.js +115 -10
  4. package/dist/src/cli/format.js +3 -2
  5. package/dist/src/cli/json-schemas.js +81 -46
  6. package/dist/src/cli/main.js +6 -3
  7. package/dist/src/core/accounts.d.ts +6 -1
  8. package/dist/src/core/accounts.js +16 -3
  9. package/dist/src/core/ask.d.ts +2 -1
  10. package/dist/src/core/ask.js +6 -3
  11. package/dist/src/core/claude-settings-file.d.ts +57 -0
  12. package/dist/src/core/claude-settings-file.js +104 -2
  13. package/dist/src/core/config.d.ts +29 -15
  14. package/dist/src/core/config.js +40 -2
  15. package/dist/src/core/create.js +4 -1
  16. package/dist/src/core/desktop-app.js +5 -1
  17. package/dist/src/core/handoff-overview.d.ts +4 -1
  18. package/dist/src/core/handoff-overview.js +3 -2
  19. package/dist/src/core/handoff-rules.d.ts +34 -0
  20. package/dist/src/core/handoff-rules.js +115 -0
  21. package/dist/src/core/handoff-select.js +45 -28
  22. package/dist/src/core/handoff-status.d.ts +37 -7
  23. package/dist/src/core/handoff-status.js +95 -19
  24. package/dist/src/core/handoff.d.ts +4 -1
  25. package/dist/src/core/handoff.js +8 -5
  26. package/dist/src/core/inbound.d.ts +11 -3
  27. package/dist/src/core/inbound.js +26 -74
  28. package/dist/src/core/launch.js +6 -4
  29. package/dist/src/core/quota-levels.d.ts +6 -0
  30. package/dist/src/core/quota-levels.js +8 -0
  31. package/dist/src/core/remote-control.d.ts +10 -12
  32. package/dist/src/core/remote-control.js +29 -86
  33. package/dist/src/core/tuning-apply.js +12 -20
  34. package/dist/src/families/agy/index.d.ts +8 -0
  35. package/dist/src/families/agy/index.js +53 -0
  36. package/dist/src/families/agy/quota.d.ts +9 -0
  37. package/dist/src/families/agy/quota.js +110 -0
  38. package/dist/src/families/index.js +7 -0
  39. package/dist/src/families/logos.d.ts +10 -0
  40. package/dist/src/families/logos.js +12 -1
  41. package/dist/src/menubar/script.js +26 -3
  42. package/dist/src/menubar/snapshot.d.ts +23 -6
  43. package/dist/src/menubar/snapshot.js +126 -39
  44. package/dist/src/menubar/strings.d.ts +12 -2
  45. package/dist/src/menubar/strings.js +12 -2
  46. package/dist/src/panel/handler.d.ts +2 -1
  47. package/dist/src/panel/handler.js +81 -45
  48. package/dist/src/panel/i18n.d.ts +57 -7
  49. package/dist/src/panel/i18n.js +156 -56
  50. package/dist/src/panel/page-logic.d.ts +47 -19
  51. package/dist/src/panel/page-logic.js +33 -7
  52. package/dist/src/panel/page-script.js +263 -94
  53. package/dist/src/panel/page-styles.js +105 -8
  54. package/dist/src/panel/page.js +3 -3
  55. package/dist/src/plugins/check.js +27 -13
  56. package/dist/src/plugins/loader.d.ts +11 -0
  57. package/dist/src/plugins/loader.js +47 -1
  58. package/dist/src/runtime.d.ts +5 -2
  59. package/dist/src/runtime.js +12 -5
  60. package/dist/src/types.d.ts +35 -5
  61. package/package.json +2 -2
  62. package/schemas/config.json +16 -1
  63. package/schemas/families.json +8 -5
  64. package/schemas/handoff-disable.json +22 -0
  65. package/schemas/handoff-enable.json +22 -0
  66. package/schemas/handoff-rules.json +302 -0
  67. package/schemas/handoff-status.json +26 -0
  68. package/schemas/list.json +5 -0
  69. package/schemas/menubar-snapshot.json +309 -2
  70. package/skills/sideby/SKILL.md +3 -2
  71. package/skills/sideby/references/accounts.md +1 -0
  72. package/skills/sideby/references/handoff.md +7 -3
  73. package/skills/sideby/references/quota.md +2 -0
@@ -546,15 +546,44 @@ a.btn:hover { text-decoration: none; }
546
546
  .rc-row { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; display: grid; gap: 2px; }
547
547
  .rc-row code { word-break: break-all; }
548
548
  .banner-actions { display: flex; gap: 8px; flex: none; }
549
- .hp-how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
549
+ .hp-rules { list-style: none; margin: 0; padding: 0; counter-reset: hp-rule; display: flex; flex-direction: column; }
550
+ .hp-rules > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
551
+ .hp-rules > li:last-child { border-bottom: 0; }
552
+ .hp-rule-text::before { counter-increment: hp-rule; content: counter(hp-rule) '. '; color: var(--muted); font-variant-numeric: tabular-nums; }
553
+ .hp-rule-ctl { display: flex; align-items: center; gap: 8px; justify-self: end; }
554
+ .hp-rule-ctl:empty { display: none; }
555
+ .hp-rule-below { grid-column: 1 / -1; margin-top: 8px; }
556
+ .hp-rule-sub { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
557
+ .hp-rules .seg { height: var(--ctl-h-sm); }
558
+ .hp-rules .seg-btn[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); }
559
+ .hp-on-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
560
+ .hp-on-row > p { margin: 0; }
561
+ .hp-ai-order { margin: 0; }
562
+ .hp-ai-order li .title-logo { min-width: 150px; }
563
+ .ah-cross { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
564
+ .ah-fam > summary { cursor: pointer; }
550
565
  .hp-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
551
566
  .hp-steps li { display: flex; gap: 8px; }
552
567
  .hp-steps li::before { content: '•'; color: var(--muted); }
553
568
  .hp-steps li > div { flex: 1; min-width: 0; }
554
569
  .hp-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
555
- .hp-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
570
+ .hp-rows li { display: grid; grid-template-columns: minmax(0, 16rem) 7rem minmax(0, 1fr); align-items: center; column-gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
556
571
  .hp-rows li:last-child { border-bottom: 0; }
572
+ .hp-rows .num { font-variant-numeric: tabular-nums; }
573
+ .hp-rows li > .num { text-align: end; }
574
+ .hp-recent li { grid-template-columns: minmax(0, 1fr) max-content minmax(0, 12rem); }
575
+ .hp-recent li > .num { white-space: nowrap; }
557
576
  #handoff-page > * + * { margin-top: 12px; }
577
+ #handoff-page > h3 { margin-top: 28px; }
578
+ #handoff-page > h3 + * { margin-top: 8px; }
579
+ :where(:root[data-width=narrow], :root[data-width=phone]) {
580
+ .hp-rows li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
581
+ .hp-rows li > :last-child { grid-column: 1 / -1; }
582
+ .hp-rules > li { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
583
+ .hp-rule-ctl { justify-self: start; }
584
+ .hp-rule-sub { justify-content: flex-start; }
585
+ .hp-rows li > .num { text-align: start; }
586
+ }
558
587
  /* Sessions page (spec §3.32): one row per Live Session; a Session that needs the user gets the warning tint. */
559
588
  #sessions-page > * + * { margin-top: 12px; }
560
589
  .sess-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 11px 10px 11px 16px; border-top: 1px solid var(--border); transition: background-color .15s; }
@@ -989,7 +1018,7 @@ select:is(:hover, :focus) { --chevron: var(--text); }
989
1018
  .hist-group { display: flex; flex-direction: column; gap: 4px; }
990
1019
  .hist-group + .hist-group { margin-top: 10px; }
991
1020
  .hist-group.is-folded + .hist-group.is-folded { margin-top: 0; }
992
- .hist-ghead { display: flex; align-items: center; min-width: 0; }
1021
+ .hist-ghead { display: flex; align-items: center; min-width: 0; padding-left: 14px; }
993
1022
  .hist-gtoggle { max-width: 100%; padding: 3px 8px 3px 2px; font-size: var(--small); font-weight: var(--strong-weight); }
994
1023
  .hist-gtitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
995
1024
  .hist-gtoggle .spin { width: 12px; height: 12px; }
@@ -1014,7 +1043,7 @@ select:is(:hover, :focus) { --chevron: var(--text); }
1014
1043
  /* Inner scroll boxes get a thin bar in the theme's colours; the side list shows it only while the pointer is on it. */
1015
1044
  :is(.hist-side, .hv-msgs, .diff, .dlg-body, .menu) { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
1016
1045
  .hist-side:not(:hover, :focus-within) { scrollbar-color: transparent transparent; }
1017
- .hist-side-h { margin: 0 0 2px 10px; font-size: 11.5px; font-weight: var(--strong-weight); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
1046
+ .hist-side-h { margin: 0 0 2px 10px; font-size: var(--small); font-weight: 400; color: var(--muted); }
1018
1047
  .hist-projs { display: flex; flex-direction: column; gap: 1px; }
1019
1048
  .hist-proj { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 10px; border: 0; border-radius: var(--ctl-radius); background: transparent; color: var(--muted); font: inherit; font-size: var(--small); text-align: left; cursor: pointer; transition: background-color .12s, color .12s; }
1020
1049
  .hist-proj:hover { background: var(--hover); color: var(--text); }
@@ -1056,7 +1085,7 @@ select:is(:hover, :focus) { --chevron: var(--text); }
1056
1085
  .hist-mi-wrap { display: flex; flex-wrap: wrap; align-items: center; row-gap: 2px; margin-left: -14px; }
1057
1086
  .hist-mi { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
1058
1087
  .hist-mi::before { content: '·'; flex: none; width: 14px; text-align: center; opacity: .7; }
1059
- .hist-meta b { color: var(--text); font-weight: var(--strong-weight); }
1088
+ .hist-meta b { color: var(--text); font-weight: 500; }
1060
1089
  .hist-pname, .hist-branch { min-width: 0; max-width: 18em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1061
1090
  .hist-age { white-space: nowrap; }
1062
1091
  .hist-snip { color: var(--muted); font-size: var(--small); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
@@ -1114,7 +1143,8 @@ select:is(:hover, :focus) { --chevron: var(--text); }
1114
1143
  :where(:root[data-width=narrow], :root[data-width=phone]) .hist-grid { grid-template-columns: minmax(0, 1fr); }
1115
1144
  :where(:root[data-width=narrow], :root[data-width=phone]) .hist-side { position: static; max-height: none; flex-direction: row; align-items: center; overflow-x: auto; }
1116
1145
  :where(:root[data-width=narrow], :root[data-width=phone]) .hist-side-h { display: none; }
1117
- :where(:root[data-width=narrow], :root[data-width=phone]) .hist-projs { flex-direction: row; gap: 4px; }
1146
+ :where(:root[data-width=narrow], :root[data-width=phone]) .hist-projs { flex-direction: row; align-items: center; gap: 4px; }
1147
+ :where(:root[data-width=narrow], :root[data-width=phone]) .hist-catbody > .hist-catps { flex-direction: row; overflow: visible; }
1118
1148
  :where(:root[data-width=narrow], :root[data-width=phone]) .hist-proj { width: auto; flex: none; max-width: 16em; }
1119
1149
  :where(:root[data-width=narrow], :root[data-width=phone]) :is(.hist-catgrp, .hist-catps) { flex-direction: row; display: flex; gap: 4px; margin-top: 0; }
1120
1150
  :where(:root[data-width=narrow], :root[data-width=phone]) .hist-catps .hist-proj { padding-left: 10px; }
@@ -1153,9 +1183,76 @@ select:is(:hover, :focus) { --chevron: var(--text); }
1153
1183
  .dialog.dialog-top { margin-top: min(12vh, 96px); max-height: calc(100vh - min(12vh, 96px) - 24px); }
1154
1184
  .dialog:not([open]) { opacity: 0; transform: translateY(4px) scale(.985); pointer-events: none; }
1155
1185
  .dialog:not([open])::backdrop { opacity: 0; }
1186
+ /* Page tabs (2026-10-21): underline tabs across the content width, as GitHub and Vercel draw them. The selected page
1187
+ is in full text color with its mark in the accent and a 2px accent line under it; the others are muted. Each label
1188
+ reserves its bold width, so picking a tab never moves the ones after it. */
1189
+ .pages { margin: 2px 0 22px; }
1190
+ .tabs { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
1191
+ .tab { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 7px; flex: none; height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--font-size); font-weight: 500; white-space: nowrap; cursor: pointer; transition: color .12s; }
1192
+ .tab::before { content: ""; position: absolute; inset: 6px 2px 7px; z-index: -1; border-radius: var(--ctl-radius); background: var(--hover); opacity: 0; transition: opacity .12s; }
1193
+ .tab:hover { color: var(--text); }
1194
+ .tab:hover::before { opacity: 1; }
1195
+ .tab .ic { width: 16px; height: 16px; color: var(--faint); transition: color .12s; }
1196
+ .tab:hover .ic { color: var(--muted); }
1197
+ .tab-label { display: inline-grid; }
1198
+ .tab-label::after { content: attr(data-label); height: 0; overflow: hidden; visibility: hidden; font-weight: var(--strong-weight); }
1199
+ .tab[aria-selected=true] { color: var(--text); font-weight: var(--strong-weight); }
1200
+ .tab[aria-selected=true] .ic { color: var(--accent); }
1201
+ .tab[aria-selected=true]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); animation: tab-line .22s cubic-bezier(.16, 1, .3, 1); }
1202
+ @keyframes tab-line { from { opacity: 0; transform: scaleX(.3); } }
1203
+ .tab:focus-visible { outline: var(--focus-outline); outline-offset: -5px; border-radius: var(--ctl-radius); }
1204
+ .tab-count { min-width: 20px; padding: 0 6px; border-radius: var(--chip-radius); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); font-size: 11.5px; font-weight: 500; line-height: 18px; text-align: center; }
1205
+ .tab[aria-selected=true] .tab-count { background: var(--accent-soft); box-shadow: none; color: var(--accent); }
1206
+ .tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-bar); box-shadow: 0 0 0 3px var(--ok-soft); }
1207
+ .tab .seg-badge { margin-left: 0; }
1208
+ .tab .spin { width: 16px; height: 16px; }
1209
+
1210
+ /* Pages other than Accounts open the same way: a title with its actions on the right, one line saying what the page
1211
+ is for, then the content in surfaces. A section inside a page has a small heading with more room above than below. */
1212
+ .page > .section-head { margin-bottom: 4px; min-height: var(--ctl-h); }
1213
+ .page > .section-head h2 { font-size: 18px; letter-spacing: -0.015em; }
1214
+ .page > .section-head + p { margin-bottom: 18px; max-width: 860px; color: var(--muted); font-size: 13px; line-height: 1.6; }
1215
+ .page-sec { margin: 28px 0 10px; font-size: 13.5px; font-weight: var(--heading-weight); color: var(--text); }
1216
+ .page-sec-head { display: flex; flex-direction: column; gap: 2px; margin: 28px 0 10px; }
1217
+ .page-sec-head .page-sec { margin: 0; }
1218
+
1219
+ /* Auto Handoff's status card: its mark, on or off in words, what that means, and the one action that changes it. On,
1220
+ it takes a green edge and tint, so the state reads before the words. */
1221
+ .hp-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: background-color .2s, border-color .2s; }
1222
+ .hp-status-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
1223
+ .hp-status-ic .ic { width: 20px; height: 20px; }
1224
+ .hp-status-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
1225
+ .hp-status-text b { font-size: var(--large); font-weight: var(--heading-weight); }
1226
+ .hp-status-text p { font-size: 13px; line-height: 1.55; }
1227
+ .hp-status.is-on { border-color: color-mix(in srgb, var(--ok-bar) 40%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface)); }
1228
+ .hp-status.is-on .hp-status-ic { background: var(--ok-soft); box-shadow: none; color: var(--ok); }
1229
+ .hp-status + :not(.page-sec-head, .page-sec) { margin-top: 12px; }
1230
+ .page .hp-rules, .page .hp-rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
1231
+ .page .hp-rules > li { padding: 12px 16px; min-height: 52px; }
1232
+ .page .hp-rows li { padding: 11px 16px; }
1233
+ .hp-rule-text::before { color: var(--faint); }
1234
+ :where(:root[data-width=narrow], :root[data-width=phone]) .hp-status { grid-template-columns: auto minmax(0, 1fr); }
1235
+ :where(:root[data-width=narrow], :root[data-width=phone]) .hp-status > .btn { grid-column: 1 / -1; justify-self: start; }
1236
+
1237
+ /* Context tuning on its page: one surface per settings file. Now, the suggestion and what it saves are one strip like
1238
+ the Accounts summary; the per-account details sit in the card's foot. */
1239
+ .tg-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
1240
+ .tg-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface-2); border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); overflow: hidden; }
1241
+ .tg-stat { min-width: 0; padding: 12px 16px; border-left: 1px solid var(--border); }
1242
+ .tg-stat:first-child { border-left: 0; }
1243
+ .tg-stats .tune-num { font-size: 24px; font-weight: var(--heading-weight); letter-spacing: -0.02em; line-height: 1.35; white-space: nowrap; }
1244
+ #tuning-page .tune-acct { gap: 0; margin: 0 0 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
1245
+ #tuning-page .tune-group { gap: 12px; padding: 18px 20px; border: 0; border-radius: 0; }
1246
+ #tuning-page .tune-acct > .tune-details { margin: 0; padding: 11px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
1247
+ #tuning-page .tune-acct > .tune-details:first-child { border-top: 0; }
1248
+ #tuning-page .tune-acct > .tune-details[open] > summary { margin-bottom: 6px; }
1249
+ :where(:root[data-width=phone]) .tg-stats { grid-auto-flow: row; }
1250
+ :where(:root[data-width=phone]) .tg-stat { border-left: 0; border-top: 1px solid var(--border); }
1251
+ :where(:root[data-width=phone]) .tg-stat:first-child { border-top: 0; }
1252
+
1156
1253
  @media (prefers-reduced-motion: reduce) {
1157
- .sk, .spin, .is-spinning svg, .toast, .toast.bump, .toast.toast-out, .view-in > *, .set-pane.view-in, .row.flash, .sess-row.flash, .sess-msg, .seg-badge, .card.flash, .pulse, .sess-busy .sess-dot, .menu, .menu.float-out, .dialog[open], .dialog[open]::backdrop, .enter, .fade-in, .hist-list.swap-in, .tip-body, .tip-float, .row-run.is-done .ic { animation: none; }
1158
- .bar > span, .chev, .row, .sess-row, .sess-copy, .hist-row, .hist-cont, .hist-proj, .hist-catbody, .hist-opt, .hist-list, .icon-btn, .seg-btn, .menu-item, .set-tab, .link-btn, .tag-btn, .email-btn, .btn, .chip-btn, .set-link .ic, .dialog, .dialog[open], .dialog::backdrop { transition: none; }
1254
+ .sk, .spin, .is-spinning svg, .toast, .toast.bump, .toast.toast-out, .view-in > *, .set-pane.view-in, .row.flash, .sess-row.flash, .sess-msg, .seg-badge, .card.flash, .pulse, .sess-busy .sess-dot, .menu, .menu.float-out, .dialog[open], .dialog[open]::backdrop, .enter, .fade-in, .hist-list.swap-in, .tip-body, .tip-float, .row-run.is-done .ic, .tab[aria-selected=true]::after { animation: none; }
1255
+ .bar > span, .chev, .row, .sess-row, .sess-copy, .hist-row, .hist-cont, .hist-proj, .hist-catbody, .hist-opt, .hist-list, .icon-btn, .seg-btn, .menu-item, .set-tab, .link-btn, .tag-btn, .email-btn, .btn, .chip-btn, .set-link .ic, .dialog, .dialog[open], .dialog::backdrop, .tab, .tab::before, .tab .ic, .hp-status { transition: none; }
1159
1256
  :is(.btn, .icon-btn, .seg-btn, .set-tab, .chip-btn):active:not(:disabled), .set-link:hover .ic, .dialog:not([open]) { transform: none; }
1160
1257
  }
1161
1258
  `;
@@ -95,9 +95,9 @@ export function renderPage(opts) {
95
95
  <div id="banners"></div>
96
96
  <nav id="pages" class="pages" role="tablist" hidden></nav>
97
97
  <section id="summary" class="summary" aria-busy="true">${SKELETON_STAT.repeat(4)}</section>
98
- <section id="handoff-page" class="block" aria-labelledby="h-handoff" hidden></section>
99
- <section id="tuning-page" class="block" aria-labelledby="h-tuning" hidden></section>
100
- <section id="sessions-page" class="block" aria-labelledby="h-sessions" hidden></section>
98
+ <section id="handoff-page" class="block page" aria-labelledby="h-handoff" hidden></section>
99
+ <section id="tuning-page" class="block page" aria-labelledby="h-tuning" hidden></section>
100
+ <section id="sessions-page" class="block page" aria-labelledby="h-sessions" hidden></section>
101
101
  <section id="accounts-page" class="block" aria-labelledby="h-accounts">
102
102
  <div class="section-head acct-head"><h2 id="h-accounts"><span data-i18n="acct.title">Accounts</span><span id="acct-count" class="muted small"></span></h2><span id="updated" class="muted small" role="status">Loading…</span></div>
103
103
  <div id="toolbar" class="toolbar" hidden></div>
@@ -19,7 +19,7 @@ import { fakeHost, withFakeHome } from '../../testing/index.js';
19
19
  import { SHARE_MODES } from '../core/share-mode-names.js';
20
20
  import { BUILTIN_PLUGINS } from '../families/index.js';
21
21
  import { createRuntime } from '../runtime.js';
22
- import { checkTrustedTree, logoProblem, websiteProblem, } from './loader.js';
22
+ import { checkTrustedTree, logoProblem, mainOnlyProblem, websiteProblem, } from './loader.js';
23
23
  import { FAMILY_ID_RE, TODO_MARK } from './scaffold.js';
24
24
  /** Name of the Account the check creates next to the Main Account in its throwaway HOME. */
25
25
  const CHECK_ACCOUNT = 'check';
@@ -300,7 +300,14 @@ export function defProblems(raw) {
300
300
  field('bin', 'bin must be the executable name, without a folder', 'Set `bin` to the command the Host installs on PATH.');
301
301
  if (!nonEmpty(def.installUrl) || !/^https?:\/\/\S+$/.test(def.installUrl))
302
302
  field('installUrl', 'installUrl must be an http(s) link', "Set `installUrl` to the Host's official install page.");
303
- if (!nonEmpty(def.selectVar))
303
+ const mainOnly = def.mainOnly !== undefined;
304
+ const shape = mainOnlyProblem(def);
305
+ if (shape)
306
+ field('mainOnly', shape, 'Leave out `mainOnly` when the Host has a variable that moves its config directory; set `mainOnly: true` and leave out `selectVar` and `layout.account` only when it has none (ADR-0047).');
307
+ else if (mainOnly) {
308
+ // A Main-only Family has neither field to check.
309
+ }
310
+ else if (!nonEmpty(def.selectVar))
304
311
  out.push({
305
312
  code: 'select-var.missing',
306
313
  message: `${at}: selectVar is missing, so every Account would share one config directory`,
@@ -313,9 +320,10 @@ export function defProblems(raw) {
313
320
  const account = layout.account;
314
321
  if (!nonEmpty(main) || !isRelativeInside(main))
315
322
  field('layout', 'layout.main must be a path relative to HOME, without ".."', 'Set `layout.main` such as ".mytool".');
316
- if (!nonEmpty(account) ||
317
- !isRelativeInside(account) ||
318
- !account.split('/')[0].includes('<name>'))
323
+ if (!mainOnly &&
324
+ (!nonEmpty(account) ||
325
+ !isRelativeInside(account) ||
326
+ !account.split('/')[0].includes('<name>')))
319
327
  field('layout', 'layout.account must be relative to HOME, without "..", with <name> in its first segment', 'Set `layout.account` such as ".mytool-<name>".');
320
328
  for (const key of ['hijackVars', 'apiVars']) {
321
329
  const v = def[key];
@@ -400,15 +408,17 @@ async function round(h, builtins, id, problems) {
400
408
  return false;
401
409
  }
402
410
  };
403
- const layoutOk = defProblems(def).every((p) => p.code !== 'field.layout' && p.code !== 'field.bin');
411
+ const layoutOk = defProblems(def).every((p) => p.code !== 'field.layout' && p.code !== 'field.bin' && p.code !== 'field.mainOnly');
404
412
  if (!layoutOk)
405
413
  return;
406
414
  await fakeHost(h, def.bin);
407
415
  await h.mkdir(def.layout.main);
408
416
  for (const item of def.sharedItems)
409
417
  await seed(h, def, item.path, item);
410
- const accountDir = def.layout.account.replace('<name>', CHECK_ACCOUNT);
411
- await h.mkdir(accountDir);
418
+ // A Main-only Family (ADR-0047) has only its Main Account to find.
419
+ const accountDir = def.layout.account?.replace('<name>', CHECK_ACCOUNT);
420
+ if (accountDir)
421
+ await h.mkdir(accountDir);
412
422
  let refs = [];
413
423
  const found = await step('round.discover', 'finding Accounts', async () => {
414
424
  const all = await rt.accounts();
@@ -420,18 +430,22 @@ async function round(h, builtins, id, problems) {
420
430
  }
421
431
  });
422
432
  const ref = `${id}:${CHECK_ACCOUNT}`;
423
- if (found && (!refs.includes(`${id}:main`) || !refs.includes(ref)))
433
+ if (found && (!refs.includes(`${id}:main`) || (accountDir && !refs.includes(ref))))
424
434
  problems.push({
425
435
  code: 'round.discover',
426
- message: `family ${id}: sideby found ${refs.join(', ') || 'no Accounts'} in ~/${def.layout.main} and ~/${accountDir}, not both`,
436
+ message: accountDir
437
+ ? `family ${id}: sideby found ${refs.join(', ') || 'no Accounts'} in ~/${def.layout.main} and ~/${accountDir}, not both`
438
+ : `family ${id}: sideby found no Main Account in ~/${def.layout.main}`,
427
439
  fix: 'Check `layout` and `markers`: an Account directory counts when it holds proxy.env, a marker, or nothing at all.',
428
440
  });
429
- if (refs.includes(ref))
441
+ if (accountDir && def.selectVar && refs.includes(ref)) {
442
+ const selectVar = def.selectVar;
430
443
  await step('round.launch', 'preparing a launch', async () => {
431
444
  const launch = await rt.prepareLaunch(ref, [], 'run');
432
- if (launch.env[def.selectVar] !== h.path(accountDir))
433
- throw new Error(`${def.selectVar} does not point at the Account directory`);
445
+ if (launch.env[selectVar] !== h.path(accountDir))
446
+ throw new Error(`${selectVar} does not point at the Account directory`);
434
447
  });
448
+ }
435
449
  await step('round.doctor', 'doctor', async () => {
436
450
  await rt.doctor({ target: id, persist: false });
437
451
  });
@@ -63,3 +63,14 @@ export declare function loadPlugins(opts: {
63
63
  userPluginsDir: string;
64
64
  home: string;
65
65
  }): Promise<LoadResult>;
66
+ /**
67
+ * What is wrong with how a FamilyDef says where its Accounts live (ADR-0047): either `selectVar` and `layout.account`
68
+ * both set, or `mainOnly: true` with both left out. undefined when it is right.
69
+ */
70
+ export declare function mainOnlyProblem(def: {
71
+ mainOnly?: unknown;
72
+ selectVar?: unknown;
73
+ layout?: {
74
+ account?: unknown;
75
+ } | unknown;
76
+ }): string | undefined;
@@ -58,7 +58,7 @@ export const MAX_LOGO_PATH = 20_000;
58
58
  export function logoProblem(logo) {
59
59
  if (typeof logo !== 'object' || logo === null || Array.isArray(logo))
60
60
  return 'logo must be an object';
61
- const { path, color, title, fillRule } = logo;
61
+ const { path, color, title, fillRule, gradients } = logo;
62
62
  if (typeof path !== 'string' || !path.trim())
63
63
  return 'logo.path must be a non-empty string';
64
64
  if (path.length > MAX_LOGO_PATH)
@@ -71,8 +71,26 @@ export function logoProblem(logo) {
71
71
  return 'logo.title must be a string of at most 80 characters';
72
72
  if (fillRule !== undefined && fillRule !== 'nonzero' && fillRule !== 'evenodd')
73
73
  return 'logo.fillRule must be "nonzero" or "evenodd"';
74
+ if (gradients !== undefined) {
75
+ if (!Array.isArray(gradients) || gradients.length > MAX_LOGO_GRADIENTS)
76
+ return `logo.gradients must be a list of at most ${MAX_LOGO_GRADIENTS} washes`;
77
+ for (const g of gradients) {
78
+ const { from, to, color: c } = (g ?? {});
79
+ if (!isLogoPoint(from) || !isLogoPoint(to))
80
+ return 'each of logo.gradients needs `from` and `to` points such as [12, 2], numbers from -24 to 48';
81
+ if (typeof c !== 'string' || !LOGO_COLOR_RE.test(c))
82
+ return 'each of logo.gradients needs a hex `color` such as #3186FF';
83
+ }
84
+ }
74
85
  return null;
75
86
  }
87
+ const MAX_LOGO_GRADIENTS = 4;
88
+ /** A point of a logo wash: two plain numbers near the 24x24 view box, so it reaches markup as nothing else. */
89
+ function isLogoPoint(p) {
90
+ return (Array.isArray(p) &&
91
+ p.length === 2 &&
92
+ p.every((n) => typeof n === 'number' && Number.isFinite(n) && n >= -24 && n <= 48));
93
+ }
76
94
  // The url reaches `open` and, on WSL, `cmd.exe /c start`, so it holds no character a shell gives meaning to.
77
95
  const WEBSITE_URL_RE = /^https:\/\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+(?:\/[A-Za-z0-9._~/-]*)?$/;
78
96
  const WEBSITE_ORIGIN_RE = /^https:\/\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$/;
@@ -108,6 +126,15 @@ function cleanLogo(logo) {
108
126
  ...(logo.color ? { color: logo.color } : {}),
109
127
  ...(logo.title ? { title: logo.title } : {}),
110
128
  ...(logo.fillRule ? { fillRule: logo.fillRule } : {}),
129
+ ...(logo.gradients?.length
130
+ ? {
131
+ gradients: logo.gradients.map((g) => ({
132
+ from: [g.from[0], g.from[1]],
133
+ to: [g.to[0], g.to[1]],
134
+ color: g.color,
135
+ })),
136
+ }
137
+ : {}),
111
138
  };
112
139
  }
113
140
  function settingsFor(config, name, manifest) {
@@ -150,6 +177,9 @@ async function register(plugin, bus, result, source, settings) {
150
177
  throw new Error(`family ${def.id} is already provided by ${owner}`);
151
178
  if (stagedFamilies.some((f) => f.id === def.id))
152
179
  throw new Error(`family ${def.id} is registered twice`);
180
+ const shape = mainOnlyProblem(def);
181
+ if (shape)
182
+ throw new Error(`family ${def.id}: ${shape}`);
153
183
  // A bad logo or website costs only that field: the Family still loads.
154
184
  let clean = def;
155
185
  if (def.logo !== undefined) {
@@ -313,3 +343,19 @@ export async function loadPlugins(opts) {
313
343
  }
314
344
  return result;
315
345
  }
346
+ /**
347
+ * What is wrong with how a FamilyDef says where its Accounts live (ADR-0047): either `selectVar` and `layout.account`
348
+ * both set, or `mainOnly: true` with both left out. undefined when it is right.
349
+ */
350
+ export function mainOnlyProblem(def) {
351
+ const layout = (typeof def.layout === 'object' && def.layout !== null ? def.layout : {});
352
+ const hasSelect = def.selectVar !== undefined;
353
+ const hasAccount = layout.account !== undefined;
354
+ if (def.mainOnly === undefined)
355
+ return undefined;
356
+ if (def.mainOnly !== true)
357
+ return 'mainOnly must be true or left out';
358
+ if (hasSelect || hasAccount)
359
+ return 'a Main-only Family (mainOnly: true) must leave out selectVar and layout.account';
360
+ return undefined;
361
+ }
@@ -79,6 +79,8 @@ export interface FamilyInfo {
79
79
  tuning: boolean;
80
80
  /** The Host's settings file that `sideby edit` opens (spec §3.30), relative to the account directory. */
81
81
  settingsFile?: string;
82
+ /** Set only for a Main-only Family: sideby knows only its Main Account and creates no other (ADR-0047). */
83
+ mainOnly?: true;
82
84
  }
83
85
  /** One Shared Item as `sideby families` reports it (spec §3.16). */
84
86
  export interface SharedItemInfo {
@@ -98,9 +100,10 @@ export interface FamilyDetail extends FamilyInfo {
98
100
  /** Relative to HOME: `{ main: '.claude', account: '.claude-<name>' }`. */
99
101
  layout: {
100
102
  main: string;
101
- account: string;
103
+ account?: string;
102
104
  };
103
- selectVar: string;
105
+ /** Left out for a Main-only Family (ADR-0047). */
106
+ selectVar?: string;
104
107
  /** `args` is null when sign-in happens inside the Host. */
105
108
  login: {
106
109
  args: string[] | null;
@@ -18,6 +18,7 @@ import { resolvePaths } from './core/paths.js';
18
18
  import { choosePick, suggestPickName } from './core/pick-commands.js';
19
19
  import { categoryReader } from './core/project-categories.js';
20
20
  import { fetchedQuota, quotaCheckOff, shownQuota } from './core/quota-fetch.js';
21
+ import { takeoverLimit } from './core/quota-levels.js';
21
22
  import { remoteControlGroups, turnRemoteControlOff, turnRemoteControlOn, undoRemoteControlOff, } from './core/remote-control.js';
22
23
  import { findResumeRoute } from './core/resume.js';
23
24
  import { SAME_LOGIN_FAMILIES, sameLoginGroups, sharedQuota } from './core/same-login.js';
@@ -283,6 +284,7 @@ export async function createRuntime(opts = {}) {
283
284
  plugin: loaded.familyOwner.get(f.id) ?? 'unknown',
284
285
  tuning: Boolean(f.readTuning),
285
286
  ...(hostSettingsFile(f) ? { settingsFile: hostSettingsFile(f) } : {}),
287
+ ...(f.mainOnly ? { mainOnly: true } : {}),
286
288
  };
287
289
  }));
288
290
  },
@@ -293,8 +295,8 @@ export async function createRuntime(opts = {}) {
293
295
  const fromConfig = new Set(config.extraSharedItems?.[f.id] ?? []);
294
296
  return {
295
297
  ...info.get(f.id),
296
- layout: { main: f.layout.main, account: f.layout.account },
297
- selectVar: f.selectVar,
298
+ layout: { main: f.layout.main, ...(f.layout.account ? { account: f.layout.account } : {}) },
299
+ ...(f.selectVar ? { selectVar: f.selectVar } : {}),
298
300
  login: { args: f.login.args ? [...f.login.args] : null, hint: f.login.hint },
299
301
  quota: Boolean(f.readQuota || f.fetchQuota),
300
302
  usage: Boolean(f.readUsage),
@@ -595,7 +597,10 @@ export async function createRuntime(opts = {}) {
595
597
  // Routing helps only a Family that can route and has somewhere else to route to (spec §3.15).
596
598
  const routes = config.resumeRouting
597
599
  ? [...families.values()]
598
- .filter((f) => f.resumedSession && f.sessionWrittenAt && list.some((a) => a.family === f.id && !a.isMain))
600
+ .filter((f) => f.selectVar &&
601
+ f.resumedSession &&
602
+ f.sessionWrittenAt &&
603
+ list.some((a) => a.family === f.id && !a.isMain))
599
604
  .map((f) => ({ family: f.id, bin: f.bin, selectVar: f.selectVar }))
600
605
  : [];
601
606
  return shellInitScript(list, { ...config.aliases, ...config.pickCommands }, routes);
@@ -645,7 +650,7 @@ export async function createRuntime(opts = {}) {
645
650
  throw new UserError(`${family.title} sessions cannot be routed; start an account yourself with \`sideby run <account> -- …\``);
646
651
  const host = { family, bin: family.bin, args: [...userArgs], env };
647
652
  // A select variable already set means an Account was chosen on purpose: run the Host as it is.
648
- if (env[family.selectVar])
653
+ if (family.selectVar && env[family.selectVar])
649
654
  return { launch: host };
650
655
  const route = await findResumeRoute(family, await accounts(), userArgs);
651
656
  const id = route.sessionId ? { sessionId: route.sessionId } : {};
@@ -836,7 +841,9 @@ export async function createRuntime(opts = {}) {
836
841
  // The current Account: the one sideby started this process from, when it belongs to this Family.
837
842
  const current = env.SIDEBY_ACCOUNT;
838
843
  const from = current && list.some((a) => a.ref === current) ? current : undefined;
839
- return planHandoff(f.id, candidates, readContext().now, { ...o, ...(from ? { from } : {}) });
844
+ // The Takeover Limit follows the user's Handoff Threshold, so `sideby next` and Auto Handoff agree on "full".
845
+ const fullAt = takeoverLimit(handoffSettings(config).threshold);
846
+ return planHandoff(f.id, candidates, readContext().now, { ...o, fullAt, ...(from ? { from } : {}) });
840
847
  },
841
848
  handoffSettings: () => handoffSettings(config),
842
849
  async handoffDecision(origin, used, opts = {}) {
@@ -17,8 +17,11 @@ export interface SharedItemDef {
17
17
  export interface FamilyLayout {
18
18
  /** Main Account directory relative to HOME, for example `.claude` or `.pi/agent`. */
19
19
  main: string;
20
- /** Other Accounts relative to HOME, with `<name>` in the first path segment: `.claude-<name>`, `.pi-<name>/agent`. */
21
- account: string;
20
+ /**
21
+ * Other Accounts relative to HOME, with `<name>` in the first path segment: `.claude-<name>`, `.pi-<name>/agent`.
22
+ * Left out only by a Main-only Family (`mainOnly: true`, ADR-0047).
23
+ */
24
+ account?: string;
22
25
  }
23
26
  export type LoginState = 'logged-in' | 'logged-out' | 'unknown';
24
27
  /**
@@ -33,6 +36,18 @@ export interface FamilyLogo {
33
36
  /** Name of the mark for tooltips; defaults to the Family title. */
34
37
  title?: string;
35
38
  fillRule?: 'nonzero' | 'evenodd';
39
+ /**
40
+ * Colour washes painted over the mark, in order, for a multicoloured mark (at most 4). Each fades in a straight line
41
+ * from `color` at `from` to transparent at `to`, in the 24x24 view box. `color` is then the base under them.
42
+ */
43
+ gradients?: FamilyLogoGradient[];
44
+ }
45
+ /** One colour wash of a FamilyLogo: `color` at `from`, fading to transparent at `to`. */
46
+ export interface FamilyLogoGradient {
47
+ from: [number, number];
48
+ to: [number, number];
49
+ /** Hex colour such as `#3186FF`. */
50
+ color: string;
36
51
  }
37
52
  /**
38
53
  * A Family's vendor website, for Browser Sign-ins (spec §3.24, ADR-0043): "Open in browser" opens `url` in a Chrome
@@ -139,8 +154,17 @@ export interface FamilyDef {
139
154
  installUrl: string;
140
155
  /** The Host's official one-line install command, shown before `installUrl`; sideby never runs it. */
141
156
  installCommand?: string;
142
- /** Environment variable that selects the Account directory. Not set for the Main Account. */
143
- selectVar: string;
157
+ /**
158
+ * Environment variable that selects the Account directory. Not set for the Main Account. Left out only by a
159
+ * Main-only Family (`mainOnly: true`).
160
+ */
161
+ selectVar?: string;
162
+ /**
163
+ * The Host offers no way to run a second Account apart from the first (no variable that moves its configuration
164
+ * directory, or a login kept in one fixed place): sideby knows only its Main Account and refuses to create others
165
+ * (ADR-0047). Set it with `selectVar` and `layout.account` both left out; any other combination is rejected.
166
+ */
167
+ mainOnly?: true;
144
168
  layout: FamilyLayout;
145
169
  /**
146
170
  * Entries that prove a directory is this Family's Account (besides a Secret File or an empty directory).
@@ -175,6 +199,12 @@ export interface FamilyDef {
175
199
  * it read the images from the paths the prompt lists. Public contract, additive only.
176
200
  */
177
201
  imageArg?: string;
202
+ /**
203
+ * The Host option that starts an interactive session with a first prompt, for a Host that refuses the prompt as a
204
+ * positional argument (Antigravity CLI: `--prompt-interactive`). An AI Task then passes `<promptArg>=<prompt>` in
205
+ * place of the positional prompt. Public contract, additive only.
206
+ */
207
+ promptArg?: string;
178
208
  /**
179
209
  * Makes a Launch safe for an AI Task (spec §3.28 "权限检查", ADR-0031): given every argument the Host would get
180
210
  * (Family defaults, the Account's config arguments, the task's own), returns them without any argument that
@@ -372,7 +402,7 @@ export interface QuotaFetchContext extends ReadContext {
372
402
  signal: AbortSignal;
373
403
  /**
374
404
  * The environment the Host gets at Launch, before the Secret File and Plugin hooks: sideby's own, Hijack Variables
375
- * cleared, the Family's `selectVar` set for every Account but the Main Account. Run the Host with this one.
405
+ * cleared, the Family's `selectVar` (if any) set for every Account but the Main Account. Run the Host with this one.
376
406
  */
377
407
  hostEnv: Env;
378
408
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sideby",
3
- "version": "0.21.0",
3
+ "version": "0.22.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)",
@@ -84,5 +84,5 @@
84
84
  },
85
85
  "packageManager": "pnpm@10.15.0",
86
86
  "readmeFilename": "README.md",
87
- "readme": "<p align=\"center\">\n <img alt=\"sideby: work, personal and API-key accounts, one terminal each, one shared config\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/banner.jpg\" width=\"880\">\n</p>\n\n<p align=\"center\">\n <b>Run work, personal and API-key accounts at the same time, without their configs drifting apart.</b><br>\n Each account is its own directory and its own terminal. Skills, hooks and settings stay linked to your main account. Claude Code, Codex, Grok Build and pi.\n</p>\n\n<p align=\"center\">\n <a href=\"https://www.npmjs.com/package/sideby\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/sideby\"></a>\n <a href=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml\"><img alt=\"CI\" src=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml/badge.svg\"></a>\n <img alt=\"Node 22.18+\" src=\"https://img.shields.io/badge/node-%E2%89%A522.18-339933\">\n <a href=\"LICENSE\"><img alt=\"MIT\" src=\"https://img.shields.io/badge/license-MIT-blue\"></a>\n</p>\n\n<p align=\"center\">English | <a href=\"README.zh-CN.md\">中文</a></p>\n\n## Quick start\n\nRequires Node 22.18+ and at least one Host CLI (Claude Code, Codex, Grok Build or pi) installed. AI agents: follow the setup steps in [`llms.txt`](llms.txt) (\"Set up sideby for a user\") instead.\n\n```sh\nnpm i -g sideby\nsideby new claude work # create ~/.claude-work, sharing ~/.claude's skills and hooks\nsideby login claude:work # sign in once\nsideby run work # Claude Code on the work account\nsideby quota setup claude --yes # Claude quota in the panel; undo: sideby quota teardown claude\nsideby ui --background # every account's quota at http://127.0.0.1:17420, still there after you close the terminal\n```\n\n`sideby app install` adds a Dock icon that opens the panel, and `sideby autostart on` has it ready each time you log in. `sideby update` installs a newer sideby when there is one; sideby says so after a command and in the panel. `sideby run claude:main` keeps using `~/.claude` in another terminal at the same time. Arguments after `--` go to the Host: `sideby run work -- --resume`. To try it without installing, run `npx sideby`.\n\n## Set up with your AI agent\n\nPaste this into Claude Code, Codex or any coding agent:\n\n```text\nInstall the sideby CLI (npm package `sideby`) and its agent skill, then set up a second Claude Code account for me.\nFollow \"Set up sideby for a user\" in https://raw.githubusercontent.com/Adonis0123/sideby/main/llms.txt\n```\n\nThe agent checks Node and your Host CLIs, installs sideby and the skill, creates the account, tells you what it shares with your main one and makes its short command work. You sign in once in your browser; the agent gives you that one command. Once the skill is installed, short requests work too: \"add another Claude account, cc008\", \"what do my Codex accounts share?\", \"which account still has quota?\".\n\n## What it looks like\n\nThe 25-second story: one account buried in tasks, then accounts side by side sharing one setup, and a task moving on when one runs out.\n\nhttps://github.com/user-attachments/assets/d1d7e8dd-1df1-4881-ac88-e468c2dd4a1d\n\n<img alt=\"Two terminals: the personal account and the work account running at the same time, both linked to the main account's skills and settings, then the local quota panel, and at 95% Auto Handoff moving work's session to the next account\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/demo.gif\" width=\"1280\">\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel-dark.png\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\">\n <img alt=\"sideby panel: every account's 5h and 7d quota, 7-day token usage and health in one page\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\" width=\"1280\">\n</picture>\n\nOn macOS, the same quota sits in the menu bar (`sideby menubar on`): click or press `⌥X` to open it, and click an account to start it in the terminal.\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar-dark.png\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar.png\">\n <img alt=\"sideby macOS menu bar dropdown: a status card, each tool with 5-hour and weekly quota bars, reset times, and the suggested account marked\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar.png\" width=\"468\">\n</picture>\n\n## Why not just an alias?\n\n`CLAUDE_CONFIG_DIR` plus a shell alias already starts a second account. It does not keep skills and settings in one place, and it does not show quota for every account. [Does this break a provider's terms?](docs/guide/faq.md#terms)\n\n| | At the same time | Skills, hooks, settings | Quota and usage | Setup |\n|---|---|---|---|---|\n| `CLAUDE_CONFIG_DIR` and an alias | Yes. Each terminal exports the variable. | Each directory is its own copy. They drift unless you symlink by hand. | That session's status line | One alias per account |\n| [cc-switch](https://github.com/farion1231/cc-switch) | Enabling a provider writes the host's live config, so open sessions share that switch. | Plugin settings are copied across providers as a separate step. | The active provider, from its quota endpoint | Install the desktop app |\n| sideby | Yes. `sideby run` selects the directory for that process and leaves your shell alone. | Linked to the main account. `sideby doctor --fix` repairs copies. Sign-in and sessions stay separate. | Every account, from local files. Claude needs `quota setup`. | `npm i -g sideby`, then `sideby new` and sign in |\n\ncc-switch's docs describe that switch: it writes the live settings file ([README](https://github.com/farion1231/cc-switch#readme)). [#1105](https://github.com/farion1231/cc-switch/issues/1105) and [#2908](https://github.com/farion1231/cc-switch/issues/2908) ask for several sessions at once. [#1106](https://github.com/farion1231/cc-switch/issues/1106) is closed; the maintainer says Claude Code's \"open terminal\" can start one provider without changing the global config.\n\n## What else it does\n\n| You want to | Run | Guide |\n|---|---|---|\n| Find any past session of any account by what you remember, grouped by project, read it and continue it where it was | **Sessions › History** in the panel, or `sideby history \"fix login\" --project .` | [History](docs/guide/panel.md#history) |\n| See what every account is running right now and copy one session for another AI | **Sessions › Running** in the panel, or `sideby sessions` | [Sessions](docs/guide/panel.md#sessions) |\n| Send a running session a message, screenshots included | **Send to it** on a running session, or `sideby send claude:work \"run the tests\"` | [Send to a session](docs/guide/panel.md#send-to-a-session) |\n| Hand a task to your own AI from the panel: set up an account, fix a problem, support a new tool | **Let AI do it** in the panel, or `sideby ask` | [Let AI do it](docs/guide/panel.md#let-ai-do-it) |\n| See quota at a glance in the macOS menu bar | **Settings › Startup** in the panel, or `sideby menubar on` | [Quota in the menu bar](docs/guide/usage.md#quota-in-the-menu-bar) |\n| Have the panel ready in the background whenever you log in | **Settings › Startup** in the panel, or `sideby autostart on` | [Start at login](docs/guide/usage.md#start-at-login) |\n| Add an API key account (DeepSeek, a gateway, …) | `sideby new claude deepseek --api` | [API accounts](docs/guide/usage.md#api-accounts) |\n| Find and fix config drift between accounts | `sideby doctor --fix` | [Doctor](docs/guide/usage.md#doctor) |\n| See Claude quota (Codex needs no setup) | `sideby quota setup claude --yes` | [Claude quota](docs/guide/usage.md#claude-quota) |\n| Find the cheapest auto-compact size from your own sessions, and use it in one click | `sideby tune` (or the panel's Context tuning tab) | [Context tuning](docs/guide/usage.md#context-tuning) |\n| See each account's model and effort, and set them per account | `sideby model <account>` (or click the model in the panel) | [Model and effort](docs/guide/usage.md#model-and-effort) |\n| Choose whether Claude sessions connect to claude.ai by themselves (Remote Control), for every account at once | `sideby remote-control off` or `on` (or the panel's Settings) | [Remote Control](docs/guide/usage.md#remote-control) |\n| Pin the accounts you use most and put tools and accounts in your own order | `sideby pin claude:work`, `sideby order` (or the panel's Settings) | [Your own order](docs/guide/usage.md#your-own-order) |\n| Move on when an account hits its limit | `sideby next claude` | [Handoff](docs/guide/usage.md#when-an-account-hits-its-limit) |\n| Let a running task move to the next account by itself when quota runs low (off by default; see the risk) | `sideby handoff enable` (or the panel) | [Auto Handoff](docs/guide/usage.md#auto-handoff) |\n| Short commands such as `ccw` | `sideby alias add ccw claude:work` | [Shell functions](docs/guide/configuration.md#shell-functions) |\n| Reopen a session from Orca and the like in the account that holds it | `\"resumeRouting\": true` in config | [Resuming from other tools](docs/guide/configuration.md#resuming-from-other-tools) |\n| Open Claude Desktop or the Codex app as one account, several side by side (macOS) | `sideby desktop claude:work` (or the panel) | [Desktop apps](docs/guide/usage.md#desktop-apps) |\n| Keep several Grok Bot windows open, each signed in to its own account (macOS) | `sideby desktop grok-bot:002` (or the panel) | [Grok Bot windows](docs/guide/usage.md#grok-bot-windows) |\n| Open the panel from the Dock or app menu | `sideby app install` | [Panel app](docs/guide/panel.md#panel-app) |\n| Show the panel inside your own local page | `createPanelHandler()` | [Embed the panel](docs/guide/panel.md#embed-the-panel) |\n| Add a Host, a pre-launch check, or your own project categories for History | a local plugin | [Plugins](docs/guide/plugins.md) |\n\n## Supported hosts\n\n| Host | Account directories | Sign-in | Quota | Usage (7 days) |\n|---|---|---|---|---|\n| Claude Code | `~/.claude`, `~/.claude-<name>` | `claude auth login` | ✓ after `quota setup claude` | ✓ |\n| Codex CLI | `~/.codex`, `~/.codex-<name>` | `codex login` | ✓ | ✓ |\n| Grok Build | `~/.grok`, `~/.grok-<name>` | `grok login` | weekly, asked from the `grok` CLI | no public source |\n| pi | `~/.pi/agent`, `~/.pi-<name>/agent` | `/login` inside pi | no public source | no public source |\n\nsideby starts the official binary on your `PATH` and never patches it. Tested versions and per-Host notes are in the [guide](docs/guide/usage.md#host-notes).\n\n## Platforms\n\nmacOS and Linux. CI runs the suite on `ubuntu-latest` and `macos-latest`, Node 22 and 24. **Windows is untested.** `sideby app` only installs a launcher on macOS and Linux. Linked items are symlinks, `sideby shell-init` prints bash and zsh functions, and the Claude quota wrapper runs `/bin/sh`.\n\n## Roadmap\n\n**Gemini CLI.** Gemini can point at another config directory with `GEMINI_CONFIG_DIR`. Older docs use `GEMINI_CLI_HOME`; current builds treat that name as deprecated, and exit on startup if it is set together with an exact directory override. A sideby family still needs a tested Gemini version, a login check that does not read tokens, and a list of which files to link or copy. That is more than a small patch, so it is not in this version.\n\n## Safe by design\n\n- It never edits a Host's global config to switch accounts. It moves a task to another account only when you turn on Auto Handoff, and never proxies requests or pools logins.\n- It never reads, prints or sends a credential value. Nothing about your accounts leaves your machine: the only request sideby makes on its own is a daily check of the npm registry for its newest version (off with `NO_UPDATE_NOTIFIER=1`; see [Updates](docs/guide/configuration.md#updates)).\n- `doctor --fix` never replaces a real file and never changes where a link points.\n- The panel answers only on `127.0.0.1` and refuses web pages from other sites, but it trusts every user of this computer. On a shared Mac, do not leave it running in the background ([details](docs/guide/panel.md#who-can-reach-the-panel)).\n\nDetails and the terms-of-service question are in the [FAQ](docs/guide/faq.md).\n\nUsage questions and ideas go in [Discussions](https://github.com/Adonis0123/sideby/discussions).\n\n## Docs\n\n- [Using sideby](docs/guide/usage.md): accounts, API accounts, Doctor, quota, Handoff, Host notes\n- [Commands](docs/guide/commands.md): every command, exit codes and `--json`\n- [Configuration](docs/guide/configuration.md): `config.json`, aliases, shell functions\n- [Panel](docs/guide/panel.md): the panel, sessions and their history, panel app and embedding\n- [Plugins](docs/guide/plugins.md): write your own Family, launch hook or project categories\n- [FAQ](docs/guide/faq.md): terms of service, data locations, alternatives, uninstall\n- [Changelog](https://github.com/Adonis0123/sideby/releases)\n\n## For AI agents\n\n- [`llms.txt`](llms.txt): setup steps, commands, JSON contract and plugin API in one index. `sideby families --json` states what each Host's accounts share.\n- [`skills/sideby/SKILL.md`](skills/sideby/SKILL.md): one Agent Skill for seeing, repairing and creating accounts and for moving on when one hits its limit. Install with `npx skills add Adonis0123/sideby -g`; `sideby doctor` warns when the installed copy is for another sideby version.\n- [`AGENTS.md`](AGENTS.md): rules for agents working on this repository.\n\n## License\n\n[MIT](LICENSE)\n"
87
+ "readme": "<p align=\"center\">\n <img alt=\"sideby: work, personal and API-key accounts, one terminal each, one shared config\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/banner.jpg\" width=\"880\">\n</p>\n\n<p align=\"center\">\n <b>Run work, personal and API-key accounts at the same time, without their configs drifting apart.</b><br>\n Each account is its own directory and its own terminal. Skills, hooks and settings stay linked to your main account. Claude Code, Codex, Grok Build and pi.\n</p>\n\n<p align=\"center\">\n <a href=\"https://www.npmjs.com/package/sideby\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/sideby\"></a>\n <a href=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml\"><img alt=\"CI\" src=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml/badge.svg\"></a>\n <img alt=\"Node 22.18+\" src=\"https://img.shields.io/badge/node-%E2%89%A522.18-339933\">\n <a href=\"LICENSE\"><img alt=\"MIT\" src=\"https://img.shields.io/badge/license-MIT-blue\"></a>\n</p>\n\n<p align=\"center\">English | <a href=\"README.zh-CN.md\">中文</a></p>\n\n## Quick start\n\nRequires Node 22.18+ and at least one Host CLI (Claude Code, Codex, Grok Build or pi) installed. AI agents: follow the setup steps in [`llms.txt`](llms.txt) (\"Set up sideby for a user\") instead.\n\n```sh\nnpm i -g sideby\nsideby new claude work # create ~/.claude-work, sharing ~/.claude's skills and hooks\nsideby login claude:work # sign in once\nsideby run work # Claude Code on the work account\nsideby quota setup claude --yes # Claude quota in the panel; undo: sideby quota teardown claude\nsideby ui --background # every account's quota at http://127.0.0.1:17420, still there after you close the terminal\n```\n\n`sideby app install` adds a Dock icon that opens the panel, and `sideby autostart on` has it ready each time you log in. `sideby update` installs a newer sideby when there is one; sideby says so after a command and in the panel. `sideby run claude:main` keeps using `~/.claude` in another terminal at the same time. Arguments after `--` go to the Host: `sideby run work -- --resume`. To try it without installing, run `npx sideby`.\n\n## Set up with your AI agent\n\nPaste this into Claude Code, Codex or any coding agent:\n\n```text\nInstall the sideby CLI (npm package `sideby`) and its agent skill, then set up a second Claude Code account for me.\nFollow \"Set up sideby for a user\" in https://raw.githubusercontent.com/Adonis0123/sideby/main/llms.txt\n```\n\nThe agent checks Node and your Host CLIs, installs sideby and the skill, creates the account, tells you what it shares with your main one and makes its short command work. You sign in once in your browser; the agent gives you that one command. Once the skill is installed, short requests work too: \"add another Claude account, cc008\", \"what do my Codex accounts share?\", \"which account still has quota?\".\n\n## What it looks like\n\nThe 25-second story: one account buried in tasks, then accounts side by side sharing one setup, and a task moving on when one runs out.\n\nhttps://github.com/user-attachments/assets/d1d7e8dd-1df1-4881-ac88-e468c2dd4a1d\n\n<img alt=\"Two terminals: the personal account and the work account running at the same time, both linked to the main account's skills and settings, then the local quota panel, and at 95% Auto Handoff moving work's session to the next account\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/demo.gif\" width=\"1280\">\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel-dark.png\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\">\n <img alt=\"sideby panel: every account's 5h and 7d quota, 7-day token usage and health in one page\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\" width=\"1280\">\n</picture>\n\nOn macOS, the same quota sits in the menu bar (`sideby menubar on`): click or press `⌥X` to open it, and click an account to start it in the terminal.\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar-dark.png\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar.png\">\n <img alt=\"sideby macOS menu bar dropdown: a status card, each tool with 5-hour and weekly quota bars, reset times, and the suggested account marked\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar.png\" width=\"468\">\n</picture>\n\n## Why not just an alias?\n\n`CLAUDE_CONFIG_DIR` plus a shell alias already starts a second account. It does not keep skills and settings in one place, and it does not show quota for every account. [Does this break a provider's terms?](docs/guide/faq.md#terms)\n\n| | At the same time | Skills, hooks, settings | Quota and usage | Setup |\n|---|---|---|---|---|\n| `CLAUDE_CONFIG_DIR` and an alias | Yes. Each terminal exports the variable. | Each directory is its own copy. They drift unless you symlink by hand. | That session's status line | One alias per account |\n| [cc-switch](https://github.com/farion1231/cc-switch) | Enabling a provider writes the host's live config, so open sessions share that switch. | Plugin settings are copied across providers as a separate step. | The active provider, from its quota endpoint | Install the desktop app |\n| sideby | Yes. `sideby run` selects the directory for that process and leaves your shell alone. | Linked to the main account. `sideby doctor --fix` repairs copies. Sign-in and sessions stay separate. | Every account, from local files. Claude needs `quota setup`. | `npm i -g sideby`, then `sideby new` and sign in |\n\ncc-switch's docs describe that switch: it writes the live settings file ([README](https://github.com/farion1231/cc-switch#readme)). [#1105](https://github.com/farion1231/cc-switch/issues/1105) and [#2908](https://github.com/farion1231/cc-switch/issues/2908) ask for several sessions at once. [#1106](https://github.com/farion1231/cc-switch/issues/1106) is closed; the maintainer says Claude Code's \"open terminal\" can start one provider without changing the global config.\n\n## What else it does\n\n| You want to | Run | Guide |\n|---|---|---|\n| Find any past session of any account by what you remember, grouped by project, read it and continue it where it was | **Sessions › History** in the panel, or `sideby history \"fix login\" --project .` | [History](docs/guide/panel.md#history) |\n| See what every account is running right now and copy one session for another AI | **Sessions › Running** in the panel, or `sideby sessions` | [Sessions](docs/guide/panel.md#sessions) |\n| Send a running session a message, screenshots included | **Send to it** on a running session, or `sideby send claude:work \"run the tests\"` | [Send to a session](docs/guide/panel.md#send-to-a-session) |\n| Hand a task to your own AI from the panel: set up an account, fix a problem, support a new tool | **Let AI do it** in the panel, or `sideby ask` | [Let AI do it](docs/guide/panel.md#let-ai-do-it) |\n| See quota at a glance in the macOS menu bar | **Settings › Startup** in the panel, or `sideby menubar on` | [Quota in the menu bar](docs/guide/usage.md#quota-in-the-menu-bar) |\n| Have the panel ready in the background whenever you log in | **Settings › Startup** in the panel, or `sideby autostart on` | [Start at login](docs/guide/usage.md#start-at-login) |\n| Add an API key account (DeepSeek, a gateway, …) | `sideby new claude deepseek --api` | [API accounts](docs/guide/usage.md#api-accounts) |\n| Find and fix config drift between accounts | `sideby doctor --fix` | [Doctor](docs/guide/usage.md#doctor) |\n| See Claude quota (Codex needs no setup) | `sideby quota setup claude --yes` | [Claude quota](docs/guide/usage.md#claude-quota) |\n| Find the cheapest auto-compact size from your own sessions, and use it in one click | `sideby tune` (or the panel's Context tuning tab) | [Context tuning](docs/guide/usage.md#context-tuning) |\n| See each account's model and effort, and set them per account | `sideby model <account>` (or click the model in the panel) | [Model and effort](docs/guide/usage.md#model-and-effort) |\n| Choose whether Claude sessions connect to claude.ai by themselves (Remote Control), for every account at once | `sideby remote-control off` or `on` (or the panel's Settings) | [Remote Control](docs/guide/usage.md#remote-control) |\n| Pin the accounts you use most and put tools and accounts in your own order | `sideby pin claude:work`, `sideby order` (or the panel's Settings) | [Your own order](docs/guide/usage.md#your-own-order) |\n| Move on when an account hits its limit | `sideby next claude` | [Handoff](docs/guide/usage.md#when-an-account-hits-its-limit) |\n| Let a running task move to the next account by itself when quota runs low (off by default; see the risk) | `sideby handoff enable` (or the panel) | [Auto Handoff](docs/guide/usage.md#auto-handoff) |\n| Short commands such as `ccw` | `sideby alias add ccw claude:work` | [Shell functions](docs/guide/configuration.md#shell-functions) |\n| Reopen a session from Orca and the like in the account that holds it | `\"resumeRouting\": true` in config | [Resuming from other tools](docs/guide/configuration.md#resuming-from-other-tools) |\n| Open Claude Desktop or the Codex app as one account, several side by side (macOS) | `sideby desktop claude:work` (or the panel) | [Desktop apps](docs/guide/usage.md#desktop-apps) |\n| Keep several Grok Bot windows open, each signed in to its own account (macOS) | `sideby desktop grok-bot:002` (or the panel) | [Grok Bot windows](docs/guide/usage.md#grok-bot-windows) |\n| Open the panel from the Dock or app menu | `sideby app install` | [Panel app](docs/guide/panel.md#panel-app) |\n| Show the panel inside your own local page | `createPanelHandler()` | [Embed the panel](docs/guide/panel.md#embed-the-panel) |\n| Add a Host, a pre-launch check, or your own project categories for History | a local plugin | [Plugins](docs/guide/plugins.md) |\n\n## Supported hosts\n\n| Host | Account directories | Sign-in | Quota | Usage (7 days) |\n|---|---|---|---|---|\n| Claude Code | `~/.claude`, `~/.claude-<name>` | `claude auth login` | ✓ after `quota setup claude` | ✓ |\n| Codex CLI | `~/.codex`, `~/.codex-<name>` | `codex login` | ✓ | ✓ |\n| Grok Build | `~/.grok`, `~/.grok-<name>` | `grok login` | weekly, asked from the `grok` CLI | no public source |\n| pi | `~/.pi/agent`, `~/.pi-<name>/agent` | `/login` inside pi | no public source | no public source |\n| Antigravity CLI | `~/.gemini/antigravity-cli` (main account only) | sign in with Google inside `agy` | 5-hour and weekly per model group, asked from the `agy` CLI | no public source |\n\nsideby starts the official binary on your `PATH` and never patches it. Tested versions and per-Host notes are in the [guide](docs/guide/usage.md#host-notes).\n\n## Platforms\n\nmacOS and Linux. CI runs the suite on `ubuntu-latest` and `macos-latest`, Node 22 and 24. **Windows is untested.** `sideby app` only installs a launcher on macOS and Linux. Linked items are symlinks, `sideby shell-init` prints bash and zsh functions, and the Claude quota wrapper runs `/bin/sh`.\n\n## Roadmap\n\n**Gemini CLI.** Gemini can point at another config directory with `GEMINI_CONFIG_DIR`. Older docs use `GEMINI_CLI_HOME`; current builds treat that name as deprecated, and exit on startup if it is set together with an exact directory override. A sideby family still needs a tested Gemini version, a login check that does not read tokens, and a list of which files to link or copy. That is more than a small patch, so it is not in this version.\n\n## Safe by design\n\n- It never edits a Host's global config to switch accounts. It moves a task to another account only when you turn on Auto Handoff, and never proxies requests or pools logins.\n- It never reads, prints or sends a credential value. Nothing about your accounts leaves your machine: the only request sideby makes on its own is a daily check of the npm registry for its newest version (off with `NO_UPDATE_NOTIFIER=1`; see [Updates](docs/guide/configuration.md#updates)).\n- `doctor --fix` never replaces a real file and never changes where a link points.\n- The panel answers only on `127.0.0.1` and refuses web pages from other sites, but it trusts every user of this computer. On a shared Mac, do not leave it running in the background ([details](docs/guide/panel.md#who-can-reach-the-panel)).\n\nDetails and the terms-of-service question are in the [FAQ](docs/guide/faq.md).\n\nUsage questions and ideas go in [Discussions](https://github.com/Adonis0123/sideby/discussions).\n\n## Docs\n\n- [Using sideby](docs/guide/usage.md): accounts, API accounts, Doctor, quota, Handoff, Host notes\n- [Commands](docs/guide/commands.md): every command, exit codes and `--json`\n- [Configuration](docs/guide/configuration.md): `config.json`, aliases, shell functions\n- [Panel](docs/guide/panel.md): the panel, sessions and their history, panel app and embedding\n- [Plugins](docs/guide/plugins.md): write your own Family, launch hook or project categories\n- [FAQ](docs/guide/faq.md): terms of service, data locations, alternatives, uninstall\n- [Changelog](https://github.com/Adonis0123/sideby/releases)\n\n## For AI agents\n\n- [`llms.txt`](llms.txt): setup steps, commands, JSON contract and plugin API in one index. `sideby families --json` states what each Host's accounts share.\n- [`skills/sideby/SKILL.md`](skills/sideby/SKILL.md): one Agent Skill for seeing, repairing and creating accounts and for moving on when one hits its limit. Install with `npx skills add Adonis0123/sideby -g`; `sideby doctor` warns when the installed copy is for another sideby version.\n- [`AGENTS.md`](AGENTS.md): rules for agents working on this repository.\n\n## License\n\n[MIT](LICENSE)\n"
88
88
  }