dsh-plugin-guide 0.3.21 → 0.3.23
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 +15 -12
- package/README-hi.md +15 -12
- package/README-pt.md +15 -12
- package/README-zh.md +15 -12
- package/README.md +290 -280
- package/SKILL.md +36 -19
- package/dist/dsh-plugin-dev.js +113 -9
- package/guide/choosing-a-plugin.md +412 -0
- package/guide/choosing-a-plugin.zh-CN.md +414 -0
- package/guide/links.md +20 -2
- package/guide/migration-0.2.md +219 -0
- package/guide/plugin-dev-guide.md +99 -24
- package/guide/quick-reference.es.md +14 -8
- package/guide/quick-reference.hi.md +15 -9
- package/guide/quick-reference.md +18 -10
- package/guide/quick-reference.pt.md +15 -9
- package/guide/quick-reference.zh-CN.md +19 -11
- package/guide/release-engineering.md +2 -2
- package/guide/release-engineering.zh-CN.md +2 -2
- package/guide/unfixed-issues.md +117 -82
- package/guide/when-to-retire-a-plugin.md +127 -0
- package/guide/when-to-retire-a-plugin.zh-CN.md +127 -0
- package/icon.svg +5 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +8 -4
- package/references/official-docs/AGENTS.md +8 -5
- package/references/official-docs/CONTRIBUTING.i18n.yaml +6 -5
- package/references/official-docs/README.i18n.yaml +33 -5
- package/references/official-docs/README.zh.md +3 -3
- package/references/official-docs/SNAPSHOT.md +3 -3
- package/references/official-docs/THIRD_PARTY_NOTICES.md +34 -6
- package/references/official-docs/docs/AGENTS.md +4 -4
- package/references/official-docs/docs/agent-lifecycle.i18n.yaml +9 -5
- package/references/official-docs/docs/api-gateway.i18n.yaml +27 -5
- package/references/official-docs/docs/api-gateway.md +10 -9
- package/references/official-docs/docs/api-gateway.zh.md +10 -9
- package/references/official-docs/docs/architecture.i18n.yaml +36 -5
- package/references/official-docs/docs/architecture.md +10 -8
- package/references/official-docs/docs/architecture.zh.md +10 -8
- package/references/official-docs/docs/capability-seams.i18n.yaml +9 -5
- package/references/official-docs/docs/capability-seams.md +76 -32
- package/references/official-docs/docs/capability-seams.zh.md +76 -32
- package/references/official-docs/docs/config-catalog.i18n.yaml +18 -5
- package/references/official-docs/docs/config-catalog.md +1360 -765
- package/references/official-docs/docs/config-catalog.zh.md +1363 -767
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +27 -5
- package/references/official-docs/docs/cookbook/adding-a-package.md +56 -3
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +54 -3
- package/references/official-docs/docs/cookbook/adding-a-remote-api.i18n.yaml +24 -5
- package/references/official-docs/docs/cookbook/adding-a-remote-api.md +2 -2
- package/references/official-docs/docs/cookbook/adding-a-remote-api.zh.md +2 -2
- package/references/official-docs/docs/cookbook/adding-a-session-format-version.i18n.yaml +39 -5
- package/references/official-docs/docs/cookbook/adding-a-session-format-version.md +46 -6
- package/references/official-docs/docs/cookbook/adding-a-session-format-version.zh.md +46 -6
- package/references/official-docs/docs/cookbook/adding-a-settings-card.i18n.yaml +21 -5
- package/references/official-docs/docs/cookbook/adding-a-settings-card.md +34 -64
- package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +34 -64
- package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +30 -5
- package/references/official-docs/docs/cookbook/adding-a-tool.md +2 -2
- package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +2 -2
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +18 -5
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +18 -5
- package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +24 -5
- package/references/official-docs/docs/cookbook/extension-cookbook.md +3 -3
- package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +3 -3
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +21 -5
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +15 -5
- package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.i18n.yaml +30 -5
- package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.md +13 -1
- package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.zh.md +13 -1
- package/references/official-docs/docs/cordis-api/context.i18n.yaml +72 -5
- package/references/official-docs/docs/cordis-api/events.i18n.yaml +36 -5
- package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +75 -5
- package/references/official-docs/docs/cordis-api/inherited.md +15 -13
- package/references/official-docs/docs/cordis-api/registry.i18n.yaml +21 -5
- package/references/official-docs/docs/cordis-api/service.i18n.yaml +36 -5
- package/references/official-docs/docs/cordis-primer.i18n.yaml +21 -5
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +21 -5
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +15 -5
- package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +21 -5
- package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +15 -5
- package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +18 -5
- package/references/official-docs/docs/cordis-tutorial/05-config.md +27 -0
- package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +27 -0
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +15 -5
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +18 -5
- package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +15 -5
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +33 -5
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +7 -7
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +7 -7
- package/references/official-docs/docs/defensive-patterns.i18n.yaml +27 -5
- package/references/official-docs/docs/dependency-catalog.json +2 -2
- package/references/official-docs/docs/development.i18n.yaml +48 -5
- package/references/official-docs/docs/development.md +27 -10
- package/references/official-docs/docs/development.zh.md +27 -10
- package/references/official-docs/docs/event-producer-consumer.i18n.yaml +12 -5
- package/references/official-docs/docs/event-producer-consumer.md +78 -66
- package/references/official-docs/docs/event-producer-consumer.zh.md +78 -66
- package/references/official-docs/docs/glossary.i18n.yaml +24 -5
- package/references/official-docs/docs/graph-atlas.i18n.yaml +9 -5
- package/references/official-docs/docs/i18n/README.i18n.yaml +18 -5
- package/references/official-docs/docs/i18n/README.md +12 -8
- package/references/official-docs/docs/i18n/README.zh.md +12 -8
- package/references/official-docs/docs/i18n/terminology.md +4 -4
- package/references/official-docs/docs/i18n/translation-prompt.md +2 -2
- package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +27 -5
- package/references/official-docs/docs/module-graph.i18n.yaml +9 -5
- package/references/official-docs/docs/module-graph.md +348 -245
- package/references/official-docs/docs/module-graph.zh.md +348 -245
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +2064 -5
- package/references/official-docs/docs/persistence-catalog.md +5275 -3205
- package/references/official-docs/docs/persistence-catalog.zh.md +5275 -3205
- package/references/official-docs/docs/persistence-changes/2026-09-11-initial.i18n.yaml +27 -5
- package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.i18n.yaml +27 -5
- package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.i18n.yaml +27 -5
- package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.i18n.yaml +27 -5
- package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.i18n.yaml +28 -0
- package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.md +120 -0
- package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.schema.json +16212 -0
- package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.zh.md +120 -0
- package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.i18n.yaml +28 -0
- package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.md +48 -0
- package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.schema.json +302 -0
- package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.zh.md +48 -0
- package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.i18n.yaml +28 -0
- package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.md +48 -0
- package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.schema.json +250 -0
- package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.zh.md +48 -0
- package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.i18n.yaml +28 -0
- package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.md +60 -0
- package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.schema.json +11405 -0
- package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.zh.md +60 -0
- package/references/official-docs/docs/persistence-changes/README.i18n.yaml +27 -5
- package/references/official-docs/docs/persistence-changes/README.md +17 -3
- package/references/official-docs/docs/persistence-changes/README.zh.md +17 -3
- package/references/official-docs/docs/persistence-changes/finalized/v4.json +379 -0
- package/references/official-docs/docs/persistence-changes/historical-formats/README.i18n.yaml +27 -5
- package/references/official-docs/docs/persistence-changes/historical-formats/README.md +3 -2
- package/references/official-docs/docs/persistence-changes/historical-formats/README.zh.md +3 -2
- package/references/official-docs/docs/persistence-changes/historical-formats/v0.i18n.yaml +1284 -5
- package/references/official-docs/docs/persistence-changes/historical-formats/v1.i18n.yaml +1284 -5
- package/references/official-docs/docs/persistence-changes/historical-formats/v2.i18n.yaml +1344 -5
- package/references/official-docs/docs/persistence-changes/historical-formats/v3.i18n.yaml +1441 -0
- package/references/official-docs/docs/persistence-changes/historical-formats/v3.md +5634 -0
- package/references/official-docs/docs/persistence-changes/historical-formats/v3.schema.json +61307 -0
- package/references/official-docs/docs/persistence-changes/historical-formats/v3.zh.md +5634 -0
- package/references/official-docs/docs/persistence-changes/releases/README.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.schema.json +3 -3
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.i18n.yaml +30 -5
- package/references/official-docs/docs/persistence-schema.json +12692 -48753
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +33 -5
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +27 -5
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +27 -5
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +27 -5
- package/references/official-docs/docs/postmortem/README.i18n.yaml +6 -5
- package/references/official-docs/docs/rescope.i18n.yaml +18 -5
- package/references/official-docs/docs/rescope.md +1 -1
- package/references/official-docs/docs/rescope.zh.md +1 -1
- package/references/official-docs/docs/session-format-status.i18n.yaml +27 -5
- package/references/official-docs/docs/session-format-status.md +17 -3
- package/references/official-docs/docs/session-format-status.zh.md +17 -3
- package/references/official-docs/docs/subsystems/README.i18n.yaml +6 -5
- package/references/official-docs/docs/subsystems/README.md +6 -3
- package/references/official-docs/docs/subsystems/README.zh.md +6 -3
- package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +21 -5
- package/references/official-docs/docs/subsystems/agent-team.md +52 -28
- package/references/official-docs/docs/subsystems/agent-team.zh.md +52 -28
- package/references/official-docs/docs/subsystems/approval.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/approval.md +1 -1
- package/references/official-docs/docs/subsystems/approval.zh.md +1 -1
- package/references/official-docs/docs/subsystems/attachment.i18n.yaml +12 -5
- package/references/official-docs/docs/subsystems/attachment.md +2 -2
- package/references/official-docs/docs/subsystems/attachment.zh.md +2 -2
- package/references/official-docs/docs/subsystems/boot.i18n.yaml +9 -5
- package/references/official-docs/docs/subsystems/boot.md +117 -17
- package/references/official-docs/docs/subsystems/boot.zh.md +117 -17
- package/references/official-docs/docs/subsystems/browser-use.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/claude-code-mods.i18n.yaml +28 -0
- package/references/official-docs/docs/subsystems/claude-code-mods.md +146 -0
- package/references/official-docs/docs/subsystems/claude-code-mods.zh.md +146 -0
- package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/client-modules.md +13 -7
- package/references/official-docs/docs/subsystems/client-modules.zh.md +13 -7
- package/references/official-docs/docs/subsystems/client-resources.i18n.yaml +21 -5
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/commands.md +1 -1
- package/references/official-docs/docs/subsystems/commands.zh.md +1 -1
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +21 -5
- package/references/official-docs/docs/subsystems/compaction.md +2 -2
- package/references/official-docs/docs/subsystems/compaction.zh.md +2 -2
- package/references/official-docs/docs/subsystems/computer-use.i18n.yaml +15 -5
- package/references/official-docs/docs/subsystems/conversation.i18n.yaml +30 -5
- package/references/official-docs/docs/subsystems/conversation.md +35 -6
- package/references/official-docs/docs/subsystems/conversation.zh.md +34 -5
- package/references/official-docs/docs/subsystems/core.i18n.yaml +36 -5
- package/references/official-docs/docs/subsystems/core.md +70 -214
- package/references/official-docs/docs/subsystems/core.zh.md +70 -214
- package/references/official-docs/docs/subsystems/credentials.i18n.yaml +24 -5
- package/references/official-docs/docs/subsystems/credentials.md +168 -5
- package/references/official-docs/docs/subsystems/credentials.zh.md +168 -5
- package/references/official-docs/docs/subsystems/deliverables.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/extensions.i18n.yaml +6 -5
- package/references/official-docs/docs/subsystems/extensions.md +6 -4
- package/references/official-docs/docs/subsystems/extensions.zh.md +6 -4
- package/references/official-docs/docs/subsystems/feedback.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +33 -5
- package/references/official-docs/docs/subsystems/filesystem.md +10 -0
- package/references/official-docs/docs/subsystems/filesystem.zh.md +10 -0
- package/references/official-docs/docs/subsystems/goal.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/goal.md +1 -1
- package/references/official-docs/docs/subsystems/goal.zh.md +1 -1
- package/references/official-docs/docs/subsystems/jobs.i18n.yaml +24 -5
- package/references/official-docs/docs/subsystems/jobs.md +335 -126
- package/references/official-docs/docs/subsystems/jobs.zh.md +335 -126
- package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +48 -5
- package/references/official-docs/docs/subsystems/llm-streaming.md +60 -31
- package/references/official-docs/docs/subsystems/llm-streaming.zh.md +60 -31
- package/references/official-docs/docs/subsystems/lsp.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/mcp.i18n.yaml +33 -5
- package/references/official-docs/docs/subsystems/mcp.md +2 -2
- package/references/official-docs/docs/subsystems/mcp.zh.md +2 -2
- package/references/official-docs/docs/subsystems/office-to-pdf.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/office-to-pdf.md +4 -4
- package/references/official-docs/docs/subsystems/office-to-pdf.zh.md +4 -4
- package/references/official-docs/docs/subsystems/otel.i18n.yaml +7 -0
- package/references/official-docs/docs/subsystems/otel.md +44 -0
- package/references/official-docs/docs/subsystems/otel.zh.md +44 -0
- package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/permission-presets.md +7 -6
- package/references/official-docs/docs/subsystems/permission-presets.zh.md +7 -6
- package/references/official-docs/docs/subsystems/persistence.i18n.yaml +36 -5
- package/references/official-docs/docs/subsystems/persistence.md +3 -3
- package/references/official-docs/docs/subsystems/persistence.zh.md +3 -3
- package/references/official-docs/docs/subsystems/plan.i18n.yaml +21 -5
- package/references/official-docs/docs/subsystems/plan.md +1 -1
- package/references/official-docs/docs/subsystems/plan.zh.md +1 -1
- package/references/official-docs/docs/subsystems/product-telemetry.i18n.yaml +10 -0
- package/references/official-docs/docs/subsystems/product-telemetry.md +79 -0
- package/references/official-docs/docs/subsystems/product-telemetry.zh.md +79 -0
- package/references/official-docs/docs/subsystems/ptc-runtime.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/sandbox.md +1 -1
- package/references/official-docs/docs/subsystems/sandbox.zh.md +1 -1
- package/references/official-docs/docs/subsystems/schedule.i18n.yaml +39 -5
- package/references/official-docs/docs/subsystems/schedule.md +391 -33
- package/references/official-docs/docs/subsystems/schedule.zh.md +391 -33
- package/references/official-docs/docs/subsystems/scope.i18n.yaml +15 -5
- package/references/official-docs/docs/subsystems/scope.md +1 -1
- package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
- package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +15 -5
- package/references/official-docs/docs/subsystems/session-projection.md +20 -18
- package/references/official-docs/docs/subsystems/session-projection.zh.md +20 -18
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +21 -5
- package/references/official-docs/docs/subsystems/session-telemetry.md +6 -4
- package/references/official-docs/docs/subsystems/session-telemetry.zh.md +6 -4
- package/references/official-docs/docs/subsystems/session-title.i18n.yaml +15 -5
- package/references/official-docs/docs/subsystems/session.i18n.yaml +66 -5
- package/references/official-docs/docs/subsystems/session.md +113 -62
- package/references/official-docs/docs/subsystems/session.zh.md +113 -62
- package/references/official-docs/docs/subsystems/settings.i18n.yaml +12 -5
- package/references/official-docs/docs/subsystems/settings.md +42 -292
- package/references/official-docs/docs/subsystems/settings.zh.md +42 -292
- package/references/official-docs/docs/subsystems/shell.i18n.yaml +24 -5
- package/references/official-docs/docs/subsystems/shell.md +29 -22
- package/references/official-docs/docs/subsystems/shell.zh.md +29 -22
- package/references/official-docs/docs/subsystems/sidebar-right.i18n.yaml +36 -5
- package/references/official-docs/docs/subsystems/sidebar-right.md +14 -9
- package/references/official-docs/docs/subsystems/sidebar-right.zh.md +14 -9
- package/references/official-docs/docs/subsystems/skills.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/skills.md +2 -2
- package/references/official-docs/docs/subsystems/skills.zh.md +2 -2
- package/references/official-docs/docs/subsystems/slots.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/slots.md +21 -7
- package/references/official-docs/docs/subsystems/slots.zh.md +21 -7
- package/references/official-docs/docs/subsystems/spill.i18n.yaml +15 -5
- package/references/official-docs/docs/subsystems/spill.md +1 -1
- package/references/official-docs/docs/subsystems/spill.zh.md +1 -1
- package/references/official-docs/docs/subsystems/ssh.i18n.yaml +21 -5
- package/references/official-docs/docs/subsystems/storage.i18n.yaml +24 -5
- package/references/official-docs/docs/subsystems/storage.md +1 -2
- package/references/official-docs/docs/subsystems/storage.zh.md +1 -2
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +30 -5
- package/references/official-docs/docs/subsystems/subagent.md +35 -60
- package/references/official-docs/docs/subsystems/subagent.zh.md +35 -60
- package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +30 -5
- package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/terminal.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/todo.i18n.yaml +12 -5
- package/references/official-docs/docs/subsystems/todo.md +3 -3
- package/references/official-docs/docs/subsystems/todo.zh.md +3 -3
- package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +12 -5
- package/references/official-docs/docs/subsystems/tools.i18n.yaml +24 -5
- package/references/official-docs/docs/subsystems/tools.md +15 -4
- package/references/official-docs/docs/subsystems/tools.zh.md +15 -4
- package/references/official-docs/docs/subsystems/typert.i18n.yaml +21 -5
- package/references/official-docs/docs/subsystems/typert.md +147 -6
- package/references/official-docs/docs/subsystems/typert.zh.md +147 -6
- package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/user-questions.md +128 -1
- package/references/official-docs/docs/subsystems/user-questions.zh.md +129 -2
- package/references/official-docs/docs/subsystems/voice-input.i18n.yaml +19 -0
- package/references/official-docs/docs/subsystems/voice-input.md +164 -0
- package/references/official-docs/docs/subsystems/voice-input.zh.md +164 -0
- package/references/official-docs/docs/subsystems/web-client.i18n.yaml +36 -5
- package/references/official-docs/docs/subsystems/web-client.md +10 -5
- package/references/official-docs/docs/subsystems/web-client.zh.md +10 -5
- package/references/official-docs/docs/subsystems/web-server.i18n.yaml +15 -5
- package/references/official-docs/docs/subsystems/web-server.md +12 -4
- package/references/official-docs/docs/subsystems/web-server.zh.md +12 -4
- package/references/official-docs/docs/subsystems/web.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/webhook.i18n.yaml +18 -5
- package/references/official-docs/docs/subsystems/webhook.md +1 -1
- package/references/official-docs/docs/subsystems/webhook.zh.md +1 -1
- package/references/official-docs/docs/subsystems/workflow.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/workflow.md +2 -2
- package/references/official-docs/docs/subsystems/workflow.zh.md +2 -2
- package/references/official-docs/docs/subsystems/workspace.i18n.yaml +27 -5
- package/references/official-docs/docs/subsystems/workspace.md +175 -35
- package/references/official-docs/docs/subsystems/workspace.zh.md +175 -35
- package/references/official-docs/docs/testing.i18n.yaml +33 -5
- package/references/official-docs/docs/testing.md +2 -2
- package/references/official-docs/docs/testing.zh.md +2 -2
- package/references/official-docs/docs/tool-catalog.i18n.yaml +312 -5
- package/references/official-docs/docs/tool-catalog.md +321 -92
- package/references/official-docs/docs/tool-catalog.zh.md +321 -92
- package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +9 -5
- package/references/official-docs/docs/tool-execution-pipeline.md +6 -3
- package/references/official-docs/docs/tool-execution-pipeline.zh.md +6 -3
- package/references/official-docs/docs/ui-radius.i18n.yaml +31 -0
- package/references/official-docs/docs/ui-radius.md +115 -0
- package/references/official-docs/docs/ui-radius.zh.md +115 -0
- package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.i18n.yaml +16 -0
- package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.md +22 -0
- package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.zh.md +22 -0
- package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.i18n.yaml +16 -0
- package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.md +25 -0
- package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.zh.md +25 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.i18n.yaml +16 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.md +18 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.zh.md +18 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.i18n.yaml +16 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.md +23 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.zh.md +23 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.i18n.yaml +16 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md +22 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md +22 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.i18n.yaml +16 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.md +27 -0
- package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.zh.md +27 -0
- package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +27 -5
- package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +36 -5
- package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +30 -5
- package/references/official-docs/docs/user/develop/basic/publish.md +7 -1
- package/references/official-docs/docs/user/develop/basic/publish.zh.md +7 -1
- package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +15 -5
- package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +45 -5
- package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +30 -5
- package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +39 -5
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +9 -5
- package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +45 -5
- package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +33 -5
- package/references/official-docs/docs/user/develop/practice/llm-adapter.md +1 -1
- package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +1 -1
- package/references/official-docs/docs/user/guide/github-review.i18n.yaml +24 -5
- package/references/official-docs/docs/user/guide/index.i18n.yaml +18 -5
- package/references/official-docs/docs/user/guide/index.md +1 -0
- package/references/official-docs/docs/user/guide/index.zh.md +1 -0
- package/references/official-docs/docs/user/guide/mcp-memory.i18n.yaml +36 -5
- package/references/official-docs/docs/user/guide/network-proxy.i18n.yaml +24 -5
- package/references/official-docs/docs/user/guide/providers-custom-form.png +0 -0
- package/references/official-docs/docs/user/guide/providers-custom-form.zh.png +0 -0
- package/references/official-docs/docs/user/guide/providers-models-page.png +0 -0
- package/references/official-docs/docs/user/guide/providers-models-page.zh.png +0 -0
- package/references/official-docs/docs/user/guide/providers.i18n.yaml +36 -5
- package/references/official-docs/docs/user/guide/providers.md +88 -78
- package/references/official-docs/docs/user/guide/providers.zh.md +102 -92
- package/references/official-docs/docs/user/guide/public-deployments.i18n.yaml +19 -0
- package/references/official-docs/docs/user/guide/public-deployments.md +33 -0
- package/references/official-docs/docs/user/guide/public-deployments.zh.md +33 -0
- package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +27 -5
- package/references/official-docs/docs/user/guide/python-sdk.md +1 -1
- package/references/official-docs/docs/user/guide/python-sdk.zh.md +1 -1
- package/references/official-docs/docs/user/guide/schedule.i18n.yaml +30 -5
- package/references/official-docs/docs/user/guide/schedule.md +69 -11
- package/references/official-docs/docs/user/guide/schedule.zh.md +69 -11
- package/references/official-docs/docs/user/index.i18n.yaml +9 -5
- package/references/official-docs/docs/web-styling.i18n.yaml +18 -5
- package/references/official-docs/docs/web-styling.md +12 -3
- package/references/official-docs/docs/web-styling.zh.md +12 -3
- package/references/official-docs/packages/AGENTS.md +1 -2
- package/references/official-docs/packages/README.md +5 -5
- package/references/official-docs/vendor/README.md +6 -2
- package/references/official-docs/website-docs.ts +10 -3
- package/references/official-plugin-dev-skill.md +124 -0
- package/references/sources.md +10 -5
- package/scripts/archive-discussions.ps1 +9 -1
- package/scripts/build-llms-full.mjs +64 -0
- package/scripts/check-docs-drift.ps1 +1 -1
- package/scripts/sync-official-docs.ps1 +1 -1
- package/templates/js/icon.svg +4 -0
- package/templates/js/locale/en.json +6 -0
- package/templates/js/locale/zh.json +6 -0
- package/templates/js/package.json +9 -1
- package/templates/ts/icon.svg +4 -0
- package/templates/ts/locale/en.json +6 -0
- package/templates/ts/locale/zh.json +6 -0
- package/templates/ts/package.json +9 -1
- package/references/official-docs/docs/subsystems/invariants.i18n.yaml +0 -6
- package/references/official-docs/docs/subsystems/invariants.md +0 -88
- package/references/official-docs/docs/subsystems/invariants.zh.md +0 -88
|
@@ -38,7 +38,7 @@ interface TypertLookupDefinition {
|
|
|
38
38
|
|
|
39
39
|
## Invocation descriptors
|
|
40
40
|
|
|
41
|
-
An `InvocationDescriptor` is local reflection, not a wire message. Host and consumer builds generate corresponding descriptors; the request sends only the endpoint and named `args`. Strict codecs carry generated schema factories, while SRC codecs enforce JSON-safe
|
|
41
|
+
An `InvocationDescriptor` is local reflection, not a wire message. Host and consumer builds generate corresponding descriptors; the request sends only the endpoint and named `args`. Strict codecs carry generated schema factories, while SRC codecs enforce JSON-safe inputs without structural type recovery. Unary result codecs can supply `encode()` for byte-containing subtrees and `decode()` for recursive native-byte validation; Client declarations narrow every `Uint8Array` to `ArrayBuffer` backing. Pure JSON results need neither byte detection nor Client decoding. Cancellation is an out-of-band carrier signal injected after business parameters and never enters `args`.
|
|
42
42
|
|
|
43
43
|
```ts type-equiv
|
|
44
44
|
/** Codec attached to one invocation parameter or result. */
|
|
@@ -48,6 +48,19 @@ type TypertCodec =
|
|
|
48
48
|
readonly typeSymbol: string
|
|
49
49
|
/** Materialize and return the process-realm schema on first boundary use. */
|
|
50
50
|
readonly create: () => TypertSchema
|
|
51
|
+
/**
|
|
52
|
+
* Decode a unary result whose fields require type-specific handling.
|
|
53
|
+
* @param value - result reconstructed by the RPC carrier.
|
|
54
|
+
* @returns the validated result, retaining native byte views.
|
|
55
|
+
*/
|
|
56
|
+
readonly decode?: (value: unknown) => unknown
|
|
57
|
+
/**
|
|
58
|
+
* Project typed binary fields into RPC result attachments.
|
|
59
|
+
* @param value - native unary result.
|
|
60
|
+
* @param writeBytes - records a byte view at its result-relative path and returns its JSON placeholder.
|
|
61
|
+
* @returns JSON metadata with untouched JSON subtrees retained.
|
|
62
|
+
*/
|
|
63
|
+
readonly encode?: (value: unknown, writeBytes: (bytes: Uint8Array, path: readonly (string | number)[]) => null) => unknown
|
|
51
64
|
}
|
|
52
65
|
| {
|
|
53
66
|
readonly mode: 'src-json'
|
|
@@ -85,7 +98,7 @@ interface InvocationDescriptor {
|
|
|
85
98
|
readonly method: string
|
|
86
99
|
/** Service member invoked when the exported method name is an alias. */
|
|
87
100
|
readonly implementation?: string
|
|
88
|
-
/** Absent for unary calls; stream calls
|
|
101
|
+
/** Absent for unary calls; stream calls deliver every yielded item as the Host produced it. */
|
|
89
102
|
readonly mode?: 'stream'
|
|
90
103
|
/** Receiver selection mode. */
|
|
91
104
|
readonly invocation:
|
|
@@ -105,6 +118,16 @@ interface InvocationDescriptor {
|
|
|
105
118
|
}
|
|
106
119
|
/** Ordered business parameters. */
|
|
107
120
|
readonly parameters: readonly InvocationParameterDescriptor[]
|
|
121
|
+
/**
|
|
122
|
+
* Client-to-Host items of the same logical stream, generated from the `In`
|
|
123
|
+
* type argument of the method's `RemoteStream<Out, In>` return type; absent
|
|
124
|
+
* when `In` is `never`. The method reads the items through
|
|
125
|
+
* `RemoteInvocation.uplink()`, so nothing enters the parameter list.
|
|
126
|
+
*/
|
|
127
|
+
readonly uplink?: {
|
|
128
|
+
/** Codec validating every uplink item before `uplink()` delivers it. */
|
|
129
|
+
readonly codec: TypertCodec
|
|
130
|
+
}
|
|
108
131
|
/** Transport cancellation injected after business parameters instead of entering wire args. */
|
|
109
132
|
readonly cancellation?: {
|
|
110
133
|
/** Reserved final Host method parameter. */
|
|
@@ -117,6 +140,106 @@ interface InvocationDescriptor {
|
|
|
117
140
|
}
|
|
118
141
|
```
|
|
119
142
|
|
|
143
|
+
The Host alias `RemoteStream<Out, In>` names both directions of one stream, and the receiving method reads its call context as `this.ctx.invocation`:
|
|
144
|
+
|
|
145
|
+
```ts type-equiv
|
|
146
|
+
/**
|
|
147
|
+
* One Remote stream as a Host method returns it: the items it yields to the
|
|
148
|
+
* Client, iterated as a plain `AsyncIterable<Out>`. `In` is the type of the
|
|
149
|
+
* items the Client may send back on the same logical stream, read through
|
|
150
|
+
* `RemoteInvocation.uplink()`; it is carried only as a type-level marker. The
|
|
151
|
+
* default `never` declares a method that reads none, and its descriptor
|
|
152
|
+
* carries no uplink codec. A generated Client stream method returns the same
|
|
153
|
+
* stream as a `RemoteStreamHandle<Out, In>`.
|
|
154
|
+
* @template Out - item type the Host method yields.
|
|
155
|
+
* @template In - item type the Client may send; `never` when the method reads none.
|
|
156
|
+
*/
|
|
157
|
+
type RemoteStream<Out, In = never> = AsyncIterable<Out> & { readonly [STREAM_UPLINK]?: In }
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```ts type-equiv
|
|
161
|
+
/**
|
|
162
|
+
* One open Remote stream as the Client holds it: the downlink items as an
|
|
163
|
+
* `AsyncIterable`, plus the uplink and cancellation of the same logical
|
|
164
|
+
* stream. A generated Client stream method returns it, and calling that
|
|
165
|
+
* method opens the stream: a holder that neither iterates nor disposes the
|
|
166
|
+
* handle keeps the Host stream alive. A handle stands for one generation:
|
|
167
|
+
* when the carrier is lost, iteration fails with the carrier error and the
|
|
168
|
+
* handle is finished.
|
|
169
|
+
* @template Out - item type the Host method yields.
|
|
170
|
+
* @template In - item type the Client may send; `never` when the method reads none.
|
|
171
|
+
*/
|
|
172
|
+
interface RemoteStreamHandle<Out, In> extends AsyncIterable<Out> {
|
|
173
|
+
/**
|
|
174
|
+
* Send one uplink item. Items sent before the stream has opened are queued
|
|
175
|
+
* and sent once the `open` frame is on the wire. A top-level `undefined`
|
|
176
|
+
* travels as an `item` frame without `value`.
|
|
177
|
+
* @param item - item the Host validates against the method's uplink codec.
|
|
178
|
+
* @throws {Error} when the item is not a lossless JSON value, when `end()`
|
|
179
|
+
* was called, or once the stream has terminated.
|
|
180
|
+
*/
|
|
181
|
+
send(item: In): void
|
|
182
|
+
/** Half-close the uplink: the Host's `uplink()` iteration ends. Idempotent; ignored after termination. */
|
|
183
|
+
end(): void
|
|
184
|
+
/**
|
|
185
|
+
* Cancel the logical stream: send `cancel` unless a terminal frame has
|
|
186
|
+
* arrived, and end the downlink iterator quietly. Breaking out of
|
|
187
|
+
* `for await` early does the same.
|
|
188
|
+
*/
|
|
189
|
+
dispose(): void
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
```ts type-equiv
|
|
194
|
+
/**
|
|
195
|
+
* One Peer's session on this Host. Connection owns it: `ctx` is the Cordis
|
|
196
|
+
* scope that owns connection-lifetime registrations and is disposed with the
|
|
197
|
+
* Peer. Who the Peer is and what it may do are not recorded here.
|
|
198
|
+
*/
|
|
199
|
+
interface PeerScope {
|
|
200
|
+
readonly id: PeerId
|
|
201
|
+
readonly ctx: Context
|
|
202
|
+
/**
|
|
203
|
+
* Tear down every registration made through `ctx`.
|
|
204
|
+
* @returns settles once the scope has quiesced; racing calls share one completion.
|
|
205
|
+
*/
|
|
206
|
+
dispose(): Promise<void>
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```ts type-equiv
|
|
211
|
+
/**
|
|
212
|
+
* The context of one Remote call, reachable inside the receiving method as
|
|
213
|
+
* `this.ctx.invocation`. The Gateway derives the receiver from a Context that
|
|
214
|
+
* carries it, so no parameter is injected and nothing crosses the wire.
|
|
215
|
+
*/
|
|
216
|
+
interface RemoteInvocation {
|
|
217
|
+
readonly request: {
|
|
218
|
+
readonly namespace: string
|
|
219
|
+
readonly method: string
|
|
220
|
+
readonly args: Readonly<Record<string, unknown>>
|
|
221
|
+
}
|
|
222
|
+
/** Cordis service key of the receiving Service. */
|
|
223
|
+
readonly service: string
|
|
224
|
+
/** Peer the call speaks for; an in-process carrier speaks for the operator. */
|
|
225
|
+
readonly peer: PeerScope
|
|
226
|
+
/** Carrier cancellation: Client cancel, socket close, or an uplink failure. */
|
|
227
|
+
readonly signal: AbortSignal
|
|
228
|
+
/**
|
|
229
|
+
* The Client's uplink items for this call. Available once; a second call
|
|
230
|
+
* throws. With an uplink codec on the descriptor every item is decoded to
|
|
231
|
+
* `In`; without one items arrive as `unknown` after a JSON-safety check.
|
|
232
|
+
* Iteration ends when the Client ends its uplink; when the method finishes
|
|
233
|
+
* its downlink the Gateway calls the iterator's `return()` and unread items
|
|
234
|
+
* are dropped. `In` is the caller's assertion: the runtime decodes by the
|
|
235
|
+
* descriptor and does not cross-check it.
|
|
236
|
+
* @template In - item type the caller reads; the descriptor codec decides what arrives.
|
|
237
|
+
* @returns the single-consumer uplink iterable.
|
|
238
|
+
*/
|
|
239
|
+
uplink<In = unknown>(): AsyncIterable<In>
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
120
243
|
## Typert registry
|
|
121
244
|
|
|
122
245
|
`ctx.typert` separates current-environment descriptors, explicitly selected Remote contributions, lookup providers, and scoped Context providers. A lookup provider owns the stable wire declaration and default resolver; Host composition can configure an effect-scoped synchronous or asynchronous resolver for the same key, and unloading that configuration restores the default policy. Registrations are Cordis-owned effects and return awaitable disposers.
|
|
@@ -151,6 +274,13 @@ interface InvokeRemoteRequest {
|
|
|
151
274
|
readonly method: string
|
|
152
275
|
/** Named wire values; fields must exactly match the descriptor. */
|
|
153
276
|
readonly args: Readonly<Record<string, unknown>>
|
|
277
|
+
/**
|
|
278
|
+
* Client uplink items of this logical stream, delivered to the method through
|
|
279
|
+
* `invocation.uplink()`; absent means an immediately ended iterable.
|
|
280
|
+
*/
|
|
281
|
+
readonly uplink?: AsyncIterable<unknown>
|
|
282
|
+
/** Peer the call speaks for; absent means an in-process carrier, answered as the operator. */
|
|
283
|
+
readonly peer?: PeerScope
|
|
154
284
|
/** Carrier or direct-caller cancellation injected only into cancellation-aware methods. */
|
|
155
285
|
readonly signal?: AbortSignal
|
|
156
286
|
}
|
|
@@ -172,10 +302,12 @@ type TypertGatewayErrorCode =
|
|
|
172
302
|
| 'gateway/lookup-not-found'
|
|
173
303
|
| 'gateway/lookup-unavailable'
|
|
174
304
|
| 'gateway/method-unavailable'
|
|
305
|
+
| 'gateway/protocol'
|
|
175
306
|
| 'gateway/provider-mismatch'
|
|
176
307
|
| 'gateway/result-invalid'
|
|
177
308
|
| 'gateway/service-unavailable'
|
|
178
309
|
| 'gateway/signature-invalid'
|
|
310
|
+
| 'gateway/uplink-overflow'
|
|
179
311
|
```
|
|
180
312
|
|
|
181
313
|
```ts type-equiv
|
|
@@ -183,6 +315,11 @@ type TypertGatewayErrorCode =
|
|
|
183
315
|
interface TypertGateway {
|
|
184
316
|
/** Carrier adapter shared by WebSocket and in-process transports. */
|
|
185
317
|
readonly wireStream: TypertGatewayWireStream
|
|
318
|
+
/**
|
|
319
|
+
* Check for an active Client event stream.
|
|
320
|
+
* @returns whether a stream is open and has not been cancelled.
|
|
321
|
+
*/
|
|
322
|
+
hasLiveClient(): boolean
|
|
186
323
|
/**
|
|
187
324
|
* Register the application-selected forwarded-event source.
|
|
188
325
|
* @param source - stream factory installed by the Remote assembly.
|
|
@@ -202,7 +339,7 @@ interface TypertGateway {
|
|
|
202
339
|
invoke(request: InvokeRemoteRequest): Promise<unknown>
|
|
203
340
|
/**
|
|
204
341
|
* Open one live stream Remote method without assuming a physical carrier.
|
|
205
|
-
* @param request - decoded endpoint
|
|
342
|
+
* @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
|
|
206
343
|
* @returns a cancellation-aware iterable over the business results.
|
|
207
344
|
*/
|
|
208
345
|
stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
|
|
@@ -305,8 +442,6 @@ listPackages(filter: TypertPackageFilter = {}): TypertPackageRecord[]
|
|
|
305
442
|
toJSONSchema(key: string, params?: z.core.ToJSONSchemaParams): z.core.JSONSchema.BaseSchema
|
|
306
443
|
```
|
|
307
444
|
|
|
308
|
-
Types: [TypertContribution](invariants.md) · [TypertFace](invariants.md) · [TypertPackageFilter](invariants.md) · [TypertPackageRecord](invariants.md) · [TypertSchemaFilter](invariants.md) · [TypertSchemaRecord](invariants.md)
|
|
309
|
-
|
|
310
445
|
Source: [`packages/typert/registry/src/service.ts`](../../packages/typert/registry/src/service.ts)
|
|
311
446
|
|
|
312
447
|
<a id="ctxtypertgateway--typertgatewayservice"></a>
|
|
@@ -316,6 +451,12 @@ Source: [`packages/typert/registry/src/service.ts`](../../packages/typert/regist
|
|
|
316
451
|
Resolve strict generated definitions or conservative SRC markers against current Cordis Services and Typert providers.
|
|
317
452
|
|
|
318
453
|
```ts cordis-catalog
|
|
454
|
+
/**
|
|
455
|
+
* Check for an active Client event stream.
|
|
456
|
+
* @returns whether a stream is open and has not been cancelled.
|
|
457
|
+
*/
|
|
458
|
+
hasLiveClient(): boolean
|
|
459
|
+
|
|
319
460
|
/**
|
|
320
461
|
* Register the sole application-selected forwarded-event source.
|
|
321
462
|
* @param source - stream factory installed by the Remote assembly.
|
|
@@ -334,7 +475,7 @@ async invoke(request: InvokeRemoteRequest): Promise<unknown>
|
|
|
334
475
|
|
|
335
476
|
/**
|
|
336
477
|
* Open one live stream Remote method without assuming a physical carrier.
|
|
337
|
-
* @param request - decoded endpoint
|
|
478
|
+
* @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
|
|
338
479
|
* @returns a cancellation-aware iterable over the business results.
|
|
339
480
|
*/
|
|
340
481
|
async stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
|
|
@@ -38,7 +38,7 @@ interface TypertLookupDefinition {
|
|
|
38
38
|
|
|
39
39
|
## 调用 descriptor
|
|
40
40
|
|
|
41
|
-
`InvocationDescriptor` 是本地反射信息,不是 wire message。Host 与消费方构建会生成彼此对应的 descriptor;请求只发送 endpoint 与具名 `args`。strict codec 携带生成的 schema factory,SRC codec
|
|
41
|
+
`InvocationDescriptor` 是本地反射信息,不是 wire message。Host 与消费方构建会生成彼此对应的 descriptor;请求只发送 endpoint 与具名 `args`。strict codec 携带生成的 schema factory,SRC codec 则在不恢复结构类型的前提下强制要求输入为 JSON 安全值。一元结果 codec 可提供 `encode()` 处理含字节的子树,并通过 `decode()` 递归校验原生字节;Client 声明将每个 `Uint8Array` 限定为以 `ArrayBuffer` 为底层缓冲区。纯 JSON 结果无需字节识别或 Client 解码。取消通过带外 carrier signal 表达:它在业务参数之后注入,绝不进入 `args`。
|
|
42
42
|
|
|
43
43
|
```ts type-equiv
|
|
44
44
|
/** Codec attached to one invocation parameter or result. */
|
|
@@ -48,6 +48,19 @@ type TypertCodec =
|
|
|
48
48
|
readonly typeSymbol: string
|
|
49
49
|
/** Materialize and return the process-realm schema on first boundary use. */
|
|
50
50
|
readonly create: () => TypertSchema
|
|
51
|
+
/**
|
|
52
|
+
* Decode a unary result whose fields require type-specific handling.
|
|
53
|
+
* @param value - result reconstructed by the RPC carrier.
|
|
54
|
+
* @returns the validated result, retaining native byte views.
|
|
55
|
+
*/
|
|
56
|
+
readonly decode?: (value: unknown) => unknown
|
|
57
|
+
/**
|
|
58
|
+
* Project typed binary fields into RPC result attachments.
|
|
59
|
+
* @param value - native unary result.
|
|
60
|
+
* @param writeBytes - records a byte view at its result-relative path and returns its JSON placeholder.
|
|
61
|
+
* @returns JSON metadata with untouched JSON subtrees retained.
|
|
62
|
+
*/
|
|
63
|
+
readonly encode?: (value: unknown, writeBytes: (bytes: Uint8Array, path: readonly (string | number)[]) => null) => unknown
|
|
51
64
|
}
|
|
52
65
|
| {
|
|
53
66
|
readonly mode: 'src-json'
|
|
@@ -85,7 +98,7 @@ interface InvocationDescriptor {
|
|
|
85
98
|
readonly method: string
|
|
86
99
|
/** Service member invoked when the exported method name is an alias. */
|
|
87
100
|
readonly implementation?: string
|
|
88
|
-
/** Absent for unary calls; stream calls
|
|
101
|
+
/** Absent for unary calls; stream calls deliver every yielded item as the Host produced it. */
|
|
89
102
|
readonly mode?: 'stream'
|
|
90
103
|
/** Receiver selection mode. */
|
|
91
104
|
readonly invocation:
|
|
@@ -105,6 +118,16 @@ interface InvocationDescriptor {
|
|
|
105
118
|
}
|
|
106
119
|
/** Ordered business parameters. */
|
|
107
120
|
readonly parameters: readonly InvocationParameterDescriptor[]
|
|
121
|
+
/**
|
|
122
|
+
* Client-to-Host items of the same logical stream, generated from the `In`
|
|
123
|
+
* type argument of the method's `RemoteStream<Out, In>` return type; absent
|
|
124
|
+
* when `In` is `never`. The method reads the items through
|
|
125
|
+
* `RemoteInvocation.uplink()`, so nothing enters the parameter list.
|
|
126
|
+
*/
|
|
127
|
+
readonly uplink?: {
|
|
128
|
+
/** Codec validating every uplink item before `uplink()` delivers it. */
|
|
129
|
+
readonly codec: TypertCodec
|
|
130
|
+
}
|
|
108
131
|
/** Transport cancellation injected after business parameters instead of entering wire args. */
|
|
109
132
|
readonly cancellation?: {
|
|
110
133
|
/** Reserved final Host method parameter. */
|
|
@@ -117,6 +140,106 @@ interface InvocationDescriptor {
|
|
|
117
140
|
}
|
|
118
141
|
```
|
|
119
142
|
|
|
143
|
+
Host 别名 `RemoteStream<Out, In>` 同时命名一条流的两个方向,接收方法通过 `this.ctx.invocation` 读取本次调用的上下文:
|
|
144
|
+
|
|
145
|
+
```ts type-equiv
|
|
146
|
+
/**
|
|
147
|
+
* One Remote stream as a Host method returns it: the items it yields to the
|
|
148
|
+
* Client, iterated as a plain `AsyncIterable<Out>`. `In` is the type of the
|
|
149
|
+
* items the Client may send back on the same logical stream, read through
|
|
150
|
+
* `RemoteInvocation.uplink()`; it is carried only as a type-level marker. The
|
|
151
|
+
* default `never` declares a method that reads none, and its descriptor
|
|
152
|
+
* carries no uplink codec. A generated Client stream method returns the same
|
|
153
|
+
* stream as a `RemoteStreamHandle<Out, In>`.
|
|
154
|
+
* @template Out - item type the Host method yields.
|
|
155
|
+
* @template In - item type the Client may send; `never` when the method reads none.
|
|
156
|
+
*/
|
|
157
|
+
type RemoteStream<Out, In = never> = AsyncIterable<Out> & { readonly [STREAM_UPLINK]?: In }
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```ts type-equiv
|
|
161
|
+
/**
|
|
162
|
+
* One open Remote stream as the Client holds it: the downlink items as an
|
|
163
|
+
* `AsyncIterable`, plus the uplink and cancellation of the same logical
|
|
164
|
+
* stream. A generated Client stream method returns it, and calling that
|
|
165
|
+
* method opens the stream: a holder that neither iterates nor disposes the
|
|
166
|
+
* handle keeps the Host stream alive. A handle stands for one generation:
|
|
167
|
+
* when the carrier is lost, iteration fails with the carrier error and the
|
|
168
|
+
* handle is finished.
|
|
169
|
+
* @template Out - item type the Host method yields.
|
|
170
|
+
* @template In - item type the Client may send; `never` when the method reads none.
|
|
171
|
+
*/
|
|
172
|
+
interface RemoteStreamHandle<Out, In> extends AsyncIterable<Out> {
|
|
173
|
+
/**
|
|
174
|
+
* Send one uplink item. Items sent before the stream has opened are queued
|
|
175
|
+
* and sent once the `open` frame is on the wire. A top-level `undefined`
|
|
176
|
+
* travels as an `item` frame without `value`.
|
|
177
|
+
* @param item - item the Host validates against the method's uplink codec.
|
|
178
|
+
* @throws {Error} when the item is not a lossless JSON value, when `end()`
|
|
179
|
+
* was called, or once the stream has terminated.
|
|
180
|
+
*/
|
|
181
|
+
send(item: In): void
|
|
182
|
+
/** Half-close the uplink: the Host's `uplink()` iteration ends. Idempotent; ignored after termination. */
|
|
183
|
+
end(): void
|
|
184
|
+
/**
|
|
185
|
+
* Cancel the logical stream: send `cancel` unless a terminal frame has
|
|
186
|
+
* arrived, and end the downlink iterator quietly. Breaking out of
|
|
187
|
+
* `for await` early does the same.
|
|
188
|
+
*/
|
|
189
|
+
dispose(): void
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
```ts type-equiv
|
|
194
|
+
/**
|
|
195
|
+
* One Peer's session on this Host. Connection owns it: `ctx` is the Cordis
|
|
196
|
+
* scope that owns connection-lifetime registrations and is disposed with the
|
|
197
|
+
* Peer. Who the Peer is and what it may do are not recorded here.
|
|
198
|
+
*/
|
|
199
|
+
interface PeerScope {
|
|
200
|
+
readonly id: PeerId
|
|
201
|
+
readonly ctx: Context
|
|
202
|
+
/**
|
|
203
|
+
* Tear down every registration made through `ctx`.
|
|
204
|
+
* @returns settles once the scope has quiesced; racing calls share one completion.
|
|
205
|
+
*/
|
|
206
|
+
dispose(): Promise<void>
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```ts type-equiv
|
|
211
|
+
/**
|
|
212
|
+
* The context of one Remote call, reachable inside the receiving method as
|
|
213
|
+
* `this.ctx.invocation`. The Gateway derives the receiver from a Context that
|
|
214
|
+
* carries it, so no parameter is injected and nothing crosses the wire.
|
|
215
|
+
*/
|
|
216
|
+
interface RemoteInvocation {
|
|
217
|
+
readonly request: {
|
|
218
|
+
readonly namespace: string
|
|
219
|
+
readonly method: string
|
|
220
|
+
readonly args: Readonly<Record<string, unknown>>
|
|
221
|
+
}
|
|
222
|
+
/** Cordis service key of the receiving Service. */
|
|
223
|
+
readonly service: string
|
|
224
|
+
/** Peer the call speaks for; an in-process carrier speaks for the operator. */
|
|
225
|
+
readonly peer: PeerScope
|
|
226
|
+
/** Carrier cancellation: Client cancel, socket close, or an uplink failure. */
|
|
227
|
+
readonly signal: AbortSignal
|
|
228
|
+
/**
|
|
229
|
+
* The Client's uplink items for this call. Available once; a second call
|
|
230
|
+
* throws. With an uplink codec on the descriptor every item is decoded to
|
|
231
|
+
* `In`; without one items arrive as `unknown` after a JSON-safety check.
|
|
232
|
+
* Iteration ends when the Client ends its uplink; when the method finishes
|
|
233
|
+
* its downlink the Gateway calls the iterator's `return()` and unread items
|
|
234
|
+
* are dropped. `In` is the caller's assertion: the runtime decodes by the
|
|
235
|
+
* descriptor and does not cross-check it.
|
|
236
|
+
* @template In - item type the caller reads; the descriptor codec decides what arrives.
|
|
237
|
+
* @returns the single-consumer uplink iterable.
|
|
238
|
+
*/
|
|
239
|
+
uplink<In = unknown>(): AsyncIterable<In>
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
120
243
|
## Typert 注册表
|
|
121
244
|
|
|
122
245
|
`ctx.typert` 分开保存当前环境的 descriptor、显式选择的 Remote contribution、lookup 提供方与作用域上下文提供方。lookup 提供方拥有稳定 wire 声明和默认 resolver;Host 组合可以为同一个 key 配置 effect-scoped 同步或异步 resolver,配置卸载后恢复默认策略。各项注册都是由 Cordis 持有的 effect,并返回可等待的 disposer。
|
|
@@ -151,6 +274,13 @@ interface InvokeRemoteRequest {
|
|
|
151
274
|
readonly method: string
|
|
152
275
|
/** Named wire values; fields must exactly match the descriptor. */
|
|
153
276
|
readonly args: Readonly<Record<string, unknown>>
|
|
277
|
+
/**
|
|
278
|
+
* Client uplink items of this logical stream, delivered to the method through
|
|
279
|
+
* `invocation.uplink()`; absent means an immediately ended iterable.
|
|
280
|
+
*/
|
|
281
|
+
readonly uplink?: AsyncIterable<unknown>
|
|
282
|
+
/** Peer the call speaks for; absent means an in-process carrier, answered as the operator. */
|
|
283
|
+
readonly peer?: PeerScope
|
|
154
284
|
/** Carrier or direct-caller cancellation injected only into cancellation-aware methods. */
|
|
155
285
|
readonly signal?: AbortSignal
|
|
156
286
|
}
|
|
@@ -172,10 +302,12 @@ type TypertGatewayErrorCode =
|
|
|
172
302
|
| 'gateway/lookup-not-found'
|
|
173
303
|
| 'gateway/lookup-unavailable'
|
|
174
304
|
| 'gateway/method-unavailable'
|
|
305
|
+
| 'gateway/protocol'
|
|
175
306
|
| 'gateway/provider-mismatch'
|
|
176
307
|
| 'gateway/result-invalid'
|
|
177
308
|
| 'gateway/service-unavailable'
|
|
178
309
|
| 'gateway/signature-invalid'
|
|
310
|
+
| 'gateway/uplink-overflow'
|
|
179
311
|
```
|
|
180
312
|
|
|
181
313
|
```ts type-equiv
|
|
@@ -183,6 +315,11 @@ type TypertGatewayErrorCode =
|
|
|
183
315
|
interface TypertGateway {
|
|
184
316
|
/** Carrier adapter shared by WebSocket and in-process transports. */
|
|
185
317
|
readonly wireStream: TypertGatewayWireStream
|
|
318
|
+
/**
|
|
319
|
+
* Check for an active Client event stream.
|
|
320
|
+
* @returns whether a stream is open and has not been cancelled.
|
|
321
|
+
*/
|
|
322
|
+
hasLiveClient(): boolean
|
|
186
323
|
/**
|
|
187
324
|
* Register the application-selected forwarded-event source.
|
|
188
325
|
* @param source - stream factory installed by the Remote assembly.
|
|
@@ -202,7 +339,7 @@ interface TypertGateway {
|
|
|
202
339
|
invoke(request: InvokeRemoteRequest): Promise<unknown>
|
|
203
340
|
/**
|
|
204
341
|
* Open one live stream Remote method without assuming a physical carrier.
|
|
205
|
-
* @param request - decoded endpoint
|
|
342
|
+
* @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
|
|
206
343
|
* @returns a cancellation-aware iterable over the business results.
|
|
207
344
|
*/
|
|
208
345
|
stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
|
|
@@ -305,8 +442,6 @@ listPackages(filter: TypertPackageFilter = {}): TypertPackageRecord[]
|
|
|
305
442
|
toJSONSchema(key: string, params?: z.core.ToJSONSchemaParams): z.core.JSONSchema.BaseSchema
|
|
306
443
|
```
|
|
307
444
|
|
|
308
|
-
Types: [TypertContribution](invariants.zh.md) · [TypertFace](invariants.zh.md) · [TypertPackageFilter](invariants.zh.md) · [TypertPackageRecord](invariants.zh.md) · [TypertSchemaFilter](invariants.zh.md) · [TypertSchemaRecord](invariants.zh.md)
|
|
309
|
-
|
|
310
445
|
Source: [`packages/typert/registry/src/service.ts`](../../packages/typert/registry/src/service.ts)
|
|
311
446
|
|
|
312
447
|
<a id="ctxtypertgateway--typertgatewayservice"></a>
|
|
@@ -316,6 +451,12 @@ Source: [`packages/typert/registry/src/service.ts`](../../packages/typert/regist
|
|
|
316
451
|
Resolve strict generated definitions or conservative SRC markers against current Cordis Services and Typert providers.
|
|
317
452
|
|
|
318
453
|
```ts cordis-catalog
|
|
454
|
+
/**
|
|
455
|
+
* Check for an active Client event stream.
|
|
456
|
+
* @returns whether a stream is open and has not been cancelled.
|
|
457
|
+
*/
|
|
458
|
+
hasLiveClient(): boolean
|
|
459
|
+
|
|
319
460
|
/**
|
|
320
461
|
* Register the sole application-selected forwarded-event source.
|
|
321
462
|
* @param source - stream factory installed by the Remote assembly.
|
|
@@ -334,7 +475,7 @@ async invoke(request: InvokeRemoteRequest): Promise<unknown>
|
|
|
334
475
|
|
|
335
476
|
/**
|
|
336
477
|
* Open one live stream Remote method without assuming a physical carrier.
|
|
337
|
-
* @param request - decoded endpoint
|
|
478
|
+
* @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
|
|
338
479
|
* @returns a cancellation-aware iterable over the business results.
|
|
339
480
|
*/
|
|
340
481
|
async stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
# Bilingual-pair consistency record (docs/i18n/README.md):
|
|
2
|
-
#
|
|
3
|
-
#
|
|
1
|
+
# Bilingual-pair consistency record for user-questions.md (docs/i18n/README.md): per heading
|
|
2
|
+
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
|
3
|
+
# After editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write docs/subsystems/user-questions.md
|
|
5
|
-
user-
|
|
6
|
-
|
|
5
|
+
/user-interaction:
|
|
6
|
+
en: bc5bf42af08a66aa
|
|
7
|
+
zh: a90222f49abd2d0c
|
|
8
|
+
/user-interaction/question-options:
|
|
9
|
+
en: 88cceb3cf383248e
|
|
10
|
+
zh: 8e1d2627823b1ffc
|
|
11
|
+
/user-interaction/presentation-intent:
|
|
12
|
+
en: aca3811ea3f0c2ef
|
|
13
|
+
zh: 6cf2aea40c7dece8
|
|
14
|
+
/user-interaction/question-item:
|
|
15
|
+
en: 1ad4373e6fdfe4c7
|
|
16
|
+
zh: efb8d41ebe7224f8
|
|
17
|
+
/user-interaction/ask-request:
|
|
18
|
+
en: e10cf6c8c9c20962
|
|
19
|
+
zh: 0b347b40c12b6b25
|
|
20
|
+
/user-interaction/answer:
|
|
21
|
+
en: efd2dbb95a885d0e
|
|
22
|
+
zh: 7a20c75c4ea6a9e0
|
|
23
|
+
/user-interaction/timed-questions-and-late-replies:
|
|
24
|
+
en: 74fa698d4a115e80
|
|
25
|
+
zh: 4e9b03b5eab2ae5e
|
|
26
|
+
/user-interaction/errors:
|
|
27
|
+
en: 5762b1498a426ab6
|
|
28
|
+
zh: bb9987ec82103620
|
|
@@ -103,9 +103,96 @@ interface AskUserQuestionAnswer {
|
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
Timed answerers receive `wait: { callId, timed: true }`. The call id identifies the card and the foreground wait. The Client calls `attachWait` to claim the wait and obtain its remaining duration; transport forwards the original event without inspecting or rewriting these fields. A `wait` without `timed` identifies an indefinite card-keyed request. An absent `wait` identifies a blocking request without a card key.
|
|
107
|
+
|
|
108
|
+
```ts type-equiv
|
|
109
|
+
/** Client-safe payload declared for the user-question answerer waterfall. */
|
|
110
|
+
interface AskUserQuestionRequestEvent {
|
|
111
|
+
/** Questions to display. */
|
|
112
|
+
questions: AskUserQuestionItem[]
|
|
113
|
+
/** Agent identity projected to the corresponding Client Context in transit. */
|
|
114
|
+
agent?: Agent
|
|
115
|
+
/** Cancellation lifetime of the pending request. */
|
|
116
|
+
signal?: AbortSignal
|
|
117
|
+
/**
|
|
118
|
+
* Tool call the Client card is keyed by. Timed answerers attach to the
|
|
119
|
+
* business wait stream before starting their local countdown.
|
|
120
|
+
*/
|
|
121
|
+
wait?: {
|
|
122
|
+
/** Tool call the Client card is keyed by. */
|
|
123
|
+
callId: ToolCallId
|
|
124
|
+
/** True for a foreground wait that requires a Client claim; absent for indefinite waits. */
|
|
125
|
+
timed?: boolean
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Timed questions and late replies
|
|
131
|
+
|
|
132
|
+
A timed question waits for a bounded foreground window and then lets the agent continue independent work. If the user answers inside the window, the tool returns the answer batch; otherwise `TimedUserQuestionResult` is `{ pending: true, callId }`. Pending means the question is still answerable; it is not an empty answer, a refusal, a confirmation, or permission.
|
|
133
|
+
|
|
134
|
+
```ts type-equiv
|
|
135
|
+
/** Timed ask result returned when the foreground answer window closes. */
|
|
136
|
+
type TimedUserQuestionResult = AskUserQuestionAnswer | { pending: true; callId: ToolCallId }
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
A Client claim is a business Remote stream, not a Gateway delivery. `TimedQuestionWait` holds the original Host deadline and runs its timer only while no claim exists. Its `attachWait` stream yields the current remaining duration, and the Client counts down with its own clock. Focus, editing, and Take time stay local. Stream cancellation releases that claim; after the last claim leaves, the Host resumes the original deadline. An unattended timeout aborts the foreground waterfall's private signal and returns pending without cancelling the Turn. Gateway and `api-remotes` contain no question-specific timing policy.
|
|
140
|
+
|
|
141
|
+
The `userQuestions` Session projection folds existing events into the answerable question set and the settled one; no wait state, focus state, or deadline is logged. Each `request/header` records the exact tool schemas the model saw. Native calls are tracked only when that header declares the timed `ask_user_question` schema with a `timeout` parameter; the blocking legacy tool never declares it. A native `tool/call` opens a question. A `tool/result` marks it `continued` only when it carries the pending payload or is the synthetic `TOOL_OUTCOME_UNKNOWN` result Session resume repair appends; an answer batch moves it into `settled` with that batch, and any failure drops it. A `run_code` PTC sub-call enters the projection when its `tool/ptc-dispatch` result is pending, even though the request header exposes only `run_code`. A late reply moves a continued question into `settled` when its message is admitted as `user/message`, together with the answer batch read out of that message: the timed call's own result recorded the timeout, so a transcript row has nowhere else to read what the user finally chose. A queued reply can be canceled before admission and leaves the question answerable. A reply whose text carries no readable batch settles the call with no answers; one naming a call that is not active changes nothing.
|
|
142
|
+
|
|
143
|
+
```ts type-equiv
|
|
144
|
+
/** `open` while the tool call may still return the answer; `continued` once the answer can only arrive as a new turn. */
|
|
145
|
+
type UserQuestionState = 'open' | 'continued'
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
```ts type-equiv
|
|
149
|
+
/** One unanswered timed `ask_user_question` call reconstructed from the Session log. */
|
|
150
|
+
interface PendingUserQuestion {
|
|
151
|
+
readonly callId: ToolCallId
|
|
152
|
+
readonly questions: readonly AskUserQuestionItem[]
|
|
153
|
+
readonly state: UserQuestionState
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```ts type-equiv
|
|
158
|
+
/**
|
|
159
|
+
* One timed `ask_user_question` call and the answers it settled with: the
|
|
160
|
+
* batch its own result carried when the user answered inside the window,
|
|
161
|
+
* otherwise the batch its late reply carried, because that call's own result
|
|
162
|
+
* recorded the timeout. A transcript row reads what the user finally answered
|
|
163
|
+
* from here, and only a call listed here was a timed one.
|
|
164
|
+
*/
|
|
165
|
+
interface SettledUserQuestion {
|
|
166
|
+
/** The settled call. */
|
|
167
|
+
readonly callId: ToolCallId
|
|
168
|
+
/** The recorded batch, one entry per question; empty when the late reply carried none. */
|
|
169
|
+
readonly answers: readonly AskUserQuestionAnswerItem[]
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
```ts type-equiv
|
|
174
|
+
/**
|
|
175
|
+
* Both halves of one Session's timed `ask_user_question` state, as every
|
|
176
|
+
* Client reads them. A call made while the blocking legacy tool was in
|
|
177
|
+
* effect appears in neither half.
|
|
178
|
+
*/
|
|
179
|
+
interface UserQuestionProjectionView {
|
|
180
|
+
/** Calls that can still take an answer, in ask order. */
|
|
181
|
+
readonly active: readonly PendingUserQuestion[]
|
|
182
|
+
/** Calls an answer settled, in settlement order. */
|
|
183
|
+
readonly settled: readonly SettledUserQuestion[]
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
An open question accepts answers only through the waterfall. Once it is `continued`, the `answer` Remote method queues a user message for the owning agent and wakes it if idle. The message has source `user-question-reply`, outcome `answered`, and an `answer_to_pending_question` payload. The method returns `false` for an open or unknown call, rejects a second queued reply with `REPLY_QUEUED` even after a Host restart, and rejects incomplete or duplicate answer batches with `BAD_ANSWER`.
|
|
188
|
+
|
|
189
|
+
Closing the Client panel sends nothing. A foreground timeout ends only the tool wait. Continued questions have no deadline; they stay answerable until a reply is admitted.
|
|
190
|
+
|
|
191
|
+
After a Host restart, the Remote layer resumes the root agent when the Session reopens. A late reply then enters a new turn.
|
|
192
|
+
|
|
106
193
|
## Errors
|
|
107
194
|
|
|
108
|
-
`UserQuestionError` extends `HarnessError`, so `ctx.tools.execute()` preserves `{ name, code }` for model-facing tool failures such as `EMPTY_QUESTIONS`, `NO_PROVIDER`, `ASK_ABORTED`, or UI-side cancellation.
|
|
195
|
+
`UserQuestionError` extends `HarnessError`, so `ctx.tools.execute()` preserves `{ name, code }` for model-facing tool failures such as `EMPTY_QUESTIONS`, `BAD_INTENT`, `NO_PROVIDER`, `ASK_ABORTED`, or UI-side cancellation.
|
|
109
196
|
|
|
110
197
|
```ts type-equiv
|
|
111
198
|
/** Stable error taxonomy for user-questions failures. */
|
|
@@ -132,6 +219,44 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
|
|
|
132
219
|
`ctx.userQuestions`: validation plus the scoped answerer waterfall.
|
|
133
220
|
|
|
134
221
|
```ts cordis-catalog
|
|
222
|
+
/**
|
|
223
|
+
* Answer a continued question. The reply is steered into the agent as a
|
|
224
|
+
* user message whose source names the call; that message is also the
|
|
225
|
+
* record that closes the question in the projection.
|
|
226
|
+
* @param agent - Live root agent for the owning Session.
|
|
227
|
+
* @param callId - Continued question identity.
|
|
228
|
+
* @param answer - Complete structured answer batch, one item per question of the call.
|
|
229
|
+
* @returns Whether the question is still continued; an accepted reply stays
|
|
230
|
+
* queued until the agent admits its user message.
|
|
231
|
+
* @throws {UserQuestionError} `BAD_ANSWER` when the batch does not name each
|
|
232
|
+
* question of the call exactly once, or `REPLY_QUEUED` when a reply is
|
|
233
|
+
* already waiting for admission.
|
|
234
|
+
*/
|
|
235
|
+
@Remote answer(agent: Agent, callId: ToolCallId, answer: AskUserQuestionAnswer): boolean
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Let one answer UI hold a live timed wait. Closing the stream releases its claim.
|
|
239
|
+
* @param agent - Live root agent owning the question.
|
|
240
|
+
* @param callId - Foreground tool call to attach to.
|
|
241
|
+
* @param signal - Remote stream cancellation, including Client disconnect.
|
|
242
|
+
* @returns One Host-computed remaining duration, or no frames once the wait ended.
|
|
243
|
+
*/
|
|
244
|
+
@Remote({ mode: 'stream' }) async *attachWait(agent: Agent, callId: ToolCallId, signal: AbortSignal): AsyncIterable<{ remainingMs: number }>
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Foreground wait whose first settlement the Client decides: the Client
|
|
248
|
+
* rejects with `ASK_TIMED_OUT` when its countdown ends, and this method maps
|
|
249
|
+
* that code to the pending result.
|
|
250
|
+
* @param request - Questions, live owner agent, and abort signal.
|
|
251
|
+
* @param callId - Tool call identity the Client card is keyed by.
|
|
252
|
+
* @param timeoutMs - Positive foreground wait in milliseconds.
|
|
253
|
+
* @returns The answer when it arrives inside the window, otherwise a pending
|
|
254
|
+
* result, also when no connected Client claimed the request by the deadline.
|
|
255
|
+
* @throws {UserQuestionError} `BAD_TIMEOUT` for a non-integer, non-positive,
|
|
256
|
+
* or oversized wait.
|
|
257
|
+
*/
|
|
258
|
+
async askTimed( request: AskUserQuestionRequest & { agent: Agent }, callId: ToolCallId, timeoutMs: number, ): Promise<TimedUserQuestionResult>
|
|
259
|
+
|
|
135
260
|
/**
|
|
136
261
|
* Ask the scoped answerer waterfall and wait for the user's answer.
|
|
137
262
|
*
|
|
@@ -151,6 +276,8 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
|
|
|
151
276
|
async ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
|
|
152
277
|
```
|
|
153
278
|
|
|
279
|
+
Types: [Agent](core.md) · [ToolCallId](core.md)
|
|
280
|
+
|
|
154
281
|
Source: [`packages/interaction/user-questions/src/index.ts`](../../packages/interaction/user-questions/src/index.ts)
|
|
155
282
|
|
|
156
283
|
<a id="user-questions-events"></a>
|