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,675 @@
|
|
|
1
|
+
const CONFIG_MANAGEMENT_OPERATIONS = [
|
|
2
|
+
['config.show', 'Read one raw config layer', ['relation', 'agent', 'process']],
|
|
3
|
+
['config.effective', 'Read effective config with sources', ['relation', 'agent', 'process']],
|
|
4
|
+
['config.fields', 'List config schema fields', ['relation', 'agent', 'process']],
|
|
5
|
+
['config.validate', 'Validate a config layer', ['relation', 'agent', 'process']],
|
|
6
|
+
['config.init', 'Initialize a config layer', ['relation', 'agent', 'process']],
|
|
7
|
+
['config.list', 'List all config files', ['process']],
|
|
8
|
+
['config.snapshot', 'Create a config snapshot', ['process']],
|
|
9
|
+
['config.prune', 'Prune config snapshots', ['process']],
|
|
10
|
+
['config.history', 'List config snapshots', ['process']],
|
|
11
|
+
['config.diff', 'Compare config snapshots', ['process']],
|
|
12
|
+
['config.restore', 'Restore a config snapshot', ['process']],
|
|
13
|
+
['config.current', 'Read the selected config snapshot', ['process']],
|
|
14
|
+
['config.boots', 'Read config boot history', ['process']],
|
|
15
|
+
['config.schema', 'Read a config schema definition', ['process']],
|
|
16
|
+
].map(([id, description, defaultScopes]) => ({
|
|
17
|
+
id,
|
|
18
|
+
category: 'dangerous',
|
|
19
|
+
dangerous: true,
|
|
20
|
+
defaultScopes,
|
|
21
|
+
description,
|
|
22
|
+
sources: ['menu.cli', 'agent-tool', 'control'],
|
|
23
|
+
}));
|
|
24
|
+
/**
|
|
25
|
+
* Operation Catalog - 所有命令操作的元数据定义
|
|
26
|
+
*
|
|
27
|
+
* 参照设计文档 docs/command-execution-role-permission-design.md 第 5 节
|
|
28
|
+
*/
|
|
29
|
+
const OPERATIONS = [
|
|
30
|
+
// ── Model Operations ──
|
|
31
|
+
{
|
|
32
|
+
id: 'model.list',
|
|
33
|
+
category: 'read',
|
|
34
|
+
dangerous: false,
|
|
35
|
+
defaultScopes: ['relation', 'role', 'agent'],
|
|
36
|
+
description: '列出可用模型',
|
|
37
|
+
sources: ['slash', 'menu', 'menu.cli'],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'model.current',
|
|
41
|
+
category: 'read',
|
|
42
|
+
dangerous: false,
|
|
43
|
+
defaultScopes: ['relation', 'role', 'agent'],
|
|
44
|
+
description: '查询当前使用的模型',
|
|
45
|
+
sources: ['slash', 'menu', 'menu.cli'],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'model.info',
|
|
49
|
+
category: 'read',
|
|
50
|
+
dangerous: false,
|
|
51
|
+
defaultScopes: ['relation', 'role', 'agent'],
|
|
52
|
+
description: '查询指定模型的详细信息',
|
|
53
|
+
sources: ['menu.cli', 'agent-tool'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'model.check',
|
|
57
|
+
category: 'diagnose',
|
|
58
|
+
dangerous: false,
|
|
59
|
+
defaultScopes: ['agent'],
|
|
60
|
+
description: '检查模型可用性(可能触发网关探测)',
|
|
61
|
+
sources: ['slash', 'menu.cli', 'agent-tool'],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'model.use',
|
|
65
|
+
category: 'write-own',
|
|
66
|
+
dangerous: false,
|
|
67
|
+
defaultScopes: ['relation', 'role', 'agent'],
|
|
68
|
+
description: '切换使用的模型',
|
|
69
|
+
sources: ['slash', 'menu', 'menu.cli'],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'model.effort',
|
|
73
|
+
category: 'write-own',
|
|
74
|
+
dangerous: false,
|
|
75
|
+
defaultScopes: ['relation', 'role', 'agent'],
|
|
76
|
+
description: '设置推理努力度',
|
|
77
|
+
sources: ['slash', 'menu', 'menu.cli'],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'model.reset',
|
|
81
|
+
category: 'write-own',
|
|
82
|
+
dangerous: false,
|
|
83
|
+
defaultScopes: ['relation', 'role', 'agent'],
|
|
84
|
+
description: '重置模型配置到角色默认值',
|
|
85
|
+
sources: ['slash', 'menu.cli', 'agent-tool'],
|
|
86
|
+
},
|
|
87
|
+
// ── Session Operations ──
|
|
88
|
+
{
|
|
89
|
+
id: 'permission.current',
|
|
90
|
+
category: 'read',
|
|
91
|
+
dangerous: false,
|
|
92
|
+
defaultScopes: ['relation'],
|
|
93
|
+
description: 'Read current permission mode',
|
|
94
|
+
sources: ['slash', 'menu'],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'permission.answer',
|
|
98
|
+
category: 'write-own',
|
|
99
|
+
dangerous: false,
|
|
100
|
+
defaultScopes: ['relation'],
|
|
101
|
+
description: 'Answer an interactive permission request',
|
|
102
|
+
sources: ['slash', 'menu'],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'chatmode.current',
|
|
106
|
+
category: 'read',
|
|
107
|
+
dangerous: false,
|
|
108
|
+
defaultScopes: ['relation', 'agent'],
|
|
109
|
+
description: 'Read chat mode',
|
|
110
|
+
sources: ['slash', 'menu'],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 'chatmode.update',
|
|
114
|
+
category: 'write-own',
|
|
115
|
+
dangerous: false,
|
|
116
|
+
defaultScopes: ['relation', 'agent'],
|
|
117
|
+
description: 'Update chat mode',
|
|
118
|
+
sources: ['slash', 'menu'],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'mentionmode.current',
|
|
122
|
+
category: 'read',
|
|
123
|
+
dangerous: false,
|
|
124
|
+
defaultScopes: ['relation', 'agent'],
|
|
125
|
+
description: 'Read group mention mode',
|
|
126
|
+
sources: ['slash', 'menu'],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 'mentionmode.update',
|
|
130
|
+
category: 'write-own',
|
|
131
|
+
dangerous: false,
|
|
132
|
+
defaultScopes: ['relation', 'agent'],
|
|
133
|
+
description: 'Update group mention mode',
|
|
134
|
+
sources: ['slash', 'menu'],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'session.list',
|
|
138
|
+
category: 'read',
|
|
139
|
+
dangerous: false,
|
|
140
|
+
defaultScopes: ['relation'],
|
|
141
|
+
description: '列出会话',
|
|
142
|
+
sources: ['slash', 'menu'],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'session.create',
|
|
146
|
+
category: 'write-own',
|
|
147
|
+
dangerous: false,
|
|
148
|
+
defaultScopes: ['relation'],
|
|
149
|
+
description: '创建新会话',
|
|
150
|
+
sources: ['slash', 'menu'],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'session.rename',
|
|
154
|
+
category: 'write-own',
|
|
155
|
+
dangerous: false,
|
|
156
|
+
defaultScopes: ['relation'],
|
|
157
|
+
description: '重命名会话',
|
|
158
|
+
sources: ['slash', 'menu'],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'session.delete',
|
|
162
|
+
category: 'write-own',
|
|
163
|
+
dangerous: false,
|
|
164
|
+
defaultScopes: ['relation'],
|
|
165
|
+
description: '删除会话',
|
|
166
|
+
sources: ['slash', 'menu'],
|
|
167
|
+
},
|
|
168
|
+
// ── File Operations ──
|
|
169
|
+
{
|
|
170
|
+
id: 'file.list',
|
|
171
|
+
category: 'read',
|
|
172
|
+
dangerous: false,
|
|
173
|
+
defaultScopes: ['filesystem'],
|
|
174
|
+
description: '列出文件(需路径沙箱检查)',
|
|
175
|
+
sources: ['menu'],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: 'file.fetch',
|
|
179
|
+
category: 'read',
|
|
180
|
+
dangerous: false,
|
|
181
|
+
defaultScopes: ['filesystem'],
|
|
182
|
+
description: '获取文件内容(需路径沙箱检查)',
|
|
183
|
+
sources: ['menu'],
|
|
184
|
+
},
|
|
185
|
+
// ── Trigger Operations ──
|
|
186
|
+
{
|
|
187
|
+
id: 'trigger.list',
|
|
188
|
+
category: 'read',
|
|
189
|
+
dangerous: false,
|
|
190
|
+
defaultScopes: ['relation', 'agent'],
|
|
191
|
+
description: '列出定时触发器',
|
|
192
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: 'trigger.show',
|
|
196
|
+
category: 'read',
|
|
197
|
+
dangerous: false,
|
|
198
|
+
defaultScopes: ['relation', 'agent'],
|
|
199
|
+
description: '查看定时触发器详情',
|
|
200
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: 'trigger.history',
|
|
204
|
+
category: 'read',
|
|
205
|
+
dangerous: false,
|
|
206
|
+
defaultScopes: ['relation', 'agent'],
|
|
207
|
+
description: '查看定时触发器历史',
|
|
208
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: 'trigger.eventCatalog',
|
|
212
|
+
category: 'read',
|
|
213
|
+
dangerous: false,
|
|
214
|
+
defaultScopes: ['relation', 'agent'],
|
|
215
|
+
description: '查看可订阅事件目录',
|
|
216
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: 'trigger.create',
|
|
220
|
+
category: 'write-own',
|
|
221
|
+
dangerous: false,
|
|
222
|
+
defaultScopes: ['relation', 'agent'],
|
|
223
|
+
description: '创建定时触发器',
|
|
224
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 'trigger.update',
|
|
228
|
+
category: 'write-own',
|
|
229
|
+
dangerous: false,
|
|
230
|
+
defaultScopes: ['relation', 'agent'],
|
|
231
|
+
description: '更新定时触发器',
|
|
232
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: 'trigger.setEnabled',
|
|
236
|
+
category: 'write-own',
|
|
237
|
+
dangerous: false,
|
|
238
|
+
defaultScopes: ['relation', 'agent'],
|
|
239
|
+
description: '启用或禁用定时触发器',
|
|
240
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: 'trigger.cancel',
|
|
244
|
+
category: 'write-own',
|
|
245
|
+
dangerous: false,
|
|
246
|
+
defaultScopes: ['relation', 'agent'],
|
|
247
|
+
description: '取消定时触发器',
|
|
248
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: 'trigger.delete',
|
|
252
|
+
category: 'write-own',
|
|
253
|
+
dangerous: false,
|
|
254
|
+
defaultScopes: ['relation', 'agent'],
|
|
255
|
+
description: '删除定时触发器',
|
|
256
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: 'trigger.run',
|
|
260
|
+
category: 'write-own',
|
|
261
|
+
dangerous: false,
|
|
262
|
+
defaultScopes: ['relation', 'agent'],
|
|
263
|
+
description: '立即执行定时触发器',
|
|
264
|
+
sources: ['slash', 'menu', 'menu.cli', 'agent-tool', 'control'],
|
|
265
|
+
},
|
|
266
|
+
// Role Assignment Operations
|
|
267
|
+
{
|
|
268
|
+
id: 'role.assign',
|
|
269
|
+
category: 'write-agent',
|
|
270
|
+
dangerous: false,
|
|
271
|
+
defaultScopes: ['agent'],
|
|
272
|
+
description: 'Assign a role to a private or group relation',
|
|
273
|
+
sources: ['menu', 'ecweb', 'control'],
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
id: 'role.revoke',
|
|
277
|
+
category: 'write-agent',
|
|
278
|
+
dangerous: false,
|
|
279
|
+
defaultScopes: ['agent'],
|
|
280
|
+
description: 'Revoke a private or group relation role assignment',
|
|
281
|
+
sources: ['menu', 'ecweb', 'control'],
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
id: 'role.policy.read',
|
|
285
|
+
category: 'read',
|
|
286
|
+
dangerous: false,
|
|
287
|
+
defaultScopes: ['agent'],
|
|
288
|
+
description: 'Read role definitions, command permissions, default roles, and usage limits',
|
|
289
|
+
sources: ['menu', 'ecweb', 'control'],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: 'role.relation.read',
|
|
293
|
+
category: 'read',
|
|
294
|
+
dangerous: false,
|
|
295
|
+
defaultScopes: ['agent'],
|
|
296
|
+
description: 'Read private and group relation role assignments',
|
|
297
|
+
sources: ['menu', 'ecweb', 'control'],
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: 'role.policy.write',
|
|
301
|
+
category: 'write-agent',
|
|
302
|
+
dangerous: true,
|
|
303
|
+
defaultScopes: ['agent'],
|
|
304
|
+
description: 'Modify role definitions, command permissions, default roles, or usage limits',
|
|
305
|
+
sources: ['menu', 'ecweb', 'control'],
|
|
306
|
+
},
|
|
307
|
+
// Agent Operations
|
|
308
|
+
{
|
|
309
|
+
id: 'agent.list',
|
|
310
|
+
category: 'read',
|
|
311
|
+
dangerous: false,
|
|
312
|
+
defaultScopes: ['control'],
|
|
313
|
+
description: '列出所有 agent(敏感信息)',
|
|
314
|
+
sources: ['menu', 'menu.cli', 'control'],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: 'agent.show',
|
|
318
|
+
category: 'read',
|
|
319
|
+
dangerous: false,
|
|
320
|
+
defaultScopes: ['control', 'agent'],
|
|
321
|
+
description: '查看 agent 详情(敏感信息)',
|
|
322
|
+
sources: ['menu', 'menu.cli', 'control'],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: 'agent.getConfig',
|
|
326
|
+
category: 'read',
|
|
327
|
+
dangerous: true,
|
|
328
|
+
defaultScopes: ['control'],
|
|
329
|
+
description: '获取 agent 配置(含凭证)',
|
|
330
|
+
sources: ['menu', 'menu.cli', 'control'],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
id: 'agent.create',
|
|
334
|
+
category: 'process',
|
|
335
|
+
dangerous: true,
|
|
336
|
+
defaultScopes: ['control'],
|
|
337
|
+
description: '创建新 agent',
|
|
338
|
+
sources: ['menu', 'menu.cli', 'control'],
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: 'agent.reload',
|
|
342
|
+
category: 'process',
|
|
343
|
+
dangerous: true,
|
|
344
|
+
defaultScopes: ['control', 'agent'],
|
|
345
|
+
description: '重载 agent 配置',
|
|
346
|
+
sources: ['slash', 'menu', 'control'],
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
id: 'agent.delete',
|
|
350
|
+
category: 'dangerous',
|
|
351
|
+
dangerous: true,
|
|
352
|
+
defaultScopes: ['control'],
|
|
353
|
+
description: '删除 agent(危险操作)',
|
|
354
|
+
sources: ['menu', 'menu.cli', 'control'],
|
|
355
|
+
},
|
|
356
|
+
// ── System Operations ──
|
|
357
|
+
{
|
|
358
|
+
id: 'system.status',
|
|
359
|
+
category: 'read',
|
|
360
|
+
dangerous: false,
|
|
361
|
+
defaultScopes: ['process'],
|
|
362
|
+
description: '查看系统状态(敏感信息)',
|
|
363
|
+
sources: ['slash', 'menu', 'menu.cli'],
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: 'system.restart',
|
|
367
|
+
category: 'process',
|
|
368
|
+
dangerous: true,
|
|
369
|
+
defaultScopes: ['process'],
|
|
370
|
+
description: '重启 daemon 进程',
|
|
371
|
+
sources: ['slash', 'menu', 'control'],
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: 'system.upgrade',
|
|
375
|
+
category: 'process',
|
|
376
|
+
dangerous: true,
|
|
377
|
+
defaultScopes: ['process'],
|
|
378
|
+
description: '升级 evolcore 版本',
|
|
379
|
+
sources: ['slash', 'menu', 'control'],
|
|
380
|
+
},
|
|
381
|
+
// ── Stats Operations ──
|
|
382
|
+
{
|
|
383
|
+
id: 'stats.summary',
|
|
384
|
+
category: 'read',
|
|
385
|
+
dangerous: false,
|
|
386
|
+
defaultScopes: ['relation', 'control'],
|
|
387
|
+
description: '查看使用统计摘要',
|
|
388
|
+
sources: ['menu.cli'],
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
id: 'stats.peers',
|
|
392
|
+
category: 'read',
|
|
393
|
+
dangerous: false,
|
|
394
|
+
defaultScopes: ['control'],
|
|
395
|
+
description: '查看对端统计',
|
|
396
|
+
sources: ['menu.cli'],
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: 'stats.groups',
|
|
400
|
+
category: 'read',
|
|
401
|
+
dangerous: false,
|
|
402
|
+
defaultScopes: ['control'],
|
|
403
|
+
description: '查看群组统计',
|
|
404
|
+
sources: ['menu.cli'],
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
id: 'stats.session',
|
|
408
|
+
category: 'read',
|
|
409
|
+
dangerous: false,
|
|
410
|
+
defaultScopes: ['relation'],
|
|
411
|
+
description: '查看指定会话统计',
|
|
412
|
+
sources: ['menu.cli'],
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: 'stats.context',
|
|
416
|
+
category: 'read',
|
|
417
|
+
dangerous: false,
|
|
418
|
+
defaultScopes: ['relation'],
|
|
419
|
+
description: '查看指定上下文统计',
|
|
420
|
+
sources: ['menu.cli'],
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
id: 'stats.sqlReadonly',
|
|
424
|
+
category: 'dangerous',
|
|
425
|
+
dangerous: true,
|
|
426
|
+
defaultScopes: ['control', 'raw-cli'],
|
|
427
|
+
description: '执行只读 SQL 查询(可绕过业务 API 枚举数据)',
|
|
428
|
+
sources: ['menu.cli'],
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
id: 'stats.rebuild',
|
|
432
|
+
category: 'dangerous',
|
|
433
|
+
dangerous: true,
|
|
434
|
+
defaultScopes: ['process'],
|
|
435
|
+
description: '重建统计数据库',
|
|
436
|
+
sources: ['menu.cli'],
|
|
437
|
+
},
|
|
438
|
+
// ── AID Operations ──
|
|
439
|
+
{
|
|
440
|
+
id: 'aid.listLocal',
|
|
441
|
+
category: 'read',
|
|
442
|
+
dangerous: true,
|
|
443
|
+
defaultScopes: ['control'],
|
|
444
|
+
description: '列出本地 AID(敏感信息)',
|
|
445
|
+
sources: ['menu.cli', 'control'],
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: 'aid.showLocal',
|
|
449
|
+
category: 'read',
|
|
450
|
+
dangerous: true,
|
|
451
|
+
defaultScopes: ['control'],
|
|
452
|
+
description: '查看本地 AID 详情(敏感信息)',
|
|
453
|
+
sources: ['menu.cli', 'control'],
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
id: 'aid.lookupRemote',
|
|
457
|
+
category: 'diagnose',
|
|
458
|
+
dangerous: false,
|
|
459
|
+
defaultScopes: ['control'],
|
|
460
|
+
description: '查询远程 AID 信息(敏感信息)',
|
|
461
|
+
sources: ['menu.cli', 'control'],
|
|
462
|
+
},
|
|
463
|
+
// ── Storage Operations ──
|
|
464
|
+
{
|
|
465
|
+
id: 'storage.list',
|
|
466
|
+
category: 'read',
|
|
467
|
+
dangerous: false,
|
|
468
|
+
defaultScopes: ['control'],
|
|
469
|
+
description: '列出存储对象(敏感信息)',
|
|
470
|
+
sources: ['menu.cli', 'control'],
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
id: 'storage.quota',
|
|
474
|
+
category: 'read',
|
|
475
|
+
dangerous: false,
|
|
476
|
+
defaultScopes: ['control'],
|
|
477
|
+
description: '查看存储配额(敏感信息)',
|
|
478
|
+
sources: ['menu.cli', 'control'],
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
id: 'storage.upload',
|
|
482
|
+
category: 'write-agent',
|
|
483
|
+
dangerous: true,
|
|
484
|
+
defaultScopes: ['control'],
|
|
485
|
+
description: '上传文件到云存储',
|
|
486
|
+
sources: ['menu.cli', 'control'],
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
id: 'storage.download',
|
|
490
|
+
category: 'write-agent',
|
|
491
|
+
dangerous: true,
|
|
492
|
+
defaultScopes: ['control'],
|
|
493
|
+
description: '从云存储下载文件',
|
|
494
|
+
sources: ['menu.cli', 'control'],
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
id: 'storage.delete',
|
|
498
|
+
category: 'dangerous',
|
|
499
|
+
dangerous: true,
|
|
500
|
+
defaultScopes: ['control'],
|
|
501
|
+
description: '删除云存储对象',
|
|
502
|
+
sources: ['menu.cli', 'control'],
|
|
503
|
+
},
|
|
504
|
+
// ── Gateway & Config Operations ──
|
|
505
|
+
{
|
|
506
|
+
id: 'gateway.read',
|
|
507
|
+
category: 'read',
|
|
508
|
+
dangerous: true,
|
|
509
|
+
defaultScopes: ['process'],
|
|
510
|
+
description: '查询网关配置',
|
|
511
|
+
sources: ['menu', 'control'],
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
id: 'gateway.write',
|
|
515
|
+
category: 'process',
|
|
516
|
+
dangerous: true,
|
|
517
|
+
defaultScopes: ['process'],
|
|
518
|
+
description: '修改网关配置',
|
|
519
|
+
sources: ['menu', 'control'],
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
id: 'config.get',
|
|
523
|
+
category: 'read',
|
|
524
|
+
dangerous: false,
|
|
525
|
+
defaultScopes: ['relation', 'agent'],
|
|
526
|
+
description: 'Read a relation or agent config field',
|
|
527
|
+
sources: ['menu.cli', 'agent-tool'],
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
id: 'config.set',
|
|
531
|
+
category: 'write-own',
|
|
532
|
+
dangerous: false,
|
|
533
|
+
defaultScopes: ['relation', 'agent'],
|
|
534
|
+
description: 'Write a relation or agent config field',
|
|
535
|
+
sources: ['menu.cli', 'agent-tool'],
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
id: 'config.unset',
|
|
539
|
+
category: 'write-own',
|
|
540
|
+
dangerous: false,
|
|
541
|
+
defaultScopes: ['relation', 'agent'],
|
|
542
|
+
description: 'Remove a relation or agent config field',
|
|
543
|
+
sources: ['menu.cli', 'agent-tool'],
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
id: 'config.read',
|
|
547
|
+
category: 'read',
|
|
548
|
+
dangerous: true,
|
|
549
|
+
defaultScopes: ['relation', 'agent', 'process'],
|
|
550
|
+
description: '查询配置',
|
|
551
|
+
sources: ['menu', 'menu.cli', 'control'],
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
id: 'config.write',
|
|
555
|
+
category: 'process',
|
|
556
|
+
dangerous: true,
|
|
557
|
+
defaultScopes: ['relation', 'agent', 'process'],
|
|
558
|
+
description: '修改配置',
|
|
559
|
+
sources: ['menu', 'menu.cli', 'control'],
|
|
560
|
+
},
|
|
561
|
+
// ── EC Command Operations ──
|
|
562
|
+
// EC daemon 入口根据结构化 IPC 请求构造 operation;Runner 不解析 EC 子命令。
|
|
563
|
+
...CONFIG_MANAGEMENT_OPERATIONS,
|
|
564
|
+
{
|
|
565
|
+
id: 'ec.msg.send',
|
|
566
|
+
category: 'write-own',
|
|
567
|
+
dangerous: false,
|
|
568
|
+
defaultScopes: ['relation', 'agent'],
|
|
569
|
+
description: '通过 ec msg send 发送私聊消息',
|
|
570
|
+
sources: ['agent-tool'],
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
id: 'ec.msg.file',
|
|
574
|
+
category: 'write-own',
|
|
575
|
+
dangerous: false,
|
|
576
|
+
defaultScopes: ['relation', 'agent'],
|
|
577
|
+
description: '通过 ec msg file 发送私聊文件',
|
|
578
|
+
sources: ['agent-tool'],
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
id: 'ec.group.send',
|
|
582
|
+
category: 'write-own',
|
|
583
|
+
dangerous: false,
|
|
584
|
+
defaultScopes: ['relation', 'agent'],
|
|
585
|
+
description: '通过 ec group send 发送群组消息',
|
|
586
|
+
sources: ['agent-tool'],
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
id: 'ec.group.file',
|
|
590
|
+
category: 'write-own',
|
|
591
|
+
dangerous: false,
|
|
592
|
+
defaultScopes: ['relation', 'agent'],
|
|
593
|
+
description: '通过 ec group file 发送群组文件',
|
|
594
|
+
sources: ['agent-tool'],
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
id: 'ec.ctl.send',
|
|
598
|
+
category: 'write-agent',
|
|
599
|
+
dangerous: false,
|
|
600
|
+
defaultScopes: ['control', 'agent'],
|
|
601
|
+
description: '通过 ec ctl send 发送控制通道消息',
|
|
602
|
+
sources: ['agent-tool'],
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
id: 'ec.ctl.file',
|
|
606
|
+
category: 'write-agent',
|
|
607
|
+
dangerous: false,
|
|
608
|
+
defaultScopes: ['control', 'agent'],
|
|
609
|
+
description: '通过 ec ctl file 发送控制通道文件',
|
|
610
|
+
sources: ['agent-tool'],
|
|
611
|
+
},
|
|
612
|
+
// ── Raw CLI & Shell Execution ──
|
|
613
|
+
{
|
|
614
|
+
id: 'cli.exec.raw',
|
|
615
|
+
category: 'dangerous',
|
|
616
|
+
dangerous: true,
|
|
617
|
+
defaultScopes: ['raw-cli'],
|
|
618
|
+
description: '原始 CLI 透传(无法归一化的命令)',
|
|
619
|
+
sources: ['menu.cli'],
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
id: 'shell.exec',
|
|
623
|
+
category: 'dangerous',
|
|
624
|
+
dangerous: true,
|
|
625
|
+
defaultScopes: ['raw-cli'],
|
|
626
|
+
description: 'Shell 命令执行(预留)',
|
|
627
|
+
sources: ['menu.cli'],
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
id: 'rce.exec',
|
|
631
|
+
category: 'dangerous',
|
|
632
|
+
dangerous: true,
|
|
633
|
+
defaultScopes: ['raw-cli'],
|
|
634
|
+
description: '远程代码执行(预留)',
|
|
635
|
+
sources: ['menu.cli'],
|
|
636
|
+
},
|
|
637
|
+
];
|
|
638
|
+
// ── Registry ──
|
|
639
|
+
const operationMap = new Map();
|
|
640
|
+
for (const op of OPERATIONS) {
|
|
641
|
+
if ((op.id === 'config.read' || op.id === 'config.write') && op.sources && !op.sources.includes('agent-tool')) {
|
|
642
|
+
op.sources = [...op.sources, 'agent-tool'];
|
|
643
|
+
}
|
|
644
|
+
operationMap.set(op.id, op);
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* 获取 operation 元数据
|
|
648
|
+
*/
|
|
649
|
+
export function getOperationMeta(id) {
|
|
650
|
+
return operationMap.get(id) ?? null;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* 列出所有 operation
|
|
654
|
+
*/
|
|
655
|
+
export function listOperations() {
|
|
656
|
+
return [...OPERATIONS];
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* 列出指定类别的 operation
|
|
660
|
+
*/
|
|
661
|
+
export function listOperationsByCategory(category) {
|
|
662
|
+
return OPERATIONS.filter(op => op.category === category);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* 列出所有危险 operation
|
|
666
|
+
*/
|
|
667
|
+
export function listDangerousOperations() {
|
|
668
|
+
return OPERATIONS.filter(op => op.dangerous);
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* 检查 operation 是否存在
|
|
672
|
+
*/
|
|
673
|
+
export function hasOperation(id) {
|
|
674
|
+
return operationMap.has(id);
|
|
675
|
+
}
|