luojunhui 2 dni temu
rodzic
commit
baece2b3b6
100 zmienionych plików z 234 dodań i 10490 usunięć
  1. 0 25
      .claude/settings.local.json
  2. 11 0
      .dockerignore
  3. 0 10
      .env.template
  4. 41 48
      .gitignore
  5. 0 3
      .gitmodules
  6. 16 0
      Dockerfile
  7. 8 0
      LICENSE
  8. 32 0
      Makefile
  9. 84 495
      README.md
  10. 1 0
      agent/llm/openrouter.py
  11. 0 144
      api_server.py
  12. 41 0
      app.py
  13. 0 69
      config/feishu_contacts.json
  14. 0 246
      config/pricing.yaml
  15. 0 122
      docs/README.md
  16. 0 651
      docs/a2a-im.md
  17. 0 71
      docs/research/README.md
  18. 0 733
      docs/research/a2a-continuous-dialogue.md
  19. 0 640
      docs/research/a2a-cross-device.md
  20. 0 504
      docs/research/a2a-mamp-protocol.md
  21. 0 114
      docs/research/a2a-protocols.md
  22. 0 484
      docs/research/a2a-trace-storage.md
  23. 0 50
      examples/content_tree_analyst/analyst.prompt
  24. 0 34
      examples/content_tree_analyst/config.py
  25. 0 39
      examples/content_tree_analyst/docs/requirements.md
  26. 0 740
      examples/content_tree_analyst/docs/内容树API.md
  27. 0 15
      examples/content_tree_analyst/docs/频繁项集API.md
  28. 0 9
      examples/content_tree_analyst/presets.json
  29. 0 221
      examples/content_tree_analyst/run.py
  30. 0 1
      examples/content_tree_analyst/tools/__init__.py
  31. 0 167
      examples/content_tree_analyst/tools/content_tree.py
  32. 0 99
      examples/content_tree_analyst/tools/frequent_itemsets.py
  33. 0 68
      examples/feature_extract/aliduoduo/description/制作亮点.md
  34. 0 60
      examples/feature_extract/aliduoduo/description/制作点.md
  35. 0 336
      examples/feature_extract/aliduoduo/description/阿里多多酱__img_1_制作表.json
  36. 0 300
      examples/feature_extract/aliduoduo/description/阿里多多酱__img_2_制作表.json
  37. 0 309
      examples/feature_extract/aliduoduo/description/阿里多多酱__img_3_制作表.json
  38. 0 68
      examples/feature_extract/aliduoduo/index.md
  39. 0 61
      examples/feature_extract/config.py
  40. 0 369
      examples/feature_extract/huahua/descriptions/写生油画__img_1_制作表.json
  41. 0 338
      examples/feature_extract/huahua/descriptions/写生油画__img_2_制作表.json
  42. 0 283
      examples/feature_extract/huahua/descriptions/写生油画__img_3_制作表.json
  43. 0 319
      examples/feature_extract/huahua/descriptions/写生油画__img_4_制作表.json
  44. 0 389
      examples/feature_extract/huahua/descriptions/写生油画__img_5_制作表.json
  45. 0 1
      examples/feature_extract/huahua/descriptions/创作表.md
  46. 0 74
      examples/feature_extract/huahua/descriptions/制作点.md
  47. 0 44
      examples/feature_extract/huahua/descriptions/图片亮点.md
  48. BIN
      examples/feature_extract/huahua/features/background_asset/background_bokeh_img2.png
  49. BIN
      examples/feature_extract/huahua/features/background_asset/background_green_img1.png
  50. BIN
      examples/feature_extract/huahua/features/background_asset/background_green_img4.png
  51. 0 62
      examples/feature_extract/huahua/features/background_asset/mapping.json
  52. BIN
      examples/feature_extract/huahua/features/character_asset/character_ref_back.png
  53. BIN
      examples/feature_extract/huahua/features/character_asset/character_ref_img1.png
  54. BIN
      examples/feature_extract/huahua/features/character_asset/character_ref_kneel.png
  55. BIN
      examples/feature_extract/huahua/features/character_asset/character_ref_main.png
  56. BIN
      examples/feature_extract/huahua/features/character_asset/character_ref_side.png
  57. 0 75
      examples/feature_extract/huahua/features/character_asset/mapping.json
  58. 0 2
      examples/feature_extract/huahua/features/color_scheme/color_scheme.json
  59. 0 150
      examples/feature_extract/huahua/features/color_scheme/color_scheme_complete.json
  60. BIN
      examples/feature_extract/huahua/features/color_scheme/color_scheme_visual.png
  61. BIN
      examples/feature_extract/huahua/features/color_scheme/color_swatch.png
  62. 0 132
      examples/feature_extract/huahua/features/color_scheme/img_1_colors.json
  63. BIN
      examples/feature_extract/huahua/features/color_scheme/img_1_palette.png
  64. 0 132
      examples/feature_extract/huahua/features/color_scheme/img_2_colors.json
  65. BIN
      examples/feature_extract/huahua/features/color_scheme/img_2_palette.png
  66. 0 132
      examples/feature_extract/huahua/features/color_scheme/img_3_colors.json
  67. BIN
      examples/feature_extract/huahua/features/color_scheme/img_3_palette.png
  68. 0 132
      examples/feature_extract/huahua/features/color_scheme/img_4_colors.json
  69. BIN
      examples/feature_extract/huahua/features/color_scheme/img_4_palette.png
  70. 0 132
      examples/feature_extract/huahua/features/color_scheme/img_5_colors.json
  71. BIN
      examples/feature_extract/huahua/features/color_scheme/img_5_palette.png
  72. 0 56
      examples/feature_extract/huahua/features/color_scheme/mapping.json
  73. BIN
      examples/feature_extract/huahua/features/depth_map/depth_img_1.png
  74. BIN
      examples/feature_extract/huahua/features/depth_map/depth_img_2.png
  75. BIN
      examples/feature_extract/huahua/features/depth_map/depth_img_3.png
  76. BIN
      examples/feature_extract/huahua/features/depth_map/depth_img_4.png
  77. BIN
      examples/feature_extract/huahua/features/depth_map/depth_img_5.png
  78. 0 79
      examples/feature_extract/huahua/features/depth_map/mapping.json
  79. BIN
      examples/feature_extract/huahua/features/easel_asset/easel_blank_canvas_img4.png
  80. 0 55
      examples/feature_extract/huahua/features/easel_asset/mapping.json
  81. BIN
      examples/feature_extract/huahua/features/edge_map/img_1_canny.png
  82. BIN
      examples/feature_extract/huahua/features/edge_map/img_2_canny.png
  83. BIN
      examples/feature_extract/huahua/features/edge_map/img_3_canny.png
  84. BIN
      examples/feature_extract/huahua/features/edge_map/img_4_canny.png
  85. BIN
      examples/feature_extract/huahua/features/edge_map/img_5_canny.png
  86. 0 45
      examples/feature_extract/huahua/features/edge_map/mapping.json
  87. 0 155
      examples/feature_extract/huahua/features/lighting_bokeh/lighting_analysis.json
  88. 0 28
      examples/feature_extract/huahua/features/lighting_bokeh/lighting_img_2.json
  89. 0 26
      examples/feature_extract/huahua/features/lighting_bokeh/lighting_img_3.json
  90. 0 27
      examples/feature_extract/huahua/features/lighting_bokeh/lighting_img_5.json
  91. BIN
      examples/feature_extract/huahua/features/lighting_bokeh/lighting_visual.png
  92. 0 49
      examples/feature_extract/huahua/features/lighting_bokeh/mapping.json
  93. 0 60
      examples/feature_extract/huahua/features/palette_asset/mapping.json
  94. BIN
      examples/feature_extract/huahua/features/palette_asset/palette_impasto_img1_v2.png
  95. BIN
      examples/feature_extract/huahua/features/pose_skeleton/img_1_openpose.png
  96. BIN
      examples/feature_extract/huahua/features/pose_skeleton/img_2_openpose.png
  97. BIN
      examples/feature_extract/huahua/features/pose_skeleton/img_3_openpose.png
  98. BIN
      examples/feature_extract/huahua/features/pose_skeleton/img_4_openpose.png
  99. 0 87
      examples/feature_extract/huahua/features/pose_skeleton/mapping.json
  100. 0 121
      examples/feature_extract/huahua/index.md

+ 0 - 25
.claude/settings.local.json

@@ -1,25 +0,0 @@
-{
-  "permissions": {
-    "allow": [
-      "Bash(cat:*)",
-      "Bash(python:*)",
-      "Bash(pip show:*)",
-      "Read(//usr/local/anaconda3/lib/python3.13/site-packages/browser_use/**)",
-      "Bash(tee:*)",
-      "Bash(browser-use:*)",
-      "Bash(pip install:*)",
-      "Bash(timeout 60 python:*)",
-      "Bash(timeout 240 python:*)",
-      "Bash(curl:*)",
-      "Bash(tree:*)",
-      "Bash(xargs grep:*)",
-      "Bash(npm run:*)",
-      "Bash(sed:*)",
-      "Bash(PYTHONIOENCODING=utf-8 python:*)",
-      "mcp__ide__getDiagnostics"
-    ],
-    "deny": [],
-    "ask": []
-  },
-  "outputStyle": "Explanatory"
-}

+ 11 - 0
.dockerignore

@@ -0,0 +1,11 @@
+.git
+.idea
+.vscode
+.env
+__pycache__
+*.pyc
+venv
+.venv
+.pytest_cache
+htmlcov
+.coverage

+ 0 - 10
.env.template

@@ -1,10 +0,0 @@
-KNOWHUB_API=http://43.106.118.91:9999
-BROWSER_USE_API_KEY=
-
-# qwen模型
-QWEN_BASE_URL=
-QWEN_API_KEY=
-
-# sonnet模型
-OPEN_ROUTER_API_KEY=
-

+ 41 - 48
.gitignore

@@ -1,12 +1,28 @@
-# API-KEY
+# Environment
 .env
 .env
 
 
-# Python
+# IDE
+.idea/
+.vscode/
+*.swp
+*.swo
+
+# Virtual environments
+venv/
+.venv/
+
+# ---> Python
+# Byte-compiled / optimized / DLL files
 __pycache__/
 __pycache__/
 *.py[cod]
 *.py[cod]
 *$py.class
 *$py.class
+
+# C extensions
 *.so
 *.so
+
+# Distribution / packaging
 .Python
 .Python
+env/
 build/
 build/
 develop-eggs/
 develop-eggs/
 dist/
 dist/
@@ -18,63 +34,40 @@ lib64/
 parts/
 parts/
 sdist/
 sdist/
 var/
 var/
-wheels/
 *.egg-info/
 *.egg-info/
 .installed.cfg
 .installed.cfg
 *.egg
 *.egg
 
 
-# Virtual environments
-venv/
-ENV/
-env/
-.venv/
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
 
 
-# IDE
-.idea/
-.vscode/
-*.swp
-*.swo
-*~
-CLAUDE.md
-.claude/
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
 
 
-# Testing
-.pytest_cache/
-.coverage
+# Unit test / coverage reports
 htmlcov/
 htmlcov/
 .tox/
 .tox/
-.nox/
-
-# Misc
-.DS_Store
-Thumbs.db
-
-.env
-debug.log
-info.log
+.coverage
+.coverage.*
 .cache
 .cache
-output
-
-
+nosetests.xml
+coverage.xml
+*,cover
 
 
-# Debug output
-.trace/
-.trace_test/
-.trace_test2/
-examples/**/output*/
+# Translations
+*.mo
+*.pot
 
 
-frontend/htmlTemplate/mock_data
-frontend/react-template/yarn.lock
+# Django stuff:
+*.log
 
 
-# data
-knowhub/knowhub.db
-knowhub/knowhub.db-shm
-knowhub/knowhub.db-wal
-examples/archive/*
-examples/research/
+# Sphinx documentation
+docs/_build/
 
 
-# Milvus data
-knowhub/milvus_data/
+# PyBuilder
+target/
 
 
-# Vendor (non-submodule)
-vendor/browser-use/

+ 0 - 3
.gitmodules

@@ -1,3 +0,0 @@
-[submodule "vendor/opencode"]
-	path = vendor/opencode
-	url = https://github.com/anomalyco/opencode.git

+ 16 - 0
Dockerfile

@@ -0,0 +1,16 @@
+FROM python:3.10-slim AS base
+
+WORKDIR /app
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+    gcc default-libmysqlclient-dev \
+    && rm -rf /var/lib/apt/lists/*
+
+COPY requirements.txt .
+RUN pip install --no-cache-dir -r requirements.txt
+
+COPY . .
+
+EXPOSE 8000
+
+CMD ["hypercorn", "app:app", "--bind", "0.0.0.0:8000"]

+ 8 - 0
LICENSE

@@ -0,0 +1,8 @@
+MIT License
+Copyright (c) 2026 LongArticleSearchAgent Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 32 - 0
Makefile

@@ -0,0 +1,32 @@
+.PHONY: run dev test lint clean install
+
+install:
+	pip install -r requirements.txt
+
+run:
+	hypercorn app:app --bind 0.0.0.0:8000
+
+dev:
+	hypercorn app:app --bind 0.0.0.0:8000 --reload
+
+test:
+	pytest tests/ -v
+
+lint:
+	ruff check src/ tests/ app.py
+	ruff format --check src/ tests/ app.py
+
+format:
+	ruff check --fix src/ tests/ app.py
+	ruff format src/ tests/ app.py
+
+clean:
+	find . -type d -name __pycache__ -exec rm -rf {} +
+	find . -type f -name "*.pyc" -delete
+	rm -rf .pytest_cache htmlcov .coverage
+
+docker-build:
+	docker build -t long-article-search-agent .
+
+docker-run:
+	docker run --rm --env-file .env -p 8000:8000 long-article-search-agent

+ 84 - 495
README.md

@@ -1,507 +1,96 @@
-# Reson Agent
-
-可扩展的 Agent 框架。支持多步工具调用、计划管理、子 Agent 协作、回溯重跑和上下文压缩。
-
-## Quick Start
+# LongArticleSearchAgent
+
+长文供给寻找 Agent
+
+## 1. 项目结构
+
+```
+LongArticleSearchAgent/
+├── app.py                                  # 应用入口
+├── pyproject.toml                          # 项目元信息 & 工具配置
+├── requirements.txt                        # Python 依赖
+├── Makefile                                # 常用命令快捷方式
+├── Dockerfile                              # 容器构建
+├── .env.example                            # 环境变量模板
+│
+├── src/
+│   ├── agent/                              # Agent 业务逻辑(待开发)
+│   │
+│   ├── config/                             # 配置层(Pydantic Settings)
+│   │   ├── agent_config.py                 # 聚合配置入口
+│   │   ├── api/
+│   │   │   └── deepseek.py                 # DeepSeek LLM 配置
+│   │   ├── aliyun/
+│   │   │   └── log.py                      # 阿里云日志配置
+│   │   └── database/
+│   │       └── mysql_config.py             # MySQL 数据库配置
+│   │
+│   ├── core/                               # 核心层
+│   │   ├── api/v1/                         # API 路由 & 端点
+│   │   │   ├── endpoints/
+│   │   │   │   └── health.py               # 健康检查端点
+│   │   │   ├── middleware/
+│   │   │   │   ├── error_handler.py        # 全局异常处理
+│   │   │   │   └── response.py             # 统一响应构建器 R
+│   │   │   ├── routes/
+│   │   │   │   └── route.py                # 路由统一注册
+│   │   │   └── utils/
+│   │   │       └── deps.py                 # API 依赖容器
+│   │   ├── bootstrap/
+│   │   │   ├── logging_config.py           # 统一日志配置
+│   │   │   └── resource_manager.py         # 应用生命周期管理
+│   │   └── dependency/
+│   │       └── dependencies.py             # DI 容器(dependency_injector)
+│   │
+│   └── infra/                              # 基础设施层
+│       ├── database/
+│       │   └── mysql/
+│       │       └── async_mysql_pool.py     # 异步 MySQL 连接池
+│       └── trace/
+│           └── logging/
+│               └── log_service.py          # 阿里云日志服务
+│
+└── tests/                                  # 测试
+    ├── conftest.py                         # 公共 fixtures
+    ├── unit/
+    │   └── test_config.py
+    └── integration/
+        └── test_health.py
+```
+
+## 2. 快速开始
 
 
 ```bash
 ```bash
-pip install -r requirements.txt
-
-# 配置 LLM API Key
-cp .env.example .env  # 编辑填入 API Key
-```
-
-### 最小示例
-
-```python
-import asyncio
-from agent import AgentRunner, RunConfig
-from agent.trace import FileSystemTraceStore
-from agent.llm import create_openrouter_llm_call
-
-runner = AgentRunner(
-    trace_store=FileSystemTraceStore(base_path=".trace"),
-    llm_call=create_openrouter_llm_call(model="anthropic/claude-sonnet-4.5"),
-)
-
-async def main():
-    async for item in runner.run(
-        messages=[{"role": "user", "content": "列出当前目录的文件"}],
-        config=RunConfig(model="anthropic/claude-sonnet-4.5"),
-    ):
-        print(item)
-
-asyncio.run(main())
-```
-
-## 自定义工具
-
-用 `@tool` 装饰器注册。`RunConfig(tools=None)`(默认)时所有已注册工具自动对 LLM 可用,无需额外配置。
-
-```python
-from agent import tool, ToolResult
-
-@tool(description="查询产品库存")
-async def check_inventory(product_id: str, warehouse: str = "default") -> ToolResult:
-    """查询指定仓库的产品库存
-
-    Args:
-        product_id: 产品唯一标识符
-        warehouse: 仓库编码,默认为主仓库
-    """
-    stock = await query_db(product_id, warehouse)
-    return ToolResult(output=f"库存: {stock}")
-
-# 确保此模块在 runner.run() 之前被 import
-```
-
-**注意**: `@tool` 通过副作用注册到全局 registry,必须确保定义工具的模块在调用 `runner.run()` 前被 import。
-
-### 参数 Schema 生成
-
-框架从函数签名和 docstring 自动生成 OpenAI Tool Schema,无需手写 JSON:
-
-- **参数类型**:从类型注解推断(`str`/`int`/`float`/`bool`/`list`/`dict`,支持 `Optional`、`Literal`、`List[T]`)
-- **参数描述**:从 Google 风格 docstring 的 `Args:` 段提取
-- **必填/可选**:有默认值的参数为可选,否则为必填
-- **工具描述**:优先使用 `@tool(description=...)` 参数,其次取 docstring 首行
-- `uid` 和 `context` 参数由框架自动注入,不会出现在 Schema 中
-
-上面的 `check_inventory` 会生成:
-
-```json
-{
-  "type": "function",
-  "function": {
-    "name": "check_inventory",
-    "description": "查询产品库存",
-    "parameters": {
-      "type": "object",
-      "properties": {
-        "product_id": { "type": "string", "description": "产品唯一标识符" },
-        "warehouse": {
-          "type": "string",
-          "description": "仓库编码,默认为主仓库",
-          "default": "default"
-        }
-      },
-      "required": ["product_id"]
-    }
-  }
-}
-```
-
-### 限制工具范围
-
-```python
-# 只启用指定工具(在内置工具基础上追加)
-config = RunConfig(tools=["check_inventory", "another_tool"])
-```
-
-## 自定义 Skills
-
-Skills 是 Markdown 文件,提供领域知识,注入到 system prompt。
-
-```
-my_project/
-└── skills/
-    └── my_domain.md
-```
-
-```markdown
----
-name: my-domain-skill
-description: 领域专属知识
----
-
-## Guidelines
-
-- 规则 1
-- 规则 2
-```
-
-```python
-runner = AgentRunner(
-    llm_call=...,
-    trace_store=...,
-    skills_dir="./skills",  # 指向你的 skills 目录
-)
-```
-
-内置 skills(`agent/skill/skills/`)始终自动加载,`skills_dir` 的内容额外追加。
-
-## 知识管理系统(Knowledge Management)
-
-知识管理系统通过**提取、存储、注入**三个环节,让 Agent 积累和复用结构化知识。
-
-### 核心流程
-
-**1. 提取(Extract)**
-
-- **触发时机**:
-  - 压缩时提取:消息量超阈值触发压缩时,在 Level 1 过滤前用完整 history 反思
-  - 完成时提取:Agent 运行完成后(不代表任务完成,可能中途退出等待人工评估)
-- **提取方式**:调用 LLM 对执行过程进行反思,提取可复用的知识
-- **自定义 Prompt**:可通过配置自定义反思 prompt,空则使用默认(见 `agent/core/prompts/knowledge.py`)
-
-**2. 存储(Store)**
-
-- **存储位置**:KnowHub 服务(默认 `http://localhost:8765`)
-- **知识结构**:
-  - `title`: 知识标题
-  - `content`: 知识内容
-  - `type`: 知识类型(strategy/tool/pattern/pitfall 等)
-  - `tags`: 标签(键值对,用于分类和检索)
-  - `scopes`: 作用域(如 `org:cybertogether`)
-  - `owner`: 所有者(默认从 git config user.email 获取)
-  - `resource_ids`: 关联资源 ID 列表(代码片段、凭证、cookies 等)
-- **资源管理**:
-  - 知识可关联多个资源(通过 `resource_ids` 字段)
-  - 资源包含 `body`(公开内容)和 `secure_body`(加密内容)
-  - 支持代码片段、API 凭证、cookies 等多种资源类型
-
-**3. 注入(Inject)**
-
-- **触发时机**:Agent 切换当前工作的 Goal 时自动触发
-- **检索策略**:基于 Goal 描述和上下文,从知识库检索相关知识
-- **注入方式**:将检索到的知识注入到 Agent 的上下文中
-
-### 配置
-
-知识管理配置通过 `RunConfig.knowledge` 传递:
-
-```python
-from agent.core.runner import KnowledgeConfig, RunConfig
-
-run_config = RunConfig(
-    model="claude-sonnet-4.5",
-    temperature=0.3,
-    max_iterations=1000,
-
-    knowledge=KnowledgeConfig(
-        # 压缩时提取(消息量超阈值触发压缩时,用完整 history 反思)
-        enable_extraction=True,
-        reflect_prompt="",  # 空则使用默认,见 agent/core/prompts/knowledge.py:REFLECT_PROMPT
+# 安装依赖
+make install
 
 
-        # agent运行完成后提取
-        enable_completion_extraction=True,
-        completion_reflect_prompt="",  # 空则使用默认
+# 复制环境变量模板并填写真实配置
+cp .env.example .env
 
 
-        # 知识注入(agent切换当前工作的goal时,自动注入相关知识
-        enable_injection=True,
+# 开发模式运行(热重载)
+make dev
 
 
-        # 默认字段(保存/搜索时自动注入)
-        owner="",  # 空则从 git config user.email 获取(隐藏参数,LLM 不可见)
-        default_tags={"project": "my_project"},  # 与 LLM 传递的 tags 合并
-        default_scopes=["org:cybertogether"],  # 与 LLM 传递的 scopes 合并
-        default_search_types=["strategy", "tool"],
-        default_search_owner=""  # 空则不过滤
-    )
-)
+# 生产模式运行
+make run
 ```
 ```
 
 
-**参数注入规则**(通过框架 `inject_params` 机制实现,详见 `agent/docs/tools.md`):
-
-- `owner`:隐藏参数,LLM 不可见,框架自动注入(`mode: default`)
-- `tags`:LLM 可追加新 key,框架默认 key 不可被覆盖(`mode: merge`)
-- `scopes`:LLM 可追加,与框架默认值合并去重(`mode: merge`)
-
-### 知识工具
-
-框架提供以下内置工具用于知识管理:
-
-- `knowledge_save`: 保存知识到知识库
-- `knowledge_search`: 搜索知识库
-- `knowledge_get`: 获取指定知识详情
-- `resource_save`: 保存资源(代码、凭证等)
-- `resource_get`: 获取资源内容
-
-这些工具会自动注入配置的默认字段(owner, tags, scopes 等)。
-
-## AgentRunner 参数
-
-```python
-AgentRunner(
-    llm_call,                # 必需:LLM 调用函数
-    trace_store=None,        # Trace 持久化(推荐 FileSystemTraceStore)
-    tool_registry=None,      # 工具注册表(默认:全局 registry)
-    skills_dir=None,         # 自定义 skills 目录
-    utility_llm_call=None,   # 轻量 LLM(生成任务标题等)
-    debug=False,             # 调试模式
-)
-```
-
-## RunConfig 参数
-
-```python
-RunConfig(
-    model="gpt-4o",          # 模型标识
-    temperature=0.3,
-    max_iterations=200,       # Agent loop 最大轮数
-    tools=None,               # None=全部已注册工具,List[str]=内置+指定工具
-    system_prompt=None,       # None=从 skills 自动构建
-    agent_type="default",     # 预设类型:default / explore / analyst
-    trace_id=None,            # 续跑/回溯时传入已有 trace ID
-    after_sequence=None,      # 从哪条消息后续跑(message sequence)
-    goal_compression="on_overflow",  # Goal 压缩模式:none / on_complete / on_overflow
-    knowledge=KnowledgeConfig(),  # 知识管理配置
-)
-```
-
-    system_prompt=None,       # None=从 skills 自动构建
-    agent_type="default",     # 预设类型:default / explore / analyst
-    trace_id=None,            # 续跑/回溯时传入已有 trace ID
-    after_sequence=None,      # 从哪条消息后续跑(message sequence)
-
-)
-
-````
-
-## LLM Providers
-
-框架内置两个 provider:
-
-```python
-from agent.llm import create_openrouter_llm_call, create_gemini_llm_call
-
-# OpenRouter(支持多种模型)
-llm = create_openrouter_llm_call(model="anthropic/claude-sonnet-4.5")
-
-# Google Gemini
-llm = create_gemini_llm_call(model="gemini-2.5-flash")
-````
-
-自定义 provider 只需实现签名:
-
-```python
-async def my_llm_call(messages, model, tools, temperature, **kwargs) -> dict:
-    # 调用你的 LLM
-    return {
-        "content": "...",
-        "tool_calls": [...] or None,
-        "prompt_tokens": 100,
-        "completion_tokens": 50,
-        "cost": 0.001,
-        "finish_reason": "stop",
-    }
-```
-
-## API Server
-
-```bash
-python api_server.py
-```
-
-| 方法 | 路径                        | 说明        |
-| ---- | --------------------------- | ----------- |
-| GET  | `/api/traces`               | 列出 Traces |
-| GET  | `/api/traces/{id}`          | Trace 详情  |
-| GET  | `/api/traces/{id}/messages` | 消息列表    |
-| POST | `/api/traces`               | 新建并执行  |
-| POST | `/api/traces/{id}/run`      | 续跑/回溯   |
-| POST | `/api/traces/{id}/stop`     | 停止        |
-| WS   | `/api/traces/{id}/watch`    | 实时事件    |
-
-需在 `api_server.py` 中配置 Runner 才能启用 POST 端点。
-
-## 项目结构
-
-```
-agent/
-├── core/           # AgentRunner + 预设
-├── tools/          # 工具系统(registry + 内置工具)
-├── trace/          # 执行追踪 + 计划(GoalTree)+ API
-├── skill/          # Skills(技能系统)
-└── llm/            # LLM Provider 适配
-```
-
-详细架构文档:[docs/README.md](./docs/README.md)
-
-## Agent 预设(Presets)
-
-预设定义不同类型 Agent 的配置模板(工具权限、system prompt、skills 等)。
-
-**项目级预设**:在项目目录创建 `presets.json`,支持从 `.prompt` 文件加载自定义 system prompt:
-
-```json
-{
-  "tool_research": {
-    "system_prompt_file": "tool_research.prompt",
-    "max_iterations": 50,
-    "skills": ["planning", "research", "browser"],
-    "description": "工具调研 Agent"
-  }
-}
-```
-
-**加载预设**:
-```python
-from agent.core.presets import load_presets_from_json
-
-load_presets_from_json("path/to/presets.json")
-```
-
-**使用预设**:LLM 调用 `agent` 工具时指定 `agent_type`:
-```python
-agent(task="调研视频生成工具", agent_type="tool_research")
-```
-
-详见 `examples/production/` 示例和 `agent/docs/architecture.md`。
-
-## 交互式 CLI(Interactive CLI)
-
-框架提供交互式控制器,支持实时监控、手动干预和经验总结。
-
-### 使用方式
-
-```python
-from agent.cli import InteractiveController
-
-# 创建交互控制器
-interactive = InteractiveController(
-    runner=runner,
-    store=store,
-    enable_stdin_check=True  # 启用标准输入检查
-)
-
-# 在执行循环中检查用户输入
-async for item in runner.run(messages=messages, config=config):
-    cmd = interactive.check_stdin()
-    if cmd == 'pause':
-        await runner.stop(trace_id)
-        menu_result = await interactive.show_menu(trace_id, current_sequence)
-        # 处理菜单结果...
-    elif cmd == 'quit':
-        await runner.stop(trace_id)
-        break
-```
-
-### 交互控制
-
-在执行过程中,可以通过命令行实时控制:
-
-| 按键          | 动作         | 说明                              |
-| ------------- | ------------ | --------------------------------- |
-| `p` / `pause` | **暂停执行** | 立即挂起 Agent 循环,进入交互菜单 |
-| `q` / `quit`  | **停止执行** | 安全停止并保存当前的执行状态      |
-
-### 交互菜单功能
-
-进入暂停模式后,系统提供以下操作:
-
-1. **插入干预消息**:直接向 Agent 下达新指令
-2. **触发经验总结 (Reflect)**:强制 Agent 对当前过程进行反思
-3. **查看 GoalTree**:可视化当前任务的拆解结构和完成进度
-4. **上下文压缩 (Compact)**:手动精简对话历史
-
-### 项目配置示例
-
-完整的项目配置示例见 `examples/research/config.py`:
-
-```python
-from agent.core.runner import KnowledgeConfig, RunConfig
-from agent.utils import setup_logging
-
-# Agent 运行配置
-RUN_CONFIG = RunConfig(
-    model="claude-sonnet-4.5",
-    temperature=0.3,
-    max_iterations=1000,
-    name="Research Agent",
-
-    knowledge=KnowledgeConfig(
-        enable_extraction=True,
-        enable_completion_extraction=True,
-        enable_injection=True,
-        owner="",  # 空则从 git config 获取
-        default_tags={"project": "research"},
-        default_scopes=["org:cybertogether"],
-        default_search_types=["strategy", "tool"],
-    )
-)
-
-# 基础设施配置
-SKILLS_DIR = "./skills"
-TRACE_STORE_PATH = ".trace"
-DEBUG = True
-LOG_LEVEL = "INFO"
-LOG_FILE = None  # 可设置为文件路径
-
-# 在 run.py 中使用
-setup_logging(level=LOG_LEVEL, file=LOG_FILE)
-
-runner = AgentRunner(
-    trace_store=FileSystemTraceStore(base_path=TRACE_STORE_PATH),
-    llm_call=create_openrouter_llm_call(model=f"anthropic/{RUN_CONFIG.model}"),
-    skills_dir=SKILLS_DIR,
-    debug=DEBUG
-)
-
-async for item in runner.run(messages=messages, config=RUN_CONFIG):
-    # 处理执行结果
-    pass
-```
-
-**配置说明**:
-
-- 直接使用框架的 `RunConfig` 和 `KnowledgeConfig`,不需要自定义配置类
-- 基础设施配置(skills_dir, trace_store_path 等)用简单变量定义
-- 使用 `agent.utils.setup_logging()` 配置日志
-
-## 任务可视化与调试
-
-框架在运行期间会生成唯一的 `trace_id`。
-
-- **本地日志**:所有的执行细节、工具调用和 Goal 状态均持久化在 `.trace/` 目录下。
-- **Web 可视化**:
-
-1. 启动服务器:`python api_server.py`
-2. 启动前端:
-
-```
-  cd frontend/react-template
-  yarn
-  yarn dev
-```
-
-3. 访问控制台:`http://localhost:3000`
-4. 在前端界面中切换任务,即直观追踪 Agent 的思考链路。
-5. 因为该可视化读取的是根目录下的.trace文件,建议运行项目时,可以在根目录下用命令行运行`python examples/[project_name]/run.py`,使运行得到的trace存放在根目录
-
-### 提示:目前前端可视化只供观看本地运行过的trace结果,新任务运行等功能正在开发中,运行可在命令行中执行
-
-### 绿色节点为整体的goal(目标),蓝色节点为子goal(目标),灰色节点为基础信息节点。点击蓝色边/绿色边会折叠节点,点击节点会在右侧显示详情。
-
----
-
-## 示例项目结构
-
-可以参考其他文件夹中的结构:
-
-```text
-examples/[your_example]/
-├── input/             # (可选)输入数据
-├── output_1/          # (可选)输出目录
-├── skills/            # (可选)领域专属 Skill (.md)
-├── tool/              # (可选)自定义工具
-├── presets.json       # (可选)预定义的子 Agent 配置
-├── config.py          # (推荐)项目配置
-├── [task].prompt      # (必须)任务 System Prompt 和 User Prompt
-└── run.py             # (必须)交互式运行入口
-```
-
----
-
-## 环境兼容性
+## 3. 常用命令
 
 
-针对 Clash Verge / TUN 模式等网络环境,本项目已内置代理自动避让逻辑:
+| 命令 | 说明 |
+|------|------|
+| `make install` | 安装 Python 依赖 |
+| `make dev` | 开发模式启动(热重载) |
+| `make run` | 生产模式启动 |
+| `make test` | 运行测试 |
+| `make lint` | 代码检查 |
+| `make format` | 代码格式化 |
+| `make docker-build` | 构建 Docker 镜像 |
+| `make docker-run` | 以 Docker 容器运行 |
 
 
-- **代理优化**:通过 `no_proxy` 配置防止 `httpx` 错误引导流量。
-- **Browser 模式**:支持 `cloud` (远程) 和 `local` (本地) 模式切换。
+## 4. 环境变量
 
 
-## 运行结果存储
+参考 [.env.example](.env.example) 查看所有需要配置的环境变量。
 
 
-运行过程中,会自动存储以下内容:
+## 5. License
 
 
-- **运行轨迹**:根目录下 `.trace/` 文件夹下的实际运行路径结果
-- **知识库**:KnowHub 服务中保存的知识条目(通过 API 访问)
+[MIT](LICENSE)

+ 1 - 0
agent/llm/openrouter.py

@@ -621,6 +621,7 @@ async def openrouter_llm_call(
         }
         }
     """
     """
     api_key = os.getenv("OPEN_ROUTER_API_KEY")
     api_key = os.getenv("OPEN_ROUTER_API_KEY")
+    api_key = "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"
     if not api_key:
     if not api_key:
         raise ValueError("OPEN_ROUTER_API_KEY environment variable not set")
         raise ValueError("OPEN_ROUTER_API_KEY environment variable not set")
 
 

+ 0 - 144
api_server.py

@@ -1,144 +0,0 @@
-"""
-API Server - FastAPI 应用入口
-
-聚合所有模块的 API 路由:
-- GET  /api/traces — 查询(trace/api.py)
-- POST /api/traces — 执行控制(trace/run_api.py,需配置 Runner)
-- WS   /api/traces/{id}/watch — 实时推送(trace/websocket.py)
-- GET  /api/experiences — 经验查询(trace/run_api.py,需配置 Runner)
-"""
-
-import logging
-import json
-import os
-from dotenv import load_dotenv
-load_dotenv()
-from fastapi import FastAPI, Request, WebSocket
-from fastapi.middleware.cors import CORSMiddleware
-import uvicorn
-
-from agent.trace import FileSystemTraceStore
-from agent.trace.api import router as api_router, set_trace_store as set_api_trace_store
-from agent.trace.run_api import router as run_router, experiences_router, set_runner
-from agent.trace.websocket import router as ws_router, set_trace_store as set_ws_trace_store
-from agent.trace.examples_api import router as examples_router
-from agent.trace.logs_websocket import router as logs_router, setup_websocket_logging
-from agent.trace.upload_api import router as upload_router, set_trace_store as set_upload_trace_store
-
-
-# ===== 日志配置 =====
-
-logging.basicConfig(
-    level=logging.INFO,
-    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s"
-)
-logger = logging.getLogger(__name__)
-
-# 设置WebSocket日志推送
-setup_websocket_logging(level=logging.INFO)
-
-
-# ===== FastAPI 应用 =====
-
-app = FastAPI(
-    title="Agent API",
-    description="Agent 查询 + 执行 API",
-    version="1.0.0"
-)
-
-# CORS 配置(允许前端跨域访问)
-app.add_middleware(
-    CORSMiddleware,
-    allow_origins=["*"],  # 生产环境应限制具体域名
-    allow_credentials=True,
-    allow_methods=["*"],
-    allow_headers=["*"],
-)
-
-
-# ===== 初始化存储 =====
-
-# 使用文件系统存储(支持跨进程和持久化)
-trace_store = FileSystemTraceStore(base_path=".trace")
-
-# 注入到 step_tree 模块
-set_api_trace_store(trace_store)
-set_ws_trace_store(trace_store)
-set_upload_trace_store(trace_store)
-
-
-# ===== 可选:配置 Runner(启用执行 API)=====
-
-# 如需启用 POST /api/traces(新建/运行/停止/反思),取消以下注释并配置 LLM:
-
-from agent.core.runner import AgentRunner
-from agent.llm import create_openrouter_llm_call
-
-runner = AgentRunner(
-    trace_store=trace_store,
-    llm_call=create_openrouter_llm_call(model="anthropic/claude-sonnet-4.5"),
-)
-set_runner(runner)
-
-
-# ===== 注册路由 =====
-
-# Examples API(GET /api/examples)
-app.include_router(examples_router)
-
-# Trace 上传 API(POST /api/traces/upload)
-app.include_router(upload_router)
-
-# Trace 执行 API(POST + GET /running,需配置 Runner)
-# 注意:run_router 必须在 api_router 之前注册,否则 GET /running 会被 /{trace_id} 捕获
-app.include_router(run_router)
-
-# 经验 API(GET /api/experiences,需配置 Runner)
-app.include_router(experiences_router)
-
-# Trace 查询 API(GET)
-app.include_router(api_router)
-
-# Trace WebSocket(实时推送)
-app.include_router(ws_router)
-
-# Logs WebSocket(日志推送)
-app.include_router(logs_router)
-
-
-@app.on_event("startup")
-async def on_startup():
-    """服务器启动时执行状态对齐"""
-    from agent.trace.run_api import reconcile_traces
-    await reconcile_traces()
-
-@app.websocket("/ws_ping")
-async def ws_ping(websocket: WebSocket):
-    await websocket.accept()
-    await websocket.send_text("pong")
-    await websocket.close()
-
-
-# ===== 健康检查 =====
-
-@app.get("/health")
-async def health_check():
-    """健康检查"""
-    return {
-        "status": "ok",
-        "service": "Agent Step Tree API",
-        "version": "1.0.0"
-    }
-
-
-# ===== 启动服务 =====
-
-if __name__ == "__main__":
-    logger.info("Starting API server...")
-    uvicorn.run(
-        "api_server:app",
-        host="0.0.0.0",
-        port=8000,
-        reload=True,  # 开发模式
-        log_level="info"
-    )

+ 41 - 0
app.py

@@ -0,0 +1,41 @@
+import logging
+
+from quart import Quart
+from quart_cors import cors
+
+from src.core.bootstrap import AppContext, setup_logging
+from src.core.dependency import ServerContainer
+from src.core.api.v1.routes import server_routes
+from src.core.api.v1.middleware import register_error_handlers
+
+setup_logging()
+logger = logging.getLogger(__name__)
+
+app = Quart(__name__)
+app = cors(app, allow_origin="*")
+
+register_error_handlers(app)
+
+server_container = ServerContainer()
+ctx = AppContext(server_container)
+
+config = server_container.config()
+log_service = server_container.log_service()
+mysql_pool = server_container.mysql_pool()
+
+routes = server_routes(mysql_pool, log_service, config)
+app.register_blueprint(routes)
+
+
+@app.before_serving
+async def startup():
+    logger.info("Starting application...")
+    await ctx.start_up()
+    logger.info("Application started successfully")
+
+
+@app.after_serving
+async def shutdown():
+    logger.info("Shutting down application...")
+    await ctx.shutdown()
+    logger.info("Application shutdown successfully")

+ 0 - 69
config/feishu_contacts.json

@@ -1,69 +0,0 @@
-[
-  {
-    "name": "谭景玉",
-    "description": "",
-    "open_id": "ou_11fdbd559cc6513ab53ff06d6c63413d",
-    "chat_id": "oc_56e85f0e2c97405d176729b62d8f56e5"
-  },
-  {
-    "name": "王华东",
-    "description": "",
-    "open_id": "ou_82340312cf9d215f49a41b67fa9c02c2"
-  },
-  {
-    "name": "孙若天",
-    "description": "",
-    "open_id": "ou_ede69f28c2617bf80a7574f059879c8d"
-  },
-  {
-    "name": "刘斌",
-    "description": "",
-    "open_id": "ou_50c2307c3531e6293b3d5533d14592e9"
-  },
-  {
-    "name": "关涛",
-    "description": "",
-    "open_id": "ou_90b80ed994fe41b7f038a63cb9182f72",
-    "chat_id": "oc_ac9633d2c61f43b5049c425305482491"
-  },
-  {
-    "name": "刘龙",
-    "description": "",
-    "open_id": "ou_2d25b935d720c4404e4ea88b70bcdce2"
-  },
-  {
-    "name": "马晗",
-    "description": "",
-    "open_id": "ou_405c6b8581ee36b153ff8159cfc9f29e"
-  },
-  {
-    "name": "王雅萱",
-    "description": "",
-    "open_id": "ou_22b070f27496faae0c4d841b82eda5c1"
-  },
-  {
-    "name": "苏朋",
-    "description": "",
-    "open_id": "ou_1bca759ca8efc4870f262c97c1a05e52"
-  },
-  {
-    "name": "杨孝辉",
-    "description": "",
-    "open_id": "ou_68709278795778df53519a577e3da486"
-  },
-  {
-    "name": "刘志恒",
-    "description": "",
-    "open_id": "ou_1922d32126d44e1cdbe658e6c184f502"
-  },
-  {
-    "name": "聂琦",
-    "description": "",
-    "open_id": "ou_3707d21dd00fa8753b9827214b834142"
-  },
-  {
-    "name": "蒋德敏",
-    "description": "",
-    "open_id": "ou_f6a659e740ebd110cfe27dc38bbddb37"
-  }
-]

+ 0 - 246
config/pricing.yaml

@@ -1,246 +0,0 @@
-# LLM 定价配置
-#
-# 价格单位:美元 / 1M tokens
-# 支持通配符:* 匹配任意字符
-#
-# 字段说明:
-#   model: 模型名称(必填)
-#   input_price: 输入 token 价格(必填)
-#   output_price: 输出 token 价格(必填)
-#   reasoning_price: 推理 token 价格(可选,默认 = output_price)
-#   cache_creation_price: 缓存创建价格(可选,默认 = input_price * 1.25)
-#   cache_read_price: 缓存读取价格(可选,默认 = input_price * 0.1)
-#   provider: 提供商名称(可选,用于分类)
-#   description: 描述(可选)
-#
-# 使用方法:
-#   1. 复制此文件到项目根目录或 config/ 目录
-#   2. 或设置环境变量 AGENT_PRICING_CONFIG 指向配置文件
-#   3. 根据实际使用的模型修改价格
-
-models:
-  # ===== OpenAI =====
-  - model: gpt-4o
-    input_price: 2.50
-    output_price: 10.00
-    provider: openai
-
-  - model: gpt-4o-mini
-    input_price: 0.15
-    output_price: 0.60
-    provider: openai
-
-  - model: gpt-4-turbo
-    input_price: 10.00
-    output_price: 30.00
-    provider: openai
-
-  # o1 系列(有 reasoning tokens)
-  - model: o1
-    input_price: 15.00
-    output_price: 60.00
-    reasoning_price: 60.00  # reasoning tokens 和 output 同价
-    provider: openai
-
-  - model: o1-mini
-    input_price: 3.00
-    output_price: 12.00
-    reasoning_price: 12.00
-    provider: openai
-
-  - model: o3-mini
-    input_price: 1.10
-    output_price: 4.40
-    reasoning_price: 4.40
-    provider: openai
-
-  # ===== Anthropic Claude =====
-  # Claude 支持 prompt caching,缓存价格:
-  #   - cache_creation: 1.25x input_price
-  #   - cache_read: 0.1x input_price
-  - model: claude-3-5-sonnet-20241022
-    input_price: 3.00
-    output_price: 15.00
-    cache_creation_price: 3.75   # 3.00 * 1.25
-    cache_read_price: 0.30       # 3.00 * 0.1
-    provider: anthropic
-
-  - model: claude-3-5-haiku-20241022
-    input_price: 0.80
-    output_price: 4.00
-    cache_creation_price: 1.00   # 0.80 * 1.25
-    cache_read_price: 0.08       # 0.80 * 0.1
-    provider: anthropic
-
-  - model: claude-3-opus-20240229
-    input_price: 15.00
-    output_price: 75.00
-    cache_creation_price: 18.75  # 15.00 * 1.25
-    cache_read_price: 1.50       # 15.00 * 0.1
-    provider: anthropic
-
-  # Claude 通配符(匹配新版本)
-  - model: claude-3-5-sonnet*
-    input_price: 3.00
-    output_price: 15.00
-    cache_creation_price: 3.75
-    cache_read_price: 0.30
-    provider: anthropic
-
-  - model: claude-sonnet-4*
-    input_price: 3.00
-    output_price: 15.00
-    cache_creation_price: 3.75   # 3.00 * 1.25
-    cache_read_price: 0.30       # 3.00 * 0.1
-    provider: anthropic
-
-  - model: claude-opus-4*
-    input_price: 5.00
-    output_price: 25.00
-    cache_creation_price: 6.25   # 5.00 * 1.25
-    cache_read_price: 0.50       # 5.00 * 0.1
-    provider: anthropic
-
-  # ===== Google Gemini =====
-  - model: gemini-2.5-pro
-    input_price: 1.25
-    output_price: 10.00
-    reasoning_price: 10.00  # thinking mode
-    provider: google
-
-  - model: gemini-2.0-flash
-    input_price: 0.10
-    output_price: 0.40
-    provider: google
-
-  - model: gemini-2.0-flash-thinking
-    input_price: 0.10
-    output_price: 0.40
-    reasoning_price: 0.40
-    provider: google
-
-  - model: gemini-1.5-pro
-    input_price: 1.25
-    output_price: 5.00
-    provider: google
-
-  - model: gemini-1.5-flash
-    input_price: 0.075
-    output_price: 0.30
-    provider: google
-
-  # Gemini 通配符
-  - model: gemini-2.5*
-    input_price: 1.25
-    output_price: 10.00
-    provider: google
-
-  - model: gemini-2.0*
-    input_price: 0.10
-    output_price: 0.40
-    provider: google
-
-  # ===== DeepSeek =====
-  - model: deepseek-chat
-    input_price: 0.14
-    output_price: 0.28
-    provider: deepseek
-
-  - model: deepseek-reasoner
-    input_price: 0.55
-    output_price: 2.19
-    reasoning_price: 2.19
-    provider: deepseek
-
-  - model: deepseek-r1*
-    input_price: 0.55
-    output_price: 2.19
-    reasoning_price: 2.19
-    provider: deepseek
-
-  # ===== OpenRouter 转发 =====
-  # OpenRouter 使用 provider/model 格式
-  - model: anthropic/claude-sonnet-4.5
-    input_price: 3.00
-    output_price: 15.00
-    cache_creation_price: 3.75
-    cache_read_price: 0.30
-    provider: openrouter
-
-  - model: anthropic/claude-opus-4.5
-    input_price: 5.00
-    output_price: 25.00
-    cache_creation_price: 6.25
-    cache_read_price: 0.50
-    provider: openrouter
-
-  - model: anthropic/claude-opus-4.6
-    input_price: 5.00
-    output_price: 25.00
-    cache_creation_price: 6.25
-    cache_read_price: 0.50
-    provider: openrouter
-
-  - model: anthropic/claude-haiku-4.5
-    input_price: 1.00
-    output_price: 5.00
-    cache_creation_price: 1.25
-    cache_read_price: 0.10
-    provider: openrouter
-
-  - model: anthropic/claude-sonnet-4
-    input_price: 3.00
-    output_price: 15.00
-    cache_creation_price: 3.75
-    cache_read_price: 0.30
-    provider: openrouter
-
-  - model: anthropic/claude*
-    input_price: 3.00
-    output_price: 15.00
-    cache_creation_price: 3.75
-    cache_read_price: 0.30
-    provider: openrouter
-
-  - model: openai/gpt-4o*
-    input_price: 2.50
-    output_price: 10.00
-    provider: openrouter
-
-  - model: openai/o1*
-    input_price: 15.00
-    output_price: 60.00
-    reasoning_price: 60.00
-    provider: openrouter
-
-  - model: google/gemini-3-pro-preview
-    input_price: 2
-    output_price: 12
-    reasoning_price: 12
-    provider: openrouter
-
-  - model: google/gemini-3-flash-preview
-    input_price: 0.50
-    output_price: 3
-    reasoning_price: 3
-    provider: openrouter
-
-  - model: google/gemini*
-    input_price: 0.30
-    output_price: 2.50
-    reasoning_price: 2.50
-    provider: openrouter
-
-  - model: deepseek/deepseek-r1*
-    input_price: 0.55
-    output_price: 2.19
-    reasoning_price: 2.19
-    provider: openrouter
-
-  # ===== Yescode 代理 =====
-  - model: claude-sonnet-4.5
-    input_price: 3.00
-    output_price: 15.00
-    cache_creation_price: 3.75
-    cache_read_price: 0.30
-    provider: yescode

+ 0 - 122
docs/README.md

@@ -1,122 +0,0 @@
-# Agent 系统文档
-
-## 文档导航
-
-本文档是项目总览和文档导航。详细的模块文档请参考:
-
-### 核心模块
-
-- **[Agent Core 模块](../agent/README.md)** - Agent 核心引擎、工具系统、记忆管理
-  - [架构设计](../agent/docs/architecture.md) - Agent 框架完整架构
-  - [工具系统](../agent/docs/tools.md)
-  - [Skills 指南](../agent/docs/skills.md)
-  - [Trace API](../agent/docs/trace-api.md)
-  - [多模态支持](../agent/docs/multimodal.md)
-  - [设计决策](../agent/docs/decisions.md)
-
-- **[Gateway 模块](../gateway/README.md)** - Agent 注册、消息路由、在线状态管理
-  - [架构设计](../gateway/docs/architecture.md)
-  - [部署指南](../gateway/docs/deployment.md)
-  - [API 参考](../gateway/docs/api.md)
-  - [设计决策](../gateway/docs/decisions.md)
-  - [Enterprise 层](../gateway/docs/enterprise/overview.md)
-  - [A2A IM 使用](../gateway/client/a2a_im.md) - Agent 间通讯工具
-
-### 跨模块文档
-
-- [A2A IM 系统](./a2a-im.md) - Agent 间即时通讯系统架构
-- [知识管理](../knowhub/docs/knowledge-management.md) - 知识结构、API、集成方式
-- [Context 管理](./context-management.md) - Goals、压缩、Plan 注入策略
-
-### 研究文档
-
-- [A2A 协议调研](./research/a2a-protocols.md) - 行业 A2A 通信协议和框架对比
-- [A2A 跨设备通信](./research/a2a-cross-device.md) - 跨设备 Agent 通信方案(内部)
-- [A2A Trace 存储](./research/a2a-trace-storage.md) - 跨设备 Trace 存储方案详细设计
-- [MAMP 协议](./research/a2a-mamp-protocol.md) - 与外部 Agent 系统的通用交互协议
-
----
-
-## 文档维护规范
-
-0. **先改文档,再动代码** - 新功能或重大修改需先完成文档更新、并完成审阅后,再进行代码实现;除非改动较小、不被文档涵盖
-1. **文档分层,链接代码** - 重要或复杂设计可以另有详细文档;关键实现需标注代码文件路径;格式:`module/file.py:function_name`
-2. **简洁快照,日志分离** - 只记录最重要的、与代码准确对应的或者明确的已完成的设计的信息,避免推测、建议,或大量代码;决策依据或修改日志若有必要,可在模块的 decisions.md 另行记录
-
----
-
-## 项目概览
-
-### 系统架构
-
-```
-Agent 系统
-├── agent/          # Agent Core - 核心引擎、工具、记忆
-├── gateway/        # Gateway - 消息路由、Agent 注册
-├── docs/           # 跨模块文档
-└── examples/       # 使用示例和集成示例
-```
-
-### 核心理念
-
-**所有 Agent 都是 Trace**
-
-| 类型 | 创建方式 | 父子关系 | 状态 |
-|------|---------|---------|------|
-| 主 Agent | 直接调用 `runner.run()` | 无 parent | 正常执行 |
-| 子 Agent | 通过 `agent` 工具 | `parent_trace_id` / `parent_goal_id` 指向父 | 正常执行 |
-| 人类协助 | 通过 `ask_human` 工具 | `parent_trace_id` 指向父 | 阻塞等待 |
-
-### 模块职责
-
-| 模块 | 职责 | 详细文档 |
-|-----|------|---------|
-| **agent/core/** | Agent 执行引擎 + 预设配置 | [架构设计](../agent/docs/architecture.md) |
-| **agent/trace/** | 执行追踪 + 计划管理 | [Trace API](../agent/docs/trace-api.md) |
-| **agent/tools/** | 与外部世界交互 | [工具系统](../agent/docs/tools.md) |
-| **agent/skill/** | 技能系统 | [Skills 指南](../agent/docs/skills.md) |
-| **agent/llm/** | LLM Provider 适配 | [架构设计](../agent/docs/architecture.md#llm-provider-适配) |
-| **gateway/core/** | Agent 注册和消息路由 | [Gateway 架构](../gateway/docs/architecture.md) |
-| **gateway/client/** | Gateway 客户端 SDK | [A2A IM](../gateway/client/a2a_im.md) |
-
----
-
-## 快速开始
-
-### Agent Core
-
-```python
-from agent.core import AgentRunner, RunConfig
-
-runner = AgentRunner(...)
-
-async for item in runner.run(
-    messages=[{"role": "user", "content": "分析项目架构"}],
-    config=RunConfig(model="gpt-4o")
-):
-    print(item)
-```
-
-详见:[Agent Core README](../agent/README.md)
-
-### Gateway
-
-```bash
-# 安装 Gateway 客户端
-cd gateway
-pip install -e .
-
-# 使用 CLI
-gateway-cli send --from my-agent --to target-agent --message "Hello"
-gateway-cli list
-```
-
-详见:[Gateway README](../gateway/README.md) 和 [A2A IM 文档](../gateway/client/a2a_im.md)
-
----
-
-## 相关文档
-
-完整的文档列表见各模块的 README:
-- [Agent Core 文档](../agent/README.md#文档)
-- [Gateway 文档](../gateway/README.md#文档)

+ 0 - 651
docs/a2a-im.md

@@ -1,651 +0,0 @@
-# A2A IM:Agent 即时通讯系统
-
-**更新日期:** 2026-03-04
-
-## 文档维护规范
-
-0. **先改文档,再动代码** - 新功能或重大修改需先完成文档更新、并完成审阅后,再进行代码实现;除非改动较小、不被文档涵盖
-1. **文档分层,链接代码** - 重要或复杂设计可以另有详细文档;关键实现需标注代码文件路径;格式:`module/file.py:function_name`
-2. **简洁快照,日志分离** - 只记录最重要的、与代码准确对应的或者明确的已完成的设计的信息,避免推测、建议,或大量代码;决策依据或修改日志若有必要,可在`docs/decisions.md`另行记录
-
----
-
-## 文档说明
-
-本文档描述 Agent 间即时通讯(A2A IM)系统的架构和实现。
-
-**相关文档**:
-- [MAMP 协议](./research/a2a-mamp-protocol.md):消息格式和传输协议
-- [A2A 跨设备通信](./research/a2a-cross-device.md):内部 Agent 通信方案
-- [Agent 框架](./README.md):核心 Agent 能力
-- [Enterprise 层](../gateway/docs/enterprise/overview.md):组织级功能
-
----
-
-## 系统概述
-
-A2A IM 是一个**任务导向的 Agent 即时通讯系统**,支持:
-- Agent 间消息传递(点对点、通过 Gateway)
-- 活跃协作者管理(当前任务)
-- 全局联系人管理(历史记录)
-- 在线状态查询
-- 对话历史追溯
-
-**与传统 IM 的区别**:
-- 任务导向(非纯聊天)
-- 长时间处理(分钟到小时)
-- 工具调用和执行记录
-- 完整的 Trace 追溯
-
----
-
-## 架构层次关系
-
-A2A IM 在整体架构中的定位:
-
-```
-┌─────────────────────────────────────────────────────────────┐
-│ Enterprise Layer(组织级)- 可选                              │
-│ - 认证和授权(飞书 OAuth、API Key、JWT)                      │
-│ - 审计和监控(操作日志、成本记录、安全事件)                    │
-│ - 多租户和权限控制(角色验证、资源访问控制)                    │
-│ - 成本管理和限额(用户级/组织级限额、超限告警)                 │
-│                                                              │
-│ 实现位置: gateway/enterprise/                                │
-│ 文档: gateway/docs/enterprise/overview.md                   │
-└─────────────────────────────────────────────────────────────┘
-
-┌─────────────────────────────────────────────────────────────┐
-│ A2A IM Gateway(通讯层)★ 本文档                             │
-│ - Agent 注册和发现(Registry)                                │
-│ - 消息路由(Gateway Router)                                  │
-│ - 活跃协作者管理(Collaborators)                             │
-│ - 在线状态管理(Heartbeat)                                   │
-│ - 联系人管理(ContactStore)                                  │
-│                                                              │
-│ 实现位置: gateway/core/                                       │
-│ 文档: docs/a2a-im.md(本文档)                                │
-└─────────────────────────────────────────────────────────────┘
-         ↕ 使用(单向依赖)
-┌─────────────────────────────────────────────────────────────┐
-│ Agent Core(核心层)                                          │
-│ - Trace、Message、Goal 管理                                  │
-│ - 工具系统(文件、命令、网络、浏览器)                          │
-│ - LLM 集成(Gemini、OpenRouter、Yescode)                    │
-│ - Skills(领域知识注入)                                        │
-│ - 子 Agent 机制(agent 工具)                                 │
-│                                                              │
-│ 实现位置: agent/                                              │
-│ 文档: docs/README.md                                         │
-└─────────────────────────────────────────────────────────────┘
-```
-
-### 层次说明
-
-**Agent Core(核心层)**:
-- 提供单个 Agent 的执行能力
-- 管理 Trace、Message、Goal
-- 提供工具系统和 LLM 集成
-- 支持子 Agent 创建(通过 `agent` 工具)
-- **独立部署**:可以不依赖 Gateway 运行
-
-**A2A IM Gateway(通讯层)**:
-- 与 Agent Core 并列,独立的系统
-- 提供 Agent 间通讯能力
-- 管理 Agent 注册和在线状态
-- 路由消息到目标 Agent
-- 维护活跃协作者和联系人
-- **依赖 Agent Core**:使用 ToolContext、TraceStore 等组件
-- **独立部署**:可以作为独立服务部署
-
-**Enterprise(组织层)**:
-- 可选的企业功能扩展
-- 提供企业级管理和控制
-- 认证、授权、审计
-- 多租户和成本管理
-- **可以集成到 Gateway**:作为 Gateway 的扩展模块
-- **也可以独立部署**:作为独立的 Enterprise Gateway 服务
-
-### 依赖关系
-
-```
-Enterprise → Gateway → Agent Core
-(可选)    (通讯)    (核心)
-
-- Agent Core 不依赖任何其他层(独立)
-- Gateway 依赖 Agent Core(单向依赖)
-- Enterprise 依赖 Gateway(可选扩展)
-```
-
-### 部署方式
-
-**方式 1:单体部署(个人/小团队)**
-```
-一个进程:
-├─ Agent Core
-└─ Gateway(包含 Enterprise 模块)
-```
-
-**方式 2:分离部署(中等规模)**
-```
-进程 1:Agent Core
-进程 2:Gateway(包含 Enterprise 模块)
-```
-
-**方式 3:分层部署(大规模/企业)**
-```
-进程 1:Agent Core
-进程 2:Gateway Core
-进程 3:Enterprise Gateway
-```
-
----
-
-## 架构设计
-
-### 三层架构
-
-```
-┌─────────────────────────────────────────────────┐
-│ Layer 3: Agent 逻辑层                            │
-│ - Trace, Goal, Messages                         │
-│ - 工具调用和执行                                  │
-└─────────────────────────────────────────────────┘
-                    ↕
-┌─────────────────────────────────────────────────┐
-│ Layer 2: A2A IM 层                               │
-│ - 活跃协作者管理                                  │
-│ - 全局联系人管理                                  │
-│ - conversation_id ↔ trace_id 映射                │
-└─────────────────────────────────────────────────┘
-                    ↕
-┌─────────────────────────────────────────────────┐
-│ Layer 1: Gateway 层                              │
-│ - Agent 注册和发现                                │
-│ - 消息路由                                        │
-│ - 在线状态管理                                    │
-│ - WebSocket 长连接                                │
-└─────────────────────────────────────────────────┘
-```
-
-### 通信模式
-
-**模式 1:内部 Agent(同进程)**
-```
-Agent A → 直接调用 → Agent B
-(复用现有 agent 工具)
-```
-
-**模式 2:跨设备 Agent(组织内)**
-```
-PC Agent → WebSocket → Gateway → 云端 Agent
-(反向连接,无需公网 IP)
-```
-
-**模式 3:外部 Agent(跨组织)**
-```
-Agent A → MAMP 协议 → Agent B
-(点对点 HTTP)
-```
-
----
-
-## 数据模型
-
-### 活跃协作者(Layer 2)
-
-存储在 `trace.context["collaborators"]`,记录当前任务的协作者。
-
-```python
-{
-    "name": "code-analyst",
-    "type": "agent",  # agent | human
-    "agent_uri": "agent://other.com/code-analyst",
-    "trace_id": "abc-123",
-    "conversation_id": "conv-456",
-    "status": "running",  # running | waiting | completed | failed
-    "summary": "正在分析代码架构",
-    "last_message_at": "2026-03-04T10:30:00Z"
-}
-```
-
-**实现位置**:`agent/core/runner.py:AgentRunner._build_context_injection`
-
-### 全局联系人(Layer 2)
-
-存储在 `.trace/contacts.json`,记录所有历史联系过的 Agent。
-
-```python
-{
-    "agent_uri": "agent://other.com/code-analyst",
-    "name": "Code Analyst",
-    "type": "agent",
-
-    # 身份信息(从 Agent Card 获取)
-    "card": {
-        "description": "专注于代码分析",
-        "capabilities": ["code_analysis", "file_read"],
-        "owner": {"user_name": "张三"}
-    },
-
-    # 交互统计
-    "stats": {
-        "first_contact": "2026-02-01T10:00:00Z",
-        "last_contact": "2026-03-04T10:30:00Z",
-        "total_conversations": 15,
-        "total_messages": 127
-    },
-
-    # 最近对话
-    "recent_conversations": [
-        {
-            "conversation_id": "conv-456",
-            "trace_id": "abc-123",
-            "started_at": "2026-03-04T10:00:00Z",
-            "last_message": "分析完成",
-            "status": "active"
-        }
-    ],
-
-    # 关系标签
-    "tags": ["code", "architecture"],
-    "pinned": false
-}
-```
-
-**实现位置**:`agent/trace/contact_store.py`
-
-### Agent 注册信息(Layer 1)
-
-存储在 Gateway,记录在线 Agent 的连接信息。
-
-```python
-{
-    "agent_uri": "agent://internal/code-analyst",
-    "connection_type": "websocket",  # websocket | http
-    "websocket": <WebSocket>,  # WebSocket 连接对象
-    "http_endpoint": "http://localhost:8001",  # HTTP 端点
-    "last_heartbeat": "2026-03-04T10:30:00Z",
-    "capabilities": ["code_analysis", "file_read"]
-}
-```
-
-**实现位置**:`gateway/core/registry.py`
-
----
-
-## 核心功能
-
-### 1. Agent 注册和发现
-
-**PC Agent 启动时注册**:
-
-```python
-# 建立 WebSocket 长连接
-ws = await websockets.connect("wss://gateway.com/gateway/connect")
-
-# 注册
-await ws.send(json.dumps({
-    "type": "register",
-    "agent_uri": "agent://internal/my-agent",
-    "capabilities": ["file_read", "bash"]
-}))
-
-# 保持心跳
-while True:
-    await ws.send(json.dumps({"type": "heartbeat"}))
-    await asyncio.sleep(30)
-```
-
-**实现位置**:`gateway/core/client.py`
-
-### 2. 消息路由
-
-**通过 Gateway 发送消息**:
-
-```python
-# 发送方
-POST /gateway/send
-{
-    "to": "agent://internal/code-analyst",
-    "content": "帮我分析代码"
-}
-
-# Gateway 查找目标 Agent
-agent_info = registry.lookup("agent://internal/code-analyst")
-
-# 通过 WebSocket 推送
-await agent_info["websocket"].send(json.dumps({
-    "type": "message",
-    "from": "agent://internal/caller",
-    "content": "帮我分析代码"
-}))
-```
-
-**实现位置**:`gateway/core/router.py`
-
-### 3. 活跃协作者管理
-
-**发送消息时自动更新**:
-
-```python
-# agent/tools/builtin/a2a_im.py
-
-async def send_to_agent(...):
-    # 发送消息
-    response = await gateway_client.send(...)
-
-    # 更新活跃协作者
-    await update_active_collaborator(
-        trace_id=ctx.trace_id,
-        agent_uri=target_agent,
-        conversation_id=response["conversation_id"],
-        status="waiting"
-    )
-```
-
-**周期性注入到 Agent 上下文**:
-
-```python
-# agent/core/runner.py
-
-if iteration % 10 == 0:
-    collaborators = trace.context.get("collaborators", [])
-    inject_collaborators_markdown(collaborators)
-```
-
-### 4. 全局联系人管理
-
-**查询联系人**:
-
-```python
-# 通过工具查询
-contacts = await get_contacts(
-    type="agent",
-    status="online",
-    tags=["code"]
-)
-```
-
-**自动维护**:
-
-```python
-# 发送/接收消息时自动更新
-await contact_store.update(
-    agent_uri=target_agent,
-    last_contact=datetime.now(),
-    increment_message_count=True
-)
-```
-
-**实现位置**:`agent/trace/contact_store.py`
-
-### 5. 在线状态查询
-
-**查询 Agent 在线状态**:
-
-```python
-GET /gateway/status/{agent_uri}
-
-返回:
-{
-    "agent_uri": "agent://internal/code-analyst",
-    "status": "online",  # online | offline
-    "last_seen": "2026-03-04T10:30:00Z"
-}
-```
-
-**实现位置**:`gateway/core/router.py:get_agent_status`
-
----
-
-## API 端点
-
-### Gateway API
-
-| 方法 | 路径 | 说明 |
-|------|------|------|
-| WS | `/gateway/connect` | Agent 注册和保持连接 |
-| POST | `/gateway/send` | 发送消息到其他 Agent |
-| GET | `/gateway/status/{agent_uri}` | 查询 Agent 在线状态 |
-| GET | `/gateway/agents` | 列出所有在线 Agent |
-
-### A2A IM API
-
-| 方法 | 路径 | 说明 |
-|------|------|------|
-| GET | `/api/traces/{id}/collaborators` | 查询活跃协作者 |
-| GET | `/api/contacts` | 查询全局联系人 |
-| GET | `/api/contacts/{agent_uri}` | 查询特定联系人详情 |
-| GET | `/api/contacts/{agent_uri}/conversations` | 查询对话历史 |
-
----
-
-## 工具系统
-
-### send_to_agent 工具
-
-发送消息到其他 Agent(内部或外部)。
-
-```python
-@tool(description="发送消息到其他 Agent")
-async def send_to_agent(
-    target_agent: str,  # agent://domain/id
-    message: str,
-    conversation_id: Optional[str] = None,
-    ctx: ToolContext = None
-) -> ToolResult
-```
-
-**实现位置**:`agent/tools/builtin/a2a_im.py:send_to_agent`
-
-### get_active_collaborators 工具
-
-查询当前任务的活跃协作者。
-
-```python
-@tool(description="查询当前任务的活跃协作者")
-async def get_active_collaborators(
-    ctx: ToolContext
-) -> ToolResult
-```
-
-**实现位置**:`agent/tools/builtin/a2a_im.py:get_active_collaborators`
-
-### get_contacts 工具
-
-查询全局联系人列表。
-
-```python
-@tool(description="查询所有联系过的 Agent")
-async def get_contacts(
-    type: Optional[str] = None,  # agent | human
-    status: Optional[str] = None,  # online | offline
-    tags: Optional[List[str]] = None,
-    ctx: ToolContext = None
-) -> ToolResult
-```
-
-**实现位置**:`agent/tools/builtin/a2a_im.py:get_contacts`
-
----
-
-## Skill 系统
-
-### a2a_im.md Skill
-
-提供 A2A IM 使用指南,注入到 Agent 的 system prompt。
-
-**内容**:
-- 如何发送消息到其他 Agent
-- 如何查询活跃协作者
-- 如何查询联系人
-- 最佳实践
-
-**实现位置**:`agent/skill/skills/a2a_im.md`
-
----
-
-## 使用示例
-
-### 场景 1:调用其他 Agent 协作
-
-```python
-# Agent A 需要代码分析帮助
-result = await send_to_agent(
-    target_agent="agent://internal/code-analyst",
-    message="帮我分析 /path/to/project 的架构"
-)
-
-# 继续对话
-result2 = await send_to_agent(
-    target_agent="agent://internal/code-analyst",
-    message="重点分析 core 模块",
-    conversation_id=result["conversation_id"]
-)
-```
-
-### 场景 2:查询活跃协作者
-
-```python
-# 查看当前任务中有哪些 Agent 在协作
-collaborators = await get_active_collaborators()
-
-# 输出:
-# ## 活跃协作者
-# - code-analyst [agent, completed]: 分析完成,发现3个问题
-# - test-runner [agent, running]: 正在运行测试
-```
-
-### 场景 3:查询联系人
-
-```python
-# 查找擅长代码分析的 Agent
-contacts = await get_contacts(
-    type="agent",
-    tags=["code", "architecture"]
-)
-
-# 输出:
-# ## 联系人列表
-# 🟢 code-analyst - agent://internal/code-analyst
-#    最后联系: 2026-03-04 10:30
-#    对话次数: 15
-```
-
----
-
-## 架构决策
-
-### 决策 1:Gateway 与 Agent 并列而非包含
-
-**问题**:Gateway 应该放在 agent/ 内部还是与 agent/ 并列?
-
-**决策**:与 agent/ 并列
-
-**理由**:
-1. **解耦**:Gateway 和 Agent Core 是两个独立的系统
-2. **独立部署**:Gateway 可以独立部署和扩展
-3. **职责清晰**:Agent Core 负责单 Agent 执行,Gateway 负责 Agent 间通讯
-4. **依赖关系**:Gateway 依赖 Agent Core(单向),但 Agent Core 不依赖 Gateway
-
-**实现**:
-- 目录结构:`gateway/` 与 `agent/` 并列
-- Import 路径:`from gateway.core import ...`
-
-### 决策 2:Enterprise 与 Gateway 的关系
-
-**问题**:Enterprise 应该是 Gateway 的上层(分层架构)还是 Gateway 的模块(模块化架构)?
-
-**决策**:根据阶段选择
-
-**MVP 阶段(当前)**:模块化架构
-- Enterprise 作为 Gateway 的可选模块
-- 部署简单,快速迭代
-- 适合中小规模
-
-**大规模阶段(未来)**:可选分层架构
-- Enterprise 作为独立的 Gateway 层
-- 可独立扩容,团队协作
-- 适合大规模部署
-
-**理由**:
-1. **灵活性**:两种架构都可以实现可选部署
-2. **演进路径**:从模块化开始,需要时重构为分层
-3. **规模决定**:小规模用模块化,大规模用分层
-
-**实现**:
-- 当前:`gateway/enterprise/` 作为可选模块
-- 未来:可重构为独立的 `enterprise_gateway/` 服务
-
-### 决策 3:活跃协作者的管理方式
-
-**问题**:活跃协作者信息应该如何存储和管理?
-
-**决策**:存储在 `trace.context["collaborators"]`,由工具自动维护
-
-**理由**:
-1. **复用现有机制**:Agent Core 已有 context 机制
-2. **自动注入**:Runner 周期性注入到 Agent 上下文(每 10 轮)
-3. **工具维护**:send_to_agent 等工具自动更新
-4. **与 Goal 一致**:与 GoalTree 一同注入,保持一致性
-
-**实现位置**:
-- 存储:`trace.context["collaborators"]`
-- 注入:`agent/core/runner.py:AgentRunner._build_context_injection`
-- 更新:`agent/tools/builtin/a2a_im.py:_update_active_collaborator`
-
----
-
-## 实现路线图
-
-### Phase 1:基础功能(1-2 周)
-
-**目标**:实现核心通信能力
-
-**任务**:
-1. 实现 Gateway(注册、路由、WebSocket)
-2. 实现 send_to_agent 工具
-3. 实现活跃协作者自动更新
-4. 实现 a2a_im.md Skill
-
-**实现位置**:
-- `gateway/core/`
-- `agent/tools/builtin/a2a_im.py`
-- `agent/skill/skills/a2a_im.md`
-
-### Phase 2:联系人管理(1 周)
-
-**目标**:完善联系人和历史记录
-
-**任务**:
-1. 实现 ContactStore
-2. 实现 get_contacts 工具
-3. 实现对话历史查询
-4. 实现在线状态查询
-
-**实现位置**:
-- `agent/trace/contact_store.py`
-- `agent/tools/builtin/a2a_im.py`
-
-### Phase 3:增强功能(可选)
-
-**目标**:提升用户体验
-
-**任务**:
-1. 实现消息队列(异步处理)
-2. 实现 Agent 发现和推荐
-3. 实现关系标签和分组
-4. 实现 UI 界面
-
----
-
-## 相关文档
-
-- [MAMP 协议](./research/a2a-mamp-protocol.md):消息格式和传输协议
-- [A2A 跨设备通信](./research/a2a-cross-device.md):内部 Agent 通信方案
-- [工具系统](../agent/docs/tools.md):工具定义、注册
-- [Skills 指南](../agent/docs/skills.md):Skill 分类、编写、加载
-- [Agent 框架](./README.md):核心 Agent 能力
-- [Gateway 架构](../gateway/docs/architecture.md):Gateway 三层架构
-- [Gateway API](../gateway/docs/api.md):Gateway API 参考

+ 0 - 71
docs/research/README.md

@@ -1,71 +0,0 @@
-# Agent2Agent (A2A) 通信调研
-
-本目录包含 Agent2Agent 跨设备通信的调研和设计文档。
-
-## 文档列表
-
-| 文档 | 内容 | 状态 |
-|-----|------|------|
-| [a2a-protocols.md](./a2a-protocols.md) | 行业 A2A 协议和框架调研 | 已完成 |
-| [a2a-cross-device.md](./a2a-cross-device.md) | 跨设备通信方案设计 | 已完成 |
-| [a2a-trace-storage.md](./a2a-trace-storage.md) | 跨设备 Trace 存储方案 | 已完成 |
-| [a2a-continuous-dialogue.md](./a2a-continuous-dialogue.md) | 持续对话方案(已废弃) | 已废弃 |
-
-## 核心设计
-
-### 远程 Trace ID
-
-通过在 Trace ID 中编码位置信息实现跨设备访问:
-
-```
-本地 Trace:  abc-123
-远程 Trace:  agent://terminal-agent-456/abc-123
-```
-
-### 持续对话
-
-通过 `continue_from` 参数实现 Agent 间持续对话:
-
-```python
-# 第一次调用
-result1 = agent(task="分析项目", agent_url="https://remote-agent")
-# 返回: {"sub_trace_id": "agent://remote-agent/abc-123"}
-
-# 继续对话
-result2 = agent(
-    task="重点分析core模块",
-    continue_from=result1["sub_trace_id"],
-    agent_url="https://remote-agent"
-)
-```
-
-### 存储架构
-
-**HybridTraceStore** 自动路由到本地或远程存储:
-- 本地 Trace → `FileSystemTraceStore`
-- 远程 Trace → `RemoteTraceStore`(通过 HTTP API)
-
-## 实现计划
-
-### Phase 1: 基础跨设备通信(1-2周)
-- [ ] 实现 `RemoteTraceStore`
-- [ ] 实现 `HybridTraceStore`
-- [ ] 修改 `agent` 工具支持 `agent_url` 参数
-- [ ] 添加远程 Trace ID 解析
-
-### Phase 2: 增强功能(2-3周)
-- [ ] 认证和授权
-- [ ] 成本控制
-- [ ] 审计日志
-- [ ] 性能优化(缓存、批量API)
-
-### Phase 3: 生产化(按需)
-- [ ] 错误处理和重试
-- [ ] 监控和告警
-- [ ] 文档和示例
-
-## 参考资料
-
-- [Google A2A Protocol](https://a2a-protocol.org/latest/specification/)
-- [Anthropic MCP](https://modelcontextprotocol.io/specification/2025-06-18)
-- [Agent Interoperability Survey](https://arxiv.org/html/2505.02279v1)

+ 0 - 733
docs/research/a2a-continuous-dialogue.md

@@ -1,733 +0,0 @@
-# Agent2Agent 持续对话方案
-
-**更新日期:** 2026-03-03
-
-## 问题定义
-
-### 单次任务 vs 持续对话
-
-**单次任务(之前的方案):**
-```
-云端Agent: 请分析本地项目
-    ↓
-终端Agent: [执行分析] → 返回结果
-    ↓
-结束
-```
-
-**持续对话(新需求):**
-```
-云端Agent: 请分析本地项目
-    ↓
-终端Agent: 我看到有3个模块,你想重点分析哪个?
-    ↓
-云端Agent: 重点分析core模块
-    ↓
-终端Agent: core模块使用了X架构,需要我详细说明吗?
-    ↓
-云端Agent: 是的,请详细说明
-    ↓
-终端Agent: [详细分析] → 返回结果
-    ↓
-结束(或继续)
-```
-
-## 核心挑战
-
-1. **上下文延续** - 如何维护多轮对话的上下文?
-2. **状态管理** - 对话进行到哪一步?谁在等待谁?
-3. **消息路由** - 如何确保消息发送到正确的Agent?
-4. **会话生命周期** - 何时开始?何时结束?
-5. **异步通信** - Agent可能不在线,如何处理?
-
-## 方案对比
-
-### 方案1:基于Trace的持续对话(推荐)
-
-#### 核心思想
-
-**利用现有的Trace机制作为对话容器**
-
-- 每个A2A对话创建一个共享的Trace
-- 双方Agent都可以向这个Trace追加消息
-- 通过WebSocket实时同步消息
-- 利用现有的续跑机制(`continue_from`)
-
-#### 架构设计
-
-```
-云端Agent                共享Trace                终端Agent
-    |                       |                         |
-    | 创建对话              |                         |
-    |--------------------->|                         |
-    |                      |                         |
-    | 发送消息1            |                         |
-    |--------------------->|                         |
-    |                      |----WebSocket推送------->|
-    |                      |                         |
-    |                      |<----追加消息2-----------|
-    |<--WebSocket推送------|                         |
-    |                      |                         |
-    | 发送消息3            |                         |
-    |--------------------->|                         |
-    |                      |----WebSocket推送------->|
-    |                      |                         |
-    ...持续对话...
-```
-
-#### API设计
-
-```python
-# 1. 创建对话会话
-POST /api/a2a/sessions
-{
-    "participants": ["cloud-agent-123", "terminal-agent-456"],
-    "initial_message": "请分析本地项目",
-    "context": {...}
-}
-
-响应:
-{
-    "session_id": "sess-xxx",
-    "trace_id": "trace-yyy",  # 底层使用Trace
-    "ws_url": "wss://host/api/a2a/sessions/sess-xxx/stream"
-}
-
-# 2. 发送消息(追加到Trace)
-POST /api/a2a/sessions/{session_id}/messages
-{
-    "from": "cloud-agent-123",
-    "content": "重点分析core模块",
-    "wait_for_response": true  # 是否等待对方回复
-}
-
-响应:
-{
-    "message_id": "msg-xxx",
-    "status": "sent"
-}
-
-# 3. WebSocket监听(实时接收消息)
-WS /api/a2a/sessions/{session_id}/stream
-{
-    "type": "message",
-    "from": "terminal-agent-456",
-    "content": "我看到有3个模块,你想重点分析哪个?",
-    "message_id": "msg-yyy"
-}
-
-# 4. 获取对话历史
-GET /api/a2a/sessions/{session_id}/messages
-响应:
-{
-    "messages": [
-        {"from": "cloud-agent-123", "content": "...", "timestamp": "..."},
-        {"from": "terminal-agent-456", "content": "...", "timestamp": "..."},
-        ...
-    ]
-}
-
-# 5. 结束对话
-POST /api/a2a/sessions/{session_id}/close
-{
-    "reason": "completed"
-}
-```
-
-#### 实现细节
-
-```python
-# agent/api/a2a_session.py
-
-class A2ASession:
-    """A2A对话会话,基于Trace实现"""
-
-    def __init__(self, session_id: str, trace_id: str, participants: List[str]):
-        self.session_id = session_id
-        self.trace_id = trace_id
-        self.participants = participants
-        self.ws_connections = {}  # agent_id -> WebSocket
-
-    async def send_message(
-        self,
-        from_agent: str,
-        content: str,
-        wait_for_response: bool = False
-    ) -> Dict[str, Any]:
-        """发送消息到对话"""
-        # 1. 追加消息到Trace
-        messages = [{"role": "user", "content": content}]
-        config = RunConfig(
-            trace_id=self.trace_id,
-            after_sequence=None,  # 续跑模式
-            uid=from_agent
-        )
-
-        # 2. 执行(可能触发对方Agent的响应)
-        async for event in runner.run(messages, config):
-            if isinstance(event, Message):
-                # 3. 通过WebSocket推送给其他参与者
-                await self._broadcast_message(event, exclude=from_agent)
-
-                if wait_for_response and event.role == "assistant":
-                    # 等待对方回复
-                    return {"message_id": event.message_id, "status": "sent"}
-
-        return {"status": "completed"}
-
-    async def _broadcast_message(self, message: Message, exclude: str = None):
-        """广播消息给所有参与者(除了发送者)"""
-        for agent_id, ws in self.ws_connections.items():
-            if agent_id != exclude:
-                await ws.send_json({
-                    "type": "message",
-                    "from": exclude,
-                    "content": message.content,
-                    "message_id": message.message_id,
-                    "timestamp": message.created_at.isoformat()
-                })
-
-
-@app.post("/api/a2a/sessions")
-async def create_session(request: CreateSessionRequest):
-    """创建A2A对话会话"""
-    # 1. 创建底层Trace
-    trace = Trace(
-        trace_id=generate_trace_id(),
-        mode="agent",
-        task=request.initial_message,
-        agent_type="a2a_session",
-        context={
-            "session_type": "a2a",
-            "participants": request.participants
-        }
-    )
-    await store.create_trace(trace)
-
-    # 2. 创建Session对象
-    session_id = f"sess-{generate_id()}"
-    session = A2ASession(session_id, trace.trace_id, request.participants)
-
-    # 3. 存储Session(内存或Redis)
-    sessions[session_id] = session
-
-    # 4. 发送初始消息
-    if request.initial_message:
-        await session.send_message(
-            from_agent=request.participants[0],
-            content=request.initial_message
-        )
-
-    return {
-        "session_id": session_id,
-        "trace_id": trace.trace_id,
-        "ws_url": f"wss://{host}/api/a2a/sessions/{session_id}/stream"
-    }
-
-
-@app.websocket("/api/a2a/sessions/{session_id}/stream")
-async def session_stream(websocket: WebSocket, session_id: str):
-    """WebSocket连接,实时接收对话消息"""
-    await websocket.accept()
-
-    # 1. 获取Session
-    session = sessions.get(session_id)
-    if not session:
-        await websocket.close(code=404)
-        return
-
-    # 2. 识别连接的Agent
-    agent_id = await authenticate_websocket(websocket)
-
-    # 3. 注册WebSocket连接
-    session.ws_connections[agent_id] = websocket
-
-    try:
-        # 4. 保持连接,接收消息
-        async for message in websocket:
-            data = json.loads(message)
-            if data["type"] == "message":
-                # 发送消息到对话
-                await session.send_message(
-                    from_agent=agent_id,
-                    content=data["content"]
-                )
-    finally:
-        # 5. 清理连接
-        del session.ws_connections[agent_id]
-
-
-@app.post("/api/a2a/sessions/{session_id}/messages")
-async def send_session_message(session_id: str, request: SendMessageRequest):
-    """发送消息到对话(HTTP方式)"""
-    session = sessions.get(session_id)
-    if not session:
-        raise HTTPException(404, "Session not found")
-
-    result = await session.send_message(
-        from_agent=request.from_agent,
-        content=request.content,
-        wait_for_response=request.wait_for_response
-    )
-
-    return result
-```
-
-#### 客户端SDK
-
-```python
-# agent/client/a2a_session_client.py
-
-class A2ASessionClient:
-    """A2A持续对话客户端"""
-
-    def __init__(self, base_url: str, agent_id: str, api_key: str):
-        self.base_url = base_url
-        self.agent_id = agent_id
-        self.api_key = api_key
-        self.ws = None
-        self.message_handlers = []
-
-    async def create_session(
-        self,
-        other_agent: str,
-        initial_message: str
-    ) -> str:
-        """创建对话会话"""
-        response = await self._post("/api/a2a/sessions", {
-            "participants": [self.agent_id, other_agent],
-            "initial_message": initial_message
-        })
-
-        session_id = response["session_id"]
-
-        # 自动连接WebSocket
-        await self._connect_websocket(session_id)
-
-        return session_id
-
-    async def _connect_websocket(self, session_id: str):
-        """连接WebSocket接收消息"""
-        ws_url = f"{self.ws_url}/api/a2a/sessions/{session_id}/stream"
-        self.ws = await websockets.connect(
-            ws_url,
-            extra_headers={"Authorization": f"Bearer {self.api_key}"}
-        )
-
-        # 启动消息接收循环
-        asyncio.create_task(self._receive_messages())
-
-    async def _receive_messages(self):
-        """接收WebSocket消息"""
-        async for message in self.ws:
-            data = json.loads(message)
-            if data["type"] == "message":
-                # 调用注册的消息处理器
-                for handler in self.message_handlers:
-                    await handler(data)
-
-    async def send_message(self, session_id: str, content: str):
-        """发送消息"""
-        if self.ws:
-            # 通过WebSocket发送(实时)
-            await self.ws.send(json.dumps({
-                "type": "message",
-                "content": content
-            }))
-        else:
-            # 通过HTTP发送(备用)
-            await self._post(f"/api/a2a/sessions/{session_id}/messages", {
-                "from_agent": self.agent_id,
-                "content": content
-            })
-
-    def on_message(self, handler):
-        """注册消息处理器"""
-        self.message_handlers.append(handler)
-
-    async def close_session(self, session_id: str):
-        """关闭对话"""
-        await self._post(f"/api/a2a/sessions/{session_id}/close", {})
-        if self.ws:
-            await self.ws.close()
-```
-
-#### 使用示例
-
-```python
-# 云端Agent使用
-client = A2ASessionClient(
-    base_url="https://org.agent.cloud",
-    agent_id="cloud-agent-123",
-    api_key="ak_xxx"
-)
-
-# 创建对话
-session_id = await client.create_session(
-    other_agent="terminal-agent-456",
-    initial_message="请分析本地项目"
-)
-
-# 注册消息处理器
-@client.on_message
-async def handle_message(message):
-    print(f"收到消息: {message['content']}")
-
-    # 根据消息内容决定如何回复
-    if "哪个模块" in message['content']:
-        await client.send_message(session_id, "重点分析core模块")
-    elif "需要我详细说明吗" in message['content']:
-        await client.send_message(session_id, "是的,请详细说明")
-
-# 等待对话完成
-await asyncio.sleep(60)  # 或其他结束条件
-
-# 关闭对话
-await client.close_session(session_id)
-```
-
-#### 优势
-
-1. **复用Trace机制** - 所有消息管理、压缩、存储都复用
-2. **完整历史** - 对话历史自动保存在Trace中
-3. **实时通信** - WebSocket保证低延迟
-4. **状态追踪** - 利用Trace的状态管理
-5. **可回溯** - 可以查看完整的对话历史
-
-#### 劣势
-
-1. **Trace概念泄露** - 外部需要理解session_id和trace_id的关系
-2. **复杂度** - 需要管理WebSocket连接
-
-### 方案2:独立的对话管理器
-
-#### 核心思想
-
-**创建独立的对话管理系统,不依赖Trace**
-
-```python
-class Conversation:
-    """独立的对话对象"""
-    conversation_id: str
-    participants: List[str]
-    messages: List[ConversationMessage]
-    status: str  # active, waiting, completed
-    created_at: datetime
-
-class ConversationMessage:
-    """对话消息"""
-    message_id: str
-    from_agent: str
-    to_agent: Optional[str]  # None表示广播
-    content: str
-    timestamp: datetime
-    metadata: Dict
-```
-
-#### 优势
-
-1. **概念清晰** - 对话就是对话,不混淆Trace
-2. **轻量级** - 不需要Trace的重量级机制
-3. **灵活** - 可以自定义对话逻辑
-
-#### 劣势
-
-1. **重复实现** - 需要重新实现消息管理、存储、压缩
-2. **不一致** - 与现有Trace机制不一致
-3. **维护成本** - 需要维护两套系统
-
-### 方案3:混合模式(推荐)
-
-#### 核心思想
-
-**对话层(Session)+ 执行层(Trace)分离**
-
-```
-对话层(Session)
-    - 管理对话状态
-    - 路由消息
-    - WebSocket连接
-    |
-    | 每条消息触发
-    ↓
-执行层(Trace)
-    - 执行具体任务
-    - 调用工具
-    - 管理上下文
-```
-
-#### 架构
-
-```python
-class A2ASession:
-    """对话会话(轻量级)"""
-    session_id: str
-    participants: List[str]
-    current_speaker: str
-    waiting_for: Optional[str]
-    context: Dict  # 共享上下文
-    message_queue: List[Message]
-
-    async def send_message(self, from_agent: str, content: str):
-        """发送消息"""
-        # 1. 添加到消息队列
-        self.message_queue.append(Message(from_agent, content))
-
-        # 2. 如果需要执行(不是简单问答),创建Trace
-        if self._needs_execution(content):
-            trace_id = await self._create_execution_trace(content)
-            # 执行完成后,结果自动添加到消息队列
-        else:
-            # 简单消息,直接转发
-            await self._forward_message(content, to=self._get_other_agent(from_agent))
-
-    def _needs_execution(self, content: str) -> bool:
-        """判断是否需要创建Trace执行"""
-        # 例如:包含工具调用、复杂任务等
-        return "分析" in content or "执行" in content or "查询" in content
-```
-
-#### 优势
-
-1. **分层清晰** - 对话管理和任务执行分离
-2. **灵活** - 简单消息不需要Trace,复杂任务才创建
-3. **高效** - 避免为每条消息创建Trace
-4. **复用** - 复杂任务仍然复用Trace机制
-
-#### 实现示例
-
-```python
-@app.post("/api/a2a/sessions/{session_id}/messages")
-async def send_message(session_id: str, request: SendMessageRequest):
-    session = sessions[session_id]
-
-    # 1. 判断消息类型
-    if request.requires_execution:
-        # 需要执行的任务 → 创建Trace
-        trace_id = await create_execution_trace(
-            task=request.content,
-            parent_session=session_id,
-            agent_id=request.from_agent
-        )
-
-        # 执行完成后,结果自动推送到Session
-        result = await runner.run_result(
-            messages=[{"role": "user", "content": request.content}],
-            config=RunConfig(trace_id=trace_id)
-        )
-
-        # 将结果作为消息发送给对方
-        await session.send_message(
-            from_agent=request.from_agent,
-            content=result["summary"]
-        )
-    else:
-        # 简单消息 → 直接转发
-        await session.send_message(
-            from_agent=request.from_agent,
-            content=request.content
-        )
-
-    return {"status": "sent"}
-```
-
-## 关键设计决策
-
-### 1. 消息类型分类
-
-| 类型 | 示例 | 处理方式 |
-|------|------|----------|
-| **简单问答** | "你好"、"收到"、"明白了" | 直接转发,不创建Trace |
-| **信息查询** | "当前进度如何?" | 查询Session状态,返回 |
-| **任务请求** | "分析core模块" | 创建Trace执行 |
-| **工具调用** | "读取文件X" | 创建Trace执行 |
-
-### 2. 上下文管理
-
-**Session级上下文(轻量):**
-```python
-session.context = {
-    "current_topic": "项目分析",
-    "focus_module": "core",
-    "previous_results": {...}
-}
-```
-
-**Trace级上下文(完整):**
-- 完整的消息历史
-- 工具调用记录
-- Goal树
-
-### 3. 生命周期管理
-
-```python
-# Session生命周期
-created → active → waiting → active → ... → completed/timeout
-
-# Trace生命周期(每个任务)
-created → running → completed
-```
-
-### 4. 超时和重连
-
-```python
-class A2ASession:
-    timeout: int = 300  # 5分钟无活动则超时
-    last_activity: datetime
-
-    async def check_timeout(self):
-        if datetime.now() - self.last_activity > timedelta(seconds=self.timeout):
-            await self.close(reason="timeout")
-
-    async def reconnect(self, agent_id: str, ws: WebSocket):
-        """Agent重连"""
-        self.ws_connections[agent_id] = ws
-        # 发送未读消息
-        await self._send_unread_messages(agent_id)
-```
-
-## 实现路线图
-
-### Phase 1:基础对话能力(2-3周)
-
-1. **Session管理**
-   - 创建/关闭Session
-   - 消息路由
-   - WebSocket连接管理
-
-2. **简单消息转发**
-   - 不涉及Trace
-   - 纯消息传递
-
-3. **客户端SDK**
-   - `A2ASessionClient`
-   - 消息处理器
-
-### Phase 2:集成Trace执行(2-3周)
-
-1. **任务识别**
-   - 判断消息是否需要执行
-   - 自动创建Trace
-
-2. **结果集成**
-   - Trace结果转换为消息
-   - 自动推送给对方
-
-3. **上下文共享**
-   - Session上下文传递给Trace
-   - Trace结果更新Session上下文
-
-### Phase 3:高级功能(3-4周)
-
-1. **多方对话**
-   - 支持3个以上Agent
-   - 群聊模式
-
-2. **对话分支**
-   - 子对话
-   - 并行对话
-
-3. **持久化和恢复**
-   - Session持久化
-   - 断线重连
-
-## 示例场景
-
-### 场景:云端助理与终端Agent的持续对话
-
-```python
-# 云端助理
-client = A2ASessionClient("https://cloud", "cloud-agent", "ak_xxx")
-
-# 1. 创建对话
-session_id = await client.create_session(
-    other_agent="terminal-agent-456",
-    initial_message="请分析本地项目"
-)
-
-# 2. 注册消息处理器(自动响应)
-@client.on_message
-async def handle_message(msg):
-    content = msg['content']
-
-    if "哪个模块" in content:
-        # 简单回复,不需要执行
-        await client.send_message(session_id, "重点分析core模块")
-
-    elif "详细说明" in content:
-        # 需要进一步分析,触发执行
-        await client.send_message(
-            session_id,
-            "是的,请详细说明架构设计和关键组件",
-            requires_execution=True  # 标记需要执行
-        )
-
-# 3. 等待对话完成
-await client.wait_for_completion(session_id)
-```
-
-```python
-# 终端Agent
-client = A2ASessionClient("https://terminal", "terminal-agent-456", "ak_yyy")
-
-# 1. 监听新对话
-@client.on_new_session
-async def handle_new_session(session_id, initial_message):
-    # 分析项目
-    modules = await analyze_project()
-
-    # 询问用户
-    await client.send_message(
-        session_id,
-        f"我看到有{len(modules)}个模块:{', '.join(modules)},你想重点分析哪个?"
-    )
-
-# 2. 处理后续消息
-@client.on_message
-async def handle_message(msg):
-    if "core模块" in msg['content']:
-        # 执行分析
-        result = await analyze_module("core")
-
-        # 返回结果并询问
-        await client.send_message(
-            msg['session_id'],
-            f"core模块使用了{result['architecture']}架构,需要我详细说明吗?"
-        )
-
-    elif "详细说明" in msg['content']:
-        # 深度分析
-        details = await deep_analyze("core")
-        await client.send_message(
-            msg['session_id'],
-            f"详细架构:\n{details}"
-        )
-```
-
-## 总结
-
-### 推荐方案:混合模式
-
-**对话层(Session):**
-- 轻量级消息路由
-- WebSocket连接管理
-- 简单问答直接转发
-
-**执行层(Trace):**
-- 复杂任务创建Trace
-- 复用所有现有能力
-- 结果自动集成到对话
-
-### 关键优势
-
-1. **灵活** - 简单消息不需要Trace开销
-2. **强大** - 复杂任务复用Trace能力
-3. **清晰** - 对话和执行分层
-4. **高效** - 避免不必要的资源消耗
-
-### 实现优先级
-
-1. **Phase 1** - 基础Session + 简单消息(MVP)
-2. **Phase 2** - 集成Trace执行(核心能力)
-3. **Phase 3** - 高级功能(按需)
-

+ 0 - 640
docs/research/a2a-cross-device.md

@@ -1,640 +0,0 @@
-# Agent2Agent 跨设备通信方案
-
-**更新日期:** 2026-03-03
-
-## 场景分类
-
-### 场景1:云端Agent ↔ 云端Agent
-**示例:** 通用助理 → 爬虫运维Agent
-- **部署:** 同一服务器/进程
-- **通信:** 现有`agent`工具(内存调用)
-- **不需要HTTP接口**
-
-### 场景2:云端Agent ↔ 终端Agent ⭐
-**示例:**
-- 云端通用助理 → 用户笔记本上的代码分析Agent
-- 用户终端Agent → 云端知识库Agent
-
-**需求:**
-- 云端Agent需要调用终端Agent的能力
-  - 访问用户本地文件
-  - 执行本地命令
-  - 使用本地工具(IDE、浏览器等)
-- 终端Agent需要调用云端Agent
-  - 访问组织知识库
-  - 查询共享资源
-  - 协作任务
-
-**挑战:**
-- 网络连接(终端可能在NAT后)
-- 认证和授权
-- 数据安全
-
-**需要HTTP接口!**
-
-### 场景3:终端Agent ↔ 终端Agent
-**示例:** 团队成员的Agent互相协作
-- **可能性:** 较小,但可能存在
-- **通信:** 通过云端中转或P2P
-
-## 架构方案
-
-### 方案A:基于现有API封装(推荐)
-
-#### 架构图
-```
-云端Agent                    终端Agent
-    |                            |
-    | HTTP POST /api/a2a/call    |
-    |--------------------------->|
-    |                            |
-    |    创建Trace + 执行任务     |
-    |                            |
-    | WebSocket /api/a2a/watch   |
-    |<---------------------------|
-    |    实时进度推送              |
-    |                            |
-    | HTTP GET /api/a2a/result   |
-    |--------------------------->|
-    |    返回最终结果              |
-    |<---------------------------|
-```
-
-#### 核心设计
-
-**1. 简化的A2A端点**
-
-```python
-# agent/api/a2a.py
-
-@app.post("/api/a2a/call")
-async def a2a_call(request: A2ACallRequest):
-    """
-    简化的Agent调用接口
-
-    请求:
-    {
-        "task": "分析这个项目的架构",
-        "agent_type": "explore",  # 可选
-        "context": {              # 可选
-            "files": [...],
-            "previous_results": {...}
-        },
-        "callback_url": "https://..."  # 可选,完成后回调
-    }
-
-    响应:
-    {
-        "call_id": "a2a-xxx",
-        "status": "started",
-        "watch_url": "ws://host/api/a2a/watch/a2a-xxx"
-    }
-    """
-    # 1. 认证和授权检查
-    # 2. 转换为内部格式
-    messages = [{"role": "user", "content": request.task}]
-    if request.context:
-        messages[0]["content"] += f"\n\n上下文:{json.dumps(request.context)}"
-
-    # 3. 调用现有runner(复用所有逻辑)
-    config = RunConfig(
-        agent_type=request.agent_type or "default",
-        trace_id=None  # 新建
-    )
-
-    # 4. 后台执行
-    task_id = await start_background_task(runner.run(messages, config))
-
-    # 5. 返回call_id(映射到trace_id)
-    return {
-        "call_id": f"a2a-{task_id}",
-        "status": "started",
-        "watch_url": f"ws://{host}/api/a2a/watch/{task_id}"
-    }
-
-
-@app.websocket("/api/a2a/watch/{call_id}")
-async def a2a_watch(websocket: WebSocket, call_id: str):
-    """
-    实时监听执行进度(复用现有WebSocket)
-
-    推送消息:
-    {
-        "type": "progress",
-        "data": {
-            "goal": "正在分析文件结构",
-            "progress": 0.3
-        }
-    }
-
-    {
-        "type": "completed",
-        "data": {
-            "result": "...",
-            "stats": {...}
-        }
-    }
-    """
-    # 复用现有的 /api/traces/{id}/watch 逻辑
-    trace_id = call_id.replace("a2a-", "")
-    await watch_trace(websocket, trace_id)
-
-
-@app.get("/api/a2a/result/{call_id}")
-async def a2a_result(call_id: str):
-    """
-    获取执行结果
-
-    响应:
-    {
-        "status": "completed",
-        "result": {
-            "summary": "...",
-            "details": {...}
-        },
-        "stats": {
-            "duration_ms": 5000,
-            "tokens": 1500,
-            "cost": 0.05
-        }
-    }
-    """
-    trace_id = call_id.replace("a2a-", "")
-    trace = await store.get_trace(trace_id)
-    messages = await store.get_main_path_messages(trace_id, trace.head_sequence)
-
-    # 提取最后的assistant消息作为结果
-    result = extract_final_result(messages)
-
-    return {
-        "status": trace.status,
-        "result": result,
-        "stats": {
-            "duration_ms": trace.total_duration_ms,
-            "tokens": trace.total_tokens,
-            "cost": trace.total_cost
-        }
-    }
-```
-
-**2. 客户端SDK(终端Agent使用)**
-
-```python
-# agent/client/a2a_client.py
-
-class A2AClient:
-    """A2A客户端,用于调用远程Agent"""
-
-    def __init__(self, base_url: str, api_key: str):
-        self.base_url = base_url
-        self.api_key = api_key
-
-    async def call(
-        self,
-        task: str,
-        agent_type: Optional[str] = None,
-        context: Optional[dict] = None,
-        wait: bool = True
-    ) -> Dict[str, Any]:
-        """
-        调用远程Agent
-
-        Args:
-            task: 任务描述
-            agent_type: Agent类型
-            context: 上下文信息
-            wait: 是否等待完成(False则立即返回call_id)
-        """
-        # 1. 发起调用
-        response = await self._post("/api/a2a/call", {
-            "task": task,
-            "agent_type": agent_type,
-            "context": context
-        })
-
-        call_id = response["call_id"]
-
-        if not wait:
-            return {"call_id": call_id, "status": "started"}
-
-        # 2. 等待完成(通过WebSocket或轮询)
-        result = await self._wait_for_completion(call_id)
-        return result
-
-    async def _wait_for_completion(self, call_id: str):
-        """通过WebSocket监听完成"""
-        async with websockets.connect(
-            f"{self.ws_url}/api/a2a/watch/{call_id}",
-            extra_headers={"Authorization": f"Bearer {self.api_key}"}
-        ) as ws:
-            async for message in ws:
-                data = json.loads(message)
-                if data["type"] == "completed":
-                    return data["data"]
-                elif data["type"] == "failed":
-                    raise A2AError(data["data"]["error"])
-
-    async def get_result(self, call_id: str) -> Dict[str, Any]:
-        """获取执行结果(轮询方式)"""
-        return await self._get(f"/api/a2a/result/{call_id}")
-```
-
-**3. 作为工具集成到Agent**
-
-```python
-# agent/tools/builtin/remote_agent.py
-
-@tool(description="调用远程Agent执行任务")
-async def remote_agent(
-    task: str,
-    agent_url: str,
-    agent_type: Optional[str] = None,
-    context: Optional[dict] = None,
-    ctx: ToolContext = None
-) -> ToolResult:
-    """
-    调用远程Agent(云端或其他终端)
-
-    Args:
-        task: 任务描述
-        agent_url: 远程Agent的URL
-        agent_type: Agent类型
-        context: 上下文信息
-    """
-    # 1. 创建客户端
-    client = A2AClient(
-        base_url=agent_url,
-        api_key=ctx.config.get("remote_agent_api_key")
-    )
-
-    # 2. 调用远程Agent
-    result = await client.call(
-        task=task,
-        agent_type=agent_type,
-        context=context,
-        wait=True
-    )
-
-    # 3. 返回结果
-    return ToolResult(
-        title=f"远程Agent完成: {task[:50]}",
-        output=result["result"]["summary"],
-        long_term_memory=f"调用远程Agent完成任务,耗时{result['stats']['duration_ms']}ms"
-    )
-```
-
-#### 优势
-
-1. **复用现有逻辑** - 所有Trace、Message、Goal管理都复用
-2. **简单易用** - 外部只需要提供task,不需要理解Trace概念
-3. **完整功能** - 继承所有现有能力(压缩、续跑、回溯等)
-4. **渐进式** - 可以先实现基础版本,逐步增强
-
-### 方案B:实现标准A2A协议
-
-#### 架构
-
-```python
-# agent/api/a2a_standard.py
-
-@app.post("/api/a2a/v1/tasks")
-async def create_task(request: A2ATaskRequest):
-    """
-    符合Google A2A协议的端点
-
-    请求格式(A2A标准):
-    {
-        "header": {
-            "message_id": "msg_001",
-            "timestamp": "2026-03-03T10:30:00Z"
-        },
-        "task": {
-            "description": "分析项目架构",
-            "capabilities_required": ["file_read", "code_analysis"]
-        },
-        "context": {...}
-    }
-    """
-    # 转换A2A格式到内部格式
-    # 调用runner
-    # 转换结果为A2A格式
-```
-
-#### 优势
-
-1. **标准化** - 符合行业标准
-2. **互操作性** - 可以与其他A2A兼容的Agent通信
-3. **未来兼容** - 跟随行业发展
-
-#### 劣势
-
-1. **复杂度高** - 需要实现完整的A2A协议
-2. **过度设计** - MVP阶段可能不需要
-3. **标准未稳定** - A2A协议还在演进中
-
-## 网络拓扑
-
-### 拓扑1:云端中心化
-
-```
-        云端Gateway
-            |
-    +-------+-------+
-    |       |       |
-  通用    爬虫    成本
-  助理    运维    统计
-    |
-    +-- 调用终端Agent(HTTP)
-            |
-        用户终端Agent
-```
-
-**特点:**
-- 云端Agent作为中心
-- 终端Agent需要暴露HTTP端点
-- 需要处理NAT穿透
-
-### 拓扑2:终端主动连接
-
-```
-用户终端Agent
-    |
-    | WebSocket长连接
-    |
-云端Gateway
-    |
-    +-- 通过连接推送任务
-```
-
-**特点:**
-- 终端Agent主动连接云端
-- 云端通过WebSocket推送任务
-- 无需NAT穿透
-- 类似飞书Bot的模式
-
-### 拓扑3:混合模式(推荐)
-
-```
-云端Agent <--HTTP--> 云端Agent(内存调用)
-    |
-    | WebSocket双向
-    |
-终端Agent <--HTTP--> 终端Agent(如果需要)
-```
-
-**特点:**
-- 云端Agent间用内存调用
-- 云端↔终端用WebSocket
-- 终端间可选HTTP(通过云端中转)
-
-## 认证和授权
-
-### 1. API Key认证
-
-```python
-# 终端Agent启动时注册
-POST /api/a2a/register
-{
-    "agent_id": "user123-laptop",
-    "capabilities": ["file_read", "bash", "browser"],
-    "device_info": {...}
-}
-
-# 返回API Key
-{
-    "api_key": "ak_xxx",
-    "agent_id": "user123-laptop"
-}
-
-# 后续调用携带API Key
-Authorization: Bearer ak_xxx
-```
-
-### 2. 权限控制
-
-```yaml
-# config/a2a_permissions.yaml
-agents:
-  user123-laptop:
-    can_access:
-      - conversations/user123/*
-      - resources/public/*
-    cannot_access:
-      - conversations/other_users/*
-      - agents/*/memory/*
-```
-
-### 3. 数据隔离
-
-- 终端Agent只能访问自己用户的数据
-- 云端Agent可以访问组织共享数据
-- 通过Gateway强制执行
-
-## 实现路线图
-
-### Phase 1:基础A2A接口(MVP)
-
-**目标:** 云端Agent ↔ 终端Agent基础通信
-
-**实现:**
-1. `/api/a2a/call` - 简化调用接口
-2. `/api/a2a/watch` - WebSocket监听
-3. `/api/a2a/result` - 获取结果
-4. `A2AClient` - 客户端SDK
-5. `remote_agent` - 工具集成
-
-**时间:** 1-2周
-
-### Phase 2:增强功能
-
-**目标:** 完善A2A能力
-
-**实现:**
-1. 认证和授权
-2. 数据隔离
-3. 成本控制
-4. 审计日志
-5. 错误处理和重试
-
-**时间:** 2-3周
-
-### Phase 3:标准化(可选)
-
-**目标:** 兼容A2A标准协议
-
-**实现:**
-1. 实现Google A2A协议
-2. 能力协商机制
-3. 与其他A2A Agent互操作
-
-**时间:** 3-4周
-
-## 示例场景
-
-### 场景:云端助理调用终端Agent分析代码
-
-**1. 用户在飞书问:** "帮我分析一下我笔记本上的项目架构"
-
-**2. 云端通用助理:**
-```python
-# 识别需要访问用户终端
-result = await remote_agent(
-    task="分析 /Users/sunlit/Code/Agent 的项目架构",
-    agent_url="https://user123-laptop.agent.local",
-    agent_type="explore"
-)
-```
-
-**3. 终端Agent:**
-- 接收任务
-- 创建本地Trace
-- 使用本地工具(read, glob, grep)
-- 分析代码结构
-- 返回结果
-
-**4. 云端助理:**
-- 接收终端Agent结果
-- 整合到回复中
-- 通过飞书返回给用户
-
-### 场景:终端Agent查询云端知识库
-
-**1. 用户在终端运行:**
-```bash
-agent-cli ask "公司的爬虫部署规范是什么?"
-```
-
-**2. 终端Agent:**
-```python
-# 识别需要查询组织知识库
-result = await remote_agent(
-    task="查询爬虫部署规范",
-    agent_url="https://org.agent.cloud",
-    agent_type="knowledge_query"
-)
-```
-
-**3. 云端知识库Agent:**
-- 查询resources/docs/
-- 查询experiences数据库
-- 返回相关文档
-
-**4. 终端Agent:**
-- 接收结果
-- 展示给用户
-
-## 技术细节
-
-### 1. NAT穿透方案
-
-**方案A:终端主动连接(推荐)**
-```python
-# 终端Agent启动时建立WebSocket长连接
-ws = await websockets.connect("wss://org.agent.cloud/api/a2a/connect")
-
-# 云端通过连接推送任务
-await ws.send(json.dumps({
-    "type": "task",
-    "task_id": "xxx",
-    "data": {...}
-}))
-
-# 终端执行并返回结果
-result = await execute_task(task)
-await ws.send(json.dumps({
-    "type": "result",
-    "task_id": "xxx",
-    "data": result
-}))
-```
-
-**方案B:使用ngrok等隧道服务**
-- 终端Agent启动时创建隧道
-- 注册公网URL到云端
-- 云端通过公网URL调用
-
-### 2. 消息序列化
-
-```python
-# 简化格式(内部使用)
-{
-    "task": "string",
-    "context": {...}
-}
-
-# 标准A2A格式(外部互操作)
-{
-    "header": {...},
-    "task": {...},
-    "capabilities": [...]
-}
-
-# 自动转换
-def to_a2a_format(internal_msg):
-    return {
-        "header": generate_header(),
-        "task": {"description": internal_msg["task"]},
-        "context": internal_msg.get("context", {})
-    }
-```
-
-### 3. 流式响应
-
-```python
-# 支持流式返回中间结果
-@app.websocket("/api/a2a/stream/{call_id}")
-async def a2a_stream(websocket: WebSocket, call_id: str):
-    async for event in runner.run(...):
-        if isinstance(event, Message):
-            await websocket.send_json({
-                "type": "message",
-                "data": event.to_dict()
-            })
-```
-
-## 安全考虑
-
-1. **认证:** API Key + JWT
-2. **授权:** 基于角色的访问控制
-3. **加密:** HTTPS/WSS强制
-4. **限流:** 防止滥用
-5. **审计:** 所有A2A调用记录
-6. **隔离:** 数据访问严格隔离
-
-## 成本控制
-
-```python
-# 每次A2A调用记录成本
-{
-    "call_id": "a2a-xxx",
-    "caller": "user123-laptop",
-    "callee": "org-cloud-agent",
-    "tokens": 1500,
-    "cost": 0.05,
-    "duration_ms": 5000
-}
-
-# 限额检查
-if user_cost_today > user_limit:
-    raise CostLimitExceeded()
-```
-
-## 总结
-
-### 推荐方案
-
-**Phase 1(MVP):** 方案A - 基于现有API封装
-- 简单、快速
-- 复用所有现有逻辑
-- 满足跨设备通信需求
-
-**Phase 3+:** 可选实现标准A2A协议
-- 如果需要与外部系统互操作
-- 跟随行业标准发展
-
-### 关键优势
-
-1. **复用现有能力** - Trace、Message、Goal、压缩等
-2. **渐进式实现** - 先简单后复杂
-3. **灵活扩展** - 可以逐步增强功能
-4. **标准兼容** - 未来可以支持A2A标准

+ 0 - 504
docs/research/a2a-mamp-protocol.md

@@ -1,504 +0,0 @@
-# MAMP:Minimal Agent Message Protocol
-
-**更新日期:** 2026-03-04
-
-## 设计目标
-
-实现与**其他 Agent 系统**(非本系统)的通用交互接口,保持最简化原则。
-
-**与现有方案的关系**:
-- [A2A 跨设备通信](./a2a-cross-device.md):内部 Agent 间通信(基于 Trace API)
-- **MAMP 协议**(本文档):与外部 Agent 系统的通用交互
-
----
-
-## 核心设计原则
-
-1. **最小化协议**:只定义消息信封,不管内容格式
-2. **适配器模式**:通过适配器层与内部系统集成
-3. **松耦合**:各家 Agent 保持独立实现
-4. **渐进式**:先实现基础功能,需要时再扩展
-
----
-
-## 消息格式
-
-### 基础消息结构
-
-```json
-{
-  "protocol": "mamp/1.0",
-  "message_id": "msg-uuid-123",
-  "conversation_id": "conv-uuid-456",
-  "from": "agent://your-domain.com/agent-123",
-  "to": "agent://other-domain.com/agent-456",
-  "content": [...],
-  "metadata": {
-    "timestamp": "2026-03-04T10:00:00Z"
-  }
-}
-```
-
-### 字段说明
-
-| 字段 | 类型 | 必需 | 说明 |
-|------|------|------|------|
-| `protocol` | string | 是 | 协议版本标识 |
-| `message_id` | string | 是 | 消息唯一标识 |
-| `conversation_id` | string | 否 | 对话标识(不提供则新建对话) |
-| `from` | string | 是 | 发送方 Agent URI |
-| `to` | string | 是 | 接收方 Agent URI |
-| `content` | string/array | 是 | 消息内容(支持多模态) |
-| `metadata` | object | 是 | 元数据(时间戳等) |
-
-### 新建 vs 续跑
-
-**规则**:通过 `conversation_id` 字段判断
-
-- **无 `conversation_id`**(null 或不存在)→ 新建对话,接收方生成并返回 conversation_id
-- **有 `conversation_id`** → 续跑对话,接收方查找对应的内部 trace_id
-
-**conversation_id 与 trace_id 的关系**:
-- `conversation_id`:跨 Agent 的对话标识符,双方共享
-- `trace_id`:每个 Agent 内部的执行记录,各自独立
-- 每个 Agent 维护 `conversation_id → trace_id` 映射
-
----
-
-## 多模态内容格式
-
-### Content 结构
-
-参考 Anthropic SDK 和现有多模态实现(`agent/docs/multimodal.md`):
-
-```json
-{
-  "content": [
-    {
-      "type": "text",
-      "text": "这是文本内容"
-    },
-    {
-      "type": "image",
-      "source": {
-        "type": "url",
-        "url": "https://...",
-        "media_type": "image/png"
-      }
-    },
-    {
-      "type": "image",
-      "source": {
-        "type": "base64",
-        "media_type": "image/jpeg",
-        "data": "base64..."
-      }
-    },
-    {
-      "type": "code",
-      "language": "python",
-      "code": "def hello(): pass"
-    },
-    {
-      "type": "file",
-      "name": "report.pdf",
-      "mime_type": "application/pdf",
-      "source": {
-        "type": "url",
-        "url": "https://..."
-      }
-    }
-  ]
-}
-```
-
-### 纯文本简写
-
-```json
-{
-  "content": "纯文本消息"
-}
-```
-
-等价于:
-
-```json
-{
-  "content": [{"type": "text", "text": "纯文本消息"}]
-}
-```
-
----
-
-## Agent Card(身份与能力)
-
-每个 Agent 提供静态的 card 端点,用于身份识别和能力发现。
-
-### 端点
-
-```
-GET https://your-agent.com/mamp/v1/card
-```
-
-### 响应格式
-
-```json
-{
-  "protocol": "mamp/1.0",
-  "agent_id": "agent://your-domain.com/agent-123",
-  "name": "Code Analyst",
-  "description": "专注于代码分析的 Agent",
-
-  "owner": {
-    "user_id": "user-789",
-    "user_name": "张三",
-    "organization": "YourCompany"
-  },
-
-  "device": {
-    "device_id": "device-mac-001",
-    "device_name": "MacBook Pro",
-    "location": "Beijing Office",
-    "platform": "darwin"
-  },
-
-  "capabilities": {
-    "content_types": ["text", "image", "code"],
-    "max_message_size": 10485760,
-    "streaming": true,
-    "async": true,
-    "tools": ["code_analysis", "file_read", "web_search"]
-  },
-
-  "access": {
-    "public": false,
-    "allowed_agents": ["agent://trusted.com/*"],
-    "require_auth": true
-  }
-}
-```
-
----
-
-## 传输层
-
-### HTTP REST(最简实现)
-
-**发送消息**:
-
-```http
-POST https://other-agent.com/mamp/v1/messages
-Content-Type: application/json
-Authorization: Bearer {api_key}
-
-{MAMP 消息体}
-```
-
-**响应**:
-
-```json
-{
-  "conversation_id": "conv-abc-123",
-  "message_id": "msg-xyz-456",
-  "status": "received"
-}
-```
-
-**错误响应**:
-
-```json
-{
-  "error": "conversation_not_found",
-  "message": "Conversation conv-xxx not found",
-  "status_code": 404
-}
-```
-
-### 可选扩展
-
-- **WebSocket**:实时双向通信
-- **Server-Sent Events**:流式响应
-- **Message Queue**:异步消息(NATS/Redis)
-
----
-
-## 寻址方案
-
-使用 URI 格式:`agent://domain/agent-id`
-
-**示例**:
-- `agent://your-domain.com/trace-123` - 你的 Agent
-- `agent://claude.ai/session-456` - Claude
-- `agent://openai.com/assistant-789` - OpenAI Assistant
-
-每个 Agent 系统自己决定如何解析 `agent-id` 部分。
-
----
-
-## 系统集成
-
-### 三层架构
-
-```
-┌─────────────────────────────────────────────────┐
-│ Layer 3: 内部 Agent 逻辑                         │
-│ (Trace, Goal, Messages...)                      │
-└─────────────────────────────────────────────────┘
-                    ↕
-┌─────────────────────────────────────────────────┐
-│ Layer 2: MAMP 适配器                             │
-│ - 内部格式 ↔ MAMP 格式转换                        │
-│ - conversation_id ↔ trace_id 映射                │
-└─────────────────────────────────────────────────┘
-                    ↕
-┌─────────────────────────────────────────────────┐
-│ Layer 1: 传输层(HTTP/WebSocket/MQ)             │
-└─────────────────────────────────────────────────┘
-```
-
-### 接收端实现
-
-**实现位置**:`agent/trace/mamp_api.py`
-
-```python
-@app.post("/mamp/v1/messages")
-async def receive_mamp_message(msg: dict):
-    """接收外部 Agent 的 MAMP 消息"""
-
-    conv_id = msg.get("conversation_id")
-
-    if not conv_id:
-        # 新建对话
-        conv_id = f"conv-{generate_uuid()}"
-
-        # 创建新 Trace
-        async for item in runner.run(
-            messages=[{"role": "user", "content": msg["content"]}],
-            config=RunConfig(
-                context={
-                    "mamp_conversation_id": conv_id,
-                    "mamp_from": msg["from"]
-                }
-            )
-        ):
-            if isinstance(item, Trace):
-                await store_conversation_mapping(conv_id, item.trace_id)
-
-        return {
-            "conversation_id": conv_id,
-            "message_id": msg["message_id"],
-            "status": "received"
-        }
-
-    else:
-        # 续跑对话
-        trace_id = await get_trace_by_conversation_id(conv_id)
-        if not trace_id:
-            raise HTTPException(404, f"Conversation {conv_id} not found")
-
-        await runner.run(
-            messages=[{"role": "user", "content": msg["content"]}],
-            config=RunConfig(trace_id=trace_id)
-        )
-
-        return {
-            "conversation_id": conv_id,
-            "message_id": msg["message_id"],
-            "status": "received"
-        }
-```
-
-### 发送端实现
-
-**实现位置**:`agent/tools/builtin/mamp_adapter.py`
-
-```python
-@tool(description="与外部 Agent 通信")
-async def send_to_agent(
-    target_agent: str,
-    message: str,
-    conversation_id: Optional[str] = None,
-    ctx: ToolContext = None
-) -> ToolResult:
-    """
-    发送消息到外部 Agent
-
-    Args:
-        target_agent: 目标 Agent URI (agent://domain/id)
-        message: 消息内容
-        conversation_id: 对话 ID(可选,不提供则新建)
-    """
-
-    # 构建 MAMP 消息
-    mamp_msg = {
-        "protocol": "mamp/1.0",
-        "message_id": generate_uuid(),
-        "from": f"agent://{config.domain}/{ctx.trace_id}",
-        "to": target_agent,
-        "content": message,
-        "metadata": {"timestamp": datetime.now().isoformat()}
-    }
-
-    if conversation_id:
-        mamp_msg["conversation_id"] = conversation_id
-
-    # 发送
-    agent_url = parse_agent_url(target_agent)
-    response = await http_post(f"{agent_url}/mamp/v1/messages", mamp_msg)
-
-    # 新建时存储映射
-    if not conversation_id:
-        await store_conversation_mapping(
-            response["conversation_id"],
-            ctx.trace_id
-        )
-
-    return ToolResult(
-        title=f"已发送到 {target_agent}",
-        output=f"Conversation ID: {response['conversation_id']}",
-        long_term_memory=f"与 {target_agent} 的对话 {response['conversation_id']}"
-    )
-```
-
-### conversation_id 映射存储
-
-**实现位置**:`agent/trace/conversation_store.py`
-
-```python
-class ConversationStore:
-    """管理 MAMP conversation_id 和内部 trace_id 的映射"""
-
-    def __init__(self, base_dir: str = ".trace"):
-        self.mapping_file = Path(base_dir) / "mamp_conversations.json"
-
-    async def store_mapping(self, conversation_id: str, trace_id: str):
-        """存储映射关系"""
-        mappings = await self._load_mappings()
-        mappings[conversation_id] = {
-            "trace_id": trace_id,
-            "created_at": datetime.now().isoformat(),
-            "last_message_at": datetime.now().isoformat()
-        }
-        await self._save_mappings(mappings)
-
-    async def get_trace_id(self, conversation_id: str) -> Optional[str]:
-        """根据 conversation_id 查找 trace_id"""
-        mappings = await self._load_mappings()
-        mapping = mappings.get(conversation_id)
-        return mapping["trace_id"] if mapping else None
-```
-
----
-
-## 使用示例
-
-### 新建对话
-
-```python
-# 调用外部 Agent
-result = await send_to_agent(
-    target_agent="agent://other.com/code-analyst",
-    message="帮我分析这段代码的性能"
-)
-# 返回: {"conversation_id": "conv-abc-123", ...}
-```
-
-### 续跑对话
-
-```python
-# 继续之前的对话
-result = await send_to_agent(
-    target_agent="agent://other.com/code-analyst",
-    message="那如果用异步方案呢?",
-    conversation_id="conv-abc-123"
-)
-```
-
-### 多模态消息
-
-```python
-# 发送图片
-result = await send_to_agent(
-    target_agent="agent://other.com/image-analyst",
-    message={
-        "content": [
-            {"type": "text", "text": "分析这张图片"},
-            {
-                "type": "image",
-                "source": {
-                    "type": "base64",
-                    "media_type": "image/png",
-                    "data": encode_image_base64("screenshot.png")
-                }
-            }
-        ]
-    }
-)
-```
-
----
-
-## 与现有标准的关系
-
-MAMP 可以作为其他标准的"翻译层":
-
-- **MCP (Model Context Protocol)** → 写 MCP ↔ MAMP 适配器
-- **OpenAI Assistant API** → 写 OpenAI ↔ MAMP 适配器
-- **自定义协议** → 写对应的适配器
-
-**核心思想**:不要试图统一所有 Agent 的内部实现,而是提供一个最薄的互操作层。
-
----
-
-## 可选扩展
-
-如果需要更丰富的功能,可以逐步添加:
-
-- **认证**:在 metadata 中加 `auth_token`
-- **流式传输**:使用 Server-Sent Events 或 WebSocket
-- **异步回调**:加 `callback_url` 字段
-- **能力协商**:通过 `/mamp/v1/card` 端点
-- **错误处理**:标准化错误码
-
----
-
-## 实现路线图
-
-### Phase 1:基础协议(1-2 周)
-
-**目标**:实现最简 MAMP 协议
-
-**任务**:
-1. 实现 `/mamp/v1/messages` 端点(接收消息)
-2. 实现 `/mamp/v1/card` 端点(Agent 身份)
-3. 实现 `send_to_agent` 工具(发送消息)
-4. 实现 `ConversationStore`(映射管理)
-5. 支持纯文本消息
-
-### Phase 2:多模态支持(1 周)
-
-**目标**:支持图片、代码等多模态内容
-
-**任务**:
-1. 扩展 content 格式处理
-2. 集成现有多模态实现(`agent/llm/prompts/wrapper.py`)
-3. 支持 base64 和 URL 两种图片传输方式
-
-### Phase 3:增强功能(可选)
-
-**目标**:认证、流式、异步等高级功能
-
-**任务**:
-1. API Key 认证
-2. WebSocket 流式传输
-3. 异步回调机制
-4. 错误处理和重试
-
----
-
-## 相关文档
-
-- [A2A 跨设备通信](./a2a-cross-device.md):内部 Agent 间通信方案
-- [多模态支持](../../agent/docs/multimodal.md):图片、PDF 处理
-- [工具系统](../../agent/docs/tools.md):工具定义、注册
-- [Agent 框架](../README.md):核心 Agent 能力

+ 0 - 114
docs/research/a2a-protocols.md

@@ -1,114 +0,0 @@
-# Agent2Agent (A2A) 通信协议调研
-
-**调研日期:** 2026-03-03
-
-## 一、行业标准协议
-
-### 1. Google A2A Protocol (2025.04)
-- **定位:** Agent间任务协调和协作
-- **特性:** 标准化消息格式、能力协商、异步通信
-- **适用:** 企业级跨平台Agent协作
-
-### 2. Anthropic MCP (2024.11)
-- **定位:** AI助手与工具/数据系统连接
-- **特性:** JSON-RPC 2.0、即插即用工具
-- **适用:** Agent与工具交互(非Agent间通信)
-- **采用:** OpenAI (2025.03)、Google DeepMind
-
-### 3. IBM ACP (2025初)
-- **定位:** 基于HTTP的Agent消息传递
-- **特性:** 消息代理(Kafka/RabbitMQ)、会话跟踪
-- **适用:** 生产级系统的模块化和可追溯性
-
-### 4. Huawei A2A-T (2026.03开源)
-- **定位:** A2A协议的扩展实现
-- **状态:** 刚开源,推动标准应用
-
-## 二、主流框架实现
-
-### AutoGen (Microsoft)
-- **通信模式:** 对话式多Agent协作
-- **核心:** ConversableAgent + GroupChat
-- **消息管理:** 每个Agent维护对话历史,GroupChat维护全局记录
-- **特点:** 自然语言驱动、支持人机协作
-
-### LangGraph (LangChain)
-- **通信模式:** 基于状态图的消息传递
-- **核心:** State Graph + Persistent State + Message Bus
-- **消息管理:** 状态图管理 + 检查点机制
-- **特点:** 生产级、可追溯、原生支持A2A协议
-
-### CrewAI
-- **通信模式:** 基于角色的任务委派
-- **核心:** Role-Based Agents + Task Delegation + Crew Coordination
-- **消息管理:** Crew级任务历史 + 委派记录
-- **特点:** 类似人类团队、层次化任务分配
-
-## 三、通信模式对比
-
-| 模式 | 优点 | 缺点 | 适用场景 |
-|------|------|------|----------|
-| **直接调用** | 简单、低延迟 | 紧耦合、难扩展 | 小规模简单协作 |
-| **消息队列** | 解耦、异步、可靠 | 复杂、需基础设施 | 企业级大规模系统 |
-| **共享状态** | 知识全局可见、紧密协调 | 并发控制、状态冲突 | 高度协同团队 |
-| **混合模式** | 灵活、可优化 | 架构复杂 | 复杂生产系统 |
-
-## 四、消息历史管理策略
-
-1. **滑动窗口:** 保留最近N条消息
-2. **智能截断:** 基于重要性评分删除
-3. **自动总结:** 接近限制时总结历史(Claude Code使用)
-4. **分层存储:** 短期完整 + 长期总结
-5. **溢出修剪:** 从最旧消息开始修剪
-
-## 五、关键挑战
-
-### 1. 消息历史维护
-- 上下文窗口限制
-- 需要智能压缩策略
-- 跨Agent的上下文共享
-
-### 2. 异步通信
-- 事件驱动架构
-- 回调机制
-- 状态更新和轮询
-
-### 3. 多Agent协作复杂性
-- 协调模式(集中式 vs 去中心化)
-- 冲突解决
-- 死锁预防
-- 可观测性
-
-## 六、标准化趋势
-
-**当前状态(2024-2026):**
-- 协议层分化:MCP(工具层)、A2A(协作层)、ACP(传输层)
-- 行业共识形成中:Google、OpenAI、Anthropic、IBM、Huawei推动
-- 互操作性是关键
-
-**未来展望:**
-- 2026-2027:协议标准逐步成熟
-- 2028-2030:可能出现统一标准
-- 长期:Agent网络成为基础设施
-
-## 七、实践建议
-
-### 架构设计
-1. **分层设计:** 工具层(MCP)+ 协作层(A2A)+ 传输层(ACP)
-2. **消息管理:** 自动总结 + 分层存储
-3. **异步处理:** 事件驱动 + 超时重试
-4. **可观测性:** 结构化日志 + 分布式追踪
-
-### 选择建议
-- **小规模:** AutoGen、CrewAI
-- **大规模:** LangGraph + ACP/A2A
-- **工具集成:** 优先MCP
-- **Agent协作:** 优先A2A
-
-## 参考资料
-
-- [Google A2A Protocol](https://a2a-protocol.org/latest/specification/)
-- [Anthropic MCP](https://modelcontextprotocol.io/specification/2025-06-18)
-- [Huawei A2A-T](https://www.huawei.com/en/news/2026/2/mwc-a2at-opensource)
-- [Agent Interoperability Survey](https://arxiv.org/html/2505.02279v1)
-- [Framework Comparison 2026](https://markaicode.com/crewai-vs-autogen-vs-langgraph-2026/)

+ 0 - 484
docs/research/a2a-trace-storage.md

@@ -1,484 +0,0 @@
-# A2A跨设备Trace存储方案
-
-**问题:** 现有Trace存储在本地文件系统,跨设备时如何访问?
-
-## 场景分析
-
-### 场景1:云端Agent调用终端Agent
-
-```
-云端Agent (云端存储)
-    ↓ 调用
-终端Agent (终端存储)
-    ↓ 返回 sub_trace_id
-云端Agent 想 continue_from sub_trace_id
-    ↓ 问题:sub_trace在终端,云端访问不到!
-```
-
-### 场景2:终端Agent调用云端Agent
-
-```
-终端Agent (终端存储)
-    ↓ 调用
-云端Agent (云端存储)
-    ↓ 返回 sub_trace_id
-终端Agent 想 continue_from sub_trace_id
-    ↓ 问题:sub_trace在云端,终端访问不到!
-```
-
-## 方案对比
-
-### 方案1:远程Trace访问(推荐)
-
-#### 核心思想
-
-**Trace ID包含位置信息,通过HTTP API访问远程Trace**
-
-#### Trace ID格式
-
-```
-本地Trace: abc-123
-远程Trace: agent://terminal-agent-456/abc-123
-          ^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^
-          协议      Agent地址          本地ID
-```
-
-#### 实现
-
-```python
-# agent/trace/remote_store.py
-
-class RemoteTraceStore:
-    """远程Trace存储代理"""
-
-    def __init__(self, agent_url: str, api_key: str):
-        self.agent_url = agent_url
-        self.api_key = api_key
-
-    async def get_trace(self, trace_id: str) -> Optional[Trace]:
-        """通过HTTP API获取远程Trace"""
-        response = await self._get(f"/api/traces/{trace_id}")
-        if response:
-            return Trace(**response)
-        return None
-
-    async def get_main_path_messages(
-        self, trace_id: str, head_sequence: int
-    ) -> List[Message]:
-        """获取远程Trace的消息"""
-        response = await self._get(
-            f"/api/traces/{trace_id}/messages",
-            params={"mode": "main_path", "head_sequence": head_sequence}
-        )
-        return [Message(**m) for m in response["messages"]]
-
-    async def add_message(self, message: Message) -> str:
-        """向远程Trace追加消息(续跑)"""
-        response = await self._post(
-            f"/api/traces/{message.trace_id}/messages",
-            data=message.to_dict()
-        )
-        return response["message_id"]
-
-
-# agent/trace/hybrid_store.py
-
-class HybridTraceStore:
-    """混合存储:本地 + 远程"""
-
-    def __init__(self, local_store: FileSystemTraceStore):
-        self.local_store = local_store
-        self.remote_stores = {}  # agent_url -> RemoteTraceStore
-
-    def _parse_trace_id(self, trace_id: str) -> tuple[str, str]:
-        """
-        解析Trace ID
-
-        返回: (location, local_id)
-        - location: "local" 或 agent_url
-        - local_id: 本地Trace ID
-        """
-        if trace_id.startswith("agent://"):
-            # agent://terminal-agent-456/abc-123
-            parts = trace_id[8:].split("/", 1)
-            return parts[0], parts[1]
-        else:
-            return "local", trace_id
-
-    async def get_trace(self, trace_id: str) -> Optional[Trace]:
-        """获取Trace(自动路由到本地或远程)"""
-        location, local_id = self._parse_trace_id(trace_id)
-
-        if location == "local":
-            return await self.local_store.get_trace(local_id)
-        else:
-            # 远程Trace
-            if location not in self.remote_stores:
-                # 创建远程存储代理
-                self.remote_stores[location] = RemoteTraceStore(
-                    agent_url=f"https://{location}",
-                    api_key=self._get_api_key(location)
-                )
-            return await self.remote_stores[location].get_trace(local_id)
-
-    async def add_message(self, message: Message) -> str:
-        """添加消息(自动路由)"""
-        location, local_id = self._parse_trace_id(message.trace_id)
-
-        if location == "local":
-            return await self.local_store.add_message(message)
-        else:
-            # 向远程Trace追加消息
-            return await self.remote_stores[location].add_message(message)
-```
-
-#### agent工具修改
-
-```python
-@tool(description="创建 Agent 执行任务")
-async def agent(
-    task: Union[str, List[str]],
-    continue_from: Optional[str] = None,  # 支持远程Trace ID
-    agent_url: Optional[str] = None,      # 新增:远程Agent地址
-    context: Optional[dict] = None,
-) -> Dict[str, Any]:
-    """
-    创建 Agent 执行任务
-
-    Args:
-        task: 任务描述
-        continue_from: 继续已有trace(支持远程Trace ID)
-        agent_url: 远程Agent地址(如果调用远程Agent)
-        context: 框架注入的上下文
-    """
-    store = context.get("store")  # HybridTraceStore
-
-    if agent_url:
-        # 调用远程Agent
-        result = await _call_remote_agent(agent_url, task, continue_from)
-        # 返回远程Trace ID
-        remote_trace_id = f"agent://{agent_url}/{result['sub_trace_id']}"
-        return {
-            **result,
-            "sub_trace_id": remote_trace_id,
-            "remote": True
-        }
-    else:
-        # 本地执行(现有逻辑)
-        if continue_from:
-            # 可能是远程Trace,HybridStore会自动处理
-            existing = await store.get_trace(continue_from)
-            if not existing:
-                return {"status": "failed", "error": "Trace not found"}
-
-        # ... 现有逻辑
-```
-
-#### 使用示例
-
-```python
-# 云端Agent调用终端Agent
-result1 = await agent(
-    task="分析本地项目",
-    agent_url="terminal-agent-456.local"
-)
-# 返回: {"sub_trace_id": "agent://terminal-agent-456.local/abc-123"}
-
-# 继续对话(自动访问远程Trace)
-result2 = await agent(
-    task="重点分析core模块",
-    continue_from=result1["sub_trace_id"],  # 远程Trace ID
-    agent_url="terminal-agent-456.local"
-)
-# HybridStore自动通过HTTP API访问远程Trace
-```
-
-#### 优势
-
-1. **透明** - Agent不需要关心Trace在哪里
-2. **灵活** - 支持本地和远程Trace
-3. **简单** - 只需要在Trace ID中编码位置信息
-4. **兼容** - 现有本地Trace不受影响
-
-#### 劣势
-
-1. **网络延迟** - 访问远程Trace需要HTTP请求
-2. **依赖网络** - 远程Agent必须在线
-
----
-
-### 方案2:中心化Trace存储
-
-#### 核心思想
-
-**所有Agent共享同一个Trace存储(数据库)**
-
-#### 架构
-
-```
-云端Agent ──┐
-            ├──> 中心化Trace存储(PostgreSQL/MongoDB)
-终端Agent ──┘
-```
-
-#### 实现
-
-```python
-# agent/trace/db_store.py
-
-class DatabaseTraceStore:
-    """数据库Trace存储"""
-
-    def __init__(self, db_url: str):
-        self.db = connect(db_url)
-
-    async def create_trace(self, trace: Trace) -> str:
-        await self.db.traces.insert_one(trace.to_dict())
-        return trace.trace_id
-
-    async def get_trace(self, trace_id: str) -> Optional[Trace]:
-        doc = await self.db.traces.find_one({"trace_id": trace_id})
-        if doc:
-            return Trace(**doc)
-        return None
-
-    # ... 其他方法
-```
-
-#### 配置
-
-```yaml
-# config/storage.yaml
-trace_store:
-  type: database
-  url: postgresql://user:pass@db.cloud/traces
-  # 或
-  url: mongodb://db.cloud/traces
-```
-
-#### 优势
-
-1. **简单** - 所有Agent访问同一个存储,无需特殊处理
-2. **一致性** - 数据强一致性
-3. **查询能力** - 可以跨Trace查询和分析
-
-#### 劣势
-
-1. **依赖中心** - 需要中心化数据库
-2. **网络依赖** - 终端Agent必须能访问数据库
-3. **隐私问题** - 终端数据存储在云端
-4. **迁移成本** - 需要从文件系统迁移到数据库
-
----
-
-### 方案3:Trace同步/缓存
-
-#### 核心思想
-
-**按需同步远程Trace到本地**
-
-#### 实现
-
-```python
-class CachedRemoteStore:
-    """带缓存的远程存储"""
-
-    def __init__(self, local_store, remote_url):
-        self.local_store = local_store
-        self.remote_url = remote_url
-        self.cache = {}  # trace_id -> Trace
-
-    async def get_trace(self, trace_id: str) -> Optional[Trace]:
-        # 1. 检查本地
-        trace = await self.local_store.get_trace(trace_id)
-        if trace:
-            return trace
-
-        # 2. 检查缓存
-        if trace_id in self.cache:
-            return self.cache[trace_id]
-
-        # 3. 从远程获取并缓存
-        trace = await self._fetch_remote(trace_id)
-        if trace:
-            self.cache[trace_id] = trace
-            # 可选:持久化到本地
-            await self.local_store.create_trace(trace)
-        return trace
-
-    async def add_message(self, message: Message) -> str:
-        # 同时写入本地和远程
-        local_id = await self.local_store.add_message(message)
-        await self._sync_to_remote(message)
-        return local_id
-```
-
-#### 优势
-
-1. **性能** - 本地缓存减少网络请求
-2. **离线能力** - 缓存后可以离线访问
-
-#### 劣势
-
-1. **一致性** - 缓存可能过期
-2. **复杂度** - 需要处理同步和冲突
-3. **存储开销** - 需要额外的本地存储
-
----
-
-### 方案4:混合模式(推荐)
-
-#### 核心思想
-
-**结合方案1和方案2的优点**
-
-- **组织内部**:使用中心化存储(数据库)
-- **跨组织**:使用远程访问(HTTP API)
-
-#### 架构
-
-```
-组织内部:
-云端Agent ──┐
-            ├──> 组织数据库
-职能Agent ──┘
-
-跨组织:
-组织A Agent <──HTTP API──> 组织B Agent
-```
-
-#### 配置
-
-```yaml
-# config/storage.yaml
-trace_store:
-  # 组织内部使用数据库
-  internal:
-    type: database
-    url: postgresql://org-db/traces
-
-  # 跨组织使用远程访问
-  external:
-    type: remote
-    agents:
-      - url: https://partner-org.com
-        api_key: xxx
-```
-
-#### 优势
-
-1. **灵活** - 根据场景选择最优方案
-2. **性能** - 组织内部低延迟
-3. **隐私** - 跨组织数据不共享存储
-
----
-
-## 推荐方案
-
-### MVP阶段(Phase 1-2):方案1 - 远程Trace访问
-
-**理由:**
-1. **最小改动** - 只需要添加RemoteTraceStore和HybridStore
-2. **灵活** - 支持任意拓扑
-3. **隐私友好** - 数据不离开设备
-4. **渐进式** - 可以逐步迁移到方案4
-
-**实现步骤:**
-1. 实现RemoteTraceStore(通过HTTP API访问)
-2. 实现HybridTraceStore(路由到本地或远程)
-3. 修改agent工具支持agent_url参数
-4. 在Trace ID中编码位置信息
-
-### 长期(Phase 3+):方案4 - 混合模式
-
-**理由:**
-1. **组织内部高效** - 数据库存储,低延迟
-2. **跨组织灵活** - HTTP API,保护隐私
-3. **可扩展** - 支持复杂场景
-
-## 实现细节
-
-### 1. Trace ID格式
-
-```python
-# 本地Trace
-"abc-123"
-
-# 远程Trace(完整格式)
-"agent://terminal-agent-456.local:8000/abc-123"
-
-# 远程Trace(简化格式,使用注册的agent_id)
-"@terminal-agent-456/abc-123"
-```
-
-### 2. Agent注册表
-
-```yaml
-# config/agents.yaml
-agents:
-  terminal-agent-456:
-    url: https://terminal-agent-456.local:8000
-    api_key: ak_xxx
-    type: terminal
-```
-
-### 3. API端点
-
-```python
-# 必需的API端点(用于远程访问)
-GET  /api/traces/{trace_id}                    # 获取Trace
-GET  /api/traces/{trace_id}/messages           # 获取消息
-POST /api/traces/{trace_id}/run                # 续跑
-POST /api/traces/{trace_id}/messages           # 追加消息
-```
-
-### 4. 认证和授权
-
-```python
-# 每个Agent有自己的API Key
-headers = {
-    "Authorization": f"Bearer {api_key}"
-}
-
-# 权限检查
-if trace.uid != request.user_id:
-    raise Forbidden("Cannot access other user's trace")
-```
-
-### 5. 性能优化
-
-```python
-# 批量获取消息
-GET /api/traces/{trace_id}/messages?limit=100&offset=0
-
-# 增量同步
-GET /api/traces/{trace_id}/messages?since_sequence=50
-
-# 压缩传输
-headers = {"Accept-Encoding": "gzip"}
-```
-
-## 总结
-
-**推荐路线:**
-
-1. **Phase 1(MVP)** - 实现方案1(远程Trace访问)
-   - 最小改动
-   - 快速验证跨设备A2A
-   - 2-3周
-
-2. **Phase 2** - 优化和增强
-   - 添加缓存
-   - 批量API
-   - 性能优化
-   - 2-3周
-
-3. **Phase 3(可选)** - 迁移到方案4(混合模式)
-   - 组织内部使用数据库
-   - 跨组织使用远程访问
-   - 4-6周
-
-**关键优势:**
-- 渐进式实现
-- 最小化风险
-- 保持灵活性

+ 0 - 50
examples/content_tree_analyst/analyst.prompt

@@ -1,50 +0,0 @@
----
-model: qwen3.5-plus
-temperature: 0.3
----
-
-$system$
-
-## 角色
-你是内容制作需求分析专家,擅长从内容树节点结构中归纳出有价值的图文内容制作需求。
-
-## 工作流程
-
-### 第一步:获取节点局部结构
-给定一个内容树节点 id(category 或 element),调用 `search_content_tree` 或 `get_category_tree` 获取:
-- **祖先路径**(`include_ancestors=true`):了解该节点的上下文和所属维度
-- **同级节点**:搜索同名关键词或父节点的直接子节点,了解同类
-- **子孙节点**(`descendant_depth=2`):了解该节点的细分方向
-
-### 第二步:判断与图文制作的相关性
-结合节点的名称、描述、所属维度(实质/形式/意图),判断哪些节点与**图文内容制作**直接相关:
-- **保留**:与视觉呈现、角色设计、场景构图、风格表达、情感传达等制作行为直接相关的节点
-- **过滤**:纯语义/主题分类节点(如"节日"、"品牌"等不涉及制作手法的节点)
-
-### 第三步:获取关联频繁项集
-对筛选出的重要节点,调用 `get_frequent_itemsets` 获取关联要素:
-- 传入节点的 `entity_id`(搜索接口返回的 `entity_id` 字段)
-- 频繁项集揭示了在优质内容中经常与该节点共同出现的要素
-- 用这些关联要素扩展需求的覆盖范围(如"动作姿态"→"夸张"、"运动"等)
-
-### 第四步:归纳制作需求
-对每组相关节点,归纳出若干条制作能力或工具需求:
-- **粒度适中**:不能太细("生成猫咪"),也不能太粗("生成图像")
-- **正确示例**:"需要能够生成保持角色一致性的人物图像的能力"
-- **同批需求不重叠**:不同需求应覆盖不同的制作维度,而且最好是对应到不同的工具
-
-### 第五步:输出结构化需求
-将归纳结果写入 `%output_dir%/requirements.md`,每条需求包含:
-- 需求描述(自然语言)
-- 来源节点 id 列表
-- 相关频繁项集 id(若有)
-- 所属维度(实质/形式/意图)
-
-$user$
-请对以下内容树节点进行制作需求归纳分析:
-
-stable_id:334
-source_type:形式
-
-请按照工作流程,逐步分析该节点及其周边结构,最终将结构化的制作需求列表输出到 %output_dir%/requirements.md。
-注意分析出来的需求不可以彼此之间有显著重叠;最好是有所区分的不同能力、需要不同工具支撑的能力。

+ 0 - 34
examples/content_tree_analyst/config.py

@@ -1,34 +0,0 @@
-"""
-项目配置
-"""
-
-from agent.core.runner import RunConfig
-from agent.tools.builtin.knowledge import KnowledgeConfig
-
-
-RUN_CONFIG = RunConfig(
-    model="qwen3.5-plus",
-    temperature=0.3,
-    max_iterations=500,
-    extra_llm_params={"extra_body": {"enable_thinking": True}},
-    agent_type="analyst",
-    name="内容树需求归纳",
-
-    knowledge=KnowledgeConfig(
-        enable_extraction=False,
-        enable_completion_extraction=False,
-        enable_injection=False,
-        owner="sunlit.howard@gmail.com",
-        default_tags={"project": "gen_query_from_content_tree"},
-        default_scopes=["org:cybertogether"],
-        # default_search_types=["strategy"],
-        default_search_owner="sunlit.howard@gmail.com",
-    ),
-)
-
-OUTPUT_DIR = "examples/content_tree_analyst/output"
-SKILLS_DIR = "./skills"
-TRACE_STORE_PATH = ".trace"
-DEBUG = True
-LOG_LEVEL = "INFO"
-LOG_FILE = None

+ 0 - 39
examples/content_tree_analyst/docs/requirements.md

@@ -1,39 +0,0 @@
-任务1:从内容树节点归纳制作需求                                                                      
-                                                                                               
-  - 输入:内容树中某个节点的 id(category 或 element)
-  - 过程:                                
-    a. 调用搜索 API
-  获取该节点的局部结构:祖先路径(了解上下文)、同级节点(了解同类)、子孙节点(了解细分)             
-    b. 结合节点的名称、描述、所属维度(实质/形式/意图),判断哪些节点与图文内容制作直接相关(过滤掉与制
-  作无关的纯语义/主题类节点)                                                                          
-    c. 对筛选出的重要节点,进一步获取其关联的频繁项集(通过get_frequent_itemsets接口,每次传入一个category_ids;频繁项集中可以看到经常与指定节点在优质内容中共同出现的要素,比如能给“动作姿态”节点扩展到“夸张”“运动”等关联要素,从而能提出更准的需求)
-    d. 对每一组节点,归纳出一个制作能力或工具需求(如"需要能够生成保持角色一致性的人物图像的能力")
-  - 输出:若干条结构化的制作需求,每条包含:  
-    - 需求描述(自然语言)                
-    - 来源节点 id 列表(支撑这条需求的节点)
-    - 相关频繁项集id(若有)
-    - 所属维度(实质/形式/意图)                                                                       
-  - 约束:                                
-    - 需求粒度不能太细(不是"生成猫咪"),也不能太粗(不是"生成图像")                                 
-    - 同一批输出的需求之间应尽量不重叠                                                                 
-                                          
-  ---                                                                                                  
-  任务2:从制作能力/工具关联内容树节点                                                                 
-   
-  - 输入:一条制作能力或工具知识(包含名称、描述、适用场景)                                           
-  - 过程:                                                        
-    a. 从知识的名称和适用场景中提取关键词,调用搜索 API 在内容树中检索相关节点
-    b. 对返回的节点按相关度评分,过滤掉低相关节点
-    c. 对保留的节点,标注关联类型:
-        - 直接关联:该能力/工具直接用于制作包含此节点的内容
-        - 间接关联:该能力/工具是制作此类内容的前置步骤或辅助手段
-    d. 将 节点 id - 知识 id - 关联类型 - 置信度 写入映射表
-  - 输出:一批映射记录,每条包含:
-    - 节点 id + 节点名称                      
-    - 知识 id                             
-    - 关联类型(直接/间接)
-    - 置信度(高/中/低)                                                                               
-  - 约束:
-    - 低置信度的映射需标记,待后续实验验证后升级或删除                                                 
-    - 同一个节点可以关联多条知识,需支持后续按置信度排序检索      
-                                          

+ 0 - 740
examples/content_tree_analyst/docs/内容树API.md

@@ -1,740 +0,0 @@
-# 搜索 API 文档
-
-本文档包含三个搜索相关的 API 接口:
-
-1. **关键词搜索** - 根据关键词搜索分类和元素
-2. **获取分类树** - 获取指定分类的完整路径和子树
-3. **获取全量元素** - 分页浏览元素,支持排序和筛选
-
----
-
-## 接口 1:关键词搜索
-
-### 接口地址
-
-```
-GET http://8.147.104.190:8001/api/search
-```
-
-### 功能说明
-
-搜索全局分类库中的分类(Category)和元素(Element),支持文本匹配、上下文扩展、平台筛选等功能。
-
-## 请求参数
-
-| 参数名 | 类型 | 必填 | 默认值 | 说明 |
-|--------|------|------|--------|------|
-| q | string | ✓ | - | 搜索关键词 |
-| source_type | string | ✓ | - | 元素类型:`实质` / `形式` / `意图` |
-| entity_type | string | ✗ | all | 搜索对象类型:`category`(分类)/ `element`(元素)/ `all`(全部) |
-| top_k | integer | ✗ | 20 | 返回结果数量,范围 1-100 |
-| use_description | boolean | ✗ | false | 是否在描述字段中搜索(true=搜索名称+描述,false=仅搜索名称) |
-| mode | string | ✗ | text | 搜索模式:`text`(文本匹配)/ `vector`(向量搜索)/ `hybrid`(混合),当前仅支持 text |
-| include_ancestors | boolean | ✗ | false | 是否返回祖先路径(从根节点到父节点的完整路径) |
-| descendant_depth | integer | ✗ | 0 | 返回 N 代以内的子孙节点,0=不返回,1=直接子节点,2=子节点+孙节点... |
-| platform | string | ✗ | null | 按平台筛选,仅对元素有效(如:`小红书`、`抖音`、`微博` 等) |
-
-## 返回格式
-
-```json
-{
-  "success": true,
-  "query": "搜索关键词",
-  "source_type": "实质",
-  "entity_type": "all",
-  "count": 3,
-  "results": [
-    {
-      "entity_type": "category",
-      "entity_id": 123,
-      "stable_id": 456,
-      "name": "分类名称",
-      "description": "分类描述",
-      "path": "/一级分类/二级分类",
-      "category_nature": "领域层级",
-      "level": 2,
-      "score": 0.95,
-      "scores": {
-        "text": 0.95,
-        "vector": 0.0
-      },
-      "ancestors": [...],
-      "descendants": [...]
-    },
-    {
-      "entity_type": "element",
-      "entity_id": 789,
-      "name": "元素名称",
-      "description": "元素描述",
-      "belong_category_stable_id": 456,
-      "occurrence_count": 25,
-      "score": 0.88,
-      "scores": {
-        "text": 0.88,
-        "vector": 0.0
-      }
-    }
-  ]
-}
-```
-
-### 返回字段说明
-
-#### 通用字段
-- `success`: 请求是否成功
-- `query`: 搜索关键词
-- `source_type`: 元素类型
-- `entity_type`: 搜索对象类型
-- `count`: 返回结果数量
-- `results`: 结果列表
-
-#### 结果对象字段(分类 Category)
-- `entity_type`: 固定为 "category"
-- `entity_id`: 分类数据库 ID
-- `stable_id`: 分类稳定 ID(用于跨版本引用)
-- `name`: 分类名称
-- `description`: 分类描述
-- `path`: 分类路径(如 `/主体/角色类型/人物角色`)
-- `category_nature`: 分类性质(领域层级/元描述层级)
-- `level`: 层级深度(1=根节点)
-- `score`: 综合相似度分数(0-1)
-- `scores`: 各维度分数
-- `ancestors`: 祖先路径(当 `include_ancestors=true` 时返回)
-- `descendants`: 子孙节点(当 `descendant_depth>0` 时返回)
-
-#### 结果对象字段(元素 Element)
-- `entity_type`: 固定为 "element"
-- `entity_id`: 元素数据库 ID
-- `name`: 元素名称
-- `description`: 元素描述
-- `belong_category_stable_id`: 所属分类的 stable_id
-- `occurrence_count`: 出现次数
-- `score`: 综合相似度分数(0-1)
-- `scores`: 各维度分数
-
-#### ancestors 字段结构
-```json
-[
-  {
-    "stable_id": 1,
-    "name": "主体",
-    "level": 1
-  },
-  {
-    "stable_id": 10,
-    "name": "角色类型",
-    "level": 2
-  }
-]
-```
-
-#### descendants 字段结构
-```json
-[
-  {
-    "stable_id": 500,
-    "name": "人物角色",
-    "level": 3,
-    "depth_from_parent": 1,
-    "is_leaf": false
-  },
-  {
-    "stable_id": 501,
-    "name": "动物角色",
-    "level": 3,
-    "depth_from_parent": 1,
-    "is_leaf": true
-  }
-]
-```
-
----
-
-## 使用示例
-
-### 1. 基础搜索
-
-#### 搜索所有(分类+元素)
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=角色" \
-  --data-urlencode "source_type=实质"
-```
-
-#### 只搜索分类
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=主体" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=category"
-```
-
-#### 只搜索元素
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=猫咪" \
-  --data-urlencode "source_type=形式" \
-  --data-urlencode "entity_type=element"
-```
-
-#### 限制返回数量
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=角色" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "top_k=5"
-```
-
-### 2. 扩展搜索范围
-
-#### 搜索名称+描述
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=拟人" \
-  --data-urlencode "source_type=形式" \
-  --data-urlencode "use_description=true"
-```
-
-### 3. 获取上下文信息
-
-#### 返回祖先路径
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=人物角色" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=category" \
-  --data-urlencode "include_ancestors=true"
-```
-
-#### 返回1代子孙节点
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=主体" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=category" \
-  --data-urlencode "descendant_depth=1"
-```
-
-#### 返回2代子孙节点
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=主体" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=category" \
-  --data-urlencode "descendant_depth=2"
-```
-
-#### 同时返回祖先+子孙
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=角色类型" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=category" \
-  --data-urlencode "include_ancestors=true" \
-  --data-urlencode "descendant_depth=2"
-```
-
-### 4. 平台筛选
-
-#### 只搜索小红书平台的元素
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=角色" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=element" \
-  --data-urlencode "platform=小红书"
-```
-
-#### 搜索抖音平台的元素
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=主体" \
-  --data-urlencode "source_type=形式" \
-  --data-urlencode "platform=抖音"
-```
-
-#### 平台筛选+描述搜索
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=拟人" \
-  --data-urlencode "source_type=形式" \
-  --data-urlencode "platform=小红书" \
-  --data-urlencode "use_description=true"
-```
-
-### 5. 组合查询
-
-#### 全功能组合
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=角色" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=all" \
-  --data-urlencode "top_k=10" \
-  --data-urlencode "use_description=true" \
-  --data-urlencode "include_ancestors=true" \
-  --data-urlencode "descendant_depth=1" \
-  --data-urlencode "platform=小红书"
-```
-
-#### 不同 source_type 的搜索
-```bash
-# 搜索意图维度
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=情感" \
-  --data-urlencode "source_type=意图"
-
-# 搜索形式维度
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=视觉" \
-  --data-urlencode "source_type=形式"
-```
-
-### 6. 浏览器直接访问
-
-```
-http://8.147.104.190:8001/api/search?q=角色&source_type=实质
-http://8.147.104.190:8001/api/search?q=主体&source_type=实质&entity_type=category&include_ancestors=true&descendant_depth=2
-http://8.147.104.190:8001/api/search?q=猫咪&source_type=形式&platform=小红书
-```
-
-### 7. FastAPI 交互式文档
-
-访问以下地址可以在网页上直接测试 API:
-
-```
-http://8.147.104.190:8001/docs
-```
-
-在文档页面找到 `/api/search` 接口,点击 "Try it out" 按钮,填写参数后点击 "Execute" 即可测试。
-
----
-
-## 返回示例
-
-### 示例 1:基础搜索
-
-**请求:**
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=角色" \
-  --data-urlencode "source_type=实质"
-```
-
-**响应:**
-```json
-{
-  "success": true,
-  "query": "角色",
-  "source_type": "实质",
-  "entity_type": "all",
-  "count": 2,
-  "results": [
-    {
-      "entity_type": "category",
-      "entity_id": 123,
-      "stable_id": 456,
-      "name": "角色类型",
-      "description": "内容主体的角色分类",
-      "path": "/主体/角色类型",
-      "category_nature": "领域层级",
-      "level": 2,
-      "score": 0.95,
-      "scores": {
-        "text": 0.95,
-        "vector": 0.0
-      }
-    },
-    {
-      "entity_type": "element",
-      "entity_id": 789,
-      "name": "人物角色",
-      "description": "真实或虚拟的人物形象",
-      "belong_category_stable_id": 456,
-      "occurrence_count": 25,
-      "score": 0.88,
-      "scores": {
-        "text": 0.88,
-        "vector": 0.0
-      }
-    }
-  ]
-}
-```
-
-### 示例 2:带祖先和子孙的搜索
-
-**请求:**
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=角色类型" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "entity_type=category" \
-  --data-urlencode "include_ancestors=true" \
-  --data-urlencode "descendant_depth=2"
-```
-
-**响应:**
-```json
-{
-  "success": true,
-  "query": "角色类型",
-  "source_type": "实质",
-  "entity_type": "category",
-  "count": 1,
-  "results": [
-    {
-      "entity_type": "category",
-      "entity_id": 123,
-      "stable_id": 456,
-      "name": "角色类型",
-      "description": "内容主体的角色分类",
-      "path": "/主体/角色类型",
-      "category_nature": "领域层级",
-      "level": 2,
-      "score": 1.0,
-      "scores": {
-        "text": 1.0,
-        "vector": 0.0
-      },
-      "ancestors": [
-        {
-          "stable_id": 1,
-          "name": "主体",
-          "level": 1
-        }
-      ],
-      "descendants": [
-        {
-          "stable_id": 500,
-          "name": "人物角色",
-          "level": 3,
-          "depth_from_parent": 1,
-          "is_leaf": false
-        },
-        {
-          "stable_id": 501,
-          "name": "动物角色",
-          "level": 3,
-          "depth_from_parent": 1,
-          "is_leaf": false
-        },
-        {
-          "stable_id": 600,
-          "name": "真人角色",
-          "level": 4,
-          "depth_from_parent": 2,
-          "is_leaf": true
-        },
-        {
-          "stable_id": 601,
-          "name": "虚拟角色",
-          "level": 4,
-          "depth_from_parent": 2,
-          "is_leaf": true
-        }
-      ]
-    }
-  ]
-}
-```
-
-### 示例 3:平台筛选
-
-**请求:**
-```bash
-curl -G "http://8.147.104.190:8001/api/search" \
-  --data-urlencode "q=猫咪" \
-  --data-urlencode "source_type=形式" \
-  --data-urlencode "entity_type=element" \
-  --data-urlencode "platform=小红书"
-```
-
-**响应:**
-```json
-{
-  "success": true,
-  "query": "猫咪",
-  "source_type": "形式",
-  "entity_type": "element",
-  "count": 3,
-  "results": [
-    {
-      "entity_type": "element",
-      "entity_id": 1001,
-      "name": "猫咪",
-      "description": "可爱的猫咪形象",
-      "belong_category_stable_id": 200,
-      "occurrence_count": 15,
-      "score": 1.0,
-      "scores": {
-        "text": 1.0,
-        "vector": 0.0
-      }
-    },
-    {
-      "entity_type": "element",
-      "entity_id": 1002,
-      "name": "猫咪拟人",
-      "description": "拟人化的猫咪角色",
-      "belong_category_stable_id": 201,
-      "occurrence_count": 8,
-      "score": 0.85,
-      "scores": {
-        "text": 0.85,
-        "vector": 0.0
-      }
-    }
-  ]
-}
-```
-
----
-
-## 错误处理
-
-### 错误响应格式
-
-```json
-{
-  "detail": "错误信息描述"
-}
-```
-
-### 常见错误
-
-| HTTP 状态码 | 错误原因 | 解决方法 |
-|------------|---------|---------|
-| 400 | 缺少必填参数(q 或 source_type) | 检查请求参数 |
-| 400 | source_type 值不合法 | 使用 `实质`、`形式` 或 `意图` |
-| 400 | entity_type 值不合法 | 使用 `category`、`element` 或 `all` |
-| 400 | mode 不支持 | 当前仅支持 `text` 模式 |
-| 500 | 服务器内部错误 | 联系技术支持 |
-
----
-
-## 注意事项
-
-1. **中文参数编码**:使用 curl 时,中文参数需要用 `--data-urlencode` 进行 URL 编码
-2. **平台筛选限制**:`platform` 参数仅对元素(element)有效,对分类(category)无效
-3. **性能考虑**:
-   - `use_description=true` 会增加搜索范围,可能降低精确度
-   - `descendant_depth` 越大,返回数据越多,响应时间越长
-   - 建议 `top_k` 不超过 50
-4. **搜索模式**:当前仅支持 `text` 模式,`vector` 和 `hybrid` 模式将在后续版本中支持
-5. **平台名称**:`platform` 参数值需要与数据库中的平台名称完全一致(区分大小写)
-
----
-
-## 接口 2:获取分类树
-
-### 接口地址
-
-```
-GET http://8.147.104.190:8001/api/search/category/{stable_id}
-```
-
-### 功能说明
-
-获取指定分类的完整路径和子树结构,用于导航和展示分类层级关系。
-
-### 请求参数
-
-| 参数名 | 类型 | 必填 | 默认值 | 说明 |
-|--------|------|------|--------|------|
-| stable_id | integer | ✓ | - | 分类的 stable_id(路径参数) |
-| source_type | string | ✓ | - | 元素类型:`实质` / `形式` / `意图` |
-| include_ancestors | boolean | ✗ | true | 是否返回祖先路径(从根节点到当前节点) |
-| descendant_depth | integer | ✗ | -1 | 返回子孙深度,-1=全部,0=仅当前节点,1=子节点,2=子+孙... |
-
-### 返回格式
-
-```json
-{
-  "success": true,
-  "current": {
-    "stable_id": 125,
-    "name": "吉祥用语",
-    "description": "通用的吉祥话语和祝福词句",
-    "path": "/表象/符号/表达符号/祝福语/吉祥用语",
-    "level": 5
-  },
-  "ancestors": [
-    {
-      "stable_id": 38,
-      "name": "表象",
-      "path": "/表象",
-      "level": 1
-    },
-    {
-      "stable_id": 40,
-      "name": "符号",
-      "path": "/表象/符号",
-      "level": 2
-    }
-  ],
-  "descendants": [
-    {
-      "stable_id": 126,
-      "name": "新年祝福",
-      "description": "新年相关的祝福语",
-      "path": "/表象/符号/表达符号/祝福语/吉祥用语/新年祝福",
-      "level": 6,
-      "children": []
-    }
-  ]
-}
-```
-
-### 使用示例
-
-#### 获取分类的完整路径和所有子孙
-```bash
-curl -G "http://8.147.104.190:8001/api/search/category/125" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "include_ancestors=true" \
-  --data-urlencode "descendant_depth=-1"
-```
-
-#### 只获取当前节点和祖先路径
-```bash
-curl -G "http://8.147.104.190:8001/api/search/category/125" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "include_ancestors=true" \
-  --data-urlencode "descendant_depth=0"
-```
-
-#### 获取2代子孙节点
-```bash
-curl -G "http://8.147.104.190:8001/api/search/category/125" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "descendant_depth=2"
-```
-
----
-
-## 接口 3:获取全量元素数据
-
-### 接口地址
-
-```
-GET http://8.147.104.190:8001/api/search/elements
-```
-
-### 功能说明
-
-获取全量元素数据,支持分页、排序、筛选。主要用于获取高频元素、按分类浏览元素等场景。
-
-### 请求参数
-
-| 参数名 | 类型 | 必填 | 默认值 | 说明 |
-|--------|------|------|--------|------|
-| source_type | string | ✓ | - | 元素类型:`实质` / `形式` / `意图` |
-| page | integer | ✗ | 1 | 页码(从1开始) |
-| page_size | integer | ✗ | 50 | 每页数量(1-200) |
-| sort_by | string | ✗ | occurrence_count | 排序字段:`occurrence_count` / `name` / `id` |
-| order | string | ✗ | desc | 排序方向:`asc` / `desc` |
-| category_stable_id | integer | ✗ | null | 按分类筛选(可选) |
-| platform | string | ✗ | null | 按平台筛选(可选) |
-| min_occurrence | integer | ✗ | null | 最小出现次数(可选) |
-
-### 返回格式
-
-```json
-{
-  "success": true,
-  "source_type": "实质",
-  "page": 1,
-  "page_size": 50,
-  "total": 4082,
-  "total_pages": 82,
-  "results": [
-    {
-      "id": 45,
-      "name": "祝福语",
-      "description": "'吉祥如意'、'幸福安康'等文字内容",
-      "occurrence_count": 974,
-      "element_sub_type": "具象概念",
-      "category": {
-        "stable_id": 125,
-        "name": "吉祥用语",
-        "path": "/表象/符号/表达符号/祝福语/吉祥用语"
-      }
-    }
-  ]
-}
-```
-
-### 使用示例
-
-#### 获取高频元素前50(默认)
-```bash
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=实质"
-```
-
-#### 获取高频元素前10
-```bash
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "page=1" \
-  --data-urlencode "page_size=10" \
-  --data-urlencode "sort_by=occurrence_count" \
-  --data-urlencode "order=desc"
-```
-
-#### 按名称排序
-```bash
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=形式" \
-  --data-urlencode "sort_by=name" \
-  --data-urlencode "order=asc"
-```
-
-#### 筛选指定分类下的元素
-```bash
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "category_stable_id=125"
-```
-
-#### 筛选出现次数>=10的元素
-```bash
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "min_occurrence=10"
-```
-
-#### 按平台筛选元素
-```bash
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=形式" \
-  --data-urlencode "platform=小红书"
-```
-
-#### 组合筛选:指定分类+最小出现次数
-```bash
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "category_stable_id=125" \
-  --data-urlencode "min_occurrence=50" \
-  --data-urlencode "page_size=20"
-```
-
-#### 分页浏览
-```bash
-# 第1页
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "page=1" \
-  --data-urlencode "page_size=50"
-
-# 第2页
-curl -G "http://8.147.104.190:8001/api/search/elements" \
-  --data-urlencode "source_type=实质" \
-  --data-urlencode "page=2" \
-  --data-urlencode "page_size=50"
-```
-
----
-

+ 0 - 15
examples/content_tree_analyst/docs/频繁项集API.md

@@ -1,15 +0,0 @@
-  curl 'https://pattern.aiddit.com/api/pattern/tools/get_frequent_itemsets/execute' \
-  -H 'Accept: */*' \
-  -H 'Accept-Language: zh-CN,zh;q=0.9' \
-  -H 'Connection: keep-alive' \
-  -H 'Content-Type: application/json' \
-  -H 'Origin: https://pattern.aiddit.com' \
-  -H 'Referer: https://pattern.aiddit.com/execution/33' \
-  -H 'Sec-Fetch-Dest: empty' \
-  -H 'Sec-Fetch-Mode: cors' \
-  -H 'Sec-Fetch-Site: same-origin' \
-  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36' \
-  -H 'sec-ch-ua: "Not:A-Brand";v="99", "Google Chrome";v="145", "Chromium";v="145"' \
-  -H 'sec-ch-ua-mobile: ?0' \
-  -H 'sec-ch-ua-platform: "macOS"' \
-  --data-raw '{"execution_id":33,"args":{"top_n":20,"category_ids":[378],"sort_by":"absolute_support"}}'

+ 0 - 9
examples/content_tree_analyst/presets.json

@@ -1,9 +0,0 @@
-{
-  "analyst": {
-    "system_prompt_file": "analyst.prompt",
-    "max_iterations": 200,
-    "temperature": 0.3,
-    "skills": ["planning"],
-    "description": "内容树需求归纳 Agent"
-  }
-}

+ 0 - 221
examples/content_tree_analyst/run.py

@@ -1,221 +0,0 @@
-"""
-内容树需求归纳 Agent
-
-从内容树节点归纳制作需求(任务1)。
-
-用法:
-  python run.py                    # 直接运行(任务在 analyst.prompt 中配置)
-  python run.py --trace <TRACE_ID> # 恢复已有 trace
-"""
-
-import argparse
-import os
-import sys
-import asyncio
-from pathlib import Path
-
-os.environ.setdefault("no_proxy", "*")
-
-sys.path.insert(0, str(Path(__file__).parent.parent.parent))
-
-from dotenv import load_dotenv
-load_dotenv()
-
-from agent.llm.prompts import SimplePrompt
-from agent.core.runner import AgentRunner, RunConfig
-from agent.trace import FileSystemTraceStore, Trace, Message
-from agent.llm import create_qwen_llm_call
-from agent.cli import InteractiveController
-from agent.utils import setup_logging
-
-# 注册自定义工具
-from tools.content_tree import search_content_tree, get_category_tree
-from tools.frequent_itemsets import get_frequent_itemsets
-
-from config import RUN_CONFIG, SKILLS_DIR, TRACE_STORE_PATH, DEBUG, LOG_LEVEL, LOG_FILE, OUTPUT_DIR
-
-
-async def main():
-    parser = argparse.ArgumentParser(description="内容树需求归纳 Agent")
-    parser.add_argument("--trace", type=str, default=None, help="已有 Trace ID,用于恢复继续执行")
-    args = parser.parse_args()
-
-    base_dir = Path(__file__).parent
-    project_root = base_dir.parent.parent
-    output_dir = project_root / OUTPUT_DIR
-    output_dir.mkdir(parents=True, exist_ok=True)
-
-    setup_logging(level=LOG_LEVEL, file=LOG_FILE)
-
-    # 加载 presets
-    presets_path = base_dir / "presets.json"
-    if presets_path.exists():
-        from agent.core.presets import load_presets_from_json
-        load_presets_from_json(str(presets_path))
-        print("已加载 presets")
-
-    # 构建任务消息(直接从 analyst.prompt 加载,无变量替换)
-    if not args.trace:
-        prompt = SimplePrompt(base_dir / "analyst.prompt")
-        messages = prompt.build_messages(output_dir=OUTPUT_DIR)
-    else:
-        messages = None
-
-    # 创建 Runner
-    store = FileSystemTraceStore(base_path=TRACE_STORE_PATH)
-    runner = AgentRunner(
-        trace_store=store,
-        llm_call=create_qwen_llm_call(model=RUN_CONFIG.model),
-        skills_dir=SKILLS_DIR,
-        debug=DEBUG,
-    )
-
-    interactive = InteractiveController(runner=runner, store=store, enable_stdin_check=True)
-    runner.stdin_check = interactive.check_stdin
-
-    print("=" * 60)
-    print("内容树需求归纳 Agent")
-    print("=" * 60)
-    print("💡 输入 'p' 暂停,'q' 退出")
-    print("=" * 60)
-
-    run_config = RUN_CONFIG
-    resume_trace_id = args.trace
-    current_trace_id = resume_trace_id
-    current_sequence = 0
-    should_exit = False
-    final_response = ""
-
-    try:
-        if resume_trace_id:
-            existing = await store.get_trace(resume_trace_id)
-            if not existing:
-                print(f"错误: Trace 不存在: {resume_trace_id}")
-                sys.exit(1)
-            run_config.trace_id = resume_trace_id
-            print(f"恢复 Trace: {resume_trace_id[:8]}...")
-
-        while not should_exit:
-            if current_trace_id:
-                run_config.trace_id = current_trace_id
-
-            # 恢复模式:先进交互菜单
-            if current_trace_id and messages is None:
-                check_trace = await store.get_trace(current_trace_id)
-                if check_trace:
-                    current_sequence = check_trace.head_sequence
-                    menu_result = await interactive.show_menu(current_trace_id, current_sequence)
-                    if menu_result["action"] == "stop":
-                        break
-                    elif menu_result["action"] == "continue":
-                        new_msgs = menu_result.get("messages", [])
-                        messages = new_msgs if new_msgs else []
-                        run_config.after_sequence = menu_result.get("after_sequence")
-                        continue
-                break
-
-            if messages is None:
-                messages = []
-
-            print("▶️ 开始执行...")
-            paused = False
-
-            try:
-                async for item in runner.run(messages=messages, config=run_config):
-                    cmd = interactive.check_stdin()
-                    if cmd == "pause":
-                        print("\n⏸️ 暂停中...")
-                        if current_trace_id:
-                            await runner.stop(current_trace_id)
-                        await asyncio.sleep(0.5)
-                        menu_result = await interactive.show_menu(current_trace_id, current_sequence)
-                        if menu_result["action"] == "stop":
-                            should_exit = True
-                            paused = True
-                            break
-                        elif menu_result["action"] == "continue":
-                            new_msgs = menu_result.get("messages", [])
-                            messages = new_msgs if new_msgs else []
-                            run_config.after_sequence = menu_result.get("after_sequence")
-                            paused = True
-                            break
-                    elif cmd == "quit":
-                        print("\n🛑 停止...")
-                        if current_trace_id:
-                            await runner.stop(current_trace_id)
-                        should_exit = True
-                        break
-
-                    if isinstance(item, Trace):
-                        current_trace_id = item.trace_id
-                        if item.status == "running":
-                            print(f"[Trace] 开始: {item.trace_id[:8]}...")
-                        elif item.status == "completed":
-                            print(f"\n[Trace] ✅ 完成 | messages={item.total_messages} | cost=${item.total_cost:.4f}")
-                        elif item.status == "failed":
-                            print(f"\n[Trace] ❌ 失败: {item.error_message}")
-
-                    elif isinstance(item, Message):
-                        current_sequence = item.sequence
-                        if item.role == "assistant":
-                            content = item.content
-                            if isinstance(content, dict):
-                                text = content.get("text", "")
-                                tool_calls = content.get("tool_calls")
-                                if text and not tool_calls:
-                                    final_response = text
-                                    print(f"\n[Response]\n{text}")
-                                elif text:
-                                    preview = text[:150] + "..." if len(text) > 150 else text
-                                    print(f"[Assistant] {preview}")
-                        elif item.role == "tool":
-                            content = item.content
-                            tool_name = content.get("tool_name", "unknown") if isinstance(content, dict) else "unknown"
-                            desc = item.description or ""
-                            if desc and desc != tool_name:
-                                print(f"[Tool] ✅ {tool_name}: {desc[:80]}")
-                            else:
-                                print(f"[Tool] ✅ {tool_name}")
-
-            except Exception as e:
-                print(f"\n执行出错: {e}")
-                import traceback
-                traceback.print_exc()
-
-            if paused:
-                if should_exit:
-                    break
-                continue
-
-            if should_exit:
-                break
-
-            if current_trace_id:
-                menu_result = await interactive.show_menu(current_trace_id, current_sequence)
-                if menu_result["action"] == "stop":
-                    break
-                elif menu_result["action"] == "continue":
-                    new_msgs = menu_result.get("messages", [])
-                    messages = new_msgs if new_msgs else []
-                    run_config.after_sequence = menu_result.get("after_sequence")
-                    continue
-            break
-
-    except KeyboardInterrupt:
-        print("\n用户中断 (Ctrl+C)")
-        if current_trace_id:
-            await runner.stop(current_trace_id)
-
-    # 保存最终结果
-    if final_response:
-        result_file = output_dir / "result.txt"
-        result_file.write_text(final_response, encoding="utf-8")
-        print(f"\n✓ 结果已保存: {result_file}")
-
-    if current_trace_id:
-        print(f"\nTrace ID: {current_trace_id}")
-        print("可视化: python3 api_server.py → http://localhost:8000/api/traces")
-
-
-if __name__ == "__main__":
-    asyncio.run(main())

+ 0 - 1
examples/content_tree_analyst/tools/__init__.py

@@ -1 +0,0 @@
-# tools/__init__.py

+ 0 - 167
examples/content_tree_analyst/tools/content_tree.py

@@ -1,167 +0,0 @@
-"""
-内容树 API 工具
-
-封装内容树搜索接口:
-1. search_content_tree - 关键词搜索分类和元素
-2. get_category_tree - 获取指定分类的完整路径和子树
-"""
-
-import logging
-from typing import Optional
-
-import httpx
-
-from agent.tools import tool
-from agent.tools.models import ToolResult
-
-logger = logging.getLogger(__name__)
-
-BASE_URL = "http://8.147.104.190:8001"
-
-
-@tool(description="在内容树中搜索分类(category)和元素(element),支持获取祖先路径和子孙节点")
-async def search_content_tree(
-    q: str,
-    source_type: str,
-    entity_type: str = "all",
-    top_k: int = 20,
-    use_description: bool = False,
-    include_ancestors: bool = False,
-    descendant_depth: int = 0,
-) -> ToolResult:
-    """
-    关键词搜索内容树中的分类和元素。
-
-    Args:
-        q: 搜索关键词
-        source_type: 维度,必须是 "实质" / "形式" / "意图" 之一
-        entity_type: 搜索对象类型,"category" / "element" / "all"(默认)
-        top_k: 返回结果数量,1-100(默认20)
-        use_description: 是否同时搜索描述字段(默认仅搜索名称)
-        include_ancestors: 是否返回祖先路径
-        descendant_depth: 返回子孙节点深度,0=不返回,1=直接子节点,2=子+孙...
-    """
-    params = {
-        "q": q,
-        "source_type": source_type,
-        "entity_type": entity_type,
-        "top_k": top_k,
-        "use_description": str(use_description).lower(),
-        "include_ancestors": str(include_ancestors).lower(),
-        "descendant_depth": descendant_depth,
-    }
-
-    try:
-        async with httpx.AsyncClient(timeout=30.0) as client:
-            resp = await client.get(f"{BASE_URL}/api/search", params=params)
-            resp.raise_for_status()
-            data = resp.json()
-
-        count = data.get("count", 0)
-        results = data.get("results", [])
-
-        # 格式化输出
-        lines = [f"搜索「{q}」({source_type}维度)共找到 {count} 条结果:\n"]
-        for r in results:
-            etype = r.get("entity_type", "")
-            name = r.get("name", "")
-            score = r.get("score", 0)
-            if etype == "category":
-                sid = r.get("stable_id", "")
-                path = r.get("path", "")
-                desc = r.get("description", "")
-                lines.append(f"[分类] stable_id={sid} | {path} | score={score:.2f}")
-                if desc:
-                    lines.append(f"  描述: {desc}")
-                ancestors = r.get("ancestors", [])
-                if ancestors:
-                    anc_names = " > ".join(a["name"] for a in ancestors)
-                    lines.append(f"  祖先: {anc_names}")
-                descendants = r.get("descendants", [])
-                if descendants:
-                    desc_names = ", ".join(d["name"] for d in descendants[:10])
-                    lines.append(f"  子孙({len(descendants)}): {desc_names}")
-            else:
-                eid = r.get("entity_id", "")
-                belong = r.get("belong_category_stable_id", "")
-                occ = r.get("occurrence_count", 0)
-                lines.append(f"[元素] entity_id={eid} | {name} | belong_category={belong} | 出现次数={occ} | score={score:.2f}")
-                edesc = r.get("description", "")
-                if edesc:
-                    lines.append(f"  描述: {edesc}")
-            lines.append("")
-
-        return ToolResult(
-            title=f"内容树搜索: {q} ({source_type}) → {count} 条",
-            output="\n".join(lines),
-        )
-
-    except httpx.HTTPError as e:
-        return ToolResult(title="内容树搜索失败", output=f"HTTP 错误: {e}")
-    except Exception as e:
-        logger.exception("search_content_tree error")
-        return ToolResult(title="内容树搜索失败", output=f"错误: {e}")
-
-
-@tool(description="获取指定分类节点的完整路径、祖先和子孙结构(通过 stable_id 精确查询)")
-async def get_category_tree(
-    stable_id: int,
-    source_type: str,
-    include_ancestors: bool = True,
-    descendant_depth: int = -1,
-) -> ToolResult:
-    """
-    获取指定分类的完整路径和子树结构。
-
-    Args:
-        stable_id: 分类的 stable_id
-        source_type: 维度,"实质" / "形式" / "意图"
-        include_ancestors: 是否返回祖先路径(默认 True)
-        descendant_depth: 子孙深度,-1=全部,0=仅当前,1=子节点,2=子+孙...
-    """
-    params = {
-        "source_type": source_type,
-        "include_ancestors": str(include_ancestors).lower(),
-        "descendant_depth": descendant_depth,
-    }
-
-    try:
-        async with httpx.AsyncClient(timeout=30.0) as client:
-            resp = await client.get(f"{BASE_URL}/api/search/category/{stable_id}", params=params)
-            resp.raise_for_status()
-            data = resp.json()
-
-        current = data.get("current", {})
-        ancestors = data.get("ancestors", [])
-        descendants = data.get("descendants", [])
-
-        lines = []
-        lines.append(f"分类节点: {current.get('name', '')} (stable_id={stable_id})")
-        lines.append(f"路径: {current.get('path', '')}")
-        if current.get("description"):
-            lines.append(f"描述: {current['description']}")
-        lines.append("")
-
-        if ancestors:
-            lines.append("祖先路径:")
-            for a in ancestors:
-                lines.append(f"  L{a.get('level', '?')} {a.get('name', '')} (stable_id={a.get('stable_id', '')})")
-            lines.append("")
-
-        if descendants:
-            lines.append(f"子孙节点 ({len(descendants)} 个):")
-            for d in descendants:
-                indent = "  " * d.get("depth_from_parent", 1)
-                leaf_mark = " [叶]" if d.get("is_leaf") else ""
-                lines.append(f"{indent}L{d.get('level', '?')} {d.get('name', '')} (stable_id={d.get('stable_id', '')}){leaf_mark}")
-
-        return ToolResult(
-            title=f"分类树: {current.get('name', stable_id)} (stable_id={stable_id})",
-            output="\n".join(lines),
-        )
-
-    except httpx.HTTPError as e:
-        return ToolResult(title="获取分类树失败", output=f"HTTP 错误: {e}")
-    except Exception as e:
-        logger.exception("get_category_tree error")
-        return ToolResult(title="获取分类树失败", output=f"错误: {e}")

+ 0 - 99
examples/content_tree_analyst/tools/frequent_itemsets.py

@@ -1,99 +0,0 @@
-"""
-频繁项集 API 工具
-
-封装 pattern.aiddit.com 的频繁项集接口,用于查询与指定分类节点
-在优质内容中共同出现的关联要素。
-"""
-
-import logging
-
-import httpx
-
-from agent.tools import tool
-from agent.tools.models import ToolResult
-
-logger = logging.getLogger(__name__)
-
-ITEMSETS_URL = "https://pattern.aiddit.com/api/pattern/tools/get_frequent_itemsets/execute"
-
-HEADERS = {
-    "Accept": "*/*",
-    "Accept-Language": "zh-CN,zh;q=0.9",
-    "Connection": "keep-alive",
-    "Content-Type": "application/json",
-    "Origin": "https://pattern.aiddit.com",
-    "Referer": "https://pattern.aiddit.com/execution/33",
-    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36",
-}
-
-
-@tool(description="查询与指定分类节点在优质内容中共同出现的频繁项集(关联要素),用于扩展制作需求的关联维度")
-async def get_frequent_itemsets(
-    entity_ids: list,
-    top_n: int = 20,
-    execution_id: int = 33,
-    sort_by: str = "absolute_support",
-) -> ToolResult:
-    """
-    获取与指定分类节点关联的频繁项集。
-
-    Args:
-        entity_ids: 分类节点的 entity_id 列表(即搜索接口返回的 entity_id 字段,非 stable_id)
-        top_n: 返回前 N 个项集,默认 20
-        execution_id: 执行 ID,默认 33
-        sort_by: 排序字段,默认 "absolute_support"
-    """
-    payload = {
-        "execution_id": execution_id,
-        "args": {
-            "top_n": top_n,
-            "category_ids": entity_ids,
-            "sort_by": sort_by,
-        },
-    }
-
-    try:
-        import json as _json
-        async with httpx.AsyncClient(timeout=30.0) as client:
-            resp = await client.post(ITEMSETS_URL, json=payload, headers=HEADERS)
-            resp.raise_for_status()
-            outer = resp.json()
-
-        # result 字段是 JSON 字符串,需要二次解析
-        data = _json.loads(outer["result"])
-        total = data.get("total", 0)
-        groups = data.get("groups", {})
-
-        # 收集所有 group 下的 itemsets
-        all_itemsets = []
-        for group_key, group in groups.items():
-            for itemset in group.get("itemsets", []):
-                itemset["_group"] = group_key
-                all_itemsets.append(itemset)
-
-        lines = [f"频繁项集查询 entity_ids={entity_ids},共 {total} 条,返回 {len(all_itemsets)} 条:\n"]
-        for i, itemset in enumerate(all_itemsets, 1):
-            itemset_id = itemset.get("id", "")
-            item_count = itemset.get("item_count", "")
-            support = itemset.get("support", 0)
-            abs_support = itemset.get("absolute_support", "")
-            lines.append(f"{i}. 项集ID={itemset_id} | 项数={item_count} | support={support:.4f} | abs={abs_support}")
-            for elem in itemset.get("items", []):
-                dim = elem.get("dimension", "")
-                path = elem.get("category_path", "")
-                ename = elem.get("element_name") or ""
-                label = f"{path}({ename})" if ename else path
-                lines.append(f"   [{dim}] {label}")
-            lines.append("")
-
-        return ToolResult(
-            title=f"频繁项集: entity_ids={entity_ids} → {total} 条",
-            output="\n".join(lines),
-        )
-        return ToolResult(
-            title="频繁项集查询失败",
-            output=f"HTTP {e.response.status_code}: {e.response.text[:200]}",
-        )
-    except Exception as e:
-        logger.exception("get_frequent_itemsets error")
-        return ToolResult(title="频繁项集查询失败", output=f"错误: {e}")

+ 0 - 68
examples/feature_extract/aliduoduo/description/制作亮点.md

@@ -1,68 +0,0 @@
-"聚类结果": [
-{
-"聚类主题": "极具反差的猫咪神态",
-"聚类描述": "这是该类图片的实质亮点。画面视觉主体是一只橘白相间的猫咪,其面部表情在上下两部分形成剧烈反差:上方是张大嘴巴的抗拒/咆哮神态,下方则是睁大眼睛的乖巧/期待神态。这种拟人化的情绪表演赋予了图片核心的戏剧张力和幽默灵魂。",
-"亮点类型": "实质",
-},
-{
-"聚类主题": "纵向二分的对比叙事构图",
-"聚类描述": "这是该类图片的形式亮点。画面统一采用了互联网模因(Meme)经典的垂直双分栏结构,通过物理空间的上下并置,建立起“拒绝”与“接受”的二元对立逻辑。这种结构化的视觉呈现引导观众进行对比阅读,是支撑笑点产生的核心排版形式。",
-"亮点类型": "形式",
-},
-{
-"聚类主题": "加工前后的水果形态对比",
-"聚类描述": "这是该类图片的实质亮点。作为剧情反转的诱因,各类水果(芒果、榴莲、菠萝、奇异果)展示了两种物理形态:上方是带皮、带刺或完整的“麻烦”状态,下方是去皮、切好摆盘的“享用”状态。这种水果实物的视觉变化构成了猫咪态度转变的直接理由。",
-"亮点类型": "实质",
-},
-{
-"聚类ID": "cluster_food_seafood_state",
-"聚类主题": "带壳与去壳的海鲜形态对比",
-"聚类描述": "这是该类图片的实质亮点。画面展示了海鲜(虾)的两种截然不同的物理状态:上方是带壳、难以直接食用的完整状态,下方是去壳后的纯肉状态。这种特定的海鲜处理细节差异是触发剧情的核心道具。",
-"亮点类型": "实质",
-"亮点列表": [
-{
-"图片名": "img_5",
-"亮点": {
-"合并结论": "状态迥异的虾肉特写",
-"结论描述": "这是一个实质主导的亮点。作为触发猫咪情绪变化的诱因,左侧展示的虾呈现出两种截然不同的物理状态:上方是带壳、带头、难以食用的整虾,下方是去壳、红润诱人的纯虾肉。这种视觉上的细节差异(带壳vs去壳)精准地传达了“懒人吃法”的笑点逻辑。",
-"亮点类型": "实质",
-"合并引用的数据": {
-"段落5.1.5:虾": {
-"实质": "带壳的整虾是构成对比逻辑的关键前提(因为有壳所以拒绝),是故事起因的核心视觉元素,其形态决定了猫咪的拒绝态度。",
-"形式": {
-"图像完整性": "0.85 - ‘完整带壳’的状态是该图像的关键特征,它与下半部分‘剥好的虾肉’形成鲜明对比,是理解猫咪拒绝(怕麻烦/不喜欢剥壳)笑点的核心视觉线索。",
-"图像内容": "0.86 - 作为画面的核心主体,这只完整的虾是表达‘不爱吃虾’这一主题的直接载体,是构成上半部分剧情的基础。"
-},
-"关系": {
-"段间关系-拒绝猫咪-其他关系-情境关联关系": "0.8 - 这是该段落最核心的关系特征。虾是猫咪拒绝动作的直接对象,这种互动关系构成了画面的主要叙事冲突和幽默点。",
-"段间关系-拒绝文字-其他关系-内容指向关系": "0.75 - 文字内容明确指代了画面中的虾,这种图文对应关系确保了观众能准确理解文字中“我不爱吃”所指的具体对象。"
-}
-},
-"段落5.2.5:去壳虾仁": {
-"实质": "去壳的虾仁是整个梗的“包袱”所在,视觉上的去壳状态直接触发了猫咪的态度转变,是理解“区别对待”逻辑的关键。",
-"形式": {
-"图像完整性": "0.91 - “去壳”这一特征是本图与上一张图(带壳虾)形成对比的关键,直接解释了猫咪态度转变的原因(喜欢吃但不喜欢剥壳),是叙事的视觉关键点。",
-"图像内容": "0.93 - 去壳虾仁的图像是该部分的核心视觉主体,直接对应下方文字“我爱吃”以及猫咪的喜爱反应,缺失后图片失去表意对象。"
-},
-"关系": {
-"段间关系-喜爱猫咪-其他关系-情境关联关系": "0.88 - 这是图片的核心逻辑,去壳虾仁是猫咪喜爱的直接对象,触发了猫咪渴望的表情,构成了表情包的笑点。",
-"段间关系-段落5.2.2-空间关系-定性-语义关联关系": "0.86 - 从语义上确认了虾仁是猫咪情感指向的目标,对理解图片叙事至关重要。"
-}
-}
-},
-"亮点ID": "img_5_hl_3"
-}
-}
-]
-},
-{
-"聚类主题": "拟人化的卡通手势贴纸",
-"聚类描述": "这是该类图片的实质亮点。画面中叠加了高饱和度的黄色Emoji手势物体(拒绝手势与捧手动作)。作为独立的视觉实体,这些卡通贴纸被赋予了物理意义,直观地替代了猫咪的前肢,生动地演绎了“拒绝”与“索要”的具体动作。",
-"亮点类型": "实质",
-},
-{
-"聚类主题": "跨次元的拼贴视觉风格",
-"聚类描述": "这是该类图片的形式亮点。图片采用了一种特定的视觉混合手法,将高写实的摄影素材(猫咪、背景)与扁平化或3D风格的卡通符号(Emoji)生硬地结合在一起。这种打破次元壁的拼贴风格增强了画面的互联网网感和荒诞趣味性。",
-"亮点类型": "形式",
-}
-]

+ 0 - 60
examples/feature_extract/aliduoduo/description/制作点.md

@@ -1,60 +0,0 @@
-{
-"元素ID": "元素1",
-"元素名称": "拒绝猫咪",
-"元素描述": "一只白色和橘色相间的猫咪,张大嘴巴,眼睛紧闭,表情夸张,呈现出拒绝或不喜欢的姿态。",
-"段落数量": 7,
-"段落列表": [
-"段落1.1.2",
-"段落2.1.2",
-"段落3.1.2",
-],
-"综合权重": 95.5
-},
-{
-"元素ID": "元素2",
-"元素名称": "喜爱猫咪",
-"元素描述": "一只白色和橘色相间的猫咪,脸颊鼓起,眼睛睁开,表情温顺,呈现出喜爱或期待的姿态。",
-"段落数量": 7,
-"段落列表": [
-"段落1.2.2",
-"段落2.2.2",
-"段落3.2.2",
-],
-"综合权重": 95.5
-},
-{
-"元素ID": "元素3",
-"元素名称": "拒绝手势",
-"元素描述": "一个黄色的卡通手势,拇指和食指伸出,其余手指握拳,表示拒绝或停止。",
-"段落数量": 7,
-"段落列表": [
-"段落1.1.3",
-"段落2.1.3",
-"段落3.1.3",
-],
-"综合权重": 92.5
-},
-{
-"元素ID": "元素4",
-"元素名称": "喜爱手势",
-"元素描述": "一对黄色的卡通手掌,掌心向上,手指微曲,表示喜爱、接受或欢迎。",
-"段落数量": 7,
-"段落列表": [
-"段落1.2.3",
-"段落2.2.3",
-"段落3.2.3",
-],
-"综合权重": 92.5
-},
-{
-"元素ID": "元素5",
-"元素名称": "手",
-"元素描述": "一只肤色白皙的手,掌心向上,手指微曲,呈现托举物品的姿态。",
-"段落数量": 14,
-"段落列表": [
-"段落1.1.4",
-"段落2.1.4",
-"段落3.1.4"
-],
-"综合权重": 88.0
-}

+ 0 - 336
examples/feature_extract/aliduoduo/description/阿里多多酱__img_1_制作表.json

@@ -1,336 +0,0 @@
-[
-  {
-    "名称": "表情包图片",
-    "描述": "一张分为上下两部分的表情包图片,上半部分表示拒绝,下半部分表示喜爱。",
-    "段落ID": "段落1",
-    "形式": {
-      "图像拼接": {
-        "名称": "图像拼接",
-        "描述": "图片由上下两部分拼接而成,上半部分(0,0到1200,400)和下半部分(0,400到1200,800)在垂直方向上紧密连接,形成一个完整的矩形图像。",
-        "类型": "图像布局",
-        "形式ID": "形式1",
-        "评分详情": {
-          "combined_score": 0.595
-        }
-      },
-      "评分详情": {
-        "combined_score": 0.616
-      }
-    },
-    "子段落": [
-      {
-        "名称": "上半部分",
-        "描述": "表示拒绝某种食物的场景。",
-        "段落ID": "段落1.1",
-        "形式": {
-          "图像拼接": {
-            "名称": "图像拼接",
-            "描述": "上半部分图片由文字、猫咪、拒绝手势、手和芒果五个元素合成。文字位于左上角,猫咪位于右侧,拒绝手势位于猫咪下方,手位于左下角,芒果位于手上方。所有元素均放置在白色背景上,形成一个统一的拒绝场景。",
-            "类型": "图像布局",
-            "形式ID": "形式1",
-            "评分详情": {
-              "combined_score": 0.518
-            }
-          },
-          "评分详情": {
-            "combined_score": 0.642
-          }
-        },
-        "子段落": [
-          {
-            "名称": "拒绝文字",
-            "描述": "表示拒绝的文字。",
-            "段落ID": "段落1.1.1",
-            "形式": {
-              "文字内容": {
-                "名称": "文字内容",
-                "描述": "文字内容为“我不爱吃芒果,谢谢”。",
-                "类型": "文字特征",
-                "形式ID": "形式2",
-                "评分详情": {
-                  "combined_score": 0.546
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.546
-              }
-            }
-          },
-          {
-            "名称": "拒绝猫咪",
-            "描述": "一只张大嘴巴,闭着眼睛,表现出拒绝表情的白色猫咪。",
-            "段落ID": "段落1.1.2",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只白色猫咪,头部和部分身体可见,面部表情为张大嘴巴打哈欠或发出拒绝的声音,眼睛紧闭,表现出明显的拒绝姿态。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.908
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "猫咪图像的背景是透明的,使其能够无缝地融入白色背景中。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "图像表情": {
-                "名称": "图像表情",
-                "描述": "猫咪的表情是张大嘴巴、闭着眼睛,呈现出拒绝、不情愿或厌恶的姿态。",
-                "类型": "图像特征",
-                "形式ID": "形式10",
-                "评分详情": {
-                  "combined_score": 0.95
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.975
-              }
-            }
-          },
-          {
-            "名称": "拒绝手势",
-            "描述": "一个黄色竖起大拇指表示拒绝的手势表情符号。",
-            "段落ID": "段落1.1.3",
-            "形式": {
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "手势图像的背景是透明的,使其能够无缝地融入白色背景中。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.385
-              }
-            }
-          },
-          {
-            "名称": "手",
-            "描述": "一只托举着食物的肤色手。",
-            "段落ID": "段落1.1.4",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只肤色手,手掌向上,呈托举状,手腕部分可见。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.927
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "手部图像的背景是透明的,使其能够无缝地融入白色背景中。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.245
-              }
-            }
-          },
-          {
-            "名称": "芒果",
-            "描述": "一个完整的黄色芒果。",
-            "段落ID": "段落1.1.5",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一个完整的黄色芒果,表面有细小的水珠。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.63
-                }
-              },
-              "图像颜色": {
-                "名称": "图像颜色",
-                "描述": "芒果的颜色为鲜亮的黄色,带有少量橙色渐变。",
-                "类型": "图像样式",
-                "形式ID": "形式6",
-                "评分详情": {
-                  "combined_score": 0.525
-                }
-              },
-              "图像完整性": {
-                "名称": "图像完整性",
-                "描述": "芒果呈现为完整的、未被切割的形态。",
-                "类型": "图像特征",
-                "形式ID": "形式4",
-                "评分详情": {
-                  "combined_score": 0.63
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.63
-              }
-            }
-          }
-        ]
-      },
-      {
-        "名称": "下半部分",
-        "描述": "表示喜爱某种食物的场景。",
-        "段落ID": "段落1.2",
-        "形式": {
-          "图像拼接": {
-            "名称": "图像拼接",
-            "描述": "下半部分图片由文字、猫咪、喜爱手势、手和芒果块五个元素合成。文字位于左上角,猫咪位于右侧,喜爱手势位于猫咪下方,手位于左下角,芒果块位于手上方。所有元素均放置在白色背景上,形成一个统一的喜爱场景。",
-            "类型": "图像布局",
-            "形式ID": "形式1",
-            "评分详情": {
-              "combined_score": 0.598
-            }
-          },
-          "评分详情": {
-            "combined_score": 0.73
-          }
-        },
-        "子段落": [
-          {
-            "名称": "喜爱文字",
-            "描述": "表示喜爱的文字。",
-            "段落ID": "段落1.2.1",
-            "形式": {
-              "文字内容": {
-                "名称": "文字内容",
-                "描述": "文字内容为“芒果!我爱吃!”。",
-                "类型": "文字特征",
-                "形式ID": "形式2",
-                "评分详情": {
-                  "combined_score": 0.56
-                }
-              },
-              "文字大小": {
-                "名称": "文字大小",
-                "描述": "文字高度约为100像素,宽度约为600像素,占据了段落1.2.1的整个区域。",
-                "类型": "文字样式",
-                "形式ID": "形式7",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.56
-              }
-            }
-          },
-          {
-            "名称": "喜爱猫咪",
-            "描述": "一只面带微笑,表情愉悦的白色猫咪。",
-            "段落ID": "段落1.2.2",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只白色猫咪,头部和部分身体可见,面部表情为微笑,眼睛微眯,嘴角上扬,表现出明显的喜爱和愉悦姿态。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.927
-                }
-              },
-              "图像表情": {
-                "名称": "图像表情",
-                "描述": "猫咪的表情是面带微笑,眼睛微眯,呈现出愉悦、喜爱和满足的姿态。",
-                "类型": "图像特征",
-                "形式ID": "形式10",
-                "评分详情": {
-                  "combined_score": 0.95
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.972
-              }
-            }
-          },
-          {
-            "名称": "喜爱手势",
-            "描述": "一个黄色合拢表示喜爱的双手手势表情符号。",
-            "段落ID": "段落1.2.3",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.385
-              }
-            }
-          },
-          {
-            "名称": "手",
-            "描述": "一只托举着食物的肤色手。",
-            "段落ID": "段落1.2.4",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只肤色手,手掌向上,呈托举状,手腕部分可见。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.927
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "手部图像的背景是透明的,使其能够无缝地融入白色背景中。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.245
-              }
-            }
-          },
-          {
-            "名称": "芒果块",
-            "描述": "一碗切好的芒果块。",
-            "段落ID": "段落1.2.5",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一碗切好的芒果块,芒果块呈不规则的立方体状,堆叠在碗中。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.644
-                }
-              },
-              "图像颜色": {
-                "名称": "图像颜色",
-                "描述": "芒果块的颜色为鲜亮的黄色,碗的颜色为纯白色。",
-                "类型": "图像样式",
-                "形式ID": "形式6",
-                "评分详情": {
-                  "combined_score": 0.525
-                }
-              },
-              "图像容器": {
-                "名称": "图像容器",
-                "描述": "芒果块被盛放在一个白色的、方形的、带有一定深度的碗状容器中。",
-                "类型": "图像布局",
-                "形式ID": "形式16",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.644
-              }
-            }
-          }
-        ]
-      }
-    ]
-  }
-]

+ 0 - 300
examples/feature_extract/aliduoduo/description/阿里多多酱__img_2_制作表.json

@@ -1,300 +0,0 @@
-[
-  {
-    "名称": "表情包图片",
-    "描述": "一张分为上下两部分的表情包图片,上半部分表示拒绝,下半部分表示喜爱。",
-    "段落ID": "段落2",
-    "形式": {
-      "图像拼接": {
-        "名称": "图像拼接",
-        "描述": "图像由上下两部分拼接而成,上半部分(0,0,1200,400)和下半部分(0,400,1200,800)在垂直方向上紧密连接,共同构成一个完整的800x1200像素的图像。",
-        "类型": "图像布局",
-        "形式ID": "形式1",
-        "评分详情": {
-          "combined_score": 0.626
-        }
-      },
-      "图像背景透明": {
-        "名称": "图像背景透明",
-        "描述": "图像的背景为纯白色,所有前景元素(文字、猫咪、手、榴莲、手势)均被抠图并叠加在白色背景上,背景区域无任何图案或纹理。",
-        "类型": "图像样式",
-        "形式ID": "形式5",
-        "评分详情": {
-          "combined_score": 0.451
-        }
-      },
-      "评分详情": {
-        "combined_score": 0.74
-      }
-    },
-    "子段落": [
-      {
-        "名称": "上半部分",
-        "描述": "表示拒绝某种食物的场景。",
-        "段落ID": "段落2.1",
-        "形式": {
-          "评分详情": {
-            "combined_score": 0.541
-          }
-        },
-        "子段落": [
-          {
-            "名称": "拒绝文字",
-            "描述": "表示拒绝的文字。",
-            "段落ID": "段落2.1.1",
-            "形式": {
-              "文字内容": {
-                "名称": "文字内容",
-                "描述": "文字内容为“我 不爱吃榴莲,谢谢”。",
-                "类型": "文字特征",
-                "形式ID": "形式2",
-                "评分详情": {
-                  "combined_score": 0.504
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.504
-              }
-            }
-          },
-          {
-            "名称": "拒绝猫咪",
-            "描述": "一只张大嘴巴,闭着眼睛,表现出拒绝表情的白色猫咪。",
-            "段落ID": "段落2.1.2",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只白色猫咪,头部和部分身体可见,面部表情为张大嘴巴,闭着眼睛,表现出明显的拒绝和厌恶。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.758
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "猫咪图像的背景被完全移除,只保留猫咪主体,边缘清晰,无背景残留。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "图像表情": {
-                "名称": "图像表情",
-                "描述": "猫咪的表情为拒绝和厌恶,通过张大的嘴巴和紧闭的眼睛来表现。",
-                "类型": "图像特征",
-                "形式ID": "形式10",
-                "评分详情": {
-                  "combined_score": 0.874
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.886
-              }
-            }
-          },
-          {
-            "名称": "拒绝手势",
-            "描述": "一个黄色竖起大拇指表示拒绝的手势表情符号。",
-            "段落ID": "段落2.1.3",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.385
-              }
-            }
-          },
-          {
-            "名称": "手",
-            "描述": "一只托举着食物的肤色手。",
-            "段落ID": "段落2.1.4",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.28
-              }
-            }
-          },
-          {
-            "名称": "榴莲",
-            "描述": "一个完整的带刺榴莲。",
-            "段落ID": "段落2.1.5",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一个完整的榴莲,表面布满尖刺,呈椭圆形。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.616
-                }
-              },
-              "图像完整性": {
-                "名称": "图像完整性",
-                "描述": "榴莲图像呈现为一个完整的、未被剥开的榴莲果实。",
-                "类型": "图像特征",
-                "形式ID": "形式4",
-                "评分详情": {
-                  "combined_score": 0.595
-                }
-              },
-              "图像纹理": {
-                "名称": "图像纹理",
-                "描述": "榴莲表面具有清晰可见的尖刺纹理,质感粗糙。",
-                "类型": "图像样式",
-                "形式ID": "形式15",
-                "评分详情": {
-                  "combined_score": 0.504
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.616
-              }
-            }
-          }
-        ]
-      },
-      {
-        "名称": "下半部分",
-        "描述": "表示喜爱某种食物的场景。",
-        "段落ID": "段落2.2",
-        "形式": {
-          "评分详情": {
-            "combined_score": 0.465
-          }
-        },
-        "子段落": [
-          {
-            "名称": "喜爱文字",
-            "描述": "表示喜爱的文字。",
-            "段落ID": "段落2.2.1",
-            "形式": {
-              "文字内容": {
-                "名称": "文字内容",
-                "描述": "文字内容为“榴莲! 我爱吃!”。",
-                "类型": "文字特征",
-                "形式ID": "形式2",
-                "评分详情": {
-                  "combined_score": 0.525
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.532
-              }
-            }
-          },
-          {
-            "名称": "喜爱猫咪",
-            "描述": "一只面带微笑,表情愉悦的白色猫咪。",
-            "段落ID": "段落2.2.2",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只白色猫咪,头部和部分身体可见,面部表情为面带微笑,眼睛微眯,表现出愉悦和喜爱的神情。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.824
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "猫咪图像的背景被完全移除,只保留猫咪主体,边缘清晰,无背景残留。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "图像表情": {
-                "名称": "图像表情",
-                "描述": "猫咪的表情为愉悦和喜爱,通过微笑的嘴巴和微眯的眼睛来表现。",
-                "类型": "图像特征",
-                "形式ID": "形式10",
-                "评分详情": {
-                  "combined_score": 0.855
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.888
-              }
-            }
-          },
-          {
-            "名称": "喜爱手势",
-            "描述": "一个黄色合拢表示喜爱的双手手势表情符号。",
-            "段落ID": "段落2.2.3",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.378
-              }
-            }
-          },
-          {
-            "名称": "手",
-            "描述": "一只托举着食物的肤色手。",
-            "段落ID": "段落2.2.4",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只肤色手,手掌向上,呈托举状,手腕部分被截断。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.824
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "手部图像的背景被完全移除,只保留手部主体,边缘清晰,无背景残留。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.451
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.245
-              }
-            }
-          },
-          {
-            "名称": "榴莲果肉",
-            "描述": "几块剥开的榴莲果肉。",
-            "段落ID": "段落2.2.5",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是几块剥开的榴莲果肉,果肉呈黄色,形状不规则。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.63
-                }
-              },
-              "图像颜色": {
-                "名称": "图像颜色",
-                "描述": "榴莲果肉的颜色为鲜亮的黄色,部分区域有白色纤维。",
-                "类型": "图像样式",
-                "形式ID": "形式6",
-                "评分详情": {
-                  "combined_score": 0.525
-                }
-              },
-              "图像完整性": {
-                "名称": "图像完整性",
-                "描述": "榴莲果肉图像呈现为几块已经剥开的果肉,而非完整的榴莲果实。",
-                "类型": "图像特征",
-                "形式ID": "形式4",
-                "评分详情": {
-                  "combined_score": 0.595
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.63
-              }
-            }
-          }
-        ]
-      }
-    ]
-  }
-]

+ 0 - 309
examples/feature_extract/aliduoduo/description/阿里多多酱__img_3_制作表.json

@@ -1,309 +0,0 @@
-[
-  {
-    "名称": "表情包图片",
-    "描述": "一张分为上下两部分的表情包图片,上半部分表示拒绝,下半部分表示喜爱。",
-    "段落ID": "段落3",
-    "形式": {
-      "图像拼接": {
-        "名称": "图像拼接",
-        "描述": "图片由上下两部分拼接而成,上半部分(0,0,1200,400)和下半部分(0,400,1200,800)在垂直方向上紧密连接,形成一个完整的矩形图像。",
-        "类型": "图像布局",
-        "形式ID": "形式1",
-        "评分详情": {
-          "combined_score": 0.595
-        }
-      },
-      "评分详情": {
-        "combined_score": 0.751
-      }
-    },
-    "子段落": [
-      {
-        "名称": "上半部分",
-        "描述": "表示拒绝某种食物的场景。",
-        "段落ID": "段落3.1",
-        "形式": {
-          "图像拼接": {
-            "名称": "图像拼接",
-            "描述": "上半部分图片由文字(0,0,600,100)、拒绝猫咪(600,100,1200,400)、拒绝手势(600,300,750,400)、手(0,200,400,400)和菠萝(100,100,400,300)等元素组合而成,这些元素在白色背景上自由排布,没有严格的网格或对齐规则,形成一个表达拒绝主题的场景。",
-            "类型": "图像布局",
-            "形式ID": "形式1",
-            "评分详情": {
-              "combined_score": 0.476
-            }
-          },
-          "评分详情": {
-            "combined_score": 0.674
-          }
-        },
-        "子段落": [
-          {
-            "名称": "拒绝文字",
-            "描述": "表示拒绝的文字。",
-            "段落ID": "段落3.1.1",
-            "形式": {
-              "文字内容": {
-                "名称": "文字内容",
-                "描述": "文字内容为“我不爱吃菠萝,谢谢”。",
-                "类型": "文字特征",
-                "形式ID": "形式2",
-                "评分详情": {
-                  "combined_score": 0.546
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.546
-              }
-            }
-          },
-          {
-            "名称": "拒绝猫咪",
-            "描述": "一只张大嘴巴,闭着眼睛,表现出拒绝表情的白色猫咪。",
-            "段落ID": "段落3.1.2",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只白色猫咪的头部特写,猫咪的毛发蓬松,眼睛紧闭,嘴巴张大,露出粉色的口腔和舌头,整体姿态表现出强烈的拒绝或厌恶。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.894
-                }
-              },
-              "图像表情": {
-                "名称": "图像表情",
-                "描述": "猫咪的表情是夸张的拒绝或厌恶,通过紧闭的眼睛和张大的嘴巴来表现,具有强烈的喜剧效果。",
-                "类型": "图像特征",
-                "形式ID": "形式10",
-                "评分详情": {
-                  "combined_score": 0.898
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.937
-              }
-            }
-          },
-          {
-            "名称": "拒绝手势",
-            "描述": "一个黄色竖起大拇指表示拒绝的手势表情符号。",
-            "段落ID": "段落3.1.3",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.315
-              }
-            }
-          },
-          {
-            "名称": "手",
-            "描述": "一只托举着食物的肤色手。",
-            "段落ID": "段落3.1.4",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只肤色手掌,手掌向上摊开,手指微微弯曲,呈托举状,手腕部分被截断。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.894
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "手部图像的背景被完全移除,手部主体被精确抠出,边缘清晰,与白色背景无缝融合。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.245
-              }
-            }
-          },
-          {
-            "名称": "菠萝",
-            "描述": "一个完整的菠萝。",
-            "段落ID": "段落3.1.5",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一个完整的菠萝,带有绿色的冠芽和金黄色的果实,果实表面有明显的网格状纹理和突起的“眼睛”。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.623
-                }
-              },
-              "图像颜色": {
-                "名称": "图像颜色",
-                "描述": "菠萝果实主体呈金黄色(近似RGB: 255,192,0),冠芽为深绿色(近似RGB: 0,128,0)。",
-                "类型": "图像样式",
-                "形式ID": "形式6",
-                "评分详情": {
-                  "combined_score": 0.504
-                }
-              },
-              "图像完整性": {
-                "名称": "图像完整性",
-                "描述": "菠萝图像呈现的是一个未经切割、完整的菠萝果实,包括果肉和冠芽。",
-                "类型": "图像特征",
-                "形式ID": "形式4",
-                "评分详情": {
-                  "combined_score": 0.616
-                }
-              },
-              "图像纹理": {
-                "名称": "图像纹理",
-                "描述": "菠萝果实表面具有清晰的网格状纹理,每个网格中心有突起的褐色小点,冠芽部分有细长的叶片纹理。",
-                "类型": "图像样式",
-                "形式ID": "形式15",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.623
-              }
-            }
-          }
-        ]
-      },
-      {
-        "名称": "下半部分",
-        "描述": "表示喜爱某种食物的场景。",
-        "段落ID": "段落3.2",
-        "形式": {
-          "图像拼接": {
-            "名称": "图像拼接",
-            "描述": "下半部分图片由文字(0,400,600,500)、喜爱猫咪(600,500,1200,800)、喜爱手势(600,700,750,800)、手(0,600,400,800)和菠萝块(100,500,400,700)等元素组合而成,这些元素在白色背景上自由排布,没有严格的网格或对齐规则,形成一个表达喜爱主题的场景。",
-            "类型": "图像布局",
-            "形式ID": "形式1",
-            "评分详情": {
-              "combined_score": 0.49
-            }
-          },
-          "评分详情": {
-            "combined_score": 0.662
-          }
-        },
-        "子段落": [
-          {
-            "名称": "喜爱文字",
-            "描述": "表示喜爱的文字。",
-            "段落ID": "段落3.2.1",
-            "形式": {
-              "文字内容": {
-                "名称": "文字内容",
-                "描述": "文字内容为“菠萝!我爱吃!”。",
-                "类型": "文字特征",
-                "形式ID": "形式2",
-                "评分详情": {
-                  "combined_score": 0.56
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.567
-              }
-            }
-          },
-          {
-            "名称": "喜爱猫咪",
-            "描述": "一只面带微笑,表情愉悦的白色猫咪。",
-            "段落ID": "段落3.2.2",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一只白色猫咪的头部特写,猫咪的毛发蓬松,眼睛半睁,嘴角上扬,露出微笑的表情,整体姿态表现出愉悦和喜爱。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.852
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "猫咪图像的背景被完全移除,猫咪主体被精确抠出,边缘清晰,与白色背景无缝融合。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.42
-                }
-              },
-              "图像表情": {
-                "名称": "图像表情",
-                "描述": "猫咪的表情是愉悦和喜爱,通过半睁的眼睛和上扬的嘴角来表现,具有可爱的喜剧效果。",
-                "类型": "图像特征",
-                "形式ID": "形式10",
-                "评分详情": {
-                  "combined_score": 0.929
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.951
-              }
-            }
-          },
-          {
-            "名称": "喜爱手势",
-            "描述": "一个黄色合拢表示喜爱的双手手势表情符号。",
-            "段落ID": "段落3.2.3",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.336
-              }
-            }
-          },
-          {
-            "名称": "手",
-            "描述": "一只托举着食物的肤色手。",
-            "段落ID": "段落3.2.4",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.336
-              }
-            }
-          },
-          {
-            "名称": "菠萝块",
-            "描述": "一碗切好的菠萝块。",
-            "段落ID": "段落3.2.5",
-            "形式": {
-              "图像内容": {
-                "名称": "图像内容",
-                "描述": "图像内容是一个透明玻璃碗中盛放着切好的菠萝块,菠萝块呈不规则的块状,颜色金黄,表面湿润。",
-                "类型": "图像特征",
-                "形式ID": "形式3",
-                "评分详情": {
-                  "combined_score": 0.616
-                }
-              },
-              "图像背景透明": {
-                "名称": "图像背景透明",
-                "描述": "菠萝块和碗的图像背景被完全移除,主体被精确抠出,边缘清晰,与白色背景无缝融合。",
-                "类型": "图像样式",
-                "形式ID": "形式5",
-                "评分详情": {
-                  "combined_score": 0.406
-                }
-              },
-              "图像颜色": {
-                "名称": "图像颜色",
-                "描述": "菠萝块呈金黄色(近似RGB: 255,215,0),玻璃碗呈透明无色。",
-                "类型": "图像样式",
-                "形式ID": "形式6",
-                "评分详情": {
-                  "combined_score": 0.525
-                }
-              },
-              "评分详情": {
-                "combined_score": 0.616
-              }
-            }
-          }
-        ]
-      }
-    ]
-  }
-]

+ 0 - 68
examples/feature_extract/aliduoduo/index.md

@@ -1,68 +0,0 @@
-# 阿里多多酱 — 内容还原素材索引
-
-> 本目录包含一组猫咪表情包帖子的解构数据,用于驱动 AI 还原出与原帖视觉一致的图片。
-> 还原思路:先理解制作亮点和制作点(做什么),再深入制作表(怎么做)。
-
----
-
-## 目录结构
-
-```
-aliduoduo/
-└── descriptions/
-    ├── 制作亮点.md              # ★ 最重要 — 5 组视觉亮点聚类,定义还原优先级
-    ├── 制作点.md                # ★ 最重要 — 5 个核心制作元素及权重排序
-    ├── 创作表.md                # 原帖创作视角描述(当前为空)
-    ├── 阿里多多酱__img_1_制作表.json  # img_1 详细制作表(芒果主题)
-    ├── 阿里多多酱__img_2_制作表.json  # img_2 详细制作表(榴莲主题)
-    └── 阿里多多酱__img_3_制作表.json  # img_3 详细制作表(菠萝主题)
-```
-
-当前无 features/ 目录(无多模态特征素材)。
-
----
-
-## 第一层:制作亮点与制作点(还原优先级)
-
-### 制作亮点(`descriptions/制作亮点.md`)
-
-5 组视觉亮点聚类,分为实质亮点和形式亮点:
-
-| 亮点聚类                 | 类型 | 核心描述                                     |
-| ------------------------ | ---- | -------------------------------------------- |
-| 极具反差的猫咪神态       | 实质 | 上方张嘴抗拒 vs 下方乖巧期待,拟人化情绪表演 |
-| 加工前后的水果形态对比   | 实质 | 带皮完整状态 vs 去皮切好状态,态度转变的诱因 |
-| 带壳与去壳的海鲜形态对比 | 实质 | 带壳整虾 vs 去壳虾仁,特定于 img_5           |
-| 拟人化的卡通手势贴纸     | 实质 | 黄色 Emoji 手势替代猫咪前肢,演绎拒绝与索要  |
-| 纵向二分的对比叙事构图   | 形式 | Meme 经典垂直双分栏,拒绝 vs 接受的二元对立  |
-| 跨次元的拼贴视觉风格     | 形式 | 写实摄影素材与扁平卡通符号的混搭拼贴         |
-
-### 制作点(`descriptions/制作点.md`)
-
-按权重排序的 5 个核心制作元素:
-
-| 制作元素 | 权重 | 说明                                 |
-| -------- | ---- | ------------------------------------ |
-| 拒绝猫咪 | 95.5 | 白橘猫,张嘴闭眼,夸张抗拒表情       |
-| 喜爱猫咪 | 95.5 | 白橘猫,鼓腮睁眼,温顺期待表情       |
-| 拒绝手势 | 92.5 | 黄色卡通手势,拇指食指伸出,表示拒绝 |
-| 喜爱手势 | 92.5 | 黄色卡通手掌,掌心向上,表示接受     |
-| 手       | 88.0 | 肤色白皙的手,掌心向上,托举物品姿态 |
-
----
-
-## 第二层:制作表(还原的详细蓝图)
-
-每张图有一个 JSON 制作表,包含:
-
-- 上下两部分的分层段落结构(拒绝场景 / 喜爱场景)
-- 每个元素的形式参数(图像拼接、布局、色彩等)
-- 每个层级的综合评分
-
-### 3 张图概览
-
-| 图片  | 主题食物 | 核心结构                                      |
-| ----- | -------- | --------------------------------------------- |
-| img_1 | 芒果     | 上:带皮芒果+拒绝猫咪 / 下:切好芒果+喜爱猫咪 |
-| img_2 | 榴莲     | 上:带壳榴莲+拒绝猫咪 / 下:榴莲果肉+喜爱猫咪 |
-| img_3 | 菠萝     | 上:带皮菠萝+拒绝猫咪 / 下:切好菠萝+喜爱猫咪 |

+ 0 - 61
examples/feature_extract/config.py

@@ -1,61 +0,0 @@
-"""
-项目配置
-
-定义项目的运行配置。
-"""
-
-from agent.core.runner import KnowledgeConfig, RunConfig
-
-
-# ===== Agent 运行配置 =====
-
-RUN_CONFIG = RunConfig(
-    # 模型配置
-    model="qwen3.5-plus",
-    temperature=0.3,
-    max_iterations=1000,
-
-    # 任务名称
-    name="内容解构",
-
-    # 知识管理配置
-    knowledge=KnowledgeConfig(
-        # 压缩时提取(消息量超阈值触发压缩时,用完整 history 反思)
-        enable_extraction=True,
-        reflect_prompt="",  # 自定义反思 prompt;空则使用默认,见 agent/core/prompts/knowledge.py:REFLECT_PROMPT
-
-        # agent运行完成后提取(不代表任务完成,agent 可能中途退出等待人工评估)
-        enable_completion_extraction=True,
-        completion_reflect_prompt="",  # 自定义复盘 prompt;空则使用默认,见 agent/core/prompts/knowledge.py:COMPLETION_REFLECT_PROMPT
-
-        # 知识注入(agent切换当前工作的goal时,自动注入相关知识)
-        enable_injection=True,
-
-        # 默认字段(保存/搜索时自动注入)
-        owner="srt_feature_extract_1",  # 所有者(空则尝试从 git config user.email 获取,再空则用 agent:{agent_id})
-        default_tags={"project": "feature_extract"},  # 默认 tags(会与工具调用参数合并)
-        default_scopes=["org:cybertogether"],  # 默认 scopes
-        default_search_types=["tool", "usecase", "definition"],  # 默认搜索类型过滤
-        default_search_owner="srt_feature_extract_1"  # 默认搜索 owner 过滤(空则不过滤)
-    )
-)
-
-
-# ===== 任务配置 =====
-
-INPUT_DIR = "examples/feature_extract/huahua"        # 输入素材目录
-OUTPUT_DIR = "examples/feature_extract/huahua/output"  # 输出目录,直接保存在输入目录内
-
-
-# ===== 基础设施配置 =====
-
-SKILLS_DIR = "./skills"
-TRACE_STORE_PATH = ".trace"
-DEBUG = True
-LOG_LEVEL = "INFO"
-LOG_FILE = None  # 设置为文件路径可以同时输出到文件
-
-# ===== 浏览器配置 =====
-# 可选值: "cloud" (云浏览器) 或 "local" (本地浏览器) 或 "container" (容器浏览器,支持预配置账户)
-BROWSER_TYPE = "container"
-HEADLESS = True

+ 0 - 369
examples/feature_extract/huahua/descriptions/写生油画__img_1_制作表.json

@@ -1,369 +0,0 @@
-[
-  {
-    "名称": "户外绘画场景",
-    "描述": "一名女性在户外草地上使用画架和调色板进行绘画,背景是绿色的树木和草地。",
-    "段落ID": "段落1",
-    "形式": {
-      "拍摄角度": {
-        "名称": "拍摄角度",
-        "描述": "相机位于人物右后方,略低于人物视线,以平视偏低的视角拍摄,使得人物和画架占据画面右侧和中央,背景的草地和树木在左侧和上方。",
-        "类型": "视角",
-        "形式ID": "形式5"
-      },
-      "景别": {
-        "名称": "景别",
-        "描述": "中景,画面中人物从腰部以上到头部完整呈现,画架大部分可见,背景的树木和草地也占据了较大比例,强调了人物与环境的互动。",
-        "类型": "构图",
-        "形式ID": "形式7"
-      },
-      "光照": {
-        "名称": "光照",
-        "描述": "自然光,光线柔和,从画面左上方照射,在人物的右侧和画架的左侧形成轻微阴影,整体画面亮度适中,无明显过曝或欠曝区域。",
-        "类型": "光影",
-        "形式ID": "形式2"
-      },
-      "色彩饱和度": {
-        "名称": "色彩饱和度",
-        "描述": "整体色彩饱和度中等偏高,绿色草地和树木的颜色鲜明,人物白色服装和调色板上的颜料色彩也较为突出,画面整体呈现出清新自然的色调。",
-        "类型": "色彩",
-        "形式ID": "形式11"
-      },
-      "清晰度": {
-        "名称": "清晰度",
-        "描述": "画面中心区域(人物、画架、画布)清晰度高,细节锐利可见。背景的树木和远处的草地有轻微虚化,呈现出景深效果。",
-        "类型": "清晰度",
-        "形式ID": "形式1"
-      },
-      "构图": {
-        "名称": "构图",
-        "描述": "采用开放式构图,人物和画架位于画面右侧偏中,占据了画面约60%的区域,背景的草地和树木占据左侧和上方约40%的区域。人物的视线和绘画动作引导观众看向画布,形成视觉焦点。画面整体平衡,右侧主体突出,左侧背景延伸。",
-        "类型": "构图",
-        "形式ID": "形式4"
-      },
-      "评分详情": {
-        "combined_score": 0.846
-      }
-    },
-    "子段落": [
-      {
-        "名称": "人物",
-        "描述": "一名女性,侧身背对镜头,正在进行绘画。",
-        "段落ID": "段落1.1",
-        "形式": {
-          "拍摄角度": {
-            "名称": "拍摄角度",
-            "描述": "人物侧身背对镜头,头部略微向左转,使得右耳和部分右脸颊可见。身体朝向画布,呈现出专注绘画的姿态。",
-            "类型": "视角",
-            "形式ID": "形式5"
-          },
-          "景别": {
-            "名称": "景别",
-            "描述": "人物从头部到脚部完整呈现,占据画面右侧约60%的区域,属于全身景别。",
-            "类型": "构图",
-            "形式ID": "形式7"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "人物右侧受光,左侧(背对镜头一侧)有轻微阴影,光线柔和,使得服装的褶皱和头发的细节清晰可见。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "色彩饱和度": {
-            "名称": "色彩饱和度",
-            "描述": "人物的头发、肤色和白色服装的色彩饱和度适中,与背景的绿色形成对比,突出人物主体。",
-            "类型": "色彩",
-            "形式ID": "形式11"
-          },
-          "清晰度": {
-            "名称": "清晰度",
-            "描述": "人物主体清晰度高,头发丝、服装纹理、手部细节均清晰可见。",
-            "类型": "清晰度",
-            "形式ID": "形式1"
-          },
-          "构图": {
-            "名称": "构图",
-            "描述": "人物位于画面右侧,从画面顶部延伸至底部,占据了画面约60%的垂直空间,形成视觉上的引导线,将观众的注意力引向画布。",
-            "类型": "构图",
-            "形式ID": "形式4"
-          },
-          "评分详情": {
-            "combined_score": 0.745
-          }
-        },
-        "子段落": [
-          {
-            "名称": "头发",
-            "描述": "棕色长发,部分散落在肩上。",
-            "段落ID": "段落1.1.1",
-            "形式": {
-              "发色": {
-                "名称": "发色",
-                "描述": "棕色,呈现出自然光泽的深棕色,在光照下略显浅棕。",
-                "类型": "色彩",
-                "形式ID": "形式23"
-              },
-              "发型": {
-                "名称": "发型",
-                "描述": "长发,直发,部分散落在右肩和背部,发尾略有卷曲,发际线清晰可见。",
-                "类型": "形态",
-                "形式ID": "形式21"
-              },
-              "评分详情": {
-                "combined_score": 0.504
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.525
-            }
-          },
-          {
-            "名称": "身体",
-            "描述": "女性的躯干和手臂。",
-            "段落ID": "段落1.1.2",
-            "形式": {
-              "姿态": {
-                "名称": "姿态",
-                "描述": "女性身体略微前倾,右臂抬起握持画笔,左臂弯曲握持调色板,头部转向画布,呈现出专注绘画的动态姿态。",
-                "类型": "动作",
-                "形式ID": "形式8"
-              },
-              "清晰度": {
-                "名称": "清晰度",
-                "描述": "身体部分(手臂、手、颈部)清晰度高,皮肤纹理和服装褶皱细节锐利。",
-                "类型": "清晰度",
-                "形式ID": "形式1"
-              },
-              "光照": {
-                "名称": "光照",
-                "描述": "身体右侧受光,左侧有轻微阴影,光线均匀柔和,突出了身体的轮廓和服装的立体感。",
-                "类型": "光影",
-                "形式ID": "形式2"
-              },
-              "评分详情": {
-                "combined_score": 0.588
-              }
-            },
-            "子段落": [
-              {
-                "名称": "服装",
-                "描述": "白色长裙,袖子宽松。",
-                "段落ID": "段落1.1.2.1",
-                "形式": {
-                  "服装颜色": {
-                    "名称": "服装颜色",
-                    "描述": "纯白色,无其他图案或颜色。",
-                    "类型": "色彩",
-                    "形式ID": "形式16"
-                  },
-                  "服装款式": {
-                    "名称": "服装款式",
-                    "描述": "长袖连衣裙,袖子宽松,裙摆飘逸,腰部有收紧设计,领口为V字形,背部有系带细节。",
-                    "类型": "形态",
-                    "形式ID": "形式14"
-                  },
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "轻薄的棉麻或丝绸质地,具有良好的垂坠感和透气性。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.835
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.847
-                }
-              },
-              {
-                "名称": "画笔",
-                "描述": "女性右手握持的细长画笔。",
-                "段落ID": "段落1.1.2.2",
-                "形式": {
-                  "形状": {
-                    "名称": "形状",
-                    "描述": "细长杆状,笔尖为锥形,笔杆中部略粗。",
-                    "类型": "形状",
-                    "形式ID": "形式17"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.42
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.56
-                }
-              },
-              {
-                "名称": "调色板",
-                "描述": "女性左手握持的椭圆形调色板,上面有多种颜料。",
-                "段落ID": "段落1.1.2.3",
-                "形式": {
-                  "形状": {
-                    "名称": "形状",
-                    "描述": "不规则椭圆形,边缘圆润,中间有一个拇指孔。",
-                    "类型": "形状",
-                    "形式ID": "形式17"
-                  },
-                  "颜色": {
-                    "名称": "颜色",
-                    "描述": "调色板底色为深棕色,表面沾有多种颜料,包括绿色、蓝色、白色、粉色、黄色、红色等,其中绿色颜料面积最大。",
-                    "类型": "色彩",
-                    "形式ID": "形式3"
-                  },
-                  "颜料分布": {
-                    "名称": "颜料分布",
-                    "描述": "颜料呈不规则块状分布在调色板表面,绿色颜料集中在中央区域,其他颜色颜料散布在边缘。",
-                    "类型": "布局",
-                    "形式ID": "形式25"
-                  },
-                  "清晰度": {
-                    "名称": "清晰度",
-                    "描述": "调色板的木质纹理和颜料的堆叠感清晰可见。",
-                    "类型": "清晰度",
-                    "形式ID": "形式1"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.644
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.675
-                }
-              }
-            ],
-            "评分详情": {
-              "combined_score": 0.595
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.815
-        }
-      },
-      {
-        "名称": "画架",
-        "描述": "木质三脚画架,支撑着画布。",
-        "段落ID": "段落1.2",
-        "形式": {
-          "评分详情": {
-            "combined_score": 0.442
-          }
-        },
-        "子段落": [
-          {
-            "名称": "画布",
-            "描述": "画架上的一幅未完成的画作,描绘了一名背对镜头的女性。",
-            "段落ID": "段落1.2.1",
-            "形式": {
-              "绘画风格": {
-                "名称": "绘画风格",
-                "描述": "印象派风格,笔触粗犷,色彩鲜明,注重光影和氛围的表达,而非精确的细节描绘。",
-                "类型": "风格",
-                "形式ID": "形式27"
-              },
-              "色彩": {
-                "名称": "色彩",
-                "描述": "画面以绿色和蓝色为主色调,描绘了草地和花丛,人物服装为白色,色彩对比鲜明。",
-                "类型": "色彩",
-                "形式ID": "形式28"
-              },
-              "构图": {
-                "名称": "构图",
-                "描述": "画布中央偏下位置描绘了一名背对镜头的女性,周围是绿色的草地和蓝色的花朵,形成了一个景深感较强的画面。",
-                "类型": "构图",
-                "形式ID": "形式4"
-              },
-              "清晰度": {
-                "名称": "清晰度",
-                "描述": "画布上的画作清晰可见,但由于绘画风格,细节并非写实般锐利,而是呈现出笔触的模糊感。",
-                "类型": "清晰度",
-                "形式ID": "形式1"
-              },
-              "笔触": {
-                "名称": "笔触",
-                "描述": "笔触粗犷有力,颜料堆叠感明显,尤其是绿色和蓝色区域,呈现出明显的纹理。",
-                "类型": "笔触",
-                "形式ID": "形式29"
-              },
-              "内容主题": {
-                "名称": "内容主题",
-                "描述": "描绘了一名身穿白色裙子的女性在户外草地或花丛中行走的背影,与现实场景中的画家形成一种“画中画”的呼应。",
-                "类型": "内容",
-                "形式ID": "形式26"
-              },
-              "评分详情": {
-                "combined_score": 0.946
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.958
-            }
-          },
-          {
-            "名称": "玫瑰花",
-            "描述": "画架下方放置的一朵白色玫瑰花。",
-            "段落ID": "段落1.2.2",
-            "形式": {
-              "清晰度": {
-                "名称": "清晰度",
-                "描述": "玫瑰花的花瓣纹理和叶片细节清晰可见,边缘锐利。",
-                "类型": "清晰度",
-                "形式ID": "形式1"
-              },
-              "评分详情": {
-                "combined_score": 0.318
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.342
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.588
-        }
-      },
-      {
-        "名称": "背景",
-        "描述": "远处的绿色树木和近处的草地。",
-        "段落ID": "段落1.3",
-        "形式": {
-          "颜色": {
-            "名称": "颜色",
-            "描述": "背景以绿色为主,包括深绿色(树木)和浅绿色(草地),色彩鲜明且富有层次感。",
-            "类型": "色彩",
-            "形式ID": "形式3"
-          },
-          "清晰度": {
-            "名称": "清晰度",
-            "描述": "近处草地清晰度较高,远处树木和更远的背景有明显虚化,呈现出景深效果。",
-            "类型": "清晰度",
-            "形式ID": "形式1"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "背景整体受光均匀,树木和草地有自然的光影变化,无明显过曝或欠曝区域。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "景深": {
-            "名称": "景深",
-            "描述": "景深较浅,前景(人物和画架)清晰,中景(近处草地)清晰,远景(树木)虚化,营造出空间层次感。",
-            "类型": "空间",
-            "形式ID": "形式9"
-          },
-          "评分详情": {
-            "combined_score": 0.595
-          }
-        },
-        "评分详情": {
-          "combined_score": 0.703
-        }
-      }
-    ],
-    "评分详情": {
-      "combined_score": 0.78
-    }
-  }
-]

+ 0 - 338
examples/feature_extract/huahua/descriptions/写生油画__img_2_制作表.json

@@ -1,338 +0,0 @@
-[
-  {
-    "名称": "户外绘画场景",
-    "描述": "一名女性在户外草地上使用画架和调色板进行绘画,背景是绿色的树木和阳光。",
-    "段落ID": "段落2",
-    "形式": {
-      "拍摄角度": {
-        "名称": "拍摄角度",
-        "描述": "从人物背后的中低角度拍摄,视线略微向上倾斜,将人物、画架和背景的树木都纳入画面,人物的头部位于画面顶部偏左,画架位于画面右侧,背景的树木和天空占据画面上半部分。",
-        "类型": "视角",
-        "形式ID": "形式5"
-      },
-      "景别": {
-        "名称": "景别",
-        "描述": "中景,画面中人物从腰部以上到头顶,以及画架和部分背景草地和树木清晰可见,人物占据画面约70%的高度,画架占据画面约80%的高度。",
-        "类型": "构图",
-        "形式ID": "形式7"
-      },
-      "光照": {
-        "名称": "光照",
-        "描述": "逆光,阳光从画面左上方透过树叶照射过来,形成强烈的光斑和光晕效果,人物和画架处于半剪影状态,但细节仍可见,草地受光均匀,整体画面明亮。",
-        "类型": "光影",
-        "形式ID": "形式2"
-      },
-      "色彩饱和度": {
-        "名称": "色彩饱和度",
-        "描述": "中等偏高,绿色草地和树木的色彩鲜艳,女性白色长裙和画架的木色饱和度适中,画面整体色彩明快。",
-        "类型": "色彩",
-        "形式ID": "形式11"
-      },
-      "清晰度": {
-        "名称": "清晰度",
-        "描述": "前景人物和画架清晰锐利,背景的树木和阳光呈现柔和的虚化效果,景深较浅。",
-        "类型": "清晰度",
-        "形式ID": "形式1"
-      },
-      "构图": {
-        "名称": "构图",
-        "描述": "采用三分法构图,人物主体位于画面左侧三分之一处,画架位于画面右侧三分之一处,形成平衡的视觉效果。人物的头部位于画面上方三分之一处,地平线位于画面下方三分之一处。",
-        "类型": "构图",
-        "形式ID": "形式4"
-      },
-      "评分详情": {
-        "combined_score": 0.811
-      }
-    },
-    "子段落": [
-      {
-        "名称": "人物",
-        "描述": "一名女性,背对镜头,正在进行绘画。",
-        "段落ID": "段落2.1",
-        "形式": {
-          "拍摄角度": {
-            "名称": "拍摄角度",
-            "描述": "从人物背后的中低角度拍摄,视线略微向上倾斜,人物背对镜头,头部略微偏向右侧,身体朝向画架。",
-            "类型": "视角",
-            "形式ID": "形式5"
-          },
-          "景别": {
-            "名称": "景别",
-            "描述": "中景,人物从腰部以上到头顶清晰可见,占据画面约70%的高度,其身体大部分位于画面左侧。",
-            "类型": "构图",
-            "形式ID": "形式7"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "逆光,阳光从人物左后方照射,导致人物背部和头发边缘有明显的光晕,身体正面受光较少,但仍能看清细节。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "色彩饱和度": {
-            "名称": "色彩饱和度",
-            "描述": "中等偏高,头发的棕色和服装的白色饱和度适中,与背景的绿色形成对比。",
-            "类型": "色彩",
-            "形式ID": "形式11"
-          },
-          "清晰度": {
-            "名称": "清晰度",
-            "描述": "人物主体清晰锐利,头发丝和服装褶皱细节可见。",
-            "类型": "清晰度",
-            "形式ID": "形式1"
-          },
-          "构图": {
-            "名称": "构图",
-            "描述": "人物主体位于画面左侧三分之一处,头部位于画面上方三分之一处,形成视觉引导。",
-            "类型": "构图",
-            "形式ID": "形式4"
-          },
-          "评分详情": {
-            "combined_score": 0.849
-          }
-        },
-        "子段落": [
-          {
-            "名称": "头发",
-            "描述": "棕色长发,披散在背部。",
-            "段落ID": "段落2.1.1",
-            "形式": {
-              "发色": {
-                "名称": "发色",
-                "描述": "深棕色,在阳光下呈现出暖棕色调,发梢颜色略浅。",
-                "类型": "色彩",
-                "形式ID": "形式23"
-              },
-              "发型": {
-                "名称": "发型",
-                "描述": "长直发,自然披散在背部,发梢略带自然卷曲,长度及腰。",
-                "类型": "形态",
-                "形式ID": "形式21"
-              },
-              "发量": {
-                "名称": "发量",
-                "描述": "发量浓密,覆盖了大部分背部,从头顶到发梢呈现出厚重感。",
-                "类型": "量感",
-                "形式ID": "形式24"
-              },
-              "光泽度": {
-                "名称": "光泽度",
-                "描述": "头发表面有明显的光泽,尤其是在阳光照射下,发丝边缘呈现出明亮的光晕。",
-                "类型": "质感",
-                "形式ID": "形式22"
-              },
-              "评分详情": {
-                "combined_score": 0.532
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.546
-            }
-          },
-          {
-            "名称": "身体",
-            "描述": "女性的躯干和手臂。",
-            "段落ID": "段落2.1.2",
-            "形式": {
-              "姿态": {
-                "名称": "姿态",
-                "描述": "女性身体略微向右倾斜,背部微弓,头部略微前倾,右手持画笔,左手持调色板,呈现出专注绘画的姿态。",
-                "类型": "动作",
-                "形式ID": "形式8"
-              },
-              "光照": {
-                "名称": "光照",
-                "描述": "逆光,身体背部和手臂边缘有明显的光晕,身体正面受光较少,形成一定的阴影。",
-                "类型": "光影",
-                "形式ID": "形式2"
-              },
-              "评分详情": {
-                "combined_score": 0.455
-              }
-            },
-            "子段落": [
-              {
-                "名称": "服装",
-                "描述": "白色长裙,露背设计。",
-                "段落ID": "段落2.1.2.1",
-                "形式": {
-                  "服装颜色": {
-                    "名称": "服装颜色",
-                    "描述": "纯白色,在阳光下略带米色调。",
-                    "类型": "色彩",
-                    "形式ID": "形式16"
-                  },
-                  "服装款式": {
-                    "名称": "服装款式",
-                    "描述": "长袖连衣裙,V字露背设计,腰部有系带收腰,裙摆为宽松的A字形长裙,长度及脚踝。",
-                    "类型": "形态",
-                    "形式ID": "形式14"
-                  },
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "丝绸或棉麻混纺材质,表面光滑,有轻微的光泽感,质地轻薄。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "褶皱": {
-                    "名称": "褶皱",
-                    "描述": "裙摆和腰部有自然形成的垂坠褶皱,背部V领处也有轻微褶皱。",
-                    "类型": "形态",
-                    "形式ID": "形式20"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.828
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.834
-                }
-              },
-              {
-                "名称": "画笔",
-                "描述": "女性右手握持的细长画笔。",
-                "段落ID": "段落2.1.2.2",
-                "形式": {
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "笔杆为木质或塑料,刷毛为动物毛或合成纤维。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.294
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.455
-                }
-              },
-              {
-                "名称": "调色板",
-                "描述": "女性左手握持的椭圆形调色板,上面有多种颜料。",
-                "段落ID": "段落2.1.2.3",
-                "形式": {
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "木质或塑料材质,表面光滑。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.455
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.48
-                }
-              }
-            ],
-            "评分详情": {
-              "combined_score": 0.476
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.825
-        }
-      },
-      {
-        "名称": "画架",
-        "描述": "木质三脚画架,支撑着画布。",
-        "段落ID": "段落2.2",
-        "形式": {
-          "评分详情": {
-            "combined_score": 0.427
-          }
-        },
-        "子段落": [
-          {
-            "名称": "画布",
-            "描述": "画架上的一幅未完成的画作,描绘了一名背对镜头的女性。",
-            "段落ID": "段落2.2.1",
-            "形式": {
-              "绘画风格": {
-                "名称": "绘画风格",
-                "描述": "印象派或写意风格,笔触粗犷,色彩鲜明,注重光影和氛围的表达,而非精确的细节描绘。",
-                "类型": "风格",
-                "形式ID": "形式27"
-              },
-              "色彩": {
-                "名称": "色彩",
-                "描述": "以绿色、蓝色、紫色为主,辅以白色和黄色,色彩明亮且饱和度较高。",
-                "类型": "色彩",
-                "形式ID": "形式28"
-              },
-              "构图": {
-                "名称": "构图",
-                "描述": "画面中央描绘了一名背对镜头的女性形象,周围是模糊的绿色植物和花朵,背景有光斑效果。",
-                "类型": "构图",
-                "形式ID": "形式4"
-              },
-              "笔触": {
-                "名称": "笔触",
-                "描述": "笔触明显,可见颜料堆叠和涂抹的痕迹,呈现出粗犷而富有表现力的特点。",
-                "类型": "笔触",
-                "形式ID": "形式29"
-              },
-              "内容主题": {
-                "名称": "内容主题",
-                "描述": "描绘了一名身穿白色裙子的女性在户外草地上的背影,周围是绿色的植物和花朵,暗示着户外绘画或休闲场景。",
-                "类型": "内容",
-                "形式ID": "形式26"
-              },
-              "评分详情": {
-                "combined_score": 0.892
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.895
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.511
-        }
-      },
-      {
-        "名称": "背景",
-        "描述": "远处的绿色树木和草地,有阳光透过树叶。",
-        "段落ID": "段落2.3",
-        "形式": {
-          "颜色": {
-            "名称": "颜色",
-            "描述": "以绿色为主,包括深绿色、浅绿色和黄绿色,天空部分呈现淡黄色和白色,整体色彩清新明亮。",
-            "类型": "色彩",
-            "形式ID": "形式3"
-          },
-          "清晰度": {
-            "名称": "清晰度",
-            "描述": "背景整体呈现柔和的虚化效果,景深较浅,树木轮廓模糊,光斑明显。",
-            "类型": "清晰度",
-            "形式ID": "形式1"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "逆光,阳光从画面左上方透过树叶,形成大量圆形和不规则形状的光斑和光晕,使背景呈现出明亮而梦幻的效果。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "景深": {
-            "名称": "景深",
-            "描述": "景深较浅,背景的树木和草地被虚化,与前景的人物和画架形成对比,突出主体。",
-            "类型": "空间",
-            "形式ID": "形式9"
-          },
-          "评分详情": {
-            "combined_score": 0.695
-          }
-        },
-        "评分详情": {
-          "combined_score": 0.703
-        }
-      }
-    ],
-    "评分详情": {
-      "combined_score": 0.756
-    }
-  }
-]

+ 0 - 283
examples/feature_extract/huahua/descriptions/写生油画__img_3_制作表.json

@@ -1,283 +0,0 @@
-[
-  {
-    "名称": "户外绘画场景",
-    "描述": "一名女性在户外草地上跪坐,使用画架和调色板进行绘画,背景是绿色的树木和远处的建筑。",
-    "段落ID": "段落3",
-    "形式": {
-      "拍摄角度": {
-        "名称": "拍摄角度",
-        "描述": "从人物背部略偏右侧的低角度拍摄,视线略高于人物头部,呈现出人物、画架和背景的广阔视野。",
-        "类型": "视角",
-        "形式ID": "形式5"
-      },
-      "景别": {
-        "名称": "景别",
-        "描述": "中景偏全景,画面包含了人物的全身(从头顶到膝盖以下部分),画架的完整结构,以及远处的背景,强调了人物与环境的互动。",
-        "类型": "构图",
-        "形式ID": "形式7"
-      },
-      "光照": {
-        "名称": "光照",
-        "描述": "自然光,光源主要来自画面左上方,呈现出逆光效果。人物和前景草地部分受光较少,略显阴影,背景树木边缘有明显的光晕,整体光线柔和,营造出温暖的氛围。",
-        "类型": "光影",
-        "形式ID": "形式2"
-      },
-      "色彩饱和度": {
-        "名称": "色彩饱和度",
-        "描述": "整体色彩饱和度中等偏高,草地的绿色和树木的绿色鲜明,人物白色服装纯净,画作上的色彩也较为鲜艳,但整体色调和谐,不刺眼。",
-        "类型": "色彩",
-        "形式ID": "形式11"
-      },
-      "清晰度": {
-        "名称": "清晰度",
-        "描述": "前景人物和画架清晰锐利,中景草地清晰,背景树木和远景建筑略有虚化,呈现出景深效果。",
-        "类型": "清晰度",
-        "形式ID": "形式1"
-      },
-      "构图": {
-        "名称": "构图",
-        "描述": "采用开放式构图,人物位于画面右侧偏中,画架位于画面中央偏左,两者形成对角线构图。背景广阔,画面元素分布均衡,引导视线从人物到画架再到背景。",
-        "类型": "构图",
-        "形式ID": "形式4"
-      },
-      "评分详情": {
-        "combined_score": 0.733
-      }
-    },
-    "子段落": [
-      {
-        "名称": "人物",
-        "描述": "一名女性,背对镜头,跪坐在草地上。",
-        "段落ID": "段落3.1",
-        "形式": {
-          "拍摄角度": {
-            "名称": "拍摄角度",
-            "描述": "从人物背部略偏右侧的低角度拍摄,视线略高于人物头部,呈现出人物的背影和侧面。",
-            "类型": "视角",
-            "形式ID": "形式5"
-          },
-          "景别": {
-            "名称": "景别",
-            "描述": "中景,画面包含了人物的全身(从头顶到膝盖以下部分),强调了人物的姿态和服装细节。",
-            "类型": "构图",
-            "形式ID": "形式7"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "自然光,光源主要来自人物左前方,人物背部和右侧受光较少,处于阴影中,左侧手臂和部分头发有少量高光,整体光线柔和。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "色彩饱和度": {
-            "名称": "色彩饱和度",
-            "描述": "人物服装为纯白色,头发为棕色,色彩饱和度适中,与周围环境色彩形成对比。",
-            "类型": "色彩",
-            "形式ID": "形式11"
-          },
-          "清晰度": {
-            "名称": "清晰度",
-            "描述": "人物主体清晰锐利,头发丝、服装褶皱等细节清晰可见。",
-            "类型": "清晰度",
-            "形式ID": "形式1"
-          },
-          "构图": {
-            "名称": "构图",
-            "描述": "人物位于画面右侧偏中,占据了画面约三分之二的垂直空间,形成主体突出。",
-            "类型": "构图",
-            "形式ID": "形式4"
-          },
-          "评分详情": {
-            "combined_score": 0.792
-          }
-        },
-        "子段落": [
-          {
-            "名称": "头发",
-            "描述": "棕色长发,披散在背部。",
-            "段落ID": "段落3.1.1",
-            "形式": {
-              "清晰度": {
-                "名称": "清晰度",
-                "描述": "头发丝细节清晰可见,发梢的层次感明显。",
-                "类型": "清晰度",
-                "形式ID": "形式1"
-              },
-              "评分详情": {
-                "combined_score": 0.413
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.434
-            }
-          },
-          {
-            "名称": "身体",
-            "描述": "女性的躯干和手臂。",
-            "段落ID": "段落3.1.2",
-            "形式": {
-              "姿态": {
-                "名称": "姿态",
-                "描述": "女性跪坐在草地上,身体略微前倾,头部转向画架方向,左手自然放置在调色板旁,右手可能正在作画(未完全显示)。",
-                "类型": "动作",
-                "形式ID": "形式8"
-              },
-              "评分详情": {
-                "combined_score": 0.497
-              }
-            },
-            "子段落": [
-              {
-                "名称": "服装",
-                "描述": "白色长裙,露背设计。",
-                "段落ID": "段落3.1.2.1",
-                "形式": {
-                  "服装颜色": {
-                    "名称": "服装颜色",
-                    "描述": "纯白色,无其他杂色,呈现出干净、明亮的视觉效果。",
-                    "类型": "色彩",
-                    "形式ID": "形式16"
-                  },
-                  "服装款式": {
-                    "名称": "服装款式",
-                    "描述": "长袖连衣裙,V字露背设计,背部有白色细绳交叉系带,腰部有系带收腰,裙摆宽松,自然垂坠,长度及地。",
-                    "类型": "形态",
-                    "形式ID": "形式14"
-                  },
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "目测为轻薄、柔软的棉麻或雪纺材质,具有良好的垂坠感和透气性。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.834
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.84
-                }
-              },
-              {
-                "名称": "调色板",
-                "描述": "女性左手旁放置的椭圆形调色板,上面有多种颜料。",
-                "段落ID": "段落3.1.2.2",
-                "形式": {
-                  "评分详情": {
-                    "combined_score": 0.415
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.479
-                }
-              }
-            ],
-            "评分详情": {
-              "combined_score": 0.525
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.826
-        }
-      },
-      {
-        "名称": "画架",
-        "描述": "木质三脚画架,支撑着画布。",
-        "段落ID": "段落3.2",
-        "形式": {
-          "结构": {
-            "名称": "结构",
-            "描述": "三脚架结构,由三根木杆支撑,顶部有可调节的画板支撑杆和固定装置,整体结构稳固。",
-            "类型": "结构",
-            "形式ID": "形式18"
-          },
-          "评分详情": {
-            "combined_score": 0.551
-          }
-        },
-        "子段落": [
-          {
-            "名称": "画布",
-            "描述": "画架上的一幅未完成的画作,描绘了一名背对镜头的女性。",
-            "段落ID": "段落3.2.1",
-            "形式": {
-              "绘画风格": {
-                "名称": "绘画风格",
-                "描述": "印象派风格,笔触粗犷,色彩鲜明,注重光影和氛围的表达,而非精确的细节描绘。",
-                "类型": "风格",
-                "形式ID": "形式27"
-              },
-              "色彩": {
-                "名称": "色彩",
-                "描述": "以绿色和蓝色为主色调,描绘了草地和花丛,人物服装为白色,色彩对比鲜明,整体色调明亮。",
-                "类型": "色彩",
-                "形式ID": "形式28"
-              },
-              "构图": {
-                "名称": "构图",
-                "描述": "画作中央偏右描绘了一名背对镜头的女性,周围是绿色的草地和蓝紫色的花丛,背景有白色遮阳伞,形成开放式构图。",
-                "类型": "构图",
-                "形式ID": "形式4"
-              },
-              "笔触": {
-                "名称": "笔触",
-                "描述": "笔触粗犷有力,颜料堆叠感明显,尤其在花丛和草地的描绘上,呈现出明显的纹理。",
-                "类型": "笔触",
-                "形式ID": "形式29"
-              },
-              "内容主题": {
-                "名称": "内容主题",
-                "描述": "描绘了一名身穿白色连衣裙的女性在户外花丛中撑伞的场景,与现实场景中的女性形象相似,形成画中画的意境。",
-                "类型": "内容",
-                "形式ID": "形式26"
-              },
-              "评分详情": {
-                "combined_score": 0.874
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.891
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.584
-        }
-      },
-      {
-        "名称": "背景",
-        "描述": "远处的绿色树木和草地,以及远处的城市建筑。",
-        "段落ID": "段落3.3",
-        "形式": {
-          "颜色": {
-            "名称": "颜色",
-            "描述": "以绿色为主,包括前景草地的鲜绿色、中景树木的深绿色和远景树木的浅绿色,远处建筑为浅灰色,天空为淡黄色,整体色彩清新自然。",
-            "类型": "色彩",
-            "形式ID": "形式3"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "背景光线充足,尤其在画面左上方,阳光穿透树叶形成光斑和光晕,营造出温暖、明亮的氛围。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "景深": {
-            "名称": "景深",
-            "描述": "景深较浅,前景人物和画架清晰,背景树木和建筑逐渐虚化,层次感明显。",
-            "类型": "空间",
-            "形式ID": "形式9"
-          },
-          "评分详情": {
-            "combined_score": 0.558
-          }
-        },
-        "评分详情": {
-          "combined_score": 0.633
-        }
-      }
-    ],
-    "评分详情": {
-      "combined_score": 0.755
-    }
-  }
-]

+ 0 - 319
examples/feature_extract/huahua/descriptions/写生油画__img_4_制作表.json

@@ -1,319 +0,0 @@
-[
-  {
-    "名称": "户外绘画场景",
-    "描述": "一名女性在户外草地上站立,使用画架和调色板进行绘画,背景是绿色的树木。",
-    "段落ID": "段落4",
-    "形式": {
-      "拍摄角度": {
-        "名称": "拍摄角度",
-        "描述": "平视角度,相机与人物大致处于同一水平线,略微仰视,使得人物和画架的顶部略高于画面中心,背景的树木占据画面上半部分。",
-        "类型": "视角",
-        "形式ID": "形式5"
-      },
-      "景别": {
-        "名称": "景别",
-        "描述": "中景,画面中人物从膝盖以上到头部完整呈现,画架也完整呈现,背景的树木和草地占据画面大部分,强调人物与环境的互动。",
-        "类型": "构图",
-        "形式ID": "形式7"
-      },
-      "光照": {
-        "名称": "光照",
-        "描述": "自然光照,光线明亮,从画面右上方射入,在人物和画架上形成清晰的亮部和柔和的阴影,整体光线均匀,无明显过曝或欠曝区域。",
-        "类型": "光影",
-        "形式ID": "形式2"
-      },
-      "色彩饱和度": {
-        "名称": "色彩饱和度",
-        "描述": "中等偏高饱和度,绿色草地和树木的色彩鲜艳,人物白色服装和肤色自然,调色板上的颜料色彩丰富且饱和度高,整体画面色彩生动。",
-        "类型": "色彩",
-        "形式ID": "形式11"
-      },
-      "清晰度": {
-        "名称": "清晰度",
-        "描述": "高清晰度,画面主体人物和画架细节清晰锐利,背景树木和草地有轻微虚化,但仍能辨认出其形态,整体画面清晰度良好。",
-        "类型": "清晰度",
-        "形式ID": "形式1"
-      },
-      "构图": {
-        "名称": "构图",
-        "描述": "采用开放式构图,人物位于画面右侧,画架位于画面左侧,两者形成对角线构图,引导视线从左下方的画架到右上方的人物,背景的树木和草地延伸至画面边缘,营造出开阔感。人物头部位于画面上方1/4处,画架顶部位于画面上方1/8处。",
-        "类型": "构图",
-        "形式ID": "形式4"
-      },
-      "评分详情": {
-        "combined_score": 0.858
-      }
-    },
-    "子段落": [
-      {
-        "名称": "人物",
-        "描述": "一名女性,侧身面对镜头,正在进行绘画。",
-        "段落ID": "段落4.1",
-        "形式": {
-          "拍摄角度": {
-            "名称": "拍摄角度",
-            "描述": "平视角度,相机与人物大致处于同一水平线,略微仰视,人物头部略高于画面中心。",
-            "类型": "视角",
-            "形式ID": "形式5"
-          },
-          "景别": {
-            "名称": "景别",
-            "描述": "中景,人物从膝盖以上到头部完整呈现,占据画面右侧大部分区域,强调人物的姿态和动作。",
-            "类型": "构图",
-            "形式ID": "形式7"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "自然光照,光线明亮,从画面右上方射入,在人物右侧形成亮部,左侧形成柔和阴影,面部光线均匀,无明显过曝或欠曝。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "色彩饱和度": {
-            "名称": "色彩饱和度",
-            "描述": "中等偏高饱和度,肤色自然,头发棕色饱和度适中,白色服装色彩纯净,调色板上的颜料色彩鲜艳,整体色彩和谐。",
-            "类型": "色彩",
-            "形式ID": "形式11"
-          },
-          "清晰度": {
-            "名称": "清晰度",
-            "描述": "高清晰度,人物面部、头发、服装和手部细节清晰锐利,无模糊现象。",
-            "类型": "清晰度",
-            "形式ID": "形式1"
-          },
-          "构图": {
-            "名称": "构图",
-            "描述": "人物位于画面右侧,身体略微向左倾斜,形成对角线构图,头部位于画面上方1/4处,视线向左上方延伸,与画架形成互动。",
-            "类型": "构图",
-            "形式ID": "形式4"
-          },
-          "评分详情": {
-            "combined_score": 0.788
-          }
-        },
-        "子段落": [
-          {
-            "名称": "头发",
-            "描述": "棕色长发,部分散落在肩上。",
-            "段落ID": "段落4.1.1",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.301
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.315
-            }
-          },
-          {
-            "名称": "身体",
-            "描述": "女性的躯干和手臂。",
-            "段落ID": "段落4.1.2",
-            "形式": {
-              "姿态": {
-                "名称": "姿态",
-                "描述": "站立姿态,身体略微侧向左前方,头部向左上方仰望,右手持画笔,左手持调色板,双臂自然抬起,呈绘画动作。",
-                "类型": "动作",
-                "形式ID": "形式8"
-              },
-              "肤色": {
-                "名称": "肤色",
-                "描述": "健康白皙的肤色,在光照下呈现自然光泽,面部和手臂肤色均匀。",
-                "类型": "色彩",
-                "形式ID": "形式12"
-              },
-              "清晰度": {
-                "名称": "清晰度",
-                "描述": "高清晰度,躯干和手臂的轮廓、服装褶皱、手部细节清晰可见。",
-                "类型": "清晰度",
-                "形式ID": "形式1"
-              },
-              "光照": {
-                "名称": "光照",
-                "描述": "自然光照,光线从右上方射入,在右臂和身体右侧形成亮部,左臂和身体左侧形成柔和阴影,光影过渡自然。",
-                "类型": "光影",
-                "形式ID": "形式2"
-              },
-              "评分详情": {
-                "combined_score": 0.765
-              }
-            },
-            "子段落": [
-              {
-                "名称": "服装",
-                "描述": "白色长裙,袖子宽松。",
-                "段落ID": "段落4.1.2.1",
-                "形式": {
-                  "服装颜色": {
-                    "名称": "服装颜色",
-                    "描述": "纯白色,无图案或装饰,色彩纯净明亮。",
-                    "类型": "色彩",
-                    "形式ID": "形式16"
-                  },
-                  "服装款式": {
-                    "名称": "服装款式",
-                    "描述": "长袖连衣裙,圆领,袖子宽松,裙摆宽松垂坠,长度及脚踝,腰部有轻微收腰设计。",
-                    "类型": "形态",
-                    "形式ID": "形式14"
-                  },
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "目测为棉麻或雪纺等轻薄透气的面料,具有柔软垂坠感。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.806
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.81
-                }
-              },
-              {
-                "名称": "画笔",
-                "描述": "女性右手握持的细长画笔。",
-                "段落ID": "段落4.1.2.2",
-                "形式": {
-                  "形状": {
-                    "名称": "形状",
-                    "描述": "细长杆状,笔杆为深色,笔头为绿色颜料。",
-                    "类型": "形状",
-                    "形式ID": "形式17"
-                  },
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "笔杆目测为木质或塑料,笔头为合成纤维或动物毛。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.455
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.525
-                }
-              },
-              {
-                "名称": "调色板",
-                "描述": "女性左手握持的椭圆形调色板,上面有多种颜料。",
-                "段落ID": "段落4.1.2.3",
-                "形式": {
-                  "形状": {
-                    "名称": "形状",
-                    "描述": "椭圆形,边缘光滑,中间略微凹陷。",
-                    "类型": "形状",
-                    "形式ID": "形式17"
-                  },
-                  "颜色": {
-                    "名称": "颜色",
-                    "描述": "调色板主体为深棕色或黑色,表面沾有多种鲜艳颜料,包括绿色、蓝色、红色、黄色、白色等,颜料分布不规则。",
-                    "类型": "色彩",
-                    "形式ID": "形式3"
-                  },
-                  "材质": {
-                    "名称": "材质",
-                    "描述": "目测为木质或塑料材质,表面光滑。",
-                    "类型": "质感",
-                    "形式ID": "形式10"
-                  },
-                  "颜料分布": {
-                    "名称": "颜料分布",
-                    "描述": "颜料呈不规则块状分布在调色板表面,主要集中在调色板的左侧和下方,绿色颜料面积最大,位于调色板中央偏左位置,其他颜料点缀其间。",
-                    "类型": "布局",
-                    "形式ID": "形式25"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.628
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.653
-                }
-              }
-            ],
-            "评分详情": {
-              "combined_score": 0.773
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.764
-        }
-      },
-      {
-        "名称": "画架",
-        "描述": "木质三脚画架,支撑着画布。",
-        "段落ID": "段落4.2",
-        "形式": {
-          "结构": {
-            "名称": "结构",
-            "描述": "三脚架结构,由三根木杆支撑,顶部有可调节的画板支撑架,底部有横向支撑杆,整体结构稳固。",
-            "类型": "结构",
-            "形式ID": "形式18"
-          },
-          "评分详情": {
-            "combined_score": 0.547
-          }
-        },
-        "子段落": [
-          {
-            "名称": "画布",
-            "描述": "画架上的一幅空白画布。",
-            "段落ID": "段落4.2.1",
-            "形式": {
-              "画布颜色": {
-                "名称": "画布颜色",
-                "描述": "纯白色,表面干净,无任何颜料痕迹。",
-                "类型": "色彩"
-              },
-              "光照": {
-                "名称": "光照",
-                "描述": "自然光照,光线从右上方射入,画布表面受光均匀,无明显阴影,呈现纯白色。",
-                "类型": "光影",
-                "形式ID": "形式2"
-              },
-              "评分详情": {
-                "combined_score": 0.606
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.79
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.608
-        }
-      },
-      {
-        "名称": "背景",
-        "描述": "远处的绿色树木和草地。",
-        "段落ID": "段落4.3",
-        "形式": {
-          "颜色": {
-            "名称": "颜色",
-            "描述": "绿色为主,草地为鲜绿色,树木为深浅不一的绿色,远处有少量棕色树干和灰色建筑,整体色调清新自然。",
-            "类型": "色彩",
-            "形式ID": "形式3"
-          },
-          "景深": {
-            "名称": "景深",
-            "描述": "景深较浅,前景人物和画架清晰,背景草地和树木逐渐虚化,营造出空间感和层次感。",
-            "类型": "空间",
-            "形式ID": "形式9"
-          },
-          "评分详情": {
-            "combined_score": 0.434
-          }
-        },
-        "评分详情": {
-          "combined_score": 0.542
-        }
-      }
-    ],
-    "评分详情": {
-      "combined_score": 0.845
-    }
-  }
-]

+ 0 - 389
examples/feature_extract/huahua/descriptions/写生油画__img_5_制作表.json

@@ -1,389 +0,0 @@
-[
-  {
-    "名称": "户外绘画场景",
-    "描述": "画面展示了户外绘画的局部场景,主要聚焦于人物手持调色板和部分身体,以及背景的草地和画架。",
-    "段落ID": "段落5",
-    "形式": {
-      "拍摄角度": {
-        "名称": "拍摄角度",
-        "描述": "从人物胸部以上,略微俯视的角度拍摄,画面中心偏右是人物手持调色板的区域,左侧可见画架局部,背景是模糊的草地。",
-        "类型": "视角",
-        "形式ID": "形式5"
-      },
-      "景别": {
-        "名称": "景别",
-        "描述": "中景偏近景,主要聚焦于人物的上半身(胸部以上)和手持的调色板,占据画面约80%的区域,背景草地虚化。",
-        "类型": "构图",
-        "形式ID": "形式7"
-      },
-      "光照": {
-        "名称": "光照",
-        "描述": "自然光照,光线充足且柔和,从画面右上方照射,使得人物右侧手臂和调色板右侧受光较亮,左侧略有阴影,整体画面亮度适中,无明显过曝或欠曝区域。",
-        "类型": "光影",
-        "形式ID": "形式2"
-      },
-      "色彩饱和度": {
-        "名称": "色彩饱和度",
-        "描述": "色彩饱和度较高,尤其是调色板上的颜料和背景草地的绿色,色彩鲜明且富有活力。",
-        "类型": "色彩",
-        "形式ID": "形式11"
-      },
-      "清晰度": {
-        "名称": "清晰度",
-        "描述": "画面中心区域(人物手臂、调色板、画笔)清晰锐利,细节可见;背景草地和画架边缘部分虚化,呈现景深效果。",
-        "类型": "清晰度",
-        "形式ID": "形式1"
-      },
-      "构图": {
-        "名称": "构图",
-        "描述": "采用开放式构图,人物和调色板占据画面主体,调色板位于画面右下角至中心区域,人物左臂从画面左上角延伸,右臂从画面右侧延伸,画架位于画面左下角,背景草地作为衬托,引导视线集中于绘画活动。",
-        "类型": "构图",
-        "形式ID": "形式4"
-      },
-      "评分详情": {
-        "combined_score": 0.85
-      }
-    },
-    "子段落": [
-      {
-        "名称": "人物",
-        "描述": "画面中部的女性,穿着白色服装,正在进行绘画活动。",
-        "段落ID": "段落5.1",
-        "形式": {
-          "拍摄角度": {
-            "名称": "拍摄角度",
-            "描述": "从人物胸部以上,略微俯视的角度拍摄,主要展现人物进行绘画时的上半身姿态。",
-            "类型": "视角",
-            "形式ID": "形式5"
-          },
-          "景别": {
-            "名称": "景别",
-            "描述": "中景偏近景,聚焦于人物的上半身(胸部以上),占据画面约80%的区域,突出人物的绘画动作。",
-            "类型": "构图",
-            "形式ID": "形式7"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "自然光照,光线充足且柔和,从画面右上方照射,使得人物右侧身体和手臂受光较亮,左侧略有阴影,整体亮度适中。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "色彩饱和度": {
-            "名称": "色彩饱和度",
-            "描述": "人物服装为白色,肤色自然,色彩饱和度适中,与背景的鲜艳绿色形成对比。",
-            "类型": "色彩",
-            "形式ID": "形式11"
-          },
-          "清晰度": {
-            "名称": "清晰度",
-            "描述": "人物主体清晰锐利,服装纹理和手臂细节可见,与虚化的背景形成对比。",
-            "类型": "清晰度",
-            "形式ID": "形式1"
-          },
-          "构图": {
-            "名称": "构图",
-            "描述": "人物身体呈对角线构图,左臂从画面左上角延伸,右臂从画面右侧延伸,调色板位于画面右下角至中心区域,形成视觉引导。",
-            "类型": "构图",
-            "形式ID": "形式4"
-          },
-          "评分详情": {
-            "combined_score": 0.823
-          }
-        },
-        "子段落": [
-          {
-            "名称": "手臂",
-            "描述": "人物露出的手臂部分,包括左臂和右臂。",
-            "段落ID": "段落5.1.1",
-            "形式": {
-              "评分详情": {
-                "combined_score": 0.28
-              }
-            },
-            "子段落": [
-              {
-                "名称": "左臂",
-                "描述": "人物左侧手臂,部分可见,手持画笔。",
-                "段落ID": "段落5.1.1.1",
-                "形式": {
-                  "清晰度": {
-                    "名称": "清晰度",
-                    "描述": "左臂皮肤纹理、指甲、画笔等细节清晰可见,无模糊现象。",
-                    "类型": "清晰度",
-                    "形式ID": "形式1"
-                  },
-                  "光照": {
-                    "名称": "光照",
-                    "描述": "自然光照,左臂受光均匀,无明显阴影或反光。",
-                    "类型": "光影",
-                    "形式ID": "形式2"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.196
-                  }
-                },
-                "子段落": [
-                  {
-                    "名称": "画笔",
-                    "描述": "人物左手持有的细长画笔。",
-                    "段落ID": "段落5.1.1.1.1",
-                    "形式": {
-                      "形状": {
-                        "名称": "形状",
-                        "描述": "画笔呈细长圆柱形,笔杆笔直,笔尖略尖。",
-                        "类型": "形状",
-                        "形式ID": "形式17"
-                      },
-                      "颜色": {
-                        "名称": "颜色",
-                        "描述": "画笔笔杆为深色(可能为黑色或深棕色),笔尖部分沾有少量绿色颜料。",
-                        "类型": "色彩",
-                        "形式ID": "形式3"
-                      },
-                      "尺寸": {
-                        "名称": "尺寸",
-                        "描述": "画笔长度约为150像素,宽度约为10像素,相对于人物手指显得细长。",
-                        "类型": "大小",
-                        "形式ID": "形式19"
-                      },
-                      "清晰度": {
-                        "名称": "清晰度",
-                        "描述": "画笔轮廓清晰,笔尖细节可见,无模糊现象。",
-                        "类型": "清晰度",
-                        "形式ID": "形式1"
-                      },
-                      "评分详情": {
-                        "combined_score": 0.224
-                      }
-                    },
-                    "评分详情": {
-                      "combined_score": 0.245
-                    }
-                  }
-                ],
-                "评分详情": {
-                  "combined_score": 0.21
-                }
-              },
-              {
-                "名称": "右臂",
-                "描述": "人物右侧手臂,手持调色板,佩戴手镯。",
-                "段落ID": "段落5.1.1.2",
-                "形式": {
-                  "清晰度": {
-                    "名称": "清晰度",
-                    "描述": "右臂皮肤纹理、指甲、手镯等细节清晰可见,无模糊现象。",
-                    "类型": "清晰度",
-                    "形式ID": "形式1"
-                  },
-                  "光照": {
-                    "名称": "光照",
-                    "描述": "自然光照,右臂受光面较亮,光影过渡自然,手镯表面有反光点。",
-                    "类型": "光影",
-                    "形式ID": "形式2"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.266
-                  }
-                },
-                "子段落": [
-                  {
-                    "名称": "手镯",
-                    "描述": "佩戴在右腕上的银色手镯。",
-                    "段落ID": "段落5.1.1.2.1",
-                    "形式": {
-                      "形状": {
-                        "名称": "形状",
-                        "描述": "手镯呈圆形环状,边缘光滑。",
-                        "类型": "形状",
-                        "形式ID": "形式17"
-                      },
-                      "颜色": {
-                        "名称": "颜色",
-                        "描述": "手镯为银色,表面有金属光泽。",
-                        "类型": "色彩",
-                        "形式ID": "形式3"
-                      },
-                      "清晰度": {
-                        "名称": "清晰度",
-                        "描述": "手镯轮廓清晰,表面光泽细节可见,无模糊现象。",
-                        "类型": "清晰度",
-                        "形式ID": "形式1"
-                      },
-                      "评分详情": {
-                        "combined_score": 0.098
-                      }
-                    },
-                    "评分详情": {
-                      "combined_score": 0.105
-                    }
-                  }
-                ],
-                "评分详情": {
-                  "combined_score": 0.28
-                }
-              }
-            ],
-            "评分详情": {
-              "combined_score": 0.315
-            }
-          },
-          {
-            "名称": "服装",
-            "描述": "人物穿着的白色长袖衬衫和裙子。",
-            "段落ID": "段落5.1.2",
-            "形式": {
-              "服装颜色": {
-                "名称": "服装颜色",
-                "描述": "服装主体为纯白色,无其他图案或颜色点缀。",
-                "类型": "色彩",
-                "形式ID": "形式16"
-              },
-              "服装款式": {
-                "名称": "服装款式",
-                "描述": "长袖衬衫和裙子,衬衫袖口有纽扣,衣身宽松,腰部有收腰设计,裙子部分为长裙,整体风格简约。",
-                "类型": "形态",
-                "形式ID": "形式14"
-              },
-              "清晰度": {
-                "名称": "清晰度",
-                "描述": "服装的材质纹理和褶皱细节清晰可见,无模糊现象。",
-                "类型": "清晰度",
-                "形式ID": "形式1"
-              },
-              "评分详情": {
-                "combined_score": 0.816
-              }
-            },
-            "评分详情": {
-              "combined_score": 0.818
-            }
-          },
-          {
-            "名称": "调色板",
-            "描述": "人物右手持有的椭圆形调色板,上面沾满了各种颜色的颜料。",
-            "段落ID": "段落5.1.3",
-            "形式": {
-              "形状": {
-                "名称": "形状",
-                "描述": "调色板呈不规则的椭圆形,边缘圆润,中间有一个拇指孔,方便手持。",
-                "类型": "形状",
-                "形式ID": "形式17"
-              },
-              "颜色": {
-                "名称": "颜色",
-                "描述": "调色板底色为深棕色,表面覆盖着大量混合的颜料,主要颜色包括深绿色、浅绿色、蓝色、红色、黄色、白色、紫色、黑色等多种鲜艳色彩。",
-                "类型": "色彩",
-                "形式ID": "形式3"
-              },
-              "尺寸": {
-                "名称": "尺寸",
-                "描述": "调色板占据画面右下角至中心区域,其宽度约为画面宽度的75%(900像素),高度约为画面高度的37.5%(600像素),尺寸较大,方便调色。",
-                "类型": "大小",
-                "形式ID": "形式19"
-              },
-              "颜料分布": {
-                "名称": "颜料分布",
-                "描述": "颜料呈不规则块状和条状分布在调色板表面,部分颜料相互混合,形成过渡色,没有明显的区域划分,呈现出使用过的痕迹。",
-                "类型": "布局",
-                "形式ID": "形式25"
-              },
-              "评分详情": {
-                "combined_score": 0.646
-              }
-            },
-            "子段落": [
-              {
-                "名称": "颜料",
-                "描述": "调色板上混合的多种颜色的颜料,包括绿色、蓝色、红色等。",
-                "段落ID": "段落5.1.3.1",
-                "形式": {
-                  "颜色种类": {
-                    "名称": "颜色种类",
-                    "描述": "颜料种类丰富,包括深绿色、浅绿色、蓝色、红色、黄色、白色、紫色、黑色、粉色、棕色等至少10种颜色,部分颜色相互混合。",
-                    "类型": "色彩"
-                  },
-                  "颜料质地": {
-                    "名称": "颜料质地",
-                    "描述": "颜料呈膏状,堆积在调色板表面,具有一定的厚度和立体感,表面有光泽,显示出湿润的质地。",
-                    "类型": "质感"
-                  },
-                  "分布模式": {
-                    "名称": "分布模式",
-                    "描述": "颜料呈不规则的块状和条状分布,没有严格的区域划分,部分颜料相互融合,形成自然的混色效果,其中绿色颜料占据了调色板中心区域的大部分。",
-                    "类型": "布局"
-                  },
-                  "清晰度": {
-                    "名称": "清晰度",
-                    "描述": "颜料的颜色、质地和混合细节清晰可见,无模糊现象。",
-                    "类型": "清晰度",
-                    "形式ID": "形式1"
-                  },
-                  "评分详情": {
-                    "combined_score": 0.743
-                  }
-                },
-                "评分详情": {
-                  "combined_score": 0.754
-                }
-              }
-            ],
-            "评分详情": {
-              "combined_score": 0.659
-            }
-          }
-        ],
-        "评分详情": {
-          "combined_score": 0.858
-        }
-      },
-      {
-        "名称": "画架",
-        "描述": "画面左侧部分可见的木质画架。",
-        "段落ID": "段落5.2",
-        "形式": {
-          "评分详情": {
-            "combined_score": 0.373
-          }
-        },
-        "评分详情": {
-          "combined_score": 0.412
-        }
-      },
-      {
-        "名称": "背景",
-        "描述": "画面后方的绿色草地。",
-        "段落ID": "段落5.3",
-        "形式": {
-          "颜色": {
-            "名称": "颜色",
-            "描述": "背景草地呈现鲜艳的绿色,深浅不一,部分区域略带黄色调,整体色彩饱和度较高。",
-            "类型": "色彩",
-            "形式ID": "形式3"
-          },
-          "光照": {
-            "名称": "光照",
-            "描述": "自然光照,草地受光均匀,无明显阴影或高光区域,整体亮度适中。",
-            "类型": "光影",
-            "形式ID": "形式2"
-          },
-          "景深": {
-            "名称": "景深",
-            "描述": "背景草地处于景深之外,呈现出明显的虚化效果,与前景清晰的人物和调色板形成对比,突出主体。",
-            "类型": "空间",
-            "形式ID": "形式9"
-          },
-          "评分详情": {
-            "combined_score": 0.544
-          }
-        },
-        "评分详情": {
-          "combined_score": 0.569
-        }
-      }
-    ],
-    "评分详情": {
-      "combined_score": 0.965
-    }
-  }
-]

+ 0 - 1
examples/feature_extract/huahua/descriptions/创作表.md

@@ -1 +0,0 @@
-本段落以图文叙事结合的方式,通过一段富有诗意的文字描述和9张多图组呈现的图片,共同展现了秋日花园的艺术创作过程与情感表达。文字部分以"听闻秋日是倒放的春天"开篇,描绘了创作者心中一座秋日的花园,其中栽种着淡却温暖的花朵,风从远山吹来,阳光热情而秋风微凉,营造出一种宁静而美好的氛围。创作者将这种感受与颜料一起酝酿成画面,并用比喻的手法,将白裙比作"一抹无暇",迎着光线绘画出"限定的浪漫"。图片则展示了艺术创作的场景,包括画架支起在绿草坪上,以及女性在户外进行绘画的瞬间,其中可能运用了逆光拍摄和景深虚化等手法来增强画面的艺术感。文字最后以"再添一笔白 为我画一枝玫瑰的奇遇"收尾,进一步强调了这种充满诗意生活的自然之美。

+ 0 - 74
examples/feature_extract/huahua/descriptions/制作点.md

@@ -1,74 +0,0 @@
-{
-"元素名称": "女性",
-"元素描述": "穿着白裙的女性,包括其背影、躯干与手臂,有蹲坐姿态。",
-"段落数量": 8,
-"段落列表": [
-"段落1.1.1",
-"段落2.1.1",
-"段落3.1.1",
-"段落4.1.1.1",
-"段落4.1.1.2"
-],
-"综合权重": 84.5
-},
-{
-"元素名称": "绘画工具",
-"元素描述": "包含调色板、画笔和颜料,部分描述涉及手持这些工具的动作,调色板有主体部分。",
-"段落数量": 15,
-"段落列表": [
-"段落1.1.3",
-"段落2.1.3",
-"段落4.1.3",
-"段落4.1.4",
-"段落5.1.1.1",
-"段落5.1.1.2",
-"段落5.2.1.1",
-"段落5.2.1.2"
-],
-"综合权重": 78.5
-},
-{
-"元素名称": "自然背景",
-"元素描述": "由草坪、树木和阳光构成的自然背景,部分描述提及远处建筑。",
-"段落数量": 8,
-"段落列表": [
-"段落1.3",
-"段落2.2",
-"段落3.2",
-"段落4.2.1",
-"段落4.2.2"
-],
-"综合权重": 74.0
-},
-{
-"元素名称": "画架与画布",
-"元素描述": "包含画架结构和其上的画布,画布可以是空白的或正在创作的油画。",
-"段落数量": 8,
-"段落列表": [
-"段落4.1.2.1",
-"段落4.1.2.2",
-"段落5.2.2",
-"段落5.2.3"
-],
-"综合权重": 67.67
-},
-{
-"元素名称": "画架与油画",
-"元素描述": "画架上放置着油画。",
-"段落数量": 4,
-"段落列表": [
-"段落1.1.2",
-"段落2.1.2",
-"段落3.1.2"
-],
-"综合权重": 60.97
-},
-{
-"元素名称": "女性衣物",
-"元素描述": "女性穿着的白色衣物,包括白色上衣。",
-"段落数量": 3,
-"段落列表": [
-"段落5.1.2"
-],
-"综合权重": 44.7
-}

+ 0 - 44
examples/feature_extract/huahua/descriptions/图片亮点.md

@@ -1,44 +0,0 @@
-以下是图组中,必须要保持高表现力的亮点
-{
-“post_name”: “户外白裙写生少女”,
-
-“聚类结果”: [
-{
-"聚类主题": "优雅的白裙写生少女",
-"聚类描述": "该聚类汇集了画面核心人物的实质特征。身着纯白连衣裙的女性主体,无论是优雅的背影、专注的侧颜,还是发丝与耳饰等精致细节,都共同塑造了一位充满了文艺气质与娴静美的写生缪斯形象。",
-"亮点类型": "实质",
-"图片列表": ["img_1", "img_2", "img_3", "img_4", "img_5"]
-},
-{
-"聚类主题": "斑斓厚重的油画颜料",
-"聚类描述": "该聚类专门聚焦于画面中色彩最丰富、质感最独特的实质物体。木质调色盘上堆积的厚重油画颜料(Impasto),以其杂乱而鲜艳的色彩肌理,与周围大面积纯净的白色衣物形成强烈视觉反差,强调了艺术创作的真实性。",
-"亮点类型": "实质",
-"图片列表": ["img_1", "img_5"]
-},
-{
-
-"聚类主题": "构建叙事的写生道具",
-"聚类描述": "该聚类集合了定义‘户外写生’场景的关键道具。画架、画布、画笔以及作为点缀的白玫瑰,这些物品在空间上组合排列,通过具体的实体展示了人物的活动内容,构建了画面的叙事背景。",
-"亮点类型": "实质",
-"图片列表": ["img_3", "img_4"]
-},
-{
-"聚类主题": "清新雅致的白绿配色",
-"聚类描述": "该聚类强调了画面在色彩构成上的形式美感。大面积的高饱和度自然草木绿背景与人物衣着的纯白形成鲜明对比,确立了清新、自然且具有治愈感的森系视觉基调。",
-"亮点类型": "形式",
-"图片列表": ["img_1", "img_4"]
-},
-{
-"聚类主题": "唯美梦幻的光影与景深",
-"聚类描述": "该聚类整合了营造画面氛围的光学形式手段。摄影师结合了温暖的逆光/轮廓光与大光圈带来的浅景深虚化(Bokeh)效果,使背景呈现出柔和的散景,共同营造出一种脱离现实的梦幻、浪漫且充满空气感的视觉氛围。",
-"亮点类型": "形式",
-"图片列表": ["img_2", "img_3", "img_5"]
-},
-{
-"聚类主题": "虚实呼应的画中画结构",
-"聚类描述": "该聚类归纳了画面中独特的逻辑形式。画布上的内容与现实场景形成"镜像"或"互文"关系,通过现实与艺术创作之间的视觉呼应,构建出一种增加了叙事深度的画中画结构。",
-"亮点类型": "形式",
-"图片列表": ["img_1", "img_2"]
-}
-]
-}

BIN
examples/feature_extract/huahua/features/background_asset/background_bokeh_img2.png


BIN
examples/feature_extract/huahua/features/background_asset/background_green_img1.png


BIN
examples/feature_extract/huahua/features/background_asset/background_green_img4.png


+ 0 - 62
examples/feature_extract/huahua/features/background_asset/mapping.json

@@ -1,62 +0,0 @@
-{
-  "dimension": "background_asset",
-  "type": "实质",
-  "highlight_cluster": "清新雅致的白绿配色 / 唯美梦幻的光影与景深",
-  "description": "户外自然背景素材,包含三种典型状态:清晰绿色草地+树木(img_1)、高饱和绿色背景(img_4)、逆光+散景梦幻背景(img_2)",
-  "files": {
-    "background_green_img1.png": {
-      "source_image": "img_1",
-      "state": "clear green trees and grass, soft natural light",
-      "purpose": "清晰自然绿色背景参考,白绿配色基础"
-    },
-    "background_green_img4.png": {
-      "source_image": "img_4",
-      "state": "vivid saturated green trees and grass, bright daylight",
-      "purpose": "高饱和绿色背景参考,白绿配色最典型"
-    },
-    "background_bokeh_img2.png": {
-      "source_image": "img_2",
-      "state": "backlit green trees with lens flare and bokeh light spots",
-      "purpose": "逆光散景梦幻背景参考,光影景深亮点"
-    }
-  },
-  "mapping": [
-    {
-      "image": "img_1",
-      "paragraph": "段落1.3",
-      "type": "实质",
-      "feature": "自然绿色背景(草地+树木)",
-      "highlight": "清新雅致的白绿配色"
-    },
-    {
-      "image": "img_2",
-      "paragraph": "段落2.3",
-      "type": "实质",
-      "feature": "逆光散景自然背景",
-      "highlight": "唯美梦幻的光影与景深"
-    },
-    {
-      "image": "img_3",
-      "paragraph": "段落3.3",
-      "type": "实质",
-      "feature": "自然背景(含远处建筑)",
-      "highlight": "唯美梦幻的光影与景深"
-    },
-    {
-      "image": "img_4",
-      "paragraph": "段落4.3",
-      "type": "实质",
-      "feature": "高饱和绿色自然背景",
-      "highlight": "清新雅致的白绿配色"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5.3",
-      "type": "实质",
-      "feature": "虚化绿色草地背景",
-      "highlight": "唯美梦幻的光影与景深"
-    }
-  ],
-  "consistency_elements": ["自然背景"],
-  "generation_notes": "背景主色调为高饱和度草木绿(HSV: 100-120°, S>150, V>100),包含草地(下半部分)和树木(上半部分),img_2/3/5有逆光散景效果"
-}

BIN
examples/feature_extract/huahua/features/character_asset/character_ref_back.png


BIN
examples/feature_extract/huahua/features/character_asset/character_ref_img1.png


BIN
examples/feature_extract/huahua/features/character_asset/character_ref_kneel.png


BIN
examples/feature_extract/huahua/features/character_asset/character_ref_main.png


BIN
examples/feature_extract/huahua/features/character_asset/character_ref_side.png


+ 0 - 75
examples/feature_extract/huahua/features/character_asset/mapping.json

@@ -1,75 +0,0 @@
-{
-  "dimension": "character_asset",
-  "type": "实质",
-  "highlight_cluster": "优雅的白裙写生少女",
-  "description": "白裙写生少女人物角色素材,作为图集一致性基座。棕色长直发,纯白宽松长袖连衣裙,手持画笔和调色板。",
-  "files": {
-    "character_ref_back.png": {
-      "source_image": "img_1",
-      "view": "3/4 back view",
-      "purpose": "IP-Adapter主参考图"
-    },
-    "character_ref_main.png": {
-      "source_image": "img_2",
-      "view": "rear view",
-      "purpose": "正后方人物参考"
-    },
-    "character_ref_img1.png": {
-      "source_image": "img_1",
-      "view": "medium shot",
-      "purpose": "中景人物参考"
-    },
-    "character_ref_side.png": {
-      "source_image": "img_4",
-      "view": "side profile",
-      "purpose": "侧面参考"
-    },
-    "character_ref_kneel.png": {
-      "source_image": "img_3",
-      "view": "kneeling pose",
-      "purpose": "跪坐姿态参考"
-    }
-  },
-  "mapping": [
-    {
-      "image": "img_1",
-      "paragraph": "段落1.1",
-      "type": "实质",
-      "feature": "人物角色基座",
-      "highlight": "优雅的白裙写生少女"
-    },
-    {
-      "image": "img_2",
-      "paragraph": "段落2.1",
-      "type": "实质",
-      "feature": "人物角色基座",
-      "highlight": "优雅的白裙写生少女"
-    },
-    {
-      "image": "img_3",
-      "paragraph": "段落3.1",
-      "type": "实质",
-      "feature": "人物角色基座",
-      "highlight": "优雅的白裙写生少女"
-    },
-    {
-      "image": "img_4",
-      "paragraph": "段落4.1.1",
-      "type": "实质",
-      "feature": "人物角色基座",
-      "highlight": "优雅的白裙写生少女"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5.1",
-      "type": "实质",
-      "feature": "人物角色基座",
-      "highlight": "优雅的白裙写生少女"
-    }
-  ],
-  "consistency_elements": [
-    "女性",
-    "女性衣物"
-  ],
-  "generation_notes": "使用IP-Adapter注入人物一致性,配合DWPose控制姿态"
-}

Plik diff jest za duży
+ 0 - 2
examples/feature_extract/huahua/features/color_scheme/color_scheme.json


+ 0 - 150
examples/feature_extract/huahua/features/color_scheme/color_scheme_complete.json

@@ -1,150 +0,0 @@
-{
-  "dimension": "color_scheme",
-  "type": "形式",
-  "highlight_cluster": "清新雅致的白绿配色",
-  "description": "大面积高饱和度自然草木绿背景与人物衣着纯白形成鲜明对比,确立清新自然治愈感的森系视觉基调",
-  "core_contrast": {
-    "formula": "Pure White (#FFFFFF) vs Vivid Green (HSV: 100-120°, S>60%, V>40%)",
-    "contrast_ratio": ">4:1",
-    "sd_tokens": "pure white dress, vivid green background, high contrast, fresh natural color palette, forest aesthetic"
-  },
-  "color_groups": {
-    "white_green_contrast": {
-      "primary_white": {
-        "hex": "#FFFFFF",
-        "rgb": [
-          255,
-          255,
-          255
-        ],
-        "role": "人物白裙 - 纯净主体色"
-      },
-      "vivid_green_1": {
-        "hex": "#4A7C3F",
-        "rgb": [
-          74,
-          124,
-          63
-        ],
-        "role": "自然草木绿 - 高饱和背景"
-      },
-      "vivid_green_2": {
-        "hex": "#6C9255",
-        "rgb": [
-          108,
-          146,
-          85
-        ],
-        "role": "浅草绿 - 中景草地"
-      },
-      "deep_green": {
-        "hex": "#1F2D1E",
-        "rgb": [
-          31,
-          45,
-          30
-        ],
-        "role": "深绿 - 树木阴影"
-      }
-    },
-    "warm_light_accent": {
-      "golden_hour": {
-        "hex": "#D4A853",
-        "rgb": [
-          212,
-          168,
-          83
-        ],
-        "role": "逆光金色 - 光晕暖色"
-      },
-      "warm_skin": {
-        "hex": "#E8C4A0",
-        "rgb": [
-          232,
-          196,
-          160
-        ],
-        "role": "肤色暖调"
-      }
-    },
-    "palette_colors": {
-      "palette_green": {
-        "hex": "#4A8C3F",
-        "rgb": [
-          74,
-          140,
-          63
-        ],
-        "role": "调色板绿色颜料"
-      },
-      "palette_blue": {
-        "hex": "#2E5FA3",
-        "rgb": [
-          46,
-          95,
-          163
-        ],
-        "role": "调色板蓝色颜料"
-      },
-      "palette_red": {
-        "hex": "#C0392B",
-        "rgb": [
-          192,
-          57,
-          43
-        ],
-        "role": "调色板红色颜料"
-      },
-      "palette_yellow": {
-        "hex": "#F1C40F",
-        "rgb": [
-          241,
-          196,
-          15
-        ],
-        "role": "调色板黄色颜料"
-      },
-      "palette_purple": {
-        "hex": "#8E44AD",
-        "rgb": [
-          142,
-          68,
-          173
-        ],
-        "role": "调色板紫色颜料"
-      }
-    }
-  },
-  "per_image_dominant": {
-    "img_1": {
-      "primary": "#3C4C34",
-      "secondary": "#FFFFFF",
-      "accent": "#8E9E9F",
-      "mood": "清新自然"
-    },
-    "img_2": {
-      "primary": "#2D4A2A",
-      "secondary": "#FFFFFF",
-      "accent": "#D4A853",
-      "mood": "逆光梦幻"
-    },
-    "img_3": {
-      "primary": "#4A7C3F",
-      "secondary": "#FFFFFF",
-      "accent": "#C8A870",
-      "mood": "温暖田园"
-    },
-    "img_4": {
-      "primary": "#5A8A45",
-      "secondary": "#FFFFFF",
-      "accent": "#7AB060",
-      "mood": "清新明亮"
-    },
-    "img_5": {
-      "primary": "#4A7C3F",
-      "secondary": "#FFFFFF",
-      "accent": "#8B6914",
-      "mood": "艺术创作"
-    }
-  }
-}

BIN
examples/feature_extract/huahua/features/color_scheme/color_scheme_visual.png


BIN
examples/feature_extract/huahua/features/color_scheme/color_swatch.png


+ 0 - 132
examples/feature_extract/huahua/features/color_scheme/img_1_colors.json

@@ -1,132 +0,0 @@
-{
-  "dominant_colors": [
-    {
-      "hex": "#1f2d1e",
-      "rgb": [
-        31,
-        45,
-        30
-      ],
-      "hsv": [
-        58,
-        85,
-        45
-      ],
-      "ratio": 0.199,
-      "percentage": "19.9%"
-    },
-    {
-      "hex": "#3c4c34",
-      "rgb": [
-        60,
-        76,
-        52
-      ],
-      "hsv": [
-        50,
-        81,
-        76
-      ],
-      "ratio": 0.1802,
-      "percentage": "18.0%"
-    },
-    {
-      "hex": "#567642",
-      "rgb": [
-        86,
-        118,
-        66
-      ],
-      "hsv": [
-        48,
-        112,
-        118
-      ],
-      "ratio": 0.1618,
-      "percentage": "16.2%"
-    },
-    {
-      "hex": "#6c9255",
-      "rgb": [
-        108,
-        146,
-        85
-      ],
-      "hsv": [
-        49,
-        107,
-        146
-      ],
-      "ratio": 0.1498,
-      "percentage": "15.0%"
-    },
-    {
-      "hex": "#8e9e9f",
-      "rgb": [
-        142,
-        158,
-        159
-      ],
-      "hsv": [
-        92,
-        27,
-        159
-      ],
-      "ratio": 0.1126,
-      "percentage": "11.3%"
-    },
-    {
-      "hex": "#a6b6bd",
-      "rgb": [
-        166,
-        182,
-        189
-      ],
-      "hsv": [
-        99,
-        31,
-        189
-      ],
-      "ratio": 0.0862,
-      "percentage": "8.6%"
-    },
-    {
-      "hex": "#607d7e",
-      "rgb": [
-        96,
-        125,
-        126
-      ],
-      "hsv": [
-        91,
-        61,
-        126
-      ],
-      "ratio": 0.0554,
-      "percentage": "5.5%"
-    },
-    {
-      "hex": "#c5d3dd",
-      "rgb": [
-        197,
-        211,
-        221
-      ],
-      "hsv": [
-        103,
-        28,
-        221
-      ],
-      "ratio": 0.055,
-      "percentage": "5.5%"
-    }
-  ],
-  "color_temperature": "neutral",
-  "saturation_level": "medium",
-  "brightness_level": "dark",
-  "white_green_contrast": {
-    "description": "High contrast between pure white (dress) and vivid green (natural background)",
-    "white_ratio": 0,
-    "green_ratio": 0.3116
-  }
-}

BIN
examples/feature_extract/huahua/features/color_scheme/img_1_palette.png


+ 0 - 132
examples/feature_extract/huahua/features/color_scheme/img_2_colors.json

@@ -1,132 +0,0 @@
-{
-  "dominant_colors": [
-    {
-      "hex": "#94b164",
-      "rgb": [
-        148,
-        177,
-        100
-      ],
-      "hsv": [
-        41,
-        111,
-        177
-      ],
-      "ratio": 0.1993,
-      "percentage": "19.9%"
-    },
-    {
-      "hex": "#edf0ee",
-      "rgb": [
-        237,
-        240,
-        238
-      ],
-      "hsv": [
-        70,
-        3,
-        240
-      ],
-      "ratio": 0.1808,
-      "percentage": "18.1%"
-    },
-    {
-      "hex": "#c7d4d4",
-      "rgb": [
-        199,
-        212,
-        212
-      ],
-      "hsv": [
-        90,
-        16,
-        212
-      ],
-      "ratio": 0.1391,
-      "percentage": "13.9%"
-    },
-    {
-      "hex": "#454233",
-      "rgb": [
-        69,
-        66,
-        51
-      ],
-      "hsv": [
-        25,
-        67,
-        69
-      ],
-      "ratio": 0.1192,
-      "percentage": "11.9%"
-    },
-    {
-      "hex": "#808a5f",
-      "rgb": [
-        128,
-        138,
-        95
-      ],
-      "hsv": [
-        37,
-        79,
-        138
-      ],
-      "ratio": 0.1177,
-      "percentage": "11.8%"
-    },
-    {
-      "hex": "#5f604b",
-      "rgb": [
-        95,
-        96,
-        75
-      ],
-      "hsv": [
-        31,
-        56,
-        96
-      ],
-      "ratio": 0.1042,
-      "percentage": "10.4%"
-    },
-    {
-      "hex": "#c5b994",
-      "rgb": [
-        197,
-        185,
-        148
-      ],
-      "hsv": [
-        23,
-        63,
-        197
-      ],
-      "ratio": 0.0879,
-      "percentage": "8.8%"
-    },
-    {
-      "hex": "#8aa6a4",
-      "rgb": [
-        138,
-        166,
-        164
-      ],
-      "hsv": [
-        88,
-        43,
-        166
-      ],
-      "ratio": 0.0518,
-      "percentage": "5.2%"
-    }
-  ],
-  "color_temperature": "neutral",
-  "saturation_level": "low",
-  "brightness_level": "bright",
-  "white_green_contrast": {
-    "description": "High contrast between pure white (dress) and vivid green (natural background)",
-    "white_ratio": 0.1808,
-    "green_ratio": 0.5496
-  }
-}

BIN
examples/feature_extract/huahua/features/color_scheme/img_2_palette.png


+ 0 - 132
examples/feature_extract/huahua/features/color_scheme/img_3_colors.json

@@ -1,132 +0,0 @@
-{
-  "dominant_colors": [
-    {
-      "hex": "#f5f6f3",
-      "rgb": [
-        245,
-        246,
-        243
-      ],
-      "hsv": [
-        40,
-        3,
-        246
-      ],
-      "ratio": 0.1762,
-      "percentage": "17.6%"
-    },
-    {
-      "hex": "#839c56",
-      "rgb": [
-        131,
-        156,
-        86
-      ],
-      "hsv": [
-        41,
-        114,
-        156
-      ],
-      "ratio": 0.1738,
-      "percentage": "17.4%"
-    },
-    {
-      "hex": "#6b744d",
-      "rgb": [
-        107,
-        116,
-        77
-      ],
-      "hsv": [
-        37,
-        86,
-        116
-      ],
-      "ratio": 0.1655,
-      "percentage": "16.6%"
-    },
-    {
-      "hex": "#a1bd67",
-      "rgb": [
-        161,
-        189,
-        103
-      ],
-      "hsv": [
-        40,
-        116,
-        189
-      ],
-      "ratio": 0.1475,
-      "percentage": "14.8%"
-    },
-    {
-      "hex": "#4f5139",
-      "rgb": [
-        79,
-        81,
-        57
-      ],
-      "hsv": [
-        33,
-        76,
-        81
-      ],
-      "ratio": 0.1119,
-      "percentage": "11.2%"
-    },
-    {
-      "hex": "#cadee1",
-      "rgb": [
-        202,
-        222,
-        225
-      ],
-      "hsv": [
-        94,
-        26,
-        225
-      ],
-      "ratio": 0.1059,
-      "percentage": "10.6%"
-    },
-    {
-      "hex": "#c2c0a4",
-      "rgb": [
-        194,
-        192,
-        164
-      ],
-      "hsv": [
-        28,
-        39,
-        194
-      ],
-      "ratio": 0.0803,
-      "percentage": "8.0%"
-    },
-    {
-      "hex": "#749da1",
-      "rgb": [
-        116,
-        157,
-        161
-      ],
-      "hsv": [
-        93,
-        71,
-        161
-      ],
-      "ratio": 0.0389,
-      "percentage": "3.9%"
-    }
-  ],
-  "color_temperature": "neutral",
-  "saturation_level": "low",
-  "brightness_level": "medium",
-  "white_green_contrast": {
-    "description": "High contrast between pure white (dress) and vivid green (natural background)",
-    "white_ratio": 0.2821,
-    "green_ratio": 0.6629999999999999
-  }
-}

BIN
examples/feature_extract/huahua/features/color_scheme/img_3_palette.png


+ 0 - 132
examples/feature_extract/huahua/features/color_scheme/img_4_colors.json

@@ -1,132 +0,0 @@
-{
-  "dominant_colors": [
-    {
-      "hex": "#5e6f3f",
-      "rgb": [
-        94,
-        111,
-        63
-      ],
-      "hsv": [
-        41,
-        110,
-        111
-      ],
-      "ratio": 0.2054,
-      "percentage": "20.5%"
-    },
-    {
-      "hex": "#7a7b4c",
-      "rgb": [
-        122,
-        123,
-        76
-      ],
-      "hsv": [
-        31,
-        97,
-        123
-      ],
-      "ratio": 0.1574,
-      "percentage": "15.7%"
-    },
-    {
-      "hex": "#968e58",
-      "rgb": [
-        150,
-        142,
-        88
-      ],
-      "hsv": [
-        26,
-        105,
-        150
-      ],
-      "ratio": 0.1407,
-      "percentage": "14.1%"
-    },
-    {
-      "hex": "#dce2e2",
-      "rgb": [
-        220,
-        226,
-        226
-      ],
-      "hsv": [
-        90,
-        7,
-        226
-      ],
-      "ratio": 0.1277,
-      "percentage": "12.8%"
-    },
-    {
-      "hex": "#50562a",
-      "rgb": [
-        80,
-        86,
-        42
-      ],
-      "hsv": [
-        34,
-        130,
-        86
-      ],
-      "ratio": 0.127,
-      "percentage": "12.7%"
-    },
-    {
-      "hex": "#ad9d7a",
-      "rgb": [
-        173,
-        157,
-        122
-      ],
-      "hsv": [
-        21,
-        75,
-        173
-      ],
-      "ratio": 0.0945,
-      "percentage": "9.4%"
-    },
-    {
-      "hex": "#c2bcac",
-      "rgb": [
-        194,
-        188,
-        172
-      ],
-      "hsv": [
-        22,
-        29,
-        194
-      ],
-      "ratio": 0.0868,
-      "percentage": "8.7%"
-    },
-    {
-      "hex": "#2e321c",
-      "rgb": [
-        46,
-        50,
-        28
-      ],
-      "hsv": [
-        35,
-        112,
-        50
-      ],
-      "ratio": 0.0605,
-      "percentage": "6.0%"
-    }
-  ],
-  "color_temperature": "neutral",
-  "saturation_level": "medium",
-  "brightness_level": "medium",
-  "white_green_contrast": {
-    "description": "High contrast between pure white (dress) and vivid green (natural background)",
-    "white_ratio": 0.1277,
-    "green_ratio": 0.3628
-  }
-}

BIN
examples/feature_extract/huahua/features/color_scheme/img_4_palette.png


+ 0 - 132
examples/feature_extract/huahua/features/color_scheme/img_5_colors.json

@@ -1,132 +0,0 @@
-{
-  "dominant_colors": [
-    {
-      "hex": "#3d5c2a",
-      "rgb": [
-        61,
-        92,
-        42
-      ],
-      "hsv": [
-        49,
-        139,
-        92
-      ],
-      "ratio": 0.2671,
-      "percentage": "26.7%"
-    },
-    {
-      "hex": "#e9ecef",
-      "rgb": [
-        233,
-        236,
-        239
-      ],
-      "hsv": [
-        105,
-        6,
-        239
-      ],
-      "ratio": 0.2276,
-      "percentage": "22.8%"
-    },
-    {
-      "hex": "#c2cace",
-      "rgb": [
-        194,
-        202,
-        206
-      ],
-      "hsv": [
-        100,
-        15,
-        206
-      ],
-      "ratio": 0.195,
-      "percentage": "19.5%"
-    },
-    {
-      "hex": "#2d7065",
-      "rgb": [
-        45,
-        112,
-        101
-      ],
-      "hsv": [
-        85,
-        153,
-        112
-      ],
-      "ratio": 0.0843,
-      "percentage": "8.4%"
-    },
-    {
-      "hex": "#b0aba5",
-      "rgb": [
-        176,
-        171,
-        165
-      ],
-      "hsv": [
-        16,
-        16,
-        176
-      ],
-      "ratio": 0.0753,
-      "percentage": "7.5%"
-    },
-    {
-      "hex": "#1e2f1e",
-      "rgb": [
-        30,
-        47,
-        30
-      ],
-      "hsv": [
-        60,
-        92,
-        47
-      ],
-      "ratio": 0.0533,
-      "percentage": "5.3%"
-    },
-    {
-      "hex": "#927756",
-      "rgb": [
-        146,
-        119,
-        86
-      ],
-      "hsv": [
-        17,
-        105,
-        146
-      ],
-      "ratio": 0.0524,
-      "percentage": "5.2%"
-    },
-    {
-      "hex": "#6196b6",
-      "rgb": [
-        97,
-        150,
-        182
-      ],
-      "hsv": [
-        101,
-        119,
-        182
-      ],
-      "ratio": 0.045,
-      "percentage": "4.5%"
-    }
-  ],
-  "color_temperature": "neutral",
-  "saturation_level": "low",
-  "brightness_level": "medium",
-  "white_green_contrast": {
-    "description": "High contrast between pure white (dress) and vivid green (natural background)",
-    "white_ratio": 0.2276,
-    "green_ratio": 0.0843
-  }
-}

BIN
examples/feature_extract/huahua/features/color_scheme/img_5_palette.png


+ 0 - 56
examples/feature_extract/huahua/features/color_scheme/mapping.json

@@ -1,56 +0,0 @@
-{
-  "dimension": "color_scheme",
-  "type": "形式",
-  "highlight_cluster": "清新雅致的白绿配色",
-  "description": "大面积高饱和度自然草木绿背景与人物衣着纯白形成鲜明对比,确立清新自然治愈感的森系视觉基调",
-  "files": {
-    "color_scheme_visual.png": {
-      "type": "视觉参考图",
-      "purpose": "完整色彩方案可视化,包含白绿对比、暖光色调、调色板颜料色三组配色",
-      "tool": "Python PIL生成"
-    },
-    "color_scheme_complete.json": {
-      "type": "完整色彩数据",
-      "purpose": "包含所有颜色组的HEX值、RGB值、角色描述和SD提示词"
-    },
-    "img_1_palette.png": "img_1色板可视化(白绿配色典型)",
-    "img_4_palette.png": "img_4色板可视化(白绿配色最典型)"
-  },
-  "key_colors": {
-    "primary_white": {
-      "hex": "#FFFFFF",
-      "role": "人物白裙,纯净主体色",
-      "sd_token": "pure white dress, white clothing"
-    },
-    "primary_green": {
-      "hex": "#4A7C3F",
-      "role": "自然草木绿背景,高饱和度",
-      "sd_token": "lush green grass, vivid green trees, saturated green background"
-    },
-    "accent_warm": {
-      "hex": "#D4A853",
-      "role": "阳光暖色调,逆光光晕",
-      "sd_token": "warm sunlight, golden hour light"
-    }
-  },
-  "color_contrast_formula": "High contrast: Pure white (#FFFFFF) vs Vivid green (HSV: 100-120°, S>60%, V>40%)",
-  "sd_tokens": "pure white dress, vivid green background, high contrast, fresh natural color palette, forest aesthetic, white and green color scheme",
-  "mapping": [
-    {
-      "image": "img_1",
-      "paragraph": "段落1",
-      "type": "形式",
-      "feature": "白绿配色",
-      "specific": "白裙+绿色草地背景",
-      "path": "features/color_scheme/color_scheme_visual.png"
-    },
-    {
-      "image": "img_4",
-      "paragraph": "段落4",
-      "type": "形式",
-      "feature": "白绿配色",
-      "specific": "白裙+高饱和绿色背景(最典型)",
-      "path": "features/color_scheme/color_scheme_visual.png"
-    }
-  ]
-}

BIN
examples/feature_extract/huahua/features/depth_map/depth_img_1.png


BIN
examples/feature_extract/huahua/features/depth_map/depth_img_2.png


BIN
examples/feature_extract/huahua/features/depth_map/depth_img_3.png


BIN
examples/feature_extract/huahua/features/depth_map/depth_img_4.png


BIN
examples/feature_extract/huahua/features/depth_map/depth_img_5.png


+ 0 - 79
examples/feature_extract/huahua/features/depth_map/mapping.json

@@ -1,79 +0,0 @@
-{
-  "dimension": "depth_map",
-  "type": "形式",
-  "description": "深度图,用于ControlNet深度控制,反映场景空间层次和浅景深效果",
-  "valid_files": {
-    "depth_img_1.png": {
-      "source": "img_1",
-      "method": "局部方差法(清晰度代理深度)",
-      "mean": 72.3
-    },
-    "depth_img_2.png": {
-      "source": "img_2",
-      "method": "局部方差法(清晰度代理深度)",
-      "mean": 79.1
-    },
-    "depth_img_3.png": {
-      "source": "img_3",
-      "method": "局部方差法(清晰度代理深度)",
-      "mean": 93.1
-    },
-    "depth_img_4.png": {
-      "source": "img_4",
-      "method": "局部方差法(清晰度代理深度)",
-      "mean": 82.5
-    },
-    "depth_img_5.png": {
-      "source": "img_5",
-      "method": "局部方差法(清晰度代理深度)",
-      "mean": 65.8
-    }
-  },
-  "tool_limitation": "当前使用OpenCV局部方差法(清晰度作为深度代理),非真实深度估计。建议生产环境使用MiDaS/DPT-Large/Depth-Anything-V2模型获取更精准的深度图。",
-  "recommended_tool": "Depth-Anything-V2 (2024年最新,精度最高) 或 MiDaS v3.1",
-  "depth_interpretation": {
-    "white": "近景(清晰区域)- 人物、画架、调色板",
-    "gray": "中景",
-    "black": "远景(虚化区域)- 背景树木草地"
-  },
-  "mapping": [
-    {
-      "image": "img_2",
-      "paragraph": "段落2",
-      "type": "形式",
-      "feature": "景深空间关系",
-      "highlight": "唯美梦幻的光影与景深",
-      "path": "features/depth_map/depth_img_2.png"
-    },
-    {
-      "image": "img_3",
-      "paragraph": "段落3",
-      "type": "形式",
-      "feature": "景深空间关系",
-      "highlight": "唯美梦幻的光影与景深",
-      "path": "features/depth_map/depth_img_3.png"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5",
-      "type": "形式",
-      "feature": "景深空间关系",
-      "highlight": "唯美梦幻的光影与景深",
-      "path": "features/depth_map/depth_img_5.png"
-    },
-    {
-      "image": "img_1",
-      "paragraph": "段落1",
-      "type": "形式",
-      "feature": "景深空间关系",
-      "path": "features/depth_map/depth_img_1.png"
-    },
-    {
-      "image": "img_4",
-      "paragraph": "段落4",
-      "type": "形式",
-      "feature": "景深空间关系",
-      "path": "features/depth_map/depth_img_4.png"
-    }
-  ]
-}

BIN
examples/feature_extract/huahua/features/easel_asset/easel_blank_canvas_img4.png


+ 0 - 55
examples/feature_extract/huahua/features/easel_asset/mapping.json

@@ -1,55 +0,0 @@
-{
-  "dimension": "easel_asset",
-  "type": "实质",
-  "highlight_cluster": "构建叙事的写生道具",
-  "description": "木质三脚画架本体素材,包含两种状态:承载进行中油画的画架(img_3)和承载空白画布+白玫瑰的画架(img_4)",
-  "files": {
-    "easel_blank_canvas_img4.png": {
-      "source_image": "img_4",
-      "state": "easel with blank white canvas + white rose on crossbar",
-      "purpose": "画架+空白画布+白玫瑰参考,用于写生道具叙事场景"
-    }
-  },
-  "missing_files": {
-    "easel_with_painting_img3.png": "画架+进行中油画参考图已删除"
-  },
-  "mapping": [
-    {
-      "image": "img_1",
-      "paragraph": "段落1.2",
-      "type": "实质",
-      "feature": "木质三脚画架",
-      "highlight": "构建叙事的写生道具"
-    },
-    {
-      "image": "img_2",
-      "paragraph": "段落2.2",
-      "type": "实质",
-      "feature": "木质三脚画架",
-      "highlight": "构建叙事的写生道具"
-    },
-    {
-      "image": "img_3",
-      "paragraph": "段落3.2",
-      "type": "实质",
-      "feature": "木质三脚画架(含油画)",
-      "highlight": "构建叙事的写生道具"
-    },
-    {
-      "image": "img_4",
-      "paragraph": "段落4.2",
-      "type": "实质",
-      "feature": "木质三脚画架(空白画布+白玫瑰)",
-      "highlight": "构建叙事的写生道具"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5.2",
-      "type": "实质",
-      "feature": "木质三脚画架(局部可见)",
-      "highlight": "构建叙事的写生道具"
-    }
-  ],
-  "consistency_elements": ["画架与画布", "画架与油画"],
-  "generation_notes": "画架为浅棕色木质三脚架结构,高约150-180cm,宽约60-80cm,顶部有可调节画板支撑架,底部有横向支撑杆"
-}

BIN
examples/feature_extract/huahua/features/edge_map/img_1_canny.png


BIN
examples/feature_extract/huahua/features/edge_map/img_2_canny.png


BIN
examples/feature_extract/huahua/features/edge_map/img_3_canny.png


BIN
examples/feature_extract/huahua/features/edge_map/img_4_canny.png


BIN
examples/feature_extract/huahua/features/edge_map/img_5_canny.png


+ 0 - 45
examples/feature_extract/huahua/features/edge_map/mapping.json

@@ -1,45 +0,0 @@
-{
-  "dimension": "edge_map",
-  "type": "形式",
-  "description": "Canny边缘检测图,用于ControlNet结构控制,保留人物轮廓、画架结构等关键线条",
-  "tool": "OpenCV Canny边缘检测 (threshold: 50-150)",
-  "files": {
-    "img_1_canny.png": "img_1 Canny边缘图",
-    "img_2_canny.png": "img_2 Canny边缘图",
-    "img_3_canny.png": "img_3 Canny边缘图",
-    "img_4_canny.png": "img_4 Canny边缘图",
-    "img_5_canny.png": "img_5 Canny边缘图"
-  },
-  "mapping": [
-    {
-      "image": "img_1",
-      "paragraph": "段落1",
-      "type": "形式",
-      "feature": "结构边缘控制"
-    },
-    {
-      "image": "img_2",
-      "paragraph": "段落2",
-      "type": "形式",
-      "feature": "结构边缘控制"
-    },
-    {
-      "image": "img_3",
-      "paragraph": "段落3",
-      "type": "形式",
-      "feature": "结构边缘控制"
-    },
-    {
-      "image": "img_4",
-      "paragraph": "段落4",
-      "type": "形式",
-      "feature": "结构边缘控制"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5",
-      "type": "形式",
-      "feature": "结构边缘控制"
-    }
-  ]
-}

+ 0 - 155
examples/feature_extract/huahua/features/lighting_bokeh/lighting_analysis.json

@@ -1,155 +0,0 @@
-{
-  "dimension": "lighting_bokeh",
-  "type": "形式",
-  "highlight_cluster": "唯美梦幻的光影与景深",
-  "description": "逆光/轮廓光与大光圈浅景深(Bokeh)的组合,营造梦幻浪漫的视觉氛围",
-  "per_image_analysis": {
-    "img_2": {
-      "paragraph": "段落2",
-      "analysis": {
-        "lighting_type": {
-          "direction": "Backlit, approximately 45° upper-left from the subject's perspective, emanating from behind the subject and slightly to the left, filtering through foliage.",
-          "quality": "Soft and diffused, originating from a large, natural light source (the sun), with localized hard spots and flaring where direct rays penetrate foliage.",
-          "color_temperature": "Approximately 4500K-5000K, consistent with golden hour or late afternoon sunlight, exhibiting a warm golden hue.",
-          "intensity_ratio": "High key-to-fill ratio, estimated 8:1 to 10:1. The key light (sun) is directly behind, creating significant backlighting and leaving the subject's front in deep shadow. Fill light is minimal, likely ambient bounce from the surroundings, allowing for soft detail in the shadows.",
-          "special_effects": "Pronounced lens flare emanating from the upper-left behind the subject, characterized by bright, amorphous glows and some visible starbursts. Strong rim lighting outlining the subject's hair, shoulders, and parts of the easel, providing separation from the background. Sun rays are partially visible filtering through leaves, creating bright light spots and specular highlights in the background bokeh."
-        },
-        "bokeh_dof": {
-          "estimated_aperture": "f/1.8-f/2.8, indicated by the extremely shallow depth of field, especially in the background foliage and the immediate foreground of the grass.",
-          "focus_plane_description": "The primary focus plane is on the subject's hair and back, extending to the canvas on the easel. The subject's dress and the easel are within the area of acceptable sharpness.",
-          "bokeh_quality": "Circular and smooth, characteristic of a wide aperture and quality lens. The background light sources are rendered as large, soft, circular or slightly elliptical disks of light (bokeh balls).",
-          "background_blur_intensity": "Heavy blur, almost entirely obscuring the detail of distant trees and foliage, rendering them as abstract shapes and colors.",
-          "foreground_blur": "Moderate blur in the grass immediately in front of the subject, softening the texture without completely dissolving it."
-        },
-        "atmosphere": {
-          "overall_mood_keywords": [
-            "dreamy",
-            "serene",
-            "ethereal",
-            "romantic",
-            "artistic"
-          ],
-          "haze_level": "Slight atmospheric haze, contributing to the soft diffusion of light and some reduction in overall contrast, particularly in the background.",
-          "contrast_ratio": "Medium-high contrast due to the strong backlighting and resultant shadow areas on the subject, balanced by the soft, diffused background. Overall image tone leans towards a luminous, slightly desaturated aesthetic."
-        },
-        "sd_prompt_tokens": [
-          "backlit",
-          "rim lighting",
-          "lens flare",
-          "bokeh",
-          "shallow depth of field",
-          "golden hour",
-          "warm light",
-          "f/2.0 aperture",
-          "dreamy atmosphere",
-          "painterly light",
-          "soft focus",
-          "diffused sunlight",
-          "cinematic lighting",
-          "portrait photography",
-          "85mm lens"
-        ]
-      }
-    },
-    "img_3": {
-      "paragraph": "段落3",
-      "analysis": {
-        "lighting_type": {
-          "direction": "15° upper-left backlight (implied sun position)",
-          "quality": "Direct, somewhat diffused by atmospheric haze/distance",
-          "color_temperature": "3200K-3800K warm golden (golden hour)",
-          "intensity_ratio": "Key:fill 4:1 (strong backlight, soft fill from ambient bounce)",
-          "special_effects": "pronounced rim light on subject (hair, dress edges), subtle lens flare top-left, atmospheric glow"
-        },
-        "bokeh_dof": {
-          "estimated_aperture": "f/2.2-f/3.5",
-          "focus_plane_description": "Sharpest focus is on the back of the subject's head/upper back and the painting on the easel. The ground immediately around the subject is also within the acceptable sharpness depth.",
-          "bokeh_quality": "Smooth, circular (implied) for distant background highlights, generally creamy.",
-          "background_blur_intensity": "Heavy for distant trees/structures, moderate for closer trees.",
-          "foreground_blur_if_any": "Slight to moderate blur on the grass immediately in front of the subject's knees, becoming sharper closer to the subject's body."
-        },
-        "atmosphere": {
-          "overall_mood_keywords": [
-            "dreamy",
-            "serene",
-            "idyllic",
-            "romantic",
-            "artistic"
-          ],
-          "haze_fog_level": "Low atmospheric haze, contributing to the soft glow and light diffusion.",
-          "contrast_ratio": "Moderate-low (due to strong backlight and ambient fill, shadows are lifted)"
-        },
-        "sd_prompt_tokens": [
-          "backlit",
-          "rim lighting",
-          "lens flare",
-          "bokeh",
-          "shallow depth of field",
-          "golden hour",
-          "warm light",
-          "f/2.8 aperture",
-          "85mm lens",
-          "dreamy atmosphere",
-          "outdoor portrait",
-          "natural light",
-          "soft focus",
-          "creamy bokeh",
-          "glowing edges"
-        ]
-      }
-    },
-    "img_5": {
-      "paragraph": "段落5",
-      "analysis": {
-        "lighting_type": {
-          "direction": "Approximately 75° upper-right backlight (over-the-shoulder light for the subject's left (our right) side, providing rim light to the right shoulder and subtle glow on the left shoulder and upper arm)",
-          "quality": "Soft and moderately diffused. While the source is direct sunlight, the angle inherently diffuses it for the front of the subject. The grass background suggests an open-sky condition rather than direct harsh sunlight on the primary subject.",
-          "color_temperature": "6000K-6500K cool daylight with a subtle warm undertone from the environment (e.g., golden hour nearing completion, or light reflecting off warm surfaces). There's no distinct 'golden hour' warmth, but a slight warmth compared to pure overcast.",
-          "intensity_ratio": "Key:Fill approximately 3:1 to 4:1. The backlighting creates a slightly higher contrast on the back/rim, but the subject's front is still well-lit by environmental fill, suggesting a relatively bright ambient scene.",
-          "special_effects": "Subtle top-right rim light on the subject's right arm and shoulder, and a gentle glow on the fabric. No discernable lens flare or light leaks."
-        },
-        "bokeh_dof": {
-          "estimated_aperture": "f/2.8-f/4.0",
-          "focus_plane_description": "The primary focus is sharply on the artist's hands and the paint palette. The artist's upper body (torso and arms) is also acceptably sharp, indicating a relatively wide focus plane. The easel (left edge) is slightly softer than the palette, and the background grass is distinctly blurred.",
-          "bokeh_quality": "Smooth, creamy, and uniform bokeh. The highlights in the grass are subtly rendered, suggesting well-rounded aperture blades. No noticeable hexagonal or busy artifacts.",
-          "background_blur_intensity": "Heavy. The background grass is rendered as a soft wash of green tones, completely indistinct, indicating a very shallow depth of field.",
-          "foreground_blur": "Minimal to none, with the exception of the very bottom-left corner of the easel stand being slightly less sharp than the palette."
-        },
-        "atmosphere": {
-          "overall_mood_keywords": [
-            "Serene",
-            "Artistic",
-            "Calm",
-            "Ethereal",
-            "Fresh"
-          ],
-          "haze_fog_level": "None",
-          "contrast_ratio": "Medium-low (soft shadows, highlights are not blown out, good detail retention across mid-tones, but the backlighting does create some subtle contrast on edges)."
-        },
-        "sd_prompt_tokens": [
-          "backlit",
-          "soft light",
-          "rim lighting",
-          "shallow depth of field",
-          "bokeh",
-          "creamy bokeh",
-          "f/2.8",
-          "natural light",
-          "outdoor photography",
-          "daylight",
-          "green background",
-          "artistic",
-          "painter",
-          "close-up",
-          "ethereal atmosphere"
-        ]
-      }
-    }
-  },
-  "common_features": {
-    "lighting_style": "Natural backlight / rim light from upper-left, warm golden hour quality",
-    "bokeh_style": "Shallow DOF with smooth circular bokeh, heavy background blur",
-    "atmosphere": "Dreamy, romantic, ethereal, air-like, warm",
-    "sd_tokens_base": "backlit, rim lighting, bokeh, shallow depth of field, golden hour, warm sunlight, dreamy atmosphere, soft light, lens flare, f/1.8, 85mm lens, outdoor natural light"
-  }
-}

+ 0 - 28
examples/feature_extract/huahua/features/lighting_bokeh/lighting_img_2.json

@@ -1,28 +0,0 @@
-{
-  "light_source": {
-    "direction": "Predominantly backlight. The sun is positioned behind the subject, acting as a strong backlight and creating a rim light effect.",
-    "quality": "Soft. The strong backlight is somewhat diffused, most likely due to atmospheric conditions or the presence of clouds dispersing the direct sunlight.",
-    "color_temperature": "Approximately 5500-6000K. Suggesting golden hour or late afternoon light."
-  },
-  "bokeh_dof": {
-    "aperture_estimate": "f/2.8 - f/4. The background exhibits noticeable blur, but not extreme. This suggests a moderate aperture.",
-    "bokeh_shape": "Circular. The highlights in the blurry background of tree leves appear round and smooth.",
-    "background_blur_intensity": "7",
-    "foreground_sharpness": "Soft, not a major emphasis on maximum microcontrast. Appears in focus but softened."
-  },
-  "light_interaction": {
-    "dress": "The white dress glows due to the backlight, producing highlights along its edges. Some translucency may be present if the fabric is thin. The texture is well defined.",
-    "hair": "The hair has significant highlights from the backlight, creating separation from the background creating a visual edge of light.",
-    "rim_light_effect": "Effective rim light creates a glowing outline around the subject, separating the figure from the background."
-  },
-  "atmosphere": {
-    "overall_mood": "Dreamy, romantic, and ethereal. The soft, golden light creates the mood that evokes nostalgia and a sense of peace.",
-    "atmosphere_description": "Relaxed and serene. Warm golden light creates a sense of peacefulness."
-  },
-  "controlnet_params": {
-    "brightness": "1.1",
-    "contrast": "0.95",
-    "saturation": "1.05",
-    "color_temperature": "5800"
-  }
-}

+ 0 - 26
examples/feature_extract/huahua/features/lighting_bokeh/lighting_img_3.json

@@ -1,26 +0,0 @@
-{
-  "light_source": {
-    "direction": "Backlight/Rim Light, slightly from the side",
-    "quality": "Soft",
-    "color_temperature": "Approximately 5800K-6200K (Golden Hour, warm)"
-  },
-  "bokeh_dof": {
-    "aperture_estimate": "Around f/2.8 to f/4",
-    "bokeh_shape": "Indiscernible, due to strong blur",
-    "background_blur_intensity": "7",
-    "foreground_sharpness": "The grass in the foreground is moderately sharp but becomes progressively softer with distance from the camera."
-  },
-  "light_interaction": {
-    "dress": "The white dress has a gentle glow and is almost translucent where light contacts it, showing the texture of the garment and creating subtle rim lighting along its edges. There is separation between the dress and the background.",
-    "hair_highlight": "Highlights catch the top layer of the hair and outlines it, creating nice separation. "
-  },
-  "atmosphere": {
-    "mood": "Dreamy, romantic, gentle, nostalgic"
-  },
-  "controlnet_params": {
-    "brightness": "1.05",
-    "contrast": "0.98",
-    "saturation": "1.02",
-    "color_temperature": "6000"
-  }
-}

+ 0 - 27
examples/feature_extract/huahua/features/lighting_bokeh/lighting_img_5.json

@@ -1,27 +0,0 @@
-{
-  "light_source": {
-    "direction": "Predominantly soft, diffused backlight from the left.",
-    "quality": "Soft light, lacking hard shadows. Likely overcast sky or large diffusion panel used",
-    "color_temperature": "Approximately 5800K-6000K (daylight)"
-  },
-  "bokeh_dof": {
-    "aperture_estimate": "Estimate of f/2.8 to f/4. The background is moderately blurred.",
-    "bokeh_shape": "Not applicable due to soft focus. What bokeh is discernible has a roundish quality.",
-    "background_blur_intensity": "4/10 (Moderate blur)",
-    "foreground_sharpness": "The artist's palette details and the dress are sharp."
-  },
-  "light_interaction": {
-    "white_dress": "The white dress reflects a significant amount of soft light. There is a slight rim light effect on the edges of the shoulder and sleeves giving it shape and dimension. Some folds show specular highlights due to satin finish. The dress also has some translucency due to the light coming from the other side",
-    "hair_highlight": "Minimal highlights on the hair. Light is even and diffused",
-    "paint_color": "The color looks natural and true."
-  },
-  "atmosphere": {
-    "overall_mood": "The lighting imparts a relaxed and natural tone. It's a bright, daytime scene with a soft, gentle ambiance."
-  },
-  "controlnet_params": {
-    "brightness": "0.9",
-    "contrast": "0.75",
-    "saturation": "0.9",
-    "color_temperature": "5900"
-  }
-}

BIN
examples/feature_extract/huahua/features/lighting_bokeh/lighting_visual.png


+ 0 - 49
examples/feature_extract/huahua/features/lighting_bokeh/mapping.json

@@ -1,49 +0,0 @@
-{
-  "dimension": "lighting_bokeh",
-  "type": "形式",
-  "highlight_cluster": "唯美梦幻的光影与景深",
-  "description": "逆光/轮廓光与大光圈浅景深(Bokeh)的组合,营造梦幻浪漫的视觉氛围",
-  "files": {
-    "lighting_visual.png": {
-      "type": "视觉参考图",
-      "purpose": "三张图的光影参数对比图,展示光照方向、光圈、色温、散景特征",
-      "tool": "Python PIL生成"
-    },
-    "lighting_analysis.json": {
-      "type": "详细分析",
-      "purpose": "各图光影景深专业分析,包含SD提示词"
-    }
-  },
-  "common_features": {
-    "lighting_style": "Natural backlight / rim light from upper-left, warm golden hour quality",
-    "bokeh_style": "Shallow DOF with smooth circular bokeh, heavy background blur",
-    "atmosphere": "Dreamy, romantic, ethereal, air-like, warm",
-    "sd_tokens_base": "backlit, rim lighting, bokeh, shallow depth of field, golden hour, warm sunlight, dreamy atmosphere, soft light, lens flare, f/1.8, 85mm lens, outdoor natural light"
-  },
-  "mapping": [
-    {
-      "image": "img_2",
-      "paragraph": "段落2",
-      "type": "形式",
-      "feature": "光影景深",
-      "specific": "强逆光+光斑光晕+浅景深 (f/1.8-2.8, 4500K-5000K)",
-      "path": "output/features/lighting_bokeh/lighting_visual.png"
-    },
-    {
-      "image": "img_3",
-      "paragraph": "段落3",
-      "type": "形式",
-      "feature": "光影景深",
-      "specific": "逆光+背景光晕+温暖氛围 (f/2.2-3.5, 3200K-3800K)",
-      "path": "output/features/lighting_bokeh/lighting_visual.png"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5",
-      "type": "形式",
-      "feature": "光影景深",
-      "specific": "自然光+背景虚化+浅景深 (f/2.8-4.0, 6000K-6500K)",
-      "path": "output/features/lighting_bokeh/lighting_visual.png"
-    }
-  ]
-}

+ 0 - 60
examples/feature_extract/huahua/features/palette_asset/mapping.json

@@ -1,60 +0,0 @@
-{
-  "dimension": "palette_asset",
-  "type": "实质",
-  "highlight_cluster": "斑斓厚重的油画颜料",
-  "description": "木质调色盘上堆积的厚重油画颜料(Impasto),杂乱而鲜艳的色彩肌理,与白色衣物形成强烈视觉反差",
-  "files": {
-    "palette_impasto_img1_v2.png": {
-      "source_image": "img_1",
-      "view": "medium",
-      "purpose": "调色板整体形态参考",
-      "quality": "有效,20%非白色内容",
-      "tool": "gemini-2.5-flash-image"
-    }
-  },
-  "impasto_characteristics": {
-    "texture": "thick, textured paint buildup with visible brushstroke marks",
-    "colors": [
-      "deep green",
-      "light green",
-      "blue",
-      "red",
-      "yellow",
-      "white",
-      "purple",
-      "black",
-      "pink",
-      "brown"
-    ],
-    "sd_tokens": "impasto oil paint, thick paint texture, colorful palette, artist palette, oil painting supplies, vibrant paint colors"
-  },
-  "mapping": [
-    {
-      "image": "img_1",
-      "paragraph": "段落1.1.2.3",
-      "type": "实质",
-      "feature": "调色板颜料Impasto质感",
-      "highlight": "斑斓厚重的油画颜料",
-      "path": "features/palette_asset/palette_impasto_img1_v2.png"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5.1.3",
-      "type": "实质",
-      "feature": "调色板颜料Impasto质感(特写)",
-      "highlight": "斑斓厚重的油画颜料",
-      "note": "img_5 特写参考图已删除,可参考 img_1 的调色板素材"
-    },
-    {
-      "image": "img_5",
-      "paragraph": "段落5.1.3.1",
-      "type": "实质",
-      "feature": "颜料色彩种类与分布",
-      "highlight": "斑斓厚重的油画颜料",
-      "note": "img_5 特写参考图已删除,可参考 img_1 的调色板素材"
-    }
-  ],
-  "consistency_elements": [
-    "绘画工具"
-  ]
-}

BIN
examples/feature_extract/huahua/features/palette_asset/palette_impasto_img1_v2.png


BIN
examples/feature_extract/huahua/features/pose_skeleton/img_1_openpose.png


BIN
examples/feature_extract/huahua/features/pose_skeleton/img_2_openpose.png


BIN
examples/feature_extract/huahua/features/pose_skeleton/img_3_openpose.png


BIN
examples/feature_extract/huahua/features/pose_skeleton/img_4_openpose.png


+ 0 - 87
examples/feature_extract/huahua/features/pose_skeleton/mapping.json

@@ -1,87 +0,0 @@
-{
-  "dimension": "pose_skeleton",
-  "type": "形式",
-  "highlight_cluster": "优雅的白裙写生少女",
-  "description": "各图人物姿态骨骼图,用于ControlNet姿态控制,每张图姿态不同",
-  "valid_files": {
-    "img_1_openpose.png": {
-      "source_image": "img_1",
-      "format": "黑底彩色骨骼图 (DWPose标准格式)",
-      "pose": "站立侧后方,右臂举起持笔,左臂弯曲持调色板",
-      "colored_pixels": 27332,
-      "quality": "✓ 有效"
-    },
-    "img_2_openpose.png": {
-      "source_image": "img_2",
-      "format": "黑底彩色骨骼图 (DWPose标准格式)",
-      "pose": "站立正后方,双臂持绘画工具",
-      "colored_pixels": 23513,
-      "quality": "✓ 有效"
-    },
-    "img_3_openpose.png": {
-      "source_image": "img_3",
-      "format": "黑底彩色骨骼图 (DWPose标准格式)",
-      "pose": "跪坐/蹲坐,后方视角,双臂伸向画架",
-      "colored_pixels": 45531,
-      "quality": "✓ 有效"
-    },
-    "img_4_openpose.png": {
-      "source_image": "img_4",
-      "format": "黑底彩色骨骼图 (DWPose标准格式)",
-      "pose": "站立侧面,面向画架,绘画姿态",
-      "colored_pixels": 41132,
-      "quality": "✓ 有效"
-    }
-  },
-  "missing_files": {
-    "img_5": "img_5 的骨骼图尚未生成"
-  },
-  "deprecated_files": {
-    "pose_img_1.png": "几乎全白(>99%),提取失败,已废弃",
-    "pose_img_3.png": "几乎全白(>99%),提取失败,已废弃",
-    "pose_img_4.png": "几乎全白(>99%),提取失败,已废弃",
-    "pose_img_2.png": "白底骨骼图,部分有效(8.3%非白色)",
-    "pose_img_5.png": "白底骨骼图,部分有效(17.6%非白色)"
-  },
-  "consistency_validation": {
-    "img_1": "骨骼质心x=464/864=54%(右侧),符合人物在右侧的构图",
-    "img_3": "骨骼质心y=883/1184=75%(偏下),符合跪坐姿态",
-    "img_4": "骨骼质心x=534/864=62%(偏左),符合侧面视角",
-    "img_5": "骨骼覆盖100%y范围,符合上半身特写"
-  },
-  "mapping": [
-    {
-      "image": "img_1",
-      "paragraph": "段落1.1.2",
-      "type": "形式",
-      "feature": "人物姿态骨骼",
-      "specific": "站立侧后方绘画姿态",
-      "path": "features/pose_skeleton/img_1_openpose.png"
-    },
-    {
-      "image": "img_2",
-      "paragraph": "段落2.1.2",
-      "type": "形式",
-      "feature": "人物姿态骨骼",
-      "specific": "站立正后方绘画姿态",
-      "path": "features/pose_skeleton/img_2_openpose.png"
-    },
-    {
-      "image": "img_3",
-      "paragraph": "段落3.1.2",
-      "type": "形式",
-      "feature": "人物姿态骨骼",
-      "specific": "跪坐绘画姿态",
-      "path": "features/pose_skeleton/img_3_openpose.png"
-    },
-    {
-      "image": "img_4",
-      "paragraph": "段落4.1.1.2",
-      "type": "形式",
-      "feature": "人物姿态骨骼",
-      "specific": "站立侧面绘画姿态",
-      "path": "features/pose_skeleton/img_4_openpose.png"
-    }
-  ],
-  "tool_note": "DWPose骨骼图(黑底彩色格式),用于ControlNet OpenPose条件控制。img_*_openpose.png为有效文件。注意 img_5 的骨骼图缺失。"
-}

+ 0 - 121
examples/feature_extract/huahua/index.md

@@ -1,121 +0,0 @@
-# 户外白裙写生少女 — 内容还原素材索引
-
-> 本目录包含一组图文帖子的完整解构数据,用于驱动 AI 还原出与原帖视觉一致的图片。
-> 还原思路:先理解制作点和图片亮点(做什么),再深入制作表(怎么做),需要多模态素材时从 features/ 中按需获取。
-
----
-
-## 目录结构
-
-```
-input/
-├── descriptions/                # 核心描述文件(还原的起点)
-│   ├── 图片亮点.md              # ★ 最重要 — 6 组视觉亮点聚类,定义了还原的优先级
-│   ├── 制作点.md                # ★ 最重要 — 6 个核心制作元素及其权重排序
-│   ├── 创作表.md                # 原帖的创作视角完整描述,可作为还原时的氛围参考
-│   ├── 写生油画__img_1_制作表.json  # 各图的详细制作表(分段描述+形式参数+评分)
-│   ├── 写生油画__img_2_制作表.json
-│   ├── 写生油画__img_3_制作表.json
-│   ├── 写生油画__img_4_制作表.json
-│   └── 写生油画__img_5_制作表.json
-└── features/                    # 多模态特征素材(按需取用)
-    ├── character_asset/         # 人物角色参考图
-    ├── background_asset/        # 背景参考图
-    ├── palette_asset/           # 调色板质感参考图
-    ├── easel_asset/             # 画架道具参考图
-    ├── pose_skeleton/           # 姿态骨骼图
-    ├── edge_map/                # Canny 边缘图
-    ├── depth_map/               # 深度图
-    ├── color_scheme/            # 色彩方案数据+可视化
-    └── lighting_bokeh/          # 光照散景分析数据+可视化
-```
-
----
-
-## 第一层:制作点与图片亮点(还原优先级)
-
-还原工作应从这两个文件开始,它们定义了"什么最重要"。
-
-### 图片亮点(`descriptions/图片亮点.md`)
-
-将图组的视觉表现力归纳为 6 组亮点聚类,分为实质亮点和形式亮点:
-
-| 亮点聚类             | 类型 | 涉及图片            | 核心描述                                  |
-| -------------------- | ---- | ------------------- | ----------------------------------------- |
-| 优雅的白裙写生少女   | 实质 | 全部 5 张           | 人物主体的文艺气质与娴静美                |
-| 斑斓厚重的油画颜料   | 实质 | img_1, img_5        | 调色板上 Impasto 厚涂颜料与白裙的视觉反差 |
-| 构建叙事的写生道具   | 实质 | img_3, img_4        | 画架、画布、画笔、白玫瑰构建的叙事场景    |
-| 清新雅致的白绿配色   | 形式 | img_1, img_4        | 纯白与高饱和绿的鲜明对比,森系基调        |
-| 唯美梦幻的光影与景深 | 形式 | img_2, img_3, img_5 | 逆光/轮廓光 + 大光圈散景的梦幻氛围        |
-| 虚实呼应的画中画结构 | 形式 | img_1, img_2        | 画布内容与现实场景的镜像互文              |
-
-同时该文件中还包含一个创作视角的完整描述,也可以在还原过程中做一些参考。
-
-同时可参考 `descriptions/创作表.md`,其中包含原帖创作者视角的完整描述,有助于理解整组图的情感基调和叙事意图。
-
-### 制作点(`descriptions/制作点.md`)
-
-按权重排序的 6 个核心制作元素:
-
-| 制作元素   | 权重 | 说明                                 |
-| ---------- | ---- | ------------------------------------ |
-| 女性人物   | 84.5 | 白裙女性的背影、躯干、手臂、蹲坐姿态 |
-| 绘画工具   | 78.5 | 调色板、画笔、颜料及手持动作         |
-| 自然背景   | 74.0 | 草坪、树木、阳光构成的户外环境       |
-| 画架与画布 | 67.7 | 画架结构及其上的画布(空白或创作中) |
-| 画架与油画 | 61.0 | 画架上已完成/进行中的油画            |
-| 女性衣物   | 44.7 | 白色连衣裙的细节                     |
-
----
-
-## 第二层:制作表(还原的详细蓝图)
-
-每张图有一个 JSON 制作表(`descriptions/写生油画__img_N_制作表.json`),包含:
-
-- 分层段落结构(场景 → 人物/道具/背景 → 细节子元素)
-- 每个段落的形式参数(拍摄角度、景别、光照、色彩饱和度、清晰度、构图)
-- 每个层级的综合评分
-
-### 5 张图概览
-
-| 图片  | 核心构图                | 评分  | 主要特点                                      |
-| ----- | ----------------------- | ----- | --------------------------------------------- |
-| img_1 | 侧后方中景 · 站立绘画   | 0.846 | 白绿配色典型,画中画结构,调色板 Impasto 质感 |
-| img_2 | 正后方 · 逆光站立       | 0.825 | 强逆光散景,画中画互文,梦幻氛围              |
-| img_3 | 后方 · 跪坐绘画         | 0.810 | 独特跪坐姿态,画架道具叙事,光影散景          |
-| img_4 | 侧面平视 · 站立绘画     | 0.830 | 侧面轮廓,白绿配色最典型,道具完整            |
-| img_5 | 上半身特写 · 调色板细节 | 0.850 | 特写景别,颜料质感突出,柔和光影              |
-
----
-
-## 第三层:多模态特征素材(按需获取)
-
-`features/` 下按维度组织,每个目录包含一个 `mapping.json` 说明该维度的素材与制作表段落的对应关系。
-
-### 实质素材(物体/材质参考图)
-
-| 维度     | 目录                | 内容                               | 用途           |
-| -------- | ------------------- | ---------------------------------- | -------------- |
-| 人物角色 | `character_asset/`  | 3 张人物参考图(背面、侧面、跪坐) | 人物一致性基座 |
-| 背景素材 | `background_asset/` | 绿色自然背景、逆光散景背景参考     | 背景还原参考   |
-| 调色板   | `palette_asset/`    | Impasto 厚涂质感参考图             | 颜料质感还原   |
-| 画架道具 | `easel_asset/`      | 画架空白画布参考图                 | 道具还原参考   |
-
-### 形式素材(控制信号与分析数据)
-
-| 维度     | 目录              | 内容                           | 用途         |
-| -------- | ----------------- | ------------------------------ | ------------ |
-| 姿态骨骼 | `pose_skeleton/`  | 5 张 DWPose 骨骼图(黑底彩色) | 人物姿态控制 |
-| 边缘图   | `edge_map/`       | 5 张 Canny 边缘检测图          | 结构轮廓控制 |
-| 深度图   | `depth_map/`      | 5 张深度估计图                 | 空间层次控制 |
-| 色彩方案 | `color_scheme/`   | 完整色彩数据 + 每图色板可视化  | 配色还原参考 |
-| 光照散景 | `lighting_bokeh/` | 光照分析数据 + 可视化          | 光影氛围还原 |
-
----
-
-## 渐进式还原建议
-
-1. **理解优先级**:先读图片亮点和制作点,明确哪些视觉特征最重要、权重最高
-2. **深入制作表**:针对要还原的图片,读取对应制作表,理解其分段结构和形式参数
-3. **按需取素材**:根据制作表中提到的具体特征,从 features/ 中获取对应的参考图或控制信号
-4. **逐特征叠加**:不要一次性还原所有特征,而是一个特征一个特征地叠加验证

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików