sideby 0.22.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/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 +326 -21
- package/dist/src/cli/json-schemas.js +76 -1
- package/dist/src/cli/main.js +32 -4
- package/dist/src/core/ask.js +6 -1
- package/dist/src/core/config.d.ts +5 -1
- package/dist/src/core/config.js +18 -3
- package/dist/src/core/quota-levels.d.ts +7 -2
- package/dist/src/core/quota-levels.js +13 -3
- package/dist/src/core/themes.d.ts +107 -0
- package/dist/src/core/themes.js +463 -0
- package/dist/src/menubar/snapshot.d.ts +10 -0
- package/dist/src/menubar/snapshot.js +14 -6
- package/dist/src/menubar/strings.d.ts +6 -0
- package/dist/src/menubar/strings.js +6 -0
- package/dist/src/panel/handler.d.ts +2 -0
- package/dist/src/panel/handler.js +125 -1
- package/dist/src/panel/i18n.d.ts +49 -0
- package/dist/src/panel/i18n.js +104 -6
- package/dist/src/panel/page-logic.d.ts +20 -1
- package/dist/src/panel/page-logic.js +41 -0
- package/dist/src/panel/page-script.js +264 -35
- package/dist/src/panel/page-styles.d.ts +2 -0
- package/dist/src/panel/page-styles.js +57 -31
- 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/runtime.d.ts +4 -0
- package/package.json +1 -1
- package/schemas/config.json +29 -1
- package/schemas/families.json +5 -0
- package/schemas/hide.json +157 -0
- package/schemas/list.json +10 -0
- 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 +3 -1
- package/skills/sideby/references/ai-tasks.md +1 -1
- package/skills/sideby/references/panel.md +9 -0
- package/skills/sideby/references/quota.md +1 -1
- package/skills/sideby/references/themes.md +47 -0
|
@@ -26,6 +26,7 @@ import { openRunBoard, withRuns } from '../core/run-link.js';
|
|
|
26
26
|
import { SECRET_VAR_NAME, secretVarFor, setSecret } from '../core/secret-file.js';
|
|
27
27
|
import { SKILL_INSTALL } from '../core/skill-check.js';
|
|
28
28
|
import { launchArgs, TERMINALS } from '../core/terminal.js';
|
|
29
|
+
import { checkThemeData, listThemes, NO_THEME, previewColors, removeThemeFile, resolveColors, saveThemeFile, undoTheme, useTheme, } from '../core/themes.js';
|
|
29
30
|
import { MIN_CALLS } from '../core/tuning.js';
|
|
30
31
|
import * as update from '../core/update.js';
|
|
31
32
|
import { buildId, localBuild, packageVersion } from '../core/version.js';
|
|
@@ -36,7 +37,9 @@ import { MENUBAR_SCRIPT } from '../menubar/script.js';
|
|
|
36
37
|
import { orcaTabs, switchOrcaTab, systemOrca } from './orca.js';
|
|
37
38
|
import { renderPage } from './page.js';
|
|
38
39
|
import { AI_TASK_KINDS } from './page-logic.js';
|
|
40
|
+
import { tokenStyles } from './page-styles.js';
|
|
39
41
|
import { resolveTheme } from './theme.js';
|
|
42
|
+
import { BUILTIN_THEMES, DEFAULT_THEME_ID } from './themes.js';
|
|
40
43
|
export const PANEL_VERSION = packageVersion();
|
|
41
44
|
export const MAX_BODY_BYTES = 64 * 1024;
|
|
42
45
|
/** Write requests allowed to wait behind the running one; more get 409. */
|
|
@@ -90,6 +93,7 @@ function keyFacts(def) {
|
|
|
90
93
|
...(def.secretFileMeansApi === false ? { keyAlways: true } : {}),
|
|
91
94
|
...(def.probe ? { tryCommand: [def.bin, ...def.probe.args] } : {}),
|
|
92
95
|
...(def.aiTaskArgs ? { aiTaskSafe: true } : {}),
|
|
96
|
+
...(def.fetchQuota ? { quotaRefresh: true } : {}),
|
|
93
97
|
};
|
|
94
98
|
}
|
|
95
99
|
let autostartOverride = {};
|
|
@@ -640,6 +644,8 @@ function displayBody(body) {
|
|
|
640
644
|
for (const [k, v] of Object.entries(d)) {
|
|
641
645
|
if (k === 'families')
|
|
642
646
|
out.families = names(v, '"families"');
|
|
647
|
+
else if (k === 'hiddenFamilies')
|
|
648
|
+
out.hiddenFamilies = names(v, '"hiddenFamilies"');
|
|
643
649
|
else if (k === 'accounts') {
|
|
644
650
|
if (!v || typeof v !== 'object' || Array.isArray(v))
|
|
645
651
|
throw new HttpError(400, '"accounts" must be an object');
|
|
@@ -650,6 +656,11 @@ function displayBody(body) {
|
|
|
650
656
|
throw new HttpError(400, '"pinned" must be an object');
|
|
651
657
|
out.pinned = Object.fromEntries(Object.entries(v).map(([f, list]) => [f, names(list, `"pinned.${f}"`)]));
|
|
652
658
|
}
|
|
659
|
+
else if (k === 'hidden') {
|
|
660
|
+
if (!v || typeof v !== 'object' || Array.isArray(v))
|
|
661
|
+
throw new HttpError(400, '"hidden" must be an object');
|
|
662
|
+
out.hidden = Object.fromEntries(Object.entries(v).map(([f, list]) => [f, names(list, `"hidden.${f}"`)]));
|
|
663
|
+
}
|
|
653
664
|
else
|
|
654
665
|
throw new HttpError(400, `unknown key "${k}"`);
|
|
655
666
|
}
|
|
@@ -815,6 +826,67 @@ function writeQueue() {
|
|
|
815
826
|
});
|
|
816
827
|
};
|
|
817
828
|
}
|
|
829
|
+
/** What the Theme dialog shows (spec §3.34); the config is read again, so a switch from the CLI shows at once. */
|
|
830
|
+
async function themesView(rt, portal) {
|
|
831
|
+
const chosen = (await loadConfig(rt.paths.configFile).catch(() => rt.config)).panel?.colorTheme ?? NO_THEME;
|
|
832
|
+
const colors = await resolveColors(rt.paths, chosen);
|
|
833
|
+
const portalColors = portal.light.length + portal.dark.length > 0;
|
|
834
|
+
// Inside a Portal, no Theme chosen means the Portal's colors: a card of their own, in use.
|
|
835
|
+
const pageCard = portalColors
|
|
836
|
+
? [
|
|
837
|
+
{
|
|
838
|
+
id: NO_THEME,
|
|
839
|
+
name: "This page's colors",
|
|
840
|
+
source: 'portal',
|
|
841
|
+
swatches: portalSwatches(portal),
|
|
842
|
+
problems: [],
|
|
843
|
+
warnings: [],
|
|
844
|
+
},
|
|
845
|
+
]
|
|
846
|
+
: [];
|
|
847
|
+
const listed = (await listThemes(rt.paths)).map((t) => ({
|
|
848
|
+
id: t.id,
|
|
849
|
+
name: t.name,
|
|
850
|
+
...(t.source === 'builtin' ? { nameZh: BUILTIN_THEMES.find((b) => b.id === t.id)?.name.zh } : {}),
|
|
851
|
+
source: t.source,
|
|
852
|
+
swatches: t.swatches,
|
|
853
|
+
problems: t.problems,
|
|
854
|
+
warnings: t.warnings,
|
|
855
|
+
}));
|
|
856
|
+
const page = chosen === NO_THEME && portalColors;
|
|
857
|
+
return {
|
|
858
|
+
active: page ? NO_THEME : colors.id,
|
|
859
|
+
chosen,
|
|
860
|
+
adjusted: colors.adjusted,
|
|
861
|
+
...(colors.fallback ? { fallback: colors.fallback } : {}),
|
|
862
|
+
portalColors,
|
|
863
|
+
// The token CSS the page swaps in.
|
|
864
|
+
css: tokenStyles(page ? portal : layerTheme(colors, portal)),
|
|
865
|
+
themes: [...pageCard, ...listed],
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
/** A Portal's own page, card, accent tint, main button and dark page, over the Default Theme's where it leaves one out. */
|
|
869
|
+
function portalSwatches(portal) {
|
|
870
|
+
const value = (decls, name) => decls
|
|
871
|
+
.findLast((d) => d.startsWith(`--${name}:`))
|
|
872
|
+
?.slice(name.length + 3)
|
|
873
|
+
.trim();
|
|
874
|
+
const sky = BUILTIN_THEMES.find((b) => b.id === DEFAULT_THEME_ID)?.swatches ?? [];
|
|
875
|
+
return [
|
|
876
|
+
value(portal.light, 'bg') ?? sky[0],
|
|
877
|
+
value(portal.light, 'accent-soft') ?? sky[1],
|
|
878
|
+
value(portal.light, 'primary') ?? sky[2],
|
|
879
|
+
value(portal.dark, 'bg') ?? sky[3],
|
|
880
|
+
].filter((c) => typeof c === 'string');
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* A Theme the user picked over the Portal's tokens (ADR-0050): its colors win over the Portal's, and what the Theme
|
|
884
|
+
* does not name (font, sizes, header) stays the Portal's.
|
|
885
|
+
*/
|
|
886
|
+
function layerTheme(colors, portal) {
|
|
887
|
+
const own = resolveTheme({ light: colors.light, dark: colors.dark });
|
|
888
|
+
return { ...portal, light: [...portal.light, ...own.light], dark: [...portal.dark, ...own.dark] };
|
|
889
|
+
}
|
|
818
890
|
export function createPanelHandler(opts) {
|
|
819
891
|
const basePath = normalizeBase(opts.basePath);
|
|
820
892
|
const allowed = new Set(opts.allowedHosts.map((h) => h.toLowerCase()));
|
|
@@ -1012,6 +1084,41 @@ export function createPanelHandler(opts) {
|
|
|
1012
1084
|
return tryAccount(await getRuntime(), account);
|
|
1013
1085
|
},
|
|
1014
1086
|
},
|
|
1087
|
+
// Themes (spec §3.34): `use` a Theme, `undo` the last switch, `accent` saves and uses the Theme File custom.json
|
|
1088
|
+
// (the current Built-in Theme with that accent), `remove` deletes a Theme File. Answers what GET /api/themes does.
|
|
1089
|
+
'/api/theme': {
|
|
1090
|
+
async run(body) {
|
|
1091
|
+
const rt = await getRuntime();
|
|
1092
|
+
try {
|
|
1093
|
+
if (typeof body.use === 'string')
|
|
1094
|
+
await useTheme(rt.paths, body.use);
|
|
1095
|
+
else if (body.undo === true)
|
|
1096
|
+
await undoTheme(rt.paths);
|
|
1097
|
+
else if (typeof body.accent === 'string') {
|
|
1098
|
+
const current = (await loadConfig(rt.paths.configFile)).panel?.colorTheme;
|
|
1099
|
+
const base = BUILTIN_THEMES.some((t) => t.id === current) ? current : undefined;
|
|
1100
|
+
const checked = checkThemeData({
|
|
1101
|
+
schemaVersion: 1,
|
|
1102
|
+
name: 'Custom',
|
|
1103
|
+
...(base ? { base } : {}),
|
|
1104
|
+
accent: body.accent,
|
|
1105
|
+
});
|
|
1106
|
+
if (!checked.theme)
|
|
1107
|
+
throw new Error(checked.problems[0]);
|
|
1108
|
+
await saveThemeFile(rt.paths, 'custom', checked.theme);
|
|
1109
|
+
await useTheme(rt.paths, 'custom');
|
|
1110
|
+
}
|
|
1111
|
+
else if (typeof body.remove === 'string')
|
|
1112
|
+
await removeThemeFile(rt.paths, body.remove);
|
|
1113
|
+
else
|
|
1114
|
+
throw new Error('send "use", "undo", "accent" or "remove"');
|
|
1115
|
+
}
|
|
1116
|
+
catch (err) {
|
|
1117
|
+
throw new HttpError(400, err.message);
|
|
1118
|
+
}
|
|
1119
|
+
return themesView(await getRuntime(), theme);
|
|
1120
|
+
},
|
|
1121
|
+
},
|
|
1015
1122
|
// Preferred Terminal and Custom terminal command (spec §3.28): `id` null or left out goes back to the guess;
|
|
1016
1123
|
// `custom` an empty string removes the template.
|
|
1017
1124
|
'/api/terminal': {
|
|
@@ -1962,6 +2069,18 @@ export function createPanelHandler(opts) {
|
|
|
1962
2069
|
const panel = method === 'HEAD'
|
|
1963
2070
|
? undefined
|
|
1964
2071
|
: await getRuntime().then((rt) => rt.config.panel, () => undefined);
|
|
2072
|
+
// The user's Theme under the Portal's colors (spec §3.34): `?theme=preview` shows the Theme `sideby theme
|
|
2073
|
+
// preview` set, for this load only. A Theme that cannot be read leaves the default and Settings says why.
|
|
2074
|
+
const preview = new URL(req.url ?? '/', 'http://x').searchParams.get('theme') === 'preview';
|
|
2075
|
+
const colors = method === 'HEAD'
|
|
2076
|
+
? undefined
|
|
2077
|
+
: await getRuntime().then(async (rt) => (preview ? await previewColors(rt.paths) : undefined) ??
|
|
2078
|
+
(rt.config.panel?.colorTheme && rt.config.panel.colorTheme !== NO_THEME
|
|
2079
|
+
? await resolveColors(rt.paths, rt.config.panel.colorTheme)
|
|
2080
|
+
: undefined), () => undefined);
|
|
2081
|
+
// No Theme chosen: the page's own tokens (the Default Theme) under the Portal's. A chosen Theme, even the
|
|
2082
|
+
// Default one, wins over the Portal's colors.
|
|
2083
|
+
const pageTheme = colors ? layerTheme(colors, theme) : theme;
|
|
1965
2084
|
res.writeHead(200, {
|
|
1966
2085
|
'content-type': 'text/html; charset=utf-8',
|
|
1967
2086
|
'cache-control': 'no-store',
|
|
@@ -1988,7 +2107,7 @@ export function createPanelHandler(opts) {
|
|
|
1988
2107
|
build,
|
|
1989
2108
|
local,
|
|
1990
2109
|
readOnly,
|
|
1991
|
-
theme,
|
|
2110
|
+
theme: pageTheme,
|
|
1992
2111
|
lang,
|
|
1993
2112
|
updates,
|
|
1994
2113
|
...(ask ? { ask } : {}),
|
|
@@ -2018,6 +2137,11 @@ export function createPanelHandler(opts) {
|
|
|
2018
2137
|
send(res, 200, { token });
|
|
2019
2138
|
return true;
|
|
2020
2139
|
}
|
|
2140
|
+
// Themes (spec §3.34): every Theme with its swatches and problems, and the one in use.
|
|
2141
|
+
if (sub === '/api/themes') {
|
|
2142
|
+
send(res, 200, await themesView(await getRuntime(), theme));
|
|
2143
|
+
return true;
|
|
2144
|
+
}
|
|
2021
2145
|
if (sub === '/api/terminals') {
|
|
2022
2146
|
send(res, 200, await terminalsView(await getRuntime()));
|
|
2023
2147
|
return true;
|
package/dist/src/panel/i18n.d.ts
CHANGED
|
@@ -206,6 +206,23 @@ declare const en: {
|
|
|
206
206
|
'pin.full': string;
|
|
207
207
|
'pin.mark': string;
|
|
208
208
|
'pin.failed': string;
|
|
209
|
+
'hide.account': string;
|
|
210
|
+
'hide.family': string;
|
|
211
|
+
'hide.showAccount': string;
|
|
212
|
+
'hide.showFamily': string;
|
|
213
|
+
'hide.hideName': string;
|
|
214
|
+
'hide.showName': string;
|
|
215
|
+
'hide.mark': string;
|
|
216
|
+
'hide.inFamily': string;
|
|
217
|
+
'hide.done': string;
|
|
218
|
+
'hide.count.one': string;
|
|
219
|
+
'hide.count.other': string;
|
|
220
|
+
'hide.show': string;
|
|
221
|
+
'hide.collapse': string;
|
|
222
|
+
'hide.needs': string;
|
|
223
|
+
'hide.allTitle': string;
|
|
224
|
+
'hide.allBody': string;
|
|
225
|
+
'hide.failed': string;
|
|
209
226
|
'quota.fetchFailed': string;
|
|
210
227
|
'quota.checkOff': string;
|
|
211
228
|
'quota.checkOffHint': string;
|
|
@@ -280,6 +297,8 @@ declare const en: {
|
|
|
280
297
|
'quota.resetNoData': string;
|
|
281
298
|
'quota.dataFrom': string;
|
|
282
299
|
'quota.asOf': string;
|
|
300
|
+
'quota.staleSession': string;
|
|
301
|
+
'quota.quiet': string;
|
|
283
302
|
'quota.sharedFrom': string;
|
|
284
303
|
'login.label': string;
|
|
285
304
|
'login.also': string;
|
|
@@ -425,6 +444,7 @@ declare const en: {
|
|
|
425
444
|
'ai.ask.pick': string;
|
|
426
445
|
'ai.ask.new': string;
|
|
427
446
|
'ai.ask.pin': string;
|
|
447
|
+
'ai.ask.hide': string;
|
|
428
448
|
'ai.ask.fix': string;
|
|
429
449
|
'ai.ask.handoff': string;
|
|
430
450
|
'ai.ask.handoffRules': string;
|
|
@@ -489,6 +509,7 @@ declare const en: {
|
|
|
489
509
|
'ask.task.handoff': string;
|
|
490
510
|
'ask.task.menubar': string;
|
|
491
511
|
'ask.task.hotkey': string;
|
|
512
|
+
'ask.task.theme': string;
|
|
492
513
|
'ask.task.terminal': string;
|
|
493
514
|
'ask.keyWarn': string;
|
|
494
515
|
'ask.keyRemoved': string;
|
|
@@ -603,6 +624,34 @@ declare const en: {
|
|
|
603
624
|
'key.explain': string;
|
|
604
625
|
'key.explainText': string;
|
|
605
626
|
'key.cannotTry': string;
|
|
627
|
+
'th.title': string;
|
|
628
|
+
'th.intro': string;
|
|
629
|
+
'th.loading': string;
|
|
630
|
+
'th.inUse': string;
|
|
631
|
+
'th.mine': string;
|
|
632
|
+
'th.switched': string;
|
|
633
|
+
'th.custom': string;
|
|
634
|
+
'th.undo': string;
|
|
635
|
+
'th.undone': string;
|
|
636
|
+
'th.page': string;
|
|
637
|
+
'th.adjusted': string;
|
|
638
|
+
'th.accent': string;
|
|
639
|
+
'th.accentUse': string;
|
|
640
|
+
'th.accentHint': string;
|
|
641
|
+
'th.ai': string;
|
|
642
|
+
'th.aiPh': string;
|
|
643
|
+
'th.aiGo': string;
|
|
644
|
+
'th.aiHint': string;
|
|
645
|
+
'th.files': string;
|
|
646
|
+
'th.remove': string;
|
|
647
|
+
'th.removeSure': string;
|
|
648
|
+
'th.removed': string;
|
|
649
|
+
'ask.title.theme': string;
|
|
650
|
+
'ask.ph.theme': string;
|
|
651
|
+
'ask.ex.theme.1': string;
|
|
652
|
+
'ask.ex.theme.2': string;
|
|
653
|
+
'ask.ex.theme.3': string;
|
|
654
|
+
'ai.ask.theme': string;
|
|
606
655
|
'term.title': string;
|
|
607
656
|
'term.intro': string;
|
|
608
657
|
'term.pick': string;
|
package/dist/src/panel/i18n.js
CHANGED
|
@@ -187,11 +187,11 @@ const en = {
|
|
|
187
187
|
'order.position': '{name}: place {n} of {total}',
|
|
188
188
|
'order.failed': 'Could not save the order: {msg}. It is back as it was.',
|
|
189
189
|
'sort.arrange': 'Arrange order…',
|
|
190
|
-
'set.order': 'Account order and
|
|
190
|
+
'set.order': 'Account order, pins and hidden',
|
|
191
191
|
'set.orderMine': 'Yours',
|
|
192
192
|
'set.orderDefault': 'Default',
|
|
193
193
|
'order.resetButton': 'Default order',
|
|
194
|
-
'order.resetHint': 'Forget the order you gave tools and accounts. Pinned
|
|
194
|
+
'order.resetHint': 'Forget the order you gave tools and accounts. Pinned and hidden ones stay as they are.',
|
|
195
195
|
'order.reset': 'Back to the default order. Pinned accounts stay pinned.',
|
|
196
196
|
'order.bar': 'Drag, or use ↑ ↓, to change the order. Each change is saved at once.',
|
|
197
197
|
'order.done': 'Done',
|
|
@@ -208,6 +208,23 @@ const en = {
|
|
|
208
208
|
'pin.full': 'At most {n} pinned per tool',
|
|
209
209
|
'pin.mark': 'Pinned',
|
|
210
210
|
'pin.failed': 'Could not save the pin: {msg}. It is back as it was.',
|
|
211
|
+
'hide.account': 'Hide this account',
|
|
212
|
+
'hide.family': 'Hide all of {title}',
|
|
213
|
+
'hide.showAccount': 'Show this account again',
|
|
214
|
+
'hide.showFamily': 'Show {title} again',
|
|
215
|
+
'hide.hideName': 'Hide {name}',
|
|
216
|
+
'hide.showName': 'Show {name} again',
|
|
217
|
+
'hide.mark': 'Hidden',
|
|
218
|
+
'hide.inFamily': 'All of {title} is hidden; use the eye on its group to show it again',
|
|
219
|
+
'hide.done': '{name} is hidden. It still starts and can still take over a task.',
|
|
220
|
+
'hide.count.one': '{n} hidden',
|
|
221
|
+
'hide.count.other': '{n} hidden',
|
|
222
|
+
'hide.show': 'Show',
|
|
223
|
+
'hide.collapse': 'Hide them again',
|
|
224
|
+
'hide.needs': 'A hidden account needs a look',
|
|
225
|
+
'hide.allTitle': 'Every AI tool is hidden',
|
|
226
|
+
'hide.allBody': 'They are still there and still start. Show them to see them here again.',
|
|
227
|
+
'hide.failed': 'Could not save what is hidden: {msg}. It is back as it was.',
|
|
211
228
|
'quota.fetchFailed': 'Could not get the quota',
|
|
212
229
|
'quota.checkOff': 'Quota check off',
|
|
213
230
|
'quota.checkOffHint': 'Turn it on in Settings to see this quota.',
|
|
@@ -282,6 +299,8 @@ const en = {
|
|
|
282
299
|
'quota.resetNoData': 'Window reset · no new data since {date}',
|
|
283
300
|
'quota.dataFrom': 'Data from {ago}',
|
|
284
301
|
'quota.asOf': 'As of {ago}',
|
|
302
|
+
'quota.staleSession': 'These numbers update when a session runs in this account',
|
|
303
|
+
'quota.quiet': 'Not used on this computer since · use on the web or other computers is not included',
|
|
285
304
|
'quota.sharedFrom': 'Same login as {name}; quota read from {name}, {ago}',
|
|
286
305
|
'login.label': 'Same login: {names}',
|
|
287
306
|
'login.also': 'Same login',
|
|
@@ -427,6 +446,7 @@ const en = {
|
|
|
427
446
|
'ai.ask.pick': 'Add cc: start whichever Claude account has the most quota left.',
|
|
428
447
|
'ai.ask.new': 'Add another Claude account with the short command cc009.',
|
|
429
448
|
'ai.ask.pin': 'Pin claude:work to the top.',
|
|
449
|
+
'ai.ask.hide': 'Hide pi and Antigravity CLI from the Panel; I do not use them.',
|
|
430
450
|
'ai.ask.fix': 'Check my accounts and fix what they should share.',
|
|
431
451
|
'ai.ask.handoff': 'Turn on Auto Handoff.',
|
|
432
452
|
'ai.ask.handoffRules': 'When does Auto Handoff switch accounts, and could it use my API accounts?',
|
|
@@ -491,6 +511,7 @@ const en = {
|
|
|
491
511
|
'ask.task.handoff': 'AI looks at your accounts and recommends when to hand over and in what order; it shows the change before saving it.',
|
|
492
512
|
'ask.task.menubar': 'AI checks whether the menu bar item runs and what hides its icon, and asks before it changes anything.',
|
|
493
513
|
'ask.task.hotkey': 'AI checks which combinations this Mac already uses and recommends a few that are easy with one hand; it sets the one you pick.',
|
|
514
|
+
'ask.task.theme': 'AI writes a Theme, lets you look at it in the Panel, and switches only after you agree.',
|
|
494
515
|
'ask.task.terminal': 'AI will write the command that opens AI tasks in your terminal, and ask you before saving it.',
|
|
495
516
|
'ask.keyWarn': 'That looks like a key. Keys never go to AI: enter them with "Enter key" in the account menu.',
|
|
496
517
|
'ask.keyRemoved': 'Key-shaped text was taken out before the AI sees it. Enter keys with "Enter key" in the account menu.',
|
|
@@ -605,6 +626,34 @@ const en = {
|
|
|
605
626
|
'key.explain': 'Let AI explain',
|
|
606
627
|
'key.explainText': '`sideby try {ref}` failed. This is what it printed:\n{output}',
|
|
607
628
|
'key.cannotTry': 'This tool cannot be tried here; start it with {cmd} and send one short message.',
|
|
629
|
+
'th.title': 'Theme',
|
|
630
|
+
'th.intro': 'The colors of this Panel. Warnings and errors stay easy to read in every Theme.',
|
|
631
|
+
'th.loading': 'Reading Themes…',
|
|
632
|
+
'th.inUse': 'In use',
|
|
633
|
+
'th.mine': 'Your Theme',
|
|
634
|
+
'th.switched': 'Switched to {name}.',
|
|
635
|
+
'th.custom': 'Your color',
|
|
636
|
+
'th.undo': 'Undo',
|
|
637
|
+
'th.undone': 'Back to {name}',
|
|
638
|
+
'th.page': "This page's colors",
|
|
639
|
+
'th.adjusted': 'So that all text stays readable, the Panel adjusted {n} colors of this Theme.',
|
|
640
|
+
'th.accent': 'Your own color',
|
|
641
|
+
'th.accentUse': 'Use this color',
|
|
642
|
+
'th.accentHint': 'Buttons, links and quota bars take this color; everything else stays. A very light color is deepened on buttons so their white text stays readable.',
|
|
643
|
+
'th.ai': 'Let AI pick my colors',
|
|
644
|
+
'th.aiPh': 'Describe the feel, e.g. quiet like Notion',
|
|
645
|
+
'th.aiGo': 'Ask AI',
|
|
646
|
+
'th.aiHint': 'Your AI writes a Theme, shows it to you, and switches only after you agree.',
|
|
647
|
+
'th.files': 'Your Themes',
|
|
648
|
+
'th.remove': 'Remove',
|
|
649
|
+
'th.removeSure': 'Remove for good?',
|
|
650
|
+
'th.removed': 'Removed {name}',
|
|
651
|
+
'ask.title.theme': 'Let AI pick your colors',
|
|
652
|
+
'ask.ph.theme': 'What feel do you want? A website or a color works too.',
|
|
653
|
+
'ask.ex.theme.1': 'Quiet and gray, like Notion',
|
|
654
|
+
'ask.ex.theme.2': 'Green, like my company site',
|
|
655
|
+
'ask.ex.theme.3': 'Warmer, easier on the eyes at night',
|
|
656
|
+
'ai.ask.theme': 'Give the sideby Panel a green Theme.',
|
|
608
657
|
'term.title': 'Preferred terminal',
|
|
609
658
|
'term.intro': 'sideby opens this terminal when AI does something for you, and to sign in.',
|
|
610
659
|
'term.pick': 'Terminal',
|
|
@@ -1212,7 +1261,7 @@ const en = {
|
|
|
1212
1261
|
'rc.failed': 'Could not turn it off: {msg}',
|
|
1213
1262
|
'set.button': 'Settings',
|
|
1214
1263
|
'set.lang': 'Language',
|
|
1215
|
-
'set.theme': '
|
|
1264
|
+
'set.theme': 'Light or dark',
|
|
1216
1265
|
'set.theme.system': 'System',
|
|
1217
1266
|
'set.theme.light': 'Light',
|
|
1218
1267
|
'set.theme.dark': 'Dark',
|
|
@@ -1533,11 +1582,11 @@ const zh = {
|
|
|
1533
1582
|
'order.position': '{name}:第 {n} 个,共 {total} 个',
|
|
1534
1583
|
'order.failed': '顺序没有保存:{msg}。已恢复原来的顺序。',
|
|
1535
1584
|
'sort.arrange': '调整顺序…',
|
|
1536
|
-
'set.order': '
|
|
1585
|
+
'set.order': '账号顺序、置顶与隐藏',
|
|
1537
1586
|
'set.orderMine': '已调整',
|
|
1538
1587
|
'set.orderDefault': '默认',
|
|
1539
1588
|
'order.resetButton': '恢复默认顺序',
|
|
1540
|
-
'order.resetHint': '
|
|
1589
|
+
'order.resetHint': '忘掉你排的工具和账号顺序,置顶和隐藏会保留',
|
|
1541
1590
|
'order.reset': '已恢复默认顺序,置顶保留',
|
|
1542
1591
|
'order.bar': '拖动或用 ↑ ↓ 调整顺序,改动立即保存',
|
|
1543
1592
|
'order.done': '完成',
|
|
@@ -1554,6 +1603,23 @@ const zh = {
|
|
|
1554
1603
|
'pin.full': '每组最多置顶 {n} 个',
|
|
1555
1604
|
'pin.mark': '已置顶',
|
|
1556
1605
|
'pin.failed': '置顶没有保存:{msg}。已恢复原样。',
|
|
1606
|
+
'hide.account': '隐藏这个账号',
|
|
1607
|
+
'hide.family': '隐藏整个 {title}',
|
|
1608
|
+
'hide.showAccount': '取消隐藏',
|
|
1609
|
+
'hide.showFamily': '取消隐藏 {title}',
|
|
1610
|
+
'hide.hideName': '隐藏 {name}',
|
|
1611
|
+
'hide.showName': '取消隐藏 {name}',
|
|
1612
|
+
'hide.mark': '已隐藏',
|
|
1613
|
+
'hide.inFamily': '整个 {title} 已隐藏,点分组标题上的眼睛取消隐藏',
|
|
1614
|
+
'hide.done': '已隐藏 {name}。它照常能启动,也照常能接班。',
|
|
1615
|
+
'hide.count.one': '已隐藏 {n} 个',
|
|
1616
|
+
'hide.count.other': '已隐藏 {n} 个',
|
|
1617
|
+
'hide.show': '显示',
|
|
1618
|
+
'hide.collapse': '收起',
|
|
1619
|
+
'hide.needs': '有隐藏的账号需要处理',
|
|
1620
|
+
'hide.allTitle': '所有 AI 工具都已隐藏',
|
|
1621
|
+
'hide.allBody': '它们都还在,照常能启动。点「显示」就能在这里看到。',
|
|
1622
|
+
'hide.failed': '隐藏没有保存:{msg}。已恢复原样。',
|
|
1557
1623
|
'quota.fetchFailed': '没拿到额度',
|
|
1558
1624
|
'quota.checkOff': '额度查询已关',
|
|
1559
1625
|
'quota.checkOffHint': '在「设置」里打开,就能看到这份额度。',
|
|
@@ -1628,6 +1694,8 @@ const zh = {
|
|
|
1628
1694
|
'quota.resetNoData': '已重置,{date}后无新数据',
|
|
1629
1695
|
'quota.dataFrom': '数据来自 {ago}',
|
|
1630
1696
|
'quota.asOf': '截至 {ago}',
|
|
1697
|
+
'quota.staleSession': '在这个账号开一次会话,这些数字就会更新',
|
|
1698
|
+
'quota.quiet': '之后这台电脑没用过这个账号 · 网页或其他电脑上的用量不在内',
|
|
1631
1699
|
'quota.sharedFrom': '与 {name} 同一登录;额度读自 {name},{ago}',
|
|
1632
1700
|
'login.label': '同一登录:{names}',
|
|
1633
1701
|
'login.also': '同一登录',
|
|
@@ -1773,6 +1841,7 @@ const zh = {
|
|
|
1773
1841
|
'ai.ask.pick': '加个 cc:每次自动启动剩余额度最多的 Claude 账号。',
|
|
1774
1842
|
'ai.ask.new': '再加一个 Claude 账号,短命令叫 cc009。',
|
|
1775
1843
|
'ai.ask.pin': '把 claude:work 置顶。',
|
|
1844
|
+
'ai.ask.hide': '我不用 pi 和 Antigravity CLI,在面板里把它们隐藏起来。',
|
|
1776
1845
|
'ai.ask.fix': '检查一下我的账号,把该共享的修好。',
|
|
1777
1846
|
'ai.ask.handoff': '帮我开启自动接力。',
|
|
1778
1847
|
'ai.ask.handoffRules': '自动接力什么时候换号?会不会用到我的 API 账号?',
|
|
@@ -1838,6 +1907,7 @@ const zh = {
|
|
|
1838
1907
|
'ask.task.menubar': 'AI 会查状态栏图标有没有在运行、被什么挡住了;改动任何东西前先问你。',
|
|
1839
1908
|
'ask.task.hotkey': 'AI 会查这台电脑上哪些组合已被占用,推荐几个单手顺手的;你选定后它替你设好。',
|
|
1840
1909
|
'ask.task.terminal': 'AI 会写一条命令,让 sideby 在你的终端里打开 AI 任务;保存前先问你。',
|
|
1910
|
+
'ask.task.theme': 'AI 会写一套主题,先让你在面板里看一眼,你同意后才换上。',
|
|
1841
1911
|
'ask.keyWarn': '这看起来像密钥。密钥不要发给 AI:请用账号菜单里的「填写密钥」。',
|
|
1842
1912
|
'ask.keyRemoved': '像密钥的内容已在交给 AI 前去掉。密钥请用账号菜单里的「填写密钥」。',
|
|
1843
1913
|
'ask.account': '账号',
|
|
@@ -1951,6 +2021,34 @@ const zh = {
|
|
|
1951
2021
|
'key.explain': '让 AI 解释',
|
|
1952
2022
|
'key.explainText': '`sideby try {ref}` 失败了,它的输出是:\n{output}',
|
|
1953
2023
|
'key.cannotTry': '这个工具不能在这里试;用 {cmd} 启动它,发一条很短的消息。',
|
|
2024
|
+
'th.title': '主题',
|
|
2025
|
+
'th.intro': '这个面板的颜色。每套主题里,提醒和报错都看得清。',
|
|
2026
|
+
'th.loading': '正在读取主题…',
|
|
2027
|
+
'th.inUse': '使用中',
|
|
2028
|
+
'th.mine': '你的主题',
|
|
2029
|
+
'th.switched': '已换成「{name}」。',
|
|
2030
|
+
'th.custom': '自选颜色',
|
|
2031
|
+
'th.undo': '撤销',
|
|
2032
|
+
'th.undone': '已换回「{name}」',
|
|
2033
|
+
'th.page': '这个页面的配色',
|
|
2034
|
+
'th.adjusted': '为了让文字都看得清,面板调整了这套主题里的 {n} 处颜色。',
|
|
2035
|
+
'th.accent': '自选主色',
|
|
2036
|
+
'th.accentUse': '用这个颜色',
|
|
2037
|
+
'th.accentHint': '按钮、链接和额度条换成这个颜色,其他不变。颜色很浅时,按钮会稍微加深,保证白字看得清。',
|
|
2038
|
+
'th.ai': '让 AI 帮我配色',
|
|
2039
|
+
'th.aiPh': '描述你想要的感觉,比如:像 Notion 一样素净',
|
|
2040
|
+
'th.aiGo': '交给 AI',
|
|
2041
|
+
'th.aiHint': 'AI 会写一套主题给你看,你同意后才换上。',
|
|
2042
|
+
'th.files': '你的主题',
|
|
2043
|
+
'th.remove': '删除',
|
|
2044
|
+
'th.removeSure': '确定删除?',
|
|
2045
|
+
'th.removed': '已删除「{name}」',
|
|
2046
|
+
'ask.title.theme': '让 AI 帮我配色',
|
|
2047
|
+
'ask.ph.theme': '想要什么感觉?给个网址或颜色也行。',
|
|
2048
|
+
'ask.ex.theme.1': '素净的灰色,像 Notion',
|
|
2049
|
+
'ask.ex.theme.2': '绿色,和我们公司官网一样',
|
|
2050
|
+
'ask.ex.theme.3': '暖一点,晚上看着不累',
|
|
2051
|
+
'ai.ask.theme': '把 sideby 面板换成一套绿色主题。',
|
|
1954
2052
|
'term.title': '首选终端',
|
|
1955
2053
|
'term.intro': 'AI 帮你做事、以及登录时,sideby 会打开这个终端。',
|
|
1956
2054
|
'term.pick': '终端',
|
|
@@ -2558,7 +2656,7 @@ const zh = {
|
|
|
2558
2656
|
'rc.failed': '没能关闭:{msg}',
|
|
2559
2657
|
'set.button': '设置',
|
|
2560
2658
|
'set.lang': '语言',
|
|
2561
|
-
'set.theme': '
|
|
2659
|
+
'set.theme': '明暗',
|
|
2562
2660
|
'set.theme.system': '跟随系统',
|
|
2563
2661
|
'set.theme.light': '浅色',
|
|
2564
2662
|
'set.theme.dark': '深色',
|
|
@@ -90,6 +90,11 @@ export declare function attentionReasons(a: LogicAccount, health: {
|
|
|
90
90
|
fail: number;
|
|
91
91
|
warn: number;
|
|
92
92
|
} | null, now: number, warn: number): string[];
|
|
93
|
+
/**
|
|
94
|
+
* How serious an Account's `quota-high` is: `fail` once its fullest live window reaches `fail` (the bar turns red),
|
|
95
|
+
* else `warn`, so a running-low label takes the same color as the bar it speaks about.
|
|
96
|
+
*/
|
|
97
|
+
export declare function quotaHighLevel(a: LogicAccount, now: number, fail: number): 'warn' | 'fail';
|
|
93
98
|
/**
|
|
94
99
|
* The one status badge an account row shows after its name (spec §3.27), most important first: `health-fail`
|
|
95
100
|
* (needs fixing), `quota-high` (running low), the other attention labels (`signed-out`, `not-installed`,
|
|
@@ -141,6 +146,18 @@ export declare function pinnedIn(a: {
|
|
|
141
146
|
name: string;
|
|
142
147
|
sameLogin?: readonly string[];
|
|
143
148
|
}, pinned: readonly string[]): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Whether an Account is Hidden (spec §3.25): its Family is in `hiddenFamilies`, or its name is in `hidden.<family>`,
|
|
151
|
+
* or, for a Same Login, the name of any of its directories, so the login is hidden as a whole.
|
|
152
|
+
*/
|
|
153
|
+
export declare function hiddenIn(a: {
|
|
154
|
+
family: string;
|
|
155
|
+
name: string;
|
|
156
|
+
sameLogin?: readonly string[];
|
|
157
|
+
}, display: {
|
|
158
|
+
hiddenFamilies?: readonly string[];
|
|
159
|
+
hidden?: Record<string, readonly string[]>;
|
|
160
|
+
}): boolean;
|
|
144
161
|
/**
|
|
145
162
|
* Pinned Accounts first (spec §3.25): the names in `pinned`, in that order, then the rest in the order they came.
|
|
146
163
|
* A Same Login follows any of its pinned directories, so it stays together. Names no longer there are simply not met.
|
|
@@ -511,7 +528,7 @@ export declare function stripSecrets(text: string): {
|
|
|
511
528
|
removed: boolean;
|
|
512
529
|
};
|
|
513
530
|
/** The kinds of AI Task (spec §3.28); anything else is refused. */
|
|
514
|
-
export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'handoff', 'menubar', 'hotkey'];
|
|
531
|
+
export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'theme', 'handoff', 'menubar', 'hotkey'];
|
|
515
532
|
export type AiTaskKind = (typeof AI_TASK_KINDS)[number];
|
|
516
533
|
/**
|
|
517
534
|
* The message keys of the AI dialog for `task` (spec §3.28 "每个入口的提示"): its title, the text box placeholder and
|
|
@@ -591,6 +608,8 @@ export declare function taskPrompt(input: {
|
|
|
591
608
|
version?: string;
|
|
592
609
|
/** The custom terminal command saved now (`terminal` task). */
|
|
593
610
|
terminalCustom?: string;
|
|
611
|
+
/** The Theme in use, for `theme`. */
|
|
612
|
+
theme?: string;
|
|
594
613
|
/** Names of the supported terminals installed on this computer (`terminal` task). */
|
|
595
614
|
terminals?: readonly string[];
|
|
596
615
|
/** Auto Handoff facts, one per line, as `handoffTaskFacts` gives them (`handoff` task). */
|
|
@@ -98,6 +98,25 @@ export function attentionReasons(a, health, now, warn) {
|
|
|
98
98
|
out.push('health-warn');
|
|
99
99
|
return out;
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* How serious an Account's `quota-high` is: `fail` once its fullest live window reaches `fail` (the bar turns red),
|
|
103
|
+
* else `warn`, so a running-low label takes the same color as the bar it speaks about.
|
|
104
|
+
*/
|
|
105
|
+
export function quotaHighLevel(a, now, fail) {
|
|
106
|
+
const q = a.quota;
|
|
107
|
+
if (!q || q.status !== 'ok' || !q.windows || q.from)
|
|
108
|
+
return 'warn';
|
|
109
|
+
for (const w of q.windows) {
|
|
110
|
+
if (w.name)
|
|
111
|
+
continue;
|
|
112
|
+
const reset = Date.parse(w.resetsAt);
|
|
113
|
+
if (Number.isFinite(reset) && reset <= now)
|
|
114
|
+
continue;
|
|
115
|
+
if ((Number(w.usedPercent) || 0) >= fail)
|
|
116
|
+
return 'fail';
|
|
117
|
+
}
|
|
118
|
+
return 'warn';
|
|
119
|
+
}
|
|
101
120
|
/**
|
|
102
121
|
* The one status badge an account row shows after its name (spec §3.27), most important first: `health-fail`
|
|
103
122
|
* (needs fixing), `quota-high` (running low), the other attention labels (`signed-out`, `not-installed`,
|
|
@@ -228,6 +247,16 @@ export function sortAccounts(list, mode, now, order) {
|
|
|
228
247
|
export function pinnedIn(a, pinned) {
|
|
229
248
|
return (pinned.includes(a.name) || (a.sameLogin ?? []).some((r) => pinned.includes(r.slice(r.indexOf(':') + 1))));
|
|
230
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Whether an Account is Hidden (spec §3.25): its Family is in `hiddenFamilies`, or its name is in `hidden.<family>`,
|
|
252
|
+
* or, for a Same Login, the name of any of its directories, so the login is hidden as a whole.
|
|
253
|
+
*/
|
|
254
|
+
export function hiddenIn(a, display) {
|
|
255
|
+
if (display.hiddenFamilies?.includes(a.family))
|
|
256
|
+
return true;
|
|
257
|
+
const names = display.hidden?.[a.family] ?? [];
|
|
258
|
+
return (names.includes(a.name) || (a.sameLogin ?? []).some((r) => names.includes(r.slice(r.indexOf(':') + 1))));
|
|
259
|
+
}
|
|
231
260
|
/**
|
|
232
261
|
* Pinned Accounts first (spec §3.25): the names in `pinned`, in that order, then the rest in the order they came.
|
|
233
262
|
* A Same Login follows any of its pinned directories, so it stays together. Names no longer there are simply not met.
|
|
@@ -916,6 +945,7 @@ export const AI_TASK_KINDS = [
|
|
|
916
945
|
'host',
|
|
917
946
|
'plugin',
|
|
918
947
|
'terminal',
|
|
948
|
+
'theme',
|
|
919
949
|
'handoff',
|
|
920
950
|
'menubar',
|
|
921
951
|
'hotkey',
|
|
@@ -1018,6 +1048,7 @@ export function taskPrompt(input, strip) {
|
|
|
1018
1048
|
host: '帮我给 sideby 加一个它还不支持的 AI 编程工具(宿主),先做成本机的 Family 插件。',
|
|
1019
1049
|
plugin: '帮我写一个 sideby 插件或 hook。',
|
|
1020
1050
|
terminal: '帮我让 sideby 能在我用的终端里打开 AI 任务:写一条自定义终端命令。',
|
|
1051
|
+
theme: '帮我给 sideby 面板配一套颜色(主题)。',
|
|
1021
1052
|
handoff: '帮我调好 sideby 的自动接力:根据我的账号推荐什么时候接力(阈值)和接力的顺序。',
|
|
1022
1053
|
menubar: 'sideby 的状态栏额度图标在 macOS 顶栏里看不到,请帮我找出原因并让它显示出来。',
|
|
1023
1054
|
hotkey: '帮我给 sideby 的状态栏菜单挑一个单手按着顺手、又没被别的程序占用的快捷键,并替我设好。',
|
|
@@ -1030,6 +1061,7 @@ export function taskPrompt(input, strip) {
|
|
|
1030
1061
|
cFindings: '体检发现:',
|
|
1031
1062
|
cQuota: '额度原因:',
|
|
1032
1063
|
cVersion: 'sideby 版本:',
|
|
1064
|
+
cTheme: '现在的主题:',
|
|
1033
1065
|
cCustom: '现在的自定义终端命令:',
|
|
1034
1066
|
cTerminals: '本机装了的、sideby 支持的终端:',
|
|
1035
1067
|
cNoTerminals: '本机没找到 sideby 支持的终端',
|
|
@@ -1042,6 +1074,7 @@ export function taskPrompt(input, strip) {
|
|
|
1042
1074
|
pAccount: '地址、模型名、环境变量以厂商的官方文档为准。账号建好后,让我用 `sideby key <账号>` 输入密钥,再用 `sideby try <账号>` 试一次。订阅账号要登录时,让我点面板上的「登录」,或者自己运行 `sideby login <账号>`。',
|
|
1043
1075
|
pHost: '用 `sideby plugins new <id>` 生成插件骨架;收集事实时写明宿主的版本和日期;用 `sideby plugins check <id>` 检查,并在演示 HOME 里试一遍。',
|
|
1044
1076
|
pPlugin: '照 sideby 仓库的插件指南 docs/guide/plugins.zh-CN.md 写;写完用 `sideby plugins check <id>` 检查。',
|
|
1077
|
+
pTheme: '先跑 `sideby theme --json` 看现有主题和正在用的那套,再问我想要的感觉;我给了截图、网址或品牌色,就从里面取色。写一个主题文件(JSON,只放颜色,不放代码):`{"schemaVersion":1,"name":"…","base":"sky" 或 "leaf","accent":"#rrggbb","light":{…},"dark":{…}}`;多数时候给 `base` 和 `accent` 就够了,`light` / `dark` 只写要改的 token(`sideby theme export sky` 能看到全部 token)。先放在当前目录,跑 `sideby theme check <文件>`,有不达标的就按建议值改到全部通过;再跑 `sideby theme preview <文件>` 让我在面板里看一眼。我满意后才 `sideby theme import <文件>` 和 `sideby theme use <名字>`;不满意就接着改。随时可以用 `sideby theme use --undo` 换回去。',
|
|
1045
1078
|
pTerminal: "先问我用的是什么终端。只看这个终端的官方文档和它的 `--help`,找出「在指定目录新开一个窗口运行一条命令」的写法,写明你看的版本。写成一个模板:`{cmd}` 是要运行的命令,`{cwd}` 是文件夹,sideby 按参数填入,不经过 shell。保存要用 `sideby terminal --custom '<模板>'`,它会改 sideby 的设置,先问我。保存后让我在面板上点一次「让 AI 帮我」试一下,打不开就一起看错误再改。",
|
|
1046
1079
|
share: '做好之后,问我愿不愿意把这次的改进分享给 sideby。我同意后,按 sideby 仓库的 CONTRIBUTING.md 提一个 pull request,提交前去掉我自己的账号名、路径和邮箱。',
|
|
1047
1080
|
shareTerminal: '跑通之后,问我愿不愿意把这个终端做成 sideby 的内置终端。我同意后,在 sideby 仓库 src/core/terminal.ts 的终端表里加一行并补上测试,按 CONTRIBUTING.md 提一个 pull request,提交前去掉我自己的账号名、路径和邮箱。',
|
|
@@ -1060,6 +1093,7 @@ export function taskPrompt(input, strip) {
|
|
|
1060
1093
|
'account to sideby (a subscription, or an API address).',
|
|
1061
1094
|
host: 'Help me add an AI coding tool (Host) that sideby does not support yet, first as a local Family Plugin.',
|
|
1062
1095
|
plugin: 'Help me write a sideby plugin or hook.',
|
|
1096
|
+
theme: 'Help me pick a set of colors (a Theme) for the sideby Panel.',
|
|
1063
1097
|
terminal: 'Help sideby open AI Tasks in the terminal I use: write a custom terminal command.',
|
|
1064
1098
|
handoff: "Help me tune sideby's Auto Handoff: from my accounts, recommend when to hand over (the threshold) and in what order.",
|
|
1065
1099
|
menubar: "I can't see sideby's quota icon in the macOS menu bar. Find out why and make it show.",
|
|
@@ -1073,6 +1107,7 @@ export function taskPrompt(input, strip) {
|
|
|
1073
1107
|
cFindings: 'Health check findings:',
|
|
1074
1108
|
cQuota: 'Quota reason: ',
|
|
1075
1109
|
cVersion: 'sideby version: ',
|
|
1110
|
+
cTheme: 'Theme now: ',
|
|
1076
1111
|
cCustom: 'Custom terminal command now: ',
|
|
1077
1112
|
cTerminals: 'Supported terminals installed here: ',
|
|
1078
1113
|
cNoTerminals: 'No supported terminal is installed here',
|
|
@@ -1085,6 +1120,7 @@ export function taskPrompt(input, strip) {
|
|
|
1085
1120
|
pAccount: "Take addresses, model names and variables from the vendor's official docs. When the account exists, have me enter the key with `sideby key <account>`, then try it with `sideby try <account>`. For a subscription sign-in, have me click Sign in in the Panel or run `sideby login <account>` myself.",
|
|
1086
1121
|
pHost: 'Start with `sideby plugins new <id>`; note the Host version and the date with every fact you gather; check it with `sideby plugins check <id>` and try it in a demo HOME.',
|
|
1087
1122
|
pPlugin: 'Follow the plugins guide in the sideby repository (docs/guide/plugins.md); check it with `sideby plugins check <id>`.',
|
|
1123
|
+
pTheme: 'Run `sideby theme --json` first to see the Themes and the one in use, then ask me what feel I want; if I give you a screenshot, a website or a brand color, take the colors from it. Write a Theme File (JSON, colors only, never code): `{"schemaVersion":1,"name":"…","base":"sky" or "leaf","accent":"#rrggbb","light":{…},"dark":{…}}`; usually `base` and `accent` are enough, and `light` / `dark` hold only the tokens to change (`sideby theme export sky` shows them all). Keep it in the current folder, run `sideby theme check <file>` and change what fails to the suggested values until every pair passes, then run `sideby theme preview <file>` so I can look at it in the Panel. Only when I like it, run `sideby theme import <file>` and `sideby theme use <name>`; otherwise keep changing it. `sideby theme use --undo` goes back at any time.',
|
|
1088
1124
|
pTerminal: "Ask me which terminal I use first. Read only that terminal's official docs and its `--help` to find how it opens a new window that runs one command in a given folder, and note the version you read. Write it as a template: `{cmd}` is the command and `{cwd}` the folder; sideby fills them in as separate arguments, no shell runs it. Save it with `sideby terminal --custom '<template>'`, which changes sideby's settings, so ask me first. Then have me click Let AI do it in the Panel once to try it; if it does not open, look at the error with me and fix the template.",
|
|
1089
1125
|
share: 'When it works, ask me whether to share the improvement with sideby. Only with my yes, follow the CONTRIBUTING.md of the sideby repository to open a pull request, and first remove my own account names, paths and emails.',
|
|
1090
1126
|
shareTerminal: 'When it works, ask me whether to make this terminal built into sideby. Only with my yes, add a row to the terminal table in src/core/terminal.ts of the sideby repository with tests, follow its CONTRIBUTING.md to open a pull request, and first remove my own account names, paths and emails.',
|
|
@@ -1124,6 +1160,11 @@ export function taskPrompt(input, strip) {
|
|
|
1124
1160
|
const terms = (c.terminals || []).map(clean).filter(Boolean);
|
|
1125
1161
|
facts.push('- ' + (terms.length ? L.cTerminals + terms.join(', ') : L.cNoTerminals));
|
|
1126
1162
|
}
|
|
1163
|
+
if (task === 'theme') {
|
|
1164
|
+
const now = clean(c.theme);
|
|
1165
|
+
if (now)
|
|
1166
|
+
facts.push('- ' + L.cTheme + now);
|
|
1167
|
+
}
|
|
1127
1168
|
if (task === 'handoff') {
|
|
1128
1169
|
const lines = (c.handoff || []).map(clean).filter(Boolean);
|
|
1129
1170
|
if (lines.length)
|