@seavideo/cli 0.3.3 → 0.3.5
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 +1 -2
- package/README.publish.md +1 -2
- package/dist/skills/seavideo-canvas-tools/SKILL.md +0 -1
- package/dist/skills/seavideo-command/SKILL.md +0 -2
- package/dist/skills/seavideo-prompt-design/SKILL.md +0 -1
- package/dist/skills/seavideo-workflow-draft/SKILL.md +0 -1
- package/dist/skills/seavideo-workflow-image/SKILL.md +0 -1
- package/dist/skills/seavideo-workflow-video/SKILL.md +0 -1
- package/dist/src/cli/program.js +1 -1
- package/dist/src/config/envs/envs.enc.json +25 -0
- package/dist/src/config/envs/envs.json +13 -0
- package/dist/src/config/presets.js +47 -13
- package/dist/src/config/sops.js +48 -0
- package/dist/src/deps.js +2 -0
- package/dist/src/i18n.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -115,8 +115,7 @@ OAuth 登录拿到的凭据带 refresh token,过期前自动续期。续期失
|
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
117
|
seavideo update # 升到最新稳定版
|
|
118
|
-
seavideo update --
|
|
119
|
-
seavideo update --to 0.2.7 # 装/降级到指定版本
|
|
118
|
+
seavideo update --to 0.3.3 # 装/降级到指定版本
|
|
120
119
|
seavideo update --dry-run # 只显示将执行的命令
|
|
121
120
|
```
|
|
122
121
|
|
package/README.publish.md
CHANGED
|
@@ -115,8 +115,7 @@ OAuth 登录拿到的凭据带 refresh token,过期前自动续期。续期失
|
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
117
|
seavideo update # 升到最新稳定版
|
|
118
|
-
seavideo update --
|
|
119
|
-
seavideo update --to 0.2.7 # 装/降级到指定版本
|
|
118
|
+
seavideo update --to 0.3.3 # 装/降级到指定版本
|
|
120
119
|
seavideo update --dry-run # 只显示将执行的命令
|
|
121
120
|
```
|
|
122
121
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: seavideo-command
|
|
3
3
|
description: 执行 seavideo 命令行的全部子命令:环境与登录、浏览/创建/删除/打开画布、调用画布工具、技能市场、引擎安装与 CLI 升级。当用户要运行任何 seavideo 命令,或问「怎么列出画布」「怎么登录」「怎么调用画布工具」「怎么升级 CLI」「命令报错了」时使用。只管命令怎么拼,不管节点字段(看 canvas-tools),也不管怎么搭工作流。
|
|
4
|
-
version: 0.3.3
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# seavideo 命令用法
|
|
@@ -173,7 +172,6 @@ seavideo engine uninstall # 只删当前版本,并打印卸载位置
|
|
|
173
172
|
```bash
|
|
174
173
|
seavideo update # 查最新版;是全局安装就直接升级
|
|
175
174
|
seavideo update --dry-run # 只显示将要执行的 npm 命令
|
|
176
|
-
seavideo update --channel alpha # 查预发布通道
|
|
177
175
|
seavideo update --json # 只报告,不安装
|
|
178
176
|
```
|
|
179
177
|
|
package/dist/src/cli/program.js
CHANGED
|
@@ -16,7 +16,7 @@ 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.
|
|
19
|
+
export const VERSION = '0.3.5';
|
|
20
20
|
export function buildProgram(deps, ctx, entry = 'seavideo', presetNames = []) {
|
|
21
21
|
const program = new Command();
|
|
22
22
|
program
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"envs": {
|
|
3
|
+
"cn-dev": {
|
|
4
|
+
"platform": "ENC[AES256_GCM,data:ddw=,iv:C16SedQouP2VAnyDElBDPKcaH/luLkFXKmXaKBf3szI=,tag:TDhZksETLfUfrkCz9Gxeqw==,type:str]",
|
|
5
|
+
"seavideoBaseUrl": "ENC[AES256_GCM,data:SC4Qh/2WG1Zg7rJC4FFsfb2Wgg3bTMQNja9OBpIaJiZZ6VPYBz6Z5uJC5Uqpc8DEpdM=,iv:Obb+44DnvFFjCs5Os5OMkxgLwoDhTufB03ztR6k/bUU=,tag:PfPJttD2y1TFi4mwsg/2fg==,type:str]",
|
|
6
|
+
"flowWebBaseUrl": "ENC[AES256_GCM,data:UWfzTjnksCn8QumishxMaaYnVvuJ+M4qtI3ZtQ==,iv:RmVUySfNqDRJ9tAupQGVo5PCt6q3X8po4N8kaRBLDV4=,tag:3wUjWez4OHOkcgMoJohGBQ==,type:str]",
|
|
7
|
+
"flowApiBaseUrl": "ENC[AES256_GCM,data:bBhLUaUqqRne6HC6Nv/Qgtuni5GB7wRYuUQYFk/22qdEiTsTHe3qE/PJq6NQ,iv:GAmw6ytpQiHw3k+GX4F6yfhM0w64RmM1b7mBfMPxy8Y=,tag:tvK7/owRoQ/VmLTJxL2H5w==,type:str]",
|
|
8
|
+
"aiVideoApiBaseUrl": "ENC[AES256_GCM,data:gSVfGS5iveh1lgDMMOYPmLmvJ8tVo+n6caT0QbdK8riRLFkxLuLBqeQLXQ0=,iv:PtdOi+XbLswND5Bg3WGWjUtOtk1QFiKrlEbbzdmRCPw=,tag:SbnyHQHQG1Llp6uZJqJLGw==,type:str]",
|
|
9
|
+
"authIssuer": "ENC[AES256_GCM,data:HpMKbV+BmSYc8xZyQ3tOGRA9Ae3TQ//9VdRUj7v8G3UyC0A4,iv:MhX/rLrfkvwuYwijknmLs8xuERC6QJ4F45kpznIEj3Y=,tag:6vRPH+i9ikVWYozB+w1+uA==,type:str]",
|
|
10
|
+
"authClientId": "ENC[AES256_GCM,data:EV5WXX/PVF1bTeUGnnJQWw==,iv:9Qn0y/VSrgTZ4tOwUDUZVSlnhXXoIwZMHZhLYcP88LA=,tag:b6oPm9w27aBSmcCGRq4Qag==,type:str]"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"sops": {
|
|
14
|
+
"age": [
|
|
15
|
+
{
|
|
16
|
+
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB2MUY4OVB2eDVZM25Jd01w\nZXFtbUFyQXMra0JSUDg5Z05MVEZzVjYvK1MwCkpXT3hXdXRudmdnRU1aam94cG1s\nS1Zha055blZXWlNLZU5HbzllWDArbHcKLS0tIFNLU014dTNjY2o0L2lBS1lkUEZn\nQS81MEFwVVRQdkVmcVFrNnVMZU9BTjAK51r9s+kfxoKXy4Q9ZDcLnQNM2yB2PLEm\nClBgYsqLb/IDQbM3Y7BQRDKZZmFh9xrqZ6276FIhj+XwFUeE2rLMkQ==\n-----END AGE ENCRYPTED FILE-----\n",
|
|
17
|
+
"recipient": "age1489m0aw3cke0x5l4u5dyk3j4zvgq4wyksjatsssj4kzz0hevlf3qe9gsre"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"lastmodified": "2026-12-04T02:01:42Z",
|
|
21
|
+
"mac": "ENC[AES256_GCM,data:W8k0WBDxas4YeUOuat3lcshU0Yk6pdpeqBK1d9JPBOapBS34vtYVWlLEreJUGgGIu4tnjieUw+JrPnp5d4yGjC9qbxV3y6V60PTiEYvaRoIlXIR2vdqMCrvTKoywop397veWizeR+W4iy4nj+OB3+XBA9YWhAG/FLiRYuBjxPnU=,iv:6XpR/QD5pjwtmOjbMbfKmGqDSgvi9kiyHh5Oj2X5ChI=,tag:b02oORq9CfkIw9vwxMFEjA==,type:str]",
|
|
22
|
+
"unencrypted_suffix": "_unencrypted",
|
|
23
|
+
"version": "3.13.3"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"envs": {
|
|
3
|
+
"cn-release": {
|
|
4
|
+
"platform": "cn",
|
|
5
|
+
"seavideoBaseUrl": "https://www.seavideo.tv",
|
|
6
|
+
"flowWebBaseUrl": "https://flow.seavideo.tv",
|
|
7
|
+
"flowApiBaseUrl": "https://cn-flow-gateway.seavideo.ai",
|
|
8
|
+
"aiVideoApiBaseUrl": "https://seaflow-ai-video-api.seavideo.tv",
|
|
9
|
+
"authIssuer": "https://seaflow-auth.seavideo.tv",
|
|
10
|
+
"authClientId": "workbuddy-cn-cli"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
1
|
+
import { dirname, join, resolve } from 'node:path';
|
|
2
2
|
import { CliError } from "../errors.js";
|
|
3
3
|
import { t } from "../i18n.js";
|
|
4
4
|
import { parsePreset, parsePresetsDocument } from "./preset-schema.js";
|
|
@@ -13,17 +13,15 @@ export const ENV_VAR_FIELDS = {
|
|
|
13
13
|
};
|
|
14
14
|
export const ENVS_FILE_NAME = 'envs.json';
|
|
15
15
|
export const PRESET_ENV_NAME_VAR = 'SEAVIDEO_ENV';
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
};
|
|
16
|
+
export const ENCRYPTED_ENVS_FILE_NAME = 'envs.enc.json';
|
|
17
|
+
export const SOPS_LOG_FILE_NAME = 'sops.log';
|
|
18
|
+
const PACKAGED_ENVS_RELATIVE = join('..', 'src', 'config', 'envs', ENVS_FILE_NAME);
|
|
19
|
+
function packagedEnvsPath(deps) {
|
|
20
|
+
return join(dirname(resolve(deps.scriptPath())), PACKAGED_ENVS_RELATIVE);
|
|
21
|
+
}
|
|
22
|
+
function encryptedEnvsPath(deps) {
|
|
23
|
+
return join(dirname(packagedEnvsPath(deps)), ENCRYPTED_ENVS_FILE_NAME);
|
|
24
|
+
}
|
|
27
25
|
async function readEnvsFile(path, deps) {
|
|
28
26
|
const text = await readTextOrNull(path, deps);
|
|
29
27
|
let result;
|
|
@@ -35,6 +33,41 @@ async function readEnvsFile(path, deps) {
|
|
|
35
33
|
}
|
|
36
34
|
return result;
|
|
37
35
|
}
|
|
36
|
+
async function readEncryptedEnvsFile(path, deps, paths) {
|
|
37
|
+
const outcome = await deps.decryptSopsFile(path);
|
|
38
|
+
await logSopsAttempt(paths, path, deps, outcome);
|
|
39
|
+
let result;
|
|
40
|
+
if (outcome.status === 'ok') {
|
|
41
|
+
result = parsePresetsDocument(path, parseJsonOrThrow(path, outcome.text, deps), deps.env);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
result = {};
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
async function logSopsAttempt(paths, path, deps, outcome) {
|
|
49
|
+
let outcomeText;
|
|
50
|
+
if (outcome.status === 'unavailable') {
|
|
51
|
+
outcomeText = null;
|
|
52
|
+
}
|
|
53
|
+
else if (outcome.status === 'ok') {
|
|
54
|
+
outcomeText = 'ok';
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
outcomeText = `failed: ${outcome.reason}`;
|
|
58
|
+
}
|
|
59
|
+
if (outcomeText !== null) {
|
|
60
|
+
const line = `${deps.clock().toISOString()} ${path} ${outcomeText}\n`;
|
|
61
|
+
try {
|
|
62
|
+
await deps.fs.mkdir(paths.root, { recursive: true, mode: 0o700 });
|
|
63
|
+
await deps.fs.writeFile(join(paths.root, SOPS_LOG_FILE_NAME), line, { mode: 0o600 });
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
}
|
|
70
|
+
}
|
|
38
71
|
async function readTextOrNull(path, deps) {
|
|
39
72
|
let result;
|
|
40
73
|
try {
|
|
@@ -108,7 +141,8 @@ function defineEntry(target, name, value) {
|
|
|
108
141
|
}
|
|
109
142
|
export async function loadPresetRegistry(deps, paths) {
|
|
110
143
|
const registry = { presets: {}, origins: {} };
|
|
111
|
-
overlay(registry,
|
|
144
|
+
overlay(registry, await readEnvsFile(packagedEnvsPath(deps), deps), 'builtin');
|
|
145
|
+
overlay(registry, await readEncryptedEnvsFile(encryptedEnvsPath(deps), deps, paths), 'builtin');
|
|
112
146
|
overlay(registry, await readEnvsFile(join(paths.root, ENVS_FILE_NAME), deps), 'user-file');
|
|
113
147
|
overlay(registry, await readEnvsFile(join(deps.cwd(), ENVS_FILE_NAME), deps), 'project-file');
|
|
114
148
|
const fromEnvVars = readEnvVarPreset(deps);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
export function makeSopsDecrypt(spawnFn = spawn) {
|
|
3
|
+
return async (path) => {
|
|
4
|
+
let child = null;
|
|
5
|
+
try {
|
|
6
|
+
child = spawnFn('sops', ['--decrypt', path], {
|
|
7
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
8
|
+
windowsHide: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
child = null;
|
|
13
|
+
}
|
|
14
|
+
let result;
|
|
15
|
+
if (child === null) {
|
|
16
|
+
result = { status: 'unavailable' };
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
result = await collect(child);
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async function collect(child) {
|
|
25
|
+
const stdout = [];
|
|
26
|
+
const stderr = [];
|
|
27
|
+
child.stdout.on('data', (chunk) => stdout.push(chunk));
|
|
28
|
+
child.stderr.on('data', (chunk) => stderr.push(chunk));
|
|
29
|
+
const exit = await new Promise((resolve) => {
|
|
30
|
+
child.once('error', (error) => resolve({ code: null, error }));
|
|
31
|
+
child.once('close', (code) => resolve({ code, error: null }));
|
|
32
|
+
});
|
|
33
|
+
let result;
|
|
34
|
+
if (exit.error !== null) {
|
|
35
|
+
result = { status: 'unavailable' };
|
|
36
|
+
}
|
|
37
|
+
else if (exit.code !== 0) {
|
|
38
|
+
result = { status: 'failed', reason: diagnosticOf(stderr) };
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
result = { status: 'ok', text: Buffer.concat(stdout).toString('utf8') };
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
function diagnosticOf(chunks) {
|
|
46
|
+
const text = Buffer.concat(chunks).toString('utf8').trim();
|
|
47
|
+
return text === '' ? '(no stderr)' : text;
|
|
48
|
+
}
|
package/dist/src/deps.js
CHANGED
|
@@ -4,6 +4,7 @@ import { chmod, cp, lstat, mkdir, readFile, readdir, realpath, rename, rm, stat,
|
|
|
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";
|
|
7
|
+
import { makeSopsDecrypt } from "./config/sops.js";
|
|
7
8
|
import { startLoopbackServer } from "./loopback.js";
|
|
8
9
|
async function readStdin() {
|
|
9
10
|
const chunks = [];
|
|
@@ -86,6 +87,7 @@ export function createDeps() {
|
|
|
86
87
|
downloadEngine: makeEngineDownloader(),
|
|
87
88
|
runNpmInstall: makeNpmInstall(npmCommandOf(process.platform), undefined, process.platform === 'win32'),
|
|
88
89
|
scriptPath: () => scriptPathOf(process.argv),
|
|
90
|
+
decryptSopsFile: makeSopsDecrypt(),
|
|
89
91
|
readWindowsRegistry: readRegistryWith(runCapture),
|
|
90
92
|
realpath: (path) => realpath(path),
|
|
91
93
|
};
|
package/dist/src/i18n.js
CHANGED
|
@@ -65,7 +65,7 @@ const en = {
|
|
|
65
65
|
'update.notGlobalNoShim': 'No global launcher found next to this package; upgrade it the way it was installed',
|
|
66
66
|
'update.notGlobalUnknown': 'Could not tell how this CLI was installed; refusing to replace it',
|
|
67
67
|
'opt.updateDryRun': 'Show what would run without installing',
|
|
68
|
-
'opt.updateVersion': 'Install this version or tag, also for downgrades (e.g. --to 0.
|
|
68
|
+
'opt.updateVersion': 'Install this version or tag, also for downgrades (e.g. --to 0.3.3)',
|
|
69
69
|
'opt.updateRegistry': 'npm registry to use for this run (overrides SEAVIDEO_REGISTRY)',
|
|
70
70
|
'update.badRegistry': 'Not a valid registry URL: {value} (expected http:// or https://)',
|
|
71
71
|
'doctor.versionNotChecked': 'not checked yet; run seavideo update',
|
|
@@ -693,7 +693,7 @@ const zh = {
|
|
|
693
693
|
'update.notGlobalNoShim': '找不到与该包配套的全局启动器,请按原来的方式升级',
|
|
694
694
|
'update.notGlobalUnknown': '无法判断这个 CLI 是怎么装的,拒绝覆盖安装',
|
|
695
695
|
'opt.updateDryRun': '只显示将要执行的命令,不安装',
|
|
696
|
-
'opt.updateVersion': '安装指定版本或 tag(也可用于降级),如 --to 0.
|
|
696
|
+
'opt.updateVersion': '安装指定版本或 tag(也可用于降级),如 --to 0.3.3',
|
|
697
697
|
'opt.updateRegistry': '本次使用的 npm registry(覆盖 SEAVIDEO_REGISTRY)',
|
|
698
698
|
'update.badRegistry': '不是合法的 registry 地址:{value}(需要 http:// 或 https://)',
|
|
699
699
|
'doctor.versionNotChecked': '尚未检查;可运行 seavideo update',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seavideo/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
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 && node scripts/copy-skills.mjs",
|
|
32
|
+
"build": "tsc -p tsconfig.build.json && node scripts/postbuild.mjs && node scripts/copy-skills.mjs && node scripts/copy-envs.mjs",
|
|
33
33
|
"typecheck": "tsc --noEmit",
|
|
34
34
|
"dev": "node --experimental-strip-types bin/seavideo.ts",
|
|
35
35
|
"test": "vitest run",
|