@petercjl/taobao-ai-ops 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/requirements.txt +1 -0
- package/skills/taobao-ai-operations/SKILL.md +3 -0
- package/src/runtime.mjs +7 -1
- package/suite-manifest.json +25 -2
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ SealSeek 用户改用 --agent sealseek。目标有歧义时通过 SEALSEEK_SKILL
|
|
|
24
24
|
- @petercjl/taobao-search-product-form:搜索结果数据和商品形态研究、机会判断卡及 HTML。
|
|
25
25
|
- @petercjl/tbcli:淘宝数据与 NAS 数据库工具,含其独立 Skill。
|
|
26
26
|
- @petercjl/sycmcli:店铺经营数据工具,含其独立 Skill。
|
|
27
|
+
- @petercjl/commerce-ui:通用 HTML 报告 Skill、模板、渲染与校验。调用 `taobao-ai-ops component run html-report ...`;Python 依赖不足时通过该入口执行 `runtime install --yes`。
|
|
27
28
|
- taobao-ai-operations:套件自带的管理与业务路由 Skill。
|
|
28
29
|
|
|
29
30
|
yccli 为取数时按需准备的外部工具,可用 TAOBAO_AI_OPS_YCCLI 指定;Excel 分析不需要 NAS、VPN 或平台登录。账号与授权留在包外,安装不会获得服务权限。
|
package/package.json
CHANGED
package/requirements.txt
CHANGED
|
@@ -10,6 +10,7 @@ Input: an operator's goal, supplied workbooks or authorized data sources, option
|
|
|
10
10
|
## Main line
|
|
11
11
|
|
|
12
12
|
1. Resolve the requested business result with `taobao-ai-ops nodes list --json`. A category/monthly market question uses `category-research`; a search-result workbook and concrete research object use `product-research`. Existing product scope can enter product research directly. If no supported node covers the request, report the missing node.
|
|
13
|
+
A supplied analysis or compatible ViewModel requiring a reusable HTML report uses `html-report`, whose exact Skill is `compact-commerce-ui`. It supplies reporting methods, not business conclusions; existing category/product outputs keep their own declared contracts.
|
|
13
14
|
2. Run `taobao-ai-ops doctor --node NODE --mode excel --json` for local workbooks, or `--mode nas` for live category data. Doctor checks deterministic resources; verify any listed native capabilities in the active Agent before their stage. A missing dependency ends the affected node with its exact error.
|
|
14
15
|
3. Resolve the exact child Skill with `taobao-ai-ops skill source --name SKILL --json`. Read its complete current SKILL.md, load its platform adapter, then follow only the child node's current reference routes. The logical dependencies are `yuce-category-opportunity-report` (method contract `yuce-category-opportunity@2.0`) and `taobao-search-product-form` (imported method `0.1.1`). Their returned artifacts and source hashes are the handoff; resolution or contract failure stops with CAPABILITY_UNAVAILABLE or OUTPUT_CONTRACT_FAILED. Return here at step 4 after the child completes. Naming a Skill alone is not execution.
|
|
15
16
|
4. Preserve the child's analysis, full HTML and evidence files. Use `taobao-ai-ops workflow plan --run-dir NEW_DIR --node NODE --input WORKBOOK --json` when a durable suite plan is requested; this records a plan and fixed suite/method versions, not business completion. The product node's own stage ledger remains authoritative for its detailed execution.
|
|
@@ -22,6 +23,8 @@ Component scripts run via `taobao-ai-ops script NODE SCRIPT ...`; supplied Excel
|
|
|
22
23
|
|
|
23
24
|
When a child was installed by the shell, forward its CLI examples through `taobao-ai-ops component run COMPONENT ...`, retaining all remaining arguments. This resolves the actual independent package even when its CLI is not on PATH or another global version exists. Use the shell's unified update entry for shell-managed components; a child's standalone global updater belongs only to independent global installations.
|
|
24
25
|
|
|
26
|
+
The shared HTML component is `@petercjl/commerce-ui`. Load `compact-commerce-ui` through named Skill source resolution, then invoke `taobao-ai-ops component run html-report ...` for template discovery, schema, rendering, validation and custom pack lifecycle. Inputs are source evidence and report intent or a live-contract ViewModel; outputs are a new JSON, HTML and validation results. Missing runtime/contract/browser capabilities retain the child's explicit failure boundary. Return to step 4 after reporting. Compatible shared improvements belong in that independent package; adding a component belongs in the shell registry.
|
|
27
|
+
|
|
25
28
|
The shell registers independent npm packages; each owns its method, resources and release. Ordinary tasks use installed versions. On an explicit install/update request, use `taobao-ai-ops skill install --agent AGENT` or `taobao-ai-ops update install --agent AGENT --yes`; the latter checks both shell and every registered component's stable latest version even when the shell is unchanged. Inspect returned versions and managed Skill state. Registry failure preserves current components; local edits stop synchronization. Missing components return COMPONENT_NOT_INSTALLED and require authorized installation before returning to step 2. Development registrations update through their Git owners and are reported separately. Skill source resolves to each component's own canonical package, not a shell copy.
|
|
26
29
|
|
|
27
30
|
Current node selection and source resolution are deterministic contracts, with method judgment owned by each child Skill. The package manifest is the node registry and shared contracts are maintained in the package's contracts directory. Do not load unrelated node methods at startup.
|
package/src/runtime.mjs
CHANGED
|
@@ -39,7 +39,13 @@ export async function doctor(id,mode='excel'){
|
|
|
39
39
|
const children=await Promise.all(n.requires_skills.map(skill=>doctor(skill,mode)));
|
|
40
40
|
return {ok:checks.every(c=>c.ok)&&children.every(c=>c.ok),package:PACKAGE.name,version:PACKAGE.version,node:n.id,checks,children,native_requirements:children.flatMap(c=>c.native_requirements)};
|
|
41
41
|
}
|
|
42
|
-
if(n.python_imports.length){const python=resolvePython(n.python_imports);checks.push({id:'python',ok:Boolean(python),value:python,required_imports:n.python_imports});}
|
|
42
|
+
if(n.python_imports.length&&n.id!=='html-report'){const python=resolvePython(n.python_imports);checks.push({id:'python',ok:Boolean(python),value:python,required_imports:n.python_imports});}
|
|
43
|
+
if(n.id==='html-report'){
|
|
44
|
+
const record=componentRecord(n.component);
|
|
45
|
+
const result=spawnSync(process.execPath,[record.entry,'doctor','--json'],{encoding:'utf8',timeout:30000,env:pythonEnvironment()});
|
|
46
|
+
let detail;try{detail=JSON.parse(result.stdout||result.stderr);}catch{detail={message:result.stderr||'Unparseable component doctor'};}
|
|
47
|
+
checks.push({id:'html-component-runtime',ok:result.status===0,value:detail});
|
|
48
|
+
}
|
|
43
49
|
if(n.id==='category-research')checks.push({id:'report-runtime',ok:['assets/report-template.html','assets/chart-views.js'].every(p=>fs.existsSync(path.join(source(n),p)))});
|
|
44
50
|
if(n.id==='product-research'){
|
|
45
51
|
const componentRequire=createRequire(path.join(componentRecord(n.component).root,'package.json'));
|
package/suite-manifest.json
CHANGED
|
@@ -7,10 +7,22 @@
|
|
|
7
7
|
"category-research",
|
|
8
8
|
"product-research",
|
|
9
9
|
"tbcli-tools",
|
|
10
|
-
"sycmcli-tools"
|
|
10
|
+
"sycmcli-tools",
|
|
11
|
+
"html-report"
|
|
11
12
|
]
|
|
12
13
|
},
|
|
13
14
|
"nodes": [
|
|
15
|
+
{
|
|
16
|
+
"id": "html-report",
|
|
17
|
+
"skill": "compact-commerce-ui",
|
|
18
|
+
"component": "html-report",
|
|
19
|
+
"stage": "shared-reporting",
|
|
20
|
+
"method_version": "commerce-ui-template-pack@1",
|
|
21
|
+
"requires_skills": [],
|
|
22
|
+
"python_imports": ["jsonschema"],
|
|
23
|
+
"scripts": [],
|
|
24
|
+
"native_requirements": ["browser.report.inspect"]
|
|
25
|
+
},
|
|
14
26
|
{
|
|
15
27
|
"id": "operations",
|
|
16
28
|
"skill": "taobao-ai-operations",
|
|
@@ -18,7 +30,8 @@
|
|
|
18
30
|
"method_version": "1.0",
|
|
19
31
|
"requires_skills": [
|
|
20
32
|
"yuce-category-opportunity-report",
|
|
21
|
-
"taobao-search-product-form"
|
|
33
|
+
"taobao-search-product-form",
|
|
34
|
+
"compact-commerce-ui"
|
|
22
35
|
],
|
|
23
36
|
"python_imports": [],
|
|
24
37
|
"scripts": [],
|
|
@@ -105,6 +118,11 @@
|
|
|
105
118
|
}
|
|
106
119
|
],
|
|
107
120
|
"tools": {
|
|
121
|
+
"commerce-ui": {
|
|
122
|
+
"package": "@petercjl/commerce-ui",
|
|
123
|
+
"component": "html-report",
|
|
124
|
+
"role": "versioned HTML templates, rendering and validation"
|
|
125
|
+
},
|
|
108
126
|
"tbcli": {
|
|
109
127
|
"package": "@petercjl/tbcli",
|
|
110
128
|
"entry": "scripts/tbcli.mjs",
|
|
@@ -138,6 +156,11 @@
|
|
|
138
156
|
"source_checkout": "git-managed"
|
|
139
157
|
},
|
|
140
158
|
"components": {
|
|
159
|
+
"html-report": {
|
|
160
|
+
"package": "@petercjl/commerce-ui",
|
|
161
|
+
"bin": "commerce-ui",
|
|
162
|
+
"skills": ["compact-commerce-ui"]
|
|
163
|
+
},
|
|
141
164
|
"category-research": {
|
|
142
165
|
"package": "@petercjl/yuce-category-opportunity-report",
|
|
143
166
|
"bin": "yuce-category-research",
|