@kevlns/art-workshop 0.1.1 → 0.1.3

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/AGENTS.md ADDED
@@ -0,0 +1,19 @@
1
+ # 美术工坊 Agent 指导
2
+
3
+ 首次使用运行 v-cli agent docs art、v-cli agent describe art --json,再用 v-cli art config show 和 v-cli art agent index 确认外部路径、工程及核心。所有独立 art-workshop 命令都可通过 v-cli art 原样调用。详细流程、配置和输入结构用 v-cli art agent docs 查看,参考分类用 v-cli art refs guide 查看。
4
+
5
+ ## 流程与规则
6
+
7
+ - 风格分析与冻结:style analyze 生成报告,style validate 校验,用户采用报告后 style freeze。核心语言精炼、用词准确、前后一致、模块职责清楚;可复用视觉语言归核心,主体与动作归任务,背景与构图归资产配置,模型与尺寸归执行。已有冻结核心不可覆写。
8
+ - 文生图:generate show 读取任务,generate plan 编译计划,generate run --plan FILE --dry 预演,授权后去掉 --dry 生图。工程内核心选择为显式 --core、任务绑定、工程默认;冲突拒绝,不跨工程回退。默认纯白背景,其他背景必须明确声明。
9
+ - 图编辑:edit show / plan / run,明确原图、修改范围及保留范围。预演后按任务授权执行;不自动换背景或套默认核心。原图变化后重新预演。
10
+ - 计划与 dry 不调用远程模型,不产生图片;真实分析与生成会调用 bl 并产生费用。修改需求后重新编译,不手改冻结计划。
11
+ - check 导出或汇总人工验收,分别检查 content/style/asset;三项全部通过且完整性有效才可 select。工具不自动评价图片。
12
+
13
+ ## 本地资源与配套
14
+
15
+ 本地配置位于用户配置目录,可用 config path/show/init 发现;冻结核心在 workspace/projects/工程/cores。工程、参考、报告、计划、缓存、原图和产物都在安装目录之外,不纳入工具 Git 或 npm 包。相对资源按 workspace 解析,参考图按 refs 解析,RUN 按 output 解析。每次配置生效会补齐 refs 分类目录,包括 dry,不覆盖素材。
16
+
17
+ 随包 skills/art-workshop 是使用规范源,agent init --directory DIR 同步到已有 Agent 技能目录,保留扩展文件;自动同步也可用 npm run skill:sync。v-cli 负责路由、清单与本指导发现,美术工坊负责实际任务、核心选择与模型请求。安装 v-cli 会安装此官方依赖。
18
+
19
+ UI 尺寸:文生图 profile.design 声明 resolution 与 outputScale,item.design 声明控件 width/height 与可选 outputScale。单体实际出图尺寸为设计尺寸乘倍率;不能同时指定任务 execution.size。换算越界报错,不自动改变比例;完整约束见 agent docs。
package/README.md CHANGED
@@ -124,4 +124,27 @@ node art-workshop.mjs compare .cache/plan-a.json .cache/plan-b.json
124
124
  node --test tests/art-workshop.test.mjs
