@@ -20,7 +20,7 @@ import {
20
20
loggerMiddleware ,
21
21
} from "@/common/router" ;
22
22
import { deconstructError , noopNext } from "@/common/utils" ;
23
- import { HEADER_ACTOR_ID } from "@/driver-helpers/mod" ;
23
+ import { ActorDriver , HEADER_ACTOR_ID } from "@/driver-helpers/mod" ;
24
24
import type {
25
25
TestInlineDriverCallRequest ,
26
26
TestInlineDriverCallResponse ,
@@ -54,10 +54,10 @@ function buildOpenApiResponses<T>(schema: T, validateBody: boolean) {
54
54
description : "Success" ,
55
55
content : validateBody
56
56
? {
57
- "application/json" : {
58
- schema,
59
- } ,
60
- }
57
+ "application/json" : {
58
+ schema,
59
+ } ,
60
+ }
61
61
: { } ,
62
62
} ,
63
63
400 : {
@@ -73,6 +73,7 @@ export function createManagerRouter(
73
73
registryConfig : RegistryConfig ,
74
74
runConfig : RunConfig ,
75
75
managerDriver : ManagerDriver ,
76
+ actorDriver : ActorDriver | undefined ,
76
77
validateBody : boolean ,
77
78
) : { router : Hono ; openapi : OpenAPIHono } {
78
79
const router = new OpenAPIHono ( { strict : false } ) . basePath (
@@ -151,6 +152,7 @@ export function createManagerRouter(
151
152
method : c . req . raw . method ,
152
153
headers : proxyHeaders ,
153
154
body : c . req . raw . body ,
155
+ duplex : "half" ,
154
156
signal : c . req . raw . signal ,
155
157
} ) ;
156
158
@@ -211,10 +213,10 @@ export function createManagerRouter(
211
213
body : {
212
214
content : validateBody
213
215
? {
214
- "application/json" : {
215
- schema : ActorsGetOrCreateByIdRequestSchema ,
216
- } ,
217
- }
216
+ "application/json" : {
217
+ schema : ActorsGetOrCreateByIdRequestSchema ,
218
+ } ,
219
+ }
218
220
: { } ,
219
221
} ,
220
222
} ,
@@ -323,10 +325,10 @@ export function createManagerRouter(
323
325
body : {
324
326
content : validateBody
325
327
? {
326
- "application/json" : {
327
- schema : ActorsCreateRequestSchema ,
328
- } ,
329
- }
328
+ "application/json" : {
329
+ schema : ActorsCreateRequestSchema ,
330
+ } ,
331
+ }
330
332
: { } ,
331
333
} ,
332
334
} ,
@@ -500,6 +502,7 @@ export function createManagerRouter(
500
502
method : c . req . method ,
501
503
headers : c . req . raw . headers ,
502
504
body : c . req . raw . body ,
505
+ duplex : "half" ,
503
506
} ) ,
504
507
) ;
505
508
@@ -532,6 +535,8 @@ export function createManagerRouter(
532
535
router as unknown as Hono ,
533
536
) ;
534
537
538
+ actorDriver ?. modifyManagerRouter ?.( router as unknown as Hono , cors ) ;
539
+
535
540
if ( runConfig . inspector ?. enabled ) {
536
541
if ( ! managerDriver . inspector ) {
537
542
throw new Unsupported ( "inspector" ) ;
@@ -598,9 +603,9 @@ async function createTestWebSocketProxy(
598
603
onOpen : ( _evt , serverWs ) => {
599
604
serverWs . close ( 1011 , "Failed to establish connection" ) ;
600
605
} ,
601
- onMessage : ( ) => { } ,
602
- onError : ( ) => { } ,
603
- onClose : ( ) => { } ,
606
+ onMessage : ( ) => { } ,
607
+ onError : ( ) => { } ,
608
+ onClose : ( ) => { } ,
604
609
} ;
605
610
}
606
611
0 commit comments