dsh-plugin-guide 0.1.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.
- package/LICENSE +202 -0
- package/NOTICE.md +26 -0
- package/README.es.md +139 -0
- package/README.hi.md +138 -0
- package/README.md +165 -0
- package/README.pt.md +139 -0
- package/README.zh-CN.md +164 -0
- package/SKILL.md +69 -0
- package/cordis.patch.yml +4 -0
- package/guide/links.md +92 -0
- package/guide/plugin-dev-guide.md +429 -0
- package/guide/quick-reference.es.md +176 -0
- package/guide/quick-reference.hi.md +176 -0
- package/guide/quick-reference.md +176 -0
- package/guide/quick-reference.pt.md +176 -0
- package/guide/quick-reference.zh-CN.md +175 -0
- package/index.js +58 -0
- package/package.json +83 -0
- package/references/community-ecosystem.md +201 -0
- package/references/community-repo-deep-dive.md +695 -0
- package/references/cordis-paper-and-community.md +326 -0
- package/references/harness-repo.md +654 -0
- package/references/official-docs/AGENTS.md +149 -0
- package/references/official-docs/BENCHMARK.md +3 -0
- package/references/official-docs/CLAUDE.md +1 -0
- package/references/official-docs/CONTRIBUTING.i18n.yaml +6 -0
- package/references/official-docs/CONTRIBUTING.md +23 -0
- package/references/official-docs/CONTRIBUTING.zh.md +23 -0
- package/references/official-docs/LICENSE +21 -0
- package/references/official-docs/README.i18n.yaml +6 -0
- package/references/official-docs/README.md +35 -0
- package/references/official-docs/README.zh.md +74 -0
- package/references/official-docs/SNAPSHOT.md +16 -0
- package/references/official-docs/THIRD_PARTY_NOTICES.md +192 -0
- package/references/official-docs/docs/AGENTS.md +75 -0
- package/references/official-docs/docs/agent-lifecycle.i18n.yaml +6 -0
- package/references/official-docs/docs/agent-lifecycle.md +82 -0
- package/references/official-docs/docs/agent-lifecycle.zh.md +84 -0
- package/references/official-docs/docs/api-gateway.i18n.yaml +6 -0
- package/references/official-docs/docs/api-gateway.md +164 -0
- package/references/official-docs/docs/api-gateway.zh.md +164 -0
- package/references/official-docs/docs/architecture.i18n.yaml +6 -0
- package/references/official-docs/docs/architecture.md +129 -0
- package/references/official-docs/docs/architecture.zh.md +133 -0
- package/references/official-docs/docs/capability-seams.i18n.yaml +6 -0
- package/references/official-docs/docs/capability-seams.md +471 -0
- package/references/official-docs/docs/capability-seams.zh.md +473 -0
- package/references/official-docs/docs/config-catalog.i18n.yaml +6 -0
- package/references/official-docs/docs/config-catalog.md +3151 -0
- package/references/official-docs/docs/config-catalog.zh.md +3152 -0
- package/references/official-docs/docs/cookbook/adding-a-conversation-node.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-conversation-node.md +233 -0
- package/references/official-docs/docs/cookbook/adding-a-conversation-node.zh.md +233 -0
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-package.md +118 -0
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +118 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.md +94 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +96 -0
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +59 -0
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +59 -0
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +43 -0
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
- package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/extension-cookbook.md +129 -0
- package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +131 -0
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.md +64 -0
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
- package/references/official-docs/docs/cordis-api/context.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/context.md +364 -0
- package/references/official-docs/docs/cordis-api/context.zh.md +366 -0
- package/references/official-docs/docs/cordis-api/events.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/events.md +207 -0
- package/references/official-docs/docs/cordis-api/events.zh.md +209 -0
- package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/fiber.md +375 -0
- package/references/official-docs/docs/cordis-api/fiber.zh.md +377 -0
- package/references/official-docs/docs/cordis-api/inherited.md +39 -0
- package/references/official-docs/docs/cordis-api/registry.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/registry.md +152 -0
- package/references/official-docs/docs/cordis-api/registry.zh.md +154 -0
- package/references/official-docs/docs/cordis-api/service.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/service.md +102 -0
- package/references/official-docs/docs/cordis-api/service.zh.md +104 -0
- package/references/official-docs/docs/cordis-primer.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-primer.md +44 -0
- package/references/official-docs/docs/cordis-primer.zh.md +50 -0
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.md +95 -0
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/03-services.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/04-events.md +144 -0
- package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +144 -0
- package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/05-config.md +84 -0
- package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +84 -0
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +107 -0
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +107 -0
- package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/index.md +60 -0
- package/references/official-docs/docs/cordis-tutorial/index.zh.md +62 -0
- package/references/official-docs/docs/defensive-patterns.i18n.yaml +6 -0
- package/references/official-docs/docs/defensive-patterns.md +33 -0
- package/references/official-docs/docs/defensive-patterns.zh.md +33 -0
- package/references/official-docs/docs/development.i18n.yaml +6 -0
- package/references/official-docs/docs/development.md +171 -0
- package/references/official-docs/docs/development.zh.md +171 -0
- package/references/official-docs/docs/event-producer-consumer.i18n.yaml +6 -0
- package/references/official-docs/docs/event-producer-consumer.md +76 -0
- package/references/official-docs/docs/event-producer-consumer.zh.md +78 -0
- package/references/official-docs/docs/glossary.i18n.yaml +6 -0
- package/references/official-docs/docs/glossary.md +45 -0
- package/references/official-docs/docs/glossary.zh.md +45 -0
- package/references/official-docs/docs/graph-atlas.i18n.yaml +6 -0
- package/references/official-docs/docs/graph-atlas.md +24 -0
- package/references/official-docs/docs/graph-atlas.zh.md +26 -0
- package/references/official-docs/docs/i18n/README.i18n.yaml +6 -0
- package/references/official-docs/docs/i18n/README.md +60 -0
- package/references/official-docs/docs/i18n/README.zh.md +60 -0
- package/references/official-docs/docs/i18n/style-samples.md +87 -0
- package/references/official-docs/docs/i18n/terminology.md +214 -0
- package/references/official-docs/docs/i18n/translation-prompt.md +263 -0
- package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +6 -0
- package/references/official-docs/docs/i18n/translation-rules.md +69 -0
- package/references/official-docs/docs/i18n/translation-rules.zh.md +69 -0
- package/references/official-docs/docs/module-graph.i18n.yaml +6 -0
- package/references/official-docs/docs/module-graph.md +1638 -0
- package/references/official-docs/docs/module-graph.zh.md +1640 -0
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +6 -0
- package/references/official-docs/docs/persistence-catalog.md +944 -0
- package/references/official-docs/docs/persistence-catalog.zh.md +946 -0
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
- package/references/official-docs/docs/postmortem/README.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/README.md +18 -0
- package/references/official-docs/docs/postmortem/README.zh.md +18 -0
- package/references/official-docs/docs/rescope.i18n.yaml +6 -0
- package/references/official-docs/docs/rescope.md +53 -0
- package/references/official-docs/docs/rescope.zh.md +53 -0
- package/references/official-docs/docs/subsystems/README.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/README.md +55 -0
- package/references/official-docs/docs/subsystems/README.zh.md +55 -0
- package/references/official-docs/docs/subsystems/approval.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/approval.md +170 -0
- package/references/official-docs/docs/subsystems/approval.zh.md +170 -0
- package/references/official-docs/docs/subsystems/attachment.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/attachment.md +115 -0
- package/references/official-docs/docs/subsystems/attachment.zh.md +115 -0
- package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/client-modules.md +118 -0
- package/references/official-docs/docs/subsystems/client-modules.zh.md +118 -0
- package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/code-runtime.md +191 -0
- package/references/official-docs/docs/subsystems/code-runtime.zh.md +191 -0
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/commands.md +187 -0
- package/references/official-docs/docs/subsystems/commands.zh.md +187 -0
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/compaction.md +238 -0
- package/references/official-docs/docs/subsystems/compaction.zh.md +238 -0
- package/references/official-docs/docs/subsystems/core.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/core.md +1070 -0
- package/references/official-docs/docs/subsystems/core.zh.md +1078 -0
- package/references/official-docs/docs/subsystems/credentials.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/credentials.md +133 -0
- package/references/official-docs/docs/subsystems/credentials.zh.md +133 -0
- package/references/official-docs/docs/subsystems/extensions.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/extensions.md +364 -0
- package/references/official-docs/docs/subsystems/extensions.zh.md +364 -0
- package/references/official-docs/docs/subsystems/feedback.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/feedback.md +266 -0
- package/references/official-docs/docs/subsystems/feedback.zh.md +266 -0
- package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/filesystem.md +495 -0
- package/references/official-docs/docs/subsystems/filesystem.zh.md +495 -0
- package/references/official-docs/docs/subsystems/goal.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/goal.md +277 -0
- package/references/official-docs/docs/subsystems/goal.zh.md +277 -0
- package/references/official-docs/docs/subsystems/invariants.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/invariants.md +88 -0
- package/references/official-docs/docs/subsystems/invariants.zh.md +88 -0
- package/references/official-docs/docs/subsystems/jobs.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/jobs.md +290 -0
- package/references/official-docs/docs/subsystems/jobs.zh.md +290 -0
- package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/llm-streaming.md +888 -0
- package/references/official-docs/docs/subsystems/llm-streaming.zh.md +894 -0
- package/references/official-docs/docs/subsystems/lsp.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/lsp.md +202 -0
- package/references/official-docs/docs/subsystems/lsp.zh.md +202 -0
- package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/permission-presets.md +131 -0
- package/references/official-docs/docs/subsystems/permission-presets.zh.md +131 -0
- package/references/official-docs/docs/subsystems/persistence.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/persistence.md +385 -0
- package/references/official-docs/docs/subsystems/persistence.zh.md +385 -0
- package/references/official-docs/docs/subsystems/plan.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/plan.md +87 -0
- package/references/official-docs/docs/subsystems/plan.zh.md +87 -0
- package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/sandbox.md +218 -0
- package/references/official-docs/docs/subsystems/sandbox.zh.md +218 -0
- package/references/official-docs/docs/subsystems/schedule.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/schedule.md +186 -0
- package/references/official-docs/docs/subsystems/schedule.zh.md +186 -0
- package/references/official-docs/docs/subsystems/scope.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/scope.md +59 -0
- package/references/official-docs/docs/subsystems/scope.zh.md +59 -0
- package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-projection.md +262 -0
- package/references/official-docs/docs/subsystems/session-projection.zh.md +262 -0
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-query.md +495 -0
- package/references/official-docs/docs/subsystems/session-query.zh.md +495 -0
- package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-reference.md +108 -0
- package/references/official-docs/docs/subsystems/session-reference.zh.md +108 -0
- package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-telemetry.md +194 -0
- package/references/official-docs/docs/subsystems/session-telemetry.zh.md +194 -0
- package/references/official-docs/docs/subsystems/session-title.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-title.md +204 -0
- package/references/official-docs/docs/subsystems/session-title.zh.md +204 -0
- package/references/official-docs/docs/subsystems/session.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session.md +849 -0
- package/references/official-docs/docs/subsystems/session.zh.md +851 -0
- package/references/official-docs/docs/subsystems/settings.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/settings.md +310 -0
- package/references/official-docs/docs/subsystems/settings.zh.md +310 -0
- package/references/official-docs/docs/subsystems/shell.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/shell.md +303 -0
- package/references/official-docs/docs/subsystems/shell.zh.md +303 -0
- package/references/official-docs/docs/subsystems/skills.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/skills.md +331 -0
- package/references/official-docs/docs/subsystems/skills.zh.md +331 -0
- package/references/official-docs/docs/subsystems/spill.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/spill.md +117 -0
- package/references/official-docs/docs/subsystems/spill.zh.md +117 -0
- package/references/official-docs/docs/subsystems/storage.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/storage.md +229 -0
- package/references/official-docs/docs/subsystems/storage.zh.md +229 -0
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/subagent.md +734 -0
- package/references/official-docs/docs/subsystems/subagent.zh.md +736 -0
- package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/subprocess.md +324 -0
- package/references/official-docs/docs/subsystems/subprocess.zh.md +324 -0
- package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/system-prompt.md +207 -0
- package/references/official-docs/docs/subsystems/system-prompt.zh.md +207 -0
- package/references/official-docs/docs/subsystems/terminal.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/terminal.md +184 -0
- package/references/official-docs/docs/subsystems/terminal.zh.md +184 -0
- package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/token-meter.md +90 -0
- package/references/official-docs/docs/subsystems/token-meter.zh.md +90 -0
- package/references/official-docs/docs/subsystems/tools.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/tools.md +720 -0
- package/references/official-docs/docs/subsystems/tools.zh.md +720 -0
- package/references/official-docs/docs/subsystems/typert.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/typert.md +336 -0
- package/references/official-docs/docs/subsystems/typert.zh.md +336 -0
- package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/user-questions.md +178 -0
- package/references/official-docs/docs/subsystems/user-questions.zh.md +178 -0
- package/references/official-docs/docs/subsystems/web-server.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/web-server.md +108 -0
- package/references/official-docs/docs/subsystems/web-server.zh.md +108 -0
- package/references/official-docs/docs/subsystems/web.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/web.md +199 -0
- package/references/official-docs/docs/subsystems/web.zh.md +199 -0
- package/references/official-docs/docs/subsystems/workflow.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/workflow.md +278 -0
- package/references/official-docs/docs/subsystems/workflow.zh.md +278 -0
- package/references/official-docs/docs/subsystems/workspace.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/workspace.md +228 -0
- package/references/official-docs/docs/subsystems/workspace.zh.md +228 -0
- package/references/official-docs/docs/testing.i18n.yaml +6 -0
- package/references/official-docs/docs/testing.md +49 -0
- package/references/official-docs/docs/testing.zh.md +49 -0
- package/references/official-docs/docs/tool-catalog.i18n.yaml +6 -0
- package/references/official-docs/docs/tool-catalog.md +1873 -0
- package/references/official-docs/docs/tool-catalog.zh.md +1878 -0
- package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +6 -0
- package/references/official-docs/docs/tool-execution-pipeline.md +62 -0
- package/references/official-docs/docs/tool-execution-pipeline.zh.md +64 -0
- package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/config.md +106 -0
- package/references/official-docs/docs/user/develop/basic/config.zh.md +106 -0
- package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/index.md +144 -0
- package/references/official-docs/docs/user/develop/basic/index.zh.md +144 -0
- package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/publish.md +183 -0
- package/references/official-docs/docs/user/develop/basic/publish.zh.md +183 -0
- package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/tool.md +52 -0
- package/references/official-docs/docs/user/develop/basic/tool.zh.md +52 -0
- package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/framework/events.md +143 -0
- package/references/official-docs/docs/user/develop/framework/events.zh.md +143 -0
- package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/framework/index.md +137 -0
- package/references/official-docs/docs/user/develop/framework/index.zh.md +137 -0
- package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/framework/service.md +148 -0
- package/references/official-docs/docs/user/develop/framework/service.zh.md +150 -0
- package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/practice/index.md +155 -0
- package/references/official-docs/docs/user/develop/practice/index.zh.md +155 -0
- package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/practice/llm-adapter.md +188 -0
- package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +188 -0
- package/references/official-docs/docs/user/guide/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/index.md +30 -0
- package/references/official-docs/docs/user/guide/index.zh.md +30 -0
- package/references/official-docs/docs/user/guide/providers-custom-form.png +0 -0
- package/references/official-docs/docs/user/guide/providers-custom-form.zh.png +0 -0
- package/references/official-docs/docs/user/guide/providers-models-page.png +0 -0
- package/references/official-docs/docs/user/guide/providers-models-page.zh.png +0 -0
- package/references/official-docs/docs/user/guide/providers.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/providers.md +98 -0
- package/references/official-docs/docs/user/guide/providers.zh.md +98 -0
- package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/python-sdk.md +104 -0
- package/references/official-docs/docs/user/guide/python-sdk.zh.md +104 -0
- package/references/official-docs/docs/user/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/index.md +11 -0
- package/references/official-docs/docs/user/index.zh.md +11 -0
- package/references/official-docs/docs/web-styling.i18n.yaml +6 -0
- package/references/official-docs/docs/web-styling.md +25 -0
- package/references/official-docs/docs/web-styling.zh.md +25 -0
- package/references/official-docs/examples/AGENTS.md +20 -0
- package/references/official-docs/packages/AGENTS.md +27 -0
- package/references/official-docs/packages/README.md +69 -0
- package/references/official-docs/vendor/README.md +60 -0
- package/references/official-docs/website-docs.ts +524 -0
- package/references/sources.md +137 -0
- package/references/upstream-cordis.md +594 -0
- package/references/website-pages.md +668 -0
- package/scripts/archive-discussions.ps1 +154 -0
- package/scripts/download-community-articles.ps1 +188 -0
- package/scripts/download-community-repos.ps1 +232 -0
- package/scripts/download-sources.ps1 +195 -0
- package/scripts/gen-topic-snapshot.ps1 +91 -0
- package/scripts/install-skill.ps1 +63 -0
- package/scripts/sync-official-docs.ps1 +130 -0
- package/scripts/verify-kit.ps1 +191 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# LLM 适配器
|
|
2
|
+
|
|
3
|
+
[English](llm-adapter.md) | 中文
|
|
4
|
+
|
|
5
|
+
本文介绍如何为 Harness 接入新的模型提供方。
|
|
6
|
+
|
|
7
|
+
## 概述
|
|
8
|
+
|
|
9
|
+
LLM 适配器是一个继承 `LlmAdapter` 并实现 `stream()` 方法的类,它会将 Harness 的提供方无关请求转换为具体提供方的 API 调用,并将响应转换回 Harness 分片。
|
|
10
|
+
|
|
11
|
+
## 最小实现
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
15
|
+
import Schema from '@deepseek-ai/schemastery'
|
|
16
|
+
import { LlmAdapter, type GenerateOptions, type StreamChunk } from '@deepseek-ai/dsh-llm'
|
|
17
|
+
|
|
18
|
+
class MyAdapter extends LlmAdapter {
|
|
19
|
+
private apiKey: string
|
|
20
|
+
|
|
21
|
+
constructor(apiKey: string) {
|
|
22
|
+
super()
|
|
23
|
+
this.apiKey = apiKey
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async *stream(options: GenerateOptions): AsyncIterable<StreamChunk> {
|
|
27
|
+
// 1. Convert options.messages to the provider format.
|
|
28
|
+
// 2. Call the streaming API.
|
|
29
|
+
// 3. Convert the response into StreamChunk values.
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface Config {
|
|
34
|
+
apiKey: string
|
|
35
|
+
providers: string[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Config: Schema<Config> = Schema.object({
|
|
39
|
+
apiKey: Schema.string().required(),
|
|
40
|
+
providers: Schema.array(Schema.string()).required(),
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
export const name = 'my-llm-adapter'
|
|
44
|
+
export const inject = ['llm']
|
|
45
|
+
|
|
46
|
+
export function apply(ctx: Context, config: Config) {
|
|
47
|
+
const adapter = new MyAdapter(config.apiKey)
|
|
48
|
+
ctx.llm.registerAdapter(config.providers, adapter)
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## StreamChunk 协议
|
|
53
|
+
|
|
54
|
+
`stream()` 必须按以下协议生成分片:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { CallId, type StreamChunk } from '@deepseek-ai/dsh-llm'
|
|
58
|
+
|
|
59
|
+
async function* exampleChunks(): AsyncIterable<StreamChunk> {
|
|
60
|
+
// 1. Start each content block with block-start.
|
|
61
|
+
yield { type: 'block-start', index: 0, blockType: 'text' }
|
|
62
|
+
|
|
63
|
+
// 2. Stream text through text-delta.
|
|
64
|
+
yield { type: 'text-delta', index: 0, text: 'Hello' }
|
|
65
|
+
yield { type: 'text-delta', index: 0, text: ' world' }
|
|
66
|
+
|
|
67
|
+
// 3. End each content block with block-end and the complete block.
|
|
68
|
+
yield {
|
|
69
|
+
type: 'block-end',
|
|
70
|
+
index: 0,
|
|
71
|
+
block: { type: 'text', text: 'Hello world' },
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 4. Tool-call block.
|
|
75
|
+
yield { type: 'block-start', index: 1, blockType: 'tool-call' }
|
|
76
|
+
yield {
|
|
77
|
+
type: 'tool-call-delta',
|
|
78
|
+
index: 1,
|
|
79
|
+
id: CallId('call-123'),
|
|
80
|
+
name: 'bash',
|
|
81
|
+
argumentsDelta: '{"command":"ls"}',
|
|
82
|
+
}
|
|
83
|
+
yield {
|
|
84
|
+
type: 'block-end',
|
|
85
|
+
index: 1,
|
|
86
|
+
block: {
|
|
87
|
+
type: 'tool-call',
|
|
88
|
+
id: CallId('call-123'),
|
|
89
|
+
name: 'bash',
|
|
90
|
+
arguments: '{"command":"ls"}',
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 5. Token usage.
|
|
95
|
+
yield { type: 'usage', usage: { inputTokens: 100, outputTokens: 50 } }
|
|
96
|
+
|
|
97
|
+
// 6. Finish reason.
|
|
98
|
+
yield { type: 'finish', reason: { kind: 'stop' } }
|
|
99
|
+
// Alternatively, { kind: 'tool-calls' } requests tool execution.
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 关键规则
|
|
104
|
+
|
|
105
|
+
- 每个 `block-start` 都必须有与之对应的 `block-end`。
|
|
106
|
+
- `index` 从 0 开始递增,用于标识内容块的顺序。
|
|
107
|
+
- `tool-call-delta` 的 `argumentsDelta` 是原始 JSON 文本的增量,可以在一个分片中完整生成,也可以分多个分片生成。
|
|
108
|
+
- `finish` 必须是最后一个分片。
|
|
109
|
+
- `usage` 必须在 `finish` 之前生成。
|
|
110
|
+
|
|
111
|
+
## GenerateOptions
|
|
112
|
+
|
|
113
|
+
`stream()` 接收仓库导出的 `GenerateOptions`。它包含模型、适配器拥有的推理强度 ID、对话历史、系统提示词、工具 schema、生成参数、停止序列和中止信号;完整字段以 `@deepseek-ai/dsh-llm` 导出的 TypeScript 类型为准。适配器必须将支持的字段映射到具体 API;如果无法支持某个字段,应抛出带稳定 code 的 `LlmError`,不得静默丢弃。
|
|
114
|
+
|
|
115
|
+
请覆写 `resolveModel(provider, model, signal?)`,在一次查询中返回确切的提供方/模型身份以及可选的 `context` 和 `reasoning` 元数据。推理元数据包含有序的不透明 ID、展示名称,以及可选的配置默认值;请保留适配器给出的权威可选列表,包括其上游能力 API 返回的 `off`,不要将这些值提升为核心枚举。异步查询必须响应该可选信号,使取消和资源释放过程完全停稳。服务会校验聚合结果,并在调用 `stream()` 前拒绝显式指定但不受支持的推理强度;省略 `reasoning` 表示该模型没有可选的推理强度能力。
|
|
116
|
+
|
|
117
|
+
## 注册适配器
|
|
118
|
+
|
|
119
|
+
```ts ignore-check
|
|
120
|
+
ctx.llm.registerAdapter(['my-provider'], adapter)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
第一个参数是该适配器处理的提供方路由列表。`GenerateOptions.provider` 选择已注册的适配器,`GenerateOptions.model` 则传入由适配器拥有、无需在生命周期启动时注册的模型 id。适配器能够向选择器公布模型选项时,请覆写 `listModels()`。
|
|
124
|
+
|
|
125
|
+
## 在 cordis.yml 中使用
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
- id: my-llm
|
|
129
|
+
name: './src/my-llm-adapter.ts'
|
|
130
|
+
config:
|
|
131
|
+
apiKey: !!js process.env.MY_API_KEY
|
|
132
|
+
providers:
|
|
133
|
+
- my-provider
|
|
134
|
+
|
|
135
|
+
- id: agent-loop
|
|
136
|
+
name: '@deepseek-ai/dsh-agent-loop'
|
|
137
|
+
config:
|
|
138
|
+
agents:
|
|
139
|
+
- id: main
|
|
140
|
+
provider: my-provider
|
|
141
|
+
model: my-model-v1
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 实战参考
|
|
145
|
+
|
|
146
|
+
仓库中包含以下两个完整实现:
|
|
147
|
+
|
|
148
|
+
- `packages/llm/llm-deepseek/` — DeepSeek API 适配器(OpenAI 兼容格式)
|
|
149
|
+
- `packages/llm/llm-pi-ai/` — Pi AI 适配器(不同的 API 格式)
|
|
150
|
+
|
|
151
|
+
对比这两个已交付的适配器,可以看到同一套 harness 契约如何在不同提供方 SDK 之上实现。
|
|
152
|
+
|
|
153
|
+
## 错误处理
|
|
154
|
+
|
|
155
|
+
适配器应通过带稳定 code 的 `LlmError` 抛出传输和协议故障;agent loop(智能体循环)会保留该错误及其 code,用于诊断和策略处理。不要依赖普通 `Error` 被自动转换。每个提供方 HTTP 请求还必须合并 `attributionHeaders()`,并传递 `options.signal`。
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
import {
|
|
159
|
+
attributionHeaders,
|
|
160
|
+
LlmAdapter,
|
|
161
|
+
LlmError,
|
|
162
|
+
type GenerateOptions,
|
|
163
|
+
type StreamChunk,
|
|
164
|
+
} from '@deepseek-ai/dsh-llm'
|
|
165
|
+
|
|
166
|
+
class HttpAdapter extends LlmAdapter {
|
|
167
|
+
constructor(private readonly endpoint: string) {
|
|
168
|
+
super()
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async *stream(options: GenerateOptions): AsyncIterable<StreamChunk> {
|
|
172
|
+
const response = await fetch(this.endpoint, {
|
|
173
|
+
method: 'POST',
|
|
174
|
+
headers: {
|
|
175
|
+
'content-type': 'application/json',
|
|
176
|
+
...attributionHeaders(),
|
|
177
|
+
},
|
|
178
|
+
body: JSON.stringify({ model: options.model, messages: options.messages }),
|
|
179
|
+
...options.signal ? { signal: options.signal } : {},
|
|
180
|
+
})
|
|
181
|
+
if (!response.ok) {
|
|
182
|
+
throw new LlmError(`Provider API error: ${response.status}`, 'PROVIDER_HTTP_ERROR')
|
|
183
|
+
}
|
|
184
|
+
// A real adapter parses the response and emits the complete chunk sequence.
|
|
185
|
+
yield { type: 'finish', reason: { kind: 'stop' } }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write docs/user/guide/index.md
|
|
5
|
+
index.md: 282a5c11b317a8fb8706bb03f41cf03fb2aca49d
|
|
6
|
+
index.zh.md: 4ec53b16fc8987b5eb40ef4854cb41d1436a9015
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Use the Web UI
|
|
2
|
+
|
|
3
|
+
English | [中文](index.zh.md)
|
|
4
|
+
|
|
5
|
+
Start the Web UI through the [root README](../../../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.
|
|
6
|
+
|
|
7
|
+
## Configure a model
|
|
8
|
+
|
|
9
|
+
Open **Settings → Models**, enter a DeepSeek API key, and save it. The model route becomes usable immediately without restarting the server.
|
|
10
|
+
|
|
11
|
+
The [model configuration guide](./providers.md) covers other providers and custom OpenAI-compatible endpoints.
|
|
12
|
+
|
|
13
|
+
## Choose a workspace
|
|
14
|
+
|
|
15
|
+
Click **Choose workspace**, add the project directory where you started `dsh`, and select it. The session composer remains unavailable until a workspace is selected.
|
|
16
|
+
|
|
17
|
+
## Run a task
|
|
18
|
+
|
|
19
|
+
Start a session and send:
|
|
20
|
+
|
|
21
|
+
> Summarize this repository and identify its main packages.
|
|
22
|
+
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+
## Continue
|
|
26
|
+
|
|
27
|
+
- [Configure models](./providers.md)
|
|
28
|
+
- [Use the Python SDK](./python-sdk.md)
|
|
29
|
+
- [Use other CLI modes](../../../apps/cli/README.md)
|
|
30
|
+
- [Develop a plugin](../develop/basic/)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 使用 Web UI
|
|
2
|
+
|
|
3
|
+
[English](index.md) | 中文
|
|
4
|
+
|
|
5
|
+
先按照[根 README](../../../README.md#run)启动 Web UI;命令会打印其访问地址。本指南从服务器已经运行的状态开始。`dsh` 进程会把调用目录作为默认文件系统位置,但新的 Web UI 在添加工作区前不会选中任何工作区。
|
|
6
|
+
|
|
7
|
+
## 配置模型
|
|
8
|
+
|
|
9
|
+
打开**设置 → 模型**,输入 DeepSeek API 密钥并保存。模型路由会立即可用,不需要重启服务器。
|
|
10
|
+
|
|
11
|
+
[模型配置指南](./providers.md)介绍其他提供方和自定义 OpenAI 兼容端点。
|
|
12
|
+
|
|
13
|
+
## 选择工作区
|
|
14
|
+
|
|
15
|
+
点击**选择工作区**,添加启动 `dsh` 时所在的项目目录,然后选中它。选中工作区前,会话输入框不可用。
|
|
16
|
+
|
|
17
|
+
## 运行任务
|
|
18
|
+
|
|
19
|
+
启动一个会话并发送:
|
|
20
|
+
|
|
21
|
+
> Summarize this repository and identify its main packages.
|
|
22
|
+
|
|
23
|
+
agent 可以读取和编辑工作区文件、运行命令、委派工作并维护计划。当操作在当前权限策略下需要审批时,Web UI 会先询问你。
|
|
24
|
+
|
|
25
|
+
## 继续使用
|
|
26
|
+
|
|
27
|
+
- [配置模型](./providers.md)
|
|
28
|
+
- [使用 Python SDK](./python-sdk.md)
|
|
29
|
+
- [使用其他 CLI 模式](../../../apps/cli/README.md)
|
|
30
|
+
- [开发插件](../develop/basic/)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write docs/user/guide/providers.md
|
|
5
|
+
providers.md: 099f434ec4602aa402239e83c708d81fcadd7732
|
|
6
|
+
providers.zh.md: 367c90b525ad628b3cd86b2d22045c25064e88a1
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Configure models
|
|
2
|
+
|
|
3
|
+
English | [中文](providers.zh.md)
|
|
4
|
+
|
|
5
|
+
This guide assumes you started the Web UI through the [root README](../../../README.md#run). Model changes take effect on the next request without restarting the server.
|
|
6
|
+
|
|
7
|
+
## Configure DeepSeek
|
|
8
|
+
|
|
9
|
+
Open **Settings → Models**. The DeepSeek card exposes one API-key field; enter the key and save it.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
## Add a catalog provider
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
## Add a custom provider
|
|
22
|
+
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
### Image input
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
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`:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
llm-pi-ai:
|
|
39
|
+
providers:
|
|
40
|
+
my-gateway:
|
|
41
|
+
apiKeyEnv: GATEWAY_API_KEY
|
|
42
|
+
api: openai-completions
|
|
43
|
+
baseURL: https://gateway.example/v1
|
|
44
|
+
models:
|
|
45
|
+
- id: legacy-chat
|
|
46
|
+
- id: vision-preview
|
|
47
|
+
input: [text, image]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`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.
|
|
51
|
+
|
|
52
|
+
If every model you entered by hand takes images, set the fallback once on the route instead of on each of them:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
llm-pi-ai:
|
|
56
|
+
providers:
|
|
57
|
+
vision-gateway:
|
|
58
|
+
apiKeyEnv: GATEWAY_API_KEY
|
|
59
|
+
api: openai-completions
|
|
60
|
+
baseURL: https://vision.example/v1
|
|
61
|
+
defaultInput: [text, image]
|
|
62
|
+
models:
|
|
63
|
+
- id: first-model
|
|
64
|
+
- id: second-model
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`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:
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
llm-pi-ai:
|
|
71
|
+
providers:
|
|
72
|
+
anthropic:
|
|
73
|
+
modelOverrides:
|
|
74
|
+
claude-sonnet-4-5:
|
|
75
|
+
input: [text]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
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.
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
|
|
82
|
+
## Select a model
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
If a saved default names a provider that was deleted, the composer displays **Select model** and blocks input until another model is selected.
|
|
87
|
+
|
|
88
|
+
## Troubleshooting
|
|
89
|
+
|
|
90
|
+
- **`MISSING_CREDENTIAL`** — Store the provider key through the Models page or supply the referenced environment variable.
|
|
91
|
+
- **`UNKNOWN_MODEL`** — Select a configured model or add the missing model to the custom provider.
|
|
92
|
+
- **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.
|
|
93
|
+
- **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.
|
|
94
|
+
- **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.
|
|
95
|
+
|
|
96
|
+
## Advanced configuration
|
|
97
|
+
|
|
98
|
+
The generated [plugin configuration catalog](../../config-catalog.md) lists every supported field and default. The [`dsh-llm-pi-ai`](../../../packages/llm/llm-pi-ai/README.md) and [`dsh-llm-deepseek`](../../../packages/llm/llm-deepseek/README.md) references own direct `settings.yaml` configuration, catalog resolution, reasoning controls, credentials, and adapter errors.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# 配置模型
|
|
2
|
+
|
|
3
|
+
[English](providers.md) | 中文
|
|
4
|
+
|
|
5
|
+
本指南假定你已按照[根 README](../../../README.md#run)启动 Web UI。模型变更会在下一次请求时生效,不需要重启服务器。
|
|
6
|
+
|
|
7
|
+
## 配置 DeepSeek
|
|
8
|
+
|
|
9
|
+
打开**设置 → 模型**。DeepSeek 卡片提供一个 API 密钥字段;输入密钥并保存。
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
密钥是只写的。保存后,页面只会收到脱敏描述符,永远不会收到明文密钥。密钥存储在 `$DSH_HOME/.credentials.yaml` 中,settings 只保留它的凭据引用。
|
|
14
|
+
|
|
15
|
+
## 添加目录提供方
|
|
16
|
+
|
|
17
|
+
选择**添加提供方**,选取 Anthropic 或 OpenAI 等提供方,输入其 API 密钥并保存。已安装目录会提供端点、协议和模型列表。
|
|
18
|
+
|
|
19
|
+
使用原生认证的提供方需要各自的原生凭据。Bedrock、Vertex、Azure 和 Codex 分别使用 AWS 凭据与区域、ADC 项目、`api-version` 和 OAuth;只填写 API 密钥字段无法完成配置。
|
|
20
|
+
|
|
21
|
+
## 添加自定义提供方
|
|
22
|
+
|
|
23
|
+
对于公司网关、自建服务器或已安装目录中不存在的提供方,选择**添加自定义提供方**。提供小写 Provider ID、基础 URL、API 协议、凭据和至少一个模型。
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
Provider ID 是永久的,因为请求、已保存会话、模型默认值和凭据引用都会使用它。如需重命名提供方,请添加新提供方并删除旧提供方。显示名称、基础 URL、协议、凭据和模型仍可编辑。
|
|
28
|
+
|
|
29
|
+
在**模型目录**中选择**获取可用模型**,可查询表单当前显示的基础 URL 和凭据。选择候选项只会更新草稿;保存前不会存储提供方。目录提供方使用已安装目录,不发起网络请求。
|
|
30
|
+
|
|
31
|
+
### 图片输入
|
|
32
|
+
|
|
33
|
+
手动输入的模型在自己声明之前一律按纯文本对待,因为没有任何环节能去询问端点接受哪些模态。给这类模型附加图片,会在发送前就被拒绝,并点名该模型。
|
|
34
|
+
|
|
35
|
+
因此自定义提供方下的视觉模型需要加一行。表单没有对应字段;请在 `$DSH_HOME/settings.yaml` 中给该模型加上 `input`:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
llm-pi-ai:
|
|
39
|
+
providers:
|
|
40
|
+
my-gateway:
|
|
41
|
+
apiKeyEnv: GATEWAY_API_KEY
|
|
42
|
+
api: openai-completions
|
|
43
|
+
baseURL: https://gateway.example/v1
|
|
44
|
+
models:
|
|
45
|
+
- id: legacy-chat
|
|
46
|
+
- id: vision-preview
|
|
47
|
+
input: [text, image]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`input` 接受 `text` 和 `image`,且只作用于该模型,因此一条路由可以同时服务两类模型。省略它——或写成空列表,两者同义——则保留已安装目录为该模型记录的模态;目录未描述的模型则回退到该路由的 `defaultInput`。
|
|
51
|
+
|
|
52
|
+
如果你手动录入的模型全都接受图片,可以在路由上设置一次回退值,不必逐个模型写:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
llm-pi-ai:
|
|
56
|
+
providers:
|
|
57
|
+
vision-gateway:
|
|
58
|
+
apiKeyEnv: GATEWAY_API_KEY
|
|
59
|
+
api: openai-completions
|
|
60
|
+
baseURL: https://vision.example/v1
|
|
61
|
+
defaultInput: [text, image]
|
|
62
|
+
models:
|
|
63
|
+
- id: first-model
|
|
64
|
+
- id: second-model
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`defaultInput` 是回退值而不是覆盖值,默认为 `[text]`:在目录提供方上,它只为目录未描述的模型作答,因此绝不会把目录中本就具备图片能力的模型的该能力去掉。要收窄这类模型,请用它自己的 `input`。目录提供方没有可供填写的 `models` 列表,因此写在 `modelOverrides` 下,以模型 id 为键:
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
llm-pi-ai:
|
|
71
|
+
providers:
|
|
72
|
+
anthropic:
|
|
73
|
+
modelOverrides:
|
|
74
|
+
claude-sonnet-4-5:
|
|
75
|
+
input: [text]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
除模型自身的列表外,每个列表都至少要写一项模态;模型自身的空列表与省略它同义。未知模态在任何位置写入都会被拒绝。
|
|
79
|
+
|
|
80
|
+
这两个字段都是对你端点的断言,而不是对它的检查。声明了端点并不提供的图片能力的模型不会在这里被拦下,改由提供方拒绝该请求。
|
|
81
|
+
|
|
82
|
+
## 选择模型
|
|
83
|
+
|
|
84
|
+
已配置的提供方会出现在模型选择器中。选择模型也会将其设为新会话的默认值。已发送过请求的会话会保留自身日志中记录的模型。
|
|
85
|
+
|
|
86
|
+
如果已保存默认值指向已删除的提供方,输入框会显示**选择模型**,并在选择其他模型前阻止输入。
|
|
87
|
+
|
|
88
|
+
## 排错
|
|
89
|
+
|
|
90
|
+
- **`MISSING_CREDENTIAL`**:通过模型页存储提供方密钥,或提供被引用的环境变量。
|
|
91
|
+
- **`UNKNOWN_MODEL`**:选择已配置的模型,或向自定义提供方添加缺失的模型。
|
|
92
|
+
- **获取可用模型返回 401**:检查密钥。模型发现会调用 OpenAI 兼容的 `GET /models` 端点;对于不提供该端点的服务,请手动输入模型。
|
|
93
|
+
- **图片在发送前被拒绝**:该模型未声明图片模态。请给自定义提供方的模型加上 `input: [text, image]`;DeepSeek 自身的 chat-completions 路由是纯文本的,且无法通过配置改变。
|
|
94
|
+
- **提供方拒绝了带图片的请求**:该模型声明了其端点实际并不提供的图片能力。请从授予它图片能力的那个列表中移除 `image`——可能是模型的 `input`,也可能是路由的 `defaultInput`——然后开启新会话:附加的图片会留在会话日志里,因此在会话离开它之前,同一个请求会不断重复。
|
|
95
|
+
|
|
96
|
+
## 进阶配置
|
|
97
|
+
|
|
98
|
+
自动生成的[插件配置目录](../../config-catalog.md)列出所有受支持的字段与默认值。[`dsh-llm-pi-ai`](../../../packages/llm/llm-pi-ai/README.md) 和 [`dsh-llm-deepseek`](../../../packages/llm/llm-deepseek/README.md) 参考文档负责直接 `settings.yaml` 配置、目录解析、推理控制、凭据与适配器错误。
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write docs/user/guide/python-sdk.md
|
|
5
|
+
python-sdk.md: 71c588ce8c22a8de7ea6c8ed79989b310dcf812a
|
|
6
|
+
python-sdk.zh.md: e273477a3d7639a1f8da39f1a3b5f7fd1d072f60
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Get started with the Python SDK
|
|
2
|
+
|
|
3
|
+
English | [中文](python-sdk.zh.md)
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- Python 3.10 or newer
|
|
10
|
+
- Git
|
|
11
|
+
- Linux x64, Linux arm64, or macOS 14 or newer on arm64
|
|
12
|
+
- A DeepSeek-compatible API endpoint and credential
|
|
13
|
+
- An isolated workspace that the agent may modify
|
|
14
|
+
|
|
15
|
+
## Install the SDK
|
|
16
|
+
|
|
17
|
+
Clone the repository for its runnable example, create a virtual environment, and install the SDK with its same-version bundled runtime:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
git clone https://github.com/deepseek-ai/deepseek-harness.git
|
|
21
|
+
cd deepseek-harness
|
|
22
|
+
python -m venv .venv
|
|
23
|
+
. .venv/bin/activate
|
|
24
|
+
python -m pip install deepseek-harness-sdk
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
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](../../../python/development.md).
|
|
28
|
+
|
|
29
|
+
## Run the checked-in example
|
|
30
|
+
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
export DEEPSEEK_API_KEY=sk-your-key-here
|
|
35
|
+
# export DEEPSEEK_BASE_URL=http://127.0.0.1:8000/v1
|
|
36
|
+
# export DSH_MODEL=deepseek-v4-flash
|
|
37
|
+
# export DSH_SYSTEM_PROMPT='You are a helpful software engineer assistant.'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Run one task against an isolated workspace and session directory:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
python examples/jsonrpc-agent/minimal.py \
|
|
44
|
+
--workspace /absolute/path/to/workspace \
|
|
45
|
+
--session-root /absolute/path/to/sessions \
|
|
46
|
+
--session-id example-001 \
|
|
47
|
+
"Inspect the repository and fix the failing tests."
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The script prints the final assistant response. The session directory receives a JSONL log containing the assembled model requests and tool calls.
|
|
51
|
+
|
|
52
|
+
## Use the SDK in your own program
|
|
53
|
+
|
|
54
|
+
The checked-in example is a thin wrapper around this SDK call:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from pathlib import Path
|
|
58
|
+
|
|
59
|
+
from deepseek_harness import DeepSeekHarness
|
|
60
|
+
|
|
61
|
+
config = Path("examples/jsonrpc-agent/minimal.cordis.yml").resolve()
|
|
62
|
+
workspace = Path("/absolute/path/to/workspace").resolve()
|
|
63
|
+
sessions = Path("/absolute/path/to/sessions").resolve()
|
|
64
|
+
|
|
65
|
+
with DeepSeekHarness(
|
|
66
|
+
provider="deepseek-official",
|
|
67
|
+
model="deepseek-v4-flash",
|
|
68
|
+
max_tokens=49_152,
|
|
69
|
+
cwd=str(workspace),
|
|
70
|
+
session_root=str(sessions),
|
|
71
|
+
cordis=str(config),
|
|
72
|
+
) as harness:
|
|
73
|
+
result = harness.run(
|
|
74
|
+
"Inspect the repository and fix the failing tests.",
|
|
75
|
+
session_id="example-001",
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
print(result.final_response)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`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.
|
|
82
|
+
|
|
83
|
+
## Understand the example composition
|
|
84
|
+
|
|
85
|
+
| Property | Value |
|
|
86
|
+
|---|---|
|
|
87
|
+
| System prompt | `DSH_SYSTEM_PROMPT`, falling back to `You are a helpful software engineer assistant.` |
|
|
88
|
+
| Model in `minimal.py` | `--model`, then `DSH_MODEL`, then `deepseek-v4-flash` |
|
|
89
|
+
| Model-facing tools | Persistent `bash` and `str_replace_editor` only |
|
|
90
|
+
| Bash timeout | 300 seconds |
|
|
91
|
+
| Editor output limit | 16,000 characters |
|
|
92
|
+
| Context compaction | Disabled |
|
|
93
|
+
| Filesystem | Bare local backend; absolute editor paths may address any path visible to the runtime process |
|
|
94
|
+
| Session persistence | Uncompressed JSONL under `DSH_SESSION_ROOT` |
|
|
95
|
+
|
|
96
|
+
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.
|
|
97
|
+
|
|
98
|
+
## Choose workspace and session IDs
|
|
99
|
+
|
|
100
|
+
`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.
|
|
101
|
+
|
|
102
|
+
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.
|
|
103
|
+
|
|
104
|
+
The [`jsonrpc-agent` example reference](../../../examples/jsonrpc-agent/README.md) owns the exact composition. The [Python SDK reference](../../../python/sdk/README.md) covers lifecycle, results, notifications, runtime selection, and configuration; the [Cordis primer](../../cordis-primer.md) covers composition syntax.
|