sideby 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +1 -0
  2. package/dist/build.json +1 -1
  3. package/dist/src/cli/commands.js +115 -10
  4. package/dist/src/cli/format.js +3 -2
  5. package/dist/src/cli/json-schemas.js +81 -46
  6. package/dist/src/cli/main.js +6 -3
  7. package/dist/src/core/accounts.d.ts +6 -1
  8. package/dist/src/core/accounts.js +16 -3
  9. package/dist/src/core/ask.d.ts +2 -1
  10. package/dist/src/core/ask.js +6 -3
  11. package/dist/src/core/claude-settings-file.d.ts +57 -0
  12. package/dist/src/core/claude-settings-file.js +104 -2
  13. package/dist/src/core/config.d.ts +29 -15
  14. package/dist/src/core/config.js +40 -2
  15. package/dist/src/core/create.js +4 -1
  16. package/dist/src/core/desktop-app.js +5 -1
  17. package/dist/src/core/handoff-overview.d.ts +4 -1
  18. package/dist/src/core/handoff-overview.js +3 -2
  19. package/dist/src/core/handoff-rules.d.ts +34 -0
  20. package/dist/src/core/handoff-rules.js +115 -0
  21. package/dist/src/core/handoff-select.js +45 -28
  22. package/dist/src/core/handoff-status.d.ts +37 -7
  23. package/dist/src/core/handoff-status.js +95 -19
  24. package/dist/src/core/handoff.d.ts +4 -1
  25. package/dist/src/core/handoff.js +8 -5
  26. package/dist/src/core/inbound.d.ts +11 -3
  27. package/dist/src/core/inbound.js +26 -74
  28. package/dist/src/core/launch.js +6 -4
  29. package/dist/src/core/quota-levels.d.ts +6 -0
  30. package/dist/src/core/quota-levels.js +8 -0
  31. package/dist/src/core/remote-control.d.ts +10 -12
  32. package/dist/src/core/remote-control.js +29 -86
  33. package/dist/src/core/tuning-apply.js +12 -20
  34. package/dist/src/families/agy/index.d.ts +8 -0
  35. package/dist/src/families/agy/index.js +53 -0
  36. package/dist/src/families/agy/quota.d.ts +9 -0
  37. package/dist/src/families/agy/quota.js +110 -0
  38. package/dist/src/families/index.js +7 -0
  39. package/dist/src/families/logos.d.ts +10 -0
  40. package/dist/src/families/logos.js +12 -1
  41. package/dist/src/menubar/script.js +26 -3
  42. package/dist/src/menubar/snapshot.d.ts +23 -6
  43. package/dist/src/menubar/snapshot.js +126 -39
  44. package/dist/src/menubar/strings.d.ts +12 -2
  45. package/dist/src/menubar/strings.js +12 -2
  46. package/dist/src/panel/handler.d.ts +2 -1
  47. package/dist/src/panel/handler.js +81 -45
  48. package/dist/src/panel/i18n.d.ts +58 -7
  49. package/dist/src/panel/i18n.js +158 -56
  50. package/dist/src/panel/page-logic.d.ts +52 -19
  51. package/dist/src/panel/page-logic.js +47 -7
  52. package/dist/src/panel/page-script.js +333 -115
  53. package/dist/src/panel/page-styles.js +112 -21
  54. package/dist/src/panel/page.js +3 -3
  55. package/dist/src/plugins/check.js +27 -13
  56. package/dist/src/plugins/loader.d.ts +11 -0
  57. package/dist/src/plugins/loader.js +47 -1
  58. package/dist/src/runtime.d.ts +5 -2
  59. package/dist/src/runtime.js +12 -5
  60. package/dist/src/types.d.ts +35 -5
  61. package/package.json +2 -2
  62. package/schemas/config.json +16 -1
  63. package/schemas/families.json +8 -5
  64. package/schemas/handoff-disable.json +22 -0
  65. package/schemas/handoff-enable.json +22 -0
  66. package/schemas/handoff-rules.json +302 -0
  67. package/schemas/handoff-status.json +26 -0
  68. package/schemas/list.json +5 -0
  69. package/schemas/menubar-snapshot.json +309 -2
  70. package/skills/sideby/SKILL.md +3 -2
  71. package/skills/sideby/references/accounts.md +1 -0
  72. package/skills/sideby/references/handoff.md +7 -3
  73. package/skills/sideby/references/quota.md +2 -0
