yuanflow-cli 0.1.40 → 0.1.41
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 +119 -8
- package/generated/registry.json +985 -984
- package/package.json +1 -1
- package/scripts/generate-registry.js +1 -1
- package/skills/yuanflow-skill/README.md +14 -10
- package/skills/yuanflow-skill/SKILL.md +37 -7
- package/skills/yuanflow-skill/{OSS → YuanFlow}/346/226/207/344/273/266/344/270/255/350/275/254/345/267/245/345/205/267/SKILL.md +8 -8
- package/skills/yuanflow-skill/yuanflow-cli/SKILL.md +3 -3
- package/skills/yuanflow-skill//344/275/234/345/223/201/344/270/213/350/275/275/347/273/274/345/220/210/345/267/245/345/205/267/SKILL.md +1 -1
- package/skills/yuanflow-skill//344/275/234/345/223/201/350/257/204/350/256/272/351/207/207/351/233/206/SKILL.md +1 -1
- package/skills/yuanflow-skill//350/247/206/350/247/211/347/220/206/350/247/243/SKILL.md +174 -0
- package/skills/yuanflow-skill//350/247/206/351/242/221/346/213/206/350/247/243/SKILL.md +245 -0
- package/skills/yuanflow-skill//351/237/263/350/247/206/351/242/221/345/234/250/347/272/277/350/275/254/346/226/207/345/255/227/SKILL.md +10 -10
- package/src/agent-protocol.js +8 -5
- package/src/ai-tools.js +835 -0
- package/src/cli.js +35 -1
- package/src/comment-collector.js +1 -1
- package/src/oss-tools.js +11 -11
- package/src/shortcuts.js +3 -3
- package/src/trending-tools.js +1 -1
- package/src/work-tools.js +4 -4
package/src/cli.js
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
searchUsers,
|
|
29
29
|
} from './work-tools.js';
|
|
30
30
|
import { fetchVideoHotList } from './trending-tools.js';
|
|
31
|
+
import { formatAiHelp, runAiCommand } from './ai-tools.js';
|
|
31
32
|
|
|
32
33
|
export async function main(argv) {
|
|
33
34
|
const args = argv.slice(2);
|
|
@@ -98,6 +99,11 @@ export async function main(argv) {
|
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
if (command === 'ai') {
|
|
103
|
+
await handleAi(rest);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
if (command === 'schema') {
|
|
102
108
|
await handleSchema(rest);
|
|
103
109
|
return;
|
|
@@ -431,6 +437,20 @@ async function handleVideo(args) {
|
|
|
431
437
|
});
|
|
432
438
|
}
|
|
433
439
|
|
|
440
|
+
async function handleAi(args) {
|
|
441
|
+
const { positionals, options } = parseOptions(args);
|
|
442
|
+
const [action = 'help', ...rest] = positionals;
|
|
443
|
+
if (action === 'help' && !isAgentJsonFormat(options)) {
|
|
444
|
+
console.log(formatAiHelp());
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
const result = await runAiCommand({ action, rest, options });
|
|
448
|
+
await outputResult(result, { ...options, output: undefined }, {
|
|
449
|
+
command: `ai ${[action, ...rest].filter(Boolean).join(' ')}`,
|
|
450
|
+
meta: { endpoint: result.endpoint?.path, kind: result.endpoint?.kind || 'ai-model' },
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
434
454
|
async function handleGeneratedCommand(platform, args) {
|
|
435
455
|
if (!getPlatforms().includes(platform)) {
|
|
436
456
|
throw new Error(`未知平台:${platform}。可用平台:${getPlatforms().join(', ')}`);
|
|
@@ -609,10 +629,24 @@ function printHelp() {
|
|
|
609
629
|
yuanflow-cli video timeline --project "D:\\素材\\yuanflow-video-edit" --fps 1 --format agent-json
|
|
610
630
|
yuanflow-cli video visual-review --project "D:\\素材\\yuanflow-video-edit" --review-file "D:\\素材\\yuanflow-video-edit\\visual_review.agent.json" --format agent-json
|
|
611
631
|
yuanflow-cli video plan --project "D:\\素材\\yuanflow-video-edit" --timeline-plan "D:\\素材\\yuanflow-video-edit\\timeline_plan.agent.json" --format agent-json
|
|
632
|
+
yuanflow-cli ai qwen3-vl-plus --prompt "描述这张图" --image-url "https://example.com/image.png" --dry-run
|
|
633
|
+
yuanflow-cli ai qwen3-vl-plus --prompt "总结这个视频画面" --video-url "https://example.com/video.mp4" --dry-run
|
|
634
|
+
yuanflow-cli ai qwen3-vl-plus --prompt "描述本地图片" --image-file "D:\\素材\\cover.png" --dry-run
|
|
635
|
+
yuanflow-cli ai qwen3-vl-plus --prompt "描述本地视频" --video-file "D:\\素材\\demo.mp4" --dry-run
|
|
636
|
+
yuanflow-cli ai qwen-voice-enrollment --file "D:\\voice\\sample.wav" --name demo --activate --dry-run
|
|
637
|
+
yuanflow-cli ai qwen3-tts-vc-realtime-2026-01-15 --text "你好" --voice voice_xxx --output "D:\\voice\\qwen.mp3" --dry-run
|
|
638
|
+
yuanflow-cli ai fun-asr --audio-url "https://example.com/audio.wav" --response-format verbose_json --dry-run
|
|
639
|
+
yuanflow-cli ai doubao-tts voices --dry-run
|
|
640
|
+
yuanflow-cli ai doubao-tts voice --voice zh_female_xiaohe_uranus_bigtts --dry-run
|
|
641
|
+
yuanflow-cli ai doubao-tts voice-download --voice zh_female_xiaohe_uranus_bigtts --output "D:\\voice\\preview.mp3" --dry-run
|
|
642
|
+
yuanflow-cli ai doubao-tts --text "你好" --voice zh_female_xiaohe_uranus_bigtts --output "D:\\voice\\doubao.mp3" --dry-run
|
|
612
643
|
yuanflow-cli list douyin
|
|
613
644
|
|
|
614
645
|
说明:
|
|
615
|
-
社媒请求调用
|
|
646
|
+
社媒请求调用 YuanFlow API 的 /social/*path;知识库和 YuanFlow 文件中转调用 /api/* 或 /atomic/*。
|
|
647
|
+
ai 命令调用 YuanFlow API OpenAI 兼容端点,模型名使用 YuanFlow API 对外模型参数,不暴露底层供应商内部模型名。
|
|
648
|
+
qwen3-vl-plus 支持 --image-url、--video-url、--image-file、--video-file 四选一;视频建议最大 2GB、时长 2 秒到 1 小时。
|
|
649
|
+
qwen3-vl-plus 本地图片/视频会先走 YuanFlow 文件中转,内部调用 /atomic/oss/temp-upload 后把 signed_url 提交给模型。
|
|
616
650
|
browser 命令是自媒体平台专用浏览器自动化协议,只返回受控 profile/cookie/任务路径与执行计划,不用于普通网页搜索。
|
|
617
651
|
video 命令是视频智能剪辑基础链路:规则库策略快照、主音频+B-roll、ASR 时间戳对齐、1秒1帧抽帧、视觉理解回写、Agent 生成 timeline_plan/EDL、CLI 校验和渲染。
|
|
618
652
|
需要鉴权的请求都会使用 Authorization: Bearer <token>。
|
package/src/comment-collector.js
CHANGED
|
@@ -454,7 +454,7 @@ export function listCommentCommands() {
|
|
|
454
454
|
options: buildCommentCommandOptions(endpoint),
|
|
455
455
|
queryParams: buildCommentCommandQueryParams(endpoint),
|
|
456
456
|
requestBody: endpoint.bodyMode ? buildCommentCommandRequestBody(endpoint) : null,
|
|
457
|
-
returns: '
|
|
457
|
+
returns: '返回评论列表、翻页游标和平台原始响应字段,字段以 YuanFlow API 实际响应为准。',
|
|
458
458
|
}));
|
|
459
459
|
}
|
|
460
460
|
|
package/src/oss-tools.js
CHANGED
|
@@ -12,14 +12,14 @@ export function listOssCommands() {
|
|
|
12
12
|
key: 'oss.temp-upload',
|
|
13
13
|
command: 'oss temp-upload',
|
|
14
14
|
kind: 'oss-atomic',
|
|
15
|
-
description: '上传本地文件到
|
|
15
|
+
description: '上传本地文件到 YuanFlow 文件中转,并返回对象 key 和临时访问信息。',
|
|
16
16
|
method: 'POST',
|
|
17
17
|
apiPath: OSS_TEMP_UPLOAD_PATH,
|
|
18
18
|
positionals: [],
|
|
19
19
|
options: [
|
|
20
20
|
{ flag: '--file', name: 'file', required: true, label: '本地文件路径。' },
|
|
21
21
|
{ flag: '--filename', name: 'filename', required: false, label: '上传时使用的文件名,默认取本地文件名。' },
|
|
22
|
-
{ flag: '--key', name: 'key', required: false, label: '
|
|
22
|
+
{ flag: '--key', name: 'key', required: false, label: '可选文件对象 key。' },
|
|
23
23
|
{ flag: '--content-type', name: 'contentType', required: false, label: '文件 MIME 类型,默认 application/octet-stream。' },
|
|
24
24
|
...commonOptions(),
|
|
25
25
|
],
|
|
@@ -29,19 +29,19 @@ export function listOssCommands() {
|
|
|
29
29
|
content_base64: '<base64>',
|
|
30
30
|
content_type: '<content-type>',
|
|
31
31
|
},
|
|
32
|
-
returns: '返回 bucket、key、url、signed_url、expires_at
|
|
32
|
+
returns: '返回 bucket、key、url、signed_url、expires_at 等字段,字段以 YuanFlow API 实际响应为准。',
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
key: 'oss.signed-url',
|
|
36
36
|
command: 'oss signed-url',
|
|
37
37
|
kind: 'oss-atomic',
|
|
38
|
-
description: '
|
|
38
|
+
description: '为已有文件中转对象生成临时签名访问链接。',
|
|
39
39
|
method: 'POST',
|
|
40
40
|
apiPath: OSS_SIGNED_URL_PATH,
|
|
41
41
|
positionals: [],
|
|
42
42
|
options: [
|
|
43
|
-
{ flag: '--key', name: 'key', required: true, label: '
|
|
44
|
-
{ flag: '--bucket', name: 'bucket', required: false, label: '可选 bucket
|
|
43
|
+
{ flag: '--key', name: 'key', required: true, label: '文件对象 key。' },
|
|
44
|
+
{ flag: '--bucket', name: 'bucket', required: false, label: '可选 bucket,不传则使用 YuanFlow 默认配置。' },
|
|
45
45
|
{ flag: '--ttl-seconds', name: 'ttlSeconds', required: false, label: '签名有效期,最大 86400 秒。' },
|
|
46
46
|
{ flag: '--method', name: 'method', required: false, label: '签名方法:GET、PUT、HEAD。' },
|
|
47
47
|
...commonOptions(),
|
|
@@ -52,19 +52,19 @@ export function listOssCommands() {
|
|
|
52
52
|
ttl_seconds: 1800,
|
|
53
53
|
method: 'GET',
|
|
54
54
|
},
|
|
55
|
-
returns: '返回签名 URL
|
|
55
|
+
returns: '返回签名 URL、过期时间和对象信息,字段以 YuanFlow API 实际响应为准。',
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
key: 'oss.copy',
|
|
59
59
|
command: 'oss copy',
|
|
60
60
|
kind: 'oss-atomic',
|
|
61
|
-
description: '
|
|
61
|
+
description: '复制文件中转对象到目标 key。',
|
|
62
62
|
method: 'POST',
|
|
63
63
|
apiPath: OSS_COPY_PATH,
|
|
64
64
|
positionals: [],
|
|
65
65
|
options: [
|
|
66
|
-
{ flag: '--source-key', name: 'sourceKey', required: true, label: '
|
|
67
|
-
{ flag: '--target-key', name: 'targetKey', required: true, label: '
|
|
66
|
+
{ flag: '--source-key', name: 'sourceKey', required: true, label: '源文件对象 key。' },
|
|
67
|
+
{ flag: '--target-key', name: 'targetKey', required: true, label: '目标文件对象 key。' },
|
|
68
68
|
{ flag: '--source-bucket', name: 'sourceBucket', required: false, label: '可选源 bucket。' },
|
|
69
69
|
{ flag: '--target-bucket', name: 'targetBucket', required: false, label: '可选目标 bucket。' },
|
|
70
70
|
...commonOptions(),
|
|
@@ -75,7 +75,7 @@ export function listOssCommands() {
|
|
|
75
75
|
source_bucket: '<optional source bucket>',
|
|
76
76
|
target_bucket: '<optional target bucket>',
|
|
77
77
|
},
|
|
78
|
-
returns: '
|
|
78
|
+
returns: '返回复制后的对象信息,字段以 YuanFlow API 实际响应为准。',
|
|
79
79
|
},
|
|
80
80
|
];
|
|
81
81
|
}
|
package/src/shortcuts.js
CHANGED
|
@@ -7,7 +7,7 @@ export const shortcuts = [
|
|
|
7
7
|
socialPath: '/douyin/app/v3/fetch_multi_video_v2',
|
|
8
8
|
positionals: [{ name: 'url', label: '作品链接' }],
|
|
9
9
|
options: [],
|
|
10
|
-
returns: '
|
|
10
|
+
returns: '返回作品基础信息、作者信息、互动统计、媒体信息等字段,字段结构以 YuanFlow API 实际响应为准。',
|
|
11
11
|
alternatives: [
|
|
12
12
|
'GET /social/douyin/app/v3/fetch_one_video_by_share_url?share_url=...',
|
|
13
13
|
'GET /social/douyin/web/fetch_one_video?aweme_id=...',
|
|
@@ -21,7 +21,7 @@ export const shortcuts = [
|
|
|
21
21
|
socialPath: '/douyin/app/v3/fetch_video_high_quality_play_url',
|
|
22
22
|
positionals: [{ name: 'share_url', label: '作品链接或分享链接' }],
|
|
23
23
|
options: [{ flag: 'region', name: 'region', label: '地区,可选,如 CN' }],
|
|
24
|
-
returns: '
|
|
24
|
+
returns: '返回视频播放地址、清晰度信息、媒体地址等;是否可直接下载取决于 YuanFlow API 返回和目标平台限制。',
|
|
25
25
|
alternatives: [
|
|
26
26
|
'POST /social/douyin/app/v3/fetch_multi_video_high_quality_play_url',
|
|
27
27
|
'GET /social/douyin/web/fetch_video_high_quality_play_url',
|
|
@@ -280,7 +280,7 @@ export const shortcuts = [
|
|
|
280
280
|
{
|
|
281
281
|
platform: 'wechat',
|
|
282
282
|
command: 'channels-home',
|
|
283
|
-
description: '微信视频号主页采集,参数结构通常需要用 --json
|
|
283
|
+
description: '微信视频号主页采集,参数结构通常需要用 --json 传入接口要求的完整请求体。',
|
|
284
284
|
method: 'POST',
|
|
285
285
|
socialPath: '/wechat_channels/fetch_home_page',
|
|
286
286
|
positionals: [],
|
package/src/trending-tools.js
CHANGED
|
@@ -26,7 +26,7 @@ export function listTrendingCommands() {
|
|
|
26
26
|
{ flag: '--date-window', name: 'date_window', required: false, label: '时间窗口,默认 2 按天' },
|
|
27
27
|
{ flag: '--tags-json', name: 'tags', required: false, label: '垂类标签 JSON 数组,空则全部垂类' },
|
|
28
28
|
],
|
|
29
|
-
returns: '返回五类视频热榜的统一 JSON
|
|
29
|
+
returns: '返回五类视频热榜的统一 JSON,字段结构以 YuanFlow API 实际响应为准。',
|
|
30
30
|
},
|
|
31
31
|
];
|
|
32
32
|
}
|
package/src/work-tools.js
CHANGED
|
@@ -148,8 +148,8 @@ function workCommand(platform, action, endpoint, kind) {
|
|
|
148
148
|
requestBody: endpoint.bodyMode ? requestBodyExample(endpoint, 'target') : null,
|
|
149
149
|
returns:
|
|
150
150
|
action === 'download'
|
|
151
|
-
? '
|
|
152
|
-
: '
|
|
151
|
+
? '返回作品可播放媒体信息、下载地址候选或视频流信息,字段以 YuanFlow API 实际响应为准。'
|
|
152
|
+
: '返回作品详情、作者信息、正文/标题、互动统计和媒体信息,字段以 YuanFlow API 实际响应为准。',
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -167,8 +167,8 @@ function searchCommand(platform, action, endpoint, kind) {
|
|
|
167
167
|
requestBody: endpoint.bodyMode ? requestBodyExample(endpoint, 'keyword') : null,
|
|
168
168
|
returns:
|
|
169
169
|
action === 'users'
|
|
170
|
-
? '
|
|
171
|
-
: '
|
|
170
|
+
? '返回用户/频道搜索结果、分页字段和平台原始摘要字段,字段以 YuanFlow API 实际响应为准。'
|
|
171
|
+
: '返回内容搜索结果、分页字段和平台原始摘要字段,字段以 YuanFlow API 实际响应为准。',
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
|