@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
package/dist/index.mjs CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  config,
4
4
  copilotRuntimeNextJSAppRouterEndpoint,
5
5
  copilotRuntimeNextJSPagesRouterEndpoint
6
- } from "./chunk-QGFYSFTM.mjs";
6
+ } from "./chunk-326WWZNE.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "./chunk-26Q5XHVQ.mjs";
9
+ } from "./chunk-CJZ7QUXU.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-EQFWYZKN.mjs";
12
+ } from "./chunk-OS4N57XE.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-ODCQ3OFD.mjs";
24
+ } from "./chunk-2NWLEHMA.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.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",
@@ -2300,7 +2300,7 @@ async function streamEvents(controller, args) {
2300
2300
  continue;
2301
2301
  }
2302
2302
  const event = chunk.data;
2303
- const currentNodeName = event.name;
2303
+ const currentNodeName = event.metadata.langgraph_node;
2304
2304
  const eventType = event.event;
2305
2305
  const runId = event.metadata.run_id;
2306
2306
  externalRunId = runId;
@@ -3739,7 +3739,7 @@ please use an LLM adapter instead.`
3739
3739
  }
3740
3740
  if (Object.keys(state).length === 0) {
3741
3741
  return {
3742
- threadId,
3742
+ threadId: threadId || "",
3743
3743
  threadExists: false,
3744
3744
  state: JSON.stringify({}),
3745
3745
  messages: JSON.stringify([])
@@ -3748,7 +3748,7 @@ please use an LLM adapter instead.`
3748
3748
  const { messages, ...stateWithoutMessages } = state;
3749
3749
  const copilotkitMessages = langchainMessagesToCopilotKit(messages);
3750
3750
  return {
3751
- threadId,
3751
+ threadId: threadId || "",
3752
3752
  threadExists: true,
3753
3753
  state: JSON.stringify(stateWithoutMessages),
3754
3754
  messages: JSON.stringify(copilotkitMessages)
@@ -5441,7 +5441,12 @@ var StateResolver = class {
5441
5441
  const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
5442
5442
  const agent = agents.find((agent2) => agent2.name === data.agentName);
5443
5443
  if (!agent) {
5444
- throw new Error("Agent not found");
5444
+ return {
5445
+ threadId: data.threadId || "",
5446
+ threadExists: false,
5447
+ state: JSON.stringify({}),
5448
+ messages: JSON.stringify([])
5449
+ };
5445
5450
  }
5446
5451
  const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
5447
5452
  return state;