@acryldev/plugin-context 0.0.0-stage → 0.1.1

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 (284) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/docs/README.md +160 -0
  4. package/docs/delivery/local-live.md +113 -0
  5. package/docs/delivery/marketplace.md +16 -0
  6. package/docs/docs.json +2836 -0
  7. package/docs/extending/agent-preset.md +37 -0
  8. package/docs/extending/chat-command.md +28 -0
  9. package/docs/extending/client-slot.md +135 -0
  10. package/docs/extending/config-schema.md +7 -0
  11. package/docs/extending/cordis-core.md +63 -0
  12. package/docs/extending/desktop-app.md +53 -0
  13. package/docs/extending/desktop-main.md +25 -0
  14. package/docs/extending/event-hook.md +14 -0
  15. package/docs/extending/host-route.md +33 -0
  16. package/docs/extending/llm-adapter.md +38 -0
  17. package/docs/extending/packaging.md +53 -0
  18. package/docs/extending/prompt-contribution.md +9 -0
  19. package/docs/extending/service.md +13 -0
  20. package/docs/extending/skill-provider.md +9 -0
  21. package/docs/extending/state-and-persistence.md +71 -0
  22. package/docs/extending/three-role-capability.md +33 -0
  23. package/docs/extending/tool-plugin.md +24 -0
  24. package/docs/extending/tui-command.md +8 -0
  25. package/docs/extending/tui-components.md +61 -0
  26. package/docs/extending/ui-branding.md +43 -0
  27. package/docs/extending/ui-components.md +56 -0
  28. package/docs/extending/ui-customization.md +41 -0
  29. package/docs/extending/ui-library.md +66 -0
  30. package/docs/extending/ui-theme.md +55 -0
  31. package/docs/extending/workspace-tab.md +50 -0
  32. package/docs/maps/events.md +108 -0
  33. package/docs/maps/mount-points.md +154 -0
  34. package/docs/maps/slot-contracts.md +3376 -0
  35. package/docs/maps/taxonomy.md +306 -0
  36. package/docs/maps/theme-tokens.md +115 -0
  37. package/docs/maps/ui-components.md +26 -0
  38. package/docs/reference/cookbook/adding-a-package.md +174 -0
  39. package/docs/reference/cookbook/adding-a-remote-api.md +199 -0
  40. package/docs/reference/cookbook/adding-a-settings-card.md +74 -0
  41. package/docs/reference/cookbook/adding-a-tool.md +103 -0
  42. package/docs/reference/cookbook/adding-an-llm-adapter.md +45 -0
  43. package/docs/reference/cookbook/extension-cookbook.md +134 -0
  44. package/docs/reference/cordis-api/context.md +366 -0
  45. package/docs/reference/cordis-api/events.md +209 -0
  46. package/docs/reference/cordis-api/fiber.md +377 -0
  47. package/docs/reference/cordis-api/inherited.md +40 -0
  48. package/docs/reference/cordis-api/registry.md +154 -0
  49. package/docs/reference/cordis-api/service.md +104 -0
  50. package/docs/reference/cordis-guides/cordis-usage-cheatsheet.md +167 -0
  51. package/docs/reference/cordis-guides/cordis_system_guide_for_coding_agents.md +4666 -0
  52. package/docs/reference/cordis-guides/development-canvas-plugin.md +109 -0
  53. package/docs/reference/cordis-guides/hello-world-plugin-guide.md +517 -0
  54. package/docs/reference/harness/agent-lifecycle.md +93 -0
  55. package/docs/reference/harness/architecture.md +168 -0
  56. package/docs/reference/harness/capability-seams.md +675 -0
  57. package/docs/reference/harness/config-catalog.md +4523 -0
  58. package/docs/reference/harness/cordis-primer.md +47 -0
  59. package/docs/reference/harness/defensive-patterns.md +35 -0
  60. package/docs/reference/harness/event-producer-consumer.md +111 -0
  61. package/docs/reference/harness/glossary.md +47 -0
  62. package/docs/reference/harness/tool-catalog.md +2721 -0
  63. package/docs/reference/harness/tool-execution-pipeline.md +67 -0
  64. package/docs/reference/subsystems/README.md +75 -0
  65. package/docs/reference/subsystems/agent-team.md +233 -0
  66. package/docs/reference/subsystems/approval.md +172 -0
  67. package/docs/reference/subsystems/attachment.md +363 -0
  68. package/docs/reference/subsystems/boot.md +324 -0
  69. package/docs/reference/subsystems/browser-use.md +69 -0
  70. package/docs/reference/subsystems/client-modules.md +186 -0
  71. package/docs/reference/subsystems/client-resources.md +94 -0
  72. package/docs/reference/subsystems/commands.md +225 -0
  73. package/docs/reference/subsystems/compaction.md +286 -0
  74. package/docs/reference/subsystems/computer-use.md +58 -0
  75. package/docs/reference/subsystems/conversation.md +287 -0
  76. package/docs/reference/subsystems/core.md +1107 -0
  77. package/docs/reference/subsystems/credentials.md +497 -0
  78. package/docs/reference/subsystems/deliverables.md +180 -0
  79. package/docs/reference/subsystems/extensions.md +386 -0
  80. package/docs/reference/subsystems/feedback.md +402 -0
  81. package/docs/reference/subsystems/filesystem.md +532 -0
  82. package/docs/reference/subsystems/goal.md +315 -0
  83. package/docs/reference/subsystems/invariants.md +90 -0
  84. package/docs/reference/subsystems/jobs.md +501 -0
  85. package/docs/reference/subsystems/llm-streaming.md +1131 -0
  86. package/docs/reference/subsystems/lsp.md +204 -0
  87. package/docs/reference/subsystems/mcp.md +141 -0
  88. package/docs/reference/subsystems/office-to-pdf.md +89 -0
  89. package/docs/reference/subsystems/otel.md +46 -0
  90. package/docs/reference/subsystems/permission-presets.md +169 -0
  91. package/docs/reference/subsystems/persistence.md +418 -0
  92. package/docs/reference/subsystems/plan.md +89 -0
  93. package/docs/reference/subsystems/product-telemetry.md +81 -0
  94. package/docs/reference/subsystems/ptc-runtime.md +234 -0
  95. package/docs/reference/subsystems/sandbox.md +223 -0
  96. package/docs/reference/subsystems/schedule.md +545 -0
  97. package/docs/reference/subsystems/scope.md +61 -0
  98. package/docs/reference/subsystems/session-projection.md +358 -0
  99. package/docs/reference/subsystems/session-query.md +511 -0
  100. package/docs/reference/subsystems/session-reference.md +226 -0
  101. package/docs/reference/subsystems/session-telemetry.md +214 -0
  102. package/docs/reference/subsystems/session-title.md +206 -0
  103. package/docs/reference/subsystems/session.md +1300 -0
  104. package/docs/reference/subsystems/settings.md +157 -0
  105. package/docs/reference/subsystems/shell.md +316 -0
  106. package/docs/reference/subsystems/sidebar-right.md +160 -0
  107. package/docs/reference/subsystems/skills.md +354 -0
  108. package/docs/reference/subsystems/slots.md +201 -0
  109. package/docs/reference/subsystems/spill.md +126 -0
  110. package/docs/reference/subsystems/ssh.md +137 -0
  111. package/docs/reference/subsystems/storage.md +262 -0
  112. package/docs/reference/subsystems/subagent.md +762 -0
  113. package/docs/reference/subsystems/subprocess.md +323 -0
  114. package/docs/reference/subsystems/system-prompt.md +226 -0
  115. package/docs/reference/subsystems/terminal.md +186 -0
  116. package/docs/reference/subsystems/todo.md +34 -0
  117. package/docs/reference/subsystems/token-meter.md +108 -0
  118. package/docs/reference/subsystems/tools.md +749 -0
  119. package/docs/reference/subsystems/typert.md +489 -0
  120. package/docs/reference/subsystems/user-questions.md +309 -0
  121. package/docs/reference/subsystems/voice-input.md +166 -0
  122. package/docs/reference/subsystems/web-client.md +102 -0
  123. package/docs/reference/subsystems/web-server.md +228 -0
  124. package/docs/reference/subsystems/web.md +208 -0
  125. package/docs/reference/subsystems/webhook.md +72 -0
  126. package/docs/reference/subsystems/workflow.md +280 -0
  127. package/docs/reference/subsystems/workspace.md +661 -0
  128. package/docs/start-here/blueprints.md +33 -0
  129. package/docs/start-here/this-runtime.md +84 -0
  130. package/docs/start-here/troubleshooting.md +29 -0
  131. package/docs/start-here/trust-and-safety.md +39 -0
  132. package/docs/start-here/verify-before-done.md +46 -0
  133. package/example-plugins/README.md +45 -0
  134. package/example-plugins/packages/agent-preset-reviewer/agent.cordis.yml +18 -0
  135. package/example-plugins/packages/agent-preset-reviewer/preset.yml +3 -0
  136. package/example-plugins/packages/capability-swap-consumer/cordis.patch.yml +3 -0
  137. package/example-plugins/packages/capability-swap-consumer/index.js +14 -0
  138. package/example-plugins/packages/capability-swap-consumer/package.json +25 -0
  139. package/example-plugins/packages/capability-swap-provider-loud/cordis.patch.yml +3 -0
  140. package/example-plugins/packages/capability-swap-provider-loud/index.js +20 -0
  141. package/example-plugins/packages/capability-swap-provider-loud/package.json +25 -0
  142. package/example-plugins/packages/capability-swap-provider-quiet/cordis.patch.yml +3 -0
  143. package/example-plugins/packages/capability-swap-provider-quiet/index.js +20 -0
  144. package/example-plugins/packages/capability-swap-provider-quiet/package.json +25 -0
  145. package/example-plugins/packages/chat-command-basic/cordis.patch.yml +3 -0
  146. package/example-plugins/packages/chat-command-basic/index.js +26 -0
  147. package/example-plugins/packages/chat-command-basic/package.json +25 -0
  148. package/example-plugins/packages/client-chat-message-action/client.js +46 -0
  149. package/example-plugins/packages/client-chat-message-action/cordis.patch.yml +3 -0
  150. package/example-plugins/packages/client-chat-message-action/index.js +9 -0
  151. package/example-plugins/packages/client-chat-message-action/package.json +31 -0
  152. package/example-plugins/packages/client-slot-header-action/client.js +57 -0
  153. package/example-plugins/packages/client-slot-header-action/cordis.patch.yml +3 -0
  154. package/example-plugins/packages/client-slot-header-action/index.js +13 -0
  155. package/example-plugins/packages/client-slot-header-action/package.json +31 -0
  156. package/example-plugins/packages/client-slot-sidebar-tab/client.js +57 -0
  157. package/example-plugins/packages/client-slot-sidebar-tab/cordis.patch.yml +3 -0
  158. package/example-plugins/packages/client-slot-sidebar-tab/index.js +9 -0
  159. package/example-plugins/packages/client-slot-sidebar-tab/package.json +32 -0
  160. package/example-plugins/packages/client-theme-override/client.js +52 -0
  161. package/example-plugins/packages/client-theme-override/cordis.patch.yml +3 -0
  162. package/example-plugins/packages/client-theme-override/index.js +9 -0
  163. package/example-plugins/packages/client-theme-override/package.json +30 -0
  164. package/example-plugins/packages/client-tool-view/client.js +47 -0
  165. package/example-plugins/packages/client-tool-view/cordis.patch.yml +3 -0
  166. package/example-plugins/packages/client-tool-view/index.js +24 -0
  167. package/example-plugins/packages/client-tool-view/package.json +34 -0
  168. package/example-plugins/packages/client-ui-components/client.js +77 -0
  169. package/example-plugins/packages/client-ui-components/cordis.patch.yml +3 -0
  170. package/example-plugins/packages/client-ui-components/index.js +9 -0
  171. package/example-plugins/packages/client-ui-components/package.json +31 -0
  172. package/example-plugins/packages/client-ui-library/client.js +715 -0
  173. package/example-plugins/packages/client-ui-library/cordis.patch.yml +3 -0
  174. package/example-plugins/packages/client-ui-library/index.js +9 -0
  175. package/example-plugins/packages/client-ui-library/package.json +37 -0
  176. package/example-plugins/packages/client-workspace-tab/client.js +72 -0
  177. package/example-plugins/packages/client-workspace-tab/cordis.patch.yml +3 -0
  178. package/example-plugins/packages/client-workspace-tab/index.js +9 -0
  179. package/example-plugins/packages/client-workspace-tab/package.json +30 -0
  180. package/example-plugins/packages/config-schema-basic/cordis.patch.yml +3 -0
  181. package/example-plugins/packages/config-schema-basic/index.js +19 -0
  182. package/example-plugins/packages/config-schema-basic/package.json +25 -0
  183. package/example-plugins/packages/desktop-main-profile-info/cordis.patch.yml +3 -0
  184. package/example-plugins/packages/desktop-main-profile-info/index.js +22 -0
  185. package/example-plugins/packages/desktop-main-profile-info/package.json +25 -0
  186. package/example-plugins/packages/event-hook-basic/cordis.patch.yml +3 -0
  187. package/example-plugins/packages/event-hook-basic/index.js +17 -0
  188. package/example-plugins/packages/event-hook-basic/package.json +22 -0
  189. package/example-plugins/packages/generated-capability-template/cordis.patch.yml +3 -0
  190. package/example-plugins/packages/generated-capability-template/index.js +16 -0
  191. package/example-plugins/packages/generated-capability-template/package.json +42 -0
  192. package/example-plugins/packages/host-route-basic/cordis.patch.yml +3 -0
  193. package/example-plugins/packages/host-route-basic/index.js +20 -0
  194. package/example-plugins/packages/host-route-basic/package.json +29 -0
  195. package/example-plugins/packages/lifecycle-function-basic/cordis.patch.yml +3 -0
  196. package/example-plugins/packages/lifecycle-function-basic/index.js +12 -0
  197. package/example-plugins/packages/lifecycle-function-basic/package.json +15 -0
  198. package/example-plugins/packages/lifecycle-function-hot-shim/cordis.patch.yml +3 -0
  199. package/example-plugins/packages/lifecycle-function-hot-shim/impl.js +5 -0
  200. package/example-plugins/packages/lifecycle-function-hot-shim/index.js +18 -0
  201. package/example-plugins/packages/lifecycle-function-hot-shim/package.json +23 -0
  202. package/example-plugins/packages/lifecycle-hooks-observer/cordis.patch.yml +3 -0
  203. package/example-plugins/packages/lifecycle-hooks-observer/index.js +23 -0
  204. package/example-plugins/packages/lifecycle-hooks-observer/package.json +22 -0
  205. package/example-plugins/packages/llm-adapter-echo/cordis.patch.yml +3 -0
  206. package/example-plugins/packages/llm-adapter-echo/index.js +42 -0
  207. package/example-plugins/packages/llm-adapter-echo/package.json +25 -0
  208. package/example-plugins/packages/prompt-assemble-hook/cordis.patch.yml +3 -0
  209. package/example-plugins/packages/prompt-assemble-hook/index.js +22 -0
  210. package/example-plugins/packages/prompt-assemble-hook/package.json +22 -0
  211. package/example-plugins/packages/prompt-contribution-basic/cordis.patch.yml +3 -0
  212. package/example-plugins/packages/prompt-contribution-basic/index.js +18 -0
  213. package/example-plugins/packages/prompt-contribution-basic/package.json +22 -0
  214. package/example-plugins/packages/service-consumer-greeter/cordis.patch.yml +3 -0
  215. package/example-plugins/packages/service-consumer-greeter/index.js +14 -0
  216. package/example-plugins/packages/service-consumer-greeter/package.json +22 -0
  217. package/example-plugins/packages/service-provider-greeter/cordis.patch.yml +3 -0
  218. package/example-plugins/packages/service-provider-greeter/index.js +22 -0
  219. package/example-plugins/packages/service-provider-greeter/package.json +25 -0
  220. package/example-plugins/packages/settings-section-basic/cordis.patch.yml +3 -0
  221. package/example-plugins/packages/settings-section-basic/index.js +34 -0
  222. package/example-plugins/packages/settings-section-basic/package.json +26 -0
  223. package/example-plugins/packages/skill-provider-basic/cordis.patch.yml +3 -0
  224. package/example-plugins/packages/skill-provider-basic/index.js +31 -0
  225. package/example-plugins/packages/skill-provider-basic/package.json +22 -0
  226. package/example-plugins/packages/state-host-store/client.js +57 -0
  227. package/example-plugins/packages/state-host-store/cordis.patch.yml +3 -0
  228. package/example-plugins/packages/state-host-store/index.js +90 -0
  229. package/example-plugins/packages/state-host-store/package.json +31 -0
  230. package/example-plugins/packages/state-workspace-file/cordis.patch.yml +3 -0
  231. package/example-plugins/packages/state-workspace-file/index.js +52 -0
  232. package/example-plugins/packages/state-workspace-file/package.json +25 -0
  233. package/example-plugins/packages/tool-basic/cordis.patch.yml +3 -0
  234. package/example-plugins/packages/tool-basic/index.js +25 -0
  235. package/example-plugins/packages/tool-basic/package.json +25 -0
  236. package/example-plugins/packages/tool-policy-hook/cordis.patch.yml +3 -0
  237. package/example-plugins/packages/tool-policy-hook/index.js +28 -0
  238. package/example-plugins/packages/tool-policy-hook/package.json +25 -0
  239. package/example-plugins/packages/tui-command-basic/cordis.patch.yml +3 -0
  240. package/example-plugins/packages/tui-command-basic/index.js +24 -0
  241. package/example-plugins/packages/tui-command-basic/package.json +22 -0
  242. package/example-plugins/packages/tui-overlay-themed/cordis.patch.yml +3 -0
  243. package/example-plugins/packages/tui-overlay-themed/index.js +65 -0
  244. package/example-plugins/packages/tui-overlay-themed/package.json +25 -0
  245. package/example-plugins/packages/tui-ui-library/cordis.patch.yml +3 -0
  246. package/example-plugins/packages/tui-ui-library/index.js +73 -0
  247. package/example-plugins/packages/tui-ui-library/package.json +29 -0
  248. package/example-plugins/packages/web-page-branding/cordis.patch.yml +3 -0
  249. package/example-plugins/packages/web-page-branding/index.js +31 -0
  250. package/example-plugins/packages/web-page-branding/package.json +22 -0
  251. package/example-plugins/scenarios.json +11 -0
  252. package/index.js +384 -0
  253. package/lib/blend-apply.js +107 -0
  254. package/lib/blend-capture.js +249 -0
  255. package/lib/blend-ledger.js +76 -0
  256. package/lib/contract.js +5 -0
  257. package/lib/install.js +516 -0
  258. package/lib/lookup.js +67 -0
  259. package/lib/manifest.js +56 -0
  260. package/lib/pack-root.js +22 -0
  261. package/lib/provenance.js +110 -0
  262. package/lib/publish.js +64 -0
  263. package/lib/reconcile.js +83 -0
  264. package/lib/router.js +55 -0
  265. package/lib/scopes.js +82 -0
  266. package/lib/skills.js +54 -0
  267. package/lib/stage.js +157 -0
  268. package/lib/verify.js +77 -0
  269. package/package.json +58 -3
  270. package/scripts/lib/indexes.mjs +45 -0
  271. package/scripts/lib/manifest.mjs +127 -0
  272. package/scripts/lib/maps.mjs +482 -0
  273. package/skills/acryl-add-provider-or-capability/SKILL.md +12 -0
  274. package/skills/acryl-add-ui/SKILL.md +18 -0
  275. package/skills/acryl-build-plugin/SKILL.md +21 -0
  276. package/skills/acryl-change-plugin/SKILL.md +16 -0
  277. package/skills/acryl-desktop-shell/SKILL.md +12 -0
  278. package/skills/acryl-diagnose-plugin/SKILL.md +10 -0
  279. package/skills/acryl-fix-plugin/SKILL.md +12 -0
  280. package/skills/acryl-improve-ui/SKILL.md +10 -0
  281. package/skills/acryl-remove-plugin/SKILL.md +11 -0
  282. package/skills/acryl-restyle-ui/SKILL.md +14 -0
  283. package/skills/acryl-share-plugin/SKILL.md +23 -0
  284. package/skills/acryl-tui-ui/SKILL.md +12 -0
