@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/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.5.15-next.
|
|
47
|
+
version: "1.5.15-next.7",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -3557,19 +3557,23 @@ please use an LLM adapter instead.`
|
|
|
3557
3557
|
const threadId = threadIdFromRequest ?? agentSession.threadId;
|
|
3558
3558
|
const serverSideActions = await this.getServerSideActions(request);
|
|
3559
3559
|
const messages = convertGqlInputToMessages(rawMessages);
|
|
3560
|
-
const
|
|
3561
|
-
if (!
|
|
3560
|
+
const currentAgent = serverSideActions.find((action) => action.name === agentName && isLangGraphAgentAction(action));
|
|
3561
|
+
if (!currentAgent) {
|
|
3562
3562
|
throw new import_shared15.CopilotKitAgentDiscoveryError({
|
|
3563
3563
|
agentName
|
|
3564
3564
|
});
|
|
3565
3565
|
}
|
|
3566
|
-
const
|
|
3566
|
+
const availableActionsForCurrentAgent = serverSideActions.filter((action) => (
|
|
3567
|
+
// Case 1: Keep all regular (non-agent) actions
|
|
3568
|
+
!isLangGraphAgentAction(action) || // Case 2: For agent actions, keep all except self (prevent infinite loops)
|
|
3569
|
+
isLangGraphAgentAction(action) && action.name !== agentName
|
|
3570
|
+
)).map((action) => ({
|
|
3567
3571
|
name: action.name,
|
|
3568
3572
|
description: action.description,
|
|
3569
3573
|
jsonSchema: JSON.stringify((0, import_shared15.actionParametersToJsonSchema)(action.parameters))
|
|
3570
3574
|
}));
|
|
3571
|
-
const
|
|
3572
|
-
...
|
|
3575
|
+
const allAvailableActions = flattenToolCallsNoDuplicates([
|
|
3576
|
+
...availableActionsForCurrentAgent,
|
|
3573
3577
|
...request.actions
|
|
3574
3578
|
]);
|
|
3575
3579
|
await ((_a = this.onBeforeRequest) == null ? void 0 : _a.call(this, {
|
|
@@ -3580,12 +3584,12 @@ please use an LLM adapter instead.`
|
|
|
3580
3584
|
}));
|
|
3581
3585
|
try {
|
|
3582
3586
|
const eventSource = new RuntimeEventSource();
|
|
3583
|
-
const stream = await
|
|
3587
|
+
const stream = await currentAgent.langGraphAgentHandler({
|
|
3584
3588
|
name: agentName,
|
|
3585
3589
|
threadId,
|
|
3586
3590
|
nodeName,
|
|
3587
|
-
|
|
3588
|
-
|
|
3591
|
+
metaEvents,
|
|
3592
|
+
actionInputsWithoutAgents: allAvailableActions
|
|
3589
3593
|
});
|
|
3590
3594
|
eventSource.stream(async (eventStream$) => {
|
|
3591
3595
|
(0, import_rxjs3.from)(stream).subscribe({
|
|
@@ -3614,7 +3618,7 @@ please use an LLM adapter instead.`
|
|
|
3614
3618
|
runId: void 0,
|
|
3615
3619
|
eventSource,
|
|
3616
3620
|
serverSideActions: [],
|
|
3617
|
-
actionInputsWithoutAgents
|
|
3621
|
+
actionInputsWithoutAgents: allAvailableActions
|
|
3618
3622
|
};
|
|
3619
3623
|
} catch (error) {
|
|
3620
3624
|
console.error("Error getting response:", error);
|