@copilotkit/runtime 1.3.5 → 1.3.6

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 (33) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{chunk-UULC727A.mjs → chunk-I5XVY6LS.mjs} +2 -2
  3. package/dist/{chunk-R4UP33ZY.mjs → chunk-LYLGFMKH.mjs} +2 -2
  4. package/dist/{chunk-6PBGQZ72.mjs → chunk-TY5C4PL4.mjs} +2 -2
  5. package/dist/{chunk-MGY4L4BK.mjs → chunk-UB4LPMMV.mjs} +2 -2
  6. package/dist/{chunk-SWRPXKBA.mjs → chunk-VRFBTIGK.mjs} +24 -12
  7. package/dist/chunk-VRFBTIGK.mjs.map +1 -0
  8. package/dist/index.js +23 -11
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +5 -5
  11. package/dist/lib/index.js +23 -11
  12. package/dist/lib/index.js.map +1 -1
  13. package/dist/lib/index.mjs +5 -5
  14. package/dist/lib/integrations/index.js +1 -1
  15. package/dist/lib/integrations/index.js.map +1 -1
  16. package/dist/lib/integrations/index.mjs +4 -4
  17. package/dist/lib/integrations/nest/index.js +1 -1
  18. package/dist/lib/integrations/nest/index.js.map +1 -1
  19. package/dist/lib/integrations/nest/index.mjs +2 -2
  20. package/dist/lib/integrations/node-express/index.js +1 -1
  21. package/dist/lib/integrations/node-express/index.js.map +1 -1
  22. package/dist/lib/integrations/node-express/index.mjs +2 -2
  23. package/dist/lib/integrations/node-http/index.js +1 -1
  24. package/dist/lib/integrations/node-http/index.js.map +1 -1
  25. package/dist/lib/integrations/node-http/index.mjs +1 -1
  26. package/package.json +4 -4
  27. package/src/agents/langgraph/event-source.ts +19 -3
  28. package/src/agents/langgraph/events.ts +1 -1
  29. package/dist/chunk-SWRPXKBA.mjs.map +0 -1
  30. /package/dist/{chunk-UULC727A.mjs.map → chunk-I5XVY6LS.mjs.map} +0 -0
  31. /package/dist/{chunk-R4UP33ZY.mjs.map → chunk-LYLGFMKH.mjs.map} +0 -0
  32. /package/dist/{chunk-6PBGQZ72.mjs.map → chunk-TY5C4PL4.mjs.map} +0 -0
  33. /package/dist/{chunk-MGY4L4BK.mjs.map → chunk-UB4LPMMV.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CopilotRuntime,
3
3
  flattenToolCallsNoDuplicates
4
- } from "./chunk-UULC727A.mjs";
4
+ } from "./chunk-I5XVY6LS.mjs";
5
5
  import {
6
6
  AnthropicAdapter,
7
7
  GoogleGenerativeAIAdapter,
@@ -16,19 +16,19 @@ import {
16
16
  config,
17
17
  copilotRuntimeNextJSAppRouterEndpoint,
18
18
  copilotRuntimeNextJSPagesRouterEndpoint
19
- } from "./chunk-R4UP33ZY.mjs";
19
+ } from "./chunk-LYLGFMKH.mjs";
20
20
  import {
21
21
  copilotRuntimeNestEndpoint
22
- } from "./chunk-MGY4L4BK.mjs";
22
+ } from "./chunk-UB4LPMMV.mjs";
23
23
  import {
24
24
  copilotRuntimeNodeExpressEndpoint
25
- } from "./chunk-6PBGQZ72.mjs";
25
+ } from "./chunk-TY5C4PL4.mjs";
26
26
  import {
27
27
  buildSchema,
28
28
  copilotRuntimeNodeHttpEndpoint,
29
29
  createContext,
30
30
  getCommonConfig
31
- } from "./chunk-SWRPXKBA.mjs";
31
+ } from "./chunk-VRFBTIGK.mjs";
32
32
  import "./chunk-73NMP3DI.mjs";
