dsh-plugin-guide 0.2.0 → 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 +36 -18
- package/README.hi.md +36 -18
- package/README.md +38 -18
- package/README.pt.md +36 -18
- package/README.zh.md +38 -18
- 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 +2 -2
- package/guide/quick-reference.md +2 -2
- package/guide/quick-reference.pt.md +2 -2
- package/guide/quick-reference.zh-CN.md +3 -3
- package/package.json +13 -4
- package/references/cordis-paper-and-community.md +1 -1
- package/references/harness-repo.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 +160 -39
- package/references/official-docs/docs/persistence-catalog.zh.md +169 -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 +273 -39
- package/references/official-docs/docs/subsystems/session.zh.md +290 -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/check-docs-drift.ps1 +55 -0
- package/scripts/check-readme-sync.mjs +91 -0
- 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
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## 标识与经过校验的元数据
|
|
12
12
|
|
|
13
|
-
`AttachmentId` 是带类型标记的不透明字符串。本地后端目前生成 `sha256:<digest
|
|
13
|
+
`AttachmentId` 是带类型标记的不透明字符串。本地后端目前生成 `sha256:<digest>`,但消费方既不能解析这种表示,也不能据此派生文件系统路径。消费方可以通过 `imageHostPath()` 询问附件提供方所持对象的位置,然后必须由当前执行文件系统判断模型工具能否读取该宿主路径。
|
|
14
14
|
|
|
15
15
|
```ts type-equiv
|
|
16
16
|
/** Raster image formats accepted by the version-one attachment path. */
|
|
@@ -18,7 +18,7 @@ type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif'
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
```ts type-equiv
|
|
21
|
-
/** Durable, serializable
|
|
21
|
+
/** Durable, serializable reference to one immutable normalized image. */
|
|
22
22
|
interface ImageAttachmentRef {
|
|
23
23
|
/** Opaque storage identifier; never a filesystem path or bearer URL. */
|
|
24
24
|
attachmentId: AttachmentId
|
|
@@ -32,6 +32,14 @@ interface ImageAttachmentRef {
|
|
|
32
32
|
height: number
|
|
33
33
|
/** Optional display name stripped of local path information. */
|
|
34
34
|
name?: string
|
|
35
|
+
/**
|
|
36
|
+
* Input dimensions after applying EXIF orientation and before normalization
|
|
37
|
+
* scaling. Present only when normalization reduced the image.
|
|
38
|
+
*/
|
|
39
|
+
originalDimensions?: {
|
|
40
|
+
width: number
|
|
41
|
+
height: number
|
|
42
|
+
}
|
|
35
43
|
}
|
|
36
44
|
```
|
|
37
45
|
|
|
@@ -42,14 +50,30 @@ interface ImageAttachmentLimits {
|
|
|
42
50
|
maxImagesPerMessage: number
|
|
43
51
|
maxMessageImageBytes: number
|
|
44
52
|
maxImagePixels: number
|
|
53
|
+
/** Maximum intrinsic width and maximum intrinsic height in pixels for one image. */
|
|
54
|
+
maxImageDimension: number
|
|
45
55
|
mediaTypes: readonly ImageMediaType[]
|
|
46
56
|
}
|
|
47
57
|
```
|
|
48
58
|
|
|
59
|
+
本地后端每条消息最多准入 20 张图片,源图编码数据总量不超过 200 MiB。单张源图不得超过 20 MiB、64,000,000 像素和单边 8192 像素。这些源文件限制先于独立的规范化阶段执行;该阶段默认把长边限制为 2048 像素,把编码数据限制为 4 MiB。
|
|
60
|
+
|
|
49
61
|
引用记录固有尺寸和编码长度,使客户端无需先解码即可排布历史记录;每次权威读取仍会根据对象重新校验摘要、媒体签名、尺寸和元数据。
|
|
50
62
|
|
|
51
63
|
## 提交与经校验读取的数据
|
|
52
64
|
|
|
65
|
+
```ts type-equiv
|
|
66
|
+
/** Base64-encoded image upload accompanying one wire request. */
|
|
67
|
+
interface EncodedImageAttachment {
|
|
68
|
+
/** Declared media type, verified against the decoded bytes during admission. */
|
|
69
|
+
mediaType: ImageMediaType
|
|
70
|
+
/** Canonical base64 encoding of the image bytes. */
|
|
71
|
+
data: string
|
|
72
|
+
/** Optional display name; it is never interpreted as a path. */
|
|
73
|
+
name?: string
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
53
77
|
```ts type-equiv
|
|
54
78
|
/** Request to validate and durably commit one image. */
|
|
55
79
|
interface SaveImageAttachment {
|
|
@@ -69,7 +93,39 @@ interface StoredImageAttachment {
|
|
|
69
93
|
}
|
|
70
94
|
```
|
|
71
95
|
|
|
72
|
-
|
|
96
|
+
```ts type-equiv
|
|
97
|
+
/** Deterministic request-image policy selected by one exact model route. */
|
|
98
|
+
interface ImageRequestPolicy {
|
|
99
|
+
/** Maximum width multiplied by height after aspect-preserving projection. */
|
|
100
|
+
maxPixels: number
|
|
101
|
+
/** Encoded-byte target before base64 expansion or Files API upload; the smallest quality-ladder output is kept when no quality fits. */
|
|
102
|
+
maxBytes: number
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```ts type-equiv
|
|
107
|
+
/** Cached request version derived from one provider-independent normalized attachment. */
|
|
108
|
+
interface RequestImageAttachment {
|
|
109
|
+
/** Cache and upload-index key over the attachment id, policy, and fixed encoder parameters. */
|
|
110
|
+
variantId: ImageVariantId
|
|
111
|
+
/** Durable normalized attachment from which this request version was derived. */
|
|
112
|
+
attachment: ImageAttachmentRef
|
|
113
|
+
/** Encoded request bytes. */
|
|
114
|
+
data: Uint8Array
|
|
115
|
+
mediaType: ImageMediaType
|
|
116
|
+
bytes: number
|
|
117
|
+
width: number
|
|
118
|
+
height: number
|
|
119
|
+
/** Provider-compatible sample depth proven after request encoding. */
|
|
120
|
+
depth: 'uchar'
|
|
121
|
+
/** Provider-compatible color space proven after request encoding. */
|
|
122
|
+
space: 'srgb'
|
|
123
|
+
/** Whether the encoded request version retains an alpha channel. */
|
|
124
|
+
hasAlpha: boolean
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`saveImage()` 准备并原子提交提供方无关的规范化附件,然后直接返回 `ImageAttachmentRef`。`saveImages()` 在发布批次前为每个成员各准备一次经过验证的附件,因此校验拒绝不会留下部分对象,发布也不会重复解码或选择质量。`admitEncodedImages()` 是面向 base64 上传的 wire 入口,把张数、聚合字节和有序批量准入交给 `saveImages()`。`readImage()` 校验来自已授权会话路径的规范化附件。`imageHostPath()` 只公开提供方所持对象的宿主位置,不判断当前工具执行环境能否读取它。`readImageRequest()` 按确切路由的像素和字节预算派生并缓存确定性请求版本。该版本包含编码字节和元数据,不包含执行环境路径。新条目在发布前完整解码,缓存命中只做有界元数据探测。调用方需要有序批次时,对单数方法使用 `Promise.all`。本地实现按需编码首选候选、合并相同请求身份的并发任务、允许每个等待方单独取消、没有等待方时停止共享任务,并通过实例级限流器限制全部变换,默认同时执行两项。该服务不规定保留策略:恢复和 fork 后的会话可能共享对象,因此基于引用的垃圾回收会延期实现,不与单个会话的删除绑定。
|
|
73
129
|
|
|
74
130
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
75
131
|
|
|
@@ -77,7 +133,7 @@ interface StoredImageAttachment {
|
|
|
77
133
|
|
|
78
134
|
## Cordis API
|
|
79
135
|
|
|
80
|
-
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`) —
|
|
136
|
+
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).
|
|
81
137
|
|
|
82
138
|
<a id="ctxattachments--attachmentstore-abstract-seam"></a>
|
|
83
139
|
|
|
@@ -94,10 +150,20 @@ Immutable binary attachment service. Implementations validate bytes before publi
|
|
|
94
150
|
*/
|
|
95
151
|
abstract validateImage(input: SaveImageAttachment): Promise<void>
|
|
96
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Validate and durably commit one ordered image batch.
|
|
155
|
+
* @param inputs - encoded images in owning-message order.
|
|
156
|
+
* @returns durable normalized attachment references in the same order after every member succeeds.
|
|
157
|
+
*/
|
|
158
|
+
async saveImages(inputs: readonly SaveImageAttachment[]): Promise<readonly ImageAttachmentRef[]>
|
|
159
|
+
|
|
97
160
|
/**
|
|
98
161
|
* Validate and durably commit one image before its owning session event is appended.
|
|
162
|
+
* The returned reference describes the persisted normalized image. When
|
|
163
|
+
* normalization reduces the raster, its `originalDimensions` records the
|
|
164
|
+
* orientation-applied input dimensions.
|
|
99
165
|
* @param input - encoded bytes, declared media type, and optional display name.
|
|
100
|
-
* @returns
|
|
166
|
+
* @returns the durable content-addressed normalized image reference.
|
|
101
167
|
*/
|
|
102
168
|
abstract saveImage(input: SaveImageAttachment): Promise<ImageAttachmentRef>
|
|
103
169
|
|
|
@@ -105,11 +171,28 @@ abstract saveImage(input: SaveImageAttachment): Promise<ImageAttachmentRef>
|
|
|
105
171
|
* Read one image and verify that bytes still match the recorded reference.
|
|
106
172
|
* @param ref - durable reference from the session log.
|
|
107
173
|
* @param signal - optional cancellation for backend read and verification work.
|
|
108
|
-
* @returns the verified bytes and
|
|
174
|
+
* @returns the verified bytes and normalized attachment reference.
|
|
109
175
|
* @throws the signal reason when aborted, or a storage error when verification fails.
|
|
110
176
|
*/
|
|
111
177
|
abstract readImage(ref: ImageAttachmentRef, signal?: AbortSignal): Promise<StoredImageAttachment>
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Locate the provider-owned normalized object in the harness host filesystem.
|
|
181
|
+
* @param ref - durable normalized attachment reference.
|
|
182
|
+
* @returns an absolute host path, or undefined when this backend is not host-file-backed.
|
|
183
|
+
* @throws an AttachmentError when the durable reference is invalid.
|
|
184
|
+
*/
|
|
185
|
+
imageHostPath(ref: ImageAttachmentRef): string | undefined
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Generate or read one deterministic model-request version from the stored normalized image.
|
|
189
|
+
* @param ref - durable provider-independent normalized attachment reference.
|
|
190
|
+
* @param policy - exact route pixel budget and encoded-byte target; a target no ladder quality meets yields the smallest ladder output.
|
|
191
|
+
* @param signal - optional cancellation.
|
|
192
|
+
* @returns request bytes and the cache/upload identity covering every transform input.
|
|
193
|
+
*/
|
|
194
|
+
readImageRequest( ref: ImageAttachmentRef, policy: ImageRequestPolicy, signal?: AbortSignal, ): Promise<RequestImageAttachment>
|
|
112
195
|
```
|
|
113
196
|
|
|
114
|
-
Source: [`packages/attachment/attachment/src/index.ts
|
|
197
|
+
Source: [`packages/attachment/attachment/src/index.ts`](../../packages/attachment/attachment/src/index.ts)
|
|
115
198
|
<!-- 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/client-modules.md
|
|
5
|
-
client-modules.md:
|
|
6
|
-
client-modules.zh.md:
|
|
5
|
+
client-modules.md: f58cb6592a009292ffc4f87a207fe4e103fd2365
|
|
6
|
+
client-modules.zh.md: 18c72dfba6f851776100a9b6200e7222d580db7c
|
|
@@ -2,33 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](client-modules.zh.md)
|
|
4
4
|
|
|
5
|
-
The web plugin table: the Node half of the client module system in [dsh-client-modules](../../packages/client/modules), provided as `ctx.clientModules` (`ClientModuleRegistry`). It scans the host Loader's entries for packages declaring `dsh.client`, composes the `window.__DSH_BOOT__` entry graph, serves
|
|
5
|
+
The web plugin table: the Node half of the client module system in [dsh-client-modules](../../packages/client/modules), provided as `ctx.clientModules` (`ClientModuleRegistry`). It scans the host Loader's entries for packages declaring `dsh.client`, composes the `window.__DSH_BOOT__` entry graph, serves versioned one-or-more-resource combo scripts under `/plugins`, and answers every index-injection collection with the boot protocol rows — the four faces of one service. It is an optional capability of the web GUI stack, not part of the agent-loop spine, and it is a consumer of [dsh-host-webserver](../../packages/host/webserver): the carrier described in [web-server.md](web-server.md) supplies the prefix route and the `webserver/index-inject` event this service answers. The same package's browser half (`ctx.modules`, the lazy-CJS module table that fetches and materializes these bundles) is kernel machinery documented in the [package README](../../packages/client/modules/README.md), not here.
|
|
6
6
|
|
|
7
7
|
Source: [`packages/client/modules/src/client/manifest.ts`](../../packages/client/modules/src/client/manifest.ts)
|
|
8
8
|
|
|
9
9
|
## The wire
|
|
10
10
|
|
|
11
|
-
The graph is the wire single source between the Node and browser halves
|
|
11
|
+
The graph is the wire single source between the Node and browser halves. The host composes `WebBootEntry` rows and `WebBootBatch` descriptors from scanned packages, then contributes the registration facade, application preloads, bootstrap scripts, and graph global to the structured index-injection table before the Vite entry. The `global` row renders as `globalThis["__DSH_BOOT__"]` with `<` escaped so plugin-controlled strings cannot break out of the script element. A page without a valid manifest cannot boot: the browser parser rejects malformed rows or batches, unknown members, and entries without exactly one initial combo descriptor.
|
|
12
12
|
|
|
13
13
|
```ts type-equiv
|
|
14
14
|
/**
|
|
15
15
|
* One composed client entry pushed by the host (a graph row). Wire
|
|
16
16
|
* single source: the host node half (package root) produces this same shape.
|
|
17
|
-
* `immediately` marks stage-one prefetch
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* `immediately` marks stage-one prefetch. `inject` names package rows whose
|
|
18
|
+
* factories must arrive before this row materializes, while Cordis separately
|
|
19
|
+
* uses the same package edges to compose entries. `external` carries exact
|
|
20
|
+
* non-inject module requests (see {@link WebBootGraph.entries}).
|
|
20
21
|
*/
|
|
21
22
|
interface WebBootEntry {
|
|
22
23
|
/** Entry name == package name. */
|
|
23
24
|
id: string
|
|
24
|
-
/**
|
|
25
|
+
/** Revisioned single-resource combo endpoint used by HMR. */
|
|
25
26
|
url: string
|
|
26
|
-
/**
|
|
27
|
+
/** Opaque plugin-artifact revision used for HMR cache busting. */
|
|
27
28
|
rev: string
|
|
28
|
-
/** Package-name dependency edges
|
|
29
|
+
/** Package-name dependency edges used for factory arrival and plugin composition. */
|
|
29
30
|
inject?: string[]
|
|
30
31
|
/** Stage-one prefetch mark: load the script for factory registration during module-face boot. */
|
|
31
32
|
immediately?: boolean
|
|
33
|
+
/** Non-baseline module specifiers this row requests; omitted when it requests none. */
|
|
34
|
+
external?: string[]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```ts type-equiv
|
|
39
|
+
/** Initial scheduling phase for one content-addressed combo script. */
|
|
40
|
+
type WebBootBatchPhase = 'bootstrap' | 'application'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```ts type-equiv
|
|
44
|
+
/** One initial combo script; a scheduling phase may span several descriptors. */
|
|
45
|
+
interface WebBootBatch {
|
|
46
|
+
/** Parser-blocking bootstrap or preloaded application scheduling. */
|
|
47
|
+
phase: WebBootBatchPhase
|
|
48
|
+
/** Content-addressed combo script endpoint. */
|
|
49
|
+
url: string
|
|
50
|
+
/** Revision over the combined plugin script bytes and indexed source map. */
|
|
51
|
+
rev: string
|
|
52
|
+
/** Graph entry ids whose factories the script registers, in execution order. */
|
|
53
|
+
entries: string[]
|
|
32
54
|
}
|
|
33
55
|
```
|
|
34
56
|
|
|
@@ -37,30 +59,48 @@ interface WebBootEntry {
|
|
|
37
59
|
interface WebBootGraph {
|
|
38
60
|
/** Consistency anchor over the whole graph (content + bundle hashes). */
|
|
39
61
|
rev: string
|
|
40
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Composed entries in module-graph order — a dynamic package row precedes
|
|
64
|
+
* rows whose `external` requests that package. Cordis activation order is
|
|
65
|
+
* unrelated and remains owned by fiber service waiting.
|
|
66
|
+
*/
|
|
41
67
|
entries: WebBootEntry[]
|
|
68
|
+
/** Initial combo descriptors; every entry belongs to exactly one descriptor. */
|
|
69
|
+
batches: WebBootBatch[]
|
|
42
70
|
}
|
|
43
71
|
```
|
|
44
72
|
|
|
45
|
-
Each row's `rev` is
|
|
73
|
+
Each initial row's `rev` is an opaque process nonce plus sequence, so graph composition does not hash every plugin artifact. After HMR observes a change, that row's revision becomes the hash of its new bundle and available source map. The initial descriptors partition rows into bootstrap and application scheduling phases, and either phase may contain several descriptors. Their URLs contain only the ordered package-resource list and revision; phase names do not enter the route. Graph composition preserves row order while greedily splitting before the map-form URL exceeds 3 KiB. Startup combo revisions hash the combined plugin script bytes and indexed source map, and the graph revision hashes both rows and descriptors. `immediately` marks the stage-one registration barrier; rows within one combo share its script transport, while separate combos load independently.
|
|
46
74
|
|
|
47
75
|
## The scan
|
|
48
76
|
|
|
49
|
-
A package joins the table by declaring `dsh.client` (`platform: 'web'`, optional `inject` edges, optional `immediately`) in its package.json and exporting its built bundle at `exports["./client"]`.
|
|
77
|
+
A package joins the table by declaring `dsh.client` (`platform: 'web'`, optional `inject` edges, optional `immediately`) in its package.json and exporting its built bundle at `exports["./client"]`. Each live row resolves from its own Loader specifier and owning-tree `baseUrl`, through the same `loader.internal.resolveSync` implementation that imports its Host face when available. The nearest owning package manifest supplies the browser module id, so relative source and built overlays retain the package identity. Distinct active Loader sources resolving to one package name fail composition; after one source unloads, the surviving source supplies the row without a fiber restart.
|
|
50
78
|
|
|
51
79
|
Scanning is incremental per package; there is no full-rescan code path. Every cordis `internal/plugin` emission (fiber construction or disposal) marks the fiber's entry name dirty, and a microtask flush reconciles each dirty name against the live loader entries. The activation pass seeds the same dirty set with all current entries and flushes synchronously, so first scan and steady state share one implementation — with opposite failure postures. At activation, a malformed declaration or missing bundle among the already-loaded entries aggregates into one loud `AggregateError` listing every broken package: the fiber FAILS and the boot's fail-loud sweep reports it. In steady state, a broken package logs a warning and must not poison the others.
|
|
52
80
|
|
|
53
|
-
Package metadata — including the negative "not a client package" verdict — is cached per
|
|
81
|
+
Package metadata — including the negative "not a client package" verdict — is cached per Loader specifier and owning-tree base URL until restart. A fiber restart from the same source reuses its row and rev untouched; bundle content changes reach the graph only through `rebuilt()`.
|
|
54
82
|
|
|
55
|
-
## The bundle route and index
|
|
83
|
+
## The bundle route and index injection
|
|
56
84
|
|
|
57
|
-
`GET`/`HEAD /plugins
|
|
85
|
+
`GET`/`HEAD /plugins/??<package-a>/client.js,<package-b>/client.js&rev=<rev>` serves an exact generated combo script; a one-resource request uses the same form and is the HMR path. Its absolute `sourceMappingURL` changes every resource suffix in parallel, yielding `/plugins/??<package-a>/client.js.map,<package-b>/client.js.map&rev=<rev>`. The map is Indexed Source Map v3 even for one resource. An authored component map supplies its section; a component without one receives an identity section whose `sourcesContent` is the generated bundle and whose source name is its packaged `sourceURL` or plugin route. Every startup request URL is at most 3 KiB measured as UTF-8 bytes; partitioning uses the longer map form. All application URLs are preloaded, and all bootstrap URLs execute before the graph global and Vite entry. All advertised responses use long-lived immutable caching. Unknown or altered resource lists, missing revisions, and stale revisions answer 404 rather than serving different bytes or letting the SPA fallback return HTML as JavaScript; other methods are 405. The injection rows carry the current graph on every index render, so a reload always boots against the live composition.
|
|
58
86
|
|
|
59
87
|
## The service
|
|
60
88
|
|
|
61
|
-
|
|
89
|
+
```ts type-equiv
|
|
90
|
+
/** Filesystem baseline captured before a client artifact snapshot is read. */
|
|
91
|
+
interface ClientArtifactBaseline {
|
|
92
|
+
/** Absolute path of the client bundle. */
|
|
93
|
+
readonly path: string
|
|
94
|
+
/** Bundle modification time in milliseconds. */
|
|
95
|
+
readonly mtimeMs: number
|
|
96
|
+
/** Bundle size in bytes. */
|
|
97
|
+
readonly size: number
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`ClientModuleRegistry` (`ctx.clientModules`, defined in [`packages/client/modules/src/index.ts`](../../packages/client/modules/src/index.ts)) exposes reads and the rebuild face; signatures are in the generated [service catalog](#ctxclientmodules--clientmoduleregistry). `graph()` returns the current composed graph (a stable object between changes), `clientPath(id)` returns the bundle's absolute path, and `artifactBaseline(id)` returns the bundle stat values captured before the current snapshot was read. `rebuilt(id)` is the only entry point through which changed bundle content reaches the graph: it re-hashes the bundle together with its current source map, and only a real rev change recomposes the graph and notifies. `onRebuilt` fires per changed bundle with the new rev; `onGraphChanged` fires after any flush that recomposed the graph (row added or removed, or a rebuilt rev change) and is pull-model — listeners re-read `graph()`. Both notification paths contain listener exceptions so one throwing subscriber cannot skip later subscribers or kill whatever triggered the flush.
|
|
62
102
|
|
|
63
|
-
In development, [dsh-client-hmr](../../packages/client/hmr/README.md) is the registry's watch driver: its node half stat-polls every graph row's bundle from
|
|
103
|
+
In development, [dsh-client-hmr](../../packages/client/hmr/README.md) is the registry's watch driver: its node half stat-polls every graph row's bundle from the module host's pre-read baseline, calls `rebuilt(id)` only for a changed or dirty row, resyncs its watch set through `onGraphChanged`, and broadcasts rev changes to the browser half over SSE. Source-map changes alone do not trigger a reload; the current map joins the snapshot when a bundle change does. Production graphs omit the HMR row entirely; the module host itself never watches files.
|
|
64
104
|
|
|
65
105
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
66
106
|
|
|
@@ -68,13 +108,13 @@ In development, [dsh-client-hmr](../../packages/client/hmr/README.md) is the reg
|
|
|
68
108
|
|
|
69
109
|
## Cordis API
|
|
70
110
|
|
|
71
|
-
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`) —
|
|
111
|
+
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).
|
|
72
112
|
|
|
73
113
|
<a id="ctxclientmodules--clientmoduleregistry"></a>
|
|
74
114
|
|
|
75
115
|
### `ctx.clientModules` — `ClientModuleRegistry`
|
|
76
116
|
|
|
77
|
-
The web plugin table service: incremental `dsh.client` scan + wire composition + bundle route + index
|
|
117
|
+
The web plugin table service: incremental `dsh.client` scan + wire composition + bundle route + index injection rows. Construction runs the activation scan synchronously — a malformed declaration or missing bundle among the already-loaded entries aggregates into one loud throw (FAILED fiber; the boot activation audit reports it).
|
|
78
118
|
|
|
79
119
|
```ts cordis-catalog
|
|
80
120
|
/**
|
|
@@ -90,6 +130,16 @@ graph(): WebBootGraph
|
|
|
90
130
|
*/
|
|
91
131
|
clientPath(id: string): string | undefined
|
|
92
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Filesystem baseline captured before an entry's current bytes were read.
|
|
135
|
+
* HMR compares it with the live files when installing a watch, so a write
|
|
136
|
+
* between startup composition and watch installation cannot disappear into
|
|
137
|
+
* the watcher's initial state.
|
|
138
|
+
* @param id - entry id (package name).
|
|
139
|
+
* @returns the path and baseline, or undefined for an unknown id.
|
|
140
|
+
*/
|
|
141
|
+
artifactBaseline(id: string): ClientArtifactBaseline | undefined
|
|
142
|
+
|
|
93
143
|
/**
|
|
94
144
|
* Re-hash one bundle (the HMR watch's registration hook — the only entry
|
|
95
145
|
* point through which bundle content changes reach the graph).
|
|
@@ -114,5 +164,5 @@ onRebuilt(listener: (id: string, rev: string) => void): () => void
|
|
|
114
164
|
onGraphChanged(listener: () => void): () => void
|
|
115
165
|
```
|
|
116
166
|
|
|
117
|
-
Source: [`packages/client/modules/src/index.ts
|
|
167
|
+
Source: [`packages/client/modules/src/index.ts`](../../packages/client/modules/src/index.ts)
|
|
118
168
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,33 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
[English](client-modules.md) | 中文
|
|
4
4
|
|
|
5
|
-
Web 插件表:[dsh-client-modules](../../packages/client/modules) 中 client 模块系统的 Node 半,以 `ctx.clientModules`(`ClientModuleRegistry`)形式提供。它扫描宿主 Loader 的 entry,找出声明了 `dsh.client` 的包,组合出 `window.__DSH_BOOT__` entry 图,在 `/plugins
|
|
5
|
+
Web 插件表:[dsh-client-modules](../../packages/client/modules) 中 client 模块系统的 Node 半,以 `ctx.clientModules`(`ClientModuleRegistry`)形式提供。它扫描宿主 Loader 的 entry,找出声明了 `dsh.client` 的包,组合出 `window.__DSH_BOOT__` entry 图,在 `/plugins` 下提供带版本的单资源或多资源 combo 脚本,并以启动协议行回应每次 index 注入收集——这是同一个服务的四个面。它是 Web GUI 栈的一项可选能力,不属于 agent loop(智能体循环)主干,并且是 [dsh-host-webserver](../../packages/host/webserver) 的消费方:[web-server.md](web-server.zh.md) 所述的载体提供本服务注册的前缀路由与其回应的 `webserver/index-inject` 事件。同一个包的浏览器半(`ctx.modules`,即拉取并物化这些 bundle 的 lazy CJS 模块表)属于内核机件,记录在[包 README](../../packages/client/modules/README.zh.md)中,不在本页。
|
|
6
6
|
|
|
7
7
|
源码:[`packages/client/modules/src/client/manifest.ts`](../../packages/client/modules/src/client/manifest.ts)
|
|
8
8
|
|
|
9
9
|
## wire
|
|
10
10
|
|
|
11
|
-
图是 Node
|
|
11
|
+
图是 Node 半与浏览器半之间协议层的唯一真源。宿主从扫描到的包组合出 `WebBootEntry` 行与 `WebBootBatch` 描述,随后在 Vite entry 之前向结构化 index 注入表贡献 registration facade、application preload、bootstrap 脚本与图全局量。`global` 行渲染为 `globalThis["__DSH_BOOT__"]`,其中 `<` 已转义,插件可控的字符串因此无法逃出 script 元素。没有有效 manifest 的页面无法启动:浏览器解析器会拒绝畸形 row 或批次、未知成员,以及未恰好归属一个初始 combo 描述的 entry。
|
|
12
12
|
|
|
13
13
|
```ts type-equiv
|
|
14
14
|
/**
|
|
15
15
|
* One composed client entry pushed by the host (a graph row). Wire
|
|
16
16
|
* single source: the host node half (package root) produces this same shape.
|
|
17
|
-
* `immediately` marks stage-one prefetch
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* `immediately` marks stage-one prefetch. `inject` names package rows whose
|
|
18
|
+
* factories must arrive before this row materializes, while Cordis separately
|
|
19
|
+
* uses the same package edges to compose entries. `external` carries exact
|
|
20
|
+
* non-inject module requests (see {@link WebBootGraph.entries}).
|
|
20
21
|
*/
|
|
21
22
|
interface WebBootEntry {
|
|
22
23
|
/** Entry name == package name. */
|
|
23
24
|
id: string
|
|
24
|
-
/**
|
|
25
|
+
/** Revisioned single-resource combo endpoint used by HMR. */
|
|
25
26
|
url: string
|
|
26
|
-
/**
|
|
27
|
+
/** Opaque plugin-artifact revision used for HMR cache busting. */
|
|
27
28
|
rev: string
|
|
28
|
-
/** Package-name dependency edges
|
|
29
|
+
/** Package-name dependency edges used for factory arrival and plugin composition. */
|
|
29
30
|
inject?: string[]
|
|
30
31
|
/** Stage-one prefetch mark: load the script for factory registration during module-face boot. */
|
|
31
32
|
immediately?: boolean
|
|
33
|
+
/** Non-baseline module specifiers this row requests; omitted when it requests none. */
|
|
34
|
+
external?: string[]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```ts type-equiv
|
|
39
|
+
/** Initial scheduling phase for one content-addressed combo script. */
|
|
40
|
+
type WebBootBatchPhase = 'bootstrap' | 'application'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```ts type-equiv
|
|
44
|
+
/** One initial combo script; a scheduling phase may span several descriptors. */
|
|
45
|
+
interface WebBootBatch {
|
|
46
|
+
/** Parser-blocking bootstrap or preloaded application scheduling. */
|
|
47
|
+
phase: WebBootBatchPhase
|
|
48
|
+
/** Content-addressed combo script endpoint. */
|
|
49
|
+
url: string
|
|
50
|
+
/** Revision over the combined plugin script bytes and indexed source map. */
|
|
51
|
+
rev: string
|
|
52
|
+
/** Graph entry ids whose factories the script registers, in execution order. */
|
|
53
|
+
entries: string[]
|
|
32
54
|
}
|
|
33
55
|
```
|
|
34
56
|
|
|
@@ -37,30 +59,48 @@ interface WebBootEntry {
|
|
|
37
59
|
interface WebBootGraph {
|
|
38
60
|
/** Consistency anchor over the whole graph (content + bundle hashes). */
|
|
39
61
|
rev: string
|
|
40
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Composed entries in module-graph order — a dynamic package row precedes
|
|
64
|
+
* rows whose `external` requests that package. Cordis activation order is
|
|
65
|
+
* unrelated and remains owned by fiber service waiting.
|
|
66
|
+
*/
|
|
41
67
|
entries: WebBootEntry[]
|
|
68
|
+
/** Initial combo descriptors; every entry belongs to exactly one descriptor. */
|
|
69
|
+
batches: WebBootBatch[]
|
|
42
70
|
}
|
|
43
71
|
```
|
|
44
72
|
|
|
45
|
-
|
|
73
|
+
每个初始 row 的 `rev` 都是不透明的进程 nonce 加序号,因此组合图时不会哈希每个插件产物。HMR 观察到变化后,该 row 的 revision 才改为新 bundle 及其可用 sourcemap 的哈希。初始描述把 row 划入 bootstrap 与 application 两个调度阶段,每个阶段都可以包含多条描述。URL 只含有序 package 资源列表与 revision,阶段名不会进入路由。图组合保持 row 顺序,并在 map 形式 URL 超过 3 KiB 前贪心切分。启动 combo revision 对合并后的插件脚本字节与 indexed sourcemap 求哈希,图 revision 则对 row 与描述一并求哈希。`immediately` 标记第一阶段的 registration barrier;同一 combo 中的 row 共享脚本传输,不同 combo 则独立加载。
|
|
46
74
|
|
|
47
75
|
## 扫描
|
|
48
76
|
|
|
49
|
-
包加入这张表的方式,是在自己的 package.json 中声明 `dsh.client`(`platform: 'web'`、可选的 `inject` 边、可选的 `immediately`),并在 `exports["./client"]` 导出构建好的 bundle
|
|
77
|
+
包加入这张表的方式,是在自己的 package.json 中声明 `dsh.client`(`platform: 'web'`、可选的 `inject` 边、可选的 `immediately`),并在 `exports["./client"]` 导出构建好的 bundle。每个 live row 都从自己的 Loader specifier 与所属 tree `baseUrl` 解析;若 `loader.internal.resolveSync` 可用,则使用 Host face import 所用的同一个实现。最近归属的 package manifest 提供浏览器模块 id,因此相对 source 与 built overlay 仍保留包身份。若不同的 active Loader source 解析到同一包名,组合会失败;一个来源卸载后,仍存活的来源无需重启 fiber 即可提供该 row。
|
|
50
78
|
|
|
51
79
|
扫描是单包增量的;不存在全量重扫代码路径。fiber 构造或 dispose(资源释放)时的每次 cordis `internal/plugin` 发射都把该 fiber 的 entry 名标脏,一次微任务 flush 把每个脏名与实时 loader entry 对账。激活趟以全部当前 entry 灌入同一个脏集合并同步 flush,因此初扫与稳态共享一条实现——但失败姿态相反。激活时,已加载 entry 中的畸形声明或缺失 bundle 会聚合为一个大声的 `AggregateError`,列出每个损坏的包:该 fiber 进入 FAILED,由启动的大声失败 sweep 上报。稳态下,损坏的包只记录一条警告,且不得殃及其他包。
|
|
52
80
|
|
|
53
|
-
包元数据——包括「非 client
|
|
81
|
+
包元数据——包括「非 client 包」这一否定结论——按 Loader specifier 与所属 tree base URL 缓存至重启。同一来源的 fiber 重启会原样复用其 row 与 rev;bundle 内容变更只经 `rebuilt()` 到达图。
|
|
54
82
|
|
|
55
|
-
## bundle 路由与 index
|
|
83
|
+
## bundle 路由与 index 注入
|
|
56
84
|
|
|
57
|
-
`GET
|
|
85
|
+
`GET`/`HEAD /plugins/??<package-a>/client.js,<package-b>/client.js&rev=<rev>` 提供精确生成的 combo 脚本;单资源请求采用同一形式,也是 HMR 路径。其绝对 `sourceMappingURL` 平行改写每个资源后缀,得到 `/plugins/??<package-a>/client.js.map,<package-b>/client.js.map&rev=<rev>`。即使只有一个资源,map 仍采用 Indexed Source Map v3。组件有自带 map 时直接用于对应 section;没有时则获得 identity section,其 `sourcesContent` 是构建后 bundle,source 名取打包后的 `sourceURL` 或插件路由。每条启动请求 URL 按 UTF-8 字节计算都不超过 3 KiB;切分按更长的 map 形式计算。所有 application URL 都会预加载,所有 bootstrap URL 都会在图全局量与 Vite entry 之前执行。所有已发布响应都使用长期 immutable 缓存。未知或被修改的资源列表、缺少 revision 及陈旧 revision 都返回 404,绝不提供其他字节,也不会让 SPA fallback 把 HTML 当作 JavaScript 返回;其他方法返回 405。注入行在每次 index 渲染时携带当前图,因此重新加载总是基于实时组合启动。
|
|
58
86
|
|
|
59
87
|
## 服务
|
|
60
88
|
|
|
61
|
-
|
|
89
|
+
```ts type-equiv
|
|
90
|
+
/** Filesystem baseline captured before a client artifact snapshot is read. */
|
|
91
|
+
interface ClientArtifactBaseline {
|
|
92
|
+
/** Absolute path of the client bundle. */
|
|
93
|
+
readonly path: string
|
|
94
|
+
/** Bundle modification time in milliseconds. */
|
|
95
|
+
readonly mtimeMs: number
|
|
96
|
+
/** Bundle size in bytes. */
|
|
97
|
+
readonly size: number
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`ClientModuleRegistry`(`ctx.clientModules`,定义于 [`packages/client/modules/src/index.ts`](../../packages/client/modules/src/index.ts))暴露读取面与重建面;签名见生成的[服务目录](#ctxclientmodules--clientmoduleregistry)。`graph()` 返回当前组合出的图(两次变更之间是同一个稳定对象),`clientPath(id)` 返回 bundle 的绝对路径,`artifactBaseline(id)` 返回读取当前快照前捕获的 bundle stat 值。`rebuilt(id)` 是变化后的 bundle 内容到达图的唯一入口:它把 bundle 与当前 source map 一起重新哈希,只有 rev 真正变化才会重新组合图并发出通知。`onRebuilt` 按发生变化的 bundle 逐个触发并携带新 rev;`onGraphChanged` 在任何一次重新组合了图的 flush 之后触发(行的增删,或 rebuilt 带来的 rev 变化),并采用拉取模型——监听器自行重读 `graph()`。两条通知路径都会兜住监听器异常,因此一个抛错的订阅者既不能让后续订阅者被跳过,也不能杀死触发这次 flush 的一方。
|
|
62
102
|
|
|
63
|
-
开发环境下,[dsh-client-hmr](../../packages/client/hmr/README.md) 是注册表的监视驱动:它的 Node
|
|
103
|
+
开发环境下,[dsh-client-hmr](../../packages/client/hmr/README.zh.md) 是注册表的监视驱动:它的 Node 半从 module host 读文件前记录的基线出发,对图中每一行的 bundle 做 stat 轮询,只为变化或标脏的 row 调用 `rebuilt(id)`,经 `onGraphChanged` 重新同步监视集合,并通过 SSE(Server-Sent Events)把 rev 变化广播给浏览器半。仅 source map 变化不会触发重载;bundle 变化时,当前 map 会一起进入快照。生产环境的图完全不含 HMR(热模块替换)行;module host 自身从不监视文件。
|
|
64
104
|
|
|
65
105
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
66
106
|
|
|
@@ -68,13 +108,13 @@ interface WebBootGraph {
|
|
|
68
108
|
|
|
69
109
|
## Cordis API
|
|
70
110
|
|
|
71
|
-
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`) —
|
|
111
|
+
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).
|
|
72
112
|
|
|
73
113
|
<a id="ctxclientmodules--clientmoduleregistry"></a>
|
|
74
114
|
|
|
75
115
|
### `ctx.clientModules` — `ClientModuleRegistry`
|
|
76
116
|
|
|
77
|
-
The web plugin table service: incremental `dsh.client` scan + wire composition + bundle route + index
|
|
117
|
+
The web plugin table service: incremental `dsh.client` scan + wire composition + bundle route + index injection rows. Construction runs the activation scan synchronously — a malformed declaration or missing bundle among the already-loaded entries aggregates into one loud throw (FAILED fiber; the boot activation audit reports it).
|
|
78
118
|
|
|
79
119
|
```ts cordis-catalog
|
|
80
120
|
/**
|
|
@@ -90,6 +130,16 @@ graph(): WebBootGraph
|
|
|
90
130
|
*/
|
|
91
131
|
clientPath(id: string): string | undefined
|
|
92
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Filesystem baseline captured before an entry's current bytes were read.
|
|
135
|
+
* HMR compares it with the live files when installing a watch, so a write
|
|
136
|
+
* between startup composition and watch installation cannot disappear into
|
|
137
|
+
* the watcher's initial state.
|
|
138
|
+
* @param id - entry id (package name).
|
|
139
|
+
* @returns the path and baseline, or undefined for an unknown id.
|
|
140
|
+
*/
|
|
141
|
+
artifactBaseline(id: string): ClientArtifactBaseline | undefined
|
|
142
|
+
|
|
93
143
|
/**
|
|
94
144
|
* Re-hash one bundle (the HMR watch's registration hook — the only entry
|
|
95
145
|
* point through which bundle content changes reach the graph).
|
|
@@ -114,5 +164,5 @@ onRebuilt(listener: (id: string, rev: string) => void): () => void
|
|
|
114
164
|
onGraphChanged(listener: () => void): () => void
|
|
115
165
|
```
|
|
116
166
|
|
|
117
|
-
Source: [`packages/client/modules/src/index.ts
|
|
167
|
+
Source: [`packages/client/modules/src/index.ts`](../../packages/client/modules/src/index.ts)
|
|
118
168
|
<!-- 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/code-runtime.md
|
|
5
|
-
code-runtime.md:
|
|
6
|
-
code-runtime.zh.md:
|
|
5
|
+
code-runtime.md: 0f633df9fc657d9d80fc04df3bc8ad6fafdddcb2
|
|
6
|
+
code-runtime.zh.md: 43b78ce49575741f7ae6c4e2751b63b7562fc99a
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](code-runtime.zh.md)
|
|
4
4
|
|
|
5
|
-
The code-execution seam — a [capability seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md) whose Service Definition ([dsh-code-runtime](../../packages/code-runtime/code-runtime), `ctx.codeRuntime`) runs one model-written program against host-provided async bindings and reports what it printed and returned. Code execution is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](core.md). Backends differ by execution substrate and source language, both readonly descriptors on the service; the worker-thread Service Provider and tool-registry Consumer are specified by the [
|
|
5
|
+
The code-execution seam — a [capability seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md) whose Service Definition ([dsh-code-runtime](../../packages/code-runtime/code-runtime), `ctx.codeRuntime`) runs one model-written program against host-provided async bindings and reports what it printed and returned. Code execution is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](core.md). Backends differ by execution substrate and source language, both readonly descriptors on the service; the worker-thread Service Provider and tool-registry Consumer are specified by the [PTC mode foundation](../../.agents/notes/implemented/feature/2026-06-15-ptc.md) and [typed-return contract](../../.agents/notes/implemented/feature/2026-07-20-ptc-typed-tool-returns.md).
|
|
6
6
|
|
|
7
7
|
Source: [`packages/code-runtime/code-runtime/src/types.ts`](../../packages/code-runtime/code-runtime/src/types.ts)
|
|
8
8
|
|
|
@@ -61,7 +61,7 @@ interface CodeRunResult {
|
|
|
61
61
|
|
|
62
62
|
## Bindings: host functions as program globals
|
|
63
63
|
|
|
64
|
-
Each `CodeBindingNamespace` becomes one global object of async callables inside the program (the
|
|
64
|
+
Each `CodeBindingNamespace` becomes one global object of async callables inside the program (the PTC mode consumer passes one: `tools`). Arguments and resolutions must be lossless JSON and cross without a seam-level byte cap; the runtime may bridge them through structured clone. A namespace may declare a program-visible error class without making the runtime know the consumer's names: the runtime injects the real constructor and turns rejected calls into its instances. A runtime also treats binding names as hostile input (`__proto__` is an ordinary own property, never a prototype collision):
|
|
65
65
|
|
|
66
66
|
```ts type-equiv
|
|
67
67
|
/**
|
|
@@ -69,7 +69,7 @@ Each `CodeBindingNamespace` becomes one global object of async callables inside
|
|
|
69
69
|
* injects a real error constructor under `name`; rejected member calls become
|
|
70
70
|
* its instances and expose the exact member name through
|
|
71
71
|
* `memberNameProperty`. Both strings are runtime data rather than knowledge
|
|
72
|
-
* of a particular consumer such as
|
|
72
|
+
* of a particular consumer such as PTC mode.
|
|
73
73
|
*/
|
|
74
74
|
interface CodeBindingErrorClass {
|
|
75
75
|
/** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
|
|
@@ -166,7 +166,7 @@ interface CodeRunFailure {
|
|
|
166
166
|
|
|
167
167
|
## Cordis API
|
|
168
168
|
|
|
169
|
-
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`) —
|
|
169
|
+
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).
|
|
170
170
|
|
|
171
171
|
<a id="ctxcoderuntime--coderuntime-abstract-seam"></a>
|
|
172
172
|
|
|
@@ -187,5 +187,5 @@ Registers one `ctx.codeRuntime` implementation. Program, budget, abort, and subs
|
|
|
187
187
|
abstract run(request: CodeRunRequest): Promise<CodeRunResult>
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
Source: [`packages/code-runtime/code-runtime/src/index.ts
|
|
190
|
+
Source: [`packages/code-runtime/code-runtime/src/index.ts`](../../packages/code-runtime/code-runtime/src/index.ts)
|
|
191
191
|
<!-- END GENERATED cordis-surface -->
|