better-dsh 0.2.3-e → 0.2.3-g

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.
Files changed (270) hide show
  1. package/docs/50_test-reports/2026-09-13-preact-ui-shell/345/256/236/346/265/213/346/212/245/345/221/212.md +1 -1
  2. package/docs/50_test-reports/2026-09-14-4999-skill/346/270/205/345/215/225/344/270/216lsp-gate/345/256/236/346/265/213/346/212/245/345/221/212.md +54 -0
  3. package/docs/specs/agent/spec.md +54 -0
  4. package/docs/specs/ast/spec.md +34 -0
  5. package/docs/specs/compaction-recall/spec.md +46 -0
  6. package/docs/specs/ctx/spec.md +107 -0
  7. package/docs/specs/dsh/spec.md +47 -0
  8. package/docs/specs/dvc/spec.md +87 -0
  9. package/docs/specs/escalation-guidance/spec.md +44 -0
  10. package/docs/specs/fs-scheme-resolution/spec.md +37 -0
  11. package/docs/specs/hash-edit/spec.md +41 -0
  12. package/docs/specs/http-read/spec.md +73 -0
  13. package/docs/specs/kernel-provisioning/spec.md +53 -0
  14. package/docs/specs/lsp/spec.md +121 -0
  15. package/docs/specs/mobile-layout/spec.md +108 -0
  16. package/docs/specs/model-failover/spec.md +20 -0
  17. package/docs/specs/preact-ui-shell/spec.md +22 -0
  18. package/docs/specs/repl-dispatch-resilience/spec.md +21 -0
  19. package/docs/specs/skill/spec.md +58 -0
  20. package/docs/specs/tool-surface/spec.md +222 -0
  21. package/docs/specs/url-schema/spec.md +148 -0
  22. package/docs/specs/web-trust-fence/spec.md +43 -0
  23. package/dsh-docs/AGENTS.md +75 -0
  24. package/dsh-docs/agent-lifecycle.md +84 -0
  25. package/dsh-docs/agent-lifecycle.zh.md +86 -0
  26. package/dsh-docs/api-gateway.md +164 -0
  27. package/dsh-docs/api-gateway.zh.md +164 -0
  28. package/dsh-docs/architecture.md +150 -0
  29. package/dsh-docs/architecture.zh.md +154 -0
  30. package/dsh-docs/capability-seams.md +543 -0
  31. package/dsh-docs/capability-seams.zh.md +545 -0
  32. package/dsh-docs/config-catalog.md +3473 -0
  33. package/dsh-docs/config-catalog.zh.md +3474 -0
  34. package/dsh-docs/cookbook/adding-a-package.md +117 -0
  35. package/dsh-docs/cookbook/adding-a-package.zh.md +119 -0
  36. package/dsh-docs/cookbook/adding-a-remote-api.md +197 -0
  37. package/dsh-docs/cookbook/adding-a-remote-api.zh.md +197 -0
  38. package/dsh-docs/cookbook/adding-a-settings-card.md +102 -0
  39. package/dsh-docs/cookbook/adding-a-settings-card.zh.md +102 -0
  40. package/dsh-docs/cookbook/adding-a-tool.md +101 -0
  41. package/dsh-docs/cookbook/adding-a-tool.zh.md +103 -0
  42. package/dsh-docs/cookbook/adding-a-vendored-package.md +59 -0
  43. package/dsh-docs/cookbook/adding-a-vendored-package.zh.md +59 -0
  44. package/dsh-docs/cookbook/adding-an-llm-adapter.md +43 -0
  45. package/dsh-docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
  46. package/dsh-docs/cookbook/extension-cookbook.md +132 -0
  47. package/dsh-docs/cookbook/extension-cookbook.zh.md +136 -0
  48. package/dsh-docs/cookbook/maintaining-dsh-code-review.md +64 -0
  49. package/dsh-docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  50. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  51. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  52. package/dsh-docs/cordis-api/context.md +364 -0
  53. package/dsh-docs/cordis-api/context.zh.md +366 -0
  54. package/dsh-docs/cordis-api/events.md +207 -0
  55. package/dsh-docs/cordis-api/events.zh.md +209 -0
  56. package/dsh-docs/cordis-api/fiber.md +375 -0
  57. package/dsh-docs/cordis-api/fiber.zh.md +377 -0
  58. package/dsh-docs/cordis-api/inherited.md +39 -0
  59. package/dsh-docs/cordis-api/registry.md +152 -0
  60. package/dsh-docs/cordis-api/registry.zh.md +154 -0
  61. package/dsh-docs/cordis-api/service.md +102 -0
  62. package/dsh-docs/cordis-api/service.zh.md +104 -0
  63. package/dsh-docs/cordis-primer.md +45 -0
  64. package/dsh-docs/cordis-primer.zh.md +51 -0
  65. package/dsh-docs/cordis-tutorial/01-first-plugin.md +95 -0
  66. package/dsh-docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
  67. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  68. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  69. package/dsh-docs/cordis-tutorial/03-services.md +98 -0
  70. package/dsh-docs/cordis-tutorial/03-services.zh.md +98 -0
  71. package/dsh-docs/cordis-tutorial/04-events.md +144 -0
  72. package/dsh-docs/cordis-tutorial/04-events.zh.md +144 -0
  73. package/dsh-docs/cordis-tutorial/05-config.md +84 -0
  74. package/dsh-docs/cordis-tutorial/05-config.zh.md +84 -0
  75. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
  76. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  77. package/dsh-docs/cordis-tutorial/07-into-the-harness.md +108 -0
  78. package/dsh-docs/cordis-tutorial/07-into-the-harness.zh.md +108 -0
  79. package/dsh-docs/cordis-tutorial/index.md +60 -0
  80. package/dsh-docs/cordis-tutorial/index.zh.md +62 -0
  81. package/dsh-docs/deepseek-llm-api-wire-extensions.md +163 -0
  82. package/dsh-docs/deepseek-llm-api-wire-extensions.zh.md +163 -0
  83. package/dsh-docs/defensive-patterns.md +33 -0
  84. package/dsh-docs/defensive-patterns.zh.md +35 -0
  85. package/dsh-docs/development.md +167 -0
  86. package/dsh-docs/development.zh.md +173 -0
  87. package/dsh-docs/event-producer-consumer.md +86 -0
  88. package/dsh-docs/event-producer-consumer.zh.md +88 -0
  89. package/dsh-docs/glossary.md +45 -0
  90. package/dsh-docs/glossary.zh.md +45 -0
  91. package/dsh-docs/graph-atlas.md +22 -0
  92. package/dsh-docs/graph-atlas.zh.md +24 -0
  93. package/dsh-docs/i18n/README.md +60 -0
  94. package/dsh-docs/i18n/README.zh.md +62 -0
  95. package/dsh-docs/i18n/style-samples.md +87 -0
  96. package/dsh-docs/i18n/terminology.md +214 -0
  97. package/dsh-docs/i18n/translation-prompt.md +263 -0
  98. package/dsh-docs/i18n/translation-rules.md +69 -0
  99. package/dsh-docs/i18n/translation-rules.zh.md +69 -0
  100. package/dsh-docs/module-graph.md +1411 -0
  101. package/dsh-docs/module-graph.zh.md +1413 -0
  102. package/dsh-docs/persistence-catalog.md +1075 -0
  103. package/dsh-docs/persistence-catalog.zh.md +1077 -0
  104. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  105. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  106. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  107. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  108. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  109. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  110. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  111. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  112. package/dsh-docs/postmortem/README.md +18 -0
  113. package/dsh-docs/postmortem/README.zh.md +18 -0
  114. package/dsh-docs/rescope.md +53 -0
  115. package/dsh-docs/rescope.zh.md +53 -0
  116. package/dsh-docs/subsystems/README.md +61 -0
  117. package/dsh-docs/subsystems/README.zh.md +61 -0
  118. package/dsh-docs/subsystems/agent-team.md +207 -0
  119. package/dsh-docs/subsystems/agent-team.zh.md +207 -0
  120. package/dsh-docs/subsystems/approval.md +170 -0
  121. package/dsh-docs/subsystems/approval.zh.md +170 -0
  122. package/dsh-docs/subsystems/attachment.md +351 -0
  123. package/dsh-docs/subsystems/attachment.zh.md +351 -0
  124. package/dsh-docs/subsystems/client-modules.md +168 -0
  125. package/dsh-docs/subsystems/client-modules.zh.md +168 -0
  126. package/dsh-docs/subsystems/code-runtime.md +195 -0
  127. package/dsh-docs/subsystems/code-runtime.zh.md +195 -0
  128. package/dsh-docs/subsystems/commands.md +219 -0
  129. package/dsh-docs/subsystems/commands.zh.md +219 -0
  130. package/dsh-docs/subsystems/compaction.md +238 -0
  131. package/dsh-docs/subsystems/compaction.zh.md +238 -0
  132. package/dsh-docs/subsystems/conversation.md +258 -0
  133. package/dsh-docs/subsystems/conversation.zh.md +258 -0
  134. package/dsh-docs/subsystems/core.md +1209 -0
  135. package/dsh-docs/subsystems/core.zh.md +1219 -0
  136. package/dsh-docs/subsystems/credentials.md +329 -0
  137. package/dsh-docs/subsystems/credentials.zh.md +329 -0
  138. package/dsh-docs/subsystems/extensions.md +382 -0
  139. package/dsh-docs/subsystems/extensions.zh.md +382 -0
  140. package/dsh-docs/subsystems/feedback.md +266 -0
  141. package/dsh-docs/subsystems/feedback.zh.md +266 -0
  142. package/dsh-docs/subsystems/filesystem.md +505 -0
  143. package/dsh-docs/subsystems/filesystem.zh.md +505 -0
  144. package/dsh-docs/subsystems/goal.md +277 -0
  145. package/dsh-docs/subsystems/goal.zh.md +277 -0
  146. package/dsh-docs/subsystems/invariants.md +88 -0
  147. package/dsh-docs/subsystems/invariants.zh.md +88 -0
  148. package/dsh-docs/subsystems/jobs.md +290 -0
  149. package/dsh-docs/subsystems/jobs.zh.md +290 -0
  150. package/dsh-docs/subsystems/llm-streaming.md +1080 -0
  151. package/dsh-docs/subsystems/llm-streaming.zh.md +1086 -0
  152. package/dsh-docs/subsystems/lsp.md +202 -0
  153. package/dsh-docs/subsystems/lsp.zh.md +202 -0
  154. package/dsh-docs/subsystems/permission-presets.md +131 -0
  155. package/dsh-docs/subsystems/permission-presets.zh.md +131 -0
  156. package/dsh-docs/subsystems/persistence.md +395 -0
  157. package/dsh-docs/subsystems/persistence.zh.md +395 -0
  158. package/dsh-docs/subsystems/plan.md +87 -0
  159. package/dsh-docs/subsystems/plan.zh.md +87 -0
  160. package/dsh-docs/subsystems/sandbox.md +220 -0
  161. package/dsh-docs/subsystems/sandbox.zh.md +220 -0
  162. package/dsh-docs/subsystems/schedule.md +192 -0
  163. package/dsh-docs/subsystems/schedule.zh.md +192 -0
  164. package/dsh-docs/subsystems/scope.md +59 -0
  165. package/dsh-docs/subsystems/scope.zh.md +59 -0
  166. package/dsh-docs/subsystems/session-projection.md +354 -0
  167. package/dsh-docs/subsystems/session-projection.zh.md +354 -0
  168. package/dsh-docs/subsystems/session-query.md +509 -0
  169. package/dsh-docs/subsystems/session-query.zh.md +509 -0
  170. package/dsh-docs/subsystems/session-reference.md +219 -0
  171. package/dsh-docs/subsystems/session-reference.zh.md +219 -0
  172. package/dsh-docs/subsystems/session-telemetry.md +194 -0
  173. package/dsh-docs/subsystems/session-telemetry.zh.md +194 -0
  174. package/dsh-docs/subsystems/session-title.md +204 -0
  175. package/dsh-docs/subsystems/session-title.zh.md +204 -0
  176. package/dsh-docs/subsystems/session.md +1155 -0
  177. package/dsh-docs/subsystems/session.zh.md +1159 -0
  178. package/dsh-docs/subsystems/settings.md +405 -0
  179. package/dsh-docs/subsystems/settings.zh.md +405 -0
  180. package/dsh-docs/subsystems/shell.md +303 -0
  181. package/dsh-docs/subsystems/shell.zh.md +303 -0
  182. package/dsh-docs/subsystems/skills.md +354 -0
  183. package/dsh-docs/subsystems/skills.zh.md +354 -0
  184. package/dsh-docs/subsystems/slots.md +175 -0
  185. package/dsh-docs/subsystems/slots.zh.md +175 -0
  186. package/dsh-docs/subsystems/spill.md +117 -0
  187. package/dsh-docs/subsystems/spill.zh.md +117 -0
  188. package/dsh-docs/subsystems/storage.md +260 -0
  189. package/dsh-docs/subsystems/storage.zh.md +260 -0
  190. package/dsh-docs/subsystems/subagent.md +766 -0
  191. package/dsh-docs/subsystems/subagent.zh.md +770 -0
  192. package/dsh-docs/subsystems/subprocess.md +324 -0
  193. package/dsh-docs/subsystems/subprocess.zh.md +324 -0
  194. package/dsh-docs/subsystems/system-prompt.md +220 -0
  195. package/dsh-docs/subsystems/system-prompt.zh.md +220 -0
  196. package/dsh-docs/subsystems/terminal.md +184 -0
  197. package/dsh-docs/subsystems/terminal.zh.md +184 -0
  198. package/dsh-docs/subsystems/todo.md +32 -0
  199. package/dsh-docs/subsystems/todo.zh.md +32 -0
  200. package/dsh-docs/subsystems/token-meter.md +105 -0
  201. package/dsh-docs/subsystems/token-meter.zh.md +105 -0
  202. package/dsh-docs/subsystems/tools.md +720 -0
  203. package/dsh-docs/subsystems/tools.zh.md +720 -0
  204. package/dsh-docs/subsystems/typert.md +343 -0
  205. package/dsh-docs/subsystems/typert.zh.md +343 -0
  206. package/dsh-docs/subsystems/user-questions.md +178 -0
  207. package/dsh-docs/subsystems/user-questions.zh.md +178 -0
  208. package/dsh-docs/subsystems/web-client.md +95 -0
  209. package/dsh-docs/subsystems/web-client.zh.md +95 -0
  210. package/dsh-docs/subsystems/web-server.md +154 -0
  211. package/dsh-docs/subsystems/web-server.zh.md +154 -0
  212. package/dsh-docs/subsystems/web.md +206 -0
  213. package/dsh-docs/subsystems/web.zh.md +206 -0
  214. package/dsh-docs/subsystems/webhook.md +70 -0
  215. package/dsh-docs/subsystems/webhook.zh.md +70 -0
  216. package/dsh-docs/subsystems/workflow.md +278 -0
  217. package/dsh-docs/subsystems/workflow.zh.md +278 -0
  218. package/dsh-docs/subsystems/workspace.md +321 -0
  219. package/dsh-docs/subsystems/workspace.zh.md +321 -0
  220. package/dsh-docs/testing.md +54 -0
  221. package/dsh-docs/testing.zh.md +54 -0
  222. package/dsh-docs/tool-catalog.md +2225 -0
  223. package/dsh-docs/tool-catalog.zh.md +2233 -0
  224. package/dsh-docs/tool-execution-pipeline.md +62 -0
  225. package/dsh-docs/tool-execution-pipeline.zh.md +64 -0
  226. package/dsh-docs/user/develop/basic/config.md +106 -0
  227. package/dsh-docs/user/develop/basic/config.zh.md +106 -0
  228. package/dsh-docs/user/develop/basic/index.md +144 -0
  229. package/dsh-docs/user/develop/basic/index.zh.md +144 -0
  230. package/dsh-docs/user/develop/basic/publish.md +183 -0
  231. package/dsh-docs/user/develop/basic/publish.zh.md +183 -0
  232. package/dsh-docs/user/develop/basic/tool.md +52 -0
  233. package/dsh-docs/user/develop/basic/tool.zh.md +52 -0
  234. package/dsh-docs/user/develop/framework/events.md +143 -0
  235. package/dsh-docs/user/develop/framework/events.zh.md +143 -0
  236. package/dsh-docs/user/develop/framework/index.md +137 -0
  237. package/dsh-docs/user/develop/framework/index.zh.md +137 -0
  238. package/dsh-docs/user/develop/framework/service.md +148 -0
  239. package/dsh-docs/user/develop/framework/service.zh.md +150 -0
  240. package/dsh-docs/user/develop/practice/dynamic-cordis.md +15 -0
  241. package/dsh-docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
  242. package/dsh-docs/user/develop/practice/index.md +155 -0
  243. package/dsh-docs/user/develop/practice/index.zh.md +155 -0
  244. package/dsh-docs/user/develop/practice/llm-adapter.md +189 -0
  245. package/dsh-docs/user/develop/practice/llm-adapter.zh.md +189 -0
  246. package/dsh-docs/user/guide/github-review.md +102 -0
  247. package/dsh-docs/user/guide/github-review.zh.md +102 -0
  248. package/dsh-docs/user/guide/index.md +30 -0
  249. package/dsh-docs/user/guide/index.zh.md +30 -0
  250. package/dsh-docs/user/guide/mcp-memory.md +101 -0
  251. package/dsh-docs/user/guide/mcp-memory.zh.md +101 -0
  252. package/dsh-docs/user/guide/network-proxy.md +85 -0
  253. package/dsh-docs/user/guide/network-proxy.zh.md +85 -0
  254. package/dsh-docs/user/guide/providers.md +190 -0
  255. package/dsh-docs/user/guide/providers.zh.md +190 -0
  256. package/dsh-docs/user/guide/python-sdk.md +150 -0
  257. package/dsh-docs/user/guide/python-sdk.zh.md +150 -0
  258. package/dsh-docs/user/guide/schedule.md +21 -0
  259. package/dsh-docs/user/guide/schedule.zh.md +21 -0
  260. package/dsh-docs/user/index.md +11 -0
  261. package/dsh-docs/user/index.zh.md +11 -0
  262. package/dsh-docs/web-styling.md +29 -0
  263. package/dsh-docs/web-styling.zh.md +29 -0
  264. package/lib/client/index.js +268 -38
  265. package/lib/fs-aware/sandbox-plugin.js +1 -1
  266. package/lib/index.js +1112 -1261
  267. package/lib/lsp-server-registry-B8DNonhS.js +3 -0
  268. package/lib/lsp-server-registry-BexQagaK.js +943 -0
  269. package/lib/{wrap-DC8O3SYz.js → wrap-JFjcWwZf.js} +42 -16
  270. package/package.json +2 -1
