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,183 @@
|
|
|
1
|
+
# Package and install a plugin
|
|
2
|
+
|
|
3
|
+
English | [中文](publish.zh.md)
|
|
4
|
+
|
|
5
|
+
The previous tutorials loaded a local plugin through a `--patch` overlay. This tutorial packages it as an installable **bundle**, installs it into a **profile** with `dsh plugin add`, and explains the layer order that determines the composed configuration. It assumes the `dsh` CLI is installed. Complete [plugin configuration](./config.md) first.
|
|
6
|
+
|
|
7
|
+
To use a fresh source checkout instead, complete the [run-from-source section](../../../../README.md#run-from-source), keep this tutorial's `hello-plugin` directory at the repository root, and run the remaining `dsh ...` commands from there as `pnpm dsh ...`. See [source execution](../../../../apps/cli/reference/README.md#source-execution) for build and launcher behavior.
|
|
8
|
+
|
|
9
|
+
## Two concepts, two manifests
|
|
10
|
+
|
|
11
|
+
Installation is built on two concepts. Both are described by a `package.json`, but they carry different kinds of manifest under the `dsh` key, and they answer different questions:
|
|
12
|
+
|
|
13
|
+
- A **bundle** is an npm package that ships a configuration layer. Its manifest declares `dsh.bundle`, answering "what does this package contribute?": a patch file that inserts or overrides plugin rows.
|
|
14
|
+
- A **profile** is a directory under `$DSH_HOME/profiles/<name>` describing one runnable composition. Its manifest declares `dsh.profile`, answering "which bundles compose this setup, in what order?".
|
|
15
|
+
|
|
16
|
+
A bundle is what you author and distribute; a profile is what a user boots with `dsh --profile <name>`. Nothing is both.
|
|
17
|
+
|
|
18
|
+
### The bundle manifest
|
|
19
|
+
|
|
20
|
+
Create the package directory:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
mkdir -p hello-plugin
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
hello-plugin/
|
|
28
|
+
├── package.json # declares dsh.bundle
|
|
29
|
+
├── cordis.patch.yml # the layer applied when a profile lists this bundle
|
|
30
|
+
└── index.js # plugin modules the patch rows reference
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Create `hello-plugin/package.json`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"name": "dsh-hello-plugin",
|
|
38
|
+
"version": "0.1.0",
|
|
39
|
+
"type": "module",
|
|
40
|
+
"main": "index.js",
|
|
41
|
+
"files": ["index.js", "cordis.patch.yml"],
|
|
42
|
+
"dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Create `hello-plugin/index.js` with the plugin entry point:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
export const name = 'hello-plugin'
|
|
50
|
+
|
|
51
|
+
export function apply() {
|
|
52
|
+
console.log('[hello-plugin] plugin loaded!')
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Create `hello-plugin/cordis.patch.yml`. The patch is a YAML array like the `--patch` overlays you have been writing, except plugin rows reference the package by name instead of a relative source path so Node resolution finds the installed code:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- insert:
|
|
60
|
+
- id: hello
|
|
61
|
+
name: dsh-hello-plugin
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
A package without the `dsh.bundle` declaration still installs, but only as a plain dependency: `dsh plugin` prints a warning and activates no layer. Use that package format for a library that plugin packages import rather than a plugin users enable.
|
|
65
|
+
|
|
66
|
+
### The profile manifest
|
|
67
|
+
|
|
68
|
+
A profile directory holds two files:
|
|
69
|
+
|
|
70
|
+
- `package.json` — the profile's out-of-tree plugin dependencies (managed by pnpm) plus the `dsh.profile` manifest with its ordered `bundles` list.
|
|
71
|
+
- `cordis.patch.yml` — the user's own patch layer, applied after every bundle layer.
|
|
72
|
+
|
|
73
|
+
You never write a profile manifest by hand: `dsh plugin` creates and maintains it. The next section shows the result.
|
|
74
|
+
|
|
75
|
+
## Install into a profile
|
|
76
|
+
|
|
77
|
+
`dsh plugin --profile <name> <args...>` forwards to pnpm in the profile directory, so every pnpm verb works. From the directory that contains `hello-plugin`, install the package checkout:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
dsh plugin --profile demo add ./hello-plugin
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The first use initializes the profile (with `@deepseek-ai/dsh-base` as its first bundle), pnpm links the checkout, and `dsh` appends the bundle to `dsh.profile.bundles` because the package declares `dsh.bundle`:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"name": "dsh-profile-demo",
|
|
88
|
+
"private": true,
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"dsh-hello-plugin": "link:/path/to/hello-plugin"
|
|
91
|
+
},
|
|
92
|
+
"dsh": {
|
|
93
|
+
"profile": {
|
|
94
|
+
"bundles": [
|
|
95
|
+
"@deepseek-ai/dsh-base",
|
|
96
|
+
"dsh-hello-plugin"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Verify the layer without booting, then boot:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
dsh --profile demo --dump-config # shows a "# == dsh-hello-plugin" layer
|
|
107
|
+
dsh --profile demo
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`dsh plugin --profile demo remove dsh-hello-plugin` removes both the dependency and the layer.
|
|
111
|
+
|
|
112
|
+
## The loading order
|
|
113
|
+
|
|
114
|
+
The effective configuration composes over an empty root by applying, in order:
|
|
115
|
+
|
|
116
|
+
1. Each bundle patch named in the profile's `dsh.profile.bundles` list, in list order — `@deepseek-ai/dsh-base` first, then each installed bundle in the order it was added.
|
|
117
|
+
2. The profile's own `cordis.patch.yml`.
|
|
118
|
+
3. The home-level `$DSH_HOME/cordis.patch.yml` — machine-local preferences shared by every profile.
|
|
119
|
+
4. Each `--patch <path>` overlay, in argv order.
|
|
120
|
+
|
|
121
|
+
App arguments are not another patch layer. A surface bundle can resolve them through an ordinary app-owned service, described below.
|
|
122
|
+
|
|
123
|
+
Later layers win per row, and a patch replaces a row's entire `config` value rather than deep-merging keys. Two consequences for bundle authors:
|
|
124
|
+
|
|
125
|
+
- Your patch can override rows from earlier layers by `id` — the same way [the `dsh-web-app` bundle](../../../../packages/bundle/web-app/cordis.patch.yml) overrides `dsh-base` rows — but must restate every key the row needs, not just the changed one.
|
|
126
|
+
- Users can override your rows in their profile's `cordis.patch.yml` without touching your package, so prefer configuration defaults users are likely to keep and let the schema carry the rest.
|
|
127
|
+
|
|
128
|
+
In-box bundle names always resolve from the dsh installation itself; pnpm manages only out-of-tree packages, so your bundle can rely on `@deepseek-ai/dsh-base` being present and current.
|
|
129
|
+
|
|
130
|
+
## Give a surface bundle its own command line
|
|
131
|
+
|
|
132
|
+
A bundle that defines a runnable app mounts an ordinary provider plugin:
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
- id: hello-startup
|
|
136
|
+
name: 'dsh-hello-plugin/startup'
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The plugin exports `inject = ['cmdlineArgs']`, calls `parseCmdline` from [`@deepseek-ai/dsh-cmdline`](../../../../packages/boot/cmdline/README.md) with its own commander program, and provides its app-owned service from the program's action. The launcher hands every plugin the same immutable arguments after launcher flags, so app-specific flags need no launcher change and multiple plugins may parse the snapshot. The Loader row needs no launcher marker or special kind.
|
|
140
|
+
|
|
141
|
+
Rows configured by those arguments inject the provider's service and read it from their own `!!js` options, with the deployment value beside it as the fallback:
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
- id: my-app
|
|
145
|
+
name: '@example/my-app'
|
|
146
|
+
inject: [myAppStartup]
|
|
147
|
+
config:
|
|
148
|
+
port: !!js ctx.myAppStartup.port ?? 8080
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
On `--help`, the provider publishes no service, so those rows never activate. Loader mounts the composition once, waits for each row's ordinary injections, and only then evaluates that row's `!!js` config against its injected context.
|
|
152
|
+
|
|
153
|
+
## Installing from GitHub: the build-script catch
|
|
154
|
+
|
|
155
|
+
Publishing to a registry is not required — users can install straight from a git host:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
dsh plugin --profile demo add github:you/hello-plugin
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
But a git install fetches **sources, not built artifacts**: nothing runs your `build` script, so a TypeScript package arrives without its `lib/` output and fails to load. Two things must happen, one on each side:
|
|
162
|
+
|
|
163
|
+
- **The author** ships a `prepare` script — pnpm runs it after a git install — that builds the published entry points from source, self-contained: it must not assume dev-only context such as a sibling monorepo checkout. [turtle-ui](https://github.com/deepseek-harness/turtle-ui) is a working example: its `prepare` runs a dedicated tsdown config that transpiles `src/` without project references or type checking.
|
|
164
|
+
- **The user** allowlists the build. pnpm ≥10 refuses to run a git dependency's `prepare` script until it is explicitly allowed, so the first `add` fails; `dsh` points at the fix — copy the exact package key pnpm printed into the profile's `pnpm-workspace.yaml`:
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
allowBuilds:
|
|
168
|
+
dsh-hello-plugin: true
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
and re-run the `add`.
|
|
172
|
+
|
|
173
|
+
Treat that allowance as what it is: **permission to execute the package's code on your machine at install time**, outside any sandbox the agent runs under. Only allow packages whose source you trust, and pin a commit (`github:you/hello-plugin#<sha>`) so a later push cannot silently change what runs.
|
|
174
|
+
|
|
175
|
+
If you would rather not ask users for the allowance, distribute built artifacts instead — neither form needs any build permission:
|
|
176
|
+
|
|
177
|
+
- **Publish to npm** with `lib/` built at `pnpm publish` time; `dsh plugin add your-package` then installs prebuilt code.
|
|
178
|
+
- **Ship a tarball** from `pnpm pack`; users run `dsh plugin add ./hello-plugin-0.1.0.tgz`.
|
|
179
|
+
|
|
180
|
+
## Next steps
|
|
181
|
+
|
|
182
|
+
- [Plugins and lifecycle](../framework/) — the full plugin lifecycle
|
|
183
|
+
- [CLI behavior reference](../../../../apps/cli/reference/README.md) — exact layer precedence, flags, and profile mechanics
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# 打包与安装插件
|
|
2
|
+
|
|
3
|
+
[English](publish.md) | 中文
|
|
4
|
+
|
|
5
|
+
前几篇教程通过 `--patch` overlay 加载本地插件。本教程把它打包成可安装的**组合包**(bundle),用 `dsh plugin add` 安装进一个 **profile**,并解释决定组合后配置的层顺序。本文假设 `dsh` CLI 已安装。请先完成[插件配置](./config.md)。
|
|
6
|
+
|
|
7
|
+
如果改用全新的源码 checkout,请先按照[从源码运行章节](../../../../README.md#run-from-source)完成准备,将本教程的 `hello-plugin` 目录放在仓库根目录,并从该目录把下文的 `dsh ...` 命令改为 `pnpm dsh ...`。构建与启动器行为见[源码执行](../../../../apps/cli/reference/README.md#source-execution)。
|
|
8
|
+
|
|
9
|
+
## 两个概念,两种 manifest
|
|
10
|
+
|
|
11
|
+
安装机制建立在两个概念之上。二者都由一份 `package.json` 描述,但它们在 `dsh` 键下携带的 manifest(元数据清单)种类不同,回答的问题也不同:
|
|
12
|
+
|
|
13
|
+
- **组合包**是附带一个配置层的 npm 包。它的 manifest 声明 `dsh.bundle`,回答的是"这个包贡献什么?":一个插入或覆盖插件行的 patch 文件。
|
|
14
|
+
- **profile** 是位于 `$DSH_HOME/profiles/<name>` 下、描述一份可启动组合的目录。它的 manifest 声明 `dsh.profile`,回答的是"这套配置由哪些组合包按什么顺序组成?"。
|
|
15
|
+
|
|
16
|
+
组合包是你编写并分发的东西;profile 是用户用 `dsh --profile <name>` 启动的东西。没有东西同时是两者。
|
|
17
|
+
|
|
18
|
+
### 组合包 manifest
|
|
19
|
+
|
|
20
|
+
创建包目录:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
mkdir -p hello-plugin
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
hello-plugin/
|
|
28
|
+
├── package.json # declares dsh.bundle
|
|
29
|
+
├── cordis.patch.yml # the layer applied when a profile lists this bundle
|
|
30
|
+
└── index.js # plugin modules the patch rows reference
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
创建 `hello-plugin/package.json`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"name": "dsh-hello-plugin",
|
|
38
|
+
"version": "0.1.0",
|
|
39
|
+
"type": "module",
|
|
40
|
+
"main": "index.js",
|
|
41
|
+
"files": ["index.js", "cordis.patch.yml"],
|
|
42
|
+
"dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
创建 `hello-plugin/index.js`,写入插件入口:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
export const name = 'hello-plugin'
|
|
50
|
+
|
|
51
|
+
export function apply() {
|
|
52
|
+
console.log('[hello-plugin] plugin loaded!')
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
创建 `hello-plugin/cordis.patch.yml`。这个 patch 与一直在写的 `--patch` overlay 一样,是一个 patch 条目的 YAML 数组;区别是插件行按包名而不是相对源码路径引用这个包,这样 Node 的模块解析才能找到已安装的代码:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- insert:
|
|
60
|
+
- id: hello
|
|
61
|
+
name: dsh-hello-plugin
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
没有 `dsh.bundle` 声明的包仍然可以安装,但只作为普通依赖:`dsh plugin` 会打印警告,且不激活任何层。如果一个库供插件包 import,而不是供用户启用,就使用这种包格式。
|
|
65
|
+
|
|
66
|
+
### profile manifest
|
|
67
|
+
|
|
68
|
+
profile 目录包含两个文件:
|
|
69
|
+
|
|
70
|
+
- `package.json` — profile 的树外插件依赖(由 pnpm 管理),加上 `dsh.profile` manifest 及其有序的 `bundles` 列表。
|
|
71
|
+
- `cordis.patch.yml` — 用户自己的 patch 层,在每个组合包层之后应用。
|
|
72
|
+
|
|
73
|
+
profile manifest 从不需要手写:`dsh plugin` 负责创建和维护它。下一节展示其结果。
|
|
74
|
+
|
|
75
|
+
## 安装进 profile
|
|
76
|
+
|
|
77
|
+
`dsh plugin --profile <name> <args...>` 在 profile 目录内转发给 pnpm,因此所有 pnpm 子命令都可用。在包含 `hello-plugin` 的目录中安装该包的 checkout:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
dsh plugin --profile demo add ./hello-plugin
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
首次使用会初始化 profile(`@deepseek-ai/dsh-base` 作为它的第一个组合包),pnpm 链接该 checkout,而 `dsh` 因为这个包声明了 `dsh.bundle`,把它追加进 `dsh.profile.bundles`:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"name": "dsh-profile-demo",
|
|
88
|
+
"private": true,
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"dsh-hello-plugin": "link:/path/to/hello-plugin"
|
|
91
|
+
},
|
|
92
|
+
"dsh": {
|
|
93
|
+
"profile": {
|
|
94
|
+
"bundles": [
|
|
95
|
+
"@deepseek-ai/dsh-base",
|
|
96
|
+
"dsh-hello-plugin"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
先不启动、只验证该层,再启动:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
dsh --profile demo --dump-config # shows a "# == dsh-hello-plugin" layer
|
|
107
|
+
dsh --profile demo
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`dsh plugin --profile demo remove dsh-hello-plugin` 会同时移除依赖和对应的层。
|
|
111
|
+
|
|
112
|
+
## 加载顺序
|
|
113
|
+
|
|
114
|
+
生效配置在空根之上按以下顺序逐层组合:
|
|
115
|
+
|
|
116
|
+
1. profile 的 `dsh.profile.bundles` 列表所列的各个组合包 patch,按列表顺序——先是 `@deepseek-ai/dsh-base`,然后是每个已安装组合包,按其加入顺序。
|
|
117
|
+
2. profile 自己的 `cordis.patch.yml`。
|
|
118
|
+
3. home 级的 `$DSH_HOME/cordis.patch.yml`——各 profile 共享的机器本地偏好。
|
|
119
|
+
4. 每个 `--patch <path>` overlay,按 argv 顺序。
|
|
120
|
+
|
|
121
|
+
应用参数不是另一层 patch。表层组合包可以通过下文所述的普通应用自有服务解析它们。
|
|
122
|
+
|
|
123
|
+
后应用的层按行胜出,且 patch 会替换目标行的整个 `config` 值,而不是深度合并各键。这给组合包作者带来两个推论:
|
|
124
|
+
|
|
125
|
+
- 你的 patch 可以按 `id` 覆盖前面各层的行——就像 [`dsh-web-app` 组合包](../../../../packages/bundle/web-app/cordis.patch.yml)覆盖 `dsh-base` 的行那样——但必须重述该行需要的每一个键,而不是只写改动的那个。
|
|
126
|
+
- 用户可以在自己 profile 的 `cordis.patch.yml` 中覆盖你的行,无需改动你的包,所以优先给出用户大概率会保留的配置默认值,其余交给 schema 承担。
|
|
127
|
+
|
|
128
|
+
内置组合包名称始终从 dsh 安装目录本身解析;pnpm 只管理树外的包,所以你的组合包可以放心依赖 `@deepseek-ai/dsh-base` 存在且与安装保持一致。
|
|
129
|
+
|
|
130
|
+
## 让表层组合包持有自己的命令行
|
|
131
|
+
|
|
132
|
+
定义了可运行应用的组合包挂载一个普通提供方插件:
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
- id: hello-startup
|
|
136
|
+
name: 'dsh-hello-plugin/startup'
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
该插件导出 `inject = ['cmdlineArgs']`,使用自己的 commander program 调用 [`@deepseek-ai/dsh-cmdline`](../../../../packages/boot/cmdline/README.md) 中的 `parseCmdline`,再在 program 自己的 action 中把应用自有服务提供出去。启动器把自身 flag 之后的同一份不可变参数交给每个插件,因此添加应用专属 flag 无需修改启动器,多个插件也可以解析该快照。Loader 行不需要启动器标记或特殊类型。
|
|
140
|
+
|
|
141
|
+
受这些参数配置的行会注入提供方服务,并在自己的 `!!js` 选项中读取它,同时把部署取值写在旁边作为回退:
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
- id: my-app
|
|
145
|
+
name: '@example/my-app'
|
|
146
|
+
inject: [myAppStartup]
|
|
147
|
+
config:
|
|
148
|
+
port: !!js ctx.myAppStartup.port ?? 8080
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
遇到 `--help` 时,提供方不会发布该服务,所以这些行不会激活。Loader 只挂载一次组合,等待每一行的普通注入,再基于其已注入的上下文求值该行的 `!!js` 配置。
|
|
152
|
+
|
|
153
|
+
## 从 GitHub 安装:构建脚本这道坎
|
|
154
|
+
|
|
155
|
+
发布到注册表不是必须的——用户可以直接从 git 托管安装:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
dsh plugin --profile demo add github:you/hello-plugin
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
但 git 安装拉取的是**源码,不是构建产物**:没有任何环节运行你的 `build` 脚本,因此 TypeScript 包到手时没有 `lib/` 输出,加载会失败。必须两边各做一件事:
|
|
162
|
+
|
|
163
|
+
- **作者**提供一个 `prepare` 脚本——pnpm 在 git 安装后运行它——从源码构建出发布入口,且必须自包含:不能假设仅开发环境才有的上下文,例如旁边有一份 monorepo checkout。[turtle-ui](https://github.com/deepseek-harness/turtle-ui) 是一个可用的例子:它的 `prepare` 运行一份专用的 tsdown 配置,直接转译 `src/`,不用项目引用,也不做类型检查。
|
|
164
|
+
- **用户**为构建授权。pnpm ≥10 在得到显式允许之前拒绝运行 git 依赖的 `prepare` 脚本,所以第一次 `add` 会失败;`dsh` 会指出修法——把 pnpm 打印的确切包键复制进该 profile 的 `pnpm-workspace.yaml`:
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
allowBuilds:
|
|
168
|
+
dsh-hello-plugin: true
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
然后重新执行 `add`。
|
|
172
|
+
|
|
173
|
+
请如实看待这项授权:**允许该包的代码在安装时于你的机器上执行**,且不在 agent 运行的任何沙箱之内。只对源码可信的包授权,并锁定 commit(`github:you/hello-plugin#<sha>`),让后续推送无法悄悄改变实际运行的内容。
|
|
174
|
+
|
|
175
|
+
如果不想让用户做这项授权,就改为分发构建产物——以下两种形式都不需要任何构建权限:
|
|
176
|
+
|
|
177
|
+
- **发布到 npm**,在 `pnpm publish` 时构建好 `lib/`;`dsh plugin add your-package` 安装的就是预构建代码。
|
|
178
|
+
- **交付 tarball**:用 `pnpm pack` 打包;用户执行 `dsh plugin add ./hello-plugin-0.1.0.tgz`。
|
|
179
|
+
|
|
180
|
+
## 下一步
|
|
181
|
+
|
|
182
|
+
- [插件与生命周期](../framework/) — 插件的完整生命周期
|
|
183
|
+
- [CLI(命令行界面)行为参考](../../../../apps/cli/reference/README.md) — 确切的层优先级、flag 与 profile 机制
|
|
@@ -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/develop/basic/tool.md
|
|
5
|
+
tool.md: eb262d131a7f2b540827e86e56f8c0a28cb5f904
|
|
6
|
+
tool.zh.md: d33d9946a73881df2cd44ebf3695819d02d013ab
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Build a tool
|
|
2
|
+
|
|
3
|
+
English | [中文](tool.zh.md)
|
|
4
|
+
|
|
5
|
+
This tutorial adds a `greet` tool to the Web UI. Complete [Your first plugin](./) first and keep its `scratch-plugin` directory.
|
|
6
|
+
|
|
7
|
+
## Create the tool plugin
|
|
8
|
+
|
|
9
|
+
Replace `scratch-plugin/src/my-plugin.ts` with:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
13
|
+
import { defineTool } from '@deepseek-ai/dsh-tools'
|
|
14
|
+
|
|
15
|
+
export const name = 'greet-tool'
|
|
16
|
+
export const inject = ['tools']
|
|
17
|
+
|
|
18
|
+
export function apply(ctx: Context) {
|
|
19
|
+
ctx.tools.register(defineTool({
|
|
20
|
+
name: 'greet',
|
|
21
|
+
description: 'Greet someone by name.',
|
|
22
|
+
parameters: {
|
|
23
|
+
name: { type: 'string', required: true, description: 'The name to greet' },
|
|
24
|
+
},
|
|
25
|
+
output: {
|
|
26
|
+
schema: { type: 'string' },
|
|
27
|
+
render: (_args, value) => [{ type: 'text', text: value }],
|
|
28
|
+
},
|
|
29
|
+
async execute(args) {
|
|
30
|
+
return `Hello, ${args.name}!`
|
|
31
|
+
},
|
|
32
|
+
}))
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`inject` makes Cordis wait for the tool registry. `defineTool` infers and validates `args` from `parameters`; `execute` returns the canonical value declared by `output.schema`, and `output.render` converts that value to model-facing content.
|
|
37
|
+
|
|
38
|
+
## Run and call the tool
|
|
39
|
+
|
|
40
|
+
Restart the development command if it is not running:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
pnpm dsh web --patch ./scratch-plugin/cordis.yml
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Open `http://127.0.0.1:3080` and ask: `Use the greet tool to greet Ada.` The model can call `greet` and receives `Hello, Ada!` as the tool result.
|
|
47
|
+
|
|
48
|
+
## Next steps
|
|
49
|
+
|
|
50
|
+
- [Plugin configuration](./config.md) — make the greeting configurable.
|
|
51
|
+
- [Tool authoring reference](../../../cookbook/adding-a-tool.md) — look up nested schemas, canonical values, background work, policy hooks, Code Mode, and UI cards.
|
|
52
|
+
- [Capability layering](../practice/) — split a replaceable capability into Service Definition, Service Provider, and Consumer packages.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# 开发一个工具
|
|
2
|
+
|
|
3
|
+
[English](tool.md) | 中文
|
|
4
|
+
|
|
5
|
+
本教程会在 Web UI 中添加一个 `greet` 工具。请先完成[第一个插件](./),并保留其中的 `scratch-plugin` 目录。
|
|
6
|
+
|
|
7
|
+
## 创建工具插件
|
|
8
|
+
|
|
9
|
+
将 `scratch-plugin/src/my-plugin.ts` 替换为:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
13
|
+
import { defineTool } from '@deepseek-ai/dsh-tools'
|
|
14
|
+
|
|
15
|
+
export const name = 'greet-tool'
|
|
16
|
+
export const inject = ['tools']
|
|
17
|
+
|
|
18
|
+
export function apply(ctx: Context) {
|
|
19
|
+
ctx.tools.register(defineTool({
|
|
20
|
+
name: 'greet',
|
|
21
|
+
description: 'Greet someone by name.',
|
|
22
|
+
parameters: {
|
|
23
|
+
name: { type: 'string', required: true, description: 'The name to greet' },
|
|
24
|
+
},
|
|
25
|
+
output: {
|
|
26
|
+
schema: { type: 'string' },
|
|
27
|
+
render: (_args, value) => [{ type: 'text', text: value }],
|
|
28
|
+
},
|
|
29
|
+
async execute(args) {
|
|
30
|
+
return `Hello, ${args.name}!`
|
|
31
|
+
},
|
|
32
|
+
}))
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`inject` 让 Cordis 等待工具注册表就绪。`defineTool` 根据 `parameters` 推导并校验 `args`;`execute` 返回 `output.schema` 声明的规范值,`output.render` 再将该值转换为面向模型的内容。
|
|
37
|
+
|
|
38
|
+
## 运行并调用工具
|
|
39
|
+
|
|
40
|
+
如果开发命令未在运行,请重新启动:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
pnpm dsh web --patch ./scratch-plugin/cordis.yml
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
打开 `http://127.0.0.1:3080`,然后输入:`Use the greet tool to greet Ada.` 模型可以调用 `greet`,并收到 `Hello, Ada!` 这一工具结果。
|
|
47
|
+
|
|
48
|
+
## 下一步
|
|
49
|
+
|
|
50
|
+
- [插件配置](./config.md) — 让问候语可配置。
|
|
51
|
+
- [工具编写参考](../../../cookbook/adding-a-tool.md) — 查阅嵌套 schema、规范值、后台工作、策略钩子、Code Mode 和 UI 卡片。
|
|
52
|
+
- [能力分层](../practice/) — 将可替换能力拆分为 Service Definition、Service Provider 和 Consumer 三类包。
|
|
@@ -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/develop/framework/events.md
|
|
5
|
+
events.md: 1d9fe5c8f5068de6ad8b2abaa85cf67be35c8459
|
|
6
|
+
events.zh.md: 8bb9447a270cc2db966b1e01298a831a60a1b9c1
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Event system
|
|
2
|
+
|
|
3
|
+
English | [中文](events.zh.md)
|
|
4
|
+
|
|
5
|
+
Events are the core communication mechanism between Cordis plugins. Harness uses them extensively for loosely coupled extension points.
|
|
6
|
+
|
|
7
|
+
## Basic use
|
|
8
|
+
|
|
9
|
+
### Listen for an event
|
|
10
|
+
|
|
11
|
+
```ts ignore-check
|
|
12
|
+
ctx.on('event-name', (payload) => {
|
|
13
|
+
// Handle the event.
|
|
14
|
+
})
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Emit an event
|
|
18
|
+
|
|
19
|
+
```ts ignore-check
|
|
20
|
+
ctx.emit('event-name', payload)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Event modes
|
|
24
|
+
|
|
25
|
+
Cordis provides several event modes for different interaction contracts.
|
|
26
|
+
|
|
27
|
+
### emit — broadcast
|
|
28
|
+
|
|
29
|
+
Every listener runs synchronously and return values are ignored:
|
|
30
|
+
|
|
31
|
+
```ts ignore-check
|
|
32
|
+
// Emit
|
|
33
|
+
ctx.emit('my-plugin/ready', { id: 'worker-1' })
|
|
34
|
+
|
|
35
|
+
// Listen
|
|
36
|
+
ctx.on('my-plugin/ready', ({ id }) => {
|
|
37
|
+
console.log(`${id} is ready`)
|
|
38
|
+
})
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### bail — short circuit
|
|
42
|
+
|
|
43
|
+
Listeners run in order; the first result other than `null`, `false`, or `undefined` becomes the final result:
|
|
44
|
+
|
|
45
|
+
```ts ignore-check
|
|
46
|
+
// Dispatch
|
|
47
|
+
const result = ctx.bail('some-check', input)
|
|
48
|
+
|
|
49
|
+
// Listen: a returned value stops later listeners.
|
|
50
|
+
ctx.on('some-check', (input) => {
|
|
51
|
+
if (shouldBlock(input)) return 'blocked'
|
|
52
|
+
// Return null, false, or undefined to continue to the next listener.
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### serial — ordered execution
|
|
57
|
+
|
|
58
|
+
Listeners run in registration order and asynchronous results are awaited. The first result other than `null`, `false`, or `undefined` stops further execution:
|
|
59
|
+
|
|
60
|
+
```ts ignore-check
|
|
61
|
+
await ctx.serial('setup-phase', context)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### waterfall — pipeline
|
|
65
|
+
|
|
66
|
+
Each listener may wrap the downstream result to form a processing chain. A listener **must call `next()` to delegate downstream**; omitting the call short-circuits the pipeline:
|
|
67
|
+
|
|
68
|
+
```ts ignore-check
|
|
69
|
+
// Dispatch
|
|
70
|
+
const output = await ctx.waterfall('my-plugin/transform', input, async () => input)
|
|
71
|
+
|
|
72
|
+
// Listen: next() is mandatory.
|
|
73
|
+
ctx.on('my-plugin/transform', async (_input, next) => {
|
|
74
|
+
const downstream = await next()
|
|
75
|
+
return downstream.trim()
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
::: warning
|
|
80
|
+
A waterfall listener **must call `next()`**. Omitting it short-circuits the pipeline by design, enabling interception and gateway behavior.
|
|
81
|
+
:::
|
|
82
|
+
|
|
83
|
+
## Typed events
|
|
84
|
+
|
|
85
|
+
Harness uses TypeScript declaration merging for type-safe events:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import '@deepseek-ai/cordis'
|
|
89
|
+
|
|
90
|
+
declare module '@deepseek-ai/cordis' {
|
|
91
|
+
interface Events {
|
|
92
|
+
'my-plugin/ready': (payload: { id: string }) => void
|
|
93
|
+
'my-plugin/check': (input: string) => boolean | undefined
|
|
94
|
+
'my-plugin/transform': (input: string, next: () => Promise<string>) => Promise<string>
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ctx.on('my-plugin/ready', ...) and ctx.emit('my-plugin/ready', ...)
|
|
99
|
+
// are now inferred correctly.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Cordis events and session records
|
|
103
|
+
|
|
104
|
+
Harness Cordis events use `namespace/action` names, including `agent/step`, `agent/request`, `agent/request-error`, `tools/result`, and `session/event`. The generated `cordis-surface` regions on the [subsystem pages](../../../subsystems/core.md) record complete signatures and modes.
|
|
105
|
+
|
|
106
|
+
`turn/*`, `step/*`, `tool/call`, `tool/result`, and `compaction/*` are durable session-event types, not same-named Cordis events. To observe them, listen to `session/event` and inspect `event.type`.
|
|
107
|
+
|
|
108
|
+
## Event listeners are effects
|
|
109
|
+
|
|
110
|
+
A listener registered with `ctx.on()` is removed automatically when its plugin unloads:
|
|
111
|
+
|
|
112
|
+
```ts ignore-check
|
|
113
|
+
export function apply(ctx: Context) {
|
|
114
|
+
// This listener is removed when the plugin disposes.
|
|
115
|
+
ctx.on('tools/result', handler)
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Example: logging plugin
|
|
120
|
+
|
|
121
|
+
This plugin logs tool calls and results:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
125
|
+
import '@deepseek-ai/dsh-tools'
|
|
126
|
+
|
|
127
|
+
export const name = 'tool-logger'
|
|
128
|
+
|
|
129
|
+
export function apply(ctx: Context) {
|
|
130
|
+
ctx.on('tools/result', (exec, result) => {
|
|
131
|
+
console.log(`[tool] ${exec.name}(${JSON.stringify(exec.arguments)})`)
|
|
132
|
+
const text = result.content
|
|
133
|
+
.map(block => block.type === 'text' ? block.text : '')
|
|
134
|
+
.join('')
|
|
135
|
+
console.log(`[tool result] ${text.slice(0, 100)}`)
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Next steps
|
|
141
|
+
|
|
142
|
+
- [Capability layering](../practice/) — understand events within capability interfaces
|
|
143
|
+
- [LLM adapters](../practice/llm-adapter.md) — implement a complete LLM backend
|