@aswless_854771076/ai_short_studio_cli 0.1.239 → 0.1.240
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 +17 -0
- package/dist/commands/canvas/asset/audit.js +23 -5
- package/dist/commands/canvas/director/apply.d.ts +17 -0
- package/dist/commands/canvas/director/apply.js +14 -0
- package/dist/commands/canvas/director/prelayout.d.ts +22 -0
- package/dist/commands/canvas/director/prelayout.js +46 -0
- package/dist/commands/canvas/director/read.d.ts +16 -0
- package/dist/commands/canvas/director/read.js +13 -0
- package/dist/commands/canvas/document/save.js +26 -4
- package/dist/domain/canvas-asset-audit.d.ts +47 -0
- package/dist/domain/canvas-asset-audit.js +99 -4
- package/dist/domain/vvicat-api.d.ts +12 -0
- package/dist/domain/vvicat-api.js +9 -0
- package/package.json +1 -1
- package/skills/using-vvicat-ai-short-studio-cli/SKILL.md +4 -0
- package/skills/using-vvicat-ai-short-studio-cli/references/canvas-inspection.md +16 -0
- package/skills/using-vvicat-ai-short-studio-cli/references/canvas-previs.md +25 -2
package/README.md
CHANGED
|
@@ -272,3 +272,20 @@ OBJ/GLB/FBX props can be uploaded with `canvas previs upload <nodeId> <file.obj>
|
|
|
272
272
|
预演环境贴图:`ai-short-studio canvas previs upload <nodeId> sky.hdr --project <projectId> --base base.json --hdr --scene <sceneId> --json`;支持 HDR/EXR/PNG/JPEG,最大32 MiB及16,777,216像素。上传保存正式素材与场景版本并选中环境,仍须显式执行节点渲染。内置助手可读取并选择已有绑定,暂不能上传本地文件。
|
|
273
273
|
|
|
274
274
|
显式预演抠图 / Previs matte: `canvas previs apply <nodeId> --project <projectId> --file matte.json --json` accepts `{base,matte:{sceneId,objectId,selection:"auto"|"saved",options:{...}}}`. Keep the read base, save drafts first, and use existing cutout sources. This appends immutable image/mask/scene versions; it does not render or approve media.
|
|
275
|
+
|
|
276
|
+
### 3D 导演台 / 3D director
|
|
277
|
+
|
|
278
|
+
可通过 CLI 读取、编辑或从图片自动预排版,新建节点支持直接初始化。分镜图可用 `--kind storyboard --panel 2` 选择其中一格;图片尺度和深度为估计,写入后仍需检查。命令会保留现有对象与动作并追加布局;版本冲突时不会覆盖或自动重试。
|
|
279
|
+
|
|
280
|
+
Read, edit, or append an image-based layout to a new or saved director project. A storyboard image can target a single panel. Scale and depth are estimates; inspect placement and camera framing afterward. Version conflicts stop the write.
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
ai-short-studio canvas director read NODE --project PROJECT --json
|
|
284
|
+
ai-short-studio canvas director prelayout NODE --project PROJECT --image scene.png --kind scene --json
|
|
285
|
+
ai-short-studio canvas director prelayout NODE --project PROJECT --image storyboard.png --kind storyboard --panel 2 --analyze-only --json
|
|
286
|
+
ai-short-studio canvas director apply NODE --project PROJECT --file operation.json --json
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
完整合同见随包 `references/canvas-previs.md`。 / See the bundled `references/canvas-previs.md` for the full contract.
|
|
290
|
+
|
|
291
|
+
3D 导演台图片预排版:`canvas director prelayout <nodeId> --project <projectId> --image <file> --model <vision-model-key>`。仅允许已发布能力明确支持图片输入的模型;不指定模型时校验项目分析模型。
|
|
@@ -7,12 +7,13 @@ function isAssetPlanKey(key, requested) {
|
|
|
7
7
|
return key === requested || key.endsWith(`.${requested}`);
|
|
8
8
|
return key === 'asset-plan' || key.endsWith('.asset-plan');
|
|
9
9
|
}
|
|
10
|
-
function selectedVersionText(payload) {
|
|
10
|
+
function selectedVersionText(payload, pinned) {
|
|
11
11
|
const asset = payload.asset && typeof payload.asset === 'object' && !Array.isArray(payload.asset)
|
|
12
12
|
? payload.asset : null;
|
|
13
13
|
const version = asset?.selectedVersion && typeof asset.selectedVersion === 'object' && !Array.isArray(asset.selectedVersion)
|
|
14
14
|
? asset.selectedVersion : null;
|
|
15
|
-
const
|
|
15
|
+
const chosen = typeof pinned === 'string' ? [version, ...(Array.isArray(asset?.versions) ? asset.versions : [])].find(value => value && typeof value === 'object' && value.id === pinned) : version;
|
|
16
|
+
const text = chosen?.textContent;
|
|
16
17
|
if (typeof text !== 'string')
|
|
17
18
|
throw new Error('资产计划文档没有选定版本正文');
|
|
18
19
|
return text;
|
|
@@ -59,7 +60,7 @@ export default class CanvasAssetAudit extends BaseCommand {
|
|
|
59
60
|
if (node.kind !== 'text-resource' || typeof node.refId !== 'string')
|
|
60
61
|
throw new Error('资产计划节点不是已保存的画布文档');
|
|
61
62
|
const assetPayload = await api.asset(flags.project, node.refId);
|
|
62
|
-
const textContent = selectedVersionText(assetPayload);
|
|
63
|
+
const textContent = selectedVersionText(assetPayload, node.data?.selectedOutputVersionId);
|
|
63
64
|
let plan;
|
|
64
65
|
try {
|
|
65
66
|
plan = JSON.parse(textContent);
|
|
@@ -67,21 +68,38 @@ export default class CanvasAssetAudit extends BaseCommand {
|
|
|
67
68
|
catch {
|
|
68
69
|
throw new Error('资产计划文档正文不是合法 JSON');
|
|
69
70
|
}
|
|
70
|
-
const canvas = await api.inspectCanvas(flags.project, { includes: ['nodes', 'edges'] });
|
|
71
|
+
const canvas = await api.inspectCanvas(flags.project, { includes: ['nodes', 'edges', 'assets'] });
|
|
71
72
|
const nodes = (Array.isArray(canvas.nodes) ? canvas.nodes : [])
|
|
72
73
|
.map((item) => ({
|
|
73
74
|
id: String(item.id),
|
|
74
75
|
kind: String(item.kind),
|
|
75
76
|
title: typeof item.title === 'string' ? item.title : undefined,
|
|
77
|
+
refId: typeof item.refId === 'string' ? item.refId : null,
|
|
78
|
+
selectedVersionId: item.data?.selectedOutputVersionId,
|
|
76
79
|
config: item.data?.config,
|
|
77
80
|
}));
|
|
78
81
|
const edges = (Array.isArray(canvas.edges) ? canvas.edges : [])
|
|
79
82
|
.map((item) => ({
|
|
80
83
|
sourceNodeId: String(item.sourceNodeId),
|
|
81
84
|
targetNodeId: String(item.targetNodeId),
|
|
85
|
+
sourceHandle: typeof item.sourceHandle === 'string' ? item.sourceHandle : null,
|
|
82
86
|
targetHandle: typeof item.targetHandle === 'string' ? item.targetHandle : null,
|
|
83
87
|
}));
|
|
84
|
-
const
|
|
88
|
+
const exactAssets = await Promise.all([...new Set(nodes.flatMap(node => node.refId ? [node.refId] : []))].map(async (assetId) => {
|
|
89
|
+
const response = await api.asset(flags.project, assetId);
|
|
90
|
+
return response.asset;
|
|
91
|
+
}));
|
|
92
|
+
const catalog = await api.nodeTypes();
|
|
93
|
+
for (const node of nodes) {
|
|
94
|
+
const raw = canvas.nodes.find(item => item.id === node.id);
|
|
95
|
+
const asset = exactAssets.find(asset => asset.id === node.refId);
|
|
96
|
+
node.selectedVersionId ??= asset?.selectedVersion?.id;
|
|
97
|
+
node.resourceData = raw?.data;
|
|
98
|
+
const schema = catalog.nodeTypes.find(type => type.kind === node.kind)?.outputSchema;
|
|
99
|
+
const properties = schema && typeof schema === 'object' && !Array.isArray(schema) ? schema.properties : null;
|
|
100
|
+
node.outputHandles = properties && typeof properties === 'object' && !Array.isArray(properties) ? Object.keys(properties) : [];
|
|
101
|
+
}
|
|
102
|
+
const result = auditAssets({ nodes, edges, plan, assets: exactAssets });
|
|
85
103
|
this.print({ ...result, documentKey: document.documentKey, documentNodeId: document.nodeId });
|
|
86
104
|
if (!result.ok) {
|
|
87
105
|
this.error(`资产门禁未通过:${result.errors.map((item) => item.code).join('、')}`, { exit: 7 });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class DirectorApply extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
nodeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
episode: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
import { commandApi, projectFlag, readJsonInput } from '../../../command-helpers.js';
|
|
4
|
+
export default class DirectorApply extends BaseCommand {
|
|
5
|
+
static description = '按已读取基线追加预排版或更新完整导演台工程;冲突后重新读取并审阅';
|
|
6
|
+
static args = { nodeId: Args.string({ required: true }) };
|
|
7
|
+
static flags = { ...BaseCommand.baseFlags, project: projectFlag, file: Flags.string({ description: 'operation、expectedVersion、expectedVersionId 与 layout/standaloneState;省略读取 stdin' }) };
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(DirectorApply);
|
|
10
|
+
const input = await readJsonInput(flags.file);
|
|
11
|
+
const { api } = await commandApi(flags);
|
|
12
|
+
this.print(await api.directorDeskApply(flags.project, args.nodeId, input));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class DirectorPrelayout extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
nodeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
image: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
model: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
kind: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
panel: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'analyze-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
episode: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
2
|
+
import { extname } from 'node:path';
|
|
3
|
+
import { Args, Flags } from '@oclif/core';
|
|
4
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
5
|
+
import { commandApi, projectFlag } from '../../../command-helpers.js';
|
|
6
|
+
export default class DirectorPrelayout extends BaseCommand {
|
|
7
|
+
static description = '上传一张场景图或分镜图,等待视觉解析并自动追加到 3D 导演台';
|
|
8
|
+
static args = { nodeId: Args.string({ required: true }) };
|
|
9
|
+
static flags = { ...BaseCommand.baseFlags, project: projectFlag,
|
|
10
|
+
image: Flags.string({ required: true, description: '本地 PNG/JPEG/WebP 图片,不超过 25 MiB' }),
|
|
11
|
+
model: Flags.string({ description: '支持图片输入的已发布视觉模型 key;省略时校验项目分析模型' }),
|
|
12
|
+
kind: Flags.string({ options: ['scene', 'storyboard'], default: 'scene' }),
|
|
13
|
+
panel: Flags.integer({ min: 1, max: 16, default: 1, description: '分镜图按阅读顺序选取的格数' }),
|
|
14
|
+
'analyze-only': Flags.boolean({ default: false, description: '只返回解析结果,不写入工程' }),
|
|
15
|
+
timeout: Flags.integer({ min: 1, default: 600, description: '任务等待秒数;超时不写入工程' }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(DirectorPrelayout);
|
|
19
|
+
const mime = { '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp' }[extname(flags.image).toLowerCase()];
|
|
20
|
+
const info = await stat(flags.image);
|
|
21
|
+
if (!mime || !info.isFile() || !info.size || info.size > 25 * 1024 * 1024)
|
|
22
|
+
throw new Error('图片必须是 25 MiB 以内的 PNG/JPEG/WebP');
|
|
23
|
+
const { api } = await commandApi(flags);
|
|
24
|
+
const current = await api.directorDeskRead(flags.project, args.nodeId);
|
|
25
|
+
const base = current.base;
|
|
26
|
+
const panel = current.panel;
|
|
27
|
+
panel.directorState ??= current.initialState;
|
|
28
|
+
if (!panel.directorState)
|
|
29
|
+
throw new Error('历史工程缺少完整配置,请在网页检查并保存');
|
|
30
|
+
const bytes = await readFile(flags.image);
|
|
31
|
+
const submitted = await api.directorSceneAnalyze(flags.project, { ...(flags.model ? { analysisModel: flags.model } : {}), imageDataUrl: `data:${mime};base64,${bytes.toString('base64')}`, imageKind: flags.kind, panelIndex: flags.panel, locale: 'zh', assetCandidates: panel.directorState.project.assets.filter(asset => asset.sourceType === 'model').slice(0, 64).map(asset => ({ id: asset.id, name: asset.name ?? asset.fileName })) });
|
|
32
|
+
if (typeof submitted.taskId !== 'string')
|
|
33
|
+
throw new Error('未收到图片分析任务 ID');
|
|
34
|
+
const task = await api.waitTask(submitted.taskId, { timeoutMs: flags.timeout * 1000 });
|
|
35
|
+
if (task.status !== 'completed')
|
|
36
|
+
throw new Error(String(task.errorMessage ?? `图片分析失败:${task.status}`));
|
|
37
|
+
const result = task.result;
|
|
38
|
+
if (flags['analyze-only']) {
|
|
39
|
+
this.print({ taskId: submitted.taskId, base, layout: result });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const { sourceSha256, imageKind: _kind, panelIndex: _panel, limitations, ...layout } = result;
|
|
43
|
+
const saved = await api.directorDeskApply(flags.project, args.nodeId, { operation: 'layout.apply', expectedVersion: base.canvasVersion, expectedVersionId: base.versionId, layout, ...(base.versionId === null ? { standaloneState: panel.directorState } : {}) });
|
|
44
|
+
this.print({ ...saved, taskId: submitted.taskId, sourceSha256, limitations });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class DirectorRead extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
nodeId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
locale: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
episode: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
import { commandApi, projectFlag } from '../../../command-helpers.js';
|
|
4
|
+
export default class DirectorRead extends BaseCommand {
|
|
5
|
+
static description = '读取 3D 导演台完整工程、素材和并发版本基线';
|
|
6
|
+
static args = { nodeId: Args.string({ required: true }) };
|
|
7
|
+
static flags = { ...BaseCommand.baseFlags, project: projectFlag };
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(DirectorRead);
|
|
10
|
+
const { api } = await commandApi(flags);
|
|
11
|
+
this.print(await api.directorDeskRead(flags.project, args.nodeId));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -45,24 +45,46 @@ export default class CanvasDocumentSave extends BaseCommand {
|
|
|
45
45
|
const response = assetId ? await api.asset(flags.project, assetId) : null;
|
|
46
46
|
const asset = response?.asset && typeof response.asset === 'object'
|
|
47
47
|
? response.asset : null;
|
|
48
|
-
const selectedVersionId = typeof
|
|
48
|
+
const selectedVersionId = typeof node.data?.selectedOutputVersionId === 'string' ? node.data?.selectedOutputVersionId
|
|
49
|
+
: typeof asset?.selectedVersionId === 'string' ? asset.selectedVersionId : null;
|
|
49
50
|
const inputs = await Promise.all((flags.input ?? []).map(async (nodeId) => {
|
|
50
51
|
const source = await api.node(flags.project, nodeId);
|
|
51
52
|
const sourceAsset = typeof source.refId === 'string' ? await api.asset(flags.project, source.refId) : null;
|
|
52
53
|
const selectedAsset = sourceAsset?.asset && typeof sourceAsset.asset === 'object'
|
|
53
54
|
? sourceAsset.asset : null;
|
|
54
|
-
const versionId = selectedAsset?.selectedVersionId;
|
|
55
|
+
const versionId = source.data?.selectedOutputVersionId ?? selectedAsset?.selectedVersionId;
|
|
55
56
|
if (typeof versionId !== 'string' || !versionId)
|
|
56
57
|
throw new Error(`上游节点没有选版:${nodeId}`);
|
|
57
58
|
return { nodeId, versionId };
|
|
58
59
|
}));
|
|
59
|
-
|
|
60
|
+
const saved = await api.saveCanvasDocument(flags.project, args.nodeId, {
|
|
60
61
|
name: flags.name,
|
|
61
62
|
schemaKey,
|
|
62
63
|
documentKey: flags['document-key'],
|
|
63
64
|
expectedVersionId: typeof selectedVersionId === 'string' ? selectedVersionId : null,
|
|
64
65
|
content,
|
|
65
66
|
inputs,
|
|
66
|
-
})
|
|
67
|
+
});
|
|
68
|
+
// 正式保存返回来源与版本,不再自行预铺资源节点;回读证明节点引用确已持久化。
|
|
69
|
+
const derived = Array.isArray(saved.derivedResources) ? saved.derivedResources : [];
|
|
70
|
+
for (const resource of derived) {
|
|
71
|
+
if (typeof resource.nodeId !== 'string' || typeof resource.assetId !== 'string' || typeof resource.versionId !== 'string')
|
|
72
|
+
throw new Error('文档派生回执无效');
|
|
73
|
+
const persisted = await api.node(flags.project, resource.nodeId);
|
|
74
|
+
if (persisted.refId !== resource.assetId)
|
|
75
|
+
throw new Error('文档派生资源绑定已变化,请重新读取');
|
|
76
|
+
const selected = persisted.data?.selectedOutputVersionId;
|
|
77
|
+
if (selected !== resource.versionId)
|
|
78
|
+
throw new Error('文档派生资源选版已变化,请重新读取');
|
|
79
|
+
if (resource.representation === 'embedded') {
|
|
80
|
+
const outputs = persisted.data?.embeddedOutputs;
|
|
81
|
+
if (!Array.isArray(outputs) || !outputs.some(value => value && typeof value === 'object' && !Array.isArray(value)
|
|
82
|
+
&& value.assetId === resource.assetId && value.versionId === resource.versionId
|
|
83
|
+
&& value.resourceKey === resource.resourceKey && value.sourceHandle === resource.sourceHandle)) {
|
|
84
|
+
throw new Error('文档内嵌派生资源与回执不匹配,请重新读取');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
this.print(saved);
|
|
67
89
|
}
|
|
68
90
|
}
|
|
@@ -11,16 +11,62 @@ export interface AssetAuditNode {
|
|
|
11
11
|
kind: string;
|
|
12
12
|
title?: string;
|
|
13
13
|
config?: Record<string, unknown>;
|
|
14
|
+
refId?: string | null;
|
|
15
|
+
selectedVersionId?: string | null;
|
|
16
|
+
resourceKeys?: string[];
|
|
17
|
+
resourceData?: unknown;
|
|
18
|
+
outputHandles?: string[];
|
|
14
19
|
}
|
|
20
|
+
/** 仅当前选版的正式派生资源可证明身份;历史内嵌条目继续保留,但不计入当前覆盖。 */
|
|
21
|
+
export declare function readAssetResourceKeys(data: unknown, assetId: string | null | undefined, versionId: string | null | undefined, selection?: {
|
|
22
|
+
sourceHandle: string | null;
|
|
23
|
+
outputHandles?: string[];
|
|
24
|
+
}): Record<string, string[]>;
|
|
15
25
|
export interface AssetAuditEdge {
|
|
16
26
|
sourceNodeId: string;
|
|
27
|
+
sourceHandle?: string | null;
|
|
17
28
|
targetNodeId: string;
|
|
18
29
|
targetHandle?: string | null;
|
|
19
30
|
}
|
|
31
|
+
export interface AssetAuditMediaAsset {
|
|
32
|
+
id: string;
|
|
33
|
+
deletedAt?: string | null;
|
|
34
|
+
selectedVersion?: {
|
|
35
|
+
id: string;
|
|
36
|
+
media?: {
|
|
37
|
+
id?: string;
|
|
38
|
+
mimeType?: string | null;
|
|
39
|
+
url?: string;
|
|
40
|
+
} | null;
|
|
41
|
+
items?: Array<{
|
|
42
|
+
media?: {
|
|
43
|
+
id?: string;
|
|
44
|
+
mimeType?: string | null;
|
|
45
|
+
url?: string;
|
|
46
|
+
} | null;
|
|
47
|
+
}>;
|
|
48
|
+
} | null;
|
|
49
|
+
versions?: Array<{
|
|
50
|
+
id: string;
|
|
51
|
+
media?: {
|
|
52
|
+
id?: string;
|
|
53
|
+
mimeType?: string | null;
|
|
54
|
+
url?: string;
|
|
55
|
+
} | null;
|
|
56
|
+
items?: Array<{
|
|
57
|
+
media?: {
|
|
58
|
+
id?: string;
|
|
59
|
+
mimeType?: string | null;
|
|
60
|
+
url?: string;
|
|
61
|
+
} | null;
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
20
65
|
export interface AssetAuditPlan {
|
|
21
66
|
characters?: unknown;
|
|
22
67
|
scenes?: unknown;
|
|
23
68
|
props?: unknown;
|
|
69
|
+
generation_plan?: unknown;
|
|
24
70
|
}
|
|
25
71
|
export interface AssetAuditIssue {
|
|
26
72
|
code: string;
|
|
@@ -50,4 +96,5 @@ export declare function auditAssets(input: {
|
|
|
50
96
|
nodes: AssetAuditNode[];
|
|
51
97
|
edges: AssetAuditEdge[];
|
|
52
98
|
plan: AssetAuditPlan;
|
|
99
|
+
assets?: AssetAuditMediaAsset[];
|
|
53
100
|
}): AssetAuditResult;
|
|
@@ -6,6 +6,46 @@
|
|
|
6
6
|
* 也看不出设定资产被塞进了透明的 image-generate 节点。这里把这些事实做成可复现的失败项,
|
|
7
7
|
* 让资产门禁能在付费提交之前失败,而不是等用户在成片里看到不像同一张脸。
|
|
8
8
|
*/
|
|
9
|
+
/** 仅当前选版的正式派生资源可证明身份;历史内嵌条目继续保留,但不计入当前覆盖。 */
|
|
10
|
+
export function readAssetResourceKeys(data, assetId, versionId, selection) {
|
|
11
|
+
if (!assetId || !versionId || !data || typeof data !== 'object' || Array.isArray(data))
|
|
12
|
+
return {};
|
|
13
|
+
const record = data;
|
|
14
|
+
const embedded = Array.isArray(record.embeddedOutputs);
|
|
15
|
+
let outputs = embedded ? record.embeddedOutputs : [record.artifact];
|
|
16
|
+
if (embedded && selection) {
|
|
17
|
+
const rows = outputs.filter((value) => Boolean(value) && typeof value === 'object' && !Array.isArray(value));
|
|
18
|
+
let matches = rows.filter(item => item.sourceHandle === selection.sourceHandle);
|
|
19
|
+
// 与执行器相同:仅唯一声明输出的旧节点可使用未标记端口;同端口也只消费一个产物。
|
|
20
|
+
if (!matches.length && selection.outputHandles?.length === 1 && selection.outputHandles[0] === selection.sourceHandle) {
|
|
21
|
+
matches = rows.filter(item => !item.sourceHandle);
|
|
22
|
+
}
|
|
23
|
+
const selected = matches.find(item => item.versionId === versionId) ?? matches[0];
|
|
24
|
+
outputs = selected ? [selected] : [];
|
|
25
|
+
}
|
|
26
|
+
const keys = {};
|
|
27
|
+
for (const output of outputs) {
|
|
28
|
+
if (!output || typeof output !== 'object' || Array.isArray(output))
|
|
29
|
+
continue;
|
|
30
|
+
const item = output;
|
|
31
|
+
if (embedded ? item.assetId !== assetId || item.versionId !== versionId
|
|
32
|
+
: item.parentAssetId !== assetId || record.selectedOutputVersionId !== versionId)
|
|
33
|
+
continue;
|
|
34
|
+
const type = item.resourceType;
|
|
35
|
+
if (typeof type !== 'string' || !['character', 'character-visual', 'location', 'sub-location', 'prop'].includes(type))
|
|
36
|
+
continue;
|
|
37
|
+
try {
|
|
38
|
+
const content = JSON.parse(typeof item.resourceContent === 'string' ? item.resourceContent : '{}');
|
|
39
|
+
if (!content || typeof content !== 'object' || Array.isArray(content))
|
|
40
|
+
continue;
|
|
41
|
+
keys[type] = [...(keys[type] ?? []), ...[content.key, content.name].filter((key) => typeof key === 'string' && key.trim().length > 0)];
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return keys;
|
|
48
|
+
}
|
|
9
49
|
// 资产种类到设定板节点、允许的结构化设定来源的固定对应;改这里等于改资产门禁。
|
|
10
50
|
const ASSET_CATEGORIES = [
|
|
11
51
|
{
|
|
@@ -13,18 +53,21 @@ const ASSET_CATEGORIES = [
|
|
|
13
53
|
label: '人物',
|
|
14
54
|
sheetKind: 'character-turnaround',
|
|
15
55
|
sourceKinds: ['character-visual-design', 'character-resource', 'character-design'],
|
|
56
|
+
resourceTypes: ['character', 'character-visual'],
|
|
16
57
|
},
|
|
17
58
|
{
|
|
18
59
|
category: 'scenes',
|
|
19
60
|
label: '场景',
|
|
20
61
|
sheetKind: 'location-image',
|
|
21
62
|
sourceKinds: ['location-resource', 'location-design'],
|
|
63
|
+
resourceTypes: ['location', 'sub-location'],
|
|
22
64
|
},
|
|
23
65
|
{
|
|
24
66
|
category: 'props',
|
|
25
67
|
label: '道具',
|
|
26
68
|
sheetKind: 'prop-turnaround',
|
|
27
69
|
sourceKinds: ['prop-resource', 'prop-design'],
|
|
70
|
+
resourceTypes: ['prop'],
|
|
28
71
|
},
|
|
29
72
|
];
|
|
30
73
|
const TRANSPARENT_IMAGE_KIND = 'image-generate';
|
|
@@ -42,6 +85,16 @@ function promptSourceKind(nodeId, edges, kindById) {
|
|
|
42
85
|
&& (item.targetHandle === 'prompt' || !item.targetHandle));
|
|
43
86
|
return edge ? kindById.get(edge.sourceNodeId) ?? null : null;
|
|
44
87
|
}
|
|
88
|
+
function connectedResourceKeys(node, edge, resourceTypes, sourceKinds) {
|
|
89
|
+
if (!node)
|
|
90
|
+
return [];
|
|
91
|
+
if (node.resourceData) {
|
|
92
|
+
const keys = readAssetResourceKeys(node.resourceData, node.refId, node.selectedVersionId, { sourceHandle: edge.sourceHandle ?? null, outputHandles: node.outputHandles });
|
|
93
|
+
return resourceTypes.flatMap(type => keys[type] ?? []);
|
|
94
|
+
}
|
|
95
|
+
// 历史独立设定节点可有单一正文;通用文档绝不能回退到整文档的身份并集。
|
|
96
|
+
return sourceKinds.includes(node.kind) ? node.resourceKeys ?? [] : [];
|
|
97
|
+
}
|
|
45
98
|
export function auditAssets(input) {
|
|
46
99
|
const kindById = new Map(input.nodes.map((node) => [node.id, node.kind]));
|
|
47
100
|
const errors = [];
|
|
@@ -52,10 +105,38 @@ export function auditAssets(input) {
|
|
|
52
105
|
sheets: { characters: 0, scenes: 0, props: 0 },
|
|
53
106
|
imageGenerate: imageGenerateIds.length,
|
|
54
107
|
};
|
|
55
|
-
for (const { category, label, sheetKind, sourceKinds } of ASSET_CATEGORIES) {
|
|
56
|
-
const
|
|
108
|
+
for (const { category, label, sheetKind, sourceKinds, resourceTypes } of ASSET_CATEGORIES) {
|
|
109
|
+
const entries = Array.isArray(input.plan[category]) ? input.plan[category] : [];
|
|
110
|
+
let planned = 0;
|
|
111
|
+
const demanded = [];
|
|
112
|
+
for (const entry of entries) {
|
|
113
|
+
const item = entry && typeof entry === 'object' && !Array.isArray(entry) ? entry : {};
|
|
114
|
+
// 不出镜是显式制作用途,不能从自然语言状态、人物名字或“已有”字样推断。
|
|
115
|
+
if (item.usage === 'offscreen')
|
|
116
|
+
continue;
|
|
117
|
+
const explicitlyGenerate = Array.isArray(input.plan.generation_plan) && input.plan.generation_plan.some(entry => entry && typeof entry === 'object' && entry.asset_key === item.key);
|
|
118
|
+
const reference = explicitlyGenerate ? null : item.source_image;
|
|
119
|
+
if (reference && typeof reference === 'object' && !Array.isArray(reference)) {
|
|
120
|
+
const ref = reference;
|
|
121
|
+
const node = input.nodes.find(node => node.id === ref.nodeId);
|
|
122
|
+
const asset = input.assets?.find(asset => asset.id === ref.assetId && !asset.deletedAt);
|
|
123
|
+
const version = [asset?.selectedVersion, ...(asset?.versions ?? [])].find(version => version?.id === ref.versionId);
|
|
124
|
+
const media = [version?.media, ...(version?.items?.map(item => item.media) ?? [])];
|
|
125
|
+
const selected = node?.selectedVersionId ?? asset?.selectedVersion?.id;
|
|
126
|
+
if (typeof ref.nodeId === 'string' && typeof ref.assetId === 'string' && typeof ref.versionId === 'string'
|
|
127
|
+
&& node?.refId === ref.assetId && selected === ref.versionId
|
|
128
|
+
&& media.some(media => media && (media.id || media.url) && media.mimeType?.startsWith('image/')))
|
|
129
|
+
continue;
|
|
130
|
+
errors.push({ code: 'asset-reuse-invalid', severity: 'error',
|
|
131
|
+
message: `资产 ${String(item.key ?? item.name ?? '')} 的复用图片缺失、选版不匹配或没有真实图片媒体,请回读来源四元组。`,
|
|
132
|
+
nodeIds: node ? [node.id] : [] });
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
planned += 1;
|
|
136
|
+
demanded.push(item);
|
|
137
|
+
}
|
|
57
138
|
const sheets = input.nodes.filter((node) => node.kind === sheetKind);
|
|
58
|
-
counts.planned[category] =
|
|
139
|
+
counts.planned[category] = planCount(input.plan, category);
|
|
59
140
|
counts.sheets[category] = sheets.length;
|
|
60
141
|
if (planned === 0)
|
|
61
142
|
continue;
|
|
@@ -71,6 +152,17 @@ export function auditAssets(input) {
|
|
|
71
152
|
});
|
|
72
153
|
continue;
|
|
73
154
|
}
|
|
155
|
+
const suppliedKeys = new Set(sheets.flatMap(sheet => {
|
|
156
|
+
const sources = input.edges.filter(edge => edge.targetNodeId === sheet.id && (edge.targetHandle === 'prompt' || !edge.targetHandle));
|
|
157
|
+
return sources.flatMap(edge => {
|
|
158
|
+
const node = input.nodes.find(node => node.id === edge.sourceNodeId);
|
|
159
|
+
return connectedResourceKeys(node, edge, resourceTypes, sourceKinds);
|
|
160
|
+
});
|
|
161
|
+
}));
|
|
162
|
+
const missing = demanded.filter(item => ![item.key, item.name].some(key => typeof key === 'string' && suppliedKeys.has(key)));
|
|
163
|
+
if (missing.length)
|
|
164
|
+
warnings.push({ code: 'sheet-identity-uncovered', severity: 'warning',
|
|
165
|
+
message: `${label}有 ${missing.length} 项未找到匹配身份的设定板,不能用其他资产的节点数量替代覆盖。`, nodeIds: sheets.map(sheet => sheet.id) });
|
|
74
166
|
if (sheets.length < planned) {
|
|
75
167
|
warnings.push({
|
|
76
168
|
code: 'sheet-coverage-partial',
|
|
@@ -90,7 +182,10 @@ export function auditAssets(input) {
|
|
|
90
182
|
});
|
|
91
183
|
}
|
|
92
184
|
const sourceKind = promptSourceKind(sheet.id, input.edges, kindById);
|
|
93
|
-
|
|
185
|
+
const source = input.edges.find(edge => edge.targetNodeId === sheet.id && (edge.targetHandle === 'prompt' || !edge.targetHandle));
|
|
186
|
+
const embeddedSource = sourceKind === 'text-resource' && source
|
|
187
|
+
&& connectedResourceKeys(input.nodes.find(node => node.id === source.sourceNodeId), source, resourceTypes, sourceKinds).length > 0;
|
|
188
|
+
if (sourceKind && !sourceKinds.includes(sourceKind) && !embeddedSource) {
|
|
94
189
|
warnings.push({
|
|
95
190
|
code: 'sheet-prompt-source',
|
|
96
191
|
severity: 'warning',
|
|
@@ -133,6 +133,16 @@ export declare class VvicatApi {
|
|
|
133
133
|
versionId: string;
|
|
134
134
|
downstreamNodeIds: string[];
|
|
135
135
|
materializedNodeIds?: string[];
|
|
136
|
+
derivedResources?: Array<{
|
|
137
|
+
nodeId: string;
|
|
138
|
+
assetId: string;
|
|
139
|
+
versionId: string;
|
|
140
|
+
sourceHandle: string;
|
|
141
|
+
resourceKey: string | null;
|
|
142
|
+
resourceType: string | null;
|
|
143
|
+
purpose: string;
|
|
144
|
+
representation: 'embedded' | 'node';
|
|
145
|
+
}>;
|
|
136
146
|
}>;
|
|
137
147
|
canvasDocumentStatus(projectId: string, nodeId: string): Promise<JsonObject>;
|
|
138
148
|
canvasDocuments(projectId: string): Promise<JsonObject>;
|
|
@@ -148,6 +158,8 @@ export declare class VvicatApi {
|
|
|
148
158
|
patchCanvas(projectId: string, input: JsonObject): Promise<JsonObject>;
|
|
149
159
|
updateStoryboardShot(projectId: string, nodeId: string, input: JsonObject): Promise<JsonObject>;
|
|
150
160
|
directorDeskRead(projectId: string, nodeId: string): Promise<JsonObject>;
|
|
161
|
+
directorDeskApply(projectId: string, nodeId: string, input: JsonObject): Promise<JsonObject>;
|
|
162
|
+
directorSceneAnalyze(projectId: string, input: JsonObject): Promise<JsonObject>;
|
|
151
163
|
previsRead(projectId: string, nodeId: string): Promise<JsonObject>;
|
|
152
164
|
previsMotion(projectId: string, nodeId: string): Promise<JsonObject>;
|
|
153
165
|
previsQa(projectId: string, nodeId: string): Promise<JsonObject>;
|
|
@@ -266,6 +266,12 @@ export class VvicatApi {
|
|
|
266
266
|
directorDeskRead(projectId, nodeId) {
|
|
267
267
|
return this.client.request(`/api/projects/${encodeURIComponent(projectId)}/canvas/nodes/${encodeURIComponent(nodeId)}/director-desk`);
|
|
268
268
|
}
|
|
269
|
+
directorDeskApply(projectId, nodeId, input) {
|
|
270
|
+
return this.client.request(`/api/projects/${encodeURIComponent(projectId)}/canvas/nodes/${encodeURIComponent(nodeId)}/director-desk`, { method: 'POST', body: input });
|
|
271
|
+
}
|
|
272
|
+
directorSceneAnalyze(projectId, input) {
|
|
273
|
+
return this.client.request(`/api/projects/${encodeURIComponent(projectId)}/director-desk/analyze-scene`, { method: 'POST', body: input });
|
|
274
|
+
}
|
|
269
275
|
previsRead(projectId, nodeId) {
|
|
270
276
|
return this.client.request(`/api/projects/${encodeURIComponent(projectId)}/canvas/nodes/${encodeURIComponent(nodeId)}/previs`);
|
|
271
277
|
}
|
|
@@ -326,6 +332,9 @@ export class VvicatApi {
|
|
|
326
332
|
return { ...payload.data, schemaVersion: payload.data.schemaVersion };
|
|
327
333
|
}
|
|
328
334
|
async addNode(projectId, input) {
|
|
335
|
+
if (['character-resource', 'location-resource', 'prop-resource'].includes(input.kind)) {
|
|
336
|
+
throw new Error('CANVAS_NODE_RESOURCE_SOURCE_REQUIRED: 请保存对应人物/外观/场景/道具文档,并复用 derivedResources 中的正式资源;禁止新增空壳');
|
|
337
|
+
}
|
|
329
338
|
if (input.kind === 'storyboard-breakdown')
|
|
330
339
|
throw new Error('CLI 禁止创建拆镜生成节点;请使用 storyboard-resource 与 canvas node storyboard-draft 自写镜头');
|
|
331
340
|
const canvas = await this.canvas(projectId);
|
package/package.json
CHANGED
|
@@ -51,6 +51,10 @@ description: Use when an agent needs to inspect or operate VVICAT infinite-canva
|
|
|
51
51
|
新项目禁止预搭旧版固定功能节点链(`screenplay-resource` 起始、`drama-*` 分析节点整条连好的流水线)。分析阶段每个产物都由 Agent 在无限画布创建或更新 `text-resource` 自由画布文档,并通过 `canvas document save` 追加不可变版本;媒体节点只消费来源有效的自由画布文档和选定媒体版本,不要求内容审核。媒体生成节点仍由画布按文档物化或按需单独创建;首次镜头用 `storyboard-resource` 和 `canvas node storyboard-draft` 自写、校验与物化。Agent/CLI 禁止创建或执行 `storyboard-breakdown`,该模型生成节点仅供网页人工使用。
|
|
52
52
|
|
|
53
53
|
旧版固定节点链仍保留用于读取和恢复历史项目,但不得作为新项目入口,也不得与 自由画布文档并行写入同一阶段。发现旧节点链时先用 `canvas documents` 和 `canvas workflow status` 建立 自由画布文档快照,再迁移受影响阶段;迁移完成后停止继续创建旧节点链。
|
|
54
|
+
## 已有工程恢复优先
|
|
55
|
+
|
|
56
|
+
已有工程先按共享画布检查流程读取 observedStage 与 recordIssues,再结合 currentStage 决定最小修复范围;不从第一个缺失文档重跑媒体。保存设定后复用 derivedResources 并回读,不新增 character-resource、location-resource、prop-resource 空壳。资产复用核对真实精确版本;ASR 失败不等于无对白。此恢复规则优先于下文的新建制作阶段顺序。
|
|
57
|
+
|
|
54
58
|
## 核心原则
|
|
55
59
|
|
|
56
60
|
生产环境认证优先使用 MemHub;CLI 通过浏览器 PKCE 登录或个人 API Key 访问,只有本地明确关闭 MemHub 时才使用 Supabase 兼容登录。
|
|
@@ -20,3 +20,19 @@
|
|
|
20
20
|
共享媒体执行能力与人工入口分别管理:端口 `creationAudience=agent` 表示助手流程文档输入;人工界面默认隐藏未连接的这些端口,已有连接单列追溯。完整实时目录保留这些端口及原端口 ID,Agent 仍按正式生产合同接入来源镜头、时间板、故事版、连续性、逐镜审核和声音计划;不可把人工界面精简误读为执行合同删除,也不要求人工创建这些文档。不得为了区分界面重复新增相同图片或视频生成 kind。
|
|
21
21
|
|
|
22
22
|
人工图片入口统一使用 `image-generate`:不接参考图时按描述生成,连接参考图后在提示词中说明保留项和修改项,具体编辑能力以模型为准。`image-edit` 不再显示在人工新增菜单,但旧节点、独立编辑模型配置和 `image/instruction` 端口合同继续兼容;不得批量替换历史 kind 或重接历史连线。浮动提示词面板仅用于基础 `image-generate`、`video-generate`,专项节点在自身表单或属性面板中编辑。
|
|
23
|
+
|
|
24
|
+
## 恢复进度与记录缺口
|
|
25
|
+
|
|
26
|
+
读取 workflow 时同时报告 observedStage(已有有效文档或真实媒体证明的最远产出阶段)、recordIssues(缺失、过期、重复或策略未知的逐项记录)和严格的 currentStage/complete。已渲染而记录缺失时,明确说“已有成片,记录待补齐”;先回读既有精确选版和来源,只处理受影响的缺口,不因 currentStage 停在前期就重跑生成。observedStage 不证明所有镜头齐全、媒体已核实或内容已审片,不伪造文档使 complete 变成 true。
|
|
27
|
+
|
|
28
|
+
character-resource、location-resource、prop-resource 是正式设定的派生产物,禁止通用新增空壳。先保存对应 character-profiles、character-visual-design、location-design、prop-design 文档,再读取保存回执 derivedResources 的 nodeId、assetId、versionId、resourceKey、resourceType、sourceHandle、purpose、representation;representation=embedded 表示内容就在该 nodeId 的 embeddedOutputs 内,representation=node 表示历史独立资源。按回执回读精确版本和资源正文,不从标题猜测身份,不另建同名节点。幂等保存返回现有版本和相同资源身份,不用反复保存触发新生成。
|
|
29
|
+
|
|
30
|
+
资产复用必须核对 source_image 的 nodeId/assetId/versionId 与节点当前选版、真实图片媒体;自然语言 asset_status 不构成证据。计划 generation_plan 声明新增的资产,其 source_image 只是参考,不抵扣新增需求。明确不出镜使用结构化 usage=offscreen;不得根据“母亲”等名字或描述自动排除。只有已选 storyboard_strategy/required_board_types 决定本镜板型,缺策略先核实,不从已有视频或默认模板推导板型。
|
|
31
|
+
|
|
32
|
+
ASR 空白片段可过滤,其余字幕必须保留供应商真实时间。PRODUCTION_ASR_NO_VALID_TEXT 或 RECREATION_ASR_EMPTY 只表示没有有效识别文本;PRODUCTION_ASR_FORMAT_INVALID 是返回格式错误,PRODUCTION_ASR_TIMING_INVALID 是时间不可用。上述诊断都不能被记为“已确认无对白”。先核对原始返回和真实音轨,不虚构字幕、不按字数补时间、不自动重试付费请求。渲染完成、完整播放听音和内容审计分别记录。
|
|
33
|
+
|
|
34
|
+
工作流板图检查按每镜 shot_key/shotKey 和明确选择的板型核对真实媒体、节点固定选版及当前来源;storyboard-images 的空正文或完成声明不能代替板图。查看 generate-storyboard-images 检查项的 boardIssues,区分缺图、错版、来源过期和重复媒体;仅修复受影响项,不补未选择的板。当前服务端自动证据核对支持正式 temporal/shot 板图合同;其他板型及没有正式来源合同的历史板图仍需用实际节点、资产版本和媒体单独核实,不能把信息不足解释为未制作,也不能仅写文档使其通过。
|
|
35
|
+
|
|
36
|
+
内嵌派生身份仅按当前节点选版、资产和资源类型读取,旧版保留的条目不计当前覆盖。媒体节点的最近一次执行失败、取消或来源过期不抹除已有选版;observedStage 保留实际产出,执行和来源问题分别列入 recordIssues。仅当严格阶段 complete=true 且 recordIssues 为空时才报告“记录完整”。
|
|
37
|
+
|
|
38
|
+
资产身份覆盖还须匹配 prompt 入边的 sourceHandle 和执行器实际选择的单个内嵌产物。两个设定板重复连接同一人物输出不能覆盖文档中的其他人物;同一端口有多个产物也不能将其身份合并算作覆盖。未标记端口的历史条目,仅在实时节点目录声明唯一输出且连线匹配该端口时兼容;端口不明或错版先报告,不自动改线或新建空节点。
|
|
@@ -189,6 +189,29 @@ CLI 用 `ai-short-studio canvas previs apply <nodeId> --project <projectId> --fi
|
|
|
189
189
|
|
|
190
190
|
帧图和视频渲染位置:`previs-frame` 与 `previs-video` 支持 `config.previs.executionLocation=auto|client|server`。网页及内置助手的 auto 任务优先由当前用户打开的本项目画布页面领取,客户端不可用或断线后可后台接管。client 必须保持画布页面打开,无法领取、断线或编码失败会失败;server 使用后台。CLI 默认 auto 且没有网页能力声明时使用后台;显式 client 会等待网页。内置助手仍通过 canvas_execute 提交,无需再次点击运行。客户端 WebGL 使用 GPU,视频按固定 24fps 时间戳使用 WebCodecs 编码 H.264 MP4,优先硬件编码,实际设备由浏览器决定;软件 WebGL 不作为客户端 GPU 路径。单帧、首尾帧、深度、法线、联系表和视频使用同一冻结版本及角色合同。正式媒体由服务端验证执行权、来源、PNG 尺寸、MP4 编码/帧数/帧率/时长并解码后提交;客户端上传不等于审核通过。工程导出继续后台。
|
|
191
191
|
|
|
192
|
-
##
|
|
192
|
+
## 3D 导演台完整工程与图片预排版
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
`canvas director read <nodeId> --project <projectId> --json` 返回 `base.canvasVersion`、`base.versionId` 和 `panel.directorState`。后者是完整新版状态(format=pixelshort-director-state、schemaVersion=1),包含 project 与 settings;directorLayout 只是兼容投影。尚未保存的新节点返回 initialState 和 base.versionId=null,首次写入显式传 expectedVersionId:null;CLI prelayout 自动携带这份初始工程。历史已保存但缺少完整工程时,需在网页检查后保存,不静默降级。
|
|
195
|
+
|
|
196
|
+
`canvas director prelayout <nodeId> --project <projectId> --image ./scene.png --kind scene --json` 上传一张 PNG/JPEG/WebP(最多25 MiB),通过后台视觉分析任务生成对象和参考机位,等待完成后按读取时基线追加到工程。分镜图使用 `--kind storyboard --panel 2` 指定阅读顺序中的一格(1~16),不会把不同镜头混成一个场景;不重建格线、编号、箭头或水印。`--analyze-only` 只返回结果,`--timeout 600` 控制等待时长。单图尺度、深度与遮挡为粗估,仍需检查站位、机位和连续性,不代表审核或渲染通过。
|
|
197
|
+
|
|
198
|
+
`canvas director apply <nodeId> --project <projectId> --file operation.json --json` 接受 `{operation:"layout.apply",expectedVersion:<base.canvasVersion>,expectedVersionId:<base.versionId>,layout:{scene,objects,cameras,notes}}`。scene 包含 backgroundColor、groundColor(#RRGGBB)与 groundHeight(-10~10米);objects 为1~24个 `{id,kind:"character"|"prop",name,color,transform:{position,rotation,scale}}`,向量为三元数组、旋转为弧度;可选 assetRefId 必须是工程现存模型,geometryType 仅 box/sphere/cylinder/cone/pyramid/torus。cameras 为0~16个 `{id,name,position,target,fov}`,fov=10~120。ID 不能与工程已有对象或机位冲突。解析回执的 sourceSha256、imageKind、panelIndex、limitations 不放入 layout。
|
|
199
|
+
|
|
200
|
+
完整编辑使用 `operation:"project.update"`,传相同版本基线和完整 standaloneState;保留所有未编辑配置、素材、动作和截图,不用旧投影覆盖。写入生成新文档版本;409 后重新读取并审阅,不自动替换基线重发。旧快照/运动记录操作只作用于兼容投影,不等同于新版路线编辑。本地模型上传仍用网页正式素材入口;blob/data/director-asset 临时引用不可写入。历史缺失信息只能从现存备份恢复。
|
|
201
|
+
|
|
202
|
+
图片预排版可用 `--model <model-key>` 显式选择视觉模型。该模型必须在已发布能力中声明 `llm.visionInput=true`;省略时校验项目分析模型,不支持图片则在上传前报错,不自动改用其他模型。网页提供独立视觉模型选择。
|
|
203
|
+
|
|
204
|
+
图片预排版会按有效画面包围框和画幅拟合站位,尺寸先按基础几何体归一化,再写入实际 transform;人物使用等比缩放并带 characterRig 站立/坐姿/迈步控制。正式 layout.apply 可选 aspectRatio(1:1、2:1、3:4、4:3、16:9、21:9、9:16)和对象 characterRig={rigType:"mannequin",posePresetId:"stand"|"sit"|"walk",controls:{关节字段:角度}}。posePresetId 只标记姿态,真实关节必须写 controls;不能仅改名字。transform.position 是运行时原点,scale 是倍率,不能把模型返回的包围盒中心和米制尺寸直接写入。单图仍是粗预演,应回看参考机位检查人物出画、接地和遮挡。
|
|
205
|
+
|
|
206
|
+
layout.cameras[].position 为光学观察位置,写入时会转换为摄像机支架位置(镜头偏移1.82米);不要再手工添加偏移。画幅会同步到工作设置,第一视角按取景框进行投影,而非铺满视口再裁切。
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
新版导演台运镜和人物路线必须用 project.update 改刚读到的完整 standaloneState,不能使用 motion.recording.upsert / camera.recording.upsert。standaloneState 直接是 {format:"pixelshort-director-state",schemaVersion:1,project,settings},不再套文档外壳;原样保留 scene/assets/settings 等全部字段。
|
|
210
|
+
|
|
211
|
+
- 人物路线写 project.objects[].motionPath={interpolation:"linear"|"smooth",keyframes:[{id,time,transform:{position,rotation,scale},facingMode:"manual"|"path",actionPresetId?:string|null}]}。time 是0~1的归一化进度,不是秒;6秒的起中末为0、0.5、1。路线共享活动机位的duration。保持朝向时用manual并保留正确rotation;path按行进方向转身,不能将它用于倒退。
|
|
212
|
+
- 运镜写 project.cameras[].motionPath={duration:6,loop:false,interpolation:"smooth",easing:"ease-in-out",keyframes:[{id,time,position,target,fov}]},每帧必须有唯一id、0~1的time、三元position/target和数值fov。这里position直接是光学观察位置,不套layout.apply的支架偏移;不要用cam.transform.position直接充当首帧观察位置。保持原有机位支架transform,设置project.activeCameraId为编辑的机位、settings.viewMode="camera"。
|
|
213
|
+
- 人偶关节名例如leftHip.pitch、rightHip.pitch、leftKnee.bend、rightKnee.bend、leftShoulder.pitch、rightShoulder.pitch、leftElbow.bend、rightElbow.bend、head.yaw,值为度。hip_l/knee_l等缩写不受运行时驱动。坐姿双髋-90、双膝90;迈步可用双髋-20/20、双膝12/4和双肩20/-20。保持等比缩放。+Z朝镜头,向画面左yaw=-π/2,向右=π/2。
|
|
214
|
+
|
|
215
|
+
写入前检查完整工程和全部关键帧,成功后回读核对duration、keyframes、人物位移和当前活动机位。渲染/播放工具缺失时必须如实说明,不能把保存成功当成播放验收通过。
|
|
216
|
+
|
|
217
|
+
人物沿路线持续迈步需要真实动作预设:正常行走为 `walk-cycle`(约1.1秒循环),写入 `characterRig.actionPresetId` 以及路线起点和后续关键帧的 `actionPresetId`。仅设置 `posePresetId:"walk"` 或静态关节角只形成姿态,不构成持续步态;不能把沿路平移描述成已验收的行走。运动方向与朝向独立,侧退/倒退保持manual。播放需检查腿部相位和足滑,不能仅凭路径关键帧通过。
|