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,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/subsystems/lsp.md
|
|
5
|
+
lsp.md: 18ed0e178c73702534a9964557a3dabf7bb9dd11
|
|
6
|
+
lsp.zh.md: 8b154143057f05d74bf28b715a385a2ec65fbbff
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# LSP navigation
|
|
2
|
+
|
|
3
|
+
English | [中文](lsp.zh.md)
|
|
4
|
+
|
|
5
|
+
The LSP seam — a [capability seam](../../.agents/notes/implemented/architecture/2026-07-15-lsp-capability-seam.md) exposing semantic code navigation on one `ctx.lsp` service, split across packages: Service Definition ([dsh-lsp](../../packages/lsp/lsp), `ctx.lsp` + the provider registry), a generic Service Provider ([dsh-lsp-stdio](../../packages/lsp/lsp-stdio), a configured stdio language-server host), and Consumer ([dsh-tool-lsp](../../packages/lsp/tool-lsp), the `lsp` tool schema). LSP is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](core.md). A provider swap does not change how the model asks for navigation.
|
|
6
|
+
|
|
7
|
+
Source: [`packages/lsp/lsp/src/types.ts`](../../packages/lsp/lsp/src/types.ts)
|
|
8
|
+
|
|
9
|
+
## Operations and coordinates
|
|
10
|
+
|
|
11
|
+
The seam and model expose exactly four semantic queries; the union is closed, so adding one is a compile-enforced change across the seam, providers, and the tool. Positions and ranges are zero-based UTF-16, matching the protocol; the model-facing tool owns the one-based cursor convention and converts on the way in and out.
|
|
12
|
+
|
|
13
|
+
```ts type-equiv
|
|
14
|
+
/**
|
|
15
|
+
* The four semantic queries the seam and model expose. A closed union: adding an operation is a
|
|
16
|
+
* compile-enforced change across the seam, providers, and the tool. Symbols and call hierarchy are
|
|
17
|
+
* not operations here; they need different schemas.
|
|
18
|
+
*/
|
|
19
|
+
type LspOperation = 'goToDefinition' | 'findReferences' | 'goToImplementation' | 'hover'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```ts type-equiv
|
|
23
|
+
/** A zero-based UTF-16 cursor coordinate, matching the LSP wire convention. */
|
|
24
|
+
interface LspPosition {
|
|
25
|
+
/** Zero-based line. */
|
|
26
|
+
readonly line: number
|
|
27
|
+
/** Zero-based UTF-16 code-unit offset within the line. */
|
|
28
|
+
readonly character: number
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```ts type-equiv
|
|
33
|
+
/** A zero-based UTF-16 half-open range `[start, end)`. */
|
|
34
|
+
interface LspRange {
|
|
35
|
+
readonly start: LspPosition
|
|
36
|
+
readonly end: LspPosition
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Request
|
|
41
|
+
|
|
42
|
+
Every field is required: `workspaceRoot` is caller-supplied, `languageId` comes from the provider's registration (not the request), and consumers own timeouts and result limits — so no field needs implementation defaulting and there is no `resolve()` step. The provider receives the caller's request plus the derived `languageId`, which only synchronizes the transient document and never participates in selection.
|
|
43
|
+
|
|
44
|
+
```ts type-equiv
|
|
45
|
+
/**
|
|
46
|
+
* A caller's normalized query. Every field is required: `workspaceRoot` is caller-supplied,
|
|
47
|
+
* `languageId` comes from the provider registration (not here), and consumers own timeouts and
|
|
48
|
+
* result limits — so no field needs implementation defaulting and there is no `resolve()` step.
|
|
49
|
+
*/
|
|
50
|
+
interface LspQueryRequest {
|
|
51
|
+
/** Which semantic query to run. */
|
|
52
|
+
readonly operation: LspOperation
|
|
53
|
+
/** The source file to query (relative to `workspaceRoot` or absolute; the provider canonicalizes). */
|
|
54
|
+
readonly filePath: string
|
|
55
|
+
/** The zero-based UTF-16 cursor position to query at. */
|
|
56
|
+
readonly position: LspPosition
|
|
57
|
+
/** The workspace root the provider resolves against and indexes; required, never defaulted. */
|
|
58
|
+
readonly workspaceRoot: string
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```ts type-equiv
|
|
63
|
+
/**
|
|
64
|
+
* A request as a provider receives it: the caller's {@link LspQueryRequest} plus the `languageId`
|
|
65
|
+
* the seam derived from the provider's extension mapping. The language id only synchronizes the
|
|
66
|
+
* transient document; it does not participate in selection.
|
|
67
|
+
*/
|
|
68
|
+
interface LspProviderQuery extends LspQueryRequest {
|
|
69
|
+
/** The LSP language id for `filePath`, from this provider's extension mapping. */
|
|
70
|
+
readonly languageId: string
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Result
|
|
75
|
+
|
|
76
|
+
A CLOSED discriminated union: navigation operations normalize to `locations`, `hover` to content or `null`. Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled. `findReferences` always includes declarations — the provider enforces this internally, so callers get no flag. The `locations` variant carries `resolvedWorkspaceUri`, the provider's canonical workspace `file:` URI. A caller relativizing location URIs uses that coordinate rather than applying host-platform path rules to the possibly-symlinked request root.
|
|
77
|
+
|
|
78
|
+
```ts type-equiv
|
|
79
|
+
/** One resolved location: a document URI and the range within it. */
|
|
80
|
+
interface LspLocation {
|
|
81
|
+
/** The target document URI (`file:` or otherwise), verbatim from the server. */
|
|
82
|
+
readonly uri: string
|
|
83
|
+
/** The range within the target document. */
|
|
84
|
+
readonly range: LspRange
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```ts type-equiv
|
|
89
|
+
/** Normalized hover content, or `null` for no hover at the position. */
|
|
90
|
+
interface LspHover {
|
|
91
|
+
/** The normalized hover text (markdown or plaintext, provider-joined). */
|
|
92
|
+
readonly contents: string
|
|
93
|
+
/** The range the hover applies to, when the server supplied one. */
|
|
94
|
+
readonly range?: LspRange
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```ts type-equiv
|
|
99
|
+
/**
|
|
100
|
+
* The closed result union. Navigation operations (`goToDefinition`, `findReferences`,
|
|
101
|
+
* `goToImplementation`) normalize to `locations`; `hover` normalizes to content or `null`.
|
|
102
|
+
* Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled.
|
|
103
|
+
*
|
|
104
|
+
* The `locations` variant carries `resolvedWorkspaceUri`: the provider's canonical `file:` URI for
|
|
105
|
+
* the request's workspace root. A caller that relativizes location URIs MUST use this, not parse the
|
|
106
|
+
* request's possibly symlinked process path with host-platform rules; the execution platform may
|
|
107
|
+
* differ from the caller's.
|
|
108
|
+
*/
|
|
109
|
+
type LspQueryResult =
|
|
110
|
+
| { readonly kind: 'locations'; readonly locations: readonly LspLocation[]; readonly resolvedWorkspaceUri: string }
|
|
111
|
+
| { readonly kind: 'hover'; readonly hover: LspHover | null }
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Provider and service
|
|
115
|
+
|
|
116
|
+
A provider owns a stable branded `id` and an exclusive lowercase leading-dot extension map. `registerProvider` reserves the id and every extension atomically — an invalid or conflicting registration publishes nothing — and its disposer releases all reservations. Selection is per query and order-independent; no match throws `LspError` `LSP_UNAVAILABLE`. The seam exposes no protocol types, process/document controls, or generic JSON-RPC escape hatch.
|
|
117
|
+
|
|
118
|
+
```ts type-equiv
|
|
119
|
+
/**
|
|
120
|
+
* A language-server backend registered on `ctx.lsp`. Each provider owns a stable {@link
|
|
121
|
+
* LspProviderId} and an extension-to-language-id map (lowercase, leading-dot keys).
|
|
122
|
+
* `findReferences` always includes declarations — the provider enforces this internally; callers
|
|
123
|
+
* get no flag.
|
|
124
|
+
*/
|
|
125
|
+
interface LspProvider {
|
|
126
|
+
/** Stable provider identity, reserved atomically with the extension mappings. */
|
|
127
|
+
readonly id: LspProviderId
|
|
128
|
+
/** Lowercase leading-dot extension → LSP language id (e.g. `{ '.ts': 'typescript' }`). */
|
|
129
|
+
readonly extensionToLanguage: Readonly<Record<string, string>>
|
|
130
|
+
/**
|
|
131
|
+
* Run one query. The seam has already selected this provider and derived `languageId`.
|
|
132
|
+
* @param request - the resolved provider query (caller request + derived language id).
|
|
133
|
+
* @param signal - optional cancellation; the provider stops its own work when it aborts.
|
|
134
|
+
* @returns the normalized, closed-union result.
|
|
135
|
+
*/
|
|
136
|
+
query(request: LspProviderQuery, signal?: AbortSignal): Promise<LspQueryResult>
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```ts type-equiv
|
|
141
|
+
/**
|
|
142
|
+
* The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query
|
|
143
|
+
* execution; exposes exactly the four operations and no protocol escape hatch.
|
|
144
|
+
*/
|
|
145
|
+
interface LspService {
|
|
146
|
+
/**
|
|
147
|
+
* Register a provider, atomically reserving its id and every normalized extension. Any conflict
|
|
148
|
+
* or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
|
|
149
|
+
* reservations. Disposed with the calling fiber.
|
|
150
|
+
* @param provider - the backend to register.
|
|
151
|
+
* @returns a synchronous disposer releasing the id and all extension reservations.
|
|
152
|
+
*/
|
|
153
|
+
registerProvider(provider: LspProvider): () => void
|
|
154
|
+
/**
|
|
155
|
+
* Select a provider by the file's extension and run one query. Selection is per-query and
|
|
156
|
+
* order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
|
|
157
|
+
* @param request - the normalized query.
|
|
158
|
+
* @param signal - optional cancellation forwarded to the selected provider.
|
|
159
|
+
* @returns the normalized, closed-union result.
|
|
160
|
+
*/
|
|
161
|
+
query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`LspProviderId` is the seam's branded id (`Branded<'LspProviderId'>` from [dsh-brand](../../packages/util/brand)); `LspError` extends `HarnessError` with stable codes such as `LSP_INVALID_PROVIDER`, `LSP_CONFLICT`, `LSP_UNAVAILABLE`, `LSP_DISPOSED`, `LSP_UNSUPPORTED_OPERATION`, and `LSP_MALFORMED_RESPONSE`, which callers route on instead of parsing `message`.
|
|
166
|
+
|
|
167
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
168
|
+
|
|
169
|
+
<a id="cordis-surface"></a>
|
|
170
|
+
|
|
171
|
+
## Cordis API
|
|
172
|
+
|
|
173
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
174
|
+
|
|
175
|
+
<a id="ctxlsp--lspservice"></a>
|
|
176
|
+
|
|
177
|
+
### `ctx.lsp` — `LspService`
|
|
178
|
+
|
|
179
|
+
The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query execution; exposes exactly the four operations and no protocol escape hatch.
|
|
180
|
+
|
|
181
|
+
```ts cordis-catalog
|
|
182
|
+
/**
|
|
183
|
+
* Register a provider, atomically reserving its id and every normalized extension. Any conflict
|
|
184
|
+
* or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
|
|
185
|
+
* reservations. Disposed with the calling fiber.
|
|
186
|
+
* @param provider - the backend to register.
|
|
187
|
+
* @returns a synchronous disposer releasing the id and all extension reservations.
|
|
188
|
+
*/
|
|
189
|
+
registerProvider(provider: LspProvider): () => void
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Select a provider by the file's extension and run one query. Selection is per-query and
|
|
193
|
+
* order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
|
|
194
|
+
* @param request - the normalized query.
|
|
195
|
+
* @param signal - optional cancellation forwarded to the selected provider.
|
|
196
|
+
* @returns the normalized, closed-union result.
|
|
197
|
+
*/
|
|
198
|
+
query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Source: [`packages/lsp/lsp/src/types.ts:113`](../../packages/lsp/lsp/src/types.ts)
|
|
202
|
+
<!-- END GENERATED cordis-surface -->
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# LSP 导航
|
|
2
|
+
|
|
3
|
+
[English](lsp.md) | 中文
|
|
4
|
+
|
|
5
|
+
LSP seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-07-15-lsp-capability-seam.md):它在单一 `ctx.lsp` 服务上公开语义代码导航,并拆分到多个包:Service Definition([dsh-lsp](../../packages/lsp/lsp),`ctx.lsp` + 提供方注册表)、通用 Service Provider([dsh-lsp-stdio](../../packages/lsp/lsp-stdio),经过配置的 stdio 语言服务器宿主)和 Consumer([dsh-tool-lsp](../../packages/lsp/tool-lsp),即 `lsp` 工具 schema)。LSP 是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.md) 中。更换提供方不会改变模型请求导航的方式。
|
|
6
|
+
|
|
7
|
+
源文件:[`packages/lsp/lsp/src/types.ts`](../../packages/lsp/lsp/src/types.ts)
|
|
8
|
+
|
|
9
|
+
## 操作与坐标
|
|
10
|
+
|
|
11
|
+
seam 与模型恰好公开 4 项语义查询;该联合是闭合的,因此新增一项查询会通过编译强制要求同步修改 seam、提供方和工具。位置与范围采用从零开始的 UTF-16 坐标,与协议一致;面向模型的工具采用从 1 开始的光标约定,并在输入和输出时进行转换。
|
|
12
|
+
|
|
13
|
+
```ts type-equiv
|
|
14
|
+
/**
|
|
15
|
+
* The four semantic queries the seam and model expose. A closed union: adding an operation is a
|
|
16
|
+
* compile-enforced change across the seam, providers, and the tool. Symbols and call hierarchy are
|
|
17
|
+
* not operations here; they need different schemas.
|
|
18
|
+
*/
|
|
19
|
+
type LspOperation = 'goToDefinition' | 'findReferences' | 'goToImplementation' | 'hover'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```ts type-equiv
|
|
23
|
+
/** A zero-based UTF-16 cursor coordinate, matching the LSP wire convention. */
|
|
24
|
+
interface LspPosition {
|
|
25
|
+
/** Zero-based line. */
|
|
26
|
+
readonly line: number
|
|
27
|
+
/** Zero-based UTF-16 code-unit offset within the line. */
|
|
28
|
+
readonly character: number
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```ts type-equiv
|
|
33
|
+
/** A zero-based UTF-16 half-open range `[start, end)`. */
|
|
34
|
+
interface LspRange {
|
|
35
|
+
readonly start: LspPosition
|
|
36
|
+
readonly end: LspPosition
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 请求
|
|
41
|
+
|
|
42
|
+
每个字段都是必填项:`workspaceRoot` 由调用方提供,`languageId` 来自提供方注册而非请求,超时与结果上限由消费方决定。因此没有字段需要由实现提供默认值,也不存在 `resolve()` 步骤。提供方收到调用方请求和派生的 `languageId`;后者只用于同步瞬态文档,从不参与选择。
|
|
43
|
+
|
|
44
|
+
```ts type-equiv
|
|
45
|
+
/**
|
|
46
|
+
* A caller's normalized query. Every field is required: `workspaceRoot` is caller-supplied,
|
|
47
|
+
* `languageId` comes from the provider registration (not here), and consumers own timeouts and
|
|
48
|
+
* result limits — so no field needs implementation defaulting and there is no `resolve()` step.
|
|
49
|
+
*/
|
|
50
|
+
interface LspQueryRequest {
|
|
51
|
+
/** Which semantic query to run. */
|
|
52
|
+
readonly operation: LspOperation
|
|
53
|
+
/** The source file to query (relative to `workspaceRoot` or absolute; the provider canonicalizes). */
|
|
54
|
+
readonly filePath: string
|
|
55
|
+
/** The zero-based UTF-16 cursor position to query at. */
|
|
56
|
+
readonly position: LspPosition
|
|
57
|
+
/** The workspace root the provider resolves against and indexes; required, never defaulted. */
|
|
58
|
+
readonly workspaceRoot: string
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```ts type-equiv
|
|
63
|
+
/**
|
|
64
|
+
* A request as a provider receives it: the caller's {@link LspQueryRequest} plus the `languageId`
|
|
65
|
+
* the seam derived from the provider's extension mapping. The language id only synchronizes the
|
|
66
|
+
* transient document; it does not participate in selection.
|
|
67
|
+
*/
|
|
68
|
+
interface LspProviderQuery extends LspQueryRequest {
|
|
69
|
+
/** The LSP language id for `filePath`, from this provider's extension mapping. */
|
|
70
|
+
readonly languageId: string
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 结果
|
|
75
|
+
|
|
76
|
+
这是一个闭合的可辨识联合:导航操作规范化为 `locations`,`hover` 规范化为内容或 `null`。消费方使用 `switch` 对 `kind` 做穷尽处理,因此新增分支会使编译失败,直到完成处理。`findReferences` 始终包含声明;提供方在内部强制保证这一点,因此调用方没有对应 flag。`locations` 变体携带 `resolvedWorkspaceUri`,即提供方的规范工作区 `file:` URI。调用方相对化位置 URI 时应使用这一坐标,而不是对可能经过符号链接的请求根目录应用宿主平台路径规则。
|
|
77
|
+
|
|
78
|
+
```ts type-equiv
|
|
79
|
+
/** One resolved location: a document URI and the range within it. */
|
|
80
|
+
interface LspLocation {
|
|
81
|
+
/** The target document URI (`file:` or otherwise), verbatim from the server. */
|
|
82
|
+
readonly uri: string
|
|
83
|
+
/** The range within the target document. */
|
|
84
|
+
readonly range: LspRange
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```ts type-equiv
|
|
89
|
+
/** Normalized hover content, or `null` for no hover at the position. */
|
|
90
|
+
interface LspHover {
|
|
91
|
+
/** The normalized hover text (markdown or plaintext, provider-joined). */
|
|
92
|
+
readonly contents: string
|
|
93
|
+
/** The range the hover applies to, when the server supplied one. */
|
|
94
|
+
readonly range?: LspRange
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```ts type-equiv
|
|
99
|
+
/**
|
|
100
|
+
* The closed result union. Navigation operations (`goToDefinition`, `findReferences`,
|
|
101
|
+
* `goToImplementation`) normalize to `locations`; `hover` normalizes to content or `null`.
|
|
102
|
+
* Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled.
|
|
103
|
+
*
|
|
104
|
+
* The `locations` variant carries `resolvedWorkspaceUri`: the provider's canonical `file:` URI for
|
|
105
|
+
* the request's workspace root. A caller that relativizes location URIs MUST use this, not parse the
|
|
106
|
+
* request's possibly symlinked process path with host-platform rules; the execution platform may
|
|
107
|
+
* differ from the caller's.
|
|
108
|
+
*/
|
|
109
|
+
type LspQueryResult =
|
|
110
|
+
| { readonly kind: 'locations'; readonly locations: readonly LspLocation[]; readonly resolvedWorkspaceUri: string }
|
|
111
|
+
| { readonly kind: 'hover'; readonly hover: LspHover | null }
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 提供方与服务
|
|
115
|
+
|
|
116
|
+
每个提供方拥有一个稳定的品牌化 `id`,以及一份互斥的、小写且以点开头的扩展名映射。`registerProvider` 会原子预留 id 和每个扩展名:注册无效或冲突时不发布任何内容;其 disposer 会释放所有保留项。每次查询独立选择提供方,且选择与顺序无关;没有匹配项时抛出 `LspError` `LSP_UNAVAILABLE`。该 seam 不公开协议类型、进程或文档控制,也不提供通用 JSON-RPC 逃生口。
|
|
117
|
+
|
|
118
|
+
```ts type-equiv
|
|
119
|
+
/**
|
|
120
|
+
* A language-server backend registered on `ctx.lsp`. Each provider owns a stable {@link
|
|
121
|
+
* LspProviderId} and an extension-to-language-id map (lowercase, leading-dot keys).
|
|
122
|
+
* `findReferences` always includes declarations — the provider enforces this internally; callers
|
|
123
|
+
* get no flag.
|
|
124
|
+
*/
|
|
125
|
+
interface LspProvider {
|
|
126
|
+
/** Stable provider identity, reserved atomically with the extension mappings. */
|
|
127
|
+
readonly id: LspProviderId
|
|
128
|
+
/** Lowercase leading-dot extension → LSP language id (e.g. `{ '.ts': 'typescript' }`). */
|
|
129
|
+
readonly extensionToLanguage: Readonly<Record<string, string>>
|
|
130
|
+
/**
|
|
131
|
+
* Run one query. The seam has already selected this provider and derived `languageId`.
|
|
132
|
+
* @param request - the resolved provider query (caller request + derived language id).
|
|
133
|
+
* @param signal - optional cancellation; the provider stops its own work when it aborts.
|
|
134
|
+
* @returns the normalized, closed-union result.
|
|
135
|
+
*/
|
|
136
|
+
query(request: LspProviderQuery, signal?: AbortSignal): Promise<LspQueryResult>
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```ts type-equiv
|
|
141
|
+
/**
|
|
142
|
+
* The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query
|
|
143
|
+
* execution; exposes exactly the four operations and no protocol escape hatch.
|
|
144
|
+
*/
|
|
145
|
+
interface LspService {
|
|
146
|
+
/**
|
|
147
|
+
* Register a provider, atomically reserving its id and every normalized extension. Any conflict
|
|
148
|
+
* or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
|
|
149
|
+
* reservations. Disposed with the calling fiber.
|
|
150
|
+
* @param provider - the backend to register.
|
|
151
|
+
* @returns a synchronous disposer releasing the id and all extension reservations.
|
|
152
|
+
*/
|
|
153
|
+
registerProvider(provider: LspProvider): () => void
|
|
154
|
+
/**
|
|
155
|
+
* Select a provider by the file's extension and run one query. Selection is per-query and
|
|
156
|
+
* order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
|
|
157
|
+
* @param request - the normalized query.
|
|
158
|
+
* @param signal - optional cancellation forwarded to the selected provider.
|
|
159
|
+
* @returns the normalized, closed-union result.
|
|
160
|
+
*/
|
|
161
|
+
query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`LspProviderId` 是该 seam 的品牌化 id(来自 [dsh-brand](../../packages/util/brand) 的 `Branded<'LspProviderId'>`);`LspError` 扩展 `HarnessError`,提供 `LSP_INVALID_PROVIDER`、`LSP_CONFLICT`、`LSP_UNAVAILABLE`、`LSP_DISPOSED`、`LSP_UNSUPPORTED_OPERATION` 和 `LSP_MALFORMED_RESPONSE` 等稳定错误码,调用方应按错误码路由,而不是解析 `message`。
|
|
166
|
+
|
|
167
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
168
|
+
|
|
169
|
+
<a id="cordis-surface"></a>
|
|
170
|
+
|
|
171
|
+
## Cordis API
|
|
172
|
+
|
|
173
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
174
|
+
|
|
175
|
+
<a id="ctxlsp--lspservice"></a>
|
|
176
|
+
|
|
177
|
+
### `ctx.lsp` — `LspService`
|
|
178
|
+
|
|
179
|
+
The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query execution; exposes exactly the four operations and no protocol escape hatch.
|
|
180
|
+
|
|
181
|
+
```ts cordis-catalog
|
|
182
|
+
/**
|
|
183
|
+
* Register a provider, atomically reserving its id and every normalized extension. Any conflict
|
|
184
|
+
* or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
|
|
185
|
+
* reservations. Disposed with the calling fiber.
|
|
186
|
+
* @param provider - the backend to register.
|
|
187
|
+
* @returns a synchronous disposer releasing the id and all extension reservations.
|
|
188
|
+
*/
|
|
189
|
+
registerProvider(provider: LspProvider): () => void
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Select a provider by the file's extension and run one query. Selection is per-query and
|
|
193
|
+
* order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
|
|
194
|
+
* @param request - the normalized query.
|
|
195
|
+
* @param signal - optional cancellation forwarded to the selected provider.
|
|
196
|
+
* @returns the normalized, closed-union result.
|
|
197
|
+
*/
|
|
198
|
+
query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Source: [`packages/lsp/lsp/src/types.ts:113`](../../packages/lsp/lsp/src/types.ts)
|
|
202
|
+
<!-- END GENERATED cordis-surface -->
|
|
@@ -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/subsystems/permission-presets.md
|
|
5
|
+
permission-presets.md: 16ce29a4c3b00fece089ebcdc959e57f419d35c9
|
|
6
|
+
permission-presets.zh.md: d2e5eff6696d5dc6f925032d7eaafb7b19774f4e
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Permission Presets
|
|
2
|
+
|
|
3
|
+
English | [中文](permission-presets.zh.md)
|
|
4
|
+
|
|
5
|
+
The permission-preset layer of [dsh-permission-presets](../../packages/interaction/permission-presets) (`ctx.permissionPresets`, `PermissionPresetService`) bundles the two independent enforcement knobs — [sandbox mode](sandbox.md) (`sandbox/mode`) and [approval policy](approval.md) (`approval/policy`) — into named presets a client offers as one Permissions selector. It is one optional capability, not part of the agent-loop spine, and it owns no enforcement: execution, prompt narration, and replay keep reading their knob folds, and a preset switch only records intent and writes through each knob's canonical setter. The [package README](../../packages/interaction/permission-presets/README.md) owns composition status and limitations; the [sandbox switching design](../../.agents/notes/implemented/feature/2026-07-06-sandbox.md) owns the rationale.
|
|
6
|
+
|
|
7
|
+
Source: [`packages/interaction/permission-presets/src/index.ts`](../../packages/interaction/permission-presets/src/index.ts)
|
|
8
|
+
|
|
9
|
+
## The preset table
|
|
10
|
+
|
|
11
|
+
A preset is a table key mapping to one sandbox/approval bundle plus optional client presentation; the default table ships `workspace-write` (`workspace-write` + `ask`) and `danger-full-access` (`danger-full-access` + `never`).
|
|
12
|
+
|
|
13
|
+
```ts type-equiv
|
|
14
|
+
/** One preset's sandbox/approval bundle and optional client presentation. */
|
|
15
|
+
interface PresetSpec {
|
|
16
|
+
/** The `sandbox/mode` value the preset writes through. */
|
|
17
|
+
sandbox: SandboxMode
|
|
18
|
+
/** The `approval/policy` value the preset writes through. */
|
|
19
|
+
approval: ApprovalPolicy
|
|
20
|
+
/** The display label a client shows for this preset; the raw table key when omitted. */
|
|
21
|
+
name?: string
|
|
22
|
+
/** One user-facing sentence on what the preset means; omitted when not configured. */
|
|
23
|
+
description?: string
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```ts type-equiv
|
|
28
|
+
/** The {@link PermissionPresetService} config: preset table and composition default. */
|
|
29
|
+
interface Config {
|
|
30
|
+
/**
|
|
31
|
+
* The preset table: name → knob bundle. Defaults to `workspace-write`
|
|
32
|
+
* (workspace-write + ask) and `danger-full-access` (danger-full-access +
|
|
33
|
+
* never). The name `custom` is reserved for the derived not-a-preset state.
|
|
34
|
+
*/
|
|
35
|
+
presets?: Record<string, PresetSpec>
|
|
36
|
+
/**
|
|
37
|
+
* Default for new sessions. When omitted, the preset matching the composed
|
|
38
|
+
* sandbox and approval defaults is used.
|
|
39
|
+
*/
|
|
40
|
+
defaultPreset?: string
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The service requires a confining `ctx.shell` executor and `ctx.approval`, and misconfiguration fails at plugin load: a table entry named `custom` throws (the name is reserved for the derived not-a-preset state), and composing over a bash executor that does not confine (no `sandboxMode` capability fact) throws, because presets bundle a sandbox mode.
|
|
45
|
+
|
|
46
|
+
## Current preset and the derived `custom`
|
|
47
|
+
|
|
48
|
+
`current(events)` derives the effective preset from the knobs, not from its own event alone: it folds the session's effective sandbox mode (falling back to the executor's configured mode) and effective approval policy (falling back to the approval service config, then `ask`), prefers a still-matching recorded selection, then the first matching table entry in declaration order, and otherwise returns `CUSTOM_PRESET` (`'custom'`). `custom` is derived-only: clients may display it as the current value, but it is never a switch target or an event payload.
|
|
49
|
+
|
|
50
|
+
`names` lists the switchable presets in table declaration order; `optionOf(name)` builds the option a client renders for a table key (label falls back to the key) or for `custom`, and throws for any other name.
|
|
51
|
+
|
|
52
|
+
```ts type-equiv
|
|
53
|
+
/** The select-option shape a presentation layer advertises for one preset (or for the derived `custom` state). */
|
|
54
|
+
interface PresetOption {
|
|
55
|
+
/** Stable option value: the table key, or `custom`. */
|
|
56
|
+
value: string
|
|
57
|
+
/** The display label. */
|
|
58
|
+
name: string
|
|
59
|
+
/** One user-facing sentence on what the value means; omitted when not configured. */
|
|
60
|
+
description?: string
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Switching and the `permission/preset` event
|
|
65
|
+
|
|
66
|
+
`set(session, name)` resolves the preset (unknown names throw), appends a log-only `permission/preset` event unless `name` is already the effective preset, then writes each knob through its own setter — `setSandboxMode` from [dsh-sandbox-policy](../../packages/sandbox/sandbox-policy) and `setApprovalPolicy` from [dsh-user-approval](../../packages/interaction/user-approval) — only when that knob's effective value changes. The selection event precedes the knob events in the same turn, and re-selecting the effective preset appends nothing at all.
|
|
67
|
+
|
|
68
|
+
`permission/preset` is durable, log-only user intent: it stays out of the model transcript (the knob events own the model-visible consequences through their consumers), and it exists so `current()` can preserve WHICH preset the user chose when two presets share a bundle; `effectivePermissionPreset(events)` folds the last one, and replay needs no catch-up state. The complete event declaration is in the [persistence log event catalog](../persistence-catalog.md); the method signatures are in the generated [service catalog](#ctxpermissionpresets--permissionpresetservice).
|
|
69
|
+
|
|
70
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
71
|
+
|
|
72
|
+
<a id="cordis-surface"></a>
|
|
73
|
+
|
|
74
|
+
## Cordis API
|
|
75
|
+
|
|
76
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
77
|
+
|
|
78
|
+
<a id="ctxpermissionpresets--permissionpresetservice"></a>
|
|
79
|
+
|
|
80
|
+
### `ctx.permissionPresets` — `PermissionPresetService`
|
|
81
|
+
|
|
82
|
+
Owns the deployment's permission presets and their write path. Requires a confining `ctx.shell` executor and `ctx.approval`; unmatched knob values are reported as CUSTOM_PRESET, not an error.
|
|
83
|
+
|
|
84
|
+
```ts cordis-catalog
|
|
85
|
+
/**
|
|
86
|
+
* Resolve the preset matching the effective knob values. A still-matching
|
|
87
|
+
* last selection wins shared-bundle ties; otherwise the first table match
|
|
88
|
+
* wins, or {@link CUSTOM_PRESET} when no entry matches.
|
|
89
|
+
* @param events - the session's events in log order.
|
|
90
|
+
* @returns the effective preset name, or `custom` when nothing matches.
|
|
91
|
+
*/
|
|
92
|
+
current(events: readonly SessionEvent[]): string
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Build the whole select value for one folded knob state: every table
|
|
96
|
+
* option in declaration order, `custom` appended exactly while derived.
|
|
97
|
+
* @param state - the folded knob overrides.
|
|
98
|
+
* @returns the `permissions` projection payload.
|
|
99
|
+
*/
|
|
100
|
+
selectFor(state: KnobState): PermissionSelect
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Resolve a preset's knob bundle.
|
|
104
|
+
* @param name - the preset name to resolve.
|
|
105
|
+
* @returns the configured bundle.
|
|
106
|
+
* @throws when `name` is not in the table.
|
|
107
|
+
*/
|
|
108
|
+
resolve(name: string): PresetSpec
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Build the client option for a table entry or {@link CUSTOM_PRESET}. A
|
|
112
|
+
* missing label falls back to the table key.
|
|
113
|
+
* @param name - a table key, or `custom`.
|
|
114
|
+
* @returns the option a client renders.
|
|
115
|
+
* @throws when `name` is neither a table key nor `custom`.
|
|
116
|
+
*/
|
|
117
|
+
optionOf(name: string): PresetOption
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Record a changed preset, then update each changed knob through its own
|
|
121
|
+
* setter. Selecting the effective preset again appends nothing.
|
|
122
|
+
* @param session - the session the switch belongs to.
|
|
123
|
+
* @param name - the preset to switch to; unknown names throw.
|
|
124
|
+
*/
|
|
125
|
+
set(session: Session, name: string): void
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Types: [Session](session.md) · [SessionEvent](session.md)
|
|
129
|
+
|
|
130
|
+
Source: [`packages/interaction/permission-presets/src/index.ts:159`](../../packages/interaction/permission-presets/src/index.ts)
|
|
131
|
+
<!-- END GENERATED cordis-surface -->
|