@copilotkit/runtime 1.6.0-next.9 → 1.6.0

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 +38 -0
  2. package/dist/{chunk-4HQ5OZXN.mjs → chunk-2RP2NR4F.mjs} +2 -2
  3. package/dist/{chunk-L7OTGCAG.mjs → chunk-DUW72ZZB.mjs} +18 -9
  4. package/dist/chunk-DUW72ZZB.mjs.map +1 -0
  5. package/dist/{chunk-5ZBUMQE2.mjs → chunk-MPI4JZZR.mjs} +2 -2
  6. package/dist/{chunk-7BCFHZLY.mjs → chunk-WUMAYJP3.mjs} +2 -2
  7. package/dist/index.js +17 -8
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +17 -8
  11. package/dist/lib/index.js.map +1 -1
  12. package/dist/lib/index.mjs +4 -4
  13. package/dist/lib/integrations/index.js +3 -3
  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 +3 -3
  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 +3 -3
  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 +3 -3
  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/agents/langgraph/event-source.ts +11 -4
  27. package/src/lib/runtime/copilot-runtime.ts +9 -3
  28. package/src/lib/telemetry-client.ts +3 -1
  29. package/dist/chunk-L7OTGCAG.mjs.map +0 -1
  30. /package/dist/{chunk-4HQ5OZXN.mjs.map → chunk-2RP2NR4F.mjs.map} +0 -0
  31. /package/dist/{chunk-5ZBUMQE2.mjs.map → chunk-MPI4JZZR.mjs.map} +0 -0
  32. /package/dist/{chunk-7BCFHZLY.mjs.map → chunk-WUMAYJP3.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fea916f: - feat: support input and output schema of langgraph
8
+ - docs: add input output schema docs
9
+ - 7d061d9: - feat(configurable): execute langgraph with user config
10
+
11
+ ### Patch Changes
12
+
13
+ - 543f703: - fix: refrain from processing same tool end several times
14
+ - fix: do not register runtime set action when there are remote endpoints
15
+ - 090203d: - fix: use tryMap method to filter out possibly invalid items
16
+ - 1bb9ca2: - fix(coagents): don't fail when LangSmith API key is missing
17
+ - fix(coagents): don't check for langsmithApiKey in resolveEndpointType
18
+ - 4ddb6d2: - fix: add class validator to dependencies
19
+ - d07f49c: - fix(runtime): fix execution of runtime set backend action handlers
20
+ - 45a3e10: - feat: support latest openai api
21
+ - chore: update all openai dependencies to use latest
22
+ - feat: update adapters using openai API
23
+ - 68f7b65: - handle parsing in fail-safe fashion
24
+ - Updated dependencies [090203d]
25
+ - @copilotkit/shared@1.6.0
26
+
27
+ ## 1.6.0-next.11
28
+
29
+ ### Patch Changes
30
+
31
+ - @copilotkit/shared@1.6.0-next.11
32
+
33
+ ## 1.6.0-next.10
34
+
35
+ ### Patch Changes
36
+
37
+ - 543f703: - fix: refrain from processing same tool end several times
38
+ - fix: do not register runtime set action when there are remote endpoints
39
+ - @copilotkit/shared@1.6.0-next.10
40
+
3
41
  ## 1.6.0-next.9
4
42
 
5
43
  ### Patch Changes
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-L7OTGCAG.mjs";
5
+ } from "./chunk-DUW72ZZB.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-4HQ5OZXN.mjs.map
25
+ //# sourceMappingURL=chunk-2RP2NR4F.mjs.map
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  publishConfig: {
40
40
  access: "public"
41
41
  },
42
- version: "1.6.0-next.9",
42
+ version: "1.6.0",
43
43
  sideEffects: false,
44
44
  main: "./dist/index.js",
45
45
  module: "./dist/index.mjs",
