yuanflow-cli 0.1.43 → 0.1.45

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.
Files changed (23) hide show
  1. package/README.md +34 -4
  2. package/package.json +1 -1
  3. package/skills/yuanflow-skill/README.md +7 -0
  4. package/skills/yuanflow-skill/SKILL.md +24 -9
  5. package/skills/yuanflow-skill//345/243/260/351/237/263/345/205/213/351/232/206/SKILL.md +146 -0
  6. package/skills/yuanflow-skill//345/243/260/351/237/263/345/244/215/345/210/273/SKILL.md +103 -0
  7. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/SKILL.md +77 -0
  8. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/agents/openai.yaml +8 -0
  9. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/assets/templates/editorial-publishing.html +65 -0
  10. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/assets/templates/lifestyle-collage.html +49 -0
  11. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/assets/templates/product-brand.html +50 -0
  12. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/assets/templates/social-campaign.html +49 -0
  13. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/assets/templates/technical-diagram.html +45 -0
  14. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/overview.html +272 -0
  15. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/references/commercial-system.md +56 -0
  16. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/references/layout-playbook.md +98 -0
  17. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/references/quality-check.md +58 -0
  18. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/references/style-atlas.md +728 -0
  19. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/references/use-case-recipes.md +116 -0
  20. package/skills/yuanflow-skill//350/247/206/350/247/211/345/215/241/347/211/207/347/224/237/346/210/220/scripts/check_visual_card.py +92 -0
  21. package/src/agent-protocol.js +3 -0
  22. package/src/cli.js +24 -0
  23. package/src/voice-tools.js +471 -0
