@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.
- package/CHANGELOG.md +7 -0
- package/dist/{chunk-OI2VCNPX.mjs → chunk-65VBDTR4.mjs} +2 -2
- package/dist/{chunk-MKC4PI66.mjs → chunk-BUEAVIXA.mjs} +2 -2
- package/dist/{chunk-AJWO2KBE.mjs → chunk-F4WILQ32.mjs} +2 -2
- package/dist/{chunk-EMZY3B5S.mjs → chunk-OMS5GY45.mjs} +15 -11
- package/dist/{chunk-EMZY3B5S.mjs.map → chunk-OMS5GY45.mjs.map} +1 -1
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.js +14 -10
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.js +1 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.js +1 -1
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.js +1 -1
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.js +1 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/package.json +2 -2
- package/src/lib/runtime/copilot-runtime.ts +18 -9
- /package/dist/{chunk-OI2VCNPX.mjs.map → chunk-65VBDTR4.mjs.map} +0 -0
- /package/dist/{chunk-MKC4PI66.mjs.map → chunk-BUEAVIXA.mjs.map} +0 -0
- /package/dist/{chunk-AJWO2KBE.mjs.map → chunk-F4WILQ32.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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
|
|
2755
|
-
if (!
|
|
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
|
|
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
|
|
2766
|
-
...
|
|
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
|
|
2781
|
+
const stream = await currentAgent.langGraphAgentHandler({
|
|
2778
2782
|
name: agentName,
|
|
2779
2783
|
threadId,
|
|
2780
2784
|
nodeName,
|
|
2781
|
-
|
|
2782
|
-
|
|
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-
|
|
4057
|
+
//# sourceMappingURL=chunk-OMS5GY45.mjs.map
|