dsh-plugin-dev-kb 1.4.0 → 1.5.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 (415) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.en.md +6 -6
  3. package/README.md +10 -5
  4. package/kb/INDEX.md +8 -4
  5. package/kb/extra/AGENTS.md +4 -3
  6. package/kb/extra/agent-lifecycle.md +91 -0
  7. package/kb/extra/agent-lifecycle.zh.md +93 -0
  8. package/kb/extra/api-gateway.md +172 -0
  9. package/kb/extra/api-gateway.zh.md +178 -0
  10. package/kb/extra/architecture.md +165 -0
  11. package/kb/extra/architecture.zh.md +169 -0
  12. package/kb/extra/capability-seams.md +714 -0
  13. package/kb/extra/capability-seams.zh.md +716 -0
  14. package/kb/extra/cli-help.md +203 -0
  15. package/kb/extra/cli-help.zh.md +205 -0
  16. package/kb/extra/config-catalog.md +4801 -0
  17. package/kb/extra/config-catalog.zh.md +4803 -0
  18. package/kb/extra/cookbook/adding-a-package.md +170 -0
  19. package/kb/extra/cookbook/adding-a-package.zh.md +170 -0
  20. package/kb/extra/cookbook/adding-a-plugin-preview.md +52 -0
  21. package/kb/extra/cookbook/adding-a-plugin-preview.zh.md +52 -0
  22. package/kb/extra/cookbook/adding-a-session-format-version.md +7 -5
  23. package/kb/extra/cookbook/adding-a-session-format-version.zh.md +7 -5
  24. package/kb/extra/cookbook/adding-a-settings-card.md +72 -0
  25. package/kb/extra/cookbook/adding-a-settings-card.zh.md +72 -0
  26. package/kb/extra/cookbook/adding-a-tool.md +101 -0
  27. package/kb/extra/cookbook/adding-a-tool.zh.md +103 -0
  28. package/kb/extra/cookbook/adding-an-llm-adapter.md +43 -0
  29. package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +43 -0
  30. package/kb/extra/cookbook/extension-cookbook.md +132 -0
  31. package/kb/extra/cookbook/extension-cookbook.zh.md +136 -0
  32. package/kb/extra/cookbook/reviewing-persistence-type-changes.md +11 -9
  33. package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +11 -9
  34. package/kb/extra/cordis-api/context.md +364 -0
  35. package/kb/extra/cordis-api/context.zh.md +366 -0
  36. package/kb/extra/cordis-api/events.md +207 -0
  37. package/kb/extra/cordis-api/events.zh.md +209 -0
  38. package/kb/extra/cordis-api/fiber.md +375 -0
  39. package/kb/extra/cordis-api/fiber.zh.md +377 -0
  40. package/kb/extra/cordis-api/inherited.md +38 -0
  41. package/kb/extra/cordis-api/registry.md +152 -0
  42. package/kb/extra/cordis-api/registry.zh.md +154 -0
  43. package/kb/extra/cordis-api/service.md +102 -0
  44. package/kb/extra/cordis-api/service.zh.md +104 -0
  45. package/kb/extra/cordis-tutorial/01-first-plugin.md +95 -0
  46. package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +95 -0
  47. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  48. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  49. package/kb/extra/cordis-tutorial/03-services.md +98 -0
  50. package/kb/extra/cordis-tutorial/03-services.zh.md +98 -0
  51. package/kb/extra/cordis-tutorial/04-events.md +144 -0
  52. package/kb/extra/cordis-tutorial/04-events.zh.md +144 -0
  53. package/kb/extra/cordis-tutorial/05-config.md +111 -0
  54. package/kb/extra/cordis-tutorial/05-config.zh.md +111 -0
  55. package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +113 -0
  56. package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  57. package/kb/extra/cordis-tutorial/07-into-the-harness.md +108 -0
  58. package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +108 -0
  59. package/kb/extra/cordis-tutorial/index.md +60 -0
  60. package/kb/extra/cordis-tutorial/index.zh.md +62 -0
  61. package/kb/extra/deepseek-llm-api-wire-extensions.md +5 -5
  62. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +5 -5
  63. package/kb/extra/defensive-patterns/README.md +25 -0
  64. package/kb/extra/defensive-patterns/README.zh.md +27 -0
  65. package/kb/extra/defensive-patterns/client-components.md +493 -0
  66. package/kb/extra/defensive-patterns/client-components.zh.md +495 -0
  67. package/kb/extra/defensive-patterns/conversation-and-session.md +316 -0
  68. package/kb/extra/defensive-patterns/conversation-and-session.zh.md +316 -0
  69. package/kb/extra/defensive-patterns/general.md +222 -0
  70. package/kb/extra/defensive-patterns/general.zh.md +252 -0
  71. package/kb/extra/defensive-patterns/package-surface.md +231 -0
  72. package/kb/extra/defensive-patterns/package-surface.zh.md +231 -0
  73. package/kb/extra/defensive-patterns/remote-and-api.md +115 -0
  74. package/kb/extra/defensive-patterns/remote-and-api.zh.md +115 -0
  75. package/kb/extra/development.md +31 -11
  76. package/kb/extra/development.zh.md +32 -11
  77. package/kb/extra/event-producer-consumer.md +40 -39
  78. package/kb/extra/event-producer-consumer.zh.md +40 -39
  79. package/kb/extra/experimental-persistence-catalog.md +17 -0
  80. package/kb/extra/experimental-persistence-catalog.zh.md +17 -0
  81. package/kb/extra/glossary.md +1 -0
  82. package/kb/extra/glossary.zh.md +1 -0
  83. package/kb/extra/i18n/style-samples.md +2 -2
  84. package/kb/extra/i18n/terminology.md +1 -0
  85. package/kb/extra/module-graph.md +274 -195
  86. package/kb/extra/module-graph.zh.md +274 -195
  87. package/kb/extra/persistence-catalog.md +9140 -0
  88. package/kb/extra/persistence-catalog.zh.md +9142 -0
  89. package/kb/extra/persistence-changes/2026-09-13-working-directory.md +48 -0
  90. package/kb/extra/persistence-changes/2026-09-13-working-directory.zh.md +48 -0
  91. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +2 -2
  92. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +2 -2
  93. package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.md +48 -0
  94. package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.zh.md +48 -0
  95. package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.md +52 -0
  96. package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.zh.md +52 -0
  97. package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.md +48 -0
  98. package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.zh.md +48 -0
  99. package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.md +60 -0
  100. package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.zh.md +60 -0
  101. package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.md +48 -0
  102. package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.zh.md +48 -0
  103. package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.md +48 -0
  104. package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.zh.md +48 -0
  105. package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.md +60 -0
  106. package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.zh.md +60 -0
  107. package/kb/extra/persistence-changes/README.md +12 -10
  108. package/kb/extra/persistence-changes/README.zh.md +12 -10
  109. package/kb/extra/persistence-changes/historical-formats/README.md +1 -1
  110. package/kb/extra/persistence-changes/historical-formats/README.zh.md +1 -1
  111. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +50 -50
  112. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +50 -50
  113. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +14 -14
  114. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +14 -14
  115. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +3 -3
  116. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +3 -3
  117. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +10 -10
  118. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +10 -10
  119. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +3 -3
  120. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +3 -3
  121. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +13 -13
  122. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +13 -13
  123. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +63 -63
  124. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +63 -63
  125. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +54 -54
  126. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +54 -54
  127. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +7 -7
  128. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +7 -7
  129. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +27 -27
  130. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +27 -27
  131. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +4 -4
  132. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +4 -4
  133. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +27 -27
  134. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +27 -27
  135. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +7 -7
  136. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +7 -7
  137. package/kb/extra/session-format-status.md +6 -6
  138. package/kb/extra/session-format-status.zh.md +6 -6
  139. package/kb/extra/subsystems/README.md +76 -0
  140. package/kb/extra/subsystems/README.zh.md +76 -0
  141. package/kb/extra/subsystems/agent-team.md +10 -10
  142. package/kb/extra/subsystems/agent-team.zh.md +10 -10
  143. package/kb/extra/subsystems/approval.md +170 -0
  144. package/kb/extra/subsystems/approval.zh.md +170 -0
  145. package/kb/extra/subsystems/boot.md +128 -4
  146. package/kb/extra/subsystems/boot.zh.md +128 -4
  147. package/kb/extra/subsystems/claude-code-mods.md +1 -1
  148. package/kb/extra/subsystems/claude-code-mods.zh.md +1 -1
  149. package/kb/extra/subsystems/client-modules.md +198 -0
  150. package/kb/extra/subsystems/client-modules.zh.md +198 -0
  151. package/kb/extra/subsystems/client-resources.md +92 -0
  152. package/kb/extra/subsystems/client-resources.zh.md +92 -0
  153. package/kb/extra/subsystems/commands.md +223 -0
  154. package/kb/extra/subsystems/commands.zh.md +223 -0
  155. package/kb/extra/subsystems/compaction.md +284 -0
  156. package/kb/extra/subsystems/compaction.zh.md +284 -0
  157. package/kb/extra/subsystems/computer-use.md +3 -0
  158. package/kb/extra/subsystems/computer-use.zh.md +3 -0
  159. package/kb/extra/subsystems/conversation.md +301 -0
  160. package/kb/extra/subsystems/conversation.zh.md +303 -0
  161. package/kb/extra/subsystems/core.md +1113 -0
  162. package/kb/extra/subsystems/core.zh.md +1125 -0
  163. package/kb/extra/subsystems/credentials.md +493 -0
  164. package/kb/extra/subsystems/credentials.zh.md +493 -0
  165. package/kb/extra/subsystems/filesystem.md +530 -0
  166. package/kb/extra/subsystems/filesystem.zh.md +530 -0
  167. package/kb/extra/subsystems/goal.md +313 -0
  168. package/kb/extra/subsystems/goal.zh.md +313 -0
  169. package/kb/extra/subsystems/jobs.md +554 -0
  170. package/kb/extra/subsystems/jobs.zh.md +554 -0
  171. package/kb/extra/subsystems/llm-streaming.md +1196 -0
  172. package/kb/extra/subsystems/llm-streaming.zh.md +1202 -0
  173. package/kb/extra/subsystems/lsp.md +202 -0
  174. package/kb/extra/subsystems/lsp.zh.md +202 -0
  175. package/kb/extra/subsystems/permission-presets.md +167 -0
  176. package/kb/extra/subsystems/permission-presets.zh.md +167 -0
  177. package/kb/extra/subsystems/persistence.md +418 -0
  178. package/kb/extra/subsystems/persistence.zh.md +418 -0
  179. package/kb/extra/subsystems/plan.md +87 -0
  180. package/kb/extra/subsystems/plan.zh.md +87 -0
  181. package/kb/extra/subsystems/product-telemetry.md +4 -2
  182. package/kb/extra/subsystems/product-telemetry.zh.md +4 -2
  183. package/kb/extra/subsystems/ptc-runtime.md +250 -0
  184. package/kb/extra/subsystems/ptc-runtime.zh.md +250 -0
  185. package/kb/extra/subsystems/sandbox.md +221 -0
  186. package/kb/extra/subsystems/sandbox.zh.md +221 -0
  187. package/kb/extra/subsystems/schedule.md +550 -0
  188. package/kb/extra/subsystems/schedule.zh.md +550 -0
  189. package/kb/extra/subsystems/scope.md +59 -0
  190. package/kb/extra/subsystems/scope.zh.md +61 -0
  191. package/kb/extra/subsystems/session-projection.md +356 -0
  192. package/kb/extra/subsystems/session-projection.zh.md +356 -0
  193. package/kb/extra/subsystems/session-query.md +511 -0
  194. package/kb/extra/subsystems/session-query.zh.md +511 -0
  195. package/kb/extra/subsystems/session-reference.md +224 -0
  196. package/kb/extra/subsystems/session-reference.zh.md +224 -0
  197. package/kb/extra/subsystems/session-telemetry.md +212 -0
  198. package/kb/extra/subsystems/session-telemetry.zh.md +212 -0
  199. package/kb/extra/subsystems/session-title.md +213 -0
  200. package/kb/extra/subsystems/session-title.zh.md +213 -0
  201. package/kb/extra/subsystems/session.md +1339 -0
  202. package/kb/extra/subsystems/session.zh.md +1343 -0
  203. package/kb/extra/subsystems/settings.md +155 -0
  204. package/kb/extra/subsystems/settings.zh.md +155 -0
  205. package/kb/extra/subsystems/shell.md +314 -0
  206. package/kb/extra/subsystems/shell.zh.md +314 -0
  207. package/kb/extra/subsystems/sidebar-right.md +160 -0
  208. package/kb/extra/subsystems/sidebar-right.zh.md +160 -0
  209. package/kb/extra/subsystems/skills.md +352 -0
  210. package/kb/extra/subsystems/skills.zh.md +352 -0
  211. package/kb/extra/subsystems/slots.md +200 -0
  212. package/kb/extra/subsystems/slots.zh.md +204 -0
  213. package/kb/extra/subsystems/spill.md +124 -0
  214. package/kb/extra/subsystems/spill.zh.md +124 -0
  215. package/kb/extra/subsystems/ssh.md +22 -11
  216. package/kb/extra/subsystems/ssh.zh.md +22 -11
  217. package/kb/extra/subsystems/storage.md +259 -0
  218. package/kb/extra/subsystems/storage.zh.md +259 -0
  219. package/kb/extra/subsystems/subagent.md +686 -0
  220. package/kb/extra/subsystems/subagent.zh.md +688 -0
  221. package/kb/extra/subsystems/subprocess.md +321 -0
  222. package/kb/extra/subsystems/subprocess.zh.md +321 -0
  223. package/kb/extra/subsystems/system-prompt.md +254 -0
  224. package/kb/extra/subsystems/system-prompt.zh.md +254 -0
  225. package/kb/extra/subsystems/terminal.md +184 -0
  226. package/kb/extra/subsystems/terminal.zh.md +184 -0
  227. package/kb/extra/subsystems/token-meter.md +106 -0
  228. package/kb/extra/subsystems/token-meter.zh.md +106 -0
  229. package/kb/extra/subsystems/tools.md +747 -0
  230. package/kb/extra/subsystems/tools.zh.md +747 -0
  231. package/kb/extra/subsystems/translation.md +103 -0
  232. package/kb/extra/subsystems/translation.zh.md +103 -0
  233. package/kb/extra/subsystems/typert.md +690 -0
  234. package/kb/extra/subsystems/typert.zh.md +690 -0
  235. package/kb/extra/subsystems/user-questions.md +307 -0
  236. package/kb/extra/subsystems/user-questions.zh.md +307 -0
  237. package/kb/extra/subsystems/web-client.md +100 -0
  238. package/kb/extra/subsystems/web-client.zh.md +100 -0
  239. package/kb/extra/subsystems/web-server.md +302 -0
  240. package/kb/extra/subsystems/web-server.zh.md +302 -0
  241. package/kb/extra/subsystems/web.md +206 -0
  242. package/kb/extra/subsystems/web.zh.md +206 -0
  243. package/kb/extra/subsystems/webhook.md +1 -1
  244. package/kb/extra/subsystems/webhook.zh.md +1 -1
  245. package/kb/extra/subsystems/workflow.md +278 -0
  246. package/kb/extra/subsystems/workflow.zh.md +278 -0
  247. package/kb/extra/subsystems/working-directory.md +64 -0
  248. package/kb/extra/subsystems/working-directory.zh.md +64 -0
  249. package/kb/extra/subsystems/workspace.md +647 -0
  250. package/kb/extra/subsystems/workspace.zh.md +647 -0
  251. package/kb/extra/subsystems/worktrees.md +76 -0
  252. package/kb/extra/subsystems/worktrees.zh.md +76 -0
  253. package/kb/extra/testing.md +1 -1
  254. package/kb/extra/testing.zh.md +1 -1
  255. package/kb/extra/tool-catalog.md +2824 -0
  256. package/kb/extra/tool-catalog.zh.md +2832 -0
  257. package/kb/extra/tool-execution-pipeline.md +65 -0
  258. package/kb/extra/tool-execution-pipeline.zh.md +67 -0
  259. package/kb/extra/ui-radius.md +6 -4
  260. package/kb/extra/ui-radius.zh.md +6 -4
  261. package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.md +18 -0
  262. package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.zh.md +18 -0
  263. package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.md +18 -0
  264. package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.zh.md +18 -0
  265. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.md +17 -0
  266. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.zh.md +17 -0
  267. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.md +18 -0
  268. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.zh.md +18 -0
  269. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.md +28 -0
  270. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.zh.md +28 -0
  271. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.md +20 -0
  272. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.zh.md +20 -0
  273. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.md +18 -0
  274. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.zh.md +18 -0
  275. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.md +18 -0
  276. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.zh.md +18 -0
  277. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.md +17 -0
  278. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.zh.md +17 -0
  279. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.md +31 -0
  280. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.zh.md +31 -0
  281. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.md +20 -0
  282. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.zh.md +20 -0
  283. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.md +20 -0
  284. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.zh.md +20 -0
  285. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.md +18 -0
  286. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.zh.md +18 -0
  287. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -0
  288. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -0
  289. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.md +18 -0
  290. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.zh.md +18 -0
  291. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.md +20 -0
  292. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.zh.md +20 -0
  293. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.md +19 -0
  294. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.zh.md +19 -0
  295. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.md +59 -0
  296. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.zh.md +59 -0
  297. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.md +21 -0
  298. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.zh.md +21 -0
  299. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +21 -0
  300. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +21 -0
  301. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.md +18 -0
  302. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.zh.md +18 -0
  303. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.md +21 -0
  304. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.zh.md +21 -0
  305. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.md +36 -0
  306. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.zh.md +36 -0
  307. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.md +25 -0
  308. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.zh.md +25 -0
  309. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.md +18 -0
  310. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.zh.md +18 -0
  311. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.md +27 -0
  312. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.zh.md +27 -0
  313. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.md +18 -0
  314. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.zh.md +18 -0
  315. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.md +20 -0
  316. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.zh.md +20 -0
  317. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.md +18 -0
  318. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.zh.md +18 -0
  319. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.md +19 -0
  320. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.zh.md +19 -0
  321. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.md +17 -0
  322. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.zh.md +17 -0
  323. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.md +20 -0
  324. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.zh.md +20 -0
  325. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.md +32 -0
  326. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.zh.md +32 -0
  327. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.md +25 -0
  328. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.zh.md +25 -0
  329. package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md +21 -0
  330. package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.zh.md +21 -0
  331. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.md +18 -0
  332. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.zh.md +18 -0
  333. package/kb/meta/search-index.json +1932 -366
  334. package/kb/meta/source.json +9 -8
  335. package/kb/site/develop/basic/publish.md +3 -1
  336. package/kb/site/en/develop/basic/publish.md +3 -1
  337. package/kb/site/en/guide/github-review.md +7 -10
  338. package/kb/site/en/guide/plugin-market.md +151 -0
  339. package/kb/site/en/guide/providers.md +27 -4
  340. package/kb/site/en/guide/public-deployments.md +10 -6
  341. package/kb/site/en/guide/python-sdk.md +8 -9
  342. package/kb/site/en/reference/api-gateway.md +10 -3
  343. package/kb/site/en/reference/capability-seams.md +71 -24
  344. package/kb/site/en/reference/config-catalog.md +452 -191
  345. package/kb/site/en/reference/experimental-persistence-catalog.md +20 -0
  346. package/kb/site/en/reference/index.md +11 -12
  347. package/kb/site/en/reference/persistence-catalog.md +552 -192
  348. package/kb/site/en/reference/subsystems/client-modules.md +14 -0
  349. package/kb/site/en/reference/subsystems/conversation.md +14 -0
  350. package/kb/site/en/reference/subsystems/core.md +3 -1
  351. package/kb/site/en/reference/subsystems/credentials.md +13 -12
  352. package/kb/site/en/reference/subsystems/index.md +4 -1
  353. package/kb/site/en/reference/subsystems/jobs.md +62 -7
  354. package/kb/site/en/reference/subsystems/llm-streaming.md +82 -15
  355. package/kb/site/en/reference/subsystems/persistence.md +2 -0
  356. package/kb/site/en/reference/subsystems/plan.md +1 -1
  357. package/kb/site/en/reference/subsystems/ptc-runtime.md +24 -6
  358. package/kb/site/en/reference/subsystems/session-query.md +2 -0
  359. package/kb/site/en/reference/subsystems/session-title.md +14 -5
  360. package/kb/site/en/reference/subsystems/session.md +59 -14
  361. package/kb/site/en/reference/subsystems/sidebar-right.md +2 -0
  362. package/kb/site/en/reference/subsystems/skills.md +2 -2
  363. package/kb/site/en/reference/subsystems/slots.md +80 -83
  364. package/kb/site/en/reference/subsystems/subagent.md +175 -247
  365. package/kb/site/en/reference/subsystems/system-prompt.md +32 -2
  366. package/kb/site/en/reference/subsystems/tools.md +3 -3
  367. package/kb/site/en/reference/subsystems/typert.md +222 -17
  368. package/kb/site/en/reference/subsystems/web-client.md +1 -1
  369. package/kb/site/en/reference/subsystems/web-server.md +87 -11
  370. package/kb/site/en/reference/subsystems/web.md +2 -2
  371. package/kb/site/en/reference/subsystems/workflow.md +1 -1
  372. package/kb/site/en/reference/subsystems/workspace.md +25 -37
  373. package/kb/site/en/reference/tool-catalog.md +156 -51
  374. package/kb/site/guide/github-review.md +7 -10
  375. package/kb/site/guide/plugin-market.md +151 -0
  376. package/kb/site/guide/providers.md +27 -4
  377. package/kb/site/guide/public-deployments.md +10 -6
  378. package/kb/site/guide/python-sdk.md +8 -9
  379. package/kb/site/reference/api-gateway.md +16 -3
  380. package/kb/site/reference/capability-seams.md +71 -24
  381. package/kb/site/reference/config-catalog.md +452 -191
  382. package/kb/site/reference/experimental-persistence-catalog.md +20 -0
  383. package/kb/site/reference/index.md +11 -12
  384. package/kb/site/reference/persistence-catalog.md +552 -192
  385. package/kb/site/reference/subsystems/client-modules.md +14 -0
  386. package/kb/site/reference/subsystems/conversation.md +16 -0
  387. package/kb/site/reference/subsystems/core.md +5 -1
  388. package/kb/site/reference/subsystems/credentials.md +13 -12
  389. package/kb/site/reference/subsystems/index.md +4 -1
  390. package/kb/site/reference/subsystems/jobs.md +62 -7
  391. package/kb/site/reference/subsystems/llm-streaming.md +82 -15
  392. package/kb/site/reference/subsystems/persistence.md +2 -0
  393. package/kb/site/reference/subsystems/plan.md +1 -1
  394. package/kb/site/reference/subsystems/ptc-runtime.md +24 -6
  395. package/kb/site/reference/subsystems/scope.md +2 -0
  396. package/kb/site/reference/subsystems/session-query.md +2 -0
  397. package/kb/site/reference/subsystems/session-title.md +14 -5
  398. package/kb/site/reference/subsystems/session.md +59 -14
  399. package/kb/site/reference/subsystems/sidebar-right.md +2 -0
  400. package/kb/site/reference/subsystems/skills.md +2 -2
  401. package/kb/site/reference/subsystems/slots.md +84 -83
  402. package/kb/site/reference/subsystems/subagent.md +177 -251
  403. package/kb/site/reference/subsystems/system-prompt.md +32 -2
  404. package/kb/site/reference/subsystems/tools.md +3 -3
  405. package/kb/site/reference/subsystems/typert.md +222 -17
  406. package/kb/site/reference/subsystems/web-client.md +1 -1
  407. package/kb/site/reference/subsystems/web-server.md +87 -11
  408. package/kb/site/reference/subsystems/web.md +2 -2
  409. package/kb/site/reference/subsystems/workflow.md +1 -1
  410. package/kb/site/reference/subsystems/workspace.md +25 -37
  411. package/kb/site/reference/tool-catalog.md +160 -55
  412. package/package.json +2 -2
  413. package/skills/dsh-dev-sandbox.md +70 -0
  414. package/kb/extra/defensive-patterns.md +0 -33
  415. package/kb/extra/defensive-patterns.zh.md +0 -35
