@copilotkit/runtime 1.6.0-next.8 → 1.6.0-next.9
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-CC5KHDCV.mjs → chunk-4HQ5OZXN.mjs} +2 -2
- package/dist/{chunk-LR7HA4X5.mjs → chunk-5ZBUMQE2.mjs} +2 -2
- package/dist/{chunk-DI2VJM3I.mjs → chunk-7BCFHZLY.mjs} +2 -2
- package/dist/{chunk-C7VKUXWC.mjs → chunk-L7OTGCAG.mjs} +12 -8
- package/dist/chunk-L7OTGCAG.mjs.map +1 -0
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.js +11 -7
- 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/agents/langgraph/event-source.ts +13 -4
- package/src/lib/runtime/copilot-runtime.ts +1 -1
- package/dist/chunk-C7VKUXWC.mjs.map +0 -1
- /package/dist/{chunk-CC5KHDCV.mjs.map → chunk-4HQ5OZXN.mjs.map} +0 -0
- /package/dist/{chunk-LR7HA4X5.mjs.map → chunk-5ZBUMQE2.mjs.map} +0 -0
- /package/dist/{chunk-DI2VJM3I.mjs.map → chunk-7BCFHZLY.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.6.0-next.
|
|
12
|
+
"version": "1.6.0-next.9",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"rxjs": "^7.8.1",
|
|
60
60
|
"type-graphql": "2.0.0-rc.1",
|
|
61
61
|
"zod": "^3.23.3",
|
|
62
|
-
"@copilotkit/shared": "1.6.0-next.
|
|
62
|
+
"@copilotkit/shared": "1.6.0-next.9"
|
|
63
63
|
},
|
|
64
64
|
"keywords": [
|
|
65
65
|
"copilotkit",
|
|
@@ -87,11 +87,20 @@ export class RemoteLangGraphEventSource {
|
|
|
87
87
|
acc.lastMessageId = this.getCurrentMessageId(event) ?? acc.lastMessageId;
|
|
88
88
|
const toolCallChunks = this.getCurrentToolCallChunks(event) ?? [];
|
|
89
89
|
const responseMetadata = this.getResponseMetadata(event);
|
|
90
|
+
// Check if a given event is a tool call
|
|
91
|
+
const toolCallCheck = toolCallChunks && toolCallChunks.length > 0;
|
|
92
|
+
let isToolCallEnd = responseMetadata?.finish_reason === "tool_calls";
|
|
90
93
|
|
|
91
94
|
acc.isToolCallStart = toolCallChunks.some((chunk: any) => chunk.name && chunk.id);
|
|
92
95
|
acc.isMessageStart = prevMessageId !== acc.lastMessageId && !acc.isToolCallStart;
|
|
93
|
-
|
|
94
|
-
acc.
|
|
96
|
+
|
|
97
|
+
// Previous "acc.isToolCall" was set but now it won't pass the check, it means the tool call just ended.
|
|
98
|
+
if (acc.isToolCall && !toolCallCheck) {
|
|
99
|
+
isToolCallEnd = true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
acc.isToolCall = toolCallCheck;
|
|
103
|
+
acc.isToolCallEnd = isToolCallEnd;
|
|
95
104
|
acc.isMessageEnd = responseMetadata?.finish_reason === "stop";
|
|
96
105
|
({ name: acc.lastToolCallName, id: acc.lastToolCallId } = toolCallChunks.find(
|
|
97
106
|
(chunk: any) => chunk.name && chunk.id,
|
|
@@ -148,7 +157,7 @@ export class RemoteLangGraphEventSource {
|
|
|
148
157
|
|
|
149
158
|
// Tool call ended: emit ActionExecutionEnd
|
|
150
159
|
if (
|
|
151
|
-
|
|
160
|
+
acc.isToolCallEnd &&
|
|
152
161
|
this.shouldEmitToolCall(shouldEmitToolCalls, acc.lastToolCallName)
|
|
153
162
|
) {
|
|
154
163
|
events.push({
|
|
@@ -158,7 +167,7 @@ export class RemoteLangGraphEventSource {
|
|
|
158
167
|
}
|
|
159
168
|
|
|
160
169
|
// Message ended: emit TextMessageEnd
|
|
161
|
-
if (responseMetadata?.finish_reason === "stop" && shouldEmitMessages) {
|
|
170
|
+
else if (responseMetadata?.finish_reason === "stop" && shouldEmitMessages) {
|
|
162
171
|
events.push({
|
|
163
172
|
type: RuntimeEventTypes.TextMessageEnd,
|
|
164
173
|
messageId: acc.lastMessageId,
|