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,132 @@
1
+ /**
2
+ * Unique call names for the commands this plugin registers.
3
+ *
4
+ * The host's command registry keys one name to one definition per layer:
5
+ * `NamedEntries.insert` throws `command "x" is already registered` when the
6
+ * name is taken, and the layer a registration lands in is chosen by the
7
+ * registry service's own context, never by the caller's. Two suites flattening
8
+ * to one call name, a host built-in such as `compact`, or a second mount
9
+ * registry feeding the same layer therefore collide — and a colliding
10
+ * definition is the one thing the slash menu drops, so the name has to be
11
+ * chosen before `register` is called. The layer's existing names cannot be
12
+ * enumerated from here, which leaves the refused registration as the only
13
+ * observable of a foreign occupant; {@link registerWithAllocatedName} retries
14
+ * with the next suffix.
15
+ *
16
+ * Allocation answers the preferred name while it is free and appends an
17
+ * increasing numeric suffix afterwards: the first conflict is `compact-1`,
18
+ * then `compact-2`. A name the host refused stays held as occupied, so the
19
+ * retry asks for the following suffix instead of repeating the name that just
20
+ * failed.
21
+ *
22
+ * @module runtime/command-name-allocator
23
+ */
24
+ /** Suffixes one preferred name may spend before allocation gives up on it. */
25
+ export declare const MAX_COMMAND_NAME_ATTEMPTS = 50;
26
+ /**
27
+ * Whether the host refused a registration because that exact name is taken.
28
+ *
29
+ * `CommandRuntime.register` renders one sentence for the global layer
30
+ * (`command "x" is already registered (for a per-agent variant, ...)`) and a
31
+ * shorter one for a scoped layer (`... in this scope`); both open with the
32
+ * same clause, and an error carrying any other text is a real failure rather
33
+ * than a name collision.
34
+ * @param error - the value thrown by `register`.
35
+ * @returns whether re-claiming under another name can succeed.
36
+ */
37
+ export declare function isDuplicateCommandName(error: unknown): boolean;
38
+ /** Naming policy over one layer's occupancy. */
39
+ export interface CommandNameAllocator {
40
+ /**
41
+ * Claim a unique call name: `preferred` when free, otherwise the first free
42
+ * `preferred-1`, `preferred-2`, ... suffix.
43
+ * @param preferred - the name the command uses undisturbed.
44
+ * @returns the name to register under.
45
+ * @throws when every suffix within {@link MAX_COMMAND_NAME_ATTEMPTS} is taken.
46
+ */
47
+ claim(preferred: string): string;
48
+ /**
49
+ * Release a previously claimed name so it can be reused. Releasing a name
50
+ * that was never claimed, or already released, is a no-op.
51
+ * @param name - the name returned by an earlier {@link CommandNameAllocator.claim}.
52
+ */
53
+ release(name: string): void;
54
+ }
55
+ /**
56
+ * Build a naming policy over `taken`.
57
+ *
58
+ * The allocator owns the names it hands out, which is what makes
59
+ * {@link CommandNameAllocator.release} meaningful; `taken` adds the names
60
+ * occupied outside it (another surface's registrations in the same layer, and
61
+ * the names the host has already refused).
62
+ * @param taken - every name currently unavailable to this allocator.
63
+ * @returns the allocator.
64
+ */
65
+ export declare function createCommandNameAllocator(taken: () => ReadonlySet<string>): CommandNameAllocator;
66
+ /**
67
+ * The names one command layer holds for this plugin.
68
+ *
69
+ * A mount registry keeps one of these for the lifetime of its layer seat: it
70
+ * spans every reconcile pass, so a name stays reserved exactly as long as the
71
+ * registration carrying it is live, and it dies with the seat — a recomposed
72
+ * layer starts from the host's own occupancy alone. Names the host refused are
73
+ * held too, so a rename never retries a name this layer just rejected.
74
+ *
75
+ * Occupancy is per layer, not per process, because that is the unit the host
76
+ * checks: two agents' scoped layers each hold their own `review`, and neither
77
+ * registration sees the other. A process-wide ledger would rename the second
78
+ * one for a collision the host never reports.
79
+ */
80
+ export declare class CommandNameRegistry {
81
+ /** Names held by this plugin in the layer, whether registered or refused. */
82
+ private readonly held;
83
+ private readonly allocator;
84
+ /**
85
+ * Reserve the next free name for `preferred`.
86
+ * @param preferred - the name the command uses undisturbed.
87
+ * @returns the name to register under.
88
+ * @throws when every suffix within {@link MAX_COMMAND_NAME_ATTEMPTS} is taken.
89
+ */
90
+ claim(preferred: string): string;
91
+ /**
92
+ * Drop a name this plugin no longer registers, freeing it for a later claim.
93
+ * @param name - the name whose registration ended.
94
+ */
95
+ forget(name: string): void;
96
+ /**
97
+ * Hold a name the host refused, so it stays occupied without a registration.
98
+ * @param name - the refused call name.
99
+ */
100
+ refuse(name: string): void;
101
+ /**
102
+ * Every name this layer holds for the plugin.
103
+ * @returns the allocated and refused names, as one read-only view.
104
+ */
105
+ taken(): ReadonlySet<string>;
106
+ }
107
+ /** What one registration attempt settled as. */
108
+ export type CommandNameRegistration<T> = {
109
+ kind: 'registered';
110
+ name: string;
111
+ disposer: T;
112
+ } | {
113
+ kind: 'failed';
114
+ error: unknown;
115
+ };
116
+ /**
117
+ * Register under the first call name the layer accepts.
118
+ *
119
+ * The attempt loop is the only way past a foreign occupant: the layer's names
120
+ * are not enumerable, so a refusal is what moves allocation to the next
121
+ * suffix. A refusal is held on `names` before the retry, which is what makes
122
+ * the loop terminate — every iteration either registers or retires one
123
+ * candidate, and allocation itself fails once the suffix ceiling is reached.
124
+ * Any other failure ends the attempt immediately, because renaming around a
125
+ * malformed definition or an unavailable registry would report a rename
126
+ * instead of the bug that caused it.
127
+ * @param names - the layer's occupancy ledger.
128
+ * @param preferred - the name the command uses when nothing holds it.
129
+ * @param register - the host registration, called once per candidate name.
130
+ * @returns the accepted name and its registration, or the failure to diagnose.
131
+ */
132
+ export declare function registerWithAllocatedName<T>(names: CommandNameRegistry, preferred: string, register: (name: string) => T): CommandNameRegistration<T>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Session progress for the extension window: whether a session carries work the
3
+ * user authored.
4
+ *
5
+ * The host folds this answer once per session through its projection registry and
6
+ * then advances it per committed event, so a window read no longer scans the whole
7
+ * event log. The wire meaning is unchanged: a started turn, or a user/inbox
8
+ * message this plugin did not author. A host that publishes no projection registry
9
+ * falls back to the historical log scan instead of answering a constant.
10
+ *
11
+ * @module runtime/host/extension-progress
12
+ */
13
+ import { z } from 'zod';
14
+ import type { Context } from '@deepseek-ai/cordis';
15
+ import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
16
+ /** The projection key this plugin owns; host-only, so it never reaches a client view. */
17
+ export declare const EXTENSION_PROGRESS_KEY = "marketExtensionProgress";
18
+ /** Folded progress state for one session. */
19
+ export interface ExtensionProgressState {
20
+ readonly started: boolean;
21
+ }
22
+ declare module '@deepseek-ai/dsh-session-projection/types' {
23
+ interface SessionProjectionStateMap {
24
+ marketExtensionProgress: ExtensionProgressState;
25
+ }
26
+ }
27
+ /**
28
+ * Whether one committed event is authored progress.
29
+ *
30
+ * This is the definition the wire field has always carried: a started turn, or a
31
+ * user/inbox message whose source is not this plugin's own and carries no form.
32
+ * @param event - one committed session event.
33
+ * @returns true when the event proves the user started work.
34
+ */
35
+ export declare function eventCarriesProgress(event: SessionEvent): boolean;
36
+ /** The host fold this plugin registers: monotonic, because progress never un-happens. */
37
+ export declare const extensionProgressProjection: {
38
+ key: "marketExtensionProgress";
39
+ stateVersion: number;
40
+ stateSchema: z.ZodObject<{
41
+ started: z.ZodBoolean;
42
+ }, z.core.$strip>;
43
+ init: () => ExtensionProgressState;
44
+ apply: (state: NoInfer<ExtensionProgressState>, event: SessionEvent) => ExtensionProgressState;
45
+ };
46
+ /**
47
+ * Read progress from the log itself.
48
+ *
49
+ * The compatibility fallback for a host without the projection registry. The
50
+ * synchronous full-log reader is deprecated host-side; this call carries the
51
+ * deferred-migration waiver the deprecation decision allows, and disappears when
52
+ * every supported host publishes the registry.
53
+ * @param session - session whose log is scanned.
54
+ * @returns true when the log carries authored progress.
55
+ */
56
+ export declare function scanExtensionProgress(session: Session): boolean;
57
+ /**
58
+ * Owns this plugin's projection registration and answers one session's progress.
59
+ *
60
+ * The injected callback re-runs whenever a required service changes, so the
61
+ * reader guards it with its own disposal flag and owns the injected fiber: a
62
+ * disposed reader never registers again, and an older effect cleanup never
63
+ * clears a newer registration pointer.
64
+ */
65
+ export declare class ExtensionProgressReader {
66
+ private readonly ctx;
67
+ private unregister;
68
+ private injection;
69
+ private disposed;
70
+ /** Settles once the current registration attempt has run; production reads do not await it. */
71
+ readonly ready: PromiseLike<unknown>;
72
+ /**
73
+ * Register the projection for the lifetime of the calling context.
74
+ * @param ctx - context whose fiber owns the registration.
75
+ */
76
+ constructor(ctx: Context);
77
+ /** True while this plugin's projection is registered in the live registry. */
78
+ get registered(): boolean;
79
+ /**
80
+ * Whether one session carries authored progress.
81
+ * @param session - session to answer for.
82
+ * @returns the folded answer, or the log scan when no registry is published.
83
+ */
84
+ read(session: Session): boolean;
85
+ /**
86
+ * Unregister the projection and release the injected fiber, so a registry that
87
+ * arrives or cycles later cannot register this reader again.
88
+ * @returns after the injected fiber has unloaded.
89
+ */
90
+ dispose(): Promise<void>;
91
+ }
@@ -0,0 +1,77 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { Agent } from '@deepseek-ai/dsh-agent';
3
+ import { type ExtensionResource, type ExtensionSelection, type ExtensionPresetInput, type ExtensionWindowPayload, type ExtensionHooksOverview, type ExtensionHookRunInput, type ExtensionHookRunResult } from '../../../../market-contracts/src/contracts/extension-presets.js';
4
+ import type { ExtensionRouteService } from '../../extension-service.js';
5
+ import { ExtensionSessionState, type ExtensionApplyReceipt } from './extension-session-state.js';
6
+ export interface ExtensionRuntimePorts {
7
+ dataRoot: string;
8
+ inventory(agent: Agent): Promise<ExtensionResource[]>;
9
+ applySelection(agent: Agent, selection: ExtensionSelection): Promise<void | ExtensionApplyReceipt>;
10
+ /** Whether this service governs one agent at all; absent governs every agent. */
11
+ eligible?(agent: Agent): boolean;
12
+ ready?(agent: Agent, source?: string): Promise<void>;
13
+ committed?(agent: Agent): void;
14
+ /** The sessionless Hooks overview the settings workspace renders; hook declarations belong to the user, not to a session. */
15
+ hooksOverview?(): Promise<ExtensionHooksOverview>;
16
+ /** Run one declared command hook as a dry run; the composition resolves the declaration and owns the shell. */
17
+ hookRun?(input: ExtensionHookRunInput): Promise<ExtensionHookRunResult>;
18
+ }
19
+ export declare function extensionWorkspace(agent: Agent): string;
20
+ export declare class ExtensionRuntime implements ExtensionRouteService {
21
+ private readonly ctx;
22
+ private readonly ports;
23
+ readonly state: ExtensionSessionState;
24
+ private readonly store;
25
+ /** Folded session progress; the log scan is only the no-registry fallback. */
26
+ private readonly progress;
27
+ private readonly resources;
28
+ /** Agents whose cached inventory predates the current catalog; authorization fails closed until re-read. */
29
+ private readonly stale;
30
+ /** Bumped on every catalog change: a read that began earlier may not publish its answer. */
31
+ private epoch;
32
+ private readonly dirty;
33
+ /** Eligible inventory at the last successful rebuild; selection and current availability still gate every call. */
34
+ private readonly registeredIds;
35
+ private readonly appliedEpochs;
36
+ private readonly refreshing;
37
+ private readonly lifetime;
38
+ private disposed;
39
+ /** Per-agent read sequence: a slow earlier response must not overwrite a newer inventory. */
40
+ private readonly reads;
41
+ private readonly targets;
42
+ private readonly off;
43
+ constructor(ctx: Context, ports: ExtensionRuntimePorts);
44
+ start(): Promise<void>;
45
+ ready(agent: Agent): boolean;
46
+ allows(agent: Agent, resourceId: string, suiteId?: string): boolean;
47
+ private availableIds;
48
+ /** Registration alone may inspect a pending target; execution must call allows. */
49
+ registrationAllows(agent: Agent, resourceId: string, suiteId?: string): boolean;
50
+ private selected;
51
+ /**
52
+ * A catalog change can revoke a global resource at any moment, so every live
53
+ * agent's cached inventory is dropped and authorization denies until the
54
+ * inventory has been re-read from the new catalog. Callers never wait for a
55
+ * panel poll to observe a disable or uninstall.
56
+ */
57
+ invalidate(): void;
58
+ /** Re-read every live agent's inventory; an agent whose read fails stays denied. */
59
+ refreshAll(): Promise<void>;
60
+ private refreshAgent;
61
+ refreshInventory(agent: Agent): Promise<ExtensionResource[]>;
62
+ /** The settings Hooks tab: sessionless by design, so no agent is resolved and no session state is consulted. */
63
+ hooksOverview(): Promise<ExtensionHooksOverview>;
64
+ /** One declared hook's dry run: the composition resolves the command, this service only gates availability and forwards. */
65
+ hookRun(input: ExtensionHookRunInput): Promise<ExtensionHookRunResult>;
66
+ private agent;
67
+ private initialSelection;
68
+ window(sessionId: string): Promise<ExtensionWindowPayload>;
69
+ /** Recovery is an explicit, revision-checked act; it never invents a selection. */
70
+ recover(sessionId: string, revision: number): Promise<void>;
71
+ create(sessionId: string, revision: number, input: ExtensionPresetInput): Promise<void>;
72
+ update(sessionId: string, revision: number, id: string, input: ExtensionPresetInput): Promise<void>;
73
+ delete(sessionId: string, revision: number, id: string): Promise<void>;
74
+ setDefault(sessionId: string, revision: number, id: string | null): Promise<void>;
75
+ select(sessionId: string, revision: number, id: string | null): Promise<void>;
76
+ dispose(): Promise<void>;
77
+ }
@@ -0,0 +1,242 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { Agent } from '@deepseek-ai/dsh-agent';
3
+ import '@deepseek-ai/dsh-session-query';
4
+ import { z } from 'zod';
5
+ import { type ExtensionSelection } from '../../../../market-contracts/src/contracts/extension-presets.js';
6
+ export declare const EXTENSION_SESSION_SOURCE = "market-extension-selection";
7
+ declare const bindingSchema: z.ZodObject<{
8
+ version: z.ZodLiteral<1>;
9
+ ownerId: z.ZodString;
10
+ revision: z.ZodNumber;
11
+ phase: z.ZodEnum<{
12
+ pending: "pending";
13
+ committed: "committed";
14
+ }>;
15
+ requestRevision: z.ZodOptional<z.ZodNumber>;
16
+ selection: z.ZodObject<{
17
+ presetId: z.ZodNullable<z.ZodString>;
18
+ presetName: z.ZodNullable<z.ZodString>;
19
+ presetRevision: z.ZodNullable<z.ZodNumber>;
20
+ modified: z.ZodBoolean;
21
+ enabledIds: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
22
+ }, z.core.$strict>;
23
+ recoveryOf: z.ZodOptional<z.ZodObject<{
24
+ ownerId: z.ZodString;
25
+ revision: z.ZodNumber;
26
+ }, z.core.$strict>>;
27
+ }, z.core.$strict>;
28
+ type Binding = z.infer<typeof bindingSchema>;
29
+ /** The metadata marker that wakes a driver after a recovery; it never enters a request. */
30
+ export declare const EXTENSION_SESSION_WAKE_SOURCE = "market-extension-wake";
31
+ /** One durable request that becomes effective only at a safe boundary. */
32
+ declare const intentSchema: z.ZodObject<{
33
+ ownerId: z.ZodString;
34
+ revision: z.ZodNumber;
35
+ selection: z.ZodObject<{
36
+ presetId: z.ZodNullable<z.ZodString>;
37
+ presetName: z.ZodNullable<z.ZodString>;
38
+ presetRevision: z.ZodNullable<z.ZodNumber>;
39
+ modified: z.ZodBoolean;
40
+ enabledIds: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
41
+ }, z.core.$strict>;
42
+ }, z.core.$strict>;
43
+ type Intent = z.infer<typeof intentSchema>;
44
+ export declare const EXTENSION_INTENT_SOURCE = "market-extension-intent";
45
+ declare module '@deepseek-ai/dsh-llm' {
46
+ interface MessageSourceMap {
47
+ 'market-extension-selection': {
48
+ kind: 'market-extension-selection';
49
+ form: 'context';
50
+ binding: Binding;
51
+ };
52
+ 'market-extension-wake': {
53
+ kind: 'market-extension-wake';
54
+ form: 'context';
55
+ };
56
+ 'market-extension-intent': {
57
+ kind: 'market-extension-intent';
58
+ form: 'context';
59
+ intent: Intent;
60
+ };
61
+ }
62
+ }
63
+ export interface ExtensionSessionSnapshot {
64
+ revision: number;
65
+ selection: ExtensionSelection;
66
+ }
67
+ export interface ExtensionSessionStatus {
68
+ ready: boolean;
69
+ /** Latest attempted transaction, used as the recovery compare-and-swap revision. */
70
+ revision: number;
71
+ recoverable: boolean;
72
+ error?: string;
73
+ /** Recovery target when not ready; never an effective selection in that state. */
74
+ selection?: ExtensionSelection;
75
+ }
76
+ /**
77
+ * Optional lease on one applied selection.
78
+ *
79
+ * An adapter returns one when it applied an effect it can still undo: the state
80
+ * machine holds it until the committed binding is durable, then calls
81
+ * {@link ExtensionApplyReceipt.commit}. Every pre-durable failure calls
82
+ * {@link ExtensionApplyReceipt.rollback} instead, so an uncertain write never
83
+ * leaves a half-applied selection behind. Returning nothing keeps an adapter that
84
+ * owns its own rollback working unchanged.
85
+ */
86
+ export interface ExtensionApplyReceipt {
87
+ /**
88
+ * Publish the applied effect. Synchronous by contract and must not throw: it runs
89
+ * inside the commit sequence after durability, where awaiting would reopen the
90
+ * window this transaction closes.
91
+ */
92
+ commit(): void;
93
+ /** Undo the applied effect. A rejection is a diagnostic, never a replacement for the original failure. */
94
+ rollback(): Promise<void>;
95
+ }
96
+ export interface ExtensionSessionStatePorts {
97
+ /** Use agent.session.header.cwd, never a client path. Legacy captures global choices, not a workspace default. */
98
+ initialSelection(agent: Agent, source?: string): Promise<ExtensionSelection>;
99
+ /**
100
+ * Replace the complete agent-local selection; resource gates must reject unavailable service state.
101
+ * Returns a receipt when the effect is still reversible, else nothing.
102
+ */
103
+ applySelection(agent: Agent, selection: ExtensionSelection): Promise<void | ExtensionApplyReceipt>;
104
+ /** Publish synchronous cache/schema invalidations after commit, before maintenance releases queued input. */
105
+ committed?(agent: Agent): void;
106
+ /**
107
+ * Whether this service governs one agent at all. Absent governs every agent,
108
+ * which is what a workspace-agnostic host and the service's own tests rely on.
109
+ * An agent the port rejects keeps its original host lifecycle: it is never
110
+ * tracked, never granted a selection, never cancelled, and its steps pass
111
+ * through untouched. An undecidable answer — the port throws — stays on the
112
+ * governed path, so an unknown agent is denied instead of silently allowed.
113
+ */
114
+ eligible?(agent: Agent): boolean;
115
+ }
116
+ /** Durable selections use known message envelopes; pending transactions reject replay after an uncertain failure. */
117
+ export declare class ExtensionSessionState {
118
+ private readonly ctx;
119
+ private readonly ports;
120
+ private readonly states;
121
+ private readonly initializing;
122
+ private readonly checkpoints;
123
+ private readonly errors;
124
+ private readonly lifetime;
125
+ private readonly unavailable;
126
+ /** The capture classification each attempt used, so an explicit recovery replays it exactly. */
127
+ private readonly captureSources;
128
+ /** Durable requests waiting for a safe boundary; the last one received wins. */
129
+ private readonly intents;
130
+ /** The turn each pending request was made in: a boundary only exists in a later turn. */
131
+ private readonly intentTurns;
132
+ /** Per-agent order for requests and promotions, so no two of them interleave. */
133
+ private readonly requests;
134
+ /** The turn each agent last entered, so a request can record the turn it came from. */
135
+ private readonly currentTurns;
136
+ /** Single-flight promotion per agent: one turn boundary promotes once. */
137
+ private readonly promoting;
138
+ private readonly operations;
139
+ private readonly off;
140
+ private disposed;
141
+ private disposal?;
142
+ constructor(ctx: Context, ports: ExtensionSessionStatePorts);
143
+ /** Whether this service governs one agent; an undecidable answer stays governed. */
144
+ private governs;
145
+ /** Attach idle agents independently; busy agents remain denied until their current activity ends. */
146
+ start(): Promise<void>;
147
+ private attach;
148
+ /** Return diagnostics without exposing an unavailable snapshot as effective state. */
149
+ status(agent: Agent): ExtensionSessionStatus;
150
+ read(agent: Agent): ExtensionSessionSnapshot | undefined;
151
+ initialize(agent: Agent, source?: string, signal?: AbortSignal): Promise<void>;
152
+ private replay;
153
+ /** Run one capture through the adapter and commit it as revision 1. */
154
+ private capture;
155
+ private initializeOnce;
156
+ /**
157
+ * Recover only the validated last committed choice, or the original initial attempt.
158
+ *
159
+ * Never recapture defaults, with one exception: a capture that failed before it
160
+ * recorded anything has no record to protect, so an explicit recovery re-runs that
161
+ * capture with the classification the original attempt used.
162
+ */
163
+ recover(agent: Agent, expectedRevision: number): Promise<ExtensionSessionSnapshot>;
164
+ change(agent: Agent, expectedRevision: number, selection: ExtensionSelection, requestRevision?: number): Promise<ExtensionSessionSnapshot>;
165
+ /**
166
+ * Accept one selection request.
167
+ *
168
+ * An idle agent commits immediately through the ordinary transaction. While a
169
+ * turn owns the agent the request is only written durably: the effective
170
+ * selection, every gate and every mount keep reading the committed snapshot
171
+ * until a safe boundary promotes it, so nothing is staged or swapped while the
172
+ * current turn's tools are live.
173
+ * @param agent - the agent the selection belongs to.
174
+ * @param expectedRevision - the revision the caller believes is current: the committed revision or the pending request's revision.
175
+ * @param selection - the requested selection.
176
+ * @returns whether it applied now, and the revision a caller compares against next.
177
+ */
178
+ requestSelection(agent: Agent, expectedRevision: number, selection: ExtensionSelection): Promise<{
179
+ applied: boolean;
180
+ revision: number;
181
+ }>;
182
+ /** Join the current selection writer, not the active user turn; failures remain visible through status. */
183
+ whenSelectionSettled(agent: Agent): Promise<void>;
184
+ /** Public compare-and-swap token, independent of the sequential binding journal. */
185
+ selectionRevision(agent: Agent): number;
186
+ /** The pending request, for a caller that shows the intended selection. */
187
+ intended(agent: Agent): {
188
+ selection: ExtensionSelection;
189
+ revision: number;
190
+ } | undefined;
191
+ /**
192
+ * Make the pending request effective: durable request first, then the effect,
193
+ * then the committed twin and the published snapshot, exactly like a change.
194
+ * Single-flight per agent, so one boundary promotes once.
195
+ * @param agent - the agent whose pending request becomes effective.
196
+ */
197
+ promote(agent: Agent): Promise<void>;
198
+ private promoteNow;
199
+ /**
200
+ * Promote from the idle phase, for a turn that never reached a clean stop and a
201
+ * request that raced the boundary. Re-wakes parked input so the same request
202
+ * re-runs under the promoted selection.
203
+ */
204
+ private promoteAfterIdle;
205
+ /**
206
+ * Whether the host reports this agent idle. The call keeps the answer opaque to
207
+ * control-flow narrowing, which a direct property comparison cannot.
208
+ */
209
+ private isIdle;
210
+ /**
211
+ * Run one task at a time per agent. Each task starts after the previous settled,
212
+ * whether it succeeded or failed, so a rejected write never blocks the next one.
213
+ */
214
+ private serialize;
215
+ private persistIntent;
216
+ private maintenance;
217
+ private track;
218
+ /**
219
+ * Start the driver for input stranded while this service denied the session.
220
+ *
221
+ * The stranded messages are already queued, so the wake carries no payload: the
222
+ * marker is plugin metadata the same pre-step guard filters, and `steer` is the
223
+ * published way to start a driver without cancelling live work (published
224
+ * semantics: a wake during maintenance latches and replays at convergence).
225
+ * Callers run it only after a committed recovery or a successful busy retry, and
226
+ * this guard makes that common: an unavailable or disposed session must never
227
+ * open a turn, so the check here is the single place that decides.
228
+ */
229
+ private wake;
230
+ private fail;
231
+ private persist;
232
+ private commit;
233
+ /**
234
+ * Undo an applied-but-not-durable effect. A cleanup failure is reported as a
235
+ * diagnostic: the original error is what the caller acts on, so it is never
236
+ * replaced by whatever went wrong while unwinding.
237
+ */
238
+ private rollbackApplied;
239
+ dispose(): Promise<void>;
240
+ private finishDisposal;
241
+ }
242
+ export {};
@@ -0,0 +1,38 @@
1
+ import type { Agent } from '@deepseek-ai/dsh-agent';
2
+ export interface ExtensionToolResource {
3
+ resourceId: string;
4
+ suiteId?: string;
5
+ }
6
+ export interface ExtensionMcpTool extends ExtensionToolResource {
7
+ name: string;
8
+ /** Exact object supplied to ToolRuntime.register, not an inferred public-name prefix. */
9
+ definition: {
10
+ readonly name: string;
11
+ };
12
+ /** Registration scope; undefined is global. Own-scope visibility is controlled by the mount owner. */
13
+ scope: object | undefined;
14
+ }
15
+ export interface ExtensionLspProvider extends ExtensionToolResource {
16
+ extensions: readonly string[];
17
+ }
18
+ export interface ExtensionToolOwnership {
19
+ mcpTools(): readonly ExtensionMcpTool[];
20
+ lspProviders(): readonly ExtensionLspProvider[];
21
+ ownsLspTool(): boolean;
22
+ }
23
+ export interface ExtensionToolPolicy {
24
+ ready(agent: Agent): boolean;
25
+ allows(agent: Agent, resourceId: string, suiteId?: string): boolean;
26
+ }
27
+ export interface ExtensionToolGates {
28
+ /** Refresh presentation after acknowledged selection changes or provider reconciliation. */
29
+ refresh(): void;
30
+ /** Release only this agent's restrictions, guards and listener; shared servers remain untouched. */
31
+ dispose(): void;
32
+ }
33
+ /**
34
+ * Filter inherited extension tools and guard Native/PTC execution using the public rc.2 runtime.
35
+ * Policy errors and unready sessions deny owned capabilities. Project MCP mounts in the agent's
36
+ * own scope must also filter their wanted rows: host restrictions do not hide own-scope tools.
37
+ */
38
+ export declare function attachExtensionToolGates(agent: Agent, ownership: ExtensionToolOwnership, policy: ExtensionToolPolicy): ExtensionToolGates;
@@ -13,7 +13,7 @@
13
13
  * active, no preference written, a value that is not a string — means zh.
