dsh-workrally 0.2.5 → 0.3.1

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 (47) hide show
  1. package/README.md +6 -3
  2. package/lib/account.js +18 -9
  3. package/lib/client.js +4063 -408
  4. package/lib/easy-writing-skills/book-creation.md +90 -0
  5. package/lib/easy-writing-skills/novel-writing.md +8 -0
  6. package/lib/easy-writing-skills/story-development.md +41 -0
  7. package/lib/easy-writing-skills/title-and-intro.md +67 -0
  8. package/lib/easyWriting.js +72 -0
  9. package/lib/gallery.js +110 -15
  10. package/lib/index.js +188 -20
  11. package/lib/manju-skills/chongsheng-manju/SKILL.md +311 -0
  12. package/lib/manju-skills/chuanyue-manju/SKILL.md +309 -0
  13. package/lib/manju-skills/dushi-manju/SKILL.md +311 -0
  14. package/lib/manju-skills/gongdou-manju/SKILL.md +312 -0
  15. package/lib/manju-skills/jiating-manju/SKILL.md +311 -0
  16. package/lib/manju-skills/minsu-manju/SKILL.md +313 -0
  17. package/lib/manju-skills/moshi-manju/SKILL.md +313 -0
  18. package/lib/manju-skills/niandai-manju/SKILL.md +311 -0
  19. package/lib/manju-skills/quanmou-manju/SKILL.md +311 -0
  20. package/lib/manju-skills/shangzhan-manju/SKILL.md +311 -0
  21. package/lib/manju-skills/tianchong-manju/SKILL.md +310 -0
  22. package/lib/manju-skills/wuxia-manju/SKILL.md +308 -0
  23. package/lib/manju-skills/xiaoyuan-manju/SKILL.md +312 -0
  24. package/lib/manju-skills/xihuan-manju/SKILL.md +312 -0
  25. package/lib/manju-skills/xingji-manju/SKILL.md +312 -0
  26. package/lib/manju-skills/xitong-manju/SKILL.md +310 -0
  27. package/lib/manju-skills/xuanhuan-manju/SKILL.md +306 -0
  28. package/lib/manju-skills/xuanyi-manju/SKILL.md +315 -0
  29. package/lib/manju-skills/yule-manju/SKILL.md +310 -0
  30. package/lib/manju-skills/zhaidou-manju/SKILL.md +311 -0
  31. package/lib/manju-skills/zhongtian-manju/SKILL.md +310 -0
  32. package/lib/manjuSkills.js +69 -0
  33. package/lib/mcp.js +402 -0
  34. package/lib/nvzhuang/anime.json +1 -0
  35. package/lib/nvzhuang/portrait.json +1 -0
  36. package/lib/nvzhuang/real.json +1 -0
  37. package/lib/nvzhuang.js +184 -0
  38. package/lib/openmotion-skills/openmotion/SKILL.md +33 -0
  39. package/lib/openmotion-skills/openmotion-director/SKILL.md +67 -0
  40. package/lib/openmotion-skills/openmotion-media/SKILL.md +42 -0
  41. package/lib/openmotion-skills/openmotion-production/SKILL.md +48 -0
  42. package/lib/openmotion-skills/openmotion-recreate/SKILL.md +91 -0
  43. package/lib/openmotion-skills/openmotion-template-to-video/SKILL.md +72 -0
  44. package/lib/openmotion-skills/openmotion-video-to-template/SKILL.md +44 -0
  45. package/lib/openmotion.js +128 -0
  46. package/lib/plaza.js +2 -0
  47. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: openmotion-video-to-template
