evolcore 0.0.50 → 0.0.51
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 +39 -2
- package/bin/ec-build.mjs +60 -0
- package/bin/ecmsg.js +65 -63
- package/dist/ability/caller/command.js +24 -15
- package/dist/ability/caller/contract.js +24 -9
- package/dist/ability/caller/credential-files.js +132 -0
- package/dist/ability/caller/daemon.js +32 -7
- package/dist/ability/caller/schema-view.js +157 -0
- package/dist/ability/caller/service.js +202 -63
- package/dist/ability/interop-v1.js +156 -113
- package/dist/agent-template/jobs.js +14 -110
- package/dist/agent-template/runtime.js +331 -193
- package/dist/agent-template/service.js +1029 -1104
- package/dist/agent-template/share.js +103 -0
- package/dist/agent-template/tool-runner.js +25 -0
- package/dist/agent-template/types.js +10 -3
- package/dist/agents/claude/availability.js +94 -0
- package/dist/agents/claude/capability-provider.js +154 -0
- package/dist/agents/claude/index.js +145 -0
- package/dist/agents/{claude-runner.js → claude/runner.js} +74 -158
- package/dist/agents/claude/session-file-adapter.js +246 -0
- package/dist/agents/codex/app-server-client.js +90 -10
- package/dist/agents/codex/availability.js +164 -0
- package/dist/agents/codex/capability-provider.js +138 -0
- package/dist/agents/codex/cli.js +38 -0
- package/dist/agents/codex/index.js +345 -0
- package/dist/agents/codex/mcp-elicitation.js +135 -0
- package/dist/agents/{codex-runner.js → codex/runner.js} +648 -382
- package/dist/agents/codex/session-file-adapter.js +834 -0
- package/dist/agents/dsh/availability.js +28 -0
- package/dist/agents/dsh/capability-provider.js +56 -0
- package/dist/agents/dsh/desktop-locations.ps1 +66 -0
- package/dist/agents/dsh/desktop-probe.cjs +37 -0
- package/dist/agents/dsh/index.js +98 -0
- package/dist/agents/dsh/installation.js +400 -0
- package/dist/agents/dsh/resources.js +755 -0
- package/dist/agents/dsh/runner.js +1183 -0
- package/dist/agents/dsh/runtime/README.md +243 -0
- package/dist/agents/dsh/runtime/authorization.js +23 -0
- package/dist/agents/dsh/runtime/bridge.js +837 -0
- package/dist/agents/dsh/runtime/config.js +271 -0
- package/dist/agents/dsh/runtime/entry.js +229 -0
- package/dist/agents/dsh/runtime/session-inspector.js +340 -0
- package/dist/agents/dsh/runtime/tool-policy.js +49 -0
- package/dist/agents/dsh/session-file-adapter.js +145 -0
- package/dist/agents/ecagent/index.js +215 -0
- package/dist/agents/{ecagent-runner.js → ecagent/runner.js} +592 -106
- package/dist/agents/ecagent/session-file-adapter.js +134 -0
- package/dist/agents/gemini/index.js +55 -10
- package/dist/agents/gemini/{gemini-runner.js → runner.js} +4 -9
- package/dist/aun/ability-device-routing.js +11 -17
- package/dist/aun/aid/agentmd.js +27 -1
- package/dist/aun/aid/managed-operation.js +6 -4
- package/dist/aun/group/invite-service.js +1 -1
- package/dist/aun/menu/client.js +1 -1
- package/dist/aun/msg/history.js +1 -1
- package/dist/aun/msg/managed-operation.js +93 -21
- package/dist/aun/msg/p2p.js +6 -6
- package/dist/aun/service-proxy.js +1 -1
- package/dist/aun/storage/index.js +242 -0
- package/dist/build-identity.json +1 -1
- package/dist/channels/aun.js +180 -43
- package/dist/channels/daemon.js +3 -2
- package/dist/channels/dingtalk.js +1 -1
- package/dist/channels/feishu.js +9 -9
- package/dist/channels/qqbot.js +1 -1
- package/dist/channels/wechat.js +2 -2
- package/dist/channels/wecom.js +1 -1
- package/dist/{agents/claude-gateway → claude-gateway}/agent-registration.js +13 -13
- package/dist/{agents/claude-gateway → claude-gateway}/binding.js +3 -3
- package/dist/{agents/claude-gateway → claude-gateway}/inbox.js +1 -1
- package/dist/{agents/claude-gateway → claude-gateway}/index.js +2 -2
- package/dist/{agents/claude-gateway → claude-gateway}/listing.js +3 -3
- package/dist/{agents/claude-gateway → claude-gateway}/router.js +4 -4
- package/dist/{agents/claude-gateway → claude-gateway}/sessions.js +2 -2
- package/dist/{agents/claude-gateway → claude-gateway}/terminal.js +1 -1
- package/dist/{agents/claude-gateway → claude-gateway}/transcript.js +1 -1
- package/dist/cli/ability-command.js +8 -5
- package/dist/cli/ability-output.js +182 -0
- package/dist/cli/agent-command.js +1 -1
- package/dist/cli/agent-create.js +123 -42
- package/dist/cli/agent-template.js +400 -29
- package/dist/cli/agent.js +14 -11
- package/dist/cli/aun-commands.js +167 -111
- package/dist/cli/daemon-commands.js +38 -8
- package/dist/cli/data-command.js +1 -1
- package/dist/cli/debug-mode.js +9 -0
- package/dist/cli/directory.js +1 -2
- package/dist/cli/ecmsg-gateway.js +55 -19
- package/dist/cli/fs-command.js +67 -39
- package/dist/cli/index.js +25 -11
- package/dist/cli/init.js +124 -29
- package/dist/cli/managed-command-guard.js +2 -0
- package/dist/cli/model.js +1 -1
- package/dist/cli/restart-monitor.js +2 -2
- package/dist/cli/services-command.js +24 -1
- package/dist/cli/skill-command.js +4 -4
- package/dist/cli/task-context.js +24 -14
- package/dist/cli/team-workspace-command.js +50 -52
- package/dist/cli/thread-command.js +3 -2
- package/dist/cli/trigger-command.js +47 -12
- package/dist/cli/watch-logs.js +2 -1
- package/dist/config/boot-log.js +3 -0
- package/dist/config/builtin-role-templates.js +1 -1
- package/dist/config/config-field-policy.js +10 -6
- package/dist/config/config-manager.js +33 -12
- package/dist/config/gateway-config.js +21 -37
- package/dist/config/invoke-ipc-service.js +1 -1
- package/dist/config/owner-config.js +5 -3
- package/dist/config/peer-book-store.js +2 -3
- package/dist/config/peer-book.js +2 -2
- package/dist/config/peer-role-resolver.js +2 -2
- package/dist/config/provider-identity-migration.js +24 -105
- package/dist/config/provider-ipc-service.js +13 -3
- package/dist/config/provider-local-sync.js +4 -1
- package/dist/config/provider-menu-request.js +21 -3
- package/dist/config/provider-templates.js +1 -1
- package/dist/config/providers-config.js +39 -15
- package/dist/config/providers-import.js +3 -3
- package/dist/config/providers-management.js +74 -99
- package/dist/config/schema-migration.js +177 -11
- package/dist/config/schema-registry.js +1 -1
- package/dist/config-store.js +38 -50
- package/dist/core/{agent-application-service.js → agent/agent-application-service.js} +9 -9
- package/dist/core/{agent-create-status.js → agent/agent-create-status.js} +112 -4
- package/dist/core/{agent-creation-claim.js → agent/agent-creation-claim.js} +3 -3
- package/dist/core/{agent-ipc-registration.js → agent/agent-ipc-registration.js} +102 -25
- package/dist/core/{agent-reload-coordinator.js → agent/agent-reload-coordinator.js} +61 -1
- package/dist/core/{agent-runtime.js → agent/agent-runtime.js} +53 -27
- package/dist/core/{evolagent-registry.js → agent/evolagent-registry.js} +12 -12
- package/dist/core/{evolagent.js → agent/evolagent.js} +11 -11
- package/dist/core/auth/agent-delegation.js +1 -8
- package/dist/core/auth/delegation-authorization.js +28 -0
- package/dist/core/auth/operation-authorizer.js +7 -4
- package/dist/core/auth/operation-catalog.js +34 -5
- package/dist/core/baseagent/baseagent-availability.js +197 -0
- package/dist/core/baseagent/baseagent-capability-adapter.js +288 -0
- package/dist/core/baseagent/baseagent-config-shared.js +56 -0
- package/dist/core/baseagent/baseagent-identity.js +68 -0
- package/dist/core/{baseagent-loader.js → baseagent/baseagent-loader.js} +62 -6
- package/dist/core/baseagent/baseagent-model-defaults.js +26 -0
- package/dist/{agents → core/baseagent}/baseagent-plugin-descriptor.js +107 -24
- package/dist/core/baseagent/baseagent-plugin-loader.js +367 -0
- package/dist/core/baseagent/baseagent.js +157 -0
- package/dist/{agents → core/baseagent}/runner-types.js +36 -4
- package/dist/core/capability/capability-manager.js +79 -30
- package/dist/core/capability/providers/claude-capability-provider.js +2 -154
- package/dist/core/capability/providers/codex-capability-provider.js +2 -136
- package/dist/core/{channel-loader.js → channel/channel-loader.js} +226 -38
- package/dist/core/{channel-runtime.js → channel/channel-runtime.js} +18 -18
- package/dist/core/command/agent-control.js +60 -15
- package/dist/core/command/agent-template-menu.js +21 -9
- package/dist/core/command/agentmd-menu-request.js +19 -8
- package/dist/core/command/agentmd-menu.js +14 -5
- package/dist/core/command/command-handler.js +127 -57
- package/dist/core/command/context-policy-menu.js +122 -0
- package/dist/core/command/data-root-resolver.js +157 -20
- package/dist/core/command/memory-slash.js +6 -6
- package/dist/core/command/menu-catalog.js +80 -20
- package/dist/core/command/menu-handler.js +305 -25
- package/dist/core/command/menu-protocol.js +42 -8
- package/dist/core/command/menu-query-batch.js +9 -5
- package/dist/core/command/provider-menu.js +7 -11
- package/dist/core/command/role-menu.js +1 -1
- package/dist/core/command/skill-slash.js +17 -5
- package/dist/core/command/slash-gate.js +2 -4
- package/dist/core/command/slash-handler.js +127 -96
- package/dist/core/command/team-workspace-team.js +3 -3
- package/dist/core/command/topic-slash.js +10 -10
- package/dist/core/{daemon-bootstrap.js → daemon/daemon-bootstrap.js} +14 -14
- package/dist/core/{daemon-control.js → daemon/daemon-control.js} +46 -20
- package/dist/core/{daemon-lifecycle.js → daemon/daemon-lifecycle.js} +15 -15
- package/dist/core/{host-snapshot.js → daemon/host-snapshot.js} +3 -3
- package/dist/core/{ipc-registration.js → daemon/ipc-registration.js} +98 -38
- package/dist/core/{lifecycle-notice.js → daemon/lifecycle-notice.js} +4 -5
- package/dist/core/file-integrity/store.js +1 -1
- package/dist/core/handoff/ipc-registration.js +3 -3
- package/dist/core/handoff/runtime.js +1 -1
- package/dist/{agents → core/inference}/request-identity.js +2 -2
- package/dist/core/inference/text-inference.js +4 -4
- package/dist/core/{bootstrap-messages.js → initialization/bootstrap-messages.js} +10 -10
- package/dist/core/{bootstrap-service.js → initialization/bootstrap-service.js} +24 -23
- package/dist/core/initialization/service.js +54 -9
- package/dist/core/invoke/executors/media.js +1 -1
- package/dist/core/invoke/executors/text.js +1 -1
- package/dist/core/memory/consolidation-context.js +1 -1
- package/dist/core/memory/consolidation-trigger.js +9 -3
- package/dist/core/memory/consolidation.js +4 -4
- package/dist/core/memory/memory-admin.js +6 -6
- package/dist/core/memory/memory-writer.js +1 -1
- package/dist/core/memory/relation-idle-monitor.js +1 -1
- package/dist/core/message/aun-ipc-sender.js +114 -75
- package/dist/core/message/aun-request-registry.js +13 -5
- package/dist/core/message/auto-mention-gate.js +1 -1
- package/dist/core/message/contact-admission.js +1 -1
- package/dist/core/message/im-renderer.js +19 -0
- package/dist/core/{interaction-router.js → message/interaction-router.js} +4 -4
- package/dist/core/message/items-formatter.js +5 -5
- package/dist/core/message/message-admission.js +1 -1
- package/dist/core/message/message-bridge.js +135 -54
- package/dist/core/message/message-queue.js +83 -4
- package/dist/core/message/message-utils.js +1 -1
- package/dist/core/message/peer-mode.js +1 -1
- package/dist/core/message/response-engine.js +347 -163
- package/dist/core/message/send-options.js +9 -6
- package/dist/core/message/send-routing.js +45 -109
- package/dist/core/message/stream-idle-monitor.js +1 -1
- package/dist/core/{data-migration.js → migration/data-migration.js} +29 -1
- package/dist/core/model/catalog-service.js +29 -8
- package/dist/core/model/model-capabilities.js +88 -0
- package/dist/core/model/model-catalog.js +14 -3
- package/dist/core/model/model-diagnostics.js +4 -4
- package/dist/core/ownership/owner-resolver.js +95 -15
- package/dist/core/{pack-auth.js → pack/pack-auth.js} +30 -3
- package/dist/core/{pack-install.js → pack/pack-install.js} +95 -17
- package/dist/core/permission/approval-gateway.js +9 -18
- package/dist/core/permission/ec-command-parser.js +70 -34
- package/dist/core/permission/managed-file.js +234 -0
- package/dist/core/permission/protected-paths.js +56 -0
- package/dist/core/permission/sandbox-runtime.js +267 -3
- package/dist/core/permission/session-path-grants.js +1 -1
- package/dist/core/permission/shell-environment.js +15 -1
- package/dist/core/plugin/plugin-lifecycle.js +442 -0
- package/dist/core/session/adapters/claude-session-file-adapter.js +2 -246
- package/dist/core/session/adapters/codex-session-file-adapter.js +2 -566
- package/dist/core/session/adapters/ecagent-session-file-adapter.js +2 -134
- package/dist/core/{background-session → session/background}/session-cleanup.js +2 -2
- package/dist/core/{background-session → session/background}/types.js +1 -1
- package/dist/core/session/session-file-health.js +2 -272
- package/dist/core/session/session-idle-monitor.js +1 -1
- package/dist/core/session/session-manager.js +29 -2
- package/dist/core/session/session-terminal.js +185 -0
- package/dist/core/session/session-title.js +8 -11
- package/dist/core/{system-session → session/system}/memory.js +43 -9
- package/dist/core/{system-session → session/system}/registry.js +1 -1
- package/dist/core/{system-session → session/system}/types.js +1 -1
- package/dist/core/skill/index-generator.js +1 -0
- package/dist/core/task/task-activity-store.js +112 -0
- package/dist/core/task/task-recovery-service.js +2 -2
- package/dist/core/thread/ipc-operation.js +2 -2
- package/dist/core/thread/thread-operation.js +2 -1
- package/dist/core/thread/thread-route.js +5 -3
- package/dist/core/thread/thread-service.js +14 -4
- package/dist/directory/{owner-directory-admission.js → admission.js} +3 -3
- package/dist/directory/{owner-directory-cache.js → cache.js} +90 -8
- package/dist/directory/{owner-directory-markdown.js → markdown.js} +2 -2
- package/dist/directory/{owner-directory-query-operation.js → query-operation.js} +83 -9
- package/dist/directory/{owner-directory-search.js → search.js} +50 -2
- package/dist/directory/{owner-directory-store.js → store.js} +2 -2
- package/dist/eck/kit-renderer.js +1 -1
- package/dist/eck/manifest-engine.js +64 -2
- package/dist/eck/message-renderer.js +35 -0
- package/dist/ecweb/basic-settings-service.js +9 -3
- package/dist/{contracts → ecweb/contracts}/ecweb-service-protocol.js +2 -1
- package/dist/ecweb/dsh-native-service.js +413 -0
- package/dist/ecweb/providers-service.js +1 -1
- package/dist/ecweb/runtime/lifecycle.js +1 -1
- package/dist/ecweb/runtime/supervisor.js +1 -1
- package/dist/event-center/center-config.js +2 -2
- package/dist/event-center/dispatcher.js +1 -1
- package/dist/event-center/ipc-operation.js +12 -3
- package/dist/event-center/pack-loader.js +2 -2
- package/dist/event-center/registry.js +6 -6
- package/dist/event-center/runtime.js +2 -2
- package/dist/index.js +71 -42
- package/dist/ipc.js +103 -10
- package/dist/outputs/authorization.js +27 -0
- package/dist/outputs/events.js +10 -1
- package/dist/outputs/panel-cards.js +960 -0
- package/dist/paths.js +12 -0
- package/dist/pay/command.js +1 -1
- package/dist/pay/runtime.js +18 -10
- package/dist/response-system/engines/v1/proactive-flow.js +1 -1
- package/dist/services/dispatcher.js +2 -2
- package/dist/services/host/main.js +10 -1
- package/dist/services/host/protocol.js +9 -2
- package/dist/services/host/resident.js +37 -0
- package/dist/services/host-client.js +12 -0
- package/dist/services/host-recycle.js +8 -3
- package/dist/services/host-runtime.js +54 -15
- package/dist/services/index.js +83 -19
- package/dist/services/ipc-operation.js +303 -38
- package/dist/services/pack-manager.js +2 -2
- package/dist/services/router.js +43 -3
- package/dist/services/script-runner.js +34 -25
- package/dist/services/service-payload.js +28 -1
- package/dist/services/validation.js +28 -2
- package/dist/stats/context-usage.js +110 -0
- package/dist/stats/model-resolver.js +103 -17
- package/dist/stats/query.js +5 -0
- package/dist/trigger/application-service.js +3 -2
- package/dist/trigger/authorization.js +36 -33
- package/dist/trigger/ipc-service.js +4 -4
- package/dist/trigger/local-files.js +8 -176
- package/dist/trigger/manager.js +2 -2
- package/dist/trigger/parser.js +48 -0
- package/dist/trigger/scheduler.js +14 -2
- package/dist/trigger/script-executor.js +21 -0
- package/dist/trigger/script-sandbox.js +57 -243
- package/dist/trigger/system-definitions.js +25 -0
- package/dist/trigger/validation.js +1 -1
- package/dist/utils/atomic-write.js +88 -1
- package/dist/utils/cross-platform.js +4 -42
- package/dist/utils/error-dict.json +22 -1
- package/dist/utils/error-utils.js +193 -6
- package/dist/utils/evolcore-version.js +2 -2
- package/dist/utils/host-info.js +1 -1
- package/dist/utils/logger.js +3 -1
- package/dist/utils/media-cache.js +99 -4
- package/dist/utils/startup-trace.js +20 -4
- package/dist/utils/welcome.js +64 -20
- package/ecagent/README.md +35 -0
- package/ecagent/dist/agent-loop.js +80 -30
- package/ecagent/dist/harness/env/nodejs.d.ts +16 -0
- package/ecagent/dist/harness/env/nodejs.js +49 -20
- package/ecagent/dist/harness/messages.js +3 -2
- package/ecagent/dist/harness/types.d.ts +1 -0
- package/ecagent/dist/runtime/types.d.ts +2 -0
- package/ecagent/dist/runtime/utils/validation.d.ts +7 -1
- package/ecagent/dist/runtime/utils/validation.js +42 -0
- package/ecagent/dist/types.d.ts +2 -0
- package/kits/docs/INDEX.md +1 -1
- package/kits/docs/channels/feishu.md +1 -1
- package/kits/docs/evolcore/INDEX.md +10 -7
- package/kits/docs/evolcore/agent-create.md +2 -0
- package/kits/docs/evolcore/agent.md +100 -13
- package/kits/docs/evolcore/aid.md +19 -3
- package/kits/docs/evolcore/config.md +94 -0
- package/kits/docs/evolcore/ctl.md +2 -1
- package/kits/docs/evolcore/ec-capabilities.md +7 -10
- package/kits/docs/evolcore/ecweb-lifecycle.md +5 -1
- package/kits/docs/evolcore/event.md +1 -1
- package/kits/docs/evolcore/fs.md +49 -3
- package/kits/docs/evolcore/group.md +3 -3
- package/kits/docs/evolcore/memory-consolidation.md +1 -1
- package/kits/docs/evolcore/menu-protocol.md +24 -2
- package/kits/docs/evolcore/model.md +9 -1
- package/kits/docs/evolcore/msg.md +30 -28
- package/kits/docs/evolcore/pay.md +8 -20
- package/kits/docs/evolcore/plugin.md +74 -0
- package/kits/docs/evolcore/provider.md +8 -2
- package/kits/docs/evolcore/rpc.md +2 -2
- package/kits/docs/evolcore/skill.md +17 -1
- package/kits/docs/evolcore/stats.md +5 -0
- package/kits/docs/evolcore/storage.md +22 -0
- package/kits/docs/evolcore/thread-chain.md +19 -10
- package/kits/docs/evolcore/tool-authorization.md +4 -0
- package/kits/docs/evolcore/trigger.md +89 -13
- package/kits/docs/identity/AID_PROFILE_SPEC.md +1 -1
- package/kits/docs/venues/feishu-group.md +3 -2
- package/kits/docs/venues/feishu-private.md +3 -2
- package/kits/rules/02-navigation.md +20 -13
- package/kits/rules/06-channel.md +18 -2
- package/kits/schemas/_meta.json +8 -4
- package/kits/schemas/agent-config.schema.23.json +19 -3
- package/kits/schemas/agent-config.schema.24.json +986 -0
- package/kits/schemas/agent-config.schema.25.json +986 -0
- package/kits/schemas/daemon.schema.11.json +487 -0
- package/kits/schemas/daemon.schema.12.json +505 -0
- package/kits/schemas/defaults.schema.8.json +484 -0
- package/kits/schemas/providers.schema.1.json +1 -1
- package/kits/schemas/providers.schema.2.json +1 -1
- package/kits/schemas/providers.schema.3.json +8 -2
- package/kits/skills/.switches.json +4 -0
- package/kits/skills/ability/SKILL.md +194 -27
- package/kits/skills/ability/STRUCTURE.md +5 -0
- package/kits/skills/agent-output-cards/SKILL.md +90 -54
- package/kits/skills/agent-output-cards/examples/html-surface.json +11 -0
- package/kits/skills/agent-output-cards/examples/meeting-followups.json +16 -0
- package/kits/skills/agent-output-cards/examples/meeting-latest.json +24 -0
- package/kits/skills/agent-output-cards/examples/project-metrics.json +16 -0
- package/kits/skills/agent-output-cards/examples/quick-links.json +18 -0
- package/kits/skills/agent-output-cards/examples/surface.html +8 -0
- package/kits/skills/agent-template-project/SKILL.md +51 -0
- package/kits/skills/agent-template-project/references/01-collect-and-pack.md +174 -0
- package/kits/skills/agent-template-project/references/02-upload-and-share.md +109 -0
- package/kits/skills/agent-template-project/references/03-download-and-install.md +189 -0
- package/kits/skills/agent-template-project/references/04-upgrade-and-recovery.md +74 -0
- package/kits/skills/agent-template-project/references/05-publish-to-platform.md +62 -0
- package/kits/skills/ec-group/SKILL.md +3 -3
- package/kits/skills/ec-group-collaboration/SKILL.md +4 -4
- package/kits/skills/ec-identity/SKILL.md +9 -6
- package/kits/skills/ec-pay/SKILL.md +163 -41
- package/kits/skills/ec-provider/SKILL.md +5 -5
- package/kits/skills/ec-service-call/SKILL.md +3 -0
- package/kits/skills/ec-skill/SKILL.md +25 -9
- package/kits/skills/ec-skill/scripts/cli.mjs +7 -7
- package/kits/skills/ec-skill/scripts/skill.mjs +55 -41
- package/kits/skills/ec-skill/scripts/template/SKILL.md.tmpl +9 -0
- package/kits/skills/ec-trigger/SKILL.md +2 -2
- package/kits/skills/personal-assistant/SKILL.md +22 -22
- package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +1 -1
- package/kits/skills/scrapling-article-fetch/SKILL.md +5 -5
- package/kits/skills/thread-ops/SKILL.md +19 -9
- package/kits/skills/wechat-article-media-download/SKILL.md +2 -2
- package/kits/skills/wechat-article-reader/SKILL.md +2 -2
- package/kits/templates/system-fragments/commands.md +1 -1
- package/kits/templates/system-fragments/personal-assistant.md +2 -2
- package/kits/templates/system-fragments/reply.md +14 -9
- package/kits/templates/system-fragments/session.md +1 -1
- package/kits/templates/system-fragments/thread.md +10 -5
- package/package.json +6 -5
- package/scripts/agent-template/index.mjs +7 -1
- package/scripts/agent-template/inspect.mjs +81 -35
- package/scripts/agent-template/overlay.mjs +110 -4
- package/scripts/agent-template/shared/common.mjs +36 -4
- package/scripts/agent-template/shared/plan.mjs +4 -2
- package/scripts/agent-template/shared/service-packs.mjs +104 -0
- package/scripts/agent-template/shared/team-schema.json +467 -54
- package/scripts/agent-template/shared/template-contract.mjs +70 -68
- package/scripts/agent-template/shared/template-package.mjs +153 -36
- package/scripts/agent-template/shared/template-runtime.mjs +76 -64
- package/scripts/agent-template/shared/template.mjs +11 -46
- package/scripts/agent-template/team-pack.mjs +451 -35
- package/scripts/agent-template/team-preview.mjs +75 -226
- package/scripts/aid-batch/identity-batch.mjs +1 -1
- package/dist/agents/baseagent-availability.js +0 -176
- package/dist/agents/baseagent-capability-adapter.js +0 -102
- package/dist/agents/baseagent-plugin-loader.js +0 -145
- package/dist/agents/baseagent.js +0 -816
- package/dist/agents/codex/catalog.js +0 -80
- package/dist/agents/ecagent-plugin-lazy.js +0 -41
- package/dist/agents/tool-time-context.js +0 -55
- package/dist/core/legacy-rename.js +0 -41
- package/dist/core/plugin-lifecycle.js +0 -137
- package/dist/core/rate-window.js +0 -53
- package/dist/core/runner-reload-transaction.js +0 -60
- package/dist/core/runtime-lock.js +0 -90
- package/dist/core/soul.js +0 -66
- package/dist/core/system-session/grants.js +0 -40
- package/dist/directory/owner-directory-agentmd-sync.js +0 -89
- package/dist/directory/owner-directory-request-operation.js +0 -79
- package/dist/directory/owner-directory-text.js +0 -60
- package/kits/skills/ec-pay/references/pay-cli.md +0 -110
- /package/dist/agents/gemini/{gemini-capability-provider.js → capability-provider.js} +0 -0
- /package/dist/agents/gemini/{gemini-session-file-adapter.js → session-file-adapter.js} +0 -0
- /package/dist/{agents/claude-gateway → claude-gateway}/types.js +0 -0
- /package/dist/core/{system-channels.js → channel/system-channels.js} +0 -0
- /package/dist/core/{daemon-file-cache.js → daemon/daemon-file-cache.js} +0 -0
- /package/dist/core/{event-bus.js → event/event-bus.js} +0 -0
- /package/dist/core/{event-catalog.js → event/event-catalog.js} +0 -0
- /package/dist/core/{pack-ledger.js → pack/pack-ledger.js} +0 -0
- /package/dist/directory/{owner-directory-identity.js → identity.js} +0 -0
- /package/dist/directory/{owner-directory-policy.js → policy.js} +0 -0
- /package/dist/directory/{owner-directory-remarks.js → remarks.js} +0 -0
- /package/dist/directory/{owner-directory-scope.js → scope.js} +0 -0
- /package/dist/{contracts → ecweb/contracts}/ecweb-instance.js +0 -0
- /package/kits/templates/{bootstrap-welcome.md → bootstrap-intro.md} +0 -0
package/dist/channels/aun.js
CHANGED
|
@@ -7,24 +7,22 @@ import crypto from 'crypto';
|
|
|
7
7
|
import { performance } from 'node:perf_hooks';
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
import { ownerResolver, OWNERSHIP_CACHE_MAX_AGE_MS } from '../core/ownership/owner-resolver.js';
|
|
10
|
-
import { OWNER_DIRECTORY_APPLY_WAIT_MS, OwnerDirectoryCache, parseOwnerDirectoryGrantAbilityResponse } from '../directory/
|
|
11
|
-
import { registerOwnerDirectoryAdmission } from '../directory/
|
|
12
|
-
import {
|
|
13
|
-
import { parseNotificationSnapshots, parseNotificationPublished } from '../directory/owner-directory-store.js';
|
|
14
|
-
import { OWNER_DIRECTORY_SCOPES } from '../directory/owner-directory-cache.js';
|
|
10
|
+
import { OWNER_DIRECTORY_APPLY_WAIT_MS, OwnerDirectoryCache, parseOwnerDirectoryGrantAbilityResponse, OwnerDirectoryAgentMdSync, OWNER_DIRECTORY_SCOPES } from '../directory/cache.js';
|
|
11
|
+
import { registerOwnerDirectoryAdmission } from '../directory/admission.js';
|
|
12
|
+
import { parseNotificationSnapshots, parseNotificationPublished } from '../directory/store.js';
|
|
15
13
|
import path from 'path';
|
|
16
14
|
import os from 'os';
|
|
17
15
|
import { logger, localTimestamp, logPreview } from '../utils/logger.js';
|
|
18
16
|
import { ensureSessionRuntimeDir } from '../cli/task-context.js';
|
|
19
17
|
import { LogWriter } from '../utils/log-writer.js';
|
|
20
|
-
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel-loader.js';
|
|
18
|
+
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel/channel-loader.js';
|
|
21
19
|
import { DEFAULT_FLUSH_DELAY_SECONDS } from '../types.js';
|
|
22
20
|
import { resolvePaths, agentDir as agentDirPath, resolveRoot, channelStatePath, toAttachmentMarkedPath, } from '../paths.js';
|
|
23
21
|
import { getAunRequestRegistry, MAX_AUN_VOLATILE_TTL_SECONDS } from '../core/message/aun-request-registry.js';
|
|
24
22
|
import { AbilityError } from '../ability/types.js';
|
|
25
23
|
import { publishAbilityDocuments } from '../ability/publication.js';
|
|
26
24
|
import { resolveAunSendDevice } from '../aun/ability-device-routing.js';
|
|
27
|
-
import { saveRelationAttachment, sanitizeFileName, bufferToInboundImage, safeFetch } from '../utils/media-cache.js';
|
|
25
|
+
import { saveRelationAttachment, sanitizeFileName, bufferToInboundImage, safeFetch, formatAttachmentMarker } from '../utils/media-cache.js';
|
|
28
26
|
import { appendAidEvent } from '../utils/instance-registry.js';
|
|
29
27
|
import { appendMessageLog, appendMessageLogStrict, buildOutboundEntry, buildInboundEntry, classifyAunPayloadForLog, findLatestMessageLogOperation, findMessageLogOperationMessageId, hasMessageLogOperation } from '../core/message/message-log.js';
|
|
30
28
|
import { createSendFileMarkerPattern } from '../core/message/file-markers.js';
|
|
@@ -48,7 +46,8 @@ import { normalizeAunMentionMode, normalizeMentionMode } from '../config/mention
|
|
|
48
46
|
import { getProcessStartTime } from '../utils/process-introspect.js';
|
|
49
47
|
import * as outbox from '../aun/outbox.js';
|
|
50
48
|
import { recordTemplateNoticeReceipt } from '../agent-template/jobs.js';
|
|
51
|
-
import {
|
|
49
|
+
import { parseTemplateShare, saveTemplateShare, templateShareText, TEMPLATE_SHARE_TYPE } from '../agent-template/share.js';
|
|
50
|
+
import { acceptWidgetCardReply, cancelWidgetCard, readWidgetCard, registerWidgetCard } from '../core/message/interaction-router.js';
|
|
52
51
|
import { formatSize } from '../utils/media-cache.js';
|
|
53
52
|
import { formatPeerKey, PeerIdentityCache } from '../core/relation/peer-identity.js';
|
|
54
53
|
import { prepareSameOwnerProof, registerSameOwnerClient, unregisterSameOwnerClient } from '../core/relation/same-owner-proof.js';
|
|
@@ -61,7 +60,7 @@ import { buildControlAgentName, ensureControlAgentMd } from '../aun/aid/control-
|
|
|
61
60
|
import { errorTextContainsRaw, readInstalledEvolcoreVersion } from '../utils/evolcore-version.js';
|
|
62
61
|
import { ManagedMenuClient, menuSenderDeviceId, menuTransportParams, } from '../aun/menu/index.js';
|
|
63
62
|
import { toolInputForDisplay } from '../utils/tool-summary.js';
|
|
64
|
-
import { bindPostBootstrapWelcomeOutboxSession, hasPendingPostBootstrapWelcomeOutbox, pendingPostBootstrapWelcomeOwners, isPostBootstrapWelcomeOperationId, findPostBootstrapWelcomeOutbox, bootstrapInitialMessageOperationPrefix, postBootstrapWelcomeOperationId, preparePostBootstrapWelcomeOutbox, postBootstrapWelcomeStatus, } from '../core/bootstrap-messages.js';
|
|
63
|
+
import { bindPostBootstrapWelcomeOutboxSession, hasPendingPostBootstrapWelcomeOutbox, pendingPostBootstrapWelcomeOwners, isPostBootstrapWelcomeOperationId, findPostBootstrapWelcomeOutbox, bootstrapInitialMessageOperationPrefix, postBootstrapWelcomeOperationId, preparePostBootstrapWelcomeOutbox, postBootstrapWelcomeStatus, } from '../core/initialization/bootstrap-messages.js';
|
|
65
64
|
import { hasMentionAll, mentionEntryAids, mentionEntryTargets, } from '../core/message/mention-schema.js';
|
|
66
65
|
import { aunOutboundAttention, normalizeAunMentionEntries, parseAunAttention, withAunAttention, } from '../aun/msg/mention-schema.js';
|
|
67
66
|
import { isDeliveryTarget, sameDeliveryTarget } from '../core/message/message-utils.js';
|
|
@@ -1111,6 +1110,13 @@ export class AUNChannel {
|
|
|
1111
1110
|
*/
|
|
1112
1111
|
callClient(method, params, lane = 'normal', onStart, onPrepared, beforeSend) {
|
|
1113
1112
|
params = menuTransportParams(method, params);
|
|
1113
|
+
if (method === 'message.send' && typeof params.payload?.type === 'string'
|
|
1114
|
+
&& (params.payload.type === 'menu.response' || params.payload.type === 'menu.event')) {
|
|
1115
|
+
logger.info(`${this.logPrefix()} menu.send prepared type=${params.payload.type} `
|
|
1116
|
+
+ `request_id=${typeof params.payload.id === 'string' ? params.payload.id : '<none>'} `
|
|
1117
|
+
+ `target_device_id=${menuSenderDeviceId(params.to_device_id) ?? '<aid-broadcast>'} `
|
|
1118
|
+
+ `message_class=${params.message_class ?? '<none>'} ttl=${params.ttl ?? 0}`);
|
|
1119
|
+
}
|
|
1114
1120
|
const client = this.client;
|
|
1115
1121
|
const friendPayload = (typeof params.payload?.type === 'string' && params.payload.type.startsWith('friend.'))
|
|
1116
1122
|
|| isContactApprovalCard(params.payload);
|
|
@@ -1478,7 +1484,7 @@ export class AUNChannel {
|
|
|
1478
1484
|
}
|
|
1479
1485
|
// compose 按钮由新版客户端在卡片内采集输入;旧版客户端可继续从主编辑器
|
|
1480
1486
|
// 采集。两者最终都回传 action_card_reply{behavior:"compose", text}。
|
|
1481
|
-
// 映射为 _custom_input + values.custom_text,复用
|
|
1487
|
+
// 映射为 _custom_input + values.custom_text,复用 Claude runner 已有的自定义输入分支
|
|
1482
1488
|
// (原为多选表单提交而设),不需要新增 action 类型,也不必拦截消息队列。
|
|
1483
1489
|
const behaviorRaw = typeof obj.behavior === 'string' ? obj.behavior : undefined;
|
|
1484
1490
|
if (behaviorRaw && behaviorRaw !== 'reply' && behaviorRaw !== 'compose' && behaviorRaw !== 'dismiss') {
|
|
@@ -1584,7 +1590,7 @@ export class AUNChannel {
|
|
|
1584
1590
|
if (this.interactionCallback) {
|
|
1585
1591
|
if (this.interactionActionsInFlight.has(cardMsgId)) {
|
|
1586
1592
|
this.auditActionCardInteraction(behaviorRaw, cardMsgId, cardInfo.requestId, 'rejected_in_flight', text.length);
|
|
1587
|
-
this.notifyCardActionFailure(channelId, '
|
|
1593
|
+
this.notifyCardActionFailure(channelId, '操作正在处理,请勿重复点击', cardClickerAid, threadId, cardDelivery);
|
|
1588
1594
|
return '';
|
|
1589
1595
|
}
|
|
1590
1596
|
this.interactionActionsInFlight.add(cardMsgId);
|
|
@@ -2277,7 +2283,7 @@ export class AUNChannel {
|
|
|
2277
2283
|
if (this.intentionalDisconnect || this.client !== client || !this.connected)
|
|
2278
2284
|
return;
|
|
2279
2285
|
const ownerAid = ownerResolver.owner(selfAid);
|
|
2280
|
-
logger.
|
|
2286
|
+
logger.debug(`${this.logPrefix()} ownerResolver result: selfAid=${selfAid}, ownerAid=${ownerAid || 'undefined'}`);
|
|
2281
2287
|
if (ownership.refreshFailure) {
|
|
2282
2288
|
const code = ownership.refreshFailure.code || 'UNKNOWN';
|
|
2283
2289
|
logger.warn(`${this.logPrefix()} Owner relationship refresh failed: status=${ownership.consensusStatus} code=${code}`);
|
|
@@ -2676,6 +2682,8 @@ export class AUNChannel {
|
|
|
2676
2682
|
return this.shouldEncrypt(this.config.aid);
|
|
2677
2683
|
}
|
|
2678
2684
|
_aid;
|
|
2685
|
+
/** Device identity resolved at connect; descriptive metadata for payload.debug only. */
|
|
2686
|
+
deviceInfo;
|
|
2679
2687
|
_selfName; // 本地 agent.md 中的 name,首次 connect 时读取
|
|
2680
2688
|
_chatId = ''; // aid:device_id:slot_id — 多实例回声过滤
|
|
2681
2689
|
/**
|
|
@@ -3246,7 +3254,7 @@ export class AUNChannel {
|
|
|
3246
3254
|
channelName: this.config.channelName,
|
|
3247
3255
|
});
|
|
3248
3256
|
this.trace('OUT', 'client.connect', { gateway: this.gatewayUrl, extra_info: extraInfo });
|
|
3249
|
-
await client.connect({
|
|
3257
|
+
const connectResult = await client.connect({
|
|
3250
3258
|
// connection_kind 默认 long;slot 已由 AID 携带(evolcore-daemon)
|
|
3251
3259
|
// extra_info:互踢诊断名片(0.4.3 公开 connect 已支持透传)
|
|
3252
3260
|
extra_info: extraInfo,
|
|
@@ -3266,6 +3274,16 @@ export class AUNChannel {
|
|
|
3266
3274
|
this._aid = client.aid ?? undefined;
|
|
3267
3275
|
const deviceId = client.currentAid?.deviceId ?? '';
|
|
3268
3276
|
this._chatId = this._aid ? `${this._aid}:${deviceId}:` : '';
|
|
3277
|
+
// Device identity as the SDK resolved it for this connection. It is
|
|
3278
|
+
// descriptive only — never an authentication or authorization input — and
|
|
3279
|
+
// is attached to `payload.debug` so a receiving peer can tell which device
|
|
3280
|
+
// of this AID sent a message.
|
|
3281
|
+
this.deviceInfo = {
|
|
3282
|
+
deviceId: connectResult?.device_id || deviceId || undefined,
|
|
3283
|
+
deviceIdV2: connectResult?.device_id_v2 || undefined,
|
|
3284
|
+
deviceType: connectResult?.device_type || undefined,
|
|
3285
|
+
deviceName: connectResult?.device_name || undefined,
|
|
3286
|
+
};
|
|
3269
3287
|
// 控制 AID 也有标准 host agent.md。发布在后台执行,短暂的 Name
|
|
3270
3288
|
// Service/Gateway 故障不能把控制通道判定为连接失败。
|
|
3271
3289
|
if (this.config.pureIdentity) {
|
|
@@ -3486,8 +3504,8 @@ export class AUNChannel {
|
|
|
3486
3504
|
const attachment = saveRelationAttachment(attachmentBuffer, this.config.aid, formatPeerKey('aun', channelId), img.mimeType, { filename: name, direction: 'in' });
|
|
3487
3505
|
img = { ...img, attachmentId: attachment.attachmentId, localPath: attachment.filePath };
|
|
3488
3506
|
// 和非图片文件一样,把落盘路径放进消息正文,模型可直接用这个路径读文件或传给命令
|
|
3489
|
-
fileParts.push(
|
|
3490
|
-
logFileParts.push(
|
|
3507
|
+
fileParts.push(formatAttachmentMarker('图片', name, attachment.filePath, attachment.storage));
|
|
3508
|
+
logFileParts.push(formatAttachmentMarker('图片', name, toAttachmentMarkedPath(this.config.aid, attachment.filePath), attachment.storage));
|
|
3491
3509
|
}
|
|
3492
3510
|
catch (error) {
|
|
3493
3511
|
logger.warn(`${this.logPrefix()} Failed to persist relation attachment for ${name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -3500,8 +3518,8 @@ export class AUNChannel {
|
|
|
3500
3518
|
// 换机器时只要搬 $EVOLCORE_HOME,历史里引用的文件都还在。
|
|
3501
3519
|
try {
|
|
3502
3520
|
const attachment = saveRelationAttachment(attachmentBuffer, this.config.aid, formatPeerKey('aun', channelId), att.content_type || att.mime_type || 'application/octet-stream', { filename: name, allowAnyExtension: true, direction: 'in' });
|
|
3503
|
-
fileParts.push(
|
|
3504
|
-
logFileParts.push(
|
|
3521
|
+
fileParts.push(formatAttachmentMarker('文件', name, attachment.filePath, attachment.storage));
|
|
3522
|
+
logFileParts.push(formatAttachmentMarker('文件', name, toAttachmentMarkedPath(this.config.aid, attachment.filePath), attachment.storage));
|
|
3505
3523
|
}
|
|
3506
3524
|
catch (error) {
|
|
3507
3525
|
logger.warn(`${this.logPrefix()} Failed to persist relation file for ${name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -4243,7 +4261,18 @@ export class AUNChannel {
|
|
|
4243
4261
|
? payload._evolcore_causation_ref
|
|
4244
4262
|
: undefined;
|
|
4245
4263
|
const logDescriptor = classifyAunPayloadForLog(payload);
|
|
4246
|
-
|
|
4264
|
+
let templateShare;
|
|
4265
|
+
if (appOwned && payload && typeof payload === 'object' && payload.type === TEMPLATE_SHARE_TYPE) {
|
|
4266
|
+
try {
|
|
4267
|
+
templateShare = parseTemplateShare(payload, this.config.aid);
|
|
4268
|
+
}
|
|
4269
|
+
catch {
|
|
4270
|
+
logger.warn(`${this.logPrefix()} P2P template share rejected: code=INVALID_TEMPLATE_SHARE mid=${messageId}`);
|
|
4271
|
+
return;
|
|
4272
|
+
}
|
|
4273
|
+
}
|
|
4274
|
+
const text = templateShare ? templateShareText(templateShare, fromAid)
|
|
4275
|
+
: this.extractTextPayload(payload, fromAid, fromAid, { chatType: 'private' }, !!env.encrypted);
|
|
4247
4276
|
const threadId = typeof payload === 'object' && payload !== null ? payload.thread_id : undefined;
|
|
4248
4277
|
const refMessageId = typeof payload === 'object' && payload !== null && typeof payload.ref_message_id === 'string'
|
|
4249
4278
|
? payload.ref_message_id
|
|
@@ -4311,9 +4340,11 @@ export class AUNChannel {
|
|
|
4311
4340
|
&& (mentionEntryTargets(mentions).includes(this._aid) || hasMentionAll(mentions)))
|
|
4312
4341
|
|| (!!this._aid && fromAid === this._aid);
|
|
4313
4342
|
// Process attachments (顶层 + 嵌套在 merge.items / quote.quote 中的)
|
|
4314
|
-
const { finalText, logText: attachmentLogText, images: inboundImages } =
|
|
4315
|
-
? {
|
|
4316
|
-
:
|
|
4343
|
+
const { finalText, logText: attachmentLogText, images: inboundImages } = templateShare
|
|
4344
|
+
? saveTemplateShare(templateShare, { selfAid: this.config.aid, senderAid: fromAid, messageId, receivedAt })
|
|
4345
|
+
: contactControl
|
|
4346
|
+
? { finalText: text, logText: text, images: [] }
|
|
4347
|
+
: await traceMenuStage(menuRequest, menuContext, menuTiming, 'aun.attachments', () => this.processAttachments(payload, text, fromAid, undefined, { chatType: 'private' }));
|
|
4317
4348
|
// 历史记录正文用 logText(`$AGENT_DIR/attachments/...` 别名路径),不用 finalText:
|
|
4318
4349
|
// finalText 是本回合给模型的绝对路径,写进历史后换机器/换盘符就失效。
|
|
4319
4350
|
// 用 logDescriptor.content 又会把路径丢掉,读历史的一方只能看到 `[image] 文件名`。
|
|
@@ -4423,7 +4454,7 @@ export class AUNChannel {
|
|
|
4423
4454
|
return;
|
|
4424
4455
|
}
|
|
4425
4456
|
// payload 类型白名单:信号类消息(status / event / thought 等)不进 Agent
|
|
4426
|
-
if (p2pPayloadType && !AUNChannel.PROACTIVE_ALLOW_TYPES.has(p2pPayloadType)) {
|
|
4457
|
+
if (p2pPayloadType && !templateShare && !AUNChannel.PROACTIVE_ALLOW_TYPES.has(p2pPayloadType)) {
|
|
4427
4458
|
this.appendInboundPayloadJsonl(chatId, fromAid, messageId, msgEncrypted, false, logDescriptor, threadId, receivedAt, seq);
|
|
4428
4459
|
logger.info(`${this.logPrefix()} P2P retained in generic inbound event stream (not Agent chat): type=${p2pPayloadType} from=${shortAid}(${displayName}) mid=${messageId}`);
|
|
4429
4460
|
return;
|
|
@@ -4453,6 +4484,13 @@ export class AUNChannel {
|
|
|
4453
4484
|
const isSystemP2P = p2pPayloadType === 'event';
|
|
4454
4485
|
this.aidStatsCollector?.recordInbound(this.config.aid, fromAid, Buffer.byteLength(finalText, 'utf-8'), finalText, isSystemP2P, msgEncrypted, msgChatmode, isSystemP2P ? 'notify' : 'send');
|
|
4455
4486
|
const replyContext = this.buildPrivateReplyContext(threadId, fromAid, msgEncrypted, messageId, msgChatmode, topicName, refMessageId, readTopicStatus(payload));
|
|
4487
|
+
// 对端发来的 is_stale_interrupt_notice 是旧版「被打断」通知的标记。该通知已不再发送,
|
|
4488
|
+
// 保留入站标记只为兼容仍在运行的旧对端:它进来后按普通消息处理,无需特殊对待。
|
|
4489
|
+
if (payload && typeof payload === 'object' && payload.is_stale_interrupt_notice === true) {
|
|
4490
|
+
if (!replyContext.metadata)
|
|
4491
|
+
replyContext.metadata = {};
|
|
4492
|
+
replyContext.metadata.isStaleInterruptNotice = true;
|
|
4493
|
+
}
|
|
4456
4494
|
const dispatched = this.dispatchMessage({
|
|
4457
4495
|
contactDelivery,
|
|
4458
4496
|
channelId: chatId,
|
|
@@ -5272,6 +5310,38 @@ export class AUNChannel {
|
|
|
5272
5310
|
})
|
|
5273
5311
|
.catch(error => logger.debug(`${this.logPrefix()} observer outbound recipient lookup failed: ${error}`));
|
|
5274
5312
|
}
|
|
5313
|
+
/**
|
|
5314
|
+
* Device metadata for `payload.debug`, sent only to this AID's Owner and to
|
|
5315
|
+
* Agents that share that Owner.
|
|
5316
|
+
*
|
|
5317
|
+
* Device identity is descriptive: it says which device of this AID sent a
|
|
5318
|
+
* message, never who is authorized to do anything. Restricting it keeps a
|
|
5319
|
+
* peer that is unrelated to this AID from learning the sender's device
|
|
5320
|
+
* inventory from ordinary traffic. Relationship facts come from the verified
|
|
5321
|
+
* protocol relation; when there is none, nothing is attached.
|
|
5322
|
+
*/
|
|
5323
|
+
relationshipDebug(recipientAid) {
|
|
5324
|
+
const info = this.deviceInfo;
|
|
5325
|
+
const selfAid = this.getAid();
|
|
5326
|
+
if (!info || !selfAid)
|
|
5327
|
+
return undefined;
|
|
5328
|
+
const toOwner = recipientAid === ownerResolver.owner(selfAid);
|
|
5329
|
+
const sameOwner = !toOwner
|
|
5330
|
+
&& !!ownerResolver.owner(recipientAid)
|
|
5331
|
+
&& ownerResolver.owner(recipientAid) === ownerResolver.owner(selfAid);
|
|
5332
|
+
if (!toOwner && !sameOwner)
|
|
5333
|
+
return undefined;
|
|
5334
|
+
const device = {};
|
|
5335
|
+
if (info.deviceId)
|
|
5336
|
+
device.device_id = info.deviceId;
|
|
5337
|
+
if (info.deviceIdV2)
|
|
5338
|
+
device.device_id_v2 = info.deviceIdV2;
|
|
5339
|
+
if (info.deviceType)
|
|
5340
|
+
device.device_type = info.deviceType;
|
|
5341
|
+
if (info.deviceName)
|
|
5342
|
+
device.device_name = info.deviceName;
|
|
5343
|
+
return Object.keys(device).length > 0 ? device : undefined;
|
|
5344
|
+
}
|
|
5275
5345
|
/**
|
|
5276
5346
|
* 实际投递 observer.forward 给每个 owner,使用 daemon 的全局 AUN 默认加密设置。
|
|
5277
5347
|
* original 为 SDK 给到的原始对象(入站回调 data / 出站 SendResult),整体透传,
|
|
@@ -5896,7 +5966,7 @@ export class AUNChannel {
|
|
|
5896
5966
|
// 与 trigger / 事件中心同源:agent 的工程目录。沙箱要求绝对真实目录,
|
|
5897
5967
|
// 存在性与 H/L 分类由 buildTriggerScriptLaunch 自己校验并明确报错。
|
|
5898
5968
|
getProjectPath: () => this.defaultProjectPath,
|
|
5899
|
-
permissionMode:
|
|
5969
|
+
permissionMode: role => resolveRuntimePermissionMode({ selfAid: aid, role }).effectiveValue,
|
|
5900
5970
|
// bypass + owner 才免沙箱;角色取调用方(service 消息的 from)。解析失败按未知处理。
|
|
5901
5971
|
resolvePeerRole: fromAid => {
|
|
5902
5972
|
try {
|
|
@@ -6600,6 +6670,12 @@ export class AUNChannel {
|
|
|
6600
6670
|
}
|
|
6601
6671
|
if (encrypt)
|
|
6602
6672
|
params.protected_headers = aunProtectedHeaders(context);
|
|
6673
|
+
// Standalone Owner approvals belong to the persistent application control
|
|
6674
|
+
// stream. Contextual action cards need normal delivery into their topic.
|
|
6675
|
+
if (!isGroup && payload.type === 'friend.request.v1') {
|
|
6676
|
+
params.message_class = 'control';
|
|
6677
|
+
params.protected_headers = { ...params.protected_headers, message_class: 'control' };
|
|
6678
|
+
}
|
|
6603
6679
|
if (isGroup)
|
|
6604
6680
|
params.group_id = delivery.groupId;
|
|
6605
6681
|
else
|
|
@@ -7079,9 +7155,9 @@ export class AUNChannel {
|
|
|
7079
7155
|
...(result.code !== undefined ? { code: result.code } : {}),
|
|
7080
7156
|
};
|
|
7081
7157
|
}
|
|
7082
|
-
/** Daemon-side transport for `
|
|
7158
|
+
/** Daemon-side transport for `ecmsg send` running inside an agent task. */
|
|
7083
7159
|
/**
|
|
7084
|
-
* Agent 经
|
|
7160
|
+
* Agent 经 ecmsg 委托发送时占用本轮序号,
|
|
7085
7161
|
* 与回复路径共用 sentCount,保证同一轮内 seqInTurn 连续。
|
|
7086
7162
|
*/
|
|
7087
7163
|
nextSeqInTurn(channelId, threadId) {
|
|
@@ -7263,7 +7339,7 @@ export class AUNChannel {
|
|
|
7263
7339
|
}
|
|
7264
7340
|
this.forwardOutbound(result, args.debug);
|
|
7265
7341
|
let logWritten = false;
|
|
7266
|
-
// 跨话题自派(`--
|
|
7342
|
+
// 跨话题自派(`--thread T --selfmode`)不写出站日志:chatDir 会按 (to=本端, self=本端) 算成
|
|
7267
7343
|
// 「我↔我」目录,`ThreadService.listPeers` 的磁盘兜底会把它列成真实对端,
|
|
7268
7344
|
// 而话题 T 的历史里也会凭空多出一条「发给本端自己」的出站记录。
|
|
7269
7345
|
// 「自己收到了什么」由本地注入那条入站记录(source='self-address')表达。
|
|
@@ -7376,7 +7452,7 @@ export class AUNChannel {
|
|
|
7376
7452
|
return built.payload;
|
|
7377
7453
|
}
|
|
7378
7454
|
/**
|
|
7379
|
-
* 归档 daemon
|
|
7455
|
+
* 归档 daemon 侧代发的文件(托管 `ecmsg send --file` 走这条路径,不经 outbox)。
|
|
7380
7456
|
* 与 outbox 投递同一落点与命名规则;归档失败只记日志、返回 null,不阻断发送。
|
|
7381
7457
|
* 返回值是写进本地历史的正文:`[文件: 名 → $AGENT_DIR/attachments/…]`。
|
|
7382
7458
|
*/
|
|
@@ -7385,9 +7461,9 @@ export class AUNChannel {
|
|
|
7385
7461
|
if (!archived)
|
|
7386
7462
|
return null;
|
|
7387
7463
|
const label = as === 'image' ? '图片' : as === 'video' ? '视频' : as === 'voice' ? '语音' : '文件';
|
|
7388
|
-
return
|
|
7464
|
+
return formatAttachmentMarker(label, path.basename(filePath), toAttachmentMarkedPath(this.config.aid, archived.filePath), archived.storage);
|
|
7389
7465
|
}
|
|
7390
|
-
/** Daemon-side transport for `
|
|
7466
|
+
/** Daemon-side transport for group `ecmsg send` running inside an agent task. */
|
|
7391
7467
|
async sendDaemonGroupMsg(args) {
|
|
7392
7468
|
if (!args.groupId) {
|
|
7393
7469
|
return { ok: false, error: 'aun group send requires a group target', code: 'UNSUPPORTED_TARGET' };
|
|
@@ -7729,8 +7805,13 @@ export class AUNChannel {
|
|
|
7729
7805
|
const payload = await this.withSessionState(channelId, withAunAttention(echoTextPayload(finalText), context?.attention), context);
|
|
7730
7806
|
// sentAt 在每次投递尝试时盖戳(outbox 重发取重发时刻)。服务端会用自己的时间覆盖
|
|
7731
7807
|
// 顶层 timestamp,两者有毫秒级差异,sentAt 只代表本端时钟。
|
|
7732
|
-
|
|
7733
|
-
|
|
7808
|
+
// Device identity rides along when the recipient is this AID's Owner or a
|
|
7809
|
+
// sibling under the same Owner; other recipients never see it.
|
|
7810
|
+
const deviceDebug = delivery.chatType === 'private' && !delivery.service
|
|
7811
|
+
? this.relationshipDebug(channelId) : undefined;
|
|
7812
|
+
if (context?.debug || deviceDebug) {
|
|
7813
|
+
payload.debug = { ...(context?.debug ?? {}), ...(deviceDebug ?? {}), sentAt: localTimestamp() };
|
|
7814
|
+
}
|
|
7734
7815
|
if (delivery.chatType === 'group') {
|
|
7735
7816
|
const extracted = this.extractMentionEntriesFromText(finalText);
|
|
7736
7817
|
if (extracted.length > 0)
|
|
@@ -7746,6 +7827,9 @@ export class AUNChannel {
|
|
|
7746
7827
|
payload.chatmode = context.metadata.chatmode;
|
|
7747
7828
|
if (context?.metadata?.forkAnchor)
|
|
7748
7829
|
payload.fork_anchor = context.metadata.forkAnchor;
|
|
7830
|
+
// 防 ping-pong 标记:通知对端「我被打断了」时带上,对端收到后不再回发相同通知。
|
|
7831
|
+
if (context?.metadata?.isStaleInterruptNotice)
|
|
7832
|
+
payload.is_stale_interrupt_notice = true;
|
|
7749
7833
|
if (delivery.chatType === 'private' && !delivery.service) {
|
|
7750
7834
|
Object.assign(payload, this.withCurrentTopicName(channelId, payload));
|
|
7751
7835
|
}
|
|
@@ -7977,13 +8061,12 @@ export class AUNChannel {
|
|
|
7977
8061
|
if (owner.refreshFailure || owner.consensusStatus !== 'consensus') {
|
|
7978
8062
|
return { ok: false, status: 'retry', code: 'UPDATE_OWNERSHIP_UNAVAILABLE', error: 'Current Agent Owner is unavailable' };
|
|
7979
8063
|
}
|
|
7980
|
-
const {
|
|
7981
|
-
const installed = new TemplateJobs(resolvePaths().root).installation(notice.targetAid);
|
|
8064
|
+
const { compareTemplateVersions } = await import('../agent-template/jobs.js');
|
|
7982
8065
|
const config = loadAgent(notice.targetAid);
|
|
7983
|
-
if (
|
|
7984
|
-
||
|
|
7985
|
-
||
|
|
7986
|
-
||
|
|
8066
|
+
if (this.config.aid !== notice.targetAid || owner.ownerAid !== entry.channelId
|
|
8067
|
+
|| !['manual', 'auto'].includes(config?.update?.mode ?? '') || !config?.version
|
|
8068
|
+
|| config.update?.key !== notice.key || config.update?.registryAid !== notice.registryAid
|
|
8069
|
+
|| compareTemplateVersions(config.version, notice.candidateVersion) >= 0) {
|
|
7987
8070
|
return { ok: false, status: 'permanent', code: 'UPDATE_NOTICE_STALE', error: 'Owner, source, policy or installed version changed' };
|
|
7988
8071
|
}
|
|
7989
8072
|
entry.context = { ...entry.context, metadata: { ...entry.context?.metadata, encrypted: true } };
|
|
@@ -8302,6 +8385,14 @@ export class AUNChannel {
|
|
|
8302
8385
|
const encrypt = context?.metadata?.encrypted != null
|
|
8303
8386
|
? !!(context.metadata.encrypted)
|
|
8304
8387
|
: this.shouldEncrypt(encryptTarget);
|
|
8388
|
+
// Attach this device's identity when the recipient is this AID's Owner or a
|
|
8389
|
+
// sibling under the same Owner. Group traffic and service replies go to
|
|
8390
|
+
// audiences that are not that relation, so they carry no device metadata.
|
|
8391
|
+
if (!isGroup && !delivery.service) {
|
|
8392
|
+
const device = this.relationshipDebug(targetAid);
|
|
8393
|
+
if (device)
|
|
8394
|
+
finalPayload.debug = { ...(finalPayload.debug ?? {}), ...device };
|
|
8395
|
+
}
|
|
8305
8396
|
if (finalPayload.thread_id === '')
|
|
8306
8397
|
delete finalPayload.thread_id;
|
|
8307
8398
|
// 主话题 id(main:<a>:<b>)是本端身份,不上线;主话题的线上形态就是不带该字段。
|
|
@@ -8361,7 +8452,12 @@ export class AUNChannel {
|
|
|
8361
8452
|
logger.warn(`${this.logPrefix()} message.send (${payload.type}) returned no message_id; disposition=${failure.status}`);
|
|
8362
8453
|
return { ok: false, ...failure };
|
|
8363
8454
|
}
|
|
8364
|
-
|
|
8455
|
+
const menuRequestId = typeof finalPayload.id === 'string' ? finalPayload.id : '';
|
|
8456
|
+
const menuTargetDeviceId = menuSenderDeviceId(params.to_device_id) ?? '';
|
|
8457
|
+
const menuTransport = isMenuPayload
|
|
8458
|
+
? ` request_id=${menuRequestId || '<none>'} target_device_id=${menuTargetDeviceId || '<aid-broadcast>'}`
|
|
8459
|
+
: '';
|
|
8460
|
+
logger.info(`${this.logPrefix()} message.send (${payload.type}) ok: to=${this.peerLabel(targetAid)} mid=${mid} encrypt=${encrypt}${menuTransport}`);
|
|
8365
8461
|
// 服务回复不进 observer 镜像(回归 13)。
|
|
8366
8462
|
if (!isMenuPayload && !delivery.service)
|
|
8367
8463
|
this.forwardOutbound(result);
|
|
@@ -8575,7 +8671,7 @@ export class AUNChannel {
|
|
|
8575
8671
|
entry.payload = this.applyReplyContextToPayload(imagePayload, entry.context);
|
|
8576
8672
|
// 图片与文件同一规则:历史里记关系目录里的归档路径。
|
|
8577
8673
|
entry.logText ??= archived
|
|
8578
|
-
?
|
|
8674
|
+
? formatAttachmentMarker('图片', image.alt || path.basename(archived.filePath), toAttachmentMarkedPath(this.config.aid, archived.filePath), archived.storage)
|
|
8579
8675
|
: (image.alt ? `[image] ${image.alt}` : '[image]');
|
|
8580
8676
|
delete entry.image;
|
|
8581
8677
|
// Persist the attachment reference before message.send. A failed send then
|
|
@@ -8637,7 +8733,7 @@ export class AUNChannel {
|
|
|
8637
8733
|
if (entry.deliveryReceipt) {
|
|
8638
8734
|
const filename = path.basename(absPath);
|
|
8639
8735
|
const logText = entry.logText ?? (fileArchived
|
|
8640
|
-
?
|
|
8736
|
+
? formatAttachmentMarker('文件', filename, toAttachmentMarkedPath(this.config.aid, fileArchived.filePath), fileArchived.storage)
|
|
8641
8737
|
: `[file] ${filename}`);
|
|
8642
8738
|
try {
|
|
8643
8739
|
this.appendOutboundJsonl(channelId, {
|
|
@@ -8771,7 +8867,7 @@ export class AUNChannel {
|
|
|
8771
8867
|
...classifyAunPayloadForLog(filePayload),
|
|
8772
8868
|
// 有归档副本就记归档路径;没有则在正文里补源路径,避免历史只剩文件名。
|
|
8773
8869
|
...(archived
|
|
8774
|
-
? { content:
|
|
8870
|
+
? { content: formatAttachmentMarker('文件', filename, toAttachmentMarkedPath(this.config.aid, archived.filePath), archived.storage) }
|
|
8775
8871
|
: { content: `[文件: ${filename} → ${absPath}]` }),
|
|
8776
8872
|
msgId: sentMid, encrypt: !!params.encrypt,
|
|
8777
8873
|
context, isGroup, source, transport: this.sendReceiptFromResult(sendResult),
|
|
@@ -9420,10 +9516,12 @@ export class AUNChannelPlugin {
|
|
|
9420
9516
|
...(dedupeOperationId ? { operationId: dedupeOperationId } : {}),
|
|
9421
9517
|
...(payload.kind === 'result.text' && payload.metadata?.forkAnchor
|
|
9422
9518
|
? { forkAnchor: payload.metadata.forkAnchor } : {}),
|
|
9519
|
+
...(payload.kind === 'result.text' && payload.metadata?.isStaleInterruptNotice
|
|
9520
|
+
? { isStaleInterruptNotice: true } : {}),
|
|
9423
9521
|
},
|
|
9424
9522
|
};
|
|
9425
9523
|
if (payload.kind === 'result.text' && payload.isFinal && delivery.chatType === 'private') {
|
|
9426
|
-
sendCtx.title = '
|
|
9524
|
+
sendCtx.title = '最终回复:';
|
|
9427
9525
|
}
|
|
9428
9526
|
let result;
|
|
9429
9527
|
try {
|
|
@@ -9812,7 +9910,46 @@ export class AUNChannelPlugin {
|
|
|
9812
9910
|
return suppressedReceipt(envelope, 'empty_interaction');
|
|
9813
9911
|
}
|
|
9814
9912
|
case 'custom': {
|
|
9815
|
-
const
|
|
9913
|
+
const customValue = payload.payload;
|
|
9914
|
+
const customObject = typeof customValue === 'string'
|
|
9915
|
+
? (() => { try {
|
|
9916
|
+
return JSON.parse(customValue);
|
|
9917
|
+
}
|
|
9918
|
+
catch {
|
|
9919
|
+
return undefined;
|
|
9920
|
+
} })()
|
|
9921
|
+
: customValue;
|
|
9922
|
+
if (customObject && typeof customObject === 'object' && !Array.isArray(customObject)
|
|
9923
|
+
&& customObject.type === 'action_card' && customObject.card_kind === 'ownership_bind_request') {
|
|
9924
|
+
const card = customObject;
|
|
9925
|
+
const send = await channel.sendContentPayload(channelId, card, {
|
|
9926
|
+
contentKind: 'card', context: replyCtx, dedupeKey: operationId,
|
|
9927
|
+
logText: '[ownership.bind action_card]',
|
|
9928
|
+
...(typeof card.expires_at_ms === 'number'
|
|
9929
|
+
? { ttl: Math.max(1, card.expires_at_ms - Date.now()) } : {}),
|
|
9930
|
+
});
|
|
9931
|
+
if (send.messageId)
|
|
9932
|
+
return sentReceipt(envelope, [send.messageId], replyCtx?.threadId);
|
|
9933
|
+
if (send.status === 'retry'
|
|
9934
|
+
|| send.status === 'queued' || send.queued) {
|
|
9935
|
+
if (!send.outboxId)
|
|
9936
|
+
return {
|
|
9937
|
+
status: 'failed', operationId, messages: [],
|
|
9938
|
+
error: 'Queued Ownership card is missing its outbox id', code: 'MISSING_OUTBOX_ID',
|
|
9939
|
+
};
|
|
9940
|
+
return { status: 'queued', operationId, messages: [], outboxId: send.outboxId,
|
|
9941
|
+
...(send.error ? { error: send.error } : {}), ...(send.code !== undefined ? { code: send.code } : {}) };
|
|
9942
|
+
}
|
|
9943
|
+
if (send.status === 'permanent' || send.status === 'failed')
|
|
9944
|
+
return {
|
|
9945
|
+
status: 'failed', operationId, messages: [],
|
|
9946
|
+
...(send.outboxId ? { outboxId: send.outboxId } : {}),
|
|
9947
|
+
error: send.error ?? 'Ownership card delivery failed',
|
|
9948
|
+
...(send.code !== undefined ? { code: send.code } : {}),
|
|
9949
|
+
};
|
|
9950
|
+
return suppressedReceipt(envelope, 'ownership_card_not_sent');
|
|
9951
|
+
}
|
|
9952
|
+
const text = typeof customValue === 'string' ? customValue : JSON.stringify(customValue);
|
|
9816
9953
|
await channel.sendCustomPayload(channelId, text, replyCtx);
|
|
9817
9954
|
return;
|
|
9818
9955
|
}
|
package/dist/channels/daemon.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { appendExpireEntry, recordNextLaunchCleanup, cleanupPreviousByKind, runExpireCleanup, cleanupSessionRecord, } from '../core/
|
|
1
|
+
import { appendExpireEntry, recordNextLaunchCleanup, cleanupPreviousByKind, runExpireCleanup, cleanupSessionRecord, } from '../core/session/background/session-cleanup.js';
|
|
2
2
|
import { ExecutionTimeoutError } from '../utils/error-utils.js';
|
|
3
3
|
import { logger } from '../utils/logger.js';
|
|
4
4
|
import { normalizeExecutionMode } from '../trigger/validation.js';
|
|
5
5
|
import { bindTriggerExecutionIdentity, currentTriggerExecutionIdentity } from '../trigger/authorization.js';
|
|
6
|
-
import { assertSystemSessionLaunchable } from '../core/
|
|
6
|
+
import { assertSystemSessionLaunchable } from '../core/session/system/registry.js';
|
|
7
7
|
import { sessionTopicThreadId } from '../core/thread/topic-id.js';
|
|
8
8
|
const DEFAULT_WATCHDOG_MS = 11 * 60 * 1000;
|
|
9
9
|
const EXPIRE_CLEANUP_INTERVAL_MS = 60 * 60 * 1000;
|
|
@@ -300,6 +300,7 @@ export class DaemonChannel {
|
|
|
300
300
|
channelKey: this.channelKey,
|
|
301
301
|
peerId: `trigger:${trigger.id}`,
|
|
302
302
|
peerName: trigger.name,
|
|
303
|
+
peerType: 'system',
|
|
303
304
|
...(memoryMode ? { systemSession: { type: 'memory', subtype: memoryMode }, sessionType: 'memory', memoryMode } : {}),
|
|
304
305
|
...(memoryScope ? { memoryScope } : {}),
|
|
305
306
|
...(consolidationBatchDir ? { consolidationBatchDir } : {}),
|
|
@@ -3,7 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import { createHash } from 'crypto';
|
|
4
4
|
import { logger } from '../utils/logger.js';
|
|
5
5
|
import { requireOptional } from '../utils/npm-ops.js';
|
|
6
|
-
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel-loader.js';
|
|
6
|
+
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel/channel-loader.js';
|
|
7
7
|
import { formatItemsAsText } from '../core/message/items-formatter.js';
|
|
8
8
|
import { createSendFileMarkerPattern } from '../core/message/file-markers.js';
|
|
9
9
|
import { sentReceipt, suppressedReceipt } from '../core/message/send-receipt.js';
|
package/dist/channels/feishu.js
CHANGED
|
@@ -485,7 +485,7 @@ export class FeishuChannel {
|
|
|
485
485
|
case 'respond': {
|
|
486
486
|
logger.info(`[Feishu] Card action: id=${value._id}, action=${decision.response.action}`);
|
|
487
487
|
if (this.cardActionsInFlight.has(value._id)) {
|
|
488
|
-
return { toast: { type: 'info', content: '
|
|
488
|
+
return { toast: { type: 'info', content: '操作正在处理,请勿重复点击' } };
|
|
489
489
|
}
|
|
490
490
|
if (!this.interactionCallback) {
|
|
491
491
|
return this.invalidatedCardResponse('handler_unavailable');
|
|
@@ -1568,16 +1568,16 @@ export function buildResolvedV2(interaction, response) {
|
|
|
1568
1568
|
: undefined;
|
|
1569
1569
|
const temporaryGrantIsFileScoped = temporaryGrantButton?.label.includes('同文件') === true;
|
|
1570
1570
|
const labelMap = {
|
|
1571
|
-
'allow': '
|
|
1572
|
-
'always': temporaryGrantIsFileScoped ? '
|
|
1573
|
-
'approve_session_30m': temporaryGrantIsFileScoped ? '
|
|
1574
|
-
'approve_file_60m': '
|
|
1575
|
-
'approve_directory_60m': '
|
|
1576
|
-
'approve_all_directories_60m': '
|
|
1571
|
+
'allow': '已允许',
|
|
1572
|
+
'always': temporaryGrantIsFileScoped ? '已授权同文件 30 分钟' : '已授权同操作 30 分钟',
|
|
1573
|
+
'approve_session_30m': temporaryGrantIsFileScoped ? '已授权同文件 30 分钟' : '已授权本会话 30 分钟',
|
|
1574
|
+
'approve_file_60m': '已授权同文件 60 分钟',
|
|
1575
|
+
'approve_directory_60m': '已授权当前目录及子目录 60 分钟',
|
|
1576
|
+
'approve_all_directories_60m': '已授权当前会话所有普通目录 60 分钟',
|
|
1577
1577
|
'deny': '❌ 已拒绝',
|
|
1578
1578
|
'cancel': '取消',
|
|
1579
1579
|
};
|
|
1580
|
-
const statusText = labelMap[action] || (/^\p{Emoji}/u.test(action) ? action :
|
|
1580
|
+
const statusText = labelMap[action] || (/^\p{Emoji}/u.test(action) ? action.replace(/^\p{Emoji}+\s*/u, '') : action);
|
|
1581
1581
|
const headerTemplate = action === 'deny' ? 'red' : 'green';
|
|
1582
1582
|
const headerTitle = `${kind.title} — ${statusText}`;
|
|
1583
1583
|
const bodyElements = [];
|
|
@@ -1802,7 +1802,7 @@ export function hasMarkdownSyntax(text) {
|
|
|
1802
1802
|
];
|
|
1803
1803
|
return markdownPatterns.some(pattern => pattern.test(text));
|
|
1804
1804
|
}
|
|
1805
|
-
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel-loader.js';
|
|
1805
|
+
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel/channel-loader.js';
|
|
1806
1806
|
export class FeishuChannelPlugin {
|
|
1807
1807
|
name = 'feishu';
|
|
1808
1808
|
contactBind = {
|
package/dist/channels/qqbot.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logger } from '../utils/logger.js';
|
|
2
2
|
import { markdownToPlainText } from '../utils/markdown-to-plain-text.js';
|
|
3
3
|
import { requireOptional } from '../utils/npm-ops.js';
|
|
4
|
-
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel-loader.js';
|
|
4
|
+
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel/channel-loader.js';
|
|
5
5
|
import { formatItemsAsText } from '../core/message/items-formatter.js';
|
|
6
6
|
import { createSendFileMarkerPattern } from '../core/message/file-markers.js';
|
|
7
7
|
import { initWelcomeManager, sendWelcomeIfNeeded } from '../utils/welcome.js';
|
package/dist/channels/wechat.js
CHANGED
|
@@ -1008,7 +1008,7 @@ function listenForAbort(signal, listener) {
|
|
|
1008
1008
|
signal.addEventListener('abort', listener, { once: true });
|
|
1009
1009
|
return () => signal.removeEventListener('abort', listener);
|
|
1010
1010
|
}
|
|
1011
|
-
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel-loader.js';
|
|
1011
|
+
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel/channel-loader.js';
|
|
1012
1012
|
export class WechatChannelPlugin {
|
|
1013
1013
|
name = 'wechat';
|
|
1014
1014
|
contactBind = {
|
|
@@ -1041,7 +1041,7 @@ export class WechatChannelPlugin {
|
|
|
1041
1041
|
return;
|
|
1042
1042
|
case 'result.file': {
|
|
1043
1043
|
const name = payload.fileName || payload.filePath;
|
|
1044
|
-
await channel.sendMessage(channelId,
|
|
1044
|
+
await channel.sendMessage(channelId, `文件已生成:${name}\n路径:${payload.filePath}`);
|
|
1045
1045
|
return;
|
|
1046
1046
|
}
|
|
1047
1047
|
case 'result.image': return;
|
package/dist/channels/wecom.js
CHANGED
|
@@ -3,7 +3,7 @@ import fs from 'node:fs';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { logger } from '../utils/logger.js';
|
|
5
5
|
import { requireOptional } from '../utils/npm-ops.js';
|
|
6
|
-
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel-loader.js';
|
|
6
|
+
import { middleOutputModePolicy, resolveShowActivities, showActivitiesPolicy } from '../core/channel/channel-loader.js';
|
|
7
7
|
import { formatItemsAsText } from '../core/message/items-formatter.js';
|
|
8
8
|
import { createSendFileMarkerPattern } from '../core/message/file-markers.js';
|
|
9
9
|
import { initWelcomeManager, sendWelcomeIfNeeded } from '../utils/welcome.js';
|