@adhd/apigen-engine-runtime 0.3.1 → 0.3.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.
@@ -6,4 +6,4 @@ import { Call as RuntimeCall, InvokeFn, InvokeOptions, LayerResult } from './inv
6
6
  * (`InvokeFn`, e.g. from `createPackageInvoker`) and a partial runtime `Call`
7
7
  * (minus `operation`/`ctx`, per the `TransportAdapter` contract).
8
8
  */
9
- export declare function dispatchForPlan(plan: OpPlan, invoke: InvokeFn, call: Omit<RuntimeCall, 'operation' | 'ctx'>, opts: InvokeOptions): Promise<LayerResult>;
9
+ export declare function dispatchForPlan(plan: OpPlan, invoke: InvokeFn, call: Omit<RuntimeCall, 'operation' | 'ctx' | 'transport'>, opts: InvokeOptions): Promise<LayerResult>;
package/lib/invoke.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ComposedSchemas } from './types';
2
- import { Operation } from '@adhd/apigen-core-client';
2
+ import { Operation, Transport } from '@adhd/apigen-core-client';
3
3
 
4
4
  /**
5
5
  * A symbol-keyed or constructor-keyed typed extension map. Each value is
@@ -37,6 +37,13 @@ export interface Call {
37
37
  domainArgs: Record<string, unknown>;
38
38
  /** Cancellation signal (AbortSignal) — §11. */
39
39
  signal?: AbortSignal;
40
+ /**
41
+ * The canonical transport this call arrived on. Stamped by `dispatchForPlan`
42
+ * from `plan.transport` (F3), so it is guaranteed present on every call a
43
+ * Layer observes — never optional, never a silent `undefined`. A Layer that
44
+ * needs the transport reads it here; it never hunts for it elsewhere.
45
+ */
46
+ transport: Transport;
40
47
  }
41
48
  /**
42
49
  * The primitive result a Layer or dispatch can return.
@@ -7,12 +7,12 @@ export interface TransportAdapter<Raw = unknown> {
7
7
  * transport's underlying server/CLI/router, wiring inbound requests to
8
8
  * `dispatch`. Called ONCE per `OpPlan`, at server/CLI wiring time.
9
9
  */
10
- registerRoute(plan: OpPlan, dispatch: (call: Omit<Call, 'operation' | 'ctx'>) => Promise<LayerResult>): void;
10
+ registerRoute(plan: OpPlan, dispatch: (call: Omit<Call, 'operation' | 'ctx' | 'transport'>) => Promise<LayerResult>): void;
11
11
  /**
12
12
  * Marshal the transport-native inbound request `raw` into the runtime
13
13
  * `Call` shape (minus `operation`/`ctx`, filled in by the dispatch path).
14
14
  */
15
- readCall(raw: Raw, plan: OpPlan): Omit<Call, 'operation' | 'ctx'> | Promise<Omit<Call, 'operation' | 'ctx'>>;
15
+ readCall(raw: Raw, plan: OpPlan): Omit<Call, 'operation' | 'ctx' | 'transport'> | Promise<Omit<Call, 'operation' | 'ctx' | 'transport'>>;
16
16
  /**
17
17
  * Marshal a resolved `LayerResult` (the value `dispatch`'s returned
18
18
  * Promise resolved to — F1) back onto the transport-native outbound
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhd/apigen-engine-runtime",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "dependencies": {
5
5
  "ajv": "^8.20.0",
6
6
  "ajv-formats": "2.1.1",