@carbonstopper/agent-mcp 0.1.72 → 0.1.74
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/dist/anonymous-policy.js +5 -0
- package/dist/anonymous-policy.js.map +1 -1
- package/dist/apipath.d.ts +1 -0
- package/dist/apipath.js +1 -0
- package/dist/apipath.js.map +1 -1
- package/dist/monitor-tools.js +2 -1
- package/dist/monitor-tools.js.map +1 -1
- package/dist/operation-dto-schemas.d.ts +159 -0
- package/dist/operation-dto-schemas.js +155 -0
- package/dist/operation-dto-schemas.js.map +1 -0
- package/dist/operation-tools.d.ts +1104 -0
- package/dist/operation-tools.js +114 -0
- package/dist/operation-tools.js.map +1 -0
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +7 -0
- package/dist/tools.js.map +1 -1
- package/docs/cbam-monitor-v1.1.md +8 -0
- package/docs/cbam-operation-report-v1.1.md +65 -0
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# CBAM 运营报告 MCP v1.1
|
|
2
|
+
|
|
3
|
+
MCP 自 `0.1.73` 提供,需配套 CBAM2 和 Runtime 部署。开发总入口:Java 项目 `doc/agent/cbam-operation-report-agent/06_IMPLEMENTATION_AND_HANDOFF.md`。
|
|
4
|
+
|
|
5
|
+
## 工具数和调用边界
|
|
6
|
+
|
|
7
|
+
新增 17 个工具:16 个模型业务工具,1 个宿主专用 `cbam_operation_material_task`,全部默认注册,无需额外开关或专用 MCP 实例。`tools/list` 是宿主发现目录,不等于模型可调用工具列表;Runtime 仍须在模型绑定前剔除材料工具,并在执行入口拒绝模型直接调用,仅本地 prepare/apply 适配器持有其原始 handle。
|
|
8
|
+
|
|
9
|
+
当前 MCP 工具目录合计 107 个,与监测计划材料工具保持相同的默认注册方式,不为运营报告拆分五个材料 MCP。`0.1.73` 曾要求额外的宿主注册开关;自 `0.1.74` 起已移除,更新 MCP 并刷新工具发现即可,无需额外环境变量。
|
|
10
|
+
|
|
11
|
+
Agent → MCP → Java。Agent 不配置 Java 内部 API URL/密钥;MCP 内部密钥仍走已有服务配置。
|
|
12
|
+
|
|
13
|
+
| MCP 后缀(统一 cbam_operation_) | Java 相对路径 |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| prerequisite_query | prerequisite/query |
|
|
16
|
+
| material_advice | material/advice |
|
|
17
|
+
| material_task(宿主) | material/task |
|
|
18
|
+
| report_create | report/create |
|
|
19
|
+
| report_query | report/query |
|
|
20
|
+
| section_read | report/section/read |
|
|
21
|
+
| item_query | report/item/query |
|
|
22
|
+
| general_patch | report/patch/general |
|
|
23
|
+
| process_patch | report/patch/process |
|
|
24
|
+
| condition_patch | report/patch/condition |
|
|
25
|
+
| quality_patch | report/patch/quality |
|
|
26
|
+
| item_delete | report/item/delete |
|
|
27
|
+
| evidence_read | evidence/read |
|
|
28
|
+
| evidence_manage | evidence/manage |
|
|
29
|
+
| report_save | report/submit |
|
|
30
|
+
| report_progress | report/progress |
|
|
31
|
+
| report_generate | report/generate |
|
|
32
|
+
|
|
33
|
+
网关前缀 `/cbam2/agent/internal/skills/cbam2/operation-report/v1.1`,POST,不自动重试写请求。先执行 operation 专用 SQL;新增接口随 CBAM2 正常启动注册,无需功能开关。
|
|
34
|
+
|
|
35
|
+
## 使用顺序
|
|
36
|
+
|
|
37
|
+
1. prerequisite_query:只选择当前组织权限内合格正式监测计划;没有则由父 Agent 完成 monitor_plan 后恢复原任务。
|
|
38
|
+
2. 宿主 prepareCbamOperationTask 创建真实报告,持久化创建回执并立即发事件;dataVersion=0 合法。
|
|
39
|
+
3. Workspace 解析全部来源并发布事实,CBAM 读取 schema 和真实 itemKey,宿主登记候选和保存独立合法数据。
|
|
40
|
+
4. 草稿部分保存、后续新批次补充;完整后正式保存和生成受控下载入口。
|
|
41
|
+
|
|
42
|
+
## 参数要点
|
|
43
|
+
|
|
44
|
+
- 所有调用传 sessionId;operationId/planId/accountId 分开且用字符串。写请求传 dataVersion 非负整数与原始 idempotencyKey。
|
|
45
|
+
- 普通字段 `changes/clearFields`;集合 `add[{clientItemKey,values}]/update[{itemKey,changes,clearFields}]`;省略保留,0/false 有效。来源身份、计算结果不能改。
|
|
46
|
+
- section_read(view=schema) 先返回索引,随后带 collection=sections[].name 读取完整字段。directEmissions schema 给出不同排放方法的实际参数含义和单位。
|
|
47
|
+
- 引用查询平铺 referenceType=regions/precursor_defaults/cn_benchmarks。明细分页最多 50;长值 text 读取最多 4096 个 Unicode 码点,跨页核对 dataVersion。
|
|
48
|
+
- report_progress(view=summary) 是数量摘要;view=missing 遍历全部缺项。缺项路径中的数组下标不是写入 itemKey。
|
|
49
|
+
- 宿主专用元数据 actionRef/actionRefs/baseSnapshotId/confirmed 由 Runtime 隐藏并保护;MCP 字段存在不等于模型有权自报可信动作。
|
|
50
|
+
- 文件只接收 fileRef={fileId};边界附件 add/remove 增量,remove 需确认。不能传任意下载 URL。
|
|
51
|
+
- material_task 五动作:sources_read/task_read/extraction_read/batch_register/extraction_register。task_read 必须已有 operationId;前置计划阶段从 Runtime 持久任务恢复。
|
|
52
|
+
- extraction_register 必须带 processedSources/facts/candidates/unmappedFacts。注册层允许保留非法 candidate.patch 给 Java 逐条反馈,实际四模块 patch schema 仍是严格白名单。registered=true 不代表业务已保存。
|
|
53
|
+
- extraction_read 不传 collection 返回数量索引;按 collection 和页码读完。revision 修正候选,原动作不可改变内容重放。
|
|
54
|
+
|
|
55
|
+
## 维护与验证
|
|
56
|
+
|
|
57
|
+
字段 schema 来源为 Java `AgentOperationFields` 的显式白名单及 DTO;`field_catalog.json` 不是开放写入 schema。
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
python scripts/generate-operation-schemas.py "D:/work/code/carbonstop/carbon260630"
|
|
61
|
+
npm run build
|
|
62
|
+
npm test
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
测试覆盖严格字段、0/false/大 ID、嵌套对象、来源只读、附件身份、材料候选保留、默认 tools/list 注册全部工具、五种材料动作转发和匿名访问拦截。当前构建及 122 项测试通过;真实 Runtime/Java/OSS 全链路尚未验证。
|