sideby 0.35.9 → 0.36.1

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 (68) hide show
  1. package/dist/build.json +1 -1
  2. package/dist/src/cli/commands.d.ts +12 -0
  3. package/dist/src/cli/commands.js +489 -6
  4. package/dist/src/cli/format.d.ts +12 -1
  5. package/dist/src/cli/format.js +23 -3
  6. package/dist/src/cli/json-schemas.js +166 -1
  7. package/dist/src/cli/main.js +18 -4
  8. package/dist/src/core/advisor.d.ts +187 -0
  9. package/dist/src/core/advisor.js +519 -0
  10. package/dist/src/core/browser-profiles.d.ts +16 -0
  11. package/dist/src/core/browser-profiles.js +45 -0
  12. package/dist/src/core/claude-settings-file.d.ts +14 -0
  13. package/dist/src/core/claude-settings-file.js +62 -23
  14. package/dist/src/core/cli-commands.js +25 -1
  15. package/dist/src/core/config.d.ts +29 -0
  16. package/dist/src/core/config.js +25 -0
  17. package/dist/src/core/handoff-select.d.ts +13 -2
  18. package/dist/src/core/handoff-select.js +6 -2
  19. package/dist/src/core/launch.d.ts +4 -0
  20. package/dist/src/core/launch.js +7 -0
  21. package/dist/src/core/limit-reset.d.ts +198 -0
  22. package/dist/src/core/limit-reset.js +299 -0
  23. package/dist/src/core/quota-fetch.d.ts +57 -2
  24. package/dist/src/core/quota-fetch.js +291 -13
  25. package/dist/src/core/quota-levels.d.ts +70 -0
  26. package/dist/src/core/quota-levels.js +80 -0
  27. package/dist/src/core/quota-store.d.ts +15 -1
  28. package/dist/src/core/quota-store.js +26 -1
  29. package/dist/src/core/same-login.d.ts +8 -0
  30. package/dist/src/core/same-login.js +39 -2
  31. package/dist/src/core/search-catalog.js +38 -0
  32. package/dist/src/families/claude/index.js +2 -0
  33. package/dist/src/families/codex/index.js +3 -1
  34. package/dist/src/families/codex/quota.d.ts +23 -1
  35. package/dist/src/families/codex/quota.js +122 -21
  36. package/dist/src/families/grok/quota-log.d.ts +1 -0
  37. package/dist/src/menubar/script.js +70 -18
  38. package/dist/src/menubar/snapshot.d.ts +33 -1
  39. package/dist/src/menubar/snapshot.js +79 -11
  40. package/dist/src/menubar/strings.d.ts +16 -0
  41. package/dist/src/menubar/strings.js +16 -0
  42. package/dist/src/panel/handler.d.ts +21 -0
  43. package/dist/src/panel/handler.js +134 -12
  44. package/dist/src/panel/i18n.d.ts +87 -0
  45. package/dist/src/panel/i18n.js +174 -0
  46. package/dist/src/panel/page-logic.d.ts +17 -0
  47. package/dist/src/panel/page-logic.js +23 -0
  48. package/dist/src/panel/page-script.js +442 -19
  49. package/dist/src/panel/page-styles.js +38 -2
  50. package/dist/src/plugins/loader.d.ts +2 -0
  51. package/dist/src/plugins/loader.js +27 -0
  52. package/dist/src/runtime.d.ts +65 -1
  53. package/dist/src/runtime.js +530 -9
  54. package/dist/src/types.d.ts +67 -0
  55. package/package.json +1 -1
  56. package/schemas/advisor.json +332 -0
  57. package/schemas/config.json +22 -0
  58. package/schemas/error.json +4 -0
  59. package/schemas/menubar-reset.json +93 -0
  60. package/schemas/menubar-snapshot.json +70 -2
  61. package/schemas/quota-reset.json +369 -0
  62. package/schemas/quota.json +30 -0
  63. package/schemas/update.json +4 -0
  64. package/skills/sideby/SKILL.md +6 -2
  65. package/skills/sideby/references/ai-tasks.md +1 -1
  66. package/skills/sideby/references/panel.md +14 -0
  67. package/skills/sideby/references/quota.md +27 -0
  68. package/skills/sideby/references/update.md +1 -1
