@copilotkit/runtime 0.0.0-max-changeset-20260109200053 → 0.0.0-max-umd-20260122170341

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,16 +1,137 @@
1
1
  # @copilotkit/runtime
2
2
 
3
- ## 0.0.0-max-changeset-20260109200053
3
+ ## 0.0.0-max-umd-20260122170341
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 4fb8075: fix: restore and fix handle method in node http
8
- - 6da0e74: Update versioning strategy
9
- - 4fb8075: fix: use direct hono node integration on node-http integration
10
- - Updated dependencies [6da0e74]
11
- - @copilotkitnext/runtime@0.0.0-max-changeset-20260109200053
12
- - @copilotkit/shared@0.0.0-max-changeset-20260109200053
13
- - @copilotkitnext/agent@0.0.0-max-changeset-20260109200053
7
+ - d268c49: fix: add apiKey parameter to BuiltInAgentConfiguration
8
+ - 7f437ba: Add UMD export
9
+ - Updated dependencies [d268c49]
10
+ - Updated dependencies [7f437ba]
11
+ - Updated dependencies [29d70a5]
12
+ - @copilotkitnext/agent@0.0.0-max-umd-20260122170341
13
+ - @copilotkitnext/runtime@0.0.0-max-umd-20260122170341
14
+ - @copilotkit/shared@0.0.0-max-umd-20260122170341
15
+
16
+ ## 1.51.3-next.2
17
+
18
+ ### Patch Changes
19
+
20
+ - @copilotkit/shared@1.51.3-next.2
21
+ - @copilotkitnext/agent@1.51.3-next.2
22
+ - @copilotkitnext/runtime@1.51.3-next.2
23
+
24
+ ## 1.51.3-next.1
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [29d70a5]
29
+ - @copilotkitnext/agent@1.51.3-next.1
30
+ - @copilotkit/shared@1.51.3-next.1
31
+ - @copilotkitnext/runtime@1.51.3-next.1
32
+
33
+ ## 1.51.3-next.0
34
+
35
+ ### Patch Changes
36
+
37
+ - d268c49: fix: add apiKey parameter to BuiltInAgentConfiguration
38
+ - Updated dependencies [d268c49]
39
+ - @copilotkitnext/agent@1.51.3-next.0
40
+ - @copilotkit/shared@1.51.3-next.0
41
+ - @copilotkitnext/runtime@1.51.3-next.0
42
+
43
+ ## 1.51.2
44
+
45
+ ### Patch Changes
46
+
47
+ - e59d23f: Use deps instead of peerdeps
48
+ - e59d23f: Move in-repo deps from peerdeps to actual deps
49
+ - Updated dependencies [e59d23f]
50
+ - Updated dependencies [f36b6b1]
51
+ - @copilotkitnext/runtime@1.51.2
52
+ - @copilotkitnext/agent@1.51.2
53
+ - @copilotkit/shared@1.51.2
54
+
55
+ ## 1.51.2-next.1
56
+
57
+ ### Patch Changes
58
+
59
+ - e59d23f: Use deps instead of peerdeps
60
+ - e59d23f: Move in-repo deps from peerdeps to actual deps
61
+ - Updated dependencies [e59d23f]
62
+ - @copilotkitnext/runtime@1.51.2-next.1
63
+ - @copilotkitnext/agent@1.51.2-next.1
64
+ - @copilotkit/shared@1.51.2-next.1
65
+
66
+ ## 1.51.2-next.0
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [f36b6b1]
71
+ - @copilotkitnext/agent@1.51.2-next.0
72
+ - @copilotkit/shared@1.51.2-next.0
73
+ - @copilotkitnext/runtime@1.51.2-next.0
74
+
75
+ ## 1.51.1
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [329653b]
80
+ - @copilotkitnext/agent@1.51.1
81
+ - @copilotkit/shared@1.51.1
82
+ - @copilotkitnext/runtime@1.51.1
83
+
84
+ ## 1.51.0
85
+
86
+ ### Patch Changes
87
+
88
+ - 2839a15: fix: restore and fix handle method in node http
89
+ - 2839a15: Update versioning strategy
90
+ - 2839a15: fix: use direct hono node integration on node-http integration
91
+ - 4addb72: Fix ci again but really for real this time
92
+ - Updated dependencies [2793a11]
93
+ - Updated dependencies [73f196f]
94
+ - Updated dependencies [2839a15]
95
+ - Updated dependencies [2afd4e3]
96
+ - @copilotkitnext/runtime@1.51.0
97
+ - @copilotkit/shared@1.51.0
98
+ - @copilotkitnext/agent@1.51.0
99
+
100
+ ## 1.51.0-next.4
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [2793a11]
105
+ - @copilotkitnext/runtime@1.51.0-next.4
106
+ - @copilotkit/shared@1.51.0-next.4
107
+ - @copilotkitnext/agent@1.51.0-next.4
108
+
109
+ ## 1.51.0-next.3
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [73f196f]
114
+ - @copilotkitnext/runtime@1.51.0-next.3
115
+ - @copilotkit/shared@1.51.0-next.3
116
+ - @copilotkitnext/agent@1.51.0-next.3
117
+
118
+ ## 1.51.0-next.2
119
+
120
+ ### Patch Changes
121
+
122
+ - 4addb72: Fix ci again but really for real this time
123
+ - Updated dependencies [2afd4e3]
124
+ - @copilotkit/shared@1.51.0-next.2
125
+ - @copilotkitnext/agent@1.51.0-next.2
126
+ - @copilotkitnext/runtime@1.51.0-next.2
127
+
128
+ ## 1.51.0-next.1
129
+
130
+ ### Patch Changes
131
+
132
+ - @copilotkit/shared@1.51.0-next.1
133
+ - @copilotkitnext/agent@1.51.0-next.1
134
+ - @copilotkitnext/runtime@1.51.0-next.1
14
135
 
