sideby 0.40.0 → 0.41.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.
@@ -1776,6 +1776,28 @@ const en = {
1776
1776
  'pr.everyToast': 'Progress updates now every {n} minutes.',
1777
1777
  'pr.offToast': 'Progress updates off.',
1778
1778
  'pr.failed': 'Could not change progress updates: {msg}. It is back as it was; try again, or run sideby progress in a terminal.',
1779
+ 'ai.ask.trust': 'Stop Claude asking whether I trust a folder in one account when another of my accounts already trusts it.',
1780
+ 'tr.title': 'Folder trust',
1781
+ 'tr.hint': 'Claude Code asks each account once whether you trust a folder, and pressing Enter at that question ends the session. sideby can reuse the answer you already gave in another account.',
1782
+ 'tr.switch': 'Reuse trust from my other Claude accounts',
1783
+ 'tr.what': 'Before sideby starts a Claude session in a folder this account has not trusted yet, it copies the trust another of your Claude accounts already gave that folder, so Claude Code does not ask again.',
1784
+ 'tr.only': 'It only reuses trust you already gave. A folder none of your accounts trusted still asks, as before.',
1785
+ 'tr.offKeeps': 'Turning it off keeps the trust already copied; you can take it back here.',
1786
+ 'tr.carried.one': 'sideby copied trust once',
1787
+ 'tr.carried.other': 'sideby copied trust {n} times',
1788
+ 'tr.review': 'Review',
1789
+ 'tr.undoIntro': 'Removing these makes Claude Code ask again in these folders:',
1790
+ 'tr.undoRow': '{account} · {path} · from {from}',
1791
+ 'tr.changed': 'changed since; left as it is',
1792
+ 'tr.gone': 'its file is gone',
1793
+ 'tr.remove': 'Remove',
1794
+ 'tr.nothing': 'Nothing left to remove: each one changed since sideby copied it.',
1795
+ 'tr.removed.one': 'Removed 1 copied trust.',
1796
+ 'tr.removed.other': 'Removed {n} copied trusts.',
1797
+ 'tr.notRemoved': 'Some could not be changed: {msg}',
1798
+ 'tr.onToast': 'Folder trust is reused now. Claude accounts sideby starts no longer ask where another account trusts the folder.',
1799
+ 'tr.offToast': 'Folder trust is no longer reused. What was copied stays.',
1800
+ 'tr.failed': 'Could not change folder trust: {msg}. Try again, or run sideby trust in a terminal.',
1779
1801
  };
