@petercjl/taobao-ai-ops 0.4.0 → 0.4.1
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/package.json +1 -1
- package/skills/taobao-ai-operations/SKILL.md +2 -2
- package/src/cli.mjs +3 -3
- package/src/runtime.mjs +6 -2
- package/suite-manifest.json +4 -2
package/package.json
CHANGED
|
@@ -75,8 +75,8 @@ Before every audio component invocation, the suite checks stable latest, install
|
|
|
75
75
|
|
|
76
76
|
用户要求把旧详情页、产品摄影、主 KV 或 SKU 转为抱抱云朵社品牌视觉,或按当前模特设定延展画面时,选择 `cloud-hug-style-transfer` 节点。它由独立 npm 包 `@petercjl/cloud-hug-style-transfer` 拥有;套件只负责安装更新、精确来源解析、调用与检查。
|
|
77
77
|
|
|
78
|
-
先通过 `taobao-ai-ops skill source --name cloud-hug-style-transfer --json` 获取规范来源,完整读取当前 SKILL.md,按其中节点加载本轮参考与当前宿主适配,再回到本套件主线。执行前运行 `taobao-ai-ops doctor --node cloud-hug-style-transfer --json
|
|
78
|
+
先通过 `taobao-ai-ops skill source --name cloud-hug-style-transfer --json` 获取规范来源,完整读取当前 SKILL.md,按其中节点加载本轮参考与当前宿主适配,再回到本套件主线。执行前运行 `taobao-ai-ops doctor --node cloud-hug-style-transfer --json`:它核对组件资源、完整性及必需的 sealseek-media-cli 依赖,宿主仍须核验实际看图、命令执行及结果交付能力。组件业务 CLI 通过 `taobao-ai-ops component run cloud-hug-style-transfer ...` 调用;生图由 @petercjl/sealseek-media-cli 及其当前规范 sealseek-media Skill 统一执行,品牌判断由应用负责。
|
|
79
79
|
|
|
80
80
|
输入为当次源图、商品依据和用户目标,可补充已确认文案、比例和版式要求。输出为本轮约定数量的独立成图及简短验收说明,或仅要求的转换规划。品牌方法、人物与产品约束、素材选择、摄影与排版顺序、提示词、任务恢复及效果验收由子 Skill 的当前主线承接。遇到来源/合同不兼容、缺失资产或宿主能力不可用时,保留子层结构化错误并停止受影响阶段;满足条件后回到子层执行节点,完成后返回套件主线第 6 步交付。
|
|
81
81
|
|
|
82
|
-
独立包与素材不复制到套件。普通业务使用已安装版本;显式套件更新获取该组件的正式 latest 并同步受管 Skill
|
|
82
|
+
独立包与素材不复制到套件。普通业务使用已安装版本;显式套件更新获取该组件的正式 latest 并同步受管 Skill。本应用依赖 sealseek-media-cli(0.6.1+)和配套 sealseek-media Skill;缺失或不兼容时暂停整个应用任务,给出“请安装 npm 包 @petercjl/sealseek-media-cli。”,安装并复查通过后恢复。模型和服务授权遵循媒体包当前合同,其他应用的生图路由保持各自合同。
|
package/src/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {spawnSync} from 'node:child_process';
|
|
|
3
3
|
import {MANIFEST,PACKAGE,nodeFor,source,nodeVersion,fileHashes,digest,fail,componentRecords,componentRecord} from './core.mjs';
|
|
4
4
|
import {checkComponents,installComponents,registerComponent,prepareComponentRun} from './components.mjs';
|
|
5
5
|
import {targetRoot,status,install} from './skill-manager.mjs';
|
|
6
|
-
import {runScript,doctor,toolEntry} from './runtime.mjs';
|
|
6
|
+
import {runScript,doctor,toolEntry,componentEnvironment} from './runtime.mjs';
|
|
7
7
|
import {plan,workflowStatus,createHandoff} from './workflow.mjs';
|
|
8
8
|
import {checkUpdate,installUpdate} from './update.mjs';
|
|
9
9
|
const print=v=>console.log(JSON.stringify(v,null,2));
|
|
@@ -15,11 +15,11 @@ export async function main(argv){
|
|
|
15
15
|
if(command==='script')return runScript(action,rest[0],rest.slice(1));
|
|
16
16
|
if(command==='component'&&action==='run'){
|
|
17
17
|
await prepareComponentRun(rest[0]);
|
|
18
|
-
const record=componentRecord(rest[0]);const r=spawnSync(process.execPath,[record.entry,...rest.slice(1)],{stdio:'inherit',env:
|
|
18
|
+
const record=componentRecord(rest[0]);const r=spawnSync(process.execPath,[record.entry,...rest.slice(1)],{stdio:'inherit',env:componentEnvironment(rest[0])});if(r.error)throw fail('EXECUTION_FAILED',r.error.message);process.exitCode=r.status??1;return;
|
|
19
19
|
}
|
|
20
20
|
if(command==='tool'&&action==='run'){
|
|
21
21
|
await prepareComponentRun(MANIFEST.tools[rest[0]]?.component);
|
|
22
|
-
const entry=toolEntry(rest[0]);const r=spawnSync(entry.command,[...entry.args,...rest.slice(1)],{stdio:'inherit',env:
|
|
22
|
+
const entry=toolEntry(rest[0]);const r=spawnSync(entry.command,[...entry.args,...rest.slice(1)],{stdio:'inherit',env:componentEnvironment(MANIFEST.tools[rest[0]]?.component)});if(r.error)throw fail('CAPABILITY_UNAVAILABLE',r.error.message);process.exitCode=r.status??1;return;
|
|
23
23
|
}
|
|
24
24
|
if(command==='nodes'&&action==='list')return print(MANIFEST.nodes);
|
|
25
25
|
if(command==='node'&&action==='show')return print(nodeFor(rest[0]));
|
package/src/runtime.mjs
CHANGED
|
@@ -3,7 +3,11 @@ import path from 'node:path';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import {spawnSync} from 'node:child_process';
|
|
5
5
|
import {createRequire} from 'node:module';
|
|
6
|
-
import {ROOT,MANIFEST,PACKAGE,nodeFor,source,componentRecord,fail} from './core.mjs';
|
|
6
|
+
import {ROOT,MANIFEST,PACKAGE,nodeFor,source,componentRecord,componentRecords,fail} from './core.mjs';
|
|
7
|
+
export function componentEnvironment(id,env=process.env){
|
|
8
|
+
const media=componentRecords()['sealseek-media'];
|
|
9
|
+
return {...env,TBCLI_UPDATE_CHECK:'0',SYCMCLI_DISABLE_AUTO_UPDATE:'1',SEEDAUDIO_AUTO_UPDATE:'0',SEALSEEK_MEDIA_AUTO_UPDATE:'0',COMPETITOR_CANVAS_AUTO_UPDATE:'0',...(id==='cloud-hug-style-transfer'&&media&&!env.CLOUD_HUG_MEDIA_ROOT?{CLOUD_HUG_MEDIA_ROOT:media.root}:{})};
|
|
10
|
+
}
|
|
7
11
|
export function pythonEnvironment(env=process.env){
|
|
8
12
|
return {...env,PYTHONUTF8:'1',PYTHONIOENCODING:'utf-8',PYTHONDONTWRITEBYTECODE:'1'};
|
|
9
13
|
}
|
|
@@ -75,7 +79,7 @@ export async function doctor(id,mode='excel'){
|
|
|
75
79
|
}
|
|
76
80
|
if(n.component==='cloud-hug-style-transfer'){
|
|
77
81
|
const record=componentRecord(n.component);
|
|
78
|
-
const result=spawnSync(process.execPath,[record.entry,'doctor','--json'],{encoding:'utf8',timeout:30000});
|
|
82
|
+
const result=spawnSync(process.execPath,[record.entry,'doctor','--json'],{encoding:'utf8',timeout:30000,env:componentEnvironment(n.component)});
|
|
79
83
|
let detail;try{detail=JSON.parse(result.stdout);}catch{detail={ok:false,code:'COMPONENT_DOCTOR_FAILED'};}
|
|
80
84
|
checks.push({id:'cloud-hug-node',ok:Number(process.versions.node.split('.')[0])>=22,value:process.version,minimum:22});
|
|
81
85
|
checks.push({id:'cloud-hug-component-integrity',ok:result.status===0&&detail.ok===true&&detail.package===MANIFEST.components[n.component].package&&detail.version===record.version&&detail.integrity?.ok===true,value:detail});
|
package/suite-manifest.json
CHANGED
|
@@ -230,8 +230,10 @@
|
|
|
230
230
|
"skill": "cloud-hug-style-transfer",
|
|
231
231
|
"component": "cloud-hug-style-transfer",
|
|
232
232
|
"stage": "visual-production",
|
|
233
|
-
"method_version": "cloud-hug-style-transfer@0.
|
|
234
|
-
"requires_skills": [
|
|
233
|
+
"method_version": "cloud-hug-style-transfer@0.2",
|
|
234
|
+
"requires_skills": [
|
|
235
|
+
"sealseek-media"
|
|
236
|
+
],
|
|
235
237
|
"python_imports": [],
|
|
236
238
|
"scripts": [],
|
|
237
239
|
"native_requirements": [
|