sideby 0.17.0 → 0.18.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 (95) hide show
  1. package/README.md +3 -1
  2. package/ai-tasks.json +90 -0
  3. package/dist/build.json +1 -1
  4. package/dist/src/cli/commands.d.ts +9 -1
  5. package/dist/src/cli/commands.js +349 -14
  6. package/dist/src/cli/json-schemas.js +157 -18
  7. package/dist/src/cli/main.js +56 -7
  8. package/dist/src/core/after-install.d.ts +54 -0
  9. package/dist/src/core/after-install.js +78 -0
  10. package/dist/src/core/ask.d.ts +73 -1
  11. package/dist/src/core/ask.js +106 -6
  12. package/dist/src/core/autostart.d.ts +38 -8
  13. package/dist/src/core/autostart.js +85 -39
  14. package/dist/src/core/brand-mark.d.ts +49 -11
  15. package/dist/src/core/brand-mark.js +116 -38
  16. package/dist/src/core/config.d.ts +5 -0
  17. package/dist/src/core/config.js +11 -1
  18. package/dist/src/core/desktop-app.d.ts +1 -1
  19. package/dist/src/core/desktop-app.js +2 -2
  20. package/dist/src/core/edit-settings.d.ts +24 -0
  21. package/dist/src/core/edit-settings.js +97 -0
  22. package/dist/src/core/handoff-brief.d.ts +4 -2
  23. package/dist/src/core/handoff-brief.js +6 -1
  24. package/dist/src/core/handoff-chain.d.ts +24 -0
  25. package/dist/src/core/handoff-chain.js +2 -0
  26. package/dist/src/core/handoff-run.d.ts +4 -3
  27. package/dist/src/core/handoff-run.js +14 -9
  28. package/dist/src/core/launch.d.ts +2 -0
  29. package/dist/src/core/launch.js +14 -10
  30. package/dist/src/core/local-build.d.ts +12 -5
  31. package/dist/src/core/local-build.js +49 -31
  32. package/dist/src/core/lock.d.ts +30 -0
  33. package/dist/src/core/lock.js +143 -0
  34. package/dist/src/core/quota-levels.d.ts +6 -1
  35. package/dist/src/core/quota-levels.js +16 -5
  36. package/dist/src/core/task-spec.d.ts +95 -0
  37. package/dist/src/core/task-spec.js +209 -0
  38. package/dist/src/core/terminal.js +6 -1
  39. package/dist/src/core/update.d.ts +27 -16
  40. package/dist/src/core/update.js +67 -93
  41. package/dist/src/desktop/icon.js +12 -15
  42. package/dist/src/families/claude/ai-task.d.ts +8 -0
  43. package/dist/src/families/claude/ai-task.js +38 -0
  44. package/dist/src/families/claude/handoff-hook.js +4 -4
  45. package/dist/src/families/claude/index.js +3 -0
  46. package/dist/src/families/codex/handoff-hook.js +4 -4
  47. package/dist/src/families/codex/index.js +9 -0
  48. package/dist/src/families/grok/handoff-hook.js +4 -4
  49. package/dist/src/families/grok/index.js +1 -0
  50. package/dist/src/families/pi/index.js +1 -0
  51. package/dist/src/handoff/hook.js +51 -30
  52. package/dist/src/handoff/levels.d.ts +24 -0
  53. package/dist/src/handoff/levels.js +70 -0
  54. package/dist/src/handoff/messages.d.ts +6 -3
  55. package/dist/src/handoff/messages.js +20 -7
  56. package/dist/src/handoff/reader.d.ts +6 -3
  57. package/dist/src/menubar/agent.d.ts +3 -0
  58. package/dist/src/menubar/agent.js +21 -0
  59. package/dist/src/menubar/script.d.ts +8 -0
  60. package/dist/src/menubar/script.js +457 -0
  61. package/dist/src/menubar/snapshot.d.ts +115 -0
  62. package/dist/src/menubar/snapshot.js +255 -0
  63. package/dist/src/menubar/strings.d.ts +87 -0
  64. package/dist/src/menubar/strings.js +88 -0
  65. package/dist/src/panel/background.js +12 -19
  66. package/dist/src/panel/handler.d.ts +12 -0
  67. package/dist/src/panel/handler.js +80 -80
  68. package/dist/src/panel/i18n.d.ts +33 -0
  69. package/dist/src/panel/i18n.js +66 -0
  70. package/dist/src/panel/page-logic.d.ts +105 -0
  71. package/dist/src/panel/page-logic.js +170 -15
  72. package/dist/src/panel/page-script.js +238 -109
  73. package/dist/src/panel/page-styles.js +42 -13
  74. package/dist/src/panel/page.d.ts +7 -0
  75. package/dist/src/panel/page.js +5 -0
  76. package/dist/src/runtime.d.ts +9 -1
  77. package/dist/src/runtime.js +11 -3
  78. package/dist/src/types.d.ts +14 -0
  79. package/package.json +4 -3
  80. package/schemas/ask-choices.json +168 -0
  81. package/schemas/ask-print.json +87 -0
  82. package/schemas/config.json +17 -1
  83. package/schemas/edit.json +119 -0
  84. package/schemas/error.json +4 -0
  85. package/schemas/families.json +4 -0
  86. package/schemas/list.json +4 -0
  87. package/schemas/local.json +1 -1
  88. package/schemas/menubar-snapshot.json +646 -0
  89. package/schemas/menubar-start.json +112 -0
  90. package/schemas/menubar.json +165 -0
  91. package/skills/sideby/SKILL.md +6 -2
  92. package/skills/sideby/references/ai-tasks.md +10 -0
  93. package/skills/sideby/references/handoff.md +3 -1
  94. package/skills/sideby/references/panel.md +6 -0
  95. package/skills/sideby/references/update.md +1 -1
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "sideby/menubar-start.json",
4
+ "type": "object",
5
+ "required": [
6
+ "schemaVersion",
7
+ "task",
8
+ "account",
9
+ "terminal",
10
+ "opened",
11
+ "command"
12
+ ],
13
+ "properties": {
14
+ "schemaVersion": {
15
+ "type": "number",
16
+ "const": 1
17
+ },
18
+ "task": {
19
+ "type": "string"
20
+ },
21
+ "account": {
22
+ "type": "string"
23
+ },
24
+ "terminal": {
25
+ "type": "string"
26
+ },
27
+ "opened": {
28
+ "type": "boolean"
29
+ },
30
+ "command": {
31
+ "type": "string",
32
+ "description": "The command the terminal runs; paste it into a terminal when `opened` is false."
33
+ },
34
+ "reason": {
35
+ "type": "string",
36
+ "enum": [
37
+ "not-installed",
38
+ "automation-denied",
39
+ "npx-cache",
40
+ "unsafe-path",
41
+ "failed",
42
+ "unsupported-platform"
43
+ ]
44
+ },
45
+ "detail": {
46
+ "type": "string",
47
+ "description": "What to do next, for a person."
48
+ },
49
+ "_notice": {
50
+ "type": "object",
51
+ "properties": {
52
+ "update": {
53
+ "type": "object",
54
+ "required": [
55
+ "current",
56
+ "latest",
57
+ "command",
58
+ "message"
59
+ ],
60
+ "properties": {
61
+ "current": {
62
+ "type": "string"
63
+ },
64
+ "latest": {
65
+ "type": "string"
66
+ },
67
+ "command": {
68
+ "type": "string",
69
+ "description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
70
+ },
71
+ "message": {
72
+ "type": "string"
73
+ }
74
+ }
75
+ },
76
+ "skill": {
77
+ "type": "object",
78
+ "required": [
79
+ "installed",
80
+ "current",
81
+ "command",
82
+ "message"
83
+ ],
84
+ "properties": {
85
+ "installed": {
86
+ "anyOf": [
87
+ {
88
+ "type": "string"
89
+ },
90
+ {
91
+ "type": "null"
92
+ }
93
+ ],
94
+ "description": "The skill's version; null when it has none."
95
+ },
96
+ "current": {
97
+ "type": "string"
98
+ },
99
+ "command": {
100
+ "type": "string",
101
+ "description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
102
+ },
103
+ "message": {
104
+ "type": "string"
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "description": "Not the answer to the task: mention it briefly afterwards and offer to update."
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,165 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "sideby/menubar.json",
4
+ "type": "object",
5
+ "required": [
6
+ "schemaVersion",
7
+ "supported",
8
+ "state",
9
+ "path",
10
+ "current"
11
+ ],
12
+ "properties": {
13
+ "schemaVersion": {
14
+ "type": "number",
15
+ "const": 1
16
+ },
17
+ "supported": {
18
+ "type": "boolean",
19
+ "description": "False on a system sideby cannot start at login yet; `reason` says so."
20
+ },
21
+ "reason": {
22
+ "type": "string"
23
+ },
24
+ "state": {
25
+ "anyOf": [
26
+ {
27
+ "type": "string",
28
+ "const": "off"
29
+ },
30
+ {
31
+ "type": "string",
32
+ "const": "on"
33
+ },
34
+ {
35
+ "type": "string",
36
+ "const": "stale"
37
+ },
38
+ {
39
+ "type": "string",
40
+ "const": "foreign"
41
+ }
42
+ ],
43
+ "description": "`stale`: the Node or sideby it starts no longer exists; `foreign`: a file at that path that sideby did not write."
44
+ },
45
+ "path": {
46
+ "type": "string"
47
+ },
48
+ "programArguments": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "string"
52
+ }
53
+ },
54
+ "current": {
55
+ "type": "boolean",
56
+ "description": "The menu bar item runs this sideby with this Node."
57
+ },
58
+ "missing": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "string"
62
+ }
63
+ },
64
+ "action": {
65
+ "anyOf": [
66
+ {
67
+ "type": "string",
68
+ "const": "on"
69
+ },
70
+ {
71
+ "type": "string",
72
+ "const": "off"
73
+ }
74
+ ]
75
+ },
76
+ "changed": {
77
+ "type": "boolean"
78
+ },
79
+ "applied": {
80
+ "type": "boolean"
81
+ },
82
+ "content": {
83
+ "type": "string",
84
+ "description": "The file `on` writes."
85
+ },
86
+ "commands": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string"
92
+ }
93
+ }
94
+ },
95
+ "loaded": {
96
+ "type": "boolean",
97
+ "description": "launchd took the change now."
98
+ },
99
+ "note": {
100
+ "type": "string"
101
+ },
102
+ "_notice": {
103
+ "type": "object",
104
+ "properties": {
105
+ "update": {
106
+ "type": "object",
107
+ "required": [
108
+ "current",
109
+ "latest",
110
+ "command",
111
+ "message"
112
+ ],
113
+ "properties": {
114
+ "current": {
115
+ "type": "string"
116
+ },
117
+ "latest": {
118
+ "type": "string"
119
+ },
120
+ "command": {
121
+ "type": "string",
122
+ "description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
123
+ },
124
+ "message": {
125
+ "type": "string"
126
+ }
127
+ }
128
+ },
129
+ "skill": {
130
+ "type": "object",
131
+ "required": [
132
+ "installed",
133
+ "current",
134
+ "command",
135
+ "message"
136
+ ],
137
+ "properties": {
138
+ "installed": {
139
+ "anyOf": [
140
+ {
141
+ "type": "string"
142
+ },
143
+ {
144
+ "type": "null"
145
+ }
146
+ ],
147
+ "description": "The skill's version; null when it has none."
148
+ },
149
+ "current": {
150
+ "type": "string"
151
+ },
152
+ "command": {
153
+ "type": "string",
154
+ "description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
155
+ },
156
+ "message": {
157
+ "type": "string"
158
+ }
159
+ }
160
+ }
161
+ },
162
+ "description": "Not the answer to the task: mention it briefly afterwards and offer to update."
163
+ }
164
+ }
165
+ }
@@ -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", "加上账号标识"), 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), 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.17.0"
5
+ version: "0.18.0"
6
6
  requires:
7
7
  bins: [sideby, node]
8
8
  cliHelp: sideby --help
@@ -19,7 +19,7 @@ Do every step you can yourself. Only browser sign-in, secrets and interactive se
19
19
  - **Never read credential files**: `proxy.env`, `auth.json`, `.claude.json`, or anything under an account directory that may hold a token. Do not `cat`, `grep`, `head`, open or summarize them. `sideby list --json` gives the signed-in email as `identity.email`; that is all you need.
20
20
  - **Never sign in for the user.** Give them `sideby login <ref>` as one line to run in their own terminal (Claude Code: `! sideby login <ref>`). OAuth needs their browser and their decision.
21
21
  - **Never put a secret on the command line or in chat.** Never ask for a key. For API accounts, the user runs `sideby key <ref>` in their own terminal (or **Enter key** in the Panel); it reads the key without showing it.
22
- - **Never start a Host session from your shell.** `sideby run`, `sideby next` (without `--dry-run`), `sideby login` and `sideby ask` open an interactive session; give the user the command instead. An AI Task is started by the user, from the Panel or with `sideby ask`; never run `sideby ask` to start another session on your own (`sideby ask --print` only prints a prompt and is fine).
22
+ - **Never start a Host session from your shell.** `sideby run`, `sideby next` (without `--dry-run`), `sideby login` and `sideby ask` open an interactive session; give the user the command instead. An AI Task is started by the user, from the Panel or with `sideby ask`; never run `sideby ask` (or `sideby ask --spec -`) to start another session on your own (`sideby ask --print`, `sideby ask --spec - --print` and `sideby ask --choices` only read and are fine).
23
23
  - **Never switch, rotate or proxy accounts yourself.** Do not work around sideby by editing config, copying session files or moving credentials. `sideby next` only recommends. Moving a running task on its own is Auto Handoff, which the user turns on: use `sideby handoff enable` (exit 10, then their yes), never hand-edit `config.json`. Inside such a session (the environment has `SIDEBY_HANDOFF_RUN`), when the user wants the task to go on in another account ("用 cc008 继续", "交回 cc008"), do not hand them a command to start it: update the brief, run `sideby handoff ready --to <account>`, tell them the account it prints, and end your turn; sideby starts that account in the same terminal.