1780
1802
  const zh = {
1781
1803
  'top.tagline': '所有 AI 编程账号,并排运行。',
@@ -3552,5 +3574,27 @@ const zh = {
3552
3574
  'pr.everyToast': '进度提醒改为每 {n} 分钟一次。',
3553
3575
  'pr.offToast': '已关闭进度提醒。',
3554
3576
  'pr.failed': '没能改进度提醒:{msg}。已恢复原样;可以再试一次,或在终端运行 sideby progress。',
3577
+ 'ai.ask.trust': '我的一个 Claude 账号已经信任过的文件夹,别让其他账号再问我信不信任。',
3578
+ 'tr.title': '文件夹信任',
3579
+ 'tr.hint': 'Claude Code 会在每个账号里问一次你是否信任某个文件夹,在这个问题上直接按回车会结束会话。sideby 可以沿用你在另一个账号里已经给过的回答。',
3580
+ 'tr.switch': '沿用我其他 Claude 账号的信任',
3581
+ 'tr.what': 'sideby 在某个账号还没信任过的文件夹里启动 Claude 会话前,把你另一个 Claude 账号对这个文件夹的信任复制过来,Claude Code 就不会再问。',
3582
+ 'tr.only': '只沿用你已经给过的信任。你哪个账号都没信任过的文件夹,照样会问。',
3583
+ 'tr.offKeeps': '关掉后,已经复制的信任会保留;可以在这里撤回。',
3584
+ 'tr.carried.one': 'sideby 复制过 1 次信任',
3585
+ 'tr.carried.other': 'sideby 复制过 {n} 次信任',
3586
+ 'tr.review': '查看',
3587
+ 'tr.undoIntro': '移除后,Claude Code 会在这些文件夹里重新询问:',
3588
+ 'tr.undoRow': '{account} · {path} · 来自 {from}',
3589
+ 'tr.changed': '之后改过,保持原样',
3590
+ 'tr.gone': '文件已不在',
3591
+ 'tr.remove': '移除',
3592
+ 'tr.nothing': '没有可移除的:每一条在复制后都改过。',
3593
+ 'tr.removed.one': '已移除 1 条复制的信任。',
3594
+ 'tr.removed.other': '已移除 {n} 条复制的信任。',
3595
+ 'tr.notRemoved': '有几条没能改:{msg}',
3596
+ 'tr.onToast': '已开始沿用文件夹信任。sideby 启动的 Claude 账号,在别的账号信任过的文件夹里不再询问。',
3597
+ 'tr.offToast': '已不再沿用文件夹信任。已经复制的保留。',
3598
+ 'tr.failed': '没能改文件夹信任:{msg}。可以再试一次,或在终端运行 sideby trust。',
3555
3599
  };
3556
3600
  export const MESSAGES = { en, zh };
@@ -7059,6 +7059,82 @@ const MAIN = String.raw `
7059
7059
  out.push(h('p', { class: 'small' }, h('button', { class: 'link-btn small', type: 'button', 'data-key': 'pr-ask', onclick: () => openAsk({ text: t('ai.ask.progress') }) }, t('adv.ask'))))
7060
7060
  return out
7061
7061
  }
7062
+ // Carried trust (spec §3.43, ADR-0078): the switch writes config claude.carryTrust at once (the words beside it say
7063
+ // what it does) and the toast offers the way back. The trust sideby copied is listed behind Review, read from
7064
+ // sideby's own records, and goes only after the list is shown and Remove is pressed.
7065
+ const tu = { open: false, busy: false, items: null, error: null }
7066
+ async function setTrust(on) {
7067
+ const tr = S.state && S.state.trust
7068
+ if (!tr) return
7069
+ const was = tr.on
7070
+ S.state.trust = Object.assign({}, tr, { on })
7071
+ refreshSettings()
7072
+ try {
7073
+ await api('/api/trust/settings', { on, confirm: true })
7074
+ toast(t(on ? 'tr.onToast' : 'tr.offToast'), { kind: 'ok', action: { label: t('toast.undo'), run: () => setTrust(was) }, duration: 8000 })
7075
+ } catch (e) {
7076
+ S.state.trust = Object.assign({}, S.state.trust, { on: was })
7077
+ refreshSettings()
7078
+ toast(t('tr.failed', { msg: e.message }), { kind: 'fail' })
7079
+ }
7080
+ load({ silent: true })
7081
+ }
7082
+ // The list is read before it opens, so it opens at its full size.
7083
+ async function trustReview() {
7084
+ if (tu.open) { tu.open = false; refreshSettings(); return }
7085
+ if (tu.busy) return
7086
+ Object.assign(tu, { busy: true, items: null, error: null })
7087
+ refreshSettings()
7088
+ try { tu.items = (await api('/api/trust/undo', {})).items } catch (e) { tu.error = e.message }
7089
+ Object.assign(tu, { busy: false, open: true })
7090
+ refreshSettings()
7091
+ }
7092
+ async function trustRemove() {
7093
+ tu.busy = true
7094
+ refreshSettings()
7095
+ try {
7096
+ const shown = (tu.items || []).map((x) => ({ id: x.id, at: x.at }))
7097
+ const items = (await api('/api/trust/undo', { confirm: true, items: shown })).items
7098
+ const done = items.filter((x) => x.status === 'undone').length
7099
+ const stuck = items.filter((x) => x.status === 'blocked' || x.status === 'busy')
7100
+ if (stuck.length) toast(t('tr.notRemoved', { msg: stuck.map((x) => x.why || x.path).join('; ') }), { kind: 'fail' })
7101
+ else toast(tn('tr.removed', done))
7102
+ Object.assign(tu, { open: false, items: null })
7103
+ } catch (e) { toast(t('tr.notRemoved', { msg: e.message }), { kind: 'fail' }) }
7104
+ tu.busy = false
7105
+ refreshSettings()
7106
+ load({ silent: true })
7107
+ }
7108
+ function trustItems() {
7109
+ const tr = S.state.trust
7110
+ const label = t('tr.switch')
7111
+ const out = [fm('trust', h('div', { class: 'set-row', 'data-patch': '' },
7112
+ h('span', { class: 'set-label' }, label),
7113
+ BOOT.readOnly ? h('span', { class: 'chip chip-sm' + (tr.on ? ' chip-ok' : '') }, tr.on ? t('ah.on') : t('ah.off'))
7114
+ : h('div', { class: 'seg', role: 'group', 'aria-label': label, 'data-patch': '' }, [[true, t('ah.on')], [false, t('ah.off')]].map(([v, text]) =>
7115
+ h('button', { class: 'seg-btn', type: 'button', 'aria-pressed': String(v === tr.on), onclick: () => { if (v !== tr.on) setTrust(v) } }, text)))))]
7116
+ out.push(h('ul', { class: 'pr-notes' }, h('li', null, t('tr.what')), h('li', null, t('tr.only')), h('li', null, t('tr.offKeeps'))))
7117
+ if (tr.carried.length) {
7118
+ out.push(h('div', { class: 'set-row', 'data-patch': '' },
7119
+ h('span', { class: 'set-label' }, tn('tr.carried', tr.carried.length)),
7120
+ BOOT.readOnly ? null : h('button', { class: 'link-btn small', type: 'button', 'aria-expanded': String(tu.open), 'aria-busy': tu.busy && !tu.open ? 'true' : null, 'data-key': 'tr-review', onclick: trustReview }, t('tr.review'))))
7121
+ const items = tu.items || []
7122
+ const todo = items.filter((x) => x.status === 'undo')
7123
+ const body = tu.error ? [h('p', { class: 'small' }, t('tr.notRemoved', { msg: tu.error }))]
7124
+ : [h('p', { class: 'small' }, todo.length ? t('tr.undoIntro') : t('tr.nothing')),
7125
+ h('ul', { class: 'pr-notes' }, items.map((x) => h('li', null, t('tr.undoRow', { account: x.account, path: x.path, from: x.from }),
7126
+ x.status === 'undo' ? null : h('span', { class: 'muted' }, ' · ', t(x.status === 'gone' ? 'tr.gone' : x.status === 'changed' ? 'tr.changed' : 'tr.notRemoved', { msg: x.why || '' }))))),
7127
+ h('div', { class: 'row-actions', 'data-patch': '' },
7128
+ h('button', { class: 'btn btn-sm', type: 'button', disabled: tu.busy || !todo.length, 'aria-busy': tu.busy ? 'true' : null, onclick: trustRemove }, t('tr.remove')),
7129
+ h('button', { class: 'link-btn small', type: 'button', disabled: tu.busy, onclick: trustReview }, t('btn.cancel')))]
7130
+ if (!BOOT.readOnly)
7131
+ out.push(h('div', { class: 'reveal' + (tu.open ? ' is-open' : ''), 'data-patch': '', 'data-key': 'tr-undo', inert: tu.open ? undefined : true },
7132
+ h('div', { class: 'reveal-in', 'data-patch': '' }, body)))
7133
+ }
7134
+ if (!BOOT.readOnly && !askBridged(BOOT, window))
7135
+ out.push(h('p', { class: 'small' }, h('button', { class: 'link-btn small', type: 'button', 'data-key': 'tr-ask', onclick: () => openAsk({ text: t('ai.ask.trust') }) }, t('adv.ask'))))
7136
+ return out
7137
+ }
7062
7138
  function famTitleOf(fam) { const f = S.state && S.state.families.find((x) => x.id === fam); return f ? f.title : fam }
7063
7139
  // ---------- settings ----------
7064
7140
  // One header button holds what is set once and rarely changed: language, theme, Remote Control and Auto Handoff.
@@ -7076,6 +7152,7 @@ const MAIN = String.raw `
7076
7152
  if (S.state && (S.state.quotaChecks || []).length) out.push('checks')
7077
7153
  if (S.state && S.state.network) out.push('net')
7078
7154
  if (S.state && S.state.progress) out.push('progress')
7155
+ if (S.state && S.state.trust) out.push('trust')
7079
7156
  return out
7080
7157
  }
