@copilotkit/runtime 1.10.0-next.9 → 1.10.1-next.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 (40) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/{chunk-YU35HUT7.mjs → chunk-6YSZZSY2.mjs} +2 -2
  3. package/dist/{chunk-UWHAKVQV.mjs → chunk-ESNB6PUN.mjs} +30 -24
  4. package/dist/chunk-ESNB6PUN.mjs.map +1 -0
  5. package/dist/{chunk-253F6PVG.mjs → chunk-FJJL7HIM.mjs} +2 -2
  6. package/dist/{chunk-N3L3KQIA.mjs → chunk-KBUGO2EA.mjs} +2 -2
  7. package/dist/{chunk-4GZZVKJJ.mjs → chunk-NVIJFB66.mjs} +2 -2
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +40 -34
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +5 -5
  12. package/dist/lib/index.d.ts +1 -1
  13. package/dist/lib/index.js +40 -34
  14. package/dist/lib/index.js.map +1 -1
  15. package/dist/lib/index.mjs +5 -5
  16. package/dist/lib/integrations/index.d.ts +2 -2
  17. package/dist/lib/integrations/index.js +2 -2
  18. package/dist/lib/integrations/index.js.map +1 -1
  19. package/dist/lib/integrations/index.mjs +4 -4
  20. package/dist/lib/integrations/nest/index.d.ts +1 -1
  21. package/dist/lib/integrations/nest/index.js +2 -2
  22. package/dist/lib/integrations/nest/index.js.map +1 -1
  23. package/dist/lib/integrations/nest/index.mjs +2 -2
  24. package/dist/lib/integrations/node-express/index.d.ts +1 -1
  25. package/dist/lib/integrations/node-express/index.js +2 -2
  26. package/dist/lib/integrations/node-express/index.js.map +1 -1
  27. package/dist/lib/integrations/node-express/index.mjs +2 -2
  28. package/dist/lib/integrations/node-http/index.d.ts +1 -1
  29. package/dist/lib/integrations/node-http/index.js +2 -2
  30. package/dist/lib/integrations/node-http/index.js.map +1 -1
  31. package/dist/lib/integrations/node-http/index.mjs +1 -1
  32. package/dist/{shared-96b46379.d.ts → shared-c4e81118.d.ts} +1 -1
  33. package/package.json +3 -3
  34. package/src/lib/runtime/agui-action.ts +15 -6
  35. package/src/lib/runtime/copilot-runtime.ts +1 -1
  36. package/dist/chunk-UWHAKVQV.mjs.map +0 -1
  37. /package/dist/{chunk-YU35HUT7.mjs.map → chunk-6YSZZSY2.mjs.map} +0 -0
  38. /package/dist/{chunk-253F6PVG.mjs.map → chunk-FJJL7HIM.mjs.map} +0 -0
  39. /package/dist/{chunk-N3L3KQIA.mjs.map → chunk-KBUGO2EA.mjs.map} +0 -0
  40. /package/dist/{chunk-4GZZVKJJ.mjs.map → chunk-NVIJFB66.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.10.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @copilotkit/shared@1.10.1-next.0
8
+
9
+ ## 1.10.0
10
+
11
+ ### Patch Changes
12
+
13
+ - 1abcecf: - fix: add graphqlContext to constructAGUIRemoteAction for enhanced agent properties
14
+
15
+ - Updated constructAGUIRemoteAction to accept graphqlContext, allowing forwarding of properties like Authorization token to the agent.
16
+ - Modified setupRemoteActions to include graphqlContext in the parameters.
17
+
18
+ - 6f2f54b: - fix(openai): update maxTokens parameter to max_completion_tokens in OpenAIAdapter
19
+ - b5b94b9: - fix: throw errors when they happen with agui streams
20
+ - 824fb69: - fix: pass config to the forwarded props of an agui agent
21
+ - 59b0e16: - feat: add native prompt caching support to AnthropicAdapter
22
+ - a31443c: removed unused dependency on ip module
23
+ - dc6df18: - feat: use latest agui langgraph package
24
+ - chore: release python sdk 0.1.58
25
+ - Updated dependencies [a8c0263]
26
+ - Updated dependencies [8674da1]
27
+ - Updated dependencies [6d1de58]
28
+ - @copilotkit/shared@1.10.0
29
+
30
+ ## 1.10.0-next.13
31
+
32
+ ### Patch Changes
33
+
34
+ - b5b94b9: - fix: throw errors when they happen with agui streams
35
+ - @copilotkit/shared@1.10.0-next.13
36
+
37
+ ## 1.10.0-next.12
38
+
39
+ ### Patch Changes
40
+
41
+ - @copilotkit/shared@1.10.0-next.12
42
+
43
+ ## 1.10.0-next.11
44
+
45
+ ### Patch Changes
46
+
47
+ - dc6df18: - feat: use latest agui langgraph package
48
+ - chore: release python sdk 0.1.58
49
+ - @copilotkit/shared@1.10.0-next.11
50
+
51
+ ## 1.10.0-next.10
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [6d1de58]
56
+ - @copilotkit/shared@1.10.0-next.10
57
+
3
58
  ## 1.10.0-next.9
4
59
 
5
60
  ### Patch Changes
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-UWHAKVQV.mjs";
5
+ } from "./chunk-ESNB6PUN.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-YU35HUT7.mjs.map
25
+ //# sourceMappingURL=chunk-6YSZZSY2.mjs.map
@@ -40,7 +40,7 @@ var require_package = __commonJS({
40
40
  publishConfig: {
41
41
  access: "public"
42
42
  },
43
- version: "1.10.0-next.9",
43
+ version: "1.10.1-next.0",
44
44
  sideEffects: false,
45
45
  main: "./dist/index.js",
46
46
  module: "./dist/index.mjs",
@@ -81,7 +81,7 @@ var require_package = __commonJS({
81
81
  "@ag-ui/client": "0.0.35",
82
82
  "@ag-ui/core": "0.0.35",
83
83
  "@ag-ui/encoder": "0.0.35",
84
- "@ag-ui/langgraph": "0.0.7",
84
+ "@ag-ui/langgraph": "0.0.8",
85
85
  "@ag-ui/proto": "0.0.35",
86
86
  "@anthropic-ai/sdk": "^0.57.0",
87
87
  "@copilotkit/shared": "workspace:*",
@@ -1486,12 +1486,12 @@ GenerateCopilotResponseInput = _ts_decorate15([
1486
1486
  import { Repeater } from "graphql-yoga";
1487
1487
 
1488
1488
  // src/service-adapters/events.ts
1489
- import { CopilotKitError as CopilotKitError6, CopilotKitErrorCode as CopilotKitErrorCode4, CopilotKitLowLevelError as CopilotKitLowLevelError7, ensureStructuredError as ensureStructuredError3, randomId as randomId2, Severity } from "@copilotkit/shared";
1489
+ import { CopilotKitError as CopilotKitError7, CopilotKitErrorCode as CopilotKitErrorCode5, CopilotKitLowLevelError as CopilotKitLowLevelError7, ensureStructuredError as ensureStructuredError3, randomId as randomId2, Severity } from "@copilotkit/shared";
1490
1490
  import { plainToInstance as plainToInstance2 } from "class-transformer";
1491
- import { catchError as catchError2, concat, concatMap, EMPTY, firstValueFrom, from as from2, of, ReplaySubject as ReplaySubject2, scan as scan2 } from "rxjs";
1491
+ import { catchError as catchError3, concat, concatMap, EMPTY, firstValueFrom, from as from2, of, ReplaySubject as ReplaySubject2, scan as scan2 } from "rxjs";
1492
1492
 
1493
1493
  // src/lib/runtime/remote-actions.ts
1494
- import { CopilotKitErrorCode as CopilotKitErrorCode3 } from "@copilotkit/shared";
1494
+ import { CopilotKitErrorCode as CopilotKitErrorCode4 } from "@copilotkit/shared";
1495
1495
 
1496
1496
  // src/lib/runtime/remote-action-constructors.ts
1497
1497
  import { createHash as createHash3 } from "crypto";
@@ -4366,10 +4366,11 @@ function createHeaders(onBeforeRequest, graphqlContext) {
4366
4366
  __name(createHeaders, "createHeaders");
4367
4367
 
4368
4368
  // src/lib/runtime/remote-actions.ts
4369
- import { CopilotKitLowLevelError as CopilotKitLowLevelError6, ResolvedCopilotKitError as ResolvedCopilotKitError3, CopilotKitError as CopilotKitError5 } from "@copilotkit/shared";
4369
+ import { CopilotKitLowLevelError as CopilotKitLowLevelError6, ResolvedCopilotKitError as ResolvedCopilotKitError3, CopilotKitError as CopilotKitError6 } from "@copilotkit/shared";
4370
4370
 
4371
4371
  // src/lib/runtime/agui-action.ts
4372
- import { parseJson as parseJson3 } from "@copilotkit/shared";
4372
+ import { catchError as catchError2 } from "rxjs";
4373
+ import { CopilotKitError as CopilotKitError5, CopilotKitErrorCode as CopilotKitErrorCode3, parseJson as parseJson3 } from "@copilotkit/shared";
4373
4374
  function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, graphqlContext }) {
4374
4375
  const action = {
4375
4376
  name: agent.agentId,
@@ -4426,7 +4427,12 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
4426
4427
  return agent.legacy_to_be_removed_runAgentBridged({
4427
4428
  tools,
4428
4429
  forwardedProps
4429
- });
4430
+ }).pipe(catchError2((err) => {
4431
+ throw new CopilotKitError5({
4432
+ message: err.message,
4433
+ code: CopilotKitErrorCode3.UNKNOWN
4434
+ });
4435
+ }));
4430
4436
  }
4431
4437
  };
4432
4438
  return [
@@ -4526,7 +4532,7 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
4526
4532
  }, "Fetched actions from url");
4527
4533
  return json;
4528
4534
  } catch (error) {
4529
- if (error instanceof CopilotKitError5) {
4535
+ if (error instanceof CopilotKitError6) {
4530
4536
  throw error;
4531
4537
  }
4532
4538
  throw new CopilotKitLowLevelError6({
@@ -4589,9 +4595,9 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
4589
4595
  }));
4590
4596
  for (const [key, agent] of Object.entries(agents)) {
4591
4597
  if (agent.agentId !== void 0 && agent.agentId !== key) {
4592
- throw new CopilotKitError5({
4598
+ throw new CopilotKitError6({
4593
4599
  message: `Agent ${key} has agentId ${agent.agentId} which does not match the key ${key}`,
4594
- code: CopilotKitErrorCode3.UNKNOWN
4600
+ code: CopilotKitErrorCode4.UNKNOWN
4595
4601
  });
4596
4602
  } else if (agent.agentId === void 0) {
4597
4603
  agent.agentId = key;
@@ -4792,7 +4798,7 @@ var RuntimeEventSource = class {
4792
4798
  executeAction(toolCallEventStream$, guardrailsResult$ ? guardrailsResult$ : null, eventWithState.action, eventWithState.args, eventWithState.actionExecutionParentMessageId, eventWithState.actionExecutionId, actionInputsWithoutAgents, threadId).catch((error) => {
4793
4799
  });
4794
4800
  telemetry_client_default.capture("oss.runtime.server_action_executed", {});
4795
- return concat(of(eventWithState.event), toolCallEventStream$).pipe(catchError2((error) => {
4801
+ return concat(of(eventWithState.event), toolCallEventStream$).pipe(catchError3((error) => {
4796
4802
  const structuredError = ensureStructuredError3(error, convertStreamingErrorToStructured2);
4797
4803
  if (this.errorHandler && this.errorContext) {
4798
4804
  from2(this.errorHandler(structuredError, {
@@ -4935,9 +4941,9 @@ function convertStreamingErrorToStructured2(error) {
4935
4941
  message: helpfulMessage
4936
4942
  });
4937
4943
  }
4938
- return new CopilotKitError6({
4944
+ return new CopilotKitError7({
4939
4945
  message: helpfulMessage,
4940
- code: CopilotKitErrorCode4.UNKNOWN,
4946
+ code: CopilotKitErrorCode5.UNKNOWN,
4941
4947
  severity: Severity.CRITICAL
4942
4948
  });
4943
4949
  }
@@ -5003,7 +5009,7 @@ AgentsResponse = _ts_decorate16([
5003
5009
  ], AgentsResponse);
5004
5010
 
5005
5011
  // src/graphql/resolvers/copilot.resolver.ts
5006
- import { CopilotKitError as CopilotKitError7, CopilotKitLowLevelError as CopilotKitLowLevelError8, isStructuredCopilotKitError as isStructuredCopilotKitError2 } from "@copilotkit/shared";
5012
+ import { CopilotKitError as CopilotKitError8, CopilotKitLowLevelError as CopilotKitLowLevelError8, isStructuredCopilotKitError as isStructuredCopilotKitError2 } from "@copilotkit/shared";
5007
5013
  function _ts_decorate17(decorators, target, key, desc) {
5008
5014
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5009
5015
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -5521,7 +5527,7 @@ var CopilotResolver = class {
5521
5527
  },
5522
5528
  error: (err) => {
5523
5529
  var _a3, _b2, _c2, _d2, _e2, _f2;
5524
- if (err instanceof CopilotKitError7 || err instanceof CopilotKitLowLevelError8 || err instanceof Error && err.name && err.name.includes("CopilotKit") || ((_a3 = err == null ? void 0 : err.extensions) == null ? void 0 : _a3.visibility)) {
5530
+ if (err instanceof CopilotKitError8 || err instanceof CopilotKitLowLevelError8 || err instanceof Error && err.name && err.name.includes("CopilotKit") || ((_a3 = err == null ? void 0 : err.extensions) == null ? void 0 : _a3.visibility)) {
5525
5531
  responseStatus$.next(new UnknownErrorResponse({
5526
5532
  description: err.message || "Agent error occurred",
5527
5533
  // Include original error information for frontend to extract
@@ -5774,7 +5780,7 @@ StateResolver = _ts_decorate20([
5774
5780
 
5775
5781
  // src/lib/integrations/shared.ts
5776
5782
  var packageJson2 = __toESM(require_package());
5777
- import { CopilotKitError as CopilotKitError8, CopilotKitErrorCode as CopilotKitErrorCode5 } from "@copilotkit/shared";
5783
+ import { CopilotKitError as CopilotKitError9, CopilotKitErrorCode as CopilotKitErrorCode6 } from "@copilotkit/shared";
5778
5784
  var logger = createLogger();
5779
5785
  var addCustomHeaderPlugin = {
5780
5786
  onResponse({ response }) {
@@ -5840,11 +5846,11 @@ function getCommonConfig(options) {
5840
5846
  }
5841
5847
  });
5842
5848
  const userErrorCodes = [
5843
- CopilotKitErrorCode5.AGENT_NOT_FOUND,
5844
- CopilotKitErrorCode5.API_NOT_FOUND,
5845
- CopilotKitErrorCode5.REMOTE_ENDPOINT_NOT_FOUND,
5846
- CopilotKitErrorCode5.CONFIGURATION_ERROR,
5847
- CopilotKitErrorCode5.MISSING_PUBLIC_API_KEY_ERROR
5849
+ CopilotKitErrorCode6.AGENT_NOT_FOUND,
5850
+ CopilotKitErrorCode6.API_NOT_FOUND,
5851
+ CopilotKitErrorCode6.REMOTE_ENDPOINT_NOT_FOUND,
5852
+ CopilotKitErrorCode6.CONFIGURATION_ERROR,
5853
+ CopilotKitErrorCode6.MISSING_PUBLIC_API_KEY_ERROR
5848
5854
  ];
5849
5855
  return {
5850
5856
  logging: createLogger({
@@ -5867,7 +5873,7 @@ function getCommonConfig(options) {
5867
5873
  console.debug("User configuration error:", error.message);
5868
5874
  return error;
5869
5875
  }
5870
- if (originalError instanceof CopilotKitError8 && userErrorCodes.includes(originalError.code)) {
5876
+ if (originalError instanceof CopilotKitError9 && userErrorCodes.includes(originalError.code)) {
5871
5877
  console.debug("User configuration error:", error.message);
5872
5878
  return error;
5873
5879
  }
@@ -5923,4 +5929,4 @@ export {
5923
5929
  getCommonConfig,
5924
5930
  copilotRuntimeNodeHttpEndpoint
5925
5931
  };
5926
- //# sourceMappingURL=chunk-UWHAKVQV.mjs.map
5932
+ //# sourceMappingURL=chunk-ESNB6PUN.mjs.map