evolcore 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +813 -0
- package/LICENSE +21 -0
- package/MIGRATION-0.5.0.md +378 -0
- package/README.md +318 -14
- package/ROLE_ACCESS_CONTROL.md +174 -0
- package/assets/.env.template +4 -0
- package/assets/brand/evolcore/README.md +19 -0
- package/assets/brand/evolcore/evolcore-app-icon.png +0 -0
- package/assets/brand/evolcore/evolcore-app-icon.svg +13 -0
- package/assets/brand/evolcore/evolcore-brand-board.png +0 -0
- package/assets/brand/evolcore/evolcore-brand-board.svg +126 -0
- package/assets/brand/evolcore/evolcore-logo-kit.zip +0 -0
- package/assets/brand/evolcore/evolcore-logo-reverse.png +0 -0
- package/assets/brand/evolcore/evolcore-logo-reverse.svg +14 -0
- package/assets/brand/evolcore/evolcore-logo.png +0 -0
- package/assets/brand/evolcore/evolcore-logo.svg +14 -0
- package/assets/brand/evolcore/evolcore-mark.png +0 -0
- package/assets/brand/evolcore/evolcore-mark.svg +10 -0
- package/bin/ec-safe-output.js +161 -0
- package/bin/ec.js +29 -0
- package/dist/agents/baseagent.js +163 -0
- package/dist/agents/claude-runner.js +2385 -0
- package/dist/agents/codex-app-server-client.js +448 -0
- package/dist/agents/codex-runner.js +2639 -0
- package/dist/agents/gemini-runner.js +666 -0
- package/dist/agents/runner-types.js +75 -0
- package/dist/aun/aid/agentmd.js +216 -0
- package/dist/aun/aid/client.js +132 -0
- package/dist/aun/aid/control-aid.js +91 -0
- package/dist/aun/aid/identity.js +518 -0
- package/dist/aun/aid/index.js +4 -0
- package/dist/aun/aid/store.js +74 -0
- package/dist/aun/aid/types.js +1 -0
- package/dist/aun/aid/validation.js +21 -0
- package/dist/aun/group-identity.js +10 -0
- package/dist/aun/msg/group-index.js +6 -0
- package/dist/aun/msg/group.js +1231 -0
- package/dist/aun/msg/history.js +123 -0
- package/dist/aun/msg/index.js +5 -0
- package/dist/aun/msg/p2p.js +393 -0
- package/dist/aun/msg/payload-type.js +27 -0
- package/dist/aun/msg/upload.js +137 -0
- package/dist/aun/outbox.js +160 -0
- package/dist/aun/rpc/caller.js +42 -0
- package/dist/aun/rpc/connection.js +25 -0
- package/dist/aun/rpc/index.js +2 -0
- package/dist/aun/service-proxy.js +225 -0
- package/dist/aun/storage/download.js +29 -0
- package/dist/aun/storage/index.js +3 -0
- package/dist/aun/storage/manage.js +10 -0
- package/dist/aun/storage/upload.js +68 -0
- package/dist/channels/aun.js +4147 -0
- package/dist/channels/daemon.js +422 -0
- package/dist/channels/dingtalk.js +649 -0
- package/dist/channels/feishu.js +1789 -0
- package/dist/channels/qqbot.js +409 -0
- package/dist/channels/wechat.js +817 -0
- package/dist/channels/wecom.js +565 -0
- package/dist/cli/agent-command.js +641 -0
- package/dist/cli/agent.js +1059 -0
- package/dist/cli/aun-commands.js +1948 -0
- package/dist/cli/bench.js +1228 -0
- package/dist/cli/cli-argv.js +66 -0
- package/dist/cli/code-stats.js +329 -0
- package/dist/cli/command-log.js +82 -0
- package/dist/cli/config-selector.js +69 -0
- package/dist/cli/config.js +261 -0
- package/dist/cli/ctl-command.js +62 -0
- package/dist/cli/daemon-commands.js +2887 -0
- package/dist/cli/fs-command.js +1447 -0
- package/dist/cli/handoff-command.js +302 -0
- package/dist/cli/help.js +31 -0
- package/dist/cli/index.js +358 -0
- package/dist/cli/init-channel.js +1377 -0
- package/dist/cli/init.js +553 -0
- package/dist/cli/link-rules.js +240 -0
- package/dist/cli/model.js +590 -0
- package/dist/cli/net-check.js +723 -0
- package/dist/cli/queue-command.js +126 -0
- package/dist/cli/response.js +345 -0
- package/dist/cli/restart-monitor.js +456 -0
- package/dist/cli/stats.js +607 -0
- package/dist/cli/task-context.js +80 -0
- package/dist/cli/trigger-command.js +505 -0
- package/dist/cli/version.js +88 -0
- package/dist/cli/watch-logs.js +33 -0
- package/dist/cli/watch-msg.js +673 -0
- package/dist/config/boot-log.js +266 -0
- package/dist/config/builtin-role-templates.js +30 -0
- package/dist/config/builtin-roles.js +85 -0
- package/dist/config/config-batch-get.js +11 -0
- package/dist/config/config-field-policy.js +261 -0
- package/dist/config/config-manager.js +916 -0
- package/dist/config/config-operation-service.js +384 -0
- package/dist/config/contact-book.js +371 -0
- package/dist/config/gateway-config.js +858 -0
- package/dist/config/lifecycle.js +17 -0
- package/dist/config/mention-mode.js +27 -0
- package/dist/config/merge.js +161 -0
- package/dist/config/owner-policy.js +4 -0
- package/dist/config/peer-role-resolver.js +139 -0
- package/dist/config/resolved-config-op.js +483 -0
- package/dist/config/role-config-v4-startup.js +32 -0
- package/dist/config/role-config-v5-startup.js +27 -0
- package/dist/config/role-schema.js +105 -0
- package/dist/config/role-service.js +159 -0
- package/dist/config/role-store.js +204 -0
- package/dist/config/roles.js +55 -0
- package/dist/config/schema-registry.js +154 -0
- package/dist/config/snapshot.js +598 -0
- package/dist/config-store.js +503 -0
- package/dist/core/auth/agent-delegation.js +111 -0
- package/dist/core/auth/auth-gateway.js +166 -0
- package/dist/core/auth/authenticated-actor.js +6 -0
- package/dist/core/auth/authorization-audit.js +110 -0
- package/dist/core/auth/operation-authorizer.js +718 -0
- package/dist/core/auth/operation-catalog.js +675 -0
- package/dist/core/baseagent-loader.js +54 -0
- package/dist/core/bootstrap-service.js +175 -0
- package/dist/core/capability/capability-manager.js +316 -0
- package/dist/core/capability/providers/claude-capability-provider.js +176 -0
- package/dist/core/capability/providers/codex-capability-provider.js +148 -0
- package/dist/core/capability/providers/gemini-capability-provider.js +10 -0
- package/dist/core/capability/types.js +27 -0
- package/dist/core/causation/audit.js +103 -0
- package/dist/core/causation/aun-association.js +111 -0
- package/dist/core/causation/context.js +93 -0
- package/dist/core/causation/index.js +4 -0
- package/dist/core/causation/types.js +2 -0
- package/dist/core/channel-loader.js +277 -0
- package/dist/core/command/agent-control.js +616 -0
- package/dist/core/command/cli-intent-parser.js +225 -0
- package/dist/core/command/command-handler.js +1638 -0
- package/dist/core/command/menu-handler.js +3354 -0
- package/dist/core/command/menu-protocol.js +247 -0
- package/dist/core/command/role-menu.js +1524 -0
- package/dist/core/command/slash-gate.js +148 -0
- package/dist/core/command/slash-handler.js +3056 -0
- package/dist/core/daemon-file-cache.js +216 -0
- package/dist/core/event-bus.js +32 -0
- package/dist/core/event-catalog.js +740 -0
- package/dist/core/evolagent-registry.js +546 -0
- package/dist/core/evolagent.js +331 -0
- package/dist/core/handoff/dispatcher.js +229 -0
- package/dist/core/handoff/mutex.js +46 -0
- package/dist/core/handoff/runtime.js +324 -0
- package/dist/core/handoff/store.js +537 -0
- package/dist/core/handoff/types.js +12 -0
- package/dist/core/inference/text-inference.js +173 -0
- package/dist/core/interaction-registration.js +10 -0
- package/dist/core/interaction-router.js +278 -0
- package/dist/core/message/create-status.js +67 -0
- package/dist/core/message/im-renderer.js +657 -0
- package/dist/core/message/items-formatter.js +76 -0
- package/dist/core/message/logical-queue-bridge.js +123 -0
- package/dist/core/message/message-bridge.js +803 -0
- package/dist/core/message/message-cache.js +56 -0
- package/dist/core/message/message-log.js +339 -0
- package/dist/core/message/message-processor.js +4 -0
- package/dist/core/message/message-queue.js +1436 -0
- package/dist/core/message/message-utils.js +70 -0
- package/dist/core/message/peer-mode.js +105 -0
- package/dist/core/message/pending-hints.js +232 -0
- package/dist/core/message/response-depth.js +33 -0
- package/dist/core/message/response-engine.js +3776 -0
- package/dist/core/message/response-snapshot.js +83 -0
- package/dist/core/message/stream-debouncer.js +130 -0
- package/dist/core/message/stream-idle-monitor.js +124 -0
- package/dist/core/model/config-scope.js +162 -0
- package/dist/core/model/field-scope.js +78 -0
- package/dist/core/model/model-catalog.js +227 -0
- package/dist/core/model/model-diagnostics.js +182 -0
- package/dist/core/model/model-permission.js +90 -0
- package/dist/core/permission/approval-gateway.js +1017 -0
- package/dist/core/permission/ec-command-parser.js +347 -0
- package/dist/core/permission/execution-sandbox.js +16 -0
- package/dist/core/permission/index.js +6 -0
- package/dist/core/permission/mode.js +24 -0
- package/dist/core/permission/sandbox-runtime.js +265 -0
- package/dist/core/permission/tool-policy.js +987 -0
- package/dist/core/permission/unix-socket-policy.js +99 -0
- package/dist/core/protected-paths.js +330 -0
- package/dist/core/relation/peer-identity.js +222 -0
- package/dist/core/relation/peer-key.js +1 -0
- package/dist/core/role/runtime-policy.js +141 -0
- package/dist/core/session/adapters/claude-session-file-adapter.js +218 -0
- package/dist/core/session/adapters/codex-session-file-adapter.js +333 -0
- package/dist/core/session/adapters/gemini-session-file-adapter.js +181 -0
- package/dist/core/session/session-file-adapter.js +7 -0
- package/dist/core/session/session-file-health.js +45 -0
- package/dist/core/session/session-fs-store.js +232 -0
- package/dist/core/session/session-key.js +24 -0
- package/dist/core/session/session-manager.js +1587 -0
- package/dist/core/session/session-mapper.js +100 -0
- package/dist/core/session/session-renew.js +314 -0
- package/dist/core/session/session-title.js +128 -0
- package/dist/core/session/session-turn-coordinator.js +205 -0
- package/dist/core/session/session-turns.js +67 -0
- package/dist/core/system-channels.js +29 -0
- package/dist/eck/baseagent-caps.js +18 -0
- package/dist/eck/detect.js +47 -0
- package/dist/eck/group-rules-sync.js +345 -0
- package/dist/eck/init.js +77 -0
- package/dist/eck/kit-renderer.js +359 -0
- package/dist/eck/manifest-engine.js +446 -0
- package/dist/eck/message-renderer.js +199 -0
- package/dist/eck/rules-loader.js +28 -0
- package/dist/index.js +2870 -4
- package/dist/ipc.js +748 -0
- package/dist/paths.js +262 -0
- package/dist/product.js +18 -0
- package/dist/response-system/context-builder.js +71 -0
- package/dist/response-system/coordinator.js +117 -0
- package/dist/response-system/decision-executor.js +86 -0
- package/dist/response-system/engines/v1/index.js +21 -0
- package/dist/response-system/engines/v1/interactive-flow.js +27 -0
- package/dist/response-system/engines/v1/proactive-flow.js +137 -0
- package/dist/response-system/engines/v1/types.js +1 -0
- package/dist/response-system/extensions.js +41 -0
- package/dist/response-system/index.js +6 -0
- package/dist/response-system/modes/index.js +7 -0
- package/dist/response-system/modes/single-session/index.js +72 -0
- package/dist/response-system/queues/fifo-queue.js +44 -0
- package/dist/response-system/queues/index.js +6 -0
- package/dist/response-system/queues/lifo-queue.js +42 -0
- package/dist/response-system/queues/priority-queue.js +63 -0
- package/dist/response-system/registry.js +97 -0
- package/dist/response-system/resolver.js +37 -0
- package/dist/response-system/selector.js +23 -0
- package/dist/response-system/types.js +7 -0
- package/dist/stats/billing.js +151 -0
- package/dist/stats/budget.js +93 -0
- package/dist/stats/db.js +403 -0
- package/dist/stats/eck-vars.js +89 -0
- package/dist/stats/index.js +11 -0
- package/dist/stats/normalizer.js +80 -0
- package/dist/stats/price-resolver.js +138 -0
- package/dist/stats/query.js +763 -0
- package/dist/stats/role-budget.js +168 -0
- package/dist/stats/writer.js +151 -0
- package/dist/trigger/anomaly-store.js +258 -0
- package/dist/trigger/audit.js +152 -0
- package/dist/trigger/event-source.js +119 -0
- package/dist/trigger/feedback.js +685 -0
- package/dist/trigger/history.js +290 -0
- package/dist/trigger/manager.js +291 -0
- package/dist/trigger/parser.js +520 -0
- package/dist/trigger/patch.js +148 -0
- package/dist/trigger/scheduler.js +1600 -0
- package/dist/trigger/script-executor.js +155 -0
- package/dist/trigger/state.js +145 -0
- package/dist/trigger/types.js +1 -0
- package/dist/trigger/validation.js +621 -0
- package/dist/types.js +12 -0
- package/dist/utils/aid-bind.js +299 -0
- package/dist/utils/atomic-write.js +95 -0
- package/dist/utils/avatar-upload.js +123 -0
- package/dist/utils/cross-platform.js +297 -0
- package/dist/utils/ecweb-utils.js +73 -0
- package/dist/utils/error-dict.json +153 -0
- package/dist/utils/error-utils.js +349 -0
- package/dist/utils/instance-registry.js +437 -0
- package/dist/utils/locale.js +21 -0
- package/dist/utils/log-writer.js +224 -0
- package/dist/utils/logger.js +89 -0
- package/dist/utils/markdown-to-plain-text.js +20 -0
- package/dist/utils/media-cache.js +271 -0
- package/dist/utils/model-prices.jsonl +17 -0
- package/dist/utils/npm-ops.js +210 -0
- package/dist/utils/process-introspect.js +133 -0
- package/dist/utils/process-tree-stats.js +271 -0
- package/dist/utils/project-path.js +74 -0
- package/dist/utils/stats.js +410 -0
- package/dist/utils/tool-summary.js +284 -0
- package/dist/utils/welcome.js +268 -0
- package/kits/docs/GUIDE.md +20 -0
- package/kits/docs/INDEX.md +65 -0
- package/kits/docs/aun/CHEATSHEET.md +19 -0
- package/kits/docs/aun/SYNC_PROTOCOL.md +15 -0
- package/kits/docs/channels/aun.md +65 -0
- package/kits/docs/channels/feishu.md +56 -0
- package/kits/docs/context-assembly.md +366 -0
- package/kits/docs/eck_templates/GUIDE.template.md +22 -0
- package/kits/docs/eck_templates/INDEX.template.md +28 -0
- package/kits/docs/eck_templates/path-registry.template.md +33 -0
- package/kits/docs/eck_templates/runtime.template.md +19 -0
- package/kits/docs/evolcore/INDEX.md +66 -0
- package/kits/docs/evolcore/agent.md +69 -0
- package/kits/docs/evolcore/aid.md +49 -0
- package/kits/docs/evolcore/config.md +149 -0
- package/kits/docs/evolcore/ctl.md +46 -0
- package/kits/docs/evolcore/event.md +216 -0
- package/kits/docs/evolcore/fs-architecture.md +1215 -0
- package/kits/docs/evolcore/fs.md +101 -0
- package/kits/docs/evolcore/group-fs.md +17 -0
- package/kits/docs/evolcore/group-rules.md +226 -0
- package/kits/docs/evolcore/group.md +141 -0
- package/kits/docs/evolcore/model.md +47 -0
- package/kits/docs/evolcore/msg.md +130 -0
- package/kits/docs/evolcore/response.md +80 -0
- package/kits/docs/evolcore/rpc.md +35 -0
- package/kits/docs/evolcore/self-summary.md +29 -0
- package/kits/docs/evolcore/stats.md +70 -0
- package/kits/docs/evolcore/storage.md +49 -0
- package/kits/docs/evolcore/trigger.md +524 -0
- package/kits/docs/identity/AID_PROFILE_SPEC.md +26 -0
- package/kits/docs/identity/PATH_OPS.md +16 -0
- package/kits/docs/identity/ROLE_DETAIL.md +23 -0
- package/kits/docs/identity/identity-tools.md +26 -0
- package/kits/docs/path-registry.md +43 -0
- package/kits/docs/prompt-loading-architecture.md +266 -0
- package/kits/docs/venues/aun-group.md +45 -0
- package/kits/docs/venues/aun-private.md +10 -0
- package/kits/docs/venues/client-desktop.md +10 -0
- package/kits/docs/venues/client-mobile.md +10 -0
- package/kits/docs/venues/feishu-group.md +13 -0
- package/kits/docs/venues/feishu-private.md +9 -0
- package/kits/docs/venues/group.md +25 -0
- package/kits/docs/venues/private.md +10 -0
- package/kits/eck_manifest.auxiliary.json +43 -0
- package/kits/eck_manifest.json +191 -0
- package/kits/eck_message_manifest.json +63 -0
- package/kits/migrations/README-role-config-v4.md +32 -0
- package/kits/migrations/migrate-role-config-v4.mjs +623 -0
- package/kits/migrations/migrate-role-config-v5.mjs +346 -0
- package/kits/migrations/rename-config-file.mjs +99 -0
- package/kits/rules/01-overview.md +142 -0
- package/kits/rules/02-navigation.md +76 -0
- package/kits/rules/03-identity.md +34 -0
- package/kits/rules/04-relation.md +59 -0
- package/kits/rules/05-venue.md +44 -0
- package/kits/rules/06-channel.md +59 -0
- package/kits/schemas/_meta.json +29 -0
- package/kits/schemas/agent-config.schema.1.json +177 -0
- package/kits/schemas/agent-config.schema.2.json +239 -0
- package/kits/schemas/agent-config.schema.3.json +119 -0
- package/kits/schemas/agent-config.schema.4.json +208 -0
- package/kits/schemas/agent-config.schema.5.json +326 -0
- package/kits/schemas/contact-book.schema.1.json +36 -0
- package/kits/schemas/daemon.schema.1.json +90 -0
- package/kits/schemas/defaults.schema.1.json +81 -0
- package/kits/schemas/menu-exec-schema-commands.md +208 -0
- package/kits/schemas/migrations/README.md +28 -0
- package/kits/schemas/relation-config.schema.1.json +158 -0
- package/kits/schemas/relation-config.schema.2.json +73 -0
- package/kits/schemas/relation-config.schema.3.json +50 -0
- package/kits/schemas/relation-config.schema.4.json +47 -0
- package/kits/schemas/role-config.schema.1.json +200 -0
- package/kits/schemas/role-registry.schema.1.json +35 -0
- package/kits/schemas/single-session.schema.1.json +31 -0
- package/kits/templates/bootstrap-welcome.md +15 -0
- package/kits/templates/message-fragments/handoff-request-to-target.md +13 -0
- package/kits/templates/message-fragments/handoff-response-to-origin.md +10 -0
- package/kits/templates/message-fragments/inject-default.md +2 -0
- package/kits/templates/message-fragments/item.md +2 -0
- package/kits/templates/roles/admin.json +8 -0
- package/kits/templates/roles/member.json +40 -0
- package/kits/templates/roles/owner.json +8 -0
- package/kits/templates/roles/visitor.json +39 -0
- package/kits/templates/system-fragments/baseagent.md +14 -0
- package/kits/templates/system-fragments/bootstrap.md +16 -0
- package/kits/templates/system-fragments/channel.md +48 -0
- package/kits/templates/system-fragments/commands.md +26 -0
- package/kits/templates/system-fragments/identity.md +11 -0
- package/kits/templates/system-fragments/relation.md +19 -0
- package/kits/templates/system-fragments/session.md +53 -0
- package/kits/templates/system-fragments/venue.md +31 -0
- package/package.json +50 -15
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# 通过 menu action exec 获取 Schema 的命令手册
|
|
2
|
+
|
|
3
|
+
> 面向前端(App / Web / Bot)通过 `menu.action name=cli action=exec` 远程执行 CLI,取回配置 schema 的**版本**与**内容**。
|
|
4
|
+
> 传输层、`menu.response` 配对、错误处理等通用机制见 [menu-protocol-cli-exec-frontend.md](./menu-protocol-cli-exec-frontend.md)。
|
|
5
|
+
|
|
6
|
+
对应代码:`src/cli/config.ts` · `src/config/config-operation-service.ts`(`executeSchema`)· `src/config/schema-registry.ts`
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0. 请求信封(所有命令通用)
|
|
11
|
+
|
|
12
|
+
固定 `name: "cli"`、`action: "exec"`,命令通过 `args.argv` 数组传入(推荐,无注入风险):
|
|
13
|
+
|
|
14
|
+
```jsonc
|
|
15
|
+
{
|
|
16
|
+
"type": "menu.action",
|
|
17
|
+
"id": "<唯一请求 id>",
|
|
18
|
+
"name": "cli",
|
|
19
|
+
"action": "exec",
|
|
20
|
+
"args": { "argv": [ /* ...见下方各命令... */ ] }
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
响应通过 `menu.response.id` 配对:
|
|
25
|
+
|
|
26
|
+
- 成功(命令跑完):`data = { exitCode, stdout, stderr, truncated, durationMs }`
|
|
27
|
+
- `exitCode === 0` 才算命令成功;`--format json` 时对 `stdout` 直接 `JSON.parse`。
|
|
28
|
+
- 失败(透传层拒绝,命令没跑):`error = { code, message }`。
|
|
29
|
+
|
|
30
|
+
> 逻辑 schema 名(`<name>`):`daemon` / `defaults` / `agent-config` / `relation-config` / `contact-book` / `single-session`。各名对应哪份配置见 [§6 配置 ↔ Schema 对应表](#6-配置--schema-对应表)。
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 1. 获取版本
|
|
35
|
+
|
|
36
|
+
### 1.1 概览 —— 列出全部 schema 及各自当前版本
|
|
37
|
+
|
|
38
|
+
```jsonc
|
|
39
|
+
// args.argv
|
|
40
|
+
["config", "schema", "--format", "json"]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`stdout`(`JSON.parse` 后):
|
|
44
|
+
|
|
45
|
+
```jsonc
|
|
46
|
+
{
|
|
47
|
+
"ok": true,
|
|
48
|
+
"schemas": [
|
|
49
|
+
{ "name": "daemon", "current": 1 },
|
|
50
|
+
{ "name": "defaults", "current": 1 },
|
|
51
|
+
{ "name": "agent-config", "current": 3 },
|
|
52
|
+
{ "name": "relation-config", "current": 2 },
|
|
53
|
+
{ "name": "contact-book", "current": 1 },
|
|
54
|
+
{ "name": "single-session", "current": 1 }
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 1.2 某个 schema 的全部磁盘版本(含当前标记 + 元信息)
|
|
60
|
+
|
|
61
|
+
```jsonc
|
|
62
|
+
// args.argv —— 用 --list
|
|
63
|
+
["config", "schema", "agent-config", "--list", "--format", "json"]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`stdout`:
|
|
67
|
+
|
|
68
|
+
```jsonc
|
|
69
|
+
{
|
|
70
|
+
"ok": true,
|
|
71
|
+
"name": "agent-config",
|
|
72
|
+
"current": 3, // 当前版本号
|
|
73
|
+
"versions": [
|
|
74
|
+
{ "version": 1, "current": false, "date": "2026-06-14", "description": "..." },
|
|
75
|
+
{ "version": 2, "current": false, "date": "2026-06-23", "description": "..." },
|
|
76
|
+
{ "version": 3, "current": true, "date": "2026-07-08", "description": "..." }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
> `date` / `description` 来自 schema history 元信息,可能缺省。
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 2. 获取 Schema 内容
|
|
86
|
+
|
|
87
|
+
### 2.1 当前版本的完整定义(缺省版本号 = 当前版本)
|
|
88
|
+
|
|
89
|
+
```jsonc
|
|
90
|
+
// args.argv
|
|
91
|
+
["config", "schema", "agent-config", "--format", "json"]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 2.2 指定版本的完整定义
|
|
95
|
+
|
|
96
|
+
```jsonc
|
|
97
|
+
// args.argv —— 末尾追加版本号
|
|
98
|
+
["config", "schema", "agent-config", "3", "--format", "json"]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`stdout`(2.1 / 2.2 同结构):
|
|
102
|
+
|
|
103
|
+
```jsonc
|
|
104
|
+
{
|
|
105
|
+
"ok": true,
|
|
106
|
+
"name": "agent-config",
|
|
107
|
+
"version": 3,
|
|
108
|
+
"current": true, // 该版本是否为当前版本
|
|
109
|
+
"content": { /* 完整 schema JSON(字段/类型/枚举/默认/x-merge 等) */ }
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 3. 命令速查
|
|
116
|
+
|
|
117
|
+
| 目的 | `args.argv` |
|
|
118
|
+
|------|-------------|
|
|
119
|
+
| 列出全部 schema + 当前版本 | `["config","schema","--format","json"]` |
|
|
120
|
+
| 列出某 schema 的所有版本 | `["config","schema","<name>","--list","--format","json"]` |
|
|
121
|
+
| 查看某 schema 当前版本内容 | `["config","schema","<name>","--format","json"]` |
|
|
122
|
+
| 查看某 schema 指定版本内容 | `["config","schema","<name>","<version>","--format","json"]` |
|
|
123
|
+
|
|
124
|
+
三种输出模式由参数决定:
|
|
125
|
+
|
|
126
|
+
| 调用形式 | `mode` | 输出 |
|
|
127
|
+
|----------|--------|------|
|
|
128
|
+
| `schema` | `overview` | 全部 schema + 各自当前版本号 |
|
|
129
|
+
| `schema <name> --list` | `versions` | 该 schema 所有磁盘版本,`current` 标当前,附 `date`/`description` |
|
|
130
|
+
| `schema <name> [version]` | `content` | 指定版本(缺省=当前)的完整 schema JSON |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 4. 错误码
|
|
135
|
+
|
|
136
|
+
命令自身失败(`data.exitCode != 0`,`stdout` 为 `{ "ok": false, "code": "...", "error": "..." }`):
|
|
137
|
+
|
|
138
|
+
| `code` | 触发场景 |
|
|
139
|
+
|--------|----------|
|
|
140
|
+
| `UNKNOWN_SCHEMA` | 未知 schema 名(`error` 会列出已知名) |
|
|
141
|
+
| `SCHEMA_VERSION_NOT_FOUND` | 版本不存在(`error` 会列出可用版本) |
|
|
142
|
+
| `INVALID_CONFIG_COMMAND` | `--list` 与 version 参数同时给出 |
|
|
143
|
+
| `MISSING_ARG` | `--list` 或指定 version 却未带 `<name>` |
|
|
144
|
+
| `INVALID_CONFIG_VALUE` | version 非非负整数 |
|
|
145
|
+
|
|
146
|
+
透传层拒绝(`menu.response.error`,命令未执行):`NO_PERMISSION`(非 owner)、`NOT_ALLOWED`(命令不在白名单)、`MISSING_VALUE`、`NOT_SUPPORTED`(action 非 exec)、`TIMEOUT`(>15s)、`INTERNAL`。
|
|
147
|
+
|
|
148
|
+
> `config schema` 为纯只读操作,数据源为 schema-registry(读 `_meta.json` + 扫描 `kits/schemas/*.schema.*.json`),人和 agent 均可执行。
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 6. 配置 ↔ Schema 对应表
|
|
153
|
+
|
|
154
|
+
每份配置文件由 `ConfigTarget` 路由到唯一的 schema(`src/config/config-manager.ts` 的 `TARGET_SCHEMA`)。查某份配置有哪些字段、类型/枚举/默认,就用 §2 拉对应 `<name>` 的内容。
|
|
155
|
+
|
|
156
|
+
| 配置层(scope) | ConfigTarget | 磁盘文件(相对 `$EVOLCORE_HOME`) | 逻辑 schema `<name>` | 当前版本 | 校验/说明 |
|
|
157
|
+
|---|---|---|---|---|---|
|
|
158
|
+
| 进程级 | `process` | `daemon.json` | `daemon` | 1 | 进程配置,启动时读取;改动需重启 daemon |
|
|
159
|
+
| 全局默认 | `defaults` | `agents/defaults.json` | `defaults` | 1 | 覆盖链最底层(`models.allowed` / `projects` / `aun` 等) |
|
|
160
|
+
| Agent 级 | `agent` | `agents/{aid}/config.json` | `agent-config` | 3 | 单 agent 全量参数;含 user role policy |
|
|
161
|
+
| 关系级 | `relation` | `agents/{aid}/relations/{peerKey}/config.json` | `relation-config` | 2 | 覆盖链最高优先;含 user/group role 分配 |
|
|
162
|
+
| 联系人簿 | `contact` | `agents/{aid}/contact.json` | `contact-book` | 1 | 跨渠道身份映射的联系人别名 |
|
|
163
|
+
|
|
164
|
+
**覆盖链优先级**(低 → 高,逐字段合并):`defaults` → `agent` → `relation`。
|
|
165
|
+
|
|
166
|
+
### 响应模式桶 schema —— `single-session`
|
|
167
|
+
|
|
168
|
+
`single-session` 是**特殊 schema**:它不绑定任何独立配置文件,而是描述 `agent-config` / `relation-config` 里 `responseModeParams["single-session"]` 这个**桶**的形状(schema 根标记 `x-scope: "mode"`,区别于绑文件的 `process`/`agent`/`relation` 等)。它是 interactive / proactive 两模式合并为 `single-session` 后的模式特有参数容器。
|
|
169
|
+
|
|
170
|
+
- 主 config schema(`agent-config` / `relation-config`)把 `responseModeParams` 当黑箱 `{type: object}` 放行;
|
|
171
|
+
- 桶内部由「模式桶 schema」逐桶校验:桶键必须是已在 `_meta.json` 登记的响应模式名(如 `single-session`),校验逻辑见 `config-manager.ts` 的 `validateResponseModeParams`。
|
|
172
|
+
- 想看某响应模式桶能设哪些参数,就 `["config","schema","single-session","--format","json"]`。
|
|
173
|
+
|
|
174
|
+
**桶内参数**(`additionalProperties: false`,只允许下列键;均**仅 `chatmode=proactive` 时生效**):
|
|
175
|
+
|
|
176
|
+
| 字段 | 类型 | 默认 | 作用 |
|
|
177
|
+
|---|---|---|---|
|
|
178
|
+
| `pre_tool_1stmsgchk` | boolean | `true` | 首工具表态检查:首个工具调用前必须先向对端发消息/文件,否则拦截 |
|
|
179
|
+
| `tool_use_reminder` | boolean | `true` | 工具汇报提醒:启用队列未读提醒 + 每 10 次工具调用的汇报提醒 |
|
|
180
|
+
|
|
181
|
+
- schema 里的 `default` 即**运行时出厂默认**——宿主组装 `modeConfig` 时先铺这层默认(`coordinator.schemaDefaults`),再叠用户显式桶值;flow 层不再硬编码默认。
|
|
182
|
+
- `chatmode` 本身**不在此桶**:它由宿主按对端类型解析后强制注入 `modeConfig.chatmode`,与「选哪个模式」正交。
|
|
183
|
+
- 写入路径:`ec response set single-session ...` 或 `ec response config set <key> <value> --mode single-session --self <aid>`。经 menu exec 时把该 argv 传入即可。
|
|
184
|
+
|
|
185
|
+
> ⚠️ **存量迁移**:旧配置若把这两个键写在废弃的**顶层 `proactive` 块**下,读取时会被 `foldLegacyProactiveBlock` 就地折叠进 `responseModeParams["single-session"]` 桶(桶内已显式设的同名键优先,迁移值只补空缺),旧块随下次 write 从磁盘消失。未迁移的顶层旧键在运行时会**静默失效**——运行时只从桶里读。
|
|
186
|
+
|
|
187
|
+
> 每新增一个已实现的响应模式,就会多一份同名桶 schema。用 §1.1 概览命令看当前全部逻辑 schema。
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 5. 完整发送样例(AUN)
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
await client.call('message.send', {
|
|
195
|
+
to: targetAid,
|
|
196
|
+
payload: JSON.stringify({
|
|
197
|
+
type: 'menu.action',
|
|
198
|
+
id: 'c-schema-1',
|
|
199
|
+
name: 'cli',
|
|
200
|
+
action: 'exec',
|
|
201
|
+
args: { argv: ['config', 'schema', 'agent-config', '--format', 'json'] },
|
|
202
|
+
}),
|
|
203
|
+
encrypt: true,
|
|
204
|
+
});
|
|
205
|
+
// 响应在 onMessage 里按 parsed.id 配对:
|
|
206
|
+
// parsed.data.exitCode === 0 → JSON.parse(parsed.data.stdout).content
|
|
207
|
+
// parsed.error → 透传层拒绝
|
|
208
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Schema 版本迁移函数
|
|
2
|
+
|
|
3
|
+
每次某 schema 升版(`_meta.json` 里 currentVersion 上升)必须提供配套迁移函数。
|
|
4
|
+
|
|
5
|
+
## 命名
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
{schema}.{N}-to-{N+1}.ts
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
例:`agent-config.1-to-2.ts`。
|
|
12
|
+
|
|
13
|
+
## 契约(整文件 in/out)
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
export function migrate(old: object): object; // 旧版本完整 JSON → 新版本完整 JSON
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- 入参/返回都是**完整对象**——整体重写,不做字段级 patch。
|
|
20
|
+
- 迁移产物直接覆盖原文件(ConfigManager 在迁移前已建 schema-migration 快照保证可回滚),写回后更新 `$schema_version`。
|
|
21
|
+
- 多版本串联即函数复合:`v1→v3 = migrate_2to3(migrate_1to2(old))`,逐版本串联,不跨版本直跳。
|
|
22
|
+
|
|
23
|
+
## 要求
|
|
24
|
+
|
|
25
|
+
- 历史 schema 文件全部保留(`{逻辑名}.schema.{版本}.json`)。
|
|
26
|
+
- 每个迁移函数 default-export `migrate`,由 ConfigManager 动态 import。
|
|
27
|
+
|
|
28
|
+
当前所有 schema 均为 v1,无迁移函数。
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "relation-config.schema.1.json",
|
|
4
|
+
"title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
|
|
5
|
+
"description": "关系级配置——针对特定对端的个性化配置。覆盖链最高优先级。支持 29 个关系级参数。",
|
|
6
|
+
"x-logical-name": "relation-config",
|
|
7
|
+
"x-scope": "relation",
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"$schema_version": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"default": 1,
|
|
14
|
+
"description": "Schema 版本号",
|
|
15
|
+
"x-merge": "scalar"
|
|
16
|
+
},
|
|
17
|
+
"models": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"description": "模型配置覆盖",
|
|
20
|
+
"x-merge": "dict",
|
|
21
|
+
"properties": {
|
|
22
|
+
"default": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "默认模型(对不同用户可不同)"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"baseagents": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "各 base agent 的 model/effort 等配置",
|
|
31
|
+
"x-merge": "dict",
|
|
32
|
+
"properties": {
|
|
33
|
+
"claude": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"model": { "type": "string", "description": "Claude 模型" },
|
|
37
|
+
"effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "description": "Claude 推理强度" },
|
|
38
|
+
"agentProgressSummaries": { "type": "boolean", "description": "Agent 进度摘要" },
|
|
39
|
+
"excludeDynamicSections": { "type": "boolean", "description": "排除动态章节" }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"codex": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"model": { "type": "string", "description": "Codex 模型" },
|
|
46
|
+
"effort": { "type": "string", "description": "Codex 推理强度" },
|
|
47
|
+
"enableRequestUserInput": { "type": "boolean", "description": "启用用户输入请求" },
|
|
48
|
+
"approvalsReviewer": { "type": "string", "enum": ["user", "auto_review", "guardian_subagent"], "description": "审批审查者" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"gemini": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"properties": {
|
|
54
|
+
"model": { "type": "string", "description": "Gemini 模型" },
|
|
55
|
+
"mode": { "type": "string", "enum": ["cli", "sdk"], "description": "Gemini 模式" },
|
|
56
|
+
"useVertex": { "type": "boolean", "description": "是否使用 Vertex AI" }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"chatmode": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"description": "对话模式:interactive=直接输出即回复;proactive=须显式发送",
|
|
64
|
+
"x-merge": "dict",
|
|
65
|
+
"properties": {
|
|
66
|
+
"private": { "type": "string", "enum": ["interactive", "proactive"], "description": "私聊对话模式" },
|
|
67
|
+
"group": { "type": "string", "enum": ["interactive", "proactive"], "description": "群聊对话模式" },
|
|
68
|
+
"nothuman": { "type": "string", "enum": ["interactive", "proactive"], "description": "非人类对话模式" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"flush_delay": {
|
|
72
|
+
"type": "number",
|
|
73
|
+
"description": "消息 flush 间隔(秒),对不同用户可调整",
|
|
74
|
+
"x-merge": "scalar"
|
|
75
|
+
},
|
|
76
|
+
"debounce": {
|
|
77
|
+
"type": "number",
|
|
78
|
+
"description": "入站消息去抖间隔(秒)",
|
|
79
|
+
"x-merge": "scalar"
|
|
80
|
+
},
|
|
81
|
+
"dispatch": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"enum": ["mention", "broadcast"],
|
|
84
|
+
"description": "群聊分发策略",
|
|
85
|
+
"x-merge": "scalar"
|
|
86
|
+
},
|
|
87
|
+
"response_modes": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"description": "响应模式配置(关系级覆盖)。按第一层键合并",
|
|
90
|
+
"x-merge": "dict",
|
|
91
|
+
"properties": {
|
|
92
|
+
"default_private": { "type": "string", "description": "单聊默认响应模式 id" },
|
|
93
|
+
"default_group": { "type": "string", "description": "群聊默认响应模式 id" },
|
|
94
|
+
"configs": { "type": "object", "description": "各模式配置参数" },
|
|
95
|
+
"overrides": { "type": "object", "description": "按对端/群覆盖" }
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"show_activities": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": ["all", "text", "none"],
|
|
101
|
+
"description": "中间活动可见性(技术用户显示,普通用户隐藏)",
|
|
102
|
+
"x-merge": "scalar"
|
|
103
|
+
},
|
|
104
|
+
"enable_rich_content": {
|
|
105
|
+
"type": "boolean",
|
|
106
|
+
"description": "启用富内容渲染(对不同用户可定制)",
|
|
107
|
+
"x-merge": "scalar"
|
|
108
|
+
},
|
|
109
|
+
"proactive": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"description": "Proactive 模式细粒度策略",
|
|
112
|
+
"x-merge": "dict",
|
|
113
|
+
"properties": {
|
|
114
|
+
"pre_tool_1stmsgchk": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"description": "Proactive 下首次工具调用前必须先 send/file 表态"
|
|
117
|
+
},
|
|
118
|
+
"tool_use_reminder": {
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"description": "Proactive 下启用队列未读提醒和工具汇报提醒"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"render": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"description": "各渲染类型当前激活的 modeName",
|
|
127
|
+
"x-merge": "dict",
|
|
128
|
+
"properties": {
|
|
129
|
+
"private": { "type": "string", "description": "私聊渲染模式名称" },
|
|
130
|
+
"group": { "type": "string", "description": "群聊渲染模式名称" },
|
|
131
|
+
"inject": { "type": "string", "description": "注入渲染模式名称" }
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"permissionMode": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"enum": ["auto", "bypass", "readonly", "request", "edit", "plan", "noask"],
|
|
137
|
+
"description": "执行权限模式(对信任用户 bypass,对陌生用户 readonly)",
|
|
138
|
+
"x-merge": "scalar"
|
|
139
|
+
},
|
|
140
|
+
"roles": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"description": "角色级行为覆盖:role → { baseagents, permissionMode }",
|
|
143
|
+
"x-merge": "dict",
|
|
144
|
+
"additionalProperties": {
|
|
145
|
+
"type": "object",
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"properties": {
|
|
148
|
+
"baseagents": { "type": "object", "description": "角色级 baseagents 覆盖" },
|
|
149
|
+
"permissionMode": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"enum": ["auto", "bypass", "readonly", "request", "edit", "plan", "noask"],
|
|
152
|
+
"description": "角色级 permissionMode 覆盖"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "relation-config.schema.2.json",
|
|
4
|
+
"title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
|
|
5
|
+
"x-logical-name": "relation-config",
|
|
6
|
+
"x-scope": "relation",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": true,
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema_version": { "type": "number", "default": 2, "x-merge": "scalar" },
|
|
11
|
+
"active_baseagent": { "type": "string", "x-merge": "scalar" },
|
|
12
|
+
"models": { "type": "object", "x-merge": "dict" },
|
|
13
|
+
"baseagents": { "type": "object", "x-merge": "dict" },
|
|
14
|
+
"chatmode": { "type": "object", "x-merge": "dict", "properties": { "private": { "enum": ["interactive", "proactive"], "description": "人类私聊场景的投递方式", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "group": { "enum": ["interactive", "proactive"], "description": "群聊场景的投递方式", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } }, "nothuman": { "enum": ["interactive", "proactive"], "description": "非人类(agent)私聊场景的投递方式", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } } }, "additionalProperties": false, "description": "chatmode 场景覆盖表;关系级按键覆盖 agent 级。键封闭 private/group/nothuman,值枚举 interactive/proactive" },
|
|
15
|
+
"mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "x-merge": "scalar", "description": "@ 处理策略(顶层通用参数);关系级不带 default,缺省继承 agent 级/schema 出厂值", "x-enumDescriptions": { "disabled": "处理所有消息", "mention-only": "只处理被 @ 的消息,未 @ 作引用上下文" } },
|
|
16
|
+
"model": { "type": "string", "x-merge": "scalar", "description": "主会话模型(顶层通用参数);关系级覆盖 agent 级" },
|
|
17
|
+
"responseMode": { "type": "string", "x-merge": "scalar", "description": "响应模式 id(标量);关系级覆盖 agent 级" },
|
|
18
|
+
"responseModeParams": { "type": "object", "x-merge": "dict", "description": "响应模式特有参数字典,按模式 id 分桶" },
|
|
19
|
+
"flush_delay": { "type": "number", "x-merge": "scalar" },
|
|
20
|
+
"debounce": { "type": "number", "x-merge": "scalar" },
|
|
21
|
+
"show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar", "description": "中间输出展示范围(仅对 interactive 私聊有意义)", "x-enumDescriptions": { "all": "文本 + activity", "text": "仅文本", "none": "全部静默" } },
|
|
22
|
+
"enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
|
|
23
|
+
"session_renew": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"x-merge": "dict",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"description": "会话超时后的续接判定",
|
|
28
|
+
"properties": {
|
|
29
|
+
"enabled": { "type": "boolean", "description": "是否启用超时后的会话连续性判定" },
|
|
30
|
+
"after_hours": { "type": "number", "exclusiveMinimum": 0, "description": "距最后一条有效对话超过该小时数才触发判定" },
|
|
31
|
+
"effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "description": "续接判定的推理强度", "x-enumDescriptions": { "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
|
|
32
|
+
"fallback_action": { "type": "string", "enum": ["continue", "new"], "description": "无法判定时的兜底动作", "x-enumDescriptions": { "continue": "继续沿用当前会话", "new": "开启新会话" } }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"group_venue_sync": { "type": "object", "x-merge": "dict" },
|
|
36
|
+
"render": { "type": "object", "x-merge": "dict" },
|
|
37
|
+
"sessionManifests": { "type": "object", "x-merge": "dict" },
|
|
38
|
+
"permissionMode": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"enum": ["auto", "bypass", "readonly", "request", "edit", "plan", "noask"],
|
|
41
|
+
"x-merge": "scalar",
|
|
42
|
+
"description": "工具调用的审批策略",
|
|
43
|
+
"x-enumDescriptions": {
|
|
44
|
+
"auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝",
|
|
45
|
+
"bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批",
|
|
46
|
+
"readonly": "只读模式:明确只读工具自动执行,写入、普通 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权",
|
|
47
|
+
"request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批",
|
|
48
|
+
"edit": "历史值:运行时按 request 迁移",
|
|
49
|
+
"plan": "历史值:运行时按 readonly 迁移,并保留 Claude plan 工作流提示",
|
|
50
|
+
"noask": "历史值:运行时安全降级为 readonly"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"roles": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"x-merge": "dict",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"assigned": {
|
|
59
|
+
"type": ["string", "null"],
|
|
60
|
+
"pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$"
|
|
61
|
+
},
|
|
62
|
+
"members": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": {
|
|
65
|
+
"type": ["string", "null"],
|
|
66
|
+
"pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "relation-config.schema.3.json",
|
|
4
|
+
"title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
|
|
5
|
+
"x-logical-name": "relation-config",
|
|
6
|
+
"x-scope": "relation",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": true,
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema_version": { "type": "number", "default": 3, "x-merge": "scalar" },
|
|
11
|
+
"targetKind": { "type": "string", "enum": ["private", "group"], "x-merge": "scalar" },
|
|
12
|
+
"active_baseagent": { "type": "string", "x-merge": "scalar" },
|
|
13
|
+
"models": { "type": "object", "x-merge": "dict" },
|
|
14
|
+
"baseagents": { "type": "object", "x-merge": "dict" },
|
|
15
|
+
"chatmode": { "type": "object", "x-merge": "dict", "properties": { "private": { "enum": ["interactive", "proactive"] }, "group": { "enum": ["interactive", "proactive"] }, "nothuman": { "enum": ["interactive", "proactive"] } }, "additionalProperties": false },
|
|
16
|
+
"mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "x-merge": "scalar" },
|
|
17
|
+
"model": { "type": "string", "x-merge": "scalar" },
|
|
18
|
+
"responseMode": { "type": "string", "x-merge": "scalar" },
|
|
19
|
+
"responseModeParams": { "type": "object", "x-merge": "dict" },
|
|
20
|
+
"flush_delay": { "type": "number", "x-merge": "scalar" },
|
|
21
|
+
"debounce": { "type": "number", "x-merge": "scalar" },
|
|
22
|
+
"show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar" },
|
|
23
|
+
"enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
|
|
24
|
+
"session_renew": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"x-merge": "dict",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"properties": {
|
|
29
|
+
"enabled": { "type": "boolean" },
|
|
30
|
+
"after_hours": { "type": "number", "exclusiveMinimum": 0 },
|
|
31
|
+
"effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"] },
|
|
32
|
+
"fallback_action": { "type": "string", "enum": ["continue", "new"] }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"group_venue_sync": { "type": "object", "x-merge": "dict" },
|
|
36
|
+
"render": { "type": "object", "x-merge": "dict" },
|
|
37
|
+
"sessionManifests": { "type": "object", "x-merge": "dict" },
|
|
38
|
+
"permissionMode": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "x-merge": "scalar", "description": "工具调用权限模式;历史 edit/plan/noask 在运行时安全迁移" },
|
|
39
|
+
"roles": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"x-merge": "dict",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"properties": {
|
|
44
|
+
"assigned": { "type": ["string", "null"], "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$" },
|
|
45
|
+
"members": { "type": "object", "additionalProperties": { "type": ["string", "null"], "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$" } }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "relation-config.schema.4.json",
|
|
4
|
+
"title": "RelationConfig (agents/{aid}/relations/{peerKey}/config.json)",
|
|
5
|
+
"x-logical-name": "relation-config",
|
|
6
|
+
"x-scope": "relation",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": true,
|
|
9
|
+
"not": {
|
|
10
|
+
"anyOf": [
|
|
11
|
+
{ "required": ["permissionMode"] },
|
|
12
|
+
{ "required": ["roles"] }
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"properties": {
|
|
16
|
+
"$schema_version": { "type": "number", "default": 4, "x-merge": "scalar" },
|
|
17
|
+
"targetKind": { "type": "string", "enum": ["private", "group"], "x-merge": "scalar" },
|
|
18
|
+
"role": { "type": ["string", "null"], "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$", "x-merge": "scalar" },
|
|
19
|
+
"active_baseagent": { "type": "string", "x-merge": "scalar" },
|
|
20
|
+
"models": { "type": "object", "x-merge": "dict" },
|
|
21
|
+
"baseagents": { "type": "object", "x-merge": "dict" },
|
|
22
|
+
"chatmode": { "type": "object", "x-merge": "dict", "properties": { "private": { "enum": ["interactive", "proactive"] }, "group": { "enum": ["interactive", "proactive"] }, "nothuman": { "enum": ["interactive", "proactive"] } }, "additionalProperties": false },
|
|
23
|
+
"mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "x-merge": "scalar" },
|
|
24
|
+
"model": { "type": "string", "x-merge": "scalar" },
|
|
25
|
+
"responseMode": { "type": "string", "x-merge": "scalar" },
|
|
26
|
+
"responseModeParams": { "type": "object", "x-merge": "dict" },
|
|
27
|
+
"flush_delay": { "type": "number", "x-merge": "scalar" },
|
|
28
|
+
"debounce": { "type": "number", "x-merge": "scalar" },
|
|
29
|
+
"show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar" },
|
|
30
|
+
"enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
|
|
31
|
+
"session_renew": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"x-merge": "dict",
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"properties": {
|
|
36
|
+
"enabled": { "type": "boolean" },
|
|
37
|
+
"after_hours": { "type": "number", "exclusiveMinimum": 0 },
|
|
38
|
+
"effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"] },
|
|
39
|
+
"fallback_action": { "type": "string", "enum": ["continue", "new"] }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"group_venue_sync": { "type": "object", "x-merge": "dict" },
|
|
43
|
+
"render": { "type": "object", "x-merge": "dict" },
|
|
44
|
+
"sessionManifests": { "type": "object", "x-merge": "dict" },
|
|
45
|
+
"extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
|
|
46
|
+
}
|
|
47
|
+
}
|