3
+ description: Rebuild a reference video (pure motion graphics or mixed media with products, people, or audio) into a reusable editable OpenMotion template with source files, assets, preview, editing guide, and folder or ZIP delivery. Use only when a reusable template is requested; use openmotion-recreate for a single film recreation, openmotion-template-to-video for adapting an existing template, and openmotion-director for original videos.
4
+ ---
5
+
6
+ # OpenMotion Video to Template
7
+
8
+ This is the openmotion-video-to-template production entry, selected for a requested reusable template. Read [shared context](../openmotion-production/references/context.md) for the current scope and reuse available bodies without returning to the router. MCP-only clients use resources/read `openmotion://workflow/video-to-template/start` for this same file; follow supporting references only when needed. Revisions to an existing template draft use the [shared edit workflow](../openmotion-production/references/edit.md). A request to recreate a finished video without a reusable-template deliverable stays with [openmotion-recreate](../openmotion-recreate/SKILL.md).
9
+
10
+ Deliver a reusable native HyperFrames project with local assets and an actual preview. Keep controlled text, brand overlays, graphics and timing editable. When reference footage, product imagery or sound carries part of the film, reconstruct that role as a separate, replaceable asset in the same timeline.
11
+
12
+ Closely match the reference's pictures, composition, motion and pacing while preserving editability. Reproduce texture, depth and lighting present in the reference; do not add decorative effects merely to make it look more polished.
13
+
14
+ When a reference comes with change requests, deliver the faithful template first and apply those changes separately through `openmotion-template-to-video`; do not mix a remix into the faithful baseline.
15
+
16
+ Follow the [shared material policy](../openmotion-production/references/materials.md). Use the [mixed-media workflow](references/rebuild.md#rebuild-mixed-media-shots) only when images, footage or audio need to be sourced or recreated. Code-only Motion never enters provider setup or generation.
17
+
18
+ ## Understand the requested result
19
+
20
+ Obtain and read the whole reference through the shared [reference reading and measurement](../openmotion-production/references/reference-video.md) method before choosing implementation. Use its local sound checks when the active model's audio input is unavailable or unknown. Preserve the link's URL and the local copy's checksum.
21
+
22
+ Preserve the reference's content, wording, brand, composition and motion as they are; do not pre-substitute them. Content replacement happens later with `openmotion-template-to-video`.
23
+
24
+ Work independently on ordinary creative decisions. Where the reference is ambiguous, choose the most faithful reasonable option and record the choice and trade-off in `TEMPLATE.md`. If generation needs spend consent not covered by the task, follow the media Skill for the planned batch. If an input cannot be obtained or decoded, report the specific blocker.
25
+
26
+ ## Choose an editable representation
27
+
28
+ Apply the shared [editable representation](../openmotion-production/references/reference-video.md#choose-an-editable-representation) and [text and fonts](../openmotion-production/references/reference-video.md#text-and-fonts) rules. A template's content stays editable for later replacement: keep wording, brand, images and named objects easy to locate, declare common edits as root variables, and make distinctive lettering settable for new words. Record font substitutions and other approximations in `TEMPLATE.md`.
29
+
30
+ ## Make and check the work
31
+
32
+ Read the pinned native authoring guide and [runtime adapter](../openmotion-production/references/production.md). For a portable folder, create a separate working directory and use the pinned native CLI; this requires host filesystem/shell capabilities. For a managed project, reuse its projectId or create a carrier with `openmotion_create_project`: use projectType=reference_video with an actual HTTP(S) referenceUrl or known referenceVideoId; for a local video use projectType=natural_language and record the local reference/checksum in requirements. Include requestId, title and requirements. Creation records the source but does not analyze or recreate the video. Read sources/current versions with `openmotion_get_project`, import supplied local files with `openmotion_import_assets` or adopt a selected workspace asset version as described by the [media Skill](../openmotion-media/SKILL.md), and save native text through `openmotion_edit_project` with projectId, requestId, expectedRevision and expectedVersionId. Read the new version after imports or GUI changes. Do not assume a catalog ID exists, write reserved metadata, or bypass managed-project version protection with direct filesystem writes.
33
+
34
+ Use the shared [runtime and media-tool paths](../openmotion-production/references/reference-video.md#locate-the-pinned-cli-and-media-tools) to read the guide and locate the CLI. Do not call `openmotion_open_preview` just to obtain paths: it runs lint and selects an existing project in Studio. Initial template packaging can run in the background; follow-up content edits apply the shared [continuing-edit preview rules](../openmotion-production/references/native.md#continuing-edits), with explicit background requests taking precedence. Use host capabilities to obtain and analyze video, make the comparison, and package an independent folder. Report a concrete capability gap if any of these steps is unavailable.
35
+
36
+ Use the shared [measurements](../openmotion-production/references/reference-video.md#measure-specific-questions) for questions that need exact timing, dimensions or layout, and [record them](references/measure.md) in `TEMPLATE.md`. Use [rebuild guidance](references/rebuild.md) for grouping, media and edit dependencies. For an unfamiliar or difficult visual system, a short representative segment can establish a useful approach before expanding the film; this is advice, not a mandatory extra stage.
37
+
38
+ Compare actual frames with the reference while developing, and apply the shared [fidelity checks](../openmotion-production/references/reference-video.md#check-fidelity-and-edit-dependencies): bounded repair, hard cuts and edit dependencies. Record an issue that bounded repair does not resolve in `TEMPLATE.md` and move on.
39
+
40
+ Finish with [technical checks and packaging](references/verify.md) and the [portable project contract](../openmotion-production/references/portable-project.md). Deliver the complete folder/ZIP, preview and cover, with one `TEMPLATE.md` inside. Do not require registration, a template ID or a custom content schema. Keep the reply short and in the user's words: absolute-path links to the preview, the template and the original-versus-template comparison; what can be changed; and where it still differs from the original. Technical check results stay in `TEMPLATE.md`; mention one in the reply only when it affects the user, such as a silent tail or a substituted font. Humans decide visual acceptance. Do not reject or repeatedly rework a deliverable solely because of a similarity score or your own taste.
41
+
42
+ Keep two checks separate: reference-to-rebuild uses diagnostics and human visual judgment; the package check confirms the unpacked ZIP renders elsewhere without missing files or creator-machine paths, with the frame rate, frame count and duration of `preview.mp4`. It is not a pixel comparison; do not spend repair rounds on invisible differences.
43
+
44
+ [Guidance sources](references/rule-sources.md) separates reviewed material, observed evidence and advice. Do not treat one sample or another product's documentation as a universal effect guarantee.
@@ -0,0 +1,128 @@
1
+ /** OpenMotion(nexu-io/openmotion)宿主适配:随包 7 套官方 Skill 读取 + 本地 Studio(127.0.0.1:4173)健康探测。 */
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { dirname, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const HERE = dirname(fileURLToPath(import.meta.url));
7
+ const DEFAULT_DIR = existsSync(join(HERE, 'openmotion-skills'))
8
+ ? join(HERE, 'openmotion-skills')
9
+ : join(HERE, '..', 'assets', 'openmotion-skills');
10
+
11
+ export const OPENMOTION_REPO = 'https://github.com/nexu-io/openmotion';
12
+ export const OPENMOTION_DEFAULT_PORT = 4173;
13
+
14
+ export const OPENMOTION_SKILLS = [
15
+ {
16
+ id: 'openmotion-recreate',
17
+ title: '参考片复刻',
18
+ titleEn: 'Recreate Reference',
19
+ tag: '核心',
20
+ summary: '粘贴参考视频链接或本地路径,用自有品牌视觉与文案 1:1 重建可编辑 OpenMotion 工程。',
21
+ },
22
+ {
23
+ id: 'openmotion-director',
24
+ title: '原创动效导演',
25
+ titleEn: 'Original Director',
26
+ tag: '原创',
27
+ summary: '从零策划品牌短片、产品演示、动效解说与 Motion.md 镜头结构,配画面、字幕与配乐。',
28
+ },
29
+ {
30
+ id: 'openmotion-template-to-video',
31
+ title: '模板改编出片',
32
+ titleEn: 'Template to Video',
33
+ tag: '模板',
34
+ summary: '浏览并套用 OpenMotion 可编辑动效模板,保留节奏动效并替换为自己的文案与素材。',
35
+ },
36
+ {
37
+ id: 'openmotion-video-to-template',
38
+ title: '视频转可复用模板',
39
+ titleEn: 'Video to Template',
40
+ tag: '沉淀',
41
+ summary: '把参考视频拆解重构为参数化 HyperFrames 模板,输出完整工程与复用指南。',
42
+ },
43
+ {
44
+ id: 'openmotion-production',
45
+ title: '时间轴精修与导出 MP4',
46
+ titleEn: 'Edit & Export MP4',
47
+ tag: '交付',
48
+ summary: '对已有 OpenMotion 工程做镜头微调、素材/配音替换、Studio 预览排查与 MP4 渲染交付。',
49
+ },
50
+ {
51
+ id: 'openmotion-media',
52
+ title: '单素材生成(图/视/音)',
53
+ titleEn: 'Media Assets',
54
+ tag: '素材',
55
+ summary: '单独生成或补齐镜头图像、视频片段、旁白语音与配乐素材,无缝回填时间轴。',
56
+ },
57
+ {
58
+ id: 'openmotion',
59
+ title: 'OpenMotion 总控与安装引导',
60
+ titleEn: 'Setup & Router',
61
+ tag: '入口',
62
+ summary: '连接或安装本地 OpenMotion Studio + MCP 服务,检测环境与组件就绪状态。',
63
+ },
64
+ ];
65
+
66
+ const BY_ID = new Map(OPENMOTION_SKILLS.map(item => [item.id, item]));
67
+ const skillCache = new Map();
68
+
69
+ const stripFrontmatter = (markdown) => String(markdown || '').replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n*/, '').trim();
70
+
71
+ export const normalizeOpenMotionPort = (raw) => {
72
+ const num = Number(raw);
73
+ if (!Number.isInteger(num) || num < 1024 || num > 65526) return OPENMOTION_DEFAULT_PORT;
74
+ return num;
75
+ };
76
+
77
+ export const listOpenMotionSkills = () => OPENMOTION_SKILLS;
78
+
79
+ export const readOpenMotionSkill = (id, baseDir = DEFAULT_DIR) => {
80
+ const meta = BY_ID.get(String(id || '').trim());
81
+ if (!meta) return null;
82
+ const key = `${baseDir}::${meta.id}`;
83
+ if (skillCache.has(key)) return skillCache.get(key);
84
+ const file = join(baseDir, meta.id, 'SKILL.md');
85
+ if (!existsSync(file)) return null;
86
+ const raw = readFileSync(file, 'utf8');
87
+ const content = stripFrontmatter(raw);
88
+ const result = {
89
+ ...meta,
90
+ raw,
91
+ content,
92
+ chars: content.length,
93
+ repoUrl: `${OPENMOTION_REPO}/blob/main/skills/${meta.id}/SKILL.md`,
94
+ };
95
+ skillCache.set(key, result);
96
+ return result;
97
+ };
98
+
99
+ /** 仅向本机 loopback 探测 OpenMotion Studio 健康接口,拒绝任何非本机主机。 */
100
+ export const probeOpenMotionStudio = async (rawPort = OPENMOTION_DEFAULT_PORT, fetchImpl = fetch) => {
101
+ const port = normalizeOpenMotionPort(rawPort);
102
+ const studioUrl = `http://127.0.0.1:${port}/`;
103
+ try {
104
+ const response = await fetchImpl(`http://127.0.0.1:${port}/api/health`, {
105
+ signal: AbortSignal.timeout(1200),
106
+ });
107
+ if (!response?.ok) {
108
+ return { online: false, port, studioUrl, reason: `HTTP ${response?.status || 0}` };
109
+ }
110
+ const health = await response.json().catch(() => null);
111
+ if (health && health.service === 'motion-preview') {
112
+ return {
113
+ online: true,
114
+ port,
115
+ studioUrl: typeof health.studioUrl === 'string' && health.studioUrl.startsWith('http://127.0.0.1:')
116
+ ? health.studioUrl
117
+ : studioUrl,
118
+ version: String(health.version || ''),
119
+ ffmpeg: Boolean(health.ffmpeg),
120
+ ready: Boolean(health.ready),
121
+ dataDirectory: String(health.dataDirectory || ''),
122
+ };
123
+ }
124
+ return { online: false, port, studioUrl, reason: '端口已被其他本地服务占用' };
125
+ } catch {
126
+ return { online: false, port, studioUrl, reason: '本地 Studio 未启动' };
127
+ }
128
+ };
package/lib/plaza.js CHANGED
@@ -87,6 +87,8 @@ export const parseCollections = (rows) => {
87
87
  if (!raw || typeof raw !== 'object') continue;
88
88
  const id = readText(raw.id || raw._id);
89
89
  const title = readText(raw.title);
90
+ // This collection is intentionally excluded from the DSH plugin.
91
+ if (id === '3zsszfod4t' || title === '代码搓片') continue;
90
92
  const desc = readText(raw.desc);
91
93
  const rawItems = parseJson(raw.items);
92
94
  const list = Array.isArray(rawItems) ? rawItems : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workrally",
3
- "version": "0.2.5",
3
+ "version": "0.3.1",
4
4
  "description": "WorkRally 创作工作台:原生 MCP、按需创作技能、任务追踪与会话素材。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",