sideby 0.29.0 → 0.30.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 (50) hide show
  1. package/dist/build.json +1 -1
  2. package/dist/src/cli/commands.d.ts +10 -0
  3. package/dist/src/cli/commands.js +306 -8
  4. package/dist/src/cli/json-schemas.js +75 -1
  5. package/dist/src/cli/main.js +83 -4
  6. package/dist/src/core/config.d.ts +25 -0
  7. package/dist/src/core/config.js +34 -0
  8. package/dist/src/core/fs-safe.d.ts +22 -1
  9. package/dist/src/core/fs-safe.js +68 -1
  10. package/dist/src/core/handoff-run.d.ts +2 -0
  11. package/dist/src/core/handoff-run.js +12 -6
  12. package/dist/src/core/launch.d.ts +6 -1
  13. package/dist/src/core/messages.js +9 -31
  14. package/dist/src/core/network.d.ts +5 -2
  15. package/dist/src/core/network.js +15 -45
  16. package/dist/src/core/search-catalog.d.ts +1 -1
  17. package/dist/src/core/search-catalog.js +37 -0
  18. package/dist/src/core/session-hooks.d.ts +33 -0
  19. package/dist/src/core/session-hooks.js +92 -0
  20. package/dist/src/core/unattended-ended.d.ts +62 -0
  21. package/dist/src/core/unattended-ended.js +275 -0
  22. package/dist/src/core/unattended-pending.d.ts +56 -0
  23. package/dist/src/core/unattended-pending.js +182 -0
  24. package/dist/src/core/unattended-state.d.ts +129 -0
  25. package/dist/src/core/unattended-state.js +373 -0
  26. package/dist/src/core/unattended.d.ts +142 -0
  27. package/dist/src/core/unattended.js +349 -0
  28. package/dist/src/panel/background.js +8 -0
  29. package/dist/src/panel/handler.d.ts +37 -0
  30. package/dist/src/panel/handler.js +153 -1
  31. package/dist/src/panel/i18n.d.ts +97 -0
  32. package/dist/src/panel/i18n.js +194 -0
  33. package/dist/src/panel/page-logic.d.ts +129 -0
  34. package/dist/src/panel/page-logic.js +166 -0
  35. package/dist/src/panel/page-script.js +638 -7
  36. package/dist/src/panel/page-styles.js +69 -0
  37. package/dist/src/panel/page.js +2 -0
  38. package/dist/src/plugins/bus.js +1 -0
  39. package/dist/src/runtime.d.ts +17 -1
  40. package/dist/src/runtime.js +78 -15
  41. package/dist/src/types.d.ts +48 -0
  42. package/dist/src/unattended/hook.d.ts +46 -0
  43. package/dist/src/unattended/hook.js +288 -0
  44. package/package.json +1 -1
  45. package/schemas/config.json +76 -0
  46. package/schemas/unattended-defer.json +143 -0
  47. package/schemas/unattended-pending.json +154 -0
  48. package/schemas/unattended.json +291 -0
  49. package/skills/sideby/SKILL.md +2 -1
  50. package/skills/sideby/references/unattended.md +58 -0
