evolcore 0.0.1 → 0.0.3
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 +64 -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/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 +2565 -0
- package/dist/agents/codex-app-server-client.js +448 -0
- package/dist/agents/codex-runner.js +2682 -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 +168 -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 +4164 -0
- package/dist/channels/contact-bind-code.js +134 -0
- package/dist/channels/daemon.js +422 -0
- package/dist/channels/dingtalk.js +1479 -0
- package/dist/channels/feishu.js +1865 -0
- package/dist/channels/qqbot.js +409 -0
- package/dist/channels/wechat.js +817 -0
- package/dist/channels/wecom-card.js +101 -0
- package/dist/channels/wecom-onboarding.js +82 -0
- package/dist/channels/wecom-state.js +191 -0
- package/dist/channels/wecom.js +1157 -0
- package/dist/cli/agent-command.js +642 -0
- package/dist/cli/agent.js +1059 -0
- package/dist/cli/aun-commands.js +2003 -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/contact.js +71 -0
- package/dist/cli/ctl-command.js +62 -0
- package/dist/cli/daemon-commands.js +2750 -0
- package/dist/cli/fs-command.js +1447 -0
- package/dist/cli/handoff-command.js +302 -0
- package/dist/cli/help.js +35 -0
- package/dist/cli/index.js +374 -0
- package/dist/cli/init-channel.js +1372 -0
- package/dist/cli/init.js +590 -0
- package/dist/cli/link-rules.js +240 -0
- package/dist/cli/model.js +591 -0
- package/dist/cli/net-check.js +723 -0
- package/dist/cli/queue-command.js +150 -0
- package/dist/cli/raw-key-input.js +25 -0
- package/dist/cli/response.js +344 -0
- package/dist/cli/restart-monitor.js +480 -0
- package/dist/cli/stats.js +609 -0
- package/dist/cli/task-context.js +80 -0
- package/dist/cli/trigger-command.js +545 -0
- package/dist/cli/version.js +93 -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 +42 -0
- package/dist/config/builtin-roles.js +91 -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 +1120 -0
- package/dist/config/config-operation-service.js +384 -0
- package/dist/config/contact-alias.js +68 -0
- package/dist/config/contact-book-store.js +454 -0
- package/dist/config/contact-book-v2-startup.js +35 -0
- package/dist/config/contact-book.js +224 -0
- package/dist/config/contact-operation-service.js +110 -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 +218 -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-ranks.js +18 -0
- package/dist/config/role-schema.js +105 -0
- package/dist/config/role-service.js +156 -0
- package/dist/config/role-store.js +215 -0
- package/dist/config/roles.js +64 -0
- package/dist/config/schema-registry.js +154 -0
- package/dist/config/snapshot.js +598 -0
- package/dist/config-store.js +501 -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 +119 -0
- package/dist/core/auth/operation-authorizer.js +720 -0
- package/dist/core/auth/operation-catalog.js +731 -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 +1733 -0
- package/dist/core/command/connect-menu.js +374 -0
- package/dist/core/command/menu-handler.js +3452 -0
- package/dist/core/command/menu-protocol.js +247 -0
- package/dist/core/command/role-menu.js +1623 -0
- package/dist/core/command/slash-gate.js +148 -0
- package/dist/core/command/slash-handler.js +3066 -0
- package/dist/core/daemon-file-cache.js +222 -0
- package/dist/core/event-bus.js +32 -0
- package/dist/core/event-catalog.js +810 -0
- package/dist/core/evolagent-registry.js +545 -0
- package/dist/core/evolagent.js +342 -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 +659 -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 +874 -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 +1446 -0
- package/dist/core/message/message-utils.js +76 -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 +4020 -0
- package/dist/core/message/response-snapshot.js +83 -0
- package/dist/core/message/send-receipt.js +24 -0
- package/dist/core/message/stream-debouncer.js +139 -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 +1019 -0
- package/dist/core/permission/unix-socket-policy.js +99 -0
- package/dist/core/protected-paths.js +332 -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 +273 -0
- package/dist/core/session/session-key.js +24 -0
- package/dist/core/session/session-manager.js +1643 -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 +2926 -4
- package/dist/ipc.js +777 -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 +163 -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 +294 -0
- package/dist/trigger/parser.js +595 -0
- package/dist/trigger/patch.js +155 -0
- package/dist/trigger/scheduler.js +1602 -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 +634 -0
- package/dist/types.js +12 -0
- package/dist/utils/aid-bind.js +313 -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 +444 -0
- package/dist/utils/locale.js +21 -0
- package/dist/utils/log-writer.js +270 -0
- package/dist/utils/logger.js +89 -0
- package/dist/utils/markdown-to-plain-text.js +20 -0
- package/dist/utils/media-cache.js +274 -0
- package/dist/utils/model-prices.jsonl +20 -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/restart-safety.js +31 -0
- package/dist/utils/stats.js +410 -0
- package/dist/utils/system-memory.js +62 -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 +66 -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 +68 -0
- package/kits/docs/evolcore/agent.md +77 -0
- package/kits/docs/evolcore/aid.md +52 -0
- package/kits/docs/evolcore/config.md +149 -0
- package/kits/docs/evolcore/contact.md +57 -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 +110 -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 +150 -0
- package/kits/docs/evolcore/model.md +50 -0
- package/kits/docs/evolcore/msg.md +136 -0
- package/kits/docs/evolcore/response.md +75 -0
- package/kits/docs/evolcore/rpc.md +37 -0
- package/kits/docs/evolcore/self-summary.md +29 -0
- package/kits/docs/evolcore/stats.md +83 -0
- package/kits/docs/evolcore/storage.md +50 -0
- package/kits/docs/evolcore/trigger.md +539 -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 +203 -0
- package/kits/eck_message_manifest.json +63 -0
- package/kits/migrations/README-role-config-v4.md +32 -0
- package/kits/migrations/migrate-contact-book-v2.mjs +747 -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 +32 -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/agent-config.schema.6.json +322 -0
- package/kits/schemas/contact-book.schema.1.json +36 -0
- package/kits/schemas/contact-book.schema.2.json +43 -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/relation-config.schema.5.json +47 -0
- package/kits/schemas/role-config.schema.1.json +201 -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 +9 -0
- package/kits/templates/roles/member.json +41 -0
- package/kits/templates/roles/owner.json +9 -0
- package/kits/templates/roles/visitor.json +40 -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 +28 -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,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "agent-config.schema.3.json",
|
|
4
|
+
"title": "AgentConfig (agents/{aid}/config.json)",
|
|
5
|
+
"x-logical-name": "agent-config",
|
|
6
|
+
"x-scope": "agent",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": true,
|
|
9
|
+
"required": ["aid", "channels"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"$schema_version": { "type": "number", "default": 3, "x-merge": "scalar" },
|
|
12
|
+
"aid": { "type": "string", "x-merge": "scalar" },
|
|
13
|
+
"enabled": { "type": "boolean", "x-merge": "scalar" },
|
|
14
|
+
"lifecycle": { "type": "string", "enum": ["created", "bootstrapping", "active"], "x-merge": "scalar", "description": "agent 生命周期状态", "x-enumDescriptions": { "created": "已创建,尚未进入引导流程", "bootstrapping": "引导中(初始化配置/身份)", "active": "已激活,正常运行" } },
|
|
15
|
+
"initialized": { "type": "boolean", "x-merge": "scalar" },
|
|
16
|
+
"owners": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": { "type": "string" },
|
|
19
|
+
"uniqueItems": true,
|
|
20
|
+
"x-merge": "list"
|
|
21
|
+
},
|
|
22
|
+
"admins": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "type": "string" },
|
|
25
|
+
"uniqueItems": true,
|
|
26
|
+
"x-merge": "list"
|
|
27
|
+
},
|
|
28
|
+
"channels": { "type": "array", "items": { "type": "object" }, "x-merge": "list" },
|
|
29
|
+
"aun": { "type": "object", "x-merge": "dict" },
|
|
30
|
+
"models": { "type": "object", "x-merge": "dict" },
|
|
31
|
+
"active_baseagent": { "type": "string", "x-merge": "scalar" },
|
|
32
|
+
"baseagents": { "type": "object", "x-merge": "dict" },
|
|
33
|
+
"projects": { "type": "object", "x-merge": "dict" },
|
|
34
|
+
"capabilities": { "type": "object", "x-merge": "dict" },
|
|
35
|
+
"debug": { "type": "object", "x-merge": "dict" },
|
|
36
|
+
"observable": { "type": "boolean", "x-merge": "scalar" },
|
|
37
|
+
"chatmode": { "type": "object", "x-merge": "dict", "default": { "private": "interactive", "group": "proactive", "nothuman": "proactive" }, "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 场景默认表;出厂默认值即此 default(agent 级改默认,关系级按键覆盖)。键封闭 private/group/nothuman,值枚举 interactive/proactive" },
|
|
38
|
+
"mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "default": "disabled", "x-merge": "scalar", "description": "@ 处理策略(顶层通用参数)", "x-enumDescriptions": { "disabled": "处理所有消息", "mention-only": "只处理被 @ 的消息,未 @ 作引用上下文" } },
|
|
39
|
+
"model": { "type": "string", "x-merge": "scalar", "description": "主会话模型(顶层通用参数);无默认值,缺省时由响应模式/全局默认决定" },
|
|
40
|
+
"responseMode": { "type": "string", "x-merge": "scalar", "description": "响应模式 id(标量);候选清单/默认值来自注册表,非 schema。关系级>agent级>注册表首选" },
|
|
41
|
+
"responseModeParams": { "type": "object", "x-merge": "dict", "description": "响应模式特有参数字典,按模式 id 分桶:{ [modeId]: {...} }" },
|
|
42
|
+
"flush_delay": { "type": "number", "x-merge": "scalar" },
|
|
43
|
+
"debounce": { "type": "number", "x-merge": "scalar" },
|
|
44
|
+
"show_activities": { "type": "string", "enum": ["all", "text", "none"], "x-merge": "scalar", "description": "中间输出展示范围(仅对 interactive 私聊有意义)", "x-enumDescriptions": { "all": "文本 + activity", "text": "仅文本", "none": "全部静默" } },
|
|
45
|
+
"session_renew": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"x-merge": "dict",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"description": "会话超时后的续接判定",
|
|
50
|
+
"properties": {
|
|
51
|
+
"enabled": { "type": "boolean", "default": false, "description": "是否启用超时后的会话连续性判定" },
|
|
52
|
+
"after_hours": { "type": "number", "exclusiveMinimum": 0, "default": 24, "description": "距最后一条有效对话超过该小时数才触发判定" },
|
|
53
|
+
"effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "default": "low", "description": "续接判定的推理强度", "x-enumDescriptions": { "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
|
|
54
|
+
"fallback_action": { "type": "string", "enum": ["continue", "new"], "default": "continue", "description": "无法判定时的兜底动作", "x-enumDescriptions": { "continue": "继续沿用当前会话", "new": "开启新会话" } }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"group_venue_sync": { "type": "object", "x-merge": "dict" },
|
|
58
|
+
"render": { "type": "object", "x-merge": "dict" },
|
|
59
|
+
"sessionManifests": { "type": "object", "x-merge": "dict" },
|
|
60
|
+
"enable_rich_content": { "type": "boolean", "x-merge": "scalar" },
|
|
61
|
+
"permissionMode": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"enum": ["readonly", "auto", "request", "bypass"],
|
|
64
|
+
"x-merge": "scalar",
|
|
65
|
+
"description": "工具调用的审批策略",
|
|
66
|
+
"x-enumDescriptions": {
|
|
67
|
+
"readonly": "只读模式:明确只读工具自动执行,写入、普通 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权",
|
|
68
|
+
"auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝",
|
|
69
|
+
"request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批",
|
|
70
|
+
"bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"roles": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"x-merge": "dict",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"defaultRoles": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"properties": {
|
|
82
|
+
"private": { "type": ["string", "null"], "pattern": "^[a-z0-9_-]+$" },
|
|
83
|
+
"group": { "type": ["string", "null"], "pattern": "^[a-z0-9_-]+$" }
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"definitions": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"propertyNames": {
|
|
89
|
+
"pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$"
|
|
90
|
+
},
|
|
91
|
+
"additionalProperties": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"required": ["description", "permissions"],
|
|
95
|
+
"properties": {
|
|
96
|
+
"description": { "type": "string" },
|
|
97
|
+
"allowAccess": { "type": "boolean" },
|
|
98
|
+
"permissions": { "type": "object" },
|
|
99
|
+
"commandPermissions": { "type": "object" },
|
|
100
|
+
"usageLimits": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"properties": {
|
|
104
|
+
"enabled": { "type": "boolean" },
|
|
105
|
+
"resetMode": { "type": "string", "enum": ["never", "daily", "weekly", "monthly"], "description": "用量额度的重置周期", "x-enumDescriptions": { "never": "从不重置", "daily": "每日重置", "weekly": "每周重置", "monthly": "每月重置" } },
|
|
106
|
+
"currency": { "type": "string", "enum": ["CNY", "USD"], "description": "额度计价货币", "x-enumDescriptions": { "CNY": "人民币", "USD": "美元" } },
|
|
107
|
+
"limitAmount": { "type": ["number", "null"], "minimum": 0, "description": "额度上限金额;null 表示不限" },
|
|
108
|
+
"costBasis": { "type": "string", "enum": ["gateway", "official"], "description": "计费口径", "x-enumDescriptions": { "gateway": "按网关计费价", "official": "按官方定价" } },
|
|
109
|
+
"scope": { "type": "string", "enum": ["subject", "role"], "description": "额度统计范围", "x-enumDescriptions": { "subject": "按主体(对端)统计", "role": "按角色统计" } }
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "agent-config.schema.4.json",
|
|
4
|
+
"title": "AgentConfig (agents/{aid}/config.json)",
|
|
5
|
+
"x-logical-name": "agent-config",
|
|
6
|
+
"x-scope": "agent",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": true,
|
|
9
|
+
"not": { "required": ["permissionMode"] },
|
|
10
|
+
"required": ["aid", "channels"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"$schema_version": { "type": "number", "default": 4, "x-merge": "scalar", "description": "配置 Schema 版本;v4 使用角色级字段权限策略" },
|
|
13
|
+
"aid": { "type": "string", "x-merge": "scalar", "description": "Agent 的全局唯一身份标识" },
|
|
14
|
+
"enabled": { "type": "boolean", "default": true, "x-merge": "scalar", "description": "是否启用 Agent;缺省按启用处理" },
|
|
15
|
+
"lifecycle": { "type": "string", "enum": ["created", "bootstrapping", "active"], "x-merge": "scalar", "description": "agent 生命周期状态", "x-enumDescriptions": { "created": "已创建,尚未进入引导流程", "bootstrapping": "引导中(初始化配置/身份)", "active": "已激活,正常运行" } },
|
|
16
|
+
"initialized": { "type": "boolean", "x-merge": "scalar", "description": "是否已完成 Agent 初始化流程" },
|
|
17
|
+
"owners": { "type": "array", "items": { "type": "string" }, "uniqueItems": true, "x-merge": "list", "description": "Agent 所有者身份列表;用于 owner 级控制和通知" },
|
|
18
|
+
"admins": { "type": "array", "items": { "type": "string" }, "uniqueItems": true, "x-merge": "list", "description": "Agent 管理员身份列表" },
|
|
19
|
+
"channels": { "type": "array", "items": { "type": "object" }, "x-merge": "list", "description": "Agent 绑定的消息渠道实例列表" },
|
|
20
|
+
"aun": { "type": "object", "x-merge": "dict", "description": "Agent 级 AUN 通信配置" },
|
|
21
|
+
"models": { "type": "object", "x-merge": "dict", "description": "Agent 级模型别名、注册表或模型覆盖配置" },
|
|
22
|
+
"active_baseagent": { "type": "string", "x-merge": "scalar", "description": "默认使用的 base agent 标识,例如 claude 或 codex" },
|
|
23
|
+
"baseagents": { "type": "object", "x-merge": "dict", "description": "各 base agent 的模型、推理强度及运行参数" },
|
|
24
|
+
"projects": { "type": "object", "x-merge": "dict", "description": "Agent 可用项目路径和项目选择配置" },
|
|
25
|
+
"capabilities": { "type": "object", "x-merge": "dict", "description": "Agent 能力开关及能力参数" },
|
|
26
|
+
"debug": { "type": "object", "x-merge": "dict", "description": "Agent 级调试和诊断配置" },
|
|
27
|
+
"observable": { "type": "boolean", "default": false, "x-merge": "scalar", "description": "是否将 Agent 的入站和出站消息转发给 owners;默认关闭" },
|
|
28
|
+
"chatmode": { "type": "object", "x-merge": "dict", "default": { "private": "interactive", "group": "proactive", "nothuman": "proactive" }, "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 场景默认表;出厂默认值即此 default(agent 级改默认,关系级按键覆盖)。键封闭 private/group/nothuman,值枚举 interactive/proactive" },
|
|
29
|
+
"mentionMode": { "type": "string", "enum": ["disabled", "mention-only"], "default": "disabled", "x-merge": "scalar", "description": "@ 处理策略(顶层通用参数)", "x-enumDescriptions": { "disabled": "处理所有消息", "mention-only": "只处理被 @ 的消息,未 @ 作引用上下文" } },
|
|
30
|
+
"model": { "type": "string", "x-merge": "scalar", "description": "主会话模型(顶层通用参数);无默认值,缺省时由响应模式/全局默认决定" },
|
|
31
|
+
"responseMode": { "type": "string", "x-merge": "scalar", "description": "响应模式 id(标量);候选清单/默认值来自注册表,非 schema。关系级>agent级>注册表首选" },
|
|
32
|
+
"responseModeParams": { "type": "object", "x-merge": "dict", "description": "响应模式特有参数字典,按模式 id 分桶:{ [modeId]: {...} }" },
|
|
33
|
+
"flush_delay": { "type": "number", "minimum": 0, "default": 3, "x-merge": "scalar", "description": "流式出站消息的批量刷新间隔,单位为秒;默认 3 秒" },
|
|
34
|
+
"debounce": { "type": "number", "minimum": 0, "default": 0, "x-merge": "scalar", "description": "入站消息合并窗口,单位为秒;0 表示不合并,默认 0" },
|
|
35
|
+
"show_activities": { "type": "string", "enum": ["all", "text", "none"], "default": "all", "x-merge": "scalar", "description": "中间输出展示范围(仅对 interactive 私聊有意义)", "x-enumDescriptions": { "all": "文本 + activity", "text": "仅文本", "none": "全部静默" } },
|
|
36
|
+
"session_renew": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"x-merge": "dict",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"description": "会话超时后的续接判定",
|
|
41
|
+
"properties": {
|
|
42
|
+
"enabled": { "type": "boolean", "default": false, "description": "是否启用超时后的会话连续性判定" },
|
|
43
|
+
"after_hours": { "type": "number", "exclusiveMinimum": 0, "default": 24, "description": "距最后一条有效对话超过该小时数才触发判定" },
|
|
44
|
+
"effort": { "type": "string", "enum": ["low", "medium", "high", "xhigh", "max"], "default": "low", "description": "续接判定的推理强度", "x-enumDescriptions": { "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
|
|
45
|
+
"fallback_action": { "type": "string", "enum": ["continue", "new"], "default": "continue", "description": "无法判定时的兜底动作", "x-enumDescriptions": { "continue": "继续沿用当前会话", "new": "开启新会话" } }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"group_venue_sync": { "type": "object", "x-merge": "dict" },
|
|
49
|
+
"render": { "type": "object", "x-merge": "dict" },
|
|
50
|
+
"sessionManifests": { "type": "object", "x-merge": "dict" },
|
|
51
|
+
"enable_rich_content": { "type": "boolean", "x-merge": "scalar", "description": "是否允许渠道使用富内容消息;未设置时由渠道能力和运行时默认决定" },
|
|
52
|
+
"roles": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"x-merge": "dict",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"description": "Agent 级角色策略。权限模式仅在角色定义中配置,关系配置不可直接覆盖。",
|
|
57
|
+
"properties": {
|
|
58
|
+
"defaultRoles": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"default": { "private": null, "group": null },
|
|
62
|
+
"description": "未显式分配角色时,私聊和群聊使用的默认角色;null 表示不授予默认角色。",
|
|
63
|
+
"properties": {
|
|
64
|
+
"private": { "type": ["string", "null"], "pattern": "^[a-z0-9_-]+$", "default": null, "description": "私聊对端的默认角色;必须引用内置或 definitions 中的角色。" },
|
|
65
|
+
"group": { "type": ["string", "null"], "pattern": "^[a-z0-9_-]+$", "default": null, "description": "群聊对端的默认角色;必须引用内置或 definitions 中的角色。" }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"definitions": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"propertyNames": { "pattern": "^(?!owner$)(?!admin$)[a-z0-9_-]+$" },
|
|
71
|
+
"description": "自定义角色定义。owner 和 admin 为系统保留角色,不能在此重定义。",
|
|
72
|
+
"additionalProperties": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"required": ["description", "permissions"],
|
|
76
|
+
"description": "一个自定义角色的访问、字段权限、命令权限及用量限制。",
|
|
77
|
+
"properties": {
|
|
78
|
+
"description": { "type": "string", "description": "角色的用途和授权边界说明。" },
|
|
79
|
+
"allowAccess": { "type": "boolean", "default": true, "description": "是否允许该角色访问 Agent;缺省为 true。" },
|
|
80
|
+
"permissions": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": ["permissionMode"],
|
|
83
|
+
"description": "角色对可配置行为字段施加的默认值、关系级覆盖权和可选值约束。",
|
|
84
|
+
"properties": {
|
|
85
|
+
"permissionMode": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"required": ["default", "allowOverride"],
|
|
89
|
+
"description": "工具调用的审批策略(角色级)",
|
|
90
|
+
"properties": {
|
|
91
|
+
"default": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"], "description": "角色默认的工具调用审批策略;未得到有效角色策略时运行时安全回退为 readonly。", "x-enumDescriptions": { "readonly": "只读模式:明确只读工具自动执行,写入、普通 Shell 和未知工具拒绝;EC 命令仍由 daemon 鉴权", "auto": "自动模式:常规 workspace 操作自动执行,已识别危险操作和扩权请求拒绝", "request": "请求模式:常规操作自动执行,危险 Bash 和沙箱扩权请求人工审批", "bypass": "放行模式:沙箱内常规和普通审批命令自动执行,强危险 Git 和越界扩权仍需审批" } },
|
|
92
|
+
"allowOverride": { "const": false, "default": false, "description": "权限模式禁止关系级覆盖,固定为 false。" },
|
|
93
|
+
"allowedValues": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": { "type": "string", "enum": ["readonly", "auto", "request", "bypass"] },
|
|
96
|
+
"uniqueItems": true,
|
|
97
|
+
"description": "保留的权限模式候选集合;permissionMode 当前不可由关系级覆盖,通常无需配置。"
|
|
98
|
+
},
|
|
99
|
+
"reason": { "type": "string", "description": "采用该角色策略的可审计原因或管理备注。" }
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"chatmode.private": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": ["default", "allowOverride"],
|
|
106
|
+
"description": "角色在私聊场景中的响应方式策略。",
|
|
107
|
+
"properties": {
|
|
108
|
+
"default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的私聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
|
|
109
|
+
"allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖私聊响应方式;默认不允许。" },
|
|
110
|
+
"allowedValues": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": { "type": "string", "enum": ["interactive", "proactive"] },
|
|
113
|
+
"uniqueItems": true,
|
|
114
|
+
"description": "允许覆盖到的响应方式白名单;未配置或为空时不额外限制枚举值。"
|
|
115
|
+
},
|
|
116
|
+
"reason": { "type": "string", "description": "采用该角色策略的可审计原因或管理备注。" }
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"chatmode.group": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"additionalProperties": false,
|
|
122
|
+
"required": ["default", "allowOverride"],
|
|
123
|
+
"description": "角色在群聊场景中的响应方式策略。",
|
|
124
|
+
"properties": {
|
|
125
|
+
"default": { "type": "string", "enum": ["interactive", "proactive"], "description": "未设置有效关系级覆盖时使用的群聊响应方式。", "x-enumDescriptions": { "interactive": "同步交互:输出即回复", "proactive": "主动推送:CLI 回复 + 思考投影" } },
|
|
126
|
+
"allowOverride": { "type": "boolean", "default": false, "description": "是否允许该角色在关系级覆盖群聊响应方式;默认不允许。" },
|
|
127
|
+
"allowedValues": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": { "type": "string", "enum": ["interactive", "proactive"] },
|
|
130
|
+
"uniqueItems": true,
|
|
131
|
+
"description": "允许覆盖到的响应方式白名单;未配置或为空时不额外限制枚举值。"
|
|
132
|
+
},
|
|
133
|
+
"reason": { "type": "string", "description": "采用该角色策略的可审计原因或管理备注。" }
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"baseagents.claude.effort": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": ["default", "allowOverride"],
|
|
140
|
+
"description": "Claude runner 的推理强度策略。",
|
|
141
|
+
"properties": {
|
|
142
|
+
"default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"], "description": "角色默认的 Claude 推理强度。", "x-enumDescriptions": { "auto": "自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高", "max": "最高" } },
|
|
143
|
+
"allowOverride": { "type": "boolean", "default": false, "description": "是否允许关系级覆盖 Claude 推理强度;默认不允许。" },
|
|
144
|
+
"allowedValues": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"items": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh", "max"] },
|
|
147
|
+
"uniqueItems": true,
|
|
148
|
+
"description": "允许关系级覆盖的 Claude 推理强度白名单。"
|
|
149
|
+
},
|
|
150
|
+
"reason": { "type": "string", "description": "采用该角色策略的可审计原因或管理备注。" }
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"baseagents.codex.reasoning": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"required": ["default", "allowOverride"],
|
|
157
|
+
"description": "Codex runner 的推理强度策略。",
|
|
158
|
+
"properties": {
|
|
159
|
+
"default": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh"], "description": "角色默认的 Codex 推理强度。", "x-enumDescriptions": { "auto": "自动选择", "low": "低", "medium": "中", "high": "高", "xhigh": "很高" } },
|
|
160
|
+
"allowOverride": { "type": "boolean", "default": false, "description": "是否允许关系级覆盖 Codex 推理强度;默认不允许。" },
|
|
161
|
+
"allowedValues": {
|
|
162
|
+
"type": "array",
|
|
163
|
+
"items": { "type": "string", "enum": ["auto", "low", "medium", "high", "xhigh"] },
|
|
164
|
+
"uniqueItems": true,
|
|
165
|
+
"description": "允许关系级覆盖的 Codex 推理强度白名单。"
|
|
166
|
+
},
|
|
167
|
+
"reason": { "type": "string", "description": "采用该角色策略的可审计原因或管理备注。" }
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"patternProperties": {
|
|
172
|
+
"^baseagents\\.[a-z0-9_-]+\\.model$": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"additionalProperties": false,
|
|
175
|
+
"required": ["default", "allowOverride", "allowedModels"],
|
|
176
|
+
"description": "指定 base agent 的模型选择策略;模型必须同时匹配 allowedModels。",
|
|
177
|
+
"properties": {
|
|
178
|
+
"default": { "type": "string", "minLength": 1, "description": "角色默认模型标识;必须被 allowedModels 中的精确值或通配符允许。" },
|
|
179
|
+
"allowOverride": { "type": "boolean", "default": false, "description": "是否允许关系级覆盖模型;默认不允许。" },
|
|
180
|
+
"allowedModels": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "模型白名单;支持以 * 结尾的前缀通配符,且至少包含一个模型。" },
|
|
181
|
+
"reason": { "type": "string", "description": "采用该角色模型策略的可审计原因或管理备注。" }
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"additionalProperties": false
|
|
186
|
+
},
|
|
187
|
+
"commandPermissions": { "type": "object", "description": "按 operation 标识控制命令是否允许执行,可附带作用域、危险标记和约束。" },
|
|
188
|
+
"usageLimits": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"description": "角色用量额度策略;enabled 未开启或未配置时不启用额度限制。",
|
|
192
|
+
"properties": {
|
|
193
|
+
"enabled": { "type": "boolean", "default": false, "description": "是否启用该角色的用量额度限制;默认关闭。" },
|
|
194
|
+
"resetMode": { "type": "string", "enum": ["never", "daily", "weekly", "monthly"], "description": "用量额度的重置周期", "x-enumDescriptions": { "never": "从不重置", "daily": "每日重置", "weekly": "每周重置", "monthly": "每月重置" } },
|
|
195
|
+
"currency": { "type": "string", "enum": ["CNY", "USD"], "description": "额度计价货币", "x-enumDescriptions": { "CNY": "人民币", "USD": "美元" } },
|
|
196
|
+
"limitAmount": { "type": ["number", "null"], "minimum": 0, "description": "额度上限金额;null 表示不限" },
|
|
197
|
+
"costBasis": { "type": "string", "enum": ["gateway", "official"], "description": "计费口径", "x-enumDescriptions": { "gateway": "按网关计费价", "official": "按官方定价" } },
|
|
198
|
+
"scope": { "type": "string", "enum": ["subject", "role"], "description": "额度统计范围", "x-enumDescriptions": { "subject": "按主体(对端)统计", "role": "按角色统计" } }
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"extra_backup": { "type": "array", "items": { "type": "object" }, "x-merge": "list" }
|
|
207
|
+
}
|
|
208
|
+
}
|