File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,6 @@ import {
1919// Export Durable Object
2020export { MessageDebouncer } from "./durable-objects/message-debouncer" ;
2121
22- // WorkerEntrypoint for RPC calls from other workers
23- export class InteractionService extends WorkerEntrypoint < WorkerEnv > {
24- async handleAgentCompletion ( input : AgentCompletionInput ) : Promise < void > {
25- const db = createDatabaseClient ( this . env ) ;
26- await processAgentCompletion ( input , db , this . env ) ;
27- }
28- }
29-
3022const app = new Hono < App > ( ) ;
3123
3224// Middleware
@@ -158,4 +150,14 @@ app.post("/", async (c) => {
158150app . onError ( withOnError < App > ( ) ) ;
159151app . notFound ( withNotFound < App > ( ) ) ;
160152
161- export default app ;
153+ // Default export: WorkerEntrypoint class for both HTTP and RPC
154+ export default class extends WorkerEntrypoint < WorkerEnv > {
155+ async fetch ( request : Request ) : Promise < Response > {
156+ return app . fetch ( request , this . env , this . ctx ) ;
157+ }
158+
159+ async handleAgentCompletion ( input : AgentCompletionInput ) : Promise < void > {
160+ const db = createDatabaseClient ( this . env ) ;
161+ await processAgentCompletion ( input , db , this . env ) ;
162+ }
163+ }
Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ export default defineWorkersProject({
3636 ) ,
3737 } ,
3838 } ,
39+ serviceBindings : {
40+ EXECUTION_WORKER : {
41+ scriptPath : resolve (
42+ __dirname ,
43+ "../execution-worker/src/index.ts" ,
44+ ) ,
45+ } ,
46+ } ,
3947 hyperdrives : {
4048 HYPERDRIVE :
4149 process . env . DATABASE_URL ||
You can’t perform that action at this time.
0 commit comments