14
14
  */
15
15
  /** Host runtime dictionary keys (mirrored for zh and en). */
16
- export type HostLocaleKey = 'commandAcknowledged' | 'userCommandSourceLabel' | 'feedbackToolCardTitle';
16
+ export type HostLocaleKey = 'commandAcknowledged' | 'commandNotSelected' | 'userCommandSourceLabel' | 'feedbackToolCardTitle';
17
17
  export type HostTranslate = (key: HostLocaleKey, params?: Record<string, string>) => string;
18
18
  /**
19
19
  * The settings entry the harness locale plugin owns. The web bundle patch
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The `/` menu's row identities: which rows this plugin owns, and the panel
3
+ * entry each one translates as.
4
+ *
5
+ * Two halves have to meet, and neither can see the other. The runtime command
6
+ * registries know the call name a command actually got — allocation may have
7
+ * suffixed it — but nothing about translation. The panels own the id and the
8
+ * authored text a translation is cached under, because they are what queued it.
9
+ *
10
+ * The join happens here, on the panel's own output: a registration names the
11
+ * panel id it belongs to, and this looks that entry up and copies the text the
12
+ * panel handed the translator. Deriving the text again would risk a different
13
+ * spelling than the one the cache key was built from, which shows up as the
14
+ * same prose translated — and paid for — twice.
15
+ *
16
+ * The skill half needs no registry: a skill's menu name is the name the panel
17
+ * lists it under, so the panel read is the whole answer.
18
+ * @module runtime/host/menu-row-identities
19
+ */
20
+ import type { MenuRowIdentity } from '../../../../market-contracts/src/ports/ports.js';
21
+ import type { PanelResourceStore } from '../../application/panel-resources.js';
22
+ /** One live command registration: the menu row's call name and the panel entry behind it. */
23
+ export interface MenuRowRegistration {
24
+ /** The call name the `/` menu row carries. */
25
+ readonly name: string;
26
+ /** The panel identity the same document is listed and translated under. */
27
+ readonly id: string;
28
+ }
29
+ /** What the join reads. */
30
+ export interface MenuRowIdentitySource {
31
+ /** The panels whose entries back the menu rows (the same stores the panel UI reads). */
32
+ readonly panels: {
33
+ skills: PanelResourceStore;
34
+ commands: PanelResourceStore;
35
+ };
36
+ /** Every live command registration, from the user and suite registries. */
37
+ readonly commands: readonly MenuRowRegistration[];
38
+ }
39
+ /**
40
+ * Pair the installed and user-authored entries this plugin owns with the menu
41
+ * rows they appear as.
42
+ *
43
+ * A command whose registration has no panel entry is skipped rather than
44
+ * guessed at: without the panel's own text there is no id to share and no
45
+ * translation to show. A skill the panel lists contributes whatever translation
46
+ * the panel already resolved for it.
47
+ * @param source - the panels to read and the live command registrations to match.
48
+ * @returns one identity per owned menu row.
49
+ */
50
+ export declare function collectMenuRowIdentities(source: MenuRowIdentitySource): Promise<MenuRowIdentity[]>;
@@ -1,4 +1,4 @@
1
- import type { ModelCatalogPayload } from '../../contracts/market.js';
1
+ import type { ModelCatalogPayload } from '../../../../market-contracts/src/contracts/market.js';
2
2
  interface ModelCatalogHost {
3
3
  get?(name: string): unknown;
4
4
  }