15
136
  ## 1.50.2-next.0
16
137
 
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.50.2-next.0",
75
+ version: "1.51.3-next.2",
76
76
  sideEffects: false,
77
77
  main: "./dist/index.js",
78
78
  module: "./dist/index.mjs",
@@ -80,23 +80,28 @@ var require_package = __commonJS({
80
80
  ".": {
81
81
  import: "./dist/index.mjs",
82
82
  require: "./dist/index.js",
83
- types: "./dist/index.d.ts"
83
+ types: "./dist/index.d.ts",
84
+ umd: "./dist/index.umd.js"
84
85
  },
85
86
  "./v2": {
86
87
  import: "./dist/v2/index.mjs",
87
88
  require: "./dist/v2/index.js",
88
- types: "./dist/v2/index.d.ts"
89
+ types: "./dist/v2/index.d.ts",
90
+ umd: "./dist/v2/index.umd.js"
89
91
  },
90
92
  "./langgraph": {
91
93
  import: "./dist/langgraph.mjs",
92
94
  require: "./dist/langgraph.js",
93
- types: "./dist/langgraph.d.ts"
95
+ types: "./dist/langgraph.d.ts",
96
+ umd: "./dist/langgraph.umd.js"
94
97
  }
95
98
  },
99
+ unpkg: "./dist/index.umd.js",
100
+ jsdelivr: "./dist/index.umd.js",
96
101
  types: "./dist/index.d.ts",
97
102
  license: "MIT",
98
103
  scripts: {
99
- build: "pnpm run generate-graphql-schema && tsup",
104
+ build: "pnpm run generate-graphql-schema && tsup && rollup -c rollup.config.mjs",
100
105
  dev: 'tsup --watch --onSuccess "pnpm run generate-graphql-schema"',
101
106
  test: "jest --passWithNoTests",
102
107
  "check-types": "tsc --noEmit",
@@ -106,9 +111,6 @@ var require_package = __commonJS({
106
111
  "unlink:global": "pnpm unlink --global"
107
112
  },
108
113
  devDependencies: {
109
- "@copilotkit/shared": "workspace:*",
110
- "@copilotkitnext/agent": "workspace:*",
111
- "@copilotkitnext/runtime": "workspace:*",
112
114
  "@jest/globals": "^29.7.0",
113
115
  "@swc/core": "1.5.28",
114
116
  "@types/jest": "^29.5.12",
@@ -126,6 +128,12 @@ var require_package = __commonJS({
126
128
  vitest: "^3.2.4"
127
129
  },
128
130
  dependencies: {
131
+ "@ag-ui/client": "^0.0.42",
132
+ "@ag-ui/core": "^0.0.42",
133
+ "@ag-ui/langgraph": "^0.0.20",
134
+ "@copilotkit/shared": "workspace:*",
135
+ "@copilotkitnext/agent": "workspace:*",
136
+ "@copilotkitnext/runtime": "workspace:*",
129
137
  "@graphql-yoga/plugin-defer-stream": "^3.3.1",
130
138
  "@hono/node-server": "^1.13.5",
131
139
  "@scarf/scarf": "^1.3.0",
@@ -134,7 +142,7 @@ var require_package = __commonJS({
134
142
  graphql: "^16.8.1",
135
143
  "graphql-scalars": "^1.23.0",
136
144
  "graphql-yoga": "^5.3.1",
137
- hono: "^4.10.3",
145
+ hono: "^4.11.4",
138
146
  openai: "^4.85.1",
139
147
  "partial-json": "^0.1.7",
140
148
  pino: "^9.2.0",
@@ -145,9 +153,6 @@ var require_package = __commonJS({
145
153
  zod: "^3.23.3"
146
154
  },
147
155
  peerDependencies: {
148
- "@ag-ui/client": "^0.0.42",
149
- "@ag-ui/core": "^0.0.42",
150
- "@ag-ui/langgraph": "^0.0.20",
151
156
  "@anthropic-ai/sdk": "^0.57.0",
152
157
  "@copilotkit/shared": "workspace:*",
153
158
  "@copilotkitnext/agent": "workspace:*",
@@ -3591,7 +3596,7 @@ var CopilotRuntime = class {
3591
3596
  } : {},
3592
3597
  "cloud.base_url": cloudBaseUrl
3593
3598
  });
3594
- (_c = params == null ? void 0 : params.beforeRequestMiddleware) == null ? void 0 : _c.call(params, hookParams);
3599
+ const middlewareResult = await ((_c = params == null ? void 0 : params.beforeRequestMiddleware) == null ? void 0 : _c.call(params, hookParams));
3595
3600
  if ((_d = params == null ? void 0 : params.middleware) == null ? void 0 : _d.onBeforeRequest) {
3596
3601
  const { request: request2, runtime, path } = hookParams;
3597
3602
  const gqlMessages = aguiToGQL(body.messages).reduce((acc, msg) => {
@@ -3614,6 +3619,7 @@ var CopilotRuntime = class {
3614
3619
  url: request2.url
3615
3620
  });
3616
3621
  }
3622
+ return middlewareResult;
3617
3623
  };
3618
3624
  }
3619
3625
  createOnAfterRequestHandler(params) {
@@ -4732,7 +4738,10 @@ function copilotRuntimeNextJSAppRouterEndpoint(options) {
4732
4738
  }
4733
4739
  const copilotRoute = runtime.createCopilotEndpointSingleRoute({
4734
4740
  runtime: options.runtime.instance,
4735
- basePath: options.baseUrl ?? options.endpoint
4741
+ basePath: options.baseUrl ?? options.endpoint,
4742
+ ...options.cors && {
4743
+ cors: options.cors
4744
+ }
4736
4745
  });
4737
4746
  const handleRequest = vercel.handle(copilotRoute);
4738
4747
  return {
@@ -4854,7 +4863,10 @@ function copilotRuntimeNodeHttpEndpoint(options) {
4854
4863
  }
4855
4864
  const honoApp = runtime.createCopilotEndpointSingleRoute({
4856
4865
  runtime: options.runtime.instance,
4857
- basePath: options.baseUrl ?? options.endpoint
4866
+ basePath: options.baseUrl ?? options.endpoint,
4867
+ ...options.cors && {
4868
+ cors: options.cors
4869
+ }
4858
4870
  });
4859
4871
  const handle2 = /* @__PURE__ */ __name(async function handler(req, res) {
4860
4872
  const url = getFullUrl(req);