@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninkch/dsh-infinite-canvas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "无限画布(Infinite Canvas)for DeepSeek Harness:节点式创作工作室(剧本/分镜/生成/成片),内置「媒体创作」预设模式(导演第一视角 + 引导工作坊)。Version-agnostic: reads the live catalog from the installed package at load time.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"skill-pack.js",
|
|
58
58
|
"skill-pack-loader.js",
|
|
59
59
|
"index-core-skill-profile.js",
|
|
60
|
+
"combat-semantics.js",
|
|
60
61
|
"assets/canvas-director/**",
|
|
61
62
|
"skills.js",
|
|
62
63
|
"skills/**"
|
package/skill-pack.js
CHANGED
|
@@ -8,24 +8,19 @@ import {
|
|
|
8
8
|
getPackModule, packInventory, readCard, readMove, findEntry, allowedIds, readManifestRaw,
|
|
9
9
|
} from './skill-pack-loader.js';
|
|
10
10
|
import { normalizeSkillProfile } from './index-core-skill-profile.js';
|
|
11
|
+
import { detectCombatScene } from './combat-semantics.js';
|
|
11
12
|
|
|
12
13
|
/** moves 永远随 storyboard/prompt 走(运镜是这两类生成的必需品)。 */
|
|
13
14
|
const MOVES_FOR_KIND = {
|
|
14
15
|
script: [],
|
|
15
|
-
//
|
|
16
|
-
//
|
|
16
|
+
// 分镜要调度动作,运镜必备;打斗节奏卡只在**按场检测命中打斗**时跟随注入
|
|
17
|
+
// (2026-11 定稿:题材不再参与判定——选了 wuxia 的文戏场不注入,没选动作题材
|
|
18
|
+
// 但剧本明确打斗的场仍注入。combatMode on/off 用户显式覆盖优先于检测)。
|
|
17
19
|
storyboard: ['camera-moves'],
|
|
18
20
|
prompt: ['camera-moves'],
|
|
19
21
|
assets: [],
|
|
20
22
|
};
|
|
21
23
|
|
|
22
|
-
/** 动作/冲突强度高的题材 → 分镜链路额外带「打斗节奏」卡(它讲的是打斗/追逐场面的镜头组织)。 */
|
|
23
|
-
const FIGHT_RHYTHM_GENRES = new Set([
|
|
24
|
-
'action-mission', 'wuxia', 'gunstandoff', 'adventure', 'crime-police', 'hk-retro',
|
|
25
|
-
'wasteland-chase', 'mo-lei-tau', 'revenge-face-slap', 'multi-thread-caper',
|
|
26
|
-
'neon-dystopia', 'rebirth-transmigration',
|
|
27
|
-
]);
|
|
28
|
-
|
|
29
24
|
/**
|
|
30
25
|
* 构建某生成能力下的注入文本。
|
|
31
26
|
* @param {object} opts
|
|
@@ -33,6 +28,9 @@ const FIGHT_RHYTHM_GENRES = new Set([
|
|
|
33
28
|
* @param {object} opts.profile 技能配置(已归一或原始,函数内部会再归一)
|
|
34
29
|
* @param {string} opts.hereDir 插件根目录
|
|
35
30
|
* @param {boolean} opts.zh 中文
|
|
31
|
+
* @param {string} [opts.sceneText] 本场剧本文本(storyboard + combatMode 给出时才参与打斗判定)
|
|
32
|
+
* @param {string} [opts.combatMode] auto=按 sceneText 检测 / on=强制打斗 / off=强制非打斗;
|
|
33
|
+
* 不传 = 不判定、永不注入 fight-rhythm(老调用方行为不变)
|
|
36
34
|
* @returns {Promise<{text:string,bytes:number,used:Array,profile:object,inventory:object}>}
|
|
37
35
|
*/
|
|
38
36
|
export async function buildSkillPack(opts) {
|
|
@@ -78,9 +76,11 @@ export async function buildSkillPack(opts) {
|
|
|
78
76
|
// 否则四层全空的项目也会被塞进 5KB 运镜词典 —— 违反「未配置不注入」(老项目零变化)。
|
|
79
77
|
if (items.length) {
|
|
80
78
|
const moves = [...(MOVES_FOR_KIND[kind] || [])];
|
|
81
|
-
// 打斗节奏:仅分镜链路 +
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
// 打斗节奏:仅分镜链路 + **按场检测命中打斗**(combatMode on=强制开 / off=强制关 /
|
|
80
|
+
// auto=看 sceneText)。对话侧拿不到本场文本时不判定(不臆造)——老调用方行为不变。
|
|
81
|
+
if (kind === 'storyboard' && o.combatMode !== undefined) {
|
|
82
|
+
const c = detectCombatScene(String(o.sceneText || ''), { mode: o.combatMode });
|
|
83
|
+
if (c.hit) moves.push('fight-rhythm');
|
|
84
84
|
}
|
|
85
85
|
for (const mid of moves) {
|
|
86
86
|
const mv = (inv.moves || []).find((x) => x.id === mid);
|