@dsh-edge/dsh-edge-agent 0.0.0-stage → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/LICENSE +21 -0
  3. package/README.md +181 -2
  4. package/config/edge.example.json +179 -0
  5. package/config/privacy-policy.json +202 -0
  6. package/cordis.desktop-safe.patch.yml +129 -0
  7. package/cordis.patch.yml +382 -0
  8. package/cordis.yml +374 -0
  9. package/lib/attestation.d.ts +2 -0
  10. package/lib/attestation.d.ts.map +1 -0
  11. package/lib/attestation.js +2 -0
  12. package/lib/audit-log.d.ts +2 -0
  13. package/lib/audit-log.d.ts.map +1 -0
  14. package/lib/audit-log.js +2 -0
  15. package/lib/client.js +87 -0
  16. package/lib/cloud-llm-adapter.d.ts +2 -0
  17. package/lib/cloud-llm-adapter.d.ts.map +1 -0
  18. package/lib/cloud-llm-adapter.js +2 -0
  19. package/lib/dsh-adapter/attestation.d.ts +42 -0
  20. package/lib/dsh-adapter/attestation.d.ts.map +1 -0
  21. package/lib/dsh-adapter/attestation.js +40 -0
  22. package/lib/dsh-adapter/audit-log.d.ts +139 -0
  23. package/lib/dsh-adapter/audit-log.d.ts.map +1 -0
  24. package/lib/dsh-adapter/audit-log.js +376 -0
  25. package/lib/dsh-adapter/cloud-egress.d.ts +181 -0
  26. package/lib/dsh-adapter/cloud-egress.d.ts.map +1 -0
  27. package/lib/dsh-adapter/cloud-egress.js +257 -0
  28. package/lib/dsh-adapter/cloud-llm-adapter.d.ts +416 -0
  29. package/lib/dsh-adapter/cloud-llm-adapter.d.ts.map +1 -0
  30. package/lib/dsh-adapter/cloud-llm-adapter.js +1472 -0
  31. package/lib/dsh-adapter/contract.d.ts +80 -0
  32. package/lib/dsh-adapter/contract.d.ts.map +1 -0
  33. package/lib/dsh-adapter/contract.js +194 -0
  34. package/lib/dsh-adapter/desktop-cookie-janitor.d.ts +214 -0
  35. package/lib/dsh-adapter/desktop-cookie-janitor.d.ts.map +1 -0
  36. package/lib/dsh-adapter/desktop-cookie-janitor.js +409 -0
  37. package/lib/dsh-adapter/dsh-edge-agent.d.ts +48 -0
  38. package/lib/dsh-adapter/dsh-edge-agent.d.ts.map +1 -0
  39. package/lib/dsh-adapter/dsh-edge-agent.js +64 -0
  40. package/lib/dsh-adapter/edge-config.d.ts +484 -0
  41. package/lib/dsh-adapter/edge-config.d.ts.map +1 -0
  42. package/lib/dsh-adapter/edge-config.js +898 -0
  43. package/lib/dsh-adapter/edge-context-view.d.ts +184 -0
  44. package/lib/dsh-adapter/edge-context-view.d.ts.map +1 -0
  45. package/lib/dsh-adapter/edge-context-view.js +483 -0
  46. package/lib/dsh-adapter/effective-model.d.ts +85 -0
  47. package/lib/dsh-adapter/effective-model.d.ts.map +1 -0
  48. package/lib/dsh-adapter/effective-model.js +171 -0
  49. package/lib/dsh-adapter/etscli-shell-guard.d.ts +244 -0
  50. package/lib/dsh-adapter/etscli-shell-guard.d.ts.map +1 -0
  51. package/lib/dsh-adapter/etscli-shell-guard.js +420 -0
  52. package/lib/dsh-adapter/etscli-tools.d.ts +112 -0
  53. package/lib/dsh-adapter/etscli-tools.d.ts.map +1 -0
  54. package/lib/dsh-adapter/etscli-tools.js +393 -0
  55. package/lib/dsh-adapter/file-logger.d.ts +294 -0
  56. package/lib/dsh-adapter/file-logger.d.ts.map +1 -0
  57. package/lib/dsh-adapter/file-logger.js +564 -0
  58. package/lib/dsh-adapter/function-call-external.d.ts +357 -0
  59. package/lib/dsh-adapter/function-call-external.d.ts.map +1 -0
  60. package/lib/dsh-adapter/function-call-external.js +1005 -0
  61. package/lib/dsh-adapter/host-egress-guard.d.ts +161 -0
  62. package/lib/dsh-adapter/host-egress-guard.d.ts.map +1 -0
  63. package/lib/dsh-adapter/host-egress-guard.js +213 -0
  64. package/lib/dsh-adapter/host-llm-trace.d.ts +198 -0
  65. package/lib/dsh-adapter/host-llm-trace.d.ts.map +1 -0
  66. package/lib/dsh-adapter/host-llm-trace.js +344 -0
  67. package/lib/dsh-adapter/http-api-routes.d.ts +61 -0
  68. package/lib/dsh-adapter/http-api-routes.d.ts.map +1 -0
  69. package/lib/dsh-adapter/http-api-routes.js +79 -0
  70. package/lib/dsh-adapter/http-api-sessions.d.ts +105 -0
  71. package/lib/dsh-adapter/http-api-sessions.d.ts.map +1 -0
  72. package/lib/dsh-adapter/http-api-sessions.js +173 -0
  73. package/lib/dsh-adapter/http-api.d.ts +221 -0
  74. package/lib/dsh-adapter/http-api.d.ts.map +1 -0
  75. package/lib/dsh-adapter/http-api.js +1811 -0
  76. package/lib/dsh-adapter/index.d.ts +62 -0
  77. package/lib/dsh-adapter/index.d.ts.map +1 -0
  78. package/lib/dsh-adapter/index.js +97 -0
  79. package/lib/dsh-adapter/input-guard-messages.d.ts +56 -0
  80. package/lib/dsh-adapter/input-guard-messages.d.ts.map +1 -0
  81. package/lib/dsh-adapter/input-guard-messages.js +136 -0
  82. package/lib/dsh-adapter/input-guard.d.ts +508 -0
  83. package/lib/dsh-adapter/input-guard.d.ts.map +1 -0
  84. package/lib/dsh-adapter/input-guard.js +2174 -0
  85. package/lib/dsh-adapter/intent-prompts.d.ts +77 -0
  86. package/lib/dsh-adapter/intent-prompts.d.ts.map +1 -0
  87. package/lib/dsh-adapter/intent-prompts.js +97 -0
  88. package/lib/dsh-adapter/intent-router.d.ts +710 -0
  89. package/lib/dsh-adapter/intent-router.d.ts.map +1 -0
  90. package/lib/dsh-adapter/intent-router.js +2802 -0
  91. package/lib/dsh-adapter/intent-signals.d.ts +208 -0
  92. package/lib/dsh-adapter/intent-signals.d.ts.map +1 -0
  93. package/lib/dsh-adapter/intent-signals.js +391 -0
  94. package/lib/dsh-adapter/invariant-install.d.ts +16 -0
  95. package/lib/dsh-adapter/invariant-install.d.ts.map +1 -0
  96. package/lib/dsh-adapter/invariant-install.js +15 -0
  97. package/lib/dsh-adapter/invariant.d.ts +16 -0
  98. package/lib/dsh-adapter/invariant.d.ts.map +1 -0
  99. package/lib/dsh-adapter/invariant.js +22 -0
  100. package/lib/dsh-adapter/llm-adapters.d.ts +19 -0
  101. package/lib/dsh-adapter/llm-adapters.d.ts.map +1 -0
  102. package/lib/dsh-adapter/llm-adapters.js +16 -0
  103. package/lib/dsh-adapter/llm-internal-caller.d.ts +92 -0
  104. package/lib/dsh-adapter/llm-internal-caller.d.ts.map +1 -0
  105. package/lib/dsh-adapter/llm-internal-caller.js +100 -0
  106. package/lib/dsh-adapter/llm-max-turns.d.ts +55 -0
  107. package/lib/dsh-adapter/llm-max-turns.d.ts.map +1 -0
  108. package/lib/dsh-adapter/llm-max-turns.js +127 -0
  109. package/lib/dsh-adapter/llm-trace-store.d.ts +131 -0
  110. package/lib/dsh-adapter/llm-trace-store.d.ts.map +1 -0
  111. package/lib/dsh-adapter/llm-trace-store.js +205 -0
  112. package/lib/dsh-adapter/llm-trace.d.ts +450 -0
  113. package/lib/dsh-adapter/llm-trace.d.ts.map +1 -0
  114. package/lib/dsh-adapter/llm-trace.js +463 -0
  115. package/lib/dsh-adapter/local-llm-adapter.d.ts +141 -0
  116. package/lib/dsh-adapter/local-llm-adapter.d.ts.map +1 -0
  117. package/lib/dsh-adapter/local-llm-adapter.js +787 -0
  118. package/lib/dsh-adapter/local-storage.d.ts +96 -0
  119. package/lib/dsh-adapter/local-storage.d.ts.map +1 -0
  120. package/lib/dsh-adapter/local-storage.js +198 -0
  121. package/lib/dsh-adapter/model-router.d.ts +79 -0
  122. package/lib/dsh-adapter/model-router.d.ts.map +1 -0
  123. package/lib/dsh-adapter/model-router.js +107 -0
  124. package/lib/dsh-adapter/ohttp-gateway.d.ts +49 -0
  125. package/lib/dsh-adapter/ohttp-gateway.d.ts.map +1 -0
  126. package/lib/dsh-adapter/ohttp-gateway.js +32 -0
  127. package/lib/dsh-adapter/openai-sse.d.ts +85 -0
  128. package/lib/dsh-adapter/openai-sse.d.ts.map +1 -0
  129. package/lib/dsh-adapter/openai-sse.js +462 -0
  130. package/lib/dsh-adapter/pii-utils.d.ts +96 -0
  131. package/lib/dsh-adapter/pii-utils.d.ts.map +1 -0
  132. package/lib/dsh-adapter/pii-utils.js +324 -0
  133. package/lib/dsh-adapter/plugin-host.d.ts +38 -0
  134. package/lib/dsh-adapter/plugin-host.d.ts.map +1 -0
  135. package/lib/dsh-adapter/plugin-host.js +38 -0
  136. package/lib/dsh-adapter/plugin.d.ts +46 -0
  137. package/lib/dsh-adapter/plugin.d.ts.map +1 -0
  138. package/lib/dsh-adapter/plugin.js +100 -0
  139. package/lib/dsh-adapter/privacy-policy.d.ts +237 -0
  140. package/lib/dsh-adapter/privacy-policy.d.ts.map +1 -0
  141. package/lib/dsh-adapter/privacy-policy.js +391 -0
  142. package/lib/dsh-adapter/prompt-guard.d.ts +152 -0
  143. package/lib/dsh-adapter/prompt-guard.d.ts.map +1 -0
  144. package/lib/dsh-adapter/prompt-guard.js +872 -0
  145. package/lib/dsh-adapter/realm-skill-bridge.d.ts +365 -0
  146. package/lib/dsh-adapter/realm-skill-bridge.d.ts.map +1 -0
  147. package/lib/dsh-adapter/realm-skill-bridge.js +1180 -0
  148. package/lib/dsh-adapter/sanitizer-pipeline.d.ts +140 -0
  149. package/lib/dsh-adapter/sanitizer-pipeline.d.ts.map +1 -0
  150. package/lib/dsh-adapter/sanitizer-pipeline.js +431 -0
  151. package/lib/dsh-adapter/secure-bridge.d.ts +47 -0
  152. package/lib/dsh-adapter/secure-bridge.d.ts.map +1 -0
  153. package/lib/dsh-adapter/secure-bridge.js +35 -0
  154. package/lib/dsh-adapter/session-attribution.d.ts +70 -0
  155. package/lib/dsh-adapter/session-attribution.d.ts.map +1 -0
  156. package/lib/dsh-adapter/session-attribution.js +76 -0
  157. package/lib/dsh-adapter/sessions.d.ts +86 -0
  158. package/lib/dsh-adapter/sessions.d.ts.map +1 -0
  159. package/lib/dsh-adapter/sessions.js +179 -0
  160. package/lib/dsh-adapter/tcm.d.ts +55 -0
  161. package/lib/dsh-adapter/tcm.d.ts.map +1 -0
  162. package/lib/dsh-adapter/tcm.js +94 -0
  163. package/lib/dsh-adapter/td-bus.d.ts +87 -0
  164. package/lib/dsh-adapter/td-bus.d.ts.map +1 -0
  165. package/lib/dsh-adapter/td-bus.js +196 -0
  166. package/lib/dsh-adapter/tool-runner.d.ts +185 -0
  167. package/lib/dsh-adapter/tool-runner.d.ts.map +1 -0
  168. package/lib/dsh-adapter/tool-runner.js +271 -0
  169. package/lib/dsh-adapter/tools.d.ts +118 -0
  170. package/lib/dsh-adapter/tools.d.ts.map +1 -0
  171. package/lib/dsh-adapter/tools.js +292 -0
  172. package/lib/dsh-adapter/types.d.ts +23 -0
  173. package/lib/dsh-adapter/types.d.ts.map +1 -0
  174. package/lib/dsh-adapter/types.js +16 -0
  175. package/lib/dsh-adapter/voice-input.d.ts +30 -0
  176. package/lib/dsh-adapter/voice-input.d.ts.map +1 -0
  177. package/lib/dsh-adapter/voice-input.js +34 -0
  178. package/lib/dsh-adapter/web-search-tavily-bocha.d.ts +152 -0
  179. package/lib/dsh-adapter/web-search-tavily-bocha.d.ts.map +1 -0
  180. package/lib/dsh-adapter/web-search-tavily-bocha.js +289 -0
  181. package/lib/http-api.d.ts +2 -0
  182. package/lib/http-api.d.ts.map +1 -0
  183. package/lib/http-api.js +2 -0
  184. package/lib/index.d.ts +48 -0
  185. package/lib/index.d.ts.map +1 -0
  186. package/lib/index.js +49 -0
  187. package/lib/intent-router.d.ts +2 -0
  188. package/lib/intent-router.d.ts.map +1 -0
  189. package/lib/intent-router.js +2 -0
  190. package/lib/llm-adapters.d.ts +2 -0
  191. package/lib/llm-adapters.d.ts.map +1 -0
  192. package/lib/llm-adapters.js +2 -0
  193. package/lib/local-llm-adapter.d.ts +2 -0
  194. package/lib/local-llm-adapter.d.ts.map +1 -0
  195. package/lib/local-llm-adapter.js +2 -0
  196. package/lib/local-storage.d.ts +2 -0
  197. package/lib/local-storage.d.ts.map +1 -0
  198. package/lib/local-storage.js +2 -0
  199. package/lib/model-router.d.ts +2 -0
  200. package/lib/model-router.d.ts.map +1 -0
  201. package/lib/model-router.js +2 -0
  202. package/lib/ohttp-gateway.d.ts +2 -0
  203. package/lib/ohttp-gateway.d.ts.map +1 -0
  204. package/lib/ohttp-gateway.js +2 -0
  205. package/lib/plugin-host.d.ts +2 -0
  206. package/lib/plugin-host.d.ts.map +1 -0
  207. package/lib/plugin-host.js +2 -0
  208. package/lib/privacy-policy.d.ts +2 -0
  209. package/lib/privacy-policy.d.ts.map +1 -0
  210. package/lib/privacy-policy.js +2 -0
  211. package/lib/prompt-guard.d.ts +2 -0
  212. package/lib/prompt-guard.d.ts.map +1 -0
  213. package/lib/prompt-guard.js +2 -0
  214. package/lib/sanitizer-pipeline.d.ts +2 -0
  215. package/lib/sanitizer-pipeline.d.ts.map +1 -0
  216. package/lib/sanitizer-pipeline.js +2 -0
  217. package/lib/secure-bridge.d.ts +2 -0
  218. package/lib/secure-bridge.d.ts.map +1 -0
  219. package/lib/secure-bridge.js +2 -0
  220. package/lib/sessions.d.ts +2 -0
  221. package/lib/sessions.d.ts.map +1 -0
  222. package/lib/sessions.js +2 -0
  223. package/lib/tcm.d.ts +2 -0
  224. package/lib/tcm.d.ts.map +1 -0
  225. package/lib/tcm.js +2 -0
  226. package/lib/td-bus.d.ts +2 -0
  227. package/lib/td-bus.d.ts.map +1 -0
  228. package/lib/td-bus.js +2 -0
  229. package/lib/tools.d.ts +2 -0
  230. package/lib/tools.d.ts.map +1 -0
  231. package/lib/tools.js +2 -0
  232. package/lib/voice-input.d.ts +2 -0
  233. package/lib/voice-input.d.ts.map +1 -0
  234. package/lib/voice-input.js +2 -0
  235. package/package.json +253 -3
  236. package/presets/agent-preset-edge.json +50 -0
  237. package/presets/edge.desktop-safe.patch.yml +503 -0
  238. package/presets/edge.patch.yml +557 -0
