scene-capability-engine 3.6.8 → 3.6.10
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/CHANGELOG.md +27 -0
- package/README.md +2 -1
- package/README.zh.md +2 -1
- package/bin/scene-capability-engine.js +2 -0
- package/docs/agent-runtime/capability-iteration-ui.schema.json +226 -0
- package/docs/agent-runtime/orchestrator-rate-limit-profiles.md +4 -0
- package/docs/command-reference.md +29 -0
- package/docs/magicball-capability-iteration-api.md +154 -0
- package/docs/magicball-capability-iteration-ui.md +172 -0
- package/docs/ontology/capability-mapping.schema.json +54 -0
- package/lib/commands/capability.js +634 -0
- package/lib/orchestrator/orchestration-engine.js +234 -4
- package/lib/orchestrator/orchestrator-config.js +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Magicball 能力迭代管理(SCE 对接说明)
|
|
2
|
+
|
|
3
|
+
> 适用于:Magicball AI 助手页面新增顶部图标入口,内部用页签切换。
|
|
4
|
+
> 目标:从历史 `scene/spec/task` 中提炼可复用能力模板,并完成本体映射,形成可发布的能力资产。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. 目标与范围
|
|
9
|
+
|
|
10
|
+
- 目标:从历史 `scene/spec/task` 中提炼能力模板,并完成 ontology 映射闭环。
|
|
11
|
+
- 范围:Magicball UI 新增「能力迭代」入口(顶部图标),内部用页签完成全流程。
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. UI 草图(文字版)
|
|
16
|
+
|
|
17
|
+
### 2.1 能力迭代首页(Scene 盘点)
|
|
18
|
+
```
|
|
19
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
20
|
+
│ 能力迭代 │
|
|
21
|
+
│ [筛选:时间 | 完成率 | 风险] [搜索:scene id] │
|
|
22
|
+
├─────────────────────────────────────────────────────────────┤
|
|
23
|
+
│ Scene卡片:scene.customer-order │
|
|
24
|
+
│ - spec: 3 tasks: 42 completed: 36 pending: 6 │
|
|
25
|
+
│ - score: 未评估 │
|
|
26
|
+
│ [进入评估] │
|
|
27
|
+
├─────────────────────────────────────────────────────────────┤
|
|
28
|
+
│ Scene卡片:scene.inventory-reconcile │
|
|
29
|
+
│ - spec: 2 tasks: 18 completed: 18 pending: 0 │
|
|
30
|
+
│ [进入评估] │
|
|
31
|
+
└─────────────────────────────────────────────────────────────┘
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2.2 评估页(Spec/Task + 评分卡)
|
|
35
|
+
```
|
|
36
|
+
┌───────────────┬─────────────────────────────────────────────┐
|
|
37
|
+
│ Spec列表 │ 评分卡 │
|
|
38
|
+
│ - 01-00-demo │ value: 78 reuse: 66 stability: 85 risk: 20 │
|
|
39
|
+
│ - 01-01-check │ completion: 0.86 │
|
|
40
|
+
│ - 01-02-order │ │
|
|
41
|
+
├───────────────┼─────────────────────────────────────────────┤
|
|
42
|
+
│ Task摘要 │ [生成模板候选] │
|
|
43
|
+
│ total: 42 │ │
|
|
44
|
+
│ completed:36 │ │
|
|
45
|
+
│ pending: 6 │ │
|
|
46
|
+
└───────────────┴─────────────────────────────────────────────┘
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2.3 模板构建页(元信息 + 本体映射)
|
|
50
|
+
```
|
|
51
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
52
|
+
│ 模板信息 │
|
|
53
|
+
│ name: [Capability template: scene.customer-order] │
|
|
54
|
+
│ desc: [模板描述 ...] │
|
|
55
|
+
│ tags: [order, customer, inventory] │
|
|
56
|
+
├─────────────────────────────────────────────────────────────┤
|
|
57
|
+
│ 本体映射 │
|
|
58
|
+
│ domains: [commerce] │
|
|
59
|
+
│ entities: [Order, Customer] │
|
|
60
|
+
│ relations: [Order->Customer] │
|
|
61
|
+
│ business_rules: [OrderApproval] │
|
|
62
|
+
│ decisions: [RiskPolicy] │
|
|
63
|
+
├─────────────────────────────────────────────────────────────┤
|
|
64
|
+
│ [保存映射] [进入发布] │
|
|
65
|
+
└─────────────────────────────────────────────────────────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2.4 发布页(模板包生成)
|
|
69
|
+
```
|
|
70
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
71
|
+
│ 发布结果 │
|
|
72
|
+
│ template_id: scene.customer-order │
|
|
73
|
+
│ output_dir: .sce/templates/exports/capability-scene_customer… │
|
|
74
|
+
│ files: │
|
|
75
|
+
│ - capability-template.json │
|
|
76
|
+
│ - template-registry.json │
|
|
77
|
+
│ [复制路径] [推送模板库] │
|
|
78
|
+
└─────────────────────────────────────────────────────────────┘
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 3. 推荐 UI 架构(顶部图标 + 页签)
|
|
84
|
+
|
|
85
|
+
顶部图标入口:`能力迭代`
|
|
86
|
+
|
|
87
|
+
内部页签建议:
|
|
88
|
+
1. `Scene 盘点`
|
|
89
|
+
2. `评估`
|
|
90
|
+
3. `模板构建`
|
|
91
|
+
4. `发布`
|
|
92
|
+
|
|
93
|
+
状态机建议:
|
|
94
|
+
`extract -> score -> map -> register`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 4. SCE 接口参数(CLI 可封装)
|
|
99
|
+
|
|
100
|
+
### 4.1 提取候选能力
|
|
101
|
+
```bash
|
|
102
|
+
sce capability extract --scene <sceneId> --json
|
|
103
|
+
```
|
|
104
|
+
可选参数:
|
|
105
|
+
- `--specs <spec-id, spec-id>`
|
|
106
|
+
- `--out <path>`
|
|
107
|
+
- `--sample-limit <n>`
|
|
108
|
+
|
|
109
|
+
### 4.2 评分
|
|
110
|
+
```bash
|
|
111
|
+
sce capability score --input <candidate.json> --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 4.3 本体映射
|
|
115
|
+
```bash
|
|
116
|
+
sce capability map --input <candidate.json> --mapping <ontology.json> --json
|
|
117
|
+
```
|
|
118
|
+
可选参数:
|
|
119
|
+
- `--template-id <id>`
|
|
120
|
+
- `--name <name>`
|
|
121
|
+
- `--description <desc>`
|
|
122
|
+
- `--category <category>`
|
|
123
|
+
- `--tags <tag1,tag2>`
|
|
124
|
+
|
|
125
|
+
### 4.4 发布模板包
|
|
126
|
+
```bash
|
|
127
|
+
sce capability register --input <template.json> --json
|
|
128
|
+
```
|
|
129
|
+
可选参数:
|
|
130
|
+
- `--out <dir>`
|
|
131
|
+
- `--risk-level <low|medium|high|critical>`
|
|
132
|
+
- `--difficulty <beginner|intermediate|advanced>`
|
|
133
|
+
- `--tags <tag1,tag2>`
|
|
134
|
+
- `--applicable-scenarios <scene1,scene2>`
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 5. 数据契约(前端对接)
|
|
139
|
+
|
|
140
|
+
- UI 契约:`docs/agent-runtime/capability-iteration-ui.schema.json`
|
|
141
|
+
- 本体映射 schema:`docs/ontology/capability-mapping.schema.json`
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 6. 前端适配建议
|
|
146
|
+
|
|
147
|
+
### 6.1 状态管理
|
|
148
|
+
- 采用步骤式状态机:`extract -> score -> map -> register`
|
|
149
|
+
- 每一步输出的 JSON 都持久化,便于回放/复用
|
|
150
|
+
|
|
151
|
+
### 6.2 体验优化
|
|
152
|
+
- Scene 首页显示完成率、待处理数、评分卡入口
|
|
153
|
+
- 评分卡统一可视化(value/reuse/stability/risk)
|
|
154
|
+
- 本体映射表单应支持快速导入与默认推荐值
|
|
155
|
+
|
|
156
|
+
### 6.3 错误处理
|
|
157
|
+
- CLI 失败时直接展示错误原因
|
|
158
|
+
- `task_error` 存在时提示 spec 任务文件缺失或解析失败
|
|
159
|
+
- 保留上一步产物可继续重试
|
|
160
|
+
|
|
161
|
+
### 6.4 权限与治理
|
|
162
|
+
- 若涉及写入本体或发布模板,建议通过 SCE auth lease 授权
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 7. 推荐路由
|
|
167
|
+
|
|
168
|
+
- `/capability` Scene 首页
|
|
169
|
+
- `/capability/scene/:sceneId` 评估页
|
|
170
|
+
- `/capability/scene/:sceneId/template` 模板构建页
|
|
171
|
+
- `/capability/scene/:sceneId/release` 发布页
|
|
172
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://scene-capability-engine.dev/contracts/capability-mapping.schema.json",
|
|
4
|
+
"title": "Capability Ontology Mapping",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"ontology_scope"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"ontology_scope": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": [
|
|
13
|
+
"domains",
|
|
14
|
+
"entities",
|
|
15
|
+
"relations",
|
|
16
|
+
"business_rules",
|
|
17
|
+
"decisions"
|
|
18
|
+
],
|
|
19
|
+
"properties": {
|
|
20
|
+
"domains": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": { "type": "string" }
|
|
23
|
+
},
|
|
24
|
+
"entities": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": { "type": "string" }
|
|
27
|
+
},
|
|
28
|
+
"relations": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": { "type": "string" }
|
|
31
|
+
},
|
|
32
|
+
"business_rules": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "type": "string" }
|
|
35
|
+
},
|
|
36
|
+
"decisions": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": { "type": "string" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
},
|
|
43
|
+
"notes": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"source": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"version": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"additionalProperties": false
|
|
54
|
+
}
|