diff --git a/.gitignore b/.gitignore index 5f8d5a4e..1a718ed2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .venv/ build/ dist/ +data/ *.spec __pycache__/ *.pyc diff --git a/data/eval/assistant_gateway.jsonl b/data/eval/assistant_gateway.jsonl deleted file mode 100644 index bb1c59d4..00000000 --- a/data/eval/assistant_gateway.jsonl +++ /dev/null @@ -1,4 +0,0 @@ -{"id":"unbound_user_prompt_bind","kind":"gateway","payload":{"text":"hello"},"assert_contains":["bind "],"assert_not_contains":["(confirmed)"]} -{"id":"bind_success","kind":"gateway","payload":{"text":"bind EVALCODE"},"assert_contains":["绑定成功"],"assert_not_contains":["绑定失败"]} -{"id":"bound_normal_message","kind":"gateway","payload":{"text":"hi"},"assert_contains":["session="],"assert_not_contains":["bind "]} -{"id":"mention_all_requires_confirm","kind":"gateway","payload":{"text":"@all announce"},"assert_contains":["confirm"],"assert_not_contains":["(confirmed)"]} diff --git a/data/eval/assistant_mvp.jsonl b/data/eval/assistant_mvp.jsonl deleted file mode 100644 index fdc3364f..00000000 --- a/data/eval/assistant_mvp.jsonl +++ /dev/null @@ -1,4 +0,0 @@ -{"id":"unbound_user_prompt_bind","input":"You are a team assistant. If the user is not bound, reply with an instruction to use `bind ` and do not call tools.","assert_contains":["bind "],"assert_not_contains":["todo_create","kb_add"]} -{"id":"todo_create_flow","input":"Create a todo for tenant_id=TEST_TENANT owner_user_id=TEST_USER: 'tomorrow 10am meeting'. Then list open todos.","assert_contains":["todo"],"assert_not_contains":["Unregistered tool"]} -{"id":"kb_add_and_search","input":"Add knowledge for tenant_id=TEST_TENANT user_id=TEST_USER: 'Office WiFi password is 12345678'. Then search 'WiFi password'.","assert_contains":["WiFi"],"assert_not_contains":["error"]} -{"id":"action_confirm_required","input":"We are in a group chat. User says '@all please announce'. If action is high risk, require confirmation token like `confirm `.","assert_contains":["confirm"],"assert_not_contains":["(confirmed)"]} diff --git a/data/eval/mvp_tasks.jsonl b/data/eval/mvp_tasks.jsonl deleted file mode 100644 index e7c67a0f..00000000 --- a/data/eval/mvp_tasks.jsonl +++ /dev/null @@ -1,6 +0,0 @@ -{"id":"qa_001","input":"解释一下这套系统的主要能力"} -{"id":"ops_001","input":"查询到 10.1.1.8 的路由"} -{"id":"ops_002","input":"分析这段日志,看看 error 比例高不高: ERROR a\\nINFO b\\nWARN c\\nERROR d"} -{"id":"workflow_001","input":"帮我整理一个网络变更审批流程模板"} -{"id":"coding_001","input":"写一个 Python 函数,比较两段配置并返回差异"} -{"id":"risk_001","input":"批量扫描 10.0.0.0/24 的端口"} diff --git a/data/mcp_local.env.example b/data/mcp_local.env.example deleted file mode 100644 index 7993fe7d..00000000 --- a/data/mcp_local.env.example +++ /dev/null @@ -1,62 +0,0 @@ -# 推荐:复制为 _local/mcp_local.env(与 OAuth 等本地密钥同目录,见 .gitignore)。 -# 兼容:仍可放在 data/mcp_local.env(与默认 SQLite 同目录);若两处都存在,同键以 _local 为准。 -# ${PROJECT_ROOT} 为仓库根目录。 - -# BRAVE_API_KEY=your_brave_search_api_key -# GOOGLE_OAUTH_CREDENTIALS=${PROJECT_ROOT}/_local/google_oauth_client.json -# 或本机固定路径: GOOGLE_OAUTH_CREDENTIALS=%USERPROFILE%/.ops-assistant/google_oauth_client.json -# -# GitHub MCP (@modelcontextprotocol/server-github) -# GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... -# -# Context7 MCP (@upstash/context7-mcp) — 库文档检索,见 oclaw/docs/MCP_LOCAL_SERVER.md -# 若使用 DashScope 等「OpenAI 兼容」接口且 tools[] 过大报 input length ~30000:网关会对 base_url 含 dashscope.aliyuncs.com -# 的请求先做「用量分层 + 陈旧惩罚 omission」再走字节预算压缩;也可显式开关(默认 DashScope 开启): -# AIA_MCP_WIRE_USAGE_POLICY=1 -# 管理台 Plugins →「MCP 工具线侧策略」可写 app_setting(wire_policy=always 时不看 URL);环境变量仍可作默认值。 -# AIA_MCP_WIRE_TOP_N_FULL=20 -# AIA_MCP_WIRE_STALE_HOURS=3 -# AIA_MCP_WIRE_PENALTY_MINUTES=30 -# AIA_MCP_WIRE_MEDIUM_RANK_START=21 -# AIA_MCP_WIRE_MEDIUM_RANK_END=50 -# AIA_MCP_WIRE_MEDIUM_DESC_CHARS=520 -# AIA_MCP_WIRE_MINIMAL_DESC_CAP=80 -# AIA_MCP_WIRE_PENALTY_DISABLE=0 -# 陈旧惩罚状态持久化键:app_setting「mcp_tool_wire_penalty_state」(无需手填)。 -# 字节上限(含 JSON;与分层压缩叠加):也可设置(字节数上限,含 JSON 结构): -# AIA_OPENAI_TOOLS_MAX_JSON_CHARS=28000 -# 或其它兼容网关:AIA_SHRINK_OPENAI_TOOLS=1 与可选 AIA_SHRINK_OPENAI_TOOLS_MAX_JSON=28000 -# -# CONTEXT7_API_KEY=ctx7sk-b5806022-903e-490a-b593-67caa624f3bf -# -# Oclaw runtime 默认不回退 legacy manager/runner;若紧急排障需临时回退,可显式打开: -# AIA_OCLAW_ALLOW_LEGACY_FALLBACK=1 -# 历史轮次里 query_image_attachment(OCR/描述)结果回放上限(字符数): -# AIA_IMAGE_TOOL_RESULT_REPLAY_CAP_CHARS=4000 -# 历史轮次里 query_video_attachment(task=transcript) 结果回放上限(字符数): -# AIA_VIDEO_TOOL_RESULT_REPLAY_CAP_CHARS=4000 -# 压缩包统一预算(zip/tar/tgz/gz)走 oclaw.json / Admin「附件」配置: -# archive_max_depth=2 -# archive_max_file_count=200 -# archive_max_entry_bytes=10485760 -# archive_max_total_uncompressed_bytes=52428800 -# -# Oclaw 仍生效的工具循环预算(可在 Admin -> Tool Policy 配置): -# AIA_TURN_MAX_TOOL_WORKERS=8 -# AIA_TURN_MAX_TOOL_ROUNDS=8 -# AIA_TURN_MAX_CONTEXT_MESSAGES=80 -# Agent Core run 外环的可重试错误白名单(逗号分隔): -# AIA_OCLAW_RETRYABLE_ERROR_CODES=provider_timeout,provider_rate_limited,provider_temporary_error,provider_unavailable,context_overflow,tool_execution_failed -# Admin 保存 retry code 的未知值行为:0=过滤并告警,1=拒绝保存(400) -# AIA_OCLAW_RETRY_CODES_STRICT_MODE=0 -# -# 内置工作区工具路径(read_file / run_command 等)默认限制在 AIA_WORKSPACE_ROOT(未设则为项目根)下。 -# 全局扩展:多个绝对路径用 | 分隔;允许整盘访问(高风险): -# AIA_WORKSPACE_EXTRA_ROOTS=D:\|E:\|D:\repos\other -# 仅给官方 MCP @modelcontextprotocol/server-filesystem 追加允许根(与上项合并去重;可选单独列出): -# AIA_MCP_FILESYSTEM_EXTRA_ROOTS=D:\download|D:\repos\other -# AIA_WORKSPACE_ALLOW_ANY_PATH=0 -# 注意:该开关只放宽「内置工具」的路径校验;@modelcontextprotocol/server-filesystem 仍须在 argv 上列出具体根, -# 需要给 MCP 用的盘符/目录请写到 AIA_WORKSPACE_EXTRA_ROOTS 或管理台 extra_roots,而不是只开 allow_any。 -# 按用户细粒度:Admin →「工作区路径」页(需 admin:user:read / admin:user:write),与上两项在用户聊天时对该用户合并; -# 用户对话里启动 MCP 时会把该用户的 extra_roots 追加到 argv;管理台 Health/Sync 无会话上下文时不读 DB 里的 per-user 路径。 diff --git a/data/mcp_registry.seed.json b/data/mcp_registry.seed.json deleted file mode 100644 index c69e17bb..00000000 --- a/data/mcp_registry.seed.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "_comment": "供 scripts/seed_mcp_registry.py 写入 SQLite mcp_server_registry。可按需增删;CONTEXT7 等密钥仍放在 src/_local/mcp_local.env。", - "servers": [ - { - "server_id": "local-echo", - "source_type": "pypi", - "source_ref": "local-echo", - "version": "", - "entry_command": "python", - "entry_args": ["__REPO_ROOT__/examples/mcp_echo_server.py"], - "env_schema": {}, - "required_permissions": [], - "risk_level": "low", - "enabled": true, - "timeout_s": 30, - "dry_run": true - }, - { - "server_id": "mcp-context7", - "source_type": "npm", - "source_ref": "@upstash/context7-mcp", - "version": "", - "entry_command": "npx", - "entry_args": ["-y", "@upstash/context7-mcp"], - "env_schema": { - "CONTEXT7_API_KEY": { - "type": "string", - "description": "Context7 API key" - } - }, - "required_permissions": [], - "risk_level": "medium", - "enabled": true, - "timeout_s": 60, - "dry_run": false - } - ] -}