@copilotkit/runtime 1.5.18-next.0 → 1.5.18-next.2

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 (34) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{chunk-ODCQ3OFD.mjs → chunk-6LFPAZDL.mjs} +79 -28
  3. package/dist/chunk-6LFPAZDL.mjs.map +1 -0
  4. package/dist/{chunk-26Q5XHVQ.mjs → chunk-BMKRXGMW.mjs} +2 -2
  5. package/dist/{chunk-EQFWYZKN.mjs → chunk-BNJW4KHS.mjs} +2 -2
  6. package/dist/{chunk-QGFYSFTM.mjs → chunk-KZ3RUNSQ.mjs} +2 -2
  7. package/dist/index.js +98 -47
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +98 -47
  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 +35 -15
  28. package/src/lib/runtime/remote-action-constructors.ts +17 -2
  29. package/src/lib/runtime/remote-actions.ts +5 -1
  30. package/src/lib/runtime/remote-lg-action.ts +1 -1
  31. package/dist/chunk-ODCQ3OFD.mjs.map +0 -1
  32. /package/dist/{chunk-26Q5XHVQ.mjs.map → chunk-BMKRXGMW.mjs.map} +0 -0
  33. /package/dist/{chunk-EQFWYZKN.mjs.map → chunk-BNJW4KHS.mjs.map} +0 -0
  34. /package/dist/{chunk-QGFYSFTM.mjs.map → chunk-KZ3RUNSQ.mjs.map} +0 -0
@@ -2,20 +2,20 @@ import {
2
2
  config,
3
3
  copilotRuntimeNextJSAppRouterEndpoint,
4
4
  copilotRuntimeNextJSPagesRouterEndpoint
5
- } from "../../chunk-QGFYSFTM.mjs";
5
+ } from "../../chunk-KZ3RUNSQ.mjs";
6
6
  import {
7
7
  copilotRuntimeNestEndpoint
8
- } from "../../chunk-26Q5XHVQ.mjs";
8
+ } from "../../chunk-BMKRXGMW.mjs";
9
9
  import {
10
10
  copilotRuntimeNodeExpressEndpoint
11
- } from "../../chunk-EQFWYZKN.mjs";
11
+ } from "../../chunk-BNJW4KHS.mjs";
12
12
  import {
13
13
  addCustomHeaderPlugin,
14
14
  buildSchema,
15
15
  copilotRuntimeNodeHttpEndpoint,
16
16
  createContext,
17
17
  getCommonConfig
18
- } from "../../chunk-ODCQ3OFD.mjs";
18
+ } from "../../chunk-6LFPAZDL.mjs";
19
19
  import "../../chunk-OS5YD32G.mjs";
20
20
  import "../../chunk-5BIEM2UU.mjs";
21
21
  import "../../chunk-RTFJTJMA.mjs";
@@ -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.2",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -2533,7 +2533,12 @@ var StateResolver = class {
2533
2533
  const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
2534
2534
  const agent = agents.find((agent2) => agent2.name === data.agentName);
2535
2535
  if (!agent) {
2536
- throw new Error("Agent not found");
2536
+ return {
2537
+ threadId: data.threadId || "",
2538
+ threadExists: false,
2539
+ state: JSON.stringify({}),
2540
+ messages: JSON.stringify([])
2541
+ };
2537
2542
  }
2538
2543
  const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
2539
2544
  return state;