7081
7158
  function renderSettingsButton() {
@@ -7190,6 +7267,7 @@ const MAIN = String.raw `
7190
7267
  { id: 'quota', title: t('set.g.quota'), items: checks, foot: t('set.quotaChecksHint', { n: every }) },
7191
7268
  { id: 'handoff', title: t('ah.button'), items: [ahLink(leave)].filter(Boolean), foot: t('set.ahHint') },
7192
7269
  { id: 'progress', title: t('pr.title'), items: secs.includes('progress') ? progressItems() : [], foot: t('pr.hint') },
7270
+ { id: 'trust', title: t('tr.title'), items: secs.includes('trust') ? trustItems() : [], foot: t('tr.hint') },
7193
7271
  { id: 'network', title: t('net.title'), items: netItems, foot: t('net.hint') },
7194
7272
  { id: 'ai', title: t('set.g.ai'), items: ai, foot: t('set.aiHint') },
7195
7273
  ].filter((g) => g.items.length)
@@ -7891,7 +7969,7 @@ const MAIN = String.raw `
7891
7969
  return Boolean(u && u.skillUpdate && u.skillUpdate.installed && u.skillUpdate.installed.length)
7892
7970
  }
7893
7971
  // Example phrases: a click puts one in the Let AI do it box (spec §3.28).
