sideby 0.26.0 → 0.27.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/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +5 -0
- package/dist/src/cli/commands.js +28 -0
- package/dist/src/cli/json-schemas.js +14 -0
- package/dist/src/cli/main.js +18 -2
- package/dist/src/core/search-catalog.d.ts +54 -0
- package/dist/src/core/search-catalog.js +357 -0
- package/dist/src/panel/i18n.d.ts +23 -1
- package/dist/src/panel/i18n.js +46 -2
- package/dist/src/panel/page-script.js +349 -62
- package/dist/src/panel/page-styles.js +27 -0
- package/dist/src/panel/page.js +3 -0
- package/package.json +1 -1
- package/schemas/commands.json +117 -0
- package/skills/sideby/SKILL.md +2 -1
- package/skills/sideby/references/panel.md +10 -0
package/dist/build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"20261028T040020-d659f5"}
|
|
@@ -153,3 +153,8 @@ export declare function cmdTheme(a: ParsedArgs, io: Io): Promise<number>;
|
|
|
153
153
|
* `network` after a preview (exit 10 without `--yes`).
|
|
154
154
|
*/
|
|
155
155
|
export declare function cmdNetwork(a: ParsedArgs, io: Io): Promise<number>;
|
|
156
|
+
/**
|
|
157
|
+
* `sideby commands <words>` (spec §3.36, ADR-0054): the Search Catalog the Panel's Command Palette searches, read-only.
|
|
158
|
+
* Titles and places are in English, as every other command prints; the words may be English or Chinese.
|
|
159
|
+
*/
|
|
160
|
+
export declare function cmdCommands(a: ParsedArgs, io: Io): number;
|
package/dist/src/cli/commands.js
CHANGED
|
@@ -20,6 +20,7 @@ import { accountModel, setAccountModel } from '../core/model-choice.js';
|
|
|
20
20
|
import { resolvePaths, tildify } from '../core/paths.js';
|
|
21
21
|
import { USAGE_DAYS } from '../core/quota-levels.js';
|
|
22
22
|
import { groupsToUndo, remoteControlNothingToDo, remoteControlTodo, } from '../core/remote-control.js';
|
|
23
|
+
import { SEARCH_CATALOG, searchCatalog } from '../core/search-catalog.js';
|
|
23
24
|
import { SHELLS } from '../core/shell-init.js';
|
|
24
25
|
import { MODEL_NAME } from '../families/shared/model-args.js';
|
|
25
26
|
import { AI_TASK_KINDS, hiddenIn, inDisplayOrder, pinnedIn, suggestAlias, suggestName, withPinned, } from '../panel/page-logic.js';
|
|
@@ -3897,3 +3898,30 @@ export async function cmdNetwork(a, io) {
|
|
|
3897
3898
|
io.out(c.dim('Sessions started without sideby (running `claude` or `codex` directly) are not checked.'));
|
|
3898
3899
|
return 0;
|
|
3899
3900
|
}
|
|
3901
|
+
/**
|
|
3902
|
+
* `sideby commands <words>` (spec §3.36, ADR-0054): the Search Catalog the Panel's Command Palette searches, read-only.
|
|
3903
|
+
* Titles and places are in English, as every other command prints; the words may be English or Chinese.
|
|
3904
|
+
*/
|
|
3905
|
+
export function cmdCommands(a, io) {
|
|
3906
|
+
const query = a.positionals.join(' ').trim();
|
|
3907
|
+
if (!query)
|
|
3908
|
+
throw new UsageError('usage: sideby commands <words> [--json], for example: sideby commands language');
|
|
3909
|
+
const results = searchCatalog(query, SEARCH_CATALOG).map(({ entry }) => ({
|
|
3910
|
+
id: entry.id,
|
|
3911
|
+
kind: entry.kind,
|
|
3912
|
+
title: entry.title.en,
|
|
3913
|
+
panel: entry.panel.en,
|
|
3914
|
+
cliCommand: entry.cliCommand,
|
|
3915
|
+
}));
|
|
3916
|
+
if (a.flags.has('json')) {
|
|
3917
|
+
json(io, { results });
|
|
3918
|
+
return 0;
|
|
3919
|
+
}
|
|
3920
|
+
if (!results.length) {
|
|
3921
|
+
io.out(`No feature of sideby matches "${query}".`);
|
|
3922
|
+
io.out(c.dim(`Try other words (English or Chinese), \`sideby history ${query}\` to find a past session, or ask your AI.`));
|
|
3923
|
+
return 0;
|
|
3924
|
+
}
|
|
3925
|
+
io.out(table(results.map((r) => [r.title, r.kind, r.panel, r.cliCommand ?? c.dim('Panel only')]), ['Feature', 'Kind', 'In the Panel', 'Command']));
|
|
3926
|
+
return 0;
|
|
3927
|
+
}
|
|
@@ -840,6 +840,20 @@ export const OUTPUT_SCHEMAS = {
|
|
|
840
840
|
errors: Type.Array(PluginError),
|
|
841
841
|
}, { title: 'sideby plugins --json' }),
|
|
842
842
|
families: Type.Object({ schemaVersion: Version, families: Type.Array(FamilyDetail) }, { title: 'sideby families --json' }),
|
|
843
|
+
commands: Type.Object({
|
|
844
|
+
schemaVersion: Version,
|
|
845
|
+
results: Type.Array(Type.Object({
|
|
846
|
+
id: Str,
|
|
847
|
+
kind: Type.String({
|
|
848
|
+
description: "'page', 'setting' or 'action'; an open set, so tolerate others.",
|
|
849
|
+
}),
|
|
850
|
+
title: Str,
|
|
851
|
+
panel: Type.String({
|
|
852
|
+
description: 'Where it lives in the Panel, such as "Settings → General → Language".',
|
|
853
|
+
}),
|
|
854
|
+
cliCommand: Type.Union([Str, Type.Null()]),
|
|
855
|
+
})),
|
|
856
|
+
}, { title: 'sideby commands --json' }),
|
|
843
857
|
'app-install': Type.Object({
|
|
844
858
|
schemaVersion: Version,
|
|
845
859
|
platform: AppPlatform,
|
package/dist/src/cli/main.js
CHANGED
|
@@ -29,6 +29,8 @@ Usage:
|
|
|
29
29
|
sideby quota check <family> on|off turn quota fetching on or off
|
|
30
30
|
sideby update --auto on|off set Auto Update without running an update
|
|
31
31
|
sideby update --skill [--yes] update only the installed sideby skill to this version
|
|
32
|
+
sideby commands <words> find where a page, setting or action lives in the Panel,
|
|
33
|
+
and the command that does the same (read-only)
|
|
32
34
|
sideby families [family] what each host's accounts share with the main account,
|
|
33
35
|
where they live and how they sign in
|
|
34
36
|
sideby alias add <short> <account> [-- args]
|
|
@@ -132,9 +134,9 @@ Usage:
|
|
|
132
134
|
|
|
133
135
|
Options:
|
|
134
136
|
--json machine-readable output (list, new, next, alias, doctor, quota, tune, model, remote-control, handoff,
|
|
135
|
-
families, plugins, app, desktop, sessions, history, send, messages, edit, browser, update, local, ask,
|
|
137
|
+
families, commands, plugins, app, desktop, sessions, history, send, messages, edit, browser, update, local, ask,
|
|
136
138
|
terminal, key, try, autostart, menubar, config)
|
|
137
|
-
-h, --help show this help; \`sideby <command> --help\` for new, alias, login, doctor, families, desktop, edit, browser,
|
|
139
|
+
-h, --help show this help; \`sideby <command> --help\` for new, alias, login, doctor, families, commands, desktop, edit, browser,
|
|
138
140
|
autostart, menubar, config, sessions, history, send, messages
|
|
139
141
|
-v, --version show the version
|
|
140
142
|
|
|
@@ -493,6 +495,17 @@ Examples:
|
|
|
493
495
|
sideby browser set codex:main "Profile 7"
|
|
494
496
|
Exit: 0 shown, changed, chosen or opened; 1 not macOS, Chrome not installed, no or several browser users to choose from, or
|
|
495
497
|
Chrome did not open; 10 --enable/--disable without --yes; 2 malformed command line.`,
|
|
498
|
+
commands: `sideby commands <words>... [--json]
|
|
499
|
+
|
|
500
|
+
Find a feature of sideby by name, in English or Chinese: a page of the Panel, a setting or an action. Each result
|
|
501
|
+
says where it lives in the Panel (Settings → General → Language) and the command that does the same, when there is
|
|
502
|
+
one. The Panel's Search (Cmd/Ctrl+K) searches the same list. It finds features, not sessions: for those use
|
|
503
|
+
\`sideby history <words>\`.
|
|
504
|
+
|
|
505
|
+
Examples:
|
|
506
|
+
sideby commands language
|
|
507
|
+
sideby commands 深色 --json
|
|
508
|
+
Exit: 0, also when nothing matches; 2 no words given or malformed command line.`,
|
|
496
509
|
families: `sideby families [family] [--json]
|
|
497
510
|
|
|
498
511
|
For each host (built in or from a plugin): where its accounts live, the variable that selects one, how to sign
|
|
@@ -562,6 +575,7 @@ const COMMANDS = {
|
|
|
562
575
|
'shell-init': { flags: ['write', 'yes', 'undo', 'json'] },
|
|
563
576
|
plugins: { flags: ['json'] },
|
|
564
577
|
families: { flags: ['json'] },
|
|
578
|
+
commands: { flags: ['json'] },
|
|
565
579
|
update: { flags: ['json', 'yes', 'skill'], valued: ['auto'] },
|
|
566
580
|
local: { flags: ['json', 'yes'] },
|
|
567
581
|
'update-check': { flags: [] },
|
|
@@ -837,6 +851,8 @@ async function dispatch(cmd, parsed, io, cmds) {
|
|
|
837
851
|
return await cmds.cmdPlugins(parsed, io);
|
|
838
852
|
case 'families':
|
|
839
853
|
return await cmds.cmdFamilies(parsed, io);
|
|
854
|
+
case 'commands':
|
|
855
|
+
return cmds.cmdCommands(parsed, io);
|
|
840
856
|
case 'update':
|
|
841
857
|
return await cmds.cmdUpdate(parsed, io);
|
|
842
858
|
case 'update-check':
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type SearchKind = 'page' | 'setting' | 'action';
|
|
2
|
+
export type PanelPage = 'accounts' | 'sessions' | 'tuning' | 'handoff';
|
|
3
|
+
/** Where the Panel takes the user. Internal: the CLI shows `panel`, never this. */
|
|
4
|
+
export type SearchTarget =
|
|
5
|
+
/** A page of its own (the tabs under the header). */
|
|
6
|
+
{
|
|
7
|
+
page: PanelPage;
|
|
8
|
+
}
|
|
9
|
+
/** A row of the Settings dialog: its section, and the `fm('<find>', …)` mark on the row. */
|
|
10
|
+
| {
|
|
11
|
+
settings: string;
|
|
12
|
+
find: string;
|
|
13
|
+
}
|
|
14
|
+
/** A row of the Accounts page's Display popover, marked the same way. */
|
|
15
|
+
| {
|
|
16
|
+
display: string;
|
|
17
|
+
}
|
|
18
|
+
/** One of the page's PALETTE_ACTIONS; `write` ones are disabled in a read-only Panel. */
|
|
19
|
+
| {
|
|
20
|
+
action: string;
|
|
21
|
+
write: boolean;
|
|
22
|
+
};
|
|
23
|
+
export interface Words {
|
|
24
|
+
en: string;
|
|
25
|
+
zh: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SearchEntry {
|
|
28
|
+
id: string;
|
|
29
|
+
kind: SearchKind;
|
|
30
|
+
title: Words;
|
|
31
|
+
/** Other words people use for it, in either language. */
|
|
32
|
+
synonyms: string[];
|
|
33
|
+
/** Where it lives, as the user reads it ("Settings → General → Language"). */
|
|
34
|
+
panel: Words;
|
|
35
|
+
target: SearchTarget;
|
|
36
|
+
cliCommand: string | null;
|
|
37
|
+
}
|
|
38
|
+
/** The catalog; a row of the Settings dialog or the Display popover names itself at the end of its place. */
|
|
39
|
+
export declare const SEARCH_CATALOG: readonly SearchEntry[];
|
|
40
|
+
/** Shown on an empty query after the recently used ones (spec §3.36). */
|
|
41
|
+
export declare const COMMON_ENTRIES: readonly string[];
|
|
42
|
+
export interface SearchHit {
|
|
43
|
+
entry: SearchEntry;
|
|
44
|
+
/** 0 exact, 1 prefix, 2 contains (title before synonym at each level). */
|
|
45
|
+
rank: number;
|
|
46
|
+
}
|
|
47
|
+
export declare function catalogNorm(s: string): string;
|
|
48
|
+
/** How well one text matches: 0 exact, 1 starts with it, 2 a word starts with it, 3 contains it, -1 not at all. */
|
|
49
|
+
export declare function catalogMatchLevel(text: string, q: string): number;
|
|
50
|
+
/**
|
|
51
|
+
* Entries matching `query`, best first: exact before prefix before contains, titles before synonyms, then the
|
|
52
|
+
* catalog's own order. Both languages are searched whatever the Panel shows. An empty query matches nothing.
|
|
53
|
+
*/
|
|
54
|
+
export declare function searchCatalog(query: string, catalog: readonly SearchEntry[]): SearchHit[];
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
// The Search Catalog (spec §3.36, ADR-0054): every page, setting and action of the Panel that the Command Palette
|
|
2
|
+
// finds, in English and Chinese, with where it lives and the command that does the same. The Panel embeds it and
|
|
3
|
+
// `sideby commands` searches it, so both find the same things. It names features only, never Accounts or Sessions.
|
|
4
|
+
const SET = { en: 'Settings', zh: '设置' };
|
|
5
|
+
const at = (...parts) => ({
|
|
6
|
+
en: parts.map((p) => p.en).join(' → '),
|
|
7
|
+
zh: parts.map((p) => p.zh).join(' → '),
|
|
8
|
+
});
|
|
9
|
+
const GENERAL = { en: 'General', zh: '通用' };
|
|
10
|
+
const MENUBAR = { en: 'Menu bar', zh: '状态栏' };
|
|
11
|
+
const ACCOUNTS = { en: 'Accounts', zh: '账号' };
|
|
12
|
+
const QUOTA = { en: 'Quota checks', zh: '额度查询' };
|
|
13
|
+
const AI = { en: 'Let AI help', zh: '让 AI 帮我' };
|
|
14
|
+
const DISPLAY = at({ en: 'Accounts', zh: '账号' }, { en: 'Display', zh: '显示' });
|
|
15
|
+
const HEADER = { en: 'Header', zh: '顶栏' };
|
|
16
|
+
const ENTRIES = [
|
|
17
|
+
{
|
|
18
|
+
id: 'page.accounts',
|
|
19
|
+
kind: 'page',
|
|
20
|
+
title: { en: 'Accounts', zh: '账号' },
|
|
21
|
+
synonyms: ['quota', 'usage', 'list', 'limit', '额度', '用量', '列表'],
|
|
22
|
+
panel: { en: 'Accounts page', zh: '账号页' },
|
|
23
|
+
target: { page: 'accounts' },
|
|
24
|
+
cliCommand: 'sideby list',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'page.sessions',
|
|
28
|
+
kind: 'page',
|
|
29
|
+
title: { en: 'Sessions', zh: '会话' },
|
|
30
|
+
synonyms: ['session history', 'live sessions', 'past sessions', 'history', '历史', '会话记录', '运行中'],
|
|
31
|
+
panel: { en: 'Sessions page', zh: '会话页' },
|
|
32
|
+
target: { page: 'sessions' },
|
|
33
|
+
cliCommand: 'sideby history',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'page.tuning',
|
|
37
|
+
kind: 'page',
|
|
38
|
+
title: { en: 'Context tuning', zh: '上下文调优' },
|
|
39
|
+
synonyms: [
|
|
40
|
+
'auto-compact',
|
|
41
|
+
'autocompact',
|
|
42
|
+
'compaction threshold',
|
|
43
|
+
'context window',
|
|
44
|
+
'tune',
|
|
45
|
+
'自动压缩',
|
|
46
|
+
'压缩阈值',
|
|
47
|
+
'上下文窗口',
|
|
48
|
+
],
|
|
49
|
+
panel: { en: 'Context tuning page', zh: '上下文调优页' },
|
|
50
|
+
target: { page: 'tuning' },
|
|
51
|
+
cliCommand: 'sideby tune',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'page.handoff',
|
|
55
|
+
kind: 'page',
|
|
56
|
+
title: { en: 'Auto Handoff', zh: '自动接力' },
|
|
57
|
+
synonyms: [
|
|
58
|
+
'handoff',
|
|
59
|
+
'switch account',
|
|
60
|
+
'out of quota',
|
|
61
|
+
'limit reached',
|
|
62
|
+
'接力',
|
|
63
|
+
'换号',
|
|
64
|
+
'额度用完',
|
|
65
|
+
'切换账号',
|
|
66
|
+
],
|
|
67
|
+
panel: { en: 'Auto Handoff page', zh: '自动接力页' },
|
|
68
|
+
target: { page: 'handoff' },
|
|
69
|
+
cliCommand: 'sideby handoff',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'setting.language',
|
|
73
|
+
kind: 'setting',
|
|
74
|
+
title: { en: 'Language', zh: '语言' },
|
|
75
|
+
synonyms: ['english', 'chinese', '中文', '英文', 'lang'],
|
|
76
|
+
panel: at(SET, GENERAL),
|
|
77
|
+
target: { settings: 'general', find: 'lang' },
|
|
78
|
+
cliCommand: 'sideby config set panel.language zh',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'setting.light-dark',
|
|
82
|
+
kind: 'setting',
|
|
83
|
+
title: { en: 'Light or dark', zh: '明暗' },
|
|
84
|
+
synonyms: ['dark mode', 'light mode', 'appearance', 'night', '深色', '浅色', '暗色模式', '外观'],
|
|
85
|
+
panel: at(SET, GENERAL),
|
|
86
|
+
target: { settings: 'general', find: 'theme' },
|
|
87
|
+
cliCommand: 'sideby config set panel.theme dark',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'setting.theme',
|
|
91
|
+
kind: 'setting',
|
|
92
|
+
title: { en: 'Theme', zh: '主题' },
|
|
93
|
+
synonyms: ['colors', 'colours', 'accent', 'look', '配色', '颜色', '皮肤'],
|
|
94
|
+
panel: at(SET, GENERAL),
|
|
95
|
+
target: { settings: 'general', find: 'themes' },
|
|
96
|
+
cliCommand: 'sideby theme',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'setting.autostart',
|
|
100
|
+
kind: 'setting',
|
|
101
|
+
title: { en: 'Start sideby at login', zh: '登录后启动 sideby' },
|
|
102
|
+
synonyms: ['autostart', 'launch at login', 'background', 'startup', '开机启动', '自启动', '后台'],
|
|
103
|
+
panel: at(SET, GENERAL),
|
|
104
|
+
target: { settings: 'general', find: 'autostart' },
|
|
105
|
+
cliCommand: 'sideby autostart on',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'setting.terminal',
|
|
109
|
+
kind: 'setting',
|
|
110
|
+
title: { en: 'Preferred terminal', zh: '首选终端' },
|
|
111
|
+
synonyms: ['terminal app', 'iterm', 'ghostty', 'warp', '终端'],
|
|
112
|
+
panel: at(SET, GENERAL),
|
|
113
|
+
target: { settings: 'general', find: 'terminal' },
|
|
114
|
+
cliCommand: 'sideby terminal',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'setting.menubar',
|
|
118
|
+
kind: 'setting',
|
|
119
|
+
title: { en: 'Show quota in the menu bar', zh: '在状态栏显示额度' },
|
|
120
|
+
synonyms: ['menu bar', 'menubar', 'tray', 'status bar', '菜单栏', '状态栏'],
|
|
121
|
+
panel: at(SET, MENUBAR),
|
|
122
|
+
target: { settings: 'menubar', find: 'menubar' },
|
|
123
|
+
cliCommand: 'sideby menubar on',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'setting.hotkey',
|
|
127
|
+
kind: 'setting',
|
|
128
|
+
title: { en: 'Menu bar shortcut', zh: '状态栏快捷键' },
|
|
129
|
+
synonyms: ['hotkey', 'keyboard shortcut', 'menu bar icon', '快捷键', '热键'],
|
|
130
|
+
panel: at(SET, MENUBAR),
|
|
131
|
+
target: { settings: 'menubar', find: 'hotkey' },
|
|
132
|
+
cliCommand: 'sideby menubar hotkey',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'setting.order',
|
|
136
|
+
kind: 'setting',
|
|
137
|
+
title: { en: 'Account order, pins and hidden', zh: '账号顺序、置顶与隐藏' },
|
|
138
|
+
synonyms: ['sort', 'pin', 'hide', 'arrange', 'reorder', '排序', '置顶', '隐藏'],
|
|
139
|
+
panel: at(SET, ACCOUNTS),
|
|
140
|
+
target: { settings: 'accounts', find: 'order' },
|
|
141
|
+
cliCommand: 'sideby order',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'setting.pick',
|
|
145
|
+
kind: 'setting',
|
|
146
|
+
title: { en: 'Start the account with the most quota left', zh: '自动启动剩余额度最多的账号' },
|
|
147
|
+
synonyms: ['pick command', 'alias', 'short command', 'next', '挑选命令', '短命令', '别名'],
|
|
148
|
+
panel: at(SET, ACCOUNTS),
|
|
149
|
+
target: { settings: 'accounts', find: 'pick' },
|
|
150
|
+
cliCommand: 'sideby alias add <short> --pick <family>',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'setting.remote-control',
|
|
154
|
+
kind: 'setting',
|
|
155
|
+
title: { en: 'Remote Control', zh: '远程控制' },
|
|
156
|
+
synonyms: ['phone', 'web', 'continue on phone', 'remote', '手机', '网页', '远控'],
|
|
157
|
+
panel: at(SET, ACCOUNTS),
|
|
158
|
+
target: { settings: 'accounts', find: 'rc' },
|
|
159
|
+
cliCommand: 'sideby remote-control',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: 'setting.quota-checks',
|
|
163
|
+
kind: 'setting',
|
|
164
|
+
title: { en: 'Quota checks', zh: '额度查询' },
|
|
165
|
+
synonyms: ['fetch quota', 'ask host', 'quota refresh', '查询额度', '刷新额度'],
|
|
166
|
+
panel: at(SET, QUOTA),
|
|
167
|
+
target: { settings: 'quota', find: 'checks' },
|
|
168
|
+
cliCommand: 'sideby quota check <family> on|off',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: 'setting.network',
|
|
172
|
+
kind: 'setting',
|
|
173
|
+
title: { en: 'Network check', zh: '网络检查' },
|
|
174
|
+
synonyms: ['network guard', 'proxy', 'vpn', 'country', 'region', '网络守卫', '代理', '地区', '国家'],
|
|
175
|
+
panel: at(SET, { en: 'Network check', zh: '网络检查' }),
|
|
176
|
+
target: { settings: 'network', find: 'net' },
|
|
177
|
+
cliCommand: 'sideby network',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 'setting.skill',
|
|
181
|
+
kind: 'setting',
|
|
182
|
+
title: { en: 'Ask your AI to do it', zh: '让 AI 帮你操作' },
|
|
183
|
+
synonyms: ['skill', 'agent skill', 'install skill', 'claude code', 'codex', '技能', '安装技能'],
|
|
184
|
+
panel: at(SET, AI),
|
|
185
|
+
target: { settings: 'ai', find: 'skill' },
|
|
186
|
+
cliCommand: 'sideby update --skill',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: 'setting.quota-as',
|
|
190
|
+
kind: 'setting',
|
|
191
|
+
title: { en: 'Show quota as used or left', zh: '额度显示:已用或剩余' },
|
|
192
|
+
synonyms: ['used', 'left', 'remaining', 'percent', '已用', '剩余', '百分比'],
|
|
193
|
+
panel: DISPLAY,
|
|
194
|
+
target: { display: 'quota' },
|
|
195
|
+
cliCommand: null,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: 'setting.view',
|
|
199
|
+
kind: 'setting',
|
|
200
|
+
title: { en: 'List or cards', zh: '列表或卡片' },
|
|
201
|
+
synonyms: ['view', 'layout', 'grid', '视图', '布局', '网格'],
|
|
202
|
+
panel: DISPLAY,
|
|
203
|
+
target: { display: 'view' },
|
|
204
|
+
cliCommand: null,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 'setting.hide-emails',
|
|
208
|
+
kind: 'setting',
|
|
209
|
+
title: { en: 'Hide emails', zh: '隐藏邮箱' },
|
|
210
|
+
synonyms: ['privacy', 'screenshot', 'email', '隐私', '截图', '邮箱'],
|
|
211
|
+
panel: DISPLAY,
|
|
212
|
+
target: { display: 'emails' },
|
|
213
|
+
cliCommand: null,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 'action.new-account',
|
|
217
|
+
kind: 'action',
|
|
218
|
+
title: { en: 'New account', zh: '新建账号' },
|
|
219
|
+
synonyms: ['add account', 'create account', 'api account', 'sign in', '添加账号', '加账号', '登录'],
|
|
220
|
+
panel: at(ACCOUNTS, { en: 'New account', zh: '新建账号' }),
|
|
221
|
+
target: { action: 'new-account', write: true },
|
|
222
|
+
cliCommand: 'sideby new <family> --next',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: 'action.remote-control-off',
|
|
226
|
+
kind: 'action',
|
|
227
|
+
title: { en: 'Turn Remote Control off', zh: '关闭远程控制' },
|
|
228
|
+
synonyms: ['disable remote control', '关掉远程控制'],
|
|
229
|
+
panel: at(SET, ACCOUNTS, { en: 'Remote Control', zh: '远程控制' }),
|
|
230
|
+
target: { action: 'remote-control', write: true },
|
|
231
|
+
cliCommand: 'sideby remote-control off',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: 'action.handoff-on',
|
|
235
|
+
kind: 'action',
|
|
236
|
+
title: { en: 'Turn on Auto Handoff', zh: '开启自动接力' },
|
|
237
|
+
synonyms: ['handoff setup', 'enable handoff', '设置接力', '打开接力'],
|
|
238
|
+
panel: { en: 'Auto Handoff page', zh: '自动接力页' },
|
|
239
|
+
target: { action: 'handoff-on', write: true },
|
|
240
|
+
cliCommand: 'sideby handoff enable',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: 'action.network-guard',
|
|
244
|
+
kind: 'action',
|
|
245
|
+
title: { en: 'Turn the network check on or off', zh: '开关网络检查' },
|
|
246
|
+
synonyms: ['network guard on', 'block country', '网络守卫开关'],
|
|
247
|
+
panel: at(SET, { en: 'Network check', zh: '网络检查' }),
|
|
248
|
+
target: { action: 'network', write: true },
|
|
249
|
+
cliCommand: 'sideby network on|off',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: 'action.themes',
|
|
253
|
+
kind: 'action',
|
|
254
|
+
title: { en: 'Choose a theme', zh: '选择主题' },
|
|
255
|
+
synonyms: ['import theme', 'theme preview', '导入主题', '换主题'],
|
|
256
|
+
panel: at(SET, GENERAL, { en: 'Theme', zh: '主题' }),
|
|
257
|
+
target: { action: 'themes', write: false },
|
|
258
|
+
cliCommand: 'sideby theme use <name>',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: 'action.update',
|
|
262
|
+
kind: 'action',
|
|
263
|
+
title: { en: 'Update sideby', zh: '更新 sideby' },
|
|
264
|
+
synonyms: ['upgrade', 'new version', 'auto update', '升级', '新版本', '自动更新'],
|
|
265
|
+
panel: at(HEADER, { en: 'Version', zh: '版本' }),
|
|
266
|
+
target: { action: 'update', write: true },
|
|
267
|
+
cliCommand: 'sideby update',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
id: 'action.ask-ai',
|
|
271
|
+
kind: 'action',
|
|
272
|
+
title: { en: 'Let AI do it', zh: '让 AI 帮我' },
|
|
273
|
+
synonyms: ['ask ai', 'assistant', 'help', '问 AI', '助手', '帮助'],
|
|
274
|
+
panel: at(HEADER, { en: 'Let AI do it', zh: '让 AI 帮我' }),
|
|
275
|
+
target: { action: 'ask', write: true },
|
|
276
|
+
cliCommand: 'sideby ask',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: 'action.health-check',
|
|
280
|
+
kind: 'action',
|
|
281
|
+
title: { en: 'Health check and fixes', zh: '健康检查与修复' },
|
|
282
|
+
synonyms: [
|
|
283
|
+
'doctor',
|
|
284
|
+
'fix',
|
|
285
|
+
'repair',
|
|
286
|
+
'broken',
|
|
287
|
+
'symlink',
|
|
288
|
+
'permissions',
|
|
289
|
+
'修复',
|
|
290
|
+
'诊断',
|
|
291
|
+
'权限',
|
|
292
|
+
'软链接',
|
|
293
|
+
],
|
|
294
|
+
panel: at(ACCOUNTS, { en: 'Health check', zh: '健康检查' }),
|
|
295
|
+
target: { action: 'health', write: false },
|
|
296
|
+
cliCommand: 'sideby doctor --fix',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: 'action.inbound',
|
|
300
|
+
kind: 'action',
|
|
301
|
+
title: { en: 'Receiving messages', zh: '接收消息' },
|
|
302
|
+
synonyms: ['send to session', 'inbound', 'cross-session', 'accept messages', '发消息', '跨会话'],
|
|
303
|
+
panel: at({ en: 'Sessions', zh: '会话' }, { en: 'Receiving messages', zh: '接收消息' }),
|
|
304
|
+
target: { action: 'inbound', write: false },
|
|
305
|
+
cliCommand: 'sideby messages inbound accept',
|
|
306
|
+
},
|
|
307
|
+
];
|
|
308
|
+
/** The catalog; a row of the Settings dialog or the Display popover names itself at the end of its place. */
|
|
309
|
+
export const SEARCH_CATALOG = ENTRIES.map((e) => 'settings' in e.target || 'display' in e.target ? { ...e, panel: at(e.panel, e.title) } : e);
|
|
310
|
+
/** Shown on an empty query after the recently used ones (spec §3.36). */
|
|
311
|
+
export const COMMON_ENTRIES = [
|
|
312
|
+
'action.new-account',
|
|
313
|
+
'setting.language',
|
|
314
|
+
'setting.light-dark',
|
|
315
|
+
'page.sessions',
|
|
316
|
+
];
|
|
317
|
+
export function catalogNorm(s) {
|
|
318
|
+
return s.toLowerCase().normalize('NFKC').replace(/\s+/g, ' ').trim();
|
|
319
|
+
}
|
|
320
|
+
/** How well one text matches: 0 exact, 1 starts with it, 2 a word starts with it, 3 contains it, -1 not at all. */
|
|
321
|
+
export function catalogMatchLevel(text, q) {
|
|
322
|
+
const s = catalogNorm(text);
|
|
323
|
+
if (s === q)
|
|
324
|
+
return 0;
|
|
325
|
+
if (s.startsWith(q))
|
|
326
|
+
return 1;
|
|
327
|
+
if (s.split(/[\s,→()/-]+/).some((w) => w && w.startsWith(q)))
|
|
328
|
+
return 2;
|
|
329
|
+
return s.includes(q) ? 3 : -1;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Entries matching `query`, best first: exact before prefix before contains, titles before synonyms, then the
|
|
333
|
+
* catalog's own order. Both languages are searched whatever the Panel shows. An empty query matches nothing.
|
|
334
|
+
*/
|
|
335
|
+
export function searchCatalog(query, catalog) {
|
|
336
|
+
const q = catalogNorm(query);
|
|
337
|
+
if (!q)
|
|
338
|
+
return [];
|
|
339
|
+
const hits = [];
|
|
340
|
+
catalog.forEach((entry, order) => {
|
|
341
|
+
let best = -1;
|
|
342
|
+
for (const title of [entry.title.en, entry.title.zh]) {
|
|
343
|
+
const l = catalogMatchLevel(title, q);
|
|
344
|
+
if (l >= 0 && (best < 0 || l * 2 < best))
|
|
345
|
+
best = l * 2;
|
|
346
|
+
}
|
|
347
|
+
for (const syn of entry.synonyms) {
|
|
348
|
+
const l = catalogMatchLevel(syn, q);
|
|
349
|
+
if (l >= 0 && (best < 0 || l * 2 + 1 < best))
|
|
350
|
+
best = l * 2 + 1;
|
|
351
|
+
}
|
|
352
|
+
if (best >= 0)
|
|
353
|
+
hits.push({ entry, rank: best, order });
|
|
354
|
+
});
|
|
355
|
+
hits.sort((a, b) => a.rank - b.rank || a.order - b.order);
|
|
356
|
+
return hits.map(({ entry, rank }) => ({ entry, rank }));
|
|
357
|
+
}
|
package/dist/src/panel/i18n.d.ts
CHANGED
|
@@ -455,6 +455,26 @@ declare const en: {
|
|
|
455
455
|
'ai.how': string;
|
|
456
456
|
'ai.ask.api': string;
|
|
457
457
|
'ai.ask.tool': string;
|
|
458
|
+
'ai.ask.find': string;
|
|
459
|
+
'pal.button': string;
|
|
460
|
+
'pal.title': string;
|
|
461
|
+
'pal.placeholder': string;
|
|
462
|
+
'pal.kind.page': string;
|
|
463
|
+
'pal.kind.setting': string;
|
|
464
|
+
'pal.kind.action': string;
|
|
465
|
+
'pal.recent': string;
|
|
466
|
+
'pal.common': string;
|
|
467
|
+
'pal.results': string;
|
|
468
|
+
'pal.more.one': string;
|
|
469
|
+
'pal.more.other': string;
|
|
470
|
+
'pal.history': string;
|
|
471
|
+
'pal.historyHint': string;
|
|
472
|
+
'pal.none': string;
|
|
473
|
+
'pal.askAi': string;
|
|
474
|
+
'pal.askText': string;
|
|
475
|
+
'pal.readOnly': string;
|
|
476
|
+
'pal.also': string;
|
|
477
|
+
'pal.keys': string;
|
|
458
478
|
'ask.button': string;
|
|
459
479
|
'ask.title': string;
|
|
460
480
|
'ask.title.fix': string;
|
|
@@ -1294,8 +1314,10 @@ declare const en: {
|
|
|
1294
1314
|
'net.noTargets': string;
|
|
1295
1315
|
'net.skipped': string;
|
|
1296
1316
|
'net.notCovered': string;
|
|
1297
|
-
'net.save': string;
|
|
1298
1317
|
'net.savedOn': string;
|
|
1318
|
+
'net.savedAllow': string;
|
|
1319
|
+
'net.none': string;
|
|
1320
|
+
'net.undone': string;
|
|
1299
1321
|
'net.savedOff': string;
|
|
1300
1322
|
'net.checkFailed': string;
|
|
1301
1323
|
'net.bannerTitle': string;
|
package/dist/src/panel/i18n.js
CHANGED
|
@@ -457,6 +457,26 @@ const en = {
|
|
|
457
457
|
'ai.how': 'How',
|
|
458
458
|
'ai.ask.api': 'Add a DeepSeek API account for me.',
|
|
459
459
|
'ai.ask.tool': 'Help sideby support a new tool.',
|
|
460
|
+
'ai.ask.find': 'Where do I change the language of the Panel?',
|
|
461
|
+
'pal.button': 'Search',
|
|
462
|
+
'pal.title': 'Search sideby',
|
|
463
|
+
'pal.placeholder': 'Find a page, setting or action…',
|
|
464
|
+
'pal.kind.page': 'Page',
|
|
465
|
+
'pal.kind.setting': 'Setting',
|
|
466
|
+
'pal.kind.action': 'Action',
|
|
467
|
+
'pal.recent': 'Recently used',
|
|
468
|
+
'pal.common': 'Common',
|
|
469
|
+
'pal.results': 'Features',
|
|
470
|
+
'pal.more.one': 'Show {n} more',
|
|
471
|
+
'pal.more.other': 'Show {n} more',
|
|
472
|
+
'pal.history': 'Search session history for “{q}”',
|
|
473
|
+
'pal.historyHint': 'Sessions page',
|
|
474
|
+
'pal.none': 'No matching feature.',
|
|
475
|
+
'pal.askAi': 'Ask your AI where “{q}” is',
|
|
476
|
+
'pal.askText': 'Where do I find “{q}” in sideby?',
|
|
477
|
+
'pal.readOnly': 'Not in a read-only Panel',
|
|
478
|
+
'pal.also': 'matches “{w}”',
|
|
479
|
+
'pal.keys': '↑ ↓ to move · Enter to open · Esc to close',
|
|
460
480
|
'ask.button': 'Let AI do it',
|
|
461
481
|
'ask.title': 'Let AI do it',
|
|
462
482
|
'ask.title.fix': 'Let AI fix it',
|
|
@@ -1296,8 +1316,10 @@ const en = {
|
|
|
1296
1316
|
'net.noTargets': 'No Claude or Codex account is checked here.',
|
|
1297
1317
|
'net.skipped': '{refs}: API accounts are checked when they start (a third-party endpoint is not checked).',
|
|
1298
1318
|
'net.notCovered': 'Only sessions sideby starts are checked; running claude or codex directly is not. sideby asks the vendor’s own /cdn-cgi/trace with your proxy settings and no credential, and keeps only the country.',
|
|
1299
|
-
'net.save': 'Save',
|
|
1300
1319
|
'net.savedOn': 'Network check is on.',
|
|
1320
|
+
'net.savedAllow': 'Allowed: {list}.',
|
|
1321
|
+
'net.none': 'no country yet',
|
|
1322
|
+
'net.undone': 'Changed back.',
|
|
1301
1323
|
'net.savedOff': 'Network check is off.',
|
|
1302
1324
|
'net.checkFailed': 'Could not check: {msg}',
|
|
1303
1325
|
'net.bannerTitle': 'Wrong network.',
|
|
@@ -1901,6 +1923,26 @@ const zh = {
|
|
|
1901
1923
|
'ai.how': '怎么做',
|
|
1902
1924
|
'ai.ask.api': '帮我加一个 DeepSeek API 账号。',
|
|
1903
1925
|
'ai.ask.tool': '帮 sideby 支持一个新工具。',
|
|
1926
|
+
'ai.ask.find': '面板的语言在哪里改?',
|
|
1927
|
+
'pal.button': '搜索',
|
|
1928
|
+
'pal.title': '搜索 sideby',
|
|
1929
|
+
'pal.placeholder': '查找页面、设置或操作…',
|
|
1930
|
+
'pal.kind.page': '页面',
|
|
1931
|
+
'pal.kind.setting': '设置',
|
|
1932
|
+
'pal.kind.action': '操作',
|
|
1933
|
+
'pal.recent': '最近用过',
|
|
1934
|
+
'pal.common': '常用',
|
|
1935
|
+
'pal.results': '功能',
|
|
1936
|
+
'pal.more.one': '再显示 {n} 项',
|
|
1937
|
+
'pal.more.other': '再显示 {n} 项',
|
|
1938
|
+
'pal.history': '在会话历史里搜索“{q}”',
|
|
1939
|
+
'pal.historyHint': '会话页',
|
|
1940
|
+
'pal.none': '没有匹配的功能。',
|
|
1941
|
+
'pal.askAi': '问 AI “{q}”在哪里',
|
|
1942
|
+
'pal.askText': '在 sideby 里,“{q}”在哪里?',
|
|
1943
|
+
'pal.readOnly': '只读面板里不能用',
|
|
1944
|
+
'pal.also': '匹配“{w}”',
|
|
1945
|
+
'pal.keys': '↑ ↓ 选择 · Enter 打开 · Esc 关闭',
|
|
1904
1946
|
'ask.button': '让 AI 帮我',
|
|
1905
1947
|
'ask.title': '让 AI 帮我',
|
|
1906
1948
|
'ask.title.fix': '让 AI 修复',
|
|
@@ -2740,8 +2782,10 @@ const zh = {
|
|
|
2740
2782
|
'net.noTargets': '这里没有要检查的 Claude 或 Codex 账号。',
|
|
2741
2783
|
'net.skipped': '{refs}:API 账号在启动时检查(第三方接口不检查)。',
|
|
2742
2784
|
'net.notCovered': '只检查 sideby 启动的会话,直接运行 claude 或 codex 不检查。sideby 带着你的代理设置访问服务商自己的 /cdn-cgi/trace,不带任何凭证,只保留国家或地区。',
|
|
2743
|
-
'net.save': '保存',
|
|
2744
2785
|
'net.savedOn': '网络检查已打开。',
|
|
2786
|
+
'net.savedAllow': '允许的地区:{list}。',
|
|
2787
|
+
'net.none': '还没有选',
|
|
2788
|
+
'net.undone': '已改回。',
|
|
2745
2789
|
'net.savedOff': '网络检查已关闭。',
|
|
2746
2790
|
'net.checkFailed': '没能检查:{msg}',
|
|
2747
2791
|
'net.bannerTitle': '网络不对。',
|