@ninkch/dsh-infinite-canvas 0.19.16 → 0.19.18
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/client.js +729 -121
- package/docs/UI-RULES.md +2 -0
- package/index.js +129 -18
- package/package.json +1 -1
package/docs/UI-RULES.md
CHANGED
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
41. **设置页技能增强 = 单一「专家」下拉**:专家 = 一套技能组(`persona` + `skills`);选项**只列本插件专家**(当前仅「通用专家 / General expert」,默认值 `general`),**禁止列举 Harness 全部技能**(artcraft-* / noteboard-* / office-* / diagnose-* 等一律不得出现);旧设置 `skillScript` / `skillStoryboard` 迁移到 `general`,缺字段/非法值回退 `general` 且不报错。
|
|
69
69
|
42. **画布性能**:视频节点空闲时只渲染静态 poster(不挂 `<video>`,播放时才挂、暂停/播完卸载),有 poster 即视为 ready,骨架只允许在首次取 poster 时出现一次;拖动/平移的每一帧**不得** `notify()` 全树、不得遍历全部节点,松手只通知一次;`idbGet` 在 SQLite 模式必须先走服务端,**不得**每次前置查 IndexedDB。
|
|
70
70
|
|
|
71
|
+
43. **资产页工具栏**:所有操作按钮(同步全部资产到磁盘 / 导入图片/视频 / 全选本页 / 添加到画布 / 批量删除 / 清除选择)与分页**集中在项目下拉下一行**,不各自占行;按钮一律**透明底 + 1px 线框 + 文字**(禁止灰色/品牌色块底),删除按钮用红色线框 + 红字;分页为 `‹ [页码输入] / N ›`,回车/失焦跳转、非法文本不改页、越界夹取到 1..N,右侧显示总数;窄窗口自动换行,分页始终靠右。
|
|
72
|
+
|
|
71
73
|
---
|
|
72
74
|
|
|
73
75
|
**自检方式**:改完 UI 后逐条对照本文件;涉及"禁止/不得"的条目,必须在测试里有**反向断言**(例如断言某样式不存在),而不是靠肉眼确认。
|
package/index.js
CHANGED
|
@@ -29,8 +29,15 @@ try {
|
|
|
29
29
|
|
|
30
30
|
// 更新检查的唯一信息源 = npm registry latest(与安装方式无关:
|
|
31
31
|
// npm 在线安装 / 本地 link 开发态 / 其它方式,一律走同一条逻辑)。
|
|
32
|
-
|
|
32
|
+
// 双源:官方权威 + 中国大陆镜像(registry.npmmirror.com)。按网络环境自动选源
|
|
33
|
+
// (探测缓存 24h),用户可在更新横幅手动覆盖(config.updateRegistry = 'auto' | 'official' | 'china')。
|
|
33
34
|
const PKG_NAME = '@ninkch/dsh-infinite-canvas';
|
|
35
|
+
const NPM_LATEST_PATH = '/' + encodeURIComponent(PKG_NAME) + '/latest';
|
|
36
|
+
const NPM_REGISTRIES = {
|
|
37
|
+
official: 'https://registry.npmjs.org',
|
|
38
|
+
china: 'https://registry.npmmirror.com',
|
|
39
|
+
};
|
|
40
|
+
const REGISTRY_CACHE_TTL_MS = 24 * 60 * 60 * 1000;
|
|
34
41
|
|
|
35
42
|
// ---------- 安装形态探测(用于"点击即更新") ----------
|
|
36
43
|
// 受管安装 = 本副本位于某个 DSH profile 的 node_modules 下(向上找带 dsh.profile.bundles 的 package.json)。
|
|
@@ -68,16 +75,22 @@ function findPnpm() {
|
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
/** 在 profile 目录执行 pnpm add <spec> --save-exact。opts.relaxReleaseAge → 跳过 24h 新版本冷却期。 */
|
|
78
|
+
/** 组装 pnpm add 参数(纯函数供回归):registry 只认白名单值——
|
|
79
|
+
* URL 是外部输入时绝不进命令行(防注入面),非白名单一律不带参数(回落机器默认配置)。 */
|
|
80
|
+
function pnpmAddArgs(pnpm, spec, opts = {}) {
|
|
81
|
+
const relax = opts.relaxReleaseAge ? ['--config.minimum-release-age=0'] : [];
|
|
82
|
+
const reg = NPM_REGISTRIES[opts.registry] ? ['--registry', NPM_REGISTRIES[opts.registry]] : [];
|
|
83
|
+
const tail = ['add', spec, '--save-exact', ...relax, ...reg];
|
|
84
|
+
return pnpm.kind === 'script' ? ['--expose-internals', pnpm.script, ...tail] : tail;
|
|
85
|
+
}
|
|
86
|
+
|
|
71
87
|
function runPnpmAdd(pnpm, spec, opts = {}) {
|
|
72
88
|
return new Promise((resolve) => {
|
|
73
89
|
const started = Date.now();
|
|
74
90
|
const stdout = [];
|
|
75
91
|
const stderr = [];
|
|
76
92
|
let child;
|
|
77
|
-
const
|
|
78
|
-
const args = pnpm.kind === 'script'
|
|
79
|
-
? ['--expose-internals', pnpm.script, 'add', spec, '--save-exact', ...relax]
|
|
80
|
-
: ['add', spec, '--save-exact', ...relax];
|
|
93
|
+
const args = pnpmAddArgs(pnpm, spec, opts);
|
|
81
94
|
try {
|
|
82
95
|
child = pnpm.kind === 'script'
|
|
83
96
|
? spawn(pnpm.node, args, { cwd: PROFILE_DIR, windowsHide: true, env: { ...process.env, ELECTRON_RUN_AS_NODE: '1' } })
|
|
@@ -930,6 +943,8 @@ function normalizeBible(raw) {
|
|
|
930
943
|
return {
|
|
931
944
|
worldview: String(b.worldview || '').slice(0, 8000),
|
|
932
945
|
style: String(b.style || '').slice(0, 2000),
|
|
946
|
+
// 风格锚(一句话全片视觉总锚):AI 更新设定集时与 style 同时产出;生成请求只带锚,style 全文进分镜消化
|
|
947
|
+
styleAnchor: String(b.styleAnchor || '').slice(0, 200),
|
|
933
948
|
characters: arr(b.characters),
|
|
934
949
|
scenes: arr(b.scenes),
|
|
935
950
|
props: arr(b.props),
|
|
@@ -1999,6 +2014,7 @@ async function canvasUpdateBible(args) {
|
|
|
1999
2014
|
const next = {
|
|
2000
2015
|
worldview: inc.worldview !== undefined ? String(inc.worldview) : cur.worldview,
|
|
2001
2016
|
style: inc.style !== undefined ? String(inc.style) : cur.style,
|
|
2017
|
+
styleAnchor: inc.styleAnchor !== undefined ? String(inc.styleAnchor) : cur.styleAnchor,
|
|
2002
2018
|
characters: mergeList(cur.characters, inc.characters),
|
|
2003
2019
|
scenes: mergeList(cur.scenes, inc.scenes),
|
|
2004
2020
|
props: mergeList(cur.props, inc.props),
|
|
@@ -2706,9 +2722,10 @@ function canvasConnect(args) {
|
|
|
2706
2722
|
};
|
|
2707
2723
|
}
|
|
2708
2724
|
|
|
2709
|
-
/** 读取 npm registry 上 latest dist-tag
|
|
2710
|
-
async function npmLatestVersion() {
|
|
2711
|
-
const
|
|
2725
|
+
/** 读取 npm registry 上 latest dist-tag 的版本号(kind: 'official' | 'china',双源白名单)。 */
|
|
2726
|
+
async function npmLatestVersion(kind) {
|
|
2727
|
+
const base = NPM_REGISTRIES[kind] || NPM_REGISTRIES.official;
|
|
2728
|
+
const res = await fetch(base + NPM_LATEST_PATH, {
|
|
2712
2729
|
headers: { accept: 'application/json' },
|
|
2713
2730
|
signal: AbortSignal.timeout(15000),
|
|
2714
2731
|
});
|
|
@@ -2721,6 +2738,69 @@ async function npmLatestVersion() {
|
|
|
2721
2738
|
return v;
|
|
2722
2739
|
}
|
|
2723
2740
|
|
|
2741
|
+
/** 探测双源可用性(并发,3s 超时):探测路径就是实际要拉取的 packument——比 /-/ping 更贴近真实链路。 */
|
|
2742
|
+
async function probeRegistries() {
|
|
2743
|
+
const probeOne = async (kind) => {
|
|
2744
|
+
const t0 = Date.now();
|
|
2745
|
+
try {
|
|
2746
|
+
const res = await fetch(NPM_REGISTRIES[kind] + NPM_LATEST_PATH, { headers: { accept: 'application/json' }, signal: AbortSignal.timeout(3000) });
|
|
2747
|
+
return { ok: !!res.ok, ms: Date.now() - t0 };
|
|
2748
|
+
} catch { return { ok: false, ms: Date.now() - t0 }; }
|
|
2749
|
+
};
|
|
2750
|
+
const [official, china] = await Promise.all([probeOne('official'), probeOne('china')]);
|
|
2751
|
+
return { official, china };
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
/** 选源纯函数(表驱动回归):手动覆盖显式优先;auto 按探测结果——
|
|
2755
|
+
* 官方可达 → 官方(非大陆/代理良好,权威源优先);官方不可达而镜像可达 → 镜像(大陆直连形态);
|
|
2756
|
+
* 双可达 → 官方(保守,镜像同步有分钟级延迟);双不可达 → 官方(维持现状行为与报错)。 */
|
|
2757
|
+
function pickUpdateRegistry(override, probe) {
|
|
2758
|
+
if (override === 'china') return 'china';
|
|
2759
|
+
if (override === 'official') return 'official';
|
|
2760
|
+
const off = probe && probe.official;
|
|
2761
|
+
const cn = probe && probe.china;
|
|
2762
|
+
if (off && off.ok) return 'official';
|
|
2763
|
+
if (cn && cn.ok) return 'china';
|
|
2764
|
+
return 'official';
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
/** 自动探测缓存是否仍有效:24h TTL 且源必须是白名单值(防 config 被手改成任意字符串)。 */
|
|
2768
|
+
function registryCacheValid(cache, now) {
|
|
2769
|
+
if (!cache) return false;
|
|
2770
|
+
if (cache.resolved !== 'official' && cache.resolved !== 'china') return false;
|
|
2771
|
+
const at = Number(cache.at);
|
|
2772
|
+
if (!Number.isFinite(at) || at <= 0) return false;
|
|
2773
|
+
return now - at < REGISTRY_CACHE_TTL_MS;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
/** 解析本次更新应使用的源:手动覆盖优先;auto 读 24h 缓存,过期/缺失则探测并写回缓存。 */
|
|
2777
|
+
async function resolveUpdateRegistry() {
|
|
2778
|
+
const cfg = readIcConfig();
|
|
2779
|
+
const override = cfg.updateRegistry === 'china' || cfg.updateRegistry === 'official' ? cfg.updateRegistry : 'auto';
|
|
2780
|
+
if (override !== 'auto') return { kind: override, override: true };
|
|
2781
|
+
const cache = cfg.updateRegistryResolved && Number(cfg.updateRegistryAt) > 0
|
|
2782
|
+
? { resolved: cfg.updateRegistryResolved, at: Number(cfg.updateRegistryAt) }
|
|
2783
|
+
: null;
|
|
2784
|
+
if (registryCacheValid(cache, Date.now())) return { kind: cache.resolved, cached: true };
|
|
2785
|
+
const kind = pickUpdateRegistry('auto', await probeRegistries());
|
|
2786
|
+
try {
|
|
2787
|
+
writeIcConfig({ ...readIcConfig(), updateRegistry: 'auto', updateRegistryResolved: kind, updateRegistryAt: Date.now() });
|
|
2788
|
+
} catch { /* 写缓存失败不阻断更新 */ }
|
|
2789
|
+
return { kind, probed: true };
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
/** 按偏好源取 latest,失败自动换备源一次(探测再准也有抖动,兜底保证不卡更新)。 */
|
|
2793
|
+
async function npmLatestVersionAny(preferred) {
|
|
2794
|
+
const order = preferred === 'china' ? ['china', 'official'] : ['official', 'china'];
|
|
2795
|
+
let lastErr = null;
|
|
2796
|
+
for (const kind of order) {
|
|
2797
|
+
try {
|
|
2798
|
+
return { kind, version: await npmLatestVersion(kind) };
|
|
2799
|
+
} catch (e) { lastErr = e; }
|
|
2800
|
+
}
|
|
2801
|
+
throw lastErr;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2724
2804
|
/**
|
|
2725
2805
|
* 语义化版本比较:a<b → -1,a>b → 1,相等 → 0,**无法解析 → null(未知,不能当成"相等")**。
|
|
2726
2806
|
* prerelease 按 semver 规则逐段比较:数字段按数值(rc.10 > rc.9),数字段优先于字母段。
|
|
@@ -2770,14 +2850,17 @@ function readLocalVersion() {
|
|
|
2770
2850
|
*/
|
|
2771
2851
|
async function updateCheck() {
|
|
2772
2852
|
const runningVersion = readLocalVersion();
|
|
2773
|
-
const
|
|
2853
|
+
const reg = await resolveUpdateRegistry();
|
|
2854
|
+
const r = await npmLatestVersionAny(reg.kind);
|
|
2855
|
+
const remoteVersion = r.version;
|
|
2774
2856
|
const cmp = cmpVer(runningVersion, remoteVersion);
|
|
2857
|
+
const base = { registryKind: r.kind, registry: NPM_REGISTRIES[r.kind], registryFallback: r.kind !== reg.kind };
|
|
2775
2858
|
if (cmp === null) {
|
|
2776
2859
|
// 版本号无法解析(本地被改成非规范三段等):如实报"未知",绝不谎称已是最新
|
|
2777
|
-
return { source: 'npm', runningVersion, remoteVersion, behind: 0, upToDate: false, unknown: true, note: '版本号无法解析,无法判断是否需要更新' };
|
|
2860
|
+
return { source: 'npm', ...base, runningVersion, remoteVersion, behind: 0, upToDate: false, unknown: true, note: '版本号无法解析,无法判断是否需要更新' };
|
|
2778
2861
|
}
|
|
2779
2862
|
const behind = cmp < 0 ? 1 : 0;
|
|
2780
|
-
return { source: 'npm', runningVersion, remoteVersion, behind, upToDate: behind === 0 };
|
|
2863
|
+
return { source: 'npm', ...base, runningVersion, remoteVersion, behind, upToDate: behind === 0 };
|
|
2781
2864
|
}
|
|
2782
2865
|
|
|
2783
2866
|
/**
|
|
@@ -2789,7 +2872,10 @@ async function updateCheck() {
|
|
|
2789
2872
|
*/
|
|
2790
2873
|
async function updateInstall() {
|
|
2791
2874
|
const runningVersion = readLocalVersion();
|
|
2792
|
-
const
|
|
2875
|
+
const reg = await resolveUpdateRegistry();
|
|
2876
|
+
const order = reg.kind === 'china' ? ['china', 'official'] : ['official', 'china'];
|
|
2877
|
+
const r = await npmLatestVersionAny(order[0]);
|
|
2878
|
+
const latest = r.version;
|
|
2793
2879
|
const cmp = cmpVer(runningVersion, latest);
|
|
2794
2880
|
if (cmp === null) {
|
|
2795
2881
|
// 无法比较时不能假装"已是最新"(按钮会显示成功但什么都没装)→ 回退为引导
|
|
@@ -2803,12 +2889,20 @@ async function updateInstall() {
|
|
|
2803
2889
|
}
|
|
2804
2890
|
const pnpm = findPnpm();
|
|
2805
2891
|
const spec = PKG_NAME + '@' + latest;
|
|
2806
|
-
let
|
|
2892
|
+
let usedRegistry = order[0];
|
|
2807
2893
|
let policyRelaxed = false;
|
|
2894
|
+
let registryFallback = false;
|
|
2895
|
+
let res = await runPnpmAdd(pnpm, spec, { registry: usedRegistry });
|
|
2808
2896
|
if (!res.ok && /MINIMUM_RELEASE_AGE_VIOLATION/.test((res.stdout || '') + (res.stderr || ''))) {
|
|
2809
2897
|
// pnpm 11 供应链保护对 24h 内新发布间歇性拦截;用户点击已是明确同意 → 放宽重试一次
|
|
2810
2898
|
policyRelaxed = true;
|
|
2811
|
-
res = await runPnpmAdd(pnpm, spec, { relaxReleaseAge: true });
|
|
2899
|
+
res = await runPnpmAdd(pnpm, spec, { relaxReleaseAge: true, registry: usedRegistry });
|
|
2900
|
+
}
|
|
2901
|
+
if (!res.ok) {
|
|
2902
|
+
// 备源兜底:探测选错的源不会卡死更新——自动换另一源重试一次
|
|
2903
|
+
registryFallback = true;
|
|
2904
|
+
usedRegistry = order[1];
|
|
2905
|
+
res = await runPnpmAdd(pnpm, spec, { registry: usedRegistry, relaxReleaseAge: policyRelaxed });
|
|
2812
2906
|
}
|
|
2813
2907
|
const output = ((res.stdout || '') + '\n' + (res.stderr || '')).trim().slice(-1500);
|
|
2814
2908
|
if (!res.ok) {
|
|
@@ -2821,13 +2915,13 @@ async function updateInstall() {
|
|
|
2821
2915
|
try {
|
|
2822
2916
|
installed = JSON.parse(readFileSync(path.join(PROFILE_DIR, 'node_modules', ...PKG_NAME.split('/'), 'package.json'), 'utf8')).version || latest;
|
|
2823
2917
|
} catch { /* 保留 latest */ }
|
|
2824
|
-
return { ok: true, changed: true, version: installed, output, policyRelaxed };
|
|
2918
|
+
return { ok: true, changed: true, version: installed, output, policyRelaxed, registryKind: usedRegistry, registry: NPM_REGISTRIES[usedRegistry], registryFallback };
|
|
2825
2919
|
}
|
|
2826
2920
|
|
|
2827
2921
|
export const inject = ['webServer', 'tools'];
|
|
2828
2922
|
|
|
2829
2923
|
// 仅供诊断 / 自动化测试(不属于 RPC 面,运行时行为不受影响)
|
|
2830
|
-
export const _internals = { THUMB_MAX_SIDE, thumbRelOf, isDerivedMedia, updateCheck, updateInstall, npmLatestVersion, cmpVer, findPnpm, getProfileDir: () => PROFILE_DIR, getVersion: () => VERSION, dataRoot, setDataRoot, dataRootMigrate, dataRootImport, ensureProjectFolder, physicalRel, mirrorProjectToDataRoot, writeAssetIndex, removeAssetIndexEntry, readDataRootMeta, removeDataRootProject, sqlDeleteProjectRows, deletedProjectIds, addDeletedProjectId, clearDeletedProjectId, fetchProxyForward, storyboardConsistencyWarnings, readAssetIndexNames, safeJoin, mimeOf, pipeFile, getIcConfigPath: () => CONFIG_PATH, canvasCreateProject, canvasWriteNode, canvasConnect, canvasDeleteProject, canvasDeleteNode, canvasRunNode, canvasNodeStatus, canvasGetBible, canvasUpdateBible, canvasCreateNode, canvasOpen, canvasesList, canvasCreate, canvasRename, canvasDelete, canvasDocId, isCanvasDocId, splitCanvasDocId, normalizeCanvasId, canvasRegistry, sanitizeCanvases, readCanvasDoc, writeCanvasDoc, deleteCanvasDocsForProject, projectsList, projectsPut, projectsGet, projectsDelete, projectsSync, sqliteAvailable: () => !!SQLITE, getDb, closeDb, dbAssetsList, dbAssetsGet, dbAssetNames, dbAssetCreate, dbAssetUpdate, dbAssetDelete, objectAbsFor, ftsReconcile, readDocOrNull, docExists, sqlActive, rpcMethods: () => _rpcMethods, canvasUpdateNode, canvasGenerateNode };
|
|
2924
|
+
export const _internals = { THUMB_MAX_SIDE, thumbRelOf, isDerivedMedia, updateCheck, updateInstall, npmLatestVersion, cmpVer, findPnpm, NPM_REGISTRIES, pickUpdateRegistry, registryCacheValid, pnpmAddArgs, getProfileDir: () => PROFILE_DIR, getVersion: () => VERSION, dataRoot, setDataRoot, dataRootMigrate, dataRootImport, ensureProjectFolder, physicalRel, mirrorProjectToDataRoot, writeAssetIndex, removeAssetIndexEntry, readDataRootMeta, removeDataRootProject, sqlDeleteProjectRows, deletedProjectIds, addDeletedProjectId, clearDeletedProjectId, fetchProxyForward, storyboardConsistencyWarnings, readAssetIndexNames, safeJoin, mimeOf, pipeFile, getIcConfigPath: () => CONFIG_PATH, canvasCreateProject, canvasWriteNode, canvasConnect, canvasDeleteProject, canvasDeleteNode, canvasRunNode, canvasNodeStatus, canvasGetBible, canvasUpdateBible, canvasCreateNode, canvasOpen, canvasesList, canvasCreate, canvasRename, canvasDelete, canvasDocId, isCanvasDocId, splitCanvasDocId, normalizeCanvasId, canvasRegistry, sanitizeCanvases, readCanvasDoc, writeCanvasDoc, deleteCanvasDocsForProject, projectsList, projectsPut, projectsGet, projectsDelete, projectsSync, sqliteAvailable: () => !!SQLITE, getDb, closeDb, dbAssetsList, dbAssetsGet, dbAssetNames, dbAssetCreate, dbAssetUpdate, dbAssetDelete, objectAbsFor, ftsReconcile, readDocOrNull, docExists, sqlActive, rpcMethods: () => _rpcMethods, canvasUpdateNode, canvasGenerateNode };
|
|
2831
2925
|
|
|
2832
2926
|
function resolveModel(providers, want) {
|
|
2833
2927
|
const byProvider = want && want.provider
|
|
@@ -2994,6 +3088,22 @@ export function apply(ctx) {
|
|
|
2994
3088
|
async llmComplete(args) { return complete(args); },
|
|
2995
3089
|
async updateCheck() { return updateCheck(); },
|
|
2996
3090
|
async updateInstall() { return updateInstall(); },
|
|
3091
|
+
async updateGetRegistry() {
|
|
3092
|
+
const cfg = readIcConfig();
|
|
3093
|
+
const override = cfg.updateRegistry === 'china' || cfg.updateRegistry === 'official' ? cfg.updateRegistry : 'auto';
|
|
3094
|
+
return { override, resolved: cfg.updateRegistryResolved || null, cachedAt: cfg.updateRegistryAt || null, registries: NPM_REGISTRIES };
|
|
3095
|
+
},
|
|
3096
|
+
async updateSetRegistry(args) {
|
|
3097
|
+
const v = String((args && args.override) || 'auto');
|
|
3098
|
+
if (v !== 'auto' && v !== 'official' && v !== 'china') throw new Error('updateRegistry 只接受 auto / official / china');
|
|
3099
|
+
const cfg = readIcConfig();
|
|
3100
|
+
cfg.updateRegistry = v;
|
|
3101
|
+
// 覆盖变化后清掉自动探测缓存:显式覆盖不需要缓存;切回 auto 时重新探测
|
|
3102
|
+
delete cfg.updateRegistryResolved;
|
|
3103
|
+
delete cfg.updateRegistryAt;
|
|
3104
|
+
writeIcConfig(cfg);
|
|
3105
|
+
return { override: v, resolved: null };
|
|
3106
|
+
},
|
|
2997
3107
|
async dataRootGet() {
|
|
2998
3108
|
const root = dataRoot();
|
|
2999
3109
|
let exists = false;
|
|
@@ -3703,7 +3813,7 @@ export function apply(ctx) {
|
|
|
3703
3813
|
});
|
|
3704
3814
|
reg({
|
|
3705
3815
|
name: 'canvas_update_bible',
|
|
3706
|
-
description: '写入项目设定集(世界观/核心设定、风格基调、角色/场景/道具)。默认按名称合并:同名更新、不存在则追加;mode="replace"
|
|
3816
|
+
description: '写入项目设定集(世界观/核心设定、风格基调、角色/场景/道具)。默认按名称合并:同名更新、不存在则追加;mode="replace" 时条目整体替换。【设定集先行】先把世界观/风格/角色/场景/道具写进设定集,再生成剧本与参考图,保证跨镜跨集一致。写/改 style 时必须同时产出 styleAnchor(一句话 ≤40 字的全片视觉总锚;细节在 style,锚进生成请求总控)。',
|
|
3707
3817
|
parameters: {
|
|
3708
3818
|
type: 'object',
|
|
3709
3819
|
properties: {
|
|
@@ -3714,7 +3824,8 @@ export function apply(ctx) {
|
|
|
3714
3824
|
description: '设定集内容(只传要改的字段)',
|
|
3715
3825
|
properties: {
|
|
3716
3826
|
worldview: { type: 'string', description: '世界观/核心设定(题材、年代、核心规则、主线暗线)' },
|
|
3717
|
-
style: { type: 'string', description: '
|
|
3827
|
+
style: { type: 'string', description: '风格基调(画风、年代、色调、质感,可多句细节)' },
|
|
3828
|
+
styleAnchor: { type: 'string', description: '风格锚:一句话(≤40 字)全片视觉总锚,与 style 同时产出——style 写细节,锚进图片/视频生成请求的总控' },
|
|
3718
3829
|
characters: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, desc: { type: 'string' } }, required: ['name'] }, description: '角色设定(名称 + 外观/性格描述)' },
|
|
3719
3830
|
scenes: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, desc: { type: 'string' } }, required: ['name'] }, description: '场景设定' },
|
|
3720
3831
|
props: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, desc: { type: 'string' } }, required: ['name'] }, description: '道具设定' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninkch/dsh-infinite-canvas",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.18",
|
|
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",
|