sideby 0.35.5 → 0.35.7

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 (57) hide show
  1. package/dist/build.json +1 -1
  2. package/dist/src/cli/commands.d.ts +9 -1
  3. package/dist/src/cli/commands.js +59 -16
  4. package/dist/src/cli/json-schemas.js +20 -0
  5. package/dist/src/cli/main.js +11 -5
  6. package/dist/src/core/cli-commands.js +1 -1
  7. package/dist/src/core/config.d.ts +7 -0
  8. package/dist/src/core/config.js +9 -0
  9. package/dist/src/core/doctor.d.ts +5 -1
  10. package/dist/src/core/doctor.js +16 -0
  11. package/dist/src/core/edit-settings.d.ts +27 -1
  12. package/dist/src/core/edit-settings.js +78 -4
  13. package/dist/src/core/handoff-select.d.ts +3 -1
  14. package/dist/src/core/handoff-select.js +11 -1
  15. package/dist/src/core/handoff.d.ts +13 -1
  16. package/dist/src/core/handoff.js +16 -5
  17. package/dist/src/core/login-mark.d.ts +3 -0
  18. package/dist/src/core/login-mark.js +22 -0
  19. package/dist/src/core/pick-commands.d.ts +4 -2
  20. package/dist/src/core/pick-commands.js +7 -2
  21. package/dist/src/core/quota-fetch.d.ts +7 -1
  22. package/dist/src/core/quota-fetch.js +38 -1
  23. package/dist/src/core/quota-store.d.ts +5 -0
  24. package/dist/src/core/quota-store.js +3 -0
  25. package/dist/src/core/search-catalog.js +9 -0
  26. package/dist/src/core/session-hooks.d.ts +6 -1
  27. package/dist/src/core/session-hooks.js +16 -2
  28. package/dist/src/families/claude/index.js +3 -0
  29. package/dist/src/families/claude/login-events.d.ts +24 -0
  30. package/dist/src/families/claude/login-events.js +163 -0
  31. package/dist/src/families/claude/quota-fetch.js +14 -0
  32. package/dist/src/menubar/snapshot.d.ts +2 -0
  33. package/dist/src/menubar/snapshot.js +6 -2
  34. package/dist/src/menubar/strings.d.ts +4 -0
  35. package/dist/src/menubar/strings.js +4 -0
  36. package/dist/src/panel/handler.d.ts +14 -1
  37. package/dist/src/panel/handler.js +48 -14
  38. package/dist/src/panel/i18n.d.ts +23 -0
  39. package/dist/src/panel/i18n.js +46 -0
  40. package/dist/src/panel/page-logic.d.ts +44 -2
  41. package/dist/src/panel/page-logic.js +43 -3
  42. package/dist/src/panel/page-script.js +124 -7
  43. package/dist/src/panel/page-styles.js +8 -0
  44. package/dist/src/panel/page.d.ts +7 -0
  45. package/dist/src/panel/page.js +1 -0
  46. package/dist/src/runtime.d.ts +16 -1
  47. package/dist/src/runtime.js +51 -2
  48. package/dist/src/types.d.ts +37 -0
  49. package/package.json +3 -3
  50. package/schemas/config.json +11 -0
  51. package/schemas/edit.json +4 -0
  52. package/schemas/list.json +24 -0
  53. package/schemas/next.json +18 -0
  54. package/skills/sideby/SKILL.md +4 -2
  55. package/skills/sideby/references/accounts.md +9 -0
  56. package/skills/sideby/references/diagnose.md +6 -1
  57. package/skills/sideby/references/panel.md +1 -1
@@ -5,13 +5,15 @@ import { groupsToAccept } from '../core/inbound.js';
5
5
  import { quotaIsStale } from '../core/quota-levels.js';
6
6
  import { remoteControlTodo } from '../core/remote-control.js';
7
7
  import { catalogMatchLevel, catalogNorm, searchCatalog } from '../core/search-catalog.js';
