dsh-plugin-dev-kb 1.0.0

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 (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/cordis.patch.yml +12 -0
  4. package/kb/INDEX.md +210 -0
  5. package/kb/README.md +69 -0
  6. package/kb/extra/AGENTS.md +75 -0
  7. package/kb/extra/api-gateway.md +164 -0
  8. package/kb/extra/api-gateway.zh.md +164 -0
  9. package/kb/extra/cookbook/adding-a-vendored-package.md +59 -0
  10. package/kb/extra/cookbook/adding-a-vendored-package.zh.md +59 -0
  11. package/kb/extra/cookbook/maintaining-dsh-code-review.md +64 -0
  12. package/kb/extra/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  13. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  14. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  15. package/kb/extra/defensive-patterns.md +33 -0
  16. package/kb/extra/defensive-patterns.zh.md +33 -0
  17. package/kb/extra/development.md +171 -0
  18. package/kb/extra/development.zh.md +171 -0
  19. package/kb/extra/event-producer-consumer.md +76 -0
  20. package/kb/extra/event-producer-consumer.zh.md +78 -0
  21. package/kb/extra/glossary.md +45 -0
  22. package/kb/extra/glossary.zh.md +45 -0
  23. package/kb/extra/graph-atlas.md +24 -0
  24. package/kb/extra/graph-atlas.zh.md +26 -0
  25. package/kb/extra/i18n/README.md +60 -0
  26. package/kb/extra/i18n/README.zh.md +60 -0
  27. package/kb/extra/i18n/style-samples.md +87 -0
  28. package/kb/extra/i18n/terminology.md +214 -0
  29. package/kb/extra/i18n/translation-prompt.md +263 -0
  30. package/kb/extra/i18n/translation-rules.md +69 -0
  31. package/kb/extra/i18n/translation-rules.zh.md +69 -0
  32. package/kb/extra/module-graph.md +1641 -0
  33. package/kb/extra/module-graph.zh.md +1643 -0
  34. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  35. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  36. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  37. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  38. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  39. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  40. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  41. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  42. package/kb/extra/postmortem/README.md +18 -0
  43. package/kb/extra/postmortem/README.zh.md +18 -0
  44. package/kb/extra/rescope.md +53 -0
  45. package/kb/extra/rescope.zh.md +53 -0
  46. package/kb/extra/subsystems/attachment.md +125 -0
  47. package/kb/extra/subsystems/attachment.zh.md +125 -0
  48. package/kb/extra/subsystems/extensions.md +364 -0
  49. package/kb/extra/subsystems/extensions.zh.md +364 -0
  50. package/kb/extra/subsystems/feedback.md +266 -0
  51. package/kb/extra/subsystems/feedback.zh.md +266 -0
  52. package/kb/extra/testing.md +49 -0
  53. package/kb/extra/testing.zh.md +49 -0
  54. package/kb/extra/web-styling.md +25 -0
  55. package/kb/extra/web-styling.zh.md +25 -0
  56. package/kb/meta/search-index.json +1328 -0
  57. package/kb/meta/site-pages.txt +168 -0
  58. package/kb/meta/source.json +13 -0
  59. package/kb/meta/topics.md +75 -0
  60. package/kb/site/develop/basic/config.md +108 -0
  61. package/kb/site/develop/basic/index.md +146 -0
  62. package/kb/site/develop/basic/publish.md +185 -0
  63. package/kb/site/develop/basic/tool.md +54 -0
  64. package/kb/site/develop/cordis-tutorial/01-first-plugin.md +95 -0
  65. package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  66. package/kb/site/develop/cordis-tutorial/03-services.md +98 -0
  67. package/kb/site/develop/cordis-tutorial/04-events.md +144 -0
  68. package/kb/site/develop/cordis-tutorial/05-config.md +84 -0
  69. package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
  70. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +107 -0
  71. package/kb/site/develop/cordis-tutorial/index.md +62 -0
  72. package/kb/site/develop/framework/events.md +145 -0
  73. package/kb/site/develop/framework/index.md +139 -0
  74. package/kb/site/develop/framework/service.md +152 -0
  75. package/kb/site/develop/practice/index.md +157 -0
  76. package/kb/site/develop/practice/llm-adapter.md +190 -0
  77. package/kb/site/en/develop/basic/config.md +108 -0
  78. package/kb/site/en/develop/basic/index.md +146 -0
  79. package/kb/site/en/develop/basic/publish.md +185 -0
  80. package/kb/site/en/develop/basic/tool.md +54 -0
  81. package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +95 -0
  82. package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  83. package/kb/site/en/develop/cordis-tutorial/03-services.md +98 -0
  84. package/kb/site/en/develop/cordis-tutorial/04-events.md +144 -0
  85. package/kb/site/en/develop/cordis-tutorial/05-config.md +84 -0
  86. package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
  87. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +107 -0
  88. package/kb/site/en/develop/cordis-tutorial/index.md +60 -0
  89. package/kb/site/en/develop/framework/events.md +145 -0
  90. package/kb/site/en/develop/framework/index.md +139 -0
  91. package/kb/site/en/develop/framework/service.md +150 -0
  92. package/kb/site/en/develop/practice/index.md +157 -0
  93. package/kb/site/en/develop/practice/llm-adapter.md +190 -0
  94. package/kb/site/en/guide/providers-custom-form.png +0 -0
  95. package/kb/site/en/guide/providers-models-page.png +0 -0
  96. package/kb/site/en/guide/providers.md +100 -0
  97. package/kb/site/en/guide/python-sdk.md +106 -0
  98. package/kb/site/en/guide/quickstart.md +32 -0
  99. package/kb/site/en/index.md +8 -0
  100. package/kb/site/en/reference/agent-lifecycle.md +86 -0
  101. package/kb/site/en/reference/capability-seams.md +475 -0
  102. package/kb/site/en/reference/config-catalog.md +3155 -0
  103. package/kb/site/en/reference/cookbook/adding-a-conversation-node.md +235 -0
  104. package/kb/site/en/reference/cookbook/adding-a-package.md +120 -0
  105. package/kb/site/en/reference/cookbook/adding-a-settings-card.md +102 -0
  106. package/kb/site/en/reference/cookbook/adding-a-tool.md +96 -0
  107. package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +45 -0
  108. package/kb/site/en/reference/cookbook/extension-cookbook.md +131 -0
  109. package/kb/site/en/reference/cordis-api/context.md +368 -0
  110. package/kb/site/en/reference/cordis-api/events.md +211 -0
  111. package/kb/site/en/reference/cordis-api/fiber.md +379 -0
  112. package/kb/site/en/reference/cordis-api/inherited.md +43 -0
  113. package/kb/site/en/reference/cordis-api/registry.md +156 -0
  114. package/kb/site/en/reference/cordis-api/service.md +106 -0
  115. package/kb/site/en/reference/cordis-primer.md +46 -0
  116. package/kb/site/en/reference/index.md +131 -0
  117. package/kb/site/en/reference/persistence-catalog.md +949 -0
  118. package/kb/site/en/reference/subsystems/approval.md +173 -0
  119. package/kb/site/en/reference/subsystems/client-modules.md +121 -0
  120. package/kb/site/en/reference/subsystems/code-runtime.md +194 -0
  121. package/kb/site/en/reference/subsystems/commands.md +190 -0
  122. package/kb/site/en/reference/subsystems/compaction.md +241 -0
  123. package/kb/site/en/reference/subsystems/core.md +1073 -0
  124. package/kb/site/en/reference/subsystems/credentials.md +136 -0
  125. package/kb/site/en/reference/subsystems/filesystem.md +498 -0
  126. package/kb/site/en/reference/subsystems/goal.md +280 -0
  127. package/kb/site/en/reference/subsystems/index.md +58 -0
  128. package/kb/site/en/reference/subsystems/invariants.md +91 -0
  129. package/kb/site/en/reference/subsystems/jobs.md +293 -0
  130. package/kb/site/en/reference/subsystems/llm-streaming.md +920 -0
  131. package/kb/site/en/reference/subsystems/lsp.md +205 -0
  132. package/kb/site/en/reference/subsystems/permission-presets.md +134 -0
  133. package/kb/site/en/reference/subsystems/persistence.md +388 -0
  134. package/kb/site/en/reference/subsystems/plan.md +90 -0
  135. package/kb/site/en/reference/subsystems/sandbox.md +221 -0
  136. package/kb/site/en/reference/subsystems/schedule.md +189 -0
  137. package/kb/site/en/reference/subsystems/scope.md +62 -0
  138. package/kb/site/en/reference/subsystems/session-projection.md +265 -0
  139. package/kb/site/en/reference/subsystems/session-query.md +498 -0
  140. package/kb/site/en/reference/subsystems/session-reference.md +111 -0
  141. package/kb/site/en/reference/subsystems/session-telemetry.md +197 -0
  142. package/kb/site/en/reference/subsystems/session-title.md +207 -0
  143. package/kb/site/en/reference/subsystems/session.md +852 -0
  144. package/kb/site/en/reference/subsystems/settings.md +313 -0
  145. package/kb/site/en/reference/subsystems/shell.md +306 -0
  146. package/kb/site/en/reference/subsystems/skills.md +334 -0
  147. package/kb/site/en/reference/subsystems/spill.md +120 -0
  148. package/kb/site/en/reference/subsystems/storage.md +232 -0
  149. package/kb/site/en/reference/subsystems/subagent.md +737 -0
  150. package/kb/site/en/reference/subsystems/subprocess.md +327 -0
  151. package/kb/site/en/reference/subsystems/system-prompt.md +210 -0
  152. package/kb/site/en/reference/subsystems/terminal.md +187 -0
  153. package/kb/site/en/reference/subsystems/token-meter.md +93 -0
  154. package/kb/site/en/reference/subsystems/tools.md +723 -0
  155. package/kb/site/en/reference/subsystems/typert.md +339 -0
  156. package/kb/site/en/reference/subsystems/user-questions.md +181 -0
  157. package/kb/site/en/reference/subsystems/web-server.md +111 -0
  158. package/kb/site/en/reference/subsystems/web.md +202 -0
  159. package/kb/site/en/reference/subsystems/workflow.md +281 -0
  160. package/kb/site/en/reference/subsystems/workspace.md +231 -0
  161. package/kb/site/en/reference/tool-catalog.md +1877 -0
  162. package/kb/site/en/reference/tool-execution-pipeline.md +66 -0
  163. package/kb/site/guide/providers-custom-form.zh.png +0 -0
  164. package/kb/site/guide/providers-models-page.zh.png +0 -0
  165. package/kb/site/guide/providers.md +100 -0
  166. package/kb/site/guide/python-sdk.md +106 -0
  167. package/kb/site/guide/quickstart.md +32 -0
  168. package/kb/site/index.md +8 -0
  169. package/kb/site/reference/agent-lifecycle.md +86 -0
  170. package/kb/site/reference/capability-seams.md +475 -0
  171. package/kb/site/reference/config-catalog.md +3154 -0
  172. package/kb/site/reference/cookbook/adding-a-conversation-node.md +235 -0
  173. package/kb/site/reference/cookbook/adding-a-package.md +120 -0
  174. package/kb/site/reference/cookbook/adding-a-settings-card.md +102 -0
  175. package/kb/site/reference/cookbook/adding-a-tool.md +98 -0
  176. package/kb/site/reference/cookbook/adding-an-llm-adapter.md +45 -0
  177. package/kb/site/reference/cookbook/extension-cookbook.md +133 -0
  178. package/kb/site/reference/cordis-api/context.md +368 -0
  179. package/kb/site/reference/cordis-api/events.md +211 -0
  180. package/kb/site/reference/cordis-api/fiber.md +379 -0
  181. package/kb/site/reference/cordis-api/inherited.md +43 -0
  182. package/kb/site/reference/cordis-api/registry.md +156 -0
  183. package/kb/site/reference/cordis-api/service.md +106 -0
  184. package/kb/site/reference/cordis-primer.md +52 -0
  185. package/kb/site/reference/index.md +135 -0
  186. package/kb/site/reference/persistence-catalog.md +949 -0
  187. package/kb/site/reference/subsystems/approval.md +173 -0
  188. package/kb/site/reference/subsystems/client-modules.md +121 -0
  189. package/kb/site/reference/subsystems/code-runtime.md +194 -0
  190. package/kb/site/reference/subsystems/commands.md +190 -0
  191. package/kb/site/reference/subsystems/compaction.md +241 -0
  192. package/kb/site/reference/subsystems/core.md +1081 -0
  193. package/kb/site/reference/subsystems/credentials.md +136 -0
  194. package/kb/site/reference/subsystems/filesystem.md +498 -0
  195. package/kb/site/reference/subsystems/goal.md +280 -0
  196. package/kb/site/reference/subsystems/index.md +58 -0
  197. package/kb/site/reference/subsystems/invariants.md +91 -0
  198. package/kb/site/reference/subsystems/jobs.md +293 -0
  199. package/kb/site/reference/subsystems/llm-streaming.md +926 -0
  200. package/kb/site/reference/subsystems/lsp.md +205 -0
  201. package/kb/site/reference/subsystems/permission-presets.md +134 -0
  202. package/kb/site/reference/subsystems/persistence.md +388 -0
  203. package/kb/site/reference/subsystems/plan.md +90 -0
  204. package/kb/site/reference/subsystems/sandbox.md +221 -0
  205. package/kb/site/reference/subsystems/schedule.md +189 -0
  206. package/kb/site/reference/subsystems/scope.md +62 -0
  207. package/kb/site/reference/subsystems/session-projection.md +265 -0
  208. package/kb/site/reference/subsystems/session-query.md +498 -0
  209. package/kb/site/reference/subsystems/session-reference.md +111 -0
  210. package/kb/site/reference/subsystems/session-telemetry.md +197 -0
  211. package/kb/site/reference/subsystems/session-title.md +207 -0
  212. package/kb/site/reference/subsystems/session.md +854 -0
  213. package/kb/site/reference/subsystems/settings.md +313 -0
  214. package/kb/site/reference/subsystems/shell.md +306 -0
  215. package/kb/site/reference/subsystems/skills.md +334 -0
  216. package/kb/site/reference/subsystems/spill.md +120 -0
  217. package/kb/site/reference/subsystems/storage.md +232 -0
  218. package/kb/site/reference/subsystems/subagent.md +739 -0
  219. package/kb/site/reference/subsystems/subprocess.md +327 -0
  220. package/kb/site/reference/subsystems/system-prompt.md +210 -0
  221. package/kb/site/reference/subsystems/terminal.md +187 -0
  222. package/kb/site/reference/subsystems/token-meter.md +93 -0
  223. package/kb/site/reference/subsystems/tools.md +723 -0
  224. package/kb/site/reference/subsystems/typert.md +339 -0
  225. package/kb/site/reference/subsystems/user-questions.md +181 -0
  226. package/kb/site/reference/subsystems/web-server.md +111 -0
  227. package/kb/site/reference/subsystems/web.md +202 -0
  228. package/kb/site/reference/subsystems/workflow.md +281 -0
  229. package/kb/site/reference/subsystems/workspace.md +231 -0
  230. package/kb/site/reference/tool-catalog.md +1880 -0
  231. package/kb/site/reference/tool-execution-pipeline.md +66 -0
  232. package/package.json +40 -0
  233. package/scripts/rebuild-index.mjs +88 -0
  234. package/skills/dsh-plugin-dev-kb.md +66 -0
@@ -0,0 +1,100 @@
1
+ ---
2
+ editSource: "docs/user/guide/providers.md"
3
+ ---
4
+
5
+ # Configure models
6
+
7
+ This guide assumes you started the Web UI through the [root README](https://github.com/deepseek-ai/deepseek-harness/blob/master/README.md#run). Model changes take effect on the next request without restarting the server.
8
+
9
+ ## Configure DeepSeek
10
+
11
+ Open **Settings → Models**. The DeepSeek card exposes one API-key field; enter the key and save it.
12
+
13
+ ![The Models page: the DeepSeek card, with Add provider and Add a custom provider below it](./providers-models-page.png)
14
+
15
+ Keys are write-only. The page receives a redacted descriptor after saving, never the literal secret. The key is stored in `$DSH_HOME/.credentials.yaml`, while settings retain only its credential reference.
16
+
17
+ ## Add a catalog provider
18
+
19
+ Choose **Add provider**, select a provider such as Anthropic or OpenAI, enter its API key, and save. The installed catalog supplies the endpoint, protocol, and model list.
20
+
21
+ Providers with native authentication need their native credentials instead. Bedrock, Vertex, Azure, and Codex use AWS credentials and a region, an ADC project, an `api-version`, and OAuth respectively; filling only the API-key field does not configure them.
22
+
23
+ ## Add a custom provider
24
+
25
+ Choose **Add a custom provider** for a company gateway, self-hosted server, or provider absent from the installed catalog. Supply a lowercase Provider ID, base URL, API protocol, credential, and at least one model.
26
+
27
+ ![The custom provider form: Provider ID, display name, base URL, API protocol, and API key](./providers-custom-form.png)
28
+
29
+ The Provider ID is permanent because requests, saved sessions, model defaults, and credential references use it. To rename a provider, add a new provider and delete the old one. The display name, base URL, protocol, credential, and models remain editable.
30
+
31
+ Under **Model catalog**, choose **Fetch available models** to query the base URL and credential currently shown in the form. Selecting candidates updates the draft; the provider is not stored until you save. Catalog providers use their installed catalog without a network request.
32
+
33
+ ### Image input
34
+
35
+ A model you enter by hand is treated as text-only until it says otherwise, because nothing can ask an endpoint which modalities it accepts. Attaching an image to such a model is refused before it is sent, naming the model.
36
+
37
+ A vision model on a custom provider therefore needs one line. The form has no field for it; add `input` to the model in `$DSH_HOME/settings.yaml`:
38
+
39
+ ```yaml
40
+ llm-pi-ai:
41
+ providers:
42
+ my-gateway:
43
+ apiKeyEnv: GATEWAY_API_KEY
44
+ api: openai-completions
45
+ baseURL: https://gateway.example/v1
46
+ models:
47
+ - id: legacy-chat
48
+ - id: vision-preview
49
+ input: [text, image]
50
+ ```
51
+
52
+ `input` accepts `text` and `image`, and applies to that model alone, so one route can serve both kinds. Omitting it — or writing an empty list, which means the same thing — keeps whatever the installed catalog records for that model, and falls back to the route's `defaultInput` for a model the catalog does not describe.
53
+
54
+ If every model you entered by hand takes images, set the fallback once on the route instead of on each of them:
55
+
56
+ ```yaml
57
+ llm-pi-ai:
58
+ providers:
59
+ vision-gateway:
60
+ apiKeyEnv: GATEWAY_API_KEY
61
+ api: openai-completions
62
+ baseURL: https://vision.example/v1
63
+ defaultInput: [text, image]
64
+ models:
65
+ - id: first-model
66
+ - id: second-model
67
+ ```
68
+
69
+ `defaultInput` is a fallback, not an override, and defaults to `[text]`: on a catalog provider it answers only for models the catalog does not describe, so it never removes images from a catalog model that has them. Narrow one of those with that model's own `input`. A catalog provider has no `models` list to put it in, so write it under `modelOverrides`, keyed by model id:
70
+
71
+ ```yaml
72
+ llm-pi-ai:
73
+ providers:
74
+ anthropic:
75
+ modelOverrides:
76
+ claude-sonnet-4-5:
77
+ input: [text]
78
+ ```
79
+
80
+ Every list must name at least one modality except a model's own, where an empty list means the same as omitting it. An unknown modality is refused wherever it is written.
81
+
82
+ Both fields state a claim about your endpoint rather than checking it. A model that declares images its endpoint does not serve is not caught here; the provider rejects the request instead.
83
+
84
+ ## Select a model
85
+
86
+ Configured providers appear in the model picker. Selecting a model also makes it the default for new sessions. A session that has already sent a request retains the model recorded in its own log.
87
+
88
+ If a saved default names a provider that was deleted, the composer displays **Select model** and blocks input until another model is selected.
89
+
90
+ ## Troubleshooting
91
+
92
+ - **`MISSING_CREDENTIAL`** — Store the provider key through the Models page or supply the referenced environment variable.
93
+ - **`UNKNOWN_MODEL`** — Select a configured model or add the missing model to the custom provider.
94
+ - **Fetching available models returns 401** — Check the key. Model discovery calls the OpenAI-compatible `GET /models` endpoint; enter models manually for endpoints that do not provide it.
95
+ - **An image is refused before sending** — The model declares no image modality. Give a custom provider's model `input: [text, image]`; DeepSeek's own chat-completions route is text-only and cannot be configured otherwise.
96
+ - **The provider rejects a request carrying an image** — The model declares images its endpoint does not actually serve. Remove `image` from whichever list granted it — the model's `input`, or the route's `defaultInput` — then start a new session: the attached image stays in the session log, so the same request repeats until the session moves off it.
97
+
98
+ ## Advanced configuration
99
+
100
+ The generated [plugin configuration catalog](../reference/config-catalog.md) lists every supported field and default. The [`dsh-llm-pi-ai`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-pi-ai/README.md) and [`dsh-llm-deepseek`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-deepseek/README.md) references own direct `settings.yaml` configuration, catalog resolution, reasoning controls, credentials, and adapter errors.
@@ -0,0 +1,106 @@
1
+ ---
2
+ editSource: "docs/user/guide/python-sdk.md"
3
+ ---
4
+
5
+ # Get started with the Python SDK
6
+
7
+ This tutorial is the programmatic alternative to the Web UI. It installs the published Python SDK, runs a checked-in agent composition, and shows how to call the same API from your own program.
8
+
9
+ ## Prerequisites
10
+
11
+ - Python 3.10 or newer
12
+ - Git
13
+ - Linux x64, Linux arm64, or macOS 14 or newer on arm64
14
+ - A DeepSeek-compatible API endpoint and credential
15
+ - An isolated workspace that the agent may modify
16
+
17
+ ## Install the SDK
18
+
19
+ Clone the repository for its runnable example, create a virtual environment, and install the SDK with its same-version bundled runtime:
20
+
21
+ ```sh
22
+ git clone https://github.com/deepseek-ai/deepseek-harness.git
23
+ cd deepseek-harness
24
+ python -m venv .venv
25
+ . .venv/bin/activate
26
+ python -m pip install deepseek-harness-sdk
27
+ ```
28
+
29
+ The installed runtime needs no system Node.js. Repository contributors who need to build the runtime or wheels from source should use the [Python contributor workflows](https://github.com/deepseek-ai/deepseek-harness/blob/master/python/development.md).
30
+
31
+ ## Run the checked-in example
32
+
33
+ Set the credential in the environment. Set `DEEPSEEK_BASE_URL` as well when the model is served by an OpenAI-compatible proxy rather than the default DeepSeek endpoint.
34
+
35
+ ```sh
36
+ export DEEPSEEK_API_KEY=sk-your-key-here
37
+ # export DEEPSEEK_BASE_URL=http://127.0.0.1:8000/v1
38
+ # export DSH_MODEL=deepseek-v4-flash
39
+ # export DSH_SYSTEM_PROMPT='You are a helpful software engineer assistant.'
40
+ ```
41
+
42
+ Run one task against an isolated workspace and session directory:
43
+
44
+ ```sh
45
+ python examples/jsonrpc-agent/minimal.py \
46
+ --workspace /absolute/path/to/workspace \
47
+ --session-root /absolute/path/to/sessions \
48
+ --session-id example-001 \
49
+ "Inspect the repository and fix the failing tests."
50
+ ```
51
+
52
+ The script prints the final assistant response. The session directory receives a JSONL log containing the assembled model requests and tool calls.
53
+
54
+ ## Use the SDK in your own program
55
+
56
+ The checked-in example is a thin wrapper around this SDK call:
57
+
58
+ ```python
59
+ from pathlib import Path
60
+
61
+ from deepseek_harness import DeepSeekHarness
62
+
63
+ config = Path("examples/jsonrpc-agent/minimal.cordis.yml").resolve()
64
+ workspace = Path("/absolute/path/to/workspace").resolve()
65
+ sessions = Path("/absolute/path/to/sessions").resolve()
66
+
67
+ with DeepSeekHarness(
68
+ provider="deepseek-official",
69
+ model="deepseek-v4-flash",
70
+ max_tokens=49_152,
71
+ cwd=str(workspace),
72
+ session_root=str(sessions),
73
+ cordis=str(config),
74
+ ) as harness:
75
+ result = harness.run(
76
+ "Inspect the repository and fix the failing tests.",
77
+ session_id="example-001",
78
+ )
79
+
80
+ print(result.final_response)
81
+ ```
82
+
83
+ `DeepSeekHarness` starts the bundled runtime lazily and reuses it until the context manager exits. Reusing the same harness and session id preserves the session-owned Bash process, including its working directory, exported variables, and shell functions. Use a fresh session id for an independent task; reuse an id only when the next call should continue the same durable conversation.
84
+
85
+ ## Understand the example composition
86
+
87
+ | Property | Value |
88
+ |---|---|
89
+ | System prompt | `DSH_SYSTEM_PROMPT`, falling back to `You are a helpful software engineer assistant.` |
90
+ | Model in `minimal.py` | `--model`, then `DSH_MODEL`, then `deepseek-v4-flash` |
91
+ | Model-facing tools | Persistent `bash` and `str_replace_editor` only |
92
+ | Bash timeout | 300 seconds |
93
+ | Editor output limit | 16,000 characters |
94
+ | Context compaction | Disabled |
95
+ | Filesystem | Bare local backend; absolute editor paths may address any path visible to the runtime process |
96
+ | Session persistence | Uncompressed JSONL under `DSH_SESSION_ROOT` |
97
+
98
+ The composition omits harness identity, workspace prompt text, skills, one-shot Bash, task tools, compaction, and every other model-facing plugin. Sandbox-policy facts are logged as runtime user context rather than appended to the system prompt.
99
+
100
+ ## Choose workspace and session IDs
101
+
102
+ `cwd` selects the workspace available to the agent, while `session_root` stores session logs and state. Use a fresh session id for an independent task; reuse an id only when the next call should continue the same conversation and persistent shell state.
103
+
104
+ The composition uses `danger-full-access`. Run it only inside a disposable checkout or container: Bash and the editor can modify any path allowed to the runtime process. The persistent PTY backend requires a POSIX terminal substrate, so this composition does not support Windows agents.
105
+
106
+ The [`jsonrpc-agent` example reference](https://github.com/deepseek-ai/deepseek-harness/blob/master/examples/jsonrpc-agent/README.md) owns the exact composition. The [Python SDK reference](https://github.com/deepseek-ai/deepseek-harness/blob/master/python/sdk/README.md) covers lifecycle, results, notifications, runtime selection, and configuration; the [Cordis primer](../reference/cordis-primer.md) covers composition syntax.
@@ -0,0 +1,32 @@
1
+ ---
2
+ editSource: "docs/user/guide/index.md"
3
+ ---
4
+
5
+ # Use the Web UI
6
+
7
+ Start the Web UI through the [root README](https://github.com/deepseek-ai/deepseek-harness/blob/master/README.md#run); the command prints its URL. This guide begins after that server is running. The `dsh` process uses its invoking directory as the default filesystem location, but a fresh Web UI has no selected workspace until you add one.
8
+
9
+ ## Configure a model
10
+
11
+ Open **Settings → Models**, enter a [DeepSeek API key](https://platform.deepseek.com/), and save it. The model route becomes usable immediately without restarting the server.
12
+
13
+ The [model configuration guide](./providers.md) covers other providers and custom OpenAI-compatible endpoints.
14
+
15
+ ## Choose a workspace
16
+
17
+ Click **Choose workspace**, add the project directory where you started `dsh`, and select it. The session composer remains unavailable until a workspace is selected.
18
+
19
+ ## Run a task
20
+
21
+ Start a session and send:
22
+
23
+ > Summarize this repository and identify its main packages.
24
+
25
+ The agent can read and edit workspace files, run commands, delegate work, and maintain a plan. The Web UI asks before operations that require approval under the active permission policy.
26
+
27
+ ## Continue
28
+
29
+ - [Configure models](./providers.md)
30
+ - [Use the Python SDK](./python-sdk.md)
31
+ - [Use other CLI modes](https://github.com/deepseek-ai/deepseek-harness/blob/master/apps/cli/README.md)
32
+ - [Develop a plugin](../develop/basic/index.md)
@@ -0,0 +1,8 @@
1
+ ---
2
+ editSource: "docs/user/index.md"
3
+ layout: false
4
+ head:
5
+ - - meta
6
+ - http-equiv: refresh
7
+ content: 0; url=./guide/quickstart
8
+ ---
@@ -0,0 +1,86 @@
1
+ ---
2
+ editSource: "docs/agent-lifecycle.md"
3
+ ---
4
+
5
+ <!-- Generated by scripts/gen-doc-graphs.ts - do not edit by hand.
6
+ Run `pnpm run gen-doc-graphs` to regenerate. -->
7
+
8
+ # Agent Turn And Step Lifecycle
9
+
10
+ This sequence is the visual companion to [architecture.md](./index.md#turn-flow). It keeps durable replay facts on `session/event` and live control/status on `agent/*`.
11
+
12
+ ```mermaid
13
+ sequenceDiagram
14
+ participant User
15
+ participant Agent
16
+ participant Driver
17
+ participant Hooks as hook listeners
18
+ participant Prompt as ctx.systemPrompt
19
+ participant LLM as ctx.llm
20
+ participant Tools as ctx.tools
21
+ participant Session
22
+ participant SDK as UI or SDK listener
23
+ User->>Agent: followup(content)
24
+ Agent-->>SDK: <code>agent/inbox/spliced</code>
25
+ Agent-->>SDK: <code>agent/inbox/inserted</code> { message }
26
+ Agent->>Driver: queued work wakes driver
27
+ Driver-->>SDK: <code>agent/status</code> running
28
+ Driver->>Session: <code>turn/start</code>
29
+ Note over Agent,Driver: claim pending next-step input plus one queued prompt
30
+ Driver-->>SDK: <code>agent/inbox/spliced</code> pure deletion
31
+ Driver-->>SDK: <code>agent/inbox/claimed</code> { message, turn } per message
32
+ Driver->>Hooks: <code>agent/pre-step</code> waterfall
33
+ Hooks-->>Driver: authoritative reject or enter(messages)
34
+ alt proposed step rejected or pre-step failed
35
+ Driver-->>Driver: claimed batch stays removed, the open turn spends no step
36
+ else enter proposed step
37
+ Driver->>Session: <code>step/start</code>
38
+ Driver->>Session: <code>user/message</code> per entered message
39
+ Driver->>Prompt: <code>system-prompt/assemble</code> waterfall
40
+ Driver->>LLM: <code>agent/request</code> waterfall, then <code>llm/stream</code> waterfall
41
+ LLM-->>Driver: StreamChunk*
42
+ Driver->>Session: <code>assistant/chunk</code>*
43
+ Session-->>SDK: <code>session/event</code> <code>assistant/chunk</code>*
44
+ alt final adapter or terminal in-band request failure
45
+ Driver->>Session: <code>step/end</code>
46
+ Driver->>Hooks: <code>agent/request-error</code> waterfall
47
+ Hooks-->>Driver: return retry action or preserve the original error
48
+ else model request succeeded
49
+ Driver->>Session: <code>assistant/message</code>
50
+ Driver->>Tools: classify pending call by executionMode
51
+ loop barriers and bounded rolling pool, reclassify before start
52
+ opt call starts
53
+ Driver->>Session: <code>tool/call</code>
54
+ Driver->>Tools: ordered pre, concurrent execute
55
+ Tools-->>Session: tool-owned events when applicable
56
+ end
57
+ opt next model-order result ready
58
+ Driver->>Tools: ordered post
59
+ Driver->>Session: <code>tool/result</code>
60
+ end
61
+ end
62
+ Driver->>Session: <code>step/end</code>
63
+ opt natural stop and next-step inbox empty
64
+ Driver->>Hooks: <code>agent/turn-stopping</code> serial terminal checkpoint
65
+ end
66
+ opt next-step input is pending
67
+ Driver-->>Driver: claim pending next-step input
68
+ Driver-->>SDK: <code>agent/inbox/claimed</code> { message, turn } per message
69
+ Driver->>Hooks: <code>agent/pre-step</code> waterfall
70
+ Hooks-->>Driver: authoritative reject or enter(messages)
71
+ end
72
+ end
73
+ end
74
+ Driver->>Session: <code>turn/end</code>
75
+ Driver-->>SDK: <code>agent/status</code> idle
76
+ ```
77
+
78
+ The `assistant/message` event records every successful provider call, including content-less and `max-tokens` finishes. Empty content stays out of derived history, while the durable event keeps usage and `sourceEventSeqs` listing the exact `assistant/chunk` events, including an explicit empty list.
79
+
80
+ `dsh-compaction-basic` uses `agent/pre-step` for pressure before request derivation and `agent/request-error` only for canonical context overflow. Once either trigger qualifies, optional tool-result pruning runs before summary selection. Recovery works between the closed failed step and failed turn close, and opens a fresh retry turn only when pruning or summarization advances the surface replacement generation; otherwise the original request error remains authoritative.
81
+
82
+ The returned `agent/pre-step` decision is authoritative; listeners wrapping `next()` preserve downstream messages unless replacement is intentional. Steering and injected context pass through the same waterfall after a later claim operation takes their next-step batch.
83
+
84
+ SDK users that need replayable transcript data should consume `session/event`; `agent/*` is the live coordination API for queue/status, prompt interception, request construction, steering, continuation, and errors.
85
+
86
+ Maintenance mode: curated Mermaid sequence; exact event signatures live in the generated Cordis catalog.