@@ -0,0 +1,369 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "sideby/quota-reset.json",
4
+ "type": "object",
5
+ "required": [
6
+ "schemaVersion",
7
+ "account",
8
+ "message"
9
+ ],
10
+ "properties": {
11
+ "schemaVersion": {
12
+ "type": "number",
13
+ "const": 1
14
+ },
15
+ "account": {
16
+ "type": "string",
17
+ "description": "The account the command named."
18
+ },
19
+ "confirmationRequired": {
20
+ "type": "boolean",
21
+ "description": "Only without `--yes` (the plan; nothing was spent). True: show the plan to the user and, after a yes, run again with `--yes --operation <operationId>` (exit 10). False: it cannot be used now, see `blocked` (exit 1)."
22
+ },
23
+ "operationId": {
24
+ "type": "string",
25
+ "description": "The operation: in a plan, the one to confirm; in a result, the one that ran. One operation sends one idempotency key, however often it is retried."
26
+ },
27
+ "via": {
28
+ "type": "string",
29
+ "description": "The account whose Host sends the request (the first signed-in one of the login)."
30
+ },
31
+ "sameLogin": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string"
35
+ },
36
+ "description": "The other accounts signed in as the same login; a limit reset applies to all of them."
37
+ },
38
+ "unresolved": {
39
+ "type": "boolean",
40
+ "const": true,
41
+ "description": "In a plan: an earlier attempt for this login got no final answer; confirming asks the Host again with that same request."
42
+ },
43
+ "quota": {
44
+ "anyOf": [
45
+ {
46
+ "type": "object",
47
+ "required": [
48
+ "status",
49
+ "windows",
50
+ "observedAt",
51
+ "source"
52
+ ],
53
+ "properties": {
54
+ "status": {
55
+ "type": "string",
56
+ "const": "ok"
57
+ },
58
+ "windows": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "object",
62
+ "required": [
63
+ "label",
64
+ "windowMinutes",
65
+ "usedPercent",
66
+ "resetsAt"
67
+ ],
68
+ "properties": {
69
+ "label": {
70
+ "type": "string"
71
+ },
72
+ "name": {
73
+ "type": "string",
74
+ "description": "The group of models this limit covers, when it covers only some (spec §3.26); it does not count toward Quota Pressure."
75
+ },
76
+ "windowMinutes": {
77
+ "type": "number"
78
+ },
79
+ "usedPercent": {
80
+ "type": "number"
81
+ },
82
+ "resetsAt": {
83
+ "type": "string"
84
+ },
85
+ "observedAt": {
86
+ "type": "string",
87
+ "description": "When this window was read, when that is not the quota's `observedAt` (a newer reading did not cover it); left out, it is as old as the quota."
88
+ },
89
+ "source": {
90
+ "type": "string",
91
+ "description": "Where this window was read from, when that is not the quota's `source`."
92
+ }
93
+ }
94
+ }
95
+ },
96
+ "observedAt": {
97
+ "type": "string"
98
+ },
99
+ "source": {
100
+ "type": "string"
101
+ },
102
+ "plan": {
103
+ "type": "string"
104
+ },
105
+ "limitResets": {
106
+ "type": "object",
107
+ "required": [
108
+ "available",
109
+ "observedAt"
110
+ ],
111
+ "properties": {
112
+ "available": {
113
+ "type": "number",
114
+ "description": "How many the account can use now; 0 when its Host says none."
115
+ },
116
+ "observedAt": {
117
+ "type": "string",
118
+ "description": "When the count was read."
119
+ },
120
+ "nextExpiresAt": {
121
+ "type": "string",
122
+ "description": "When the next one to expire does; left out when that is not known for all of them."
123
+ }
124
+ },
125
+ "description": "The Limit Resets the account holds: one-time credits from the vendor that restore quota before a window's own reset time (ADR-0072). Only from a Host that tells the count (Codex); left out when the Host cannot tell, which never means zero."
126
+ },
127
+ "from": {
128
+ "type": "string",
129
+ "description": "The account this reading was taken from, when it is another account of the same login (spec §3.21); observedAt is its time."
130
+ },
131
+ "fetched": {
132
+ "type": "boolean",
133
+ "description": "This reading is the kept answer of a quota check that costs a request (spec §3.26)."
134
+ },
135
+ "fetchError": {
136
+ "type": "string",
137
+ "description": "Why the latest quota check failed, while this older reading is shown."
138
+ }
139
+ }
140
+ },
141
+ {
142
+ "type": "object",
143
+ "required": [
144
+ "status",
145
+ "reason"
146
+ ],
147
+ "properties": {
148
+ "status": {
149
+ "type": "string",
150
+ "const": "unavailable"
151
+ },
152
+ "reason": {
153
+ "type": "string",
154
+ "description": "not-enabled, no-session, unrecognized, no-source, api-account or fetch-failed."
155
+ },
156
+ "detail": {
157
+ "type": "string"
158
+ }
159
+ }
160
+ }
161
+ ]
162
+ },
163
+ "limitResets": {
164
+ "type": "object",
165
+ "required": [
166
+ "available",
167
+ "observedAt"
168
+ ],
169
+ "properties": {
170
+ "available": {
171
+ "type": "number",
172
+ "description": "How many the account can use now; 0 when its Host says none."
173
+ },
174
+ "observedAt": {
175
+ "type": "string",
176
+ "description": "When the count was read."
177
+ },
178
+ "nextExpiresAt": {
179
+ "type": "string",
180
+ "description": "When the next one to expire does; left out when that is not known for all of them."
181
+ }
182
+ },
183
+ "description": "The Limit Resets the account holds: one-time credits from the vendor that restore quota before a window's own reset time (ADR-0072). Only from a Host that tells the count (Codex); left out when the Host cannot tell, which never means zero."
184
+ },
185
+ "expectedAfter": {
186
+ "type": "number",
187
+ "description": "In a plan: the count expected after one is used; not a promise."
188
+ },
189
+ "canUse": {
190
+ "type": "boolean"
191
+ },
192
+ "blocked": {
193
+ "type": "string",
194
+ "description": "In a plan that cannot be confirmed: why, and what to do."
195
+ },
196
+ "outcome": {
197
+ "anyOf": [
198
+ {
199
+ "type": "string",
200
+ "const": "reset"
201
+ },
202
+ {
203
+ "type": "string",
204
+ "const": "nothing-to-reset"
205
+ },
206
+ {
207
+ "type": "string",
208
+ "const": "none-left"
209
+ },
210
+ {
211
+ "type": "string",
212
+ "const": "already-done"
213
+ },
214
+ {
215
+ "type": "string",
216
+ "const": "open-vendor-page"
217
+ }
218
+ ],
219
+ "description": "With `--yes`: `reset` (one was used), `already-done` (this operation had already used one; nothing more was spent), `nothing-to-reset` or `none-left` (nothing was spent; exit 1). `open-vendor-page`: this Host cannot use one from the command line; `url` is the page where it is used (Claude Code)."
220
+ },
221
+ "resumed": {
222
+ "type": "boolean",
223
+ "const": true,
224
+ "description": "This run finished an earlier attempt with its own key."
225
+ },
226
+ "replayed": {
227
+ "type": "boolean",
228
+ "const": true,
229
+ "description": "The outcome was already known for this operation; no request to use one was sent now. `quota` is read again when the kept numbers are from before the spend."
230
+ },
231
+ "quotaPending": {
232
+ "type": "boolean",
233
+ "const": true,
234
+ "description": "One was used, but the quota could not be read afterwards; the numbers on show are still old."
235
+ },
236
+ "url": {
237
+ "type": "string",
238
+ "description": "With `open-vendor-page`: the vendor's page."
239
+ },
240
+ "opened": {
241
+ "type": "boolean",
242
+ "description": "Whether `--open` opened the page."
243
+ },
244
+ "profile": {
245
+ "type": "object",
246
+ "required": [
247
+ "dir",
248
+ "name"
249
+ ],
250
+ "properties": {
251
+ "dir": {
252
+ "type": "string"
253
+ },
254
+ "name": {
255
+ "type": "string"
256
+ }
257
+ },
258
+ "description": "The browser user the page was opened in."
259
+ },
260
+ "identity": {
261
+ "type": "object",
262
+ "required": [
263
+ "email"
264
+ ],
265
+ "properties": {
266
+ "email": {
267
+ "type": "string"
268
+ },
269
+ "org": {
270
+ "type": "string"
271
+ }
272
+ },
273
+ "description": "Who the account is signed in as; the page must be signed in as the same login."
274
+ },
275
+ "tight": {
276
+ "type": "array",
277
+ "items": {
278
+ "type": "object",
279
+ "required": [
280
+ "label",
281
+ "usedPercent",
282
+ "resetsAt"
283
+ ],
284
+ "properties": {
285
+ "label": {
286
+ "type": "string"
287
+ },
288
+ "name": {
289
+ "type": "string"
290
+ },
291
+ "usedPercent": {
292
+ "type": "number"
293
+ },
294
+ "resetsAt": {
295
+ "type": "string"
296
+ }
297
+ }
298
+ },
299
+ "description": "With `open-vendor-page`: the windows at their warning level now."
300
+ },
301
+ "message": {
302
+ "type": "string",
303
+ "description": "What happened or what confirming does, in plain words."
304
+ },
305
+ "_notice": {
306
+ "type": "object",
307
+ "properties": {
308
+ "update": {
309
+ "type": "object",
310
+ "required": [
311
+ "current",
312
+ "latest",
313
+ "command",
314
+ "message"
315
+ ],
316
+ "properties": {
317
+ "current": {
318
+ "type": "string"
319
+ },
320
+ "latest": {
321
+ "type": "string"
322
+ },
323
+ "command": {
324
+ "type": "string",
325
+ "description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
326
+ },
327
+ "message": {
328
+ "type": "string"
329
+ }
330
+ }
331
+ },
332
+ "skill": {
333
+ "type": "object",
334
+ "required": [
335
+ "installed",
336
+ "current",
337
+ "command",
338
+ "message"
339
+ ],
340
+ "properties": {
341
+ "installed": {
342
+ "anyOf": [
343
+ {
344
+ "type": "string"
345
+ },
346
+ {
347
+ "type": "null"
348
+ }
349
+ ],
350
+ "description": "The skill's version; null when it has none."
351
+ },
352
+ "current": {
353
+ "type": "string"
354
+ },
355
+ "command": {
356
+ "type": "string",
357
+ "description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
358
+ },
359
+ "message": {
360
+ "type": "string"
361
+ }
362
+ }
363
+ }
364
+ },
365
+ "description": "Not the answer to the task: mention it briefly afterwards and offer to update."
366
+ }
367
+ },
368
+ "title": "sideby quota reset --json"
369
+ }
@@ -78,6 +78,14 @@
78
78
  },