33
33
  import {
34
34
  GuardrailsValidationFailureResponse,
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.3.5",
47
+ version: "1.3.6",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -1370,20 +1370,31 @@ var RemoteLangGraphEventSource = class {
1370
1370
  processLangGraphEvents() {
1371
1371
  let lastEventWithState = null;
1372
1372
  return this.eventStream$.pipe((0, import_rxjs.scan)((acc, event) => {
1373
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1373
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
1374
1374
  if (event.event === LangGraphEventTypes.OnChatModelStream) {
1375
- if ((_c = (_b = (_a = event.data) == null ? void 0 : _a.chunk) == null ? void 0 : _b.kwargs) == null ? void 0 : _c.tool_call_chunks) {
1375
+ const content = ((_c = (_b = (_a = event.data) == null ? void 0 : _a.chunk) == null ? void 0 : _b.kwargs) == null ? void 0 : _c.content) ?? ((_e = (_d = event.data) == null ? void 0 : _d.chunk) == null ? void 0 : _e.content);
1376
+ if (typeof content === "string") {
1377
+ acc.content = content;
1378
+ } else if (Array.isArray(content) && content.length > 0) {
1379
+ acc.content = content[0].text;
1380
+ } else {
1381
+ acc.content = null;
1382
+ }
1383
+ if ((_h = (_g = (_f = event.data) == null ? void 0 : _f.chunk) == null ? void 0 : _g.kwargs) == null ? void 0 : _h.tool_call_chunks) {
1376
1384
  acc.prevToolCallMessageId = acc.toolCallMessageId;
1377
- acc.toolCallMessageId = (_d = event.data.chunk.kwargs) == null ? void 0 : _d.id;
1378
- if ((_e = event.data.chunk.kwargs.tool_call_chunks[0]) == null ? void 0 : _e.name) {
1385
+ acc.toolCallMessageId = (_i = event.data.chunk.kwargs) == null ? void 0 : _i.id;
1386
+ if ((_j = event.data.chunk.kwargs.tool_call_chunks[0]) == null ? void 0 : _j.name) {
1379
1387
  acc.toolCallName = event.data.chunk.kwargs.tool_call_chunks[0].name;
1380
1388
  }
1381
- if ((_f = event.data.chunk.kwargs.tool_call_chunks[0]) == null ? void 0 : _f.id) {
1389
+ if ((_k = event.data.chunk.kwargs.tool_call_chunks[0]) == null ? void 0 : _k.id) {
1382
1390
  acc.toolCallId = event.data.chunk.kwargs.tool_call_chunks[0].id;
1383
1391
  }
1392
+ acc.prevMessageId = acc.messageId;
1393
+ acc.messageId = (_n = (_m = (_l = event.data) == null ? void 0 : _l.chunk) == null ? void 0 : _m.kwargs) == null ? void 0 : _n.id;
1394
+ } else if (acc.content && acc.content != "") {
1395
+ acc.prevMessageId = acc.messageId;
1396
+ acc.messageId = (_q = (_p = (_o = event.data) == null ? void 0 : _o.chunk) == null ? void 0 : _p.kwargs) == null ? void 0 : _q.id;
1384
1397
  }
1385
- acc.prevMessageId = acc.messageId;
1386
- acc.messageId = (_i = (_h = (_g = event.data) == null ? void 0 : _g.chunk) == null ? void 0 : _h.kwargs) == null ? void 0 : _i.id;
1387
1398
  } else {
1388
1399
  acc.prevToolCallMessageId = acc.toolCallMessageId;
1389
1400
  acc.toolCallMessageId = null;
@@ -1401,9 +1412,10 @@ var RemoteLangGraphEventSource = class {
1401
1412
  prevToolCallMessageId: null,
1402
1413
  messageId: null,
1403
1414
  toolCallName: null,
1404
- prevMessageId: null
1415
+ prevMessageId: null,
1416
+ content: null
1405
1417
  }), (0, import_rxjs.mergeMap)((eventWithState) => {
1406
- var _a, _b, _c, _d, _e, _f, _g, _h;
1418
+ var _a, _b, _c, _d, _e;
1407
1419
  const events = [];
1408
1420
  let shouldEmitMessages = true;
1409
1421
  let shouldEmitToolCalls = false;
@@ -1487,7 +1499,7 @@ var RemoteLangGraphEventSource = class {
1487
1499
  }
1488
1500
  }
1489
1501
  const args = (_e = (_d = (_c = (_b = (_a = eventWithState.event.data) == null ? void 0 : _a.chunk) == null ? void 0 : _b.kwargs) == null ? void 0 : _c.tool_call_chunks) == null ? void 0 : _d[0]) == null ? void 0 : _e.args;
1490
- const content = (_h = (_g = (_f = eventWithState.event.data) == null ? void 0 : _f.chunk) == null ? void 0 : _g.kwargs) == null ? void 0 : _h.content;
1502
+ const content = eventWithState.content;
1491
1503
  if (args) {
1492
1504
  if (this.shouldEmitToolCall(shouldEmitToolCalls, eventWithState.toolCallName)) {
1493
1505
  events.push({