7894
- const AI_ASKS = ['ai.ask.quota', 'ai.ask.reset', '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.advisor', 'ai.ask.network', 'ai.ask.unattended', 'ai.ask.progress', 'ai.ask.theme', 'ai.ask.find', 'ai.ask.commands', 'ai.ask.tool']
7972
+ const AI_ASKS = ['ai.ask.quota', 'ai.ask.reset', '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.advisor', 'ai.ask.trust', 'ai.ask.network', 'ai.ask.unattended', 'ai.ask.progress', 'ai.ask.theme', 'ai.ask.find', 'ai.ask.commands', 'ai.ask.tool']
7895
7973
  // Network Guard (spec §3.35): one dialog with the switch, the allowed countries and the newest result per address.
7896
7974
  // Countries are never ticked for the user, the current one included: a wrong network would allow itself.
7897
7975
  const NET_COMMON = ['US', 'JP', 'SG', 'GB', 'DE', 'FR', 'NL', 'CA', 'AU', 'KR', 'TW', 'HK']
@@ -1,5 +1,6 @@
1
1
  import { type AccountRefError } from './core/accounts.ts';
2
2
  import { type AdvisorChange, type AdvisorChoice, type AdvisorSeen, type AdvisorStatus } from './core/advisor.ts';
3
+ import { type TrustStatus, type UndoItem } from './core/claude-trust.ts';
3
4
  import { type Config, type DisplayConfig, type HandoffSettings } from './core/config.ts';
4
5
  import { type CreateResult } from './core/create.ts';
5
6
  import { type DesktopDeps } from './core/desktop-app.ts';
@@ -450,6 +451,29 @@ export interface Runtime {
450
451
  unlock: boolean;
451
452
  message: string;
452
453
  }>;
454
+ /**
455
+ * Carried trust (spec §3.43, ADR-0078): config `claude.carryTrust` and the carries sideby recorded; with `dir` while
456
+ * it is on, each Claude Account's trust of that folder (booleans only). While it is off no `.claude.json` is read.
457
+ */
458
+ trustStatus(dir?: string): Promise<TrustStatus>;
459
+ /** Turns config `claude.carryTrust` on or off; without `apply`, only says what would change. */
460
+ trustSet(on: boolean, opts: {
461
+ apply: boolean;
462
+ }): Promise<{
463
+ changed: boolean;
464
+ applied: boolean;
465
+ before: boolean;
466
+ after: boolean;
467
+ file: string;
468
+ }>;
469
+ /** Takes back the trust marks sideby copied, only where each still holds what sideby wrote; `apply` false previews. */
470
+ trustUndo(opts: {
471
+ apply: boolean;
472
+ only?: readonly {
473
+ id: string;
474
+ at: string;
475
+ }[];
476
+ }): Promise<UndoItem[]>;
453
477
  /**
454
478
  * Which Account of a Family to move on to (spec §3.13), for a start the user asks for: past the Takeover Limit it
455
479
  * falls back to the least used Account under 100% (`tight`). Throws a UserError with code `no-quota-source`
@@ -513,4 +537,12 @@ export declare function createRuntime(opts?: {
513
537
  limitReset?: {
514
538
  timeoutMs?: number;
515
539
  };
540
+ /**
541
+ * Internal, for tests: the folder a Launch starts in (the Host inherits sideby's own) and where a carry's line goes
542
+ * (spec §3.43). Omitted, `process.cwd()` and stderr. Not part of the plugin or Portal contract.
543
+ */
544
+ trust?: {
545
+ cwd?: () => string;
546
+ print?: (line: string) => void;
547
+ };
516
548
  }): Promise<Runtime>;
