@deepseek-ai/dsh-typert-protocol 0.1.3-alpha.2 → 0.1.5-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/typert/protocol/README.md
5
- README.md: ae18b92c162992eef5f860471e5e45543d8d2c88
6
- README.zh.md: 08f2146a269581cb8905c19488db8e37127399e4
5
+ README.md: 43147c2c2f1746ff0c806c0842b5dba65457775a
6
+ README.zh.md: 0633db1a9e95d9abda8131fec0f1cf659c484910
package/README.md CHANGED
@@ -46,7 +46,7 @@ Generation turns the method into a wire endpoint under the service's namespace;
46
46
 
47
47
  ### Associating Host objects and Contexts with wire identities
48
48
 
49
- Complex Host objects cannot cross the wire directly. A business package declares the association through the merge-extensible `TypertLookupMap` and `TypertContextMap`. Host and Client Context adapters both map `Context` to a wire identity and that identity back to `Context`; the Host adapter also owns the stable wire declaration. Host composition may override its synchronous or asynchronous resolver. A resolver that refuses on policy grounds throws `RemoteError` with its own code, which reaches the caller unchanged.
49
+ Complex Host objects cannot cross the wire directly. A business package declares the association through the merge-extensible `TypertLookupMap` and `TypertContextMap`. A Host Context adapter owns the stable wire declaration and resolves wire identities to live Contexts. A Client Context adapter maps in both directions because scoped calls originate from a Client Context and forwarded Host events resolve their explicit wire identity there. Host composition may override its synchronous or asynchronous resolver. A resolver that refuses on policy grounds throws `RemoteError` with its own code, which reaches the caller unchanged.
50
50
 
51
51
  ### Reporting and reading a Remote failure
52
52
 
