@copilotkit/runtime 1.51.2 → 1.51.3-next.0

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,5 +1,15 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.51.3-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d268c49: fix: add apiKey parameter to BuiltInAgentConfiguration
8
+ - Updated dependencies [d268c49]
9
+ - @copilotkitnext/agent@1.51.3-next.0
10
+ - @copilotkit/shared@1.51.3-next.0
11
+ - @copilotkitnext/runtime@1.51.3-next.0
12
+
3
13
  ## 1.51.2
4
14
 
5
15
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1304,6 +1304,20 @@ declare function createLogger(options?: {
1304
1304
  component?: string;
1305
1305
  }): createPinoLogger__default.Logger<never, boolean>;
1306
1306
 
1307
+ /**
1308
+ * CORS configuration for CopilotKit endpoints.
1309
+ */
1310
+ interface CopilotEndpointCorsConfig {
1311
+ /**
1312
+ * Allowed origin(s). Can be a string, array of strings, or a function that returns the origin.
1313
+ */
1314
+ origin: string | string[] | ((origin: string, c: any) => string | undefined | null);
1315
+ /**
1316
+ * Whether to include credentials (cookies, authorization headers) in CORS requests.
1317
+ * When true, origin cannot be "*" - must be an explicit origin.
1318
+ */
1319
+ credentials?: boolean;
1320
+ }
1307
1321
  declare const logger: createPinoLogger.Logger<never, boolean>;
