sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)

This commit is contained in:
gozeros committed 2026-10-21 14:51:31 +08:00
1 parent 4f7f07504a
commit 8bc8b0e082
1651 files changed
+278599 -11416

No files matched your search

@@ -0,0 +1,92 @@
# 商业情报监测接口、技能与业务链说明
## 组成
本功能全部使用项目级自定义资源:
- 自定义任务详情技能:`fs-task-detail-info`
- 自定义接口技能:`fs-timeline-info`、`fs-insight-info`、`fs-target-info`、`fs-connection-info`
- 当前判断独立接口技能:`fs-current-judgment-info`
- 自定义摘要技能:`fs-brief-info`
- 自定义编排技能:`fs-collect`
- 自定义业务链:`biz-intel-chain`
- 自定义页面助理:`biz-detail-assistant`,显示名“商业QB助理”
这些资源不写入内置技能或内置智能体目录。接口技能脚本第一行均为对应生产接口地址。
## 本地模拟接口
```powershell
cd F:\react01\deeflow-code\deerflow-server\offline-backend-20260512\backend
./devtools/mock_monitor_api/start-mock.ps1
```
新开一个 PowerShell,设置:
```powershell
$env:MONITOR_API_BASE_URL = "http://127.0.0.1:18080/consumer"
$env:MONITOR_AUTHORIZATION = "admin"
```
若要让定时业务链也访问模拟接口,需要在**启动 DeerFlow Gateway 的同一环境**中设置以上
两个环境变量,并保持模拟服务运行;只在另一个终端设置不会改变已经启动的 Gateway 进程。
模拟接口校验 `Authorization: admin`,提供任务详情、时间节点、热点/威胁/战机、实体及
打击/塑势衔接任务。任务名作为严格关键词时先返回空数组,用来验证技能会逐步扩大时间、
移除关键词并最终命中。
## 采集命令
只采集和转换,不写入:
```powershell
python skills/custom/fs-collect/scripts/fs_collect.py `
--group source --task-id 3 --dry-run
```
采集并原子合并到态势详情:
```powershell
python skills/custom/fs-collect/scripts/fs_collect.py `
--group source --task-id 003
```
当前判断写入后生成情报摘要:
```powershell
python skills/custom/fs-collect/scripts/fs_collect.py `
--group judgment --task-id 003
python skills/custom/fs-collect/scripts/fs_collect.py `
--group summary --task-id 003
```
脚本逐次输出接口方法、地址、Authorization 状态、查询参数或请求体、原始返回和放宽原因;
最后一行输出机器可读 JSON。
## 关键字段
- 时间节点:页面字段外保留 `recUuid` 和全部原始时间字段。
- 三类事件:保留接口 `id`,并复制为 `eventId` 供实体查询和追溯。
- 当前判断:独立调用 `eventMonitorByTime`,固定 `discriminant=威胁`,保留 `id/eventId`。
- 重要目标:保留 `eid/etype/text/imagePath/num/label/reason/score`。
- 衔接任务:标识字段是 `taskId`,不生成 `id`;类型只有 `打击/塑势`。
- 情报摘要:`sourceRefs` 保留所依据的事件 id、eid、recUuid、taskId 和判断 id。
## 自定义智能体与业务链注册
Gateway 启动后执行:
```powershell
python scripts/setup_force_situation_chain.py
python scripts/setup_biz_detail_assistant.py
```
业务链安装脚本默认只更新配置,不立即触发真实接口。需要立即执行时显式追加
`--trigger`。链路阶段为:接口数据采集 → 当前判断威胁接口采集 → 情报摘要与校验。
## 测试
```powershell
python -m pytest tests/test_force_situation_monitor_skills.py -q
```