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/cli/data-command.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { resolvePaths, resolveRoot } from '../paths.js';
|
|
4
|
-
import { applyDataMigration, finalizeDataMigration, planDataMigration, readDataMigration, verifyDataMigration } from '../core/data-migration.js';
|
|
4
|
+
import { applyDataMigration, finalizeDataMigration, planDataMigration, readDataMigration, verifyDataMigration } from '../core/migration/data-migration.js';
|
|
5
5
|
import { scanInstances } from '../utils/instance-registry.js';
|
|
6
6
|
import { isProcessRunning, killProcess } from '../utils/cross-platform.js';
|
|
7
7
|
import { ipcQuery } from '../ipc.js';
|
package/dist/cli/debug-mode.js
CHANGED
|
@@ -12,6 +12,12 @@ import { ipcQuery } from '../ipc.js';
|
|
|
12
12
|
import { AGENT_DELEGATION_TOKEN_ENV } from '../core/auth/agent-delegation.js';
|
|
13
13
|
import { buildTaskRuntimeEnv } from './task-context.js';
|
|
14
14
|
const AS_SESSION_FLAG = '--as-session';
|
|
15
|
+
/**
|
|
16
|
+
* 由 `--as-session` 注入的身份标记。只有本文件会设置它:托管会话里的 agent
|
|
17
|
+
* 无法伪造(子进程环境由 daemon 构造,且 CLI 在托管会话中拒绝 `--as-session`)。
|
|
18
|
+
* 发送命令据此区分「调试身份」与「真实托管会话」。
|
|
19
|
+
*/
|
|
20
|
+
export const DEBUG_SESSION_ENV = 'EVOLCORE_DEBUG_SESSION';
|
|
15
21
|
function formatTimeAgo(ms) {
|
|
16
22
|
const s = Math.floor(ms / 1000);
|
|
17
23
|
if (s < 60)
|
|
@@ -134,6 +140,9 @@ export async function resolveDebugContext(args) {
|
|
|
134
140
|
const ctxWithoutEpoch = { ...runtimeContext, daemonRuntimeEpoch: undefined };
|
|
135
141
|
Object.assign(process.env, buildTaskRuntimeEnv(ctxWithoutEpoch));
|
|
136
142
|
process.env[AGENT_DELEGATION_TOKEN_ENV] = token;
|
|
143
|
+
// 标记这是调试注入的身份:`ec msg send` / `ec group send` 在普通托管会话里被禁用,
|
|
144
|
+
// 只在这条调试路径上放行——宿主终端需要一条能代表任意 agent 发消息的通道。
|
|
145
|
+
process.env[DEBUG_SESSION_ENV] = '1';
|
|
137
146
|
// peer / directory / fs 等命令只读 EVOLCORE_SELF_AID,不走 taskRuntimeContext,单独注入
|
|
138
147
|
if (runtimeContext.selfAid)
|
|
139
148
|
process.env.EVOLCORE_SELF_AID = runtimeContext.selfAid;
|
package/dist/cli/directory.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { resolvePaths } from '../paths.js';
|
|
2
2
|
import { daemonUnavailableMessage, getArgValue, isHelpFlag, queryDaemon, wantsHelp } from './help.js';
|
|
3
3
|
import { AGENT_DELEGATION_TOKEN_ENV, readDelegationCredential } from '../core/auth/agent-delegation.js';
|
|
4
|
-
import { DirectoryQueryError, executeDirectoryQueryCommand, resolveDirectoryQueryCommand, } from '../directory/
|
|
5
|
-
import { executeDirectoryRequestCommand, resolveDirectoryRequestCommand, } from '../directory/owner-directory-request-operation.js';
|
|
4
|
+
import { DirectoryQueryError, executeDirectoryQueryCommand, resolveDirectoryQueryCommand, executeDirectoryRequestCommand, resolveDirectoryRequestCommand } from '../directory/query-operation.js';
|
|
6
5
|
const QUERY_ACTIONS = new Set(['list', 'info', 'refresh', 'blocked', 'block', 'unblock']);
|
|
7
6
|
/**
|
|
8
7
|
* `ec directory ...`
|
|
@@ -15,7 +15,7 @@ import { GATEWAY_FLAG_ALIASES, GATEWAY_ROUTE_VALUE_FLAGS, isValidEncryptMode, MA
|
|
|
15
15
|
*
|
|
16
16
|
* 网关消费的:路由选项 + 三态 `--encrypt`;其余一律原样透传给下游通道,
|
|
17
17
|
* 因此 `--file` / `--link` / `--payload` / `--trigger-prompt` 等能力与
|
|
18
|
-
*
|
|
18
|
+
* 下游发送解析(`resolveManagedSendArgv`)天然一致,不存在"两边各实现一套"的漂移。
|
|
19
19
|
*/
|
|
20
20
|
const ROUTE_VALUE_FLAGS = new Set(GATEWAY_ROUTE_VALUE_FLAGS);
|
|
21
21
|
/** 原样透传给底层发送通道的选项(取一个值)。 */
|
|
@@ -30,7 +30,7 @@ export const BODY_FLAGS = new Set([
|
|
|
30
30
|
* 把 argv 切成「路由选项」「正文」「透传选项」三部分。
|
|
31
31
|
*
|
|
32
32
|
* 正文与透传选项原样交给底层通道,保证 `--file` / `--link` / `--payload` 等
|
|
33
|
-
*
|
|
33
|
+
* 能力与下游发送解析完全一致——网关不重新实现任何正文形态。
|
|
34
34
|
*/
|
|
35
35
|
export function parseGatewayArgs(args) {
|
|
36
36
|
const route = {};
|
|
@@ -51,10 +51,29 @@ export function parseGatewayArgs(args) {
|
|
|
51
51
|
route.help = true;
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
+
if (token === '--selfmode') {
|
|
55
|
+
route.selfMode = true;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
54
58
|
if (PASSTHROUGH_BOOLEAN_FLAGS.has(token)) {
|
|
55
59
|
passthrough.push(token);
|
|
56
60
|
continue;
|
|
57
61
|
}
|
|
62
|
+
// `--to` 已废弃:接收方由「话题 + 模式」推出。静默改写会让回执与实际
|
|
63
|
+
// 目标不一致,因此出现即报错,并给出按目标类型的替代写法。
|
|
64
|
+
if (token === '--to' || token.startsWith('--to=')) {
|
|
65
|
+
return {
|
|
66
|
+
ok: false,
|
|
67
|
+
code: 'TO_REMOVED',
|
|
68
|
+
error: '--to 已废弃:接收方由话题和模式推出。'
|
|
69
|
+
+ '当前话题直接省略;联系别的对端用 --thread main:<本端AID>:<对方AID>;'
|
|
70
|
+
+ '群消息用 --thread main:<本端AID>:<群AID>;跨话题自派用 --thread <话题id> --selfmode',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// `--selfmode` 无取值:写成 `--selfmode=true` 是参数错误,避免被当成正文。
|
|
74
|
+
if (token.startsWith('--selfmode=')) {
|
|
75
|
+
return { ok: false, error: '--selfmode 不接受取值,只写 --selfmode' };
|
|
76
|
+
}
|
|
58
77
|
// `--self` 是 `--from` 的别名:托管发送里本端恒为会话本端,两者同义。
|
|
59
78
|
const flag = GATEWAY_FLAG_ALIASES[token] ?? token;
|
|
60
79
|
if (ROUTE_VALUE_FLAGS.has(flag)) {
|
|
@@ -68,8 +87,6 @@ export function parseGatewayArgs(args) {
|
|
|
68
87
|
}
|
|
69
88
|
else if (flag === '--thread')
|
|
70
89
|
route.thread = value;
|
|
71
|
-
else if (flag === '--to')
|
|
72
|
-
route.to = value;
|
|
73
90
|
else if (flag === '--from')
|
|
74
91
|
route.from = value;
|
|
75
92
|
else if (flag === '--check-every')
|
|
@@ -99,6 +116,18 @@ export function parseGatewayArgs(args) {
|
|
|
99
116
|
}
|
|
100
117
|
text.push(token);
|
|
101
118
|
}
|
|
119
|
+
// 位置参数形态已废弃:`ecmsg send <from> <to> '<正文>'` 是照搬旧 CLI 位置参数的写法,
|
|
120
|
+
// 但网关不认位置 from/to,两个 AID 会被静默并入正文,消息实际发到当前会话对端,
|
|
121
|
+
// 回执却仍报 ok。这种「发错地方还报成功」的失败方式必须显式拒绝。
|
|
122
|
+
// 只拦「头部连续两个 AID」这一无歧义形态;正文本身确实以两个 AID 开头时用 `--` 分隔。
|
|
123
|
+
if (!endOfOptions && text.length >= 2 && looksLikeAid(text[0]) && looksLikeAid(text[1])) {
|
|
124
|
+
return {
|
|
125
|
+
ok: false,
|
|
126
|
+
error: 'ecmsg 不接受位置参数形式的发送方/收件人。本端恒为当前会话本端,'
|
|
127
|
+
+ '跨话题用 --thread <话题id>(默认委托,加 --selfmode 为自派);'
|
|
128
|
+
+ '若正文本身以两个 AID 开头,用 `--` 分隔后再写正文',
|
|
129
|
+
};
|
|
130
|
+
}
|
|
102
131
|
return { ok: true, route, passthrough, text };
|
|
103
132
|
}
|
|
104
133
|
/** 毫秒 → `20m` / `90s` / `2h` / `1d`,供下游 `--check-every` 使用。 */
|
|
@@ -137,26 +166,33 @@ function looksLikeAid(value) {
|
|
|
137
166
|
&& labels.every(label => /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(label));
|
|
138
167
|
}
|
|
139
168
|
export function buildDownstreamArgv(route, text, passthrough) {
|
|
140
|
-
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
169
|
+
// 自派一律走 msg:线上消息发给本端自己,落点由 --thread 决定。
|
|
170
|
+
// 委托的 scope 由话题对端类型决定(群话题 → group)。
|
|
171
|
+
const scope = route.recipient === 'self'
|
|
172
|
+
? 'msg'
|
|
173
|
+
: (route.peer.peerKind === 'group' ? 'group' : 'msg');
|
|
174
|
+
// 收件人:自派时是本端,否则是话题对端。下游按位置参数认目标,
|
|
175
|
+
// `--thread` 只决定落点会话。
|
|
176
|
+
const targetId = route.recipientId;
|
|
145
177
|
// 目标为原生 ID 时必须靠 --thread 推导,写成位置参数会变成正文的一部分。
|
|
146
178
|
const targetAsPositional = looksLikeAid(targetId)
|
|
147
179
|
|| (route.peer.peerKind === 'group' && !route.crossTopic);
|
|
148
180
|
const argv = targetAsPositional
|
|
149
181
|
? [scope, 'send', route.self, targetId, ...passthrough]
|
|
150
182
|
: [scope, 'send', route.self, ...passthrough];
|
|
151
|
-
//
|
|
152
|
-
//
|
|
183
|
+
// 首次联系:主话题的会话还没建立,带上 --thread 反而会被下游判成"话题不存在",
|
|
184
|
+
// 所以按普通私聊发出,会话随这条消息建立,也就没有复查可挂。
|
|
153
185
|
if (route.crossTopic && route.threadId && !route.firstContact) {
|
|
154
186
|
argv.push('--thread', route.threadId);
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
187
|
+
if (route.recipient === 'self') {
|
|
188
|
+
// 自派不建复查:显式标记,下游据此跳过「跨话题必须带 --check-every」的旧校验。
|
|
189
|
+
argv.push('--selfmode');
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// 委托:`checkEveryMs === undefined` 只可能是显式 `--check-every none`。
|
|
193
|
+
// 漏传会让下游看到「有 --thread 没 --check-every」而报错。
|
|
194
|
+
argv.push('--check-every', route.checkEveryMs ? formatDuration(route.checkEveryMs) : 'none');
|
|
195
|
+
}
|
|
160
196
|
}
|
|
161
197
|
// 三态原样下发:`auto` 不能在这里塌成二态——它要求下游按「本轮是否被对端
|
|
162
198
|
// 消息触发」决定,网关替它拍板会把会话首条消息锁成明文/密文之一。
|
|
@@ -169,11 +205,11 @@ export function buildDownstreamArgv(route, text, passthrough) {
|
|
|
169
205
|
/**
|
|
170
206
|
* 群 AID 的 base 简写展开(`g-18127` → `g-18127.agentid.cn`)。
|
|
171
207
|
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
208
|
+
* v2 起 `--to` 已废弃,群目标由 `--thread main:<self>:<群AID>` 表达(要求完整 AID);
|
|
209
|
+
* 本函数保留给历史调用方与单测,网关主流程不再使用。
|
|
174
210
|
*
|
|
175
211
|
* 只处理裸 base:已含 issuer 的值原样返回,私聊 AID 不受影响。
|
|
176
|
-
* issuer 取本端 AID
|
|
212
|
+
* issuer 取本端 AID 的域,与托管 group 操作的调用口径一致。
|
|
177
213
|
* 展开失败(非群 AID 形态)时同样原样返回,交给后续判定按私聊处理。
|
|
178
214
|
*/
|
|
179
215
|
export function expandGroupBase(selfAid, value, normalizeGroupAid) {
|
package/dist/cli/fs-command.js
CHANGED
|
@@ -3,6 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import { TextDecoder } from 'util';
|
|
4
4
|
import { getArgValue, isHelpFlag, wantsHelp } from './help.js';
|
|
5
5
|
import { agentmdGet, getAidStore, isValidAid, loadClient, SLOT } from '../aun/aid/index.js';
|
|
6
|
+
import { executeStorageAcl, parseStorageAcl } from '../aun/storage/index.js';
|
|
6
7
|
import { daemonUnavailableMessage, queryDaemon } from './help.js';
|
|
7
8
|
import { resolvePaths } from '../paths.js';
|
|
8
9
|
import { AGENT_DELEGATION_TOKEN_ENV, readDelegationCredential } from '../core/auth/agent-delegation.js';
|
|
@@ -34,7 +35,7 @@ Commands:
|
|
|
34
35
|
mkdir [-p] <AID>:<path> 创建目录
|
|
35
36
|
ln -s <target> <AID>:<path> 创建软链(personal storage)
|
|
36
37
|
chmod [mode] <AID>:<path> 切换公开/私有(personal storage)
|
|
37
|
-
setfacl <AID>:<path> -m|-x ... 设置/移除 ACL
|
|
38
|
+
setfacl <AID>:<path> -m|-x ... 设置/移除 ACL(个人空间支持通用 ACL JSON)
|
|
38
39
|
getfacl <AID>:<path> 查看 ACL
|
|
39
40
|
token issue|revoke|ls <path> 管理访问 token(personal storage)
|
|
40
41
|
find <AID>:<path> [filters] 查找节点
|
|
@@ -61,11 +62,13 @@ Options:
|
|
|
61
62
|
如 --allow-roles 'owner,admin'
|
|
62
63
|
-m aid:<aid>:<perms> setfacl 新增/更新 ACL
|
|
63
64
|
-x aid:<aid> setfacl 移除 ACL
|
|
65
|
+
-m '<ACL JSON>' 设置 ACL:subject/grantee_aid/grantee_aids 三选一,另传 perms
|
|
66
|
+
-x '<selector JSON>' 移除相同主体的 ACL;群路径仍使用 role:member|role:admin
|
|
64
67
|
--source <AID>:<path> mount 虚拟卷来源
|
|
65
68
|
--volume <id> mount 实体卷 ID
|
|
66
69
|
--require-approval mount 需要来源 owner 审批
|
|
67
70
|
--expires <time> mount/token/ACL 过期时间,Unix 秒或 ISO 日期
|
|
68
|
-
--max-uses <n> ACL
|
|
71
|
+
--max-uses <n> ACL 最大使用次数,0 不限;--expires 0 不过期
|
|
69
72
|
--max-reads <n> token 最大读取次数
|
|
70
73
|
--readonly, --readwrite mount 只读/读写
|
|
71
74
|
--name <glob> find 名称过滤
|
|
@@ -87,6 +90,7 @@ Options:
|
|
|
87
90
|
ec fs ln -s alice.agentid.pub:/private/report.md alice.agentid.pub:/public/report.md --as alice.agentid.pub
|
|
88
91
|
ec fs chmod +r alice.agentid.pub:/public/report.md --as alice.agentid.pub
|
|
89
92
|
ec fs setfacl alice.agentid.pub:/private/report.md -m aid:bob.agentid.pub:r --as alice.agentid.pub
|
|
93
|
+
ec fs setfacl alice.agentid.pub:/private/report.md -m '{"subject":{"ownership":{"owner_aid":"bob.agentid.pub"},"card":{"type":["host"]}},"perms":"r","expires_at":0,"max_uses":0}'
|
|
90
94
|
ec fs token issue alice.agentid.pub:/public/report.md --expires 2026-12-31 --as alice.agentid.pub
|
|
91
95
|
ec fs find alice.agentid.pub:/private/ --name "*.md" --as alice.agentid.pub
|
|
92
96
|
ec fs df alice.agentid.pub: --as alice.agentid.pub`;
|
|
@@ -273,6 +277,9 @@ async function runManagedFs(args, formatJson) {
|
|
|
273
277
|
case 'upload':
|
|
274
278
|
console.log(`✓ 已上传: ${result.localPath} -> ${result.path}`);
|
|
275
279
|
return;
|
|
280
|
+
case 'download':
|
|
281
|
+
console.log(`✓ 已下载: ${result.path} -> ${result.localPath}`);
|
|
282
|
+
return;
|
|
276
283
|
case 'copy':
|
|
277
284
|
console.log(`✓ 已复制: ${result.src} -> ${result.path}`);
|
|
278
285
|
return;
|
|
@@ -282,16 +289,19 @@ async function runManagedFs(args, formatJson) {
|
|
|
282
289
|
case 'remove':
|
|
283
290
|
console.log(`✓ 已删除: ${result.path}`);
|
|
284
291
|
return;
|
|
285
|
-
case 'link':
|
|
292
|
+
case 'link': {
|
|
286
293
|
console.log(`🔗 ${String(result.url ?? '')}`);
|
|
287
|
-
|
|
288
|
-
|
|
294
|
+
// storage 返回的 expire_at 是 Unix 秒;按毫秒解析会显示成 1970 年。
|
|
295
|
+
const expiry = formatLinkExpiry(result.expireAt);
|
|
296
|
+
if (expiry)
|
|
297
|
+
console.log(expiry);
|
|
289
298
|
return;
|
|
299
|
+
}
|
|
290
300
|
case 'getfacl':
|
|
291
301
|
console.log(JSON.stringify(result.result ?? {}, null, 2));
|
|
292
302
|
return;
|
|
293
303
|
case 'setfacl':
|
|
294
|
-
console.log(`✓ 已${result.removed ? '移除' : '设置'}
|
|
304
|
+
console.log(`✓ 已${result.removed ? '移除' : '设置'} ACL: ${result.path}`);
|
|
295
305
|
return;
|
|
296
306
|
}
|
|
297
307
|
}
|
|
@@ -856,8 +866,8 @@ async function fsSetfacl(args, opts) {
|
|
|
856
866
|
const target = parseRemoteRequired(positional[0], { command: 'setfacl' });
|
|
857
867
|
const modify = getArgValue(args, '-m');
|
|
858
868
|
const remove = getArgValue(args, '-x');
|
|
859
|
-
const
|
|
860
|
-
const maxUses =
|
|
869
|
+
const expires = getArgValue(args, '--expires');
|
|
870
|
+
const maxUses = getArgValue(args, '--max-uses');
|
|
861
871
|
if (!!modify === !!remove) {
|
|
862
872
|
throw new FsCliError('INVALID_ARGUMENT', 'setfacl 必须且只能指定 -m 或 -x', '用法: ec fs setfacl <AID>:<path> -m aid:bob.aid.pub:r');
|
|
863
873
|
}
|
|
@@ -866,35 +876,41 @@ async function fsSetfacl(args, opts) {
|
|
|
866
876
|
if (modify) {
|
|
867
877
|
if (route.backend === 'group') {
|
|
868
878
|
const [role, rolePerms] = parseGroupAclSpec(modify, true);
|
|
869
|
-
if (
|
|
879
|
+
if (expires !== undefined || maxUses !== undefined) {
|
|
870
880
|
throw new FsCliError('INVALID_ARGUMENT', '群空间 ACL 不支持 --expires 或 --max-uses');
|
|
871
881
|
}
|
|
872
882
|
const result = await client.group.fs.setAcl(remoteRef(target), { granteeAid: role, perms: rolePerms });
|
|
873
883
|
outputSuccess(opts, { command: 'setfacl', backend: route.backend, route, path: remoteRef(target), result }, () => console.log(`✓ 已设置群 ACL: ${remoteRef(target)}`));
|
|
874
884
|
return;
|
|
875
885
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
886
|
+
let acl;
|
|
887
|
+
try {
|
|
888
|
+
acl = parseStorageAcl(modify, false, { expires, maxUses });
|
|
889
|
+
}
|
|
890
|
+
catch (error) {
|
|
891
|
+
throw new FsCliError('INVALID_ARGUMENT', error.message);
|
|
892
|
+
}
|
|
893
|
+
const result = await executeStorageAcl(client, target.aid, target.path, acl, false);
|
|
884
894
|
outputSuccess(opts, { command: 'setfacl', backend: route.backend, route, path: remoteRef(target), result }, () => console.log(`✓ 已设置 ACL: ${remoteRef(target)}`));
|
|
885
895
|
return;
|
|
886
896
|
}
|
|
887
897
|
if (route.backend === 'group') {
|
|
898
|
+
if (expires !== undefined || maxUses !== undefined) {
|
|
899
|
+
throw new FsCliError('INVALID_ARGUMENT', '群空间 ACL 不支持 --expires 或 --max-uses');
|
|
900
|
+
}
|
|
888
901
|
const [role] = parseGroupAclSpec(remove || '', false);
|
|
889
902
|
const result = await client.group.fs.removeAcl(remoteRef(target), { granteeAid: role });
|
|
890
903
|
outputSuccess(opts, { command: 'setfacl', backend: route.backend, route, path: remoteRef(target), result }, () => console.log(`✓ 已移除群 ACL: ${remoteRef(target)}`));
|
|
891
904
|
return;
|
|
892
905
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
906
|
+
let acl;
|
|
907
|
+
try {
|
|
908
|
+
acl = parseStorageAcl(remove || '', true, { expires, maxUses });
|
|
909
|
+
}
|
|
910
|
+
catch (error) {
|
|
911
|
+
throw new FsCliError('INVALID_ARGUMENT', error.message);
|
|
912
|
+
}
|
|
913
|
+
const result = await executeStorageAcl(client, target.aid, target.path, acl, true);
|
|
898
914
|
outputSuccess(opts, { command: 'setfacl', backend: route.backend, route, path: remoteRef(target), result }, () => console.log(`✓ 已移除 ACL: ${remoteRef(target)}`));
|
|
899
915
|
});
|
|
900
916
|
}
|
|
@@ -1053,7 +1069,11 @@ async function fsLink(args, opts) {
|
|
|
1053
1069
|
url, expireAt: ticket.expire_at ?? null,
|
|
1054
1070
|
}, () => {
|
|
1055
1071
|
console.log(`🔗 ${url}`);
|
|
1056
|
-
|
|
1072
|
+
// 优先用服务端回的绝对过期时间;缺失时才回落请求的时长。
|
|
1073
|
+
const expiry = formatLinkExpiry(ticket.expire_at);
|
|
1074
|
+
if (expiry)
|
|
1075
|
+
console.log(expiry);
|
|
1076
|
+
else if (expiresSeconds !== undefined) {
|
|
1057
1077
|
console.log(expiresSeconds === 0 ? '有效期: 不过期' : `有效期: ${expiresSeconds} 秒`);
|
|
1058
1078
|
}
|
|
1059
1079
|
});
|
|
@@ -1366,22 +1386,6 @@ function parseVisibility(value) {
|
|
|
1366
1386
|
return 'private';
|
|
1367
1387
|
throw new FsCliError('INVALID_ARGUMENT', `不支持的 chmod 模式: ${value}`, '当前 ec fs chmod 只支持 +r/o-r,或 --visibility public|private。');
|
|
1368
1388
|
}
|
|
1369
|
-
function parseAclSpec(value, requirePerms) {
|
|
1370
|
-
const parts = value.split(':');
|
|
1371
|
-
if (parts.length < 2 || parts[0] !== 'aid' || !parts[1]) {
|
|
1372
|
-
throw new FsCliError('INVALID_ARGUMENT', 'ACL 条目格式应为 aid:<AID>:<perms> 或 aid:<AID>');
|
|
1373
|
-
}
|
|
1374
|
-
if (requirePerms) {
|
|
1375
|
-
if (parts.length !== 3 || !parts[2]) {
|
|
1376
|
-
throw new FsCliError('INVALID_ARGUMENT', 'setfacl -m 格式应为 aid:<AID>:<perms>');
|
|
1377
|
-
}
|
|
1378
|
-
return [parts[1], parts[2]];
|
|
1379
|
-
}
|
|
1380
|
-
if (parts.length !== 2) {
|
|
1381
|
-
throw new FsCliError('INVALID_ARGUMENT', 'setfacl -x 格式应为 aid:<AID>');
|
|
1382
|
-
}
|
|
1383
|
-
return [parts[1]];
|
|
1384
|
-
}
|
|
1385
1389
|
function parseGroupAclSpec(value, requirePerms) {
|
|
1386
1390
|
const parts = value.split(':');
|
|
1387
1391
|
if (parts[0] !== 'role' || !parts[1] || (parts.length !== (requirePerms ? 3 : 2))) {
|
|
@@ -1512,6 +1516,30 @@ function formatBytes(n) {
|
|
|
1512
1516
|
return `${(n / 1024).toFixed(1)}KB`;
|
|
1513
1517
|
return `${n}B`;
|
|
1514
1518
|
}
|
|
1519
|
+
/** Download expiry accepts Unix seconds, milliseconds, or an ISO date; zero never expires. */
|
|
1520
|
+
function formatLinkExpiry(value) {
|
|
1521
|
+
if (value === undefined || value === null || value === '')
|
|
1522
|
+
return undefined;
|
|
1523
|
+
if (typeof value === 'string') {
|
|
1524
|
+
const text = value.trim();
|
|
1525
|
+
if (!text)
|
|
1526
|
+
return undefined;
|
|
1527
|
+
if (!/^-?\d+$/.test(text)) {
|
|
1528
|
+
const parsed = Date.parse(text);
|
|
1529
|
+
return Number.isFinite(parsed) ? `有效期至: ${new Date(parsed).toISOString()}` : undefined;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
const numeric = Number(value);
|
|
1533
|
+
if (!Number.isFinite(numeric))
|
|
1534
|
+
return undefined;
|
|
1535
|
+
if (numeric === 0)
|
|
1536
|
+
return '有效期: 不过期';
|
|
1537
|
+
if (numeric < 0)
|
|
1538
|
+
return undefined;
|
|
1539
|
+
const millis = numeric > 1e12 ? numeric : numeric * 1000;
|
|
1540
|
+
const date = new Date(millis);
|
|
1541
|
+
return Number.isNaN(date.getTime()) ? undefined : `有效期至: ${date.toISOString()}`;
|
|
1542
|
+
}
|
|
1515
1543
|
function formatTimestamp(value) {
|
|
1516
1544
|
const ms = value > 10_000_000_000 ? value : value * 1000;
|
|
1517
1545
|
const d = new Date(ms);
|
package/dist/cli/index.js
CHANGED
|
@@ -27,6 +27,7 @@ const MAIN_HELP = `用法: ec <command> [选项]
|
|
|
27
27
|
upgrade 检查 EvolCore、EC Web 和 FASTAUN 是否有更新(只查询,不安装)
|
|
28
28
|
update 受理或复用唯一更新任务并异步执行(update status 查询进度)
|
|
29
29
|
status 查看运行状态(含 --format json 结构化快照)
|
|
30
|
+
plugin 查询、诊断及启停随包渠道和基座插件(部署变更需宿主重启)
|
|
30
31
|
logs 持续查看 daemon 日志
|
|
31
32
|
watch 打开日志、AID、消息或 EC Web 监控
|
|
32
33
|
|
|
@@ -50,13 +51,13 @@ Agent 与会话:
|
|
|
50
51
|
|
|
51
52
|
AUN:
|
|
52
53
|
aid 管理 AID 身份与 agent.md
|
|
53
|
-
msg
|
|
54
|
-
group
|
|
54
|
+
msg 私聊消息查询、撤回、在线状态与历史
|
|
55
|
+
group 群管理与本地群历史
|
|
55
56
|
|
|
56
57
|
发送消息请用独立入口 ecmsg(统一入口):
|
|
57
|
-
ecmsg send '<正文>'
|
|
58
|
-
ecmsg send '<正文>' --thread <话题id>
|
|
59
|
-
ecmsg send '<正文>' --
|
|
58
|
+
ecmsg send '<正文>' 回复当前会话
|
|
59
|
+
ecmsg send '<正文>' --thread <话题id> 跨话题委托(发给该话题对端)
|
|
60
|
+
ecmsg send '<正文>' --thread <话题id> --selfmode 跨话题自派(发给自己)
|
|
60
61
|
详见 ecmsg --help。
|
|
61
62
|
fs AUN 文件系统
|
|
62
63
|
storage 底层对象存储命令
|
|
@@ -111,7 +112,7 @@ export const KNOWN_TOP_LEVEL_COMMANDS = new Set([
|
|
|
111
112
|
'storage', 'fs', 'msg', 'thread', 'events', 'services',
|
|
112
113
|
'session', 'getmeta', 'group', 'model', 'skill', 'response',
|
|
113
114
|
'config', 'peer', 'directory', 'role', 'stats', 'quota',
|
|
114
|
-
'provider', 'invoke', 'ability', 'pay',
|
|
115
|
+
'provider', 'invoke', 'ability', 'pay', 'plugin',
|
|
115
116
|
// 版本三个别名在 switch 之前统一处理(含只在早期分支出现的 -V)。
|
|
116
117
|
'version', '-v', '-V', '--version',
|
|
117
118
|
'bench', 'link-rules',
|
|
@@ -220,9 +221,17 @@ export async function main(args) {
|
|
|
220
221
|
console.log(MAIN_HELP);
|
|
221
222
|
return;
|
|
222
223
|
}
|
|
223
|
-
|
|
224
|
-
|
|
224
|
+
// Managed template operations are delegated to the running daemon, which
|
|
225
|
+
// completed startup migration and plugin discovery before accepting sessions.
|
|
226
|
+
// The sandboxed CLI cannot inspect the protected marker or acquire its lock.
|
|
227
|
+
const delegatedTemplate = !!process.env.EVOLCORE_SESSION_ID && cmd === 'agent' && strippedArgs[1] === 'template';
|
|
228
|
+
if (['agent', 'config', 'model', 'provider', 'role', 'status', 'diagnose', 'plugin'].includes(cmd)
|
|
229
|
+
&& !wantsHelp(strippedArgs.slice(1)) && !delegatedTemplate) {
|
|
230
|
+
const { runBaseagentDeclarationMigration } = await import('../config/schema-migration.js');
|
|
231
|
+
runBaseagentDeclarationMigration({ apply: true });
|
|
232
|
+
const { discoverBaseagentPlugins } = await import('../core/baseagent/baseagent-plugin-loader.js');
|
|
225
233
|
await discoverBaseagentPlugins({ quiet: true });
|
|
234
|
+
await (await import('../core/channel/channel-loader.js')).discoverChannelPlugins();
|
|
226
235
|
}
|
|
227
236
|
switch (cmd) {
|
|
228
237
|
case 'init': {
|
|
@@ -234,7 +243,7 @@ export async function main(args) {
|
|
|
234
243
|
ec init 交互式(写完 defaults.json 后嵌套 agent new)
|
|
235
244
|
选择 ecagent 时会继续询问 API Key 和 Base URL
|
|
236
245
|
ec init --non-interactive [选项]
|
|
237
|
-
--baseagent <
|
|
246
|
+
--baseagent <name> 默认: PATH 中第一个可用项;ecagent 需显式选择
|
|
238
247
|
--force 已存在 defaults.json 时覆盖
|
|
239
248
|
|
|
240
249
|
通过 EC Web 完成首次初始化:
|
|
@@ -244,7 +253,7 @@ export async function main(args) {
|
|
|
244
253
|
云部署非交互式初始化(结构化 JSON 输出):
|
|
245
254
|
ec init --non-interactive --owner <aid> [--format json] [选项]
|
|
246
255
|
--owner <aid> 必填。控制 AID 创建后的 Owner 邀约目标,不等待审批
|
|
247
|
-
--baseagent <
|
|
256
|
+
--baseagent <name> 可选。默认从 PATH 检测,ecagent 需显式选择
|
|
248
257
|
--projectpath <abs-path> 可选。默认项目目录(必须绝对路径,自动创建)
|
|
249
258
|
--ecweb 兼容选项。检查 EC Web 安装;默认随 ec start 启动
|
|
250
259
|
--auto-start Windows/macOS 上启用 EvolCore 登录自启动
|
|
@@ -287,7 +296,8 @@ export async function main(args) {
|
|
|
287
296
|
await (await import('./init-channel.js')).cmdInitWecom();
|
|
288
297
|
}
|
|
289
298
|
else if (strippedArgs[1] && !strippedArgs[1].startsWith('-')) {
|
|
290
|
-
const
|
|
299
|
+
const { listChannelPluginDescriptors } = await import('../core/channel/channel-loader.js');
|
|
300
|
+
const supported = listChannelPluginDescriptors().map(item => item.name);
|
|
291
301
|
console.error(`❌ 不支持的渠道: ${strippedArgs[1]}`);
|
|
292
302
|
console.error(` 支持的渠道: ${supported.join(', ')}`);
|
|
293
303
|
process.exit(1);
|
|
@@ -676,6 +686,10 @@ export async function main(args) {
|
|
|
676
686
|
await cmdResponse(strippedArgs.slice(1));
|
|
677
687
|
break;
|
|
678
688
|
}
|
|
689
|
+
case 'plugin': {
|
|
690
|
+
await (await import('./daemon-commands.js')).cmdPlugins(strippedArgs.slice(1));
|
|
691
|
+
break;
|
|
692
|
+
}
|
|
679
693
|
case 'provider': {
|
|
680
694
|
const { cmdProvider } = await import('./provider-command.js');
|
|
681
695
|
await cmdProvider(strippedArgs.slice(1));
|