sideby 0.19.1 → 0.20.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 +7 -4
- package/ai-tasks.json +28 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +22 -1
- package/dist/src/cli/commands.js +815 -21
- package/dist/src/cli/format.d.ts +4 -0
- package/dist/src/cli/format.js +42 -4
- package/dist/src/cli/json-schemas.js +334 -4
- package/dist/src/cli/main.js +159 -13
- package/dist/src/core/accounts.d.ts +6 -0
- package/dist/src/core/accounts.js +12 -0
- package/dist/src/core/autostart.d.ts +11 -0
- package/dist/src/core/autostart.js +32 -5
- package/dist/src/core/browser-profiles.d.ts +23 -2
- package/dist/src/core/browser-profiles.js +148 -37
- package/dist/src/core/claude-settings-file.d.ts +18 -0
- package/dist/src/core/claude-settings-file.js +52 -3
- package/dist/src/core/config.d.ts +5 -0
- package/dist/src/core/config.js +12 -1
- package/dist/src/core/edit-settings.d.ts +7 -0
- package/dist/src/core/edit-settings.js +10 -5
- package/dist/src/core/history-group.d.ts +28 -0
- package/dist/src/core/history-group.js +47 -0
- package/dist/src/core/history-index.d.ts +145 -0
- package/dist/src/core/history-index.js +447 -0
- package/dist/src/core/history-project.d.ts +13 -0
- package/dist/src/core/history-project.js +87 -0
- package/dist/src/core/history.d.ts +210 -0
- package/dist/src/core/history.js +952 -0
- package/dist/src/core/inbound.d.ts +62 -0
- package/dist/src/core/inbound.js +215 -0
- package/dist/src/core/launch.d.ts +9 -1
- package/dist/src/core/launch.js +58 -24
- package/dist/src/core/live-sessions-copy.d.ts +5 -0
- package/dist/src/core/live-sessions-copy.js +46 -0
- package/dist/src/core/live-sessions-procs.d.ts +89 -0
- package/dist/src/core/live-sessions-procs.js +296 -0
- package/dist/src/core/live-sessions-title.d.ts +28 -0
- package/dist/src/core/live-sessions-title.js +80 -0
- package/dist/src/core/live-sessions.d.ts +68 -0
- package/dist/src/core/live-sessions.js +163 -0
- package/dist/src/core/login-check.d.ts +15 -0
- package/dist/src/core/login-check.js +32 -0
- package/dist/src/core/messages.d.ts +83 -0
- package/dist/src/core/messages.js +433 -0
- package/dist/src/core/project-categories.d.ts +14 -0
- package/dist/src/core/project-categories.js +48 -0
- package/dist/src/core/quota-fetch.d.ts +3 -3
- package/dist/src/core/quota-fetch.js +5 -5
- package/dist/src/core/quota-levels.d.ts +5 -0
- package/dist/src/core/quota-levels.js +5 -0
- package/dist/src/core/remote-control.d.ts +2 -0
- package/dist/src/core/remote-control.js +34 -59
- package/dist/src/core/run-link.d.ts +76 -0
- package/dist/src/core/run-link.js +245 -0
- package/dist/src/core/same-login.d.ts +4 -3
- package/dist/src/core/same-login.js +10 -7
- package/dist/src/core/session-select.d.ts +31 -0
- package/dist/src/core/session-select.js +44 -0
- package/dist/src/families/browser.d.ts +7 -18
- package/dist/src/families/browser.js +19 -8
- package/dist/src/families/claude/deliver.d.ts +2 -0
- package/dist/src/families/claude/deliver.js +43 -0
- package/dist/src/families/claude/history.d.ts +2 -0
- package/dist/src/families/claude/history.js +192 -0
- package/dist/src/families/claude/live-sessions.d.ts +13 -0
- package/dist/src/families/claude/live-sessions.js +117 -0
- package/dist/src/families/claude/messaging.d.ts +69 -0
- package/dist/src/families/claude/messaging.js +165 -0
- package/dist/src/families/claude/mod.d.ts +26 -0
- package/dist/src/families/claude/mod.js +105 -0
- package/dist/src/families/claude/session-files.d.ts +21 -0
- package/dist/src/families/claude/session-files.js +54 -0
- package/dist/src/families/codex/deliver.d.ts +5 -0
- package/dist/src/families/codex/deliver.js +76 -0
- package/dist/src/families/codex/history.d.ts +7 -0
- package/dist/src/families/codex/history.js +174 -0
- package/dist/src/families/codex/index.js +2 -0
- package/dist/src/families/codex/live-sessions.d.ts +12 -0
- package/dist/src/families/codex/live-sessions.js +193 -0
- package/dist/src/families/codex/quota.d.ts +3 -0
- package/dist/src/families/codex/quota.js +123 -0
- package/dist/src/families/codex/rate-limits.js +2 -0
- package/dist/src/families/codex/rollout.js +1 -1
- package/dist/src/families/grok/browser.d.ts +3 -0
- package/dist/src/families/grok/browser.js +5 -0
- package/dist/src/families/grok/history.d.ts +2 -0
- package/dist/src/families/grok/history.js +157 -0
- package/dist/src/families/grok/live-sessions.d.ts +4 -0
- package/dist/src/families/grok/live-sessions.js +80 -0
- package/dist/src/families/grok/login-key.d.ts +14 -0
- package/dist/src/families/grok/login-key.js +37 -0
- package/dist/src/families/history.d.ts +20 -0
- package/dist/src/families/history.js +81 -0
- package/dist/src/families/live-sessions.d.ts +26 -0
- package/dist/src/families/live-sessions.js +9 -0
- package/dist/src/families/login-keys.js +5 -1
- package/dist/src/families/messaging.d.ts +27 -0
- package/dist/src/families/messaging.js +6 -0
- package/dist/src/families/pi/history.d.ts +2 -0
- package/dist/src/families/pi/history.js +124 -0
- package/dist/src/families/pi/live-sessions.d.ts +2 -0
- package/dist/src/families/pi/live-sessions.js +70 -0
- package/dist/src/families/shared/history-text.d.ts +65 -0
- package/dist/src/families/shared/history-text.js +261 -0
- package/dist/src/menubar/hotkey.d.ts +86 -0
- package/dist/src/menubar/hotkey.js +159 -0
- package/dist/src/menubar/script.d.ts +2 -0
- package/dist/src/menubar/script.js +118 -22
- package/dist/src/menubar/snapshot.d.ts +8 -4
- package/dist/src/menubar/snapshot.js +45 -13
- package/dist/src/menubar/strings.d.ts +24 -6
- package/dist/src/menubar/strings.js +24 -6
- package/dist/src/panel/handler.d.ts +69 -0
- package/dist/src/panel/handler.js +686 -15
- package/dist/src/panel/i18n.d.ts +304 -3
- package/dist/src/panel/i18n.js +620 -18
- package/dist/src/panel/orca.d.ts +48 -0
- package/dist/src/panel/orca.js +153 -0
- package/dist/src/panel/page-logic.d.ts +255 -13
- package/dist/src/panel/page-logic.js +483 -1
- package/dist/src/panel/page-script.js +2260 -204
- package/dist/src/panel/page-styles.js +404 -32
- package/dist/src/panel/page.js +1 -0
- package/dist/src/plugins/check.js +16 -4
- package/dist/src/plugins/loader.d.ts +8 -1
- package/dist/src/plugins/loader.js +72 -7
- package/dist/src/runtime.d.ts +5 -0
- package/dist/src/runtime.js +27 -5
- package/dist/src/types.d.ts +116 -1
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.js +5 -0
- package/mods/claude/.claude-plugin/plugin.json +7 -0
- package/mods/claude/hooks/hooks.json +1 -0
- package/mods/claude/hooks/register.js +261 -0
- package/package.json +5 -2
- package/schemas/autostart.json +74 -1
- package/schemas/browser-set.json +110 -0
- package/schemas/browser.json +22 -2
- package/schemas/config.json +26 -1
- package/schemas/history-index.json +209 -0
- package/schemas/history-projects.json +133 -0
- package/schemas/history-show.json +275 -0
- package/schemas/history.json +410 -0
- package/schemas/menubar-hotkey.json +139 -0
- package/schemas/menubar-snapshot.json +36 -2
- package/schemas/menubar.json +74 -1
- package/schemas/messages-inbound.json +258 -0
- package/schemas/messages.json +164 -0
- package/schemas/send.json +165 -0
- package/schemas/sessions-copy.json +113 -0
- package/schemas/sessions-open-run.json +97 -0
- package/schemas/sessions.json +237 -0
- package/skills/sideby/SKILL.md +10 -5
- package/skills/sideby/references/accounts.md +11 -0
- package/skills/sideby/references/ai-tasks.md +17 -1
- package/skills/sideby/references/panel.md +6 -4
- package/skills/sideby/references/quota.md +2 -2
- package/skills/sideby/references/sessions.md +79 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Sessions: which session each account runs, finding one from before, handing one to another AI, and telling it something
|
|
2
|
+
|
|
3
|
+
For "which session is cc002 running", "cc002 现在在干嘛", "cc002 在哪个任务里", "哪个会话在等我", "copy cc002's session id for another AI", "复制 cc002 的会话给另一个 AI", "告诉 cc002 ……", "把这张截图发给 cc003", "send this to the codex session"; for past sessions, "find a session I had before", "找一下我上周改登录页的那个会话", "sideby 项目最近的会话".
|
|
4
|
+
|
|
5
|
+
## See them
|
|
6
|
+
|
|
7
|
+
Run `sideby sessions --json` (or `sideby sessions <account|family> --json` for one account or host). Each entry of `sessions` is one running session:
|
|
8
|
+
|
|
9
|
+
- `label` is the Session Label, `<account> · <the host's own title> · <first 8 of the id>`, as in `cc002 · knip cleanup · 61230c3d`. Use it when you name a session to the user; sideby never invents the title.
|
|
10
|
+
- `status`: `needs-you` (it waits for a permission or an answer: tell the user first), `busy`, `idle`, or `unknown` where the host does not say. Sessions that need the user come first.
|
|
11
|
+
- `cwd`, `startedAt`, `updatedAt`, `transcript` (the path of its record), `resumeCommand`.
|
|
12
|
+
- `guessed: true` means sideby could not tie a running Codex or pi program to a session and shows that account's newest session instead. Say "probably" when you report it.
|
|
13
|
+
|
|
14
|
+
- `run` (only some sessions): the Run a local orchestrator such as the `agent-dispatch` skill gave this session, `{ title, laneTitle, role, board, url, others }`. For "cc002 在哪个任务里" / "which run is cc002 working on", answer with `title` (and `laneTitle`, the part it does; `others` lists further Runs it also works for) and give `board`, the Run Board's file on this computer; to open it for the user ("打开它的任务看板", "open cc002's run report"), run `sideby sessions open-run <account|session-id> --json` yourself: it opens the board with the default program, as the chip on the Panel's Sessions page does, and returns `{ opened, board, sessionId, label }`. It exits 1 with code `no-run` when the session is in no Run (or its board file is gone: ask the coordinating AI to show the board again), `board-changed` when the file changed while sideby checked it, and `several-sessions` like `copy` below. No `run` means no orchestrator claims the session, not an error.
|
|
15
|
+
|
|
16
|
+
`problems` lists accounts sideby could not read and what to do; the rest of the list is still right. An empty list means nothing is running: the user starts an account with `sideby run <account>`.
|
|
17
|
+
|
|
18
|
+
It is read-only: sideby reads the hosts' own session files and the running programs, never a credential, and never changes or ends a session.
|
|
19
|
+
|
|
20
|
+
## Copy one for another AI
|
|
21
|
+
|
|
22
|
+
Run `sideby sessions copy <account|session-id> --json` yourself. It puts the text on the clipboard and returns it in `text`:
|
|
23
|
+
|
|
24
|
+
- default `--as reference`: the Session Reference, one sentence such as "cc002's session 61230c3d (knip cleanup), working directory /work/repo, record at …. Read its record for the context." It points at the record by path and never copies the conversation itself. It follows the user's locale; `--lang zh` or `--lang en` chooses.
|
|
25
|
+
- `--as id`: the bare session id. `--as resume`: the command that resumes it (`sideby resume claude -- --resume <id>`), which starts the account that holds it.
|
|
26
|
+
|
|
27
|
+
When `copied` is false there is no clipboard program (pbcopy on macOS, wl-copy or xclip on Linux): give the user `text` to paste. When an account runs several sessions, the command exits 1 with code `several-sessions` and lists them: ask which one, or pick by what the user said, then run it again with that id.
|
|
28
|
+
|
|
29
|
+
When you are the other AI and get a Session Reference, read the record it names for the context; do not copy files between accounts.
|
|
30
|
+
|
|
31
|
+
## Tell a session something (Messages)
|
|
32
|
+
|
|
33
|
+
When the user asks you to tell another session something ("告诉 cc002 测试过了,可以发版", "send this screenshot to cc003"), run `sideby send <account|session> "<text>" --json` yourself; add `--image <path>` once per screenshot (PNG, JPEG, GIF or WebP, up to 20 MB); a screenshot alone, without text, is fine. `<account>` works when that account runs one session now; otherwise use the session id or its first 8 characters from `sideby sessions --json`. Write the text the way the user meant it, addressed to the other AI; do not paste your whole conversation, point at files by path.
|
|
34
|
+
|
|
35
|
+
sideby keeps the Message first as a file (`message.file`, mode 600, screenshots copied next to it), then:
|
|
36
|
+
|
|
37
|
+
- `status: "delivered"`: a Claude Code session got it at once through Claude Code's own messages between sessions. Its first line names the sender (the session you run in, found by sideby) or "the user via sideby", then the text, then one `Screenshot: <path>` line per screenshot. Tell the user it was delivered.
|
|
38
|
+
- `status: "delivered"` for Codex means Codex queued it (`codex queue`, Codex 0.163 or later): the session reads it when its current turn ends, or within about 10 s when idle. `status: "paste-needed"`: Grok Build and pi have no channel sideby can deliver to yet (or the Claude session could not be reached; `note` says why in plain words). `pasteText` is one line telling the other AI to read the Message file; `copied: true` means it is on the clipboard. Tell the user to paste it into the tab of `message.to`.
|
|
39
|
+
- `needsApproval: true` (with a `note` saying the session "waits for your approval"): that Claude session holds Messages (`crossSessionInbound` is `hold`, or not set while it runs in bypass permission mode), so it waits for the user to approve the message in its terminal and drops it after about 5 minutes. Tell the user. If the target is a headless worker you or an orchestrator started (`claude -p`), the narrow fix is to start it with `--settings '{"crossSessionInbound":"accept"}'`, which applies to that one session only; for an interactive session the user cannot restart with a flag, offer `sideby messages inbound accept` (below), which changes the account's settings for every session.
|
|
40
|
+
- Delivery works on macOS, Linux and WSL 2: sideby accepts the socket under `$XDG_RUNTIME_DIR/cc-socks/` (Linux, WSL) and under the system temp folder's `cc-socks/` or per-user `cc-socks-<uid>/` (macOS). Native Windows has a named pipe sideby does not write to; those sessions get `paste-needed`.
|
|
41
|
+
|
|
42
|
+
`sideby messages --json` lists what was sent, newest first; `status: "read"` means the Message id shows in the target's record (it took it in). `needsApproval: true` stays until it is read; a held Message still unread after 6 minutes turns to `paste-needed`, because Claude Code dropped it. `--to <account|session>` narrows it.
|
|
43
|
+
|
|
44
|
+
When you are the receiving AI and see "sideby message <id> from …" or "Read the message sideby kept for you at <file>", read that file and the screenshots it lists, then act on it as a request from the user.
|
|
45
|
+
|
|
46
|
+
### Let Claude sessions show messages at once
|
|
47
|
+
|
|
48
|
+
Run `sideby messages inbound --json`: per Claude settings file (accounts linked to one file share it), `state` is `accept`, `hold`, `refuse`, `default` (not set: a bypass-mode session holds messages), `other`, `missing` or `blocked`. `sideby messages inbound accept --json` shows the change (exit 10, `applied: false`): only the top-level `crossSessionInbound` becomes `"accept"` where it is not set or `hold`. Show it to the user; after they agree, run it again with `--yes`. A `refuse` or any other value the user set is left alone and named with the reason (if nothing changes, it exits 1 and says so): tell them, and change it only if they ask. `sideby messages inbound undo --yes` puts back what sideby replaced. Running sessions pick it up when restarted. `sideby doctor` warns (`messages.inbound-held`) for an account that starts in bypass mode while it holds messages. In the Panel the same is **Receiving messages** at the bottom of the Sessions page (a banner at the top while an account holds messages), with a preview, **Receive directly** and **Undo**.
|
|
49
|
+
|
|
50
|
+
## Find a session from before (Session History)
|
|
51
|
+
|
|
52
|
+
For a session that is not running any more, in any account of any host, run `sideby history [<words>...] --json` yourself. Put what the user remembers as words ("改登录页的那个" becomes `登录页`); every word must match, in the title, project, branch, account, the user's prompts or the replies, and Chinese words or words of one or two characters work too. Quote words the user remembers together (`"fix login"`) to match them as one phrase. Narrow it with what they said:
|
|
53
|
+
|
|
54
|
+
- `--project <name|path>`: the Project, the git repository the session ran in (worktrees and subfolders fold into it); `sideby history projects --json` lists them with their counts. "sideby 项目最近的会话" is `sideby history --project sideby --json`; "这个项目" (the folder you are working in) is `--project .`.
|
|
55
|
+
- `--since today|7d|30d|all` ("上周" is `7d`), `--family <id>`, `--account <account>`, `--limit <n>` (default 30, at most 500); `total` counts every match, and `--offset <n>` gives the next page.
|
|
56
|
+
- `--group project|category|day|account|family|none` ("按日期列一下" is `--group day`) adds `groups` (each `key`, `label`, `sessions`) and a `group` on each session; it cannot be used with `--tools`. When one of the user's plugins sorts projects into categories, the result has `categories` (`label`, and `from`, the plugin), `sideby history projects --json` gives each project's `category`, and `--category <name>` keeps one ("客户 A 那组项目的会话"). Without such a plugin, `--category` fails and says to add one (docs/guide/plugins.md).
|
|
57
|
+
- `--scripts` also shows Script Sessions (started by a script, an SDK or another agent; hidden by default). `--tools` also reads the session files in scope for tool output (slower, keeps nothing): use it when nothing is found and the user remembers a command's output or an error message. Sessions found only there come last with `foundIn: "tools"`; `toolOutputMore: true` means a bigger `--limit` shows more of them.
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
- 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.
|
|
62
|
+
- 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.
|
|
63
|
+
- To give it to another AI, use its `reference`, the Session Reference (as in `sessions copy` above).
|
|
64
|
+
|
|
65
|
+
`index.state` is `building` while sideby's local search index (the History Index) is read for the first time: what is built already answers, and `progress` says how far it is; run it again for the rest. `sources` says how many sessions sideby read per account, with a `note` for an account it could not read (`reason: unsupported` means the tool comes from a plugin that gives no session reader: tell the user sideby cannot read that tool's past sessions until the plugin adds `history`); `problems` says what to do. `sideby history index --json` shows the index; `--clear` deletes it (it is rebuilt from the hosts' files). The index holds titles, projects, prompts and replies, never tool output, at mode 600 in sideby's state folder; config `history.index: false` turns it off and deletes it, and then only titles and folders are searched. It is read-only towards the hosts and never opens a credential file.
|
|
66
|
+
|
|
67
|
+
## Tab titles
|
|
68
|
+
|
|
69
|
+
With config `accountTitle` on (`references/badge.md`), the title of a tab sideby started grows from `[cc002]` to `[cc002 · knip cleanup · 61230c3d]` once the session shows up, and follows a rename within about 10 seconds.
|
|
70
|
+
|
|
71
|
+
## Inside Claude Code: the sideby mod
|
|
72
|
+
|
|
73
|
+
When sideby starts a Claude Code account (Claude Code 2.1.287 or later, not `-p`), it loads its own mod with `--plugin-dir`; nothing is written into the account. In that session:
|
|
74
|
+
|
|
75
|
+
- A dim line above the prompt shows this session's Session Label (`cc002 · knip cleanup · 61230c3d`), so the user can tell tabs apart.
|
|
76
|
+
- A Message sent with `sideby send` raises a toast ("Message from cc001 · …").
|
|
77
|
+
- `/sessions` opens a "Sessions" pane with every running session, refreshed every 5 seconds, each with "Copy for AI" (the Session Reference) and "Copy id". When the user asks to see all sessions while in Claude Code ("在这里看所有会话", "show my sessions in Claude Code"), tell them to type `/sessions`.
|
|
78
|
+
|
|
79
|
+
To turn it off ("关掉 sideby 的横带", "turn off the sideby mod"), run `sideby config set claudeMod false --json` yourself; sessions started after that load no mod. `sideby config set claudeMod true --json` turns it back on. When the line or `/sessions` is missing, check `claude --version` (2.1.287 or later) and that the session was started by sideby (`SIDEBY_ACCOUNT` is set in it).
|