sideby 0.26.1 → 0.27.1
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 +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/ask.js +2 -1
- package/dist/src/core/egress.d.ts +5 -2
- package/dist/src/core/egress.js +7 -4
- package/dist/src/core/search-catalog.d.ts +54 -0
- package/dist/src/core/search-catalog.js +357 -0
- package/dist/src/core/skill-check.d.ts +5 -0
- package/dist/src/core/skill-check.js +7 -1
- package/dist/src/core/update.d.ts +2 -3
- package/dist/src/core/update.js +39 -40
- package/dist/src/core/version.d.ts +8 -0
- package/dist/src/core/version.js +34 -0
- package/dist/src/panel/i18n.d.ts +27 -0
- package/dist/src/panel/i18n.js +54 -0
- package/dist/src/panel/page-logic.d.ts +3 -1
- package/dist/src/panel/page-logic.js +12 -0
- package/dist/src/panel/page-script.js +282 -27
- 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/ai-tasks.md +1 -1
- package/skills/sideby/references/panel.md +10 -0
- package/skills/sideby/references/update.md +3 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Env } from '../types.ts';
|
|
2
2
|
import type { Paths } from './paths.ts';
|
|
3
3
|
export { isZombieStat } from './lock.ts';
|
|
4
|
+
export { compareVersions } from './version.ts';
|
|
4
5
|
export declare const DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
|
5
6
|
export declare const CHECK_INTERVAL_MS: number;
|
|
6
7
|
export declare const NOTICE_INTERVAL_MS: number;
|
|
@@ -114,8 +115,6 @@ export declare const runProgram: UpdateDeps['exec'];
|
|
|
114
115
|
export declare const updateMachine: () => UpdateDeps;
|
|
115
116
|
/** The lock every install shares (`update-install.lock`), so a Local Build switch never races an Update. */
|
|
116
117
|
export declare const takeInstallLock: (paths: Paths) => Promise<(() => Promise<void>) | null>;
|
|
117
|
-
/** -1, 0 or 1 like a sort comparator; a prerelease sorts before its release. Null when either is not a version. */
|
|
118
|
-
export declare function compareVersions(a: string, b: string): number | null;
|
|
119
118
|
/** `latest` is newer than `current`. */
|
|
120
119
|
export declare const isNewer: (latest: string | undefined, current: string) => latest is string;
|
|
121
120
|
/**
|
|
@@ -280,7 +279,7 @@ export declare function shownPlan(plan: UpdatePlan): {
|
|
|
280
279
|
export interface SkillUpdatePlan {
|
|
281
280
|
/** Versions of the installed skills (`null`: one without a version). */
|
|
282
281
|
installed: (string | null)[];
|
|
283
|
-
/** Some installed skill is for
|
|
282
|
+
/** Some installed skill is for an older version than the one sideby will run (a newer one is not outdated). */
|
|
284
283
|
outdated: boolean;
|
|
285
284
|
command: string;
|
|
286
285
|
/** False when sideby must not run it; `reason` says why and the user runs `command` where it belongs. */
|
package/dist/src/core/update.js
CHANGED
|
@@ -6,11 +6,13 @@ import { access, constants, mkdir, readdir, readFile, realpath, rm } from 'node:
|
|
|
6
6
|
import { dirname, join, sep } from 'node:path';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import { afterInstall, runSkillUpdate } from './after-install.js';
|
|
9
|
+
import { fetchTrace, proxyFor } from './egress.js';
|
|
9
10
|
import { writeFileAtomic } from './fs-safe.js';
|
|
10
11
|
import { processAlive, takeFileLock } from './lock.js';
|
|
11
|
-
import { installedSkills, REPO_URL, SKILL_UPDATE, SKILL_UPDATE_SHOWN, skillOwnerRepo } from './skill-check.js';
|
|
12
|
-
import { localBuild, packageVersion, parseLocalBuild } from './version.js';
|
|
12
|
+
import { installedSkills, REPO_URL, SKILL_UPDATE, SKILL_UPDATE_SHOWN, skillIsBehind, skillOwnerRepo, } from './skill-check.js';
|
|
13
|
+
import { compareVersions, localBuild, packageVersion, parseLocalBuild, parseVersion } from './version.js';
|
|
13
14
|
export { isZombieStat } from './lock.js';
|
|
15
|
+
export { compareVersions } from './version.js';
|
|
14
16
|
export const DEFAULT_REGISTRY = 'https://registry.npmjs.org';
|
|
15
17
|
export const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
16
18
|
export const NOTICE_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
@@ -51,8 +53,38 @@ async function ownPackageDir() {
|
|
|
51
53
|
}
|
|
52
54
|
return realpath(join(here, '../..'));
|
|
53
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Node's `fetch` ignores `HTTPS_PROXY` and the like, so on a network that only reaches npm through a proxy the check
|
|
58
|
+
* would time out. An `https://` registry the proxy variables cover is asked through that proxy, as npm itself would.
|
|
59
|
+
*/
|
|
60
|
+
async function registryFetch(input, init) {
|
|
61
|
+
const url = String(input instanceof Request ? input.url : input);
|
|
62
|
+
if (!url.startsWith('https://') || !proxyFor(url, process.env))
|
|
63
|
+
return fetch(input, init);
|
|
64
|
+
try {
|
|
65
|
+
const body = await fetchTrace(url, process.env, FETCH_TIMEOUT_MS, 'sideby-update-check');
|
|
66
|
+
return new Response(body, { status: 200, headers: { 'content-type': 'application/json' } });
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
const e = err;
|
|
70
|
+
const status = /^HTTP (\d{3})$/.exec(e.message ?? '');
|
|
71
|
+
if (status)
|
|
72
|
+
return new Response(null, { status: Number(status[1]) });
|
|
73
|
+
// Plain words that never carry the proxy address or its password.
|
|
74
|
+
const why = e.message === 'timeout'
|
|
75
|
+
? Object.assign(new Error('timed out'), { name: 'TimeoutError' })
|
|
76
|
+
: e.code === 'ECONNREFUSED'
|
|
77
|
+
? new Error('the proxy in HTTPS_PROXY refused the connection; is it running?')
|
|
78
|
+
: e.code === 'ENOTFOUND' || e.code === 'EAI_AGAIN'
|
|
79
|
+
? new Error('the address could not be looked up; offline?')
|
|
80
|
+
: new Error(e.message?.startsWith('the proxy') || e.message?.startsWith('a ')
|
|
81
|
+
? `${e.message} (HTTPS_PROXY)`
|
|
82
|
+
: 'the request through the proxy in HTTPS_PROXY failed');
|
|
83
|
+
throw why;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
54
86
|
const realDeps = {
|
|
55
|
-
fetch:
|
|
87
|
+
fetch: registryFetch,
|
|
56
88
|
now: () => new Date(),
|
|
57
89
|
packageDir: ownPackageDir,
|
|
58
90
|
writable: (dir) => access(dir, constants.W_OK).then(() => true, () => false),
|
|
@@ -148,40 +180,7 @@ export const runProgram = (file, args, opts) => deps().exec(file, args, opts);
|
|
|
148
180
|
export const updateMachine = () => deps();
|
|
149
181
|
/** The lock every install shares (`update-install.lock`), so a Local Build switch never races an Update. */
|
|
150
182
|
export const takeInstallLock = (paths) => takeLock(paths, 'update-install.lock').catch(() => null);
|
|
151
|
-
//
|
|
152
|
-
const VERSION = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
153
|
-
function parseVersion(v) {
|
|
154
|
-
const m = VERSION.exec(v.trim());
|
|
155
|
-
return m ? { core: [Number(m[1]), Number(m[2]), Number(m[3])], pre: m[4] ? m[4].split('.') : [] } : null;
|
|
156
|
-
}
|
|
157
|
-
/** Semver precedence of two prerelease identifiers: numbers compare as numbers and sort before words. */
|
|
158
|
-
function comparePre(a, b) {
|
|
159
|
-
const na = /^\d+$/.test(a);
|
|
160
|
-
const nb = /^\d+$/.test(b);
|
|
161
|
-
if (na && nb)
|
|
162
|
-
return Math.sign(Number(a) - Number(b));
|
|
163
|
-
if (na !== nb)
|
|
164
|
-
return na ? -1 : 1;
|
|
165
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
166
|
-
}
|
|
167
|
-
/** -1, 0 or 1 like a sort comparator; a prerelease sorts before its release. Null when either is not a version. */
|
|
168
|
-
export function compareVersions(a, b) {
|
|
169
|
-
const pa = parseVersion(a);
|
|
170
|
-
const pb = parseVersion(b);
|
|
171
|
-
if (!pa || !pb)
|
|
172
|
-
return null;
|
|
173
|
-
for (let i = 0; i < 3; i++)
|
|
174
|
-
if (pa.core[i] !== pb.core[i])
|
|
175
|
-
return pa.core[i] < pb.core[i] ? -1 : 1;
|
|
176
|
-
if (!pa.pre.length || !pb.pre.length)
|
|
177
|
-
return Math.sign(pb.pre.length - pa.pre.length);
|
|
178
|
-
for (let i = 0; i < Math.min(pa.pre.length, pb.pre.length); i++) {
|
|
179
|
-
const c = comparePre(pa.pre[i], pb.pre[i]);
|
|
180
|
-
if (c)
|
|
181
|
-
return c;
|
|
182
|
-
}
|
|
183
|
-
return Math.sign(pa.pre.length - pb.pre.length);
|
|
184
|
-
}
|
|
183
|
+
// ---- versions
|
|
185
184
|
/** `latest` is newer than `current`. */
|
|
186
185
|
export const isNewer = (latest, current) => latest !== undefined && compareVersions(latest, current) === 1;
|
|
187
186
|
/**
|
|
@@ -331,7 +330,7 @@ export async function fetchLatest(env) {
|
|
|
331
330
|
}
|
|
332
331
|
catch (err) {
|
|
333
332
|
const why = err.name === 'TimeoutError' ? 'timed out' : err.message;
|
|
334
|
-
throw new Error(`could not reach ${shown} (${why}); check the connection, or set SIDEBY_UPDATE_REGISTRY to a mirror`);
|
|
333
|
+
throw new Error(`could not reach ${shown} (${why}); check the connection (and HTTPS_PROXY if you use a proxy), or set SIDEBY_UPDATE_REGISTRY to a mirror`);
|
|
335
334
|
}
|
|
336
335
|
if (!res.ok)
|
|
337
336
|
throw new Error(`${shown} answered ${res.status} for sideby's versions; try again later, or set SIDEBY_UPDATE_REGISTRY`);
|
|
@@ -412,7 +411,7 @@ export function skillAutoLine(cache) {
|
|
|
412
411
|
}
|
|
413
412
|
/** The skill part of a `SkillUpdatePlan` toward the running version, as `afterCommandPlan` takes it. */
|
|
414
413
|
export const skillBehind = (plan, current) => plan?.outdated
|
|
415
|
-
? { installed: plan.installed.find((v) => v
|
|
414
|
+
? { installed: plan.installed.find((v) => skillIsBehind(v, current)) ?? null, canRun: plan.canRun }
|
|
416
415
|
: null;
|
|
417
416
|
/**
|
|
418
417
|
* The line about a skill behind this version the CLI may print now (spec §3.23), or null: once a day per CLI version,
|
|
@@ -680,7 +679,7 @@ export async function skillUpdatePlan(home, target) {
|
|
|
680
679
|
const installed = skills.map((s) => s.version);
|
|
681
680
|
const plan = {
|
|
682
681
|
installed,
|
|
683
|
-
outdated: installed.some((v) => v
|
|
682
|
+
outdated: installed.some((v) => skillIsBehind(v, target)),
|
|
684
683
|
command: SKILL_UPDATE.join(' '),
|
|
685
684
|
canRun: true,
|
|
686
685
|
};
|
|
@@ -18,3 +18,11 @@ export interface LocalBuild {
|
|
|
18
18
|
export declare function parseLocalBuild(data: unknown): LocalBuild | null;
|
|
19
19
|
/** The running code's Local Build, or null when it was published or runs from source. */
|
|
20
20
|
export declare function localBuild(): LocalBuild | null;
|
|
21
|
+
type Parsed = {
|
|
22
|
+
core: [number, number, number];
|
|
23
|
+
pre: string[];
|
|
24
|
+
};
|
|
25
|
+
export declare function parseVersion(v: string): Parsed | null;
|
|
26
|
+
/** -1, 0 or 1 like a sort comparator; a prerelease sorts before its release. Null when either is not a version. */
|
|
27
|
+
export declare function compareVersions(a: string, b: string): number | null;
|
|
28
|
+
export {};
|
package/dist/src/core/version.js
CHANGED
|
@@ -70,3 +70,37 @@ export function localBuild() {
|
|
|
70
70
|
}
|
|
71
71
|
return cachedLocal;
|
|
72
72
|
}
|
|
73
|
+
// Build metadata is limited to what semver allows, so a version never carries a terminal escape into the notice.
|
|
74
|
+
const VERSION = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
75
|
+
export function parseVersion(v) {
|
|
76
|
+
const m = VERSION.exec(v.trim());
|
|
77
|
+
return m ? { core: [Number(m[1]), Number(m[2]), Number(m[3])], pre: m[4] ? m[4].split('.') : [] } : null;
|
|
78
|
+
}
|
|
79
|
+
/** Semver precedence of two prerelease identifiers: numbers compare as numbers and sort before words. */
|
|
80
|
+
function comparePre(a, b) {
|
|
81
|
+
const na = /^\d+$/.test(a);
|
|
82
|
+
const nb = /^\d+$/.test(b);
|
|
83
|
+
if (na && nb)
|
|
84
|
+
return Math.sign(Number(a) - Number(b));
|
|
85
|
+
if (na !== nb)
|
|
86
|
+
return na ? -1 : 1;
|
|
87
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
88
|
+
}
|
|
89
|
+
/** -1, 0 or 1 like a sort comparator; a prerelease sorts before its release. Null when either is not a version. */
|
|
90
|
+
export function compareVersions(a, b) {
|
|
91
|
+
const pa = parseVersion(a);
|
|
92
|
+
const pb = parseVersion(b);
|
|
93
|
+
if (!pa || !pb)
|
|
94
|
+
return null;
|
|
95
|
+
for (let i = 0; i < 3; i++)
|
|
96
|
+
if (pa.core[i] !== pb.core[i])
|
|
97
|
+
return pa.core[i] < pb.core[i] ? -1 : 1;
|
|
98
|
+
if (!pa.pre.length || !pb.pre.length)
|
|
99
|
+
return Math.sign(pb.pre.length - pa.pre.length);
|
|
100
|
+
for (let i = 0; i < Math.min(pa.pre.length, pb.pre.length); i++) {
|
|
101
|
+
const c = comparePre(pa.pre[i], pb.pre[i]);
|
|
102
|
+
if (c)
|
|
103
|
+
return c;
|
|
104
|
+
}
|
|
105
|
+
return Math.sign(pa.pre.length - pb.pre.length);
|
|
106
|
+
}
|
package/dist/src/panel/i18n.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ declare const en: {
|
|
|
64
64
|
'upd.unconfirmed': string;
|
|
65
65
|
'upd.reloading': string;
|
|
66
66
|
'upd.restartHint': string;
|
|
67
|
+
'upd.askAi': string;
|
|
67
68
|
'upd.skillLabel': string;
|
|
68
69
|
'upd.skillLater': string;
|
|
69
70
|
'upd.skillLabelLong': string;
|
|
@@ -455,6 +456,26 @@ declare const en: {
|
|
|
455
456
|
'ai.how': string;
|
|
456
457
|
'ai.ask.api': string;
|
|
457
458
|
'ai.ask.tool': string;
|
|
459
|
+
'ai.ask.find': string;
|
|
460
|
+
'pal.button': string;
|
|
461
|
+
'pal.title': string;
|
|
462
|
+
'pal.placeholder': string;
|
|
463
|
+
'pal.kind.page': string;
|
|
464
|
+
'pal.kind.setting': string;
|
|
465
|
+
'pal.kind.action': string;
|
|
466
|
+
'pal.recent': string;
|
|
467
|
+
'pal.common': string;
|
|
468
|
+
'pal.results': string;
|
|
469
|
+
'pal.more.one': string;
|
|
470
|
+
'pal.more.other': string;
|
|
471
|
+
'pal.history': string;
|
|
472
|
+
'pal.historyHint': string;
|
|
473
|
+
'pal.none': string;
|
|
474
|
+
'pal.askAi': string;
|
|
475
|
+
'pal.askText': string;
|
|
476
|
+
'pal.readOnly': string;
|
|
477
|
+
'pal.also': string;
|
|
478
|
+
'pal.keys': string;
|
|
458
479
|
'ask.button': string;
|
|
459
480
|
'ask.title': string;
|
|
460
481
|
'ask.title.fix': string;
|
|
@@ -645,6 +666,12 @@ declare const en: {
|
|
|
645
666
|
'th.removeSure': string;
|
|
646
667
|
'th.removed': string;
|
|
647
668
|
'ask.title.theme': string;
|
|
669
|
+
'ask.task.update': string;
|
|
670
|
+
'ask.title.update': string;
|
|
671
|
+
'ask.ph.update': string;
|
|
672
|
+
'ask.ex.update.1': string;
|
|
673
|
+
'ask.ex.update.2': string;
|
|
674
|
+
'ask.ex.update.3': string;
|
|
648
675
|
'ask.title.network': string;
|
|
649
676
|
'ask.task.network': string;
|
|
650
677
|
'ask.ph.network': string;
|
package/dist/src/panel/i18n.js
CHANGED
|
@@ -66,6 +66,7 @@ const en = {
|
|
|
66
66
|
'upd.unconfirmed': 'Could not confirm the update to sideby {v}: this page cannot reach sideby. Reload the page to see which version runs.',
|
|
67
67
|
'upd.reloading': 'Waiting for the new version; this page reloads by itself.',
|
|
68
68
|
'upd.restartHint': 'This page still runs the old version. Restart sideby ui (or reload the page in your portal) to use the new one.',
|
|
69
|
+
'upd.askAi': 'Not sure why? Let AI fix it',
|
|
69
70
|
'upd.skillLabel': 'Update skill',
|
|
70
71
|
'upd.skillLater': 'Once the new version is installed, open this again to bring the sideby skill agents read along.',
|
|
71
72
|
'upd.skillLabelLong': 'The sideby skill agents read is for {s}; this sideby is {cur}. Click to update it.',
|
|
@@ -457,6 +458,26 @@ const en = {
|
|
|
457
458
|
'ai.how': 'How',
|
|
458
459
|
'ai.ask.api': 'Add a DeepSeek API account for me.',
|
|
459
460
|
'ai.ask.tool': 'Help sideby support a new tool.',
|
|
461
|
+
'ai.ask.find': 'Where do I change the language of the Panel?',
|
|
462
|
+
'pal.button': 'Search',
|
|
463
|
+
'pal.title': 'Search sideby',
|
|
464
|
+
'pal.placeholder': 'Find a page, setting or action…',
|
|
465
|
+
'pal.kind.page': 'Page',
|
|
466
|
+
'pal.kind.setting': 'Setting',
|
|
467
|
+
'pal.kind.action': 'Action',
|
|
468
|
+
'pal.recent': 'Recently used',
|
|
469
|
+
'pal.common': 'Common',
|
|
470
|
+
'pal.results': 'Features',
|
|
471
|
+
'pal.more.one': 'Show {n} more',
|
|
472
|
+
'pal.more.other': 'Show {n} more',
|
|
473
|
+
'pal.history': 'Search session history for “{q}”',
|
|
474
|
+
'pal.historyHint': 'Sessions page',
|
|
475
|
+
'pal.none': 'No matching feature.',
|
|
476
|
+
'pal.askAi': 'Ask your AI where “{q}” is',
|
|
477
|
+
'pal.askText': 'Where do I find “{q}” in sideby?',
|
|
478
|
+
'pal.readOnly': 'Not in a read-only Panel',
|
|
479
|
+
'pal.also': 'matches “{w}”',
|
|
480
|
+
'pal.keys': '↑ ↓ to move · Enter to open · Esc to close',
|
|
460
481
|
'ask.button': 'Let AI do it',
|
|
461
482
|
'ask.title': 'Let AI do it',
|
|
462
483
|
'ask.title.fix': 'Let AI fix it',
|
|
@@ -647,6 +668,12 @@ const en = {
|
|
|
647
668
|
'th.removeSure': 'Remove for good?',
|
|
648
669
|
'th.removed': 'Removed {name}',
|
|
649
670
|
'ask.title.theme': 'Let AI pick your colors',
|
|
671
|
+
'ask.task.update': 'AI checks why the update failed (network, proxy, how sideby is installed), shows you the fix and updates sideby after you agree.',
|
|
672
|
+
'ask.title.update': 'Let AI fix the update',
|
|
673
|
+
'ask.ph.update': 'Anything to add? For example: I use a proxy',
|
|
674
|
+
'ask.ex.update.1': 'I am behind a proxy',
|
|
675
|
+
'ask.ex.update.2': 'Use a registry mirror in China',
|
|
676
|
+
'ask.ex.update.3': 'It says it cannot update itself here',
|
|
650
677
|
'ask.title.network': 'Let AI help',
|
|
651
678
|
'ask.task.network': 'AI asks which countries your requests may leave from, shows the change, and turns the check on only after you agree.',
|
|
652
679
|
'ask.ph.network': 'Where are you, and which proxy nodes do you use? Or paste what was blocked.',
|
|
@@ -1512,6 +1539,7 @@ const zh = {
|
|
|
1512
1539
|
'upd.unconfirmed': '没能确认是否已更新到 sideby {v}:这个页面连不上 sideby。刷新页面看看现在是哪个版本。',
|
|
1513
1540
|
'upd.reloading': '等待新版本启动,本页会自动刷新。',
|
|
1514
1541
|
'upd.restartHint': '本页仍在运行旧版本。重启 sideby ui(在 Portal 里就刷新页面)后使用新版本。',
|
|
1542
|
+
'upd.askAi': '不知道怎么办?让 AI 帮我修',
|
|
1515
1543
|
'upd.skillLabel': '更新 skill',
|
|
1516
1544
|
'upd.skillLater': '装好新版本后,再打开这里把 agent 用的 sideby skill 一起更新。',
|
|
1517
1545
|
'upd.skillLabelLong': 'agent 用的 sideby skill 还是 {s},当前 sideby 是 {cur}。点击更新。',
|
|
@@ -1903,6 +1931,26 @@ const zh = {
|
|
|
1903
1931
|
'ai.how': '怎么做',
|
|
1904
1932
|
'ai.ask.api': '帮我加一个 DeepSeek API 账号。',
|
|
1905
1933
|
'ai.ask.tool': '帮 sideby 支持一个新工具。',
|
|
1934
|
+
'ai.ask.find': '面板的语言在哪里改?',
|
|
1935
|
+
'pal.button': '搜索',
|
|
1936
|
+
'pal.title': '搜索 sideby',
|
|
1937
|
+
'pal.placeholder': '查找页面、设置或操作…',
|
|
1938
|
+
'pal.kind.page': '页面',
|
|
1939
|
+
'pal.kind.setting': '设置',
|
|
1940
|
+
'pal.kind.action': '操作',
|
|
1941
|
+
'pal.recent': '最近用过',
|
|
1942
|
+
'pal.common': '常用',
|
|
1943
|
+
'pal.results': '功能',
|
|
1944
|
+
'pal.more.one': '再显示 {n} 项',
|
|
1945
|
+
'pal.more.other': '再显示 {n} 项',
|
|
1946
|
+
'pal.history': '在会话历史里搜索“{q}”',
|
|
1947
|
+
'pal.historyHint': '会话页',
|
|
1948
|
+
'pal.none': '没有匹配的功能。',
|
|
1949
|
+
'pal.askAi': '问 AI “{q}”在哪里',
|
|
1950
|
+
'pal.askText': '在 sideby 里,“{q}”在哪里?',
|
|
1951
|
+
'pal.readOnly': '只读面板里不能用',
|
|
1952
|
+
'pal.also': '匹配“{w}”',
|
|
1953
|
+
'pal.keys': '↑ ↓ 选择 · Enter 打开 · Esc 关闭',
|
|
1906
1954
|
'ask.button': '让 AI 帮我',
|
|
1907
1955
|
'ask.title': '让 AI 帮我',
|
|
1908
1956
|
'ask.title.fix': '让 AI 修复',
|
|
@@ -2093,6 +2141,12 @@ const zh = {
|
|
|
2093
2141
|
'th.removeSure': '确定删除?',
|
|
2094
2142
|
'th.removed': '已删除「{name}」',
|
|
2095
2143
|
'ask.title.theme': '让 AI 帮我配色',
|
|
2144
|
+
'ask.task.update': 'AI 会查更新为什么失败(网络、代理、安装方式),先给你看怎么修,你同意后再更新 sideby。',
|
|
2145
|
+
'ask.title.update': '让 AI 帮我更新',
|
|
2146
|
+
'ask.ph.update': '想补充什么?比如:我要走代理才能上网',
|
|
2147
|
+
'ask.ex.update.1': '我上网要走代理',
|
|
2148
|
+
'ask.ex.update.2': '在国内,帮我换成镜像源',
|
|
2149
|
+
'ask.ex.update.3': '提示这里不能自己更新',
|
|
2096
2150
|
'ask.title.network': '让 AI 帮我',
|
|
2097
2151
|
'ask.task.network': 'AI 会问你允许哪些地区,先给你看改动,你同意后才打开检查。',
|
|
2098
2152
|
'ask.ph.network': '你在哪里、用哪些代理节点?或者贴上被拦下的提示。',
|
|
@@ -559,7 +559,7 @@ export declare function networkTaskFacts(n: {
|
|
|
559
559
|
}[];
|
|
560
560
|
}): string[];
|
|
561
561
|
/** The kinds of AI Task (spec §3.28); anything else is refused. */
|
|
562
|
-
export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'theme', 'handoff', 'menubar', 'hotkey', 'network'];
|
|
562
|
+
export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'theme', 'handoff', 'menubar', 'hotkey', 'network', 'update'];
|
|
563
563
|
export type AiTaskKind = (typeof AI_TASK_KINDS)[number];
|
|
564
564
|
/**
|
|
565
565
|
* The message keys of the AI dialog for `task` (spec §3.28 "每个入口的提示"): its title, the text box placeholder and
|
|
@@ -647,6 +647,8 @@ export declare function taskPrompt(input: {
|
|
|
647
647
|
handoff?: readonly string[];
|
|
648
648
|
/** Network Guard facts, one per line, as `networkTaskFacts` gives them (`network` task, spec §3.35). */
|
|
649
649
|
network?: readonly string[];
|
|
650
|
+
/** The error the last Update Check or Update showed (`update` task, spec §3.23). */
|
|
651
|
+
updateError?: string;
|
|
650
652
|
};
|
|
651
653
|
/** Files saved for the task (spec §3.28 "附件"): absolute paths and their kind. */
|
|
652
654
|
attachments?: readonly {
|
|
@@ -996,6 +996,7 @@ export const AI_TASK_KINDS = [
|
|
|
996
996
|
'menubar',
|
|
997
997
|
'hotkey',
|
|
998
998
|
'network',
|
|
999
|
+
'update',
|
|
999
1000
|
];
|
|
1000
1001
|
/**
|
|
1001
1002
|
* The message keys of the AI dialog for `task` (spec §3.28 "每个入口的提示"): its title, the text box placeholder and
|
|
@@ -1104,6 +1105,9 @@ export function taskPrompt(input, strip) {
|
|
|
1104
1105
|
cHandoff: '自动接力现在的设置(来自 `sideby handoff status --json`):',
|
|
1105
1106
|
network: '帮我设置 sideby 的网络检查:请求要从我没允许的国家或地区发出时(比如代理断了、节点切错了),拦下 Claude 和 Codex。',
|
|
1106
1107
|
cNetwork: '网络检查现在的情况(来自 `sideby network --json`):',
|
|
1108
|
+
update: '帮我把 sideby 和它的 skill 更新到最新版:面板检查更新或更新时出错了,请找出原因并修好。',
|
|
1109
|
+
cUpdate: '面板上的报错:',
|
|
1110
|
+
pUpdate: '先运行 `sideby update --json`,看它能不能连上 npm、最新版是多少、是哪种安装方式(`canRun`)。连不上时先查网络:要走代理的话,看启动 sideby 的终端里有没有 `HTTPS_PROXY`、代理开没开;在中国大陆可以用镜像 `SIDEBY_UPDATE_REGISTRY=https://registry.npmmirror.com`,要写进 shell 配置文件前先问我。能更新时,`sideby update --json` 已经给出预览(退出码 10),我同意后再跑 `sideby update --yes --json`。`canRun` 为 `false` 时(npx、项目依赖、没有写权限的全局目录),把输出里的 `command` 给我,告诉我在哪里运行。skill 比 sideby 新不是问题,更新 sideby 就好。最后再跑一次 `sideby update --json`,确认 sideby 和 skill 都已是最新。',
|
|
1107
1111
|
pNetwork: '先运行 `sideby network check --json`,告诉我现在每个地址的请求从哪里发出。问我允许哪些国家或地区;不要替我决定,也不要因为现在在哪就把它加进去(网络不对时那正是错的地区)。我说了以后,先不加 `--yes` 跑 `sideby network allow <代码>... --json` 和 `sideby network on --json` 给我看预览,我同意后再加 `--yes`。告诉我:只检查 sideby 启动的会话;Codex 要在 `/hooks` 里信任一次 `network-hook`;临时跳过一次用 `sideby run <账号> --ignore-network`。被拦过的话,先帮我查代理(开没开、哪个节点),再跑 `sideby network check --json` 确认。它只防代理出意外,不会让在不支持的地区使用变得合规;不要帮我隐藏所在地(时区、指纹之类)。',
|
|
1108
1112
|
pHandoff: '先运行 `sideby handoff status --json` 和 `sideby quota --json`,看清每个账号的额度来源和用量。只用 `sideby handoff enable …` 或 `sideby config set handoff.<键> <值>` 改设置;先不加 `--yes` 给我看预览,我同意后再加 `--yes`。没有额度数据的账号排在顺序后面,并告诉我怎么让它显示额度。',
|
|
1109
1113
|
cAccount: '账号:',
|
|
@@ -1153,6 +1157,9 @@ export function taskPrompt(input, strip) {
|
|
|
1153
1157
|
cHandoff: 'Auto Handoff now (from `sideby handoff status --json`):',
|
|
1154
1158
|
network: "Help me set up sideby's network check: stop Claude and Codex when my requests would leave from a country I did not allow (for example when the proxy stopped or a node in the wrong country is picked).",
|
|
1155
1159
|
cNetwork: 'Network check now (from `sideby network --json`):',
|
|
1160
|
+
update: 'Bring sideby and its skill up to date: the Panel showed an error while checking for or installing an update. Find out why and fix it.',
|
|
1161
|
+
cUpdate: 'The error the Panel showed: ',
|
|
1162
|
+
pUpdate: 'Run `sideby update --json` first to see whether it reaches npm, the latest version and how sideby is installed (`canRun`). When it cannot reach npm, check the network: behind a proxy, whether the terminal that starts sideby has `HTTPS_PROXY` and the proxy is on; in mainland China the mirror `SIDEBY_UPDATE_REGISTRY=https://registry.npmmirror.com` helps, but ask me before writing it into a shell config file. When it can update, `sideby update --json` already shows the change (exit 10); run `sideby update --yes --json` after I agree. When `canRun` is false (npx, a project dependency, a global folder I cannot write), give me the `command` from its output and tell me where to run it. A skill newer than sideby is fine: updating sideby is enough. Finish with `sideby update --json` again to confirm sideby and the skill are current.',
|
|
1156
1163
|
pNetwork: "Run `sideby network check --json` first and tell me where each address's requests leave from now. Ask me which countries to allow; never decide for me, and never add the current country because it is current (on a wrong network that is the wrong one). Once I say, run `sideby network allow <codes>... --json` and `sideby network on --json` without `--yes` to show me the change, and add `--yes` after I agree. Tell me: only sessions sideby starts are checked; in Codex I trust `network-hook` once in `/hooks`; `sideby run <account> --ignore-network` skips it once. If something was blocked, help me check the proxy (is it on, which node) first, then run `sideby network check --json` to confirm. It guards against proxy accidents; it does not make use from an unsupported region allowed, and never help hide where I am (time zone, fingerprints).",
|
|
1157
1164
|
pHandoff: 'Run `sideby handoff status --json` and `sideby quota --json` first to see where each account gets its quota and how much is used. Change settings only with `sideby handoff enable …` or `sideby config set handoff.<key> <value>`; show me the preview without `--yes` first, and add `--yes` only after I agree. Put accounts without quota data last in the order, and tell me how to make them show it.',
|
|
1158
1165
|
cAccount: 'Account: ',
|
|
@@ -1228,6 +1235,11 @@ export function taskPrompt(input, strip) {
|
|
|
1228
1235
|
if (lines.length)
|
|
1229
1236
|
facts.push('- ' + L.cNetwork, ...lines.map((l) => ' - ' + l));
|
|
1230
1237
|
}
|
|
1238
|
+
if (task === 'update') {
|
|
1239
|
+
const err = clean(c.updateError);
|
|
1240
|
+
if (err)
|
|
1241
|
+
facts.push('- ' + L.cUpdate + err);
|
|
1242
|
+
}
|
|
1231
1243
|
const version = clean(c.version);
|
|
1232
1244
|
if (version)
|
|
1233
1245
|
facts.push('- ' + L.cVersion + version);
|