{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "properties": { "http": { "type": "object", "additionalProperties": true, "description": "HTTP, Console, REST/RPC/SSE, and Webhook Host.", "x-descriptionZh": "HTTP、Console、REST/RPC/SSE 与 Webhook Host。", "properties": { "readiness": { "type": "object", "additionalProperties": false, "description": "Required runtime components for /pub/ready; no external network probes.", "x-descriptionZh": "/pub/ready 要求就绪的运行时组件;不执行外部网络探测。", "properties": { "database": { "type": "boolean", "default": true, "description": "Require an initialized Database Host (not a live database query).", "x-descriptionZh": "要求 Database Host 已初始化(不执行实时数据库查询)。" }, "endpoints": { "type": "array", "uniqueItems": true, "description": "Required Endpoint admission slots, selected by exact plugin owner and stable slot name.", "x-descriptionZh": "必须开放入站的 Endpoint,按插件 owner 与稳定槽名精确选择。", "items": { "type": "object", "additionalProperties": false, "required": [ "owner", "name" ], "properties": { "owner": { "type": "string", "pattern": "^root(?:/[a-z0-9][a-z0-9-]*)*$" }, "name": { "type": "string", "minLength": 1, "pattern": "^[^\\u0000]+$" } } } }, "agents": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 }, "description": "Required configured Agent bindings; does not verify model credentials or provider reachability.", "x-descriptionZh": "必须存在的 Agent binding;不验证模型凭据或 Provider 网络可用性。" } } }, "host": { "type": [ "string", "null" ], "description": "监听地址。" }, "port": { "type": [ "integer", "string", "null" ], "minimum": 0, "maximum": 65535, "pattern": "^\\$\\{[A-Za-z_][A-Za-z0-9_]*(?::[-=][^}]*)?\\}$", "description": "Listening port: an integer from 1 to 65535, or a ${VAR} environment reference that expands to one (0 lets the system pick a free port). When unset the gateway listens on 8068.", "x-descriptionZh": "监听端口:1–65535 的整数,或展开后为该范围整数的 ${VAR} 环境变量引用(0 表示由系统分配空闲端口)。未配置时网关监听 8068。" }, "token": { "type": [ "string", "null" ], "description": "Bootstrap token: signs in to the setup wizard until the first Console owner exists, then stops working (ADR 0049).", "x-descriptionZh": "初始化令牌:创建第一个 Console 所有者之前用于登录初始化向导;之后失效(ADR 0049)。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true, "security": true } }, "corsOrigins": { "type": [ "array", "null" ], "items": { "type": [ "string", "null" ] } }, "trustProxy": { "anyOf": [ { "type": "boolean" }, { "type": "integer", "minimum": 0, "maximum": 32 }, { "type": "array", "items": { "type": "string", "minLength": 1 } }, { "type": "string" } ], "description": "Reverse proxies whose X-Forwarded-For / Forwarded header names the client (login rate limit, audit IP, loopback-only sockets): false (default) uses the TCP peer; true trusts every hop; a number trusts that many hops; a list trusts peers matching IPs / CIDRs or loopback, private, linklocal.", "x-descriptionZh": "受信任的反向代理,其 X-Forwarded-For / Forwarded 头给出真实客户端地址(登录限流、审计 IP、仅本机套接字):false(默认)只用 TCP 对端地址;true 信任所有跳;数字表示信任离服务端最近的若干跳;列表表示只信任匹配的 IP / CIDR 或 loopback、private、linklocal。", "x-zhin-config": { "security": true } }, "base": { "type": [ "string", "null" ], "description": "API 路径前缀。" }, "tls": { "anyOf": [ { "const": false }, { "type": "null" }, { "type": "object", "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "是否启用 TLS;省略时由 HTTP Host 的 TLS 解析规则决定。" }, "keyFile": { "type": "string", "description": "TLS 私钥文件路径。" }, "certFile": { "type": "string", "description": "TLS 证书文件路径。" }, "caFile": { "type": "string", "description": "CA 证书文件路径。" }, "passphrase": { "type": "string", "description": "私钥口令。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "minVersion": { "type": "string", "description": "最低 TLS 版本。" }, "ciphers": { "type": "string", "description": "TLS cipher 列表。" } } } ] }, "listeners": { "type": "array", "items": { "type": "object", "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "是否启用此监听器。" }, "host": { "type": "string", "description": "监听地址。" }, "port": { "type": [ "integer", "string" ], "minimum": 0, "maximum": 65535, "pattern": "^\\$\\{[A-Za-z_][A-Za-z0-9_]*(?::[-=][^}]*)?\\}$", "description": "Listening port: an integer from 1 to 65535, or a ${VAR} environment reference that expands to one.", "x-descriptionZh": "监听端口:1–65535 的整数,或展开后为该范围整数的 ${VAR} 环境变量引用。" }, "tls": { "anyOf": [ { "const": false }, { "type": "null" }, { "type": "object", "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "是否启用 TLS;省略时由 HTTP Host 的 TLS 解析规则决定。" }, "keyFile": { "type": "string", "description": "TLS 私钥文件路径。" }, "certFile": { "type": "string", "description": "TLS 证书文件路径。" }, "caFile": { "type": "string", "description": "CA 证书文件路径。" }, "passphrase": { "type": "string", "description": "私钥口令。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "minVersion": { "type": "string", "description": "最低 TLS 版本。" }, "ciphers": { "type": "string", "description": "TLS cipher 列表。" } } } ] } } } } } }, "console": { "type": "object", "additionalProperties": false, "description": "Console Host features.", "x-descriptionZh": "Console 宿主功能。", "properties": { "terminal": { "type": "object", "additionalProperties": false, "description": "Console terminal (host shell / SSH) for owners holding ops.terminal; off by default.", "x-descriptionZh": "Console 终端(宿主 Shell / SSH),仅持有 ops.terminal 的所有者可用;默认关闭。", "properties": { "enabled": { "type": "boolean", "default": false, "description": "Register the terminal routes.", "x-descriptionZh": "注册终端路由。" }, "shell": { "type": "string", "minLength": 1, "description": "Local shell; defaults to $SHELL (powershell.exe on Windows).", "x-descriptionZh": "本机 Shell;省略时用 $SHELL(Windows 为 powershell.exe)。" }, "cwd": { "type": "string", "default": ".", "description": "Working directory, relative to the project root.", "x-descriptionZh": "工作目录,相对项目根。" }, "idleTimeout": { "type": "integer", "minimum": 0, "maximum": 604800, "default": 900, "description": "Seconds without input before the session closes (0 = never).", "x-descriptionZh": "无输入多少秒后断开(0 表示不限)。" }, "maxSessions": { "type": "integer", "minimum": 1, "maximum": 256, "default": 4, "description": "Concurrent sessions across all users.", "x-descriptionZh": "所有用户合计的同时会话上限。" }, "ssh": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "name", "host", "username" ], "description": "Allow-listed SSH target; credentials come only from environment variables or local key files.", "x-descriptionZh": "白名单 SSH 目标;凭据只从环境变量或本地密钥文件读取。", "properties": { "name": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$", "not": { "const": "local" }, "description": "Target id the Console selects (not \"local\").", "x-descriptionZh": "目标 id,Console 按它选择(不能是 local)。" }, "label": { "type": "string", "description": "Display name.", "x-descriptionZh": "显示名称。" }, "host": { "type": "string", "minLength": 1, "description": "SSH host.", "x-descriptionZh": "SSH 主机。" }, "port": { "type": "integer", "minimum": 1, "maximum": 65535, "default": 22, "description": "SSH port.", "x-descriptionZh": "SSH 端口。" }, "username": { "type": "string", "minLength": 1, "description": "SSH user.", "x-descriptionZh": "SSH 用户。" }, "privateKeyPath": { "type": "string", "minLength": 1, "description": "Private key file (relative to the project root, ~ allowed); exclusive with privateKeyEnv.", "x-descriptionZh": "私钥文件(相对项目根,可用 ~);与 privateKeyEnv 互斥。" }, "privateKeyEnv": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "Environment variable holding the private key.", "x-descriptionZh": "保存私钥的环境变量名。" }, "passwordEnv": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "Environment variable holding the password.", "x-descriptionZh": "保存密码的环境变量名。" }, "passphraseEnv": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "description": "Environment variable holding the key passphrase.", "x-descriptionZh": "保存私钥口令的环境变量名。" }, "hostFingerprint": { "type": "string", "pattern": "^[Ss][Hh][Aa]256:[A-Za-z0-9+/]{43}=*$", "description": "Required host key fingerprint (SHA256:…), verified strictly; get it with `ssh-keyscan -t ed25519 | ssh-keygen -lf -` on a trusted network.", "x-descriptionZh": "必填的主机密钥指纹(SHA256:…),严格校验;在可信网络中用 `ssh-keyscan -t ed25519 | ssh-keygen -lf -` 获取。" }, "insecureAcceptAnyHostKey": { "type": "boolean", "description": "Accept any host key without verification (unsafe, open to man-in-the-middle); only instead of hostFingerprint. The Console marks the target unsafe.", "x-descriptionZh": "不校验主机密钥、接受任意密钥(不安全,可被中间人攻击);仅在不填 hostFingerprint 时使用,Console 会把该目标标为不安全。" } }, "allOf": [ { "anyOf": [ { "properties": { "hostFingerprint": true }, "required": [ "hostFingerprint" ], "not": { "properties": { "insecureAcceptAnyHostKey": { "const": true } }, "required": [ "insecureAcceptAnyHostKey" ] } }, { "properties": { "insecureAcceptAnyHostKey": { "const": true } }, "required": [ "insecureAcceptAnyHostKey" ], "not": { "properties": { "hostFingerprint": true }, "required": [ "hostFingerprint" ] } } ] }, { "anyOf": [ { "properties": { "privateKeyPath": true }, "required": [ "privateKeyPath" ] }, { "properties": { "privateKeyEnv": true }, "required": [ "privateKeyEnv" ] }, { "properties": { "passwordEnv": true }, "required": [ "passwordEnv" ] } ] }, { "not": { "properties": { "privateKeyPath": true, "privateKeyEnv": true }, "required": [ "privateKeyPath", "privateKeyEnv" ] } } ] }, "description": "SSH targets the Console may open.", "x-descriptionZh": "Console 可连接的 SSH 目标。" } }, "x-zhin-config": { "security": true } }, "loginAssist": { "type": "object", "additionalProperties": false, "description": "Login assistance shown in the Console (ADR 0058).", "x-descriptionZh": "Console 中的登录辅助(ADR 0058)。", "properties": { "captchaHelperUrl": { "type": "string", "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1)(:|/))", "description": "Hosted captcha helper page on its own origin; defaults to https://zhin.js.org/login-assist/tcaptcha.html.", "x-descriptionZh": "独立源上的验证码辅助页;默认 https://zhin.js.org/login-assist/tcaptcha.html。" } } } } }, "gateway": { "type": "object", "additionalProperties": false, "description": "Management gateway (zhin start): instance supervision and dependency transactions.", "x-descriptionZh": "管理网关(zhin start):实例监管与依赖事务。", "properties": { "readyTimeout": { "type": "integer", "minimum": 1, "maximum": 3600, "default": 60, "description": "Seconds the instance has to report ready after a start, a restart or a dependency transaction before the start counts as failed (the transaction then rolls back). Read again before every start, restart and transaction; no gateway restart needed.", "x-descriptionZh": "实例启动、重启或依赖事务后报告就绪的最长秒数;超时视为启动失败(依赖事务随之回滚)。每次启动、重启与事务前重新读取,修改后无需重启网关。" } } }, "database": { "type": "object", "additionalProperties": true, "description": "Database Host and dialect connection options.", "x-descriptionZh": "Database Host 与方言连接参数。", "properties": { "dialect": { "type": "string", "description": "数据库方言。", "x-zhin-config": { "options": [ { "value": "memory", "label": "memory" }, { "value": "sqlite", "label": "sqlite" }, { "value": "mysql", "label": "mysql" }, { "value": "pg", "label": "pg" }, { "value": "mongodb", "label": "mongodb" }, { "value": "redis", "label": "redis" } ] } }, "filename": { "type": "string", "description": "SQLite 文件路径。" }, "mode": { "type": "string", "description": "SQLite 兼容模式字段。" }, "host": { "type": "string", "description": "数据库主机。" }, "port": { "type": [ "number", "string" ], "description": "网络数据库端口。" }, "user": { "type": "string", "description": "MySQL / PostgreSQL 用户名。" }, "username": { "type": "string", "description": "Redis 用户名。" }, "password": { "type": "string", "description": "连接密码。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "database": { "type": [ "string", "number" ], "description": "MySQL / PostgreSQL 数据库名,或 Redis 数据库索引。" }, "uri": { "type": "string", "description": "MySQL 连接 URI(可能含凭据)。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "connectionString": { "type": "string", "description": "PostgreSQL 连接串(可能含凭据)。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "url": { "type": "string", "description": "MongoDB / Redis 连接 URL(可能含凭据)。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "dbName": { "type": "string", "description": "MongoDB 数据库名。" }, "pool": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "min": { "type": [ "number", "string", "null" ], "description": "最少连接数。" }, "max": { "type": [ "number", "string", "null" ], "description": "最多连接数。" }, "acquireTimeoutMillis": { "type": [ "number", "string", "null" ], "description": "获取连接超时毫秒。" }, "idleTimeoutMillis": { "type": [ "number", "string", "null" ], "description": "空闲连接超时毫秒。" } } }, "socket": { "type": "object", "additionalProperties": true, "properties": { "host": { "type": "string", "description": "Redis 主机。" }, "port": { "type": [ "number", "string" ], "description": "Redis 端口。" }, "path": { "type": "string", "description": "Unix socket 路径。" }, "connectTimeout": { "type": [ "number", "string" ], "description": "连接超时毫秒。" }, "tls": { "type": [ "boolean", "string" ], "description": "启用 TLS。" }, "keepAlive": { "type": [ "number", "string" ], "description": "TCP keep-alive 毫秒。" }, "noDelay": { "type": [ "boolean", "string" ], "description": "TCP noDelay。" } } }, "ssl": { "anyOf": [ { "type": [ "boolean", "string" ] }, { "type": "object", "additionalProperties": true, "properties": { "rejectUnauthorized": { "type": [ "boolean", "string" ], "description": "校验证书。" }, "ca": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "object", "additionalProperties": true, "description": "驱动可识别的二进制证书;非普通文本编辑项。" } ], "description": "CA 证书内容或路径;由驱动解释。" }, "cert": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "object", "additionalProperties": true, "description": "驱动可识别的二进制证书;非普通文本编辑项。" } ], "description": "客户端证书。" }, "key": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "object", "additionalProperties": true, "description": "驱动可识别的二进制证书;非普通文本编辑项。" } ], "description": "客户端私钥。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "passphrase": { "type": "string", "description": "私钥口令。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "servername": { "type": "string", "description": "TLS server name。" } } } ] }, "charset": { "type": "string", "description": "MySQL 字符集。" }, "timezone": { "type": "string", "description": "MySQL 时区。" }, "connectTimeout": { "type": [ "number", "string" ], "description": "MySQL 连接超时毫秒。" }, "connectionTimeoutMillis": { "type": [ "number", "string" ], "description": "PostgreSQL 连接超时毫秒。" }, "query_timeout": { "type": [ "number", "string" ], "description": "PostgreSQL 查询超时毫秒。" }, "statement_timeout": { "type": [ "number", "string" ], "description": "PostgreSQL statement 超时毫秒。" }, "application_name": { "type": "string", "description": "PostgreSQL 应用名称。" }, "maxPoolSize": { "type": [ "number", "string" ], "description": "MongoDB 最大连接池大小。" }, "minPoolSize": { "type": [ "number", "string" ], "description": "MongoDB 最小连接池大小。" }, "serverSelectionTimeoutMS": { "type": [ "number", "string" ], "description": "MongoDB server 选择超时毫秒。" }, "connectTimeoutMS": { "type": [ "number", "string" ], "description": "MongoDB 连接超时毫秒。" }, "socketTimeoutMS": { "type": [ "number", "string" ], "description": "MongoDB socket 超时毫秒。" }, "authSource": { "type": "string", "description": "MongoDB 认证数据库。" }, "replicaSet": { "type": "string", "description": "MongoDB 副本集。" }, "auth": { "type": "object", "additionalProperties": true, "properties": { "username": { "type": "string", "description": "MongoDB 用户名。" }, "password": { "type": "string", "description": "MongoDB 密码。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } } } }, "disableOfflineQueue": { "type": [ "boolean", "string" ], "description": "Redis 禁止离线队列。" }, "pingInterval": { "type": [ "number", "string" ], "description": "Redis 心跳间隔毫秒。" }, "console": { "type": "object", "additionalProperties": false, "description": "PostgreSQL / MySQL:Console SQL 控制台使用的受限账号(ADR 0059;zhin db console-role 创建)。未配置时原始 SQL 关闭。", "properties": { "user": { "type": "string", "description": "受限账号用户名,通常写 ${ZHIN_DB_CONSOLE_USER}。" }, "password": { "type": "string", "description": "受限账号密码,写 ${ZHIN_DB_CONSOLE_PASSWORD},值只放 .env。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } } } } } }, "ai": { "type": "object", "additionalProperties": true, "description": "Providers, Agents, sessions, memory, tools, and execution security.", "x-descriptionZh": "Provider、Agent、会话、记忆、工具与执行安全策略。", "properties": { "venues": { "type": "array", "description": "Shared multi-Bot IM rooms (ADR 0048 §3.2).", "x-descriptionZh": "多 Bot 共享 IM 房间(ADR 0048 §3.2)。", "items": { "type": "object", "additionalProperties": false, "required": [ "id", "conversation", "members" ], "properties": { "id": { "type": "string", "minLength": 1 }, "label": { "type": "string" }, "conversation": { "type": "object", "additionalProperties": false, "required": [ "platform", "sceneId" ], "properties": { "platform": { "type": "string", "minLength": 1 }, "sceneType": { "type": "string", "enum": [ "private", "group", "channel" ] }, "sceneId": { "type": "string", "minLength": 1 }, "threadId": { "type": "string" } } }, "members": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": [ "agent", "botEndpoint" ], "properties": { "agent": { "type": "string", "minLength": 1 }, "botEndpoint": { "type": "string", "minLength": 1 }, "aliases": { "type": "array", "items": { "type": "string", "minLength": 1 } } } } }, "entry": { "type": "string", "minLength": 1 }, "visibility": { "type": "string", "enum": [ "visible", "summary", "backstage" ] } } } }, "externalPeers": { "type": "array", "description": "Declared third-party Bot accounts (ADR 0043/0048).", "x-descriptionZh": "显式声明的外部第三方 Bot 账号(ADR 0043/0048)。", "items": { "type": "object", "additionalProperties": false, "required": [ "platform", "userId" ], "properties": { "platform": { "type": "string", "minLength": 1 }, "userId": { "type": "string", "minLength": 1 }, "label": { "type": "string" } } } }, "agent": { "type": "object", "additionalProperties": true, "description": "Agent execution, queueing, tool, and model policies.", "x-descriptionZh": "Agent 执行、排队、工具与模型策略。", "properties": { "mailbox": { "type": "object", "additionalProperties": true, "description": "IM inbox policy of the agent Mailbox (ADR 0048 H3; renamed from inboundQueue, which now fails startup).", "x-descriptionZh": "Agent 收件箱(Mailbox)的 IM 收件策略(ADR 0048 H3;由 inboundQueue 改名,旧键会导致启动失败)。", "properties": { "groupMode": { "type": "string", "enum": [ "supersede", "fifo" ], "description": "supersede (default): a sender's new message replaces their own unanswered turn; fifo: every message waits in arrival order. Other members' messages always queue.", "x-descriptionZh": "supersede(默认):同一发起人的新消息会替换他自己尚未回复的回合;fifo:全部按到达顺序排队。其他成员的消息总是排队。" }, "ttlMs": { "type": "integer", "minimum": 0, "default": 180000, "description": "A queued turn that waited longer than this is dropped with a short notice. 0 disables expiry.", "x-descriptionZh": "排队超过该时长的回合会被丢弃并简短提示;0 表示不过期。" }, "maxQueuedTurns": { "type": "integer", "minimum": 0, "default": 5, "description": "Turns allowed to wait behind the running turn of one conversation; further messages get a short busy reply.", "x-descriptionZh": "同一会话中允许排在当前回合之后的回合数;超出时回复一句“正在忙”。" }, "merge": { "type": "object", "additionalProperties": false, "description": "Group merge window (ADR 0038): mentions from several members within a short window get one combined reply. Private chats, the master, commands, stop words and messages with media, quotes or forwards never merge.", "x-descriptionZh": "群聊合流窗口(ADR 0038):短时间内多人点名 Bot 时合并为一次回复。私聊、主人、指令、叫停以及带媒体 / 引用 / 转发的消息不参与合流。", "properties": { "enabled": { "type": "boolean", "default": true, "description": "Turn the group merge window on (group chats only). Set false to answer every member one by one as before.", "x-descriptionZh": "开启群聊合流(仅群聊)。设为 false 则恢复逐人逐条回复。" }, "quietMs": { "type": "integer", "minimum": 0, "default": 1500, "description": "The window is answered once no new message joined it for this long.", "x-descriptionZh": "窗口内最后一条消息后安静多久就发车。" }, "maxWaitMs": { "type": "integer", "minimum": 0, "default": 6000, "description": "The window is answered at the latest this long after its first message.", "x-descriptionZh": "窗口从第一条消息起最多等多久。" }, "maxSenders": { "type": "integer", "minimum": 1, "default": 5, "description": "Senders one merged reply covers; further senders wait for the next window.", "x-descriptionZh": "一次合并回复最多容纳的发送者数;超出的人留到下一个窗口。" } } }, "live": { "type": "object", "additionalProperties": false, "description": "Danmaku mode (ADR 0038): live-stream adapters that declare liveDanmaku collect danmaku in a window and reply once, with read-only tools and no approval cards.", "x-descriptionZh": "弹幕模式(ADR 0038):声明了 liveDanmaku 的直播适配器把一段时间内的弹幕收进窗口后只回一次;只开放只读工具,不出审批卡。", "properties": { "mode": { "type": "string", "enum": [ "pick-one", "summary" ], "default": "pick-one", "description": "pick-one answers one danmaku of the window; summary answers the window as a whole once.", "x-descriptionZh": "pick-one:从窗口里挑一条回;summary:概括整个窗口后回一次。" }, "windowMs": { "type": "integer", "minimum": 0, "default": 10000, "description": "How long a danmaku window collects messages from its first danmaku.", "x-descriptionZh": "弹幕窗口从第一条弹幕起收集多久。" }, "minIntervalMs": { "type": "integer", "minimum": 0, "default": 15000, "description": "Minimum time between two danmaku replies in one live room.", "x-descriptionZh": "同一直播间两次弹幕回复的最小间隔。" } } }, "coalesceWindowMs": { "type": [ "number", "string" ] } } }, "execSecurity": { "type": "string", "enum": [ "deny", "allowlist", "full" ], "description": "Shell command security boundary.", "x-descriptionZh": "Shell 命令安全边界。", "x-zhin-config": { "security": true } }, "execPreset": { "type": "string", "enum": [ "readonly", "network", "development", "custom" ], "description": "Command allowlist preset used outside full mode.", "x-descriptionZh": "非 full 模式使用的命令白名单预设。", "x-zhin-config": { "security": true } }, "network": { "type": "object", "additionalProperties": false, "description": "Network access for IM turns (web_fetch / web_search and networked commands). Off by default; enabled allows HTTPS egress, optionally limited to allowedDomains. When enabled is unset, execPreset: network still enables it for compatibility.", "x-descriptionZh": "IM 回合的出网权限(web_fetch / web_search 与联网命令)。默认关闭;enabled 开启 HTTPS 出网,allowedDomains 非空时只允许这些域名。未设置 enabled 时兼容旧配置:execPreset: network 视为开启。", "properties": { "enabled": { "type": "boolean", "default": false, "description": "Allow HTTPS egress for IM turns.", "x-descriptionZh": "是否允许 IM 回合 HTTPS 出网。" }, "allowedDomains": { "type": "array", "items": { "type": "string" }, "description": "When non-empty, only these domains (and their subdomains) are reachable.", "x-descriptionZh": "非空时只允许访问这些域名(含子域名)。" } } }, "masterShell": { "type": "string", "enum": [ "off", "isolated" ], "default": "off", "description": "Shell access for the master in IM private chats. off: no bash in IM turns. isolated: master DMs run bash inside a Docker container (workspace writable, no network, development allowlist, approval for anything else); fails closed when Docker is unavailable.", "x-descriptionZh": "IM 私聊中 master 的 Shell 权限。off:IM 会话不提供 bash;isolated:master 私聊在 Docker 容器内执行 bash(工作区可写、无网络、development 白名单、其余命令需审批),宿主无 Docker 时直接失败。", "x-zhin-config": { "security": true } }, "masterShellApprovalMode": { "type": "string", "enum": [ "ask", "auto", "inherit" ], "default": "ask", "description": "How approval-gated calls are approved in the master's IM private chat when masterShell is isolated. ask: show the master an approval prompt; auto: automatic reviewer (a reviewer rejection is escalated to the master); inherit: use execApprovalMode.", "x-descriptionZh": "masterShell: isolated 时 master 私聊里需审批的调用怎么批。ask(默认):弹确认卡给 master;auto:自动审核(审核拒绝时转问 master);inherit:沿用 execApprovalMode。", "x-zhin-config": { "security": true } }, "toolBudget": { "type": "object", "description": "Interactive runtime turns and their synchronous children have no fixed step or total wall-clock cap. They share configured token quotas. Step/time caps and continuation settings apply to bounded and legacy executions.", "x-descriptionZh": "交互运行时及其同步子任务不设固定轮数和总时长上限,共享配置的 token 额度。步数、时间和续跑设置用于有界任务及旧兼容入口。", "properties": { "extendBy": { "type": "integer", "minimum": 0, "default": 10, "description": "Steps added per extension when progressing; 0 disables.", "x-descriptionZh": "有进展时每次延长的步数;0 关闭。" }, "progressWindow": { "type": "integer", "minimum": 0, "default": 5, "description": "Progress must have happened within this many recent steps.", "x-descriptionZh": "最近多少步内有进展才延长。" }, "maxTotalIterations": { "type": "integer", "minimum": 0, "default": 40, "description": "Hard step cap per turn segment.", "x-descriptionZh": "每段回合的硬步数上限。" }, "maxSubagentTotalIterations": { "type": "integer", "minimum": 0, "default": 30, "description": "Hard step cap for an in-turn sub-agent.", "x-descriptionZh": "回合内子 Agent 的硬步数上限。" }, "maxWallClockMs": { "type": "integer", "minimum": 0, "default": 600000, "description": "Wall-clock cap for the whole turn in ms; 0 disables.", "x-descriptionZh": "整个回合的时间上限(毫秒);0 关闭。" }, "maxTotalTokens": { "type": "integer", "minimum": 0, "default": 0, "description": "Token cap for the whole turn; 0 disables.", "x-descriptionZh": "整个回合的 Token 上限;0 关闭。" }, "failureStreakLimit": { "type": "integer", "minimum": 0, "default": 3, "description": "Consecutive tool failures that stop extensions.", "x-descriptionZh": "连续失败多少次后不再延长。" }, "repeatLimit": { "type": "integer", "minimum": 0, "default": 2, "description": "Consecutive identical repeated calls that stop extensions.", "x-descriptionZh": "连续重复相同调用多少次后不再延长。" }, "autoContinue": { "type": "string", "enum": [ "off", "master_dm", "on" ], "default": "master_dm", "description": "Auto-continue a progressing turn that hit its budget: off, only in the master's private chat, or always. Continuations reuse the same turn (same policy and approvals).", "x-descriptionZh": "回合有进展但预算用尽时自动续跑:off 关闭;master_dm 仅主人私聊;on 总是。续跑沿用同一回合的策略与审批。" }, "maxContinuations": { "type": "integer", "minimum": 0, "default": 2, "description": "Maximum automatic continuations per turn.", "x-descriptionZh": "每回合最多自动续跑次数。" }, "progressUpdates": { "type": "string", "enum": [ "off", "private", "all" ], "default": "private", "description": "off disables progress. Continuous interactive turns report in their current conversation; private/all select scope for bounded turns.", "x-descriptionZh": "off 关闭进度;持续交互任务在当前会话报告。private/all 用于选择有界任务的通知范围。" }, "progressMinIntervalMs": { "type": "integer", "minimum": 0, "default": 45000, "description": "Minimum time between progress updates in ms.", "x-descriptionZh": "两次进度更新的最小间隔(毫秒)。" }, "progressMaxUpdates": { "type": "integer", "minimum": 0, "default": 3, "description": "0 disables progress. Positive values cap bounded turns only; continuous interactive turns use the configured interval without a count cap.", "x-descriptionZh": "0 关闭进度。正数仅限制有界任务的更新次数;持续交互任务按配置的间隔报告,不限次数。" } } }, "injectionGuard": { "type": "object", "description": "Prompt-injection defences. After lower-trust content (tool results, web pages, files, sub-agent reports, background messages) enters a turn, high-risk actions (shell, messaging other conversations, config changes, scheduling) need approval; replies are checked for system-prompt, secret and other-session memory leaks.", "x-descriptionZh": "注入防护。外部内容(工具结果、网页、文件、子 agent 报告、群聊背景消息)进入回合后,高危动作(执行命令、向其他会话发消息、改配置、定时任务)必须审批;出站回复检查系统提示、密钥与其他会话记忆泄露。", "properties": { "confirmHighRisk": { "anyOf": [ { "type": "string", "enum": [ "external_content", "always", "off" ], "description": "Applies to every category. external_content: the pre-ADR-0067 meaning (any_content everywhere, trusted first-party read-only output included); always: every call asks; off: disabled.", "x-descriptionZh": "作用于所有类别。external_content:原来的含义(所有类别 any_content,第一方只读工具的结果也算);always:每次都确认;off:关闭。" }, { "type": "object", "additionalProperties": false, "description": "Per-category levels; unset categories use the defaults (schedule: untrusted_content, others: any_content).", "x-descriptionZh": "按类别设置级别;没写的类别用默认值(定时任务 untrusted_content,其余 any_content)。", "properties": { "shell": { "type": "string", "enum": [ "off", "untrusted_content", "any_content", "always" ], "description": "Running commands. Default any_content.", "x-descriptionZh": "执行命令。默认 any_content。" }, "fileWrite": { "type": "string", "enum": [ "off", "untrusted_content", "any_content", "always" ], "description": "Writing files. Default any_content.", "x-descriptionZh": "写文件。默认 any_content。" }, "outbound": { "type": "string", "enum": [ "off", "untrusted_content", "any_content", "always" ], "description": "Messaging other conversations. Default any_content.", "x-descriptionZh": "向其他会话发消息。默认 any_content。" }, "config": { "type": "string", "enum": [ "off", "untrusted_content", "any_content", "always" ], "description": "Changing configuration. Default any_content.", "x-descriptionZh": "修改配置。默认 any_content。" }, "schedule": { "type": "string", "enum": [ "off", "untrusted_content", "any_content", "always" ], "description": "Scheduled tasks and reminders. Default untrusted_content.", "x-descriptionZh": "定时任务与提醒。默认 untrusted_content。" } } } ], "description": "High-risk action confirmation after lower-trust content (ADR 0067). Levels: off; untrusted_content (after external content; trusted first-party read-only output does not count); any_content (after any content); always (every call). Confirmation is denied in unattended turns. Unset: schedule untrusted_content, shell / fileWrite / outbound / config any_content.", "x-descriptionZh": "读取外部内容后的高危动作确认(ADR 0067)。级别:off;untrusted_content(读过外部内容后确认,第一方只读工具的结果不算);any_content(读过任何内容后确认);always(每次确认)。无人值守回合需要确认时直接拒绝。不写时:定时任务 untrusted_content,执行命令 / 写文件 / 外发 / 改配置 any_content。" }, "outboundCheck": { "type": "string", "enum": [ "redact", "off" ], "default": "redact", "description": "redact: mask leaked system-prompt lines, secrets and other sessions' memory in replies and outbound tool messages. off: disabled.", "x-descriptionZh": "redact:在回复和外发工具消息中屏蔽泄露的系统提示、密钥和其他会话记忆;off:关闭。" }, "trustedOutputTools": { "type": "array", "items": { "type": "string" }, "default": [], "description": "Tools whose results do not count as external content.", "x-descriptionZh": "结果不算外部内容的工具。" } }, "x-zhin-config": { "security": true } }, "toolHardGate": { "type": "object", "description": "Dangerous-tool hard gate (ADR 0036). Always on and independent of execApprovalMode: tools that manage members, publish content, move money or change the bot's identity (a core list, plus tools that declare risk: dangerous), and any call that writes the host's own configuration, dependencies or git hooks (zhin.config.*, .env*, package.json, lockfiles, node_modules/, .git/, …) never run without a fresh human approval or a Console-approved card, even under bypass. A denial fails closed and is not retried in the same turn. Settings can only make it stricter.", "x-descriptionZh": "危险工具硬闸(ADR 0036)。始终开启,独立于 execApprovalMode:成员管理、内容发布、资金、改 Bot 身份类工具(核心名单 + 声明 risk: dangerous 的工具),以及写宿主自身配置 / 依赖 / git 钩子的调用(zhin.config.*、.env*、package.json、锁文件、node_modules/、.git/ 等)没有新鲜的人工批准或 Console 已批准的卡片就不执行,bypass 也不例外;被拒即 fail closed,同一回合不再重试。配置只能更严。", "properties": { "dangerousTools": { "type": "array", "items": { "type": "string" }, "default": [], "description": "Extra tools to treat as dangerous (local or qualified names). Cannot mark a core dangerous tool safe.", "x-descriptionZh": "额外按危险工具处理的工具(本地名或限定名);不能把核心危险工具调成安全。" }, "allowFunds": { "type": "boolean", "default": false, "description": "Allow funds tools (red packets, transfers, payments). Off by default; when on they still need approval.", "x-descriptionZh": "允许资金类工具(红包、转账、付款)。默认关闭;开启后仍需审批。" }, "approvalTimeoutMs": { "type": "integer", "minimum": 1, "default": 300000, "description": "How long a dangerous call waits for approval before it is denied (ms).", "x-descriptionZh": "危险调用等待审批的上限(毫秒),超时即拒绝。" }, "maxPendingPerScene": { "type": "integer", "minimum": 1, "default": 3, "description": "Approval cards one group (scene) may have pending at once (ADR 0038). Beyond it a dangerous call is denied without a new card; asking again for an already pending card does not count.", "x-descriptionZh": "同一群(场景)同时待审批的卡片上限(ADR 0038)。超出后危险调用直接拒绝、不生成新卡;对已有待审卡的重复请求不计数。" }, "imApproval": { "type": "object", "description": "IM approval channel for the hard gate (#1013). Off by default. When on, each new approval card is also sent to allowlisted approvers, who settle it with `approve ` / `deny ` in a private chat (or the dedicated approver group). It shares the Console approval queue: whichever answers first wins. Messages in business groups never settle a card; there is no session-wide or permanent approval.", "x-descriptionZh": "硬闸 IM 审批通道(#1013),默认关闭。开启后每张新审批卡片同时投递给 allowlist 审批人,审批人在私聊(或专用审批群)发送 `approve ` / `deny ` 结算;与 Console 共用审批队列,先到先得。业务群内的消息不能结算卡片,也没有本会话 / 永久授权。", "properties": { "enabled": { "type": "boolean", "default": false, "description": "Turn the IM approval channel on.", "x-descriptionZh": "开启 IM 审批通道。" }, "approverIds": { "description": "Approver platform user ids: a flat list applies to every platform; an object maps a platform (adapter name) to its user ids. Anyone not listed cannot settle a card over IM.", "x-descriptionZh": "审批人的平台用户 id:扁平列表对所有平台生效;对象形式为 平台(adapter 名)→ 用户 id 列表。不在名单里的人不能通过 IM 结算卡片。", "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } ], "default": [] }, "delivery": { "type": "string", "enum": [ "dm", "approver_group" ], "default": "dm", "description": "dm sends each card to every approver privately; approver_group posts it to approverGroupId, which must not be the conversation that triggered the call.", "x-descriptionZh": "dm:私聊发给每位审批人;approver_group:发到 approverGroupId,且不能是触发调用的会话。" }, "approverGroupId": { "type": "string", "description": "Dedicated approver group id, required for delivery: approver_group. Without it the IM channel stays unavailable and only the Console can approve.", "x-descriptionZh": "专用审批群 id,delivery 为 approver_group 时必填;未配置时 IM 通道不可用,只能在 Console 审批。" } } } }, "x-zhin-config": { "security": true } }, "reactions": { "type": "object", "description": "Emoji-reaction pacing per session. The model may propose a reaction on any turn; the host applies one only if at least cooldownMs passed since the last applied reaction in that session and a random roll passes probability. Counters are kept in memory.", "x-descriptionZh": "按会话限制表情回应的频率。模型每轮都可能提出回应,宿主只在距该会话上次已发出的回应满 cooldownMs 且随机掷骰通过 probability 时才发出;计数保存在内存中。", "properties": { "cooldownMs": { "type": "integer", "minimum": 0, "default": 600000, "description": "Minimum gap between two applied reactions in one session (ms).", "x-descriptionZh": "同一会话两次已发出回应之间的最小间隔(毫秒)。" }, "probability": { "type": "number", "minimum": 0, "maximum": 1, "default": 0.35, "description": "Chance that an allowed reaction is applied; 0 disables reactions.", "x-descriptionZh": "允许发出的回应实际发出的概率;0 表示关闭表情回应。" } } }, "usageQuota": { "type": "object", "description": "Per-user and per-group token quotas and a per-group rate limit. All limits are off (0) by default; the owner is exempt by default. Counters are kept in memory.", "x-descriptionZh": "按用户 / 按群的 token 配额与群速率限制。默认全部关闭(0),主人默认不受限;计数保存在内存中。", "properties": { "windowMs": { "type": "integer", "minimum": 60000, "default": 86400000, "description": "Quota window in ms.", "x-descriptionZh": "配额周期(毫秒)。" }, "perUserTokens": { "type": "integer", "minimum": 0, "default": 0, "description": "Tokens one user may use per window; 0 = unlimited.", "x-descriptionZh": "每个用户每周期可用的 token;0 不限。" }, "perGroupTokens": { "type": "integer", "minimum": 0, "default": 0, "description": "Tokens one group may use per window; 0 = unlimited.", "x-descriptionZh": "每个群每周期可用的 token;0 不限。" }, "perGroupRequestsPerMinute": { "type": "integer", "minimum": 0, "default": 0, "description": "Turns one group may start per minute; 0 = unlimited.", "x-descriptionZh": "每个群每分钟可发起的回合数;0 不限。" }, "exemptOwner": { "type": "boolean", "default": true, "description": "The owner is never limited.", "x-descriptionZh": "主人不受限制。", "x-zhin-config": { "security": true } } } }, "execApprovalMode": { "type": "string", "enum": [ "ask", "bypass", "auto" ], "description": "Approval policy for main Agent commands.", "x-descriptionZh": "主 Agent 命令的审批策略。", "x-zhin-config": { "security": true } }, "approval": { "type": "object", "additionalProperties": false, "properties": { "adminSelfApprove": { "type": "boolean", "default": false, "description": "Let a zhin admin (held at endpoint level or above) approve, once, in their own private chat, the operations a policy marks admin-approvable (tools tagged admin_approvable such as schedule_add, session memory) when the bot owner cannot answer there. Default false: only the bot owner approves. Never covers sensitive files, shell commands, global/platform memory, human-only or dangerous tools, or groups without an owner.", "x-descriptionZh": "允许端点层或以上的 zhin admin 在自己的私聊里、主人无法作答时,本人一次性批准策略标为管理员可批的操作(标了 admin_approvable 的工具,如 schedule_add;session 记忆)。默认 false:只有主人能批。敏感文件、Shell 命令、global / platform 记忆、仅限人工与危险工具、无主人的群聊始终不在此列。", "x-zhin-config": { "security": true } } }, "description": "IM approval options.", "x-descriptionZh": "IM 审批选项。" }, "toolExecution": { "type": "string", "enum": [ "parallel", "sequential", "tiered" ], "description": "How tool calls in one model step are scheduled.", "x-descriptionZh": "同一模型步骤中的工具调用调度方式。", "x-zhin-config": { "security": true } }, "modelSizeHint": { "type": "string", "enum": [ "", "small", "medium", "large" ], "description": "Optional model-size hint; an empty string clears the hint.", "x-descriptionZh": "可选模型尺寸提示;空字符串表示清除提示。" }, "promptCacheRetention": { "type": "string", "enum": [ "in_memory", "24h" ], "description": "Provider prompt-cache retention policy.", "x-descriptionZh": "Provider Prompt Cache 保留策略。" }, "steeringMode": { "type": "string", "enum": [ "one-at-a-time", "all" ], "description": "Process steering messages one at a time or drain all pending messages together.", "x-descriptionZh": "逐条处理 Steering 消息,或一次取出全部待处理消息。" }, "followUpMode": { "type": "string", "enum": [ "one-at-a-time", "all" ], "description": "Process follow-up messages one at a time or drain all pending messages together.", "x-descriptionZh": "逐条处理 Follow-up 消息,或一次取出全部待处理消息。" }, "outputSchema": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": [ "segments" ] }, { "type": "object" } ], "description": "Final-output mode: defaults to segments for IM conversations; false for text, true or segments for ordered canonical segments, or a custom JSON Schema object. Detached and non-IM turns do not inherit the IM preset.", "x-descriptionZh": "最终输出默认在 IM 会话使用 segments:false 显式使用文本,true 或 segments 使用有序规范消息段,也可传入自定义 JSON Schema。隔离及非 IM 调用不应用 IM 预设。" }, "schedule": { "type": "object", "additionalProperties": true, "description": "Unattended Schedule execution policy.", "x-descriptionZh": "无人值守 Schedule 执行策略。", "properties": { "security": { "type": "object", "additionalProperties": true, "description": "Schedule command security policy.", "x-descriptionZh": "Schedule 命令安全策略。", "properties": { "execPreset": { "type": "string", "enum": [ "readonly", "network" ], "description": "Schedule Jobs may use only the read-only or network preset.", "x-descriptionZh": "Schedule Job 只能使用只读或网络预设。" }, "allowedDomains": { "type": "array", "items": { "type": "string" } } }, "x-zhin-config": { "security": true } }, "budget": { "type": "object", "additionalProperties": true, "properties": { "maxTokens": { "type": [ "number", "string" ] }, "maxToolCalls": { "type": [ "number", "string" ] }, "timeoutMs": { "type": [ "number", "string" ] } } } } }, "execAllowlist": { "type": "array", "items": { "type": "string" }, "description": "allowlist 模式下允许的命令(支持正则字符串,如 \"^ls \"、\"^cat \"),与 preset 合并", "x-zhin-config": { "security": true } }, "phaseTrace": { "type": [ "boolean", "string" ], "description": "观测主回合阶段日志(或通过 ZHIN_AGENT_PHASE_TRACE=1 开启)" }, "modelHarness": { "type": "object", "additionalProperties": false, "properties": { "services": { "type": "object", "description": "Exact runtime Service id; native-model entries override that Service default.", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "defaults": { "type": "object", "additionalProperties": true, "properties": { "maxIterations": { "type": [ "number", "string" ] }, "explorationBudget": { "type": [ "number", "string" ], "description": "连续只读探索调用达到该次数时注入提示;0 关闭" }, "explorationGuidance": { "type": [ "boolean", "string" ], "description": "在系统提示中加入\"先规划、限定目标文件\"的探索纪律" }, "iterationExtension": { "type": [ "number", "string" ], "description": "每次有进展时延长的步数(覆盖 toolBudget.extendBy)" }, "maxTotalIterations": { "type": [ "number", "string" ], "description": "单段回合的硬步数上限(覆盖 toolBudget.maxTotalIterations)" }, "emptyReplyRetries": { "type": [ "number", "string" ], "description": "空回复(无文本且无工具调用)时额外重试次数;默认 0" }, "requestTimeoutMs": { "type": [ "number", "string" ], "description": "单次模型请求超时(毫秒);0 关闭" } } }, "models": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": true, "properties": { "maxIterations": { "type": [ "number", "string" ] }, "explorationBudget": { "type": [ "number", "string" ], "description": "连续只读探索调用达到该次数时注入提示;0 关闭" }, "explorationGuidance": { "type": [ "boolean", "string" ], "description": "在系统提示中加入\"先规划、限定目标文件\"的探索纪律" }, "iterationExtension": { "type": [ "number", "string" ], "description": "每次有进展时延长的步数(覆盖 toolBudget.extendBy)" }, "maxTotalIterations": { "type": [ "number", "string" ], "description": "单段回合的硬步数上限(覆盖 toolBudget.maxTotalIterations)" }, "emptyReplyRetries": { "type": [ "number", "string" ], "description": "空回复(无文本且无工具调用)时额外重试次数;默认 0" }, "requestTimeoutMs": { "type": [ "number", "string" ], "description": "单次模型请求超时(毫秒);0 关闭" } } } } } } } }, "description": "按模型 / provider 模式覆盖 model harness" }, "providerResilience": { "type": "object", "additionalProperties": true, "properties": { "maxRetries": { "type": [ "number", "string" ], "description": "Retries per model after the first attempt. Default 2. `0` disables retry." }, "baseDelayMs": { "type": [ "number", "string" ], "description": "First backoff delay in ms; doubles each retry. Default 1000." }, "maxDelayMs": { "type": [ "number", "string" ], "description": "Upper bound for one backoff delay in ms. Default 10000." }, "maxRetryAfterMs": { "type": [ "number", "string" ], "description": "A `Retry-After` longer than this stops retry. Default 30000." }, "requestTimeoutMs": { "type": [ "number", "string" ], "description": "Per-attempt timeout in ms (whole streamed completion). Default 120000. `0` disables." }, "firstResponseTimeoutMs": { "type": [ "number", "string" ], "description": "Per-attempt wait in ms for the provider's first response (response headers or the first\nstream event). Default 30000. `0` disables. A service that does not answer in time is not\nre-asked on the same model: the attempt fails as `no_response`." }, "emptyReplyRetries": { "type": [ "number", "string" ], "description": "Extra attempts when the model returns neither text nor tool calls (or a tool call\nwithout a name). Default 0: the reply is passed through unchanged. Quirk presets\n(see model harness) raise this for models known to emit spurious empty replies." } }, "description": "固定模型韧性:重试 / 退避 / 超时(见 ProviderResilienceConfig)" }, "deferredTools": { "type": "object", "additionalProperties": true, "properties": { "maxLoadedPerSession": { "type": [ "number", "string" ] }, "discoverTopK": { "type": [ "number", "string" ] }, "alwaysLoadedTools": { "type": "array", "items": { "type": "string" }, "description": "额外常驻工具;在当前场景档(群聊、私聊、主人私聊)的常驻集合基础上追加" }, "alwaysLoadedMode": { "type": "string", "x-zhin-config": { "options": [ { "label": "extend", "value": "extend" }, { "label": "replace", "value": "replace" } ] }, "description": "`extend`(默认)追加到内置常驻集合;`replace` 完全替换" }, "mcpServers": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": true, "properties": { "alwaysLoaded": { "type": "array", "items": { "type": "string" } } } } } }, "description": "工具 schema 按需加载" }, "persona": { "type": "string" }, "maxIterations": { "type": [ "number", "string" ] }, "timeout": { "type": [ "number", "string" ] }, "maxTools": { "type": [ "number", "string" ] }, "contextTailMessageLimit": { "type": [ "number", "string" ] }, "rateLimit": { "type": "object", "additionalProperties": true, "properties": { "maxRequestsPerMinute": { "type": [ "number", "string" ], "description": "每分钟最大请求数(默认 20)" }, "cooldownSeconds": { "type": [ "number", "string" ], "description": "冷却时间(秒),超限后需等待(默认 10)" } } }, "toneAwareness": { "type": [ "boolean", "string" ] }, "contextTokens": { "type": [ "number", "string" ] }, "maxHistoryShare": { "type": [ "number", "string" ] }, "compaction": { "type": "object", "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "auto": { "type": [ "boolean", "string" ] }, "keepRecentTokens": { "type": [ "number", "string" ] }, "minKeepCount": { "type": [ "number", "string" ] }, "thresholdRatio": { "type": [ "number", "string" ], "description": "Share of the model context window (system prompt and tools included) at\nwhich auto-compaction runs. Default 0.7 (#730)." } } }, "disabledTools": { "type": "array", "items": { "type": "string" } }, "allowedTools": { "type": "array", "items": { "type": "string" } }, "maxSubagentIterations": { "type": [ "number", "string" ] }, "skillInstructionMaxChars": { "type": [ "number", "string" ] }, "promptTrace": { "type": [ "boolean", "string" ] }, "promptTraceVerbose": { "type": [ "boolean", "string" ] }, "recordRequestBodies": { "type": "boolean" }, "promptCache": { "type": [ "boolean", "string" ] }, "promptCacheKeyPrefix": { "type": "string" }, "gitStatus": { "type": [ "boolean", "string" ], "description": "§1 Runtime 注入单行 git 状态摘要(非 git 仓库自动跳过)" }, "contextPaths": { "type": "array", "items": { "type": "string" }, "description": "追加的上下文文件路径(支持 ~ 与相对路径;默认另加载 ~/.config/zhin/AGENTS.md 等全局路径)" }, "systemPromptMaxChars": { "type": [ "number", "string" ], "description": "系统提示词总字符上限;按 retention/order 让出预算,required 内容放不下则失败。" }, "thinkingPreview": { "type": [ "boolean", "string" ], "description": "Activity feedback 展示 LLM 实际 thinking 内容(截断),而非静态 \"思考中...\"。" }, "thinkingPreviewMaxLength": { "type": [ "number", "string" ], "description": "thinkingPreview 展示的最大字符数。" } } }, "enabled": { "type": [ "boolean", "string" ] }, "agents": { "type": [ "object", "null" ], "additionalProperties": { "type": "object", "additionalProperties": true, "properties": { "mcpServers": { "type": [ "array", "null" ], "items": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "object", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { "type": "string", "minLength": 1 }, "permit": { "type": [ "object", "null" ], "additionalProperties": false, "properties": { "readOnly": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } ], "description": "上游标注 readOnlyHint=true(且不是 destructiveHint=true)、没被 tools 命中的工具。everyone / deny / permit DSL 字符串或数组(AND)。省略时不额外限制。" }, "default": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } ], "description": "其余工具(未标注、标注为写、标注矛盾)。省略时不额外限制。" }, "tools": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } ], "description": "该工具名或模式的权限档位。" }, "description": "按上游原始工具名覆盖(区分大小写,只支持 * 通配;精确名优先,其次字面字符最多的模式,并列时都要满足)。非 ASCII 工具名只能被精确名命中。", "x-keyPlaceholder": "create_*" } }, "description": "Agent 层权限(ADR 0065):与服务器级结果取 AND,只能收窄。" } } } ] }, "description": "该 Agent 能用哪些 MCP 服务器的工具:填 ai.mcpServers 中的 name,或 { name, permit }(Agent 层权限只能收窄,ADR 0065)。不在这里列出的服务器即使已连接,这个 Agent 也用不了它的工具(例:ai.agents.zhin.mcpServers: [github])。同一服务器只能出现一次。", "x-zhin-config": { "security": true } }, "nickname": { "type": "string", "description": "Fallback nickname when the Endpoint does not provide account profile data." } } }, "description": "Agent authority and display metadata. Model selection belongs to runtime Profile purposes." }, "sessions": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "maxHistory": { "type": [ "number", "string" ], "description": "最大历史消息数(数据库模式默认200,内存模式默认100)" }, "expireMs": { "type": [ "number", "string" ], "description": "会话过期时间(毫秒,数据库模式默认7天,内存模式默认24小时)" }, "useDatabase": { "type": [ "boolean", "string" ], "description": "是否使用数据库持久化存储(默认 true)" }, "coldStartMaxMessages": { "type": [ "number", "string" ], "description": "无摘要时冷启动最多条数(默认 50)" }, "coldStartMaxAgeMs": { "type": [ "number", "string" ], "description": "冷启动时间窗(毫秒,默认 24h)" }, "sessionIdleArchiveMs": { "type": [ "number", "string" ], "description": "空闲后自动归档 active 会话(毫秒,默认 7 天;0=关闭)" } } }, "context": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "是否启用消息记录(默认 true)" }, "maxRecentMessages": { "type": [ "number", "string" ], "description": "历史消息条数上限(默认 100);与 historyTokens 取先到者" }, "historyTokens": { "type": [ "number", "string", "object" ], "description": "每轮发给模型的历史 token 预算:数字对所有场景生效,也可写 { group, private, masterPrivate };默认群聊 8000、普通私聊 12000、主人私聊 24000;0 = 不按 token 限制", "additionalProperties": true, "properties": { "group": { "type": [ "number", "string" ], "description": "群聊 / 频道(默认 8000)" }, "private": { "type": [ "number", "string" ], "description": "普通私聊(默认 12000)" }, "masterPrivate": { "type": [ "number", "string" ], "description": "主人私聊(默认 24000)" } } }, "summaryThreshold": { "type": [ "number", "string" ], "description": "触发总结的消息数量阈值(默认 50)" }, "keepAfterSummary": { "type": [ "number", "string" ], "description": "总结后保留的消息数量(默认 10)" }, "maxContextTokens": { "type": [ "number", "string" ], "description": "上下文最大 token 估算(默认 4000)" }, "summaryPrompt": { "type": "string", "description": "自定义总结提示词" } } }, "multimodal": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "maxFileBytes": { "type": [ "number", "string" ] }, "inboundDir": { "type": "string" }, "outboundDir": { "type": "string" }, "image": { "type": "object", "additionalProperties": true, "properties": { "maxDimension": { "type": [ "number", "string" ] }, "preferNativeVision": { "type": [ "boolean", "string" ] } } }, "audio": { "type": "object", "additionalProperties": true, "properties": { "strategy": { "type": "string", "x-zhin-config": { "options": [ { "label": "transcribe", "value": "transcribe" }, { "label": "mcp", "value": "mcp" }, { "label": "text-only", "value": "text-only" } ] } } } }, "video": { "type": "object", "additionalProperties": true, "properties": { "strategy": { "type": "string", "x-zhin-config": { "options": [ { "label": "mcp", "value": "mcp" }, { "label": "text-only", "value": "text-only" } ] } }, "mcpServer": { "type": "string" }, "maxFrames": { "type": [ "number", "string" ] } } }, "outbound": { "type": "object", "additionalProperties": true, "properties": { "splitMessages": { "type": "string", "x-zhin-config": { "options": [ { "label": "auto", "value": "auto" }, { "label": "single", "value": "single" }, { "label": "always_split", "value": "always_split" } ] } } } }, "perception": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "kinds": { "type": "array", "items": { "type": "string", "x-zhin-config": { "options": [ { "label": "image", "value": "image" }, { "label": "video", "value": "video" }, { "label": "file", "value": "file" } ] } }, "description": "Kinds to describe. Default `['image']`; `file` covers PDFs only." }, "maxChars": { "type": [ "number", "string" ], "description": "Description length cap in characters. Default 800." }, "timeoutMs": { "type": [ "number", "string" ], "description": "Per-attempt timeout in ms. Default 30000." }, "maxItemsPerTurn": { "type": [ "number", "string" ], "description": "Media described per turn; the rest keep the placeholder. Default 4." } }, "description": "Perception pre-pass: when the turn's model cannot take an image / video / PDF,\nthis media-capable model describes it and the description is injected as\nuntrusted text (`[图片描述] …`). Unset = off (placeholders as before)." } }, "description": "入站/出站多模态(base64 契约;平台 adapter 负责编解码与发送)" }, "memory": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "semantic": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "autoConsolidate": { "type": [ "boolean", "string" ] }, "recall": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "topK": { "type": [ "number", "string", "null" ] }, "maxTokens": { "type": [ "number", "string", "null" ] } }, "description": "Per-turn recall (#734): BM25 top-k entries relevant to the current\nmessage are added to the turn context. Default on when semantic memory\nis enabled; topK 5, maxTokens 400." } }, "description": "L4 语义记忆:memory_entries 表 + memory_search/upsert 工具" }, "budgets": { "type": "object", "additionalProperties": true, "properties": { "session": { "type": [ "number", "string" ] }, "platform": { "type": [ "number", "string" ] }, "global": { "type": [ "number", "string" ] }, "daily": { "type": [ "number", "string" ] } } } }, "description": "三层 Markdown 文件记忆(global / platform / session)。\n默认启用;设 enabled: false 可关闭注入。" }, "knowledge": { "type": "object", "additionalProperties": true, "properties": { "baseDir": { "type": "string", "description": "项目根目录内的知识库目录路径。配置该段时必须显式声明。" } }, "description": "本地知识库(knowledge_search 工具数据源)。\n放置 .md / .txt 文件到 baseDir,Agent 可通过 knowledge_search 工具检索。" }, "githubMcp": { "type": "object", "additionalProperties": true, "properties": { "token": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "enabled": { "type": [ "boolean", "string" ], "description": "为 true 时注册 server-github MCP(PAT,人身份);默认 false,Bot 写操作用 adapter github_* 工具" } }, "description": "PAT for adapter-github auto-registered server-github MCP (overrides env when set).", "x-zhin-config": { "security": true } }, "mcpServers": { "type": [ "array", "null" ], "items": { "type": "object", "additionalProperties": true, "properties": { "name": { "type": "string" }, "transport": { "type": "string", "x-zhin-config": { "options": [ { "label": "stdio", "value": "stdio" }, { "label": "streamable-http", "value": "streamable-http" }, { "label": "sse", "value": "sse" } ] } }, "url": { "type": "string" }, "command": { "type": "string" }, "args": { "type": "array", "items": { "type": "string" } }, "env": { "type": "object", "additionalProperties": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } } }, "headers": { "type": "object", "additionalProperties": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } } }, "permit": { "type": [ "object", "null" ], "additionalProperties": false, "properties": { "readOnly": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } ], "description": "上游标注 readOnlyHint=true(且不是 destructiveHint=true)、没被 tools 命中的工具。everyone / deny / permit DSL 字符串或数组(AND)。缺省 everyone。" }, "default": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } ], "description": "其余工具(未标注、标注为写、标注矛盾)。缺省 owner@global。" }, "tools": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } ], "description": "该工具名或模式的权限档位。" }, "description": "按上游原始工具名覆盖(区分大小写,只支持 * 通配;精确名优先,其次字面字符最多的模式,并列时都要满足)。非 ASCII 工具名只能被精确名命中。", "x-keyPlaceholder": "create_*" } }, "description": "谁能用这个服务器的哪些工具(ADR 0065)。不写等同于 { readOnly: everyone, default: owner@global, tools: {} }。" } } }, "description": "要连接的外部 MCP 服务器(只负责连接)。连接成功不等于能用:还要在 ai.agents..mcpServers 里写上服务器的 name,对应的 Agent 才能调用它的工具(例:ai.agents.zhin.mcpServers: [github])。没有任何 Agent 绑定的服务器,zhin status、zhin doctor 与 Console「需要你处理」会提示。", "x-zhin-config": { "security": true } }, "access": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "mode": { "type": "string", "x-zhin-config": { "options": [ { "label": "open", "value": "open" }, { "label": "closed", "value": "closed" }, { "label": "whitelist", "value": "whitelist" } ] }, "description": "open | closed | whitelist,默认 open" }, "users": { "type": "array", "items": { "type": "string" }, "description": "允许触发 AI 的 sender.id" }, "groups": { "type": "array", "items": { "type": "string" }, "description": "允许触发 AI 的 group/channel id" }, "denyMessage": { "type": "string", "description": "私聊拒绝时的回复文案" } }, "description": "AI 访问控制(平台 AIGC 合规;Endpoint 可用 aiAccess 覆盖)" }, "trigger": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "是否启用(默认 true)" }, "prefixes": { "type": "array", "items": { "type": "string" }, "description": "触发前缀列表(默认 ['#', 'AI:'])" }, "respondToAt": { "type": [ "boolean", "string" ], "description": "是否响应 @ 机器人(默认 true)" }, "respondToPrivate": { "type": [ "boolean", "string" ], "description": "是否响应私聊(默认 true)" }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "触发关键词(可选)" }, "ignorePrefixes": { "type": "array", "items": { "type": "string" }, "description": "除适配器真实 commandPrefix 外额外视为命令的前缀(不当 AI 消息、不进合并窗口;默认 ['/', '!', '!'])" }, "timeout": { "type": [ "number", "string" ], "description": "超时时间(毫秒,默认 60000)" }, "thinkingMessage": { "type": "string", "description": "思考中提示语(可选,设置后会在处理前发送)" }, "errorTemplate": { "type": "string", "description": "入口层错误提示模板,{error} 为错误信息(可选;不配置时用聊天口吻说\"刚卡了一下\",主人额外看到原因)" }, "ambient": { "type": "object", "additionalProperties": true, "description": "群聊旁听:群里没人叫机器人时,由判断模型决定是否接话。被 @、引用和私聊不经过这里,总会交给 Agent(Agent 也可以选择不回复)。", "properties": { "conversations": { "type": "array", "items": { "type": "string" }, "description": "开启旁听的群,格式 platform:groupId;* 表示所有群。默认为空(关闭)" }, "quietMs": { "type": [ "number", "string" ], "description": "群安静多久后才判断一次(毫秒,默认 4000)" }, "cooldownMs": { "type": [ "number", "string" ], "description": "两次主动插话之间的最短间隔(毫秒,默认 120000);对话进行中不受限制" }, "maxPerHour": { "type": [ "number", "string" ], "description": "每个群每小时最多主动插话次数(默认 3);对话进行中不计入" }, "conversationWindowMs": { "type": [ "number", "string" ], "description": "机器人说话后,这段时间内算作对话进行中:群友接它的话只由判断模型决定,不受冷却和每小时次数限制(毫秒,默认 180000)" }, "judgeIntervalMs": { "type": [ "number", "string" ], "description": "没在对话时,同一个群至少隔这么久才判断一次(毫秒,默认 30000),节省判断模型的额度;窗口内的消息顺延到窗口结束再判,不会丢" }, "minConfidence": { "type": [ "number", "string" ], "deprecated": true, "description": "已废弃(ADR 0066):门槛改在插话判断 purposes.ambient.minConfidence(Console「插话判断」)设置。升级后迁移时读入一次,之后不再生效;zhin doctor --fix 可删除" }, "mode": { "type": "string", "enum": [ "active", "shadow" ], "deprecated": true, "description": "已废弃(ADR 0066):「只记录不插话」改在插话判断 purposes.ambient.mode 设置。升级后迁移时读入一次,之后不再生效;zhin doctor --fix 可删除" } } }, "sceneEvents": { "type": "object", "additionalProperties": true, "description": "状态感知:禁言/解禁、入群申请、成员进出、公告变更、戳 Bot 等高优先社交事件独立唤醒一次回合(不必等下一条人话);表情回应、名片/头衔变更等低优先事件不单独唤醒,只在下一轮 [Scene events] 摘要里出现。Bot 不能发言时只更新会话画像,不调用模型。", "properties": { "conversations": { "type": "array", "items": { "type": "string" }, "description": "允许被社交事件唤醒的群/频道,格式 platform:sceneId;* 表示所有群。缺省沿用 ai.trigger.ambient.conversations(都没配则不唤醒)", "x-i18n": { "en": { "description": "Groups/channels that social events may wake, as platform:sceneId; * for every group. Defaults to ai.trigger.ambient.conversations (no wake when neither is set)" } } }, "coalesceMs": { "type": [ "number", "string" ], "description": "同一场景的合并窗口(毫秒,限定 3000~5000,默认 4000)", "x-i18n": { "en": { "description": "Coalesce window per scene in ms, clamped to 3000–5000 (default 4000)" } } }, "minIntervalMs": { "type": [ "number", "string" ], "description": "同一场景两次唤醒的最短间隔(毫秒,默认 15000);未到时间的批次顺延,不丢", "x-i18n": { "en": { "description": "Minimum gap between two wakes in one scene in ms (default 15000); early batches are deferred, not dropped" } } } }, "x-i18n": { "en": { "description": "Scene awareness: high-priority social events (bot muted/unmuted, join request, member joined/left, notice updated, bot poked) wake one turn on their own without waiting for the next human message; low-priority events (reactions, card/title changes) never wake alone and only appear in the next turn's [Scene events] summary. When the bot cannot speak, only the session profile is updated and the model is not called." } } } }, "description": "AI 触发配置" }, "usage": { "type": [ "object", "null" ], "additionalProperties": false, "description": "结构化用量存储(SQLite、MySQL、PostgreSQL);独立于日志级别,不保存正文或工具参数。", "properties": { "retentionDays": { "type": [ "integer", "string" ], "minimum": 1, "default": 30, "description": "用量明细保留天数,正整数,默认 30 天;按回合结束时间清理,子调用与所属回合一起删除。" } } }, "audit": { "type": [ "object", "null" ], "additionalProperties": false, "description": "决策审计 ai_decision_events(ADR 0036):每次进不进模型、说不说话、调不调工具都记一行,在 Console「机器人状态 → 决策回放」查看与导出;不保存正文、提示词或密钥。", "properties": { "retentionDays": { "type": [ "integer", "string" ], "minimum": 1, "default": 14, "description": "决策审计保留天数,正整数,默认 14 天;启动时与之后每小时按事件时间清理过期行。" } } }, "imageStorage": { "type": "object", "additionalProperties": false, "description": "Optional public R2 storage for generated images. Bucket access and lifecycle are managed by the operator.", "required": [ "accountId", "bucket", "accessKeyId", "secretAccessKey", "publicBaseUrl", "prefix" ], "properties": { "accountId": { "type": "string" }, "bucket": { "type": "string" }, "accessKeyId": { "type": "string", "writeOnly": true, "x-zhin-secret": true }, "secretAccessKey": { "type": "string", "writeOnly": true, "x-zhin-secret": true }, "publicBaseUrl": { "type": "string", "description": "Public HTTPS base URL; not the S3 upload endpoint." }, "prefix": { "type": "string", "description": "Object directory ending in /; must be covered by the bucket lifecycle." } } }, "personalPrincipals": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "rootId": { "type": "string", "minLength": 1 }, "platform": { "type": "string", "minLength": 1 }, "endpoint": { "type": "string", "minLength": 1 }, "adapterId": { "type": "string", "minLength": 1 }, "subjectId": { "type": "string", "minLength": 1 } }, "required": [ "rootId", "platform", "endpoint", "adapterId", "subjectId" ] } }, "description": "Administrator mapping from authenticated Console principal ids to exact IM owners; never inferred from client input." } } }, "menuKeyword": { "type": [ "string", "boolean" ], "anyOf": [ { "type": "string" }, { "const": false } ], "description": "Built-in command menu keyword. Defaults to 菜单; false or an empty string disables the menu.", "x-descriptionZh": "内置指令菜单关键词;默认 菜单,false 或空字符串关闭菜单。" }, "commandSuggestion": { "description": "Reply \"no such command, did you mean …\" instead of handing a near-miss command (private chat, @mention or prefixed message) to the AI. false disables it.", "x-descriptionZh": "未命中但与已注册指令名/别名高度相似的消息(私聊、@机器人或带指令前缀)直接回复「没有这个指令,你是不是想用:…」,不交给 AI;false 关闭。", "anyOf": [ { "type": "boolean" }, { "type": "object", "additionalProperties": false, "properties": { "enabled": { "type": "boolean", "description": "Whether suggestions are on (default true).", "x-descriptionZh": "是否开启(默认 true)。" }, "maxDistance": { "type": "integer", "minimum": 0, "maximum": 2, "description": "Largest edit distance still suggested (default 1; one edit needs a name of at least 5 characters, or 3 CJK characters; two edits need 8).", "x-descriptionZh": "仍给出建议的最大编辑距离(默认 1;1 次编辑要求名称至少 5 个字符或 3 个汉字,2 次编辑要求至少 8 个字符)。" }, "limit": { "type": "integer", "minimum": 1, "maximum": 5, "description": "Most commands listed in one reply (default 3).", "x-descriptionZh": "一次回复最多列出的指令数(默认 3)。" } } } ] }, "menuStyle": { "type": "object", "additionalProperties": false, "description": "Command menu appearance when an HTML renderer is available; plain text fallback remains available.", "x-descriptionZh": "HTML 渲染可用时的指令菜单外观;始终保留纯文本降级。", "properties": { "title": { "type": "string", "description": "Menu title.", "x-descriptionZh": "菜单标题。" }, "subtitle": { "type": "string", "description": "Menu subtitle.", "x-descriptionZh": "菜单副标题。" }, "accentColor": { "type": "string", "description": "Six-digit hex accent color; invalid values use the renderer default.", "x-descriptionZh": "六位十六进制强调色;无效值使用渲染器默认值。" }, "backgroundImage": { "type": "string", "description": "HTTP(S) image or PNG/JPEG/WebP data URL; unsupported values use the renderer default.", "x-descriptionZh": "HTTP(S) 图片或 PNG/JPEG/WebP data URL;不支持的值使用渲染器默认值。" } } }, "mcp": { "type": "object", "additionalProperties": true, "description": "Expose Bot tools through an MCP Server.", "x-descriptionZh": "把 Bot 工具公开为 MCP Server。", "properties": { "enabled": { "type": [ "boolean", "string" ] }, "path": { "type": [ "string", "null" ] }, "token": { "type": [ "string", "null" ], "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "allowUnauthenticatedLocalhost": { "type": [ "boolean", "string" ] } }, "x-zhin-config": { "security": true } }, "a2a": { "type": "object", "additionalProperties": true, "description": "A2A Agent Card, remote execution, and cross-process Mailbox transport.", "x-descriptionZh": "A2A Agent Card、远程执行与跨进程 Mailbox 传输。", "properties": { "enabled": { "type": [ "boolean", "string" ] }, "path": { "type": [ "string", "null" ] }, "token": { "type": [ "string", "null" ], "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "publicUrl": { "type": [ "string", "null" ] }, "mailbox": { "type": [ "object", "null" ], "additionalProperties": true, "description": "Cross-process A2A Mailbox transport for signed Mail + Authority + Budget envelopes (ADR 0048 §3.6).", "x-descriptionZh": "跨进程 A2A Mailbox 传输(携带签名 Mail、Authority 与 Budget,ADR 0048 §3.6)。", "properties": { "enabled": { "type": [ "boolean", "string" ] }, "path": { "type": "string", "description": "Inbound HTTP route path (defaults to `/a2a/mailbox`)." }, "secret": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "maxBodyBytes": { "type": [ "number", "string" ] }, "peers": { "type": "array", "items": { "type": "object", "additionalProperties": true, "required": [ "actor", "url" ], "properties": { "actor": { "type": "string", "minLength": 1 }, "url": { "type": "string", "minLength": 1 }, "token": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "secret": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "timeoutMs": { "type": [ "number", "string" ] } } } } }, "x-zhin-config": { "security": true } } } }, "speech": { "type": "object", "additionalProperties": true, "description": "Speech-to-text and text-to-speech Host.", "x-descriptionZh": "语音识别与语音合成 Host。", "properties": { "stt": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "provider": { "type": "string", "x-zhin-config": { "options": [ { "label": "openai", "value": "openai" }, { "label": "ollama", "value": "ollama" } ] } }, "model": { "type": "string" }, "host": { "type": "string" }, "apiKey": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } } } }, "tts": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "provider": { "type": "string", "x-zhin-config": { "options": [ { "label": "openai", "value": "openai" }, { "label": "custom", "value": "custom" }, { "label": "edge", "value": "edge" }, { "label": "azure", "value": "azure" } ] } }, "voice": { "type": "string" }, "model": { "type": "string" }, "host": { "type": "string" }, "apiKey": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "rate": { "type": "string", "description": "edge-tts" }, "pitch": { "type": "string" }, "edgeTtsCommand": { "type": "string" }, "region": { "type": "string", "description": "azure" }, "subscriptionKey": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "baseUrl": { "type": "string", "description": "custom OpenAI-compatible" }, "headers": { "type": "object", "additionalProperties": { "type": "string", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } } }, "speed": { "type": [ "number", "string" ] } } } } }, "htmlRenderer": { "type": "object", "additionalProperties": true, "description": "HTML and image rendering options backed by Shotium.", "x-descriptionZh": "基于 Shotium 的 HTML/图片渲染参数。", "properties": { "width": { "type": "number", "minimum": 1, "maximum": 30000, "description": "Default layout width in CSS pixels.", "x-descriptionZh": "默认排版宽度(CSS 像素)。" }, "defaultWidth": { "type": "number", "minimum": 1, "maximum": 30000, "description": "Legacy alias of width.", "x-descriptionZh": "width 的旧别名。" }, "viewport": { "type": "object", "additionalProperties": true, "description": "Default viewport for Shotium rendering.", "x-descriptionZh": "Shotium 渲染默认视窗。", "properties": { "width": { "type": "number", "minimum": 1, "maximum": 30000, "description": "Viewport width in CSS pixels.", "x-descriptionZh": "视窗宽度(CSS 像素)。" }, "height": { "type": "number", "minimum": 1, "maximum": 30000, "description": "Viewport height in CSS pixels.", "x-descriptionZh": "视窗高度(CSS 像素)。" } } }, "backgroundColor": { "type": "string", "description": "Fragment background color.", "x-descriptionZh": "HTML 片段背景色。" }, "defaultBackgroundColor": { "type": "string", "description": "Legacy alias of backgroundColor.", "x-descriptionZh": "backgroundColor 的旧别名。" }, "scale": { "type": "number", "minimum": 0.01, "maximum": 8, "description": "Device scale factor.", "x-descriptionZh": "设备像素比。" }, "type": { "type": "string", "enum": [ "png", "jpeg", "webp" ], "description": "Default raster output format.", "x-descriptionZh": "默认位图输出格式。" }, "quality": { "type": "number", "minimum": 1, "maximum": 100, "description": "Quality for jpeg/webp output.", "x-descriptionZh": "jpeg/webp 输出质量。" }, "timeout": { "type": "number", "minimum": 1, "maximum": 600000, "description": "Navigation timeout in milliseconds.", "x-descriptionZh": "导航超时(毫秒)。" }, "waitUntil": { "type": "string", "enum": [ "load", "networkidle" ], "description": "Navigation wait strategy.", "x-descriptionZh": "导航等待策略。" }, "fontFamily": { "type": "string", "description": "Default font-family for fragments.", "x-descriptionZh": "HTML 片段默认字体栈。" }, "maxImageHeight": { "type": "number", "minimum": 0, "maximum": 100000, "description": "Split overly tall PNGs above this height; 0 disables splitting.", "x-descriptionZh": "超过该高度时切分 PNG;0 表示不切分。" }, "sliceCompression": { "type": "number", "minimum": 0, "maximum": 9, "description": "Compression level used when splitting PNGs.", "x-descriptionZh": "PNG 切片时使用的压缩级别。" }, "allowFileAccess": { "type": "boolean", "description": "Allow local file subresources.", "x-descriptionZh": "允许访问本地文件子资源。" }, "takeOverHtmlSegments": { "type": "boolean", "description": "Take over html/markdown rich-segment image rendering.", "x-descriptionZh": "接管 html/markdown 富媒体段转图。" }, "cacheDir": { "type": "string", "description": "HTTP cache directory; use off to disable.", "x-descriptionZh": "HTTP 缓存目录;off 表示关闭。" }, "cacheMaxBytes": { "type": "number", "minimum": 0, "description": "Maximum HTTP cache size in bytes.", "x-descriptionZh": "HTTP 缓存最大字节数。" }, "userAgent": { "type": "string", "description": "Custom user agent string.", "x-descriptionZh": "自定义 User-Agent。" }, "idleTimeoutMs": { "type": "number", "minimum": 0, "maximum": 86400000, "description": "Daemon idle-exit timeout in milliseconds.", "x-descriptionZh": "daemon 空闲退出超时(毫秒)。" }, "logStats": { "type": "boolean", "description": "Log render timing statistics.", "x-descriptionZh": "记录渲染耗时统计。" }, "mode": { "type": "string", "enum": [ "inprocess", "daemon" ], "description": "Whether Shotium runs in-process or as a daemon.", "x-descriptionZh": "Shotium 在进程内运行还是以 daemon 运行。" } } }, "assistant": { "type": "object", "additionalProperties": true, "description": "Scheduled jobs, event ingress, and failure notifications.", "x-descriptionZh": "调度任务、事件入口和失败通知。", "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "启用统一 JobStore(默认 false,Stable 行为不变)" }, "defaults": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "notify": { "anyOf": [ { "type": "object", "additionalProperties": true, "properties": { "channel": { "anyOf": [ { "const": "im" }, { "type": "string", "pattern": "^\\$\\{[A-Za-z_][A-Za-z0-9_]*(?::[-=][^}]*)?\\}$" } ] }, "target": { "type": "object", "additionalProperties": true, "properties": { "channel": { "anyOf": [ { "const": "im" }, { "type": "string", "pattern": "^\\$\\{[A-Za-z_][A-Za-z0-9_]*(?::[-=][^}]*)?\\}$" } ] }, "scene": { "type": "object", "additionalProperties": true, "properties": { "platform": { "type": "string" }, "endpointKey": { "type": "string" }, "sceneId": { "type": "string" }, "kind": { "type": "string", "x-zhin-config": { "options": [ { "label": "private", "value": "private" }, { "label": "group", "value": "group" }, { "label": "channel", "value": "channel" } ] } }, "senderId": { "type": "string" }, "parent": { "type": "object", "additionalProperties": true, "properties": { "kind": { "type": "string", "x-zhin-config": { "options": [ { "label": "group", "value": "group" }, { "label": "guild", "value": "guild" } ] } }, "sceneId": { "type": "string" } } } } }, "threadId": { "type": "string" }, "quoteId": { "type": "string" } } } } }, { "type": "object", "additionalProperties": true, "properties": { "channel": { "anyOf": [ { "const": "silent" }, { "type": "string", "pattern": "^\\$\\{[A-Za-z_][A-Za-z0-9_]*(?::[-=][^}]*)?\\}$" } ] } } }, { "type": "object", "additionalProperties": true, "properties": { "channel": { "anyOf": [ { "const": "log" }, { "type": "string", "pattern": "^\\$\\{[A-Za-z_][A-Za-z0-9_]*(?::[-=][^}]*)?\\}$" } ] } } }, { "type": "object", "additionalProperties": true, "properties": { "channel": { "anyOf": [ { "const": "ha" }, { "type": "string", "pattern": "^\\$\\{[A-Za-z_][A-Za-z0-9_]*(?::[-=][^}]*)?\\}$" } ] }, "service": { "type": "string" }, "target": { "type": "string" }, "data": { "type": "object", "additionalProperties": { "description": "任意 JSON 值;由对应服务解释。" } } } }, { "type": "null" } ], "description": "未显式指定 notify 时的默认投递目标(M3)" }, "notifyOnFailure": { "type": [ "boolean", "string" ], "description": "Job 失败时是否通知(默认 false)" } } }, "profile": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "启用 Profile 覆盖 Bootstrap(默认 false)" }, "file": { "type": [ "string", "null" ], "description": "相对项目根路径,默认 assistant.profile.yml" } } }, "home": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ] }, "restUrl": { "type": "string", "description": "HA REST 基址,如 http://homeassistant.local:8123" }, "restToken": { "type": "string", "description": "HA 长期访问令牌", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "mcpServer": { "type": "string", "description": "可选:ai.mcpServers 中的名称(REST 为主,MCP 仅校验)" }, "aliases": { "type": [ "object", "null" ], "additionalProperties": { "type": "string" }, "description": "中文/友好名 → entity_id" }, "policy": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "requireMaster": { "type": [ "boolean", "string" ], "description": "仅 master 可调用 home_*(默认 true)" }, "confirmServices": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "写操作需 Owner 审批的 HA domain(默认 lock、alarm_control_panel)" }, "allowedServiceDomains": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "home_call_service 允许的 domain 白名单(默认 light/climate/scene/cover/script)" } }, "x-zhin-config": { "security": true } }, "watch": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "要通过 HA WebSocket 订阅状态变化的设备别名列表" }, "debounceMs": { "type": [ "number", "string", "null" ], "description": "同实体状态变化推送的防抖间隔(毫秒,默认 5000)" } } }, "events": { "type": [ "object", "null" ], "additionalProperties": true, "properties": { "enabled": { "type": [ "boolean", "string" ], "description": "启用 POST /api/assistant/events(需 assistant.enabled)" }, "token": { "type": "string", "description": "可选专用 Bearer;未设时复用 http.token(路由仍在 /api 下受全局鉴权保护)。", "writeOnly": true, "x-zhin-secret": true, "x-zhin-config": { "secret": true } }, "allowedSources": { "type": "array", "items": { "type": "string" }, "description": "允许的来源白名单;空数组表示不限制" }, "rateLimitPerMinute": { "type": [ "number", "string", "null" ], "description": "每来源每分钟最大请求数(默认 60)" } } } } }, "log_level": { "type": [ "string", "number" ], "description": "Runtime log level.", "x-descriptionZh": "Runtime 日志级别。" }, "plugin": { "type": "object", "description": "Root Plugin configuration; replaced by its project schema during composition.", "x-descriptionZh": "Root Plugin 配置;组合时由项目 Schema 替换。" }, "locale": { "type": "string", "enum": [ "zh-CN", "en" ], "title": "项目语言", "description": "未设置个人偏好时使用的语言;未配置时使用简体中文,语言与时区独立。", "x-i18n": { "en": { "title": "Project language", "description": "Language used when no personal preference is set; Simplified Chinese when omitted. Language and time zone are independent.", "enumLabels": [ "Simplified Chinese", "English" ] } } }, "features": { "type": "object", "additionalProperties": false, "description": "Feature configuration beyond the plugin blocks (ADR 0055): in-chat self-service. Restart to apply.", "x-descriptionZh": "插件配置块之外的功能配置(ADR 0055):群内自助。修改后需重启。", "properties": { "selfService": { "type": "object", "additionalProperties": false, "description": "In-chat `feature` / `功能` and `role` / `角色` commands for chat role admins (ADR 0055 / 0056). Off by default. Platform group owners / admins are not zhin roles: grant them admin explicitly.", "x-descriptionZh": "聊天角色 admin 在聊天中使用的 `功能` / `feature` 与 `角色` / `role` 命令(ADR 0055 / 0056),默认关闭。平台群主 / 管理员不是 zhin 角色,需要显式授予 admin。", "properties": { "enabled": { "type": "boolean", "default": false, "description": "Register the in-chat feature and role commands.", "x-descriptionZh": "注册群内功能自助与角色命令。" } } } } } }, "$defs": {} }