125
125
  ```
126
126
 
127
- 依赖 Node.js 与已配置的 bailian-cli。历史图片保留供对照,旧配置和旧计划接口不再支持。真实模型效果需另行实测。
127
+ 依赖 Node.js 与已配置的 bailian-cli。历史图片保留供对照,旧配置和旧计划接口不再支持。真实模型效果需另行实测。
128
+
129
+ ## v-cli 接入
130
+
131
+ 美术工坊是 v-cli 的随包官方插件,入口为 `v-cli art`。先运行 `v-cli agent docs art` 和 `v-cli agent describe art --json`,再运行 `v-cli art config show`、`v-cli art agent index` 选择正确工程。本文所有 `art-workshop` 命令都可将前缀替换为 `v-cli art`;参数、外部本地配置和冻结核心保持一致。`v-cli art --help` 查看入口,`v-cli art agent docs` 查看完整使用规范。
132
+ ## UI 设计分辨率与单体出图尺寸
133
+
134
+ UI 设计基准属于资产规格,不写进冻结风格核心。文生图 profile 可声明:
135
+
136
+ ```json
137
+ "design": { "resolution": { "width": 1920, "height": 1080 }, "outputScale": 2 }
138
+ ```
139
+
140
+ 任务 item 可声明独立控件尺寸与可选倍率:
141
+
142
+ ```json
143
+ "design": { "width": 240, "height": 80, "outputScale": 4 }
144
+ ```
145
+
146
+ 该按钮实际请求 size 为 960*320。同一任务的其他控件可使用不同设计尺寸;单体没有 design 时按 profile 的整幅设计分辨率出图。未覆盖倍率时继承 profile.outputScale。倍率为 1~4 的整数,设计尺寸为正整数且不得超过基准分辨率;换算后的每条边必须在工具支持的 256~4096 像素范围内,越界报错,不自动拉伸、补边或更改倍率。模型可能有额外尺寸与比例限制,工具的通用范围不等于模型能力保证。
147
+
148
+ 启用设计尺寸时禁止同时设置任务 execution.size;工程和本地 execution.size 默认值被单体换算尺寸替代,模型等其他执行参数保留既有优先级。旧任务不声明 design 时保持原有行为。设计模式的提示词不再附加整体占画幅 75% 等比例要求,而声明设计宽高比和安全留白。
149
+
150
+ 编译计划的每项包含 design(resolution、size、outputScale、outputSize)与实际 execution。预演、真实请求、输入哈希与执行验收使用同一份单体参数。修改设计尺寸后必须重新 plan。此配置控制请求画布,不保证模型精确绘制控件边界、描边或圆角像素,也不自动生成九宫切片、裁切或透明底资源。
package/art-workshop.mjs CHANGED
@@ -1,19 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {readdirSync,existsSync} from 'node:fs';
3
3
  import {join,resolve} from 'node:path';
4
- import {loadJob,loadProject} from './lib/project.mjs';
5
- import {referenceRoot,ensureReferenceDirectories,referenceGuide} from './lib/refs.mjs';
6
- import {loadSettings,initSettings,externalPath} from './lib/settings.mjs';
7
4
  import {readJson,writeJson} from './lib/shared.mjs';
8
- import {analyzeStyle} from './lib/analyze.mjs';
9
- import {validateReport,freezeCore,loadCore} from './lib/core.mjs';
10
- import {compileGenerate} from './lib/generate.mjs';
11
- import {compileEdit} from './lib/edit.mjs';
12
- import {validatePlan,selectItems} from './lib/plan.mjs';
13
- import {executePlan,checkRun} from './lib/executor.mjs';
14
- import {agentIndex,agentDocs,syncSkill,autoSync} from './lib/agent.mjs';
15
5
  const args=process.argv.slice(2),pos=[],options={};
16
6
  if(args.length===1&&['--version','-V'].includes(args[0])){console.log(readJson(new URL('./package.json',import.meta.url)).version);process.exit(0);}
7
+ const help='art-workshop: config path/show/init | refs guide | agent index/docs/init | list | style analyze/validate/freeze/show | generate show/plan/run | edit show/plan/run | check/select RUN | compare PLAN PLAN\n也可用 v-cli art 调用;先 v-cli agent docs art,再 v-cli agent describe art --json 查看完整参数。';
8
+ if(!args.length||args.length===1&&['--help','-h','help'].includes(args[0])){console.log(help);process.exit(0);}
9
+ const {loadJob,loadProject}=await import('./lib/project.mjs');
10
+ const {referenceRoot,ensureReferenceDirectories,referenceGuide}=await import('./lib/refs.mjs');
11
+ const {loadSettings,initSettings,externalPath}=await import('./lib/settings.mjs');
12
+ const {analyzeStyle}=await import('./lib/analyze.mjs');
13
+ const {validateReport,freezeCore,loadCore}=await import('./lib/core.mjs');
14
+ const {compileGenerate}=await import('./lib/generate.mjs');
15
+ const {compileEdit}=await import('./lib/edit.mjs');
16
+ const {validatePlan,selectItems}=await import('./lib/plan.mjs');
17
+ const {executePlan,checkRun}=await import('./lib/executor.mjs');
18
+ const {agentIndex,agentDocs,syncSkill,autoSync}=await import('./lib/agent.mjs');
17
19
  const flags=new Set(['dry','explore']);
18
20
  const allowed=new Set(['config','workspace','output-dir','refs-dir','cache-dir','directory','project','input','out','report','note','core','job','plan','item','variant','offset','limit','review','file',...flags]);
19
21
  for(let i=0;i<args.length;i++){if(args[i].startsWith('--')){const k=args[i].slice(2);if(!allowed.has(k)||k in options) throw new Error('未知或重复参数 '+k);options[k]=flags.has(k)?true:args[++i];if(options[k]===undefined) throw new Error('参数缺少值 '+k);}else pos.push(args[i]);}
@@ -70,6 +72,6 @@ try {
70
72
  if(module==='check'){if(options.out) writeJson(path(options.out),rows);print(rows);}
71
73
  else {const matched=rows.filter(x=>x.itemId===required('item')&&x.variantId===required('variant')&&(!options.file||x.file===options.file));if(matched.length!==1||!matched[0].accepted) throw new Error('只能选择唯一且全部验收通过的产物');manifest.review=rows;manifest.selections[options.item]=matched[0];writeJson(file,manifest);print(matched[0]);}
72
74
  }else if(module==='compare'){const read=value=>{const data=readJson(path(value));const plan=data.plan??data;validatePlan(plan);return plan;};const a=read(action),b=read(pos[2]);print({sameCore:a.sources.coreHash===b.sources.coreHash,execution:{before:a.execution,after:b.execution},items:b.items.map(x=>({itemId:x.itemId,variantId:x.variantId,changed:a.items.find(y=>y.itemId===x.itemId&&y.variantId===x.variantId)?.inputHash!==x.inputHash}))});}
73
- else if(!module||module==='help') console.log('art-workshop: config path/show/init | refs guide | agent index/docs/init | list | style analyze/validate/freeze/show | generate show/plan/run | edit show/plan/run | check/select RUN | compare PLAN PLAN');
75
+ else if(!module||module==='help') console.log(help);
74
76
  else throw new Error('未知模块或旧入口:'+module);
75
77
  }catch(e){console.error(e.message);process.exitCode=1;}
package/lib/design.mjs ADDED
@@ -0,0 +1,29 @@
1
+ import { keys, integer } from './shared.mjs';
2
+
3
+ // 设计基准归资产规格,单体尺寸与倍率归任务;出图尺寸由它们确定。
4
+ export function design(profile, override, explicitExecution = {}) {
5
+ if (profile.design === undefined) {
6
+ if (override !== undefined) throw new Error('单体 design 需要资产规格声明 design');
7
+ return null;
8
+ }
9
+ const base = profile.design;
10
+ keys(base, ['resolution', 'outputScale'], 'profile.design');
11
+ keys(base.resolution, ['width', 'height'], 'design.resolution');
12
+ integer(base.resolution.width, 'design.resolution.width', 1, 16384);
13
+ integer(base.resolution.height, 'design.resolution.height', 1, 16384);
14
+ integer(base.outputScale, 'design.outputScale', 1, 4);
15
+ if (override !== undefined) keys(override, ['width', 'height', 'outputScale'], 'item.design');
16
+ const size = override === undefined ? base.resolution : override;
17
+ integer(size.width, 'design.width', 1, base.resolution.width);
18
+ integer(size.height, 'design.height', 1, base.resolution.height);
19
+ const outputScale = override?.outputScale ?? base.outputScale;
20
+ integer(outputScale, 'design.outputScale', 1, 4);
21
+ if (explicitExecution.size !== undefined) throw new Error('设计尺寸与任务 execution.size 不能同时指定');
22
+ const outputSize = { width: size.width * outputScale, height: size.height * outputScale };
23
+ for (const axis of ['width', 'height']) integer(outputSize[axis], `设计换算出图 ${axis}`, 256, 4096);
24
+ return { resolution: { ...base.resolution }, size: { width: size.width, height: size.height }, outputScale, outputSize };
25
+ }
26
+
27
+ export function designPrompt(value) {
28
+ return `UI 设计基准 ${value.resolution.width}×${value.resolution.height};本单体设计尺寸 ${value.size.width}×${value.size.height};出图倍率 ${value.outputScale},画布 ${value.outputSize.width}×${value.outputSize.height} 像素。保持设计宽高比,完整展示并在画布内居中;描边、圆角与细节随同一倍率缩放。`;
29
+ }
package/lib/executor.mjs CHANGED
@@ -15,11 +15,14 @@ function runtimeVersion() {
15
15
  export function executePlan(plan, items, { outputRoot=loadSettings().paths.output, dry = false, runner = runBl, log = console.log } = {}) {
16
16
  validatePlan(plan);
17
17
  if (!items.length) throw new Error('没有选中任何计划项');
18
- for (const item of items) if (!plan.items.some(x => x.inputHash === item.inputHash)) throw new Error('执行项不属于该计划');
18
+ for (const item of items) {
19
+ const expected = plan.items.find(x => x.inputHash === item.inputHash);
20
+ if (!expected || hash(item) !== hash(expected)) throw new Error('执行项不属于该计划或内容已改变');
21
+ }
19
22
  for (const ref of plan.refs) { externalPath(ref.path,'原图/参考图'); if (!existsSync(ref.path) || sha256File(ref.path) !== ref.hash) throw new Error(`参考图已变化:${ref.path}`); }
20
23
  externalPath(outputRoot,'输出目录');
21
24
  if (dry) {
22
- const requests = items.map(item => ({ itemId: item.itemId, variantId: item.variantId, seed: item.seed,
25
+ const requests = items.map(item => ({ ...(item.design?{design:item.design,execution:item.execution}:{}),itemId: item.itemId, variantId: item.variantId, seed: item.seed,
23
26
  inputHash: item.inputHash, args: buildArgs(plan, item, join(outputRoot,'<runId>'), `${item.itemId}--${item.variantId}`) }));
24
27
  log(JSON.stringify({ dry: true, remoteCalls: 0, planHash: plan.planHash, requests }, null, 2));
25
28
  return { dry: true, requests };
@@ -39,7 +42,7 @@ export function executePlan(plan, items, { outputRoot=loadSettings().paths.outpu
39
42
  for (const item of items) {
40
43
  const prefix = `${item.itemId}--${item.variantId}`;
41
44
  const args = buildArgs(plan, item, runDir, prefix);
42
- const record = { ...item, args, ok: false, status: 'running', files: [], urls: [], outputHashes: {} };
45
+ const record = { ...structuredClone(item), args, ok: false, status: 'running', files: [], urls: [], outputHashes: {} };
43
46
  manifest.items.push(record); persist();
44
47
  const before = new Set(readdirSync(runDir));
45
48
  try {
@@ -54,7 +57,8 @@ export function executePlan(plan, items, { outputRoot=loadSettings().paths.outpu
54
57
  record.files.push(target); record.outputHashes[target] = sha256File(join(runDir, target));
55
58
  });
56
59
  record.urls = response.urls ?? [];
57
- if (record.files.length !== plan.execution.perValue) throw new Error(`期望 ${plan.execution.perValue} 张,实际 ${record.files.length} 张`);
60
+ const expectedCount = (item.execution??plan.execution).perValue;
61
+ if (record.files.length !== expectedCount) throw new Error(`期望 ${expectedCount} 张,实际 ${record.files.length} 张`);
58
62
  record.ok = true; record.status = 'generated';
59
63
  log(`✔ ${item.itemId}/${item.variantId} seed=${item.seed} → ${record.files.join(', ')}`);
60
64
  } catch (e) {
@@ -81,8 +85,8 @@ export function checkRun(manifest, manifestPath, review = manifest.review ?? [])
81
85
  for (const item of manifest.items) {
82
86
  const expected = manifest.plan.items.find(x => x.itemId === item.itemId && x.variantId === item.variantId);
83
87
  if (!expected || expected.inputHash !== item.inputHash) throw new Error('执行记录不属于原始计划');
84
- for (const key of ['prompt', 'seed', 'checks', 'negativeBlock', 'imageArgs']) {
85
- if (hash(item[key]) !== hash(expected[key])) throw new Error(`执行记录已改变:${item.itemId}.${key}`);
88
+ for (const key of ['prompt', 'seed', 'checks', 'negativeBlock', 'imageArgs', 'execution', 'design']) {
89
+ if (hash({value:item[key]}) !== hash({value:expected[key]})) throw new Error(`执行记录已改变:${item.itemId}.${key}`);
86
90
  }
87
91
  }
88
92
  if (!Array.isArray(review)) throw new Error('review 必须为数组');
package/lib/generate.mjs CHANGED
@@ -3,12 +3,13 @@ import { ROOT,loadProject,loadJob,projectPath } from './project.mjs';
3
3
  import {selectCore,corePrompt,coreNegative} from './core.mjs';
4
4
  import {execution,finishPlan} from './plan.mjs';
5
5
  import {presentation,assetPrompt} from './presentation.mjs';
6
+ import {design,designPrompt} from './design.mjs';
6
7
  export function compileGenerate({projectId,jobId,coreId,root=ROOT,localExecution={}}) {
7
8
  const project=loadProject(projectId,root),job=loadJob(projectId,jobId,'generate',root);
8
9
  keys(job,['project','kind','core','profile','execution','items'],'job');
9
10
  const selected=selectCore(project,job,coreId,root),core=selected.core;
10
11
  const profile=readJson(projectPath(root,projectId,'profiles',job.profile));
11
- keys(profile,['project','id','name','constraints','defaults','allowedOverrides','presets','checks'],'profile');
12
+ keys(profile,['project','id','name','constraints','defaults','allowedOverrides','presets','checks','design'],'profile');
12
13
  if(profile.project!==projectId||profile.id!==job.profile) throw new Error('资产配置工程身份不匹配');
13
14
  keys(profile.constraints,['text','frame','scene','crop','shadow'],'constraints');
14
15
  for(const v of Object.values(profile.constraints)) if(typeof v!=='boolean') throw new Error('资产约束必须为布尔值');
@@ -16,7 +17,8 @@ export function compileGenerate({projectId,jobId,coreId,root=ROOT,localExecution
16
17
  const items=[],ids=new Set();
17
18
  if(!Array.isArray(job.items)||!job.items.length) throw new Error('任务 items 必须非空');
18
19
  for(const source of job.items) {
19
- keys(source,['id','seed','intent','entities','effects','relations','composition','mustRead','variants'],'item');
20
+ keys(source,['id','seed','intent','entities','effects','relations','composition','mustRead','variants','design'],'item');
21
+ const d=design(profile,source.design,job.execution);
20
22
  id(source.id); if(ids.has(source.id)) throw new Error('item ID 重复'); ids.add(source.id);
21
23
  text(source.intent,'intent'); texts(source.mustRead,'mustRead');
22
24
  if(!Array.isArray(source.entities)||!source.entities.length) throw new Error('entities 必须非空');
@@ -39,10 +41,10 @@ export function compileGenerate({projectId,jobId,coreId,root=ROOT,localExecution
39
41
  const variants=source.variants?.length?source.variants:[{id:'base'}],variantIds=new Set();
40
42
  for(const variant of variants) {
41
43
  keys(variant,['id','composition','seed'],'variant');id(variant.id); if(variantIds.has(variant.id)) throw new Error('variant ID 重复');variantIds.add(variant.id);
42
- const p=presentation(profile,{...source.composition,...variant.composition});
44
+ const p=presentation(profile,{...source.composition,...variant.composition},d);
43
45
  if(!objectIds.has(p.value.focalTarget)) throw new Error('视觉焦点不存在');
44
46
  const seed=variant.seed??source.seed??parseInt(hash([projectId,jobId,source.id]).slice(0,7),16); integer(seed,'seed');
45
- items.push({itemId:source.id,variantId:variant.id,seed,brief:{...source,composition:p.value},prompt:`【风格核心】\n${corePrompt(core,source.entities.map(e=>e.kind))}\n【真实需求】\n${source.intent}。\n${lines.join('\n')}\n视觉焦点:${p.value.focalTarget}。\n【构图与资产】\n${p.prompt}\n${assetPrompt(profile)}`,negativeBlock:[coreNegative(core),profile.constraints.text?'':'文字, 字母, 水印',profile.constraints.frame?'':'装饰外框'].filter(Boolean).join(', '),imageArgs:[],checks:{content:source.mustRead,style:[corePrompt(core,source.entities.map(e=>e.kind))],asset:[...profile.checks,p.background]}});
47
+ items.push({...(d?{design:d,execution:execution(project,{...job.execution,size:`${d.outputSize.width}*${d.outputSize.height}`},localExecution)}:{}),itemId:source.id,variantId:variant.id,seed,brief:{...source,composition:p.value},prompt:`【风格核心】\n${corePrompt(core,source.entities.map(e=>e.kind))}\n【真实需求】\n${source.intent}。\n${lines.join('\n')}\n视觉焦点:${p.value.focalTarget}。\n【构图与资产】\n${p.prompt}\n${d ? designPrompt(d) : ""}\n${assetPrompt(profile)}`,negativeBlock:[coreNegative(core),profile.constraints.text?'':'文字, 字母, 水印',profile.constraints.frame?'':'装饰外框'].filter(Boolean).join(', '),imageArgs:[],checks:{content:source.mustRead,style:[corePrompt(core,source.entities.map(e=>e.kind))],asset:[...profile.checks,p.background]}});
46
48
  }
47
49
  }
48
50
  return finishPlan({module:'generate',project:projectId,job:jobId,execution:execution(project,job.execution,localExecution),sources:{core:core.id,coreHash:core.coreHash,selection:selected.source},snapshots:{project,core,profile,job},refs:[],items});
package/lib/plan.mjs CHANGED
@@ -10,13 +10,16 @@ export function execution(project, overrides = {},local = {}) {
10
10
  return e;
11
11
  }
12
12
  export function finishPlan(body) {
13
- const items = body.items.map(x => ({...x,inputHash:hash({...x,execution:body.execution})}));
13
+ const items = body.items.map(x => ({...x,inputHash:hash({...x,execution:x.execution??body.execution})}));
14
14
  const plan = {schema:'art-workshop/plan',...body,items}; return {...plan,planHash:hash(plan)};
15
15
  }
16
16
  export function validatePlan(plan) {
17
17
  if(plan.schema !== 'art-workshop/plan' || !['generate','edit'].includes(plan.module) || !plan.items?.length) throw new Error('不是有效的当前计划');
18
18
  const {planHash,...body} = plan; if(hash(body)!==planHash) throw new Error('计划已改变;请修改任务后重新预演');
19
- for(const {inputHash,...item} of plan.items) if(hash({...item,execution:plan.execution})!==inputHash) throw new Error('计划项校验失败');
19
+ for(const {inputHash,...item} of plan.items) {
20
+ execution({},item.execution??plan.execution);
21
+ if(hash({...item,execution:item.execution??plan.execution})!==inputHash) throw new Error('计划项校验失败');
22
+ }
20
23
  }
21
24
  export function selectItems(plan,{item,variant,offset=0,limit}={}) {
22
25
  integer(offset,'offset'); if(limit!==undefined) integer(limit,'limit',1);
@@ -26,7 +29,7 @@ export function selectItems(plan,{item,variant,offset=0,limit}={}) {
26
29
  return result.filter(x=>ids.includes(x.itemId));
27
30
  }
28
31
  export function buildArgs(plan,item,outDir,prefix) {
29
- const e=plan.execution, args=['image',plan.module==='edit'?'edit':'generate'];
32
+ const e=item.execution??plan.execution, args=['image',plan.module==='edit'?'edit':'generate'];
30
33
  for(const path of item.imageArgs) args.push('--image',path);
31
34
  args.push('--prompt',item.prompt,'--model',e.model,'--size',e.size,'--n',String(e.perValue));
32
35
  if(item.negativeBlock) args.push('--negative-prompt',item.negativeBlock);
@@ -6,14 +6,14 @@ export function background(value,allowScene=false) {
6
6
  if(value.type==='scene'&&allowScene) { keys(value,['type','description'],'background'); return `场景背景:${text(value.description,'scene')}。`; }
7
7
  throw new Error('背景类型不支持或资产不允许场景');
8
8
  }
9
- export function presentation(profile,overrides={}) {
9
+ export function presentation(profile,overrides={},design=null) {
10
10
  keys(overrides,['preset','view','direction','occupancy','effectIntensity','background','focalTarget'],'composition');
11
11
  const c={...profile.defaults,...overrides};
12
12
  for(const k of ['preset','view','direction','effectIntensity']) choice(c[k],profile.allowedOverrides[k],k);
13
13
  const range=profile.allowedOverrides.occupancy;
14
14
  if(!Number.isFinite(c.occupancy)||c.occupancy<range.min||c.occupancy>range.max) throw new Error('主体占比越界');
15
15
  const bg=background(c.background,profile.constraints.scene);
16
- return {value:c,prompt:`${profile.presets[c.preset]}。视角:${c.view};方向:${c.direction};整体占画幅约 ${c.occupancy*100}%;效果强度:${c.effectIntensity}。\n${bg}`,background:bg};
16
+ return {value:c,prompt:`${profile.presets[c.preset]}。视角:${c.view};方向:${c.direction};${design?'保持设计宽高比与四周安全留白':'整体占画幅约 '+c.occupancy*100+'%'};效果强度:${c.effectIntensity}。\n${bg}`,background:bg};
17
17
  }
18
18
  export function assetPrompt(profile) {
19
19
  const c=profile.constraints;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevlns/art-workshop",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "description": "美术工坊:统一风格的多工程图片生成与编辑工具",
6
6
  "type": "module",
@@ -15,7 +15,9 @@
15
15
  "scripts/sync-skill.mjs",
16
16
  "README.md",
17
17
  "docs/core-guidance.md",
18
- "LICENSE"
18
+ "LICENSE",
19
+ "v-cli.plugin.json",
20
+ "AGENTS.md"
19
21
  ],
20
22
  "scripts": {
21
23
  "postinstall": "node scripts/sync-skill.mjs",
@@ -40,5 +42,8 @@
40
42
  "access": "public"
41
43
  },
42
44
  "license": "MIT",
43
- "author": "kevlns"
45
+ "author": "kevlns",
46
+ "vCli": {
47
+ "manifest": "v-cli.plugin.json"
48
+ }
44
49
  }
@@ -5,7 +5,7 @@ description: 使用 美术工坊 分析并冻结视觉风格、在多工程中
5
5
 
6
6
  # 美术工坊
7
7
 
8
- 读取同目录 `runtime.json`,通过 `node <entry>` 调用工具;已安装全局命令时可用 `art-workshop`。随包直接使用时,在工具目录执行 `node art-workshop.mjs`。下文用 `art-workshop` 表示该入口。
8
+ 已安装 v-cli 时可用 `v-cli art` 调用全部命令,首次先读取 `v-cli agent docs art`,用 `v-cli agent describe art --json` 发现完整参数。独立调用时读取同目录 `runtime.json`,通过 `node <entry>` 调用工具;已安装全局命令时可用 `art-workshop`。随包直接使用时,在工具目录执行 `node art-workshop.mjs`。下文用 `art-workshop` 表示该入口。
9
9
 
10
10
  先用 `art-workshop config show` 读取本地配置与外部工作目录,再用 `art-workshop agent index` 发现模块、工程及核心;需要完整用法或配置结构时读取 `art-workshop agent docs`。查看实际任务用 `<generate|edit> show --project <工程> --job <任务>`,不要猜测任务或核心身份。
11
11
 
@@ -26,3 +26,22 @@ plan 和 `--dry` 不产生图片、没有远程生图调用;真实分析或 ru
26
26
  随包 skill 是权威来源,`agent init --directory DIR` 同步到 DIR 下已有的 Agent 技能目录;保留项目扩展文件。修改随包源后重新同步,不直接改已同步的 SKILL.md。
27
27
 
28
28
  资源路径:工程、报告、计划、参考图、缓存、编辑原图与输出均放在工具目录之外。默认输出为系统下载目录/image.g。参考目录可用 --refs-dir 指定;其他路径用 --workspace、--output-dir、--cache-dir 覆盖。相对资源文件按 workspace 解析,参考图按 refs 目录解析;不要在安装目录创建工程或产物。本地配置位于用户配置目录,通过 config path/show/init 发现;不纳入 Git。
29
+ ## UI 设计分辨率与单体出图尺寸
30
+
31
+ UI 设计基准属于资产规格,不写进冻结风格核心。文生图 profile 可声明:
32
+
33
+ ```json
34
+ "design": { "resolution": { "width": 1920, "height": 1080 }, "outputScale": 2 }
35
+ ```
36
+
37
+ 任务 item 可声明独立控件尺寸与可选倍率:
38
+
39
+ ```json
40
+ "design": { "width": 240, "height": 80, "outputScale": 4 }
41
+ ```
42
+
43
+ 该按钮实际请求 size 为 960*320。同一任务的其他控件可使用不同设计尺寸;单体没有 design 时按 profile 的整幅设计分辨率出图。未覆盖倍率时继承 profile.outputScale。倍率为 1~4 的整数,设计尺寸为正整数且不得超过基准分辨率;换算后的每条边必须在工具支持的 256~4096 像素范围内,越界报错,不自动拉伸、补边或更改倍率。模型可能有额外尺寸与比例限制,工具的通用范围不等于模型能力保证。
44
+
45
+ 启用设计尺寸时禁止同时设置任务 execution.size;工程和本地 execution.size 默认值被单体换算尺寸替代,模型等其他执行参数保留既有优先级。旧任务不声明 design 时保持原有行为。设计模式的提示词不再附加整体占画幅 75% 等比例要求,而声明设计宽高比和安全留白。
46
+
47
+ 编译计划的每项包含 design(resolution、size、outputScale、outputSize)与实际 execution。预演、真实请求、输入哈希与执行验收使用同一份单体参数。修改设计尺寸后必须重新 plan。此配置控制请求画布,不保证模型精确绘制控件边界、描边或圆角像素,也不自动生成九宫切片、裁切或透明底资源。
@@ -0,0 +1,799 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "package": "@kevlns/art-workshop",
4
+ "command": "art",
5
+ "bin": "art-workshop",
6
+ "description": "美术工坊:多工程风格分析与核心冻结、统一风格文生图及图编辑,支持计划预演与人工验收。",
7
+ "platforms": [
8
+ "win32",
9
+ "linux",
10
+ "darwin"
11
+ ],
12
+ "runtime": {
13
+ "node": ">=20",
14
+ "imageProvider": "bl CLI for remote analysis/generation"
15
+ },
16
+ "environment": [
17
+ {
18
+ "name": "ART_WORKSHOP_CONFIG",
19
+ "description": "外部本地配置文件路径;未指定时使用用户配置目录/art-workshop/config.json"
20
+ },
21
+ {
22
+ "name": "CODEX_HOME",
23
+ "description": "可选 Codex 配置目录,用于随包 skill 同步"
24
+ }
25
+ ],
26
+ "agent": {
27
+ "whenToUse": "视觉风格分析与冻结、基于正确工程核心生成统一风格图片、按修改与保留计划编辑现有图片,或查看 refs 分类、预演与验收。先 config show 和 agent index 选择工程,远程分析及生图须有任务授权。",
28
+ "globalOptions": [
29
+ {
30
+ "flags": "--config <file>",
31
+ "description": "外部本地配置文件"
32
+ },
33
+ {
34
+ "flags": "--workspace <dir>",
35
+ "description": "外部工程与任务根目录"
36
+ },
37
+ {
38
+ "flags": "--output-dir <dir>",
39
+ "description": "外部产物目录,默认系统下载目录/image.g"
40
+ },
41
+ {
42
+ "flags": "--refs-dir <dir>",
43
+ "description": "外部参考图目录"
44
+ },
45
+ {
46
+ "flags": "--cache-dir <dir>",
47
+ "description": "外部缓存目录"
48
+ },
49
+ {
50
+ "flags": "-V, --version",
51
+ "description": "单独使用,显示工具版本"
52
+ },
53
+ {
54
+ "flags": "-h, --help",
55
+ "description": "单独使用,显示入口帮助"
56
+ }
57
+ ],
58
+ "commands": [
59
+ {
60
+ "path": [
61
+ "help"
62
+ ],
63
+ "usage": "art-workshop help",
64
+ "description": "显示命令入口与 v-cli 发现方式",
65
+ "arguments": [],
66
+ "options": [],
67
+ "output": {
68
+ "format": "text",
69
+ "description": "显示命令入口与 v-cli 发现方式"
70
+ },
71
+ "exitCodes": {
72
+ "0": "成功;验收状态以返回内容为准",
73
+ "1": "参数、配置、计划或执行失败"
74
+ },
75
+ "safety": [
76
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
77
+ "无网络调用"
78
+ ]
79
+ },
80
+ {
81
+ "path": [
82
+ "config",
83
+ "path"
84
+ ],
85
+ "usage": "art-workshop config path",
86
+ "description": "显示本地配置文件路径",
87
+ "arguments": [],
88
+ "options": [],
89
+ "output": {
90
+ "format": "text",
91
+ "description": "显示本地配置文件路径"
92
+ },
93
+ "exitCodes": {
94
+ "0": "成功;验收状态以返回内容为准",
95
+ "1": "参数、配置、计划或执行失败"
96
+ },
97
+ "safety": [
98
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
99
+ "无网络调用"
100
+ ]
101
+ },
102
+ {
103
+ "path": [
104
+ "config",
105
+ "show"
106
+ ],
107
+ "usage": "art-workshop config show",
108
+ "description": "显示生效的本地配置和外部资源路径",
109
+ "arguments": [],
110
+ "options": [],
111
+ "output": {
112
+ "format": "json",
113
+ "description": "显示生效的本地配置和外部资源路径"
114
+ },
115
+ "exitCodes": {
116
+ "0": "成功;验收状态以返回内容为准",
117
+ "1": "参数、配置、计划或执行失败"
118
+ },
119
+ "safety": [
120
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
121
+ "无网络调用"
122
+ ]
123
+ },
124
+ {
125
+ "path": [
126
+ "config",
127
+ "init"
128
+ ],
129
+ "usage": "art-workshop config init",
130
+ "description": "配置不存在时创建本地模板;已存在时读取,不覆盖",
131
+ "arguments": [],
132
+ "options": [],
133
+ "output": {
134
+ "format": "json",
135
+ "description": "配置不存在时创建本地模板;已存在时读取,不覆盖"
136
+ },
137
+ "exitCodes": {
138
+ "0": "成功;验收状态以返回内容为准",
139
+ "1": "参数、配置、计划或执行失败"
140
+ },
141
+ "safety": [
142
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
143
+ "无网络调用",
144
+ "写入外部本地配置"
145
+ ]
146
+ },
147
+ {
148
+ "path": [
149
+ "refs",
150
+ "guide"
151
+ ],
152
+ "usage": "art-workshop refs guide [--project <id>]",
153
+ "description": "解释参考分类目录的用途与推荐图片样式",
154
+ "arguments": [],
155
+ "options": [
156
+ {
157
+ "flags": "--project <id>",
158
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
159
+ }
160
+ ],
161
+ "output": {
162
+ "format": "text",
163
+ "description": "解释参考分类目录的用途与推荐图片样式"
164
+ },
165
+ "exitCodes": {
166
+ "0": "成功;验收状态以返回内容为准",
167
+ "1": "参数、配置、计划或执行失败"
168
+ },
169
+ "safety": [
170
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
171
+ "无网络调用"
172
+ ]
173
+ },
174
+ {
175
+ "path": [
176
+ "agent",
177
+ "index"
178
+ ],
179
+ "usage": "art-workshop agent index",
180
+ "description": "发现模块、工程、核心、任务与随包 skill",
181
+ "arguments": [],
182
+ "options": [],
183
+ "output": {
184
+ "format": "json",
185
+ "description": "发现模块、工程、核心、任务与随包 skill"
186
+ },
187
+ "exitCodes": {
188
+ "0": "成功;验收状态以返回内容为准",
189
+ "1": "参数、配置、计划或执行失败"
190
+ },
191
+ "safety": [
192
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
193
+ "无网络调用"
194
+ ]
195
+ },
196
+ {
197
+ "path": [
198
+ "agent",
199
+ "docs"
200
+ ],
201
+ "usage": "art-workshop agent docs",
202
+ "description": "输出完整使用规范与核心冻结指导",
203
+ "arguments": [],
204
+ "options": [],
205
+ "output": {
206
+ "format": "text",
207
+ "description": "输出完整使用规范与核心冻结指导"
208
+ },
209
+ "exitCodes": {
210
+ "0": "成功;验收状态以返回内容为准",
211
+ "1": "参数、配置、计划或执行失败"
212
+ },
213
+ "safety": [
214
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
215
+ "无网络调用"
216
+ ]
217
+ },
218
+ {
219
+ "path": [
220
+ "agent",
221
+ "init"
222
+ ],
223
+ "usage": "art-workshop agent init [--directory <dir>] [--dry]",
224
+ "description": "将随包 skill 同步到目标下已有 Agent 技能目录",
225
+ "arguments": [],
226
+ "options": [
227
+ {
228
+ "flags": "--directory <dir>",
229
+ "description": "同步目标根目录,默认 cwd"
230
+ },
231
+ {
232
+ "flags": "--dry",
233
+ "description": "预演,不调用远程模型;仍补齐 refs 分类目录"
234
+ }
235
+ ],
236
+ "output": {
237
+ "format": "json",
238
+ "description": "将随包 skill 同步到目标下已有 Agent 技能目录"
239
+ },
240
+ "exitCodes": {
241
+ "0": "成功;验收状态以返回内容为准",
242
+ "1": "参数、配置、计划或执行失败"
243
+ },
244
+ "safety": [
245
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
246
+ "无网络调用",
247
+ "覆盖同名随包 skill 和 runtime.json,保留扩展文件"
248
+ ]
249
+ },
250
+ {
251
+ "path": [
252
+ "list"
253
+ ],
254
+ "usage": "art-workshop list",
255
+ "description": "列出外部工作目录中的工程",
256
+ "arguments": [],
257
+ "options": [],
258
+ "output": {
259
+ "format": "json",
260
+ "description": "列出外部工作目录中的工程"
261
+ },
262
+ "exitCodes": {
263
+ "0": "成功;验收状态以返回内容为准",
264
+ "1": "参数、配置、计划或执行失败"
265
+ },
266
+ "safety": [
267
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
268
+ "无网络调用"
269
+ ]
270
+ },
271
+ {
272
+ "path": [
273
+ "style",
274
+ "analyze"
275
+ ],
276
+ "usage": "art-workshop style analyze [--project <id>] [--input <file>] [--out <file>] [--dry]",
277
+ "description": "通过具备视觉能力的模型生成风格报告与推荐配置",
278
+ "arguments": [],
279
+ "options": [
280
+ {
281
+ "flags": "--project <id>",
282
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
283
+ },
284
+ {
285
+ "flags": "--input <file>",
286
+ "description": "分析输入 JSON,引用图片按 refs 解析"
287
+ },
288
+ {
289
+ "flags": "--out <file>",
290
+ "description": "可选外部输出文件;相对路径基于 workspace"
291
+ },
292
+ {
293
+ "flags": "--dry",
294
+ "description": "预演,不调用远程模型;仍补齐 refs 分类目录"
295
+ }
296
+ ],
297
+ "output": {
298
+ "format": "json",
299
+ "description": "通过具备视觉能力的模型生成风格报告与推荐配置"
300
+ },
301
+ "exitCodes": {
302
+ "0": "成功;验收状态以返回内容为准",
303
+ "1": "参数、配置、计划或执行失败"
304
+ },
305
+ "safety": [
306
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
307
+ "非 dry 会调用远程模型并产生费用",
308
+ "非 dry 可写入外部报告和分析缓存",
309
+ "不自动冻结核心"
310
+ ]
311
+ },
312
+ {
313
+ "path": [
314
+ "style",
315
+ "validate"
316
+ ],
317
+ "usage": "art-workshop style validate [--project <id>] [--report <file>]",
318
+ "description": "校验报告及核心规则的一致性",
319
+ "arguments": [],
320
+ "options": [
321
+ {
322
+ "flags": "--project <id>",
323
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
324
+ },
325
+ {
326
+ "flags": "--report <file>",
327
+ "description": "风格报告 JSON,相对路径基于 workspace"
328
+ }
329
+ ],
330
+ "output": {
331
+ "format": "json",
332
+ "description": "校验报告及核心规则的一致性"
333
+ },
334
+ "exitCodes": {
335
+ "0": "成功;验收状态以返回内容为准",
336
+ "1": "参数、配置、计划或执行失败"
337
+ },
338
+ "safety": [
339
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
340
+ "无网络调用"
341
+ ]
342
+ },
343
+ {
344
+ "path": [
345
+ "style",
346
+ "freeze"
347
+ ],
348
+ "usage": "art-workshop style freeze [--project <id>] [--report <file>] [--note <text>]",
349
+ "description": "采用报告并冻结核心,将核心绑定到当前工程",
350
+ "arguments": [],
351
+ "options": [
352
+ {
353
+ "flags": "--project <id>",
354
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
355
+ },
356
+ {
357
+ "flags": "--report <file>",
358
+ "description": "风格报告 JSON,相对路径基于 workspace"
359
+ },
360
+ {
361
+ "flags": "--note <text>",
362
+ "description": "冻结备注"
363
+ }
364
+ ],
365
+ "output": {
366
+ "format": "json",
367
+ "description": "采用报告并冻结核心,将核心绑定到当前工程"
368
+ },
369
+ "exitCodes": {
370
+ "0": "成功;验收状态以返回内容为准",
371
+ "1": "参数、配置、计划或执行失败"
372
+ },
373
+ "safety": [
374
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
375
+ "须有用户采用报告的授权",
376
+ "写入外部工程核心和 project.json,拒绝覆写已有核心",
377
+ "无网络调用"
378
+ ]
379
+ },
380
+ {
381
+ "path": [
382
+ "style",
383
+ "show"
384
+ ],
385
+ "usage": "art-workshop style show [--project <id>] [--core <id>]",
386
+ "description": "读取当前工程的指定冻结核心并验证完整性",
387
+ "arguments": [],
388
+ "options": [
389
+ {
390
+ "flags": "--project <id>",
391
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
392
+ },
393
+ {
394
+ "flags": "--core <id>",
395
+ "description": "工程内冻结核心 ID;显式选择与任务绑定冲突时拒绝执行"
396
+ }
397
+ ],
398
+ "output": {
399
+ "format": "json",
400
+ "description": "读取当前工程的指定冻结核心并验证完整性"
401
+ },
402
+ "exitCodes": {
403
+ "0": "成功;验收状态以返回内容为准",
404
+ "1": "参数、配置、计划或执行失败"
405
+ },
406
+ "safety": [
407
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
408
+ "无网络调用"
409
+ ]
410
+ },
411
+ {
412
+ "path": [
413
+ "generate",
414
+ "show"
415
+ ],
416
+ "usage": "art-workshop generate show [--project <id>] [--job <id>]",
417
+ "description": "读取文生图任务",
418
+ "arguments": [],
419
+ "options": [
420
+ {
421
+ "flags": "--project <id>",
422
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
423
+ },
424
+ {
425
+ "flags": "--job <id>",
426
+ "description": "工程内任务 ID"
427
+ }
428
+ ],
429
+ "output": {
430
+ "format": "json",
431
+ "description": "读取文生图任务"
432
+ },
433
+ "exitCodes": {
434
+ "0": "成功;验收状态以返回内容为准",
435
+ "1": "参数、配置、计划或执行失败"
436
+ },
437
+ "safety": [
438
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
439
+ "无网络调用"
440
+ ]
441
+ },
442
+ {
443
+ "path": [
444
+ "generate",
445
+ "plan"
446
+ ],
447
+ "usage": "art-workshop generate plan [--project <id>] [--job <id>] [--core <id>] [--out <file>]",
448
+ "description": "编译文生图计划,明确来源及真实请求",
449
+ "arguments": [],
450
+ "options": [
451
+ {
452
+ "flags": "--project <id>",
453
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
454
+ },
455
+ {
456
+ "flags": "--job <id>",
457
+ "description": "工程内任务 ID"
458
+ },
459
+ {
460
+ "flags": "--core <id>",
461
+ "description": "工程内冻结核心 ID;显式选择与任务绑定冲突时拒绝执行"
462
+ },
463
+ {
464
+ "flags": "--out <file>",
465
+ "description": "可选外部输出文件;相对路径基于 workspace"
466
+ }
467
+ ],
468
+ "output": {
469
+ "format": "json",
470
+ "description": "编译文生图计划,明确来源及真实请求"
471
+ },
472
+ "exitCodes": {
473
+ "0": "成功;验收状态以返回内容为准",
474
+ "1": "参数、配置、计划或执行失败"
475
+ },
476
+ "safety": [
477
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
478
+ "无网络调用",
479
+ "指定 out 时写入外部计划文件"
480
+ ]
481
+ },
482
+ {
483
+ "path": [
484
+ "generate",
485
+ "run"
486
+ ],
487
+ "usage": "art-workshop generate run [--plan <file>] [--project <id>] [--job <id>] [--core <id>] [--item <id>] [--variant <id>] [--explore] [--offset <n>] [--limit <n>] [--dry]",
488
+ "description": "执行或预演文生图计划",
489
+ "arguments": [],
490
+ "options": [
491
+ {
492
+ "flags": "--plan <file>",
493
+ "description": "冻结计划文件;不能同时指定 project/job/core/explore"
494
+ },
495
+ {
496
+ "flags": "--project <id>",
497
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
498
+ },
499
+ {
500
+ "flags": "--job <id>",
501
+ "description": "工程内任务 ID"
502
+ },
503
+ {
504
+ "flags": "--core <id>",
505
+ "description": "工程内冻结核心 ID;显式选择与任务绑定冲突时拒绝执行"
506
+ },
507
+ {
508
+ "flags": "--item <id>",
509
+ "description": "选择单体"
510
+ },
511
+ {
512
+ "flags": "--variant <id>",
513
+ "description": "选择候选,默认 base"
514
+ },
515
+ {
516
+ "flags": "--explore",
517
+ "description": "执行全部候选;仅在从任务编译时使用"
518
+ },
519
+ {
520
+ "flags": "--offset <n>",
521
+ "description": "选择起始偏移,默认 0"
522
+ },
523
+ {
524
+ "flags": "--limit <n>",
525
+ "description": "执行数量上限"
526
+ },
527
+ {
528
+ "flags": "--dry",
529
+ "description": "预演,不调用远程模型;仍补齐 refs 分类目录"
530
+ }
531
+ ],
532
+ "output": {
533
+ "format": "stdout",
534
+ "description": "执行或预演文生图计划"
535
+ },
536
+ "exitCodes": {
537
+ "0": "成功;验收状态以返回内容为准",
538
+ "1": "参数、配置、计划或执行失败"
539
+ },
540
+ "safety": [
541
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
542
+ "非 dry 调用远程模型并产生费用,需任务授权",
543
+ "真实执行写入外部图片及 manifest",
544
+ "预演展示请求,不生成图片"
545
+ ]
546
+ },
547
+ {
548
+ "path": [
549
+ "edit",
550
+ "show"
551
+ ],
552
+ "usage": "art-workshop edit show [--project <id>] [--job <id>]",
553
+ "description": "读取图编辑任务",
554
+ "arguments": [],
555
+ "options": [
556
+ {
557
+ "flags": "--project <id>",
558
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
559
+ },
560
+ {
561
+ "flags": "--job <id>",
562
+ "description": "工程内任务 ID"
563
+ }
564
+ ],
565
+ "output": {
566
+ "format": "json",
567
+ "description": "读取图编辑任务"
568
+ },
569
+ "exitCodes": {
570
+ "0": "成功;验收状态以返回内容为准",
571
+ "1": "参数、配置、计划或执行失败"
572
+ },
573
+ "safety": [
574
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
575
+ "无网络调用"
576
+ ]
577
+ },
578
+ {
579
+ "path": [
580
+ "edit",
581
+ "plan"
582
+ ],
583
+ "usage": "art-workshop edit plan [--project <id>] [--job <id>] [--core <id>] [--out <file>]",
584
+ "description": "编译图编辑计划,明确来源及真实请求",
585
+ "arguments": [],
586
+ "options": [
587
+ {
588
+ "flags": "--project <id>",
589
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
590
+ },
591
+ {
592
+ "flags": "--job <id>",
593
+ "description": "工程内任务 ID"
594
+ },
595
+ {
596
+ "flags": "--core <id>",
597
+ "description": "工程内冻结核心 ID;显式选择与任务绑定冲突时拒绝执行"
598
+ },
599
+ {
600
+ "flags": "--out <file>",
601
+ "description": "可选外部输出文件;相对路径基于 workspace"
602
+ }
603
+ ],
604
+ "output": {
605
+ "format": "json",
606
+ "description": "编译图编辑计划,明确来源及真实请求"
607
+ },
608
+ "exitCodes": {
609
+ "0": "成功;验收状态以返回内容为准",
610
+ "1": "参数、配置、计划或执行失败"
611
+ },
612
+ "safety": [
613
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
614
+ "无网络调用",
615
+ "指定 out 时写入外部计划文件"
616
+ ]
617
+ },
618
+ {
619
+ "path": [
620
+ "edit",
621
+ "run"
622
+ ],
623
+ "usage": "art-workshop edit run [--plan <file>] [--project <id>] [--job <id>] [--core <id>] [--item <id>] [--variant <id>] [--explore] [--offset <n>] [--limit <n>] [--dry]",
624
+ "description": "执行或预演图编辑计划",
625
+ "arguments": [],
626
+ "options": [
627
+ {
628
+ "flags": "--plan <file>",
629
+ "description": "冻结计划文件;不能同时指定 project/job/core/explore"
630
+ },
631
+ {
632
+ "flags": "--project <id>",
633
+ "description": "工程 ID;未指定时使用本地 defaultProject,不跨工程回退"
634
+ },
635
+ {
636
+ "flags": "--job <id>",
637
+ "description": "工程内任务 ID"
638
+ },
639
+ {
640
+ "flags": "--core <id>",
641
+ "description": "工程内冻结核心 ID;显式选择与任务绑定冲突时拒绝执行"
642
+ },
643
+ {
644
+ "flags": "--item <id>",
645
+ "description": "选择单体"
646
+ },
647
+ {
648
+ "flags": "--variant <id>",
649
+ "description": "选择候选,默认 base"
650
+ },
651
+ {
652
+ "flags": "--explore",
653
+ "description": "执行全部候选;仅在从任务编译时使用"
654
+ },
655
+ {
656
+ "flags": "--offset <n>",
657
+ "description": "选择起始偏移,默认 0"
658
+ },
659
+ {
660
+ "flags": "--limit <n>",
661
+ "description": "执行数量上限"
662
+ },
663
+ {
664
+ "flags": "--dry",
665
+ "description": "预演,不调用远程模型;仍补齐 refs 分类目录"
666
+ }
667
+ ],
668
+ "output": {
669
+ "format": "stdout",
670
+ "description": "执行或预演图编辑计划"
671
+ },
672
+ "exitCodes": {
673
+ "0": "成功;验收状态以返回内容为准",
674
+ "1": "参数、配置、计划或执行失败"
675
+ },
676
+ "safety": [
677
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
678
+ "非 dry 调用远程模型并产生费用,需任务授权",
679
+ "真实执行写入外部图片及 manifest",
680
+ "预演展示请求,不生成图片"
681
+ ]
682
+ },
683
+ {
684
+ "path": [
685
+ "check"
686
+ ],
687
+ "usage": "art-workshop check RUN [--review <file>] [--out <file>]",
688
+ "description": "导出或汇总人工验收;不自动评价图片",
689
+ "arguments": [
690
+ {
691
+ "name": "RUN",
692
+ "description": "运行目录或 manifest 路径,按 output 解析",
693
+ "required": true
694
+ }
695
+ ],
696
+ "options": [
697
+ {
698
+ "flags": "--review <file>",
699
+ "description": "人工 review JSON"
700
+ },
701
+ {
702
+ "flags": "--out <file>",
703
+ "description": "可选外部输出文件;相对路径基于 workspace"
704
+ }
705
+ ],
706
+ "output": {
707
+ "format": "json",
708
+ "description": "导出或汇总人工验收;不自动评价图片"
709
+ },
710
+ "exitCodes": {
711
+ "0": "成功;验收状态以返回内容为准",
712
+ "1": "参数、配置、计划或执行失败"
713
+ },
714
+ "safety": [
715
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
716
+ "无网络调用",
717
+ "指定 out 时写入外部验收文件"
718
+ ]
719
+ },
720
+ {
721
+ "path": [
722
+ "select"
723
+ ],
724
+ "usage": "art-workshop select RUN [--item <id>] [--variant <id>] [--review <file>] [--file <path>]",
725
+ "description": "选择完整性有效且 content/style/asset 全部通过的唯一产物",
726
+ "arguments": [
727
+ {
728
+ "name": "RUN",
729
+ "description": "运行目录或 manifest 路径,按 output 解析",
730
+ "required": true
731
+ }
732
+ ],
733
+ "options": [
734
+ {
735
+ "flags": "--item <id>",
736
+ "description": "必须指定单体"
737
+ },
738
+ {
739
+ "flags": "--variant <id>",
740
+ "description": "必须指定候选"
741
+ },
742
+ {
743
+ "flags": "--review <file>",
744
+ "description": "人工 review JSON"
745
+ },
746
+ {
747
+ "flags": "--file <path>",
748
+ "description": "选择记录内的图片文件"
749
+ }
750
+ ],
751
+ "output": {
752
+ "format": "json",
753
+ "description": "选择完整性有效且 content/style/asset 全部通过的唯一产物"
754
+ },
755
+ "exitCodes": {
756
+ "0": "成功;验收状态以返回内容为准",
757
+ "1": "参数、配置、计划或执行失败"
758
+ },
759
+ "safety": [
760
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
761
+ "无网络调用",
762
+ "写回外部 manifest 的验收与选择记录"
763
+ ]
764
+ },
765
+ {
766
+ "path": [
767
+ "compare"
768
+ ],
769
+ "usage": "art-workshop compare BEFORE AFTER",
770
+ "description": "比较两份计划或执行记录的核心、执行配置和单体变更",
771
+ "arguments": [
772
+ {
773
+ "name": "BEFORE",
774
+ "description": "前一份计划/执行记录 JSON,按 workspace 解析",
775
+ "required": true
776
+ },
777
+ {
778
+ "name": "AFTER",
779
+ "description": "后一份计划/执行记录 JSON,按 workspace 解析",
780
+ "required": true
781
+ }
782
+ ],
783
+ "options": [],
784
+ "output": {
785
+ "format": "json",
786
+ "description": "比较两份计划或执行记录的核心、执行配置和单体变更"
787
+ },
788
+ "exitCodes": {
789
+ "0": "成功;验收状态以返回内容为准",
790
+ "1": "参数、配置、计划或执行失败"
791
+ },
792
+ "safety": [
793
+ "配置生效时补齐外部 refs 分类目录,不覆盖素材",
794
+ "无网络调用"
795
+ ]
796
+ }
797
+ ]
798
+ }
799
+ }