79
79
  "resetsAt": {
80
80
  "type": "string"
81
+ },
82
+ "observedAt": {
83
+ "type": "string",
84
+ "description": "When this window was read, when that is not the quota's `observedAt` (a newer reading did not cover it); left out, it is as old as the quota."
85
+ },
86
+ "source": {
87
+ "type": "string",
88
+ "description": "Where this window was read from, when that is not the quota's `source`."
81
89
  }
82
90
  }
83
91
  }
@@ -91,6 +99,28 @@
91
99
  "plan": {
92
100
  "type": "string"
93
101
  },
102
+ "limitResets": {
103
+ "type": "object",
104
+ "required": [
105
+ "available",
106
+ "observedAt"
107
+ ],
108
+ "properties": {
109
+ "available": {
110
+ "type": "number",
111
+ "description": "How many the account can use now; 0 when its Host says none."
112
+ },
113
+ "observedAt": {
114
+ "type": "string",
115
+ "description": "When the count was read."
116
+ },
117
+ "nextExpiresAt": {
118
+ "type": "string",
119
+ "description": "When the next one to expire does; left out when that is not known for all of them."
120
+ }
121
+ },
122
+ "description": "The Limit Resets the account holds: one-time credits from the vendor that restore quota before a window's own reset time (ADR-0072). Only from a Host that tells the count (Codex); left out when the Host cannot tell, which never means zero."
123
+ },
94
124
  "from": {
95
125
  "type": "string",
96
126
  "description": "The account this reading was taken from, when it is another account of the same login (spec §3.21); observedAt is its time."
@@ -236,6 +236,10 @@
236
236
  "type": "boolean",
237
237
  "description": "The skill was updated too (true) or that failed (false); absent when not tried."
238
238
  },
