@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 CHANGED
@@ -115,8 +115,7 @@ OAuth 登录拿到的凭据带 refresh token,过期前自动续期。续期失
115
115
 
116
116
  ```bash
117
117
  seavideo update # 升到最新稳定版
118
- seavideo update --channel alpha # 升到预发布通道
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 --channel alpha # 升到预发布通道
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-canvas-tools
3
3
  description: 查画布上有哪些工具、哪些节点类型、参数怎么给、节点之间怎么连。当用户问「画布上能做什么」「某个工具要什么参数」「该用哪种节点类型」「这两个节点能连吗」「工具报 MISSING_END_PORT_CODE 之类的错」,或要在建节点前确认字段与枚举时使用。只回答能力与参数,不含命令行语法,也不含完整工作流步骤。
4
- version: 0.3.3
5
4
  ---
6
5
 
7
6
  # 画布工具与节点类型
@@ -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
 
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: seavideo-prompt-design
3
3
  description: 当用户要写或改本画布的生成 prompt、觉得产出不像、人物跨图不一致、构图光线不对、视频动作奇怪时使用。含具体化、画面分层、注意力顺序、负面约束、人物/道具/场景/普通图四类资产写法、视频分镜运镜、按症状诊断。仅限本画布内置模型,不含 Midjourney、Stable Diffusion 等外部工具的语法。
4
- version: 0.3.3
5
4
  ---
6
5
 
7
6
  # 怎么设计 prompt
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: seavideo-workflow-draft
3
3
  description: 把模糊需求梳理成可落地的结构化草稿:目标、资产清单、产出单元(几张图 / 几个 clip)、引用关系。当用户提出要做一组图、一条视频或多镜头成片,但需求还没细化;或需要先拆资产、切分镜、确认时长画幅时使用。只产出草稿,不建任何节点。
4
- version: 0.3.3
5
4
  ---
6
5
 
7
6
  # 工作流设计草稿
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: seavideo-workflow-image
3
3
  description: 在画布上落地图片工作流并跑出图:建资产图片节点、建 N 个产出节点、把 @资产名 写进 prompt、按引用连线、执行、验收。当用户要生成图片、要做一组风格统一的图、要基于已有素材图出图,且方案(出几张、引用哪些资产)已经明确时使用。视频成片请用 video 技能,不知道怎么设计 prompt 请用 prompt 技能。
4
- version: 0.3.3
5
4
  ---
6
5
 
7
6
  # 图片工作流落地
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: seavideo-workflow-video
3
3
  description: 在画布上落地视频工作流并跑出片:建资产图片节点、按草稿建 N 个 video clip 节点、写 @资产名 引用、按引用连线、逐个执行、用合成节点聚合成片、验收。当用户要生成视频、做多镜头短片、把多个 clip 拼成成片,且分镜与资产已定时使用。单张图片请用 image 技能。
4
- version: 0.3.3
5
4
  ---
6
5
 
7
6
  # 视频工作流落地
@@ -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.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 BUILTIN_PRESETS = {
17
- 'cn-release': {
18
- platform: 'cn',
19
- seavideoBaseUrl: 'https://seacraft-cn-sea-craft-next.dev.seavideo.tv',
20
- flowWebBaseUrl: 'https://flow.dev.seavideo.tv',
21
- flowApiBaseUrl: 'https://aiart-cn-flow-gateway.dev.seavideo.tv',
22
- aiVideoApiBaseUrl: 'https://seaflow-ai-video-api.dev.seavideo.tv',
23
- authIssuer: 'https://seaflow-auth.dev.seavideo.tv',
24
- authClientId: 'workbuddy-cn-cli',
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, BUILTIN_PRESETS, 'builtin');
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.2.7-alpha.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.2.7-alpha.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",
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",