@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/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7BCFHZLY.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5ZBUMQE2.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4HQ5OZXN.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
addCustomHeaderPlugin,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
getCommonConfig,
|
|
22
22
|
langGraphPlatformEndpoint,
|
|
23
23
|
resolveEndpointType
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-L7OTGCAG.mjs";
|
|
25
25
|
import {
|
|
26
26
|
AnthropicAdapter,
|
|
27
27
|
EmptyAdapter,
|
package/dist/lib/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.6.0-next.
|
|
47
|
+
version: "1.6.0-next.9",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -1357,10 +1357,15 @@ var RemoteLangGraphEventSource = class {
|
|
|
1357
1357
|
acc.lastMessageId = this.getCurrentMessageId(event) ?? acc.lastMessageId;
|
|
1358
1358
|
const toolCallChunks = this.getCurrentToolCallChunks(event) ?? [];
|
|
1359
1359
|
const responseMetadata = this.getResponseMetadata(event);
|
|
1360
|
+
const toolCallCheck = toolCallChunks && toolCallChunks.length > 0;
|
|
1361
|
+
let isToolCallEnd = (responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "tool_calls";
|
|
1360
1362
|
acc.isToolCallStart = toolCallChunks.some((chunk) => chunk.name && chunk.id);
|
|
1361
1363
|
acc.isMessageStart = prevMessageId !== acc.lastMessageId && !acc.isToolCallStart;
|
|
1362
|
-
acc.isToolCall
|
|
1363
|
-
|
|
1364
|
+
if (acc.isToolCall && !toolCallCheck) {
|
|
1365
|
+
isToolCallEnd = true;
|
|
1366
|
+
}
|
|
1367
|
+
acc.isToolCall = toolCallCheck;
|
|
1368
|
+
acc.isToolCallEnd = isToolCallEnd;
|
|
1364
1369
|
acc.isMessageEnd = (responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "stop";
|
|
1365
1370
|
({ name: acc.lastToolCallName, id: acc.lastToolCallId } = toolCallChunks.find((chunk) => chunk.name && chunk.id) ?? {
|
|
1366
1371
|
name: acc.lastToolCallName,
|
|
@@ -1408,13 +1413,12 @@ var RemoteLangGraphEventSource = class {
|
|
|
1408
1413
|
});
|
|
1409
1414
|
}
|
|
1410
1415
|
const responseMetadata = this.getResponseMetadata(acc.event);
|
|
1411
|
-
if (
|
|
1416
|
+
if (acc.isToolCallEnd && this.shouldEmitToolCall(shouldEmitToolCalls, acc.lastToolCallName)) {
|
|
1412
1417
|
events.push({
|
|
1413
1418
|
type: RuntimeEventTypes.ActionExecutionEnd,
|
|
1414
1419
|
actionExecutionId: acc.lastToolCallId
|
|
1415
1420
|
});
|
|
1416
|
-
}
|
|
1417
|
-
if ((responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "stop" && shouldEmitMessages) {
|
|
1421
|
+
} else if ((responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "stop" && shouldEmitMessages) {
|
|
1418
1422
|
events.push({
|
|
1419
1423
|
type: RuntimeEventTypes.TextMessageEnd,
|
|
1420
1424
|
messageId: acc.lastMessageId
|
|
@@ -3961,7 +3965,7 @@ please use an LLM adapter instead.`
|
|
|
3961
3965
|
threadId,
|
|
3962
3966
|
runId: void 0,
|
|
3963
3967
|
eventSource,
|
|
3964
|
-
serverSideActions
|
|
3968
|
+
serverSideActions,
|
|
3965
3969
|
actionInputsWithoutAgents: allAvailableActions
|
|
3966
3970
|
};
|
|
3967
3971
|
} catch (error) {
|