@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
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-YKYBGYYL.mjs";
5
+ } from "./chunk-GRU5EPNU.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-BNLL5CH2.mjs.map
25
+ //# sourceMappingURL=chunk-PQG7ZI72.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  getCommonConfig,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-YKYBGYYL.mjs";
5
+ } from "./chunk-GRU5EPNU.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-GJWXNXSA.mjs.map
80
+ //# sourceMappingURL=chunk-SE7TPKR2.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.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",
@@ -5182,6 +5182,7 @@ please use an LLM adapter instead.`
5182
5182
  }));
5183
5183
  }
5184
5184
  async loadAgentState(graphqlContext, threadId, agentName) {
5185
+ var _a;
5185
5186
  const agents = await this.getAllAgents(graphqlContext);
5186
5187
  const agent = agents.find((agent2) => agent2.name === agentName);
5187
5188
  if (!agent) {
@@ -5262,12 +5263,17 @@ please use an LLM adapter instead.`
5262
5263
  state = client ? (await client.threads.getState(threadId)).values : {};
5263
5264
  } catch (error) {
5264
5265
  const errorMessage = error instanceof Error ? error.message : String(error);
5265
- console.debug(`Agent '${agentName}' configuration issue: ${errorMessage}`);
5266
- throw new import_shared18.ResolvedCopilotKitError({
5267
- status: 400,
5268
- message: `Agent '${agentName}' failed to execute: ${errorMessage}`,
5269
- code: import_shared18.CopilotKitErrorCode.CONFIGURATION_ERROR
5270
- });
5266
+ const errorStatus = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) || (error == null ? void 0 : error.status);
5267
+ if (errorStatus === 404) {
5268
+ state = {};
5269
+ } else {
5270
+ console.debug(`Agent '${agentName}' configuration issue: ${errorMessage}`);
5271
+ throw new import_shared18.ResolvedCopilotKitError({
5272
+ status: 400,
5273
+ message: `Agent '${agentName}' failed to execute: ${errorMessage}`,
5274
+ code: import_shared18.CopilotKitErrorCode.CONFIGURATION_ERROR
5275
+ });
5276
+ }
5271
5277
  }
5272
5278
  if (Object.keys(state).length === 0) {
5273
5279
  return {