docs(typert): label the note's illustrative fences as text

The eight snippets in this note are before/after sketches: two import the
Remote source modules this change deletes, and the rest are fragments without
their surrounding context. They were never type-checked, yet each one counted
against the repository-wide opt-out ratio, which now sits above the 50% ceiling
that `doc-typecheck:contracts-ready` enforces.

Label them as text so the ceiling reflects blocks that could be checked.
This commit is contained in:
imccyu committed 2026-10-13 00:53:00 +08:00
1 parent d4d904bc4f
commit e6278de7cc
2 files changed
+16 -16

No files matched your search

@@ -66,7 +66,7 @@ The old examples are historical comparisons of source-export consumers in the de
**Operation owner and strict Host.** Preserve the business signature; leave generated registration to ordinary Typert Loader instead of the Service constructor.
```ts ignore-check
```text
// Old source delivery.
import { TYPERT_REMOTE } from './remote.generated.ts'
// Constructor: super(ctx, 'sessionController', { namespace: 'session', definitions: TYPERT_REMOTE })
@@ -85,7 +85,7 @@ page(request: SessionPageRequest, signal: AbortSignal): Promise<SessionPage> {
**Browser and Node invocation.** A source-export consumer changes `/remote-source` to `/remote`; existing ordinary consumers already use this path. The live Context mounts once, without separate Registry registration.
```ts ignore-check
```text
import { TYPERT_REMOTE } from '@deepseek-ai/dsh-api-session-controller/remote'
await ctx.remote.$mount(TYPERT_REMOTE)
const result = await ctx.remote.session.page(request, signal)
@@ -99,13 +99,13 @@ try {
**Offline CLI and framework metadata.** The old selection reads a source table; the replacement reads the profile-owned Registry before target discovery. The two snippets are alternatives, not simultaneous declarations.
```ts ignore-check
```text
// Old selection.
import { REMOTE_METHODS } from '@deepseek-ai/dsh-api-session-controller/remote-source'
const page = REMOTE_METHODS['session/page']
```
```ts ignore-check
```text
// Metadata plugin: inject: ['typert']; no Gateway, Connection, or Host controller.
import { TYPERT_REMOTE } from '@deepseek-ai/dsh-api-session-controller/remote'
import { isTypertRemoteMethod } from '@deepseek-ai/dsh-typert-protocol/remote-info'
@@ -120,7 +120,7 @@ The registration belongs to that plugin's fiber. Help uses `description` and `in
**CLI input and dispatch.** After local `current` resolution and attachment preparation, either metadata access path uses the same invocation sequence:
```ts ignore-check
```text
if (page.mode === 'stream') throw new Error('session/page must be unary')
const input = page.input({ strict: true })
const arguments_ = input.create().parse(raw)
@@ -131,7 +131,7 @@ const output = page.result.create().parse(result.value)
**MCP discovery and calls.** Selection validates tool-specific requirements; generation itself does not require them.
```ts ignore-check
```text
const input = page.input({ strict: true })
if (!page.description) throw new Error('session/page has no tool description')
if (input.jsonSchema === undefined) throw new Error('session/page has no supported tool input schema')
@@ -147,13 +147,13 @@ This compact object shows only the metadata dependency. The real MCP adapter ret
**Native tools.** Query `ctx.typert.local.get('session/page')` and narrow it with `isTypertRemoteMethod` instead of reading the source table. Native tools can select `method.input({ strict: true })` for matching parsing and input projection. Native registration still requires supported input and result projections, including core Tool's mandatory `output.schema`; optional MCP output projection is not sufficient here. Once the facade obtains a typed request, both designs execute the same local call:
```ts ignore-check
```text
const value = await ctx.sessionController.page(request, signal)
```
**Independent consumers.** Read the ordinary info instance's typed index; no Registry is required:
```ts ignore-check
```text
import { TYPERT_REMOTE } from '@deepseek-ai/dsh-api-session-controller/remote'
const page = TYPERT_REMOTE.methods['session/page']
const arguments_ = page.input().create().parse(raw)
@@ -66,7 +66,7 @@ Host 元数据就绪仍由组合负责。要求严格校验的 Host 必须等待
**操作拥有者与严格 Host。** 保留业务签名;将生成定义注册交给普通 Typert Loader,而非 Service 构造函数。
```ts ignore-check
```text
// Old source delivery.
import { TYPERT_REMOTE } from './remote.generated.ts'
// Constructor: super(ctx, 'sessionController', { namespace: 'session', definitions: TYPERT_REMOTE })
@@ -85,7 +85,7 @@ page(request: SessionPageRequest, signal: AbortSignal): Promise<SessionPage> {
**Browser 与 Node 调用。** 源码导出消费方将 `/remote-source` 改为 `/remote`;已有普通消费方本来就使用此路径。实际调用 Context 挂载一次,不额外向 Registry 注册。
```ts ignore-check
```text
import { TYPERT_REMOTE } from '@deepseek-ai/dsh-api-session-controller/remote'
await ctx.remote.$mount(TYPERT_REMOTE)
const result = await ctx.remote.session.page(request, signal)
@@ -99,13 +99,13 @@ try {
**离线 CLI 与框架元数据。** 旧选择读取源码方法表;替代方式在目标发现之前读取 profile 拥有的 Registry。两个片段是不同选择,不是同时声明。
```ts ignore-check
```text
// Old selection.
import { REMOTE_METHODS } from '@deepseek-ai/dsh-api-session-controller/remote-source'
const page = REMOTE_METHODS['session/page']
```
```ts ignore-check
```text
// Metadata plugin: inject: ['typert']; no Gateway, Connection, or Host controller.
import { TYPERT_REMOTE } from '@deepseek-ai/dsh-api-session-controller/remote'
import { isTypertRemoteMethod } from '@deepseek-ai/dsh-typert-protocol/remote-info'
@@ -120,7 +120,7 @@ if (page === undefined || !isTypertRemoteMethod(page)) {
**CLI 输入与分发。** 本地 `current` 解析和附件准备之后,两种元数据访问方式使用同样的调用步骤:
```ts ignore-check
```text
if (page.mode === 'stream') throw new Error('session/page must be unary')
const input = page.input({ strict: true })
const arguments_ = input.create().parse(raw)
@@ -131,7 +131,7 @@ const output = page.result.create().parse(result.value)
**MCP 发现与调用。** 选择时验证工具特有要求;生成过程本身不要求它们。
```ts ignore-check
```text
const input = page.input({ strict: true })
if (!page.description) throw new Error('session/page has no tool description')
if (input.jsonSchema === undefined) throw new Error('session/page has no supported tool input schema')
@@ -147,13 +147,13 @@ const tool = {
**原生工具。** 查询 `ctx.typert.local.get('session/page')`,并用 `isTypertRemoteMethod` 收窄,而非读取源码方法表。原生工具可以选择 `method.input({ strict: true })`,取得匹配的解析与输入投影。原生注册仍要求受支持的输入与结果投影,包括 core Tool 必需的 `output.schema`;MCP 的可选输出投影在这里并不足够。facade 取得类型化请求后,两种设计执行同样的本地调用:
```ts ignore-check
```text
const value = await ctx.sessionController.page(request, signal)
```
**独立消费方。** 读取普通 info 实例的类型化索引,不要求 Registry:
```ts ignore-check
```text
import { TYPERT_REMOTE } from '@deepseek-ai/dsh-api-session-controller/remote'
const page = TYPERT_REMOTE.methods['session/page']
const arguments_ = page.input().create().parse(raw)