@@ -1503,10 +1503,11 @@ var RemoteLangGraphEventSource = class {
1503
1503
  let isToolCallEnd = (responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "tool_calls";
1504
1504
  acc.isToolCallStart = toolCallChunks.some((chunk) => chunk.name && chunk.id);
1505
1505
  acc.isMessageStart = prevMessageId !== acc.lastMessageId && !acc.isToolCallStart;
1506
- if (acc.isToolCall && !toolCallCheck) {
1506
+ let previousRoundHadToolCall = acc.isToolCall;
1507
+ acc.isToolCall = toolCallCheck;
1508
+ if (previousRoundHadToolCall && !toolCallCheck) {
1507
1509
  isToolCallEnd = true;
1508
1510
  }
1509
- acc.isToolCall = toolCallCheck;
1510
1511
  acc.isToolCallEnd = isToolCallEnd;
1511
1512
  acc.isMessageEnd = (responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "stop";
1512
1513
  ({ name: acc.lastToolCallName, id: acc.lastToolCallId } = toolCallChunks.find((chunk) => chunk.name && chunk.id) ?? {
@@ -1527,7 +1528,8 @@ var RemoteLangGraphEventSource = class {
1527
1528
  lastMessageId: null,
1528
1529
  lastToolCallId: null,
1529
1530
  lastToolCallName: null,
1530
- currentContent: null
1531
+ currentContent: null,
1532
+ processedToolCallIds: /* @__PURE__ */ new Set()
1531
1533
  }), mergeMap((acc) => {
1532
1534
  const events = [];
1533
1535
  let shouldEmitMessages = true;
@@ -1555,7 +1557,8 @@ var RemoteLangGraphEventSource = class {
1555
1557
  });
1556
1558
  }
1557
1559
  const responseMetadata = this.getResponseMetadata(acc.event);
1558
- if (acc.isToolCallEnd && this.shouldEmitToolCall(shouldEmitToolCalls, acc.lastToolCallName)) {
1560
+ if (acc.isToolCallEnd && this.shouldEmitToolCall(shouldEmitToolCalls, acc.lastToolCallName) && acc.lastToolCallId && !acc.processedToolCallIds.has(acc.lastToolCallId)) {
1561
+ acc.processedToolCallIds.add(acc.lastToolCallId);
1559
1562
  events.push({
1560
1563
  type: RuntimeEventTypes.ActionExecutionEnd,
1561
1564
  actionExecutionId: acc.lastToolCallId
@@ -1622,6 +1625,7 @@ var RemoteLangGraphEventSource = class {
1622
1625
  parentMessageId: acc.lastMessageId
1623
1626
  });
1624
1627
  } else if (acc.isMessageStart && shouldEmitMessages) {
1628
+ acc.processedToolCallIds.clear();
1625
1629
  events.push({
1626
1630
  type: RuntimeEventTypes.TextMessageStart,
1627
1631
  messageId: acc.lastMessageId
@@ -2693,7 +2697,12 @@ var CopilotRuntime = class {
2693
2697
  delegateAgentProcessingToServiceAdapter;
2694
2698
  constructor(params) {
2695
2699
  var _a, _b;
2696
- this.actions = (params == null ? void 0 : params.actions) || [];
2700
+ if ((params == null ? void 0 : params.actions) && (params == null ? void 0 : params.remoteEndpoints)) {
2701
+ console.warn("Actions set in runtime instance will be ignored when remote endpoints are set");
2702
+ this.actions = [];
2703
+ } else {
2704
+ this.actions = (params == null ? void 0 : params.actions) || [];
2705
+ }
2697
2706
  for (const chain of (params == null ? void 0 : params.langserve) || []) {
2698
2707
  const remoteChain = new RemoteChain(chain);
2699
2708
  this.langserve.push(remoteChain.toAction());
@@ -3076,7 +3085,7 @@ function langGraphPlatformEndpoint(config) {
3076
3085
  __name(langGraphPlatformEndpoint, "langGraphPlatformEndpoint");
3077
3086
  function resolveEndpointType(endpoint) {
3078
3087
  if (!endpoint.type) {
3079
- if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
3088
+ if ("deploymentUrl" in endpoint && "agents" in endpoint) {
3080
3089
  return EndpointType.LangGraphPlatform;
3081
3090
  } else {
3082
3091
  return EndpointType.CopilotKit;
@@ -3112,7 +3121,7 @@ function getRuntimeInstanceTelemetryInfo(runtime) {
3112
3121
  info = {
3113
3122
  ...info,
3114
3123
  agentsAmount: ep.agents.length,
3115
- hashedKey: createHash3("sha256").update(ep.langsmithApiKey).digest("hex")
3124
+ hashedKey: ep.langsmithApiKey ? createHash3("sha256").update(ep.langsmithApiKey).digest("hex") : null
3116
3125
  };
3117
3126
  }
3118
3127
  return info;
@@ -4296,4 +4305,4 @@ export {
4296
4305
  getCommonConfig,
4297
4306
  copilotRuntimeNodeHttpEndpoint
4298
4307
  };
4299
- //# sourceMappingURL=chunk-L7OTGCAG.mjs.map
4308
+ //# sourceMappingURL=chunk-DUW72ZZB.mjs.map