@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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  copilotRuntimeNodeHttpEndpoint
3
- } from "../../../chunk-ODCQ3OFD.mjs";
3
+ } from "../../../chunk-2NWLEHMA.mjs";
4
4
  import "../../../chunk-OS5YD32G.mjs";
5
5
  import "../../../chunk-5BIEM2UU.mjs";
6
6
  import "../../../chunk-RTFJTJMA.mjs";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.5.18-next.0",
12
+ "version": "1.5.18-next.1",
13
13
  "sideEffects": false,
14
14
  "main": "./dist/index.js",
15
15
  "module": "./dist/index.mjs",
@@ -58,7 +58,7 @@
58
58
  "rxjs": "^7.8.1",
59
59
  "type-graphql": "2.0.0-rc.1",
60
60
  "zod": "^3.23.3",
61
- "@copilotkit/shared": "1.5.18-next.0"
61
+ "@copilotkit/shared": "1.5.18-next.1"
62
62
  },
63
63
  "keywords": [
64
64
  "copilotkit",
@@ -13,7 +13,12 @@ export class StateResolver {
13
13
  const agent = agents.find((agent) => agent.name === data.agentName);
14
14
 
15
15
  if (!agent) {
16
- throw new Error("Agent not found");
16
+ return {
17
+ threadId: data.threadId || "",
18
+ threadExists: false,
19
+ state: JSON.stringify({}),
20
+ messages: JSON.stringify([]),
21
+ };
17
22
  }
18
23
 
19
24
  const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
@@ -415,7 +415,7 @@ please use an LLM adapter instead.`,
415
415
 
416
416
  if (Object.keys(state).length === 0) {
417
417
  return {
418
- threadId,
418
+ threadId: threadId || "",
419
419
  threadExists: false,
420
420
  state: JSON.stringify({}),
421
421
  messages: JSON.stringify([]),
@@ -424,7 +424,7 @@ please use an LLM adapter instead.`,
424
424
  const { messages, ...stateWithoutMessages } = state;
425
425
  const copilotkitMessages = langchainMessagesToCopilotKit(messages);
426
426
  return {
427
- threadId,
427
+ threadId: threadId || "",
428
428
  threadExists: true,
429
429
  state: JSON.stringify(stateWithoutMessages),
430
430
  messages: JSON.stringify(copilotkitMessages),
@@ -271,7 +271,7 @@ async function streamEvents(controller: ReadableStreamDefaultController, args: E
271
271
  }
272
272
 
273
273
  const event = chunk.data;
274
- const currentNodeName = event.name;
274
+ const currentNodeName = event.metadata.langgraph_node;
275
275
  const eventType = event.event;
276
276
  const runId = event.metadata.run_id;
277
277
  externalRunId = runId;