@@ -429,6 +429,7 @@ const en = {
429
429
  'ai.ask.pin': 'Pin claude:work to the top.',
430
430
  'ai.ask.fix': 'Check my accounts and fix what they should share.',
431
431
  'ai.ask.handoff': 'Turn on Auto Handoff.',
432
+ 'ai.ask.handoffRules': 'When does Auto Handoff switch accounts, and could it use my API accounts?',
432
433
  'ai.ask.rc': 'Turn off Remote Control for every Claude account.',
433
434
  'ai.ask.relogin': 'Two of my accounts are the same login; help me sign one in with another account.',
434
435
  'ai.orderHint': 'or ask your AI',
@@ -739,52 +740,93 @@ const en = {
739
740
  'md.saved': 'Saved. New sessions of {ref} use it.',
740
741
  'page.handoff': 'Auto Handoff',
741
742
  'hp.title': 'Auto Handoff',
743
+ 'hp.statusOn': 'Auto Handoff is on',
744
+ 'hp.statusOff': 'Auto Handoff is off',
742
745
  'hp.advanced': 'Advanced settings',
743
746
  'hp.loading': 'Checking…',
744
- 'hp.intro': 'When an account is about to run out of quota, your work moves to the next account by itself. You do not have to do anything.',
745
- 'hp.how1': 'You keep working in a session you started with sideby (a short command such as cc001, or sideby run).',
746
- 'hp.how2': 'When that account reaches {p}% of its quota, sideby has the AI write a short note about the task and ends the session.',
747
- 'hp.how3': 'After a {s}-second countdown (Enter cancels), the next account starts in the same terminal and carries on from the note.',
748
- 'hp.noStarters': 'None of your accounts can start a hand-over yet. Add a Claude, Codex or Grok account first.',
749
- 'hp.sameFamily': 'Also switch between accounts of the same tool (for example cc001 to cc002)',
747
+ 'hp.intro': 'When an account runs low on quota, the AI writes a handoff note. The next account takes over in the same terminal. You do not have to do anything.',
748
+ 'hp.noStarters': 'None of your accounts can start a handoff yet. Add a Claude, Codex or Grok account first.',
749
+ 'hp.sameFamily': 'Also switch between accounts of the same AI (for example cc001 to cc002)',
750
750
  'hp.turnOn': 'Turn on Auto Handoff',
751
751
  'hp.turnOff': 'Turn off',
752
752
  'hp.willDo': 'To turn it on, sideby will:',
753
753
  'hp.step.config': 'Switch Auto Handoff on in sideby’s settings',
754
- 'hp.step.quota': 'Turn on {host} quota display (hand-over needs it to know how much is used)',
755
- 'hp.step.hook': 'Add sideby’s hand-over hook to {host}',
754
+ 'hp.step.quota': 'Show {host} quota (Auto Handoff needs it to track usage)',
755
+ 'hp.step.hook': 'Add sideby’s handoff hook to {host}',
756
756
  'hp.step.copy': 'Copy the hook file into your other {host} accounts ({accounts}); nothing else in them changes',
757
757
  'hp.showChange': 'Show the change',
758
- 'hp.sameFamilyOffNote': 'Accounts of the same tool will not switch between each other. You can turn that on later on this page.',
758
+ 'hp.sameFamilyOffNote': 'Accounts of the same AI will not take over from each other. You can turn this on later on this page.',
759
759
  'hp.manual.codexTrust': 'Codex asks once per account to trust sideby’s hooks. Type /hooks in Codex the first time and trust them; sideby reminds you then.',
760
760
  'hp.blocked': 'It cannot be turned on yet: {why}',
761
761
  'hp.confirmOn': 'Confirm and turn on',
762
762
  'hp.applying': 'Turning on…',
763
763
  'hp.stepFailed': 'Stopped at: {step}. {why}',
764
764
  'hp.tryAgain': 'Nothing after it was changed. Try again, or ask for help.',
765
- 'hp.onNote': 'When an account reaches {p}% of its quota, its session moves to the next account by itself.',
765
+ 'hp.onNote': 'Sessions you start with sideby move to the next account by themselves, following the rules below.',
766
766
  'hp.takeover': 'Where work goes next',
767
767
  'hp.used': '{p}% used',
768
768
  'hp.noQuota': 'quota unknown',
769
- 'hp.goesTo': 'at {p}% it moves to {to}',
769
+ 'hp.goesTo': 'moves to {to}',
770
770
  'hp.goesToLimit': 'when it hits its usage limit it moves to {to}',
771
771
  'hp.waits': 'at the limit it waits: quota is back at {at}',
772
- 'hp.waitRule': 'If its quota comes back within {w} minutes at that point, it waits instead of switching.',
773
772
  'hp.planChanged': 'Something changed since you looked, so sideby has not changed anything yet. This is what it would do now; confirm again.',
774
773
  'hp.none': 'no account can take over right now',
775
774
  'hp.noneBack': 'no account can take over now; {ref} is back at {at}',
776
- 'hp.noAccounts': 'No subscription account can start a hand-over.',
777
- 'hp.recent': 'Recent hand-overs',
775
+ 'hp.noAccounts': 'No subscription account can start a handoff.',
776
+ 'hp.recent': 'Recent handoffs',
778
777
  'hp.noneYet': 'None yet. The next time an account runs low you will see it here.',
779
- 'hp.why.threshold': 'quota reached the hand-over level',
778
+ 'hp.why.threshold': 'quota reached the handoff level',
780
779
  'hp.why.limit': 'it hit its usage limit',
781
780
  'hp.why.manual': 'handed over on request',
782
781
  'hp.missing': 'One step left',
783
782
  'hp.complete': 'Finish setting up',
784
783
  'hp.onlySideby': 'Only sessions started with sideby hand over (a short command such as cc001, or sideby run). Typing claude directly does not.',
785
784
  'hp.sameConfirm': 'Switch it on',
786
- 'hp.sameOn': 'Same-tool hand-over is on.',
787
- 'hp.sameOff': 'Same-tool hand-over is off.',
785
+ 'hp.sameOn': 'Same-AI handoff is on.',
786
+ 'hp.sameOff': 'Same-AI handoff is off.',
787
+ 'hp.takeoverIf': 'If a handoff started now',
788
+ 'hp.rules': 'Hand-over rules',
789
+ 'hp.rulesNote': 'These rules decide when an account hands over and which account takes over. Each change applies at once and can be undone.',
790
+ 'hp.rule.whenAdaptive': 'The AI writes a handoff note at {prepare}% used. Handoff starts at {p}% used until sideby learns how fast this session spends quota, then between {prepare}% and {max}%, earlier if recent turns used a lot.',
791
+ 'hp.rule.when': 'The AI writes a handoff note at {prepare}% used. Handoff starts at {p}% used.',
792
+ 'hp.rule.windows': 'Every quota window counts (5 hours, weekly, a billing period): the fullest one decides. No AI has a daily quota.',
793
+ 'hp.rule.takeover': 'Accounts already over {limit}% used will not take over, so the next account has room to work. This stays 10 points below the handoff level ({p}%).',
794
+ 'hp.rule.wait': 'If the quota comes back within {w} minutes and the session carries on by itself at that point (Claude Code), it waits instead of switching. Codex and Grok switch right away.',
795
+ 'hp.rule.noWait': 'It never waits for quota to come back; it switches right away.',
796
+ 'hp.rule.sameOn': 'Other accounts of the same AI can take over first (for example cc001 to cc002). The account with the most quota left goes first.',
797
+ 'hp.rule.sameOff': 'Other accounts of the same AI do not take over.',
798
+ 'hp.rule.otherOn': 'When the same AI has no accounts left to take over, another AI does, in the order below. The account with the most quota left goes first.',
799
+ 'hp.rule.otherOff': 'Other AIs do not take over (for example Claude Code to Codex).',
800
+ 'hp.rule.apiOn': 'API accounts take over last, when no subscription account can. They are billed per use; sideby cannot limit the spend.',
801
+ 'hp.rule.apiOff': 'API accounts do not take over: they are billed per use.',
802
+ 'hp.rule.org': 'An account signed in to another organization (team, company) does not take over.',
803
+ 'hp.rule.orgExcept': 'An account signed in to another organization (team, company) does not take over, except {refs}.',
804
+ 'hp.rule.order': 'From {host}, accounts are tried in your order: {order}.',
805
+ 'hp.rule.countdown': 'Before the next account starts, a {s}-second countdown runs; Enter cancels it.',
806
+ 'hp.rule.noCountdown': 'The next account starts right away, without a countdown.',
807
+ 'hp.on': 'On',
808
+ 'hp.off': 'Off',
809
+ 'hp.edit': 'Change…',
810
+ 'hp.adaptive': 'Adjust the timing to recent use',
811
+ 'hp.adaptiveOn': 'The handoff timing now follows recent use.',
812
+ 'hp.adaptiveOff': 'Handoff now always happens at the set quota level.',
813
+ 'hp.otherFamilies': 'Let other AIs take over',
814
+ 'hp.otherOn': 'Other AIs can now take over.',
815
+ 'hp.otherOff': 'Other AIs will not take over.',
816
+ 'hp.aiOrderSaved': 'Order saved.',
817
+ 'hp.api': 'Let API accounts take over',
818
+ 'hp.apiOn': 'API accounts may take over last.',
819
+ 'hp.apiOff': 'API accounts no longer take over.',
820
+ 'hp.noApi': 'You have no API account yet.',
821
+ 'hp.apiWarn': 'API accounts are billed for every request. sideby cannot see or limit what you spend: set a monthly limit in your provider’s console first.',
822
+ 'hp.apiConfirm': 'Allow API accounts',
823
+ 'hp.apiAskTitle': 'Should API accounts still take over?',
824
+ 'hp.apiAskBody': 'They used to take over by themselves when quota ran out. They are billed per use, so now they only do when you allow it.',
825
+ 'hp.apiKeepOff': 'Keep them out',
826
+ 'hp.apiKeepOn': 'Let them take over',
827
+ 'hp.apiKeptOff': 'API accounts stay out of handoffs.',
828
+ 'hp.undone': 'Changed back.',
829
+ 'hp.noneAll': 'No account can take over right now. Turn on rule 5 (same AI) or rule 6 (other AIs) in the rules below.',
788
830
  'page.accounts': 'Accounts',
789
831
  'page.tuning': 'Context tuning',
790
832
  'page.sessions': 'Sessions',
@@ -855,6 +897,7 @@ const en = {
855
897
  'hist.unfold': 'Open {n} folded groups',
856
898
  'hist.fold': 'Fold',
857
899
  'hist.unfoldOne': 'Unfold',
900
+ 'hist.catMove': 'Click to fold; drag, or Alt+arrow keys, to move',
858
901
  'hist.day.today': 'Today',
859
902
  'hist.day.yesterday': 'Yesterday',
860
903
  'hist.day.week': 'Previous {n} days',
@@ -990,8 +1033,6 @@ const en = {
990
1033
  'inb.state.default': 'Not set',
991
1034
  'inb.state.refuse': 'Turned off',
992
1035
  'inb.state.cannot': 'Cannot change',
993
- 'inb.change': '{from} → "accept"',
994
- 'inb.notSet': 'not set',
995
1036
  'inb.confirmNote': 'Choose "Receive directly" so messages arrive on their own. Only this one setting changes; sessions already running pick it up when they restart. You can undo it.',
996
1037
  'inb.accept': 'Receive directly',
997
1038
  'inb.undo': 'Undo last change',
@@ -1016,6 +1057,8 @@ const en = {
1016
1057
  'tune.hostDefaultRange': 'Default ({lo}–{hi} by model)',
1017
1058
  'tune.best': 'Suggested',
1018
1059
  'tune.saved': 'Expected to use about {n}% fewer tokens (an estimate).',
1060
+ 'tune.savedLabel': 'Saves about',
1061
+ 'tune.savedValue': '{n}%',
1019
1062
  'tune.compactions.one': 'It compacted once, when the conversation reached about {size}.',
1020
1063
  'tune.compactions.other': 'It compacted {n} times, usually when the conversation reached about {size}.',
1021
1064
  'tune.noCompactions': 'It did not compact in this period.',
@@ -1063,6 +1106,7 @@ const en = {
1063
1106
  'nf.accounts.other': '{n} accounts',
1064
1107
  'nf.runOnce': 'Run {bin} once first',
1065
1108
  'nf.notInstalled': 'Not installed',
1109
+ 'nf.mainOnly': 'Main account only for now: it keeps one sign-in per computer',
1066
1110
  'nf.broken': 'Install broken',
1067
1111
  'nf.name': 'Name',
1068
1112
  'nf.namePh': 'name',
@@ -1101,19 +1145,19 @@ const en = {
1101
1145
  'ah.on': 'On',
1102
1146
  'ah.off': 'Off',
1103
1147
  'ah.title': 'Auto Handoff',
1104
- 'ah.intro': 'When a session that sideby started runs low on quota, it writes a handoff brief, sideby ends it, and the next account carries on in the same terminal. Off by default.',
1148
+ 'ah.intro': 'When a session that sideby started runs low on quota, it writes a handoff note, sideby ends it, and the next account carries on in the same terminal. Off by default.',
1105
1149
  'ah.auto': 'Hand over when quota runs low',
1106
- 'ah.sameFamily': 'Also hand over between accounts of the same tool',
1107
- 'ah.sameFamilyWarn': 'Moving work between subscriptions of one vendor to get past a limit may break its terms; the risk is yours.',
1108
- 'ah.prepareAt': 'Start the brief at (%)',
1150
+ 'ah.sameFamily': 'Also hand over between accounts of the same AI',
1151
+ 'ah.sameFamilyWarn': 'Switching between accounts of the same vendor to bypass limits may violate its terms. Use at your own risk.',
1152
+ 'ah.prepareAt': 'Write handoff note at (%)',
1109
1153
  'ah.threshold': 'Hand over at (%)',
1110
- 'ah.wait': 'Wait if it resets within (min)',
1154
+ 'ah.wait': 'Wait if quota resets within (min)',
1111
1155
  'ah.countdown': 'Countdown before switching (s)',
1112
- 'ah.badLevels': 'Start the brief below the hand-over level.',
1156
+ 'ah.badLevels': 'Start the handoff note below the handoff level.',
1113
1157
  'ah.order': '{host} hands over to',
1114
1158
  'ah.byQuota': 'Most quota left',
1115
1159
  'ah.myOrder': 'My order',
1116
- 'ah.byQuotaHint': 'Its own accounts with the most quota left (when same-tool hand-over is on), then API accounts.',
1160
+ 'ah.byQuotaHint': 'Accounts of the same AI with the most quota left (when same-AI handoff is on), then API accounts.',
1117
1161
  'ah.add': 'Add account',
1118
1162
  'ah.up': 'Move up',
1119
1163
  'ah.down': 'Move down',
@@ -1131,9 +1175,11 @@ const en = {
1131
1175
  'ah.nothing': 'Nothing to change.',
1132
1176
  'ah.saved': 'Saved to {file}.',
1133
1177
  'ah.changes': 'This changes {file}:',
1134
- 'ah.hint': '{ref} is at {p}% of its quota. Sessions can hand their task to another account by themselves when quota runs low.',
1178
+ 'ah.hint': '{ref} is at {p}% quota. Sessions can hand their task to another account automatically when quota runs low.',
1135
1179
  'ah.setUp': 'Set up',
1136
1180
  'ah.dismiss': 'Not now',
1181
+ 'ah.crossOrg': 'Other organizations',
1182
+ 'ah.crossOrgHint': 'Accounts checked here may take over even when signed in to another organization than the account that runs out.',
1137
1183
  'toast.ahOn': 'Auto Handoff is on for sessions you start with sideby.',
1138
1184
  'toast.ahOff': 'Auto Handoff is off.',
1139
1185
  'qs.title': 'Turn on {host} quota',
@@ -1157,11 +1203,11 @@ const en = {
1157
1203
  'rc.hidden': 'Hidden in this browser. sideby remote-control off turns it off later.',
1158
1204
  'rc.readOnly': 'Run sideby remote-control off to turn it off.',
1159
1205
  'rc.confirmTitle': 'Turn off Remote Control at startup?',
1160
- 'rc.change': 'remoteControlAtStartup {from} → {to}',
1161
1206
  'rc.notSet': 'not set',
1162
1207
  'rc.usedBy': 'used by {refs}',
1163
1208
  'rc.confirmNote': 'Running sessions stay connected until you restart them. You can still start it in a session with /remote-control.',
1164
1209
  'rc.confirm': 'Turn off',
1210
+ 'rc.skipped': 'Not changed: ',
1165
1211
  'rc.done': 'Remote Control is off for new sessions. Restart sessions that are running.',
1166
1212
  'rc.failed': 'Could not turn it off: {msg}',
1167
1213
  'set.button': 'Settings',
@@ -1280,8 +1326,13 @@ const en = {
1280
1326
  'rc.state.off': 'Off',
1281
1327
  'rc.state.missing': 'No settings file',
1282
1328
  'rc.state.blocked': 'Cannot read',
1329
+ 'settings.why.no-settings': 'This account has no settings.json. Run sideby doctor --fix so it shares the main one, then try again.',
1330
+ 'settings.why.broken-link': 'settings.json links to a file that does not exist. Run sideby doctor to see how to fix it.',
1331
+ 'settings.why.unsafe': 'settings.json cannot be changed safely. Fix or move the file, then try again.',
1332
+ 'settings.why.refuse': 'You set it to refuse, so sideby leaves it alone and Messages to these sessions need pasting. To get them, set "crossSessionInbound": "accept" in this file yourself.',
1333
+ 'settings.why.other': 'It holds a value sideby does not know, so sideby leaves it alone. Set "crossSessionInbound" to "accept" in this file yourself, or remove the key and try again.',
1283
1334
  'rc.dialogTitle': 'Remote Control at startup',
1284
- 'rc.explain': 'When it is on, each new Claude session connects to claude.ai and the Claude app, where every device signed in to that account can read it. Default leaves it to Claude Code or your organization.',
1335
+ 'rc.explain': 'When it is on, each new Claude session connects to claude.ai and the Claude app, where every device signed in to that account can read it. Where it is not set (Left to Claude Code), Claude Code or your organization decides.',
1285
1336
  'rc.allOff': 'Off everywhere. You can still start it in a session with /remote-control, or switch it on above.',
1286
1337
  'rc.undo': 'Undo last change',
1287
1338
  'rc.switch': 'New sessions start it by themselves',
@@ -1724,6 +1775,7 @@ const zh = {
1724
1775
  'ai.ask.pin': '把 claude:work 置顶。',
1725
1776
  'ai.ask.fix': '检查一下我的账号,把该共享的修好。',
1726
1777
  'ai.ask.handoff': '帮我开启自动接力。',
1778
+ 'ai.ask.handoffRules': '自动接力什么时候换号?会不会用到我的 API 账号?',
1727
1779
  'ai.ask.rc': '把所有 Claude 账号的远程控制关掉。',
1728
1780
  'ai.ask.relogin': '我有两个账号登录的是同一个号,帮我把其中一个换成别的账号。',
1729
1781
  'ai.orderHint': '也可以让 AI 帮你排',
@@ -2034,52 +2086,93 @@ const zh = {
2034
2086
  'md.saved': '已保存,{ref} 的新会话会用它。',
2035
2087
  'page.handoff': '自动接力',
2036
2088
  'hp.title': '自动接力',
2089
+ 'hp.statusOn': '自动接力已开启',
2090
+ 'hp.statusOff': '自动接力未开启',
2037
2091
  'hp.advanced': '高级设置',
2038
2092
  'hp.loading': '检查中…',
2039
- 'hp.intro': '账号额度快用完时,你的工作会自动换到下一个账号接着做,不用你操心。',
2040
- 'hp.how1': '你照常在用 sideby 启动的会话里工作(短命令如 cc001,或 sideby run)。',
2041
- 'hp.how2': '这个账号用到 {p}% 时,sideby 让 AI 写一份任务小结,然后结束这个会话。',
2042
- 'hp.how3': '倒计时 {s} 秒后(按回车可取消),下一个账号在同一个终端里按小结接着做。',
2093
+ 'hp.intro': '账号额度快用完时,AI 会写好接力笔记。下一个账号在同一个终端里接着做,你不用做任何事。',
2043
2094
  'hp.noStarters': '你的账号里还没有能发起接力的。先添加一个 Claude、Codex 或 Grok 账号。',
2044
- 'hp.sameFamily': '同一个工具的账号之间也切换(例如 cc001 到 cc002)',
2095
+ 'hp.sameFamily': '同一个 AI 的账号之间也换(例如 cc001 到 cc002)',
2045
2096
  'hp.turnOn': '开启自动接力',
2046
2097
  'hp.turnOff': '关闭',
2047
2098
  'hp.willDo': '开启时 sideby 会:',
2048
2099
  'hp.step.config': '在 sideby 的设置里打开自动接力',
2049
- 'hp.step.quota': '打开 {host} 的额度显示(接力要靠它知道用了多少)',
2100
+ 'hp.step.quota': '打开 {host} 的额度显示(自动接力需要查看当前用量)',
2050
2101
  'hp.step.hook': '给 {host} 装上 sideby 的接力钩子',
2051
2102
  'hp.step.copy': '把钩子文件复制到你的其他 {host} 账号({accounts}),它们的其他文件不动',
2052
2103
  'hp.showChange': '查看改动',
2053
- 'hp.sameFamilyOffNote': '同一个工具的账号之间不会互相切换,之后可以在本页打开。',
2104
+ 'hp.sameFamilyOffNote': '同一个 AI 的账号之间不会互相接力。你之后可以在本页开启。',
2054
2105
  'hp.manual.codexTrust': 'Codex 每个账号第一次要信任 sideby 的钩子:第一次启动时在 Codex 里输入 /hooks 并信任,到时 sideby 会提醒你。',
2055
2106
  'hp.blocked': '暂时不能开启:{why}',
2056
2107
  'hp.confirmOn': '确认开启',
2057
2108
  'hp.applying': '正在开启…',
2058
2109
  'hp.stepFailed': '停在这一步:{step}。{why}',
2059
2110
  'hp.tryAgain': '它之后的步骤没有执行。可以重试,或找人帮忙。',
2060
- 'hp.onNote': '任一账号用到 {p}% 时,它的会话会自动换到下一个账号。',
2111
+ 'hp.onNote': '用 sideby 启动的会话会按下面的规则自动换到下一个账号。',
2061
2112
  'hp.takeover': '接下来会交给谁',
2062
2113
  'hp.used': '已用 {p}%',
2063
2114
  'hp.noQuota': '额度未知',
2064
- 'hp.goesTo': '到 {p}% 时交给 {to}',
2065
- 'hp.goesToLimit': '撞到用量上限时交给 {to}',
2115
+ 'hp.goesTo': '交给 {to}',
2116
+ 'hp.goesToLimit': '用量达到上限时交给 {to}',
2066
2117
  'hp.waits': '到上限时会等待:{at} 额度恢复',
2067
- 'hp.waitRule': '如果那时离额度恢复不到 {w} 分钟,就原地等,不换号。',
2068
2118
  'hp.planChanged': '你查看之后设置有了变化,所以还没有改任何东西。下面是现在要做的改动,请再确认一次。',
2069
2119
  'hp.none': '现在没有能接手的账号',
2070
2120
  'hp.noneBack': '现在没有能接手的账号;{ref} 在 {at} 恢复',
2071
2121
  'hp.noAccounts': '没有能发起接力的订阅账号。',
2072
2122
  'hp.recent': '最近的接力',
2073
2123
  'hp.noneYet': '还没有。下次有账号额度快用完时,这里会出现记录。',
2074
- 'hp.why.threshold': '额度到了接力线',
2124
+ 'hp.why.threshold': '用量达到了设定的接力比例',
2075
2125
  'hp.why.limit': '撞到了用量上限',
2076
2126
  'hp.why.manual': '按你的要求接力',
2077
2127
  'hp.missing': '还差一步',
2078
2128
  'hp.complete': '补全设置',
2079
2129
  'hp.onlySideby': '只有用 sideby 启动的会话才会接力(短命令如 cc001,或 sideby run)。直接敲 claude 启动的不会。',
2080
2130
  'hp.sameConfirm': '确认打开',
2081
- 'hp.sameOn': '已开启同工具接力。',
2082
- 'hp.sameOff': '已关闭同工具接力。',
2131
+ 'hp.sameOn': '已开启同一个 AI 接力。',
2132
+ 'hp.sameOff': '已关闭同一个 AI 接力。',
2133
+ 'hp.takeoverIf': '如果现在接力',
2134
+ 'hp.rules': '接力规则',
2135
+ 'hp.rulesNote': '这些规则决定什么时候接力、交给哪个账号。每项改动立即生效,可以撤销。',
2136
+ 'hp.rule.whenAdaptive': '用量到 {prepare}% 时,AI 会写好接力笔记。sideby 了解本次会话的消耗速度前,会在用量到 {p}% 时接力;之后会在 {prepare}% 到 {max}% 之间接力,最近几轮用得多就更早接力。',
2137
+ 'hp.rule.when': '用量到 {prepare}% 时,AI 会写好接力笔记;用量到 {p}% 时接力。',
2138
+ 'hp.rule.windows': '每个额度窗口都算(5 小时、每周、计费周期),以用得最多的那个为准。目前没有 AI 设日额度。',
2139
+ 'hp.rule.takeover': '用量超过 {limit}% 的账号不会接手,确保下一个账号有足够额度干活。这条线始终比接力用量({p}%)低 10 个百分点。',
2140
+ 'hp.rule.wait': '如果 {w} 分钟内额度就恢复,而且会话到时会自己继续(Claude Code),就原地等,不换号。Codex 和 Grok 直接换号。',
2141
+ 'hp.rule.noWait': '不等额度恢复,直接换号。',
2142
+ 'hp.rule.sameOn': '同一个 AI 的其他账号优先接手(例如 cc001 到 cc002),剩余额度最多的优先。',
2143
+ 'hp.rule.sameOff': '同一个 AI 的其他账号不接手。',
2144
+ 'hp.rule.otherOn': '同一个 AI 没有可用账号时,按下方顺序交给其他 AI。其中剩余额度最多的账号优先。',
2145
+ 'hp.rule.otherOff': '其他 AI 不接手(例如 Claude Code 换到 Codex)。',
2146
+ 'hp.rule.apiOn': '没有订阅账号能接手时,最后交给 API 账号。API 按用量计费,sideby 管不了花费上限。',
2147
+ 'hp.rule.apiOff': 'API 账号不接手,因为它按用量计费。',
2148
+ 'hp.rule.org': '登录在其他组织(团队、公司)的账号不接手。',
2149
+ 'hp.rule.orgExcept': '登录在其他组织(团队、公司)的账号不接手,{refs} 除外。',
2150
+ 'hp.rule.order': '从 {host} 接力时,按你排的顺序试:{order}。',
2151
+ 'hp.rule.countdown': '下一个账号启动前倒计时 {s} 秒,按回车可取消。',
2152
+ 'hp.rule.noCountdown': '下一个账号直接启动,不倒计时。',
2153
+ 'hp.on': '开',
2154
+ 'hp.off': '关',
2155
+ 'hp.edit': '修改…',
2156
+ 'hp.adaptive': '按近期消耗调整接力时机',
2157
+ 'hp.adaptiveOn': '接力时机会按近期消耗调整。',
2158
+ 'hp.adaptiveOff': '用量达到设定值时才会接力。',
2159
+ 'hp.otherFamilies': '允许换到其他 AI',
2160
+ 'hp.otherOn': '其他 AI 现在可以接手。',
2161
+ 'hp.otherOff': '其他 AI 不再接手。',
2162
+ 'hp.aiOrderSaved': '顺序已保存。',
2163
+ 'hp.api': '允许 API 账号接手',
2164
+ 'hp.apiOn': 'API 账号会在最后接手。',
2165
+ 'hp.apiOff': 'API 账号不再接手。',
2166
+ 'hp.noApi': '你还没有 API 账号。',
2167
+ 'hp.apiWarn': 'API 账号每次请求都计费。sideby 看不到、也管不了你的花费,请先在服务商后台设好每月上限。',
2168
+ 'hp.apiConfirm': '允许 API 账号',
2169
+ 'hp.apiAskTitle': '还让 API 账号接手吗?',
2170
+ 'hp.apiAskBody': '以前额度用完时,API 账号会自动接手。它按用量计费,所以现在要你同意才会接手。',
2171
+ 'hp.apiKeepOff': '不让它接手',
2172
+ 'hp.apiKeepOn': '继续让它接手',
2173
+ 'hp.apiKeptOff': 'API 账号不参与接力。',
2174
+ 'hp.undone': '已改回。',
2175
+ 'hp.noneAll': '目前没有账号能接手。开启接力规则第 5 条(同一个 AI)或第 6 条(其他 AI)即可。',
2083
2176
  'page.accounts': '账号',
2084
2177
  'page.tuning': '上下文调优',
2085
2178
  'page.sessions': '会话',
@@ -2150,6 +2243,7 @@ const zh = {
2150
2243
  'hist.unfold': '展开 {n} 个已折叠的组',
2151
2244
  'hist.fold': '收起',
2152
2245
  'hist.unfoldOne': '展开',
2246
+ 'hist.catMove': '点击收起或展开;拖动或按 Alt+方向键换位置',
2153
2247
  'hist.day.today': '今天',
2154
2248
  'hist.day.yesterday': '昨天',
2155
2249
  'hist.day.week': '{n} 天内',
@@ -2285,8 +2379,6 @@ const zh = {
2285
2379
  'inb.state.default': '未设置',
2286
2380
  'inb.state.refuse': '已关闭',
2287
2381
  'inb.state.cannot': '无法修改',
2288
- 'inb.change': '{from} → "accept"',
2289
- 'inb.notSet': '未设置',
2290
2382
  'inb.confirmNote': '选「直接接收」,消息就会自己到达。只改这一项设置;已经在运行的会话要重启后才生效。可以撤销。',
2291
2383
  'inb.accept': '直接接收',
2292
2384
  'inb.undo': '撤销上次修改',
@@ -2311,6 +2403,8 @@ const zh = {
2311
2403
  'tune.hostDefaultRange': '默认({lo}–{hi},看模型)',
2312
2404
  'tune.best': '建议',
2313
2405
  'tune.saved': '预计能少用约 {n}% 的 token(估算)。',
2406
+ 'tune.savedLabel': '预计少用',
2407
+ 'tune.savedValue': '约 {n}%',
2314
2408
  'tune.compactions.one': '最近自动压缩了 1 次,在对话长到约 {size} 时触发。',
2315
2409
  'tune.compactions.other': '最近自动压缩了 {n} 次,通常在对话长到约 {size} 时触发。',
2316
2410
  'tune.noCompactions': '这段时间没有压缩过。',
@@ -2358,6 +2452,7 @@ const zh = {
2358
2452
  'nf.accounts.other': '{n} 个账号',
2359
2453
  'nf.runOnce': '先运行一次 {bin}',
2360
2454
  'nf.notInstalled': '未安装',
2455
+ 'nf.mainOnly': '暂时只支持主账号:它在一台电脑上只保留一个登录',
2361
2456
  'nf.broken': '安装已损坏',
2362
2457
  'nf.name': '名称',
2363
2458
  'nf.namePh': '名称',
@@ -2396,19 +2491,19 @@ const zh = {
2396
2491
  'ah.on': '开',
2397
2492
  'ah.off': '关',
2398
2493
  'ah.title': '自动接力',
2399
- 'ah.intro': 'sideby 启动的会话额度快用完时,会写好接力说明,sideby 结束它,下一个账号在同一个终端里接着做。默认关闭。',
2494
+ 'ah.intro': 'sideby 启动的会话额度快用完时,会先写好接力笔记,sideby 再结束它,下一个账号在同一个终端里接着做。默认关闭。',
2400
2495
  'ah.auto': '额度快用完时自动接力',
2401
- 'ah.sameFamily': '也允许同一工具的账号之间接力',
2402
- 'ah.sameFamilyWarn': '同一家厂商的多个订阅之间接力来绕过限额,可能违反厂商条款,风险由你承担。',
2403
- 'ah.prepareAt': '开始写接力说明(%)',
2404
- 'ah.threshold': '接力阈值(%)',
2405
- 'ah.wait': '这么多分钟内重置就等待',
2496
+ 'ah.sameFamily': '同一个 AI 的账号之间也允许接力',
2497
+ 'ah.sameFamilyWarn': '在同一家厂商的多个订阅账号间换号以绕过限额,可能违反对方条款,请自行承担风险。',
2498
+ 'ah.prepareAt': '开始写接力笔记(%)',
2499
+ 'ah.threshold': '接力用量(%)',
2500
+ 'ah.wait': '额度在此时间内恢复则等待(分钟)',
2406
2501
  'ah.countdown': '接力前倒计时(秒)',
2407
- 'ah.badLevels': '开始写说明的比例要低于接力阈值。',
2502
+ 'ah.badLevels': '写接力笔记的用量必须低于接力用量。',
2408
2503
  'ah.order': '{host} 交给',
2409
2504
  'ah.byQuota': '剩余额度最多的',
2410
2505
  'ah.myOrder': '按我的顺序',
2411
- 'ah.byQuotaHint': '先选同一工具里剩余额度最多的账号(需打开同工具接力),再选 API 账号。',
2506
+ 'ah.byQuotaHint': '优先选同一个 AI 剩余额度最多的账号(需开启同一个 AI 接力),最后选 API 账号。',
2412
2507
  'ah.add': '添加账号',
2413
2508
  'ah.up': '上移',
2414
2509
  'ah.down': '下移',
@@ -2426,9 +2521,11 @@ const zh = {
2426
2521
  'ah.nothing': '没有要改的。',
2427
2522
  'ah.saved': '已保存到 {file}。',
2428
2523
  'ah.changes': '将修改 {file}:',
2429
- 'ah.hint': '{ref} 的额度已用 {p}%。会话可以在额度快用完时,自己把任务交给另一个账号。',
2524
+ 'ah.hint': '{ref} 的额度已用了 {p}%。额度快用完时,会话可以自动把任务交给另一个账号。',
2430
2525
  'ah.setUp': '去设置',
2431
2526
  'ah.dismiss': '暂不',
2527
+ 'ah.crossOrg': '其他组织',
2528
+ 'ah.crossOrgHint': '勾选的账号即使登录在别的组织,也可以接手。',
2432
2529
  'toast.ahOn': '自动接力已开启,对用 sideby 启动的会话生效。',
2433
2530
  'toast.ahOff': '自动接力已关闭。',
2434
2531
  'qs.title': '开启 {host} 额度显示',
@@ -2452,11 +2549,11 @@ const zh = {
2452
2549
  'rc.hidden': '本浏览器不再提示。以后可以运行 sideby remote-control off 关闭。',
2453
2550
  'rc.readOnly': '运行 sideby remote-control off 关闭。',
2454
2551
  'rc.confirmTitle': '关闭 Remote Control 自动打开?',
2455
- 'rc.change': 'remoteControlAtStartup {from} → {to}',
2456
2552
  'rc.notSet': '未设置',
2457
2553
  'rc.usedBy': '用于 {refs}',
2458
2554
  'rc.confirmNote': '已经开着的会话要重开才断开。需要时仍可在会话里运行 /remote-control 手动打开。',
2459
2555
  'rc.confirm': '确认关闭',
2556
+ 'rc.skipped': '不会改:',
2460
2557
  'rc.done': '新会话不会再自动打开 Remote Control。开着的会话要重开。',
2461
2558
  'rc.failed': '没能关闭:{msg}',
2462
2559
  'set.button': '设置',
@@ -2575,8 +2672,13 @@ const zh = {
2575
2672
  'rc.state.off': '关',
2576
2673
  'rc.state.missing': '没有设置文件',
2577
2674
  'rc.state.blocked': '读不了',
2675
+ 'settings.why.no-settings': '这个账号没有 settings.json。运行 sideby doctor --fix 让它共用主账号的,再试一次。',
2676
+ 'settings.why.broken-link': 'settings.json 指向的文件不存在。运行 sideby doctor 看怎么修。',
2677
+ 'settings.why.unsafe': 'settings.json 现在没法安全修改。先修好或移走这个文件,再试一次。',
2678
+ 'settings.why.refuse': '你设成了拒绝,sideby 不会改它,发给这些会话的消息只能粘贴。想直接收到,请自己在这个文件里写 "crossSessionInbound": "accept"。',
2679
+ 'settings.why.other': '这里是 sideby 不认识的值,sideby 不会改它。请自己把 "crossSessionInbound" 改成 "accept",或删掉这个键后再试一次。',
2578
2680
  'rc.dialogTitle': 'Remote Control 自动打开',
2579
- 'rc.explain': '打开时,每个新的 Claude 会话都会连到 claude.ai 和 Claude 手机 App,登录这个账号的设备都能看到对话。「默认」表示交给 Claude Code 或你的组织决定。',
2681
+ 'rc.explain': '打开时,每个新的 Claude 会话都会连到 claude.ai 和 Claude 手机 App,登录这个账号的设备都能看到对话。没写这个设置的文件显示「由 Claude Code 决定」,由 Claude Code 或你的组织决定。',
2580
2682
  'rc.allOff': '已全部关闭。需要时仍可在会话里运行 /remote-control 手动打开,或在上面切到「开」。',
2581
2683
  'rc.undo': '撤销上次更改',
2582
2684
  'rc.switch': '新会话自动打开',
@@ -1,3 +1,4 @@
1
+ import type { HandoffSettings } from '../core/config.ts';
1
2
  /** The parts of a PanelAccount the helpers read. */
2
3
  export interface LogicAccount {
3
4
  family: string;
@@ -60,6 +61,14 @@ export declare function windowState(w: {
60
61
  passed: boolean;
61
62
  level: string;
62
63
  };
64
+ /**
65
+ * The window that binds first among those sharing one column (a model group with a 5-hour and a weekly limit, as
66
+ * Antigravity CLI reports): the most used as the page draws it, the first on a tie. Undefined for none.
67
+ */
68
+ export declare function bindingWindow<W extends {
69
+ usedPercent: number;
70
+ resetsAt: string;
71
+ }>(list: W[], now: number, warn: number, fail: number): W | undefined;
63
72
  /**
64
73
  * A window whose reset time has passed: the numbers on record are from before the reset and nothing newer came
65
74
  * in. `since` is when they were last seen (the Quota's observation time, or the reset itself when that is
@@ -107,6 +116,11 @@ export declare function attentionWhy(a: LogicAccount, health: {
107
116
  * order they came. Names no longer there are simply not met.
108
117
  */
109
118
  export declare function inDisplayOrder<T>(items: readonly T[], key: (t: T) => string, order?: readonly string[]): T[];
119
+ /**
120
+ * The categories of the History side list in the order the user dragged them to: the saved ones first, then the
121
+ * others in the order `seen` gives (latest Session first). The empty category (Projects without one) stays last.
122
+ */
123
+ export declare function categoryOrder(seen: readonly string[], saved: readonly string[]): string[];
110
124
  /**
111
125
  * The Display Order after a drag (spec §3.25). `all` is every key of the list in the current Display Order, hidden
112
126
  * ones included; `shown` is what the screen showed, in its order, as units (one key, or a Same Login group that moves
@@ -429,18 +443,8 @@ export declare function handoffHintAccount(accounts: readonly LogicAccount[], se
429
443
  ref: string;
430
444
  pressure: number;
431
445
  } | null;
432
- export interface HandoffSettingsView {
433
- auto: boolean;
434
- sameFamily: boolean;
435
- prepareAt: number;
436
- threshold: number;
437
- waitIfResetWithinMinutes: number;
438
- countdownSeconds: number;
439
- families: Record<string, {
440
- policy: string;
441
- order: string[];
442
- }>;
443
- }
446
+ /** The settings `/api/handoff/*` sends, as `sideby handoff --json` prints them. */
447
+ export type HandoffSettingsView = HandoffSettings;
444
448
  export interface HandoffForm {
445
449
  auto: boolean;
446
450
  sameFamily: boolean;
@@ -452,6 +456,8 @@ export interface HandoffForm {
452
456
  policy: string;
453
457
  order: string[];
454
458
  }>;
459
+ /** Left out: unchanged. */
460
+ crossOrganization?: string[];
455
461
  }
456
462
  /** What the Panel's Auto Handoff form changed, as the `change` /api/handoff/configure takes; {} when nothing. */
457
463
  export declare function handoffChangeOf(s: HandoffSettingsView, f: HandoffForm): Record<string, unknown>;
@@ -464,13 +470,6 @@ export declare function remoteControlSummary(groups: readonly {
464
470
  accounts: readonly string[];
465
471
  state: string;
466
472
  }[], apiRefs: readonly string[]): 'on' | 'default' | 'off' | null;
467
- /**
468
- * The groups that turning Remote Control `to` on or off changes (spec §3.22): those that do not hold it yet, a
469
- * default counting as either. A file that is missing or cannot be read is never changed.
470
- */
471
- export declare function remoteControlTodo<G extends {
472
- state: string;
473
- }>(groups: readonly G[], to: 'on' | 'off'): G[];
474
473
  /**
475
474
  * Where a menu or popover goes next to its anchor, all in viewport pixels. It opens below when its whole height fits
476
475
  * there, else above when it fits there, else on the side with more room, its height capped at that room so it scrolls
@@ -847,3 +846,37 @@ export type HistFilters = {
847
846
  };
848
847
  /** The History filters saved before a reload, each dropped back to its default when it is missing or malformed. */
849
848
  export declare function histFilters(raw: unknown): HistFilters;
849
+ /**
850
+ * Saves one Auto Handoff change from the Handoff page (spec §3.17 "接力规则"): every change applies at once, and
851
+ * the toast offers the undo the server read from the config as it was. Undoing offers no undo of its own.
852
+ */
853
+ export declare function saveHandoffChange(post: (path: string, body: object) => Promise<{
854
+ undo?: Record<string, unknown>;
855
+ }>, change: Record<string, unknown>, opts?: {
856
+ noUndo?: boolean;
857
+ }): Promise<{
858
+ undo: Record<string, unknown> | null;
859
+ }>;
860
+ /**
861
+ * What the Handoff page shows after confirming the plan that turns Auto Handoff on (ADR-0013): the plan again when
862
+ * it changed since it was shown (unless nothing is left to do) or is blocked, the first step that failed, or done.
863
+ */
864
+ export declare function enableOutcome<P extends {
865
+ alreadyOn?: boolean;
866
+ blocked?: unknown;
867
+ }, S extends {
868
+ ok: boolean;
869
+ }>(r: {
870
+ changed?: boolean;
871
+ plan: P;
872
+ results: S[];
873
+ }): {
874
+ kind: 'changed' | 'blocked';
875
+ plan: P;
876
+ } | {
877
+ kind: 'failed';
878
+ step: S;
879
+ plan: P;
880
+ } | {
881
+ kind: 'done';
882
+ };