@@ -0,0 +1,116 @@
1
+ # Use Case Recipes
2
+
3
+ ## 1. Xiaohongshu Cover
4
+
5
+ Fixed:
6
+
7
+ - Ratio: `1080x1440`.
8
+ - Must read at 360px wide.
9
+ - Title should be short, usually 8-18 Chinese characters.
10
+ - One strong visual signal: face/object/screenshot/title block/large number.
11
+
12
+ Recommended style families:
13
+
14
+ - Pop Magazine for trend and consumer hooks.
15
+ - Chinese Editorial for travel, culture, food, reading, personal essays.
16
+ - Product Cutout for recommendations and product posts.
17
+ - Neo-Brutalist for warnings and opinion hooks.
18
+
19
+ Modules:
20
+
21
+ - `hero-title`, `image-led`, `object-callout`, `split-compare`, `data-chart`.
22
+
23
+ ## 2. Xiaohongshu Carousel
24
+
25
+ Fixed:
26
+
27
+ - 5-9 pages unless the source is very short.
28
+ - Page 1 cover, page 2 context, middle pages evidence/method/detail, final page summary.
29
+ - Use repeated metadata, but vary the layout module.
30
+
31
+ Recommended module sequence:
32
+
33
+ `hero-title` -> `evidence-feature` -> `ledger-list` -> `diagram-flow` -> `matrix-grid` -> `split-compare` -> `quote-page`.
34
+
35
+ ## 3. Article Illustration
36
+
37
+ Fixed:
38
+
39
+ - Ratio: `1600x900`, `1440x1080`, or `1500x1000`.
40
+ - One concept only; title optional.
41
+ - Avoid social-media hook language unless the article needs it.
42
+
43
+ Recommended style families:
44
+
45
+ - Calm Diagram for frameworks.
46
+ - Blueprint Technical for architecture and systems.
47
+ - Museum Label for objects and design analysis.
48
+ - Editorial Paper for essays.
49
+ - Data Newspaper for research/report summaries.
50
+
51
+ ## 4. WeChat Cover Pair
52
+
53
+ Fixed:
54
+
55
+ - Main cover: `2100x900`.
56
+ - Square cover: `1080x1080`.
57
+ - Compose separately. Do not crop the wide cover into square.
58
+ - Square cover should usually use a shorter title and fewer elements.
59
+
60
+ Recommended style families:
61
+
62
+ - Editorial Paper, Luxury Minimal, Chinese Editorial, Event Key Visual.
63
+
64
+ ## 5. Design Graphic / Design Draft
65
+
66
+ Fixed:
67
+
68
+ - Decide function first: explain, persuade, summarize, decorate, or compare.
69
+ - Use annotations and labels only when they clarify the design.
70
+ - Keep source/editability: HTML and CSS must stay understandable.
71
+
72
+ Recommended style families:
73
+
74
+ - Swiss Data for structured product diagrams.
75
+ - Blueprint Technical for architecture.
76
+ - Product Cutout for feature graphics.
77
+ - Calm Diagram for frameworks.
78
+ - Maximal Poster for campaign direction.
79
+
80
+ ## 6. Product Recommendation / Product Feature Image
81
+
82
+ Fixed:
83
+
84
+ - Product/screenshot must be large enough to inspect.
85
+ - Benefits must be true to source.
86
+ - Use 2-4 callouts, not a paragraph cloud.
87
+
88
+ Recommended style families:
89
+
90
+ - Product Cutout, Museum Label, Luxury Minimal, Swiss Data.
91
+
92
+ ## 7. Event / Course / Launch Poster
93
+
94
+ Fixed:
95
+
96
+ - Title, date/time, host/location, and CTA have separate hierarchy.
97
+ - Key visual should dominate; logistics should not become the headline.
98
+
99
+ Recommended style families:
100
+
101
+ - Event Key Visual, Maximal Poster, Neo-Brutalist, Luxury Minimal.
102
+
103
+ ## 8. Style Exploration
104
+
105
+ Fixed:
106
+
107
+ - Same source topic across variants.
108
+ - Keep the ratio and core copy stable enough for comparison.
109
+ - Generate 3-6 variants, each changing at least style family + layout + image treatment.
110
+
111
+ Good variant sets:
112
+
113
+ - Professional: Swiss Data / Editorial Paper / Luxury Minimal.
114
+ - Social growth: Pop Magazine / Product Cutout / Neo-Brutalist.
115
+ - Article and report: Data Newspaper / Calm Diagram / Museum Label.
116
+ - Lifestyle: Chinese Editorial / Soft Studio / Film Contact Sheet.
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env python3
2
+ """Lightweight static checks for YuanFlow visual-card HTML."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import re
7
+ import sys
8
+ from pathlib import Path
9
+
10
+ KNOWN_STYLES = {
11
+ "magazine-paper",
12
+ "editorial-paper",
13
+ "chinese-literary",
14
+ "swiss-data",
15
+ "pop-magazine",
16
+ "neo-brutalist",
17
+ "chinese-editorial",
18
+ "luxury-minimal",
19
+ "blueprint-technical",
20
+ "soft-studio",
21
+ "collage-desk",
22
+ "cyber-interface",
23
+ "botanical-organic",
24
+ "playful-toy",
25
+ "film-contact-sheet",
26
+ "museum-label",
27
+ "maximal-poster",
28
+ "calm-diagram",
29
+ "data-newspaper",
30
+ "handwritten-lab",
31
+ "event-key-visual",
32
+ "product-cutout",
33
+ "brand-system",
34
+ "app-feature",
35
+ }
36
+
37
+ KNOWN_RATIOS = {"xhs", "square", "wide", "article", "poster"}
38
+
39
+
40
+ def main() -> int:
41
+ if len(sys.argv) != 2:
42
+ print("Usage: python check_visual_card.py <index.html>")
43
+ return 2
44
+
45
+ html_path = Path(sys.argv[1])
46
+ if not html_path.exists():
47
+ print(f"FAIL: file not found: {html_path}")
48
+ return 1
49
+
50
+ text = html_path.read_text(encoding="utf-8")
51
+ failures: list[str] = []
52
+ warnings: list[str] = []
53
+
54
+ if '<meta charset="utf-8">' not in text.lower():
55
+ failures.append("missing utf-8 charset meta")
56
+ if re.search(r"\b(TODO|Lorem ipsum|标题占位|替换标题)\b", text, re.I):
57
+ failures.append("placeholder text remains")
58
+ if ".poster" not in text:
59
+ failures.append("missing .poster class")
60
+ poster_count = len(re.findall(r'class="[^"]*\bposter\b[^"]*"', text))
61
+ style_values = re.findall(r'data-style="([^"]+)"', text)
62
+ ratio_values = re.findall(r'data-ratio="([^"]+)"', text)
63
+ if poster_count and len(style_values) < poster_count:
64
+ failures.append("some .poster nodes are missing data-style")
65
+ if poster_count and len(ratio_values) < poster_count:
66
+ failures.append("some .poster nodes are missing data-ratio")
67
+ unknown_styles = sorted(set(style_values) - KNOWN_STYLES)
68
+ unknown_ratios = sorted(set(ratio_values) - KNOWN_RATIOS)
69
+ if unknown_styles:
70
+ warnings.append("unknown data-style values: " + ", ".join(unknown_styles))
71
+ if unknown_ratios:
72
+ warnings.append("unknown data-ratio values: " + ", ".join(unknown_ratios))
73
+ if not re.search(r"width:\s*\d+px", text) or not re.search(r"height:\s*\d+px", text):
74
+ warnings.append("no fixed pixel poster width/height detected")
75
+ if "data-style=" not in text:
76
+ warnings.append("no data-style style family marker detected")
77
+ if "data-ratio=" not in text:
78
+ warnings.append("no data-ratio marker detected")
79
+
80
+ for item in failures:
81
+ print(f"FAIL: {item}")
82
+ for item in warnings:
83
+ print(f"WARN: {item}")
84
+
85
+ if failures:
86
+ return 1
87
+ print("PASS: visual-card HTML basic checks passed")
88
+ return 0
89
+
90
+
91
+ if __name__ == "__main__":
92
+ raise SystemExit(main())
@@ -8,6 +8,7 @@ import { listSearchCommands, listWorkCommands } from './work-tools.js';
8
8
  import { listVideoCommands } from './video-tools.js';
9
9
  import { listTrendingCommands } from './trending-tools.js';
10
10
  import { listAiCommands } from './ai-tools.js';
11
+ import { listVoiceCommands } from './voice-tools.js';
11
12
 
12
13
  const ERROR_MAP = [
13
14
  {
@@ -113,6 +114,7 @@ export function buildCommandRegistry() {
113
114
  const videoCommands = listVideoCommands();
114
115
  const trendingCommands = listTrendingCommands();
115
116
  const aiCommands = listAiCommands();
117
+ const voiceCommands = listVoiceCommands();
116
118
  return [
117
119
  ...shortcuts,
118
120
  ...endpoints,
@@ -125,6 +127,7 @@ export function buildCommandRegistry() {
125
127
  ...videoCommands,
126
128
  ...trendingCommands,
127
129
  ...aiCommands,
130
+ ...voiceCommands,
128
131
  ].sort((left, right) => left.key.localeCompare(right.key));
129
132
  }
130
133
 
package/src/cli.js CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  } from './work-tools.js';
30
30
  import { fetchVideoHotList } from './trending-tools.js';
31
31
  import { formatAiHelp, runAiCommand } from './ai-tools.js';
32
+ import { formatVoiceHelp, runVoiceCommand } from './voice-tools.js';
32
33
 
33
34
  export async function main(argv) {
34
35
  const args = argv.slice(2);
@@ -104,6 +105,11 @@ export async function main(argv) {
104
105
  return;
105
106
  }
106
107
 
108
+ if (command === 'voice') {
109
+ await handleVoice(rest);
110
+ return;
111
+ }
112
+
107
113
  if (command === 'schema') {
108
114
  await handleSchema(rest);
109
115
  return;
@@ -451,6 +457,20 @@ async function handleAi(args) {
451
457
  });
452
458
  }
453
459
 
460
+ async function handleVoice(args) {
461
+ const { positionals, options } = parseOptions(args);
462
+ const [action = 'help'] = positionals;
463
+ if (action === 'help' && !isAgentJsonFormat(options)) {
464
+ console.log(formatVoiceHelp());
465
+ return;
466
+ }
467
+ const result = await runVoiceCommand({ action, options });
468
+ await outputResult(result, { ...options, output: undefined }, {
469
+ command: `voice ${action}`,
470
+ meta: { endpoint: result.endpoint?.path, kind: result.endpoint?.kind || 'voice' },
471
+ });
472
+ }
473
+
454
474
  async function handleGeneratedCommand(platform, args) {
455
475
  if (!getPlatforms().includes(platform)) {
456
476
  throw new Error(`未知平台:${platform}。可用平台:${getPlatforms().join(', ')}`);
@@ -633,6 +653,10 @@ function printHelp() {
633
653
  yuanflow-cli ai qwen3-vl-plus --prompt "总结这个视频画面" --video-url "https://example.com/video.mp4" --dry-run
634
654
  yuanflow-cli ai qwen3-vl-plus --prompt "描述本地图片" --image-file "D:\\素材\\cover.png" --dry-run
635
655
  yuanflow-cli ai qwen3-vl-plus --prompt "描述本地视频" --video-file "D:\\素材\\demo.mp4" --dry-run
656
+ yuanflow-cli voice clone --file-transfer "D:\\voice\\sample.wav" --name demo --activate --dry-run
657
+ yuanflow-cli voice list --dry-run
658
+ yuanflow-cli voice activate --voice voice_xxx --dry-run
659
+ yuanflow-cli voice replicate --text "你好" --voice voice_xxx --output "D:\\voice\\replicate.mp3" --dry-run
636
660
  yuanflow-cli ai qwen-voice-enrollment --file "D:\\voice\\sample.wav" --name demo --activate --dry-run
637
661
  yuanflow-cli ai qwen3-tts-vc-realtime-2026-01-15 --text "你好" --voice voice_xxx --output "D:\\voice\\qwen.mp3" --dry-run
638
662
  yuanflow-cli ai fun-asr --audio-url "https://example.com/audio.wav" --response-format verbose_json --dry-run