sideby 0.42.2 → 0.44.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/ai-tasks.json +10 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.js +54 -13
- package/dist/src/cli/json-schemas.js +65 -1
- package/dist/src/cli/main.js +11 -4
- package/dist/src/core/ask.d.ts +8 -14
- package/dist/src/core/ask.js +66 -30
- package/dist/src/core/egress.d.ts +5 -0
- package/dist/src/core/egress.js +32 -2
- package/dist/src/core/file-memo.d.ts +2 -0
- package/dist/src/core/file-memo.js +20 -0
- package/dist/src/core/handoff-run.js +41 -8
- package/dist/src/core/handoff-select.d.ts +5 -0
- package/dist/src/core/handoff-select.js +1 -1
- package/dist/src/core/handoff.d.ts +78 -1
- package/dist/src/core/handoff.js +100 -9
- package/dist/src/core/history-index.d.ts +4 -0
- package/dist/src/core/history-index.js +1 -1
- package/dist/src/core/live-sessions.d.ts +5 -0
- package/dist/src/core/live-sessions.js +12 -1
- package/dist/src/core/memo-store.js +32 -8
- package/dist/src/core/network.d.ts +37 -0
- package/dist/src/core/network.js +65 -1
- package/dist/src/core/pick-commands.d.ts +7 -1
- package/dist/src/core/pick-commands.js +15 -3
- package/dist/src/core/pick-records.d.ts +26 -0
- package/dist/src/core/pick-records.js +81 -0
- package/dist/src/families/agy/history.d.ts +2 -0
- package/dist/src/families/agy/history.js +118 -0
- package/dist/src/families/agy/index.js +5 -0
- package/dist/src/families/agy/quota.d.ts +5 -1
- package/dist/src/families/agy/quota.js +111 -10
- package/dist/src/families/history.js +2 -1
- package/dist/src/families/quota-watch.d.ts +12 -0
- package/dist/src/families/quota-watch.js +24 -0
- package/dist/src/network/hook.js +4 -4
- package/dist/src/network/page-script.d.ts +40 -0
- package/dist/src/network/page-script.js +270 -0
- package/dist/src/network/page.d.ts +11 -0
- package/dist/src/network/page.js +189 -0
- package/dist/src/network/panel.d.ts +5 -0
- package/dist/src/network/panel.js +7 -0
- package/dist/src/panel/changes.d.ts +57 -0
- package/dist/src/panel/changes.js +178 -0
- package/dist/src/panel/handler.d.ts +59 -1
- package/dist/src/panel/handler.js +374 -99
- package/dist/src/panel/i18n.d.ts +49 -0
- package/dist/src/panel/i18n.js +100 -2
- package/dist/src/panel/page-logic.d.ts +37 -3
- package/dist/src/panel/page-logic.js +106 -12
- package/dist/src/panel/page-script.js +194 -27
- package/dist/src/panel/page-styles.js +18 -8
- package/dist/src/panel/page.js +3 -1
- package/dist/src/runtime.d.ts +55 -5
- package/dist/src/runtime.js +105 -12
- package/dist/src/types.d.ts +3 -2
- package/package.json +1 -1
- package/schemas/network-diagnose.json +196 -0
- package/schemas/next.json +67 -2
- package/skills/sideby/SKILL.md +3 -2
- package/skills/sideby/references/accounts.md +1 -1
- package/skills/sideby/references/ai-tasks.md +1 -1
- package/skills/sideby/references/handoff.md +6 -2
- package/skills/sideby/references/network.md +6 -1
- package/skills/sideby/references/quota.md +1 -1
- package/skills/sideby/references/sessions.md +1 -1
|
@@ -65,7 +65,7 @@ To start one account with fixed Host arguments, such as another model, put them
|
|
|
65
65
|
|
|
66
66
|
## Pick commands (start the account with the most room)
|
|
67
67
|
|
|
68
|
-
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
|
|
68
|
+
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 with the most room per running session (a weekly quota that resets within 24 hours goes first), and prints which (`cc → claude:work (5h 12% used, the most room)`, or `… 2 running, the most room per session` when sessions already run on it). 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. Given a session to resume by id (`cc --resume <id>`), it skips the quota and starts the account that holds the session (`sideby: session <id> is in claude:work; starting it there`), or a new session where a never-saved one started.
|
|
69
69
|
|
|
70
70
|
- 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.
|
|
71
71
|
- 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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AI Tasks
|
|
2
2
|
|
|
3
|
-
An AI Task is a session of the user's own Host that sideby started for them, with a Task Prompt as its first message. The user starts it from the Panel ("Let AI do it", a Finding, a quota cell, the new-account dialog, "Other tool…", "Let AI write a plugin", "Not sure how? Let AI set it up" in the Preferred terminal dialog, "Let AI tune it" on the Auto Handoff page) or with `sideby ask` in a terminal (`--task free|fix|quota|account|host|plugin|terminal|handoff|theme|menubar|hotkey|network|update`; "Let AI help" in the Panel's Network check dialog and on its wrong-network banner starts `network`, see `references/network.md`; "Let AI pick my colors" in the Panel's Theme dialog starts `theme`, see `references/themes.md`; "Let AI check it" in the Panel's Menu bar icon dialog starts `menubar`, and "Not sure which? Let AI pick one" under its shortcut starts `hotkey`; "Not sure why? Let AI fix it" under an error in the Panel's update dialog starts `update`, see `references/update.md`). The prompt says what to do and gives facts sideby already knows (account refs, Family, Finding codes, the quota reason, the Panel language, the sideby version). How to do it is on this page.
|
|
3
|
+
An AI Task is a session of the user's own Host that sideby started for them, with a Task Prompt as its first message. The user starts it from the Panel ("Let AI do it", a Finding, a quota cell, the new-account dialog, "Other tool…", "Let AI write a plugin", "Not sure how? Let AI set it up" in the Preferred terminal dialog, "Let AI tune it" on the Auto Handoff page) or with `sideby ask` in a terminal (`--task free|fix|quota|account|host|plugin|terminal|handoff|theme|menubar|hotkey|network|network-diagnose|update`; "Let AI help" in the Panel's Network check dialog and on its wrong-network banner starts `network`, see `references/network.md`; "Let AI pick my colors" in the Panel's Theme dialog starts `theme`, see `references/themes.md`; "Let AI check it" in the Panel's Menu bar icon dialog starts `menubar`, and "Not sure which? Let AI pick one" under its shortcut starts `hotkey`; "Not sure why? Let AI fix it" under an error in the Panel's update dialog starts `update`, see `references/update.md`). The prompt says what to do and gives facts sideby already knows (account refs, Family, Finding codes, the quota reason, the Panel language, the sideby version). How to do it is on this page.
|
|
4
4
|
|
|
5
5
|
You are inside such a session when the first message came from sideby and names a task. Work in the directory the session started in (sideby's own `ai/` folder) unless the user names another one.
|
|
6
6
|
|
|
@@ -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 with the most room per running session, 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,16 +9,20 @@ 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 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,
|
|
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: an `expiring` one first, then the most room per running session, `(100 − limitUse) / (liveSessions + 1)` |
|
|
13
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
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
|
+
`liveSessions` counts the sessions running on the account's login (any app started them) plus picks sideby made in the last two minutes that have not shown up yet, so tasks started together spread over the accounts. `expiring` on a `ready` entry is a weekly (or longer) window that resets within 24 hours while every window is still at least 10 points under its limit: that room is lost at the reset, so the account goes first. `reason` on the plan says why the pick won: `expiring` ("claude:006's weekly quota resets tomorrow with 23% left, so it goes first") or `room` ("claude:002 has the most room per running session").
|
|
19
|
+
|
|
18
20
|
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
21
|
|
|
20
22
|
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
23
|
|
|
24
|
+
Each entry's `windows` lists every counted window not reset yet (`label`, `usedPercent`, `resetsAt`): say what is left in each, such as "claude:002 has 72% of its 5-hour window and 40% of its week left". The Panel's top line, **Best to use now**, shows the same pick and numbers for one tool and starts it on a click; point a user who is not in a terminal there.
|
|
25
|
+
|
|
22
26
|
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.
|
|
23
27
|
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.
|
|
24
28
|
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.
|
|
@@ -7,10 +7,13 @@ Network Guard (spec §3.35, ADR-0053) checks the country a Host's requests leave
|
|
|
7
7
|
```sh
|
|
8
8
|
sideby network --json # the setting and the newest result per address, from the cache (no request)
|
|
9
9
|
sideby network check --json # ask every address now
|
|
10
|
+
sideby network diagnose --json # offline route/listener/cache diagnosis (no trace)
|
|
10
11
|
```
|
|
11
12
|
|
|
12
13
|
Each `targets[]` row is one address sideby asks (`api.anthropic.com` for Claude, `chatgpt.com` for Codex) with `status` (`ok`, `blocked`, `unknown`, `not-checked`), `loc` (the country) and the `accounts` checked there. `accounts[].skip` says why an account is not checked: `api` (API accounts are never checked) or `third-party` (an endpoint set to a third party).
|
|
13
14
|
|
|
15
|
+
`network diagnose` is read-only and sends no `/cdn-cgi/trace`. It reports the current process's selected proxy reduced to scheme, hostname and port (`direct` when none), a loopback TCP listener result, and the cached Guard state with its own `checkedAt`. It never resolves or connects to a remote proxy, and does not invent a port for a non-HTTP proxy that omitted one. Credentials, paths, queries and fragments are never returned or cached; the command also skips generic update and Unattended-ended notification side effects. This covers direct, HTTP and SOCKS settings from Clash, v2rayN or another proxy app without identifying or controlling the app. A reachable TCP listener does not prove HTTP CONNECT, SOCKS or upstream connectivity. `guardSupport: "unsupported"` means the current Guard cannot use that scheme: it supports HTTP CONNECT only. Tell the user to configure an HTTP proxy (v2rayN commonly exposes one separately from SOCKS) or direct connection; do not add a proxy protocol stack or switch the exit. Run `network check` only when the user wants a fresh online country result.
|
|
16
|
+
|
|
14
17
|
## Turn it on
|
|
15
18
|
|
|
16
19
|
Ask the user which countries their requests may leave from. Never choose for them, and never add the current country because it is current: on a wrong network that would allow the wrong country. Then:
|
|
@@ -32,6 +35,8 @@ Tell the user, once:
|
|
|
32
35
|
|
|
33
36
|
The Panel's **Let AI help** (in the Network check dialog and on the wrong-network banner) starts the `network` AI Task (`sideby ask --task network`). Its prompt carries the switch, the allowed countries and the newest result per address (countries only, never an address). Follow it: run `sideby network check --json`, ask which countries, preview, then `--yes` after they agree.
|
|
34
37
|
|
|
38
|
+
**Diagnose connection** in the same dialog is manual and offline. **Let AI diagnose** starts the separate fixed `network-diagnose` task with only current errors, the redacted route, listener results and Guard check times; `sideby ask --task network-diagnose` gathers the same facts itself. That task excludes generic account, health, quota, version and attachment context, removes URL userinfo before preview or task-file writing, and is read-only: explain the facts and next step, never install a skill, change network settings, configuration, code or files, switch the exit, or automatically run an online check. Do not mix it with the `network` settings task.
|
|
39
|
+
|
|
35
40
|
## When something was blocked
|
|
36
41
|
|
|
37
|
-
A blocked Launch exits 1 with `code` `network-blocked` (wrong country) or `network-unknown` (could not tell). Inside a session the prompt or tool call is stopped with the same reason. In a Claude session, a message Claude Code made itself (a background task's result) that was stopped is kept and handed to the session once the network is right again, between `<sideby-held-message>` tags; a typed message is not, the user sends it again. Help the user check their proxy (is it running, which node), then run `sideby network check --json` to confirm. To go on once anyway, the user runs `sideby run <account> --ignore-network` (or `sideby next <family> --ignore-network`); never add it yourself without their say-so. When the user wants the check gone, show `sideby network off --json` (exit 10, a preview), then run it with `--yes` once they agree; sessions already running follow config at once, so no restart is needed.
|
|
42
|
+
A blocked Launch exits 1 with `code` `network-blocked` (wrong country) or `network-unknown` (could not tell). The block names the selected redacted proxy or `direct`; connection-refused wording is kept. Inside a session the prompt or tool call is stopped with the same reason, and the message says an older session may need restarting to inherit a changed proxy environment. In a Claude session, a message Claude Code made itself (a background task's result) that was stopped is kept and handed to the session once the network is right again, between `<sideby-held-message>` tags; a typed message is not, the user sends it again. Help the user check their proxy (is it running, which node), then run `sideby network check --json` to confirm. To go on once anyway, the user runs `sideby run <account> --ignore-network` (or `sideby next <family> --ignore-network`); never add it yourself without their say-so. When the user wants the check gone, show `sideby network off --json` (exit 10, a preview), then run it with `--yes` once they agree; sessions already running follow config at once, so no restart is needed.
|
|
@@ -48,7 +48,7 @@ Two accounts of one tool signed in as the same login (Claude: same email and org
|
|
|
48
48
|
|
|
49
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.
|
|
50
50
|
|
|
51
|
-
Antigravity CLI (`agy`, main account only) quota also needs no setup: sideby runs `agy -p /usage --output-format json` (agy answers with its own Google sign-in and starts no model turn) at most every 15 minutes; `sideby quota agy --refresh` asks again now, and config `quota.check.agy: false` turns it off. Each window carries a model group `name` (5-hour and 7-day windows per group, some groups weekly only); tell the user which group each number belongs to. Named windows never count toward picking an account. A `detail` saying agy is not signed in means the user runs `sideby login agy:main` (it starts `agy`; they sign in with Google in the browser).
|
|
51
|
+
Antigravity CLI (`agy`, main account only) quota also needs no setup: sideby runs `agy -p /usage --output-format json` (agy answers with its own Google sign-in and starts no model turn) at most every 15 minutes; `sideby quota agy --refresh` asks again now, and config `quota.check.agy: false` turns it off. Each window carries a model group `name` (5-hour and 7-day windows per group, some groups weekly only); tell the user which group each number belongs to. Named windows never count toward picking an account. A `detail` saying agy is not signed in means the user runs `sideby login agy:main` (it starts `agy`; they sign in with Google in the browser). The check never opens a browser itself: when agy asks for a new sign-in, sideby stops it; `sideby quota agy --refresh --json` then shows a `detail` saying agy needs a new sign-in (or, when an older reading is kept, that reading with `fetchError`), and `sideby list --json` shows the account's `loginProblem.kind` as `"expired"`. The fix is the same.
|
|
52
52
|
|
|
53
53
|
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.
|
|
54
54
|
|
|
@@ -62,7 +62,7 @@ For a session that is not running any more, in any account of any host, run `sid
|
|
|
62
62
|
|
|
63
63
|
Each entry of `sessions` has `title` (the Session Title: the user's own name, else the host's, else the first prompt), `projectName`, `branch`, `updatedAt`, `accountLabel`, `snippet` (where the words matched), `children` (subagent sessions folded into it), `live` (running now) and `cwdGone` (its folder was removed). Name a session to the user by its title, account and when it was last active; when several fit, show the top few and ask.
|
|
64
64
|
|
|
65
|
-
- To read it: `sideby history show <id> --json` (the id or its first 8 characters or more; add `--account <acct>` when the error says two accounts have that id) gives the newest 200 `messages`, oldest first; tool calls are one line each with the tool's name only. `before` in the result, passed as `--before <n>`, gives the ones before.
|
|
65
|
+
- To read it: `sideby history show <id> --json` (the id or its first 8 characters or more; add `--account <acct>` when the error says two accounts have that id) gives the newest 200 `messages`, oldest first; tool calls are one line each with the tool's name only. `before` in the result, passed as `--before <n>`, gives the ones before. Antigravity CLI (`agy`) sessions are listed by title and project only: sideby does not read what was said in them, so `messages` is empty and words match the title and project, not the conversation; the result still gives the command that continues it (`agy --conversation <id>`).
|
|
66
66
|
- To continue it where it was, hand the user its `continueCommand` as one line: it runs `cd <its folder>` and resumes the session in the account that holds it (`resumeCommand` alone when the folder is gone). Do not start it yourself.
|
|
67
67
|
- To give it to another AI, use its `reference`, the Session Reference (as in `sessions copy` above).
|
|
68
68
|
|