239
+ "skillMessage": {
240
+ "type": "string",
241
+ "description": "Set with `skillUpdated` after an Update: when it is false, why the skill update failed and what to run instead; when true, that the skill was updated."
242
+ },
239
243
  "output": {
240
244
  "type": "string",
241
245
  "description": "What the failed install command printed."
@@ -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.9"
5
+ version: "0.36.1"
6
6
  requires:
7
7
  bins: [sideby, node]
8
8
  cliHelp: sideby --help
@@ -52,7 +52,9 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
52
52
  | Pin accounts or arrange their Display Order | `sideby order --json`, `sideby pin <ref> --json`, `sideby unpin <ref> --json` | `references/panel.md` |
53
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` |
54
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` |
55
- | Set the model, effort or Remote Control | `sideby model <ref> --json`, `sideby remote-control --json` | `references/panel.md` |
55
+ | See whether an account holds a limit reset ("do I have a reset?", "有没有重置次数", "还能重置几次"), or how old a quota number is | `sideby quota [family] --json` (`quota.limitResets`, each window's `observedAt`) | `references/quota.md` |
56
+ | Use a limit reset ("use a reset", "reset my Codex quota", "用一次重置", "把额度重置一下", "去 claude.ai 用重置") | `sideby quota reset <ref> --json` (exit 10: the plan; show it and ask the user), then `sideby quota reset <ref> --yes --operation <operationId> --json`; Claude: `sideby quota reset <ref> --open` | `references/quota.md` |
57
+ | Set the model, effort, Remote Control or the Advisor | `sideby model <ref> --json`, `sideby remote-control --json`, `sideby advisor --json` | `references/panel.md` |
56
58
  | Start sideby at login ("开机启动", "start the panel when I log in") | `sideby autostart --json`, `sideby autostart on --json` (exit 10 first) | `references/panel.md` |
57
59
  | Show quota in the macOS menu bar ("状态栏显示额度", "menu bar"), its icon is missing ("状态栏没有图标"), or change its shortcut ("换个快捷键", "帮我挑个顺手的快捷键") | `sideby menubar --json`, `sideby menubar on --json` (exit 10 first), `sideby menubar snapshot --json`, `sideby menubar hotkey [<keys>] --json` | `references/panel.md` |
58
60
  | Change the Panel's theme or language, or any other setting ("改成深色", "change any setting") | `sideby config get --json`, `sideby config set <key> <value> --json` (exit 10 first) | `references/panel.md` |
@@ -78,6 +80,8 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
78
80
  | Tune the auto-compact threshold ("which compaction setting costs the fewest tokens"), use the suggestion or undo it | `sideby tune --json`, `sideby tune apply` (exit 10 first), `sideby tune undo` | `references/diagnose.md` |
79
81
  | See or set the model and effort an account starts with ("用哪个模型", "set effort to high for cc002") | `sideby model <acct> --json`; `sideby model <acct> <model\|default> --effort <level\|default>` (exit 10 first, then `--yes` after the user agrees) | — |
80
82
  | Stop Claude sessions from connecting to claude.ai / the Claude app by themselves ("关闭 remote control", "别让别人远程看到对话") for every account | `sideby remote-control --json`, then `sideby remote-control off` (exits 10 with the change; rerun with `--yes` after they agree); `sideby remote-control undo` puts it back; `sideby remote-control on` turns it back on the same way (only when they ask for it) | — |
83
+ | Let Claude sessions consult a stronger model at key moments, or fix `/advisor` not working ("/advisor 不能用", "Unknown command: /advisor", "/advisor isn't available in this environment", "让 Claude 请教更强的模型", "turn on the advisor", "用 Opus 当顾问") for every Claude subscription account | `sideby advisor --json`, then `sideby advisor opus` (or `fable`, `sonnet`, `off`; exits 10 with the change; rerun with `--yes` after they agree); `sideby advisor undo` puts it back; `sideby advisor unlock on\|off` only changes whether sessions sideby starts get `/advisor` | `references/panel.md` |
84
+ | A Claude API account's gateway rejects requests after an Advisor change, or why sideby adds `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` to API accounts ("API 账号网关报错了", "为什么 API 账号多了这个变量") | `sideby advisor --json` (`apiBetasOff`, each group's `apiAccounts`), `sideby config get claude.apiBetasOff --json`; `sideby advisor undo` or `sideby config set claude.apiBetasOff false` after they agree | `references/panel.md` |
81
85
  | Stop Claude and Codex when the network is wrong ("网络不对时别让 Claude 用", "代理断了就拦住", "only allow US and Japan", "开网络检查"), see where requests leave from now, or a session says it was blocked | `sideby network --json`, `sideby network check --json`, `sideby network allow <CC>... --json` and `sideby network on --json` (each exits 10 first; rerun with `--yes` after they agree) | `references/network.md` |
82
86
  | Leave sessions running with nobody there ("挂机", "无人值守", "今晚自己跑完", "设个时间段别问我", "keep going while I sleep"), set a nightly Schedule, or see what was left for the user | `sideby unattended on [--until 08:00] --json` (run it yourself when they say they are leaving), `sideby unattended schedule preset weeknights --json`, `sideby unattended --json`, `sideby unattended pending --json`; inside a session refused a question: `sideby unattended defer "<one sentence>"` | `references/unattended.md` |
83
87
  | See Claude quota, refresh it, or turn on live quota for Auto Handoff | `sideby quota claude --refresh --json` (no setup); `sideby quota setup claude` (exits 10) for Auto Handoff | `references/quota.md` |
@@ -7,7 +7,7 @@ You are inside such a session when the first message came from sideby and names
7
7
  ## Rules for every task
8
8
 
9
9
  - Use this skill and `sideby … --json` for every step a command covers.
10
- - `quota setup`, `handoff setup`, `update`, `browser --enable|--disable`, `try`, `tune apply|undo`, `model` and `remote-control off|on` show a preview first and exit 10: show the user the change, and add `--yes` only after they agree. `doctor` shows what `--fix` would fix; run `--fix` after they agree. `new`, `plugins new`, `terminal --set|--custom` and `key` write at once, so ask the user before you run them.
10
+ - `quota setup`, `handoff setup`, `update`, `browser --enable|--disable`, `try`, `tune apply|undo`, `model`, `remote-control off|on` and `advisor <model>|off|undo|unlock` show a preview first and exit 10: show the user the change, and add `--yes` only after they agree. `doctor` shows what `--fix` would fix; run `--fix` after they agree. `new`, `plugins new`, `terminal --set|--custom` and `key` write at once, so ask the user before you run them.
11
11
  - Never sign in for the user. Tell them to click **Sign in** on the account in the Panel, or to run `sideby login <ref>` in their own terminal.
12
12
  - Never ask for an API key, a token or a password in chat, and do not use one the user pastes: tell them it is not needed here and to keep it out of the chat. A key goes in with `sideby key <ref>`, which the user runs in their own terminal (or **Enter key** in the Panel); it reads the key without showing it.
13
13
  - Do not run `sideby ask` to start another AI Task yourself.
@@ -56,6 +56,20 @@ To change them, run `sideby model claude:work opus --effort high --json`; `defau
56
56
 
57
57
  Use `sideby remote-control off --json`, `on --json` or `undo --json`. Exit 10 shows the affected groups and waits for `--yes`; confirm before applying. Exit 1 with `applied: false` and a message such as "already off, nothing changed" means no file needed it: tell the user, do not retry. A result has `applied`, optional `results` (`file`, `accounts`, `ok`, `message`) and optional `message`. Only turn it on when asked. Changes affect new sessions; running sessions remain connected until restarted. Undo restores the earlier value only while the key still holds what sideby wrote.
58
58
 
59
+ ## Advisor
60
+
61
+ Claude Code's Advisor lets a session consult a stronger model (Fable, Opus or Sonnet) at key moments. `/advisor` is hidden ("Unknown command: /advisor") until it is unlocked: sideby unlocks it in sessions it starts while config `advisor.unlock` is on.
62
+
63
+ `sideby advisor --json` returns `action: "status"`, `groups`, `unlock` and optional `envOff`. Each group has `file`, `accounts`, `state`, `undo`, optional `model`, `reason`, `betasOff` and `betasValue`. `state` is `fable`, `opus`, `sonnet`, `other` (another value; `model` holds it when it is a plain model id), `off` (`advisorModel` not set), `missing` (no settings.json: suggest `sideby doctor --fix`) or `blocked`. Only Claude subscription accounts appear; API accounts are left out. `betasOff: true` means that file's `env` sets `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` to a true value (`betasValue` is that value as JSON, such as `"1"`): it blocks the Advisor ("/advisor isn't available in this environment") even when unlocked. `envOff` names a variable in the user's own shell environment that hides the Advisor in every session, those sideby starts too: tell the user to remove it from their shell profile; sideby never overrides it. Top-level `apiBetasOff` is config `claude.apiBetasOff`: while it is true, sideby adds `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` whenever it starts a Claude API account (never a subscription account; a value in the account's `proxy.env` or the environment wins). A group's `apiAccounts` lists the API accounts that share its file (they are not in `accounts`), and `undoApiBetas: true` means undo also turns that config back. With `undo`, `undoModel` is the `advisorModel` value undo puts back (JSON, or `removed`; absent when the last change kept the model) and `undoBetas` the env value it puts back: name only these when you tell the user what undo changes.
64
+
65
+ Use `sideby advisor opus --json` (or `fable`, `sonnet`, `off`; `--account <ref>` for one account's file only), `sideby advisor undo --json` or `sideby advisor unlock on|off --json`. Exit 10 is a preview with `applied: false`: show each `groups` entry (the file, `advisorModel` from and to, its accounts), any `skipped` files, and, when `unlocks` is true, that sideby will also turn `advisor.unlock` on. When `removesBetas` is true, the preview also removes `env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` from the files with `betasOff` (only that entry; every other `env` entry stays): before the user agrees, tell them this also turns Claude Code's other experimental features back on, and that `undo` puts it back. When the preview has `apiAccounts`, those API accounts share a file that loses the variable, which their gateway may need (it stops `anthropic-beta` headers some gateways reject): with `apiBetasOn: true` the same change turns `claude.apiBetasOff` on (preview line `sideby config: claude.apiBetasOff false -> true`) so sideby gives them the variable at launch; without it, they already get it. Name those accounts to the user. An undo preview with `apiBetasBack: true` also turns the config back to its earlier value; if undo cannot (the config changed, or a file did not get the variable back), it stays on and the message names `sideby config set claude.apiBetasOff false`. Confirm, then rerun with `--yes`. A result has `applied`, `results` (`file`, `accounts`, `ok`, `message`), `unlocked`, `unlock`, `apiBetasOff` and `message`. Exit 1 with `applied: false` and a message means nothing to change (already that model and unlocked, nothing to undo, every file missing or blocked, no subscription account): tell the user, do not retry. `off` removes the key and never touches the env entry; `off` and `undo` leave `advisor.unlock` as it is; `sideby advisor unlock off` stops unlocking.
66
+
67
+ Tell the user:
68
+ - Restart running sessions to pick up a change.
69
+ - Sessions started with plain `claude`, outside sideby, are not unlocked; they get the Advisor only where Anthropic has rolled it out.
70
+ - "Advisor unavailable" in a session means Anthropic has not enabled the Advisor for that account; sideby cannot change that.
71
+ - The Advisor uses more quota. Pick a model at least as strong as the one the session runs. Fable may ask for consent the first time.
72
+
59
73
  ## Theme, language and any other setting
60
74
 
61
75
  Every setting in sideby's config has a command. `sideby config get --json` returns `file` and `keys`: each has `key` (a dot path; `<…>` marks a part you fill in, such as `accounts.<family>:<name>.args`), `meaning`, `takes`, and the current `value` or, for a key with `<…>`, the `entries` set now. `sideby config get panel.theme --json` returns `key`, `set`, optional `value`, `meaning`, `takes`.
@@ -17,6 +17,33 @@ Accounts with their own (not linked) `settings.json` get no status line readings
17
17
 
18
18
  Codex quota needs no setup: sideby asks the official `codex app-server` every 15 minutes, without a conversation. `sideby quota codex --refresh --json` asks now; `sideby quota check codex off --json` disables querying, as does CI. Local session records are a fallback only until the first successful query; they cannot overwrite fetched quota afterward. On failure, relay `fetchError` and `observedAt`, never call old numbers current. The menu's checked time is separate from each row's `observedAt` and `stale`; readings older than one hour or with a query failure show as older readings, except a reading over an hour old whose login has had no local session since (it stays current; use on the web or other computers is not seen). Claude Code quota refreshes on demand the same way (`sideby quota claude --refresh`). Tested with Codex CLI 0.163.0.
19
19
 
20
+ ## Limit resets and how fresh a number is
21
+
22
+ A **limit reset** is a one-time credit a vendor gives a subscription; using one restores quota before a window resets by itself. Codex tells how many an account holds in the same answer as its quota, so `sideby quota codex --json` carries `quota.limitResets`: `available` (the count), `observedAt` (when it was read) and `nextExpiresAt` (only when Codex says when every available one expires). When the user asks "do I have a reset?" or "有没有重置次数", read that field and say the count and the expiry, or that the expiry is not known. No `limitResets` field means the tool does not tell (Claude Code, Grok Build, Antigravity CLI): say sideby cannot see it, never "none". `available: 0` means Codex said none. Using one is its own step with its own rules: see "Use a limit reset" below. Accounts of the same login share the count; it is said once, on the account the reading came from (`quota.from` on the others).
23
+
24
+ ## Use a limit reset
25
+
26
+ Using a limit reset cannot be undone. **Never add `--yes` on your own**: not to make room for a task, not in a loop, not because the user said "fix my quota". Use one only when the user asked for exactly this, and after they have seen the plan and said yes to it. In a session sideby started under Unattended Mode, and in CI, sideby refuses (`code: "unattended"` or `"ci"`): record it as a decision for the user (`sideby unattended defer "<one line>"`) and go on with other work.
27
+
28
+ **Codex** (the Host uses it):
29
+
30
+ 1. `sideby quota reset <ref> --json` reads the count and the quota from Codex at that moment and exits 10 with the plan: `account`, `sameLogin` (the other accounts of the login; the reset applies to all of them), `quota.windows` (each with `usedPercent` and its own `resetsAt`), `limitResets.available`, `expectedAfter`, `limitResets.nextExpiresAt` (absent: Codex did not say), `operationId` and `message`. `canUse: false` (exit 1) carries `blocked`, the reason and the next step; relay it and stop.
31
+ 2. Show the user that plan in plain words: which account and which other accounts it covers, each window's use and reset time, how many resets they hold and how many are left afterwards, when the next one expires or that it is unknown, that it cannot be undone, and that Codex does not say beforehand which windows it restores (do not promise any). Ask whether to use one.
32
+ 3. Only after a yes: `sideby quota reset <ref> --yes --operation <operationId> --json`. Exit 0 with `outcome: "reset"` (or `"already-done"`: this request had already used one; nothing more was used): tell them the numbers in `quota`, which Codex reported after the reset. `quotaPending: true` means the reset was used but the quota could not be read yet; say that, and that the numbers update with the next check. Exit 1 with `outcome: "nothing-to-reset"` or `"none-left"`: nothing was used; say why.
33
+ 4. An error with `code: "outcome-unknown"` and an `operationId` means no final answer came: sideby cannot tell whether one was used. Say exactly that, then run the same `--yes --operation <operationId>` command once more: it repeats the same request with the same key, which cannot use a second reset. Do not make a new plan while one is unresolved (a new plan shows `unresolved: true` and the same `operationId`). `outcome-not-saved`: the Host answered and the message starts with what it answered (a reset was used, or nothing was spent), but sideby could not write its record of the operation; tell the user that answer and the file the message names, and once the file can be written (disk space, permissions) run the same `--yes --operation <operationId>` command, which repeats the same request and cannot use a second reset. `not-sent`: nothing was sent, nothing was used; make a new plan if the user still wants it. `plan-outdated`, `unknown-operation`, `operation-ended`: the plan is no longer the one to confirm; show a new plan and ask again. `login-changed`: the account is signed in as another login than the one the attempt was sent for, so sideby will not send it from there and the attempt stays unresolved; relay the message, which says which account may still be the original login (retry from that one with `--yes --operation <operationId>`) or to sign in as the original login first. Never work around it with a new plan. `records-unreadable`: a record of an earlier attempt cannot be read, so nothing is sent; relay the path and the fix from the message, and do not move the file yourself. `busy`: another sideby is using one for that login right now; wait and look at the quota.
34
+
35
+ sideby never changes the count or the bars itself: report only what `quota` says.
36
+
37
+ **Claude Code** (only Claude's website can use one): `sideby quota reset <ref> --json` answers `outcome: "open-vendor-page"` with `url` (`https://claude.ai/settings/usage`), `identity` (the account's email) and `tight` (the windows at their warning level). sideby cannot see whether the account holds a reset. Tell the user to use it on that page, signed in as that email; `sideby quota reset <ref> --open` opens the page in the account's browser profile (ask first: it opens a window). Afterwards `sideby quota <ref> --refresh --json` reads the new numbers. Which limit it restores is Anthropic's rule: a Fable reset gives back the Fable share of the week, and a 5-hour reset restores that window whole.
38
+
39
+ Any other tool answers `code: "no-limit-reset"`: say sideby cannot use one there and point to the vendor's own usage page.
40
+
41
+ In the Panel the same is the **Use a reset** button on the account's row (or its ⋯ menu and Search); in the menu bar, **Use a reset…** opens that confirmation.
42
+
43
+ Each window is as old as its own reading. `quota.observedAt` and `quota.source` are the reading's; a window that was read at another time carries its own `observedAt` and `source` (Claude Code's per-model week under a newer status line reading). When you report numbers, give the age of the window you speak about, and do not call a window current because the others are. A window whose `resetsAt` has passed has reset: sideby asks its tool once more by itself when that happens (once per reset time, ADR-0073); if the numbers are still the old ones, run `sideby quota <family> --refresh --json`.
44
+
45
+ sideby asks one account of a same login for the whole group, joins an ask that is already running, and asks at most four tools at once, so a refresh of many accounts can take a little longer than one account; that is expected.
46
+
20
47
  Two accounts of one tool signed in as the same login (Claude: same email and organization; Codex and Grok also compare the workspace or team; `sameLogin` in `sideby list --json`) share one quota: both show the freshest reading, and `quota.from` names the account it was read from. Explain that to the user rather than calling the numbers wrong; usage stays per account, and sideby never merges or deletes either directory.
