@seavideo/cli 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -2
- package/README.publish.md +17 -2
- package/dist/skills/seavideo-canvas-tools/SKILL.md +324 -0
- package/dist/skills/seavideo-command/SKILL.md +215 -0
- package/dist/skills/seavideo-prompt-design/SKILL.md +735 -0
- package/dist/skills/seavideo-setup/SKILL.md +195 -0
- package/dist/skills/seavideo-setup/references/agents/claude-code.md +31 -0
- package/dist/skills/seavideo-setup/references/agents/codex.md +28 -0
- package/dist/skills/seavideo-setup/references/authentication.md +69 -0
- package/dist/skills/seavideo-setup/references/install-skills.md +68 -0
- package/dist/skills/seavideo-setup/references/install.md +92 -0
- package/dist/skills/seavideo-setup/references/platforms/linux.md +29 -0
- package/dist/skills/seavideo-setup/references/platforms/macos.md +31 -0
- package/dist/skills/seavideo-setup/references/platforms/windows.md +55 -0
- package/dist/skills/seavideo-setup/references/troubleshooting.md +69 -0
- package/dist/skills/seavideo-setup/scripts/install-cli.ps1 +109 -0
- package/dist/skills/seavideo-setup/scripts/install-cli.sh +89 -0
- package/dist/skills/seavideo-setup/scripts/install-skills.mjs +130 -0
- package/dist/skills/seavideo-setup/scripts/preflight.ps1 +60 -0
- package/dist/skills/seavideo-setup/scripts/preflight.sh +25 -0
- package/dist/skills/seavideo-setup/scripts/setup.ps1 +74 -0
- package/dist/skills/seavideo-setup/scripts/setup.sh +78 -0
- package/dist/skills/seavideo-workflow-draft/SKILL.md +203 -0
- package/dist/skills/seavideo-workflow-image/SKILL.md +283 -0
- package/dist/skills/seavideo-workflow-video/SKILL.md +352 -0
- package/dist/src/agent-skills/agents.js +62 -0
- package/dist/src/agent-skills/backup.js +17 -0
- package/dist/src/agent-skills/install.js +155 -0
- package/dist/src/agent-skills/manifest.js +68 -0
- package/dist/src/agent-skills/payload.js +46 -0
- package/dist/src/agent-skills/store.js +38 -0
- package/dist/src/canvas/browser.js +5 -0
- package/dist/src/canvas/launch.js +77 -42
- package/dist/src/canvas/lifecycle.js +21 -4
- package/dist/src/canvas/puppeteer.js +56 -6
- package/dist/src/cli/commands/agent-skills.js +249 -0
- package/dist/src/cli/commands/canvas/session.js +3 -1
- package/dist/src/cli/main.js +36 -6
- package/dist/src/cli/program.js +27 -2
- package/dist/src/cli/session.js +2 -0
- package/dist/src/deps.js +6 -1
- package/dist/src/i18n.js +86 -2
- package/dist/src/update/check-cache.js +0 -1
- package/dist/src/update/notify.js +6 -4
- package/dist/src/update/passive.js +9 -17
- package/package.json +3 -2
package/dist/src/cli/main.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { createPaths } from "../config/paths.js";
|
|
2
2
|
import { createConfigStore } from "../config/store.js";
|
|
3
3
|
import { applyDotEnv } from "../config/dotenv.js";
|
|
4
|
-
import { buildProgram, presetNamesFor } from "./program.js";
|
|
5
|
-
import {
|
|
4
|
+
import { buildProgram, presetNamesFor, VERSION } from "./program.js";
|
|
5
|
+
import { CliError } from "../errors.js";
|
|
6
|
+
import { t } from "../i18n.js";
|
|
7
|
+
import { detectNewerVersion, refreshVersionAfterCommand } from "../update/passive.js";
|
|
8
|
+
import { isBusinessCommand, printNotice, shouldConsiderPassive } from "../update/notify.js";
|
|
6
9
|
export { buildProgram, VERSION } from "./program.js";
|
|
7
10
|
export { handleError } from "./output-error.js";
|
|
8
11
|
export function createContextFactory(deps, entry = 'seavideo') {
|
|
@@ -17,6 +20,10 @@ export function createContextFactory(deps, entry = 'seavideo') {
|
|
|
17
20
|
};
|
|
18
21
|
};
|
|
19
22
|
}
|
|
23
|
+
function topLevelNameOf(actionCommand) {
|
|
24
|
+
const parent = actionCommand.parent;
|
|
25
|
+
return parent.parent === null ? actionCommand.name() : parent.name();
|
|
26
|
+
}
|
|
20
27
|
export async function main(argv, deps, entry = 'seavideo') {
|
|
21
28
|
let ctxEnvFlag;
|
|
22
29
|
const merged = { ...deps, env: await applyDotEnv(deps) };
|
|
@@ -33,12 +40,35 @@ export async function main(argv, deps, entry = 'seavideo') {
|
|
|
33
40
|
const paths = createPaths(merged);
|
|
34
41
|
const presetNames = await presetNamesFor(merged, paths);
|
|
35
42
|
const program = buildProgram(merged, ctxFactory, entry, presetNames);
|
|
36
|
-
|
|
43
|
+
let skipUpdate = false;
|
|
44
|
+
program.hook('preAction', async (thisCommand, actionCommand) => {
|
|
37
45
|
const globalOpts = thisCommand.opts();
|
|
38
|
-
|
|
46
|
+
const actionOpts = actionCommand.opts();
|
|
47
|
+
ctxEnvFlag = actionOpts.env ?? globalOpts.env;
|
|
48
|
+
skipUpdate = actionOpts.skipUpdate === true || globalOpts.skipUpdate === true;
|
|
49
|
+
if (skipUpdate) {
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const newer = await detectNewerVersion(merged, paths);
|
|
53
|
+
if (newer !== null) {
|
|
54
|
+
if (isBusinessCommand(topLevelNameOf(actionCommand))) {
|
|
55
|
+
throw new CliError('unsupported', t('update.blocked', { current: VERSION, latest: newer }, merged.env), { detail: t('update.hint', {}, merged.env) });
|
|
56
|
+
}
|
|
57
|
+
else if (shouldConsiderPassive(merged.env, merged.stderrIsTTY)) {
|
|
58
|
+
printNotice(merged, VERSION, newer);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
39
66
|
});
|
|
40
|
-
await checkVersionBeforeCommand(merged, paths);
|
|
41
67
|
await program.parseAsync(['node', entry, ...argv]);
|
|
42
|
-
|
|
68
|
+
if (!skipUpdate) {
|
|
69
|
+
await refreshVersionAfterCommand(merged, paths);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
}
|
|
43
73
|
return process.exitCode;
|
|
44
74
|
}
|
package/dist/src/cli/program.js
CHANGED
|
@@ -15,20 +15,23 @@ import { engineInstallCommand, engineUninstallCommand } from "./commands/engine.
|
|
|
15
15
|
import { updateCommand } from "./commands/update.js";
|
|
16
16
|
import { walletCommand } from "./commands/wallet.js";
|
|
17
17
|
import { skillListCommand, skillReadCommand } from "./commands/skill.js";
|
|
18
|
-
|
|
18
|
+
import { agentSkillsAddCommand, agentSkillsListCommand, agentSkillsRemoveCommand, } from "./commands/agent-skills.js";
|
|
19
|
+
export const VERSION = '0.3.3';
|
|
19
20
|
export function buildProgram(deps, ctx, entry = 'seavideo', presetNames = []) {
|
|
20
21
|
const program = new Command();
|
|
21
22
|
program
|
|
22
23
|
.name(entry)
|
|
23
24
|
.description(t(`program.description.${entry}`))
|
|
24
25
|
.version(VERSION)
|
|
25
|
-
.option('--env <name>', t('program.envOption'))
|
|
26
|
+
.option('--env <name>', t('program.envOption'))
|
|
27
|
+
.option('--skip-update', t('program.skipUpdate'));
|
|
26
28
|
registerIdentity(program, deps, ctx);
|
|
27
29
|
registerEnv(program, deps, ctx, presetNames);
|
|
28
30
|
registerConfig(program, deps, ctx);
|
|
29
31
|
registerCanvas(program, deps, ctx);
|
|
30
32
|
registerTool(program, deps, ctx);
|
|
31
33
|
registerSkill(program, deps, ctx);
|
|
34
|
+
registerAgentSkills(program, deps, ctx);
|
|
32
35
|
program
|
|
33
36
|
.command('doctor')
|
|
34
37
|
.description(t('cmd.doctor'))
|
|
@@ -237,6 +240,28 @@ function registerTool(program, deps, ctx) {
|
|
|
237
240
|
process.exitCode = await runCommand(() => toolCallCommand(ctx(), name, options), deps);
|
|
238
241
|
});
|
|
239
242
|
}
|
|
243
|
+
function registerAgentSkills(program, deps, ctx) {
|
|
244
|
+
const agentSkills = program.command('agent-skills').description(t('cmd.agentSkills'));
|
|
245
|
+
const options = (command) => command
|
|
246
|
+
.option('-a, --agent <name...>', t('opt.agent'))
|
|
247
|
+
.option('-g, --global', t('opt.global'))
|
|
248
|
+
.option('--project <path>', t('opt.project'))
|
|
249
|
+
.option('--skills-dir <path>', t('opt.skillsDir'))
|
|
250
|
+
.option('-n, --dry-run', t('opt.dryRun'))
|
|
251
|
+
.option('-f, --force', t('opt.force'))
|
|
252
|
+
.option('-q, --quiet', t('opt.quiet'));
|
|
253
|
+
options(agentSkills.command('add').description(t('cmd.agentSkills.add'))).action(async (opts) => {
|
|
254
|
+
process.exitCode = await runCommand(() => agentSkillsAddCommand(ctx(), opts), deps);
|
|
255
|
+
});
|
|
256
|
+
options(agentSkills.command('remove').description(t('cmd.agentSkills.remove'))).action(async (opts) => {
|
|
257
|
+
process.exitCode = await runCommand(() => agentSkillsRemoveCommand(ctx(), opts), deps);
|
|
258
|
+
});
|
|
259
|
+
options(agentSkills.command('list').description(t('cmd.agentSkills.list')))
|
|
260
|
+
.option('--json', t('opt.json'))
|
|
261
|
+
.action(async (opts) => {
|
|
262
|
+
process.exitCode = await runCommand(() => agentSkillsListCommand(ctx(), opts), deps);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
240
265
|
function registerSkill(program, deps, ctx) {
|
|
241
266
|
const skill = program.command('skill').description(t('cmd.skill'));
|
|
242
267
|
skill
|
package/dist/src/cli/session.js
CHANGED
|
@@ -5,6 +5,7 @@ import { readSessionRecord, sessionFingerprint, touchSessionRecord, } from "../c
|
|
|
5
5
|
import { sessionAlive } from "../canvas/daemon.js";
|
|
6
6
|
import { resolveFlowCredential } from "./credential.js";
|
|
7
7
|
import { daemonDepsOf } from "../canvas/lifecycle.js";
|
|
8
|
+
import { craftCanvasOf } from "../canvas/browser.js";
|
|
8
9
|
import { style } from "./output.js";
|
|
9
10
|
import { t } from "../i18n.js";
|
|
10
11
|
export async function connectSession(ctx) {
|
|
@@ -47,6 +48,7 @@ export async function connectSession(ctx) {
|
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
const browser = connectPuppeteerBrowser({
|
|
51
|
+
craftCanvas: craftCanvasOf(config, record.id),
|
|
50
52
|
connect: puppeteerConnect,
|
|
51
53
|
port: record.port,
|
|
52
54
|
envMap: deps.env,
|
package/dist/src/deps.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn, spawnSync } from 'node:child_process';
|
|
2
2
|
import { randomBytes } from 'node:crypto';
|
|
3
|
-
import { chmod, mkdir, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile, } from 'node:fs/promises';
|
|
3
|
+
import { chmod, cp, lstat, mkdir, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile, } from 'node:fs/promises';
|
|
4
4
|
import { homedir, platform as osPlatform } from 'node:os';
|
|
5
5
|
import { makeEngineDownloader } from "./canvas/engine-install.js";
|
|
6
6
|
import { makeNpmInstall, npmCommandOf, scriptPathOf } from "./update/npm-install.js";
|
|
@@ -30,7 +30,12 @@ export function createDeps() {
|
|
|
30
30
|
const s = await stat(path);
|
|
31
31
|
return { mode: s.mode };
|
|
32
32
|
},
|
|
33
|
+
lstat: async (path) => {
|
|
34
|
+
const s = await lstat(path);
|
|
35
|
+
return { mode: s.mode };
|
|
36
|
+
},
|
|
33
37
|
unlink: (path) => unlink(path),
|
|
38
|
+
cp: (source, target, options) => cp(source, target, options),
|
|
34
39
|
},
|
|
35
40
|
clock: () => new Date(),
|
|
36
41
|
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
package/dist/src/i18n.js
CHANGED
|
@@ -27,6 +27,7 @@ const en = {
|
|
|
27
27
|
'program.description.seavideo': 'Seavideo local CLI',
|
|
28
28
|
'program.description.seaflow': 'Seaflow local CLI (token-based canvas entry)',
|
|
29
29
|
'program.envOption': 'Override the environment for this invocation',
|
|
30
|
+
'program.skipUpdate': 'Skip the update check for this run',
|
|
30
31
|
'cmd.login': 'Log in to the current environment',
|
|
31
32
|
'cmd.whoami': 'Show login status (always calls the server)',
|
|
32
33
|
'cmd.logout': 'Clear local credentials',
|
|
@@ -41,7 +42,8 @@ const en = {
|
|
|
41
42
|
'cmd.update': 'Check for a newer CLI version',
|
|
42
43
|
'opt.updateChannel': 'Release channel to check (default: latest)',
|
|
43
44
|
'update.available': 'A newer version is available: {current} -> {latest}',
|
|
44
|
-
'update.
|
|
45
|
+
'update.blocked': 'This command requires a newer CLI: {current} -> {latest}',
|
|
46
|
+
'update.hint': 'Upgrade now: seavideo update\nTo run this command without upgrading, add --skip-update',
|
|
45
47
|
'update.channelLine': 'channel {channel} · registry {registry}',
|
|
46
48
|
'update.upToDate': 'Already up to date: {version}',
|
|
47
49
|
'update.ahead': 'Local version {current} is ahead of the channel ({latest})',
|
|
@@ -103,6 +105,44 @@ const en = {
|
|
|
103
105
|
'cmd.skill': 'Manage skills',
|
|
104
106
|
'cmd.skill.list': 'List skills (search by keyword)',
|
|
105
107
|
'cmd.skill.read': 'Read skill files (default SKILL.md)',
|
|
108
|
+
'cmd.agentSkills': 'Install bundled skills into agent directories',
|
|
109
|
+
'cmd.agentSkills.add': 'Install or sync bundled skills',
|
|
110
|
+
'cmd.agentSkills.remove': 'Uninstall skills recorded in the manifest',
|
|
111
|
+
'cmd.agentSkills.list': 'Show installed skills',
|
|
112
|
+
'opt.agent': 'Target agent (repeatable); "all" for every known agent',
|
|
113
|
+
'opt.global': 'Install to the user-level skill directory instead of the project',
|
|
114
|
+
'opt.project': 'Project root (default: current directory)',
|
|
115
|
+
'opt.skillsDir': 'Skill root directory of an agent, such as ~/.claude/skills',
|
|
116
|
+
'opt.dryRun': 'Print the plan without writing anything',
|
|
117
|
+
'opt.force': 'Back up and replace directories not created by this CLI',
|
|
118
|
+
'opt.quiet': 'Suppress normal output',
|
|
119
|
+
'agentSkills.addDone': 'Installed {count} skill(s) to {root}',
|
|
120
|
+
'agentSkills.removed': 'Removed {count} skill(s) from {root}',
|
|
121
|
+
'agentSkills.removedAll': 'Removed {count} skill(s)',
|
|
122
|
+
'agentSkills.nothingToRemove': 'No skills recorded in the manifest',
|
|
123
|
+
'agentSkills.plannedTarget': 'Target {root}',
|
|
124
|
+
'agentSkills.plannedInstall': 'would install {skill}',
|
|
125
|
+
'agentSkills.plannedRemove': 'would remove {skill}',
|
|
126
|
+
'agentSkills.backedUp': 'Backed up {skill} to {backup}',
|
|
127
|
+
'agentSkills.restored': 'Restored {skill} from backup',
|
|
128
|
+
'agentSkills.failed': 'Failed to install {skill}: {reason}',
|
|
129
|
+
'agentSkills.partialFailure': '{count} skill(s) failed; no old entries were removed',
|
|
130
|
+
'agentSkills.noAgentDetected': 'No supported agent detected for {scope} scope',
|
|
131
|
+
'agentSkills.noAgentDetectedDetail': 'Pass --agent <name>, --agent all, or --skills-dir <path>. Supported agents: {agents}',
|
|
132
|
+
'agentSkills.unknownAgent': 'Unknown agent "{value}". Supported: {agents}',
|
|
133
|
+
'agentSkills.conflict': '"{skill}" already exists at {path} and was not installed by this CLI',
|
|
134
|
+
'agentSkills.conflictDetail': 'Re-run with --force to back it up and replace it',
|
|
135
|
+
'agentSkills.hint': 'Hint: {hint}',
|
|
136
|
+
'agentSkills.skillsDirConflict': '--skills-dir cannot be combined with --agent or --global',
|
|
137
|
+
'agentSkills.globalWithProject': '--global cannot be combined with --project',
|
|
138
|
+
'agentSkills.locked': 'Another seavideo install is running: {path}',
|
|
139
|
+
'agentSkills.manifestMissing': 'Install manifest is missing; refusing to guess',
|
|
140
|
+
'agentSkills.manifestCorrupt': 'Install manifest is unreadable: {path} ({reason})',
|
|
141
|
+
'agentSkills.manifestMissingDetail': 'Remove the skill directories by hand, or reinstall with "agent-skills add"',
|
|
142
|
+
'agentSkills.payloadMissing': 'Bundled skills are missing from this installation',
|
|
143
|
+
'agentSkills.payloadMissingDetail': 'Expected them under {path}; missing: {missing}',
|
|
144
|
+
'agentSkills.listEmpty': 'No skills installed',
|
|
145
|
+
'agentSkills.listHeader': 'Agent Scope Skill Version',
|
|
106
146
|
'cmd.tool': 'Work with the tools the current canvas exposes',
|
|
107
147
|
'cmd.tool.list': 'List tool names and descriptions',
|
|
108
148
|
'cmd.tool.spec': 'Show full definitions (one name, several names, or all)',
|
|
@@ -608,11 +648,14 @@ const en = {
|
|
|
608
648
|
'canvas.shotSaved': 'Screenshot saved to: {path}',
|
|
609
649
|
'canvas.shotWriteFailed': 'Could not write the screenshot',
|
|
610
650
|
'canvas.notOpened': 'The browser session has no canvas page open; the session is unusable, so close it and run canvas use again',
|
|
651
|
+
'canvas.craftLocationChanged': 'The Craft page navigated away from the canvas (login page or error page). Run canvas use again.',
|
|
652
|
+
'canvas.previousClosing': 'The previous canvas browser is still closing. Please retry in a moment.',
|
|
611
653
|
};
|
|
612
654
|
const zh = {
|
|
613
655
|
'program.description.seavideo': 'Seavideo 本地命令行工具',
|
|
614
656
|
'program.description.seaflow': 'Seaflow 本地命令行工具(token 直连画布入口)',
|
|
615
657
|
'program.envOption': '临时指定环境',
|
|
658
|
+
'program.skipUpdate': '本次跳过更新检查',
|
|
616
659
|
'cmd.login': '登录到当前环境',
|
|
617
660
|
'cmd.whoami': '查询登录状态(每次真实调用服务端)',
|
|
618
661
|
'cmd.logout': '清除本地凭据',
|
|
@@ -627,7 +670,8 @@ const zh = {
|
|
|
627
670
|
'cmd.update': '检查 CLI 是否有新版本',
|
|
628
671
|
'opt.updateChannel': '要检查的发布通道(默认 latest)',
|
|
629
672
|
'update.available': '有新版本可用:{current} -> {latest}',
|
|
630
|
-
'update.
|
|
673
|
+
'update.blocked': '该命令需要更新的 CLI 版本:{current} -> {latest}',
|
|
674
|
+
'update.hint': '立即升级:seavideo update\n本次不升级:在命令后加 --skip-update',
|
|
631
675
|
'update.channelLine': '通道 {channel} · registry {registry}',
|
|
632
676
|
'update.upToDate': '已是最新版本:{version}',
|
|
633
677
|
'update.ahead': '本地版本 {current} 领先于通道顶端({latest})',
|
|
@@ -689,6 +733,44 @@ const zh = {
|
|
|
689
733
|
'cmd.skill': '技能管理',
|
|
690
734
|
'cmd.skill.list': '列出技能(支持关键字检索)',
|
|
691
735
|
'cmd.skill.read': '读取技能文件(默认 SKILL.md)',
|
|
736
|
+
'cmd.agentSkills': '把随包技能安装到 agent 目录',
|
|
737
|
+
'cmd.agentSkills.add': '安装或同步随包技能',
|
|
738
|
+
'cmd.agentSkills.remove': '卸载清单里记录的技能',
|
|
739
|
+
'cmd.agentSkills.list': '查看已安装的技能',
|
|
740
|
+
'opt.agent': '目标 agent(可重复);all 表示全部已知 agent',
|
|
741
|
+
'opt.global': '装到用户级技能目录,而不是当前项目',
|
|
742
|
+
'opt.project': '项目根目录(默认当前目录)',
|
|
743
|
+
'opt.skillsDir': 'agent 的技能根目录,如 ~/.claude/skills',
|
|
744
|
+
'opt.dryRun': '只打印计划,不写任何文件',
|
|
745
|
+
'opt.force': '备份并替换不是本 CLI 安装的同名目录',
|
|
746
|
+
'opt.quiet': '抑制普通输出',
|
|
747
|
+
'agentSkills.addDone': '已向 {root} 安装 {count} 个技能',
|
|
748
|
+
'agentSkills.removed': '已从 {root} 移除 {count} 个技能',
|
|
749
|
+
'agentSkills.removedAll': '已移除 {count} 个技能',
|
|
750
|
+
'agentSkills.nothingToRemove': '清单中没有已安装的技能',
|
|
751
|
+
'agentSkills.plannedTarget': '目标 {root}',
|
|
752
|
+
'agentSkills.plannedInstall': '将安装 {skill}',
|
|
753
|
+
'agentSkills.plannedRemove': '将移除 {skill}',
|
|
754
|
+
'agentSkills.backedUp': '已备份 {skill} 到 {backup}',
|
|
755
|
+
'agentSkills.restored': '已从备份恢复 {skill}',
|
|
756
|
+
'agentSkills.failed': '安装 {skill} 失败:{reason}',
|
|
757
|
+
'agentSkills.partialFailure': '有 {count} 个技能失败;未删除任何旧条目',
|
|
758
|
+
'agentSkills.noAgentDetected': '未在 {scope} 作用域下检测到受支持的 agent',
|
|
759
|
+
'agentSkills.noAgentDetectedDetail': '请使用 --agent <名字>、--agent all 或 --skills-dir <路径>。支持的 agent:{agents}',
|
|
760
|
+
'agentSkills.unknownAgent': '未知 agent "{value}"。支持:{agents}',
|
|
761
|
+
'agentSkills.conflict': '"{skill}" 已存在于 {path},且不是本 CLI 安装的',
|
|
762
|
+
'agentSkills.conflictDetail': '确认要覆盖请加 --force,会先备份',
|
|
763
|
+
'agentSkills.hint': '提示:{hint}',
|
|
764
|
+
'agentSkills.skillsDirConflict': '--skills-dir 不能与 --agent 或 --global 同时使用',
|
|
765
|
+
'agentSkills.globalWithProject': '--global 不能与 --project 同时使用',
|
|
766
|
+
'agentSkills.locked': '另一个 seavideo 安装正在进行:{path}',
|
|
767
|
+
'agentSkills.manifestMissing': '安装清单缺失,拒绝猜测删除',
|
|
768
|
+
'agentSkills.manifestCorrupt': '安装清单无法解析:{path}({reason})',
|
|
769
|
+
'agentSkills.manifestMissingDetail': '请手动删除技能目录,或重新执行 agent-skills add',
|
|
770
|
+
'agentSkills.payloadMissing': '当前安装缺少随包技能',
|
|
771
|
+
'agentSkills.payloadMissingDetail': '期望位于 {path};缺少:{missing}',
|
|
772
|
+
'agentSkills.listEmpty': '尚未安装任何技能',
|
|
773
|
+
'agentSkills.listHeader': 'Agent 作用域 技能 版本',
|
|
692
774
|
'cmd.tool': '操作当前画布暴露的工具',
|
|
693
775
|
'cmd.tool.list': '列出工具名与描述',
|
|
694
776
|
'cmd.tool.spec': '查看完整定义(一个名字、多个名字或全部)',
|
|
@@ -1194,6 +1276,8 @@ const zh = {
|
|
|
1194
1276
|
'canvas.shotSaved': '截图已保存到:{path}',
|
|
1195
1277
|
'canvas.shotWriteFailed': '无法写入截图文件',
|
|
1196
1278
|
'canvas.notOpened': '浏览器会话里没有打开的画布页。该会话已不可用,请 canvas close 后重新 canvas use',
|
|
1279
|
+
'canvas.craftLocationChanged': 'Craft 页面已离开画布(跳到了登录页或错误页),请重新 canvas use',
|
|
1280
|
+
'canvas.previousClosing': '上一个画布浏览器仍在退出,请稍后重试',
|
|
1197
1281
|
};
|
|
1198
1282
|
const TABLES = { en, zh };
|
|
1199
1283
|
export function t(key, vars = {}, env = process.env) {
|
|
@@ -4,10 +4,12 @@ import { DISABLE_ENV } from "./check-cache.js";
|
|
|
4
4
|
export function shouldConsiderPassive(env, stderrIsTTY) {
|
|
5
5
|
return stderrIsTTY && env[DISABLE_ENV] !== '1';
|
|
6
6
|
}
|
|
7
|
-
export function decideNotice(current, latest
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export function decideNotice(current, latest) {
|
|
8
|
+
return latest !== null && compareVersions(latest, current) === 1 ? latest : null;
|
|
9
|
+
}
|
|
10
|
+
const BUSINESS_COMMANDS = new Set(['canvas', 'tool', 'skill', 'wallet']);
|
|
11
|
+
export function isBusinessCommand(name) {
|
|
12
|
+
return BUSINESS_COMMANDS.has(name);
|
|
11
13
|
}
|
|
12
14
|
export function printNotice(deps, current, latest) {
|
|
13
15
|
deps.stderr(`\n${t('update.available', { current, latest }, deps.env)}\n` +
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { VERSION } from "../cli/program.js";
|
|
2
|
-
import { cacheUsable, readCheckCache, successTtlOf, writeCheckCache, } from "./check-cache.js";
|
|
3
|
-
import { decideNotice,
|
|
2
|
+
import { cacheUsable, checkDisabled, readCheckCache, successTtlOf, writeCheckCache, } from "./check-cache.js";
|
|
3
|
+
import { decideNotice, shouldConsiderPassive } from "./notify.js";
|
|
4
4
|
import { DEFAULT_CHANNEL, fetchVersionInfo, PACKAGE_NAME } from "./registry.js";
|
|
5
|
-
export async function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (latest !== null) {
|
|
10
|
-
printNotice(deps, VERSION, latest);
|
|
11
|
-
await writeCheckCache(deps, paths.versionCheckFile, {
|
|
12
|
-
...cache,
|
|
13
|
-
notified: latest,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
}
|
|
5
|
+
export async function detectNewerVersion(deps, paths) {
|
|
6
|
+
let result;
|
|
7
|
+
if (checkDisabled(deps.env)) {
|
|
8
|
+
result = null;
|
|
18
9
|
}
|
|
19
10
|
else {
|
|
11
|
+
const cache = await readCheckCache(deps.fs, paths.versionCheckFile);
|
|
12
|
+
result = decideNotice(VERSION, cache?.latest ?? null);
|
|
20
13
|
}
|
|
14
|
+
return result;
|
|
21
15
|
}
|
|
22
16
|
export async function refreshVersionAfterCommand(deps, paths) {
|
|
23
17
|
if (shouldConsiderPassive(deps.env, deps.stderrIsTTY)) {
|
|
@@ -39,7 +33,6 @@ async function refreshCache(deps, paths, cache) {
|
|
|
39
33
|
checkedAt: deps.clock().toISOString(),
|
|
40
34
|
latest: info.latest,
|
|
41
35
|
channel,
|
|
42
|
-
notified: cache?.notified ?? null,
|
|
43
36
|
});
|
|
44
37
|
}
|
|
45
38
|
catch {
|
|
@@ -47,7 +40,6 @@ async function refreshCache(deps, paths, cache) {
|
|
|
47
40
|
checkedAt: deps.clock().toISOString(),
|
|
48
41
|
latest: cache?.latest ?? null,
|
|
49
42
|
channel,
|
|
50
|
-
notified: cache?.notified ?? null,
|
|
51
43
|
});
|
|
52
44
|
}
|
|
53
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seavideo/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "CLI gateway for Seavideo canvas workflows: build, run and inspect image/video generation graphs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "tsc -p tsconfig.build.json && node scripts/postbuild.mjs",
|
|
32
|
+
"build": "tsc -p tsconfig.build.json && node scripts/postbuild.mjs && node scripts/copy-skills.mjs",
|
|
33
33
|
"typecheck": "tsc --noEmit",
|
|
34
34
|
"dev": "node --experimental-strip-types bin/seavideo.ts",
|
|
35
35
|
"test": "vitest run",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"format": "prettier --write .",
|
|
40
40
|
"format:check": "prettier --check .",
|
|
41
41
|
"check:rules": "node --experimental-strip-types bin/check-code-rules.ts",
|
|
42
|
+
"package:skills": "node scripts/package-skills.mjs",
|
|
42
43
|
"sync:version": "node scripts/sync-version.mjs",
|
|
43
44
|
"version": "node scripts/sync-version.mjs",
|
|
44
45
|
"prepublishOnly": "npm run build"
|