@@ -0,0 +1,489 @@
1
+ <!-- Synced from deepseek-harness:docs/subsystems/typert.md @ 639ed01539. Do not edit; run scripts/sync-corpus.mjs. Relative links inside may not resolve here. -->
2
+
3
+ # Typert remote calls
4
+
5
+ English | [中文](typert.zh.md)
6
+
7
+ 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).
8
+
9
+ ## Lookup and Context declarations
10
+
11
+ 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.
12
+
13
+ ```ts type-equiv
14
+ /** Merge-extensible Host object lookup declarations. */
15
+ interface TypertLookupMap {}
16
+ ```
17
+
18
+ ```ts type-equiv
19
+ /** Merge-extensible scoped Context declarations. */
20
+ interface TypertContextMap {}
21
+ ```
22
+
23
+ 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.
24
+
25
+ ```ts type-equiv
26
+ /** Stable wire declaration retained after a lookup provider unloads. */
27
+ interface TypertLookupDefinition {
28
+ /** Merge-declared lookup key. */
29
+ readonly key: string
30
+ /** Source parameter name recognized by the SRC weak parser. */
31
+ readonly parameter: string
32
+ /** Wire field replacing the Host object parameter. */
33
+ readonly wire: string
34
+ /** Canonical Host type symbol used by strict generation. */
35
+ readonly hostTypeSymbol: string
36
+ /** Canonical wire type symbol used by strict generation. */
37
+ readonly wireTypeSymbol: string
38
+ }
39
+ ```
40
+
41
+ ## Invocation descriptors
42
+
43
+ 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`.
44
+
45
+ ```ts type-equiv
46
+ /** Codec attached to one invocation parameter or result. */
47
+ type TypertCodec =
48
+ | {
49
+ readonly mode: 'strict'
50
+ readonly typeSymbol: string
51
+ /** Materialize and return the process-realm schema on first boundary use. */
52
+ readonly create: () => TypertSchema
53
+ /**
54
+ * Decode a unary result whose fields require type-specific handling.
55
+ * @param value - result reconstructed by the RPC carrier.
56
+ * @returns the validated result, retaining native byte views.
57
+ */
58
+ readonly decode?: (value: unknown) => unknown
59
+ /**
60
+ * Project typed binary fields into RPC result attachments.
61
+ * @param value - native unary result.
62
+ * @param writeBytes - records a byte view at its result-relative path and returns its JSON placeholder.
63
+ * @returns JSON metadata with untouched JSON subtrees retained.
64
+ */
65
+ readonly encode?: (value: unknown, writeBytes: (bytes: Uint8Array, path: readonly (string | number)[]) => null) => unknown
66
+ }
67
+ | {
68
+ readonly mode: 'src-json'
69
+ }
70
+ ```
71
+
72
+ ```ts type-equiv
73
+ /** One ordered business parameter in a Remote invocation. */
74
+ interface InvocationParameterDescriptor {
75
+ /** Source-level parameter name. */
76
+ readonly name: string
77
+ /** Required key in the wire `args` object. */
78
+ readonly wire: string
79
+ /** Whether the value is JSON or requires a registered Host lookup. */
80
+ readonly source: 'json' | 'lookup'
81
+ /** Lookup key when `source` is `lookup`. */
82
+ readonly lookup?: string
83
+ /** Boundary codec for the wire representation. */
84
+ readonly codec: TypertCodec
85
+ /** Missing wire fields decode to `undefined` only for an explicitly declared `T | undefined`. */
86
+ readonly acceptsUndefined?: true
87
+ }
88
+ ```
89
+
90
+ ```ts type-equiv
91
+ /** Carrier-independent description of one exported method invocation. */
92
+ interface InvocationDescriptor {
93
+ /** Globally stable generated identity. */
94
+ readonly id: string
95
+ /** Cordis service key owning the method. */
96
+ readonly service: string
97
+ /** Wire namespace, defaulting to the service key. */
98
+ readonly namespace: string
99
+ /** Public instance method name. */
100
+ readonly method: string
101
+ /** Service member invoked when the exported method name is an alias. */
102
+ readonly implementation?: string
103
+ /** Absent for unary calls; stream calls deliver every yielded item as the Host produced it. */
104
+ readonly mode?: 'stream'
105
+ /** Receiver selection mode. */
106
+ readonly invocation:
107
+ | { readonly kind: 'direct' }
108
+ | {
109
+ readonly kind: 'context'
110
+ readonly context: string
111
+ readonly wire: string
112
+ readonly codec: TypertCodec
113
+ }
114
+ /** Optional consuming-Context projection for one direct lookup parameter. */
115
+ readonly scope?: {
116
+ /** Context kind whose Client adapter supplies the identity. */
117
+ readonly context: string
118
+ /** Lookup parameter wire field replaced by the Context identity. */
119
+ readonly wire: string
120
+ }
121
+ /** Ordered business parameters. */
122
+ readonly parameters: readonly InvocationParameterDescriptor[]
123
+ /**
124
+ * Client-to-Host items of the same logical stream, generated from the `In`
125
+ * type argument of the method's `RemoteStream<Out, In>` return type; absent
126
+ * when `In` is `never`. The method reads the items through
127
+ * `RemoteInvocation.uplink()`, so nothing enters the parameter list.
128
+ */
129
+ readonly uplink?: {
130
+ /** Codec validating every uplink item before `uplink()` delivers it. */
131
+ readonly codec: TypertCodec
132
+ }
133
+ /** Transport cancellation injected after business parameters instead of entering wire args. */
134
+ readonly cancellation?: {
135
+ /** Reserved final Host method parameter. */
136
+ readonly parameter: 'signal'
137
+ }
138
+ /** Codec for the unary result or each yielded stream item. */
139
+ readonly result: TypertCodec
140
+ /** Source declaration used only for diagnostics. */
141
+ readonly sourceLocation?: InvocationSourceLocation
142
+ }
143
+ ```
144
+
145
+ The Host alias `RemoteStream<Out, In>` names both directions of one stream, and the receiving method reads its call context as `this.ctx.invocation`:
146
+
147
+ ```ts type-equiv
148
+ /**
149
+ * One Remote stream as a Host method returns it: the items it yields to the
150
+ * Client, iterated as a plain `AsyncIterable<Out>`. `In` is the type of the
151
+ * items the Client may send back on the same logical stream, read through
152
+ * `RemoteInvocation.uplink()`; it is carried only as a type-level marker. The
153
+ * default `never` declares a method that reads none, and its descriptor
154
+ * carries no uplink codec. A generated Client stream method returns the same
155
+ * stream as a `RemoteStreamHandle<Out, In>`.
156
+ * @template Out - item type the Host method yields.
157
+ * @template In - item type the Client may send; `never` when the method reads none.
158
+ */
159
+ type RemoteStream<Out, In = never> = AsyncIterable<Out> & { readonly [STREAM_UPLINK]?: In }
160
+ ```
161
+
162
+ ```ts type-equiv
163
+ /**
164
+ * One open Remote stream as the Client holds it: the downlink items as an
165
+ * `AsyncIterable`, plus the uplink and cancellation of the same logical
166
+ * stream. A generated Client stream method returns it, and calling that
167
+ * method opens the stream: a holder that neither iterates nor disposes the
168
+ * handle keeps the Host stream alive. A handle stands for one generation:
169
+ * when the carrier is lost, iteration fails with the carrier error and the
170
+ * handle is finished.
171
+ * @template Out - item type the Host method yields.
172
+ * @template In - item type the Client may send; `never` when the method reads none.
173
+ */
174
+ interface RemoteStreamHandle<Out, In> extends AsyncIterable<Out> {
175
+ /**
176
+ * Send one uplink item. Items sent before the stream has opened are queued
177
+ * and sent once the `open` frame is on the wire. A top-level `undefined`
178
+ * travels as an `item` frame without `value`.
179
+ * @param item - item the Host validates against the method's uplink codec.
180
+ * @throws {Error} when the item is not a lossless JSON value, when `end()`
181
+ * was called, or once the stream has terminated.
182
+ */
183
+ send(item: In): void
184
+ /** Half-close the uplink: the Host's `uplink()` iteration ends. Idempotent; ignored after termination. */
185
+ end(): void
186
+ /**
187
+ * Cancel the logical stream: send `cancel` unless a terminal frame has
188
+ * arrived, and end the downlink iterator quietly. Breaking out of
189
+ * `for await` early does the same.
190
+ */
191
+ dispose(): void
192
+ }
193
+ ```
194
+
195
+ ```ts type-equiv
196
+ /**
197
+ * One Peer's session on this Host. Connection owns it: `ctx` is the Cordis
198
+ * scope that owns connection-lifetime registrations and is disposed with the
199
+ * Peer. Who the Peer is and what it may do are not recorded here.
200
+ */
201
+ interface PeerScope {
202
+ readonly id: PeerId
203
+ readonly ctx: Context
204
+ /**
205
+ * Tear down every registration made through `ctx`.
206
+ * @returns settles once the scope has quiesced; racing calls share one completion.
207
+ */
208
+ dispose(): Promise<void>
209
+ }
210
+ ```
211
+
212
+ ```ts type-equiv
213
+ /**
214
+ * The context of one Remote call, reachable inside the receiving method as
215
+ * `this.ctx.invocation`. The Gateway derives the receiver from a Context that
216
+ * carries it, so no parameter is injected and nothing crosses the wire.
217
+ */
218
+ interface RemoteInvocation {
219
+ readonly request: {
220
+ readonly namespace: string
221
+ readonly method: string
222
+ readonly args: Readonly<Record<string, unknown>>
223
+ }
224
+ /** Cordis service key of the receiving Service. */
225
+ readonly service: string
226
+ /** Peer the call speaks for; an in-process carrier speaks for the operator. */
227
+ readonly peer: PeerScope
228
+ /** Carrier cancellation: Client cancel, socket close, or an uplink failure. */
229
+ readonly signal: AbortSignal
230
+ /**
231
+ * The Client's uplink items for this call. Available once; a second call
232
+ * throws. With an uplink codec on the descriptor every item is decoded to
233
+ * `In`; without one items arrive as `unknown` after a JSON-safety check.
234
+ * Iteration ends when the Client ends its uplink; when the method finishes
235
+ * its downlink the Gateway calls the iterator's `return()` and unread items
236
+ * are dropped. `In` is the caller's assertion: the runtime decodes by the
237
+ * descriptor and does not cross-check it.
238
+ * @template In - item type the caller reads; the descriptor codec decides what arrives.
239
+ * @returns the single-consumer uplink iterable.
240
+ */
241
+ uplink<In = unknown>(): AsyncIterable<In>
242
+ }
243
+ ```
244
+
245
+ ## Typert registry
246
+
247
+ `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.
248
+
249
+ ```ts type-equiv
250
+ /** Minimal Typert runtime consumed through dependency inversion. */
251
+ interface TypertRegistryContract {
252
+ readonly local: TypertLocalRegistry
253
+ readonly remotes: TypertRemoteRegistry
254
+ readonly lookups: TypertLookupRegistry
255
+ readonly contexts: TypertContextRegistry
256
+ }
257
+ ```
258
+
259
+ Generated consumer declarations merge direct namespaces into the map inherited by `TypertClientRemote`.
260
+
261
+ ```ts type-equiv
262
+ /** Merge-extensible direct namespace surface generated for Client Remote services. */
263
+ interface TypertRemoteNamespaceMap {}
264
+ ```
265
+
266
+ ## Host Gateway
267
+
268
+ 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`.
269
+
270
+ ```ts type-equiv
271
+ /** One Remote method request after a carrier has decoded its envelope. */
272
+ interface InvokeRemoteRequest {
273
+ /** Remote namespace selected by the generated descriptor. */
274
+ readonly namespace: string
275
+ /** Exported Service method name. */
276
+ readonly method: string
277
+ /** Named wire values; fields must exactly match the descriptor. */
278
+ readonly args: Readonly<Record<string, unknown>>
279
+ /**
280
+ * Client uplink items of this logical stream, delivered to the method through
281
+ * `invocation.uplink()`; absent means an immediately ended iterable.
282
+ */
283
+ readonly uplink?: AsyncIterable<unknown>
284
+ /** Peer the call speaks for; absent means an in-process carrier, answered as the operator. */
285
+ readonly peer?: PeerScope
286
+ /** Carrier or direct-caller cancellation injected only into cancellation-aware methods. */
287
+ readonly signal?: AbortSignal
288
+ }
289
+ ```
290
+
291
+ ```ts type-equiv
292
+ /** Stable infrastructure and boundary failures emitted before or after business execution. */
293
+ type TypertGatewayErrorCode =
294
+ | 'gateway/ambiguous-endpoint'
295
+ | 'gateway/arguments-invalid'
296
+ | 'gateway/binding-invalid'
297
+ | 'gateway/context-failed'
298
+ | 'gateway/context-not-found'
299
+ | 'gateway/context-unavailable'
300
+ | 'gateway/definition-unavailable'
301
+ | 'gateway/input-invalid'
302
+ | 'gateway/invocation-unavailable'
303
+ | 'gateway/lookup-failed'
304
+ | 'gateway/lookup-not-found'
305
+ | 'gateway/lookup-unavailable'
306
+ | 'gateway/method-unavailable'
307
+ | 'gateway/protocol'
308
+ | 'gateway/provider-mismatch'
309
+ | 'gateway/result-invalid'
310
+ | 'gateway/service-unavailable'
311
+ | 'gateway/signature-invalid'
312
+ | 'gateway/uplink-overflow'
313
+ ```
314
+
315
+ ```ts type-equiv
316
+ /** Host dispatcher consumed by Connection adapters. */
317
+ interface TypertGateway {
318
+ /** Carrier adapter shared by WebSocket and in-process transports. */
319
+ readonly wireStream: TypertGatewayWireStream
320
+ /**
321
+ * Check for an active Client event stream.
322
+ * @returns whether a stream is open and has not been cancelled.
323
+ */
324
+ hasLiveClient(): boolean
325
+ /**
326
+ * Register the application-selected forwarded-event source.
327
+ * @param source - stream factory installed by the Remote assembly.
328
+ * @param host - stable Host facts included in each Client generation's opening frame.
329
+ * @returns disposer removing this exact source and cancelling its active streams.
330
+ */
331
+ registerRemoteEvents(
332
+ source: TypertRemoteEventSource,
333
+ host: RemoteEventHostInfo,
334
+ ): () => Promise<void>
335
+ /**
336
+ * Invoke one live Remote method without assuming a carrier or response envelope.
337
+ * @param request - decoded endpoint and named wire arguments.
338
+ * @returns the business result without output decoding.
339
+ * @throws {@link TypertGatewayError} for dispatch, provider, or boundary failures; lookup-policy and business errors retain identity.
340
+ */
341
+ invoke(request: InvokeRemoteRequest): Promise<unknown>
342
+ /**
343
+ * Open one live stream Remote method without assuming a physical carrier.
344
+ * @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
345
+ * @returns a cancellation-aware iterable over the business results.
346
+ */
347
+ stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
348
+ }
349
+ ```
350
+
351
+ ## Consumer Remote
352
+
353
+ `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.
354
+
355
+ ```ts type-equiv
356
+ /** Client Remote capability implemented by the Gateway and consumed by Remote assemblies. */
357
+ interface TypertClientRemote extends TypertRemoteNamespaceMap {
358
+ /**
359
+ * Mount one generated Host-for-Client contribution in the caller's fiber.
360
+ * @param contribution - explicitly selected Remote package artifact.
361
+ * @returns disposer after namespace services and concrete methods are ready.
362
+ */
363
+ $mount(contribution: TypertRemoteContribution): Promise<TypertDisposer>
364
+ /**
365
+ * Subscribe to one forwarded Host event. Notifications run in registration
366
+ * order and isolate failures; scoped waterfalls return, delegate through
367
+ * `next()`, or reject the Host dispatch.
368
+ * @template Event - forwarded event name selected by the Host assembly.
369
+ * @param event - forwarded Host event name, unchanged on the wire.
370
+ * @param listener - receives the Client projection of the Cordis `Events` declaration.
371
+ * @returns disposer owned by the calling fiber.
372
+ */
373
+ $on<Event extends TypertRemoteEvent>(event: Event, listener: TypertClientEventListener<Event>): () => void
374
+ }
375
+ ```
376
+
377
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) - do not edit between markers -->
378
+
379
+ <a id="cordis-surface"></a>
380
+
381
+ ## Cordis API
382
+
383
+ 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).
384
+
385
+ <a id="ctxtypert--typertregistry"></a>
386
+
387
+ ### `ctx.typert` - `TypertRegistry`
388
+
389
+ Registry of generated schemas, package reflection, invocations, and Remote dependency providers.
390
+
391
+ ```ts cordis-catalog
392
+ /**
393
+ * Register one generated contribution atomically for the calling fiber.
394
+ * Duplicate package-face identities, schemas, invocation ids, or endpoints
395
+ * reject the whole batch.
396
+ * @param contribution - generated schemas, reflection, and Host invocations.
397
+ * @returns the exact effect disposer that removes this contribution.
398
+ */
399
+ register(contribution: TypertContribution): TypertDisposer
400
+
401
+ /**
402
+ * Look up one schema by `<package>#<name>`.
403
+ * @param key - global schema key.
404
+ * @returns a record containing the cached schema, or `undefined` when absent.
405
+ */
406
+ get(key: string): TypertSchemaRecord | undefined
407
+
408
+ /**
409
+ * Resolve one required schema.
410
+ * @param key - global schema key.
411
+ * @returns a record containing the cached schema.
412
+ * @throws when the key is malformed, the package face is absent, or the schema is not contributed.
413
+ */
414
+ resolve(key: string): TypertSchemaRecord
415
+
416
+ /**
417
+ * Enumerate live schemas in registration order.
418
+ * @param filter - optional package and face restriction.
419
+ * @returns matching records containing the cached schemas.
420
+ */
421
+ list(filter: TypertSchemaFilter = {}): TypertSchemaRecord[]
422
+
423
+ /**
424
+ * Look up generated reflection for one package face.
425
+ * @param packageName - exact npm package name.
426
+ * @param face - face to query; defaults to the host runtime.
427
+ * @returns the live package record, or `undefined` when absent.
428
+ */
429
+ getPackage(packageName: string, face: TypertFace = 'host'): TypertPackageRecord | undefined
430
+
431
+ /**
432
+ * Enumerate generated package reflection in registration order.
433
+ * @param filter - optional package and face restriction.
434
+ * @returns matching package records.
435
+ */
436
+ listPackages(filter: TypertPackageFilter = {}): TypertPackageRecord[]
437
+
438
+ /**
439
+ * Project a live Zod schema to JSON Schema without caching the result.
440
+ * @param key - global schema key.
441
+ * @param params - Zod projection parameters.
442
+ * @returns a fresh JSON Schema document.
443
+ */
444
+ toJSONSchema(key: string, params?: z.core.ToJSONSchemaParams): z.core.JSONSchema.BaseSchema
445
+ ```
446
+
447
+ Types: [TypertContribution](invariants.md) · [TypertFace](invariants.md) · [TypertPackageFilter](invariants.md) · [TypertPackageRecord](invariants.md) · [TypertSchemaFilter](invariants.md) · [TypertSchemaRecord](invariants.md)
448
+
449
+ Source: [`packages/typert/registry/src/service.ts`](../../packages/typert/registry/src/service.ts)
450
+
451
+ <a id="ctxtypertgateway--typertgatewayservice"></a>
452
+
453
+ ### `ctx.typertGateway` - `TypertGatewayService`
454
+
455
+ Resolve strict generated definitions or conservative SRC markers against current Cordis Services and Typert providers.
456
+
457
+ ```ts cordis-catalog
458
+ /**
459
+ * Check for an active Client event stream.
460
+ * @returns whether a stream is open and has not been cancelled.
461
+ */
462
+ hasLiveClient(): boolean
463
+
464
+ /**
465
+ * Register the sole application-selected forwarded-event source.
466
+ * @param source - stream factory installed by the Remote assembly.
467
+ * @param host - stable Host facts included in each Client generation's opening frame.
468
+ * @returns disposer removing this source and cancelling its active streams.
469
+ */
470
+ registerRemoteEvents( source: TypertRemoteEventSource, host: RemoteEventHostInfo, ): () => Promise<void>
471
+
472
+ /**
473
+ * Invoke one live Remote method through strict generated reflection or SRC markers.
474
+ * @param request - decoded endpoint and exact named wire arguments.
475
+ * @returns the business result without output decoding.
476
+ * @throws {@link TypertGatewayError} for dispatch, provider, or boundary failures; lookup-policy and business errors retain identity.
477
+ */
478
+ async invoke(request: InvokeRemoteRequest): Promise<unknown>
479
+
480
+ /**
481
+ * Open one live stream Remote method without assuming a physical carrier.
482
+ * @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
483
+ * @returns a cancellation-aware iterable over the business results.
484
+ */
485
+ async stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
486
+ ```
487
+
488
+ Source: [`packages/api/gateway/src/index.ts`](../../packages/api/gateway/src/index.ts)
489
+ <!-- END GENERATED cordis-surface -->