dsh-agent-plugins-market 0.9.0 → 0.9.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 (358) hide show
  1. package/README.md +64 -154
  2. package/README.zh.md +74 -164
  3. package/assets/dsh-agent-plugins.png +0 -0
  4. package/client/client.js +5371 -1085
  5. package/client/client.js.map +1 -1
  6. package/lib/index.js +2 -257
  7. package/lib/{application → packages/market-bundle/src/application}/catalog.js +207 -41
  8. package/lib/{application → packages/market-bundle/src/application}/details.js +73 -29
  9. package/lib/packages/market-bundle/src/application/extension-inventory.js +408 -0
  10. package/lib/packages/market-bundle/src/application/extension-project.js +64 -0
  11. package/lib/packages/market-bundle/src/application/resource-inventory.js +96 -0
  12. package/lib/packages/market-bundle/src/application/server-config.js +9 -0
  13. package/lib/packages/market-bundle/src/application/suite-queries.js +86 -0
  14. package/lib/packages/market-bundle/src/index.js +372 -0
  15. package/lib/{runtime/host → packages/market-bundle/src/platform}/feedback-tool.js +2 -2
  16. package/lib/{runtime/host → packages/market-bundle/src/platform}/settings-namespace.js +55 -7
  17. package/lib/packages/market-bundle/src/platform/settings-schema.js +25 -0
  18. package/lib/packages/market-bundle/src/routes-extension-presets.js +161 -0
  19. package/lib/packages/market-bundle/src/routes-resources.js +127 -0
  20. package/lib/{routes.js → packages/market-bundle/src/routes.js} +225 -21
  21. package/lib/packages/market-bundle/src/runtime-adapters.js +57 -0
  22. package/lib/packages/market-bundle/src/session-extension.js +337 -0
  23. package/lib/{application → packages/market-catalog/src/application}/catalog-context.js +7 -4
  24. package/lib/{application → packages/market-catalog/src/application}/install-store.js +3 -3
  25. package/lib/{application → packages/market-catalog/src/application}/snapshot-cache.js +100 -11
  26. package/lib/{application → packages/market-catalog/src/application}/source-store.js +24 -11
  27. package/lib/{application → packages/market-catalog/src/application}/state/state-store.js +1 -1
  28. package/lib/{application → packages/market-catalog/src/application}/state/storage-migration.js +1 -1
  29. package/lib/packages/market-catalog/src/index.js +19 -0
  30. package/lib/{catalog → packages/market-catalog/src/scanning}/archive.js +1 -1
  31. package/lib/{catalog → packages/market-catalog/src/scanning}/codex-mcp.js +1 -1
  32. package/lib/{catalog → packages/market-catalog/src/scanning}/component-files.js +2 -2
  33. package/lib/{catalog → packages/market-catalog/src/scanning}/manifests.js +2 -2
  34. package/lib/{catalog → packages/market-catalog/src/scanning}/native-project.js +1 -1
  35. package/lib/{catalog → packages/market-catalog/src/scanning}/paths.js +1 -1
  36. package/lib/{catalog → packages/market-catalog/src/scanning}/plugin-variables.js +21 -1
  37. package/lib/{catalog → packages/market-catalog/src/scanning}/scan-resolvers.js +35 -2
  38. package/lib/{catalog → packages/market-catalog/src/scanning}/skills-parse.js +40 -10
  39. package/lib/{catalog → packages/market-catalog/src/scanning}/validate.js +15 -2
  40. package/lib/packages/market-contracts/src/contracts/extension-presets.js +125 -0
  41. package/lib/{contracts → packages/market-contracts/src/contracts}/market.js +33 -5
  42. package/lib/packages/market-contracts/src/contracts/mcp-overrides.js +2 -0
  43. package/lib/packages/market-contracts/src/contracts/resource-window.js +29 -0
  44. package/lib/packages/market-contracts/src/contracts/settings.js +130 -0
  45. package/lib/packages/market-contracts/src/contracts/surface-toggles.js +29 -0
  46. package/lib/packages/market-contracts/src/contracts/translation.js +28 -0
  47. package/lib/packages/market-contracts/src/index.js +4 -0
  48. package/lib/{model → packages/market-contracts/src/model}/layouts.js +11 -0
  49. package/lib/{application → packages/market-contracts/src/ports}/ports.js +3 -0
  50. package/lib/{application/mcp/mcp-redaction.js → packages/market-contracts/src/redaction.js} +17 -1
  51. package/lib/{application → packages/market-lsp/src/application}/lsp/lsp-direct-config.js +2 -2
  52. package/lib/{application → packages/market-lsp/src/application}/lsp/lsp-server-state.js +1 -1
  53. package/lib/{application → packages/market-lsp/src/application}/lsp/lsp-status.js +20 -3
  54. package/lib/{application → packages/market-lsp/src/application}/lsp/profile-seam.js +1 -1
  55. package/lib/packages/market-lsp/src/application/lsp/validation.js +46 -0
  56. package/lib/{application → packages/market-lsp/src/application}/lsp-service.js +61 -3
  57. package/lib/packages/market-lsp/src/index.js +8 -0
  58. package/lib/{runtime → packages/market-lsp/src/runtime}/lsp/lsp-mounts.js +79 -40
  59. package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-backend.js +0 -16
  60. package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-config.js +104 -21
  61. package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-direct-config.js +12 -4
  62. package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-overrides.js +4 -4
  63. package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-status.js +49 -10
  64. package/lib/packages/market-mcp/src/application/mcp/validation.js +63 -0
  65. package/lib/{application → packages/market-mcp/src/application}/mcp-service.js +111 -91
  66. package/lib/packages/market-mcp/src/index.js +10 -0
  67. package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/bridge.js +12 -9
  68. package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/connection.js +1 -1
  69. package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/oauth.js +1 -1
  70. package/lib/packages/market-mcp/src/runtime/mcp/bridge/tool-ownership.js +26 -0
  71. package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/tools.js +1 -1
  72. package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-auth-record.js +35 -4
  73. package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-mounts.js +35 -4
  74. package/lib/packages/market-runtime/src/adapter-contracts.js +1 -0
  75. package/lib/packages/market-runtime/src/application/command-resources.js +74 -0
  76. package/lib/packages/market-runtime/src/application/extension-authorization.js +27 -0
  77. package/lib/packages/market-runtime/src/application/extension-hook-selection.js +56 -0
  78. package/lib/packages/market-runtime/src/application/extension-suite-declarations.js +57 -0
  79. package/lib/packages/market-runtime/src/application/extension-suite-selection.js +84 -0
  80. package/lib/packages/market-runtime/src/application/fs-probe.js +43 -0
  81. package/lib/packages/market-runtime/src/application/panel-resources.js +370 -0
  82. package/lib/{application → packages/market-runtime/src/application}/panels/user-hooks.js +2 -2
  83. package/lib/{application → packages/market-runtime/src/application}/panels/user-store.js +53 -13
  84. package/lib/{application → packages/market-runtime/src/application}/project-agent-roles.js +20 -11
  85. package/lib/packages/market-runtime/src/application/state/extension-presets.js +144 -0
  86. package/lib/packages/market-runtime/src/application/state/resource-favorites.js +90 -0
  87. package/lib/packages/market-runtime/src/application/state/resource-filters.js +2 -0
  88. package/lib/packages/market-runtime/src/application/state/surface-toggles.js +10 -0
  89. package/lib/packages/market-runtime/src/application/state/workspace-policy.js +56 -0
  90. package/lib/packages/market-runtime/src/catalog-port.js +1 -0
  91. package/lib/packages/market-runtime/src/extension-service.js +1 -0
  92. package/lib/packages/market-runtime/src/index.js +31 -0
  93. package/lib/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-router.js +74 -79
  94. package/lib/packages/market-runtime/src/runtime/agents/agent-teams-seat.js +58 -0
  95. package/lib/{runtime → packages/market-runtime/src/runtime}/agents/subagent-catalog.js +89 -21
  96. package/lib/packages/market-runtime/src/runtime/agents/team-coordination.js +51 -0
  97. package/lib/packages/market-runtime/src/runtime/agents/teammate-role-runtime.js +241 -0
  98. package/lib/packages/market-runtime/src/runtime/agents/teammate-role-tool.js +130 -0
  99. package/lib/{runtime → packages/market-runtime/src/runtime}/core/reconcile-scheduler.js +2 -2
  100. package/lib/packages/market-runtime/src/runtime/core/reconciler.js +457 -0
  101. package/lib/packages/market-runtime/src/runtime/host/command-name-allocator.js +168 -0
  102. package/lib/packages/market-runtime/src/runtime/host/extension-progress.js +120 -0
  103. package/lib/packages/market-runtime/src/runtime/host/extension-runtime.js +405 -0
  104. package/lib/packages/market-runtime/src/runtime/host/extension-session-state.js +839 -0
  105. package/lib/packages/market-runtime/src/runtime/host/extension-tool-gates.js +96 -0
  106. package/lib/{runtime → packages/market-runtime/src/runtime}/host/failure-detail.js +1 -1
  107. package/lib/{runtime → packages/market-runtime/src/runtime}/host/host-locale.js +2 -0
  108. package/lib/packages/market-runtime/src/runtime/host/menu-row-identities.js +38 -0
  109. package/lib/packages/market-runtime/src/runtime/host/resource-filter-service.js +81 -0
  110. package/lib/packages/market-runtime/src/runtime/host/scoped-contributors.js +304 -0
  111. package/lib/packages/market-runtime/src/runtime/host/surface-toggle-service.js +15 -0
  112. package/lib/packages/market-runtime/src/runtime/panels/user-commands.js +211 -0
  113. package/lib/{runtime → packages/market-runtime/src/runtime}/panels/user-panels.js +34 -14
  114. package/lib/packages/market-runtime/src/runtime/surfaces/commands-mounts.js +256 -0
  115. package/lib/packages/market-runtime/src/runtime/surfaces/extension-hooks.js +294 -0
  116. package/lib/packages/market-runtime/src/runtime/surfaces/hook-dry-run.js +122 -0
  117. package/lib/{runtime → packages/market-runtime/src/runtime}/surfaces/hooks-mounts.js +1 -1
  118. package/lib/{runtime → packages/market-runtime/src/runtime}/surfaces/project-runtime.js +23 -13
  119. package/lib/packages/market-runtime/src/runtime/surfaces/skills-provider.js +241 -0
  120. package/lib/packages/market-translation/src/application/state/translation-cache.js +122 -0
  121. package/lib/packages/market-translation/src/application/translation/chain.js +99 -0
  122. package/lib/packages/market-translation/src/application/translation/document.js +384 -0
  123. package/lib/packages/market-translation/src/application/translation/localizer.js +642 -0
  124. package/lib/packages/market-translation/src/application/translation/service.js +113 -0
  125. package/lib/packages/market-translation/src/application/translation/unit.js +19 -0
  126. package/lib/packages/market-translation/src/index.js +4 -0
  127. package/lib/packages/market-translation/src/runtime/host/llm-translator.js +278 -0
  128. package/lib/packages/market-translation/src/runtime/host/machine-translator.js +152 -0
  129. package/lib/packages/market-translation/src/runtime/host/text-masking.js +96 -0
  130. package/lib/packages/market-translation/src/runtime/host/translation-providers.js +116 -0
  131. package/lib/types/index.d.ts +2 -130
  132. package/lib/types/{application → packages/market-bundle/src/application}/catalog.d.ts +117 -22
  133. package/lib/types/packages/market-bundle/src/application/details.d.ts +24 -0
  134. package/lib/types/packages/market-bundle/src/application/extension-inventory.d.ts +45 -0
  135. package/lib/types/packages/market-bundle/src/application/extension-project.d.ts +26 -0
  136. package/lib/types/packages/market-bundle/src/application/resource-inventory.d.ts +42 -0
  137. package/lib/types/packages/market-bundle/src/application/server-config.d.ts +9 -0
  138. package/lib/types/packages/market-bundle/src/application/suite-queries.d.ts +84 -0
  139. package/lib/types/packages/market-bundle/src/index.d.ts +125 -0
  140. package/lib/types/{runtime/host → packages/market-bundle/src/platform}/settings-namespace.d.ts +44 -9
  141. package/lib/types/{application/mcp/mcp-backend.d.ts → packages/market-bundle/src/platform/settings-schema.d.ts} +13 -28
  142. package/lib/types/packages/market-bundle/src/routes-extension-presets.d.ts +15 -0
  143. package/lib/types/packages/market-bundle/src/routes-resources.d.ts +17 -0
  144. package/lib/types/packages/market-bundle/src/routes.d.ts +32 -0
  145. package/lib/types/packages/market-bundle/src/runtime-adapters.d.ts +42 -0
  146. package/lib/types/packages/market-bundle/src/session-extension.d.ts +62 -0
  147. package/lib/types/{application → packages/market-catalog/src/application}/catalog-context.d.ts +11 -3
  148. package/lib/types/{application → packages/market-catalog/src/application}/install-store.d.ts +1 -1
  149. package/lib/types/{application → packages/market-catalog/src/application}/regions.d.ts +1 -1
  150. package/lib/types/{application → packages/market-catalog/src/application}/snapshot-cache.d.ts +44 -2
  151. package/lib/types/{application → packages/market-catalog/src/application}/source-store.d.ts +12 -3
  152. package/lib/types/{application → packages/market-catalog/src/application}/state/state-store.d.ts +1 -1
  153. package/lib/types/packages/market-catalog/src/index.d.ts +22 -0
  154. package/lib/types/{catalog → packages/market-catalog/src/scanning}/archive.d.ts +1 -1
  155. package/lib/types/{catalog → packages/market-catalog/src/scanning}/codex-mcp.d.ts +1 -1
  156. package/lib/types/{catalog → packages/market-catalog/src/scanning}/component-files.d.ts +1 -1
  157. package/lib/types/{catalog → packages/market-catalog/src/scanning}/lsp-spec.d.ts +1 -1
  158. package/lib/types/{catalog → packages/market-catalog/src/scanning}/manifests.d.ts +3 -3
  159. package/lib/types/{catalog → packages/market-catalog/src/scanning}/native-project.d.ts +2 -2
  160. package/lib/types/{catalog → packages/market-catalog/src/scanning}/plugin-variables.d.ts +12 -1
  161. package/lib/types/{catalog → packages/market-catalog/src/scanning}/project-config.d.ts +2 -2
  162. package/lib/types/{catalog → packages/market-catalog/src/scanning}/project-hooks.d.ts +2 -2
  163. package/lib/types/{catalog → packages/market-catalog/src/scanning}/scan-pipeline.d.ts +1 -1
  164. package/lib/types/{catalog → packages/market-catalog/src/scanning}/scan-resolvers.d.ts +3 -3
  165. package/lib/types/{catalog → packages/market-catalog/src/scanning}/source-catalog.d.ts +1 -1
  166. package/lib/types/{catalog → packages/market-catalog/src/scanning}/suite-components.d.ts +1 -1
  167. package/lib/types/{catalog → packages/market-catalog/src/scanning}/suite-scanner.d.ts +1 -1
  168. package/lib/types/{catalog → packages/market-catalog/src/scanning}/surfaces.d.ts +1 -1
  169. package/lib/types/{catalog → packages/market-catalog/src/scanning}/validate.d.ts +1 -1
  170. package/lib/types/packages/market-contracts/src/contracts/extension-presets.d.ts +237 -0
  171. package/lib/types/{contracts → packages/market-contracts/src/contracts}/market.d.ts +87 -16
  172. package/lib/types/packages/market-contracts/src/contracts/mcp-overrides.d.ts +39 -0
  173. package/lib/types/{contracts → packages/market-contracts/src/contracts}/mcp-status.d.ts +9 -0
  174. package/lib/types/packages/market-contracts/src/contracts/resource-window.d.ts +70 -0
  175. package/lib/types/packages/market-contracts/src/contracts/settings.d.ts +121 -0
  176. package/lib/types/packages/market-contracts/src/contracts/surface-toggles.d.ts +28 -0
  177. package/lib/types/packages/market-contracts/src/contracts/translation.d.ts +81 -0
  178. package/lib/types/{runtime → packages/market-contracts/src}/host/plugin-message-source.d.ts +1 -1
  179. package/lib/types/packages/market-contracts/src/index.d.ts +5 -0
  180. package/lib/types/{model → packages/market-contracts/src/model}/layouts.d.ts +7 -0
  181. package/lib/types/{model → packages/market-contracts/src/model}/types.d.ts +2 -2
  182. package/lib/types/packages/market-contracts/src/ports/ports.d.ts +183 -0
  183. package/lib/types/{application → packages/market-contracts/src/ports}/queries.d.ts +27 -6
  184. package/lib/types/{application/mcp/mcp-redaction.d.ts → packages/market-contracts/src/redaction.d.ts} +2 -0
  185. package/lib/types/{application → packages/market-lsp/src/application}/lsp/lsp-direct-config.d.ts +1 -1
  186. package/lib/types/{application → packages/market-lsp/src/application}/lsp/lsp-status.d.ts +21 -5
  187. package/lib/types/packages/market-lsp/src/application/lsp/validation.d.ts +8 -0
  188. package/lib/types/{application → packages/market-lsp/src/application}/lsp-service.d.ts +19 -6
  189. package/lib/types/packages/market-lsp/src/index.d.ts +8 -0
  190. package/lib/types/{runtime → packages/market-lsp/src/runtime}/lsp/lsp-mounts.d.ts +26 -6
  191. package/lib/types/packages/market-mcp/src/application/mcp/mcp-backend.d.ts +28 -0
  192. package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-bridge-config.d.ts +1 -1
  193. package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-config.d.ts +2 -2
  194. package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-direct-config.d.ts +6 -1
  195. package/lib/types/{application → packages/market-mcp/src/application}/mcp/mcp-overrides.d.ts +4 -38
  196. package/lib/types/packages/market-mcp/src/application/mcp/mcp-status.d.ts +40 -0
  197. package/lib/types/{application/server-config.d.ts → packages/market-mcp/src/application/mcp/validation.d.ts} +2 -10
  198. package/lib/types/{application → packages/market-mcp/src/application}/mcp-service.d.ts +22 -16
  199. package/lib/types/packages/market-mcp/src/index.d.ts +12 -0
  200. package/lib/types/packages/market-mcp/src/runtime/mcp/bridge/tool-ownership.d.ts +14 -0
  201. package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-auth-record.d.ts +4 -0
  202. package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-mounts.d.ts +19 -3
  203. package/lib/types/packages/market-runtime/src/adapter-contracts.d.ts +89 -0
  204. package/lib/types/{application → packages/market-runtime/src/application}/agent-roles.d.ts +2 -0
  205. package/lib/types/packages/market-runtime/src/application/command-resources.d.ts +26 -0
  206. package/lib/types/packages/market-runtime/src/application/extension-authorization.d.ts +12 -0
  207. package/lib/types/packages/market-runtime/src/application/extension-hook-selection.d.ts +23 -0
  208. package/lib/types/packages/market-runtime/src/application/extension-suite-declarations.d.ts +10 -0
  209. package/lib/types/packages/market-runtime/src/application/extension-suite-selection.d.ts +30 -0
  210. package/lib/types/packages/market-runtime/src/application/fs-probe.d.ts +12 -0
  211. package/lib/types/packages/market-runtime/src/application/panel-resources.d.ts +100 -0
  212. package/lib/types/{application → packages/market-runtime/src/application}/panels/user-hooks.d.ts +1 -1
  213. package/lib/types/packages/market-runtime/src/application/project-agent-roles.d.ts +10 -0
  214. package/lib/types/packages/market-runtime/src/application/state/extension-presets.d.ts +24 -0
  215. package/lib/types/packages/market-runtime/src/application/state/resource-favorites.d.ts +9 -0
  216. package/lib/types/packages/market-runtime/src/application/state/resource-filters.d.ts +2 -0
  217. package/lib/types/packages/market-runtime/src/application/state/surface-toggles.d.ts +6 -0
  218. package/lib/types/packages/market-runtime/src/application/state/workspace-policy.d.ts +19 -0
  219. package/lib/types/packages/market-runtime/src/catalog-port.d.ts +30 -0
  220. package/lib/types/packages/market-runtime/src/extension-service.d.ts +14 -0
  221. package/lib/types/packages/market-runtime/src/index.d.ts +41 -0
  222. package/lib/types/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-router.d.ts +66 -31
  223. package/lib/types/packages/market-runtime/src/runtime/agents/agent-teams-seat.d.ts +41 -0
  224. package/lib/types/{runtime → packages/market-runtime/src/runtime}/agents/subagent-catalog.d.ts +34 -2
  225. package/lib/types/packages/market-runtime/src/runtime/agents/team-coordination.d.ts +8 -0
  226. package/lib/types/packages/market-runtime/src/runtime/agents/teammate-role-runtime.d.ts +74 -0
  227. package/lib/types/packages/market-runtime/src/runtime/agents/teammate-role-tool.d.ts +6 -0
  228. package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/reconcile-scheduler.d.ts +5 -2
  229. package/lib/types/packages/market-runtime/src/runtime/core/reconciler.d.ts +141 -0
  230. package/lib/types/packages/market-runtime/src/runtime/host/command-name-allocator.d.ts +132 -0
  231. package/lib/types/packages/market-runtime/src/runtime/host/extension-progress.d.ts +91 -0
  232. package/lib/types/packages/market-runtime/src/runtime/host/extension-runtime.d.ts +77 -0
  233. package/lib/types/packages/market-runtime/src/runtime/host/extension-session-state.d.ts +242 -0
  234. package/lib/types/packages/market-runtime/src/runtime/host/extension-tool-gates.d.ts +38 -0
  235. package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/host-locale.d.ts +1 -1
  236. package/lib/types/packages/market-runtime/src/runtime/host/menu-row-identities.d.ts +50 -0
  237. package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/model-catalog.d.ts +1 -1
  238. package/lib/types/packages/market-runtime/src/runtime/host/resource-filter-service.d.ts +34 -0
  239. package/lib/types/packages/market-runtime/src/runtime/host/scoped-contributors.d.ts +58 -0
  240. package/lib/types/packages/market-runtime/src/runtime/host/surface-toggle-service.d.ts +10 -0
  241. package/lib/types/packages/market-runtime/src/runtime/panels/user-commands.d.ts +74 -0
  242. package/lib/types/{runtime → packages/market-runtime/src/runtime}/panels/user-panels.d.ts +7 -1
  243. package/lib/types/packages/market-runtime/src/runtime/surfaces/commands-mounts.d.ts +81 -0
  244. package/lib/types/packages/market-runtime/src/runtime/surfaces/extension-hooks.d.ts +59 -0
  245. package/lib/types/packages/market-runtime/src/runtime/surfaces/hook-dry-run.d.ts +91 -0
  246. package/lib/types/{runtime → packages/market-runtime/src/runtime}/surfaces/hooks-mounts.d.ts +1 -1
  247. package/lib/types/{runtime → packages/market-runtime/src/runtime}/surfaces/project-runtime.d.ts +8 -5
  248. package/lib/types/packages/market-runtime/src/runtime/surfaces/skills-provider.d.ts +71 -0
  249. package/lib/types/packages/market-translation/src/application/state/translation-cache.d.ts +56 -0
  250. package/lib/types/packages/market-translation/src/application/translation/chain.d.ts +47 -0
  251. package/lib/types/packages/market-translation/src/application/translation/document.d.ts +54 -0
  252. package/lib/types/packages/market-translation/src/application/translation/localizer.d.ts +325 -0
  253. package/lib/types/packages/market-translation/src/application/translation/service.d.ts +89 -0
  254. package/lib/types/packages/market-translation/src/application/translation/unit.d.ts +35 -0
  255. package/lib/types/packages/market-translation/src/index.d.ts +4 -0
  256. package/lib/types/packages/market-translation/src/runtime/host/llm-translator.d.ts +30 -0
  257. package/lib/types/packages/market-translation/src/runtime/host/machine-translator.d.ts +52 -0
  258. package/lib/types/packages/market-translation/src/runtime/host/text-masking.d.ts +42 -0
  259. package/lib/types/packages/market-translation/src/runtime/host/translation-providers.d.ts +42 -0
  260. package/locale/en.json +6 -0
  261. package/locale/zh.json +6 -0
  262. package/package.json +47 -10
  263. package/schemas/README.md +4 -4
  264. package/schemas/agent-plugins/spec.md +2 -2
  265. package/schemas/com.deepseek.harness/spec.md +1 -1
  266. package/schemas/skill-collection/spec.md +10 -2
  267. package/lib/application/panel-resources.js +0 -161
  268. package/lib/application/server-config.js +0 -109
  269. package/lib/contracts/settings.js +0 -63
  270. package/lib/runtime/core/reconciler.js +0 -100
  271. package/lib/runtime/panels/user-commands.js +0 -105
  272. package/lib/runtime/surfaces/commands-mounts.js +0 -186
  273. package/lib/runtime/surfaces/skills-provider.js +0 -160
  274. package/lib/types/application/details.d.ts +0 -7
  275. package/lib/types/application/mcp/mcp-status.d.ts +0 -24
  276. package/lib/types/application/panel-resources.d.ts +0 -28
  277. package/lib/types/application/ports.d.ts +0 -86
  278. package/lib/types/application/project-agent-roles.d.ts +0 -3
  279. package/lib/types/contracts/settings.d.ts +0 -59
  280. package/lib/types/routes.d.ts +0 -16
  281. package/lib/types/runtime/core/reconciler.d.ts +0 -58
  282. package/lib/types/runtime/panels/user-commands.d.ts +0 -27
  283. package/lib/types/runtime/surfaces/commands-mounts.d.ts +0 -48
  284. package/lib/types/runtime/surfaces/skills-provider.d.ts +0 -23
  285. /package/lib/{application → packages/market-catalog/src/application}/deadline.js +0 -0
  286. /package/lib/{application → packages/market-catalog/src/application}/json-file.js +0 -0
  287. /package/lib/{application → packages/market-catalog/src/application}/regions.js +0 -0
  288. /package/lib/{catalog → packages/market-catalog/src/scanning}/fs-probes.js +0 -0
  289. /package/lib/{catalog → packages/market-catalog/src/scanning}/git.js +0 -0
  290. /package/lib/{catalog → packages/market-catalog/src/scanning}/lsp-spec.js +0 -0
  291. /package/lib/{catalog → packages/market-catalog/src/scanning}/project-config.js +0 -0
  292. /package/lib/{catalog → packages/market-catalog/src/scanning}/project-hooks.js +0 -0
  293. /package/lib/{catalog → packages/market-catalog/src/scanning}/scan-pipeline.js +0 -0
  294. /package/lib/{catalog → packages/market-catalog/src/scanning}/source-catalog.js +0 -0
  295. /package/lib/{catalog → packages/market-catalog/src/scanning}/suite-components.js +0 -0
  296. /package/lib/{catalog → packages/market-catalog/src/scanning}/suite-scanner.js +0 -0
  297. /package/lib/{catalog → packages/market-catalog/src/scanning}/surfaces.js +0 -0
  298. /package/lib/{contracts → packages/market-contracts/src/contracts}/lsp-status.js +0 -0
  299. /package/lib/{contracts → packages/market-contracts/src/contracts}/lsp.js +0 -0
  300. /package/lib/{contracts → packages/market-contracts/src/contracts}/mcp-status.js +0 -0
  301. /package/lib/{contracts → packages/market-contracts/src/contracts}/mcp.js +0 -0
  302. /package/lib/{runtime → packages/market-contracts/src}/host/plugin-message-source.js +0 -0
  303. /package/lib/{model → packages/market-contracts/src/model}/command-names.js +0 -0
  304. /package/lib/{model → packages/market-contracts/src/model}/preset-source.js +0 -0
  305. /package/lib/{model → packages/market-contracts/src/model}/types.js +0 -0
  306. /package/lib/{application → packages/market-contracts/src/ports}/queries.js +0 -0
  307. /package/lib/{application → packages/market-mcp/src/application}/mcp/mcp-bridge-config.js +0 -0
  308. /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-contract.js +0 -0
  309. /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-seams.js +0 -0
  310. /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/plugin-identity.js +0 -0
  311. /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/projection.js +0 -0
  312. /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/transport.js +0 -0
  313. /package/lib/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-credentials.js +0 -0
  314. /package/lib/{application → packages/market-runtime/src/application}/agent-roles.js +0 -0
  315. /package/lib/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-names.js +0 -0
  316. /package/lib/{runtime → packages/market-runtime/src/runtime}/core/context.js +0 -0
  317. /package/lib/{runtime → packages/market-runtime/src/runtime}/core/mount-lifecycle.js +0 -0
  318. /package/lib/{runtime → packages/market-runtime/src/runtime}/core/source-auto-update.js +0 -0
  319. /package/lib/{runtime → packages/market-runtime/src/runtime}/core/timer-seat.js +0 -0
  320. /package/lib/{runtime → packages/market-runtime/src/runtime}/host/model-catalog.js +0 -0
  321. /package/lib/{runtime → packages/market-runtime/src/runtime}/host/shell-path.js +0 -0
  322. /package/lib/{runtime → packages/market-runtime/src/runtime}/host/tool-registry-observer.js +0 -0
  323. /package/lib/{runtime → packages/market-runtime/src/runtime}/surfaces/dynamic-context.js +0 -0
  324. /package/lib/types/{runtime/host → packages/market-bundle/src/platform}/feedback-tool.d.ts +0 -0
  325. /package/lib/types/{application → packages/market-catalog/src/application}/deadline.d.ts +0 -0
  326. /package/lib/types/{application → packages/market-catalog/src/application}/json-file.d.ts +0 -0
  327. /package/lib/types/{application → packages/market-catalog/src/application}/state/storage-migration.d.ts +0 -0
  328. /package/lib/types/{catalog → packages/market-catalog/src/scanning}/fs-probes.d.ts +0 -0
  329. /package/lib/types/{catalog → packages/market-catalog/src/scanning}/git.d.ts +0 -0
  330. /package/lib/types/{catalog → packages/market-catalog/src/scanning}/paths.d.ts +0 -0
  331. /package/lib/types/{catalog → packages/market-catalog/src/scanning}/skills-parse.d.ts +0 -0
  332. /package/lib/types/{contracts → packages/market-contracts/src/contracts}/lsp-status.d.ts +0 -0
  333. /package/lib/types/{contracts → packages/market-contracts/src/contracts}/lsp.d.ts +0 -0
  334. /package/lib/types/{contracts → packages/market-contracts/src/contracts}/mcp.d.ts +0 -0
  335. /package/lib/types/{model → packages/market-contracts/src/model}/command-names.d.ts +0 -0
  336. /package/lib/types/{model → packages/market-contracts/src/model}/preset-source.d.ts +0 -0
  337. /package/lib/types/{application → packages/market-lsp/src/application}/lsp/lsp-server-state.d.ts +0 -0
  338. /package/lib/types/{application → packages/market-lsp/src/application}/lsp/profile-seam.d.ts +0 -0
  339. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/bridge.d.ts +0 -0
  340. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/connection.d.ts +0 -0
  341. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-contract.d.ts +0 -0
  342. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/host-seams.d.ts +0 -0
  343. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/oauth.d.ts +0 -0
  344. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/plugin-identity.d.ts +0 -0
  345. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/projection.d.ts +0 -0
  346. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/tools.d.ts +0 -0
  347. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/bridge/transport.d.ts +0 -0
  348. /package/lib/types/{runtime → packages/market-mcp/src/runtime}/mcp/mcp-credentials.d.ts +0 -0
  349. /package/lib/types/{application → packages/market-runtime/src/application}/panels/user-store.d.ts +0 -0
  350. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/agents/agent-role-names.d.ts +0 -0
  351. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/context.d.ts +0 -0
  352. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/mount-lifecycle.d.ts +0 -0
  353. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/source-auto-update.d.ts +0 -0
  354. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/core/timer-seat.d.ts +0 -0
  355. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/failure-detail.d.ts +0 -0
  356. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/shell-path.d.ts +0 -0
  357. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/host/tool-registry-observer.d.ts +0 -0
  358. /package/lib/types/{runtime → packages/market-runtime/src/runtime}/surfaces/dynamic-context.d.ts +0 -0
