sideby 0.41.3 → 0.42.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 (36) hide show
  1. package/dist/build.json +1 -1
  2. package/dist/src/cli/commands.d.ts +2 -0
  3. package/dist/src/cli/commands.js +100 -0
  4. package/dist/src/cli/json-schemas.js +56 -1
  5. package/dist/src/cli/main.js +32 -1
  6. package/dist/src/core/claude-memory.d.ts +252 -0
  7. package/dist/src/core/claude-memory.js +1015 -0
  8. package/dist/src/core/cli-commands.js +15 -2
  9. package/dist/src/core/config.d.ts +1 -0
  10. package/dist/src/core/config.js +4 -1
  11. package/dist/src/core/doctor.d.ts +2 -1
  12. package/dist/src/core/search-catalog.js +22 -0
  13. package/dist/src/core/session-hooks.d.ts +12 -2
  14. package/dist/src/core/session-hooks.js +12 -8
  15. package/dist/src/families/claude/layout.d.ts +7 -0
  16. package/dist/src/families/claude/layout.js +17 -0
  17. package/dist/src/families/claude/live-sessions.d.ts +9 -0
  18. package/dist/src/families/claude/live-sessions.js +17 -8
  19. package/dist/src/panel/handler.d.ts +11 -0
  20. package/dist/src/panel/handler.js +21 -0
  21. package/dist/src/panel/i18n.d.ts +27 -0
  22. package/dist/src/panel/i18n.js +54 -0
  23. package/dist/src/panel/page-logic.d.ts +12 -0
  24. package/dist/src/panel/page-logic.js +24 -0
  25. package/dist/src/panel/page-script.js +47 -6
  26. package/dist/src/panel/page-styles.js +1 -0
  27. package/dist/src/runtime.d.ts +30 -0
  28. package/dist/src/runtime.js +90 -1
  29. package/dist/src/types.d.ts +6 -0
  30. package/package.json +1 -1
  31. package/schemas/config.json +5 -1
  32. package/schemas/doctor.json +48 -0
  33. package/schemas/memory-set.json +117 -0
  34. package/schemas/memory.json +210 -0
  35. package/skills/sideby/SKILL.md +2 -1
  36. package/skills/sideby/references/sharing.md +23 -1
