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.
Files changed (448) hide show
  1. package/CHANGELOG.md +39 -2
  2. package/bin/ec-build.mjs +60 -0
  3. package/bin/ecmsg.js +65 -63
  4. package/dist/ability/caller/command.js +24 -15
  5. package/dist/ability/caller/contract.js +24 -9
  6. package/dist/ability/caller/credential-files.js +132 -0
  7. package/dist/ability/caller/daemon.js +32 -7
  8. package/dist/ability/caller/schema-view.js +157 -0
  9. package/dist/ability/caller/service.js +202 -63
  10. package/dist/ability/interop-v1.js +156 -113
  11. package/dist/agent-template/jobs.js +14 -110
  12. package/dist/agent-template/runtime.js +331 -193
  13. package/dist/agent-template/service.js +1029 -1104
  14. package/dist/agent-template/share.js +103 -0
  15. package/dist/agent-template/tool-runner.js +25 -0
  16. package/dist/agent-template/types.js +10 -3
  17. package/dist/agents/claude/availability.js +94 -0
  18. package/dist/agents/claude/capability-provider.js +154 -0
  19. package/dist/agents/claude/index.js +145 -0
  20. package/dist/agents/{claude-runner.js → claude/runner.js} +74 -158
  21. package/dist/agents/claude/session-file-adapter.js +246 -0
  22. package/dist/agents/codex/app-server-client.js +90 -10
  23. package/dist/agents/codex/availability.js +164 -0
  24. package/dist/agents/codex/capability-provider.js +138 -0
  25. package/dist/agents/codex/cli.js +38 -0
  26. package/dist/agents/codex/index.js +345 -0
  27. package/dist/agents/codex/mcp-elicitation.js +135 -0
  28. package/dist/agents/{codex-runner.js → codex/runner.js} +648 -382
  29. package/dist/agents/codex/session-file-adapter.js +834 -0
  30. package/dist/agents/dsh/availability.js +28 -0
  31. package/dist/agents/dsh/capability-provider.js +56 -0
  32. package/dist/agents/dsh/desktop-locations.ps1 +66 -0
  33. package/dist/agents/dsh/desktop-probe.cjs +37 -0
  34. package/dist/agents/dsh/index.js +98 -0
  35. package/dist/agents/dsh/installation.js +400 -0
  36. package/dist/agents/dsh/resources.js +755 -0
  37. package/dist/agents/dsh/runner.js +1183 -0
  38. package/dist/agents/dsh/runtime/README.md +243 -0
  39. package/dist/agents/dsh/runtime/authorization.js +23 -0
  40. package/dist/agents/dsh/runtime/bridge.js +837 -0
  41. package/dist/agents/dsh/runtime/config.js +271 -0
  42. package/dist/agents/dsh/runtime/entry.js +229 -0
  43. package/dist/agents/dsh/runtime/session-inspector.js +340 -0
  44. package/dist/agents/dsh/runtime/tool-policy.js +49 -0
  45. package/dist/agents/dsh/session-file-adapter.js +145 -0
  46. package/dist/agents/ecagent/index.js +215 -0
  47. package/dist/agents/{ecagent-runner.js → ecagent/runner.js} +592 -106
  48. package/dist/agents/ecagent/session-file-adapter.js +134 -0
  49. package/dist/agents/gemini/index.js +55 -10
  50. package/dist/agents/gemini/{gemini-runner.js → runner.js} +4 -9
  51. package/dist/aun/ability-device-routing.js +11 -17
  52. package/dist/aun/aid/agentmd.js +27 -1
  53. package/dist/aun/aid/managed-operation.js +6 -4
  54. package/dist/aun/group/invite-service.js +1 -1
  55. package/dist/aun/menu/client.js +1 -1
  56. package/dist/aun/msg/history.js +1 -1
  57. package/dist/aun/msg/managed-operation.js +93 -21
  58. package/dist/aun/msg/p2p.js +6 -6
  59. package/dist/aun/service-proxy.js +1 -1
  60. package/dist/aun/storage/index.js +242 -0
  61. package/dist/build-identity.json +1 -1
  62. package/dist/channels/aun.js +180 -43
  63. package/dist/channels/daemon.js +3 -2
  64. package/dist/channels/dingtalk.js +1 -1
  65. package/dist/channels/feishu.js +9 -9
  66. package/dist/channels/qqbot.js +1 -1
  67. package/dist/channels/wechat.js +2 -2
  68. package/dist/channels/wecom.js +1 -1
  69. package/dist/{agents/claude-gateway → claude-gateway}/agent-registration.js +13 -13
  70. package/dist/{agents/claude-gateway → claude-gateway}/binding.js +3 -3
  71. package/dist/{agents/claude-gateway → claude-gateway}/inbox.js +1 -1
  72. package/dist/{agents/claude-gateway → claude-gateway}/index.js +2 -2
  73. package/dist/{agents/claude-gateway → claude-gateway}/listing.js +3 -3
  74. package/dist/{agents/claude-gateway → claude-gateway}/router.js +4 -4
  75. package/dist/{agents/claude-gateway → claude-gateway}/sessions.js +2 -2
  76. package/dist/{agents/claude-gateway → claude-gateway}/terminal.js +1 -1
  77. package/dist/{agents/claude-gateway → claude-gateway}/transcript.js +1 -1
  78. package/dist/cli/ability-command.js +8 -5
  79. package/dist/cli/ability-output.js +182 -0
  80. package/dist/cli/agent-command.js +1 -1
  81. package/dist/cli/agent-create.js +123 -42
  82. package/dist/cli/agent-template.js +400 -29
  83. package/dist/cli/agent.js +14 -11
  84. package/dist/cli/aun-commands.js +167 -111
  85. package/dist/cli/daemon-commands.js +38 -8
  86. package/dist/cli/data-command.js +1 -1
  87. package/dist/cli/debug-mode.js +9 -0
  88. package/dist/cli/directory.js +1 -2
  89. package/dist/cli/ecmsg-gateway.js +55 -19
  90. package/dist/cli/fs-command.js +67 -39
  91. package/dist/cli/index.js +25 -11
  92. package/dist/cli/init.js +124 -29
  93. package/dist/cli/managed-command-guard.js +2 -0
  94. package/dist/cli/model.js +1 -1
  95. package/dist/cli/restart-monitor.js +2 -2
  96. package/dist/cli/services-command.js +24 -1
  97. package/dist/cli/skill-command.js +4 -4
  98. package/dist/cli/task-context.js +24 -14
  99. package/dist/cli/team-workspace-command.js +50 -52
  100. package/dist/cli/thread-command.js +3 -2
  101. package/dist/cli/trigger-command.js +47 -12
  102. package/dist/cli/watch-logs.js +2 -1
  103. package/dist/config/boot-log.js +3 -0
  104. package/dist/config/builtin-role-templates.js +1 -1
  105. package/dist/config/config-field-policy.js +10 -6
  106. package/dist/config/config-manager.js +33 -12
  107. package/dist/config/gateway-config.js +21 -37
  108. package/dist/config/invoke-ipc-service.js +1 -1
  109. package/dist/config/owner-config.js +5 -3
  110. package/dist/config/peer-book-store.js +2 -3
  111. package/dist/config/peer-book.js +2 -2
  112. package/dist/config/peer-role-resolver.js +2 -2
  113. package/dist/config/provider-identity-migration.js +24 -105
  114. package/dist/config/provider-ipc-service.js +13 -3
  115. package/dist/config/provider-local-sync.js +4 -1
  116. package/dist/config/provider-menu-request.js +21 -3
  117. package/dist/config/provider-templates.js +1 -1
  118. package/dist/config/providers-config.js +39 -15
  119. package/dist/config/providers-import.js +3 -3
  120. package/dist/config/providers-management.js +74 -99
  121. package/dist/config/schema-migration.js +177 -11
  122. package/dist/config/schema-registry.js +1 -1
  123. package/dist/config-store.js +38 -50
  124. package/dist/core/{agent-application-service.js → agent/agent-application-service.js} +9 -9
  125. package/dist/core/{agent-create-status.js → agent/agent-create-status.js} +112 -4
  126. package/dist/core/{agent-creation-claim.js → agent/agent-creation-claim.js} +3 -3
  127. package/dist/core/{agent-ipc-registration.js → agent/agent-ipc-registration.js} +102 -25
  128. package/dist/core/{agent-reload-coordinator.js → agent/agent-reload-coordinator.js} +61 -1
  129. package/dist/core/{agent-runtime.js → agent/agent-runtime.js} +53 -27
  130. package/dist/core/{evolagent-registry.js → agent/evolagent-registry.js} +12 -12
  131. package/dist/core/{evolagent.js → agent/evolagent.js} +11 -11
  132. package/dist/core/auth/agent-delegation.js +1 -8
  133. package/dist/core/auth/delegation-authorization.js +28 -0
  134. package/dist/core/auth/operation-authorizer.js +7 -4
  135. package/dist/core/auth/operation-catalog.js +34 -5
  136. package/dist/core/baseagent/baseagent-availability.js +197 -0
  137. package/dist/core/baseagent/baseagent-capability-adapter.js +288 -0
  138. package/dist/core/baseagent/baseagent-config-shared.js +56 -0
  139. package/dist/core/baseagent/baseagent-identity.js +68 -0
  140. package/dist/core/{baseagent-loader.js → baseagent/baseagent-loader.js} +62 -6
  141. package/dist/core/baseagent/baseagent-model-defaults.js +26 -0
  142. package/dist/{agents → core/baseagent}/baseagent-plugin-descriptor.js +107 -24
  143. package/dist/core/baseagent/baseagent-plugin-loader.js +367 -0
  144. package/dist/core/baseagent/baseagent.js +157 -0
  145. package/dist/{agents → core/baseagent}/runner-types.js +36 -4
  146. package/dist/core/capability/capability-manager.js +79 -30
  147. package/dist/core/capability/providers/claude-capability-provider.js +2 -154
  148. package/dist/core/capability/providers/codex-capability-provider.js +2 -136
  149. package/dist/core/{channel-loader.js → channel/channel-loader.js} +226 -38
  150. package/dist/core/{channel-runtime.js → channel/channel-runtime.js} +18 -18
  151. package/dist/core/command/agent-control.js +60 -15
  152. package/dist/core/command/agent-template-menu.js +21 -9
  153. package/dist/core/command/agentmd-menu-request.js +19 -8
  154. package/dist/core/command/agentmd-menu.js +14 -5
  155. package/dist/core/command/command-handler.js +127 -57
  156. package/dist/core/command/context-policy-menu.js +122 -0
  157. package/dist/core/command/data-root-resolver.js +157 -20
  158. package/dist/core/command/memory-slash.js +6 -6
  159. package/dist/core/command/menu-catalog.js +80 -20
  160. package/dist/core/command/menu-handler.js +305 -25
  161. package/dist/core/command/menu-protocol.js +42 -8
  162. package/dist/core/command/menu-query-batch.js +9 -5
  163. package/dist/core/command/provider-menu.js +7 -11
  164. package/dist/core/command/role-menu.js +1 -1
  165. package/dist/core/command/skill-slash.js +17 -5
  166. package/dist/core/command/slash-gate.js +2 -4
  167. package/dist/core/command/slash-handler.js +127 -96
  168. package/dist/core/command/team-workspace-team.js +3 -3
  169. package/dist/core/command/topic-slash.js +10 -10
  170. package/dist/core/{daemon-bootstrap.js → daemon/daemon-bootstrap.js} +14 -14
  171. package/dist/core/{daemon-control.js → daemon/daemon-control.js} +46 -20
  172. package/dist/core/{daemon-lifecycle.js → daemon/daemon-lifecycle.js} +15 -15
  173. package/dist/core/{host-snapshot.js → daemon/host-snapshot.js} +3 -3
  174. package/dist/core/{ipc-registration.js → daemon/ipc-registration.js} +98 -38
  175. package/dist/core/{lifecycle-notice.js → daemon/lifecycle-notice.js} +4 -5
  176. package/dist/core/file-integrity/store.js +1 -1
  177. package/dist/core/handoff/ipc-registration.js +3 -3
  178. package/dist/core/handoff/runtime.js +1 -1
  179. package/dist/{agents → core/inference}/request-identity.js +2 -2
  180. package/dist/core/inference/text-inference.js +4 -4
  181. package/dist/core/{bootstrap-messages.js → initialization/bootstrap-messages.js} +10 -10
  182. package/dist/core/{bootstrap-service.js → initialization/bootstrap-service.js} +24 -23
  183. package/dist/core/initialization/service.js +54 -9
  184. package/dist/core/invoke/executors/media.js +1 -1
  185. package/dist/core/invoke/executors/text.js +1 -1
  186. package/dist/core/memory/consolidation-context.js +1 -1
  187. package/dist/core/memory/consolidation-trigger.js +9 -3
  188. package/dist/core/memory/consolidation.js +4 -4
  189. package/dist/core/memory/memory-admin.js +6 -6
  190. package/dist/core/memory/memory-writer.js +1 -1
  191. package/dist/core/memory/relation-idle-monitor.js +1 -1
  192. package/dist/core/message/aun-ipc-sender.js +114 -75
  193. package/dist/core/message/aun-request-registry.js +13 -5
  194. package/dist/core/message/auto-mention-gate.js +1 -1
  195. package/dist/core/message/contact-admission.js +1 -1
  196. package/dist/core/message/im-renderer.js +19 -0
  197. package/dist/core/{interaction-router.js → message/interaction-router.js} +4 -4
  198. package/dist/core/message/items-formatter.js +5 -5
  199. package/dist/core/message/message-admission.js +1 -1
  200. package/dist/core/message/message-bridge.js +135 -54
  201. package/dist/core/message/message-queue.js +83 -4
  202. package/dist/core/message/message-utils.js +1 -1
  203. package/dist/core/message/peer-mode.js +1 -1
  204. package/dist/core/message/response-engine.js +347 -163
  205. package/dist/core/message/send-options.js +9 -6
  206. package/dist/core/message/send-routing.js +45 -109
  207. package/dist/core/message/stream-idle-monitor.js +1 -1
  208. package/dist/core/{data-migration.js → migration/data-migration.js} +29 -1
  209. package/dist/core/model/catalog-service.js +29 -8
  210. package/dist/core/model/model-capabilities.js +88 -0
  211. package/dist/core/model/model-catalog.js +14 -3
  212. package/dist/core/model/model-diagnostics.js +4 -4
  213. package/dist/core/ownership/owner-resolver.js +95 -15
  214. package/dist/core/{pack-auth.js → pack/pack-auth.js} +30 -3
  215. package/dist/core/{pack-install.js → pack/pack-install.js} +95 -17
  216. package/dist/core/permission/approval-gateway.js +9 -18
  217. package/dist/core/permission/ec-command-parser.js +70 -34
  218. package/dist/core/permission/managed-file.js +234 -0
  219. package/dist/core/permission/protected-paths.js +56 -0
  220. package/dist/core/permission/sandbox-runtime.js +267 -3
  221. package/dist/core/permission/session-path-grants.js +1 -1
  222. package/dist/core/permission/shell-environment.js +15 -1
  223. package/dist/core/plugin/plugin-lifecycle.js +442 -0
  224. package/dist/core/session/adapters/claude-session-file-adapter.js +2 -246
  225. package/dist/core/session/adapters/codex-session-file-adapter.js +2 -566
  226. package/dist/core/session/adapters/ecagent-session-file-adapter.js +2 -134
  227. package/dist/core/{background-session → session/background}/session-cleanup.js +2 -2
  228. package/dist/core/{background-session → session/background}/types.js +1 -1
  229. package/dist/core/session/session-file-health.js +2 -272
  230. package/dist/core/session/session-idle-monitor.js +1 -1
  231. package/dist/core/session/session-manager.js +29 -2
  232. package/dist/core/session/session-terminal.js +185 -0
  233. package/dist/core/session/session-title.js +8 -11
  234. package/dist/core/{system-session → session/system}/memory.js +43 -9
  235. package/dist/core/{system-session → session/system}/registry.js +1 -1
  236. package/dist/core/{system-session → session/system}/types.js +1 -1
  237. package/dist/core/skill/index-generator.js +1 -0
  238. package/dist/core/task/task-activity-store.js +112 -0
  239. package/dist/core/task/task-recovery-service.js +2 -2
  240. package/dist/core/thread/ipc-operation.js +2 -2
  241. package/dist/core/thread/thread-operation.js +2 -1
  242. package/dist/core/thread/thread-route.js +5 -3
  243. package/dist/core/thread/thread-service.js +14 -4
  244. package/dist/directory/{owner-directory-admission.js → admission.js} +3 -3
  245. package/dist/directory/{owner-directory-cache.js → cache.js} +90 -8
  246. package/dist/directory/{owner-directory-markdown.js → markdown.js} +2 -2
  247. package/dist/directory/{owner-directory-query-operation.js → query-operation.js} +83 -9
  248. package/dist/directory/{owner-directory-search.js → search.js} +50 -2
  249. package/dist/directory/{owner-directory-store.js → store.js} +2 -2
  250. package/dist/eck/kit-renderer.js +1 -1
  251. package/dist/eck/manifest-engine.js +64 -2
  252. package/dist/eck/message-renderer.js +35 -0
  253. package/dist/ecweb/basic-settings-service.js +9 -3
  254. package/dist/{contracts → ecweb/contracts}/ecweb-service-protocol.js +2 -1
  255. package/dist/ecweb/dsh-native-service.js +413 -0
  256. package/dist/ecweb/providers-service.js +1 -1
  257. package/dist/ecweb/runtime/lifecycle.js +1 -1
  258. package/dist/ecweb/runtime/supervisor.js +1 -1
  259. package/dist/event-center/center-config.js +2 -2
  260. package/dist/event-center/dispatcher.js +1 -1
  261. package/dist/event-center/ipc-operation.js +12 -3
  262. package/dist/event-center/pack-loader.js +2 -2
  263. package/dist/event-center/registry.js +6 -6
  264. package/dist/event-center/runtime.js +2 -2
  265. package/dist/index.js +71 -42
  266. package/dist/ipc.js +103 -10
  267. package/dist/outputs/authorization.js +27 -0
  268. package/dist/outputs/events.js +10 -1
  269. package/dist/outputs/panel-cards.js +960 -0
  270. package/dist/paths.js +12 -0
  271. package/dist/pay/command.js +1 -1
  272. package/dist/pay/runtime.js +18 -10
  273. package/dist/response-system/engines/v1/proactive-flow.js +1 -1
  274. package/dist/services/dispatcher.js +2 -2
  275. package/dist/services/host/main.js +10 -1
  276. package/dist/services/host/protocol.js +9 -2
  277. package/dist/services/host/resident.js +37 -0
  278. package/dist/services/host-client.js +12 -0
  279. package/dist/services/host-recycle.js +8 -3
  280. package/dist/services/host-runtime.js +54 -15
  281. package/dist/services/index.js +83 -19
  282. package/dist/services/ipc-operation.js +303 -38
  283. package/dist/services/pack-manager.js +2 -2
  284. package/dist/services/router.js +43 -3
  285. package/dist/services/script-runner.js +34 -25
  286. package/dist/services/service-payload.js +28 -1
  287. package/dist/services/validation.js +28 -2
  288. package/dist/stats/context-usage.js +110 -0
  289. package/dist/stats/model-resolver.js +103 -17
  290. package/dist/stats/query.js +5 -0
  291. package/dist/trigger/application-service.js +3 -2
  292. package/dist/trigger/authorization.js +36 -33
  293. package/dist/trigger/ipc-service.js +4 -4
  294. package/dist/trigger/local-files.js +8 -176
  295. package/dist/trigger/manager.js +2 -2
  296. package/dist/trigger/parser.js +48 -0
  297. package/dist/trigger/scheduler.js +14 -2
  298. package/dist/trigger/script-executor.js +21 -0
  299. package/dist/trigger/script-sandbox.js +57 -243
  300. package/dist/trigger/system-definitions.js +25 -0
  301. package/dist/trigger/validation.js +1 -1
  302. package/dist/utils/atomic-write.js +88 -1
  303. package/dist/utils/cross-platform.js +4 -42
  304. package/dist/utils/error-dict.json +22 -1
  305. package/dist/utils/error-utils.js +193 -6
  306. package/dist/utils/evolcore-version.js +2 -2
  307. package/dist/utils/host-info.js +1 -1
  308. package/dist/utils/logger.js +3 -1
  309. package/dist/utils/media-cache.js +99 -4
  310. package/dist/utils/startup-trace.js +20 -4
  311. package/dist/utils/welcome.js +64 -20
  312. package/ecagent/README.md +35 -0
  313. package/ecagent/dist/agent-loop.js +80 -30
  314. package/ecagent/dist/harness/env/nodejs.d.ts +16 -0
  315. package/ecagent/dist/harness/env/nodejs.js +49 -20
  316. package/ecagent/dist/harness/messages.js +3 -2
  317. package/ecagent/dist/harness/types.d.ts +1 -0
  318. package/ecagent/dist/runtime/types.d.ts +2 -0
  319. package/ecagent/dist/runtime/utils/validation.d.ts +7 -1
  320. package/ecagent/dist/runtime/utils/validation.js +42 -0
  321. package/ecagent/dist/types.d.ts +2 -0
  322. package/kits/docs/INDEX.md +1 -1
  323. package/kits/docs/channels/feishu.md +1 -1
  324. package/kits/docs/evolcore/INDEX.md +10 -7
  325. package/kits/docs/evolcore/agent-create.md +2 -0
  326. package/kits/docs/evolcore/agent.md +100 -13
  327. package/kits/docs/evolcore/aid.md +19 -3
  328. package/kits/docs/evolcore/config.md +94 -0
  329. package/kits/docs/evolcore/ctl.md +2 -1
  330. package/kits/docs/evolcore/ec-capabilities.md +7 -10
  331. package/kits/docs/evolcore/ecweb-lifecycle.md +5 -1
  332. package/kits/docs/evolcore/event.md +1 -1
  333. package/kits/docs/evolcore/fs.md +49 -3
  334. package/kits/docs/evolcore/group.md +3 -3
  335. package/kits/docs/evolcore/memory-consolidation.md +1 -1
  336. package/kits/docs/evolcore/menu-protocol.md +24 -2
  337. package/kits/docs/evolcore/model.md +9 -1
  338. package/kits/docs/evolcore/msg.md +30 -28
  339. package/kits/docs/evolcore/pay.md +8 -20
  340. package/kits/docs/evolcore/plugin.md +74 -0
  341. package/kits/docs/evolcore/provider.md +8 -2
  342. package/kits/docs/evolcore/rpc.md +2 -2
  343. package/kits/docs/evolcore/skill.md +17 -1
  344. package/kits/docs/evolcore/stats.md +5 -0
  345. package/kits/docs/evolcore/storage.md +22 -0
  346. package/kits/docs/evolcore/thread-chain.md +19 -10
  347. package/kits/docs/evolcore/tool-authorization.md +4 -0
  348. package/kits/docs/evolcore/trigger.md +89 -13
  349. package/kits/docs/identity/AID_PROFILE_SPEC.md +1 -1
  350. package/kits/docs/venues/feishu-group.md +3 -2
  351. package/kits/docs/venues/feishu-private.md +3 -2
  352. package/kits/rules/02-navigation.md +20 -13
  353. package/kits/rules/06-channel.md +18 -2
  354. package/kits/schemas/_meta.json +8 -4
  355. package/kits/schemas/agent-config.schema.23.json +19 -3
  356. package/kits/schemas/agent-config.schema.24.json +986 -0
  357. package/kits/schemas/agent-config.schema.25.json +986 -0
  358. package/kits/schemas/daemon.schema.11.json +487 -0
  359. package/kits/schemas/daemon.schema.12.json +505 -0
  360. package/kits/schemas/defaults.schema.8.json +484 -0
  361. package/kits/schemas/providers.schema.1.json +1 -1
  362. package/kits/schemas/providers.schema.2.json +1 -1
  363. package/kits/schemas/providers.schema.3.json +8 -2
  364. package/kits/skills/.switches.json +4 -0
  365. package/kits/skills/ability/SKILL.md +194 -27
  366. package/kits/skills/ability/STRUCTURE.md +5 -0
  367. package/kits/skills/agent-output-cards/SKILL.md +90 -54
  368. package/kits/skills/agent-output-cards/examples/html-surface.json +11 -0
  369. package/kits/skills/agent-output-cards/examples/meeting-followups.json +16 -0
  370. package/kits/skills/agent-output-cards/examples/meeting-latest.json +24 -0
  371. package/kits/skills/agent-output-cards/examples/project-metrics.json +16 -0
  372. package/kits/skills/agent-output-cards/examples/quick-links.json +18 -0
  373. package/kits/skills/agent-output-cards/examples/surface.html +8 -0
  374. package/kits/skills/agent-template-project/SKILL.md +51 -0
  375. package/kits/skills/agent-template-project/references/01-collect-and-pack.md +174 -0
  376. package/kits/skills/agent-template-project/references/02-upload-and-share.md +109 -0
  377. package/kits/skills/agent-template-project/references/03-download-and-install.md +189 -0
  378. package/kits/skills/agent-template-project/references/04-upgrade-and-recovery.md +74 -0
  379. package/kits/skills/agent-template-project/references/05-publish-to-platform.md +62 -0
  380. package/kits/skills/ec-group/SKILL.md +3 -3
  381. package/kits/skills/ec-group-collaboration/SKILL.md +4 -4
  382. package/kits/skills/ec-identity/SKILL.md +9 -6
  383. package/kits/skills/ec-pay/SKILL.md +163 -41
  384. package/kits/skills/ec-provider/SKILL.md +5 -5
  385. package/kits/skills/ec-service-call/SKILL.md +3 -0
  386. package/kits/skills/ec-skill/SKILL.md +25 -9
  387. package/kits/skills/ec-skill/scripts/cli.mjs +7 -7
  388. package/kits/skills/ec-skill/scripts/skill.mjs +55 -41
  389. package/kits/skills/ec-skill/scripts/template/SKILL.md.tmpl +9 -0
  390. package/kits/skills/ec-trigger/SKILL.md +2 -2
  391. package/kits/skills/personal-assistant/SKILL.md +22 -22
  392. package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +1 -1
  393. package/kits/skills/scrapling-article-fetch/SKILL.md +5 -5
  394. package/kits/skills/thread-ops/SKILL.md +19 -9
  395. package/kits/skills/wechat-article-media-download/SKILL.md +2 -2
  396. package/kits/skills/wechat-article-reader/SKILL.md +2 -2
  397. package/kits/templates/system-fragments/commands.md +1 -1
  398. package/kits/templates/system-fragments/personal-assistant.md +2 -2
  399. package/kits/templates/system-fragments/reply.md +14 -9
  400. package/kits/templates/system-fragments/session.md +1 -1
  401. package/kits/templates/system-fragments/thread.md +10 -5
  402. package/package.json +6 -5
  403. package/scripts/agent-template/index.mjs +7 -1
  404. package/scripts/agent-template/inspect.mjs +81 -35
  405. package/scripts/agent-template/overlay.mjs +110 -4
  406. package/scripts/agent-template/shared/common.mjs +36 -4
  407. package/scripts/agent-template/shared/plan.mjs +4 -2
  408. package/scripts/agent-template/shared/service-packs.mjs +104 -0
  409. package/scripts/agent-template/shared/team-schema.json +467 -54
  410. package/scripts/agent-template/shared/template-contract.mjs +70 -68
  411. package/scripts/agent-template/shared/template-package.mjs +153 -36
  412. package/scripts/agent-template/shared/template-runtime.mjs +76 -64
  413. package/scripts/agent-template/shared/template.mjs +11 -46
  414. package/scripts/agent-template/team-pack.mjs +451 -35
  415. package/scripts/agent-template/team-preview.mjs +75 -226
  416. package/scripts/aid-batch/identity-batch.mjs +1 -1
  417. package/dist/agents/baseagent-availability.js +0 -176
  418. package/dist/agents/baseagent-capability-adapter.js +0 -102
  419. package/dist/agents/baseagent-plugin-loader.js +0 -145
  420. package/dist/agents/baseagent.js +0 -816
  421. package/dist/agents/codex/catalog.js +0 -80
  422. package/dist/agents/ecagent-plugin-lazy.js +0 -41
  423. package/dist/agents/tool-time-context.js +0 -55
  424. package/dist/core/legacy-rename.js +0 -41
  425. package/dist/core/plugin-lifecycle.js +0 -137
  426. package/dist/core/rate-window.js +0 -53
  427. package/dist/core/runner-reload-transaction.js +0 -60
  428. package/dist/core/runtime-lock.js +0 -90
  429. package/dist/core/soul.js +0 -66
  430. package/dist/core/system-session/grants.js +0 -40
  431. package/dist/directory/owner-directory-agentmd-sync.js +0 -89
  432. package/dist/directory/owner-directory-request-operation.js +0 -79
  433. package/dist/directory/owner-directory-text.js +0 -60
  434. package/kits/skills/ec-pay/references/pay-cli.md +0 -110
  435. /package/dist/agents/gemini/{gemini-capability-provider.js → capability-provider.js} +0 -0
  436. /package/dist/agents/gemini/{gemini-session-file-adapter.js → session-file-adapter.js} +0 -0
  437. /package/dist/{agents/claude-gateway → claude-gateway}/types.js +0 -0
  438. /package/dist/core/{system-channels.js → channel/system-channels.js} +0 -0
  439. /package/dist/core/{daemon-file-cache.js → daemon/daemon-file-cache.js} +0 -0
  440. /package/dist/core/{event-bus.js → event/event-bus.js} +0 -0
  441. /package/dist/core/{event-catalog.js → event/event-catalog.js} +0 -0
  442. /package/dist/core/{pack-ledger.js → pack/pack-ledger.js} +0 -0
  443. /package/dist/directory/{owner-directory-identity.js → identity.js} +0 -0
  444. /package/dist/directory/{owner-directory-policy.js → policy.js} +0 -0
  445. /package/dist/directory/{owner-directory-remarks.js → remarks.js} +0 -0
  446. /package/dist/directory/{owner-directory-scope.js → scope.js} +0 -0
  447. /package/dist/{contracts → ecweb/contracts}/ecweb-instance.js +0 -0
  448. /package/kits/templates/{bootstrap-welcome.md → bootstrap-intro.md} +0 -0