@@ -0,0 +1,183 @@
1
+ /**
2
+ * The host seams a catalog consumes, in one declared place.
3
+ *
4
+ * Every seam is read at call time rather than captured at construction: the
5
+ * credentials, tools and settings services resolve *after* `apply()` returns,
6
+ * so a value snapshotted when the catalog is built would stay undefined for
7
+ * the rest of the process. A composition root wires the seams it has;
8
+ * {@link resolveCatalogPorts} fills in the rest from
9
+ * {@link defaultCatalogPorts}, which keeps a bare `new Catalog({...})` — the
10
+ * shape the tests build — fully functional.
11
+ */
12
+ import type { LspServerSpec, SourceKind } from '../model/types.js';
13
+ import type { MenuRowSource } from '../contracts/market.js';
14
+ export type { McpBackendInfo } from '../contracts/market.js';
15
+ import type { DownloadRegionSetting } from '../contracts/settings.js';
16
+ import type { McpBackend } from '../contracts/mcp.js';
17
+ import type { LspMountDiagnostic } from '../contracts/lsp.js';
18
+ import type { DocumentTranslation, TranslationFields, TranslationProvider, TranslationSurfaceKind } from '../contracts/translation.js';
19
+ /**
20
+ * One localization read: the fields resolved now, and how many of them this
21
+ * read queued and has not seen land yet. A surface reports the count so its
22
+ * reader can re-read until the translations arrive instead of staying on the
23
+ * authored text.
24
+ */
25
+ export interface LocalizeResult {
26
+ fields: TranslationFields;
27
+ pending: number;
28
+ }
29
+ /**
30
+ * Resolve one entity's translatable fields for a surface.
31
+ *
32
+ * `locale` is required: the caller resolved the host preference once for the
33
+ * read it is serving. Resolving it is not free — the host projects every active
34
+ * profile entry's live configuration to answer it — so there is deliberately no
35
+ * default and no omitted form here: a resolver that fell back to resolving the
36
+ * preference itself made a read's cost scale with its entity count.
37
+ */
38
+ export type LocalizeFields = (surface: TranslationSurfaceKind, id: string, fields: {
39
+ name?: string | undefined;
40
+ description?: string | undefined;
41
+ }, locale: string) => LocalizeResult;
42
+ /**
43
+ * Resolve one document body for a surface, chunk by chunk.
44
+ *
45
+ * A document is not a field: it is longer than any single provider request may
46
+ * carry, so the resolver splits it, queues what is missing, and answers with
47
+ * whatever is ready. The same "never wait, report pending" contract as
48
+ * {@link LocalizeFields} holds, and for the same reason — a reader must be able
49
+ * to open a document without a provider round trip standing between it and the
50
+ * page.
51
+ *
52
+ * `locale` is required for the reason {@link LocalizeFields} documents.
53
+ */
54
+ export type LocalizeDocument = (surface: TranslationSurfaceKind, id: string, text: string, locale: string, retry?: boolean) => DocumentTranslation;
55
+ /**
56
+ * One read's localization: the host locale, and the resolver that applies it.
57
+ *
58
+ * The two travel together because resolving the locale is a whole-profile
59
+ * projection, never a per-entity question. A surface that walks entities — the
60
+ * MCP and LSP status inventories — receives the pair from the caller that owns
61
+ * the read instead of resolving anything itself.
62
+ */
63
+ export interface Localization {
64
+ locale: string;
65
+ localizeFields: LocalizeFields;
66
+ }
67
+ /** One MCP tool observed from the host tool registry (structural). */
68
+ export interface McpToolSnapshot {
69
+ name: string;
70
+ description?: string;
71
+ /** The input schema the server advertised, when the host exposes it. */
72
+ parameters?: unknown;
73
+ }
74
+ /** The LSP mount-registry surface the aggregator consumes (structural, for tests). */
75
+ export interface LspMountStatusSource {
76
+ diagnosticsSnapshot(): Map<string, LspMountDiagnostic>;
77
+ hasLiveMounts(): boolean;
78
+ disabledServers?(): Set<string>;
79
+ }
80
+ /** A new source: its location, optional branch, and acquisition kind. */
81
+ export interface SourceInput {
82
+ url: string;
83
+ branch?: string;
84
+ local?: boolean;
85
+ kind?: SourceKind;
86
+ sha256?: string;
87
+ }
88
+ /** A partial source update; omitted fields keep their persisted value. */
89
+ export interface SourcePatch {
90
+ url?: string;
91
+ branch?: string;
92
+ local?: boolean;
93
+ kind?: SourceKind;
94
+ sha256?: string;
95
+ }
96
+ /** The user's direct LSP server table, keyed by server name. */
97
+ export type LspServerTable = Record<string, LspServerSpec>;
98
+ /** Credential-store seam backing the MCP re-authorize action. */
99
+ export interface CredentialGrantStore {
100
+ deleteGrantRecord(serverName: string): Promise<void>;
101
+ }
102
+ /**
103
+ * One menu row this plugin owns, paired with the panel identity that
104
+ * translates it.
105
+ *
106
+ * The runtime half of the join lives behind this record because only the
107
+ * registries know the call name a command actually got, while only the panels
108
+ * know the id and authored text a translation is cached under. The catalog
109
+ * joins them without importing either.
110
+ */
111
+ export interface MenuRowIdentity {
112
+ /** Which `/` menu group the row belongs to. */
113
+ readonly source: MenuRowSource;
114
+ /** The name the menu row carries — the allocated call name for a command. */
115
+ readonly name: string;
116
+ /** The identity the panel translates the entry under; the same id means the same cache entry. */
117
+ readonly id: string;
118
+ /** The authored name the panel handed to the translator. */
119
+ readonly authoredName: string;
120
+ /** The authored description the panel handed to the translator; absent when it had none. */
121
+ readonly authoredDescription?: string;
122
+ }
123
+ /** The complete set of host seams a catalog needs; every member is resolved. */
124
+ export interface CatalogPorts {
125
+ /** Live host MCP tool registry snapshot for the status surface. */
126
+ mcpToolSnapshot(): readonly McpToolSnapshot[];
127
+ /** Absent when the credentials service is not mounted in this composition. */
128
+ credentialsStore: CredentialGrantStore | undefined;
129
+ /** Flags one mount key for an explicit rebuild on the next reconcile. */
130
+ mcpRemount(suiteId: string, serverKey: string): void;
131
+ /** Flags every live mount for an explicit rebuild on the next reconcile. */
132
+ mcpRemountAll(): void;
133
+ /** Resolves the mount key owning one derived serverName; undefined when not mounted. */
134
+ mcpServerOwner(serverName: string): {
135
+ suiteId: string;
136
+ serverKey: string;
137
+ } | undefined;
138
+ /** Latest LSP mount diagnostics. */
139
+ lspStatusSource: LspMountStatusSource;
140
+ /** The persisted MCP mount backend choice. */
141
+ mcpBackend(): Promise<McpBackend>;
142
+ /** Persists an MCP mount backend choice. */
143
+ setMcpBackend(backend: McpBackend): Promise<void>;
144
+ /** The persisted download-region setting. */
145
+ downloadRegion(): Promise<DownloadRegionSetting>;
146
+ /** The host locale preference ('zh' default when unset). */
147
+ localePreference(): string;
148
+ /**
149
+ * Every `/` menu row this plugin currently owns, with the panel identity it
150
+ * translates as. Empty when nothing is registered.
151
+ */
152
+ menuRowIdentities(): Promise<readonly MenuRowIdentity[]>;
153
+ /**
154
+ * The ordered translation chain, best provider first. An empty array means
155
+ * this deployment translates nothing and every surface renders the upstream
156
+ * text as authored.
157
+ */
158
+ translationProviders?: readonly TranslationProvider[] | undefined;
159
+ /**
160
+ * Whether translation is switched on, read per call.
161
+ *
162
+ * The chain above is built once, while the user's switch can flip at any
163
+ * time, so the switch is a live read rather than a second captured value.
164
+ * Absent means on, so a composition that omits it keeps translating.
165
+ */
166
+ translationEnabled?: (() => boolean) | undefined;
167
+ /**
168
+ * Stable identity of the current chain, folded into every cache key.
169
+ *
170
+ * A deployment that changes engines must miss the entries the previous chain
171
+ * filled rather than serve its output as if the new chain had produced it.
172
+ */
173
+ translationProviderIdentity?: (() => string) | undefined;
174
+ }
175
+ /** The seams a composition root may wire; the rest fall back to the defaults. */
176
+ export type CatalogPortsOverride = Partial<CatalogPorts>;
177
+ /**
178
+ * The seams a catalog runs on when nothing is wired. The MCP backend writer
179
+ * rejects rather than silently accepting a choice nothing can persist.
180
+ */
181
+ export declare const defaultCatalogPorts: CatalogPorts;
182
+ /** Fill in every seam the composition root left unwired. */
183
+ export declare function resolveCatalogPorts(overrides?: CatalogPortsOverride): CatalogPorts;
@@ -1,15 +1,17 @@
1
1
  /** Narrow application interfaces consumed by the HTTP transport adapter. */