@@ -0,0 +1,291 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "sideby/unattended.json",
4
+ "type": "object",
5
+ "required": [
6
+ "schemaVersion",
7
+ "on",
8
+ "reason",
9
+ "configured",
10
+ "schedule",
11
+ "pending",
12
+ "coverage"
13
+ ],
14
+ "properties": {
15
+ "schemaVersion": {
16
+ "type": "number",
17
+ "const": 1
18
+ },
19
+ "on": {
20
+ "type": "boolean",
21
+ "description": "Unattended Mode is on now."
22
+ },
23
+ "reason": {
24
+ "anyOf": [
25
+ {
26
+ "type": "string",
27
+ "const": "slot"
28
+ },
29
+ {
30
+ "type": "string",
31
+ "const": "manual"
32
+ },
33
+ {
34
+ "type": "string",
35
+ "const": "session"
36
+ },
37
+ {
38
+ "type": "string",
39
+ "const": "paused"
40
+ },
41
+ {
42
+ "type": "string",
43
+ "const": "off"
44
+ }
45
+ ],
46
+ "description": "slot: a Slot of the Schedule turned it on; manual: the user did; session: only this session, started with --unattended; paused: off until the current Slot ends; off."
47
+ },
48
+ "until": {
49
+ "type": "string",
50
+ "description": "When it turns off (on), or when the pause ends (paused); ISO. Absent for a session alone, and when the Schedule covers every hour (on with no end, or paused until `on`)."
51
+ },
52
+ "slot": {
53
+ "type": "string",
54
+ "description": "The Slot it is in: its name, or its days and times when it has none."
55
+ },
56
+ "slotNumber": {
57
+ "type": "integer",
58
+ "description": "That Slot’s number in `schedule`, from 1.",
59
+ "minimum": 1
60
+ },
61
+ "next": {
62
+ "type": "object",
63
+ "required": [
64
+ "at",
65
+ "slot"
66
+ ],
67
+ "properties": {
68
+ "at": {
69
+ "type": "string",
70
+ "description": "ISO."
71
+ },
72
+ "slot": {
73
+ "type": "string"
74
+ },
75
+ "slotNumber": {
76
+ "type": "integer",
77
+ "minimum": 1
78
+ }
79
+ },
80
+ "description": "The next time a Slot turns it on by itself."
81
+ },
82
+ "configured": {
83
+ "type": "boolean",
84
+ "description": "The config has an `unattended` section, so sideby adds its hook to the Claude and Codex sessions it starts."
85
+ },
86
+ "schedule": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "object",
90
+ "required": [
91
+ "days",
92
+ "start",
93
+ "end"
94
+ ],
95
+ "properties": {
96
+ "name": {
97
+ "type": "string",
98
+ "minLength": 1,
99
+ "maxLength": 60,
100
+ "description": "What the Slot is called."
101
+ },
102
+ "days": {
103
+ "type": "array",
104
+ "items": {
105
+ "anyOf": [
106
+ {
107
+ "type": "string",
108
+ "const": "mon"
109
+ },
110
+ {
111
+ "type": "string",
112
+ "const": "tue"
113
+ },
114
+ {
115
+ "type": "string",
116
+ "const": "wed"
117
+ },
118
+ {
119
+ "type": "string",
120
+ "const": "thu"
121
+ },
122
+ {
123
+ "type": "string",
124
+ "const": "fri"
125
+ },
126
+ {
127
+ "type": "string",
128
+ "const": "sat"
129
+ },
130
+ {
131
+ "type": "string",
132
+ "const": "sun"
133
+ }
134
+ ]
135
+ },
136
+ "minItems": 1,
137
+ "uniqueItems": true,
138
+ "description": "The days it starts on."
139
+ },
140
+ "start": {
141
+ "type": "string",
142
+ "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
143
+ "description": "When it starts, `HH:MM` in 24-hour local time."
144
+ },
145
+ "end": {
146
+ "type": "string",
147
+ "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
148
+ "description": "When it ends, `HH:MM`. An end before the start is the next day; an end equal to the start lasts the whole day."
149
+ }
150
+ },
151
+ "additionalProperties": false
152
+ },
153
+ "description": "Config `unattended.schedule`, numbered from 1."
154
+ },
155
+ "pending": {
156
+ "type": "integer",
157
+ "description": "Open Pending Decisions (`sideby unattended pending`)."
158
+ },
159
+ "coverage": {
160
+ "type": "object",
161
+ "patternProperties": {
162
+ "^.*$": {
163
+ "anyOf": [
164
+ {
165
+ "type": "string",
166
+ "const": "covered"
167
+ },
168
+ {
169
+ "type": "string",
170
+ "const": "needs-trust"
171
+ },
172
+ {
173
+ "type": "string",
174
+ "const": "not-covered"
175
+ }
176
+ ]
177
+ }
178
+ },
179
+ "description": "Per family: covered (sessions sideby starts get the hook), needs-trust (Codex runs it once the user trusts it in /hooks), not-covered (no hook sideby can add, or the feature was never used)."
180
+ },
181
+ "slotEnd": {
182
+ "type": "string",
183
+ "description": "When `on --slot-end` would end: the end of the current or next Slot, when that is within 72 hours; ISO."
184
+ },
185
+ "manual": {
186
+ "type": "object",
187
+ "required": [
188
+ "mode",
189
+ "at"
190
+ ],
191
+ "properties": {
192
+ "mode": {
193
+ "anyOf": [
194
+ {
195
+ "type": "string",
196
+ "const": "on"
197
+ },
198
+ {
199
+ "type": "string",
200
+ "const": "pause"
201
+ }
202
+ ]
203
+ },
204
+ "until": {
205
+ "type": "string",
206
+ "description": "ISO. Absent only for a pause made while the Schedule covers every hour: it lasts until `on`."
207
+ },
208
+ "at": {
209
+ "type": "string",
210
+ "description": "When the user chose it; ISO."
211
+ }
212
+ },
213
+ "description": "The manual state in effect now: on until, or paused until."
214
+ },
215
+ "problem": {
216
+ "type": "string",
217
+ "description": "Why sideby cannot keep its state: `<state>/unattended` is a link, someone else’s, or writable by others. Says what to do."
218
+ },
219
+ "changed": {
220
+ "type": "boolean",
221
+ "description": "Set by on, off and schedule changes: whether anything changed."
222
+ },
223
+ "undo": {
224
+ "type": "string",
225
+ "description": "The command that puts back what the change replaced."
226
+ },
227
+ "_notice": {
228
+ "type": "object",
229
+ "properties": {
230
+ "update": {
231
+ "type": "object",
232
+ "required": [
233
+ "current",
234
+ "latest",
235
+ "command",
236
+ "message"
237
+ ],
238
+ "properties": {
239
+ "current": {
240
+ "type": "string"
241
+ },
242
+ "latest": {
243
+ "type": "string"
244
+ },
245
+ "command": {
246
+ "type": "string",
247
+ "description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
248
+ },
249
+ "message": {
250
+ "type": "string"
251
+ }
252
+ }
253
+ },
254
+ "skill": {
255
+ "type": "object",
256
+ "required": [
257
+ "installed",
258
+ "current",
259
+ "command",
260
+ "message"
261
+ ],
262
+ "properties": {
263
+ "installed": {
264
+ "anyOf": [
265
+ {
266
+ "type": "string"
267
+ },
268
+ {
269
+ "type": "null"
270
+ }
271
+ ],
272
+ "description": "The skill's version; null when it has none."
273
+ },
274
+ "current": {
275
+ "type": "string"
276
+ },
277
+ "command": {
278
+ "type": "string",
279
+ "description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
280
+ },
281
+ "message": {
282
+ "type": "string"
283
+ }
284
+ }
285
+ }
286
+ },
287
+ "description": "Not the answer to the task: mention it briefly afterwards and offer to update."
288
+ }
289
+ },
290
+ "title": "sideby unattended [on|off|schedule …] --json"
291
+ }
@@ -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.29.0"
5
+ version: "0.30.1"
6
6
  requires:
