@copilotkit/runtime 1.5.18-next.0 → 1.5.18-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 (32) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-ODCQ3OFD.mjs → chunk-2NWLEHMA.mjs} +11 -6
  3. package/dist/chunk-2NWLEHMA.mjs.map +1 -0
  4. package/dist/{chunk-QGFYSFTM.mjs → chunk-326WWZNE.mjs} +2 -2
  5. package/dist/{chunk-26Q5XHVQ.mjs → chunk-CJZ7QUXU.mjs} +2 -2
  6. package/dist/{chunk-EQFWYZKN.mjs → chunk-OS4N57XE.mjs} +2 -2
  7. package/dist/index.js +10 -5
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +10 -5
  11. package/dist/lib/index.js.map +1 -1
  12. package/dist/lib/index.mjs +4 -4
  13. package/dist/lib/integrations/index.js +7 -2
  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 +7 -2
  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 +7 -2
  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 +7 -2
  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/graphql/resolvers/state.resolver.ts +6 -1
  27. package/src/lib/runtime/copilot-runtime.ts +2 -2
  28. package/src/lib/runtime/remote-lg-action.ts +1 -1
  29. package/dist/chunk-ODCQ3OFD.mjs.map +0 -1
  30. /package/dist/{chunk-QGFYSFTM.mjs.map → chunk-326WWZNE.mjs.map} +0 -0
  31. /package/dist/{chunk-26Q5XHVQ.mjs.map → chunk-CJZ7QUXU.mjs.map} +0 -0
  32. /package/dist/{chunk-EQFWYZKN.mjs.map → chunk-OS4N57XE.mjs.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  getCommonConfig,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-ODCQ3OFD.mjs";
5
+ } from "./chunk-2NWLEHMA.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-QGFYSFTM.mjs.map
80
+ //# sourceMappingURL=chunk-326WWZNE.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-ODCQ3OFD.mjs";
5
+ } from "./chunk-2NWLEHMA.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-26Q5XHVQ.mjs.map
25
+ //# sourceMappingURL=chunk-CJZ7QUXU.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-ODCQ3OFD.mjs";
5
+ } from "./chunk-2NWLEHMA.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-EQFWYZKN.mjs.map
25
+ //# sourceMappingURL=chunk-OS4N57XE.mjs.map
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.18-next.0",
47
+ version: "1.5.18-next.1",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -2636,7 +2636,7 @@ async function streamEvents(controller, args) {
2636
2636
  continue;
2637
2637
  }
2638
2638
  const event = chunk.data;
2639
- const currentNodeName = event.name;
2639
+ const currentNodeName = event.metadata.langgraph_node;
2640
2640
  const eventType = event.event;
2641
2641
  const runId = event.metadata.run_id;
2642
2642
  externalRunId = runId;
@@ -4075,7 +4075,7 @@ please use an LLM adapter instead.`
4075
4075
  }
4076
4076
  if (Object.keys(state).length === 0) {
4077
4077
  return {
4078
- threadId,
4078
+ threadId: threadId || "",
4079
4079
  threadExists: false,
4080
4080
  state: JSON.stringify({}),
4081
4081
  messages: JSON.stringify([])
@@ -4084,7 +4084,7 @@ please use an LLM adapter instead.`
4084
4084
  const { messages, ...stateWithoutMessages } = state;
4085
4085
  const copilotkitMessages = langchainMessagesToCopilotKit(messages);
4086
4086
  return {
4087
- threadId,
4087
+ threadId: threadId || "",
4088
4088
  threadExists: true,
4089
4089
  state: JSON.stringify(stateWithoutMessages),
4090
4090
  messages: JSON.stringify(copilotkitMessages)
@@ -5777,7 +5777,12 @@ var StateResolver = class {
5777
5777
  const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
5778
5778
  const agent = agents.find((agent2) => agent2.name === data.agentName);
5779
5779
  if (!agent) {
5780
- throw new Error("Agent not found");
5780
+ return {
5781
+ threadId: data.threadId || "",
5782
+ threadExists: false,
5783
+ state: JSON.stringify({}),
5784
+ messages: JSON.stringify([])
5785
+ };
5781
5786
  }
5782
5787
  const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
5783
5788
  return state;