@copilotkit/runtime 1.9.2-next.12 → 1.9.2-next.13

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 (39) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-5242BPKE.mjs → chunk-6V6X7HZO.mjs} +2 -2
  3. package/dist/{chunk-67FD4ROM.mjs → chunk-CSXEYW65.mjs} +19 -19
  4. package/dist/chunk-CSXEYW65.mjs.map +1 -0
  5. package/dist/{chunk-GS7DO47Q.mjs → chunk-JTFQ5GIL.mjs} +1 -25
  6. package/dist/chunk-JTFQ5GIL.mjs.map +1 -0
  7. package/dist/{chunk-QYYJ4HZT.mjs → chunk-LNXBP675.mjs} +2 -2
  8. package/dist/{chunk-XRRSRDZR.mjs → chunk-NV2UY5BF.mjs} +2 -2
  9. package/dist/{chunk-26EZI2OL.mjs → chunk-WY337BWR.mjs} +2 -2
  10. package/dist/index.js +17 -41
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +6 -6
  13. package/dist/lib/index.js +17 -41
  14. package/dist/lib/index.js.map +1 -1
  15. package/dist/lib/index.mjs +6 -6
  16. package/dist/lib/integrations/index.js +1 -1
  17. package/dist/lib/integrations/index.js.map +1 -1
  18. package/dist/lib/integrations/index.mjs +5 -5
  19. package/dist/lib/integrations/nest/index.js +1 -1
  20. package/dist/lib/integrations/nest/index.js.map +1 -1
  21. package/dist/lib/integrations/nest/index.mjs +3 -3
  22. package/dist/lib/integrations/node-express/index.js +1 -1
  23. package/dist/lib/integrations/node-express/index.js.map +1 -1
  24. package/dist/lib/integrations/node-express/index.mjs +3 -3
  25. package/dist/lib/integrations/node-http/index.js +1 -1
  26. package/dist/lib/integrations/node-http/index.js.map +1 -1
  27. package/dist/lib/integrations/node-http/index.mjs +2 -2
  28. package/dist/service-adapters/index.js +0 -24
  29. package/dist/service-adapters/index.js.map +1 -1
  30. package/dist/service-adapters/index.mjs +1 -1
  31. package/package.json +2 -2
  32. package/src/lib/runtime/copilot-runtime.ts +17 -15
  33. package/src/service-adapters/openai/openai-adapter.ts +0 -14
  34. package/dist/chunk-67FD4ROM.mjs.map +0 -1
  35. package/dist/chunk-GS7DO47Q.mjs.map +0 -1
  36. /package/dist/{chunk-5242BPKE.mjs.map → chunk-6V6X7HZO.mjs.map} +0 -0
  37. /package/dist/{chunk-QYYJ4HZT.mjs.map → chunk-LNXBP675.mjs.map} +0 -0
  38. /package/dist/{chunk-XRRSRDZR.mjs.map → chunk-NV2UY5BF.mjs.map} +0 -0
  39. /package/dist/{chunk-26EZI2OL.mjs.map → chunk-WY337BWR.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.9.2-next.13
4
+
5
+ ### Patch Changes
6
+
7
+ - dec5527: - fix: only fetch agent state for langgraph agents
8
+ - @copilotkit/shared@1.9.2-next.13
9
+
3
10
  ## 1.9.2-next.12
4
11
 
5
12
  ### Patch Changes
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-67FD4ROM.mjs";
5
+ } from "./chunk-CSXEYW65.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
22
22
  export {
23
23
  copilotRuntimeNodeExpressEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-5242BPKE.mjs.map
25
+ //# sourceMappingURL=chunk-6V6X7HZO.mjs.map
@@ -9,7 +9,7 @@ import {
9
9
  EmptyAdapter,
10
10
  RemoteChain,
11
11
  streamLangChainResponse
12
- } from "./chunk-GS7DO47Q.mjs";
12
+ } from "./chunk-JTFQ5GIL.mjs";
13
13
  import {
14
14
  GuardrailsValidationFailureResponse,
15
15
  MessageStreamInterruptedResponse,
@@ -40,7 +40,7 @@ var require_package = __commonJS({
40
40
  publishConfig: {
41
41
  access: "public"
42
42
  },
43
- version: "1.9.2-next.12",
43
+ version: "1.9.2-next.13",
44
44
  sideEffects: false,
45
45
  main: "./dist/index.js",
46
46
  module: "./dist/index.mjs",
@@ -3231,25 +3231,25 @@ please use an LLM adapter instead.`
3231
3231
  const propertyHeaders = graphqlContext.properties.authorization ? {
3232
3232
  authorization: `Bearer ${graphqlContext.properties.authorization}`
3233
3233
  } : null;
3234
- let client;
3235
- if ("endpoint" in agent && agent.endpoint.type === EndpointType.LangGraphPlatform) {
3236
- client = new LangGraphClient2({
3237
- apiUrl: agent.endpoint.deploymentUrl,
3238
- apiKey: agent.endpoint.langsmithApiKey,
3239
- defaultHeaders: {
3240
- ...propertyHeaders
3241
- }
3242
- });
3243
- } else {
3244
- const aguiAgent = graphqlContext._copilotkit.runtime.agents[agent.name];
3245
- if (!aguiAgent) {
3246
- throw new Error(`Agent: ${agent.name} could not be resolved`);
3247
- }
3248
- client = aguiAgent.client;
3234
+ const aguiAgent = graphqlContext._copilotkit.runtime.agents[agent.name];
3235
+ if (!aguiAgent) {
3236
+ throw new Error(`Agent: ${agent.name} could not be resolved`);
3249
3237
  }
3250
3238
  let state = {};
3251
3239
  try {
3252
- state = (await client.threads.getState(threadId)).values;
3240
+ let client;
3241
+ if ("endpoint" in agent && agent.endpoint.type === EndpointType.LangGraphPlatform) {
3242
+ client = new LangGraphClient2({
3243
+ apiUrl: agent.endpoint.deploymentUrl,
3244
+ apiKey: agent.endpoint.langsmithApiKey,
3245
+ defaultHeaders: {
3246
+ ...propertyHeaders
3247
+ }
3248
+ });
3249
+ } else {
3250
+ client = aguiAgent.client ?? null;
3251
+ }
3252
+ state = client ? (await client.threads.getState(threadId)).values : {};
3253
3253
  } catch (error) {
3254
3254
  const errorMessage = error instanceof Error ? error.message : String(error);
3255
3255
  console.debug(`Agent '${agentName}' configuration issue: ${errorMessage}`);
@@ -5811,4 +5811,4 @@ export {
5811
5811
  getCommonConfig,
5812
5812
  copilotRuntimeNodeHttpEndpoint
5813
5813
  };
5814
- //# sourceMappingURL=chunk-67FD4ROM.mjs.map
5814
+ //# sourceMappingURL=chunk-CSXEYW65.mjs.map