7
7
  bins: [sideby, node]
8
8
  cliHelp: sideby --help
@@ -74,6 +74,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
74
74
  | 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) | — |
75
75
  | 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
76
  | 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
+ | 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` |
77
78
  | See Claude quota (it shows `not-enabled`) | `sideby quota setup claude` (exits 10) | `references/quota.md` |
78
79
  | 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` |
79
80
  | See everything at once | `sideby ui` (local panel on `127.0.0.1:17420`; `--no-open` prints the address) | — |
@@ -0,0 +1,58 @@
1
+ # Unattended Mode: sessions that do not stop to wait for a person
2
+
3
+ Unattended Mode (spec §3.37, ADR-0058) is one state for the whole computer: nobody is there to answer, so the Claude and Codex sessions sideby starts never stop to wait. While it is on, sideby's hook refuses the Host's question tool (Claude `AskUserQuestion`, Codex `request_user_input`) and tells the model to take the recommended option where the choice can be undone and to skip anything hard to undo; each refused question is kept as a **Pending Decision**. In Claude sessions it also answers "no" to every permission prompt Claude Code is about to show (even in bypass mode, and in subagents), with how to do the step without one; each refused request is kept as a Pending Decision too. Codex's own approval prompts still wait.
4
+
5
+ ## Turn it on when the user is leaving
6
+
7
+ When the user says they are leaving the computer ("挂机", "无人值守", "今晚自己跑完", "I'm off to bed, keep going"), run it yourself first:
8
+
9
+ ```sh
10
+ sideby unattended on --json # until the current or next Slot ends, else 12 hours
11
+ sideby unattended on --until 08:00 --json # or --for 4h; at most 72 hours
12
+ ```
13
+
14
+ Tell the user, in one line each:
15
+ - It covers Claude and Codex sessions sideby starts (`sideby run`, short commands, pick commands, `sideby next`, Auto Handoff, AI Tasks). Running `claude` or `codex` directly, Grok, pi and desktop apps are not covered.
16
+ - Sessions started before the feature was first used have no hook. If `configured` was `false` before this command, the sessions already running are not covered: suggest restarting long tasks with `sideby run <account> --unattended`.
17
+ - A Codex account runs the hook only after the user trusts it once: in that account type `/hooks` and trust `unattended-hook` (`coverage.codex` is `needs-trust`).
18
+ - `sideby unattended off --json` turns it off; inside a Slot it pauses until that Slot ends.
19
+
20
+ Every change prints `undo`, the command that puts back what was there.
21
+
22
+ ## Every night: the Schedule
23
+
24
+ A Slot is days, a start and an end in the computer's own time zone; an end before the start is the next morning. Overlapping Slots join.
25
+
26
+ ```sh
27
+ sideby unattended schedule preset weeknights --json # Monday to Friday, 23:00 to 08:00
28
+ sideby unattended schedule add --days sat,sun --from 01:00 --to 09:00 --name "Weekend nights" --json
29
+ sideby unattended schedule remove 2 --json # the number `sideby unattended` shows
30
+ ```
31
+
32
+ `--days` takes `mon`…`sun`, ranges and lists (`mon-fri`, `fri-mon`, `sat,sun`, `weekdays`, `daily`). Ask the user for the times; do not invent a Slot they did not ask for.
33
+
34
+ ## One session only
35
+
36
+ `sideby run <account> --unattended` (also `sideby next <family> --unattended`, `sideby resume`, short commands and pick commands) makes that one session unattended whatever the Schedule says. Give the user the command; do not start an interactive session yourself.
37
+
38
+ ## When a session was refused a question or a permission
39
+
40
+ The refusal tells you what to do: go on with the recommended option where it can be undone, and list the question and your choice in your final report. A refused permission means Claude Code wanted a person to confirm that step: rewrite it so it needs none (literal paths, `"${VAR:?}"` for a variable in an `rm` target, plain bash syntax, `rm` as a command of its own), or skip it. For anything hard to undo (deleting, sending or posting outside, publishing, deploying, paying), skip it and record it:
41
+
42
+ ```sh
43
+ sideby unattended defer "deleting the old release branch is left for the user" --json
44
+ ```
45
+
46
+ Then go on with the rest. Do not retry the question, and do not work around the refusal.
47
+
48
+ ## When the user is back
49
+
50
+ ```sh
51
+ sideby unattended --json # on or off and why, until when, the next Slot, open decisions, coverage
52
+ sideby unattended pending --json # each question, refused permission or skipped action, with account, session and folder
53
+ sideby unattended pending done <id> --json # or --all, once the user has dealt with them
54
+ ```
55
+
56
+ Go through the open ones with the user (a `permission` one names the tool, for Bash only the program and the model's description of the step, and `agentType` when a subagent asked; the whole command is in the session itself). A decision with a `sessionId` can be continued in its session: `sideby sessions copy <sessionId> --as resume` copies the command. Done ones are deleted 30 days later. A plugin can be told when a stretch ends through the `unattended.ended` event (`docs/guide/plugins.md`); sideby itself sends no notification.
57
+
58
+ The same is on the Panel's **Unattended** tab (`sideby ui`): the status with **Turn on now**, the Schedule, and the Pending Decisions with **Done**. Point the user there when they prefer clicking.