@copilotkit/runtime 1.8.4 → 1.8.5-next.1

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 (30) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{chunk-ASPOKF3X.mjs → chunk-AQHJGUTA.mjs} +2 -2
  3. package/dist/{chunk-H7KRQAE2.mjs → chunk-CFWU64MY.mjs} +2 -2
  4. package/dist/{chunk-6GRCGNF7.mjs → chunk-EH5E2IX3.mjs} +2 -2
  5. package/dist/{chunk-LV2HHMFK.mjs → chunk-KH52RHVR.mjs} +14 -3
  6. package/dist/chunk-KH52RHVR.mjs.map +1 -0
  7. package/dist/index.js +13 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +13 -2
  11. package/dist/lib/index.js.map +1 -1
  12. package/dist/lib/index.mjs +4 -4
  13. package/dist/lib/integrations/index.js +1 -1
  14. package/dist/lib/integrations/index.js.map +1 -1
  15. package/dist/lib/integrations/index.mjs +4 -4
  16. package/dist/lib/integrations/nest/index.js +1 -1
  17. package/dist/lib/integrations/nest/index.js.map +1 -1
  18. package/dist/lib/integrations/nest/index.mjs +2 -2
  19. package/dist/lib/integrations/node-express/index.js +1 -1
  20. package/dist/lib/integrations/node-express/index.js.map +1 -1
  21. package/dist/lib/integrations/node-express/index.mjs +2 -2
  22. package/dist/lib/integrations/node-http/index.js +1 -1
  23. package/dist/lib/integrations/node-http/index.js.map +1 -1
  24. package/dist/lib/integrations/node-http/index.mjs +1 -1
  25. package/package.json +2 -2
  26. package/src/lib/runtime/remote-lg-action.ts +12 -1
  27. package/dist/chunk-LV2HHMFK.mjs.map +0 -1
  28. /package/dist/{chunk-ASPOKF3X.mjs.map → chunk-AQHJGUTA.mjs.map} +0 -0
  29. /package/dist/{chunk-H7KRQAE2.mjs.map → chunk-CFWU64MY.mjs.map} +0 -0
  30. /package/dist/{chunk-6GRCGNF7.mjs.map → chunk-EH5E2IX3.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.8.5-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d0e8a1e: - fix: fix duplicate messages on regenerate
8
+ - @copilotkit/shared@1.8.5-next.1
9
+
10
+ ## 1.8.5-next.0
11
+
12
+ ### Patch Changes
13
+
14
+ - @copilotkit/shared@1.8.5-next.0
15
+
3
16
  ## 1.8.4
4
17
 
5
18
  ### Patch Changes
@@ -2,7 +2,7 @@ import {
2
2
  getCommonConfig,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-LV2HHMFK.mjs";
5
+ } from "./chunk-KH52RHVR.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -77,4 +77,4 @@ export {
77
77
  config,
78
78
  copilotRuntimeNextJSPagesRouterEndpoint
79
79
  };
80
- //# sourceMappingURL=chunk-ASPOKF3X.mjs.map
80
+ //# sourceMappingURL=chunk-AQHJGUTA.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-LV2HHMFK.mjs";
5
+ } from "./chunk-KH52RHVR.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
22
22
  export {
23
23
  copilotRuntimeNestEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-H7KRQAE2.mjs.map
25
+ //# sourceMappingURL=chunk-CFWU64MY.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-LV2HHMFK.mjs";
5
+ } from "./chunk-KH52RHVR.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
22
22
  export {
23
23
  copilotRuntimeNodeExpressEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-6GRCGNF7.mjs.map
25
+ //# sourceMappingURL=chunk-EH5E2IX3.mjs.map
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  publishConfig: {
40
40
  access: "public"
41
41
  },
42
- version: "1.8.4",
42
+ version: "1.8.5-next.1",
43
43
  sideEffects: false,
44
44
  main: "./dist/index.js",
45
45
  module: "./dist/index.mjs",
@@ -1688,6 +1688,7 @@ import { createHash } from "crypto";
1688
1688
  import { isValidUUID, randomUUID } from "@copilotkit/shared";
1689
1689
  import { parse as parsePartialJson } from "partial-json";
1690
1690
  import { parseJson } from "@copilotkit/shared";
1691
+ import { RemoveMessage } from "@langchain/core/messages";
1691
1692
  var activeInterruptEvent = false;
1692
1693
  async function execute(args) {
1693
1694
  return new ReadableStream({
@@ -2070,10 +2071,20 @@ function langGraphDefaultMergeState(state, messages, actions, agentName) {
2070
2071
  }
2071
2072
  const existingMessages = state.messages || [];
2072
2073
  const existingMessageIds = new Set(existingMessages.map((message) => message.id));
2074
+ const messageIds = new Set(messages.map((message) => message.id));
2075
+ let removedMessages = [];
2076
+ if (messages.length < existingMessages.length) {
2077
+ removedMessages = existingMessages.filter((m) => !messageIds.has(m.id)).map((m) => new RemoveMessage({
2078
+ id: m.id
2079
+ }));
2080
+ }
2073
2081
  const newMessages = messages.filter((message) => !existingMessageIds.has(message.id));
2074
2082
  return {
2075
2083
  ...state,
2076
- messages: newMessages,
2084
+ messages: [
2085
+ ...removedMessages,
2086
+ ...newMessages
2087
+ ],
2077
2088
  copilotkit: {
2078
2089
  actions
2079
2090
  }
@@ -4591,4 +4602,4 @@ export {
4591
4602
  getCommonConfig,
4592
4603
  copilotRuntimeNodeHttpEndpoint
4593
4604
  };
4594
- //# sourceMappingURL=chunk-LV2HHMFK.mjs.map
4605
+ //# sourceMappingURL=chunk-KH52RHVR.mjs.map