@copilotkit/runtime 1.5.15-next.6 → 1.5.15-next.7

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-OI2VCNPX.mjs → chunk-65VBDTR4.mjs} +2 -2
  3. package/dist/{chunk-MKC4PI66.mjs → chunk-BUEAVIXA.mjs} +2 -2
  4. package/dist/{chunk-AJWO2KBE.mjs → chunk-F4WILQ32.mjs} +2 -2
  5. package/dist/{chunk-EMZY3B5S.mjs → chunk-OMS5GY45.mjs} +15 -11
  6. package/dist/{chunk-EMZY3B5S.mjs.map → chunk-OMS5GY45.mjs.map} +1 -1
  7. package/dist/index.js +14 -10
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +14 -10
  11. package/dist/lib/index.js.map +1 -1
  12. package/dist/lib/index.mjs +4 -4
  13. package/dist/lib/integrations/index.js +1 -1
  14. package/dist/lib/integrations/index.js.map +1 -1
  15. package/dist/lib/integrations/index.mjs +4 -4
  16. package/dist/lib/integrations/nest/index.js +1 -1
  17. package/dist/lib/integrations/nest/index.js.map +1 -1
  18. package/dist/lib/integrations/nest/index.mjs +2 -2
  19. package/dist/lib/integrations/node-express/index.js +1 -1
  20. package/dist/lib/integrations/node-express/index.js.map +1 -1
  21. package/dist/lib/integrations/node-express/index.mjs +2 -2
  22. package/dist/lib/integrations/node-http/index.js +1 -1
  23. package/dist/lib/integrations/node-http/index.js.map +1 -1
  24. package/dist/lib/integrations/node-http/index.mjs +1 -1
  25. package/package.json +2 -2
  26. package/src/lib/runtime/copilot-runtime.ts +18 -9
  27. /package/dist/{chunk-OI2VCNPX.mjs.map → chunk-65VBDTR4.mjs.map} +0 -0
  28. /package/dist/{chunk-MKC4PI66.mjs.map → chunk-BUEAVIXA.mjs.map} +0 -0
  29. /package/dist/{chunk-AJWO2KBE.mjs.map → chunk-F4WILQ32.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.5.15-next.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 68bdbcd: - fix(runtime): enable multi-agent flows while preventing recursive self-calls
8
+ - @copilotkit/shared@1.5.15-next.7
9
+
3
10
  ## 1.5.15-next.6
4
11
 
5
12
  ### Patch Changes
@@ -2,7 +2,7 @@ import {
2
2
  getCommonConfig,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-EMZY3B5S.mjs";
5
+ } from "./chunk-OMS5GY45.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-44O2JGUY.mjs";
@@ -77,4 +77,4 @@ export {
77
77
  config,
78
78
  copilotRuntimeNextJSPagesRouterEndpoint
79
79
  };
80
- //# sourceMappingURL=chunk-OI2VCNPX.mjs.map
80
+ //# sourceMappingURL=chunk-65VBDTR4.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-EMZY3B5S.mjs";
5
+ } from "./chunk-OMS5GY45.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-44O2JGUY.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
22
22
  export {
23
23
  copilotRuntimeNestEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-MKC4PI66.mjs.map
25
+ //# sourceMappingURL=chunk-BUEAVIXA.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-EMZY3B5S.mjs";
5
+ } from "./chunk-OMS5GY45.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-44O2JGUY.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
22
22
  export {
23
23
  copilotRuntimeNodeExpressEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-AJWO2KBE.mjs.map
25
+ //# sourceMappingURL=chunk-F4WILQ32.mjs.map
@@ -38,7 +38,7 @@ var require_package = __commonJS({
38
38
  publishConfig: {
39
39
  access: "public"
40
40
  },
41
- version: "1.5.15-next.6",
41
+ version: "1.5.15-next.7",
42
42
  sideEffects: false,
43
43
  main: "./dist/index.js",
44
44
  module: "./dist/index.mjs",
@@ -2751,19 +2751,23 @@ please use an LLM adapter instead.`
2751
2751
  const threadId = threadIdFromRequest ?? agentSession.threadId;
2752
2752
  const serverSideActions = await this.getServerSideActions(request);
2753
2753
  const messages = convertGqlInputToMessages(rawMessages);
2754
- const agent = serverSideActions.find((action) => action.name === agentName && isLangGraphAgentAction(action));
2755
- if (!agent) {
2754
+ const currentAgent = serverSideActions.find((action) => action.name === agentName && isLangGraphAgentAction(action));
2755
+ if (!currentAgent) {
2756
2756
  throw new CopilotKitAgentDiscoveryError({
2757
2757
  agentName
2758
2758
  });
2759
2759
  }
2760
- const serverSideActionsInput = serverSideActions.filter((action) => !isLangGraphAgentAction(action)).map((action) => ({
2760
+ const availableActionsForCurrentAgent = serverSideActions.filter((action) => (
2761
+ // Case 1: Keep all regular (non-agent) actions
2762
+ !isLangGraphAgentAction(action) || // Case 2: For agent actions, keep all except self (prevent infinite loops)
2763
+ isLangGraphAgentAction(action) && action.name !== agentName
2764
+ )).map((action) => ({
2761
2765
  name: action.name,
2762
2766
  description: action.description,
2763
2767
  jsonSchema: JSON.stringify(actionParametersToJsonSchema(action.parameters))
2764
2768
  }));
2765
- const actionInputsWithoutAgents = flattenToolCallsNoDuplicates([
2766
- ...serverSideActionsInput,
2769
+ const allAvailableActions = flattenToolCallsNoDuplicates([
2770
+ ...availableActionsForCurrentAgent,
2767
2771
  ...request.actions
2768
2772
  ]);
2769
2773
  await ((_a = this.onBeforeRequest) == null ? void 0 : _a.call(this, {
@@ -2774,12 +2778,12 @@ please use an LLM adapter instead.`
2774
2778
  }));
2775
2779
  try {
2776
2780
  const eventSource = new RuntimeEventSource();
2777
- const stream = await agent.langGraphAgentHandler({
2781
+ const stream = await currentAgent.langGraphAgentHandler({
2778
2782
  name: agentName,
2779
2783
  threadId,
2780
2784
  nodeName,
2781
- actionInputsWithoutAgents,
2782
- metaEvents
2785
+ metaEvents,
2786
+ actionInputsWithoutAgents: allAvailableActions
2783
2787
  });
2784
2788
  eventSource.stream(async (eventStream$) => {
2785
2789
  from(stream).subscribe({
@@ -2808,7 +2812,7 @@ please use an LLM adapter instead.`
2808
2812
  runId: void 0,
2809
2813
  eventSource,
2810
2814
  serverSideActions: [],
2811
- actionInputsWithoutAgents
2815
+ actionInputsWithoutAgents: allAvailableActions
2812
2816
  };
2813
2817
  } catch (error) {
2814
2818
  console.error("Error getting response:", error);
@@ -4050,4 +4054,4 @@ export {
4050
4054
  getCommonConfig,
4051
4055
  copilotRuntimeNodeHttpEndpoint
4052
4056
  };
4053
- //# sourceMappingURL=chunk-EMZY3B5S.mjs.map
4057
+ //# sourceMappingURL=chunk-OMS5GY45.mjs.map