package/README.zh.md CHANGED
@@ -46,7 +46,7 @@ export class GoalService extends TypertRemoteService {
46
46
 
47
47
  ### 把 Host 对象与 Context 关联到 wire identity
48
48
 
49
- 复杂的 Host 对象不能直接跨 wire 传输。业务包通过可合并扩展的 `TypertLookupMap` 与 `TypertContextMap` 声明关联。Host 与 Client Context adapter 都把 `Context` 映射为 wire identity,也把该 identity 映射回 `Context`;Host adapter 还拥有稳定 wire 声明。Host 组合可以覆盖其同步或异步 resolver。因策略而拒绝的 resolver 抛出带自有码的 `RemoteError`,该码原样到达调用方。
49
+ 复杂的 Host 对象不能直接跨 wire 传输。业务包通过可合并扩展的 `TypertLookupMap` 与 `TypertContextMap` 声明关联。Host Context adapter 拥有稳定 wire 声明,并把 wire identity 解析为活跃 Context。Client Context adapter 需要双向映射,因为作用域调用从 Client Context 发起,而转发的 Host 事件要在 Client 侧解析其显式 wire identity。Host 组合可以覆盖其同步或异步 resolver。因策略而拒绝的 resolver 抛出带自有码的 `RemoteError`,该码原样到达调用方。
50
50
 
51
51
  ### 报告与读取 Remote 失败
52
52
 
@@ -13,7 +13,7 @@ export { RemoteError, remoteErrorOf } from './remote-error.ts';
13
13
  * @returns whether the value can cross the shared RPC carrier unchanged.
14
14
  */
15
15
  export declare function isTypertRemoteSegment(value: string): boolean;
16
- export type { InvocationDescriptor, InvocationParameterDescriptor, InvocationSourceLocation, RemoteErrorCode, RemoteErrorDetailsMap, RemoteFailure, RemoteResult, TypertClientEventListener, TypertClientRemote, TypertClientContextAdapter, TypertCodec, TypertContext, TypertContextAdapter, TypertContextMap, TypertContextRegistry, TypertContextWire, TypertDisposer, TypertForwardableEvent, TypertForwardableEventEntry, TypertHostContextAdapter, TypertHostContextIdentity, TypertHostContextResolver, TypertLocalRegistry, TypertLookup, TypertLookupDefinition, TypertLookupHost, TypertLookupMap, TypertLookupProvider, TypertLookupResolver, TypertLookupRegistry, TypertLookupWire, TypertRemoteScopeApi, TypertRemoteScopeMap, TypertRemoteScopeNamespace, TypertRemoteContribution, TypertRemoteEvent, TypertRemoteEventSelection, TypertRemoteMap, TypertRemoteNamespace, TypertRemoteNamespaceMap, TypertRemoteRegistry, TypertRegistryChange, TypertRegistryListener, TypertSchema, TypertRegistryContract, } from './types.ts';
16
+ export type { InvocationDescriptor, InvocationParameterDescriptor, InvocationSourceLocation, RemoteErrorCode, RemoteErrorDetailsMap, RemoteFailure, RemoteResult, TypertClientEventListener, TypertClientRemote, TypertClientContextAdapter, TypertCodec, TypertContext, TypertContextMap, TypertContextRegistry, TypertContextWire, TypertDisposer, TypertForwardableEvent, TypertForwardableEventEntry, TypertHostContextAdapter, TypertHostContextResolver, TypertLocalRegistry, TypertLookup, TypertLookupDefinition, TypertLookupHost, TypertLookupMap, TypertLookupProvider, TypertLookupResolver, TypertLookupRegistry, TypertLookupWire, TypertRemoteScopeApi, TypertRemoteScopeMap, TypertRemoteScopeNamespace, TypertRemoteContribution, TypertRemoteEvent, TypertRemoteEventSelection, TypertRemoteMap, TypertRemoteNamespace, TypertRemoteNamespaceMap, TypertRemoteRegistry, TypertRegistryChange, TypertRegistryListener, TypertSchema, TypertRegistryContract, } from './types.ts';
17
17
  /** Options for an explicit Service-to-Gateway binding. */
18
18
  export interface TypertGatewayBindingOptions {
19
19
  /** Wire namespace; defaults to the Cordis service key. */
@@ -281,29 +281,19 @@ export interface TypertLookupDefinition {
281
281
  /** Canonical wire type symbol used by strict generation. */
282
282
  readonly wireTypeSymbol: string;
283
283
  }
284
- /** Bidirectional projection between one environment's Context and its wire identity. */
285
- export interface TypertContextAdapter<Wire = unknown> {
286
- /**
287
- * Read the identity represented by a live Context.
288
- * @param ctx - Context in this adapter's environment.
289
- * @returns the wire identity, or `undefined` when the Context has another kind.
290
- */
291
- identity(ctx: Context): Wire | undefined;
284
+ /** Host wire-to-Context resolver plus the declaration used by strict Remote methods. */
285
+ export interface TypertHostContextAdapter<Wire = unknown> {
286
+ /** Wire field carrying the Context identity. */
287
+ readonly wire: string;
288
+ /** Canonical wire type symbol used by strict generation. */
289
+ readonly wireTypeSymbol: string;
292
290
  /**
293
- * Resolve a wire identity to a live Context in this adapter's environment.
294
- * An asynchronous Client resolver may wait for its owner to create the Context.
291
+ * Resolve a validated wire identity to a live Host Context.
295
292
  * @param id - validated wire identity.
296
293
  * @returns the Context, or `undefined` when it is unavailable.
297
294
  */
298
295
  resolve(id: Wire): Context | undefined | Promise<Context | undefined>;
299
296
  }
300
- /** Host Context adapter plus the wire declaration used by strict Remote methods. */
301
- export interface TypertHostContextAdapter<Wire = unknown> extends TypertContextAdapter<Wire> {
302
- /** Wire field carrying the Context identity. */
303
- readonly wire: string;
304
- /** Canonical wire type symbol used by strict generation. */
305
- readonly wireTypeSymbol: string;
306
- }
307
297
  /** Composition-owned resolver replacing one Host Context adapter's default lookup policy. */
308
298
  export type TypertHostContextResolver<Wire = unknown> = (id: Wire) => Context | undefined | Promise<Context | undefined>;
309
299
  /** Client-side bidirectional Context adapter. */
@@ -321,13 +311,6 @@ export interface TypertClientContextAdapter<Wire = unknown> {
321
311
  */
322
312
  resolve(id: Wire): Context | undefined;
323
313
  }
324
- /** Host Context identity selected from the registered adapter set. */
325
- export interface TypertHostContextIdentity {
326
- /** Merge-declared Context kind whose adapter recognized the Context. */
327
- readonly kind: string;
328
- /** Wire identity returned by that adapter. */
329
- readonly identity: unknown;
330
- }
331
314
  /** Notification emitted after a Typert runtime registry changes. */
332
315
  export interface TypertRegistryChange {
333
316
  readonly kind: 'local' | 'remote' | 'lookup' | 'host-context' | 'client-context';
@@ -420,7 +403,7 @@ export interface TypertContextRegistry {
420
403
  /**
421
404
  * Register a Host Context adapter.
422
405
  * @param key - merge-declared Context key.
423
- * @param adapter - owning package's bidirectional Host projection.
406
+ * @param adapter - owning package's Host resolver and wire declaration.
424
407
  * @returns disposer withdrawing the exact adapter.
425
408
  */
426
409
  registerHost<K extends StringKeyOf<TypertContextMap>>(key: K, adapter: TypertHostContextAdapter<TypertContextWire<TypertContextMap[K]>>): TypertDisposer;
@@ -439,13 +422,6 @@ export interface TypertContextRegistry {
439
422
  * @returns disposer withdrawing the exact adapter.
440
423
  */
441
424
  registerClient<K extends StringKeyOf<TypertContextMap>>(key: K, adapter: TypertClientContextAdapter<TypertContextWire<TypertContextMap[K]>>): TypertDisposer;
442
- /**
443
- * Identify a live Host Context through the sole registered adapter set.
444
- * @param ctx - Context projected by a Host-to-Client scoped event.
445
- * @returns its kind and wire identity, or `undefined` when no adapter recognizes it.
446
- * @throws when more than one Context kind recognizes the same Context.
447
- */
448
- identifyHost(ctx: Context): TypertHostContextIdentity | undefined;
449
425
  /**
450
426
  * Look up a Host Context adapter.
451
427
  * @param key - descriptor Context key.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-typert-protocol",
3
3
  "description": "Compiler-independent Remote metadata and Typert provider protocols",
4
- "version": "0.1.3-alpha.2",
4
+ "version": "0.1.5-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },