@copilotkit/runtime 1.9.2-next.25 → 1.9.2-next.26

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-DOXGUQKL.mjs → chunk-3RL34U4Q.mjs} +2 -2
  3. package/dist/{chunk-3JXN25PL.mjs → chunk-D7OAY4CQ.mjs} +2 -2
  4. package/dist/{chunk-YKYBGYYL.mjs → chunk-GRU5EPNU.mjs} +14 -8
  5. package/dist/chunk-GRU5EPNU.mjs.map +1 -0
  6. package/dist/{chunk-BNLL5CH2.mjs → chunk-PQG7ZI72.mjs} +2 -2
  7. package/dist/{chunk-GJWXNXSA.mjs → chunk-SE7TPKR2.mjs} +2 -2
  8. package/dist/index.js +13 -7
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +5 -5
  11. package/dist/lib/index.js +13 -7
  12. package/dist/lib/index.js.map +1 -1
  13. package/dist/lib/index.mjs +5 -5
  14. package/dist/lib/integrations/index.js +1 -1
  15. package/dist/lib/integrations/index.js.map +1 -1
  16. package/dist/lib/integrations/index.mjs +4 -4
  17. package/dist/lib/integrations/nest/index.js +1 -1
  18. package/dist/lib/integrations/nest/index.js.map +1 -1
  19. package/dist/lib/integrations/nest/index.mjs +2 -2
  20. package/dist/lib/integrations/node-express/index.js +1 -1
  21. package/dist/lib/integrations/node-express/index.js.map +1 -1
  22. package/dist/lib/integrations/node-express/index.mjs +2 -2
  23. package/dist/lib/integrations/node-http/index.js +1 -1
  24. package/dist/lib/integrations/node-http/index.js.map +1 -1
  25. package/dist/lib/integrations/node-http/index.mjs +1 -1
  26. package/package.json +2 -2
  27. package/src/lib/runtime/copilot-runtime.ts +14 -9
  28. package/dist/chunk-YKYBGYYL.mjs.map +0 -1
  29. /package/dist/{chunk-DOXGUQKL.mjs.map → chunk-3RL34U4Q.mjs.map} +0 -0
  30. /package/dist/{chunk-3JXN25PL.mjs.map → chunk-D7OAY4CQ.mjs.map} +0 -0
  31. /package/dist/{chunk-BNLL5CH2.mjs.map → chunk-PQG7ZI72.mjs.map} +0 -0
  32. /package/dist/{chunk-GJWXNXSA.mjs.map → chunk-SE7TPKR2.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  CustomEventNames,
3
3
  LangGraphAgent
4
- } from "./chunk-DOXGUQKL.mjs";
4
+ } from "./chunk-3RL34U4Q.mjs";
5
5
  import {
6
6
  config,
7
7
  copilotRuntimeNextJSAppRouterEndpoint,
8
8
  copilotRuntimeNextJSPagesRouterEndpoint
9
- } from "./chunk-GJWXNXSA.mjs";
9
+ } from "./chunk-SE7TPKR2.mjs";
10
10
  import {
11
11
  copilotRuntimeNestEndpoint
12
- } from "./chunk-BNLL5CH2.mjs";
12
+ } from "./chunk-PQG7ZI72.mjs";
13
13
  import {
14
14
  copilotRuntimeNodeExpressEndpoint
15
- } from "./chunk-3JXN25PL.mjs";
15
+ } from "./chunk-D7OAY4CQ.mjs";
16
16
  import {
17
17
  CopilotRuntime,
18
18
  addCustomHeaderPlugin,
@@ -28,7 +28,7 @@ import {
28
28
  getCommonConfig,
29
29
  langGraphPlatformEndpoint,
30
30
  resolveEndpointType
31
- } from "./chunk-YKYBGYYL.mjs";
31
+ } from "./chunk-GRU5EPNU.mjs";
32
32
  import "./chunk-SHBDMA63.mjs";
33
33
  import {
34
34
  AnthropicAdapter,
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.9.2-next.25",
47
+ version: "1.9.2-next.26",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -4728,6 +4728,7 @@ please use an LLM adapter instead.`
4728
4728
  }));
4729
4729
  }
4730
4730
  async loadAgentState(graphqlContext, threadId, agentName) {
4731
+ var _a;
4731
4732
  const agents = await this.getAllAgents(graphqlContext);
4732
4733
  const agent = agents.find((agent2) => agent2.name === agentName);
4733
4734
  if (!agent) {
@@ -4808,12 +4809,17 @@ please use an LLM adapter instead.`
4808
4809
  state = client ? (await client.threads.getState(threadId)).values : {};
4809
4810
  } catch (error) {
4810
4811
  const errorMessage = error instanceof Error ? error.message : String(error);
4811
- console.debug(`Agent '${agentName}' configuration issue: ${errorMessage}`);
4812
- throw new import_shared15.ResolvedCopilotKitError({
4813
- status: 400,
4814
- message: `Agent '${agentName}' failed to execute: ${errorMessage}`,
4815
- code: import_shared15.CopilotKitErrorCode.CONFIGURATION_ERROR
4816
- });
4812
+ const errorStatus = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) || (error == null ? void 0 : error.status);
4813
+ if (errorStatus === 404) {
4814
+ state = {};
4815
+ } else {
4816
+ console.debug(`Agent '${agentName}' configuration issue: ${errorMessage}`);
4817
+ throw new import_shared15.ResolvedCopilotKitError({
4818
+ status: 400,
4819
+ message: `Agent '${agentName}' failed to execute: ${errorMessage}`,
4820
+ code: import_shared15.CopilotKitErrorCode.CONFIGURATION_ERROR
4821
+ });
4822
+ }
4817
4823
  }
4818
4824
  if (Object.keys(state).length === 0) {
4819
4825
  return {