sideby 0.35.6 → 0.35.8
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 +9 -1
- package/dist/src/cli/commands.js +59 -16
- package/dist/src/cli/json-schemas.js +20 -0
- package/dist/src/cli/main.js +11 -5
- package/dist/src/core/cli-commands.js +1 -1
- package/dist/src/core/config.d.ts +7 -0
- package/dist/src/core/config.js +9 -0
- package/dist/src/core/doctor.d.ts +5 -1
- package/dist/src/core/doctor.js +16 -0
- package/dist/src/core/edit-settings.d.ts +27 -1
- package/dist/src/core/edit-settings.js +78 -4
- package/dist/src/core/handoff-select.d.ts +3 -1
- package/dist/src/core/handoff-select.js +11 -1
- package/dist/src/core/handoff.d.ts +13 -1
- package/dist/src/core/handoff.js +16 -5
- package/dist/src/core/history-index.d.ts +4 -0
- package/dist/src/core/history-index.js +46 -17
- package/dist/src/core/history-project.js +15 -2
- package/dist/src/core/history.d.ts +11 -1
- package/dist/src/core/history.js +70 -16
- package/dist/src/core/login-mark.d.ts +3 -0
- package/dist/src/core/login-mark.js +22 -0
- package/dist/src/core/pick-commands.d.ts +4 -2
- package/dist/src/core/pick-commands.js +7 -2
- package/dist/src/core/quota-fetch.d.ts +7 -1
- package/dist/src/core/quota-fetch.js +38 -1
- package/dist/src/core/quota-store.d.ts +5 -0
- package/dist/src/core/quota-store.js +3 -0
- package/dist/src/core/search-catalog.js +9 -0
- package/dist/src/families/claude/index.js +3 -0
- package/dist/src/families/claude/login-events.d.ts +24 -0
- package/dist/src/families/claude/login-events.js +163 -0
- package/dist/src/families/claude/quota-fetch.js +14 -0
- package/dist/src/families/grok/bot.d.ts +6 -3
- package/dist/src/families/grok/bot.js +15 -4
- package/dist/src/menubar/snapshot.d.ts +2 -0
- package/dist/src/menubar/snapshot.js +6 -2
- package/dist/src/menubar/strings.d.ts +4 -0
- package/dist/src/menubar/strings.js +4 -0
- package/dist/src/panel/handler.d.ts +14 -1
- package/dist/src/panel/handler.js +48 -14
- package/dist/src/panel/i18n.d.ts +23 -0
- package/dist/src/panel/i18n.js +46 -0
- package/dist/src/panel/page-logic.d.ts +44 -2
- package/dist/src/panel/page-logic.js +43 -3
- package/dist/src/panel/page-script.js +124 -7
- package/dist/src/panel/page-styles.js +8 -0
- package/dist/src/panel/page.d.ts +7 -0
- package/dist/src/panel/page.js +1 -0
- package/dist/src/runtime.d.ts +16 -1
- package/dist/src/runtime.js +51 -2
- package/dist/src/types.d.ts +37 -0
- package/package.json +3 -3
- package/schemas/config.json +11 -0
- package/schemas/edit.json +4 -0
- package/schemas/list.json +24 -0
- package/schemas/next.json +18 -0
- package/skills/sideby/SKILL.md +4 -2
- package/skills/sideby/references/accounts.md +9 -0
- package/skills/sideby/references/diagnose.md +6 -1
- package/skills/sideby/references/panel.md +1 -1
- package/skills/sideby/references/unattended.md +1 -1
package/dist/src/runtime.js
CHANGED
|
@@ -13,13 +13,15 @@ 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';
|
|
15
15
|
import { accountEnv, beforeDashes, brokenOnPath, launchCommand, prepareLaunch, which, } from './core/launch.js';
|
|
16
|
+
import { loginMarkFile, readLoginMark, writeLoginMark } from './core/login-mark.js';
|
|
16
17
|
import { memoStore } from './core/memo-store.js';
|
|
17
18
|
import { codexNetworkTrustLine, guardLaunch, guardOn, ipChangedLine, networkHookPart, networkOverview, networkSettingsLine, } from './core/network.js';
|
|
18
19
|
import { resolvePaths } from './core/paths.js';
|
|
19
20
|
import { choosePick, suggestPickName } from './core/pick-commands.js';
|
|
20
21
|
import { categoryReader } from './core/project-categories.js';
|
|
21
|
-
import { fetchedQuota, quotaCheckOff, shownQuota } from './core/quota-fetch.js';
|
|
22
|
+
import { fetchedQuota, loginProblemOf, quotaCheckOff, shownQuota, } from './core/quota-fetch.js';
|
|
22
23
|
import { takeoverLimits } from './core/quota-levels.js';
|
|
24
|
+
import { quotaStoreFile, readQuotaStore } from './core/quota-store.js';
|
|
23
25
|
import { remoteControlGroups, turnRemoteControlOff, turnRemoteControlOn, undoRemoteControlOff, } from './core/remote-control.js';
|
|
24
26
|
import { findResumeRoute } from './core/resume.js';
|
|
25
27
|
import { SAME_LOGIN_FAMILIES, sameLoginGroups, sharedQuota } from './core/same-login.js';
|
|
@@ -280,6 +282,34 @@ export async function createRuntime(opts = {}) {
|
|
|
280
282
|
return 'unknown';
|
|
281
283
|
}
|
|
282
284
|
};
|
|
285
|
+
/**
|
|
286
|
+
* An Expired Login (ADR-0071): only for a signed-in Subscription Account of a Family that reads its Host's login
|
|
287
|
+
* records. A reader that throws counts as nothing known.
|
|
288
|
+
*/
|
|
289
|
+
const loginProblemFor = async (a, login) => {
|
|
290
|
+
const f = families.get(a.family);
|
|
291
|
+
if (!f?.readLoginEvents || a.kind === 'api')
|
|
292
|
+
return undefined;
|
|
293
|
+
if ((login ?? (await loginOf(a))) !== 'logged-in')
|
|
294
|
+
return undefined;
|
|
295
|
+
const ctx = readContext();
|
|
296
|
+
await memos.ready();
|
|
297
|
+
let events;
|
|
298
|
+
try {
|
|
299
|
+
events = await f.readLoginEvents(a, ctx);
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
events = undefined;
|
|
303
|
+
}
|
|
304
|
+
finally {
|
|
305
|
+
memos.saveSoon();
|
|
306
|
+
}
|
|
307
|
+
const [kept, mark] = await Promise.all([
|
|
308
|
+
f.fetchQuota ? readQuotaStore(quotaStoreFile(ctx.stateDir, a.family, a.name)) : null,
|
|
309
|
+
readLoginMark(loginMarkFile(ctx.stateDir, a.family, a.name)),
|
|
310
|
+
]);
|
|
311
|
+
return loginProblemOf(a.ref, events, kept, mark);
|
|
312
|
+
};
|
|
283
313
|
/** A Family's one-time setup bound to this Runtime; a setup that throws is reported, never crashes the caller. */
|
|
284
314
|
const bindSetup = (f, setup) => {
|
|
285
315
|
// The message is the error's own text; setup implementations must not put file contents into it.
|
|
@@ -442,11 +472,13 @@ export async function createRuntime(opts = {}) {
|
|
|
442
472
|
readIdentity(f, account),
|
|
443
473
|
peersOf(account).catch(() => []),
|
|
444
474
|
]);
|
|
475
|
+
const loginProblem = account.kind === 'api' ? undefined : await loginProblemFor(account, login ?? 'unknown');
|
|
445
476
|
return {
|
|
446
477
|
...account,
|
|
447
478
|
familyTitle: f.title,
|
|
448
479
|
hostInstalled: installed !== null,
|
|
449
480
|
login: account.kind === 'api' ? 'not-needed' : (login ?? 'unknown'),
|
|
481
|
+
...(loginProblem ? { loginProblem } : {}),
|
|
450
482
|
...(model ? { model } : {}),
|
|
451
483
|
...(identity ? { identity } : {}),
|
|
452
484
|
...(peers.length ? { sameLogin: peers.map((p) => p.ref) } : {}),
|
|
@@ -489,6 +521,7 @@ export async function createRuntime(opts = {}) {
|
|
|
489
521
|
// Messages held in bypass permission mode (spec §3.32 step 2): the arguments the Account starts with.
|
|
490
522
|
...(await inboundFindings(a, startArgs(a))),
|
|
491
523
|
],
|
|
524
|
+
loginProblem: (a) => loginProblemFor(a),
|
|
492
525
|
};
|
|
493
526
|
// Auto Handoff warnings (spec §3.17) join the general Findings; they never fail Doctor.
|
|
494
527
|
const all = await accounts();
|
|
@@ -881,6 +914,17 @@ export async function createRuntime(opts = {}) {
|
|
|
881
914
|
async sameLogin(account) {
|
|
882
915
|
return (await peersOf(account)).map((a) => a.ref);
|
|
883
916
|
},
|
|
917
|
+
loginProblem: (account) => loginProblemFor(account),
|
|
918
|
+
async afterLogin(account) {
|
|
919
|
+
const f = familyOf(account.family);
|
|
920
|
+
const ctx = readContext();
|
|
921
|
+
await writeLoginMark(loginMarkFile(ctx.stateDir, account.family, account.name), ctx.now).catch(() => { });
|
|
922
|
+
const checked = account.kind !== 'api' && Boolean(f.fetchQuota) && quotaCheckOff(f.id, config, env) === null;
|
|
923
|
+
if (checked)
|
|
924
|
+
await ownQuota(account, 'force').catch(() => undefined);
|
|
925
|
+
const loginProblem = await loginProblemFor(account);
|
|
926
|
+
return { ...(loginProblem ? { loginProblem } : {}), checked };
|
|
927
|
+
},
|
|
884
928
|
async usage(account) {
|
|
885
929
|
const f = familyOf(account.family);
|
|
886
930
|
if (!f.readUsage)
|
|
@@ -1001,12 +1045,15 @@ export async function createRuntime(opts = {}) {
|
|
|
1001
1045
|
const [quotas, groups] = await Promise.all([quotasOf(list, o.fetch), groupsOf(list)]);
|
|
1002
1046
|
const candidates = await Promise.all(list.map(async (a) => {
|
|
1003
1047
|
const peers = groups.get(a.ref);
|
|
1048
|
+
const login = await loginOf(a);
|
|
1049
|
+
const loginProblem = await loginProblemFor(a, login);
|
|
1004
1050
|
return {
|
|
1005
1051
|
ref: a.ref,
|
|
1006
1052
|
name: a.name,
|
|
1007
1053
|
isMain: a.isMain,
|
|
1008
1054
|
kind: a.kind,
|
|
1009
|
-
login
|
|
1055
|
+
login,
|
|
1056
|
+
...(loginProblem ? { loginProblem } : {}),
|
|
1010
1057
|
quota: quotas.get(a.ref),
|
|
1011
1058
|
...(peers ? { sameLogin: peers } : {}),
|
|
1012
1059
|
};
|
|
@@ -1037,6 +1084,7 @@ export async function createRuntime(opts = {}) {
|
|
|
1037
1084
|
loginOf(a),
|
|
1038
1085
|
readIdentity(f, a),
|
|
1039
1086
|
]);
|
|
1087
|
+
const loginProblem = await loginProblemFor(a, login);
|
|
1040
1088
|
let receive = false;
|
|
1041
1089
|
try {
|
|
1042
1090
|
receive = Boolean(f.handoff &&
|
|
@@ -1052,6 +1100,7 @@ export async function createRuntime(opts = {}) {
|
|
|
1052
1100
|
isMain: a.isMain,
|
|
1053
1101
|
kind: a.kind,
|
|
1054
1102
|
login,
|
|
1103
|
+
...(loginProblem ? { loginProblem } : {}),
|
|
1055
1104
|
quota,
|
|
1056
1105
|
...(identity ? { identity } : {}),
|
|
1057
1106
|
...(peers ? { sameLogin: peers } : {}),
|
package/dist/src/types.d.ts
CHANGED
|
@@ -24,6 +24,31 @@ export interface FamilyLayout {
|
|
|
24
24
|
account?: string;
|
|
25
25
|
}
|
|
26
26
|
export type LoginState = 'logged-in' | 'logged-out' | 'unknown';
|
|
27
|
+
/**
|
|
28
|
+
* A Subscription Account whose login file is still there but whose Host has reported that the login no longer works
|
|
29
|
+
* (an Expired Login, ADR-0071). `kind` is a closed set; `message` is sideby's own sentence, never the Host's text.
|
|
30
|
+
*/
|
|
31
|
+
export interface LoginProblem {
|
|
32
|
+
kind: 'expired';
|
|
33
|
+
/** When the Host reported it (ISO time), not when a token ends. */
|
|
34
|
+
since?: string;
|
|
35
|
+
message: string;
|
|
36
|
+
/**
|
|
37
|
+
* When a sign-in that sideby started finished after `since` (ISO time) but nothing has confirmed it yet: no later
|
|
38
|
+
* successful turn or Quota answer. The Panel then says the sign-in finished and waits for confirmation.
|
|
39
|
+
*/
|
|
40
|
+
signedInAt?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* What a Family's Host last wrote about its login (ADR-0071), as times only: never the Host's text, a token or a
|
|
44
|
+
* credential. sideby compares them with its own Quota answers to decide whether a login has expired.
|
|
45
|
+
*/
|
|
46
|
+
export interface LoginEvents {
|
|
47
|
+
/** The newest record in which the Host said the login expired (ISO time). */
|
|
48
|
+
expiredAt?: string;
|
|
49
|
+
/** The newest record that shows the login working, such as a successful model turn (ISO time). */
|
|
50
|
+
workingAt?: string;
|
|
51
|
+
}
|
|
27
52
|
/**
|
|
28
53
|
* A Family's mark for the Panel: one SVG path in a 24x24 view box, drawn inline. sideby checks it when the
|
|
29
54
|
* Plugin registers; an invalid logo is dropped with a plugin error and the Panel shows the Family's initials.
|
|
@@ -243,6 +268,13 @@ export interface FamilyDef {
|
|
|
243
268
|
key: string;
|
|
244
269
|
};
|
|
245
270
|
loginState?(account: Account): Promise<LoginState>;
|
|
271
|
+
/**
|
|
272
|
+
* When the Host last said this Account's login expired, and when it last showed it working, from the Host's own
|
|
273
|
+
* records only (ADR-0071): never a token, the Keychain or an expiry field of a credential file. Called only for a
|
|
274
|
+
* signed-in Subscription Account; an error counts as nothing known. Without it the Family's logins never show as
|
|
275
|
+
* expired.
|
|
276
|
+
*/
|
|
277
|
+
readLoginEvents?(account: Account, ctx: ReadContext): Promise<LoginEvents>;
|
|
246
278
|
model?(account: Account): Promise<string | undefined>;
|
|
247
279
|
/** Choosing the model and effort an Account starts with, as Host arguments (spec §3.19, ADR-0014). */
|
|
248
280
|
modelChoice?: FamilyModelChoice;
|
|
@@ -456,6 +488,11 @@ export type QuotaResult = {
|
|
|
456
488
|
status: 'unavailable';
|
|
457
489
|
reason: QuotaUnavailableReason;
|
|
458
490
|
detail?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Set by a `fetchQuota` answer that clearly says the login expired or asks for a new sign-in (ADR-0071). A
|
|
493
|
+
* generic failure leaves it out.
|
|
494
|
+
*/
|
|
495
|
+
loginExpired?: true;
|
|
459
496
|
};
|
|
460
497
|
export interface TokenTotals {
|
|
461
498
|
inputTokens: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sideby",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.8",
|
|
4
4
|
"description": "Run work, personal and API-key accounts at the same time, without their configs drifting apart.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Adonis0123 (https://github.com/Adonis0123)",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"typebox": "^1.3.34"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@biomejs/biome": "2.6.
|
|
82
|
+
"@biomejs/biome": "2.6.4",
|
|
83
83
|
"@types/node": "^22.18.0",
|
|
84
|
-
"motion": "14.
|
|
84
|
+
"motion": "14.7.1",
|
|
85
85
|
"typescript": "^7.0.2"
|
|
86
86
|
},
|
|
87
87
|
"packageManager": "pnpm@10.15.0",
|
package/schemas/config.json
CHANGED
|
@@ -74,6 +74,17 @@
|
|
|
74
74
|
"additionalProperties": false,
|
|
75
75
|
"description": "The terminal AI Tasks open in (spec §3.28)."
|
|
76
76
|
},
|
|
77
|
+
"editor": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"enum": [
|
|
80
|
+
"system",
|
|
81
|
+
"cursor",
|
|
82
|
+
"vscode",
|
|
83
|
+
"windsurf",
|
|
84
|
+
"zed"
|
|
85
|
+
],
|
|
86
|
+
"description": "The editor `sideby edit` and the Panel open an account’s settings file with: `system` (the default) uses the system’s default program; `cursor`, `vscode`, `windsurf` and `zed` start that editor."
|
|
87
|
+
},
|
|
77
88
|
"ask": {
|
|
78
89
|
"type": "object",
|
|
79
90
|
"properties": {
|
package/schemas/edit.json
CHANGED
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
},
|
|
53
53
|
"description": "The program and arguments that opened the file."
|
|
54
54
|
},
|
|
55
|
+
"editor": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "What opened it: `system` (the default program) or the editor from config `editor` or `--with`."
|
|
58
|
+
},
|
|
55
59
|
"_notice": {
|
|
56
60
|
"type": "object",
|
|
57
61
|
"properties": {
|
package/schemas/list.json
CHANGED
|
@@ -152,6 +152,30 @@
|
|
|
152
152
|
}
|
|
153
153
|
]
|
|
154
154
|
},
|
|
155
|
+
"loginProblem": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"required": [
|
|
158
|
+
"kind",
|
|
159
|
+
"message"
|
|
160
|
+
],
|
|
161
|
+
"properties": {
|
|
162
|
+
"kind": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"const": "expired"
|
|
165
|
+
},
|
|
166
|
+
"since": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
},
|
|
169
|
+
"message": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"signedInAt": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "When a sign-in sideby started finished after `since`, with nothing confirming it yet: the Panel says the sign-in finished and waits for confirmation."
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"description": "An Expired Login (ADR-0071): the account is signed in (`login` stays `logged-in`) but its host has reported that the login expired, with no later successful turn or quota answer. `since` is when the host reported it, `message` is sideby's own sentence. Absent when the login is not known to be expired; only Claude Code accounts are checked for now."
|
|
178
|
+
},
|
|
155
179
|
"model": {
|
|
156
180
|
"type": "string"
|
|
157
181
|
},
|
package/schemas/next.json
CHANGED
|
@@ -144,6 +144,24 @@
|
|
|
144
144
|
"sameLoginAs": {
|
|
145
145
|
"type": "string",
|
|
146
146
|
"description": "The current account (`from`), when this one is signed in as the same login: it shares that quota and is never picked."
|
|
147
|
+
},
|
|
148
|
+
"skip": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"required": [
|
|
151
|
+
"reason",
|
|
152
|
+
"command"
|
|
153
|
+
],
|
|
154
|
+
"properties": {
|
|
155
|
+
"reason": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"const": "login-expired"
|
|
158
|
+
},
|
|
159
|
+
"command": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"description": "The command that fixes it: `sideby login <account>`."
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"description": "Set when the account is never picked for a reason its state does not show: `login-expired`, its sign-in expired (ADR-0071)."
|
|
147
165
|
}
|
|
148
166
|
}
|
|
149
167
|
},
|
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.35.
|
|
5
|
+
version: "0.35.8"
|
|
6
6
|
requires:
|
|
7
7
|
bins: [sideby, node]
|
|
8
8
|
cliHelp: sideby --help
|
|
@@ -48,6 +48,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
|
|
|
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
50
|
| See accounts, health, quota and usage | `sideby list --json`, `sideby doctor --json`, `sideby quota --json` | `references/diagnose.md` |
|
|
51
|
+
| 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` |
|
|
51
52
|
| Pin accounts or arrange their Display Order | `sideby order --json`, `sideby pin <ref> --json`, `sideby unpin <ref> --json` | `references/panel.md` |
|
|
52
53
|
| Hide or show a tool or an account in the lists ("too many shown", "hide pi") | `sideby hide <family\|ref> --json`, `sideby unhide <family\|ref> --json`, `sideby list --all` | `references/panel.md` |
|
|
53
54
|
| Turn quota checks on or off, or fix outdated Codex/Grok quota | `sideby quota check <family> on|off --json`, `sideby quota [family] --refresh --json` | `references/quota.md` |
|
|
@@ -63,6 +64,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
|
|
|
63
64
|
| Turn on Auto Handoff ("自动接力", "自动交接", "hand over when quota runs low"), see what it still needs, hand this session over now, or pick an account with room for a subtask | `sideby handoff status --json`, `sideby handoff enable --json` (exit 10 first), `sideby handoff ready`, `sideby next <family> --json` | `references/handoff.md` |
|
|
64
65
|
| Explain or change the handoff rules ("接力规则", "什么时候换号", "让 Codex 接 Claude", "别用 API 账号接力") | `sideby handoff rules --json`, `sideby config set handoff.<key> <value>` or `sideby handoff enable --other-ai/--api --json` (exit 10 first) | `references/handoff.md` |
|
|
65
66
|
| Sign an account in again or switch it to another login ("换个账号登录", "两个目录登录的是同一个号", "sign claude:work in with another account") | `sideby list --json` (`identity`, `sameLogin`), then give the user `sideby login <ref>` | `references/accounts.md` |
|
|
67
|
+
| Sign in again an account whose sign-in expired ("re-login cc003", "重新登录 cc003", "登录过期了帮我重新登录") | `sideby list --json` (`loginProblem`), then give the user `sideby login <ref>` | `references/accounts.md` |
|
|
66
68
|
| Create an account with a given name, an API account, or a short command | `sideby new`, `sideby alias add` | `references/accounts.md` |
|
|
67
69
|
| Rename or remove a short command ("把别名 cc-relay 改成 relay") | `sideby alias rename <old> <new> --json`, `sideby alias rm <short> --json` | `references/accounts.md` |
|
|
68
70
|
| One command that always starts the account with the most quota left ("加个 cc", "自动挑额度最多的账号启动", "start whichever has room") | `sideby alias add <short> --pick <family> --json` (exit 10 first), `sideby alias list --json` | `references/accounts.md` |
|
|
@@ -95,7 +97,7 @@ To open Claude Desktop or the Codex app as one account (macOS, subscription acco
|
|
|
95
97
|
|
|
96
98
|
Grok Bot is not a grok account's app: it signs in with a Cursor account, apart from Grok Build. For several Grok Bot windows at once, run `sideby desktop grok-bot:<name> --json` (a new name makes a new, signed-out window; `grok-bot` is its default one) and relay the notice: sign in inside the new window with the account meant for it, with the other Grok Bot windows closed. `sideby list --json` lists them under `appProfiles`. Removing one (`--remove --yes`) signs it out and deletes its data: do it only when the user asks, after they quit that window.
|
|
97
99
|
|
|
98
|
-
To let the user look at or change one account's own Host settings (`settings.json` for claude and pi, `config.toml` for codex and grok), run `sideby edit <ref> --json`: it opens the file in their default editor and reads none of it. Relay `sharedWith`: a linked file is the main account's, so a change applies to those accounts too. Use `--path` when you only need where the file is. Never print the file's content back: Claude's `settings.json` may hold API keys under `env`.
|
|
100
|
+
To let the user look at or change one account's own Host settings (`settings.json` for claude and pi, `config.toml` for codex and grok), run `sideby edit <ref> --json`: it opens the file in their default editor and reads none of it. Relay `sharedWith`: a linked file is the main account's, so a change applies to those accounts too. Use `--path` when you only need where the file is. If the user says the editor opened but the file did not (or wants another editor), set the editor with `sideby config set editor cursor --json` (or `vscode`, `windsurf`, `zed`; `system` is the default program; see references/panel.md), or open once with `sideby edit <ref> --with <editor> --json`. Never print the file's content back: Claude's `settings.json` may hold API keys under `env`.
|
|
99
101
|
|
|
100
102
|
To find which Chrome browser user the user signed in to an account's website with, or to open claude.ai, chatgpt.com or grok.com there, run `sideby browser --json` and `sideby browser open <ref> --json`. Finding is off until the user agrees: run `sideby browser --enable` to show them what it reads (all on this computer), and add `--yes` only after they say yes. To stop reading Browser Sign-ins, use `sideby browser --disable --json`, show its preview, then add `--yes` after approval. A match may be left over from before a sign-out; say so. When the user says the browser user is wrong ("codex:main 应该是 Profile 7"), run `sideby browser set <ref> <folder|name> --json` (it writes only sideby's config, no confirmation needed); `sideby browser set <ref> --auto --json` lets sideby find it again. When nothing is found, use `set` or `--profile <name>`. A plugin tool has a website only when its plugin sets `website` in its FamilyDef (`docs/guide/plugins.md`); add it there, with `match` when the website keeps an id the tool's login file also has.
|
|
101
103
|
|
|
@@ -41,6 +41,15 @@ Two directories signed in as the same login share one quota (`sameLogin` in `sid
|
|
|
41
41
|
|
|
42
42
|
A running session of that account keeps its old login until it is restarted.
|
|
43
43
|
|
|
44
|
+
## Sign in again after an expired login
|
|
45
|
+
|
|
46
|
+
An account with `loginProblem.kind: "expired"` in `sideby list --json` (an Expired Login) still has its login file, but its Host said the login expired. sideby never picks it for `sideby next`, Auto Handoff or a pick command until it works again.
|
|
47
|
+
|
|
48
|
+
1. Name the account and when it expired (`loginProblem.since`).
|
|
49
|
+
2. Give the user one line to run in their own terminal: `sideby login <ref>` (Claude Code: `! sideby login <ref>`), or tell them to click **Sign in again** on that account in the Panel (it opens the same command in their terminal).
|
|
50
|
+
3. When the sign-in ends well and quota checks are on, sideby asks that account's quota once; a good answer clears the state and sideby prints `<ref> is signed in again`. Otherwise it clears after the account's next successful session or quota check, and the Panel shows "Sign-in finished, waiting for confirmation" meanwhile.
|
|
51
|
+
4. Check `sideby list --json` afterwards: `loginProblem` is gone.
|
|
52
|
+
|
|
44
53
|
## Short commands (aliases)
|
|
45
54
|
|
|
46
55
|
For an account that already exists: `sideby alias add <short> <ref> --json`.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Start read-only:
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
sideby list --json # accounts: ref, family, kind (subscription|api), dir, login, identity.email, model, hostInstalled, problems
|
|
8
|
+
sideby list --json # accounts: ref, family, kind (subscription|api), dir, login, loginProblem, identity.email, model, hostInstalled, problems
|
|
9
9
|
sideby doctor --json # findings: level ok|warn|fail, account, item, code, message, hint, fixable
|
|
10
10
|
sideby quota --json # per account: quota windows (5h, 7d, usedPercent, resetsAt, observedAt) and 7-day tokens
|
|
11
11
|
sideby plugins --json # loaded plugins (setting names only, never values) and load errors
|
|
@@ -26,6 +26,7 @@ Shared Items the Main Account does not have are skipped: no Finding, not counted
|
|
|
26
26
|
| `warn` `skill.outdated` (in `general`) | The installed sideby skill is for another sideby version | Offer `sideby update` (it updates the skill; see `update.md`) |
|
|
27
27
|
| name looks like a backup (`bak`, `backup`, `old`, `tmp`) | A stray directory was picked up as an account | Suggest adding its ref to `ignore` in `${XDG_CONFIG_HOME:-~/.config}/sideby/config.json` |
|
|
28
28
|
| `login: "not-needed"` (`key` in `sideby list`) | API account; it authenticates with `proxy.env` | Nothing to do |
|
|
29
|
+
| `loginProblem: { kind: "expired" }` in `list --json`, `warn` `login.expired` in `doctor` (`expired` in `sideby list`) | An Expired Login: the account is still signed in on disk, but its Host said the login expired (Claude Code: "Login reached its time limit") and nothing has worked since. `sideby next`, Auto Handoff and pick commands skip it | Give the user `sideby login <ref>` (see `accounts.md`, "Sign in again after an expired login"); `doctor --fix` cannot fix it |
|
|
29
30
|
| `problems` on an account in `list --json` | A plugin failed while reading it (for example a settings file that is not valid JSON) | Show the message; the account itself still works |
|
|
30
31
|
| quota `unavailable` / `not-enabled` | Quota checks for that tool are off (config `quota.check.<family>: false`) or it runs in CI | Offer `sideby quota check <family> on` |
|
|
31
32
|
| quota `unavailable` / `no-session` | No session since the source was enabled | Ask the user to start one session with that account |
|
|
@@ -35,6 +36,10 @@ Shared Items the Main Account does not have are skipped: no Finding, not counted
|
|
|
35
36
|
| quota `unavailable` / `unrecognized` | Host changed its file format | Report it; suggest filing an issue with the Host version |
|
|
36
37
|
| host not installed | Accounts exist but the CLI is missing | Point to the Host's install docs; do not install it unasked |
|
|
37
38
|
|
|
39
|
+
### Whose sign-in expired
|
|
40
|
+
|
|
41
|
+
For "which login expired" or a session that says "Login reached its time limit · Please run /login": run `sideby list --json` and name every account with `loginProblem.kind: "expired"`, with `loginProblem.since` (when its Host reported it). Only Claude Code subscription accounts are checked for now; API accounts never are. Only the Host's own words "Login reached its time limit" count, in a session or in a quota check's answer; a `/login` hint, "Not logged in" or "Invalid API key" alone is not an expired login (a quota check that says "Not logged in" shows as `fetch-failed` with `sideby login <ref>` in `detail`). `loginProblem.signedInAt` means the user already signed in again and sideby waits for the next session or quota check to confirm it. Then follow `accounts.md` to sign it in again.
|
|
42
|
+
|
|
38
43
|
Quota is only as fresh as each account's last session; `observedAt` says when it was recorded. A window whose `resetsAt` has passed has reset.
|
|
39
44
|
|
|
40
45
|
## Repair
|
|
@@ -60,7 +60,7 @@ Use `sideby remote-control off --json`, `on --json` or `undo --json`. Exit 10 sh
|
|
|
60
60
|
|
|
61
61
|
Every setting in sideby's config has a command. `sideby config get --json` returns `file` and `keys`: each has `key` (a dot path; `<…>` marks a part you fill in, such as `accounts.<family>:<name>.args`), `meaning`, `takes`, and the current `value` or, for a key with `<…>`, the `entries` set now. `sideby config get panel.theme --json` returns `key`, `set`, optional `value`, `meaning`, `takes`.
|
|
62
62
|
|
|
63
|
-
Prefer the dedicated command where one exists (`model`, `order`, `pin`, `quota check`, `handoff enable`, `terminal`, `update --auto`); `config` covers the rest, such as the Panel's theme and language: `sideby config set panel.theme dark --json` (`system`, `light`, `dark`) or `sideby config set panel.language zh --json` (`auto`, `en`, `zh`). A value is JSON when it parses (`90`, `true`, `["cc002","codex001"]`), else text. Exit 10 returns `action`, `key`, `before`, `after`, `changed`, `applied: false`: show the change, and run the same command with `--yes` after the user agrees. `sideby config unset <key>` goes back to the default the same way. The Panel picks a change up on its next refresh.
|
|
63
|
+
Prefer the dedicated command where one exists (`model`, `order`, `pin`, `quota check`, `handoff enable`, `terminal`, `update --auto`); `config` covers the rest, such as the Panel's theme and language: `sideby config set panel.theme dark --json` (`system`, `light`, `dark`) or `sideby config set panel.language zh --json` (`auto`, `en`, `zh`). The editor that "Open settings.json" and `sideby edit` use is `editor`: `sideby config set editor cursor --json` (`system`, the default program, `cursor`, `vscode`, `windsurf`, `zed`); offer it when the user says their editor opened a window but not the file. A value is JSON when it parses (`90`, `true`, `["cc002","codex001"]`), else text. Exit 10 returns `action`, `key`, `before`, `after`, `changed`, `applied: false`: show the change, and run the same command with `--yes` after the user agrees. `sideby config unset <key>` goes back to the default the same way. The Panel picks a change up on its next refresh.
|
|
64
64
|
|
|
65
65
|
A value the key does not take fails with code `bad-value` and changes nothing; an unknown key `bad-key`. A plugin's own settings are never read or changed through `config` (code `plugin-config`, they may hold secrets); only `plugins.<plugin>.enabled`. `accounts.<ref>.args` takes only model and effort arguments; other Host arguments belong in a short command (`sideby alias add <short> <ref> -- <args>`).
|
|
66
66
|
|
|
@@ -12,7 +12,7 @@ sideby unattended on --until 08:00 --json # or --for 4h; at most 72 hours
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
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.
|
|
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. A terminal manager that starts the Host itself (Orca, for example) is covered once its Claude command is `sideby resume claude --` (configuration guide, "Resuming from other tools"); in Orca that is Settings → Agents → Claude → the command field.
|
|
16
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
17
|
- A Codex account runs the hooks only after the user trusts them once: in that account type `/hooks` and trust both `unattended-hook` entries, before a question and at the end of a turn (`coverage.codex` is `needs-trust`).
|
|
18
18
|
- `sideby unattended off --json` turns it off; inside a Slot it pauses until that Slot ends.
|