8
- import { accountTitle, aiTaskAccounts, aliasArgsOf, aliasIssue, aliasPrefix, askBridge, askBridged, askCopy, askPermissionNote, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, longWindow, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, messageToCheck, networkTaskFacts, newAccountDir, nextReset, orderedAliases, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, portalRefresh, quotaAskable, quotaHighLevel, quotaPressure, radioStep, reloadForBuild, remoteControlSummary, reorder, resetWhen, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, sessionRowShape, shortCwd, shortSessionLabel, sortAccounts, sortMenu, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, uaDayRuns, uaGroupPending, uaOnChoices, uaParseClock, uaPickTime, uaSameSlot, uaShouldRead, uaSlotNight, uaStatusParts, uaStepClock, uaToggleDay, uaWaitingCount, uaWhen, updatedAge, vendorAlias, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
8
+ import { accountTitle, aiTaskAccounts, aliasArgsOf, aliasIssue, aliasPrefix, askBridge, askBridged, askCopy, askPermissionNote, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, expiredLogins, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, longWindow, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, messageToCheck, networkTaskFacts, newAccountDir, nextReset, openBridge, openBridged, orderedAliases, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, portalRefresh, quotaAskable, quotaHighLevel, quotaPressure, radioStep, reloadForBuild, remoteControlSummary, reorder, resetWhen, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, sessionRowShape, shortCwd, shortSessionLabel, sortAccounts, sortMenu, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, uaDayRuns, uaGroupPending, uaOnChoices, uaParseClock, uaPickTime, uaSameSlot, uaShouldRead, uaSlotNight, uaStatusParts, uaStepClock, uaToggleDay, uaWaitingCount, uaWhen, updatedAge, vendorAlias, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
9
9
  // The component library's dropdown menu, copied by the brand repo's add script (--html into ui/); do not edit it.
10
10
  import { CHECK, menuItem, menuScript } from './ui/dropdown-menu/dropdown-menu.html.js';
11
11
  import { cn, esc } from './ui/lib/cn.js';
12
12
  const LOGIC = [
13
13
  quotaIsStale,
14
14
  portalRefresh,
15
+ openBridge,
16
+ openBridged,
15
17
  catalogNorm,
16
18
  catalogMatchLevel,
17
19
  searchCatalog,
@@ -31,6 +33,7 @@ const LOGIC = [
31
33
  accountTitle,
32
34
  vendorAlias,
33
35
  attentionReasons,
36
+ expiredLogins,
34
37
  attentionWhy,
35
38
  quotaHighLevel,
36
39
  autostartNote,
@@ -1100,13 +1103,43 @@ const MAIN = String.raw `
1100
1103
  if (!file || !a.dir || BOOT.readOnly) return null
1101
1104
  return { icon: 'file', label: t('menu.editSettings', { file }), hint: a.dir + '/' + file, run: () => editSettings(a, file) }
1102
1105
  }
1106
+ // In a Portal that opens files itself (createPanelHandler's open bridge), the server only says where the real file
1107
+ // is and the Portal opens it with the app chosen there, and says so; otherwise the server opens it (config editor).
1103
1108
  async function editSettings(a, file) {
1104
1109
  try {
1105
- const r = await api('/api/account/edit-settings', { account: a.ref })
1106
- toast(t('edit.opened', { ref: a.ref, file }))
1110
+ const bridged = openBridged(BOOT, window)
1111
+ const r = await api('/api/account/edit-settings', bridged ? { account: a.ref, open: false } : { account: a.ref })
1112
+ if (bridged) { if (!openBridge(BOOT, r.realPath, window)) throw new Error(t('edit.noPath')) }
1113
+ else toast(t(r.editor && r.editor !== 'system' ? 'edit.openedWith' : 'edit.opened', { ref: a.ref, file, app: editorName(r.editor) }))
1107
1114
  if (r.sharedWith && r.sharedWith.length) toast(t('edit.shared', { names: r.sharedWith.map(refName).join(', ') }), { kind: 'info', duration: 8000 })
1108
1115
  } catch (e) { toast(t('edit.failed', { ref: a.ref, file, msg: e.message }), { kind: 'fail' }) }
1109
1116
  }
1117
+ // config editor (spec §3.30): the choices of the Settings row, in the order of EDITORS.
1118
+ const EDITOR_CHOICES = [['system', ''], ['cursor', 'Cursor'], ['vscode', 'VS Code'], ['windsurf', 'Windsurf'], ['zed', 'Zed']]
1119
+ function editorName(id) { const c = EDITOR_CHOICES.find((x) => x[0] === id); return c && c[1] ? c[1] : t('set.editor.system') }
1120
+ let editorSaving = null
1121
+ function editorNow() { return editorSaving || (S.state && S.state.editor) || 'system' }
1122
+ async function setEditor(v) {
1123
+ if (v === editorNow()) return
1124
+ editorSaving = v
1125
+ refreshSettings()
1126
+ try {
1127
+ const r = await api('/api/editor', { editor: v })
1128
+ if (S.state) S.state.editor = r.editor
1129
+ toast(t('set.editor.saved', { app: editorName(r.editor) }))
1130
+ } catch (e) { toast(t('set.saveFailed', { msg: e.message }), { kind: 'fail' }) }
1131
+ editorSaving = null
1132
+ refreshSettings()
1133
+ }
1134
+ // The Settings row. In a Portal that opens files itself, the Portal's own choice opens them here, so the row says so.
1135
+ function editorRow() {
1136
+ const label = t('set.editor')
1137
+ const cur = editorNow()
1138
+ return h('div', { class: 'set-row set-stack' },
1139
+ h('div', { class: 'set-text' }, h('span', { class: 'set-label' }, label), h('span', { class: 'set-hint' }, t(openBridged(BOOT, window) ? 'set.editor.portal' : 'set.editor.hint'))),
1140
+ h('div', { class: 'seg', role: 'group', 'aria-label': label }, EDITOR_CHOICES.map(([v, text]) =>
1141
+ h('button', { class: 'seg-btn', type: 'button', 'aria-pressed': String(v === cur), disabled: Boolean(editorSaving), onclick: () => setEditor(v) }, text || t('set.editor.system')))))
1142
+ }
1110
1143
  // What the login does, whichever directory: the browser, signing in, the email, a new account like it.
1111
1144
  function loginItems(a) {
1112
1145
  return [
@@ -1327,7 +1360,7 @@ const MAIN = String.raw `
1327
1360
  if (rs.length) need++
1328
1361
  for (const r of rs) counts[r] = (counts[r] || 0) + 1
1329
1362
  }
1330
- const order = ['error', 'health-fail', 'signed-out', 'not-installed', 'quota-high', 'health-warn']
1363
+ const order = ['error', 'health-fail', 'signed-out', 'login-expired', 'not-installed', 'quota-high', 'health-warn']
1331
1364
  // Who needs a look, by name: counting reasons beside a count of accounts made numbers that did not add up. One name
1332
1365
  // and a count, as two names did not fit the card.
1333
1366
  const needing = list.filter((a) => reasonsOf(a, now).length)
@@ -1616,8 +1649,17 @@ const MAIN = String.raw `
1616
1649
  function statusBadge(a, members) {
1617
1650
  const subject = attentionSubject(a)
1618
1651
  const next = members ? members.some(isNext) : isNext(a)
1619
- const k = rowBadge(reasonsOf(subject, Date.now()), { next, api: a.kind === 'api' })
1620
- if (k === 'health-fail' || k === 'quota-high' || k === 'health-warn') return attentionWord(subject, k)
1652
+ // A Same Login row speaks for every directory in it: an expired one is named (ADR-0071).
1653
+ const expired = expiredLogins(members || [a])
1654
+ const reasons = reasonsOf(subject, Date.now())
1655
+ if (expired.length && !reasons.includes('login-expired')) reasons.push('login-expired')
1656
+ const k = rowBadge(reasons, { next, api: a.kind === 'api' })
1657
+ if (k === 'login-expired') return expiredBadge(expired, Boolean(members && members.length > 1), a.ref)
1658
+ const now = k === 'health-fail' || k === 'quota-high' || k === 'health-warn' ? attentionWord(subject, k) : otherBadge(a, k)
1659
+ const leaving = expiredBadgeLeaving(a.ref)
1660
+ return leaving ? [leaving, now] : now
1661
+ }
1662
+ function otherBadge(a, k) {
1621
1663
  if (k === 'signed-out')
1622
1664
  return h('button', { class: 'tag tag-fail tag-btn', type: 'button', title: t('acct.signInHint'), 'aria-label': t('acct.signedOutLabel', { ref: a.ref }), onclick: (e) => { e.stopPropagation(); signIn(a) } }, h('span', { class: 'dot dot-fail', 'aria-hidden': 'true' }), t('acct.signedOut'))
1623
1665
  if (k === 'not-installed') return h('span', { class: 'tag tag-warn' }, t(family(a.family).brokenBin ? 'acct.broken' : 'acct.notInstalled'))
@@ -1625,6 +1667,45 @@ const MAIN = String.raw `
1625
1667
  if (k === 'api') return h('span', { class: 'tag tag-warn', title: t('tip.api.body') }, t('acct.api'))
1626
1668
  return null
1627
1669
  }
1670
+ // An Expired Login (ADR-0071): a word, and "Sign in again" beside it, which opens the sign-in in the terminal. In a
1671
+ // Same Login row the word names every expired directory, each with its own button. After a sign-in sideby started it
1672
+ // says it waits for confirmation. row is the ref of the row it sits in, so it can shrink away when it goes.
1673
+ function expiredBadge(list, named, row) {
1674
+ const waiting = list.every((m) => m.loginProblem && m.loginProblem.signedInAt)
1675
+ const why = list.map((m) => {
1676
+ const p = m.loginProblem || {}
1677
+ const since = p.since ? t('acct.expiredSince', { time: clock(p.since) }) : ''
1678
+ return p.signedInAt ? t('acct.expiredWaitingHint', { ref: m.ref }) : t('acct.expiredHint', { ref: m.ref, since })
1679
+ }).join('\n')
1680
+ const word = waiting ? t('acct.expiredWaiting') : named ? t('acct.expiredIn', { name: list.map((m) => m.name).join(', ') }) : t('acct.expired')
1681
+ const todo = BOOT.readOnly ? [] : list.filter((m) => !(m.loginProblem && m.loginProblem.signedInAt))
1682
+ const btn = (m) => h('button', { class: 'link-btn small', type: 'button', title: t('exp.signInRef', { ref: m.ref }), onclick: (e) => { e.stopPropagation(); signIn(m) } }, todo.length > 1 ? t('acct.signInName', { name: m.name }) : t('acct.signInAgain'))
1683
+ // It grows in once; the class goes after that, so a refresh with the same answer keeps this element.
1684
+ return h('span', { class: 'exp-badge', 'data-row': row, 'data-enter': 'exp-' + list.map((m) => m.ref).join(','), onanimationend: (e) => e.currentTarget.classList.remove('enter') },
1685
+ h('span', { class: 'tag tag-warn', title: why, 'aria-label': why }, h('span', { class: 'dot dot-warn', 'aria-hidden': 'true' }), word),
1686
+ todo.map(btn))
1687
+ }
1688
+ // The badge a row showed before its sign-in works again: kept for one more render while it fades and narrows to
1689
+ // nothing (180 ms, none under reduced motion), then the next render drops it.
1690
+ function expiredBadgeLeaving(row) {
1691
+ if (REDUCED) return null
1692
+ const old = document.querySelector('.exp-badge[data-row="' + CSS.escape(row) + '"]')
1693
+ if (!old || old.dataset.gone) return null
1694
+ if (old.dataset.leaving) return old
1695
+ old.dataset.leaving = '1'
1696
+ old.removeAttribute('data-enter')
1697
+ old.classList.remove('enter')
1698
+ old.style.pointerEvents = 'none'
1699
+ old.style.overflow = 'hidden'
1700
+ old.style.whiteSpace = 'nowrap'
1701
+ const w = old.offsetWidth
1702
+ setTimeout(() => {
1703
+ if (!old.isConnected) return
1704
+ old.animate([{ opacity: 1, maxWidth: w + 'px', marginLeft: '0px' }, { opacity: 0, maxWidth: '0px', marginLeft: '-8px' }], { duration: 180, easing: 'ease-in-out', fill: 'forwards' })
1705
+ setTimeout(() => { old.dataset.gone = '1'; renderAccounts() }, 190)
1706
+ }, 0)
1707
+ return old
1708
+ }
1628
1709
  // An Account's short commands, as quiet text after its title: those that only start it first, then those with Host
1629
1710
  // arguments; each says on hover what it adds. A card too narrow for all of them ends in an ellipsis.
1630
1711
  function aliasText(a, list) {
@@ -6611,6 +6692,7 @@ const MAIN = String.raw `
6611
6692
  const link = (...args) => setLink(leave, ...args)
6612
6693
  const general = [...lookRows(), fm('themes', link(t('th.title'), themeLabel(), '', openThemes, true)), fm('autostart', autostartRow('autostart'))]
6613
6694
  if (!BOOT.readOnly) general.push(fm('terminal', link(t('term.title'), '', '', openTerminals, true)))
6695
+ if (!BOOT.readOnly && S.state) general.push(fm('editor', editorRow()))
6614
6696
  // The menu bar switch shows only where it works (macOS); while its state loads it waits, unseen.
6615
6697
  const bar = []
6616
6698
  if (li.menubar.status && li.menubar.status.supported) {
@@ -7364,7 +7446,7 @@ const MAIN = String.raw `
7364
7446
  return Boolean(u && u.skillUpdate && u.skillUpdate.installed && u.skillUpdate.installed.length)
7365
7447
  }
7366
7448
  // Example phrases: a click puts one in the Let AI do it box (spec §3.28).
7367
- const AI_ASKS = ['ai.ask.quota', 'ai.ask.pick', 'ai.ask.new', 'ai.ask.api', 'ai.ask.pin', 'ai.ask.hide', 'ai.ask.relogin', 'ai.ask.fix', 'ai.ask.handoff', 'ai.ask.handoffRules', 'ai.ask.session', 'ai.ask.history', 'ai.ask.send', 'ai.ask.inbound', 'ai.ask.menubar', 'ai.ask.rc', 'ai.ask.network', 'ai.ask.unattended', 'ai.ask.theme', 'ai.ask.find', 'ai.ask.commands', 'ai.ask.tool']
7449
+ const AI_ASKS = ['ai.ask.quota', 'ai.ask.pick', 'ai.ask.new', 'ai.ask.api', 'ai.ask.pin', 'ai.ask.hide', 'ai.ask.relogin', 'ai.ask.expired', 'ai.ask.fix', 'ai.ask.handoff', 'ai.ask.handoffRules', 'ai.ask.session', 'ai.ask.history', 'ai.ask.send', 'ai.ask.inbound', 'ai.ask.menubar', 'ai.ask.rc', 'ai.ask.network', 'ai.ask.unattended', 'ai.ask.theme', 'ai.ask.find', 'ai.ask.commands', 'ai.ask.tool']
7368
7450
  // Network Guard (spec §3.35): one dialog with the switch, the allowed countries and the newest result per address.
7369
7451
  // Countries are never ticked for the user, the current one included: a wrong network would allow itself.
7370
7452
  const NET_COMMON = ['US', 'JP', 'SG', 'GB', 'DE', 'FR', 'NL', 'CA', 'AU', 'KR', 'TW', 'HK']
@@ -8516,6 +8598,8 @@ const MAIN = String.raw `
8516
8598
  if (inbBanner) out.push(inbBanner)
8517
8599
  const nb = netBanner()
8518
8600
  if (nb) out.push(nb)
8601
+ const eb = expiredBanner()
8602
+ if (eb) out.push(eb)
8519
8603
  const errs = S.state.pluginErrors
8520
8604
  if (errs.length) out.push(h('div', { class: 'banner banner-warn', role: 'status' }, h('div', null,
8521
8605
  h('b', null, tn('banner.plugins', errs.length) + ' '), t('banner.pluginsHint'),
@@ -8523,6 +8607,39 @@ const MAIN = String.raw `
8523
8607
  }
8524
8608
  patch($('banners'), out)
8525
8609
  growInboundBanner()
8610
+ growExpiredBanner()
8611
+ }
8612
+ // One banner while any Account's sign-in has expired (ADR-0071), on the Accounts page. Its text and button change
8613
+ // only when the list of expired Accounts does, so a refresh with the same answer redraws nothing. It grows in when it
8614
+ // appears and shrinks away when the last one is signed in again.
8615
+ const exb = { el: undefined }
8616
+ function expiredBanner() {
8617
+ const list = S.state ? expiredLogins(visibleAccounts()).filter((a) => !(a.loginProblem && a.loginProblem.signedInAt)) : []
8618
+ if (curPage !== 'accounts' || !list.length) return expiredBannerKept()
8619
+ const refs = list.map((a) => a.ref)
8620
+ const attrs = { class: 'banner banner-warn', role: 'status', 'data-key': 'exp-banner' }
8621
+ const text = h('div', null, tn('exp.banner', refs.length, { refs: refList(refs) }))
8622
+ if (BOOT.readOnly) return h('div', attrs, text)
8623
+ return h('div', attrs, text,
8624
+ h('div', { class: 'banner-actions' },
8625
+ list.slice(0, 3).map((a, i) => h('button', { class: 'btn btn-sm' + (i === 0 ? ' btn-primary' : ''), type: 'button', onclick: () => signIn(a) }, list.length > 1 ? t('exp.signInRef', { ref: a.ref }) : t('exp.signIn')))))
8626
+ }
8627
+ function expiredBannerKept() {
8628
+ const old = $('banners').querySelector('[data-key="exp-banner"]')
8629
+ if (!old || old.dataset.gone || REDUCED) return null
8630
+ // Another render while it shrinks keeps it, so it is not cut short.
8631
+ if (old.dataset.leaving) return old
8632
+ old.dataset.leaving = '1'
8633
+ old.style.pointerEvents = 'none'
8634
+ old.animate(bannerFrames(old).reverse(), { duration: 180, easing: 'ease-in-out', fill: 'forwards' })
8635
+ setTimeout(() => { old.dataset.gone = '1'; renderBanners() }, 180)
8636
+ return old
8637
+ }
8638
+ function growExpiredBanner() {
8639
+ const el = $('banners').querySelector('[data-key="exp-banner"]:not([data-leaving])')
8640
+ if (el === exb.el) return
8641
+ if (el && exb.el !== undefined && !REDUCED) el.animate(bannerFrames(el), { duration: 180, easing: 'ease-out' })
8642
+ exb.el = el
8526
8643
  }
