Files
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
15 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "alexazhou/togospace", "files": {"assets/docs/setting.README.md": {"f9409768f2c697b450b49d46d6c44d10caf3b305": {"t": 1786068466.9074728, "n": 12014, "h": "7a61bc89b35ba060", "c": "# setting.json 说明\n\n`setting.json` 是 TogoSpace 的运行时配置文件,用于配置 LLM 服务、持久化路径和工作目录等参数。\n\n**注意**:修改配置文件后,需要重启 TogoSpace 应用才能生效。\n\n**版本**:当前为 V2 格式。V1 格式(`llm_services`)会在启动时自动迁移到 V2。\n\n默认位置:\n\n- `~/.togo_agent/setting.json`(打包模式)\n- `dev_storage_root/setting.json`(开发模式)\n\n## 最小示例\n\n```json\n{\n \"version\": \"v2\",\n \"llm_providers\": [\n {\n \"name\": \"deepseek\",\n \"type\": \"deepseek\",\n \"api_key\": \"YOUR_API_KEY_HERE\",\n \"models\": [\n {\n \"name\": \"deepseek-chat\",\n \"protocol\": \"openai\"\n }\n ]\n }\n ],\n \"default_models\": {\n \"primary\": \"deepseek-chat@deepseek\"\n }\n}\n```\n\n## 顶层字段\n\n| 字段 | 类型 | 默认值 | 说明 |\n|------|------|--------|------|\n| `version` | string | `\"v2\"` | 配置版本,V1 格式会自动迁移 |\n| `language` | string | `\"zh-CN\"` | 界面语言,可选 `zh-CN`(中文)、`en`(英文) |\n| `development_mode` | bool | `false` | 前端开发模式开关,影响错误提示等交互行为 |\n| `llm_providers` | list | `[]` | LLM 服务商列表 |\n| `default_models` | object | `{}` | 默认模型槽位配置 |\n| `context_config` | object | 见下方 | 全局上下文与压缩策略配置 |\n| `default_room_max_rounds` | int | `100` | 房间默认最大轮次,`<= 0` 表示不限轮次 |\n| `db_path` | string | 自动 | 数据库文件路径 |\n| `workspace_root` | string | 自动 | 团队默认工作目录根路径 |\n| `bind_host` | string | `\"0.0.0.0\"` | HTTP 服务监听地址 |\n| `bind_port` | int | `8180` | HTTP 服务监听端口 |\n| `auto_check_update` | bool | `true` | 启动时自动检查更新 |\n| `demo_mode` | object | 见下方 | 演示模式配置 |\n| `auth` | object | 见下方 | 鉴权配置 |\n\n## `llm_providers` 服务商配置\n\n每个服务商包含连接信息和模型列表。\n\n```json\n{\n \"name\": \"deepseek\",\n \"type\": \"deepseek\",\n \"enable\": true,\n \"api_key\": \"sk-xxx\",\n \"urls\": {\n \"openai\": \"https://api.deepseek.com/v1/chat/completions\"\n },\n \"models\": [\n {\n \"name\": \"deepseek-chat\",\n \"protocol\": \"openai\",\n \"enabled\": true\n }\n ]\n}\n```\n\n### Provider 字段\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `name` | string | 是 | 服务商唯一标识 |\n| `type` | string | 是 | 服务商类型,见下方枚举 |\n| `api_key` | string | 是 | API Key |\n| `enable` | bool | 否 | 是否启用,默认 `true` |\n| `urls` | object | 否 | 协议对应的 URL,key 为协议类型 |\n| `models` | list | 是 | 该服务商下的模型列表 |\n\n### `type` 服务商类型枚举\n\n| 值 | 说明 |\n|----|------|\n| `openai` | OpenAI |\n| `anthropic` | Anthropic(Claude)官方 |\n| `google` | 谷歌官方 |\n| `deepseek` | DeepSeek |\n| `aliyun` | 阿里云(通义千问) |\n| `aliyun_coding` | 阿里云Coding Plan |\n| `volcengine_coding` | 字节火山引擎 Coding Plan |\n| `mimo` | 小米Mimo |\n| `mimo_token_plan` | Mimo Token Plan |\n| `opencode_go` | OpenCode Go |\n| `other` | 其他自定义 |\n\n### Model 字段\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `name` | string | 是 | 模型名称 |\n| `protocol` | string | 是 | 协议类型:`openai` 或 `anthropic` |\n| `enabled` | bool | 否 | 是否启用,默认 `true` |\n| `support_vision` | bool | 否 | 是否支持视觉,默认 `false` |\n| `temperature` | float | 否 | 温度参数 |\n| `extra_params` | object | 否 | 模型级别的 litellm 参数 |\n| `extra_headers` | object | 否 | 额外请求头 |\n| `context_config` | object | 否 | 模型级别的上下文配置(覆盖全局) |\n\n## `default_models` 默认模型槽位\n\n配置各场景使用的默认模型,格式为 `模型名@服务商名`。\n\n```json\n{\n \"primary\": \"deepseek-chat@deepseek\",\n \"lite\": \"\",\n \"vision\": \"\",\n \"advanced\": \"\"\n}\n```\n\n| 槽位 | 说明 |\n|------|------|\n| `primary` | 主模型,通用任务默认使用 |\n| `lite` | 轻量模型,简单任务使用 |\n| `vision` | 视觉模型,处理图片使用 |\n| `advanced` | 高级模型,复杂任务使用 |\n\n**校验规则**:保存配置时,后端会校验各槽位引用的 `模型名@服务商名` 是否存在于 `llm_providers` 中,不存在则报错。\n\n## `context_config` 全局上下文配置\n\n设置上下文窗口和压缩策略的全局默认值。单个模型可覆盖此配置。\n\n```json\n{\n \"context_config\": {\n \"context_window_tokens\": 131072,\n \"reserve_output_tokens\": 16384,\n \"compact_trigger_ratio\": 0.85,\n \"compact_summary_max_tokens\": 6144\n }\n}\n```\n\n| 字段 | 类型 | 默认值 | 说明 |\n|------|------|--------|------|\n| `context_window_tokens` | int | `131072` | 上下文窗口大小 |\n| `reserve_output_tokens` | int | `16384` | 预留输出 token 数 |\n| `compact_trigger_ratio` | float | `0.85` | 触发 compact 的比例(0.0~1.0) |\n| `compact_summary_max_tokens` | int | `6144` | compact 摘要 token 上限 |\n\n## `extra_params` 配置\n\n`extra_params` 是一个 JSON 对象,会直接合并到 litellm 的请求参数中。可用于配置模型特定的参数,如 `reasoning_effort`、`top_p` 等。\n\n**禁止覆盖的系统字段**:\n\n以下字段由系统自动管理,不能在 `extra_params` 中设置:\n\n- `api_key`、`base_url`、`model`、`messages`\n- `temperature`、`max_tokens`、`stream`\n- `tools`、`tool_choice`\n- `custom_llm_provider`、`cache_control_injection_points`\n\n示例:\n\n```json\n{\n \"extra_params\": {\n \"reasoning_effort\": \"high\"\n }\n}\n```\n\n## `demo_mode` 配置\n\n演示模式配置,用于展示环境:\n\n- `enabled`:是否启用演示模式,默认 `false`\n- `freeze_data`:是否冻结数据(禁止增删改),默认 `true`\n- `hide_sensitive`:是否隐藏敏感信息,默认 `true`\n\n启用演示模式且 `freeze_data=true` 时,后端进入只读状态,所有写操作返回 403。\n\n示例:\n\n```json\n{\n \"demo_mode\": {\n \"enabled\": true,\n \"freeze_data\": true,\n \"hide_sensitive\": true\n }\n}\n```\n\n## `auth` 配置\n\nAPI 鉴权配置,用于保护后端接口:\n\n- `enabled`:是否启用鉴权,默认 `false`\n- `token`:访问令牌,启用鉴权时必须设置\n\n启用鉴权后,所有 HTTP API 请求(除 `/system/status.json` 外)需携带 `Authorization: Bearer <token>` 请求头。WebSocket 连接后需发送 `{type: \"auth\", token: \"<token>\"}` 消息完成鉴权。\n\n示例:\n\n```json\n{\n \"auth\": {\n \"enabled\": true,\n \"token\": \"your-access-token\"\n }\n}\n```\n\n## 本地监听地址与端口\n\n默认监听地址是 `0.0.0.0`,默认端口是 `8180`。\n\n如需手动指定端口,在 `setting.json` 顶层添加或修改 `bind_port`,例如:`\"bind_port\": 9000`。\n\n如需同时指定监听地址,可一并设置 `bind_host`,例如:`\"bind_host\": \"127.0.0.1\"`。\n\n---\n\n# setting.json Description\n\n`setting.json` is the runtime configuration file for TogoSpace, used to configure LLM services, persistence paths, working directories, and other parameters.\n\n**Note**: After modifying the configuration file, you need to restart the TogoSpace application for the changes to take effect.\n\n**Version**: Currently using V2 format. V1 format (`llm_services`) will be auto-migrated to V2 on startup.\n\nDefault Location:\n\n- `~/.togo_agent/setting.json` (packaged mode)\n- `dev_storage_root/setting.json` (development mode)\n\n## Minimal Example\n\n```json\n{\n \"version\": \"v2\",\n \"llm_providers\": [\n {\n \"name\": \"deepseek\",\n \"type\": \"deepseek\",\n \"api_key\": \"YOUR_API_KEY_HERE\",\n \"models\": [\n {\n \"name\": \"deepseek-chat\",\n \"protocol\": \"openai\"\n }\n ]\n }\n ],\n \"default_models\": {\n \"primary\": \"deepseek-chat@deepseek\"\n }\n}\n```\n\n## Top-level Fields\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `version` | string | `\"v2\"` | Config version. V1 format auto-migrates. |\n| `language` | string | `\"zh-CN\"` | UI language: `zh-CN` (Chinese), `en` (English). |\n| `development_mode` | bool | `false` | Frontend dev mode switch. |\n| `llm_providers` | list | `[]` | LLM provider list. |\n| `default_models` | object | `{}` | Default model slot configuration. |\n| `context_config` | object | see below | Global context & compaction config. |\n| `default_room_max_rounds` | int | `100` | Default max rounds per room. `<= 0` = unlimited. |\n| `db_path` | string | auto | Database file path. |\n| `workspace_root` | string | auto | Default workspace root for teams. |\n| `bind_host` | string | `\"0.0.0.0\"` | HTTP service bind host. |\n| `bind_port` | int | `8180` | HTTP service bind port. |\n| `auto_check_update` | bool | `true` | Auto-check updates on startup. |\n| `demo_mode` | object | see below | Demo mode configuration. |\n| `auth` | object | see below | Authentication configuration. |\n\n## `llm_providers` Provider Configuration\n\nEach provider contains connection info and a model list.\n\n```json\n{\n \"name\": \"deepseek\",\n \"type\": \"deepseek\",\n \"enable\": true,\n \"api_key\": \"sk-xxx\",\n \"urls\": {\n \"openai\": \"https://api.deepseek.com/v1/chat/completions\"\n },\n \"models\": [\n {\n \"name\": \"deepseek-chat\",\n \"protocol\": \"openai\",\n \"enabled\": true\n }\n ]\n}\n```\n\n### Provider Fields\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| `name` | string | Yes | Unique provider identifier. |\n| `type` | string | Yes | Provider type, see enum below. |\n| `api_key` | string | Yes | API Key. |\n| `enable` | bool | No | Whether enabled, default `true`. |\n| `urls` | object | No | Protocol-to-URL mapping. |\n| `models` | list | Yes | Model list for this provider. |\n\n### `type` Provider Type Enum\n\n| Value | Description |\n|-------|-------------|\n| `openai` | OpenAI |\n| `anthropic` | Anthropic(Claude)官方 |\n| `google` | 谷歌官方 |\n| `deepseek` | DeepSeek |\n| `aliyun` | Aliyun (Tongyi Qianwen) |\n| `aliyun_coding` | 阿里云Coding Plan |\n| `volcengine_coding` | 字节火山引擎 Coding Plan |\n| `mimo` | 小米Mimo |\n| `mimo_token_plan` | Mimo Token Plan |\n| `opencode_go` | OpenCode Go |\n| `other` | Other / Custom |\n\n### Model Fields\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| `name` | string | Yes | Model name. |\n| `protocol` | string | Yes | Protocol: `openai` or `anthropic`. |\n| `enabled` | bool | No | Whether enabled, default `true`. |\n| `support_vision` | bool | No | Vision support, default `false`. |\n| `temperature` | float | No | Temperature parameter. |\n| `extra_params` | object | No | Model-level litellm params. |\n| `extra_headers` | object | No | Extra request headers. |\n| `context_config` | object | No | Model-level context config (overrides global). |\n\n## `default_models` Default Model Slots\n\nConfigure default models for different scenarios. Format: `model_name@provider_name`.\n\n```json\n{\n \"primary\": \"deepseek-chat@deepseek\",\n \"lite\": \"\",\n \"vision\": \"\",\n \"advanced\": \"\"\n}\n```\n\n| Slot | Description |\n|------|-------------|\n| `primary` | Primary model, default for general tasks. |\n| `lite` | Lightweight model for simple tasks. |\n| `vision` | Vision model for image processing. |\n| `advanced` | Advanced model for complex tasks. |\n\n**Validation**: On save, the backend validates that each slot's `model@provider` reference exists in `llm_providers`. Non-existent references return an error.\n\n## `context_config` Global Context Configuration\n\nSet global defaults for context window and compaction strategy. Individual models can override this.\n\n```json\n{\n \"context_config\": {\n \"context_window_tokens\": 131072,\n \"reserve_output_tokens\": 16384,\n \"compact_trigger_ratio\": 0.85,\n \"compact_summary_max_tokens\": 6144\n }\n}\n```\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `context_window_tokens` | int | `131072` | Context window size. |\n| `reserve_output_tokens` | int | `16384` | Reserved output tokens. |\n| `compact_trigger_ratio` | float | `0.85` | Compaction trigger ratio (0.0~1.0). |\n| `compact_summary_max_tokens` | int | `6144` | Max tokens for compaction summary. |\n\n## `extra_params` Configuration\n\n`extra_params` is a JSON object that merges directly into litellm request parameters. Use it for model-specific settings like `reasoning_effort`, `top_p`, etc.\n\n**Prohibited System Fields**:\n\nThe following fields are managed by the system and cannot be set in `extra_params`:\n\n- `api_key`, `base_url`, `model`, `messages`\n- `temperature`, `max_tokens`, `stream`\n- `tools`, `tool_choice`\n- `custom_llm_provider`, `cache_control_injection_points`\n\nExample:\n\n```json\n{\n \"extra_params\": {\n \"reasoning_effort\": \"high\"\n }\n}\n```\n\n## `demo_mode` Configuration\n\nDemo mode configuration for showcase environments:\n\n- `enabled`: Whether demo mode is enabled, default `false`.\n- `freeze_data`: Whether to freeze data (forbid add/edit/delete), default `true`.\n- `hide_sensitive`: Whether to hide sensitive info, default `true`.\n\nWhen demo mode is enabled and `freeze_data=true`, the backend enters read-only state, all write operations return 403.\n\nExample:\n\n```json\n{\n \"demo_mode\": {\n \"enabled\": true,\n \"freeze_data\": true,\n \"hide_sensitive\": true\n }\n}\n```\n\n## `auth` Configuration\n\nAPI authentication configuration:\n\n- `enabled`: Whether authentication is enabled, default `false`.\n- `token`: Access token, must be set when auth is enabled.\n\nWhen enabled, all HTTP API requests (except `/system/status.json`) require an `Authorization: Bearer <token>` header. WebSocket connections require `{type: \"auth\", token: \"<token>\"}` message for authentication.\n\nExample:\n\n```json\n{\n \"auth\": {\n \"enabled\": true,\n \"token\": \"your-access-token\"\n }\n}\n```\n\n## Local Bind Host and Port\n\nDefault bind host is `0.0.0.0`, default port is `8180`.\n\nTo specify a port, add `bind_port` at the top level: `\"bind_port\": 9000`.\n\nTo also specify a host: `\"bind_host\": \"127.0.0.1\"`.\n"}}}}