dsh-plugin-guide 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.es.md +1 -1
- package/README.hi.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/SKILL.md +1 -1
- package/dist/dsh-plugin-dev.js +5 -5
- package/guide/links.md +1 -1
- package/guide/plugin-dev-guide.md +1 -1
- package/guide/quick-reference.es.md +2 -2
- package/guide/quick-reference.hi.md +1 -1
- package/guide/quick-reference.md +2 -2
- package/guide/quick-reference.pt.md +2 -2
- package/guide/quick-reference.zh-CN.md +2 -2
- package/package.json +3 -3
- package/references/cordis-paper-and-community.md +1 -1
- package/references/official-docs/AGENTS.md +27 -22
- package/references/official-docs/README.i18n.yaml +2 -2
- package/references/official-docs/README.md +1 -1
- package/references/official-docs/README.zh.md +19 -9
- package/references/official-docs/SNAPSHOT.md +5 -5
- package/references/official-docs/THIRD_PARTY_NOTICES.md +36 -13
- package/references/official-docs/docs/AGENTS.md +4 -4
- package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
- package/references/official-docs/docs/agent-lifecycle.md +1 -1
- package/references/official-docs/docs/agent-lifecycle.zh.md +2 -2
- package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
- package/references/official-docs/docs/api-gateway.md +8 -8
- package/references/official-docs/docs/api-gateway.zh.md +8 -8
- package/references/official-docs/docs/architecture.i18n.yaml +2 -2
- package/references/official-docs/docs/architecture.md +23 -7
- package/references/official-docs/docs/architecture.zh.md +36 -20
- package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
- package/references/official-docs/docs/capability-seams.md +132 -67
- package/references/official-docs/docs/capability-seams.zh.md +132 -67
- package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/config-catalog.md +659 -373
- package/references/official-docs/docs/config-catalog.zh.md +677 -391
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-package.md +2 -3
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +8 -7
- package/references/official-docs/docs/cookbook/{adding-a-conversation-node.i18n.yaml → adding-a-remote-api.i18n.yaml} +3 -3
- package/references/official-docs/docs/cookbook/adding-a-remote-api.md +197 -0
- package/references/official-docs/docs/cookbook/adding-a-remote-api.zh.md +197 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.md +102 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +102 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-tool.md +11 -4
- package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +16 -9
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +2 -2
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +4 -4
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +1 -1
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +3 -3
- package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/extension-cookbook.md +9 -8
- package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +17 -14
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +1 -1
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +1 -1
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +1 -1
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/context.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-api/context.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/events.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-api/events.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/inherited.md +1 -1
- package/references/official-docs/docs/cordis-primer.i18n.yaml +2 -2
- package/references/official-docs/docs/cordis-primer.md +2 -1
- package/references/official-docs/docs/cordis-primer.zh.md +3 -2
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +2 -2
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +3 -3
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +2 -2
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +5 -4
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +11 -10
- package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/index.zh.md +10 -10
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +6 -0
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +159 -0
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +159 -0
- package/references/official-docs/docs/defensive-patterns.i18n.yaml +1 -1
- package/references/official-docs/docs/defensive-patterns.zh.md +3 -1
- package/references/official-docs/docs/development.i18n.yaml +2 -2
- package/references/official-docs/docs/development.md +9 -13
- package/references/official-docs/docs/development.zh.md +23 -21
- package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
- package/references/official-docs/docs/event-producer-consumer.md +55 -46
- package/references/official-docs/docs/event-producer-consumer.zh.md +55 -46
- package/references/official-docs/docs/glossary.i18n.yaml +2 -2
- package/references/official-docs/docs/glossary.md +1 -1
- package/references/official-docs/docs/glossary.zh.md +1 -1
- package/references/official-docs/docs/graph-atlas.i18n.yaml +2 -2
- package/references/official-docs/docs/graph-atlas.md +0 -2
- package/references/official-docs/docs/graph-atlas.zh.md +7 -9
- package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
- package/references/official-docs/docs/i18n/README.md +7 -7
- package/references/official-docs/docs/i18n/README.zh.md +11 -9
- package/references/official-docs/docs/i18n/style-samples.md +3 -3
- package/references/official-docs/docs/i18n/translation-prompt.md +3 -3
- package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +2 -2
- package/references/official-docs/docs/i18n/translation-rules.md +2 -2
- package/references/official-docs/docs/i18n/translation-rules.zh.md +3 -3
- package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
- package/references/official-docs/docs/module-graph.md +666 -747
- package/references/official-docs/docs/module-graph.zh.md +668 -749
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/persistence-catalog.md +172 -40
- package/references/official-docs/docs/persistence-catalog.zh.md +180 -48
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +2 -2
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +3 -3
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +2 -2
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +2 -2
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +1 -1
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +2 -2
- package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
- package/references/official-docs/docs/postmortem/README.zh.md +5 -5
- package/references/official-docs/docs/rescope.i18n.yaml +2 -2
- package/references/official-docs/docs/rescope.md +2 -2
- package/references/official-docs/docs/rescope.zh.md +3 -3
- package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/README.md +8 -2
- package/references/official-docs/docs/subsystems/README.zh.md +53 -47
- package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/agent-team.md +206 -0
- package/references/official-docs/docs/subsystems/agent-team.zh.md +206 -0
- package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/approval.md +12 -12
- package/references/official-docs/docs/subsystems/approval.zh.md +13 -13
- package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/attachment.md +90 -7
- package/references/official-docs/docs/subsystems/attachment.zh.md +90 -7
- package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/client-modules.md +69 -19
- package/references/official-docs/docs/subsystems/client-modules.zh.md +69 -19
- package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/code-runtime.md +5 -5
- package/references/official-docs/docs/subsystems/code-runtime.zh.md +6 -6
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/commands.md +29 -6
- package/references/official-docs/docs/subsystems/commands.zh.md +30 -7
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/compaction.md +5 -5
- package/references/official-docs/docs/subsystems/compaction.zh.md +11 -11
- package/references/official-docs/docs/subsystems/conversation.i18n.yaml +6 -0
- package/references/official-docs/docs/{cookbook/adding-a-conversation-node.md → subsystems/conversation.md} +49 -24
- package/references/official-docs/docs/{cookbook/adding-a-conversation-node.zh.md → subsystems/conversation.zh.md} +49 -24
- package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/core.md +110 -33
- package/references/official-docs/docs/subsystems/core.zh.md +141 -62
- package/references/official-docs/docs/subsystems/credentials.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/credentials.md +207 -11
- package/references/official-docs/docs/subsystems/credentials.zh.md +207 -11
- package/references/official-docs/docs/subsystems/extensions.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/extensions.md +27 -9
- package/references/official-docs/docs/subsystems/extensions.zh.md +30 -12
- package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/feedback.md +4 -4
- package/references/official-docs/docs/subsystems/feedback.zh.md +4 -4
- package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/filesystem.md +17 -7
- package/references/official-docs/docs/subsystems/filesystem.zh.md +19 -9
- package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/goal.md +4 -4
- package/references/official-docs/docs/subsystems/goal.zh.md +8 -8
- package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/invariants.md +2 -2
- package/references/official-docs/docs/subsystems/invariants.zh.md +5 -5
- package/references/official-docs/docs/subsystems/jobs.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/jobs.md +3 -3
- package/references/official-docs/docs/subsystems/jobs.zh.md +6 -6
- package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/llm-streaming.md +193 -22
- package/references/official-docs/docs/subsystems/llm-streaming.zh.md +199 -28
- package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/lsp.md +2 -2
- package/references/official-docs/docs/subsystems/lsp.zh.md +3 -3
- package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/permission-presets.md +8 -8
- package/references/official-docs/docs/subsystems/permission-presets.zh.md +8 -8
- package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/persistence.md +35 -17
- package/references/official-docs/docs/subsystems/persistence.zh.md +38 -20
- package/references/official-docs/docs/subsystems/plan.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/plan.md +4 -4
- package/references/official-docs/docs/subsystems/plan.zh.md +10 -10
- package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/sandbox.md +5 -3
- package/references/official-docs/docs/subsystems/sandbox.zh.md +8 -6
- package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/schedule.md +9 -3
- package/references/official-docs/docs/subsystems/schedule.zh.md +11 -5
- package/references/official-docs/docs/subsystems/scope.i18n.yaml +1 -1
- package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
- package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-projection.md +136 -67
- package/references/official-docs/docs/subsystems/session-projection.zh.md +136 -67
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-query.md +11 -3
- package/references/official-docs/docs/subsystems/session-query.zh.md +12 -4
- package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-reference.md +94 -7
- package/references/official-docs/docs/subsystems/session-reference.zh.md +95 -8
- package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-telemetry.md +5 -6
- package/references/official-docs/docs/subsystems/session-telemetry.zh.md +9 -10
- package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-title.md +3 -3
- package/references/official-docs/docs/subsystems/session-title.zh.md +5 -5
- package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session.md +284 -39
- package/references/official-docs/docs/subsystems/session.zh.md +301 -54
- package/references/official-docs/docs/subsystems/settings.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/settings.md +105 -10
- package/references/official-docs/docs/subsystems/settings.zh.md +105 -10
- package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/shell.md +3 -3
- package/references/official-docs/docs/subsystems/shell.zh.md +11 -11
- package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/skills.md +26 -3
- package/references/official-docs/docs/subsystems/skills.zh.md +29 -6
- package/references/official-docs/docs/subsystems/slots.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/slots.md +174 -0
- package/references/official-docs/docs/subsystems/slots.zh.md +174 -0
- package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/spill.md +4 -4
- package/references/official-docs/docs/subsystems/spill.zh.md +6 -6
- package/references/official-docs/docs/subsystems/storage.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/storage.md +13 -5
- package/references/official-docs/docs/subsystems/storage.zh.md +16 -8
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subagent.md +120 -32
- package/references/official-docs/docs/subsystems/subagent.zh.md +131 -41
- package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subprocess.md +3 -3
- package/references/official-docs/docs/subsystems/subprocess.zh.md +5 -5
- package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/system-prompt.md +21 -8
- package/references/official-docs/docs/subsystems/system-prompt.zh.md +23 -10
- package/references/official-docs/docs/subsystems/terminal.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/terminal.md +2 -2
- package/references/official-docs/docs/subsystems/terminal.zh.md +4 -4
- package/references/official-docs/docs/subsystems/todo.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/todo.md +32 -0
- package/references/official-docs/docs/subsystems/todo.zh.md +32 -0
- package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/token-meter.md +27 -12
- package/references/official-docs/docs/subsystems/token-meter.zh.md +28 -13
- package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/tools.md +46 -46
- package/references/official-docs/docs/subsystems/tools.zh.md +54 -54
- package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/typert.md +65 -58
- package/references/official-docs/docs/subsystems/typert.zh.md +67 -60
- package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/user-questions.md +35 -35
- package/references/official-docs/docs/subsystems/user-questions.zh.md +35 -35
- package/references/official-docs/docs/subsystems/web-client.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/web-client.md +95 -0
- package/references/official-docs/docs/subsystems/web-client.zh.md +95 -0
- package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/web-server.md +55 -9
- package/references/official-docs/docs/subsystems/web-server.zh.md +56 -10
- package/references/official-docs/docs/subsystems/web.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/web.md +14 -7
- package/references/official-docs/docs/subsystems/web.zh.md +16 -9
- package/references/official-docs/docs/subsystems/webhook.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/webhook.md +70 -0
- package/references/official-docs/docs/subsystems/webhook.zh.md +70 -0
- package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/workflow.md +8 -8
- package/references/official-docs/docs/subsystems/workflow.zh.md +13 -13
- package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/workspace.md +98 -5
- package/references/official-docs/docs/subsystems/workspace.zh.md +102 -9
- package/references/official-docs/docs/testing.i18n.yaml +2 -2
- package/references/official-docs/docs/testing.md +15 -10
- package/references/official-docs/docs/testing.zh.md +15 -10
- package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/tool-catalog.md +433 -27
- package/references/official-docs/docs/tool-catalog.zh.md +438 -29
- package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
- package/references/official-docs/docs/tool-execution-pipeline.md +1 -1
- package/references/official-docs/docs/tool-execution-pipeline.zh.md +1 -1
- package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/config.md +1 -1
- package/references/official-docs/docs/user/develop/basic/config.zh.md +4 -4
- package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +1 -1
- package/references/official-docs/docs/user/develop/basic/index.zh.md +5 -5
- package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/publish.md +3 -3
- package/references/official-docs/docs/user/develop/basic/publish.zh.md +7 -7
- package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/tool.md +3 -3
- package/references/official-docs/docs/user/develop/basic/tool.zh.md +4 -4
- package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/framework/events.md +2 -2
- package/references/official-docs/docs/user/develop/framework/events.zh.md +3 -3
- package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +1 -1
- package/references/official-docs/docs/user/develop/framework/index.zh.md +3 -3
- package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/framework/service.md +1 -1
- package/references/official-docs/docs/user/develop/framework/service.zh.md +3 -3
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +15 -0
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
- package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/practice/index.md +1 -1
- package/references/official-docs/docs/user/develop/practice/index.zh.md +3 -3
- package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/practice/llm-adapter.md +4 -3
- package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +4 -3
- package/references/official-docs/docs/user/guide/github-review.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/github-review.md +102 -0
- package/references/official-docs/docs/user/guide/github-review.zh.md +102 -0
- package/references/official-docs/docs/user/guide/index.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/index.md +2 -2
- package/references/official-docs/docs/user/guide/index.zh.md +8 -8
- package/references/official-docs/docs/user/guide/mcp-memory.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/mcp-memory.md +101 -0
- package/references/official-docs/docs/user/guide/mcp-memory.zh.md +101 -0
- package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/providers.md +40 -1
- package/references/official-docs/docs/user/guide/providers.zh.md +41 -2
- package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/python-sdk.md +80 -34
- package/references/official-docs/docs/user/guide/python-sdk.zh.md +87 -41
- package/references/official-docs/docs/user/guide/schedule.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/schedule.md +21 -0
- package/references/official-docs/docs/user/guide/schedule.zh.md +21 -0
- package/references/official-docs/docs/web-styling.i18n.yaml +1 -1
- package/references/official-docs/docs/web-styling.zh.md +2 -2
- package/references/official-docs/packages/AGENTS.md +3 -2
- package/references/official-docs/packages/README.md +104 -59
- package/references/official-docs/vendor/README.md +1 -0
- package/references/official-docs/website-docs.ts +52 -11
- package/references/sources.md +2 -2
- package/references/website-pages.md +3 -3
- package/scripts/download-sources.ps1 +1 -1
- package/scripts/sync-official-docs.ps1 +19 -11
- package/scripts/verify-kit.ps1 +0 -4
- package/templates/js/README.es.md +1 -1
- package/templates/js/README.hi.md +1 -1
- package/templates/js/README.md +1 -1
- package/templates/js/README.pt.md +1 -1
- package/templates/js/README.zh.md +1 -1
- package/templates/js/package.json +4 -4
- package/templates/ts/README.es.md +1 -1
- package/templates/ts/README.hi.md +1 -1
- package/templates/ts/README.md +1 -1
- package/templates/ts/README.pt.md +1 -1
- package/templates/ts/README.zh.md +1 -1
- package/templates/ts/package.json +4 -4
- package/references/official-docs/examples/AGENTS.md +0 -20
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[English](jobs.md) | 中文
|
|
4
4
|
|
|
5
|
-
长时间运行的生产方、`ctx.jobs` 与任务控制命令共用的类型。[运行时 Agent Note](../../.agents/notes/implemented/architecture/2026-06-20-generic-long-running-tool-runtime.md) 负责设计;本页记录 [`packages/jobs/jobs/src/types.ts`](../../packages/jobs/jobs/src/types.ts) 中的确切字段和变体。
|
|
5
|
+
长时间运行的生产方、`ctx.jobs` 与任务控制命令共用的类型。[运行时 Agent Note](../../.agents/notes/implemented/architecture/2026-06-20-generic-long-running-tool-runtime.zh.md) 负责设计;本页记录 [`packages/jobs/jobs/src/types.ts`](../../packages/jobs/jobs/src/types.ts) 中的确切字段和变体。
|
|
6
6
|
|
|
7
7
|
## ID 与状态
|
|
8
8
|
|
|
9
|
-
`JobId` 是按 `<kind>-N` 生成的[品牌化 id](core.md#branded-ids)。访问控制依赖拥有者授权,而非 id 的保密性。`JobKind` 派生自可合并扩展的 map;注册表将各个 kind 视为不透明的 id 命名空间。
|
|
9
|
+
`JobId` 是按 `<kind>-N` 生成的[品牌化 id](core.zh.md#branded-ids)。访问控制依赖拥有者授权,而非 id 的保密性。`JobKind` 派生自可合并扩展的 map;注册表将各个 kind 视为不透明的 id 命名空间。
|
|
10
10
|
|
|
11
11
|
```ts type-equiv
|
|
12
12
|
/**
|
|
@@ -154,7 +154,7 @@ interface JobRead {
|
|
|
154
154
|
|
|
155
155
|
## 服务行为
|
|
156
156
|
|
|
157
|
-
抽象的 [`JobRegistry`](../../packages/jobs/jobs/src/index.ts) Service Definition 规定原子 `start`、限定调用方作用域的 `get` 和 `list`、`read`、`kill`、有界 `wait`、故障隔离的 `onJobDone` 与 `onJobsChanged` 监听器,以及 `attachController
|
|
157
|
+
抽象的 [`JobRegistry`](../../packages/jobs/jobs/src/index.ts) Service Definition 规定原子 `start`、限定调用方作用域的 `get` 和 `list`、`read`、`kill`、有界 `wait`、故障隔离的 `onJobDone` 与 `onJobsChanged` 监听器,以及 `attachController`;[`LocalJobRegistry`](../../packages/jobs/jobs-local/src/index.ts) 是其进程局部 Service Provider。授权会比较拥有者会话;拥有者清理与准入会使用确切的已注册 `Agent` 实例。本地 Service Provider 的 `maxConcurrentJobsPerOwner` 配置必须是正的安全整数,默认值为 `10`;它按确切 owner 统计 `running` 与 `stopping` 记录,所有无 owner 任务共享一个服务级桶,并在生产方终止结算后释放容量。Service Definition 约定见 [`dsh-jobs`](../../packages/jobs/jobs/README.zh.md),注册表生命周期与准入策略见 [`dsh-jobs-local`](../../packages/jobs/jobs-local/README.zh.md),面向模型的 Consumer 见 [`dsh-tool-jobs`](../../packages/jobs/tool-jobs/README.zh.md)。
|
|
158
158
|
|
|
159
159
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
160
160
|
|
|
@@ -162,7 +162,7 @@ interface JobRead {
|
|
|
162
162
|
|
|
163
163
|
## Cordis API
|
|
164
164
|
|
|
165
|
-
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`) —
|
|
165
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
166
166
|
|
|
167
167
|
<a id="ctxjobs--jobregistry-abstract-seam"></a>
|
|
168
168
|
|
|
@@ -284,7 +284,7 @@ abstract onJobsChanged(listener: JobsChangedListener): () => void
|
|
|
284
284
|
abstract attachController(name: string): () => void
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
-
Types: [Agent](core.md)
|
|
287
|
+
Types: [Agent](core.zh.md)
|
|
288
288
|
|
|
289
|
-
Source: [`packages/jobs/jobs/src/index.ts
|
|
289
|
+
Source: [`packages/jobs/jobs/src/index.ts`](../../packages/jobs/jobs/src/index.ts)
|
|
290
290
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write docs/subsystems/llm-streaming.md
|
|
5
|
-
llm-streaming.md:
|
|
6
|
-
llm-streaming.zh.md:
|
|
5
|
+
llm-streaming.md: 6867ae292d77474bcedc1466ae0ce6b1fc1c92d3
|
|
6
|
+
llm-streaming.zh.md: b75e24f2e9010b4fb08c035f14bc4e91dc3971ef
|
|
@@ -28,7 +28,19 @@ interface ContentBlockMap {
|
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
The block interfaces (full fields in source): `TextBlock` (`text`), `ReasoningBlock` (thinking, distinct from visible text), `ImageBlock` (a durable [image attachment](attachment.md)), `ToolCallBlock` (`id:
|
|
31
|
+
The block interfaces (full fields in source): `TextBlock` (`text`), `ReasoningBlock` (thinking, distinct from visible text), `ImageBlock` (a durable [image attachment](attachment.md)), `ToolCallBlock` (`id: ToolCallId`, `name`, raw-JSON `arguments`), and `ToolResultBlock` (`toolCallId`, nested `content: ContentBlock[]`, `isError?`). `ContentBlock = ContentBlockMap[ContentBlockType]`. A new modality belongs in the merge-extensible map only when its adapter, UI, compaction, and durable replay paths honor it.
|
|
32
|
+
|
|
33
|
+
Image access belongs to request serialization rather than the durable attachment or deterministic request-image version. `resolveImageAttachmentAccess()` combines the attachment provider's optional host object path with a mapping supplied by the consumer for the current tool execution filesystem. The result is available only for that request and does not participate in `variantId`.
|
|
34
|
+
|
|
35
|
+
Source: [`packages/llm/llm/src/content.ts`](../../packages/llm/llm/src/content.ts)
|
|
36
|
+
|
|
37
|
+
```ts type-equiv
|
|
38
|
+
/** Execution-world path that model tools can use to read one normalized attachment. */
|
|
39
|
+
interface ImageAttachmentAccess {
|
|
40
|
+
/** Absolute path to immutable normalized bytes; callers must treat it as read-only. */
|
|
41
|
+
readonlyPath: string
|
|
42
|
+
}
|
|
43
|
+
```
|
|
32
44
|
|
|
33
45
|
Source: [`packages/llm/llm/src/message.ts`](../../packages/llm/llm/src/message.ts)
|
|
34
46
|
|
|
@@ -157,6 +169,29 @@ type ContextFormed =
|
|
|
157
169
|
|
|
158
170
|
A streaming response interleaves several typed blocks (text, reasoning, multiple tool calls). `index` ties each delta to its block; `block-end` carries the fully-assembled `ContentBlock` so consumers don't have to re-assemble deltas themselves. It is a **closed** discriminated union — a `switch` over `type` ends with `assertNever`, so adding a variant breaks compilation at every consumer that must handle it.
|
|
159
171
|
|
|
172
|
+
```ts type-equiv
|
|
173
|
+
/**
|
|
174
|
+
* Adapter-private lossless-JSON state for replaying a successful response,
|
|
175
|
+
* carried by a terminal `finish` chunk and stored on the assembled assistant
|
|
176
|
+
* message's model source. Both halves stay opaque to the harness; only the
|
|
177
|
+
* split is shared vocabulary, so assembly can keep stored metadata aligned
|
|
178
|
+
* with stored content without reading either half.
|
|
179
|
+
*/
|
|
180
|
+
interface ReplayEnvelope {
|
|
181
|
+
/** Response-level adapter-private metadata (ids, native stop reason). */
|
|
182
|
+
response: unknown
|
|
183
|
+
/**
|
|
184
|
+
* Per-block adapter-private metadata, one entry per emitted block in
|
|
185
|
+
* first-seen stream order. When assembly drops a block it drops the entry at
|
|
186
|
+
* the same position; entries whose length does not match the emitted block
|
|
187
|
+
* count discard the whole envelope. An adapter whose metadata is independent
|
|
188
|
+
* of block structure omits this field and the envelope passes through
|
|
189
|
+
* assembly unchanged.
|
|
190
|
+
*/
|
|
191
|
+
blocks?: readonly unknown[]
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
160
195
|
```ts type-equiv
|
|
161
196
|
/**
|
|
162
197
|
* Raw streaming protocol emitted by adapters.
|
|
@@ -170,14 +205,14 @@ type StreamChunk =
|
|
|
170
205
|
| { type: 'block-start'; index: number; blockType: ContentBlockType }
|
|
171
206
|
| { type: 'text-delta'; index: number; text: string }
|
|
172
207
|
| { type: 'reasoning-delta'; index: number; text: string }
|
|
173
|
-
| { type: 'tool-call-delta'; index: number; id:
|
|
208
|
+
| { type: 'tool-call-delta'; index: number; id: ToolCallId; name?: string; argumentsDelta: string }
|
|
174
209
|
| { type: 'block-end'; index: number; block: ContentBlock }
|
|
175
210
|
| { type: 'usage'; usage: TokenUsage }
|
|
176
211
|
| {
|
|
177
212
|
type: 'finish'
|
|
178
213
|
reason: FinishReason
|
|
179
|
-
/**
|
|
180
|
-
replayState?:
|
|
214
|
+
/** Replay metadata for a successful response; see {@link ReplayEnvelope}. */
|
|
215
|
+
replayState?: ReplayEnvelope
|
|
181
216
|
}
|
|
182
217
|
```
|
|
183
218
|
|
|
@@ -201,6 +236,44 @@ interface LlmFailure {
|
|
|
201
236
|
}
|
|
202
237
|
```
|
|
203
238
|
|
|
239
|
+
## Request-image pricing
|
|
240
|
+
|
|
241
|
+
An adapter whose provider charges visual tokens for request images declares per-route pricing by overriding `LlmAdapter.imageRequestPricing`, and `ctx.llm.imageRequestPricing(provider, model)` resolves it synchronously for consumers. The token meter resolves the routed model's pricing on every measurement so compaction pressure, retention, and range selection price image history as the routed request actually sends it; the DeepSeek adapter reproduces its own request projection (per-model pixel budget, oldest-first offload) and prices retained images with the published v4 vision accounting, while provider usage remains the authoritative anchor for completed requests.
|
|
242
|
+
|
|
243
|
+
```ts type-equiv
|
|
244
|
+
/**
|
|
245
|
+
* Request price of one ordered image occurrence under one exact model route's
|
|
246
|
+
* request projection. Every occurrence resolves to the pair the wire actually
|
|
247
|
+
* carries: provider visual tokens for a retained image, plus the model-visible
|
|
248
|
+
* text sent with or instead of it (request-preview handle, offload placeholder,
|
|
249
|
+
* or text-only substitution). The caller prices `text` with its own text
|
|
250
|
+
* estimator so provider pricing never fixes a text tokenization.
|
|
251
|
+
*/
|
|
252
|
+
interface LlmImageRequestPrice {
|
|
253
|
+
/** Provider visual tokens for the retained request image; 0 when only text represents this occurrence. */
|
|
254
|
+
visualTokens: number
|
|
255
|
+
/** Model-visible text sent for this occurrence, to be priced by the caller's text estimator. */
|
|
256
|
+
text: string
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
```ts type-equiv
|
|
261
|
+
/**
|
|
262
|
+
* Provider-side request-image pricing for one exact model route. Implemented
|
|
263
|
+
* by adapters whose provider charges visual tokens; consumers (the token
|
|
264
|
+
* meter) resolve it synchronously per measurement, so implementations must not
|
|
265
|
+
* perform I/O.
|
|
266
|
+
*/
|
|
267
|
+
interface LlmImageRequestPricing {
|
|
268
|
+
/**
|
|
269
|
+
* Price every image occurrence of one request projection.
|
|
270
|
+
* @param images - durable image references in request order, one entry per occurrence.
|
|
271
|
+
* @returns one price per occurrence, aligned by index with `images`.
|
|
272
|
+
*/
|
|
273
|
+
priceImages(images: readonly ImageAttachmentRef[]): readonly LlmImageRequestPrice[]
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
204
277
|
## The adapter contract
|
|
205
278
|
|
|
206
279
|
Every adapter MUST obey these, and every consumer may rely on them:
|
|
@@ -213,11 +286,11 @@ Every adapter MUST obey these, and every consumer may rely on them:
|
|
|
213
286
|
- **Context overflow has one canonical code.** Both DeepSeek adapters classify explicit provider detail through `isContextWindowExceededError()` and surface `CONTEXT_WINDOW_EXCEEDED`, whether the failure arrives as a thrown HTTP `LlmError` or an in-band finish error. Consumers route on the code, never provider text.
|
|
214
287
|
- **An empty completion is a retryable error, not a silent success.** Both adapters map a terminal `stop` finish that carried no content blocks to `finish {kind:'error'}` with the canonical `EMPTY_RESPONSE` code, and `dsh-llm-retry` retries it by default; see [empty model responses are retryable](../../.agents/notes/implemented/bug-fix/2026-07-24-empty-model-response-is-retryable.md).
|
|
215
288
|
- **Every provider HTTP request carries the app-attribution header.** Adapters send `attributionHeaders()` (below) - the `User-Agent` baseline - and prove it with a wire-level test.
|
|
216
|
-
- **Replay state is adapter-owned.** A successful `finish` may carry
|
|
289
|
+
- **Replay state is adapter-owned; its split is shared.** A successful `finish` may carry a `ReplayEnvelope`: opaque response-level metadata plus optional per-block entries aligned with the emitted block sequence. The alignment is the harness's vocabulary — when assembly drops a block it drops the entry at the same position, so stored metadata always describes stored content. The loop stores the pruned envelope with the assembled assistant message. On a later request, `LlmRuntime` passes the state only when the historical provider and target provider are currently registered to the exact same adapter instance. That adapter validates the state and owns any cross-model or cross-provider conversion; other adapters receive the provider-neutral content plus provider/model fields without the private state. Durable content stays authoritative: a stored state the reading adapter cannot use degrades that one message to provider-neutral conversion with a diagnostic instead of failing the request.
|
|
217
290
|
|
|
218
291
|
## `ResolvedRetryPolicy`
|
|
219
292
|
|
|
220
|
-
|
|
293
|
+
Retry configuration resolves before route registration into an immutable discriminated union. Normal mode carries `mode: 'normal'`, finite `maxRetries`, `retryableCodes`, and required `initialDelayMs`, `maxDelayMs`, and `jitterRatio`; always mode carries `mode: 'always'` and the same required backoff fields without a finite maximum. Omitting a provider policy uses the normal default of five retries. Layered settings may retain normal-only `maxRetries` or `retryableCodes` after switching to always mode; the resolver ignores those inactive fields and captures the pure always policy. `LlmRuntime.providerRetryPolicy(provider)` returns the registered value, and `llmRetryPolicyOf(stream)` returns the value captured from the serving registration after the call selects it, so later route disposal or replacement cannot change an in-flight failure's recovery policy. The [generated config catalog](../config-catalog.md) lists the optional input fields.
|
|
221
294
|
|
|
222
295
|
## `AppIdentity` — app attribution
|
|
223
296
|
|
|
@@ -243,7 +316,7 @@ interface AppIdentity {
|
|
|
243
316
|
|
|
244
317
|
## `TokenUsage`
|
|
245
318
|
|
|
246
|
-
Per-call token accounting. Counts are **disjoint**: `inputTokens` is uncached input only; cached input is reported separately, and billed input is the sum of the three. Adapters whose providers fold cache hits into a single prompt total (DeepSeek's `prompt_tokens`) subtract them back out. `reasoningTokens`, when present, is informational detail already included in `outputTokens`; totals must not add it again.
|
|
319
|
+
Per-call token accounting. Counts are **disjoint**: `inputTokens` is uncached input only; cached input is reported separately, and billed input is the sum of the three. Adapters whose providers fold cache hits into a single prompt total (DeepSeek's `prompt_tokens`) subtract them back out. Optional `totalTokens` is an exact aggregate prompt-plus-output count preserved from the provider or reconstructed from authoritative aggregate counters; adapters omit it when unavailable or inconsistent. `reasoningTokens`, when present, is informational detail already included in `outputTokens`; totals must not add it again.
|
|
247
320
|
|
|
248
321
|
```ts type-equiv
|
|
249
322
|
/**
|
|
@@ -257,6 +330,14 @@ Per-call token accounting. Counts are **disjoint**: `inputTokens` is uncached in
|
|
|
257
330
|
interface TokenUsage {
|
|
258
331
|
inputTokens: number
|
|
259
332
|
outputTokens: number
|
|
333
|
+
/**
|
|
334
|
+
* Exact full-call total including aggregate prompt and output tokens.
|
|
335
|
+
*
|
|
336
|
+
* Adapters preserve a provider total or derive it from authoritative
|
|
337
|
+
* aggregate prompt/output counters; they omit it when unavailable or
|
|
338
|
+
* inconsistent.
|
|
339
|
+
*/
|
|
340
|
+
totalTokens?: number
|
|
260
341
|
cacheReadTokens?: number
|
|
261
342
|
cacheWriteTokens?: number
|
|
262
343
|
reasoningTokens?: number
|
|
@@ -267,13 +348,16 @@ interface TokenUsage {
|
|
|
267
348
|
|
|
268
349
|
`BlockAssembler` ([`packages/llm/llm/src/assembler.ts`](../../packages/llm/llm/src/assembler.ts)) is the single shared implementation that folds a `StreamChunk` stream back into `ContentBlock`s, usage, finish reason, and replay state. The loop logs the raw chunks while feeding the same chunks through an assembler, then stores the assembled assistant content with the provider and model that produced it. A consumer that needs the assembled result without re-implementing the fold uses this.
|
|
269
350
|
|
|
351
|
+
One keep/drop decision covers content and metadata together: a `max-tokens` finish drops every tool call because a truncated call is unsafe to execute, and the same decision prunes the replay envelope's per-block entry at each dropped position. `blocks()` and `replayState` therefore cannot disagree, whatever assembly removes.
|
|
352
|
+
|
|
270
353
|
```ts public-api
|
|
271
354
|
/**
|
|
272
355
|
* Incrementally assembles raw {@link StreamChunk}s into complete
|
|
273
356
|
* {@link ContentBlock}s and a final assistant {@link Message}.
|
|
274
357
|
*
|
|
275
358
|
* The agent loop feeds it while logging raw chunks for replay fidelity, then
|
|
276
|
-
* reads `blocks()` / `message()` / `usage` / `finish` once the stream ends
|
|
359
|
+
* reads `blocks()` / `message()` / `usage` / `finish` once the stream ends,
|
|
360
|
+
* or `interruptedBlocks()` when cancellation cut the stream short.
|
|
277
361
|
*
|
|
278
362
|
* Tolerant of delta-only protocols (no block-start/end); deltas arriving for
|
|
279
363
|
* an index already closed by `block-end` are ignored (malformed stream) so a
|
|
@@ -292,12 +376,24 @@ declare class BlockAssembler {
|
|
|
292
376
|
* its accumulated deltas (an unknown block type never closed by `block-end` throws).
|
|
293
377
|
*/
|
|
294
378
|
blocks(): ContentBlock[];
|
|
379
|
+
/**
|
|
380
|
+
* Assemble the prefix an interrupted stream can safely finalize: closed and
|
|
381
|
+
* open text/reasoning blocks with non-whitespace content, in stream order.
|
|
382
|
+
* Tool calls are omitted because interruption precedes dispatch; retaining
|
|
383
|
+
* one would require a fabricated result. Open unknown blocks are also omitted.
|
|
384
|
+
* @returns the kept blocks; empty when nothing streamed before the interruption.
|
|
385
|
+
*/
|
|
386
|
+
interruptedBlocks(): ContentBlock[];
|
|
295
387
|
/** Usage from the `usage` chunk; undefined until one arrives. */
|
|
296
388
|
get usage(): TokenUsage | undefined;
|
|
297
389
|
/** Finish reason from the `finish` chunk; `{kind: 'stop'}` when the stream ended without one. */
|
|
298
390
|
get finish(): FinishReason;
|
|
299
|
-
/**
|
|
300
|
-
|
|
391
|
+
/**
|
|
392
|
+
* Replay metadata from the terminal finish chunk, if any, with per-block
|
|
393
|
+
* entries pruned in step with {@link blocks}. Undefined when the envelope's
|
|
394
|
+
* entries do not align with the emitted blocks.
|
|
395
|
+
*/
|
|
396
|
+
get replayState(): ReplayEnvelope | undefined;
|
|
301
397
|
/**
|
|
302
398
|
* The assembled assistant message.
|
|
303
399
|
* @param source - producer attribution for the assembled message.
|
|
@@ -315,7 +411,7 @@ One model call is a fully-assembled `GenerateOptions`. The adapter answers with
|
|
|
315
411
|
|
|
316
412
|
Source: [`packages/llm/llm/src/types.ts`](../../packages/llm/llm/src/types.ts)
|
|
317
413
|
|
|
318
|
-
Provider and model discovery uses small provider-neutral descriptors. A model catalog is advisory: routing still keys on a registered provider
|
|
414
|
+
Provider and model discovery uses small provider-neutral descriptors. A model catalog is advisory: routing still keys on a registered provider.
|
|
319
415
|
|
|
320
416
|
Registering an adapter returns a handle: the disposer, plus the atomic route replacement a plugin whose route set is user-configurable needs.
|
|
321
417
|
|
|
@@ -563,8 +659,6 @@ interface LlmModelDiscoveryRequest {
|
|
|
563
659
|
api?: string
|
|
564
660
|
/** Credential for this interrogation alone; the harness never stores it. */
|
|
565
661
|
apiKey?: string
|
|
566
|
-
/** Caller cancellation; implementations must settle promptly after it aborts. */
|
|
567
|
-
signal?: AbortSignal
|
|
568
662
|
}
|
|
569
663
|
```
|
|
570
664
|
|
|
@@ -624,6 +718,12 @@ interface LlmCallConfigAdapterDefaults {
|
|
|
624
718
|
}
|
|
625
719
|
```
|
|
626
720
|
|
|
721
|
+
## Official DeepSeek request extensions
|
|
722
|
+
|
|
723
|
+
`ctx.deepseekLlmApiExtensions` is the provider-specific registry for additive top-level fields on `deepseek-official` requests. Contributor plugins use `register(field, provider)` to claim one field; the adapter calls `prepare(request)` after serializing its base body and merges the returned fields before HTTP. The prepared `accept()` transaction runs after 2xx, so a contributor can commit delivery state without treating a transport or provider rejection as acceptance. Preparation, collision, and acceptance failures use `REQUEST_EXTENSION` and fail the model request.
|
|
724
|
+
|
|
725
|
+
The [wire reference](../deepseek-llm-api-wire-extensions.md) defines the exact request headers, extension transaction, field versions, and receiver obligations. The shipped composition registers [`dsh_session_log`](../../packages/session/session-log-deepseek/README.md) as a lossless incremental canonical-log suffix and [`dsh_plugin_packages`](../../packages/llm/plugin-package-inventory-deepseek/README.md) as the complete active Loader-backed package set. These fields remain outside model messages and are absent from the pi-ai adapter path.
|
|
726
|
+
|
|
627
727
|
## Service and provider contracts
|
|
628
728
|
|
|
629
729
|
`LlmAdapter` is the provider contract: subclass, implement `stream()`, and register one adapter instance with `ctx.llm.registerAdapter(providers, adapter)`. `GenerateOptions.provider` selects the registered adapter; `GenerateOptions.model` is passed to that adapter and need not be registered at lifecycle start. Duplicate provider routes fail atomically. Optional `providerRetryPolicy()` is captured per route with normal defaults, while `providerInfo()` and asynchronous `listModels()` feed `LlmRuntime.listProviders()` / `listModels()` with detached selector metadata. That catalog is advisory rather than a request whitelist: the adapter remains authoritative and may accept unlisted model ids. One asynchronous `resolveModel()` query returns exact model identity plus optional correctness-sensitive context capacity, an adapter-configured `defaultMaxTokens`, and ordered model-owned reasoning ids with an optional deployment default; absent fields mean unavailable metadata or provider-owned behavior, not invalid catalog membership. The resolver receives optional cancellation and must settle promptly after abort. `LlmRuntime.resolveModelInfo()` validates and detaches the aggregate. At the final adapter boundary, `resolveCallConfig()` materializes the output default only when `maxTokens` is absent and validates and materializes reasoning, so direct calls cannot bypass either configured behavior; direct dispatch captures one registration before awaiting that resolution. The agent loop instead uses `prepareCall()` to keep the same registration across model resolution, durable header logging, and dispatch, retain detached context metadata from that exact lookup, and report which config fields the adapter defaulted. Adapter lookup happens at the terminal continuation of the `llm/stream` waterfall, so a listener may short-circuit the call or route a mutable one-shot request before lookup. AgentLoop observes a request attempt once the outer waterfall returns a stream handle; that limited boundary does not prove a lazy terminal adapter was constructed or began provider I/O. The `block-start` / `block-end` `index` correlation and the assembler together mean an adapter only has to emit well-formed chunks — block reassembly is not each adapter's problem. [architecture.md](../architecture.md#turn-flow) shows where `ctx.llm.stream()` and the `llm/stream` waterfall sit in one turn.
|
|
@@ -637,6 +737,8 @@ interface PreparedLlmCall {
|
|
|
637
737
|
readonly retryPolicy: ResolvedRetryPolicy
|
|
638
738
|
/** Detached context metadata resolved with the registration-bound call. */
|
|
639
739
|
readonly context?: LlmModelContext
|
|
740
|
+
/** Exact model modalities captured with the adapter dispatch generation. */
|
|
741
|
+
readonly inputModalities?: readonly ModelModality[]
|
|
640
742
|
/** Config fields materialized by the captured adapter rather than proposed by the caller. */
|
|
641
743
|
readonly adapterDefaults: LlmCallConfigAdapterDefaults
|
|
642
744
|
/**
|
|
@@ -670,6 +772,16 @@ declare abstract class LlmAdapter {
|
|
|
670
772
|
* @returns a resolved policy, or `undefined` to use the normal defaults.
|
|
671
773
|
*/
|
|
672
774
|
providerRetryPolicy(_provider: string): ResolvedRetryPolicy | undefined;
|
|
775
|
+
/**
|
|
776
|
+
* Resolve provider-side request-image pricing for one exact model route.
|
|
777
|
+
* The default declares none, so consumers fall back to their own neutral
|
|
778
|
+
* estimate. Implementations must answer synchronously without I/O; the
|
|
779
|
+
* token meter resolves this per measurement.
|
|
780
|
+
* @param _provider - a route passed to `registerAdapter()` for this instance.
|
|
781
|
+
* @param _model - exact model id passed to {@link GenerateOptions.model}.
|
|
782
|
+
* @returns route-owned image pricing, or `undefined` when the route declares none.
|
|
783
|
+
*/
|
|
784
|
+
imageRequestPricing(_provider: string, _model: string): LlmImageRequestPricing | undefined;
|
|
673
785
|
/**
|
|
674
786
|
* List models this adapter can currently advertise for one owned provider.
|
|
675
787
|
* The result is advisory: an adapter may accept unlisted model ids, and
|
|
@@ -692,6 +804,16 @@ declare abstract class LlmAdapter {
|
|
|
692
804
|
model: string,
|
|
693
805
|
_signal?: AbortSignal,
|
|
694
806
|
): Promise<LlmResolvedModelInfo>;
|
|
807
|
+
/**
|
|
808
|
+
* Bind exact model metadata and the eventual request dispatch to one adapter generation.
|
|
809
|
+
* Dynamic adapters override this so settings changes between preparation and
|
|
810
|
+
* dispatch cannot combine one generation's capabilities with another's endpoint.
|
|
811
|
+
* @param provider - registered provider route.
|
|
812
|
+
* @param model - exact model id.
|
|
813
|
+
* @param signal - cancellation for model resolution.
|
|
814
|
+
* @returns model metadata and a one-generation stream entry point.
|
|
815
|
+
*/
|
|
816
|
+
async prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
695
817
|
/**
|
|
696
818
|
* Stream one model call as raw chunks. The only required method.
|
|
697
819
|
* @param options - the fully-assembled request; implementations must honor `options.signal`.
|
|
@@ -709,7 +831,34 @@ declare abstract class LlmAdapter {
|
|
|
709
831
|
|
|
710
832
|
## Cordis API
|
|
711
833
|
|
|
712
|
-
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`) —
|
|
834
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
835
|
+
|
|
836
|
+
<a id="ctxdeepseekllmapiextensions--deepseekllmapiextensionregistry"></a>
|
|
837
|
+
|
|
838
|
+
### `ctx.deepseekLlmApiExtensions` — `DeepSeekLlmApiExtensionRegistry`
|
|
839
|
+
|
|
840
|
+
Registry of independently owned top-level fields for official DeepSeek requests.
|
|
841
|
+
|
|
842
|
+
```ts cordis-catalog
|
|
843
|
+
/**
|
|
844
|
+
* Register the sole provider of one top-level request field. Registration is effect-scoped.
|
|
845
|
+
* @param field - declaration-merged field owned by the provider.
|
|
846
|
+
* @param provider - request-time field preparation and optional acceptance behavior.
|
|
847
|
+
* @returns disposer that releases the field.
|
|
848
|
+
*/
|
|
849
|
+
register<K extends keyof DeepSeekLlmApiExtensionMap>( field: K, provider: DeepSeekLlmApiExtensionProvider<DeepSeekLlmApiExtensionMap[K]>, ): () => Promise<void>
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Prepare every currently registered field from one immutable base request.
|
|
853
|
+
* Preparation failures reject before HTTP dispatch. Field values are cloned and frozen;
|
|
854
|
+
* providers retain no mutable alias to the outgoing request.
|
|
855
|
+
* @param request - exact serialized request facts before extension fields.
|
|
856
|
+
* @returns detached fields and their idempotent joint acceptance transaction.
|
|
857
|
+
*/
|
|
858
|
+
async prepare(request: DeepSeekLlmApiExtensionRequest): Promise<PreparedDeepSeekLlmApiExtensions>
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
Source: [`packages/llm/deepseek-llm-api-extensions/src/index.ts`](../../packages/llm/deepseek-llm-api-extensions/src/index.ts)
|
|
713
862
|
|
|
714
863
|
<a id="ctxllm--llmruntime"></a>
|
|
715
864
|
|
|
@@ -732,7 +881,7 @@ registerAdapter(providers: string[], adapter: LlmAdapter): AdapterRegistrationHa
|
|
|
732
881
|
* Describe provider routes with a registered adapter.
|
|
733
882
|
* @returns detached provider metadata in registration order.
|
|
734
883
|
*/
|
|
735
|
-
listProviders(): LlmProviderInfo[]
|
|
884
|
+
@Remote listProviders(): LlmProviderInfo[]
|
|
736
885
|
|
|
737
886
|
/**
|
|
738
887
|
* Declare provider routes an adapter plugin can activate through
|
|
@@ -748,7 +897,7 @@ registerConfigurableProviders(entries: readonly LlmConfigurableProvider[]): Dire
|
|
|
748
897
|
* List every declared configurable provider, registered or dormant.
|
|
749
898
|
* @returns detached directory entries in declaration order.
|
|
750
899
|
*/
|
|
751
|
-
listConfigurableProviders(): LlmConfigurableProvider[]
|
|
900
|
+
@Remote listConfigurableProviders(): LlmConfigurableProvider[]
|
|
752
901
|
|
|
753
902
|
/**
|
|
754
903
|
* Offer to interrogate provider endpoints on behalf of the settings
|
|
@@ -757,10 +906,10 @@ listConfigurableProviders(): LlmConfigurableProvider[]
|
|
|
757
906
|
* directory, and because a provider being *added* has no route to name yet.
|
|
758
907
|
* Disposed with the fiber.
|
|
759
908
|
* @param settingsNs - the namespace whose profiles this discovery serves.
|
|
760
|
-
* @param discover - interrogates one endpoint
|
|
909
|
+
* @param discover - interrogates one endpoint and must honor the supplied signal.
|
|
761
910
|
* @returns the disposer that withdraws the offer.
|
|
762
911
|
*/
|
|
763
|
-
registerModelDiscovery( settingsNs: string, discover: (request: LlmModelDiscoveryRequest) => Promise<readonly LlmDiscoveredModel[]>, ): () => void
|
|
912
|
+
registerModelDiscovery( settingsNs: string, discover: ( request: LlmModelDiscoveryRequest, signal?: AbortSignal, ) => Promise<readonly LlmDiscoveredModel[]>, ): () => void
|
|
764
913
|
|
|
765
914
|
/**
|
|
766
915
|
* Interrogate one provider endpoint for the models it advertises. The
|
|
@@ -769,9 +918,20 @@ registerModelDiscovery( settingsNs: string, discover: (request: LlmModelDiscover
|
|
|
769
918
|
* candidate metadata a surface may offer for adoption.
|
|
770
919
|
* @param settingsNs - namespace whose registered discovery serves this draft.
|
|
771
920
|
* @param request - the endpoint, protocol, and one-shot credential to use.
|
|
921
|
+
* @param signal - caller cancellation.
|
|
772
922
|
* @returns the advertised models, deduplicated in endpoint order.
|
|
773
923
|
*/
|
|
774
|
-
async discoverModels( settingsNs: string, request: LlmModelDiscoveryRequest, ): Promise<LlmDiscoveredModel[]>
|
|
924
|
+
async discoverModels( settingsNs: string, request: LlmModelDiscoveryRequest, signal?: AbortSignal, ): Promise<LlmDiscoveredModel[]>
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Remote adapter for one draft provider interrogation.
|
|
928
|
+
* @param settingsNs - namespace whose registered discovery serves this draft.
|
|
929
|
+
* @param request - endpoint, protocol, and one-shot credential to use.
|
|
930
|
+
* @param signal - caller cancellation supplied by the Remote carrier.
|
|
931
|
+
* @returns advertised models in endpoint order.
|
|
932
|
+
* @throws RemoteError with `llm/model-discovery-rejected` when discovery refuses or fails.
|
|
933
|
+
*/
|
|
934
|
+
@Remote('discoverModels') async remoteDiscoverModels( settingsNs: string, request: LlmModelDiscoveryRequest, signal: AbortSignal, ): Promise<LlmDiscoveredModel[]>
|
|
775
935
|
|
|
776
936
|
/**
|
|
777
937
|
* Resolve the retry policy captured when one provider route was registered.
|
|
@@ -780,6 +940,17 @@ async discoverModels( settingsNs: string, request: LlmModelDiscoveryRequest, ):
|
|
|
780
940
|
*/
|
|
781
941
|
providerRetryPolicy(provider: string): ResolvedRetryPolicy
|
|
782
942
|
|
|
943
|
+
/**
|
|
944
|
+
* Resolve provider-side request-image pricing for one exact route, or
|
|
945
|
+
* `undefined` when the provider is unregistered or declares none. Unknown
|
|
946
|
+
* providers degrade to `undefined` rather than throwing because callers
|
|
947
|
+
* price durable history whose route may no longer be mounted.
|
|
948
|
+
* @param provider - provider route named by a request header.
|
|
949
|
+
* @param model - exact model id named by the same header.
|
|
950
|
+
* @returns the owning adapter's image pricing for the route, when declared.
|
|
951
|
+
*/
|
|
952
|
+
imageRequestPricing(provider: string, model: string): LlmImageRequestPricing | undefined
|
|
953
|
+
|
|
783
954
|
/**
|
|
784
955
|
* Discover models advertised by one registered provider. Catalog membership
|
|
785
956
|
* is advisory and never changes routing or request validation.
|
|
@@ -835,7 +1006,7 @@ async prepareCall(config: LlmCallConfig, signal?: AbortSignal): Promise<Prepared
|
|
|
835
1006
|
stream(options: GenerateOptions): AsyncIterable<StreamChunk>
|
|
836
1007
|
```
|
|
837
1008
|
|
|
838
|
-
Source: [`packages/llm/llm/src/index.ts
|
|
1009
|
+
Source: [`packages/llm/llm/src/index.ts`](../../packages/llm/llm/src/index.ts)
|
|
839
1010
|
|
|
840
1011
|
<a id="llm-events"></a>
|
|
841
1012
|
|
|
@@ -860,7 +1031,7 @@ The provider topology changed: an adapter registered or unregistered routes, or
|
|
|
860
1031
|
'llm/adapters-updated'(): void
|
|
861
1032
|
```
|
|
862
1033
|
|
|
863
|
-
Source: [`packages/llm/llm/src/types.ts
|
|
1034
|
+
Source: [`packages/llm/llm/src/types.ts`](../../packages/llm/llm/src/types.ts)
|
|
864
1035
|
|
|
865
1036
|
<a id="llmstream--waterfall"></a>
|
|
866
1037
|
|
|
@@ -884,5 +1055,5 @@ Waterfall around every streaming model call (retry, replay, routing). Bound to t
|
|
|
884
1055
|
'llm/stream'(this: LlmRuntime, options: GenerateOptions, next: () => AsyncIterable<StreamChunk>): AsyncIterable<StreamChunk>
|
|
885
1056
|
```
|
|
886
1057
|
|
|
887
|
-
Source: [`packages/llm/llm/src/index.ts
|
|
1058
|
+
Source: [`packages/llm/llm/src/index.ts`](../../packages/llm/llm/src/index.ts)
|
|
888
1059
|
<!-- END GENERATED cordis-surface -->
|