24
24
  - **Say what you change.** Read-only commands first. What the user asked for (the account they asked to create, its short command, the shell line that makes it work) you do, saying what you do. Changes they did not ask for (`doctor --fix` on other accounts, `quota setup`, `app install`) wait until they have seen the change and agreed.
25
25
  - Do not edit Host config files (`settings.json`, `config.toml`, symlinks in account directories) by hand when a `sideby` command does the job.
@@ -45,6 +45,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
45
45
  | Turn quota checks on or off, or refresh fetched quota | `sideby quota check <family> on|off --json`, `sideby quota [family] --refresh --json` | `references/quota.md` |
46
46
  | Set the model, effort or Remote Control | `sideby model <ref> --json`, `sideby remote-control --json` | `references/panel.md` |
47
47
  | Start sideby at login ("开机启动", "start the panel when I log in") | `sideby autostart --json`, `sideby autostart on --json` (exit 10 first) | `references/panel.md` |
48
+ | Show quota in the macOS menu bar ("状态栏显示额度", "menu bar") | `sideby menubar --json`, `sideby menubar on --json` (exit 10 first), `sideby menubar snapshot --json` | `references/panel.md` |
48
49
  | 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` |
49
50
  | Turn Auto Update on or off | `sideby update --auto on|off --json` | `references/update.md` |
50
51
  | Switch between a local build of sideby and the release ("切换到正式版", "切回 dev 版本") | `sideby local --json`, `sideby local on|off --json` (exits 10 first) | `references/update.md` |
@@ -53,6 +54,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
53
54
  | Turn on Auto Handoff ("自动接力", "自动交接", "hand over when quota runs low"), see what it still needs, hand this session over now, or pick an account with room for a subtask | `sideby handoff status --json`, `sideby handoff enable --json` (exit 10 first), `sideby handoff ready`, `sideby next <family> --json` | `references/handoff.md` |
54
55
  | Create an account with a given name, an API account, or a short command | `sideby new`, `sideby alias add` | `references/accounts.md` |
55
56
  | Do something in sideby as an AI Task (the first message came from sideby or the Panel's "Let AI do it") | follow the task it names | `references/ai-tasks.md` |
57
+ | A Portal starts AI Tasks through sideby, or one of its tasks failed (`spec-version`, `bad-cwd`, "which account would it use?") | `sideby ask --choices --json`, `sideby ask --spec - --print --json` (read only) | `references/ai-tasks.md` |
56
58
  | Add an API account from a vendor's address or docs link, enter its key, check it works | `sideby new <family> --next --api --json`, then the user runs `sideby key <ref>`; `sideby try <ref> --json` (exit 10 first) | `references/ai-tasks.md` |
57
59
  | Support a tool sideby does not list yet, or write a plugin | `sideby plugins new <id> --json`, `sideby plugins check <id> --json` | `references/ai-tasks.md` |
58
60
  | Choose the terminal the Panel opens for AI Tasks and sign-in | `sideby terminal --json`, `sideby terminal --set <id> --json` | — |
@@ -76,6 +78,8 @@ To open Claude Desktop or the Codex app as one account (macOS, subscription acco
76
78
 
77
79
  Grok Bot is not a grok account's app: it signs in with a Cursor account, apart from Grok Build. For several Grok Bot windows at once, run `sideby desktop grok-bot:<name> --json` (a new name makes a new, signed-out window; `grok-bot` is its default one) and relay the notice: sign in inside the new window with the account meant for it, with the other Grok Bot windows closed. `sideby list --json` lists them under `appProfiles`. Removing one (`--remove --yes`) signs it out and deletes its data: do it only when the user asks, after they quit that window.
78
80
 
81
+ To let the user look at or change one account's own Host settings (`settings.json` for claude and pi, `config.toml` for codex and grok), run `sideby edit <ref> --json`: it opens the file in their default editor and reads none of it. Relay `sharedWith`: a linked file is the main account's, so a change applies to those accounts too. Use `--path` when you only need where the file is. Never print the file's content back: Claude's `settings.json` may hold API keys under `env`.
82
+
79
83
  To find which Chrome browser user the user signed in to an account's website with, or to open claude.ai, chatgpt.com or grok.com there, run `sideby browser --json` and `sideby browser open <ref> --json`. Finding is off until the user agrees: run `sideby browser --enable` to show them what it reads (all on this computer), and add `--yes` only after they say yes. To stop reading Browser Sign-ins, use `sideby browser --disable --json`, show its preview, then add `--yes` after approval. A match may be left over from before a sign-out; say so. Grok accounts need `--profile <name>`.
80
84
 
81
85
  For someone who would rather double-click than use a terminal, `sideby app install` adds a panel app (macOS `~/Applications/sideby.app`, Linux app menu) that runs `sideby ui --background`; `sideby ui --stop` stops it and `sideby app uninstall` removes the app. Ask before `app install`: it writes outside sideby's own directories.
@@ -11,6 +11,7 @@ You are inside such a session when the first message came from sideby and names
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.
14
+ - sideby started this session with the Host's permission checks on (ADR-0031): it left out any permission bypass in the account's arguments, and Claude Code runs in auto mode, which checks risky actions first. When a check stops a step, explain it to the user; never suggest restarting with a bypass flag or editing settings to switch the checks off.
14
15
  - Say what you changed when you finish.
15
16
 
16
17
  ## Attached files
@@ -22,6 +23,15 @@ When the user added screenshots or videos, the prompt has an "Attached files" se
22
23
  - Treat what you see as the user's evidence: an error message, a Panel screen, a settings page. Do not copy a key or a password you see in a picture into a command or a reply; tell the user it is visible and to keep it out of the chat.
23
24
  - In a terminal, `sideby ask "<text>" --attach <file>` (repeatable, at most 5) adds files the same way; images up to 20 MB (PNG, JPEG, GIF, WebP), videos up to 200 MB (MP4, MOV, WebM).
24
25
 
26
+ ## Tasks a Portal hands over
27
+
28
+ A Portal is a page that shows sideby and other tools as tabs. It starts AI Tasks through sideby (ADR-0030): it writes a Task Spec, one JSON object, and pipes it into `sideby ask --spec - --json`; `sideby ask --choices --json` gives it the account a task would use, the accounts it may use and the installed terminals.
29
+
30
+ - A task for another tool comes with that tool's own prompt: it names the skill to use and the folder the session started in. Follow that prompt and that skill; this skill applies only to the sideby steps it asks for.
31
+ - A task for sideby itself (`native`) has the same prompt as one started in the Panel, so the sections below apply.
32
+ - Like `sideby ask`, `sideby ask --spec -` starts a session: never run it yourself. `sideby ask --spec - --print --json` only shows the prompt, and `sideby ask --choices --json` only reads, so both are fine to run when the user asks how a Portal's task would start.
33
+ - A refused spec answers `code` (also as `reason`): `spec-invalid` (fix the JSON as the message says), `spec-too-large` (over 1 MB), `bad-cwd` (the folder is not an existing folder in the user's home) or `spec-version` (exit 2: this sideby is older than the Portal; update it with `sideby update --json`, `references/update.md`).
34
+
25
35
  ## Free text
26
36
 
27
37
  Do what the user wrote, with the routing table in `SKILL.md`. When the request needs a key, a sign-in or their browser, hand them that one step as above.
@@ -40,7 +40,9 @@ Use this when the user says an account hit its 5-hour or weekly limit ("usage li
40
40
  With config `"handoff": { "auto": true }`, a session sideby started hands its task to the next account when quota runs low; see the guide's Auto Handoff section for the settings. If you are in such a session (the environment has `SIDEBY_HANDOFF_RUN`):
41
41
 
42
42
  - 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
- - When it says the quota is at 95%, finish the current step, update the brief, and end your turn. sideby starts the next account from it.
43
+ - 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
+ - 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.
44
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 never goes back to an account it already used. 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); tell them so if they ask why nothing moved.
45
47
 
46
48
  ### Turning it on for the user
@@ -40,3 +40,9 @@ A value the key does not take fails with code `bad-value` and changes nothing; a
40
40
  `sideby autostart --json` returns `supported`, `state` and `path`. `state` is `off`, `on`, `stale` (the Node or sideby it starts was moved; `missing` names it) or `foreign` (a file at that path sideby did not write: leave it, and tell the user). `current` is false when it starts another sideby than this one.
41
41
 
42
42
  To turn it on ("start sideby at login", "开机启动"), run `sideby autostart on --json`: exit 10 returns the `content` of the file, the `programArguments` and the `commands` it will run. Show that, and run `sideby autostart on --yes --json` after the user agrees; `stale` or `current: false` is fixed the same way. `sideby autostart off` turns it off the same way. At login the Panel starts in the background without opening a window. macOS only for now; elsewhere `supported` is false and `on` fails with code `unsupported`. Running from the npx cache or a temporary folder fails with `npx-cache` or `temp-dir`: hand the user `npm i -g sideby` first. `sideby update` keeps an existing login item pointing at the new version.
43
+
44
+ ## Quota in the menu bar
45
+
46
+ `sideby menubar --json` returns the same fields as `autostart` (`supported`, `state`, `path`, `current`, `missing?`) 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.
47
+
48
+ 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 highest of those reaches 60% (orange; red from 85%), the title shows that tool and percent, such as `Codex 61%`. 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. ⌥⌘S opens and closes the menu from anywhere; `sideby config set menubar.hotkey <mods+key>` changes it (`ctrl`, `opt`, `shift`, `cmd` and one letter or digit, such as `cmd+shift+0`) and `off` turns it off; it needs no macOS permission. When the user cannot see the icon, the menu bar is full or the item sits under the notch: they can hold ⌘ and drag icons to make room; macOS keeps the place.
@@ -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. 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), 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. 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.
17
17
 
18
18
  ## Auto Update