8527
8644
 
8528
8645
  // ---------- loading ----------
@@ -238,6 +238,8 @@ code, .mono { font-family: var(--mono); font-size: 12px; }
238
238
  /* A Same Login (spec §3.21, ADR-0026): one row; opened, a short line per directory. */
239
239
  .login-mark { display: inline-flex; flex: none; color: var(--muted); cursor: help; }
240
240
  .login-mark .ic { width: 13px; height: 13px; }
241
+ /* An Expired Login (ADR-0071): the word, then "Sign in again" beside it. */
242
+ .exp-badge { display: inline-flex; align-items: center; gap: 6px; flex: none; }
241
243
  .login-detail { flex-direction: column; gap: 8px; }
242
244
  .login-detail .rd-note { margin: 0; }
243
245
  .login-detail > .rd-browser { flex-direction: row; align-items: center; gap: 16px; }
@@ -891,6 +893,12 @@ ${UI_CSS}
891
893
  .pop-settings { width: 340px; }
892
894
  .set-group { display: flex; flex-direction: column; gap: 8px; }
893
895
  .set-check .set-label { white-space: normal; }
896
+ /* A row whose choices need the full width (the editor for settings files): the words on top, the choices below. */
897
+ .set-stack { flex-direction: column; align-items: flex-start; gap: 8px; }
898
+ /* Five choices do not fit a phone's width on one line: they wrap as whole buttons instead of breaking their labels. */
899
+ .set-stack .seg { flex-wrap: wrap; height: auto; max-width: 100%; }
900
+ .set-stack .seg-btn { height: calc(var(--ctl-h-sm) - 10px); white-space: nowrap; }
901
+ .set-stack .seg { max-width: 100%; overflow-x: auto; }
894
902
  .set-link .menu-label { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.3; }
