@@ -29,14 +29,6 @@ export type DispatchOutput =
2929 | { kind : 'notification' ; message : JSONRPCNotification }
3030 | { kind : 'response' ; message : JSONRPCResponse | JSONRPCErrorResponse } ;
3131
32- /**
33- * Envelope-agnostic output from {@linkcode Dispatcher.dispatchRaw}. No JSON-RPC `{jsonrpc, id}` wrapping.
34- */
35- export type RawDispatchOutput =
36- | { kind : 'notification' ; method : string ; params ?: Record < string , unknown > }
37- | { kind : 'result' ; result : Result }
38- | { kind : 'error' ; code : number ; message : string ; data ?: unknown } ;
39-
4032type RawHandler < ContextT > = ( request : JSONRPCRequest , ctx : ContextT ) => Promise < Result > ;
4133
4234/** Signature of {@linkcode Dispatcher.dispatch}. Target type for {@linkcode DispatchMiddleware}. */
@@ -191,31 +183,6 @@ export class Dispatcher<ContextT extends BaseContext = BaseContext> {
191183 yield { kind : 'response' , message : final ! } ;
192184 }
193185
194- /**
195- * Envelope-agnostic dispatch for non-JSON-RPC drivers (gRPC, protobuf, REST).
196- * Takes `{method, params}` directly and yields unwrapped notifications and a terminal
197- * result/error. The JSON-RPC `{jsonrpc, id}` envelope is synthesized internally so
198- * registered handlers (which receive `JSONRPCRequest`) work unchanged.
199- *
200- * @experimental Shape may change to align with SEP-1319 named param/result types.
201- */
202- async * dispatchRaw (
203- method : string ,
204- params : Record < string , unknown > | undefined ,
205- env : RequestEnv = { }
206- ) : AsyncGenerator < RawDispatchOutput , void , void > {
207- const synthetic : JSONRPCRequest = { jsonrpc : '2.0' , id : 0 , method, params } ;
208- for await ( const out of this . dispatch ( synthetic , env ) ) {
209- if ( out . kind === 'notification' ) {
210- yield { kind : 'notification' , method : out . message . method , params : out . message . params } ;
211- } else if ( 'result' in out . message ) {
212- yield { kind : 'result' , result : out . message . result } ;
213- } else {
214- yield { kind : 'error' , ...out . message . error } ;
215- }
216- }
217- }
218-
219186 /**
220187 * Dispatch one inbound notification to its handler. Errors are reported via the
221188 * returned promise; unknown methods are silently ignored.
0 commit comments