sideby 0.31.2 → 0.32.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.
- package/README.md +4 -4
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +0 -4
- package/dist/src/cli/commands.js +76 -14
- package/dist/src/cli/format.js +3 -2
- package/dist/src/cli/json-schemas.js +45 -5
- package/dist/src/cli/main.js +19 -159
- package/dist/src/core/ask.js +6 -1
- package/dist/src/core/cli-commands.d.ts +56 -0
- package/dist/src/core/cli-commands.js +842 -0
- package/dist/src/core/handoff-chain.d.ts +9 -3
- package/dist/src/core/handoff-chain.js +3 -2
- package/dist/src/core/handoff-rules.js +5 -5
- package/dist/src/core/handoff-run.js +19 -2
- package/dist/src/core/handoff-select.d.ts +15 -5
- package/dist/src/core/handoff-select.js +34 -22
- package/dist/src/core/handoff.d.ts +36 -3
- package/dist/src/core/handoff.js +57 -18
- package/dist/src/core/pick-commands.d.ts +19 -4
- package/dist/src/core/pick-commands.js +19 -5
- package/dist/src/core/quota-levels.d.ts +67 -4
- package/dist/src/core/quota-levels.js +82 -6
- package/dist/src/core/search-catalog.js +20 -0
- package/dist/src/families/claude/index.js +3 -0
- package/dist/src/families/claude/quota-fetch.d.ts +26 -0
- package/dist/src/families/claude/quota-fetch.js +236 -0
- package/dist/src/handoff/hook.js +5 -0
- package/dist/src/menubar/script.js +8 -3
- package/dist/src/menubar/snapshot.d.ts +9 -5
- package/dist/src/menubar/snapshot.js +37 -24
- package/dist/src/menubar/strings.d.ts +6 -4
- package/dist/src/menubar/strings.js +6 -4
- package/dist/src/panel/handler.js +7 -3
- package/dist/src/panel/i18n.d.ts +15 -0
- package/dist/src/panel/i18n.js +36 -6
- package/dist/src/panel/page-logic.d.ts +32 -8
- package/dist/src/panel/page-logic.js +43 -16
- package/dist/src/panel/page-script.js +129 -17
- package/dist/src/panel/page-styles.js +18 -0
- package/dist/src/panel/page.js +6 -1
- package/dist/src/runtime.d.ts +2 -1
- package/dist/src/runtime.js +10 -4
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.js +2 -0
- package/package.json +2 -2
- package/schemas/commands-list.json +165 -0
- package/schemas/menubar-snapshot.json +3 -3
- package/schemas/next.json +57 -4
- package/skills/sideby/SKILL.md +3 -2
- package/skills/sideby/references/accounts.md +1 -1
- package/skills/sideby/references/ai-tasks.md +2 -2
- package/skills/sideby/references/diagnose.md +1 -1
- package/skills/sideby/references/handoff.md +13 -9
- package/skills/sideby/references/panel.md +11 -1
- package/skills/sideby/references/quota.md +9 -3
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/commands-list.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"common",
|
|
8
|
+
"groups"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"schemaVersion": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"const": 1
|
|
14
|
+
},
|
|
15
|
+
"common": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"description": "Ids of the common commands, most common first."
|
|
21
|
+
},
|
|
22
|
+
"groups": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"required": [
|
|
27
|
+
"id",
|
|
28
|
+
"title",
|
|
29
|
+
"commands"
|
|
30
|
+
],
|
|
31
|
+
"properties": {
|
|
32
|
+
"id": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "A task group such as 'accounts' or 'quota'; an open set."
|
|
35
|
+
},
|
|
36
|
+
"title": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"commands": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"required": [
|
|
44
|
+
"id",
|
|
45
|
+
"usage",
|
|
46
|
+
"description",
|
|
47
|
+
"example",
|
|
48
|
+
"featureId",
|
|
49
|
+
"panel"
|
|
50
|
+
],
|
|
51
|
+
"properties": {
|
|
52
|
+
"id": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Stable, such as 'run' or 'handoff.enable'."
|
|
55
|
+
},
|
|
56
|
+
"usage": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "The command line as `sideby --help` shows it."
|
|
59
|
+
},
|
|
60
|
+
"description": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"example": {
|
|
64
|
+
"anyOf": [
|
|
65
|
+
{
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"type": "null"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"featureId": {
|
|
74
|
+
"anyOf": [
|
|
75
|
+
{
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"type": "null"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"description": "The `sideby commands <words>` result id of its place in the Panel, or null."
|
|
83
|
+
},
|
|
84
|
+
"panel": {
|
|
85
|
+
"anyOf": [
|
|
86
|
+
{
|
|
87
|
+
"type": "string"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "null"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"description": "Where it lives in the Panel, such as \"Settings → General → Language\", or null."
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"_notice": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"properties": {
|
|
104
|
+
"update": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"required": [
|
|
107
|
+
"current",
|
|
108
|
+
"latest",
|
|
109
|
+
"command",
|
|
110
|
+
"message"
|
|
111
|
+
],
|
|
112
|
+
"properties": {
|
|
113
|
+
"current": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"latest": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"command": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
|
|
122
|
+
},
|
|
123
|
+
"message": {
|
|
124
|
+
"type": "string"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"skill": {
|
|
129
|
+
"type": "object",
|
|
130
|
+
"required": [
|
|
131
|
+
"installed",
|
|
132
|
+
"current",
|
|
133
|
+
"command",
|
|
134
|
+
"message"
|
|
135
|
+
],
|
|
136
|
+
"properties": {
|
|
137
|
+
"installed": {
|
|
138
|
+
"anyOf": [
|
|
139
|
+
{
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"type": "null"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"description": "The skill's version; null when it has none."
|
|
147
|
+
},
|
|
148
|
+
"current": {
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
"command": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
|
|
154
|
+
},
|
|
155
|
+
"message": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"description": "Not the answer to the task: mention it briefly afterwards and offer to update."
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"title": "sideby commands --json (no words): the Command List"
|
|
165
|
+
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"title": {
|
|
24
24
|
"type": "string",
|
|
25
|
-
"description": "The words next to the icon, such as `Codex 62%`, once the tightest tool reaches 60
|
|
25
|
+
"description": "The words next to the icon, such as `Codex 62%`, once the tightest tool reaches its warning level (60% of a 5-hour window, 85% of a longer one); empty otherwise."
|
|
26
26
|
},
|
|
27
27
|
"level": {
|
|
28
28
|
"anyOf": [
|
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
},
|
|
564
564
|
"reset": {
|
|
565
565
|
"type": "string",
|
|
566
|
-
"description": "
|
|
566
|
+
"description": "Which window resets and how long until it does, such as `7d · in 4d 17h`: the window closest to its own red level (85% for 5 hours, 95% for longer windows). Empty when nothing is used."
|
|
567
567
|
},
|
|
568
568
|
"note": {
|
|
569
569
|
"type": "string",
|
|
@@ -891,7 +891,7 @@
|
|
|
891
891
|
},
|
|
892
892
|
"reset": {
|
|
893
893
|
"type": "string",
|
|
894
|
-
"description": "
|
|
894
|
+
"description": "Which window resets and how long until it does, such as `7d · in 4d 17h`: the window closest to its own red level (85% for 5 hours, 95% for longer windows). Empty when nothing is used."
|
|
895
895
|
},
|
|
896
896
|
"note": {
|
|
897
897
|
"type": "string",
|
package/schemas/next.json
CHANGED
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"ref",
|
|
41
41
|
"kind",
|
|
42
42
|
"state",
|
|
43
|
-
"pressure"
|
|
43
|
+
"pressure",
|
|
44
|
+
"limitUse"
|
|
44
45
|
],
|
|
45
46
|
"properties": {
|
|
46
47
|
"ref": {
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"const": "logged-out"
|
|
82
83
|
}
|
|
83
84
|
],
|
|
84
|
-
"description": "ready and unknown can be picked; api only with --include-api;
|
|
85
|
+
"description": "ready and unknown can be picked; api only with --include-api; logged-out never. full (a window at or past its own Takeover Limit: 5-hour windows the handoff threshold - 10, windows longer than a day the threshold) only as a Last Resort: when no subscription account is ready or unknown, the one with the lowest limitUse and no window used up, and `tight` is set."
|
|
85
86
|
},
|
|
86
87
|
"pressure": {
|
|
87
88
|
"anyOf": [
|
|
@@ -94,9 +95,43 @@
|
|
|
94
95
|
],
|
|
95
96
|
"description": "Used percent of the fullest window not reset yet; null without quota."
|
|
96
97
|
},
|
|
98
|
+
"limitUse": {
|
|
99
|
+
"anyOf": [
|
|
100
|
+
{
|
|
101
|
+
"type": "number"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"type": "null"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"description": "Limit Use: the percent of its own Takeover Limit that the closest window has used (a weekly 87% under 95 is 91.6); null without quota. Ready accounts rank by it, lowest first."
|
|
108
|
+
},
|
|
109
|
+
"window": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"required": [
|
|
112
|
+
"label",
|
|
113
|
+
"usedPercent",
|
|
114
|
+
"limit"
|
|
115
|
+
],
|
|
116
|
+
"properties": {
|
|
117
|
+
"label": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "Such as `5h` or `7d`."
|
|
120
|
+
},
|
|
121
|
+
"usedPercent": {
|
|
122
|
+
"type": "number",
|
|
123
|
+
"description": "Rounded."
|
|
124
|
+
},
|
|
125
|
+
"limit": {
|
|
126
|
+
"type": "number",
|
|
127
|
+
"description": "This window's Takeover Limit in percent."
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"description": "The window closest to its own Takeover Limit; absent when none is open."
|
|
131
|
+
},
|
|
97
132
|
"resetsAt": {
|
|
98
133
|
"type": "string",
|
|
99
|
-
"description": "For full: when
|
|
134
|
+
"description": "For full: when it is usable again. With a window used up, when those windows reset; otherwise when every window is under its Takeover Limit again."
|
|
100
135
|
},
|
|
101
136
|
"observedAt": {
|
|
102
137
|
"type": "string",
|
|
@@ -118,6 +153,24 @@
|
|
|
118
153
|
"type": "boolean",
|
|
119
154
|
"description": "False when no account has quota data: the pick is then a guess, and `sideby next` does not start it (exit 1)."
|
|
120
155
|
},
|
|
156
|
+
"tight": {
|
|
157
|
+
"type": "object",
|
|
158
|
+
"required": [
|
|
159
|
+
"limit",
|
|
160
|
+
"longLimit"
|
|
161
|
+
],
|
|
162
|
+
"properties": {
|
|
163
|
+
"limit": {
|
|
164
|
+
"type": "number",
|
|
165
|
+
"description": "The Takeover Limit of 5-hour windows in percent (handoff threshold - 10)."
|
|
166
|
+
},
|
|
167
|
+
"longLimit": {
|
|
168
|
+
"type": "number",
|
|
169
|
+
"description": "The Takeover Limit of windows longer than a day in percent (the handoff threshold)."
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"description": "Set when the pick is a Last Resort: every subscription account has a window at or past its Takeover Limit, and the pick is the one with the lowest limitUse and no window used up."
|
|
173
|
+
},
|
|
121
174
|
"earliestReset": {
|
|
122
175
|
"type": "object",
|
|
123
176
|
"required": [
|
|
@@ -132,7 +185,7 @@
|
|
|
132
185
|
"type": "string"
|
|
133
186
|
}
|
|
134
187
|
},
|
|
135
|
-
"description": "Set when nothing can be picked and some accounts are full: the first to come back."
|
|
188
|
+
"description": "Set when nothing can be picked and some accounts are full (every one has a window used up): the first to come back."
|
|
136
189
|
},
|
|
137
190
|
"_notice": {
|
|
138
191
|
"type": "object",
|
package/skills/sideby/SKILL.md
CHANGED
|
@@ -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.
|
|
5
|
+
version: "0.32.0"
|
|
6
6
|
requires:
|
|
7
7
|
bins: [sideby, node]
|
|
8
8
|
cliHelp: sideby --help
|
|
@@ -42,6 +42,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
|
|
|
42
42
|
| Show which account a session is (`[cc001]` in the status line or tab title) | `sideby list --json` for the labels | `references/badge.md` |
|
|
43
43
|
| Find which session an account is running now ("cc002 现在在干嘛", "which session is cc002 running", "哪个会话在等我"), or copy one for another AI ("复制 cc002 的会话 id", "copy cc002's session for another AI", "把这个会话交给另一个 AI"); which Run (dispatched task) a session works for ("cc002 在哪个任务里", "which run is cc002 working on", "打开它的任务看板") | `sideby sessions [<account>\|<family>] --json`, `sideby sessions copy <account\|id> [--as reference\|id\|resume] --json`, `sideby sessions open-run <account\|id> --json` | `references/sessions.md` |
|
|
44
44
|
| Find where a setting, page or feature of sideby lives ("语言在哪改", "where is the dark mode setting", "远程控制在哪关") — not sessions: for those use `sideby history` | `sideby commands <words> --json` (English or Chinese words), then do it with the `cliCommand` it returns or tell the user the `panel` place | `references/panel.md` |
|
|
45
|
+
| See which commands sideby has ("有哪些命令", "which commands exist", "sideby 有哪些和额度有关的命令", "what can I type in a terminal") | `sideby commands --json` (no words): every command by task with `usage`, `description` and a runnable `example`, the `common` ones first | `references/panel.md` |
|
|
45
46
|
| Find a session from before, in any account ("find a session I had before", "找一下我上周改登录页的那个会话", "sideby 项目最近的会话", "按日期分组看看"), read it, or continue it where it was | `sideby history [<words>...] [--project <name>] [--since today\|7d\|30d] [--group project\|day\|category] --json`, `sideby history show <id> --json`, `sideby history projects --json`; `--tools` also searches tool output | `references/sessions.md` |
|
|
46
47
|
| Tell another running session something, or send it a screenshot ("告诉 cc002 ……", "把这张截图发给 cc003", "send this to the codex session", "tell cc002 the tests pass"); see what was sent and whether it was read ("cc002 看到我的消息了吗"); let Claude sessions show such messages at once instead of waiting for approval ("消息老要我批准", "让 cc002 直接收消息") | `sideby send <account\|session> "<text>" [--image <path>]... --json`, `sideby messages [--to <account\|session>] --json`, `sideby messages inbound --json`, then `sideby messages inbound accept` (exits 10 with the change; rerun with `--yes` after they agree) | `references/sessions.md` |
|
|
47
48
|
| See every session from inside Claude Code ("在这里看所有会话", "show my sessions in Claude Code"), or turn off the label line and `/sessions` pane sideby adds to Claude Code ("关掉 sideby 的横带", "turn off the sideby mod") | tell the user to type `/sessions`; `sideby config set claudeMod false --json` (or `true`) | `references/sessions.md` |
|
|
@@ -75,7 +76,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
|
|
|
75
76
|
| 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) | — |
|
|
76
77
|
| 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` |
|
|
77
78
|
| 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` |
|
|
78
|
-
| See Claude quota
|
|
79
|
+
| 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` |
|
|
79
80
|
| Update sideby or its skill ("is there a new version", "更新 sideby"), or an output has `_notice` | `sideby update --json` (exits 10 first) | `references/update.md` |
|
|
80
81
|
| See everything at once | `sideby ui` (local panel on `127.0.0.1:17420`; `--no-open` prints the address) | — |
|
|
81
82
|
| Start an account | give them `sideby run <ref> [-- host args]` | — |
|
|
@@ -44,7 +44,7 @@ To start one account with fixed Host arguments, such as another model, put them
|
|
|
44
44
|
|
|
45
45
|
## Pick commands (start the account with the most room)
|
|
46
46
|
|
|
47
|
-
A pick command is a short command bound to a tool (Family), not to one account: each run starts the account of that tool `sideby next` would pick, the one
|
|
47
|
+
A pick command is a short command bound to a tool (Family), not to one account: each run starts the account of that tool `sideby next` would pick, the one furthest from its limits, and prints which (`cc → claude:work (5h 12% used, the most room)`). When no account of the tool has quota data yet it starts the main account and says so. When every account is past its Takeover Limit (by default 85% of a 5-hour window, 95% of a weekly one) it still starts the one with the most left under 100% and says so (`cc → claude:008 (every claude account is past its limit, 85% of a 5-hour window or 95% of a weekly one; this one has the most left, 5h 88% used)`); only when every account has a window used up or is signed out does it start nothing and say which comes back first. API accounts are never picked.
|
|
48
48
|
|
|
49
49
|
- Add: `sideby alias add <short> --pick <family> --json` exits 10 with `status: "confirm"` and writes nothing; tell the user what it adds, then run it again with `--yes`. Then make sure new terminals load it: `sideby shell-init setup --json` (see `setup.md` step 7). Offer `cc` for Claude, `cx` for Codex, `gk` for Grok, or the letters the user's numbered short commands share (`cc001`, `cc008` → `cc`); pi gets none, since `pi` is the tool itself. `sideby new` offers one (`pickCommandOffer`) when a tool gets its second subscription account.
|
|
50
50
|
- With `shadows` in that answer, the name hides a command on PATH (for example `/usr/bin/cc`, the C compiler on macOS). Tell the user that typing the name would start the tool instead, and run again with `--yes` only after they agree to that, or pick another name.
|
|
@@ -42,7 +42,7 @@ The prompt lists the Findings (`code`, account, message). Run `sideby doctor <re
|
|
|
42
42
|
|
|
43
43
|
## quota: an account shows no quota or an error
|
|
44
44
|
|
|
45
|
-
The prompt names the account and the reason. Run `sideby quota <ref> --json` and relay what it says. Common answers: Claude
|
|
45
|
+
The prompt names the account and the reason. Run `sideby quota <ref> --json` and relay what it says. Common answers: Claude's or Grok's quota check may be off (`sideby quota check claude on`, `sideby quota check grok on`) or failed (relay `detail`); a signed-out account needs the user to sign in; pi and API accounts have no public quota source, which is not an error.
|
|
46
46
|
|
|
47
47
|
## account: add an account
|
|
48
48
|
|
|
@@ -113,7 +113,7 @@ The prompt gives Auto Handoff as it is now, in the words of `sideby handoff stat
|
|
|
113
113
|
|
|
114
114
|
1. Run `sideby handoff status --json` and `sideby quota --json` to see the facts as they are now.
|
|
115
115
|
2. Recommend, with a reason the user can follow: a `threshold` (the quota percentage at which a session hands over; leave room before 100 so the session can finish its turn) and a `prepareAt` below it; an order per Family (`pressure`, the least used first, or a fixed `order` of accounts); and whether `sameFamily` should be on. Accounts signed in as the same login share one quota and never hand over to each other.
|
|
116
|
-
3. Put accounts without quota data last, and tell the user how to make them show it (`sideby quota
|
|
116
|
+
3. Put accounts without quota data last, and tell the user how to make them show it (signing in, `sideby quota check <family> on`). For Auto Handoff from Claude, also `sideby quota setup claude` (exit 10 first), which it reads during a session.
|
|
117
117
|
4. Change settings only with `sideby handoff enable [--same-family] [--order <family>=<acct,…>] [--threshold n] [--prepare-at n]` or `sideby config set handoff.<key> <value>`. Both show the change first and exit 10; add `--yes` only after the user agrees.
|
|
118
118
|
5. Run `sideby handoff status --json` again and tell the user what is still missing (`nextSteps`).
|
|
119
119
|
|
|
@@ -27,7 +27,7 @@ Shared Items the Main Account does not have are skipped: no Finding, not counted
|
|
|
27
27
|
| name looks like a backup (`bak`, `backup`, `old`, `tmp`) | A stray directory was picked up as an account | Suggest adding its ref to `ignore` in `${XDG_CONFIG_HOME:-~/.config}/sideby/config.json` |
|
|
28
28
|
| `login: "not-needed"` (`key` in `sideby list`) | API account; it authenticates with `proxy.env` | Nothing to do |
|
|
29
29
|
| `problems` on an account in `list --json` | A plugin failed while reading it (for example a settings file that is not valid JSON) | Show the message; the account itself still works |
|
|
30
|
-
| quota `unavailable` / `not-enabled` |
|
|
30
|
+
| quota `unavailable` / `not-enabled` | Quota checks for that tool are off (config `quota.check.<family>: false`) or it runs in CI | Offer `sideby quota check <family> on` |
|
|
31
31
|
| quota `unavailable` / `no-session` | No session since the source was enabled | Ask the user to start one session with that account |
|
|
32
32
|
| quota `unavailable` / `no-source` | pi: the Host has no public source | Nothing to fix |
|
|
33
33
|
| quota `unavailable` / `fetch-failed` | Grok: its CLI could not get the quota | Follow `detail` (update Grok, `sideby login grok:<name>`), then `sideby quota grok --refresh` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Handoff: keep working on another account
|
|
2
2
|
|
|
3
|
-
Use this when the user says an account hit its 5-hour or weekly limit ("usage limit reached", "rate limited", "resets at …") and wants to keep working, or asks which account has room. sideby recommends the account of the same family
|
|
3
|
+
Use this when the user says an account hit its 5-hour or weekly limit ("usage limit reached", "rate limited", "resets at …") and wants to keep working, or asks which account has room. sideby recommends the account of the same family that is furthest from its limits (lowest `limitUse`), and the user starts it. Only Auto Handoff, which the user turns on in the config, moves a running task by itself (see below).
|
|
4
4
|
|
|
5
5
|
## Steps
|
|
6
6
|
|
|
@@ -9,12 +9,16 @@ Use this when the user says an account hit its 5-hour or weekly limit ("usage li
|
|
|
9
9
|
|
|
10
10
|
| `state` | Meaning | Can be picked |
|
|
11
11
|
|---|---|---|
|
|
12
|
-
| `ready` | Subscription account with
|
|
13
|
-
| `unknown` | No quota data yet (
|
|
12
|
+
| `ready` | Subscription account with every live window under its own limit. `pressure` is its fullest live window in percent; `limitUse` is the percent of its own limit that its closest window has used, and `window` names that window (`label`, `usedPercent`, `limit`) | Yes, lowest `limitUse` first |
|
|
13
|
+
| `unknown` | No quota data yet (not asked yet, quota checks are off, or the ask failed) | Yes, after `ready` |
|
|
14
14
|
| `api` | API account, pay per use | Only with `--include-api` |
|
|
15
|
-
| `full` | A live window is
|
|
15
|
+
| `full` | A live window is at or past its own Takeover Limit: a 5-hour window at the Auto Handoff threshold − 10 (85% by default), a weekly or longer window at the threshold (95% by default); `resetsAt` is when it is usable again | Only as a last resort, see below |
|
|
16
16
|
| `logged-out` | Needs `sideby login <ref>` | No |
|
|
17
17
|
|
|
18
|
+
When no subscription account is `ready` or `unknown`, the pick is the `full` one with no window used up (`pressure` under 100%) and the lowest `limitUse`, ahead of API accounts, and the plan has `tight: { limit, longLimit }` (the 5-hour and the weekly limit). Tell the user every account is past its limit and the pick has the most left (for example "every claude account is past its limit; claude:008 has the most left, its 5-hour window at 88%"), so they know it may run out soon. Auto Handoff never does this.
|
|
19
|
+
|
|
20
|
+
The two limits differ because one full 5-hour window costs only about a fifth of a week: a week at 87% is still `ready` and yellow, not red. When the user asks why such an account was picked, say that.
|
|
21
|
+
|
|
18
22
|
Each entry's `observedAt` says when its quota was recorded (`quotaFrom` when it was read from another account of the same login). An entry with `sameLoginAs` is signed in as the same login as the account you run in: it shares that quota and is never picked. If `hasQuota` is `false`, no account has quota data: the pick is only a guess, so say so and suggest turning quota on (see the routing table in SKILL.md) or letting the user choose.
|
|
19
23
|
3. Give the user the command to run in their own terminal: `sideby next <family>` (starts the pick) or `sideby run <pick>`. Host arguments go after `--`. Do not run it yourself.
|
|
20
24
|
4. Offer a handoff note: the new session starts empty, because each account keeps its own sessions. Write a short note the user can paste into it: the goal, what is done, what is in progress, the files involved, and the next step.
|
|
@@ -23,7 +27,7 @@ Use this when the user says an account hit its 5-hour or weekly limit ("usage li
|
|
|
23
27
|
|
|
24
28
|
`pick` is `null` and the exit code is 1:
|
|
25
29
|
|
|
26
|
-
- Every account
|
|
30
|
+
- Every signed-in account has a window used up (100%): tell the user `earliestReset.ref` comes back at `earliestReset.at`.
|
|
27
31
|
- Accounts `logged-out`: the user can sign in with `sideby login <ref>`.
|
|
28
32
|
- Only `api` left: ask whether they want to pay per use before suggesting `sideby next <family> --include-api`.
|
|
29
33
|
|
|
@@ -31,9 +35,9 @@ Use this when the user says an account hit its 5-hour or weekly limit ("usage li
|
|
|
31
35
|
|
|
32
36
|
- Error `code: "no-quota-source"` (pi, or a plugin family without quota): the Host publishes no quota. The message lists the family's accounts; let the user choose one for `sideby run <ref>`.
|
|
33
37
|
- Error `code: "no-accounts"`: the family has no account yet; see creating accounts.
|
|
34
|
-
- Many `unknown` Claude accounts: Claude quota may be off. `sideby quota --json` shows `not-enabled
|
|
38
|
+
- Many `unknown` Claude accounts: Claude quota checks may be off or failing. `sideby quota claude --json` shows `not-enabled` (turn them on with `sideby quota check claude on`) or `fetch-failed` with the next step in `detail`.
|
|
35
39
|
- Host arguments the user wants (another model, say) go after `--`: `sideby next claude -- --model opus`.
|
|
36
|
-
- Quota is only as fresh as
|
|
40
|
+
- Quota is only as fresh as its `observedAt`. Do not promise an account has room; say what the data shows and when it was recorded.
|
|
37
41
|
|
|
38
42
|
## Auto Handoff (the user turns it on)
|
|
39
43
|
|
|
@@ -42,8 +46,8 @@ With config `"handoff": { "auto": true }`, a session sideby started hands its ta
|
|
|
42
46
|
- When sideby tells you the quota is at 80%, write the handoff brief at the path it names and keep it current (do not tell the user that another account will take over; sideby decides that and says so itself): the goal, what is done, the remaining steps, key decisions and why, the files that matter. Reference specs, ADRs, commits and diffs by path; list the skills the next agent should use; never include keys, passwords or personal data.
|
|
43
47
|
- When it says a window is about to run out (the message names it, such as "weekly (7d) quota is at 98%"; each window hands over at its own pace, ADR-0032), finish the current step, update the brief, and end your turn. sideby starts the next account from it.
|
|
44
48
|
- End the brief with the line `<!-- handoff brief complete -->` once it is complete. Without it sideby asks once more, then adds its own records under what you wrote.
|
|
45
|
-
- When a user asks why a session handed over "with 95% left": the 5-hour and weekly windows are separate, and the fullest one decides. Run `sideby quota` and read both windows.
|
|
46
|
-
- When the user asks to hand over now, update the brief, run `sideby handoff ready` (add `--brief <file>` when the user's own handoff tool wrote one), and end your turn. Tell the user the account it prints, not what `sideby next` says: the chain goes back to an account it already used only once the quota window that account handed over for has reset. When the user names an account ("go back to cc008"), run `sideby handoff ready --to <account>`; it works for an account this chain already used. When the quota is about to run out and sideby says the session will wait for the reset, the user can move on at once by typing `! sideby handoff ready` in the session (the model cannot answer at the limit);
|
|
49
|
+
- When a user asks why a session handed over "with 95% left": the 5-hour and weekly windows are separate, and the fullest one decides when to hand over. Run `sideby quota` and read both windows. Which account takes over is judged per window: a 5-hour window stops it at 85%, a weekly one at 95% (with the default threshold).
|
|
50
|
+
- When the user asks to hand over now, update the brief, run `sideby handoff ready` (add `--brief <file>` when the user's own handoff tool wrote one), and end your turn. Tell the user the account it prints, not what `sideby next` says: the chain goes back to an account it already used only once the quota window that account handed over for has reset, or, for an account handed over from by hand, once its own quota shows room (not while its quota is unknown). When the user names an account ("go back to cc008"), run `sideby handoff ready --to <account>`; it works for an account this chain already used. When the quota is about to run out and sideby says the session will wait for the reset, the user can move on at once by typing `! sideby handoff ready` in the session (the model cannot answer at the limit); the same works when the session hit its limit and no account could take over then, once one can. Tell them so if they ask why nothing moved.
|
|
47
51
|
|
|
48
52
|
### Turning it on for the user
|
|
49
53
|
|
|
@@ -12,6 +12,16 @@ agrees), or tell the user the `panel` place, such as `Settings → General → L
|
|
|
12
12
|
try other words. It finds features only; to find a past session use `sideby history <words> --json`
|
|
13
13
|
(`references/sessions.md`).
|
|
14
14
|
|
|
15
|
+
## Which commands exist
|
|
16
|
+
|
|
17
|
+
When the user asks which commands sideby has ("有哪些命令", "which commands are there for quota", "what can I type"),
|
|
18
|
+
run `sideby commands --json` with no words. It returns the Command List, the same list `sideby --help` prints and the
|
|
19
|
+
Panel's Commands dialog shows (button next to Search, or `?`): `{ common: [id], groups: [{ id, title, commands: [{ id,
|
|
20
|
+
usage, description, example, featureId, panel }] }] }`. Answer with the few commands that fit the question, each with its
|
|
21
|
+
`description` and `example` (a line that runs as is; fill in the user's own account refs from `sideby list --json`).
|
|
22
|
+
`featureId` and `panel` say where the same thing lives in the Panel, or are null. Group ids are an open set. For one
|
|
23
|
+
command's details, run `sideby <command> --help`.
|
|
24
|
+
|
|
15
25
|
## Pinned Accounts and Display Order
|
|
16
26
|
|
|
17
27
|
- `sideby order --json` returns `display` (saved `families`, `accounts`, `pinned`) and `families` in their effective order. Each family has `accounts` with `name`, `ref`, `pinned`; a family with no accounts has an empty array.
|
|
@@ -64,6 +74,6 @@ To turn it on ("start sideby at login", "开机启动"), run `sideby autostart o
|
|
|
64
74
|
|
|
65
75
|
`sideby menubar --json` returns the same fields as `autostart` (`supported`, `state`, `path`, `current`, `missing?`), plus `loaded` and `hotkey`, for the Menu Bar Item, the sideby icon in the macOS menu bar. To turn it on ("show my quota in the menu bar", "状态栏显示额度"), run `sideby menubar on --json`: exit 10 shows the file (`~/Library/LaunchAgents/dev.sideby.menubar.plist`, which runs the system's `osascript` with the whole menu script and this sideby). Tell the user it adds a login item that shows quota in the menu bar from now on, and run `sideby menubar on --yes --json` after they agree; `sideby menubar off --yes` removes it. The same refusals as `autostart` apply (`unsupported`, `foreign`, `npx-cache`, `temp-dir`, `unsafe-path`), and `sideby update` keeps it pointing at the new version.
|
|
66
76
|
|
|
67
|
-
The icon stands alone while every tool has quota left. In each tool sideby takes how much the account `sideby next` would pick has used; when the
|
|
77
|
+
The icon stands alone while every tool has quota left. In each tool sideby takes how much the account `sideby next` would pick has used; when the tightest of those reaches its warning level, the title shows that tool and percent, such as `Codex 61%`: a 5-hour window turns orange at 60% and red at 85%, a weekly one orange at 85% and red at 95% (ADR-0062). Each row's `reset` names the window that runs out first and when it resets (`7d · in 4d 17h`). The menu's first line (`headline`) names that account either way. `sideby menubar snapshot --json` prints what the menu shows (`title`, `level`, `headline`, `sections[].rows[]` with `bars`, `reset`, `note` and `recommended`, and `sections[].more` for API key and signed-out accounts); use it to answer "what does my menu bar say". Clicking an account runs `sideby menubar start <account>`, which opens it in the Preferred Terminal. ⌥X opens and closes the menu from anywhere; it needs no macOS permission. To change it ("换个快捷键", "change the menu bar shortcut"), run `sideby menubar hotkey <keys> --json`: `cmd` or `ctrl`, any of `opt` and `shift`, and one letter or digit, such as `ctrl+opt+s`; `off` turns it off, `default` goes back to ⌥X, and a running menu bar item takes it within seconds without a restart (`nudged`). A refusal says why in `code`: `hotkey.reserved` (macOS and most apps use it, such as ⌘Q), `hotkey.needs-modifier` (no opt, cmd or ctrl), `hotkey.invalid`. `sideby menubar hotkey --json` shows it: `registered: false` means macOS did not accept the key, so suggest another. macOS does not tell when another app uses the same keys (both may be accepted), so when the user says the shortcut does nothing, suggest another one too. The Panel has the same as a list (⌥X, ⌥Z, ⌥⌘S, ⌃⌥S, Off, Custom…) in **Menu bar icon ›** under the menu bar switch, with "Can't see the icon?" and "Let AI check it" (`sideby ask --task menubar`).
|
|
68
78
|
|
|
69
79
|
When the user cannot see the icon ("状态栏没有图标", "the menu bar icon is gone"), read `sideby menubar --json` first. `state: "off"`: it was turned off, often with the menu's "Hide from Menu Bar…"; offer `sideby menubar on --yes`. `state: "on"` with `loaded: false`: on but not running (macOS let it go, for example after an update); `sideby menubar on --yes --json` starts it again without changing the file. `loaded: true`: it runs but is hidden. `icon.visible: false` says so for certain: the menu bar is full and macOS put it behind « (click « to see it, or set it to always show in System Settings › Menu Bar). Otherwise check System Settings › Menu Bar (osascript turned off) and menu bar organizers such as Ice or Bartender.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Claude quota
|
|
2
2
|
|
|
3
|
-
Claude quota needs
|
|
3
|
+
Claude quota needs no setup: sideby asks Claude Code itself (ADR-0063). For each signed-in subscription account it runs `claude -p /usage --no-session-persistence --output-format json` with that account's config directory, with the user's hooks and MCP servers off, at most every 15 minutes. Claude Code answers with its own sign-in and starts no model turn (tried with Claude Code 2.1.314 on 2026-10-30); sideby reads no credential and keeps only the 5-hour, weekly and per-model weekly windows. `sideby quota claude --refresh` asks again now. `sideby quota check claude off --json` (config `quota.check.claude: false`) turns it off, as does CI. On `reason: "fetch-failed"`, relay the next step in `detail` (update Claude Code or sideby, or `sideby login <ref>`). A window with a model `name` (Claude Code's `Current week (<model>)`) covers only that model: show it, but it does not decide which account is picked.
|
|
4
|
+
|
|
5
|
+
## Live quota for Auto Handoff (the status line tap)
|
|
6
|
+
|
|
7
|
+
While a session runs, Claude Code also hands each reply's official `rate_limits` (5-hour and 7-day used percent and reset time) to its status line command; sideby shows the newer of that and the `/usage` answer. Auto Handoff reads only this one, so it needs a one-time change to `~/.claude/settings.json`: the status line command becomes `sideby statusline-tap --orig-b64 <base64 of the original command>`, and sideby caches the readings per account. Nothing is sent anywhere. Offer it when the user turns on Auto Handoff, not just to see quota.
|
|
4
8
|
|
|
5
9
|
1. sideby must be installed globally (`npm i -g sideby`), because Claude Code runs the wrapper on every status line refresh. Setup is refused when `sideby` is missing from PATH or comes from the npx cache; tell the user to install it rather than working around it.
|
|
6
10
|
2. Run `sideby quota setup claude`. It prints the diff, changes nothing and exits **10**: show the diff to the user.
|
|
@@ -9,9 +13,9 @@ Claude quota needs a one-time change to `~/.claude/settings.json`: the status li
|
|
|
9
13
|
|
|
10
14
|
Setup also sets `statusLine.refreshInterval: 30` (kept if the user set one), so the quota stays current while a session waits on background agents. When `sideby handoff status` or `sideby doctor` (`handoff.quota-refresh`) asks for it, the status line was wrapped by an older sideby: run `sideby quota setup claude` again; the plan has `upgrade: true` and adds only that key. Ask before `--yes` as above.
|
|
11
15
|
|
|
12
|
-
Accounts with their own (not linked) `settings.json`
|
|
16
|
+
Accounts with their own (not linked) `settings.json` get no status line readings until that file's status line is wrapped the same way; they still show the `/usage` answer. Tell the user instead of editing it.
|
|
13
17
|
|
|
14
|
-
|
|
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.
|
|
15
19
|
|
|
16
20
|
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.
|
|
17
21
|
|
|
@@ -21,6 +25,8 @@ Antigravity CLI (`agy`, main account only) quota also needs no setup: sideby run
|
|
|
21
25
|
|
|
22
26
|
A window with a `name` (a plugin's Cursor "Other models") covers only some models: show it, but it does not make the account full.
|
|
23
27
|
|
|
28
|
+
Colors depend on the window's length (ADR-0062): a 5-hour (or any one-day-or-shorter) window is yellow from 60% and red from 85%; a weekly or longer window is yellow from 85% and red from 95%. One full 5-hour window costs only about a fifth of a week, so a week at 87% still leaves several 5-hour windows of work. When the user asks why a weekly 87% is not red, or why such an account was still picked, say that.
|
|
29
|
+
|
|
24
30
|
Usage (7-day tokens) is read by sideby itself from Claude Code and Codex local records; no ccusage is needed. Grok and pi have no usage source; pi has no quota either.
|
|
25
31
|
|
|
26
32
|
## Quota checks and refresh
|