@@ -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/owner-directory-cache.js';
11
- import { registerOwnerDirectoryAdmission } from '../directory/owner-directory-admission.js';
12
- import { OwnerDirectoryAgentMdSync } from '../directory/owner-directory-agentmd-sync.js';
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 { acceptWidgetCardReply, cancelWidgetCard, readWidgetCard, registerWidgetCard } from '../core/interaction-router.js';
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,复用 claude-runner 已有的自定义输入分支
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, '⏳ 操作正在处理,请勿重复点击', cardClickerAid, threadId, cardDelivery);
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.info(`${this.logPrefix()} ownerResolver result: selfAid=${selfAid}, ownerAid=${ownerAid || 'undefined'}`);
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(`[图片: ${name} → ${attachment.filePath}]`);
3490
- logFileParts.push(`[图片: ${name} → ${toAttachmentMarkedPath(this.config.aid, attachment.filePath)}]`);
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(`[文件: ${name} → ${attachment.filePath}]`);
3504
- logFileParts.push(`[文件: ${name} → ${toAttachmentMarkedPath(this.config.aid, attachment.filePath)}]`);
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
- const text = this.extractTextPayload(payload, fromAid, fromAid, { chatType: 'private' }, !!env.encrypted);
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 } = contactControl
4315
- ? { finalText: text, logText: text, images: [] }
4316
- : await traceMenuStage(menuRequest, menuContext, menuTiming, 'aun.attachments', () => this.processAttachments(payload, text, fromAid, undefined, { chatType: 'private' }));
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: () => resolveRuntimePermissionMode({ selfAid: aid }).effectiveValue,
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 `ec msg send` running inside an agent task. */
7158
+ /** Daemon-side transport for `ecmsg send` running inside an agent task. */
7083
7159
  /**
7084
- * Agent 经 CLI 委托发送(ec msg send / ec group send)时占用本轮序号,
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
- // 跨话题自派(`--to <本端AID>`)不写出站日志:chatDir 会按 (to=本端, self=本端) 算成
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 侧代发的文件(`ec msg send --file` 走这条路径,不经 outbox)。
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 `[${label}: ${path.basename(filePath)} → ${toAttachmentMarkedPath(this.config.aid, archived.filePath)}]`;
7464
+ return formatAttachmentMarker(label, path.basename(filePath), toAttachmentMarkedPath(this.config.aid, archived.filePath), archived.storage);
7389
7465
  }
7390
- /** Daemon-side transport for `ec group send` running inside an agent task. */
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
- if (context?.debug)
7733
- payload.debug = { ...context.debug, sentAt: localTimestamp() };
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 { TemplateJobs, templateFingerprint, compareTemplateVersions } = await import('../agent-template/jobs.js');
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 (owner.ownerAid !== entry.channelId || config?.update?.mode === 'disabled' || !installed
7984
- || installed.ownerAid !== entry.channelId || installed.hostAid !== this.config.aid
7985
- || templateFingerprint(installed.source) !== notice.sourceDigest
7986
- || installed.release && compareTemplateVersions(installed.release.version, notice.candidateVersion) >= 0) {
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
- logger.info(`${this.logPrefix()} message.send (${payload.type}) ok: to=${this.peerLabel(targetAid)} mid=${mid} encrypt=${encrypt}`);
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
- ? `[图片: ${image.alt || path.basename(archived.filePath)} → ${toAttachmentMarkedPath(this.config.aid, archived.filePath)}]`
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
- ? `[文件: ${filename} → ${toAttachmentMarkedPath(this.config.aid, fileArchived.filePath)}]`
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: `[文件: ${filename} → ${toAttachmentMarkedPath(this.config.aid, archived.filePath)}]` }
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 text = typeof payload.payload === 'string' ? payload.payload : JSON.stringify(payload.payload);
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
  }
@@ -1,9 +1,9 @@
1
- import { appendExpireEntry, recordNextLaunchCleanup, cleanupPreviousByKind, runExpireCleanup, cleanupSessionRecord, } from '../core/background-session/session-cleanup.js';
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/system-session/registry.js';
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';
@@ -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 ? '⏱ 已授权同文件 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 分钟',
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 : `✅ ${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 = {
@@ -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';
@@ -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, `📎 文件已生成:${name}\n路径:${payload.filePath}`);
1044
+ await channel.sendMessage(channelId, `文件已生成:${name}\n路径:${payload.filePath}`);
1045
1045
  return;
1046
1046
  }
1047
1047
  case 'result.image': return;
@@ -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';