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
package/dist/src/cli/format.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export declare const c: {
|
|
|
7
7
|
yellow: (s: string) => string;
|
|
8
8
|
cyan: (s: string) => string;
|
|
9
9
|
};
|
|
10
|
+
/** How many terminal columns `s` takes, colours left out. */
|
|
11
|
+
export declare function displayWidth(s: string): number;
|
|
12
|
+
/** `s` cut to at most `max` columns, ending in `…` when cut. */
|
|
13
|
+
export declare function truncate(s: string, max: number): string;
|
|
10
14
|
export declare function table(rows: string[][], header: string[]): string;
|
|
11
15
|
export declare function ago(iso: string, now: Date): string;
|
|
12
16
|
export declare function clock(iso: string, now: Date): string;
|
package/dist/src/cli/format.js
CHANGED
|
@@ -11,14 +11,52 @@ export const c = {
|
|
|
11
11
|
cyan: paint(36),
|
|
12
12
|
};
|
|
13
13
|
const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, 'g');
|
|
14
|
+
/** Whether a code point takes two terminal columns (East Asian Wide and Fullwidth, and emoji). */
|
|
15
|
+
function isWide(cp) {
|
|
16
|
+
return ((cp >= 0x1100 && cp <= 0x115f) ||
|
|
17
|
+
(cp >= 0x2e80 && cp <= 0x303e) ||
|
|
18
|
+
(cp >= 0x3041 && cp <= 0x33ff) ||
|
|
19
|
+
(cp >= 0x3400 && cp <= 0x4dbf) ||
|
|
20
|
+
(cp >= 0x4e00 && cp <= 0x9fff) ||
|
|
21
|
+
(cp >= 0xa000 && cp <= 0xa4cf) ||
|
|
22
|
+
(cp >= 0xac00 && cp <= 0xd7a3) ||
|
|
23
|
+
(cp >= 0xf900 && cp <= 0xfaff) ||
|
|
24
|
+
(cp >= 0xfe30 && cp <= 0xfe4f) ||
|
|
25
|
+
(cp >= 0xff00 && cp <= 0xff60) ||
|
|
26
|
+
(cp >= 0xffe0 && cp <= 0xffe6) ||
|
|
27
|
+
(cp >= 0x1f300 && cp <= 0x1f64f) ||
|
|
28
|
+
(cp >= 0x1f900 && cp <= 0x1f9ff) ||
|
|
29
|
+
(cp >= 0x20000 && cp <= 0x3fffd));
|
|
30
|
+
}
|
|
31
|
+
/** How many terminal columns `s` takes, colours left out. */
|
|
32
|
+
export function displayWidth(s) {
|
|
33
|
+
let w = 0;
|
|
34
|
+
for (const ch of s.replace(ANSI, ''))
|
|
35
|
+
w += isWide(ch.codePointAt(0)) ? 2 : 1;
|
|
36
|
+
return w;
|
|
37
|
+
}
|
|
38
|
+
/** `s` cut to at most `max` columns, ending in `…` when cut. */
|
|
39
|
+
export function truncate(s, max) {
|
|
40
|
+
if (displayWidth(s) <= max)
|
|
41
|
+
return s;
|
|
42
|
+
let out = '';
|
|
43
|
+
let w = 0;
|
|
44
|
+
for (const ch of s) {
|
|
45
|
+
const cw = isWide(ch.codePointAt(0)) ? 2 : 1;
|
|
46
|
+
if (w + cw > max - 1)
|
|
47
|
+
break;
|
|
48
|
+
out += ch;
|
|
49
|
+
w += cw;
|
|
50
|
+
}
|
|
51
|
+
return `${out}…`;
|
|
52
|
+
}
|
|
14
53
|
export function table(rows, header) {
|
|
15
|
-
const strip = (s) => s.replace(ANSI, '');
|
|
16
54
|
const all = [header, ...rows];
|
|
17
|
-
const widths = header.map((_, i) => Math.max(...all.map((r) =>
|
|
55
|
+
const widths = header.map((_, i) => Math.max(...all.map((r) => displayWidth(r[i] ?? ''))));
|
|
18
56
|
return all
|
|
19
57
|
.map((r, ri) => r
|
|
20
58
|
.map((cell, i) => {
|
|
21
|
-
const pad = ' '.repeat(widths[i] -
|
|
59
|
+
const pad = ' '.repeat(widths[i] - displayWidth(cell));
|
|
22
60
|
return (ri === 0 ? c.dim(cell) : cell) + (i < r.length - 1 ? pad : '');
|
|
23
61
|
})
|
|
24
62
|
.join(' ')
|
|
@@ -80,7 +118,7 @@ export function usageText(u) {
|
|
|
80
118
|
if (u.status === 'unavailable')
|
|
81
119
|
return c.dim(u.reason === 'no-source' ? '—' : u.reason === 'no-session' ? 'none' : u.reason);
|
|
82
120
|
if (u.totalTokens === 0)
|
|
83
|
-
return c.dim('none');
|
|
121
|
+
return u.sessions > 0 ? `${u.sessions} sessions` : c.dim('none');
|
|
84
122
|
return `${compactNumber(u.totalTokens)} tok / ${u.days}d`;
|
|
85
123
|
}
|
|
86
124
|
const TUNING_REASON = {
|
|
@@ -8,6 +8,20 @@ const ReasonCode = Type.Union(['local-build', 'npx', 'volta', 'not-writable', 'p
|
|
|
8
8
|
const Level = Type.Union([Type.Literal('ok'), Type.Literal('warn'), Type.Literal('fail')]);
|
|
9
9
|
const Kind = Type.Union([Type.Literal('subscription'), Type.Literal('api')]);
|
|
10
10
|
const Version = Type.Literal(1);
|
|
11
|
+
/** The menu bar shortcut (`sideby menubar hotkey`, spec §3.31). */
|
|
12
|
+
const hotkeyProps = {
|
|
13
|
+
keys: Type.String({
|
|
14
|
+
description: 'As config `menubar.hotkey` holds it, or the default: `opt+x`, `off`.',
|
|
15
|
+
}),
|
|
16
|
+
label: Type.String({ description: 'As macOS writes it, such as `⌥⌘S`; empty when off.' }),
|
|
17
|
+
enabled: Type.Boolean(),
|
|
18
|
+
isDefault: Type.Boolean(),
|
|
19
|
+
registered: Type.Union([Type.Boolean(), Type.Null()], {
|
|
20
|
+
description: 'Whether the menu bar item could register it: false means another app or macOS holds it; null when it has not said yet or it is off.',
|
|
21
|
+
}),
|
|
22
|
+
problem: Type.Optional(Type.Object({ code: Str, message: Str }, { description: 'A value config allows but a new choice would be refused for; it still works.' })),
|
|
23
|
+
};
|
|
24
|
+
const MenubarHotkeyView = Type.Object(hotkeyProps);
|
|
11
25
|
/** `sideby autostart` and `sideby menubar` (ADR-0029, ADR-0034): a LaunchAgent sideby writes. */
|
|
12
26
|
const loginItem = (current) => Type.Object({
|
|
13
27
|
schemaVersion: Version,
|
|
@@ -27,8 +41,16 @@ const loginItem = (current) => Type.Object({
|
|
|
27
41
|
applied: Type.Optional(Type.Boolean()),
|
|
28
42
|
content: Type.Optional(Type.String({ description: 'The file `on` writes.' })),
|
|
29
43
|
commands: Type.Optional(Type.Array(Type.Array(Str))),
|
|
30
|
-
loaded: Type.Optional(Type.Boolean({
|
|
44
|
+
loaded: Type.Optional(Type.Boolean({
|
|
45
|
+
description: 'After a change: launchd took it now. In a status of the menu bar item: launchd holds it now; false means it is on but not running until `sideby menubar on` or the next login.',
|
|
46
|
+
})),
|
|
31
47
|
note: Type.Optional(Str),
|
|
48
|
+
hotkey: Type.Optional(MenubarHotkeyView),
|
|
49
|
+
icon: Type.Optional(Type.Object({
|
|
50
|
+
visible: Type.Union([Type.Boolean(), Type.Null()], {
|
|
51
|
+
description: 'Whether macOS shows the menu bar icon right now: false when it sits behind « (the menu bar is full) or is covered; null when the item has not said in the last 15 minutes.',
|
|
52
|
+
}),
|
|
53
|
+
}, { description: 'Only while the menu bar item is on.' })),
|
|
32
54
|
});
|
|
33
55
|
const Choice = Type.Object({ model: Type.Optional(Str), effort: Type.Optional(Str) });
|
|
34
56
|
const Shown = Type.Object({
|
|
@@ -351,6 +373,8 @@ const MenubarRow = Type.Object({
|
|
|
351
373
|
detail: Type.String({ description: 'The whole row as one line of text.' }),
|
|
352
374
|
level: MenubarLevel,
|
|
353
375
|
recommended: Type.Boolean({ description: 'The account `sideby next` would pick in this Family.' }),
|
|
376
|
+
observedAt: Type.Union([Str, Type.Null()], { description: 'When the quota was observed, not checked.' }),
|
|
377
|
+
stale: Type.Boolean({ description: 'The quota is old, undated, or its last query failed.' }),
|
|
354
378
|
tip: Type.String({ description: 'Hover text: when each window resets, and what a click does.' }),
|
|
355
379
|
bars: Type.Union([Type.Tuple([MenubarBar, MenubarBar]), Type.Null()], {
|
|
356
380
|
description: 'The shorter window, then the longer one; a single window fills the second. Null without quota.',
|
|
@@ -359,9 +383,97 @@ const MenubarRow = Type.Object({
|
|
|
359
383
|
description: 'Until the fullest window resets, such as `4d 17h`; empty when nothing is used.',
|
|
360
384
|
}),
|
|
361
385
|
note: Type.String({
|
|
362
|
-
description: '
|
|
386
|
+
description: 'A no-quota explanation, or an old-reading warning beside the bars.',
|
|
387
|
+
}),
|
|
388
|
+
});
|
|
389
|
+
const MessageReceipt = Type.Object({
|
|
390
|
+
id: Type.String({
|
|
391
|
+
description: 'Short id, also in the delivered text, so the target record shows when it was read.',
|
|
392
|
+
}),
|
|
393
|
+
to: Type.String({ description: "The target session's Session Label." }),
|
|
394
|
+
toSessionId: Str,
|
|
395
|
+
toAccount: Type.String({ description: 'The account ref that holds the target session.' }),
|
|
396
|
+
from: Type.Optional(Type.String({ description: 'The Session Label of the session that sent it, when sideby could tell.' })),
|
|
397
|
+
status: Type.Union(['stored', 'delivered', 'read', 'paste-needed'].map((k) => Type.Literal(k)), {
|
|
398
|
+
description: "stored: kept as a file only; delivered: the host's own channel took it; read: it shows in the target's record; paste-needed: the user pastes pasteText into the target.",
|
|
399
|
+
}),
|
|
400
|
+
file: Type.String({ description: "The Message file (mode 600) in sideby's state folder." }),
|
|
401
|
+
attachments: Type.Array(Str, { description: 'Screenshots copied next to the Message file.' }),
|
|
402
|
+
pasteText: Type.String({ description: 'One line that tells the target AI to read the Message file.' }),
|
|
403
|
+
note: Type.Optional(Type.String({ description: 'Why a paste is needed, or that the target must approve it (bypass mode).' })),
|
|
404
|
+
needsApproval: Type.Optional(Type.Boolean({
|
|
405
|
+
description: 'true while a delivered Message waits for the user to approve it in the target terminal (ADR-0045); dropped once it is read, and after 6 minutes unread the status becomes paste-needed.',
|
|
406
|
+
})),
|
|
407
|
+
sentAt: Str,
|
|
408
|
+
});
|
|
409
|
+
const IndexState = Type.Union(['building', 'ready', 'off', 'unavailable'].map((k) => Type.Literal(k)), {
|
|
410
|
+
description: '`building`: the History Index is still reading files (what is built answers already); `off`: config `history.index` is false or the index file could not be opened, so only titles and folders are searched; `unavailable`: this Node has no `node:sqlite`.',
|
|
411
|
+
});
|
|
412
|
+
const IndexProgressCount = Type.Object({ done: Type.Integer(), total: Type.Integer() }, { description: 'Files read in the current build of the History Index, and how many it has to read.' });
|
|
413
|
+
const HistorySource = Type.Object({
|
|
414
|
+
account: Str,
|
|
415
|
+
accountLabel: Str,
|
|
416
|
+
family: Str,
|
|
417
|
+
sessions: Type.Integer({ description: 'Sessions stored for the account.' }),
|
|
418
|
+
files: Type.Integer({ description: 'Session record files found.' }),
|
|
419
|
+
failed: Type.Integer({ description: 'Record files that could not be read.' }),
|
|
420
|
+
note: Type.Optional(Type.String({ description: 'Why the account has no sessions or could not be listed, in plain words.' })),
|
|
421
|
+
reason: Type.Optional(Type.Union([
|
|
422
|
+
Type.Literal('empty'),
|
|
423
|
+
Type.Literal('no-conversation'),
|
|
424
|
+
Type.Literal('unreadable'),
|
|
425
|
+
Type.Literal('unsupported'),
|
|
426
|
+
], {
|
|
427
|
+
description: '`note` as a code: no record files, records without a conversation, a folder that could not be read, or a tool sideby reads no history for.',
|
|
428
|
+
})),
|
|
429
|
+
}, { description: 'How many sessions sideby read from one account.' });
|
|
430
|
+
const HistorySession = Type.Object({
|
|
431
|
+
account: Type.String({ description: 'The Account ref, for example `claude:work`.' }),
|
|
432
|
+
accountLabel: Type.String({ description: "The account's short command when it has one, else its ref." }),
|
|
433
|
+
family: Str,
|
|
434
|
+
sessionId: Type.String({ description: "The host's own session id." }),
|
|
435
|
+
title: Type.String({
|
|
436
|
+
description: "The Session Title: the name the user gave it, else the host's title, else the first prompt; may be empty.",
|
|
437
|
+
}),
|
|
438
|
+
titleFrom: Type.Union(['user', 'host', 'prompt', 'none'].map((k) => Type.Literal(k))),
|
|
439
|
+
project: Type.String({
|
|
440
|
+
description: 'The Project: the git repository root of the working directory (worktrees folded in), else the folder.',
|
|
363
441
|
}),
|
|
442
|
+
projectName: Type.String({
|
|
443
|
+
description: 'Its folder name, with the parent folder when two Projects share one.',
|
|
444
|
+
}),
|
|
445
|
+
cwd: Type.String({ description: 'The working directory the session ran in; may be empty.' }),
|
|
446
|
+
cwdGone: Type.Optional(Type.Boolean({ description: 'True when that folder no longer exists.' })),
|
|
447
|
+
branch: Type.Optional(Str),
|
|
448
|
+
model: Type.Optional(Str),
|
|
449
|
+
startedAt: Type.String({ description: 'ISO time; empty when the record gives none.' }),
|
|
450
|
+
updatedAt: Type.String({ description: 'Last activity, ISO time; empty when the record gives none.' }),
|
|
451
|
+
messages: Type.Integer({ description: 'Prompts plus replies.' }),
|
|
452
|
+
script: Type.Boolean({ description: 'A Script Session: started by a script, an SDK or another agent.' }),
|
|
453
|
+
parent: Type.Optional(Type.String({ description: 'For a subagent session: the session id that started it.' })),
|
|
454
|
+
children: Type.Integer({ description: 'Subagent sessions it started.' }),
|
|
455
|
+
preview: Type.Optional(Type.String({
|
|
456
|
+
description: 'The first prompt on one line (at most 240 characters), when it says more than the title.',
|
|
457
|
+
})),
|
|
458
|
+
snippet: Type.Optional(Type.String({ description: 'Where the words matched, about 40 characters each side.' })),
|
|
459
|
+
foundIn: Type.Optional(Type.Literal('tools', { description: '`tools` when the words matched only its tool output (--tools).' })),
|
|
460
|
+
live: Type.Boolean({ description: 'True while the session is running.' }),
|
|
461
|
+
transcript: Type.String({ description: "Path of the session's record." }),
|
|
462
|
+
resumeCommand: Type.String({ description: 'The command that resumes it in the account that holds it.' }),
|
|
463
|
+
continueCommand: Type.String({
|
|
464
|
+
description: '`cd <cwd> && <resumeCommand>` (only the resume command when the folder is gone): continue it where it was.',
|
|
465
|
+
}),
|
|
466
|
+
reference: Type.String({
|
|
467
|
+
description: 'The Session Reference in English: one sentence that points another AI at the session and its record.',
|
|
468
|
+
}),
|
|
469
|
+
group: Type.Optional(Type.String({ description: 'With --group: the key of the group the session is listed under.' })),
|
|
364
470
|
});
|
|
471
|
+
const HistoryCategories = Type.Object({
|
|
472
|
+
label: Type.String({
|
|
473
|
+
description: 'What the categories are called on screen; "Category" when the plugin gives none.',
|
|
474
|
+
}),
|
|
475
|
+
from: Type.String({ description: 'The plugin that sorts Projects into them.' }),
|
|
476
|
+
}, { description: 'Set when a plugin sorts Projects into Project Categories (ADR-0044).' });
|
|
365
477
|
export const OUTPUT_SCHEMAS = {
|
|
366
478
|
pin: PinResult,
|
|
367
479
|
unpin: PinResult,
|
|
@@ -717,6 +829,197 @@ export const OUTPUT_SCHEMAS = {
|
|
|
717
829
|
command: Type.Optional(Type.Array(Str, { description: 'The `open` command sideby ran.' })),
|
|
718
830
|
notices: Type.Array(Str),
|
|
719
831
|
}, { title: 'sideby desktop --json' }),
|
|
832
|
+
sessions: Type.Object({
|
|
833
|
+
schemaVersion: Version,
|
|
834
|
+
sessions: Type.Array(Type.Object({
|
|
835
|
+
account: Type.String({ description: 'The Account ref, for example `claude:002`.' }),
|
|
836
|
+
accountLabel: Type.String({
|
|
837
|
+
description: "The account's short name: its short command when it has one (`cc002`), else its ref.",
|
|
838
|
+
}),
|
|
839
|
+
family: Str,
|
|
840
|
+
sessionId: Type.String({ description: "The host's own session id." }),
|
|
841
|
+
title: Type.String({
|
|
842
|
+
description: "The host's own title for the session, or its working directory name when the host gives none; may be empty.",
|
|
843
|
+
}),
|
|
844
|
+
label: Type.String({
|
|
845
|
+
description: 'The Session Label: `<accountLabel> · <title> · <first 8 of sessionId>`.',
|
|
846
|
+
}),
|
|
847
|
+
status: Type.Union(['needs-you', 'busy', 'idle', 'unknown'].map((k) => Type.Literal(k)), {
|
|
848
|
+
description: '`needs-you`: it waits for the user (a permission or a question); `unknown` where the host does not say.',
|
|
849
|
+
}),
|
|
850
|
+
cwd: Type.Optional(Str),
|
|
851
|
+
pid: Type.Optional(Type.Integer({ description: 'The host process running it.' })),
|
|
852
|
+
startedAt: Type.Optional(Str),
|
|
853
|
+
updatedAt: Type.Optional(Type.String({ description: 'Its most recent activity.' })),
|
|
854
|
+
guessed: Type.Boolean({
|
|
855
|
+
description: "True when sideby could not tie a running program to the session and took the account's newest one (Codex, pi).",
|
|
856
|
+
}),
|
|
857
|
+
transcript: Type.Optional(Type.String({ description: "Path of the session's record." })),
|
|
858
|
+
reference: Type.String({
|
|
859
|
+
description: 'The Session Reference in English: one sentence that points another AI at the session and its record.',
|
|
860
|
+
}),
|
|
861
|
+
resumeCommand: Type.String({
|
|
862
|
+
description: 'The command that resumes it in the account that holds it.',
|
|
863
|
+
}),
|
|
864
|
+
run: Type.Optional(Type.Object({
|
|
865
|
+
title: Type.String({ description: "The Run's title." }),
|
|
866
|
+
laneTitle: Type.Optional(Type.String({ description: 'The part of the Run this session does.' })),
|
|
867
|
+
role: Type.Optional(Type.String({
|
|
868
|
+
description: 'Its role in the Run, for example coordinator, write or review.',
|
|
869
|
+
})),
|
|
870
|
+
board: Type.String({
|
|
871
|
+
description: "The Run Board, a static HTML file in the orchestrator's state folder.",
|
|
872
|
+
}),
|
|
873
|
+
url: Type.String({
|
|
874
|
+
description: '`file://<board>`, with `#lane-<id>` for the part this session does.',
|
|
875
|
+
}),
|
|
876
|
+
others: Type.Optional(Type.Array(Type.Object({
|
|
877
|
+
title: Str,
|
|
878
|
+
laneTitle: Type.Optional(Str),
|
|
879
|
+
role: Type.Optional(Str),
|
|
880
|
+
board: Str,
|
|
881
|
+
}), { description: 'Other Runs the session also works for, after this one (by role).' })),
|
|
882
|
+
}, {
|
|
883
|
+
description: "The Run of a local orchestrator this session works for, from the orchestrator's Session Index (spec §3.32 step 2b); only when the index lists the session and its board file checks out. With several, the first by role (coordinator, write, review, research, other).",
|
|
884
|
+
})),
|
|
885
|
+
}), { description: 'Running sessions, those that need the user first, then by most recent activity.' }),
|
|
886
|
+
problems: Type.Array(Str, {
|
|
887
|
+
description: 'An account or family that could not be read, and what to do; never aborts the listing.',
|
|
888
|
+
}),
|
|
889
|
+
}, { title: 'sideby sessions --json' }),
|
|
890
|
+
'sessions-open-run': Type.Object({
|
|
891
|
+
schemaVersion: Version,
|
|
892
|
+
opened: Type.Literal(true, {
|
|
893
|
+
description: 'The Run Board was handed to the default program; a failure is an error instead.',
|
|
894
|
+
}),
|
|
895
|
+
board: Type.String({ description: 'The Run Board file opened, with the home folder as ~.' }),
|
|
896
|
+
sessionId: Str,
|
|
897
|
+
label: Type.String({ description: 'The Session Label of the session whose run report was opened.' }),
|
|
898
|
+
}, { title: 'sideby sessions open-run --json' }),
|
|
899
|
+
'sessions-copy': Type.Object({
|
|
900
|
+
schemaVersion: Version,
|
|
901
|
+
copied: Type.Boolean({
|
|
902
|
+
description: 'Whether the text went onto the clipboard; false when no clipboard program is installed.',
|
|
903
|
+
}),
|
|
904
|
+
as: Type.Union([Type.Literal('reference'), Type.Literal('id'), Type.Literal('resume')]),
|
|
905
|
+
text: Type.String({ description: 'The text copied, also when it could not be.' }),
|
|
906
|
+
sessionId: Str,
|
|
907
|
+
label: Type.String({ description: 'The Session Label of the session copied.' }),
|
|
908
|
+
}, { title: 'sideby sessions copy --json' }),
|
|
909
|
+
history: Type.Object({
|
|
910
|
+
schemaVersion: Version,
|
|
911
|
+
sessions: Type.Array(HistorySession, {
|
|
912
|
+
description: 'Sessions best match first (relevance times recency), or newest first without words; subagent sessions are counted in their parent. Matches found only in tool output (--tools) come last.',
|
|
913
|
+
}),
|
|
914
|
+
total: Type.Integer({
|
|
915
|
+
description: 'All matching sessions; more than `sessions` when --limit or --offset cut the list.',
|
|
916
|
+
}),
|
|
917
|
+
index: Type.Object({ state: IndexState, progress: IndexProgressCount }),
|
|
918
|
+
sources: Type.Array(HistorySource),
|
|
919
|
+
problems: Type.Array(Str, {
|
|
920
|
+
description: 'An account or file that could not be read, and what to do; never aborts the listing.',
|
|
921
|
+
}),
|
|
922
|
+
groups: Type.Optional(Type.Array(Type.Object({
|
|
923
|
+
key: Type.String({
|
|
924
|
+
description: 'The Project path, category name, Account ref, Family id or day (`today`, `yesterday`, `week`, `month`, `older`); empty for sessions without one.',
|
|
925
|
+
}),
|
|
926
|
+
label: Str,
|
|
927
|
+
sessions: Type.Integer({ description: 'Matching sessions in the group, collapsed or not.' }),
|
|
928
|
+
updatedAt: Str,
|
|
929
|
+
collapsed: Type.Optional(Type.Boolean({
|
|
930
|
+
description: 'True when its sessions were left out of `sessions` (folded in the Panel).',
|
|
931
|
+
})),
|
|
932
|
+
}), {
|
|
933
|
+
description: 'With --group (not `none`): every group of the matches, best first and the one without a key last; days in time order.',
|
|
934
|
+
})),
|
|
935
|
+
categories: Type.Optional(HistoryCategories),
|
|
936
|
+
toolOutputMore: Type.Optional(Type.Literal(true, {
|
|
937
|
+
description: 'With --tools: more sessions matched in tool output than the page holds; a larger --limit lists them.',
|
|
938
|
+
})),
|
|
939
|
+
}, { title: 'sideby history --json' }),
|
|
940
|
+
'history-show': Type.Object({
|
|
941
|
+
schemaVersion: Version,
|
|
942
|
+
session: HistorySession,
|
|
943
|
+
messages: Type.Array(Type.Object({
|
|
944
|
+
n: Type.Integer({ description: 'Position in the session, from 1.' }),
|
|
945
|
+
role: Type.Union([Type.Literal('user'), Type.Literal('assistant'), Type.Literal('tool')]),
|
|
946
|
+
text: Type.String({
|
|
947
|
+
description: 'For `tool`: only the tool name; its input and output are never shown.',
|
|
948
|
+
}),
|
|
949
|
+
at: Type.Optional(Str),
|
|
950
|
+
tool: Type.Optional(Str),
|
|
951
|
+
}), { description: 'Oldest first: the newest --limit (default 200) before --before.' }),
|
|
952
|
+
before: Type.Optional(Type.Integer({
|
|
953
|
+
description: 'Pass as --before for the messages before these; absent at the first message.',
|
|
954
|
+
})),
|
|
955
|
+
}, { title: 'sideby history show --json' }),
|
|
956
|
+
'history-projects': Type.Object({
|
|
957
|
+
schemaVersion: Version,
|
|
958
|
+
projects: Type.Array(Type.Object({
|
|
959
|
+
project: Type.String({ description: 'The Project path; empty for sessions without a folder.' }),
|
|
960
|
+
name: Str,
|
|
961
|
+
sessions: Type.Integer({ description: 'Top-level sessions, Script Sessions not counted.' }),
|
|
962
|
+
updatedAt: Str,
|
|
963
|
+
gone: Type.Optional(Type.Boolean({ description: 'True when every session ran in a folder that is gone.' })),
|
|
964
|
+
category: Type.Optional(Type.String({ description: 'Its Project Category, when a plugin sorts Projects into them.' })),
|
|
965
|
+
}), { description: 'Most recent activity first.' }),
|
|
966
|
+
categories: Type.Optional(HistoryCategories),
|
|
967
|
+
}, { title: 'sideby history projects --json' }),
|
|
968
|
+
'history-index': Type.Object({
|
|
969
|
+
schemaVersion: Version,
|
|
970
|
+
enabled: Type.Boolean({ description: 'False under config `history.index: false`.' }),
|
|
971
|
+
path: Type.String({ description: "The History Index file (mode 600) in sideby's state folder." }),
|
|
972
|
+
state: IndexState,
|
|
973
|
+
progress: IndexProgressCount,
|
|
974
|
+
files: Type.Integer({ description: 'Session record files known.' }),
|
|
975
|
+
sessions: Type.Integer({ description: 'Sessions stored, subagent sessions included.' }),
|
|
976
|
+
bytes: Type.Integer({ description: 'Size of the index file and its journal; 0 when off.' }),
|
|
977
|
+
sources: Type.Array(HistorySource),
|
|
978
|
+
cleared: Type.Optional(Type.Boolean({ description: 'With --clear: whether there was a file to delete.' })),
|
|
979
|
+
}, { title: 'sideby history index --json' }),
|
|
980
|
+
send: Type.Object({
|
|
981
|
+
schemaVersion: Version,
|
|
982
|
+
message: MessageReceipt,
|
|
983
|
+
copied: Type.Boolean({
|
|
984
|
+
description: 'Whether pasteText went onto the clipboard; only tried when status is paste-needed, false otherwise.',
|
|
985
|
+
}),
|
|
986
|
+
}, { title: 'sideby send --json' }),
|
|
987
|
+
messages: Type.Object({
|
|
988
|
+
schemaVersion: Version,
|
|
989
|
+
messages: Type.Array(MessageReceipt, {
|
|
990
|
+
description: 'Messages sideby kept, newest first (20 unless --limit says otherwise).',
|
|
991
|
+
}),
|
|
992
|
+
}, { title: 'sideby messages --json' }),
|
|
993
|
+
'messages-inbound': Type.Object({
|
|
994
|
+
schemaVersion: Version,
|
|
995
|
+
action: Type.Union([Type.Literal('status'), Type.Literal('accept'), Type.Literal('undo')]),
|
|
996
|
+
applied: Type.Optional(Type.Boolean({ description: 'True once the change was written (or undone).' })),
|
|
997
|
+
groups: Type.Optional(Type.Array(Type.Object({
|
|
998
|
+
file: Str,
|
|
999
|
+
accounts: Type.Array(Str, { description: 'Claude accounts whose settings.json is this file.' }),
|
|
1000
|
+
state: Type.Union(['accept', 'hold', 'refuse', 'default', 'other', 'missing', 'blocked'].map((k) => Type.Literal(k)), {
|
|
1001
|
+
description: 'crossSessionInbound is accept, hold or refuse; default: not set (bypass sessions hold messages); other: a value sideby does not know; missing: no settings.json; blocked: cannot be changed safely (see reason).',
|
|
1002
|
+
}),
|
|
1003
|
+
reason: Type.Optional(Str),
|
|
1004
|
+
undo: Type.Boolean({ description: 'sideby set it here and can put the earlier value back.' }),
|
|
1005
|
+
change: Type.Optional(Type.Object({
|
|
1006
|
+
key: Type.Literal('crossSessionInbound'),
|
|
1007
|
+
from: Type.Union([Str, Type.Null()], { description: 'Its value now; null: not set.' }),
|
|
1008
|
+
to: Type.Literal('accept'),
|
|
1009
|
+
}, { description: 'In an accept preview: the one key this file gets and its new value.' })),
|
|
1010
|
+
}), { description: 'For status, every file; for a preview, the files that would change.' })),
|
|
1011
|
+
leftAlone: Type.Optional(Type.Array(Type.Object({
|
|
1012
|
+
file: Str,
|
|
1013
|
+
accounts: Type.Array(Str),
|
|
1014
|
+
state: Str,
|
|
1015
|
+
reason: Type.Optional(Str),
|
|
1016
|
+
undo: Type.Boolean(),
|
|
1017
|
+
}), {
|
|
1018
|
+
description: 'In a preview: the files accept never changes (refuse, an unknown value, blocked, no settings.json), each with its reason.',
|
|
1019
|
+
})),
|
|
1020
|
+
results: Type.Optional(Type.Array(Type.Object({ file: Str, accounts: Type.Array(Str), ok: Type.Boolean(), message: Str }))),
|
|
1021
|
+
message: Type.Optional(Str),
|
|
1022
|
+
}, { title: 'sideby messages inbound [accept|undo] --json' }),
|
|
720
1023
|
edit: Type.Object({
|
|
721
1024
|
schemaVersion: Version,
|
|
722
1025
|
ref: Str,
|
|
@@ -753,18 +1056,34 @@ export const OUTPUT_SCHEMAS = {
|
|
|
753
1056
|
name: Type.String({ description: 'The name Chrome shows; it may be an email.' }),
|
|
754
1057
|
email: Type.Optional(Type.String({ description: 'The Google account this browser user is signed in to Chrome with.' })),
|
|
755
1058
|
signIns: Type.Array(Str, {
|
|
756
|
-
description: "Refs of the accounts this browser user signed in to on the vendor's website, as far as its local data shows; it may be left over from before a sign-out.",
|
|
1059
|
+
description: "Refs of the accounts this browser user signed in to on the vendor's website, as far as its local data shows; it may be left over from before a sign-out. When several browser users show one account, only those whose Google account is the account's login email are kept; an account found nowhere gets the one browser user whose Google account is its login email. A user's choice replaces all of this.",
|
|
757
1060
|
}),
|
|
758
1061
|
changedAt: Type.Optional(Type.String({ description: 'When its Local Storage last changed (ISO 8601).' })),
|
|
759
1062
|
}), { description: 'Most recently changed first.' }),
|
|
760
1063
|
families: Type.Object({
|
|
761
|
-
matched: Type.Array(Str, {
|
|
1064
|
+
matched: Type.Array(Str, {
|
|
1065
|
+
description: 'Families whose accounts can be matched (claude, codex, and plugin families whose `website` has `match`).',
|
|
1066
|
+
}),
|
|
762
1067
|
openOnly: Type.Array(Str, {
|
|
763
1068
|
description: 'Families that can only be opened in a browser user given with --profile (grok).',
|
|
764
1069
|
}),
|
|
765
1070
|
}),
|
|
1071
|
+
sites: Type.Record(Str, Str, {
|
|
1072
|
+
description: 'Family → the https address its accounts open, for the families above.',
|
|
1073
|
+
}),
|
|
1074
|
+
choices: Type.Record(Str, Str, {
|
|
1075
|
+
description: "Account ref → the folder of the browser user the user chose for it (`sideby browser set`); such an account is in that profile's `signIns` alone. A choice whose folder is gone is left out and named in `problems`.",
|
|
1076
|
+
}),
|
|
766
1077
|
problems: Type.Array(Str),
|
|
767
1078
|
}, { title: 'sideby browser --json' }),
|
|
1079
|
+
'browser-set': Type.Object({
|
|
1080
|
+
schemaVersion: Version,
|
|
1081
|
+
ref: Str,
|
|
1082
|
+
profile: Type.Union([Type.Object({ dir: Str, name: Str }), Type.Null()], {
|
|
1083
|
+
description: 'The browser user now chosen, or null with --auto (sideby finds it again by itself).',
|
|
1084
|
+
}),
|
|
1085
|
+
changed: Type.Boolean({ description: 'False when config already said so.' }),
|
|
1086
|
+
}, { title: 'sideby browser set --json' }),
|
|
768
1087
|
'browser-switch': Type.Object({
|
|
769
1088
|
schemaVersion: Version,
|
|
770
1089
|
enabled: Type.Boolean({ description: 'The value asked for.' }),
|
|
@@ -981,6 +1300,17 @@ export const OUTPUT_SCHEMAS = {
|
|
|
981
1300
|
}), { description: 'One per Family with accounts, in Display Order.' }),
|
|
982
1301
|
labels: Type.Record(Str, Str, { description: 'Footer words; `{n}` in `updatedMinutes` is minutes.' }),
|
|
983
1302
|
}),
|
|
1303
|
+
'menubar-hotkey': Type.Union([
|
|
1304
|
+
Type.Object({ schemaVersion: Version, ...hotkeyProps }),
|
|
1305
|
+
Type.Object({
|
|
1306
|
+
schemaVersion: Version,
|
|
1307
|
+
changed: Type.Boolean(),
|
|
1308
|
+
nudged: Type.Boolean({
|
|
1309
|
+
description: 'A running menu bar item was told (a macOS distributed notification); it takes the new shortcut within seconds, without a restart.',
|
|
1310
|
+
}),
|
|
1311
|
+
hotkey: MenubarHotkeyView,
|
|
1312
|
+
}),
|
|
1313
|
+
]),
|
|
984
1314
|
'menubar-start': Type.Object({
|
|
985
1315
|
schemaVersion: Version,
|
|
986
1316
|
task: Str,
|