@@ -0,0 +1,210 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "sideby/memory.json",
4
+ "type": "object",
5
+ "required": [
6
+ "schemaVersion",
7
+ "action",
8
+ "on",
9
+ "main",
10
+ "folded"
11
+ ],
12
+ "properties": {
13
+ "schemaVersion": {
14
+ "type": "number",
15
+ "const": 1
16
+ },
17
+ "action": {
18
+ "type": "string",
19
+ "const": "status"
20
+ },
21
+ "on": {
22
+ "type": "boolean",
23
+ "description": "Config `claude.shareMemory` (spec §3.44): Claude sessions sideby starts in other accounts read and write the main account's memory for their project, and `sideby doctor --fix` moves memory an account wrote on its own into the main account."
24
+ },
25
+ "main": {
26
+ "type": "string",
27
+ "description": "The main account's folder that holds every project's memory."
28
+ },
29
+ "folded": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "object",
33
+ "required": [
34
+ "account",
35
+ "project",
36
+ "files",
37
+ "at"
38
+ ],
39
+ "properties": {
40
+ "account": {
41
+ "type": "string",
42
+ "description": "The account the memory came from."
43
+ },
44
+ "project": {
45
+ "type": "string",
46
+ "description": "The project folder name under projects/."
47
+ },
48
+ "files": {
49
+ "type": "number",
50
+ "description": "How many files reached the main account."
51
+ },
52
+ "at": {
53
+ "type": "string",
54
+ "description": "When (ISO time)."
55
+ }
56
+ }
57
+ },
58
+ "description": "What `sideby doctor --fix` moved into the main account, oldest first."
59
+ },
60
+ "dir": {
61
+ "type": "object",
62
+ "required": [
63
+ "path"
64
+ ],
65
+ "properties": {
66
+ "path": {
67
+ "type": "string",
68
+ "description": "The folder asked about (its real path)."
69
+ },
70
+ "name": {
71
+ "type": "string",
72
+ "description": "Its project folder name under projects/."
73
+ },
74
+ "memory": {
75
+ "type": "string",
76
+ "description": "Where its memory goes for every Claude account sideby starts."
77
+ },
78
+ "why": {
79
+ "type": "string",
80
+ "description": "Why sideby cannot tell; such a session keeps its own memory."
81
+ }
82
+ },
83
+ "description": "Where the memory of the folder asked about goes; only while on."
84
+ },
85
+ "projects": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "object",
89
+ "required": [
90
+ "name",
91
+ "main",
92
+ "pending",
93
+ "folded"
94
+ ],
95
+ "properties": {
96
+ "name": {
97
+ "type": "string",
98
+ "description": "The project folder name under projects/."
99
+ },
100
+ "main": {
101
+ "type": "number",
102
+ "description": "Files in the main account's memory folder for it."
103
+ },
104
+ "pending": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "object",
108
+ "required": [
109
+ "account",
110
+ "files"
111
+ ],
112
+ "properties": {
113
+ "account": {
114
+ "type": "string"
115
+ },
116
+ "files": {
117
+ "type": "number"
118
+ }
119
+ }
120
+ },
121
+ "description": "Accounts that keep memory of their own for it: what `sideby doctor --fix` would move."
122
+ },
123
+ "folded": {
124
+ "type": "array",
125
+ "items": {
126
+ "type": "object",
127
+ "required": [
128
+ "account",
129
+ "files"
130
+ ],
131
+ "properties": {
132
+ "account": {
133
+ "type": "string"
134
+ },
135
+ "files": {
136
+ "type": "number"
137
+ }
138
+ }
139
+ },
140
+ "description": "Files `sideby doctor --fix` already moved in, per account."
141
+ }
142
+ }
143
+ },
144
+ "description": "Each project with memory in the main account or in an account of its own; only while on. Nothing is read while off."
145
+ },
146
+ "_notice": {
147
+ "type": "object",
148
+ "properties": {
149
+ "update": {
150
+ "type": "object",
151
+ "required": [
152
+ "current",
153
+ "latest",
154
+ "command",
155
+ "message"
156
+ ],
157
+ "properties": {
158
+ "current": {
159
+ "type": "string"
160
+ },
161
+ "latest": {
162
+ "type": "string"
163
+ },
164
+ "command": {
165
+ "type": "string",
166
+ "description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
167
+ },
168
+ "message": {
169
+ "type": "string"
170
+ }
171
+ }
172
+ },
173
+ "skill": {
174
+ "type": "object",
175
+ "required": [
176
+ "installed",
177
+ "current",
178
+ "command",
179
+ "message"
180
+ ],
181
+ "properties": {
182
+ "installed": {
183
+ "anyOf": [
184
+ {
185
+ "type": "string"
186
+ },
187
+ {
188
+ "type": "null"
189
+ }
190
+ ],
191
+ "description": "The skill's version; null when it has none."
192
+ },
193
+ "current": {
194
+ "type": "string"
195
+ },
196
+ "command": {
197
+ "type": "string",
198
+ "description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
199
+ },
200
+ "message": {
201
+ "type": "string"
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "description": "Not the answer to the task: mention it briefly afterwards and offer to update."
207
+ }
208
+ },
209
+ "title": "sideby memory [--dir <path>] --json"
210
+ }
@@ -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.41.3"
5
+ version: "0.42.1"
6
6
  requires:
7
7
  bins: [sideby, node]
8
8
  cliHelp: sideby --help
@@ -47,6 +47,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
47
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` |
48
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` |
49
49
  | Know what accounts share and what stays separate | `sideby families <family> --json` | `references/sharing.md` |
50
+ | Share Claude's project memory between accounts, or another account does not remember what one learned about a project ("别的账号不记得这个项目", "多账号共享 memory", "让所有 Claude 账号共用记忆", "share memory between my Claude accounts", "cc008 doesn't know what cc002 learned") | `sideby memory --json` (setting, and while on, where `--dir <folder>`'s memory goes and which projects still wait to be moved), then `sideby memory on --json` (exits 10 with the change; rerun with `--yes` after they agree), then `sideby doctor claude --json` and `--fix` after they agree; `sideby memory off` keeps what is in the main account | `references/sharing.md` |
50
51
  | See accounts, health, quota and usage | `sideby list --json`, `sideby doctor --json`, `sideby quota --json` | `references/diagnose.md` |
51
52
  | Check whose sign-in expired ("which login expired", "哪个账号登录过期了", "登录过期", "Login reached its time limit", "Please run /login") | `sideby list --json` (`loginProblem`), `sideby doctor --json` (`login.expired`) | `references/diagnose.md` |
52
53
  | Pin accounts or arrange their Display Order | `sideby order --json`, `sideby pin <ref> --json`, `sideby unpin <ref> --json` | `references/panel.md` |
@@ -5,7 +5,7 @@ Answer from `sideby families [family] --json`, not from memory: it covers plugin
5
5
  - **Shared** (one copy, from the Main Account): `link` items. A change in the Main Account reaches every account at once.
6
6
  - **Kept equal**: `copy` and `link-or-copy` items, a subscription account's `local-if-api` item, and the one key of a `json-key` item (Claude's MCP servers in `.claude.json`). `sideby doctor --fix` brings them back in line after the Main Account changes.
7
7
  - **The account's own**: `local` items (copied once, then theirs), an API account's `local-if-api` item (it starts as a copy, so its endpoint and model never change the Main Account's), and `info` items such as `auth.json` (sign-in; never shared, never read).
8
- - **Not in the list at all**: sessions, history and everything else in the account directory belong to that account. That is why two accounts can run at the same time.
8
+ - **Not in the list at all**: sessions, history and everything else in the account directory belong to that account. That is why two accounts can run at the same time. Claude's project memory (auto memory) is the account's own too, unless the user turns on shared memory (below).
9
9
 
10
10
  An item the Main Account does not have is skipped: nothing to share, no Finding.
11
11
 
@@ -15,3 +15,25 @@ Two answers people often need:
15
15
 
16
16
  - "Will my new account have my MCP servers?" Claude Code: yes, `new` copies the `mcpServers` entry and `doctor --fix` keeps it equal later; OAuth servers (GitHub, Figma) still need each account to authorize once. Codex: yes for subscription accounts, through the linked `config.toml`.
17
17
  - "Will it see my old sessions?" No. Sessions stay in the account that made them; `sideby run <old-account> -- --resume` reopens them there.
18
+
19
+ ## Shared project memory (Claude)
20
+
21
+ Claude Code keeps what it learns about a project (auto memory, `projects/<project>/memory/` with a `MEMORY.md` index) per account, so a second account starts a project without it. Shared Project Memory (spec §3.44, ADR-0081), off by default, makes every Claude account sideby starts use the main account's memory of that project.
22
+
23
+ ```sh
24
+ sideby memory --json # { on, main, folded[] }; while off no account folder is read
25
+ sideby memory --dir ~/code/app --json # while on: dir.memory (where it goes), projects[] with pending per account
26
+ sideby memory on --json # exit 10: the change; run again with --yes after the user agrees
27
+ sideby doctor claude --json # memory.unfolded per account: memory written outside sideby
28
+ sideby doctor claude --fix --json # after the user agrees: moves it into the main account
29
+ sideby memory off --yes --json # stops passing the folder; memory in the main account stays
30
+ ```
31
+
32
+ Before turning it on, tell the user in one line each:
33
+ - Interactive Claude sessions sideby starts in an account other than the main one (`sideby run`, short commands, pick commands, `sideby next`, Auto Handoff, AI Tasks) get the main account's folder for the project (`~/.claude/projects/<project>/memory`) as `autoMemoryDirectory` in sideby's own `--settings` file. Nothing is linked: Claude Code refuses memory writes through a link.
34
+ - The project is the git repository's main checkout (worktrees and subfolders share it), elsewhere the folder itself, named the way Claude Code names it. Where sideby cannot tell (a submodule, a separate git folder), the session keeps the account's own memory and the launch says so.
35
+ - Sessions started with plain `claude`, by an app that picks the account itself, a headless run (`-p`) and a session given its own `--settings` keep writing the account's own memory. `sideby doctor --fix` moves that into the main account later: a project the main account lacks moves whole, a file that differs is kept as `<name>.<account>.md`, `MEMORY.md` gets the lines it lacks, and the moved files go to the trash in one folder (a file that changes meanwhile waits for the next fix). A project where a session of that account is running waits until it ends: Doctor names it and the session (Session Label), and does not offer the fix when every project waits; run `sideby doctor --fix` again after that session ends.
36
+ - Two accounts writing the same project at the same moment can overwrite `MEMORY.md`; Doctor's `memory.index` warning names the project. A `memory.name-mismatch` warning means Claude Code changed how it names project folders: suggest `sideby memory off --yes` and `sideby update`.
37
+ - In the Panel it is **Settings › Shared memory**.
38
+
39
+ Never read or quote the memory files' text to answer: `sideby memory --json` gives names and counts only.