21
48
 
22
49
  Grok quota needs no setup: sideby asks the `grok` CLI of each signed-in account (`grok agent --no-leader stdio`, the Host makes the request with its own login; sideby never reads `auth.json`) at most every 15 minutes, and also reads the quota Grok logs after each turn. `sideby quota grok --refresh` asks again now. `quota.status: "unavailable"` with `reason: "fetch-failed"` carries the cause and next step in `detail` (update Grok, `sideby login grok:<name>`); `"not-enabled"` means the user turned it off (config `quota.check.grok: false`, or the Panel's Settings) or it runs in CI. A reading with `fetchError` is the last good one; say it may be old.
@@ -12,7 +12,7 @@ What to do:
12
12
  3. When they agree:
13
13
  - Run `sideby update --json`. It shows the version, the install method and the command it would run, and exits `10`. Show that to the user; after their yes, run `sideby update --yes --json`.
14
14
  - If it exits `1` with `canRun: false` (npx, Volta, a project dependency, a source checkout, a Local Build), sideby cannot update itself: give the user the `command` it printed as one line to run.
15
- - The same command updates the installed sideby skill (`skillUpdate` in the plan, `skillUpdated` in the result), so do not run a skill command yourself. With sideby already current and only the skill old (`_notice.skill`), `sideby update` updates the skill alone, after the same preview. To update only the skill and never the CLI, even when a newer sideby is out, run `sideby update --skill --json` (preview, exit `10`), then `--skill --yes --json`. When `skillUpdate.canRun` is false (the skill lives in a git repository the skills tool did not install it into), tell the user `reason` and give them `command`. Tell them that sessions already running keep the old version until they start again.
15
+ - The same command updates the installed sideby skill (`skillUpdate` in the plan, `skillUpdated` in the result; when it is false, `skillMessage` says why and what to run instead), so do not run a skill command yourself. With sideby already current and only the skill old (`_notice.skill`), `sideby update` updates the skill alone, after the same preview. To update only the skill and never the CLI, even when a newer sideby is out, run `sideby update --skill --json` (preview, exit `10`), then `--skill --yes --json`. When `skillUpdate.canRun` is false (the skill lives in a git repository the skills tool did not install it into), tell the user `reason` and give them `command`. Tell them that sessions already running keep the old version until they start again.
16
16
  4. When `sideby update --json` cannot reach the registry (the `update` AI Task, started from an error in the Panel's update dialog, brings that error): behind a proxy, check that the terminal or app that starts sideby has `HTTPS_PROXY` (sideby follows it, as npm does) and that the proxy is on; in mainland China, `SIDEBY_UPDATE_REGISTRY=https://registry.npmmirror.com` uses a mirror. Ask before writing either into a shell config file. A skill for a newer sideby than the CLI is not a problem: update the CLI.
17
17
  5. The user can turn notices off with `SIDEBY_NO_UPDATE_NOTIFIER=1` (or config `update.check: false`); set it for one command when a script needs JSON without `_notice`. A Local Build (`pnpm local`) never has one.
18
18