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,740 @@
|
|
|
1
|
+
const CATALOG = [
|
|
2
|
+
{
|
|
3
|
+
type: 'system:started',
|
|
4
|
+
namespace: 'system',
|
|
5
|
+
name: 'started',
|
|
6
|
+
description: '系统启动完成',
|
|
7
|
+
fields: [
|
|
8
|
+
{ path: 'channels', type: 'array' },
|
|
9
|
+
{ path: 'timestamp', type: 'number' },
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: 'system:shutdown',
|
|
14
|
+
namespace: 'system',
|
|
15
|
+
name: 'shutdown',
|
|
16
|
+
description: '系统关闭',
|
|
17
|
+
fields: [
|
|
18
|
+
{ path: 'reason', type: 'string', optional: true },
|
|
19
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: 'system:restart',
|
|
24
|
+
namespace: 'system',
|
|
25
|
+
name: 'restart',
|
|
26
|
+
description: '当前运行时请求重启',
|
|
27
|
+
fields: [
|
|
28
|
+
{ path: 'channel', type: 'string' },
|
|
29
|
+
{ path: 'channelId', type: 'string' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'channel:connected',
|
|
34
|
+
namespace: 'channel',
|
|
35
|
+
name: 'connected',
|
|
36
|
+
description: '渠道连接成功',
|
|
37
|
+
fields: [
|
|
38
|
+
{ path: 'channel', type: 'string' },
|
|
39
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
40
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'channel:disconnected',
|
|
45
|
+
namespace: 'channel',
|
|
46
|
+
name: 'disconnected',
|
|
47
|
+
description: '渠道断开',
|
|
48
|
+
fields: [
|
|
49
|
+
{ path: 'channel', type: 'string' },
|
|
50
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
51
|
+
{ path: 'reason', type: 'string', optional: true },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'channel:error',
|
|
56
|
+
namespace: 'channel',
|
|
57
|
+
name: 'error',
|
|
58
|
+
description: '渠道错误',
|
|
59
|
+
fields: [
|
|
60
|
+
{ path: 'channel', type: 'string' },
|
|
61
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
62
|
+
{ path: 'status', type: 'string' },
|
|
63
|
+
{ path: 'message', type: 'string' },
|
|
64
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'channel:owner-bound',
|
|
69
|
+
namespace: 'channel',
|
|
70
|
+
name: 'owner-bound',
|
|
71
|
+
description: '渠道 owner 绑定',
|
|
72
|
+
fields: [
|
|
73
|
+
{ path: 'channel', type: 'string' },
|
|
74
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
75
|
+
{ path: 'userId', type: 'string' },
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'session:created',
|
|
80
|
+
namespace: 'session',
|
|
81
|
+
name: 'created',
|
|
82
|
+
description: '会话创建',
|
|
83
|
+
fields: [
|
|
84
|
+
{ path: 'sessionId', type: 'string' },
|
|
85
|
+
{ path: 'channel', type: 'string' },
|
|
86
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
87
|
+
{ path: 'channelId', type: 'string' },
|
|
88
|
+
{ path: 'projectPath', type: 'string', optional: true },
|
|
89
|
+
{ path: 'name', type: 'string', optional: true },
|
|
90
|
+
{ path: 'chatType', type: 'string', optional: true },
|
|
91
|
+
{ path: 'threadId', type: 'string', optional: true },
|
|
92
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: 'session:switched',
|
|
97
|
+
namespace: 'session',
|
|
98
|
+
name: 'switched',
|
|
99
|
+
description: '会话切换',
|
|
100
|
+
fields: [
|
|
101
|
+
{ path: 'sessionId', type: 'string' },
|
|
102
|
+
{ path: 'fromSessionId', type: 'string' },
|
|
103
|
+
{ path: 'toSessionId', type: 'string' },
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
type: 'session:deleted',
|
|
108
|
+
namespace: 'session',
|
|
109
|
+
name: 'deleted',
|
|
110
|
+
description: '会话删除',
|
|
111
|
+
fields: [{ path: 'sessionId', type: 'string' }],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'session:renamed',
|
|
115
|
+
namespace: 'session',
|
|
116
|
+
name: 'renamed',
|
|
117
|
+
description: '会话重命名',
|
|
118
|
+
fields: [
|
|
119
|
+
{ path: 'sessionId', type: 'string' },
|
|
120
|
+
{ path: 'oldName', type: 'string' },
|
|
121
|
+
{ path: 'newName', type: 'string' },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: 'session:forked',
|
|
126
|
+
namespace: 'session',
|
|
127
|
+
name: 'forked',
|
|
128
|
+
description: '会话 fork',
|
|
129
|
+
fields: [
|
|
130
|
+
{ path: 'sessionId', type: 'string' },
|
|
131
|
+
{ path: 'sourceSessionId', type: 'string' },
|
|
132
|
+
{ path: 'name', type: 'string', optional: true },
|
|
133
|
+
{ path: 'threadId', type: 'string', optional: true },
|
|
134
|
+
{ path: 'sourceAssistantMessageId', type: 'string', optional: true },
|
|
135
|
+
{ path: 'sourceTurn', type: 'number', optional: true },
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: 'session:rewind',
|
|
140
|
+
namespace: 'session',
|
|
141
|
+
name: 'rewind',
|
|
142
|
+
description: '会话回退',
|
|
143
|
+
fields: [
|
|
144
|
+
{ path: 'sessionId', type: 'string' },
|
|
145
|
+
{ path: 'turnNum', type: 'number' },
|
|
146
|
+
{ path: 'mode', type: 'string' },
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: 'session:imported',
|
|
151
|
+
namespace: 'session',
|
|
152
|
+
name: 'imported',
|
|
153
|
+
description: '导入 agent 会话',
|
|
154
|
+
fields: [
|
|
155
|
+
{ path: 'sessionId', type: 'string' },
|
|
156
|
+
{ path: 'agentSessionId', type: 'string' },
|
|
157
|
+
{ path: 'projectPath', type: 'string' },
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
type: 'message:received',
|
|
162
|
+
namespace: 'message',
|
|
163
|
+
name: 'received',
|
|
164
|
+
description: '消息到达',
|
|
165
|
+
fields: [
|
|
166
|
+
{ path: 'sessionId', type: 'string' },
|
|
167
|
+
{ path: 'channel', type: 'string' },
|
|
168
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
169
|
+
{ path: 'channelId', type: 'string' },
|
|
170
|
+
{ path: 'content', type: 'string' },
|
|
171
|
+
{ path: 'userId', type: 'string', optional: true },
|
|
172
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
173
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: 'message:sent',
|
|
178
|
+
namespace: 'message',
|
|
179
|
+
name: 'sent',
|
|
180
|
+
description: '消息发送',
|
|
181
|
+
fields: [
|
|
182
|
+
{ path: 'sessionId', type: 'string' },
|
|
183
|
+
{ path: 'channel', type: 'string' },
|
|
184
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
185
|
+
{ path: 'channelId', type: 'string' },
|
|
186
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
187
|
+
{ path: 'payloadKind', type: 'string', optional: true },
|
|
188
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: 'message:text',
|
|
193
|
+
namespace: 'message',
|
|
194
|
+
name: 'text',
|
|
195
|
+
description: 'agent 文本流输出',
|
|
196
|
+
fields: [
|
|
197
|
+
{ path: 'sessionId', type: 'string' },
|
|
198
|
+
{ path: 'text', type: 'string' },
|
|
199
|
+
{ path: 'isFinal', type: 'boolean' },
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
type: 'message:thought-put',
|
|
204
|
+
namespace: 'message',
|
|
205
|
+
name: 'thought-put',
|
|
206
|
+
description: 'agent thought/progress 输出',
|
|
207
|
+
fields: [
|
|
208
|
+
{ path: 'agentName', type: 'string' },
|
|
209
|
+
{ path: 'channelId', type: 'string' },
|
|
210
|
+
{ path: 'taskId', type: 'string', optional: true },
|
|
211
|
+
{ path: 'text', type: 'string', optional: true },
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: 'task:started',
|
|
216
|
+
namespace: 'task',
|
|
217
|
+
name: 'started',
|
|
218
|
+
description: 'agent 任务开始',
|
|
219
|
+
fields: [
|
|
220
|
+
{ path: 'sessionId', type: 'string' },
|
|
221
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
222
|
+
{ path: 'encrypt', type: 'boolean', optional: true },
|
|
223
|
+
{ path: 'chatmode', type: 'string', optional: true },
|
|
224
|
+
],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
type: 'task:queued',
|
|
228
|
+
namespace: 'task',
|
|
229
|
+
name: 'queued',
|
|
230
|
+
description: '任务入队',
|
|
231
|
+
fields: [
|
|
232
|
+
{ path: 'channel', type: 'string' },
|
|
233
|
+
{ path: 'channelId', type: 'string' },
|
|
234
|
+
{ path: 'replyContext', type: 'object', optional: true },
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
type: 'task:completed',
|
|
239
|
+
namespace: 'task',
|
|
240
|
+
name: 'completed',
|
|
241
|
+
description: 'agent 任务完成',
|
|
242
|
+
fields: [
|
|
243
|
+
{ path: 'sessionId', type: 'string' },
|
|
244
|
+
{ path: 'channel', type: 'string' },
|
|
245
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
246
|
+
{ path: 'channelId', type: 'string' },
|
|
247
|
+
{ path: 'finalText', type: 'string', optional: true },
|
|
248
|
+
{ path: 'durationMs', type: 'number', optional: true },
|
|
249
|
+
{ path: 'terminalReason', type: 'string', optional: true },
|
|
250
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
251
|
+
{ path: 'numTurns', type: 'number', optional: true },
|
|
252
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
type: 'task:error',
|
|
257
|
+
namespace: 'task',
|
|
258
|
+
name: 'error',
|
|
259
|
+
description: 'agent 任务失败',
|
|
260
|
+
fields: [
|
|
261
|
+
{ path: 'sessionId', type: 'string' },
|
|
262
|
+
{ path: 'error', type: 'string' },
|
|
263
|
+
{ path: 'errorType', type: 'string' },
|
|
264
|
+
{ path: 'terminalReason', type: 'string', optional: true },
|
|
265
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
type: 'task:interrupted',
|
|
270
|
+
namespace: 'task',
|
|
271
|
+
name: 'interrupted',
|
|
272
|
+
description: 'agent 任务被中断',
|
|
273
|
+
fields: [
|
|
274
|
+
{ path: 'sessionId', type: 'string' },
|
|
275
|
+
{ path: 'reason', type: 'string', optional: true },
|
|
276
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: 'tool:use',
|
|
281
|
+
namespace: 'tool',
|
|
282
|
+
name: 'use',
|
|
283
|
+
description: '工具调用开始',
|
|
284
|
+
fields: [
|
|
285
|
+
{ path: 'sessionId', type: 'string' },
|
|
286
|
+
{ path: 'toolName', type: 'string' },
|
|
287
|
+
{ path: 'input', type: 'object' },
|
|
288
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
type: 'tool:result',
|
|
293
|
+
namespace: 'tool',
|
|
294
|
+
name: 'result',
|
|
295
|
+
description: '工具调用结束',
|
|
296
|
+
fields: [
|
|
297
|
+
{ path: 'sessionId', type: 'string' },
|
|
298
|
+
{ path: 'toolName', type: 'string' },
|
|
299
|
+
{ path: 'isError', type: 'boolean', optional: true },
|
|
300
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
301
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
302
|
+
],
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
type: 'permission:requested',
|
|
306
|
+
namespace: 'permission',
|
|
307
|
+
name: 'requested',
|
|
308
|
+
description: '权限请求创建',
|
|
309
|
+
fields: [
|
|
310
|
+
{ path: 'sessionId', type: 'string' },
|
|
311
|
+
{ path: 'requestId', type: 'string' },
|
|
312
|
+
{ path: 'toolName', type: 'string' },
|
|
313
|
+
{ path: 'input', type: 'string' },
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
type: 'permission:resolved',
|
|
318
|
+
namespace: 'permission',
|
|
319
|
+
name: 'resolved',
|
|
320
|
+
description: '权限请求被批准或拒绝',
|
|
321
|
+
fields: [
|
|
322
|
+
{ path: 'sessionId', type: 'string' },
|
|
323
|
+
{ path: 'requestId', type: 'string' },
|
|
324
|
+
{ path: 'approved', type: 'boolean' },
|
|
325
|
+
{ path: 'toolName', type: 'string', optional: true },
|
|
326
|
+
{ path: 'reason', type: 'string', optional: true },
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
type: 'permission:cancelled',
|
|
331
|
+
namespace: 'permission',
|
|
332
|
+
name: 'cancelled',
|
|
333
|
+
description: 'pending 权限请求被取消',
|
|
334
|
+
fields: [
|
|
335
|
+
{ path: 'sessionId', type: 'string' },
|
|
336
|
+
{ path: 'requestId', type: 'string' },
|
|
337
|
+
{ path: 'toolName', type: 'string', optional: true },
|
|
338
|
+
{ path: 'reason', type: 'string', optional: true },
|
|
339
|
+
],
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
type: 'runner:compact-start',
|
|
343
|
+
namespace: 'runner',
|
|
344
|
+
name: 'compact-start',
|
|
345
|
+
description: 'runner 开始压缩',
|
|
346
|
+
fields: [{ path: 'sessionId', type: 'string' }],
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
type: 'runner:compact-complete',
|
|
350
|
+
namespace: 'runner',
|
|
351
|
+
name: 'compact-complete',
|
|
352
|
+
description: 'runner 压缩完成',
|
|
353
|
+
fields: [
|
|
354
|
+
{ path: 'sessionId', type: 'string' },
|
|
355
|
+
{ path: 'preTokens', type: 'number' },
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
type: 'runner:model-changed',
|
|
360
|
+
namespace: 'runner',
|
|
361
|
+
name: 'model-changed',
|
|
362
|
+
description: '模型或推理强度修改',
|
|
363
|
+
fields: [
|
|
364
|
+
{ path: 'sessionId', type: 'string', optional: true },
|
|
365
|
+
{ path: 'agentName', type: 'string', optional: true },
|
|
366
|
+
{ path: 'baseagent', type: 'string', optional: true },
|
|
367
|
+
{ path: 'model', type: 'string', optional: true },
|
|
368
|
+
{ path: 'effort', type: 'string', optional: true },
|
|
369
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
370
|
+
],
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
type: 'runner:idle-timeout',
|
|
374
|
+
namespace: 'runner',
|
|
375
|
+
name: 'idle-timeout',
|
|
376
|
+
description: 'runner 空闲超时',
|
|
377
|
+
fields: [
|
|
378
|
+
{ path: 'sessionId', type: 'string' },
|
|
379
|
+
{ path: 'idleSec', type: 'number' },
|
|
380
|
+
],
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
type: 'runner:idle-notify',
|
|
384
|
+
namespace: 'runner',
|
|
385
|
+
name: 'idle-notify',
|
|
386
|
+
description: 'runner 空闲提醒',
|
|
387
|
+
fields: [
|
|
388
|
+
{ path: 'sessionId', type: 'string' },
|
|
389
|
+
{ path: 'idleSec', type: 'number' },
|
|
390
|
+
{ path: 'totalEvents', type: 'number' },
|
|
391
|
+
{ path: 'totalToolCalls', type: 'number' },
|
|
392
|
+
{ path: 'lastToolName', type: 'string', optional: true },
|
|
393
|
+
],
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
type: 'runner:idle-warn',
|
|
397
|
+
namespace: 'runner',
|
|
398
|
+
name: 'idle-warn',
|
|
399
|
+
description: 'runner 空闲警告',
|
|
400
|
+
fields: [
|
|
401
|
+
{ path: 'sessionId', type: 'string' },
|
|
402
|
+
{ path: 'idleSec', type: 'number' },
|
|
403
|
+
{ path: 'totalEvents', type: 'number' },
|
|
404
|
+
{ path: 'totalToolCalls', type: 'number' },
|
|
405
|
+
{ path: 'lastToolName', type: 'string', optional: true },
|
|
406
|
+
],
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
type: 'runner:file-sent',
|
|
410
|
+
namespace: 'runner',
|
|
411
|
+
name: 'file-sent',
|
|
412
|
+
description: '文件发送完成',
|
|
413
|
+
fields: [
|
|
414
|
+
{ path: 'sessionId', type: 'string' },
|
|
415
|
+
{ path: 'filePath', type: 'string' },
|
|
416
|
+
{ path: 'channel', type: 'string' },
|
|
417
|
+
{ path: 'channelName', type: 'string', optional: true },
|
|
418
|
+
],
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
type: 'runner:state-changed',
|
|
422
|
+
namespace: 'runner',
|
|
423
|
+
name: 'state-changed',
|
|
424
|
+
description: 'runner 状态变化',
|
|
425
|
+
fields: [
|
|
426
|
+
{ path: 'sessionId', type: 'string' },
|
|
427
|
+
{ path: 'state', type: 'string' },
|
|
428
|
+
],
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
type: 'runner:status',
|
|
432
|
+
namespace: 'runner',
|
|
433
|
+
name: 'status',
|
|
434
|
+
description: 'runner 状态消息',
|
|
435
|
+
fields: [
|
|
436
|
+
{ path: 'sessionId', type: 'string' },
|
|
437
|
+
{ path: 'subtype', type: 'string' },
|
|
438
|
+
{ path: 'message', type: 'string' },
|
|
439
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
440
|
+
],
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
type: 'self-heal:started',
|
|
444
|
+
namespace: 'self-heal',
|
|
445
|
+
name: 'started',
|
|
446
|
+
description: '自愈流程开始',
|
|
447
|
+
fields: [{ path: 'reason', type: 'string' }],
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
type: 'self-heal:attempt',
|
|
451
|
+
namespace: 'self-heal',
|
|
452
|
+
name: 'attempt',
|
|
453
|
+
description: '自愈尝试',
|
|
454
|
+
fields: [
|
|
455
|
+
{ path: 'attemptNumber', type: 'number' },
|
|
456
|
+
{ path: 'maxAttempts', type: 'number' },
|
|
457
|
+
],
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
type: 'self-heal:completed',
|
|
461
|
+
namespace: 'self-heal',
|
|
462
|
+
name: 'completed',
|
|
463
|
+
description: '自愈完成',
|
|
464
|
+
fields: [
|
|
465
|
+
{ path: 'success', type: 'boolean' },
|
|
466
|
+
{ path: 'attempts', type: 'number' },
|
|
467
|
+
],
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
type: 'trigger:registered',
|
|
471
|
+
namespace: 'trigger',
|
|
472
|
+
name: 'registered',
|
|
473
|
+
description: 'trigger 创建',
|
|
474
|
+
internal: true,
|
|
475
|
+
fields: [
|
|
476
|
+
{ path: 'triggerId', type: 'string' },
|
|
477
|
+
{ path: 'name', type: 'string' },
|
|
478
|
+
{ path: 'peerId', type: 'string', optional: true },
|
|
479
|
+
{ path: 'targetChannel', type: 'string', optional: true },
|
|
480
|
+
{ path: 'targetChannelId', type: 'string', optional: true },
|
|
481
|
+
{ path: 'scheduleType', type: 'string' },
|
|
482
|
+
{ path: 'scheduleValue', type: 'string' },
|
|
483
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
484
|
+
],
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
type: 'trigger:updated',
|
|
488
|
+
namespace: 'trigger',
|
|
489
|
+
name: 'updated',
|
|
490
|
+
description: 'trigger 更新',
|
|
491
|
+
internal: true,
|
|
492
|
+
fields: [
|
|
493
|
+
{ path: 'triggerId', type: 'string' },
|
|
494
|
+
{ path: 'name', type: 'string' },
|
|
495
|
+
{ path: 'peerId', type: 'string', optional: true },
|
|
496
|
+
{ path: 'scheduleType', type: 'string' },
|
|
497
|
+
{ path: 'scheduleValue', type: 'string' },
|
|
498
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
499
|
+
],
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
type: 'trigger:fired',
|
|
503
|
+
namespace: 'trigger',
|
|
504
|
+
name: 'fired',
|
|
505
|
+
description: 'trigger run 开始',
|
|
506
|
+
internal: true,
|
|
507
|
+
fields: [
|
|
508
|
+
{ path: 'triggerId', type: 'string' },
|
|
509
|
+
{ path: 'name', type: 'string' },
|
|
510
|
+
{ path: 'runId', type: 'string' },
|
|
511
|
+
{ path: 'originTriggerId', type: 'string' },
|
|
512
|
+
{ path: 'fireTime', type: 'number' },
|
|
513
|
+
{ path: 'targetChannel', type: 'string', optional: true },
|
|
514
|
+
{ path: 'targetChannelId', type: 'string', optional: true },
|
|
515
|
+
{ path: 'scheduleType', type: 'string' },
|
|
516
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
517
|
+
],
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
type: 'trigger:completed',
|
|
521
|
+
namespace: 'trigger',
|
|
522
|
+
name: 'completed',
|
|
523
|
+
description: 'trigger run 完成',
|
|
524
|
+
internal: true,
|
|
525
|
+
fields: [
|
|
526
|
+
{ path: 'triggerId', type: 'string' },
|
|
527
|
+
{ path: 'name', type: 'string' },
|
|
528
|
+
{ path: 'runId', type: 'string' },
|
|
529
|
+
{ path: 'originTriggerId', type: 'string' },
|
|
530
|
+
{ path: 'messageId', type: 'string' },
|
|
531
|
+
{ path: 'durationMs', type: 'number' },
|
|
532
|
+
{ path: 'targetChannel', type: 'string' },
|
|
533
|
+
{ path: 'targetChannelId', type: 'string' },
|
|
534
|
+
{ path: 'fireTime', type: 'number' },
|
|
535
|
+
],
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
type: 'trigger:failed',
|
|
539
|
+
namespace: 'trigger',
|
|
540
|
+
name: 'failed',
|
|
541
|
+
description: 'trigger run 失败',
|
|
542
|
+
internal: true,
|
|
543
|
+
fields: [
|
|
544
|
+
{ path: 'triggerId', type: 'string' },
|
|
545
|
+
{ path: 'name', type: 'string' },
|
|
546
|
+
{ path: 'runId', type: 'string' },
|
|
547
|
+
{ path: 'originTriggerId', type: 'string' },
|
|
548
|
+
{ path: 'messageId', type: 'string' },
|
|
549
|
+
{ path: 'error', type: 'string' },
|
|
550
|
+
{ path: 'targetChannel', type: 'string' },
|
|
551
|
+
{ path: 'targetChannelId', type: 'string' },
|
|
552
|
+
{ path: 'fireTime', type: 'number' },
|
|
553
|
+
{ path: 'phase', type: 'string' },
|
|
554
|
+
],
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
type: 'trigger:skipped',
|
|
558
|
+
namespace: 'trigger',
|
|
559
|
+
name: 'skipped',
|
|
560
|
+
description: 'trigger run 跳过',
|
|
561
|
+
internal: true,
|
|
562
|
+
fields: [
|
|
563
|
+
{ path: 'triggerId', type: 'string' },
|
|
564
|
+
{ path: 'name', type: 'string' },
|
|
565
|
+
{ path: 'runId', type: 'string' },
|
|
566
|
+
{ path: 'originTriggerId', type: 'string' },
|
|
567
|
+
{ path: 'reason', type: 'string' },
|
|
568
|
+
{ path: 'targetChannel', type: 'string' },
|
|
569
|
+
{ path: 'targetChannelId', type: 'string' },
|
|
570
|
+
{ path: 'fireTime', type: 'number', optional: true },
|
|
571
|
+
],
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
type: 'trigger:cancelled',
|
|
575
|
+
namespace: 'trigger',
|
|
576
|
+
name: 'cancelled',
|
|
577
|
+
description: 'trigger 被取消',
|
|
578
|
+
internal: true,
|
|
579
|
+
fields: [
|
|
580
|
+
{ path: 'triggerId', type: 'string' },
|
|
581
|
+
{ path: 'name', type: 'string' },
|
|
582
|
+
{ path: 'by', type: 'string' },
|
|
583
|
+
],
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
type: 'agent:created',
|
|
587
|
+
namespace: 'agent',
|
|
588
|
+
name: 'created',
|
|
589
|
+
description: 'agent 创建',
|
|
590
|
+
fields: [
|
|
591
|
+
{ path: 'aid', type: 'string' },
|
|
592
|
+
{ path: 'name', type: 'string', optional: true },
|
|
593
|
+
{ path: 'baseagent', type: 'string', optional: true },
|
|
594
|
+
{ path: 'projectPath', type: 'string', optional: true },
|
|
595
|
+
{ path: 'owner', type: 'string', optional: true },
|
|
596
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
597
|
+
],
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
type: 'agent:bootstrap-started',
|
|
601
|
+
namespace: 'agent',
|
|
602
|
+
name: 'bootstrap-started',
|
|
603
|
+
description: 'agent bootstrap 开始',
|
|
604
|
+
fields: [
|
|
605
|
+
{ path: 'aid', type: 'string' },
|
|
606
|
+
{ path: 'channel', type: 'string', optional: true },
|
|
607
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
608
|
+
],
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
type: 'agent:bootstrap-complete',
|
|
612
|
+
namespace: 'agent',
|
|
613
|
+
name: 'bootstrap-complete',
|
|
614
|
+
description: 'agent bootstrap 完成',
|
|
615
|
+
fields: [
|
|
616
|
+
{ path: 'aid', type: 'string' },
|
|
617
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
618
|
+
],
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
type: 'agent:updated',
|
|
622
|
+
namespace: 'agent',
|
|
623
|
+
name: 'updated',
|
|
624
|
+
description: 'agent 配置更新',
|
|
625
|
+
fields: [
|
|
626
|
+
{ path: 'aid', type: 'string' },
|
|
627
|
+
{ path: 'nameChanged', type: 'boolean', optional: true },
|
|
628
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
629
|
+
],
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
type: 'agent:avatar_updated',
|
|
633
|
+
namespace: 'agent',
|
|
634
|
+
name: 'avatar_updated',
|
|
635
|
+
description: 'agent 头像更新',
|
|
636
|
+
fields: [
|
|
637
|
+
{ path: 'aid', type: 'string' },
|
|
638
|
+
{ path: 'avatar', type: 'string' },
|
|
639
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
640
|
+
],
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
type: 'agent:reloaded',
|
|
644
|
+
namespace: 'agent',
|
|
645
|
+
name: 'reloaded',
|
|
646
|
+
description: 'agent 重载',
|
|
647
|
+
fields: [
|
|
648
|
+
{ path: 'aid', type: 'string' },
|
|
649
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
650
|
+
],
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
type: 'agent:enabled',
|
|
654
|
+
namespace: 'agent',
|
|
655
|
+
name: 'enabled',
|
|
656
|
+
description: 'agent 启用',
|
|
657
|
+
fields: [
|
|
658
|
+
{ path: 'aid', type: 'string' },
|
|
659
|
+
{ path: 'reloaded', type: 'boolean', optional: true },
|
|
660
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
661
|
+
],
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
type: 'agent:disabled',
|
|
665
|
+
namespace: 'agent',
|
|
666
|
+
name: 'disabled',
|
|
667
|
+
description: 'agent 禁用',
|
|
668
|
+
fields: [
|
|
669
|
+
{ path: 'aid', type: 'string' },
|
|
670
|
+
{ path: 'reloaded', type: 'boolean', optional: true },
|
|
671
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
672
|
+
],
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
type: 'agent:deleted',
|
|
676
|
+
namespace: 'agent',
|
|
677
|
+
name: 'deleted',
|
|
678
|
+
description: 'agent 删除',
|
|
679
|
+
fields: [
|
|
680
|
+
{ path: 'aid', type: 'string' },
|
|
681
|
+
{ path: 'purged', type: 'boolean', optional: true },
|
|
682
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
683
|
+
],
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
type: 'agent:started',
|
|
687
|
+
namespace: 'agent',
|
|
688
|
+
name: 'started',
|
|
689
|
+
description: 'agent 运行态启动',
|
|
690
|
+
fields: [
|
|
691
|
+
{ path: 'aid', type: 'string' },
|
|
692
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
693
|
+
],
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
type: 'agent:stopped',
|
|
697
|
+
namespace: 'agent',
|
|
698
|
+
name: 'stopped',
|
|
699
|
+
description: 'agent 运行态停止',
|
|
700
|
+
fields: [
|
|
701
|
+
{ path: 'aid', type: 'string' },
|
|
702
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
703
|
+
],
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
type: 'agent:error',
|
|
707
|
+
namespace: 'agent',
|
|
708
|
+
name: 'error',
|
|
709
|
+
description: 'agent 操作失败',
|
|
710
|
+
fields: [
|
|
711
|
+
{ path: 'aid', type: 'string' },
|
|
712
|
+
{ path: 'action', type: 'string', optional: true },
|
|
713
|
+
{ path: 'error', type: 'string' },
|
|
714
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
715
|
+
],
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
type: 'agent:baseagent-changed',
|
|
719
|
+
namespace: 'agent',
|
|
720
|
+
name: 'baseagent-changed',
|
|
721
|
+
description: 'agent 默认 baseagent 修改',
|
|
722
|
+
fields: [
|
|
723
|
+
{ path: 'aid', type: 'string' },
|
|
724
|
+
{ path: 'baseagent', type: 'string' },
|
|
725
|
+
{ path: 'previousBaseagent', type: 'string', optional: true },
|
|
726
|
+
{ path: 'scope', type: 'string' },
|
|
727
|
+
{ path: 'timestamp', type: 'number', optional: true },
|
|
728
|
+
],
|
|
729
|
+
},
|
|
730
|
+
];
|
|
731
|
+
export function getEventCatalog(opts = {}) {
|
|
732
|
+
const events = CATALOG
|
|
733
|
+
.filter(entry => opts.includeInternal || !entry.internal)
|
|
734
|
+
.map(entry => ({
|
|
735
|
+
...entry,
|
|
736
|
+
fields: entry.fields.map(field => ({ ...field })),
|
|
737
|
+
}));
|
|
738
|
+
const namespaces = [...new Set(events.map(entry => entry.namespace))].sort();
|
|
739
|
+
return { namespaces, events };
|
|
740
|
+
}
|