1308
1322
  declare const addCustomHeaderPlugin: {
1309
1323
  onResponse({ response }: {
@@ -1325,6 +1339,11 @@ interface CreateCopilotRuntimeServerOptions {
1325
1339
  cloud?: CopilotCloudOptions;
1326
1340
  properties?: CopilotRequestContextProperties;
1327
1341
  logLevel?: LogLevel;
1342
+ /**
1343
+ * Optional CORS configuration. When not provided, defaults to allowing all origins without credentials.
1344
+ * To support HTTP-only cookies, provide cors config with credentials: true and explicit origin.
1345
+ */
1346
+ cors?: CopilotEndpointCorsConfig;
1328
1347
  }
1329
1348
  declare function createContext(initialContext: YogaInitialContext, copilotKitContext: CreateCopilotRuntimeServerOptions, contextLogger: typeof logger, properties?: CopilotRequestContextProperties): Promise<Partial<GraphQLContext>>;
1330
1349
  declare function buildSchema(options?: {
@@ -1492,4 +1511,4 @@ declare class UnknownErrorResponse extends FailedResponseStatus {
1492
1511
  });
1493
1512
  }
1494
1513
 
1495
- export { AnthropicAdapter, AnthropicAdapterParams, AnthropicPromptCachingConfig, BedrockAdapter, BedrockAdapterParams, CommonConfig, CopilotRequestContextProperties, CopilotRuntime, CopilotRuntimeChatCompletionRequest, CopilotRuntimeChatCompletionResponse, CopilotRuntimeConstructorParams_BASE, CopilotRuntimeLogger, CopilotServiceAdapter, CreateCopilotRuntimeServerOptions, CustomEventNames, EmptyAdapter, ExperimentalEmptyAdapter, ExperimentalOllamaAdapter, GoogleGenerativeAIAdapter, GraphQLContext, GroqAdapter, GroqAdapterParams, GuardrailsValidationFailureResponse, LangChainAdapter, LangGraphAgent, LangGraphHttpAgent, LogLevel, MCPClient, MCPEndpointConfig, MCPTool, MessageStreamInterruptedResponse, OpenAIAdapter, OpenAIAdapterParams, OpenAIAssistantAdapter, OpenAIAssistantAdapterParams, PredictStateTool, RemoteChain, RemoteChainParameters, TelemetryAgentRunner, TelemetryAgentRunnerConfig, TextMessageEvents, ToolCallEvents, UnifyAdapter, UnifyAdapterParams, UnknownErrorResponse, addCustomHeaderPlugin, buildSchema, config, convertMCPToolsToActions, convertServiceAdapterError, copilotKitEndpoint, copilotRuntimeNestEndpoint, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint, copilotRuntimeNodeExpressEndpoint, copilotRuntimeNodeHttpEndpoint, createContext, createLogger, extractParametersFromSchema, generateMcpToolInstructions, getCommonConfig, langGraphPlatformEndpoint, resolveEndpointType };
1514
+ export { AnthropicAdapter, AnthropicAdapterParams, AnthropicPromptCachingConfig, BedrockAdapter, BedrockAdapterParams, CommonConfig, CopilotEndpointCorsConfig, CopilotRequestContextProperties, CopilotRuntime, CopilotRuntimeChatCompletionRequest, CopilotRuntimeChatCompletionResponse, CopilotRuntimeConstructorParams_BASE, CopilotRuntimeLogger, CopilotServiceAdapter, CreateCopilotRuntimeServerOptions, CustomEventNames, EmptyAdapter, ExperimentalEmptyAdapter, ExperimentalOllamaAdapter, GoogleGenerativeAIAdapter, GraphQLContext, GroqAdapter, GroqAdapterParams, GuardrailsValidationFailureResponse, LangChainAdapter, LangGraphAgent, LangGraphHttpAgent, LogLevel, MCPClient, MCPEndpointConfig, MCPTool, MessageStreamInterruptedResponse, OpenAIAdapter, OpenAIAdapterParams, OpenAIAssistantAdapter, OpenAIAssistantAdapterParams, PredictStateTool, RemoteChain, RemoteChainParameters, TelemetryAgentRunner, TelemetryAgentRunnerConfig, TextMessageEvents, ToolCallEvents, UnifyAdapter, UnifyAdapterParams, UnknownErrorResponse, addCustomHeaderPlugin, buildSchema, config, convertMCPToolsToActions, convertServiceAdapterError, copilotKitEndpoint, copilotRuntimeNestEndpoint, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint, copilotRuntimeNodeExpressEndpoint, copilotRuntimeNodeHttpEndpoint, createContext, createLogger, extractParametersFromSchema, generateMcpToolInstructions, getCommonConfig, langGraphPlatformEndpoint, resolveEndpointType };
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ var require_package = __commonJS({
72
72
  publishConfig: {
73
73
  access: "public"
74
74
  },
75
- version: "1.51.2",
75
+ version: "1.51.3-next.0",
76
76
  sideEffects: false,
77
77
  main: "./dist/index.js",
78
78
  module: "./dist/index.mjs",
@@ -137,7 +137,7 @@ var require_package = __commonJS({
137
137
  graphql: "^16.8.1",
138
138
  "graphql-scalars": "^1.23.0",
139
139
  "graphql-yoga": "^5.3.1",
140
- hono: "^4.10.3",
140
+ hono: "^4.11.4",
141
141
  openai: "^4.85.1",
142
142
  "partial-json": "^0.1.7",
143
143
  pino: "^9.2.0",
@@ -4733,7 +4733,10 @@ function copilotRuntimeNextJSAppRouterEndpoint(options) {
4733
4733
  }
4734
4734
  const copilotRoute = runtime.createCopilotEndpointSingleRoute({
4735
4735
  runtime: options.runtime.instance,
4736
- basePath: options.baseUrl ?? options.endpoint
4736
+ basePath: options.baseUrl ?? options.endpoint,
4737
+ ...options.cors && {
4738
+ cors: options.cors
4739
+ }
4737
4740
  });
4738
4741
  const handleRequest = vercel.handle(copilotRoute);
4739
4742
  return {
@@ -4855,7 +4858,10 @@ function copilotRuntimeNodeHttpEndpoint(options) {
4855
4858
  }
4856
4859
  const honoApp = runtime.createCopilotEndpointSingleRoute({
4857
4860
  runtime: options.runtime.instance,
4858
- basePath: options.baseUrl ?? options.endpoint
4861
+ basePath: options.baseUrl ?? options.endpoint,
4862
+ ...options.cors && {
4863
+ cors: options.cors
4864
+ }
4859
4865
  });
4860
4866
  const handle2 = /* @__PURE__ */ __name(async function handler(req, res) {
4861
4867
  const url = getFullUrl(req);