@@ -0,0 +1,321 @@
1
+ # Subprocess
2
+
3
+ English | [中文](subprocess.zh.md)
4
+
5
+ The subprocess seam is split across a Service Definition ([dsh-subprocess](../../packages/subprocess/subprocess), `ctx.subprocess`) and Service Provider ([dsh-subprocess-local](../../packages/subprocess/subprocess-local)); its Consumers are other capability seams and out-of-process backends: the [bash executor family](shell.md) uses collected batch output, LSP uses raw protocol pipes, the PTY backend uses the terminal primitive, and the ACP subagent backend uses piped ndjson plus inherited stderr. This seam owns the managed `DSH_*` environment namespace, the shared credential scrub (`scrubbedParentEnv`), and the `CollectedOutput` shape; [dsh-shell](../../packages/shell/shell) re-exports the vocabulary so bash consumers keep one import root.
6
+
7
+ Source: [`packages/subprocess/subprocess/src/types.ts`](../../packages/subprocess/subprocess/src/types.ts) and [`packages/subprocess/subprocess/src/index.ts`](../../packages/subprocess/subprocess/src/index.ts)
8
+
9
+ ## Executable lookup
10
+
11
+ One provider's spawn working directories, executable paths, ordinary processes, and terminal sessions inhabit the same path and process namespace as the mounted filesystem provider. `resolveExecutable(command, env?, signal?)` verifies absolute executable paths or resolves bare names through the provider's scrubbed `PATH` plus deliberate overrides.
12
+
13
+ ## Managed environment namespace and captured output
14
+
15
+ `DSH_*` variables are Harness-owned child-process facts; implementations discard ambient `DSH_*` names before the caller's explicit `env` merges, so a current fact arrives only as a deliberate string entry, while an explicit `undefined` tombstone removes an ordinary ambient value. Each collected stream reports its truncation and spill-recovery state through `CollectedOutput`.
16
+
17
+ ```ts type-equiv
18
+ /** One environment key inside the managed {@link DSH_ENV_PREFIX} namespace. */
19
+ type DshEnvironmentKey = `${typeof DSH_ENV_PREFIX}${string}`
20
+ ```
21
+
22
+ ```ts type-equiv
23
+ /** Trusted DeepSeek Harness variables for one child-process execution. */
24
+ type DshEnvironment = Readonly<Record<DshEnvironmentKey, string>>
25
+ ```
26
+
27
+ ```ts type-equiv
28
+ /** One captured stream: the (possibly truncated) text plus recovery info. */
29
+ interface CollectedOutput {
30
+ /** Collected text — the TAIL of the stream when truncated. */
31
+ text: string
32
+ /** True when bytes were dropped from `text`. */
33
+ truncated: boolean
34
+ /** Path to a file holding the COMPLETE stream, when truncated and available. */
35
+ spillPath?: string
36
+ }
37
+ ```
38
+
39
+ ## Node-shaped stdio dispositions
40
+
41
+ Each stream's disposition is explicit, chosen per consumer: raw pipes for protocol framing (LSP JSON-RPC, ACP ndjson), inherit for pass-through diagnostics, and collect mode for bounded batch output — with the spill file optional, so a diagnostic tail (a language server's stderr) buffers without leaving files behind.
42
+
43
+ ```ts type-equiv
44
+ /**
45
+ * stdin disposition. `'ignore'` leaves fd 0 on `/dev/null`; `'pipe'` exposes
46
+ * {@link SubprocessHandle.stdin} for the caller's ongoing protocol writes;
47
+ * `{ data }` writes the bytes and closes (the batch shape).
48
+ */
49
+ type SubprocessStdinMode = 'ignore' | 'pipe' | { readonly data: string }
50
+ ```
51
+
52
+ ```ts type-equiv
53
+ /**
54
+ * Bounded in-memory collection for one output stream, with an optional
55
+ * full-stream spill file. Omitting `spill` keeps only the in-memory tail —
56
+ * the diagnostic-tail shape (a language server's stderr); including it makes
57
+ * the complete stream recoverable up to its cap (the bash tool shape).
58
+ */
59
+ interface SubprocessCollect {
60
+ /** In-memory cap in bytes; overflow keeps the TAIL. */
61
+ maxBytes: number
62
+ /** Full-stream spill file; absent disables spilling entirely. */
63
+ spill?: {
64
+ /** Whole-stream byte cap; a larger stream discards its now-incomplete spill. */
65
+ maxBytes: number
66
+ }
67
+ }
68
+ ```
69
+
70
+ ```ts type-equiv
71
+ /**
72
+ * stdout/stderr disposition. `'pipe'` exposes the raw `Readable` for the
73
+ * caller's protocol decoding; `'inherit'` passes the parent's descriptor
74
+ * through (child diagnostics land on the harness's own stream); a
75
+ * {@link SubprocessCollect} object buffers boundedly with offset-based reads.
76
+ */
77
+ type SubprocessOutputMode = 'pipe' | 'inherit' | SubprocessCollect
78
+ ```
79
+
80
+ ```ts type-equiv
81
+ /** Per-stream stdio dispositions, all explicit — this seam applies no defaults. */
82
+ interface SubprocessStdio {
83
+ stdin: SubprocessStdinMode
84
+ stdout: SubprocessOutputMode
85
+ stderr: SubprocessOutputMode
86
+ /** Request a separate byte-mode duplex channel; omission creates none. */
87
+ control?: 'pipe'
88
+ }
89
+ ```
90
+
91
+ ## The fully-explicit spawn spec
92
+
93
+ The seam applies no defaults: every disposition, limit, and directory is explicit on the spec, so the caller's own config — not a hidden subprocess-service default — decides them. `argv` is never shell-interpreted.
94
+
95
+ ```ts type-equiv
96
+ /**
97
+ * A fully-specified spawn request. This seam applies no defaults: every
98
+ * disposition, limit, and directory is explicit, so the caller's own config —
99
+ * not a hidden subprocess-service default — decides them (the `dsh-shell`
100
+ * request/spec split is the owning template).
101
+ */
102
+ interface SubprocessSpawnSpec {
103
+ /** Executable and arguments; `argv[0]` is the program. Never shell-interpreted here. */
104
+ argv: readonly string[]
105
+ /** Working directory for the child. */
106
+ cwd: string
107
+ /** Per-stream stdio dispositions. */
108
+ stdio: SubprocessStdio
109
+ /**
110
+ * Positive finite grace period in milliseconds, no greater than
111
+ * `MAX_TIMER_DELAY_MS`, available to the provider's termination procedure
112
+ * and used for draining still-open collected pipes after the process exits
113
+ * (an inherited descriptor held by a survivor cannot hold the outcome open
114
+ * indefinitely). Providers document whether range termination is staged or
115
+ * immediate.
116
+ */
117
+ graceMs: number
118
+ /**
119
+ * Abort signal — starts the terminate escalation on the managed range when
120
+ * it fires. The caller owns deadlines and cause classification; this seam
121
+ * only reacts to the abort.
122
+ */
123
+ signal?: AbortSignal | undefined
124
+ /**
125
+ * Explicit environment entries merged onto the implementation's scrubbed
126
+ * parent base (see `scrubbedParentEnv`), with no namespace validation. A
127
+ * string is a deliberate caller opt-in, so a forwarded credential-shaped
128
+ * entry or current `DSH_*` fact survives the scrub; `undefined` is a
129
+ * tombstone that removes an ordinary ambient entry from the child.
130
+ */
131
+ env?: NodeJS.ProcessEnv | undefined
132
+ }
133
+ ```
134
+
135
+ ## Handles: streams, readers, and managed-range termination
136
+
137
+ A spawn returns a live handle synchronously while target and managed-range identities remain provider-private. Collect-mode readers take whole-stream byte offsets and never consume, so independent readers cannot steal one another's deltas; piped streams belong to the caller. `terminate()` starts the provider's documented procedure, and `waitForExit()` observes the same provider-managed range; staged providers may use `graceMs`, while immediate providers do not delay. Consumers can build their own teardown ladders over those two operations (the ACP backend's stdin-EOF-first `disposeAcpChild` is the template).
138
+
139
+ ```ts type-equiv
140
+ /**
141
+ * A live subprocess and its provider-managed process range. Collected output
142
+ * remains readable after exit; piped streams belong to the caller.
143
+ *
144
+ * Termination and {@link SubprocessHandle.waitForExit} use the same managed
145
+ * range. Each provider documents the range it can observe and its signalling
146
+ * and observation limits.
147
+ */
148
+ interface SubprocessHandle {
149
+ /** The child's stdin, present iff spawned with `stdin: 'pipe'`. */
150
+ readonly stdin: Writable | undefined
151
+ /** The child's raw stdout, present iff spawned with `stdout: 'pipe'`. */
152
+ readonly stdout: Readable | undefined
153
+ /** The child's raw stderr, present iff spawned with `stderr: 'pipe'`. */
154
+ readonly stderr: Readable | undefined
155
+ /** Separate caller-owned byte channel when requested; native startup failure may leave it absent. */
156
+ readonly control: Duplex | undefined
157
+ /** Offset-based readers for collect-mode streams (also readable after exit). */
158
+ readonly collected: SubprocessCollectedOutputs
159
+ /** Resolves with spawned-command exit facts; rejects for spawn or provider failures. */
160
+ readonly done: Promise<SubprocessOutcome>
161
+ /**
162
+ * Begin the provider's documented termination procedure on the managed range
163
+ * — the seam's only termination verb. Idempotent, a no-op once that range is
164
+ * gone, and also triggered by the spec's abort signal.
165
+ */
166
+ terminate(): void
167
+ /**
168
+ * Wait until the same managed range is empty — not just until the spawned
169
+ * command reports its outcome, so surviving work remains observable.
170
+ * @param signal - optional bound for the wait.
171
+ * @returns `true` when the managed range is empty, `false` when the signal aborted first.
172
+ * @throws when the selected provider can no longer observe its managed range.
173
+ */
174
+ waitForExit(signal?: AbortSignal): Promise<boolean>
175
+ }
176
+ ```
177
+
178
+ ```ts type-equiv
179
+ /**
180
+ * Cursor-free incremental access to one collected output stream. Offsets are
181
+ * whole-stream byte coordinates owned by the caller, so independent readers
182
+ * cannot consume one another's output; `readFrom(0)` after settlement is the
183
+ * batch result (`lossy` then means the in-memory tail lost its head — the
184
+ * {@link CollectedOutput.truncated} fact).
185
+ */
186
+ interface SubprocessOutputReader {
187
+ /**
188
+ * Read everything captured since `fromByte`. When that offset has slid out
189
+ * of the in-memory tail window the read is `lossy` — it returns the whole
190
+ * retained tail and the gap is only recoverable from the spill file.
191
+ * @param fromByte - whole-stream offset to resume from (a prior read's `nextOffset`; 0 for the first read).
192
+ * @returns the delta text, the next offset, the `lossy` flag, and the spill path when one exists.
193
+ */
194
+ readFrom(fromByte: number): SubprocessOutputRead
195
+ }
196
+ ```
197
+
198
+ ```ts type-equiv
199
+ /** One incremental {@link SubprocessOutputReader.readFrom} read. */
200
+ interface SubprocessOutputRead {
201
+ /** Stream text from the requested offset (the whole retained tail when lossy). */
202
+ text: string
203
+ /** Whole-stream offset to resume from on the next read. */
204
+ nextOffset: number
205
+ /** True when the requested offset slid out of the in-memory tail window. */
206
+ lossy: boolean
207
+ /** Path to the full-stream spill file, when one was created and remains intact. */
208
+ spillPath?: string
209
+ }
210
+ ```
211
+
212
+ ```ts type-equiv
213
+ /** Offset-based readers for the streams spawned in collect mode. */
214
+ interface SubprocessCollectedOutputs {
215
+ /** Present iff stdout is a {@link SubprocessCollect}. */
216
+ readonly stdout?: SubprocessOutputReader
217
+ /** Present iff stderr is a {@link SubprocessCollect}. */
218
+ readonly stderr?: SubprocessOutputReader
219
+ }
220
+ ```
221
+
222
+
223
+ ## Outcomes carry exit facts only
224
+
225
+ `done` reports Node's close-event vocabulary and no cause classification — the service kills on abort but never decides why (the caller reads the deadline signal it owns, e.g. the bash executor's `timedOut`/`aborted` split). Collected output stays readable through `handle.collected` after settlement, so batch and streaming callers share one access path.
226
+
227
+ ```ts type-equiv
228
+ /**
229
+ * Exit facts of one closed process — Node's `close`-event vocabulary.
230
+ * Deliberately carries NO timeout or cancellation classification (the caller
231
+ * reads the signal it owns to classify causes) and NO output: collected
232
+ * streams stay readable through {@link SubprocessHandle.collected} after
233
+ * settlement, so batch and streaming callers share one access path.
234
+ */
235
+ interface SubprocessOutcome {
236
+ /** Exit code; null when the process died from a signal. */
237
+ exitCode: number | null
238
+ /** Terminating signal (e.g. 'SIGTERM'); null on normal exit. */
239
+ signal: NodeJS.Signals | null
240
+ }
241
+ ```
242
+
243
+ ## Terminal-process primitive
244
+
245
+ `spawnTerminal(spec)` is the non-pipe process primitive. The provider allocates the controlling terminal and owns UTF-8 text transport, foreground-process-group inspection and signalling, and one awaited TERM-to-KILL operation that reaches quiescence for every session member the provider can still observe; providers document substrate-specific observability limits. The PTY backend remains responsible for prompt detection, readiness inference, scrollback, sandbox policy, and persistent-session ownership; ordinary `spawn()` cannot reconstruct controlling-terminal semantics.
246
+
247
+ The terminal spec fully specifies argv, cwd, environment overrides, terminal type, dimensions, cleanup grace, and optional allocation cancellation and shell activity observation. Its handle exposes `pid`, ordered output, `done`, `write`, `resize`, `inspectForeground`, `inspectActivity`, `signalForeground`, and awaited `terminate`; [`SubprocessTerminalSpawnSpec` and `SubprocessTerminalHandle`](../../packages/subprocess/subprocess/src/types.ts) define these fields and operations. `resize(cols, rows)` updates the live PTY dimensions and rejects after process exit.
248
+
249
+ `inspectActivity()` returns `SubprocessTerminalActivity`: `state` is `idle`, `busy` or `unknown`, and `revision` changes with provider-observed activity or input. A terminal request opts into supported shell lifecycle observation with `shellActivity`; provider-specific support and conservative unknown cases are documented by [subprocess-local](../../packages/subprocess/subprocess-local/README.md#running-terminal-sessions).
250
+
251
+ `terminalEnvironment(signal?)` returns `SubprocessTerminalEnvironment`: the execution environment platform (`posix` or `windows`) and optional `defaultShell`. These facts come from the provider rather than the Web server or browser. `resolveExecutable` verifies shell candidates; `SubprocessExecutableNotFoundError` identifies a missing executable, while provider and transport failures remain errors.
252
+
253
+ ## Service behavior
254
+
255
+ The abstract [`SubprocessRuntime`](../../packages/subprocess/subprocess/src/index.ts) Service Definition specifies execution-world coordinates, executable lookup, ordinary `spawn`, and `spawnTerminal`. [`LocalSubprocessRuntime`](../../packages/subprocess/subprocess-local/src/index.ts) provides them with platform-selected managed ranges, per-disposition wiring, credential scrubbing, `node-pty`, platform process inspection, and terminate-and-join disposal. See [`dsh-subprocess`](../../packages/subprocess/subprocess/README.md) for the Service Definition contract and [`dsh-subprocess-local`](../../packages/subprocess/subprocess-local/README.md) for local mechanics.
256
+
257
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
258
+
259
+ <a id="cordis-surface"></a>
260
+
261
+ ## Cordis API
262
+
263
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
264
+
265
+ <a id="ctxsubprocess--subprocessruntime-abstract-seam"></a>
266
+
267
+ ### `ctx.subprocess` — `SubprocessRuntime` (abstract seam)
268
+
269
+ Abstract subprocess service. Subclass, implement spawn, and load the subclass as a plugin — it registers as `ctx.subprocess` (one implementation per context; loading a second throws, which is cordis' standard duplicate-service behavior).
270
+
271
+ Implementations must honor these semantics:
272
+
273
+ - Executable paths belong to one execution world shared with the mounted filesystem provider.
274
+ - spawn returns a live handle synchronously. Target identity remains provider-private; `done` resolves with the spawned command's exit facts and may reject for spawn or provider failures.
275
+ - Collect-mode readers are offset-based and non-consuming, so independent readers never consume one another's output; lossy reads report truncation and the spill file holding the complete stream when one exists. Piped streams are handed to the caller raw and never buffered here.
276
+ - SubprocessHandle.terminate (and the spec's abort signal) starts the provider's documented procedure against its managed range. SubprocessHandle.waitForExit observes that same range so a consumer-owned teardown ladder can hold each tier on real quiescence; each provider documents its signalling and observability limits.
277
+ - Disposal of the service terminates all still-running managed processes and awaits their exit.
278
+ - spawnTerminal owns terminal allocation, text transport, foreground groups, signalling, and whole-session quiescence behind one awaited termination method; readiness and persistent-shell policy stay in the PTY consumer. Its output stream ends after queued terminal output when the top-level process exits.
279
+
280
+ ```ts cordis-catalog
281
+ /**
282
+ * Resolve one configured executable in this provider's execution world.
283
+ * Absolute paths are verified; bare names use the provider's scrubbed PATH
284
+ * plus explicit environment overrides. Relative paths containing separators
285
+ * are rejected: the resolution base is undefined, so providers fail loud
286
+ * instead of guessing.
287
+ * @param command - absolute executable path or bare PATH name.
288
+ * @param env - explicit environment entries used for lookup.
289
+ * @param signal - aborts remote or local lookup.
290
+ * @returns a canonical executable path.
291
+ */
292
+ abstract resolveExecutable( command: string, env?: Readonly<Record<string, string>>, signal?: AbortSignal, ): Promise<string>
293
+
294
+ /**
295
+ * Inspect shell-selection facts in the provider's execution environment.
296
+ * @param signal - cancellation of remote environment inspection.
297
+ * @returns platform and preferred shell; executable lookup and allocation remain separate operations.
298
+ */
299
+ abstract terminalEnvironment(signal?: AbortSignal): Promise<SubprocessTerminalEnvironment>
300
+
301
+ /**
302
+ * Start one managed child process from a fully-specified spec; this seam
303
+ * applies no defaults.
304
+ * @param spec - argv, directory, stdio dispositions, grace, cancellation, and environment.
305
+ * @returns the live process handle (streams/readers, signalling, outcome promise).
306
+ * @throws synchronously when pre-aborted or when argv, cwd, environment, or grace is invalid before handle creation.
307
+ */
308
+ abstract spawn(spec: SubprocessSpawnSpec): SubprocessHandle
309
+
310
+ /**
311
+ * Allocate a real terminal and start one owned process session. This is the
312
+ * only non-pipe process primitive: implementations own terminal byte I/O,
313
+ * foreground groups, signals, and whole-session quiescence.
314
+ * @param spec - fully specified argv, cwd, environment, dimensions, grace, and allocation cancellation.
315
+ * @returns the live terminal handle after allocation succeeds.
316
+ */
317
+ abstract spawnTerminal(spec: SubprocessTerminalSpawnSpec): Promise<SubprocessTerminalHandle>
318
+ ```
319
+
320
+ Source: [`packages/subprocess/subprocess/src/index.ts`](../../packages/subprocess/subprocess/src/index.ts)
321
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,321 @@
1
+ # 子进程
2
+
3
+ [English](subprocess.md) | 中文
4
+
5
+ 子进程 seam 分为 Service Definition([dsh-subprocess](../../packages/subprocess/subprocess),`ctx.subprocess`)与 Service Provider([dsh-subprocess-local](../../packages/subprocess/subprocess-local));它的 Consumer 是其他能力 seam 与进程外后端:[bash 执行器家族](shell.zh.md)使用收集模式的批量输出,LSP 使用原始协议管道,PTY 后端使用终端原语,ACP(Agent Client Protocol)subagent 后端则使用通过管道传输的 ndjson,并让 stderr 采用 inherit。该 seam 拥有受管的 `DSH_*` 环境命名空间、共享的凭据清除(`scrubbedParentEnv`)与 `CollectedOutput` 形状;[dsh-shell](../../packages/shell/shell) 重导出这套词汇,使 bash 消费方保持单一导入入口。
6
+
7
+ 源码:[`packages/subprocess/subprocess/src/types.ts`](../../packages/subprocess/subprocess/src/types.ts) 与 [`packages/subprocess/subprocess/src/index.ts`](../../packages/subprocess/subprocess/src/index.ts)
8
+
9
+ ## 可执行文件查找
10
+
11
+ 一个提供方的 spawn 工作目录、可执行文件路径、普通进程与终端会话,和挂载的文件系统提供方处于同一路径与进程命名空间。`resolveExecutable(command, env?, signal?)` 验证绝对可执行文件路径,或通过提供方清理后的 `PATH` 加有意覆盖来解析裸名称。
12
+
13
+ ## 受管环境命名空间与捕获的输出
14
+
15
+ `DSH_*` 变量是归 Harness 所有的子进程事实;实现会在合并调用方显式 `env` 之前丢弃环境中已有的 `DSH_*` 名称,因此当前事实只会以有意提供的字符串条目形式到达,而显式的 `undefined` tombstone 会删除普通环境中已有的值。每条被收集的流都通过 `CollectedOutput` 报告自身的截断与 spill 恢复状态。
16
+
17
+ ```ts type-equiv
18
+ /** One environment key inside the managed {@link DSH_ENV_PREFIX} namespace. */
19
+ type DshEnvironmentKey = `${typeof DSH_ENV_PREFIX}${string}`
20
+ ```
21
+
22
+ ```ts type-equiv
23
+ /** Trusted DeepSeek Harness variables for one child-process execution. */
24
+ type DshEnvironment = Readonly<Record<DshEnvironmentKey, string>>
25
+ ```
26
+
27
+ ```ts type-equiv
28
+ /** One captured stream: the (possibly truncated) text plus recovery info. */
29
+ interface CollectedOutput {
30
+ /** Collected text — the TAIL of the stream when truncated. */
31
+ text: string
32
+ /** True when bytes were dropped from `text`. */
33
+ truncated: boolean
34
+ /** Path to a file holding the COMPLETE stream, when truncated and available. */
35
+ spillPath?: string
36
+ }
37
+ ```
38
+
39
+ ## Node 风格的 stdio 处置方式(disposition)
40
+
41
+ 每条流的处置方式都显式给出,由各消费方自行选择:原始管道用于协议分帧(LSP JSON-RPC、ACP ndjson),inherit 用于直通的诊断输出,收集模式用于有界的批量输出;其中 spill 文件是可选的,因此诊断尾部(语言服务器的 stderr)可以只在内存中缓冲,不留下任何文件。
42
+
43
+ ```ts type-equiv
44
+ /**
45
+ * stdin disposition. `'ignore'` leaves fd 0 on `/dev/null`; `'pipe'` exposes
46
+ * {@link SubprocessHandle.stdin} for the caller's ongoing protocol writes;
47
+ * `{ data }` writes the bytes and closes (the batch shape).
48
+ */
49
+ type SubprocessStdinMode = 'ignore' | 'pipe' | { readonly data: string }
50
+ ```
51
+
52
+ ```ts type-equiv
53
+ /**
54
+ * Bounded in-memory collection for one output stream, with an optional
55
+ * full-stream spill file. Omitting `spill` keeps only the in-memory tail —
56
+ * the diagnostic-tail shape (a language server's stderr); including it makes
57
+ * the complete stream recoverable up to its cap (the bash tool shape).
58
+ */
59
+ interface SubprocessCollect {
60
+ /** In-memory cap in bytes; overflow keeps the TAIL. */
61
+ maxBytes: number
62
+ /** Full-stream spill file; absent disables spilling entirely. */
63
+ spill?: {
64
+ /** Whole-stream byte cap; a larger stream discards its now-incomplete spill. */
65
+ maxBytes: number
66
+ }
67
+ }
68
+ ```
69
+
70
+ ```ts type-equiv
71
+ /**
72
+ * stdout/stderr disposition. `'pipe'` exposes the raw `Readable` for the
73
+ * caller's protocol decoding; `'inherit'` passes the parent's descriptor
74
+ * through (child diagnostics land on the harness's own stream); a
75
+ * {@link SubprocessCollect} object buffers boundedly with offset-based reads.
76
+ */
77
+ type SubprocessOutputMode = 'pipe' | 'inherit' | SubprocessCollect
78
+ ```
79
+
80
+ ```ts type-equiv
81
+ /** Per-stream stdio dispositions, all explicit — this seam applies no defaults. */
82
+ interface SubprocessStdio {
83
+ stdin: SubprocessStdinMode
84
+ stdout: SubprocessOutputMode
85
+ stderr: SubprocessOutputMode
86
+ /** Request a separate byte-mode duplex channel; omission creates none. */
87
+ control?: 'pipe'
88
+ }
89
+ ```
90
+
91
+ ## 完全显式的 spawn spec
92
+
93
+ 该 seam 不应用任何默认值:每项处置方式、限制与目录都在 spec 上显式给出,因此由调用方自己的配置决定它们,而不是由某个隐藏的子进程服务默认值决定。`argv` 绝不经过 shell 解释。
94
+
95
+ ```ts type-equiv
96
+ /**
97
+ * A fully-specified spawn request. This seam applies no defaults: every
98
+ * disposition, limit, and directory is explicit, so the caller's own config —
99
+ * not a hidden subprocess-service default — decides them (the `dsh-shell`
100
+ * request/spec split is the owning template).
101
+ */
102
+ interface SubprocessSpawnSpec {
103
+ /** Executable and arguments; `argv[0]` is the program. Never shell-interpreted here. */
104
+ argv: readonly string[]
105
+ /** Working directory for the child. */
106
+ cwd: string
107
+ /** Per-stream stdio dispositions. */
108
+ stdio: SubprocessStdio
109
+ /**
110
+ * Positive finite grace period in milliseconds, no greater than
111
+ * `MAX_TIMER_DELAY_MS`, available to the provider's termination procedure
112
+ * and used for draining still-open collected pipes after the process exits
113
+ * (an inherited descriptor held by a survivor cannot hold the outcome open
114
+ * indefinitely). Providers document whether range termination is staged or
115
+ * immediate.
116
+ */
117
+ graceMs: number
118
+ /**
119
+ * Abort signal — starts the terminate escalation on the managed range when
120
+ * it fires. The caller owns deadlines and cause classification; this seam
121
+ * only reacts to the abort.
122
+ */
123
+ signal?: AbortSignal | undefined
124
+ /**
125
+ * Explicit environment entries merged onto the implementation's scrubbed
126
+ * parent base (see `scrubbedParentEnv`), with no namespace validation. A
127
+ * string is a deliberate caller opt-in, so a forwarded credential-shaped
128
+ * entry or current `DSH_*` fact survives the scrub; `undefined` is a
129
+ * tombstone that removes an ordinary ambient entry from the child.
130
+ */
131
+ env?: NodeJS.ProcessEnv | undefined
132
+ }
133
+ ```
134
+
135
+ ## 句柄:流、读取器与 managed-range 终止
136
+
137
+ spawn 会同步返回活动句柄,目标与受管范围标识则保留在 provider 内部。收集模式的读取器接受全流字节偏移量且从不消费,因此独立读取器不会抢走彼此的增量;管道化的流归调用方所有。`terminate()` 启动 provider 记录的终止过程,`waitForExit()` 观察同一个 provider-managed range;分阶段 provider 可以使用 `graceMs`,立即终止的 provider 不会等待。消费方可以在这两项操作上构建自己的分级清理流程;ACP 后端先关闭 stdin 的 `disposeAcpChild` 是参考实现。
138
+
139
+ ```ts type-equiv
140
+ /**
141
+ * A live subprocess and its provider-managed process range. Collected output
142
+ * remains readable after exit; piped streams belong to the caller.
143
+ *
144
+ * Termination and {@link SubprocessHandle.waitForExit} use the same managed
145
+ * range. Each provider documents the range it can observe and its signalling
146
+ * and observation limits.
147
+ */
148
+ interface SubprocessHandle {
149
+ /** The child's stdin, present iff spawned with `stdin: 'pipe'`. */
150
+ readonly stdin: Writable | undefined
151
+ /** The child's raw stdout, present iff spawned with `stdout: 'pipe'`. */
152
+ readonly stdout: Readable | undefined
153
+ /** The child's raw stderr, present iff spawned with `stderr: 'pipe'`. */
154
+ readonly stderr: Readable | undefined
155
+ /** Separate caller-owned byte channel when requested; native startup failure may leave it absent. */
156
+ readonly control: Duplex | undefined
157
+ /** Offset-based readers for collect-mode streams (also readable after exit). */
158
+ readonly collected: SubprocessCollectedOutputs
159
+ /** Resolves with spawned-command exit facts; rejects for spawn or provider failures. */
160
+ readonly done: Promise<SubprocessOutcome>
161
+ /**
162
+ * Begin the provider's documented termination procedure on the managed range
163
+ * — the seam's only termination verb. Idempotent, a no-op once that range is
164
+ * gone, and also triggered by the spec's abort signal.
165
+ */
166
+ terminate(): void
167
+ /**
168
+ * Wait until the same managed range is empty — not just until the spawned
169
+ * command reports its outcome, so surviving work remains observable.
170
+ * @param signal - optional bound for the wait.
171
+ * @returns `true` when the managed range is empty, `false` when the signal aborted first.
172
+ * @throws when the selected provider can no longer observe its managed range.
173
+ */
174
+ waitForExit(signal?: AbortSignal): Promise<boolean>
175
+ }
176
+ ```
177
+
178
+ ```ts type-equiv
179
+ /**
180
+ * Cursor-free incremental access to one collected output stream. Offsets are
181
+ * whole-stream byte coordinates owned by the caller, so independent readers
182
+ * cannot consume one another's output; `readFrom(0)` after settlement is the
183
+ * batch result (`lossy` then means the in-memory tail lost its head — the
184
+ * {@link CollectedOutput.truncated} fact).
185
+ */
186
+ interface SubprocessOutputReader {
187
+ /**
188
+ * Read everything captured since `fromByte`. When that offset has slid out
189
+ * of the in-memory tail window the read is `lossy` — it returns the whole
190
+ * retained tail and the gap is only recoverable from the spill file.
191
+ * @param fromByte - whole-stream offset to resume from (a prior read's `nextOffset`; 0 for the first read).
192
+ * @returns the delta text, the next offset, the `lossy` flag, and the spill path when one exists.
193
+ */
194
+ readFrom(fromByte: number): SubprocessOutputRead
195
+ }
196
+ ```
197
+
198
+ ```ts type-equiv
199
+ /** One incremental {@link SubprocessOutputReader.readFrom} read. */
200
+ interface SubprocessOutputRead {
201
+ /** Stream text from the requested offset (the whole retained tail when lossy). */
202
+ text: string
203
+ /** Whole-stream offset to resume from on the next read. */
204
+ nextOffset: number
205
+ /** True when the requested offset slid out of the in-memory tail window. */
206
+ lossy: boolean
207
+ /** Path to the full-stream spill file, when one was created and remains intact. */
208
+ spillPath?: string
209
+ }
210
+ ```
211
+
212
+ ```ts type-equiv
213
+ /** Offset-based readers for the streams spawned in collect mode. */
214
+ interface SubprocessCollectedOutputs {
215
+ /** Present iff stdout is a {@link SubprocessCollect}. */
216
+ readonly stdout?: SubprocessOutputReader
217
+ /** Present iff stderr is a {@link SubprocessCollect}. */
218
+ readonly stderr?: SubprocessOutputReader
219
+ }
220
+ ```
221
+
222
+
223
+ ## 结果只承载退出事实
224
+
225
+ `done` 报告 Node close 事件的词汇,不携带原因分类:服务会在中止时终止进程,但绝不判定原因(调用方读取归自己所有的 deadline 信号,例如 bash 执行器的 `timedOut`/`aborted` 拆分)。收集到的输出在结算后仍可经 `handle.collected` 读取,因此批量与流式调用方共用一条访问路径。
226
+
227
+ ```ts type-equiv
228
+ /**
229
+ * Exit facts of one closed process — Node's `close`-event vocabulary.
230
+ * Deliberately carries NO timeout or cancellation classification (the caller
231
+ * reads the signal it owns to classify causes) and NO output: collected
232
+ * streams stay readable through {@link SubprocessHandle.collected} after
233
+ * settlement, so batch and streaming callers share one access path.
234
+ */
235
+ interface SubprocessOutcome {
236
+ /** Exit code; null when the process died from a signal. */
237
+ exitCode: number | null
238
+ /** Terminating signal (e.g. 'SIGTERM'); null on normal exit. */
239
+ signal: NodeJS.Signals | null
240
+ }
241
+ ```
242
+
243
+ ## 终端进程原语
244
+
245
+ `spawnTerminal(spec)` 是非管道进程原语。提供方分配控制终端,并负责 UTF-8 文本传输、前台进程组检查与信号发送,以及一项须等待的 TERM→KILL 操作;该操作会使提供方仍可观察到的每个会话成员完全停稳,提供方则会记录执行基底特有的可观察性限制。PTY 后端仍负责提示符检测、就绪推断、scrollback、沙箱策略和持久会话所有权;普通 `spawn()` 无法重建控制终端语义。
246
+
247
+ 终端 spec 完全指定 argv、cwd、环境覆盖、终端类型、尺寸、清理宽限期与可选的分配取消和 shell 活动观察。其句柄公开 `pid`、有序输出、`done`、`write`、`resize`、`inspectForeground`、`inspectActivity`、`signalForeground` 和须等待的 `terminate`;[`SubprocessTerminalSpawnSpec` 与 `SubprocessTerminalHandle`](../../packages/subprocess/subprocess/src/types.ts) 定义这些字段和操作。`resize(cols, rows)` 更新正在运行的 PTY 尺寸,进程退出后拒绝调用。
248
+
249
+ `inspectActivity()` 返回 `SubprocessTerminalActivity`:`state` 为 `idle`、`busy` 或 `unknown`,`revision` 随 provider 观察到的活动或输入变化。终端请求通过 `shellActivity` 启用受支持的 shell 生命周期观察;各 provider 的支持范围和保守返回 unknown 的情况见 [subprocess-local](../../packages/subprocess/subprocess-local/README.zh.md#running-terminal-sessions)。
250
+
251
+ `terminalEnvironment(signal?)` 返回 `SubprocessTerminalEnvironment`:执行环境平台(`posix` 或 `windows`)与可选的 `defaultShell`。这些事实来自提供方,而非 Web 服务器或浏览器。`resolveExecutable` 验证候选 shell;`SubprocessExecutableNotFoundError` 表示可执行文件不存在,提供方与传输故障仍作为错误报告。
252
+
253
+ ## 服务行为
254
+
255
+ 抽象的 [`SubprocessRuntime`](../../packages/subprocess/subprocess/src/index.ts) Service Definition 规定执行世界坐标、可执行文件查找、普通 `spawn` 与 `spawnTerminal`。[`LocalSubprocessRuntime`](../../packages/subprocess/subprocess-local/src/index.ts) 以平台选择的 managed range、按处置方式接线、凭据清除、`node-pty`、平台进程检查,以及先终止再等待退出的资源释放提供这些能力。Service Definition 约定见 [`dsh-subprocess`](../../packages/subprocess/subprocess/README.zh.md),本地机制见 [`dsh-subprocess-local`](../../packages/subprocess/subprocess-local/README.zh.md)。
256
+
257
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
258
+
259
+ <a id="cordis-surface"></a>
260
+
261
+ ## Cordis API
262
+
263
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
264
+
265
+ <a id="ctxsubprocess--subprocessruntime-abstract-seam"></a>
266
+
267
+ ### `ctx.subprocess` — `SubprocessRuntime` (abstract seam)
268
+
269
+ Abstract subprocess service. Subclass, implement spawn, and load the subclass as a plugin — it registers as `ctx.subprocess` (one implementation per context; loading a second throws, which is cordis' standard duplicate-service behavior).
270
+
271
+ Implementations must honor these semantics:
272
+
273
+ - Executable paths belong to one execution world shared with the mounted filesystem provider.
274
+ - spawn returns a live handle synchronously. Target identity remains provider-private; `done` resolves with the spawned command's exit facts and may reject for spawn or provider failures.
275
+ - Collect-mode readers are offset-based and non-consuming, so independent readers never consume one another's output; lossy reads report truncation and the spill file holding the complete stream when one exists. Piped streams are handed to the caller raw and never buffered here.
276
+ - SubprocessHandle.terminate (and the spec's abort signal) starts the provider's documented procedure against its managed range. SubprocessHandle.waitForExit observes that same range so a consumer-owned teardown ladder can hold each tier on real quiescence; each provider documents its signalling and observability limits.
277
+ - Disposal of the service terminates all still-running managed processes and awaits their exit.
278
+ - spawnTerminal owns terminal allocation, text transport, foreground groups, signalling, and whole-session quiescence behind one awaited termination method; readiness and persistent-shell policy stay in the PTY consumer. Its output stream ends after queued terminal output when the top-level process exits.
279
+
280
+ ```ts cordis-catalog
281
+ /**
282
+ * Resolve one configured executable in this provider's execution world.
283
+ * Absolute paths are verified; bare names use the provider's scrubbed PATH
284
+ * plus explicit environment overrides. Relative paths containing separators
285
+ * are rejected: the resolution base is undefined, so providers fail loud
286
+ * instead of guessing.
287
+ * @param command - absolute executable path or bare PATH name.
288
+ * @param env - explicit environment entries used for lookup.
289
+ * @param signal - aborts remote or local lookup.
290
+ * @returns a canonical executable path.
291
+ */
292
+ abstract resolveExecutable( command: string, env?: Readonly<Record<string, string>>, signal?: AbortSignal, ): Promise<string>
293
+
294
+ /**
295
+ * Inspect shell-selection facts in the provider's execution environment.
296
+ * @param signal - cancellation of remote environment inspection.
297
+ * @returns platform and preferred shell; executable lookup and allocation remain separate operations.
298
+ */
299
+ abstract terminalEnvironment(signal?: AbortSignal): Promise<SubprocessTerminalEnvironment>
300
+
301
+ /**
302
+ * Start one managed child process from a fully-specified spec; this seam
303
+ * applies no defaults.
304
+ * @param spec - argv, directory, stdio dispositions, grace, cancellation, and environment.
305
+ * @returns the live process handle (streams/readers, signalling, outcome promise).
306
+ * @throws synchronously when pre-aborted or when argv, cwd, environment, or grace is invalid before handle creation.
307
+ */
308
+ abstract spawn(spec: SubprocessSpawnSpec): SubprocessHandle
309
+
310
+ /**
311
+ * Allocate a real terminal and start one owned process session. This is the
312
+ * only non-pipe process primitive: implementations own terminal byte I/O,
313
+ * foreground groups, signals, and whole-session quiescence.
314
+ * @param spec - fully specified argv, cwd, environment, dimensions, grace, and allocation cancellation.
315
+ * @returns the live terminal handle after allocation succeeds.
316
+ */
317
+ abstract spawnTerminal(spec: SubprocessTerminalSpawnSpec): Promise<SubprocessTerminalHandle>
318
+ ```
319
+
320
+ Source: [`packages/subprocess/subprocess/src/index.ts`](../../packages/subprocess/subprocess/src/index.ts)
321
+ <!-- END GENERATED cordis-surface -->