@copilotkit/runtime 1.50.0-beta.1 → 1.50.0-beta.2

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,11 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.10.7-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @copilotkit/shared@1.10.7-next.0
8
+
3
9
  ## 1.10.6
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1243,13 +1243,13 @@ interface CopilotRuntimeConstructorParams<T extends Parameter[] | [] = []> exten
1243
1243
  /**
1244
1244
  * Central runtime object passed to all request handlers.
1245
1245
  */
1246
- declare class CopilotRuntime {
1247
- params?: CopilotRuntimeConstructorParams;
1246
+ declare class CopilotRuntime<const T extends Parameter[] | [] = []> {
1247
+ params?: CopilotRuntimeConstructorParams<T>;
1248
1248
  private observability?;
1249
1249
  private mcpToolsCache;
1250
1250
  private runtimeArgs;
1251
1251
  private _instance;
1252
- constructor(params?: CopilotRuntimeConstructorParams & PartialBy<CopilotRuntimeOptions, "agents">);
1252
+ constructor(params?: CopilotRuntimeConstructorParams<T> & PartialBy<CopilotRuntimeOptions, "agents">);
1253
1253
  get instance(): CopilotRuntime$1;
1254
1254
  private assignEndpointsToAgents;
1255
1255
  handleServiceAdapter(serviceAdapter: CopilotServiceAdapter): void;
@@ -1297,8 +1297,8 @@ type GraphQLContext = YogaInitialContext & {
1297
1297
  logger: typeof logger;
1298
1298
  };
1299
1299
  interface CreateCopilotRuntimeServerOptions {
1300
- runtime: CopilotRuntime;
1301
- serviceAdapter: CopilotServiceAdapter;
1300
+ runtime: CopilotRuntime<any>;
1301
+ serviceAdapter?: CopilotServiceAdapter;
1302
1302
  endpoint: string;
1303
1303
  baseUrl?: string;
1304
1304
  cloud?: CopilotCloudOptions;
package/dist/index.js CHANGED
@@ -77,7 +77,7 @@ var require_package = __commonJS({
77
77
  publishConfig: {
78
78
  access: "public"
79
79
  },
80
- version: "1.50.0-beta.0",
80
+ version: "1.50.0-beta.2",
81
81
  sideEffects: false,
82
82
  main: "./dist/index.js",
83
83
  module: "./dist/index.mjs",
@@ -126,8 +126,8 @@ var require_package = __commonJS({
126
126
  dependencies: {
127
127
  "@anthropic-ai/sdk": "^0.57.0",
128
128
  "@copilotkit/shared": "workspace:*",
129
- "@copilotkitnext/agent": "0.0.22",
130
- "@copilotkitnext/runtime": "0.0.22",
129
+ "@copilotkitnext/agent": "0.0.23",
130
+ "@copilotkitnext/runtime": "0.0.23",
131
131
  "@graphql-yoga/plugin-defer-stream": "^3.3.1",
132
132
  "@langchain/aws": "^0.1.9",
133
133
  "@langchain/community": "^0.3.29",
@@ -161,6 +161,11 @@ var require_package = __commonJS({
161
161
  "@ag-ui/langgraph": ">=0.0.18",
162
162
  "@ag-ui/proto": ">=0.0.39"
163
163
  },
164
+ peerDependenciesMeta: {
165
+ "@ag-ui/langgraph": {
166
+ optional: true
167
+ }
168
+ },
164
169
  keywords: [
165
170
  "copilotkit",
166
171
  "copilot",
@@ -3554,7 +3559,6 @@ var CopilotRuntime = class {
3554
3559
  }
3555
3560
  handleServiceAdapter(serviceAdapter) {
3556
3561
  this.runtimeArgs.agents = Promise.resolve(this.runtimeArgs.agents ?? {}).then(async (agents) => {
3557
- var _a;
3558
3562
  let agentsList = agents;
3559
3563
  const isAgentsListEmpty = !Object.keys(agents).length;
3560
3564
  const hasServiceAdapter = Boolean(serviceAdapter);
@@ -3572,7 +3576,7 @@ var CopilotRuntime = class {
3572
3576
  model: `${serviceAdapter.provider}/${serviceAdapter.model}`
3573
3577
  });
3574
3578
  }
3575
- if ((_a = this.params.actions) == null ? void 0 : _a.length) {
3579
+ if (this.params.actions) {
3576
3580
  const mcpTools = await this.getToolsFromMCP();
3577
3581
  agentsList = this.assignToolsToAgents(agents, [
3578
3582
  ...this.getToolsFromActions(this.params.actions),
@@ -4726,7 +4730,9 @@ function copilotRuntimeNextJSAppRouterEndpoint(options) {
4726
4730
  const logger2 = commonConfig.logging;
4727
4731
  logger2.debug("Creating NextJS App Router endpoint");
4728
4732
  const serviceAdapter = options.serviceAdapter;
4729
- options.runtime.handleServiceAdapter(serviceAdapter);
4733
+ if (serviceAdapter) {
4734
+ options.runtime.handleServiceAdapter(serviceAdapter);
4735
+ }
4730
4736
  const copilotRoute = runtime.createCopilotEndpointSingleRoute({
4731
4737
  runtime: options.runtime.instance,
4732
4738
  basePath: options.baseUrl ?? options.endpoint
@@ -4779,7 +4785,9 @@ function copilotRuntimeNodeHttpEndpoint(options) {
4779
4785
  const logger2 = commonConfig.logging;
4780
4786
  logger2.debug("Creating Node HTTP endpoint");
4781
4787
  const serviceAdapter = options.serviceAdapter;
4782
- options.runtime.handleServiceAdapter(serviceAdapter);
4788
+ if (serviceAdapter) {
4789
+ options.runtime.handleServiceAdapter(serviceAdapter);
4790
+ }
4783
4791
  const honoApp = runtime.createCopilotEndpointSingleRoute({
4784
4792
  runtime: options.runtime.instance,
4785
4793
  basePath: options.baseUrl ?? options.endpoint