@@ -0,0 +1,382 @@
1
+ # dsh-edge-agent bundle patch — applied after the dsh-base layer.
2
+ # This patch is the ONLY patch needed when a profile lists
3
+ # `@dsh-edge/dsh-edge-agent` in its bundles array.
4
+ #
5
+ # 2026-09-05 (§7.43): 默认 host = dsh-tui(mandatory primary)。bundle 本身仍
6
+ # profile-agnostic,可挂到 web / dsh-tui / 任意 profile;只是 install.sh 的默认
7
+ # 部署目标从 web 切到 dsh-tui。2026-09-11 进一步改 install.sh 为 --profiles=dsh-tui,web 并存启动,--with-web 完全弃用。
8
+ #
9
+ # 2026-09-03 (§7.31): dsh-edge-agent 是 profile-agnostic pure-plugin bundle。
10
+ # Previously had a separate profiles/dsh-edge-agent/cordis.patch.yml (459 lines)
11
+ # that was the profile overlay; that overlay is now deleted. Bundle is fully
12
+ # self-contained — `dsh plugin --profile <name> add -w $LOCAL_PKG` picks up every
13
+ # plugin in a single bundle layer with no profile overlay needed.
14
+ #
15
+ # 2026-09-04: http-api plugin re-enabled. Provides standalone HTTP entry
16
+ # point at :21017 for external consumers (mobile apps, third-party services).
17
+ # Web profile still uses dsh-web-app native chat (:3080) alongside http-api.
18
+ #
19
+ # Load order:
20
+ # dsh-base → ...other bundles... → @dsh-edge/dsh-edge-agent (this)
21
+ # → ~/.dsh/profiles/<prof>/cordis.patch.yml (user skin)
22
+ #
23
+ # Layer-ordering rule resolves all 5 conflicts vs. dsh-web-app automatically:
24
+ # * persona (system-prompt) — last-write-wins → edge-agent wins
25
+ # * agent-presets default — last-write-wins → edge-agent wins
26
+ # * tool-* enable/disable — last-write-wins → edge-agent wins
27
+ # * webserver port — never touched here → dsh-web-app wins (3080)
28
+ # * input-guard coverage — {global:true} hooks cover webui RPC
29
+
30
+ # ── surface-specific overrides over the dsh-base layer ────────────────────
31
+
32
+ # Deployment persona: the edge agent's default is a private-assistant tone
33
+ # (not "coding agent"). DSH_EDGE_PERSONA wins; default below.
34
+ # 2026-09-02: expanded to mirror the persona declared at the profile layer
35
+ # (so this bundle works standalone without the profile overlay).
36
+ - id: system-prompt
37
+ config:
38
+ persona: !!js process.env.DSH_EDGE_PERSONA ?? 'You are edge-agent, a privacy-first AI assistant running on the user\'s edge device. Answer in the user\'s language. Be concise and helpful. You have access to local tools for file operations and calculations when appropriate. For knowledge questions, current events, or complex reasoning, provide comprehensive answers. Use the tool registry (bash, read, write, edit, glob, grep, todo_write, web_search, web_fetch, skill, send_message, interrupt_agent, subagent_fork, local_file_read, local_file_write, local_calculate) when an action is required; call the matching tool with the correct parameter shape and never invent tool names. The `skill` tool loads detailed instructions for a named capability (e.g. lark-doc, lark-calendar); once you call skill({name}) and receive its content, use that content immediately to answer the user\'s question — do NOT call the same skill again. For local host queries (the user\'s own IP, hostname, disk, memory, kernel, running processes), call the `bash` tool directly with read-only commands — `ip addr`, `hostname -I`, `ifconfig`, `cat /proc/net/...`, `uname -a`, `df -h`, `free -h`, `uptime`, `ps aux`. Reserve the `skill` tool for explicit capability names the user invokes (e.g. `ets-discover` for scanning OTHER 密盒 devices on the LAN, `lark-doc` for Lark documents); do NOT use `ets-discover` to answer "my IP" or "本机局域网IP" — ets-discover broadcasts and returns other devices\' IPs, not the host\'s.'
39
+
40
+ # §7.100: 删除了 llm-deepseek 的 config override 行。宿主云路由
41
+ # (deepseek-official / deepseek-account)现在作为 cloud-llm delegate 的
42
+ # 转发目标,key / baseURL / reasoning 全归宿主自己的配置层(dsh-credentials
43
+ # + profile patch),edge 侧不再双头管理。需要 edge 自有云池的部署请显式
44
+ # 配置 CLOUD_LLM_*(走 cloud-llm-adapter 直连模式)。
45
+
46
+ # The edge agent creates/resumes its agent at runtime; no declarative
47
+ # agents are started at boot, and the configured agent list stays the
48
+ # base's empty default.
49
+ - id: agent-loop
50
+ config:
51
+ agents: []
52
+
53
+ # Approval policy: edge agent defaults to ASK everywhere (no
54
+ # danger-full-access by default; user must opt in via env var).
55
+ # On Windows the trust model matches every other terminal coding agent.
56
+ - id: approval
57
+ config:
58
+ policy: !!js "process.platform === 'win32' ? 'never' : ((process.env.DSH_EDGE_PERMISSION_MODE ?? 'ask') === 'danger-full-access' ? 'never' : 'ask')"
59
+
60
+ # Sessions live in the edge-agent specific JSONL store so the
61
+ # ~/.dsh-edge-agent/sessions directory is isolated from any other DSH
62
+ # bundle.
63
+ - id: session-persistence-jsonl
64
+ config:
65
+ root: !!js process.env.DSH_EDGE_SESSION_ROOT ?? (process.env.USERPROFILE ?? process.env.HOME) + '/.dsh-edge-agent/sessions'
66
+
67
+ # Sandbox: tighter than dsh-base (workspace-write, not danger-full-access).
68
+ # On Windows the no-sandbox trust model applies.
69
+ - id: sandbox-policy
70
+ config:
71
+ mode: !!js "process.platform === 'win32' ? 'danger-full-access' : (process.env.DSH_EDGE_PERMISSION_MODE ?? 'workspace-write')"
72
+ workspaceRoot: !!js process.cwd()
73
+
74
+ # §7.100: 删除了 agent-default-model override 行。宿主 profile 自己的选择
75
+ # (桌面 GUI saveSelection / dsh-base shipped deepseek-official)现在直接生效;
76
+ # http-api 路径不吃这个 row(intent resolveRoute → cloud-llm/local-llm,
77
+ # cloud-llm 在 delegate 模式下转发到宿主选择)——"profile 已配置模型提供商
78
+ # 就把它当 cloud-llm"的落点就在 delegate adapter,而不是改宿主全局默认。
79
+
80
+ # Persona + agent-presets delegation
81
+ #
82
+ # 2026-08-31: system-prompt row keeps the host deployment persona. The
83
+ # preset does NOT register its own `persona` row — that would conflict with
84
+ # this host row at the same NamedEntries table (both publish `deployment:persona`
85
+ # at host scope; the second one throws `prompt section already registered`).
86
+ # Shipped `standard` preset hits the same collision; it's an upstream bug
87
+ # in dsh 0.1.0-rc.7 (dsh-persona calls ctx.systemPrompt.section() which
88
+ # targets the systemPrompt service's own ctx, i.e. host, not the preset's
89
+ # standing scope).
90
+ #
91
+ # 2026-08-31: tool-skill moved to disabled=true at host plane. The preset
92
+ # registers its own `tool-skill` row, which joins the agent scope via
93
+ # parentage and registers into that scope's skill-registry layer.
94
+ #
95
+ # 2026-08-31: `agent-presets` config row pins the default preset to
96
+ # `dsh-edge-agent`. Moved to insert block (line 269) because TUI/headless
97
+ # profiles don't load dsh-web-app, so agent-presets must be inserted, not
98
+ # patched. See insert block for the active configuration.
99
+
100
+ # ── upstream-disabled rows ──────────────────────────────────────────────────────
101
+ # 2026-09-02: keep the disabled rows for the 7 stub plugins so any future
102
+ # downgrade (dsh-edge-agent bundle mounted alone, without the
103
+ # profiles/dsh-edge-agent overlay profile) still skips their apply() —
104
+ # they are M5+ work, not M4. The "dsh-edge-agent overlay" here refers
105
+ # to the default standalone profile directory, not a profile name; the
106
+ # bundle itself lives at the repo root.
107
+
108
+ # §7.100: 撤销了 llm-deepseek 的 disable —— 宿主云路由现在是 cloud-llm
109
+ # delegate 的转发目标,必须保持挂载。A4 (OHTTP) 届时替换的是 delegate
110
+ # 之下的 wire transport,不再是"edge 独占云路由"。
111
+ #
112
+ # §7.101.x (2026-10-20, fix #5): this `disabled: true` override is a NO-OP
113
+ # for the bare host-half row inserted below in the same file — cordis
114
+ # applies top-level overrides to already-existing entries only, and the
115
+ # insert creates the entry with that name. Kept as documentation of the
116
+ # standalone-profile intent (individual rows mount there).
117
+
118
+ - id: dsh-edge-agent
119
+ disabled: true
120
+ # Aggregator; 2026-09-03 (§7.31) dsh-edge-agent bundle 仅装 web profile
121
+ # 一个, 但 aggregator 仍保持 disabled 避免 individual plugins (file-logger,
122
+ # http-api, input-guard, etc.) double-apply。
123
+
124
+ - id: plugin-host
125
+ disabled: true
126
+ - id: ohttp-gateway
127
+ disabled: true
128
+ - id: secure-bridge
129
+ disabled: true
130
+ - id: attestation
131
+ disabled: true
132
+ - id: web-search
133
+ disabled: true
134
+ - id: voice-input
135
+ disabled: true
136
+
137
+ # ── tools (subset of dsh-base defaults restored after webui disables) ──────────
138
+ # 2026-09-02: when dsh-edge-agent is added to the web profile, dsh-web-app's
139
+ # layer (which comes BEFORE dsh-edge-agent) disables many tool rows. By
140
+ # re-declaring them here (last-write-wins), dsh-edge-agent overrides that
141
+ # disable with the upstream default. Standalone usage is unaffected.
142
+
143
+ # 启用的工具(明确 disabled: false 覆盖 dsh-web-app 的禁用)
144
+ - id: tool-bash
145
+ disabled: false
146
+ - id: tool-fs
147
+ disabled: false
148
+ - id: tool-fs-search
149
+ disabled: false
150
+ - id: tool-web
151
+ disabled: false
152
+ config:
153
+ search: true
154
+ fetch: true
155
+ searchMaxResults: 8
156
+ searchTimeoutMs: 30000
157
+ fetchTimeoutMs: 30000
158
+ - id: web
159
+ # 2026-09-02: WebRuntime.Config (dsh-web/lib/index.js:42-50) requires BOTH
160
+ # `searchProvider` AND `fetchProvider`. The upstream dsh-base row only
161
+ # supplies `searchProvider`, so Cordis plugin-config validation rejects
162
+ # the WebRuntime class plugin silently — `ctx.web` never gets provided,
163
+ # web-search-deepseek's `inject: ['web']` never fires, and `web_search`
164
+ # tool calls fail with "configured web provider ... is not registered".
165
+ # 2026-09-04: fetchProvider now uses 'http' from dsh-web-fetch-http plugin.
166
+ # 2026-09-18 (§7.82): searchProvider 改 tavily-bocha-fallback —— 三级链
167
+ # provider(Tavily → 博查 AI → DeepSeek)。web-search-deepseek 仍 enabled 作
168
+ # Tier-3 内部兜底(由 aggregator 私有 DeepSeekSearchProvider 实例调用,
169
+ # 不暴露为独立 provider;否则 seam 会因 AMBIGUOUS 报错)。
170
+ config:
171
+ searchProvider: tavily-bocha-fallback
172
+ fetchProvider: http
173
+ - id: tool-todo
174
+ disabled: false
175
+ - id: tool-str-replace-editor
176
+ disabled: false
177
+ - id: web-search-deepseek
178
+ # 2026-09-04: RE-ENABLED. The 2026-09-03 comment claimed peer dep
179
+ # `@deepseek-ai/dsh-environment` was missing. Wrong — actual peer deps are
180
+ # `dsh-launch-environment`, `dsh-web`, `dsh-agent`, all in dsh scope (0.2.x line).
181
+ # Without this plugin, `deepseek-official` search provider is never registered,
182
+ # so web_search tool calls fail with "provider not registered".
183
+ # 2026-09-18 (§7.82): DISABLED —— web-search-tavily-bocha 接管 searchProvider
184
+ # 路由,在 aggregator 内部私有持有 DeepSeekSearchProvider 实例作 Tier-3
185
+ # fallback。若两 plugin 同 enabled, ctx.web 会同时注册 2 个 usable provider
186
+ # ('tavily-bocha-fallback' + 'deepseek-official') → AMBIGUOUS 报错。仍启用
187
+ # 会留 orphan DeepSeek 注册 + 浪费一次 HTTP probe。
188
+ disabled: true
189
+ - id: web-fetch-http
190
+ # 2026-09-04: ENABLED. Provides the 'http' fetch provider for web_fetch tool.
191
+ # Peer deps (cordis, dsh-timeout, dsh-web) all in dsh scope. Without this,
192
+ # web_fetch tool calls fail with "fetchProvider not registered".
193
+
194
+ # 禁用的工具
195
+ - id: tool-pwsh
196
+ disabled: true
197
+ - id: tool-jobs
198
+ disabled: true
199
+ - id: tool-skill
200
+ # 2026-09-04 (§7.40.2): RE-ENABLED at host plane. Previously disabled
201
+ # to avoid conflict with preset's tool-skill row. Empirically the
202
+ # preset's row did NOT deliver the `skill` tool to the LLM — system-
203
+ # prompt.assemble gathers toolProviders from the scope where dsh-tools
204
+ # was constructed (host), so the bridge between ctx.tools.register() and
205
+ # assembly.tools lives at host, not at the preset's standing scope. The
206
+ # agent joined the standing scope by parentage but did not inherit the
207
+ # toolProviders layer, so the `skill` tool was absent from the 27-tool
208
+ # list while the system reminder kept telling the model to call it.
209
+ # 2026-09-04 fix: disable the preset's row (single registration point)
210
+ # and enable this host row. Session `cw-fix-test-1` and earlier
211
+ # `7eb91d59-...` reproduced the 5-turn loop with resultLen=12
212
+ # (`</tool_call>` residual) — LLM picked `tool-fs-search` instead and
213
+ # produced malformed outputs.
214
+ - id: tool-subagent
215
+ disabled: true
216
+ - id: tool-subagent-fork
217
+ disabled: true
218
+ - id: tool-subagent-control
219
+ disabled: true
220
+ - id: tool-subagent-list-agents
221
+ disabled: true
222
+ - id: tool-subagent-report
223
+ disabled: true
224
+ - id: tool-workflow
225
+ disabled: true
226
+ - id: tool-ralph
227
+ disabled: true
228
+ - id: tool-goal
229
+ disabled: true
230
+ - id: skill-filesystem
231
+ name: '@deepseek-ai/dsh-skill-filesystem'
232
+ # 2026-09-04: ENABLED at host plane so realm-skill-bridge can access
233
+ # ctx.skills.list() at boot. Previously disabled here because preset
234
+ # registered its own skill-filesystem row, causing "a skill provider
235
+ # named 'filesystem' is already registered" error. Now preset disables
236
+ # its row to avoid conflict. realm-skill-bridge needs skills available
237
+ # at host plane for Layer 1 catalog filtering.
238
+ disabled: false
239
+ - id: skill-badge
240
+ disabled: true
241
+ - id: workflow-worker-thread
242
+ disabled: true
243
+ # 2026-08-31: goal service + driver + command re-enabled — required by
244
+ # the dsh-edge-agent preset's tool-goal row (which "waits for goals" if
245
+ # the host-plane service is missing). These are upstream dsh plugins
246
+ # mounted on the host plane; the preset's tool-goal row just provides the
247
+ # model-facing tool.
248
+ - id: goal
249
+ - id: goal-round-driver
250
+ - id: command-goal
251
+ - id: session-title-llm
252
+ disabled: true
253
+ - id: session-telemetry-otel
254
+ disabled: true
255
+ - id: repeat-tool-reminder
256
+ disabled: true
257
+ - id: spill-local
258
+ disabled: true
259
+ - id: spill-policy
260
+ disabled: true
261
+ - id: session-checkpoint-policy
262
+ disabled: true
263
+ - id: tool-result-pruner
264
+ disabled: true
265
+ - id: tool-call-timeout-policy
266
+ disabled: true
267
+ - id: compaction-basic
268
+ disabled: true
269
+ - id: command-compact
270
+ disabled: true
271
+
272
+ # ── new plugin inserts ─────────────────────────────────────────────────────────
273
+
274
+ # ── 2026-09-04: agent-presets — per-session agent composition.
275
+ # dsh-web-app inserts this for web profile; dsh-tui inserts a scoped copy
276
+ # (`dsh-tui-agent-presets`) for TUI/headless. We do NOT re-insert here —
277
+ # that produces either "service agentPresets has been registered" (when
278
+ # both rows enabled) or "duplicate loader entry id" (when both rows use
279
+ # the same id in an insert block). Instead we config-override the
280
+ # existing dsh-tui-agent-presets entry to flip its default from
281
+ # 'standard' to 'dsh-edge-agent', so TUI agents compose our preset (with
282
+ # ets-* skills) instead of dsh-base's standard one.
283
+ #
284
+ # §7.40.3 detail: top-level `- id:` rows with the same id as an existing
285
+ # entry are Cordis Loader config overrides (last-write-wins on config,
286
+ # single entry per id, dedup at parse time — vs insert block which adds
287
+ # new entries). This is the standard "user skin overrides bundle default"
288
+ # pattern. On web profile (no dsh-tui bundle), this id is unknown to the
289
+ # loader; Cordis silently no-ops the override, leaving dsh-web-app's
290
+ # own agent-presets insert as the source — which already sets
291
+ # default=dsh-edge-agent (verified in dsh-web-app bundle).
292
+ - id: dsh-tui-agent-presets
293
+ config:
294
+ default: dsh-edge-agent
295
+ includeUserRoot: true
296
+
297
+ # ── 2026-09-01 (M6): file-logger — durable ops log exporter.
298
+ # Mount FIRST kept as a placement convention, but §7.169 实测推翻其原依据:
299
+ # 同层插件的 apply 先后由模块解析/求值速度决定,**不**依赖配置树顺序 ⇒
300
+ # "居首所以兜住所有 ctx.logger.*"不成立。通道可用性改由消费方延迟注入保证
301
+ # (ctx.inject(['fileLogger'], …):回调触发时导出器必已注册)。
302
+ # 历史上本行还声明过 inject:['web'](boot 诊断),该硬依赖会把它整个 apply 拖到
303
+ # web 就绪之后 ⇒ §7.169 起 web 降为延迟注入,本插件零静态依赖。
304
+ # See `src/dsh-adapter/file-logger.ts` for the two-channel discipline
305
+ # (ops log: metadata only; audit JSONL: redacted call content).
306
+
307
+ # ── 本 bundle 留在宿主树的三行(§7.136)──────────────────────────────────
308
+ # 理由见 scripts/_isolate-edge-group.mjs 的文件头:
309
+ # dsh-edge-agent(裸包名)—— 宿主 client-modules 只扫宿主 Loader 的 entries,
310
+ # preset 树不在其中 ⇒ Edge tab 的浏览器半边只能从这里被发现;
311
+ # audit-log / file-logger —— 裸包名行 inject auditLog,且它的 installFileLogger
312
+ # 会先占住 fileLogger 服务名 ⇒ 两者必须在 root realm,且 file-logger 行要更早装载。
313
+ - insert:
314
+ # §7.101.x (2026-10-20, fix #5) + §7.136: the BARE-package host-half row.
315
+ # The webview client-module system (@deepseek-ai/dsh-client-modules) scans
316
+ # LOADER ENTRY NAMES for a `dsh.client` declaration, and its package
317
+ # locator only accepts bare package-root specifiers (`exactPackageSpecifier`)
318
+ # — subpath rows like '@scope/pkg/audit-log' can never surface the bundle's
319
+ # browser half.
320
+ #
321
+ # §7.136: this row must stay in the HOST tree. client-modules scans
322
+ # `ctx.loader.entries()` — the host Loader's entries — while a preset's
323
+ # plugin list lives in its own EntryTree, outside that enumeration. A bare
324
+ # row inside the preset would therefore never surface the browser half and
325
+ # the Edge tab would vanish in every work mode.
326
+ - id: dsh-edge-agent
327
+ name: '@dsh-edge/dsh-edge-agent'
328
+
329
+ - id: file-logger
330
+ name: '@dsh-edge/dsh-edge-agent/file-logger'
331
+ config:
332
+ # §7.102 "one config file": root / level / rotation come from
333
+ # config/edge.json (audit.*) inside the plugin. Only static wiring
334
+ # stays in the row. (Rotation semantics unchanged — see PROGRESS
335
+ # §7.56; the effective values logMaxAgeDays=1 / logMaxRotated=7 /
336
+ # logLevel=info are in edge.json.)
337
+ filename: dsh-edge-agent.log
338
+ flushIntervalMs: 1000
339
+ queueCapacity: 10000
340
+ maxFileSizeBytes: 52428800 # 50MB
341
+
342
+ # NOTE: `sessions` and `audit-log` are NOT mounted — `dsh-session`
343
+ # provides `sessions` upstream and nothing provides `auditLog` so
344
+ # audit-log is mounted below under its own name.
345
+ #
346
+ # ── sessions provider ── dsh-base already mounts the same package
347
+ # under id `session-persistence-jsonl` (root: `dshHomePath('sessions')`),
348
+ # which exposes `sessionPersistence`. Previously we declared a second
349
+ # mount under id `sessions` — that caused a duplicate `provide()` call
350
+ # and a hard boot failure after the loader upgrade in @xmanrui/dsh-im
351
+ # (commit b42c7db). Keep the upstream mount; our session-root env
352
+ # override (`DSH_EDGE_SESSION_ROOT`) flows through `dshHomePath()`.
353
+ - id: audit-log
354
+ name: '@dsh-edge/dsh-edge-agent/audit-log'
355
+ config:
356
+ # §7.102: minLevel / flush / root come from config/edge.json
357
+ # (audit.*; root default = ~/.dsh-edge-agent/audit, 2026-08-29 统一).
358
+ ringBufferSize: 512
359
+ filename: audit.plain.jsonl
360
+ enablePIIRedaction: true
361
+ maxFileSizeBytes: 10485760 # 10MB
362
+ maxFileAgeDays: 7
363
+ maxRotatedFiles: 5
364
+
365
+ # §7.145: 桌面版「起不来」的根因修复(431)。
366
+ #
367
+ # 这一行**必须**留在宿主树(不是 preset)—— 它修的不是 Edge 行为,而是
368
+ # **宿主自己的启动**:Electron 外壳的 welcome 握手带着 Chromium cookie jar
369
+ # 出发,cookie 越攒越多 ⇒ 请求头爆 16 KB ⇒ 431 ⇒ 外壳拆宿主 ⇒
370
+ # 「DeepSeek Harness is unavailable」。握手发生在**任何工作方式选定之前**
371
+ # ⇒ 修它的插件也必须在 preset 之外。
372
+ #
373
+ # 它自带 `process.versions.electron` 判据 ⇒ headless profile(web / tui)
374
+ # 里直接跳过,不会去动无关 profile 的宿主 web 服务。
375
+ - id: desktop-cookie-janitor
376
+ name: '@dsh-edge/dsh-edge-agent/desktop-cookie-janitor'
377
+ config:
378
+ enabled: true
379
+ # 宿主 web 服务是裸 createServer(16 KB 头上限);抬到 64 KB 让
380
+ # 一个已经攒胖的 cookie jar 也不会打死启动。
381
+ maxHeaderBytes: 65536
382
+