sideby 0.21.0 → 0.23.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 +1 -0
- package/ai-tasks.json +14 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +7 -0
- package/dist/src/cli/commands.js +441 -31
- package/dist/src/cli/format.js +3 -2
- package/dist/src/cli/json-schemas.js +157 -47
- package/dist/src/cli/main.js +38 -7
- package/dist/src/core/accounts.d.ts +6 -1
- package/dist/src/core/accounts.js +16 -3
- package/dist/src/core/ask.d.ts +2 -1
- package/dist/src/core/ask.js +12 -4
- package/dist/src/core/claude-settings-file.d.ts +57 -0
- package/dist/src/core/claude-settings-file.js +104 -2
- package/dist/src/core/config.d.ts +34 -16
- package/dist/src/core/config.js +58 -5
- package/dist/src/core/create.js +4 -1
- package/dist/src/core/desktop-app.js +5 -1
- package/dist/src/core/handoff-overview.d.ts +4 -1
- package/dist/src/core/handoff-overview.js +3 -2
- package/dist/src/core/handoff-rules.d.ts +34 -0
- package/dist/src/core/handoff-rules.js +115 -0
- package/dist/src/core/handoff-select.js +45 -28
- package/dist/src/core/handoff-status.d.ts +37 -7
- package/dist/src/core/handoff-status.js +95 -19
- package/dist/src/core/handoff.d.ts +4 -1
- package/dist/src/core/handoff.js +8 -5
- package/dist/src/core/inbound.d.ts +11 -3
- package/dist/src/core/inbound.js +26 -74
- package/dist/src/core/launch.js +6 -4
- package/dist/src/core/quota-levels.d.ts +13 -2
- package/dist/src/core/quota-levels.js +21 -3
- package/dist/src/core/remote-control.d.ts +10 -12
- package/dist/src/core/remote-control.js +29 -86
- package/dist/src/core/themes.d.ts +107 -0
- package/dist/src/core/themes.js +463 -0
- package/dist/src/core/tuning-apply.js +12 -20
- package/dist/src/families/agy/index.d.ts +8 -0
- package/dist/src/families/agy/index.js +53 -0
- package/dist/src/families/agy/quota.d.ts +9 -0
- package/dist/src/families/agy/quota.js +110 -0
- package/dist/src/families/index.js +7 -0
- package/dist/src/families/logos.d.ts +10 -0
- package/dist/src/families/logos.js +12 -1
- package/dist/src/menubar/script.js +26 -3
- package/dist/src/menubar/snapshot.d.ts +33 -6
- package/dist/src/menubar/snapshot.js +138 -43
- package/dist/src/menubar/strings.d.ts +18 -2
- package/dist/src/menubar/strings.js +18 -2
- package/dist/src/panel/handler.d.ts +4 -1
- package/dist/src/panel/handler.js +206 -46
- package/dist/src/panel/i18n.d.ts +106 -7
- package/dist/src/panel/i18n.js +260 -62
- package/dist/src/panel/page-logic.d.ts +67 -20
- package/dist/src/panel/page-logic.js +74 -7
- package/dist/src/panel/page-script.js +522 -124
- package/dist/src/panel/page-styles.d.ts +2 -0
- package/dist/src/panel/page-styles.js +157 -34
- package/dist/src/panel/page.js +3 -3
- package/dist/src/panel/theme.d.ts +6 -1
- package/dist/src/panel/theme.js +4 -0
- package/dist/src/panel/themes.d.ts +14 -0
- package/dist/src/panel/themes.js +162 -0
- package/dist/src/plugins/check.js +27 -13
- package/dist/src/plugins/loader.d.ts +11 -0
- package/dist/src/plugins/loader.js +47 -1
- package/dist/src/runtime.d.ts +9 -2
- package/dist/src/runtime.js +12 -5
- package/dist/src/types.d.ts +35 -5
- package/package.json +2 -2
- package/schemas/config.json +45 -2
- package/schemas/families.json +13 -5
- package/schemas/handoff-disable.json +22 -0
- package/schemas/handoff-enable.json +22 -0
- package/schemas/handoff-rules.json +302 -0
- package/schemas/handoff-status.json +26 -0
- package/schemas/hide.json +157 -0
- package/schemas/list.json +15 -0
- package/schemas/menubar-snapshot.json +309 -2
- package/schemas/order.json +26 -1
- package/schemas/pin.json +17 -0
- package/schemas/theme-check.json +140 -0
- package/schemas/theme-export.json +86 -0
- package/schemas/theme-import.json +92 -0
- package/schemas/theme-preview.json +86 -0
- package/schemas/theme-remove.json +87 -0
- package/schemas/theme-use.json +88 -0
- package/schemas/theme.json +137 -0
- package/schemas/unhide.json +157 -0
- package/schemas/unpin.json +17 -0
- package/skills/sideby/SKILL.md +5 -2
- package/skills/sideby/references/accounts.md +1 -0
- package/skills/sideby/references/ai-tasks.md +1 -1
- package/skills/sideby/references/handoff.md +7 -3
- package/skills/sideby/references/panel.md +9 -0
- package/skills/sideby/references/quota.md +3 -1
- package/skills/sideby/references/themes.md +47 -0
package/dist/src/cli/format.js
CHANGED
|
@@ -82,8 +82,9 @@ export function clock(iso, now) {
|
|
|
82
82
|
return sameDay ? hm : `${d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })} ${hm}`;
|
|
83
83
|
}
|
|
84
84
|
function windowText(w, now) {
|
|
85
|
-
// A window that covers only some models goes by their name (spec §3.26)
|
|
86
|
-
|
|
85
|
+
// A window that covers only some models goes by their name (spec §3.26), with its length, since one group may have
|
|
86
|
+
// a 5-hour and a weekly limit (Antigravity CLI).
|
|
87
|
+
const label = w.name ? `${w.name} ${w.label}` : w.label;
|
|
87
88
|
if (Date.parse(w.resetsAt) <= now.getTime())
|
|
88
89
|
return `${label} reset`;
|
|
89
90
|
const pct = Math.round(w.usedPercent);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// JSON Schemas for every `--json` output. Additive changes keep schemaVersion 1; removals, renames or
|
|
2
2
|
// meaning changes bump it (spec §3.9). `pnpm schemas` writes these to schemas/*.json.
|
|
3
3
|
import { Type } from 'typebox';
|
|
4
|
-
import { ConfigSchema } from '../core/config.js';
|
|
4
|
+
import { ConfigSchema, HandoffSettingsSchema } from '../core/config.js';
|
|
5
5
|
const Str = Type.String();
|
|
6
6
|
/** Why sideby cannot do something itself (spec §3.23); `reason` keeps the English text. */
|
|
7
7
|
const ReasonCode = Type.Union(['local-build', 'npx', 'volta', 'not-writable', 'project', 'source', 'skill-in-git'].map((k) => Type.Literal(k)), { description: 'Why, as a code a page can say in its own language.' });
|
|
@@ -88,6 +88,9 @@ const AccountStatus = Type.Intersect([
|
|
|
88
88
|
pinned: Type.Optional(Type.Literal(true, {
|
|
89
89
|
description: 'Pinned to the top of its family in the Panel and `sideby list` (spec §3.25). Display only; absent when not pinned.',
|
|
90
90
|
})),
|
|
91
|
+
hidden: Type.Optional(Type.Literal(true, {
|
|
92
|
+
description: 'Hidden from the Panel, the menu bar and the text of `sideby list` (spec §3.25). Display only; set by `sideby list`, absent when shown.',
|
|
93
|
+
})),
|
|
91
94
|
problems: Type.Optional(Type.Array(Str)),
|
|
92
95
|
desktopApp: Type.Optional(Type.Object({ app: Str, installed: Type.Boolean(), running: Type.Boolean() }, {
|
|
93
96
|
description: "The family's desktop app for this account (macOS, subscription accounts of claude and codex): whether it is installed and whether this account's own window runs now. Open it with `sideby desktop <account>`.",
|
|
@@ -107,15 +110,23 @@ const FamilyInfo = Type.Object({
|
|
|
107
110
|
settingsFile: Type.Optional(Type.String({
|
|
108
111
|
description: "The Host's settings file `sideby edit` opens, relative to the account directory.",
|
|
109
112
|
})),
|
|
113
|
+
mainOnly: Type.Optional(Type.Literal(true, {
|
|
114
|
+
description: 'The Host keeps one sign-in per computer, so sideby knows only its Main Account and refuses to create others (ADR-0047).',
|
|
115
|
+
})),
|
|
116
|
+
hidden: Type.Optional(Type.Literal(true, {
|
|
117
|
+
description: 'Hidden from the Panel, the menu bar and the text of `sideby list` (spec §3.25). Display only; set by `sideby list`, absent when shown.',
|
|
118
|
+
})),
|
|
110
119
|
});
|
|
111
120
|
const ShareModeSchema = Type.Union(['link', 'copy', 'link-or-copy', 'link-or-local', 'local', 'local-if-api', 'info', 'json-key'].map((m) => Type.Literal(m)));
|
|
112
121
|
const FamilyDetail = Type.Intersect([
|
|
113
122
|
FamilyInfo,
|
|
114
123
|
Type.Object({
|
|
115
|
-
layout: Type.Object({ main: Str, account: Str }, {
|
|
116
|
-
|
|
117
|
-
description: 'Environment variable that selects a non-main Account directory.',
|
|
124
|
+
layout: Type.Object({ main: Str, account: Type.Optional(Str) }, {
|
|
125
|
+
description: 'Relative to HOME, for example `.claude` and `.claude-<name>`. A Main-only Family has no `account`.',
|
|
118
126
|
}),
|
|
127
|
+
selectVar: Type.Optional(Type.String({
|
|
128
|
+
description: 'Environment variable that selects a non-main Account directory. Left out for a Main-only Family.',
|
|
129
|
+
})),
|
|
119
130
|
login: Type.Object({
|
|
120
131
|
args: Type.Union([Type.Array(Str), Type.Null()], {
|
|
121
132
|
description: "Arguments of the Host's sign-in command; null when sign-in happens inside the Host.",
|
|
@@ -305,6 +316,8 @@ const Display = Type.Object({
|
|
|
305
316
|
families: Type.Optional(Type.Array(Str)),
|
|
306
317
|
accounts: Type.Optional(Type.Record(Str, Type.Array(Str))),
|
|
307
318
|
pinned: Type.Optional(Type.Record(Str, Type.Array(Str))),
|
|
319
|
+
hiddenFamilies: Type.Optional(Type.Array(Str)),
|
|
320
|
+
hidden: Type.Optional(Type.Record(Str, Type.Array(Str))),
|
|
308
321
|
});
|
|
309
322
|
const PinResult = Type.Object({
|
|
310
323
|
schemaVersion: Version,
|
|
@@ -314,36 +327,35 @@ const PinResult = Type.Object({
|
|
|
314
327
|
message: Str,
|
|
315
328
|
display: Display,
|
|
316
329
|
});
|
|
330
|
+
const HideResult = Type.Object({
|
|
331
|
+
schemaVersion: Version,
|
|
332
|
+
target: Type.String({ description: 'The Family id or account ref that was hidden or shown again.' }),
|
|
333
|
+
kind: Type.Union([Type.Literal('family'), Type.Literal('account')]),
|
|
334
|
+
hidden: Type.Boolean(),
|
|
335
|
+
changed: Type.Boolean(),
|
|
336
|
+
message: Str,
|
|
337
|
+
display: Display,
|
|
338
|
+
});
|
|
317
339
|
const Skipped = Type.Optional(Type.Array(Type.Object({ ref: Str, reason: Str })));
|
|
340
|
+
const HandoffSettingsOut = HandoffSettingsSchema;
|
|
341
|
+
const Takeover = Type.Array(Type.Object({
|
|
342
|
+
ref: Str,
|
|
343
|
+
family: Str,
|
|
344
|
+
starts: Type.Array(Type.Union([Type.Literal('quota'), Type.Literal('limit')])),
|
|
345
|
+
decision: Type.Union([
|
|
346
|
+
Type.Object({ kind: Type.Literal('pick'), ref: Str, skipped: Skipped }),
|
|
347
|
+
Type.Object({ kind: Type.Literal('wait'), until: Str }),
|
|
348
|
+
Type.Object({
|
|
349
|
+
kind: Type.Literal('none'),
|
|
350
|
+
reason: Str,
|
|
351
|
+
earliestReset: Type.Optional(Type.Object({ ref: Str, at: Str })),
|
|
352
|
+
skipped: Skipped,
|
|
353
|
+
}),
|
|
354
|
+
]),
|
|
355
|
+
}));
|
|
318
356
|
const Overview = Type.Object({
|
|
319
|
-
settings:
|
|
320
|
-
|
|
321
|
-
sameFamily: Type.Boolean(),
|
|
322
|
-
prepareAt: Type.Number(),
|
|
323
|
-
threshold: Type.Number(),
|
|
324
|
-
waitIfResetWithinMinutes: Type.Number(),
|
|
325
|
-
countdownSeconds: Type.Number(),
|
|
326
|
-
crossOrganization: Type.Array(Str),
|
|
327
|
-
families: Type.Record(Str, Type.Object({
|
|
328
|
-
policy: Type.Union([Type.Literal('pressure'), Type.Literal('order')]),
|
|
329
|
-
order: Type.Array(Str),
|
|
330
|
-
})),
|
|
331
|
-
}),
|
|
332
|
-
takeover: Type.Array(Type.Object({
|
|
333
|
-
ref: Str,
|
|
334
|
-
family: Str,
|
|
335
|
-
starts: Type.Array(Type.Union([Type.Literal('quota'), Type.Literal('limit')])),
|
|
336
|
-
decision: Type.Union([
|
|
337
|
-
Type.Object({ kind: Type.Literal('pick'), ref: Str, skipped: Skipped }),
|
|
338
|
-
Type.Object({ kind: Type.Literal('wait'), until: Str }),
|
|
339
|
-
Type.Object({
|
|
340
|
-
kind: Type.Literal('none'),
|
|
341
|
-
reason: Str,
|
|
342
|
-
earliestReset: Type.Optional(Type.Object({ ref: Str, at: Str })),
|
|
343
|
-
skipped: Skipped,
|
|
344
|
-
}),
|
|
345
|
-
]),
|
|
346
|
-
})),
|
|
357
|
+
settings: HandoffSettingsOut,
|
|
358
|
+
takeover: Takeover,
|
|
347
359
|
recent: Type.Array(Type.Object({
|
|
348
360
|
from: Str,
|
|
349
361
|
to: Str,
|
|
@@ -375,10 +387,23 @@ const MenubarRow = Type.Object({
|
|
|
375
387
|
recommended: Type.Boolean({ description: 'The account `sideby next` would pick in this Family.' }),
|
|
376
388
|
observedAt: Type.Union([Str, Type.Null()], { description: 'When the quota was observed, not checked.' }),
|
|
377
389
|
stale: Type.Boolean({ description: 'The quota is old, undated, or its last query failed.' }),
|
|
378
|
-
tip: Type.String({
|
|
390
|
+
tip: Type.String({
|
|
391
|
+
description: "Hover text: when the numbers were read, each window's use and reset, and what a click does.",
|
|
392
|
+
}),
|
|
379
393
|
bars: Type.Union([Type.Tuple([MenubarBar, MenubarBar]), Type.Null()], {
|
|
380
394
|
description: 'The shorter window, then the longer one; a single window fills the second. Null without quota.',
|
|
381
395
|
}),
|
|
396
|
+
groups: Type.Union([
|
|
397
|
+
Type.Array(Type.Object({
|
|
398
|
+
label: Str,
|
|
399
|
+
bars: Type.Union([Type.Tuple([MenubarBar, MenubarBar]), Type.Null()]),
|
|
400
|
+
reset: Str,
|
|
401
|
+
tip: Str,
|
|
402
|
+
})),
|
|
403
|
+
Type.Null(),
|
|
404
|
+
], {
|
|
405
|
+
description: "A Host whose every limit covers one model group: a line per group under the account, each with its own bars; the account's `bars` are then null.",
|
|
406
|
+
}),
|
|
382
407
|
reset: Type.String({
|
|
383
408
|
description: 'Until the fullest window resets, such as `4d 17h`; empty when nothing is used.',
|
|
384
409
|
}),
|
|
@@ -482,9 +507,12 @@ export const OUTPUT_SCHEMAS = {
|
|
|
482
507
|
display: Display,
|
|
483
508
|
families: Type.Array(Type.Object({
|
|
484
509
|
family: Str,
|
|
485
|
-
|
|
510
|
+
hidden: Type.Boolean(),
|
|
511
|
+
accounts: Type.Array(Type.Object({ name: Str, ref: Str, pinned: Type.Boolean(), hidden: Type.Boolean() })),
|
|
486
512
|
})),
|
|
487
513
|
}),
|
|
514
|
+
hide: HideResult,
|
|
515
|
+
unhide: HideResult,
|
|
488
516
|
'quota-check': Type.Object({
|
|
489
517
|
schemaVersion: Version,
|
|
490
518
|
family: Str,
|
|
@@ -661,6 +689,9 @@ export const OUTPUT_SCHEMAS = {
|
|
|
661
689
|
'handoff-status': Type.Object({
|
|
662
690
|
schemaVersion: Version,
|
|
663
691
|
overview: Type.Optional(Overview),
|
|
692
|
+
apiUndecided: Type.Optional(Type.Boolean({
|
|
693
|
+
description: 'Auto Handoff was on with API accounts before they became opt-in (ADR-0046): ask the user once whether they may take over, then set handoff.api.',
|
|
694
|
+
})),
|
|
664
695
|
auto: Type.Boolean(),
|
|
665
696
|
sameFamily: Type.Boolean(),
|
|
666
697
|
prepareAt: Type.Number(),
|
|
@@ -687,22 +718,39 @@ export const OUTPUT_SCHEMAS = {
|
|
|
687
718
|
applied: Type.Boolean(),
|
|
688
719
|
file: Str,
|
|
689
720
|
diff: Str,
|
|
690
|
-
settings:
|
|
691
|
-
auto: Type.Boolean(),
|
|
692
|
-
sameFamily: Type.Boolean(),
|
|
693
|
-
prepareAt: Type.Number(),
|
|
694
|
-
threshold: Type.Number(),
|
|
695
|
-
waitIfResetWithinMinutes: Type.Number(),
|
|
696
|
-
countdownSeconds: Type.Number(),
|
|
697
|
-
crossOrganization: Type.Array(Str),
|
|
698
|
-
families: Type.Record(Str, Type.Object({
|
|
699
|
-
policy: Type.Union([Type.Literal('pressure'), Type.Literal('order')]),
|
|
700
|
-
order: Type.Array(Str),
|
|
701
|
-
})),
|
|
702
|
-
}),
|
|
721
|
+
settings: HandoffSettingsOut,
|
|
703
722
|
nextSteps: Type.Array(Str),
|
|
704
723
|
}, { title: `sideby handoff ${sub} --json` }),
|
|
705
724
|
])),
|
|
725
|
+
'handoff-rules': Type.Object({
|
|
726
|
+
schemaVersion: Version,
|
|
727
|
+
auto: Type.Boolean(),
|
|
728
|
+
rules: Type.Array(Type.Object({
|
|
729
|
+
id: Type.Union([
|
|
730
|
+
'when',
|
|
731
|
+
'windows',
|
|
732
|
+
'takeover',
|
|
733
|
+
'wait',
|
|
734
|
+
'sameFamily',
|
|
735
|
+
'otherFamilies',
|
|
736
|
+
'api',
|
|
737
|
+
'organization',
|
|
738
|
+
'order',
|
|
739
|
+
'countdown',
|
|
740
|
+
].map((id) => Type.Literal(id))),
|
|
741
|
+
params: Type.Record(Str, Type.Unknown(), {
|
|
742
|
+
description: 'What the sentence needs, such as numbers.',
|
|
743
|
+
}),
|
|
744
|
+
settings: Type.Array(Str, {
|
|
745
|
+
description: 'The `handoff` config keys that change it; empty when fixed.',
|
|
746
|
+
}),
|
|
747
|
+
text: Type.String({ description: 'The rule in plain English.' }),
|
|
748
|
+
})),
|
|
749
|
+
apiUndecided: Type.Boolean({
|
|
750
|
+
description: 'Auto Handoff was on with API accounts before they became opt-in (ADR-0046): ask the user once, then set handoff.api.',
|
|
751
|
+
}),
|
|
752
|
+
takeover: Takeover,
|
|
753
|
+
}, { title: 'sideby handoff rules --json' }),
|
|
706
754
|
'handoff-ready': Type.Object({
|
|
707
755
|
schemaVersion: Version,
|
|
708
756
|
requested: Type.Literal(true),
|
|
@@ -1287,6 +1335,13 @@ export const OUTPUT_SCHEMAS = {
|
|
|
1287
1335
|
path: Str,
|
|
1288
1336
|
fillRule: Type.Optional(Type.String({ enum: ['nonzero', 'evenodd'] })),
|
|
1289
1337
|
color: Type.Optional(Type.String({ description: 'Brand colour; without one the mark follows the text colour.' })),
|
|
1338
|
+
gradients: Type.Optional(Type.Array(Type.Object({
|
|
1339
|
+
from: Type.Tuple([Type.Number(), Type.Number()]),
|
|
1340
|
+
to: Type.Tuple([Type.Number(), Type.Number()]),
|
|
1341
|
+
color: Str,
|
|
1342
|
+
}), {
|
|
1343
|
+
description: 'Colour washes over a multicoloured mark: each fades from `color` at `from` to clear at `to`.',
|
|
1344
|
+
})),
|
|
1290
1345
|
}),
|
|
1291
1346
|
Type.Null(),
|
|
1292
1347
|
]),
|
|
@@ -1348,6 +1403,61 @@ export const OUTPUT_SCHEMAS = {
|
|
|
1348
1403
|
meaning: Type.Optional(Str),
|
|
1349
1404
|
takes: Type.Optional(Str),
|
|
1350
1405
|
}),
|
|
1406
|
+
// `sideby theme` (spec §3.34, ADR-0050).
|
|
1407
|
+
theme: Type.Object({
|
|
1408
|
+
schemaVersion: Version,
|
|
1409
|
+
folder: Type.String({ description: 'Where Theme Files go, with ~ for the home folder.' }),
|
|
1410
|
+
themes: Type.Array(Type.Object({
|
|
1411
|
+
id: Type.String({ description: 'The name to pass to `sideby theme use`.' }),
|
|
1412
|
+
name: Str,
|
|
1413
|
+
source: Type.Union([Type.Literal('builtin'), Type.Literal('file')]),
|
|
1414
|
+
path: Type.Optional(Str),
|
|
1415
|
+
active: Type.Boolean(),
|
|
1416
|
+
problems: Type.Array(Str, { description: 'Why the Theme cannot be used; empty when it can.' }),
|
|
1417
|
+
warnings: Type.Array(Str, { description: 'Keys of the file that were ignored.' }),
|
|
1418
|
+
})),
|
|
1419
|
+
}),
|
|
1420
|
+
'theme-use': Type.Object({ schemaVersion: Version, before: Str, after: Str, changed: Type.Boolean() }),
|
|
1421
|
+
'theme-check': Type.Object({
|
|
1422
|
+
schemaVersion: Version,
|
|
1423
|
+
id: Str,
|
|
1424
|
+
ok: Type.Boolean({ description: 'Every pair passes; the command exits 1 otherwise.' }),
|
|
1425
|
+
pairs: Type.Array(Type.Object({
|
|
1426
|
+
mode: Type.Union([Type.Literal('light'), Type.Literal('dark')]),
|
|
1427
|
+
fg: Str,
|
|
1428
|
+
bg: Str,
|
|
1429
|
+
ratio: Type.Optional(Type.Number({ description: 'WCAG 2 contrast; missing when a value is not #rrggbb.' })),
|
|
1430
|
+
min: Type.Number(),
|
|
1431
|
+
ok: Type.Boolean(),
|
|
1432
|
+
suggest: Type.Optional(Type.String({ description: 'A value for fg that passes.' })),
|
|
1433
|
+
})),
|
|
1434
|
+
warnings: Type.Array(Str),
|
|
1435
|
+
}),
|
|
1436
|
+
'theme-preview': Type.Object({
|
|
1437
|
+
schemaVersion: Version,
|
|
1438
|
+
opened: Type.Boolean(),
|
|
1439
|
+
url: Type.Optional(Str),
|
|
1440
|
+
hint: Type.Optional(Str),
|
|
1441
|
+
}),
|
|
1442
|
+
'theme-import': Type.Object({
|
|
1443
|
+
schemaVersion: Version,
|
|
1444
|
+
id: Str,
|
|
1445
|
+
path: Str,
|
|
1446
|
+
replaced: Type.Boolean(),
|
|
1447
|
+
exists: Type.Optional(Type.Boolean({ description: 'A Theme File of that name exists; rerun with --yes to replace it.' })),
|
|
1448
|
+
}),
|
|
1449
|
+
'theme-export': Type.Object({
|
|
1450
|
+
schemaVersion: Version,
|
|
1451
|
+
id: Str,
|
|
1452
|
+
out: Type.Optional(Str),
|
|
1453
|
+
theme: Type.Optional(Type.Unknown({ description: 'The Theme File, when no --out was given.' })),
|
|
1454
|
+
}),
|
|
1455
|
+
'theme-remove': Type.Object({
|
|
1456
|
+
schemaVersion: Version,
|
|
1457
|
+
id: Str,
|
|
1458
|
+
removed: Type.Boolean(),
|
|
1459
|
+
wasActive: Type.Optional(Type.Boolean()),
|
|
1460
|
+
}),
|
|
1351
1461
|
'config-set': Type.Object({
|
|
1352
1462
|
schemaVersion: Version,
|
|
1353
1463
|
action: Type.Union([Type.Literal('set'), Type.Literal('unset')]),
|
package/dist/src/cli/main.js
CHANGED
|
@@ -12,6 +12,7 @@ Usage:
|
|
|
12
12
|
sideby key <account> [--var <NAME>] enter an API key without echo
|
|
13
13
|
sideby try <account> [--yes] try the Host with a short paid request
|
|
14
14
|
sideby list accounts (same as \`sideby list\`)
|
|
15
|
+
sideby list --all also list hidden families and accounts
|
|
15
16
|
sideby run <account> [-- args] start the host CLI for one account
|
|
16
17
|
sideby new <family> <name>|--next [--api] [--alias <short>]
|
|
17
18
|
create an account (families: claude, codex, grok, pi);
|
|
@@ -19,10 +20,12 @@ Usage:
|
|
|
19
20
|
--alias also adds a short command such as cc008
|
|
20
21
|
sideby pin|unpin <account|short command> [--json]
|
|
21
22
|
pin or unpin a Same Login (at most 3 per family)
|
|
22
|
-
sideby
|
|
23
|
+
sideby hide|unhide <family|account> [--json]
|
|
24
|
+
hide a family or an account from the Panel, menu bar and list
|
|
25
|
+
sideby order [--json] show display order, with pinned and hidden accounts marked
|
|
23
26
|
sideby order <family> <name>... set account order within a family
|
|
24
27
|
sideby order --families <id>... set family order
|
|
25
|
-
sideby order --reset restore default order, keeping pins
|
|
28
|
+
sideby order --reset restore default order, keeping pins and hidden ones
|
|
26
29
|
sideby quota check <family> on|off turn quota fetching on or off
|
|
27
30
|
sideby update --auto on|off set Auto Update without running an update
|
|
28
31
|
sideby update --skill [--yes] update only the installed sideby skill to this version
|
|
@@ -56,8 +59,11 @@ Usage:
|
|
|
56
59
|
whether Claude sessions connect to claude.ai by themselves;
|
|
57
60
|
off stops that for every account (shows the change first)
|
|
58
61
|
sideby handoff status what Auto Handoff still needs on this machine
|
|
62
|
+
sideby handoff rules every rule that decides when it hands over and to whom,
|
|
63
|
+
and where each account's work would go now
|
|
59
64
|
sideby handoff enable [--yes] turn it on (shows the config change first); --same-family,
|
|
60
|
-
--order claude=codex001,cc002, --threshold n, --prepare-at n
|
|
65
|
+
--order claude=codex001,cc002, --threshold n, --prepare-at n,
|
|
66
|
+
--other-ai [--ai-order codex,grok], --api (billed per use)
|
|
61
67
|
sideby handoff disable [--yes] turn it off, keeping the other settings
|
|
62
68
|
sideby handoff ready [--brief <f>] inside a session sideby started with Auto Handoff: hand over to
|
|
63
69
|
the next account when this turn ends (config \`handoff\`);
|
|
@@ -112,6 +118,9 @@ Usage:
|
|
|
112
118
|
file first)
|
|
113
119
|
sideby menubar [on|off] [--yes] show quota in the macOS menu bar; click an account to start it
|
|
114
120
|
sideby menubar hotkey [<keys>|off] show or change the shortcut that opens that menu (⌥X)
|
|
121
|
+
sideby theme [list] the Panel's Themes; use <name> switches, use --undo goes back, use default clears
|
|
122
|
+
sideby theme check|preview <name|file> contrast report, or one look in the Panel without switching
|
|
123
|
+
sideby theme import <file> | export <name> | remove <name> your own Themes (JSON, colors only)
|
|
115
124
|
sideby config get [<key>] every setting with its value and meaning, or one setting
|
|
116
125
|
sideby config set <key> <value> [--yes]
|
|
117
126
|
change any setting (sideby config set panel.theme dark)
|
|
@@ -141,7 +150,7 @@ Updates: once a day sideby asks the npm registry for its newest version and says
|
|
|
141
150
|
Turn it off with NO_UPDATE_NOTIFIER=1 or config "update": { "check": false }; "auto": true installs by itself.`;
|
|
142
151
|
/** `sideby <command> --help` for the commands agents use to set up and repair accounts (spec §3.16). */
|
|
143
152
|
const COMMAND_HELP = {
|
|
144
|
-
ask: 'sideby ask [<text>] [--task free|fix|quota|account|host|plugin|terminal|handoff|menubar|hotkey] [--account <ref>] [--terminal <id>] [--attach <file>]... [--print] [--json]\nsideby ask --run <id> [--state-dir <dir>]\nsideby ask --spec - [--print] --json\nsideby ask --choices --json\nOpen a task in your terminal. --spec reads a Task Spec (one JSON object, at most 1 MB) from stdin, as a Portal sends it; --choices lists the accounts and terminals a task can use. --attach adds an image (PNG, JPEG, GIF, WebP; up to 20 MB) or a video (MP4, MOV, WebM; up to 200 MB), at most 5. --print prints only the prompt. If opening fails, paste the command into a terminal.',
|
|
153
|
+
ask: 'sideby ask [<text>] [--task free|fix|quota|account|host|plugin|terminal|handoff|theme|menubar|hotkey] [--account <ref>] [--terminal <id>] [--attach <file>]... [--print] [--json]\nsideby ask --run <id> [--state-dir <dir>]\nsideby ask --spec - [--print] --json\nsideby ask --choices --json\nOpen a task in your terminal. --spec reads a Task Spec (one JSON object, at most 1 MB) from stdin, as a Portal sends it; --choices lists the accounts and terminals a task can use. --attach adds an image (PNG, JPEG, GIF, WebP; up to 20 MB) or a video (MP4, MOV, WebM; up to 200 MB), at most 5. --print prints only the prompt. If opening fails, paste the command into a terminal.',
|
|
145
154
|
terminal: "sideby terminal [--set <id>|--custom '<program> … {cwd} … {cmd}'|--unset] [--json]\nList terminals or save your preference; --custom saves and selects your own launch command.",
|
|
146
155
|
key: 'sideby key <account> [--var <NAME>] [--json]\nEnter an API key without echo. Run in a terminal or use the Panel key box.',
|
|
147
156
|
try: 'sideby try <account> [--yes] [--json]\nSend a short request through the Host. This spends a few tokens. Exit 10 waits for --yes.',
|
|
@@ -390,6 +399,20 @@ Examples:
|
|
|
390
399
|
Exit: 0 shown, done or nothing to change; 10 a change was shown and waits for --yes; 1 refused (not macOS, sideby
|
|
391
400
|
in the npx cache or a temporary folder, a file that is not sideby's), failed, or the terminal did not open; 2
|
|
392
401
|
malformed command line.`,
|
|
402
|
+
theme: `sideby theme [list] [--json]
|
|
403
|
+
sideby theme use <name> [--json] | sideby theme use --undo | sideby theme use default
|
|
404
|
+
sideby theme check <name|file> [--json]
|
|
405
|
+
sideby theme preview <name|file>
|
|
406
|
+
sideby theme import <file> [--id <name>] [--yes] [--json]
|
|
407
|
+
sideby theme export <name> [--out <file>] [--json]
|
|
408
|
+
sideby theme remove <name> [--yes] [--json]
|
|
409
|
+
|
|
410
|
+
The Panel's colors. Built-in Themes: sky (default) and leaf. A Theme File is JSON in <config>/themes/<name>.json:
|
|
411
|
+
{"schemaVersion": 1, "name": "My blue", "base": "sky", "accent": "#2f7fbf", "light": {...}, "dark": {...}}
|
|
412
|
+
base and accent are optional; light and dark take the same tokens as a Portal Theme. Files hold colors only, never code.
|
|
413
|
+
check reports text and control contrast in light and dark with a value that would pass (exit 1 when any fails); the
|
|
414
|
+
Panel moves failing colors itself. preview shows a Theme once in the running Panel without switching. Exit 10: import
|
|
415
|
+
over an existing name or remove waits for --yes.`,
|
|
393
416
|
config: `sideby config get [<key>] [--json]
|
|
394
417
|
sideby config set <key> <value> [--yes] [--json]
|
|
395
418
|
sideby config unset <key> [--yes] [--json]
|
|
@@ -473,8 +496,11 @@ const COMMANDS = {
|
|
|
473
496
|
autostart: { flags: ['json', 'yes', 'refresh'] },
|
|
474
497
|
menubar: { flags: ['json', 'yes', 'refresh'], valued: ['lang', 'hotkey', 'hotkey-label', 'icon'] },
|
|
475
498
|
config: { flags: ['json', 'yes'] },
|
|
476
|
-
|
|
499
|
+
theme: { flags: ['json', 'yes', 'undo'], valued: ['id', 'out'] },
|
|
500
|
+
list: { flags: ['json', 'all'] },
|
|
477
501
|
pin: { flags: ['json'] },
|
|
502
|
+
hide: { flags: ['json'] },
|
|
503
|
+
unhide: { flags: ['json'] },
|
|
478
504
|
unpin: { flags: ['json'] },
|
|
479
505
|
order: { flags: ['json', 'families', 'reset'] },
|
|
480
506
|
run: { flags: [] },
|
|
@@ -489,8 +515,8 @@ const COMMANDS = {
|
|
|
489
515
|
model: { flags: ['json', 'yes'], valued: ['effort'] },
|
|
490
516
|
'remote-control': { flags: ['json', 'yes'] },
|
|
491
517
|
handoff: {
|
|
492
|
-
flags: ['json', 'yes', 'same-family', 'no-same-family'],
|
|
493
|
-
valued: ['brief', 'to', 'order', 'prepare-at', 'threshold', 'wait-minutes', 'countdown'],
|
|
518
|
+
flags: ['json', 'yes', 'same-family', 'no-same-family', 'other-ai', 'no-other-ai', 'api', 'no-api'],
|
|
519
|
+
valued: ['brief', 'to', 'order', 'ai-order', 'prepare-at', 'threshold', 'wait-minutes', 'countdown'],
|
|
494
520
|
},
|
|
495
521
|
ui: { flags: ['no-open', 'background', 'stop', 'serve-detached'], valued: ['port'] },
|
|
496
522
|
app: { flags: ['json'], valued: ['url'] },
|
|
@@ -720,6 +746,9 @@ async function dispatch(cmd, parsed, io, cmds) {
|
|
|
720
746
|
case 'pin':
|
|
721
747
|
case 'unpin':
|
|
722
748
|
return await cmds.cmdPin(parsed, io, cmd === 'pin');
|
|
749
|
+
case 'hide':
|
|
750
|
+
case 'unhide':
|
|
751
|
+
return await cmds.cmdHide(parsed, io, cmd === 'hide');
|
|
723
752
|
case 'order':
|
|
724
753
|
return await cmds.cmdOrder(parsed, io);
|
|
725
754
|
case 'list':
|
|
@@ -784,6 +813,8 @@ async function dispatch(cmd, parsed, io, cmds) {
|
|
|
784
813
|
return await cmds.cmdMenubar(parsed, io);
|
|
785
814
|
case 'config':
|
|
786
815
|
return await cmds.cmdConfig(parsed, io);
|
|
816
|
+
case 'theme':
|
|
817
|
+
return await cmds.cmdTheme(parsed, io);
|
|
787
818
|
}
|
|
788
819
|
return 2;
|
|
789
820
|
}
|
|
@@ -6,12 +6,17 @@ export { ACCOUNT_NAME };
|
|
|
6
6
|
export declare function looksLikeBackup(name: string): boolean;
|
|
7
7
|
export declare function mainDirOf(family: FamilyDef, home: string): string;
|
|
8
8
|
export declare function accountDirOf(family: FamilyDef, home: string, name: string): string;
|
|
9
|
+
/** Why a Main-only Family (ADR-0047) has no other Account, and what the user can do instead. */
|
|
10
|
+
export declare function mainOnlyMessage(family: FamilyDef): string;
|
|
9
11
|
/**
|
|
10
12
|
* The Account for this Family and name, read from its directory: the one place an Account is built.
|
|
11
13
|
* Whether it is an API Account follows the Secret File on disk (and the Family's secretFileMeansApi).
|
|
12
14
|
*/
|
|
13
15
|
export declare function accountAt(family: FamilyDef, home: string, name: string): Promise<Account>;
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Discovers the Main Account (if its directory exists) and every `<prefix><name><suffix>` directory in HOME. A
|
|
18
|
+
* Main-only Family (ADR-0047) has only its Main Account: HOME is not scanned for it.
|
|
19
|
+
*/
|
|
15
20
|
export declare function discoverAccounts(family: FamilyDef, home: string, ignore?: ReadonlySet<string>): Promise<Account[]>;
|
|
16
21
|
export declare class AccountRefError extends UserError {
|
|
17
22
|
}
|
|
@@ -13,10 +13,18 @@ export function mainDirOf(family, home) {
|
|
|
13
13
|
return join(home, family.layout.main);
|
|
14
14
|
}
|
|
15
15
|
export function accountDirOf(family, home, name) {
|
|
16
|
-
|
|
16
|
+
if (name === 'main')
|
|
17
|
+
return mainDirOf(family, home);
|
|
18
|
+
if (!family.layout.account)
|
|
19
|
+
throw new UserError(mainOnlyMessage(family), { code: 'family-main-only' });
|
|
20
|
+
return join(home, family.layout.account.replace('<name>', name));
|
|
21
|
+
}
|
|
22
|
+
/** Why a Main-only Family (ADR-0047) has no other Account, and what the user can do instead. */
|
|
23
|
+
export function mainOnlyMessage(family) {
|
|
24
|
+
return `${family.title} keeps one sign-in per computer, so sideby supports only its main account for now; run \`sideby run ${family.id}:main\` to use it`;
|
|
17
25
|
}
|
|
18
26
|
function splitLayout(family) {
|
|
19
|
-
const [first, ...rest] = family.layout.account.split('/');
|
|
27
|
+
const [first, ...rest] = (family.layout.account ?? '').split('/');
|
|
20
28
|
const at = first.indexOf('<name>');
|
|
21
29
|
if (at === -1)
|
|
22
30
|
throw new Error(`family ${family.id}: layout.account must contain <name> in its first segment`);
|
|
@@ -56,12 +64,17 @@ async function looksLikeAccount(family, dir) {
|
|
|
56
64
|
return false;
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Discovers the Main Account (if its directory exists) and every `<prefix><name><suffix>` directory in HOME. A
|
|
69
|
+
* Main-only Family (ADR-0047) has only its Main Account: HOME is not scanned for it.
|
|
70
|
+
*/
|
|
60
71
|
export async function discoverAccounts(family, home, ignore = new Set()) {
|
|
61
72
|
const out = [];
|
|
62
73
|
const main = mainDirOf(family, home);
|
|
63
74
|
if ((await statOrNull(main))?.isDirectory())
|
|
64
75
|
out.push(await accountAt(family, home, 'main'));
|
|
76
|
+
if (!family.layout.account)
|
|
77
|
+
return out;
|
|
65
78
|
const { prefix, suffix, rest } = splitLayout(family);
|
|
66
79
|
let entries = [];
|
|
67
80
|
try {
|
package/dist/src/core/ask.d.ts
CHANGED
|
@@ -58,7 +58,8 @@ export declare function taskStateDir(dir: string): Promise<string>;
|
|
|
58
58
|
* The Host arguments `ask --run` adds for a prompt task: `<imageArg>=<path>` per attached image for a Family that
|
|
59
59
|
* declares `imageArg` (spec §3.28 "附件"), then the prompt, always last. The `=` form keeps one value per option, so a
|
|
60
60
|
* Host option that takes several values cannot swallow the prompt. An image that is gone, or whose path holds a comma
|
|
61
|
-
* (a Host taking lists may split it), is left to the path in the prompt.
|
|
61
|
+
* (a Host taking lists may split it), is left to the path in the prompt. A Family with `promptArg` gets the prompt as
|
|
62
|
+
* `<promptArg>=<prompt>` instead, since its Host refuses a positional prompt.
|
|
62
63
|
*/
|
|
63
64
|
export declare function taskHostArgs(rt: Runtime, task: TaskFile): Promise<string[]>;
|
|
64
65
|
/** `env` with the HOME and XDG folders the task was written under, so the Runtime sees what the Panel saw. */
|
package/dist/src/core/ask.js
CHANGED
|
@@ -132,10 +132,12 @@ function validAttachments(list) {
|
|
|
132
132
|
* The Host arguments `ask --run` adds for a prompt task: `<imageArg>=<path>` per attached image for a Family that
|
|
133
133
|
* declares `imageArg` (spec §3.28 "附件"), then the prompt, always last. The `=` form keeps one value per option, so a
|
|
134
134
|
* Host option that takes several values cannot swallow the prompt. An image that is gone, or whose path holds a comma
|
|
135
|
-
* (a Host taking lists may split it), is left to the path in the prompt.
|
|
135
|
+
* (a Host taking lists may split it), is left to the path in the prompt. A Family with `promptArg` gets the prompt as
|
|
136
|
+
* `<promptArg>=<prompt>` instead, since its Host refuses a positional prompt.
|
|
136
137
|
*/
|
|
137
138
|
export async function taskHostArgs(rt, task) {
|
|
138
|
-
const
|
|
139
|
+
const family = rt.families.get((await rt.resolve(task.account)).family);
|
|
140
|
+
const flag = family?.imageArg;
|
|
139
141
|
const images = [];
|
|
140
142
|
if (flag)
|
|
141
143
|
for (const a of task.attachments ?? []) {
|
|
@@ -144,7 +146,8 @@ export async function taskHostArgs(rt, task) {
|
|
|
144
146
|
if (await lstat(a.path).then((s) => s.isFile(), () => false))
|
|
145
147
|
images.push(`${flag}=${a.path}`);
|
|
146
148
|
}
|
|
147
|
-
|
|
149
|
+
const prompt = task.prompt ?? '';
|
|
150
|
+
return [...images, family?.promptArg ? `${family.promptArg}=${prompt}` : prompt];
|
|
148
151
|
}
|
|
149
152
|
/** `env` with the HOME and XDG folders the task was written under, so the Runtime sees what the Panel saw. */
|
|
150
153
|
export function taskEnv(task, env) {
|
|
@@ -257,7 +260,12 @@ export function taskContext(c, fail) {
|
|
|
257
260
|
return v;
|
|
258
261
|
};
|
|
259
262
|
for (const [k, v] of Object.entries(c)) {
|
|
260
|
-
if (k === 'account' ||
|
|
263
|
+
if (k === 'account' ||
|
|
264
|
+
k === 'family' ||
|
|
265
|
+
k === 'quotaReason' ||
|
|
266
|
+
k === 'version' ||
|
|
267
|
+
k === 'terminalCustom' ||
|
|
268
|
+
k === 'theme')
|
|
261
269
|
out[k] = str(v, `"context.${k}"`);
|
|
262
270
|
else if (k === 'terminals') {
|
|
263
271
|
if (!Array.isArray(v) || v.length > 50)
|
|
@@ -33,3 +33,60 @@ export declare const keyRecordPath: (stateDir: string, dir: string, file: string
|
|
|
33
33
|
export declare function writeKeyRecord(stateDir: string, dir: string, file: string, record: object): Promise<void>;
|
|
34
34
|
/** The parsed undo record of `file`, or null when there is none or it does not name `file`. */
|
|
35
35
|
export declare function readKeyRecord(stateDir: string, dir: string, file: string): Promise<Json | null>;
|
|
36
|
+
/** What sideby keeps to undo one key it wrote: whether the key was there, its exact value then, and what it wrote. */
|
|
37
|
+
export interface KeyUndo {
|
|
38
|
+
file: string;
|
|
39
|
+
hadKey: boolean;
|
|
40
|
+
previous?: unknown;
|
|
41
|
+
wrote: unknown;
|
|
42
|
+
at: string;
|
|
43
|
+
}
|
|
44
|
+
/** One line per settings file a change was meant for. */
|
|
45
|
+
export interface KeyResult {
|
|
46
|
+
file: string;
|
|
47
|
+
accounts: string[];
|
|
48
|
+
ok: boolean;
|
|
49
|
+
message: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* One top-level key of Claude's settings files that sideby writes for the user and can undo (Remote Control,
|
|
53
|
+
* ADR-0017; Cross-session inbound, ADR-0040). Each write goes through `writeSettingsKey` and leaves an undo record in
|
|
54
|
+
* `<state>/<records>/`; undo puts the old value back (or removes the key) only while it still holds what sideby
|
|
55
|
+
* wrote. `legacyWrote` reads a record from before `wrote` was kept as one that wrote that value.
|
|
56
|
+
*/
|
|
57
|
+
export declare function settingsKey(key: string, records: string, opts?: {
|
|
58
|
+
legacyWrote?: unknown;
|
|
59
|
+
}): {
|
|
60
|
+
key: string;
|
|
61
|
+
/** Whether sideby wrote `obj`'s key in `file` and it still holds that, so undo can put it back. */
|
|
62
|
+
undoable(stateDir: string, file: string, obj: Json): Promise<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* Sets the key to `to` in each group, remembering the old value. `expect` gets the value in the file right before
|
|
65
|
+
* the write and refuses with a message when the change no longer fits it.
|
|
66
|
+
*/
|
|
67
|
+
set(stateDir: string, groups: readonly {
|
|
68
|
+
file: string;
|
|
69
|
+
accounts: string[];
|
|
70
|
+
}[], to: unknown, expect: (current: unknown) => string | null, done: string): Promise<KeyResult[]>;
|
|
71
|
+
/** Puts back what each group had before `set`, only while the key still holds what sideby wrote. */
|
|
72
|
+
undo(stateDir: string, groups: readonly {
|
|
73
|
+
file: string;
|
|
74
|
+
accounts: string[];
|
|
75
|
+
}[]): Promise<KeyResult[]>;
|
|
76
|
+
};
|
|
77
|
+
/** Why a settings file cannot be read for a change: none there, a link to nothing, or not a safe JSON object. */
|
|
78
|
+
export type SettingsProblem = 'no-settings' | 'broken-link' | 'unsafe';
|
|
79
|
+
/**
|
|
80
|
+
* Every Claude Account's settings file, grouped as `settingsFileGroups` does, with the parsed object, or the problem
|
|
81
|
+
* and a reason that says what to do (the Panel words it from `why`).
|
|
82
|
+
*/
|
|
83
|
+
export declare function readSettingsGroups(accounts: readonly Account[]): Promise<({
|
|
84
|
+
file: string;
|
|
85
|
+
accounts: string[];
|
|
86
|
+
obj: Json;
|
|
87
|
+
} | {
|
|
88
|
+
file: string;
|
|
89
|
+
accounts: string[];
|
|
90
|
+
why: SettingsProblem;
|
|
91
|
+
reason: string;
|
|
92
|
+
})[]>;
|