2
- import type { McpStatusPayload } from './mcp/mcp-status.js';
2
+ import type { McpStatusPayload } from '../contracts/mcp-status.js';
3
3
  import type { LspLegacySeamMigration, LspStatusPayload } from '../contracts/lsp-status.js';
4
- import type { OverviewPayload, SkillContent, SourceProgress, SuiteDetail } from '../contracts/market.js';
4
+ import type { MenuRowFaceWire, OverviewPayload, SourceProgress, SuiteDetail, SuiteDocumentText, UserPanelKind } from '../contracts/market.js';
5
+ import type { DocumentTranslation } from '../contracts/translation.js';
5
6
  import type { SourceRef, SuiteSurfaceKey } from '../model/types.js';
6
- import type { McpServerOverride, McpSuiteOverrides } from './mcp/mcp-overrides.js';
7
+ import type { McpServerOverride, McpSuiteOverrides } from '../contracts/mcp-overrides.js';
7
8
  import type { McpBackend } from '../contracts/mcp.js';
8
9
  import type { ServerConfigPayload } from '../contracts/market.js';
9
10
  import type { LspServerTable, McpBackendInfo, SourceInput, SourcePatch } from './ports.js';
10
11
  /** Read-only market operations required by HTTP routes. */
11
12
  export interface MarketQueries {
12
- serverConfig(kind: 'mcp' | 'lsp', id: string): Promise<ServerConfigPayload>;
13
+ /** Creation templates carry empty identity fields and the current backend defaults. */
14
+ serverConfig(kind: 'mcp' | 'lsp', id: string, create?: boolean): Promise<ServerConfigPayload>;
13
15
  readonly sources: SourceRef[];
14
16
  overview(): Promise<OverviewPayload>;
15
17
  mcpStatus(): Promise<McpStatusPayload>;
@@ -17,13 +19,30 @@ export interface MarketQueries {
17
19
  lspServers(): Promise<LspServerTable>;
18
20
  sourceProgress(): SourceProgress;
19
21
  suiteDetail(sourceId: string, suiteId: string): Promise<SuiteDetail>;
20
- skillContent(sourceId: string, suiteId: string, skillName: string): Promise<SkillContent>;
22
+ /**
23
+ * One suite document's authored text — a skill, a command, or an agent — for
24
+ * the market detail page's lazy row read. The suite and the document are
25
+ * resolved here: the caller names an identity and never a path or text.
26
+ */
27
+ suiteDocument(sourceId: string, suiteId: string, kind: UserPanelKind, name: string): Promise<SuiteDocumentText>;
28
+ /**
29
+ * One suite document translated for the market detail page's locale, chunk by
30
+ * chunk. The suite and the document are re-read here: the route names an
31
+ * identity and never carries text.
32
+ */
33
+ suiteDocumentTranslation(sourceId: string, suiteId: string, kind: UserPanelKind, name: string, retry?: boolean): Promise<DocumentTranslation>;
21
34
  mcpOverrides(sourceId: string, suiteId: string): Promise<McpSuiteOverrides>;
35
+ /**
36
+ * The localized face of every `/` menu row this plugin owns: the slash
37
+ * commands and skills the menu shows, with the text the panels already
38
+ * translated. Empty while nothing is translated.
39
+ */
40
+ menuRowFaces(): Promise<MenuRowFaceWire[]>;
22
41
  }
23
42
  /** Mutating market operations required by HTTP routes. */
24
43
  export interface MarketMutations {
25
44
  saveServerConfig(kind: 'mcp' | 'lsp', id: string, config: unknown, policy?: unknown): Promise<void>;
26
- addMcpServer(name: string, server: unknown): Promise<void>;
45
+ addMcpServer(name: string, server: unknown, policy?: unknown): Promise<void>;
27
46
  addLspServer(name: string, config: unknown): Promise<void>;
28
47
  addSource(input: SourceInput): Promise<SourceRef>;
29
48
  updateSource(sourceId: string, patch: SourcePatch): Promise<void>;
@@ -58,6 +77,8 @@ export interface MarketMutations {
58
77
  mcpReauthorizeAvailable(): boolean;
59
78
  /** The active MCP backend, host-client probe, and download region. */
60
79
  mcpBackendInfo(): Promise<McpBackendInfo>;
80
+ /** Drop every cached translation; translation is lazy, so the next read refills it. */
81
+ clearTranslations(): Promise<void>;
61
82
  /** Switch the MCP mount backend and remount every suite server through it. */
62
83
  setMcpBackend(backend: McpBackend): Promise<void>;
63
84
  /**
@@ -10,3 +10,5 @@ export declare function redactUrl(raw: string): string;
10
10
  * and endpoints carry credential-bearing queries.
11
11
  */
12
12
  export declare function redactErrorMessage(raw: string): string;
13
+ /** Restore only unchanged redacted leaves, rejecting invented masked values. */
14
+ export declare function restoreRedactedConfig(input: unknown, original: unknown, redacted?: unknown): unknown;
@@ -1,4 +1,4 @@
1
- import type { LspServerSpec } from '../../model/types.js';
1
+ import type { LspServerSpec } from '../../../../market-contracts/src/model/types.js';
2
2
  /** The direct LSP server configuration file path. */
3
3
  export declare function lspServersPath(agentsRoot: string): string;
4
4
  /** Load the user-configured LSP servers; unreadable or invalid files yield an empty table. */
@@ -12,9 +12,10 @@
12
12
  * Direct user-configured rows follow the same model under the sentinel suite
13
13
  * id `direct` (mirroring mcp-status's `plugin`/`direct` split).
14
14
  */
15
- import type { LspStatusPayload } from '../../contracts/lsp-status.js';
16
- import type { LspMountDiagnostic } from '../../contracts/lsp.js';
17
- import type { LspServerSpec, Suite } from '../../model/types.js';
15
+ import type { LspStatusPayload } from '../../../../market-contracts/src/contracts/lsp-status.js';
16
+ import type { LspMountDiagnostic } from '../../../../market-contracts/src/contracts/lsp.js';
17
+ import type { Localization } from '../../../../market-contracts/src/ports/ports.js';
18
+ import type { LspServerSpec, Suite } from '../../../../market-contracts/src/model/types.js';
18
19
  /** Sentinel suite id for user-configured (non-suite) LSP servers. */
19
20
  export declare const DIRECT_LSP_SUITE_ID = "direct";
20
21
  /** The subset of LspMountRegistry the aggregator consumes (structural, for tests). */
@@ -28,5 +29,20 @@ export interface LspDirectServersSource {
28
29
  servers: Record<string, LspServerSpec>;
29
30
  errors: string[];
30
31
  }
31
- /** Build the status payload from declarations, direct configuration, and mount diagnostics. */
32
- export declare function buildLspStatus(suites: readonly Suite[], registry: LspMountStatusSource, direct?: LspDirectServersSource): LspStatusPayload;
32
+ /**
33
+ * Build the status payload from declarations, direct configuration, and mount diagnostics.
34
+ *
35
+ * A row carries only its server key, and a name is never translated: the
36
+ * declaration has no description, so the LSP surface yields no translation unit
37
+ * and the localization read answers with no fields. The parameter is optional,
38
+ * and a caller that omits it renders the same upstream key.
39
+ * @param suites - the discovered suites whose LSP declarations form the inventory.
40
+ * @param registry - the mount registry's diagnostics and live-mount flag.
41
+ * @param direct - the user's own configured servers.
42
+ * @param localization - the locale this whole inventory renders in and the
43
+ * resolver bound to it, when the deployment translates at all. Resolved once by
44
+ * the caller: every declared server is localized from this one value, never from
45
+ * a fresh read of the host preference.
46
+ * @returns the status payload.
47
+ */
48
+ export declare function buildLspStatus(suites: readonly Suite[], registry: LspMountStatusSource, direct?: LspDirectServersSource, localization?: Localization): LspStatusPayload;
@@ -0,0 +1,8 @@
1
+ import type { LspServerSpec, Suite } from '../../../../market-contracts/src/model/types.js';
2
+ /** Validate one language-server declaration before it is stored. */
3
+ export declare function validateServerLsp(key: string, config: unknown): LspServerSpec;
4
+ /** Public configuration excludes the parser's derived identity. */
5
+ export declare function lspConfig(spec: LspServerSpec): Record<string, unknown>;
6
+ export declare function loadLspOverrides(root: string): Promise<Record<string, LspServerSpec>>;
7
+ export declare function saveLspOverride(root: string, id: string, config: LspServerSpec): Promise<void>;
8
+ export declare function applyLspOverrides(root: string, suites: Suite[]): Promise<Suite[]>;
@@ -1,19 +1,22 @@
1
1
  /**
2
- * LSP use cases: the status surface, the user's direct server table, and the
3
- * per-server enable switch.
2
+ * LSP use cases: the status surface, the user's direct server table, the
3
+ * per-server enable switch, and the service-configuration editor for one
4
+ * language-server declaration.
4
5
  *
5
6
  * Direct servers live in the shared Agent layout root (`~/.agents/lsp.json`)
6
7
  * and are merged with the suites' inline declarations at mount time; a
7
8
  * suite's own declaration stays source-owned and is never rewritten. The
8
9
  * per-server enable switch stays plugin state under the data root.
9
10
  */
10
- import type { LspLegacySeamMigration, LspStatusPayload } from '../contracts/lsp-status.js';
11
- import type { CatalogContext } from './catalog-context.js';
12
- import type { CatalogPorts, LspServerTable } from './ports.js';
11
+ import type { LspLegacySeamMigration, LspStatusPayload } from '../../../market-contracts/src/contracts/lsp-status.js';
12
+ import type { ServerConfigPayload } from '../../../market-contracts/src/contracts/market.js';
13
+ import type { CatalogContext } from '../../../market-catalog/src/index.js';
14
+ import type { CatalogPorts, LocalizeFields, LspServerTable } from '../../../market-contracts/src/ports/ports.js';
13
15
  export declare class LspService {
14
16
  private readonly context;
15
17
  private readonly ports;
16
- constructor(context: CatalogContext, ports: CatalogPorts);
18
+ private readonly localizeFields;
19
+ constructor(context: CatalogContext, ports: CatalogPorts, localizeFields: LocalizeFields);
17
20
  /** The LSP status surface: declared servers merged with mount diagnostics. */
18
21
  status(): Promise<LspStatusPayload>;
19
22
  /** The profile layer behind a reported seam conflict, when one can be found. */
@@ -33,4 +36,14 @@ export declare class LspService {
33
36
  setServers(raw: unknown): Promise<LspServerTable>;
34
37
  /** Enable or disable one declared language server by row id. */
35
38
  setEnabled(id: string, enabled: boolean): Promise<void>;
39
+ /** Read one LSP declaration without credential literals, or an unsaved creation template. */
40
+ serverConfig(id: string, create?: boolean): Promise<ServerConfigPayload>;
41
+ /** Validate a complete replacement before writing; plugin checkouts remain untouched. */
42
+ saveServerConfig(id: string, config: unknown): Promise<void>;
43
+ /**
44
+ * Resolve one editable declaration: its key, owning suite, root, and the
45
+ * public document the editor renders. A suite's replacement override is
46
+ * applied first, so an edited declaration renders what will be mounted.
47
+ */
48
+ private resolve;
36
49
  }
@@ -0,0 +1,8 @@
1
+ /** Explicit cross-domain entry surface. Internal modules are not import targets for siblings. */
2
+ export { loadLspOverrides, lspConfig, saveLspOverride, validateServerLsp } from './application/lsp/validation.js';
3
+ export { applyLspOverrides } from './application/lsp/validation.js';
4
+ export { LspService } from './application/lsp-service.js';
5
+ export { DIRECT_LSP_SUITE_ID, buildLspStatus } from './application/lsp/lsp-status.js';
6
+ export { loadLspServers } from './application/lsp/lsp-direct-config.js';
7
+ export { loadDisabledLspServers } from './application/lsp/lsp-server-state.js';
8
+ export { LspMountRegistry } from './runtime/lsp/lsp-mounts.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Runtime LSP mounts: one live `dsh-lsp-stdio` child plugin per enabled
3
- * suite's inline `lspServers` table, mounted through `ctx.plugin`.
3
+ * provider in a suite's inline `lspServers` table, mounted through `ctx.plugin`.
4
4
  *
5
5
  * Mounts reconcile against the enabled-suite set exactly like the MCP mounts:
6
6
  * reconcile() unmounts rows whose suite was disabled or removed and mounts
@@ -28,10 +28,11 @@
28
28
  * user resolves it through per-suite surface toggles.
29
29
  */
30
30
  import type { Context } from '@deepseek-ai/cordis';
31
+ import type { ExtensionLspProvider } from '../../../../market-runtime/src/index.js';
31
32
  import { type LegacyLspSeam } from '../../application/lsp/profile-seam.js';
32
- import { type PluginPathContext } from '../../catalog/plugin-variables.js';
33
- import { type Suite } from '../../model/types.js';
34
- import type { LspMountDiagnostic } from '../../contracts/lsp.js';
33
+ import { type PluginPathContext } from '../../../../market-catalog/src/index.js';
34
+ import type { Suite } from '../../../../market-contracts/src/model/types.js';
35
+ import type { LspMountDiagnostic } from '../../../../market-contracts/src/contracts/lsp.js';
35
36
  export type { LspMountDiagnostic };
36
37
  /** One dsh-lsp-stdio server configuration row (its Config.servers entry). */
37
38
  export interface LspStdioServerConfig {
@@ -90,8 +91,11 @@ export declare class LspMountRegistry {
90
91
  private pluginDataRoot?;
91
92
  /** Direct (user-configured) server provider; defaults to none. */
92
93
  private directProvider;
94
+ /** Per-workspace entry filter; an absent provider mounts everything wanted. */
95
+ private entryFilter;
93
96
  private disabledProvider;
94
97
  private disabledSnapshot;
98
+ private demandedProviderIds;
95
99
  constructor(ctx: Context, loadHost?: () => Promise<HostModule | undefined>, loadService?: () => Promise<HostModule | undefined>, loadTool?: () => Promise<HostModule | undefined>, locateSeams?: () => Promise<LegacyLspSeam[]>);
96
100
  /** Queue one reconciliation behind any in-flight mount/unmount pass. */
97
101
  reconcile(enabledSuites: Suite[]): Promise<LspMountDiagnostic[]>;
@@ -134,14 +138,30 @@ export declare class LspMountRegistry {
134
138
  /** Install the plugin storage root per-suite data directories resolve against. */
135
139
  setPluginDataRoot(root: string): void;
136
140
  /** Install the direct (user-configured) server provider used at reconcile time. */
137
- setDirectProvider(provider: () => Promise<Record<string, import('../../model/types.js').LspServerSpec>>): void;
141
+ setDirectProvider(provider: () => Promise<Record<string, import('../../../../market-contracts/src/model/types.js').LspServerSpec>>): void;
142
+ /**
143
+ * Install the per-workspace entry filter read at wanted-row time. A filtered
144
+ * server is never added to its suite's wanted config, so it unmounts through
145
+ * the ordinary fingerprint pass; the registry itself stays attached.
146
+ */
147
+ setEntryFilter(filter: () => {
148
+ allows(face: 'lsp', entryId: string): boolean;
149
+ }): void;
150
+ /** Session demand overrides ordinary disabled-provider defaults only; validation and entry filters still apply. */
151
+ setDemandedProviderIdsProvider(provider: () => ReadonlySet<string>): void;
138
152
  setDisabledProvider(provider: () => Promise<Set<string>>): void;
153
+ /** Read current global disabled IDs without merging session demand. */
154
+ globalDisabledProviderIds(): Promise<ReadonlySet<string>>;
139
155
  disabledServers(): Set<string>;
140
156
  /** The latest mount diagnostic per suite, for the LSP status surface. */
141
157
  diagnosticsSnapshot(): Map<string, LspMountDiagnostic>;
158
+ /** Whether this registry owns the LSP tool, including its startup publication window. */
159
+ ownsTool(): boolean;
160
+ /** Routes from successfully mounted provider tables; conflicts and failed mounts publish none. */
161
+ providerOwnership(): ExtensionLspProvider[];
142
162
  /** Whether at least one suite mount is live. */
143
163
  hasLiveMounts(): boolean;
144
- /** Mount one suite's full server table as a single `dsh-lsp-stdio` instance. */
164
+ /** Mount one provider as an independently disposable `dsh-lsp-stdio` instance. */
145
165
  private mountWith;
146
166
  private unmount;
147
167
  /** Dispose every live mount after queued reconciliation passes settle. */
@@ -0,0 +1,28 @@
1
+ /**
2
+ * MCP backend selection: whether suite MCP servers mount through the
3
+ * market's self-built bridge (default — stdio, Streamable HTTP with OAuth,
4
+ * and legacy SSE) or through the host's `@deepseek-ai/dsh-mcp-client`
5
+ * (compatibility mode: no OAuth, no SSE, but the host-native implementation).
6
+ *
7
+ * The choice is the `mcpEnhanced` field of the market's host settings
8
+ * namespace (see `contracts/settings.ts`) registered by the plugin's node half:
9
+ * the registration is what makes the host 插件配置 tab serve our card, the
10
+ * client card binds it for state, and the node half watches it to remount
11
+ * servers when the switch flips.
12
+ *
13
+ * @module application/mcp-backend
14
+ */
15
+ import type { McpBackend } from '../../../../market-contracts/src/contracts/mcp.js';
16
+ export type { McpBackend };
17
+ /** What the host client probe reports: resolvability plus its version. */
18
+ export interface HostMcpClientProbe {
19
+ available: boolean;
20
+ version?: string;
21
+ }
22
+ /**
23
+ * Probe whether the host's `dsh-mcp-client` is resolvable from this plugin's
24
+ * module context, and at which version. Best effort: any failure reads as
25
+ * "unavailable", which the mount path surfaces as a per-server diagnostic
26
+ * when the host backend is selected.
27
+ */
28
+ export declare function probeHostMcpClient(): Promise<HostMcpClientProbe>;
@@ -19,7 +19,7 @@ export interface ReconnectConfig {
19
19
  /** Consecutive failed attempts per outage before giving up for good (default 10). */
20
20
  maxAttempts?: number;
21
21
  }
22
- import type { McpServerPolicy } from '../../model/types.js';
22
+ import type { McpServerPolicy } from '../../../../market-contracts/src/model/types.js';
23
23
  /** Default timeout for individual MCP tool calls (ms). */
24
24
  export declare const DEFAULT_TOOL_CALL_TIMEOUT_MS = 60000;
25
25
  /**
@@ -1,7 +1,7 @@
1
1
  import type { Config } from './mcp-bridge-config.js';
2
2
  import { type McpServerOverride, type McpSuiteOverrides } from './mcp-overrides.js';
3
- import type { McpStatusCode } from '../../contracts/mcp-status.js';
4
- import type { HarnessMcpPolicy, McpServer, McpServerPolicy, McpServerSse, McpServerStdio, McpServerStreamableHttp, Suite } from '../../model/types.js';
3
+ import type { McpStatusCode } from '../../../../market-contracts/src/contracts/mcp-status.js';
4
+ import type { HarnessMcpPolicy, McpServer, McpServerPolicy, McpServerSse, McpServerStdio, McpServerStreamableHttp, Suite } from '../../../../market-contracts/src/model/types.js';
5
5
  export interface McpMountRequest {
6
6
  suiteId: string;
7
7
  serverKey: string;
@@ -1,4 +1,4 @@
1
- import { type McpSuiteConfig, type Suite } from '../../model/types.js';
1
+ import { type McpSuiteConfig, type Suite } from '../../../../market-contracts/src/model/types.js';
2
2
  export declare const USER_MCP_SOURCE = "@user-mcp";
3
3
  export declare const USER_MCP_SUITE = "user-mcp";
4
4
  /**
@@ -22,5 +22,10 @@ export declare function loadUserMcpSuite(agentsRoot: string): Promise<Suite & {
22
22
  }>;
23
23
  /** Add one service atomically; reject collisions and malformed config before writing. */
24
24
  export declare function addUserMcpServer(agentsRoot: string, name: string, server: unknown): Promise<void>;
25
+ /**
26
+ * Validate an addition without publishing it. Call the returned atomic write
27
+ * once, within the same serialized mutation, after any policy has been saved.
28
+ */
29
+ export declare function prepareUserMcpServer(agentsRoot: string, name: string, server: unknown): Promise<() => Promise<void>>;
25
30
  /** The user's hand-written MCP declaration file: `<agentsRoot>/mcp.json`. */
26
31
  export declare function userMcpPath(agentsRoot: string): string;
@@ -1,41 +1,8 @@
1
- import type { McpServerSse, McpServerStreamableHttp, McpServerStdio } from '../../model/types.js';
2
- /** HTTP-shaped server sources (url + headers carriers) overrides can edit. */
1
+ import type { McpServerSse, McpServerStreamableHttp, McpServerStdio } from '../../../../market-contracts/src/model/types.js';
3
2
  type McpServerHttp = McpServerStreamableHttp | McpServerSse;
4
- /** The largest timeout a bridge config and the host timer can hold. */
5
- export declare const MAX_TIMEOUT_MS = 2147483647;
6
- /** Per-server override record; absent fields pass through from the source. */
7
- export type McpServerOverride = {
8
- /** Validated complete user configuration, retaining source-owned identity. */
9
- config?: McpServerStdio | McpServerHttp;
10
- /** Disabled servers are not mounted at all (default enabled). */
11
- enabled?: boolean;
12
- /** Replaces the source URL (streamable-http only). */
13
- url?: string;
14
- /** Replaces the whole header map (streamable-http only). */
15
- headers?: Record<string, string>;
16
- /** Replaces the whole env map (stdio). */
17
- env?: Record<string, string>;
18
- /** Replaces the whole args list (stdio). */
19
- args?: string[];
20
- /** Replaces the OAuth block (streamable-http only); `enabled: false` disables a source-declared flow. */
21
- auth?: {
22
- enabled: boolean;
23
- scope?: string;
24
- };
25
- /** Per-tool-call timeout in milliseconds; absent inherits the suite's value or the bridge default. */
26
- toolCallTimeoutMs?: number;
27
- /** Startup timeout in milliseconds; absent inherits the suite's value or the bridge default. */
28
- startupTimeoutMs?: number;
29
- /** Tool names the user turned off; the suite's own deny list stays in force beside them. */
30
- disabledTools?: string[];
31
- };
32
- /** Timeout fields a policy save can set (`number`) or clear back to inheritance (`null`). */
33
- export interface McpTimeoutPatch {
34
- toolCallTimeoutMs?: number | null;
35
- startupTimeoutMs?: number | null;
36
- }
37
- /** Overrides for one suite, keyed by mcp.json server key. */
38
- export type McpSuiteOverrides = Record<string, McpServerOverride>;
3
+ export { MAX_TIMEOUT_MS } from '../../../../market-contracts/src/contracts/mcp-overrides.js';
4
+ export type { McpServerOverride, McpSuiteOverrides, McpTimeoutPatch } from '../../../../market-contracts/src/contracts/mcp-overrides.js';
5
+ import { type McpServerOverride, type McpSuiteOverrides, type McpTimeoutPatch } from '../../../../market-contracts/src/contracts/mcp-overrides.js';
39
6
  /** The overrides directory under the plugin data root. */
40
7
  export declare function overridesDir(dataRoot: string): string;
41
8
  /** One suite's override file path. */
@@ -99,4 +66,3 @@ export declare function applyOverride(server: McpServerStdio | McpServerHttp, ov
99
66
  * so a timeout never reaches a document that has no seat for it.
100
67
  */
101
68
  export declare function withoutPolicyFields<T extends McpServerStdio | McpServerHttp>(server: T): T;
102
- export {};
@@ -0,0 +1,40 @@
1
+ import type { McpSuiteOverrides } from './mcp-overrides.js';
2
+ import type { McpStatusCode, McpStatusPayload } from '../../../../market-contracts/src/contracts/mcp-status.js';
3
+ import type { Localization, McpToolSnapshot } from '../../../../market-contracts/src/ports/ports.js';
4
+ import type { Suite } from '../../../../market-contracts/src/model/types.js';
5
+ export type { McpStatusEntry, McpStatusPayload, McpStatusKind, McpStatusState } from '../../../../market-contracts/src/contracts/mcp-status.js';
6
+ export type { McpToolSnapshot };
7
+ export interface McpDiagnostic {
8
+ suiteId: string;
9
+ serverKey: string;
10
+ reason: string;
11
+ code?: McpStatusCode;
12
+ causes?: string[];
13
+ credentialRefs?: string[];
14
+ }
15
+ /**
16
+ * Whether one effective configuration supplies its own Authorization header.
17
+ *
18
+ * Such a server authenticates with that header: the browser authorization a
19
+ * re-authorize would restart is not the path it uses, so the action is not
20
+ * offered for it.
21
+ */
22
+ export declare function declaresAuthHeader(config: Record<string, unknown> | undefined): boolean;
23
+ /**
24
+ * Build status rows from discovered plugin MCP definitions and observed tool names.
25
+ *
26
+ * Each tool's description is translated on the way out; a service name and a
27
+ * tool's own `name` are call identifiers and are never translated. The
28
+ * callback is optional: a caller that omits it gets the upstream text, which is
29
+ * what the contract's absent translated field means.
30
+ * @param suites - the discovered suites whose MCP declarations form the inventory.
31
+ * @param diagnostics - the latest mount diagnostics, keyed by suite and server.
32
+ * @param observed - the live host tool registry snapshot.
33
+ * @param overrides - persisted per-server overrides, keyed by qualified suite id.
34
+ * @param localization - the locale this whole inventory renders in and the
35
+ * resolver bound to it, when the deployment translates at all. Resolved once by
36
+ * the caller: a server and each of its tools is localized from this one value,
37
+ * never from a fresh read of the host preference.
38
+ * @returns the status payload with every translatable field carrying its translation.
39
+ */
40
+ export declare function buildMcpStatus(suites: Suite[], diagnostics: McpDiagnostic[], observed: readonly McpToolSnapshot[], overrides?: Map<string, McpSuiteOverrides>, localization?: Localization): McpStatusPayload;
@@ -1,4 +1,3 @@
1
- import type { LspServerSpec, Suite } from '../model/types.js';
2
1
  /** One rejected value, with the field it belongs to when the schema knows it. */
3
2
  export interface McpFieldError {
4
3
  /** Dotted path inside the server object; empty for a problem with the document itself. */
@@ -14,8 +13,7 @@ export declare class McpConfigError extends Error {
14
13
  readonly fields: McpFieldError[];
15
14
  constructor(fields: McpFieldError[]);
16
15
  }
17
- /** Restore only unchanged redacted leaves, rejecting invented masked values. */
18
- export declare function restoreRedactedConfig(input: unknown, original: unknown, redacted?: unknown): unknown;
16
+ export { restoreRedactedConfig } from '../../../../market-contracts/src/redaction.js';
19
17
  /**
20
18
  * Validate one service definition before it is stored.
21
19
  *
@@ -26,10 +24,4 @@ export declare function restoreRedactedConfig(input: unknown, original: unknown,
26
24
  */
27
25
  export declare function validateServerMcp(root: string, key: string, config: unknown, options?: {
28
26
  userOwned?: boolean;
29
- }): Promise<import("../model/types.js").McpServer>;
30
- export declare function validateServerLsp(key: string, config: unknown): LspServerSpec;
31
- /** Public configuration excludes the parser's derived identity. */
32
- export declare function lspConfig(spec: LspServerSpec): Record<string, unknown>;
33
- export declare function loadLspOverrides(root: string): Promise<Record<string, LspServerSpec>>;
34
- export declare function saveLspOverride(root: string, id: string, config: LspServerSpec): Promise<void>;
35
- export declare function applyLspOverrides(root: string, suites: Suite[]): Promise<Suite[]>;
27
+ }): Promise<import("@dsh-market/contracts").McpServer>;