@@ -1,7 +1,8 @@
1
1
  // The one service layer the CLI and the Panel share. Frozen contract for v0.1 (plan: 审核修订).
2
2
  import { aliasesByAccount, discoverAccounts, resolveRef, startArgsOf, } from './core/accounts.js';
3
3
  import { advisorStatus, checkAdvisorAccount, setAdvisor, setAdvisorUnlock, undoAdvisor, } from './core/advisor.js';
4
- import { addConfigAlias, addConfigPickCommand, aiTaskPermissions, aliasAccount, aliasArgs, aliasProblem, aliasRefs, editConfigDisplay, editConfigQuotaCheck, handoffSettings, loadConfig, removeConfigAlias, removeConfigPickCommand, } from './core/config.js';
4
+ import { carryLine, carryTrust, trustStatus, undoCarries, } from './core/claude-trust.js';
5
+ import { addConfigAlias, addConfigPickCommand, aiTaskPermissions, aliasAccount, aliasArgs, aliasProblem, aliasRefs, editConfigClaude, editConfigDisplay, editConfigQuotaCheck, handoffSettings, loadConfig, removeConfigAlias, removeConfigPickCommand, } from './core/config.js';
5
6
  import { createAccount } from './core/create.js';
6
7
  import { bindDesktopDeps, checkAppData } from './core/desktop-app.js';
7
8
  import { applyFixes, runDoctor } from './core/doctor.js';
