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
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# DeepSeek Harness adapter
|
|
2
|
+
|
|
3
|
+
Runtime sources live in `src/agents/dsh/runtime/`. Run `npm run build:core` before
|
|
4
|
+
launching from source or running native runtime fixtures. TypeScript compiles the
|
|
5
|
+
four native child modules to `.js` under `dist/agents/dsh/runtime/`. The desktop
|
|
6
|
+
probe and Windows installation-location script are host-side discovery helpers;
|
|
7
|
+
their compiled/assets output lives directly under `dist/agents/dsh/`.
|
|
8
|
+
|
|
9
|
+
The host-side adapter modules use responsibility names within the DSH directory:
|
|
10
|
+
|
|
11
|
+
| Module | Responsibility |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `../index.ts` | Plugin descriptor, capabilities and configuration validation |
|
|
14
|
+
| `../installation.ts` | Desktop/CLI discovery, inspection, installation identity and host admission |
|
|
15
|
+
| `../resources.ts` | Resource snapshots, authorization registry, session bindings, native inspection and catalog access |
|
|
16
|
+
| `../session-file-adapter.ts` | Authorized history reads, Core session metadata and EC takeover validation |
|
|
17
|
+
| `../runner.ts` | Host-runner lifecycle, task launch/revalidation, RPC and permission integration |
|
|
18
|
+
| `../desktop-probe.cts` | Installed Desktop manifest probe, launched by host discovery |
|
|
19
|
+
| `../desktop-locations.ps1` | Windows registry/shortcut installation discovery helper |
|
|
20
|
+
|
|
21
|
+
The native child runtime has four code files: `entry.ts` owns startup and shutdown;
|
|
22
|
+
`bridge.ts` defines task bindings and handles Host requests, native events and image offload;
|
|
23
|
+
`config.ts` validates plugins and storage; `session-inspector.ts` is the read-only inspection entry;
|
|
24
|
+
the desktop probe scripts run before native runtime admission and are not loaded by the child runtime.
|
|
25
|
+
Importing `entry.ts` exposes the boot function without starting a process.
|
|
26
|
+
Owned Node/Electron children always execute these compiled package artifacts.
|
|
27
|
+
|
|
28
|
+
The unreleased isolated implementation has been deleted, including its bundle, v1 entry, private session reader, configuration merge hooks and migration handling. The 2026-11-21 focused verification passed 65 tests, including the installed Windows desktop kernel, native resume/compaction, image tools and authorization revocation.
|
|
29
|
+
|
|
30
|
+
This adapter runs the pinned DSH `0.2.2-rc.5` in an owned process using its registered native Home, Profile and session store. Desktop and CLI installations use the same native-resource path. EvolCore owns task identity, ECK and authorization; DSH owns persistence.
|
|
31
|
+
|
|
32
|
+
## Native-sharing implementation status
|
|
33
|
+
|
|
34
|
+
Host admission selects a compatible desktop installation, or the installed CLI when no desktop is present. It records the native resource and registration revision in `defaults.baseagents.dsh`; new Agents inherit those resources. Only native storage is supported. Missing resources fail explicitly. Existing native sessions require separate binding consent. Provider, model and effort are independent optional EC overrides.
|
|
35
|
+
|
|
36
|
+
The bootstrap takes an explicitly supplied installed package, native Home/profile, project and a fresh empty directory below the current authorized `TMPDIR`. The caller must launch it in an owned child process with matching native Home and working directory. Windows uses the installed desktop Electron executable with `ELECTRON_RUN_AS_NODE=1`; an ordinary Node installation uses the same bootstrap. No desktop process or installed archive is modified.
|
|
37
|
+
|
|
38
|
+
Composition is filtered before native plugin activation:
|
|
39
|
+
|
|
40
|
+
- Only the pinned native Host and preset modules are admitted. Replacement modules, duplicate entries and untrusted configuration expressions fail closed. Native shipped expressions must match the trusted bundle at the same configuration position.
|
|
41
|
+
- Native `repeat-tool-reminder` and `timeout-policy` are retained with their Profile configuration. Repeated identical tool attempts, including Host denials, produce model reminders at the native thresholds (3/5/8 by default). A tool's declared `timeoutMs` triggers cooperative cancellation and `TOOL_TIMEOUT` only after its body settles; tools without a declared deadline retain their existing behavior. Host task authorization still applies to every attempt.
|
|
42
|
+
- Native `web_search` and `web_fetch` use the selected Profile's search and fetch backends. Search availability depends on the native provider's credentials; default fetch is anonymous and validates public HTTP(S) destinations. Both tools pass through EC's `WebSearch` / `WebFetch` tool policy before execution.
|
|
43
|
+
- Web app listeners and transports, HMR, settings writers, plugin management, scheduling, delegation and unknown extensions are excluded. Autostart Agents are cleared, background shell execution is disabled and the initial native sandbox is read-only.
|
|
44
|
+
- Native Provider and persistence definitions remain inputs. The bootstrap does not call settings or credential setters, replace the native persistence root or copy native Skills. It uses a temporary empty root with the native exported `boot` API instead of `runProfile`, which would materialize the original profile root and reread its patches.
|
|
45
|
+
- Native module resolution is anchored in the installed runtime and the empty temporary profile, not profile-installed replacement packages. Host services and every retained Agent preset must be ready before boot succeeds.
|
|
46
|
+
- With no task binding, all tool execution is denied, including an approved MCP's tools. The experimental P2 path below delegates the startup fence to the existing task bridge's real execution-token guard; it does not replace preflight with a placeholder permission callback.
|
|
47
|
+
|
|
48
|
+
MCP process startup is separate from tool authorization: configured servers are disabled unless the Owner grants startup for a matching SHA-256 fingerprint of the complete literal definition through the host Profile/MCP manager. A changed definition invalidates that approval, and native disabled servers stay disabled. The registry stores only approved fingerprints; the startup writer supplies them to the owned child, except for system maintenance sessions. Every tool call still passes task identity and EC policy checks; readonly denies calls and request uses the existing approval gateway. Revocation invalidates the running child at its next execution check; additions apply to the next task. Dynamic tool additions require a new task. The pinned native MCP SDK starts a disposable `server/discover` probe sibling before the session process. Third-party exclusive resources and startup side effects need separate acceptance.
|
|
49
|
+
|
|
50
|
+
On 2026-11-20, the focused suite passes **21 tests: 20 unit cases and one packaged Windows runtime case**, using isolated native data and the installed desktop `0.2.2-rc.5` runtime. The packaged case checks no listeners or autostart Agents, native user/project Skills, project `AGENTS.md` in the model request, scoped compaction availability, native history persistence, unchanged native profile bytes, MCP startup denial/approval and cleanup, and the default-deny tool boundary. Its model and stdio MCP are controlled fixtures; this is not real Provider authentication, GUI handoff, compression execution or production Runner acceptance. It does not prove every native migration or every plugin is safe in concurrent Hosts.
|
|
51
|
+
|
|
52
|
+
Run the unit cases with:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
node --test tests/dsh-native-shared-profile.node.mjs
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
To include the packaged case, supply `DSH_TEST_PACKAGE_PATH` (the installed native package manifest), `DSH_TEST_EXECUTABLE` (desktop Electron or a supported Node), `DSH_TEST_NODE_PATH` (Node for the stdio fixture), and the current authorized `TMPDIR`. Desktop Electron additionally requires `DSH_TEST_ELECTRON=1`. Keep the installation's `DSH_PRIMARY_RUNTIME` available when its sandbox requires it. Without the explicit package and executable, only the native case is skipped. No paid model requests or production credentials are used.
|
|
59
|
+
|
|
60
|
+
### P1 discovery and resource snapshots
|
|
61
|
+
|
|
62
|
+
`src/agents/dsh/installation.ts` now discovers Windows desktop candidates from read-only HKCU/HKLM registry views, a bounded set of Start Menu shortcuts and known installation locations. The PowerShell helper uses Registry/shortcut APIs and UTF-8 JSON instead of parsing localized `reg.exe` output. It never executes an uninstall command, a shortcut's arguments, or a registry command string, and does not recursively scan user directories.
|
|
63
|
+
|
|
64
|
+
The fixed `desktop-probe.cjs` runs under that installation's Electron with `ELECTRON_RUN_AS_NODE=1`. It reads only the app/native package manifests using built-in modules; no native profile, user plugin or credential service is loaded. Probe processes do not inherit `NODE_OPTIONS`, `NODE_PATH`, DSH credentials or EC task authority. Input/output, duration and manifest sizes are bounded. Installation records carry a stable canonical-path ID and a separate revision derived from physical executable/archive identity and package manifests. Probing and pre-use revalidation reject a concurrently changed or subsequently replaced installation.
|
|
65
|
+
|
|
66
|
+
`DSH_DESKTOP_PATH` is an explicit **daemon-launch** executable override, not an Agent-supplied execution path. An invalid explicit override fails without choosing another installation. Metadata probing may detect a CLI first; host admission separately prefers a compatible desktop. Multiple compatible desktop candidates require an explicit installation ID; incompatible older copies do not make a sole compatible installation ambiguous. Incomplete discovery cannot automatically select one. All execution requires registered native resources.
|
|
67
|
+
|
|
68
|
+
The BaseAgent inventory/ECWeb snapshot receives `installed=true`, the native version and package path for a valid desktop-only installation. Dependency compatibility and runtime availability remain distinct. Selection is confirmed once through process plugin management; ECWeb, Menu and CLI use the same admission service. Running daemons need a host-controlled restart of the built code; the implementation does not restart them.
|
|
69
|
+
|
|
70
|
+
`src/agents/dsh/resources.ts` provides platform-neutral resource snapshots and revalidation: canonical Home/profile paths, installation ID/revision, directory identity and profile-manifest revision. It rejects relative paths, profiles outside `Home/profiles`, junctions/symlinks anywhere in those paths, and later directory or profile-manifest replacement. It only reads a bounded profile package manifest; native patches and credentials are not loaded. Ordinary credential or patch updates do not invalidate the identity snapshot and must be evaluated separately at runtime. Its installation identity input must already have been revalidated by the platform adapter. The snapshot alone is not an authorization grant. CLI and desktop resources use the same snapshot semantics without requiring Electron on Linux.
|
|
71
|
+
|
|
72
|
+
`resources.ts` persists authorization-bound resource registrations and separate EC-session/native-session mappings. Registration requires explicit consent, both current daemon and Agent ownership versions, a CAS revision, physical installation revalidation and integrity verification. Startup revalidates the Agent, resource, registration revision, native ID, EC session and canonical project. Resource replacement or revocation invalidates existing session bindings. Daemon-owner-authenticated ECWeb endpoints expose installation discovery, resource preview/register/revoke, session preview/bind/revoke and status; no CLI or Menu registration endpoint exists. Selecting a registered resource uses the existing Agent configuration transaction. Test ownership consensus is mocked; live management acceptance is described below.
|
|
73
|
+
|
|
74
|
+
### Observed-session binding and desktop handoff
|
|
75
|
+
|
|
76
|
+
`POST /api/dsh/native/:agentAid/sessions/preview` takes the EC session, registered resource/revision, selected native session and project. The daemon revalidates ownership and the installation/resource, then starts the fixed `session-inspector.js` child via the installed runtime. Startup data travels over fd 3; environment overrides, delegated EC authority and diagnostic secrets are excluded. The child resolves the approved native persistence configuration and mounts only the pinned persistence service. It opens the session read-only, verifies ID/project, rejects an unfinished turn, checks the physical revision and content hash before/after the read, and returns metadata without history text or credentials. It does not run an Agent, Provider, MCP or profile plugin.
|
|
77
|
+
|
|
78
|
+
The preview issues a random daemon-local receipt valid for two minutes, tied to Owner, Agent, EC session, resource registration, registry revision and the observed session/configuration fingerprint. `POST /api/dsh/native/:agentAid/sessions` requires that receipt and explicit `native-session` consent. A receipt is consumed before asynchronous revalidation; retries after failure require a fresh preview. Binding re-reads the native session, compares the fingerprint and revalidates ownership/resource state under the registry write transaction. Expired, reused, foreign, changed-session and stale-registry requests fail closed. A daemon restart invalidates pending receipts; existing authorized bindings persist. Merely supplying a native ID cannot bind a session. Read access does not acquire writer ownership; execution still requires the native cross-process write lease.
|
|
79
|
+
|
|
80
|
+
The current focused verification passes 56 Node test cases with zero failures and zero skips: 41 profile/discovery/native-task cases plus 15 registry/launch/Runner cases. These counts include nested tests. The registry cases cover native-observation requirements, changed-session rejection, receipt expiry and concurrent reuse, stale CAS revisions, ECWeb API receipt validation, and actual packaged-runtime inspection/resume. TypeScript/core and ECWeb builds and `git diff --check` pass. Registry ownership tests use mocked consensus and do not establish live ECWeb authentication acceptance.
|
|
81
|
+
|
|
82
|
+
On 2026-11-20 a manually created desktop `0.2.2-rc.5` session was checked through this inspector: ID/project matched, 22 events were read, and native file bytes remained unchanged. While the desktop held it, a native write-open failed with `SessionAlreadyOwnedError`. After the Owner completely quit the desktop, write-open succeeded and immediate release again preserved the file. The fixed v2 bridge then resumed the same session using native Provider selection (`deepseek-v4-pro`) and correctly returned the earlier test marker. After reopening the desktop, the Owner confirmed that its reply reproduced the bridge-added user message; a later native read found 55 events under the same ID. This is evidence for desktop → independent bridge → desktop history continuity and desktop-exit lease release. This initial direct bridge acceptance did not exercise production ECWeb authentication or the registry path, uninterrupted execution during desktop exit, or desktop conflict handling while EC owns the lease; later management and conflict checks are recorded separately below.
|
|
83
|
+
|
|
84
|
+
Follow-up live acceptance on the same day exercised the running ECWeb HTTP → authenticated local IPC → daemon path, using the real Owner consensus and the same installed desktop resource. Resource preview/registration, native-session preview, receipt binding, status and both revocations returned HTTP 200. A simulated forwarded request without authentication and an invalid bearer token returned HTTP 401; forged and replayed session receipts returned HTTP 400 with `DSH_SESSION_RECEIPT_INVALID`. The session preview returned the real native ID/project/preset and 55 events. The isolated acceptance mapping and resource registration were subsequently revoked; the final production registry had zero resources and zero session mappings. This proves the live management path, not a normal channel task executed through the newly registered mapping or a completed browser selection UI.
|
|
85
|
+
|
|
86
|
+
Reverse writer exclusion was also checked with the original desktop closed: the fixed v2 EC bridge held the native session open without making a model request, and a second native writer was rejected. The Owner reopened the desktop and reported its exact occupied-session error: `当前会话已被占用,可能是其他正在运行的DSH导致的(如其他dshweb、桌面端),请退出其他正在运行的DSH后重试。` At the subsequent check, both acceptance holder processes had exited during the tool/question handoff; no graceful bridge-close receipt was observed. A native probe then acquired/released the lock without changing the file. The Owner retried the desktop request and received a reply; native inspection found 70 events and an idle session under the original ID. This establishes desktop-side conflict refusal and recovery after holder exit, rather than uninterrupted background execution or an automatically coordinated handoff. The earlier controlled tests separately cover graceful close/disposal. No production DSH activation or desktop configuration change was made by these live checks.
|
|
87
|
+
|
|
88
|
+
`runner.ts` prepares fixed executable/argv and a one-use fd-3 startup record after task/resource/session revalidation, with an environment that excludes EC delegation credentials and Node import overrides. It reuses its existing RPC, preflight, permission gateway, cancellation and owned-process cleanup for the native-sharing route. It inherits the native Profile model by default or uses explicitly selected EC overrides, checking the actual model against role policy before input and at subsequent authorization boundaries. New native IDs are committed to the authorization registry after Host binding confirmation and before model input. Existing bindings are revalidated at task/tool boundaries and cannot silently move to another configured resource. Native Skill discovery and loading are filtered by the task's EC capability policy; execution rechecks current policy. Owner-authorized shared forks use the native seed builder and a separate Host destination binding, as described below. Native history requires a current session grant and uses only the native persistence reader.
|
|
89
|
+
|
|
90
|
+
`config.ts` validates plugin configuration and persistence destinations before native plugin activation. Session, storage, credential, attachment and spill roots must remain under the registered native Home or owned runtime; junctions, outside roots and alternate storage backends are rejected. The shipped root expressions are resolved without evaluating profile code, preserving authorized custom native locations. Spill cleanup is disabled for this owned launch. Legacy credential layouts that the native provider would migrate are refused before boot so shared startup cannot silently rewrite desktop credentials. Native account refresh behavior is not yet accepted; EC does not write DSH settings back.
|
|
91
|
+
|
|
92
|
+
The combined focused suite includes installed Desktop boot, actual native task execution/resume/compaction, registration-to-fixed-entry handshake, resource/session consent/revocation, storage redirection/junction denial and credential migration refusal. An additional executable Runner fixture uses the installed kernel and its native Messages adapter against a loopback SSE model: it resumes one session for three tasks, checks ECK/project instructions and a denied file tool result, rejects a revoked binding before any model request, then creates a new session and resumes it. Native credentials and profile bytes remain unchanged. These are controlled Provider/MCP fixtures; real Provider authentication, ownership network consensus, GUI handoff and the complete production Runner contract are not covered. Test logs are kept under the authorized session `TMPDIR`.
|
|
93
|
+
|
|
94
|
+
Focused P1 verification is available through `node --import tsx --test tests/fixtures/dsh-desktop-installation.node.ts`. Setting `DSH_TEST_DESKTOP_PATH` additionally enables the installed-Windows-runtime case. Tests cover fixed probe argv/environment, protocol validation, incompatible versions, install replacement, ambiguous/deduplicated candidates, explicit failures, resource replacement/junction rejection, CLI resource snapshots and the generic inventory's compatibility/availability distinction. Local desktop discovery on 2026-11-20 finds one valid `0.2.2-rc.5` installation through registry, shortcut and known-location sources; these sources deduplicate to one physical executable, not three installations. This does not claim a recursive census of all copies on disk.
|
|
95
|
+
|
|
96
|
+
### P2 experimental native task bridge
|
|
97
|
+
|
|
98
|
+
`bridge.js` defines the separate `evolcore-dsh/2` startup binding: a fresh launch UUID, installation/resource IDs and revisions, canonical project, exact native session (or explicit creation), operation and all five EC task identity fields. Initialization must match the whole binding before any session access. Run, compaction and read-only history use separate operation-bound child processes; another session, project, task generation or operation is rejected. Forking stays explicitly unavailable until its binding transaction exists.
|
|
99
|
+
|
|
100
|
+
`bridge.ts` exposes `createNativeSharedTaskBridge` and handles image offload after HTTP body rejections. It uses protocol v2 with mandatory task bindings, preflight, immutable-argument hashes, native execution-token grants, result callbacks, cancellation and input deduplication. The bootstrap awaits the bridge's Cordis fiber after native dependencies settle and rejects an inactive bridge. The startup default-deny guard stays installed and delegates only to that bridge guard.
|
|
101
|
+
|
|
102
|
+
`entry.ts` compiles to the fixed owned-child entry `entry.js` for the shared Runner and owns its bootstrap and shutdown. The parent sends one bounded startup JSON record through inherited pipe **fd 3** and closes that pipe; stdin/stdout remain exclusively JSON-RPC. Paths, MCP approvals and task bindings are not command-line arguments. The startup channel has a 64 KiB bound and 15-second timeout, rejects extra fields and a package-anchor mismatch, and never imports a caller-supplied module. Normalized package diagnostics and generic failures go to stderr without raw config, credentials or native exception bodies. Incoming requests wait until the whole bootstrap is ready. Parent disconnect/termination aborts startup admission and disposes the owned runtime. This is a launch transport, not an externally accessible resource-selection API.
|
|
103
|
+
|
|
104
|
+
Native sessions mount their original preset before input admission, validate both original and current project, and retain native Skill discovery/loading. EC supplies its own model/effort selection; imported skill snapshots are rejected. Allowed tool definitions are pinned at session setup; replacements or newly arriving definitions fail closed. Host-normalized tool arguments are used at dispatch. The native skill loader retains its exact registration identity, which is required for its catalog to remain visible, and still passes through Host preflight and the execution-token guard. Native compaction uses the Agent preset's scoped service, not a nonexistent global compaction service. Native persistence APIs read the original compressed history; the private JSONL adapter is not used.
|
|
105
|
+
|
|
106
|
+
The focused suite is `node --test tests/fixtures/dsh-native-shared-task.node.mjs`: four binding unit cases plus three executable cases, enabled by `DSH_TEST_PACKAGE_PATH`, `DSH_TEST_EXECUTABLE`, `DSH_TEST_ELECTRON=1` for Desktop Electron, and the authorized `TMPDIR`. The Windows native case exercises create/run, normalized file input, denied file execution, native Skill loading, ECK and `AGENTS.md`, input deduplication, idle writer exclusion, cross-project rejection, restart/resume, native default changes versus retained session selection, actual scoped compaction, compressed history reads through the fixed fd-3 entry, cancellation and post-cancellation resume. The native task case also verifies inference controls and tool preflight. A separate entry test rejects malformed/oversized startup input without leaking its sensitive marker. These are not complete production CLI/Runner or real Messages Provider acceptance. All data and model responses are isolated fixtures, with evidence under the current `TMPDIR`.
|
|
107
|
+
|
|
108
|
+
On 2026-11-20 the combined P0/P1/P2 run reports **41 passing Node test cases, zero failures and zero skips**, including the installed Windows runtime cases. This count includes the test runner's nested-test accounting; it is not 41 independent production acceptance items.
|
|
109
|
+
|
|
110
|
+
**The v2 binding alone is correlation and scope validation, not resource authorization or installation attestation.** Direct bridge tests supply fixture identities. The Runner adds installation/resource revalidation, storage checks, persistent session mappings and current task/ownership checks. Resource/session management APIs and the live local ECWeb authorization chain have been exercised, alongside desktop conflict refusal and post-exit recovery. The browser resource manager has also been run against the restarted local HTTP service with real daemon IPC, native discovery and explicit cleanup. Ordinary channel-task acceptance, remote pairing acceptance, MCP startup grants, native model/Provider selection and import, catalog filtering, uninterrupted lifecycle behavior and Linux shared-mode regression remain open. The new resource-aware factory is opt-in; no existing Agent is switched automatically.
|
|
111
|
+
|
|
112
|
+
### ECWeb resource and session management
|
|
113
|
+
|
|
114
|
+
The Agent edit drawer has a **DSH native resources and sessions** entry. It lists discovered desktop installations, offers suggested Home/Profile paths, verifies an explicit selection, then requires a separate resource-sharing confirmation. Provider configuration is read only; registering a resource does not enable a Runner or alter the active baseagent. Multiple compatible installations require explicit selection. Resource and session access can be revoked independently.
|
|
115
|
+
|
|
116
|
+
`POST /api/dsh/native/:agentAid/sessions/discover` lists native session metadata for one registered resource and canonical project. The pinned persistence plugin runs without an Agent, Provider, tools or MCP. Results contain only ID, project and preset, in pages of 20 with a bounded offset; discovery does not read conversation bodies. The manual desktop handoff session was found using this path on 2026-11-20; its history hash was unchanged before/after listing. This is not a new GUI handoff test.
|
|
117
|
+
|
|
118
|
+
`GET /api/dsh/native/:agentAid/candidates` exposes eligible existing EC conversations through the live daemon SessionManager, rather than accepting arbitrary EC IDs as evidence of ownership. Initial takeover is limited to this Agent's idle, unbound DSH private conversations with its Owner, in the same project. Deleted, archived, auxiliary, foreign, already-bound and other-baseagent sessions cannot be targets. Preview and bind revalidate both the EC conversation and the native snapshot; the one-use two-minute receipt pins their revisions. Both operations use the existing queue session barrier, checking admitted, queued and running work before proceeding. Native writer contention remains handled by DSH's own session lock.
|
|
119
|
+
|
|
120
|
+
The browser clears stale previews on input changes and errors, requires separate session-history consent and never automatically retries a write. It retains the distinction between resource registration, session mapping and usable execution. Validation covers escaped installation/candidate text, consent, busy rejection, receipt submission, revoked access, cancellation and dialog cleanup. The restarted local HTTP service was tested using the served UI module: registration, native discovery, invalid-EC-ID refusal and revocation passed; simulated forwarded and invalid-bearer requests returned 401. Native history bytes were unchanged and all temporary production registrations were revoked. This was a DOM interaction check against real HTTP/IPC, not a visual browser or full channel acceptance.
|
|
121
|
+
|
|
122
|
+
### Explicit runtime selection and shared history
|
|
123
|
+
|
|
124
|
+
Use the host BaseAgent settings to register the native installation, Home and Profile. Agent configuration inherits that resource; existing native sessions still require explicit binding.
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{"baseagents":{"dsh":{"runtimeMode":"native-shared","nativeResourceId":"dsh-resource-<64 lowercase hex characters>","nativeRegistrationRevision":"<registration UUID>"}}}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The configuration schema and factory require registered native resources and reject runtime-path overrides. Provider, model and effort inherit or override independently like other BaseAgents. A missing Provider retains the native connection even when model or effort is configured. Overrides use an in-memory AgentModel and preserve the original native choice for desktop resume; an EC Provider is registered only when explicitly configured. Request history records the actual model. DSH settings and credentials remain DSH-owned.
|
|
131
|
+
|
|
132
|
+
The shared history reader uses bounded native persistence pages, revalidates session authorization between pages and at completion, and refuses a changing snapshot or revoked grant without returning partial history. It does not start an Agent, Provider or MCP and never writes the source log. Runner history and asynchronous menu summaries use this reader. Synchronous file checks report shared storage as unavailable rather than treating an absent private JSONL as deletion, preserving the native ID for authoritative Runner validation.
|
|
133
|
+
|
|
134
|
+
Current focused verification includes 17 registry/launch/Runner checks, 2 configuration/factory checks and DOM checks for both resource selection and the existing Agent update transaction. The installed-kernel Runner case now uses the descriptor factory, resumes a native session for three turns, reads first/last user messages, refuses a missing-role model call before input admission, and creates/resumes a new native session. Profile/credential bytes remain unchanged. Tests use isolated native data and a loopback model; successful normal channel execution with a real Provider after the new factory is loaded remains the next acceptance gate.
|
|
135
|
+
|
|
136
|
+
A missing native-resource selection fails before a Runner is created. The adapter has no separate Home, EC-private session reader, v1 bridge, or configuration-migration path.
|
|
137
|
+
|
|
138
|
+
Resource discovery does not authorize access or bind existing history. Saving native host resources grants the configured scope. Resource/session ownership, project and revision checks still run before every task.
|
|
139
|
+
|
|
140
|
+
DSH uses the standard BaseAgent configuration merge for Provider/model/effort settings and Agent overrides. Missing individual fields defer to the native Profile. Agent activation and incoming-message admission respect native selection; the Runner checks the actual model against role policy before input.
|
|
141
|
+
|
|
142
|
+
## Prerequisites and configuration
|
|
143
|
+
|
|
144
|
+
Use a compatible installed Desktop or `@deepseek-ai/dsh@0.2.2-rc.5` CLI and an existing native Home/Profile. CLI execution requires Node >=24.9. Linux requires the EvolCore bubblewrap protection layer. Windows uses the native process/sandbox dependencies of the selected installation.
|
|
145
|
+
|
|
146
|
+
Install globally with `npm install -g @deepseek-ai/dsh@0.2.2-rc.5` under a supported Node version. The adapter resolves the global DSH package from PATH and prefers the Node executable belonging to that npm prefix, then checks PATH and the Host executable for Node >=24.9. An EvolCore Host running Node 22 can therefore use DSH installed under nvm Node 24. The CLI JS entry is executed with Node directly, including on Windows. `DSH_PACKAGE_PATH` and `DSH_NODE_PATH` in the **daemon launch environment** remain explicit overrides; an explicit Node override that fails validation is not silently replaced. Agent `packagePath`/`nodePath` overrides do not change the daemon inventory probe. Installation discovery remains independent of declaration and does not register or enable a Runner.
|
|
147
|
+
|
|
148
|
+
Merge this deployment declaration through the existing daemon configuration entry:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{"plugins":{"baseagent:dsh":{"enabled":true,"force":false}}}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Merge the selection into the intended Agent configuration:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"active_baseagent":"dsh",
|
|
159
|
+
"baseagents":{
|
|
160
|
+
"dsh":{"provider":"provider-12345678","model":"actual-deepseek-model-id","effort":"high"}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The Provider may reuse its existing `claude` service (a Messages protocol group, independent of the actual model name). If a dedicated `dsh` service exists, it takes precedence and must use Messages style: `claude`, `anthropic`, `anthropic-messages` or `messages`. The service-specific endpoint, key, catalog path and model policy are resolved by the existing Host registry. There is no fallback to `text` or to a different model when a configured service fails. For DeepSeek's public API the Messages base URL is `https://api.deepseek.com/anthropic`. Keep credentials in the Provider registry. OpenAI-only endpoints, custom headers/query parameters and untested authentication variants are rejected.
|
|
166
|
+
|
|
167
|
+
`effort` accepts only the native adapter's `off`, `low`, `high`, `max` values. It is passed as that exact value and validated again against native model metadata before input delivery. A per-run `model_default` clears a saved effort instead of inheriting it from the resumed session. Host model menus intersect exact gateway effort metadata with DSH's supported levels; unknown metadata offers no explicit level. C12 accepts `maxOutputTokens` (integer 1–256000), `temperature` (0–2), and `stop` (up to 16 nonempty strings, at most 1024 characters each). Plugin config supplies defaults; `AgentRunOverrides.inference` replaces individual fields for one run, including a resumed run. The native request maps these to `max_tokens`, `temperature`, and `stop_sequences`. `topP`, unknown fields and invalid values are rejected before input delivery. A thinking-enabled DeepSeek model may ignore temperature. Compaction retains its native summary limits. No global process configuration is changed by a per-run override.
|
|
168
|
+
|
|
169
|
+
After a host-controlled restart, use the existing `ec plugin show baseagent dsh --format json` and `ec plugin doctor baseagent dsh --format json` commands. This adapter does not enable its daemon declaration, modify any Agent selection, install packages globally or restart the daemon itself.
|
|
170
|
+
|
|
171
|
+
## Execution and permission behavior
|
|
172
|
+
|
|
173
|
+
Each run starts a separate process, restores the authorized native session ID and refreshes the Host system slot. `DSH_HOME` is the registered native Home; sessions remain at the Profile's native persistence root (normally `<DSH Home>/sessions`). Only transient composition files, spills and helpers use the current authorized `TMPDIR`; `TEMP` and `TMP` use that same root.
|
|
174
|
+
|
|
175
|
+
Native `read`, `read_image`, `write`, `edit`, `ask_user_question`, enabled `skill`, and the current platform's `bash`/`pwsh` tools pass through Host preflight. Both read tools use the Host's `Read` path policy, including protected paths, readonly workspace limits and system-session scopes. Image decoding, size limits and the calling model's image capability remain enforced by the native tool. A monotonic native guard refuses calls that missed preflight. Body dispatch uses only the Host-returned input and final results report whether dispatch started. Native escalation, persistent terminals, background jobs, other tools and runtime self-modification are disabled. A Host-validated literal EC command retains daemon authorization and can pass the DSH inner write fence; it does not receive a new identity or connection.
|
|
176
|
+
|
|
177
|
+
Unsupported tools are excluded from each task's model-facing tool set. Disabled native skills are removed from live discovery and cannot be loaded; disabling the skill loader also clears the native catalog on resume. No skill bodies or installation files are copied or rewritten. Host authorization exceptions retain safe reason codes (including expired task, revoked binding and transport failures) in the tool result and host log; arbitrary exception bodies are not exposed.
|
|
178
|
+
|
|
179
|
+
Windows session temporary directories retain the existing `BUILTIN\\Users: Modify` grant and add inheritable `FullControl` only for the current host user. The latter supplies `WRITE_OWNER`, which native DSH needs to set its private temporary directory's integrity label. Existing session directories receive the same repair on preparation; inherited rules and other principals are preserved. This does not disable the native workspace-write sandbox.
|
|
180
|
+
|
|
181
|
+
C09 retains the native Profile's project instructions and native Skill discovery/loading. EC does not copy Skill snapshots into a separate profile. Native Skill execution remains subject to current Host capability policy and tool authorization; EC skills are managed separately.
|
|
182
|
+
|
|
183
|
+
C02 declares the existing persistent native binding and read-only exists/missing/unavailable check. C15 uses the existing Host gateway for request, waiting and final approval states and audit phases. Native tool results retain the approval request ID, decision source, policy code and error detail for allowed/denied/expired/cancelled outcomes. Approval is independent of C17: the current tools execute natively after Host authorization. Live approval UI acceptance remains separate from the local gateway fixtures.
|
|
184
|
+
|
|
185
|
+
The native executor already schedules concurrency-safe tools (currently file reads in this composition) in a bounded pool, default limit 10; Shell and mutating file tools form exclusive barriers. X14's Host-configurable limit and long-task contract are not exposed. X06 needs a Host block contract and an adapter capable of the requested cache controls; this Messages adapter currently serializes system text without cache directives. X09 can be adapted with a schema-validated terminal result tool, but is not enabled here. X11 can map native `approval/request` plus the exact held tool execution into Host approval; current native sandbox escalation is deliberately rejected and is not claimed as supported. Upstream subagent/background-task primitives (X18) and session cursor/follow primitives (X20) are present, but this owned per-run profile enables neither subagents/background producers nor event reconnect/replay. Persistent history or resuming an idle session is not X20.
|
|
186
|
+
|
|
187
|
+
Linux uses the Host H/L filesystem guard plus DSH's configured inner sandbox. Windows retains the native write sandbox and owned process Jobs, and scoped Shell commands additionally use the Host's existing provisioned Codex filesystem backend. Both Host backends live in `src/core/permission/sandbox-runtime.ts`, shared with ecagent and Trigger; this module uses common CLI discovery without importing another Runner or the baseagent configuration aggregator. The Windows backend still requires the installed, provisioned Codex CLI sandbox. The Host checks explicit read denial in a descendant process before accepting the command; unavailable provisioning or failed checks refuse execution. This protects explicitly denied Host/Agent paths, not an allowlist of every readable file. Networking remains enabled. Owner bypass follows the existing Host policy for the inner sandbox. Trusted Fullaccess disables H/L and socket masking and selects native `danger-full-access` on both platforms, retaining owned process cleanup, input validation, pause/cancellation and Host RPC. Required isolation is never silently dropped after a startup failure.
|
|
188
|
+
|
|
189
|
+
## Shared session forks
|
|
190
|
+
|
|
191
|
+
C07 and X02 require the current Agent Owner and an existing EC/native binding. The Host first prepares an expiring fork receipt, creates a separate EC destination, then commits the native child and its binding. A failed commit removes the Host destination; registry publication failures restore the previous registry and remove only the unchanged child created by that operation.
|
|
192
|
+
|
|
193
|
+
The fixed session inspector acquires the source's native exclusive writer lease, checks its fingerprint, and uses native `buildForkSeed`. The current-session fork includes the latest completed turn. An explicit `dsh-<seq>` anchor includes the selected user, assistant or tool-result event. Native synthetic closers settle unfinished calls in the child, and native inbox cancellation removes inherited pending input. The child receives current Host authorization on its next run. The source log and Profile stay unchanged. Active writers, stale fingerprints, invalid anchors and historical storage formats requiring migration are refused; native migration must happen separately before forking.
|
|
194
|
+
|
|
195
|
+
`tests/integration/dsh-runner.test.ts` contains focused Host commit/rollback tests and optional real native persistence tests for both plain JSONL and zstd. The latter require `DSH_TEST_PACKAGE_PATH` and cover message anchors, reload/append, pending-input cancellation, writer contention, changed-child deletion refusal and unchanged source/Profile bytes. They use local fixtures, not a real model Provider. Windows policy construction and failed-probe handling have fixture coverage in `tests/unit/ecagent-process-interruption.test.ts`; the new Windows command wrapper still requires native Windows acceptance.
|
|
196
|
+
|
|
197
|
+
Fullaccess reuses the existing one-task `/fa`, session policy, Agent global policy and independently approved Trigger sources. Persistent switches produce a fresh task authorization on each run; they do not become Runner defaults or upgrade ordinary Triggers. The Host revalidates current policy and approving ownership before startup and tool dispatch, including after a pause. Expired, replaced or foreign task authorizations fail closed. Fullaccess bypasses ordinary role/path/approval/proactive restrictions; EC commands still use task-bound delegated IPC, with current-instance lifecycle protection and persistent-authorization management restrictions intact. Turning off an Agent/session policy blocks subsequent tool dispatch; it does not retroactively cancel a tool body already executing. Trigger disable stops future scheduling; stopping an active attempt uses the scheduler's existing run cancellation.
|
|
198
|
+
|
|
199
|
+
Same-session runs and compaction cannot overlap. Interrupt targets must match task/generation, and stopping waits for execution and the process exit before releasing the writer. Failed resume preserves the binding. The native desktop's active Session view can request background activation and acquire the writer even before the user types. A busy `session/open` is retried after 500 ms, 1 second and 3 seconds, with cancellation and current task authorization checked before each attempt; no model input is submitted during this wait. Persistent contention is reported as recoverable `session_busy`, with guidance to release the desktop Session and retry the original EC conversation. It does not enter automatic API retries or Provider fallback, clear a native lock, or replace the Session ID. Compaction calls the native service, flushes its actual history transaction and preserves the existing system prompt; it never sends `/compact` as user text.
|
|
200
|
+
|
|
201
|
+
The pinned desktop's Session follower reads an opening snapshot and then listens to its own process's Session and assistant-stream events. An EC task runs in a separate process, so an already-open desktop view does not receive those live events; reopening reads the updated durable history. If EC holds the writer, the desktop's background activation fails while its snapshot remains readable. If the desktop opens after EC has released the writer, it may acquire ownership and block the next EC task. The Host's contention handling does not change that native viewing behavior or add cross-process live following.
|
|
202
|
+
|
|
203
|
+
The production contract is Host API 1 / `host-runner-1`. The private stdio protocol is `evolcore-dsh/2`, separate from the upstream SDK and ACP. Declared C features are C01/C02/C04/C08/C09/C10/C11/C12/C13/C14/C15/C16/C24/C25/C26/C27; extensions are X01/X07/X17. These are the exercised adapted Host-runner surfaces, not a claim to implement the complete draft v2 protocol. C26 also requires the selected Messages model to advertise image input. The production image recognition evidence below covers one Linux turn, Provider `provider-96659517`, and model `deepseek-v4.1-flash`; it does not verify production image context after resume or across multiple image turns. Current local Messages fixtures exercise transport and persistence separately. X01 pauses at the next tool boundary, keeps writer ownership, and supports resume or cancellation. X17 exposes available native cache/reasoning token fields and context pressure; it does not provide a provider invoice or resource quotas. Context capacity can come from advisory DSH metadata and is marked `safe-fallback`; it is not billing evidence. Missing usage is omitted rather than fabricated as zero. Per-attempt usage is aggregated once per run and reset on each resumed round.
|
|
204
|
+
|
|
205
|
+
C26 sends the text and ordered inline images together through `run/start`. The native attachment store normalizes and persists images under the Agent's native DSH storage, outside the per-run profile, so the same native session can use them after process cleanup. PNG, JPEG, WebP and GIF are accepted, up to 20 images, 20 MiB per image and 40 MiB total encoded image bytes per message. Canonical base64, image signatures, supplied MIME, native decode and pixel limits are checked; a missing MIME is inferred from the bytes. Local paths and channel attachment IDs are never read or forwarded.
|
|
206
|
+
|
|
207
|
+
These input limits do not establish an upstream gateway's request-body limit. Native HTTP failures retain their status through the task bridge without copying raw response bodies. HTTP 413 is separate from a token context-window error. When a request containing multiple retained images receives 413 before any response content, the bridge invokes the native image-offload recovery: omit the oldest image occurrences until roughly half the represented image bytes are removed, always retaining the newest image, then retry only that model step. Each retry strictly reduces retained images; prior tool calls and user input are not replayed. The native `image/offload` event preserves original history and attachments while projecting placeholders into later requests. The native image-offload module is retained in shared composition, including replay after process restart. Single-image, text-only, cancelled, and partially streamed failures remain `request_too_large` and require explicit input reduction or upstream changes.
|
|
208
|
+
|
|
209
|
+
On 2026-11-21, a header-only probe of the configured `mg-new.evolai.cn` Messages route accepted a declared body of 20 MiB and rejected 20 MiB + 1 byte with HTTP 413; no request body or credentials were sent. The affected native session retained 27 image occurrences totaling 15,455,205 original bytes (about 20.6 MB before text when encoded as base64). This explains why restarting the host retained the failure. The bridge does not hard-code that gateway's limit for other Providers.
|
|
210
|
+
|
|
211
|
+
The bridge resolves image capability for the actual selected native Provider/model. An explicit EC connection carries its catalog `imageIn` setting in the task request and registers that model metadata in memory. Without an EC connection, native metadata applies. Unsupported image input fails before `input_accepted`; malformed or oversized images are rejected as invalid input. Native `read_image` uses the same selected model and current Host file-read authorization, returning `IMAGE_UNSUPPORTED_MODEL` for text-only models. Descriptor changes require a build and host-controlled restart.
|
|
212
|
+
|
|
213
|
+
The SessionFileAdapter reads only authorized native history through the DSH persistence API. Synchronous callbacks cannot verify this asynchronous resource and report unavailable without clearing the binding. Asynchronous metadata and last-message reads validate current consent; there is no private-directory fallback.
|
|
214
|
+
|
|
215
|
+
The Runner opens C04 through the native persistence API in an owned inspection process. It returns chronological user/system/assistant messages and tool calls/results, preserving pre-compaction history and stable `dsh-<event-seq>` anchors. Forking (C07/X02) remains unavailable in the native shared Runner.
|
|
216
|
+
|
|
217
|
+
X07 calls native non-waking `agent.inject` for the exact current task generation. Policy corrections finish injection before the blocked tool preflight returns; the native tool result separately retains its denial reason. Idle calls are ignored and cancellation clears the native inbox. C01 declares the existing separate-process concurrency across sessions; a single session remains exclusive.
|
|
218
|
+
|
|
219
|
+
C25 enables native `ask_user_question` and the indefinite `userQuestions.ask` service. Host option/free-text cards wait for explicit input with no default answer or timeout. The live tool receives the structured answer batch only after every question is answered. Multi-select requests can use custom text; the current Host card selects one option at a time. A user cancel aborts the task; unattended tasks fail through the Host input-required path. Durable cards record their backend (historical records default to Codex), Agent, native session, question and route. After a stopped process/restart, DSH answers are queued on that exact backend only when the entire batch is answered, preserving interrupted-tool warnings. Simultaneous card answers are serialized before the batch completion check. Stale bindings/authority are rejected and uncertain submissions are never automatically replayed.
|
|
220
|
+
|
|
221
|
+
Arbitrary Host tool/MCP injection and background producers remain closed. No source native history file is edited by Core. Approval fixtures validate the Host gateway boundary; they do not substitute for live interactive approval UI acceptance.
|
|
222
|
+
|
|
223
|
+
## C26 acceptance evidence
|
|
224
|
+
|
|
225
|
+
| Evidence | Result and limits |
|
|
226
|
+
| --- | --- |
|
|
227
|
+
| Production, normal AUN entry, Linux, 2026-11-19 21:09-21:10 +08:00 | Owner image `bf6618a3-ee16-4fc7-a8ac-65c21e465d4c`, task `task-2ed1f90255`, was accepted. Deep Exploration independently checked the native `image/webp` object and message attachment: 1280x1920, 125646 bytes, SHA-256 `caeb506b3ed5818e54669bfffffc392490901527aaf609c1f7331e7e9dc966ad`. The daemon logged model text describing the image at 21:10:05.053 and delivered the 1224-character final response as `m-ffb6949819d7400090d328986054ed8b`. This proves one production image turn, without establishing image context after resume or across multiple image turns. |
|
|
228
|
+
| Current controlled tests | The 2026-11-19 BCX regression passes the complete DSH fixture suite on Linux and native Windows, including ordered image pixels, persistence/resume, text-only model rejection, invalid decode and prelaunch limits. These local Messages fixtures validate transport and attachments; real-provider consecutive image turns and resumed visual understanding remain unverified. The earlier 21:38 `bwrap`/`EPIPE` failure was specific to that acceptance context and is no longer the current regression result. |
|
|
229
|
+
| Historical archive, excluded from current acceptance | The Agent's `output/deepseek-harness-integration-20261119/` retains raw Linux 385/385 and Windows 37/37 reports, plus a real-model result dated 18:30 +08:00 with two accepted generations, the same native ID, and the answer `268482`. The source manifest matches the current Runner and bridge hashes, but its bundle patch hash differs from the 18:42 version. The real-model JSON omits per-turn prompts, images and explicit resume events; no historical build ID or complete runtime snapshot is preserved. These records establish historical results only and do not verify the current patch, consecutive image turns or image context after resume. |
|
|
230
|
+
|
|
231
|
+
Image metadata follows Host catalog `imageIn` → task connection → in-memory native Provider model metadata → `resolveModelInfo`. Native Profile connections retain their own catalog metadata. No profile patch or model-selection environment variable is used.
|
|
232
|
+
|
|
233
|
+
See `projects/dsh-c26-acceptance.md` in the development workspace for the evidence review and open regression cases. Changes to these notes require a build; the loaded daemon retains its existing descriptor until a host-controlled restart.
|
|
234
|
+
|
|
235
|
+
## Focused verification
|
|
236
|
+
|
|
237
|
+
Run the current native-sharing regression with the explicit pinned local runtime environment described above:
|
|
238
|
+
|
|
239
|
+
```text
|
|
240
|
+
node --import tsx --test tests/dsh-native-shared-profile.node.mjs tests/fixtures/dsh-desktop-installation.node.ts tests/fixtures/dsh-native-shared-task.node.mjs
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
On Windows, set the two variables in the current PowerShell environment and run the same Vitest test file. Use an isolated `TMPDIR`/`TEMP`/`TMP` and the repository's existing test setup. Without the explicit DSH test paths the native integration group is skipped; the descriptor/Host boundary tests still run. The local Messages server tests actual DSH loading, native tools, system refresh, persistence, compaction and cancellation without using a paid model endpoint or production credentials.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Preserve useful authorization codes without copying exception bodies or credentials. */
|
|
2
|
+
const knownMessages = {
|
|
3
|
+
'DSH Host task context was replaced': 'DSH_HOST_TASK_REPLACED',
|
|
4
|
+
'DSH Host task identity changed': 'DSH_HOST_TASK_CHANGED',
|
|
5
|
+
'DSH Host fullaccess authorization changed or expired': 'DSH_HOST_FULLACCESS_EXPIRED',
|
|
6
|
+
'DSH tool arguments hash mismatch': 'DSH_TOOL_ARGUMENTS_CHANGED',
|
|
7
|
+
'Invalid tool preflight': 'DSH_TOOL_PREFLIGHT_INVALID',
|
|
8
|
+
};
|
|
9
|
+
export function dshAuthorizationFailure(error, cancelled = false) {
|
|
10
|
+
const failure = error;
|
|
11
|
+
const message = typeof failure?.message === 'string' ? failure.message : '';
|
|
12
|
+
const sourceCode = typeof failure?.code === 'string' ? failure.code : '';
|
|
13
|
+
const messageCode = /^(DSH_[A-Z0-9_]{1,96}|OWNERSHIP_[A-Z0-9_]{1,96}|INTERNAL_CONTACT_[A-Z0-9_]{1,96})(?::|$)/.exec(message)?.[1];
|
|
14
|
+
const safeCode = /^(?:DSH_|OWNERSHIP_|INTERNAL_CONTACT_)[A-Z0-9_]{1,96}$/.test(sourceCode) ? sourceCode
|
|
15
|
+
: messageCode ? messageCode
|
|
16
|
+
: Object.hasOwn(knownMessages, message) ? knownMessages[message] : undefined;
|
|
17
|
+
const code = cancelled || failure?.name === 'AbortError' ? 'DSH_AUTHORIZATION_CANCELLED'
|
|
18
|
+
: safeCode ?? (['ETIMEDOUT', 'ECONNRESET', 'EPIPE', 'CLIENT_DISCONNECTED', 'CLIENT_REPLACED',
|
|
19
|
+
'CONSENSUS_REQUIRED', 'CONSENSUS_MISMATCH', 'SUBJECT_UNAVAILABLE', 'UNAVAILABLE'].includes(sourceCode)
|
|
20
|
+
? sourceCode : 'DSH_HOST_AUTHORIZATION_FAILED');
|
|
21
|
+
return { allow: false, policyCode: code === 'DSH_AUTHORIZATION_CANCELLED' ? 'dsh_task_cancelled' : 'dsh_host_authorization_failed',
|
|
22
|
+
errorDetailCode: code, reason: `Host authorization failed [${code}]; tool was not executed` };
|
|
23
|
+
}
|