@ninkch/dsh-infinite-canvas 0.20.4 → 0.21.0
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 -1
- package/assets/canvas-director/SKILL.md +1 -1
- package/assets/canvas-director/moves/fight-rhythm.md +10 -5
- package/assets/canvas-studio/SKILL.md +3 -0
- package/assets/director/engine.js +1193 -77
- package/client.js +4025 -200
- package/combat-semantics.js +147 -0
- package/cordis.patch.yml +9 -2
- package/docs/UI-RULES.md +3 -2
- package/docs/auto-creation-design.md +4 -3
- package/docs/director-3d.md +2 -0
- package/docs/guide.en.md +1 -1
- package/docs/guide.zh-CN.md +1 -1
- package/docs/host-agnostic.md +63 -0
- package/index.js +873 -42
- package/package.json +2 -1
- package/skill-pack.js +12 -12
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ninkch/dsh-infinite-canvas — 战斗语义纯函数(宿主侧权威,0.20.5)
|
|
3
|
+
*
|
|
4
|
+
* 与 client.js 里的同名函数**逐字同构**(漂移守卫:scripts/test-combat-semantics.mjs
|
|
5
|
+
* 用 vm 加载真实 client.js,把 window.__DSH_IC_SEGMENT__ 的导出与本模块在同一组
|
|
6
|
+
* fixtures 上断言输出一致——两端漂移 = 按场检测/契约块/因果句口径分叉,测试红必须人工对齐)。
|
|
7
|
+
*
|
|
8
|
+
* 为什么有本文件:canvas_skill_pack(对话侧)在 Host 进程里拼切片,够不着 client.js
|
|
9
|
+
* 的内部函数——按场打斗检测、契约块、词表必须有一份宿主可 import 的权威实现。
|
|
10
|
+
* 零 npm 依赖、零 DOM 依赖,Node 直接跑。
|
|
11
|
+
*
|
|
12
|
+
* 来源:_refs/LucianAIGC-打斗skill-V3.1 的战斗因果状态链(出招→接招→反击→攻守转换)
|
|
13
|
+
* 嫁接到画布 tail→prevTail→衔接块管道;动作词表反哺自 assets/director/engine.js
|
|
14
|
+
* BONE_POSES 打斗段 12 式的关节力学语义。
|
|
15
|
+
* 注入口径(用户定稿):只在真实有打斗的场注入,按场检测 + 三态覆盖,绝不按题材整表灌。
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** 打斗动作语义词表:把 3D 导演台 BONE_POSES 打斗段(assets/director/engine.js,12 式)
|
|
19
|
+
* 的关节力学翻译成「可见身体发力词」。id 与 3D 姿势 id 对齐(回归断言两表一致)。 */
|
|
20
|
+
export const COMBAT_ACTION_LEXICON = [
|
|
21
|
+
{ id: 'spear_ready', zh: '侧身沉肩、重心压到后腿、双手前后持械', en: 'side-on stance, shoulders sunk, weight on the back leg, weapon held fore-aft' },
|
|
22
|
+
{ id: 'spear_thrust', zh: '腰胯先拧、后腿蹬地发力把双手推出、前腿落成弓步', en: 'hips twist first, back leg drives the arms forward, front leg lands in a bow stance' },
|
|
23
|
+
{ id: 'palm_block', zh: '单臂斜上架、掌面外翻、上身侧倾把力卸向体侧', en: 'one arm angles up, palm turned out, torso tilts to shed the force sideways' },
|
|
24
|
+
{ id: 'dodge_lean', zh: '髋部后坐、上身后仰避开来势、双手收回护身', en: 'hips sit back, upper body leans away from the strike, hands pull in to guard' },
|
|
25
|
+
{ id: 'dash_forward', zh: '前腿蹬直、上身前压、双臂前后摆开冲刺', en: 'front leg extends, torso presses forward, arms swing in opposition while dashing' },
|
|
26
|
+
{ id: 'grit_advance', zh: '上身前探、双臂收紧、下颌压低逼近', en: 'torso leans in, arms tighten, jaw drops while closing in' },
|
|
27
|
+
{ id: 'low_sweep', zh: '深蹲转体、持械手贴地横扫、另一手撑地', en: 'deep-squat pivot, weapon hand sweeps low along the ground, other hand plants on the floor' },
|
|
28
|
+
{ id: 'spear_ground', zh: '单膝下沉、持械手直下压、上身俯冲', en: 'one knee sinks, weapon hand drives straight down, torso dives' },
|
|
29
|
+
{ id: 'crouch_low', zh: '单膝跪地、上身压到近地、持械手垂落收势', en: 'kneeling, torso pressed near the ground, weapon hand settling low' },
|
|
30
|
+
{ id: 'ult_charge', zh: '抬头挺胸、双臂外展上举、重心拔起蓄力', en: 'chest open, both arms spread and raised, weight rising as power gathers' },
|
|
31
|
+
{ id: 'hit_recoil', zh: '上身后折、双臂散开、后脚撤半步卸力', en: 'upper body folds back, arms fly open, rear foot steps back to absorb the hit' },
|
|
32
|
+
{ id: 'knockdown', zh: '全身放倒、四肢摊开、重心彻底失守', en: 'body laid flat, limbs sprawled, balance fully broken' },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
/** 按场打斗检测(纯函数):命中词 = 明确动作谓语;对白行与回忆/讲述语境排除;
|
|
36
|
+
* mode: auto=按文本判定,on=强制开,off=强制关(用户显式覆盖优先于检测)。 */
|
|
37
|
+
export function detectCombatScene(text, opts) {
|
|
38
|
+
const o = opts || {};
|
|
39
|
+
const mode = String(o.mode || o.combatMode || 'auto').toLowerCase();
|
|
40
|
+
if (mode === 'on') return { hit: true, matched: [], mode: 'on' };
|
|
41
|
+
if (mode === 'off') return { hit: false, matched: [], mode: 'off' };
|
|
42
|
+
const t = String(text || '');
|
|
43
|
+
if (!t.trim()) return { hit: false, matched: [], mode: 'auto' };
|
|
44
|
+
const HIT = new RegExp([
|
|
45
|
+
'出招', '过招', '交手', '开打', '对打', '搏杀', '厮杀', '互殴', '挥拳', '出拳', '出腿',
|
|
46
|
+
'肘击', '膝撞', '挥刀', '拔刀', '挥剑', '出剑', '劈', '砍', '斩', '刺出', '突刺', '横扫',
|
|
47
|
+
'扫堂腿', '鞭腿', '摆拳', '勾拳', '直拳', '抡', '格挡', '招架', '挡开', '架开', '闪避',
|
|
48
|
+
'躲开', '闪身', '翻滚', '侧身避开', '击中', '命中', '打中', '一拳', '一掌', '一剑', '一刀',
|
|
49
|
+
'一枪', '受击', '挨打', '被打', '击退', '击飞', '打飞', '撂倒', '打倒', '击倒', '摔倒',
|
|
50
|
+
'摔出', '撞飞', '撞碎', '掀翻', '锁喉', '擒拿', '反关节', '压制', '按倒', '反击', '还击',
|
|
51
|
+
'回击', '追击', '对轰', '火并', '枪战', '交火', '开枪', '射击', '扫射', '暗器', '箭矢',
|
|
52
|
+
'刀光', '剑气', '掌风', '拳风', '破甲', '贯穿', '震飞', '踹', '砸向',
|
|
53
|
+
].join('|'), 'g');
|
|
54
|
+
const DIALOGUE = /说道|说:|说道:|喊道|念道|心里想|暗想|旁白|字幕|歌词/;
|
|
55
|
+
const PAST = /(曾|当年|想起|回忆|听说|讲述|史料|新闻|棋局|牌局|谈判|演习|训练|梦里|梦中|传说|故事里|电影里)/;
|
|
56
|
+
const lines = t.split(/\n|。|;|;|!|?|!|\?/);
|
|
57
|
+
const matched = [];
|
|
58
|
+
for (const ln of lines) {
|
|
59
|
+
if (!ln || DIALOGUE.test(ln)) continue;
|
|
60
|
+
const ms = ln.match(HIT) || [];
|
|
61
|
+
for (const w of ms) {
|
|
62
|
+
const i = ln.indexOf(w);
|
|
63
|
+
if (PAST.test(ln.slice(Math.max(0, i - 6), i))) continue;
|
|
64
|
+
matched.push(w);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
if (matched.length >= 6) break;
|
|
68
|
+
}
|
|
69
|
+
return { hit: matched.length > 0, matched, mode: 'auto' };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** 打斗镜判定(纯函数):任一战斗字段非空即为打斗镜。 */
|
|
73
|
+
export function shotIsCombat(s) {
|
|
74
|
+
const sh = s || {};
|
|
75
|
+
return ['attack', 'reaction', 'impact', 'initiative', 'nextCombat'].some((k) => String(sh[k] || '').trim());
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** 分镜契约战斗扩展块(纯函数):命中打斗的场才注入。 */
|
|
79
|
+
export function combatContractAddendum(zh) {
|
|
80
|
+
if (!zh) {
|
|
81
|
+
return [
|
|
82
|
+
'',
|
|
83
|
+
'**[COMBAT STORYBOARD - HARD] this script contains real combat. Shots may carry combat fields (all optional; leave them empty on non-combat shots, never invent):**',
|
|
84
|
+
'- **attack**: "attacker -> target, locked body part, trajectory", e.g. "@Li@->@Shen@, locked on chest/shoulder, spear thrust from lower-left to upper-right" - an attack MUST point at a concrete opponent on screen;',
|
|
85
|
+
'- **reaction (required when attack exists)**: the opponent\'s visible block/dodge/hit action - never a statue receiving a blow, never just "blocked it";',
|
|
86
|
+
'- **impact**: contact part, force direction, knockback/imbalance and environmental damage;',
|
|
87
|
+
'- **initiative**: who holds the attack and who turns to counter at the end of this shot;',
|
|
88
|
+
'- **nextCombat**: the next shot\'s combat intent, echoing the tail\'s combat state;',
|
|
89
|
+
'- **tail gains a combat state**: write "picture tail state | combat state: who holds the attack, where the weapon/effect is, the hit party\'s state, damage residue" - cross-shot momentum rides entirely on this;',
|
|
90
|
+
'- **timeBeats on combat shots use attack-defense beats**: strike -> opponent receives/counters -> counter or displacement (each beat a visible body state);',
|
|
91
|
+
'- **action lexicon (visible body force, take directly):** ' + COMBAT_ACTION_LEXICON.map((x) => x.en).join('; ') + ';',
|
|
92
|
+
'- **never**: move names ("Crouching Tiger style"), summary verbs ("releases a skill / launches an attack / energy explodes"), unexplained teleports, glide drifting, statue trading; write visible body-force chains + opponent response + physical results;',
|
|
93
|
+
'- for materialized-technique shots write vfx as a picture that could be a keyframe still; when expanding prefer keyframe-then-video (hard first frame).',
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
return [
|
|
97
|
+
'',
|
|
98
|
+
'**【打斗分镜·战斗因果(本剧本命中打斗,以下为硬规则)】分镜镜头可携带战斗字段(全部可选;非打斗镜一律留空,绝不臆造):**',
|
|
99
|
+
'- **attack(攻击)**:「攻击者→目标,锁定部位,轨迹方向」,如「@李寒@→@沈铁@,锁定胸肩,自左下向右上横枪突刺」——**攻击必须指向画面里的具体对手**,写明轨迹与锁定部位;',
|
|
100
|
+
'- **reaction(对手回应;有 attack 必写)**:对手的可见防御/闪避/受击动作(如「@沈铁@ 单臂斜上架、掌面外翻、上身侧倾卸力」)——**禁止站桩接招、禁止只写「挡下了」**;',
|
|
101
|
+
'- **impact(接触与受力)**:接触部位、受力方向、击退/失衡与环境破坏(如「枪尖擦肩、沈铁后撤半步、身后木栏断裂」);',
|
|
102
|
+
'- **initiative(攻守归属)**:本镜结束时谁持攻、谁转入反击;',
|
|
103
|
+
'- **nextCombat(下一镜战斗意图)**:如「@沈铁@ 借卸力之势低身横扫」——与 tail 的战斗态呼应;',
|
|
104
|
+
'- **tail 追加战斗态**:接点尾态写成「画面尾态|战斗态:攻势在谁、武器/技能位于何处、受击者状态、破坏残留」——**跨镜攻势全靠它传递**;',
|
|
105
|
+
'- **timeBeats 打斗镜用攻防三拍**:出招 → 对手接招/受击 → 反击或位移(每拍写可见身体状态);',
|
|
106
|
+
'- **动作词表(可见身体发力,直接取用)**:' + COMBAT_ACTION_LEXICON.map((x) => x.zh).join(';') + ';',
|
|
107
|
+
'- **禁止**:招式名(「回风落雁式」)、概括词(「释放技能/发动攻击/能量爆炸/华丽连招」)、无因瞬移、滑步漂移、站桩对轰;写**可见的身体发力链 + 对手回应 + 物理结果**;',
|
|
108
|
+
'- 具象化招式镜(能量成形/武器光效)的 vfx 写成可直接出设定图的画面,铺开时优先「先出关键帧设定图 → 图生视频(hard 首帧)」。',
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** 逐镜因果句(纯函数):视频提示词编译时追加到打斗镜。只拼存在的字段;空镜返回 ''。 */
|
|
113
|
+
export function combatCausalityText(s, zh) {
|
|
114
|
+
const sh = s || {};
|
|
115
|
+
if (!shotIsCombat(sh)) return '';
|
|
116
|
+
const g = (k) => String(sh[k] || '').trim();
|
|
117
|
+
const bits = [];
|
|
118
|
+
if (zh) {
|
|
119
|
+
if (g('attack')) bits.push('攻击(必须朝向该对手):' + g('attack'));
|
|
120
|
+
if (g('reaction')) bits.push('对手回应(必须演出):' + g('reaction'));
|
|
121
|
+
if (g('impact')) bits.push('接触与受力:' + g('impact'));
|
|
122
|
+
if (g('initiative')) bits.push('攻守归属:' + g('initiative'));
|
|
123
|
+
if (g('nextCombat')) bits.push('下一镜从该攻势继续:' + g('nextCombat'));
|
|
124
|
+
return bits.length ? '【打斗因果】' + bits.join(';') : '';
|
|
125
|
+
}
|
|
126
|
+
if (g('attack')) bits.push('attack (must point at that opponent): ' + g('attack'));
|
|
127
|
+
if (g('reaction')) bits.push('opponent response (must be performed): ' + g('reaction'));
|
|
128
|
+
if (g('impact')) bits.push('contact & force: ' + g('impact'));
|
|
129
|
+
if (g('initiative')) bits.push('initiative: ' + g('initiative'));
|
|
130
|
+
if (g('nextCombat')) bits.push('next shot continues from this momentum: ' + g('nextCombat'));
|
|
131
|
+
return bits.length ? '[COMBAT CAUSALITY] ' + bits.join('; ') : '';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** 打斗镜几何最小校验(纯函数):机械可判的四条检查,失败产生可见告警,绝不拦截生成。 */
|
|
135
|
+
export function validateCombatGeometry(s, zh) {
|
|
136
|
+
const sh = s || {};
|
|
137
|
+
const out = [];
|
|
138
|
+
const g = (k) => String(sh[k] || '').trim();
|
|
139
|
+
const pre = String(sh.title || '').trim() ? String(sh.title).trim() + ' · ' : '';
|
|
140
|
+
if (!shotIsCombat(sh)) return out;
|
|
141
|
+
if (g('attack') && !g('reaction')) out.push(zh ? pre + '有攻击但无对手回应:每次攻击必须写对手的可见防御/闪避/受击(禁站桩)' : pre + 'attack without reaction: every attack needs a visible response (no statues)');
|
|
142
|
+
if (g('attack') && !/→|@/.test(g('attack'))) out.push(zh ? pre + '攻击未指向具体对手(缺少 @对手名@ 或 →)' : pre + 'attack lacks an explicit target (@name@ or ->)');
|
|
143
|
+
const vis = String(sh.visual || '');
|
|
144
|
+
if (/背对|背面|背影/.test(vis) && /表情|眼神|眼眸|面容|脸上的|嘴角/.test(vis)) out.push(zh ? pre + '可见性矛盾:背对镜头却写了表情/眼神' : pre + 'visibility conflict: back to camera yet describing facial expression');
|
|
145
|
+
if (g('attack') && g('tail') && !/战斗态|combat state/i.test(g('tail'))) out.push(zh ? pre + 'tail 建议补「|战斗态:…」(跨镜攻势靠它传递)' : pre + 'tail should append "| combat state: ..." (cross-shot momentum rides on it)');
|
|
146
|
+
return out;
|
|
147
|
+
}
|
package/cordis.patch.yml
CHANGED
|
@@ -106,6 +106,11 @@
|
|
|
106
106
|
name: '@deepseek-ai/dsh-tool-skill'
|
|
107
107
|
- id: media-studio-skills
|
|
108
108
|
name: '@ninkch/dsh-infinite-canvas/skills'
|
|
109
|
+
# 【2026-11-11 修复】本行已永久禁用:主包在 profile bundle 层挂载后,preset 再挂
|
|
110
|
+
# 同包子路径 = 同一物理包重复激活 → media-studio 预设「加载失败」(broken)。
|
|
111
|
+
# director-workshop 技能已改由 bundle 层 registerCanvasSkill 注册(index.js),
|
|
112
|
+
# 本行保留仅为避免旧 profile 补丁残留时的兼容占位,不得重新启用。
|
|
113
|
+
disabled: true
|
|
109
114
|
config: {}
|
|
110
115
|
- id: command-goal
|
|
111
116
|
name: '@deepseek-ai/dsh-command-goal'
|
|
@@ -157,8 +162,10 @@
|
|
|
157
162
|
config:
|
|
158
163
|
- id: tool-subagent-control
|
|
159
164
|
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
# 【2026-11-11 修复】主入口已统一注册 send_message / interrupt_agent / list_agents
|
|
166
|
+
# 三个工具(0.2.2-rc.1 exports 只有 ./ ),旧的 ./list-agents 子路径行
|
|
167
|
+
# (tool-subagent-list-agents)解析不到模块 → auditRows 报 never started →
|
|
168
|
+
# 整个预设 broken。本注释替代已删除的那一行,勿再添加子路径行。
|
|
162
169
|
- id: tool-subagent
|
|
163
170
|
name: '@deepseek-ai/dsh-tool-subagent'
|
|
164
171
|
config:
|
package/docs/UI-RULES.md
CHANGED
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
10. 图标列**不得有任何外框**:无 `border`、无 `background`、无 `box-shadow`、无 `border-radius`(不要卡片、不要描边、不要底色)。
|
|
24
24
|
11. 图标列**垂直居中悬浮在左栏中间**,**不撑满上下边**。正确实现是**两层结构**:外层 `.dshic-rail` 只负责占位(宽 46px、透明、`position:relative`),内层 `.dshic-rail-inner` 用 `position:absolute; top:50%; transform:translateY(-50%)` 居中。**不要用 `align-self:center` + `margin:auto 0`**——它会被父级 `align-items:stretch` 拉成整列高,看起来像"满高白色卡片",这是历史上反复复发的问题(第三次返工才根治)。
|
|
25
|
-
12. 图标顺序:文本 / 剧本 / 分镜表 / 图片 / 视频 / 成片 / 资产 / 设定集 /
|
|
26
|
-
-
|
|
25
|
+
12. 图标顺序:文本 / 剧本 / 分镜表 / 图片 / 视频 / 音频 / 成片 / 资产 / 设定集 / 角色库 / 工作流 / 记忆 / **3D-BOX** / 运行工作流;hover 才有轻量反馈。
|
|
26
|
+
- 前七个是**节点类型**,资产/设定集/角色库/工作流/记忆是**工具入口**,3D-BOX 是**产品入口**,运行工作流是**动作**——三组分隔符 `dshic-rail-sep` 把它们分开。
|
|
27
|
+
- **3D-BOX 只保留一个入口**(`data-action: 'open-3dbox-home'`,摄像机图标):先进入 3D-BOX 库(新建/我的 3D-BOX),再由卡片进入舞台;不要再加第二个「导演台」入口。
|
|
27
28
|
- `scripts/test-panel-layout.mjs` 对整列 `data-action` 序列做严格断言(顺序错一个就红),改顺序必须同时改该测试与本条。
|
|
28
29
|
|
|
29
30
|
## 四、项目下拉(左上角)
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
## 1. 当前实现(进程内执行器)
|
|
16
16
|
|
|
17
17
|
**入口**(三处,同一引擎):
|
|
18
|
-
-
|
|
19
|
-
-
|
|
18
|
+
- 设置卡「自动创作(实验)」:**只有开关**(0.21 起动作区迁出);
|
|
19
|
+
- 创作台(左栏图标,`ProductionConsole`):brief/启动、实时阶段与预算单、分场勾选生成、批准/生成/中止;批量执行同面板页签;
|
|
20
|
+
- 对话工具:`canvas_auto_status` / `canvas_auto_start` / `canvas_auto_budget` / `canvas_auto_generate` / `canvas_auto_abort`,单价设置 `canvas_production_set_price`;
|
|
20
21
|
- 人格分支:`canvas_auto_status.enabled=true` 时禁止提问,必须同一轮 `canvas_auto_start`。
|
|
21
22
|
|
|
22
23
|
**免费段**(`autoRoom`,五轮角色提示词 + 落盘 + 生成编排):
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
| 编剧室/付费段 | `index.js`(`autoRoom`/`autoPaid`/`AUTO_RUNS`) | 轮次编排、讨论落盘、生成编排 |
|
|
47
48
|
| RPC | `autoModeGet/Set`、`autoStart/Status/Abort`、`autoQuote/Approve/Generate` | 设置卡与工具共用 |
|
|
48
49
|
| 工具 | `canvas_auto_*` 五个 | 对话智能体的入口 |
|
|
49
|
-
| 客户端 | `AutoModeCard
|
|
50
|
+
| 客户端 | `AutoModeCard`(设置卡,只有开关)+ `ProductionConsole`/`AutoStudioPanel`(左栏创作台)+ `ProjectsTab` 阶段行 | 开关;brief/预算/批准/生成/中止(创作台) |
|
|
50
51
|
|
|
51
52
|
## 3. 测试
|
|
52
53
|
|
package/docs/director-3d.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 3D 导演台技术方案(Infinite Canvas)
|
|
2
2
|
|
|
3
|
+
> **0.21.0 入口变更**:用户界面统一为 **3D-BOX**,左侧只保留一个 `open-3dbox-home` 入口(先到 3D-BOX 库,再由卡片进舞台);本文中的 `open-director` 为历史入口,内部引擎与 `canvas_director_stage` 兼容不变。
|
|
4
|
+
>
|
|
3
5
|
> 状态:**决策文档**(只定方案与验收判据,不含实现代码)
|
|
4
6
|
> 范围:无限画布插件的「3D 导演台」功能——左侧图标列入口、摆位取景、截图当镜头首帧、接视频生成
|
|
5
7
|
> 代码快照:2026-10-23,`client.js` 15974 行 / `index.js` 3984 行;并行开发会让行号漂移,**以标识符检索为准**(末尾「引用自查」给出当次实测行号)
|
package/docs/guide.en.md
CHANGED
|
@@ -132,7 +132,7 @@ canvas: project card script node text+storyboard ×N ref image nodes
|
|
|
132
132
|
|
|
133
133
|
### 3.1 Auto creation (experimental) — one sentence to storyboards + budget
|
|
134
134
|
|
|
135
|
-
Settings → 「自动创作(实验)」→ on.
|
|
135
|
+
Settings → 「自动创作(实验)」→ on (the switch is all Settings keeps). Start from the **Production console** (left icon rail; auto creation + batch run in one panel) or one sentence in the chat (e.g. 拍个悬疑短剧,快递员每天送的信来自未来) — the writers room runs: research → two independent pitches → cross-critique → producer decision → bible → script → per-scene storyboards → **budget sheet**. No questions are asked in this mode; the transcript lands on the canvas (编剧室会议 node). The console shows the live phase/budget, lets you tick scenes to generate, and handles approve/generate/abort; or use `canvas_auto_budget` + `canvas_auto_generate` from chat. The video unit price is set in chat (`canvas_production_set_price`, e.g. "set video price to 0.5 yuan/second") and shared by the auto budget sheet and batch estimates. All gates still apply (bible-first, storyboard quality…), and the canvas must stay open during generation — the runner opens it for you and reports honestly if it cannot.
|
|
136
136
|
|
|
137
137
|
### 4. Manual fine-tuning: nodes are the workbench
|
|
138
138
|
|
package/docs/guide.zh-CN.md
CHANGED
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
|
|
137
137
|
### 3.1 自动创作(实验)——一句话到分镜 + 预算单
|
|
138
138
|
|
|
139
|
-
设置 → 「自动创作(实验)」→
|
|
139
|
+
设置 → 「自动创作(实验)」→ 开启(设置里**只有这个开关**)。启动入口有两个:左侧图标栏的「创作台」(自动创作 + 批量执行统一面板),或在对话里说一句话(例如:拍个悬疑短剧,快递员每天送的信来自未来)即启动编剧室:调研 → 编剧A/B 独立提案 → 互评 → 监制决策 → 设定集 → 剧本 → 逐场分镜表 → **预算单**。该模式**不会向用户提问**;讨论记录落在画布「编剧室会议」节点。创作台里可以看实时阶段/预算单、按场勾选要生成的部分;预算单批准一次(创作台,或对话里 `canvas_auto_budget` + `canvas_auto_generate`)后逐分镜表生成视频,最后建成片节点。视频每秒单价在**对话**里设置(`canvas_production_set_price`,如"设置视频单价 0.5 元/秒"),自动预算与批量执行估算共用。所有闸门照常生效(设定集先行、分镜质量……);生成期间画布需保持打开——runner 会替你自动打开,打不开时如实汇报。
|
|
140
140
|
|
|
141
141
|
---
|
|
142
142
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# 宿主无关化(Host-agnostic)
|
|
2
|
+
|
|
3
|
+
> 本文说明 0.21.0 的边界:**核心(core)不绑定 DeepSeek Harness**;独立画布服务 / MCP / CLI 由
|
|
4
|
+
> `multi-host-adapters` 分支承载,主 npm 包不重复打包一套 server。
|
|
5
|
+
|
|
6
|
+
## 1. Core 契约(本仓 `index.js`)
|
|
7
|
+
|
|
8
|
+
`apply(ctx)` 只强制依赖三个成员:
|
|
9
|
+
|
|
10
|
+
| 成员 | 用途 | 缺失时 |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| `ctx.effect(fn)` | 同步执行注册并收集清理函数 | 必需 |
|
|
13
|
+
| `ctx.tools.register(def)` | 注册 `canvas_*` 工具(当前 34 个) | 有守卫,缺失则跳过工具面 |
|
|
14
|
+
| `ctx.webServer.register(route)` | 注册 9 条 `/infinite-canvas/api/*` 路由 | 必需 |
|
|
15
|
+
|
|
16
|
+
可选增强服务(缺失只降级,不抛错):
|
|
17
|
+
|
|
18
|
+
- `ctx.get('llm')`:文本模型;缺失时相关 RPC 返回「llm 服务不可用」。
|
|
19
|
+
- `ctx.get('skills')`:技能包;缺失时跳过技能注册。
|
|
20
|
+
- `ctx.get('attachments')` / `ctx.attachments`:视觉拉片的图片附件;缺失时拉片明确报错。
|
|
21
|
+
- `ctx.get('workspaceRegistry')`:工作区项目;缺失时 watcher 跳过。
|
|
22
|
+
- `ctx.get('sessionController')` / `ctx.get('agents')`:自动创作多 Agent 探针;缺失时 `multiAgent:false`。
|
|
23
|
+
|
|
24
|
+
自检:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
node scripts/test-host-contract.mjs
|
|
28
|
+
# ✓ 宿主契约通过(最小 ctx 同步注册 34 工具 / 9 路由;增强服务缺失可降级)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 2. 独立画布服务 / MCP / CLI
|
|
32
|
+
|
|
33
|
+
实现位于 **`multi-host-adapters` 分支(0.3.3)**,运行时零 npm 依赖:
|
|
34
|
+
|
|
35
|
+
| 文件 | 作用 |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `adapters/shared/host-adapter.cjs` | 伪造最小 ctx,加载 core,收集 tools / routes |
|
|
38
|
+
| `adapters/shared/canvas-web.cjs` | 本地 HTTP 画布服务(React UMD 壳 + `/api/rpc`) |
|
|
39
|
+
| `adapters/shared/canvas-mcp.cjs` | MCP stdio server(initialize / tools/list / tools/call) |
|
|
40
|
+
| `adapters/shared/HOST-CONTRACT.md` | 逐条依赖面与实测契约 |
|
|
41
|
+
|
|
42
|
+
开发态启动(core 指向本仓):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
node adapters/shared/canvas-web.cjs --core-dir <path-to-dsh-infinite_canvas> --port 3210 --open
|
|
46
|
+
node adapters/shared/canvas-mcp.cjs --core-dir <path-to-dsh-infinite_canvas> --port 3210
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
已验证:该 adapter 对 **0.21.0 dev 核心**可同步收集 **34 个工具 / 9 条路由**;画布 UI 由
|
|
50
|
+
`canvas-web.cjs` 自带,core 不注册 HTML 面板路由。
|
|
51
|
+
|
|
52
|
+
## 3. 分发边界
|
|
53
|
+
|
|
54
|
+
- **主 npm 包**(`@ninkch/dsh-infinite-canvas`):Harness 插件本体,轻量、无 server/vendor。
|
|
55
|
+
- **adapter 发行物**(VSIX / Qoder / WorkBuddy zip):随 `multi-host-adapters` 分支单独构建,
|
|
56
|
+
内置 core 副本与 React vendor。
|
|
57
|
+
- 两条线共享同一套数据根与本地成果物;Agent 只负责传话/取件,画布资产仍在用户本地。
|
|
58
|
+
|
|
59
|
+
## 4. 为什么不把 server 搬进主包
|
|
60
|
+
|
|
61
|
+
1. 主包已由 Harness 提供面板与 webServer;再带一套 HTTP server 会造成双实例/端口冲突。
|
|
62
|
+
2. adapter 需要自带 React UMD 与宿主探针,体量属于独立发行物。
|
|
63
|
+
3. 分支已通过独立回归(`test-adapters-*`);主包只维护 core 契约,避免两套实现漂移。
|