@@ -0,0 +1,343 @@
1
+ # Typert remote calls
2
+
3
+ English | [中文](typert.zh.md)
4
+
5
+ Types shared by generated Remote artifacts, the Host Gateway, and consumer API assemblies. The [Typert Gateway Agent Note](../../.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.md) owns the architecture and transport decisions; this page records the literal public contracts from [`dsh-typert-protocol`](../../packages/typert/protocol/src/types.ts) and [`dsh-api-gateway`](../../packages/api/gateway/src/types.ts).
6
+
7
+ ## Lookup and Context declarations
8
+
9
+ Business-object packages extend two empty maps through declaration merging. A lookup associates one Host object type with its wire identity; a Context declaration associates one scoped Context kind with its wire identity. Generated descriptors name these keys, while runtime providers supply the live resolution behavior.
10
+
11
+ ```ts type-equiv
12
+ /** Merge-extensible Host object lookup declarations. */
13
+ interface TypertLookupMap {}
14
+ ```
15
+
16
+ ```ts type-equiv
17
+ /** Merge-extensible scoped Context declarations. */
18
+ interface TypertContextMap {}
19
+ ```
20
+
21
+ The registry retains a lookup's wire declaration after its resolver unloads. SRC discovery therefore continues to classify the parameter as a lookup and fails unavailable instead of accepting the wire value as an ordinary business object.
22
+
23
+ ```ts type-equiv
24
+ /** Stable wire declaration retained after a lookup provider unloads. */
25
+ interface TypertLookupDefinition {
26
+ /** Merge-declared lookup key. */
27
+ readonly key: string
28
+ /** Source parameter name recognized by the SRC weak parser. */
29
+ readonly parameter: string
30
+ /** Wire field replacing the Host object parameter. */
31
+ readonly wire: string
32
+ /** Canonical Host type symbol used by strict generation. */
33
+ readonly hostTypeSymbol: string
34
+ /** Canonical wire type symbol used by strict generation. */
35
+ readonly wireTypeSymbol: string
36
+ }
37
+ ```
38
+
39
+ ## Invocation descriptors
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 schemas, while SRC codecs enforce JSON-safe values without structural type recovery. Cancellation is an out-of-band carrier signal injected after business parameters and never enters `args`.
42
+
43
+ ```ts type-equiv
44
+ /** Codec attached to one invocation parameter or result. */
45
+ type TypertCodec =
46
+ | {
47
+ readonly mode: 'strict'
48
+ readonly typeSymbol: string
49
+ readonly schema: TypertSchema
50
+ }
51
+ | {
52
+ readonly mode: 'src-json'
53
+ }
54
+ ```
55
+
56
+ ```ts type-equiv
57
+ /** One ordered business parameter in a Remote invocation. */
58
+ interface InvocationParameterDescriptor {
59
+ /** Source-level parameter name. */
60
+ readonly name: string
61
+ /** Required key in the wire `args` object. */
62
+ readonly wire: string
63
+ /** Whether the value is JSON or requires a registered Host lookup. */
64
+ readonly source: 'json' | 'lookup'
65
+ /** Lookup key when `source` is `lookup`. */
66
+ readonly lookup?: string
67
+ /** Boundary codec for the wire representation. */
68
+ readonly codec: TypertCodec
69
+ /** Missing wire fields decode to `undefined` only for an explicitly declared `T | undefined`. */
70
+ readonly acceptsUndefined?: true
71
+ }
72
+ ```
73
+
74
+ ```ts type-equiv
75
+ /** Carrier-independent description of one exported method invocation. */
76
+ interface InvocationDescriptor {
77
+ /** Globally stable generated identity. */
78
+ readonly id: string
79
+ /** Cordis service key owning the method. */
80
+ readonly service: string
81
+ /** Wire namespace, defaulting to the service key. */
82
+ readonly namespace: string
83
+ /** Public instance method name. */
84
+ readonly method: string
85
+ /** Service member invoked when the exported method name is an alias. */
86
+ readonly implementation?: string
87
+ /** Absent for unary calls; stream calls validate and deliver every yielded item. */
88
+ readonly mode?: 'stream'
89
+ /** Receiver selection mode. */
90
+ readonly invocation:
91
+ | { readonly kind: 'direct' }
92
+ | {
93
+ readonly kind: 'context'
94
+ readonly context: string
95
+ readonly wire: string
96
+ readonly codec: TypertCodec
97
+ }
98
+ /** Optional consuming-Context projection for one direct lookup parameter. */
99
+ readonly scope?: {
100
+ /** Context kind whose Client adapter supplies the identity. */
101
+ readonly context: string
102
+ /** Lookup parameter wire field replaced by the Context identity. */
103
+ readonly wire: string
104
+ }
105
+ /** Ordered business parameters. */
106
+ readonly parameters: readonly InvocationParameterDescriptor[]
107
+ /** Transport cancellation injected after business parameters instead of entering wire args. */
108
+ readonly cancellation?: {
109
+ /** Reserved final Host method parameter. */
110
+ readonly parameter: 'signal'
111
+ }
112
+ /** Codec for the unary result or each yielded stream item. */
113
+ readonly result: TypertCodec
114
+ /** Source declaration used only for diagnostics. */
115
+ readonly sourceLocation?: InvocationSourceLocation
116
+ }
117
+ ```
118
+
119
+ ## Typert registry
120
+
121
+ `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.
122
+
123
+ ```ts type-equiv
124
+ /** Minimal Typert runtime consumed through dependency inversion. */
125
+ interface TypertRegistryContract {
126
+ readonly local: TypertLocalRegistry
127
+ readonly remotes: TypertRemoteRegistry
128
+ readonly lookups: TypertLookupRegistry
129
+ readonly contexts: TypertContextRegistry
130
+ }
131
+ ```
132
+
133
+ Generated consumer declarations merge direct namespaces into the map inherited by `TypertClientRemote`.
134
+
135
+ ```ts type-equiv
136
+ /** Merge-extensible direct namespace surface generated for Client Remote services. */
137
+ interface TypertRemoteNamespaceMap {}
138
+ ```
139
+
140
+ ## Host Gateway
141
+
142
+ Connection decodes its carrier envelope before calling `ctx.typertGateway`. The request carries exact named wire fields and the carrier's cancellation signal separately; infrastructure and boundary failures ride `TypertGatewayError`, whose `gateway/*` codes are ordinary `RemoteError` codes, so the RPC adapter passes every structurally identified `RemoteError` through with its code and details intact and folds only unrecognized exceptions into `gateway/internal`.
143
+
144
+ ```ts type-equiv
145
+ /** One Remote method request after a carrier has decoded its envelope. */
146
+ interface InvokeRemoteRequest {
147
+ /** Remote namespace selected by the generated descriptor. */
148
+ readonly namespace: string
149
+ /** Exported Service method name. */
150
+ readonly method: string
151
+ /** Named wire values; fields must exactly match the descriptor. */
152
+ readonly args: Readonly<Record<string, unknown>>
153
+ /** Carrier or direct-caller cancellation injected only into cancellation-aware methods. */
154
+ readonly signal?: AbortSignal
155
+ }
156
+ ```
157
+
158
+ ```ts type-equiv
159
+ /** Stable infrastructure and boundary failures emitted before or after business execution. */
160
+ type TypertGatewayErrorCode =
161
+ | 'gateway/ambiguous-endpoint'
162
+ | 'gateway/arguments-invalid'
163
+ | 'gateway/binding-invalid'
164
+ | 'gateway/context-failed'
165
+ | 'gateway/context-not-found'
166
+ | 'gateway/context-unavailable'
167
+ | 'gateway/definition-unavailable'
168
+ | 'gateway/input-invalid'
169
+ | 'gateway/invocation-unavailable'
170
+ | 'gateway/lookup-failed'
171
+ | 'gateway/lookup-not-found'
172
+ | 'gateway/lookup-unavailable'
173
+ | 'gateway/method-unavailable'
174
+ | 'gateway/provider-mismatch'
175
+ | 'gateway/result-invalid'
176
+ | 'gateway/service-unavailable'
177
+ | 'gateway/signature-invalid'
178
+ ```
179
+
180
+ ```ts type-equiv
181
+ /** Host dispatcher consumed by Connection adapters. */
182
+ interface TypertGateway {
183
+ /** Carrier adapter shared by WebSocket and in-process transports. */
184
+ readonly wireStream: TypertGatewayWireStream
185
+ /**
186
+ * Register the application-selected forwarded-event source.
187
+ * @param source - stream factory installed by the Remote assembly.
188
+ * @param host - stable Host facts included in each Client generation's opening frame.
189
+ * @returns disposer removing this exact source and cancelling its active streams.
190
+ */
191
+ registerRemoteEvents(
192
+ source: TypertRemoteEventSource,
193
+ host: RemoteEventHostInfo,
194
+ ): () => Promise<void>
195
+ /**
196
+ * Invoke one live Remote method without assuming a carrier or response envelope.
197
+ * @param request - decoded endpoint and named wire arguments.
198
+ * @returns the business result without output decoding.
199
+ * @throws {@link TypertGatewayError} for dispatch, provider, or boundary failures; lookup-policy and business errors retain identity.
200
+ */
201
+ invoke(request: InvokeRemoteRequest): Promise<unknown>
202
+ /**
203
+ * Open one live stream Remote method without assuming a physical carrier.
204
+ * @param request - decoded endpoint and named wire arguments.
205
+ * @returns a cancellation-aware iterable over the business results.
206
+ */
207
+ stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
208
+ }
209
+ ```
210
+
211
+ ## Consumer Remote
212
+
213
+ `ctx.remote` exposes only namespaces contributed by imported `/remote` artifacts. `$mount()` installs generated descriptors and concrete methods as one fiber-owned operation. Each namespace is a traced `remote.<namespace>` Cordis child Service whose lifetime spans its mounted methods; no JavaScript Proxy or Host business Service type enters the consumer.
214
+
215
+ ```ts type-equiv
216
+ /** Client Remote capability implemented by the Gateway and consumed by Remote assemblies. */
217
+ interface TypertClientRemote extends TypertRemoteNamespaceMap {
218
+ /**
219
+ * Mount one generated Host-for-Client contribution in the caller's fiber.
220
+ * @param contribution - explicitly selected Remote package artifact.
221
+ * @returns disposer after namespace services and concrete methods are ready.
222
+ */
223
+ $mount(contribution: TypertRemoteContribution): Promise<TypertDisposer>
224
+ /**
225
+ * Subscribe to one forwarded Host event. Notifications run in registration
226
+ * order and isolate failures; scoped waterfalls return, delegate through
227
+ * `next()`, or reject the Host dispatch.
228
+ * @template Event - forwarded event name selected by the Host assembly.
229
+ * @param event - forwarded Host event name, unchanged on the wire.
230
+ * @param listener - receives the Client projection of the Cordis `Events` declaration.
231
+ * @returns disposer owned by the calling fiber.
232
+ */
233
+ $on<Event extends TypertRemoteEvent>(event: Event, listener: TypertClientEventListener<Event>): () => void
234
+ }
235
+ ```
236
+
237
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
238
+
239
+ <a id="cordis-surface"></a>
240
+
241
+ ## Cordis API
242
+
243
+ 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).
244
+
245
+ <a id="ctxtypert--typertregistry"></a>
246
+
247
+ ### `ctx.typert` — `TypertRegistry`
248
+
249
+ Registry of generated schemas, package reflection, invocations, and Remote dependency providers.
250
+
251
+ ```ts cordis-catalog
252
+ /**
253
+ * Register one generated contribution atomically for the calling fiber.
254
+ * Duplicate package-face identities, schemas, invocation ids, or endpoints
255
+ * reject the whole batch.
256
+ * @param contribution - generated schemas, reflection, and Host invocations.
257
+ * @returns the exact effect disposer that removes this contribution.
258
+ */
259
+ register(contribution: TypertContribution): TypertDisposer
260
+
261
+ /**
262
+ * Look up one schema by `<package>#<name>`.
263
+ * @param key - global schema key.
264
+ * @returns the live schema record, or `undefined` when absent.
265
+ */
266
+ get(key: string): TypertSchemaRecord | undefined
267
+
268
+ /**
269
+ * Resolve one required schema.
270
+ * @param key - global schema key.
271
+ * @returns the live schema record.
272
+ * @throws when the key is malformed, the package face is absent, or the schema is not contributed.
273
+ */
274
+ resolve(key: string): TypertSchemaRecord
275
+
276
+ /**
277
+ * Enumerate live schemas in registration order.
278
+ * @param filter - optional package and face restriction.
279
+ * @returns matching schema records.
280
+ */
281
+ list(filter: TypertSchemaFilter = {}): TypertSchemaRecord[]
282
+
283
+ /**
284
+ * Look up generated reflection for one package face.
285
+ * @param packageName - exact npm package name.
286
+ * @param face - face to query; defaults to the host runtime.
287
+ * @returns the live package record, or `undefined` when absent.
288
+ */
289
+ getPackage(packageName: string, face: TypertFace = 'host'): TypertPackageRecord | undefined
290
+
291
+ /**
292
+ * Enumerate generated package reflection in registration order.
293
+ * @param filter - optional package and face restriction.
294
+ * @returns matching package records.
295
+ */
296
+ listPackages(filter: TypertPackageFilter = {}): TypertPackageRecord[]
297
+
298
+ /**
299
+ * Project a live Zod schema to JSON Schema without caching the result.
300
+ * @param key - global schema key.
301
+ * @param params - Zod projection parameters.
302
+ * @returns a fresh JSON Schema document.
303
+ */
304
+ toJSONSchema(key: string, params?: z.core.ToJSONSchemaParams): z.core.JSONSchema.BaseSchema
305
+ ```
306
+
307
+ Types: [TypertContribution](invariants.md) · [TypertFace](invariants.md) · [TypertPackageFilter](invariants.md) · [TypertPackageRecord](invariants.md) · [TypertSchemaFilter](invariants.md) · [TypertSchemaRecord](invariants.md)
308
+
309
+ Source: [`packages/typert/registry/src/service.ts`](../../packages/typert/registry/src/service.ts)
310
+
311
+ <a id="ctxtypertgateway--typertgatewayservice"></a>
312
+
313
+ ### `ctx.typertGateway` — `TypertGatewayService`
314
+
315
+ Resolve strict generated definitions or conservative SRC markers against current Cordis Services and Typert providers.
316
+
317
+ ```ts cordis-catalog
318
+ /**
319
+ * Register the sole application-selected forwarded-event source.
320
+ * @param source - stream factory installed by the Remote assembly.
321
+ * @param host - stable Host facts included in each Client generation's opening frame.
322
+ * @returns disposer removing this source and cancelling its active streams.
323
+ */
324
+ registerRemoteEvents( source: TypertRemoteEventSource, host: RemoteEventHostInfo, ): () => Promise<void>
325
+
326
+ /**
327
+ * Invoke one live Remote method through strict generated reflection or SRC markers.
328
+ * @param request - decoded endpoint and exact named wire arguments.
329
+ * @returns the business result without output decoding.
330
+ * @throws {@link TypertGatewayError} for dispatch, provider, or boundary failures; lookup-policy and business errors retain identity.
331
+ */
332
+ async invoke(request: InvokeRemoteRequest): Promise<unknown>
333
+
334
+ /**
335
+ * Open one live stream Remote method without assuming a physical carrier.
336
+ * @param request - decoded endpoint and named wire arguments.
337
+ * @returns a cancellation-aware iterable over the business results.
338
+ */
339
+ async stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
340
+ ```
341
+
342
+ Source: [`packages/api/gateway/src/index.ts`](../../packages/api/gateway/src/index.ts)
343
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,343 @@
1
+ # Typert 远程调用
2
+
3
+ [English](typert.md) | 中文
4
+
5
+ 以下类型由生成的 Remote 产物、Host Gateway 与消费方 API assembly 共用。[Typert Gateway Agent Note](../../.agents/notes/implemented/architecture/2026-08-02-typert-remote-method-calls.zh.md) 负责架构与传输决策;本页记录 [`dsh-typert-protocol`](../../packages/typert/protocol/src/types.ts) 和 [`dsh-api-gateway`](../../packages/api/gateway/src/types.ts) 中公共约定的字面定义。
6
+
7
+ ## Lookup 与上下文声明
8
+
9
+ 业务对象包通过声明合并扩展两个空 map。lookup 将一种 Host 对象类型与其 wire identity 关联;上下文声明将一种作用域上下文类别与其 wire identity 关联。生成的 descriptor 引用这些 key,运行时提供方则提供活对象解析行为。
10
+
11
+ ```ts type-equiv
12
+ /** Merge-extensible Host object lookup declarations. */
13
+ interface TypertLookupMap {}
14
+ ```
15
+
16
+ ```ts type-equiv
17
+ /** Merge-extensible scoped Context declarations. */
18
+ interface TypertContextMap {}
19
+ ```
20
+
21
+ lookup 的 resolver 卸载后,注册表仍会保留其 wire 声明。因此 SRC 发现过程会继续把该参数归类为 lookup,并因不可用而失败,而不会把 wire 值当作普通业务对象接受。
22
+
23
+ ```ts type-equiv
24
+ /** Stable wire declaration retained after a lookup provider unloads. */
25
+ interface TypertLookupDefinition {
26
+ /** Merge-declared lookup key. */
27
+ readonly key: string
28
+ /** Source parameter name recognized by the SRC weak parser. */
29
+ readonly parameter: string
30
+ /** Wire field replacing the Host object parameter. */
31
+ readonly wire: string
32
+ /** Canonical Host type symbol used by strict generation. */
33
+ readonly hostTypeSymbol: string
34
+ /** Canonical wire type symbol used by strict generation. */
35
+ readonly wireTypeSymbol: string
36
+ }
37
+ ```
38
+
39
+ ## 调用 descriptor
40
+
41
+ `InvocationDescriptor` 是本地反射信息,不是 wire message。Host 与消费方构建会生成彼此对应的 descriptor;请求只发送 endpoint 与具名 `args`。strict codec 携带生成的 schema,SRC codec 则在不恢复结构类型的前提下强制要求 JSON 安全值。取消通过带外 carrier signal 表达:它在业务参数之后注入,绝不进入 `args`。
42
+
43
+ ```ts type-equiv
44
+ /** Codec attached to one invocation parameter or result. */
45
+ type TypertCodec =
46
+ | {
47
+ readonly mode: 'strict'
48
+ readonly typeSymbol: string
49
+ readonly schema: TypertSchema
50
+ }
51
+ | {
52
+ readonly mode: 'src-json'
53
+ }
54
+ ```
55
+
56
+ ```ts type-equiv
57
+ /** One ordered business parameter in a Remote invocation. */
58
+ interface InvocationParameterDescriptor {
59
+ /** Source-level parameter name. */
60
+ readonly name: string
61
+ /** Required key in the wire `args` object. */
62
+ readonly wire: string
63
+ /** Whether the value is JSON or requires a registered Host lookup. */
64
+ readonly source: 'json' | 'lookup'
65
+ /** Lookup key when `source` is `lookup`. */
66
+ readonly lookup?: string
67
+ /** Boundary codec for the wire representation. */
68
+ readonly codec: TypertCodec
69
+ /** Missing wire fields decode to `undefined` only for an explicitly declared `T | undefined`. */
70
+ readonly acceptsUndefined?: true
71
+ }
72
+ ```
73
+
74
+ ```ts type-equiv
75
+ /** Carrier-independent description of one exported method invocation. */
76
+ interface InvocationDescriptor {
77
+ /** Globally stable generated identity. */
78
+ readonly id: string
79
+ /** Cordis service key owning the method. */
80
+ readonly service: string
81
+ /** Wire namespace, defaulting to the service key. */
82
+ readonly namespace: string
83
+ /** Public instance method name. */
84
+ readonly method: string
85
+ /** Service member invoked when the exported method name is an alias. */
86
+ readonly implementation?: string
87
+ /** Absent for unary calls; stream calls validate and deliver every yielded item. */
88
+ readonly mode?: 'stream'
89
+ /** Receiver selection mode. */
90
+ readonly invocation:
91
+ | { readonly kind: 'direct' }
92
+ | {
93
+ readonly kind: 'context'
94
+ readonly context: string
95
+ readonly wire: string
96
+ readonly codec: TypertCodec
97
+ }
98
+ /** Optional consuming-Context projection for one direct lookup parameter. */
99
+ readonly scope?: {
100
+ /** Context kind whose Client adapter supplies the identity. */
101
+ readonly context: string
102
+ /** Lookup parameter wire field replaced by the Context identity. */
103
+ readonly wire: string
104
+ }
105
+ /** Ordered business parameters. */
106
+ readonly parameters: readonly InvocationParameterDescriptor[]
107
+ /** Transport cancellation injected after business parameters instead of entering wire args. */
108
+ readonly cancellation?: {
109
+ /** Reserved final Host method parameter. */
110
+ readonly parameter: 'signal'
111
+ }
112
+ /** Codec for the unary result or each yielded stream item. */
113
+ readonly result: TypertCodec
114
+ /** Source declaration used only for diagnostics. */
115
+ readonly sourceLocation?: InvocationSourceLocation
116
+ }
117
+ ```
118
+
119
+ ## Typert 注册表
120
+
121
+ `ctx.typert` 分开保存当前环境的 descriptor、显式选择的 Remote contribution、lookup 提供方与作用域上下文提供方。lookup 提供方拥有稳定 wire 声明和默认 resolver;Host 组合可以为同一个 key 配置 effect-scoped 同步或异步 resolver,配置卸载后恢复默认策略。各项注册都是由 Cordis 持有的 effect,并返回可等待的 disposer。
122
+
123
+ ```ts type-equiv
124
+ /** Minimal Typert runtime consumed through dependency inversion. */
125
+ interface TypertRegistryContract {
126
+ readonly local: TypertLocalRegistry
127
+ readonly remotes: TypertRemoteRegistry
128
+ readonly lookups: TypertLookupRegistry
129
+ readonly contexts: TypertContextRegistry
130
+ }
131
+ ```
132
+
133
+ 生成的消费方声明会把 direct namespace 合并到 `TypertClientRemote` 继承的 map 中。
134
+
135
+ ```ts type-equiv
136
+ /** Merge-extensible direct namespace surface generated for Client Remote services. */
137
+ interface TypertRemoteNamespaceMap {}
138
+ ```
139
+
140
+ ## Host Gateway
141
+
142
+ Connection 会先解码 carrier envelope,再调用 `ctx.typertGateway`。请求将精确的具名 wire 字段与 carrier 的取消 signal 分开携带;基础设施与边界失败由 `TypertGatewayError` 承载,其 `gateway/*` 码就是普通的 `RemoteError` 码,因此 RPC 适配器会把每个经结构识别的 `RemoteError` 连同其 code 与 details 原样放行,只把无法识别的异常归并为 `gateway/internal`。
143
+
144
+ ```ts type-equiv
145
+ /** One Remote method request after a carrier has decoded its envelope. */
146
+ interface InvokeRemoteRequest {
147
+ /** Remote namespace selected by the generated descriptor. */
148
+ readonly namespace: string
149
+ /** Exported Service method name. */
150
+ readonly method: string
151
+ /** Named wire values; fields must exactly match the descriptor. */
152
+ readonly args: Readonly<Record<string, unknown>>
153
+ /** Carrier or direct-caller cancellation injected only into cancellation-aware methods. */
154
+ readonly signal?: AbortSignal
155
+ }
156
+ ```
157
+
158
+ ```ts type-equiv
159
+ /** Stable infrastructure and boundary failures emitted before or after business execution. */
160
+ type TypertGatewayErrorCode =
161
+ | 'gateway/ambiguous-endpoint'
162
+ | 'gateway/arguments-invalid'
163
+ | 'gateway/binding-invalid'
164
+ | 'gateway/context-failed'
165
+ | 'gateway/context-not-found'
166
+ | 'gateway/context-unavailable'
167
+ | 'gateway/definition-unavailable'
168
+ | 'gateway/input-invalid'
169
+ | 'gateway/invocation-unavailable'
170
+ | 'gateway/lookup-failed'
171
+ | 'gateway/lookup-not-found'
172
+ | 'gateway/lookup-unavailable'
173
+ | 'gateway/method-unavailable'
174
+ | 'gateway/provider-mismatch'
175
+ | 'gateway/result-invalid'
176
+ | 'gateway/service-unavailable'
177
+ | 'gateway/signature-invalid'
178
+ ```
179
+
180
+ ```ts type-equiv
181
+ /** Host dispatcher consumed by Connection adapters. */
182
+ interface TypertGateway {
183
+ /** Carrier adapter shared by WebSocket and in-process transports. */
184
+ readonly wireStream: TypertGatewayWireStream
185
+ /**
186
+ * Register the application-selected forwarded-event source.
187
+ * @param source - stream factory installed by the Remote assembly.
188
+ * @param host - stable Host facts included in each Client generation's opening frame.
189
+ * @returns disposer removing this exact source and cancelling its active streams.
190
+ */
191
+ registerRemoteEvents(
192
+ source: TypertRemoteEventSource,
193
+ host: RemoteEventHostInfo,
194
+ ): () => Promise<void>
195
+ /**
196
+ * Invoke one live Remote method without assuming a carrier or response envelope.
197
+ * @param request - decoded endpoint and named wire arguments.
198
+ * @returns the business result without output decoding.
199
+ * @throws {@link TypertGatewayError} for dispatch, provider, or boundary failures; lookup-policy and business errors retain identity.
200
+ */
201
+ invoke(request: InvokeRemoteRequest): Promise<unknown>
202
+ /**
203
+ * Open one live stream Remote method without assuming a physical carrier.
204
+ * @param request - decoded endpoint and named wire arguments.
205
+ * @returns a cancellation-aware iterable over the business results.
206
+ */
207
+ stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
208
+ }
209
+ ```
210
+
211
+ ## 消费方 Remote
212
+
213
+ `ctx.remote` 只暴露由已导入 `/remote` 产物贡献的 namespace。`$mount()` 会把生成的 descriptor 与具体方法作为一项由 fiber 持有的操作统一注册。每个 namespace 都是可追踪的 `remote.<namespace>` Cordis 子服务,其生命周期覆盖已挂载的方法;JavaScript Proxy 与 Host 业务服务类型都不会进入消费方。
214
+
215
+ ```ts type-equiv
216
+ /** Client Remote capability implemented by the Gateway and consumed by Remote assemblies. */
217
+ interface TypertClientRemote extends TypertRemoteNamespaceMap {
218
+ /**
219
+ * Mount one generated Host-for-Client contribution in the caller's fiber.
220
+ * @param contribution - explicitly selected Remote package artifact.
221
+ * @returns disposer after namespace services and concrete methods are ready.
222
+ */
223
+ $mount(contribution: TypertRemoteContribution): Promise<TypertDisposer>
224
+ /**
225
+ * Subscribe to one forwarded Host event. Notifications run in registration
226
+ * order and isolate failures; scoped waterfalls return, delegate through
227
+ * `next()`, or reject the Host dispatch.
228
+ * @template Event - forwarded event name selected by the Host assembly.
229
+ * @param event - forwarded Host event name, unchanged on the wire.
230
+ * @param listener - receives the Client projection of the Cordis `Events` declaration.
231
+ * @returns disposer owned by the calling fiber.
232
+ */
233
+ $on<Event extends TypertRemoteEvent>(event: Event, listener: TypertClientEventListener<Event>): () => void
234
+ }
235
+ ```
236
+
237
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
238
+
239
+ <a id="cordis-surface"></a>
240
+
241
+ ## Cordis API
242
+
243
+ 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).
244
+
245
+ <a id="ctxtypert--typertregistry"></a>
246
+
247
+ ### `ctx.typert` — `TypertRegistry`
248
+
249
+ Registry of generated schemas, package reflection, invocations, and Remote dependency providers.
250
+
251
+ ```ts cordis-catalog
252
+ /**
253
+ * Register one generated contribution atomically for the calling fiber.
254
+ * Duplicate package-face identities, schemas, invocation ids, or endpoints
255
+ * reject the whole batch.
256
+ * @param contribution - generated schemas, reflection, and Host invocations.
257
+ * @returns the exact effect disposer that removes this contribution.
258
+ */
259
+ register(contribution: TypertContribution): TypertDisposer
260
+
261
+ /**
262
+ * Look up one schema by `<package>#<name>`.
263
+ * @param key - global schema key.
264
+ * @returns the live schema record, or `undefined` when absent.
265
+ */
266
+ get(key: string): TypertSchemaRecord | undefined
267
+
268
+ /**
269
+ * Resolve one required schema.
270
+ * @param key - global schema key.
271
+ * @returns the live schema record.
272
+ * @throws when the key is malformed, the package face is absent, or the schema is not contributed.
273
+ */
274
+ resolve(key: string): TypertSchemaRecord
275
+
276
+ /**
277
+ * Enumerate live schemas in registration order.
278
+ * @param filter - optional package and face restriction.
279
+ * @returns matching schema records.
280
+ */
281
+ list(filter: TypertSchemaFilter = {}): TypertSchemaRecord[]
282
+
283
+ /**
284
+ * Look up generated reflection for one package face.
285
+ * @param packageName - exact npm package name.
286
+ * @param face - face to query; defaults to the host runtime.
287
+ * @returns the live package record, or `undefined` when absent.
288
+ */
289
+ getPackage(packageName: string, face: TypertFace = 'host'): TypertPackageRecord | undefined
290
+
291
+ /**
292
+ * Enumerate generated package reflection in registration order.
293
+ * @param filter - optional package and face restriction.
294
+ * @returns matching package records.
295
+ */
296
+ listPackages(filter: TypertPackageFilter = {}): TypertPackageRecord[]
297
+
298
+ /**
299
+ * Project a live Zod schema to JSON Schema without caching the result.
300
+ * @param key - global schema key.
301
+ * @param params - Zod projection parameters.
302
+ * @returns a fresh JSON Schema document.
303
+ */
304
+ toJSONSchema(key: string, params?: z.core.ToJSONSchemaParams): z.core.JSONSchema.BaseSchema
305
+ ```
306
+
307
+ 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)
308
+
309
+ Source: [`packages/typert/registry/src/service.ts`](../../packages/typert/registry/src/service.ts)
310
+
311
+ <a id="ctxtypertgateway--typertgatewayservice"></a>
312
+
313
+ ### `ctx.typertGateway` — `TypertGatewayService`
314
+
315
+ Resolve strict generated definitions or conservative SRC markers against current Cordis Services and Typert providers.
316
+
317
+ ```ts cordis-catalog
318
+ /**
319
+ * Register the sole application-selected forwarded-event source.
320
+ * @param source - stream factory installed by the Remote assembly.
321
+ * @param host - stable Host facts included in each Client generation's opening frame.
322
+ * @returns disposer removing this source and cancelling its active streams.
323
+ */
324
+ registerRemoteEvents( source: TypertRemoteEventSource, host: RemoteEventHostInfo, ): () => Promise<void>
325
+
326
+ /**
327
+ * Invoke one live Remote method through strict generated reflection or SRC markers.
328
+ * @param request - decoded endpoint and exact named wire arguments.
329
+ * @returns the business result without output decoding.
330
+ * @throws {@link TypertGatewayError} for dispatch, provider, or boundary failures; lookup-policy and business errors retain identity.
331
+ */
332
+ async invoke(request: InvokeRemoteRequest): Promise<unknown>
333
+
334
+ /**
335
+ * Open one live stream Remote method without assuming a physical carrier.
336
+ * @param request - decoded endpoint and named wire arguments.
337
+ * @returns a cancellation-aware iterable over the business results.
338
+ */
339
+ async stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
340
+ ```
341
+
342
+ Source: [`packages/api/gateway/src/index.ts`](../../packages/api/gateway/src/index.ts)
343
+ <!-- END GENERATED cordis-surface -->