@copilotkit/runtime 0.0.0-fix-restore-handle-method-node-http-20251222114321 → 0.0.0-fix-restore-handle-method-node-http-20260105204107

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/CHANGELOG.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @copilotkit/runtime
2
2
 
3
- ## 0.0.0-fix-restore-handle-method-node-http-20251222114321
3
+ ## 0.0.0-fix-restore-handle-method-node-http-20260105204107
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 6951073: fix: use direct hono node integration on node-http integration
8
- - @copilotkit/shared@0.0.0-fix-restore-handle-method-node-http-20251222114321
8
+ - @copilotkit/shared@0.0.0-fix-restore-handle-method-node-http-20260105204107
9
9
 
10
10
  ## 1.50.1
11
11
 
package/dist/index.d.ts CHANGED
@@ -11,7 +11,8 @@ import * as pino from 'pino';
11
11
  import { YogaInitialContext, createYoga } from 'graphql-yoga';
12
12
  import { CopilotRuntimeOptions, CopilotRuntime as CopilotRuntime$1, AgentRunner } from '@copilotkitnext/runtime';
13
13
  import { AbstractAgent } from '@ag-ui/client';
14
- import * as hono_dist_types_context from 'hono/dist/types/context';
14
+ import * as http from 'http';
15
+ import { IncomingMessage, ServerResponse } from 'node:http';
15
16
 
16
17
  declare enum MessageRole {
17
18
  assistant = "assistant",
@@ -1349,13 +1350,13 @@ declare const config: {
1349
1350
  };
1350
1351
  };
1351
1352
 
1352
- declare function copilotRuntimeNextJSPagesRouterEndpoint(options: CreateCopilotRuntimeServerOptions): (request: Request, Env?: unknown, executionCtx?: hono_dist_types_context.ExecutionContext) => Response | Promise<Response>;
1353
+ declare function copilotRuntimeNextJSPagesRouterEndpoint(options: CreateCopilotRuntimeServerOptions): (reqOrRequest: http.IncomingMessage | Request, res?: http.ServerResponse) => Promise<void> | Promise<Response> | Response;
1353
1354
 
1354
- declare function copilotRuntimeNodeHttpEndpoint(options: CreateCopilotRuntimeServerOptions): (request: Request, Env?: unknown, executionCtx?: hono_dist_types_context.ExecutionContext) => Response | Promise<Response>;
1355
+ declare function copilotRuntimeNodeHttpEndpoint(options: CreateCopilotRuntimeServerOptions): (reqOrRequest: IncomingMessage | Request, res?: ServerResponse) => Promise<void> | Promise<Response> | Response;
1355
1356
 
1356
- declare function copilotRuntimeNodeExpressEndpoint(options: CreateCopilotRuntimeServerOptions): (request: Request, Env?: unknown, executionCtx?: hono_dist_types_context.ExecutionContext) => Response | Promise<Response>;
1357
+ declare function copilotRuntimeNodeExpressEndpoint(options: CreateCopilotRuntimeServerOptions): (reqOrRequest: http.IncomingMessage | Request, res?: http.ServerResponse) => Promise<void> | Promise<Response> | Response;
1357
1358
 
1358
- declare function copilotRuntimeNestEndpoint(options: CreateCopilotRuntimeServerOptions): (request: Request, Env?: unknown, executionCtx?: hono_dist_types_context.ExecutionContext) => Response | Promise<Response>;
1359
+ declare function copilotRuntimeNestEndpoint(options: CreateCopilotRuntimeServerOptions): (reqOrRequest: http.IncomingMessage | Request, res?: http.ServerResponse) => Promise<void> | Promise<Response> | Response;
1359
1360
 
1360
1361
  /**
1361
1362
  * TelemetryAgentRunner - A wrapper around AgentRunner that adds telemetry
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ var pluginDeferStream = require('@graphql-yoga/plugin-defer-stream');
17
17
  var createPinoLogger = require('pino');
18
18
  var pretty = require('pino-pretty');
19
19
  var vercel = require('hono/vercel');
20
+ var nodeServer = require('@hono/node-server');
20
21
 
21
22
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
22
23
 
@@ -4760,7 +4761,16 @@ function copilotRuntimeNodeHttpEndpoint(options) {
4760
4761
  runtime: options.runtime.instance,
4761
4762
  basePath: options.baseUrl ?? options.endpoint
4762
4763
  });
4763
- return honoApp.fetch;
4764
+ const handle2 = nodeServer.getRequestListener(honoApp.fetch);
4765
+ return function(reqOrRequest, res) {
4766
+ if (reqOrRequest instanceof Request) {
4767
+ return honoApp.fetch(reqOrRequest);
4768
+ }
4769
+ if (!res) {
4770
+ throw new TypeError("ServerResponse is required for Node HTTP requests");
4771
+ }
4772
+ return handle2(reqOrRequest, res);
4773
+ };
4764
4774
  }
4765
4775
  __name(copilotRuntimeNodeHttpEndpoint, "copilotRuntimeNodeHttpEndpoint");
4766
4776