sideby 0.31.1 → 0.31.3
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/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +0 -4
- package/dist/src/cli/commands.js +49 -3
- package/dist/src/cli/json-schemas.js +20 -0
- package/dist/src/cli/main.js +19 -159
- 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-run.js +24 -8
- package/dist/src/core/handoff-select.d.ts +28 -2
- package/dist/src/core/handoff-select.js +37 -8
- package/dist/src/core/search-catalog.js +20 -0
- package/dist/src/handoff/hook.js +5 -0
- package/dist/src/panel/i18n.d.ts +14 -0
- package/dist/src/panel/i18n.js +28 -0
- package/dist/src/panel/page-script.js +117 -8
- package/dist/src/panel/page-styles.js +18 -0
- package/dist/src/panel/page.js +3 -0
- package/dist/src/runtime.d.ts +4 -3
- package/dist/src/runtime.js +1 -1
- package/package.json +1 -1
- package/schemas/commands-list.json +165 -0
- package/skills/sideby/SKILL.md +2 -1
- package/skills/sideby/references/handoff.md +1 -1
- package/skills/sideby/references/panel.md +10 -0
package/dist/src/runtime.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type DoctorReport } from './core/doctor.ts';
|
|
|
6
6
|
import type { TraceFetcher } from './core/egress.ts';
|
|
7
7
|
import { UserError } from './core/errors.ts';
|
|
8
8
|
import { type HandoffPlan } from './core/handoff.ts';
|
|
9
|
-
import { type HandoffDecision } from './core/handoff-select.ts';
|
|
9
|
+
import { type HandoffDecision, type UsedAccount } from './core/handoff-select.ts';
|
|
10
10
|
import { type DoctorHistory } from './core/last-doctor.ts';
|
|
11
11
|
import { type HostLaunch, type PreparedLaunch } from './core/launch.ts';
|
|
12
12
|
import { type NetworkOverview } from './core/network.ts';
|
|
@@ -367,11 +367,12 @@ export interface Runtime {
|
|
|
367
367
|
handoffSettings(): HandoffSettings;
|
|
368
368
|
/**
|
|
369
369
|
* Where an Auto Handoff from `origin` would go now (spec §3.17 "选号"): every Account of every Family is a
|
|
370
|
-
* candidate; `used` lists the chain's Accounts so far
|
|
370
|
+
* candidate; `used` lists the chain's Accounts so far, as refs or as its hops (an Account whose hop recorded a window
|
|
371
|
+
* that has reset since may be picked again, ADR-0060). `ahead` decides early what happens once the origin's fullest
|
|
371
372
|
* window reaches the threshold, as plan.json and the Panel need. `to` names the only candidate (`handoff ready --to`);
|
|
372
373
|
* `manual` (`handoff ready`) never waits for a reset.
|
|
373
374
|
*/
|
|
374
|
-
handoffDecision(origin: Account, used: readonly
|
|
375
|
+
handoffDecision(origin: Account, used: readonly UsedAccount[], opts?: {
|
|
375
376
|
ahead?: boolean;
|
|
376
377
|
to?: string;
|
|
377
378
|
manual?: boolean;
|
package/dist/src/runtime.js
CHANGED
|
@@ -8,7 +8,7 @@ import { hostSettingsFile } from './core/edit-settings.js';
|
|
|
8
8
|
import { UserError } from './core/errors.js';
|
|
9
9
|
import { planHandoff } from './core/handoff.js';
|
|
10
10
|
import { handoffFindings, tapState } from './core/handoff-doctor.js';
|
|
11
|
-
import { selectNext } from './core/handoff-select.js';
|
|
11
|
+
import { selectNext, } from './core/handoff-select.js';
|
|
12
12
|
import { identityOf } from './core/identity.js';
|
|
13
13
|
import { inboundFindings } from './core/inbound.js';
|
|
14
14
|
import { mergeDoctorHistory, readDoctorHistory, writeDoctorHistory, } from './core/last-doctor.js';
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
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.31.
|
|
5
|
+
version: "0.31.3"
|
|
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` |
|
|
@@ -43,7 +43,7 @@ With config `"handoff": { "auto": true }`, a session sideby started hands its ta
|
|
|
43
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
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
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
|
|
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, 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
47
|
|
|
48
48
|
### Turning it on for the user
|
|
49
49
|
|
|
@@ -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.
|