895
903
  .set-link { height: auto; min-height: 32px; padding-top: 8px; padding-bottom: 8px; }
896
904
  .set-link .chip { flex: none; }
@@ -28,6 +28,13 @@ export interface PageOptions {
28
28
  ask?: {
29
29
  bridge: 'postMessage';
30
30
  };
31
+ /**
32
+ * createPanelHandler's `open`: with the bridge, inside a frame, "Open settings.json" posts the file's real path to
33
+ * the Portal, which opens it; opened on its own, the Panel's server opens it.
34
+ */
35
+ open?: {
36
+ bridge: 'postMessage';
37
+ };
31
38
  /** Config `panel` (spec §3.29): the theme and language saved for the Panel. */
32
39
  panel?: {
33
40
  theme?: string;
@@ -49,6 +49,7 @@ export function renderPage(opts) {
49
49
  readOnly: Boolean(opts.readOnly),
50
50
  updates: opts.updates !== false,
51
51
  ask: opts.ask ?? null,
52
+ open: opts.open ?? null,
52
53
  colorScheme: theme.colorScheme,
53
54
  lang,
54
55
  panel: opts.panel ?? {},
@@ -20,7 +20,7 @@ import { type TuneEntry, type TuneGroup } from './core/tuning.ts';
20
20
  import { type TuneApplyPlan, type TuneChange, type TuneUndoRecord } from './core/tuning-apply.ts';
21
21
  import { type UnattendedStatus } from './core/unattended.ts';
22
22
  import { type BuiltinPlugin, type LoadedPlugin, type PluginLoadError } from './plugins/loader.ts';
23
- import type { Account, AccountIdentity, Env, FamilyDef, LoginState, QuotaResult, QuotaSetupPlan, ReadContext, ShareMode, TuningResult, UnattendedEndedContext, UsageResult } from './types.ts';
23
+ import type { Account, AccountIdentity, Env, FamilyDef, LoginProblem, LoginState, QuotaResult, QuotaSetupPlan, ReadContext, ShareMode, TuningResult, UnattendedEndedContext, UsageResult } from './types.ts';
24
24
  export type { AccountIdentity, AccountRefError, DoctorHistory, Shell, ShellInitWrite };
25
25
  /** How `sideby resume` starts the Host (spec §3.15). */
26
26
  export interface ResumeLaunch {
@@ -137,6 +137,11 @@ export interface AccountStatus extends Account {
137
137
  hostInstalled: boolean;
138
138
  /** `not-needed` for API Accounts, which authenticate with their Secret File. */
139
139
  login: LoginState | 'not-needed';
140
+ /**
141
+ * Set when the Account is signed in but its Host has reported that the login expired (an Expired Login, ADR-0071).
142
+ * Only for Subscription Accounts of a Family that can tell.
143
+ */
144
+ loginProblem?: LoginProblem;
140
145
  model?: string;
141
146
  /** Who the Account is signed in as (email, organization), when its Family can tell. */
142
147
  identity?: AccountIdentity;
@@ -342,6 +347,16 @@ export interface Runtime {
342
347
  setDisplayOrder(display: DisplayConfig | undefined): Promise<DisplayConfig>;
343
348
  /** The other Accounts signed in as the same login as this one (spec §3.21), in discovery order; empty when none. */
344
349
  sameLogin(account: Account): Promise<string[]>;
350
+ /** The Account's Expired Login (ADR-0071), or undefined when it has none or its Family cannot tell. */
351
+ loginProblem(account: Account): Promise<LoginProblem | undefined>;
352
+ /**
353
+ * After a sign-in that sideby started finished with exit 0 (ADR-0071 Q9): remembers when, and asks the Account's
354
+ * Quota once when Quota checks are on, so a good answer clears an Expired Login. Returns what is left of it.
355
+ */
356
+ afterLogin(account: Account): Promise<{
357
+ loginProblem?: LoginProblem;
358
+ checked: boolean;
359
+ }>;
345
360
  usage(account: Account): Promise<UsageResult>;
346
361
  /** Estimated Compaction Threshold per model for one Account (spec §3.18); read-only. */
347
362
  tuning(account: Account): Promise<TuningResult>;
@@ -13,13 +13,15 @@ import { identityOf } from './core/identity.js';
13
13
  import { inboundFindings } from './core/inbound.js';
14
14
  import { mergeDoctorHistory, readDoctorHistory, writeDoctorHistory, } from './core/last-doctor.js';
15
15
  import { accountEnv, beforeDashes, brokenOnPath, launchCommand, prepareLaunch, which, } from './core/launch.js';
16
+ import { loginMarkFile, readLoginMark, writeLoginMark } from './core/login-mark.js';
16
17
  import { memoStore } from './core/memo-store.js';
17
18
  import { codexNetworkTrustLine, guardLaunch, guardOn, ipChangedLine, networkHookPart, networkOverview, networkSettingsLine, } from './core/network.js';
18
19
  import { resolvePaths } from './core/paths.js';
19
20
  import { choosePick, suggestPickName } from './core/pick-commands.js';
20
21
  import { categoryReader } from './core/project-categories.js';
21
- import { fetchedQuota, quotaCheckOff, shownQuota } from './core/quota-fetch.js';
22
+ import { fetchedQuota, loginProblemOf, quotaCheckOff, shownQuota, } from './core/quota-fetch.js';
22
23
  import { takeoverLimits } from './core/quota-levels.js';
24
+ import { quotaStoreFile, readQuotaStore } from './core/quota-store.js';
23
25
  import { remoteControlGroups, turnRemoteControlOff, turnRemoteControlOn, undoRemoteControlOff, } from './core/remote-control.js';
24
26
  import { findResumeRoute } from './core/resume.js';
25
27
  import { SAME_LOGIN_FAMILIES, sameLoginGroups, sharedQuota } from './core/same-login.js';
@@ -280,6 +282,34 @@ export async function createRuntime(opts = {}) {
280
282
  return 'unknown';
281
283
  }
282
284
  };
285
+ /**
286
+ * An Expired Login (ADR-0071): only for a signed-in Subscription Account of a Family that reads its Host's login
287
+ * records. A reader that throws counts as nothing known.
288
+ */
289
+ const loginProblemFor = async (a, login) => {
290
+ const f = families.get(a.family);
291
+ if (!f?.readLoginEvents || a.kind === 'api')
292
+ return undefined;
293
+ if ((login ?? (await loginOf(a))) !== 'logged-in')
294
+ return undefined;
295
+ const ctx = readContext();
296
+ await memos.ready();
297
+ let events;
298
+ try {
299
+ events = await f.readLoginEvents(a, ctx);
300
+ }
301
+ catch {
302
+ events = undefined;
303
+ }
304
+ finally {
305
+ memos.saveSoon();
306
+ }
307
+ const [kept, mark] = await Promise.all([
308
+ f.fetchQuota ? readQuotaStore(quotaStoreFile(ctx.stateDir, a.family, a.name)) : null,
309
+ readLoginMark(loginMarkFile(ctx.stateDir, a.family, a.name)),
310
+ ]);
311
+ return loginProblemOf(a.ref, events, kept, mark);
312
+ };
283
313
  /** A Family's one-time setup bound to this Runtime; a setup that throws is reported, never crashes the caller. */
284
314
  const bindSetup = (f, setup) => {
285
315
  // The message is the error's own text; setup implementations must not put file contents into it.
@@ -442,11 +472,13 @@ export async function createRuntime(opts = {}) {
442
472
  readIdentity(f, account),
443
473
  peersOf(account).catch(() => []),
444
474
  ]);
475
+ const loginProblem = account.kind === 'api' ? undefined : await loginProblemFor(account, login ?? 'unknown');
445
476
  return {
446
477
  ...account,
447
478
  familyTitle: f.title,
448
479
  hostInstalled: installed !== null,
449
480
  login: account.kind === 'api' ? 'not-needed' : (login ?? 'unknown'),
481
+ ...(loginProblem ? { loginProblem } : {}),
450
482
  ...(model ? { model } : {}),
451
483
  ...(identity ? { identity } : {}),
452
484
  ...(peers.length ? { sameLogin: peers.map((p) => p.ref) } : {}),
@@ -489,6 +521,7 @@ export async function createRuntime(opts = {}) {
489
521
  // Messages held in bypass permission mode (spec §3.32 step 2): the arguments the Account starts with.
490
522
  ...(await inboundFindings(a, startArgs(a))),
491
523
  ],
524
+ loginProblem: (a) => loginProblemFor(a),
492
525
  };
493
526
  // Auto Handoff warnings (spec §3.17) join the general Findings; they never fail Doctor.
494
527
  const all = await accounts();
@@ -881,6 +914,17 @@ export async function createRuntime(opts = {}) {
881
914
  async sameLogin(account) {
882
915
  return (await peersOf(account)).map((a) => a.ref);
883
916
  },
917
+ loginProblem: (account) => loginProblemFor(account),
918
+ async afterLogin(account) {
919
+ const f = familyOf(account.family);
920
+ const ctx = readContext();
921
+ await writeLoginMark(loginMarkFile(ctx.stateDir, account.family, account.name), ctx.now).catch(() => { });
922
+ const checked = account.kind !== 'api' && Boolean(f.fetchQuota) && quotaCheckOff(f.id, config, env) === null;
923
+ if (checked)
924
+ await ownQuota(account, 'force').catch(() => undefined);
925
+ const loginProblem = await loginProblemFor(account);
926
+ return { ...(loginProblem ? { loginProblem } : {}), checked };
927
+ },
884
928
  async usage(account) {
885
929
  const f = familyOf(account.family);
886
930
  if (!f.readUsage)
@@ -1001,12 +1045,15 @@ export async function createRuntime(opts = {}) {
1001
1045
  const [quotas, groups] = await Promise.all([quotasOf(list, o.fetch), groupsOf(list)]);
1002
1046
  const candidates = await Promise.all(list.map(async (a) => {
1003
1047
  const peers = groups.get(a.ref);
1048
+ const login = await loginOf(a);
1049
+ const loginProblem = await loginProblemFor(a, login);
1004
1050
  return {
1005
1051
  ref: a.ref,
1006
1052
  name: a.name,
1007
1053
  isMain: a.isMain,
1008
1054
  kind: a.kind,
1009
- login: await loginOf(a),
1055
+ login,
1056
+ ...(loginProblem ? { loginProblem } : {}),
1010
1057
  quota: quotas.get(a.ref),
1011
1058
  ...(peers ? { sameLogin: peers } : {}),
1012
1059
  };
@@ -1037,6 +1084,7 @@ export async function createRuntime(opts = {}) {
1037
1084
  loginOf(a),
1038
1085
  readIdentity(f, a),
1039
1086
  ]);
1087
+ const loginProblem = await loginProblemFor(a, login);
1040
1088
  let receive = false;
1041
1089
  try {
1042
1090
  receive = Boolean(f.handoff &&
@@ -1052,6 +1100,7 @@ export async function createRuntime(opts = {}) {
1052
1100
  isMain: a.isMain,
1053
1101
  kind: a.kind,
1054
1102
  login,
1103
+ ...(loginProblem ? { loginProblem } : {}),
1055
1104
  quota,
1056
1105
  ...(identity ? { identity } : {}),
1057
1106
  ...(peers ? { sameLogin: peers } : {}),
@@ -24,6 +24,31 @@ export interface FamilyLayout {
24
24
  account?: string;
25
25
  }
26
26
  export type LoginState = 'logged-in' | 'logged-out' | 'unknown';
27
+ /**
28
+ * A Subscription Account whose login file is still there but whose Host has reported that the login no longer works
29
+ * (an Expired Login, ADR-0071). `kind` is a closed set; `message` is sideby's own sentence, never the Host's text.
30
+ */
31
+ export interface LoginProblem {
32
+ kind: 'expired';
33
+ /** When the Host reported it (ISO time), not when a token ends. */
34
+ since?: string;
35
+ message: string;
36
+ /**
37
+ * When a sign-in that sideby started finished after `since` (ISO time) but nothing has confirmed it yet: no later
38
+ * successful turn or Quota answer. The Panel then says the sign-in finished and waits for confirmation.
39
+ */
40
+ signedInAt?: string;
41
+ }
42
+ /**
43
+ * What a Family's Host last wrote about its login (ADR-0071), as times only: never the Host's text, a token or a
44
+ * credential. sideby compares them with its own Quota answers to decide whether a login has expired.
45
+ */
46
+ export interface LoginEvents {
47
+ /** The newest record in which the Host said the login expired (ISO time). */
48
+ expiredAt?: string;
49
+ /** The newest record that shows the login working, such as a successful model turn (ISO time). */
50
+ workingAt?: string;
51
+ }
27
52
  /**
28
53
  * A Family's mark for the Panel: one SVG path in a 24x24 view box, drawn inline. sideby checks it when the
29
54
  * Plugin registers; an invalid logo is dropped with a plugin error and the Panel shows the Family's initials.
@@ -243,6 +268,13 @@ export interface FamilyDef {
243
268
  key: string;
244
269
  };
245
270
  loginState?(account: Account): Promise<LoginState>;
271
+ /**
272
+ * When the Host last said this Account's login expired, and when it last showed it working, from the Host's own
273
+ * records only (ADR-0071): never a token, the Keychain or an expiry field of a credential file. Called only for a
274
+ * signed-in Subscription Account; an error counts as nothing known. Without it the Family's logins never show as
275
+ * expired.
276
+ */
277
+ readLoginEvents?(account: Account, ctx: ReadContext): Promise<LoginEvents>;
246
278
  model?(account: Account): Promise<string | undefined>;
247
279
  /** Choosing the model and effort an Account starts with, as Host arguments (spec §3.19, ADR-0014). */
248
280
  modelChoice?: FamilyModelChoice;
@@ -456,6 +488,11 @@ export type QuotaResult = {
456
488
  status: 'unavailable';
457
489
  reason: QuotaUnavailableReason;
458
490
  detail?: string;
491
+ /**
492
+ * Set by a `fetchQuota` answer that clearly says the login expired or asks for a new sign-in (ADR-0071). A
493
+ * generic failure leaves it out.
494
+ */
495
+ loginExpired?: true;
459
496
  };
460
497
  export interface TokenTotals {
461
498
  inputTokens: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sideby",
3
- "version": "0.35.5",
3
+ "version": "0.35.7",
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)",
@@ -79,9 +79,9 @@
79
79
  "typebox": "^1.3.34"
80
80
  },
81
81
  "devDependencies": {
82
- "@biomejs/biome": "2.6.2",
82
+ "@biomejs/biome": "2.6.4",
83
83
  "@types/node": "^22.18.0",
84
- "motion": "14.5.0",
84
+ "motion": "14.7.1",
85
85
  "typescript": "^7.0.2"
86
86
  },
87
87
  "packageManager": "pnpm@10.15.0",
@@ -74,6 +74,17 @@
74
74
  "additionalProperties": false,
75
75
  "description": "The terminal AI Tasks open in (spec §3.28)."
76
76
  },
77
+ "editor": {
78
+ "type": "string",
79
+ "enum": [
80
+ "system",
81
+ "cursor",
82
+ "vscode",
83
+ "windsurf",
84
+ "zed"
85
+ ],
86
+ "description": "The editor `sideby edit` and the Panel open an account’s settings file with: `system` (the default) uses the system’s default program; `cursor`, `vscode`, `windsurf` and `zed` start that editor."
87
+ },
77
88
  "ask": {
78
89
  "type": "object",
79
90
  "properties": {
package/schemas/edit.json CHANGED
@@ -52,6 +52,10 @@
52
52
  },
53
53
  "description": "The program and arguments that opened the file."
54
54
  },
55
+ "editor": {
56
+ "type": "string",
57
+ "description": "What opened it: `system` (the default program) or the editor from config `editor` or `--with`."
58
+ },
55
59
  "_notice": {
56
60
  "type": "object",
57
61
  "properties": {
package/schemas/list.json CHANGED
@@ -152,6 +152,30 @@
152
152
  }
153
153
  ]
154
154
  },
155
+ "loginProblem": {
156
+ "type": "object",
157
+ "required": [
158
+ "kind",
159
+ "message"
160
+ ],
161
+ "properties": {
162
+ "kind": {
163
+ "type": "string",
164
+ "const": "expired"
165
+ },
166
+ "since": {
167
+ "type": "string"
168
+ },
169
+ "message": {
170
+ "type": "string"
171
+ },
172
+ "signedInAt": {
173
+ "type": "string",
174
+ "description": "When a sign-in sideby started finished after `since`, with nothing confirming it yet: the Panel says the sign-in finished and waits for confirmation."
175
+ }
176
+ },
177
+ "description": "An Expired Login (ADR-0071): the account is signed in (`login` stays `logged-in`) but its host has reported that the login expired, with no later successful turn or quota answer. `since` is when the host reported it, `message` is sideby's own sentence. Absent when the login is not known to be expired; only Claude Code accounts are checked for now."
178
+ },
155
179
  "model": {
156
180
  "type": "string"
157
181
  },
package/schemas/next.json CHANGED
@@ -144,6 +144,24 @@
144
144
  "sameLoginAs": {
145
145
  "type": "string",
146
146
  "description": "The current account (`from`), when this one is signed in as the same login: it shares that quota and is never picked."
147
+ },
148
+ "skip": {
149
+ "type": "object",
150
+ "required": [
151
+ "reason",
152
+ "command"
153
+ ],
154
+ "properties": {
155
+ "reason": {
156
+ "type": "string",
157
+ "const": "login-expired"
158
+ },
159
+ "command": {
160
+ "type": "string",
161
+ "description": "The command that fixes it: `sideby login <account>`."
162
+ }
163
+ },
164
+ "description": "Set when the account is never picked for a reason its state does not show: `login-expired`, its sign-in expired (ADR-0071)."
147
165
  }
148
166
  }
149
167
  },
@@ -2,7 +2,7 @@
2
2
  name: sideby
3
3
  description: Use when the user runs, or wants to run, several AI coding accounts (Claude Code, Codex, Grok Build, pi) side by side. Covers installing sideby and setting up a new account ("install sideby", "set up another Claude account", "add cc008", "配置一个 cc00x", "再加一个 Codex 账号"), explaining what accounts share and what stays separate ("what do my accounts share?", "这些账号共享了什么"), showing which account a session is ("show [cc001] in the status line", "加上账号标识"), finding a past session of any account ("找一下我上周改登录页的那个会话"), telling another running session something, in any account ("告诉 cc002 ……", "给跑构建的那个会话发消息"; Claude Code's own SendMessage reaches only sessions of the same account), seeing accounts, quota and usage, moving on when one hits its 5-hour or weekly limit, moving the current task to another account ("用 cc008 继续", "交回 cc008"), adding a short command (alias) or a pick command that starts whichever account has the most quota ("加个 cc"), adding an API account from a vendor's docs ("加一个 DeepSeek API 账号"), supporting a new tool, and repairing drifted account directories (skills, hooks, rules or settings not shared, wrong symlinks, credential file permissions). Drives the `sideby` CLI with `--json`; the agent does every step except browser sign-in, filling in secrets and starting interactive sessions, which it hands to the user as one command (inside an Auto Handoff session, `sideby handoff ready --to` moves the task itself).
4
4
  metadata:
5
- version: "0.35.5"
5
+ version: "0.35.7"
6
6
  requires:
7
7
  bins: [sideby, node]
8
8
  cliHelp: sideby --help
@@ -48,6 +48,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
48
48
  | See every session from inside Claude Code ("在这里看所有会话", "show my sessions in Claude Code"), or turn off the label line and `/sessions` pane sideby adds to Claude Code ("关掉 sideby 的横带", "turn off the sideby mod") | tell the user to type `/sessions`; `sideby config set claudeMod false --json` (or `true`) | `references/sessions.md` |
49
49
  | Know what accounts share and what stays separate | `sideby families <family> --json` | `references/sharing.md` |
50
50
  | See accounts, health, quota and usage | `sideby list --json`, `sideby doctor --json`, `sideby quota --json` | `references/diagnose.md` |
51
+ | Check whose sign-in expired ("which login expired", "哪个账号登录过期了", "登录过期", "Login reached its time limit", "Please run /login") | `sideby list --json` (`loginProblem`), `sideby doctor --json` (`login.expired`) | `references/diagnose.md` |
51
52
  | Pin accounts or arrange their Display Order | `sideby order --json`, `sideby pin <ref> --json`, `sideby unpin <ref> --json` | `references/panel.md` |
52
53
  | Hide or show a tool or an account in the lists ("too many shown", "hide pi") | `sideby hide <family\|ref> --json`, `sideby unhide <family\|ref> --json`, `sideby list --all` | `references/panel.md` |
53
54
  | Turn quota checks on or off, or fix outdated Codex/Grok quota | `sideby quota check <family> on|off --json`, `sideby quota [family] --refresh --json` | `references/quota.md` |
@@ -63,6 +64,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
63
64
  | Turn on Auto Handoff ("自动接力", "自动交接", "hand over when quota runs low"), see what it still needs, hand this session over now, or pick an account with room for a subtask | `sideby handoff status --json`, `sideby handoff enable --json` (exit 10 first), `sideby handoff ready`, `sideby next <family> --json` | `references/handoff.md` |
64
65
  | Explain or change the handoff rules ("接力规则", "什么时候换号", "让 Codex 接 Claude", "别用 API 账号接力") | `sideby handoff rules --json`, `sideby config set handoff.<key> <value>` or `sideby handoff enable --other-ai/--api --json` (exit 10 first) | `references/handoff.md` |
65
66
  | Sign an account in again or switch it to another login ("换个账号登录", "两个目录登录的是同一个号", "sign claude:work in with another account") | `sideby list --json` (`identity`, `sameLogin`), then give the user `sideby login <ref>` | `references/accounts.md` |
67
+ | Sign in again an account whose sign-in expired ("re-login cc003", "重新登录 cc003", "登录过期了帮我重新登录") | `sideby list --json` (`loginProblem`), then give the user `sideby login <ref>` | `references/accounts.md` |
66
68
  | Create an account with a given name, an API account, or a short command | `sideby new`, `sideby alias add` | `references/accounts.md` |
67
69
  | Rename or remove a short command ("把别名 cc-relay 改成 relay") | `sideby alias rename <old> <new> --json`, `sideby alias rm <short> --json` | `references/accounts.md` |
68
70
  | One command that always starts the account with the most quota left ("加个 cc", "自动挑额度最多的账号启动", "start whichever has room") | `sideby alias add <short> --pick <family> --json` (exit 10 first), `sideby alias list --json` | `references/accounts.md` |
@@ -95,7 +97,7 @@ To open Claude Desktop or the Codex app as one account (macOS, subscription acco
95
97
 
96
98
  Grok Bot is not a grok account's app: it signs in with a Cursor account, apart from Grok Build. For several Grok Bot windows at once, run `sideby desktop grok-bot:<name> --json` (a new name makes a new, signed-out window; `grok-bot` is its default one) and relay the notice: sign in inside the new window with the account meant for it, with the other Grok Bot windows closed. `sideby list --json` lists them under `appProfiles`. Removing one (`--remove --yes`) signs it out and deletes its data: do it only when the user asks, after they quit that window.
97
99
 
98
- To let the user look at or change one account's own Host settings (`settings.json` for claude and pi, `config.toml` for codex and grok), run `sideby edit <ref> --json`: it opens the file in their default editor and reads none of it. Relay `sharedWith`: a linked file is the main account's, so a change applies to those accounts too. Use `--path` when you only need where the file is. Never print the file's content back: Claude's `settings.json` may hold API keys under `env`.
100
+ To let the user look at or change one account's own Host settings (`settings.json` for claude and pi, `config.toml` for codex and grok), run `sideby edit <ref> --json`: it opens the file in their default editor and reads none of it. Relay `sharedWith`: a linked file is the main account's, so a change applies to those accounts too. Use `--path` when you only need where the file is. If the user says the editor opened but the file did not (or wants another editor), set the editor with `sideby config set editor cursor --json` (or `vscode`, `windsurf`, `zed`; `system` is the default program; see references/panel.md), or open once with `sideby edit <ref> --with <editor> --json`. Never print the file's content back: Claude's `settings.json` may hold API keys under `env`.
99
101
 
100
102
  To find which Chrome browser user the user signed in to an account's website with, or to open claude.ai, chatgpt.com or grok.com there, run `sideby browser --json` and `sideby browser open <ref> --json`. Finding is off until the user agrees: run `sideby browser --enable` to show them what it reads (all on this computer), and add `--yes` only after they say yes. To stop reading Browser Sign-ins, use `sideby browser --disable --json`, show its preview, then add `--yes` after approval. A match may be left over from before a sign-out; say so. When the user says the browser user is wrong ("codex:main 应该是 Profile 7"), run `sideby browser set <ref> <folder|name> --json` (it writes only sideby's config, no confirmation needed); `sideby browser set <ref> --auto --json` lets sideby find it again. When nothing is found, use `set` or `--profile <name>`. A plugin tool has a website only when its plugin sets `website` in its FamilyDef (`docs/guide/plugins.md`); add it there, with `match` when the website keeps an id the tool's login file also has.
101
103