@@ -39,6 +40,7 @@ import { codexUnattendedTrustLine, UNATTENDED_FAMILIES, unattendedFamilyLine, un
39
40
  import { UNATTENDED_ENV } from './core/unattended-state.js';
40
41
  import { inCi } from './core/update.js';
41
42
  import { packageVersion } from './core/version.js';
43
+ import { claudeJsonOf } from './families/claude/index.js';
42
44
  import { withClaudeMod } from './families/claude/mod.js';
43
45
  import { BUILTIN_PLUGINS } from './families/index.js';
44
46
  import { LOGIN_KEY_READERS } from './families/login-keys.js';
@@ -94,6 +96,32 @@ export async function createRuntime(opts = {}) {
94
96
  const categories = loaded.categories && categoryReader(loaded.categories.def, loaded.categories.owner);
95
97
  const ignore = new Set(config.ignore ?? []);
96
98
  const now = opts.now ?? (() => new Date());
99
+ /** Where trust is read and written (spec §3.43): every Claude Account sideby knows, by the Family's own path rule. */
100
+ const trustCtx = (all) => ({
101
+ accounts: all.filter((a) => a.family === 'claude'),
102
+ jsonOf: claudeJsonOf,
103
+ home: paths.home,
104
+ stateDir: paths.stateDir,
105
+ });
106
+ const printTrust = opts.trust?.print ?? ((line) => void process.stderr.write(`sideby: ${line}\n`));
107
+ /**
108
+ * Config `claude.carryTrust` on a Claude session about to start (spec §3.43, ADR-0078): copies another Account's trust
109
+ * of the folder when this one has none. Printed at once, not as a notice: Auto Handoff may prepare a Launch twice.
110
+ * Nothing it meets stops the Launch.
111
+ */
112
+ const carryAtLaunch = async (target, all) => {
113
+ // Inside text too: a reason names a path in the middle of a sentence.
114
+ const show = (p) => p.split(`${paths.home}/`).join('~/');
115
+ try {
116
+ const r = await carryTrust(trustCtx(all), target, opts.trust?.cwd?.() ?? process.cwd(), { now: now() });
117
+ const line = carryLine(r, target.ref, show);
118
+ if (line)
119
+ printTrust(line);
120
+ }
121
+ catch (err) {
122
+ printTrust(`could not carry folder trust to ${target.ref}: ${show(err.message)}. Claude Code will ask whether you trust this folder`);
123
+ }
124
+ };
97
125
  /** Adds lines to what a Launch prints before it starts. */
98
126
  const addNotice = (p, lines) => {
99
127
  const notice = [p.notice, ...lines].filter(Boolean).join('\n');
@@ -1057,6 +1085,12 @@ export async function createRuntime(opts = {}) {
1057
1085
  // Network Guard (spec §3.35) and Unattended Mode (§3.37): last, on the environment the Host gets, so the check
1058
1086
  // takes the Host's route.
1059
1087
  await sessionReady(p, command === 'run', opts);
1088
+ // Carried trust (spec §3.43): only once nothing refused the Launch, for a session a person works in.
1089
+ if (command === 'run' &&
1090
+ p.family.id === 'claude' &&
1091
+ config.claude?.carryTrust === true &&
1092
+ !claudeHeadless(p.args))
1093
+ await carryAtLaunch(p.account, all);
1060
1094
  return p;
1061
1095
  },
1062
1096
  async unattendedStatus() {
@@ -1561,6 +1595,30 @@ export async function createRuntime(opts = {}) {
1561
1595
  await reloadAdvisorConfig();
1562
1596
  return r;
1563
1597
  },
1598
+ async trustStatus(dir) {
1599
+ const fresh = await loadConfig(paths.configFile).catch(() => null);
1600
+ if (fresh)
1601
+ config.claude = fresh.claude;
1602
+ return trustStatus(trustCtx(await accounts()), config.claude?.carryTrust === true, dir);
1603
+ },
1604
+ async trustSet(on, o) {
1605
+ const r = await editConfigClaude(paths.configFile, (c) => {
1606
+ if (on)
1607
+ return { ...c, carryTrust: true };
1608
+ const { carryTrust: _drop, ...rest } = c;
1609
+ return Object.keys(rest).length ? rest : undefined;
1610
+ }, { dryRun: !o.apply });
1611
+ if (o.apply && r.changed)
1612
+ config.claude = r.after;
1613
+ return {
1614
+ changed: r.changed,
1615
+ applied: o.apply && r.changed,
1616
+ before: r.before?.carryTrust === true,
1617
+ after: r.after?.carryTrust === true,
1618
+ file: paths.configFile,
1619
+ };
1620
+ },
1621
+ trustUndo: (o) => undoCarries(paths.stateDir, { apply: o.apply, ...(o.only ? { only: o.only } : {}) }),
1564
1622
  async advisorUnlock(on) {
1565
1623
  const r = await setAdvisorUnlock(paths.configFile, on);
1566
1624
  await reloadAdvisorConfig();
@@ -1699,3 +1757,18 @@ export async function createRuntime(opts = {}) {
1699
1757
  bindDesktopDeps(rt, opts.desktop);
1700
1758
  return rt;
1701
1759
  }
1760
+ /**
1761
+ * Whether Claude's arguments ask for a headless run: `-p`/`--print`, also inside a group of short flags such as `-cp`
1762
+ * (Claude Code's option parser reads `-cp` as `-c -p`). Before the first `--` only.
1763
+ */
1764
+ function claudeHeadless(args) {
1765
+ if (hasOption(args, ['-p', '--print']))
1766
+ return true;
1767
+ for (const a of args) {
1768
+ if (a === '--')
1769
+ return false;
1770
+ if (/^-[A-Za-z]{2,}$/.test(a) && a.includes('p'))
1771
+ return true;
1772
+ }
1773
+ return false;
1774
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sideby",
3
- "version": "0.40.0",
3
+ "version": "0.41.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)",
@@ -86,5 +86,5 @@
86
86
  },
87
87
  "packageManager": "pnpm@10.15.0",
88
88
  "readmeFilename": "README.md",
89
- "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 # optional: live Claude quota while a session runs; 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 and each tool's own CLI. | `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 every account's quota (no setup) | `sideby quota` | [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| Stop Claude and Codex when your requests would leave from a country you did not allow, for example when the proxy stopped | **Settings › Network check** in the panel, or `sideby network on` | [Network check](docs/guide/usage.md#network-check) |\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, put tools and accounts in your own order, and hide the ones you never use | `sideby pin claude:work`, `sideby order`, `sideby hide grok` (or the panel's Settings) | [Your own order](docs/guide/usage.md#your-own-order) |\n| Give the panel other colors: five built-in Themes, your own color, or one your AI writes | **Settings › Theme** in the panel, or `sideby theme use leaf` | [Themes](docs/guide/panel.md#themes) |\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` | ✓ | ✓ |\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"
89
+ "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, pi and Antigravity CLI.\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, pi or Antigravity CLI) 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 # optional: live Claude quota while a session runs; 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 and each tool's own CLI. | `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 every account's quota (no setup) | `sideby quota` | [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| Stop Claude and Codex when your requests would leave from a country you did not allow, for example when the proxy stopped | **Settings › Network check** in the panel, or `sideby network on` | [Network check](docs/guide/usage.md#network-check) |\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, put tools and accounts in your own order, and hide the ones you never use | `sideby pin claude:work`, `sideby order`, `sideby hide grok` (or the panel's Settings) | [Your own order](docs/guide/usage.md#your-own-order) |\n| Give the panel other colors: five built-in Themes, your own color, or one your AI writes | **Settings › Theme** in the panel, or `sideby theme use leaf` | [Themes](docs/guide/panel.md#themes) |\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` | ✓ | ✓ |\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"
90
90
  }
@@ -424,10 +424,14 @@
424
424
  "apiBetasOff": {
425
425
  "type": "boolean",
426
426
  "description": "Give Claude API accounts `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` when sideby starts them, for gateways that reject Claude Code's `anthropic-beta` headers. The account's own proxy.env and a value already in the environment win. Off by default; `sideby advisor <model>` turns it on when it removes that variable from a settings file API accounts share."
427
+ },
428
+ "carryTrust": {
429
+ "type": "boolean",
430
+ "description": "Carry folder trust between Claude accounts (spec §3.43, ADR-0078): before sideby starts an interactive Claude session in a folder this account has not trusted yet, when another Claude account of yours already trusts it (the folder, a parent folder outside any git repository, or the repository's main checkout), sideby copies that one trust mark (`projects[\"<path>\"].hasTrustDialogAccepted`) into this account's `.claude.json`, so Claude Code does not ask again. It never adds trust no account gave. Off by default; turning it off does not remove marks already copied (`sideby trust undo` does)."
427
431
  }
428
432
  },
429
433
  "additionalProperties": false,
430
- "description": "Claude Code launches (spec §3.41, ADR-0074)."
434
+ "description": "Claude Code launches (spec §3.41, ADR-0074; `carryTrust`: spec §3.43, ADR-0078)."
431
435
  },
432
436
  "unattended": {
433
437
  "type": "object",
@@ -0,0 +1,117 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "sideby/trust-set.json",
4
+ "type": "object",
5
+ "required": [
6
+ "schemaVersion",
7
+ "action",
8
+ "on",
9
+ "changed",
10
+ "applied",
11
+ "before",
12
+ "after",
13
+ "file"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "type": "number",
18
+ "const": 1
19
+ },
20
+ "action": {
21
+ "anyOf": [
22
+ {
23
+ "type": "string",
24
+ "const": "on"
25
+ },
26
+ {
27
+ "type": "string",
28
+ "const": "off"
29
+ }
30
+ ]
31
+ },
32
+ "on": {
33
+ "type": "boolean",
34
+ "description": "Whether config `claude.carryTrust` is on now."
35
+ },
36
+ "changed": {
37
+ "type": "boolean"
38
+ },
39
+ "applied": {
40
+ "type": "boolean",
41
+ "description": "False when only the change was shown; run again with --yes (exit 10)."
42
+ },
43
+ "before": {
44
+ "type": "boolean"
45
+ },
46
+ "after": {
47
+ "type": "boolean"
48
+ },
49
+ "file": {
50
+ "type": "string",
51
+ "description": "The config file changed."
52
+ },
53
+ "_notice": {
54
+ "type": "object",
55
+ "properties": {
56
+ "update": {
57
+ "type": "object",
58
+ "required": [
59
+ "current",
60
+ "latest",
61
+ "command",
62
+ "message"
63
+ ],
64
+ "properties": {
65
+ "current": {
66
+ "type": "string"
67
+ },
68
+ "latest": {
69
+ "type": "string"
70
+ },
71
+ "command": {
72
+ "type": "string",
73
+ "description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
74
+ },
75
+ "message": {
76
+ "type": "string"
77
+ }
78
+ }
79
+ },
80
+ "skill": {
81
+ "type": "object",
82
+ "required": [
83
+ "installed",
84
+ "current",
85
+ "command",
86
+ "message"
87
+ ],
88
+ "properties": {
89
+ "installed": {
90
+ "anyOf": [
91
+ {
92
+ "type": "string"
93
+ },
94
+ {
95
+ "type": "null"
96
+ }
97
+ ],
98
+ "description": "The skill's version; null when it has none."
99
+ },
100
+ "current": {
101
+ "type": "string"
102
+ },
103
+ "command": {
104
+ "type": "string",
105
+ "description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
106
+ },
107
+ "message": {
108
+ "type": "string"
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "description": "Not the answer to the task: mention it briefly afterwards and offer to update."
114
+ }
115
+ },
116
+ "title": "sideby trust on|off --json"
117
+ }