@copilotkit/runtime 1.10.0-next.0 → 1.10.0-next.10

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 (44) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/{chunk-Z5WUVWW7.mjs → chunk-7QWSTCMV.mjs} +2 -2
  3. package/dist/{chunk-HB5Z72TJ.mjs → chunk-AQTTXIMS.mjs} +2 -2
  4. package/dist/{chunk-QLLV2QVK.mjs → chunk-F7IANE7Z.mjs} +66 -6
  5. package/dist/chunk-F7IANE7Z.mjs.map +1 -0
  6. package/dist/{chunk-I5VNKUWI.mjs → chunk-N2JYIOSQ.mjs} +2 -2
  7. package/dist/{chunk-X76SZ4PE.mjs → chunk-RGWWA76W.mjs} +13 -9
  8. package/dist/chunk-RGWWA76W.mjs.map +1 -0
  9. package/dist/{chunk-IMZSBLG7.mjs → chunk-WENKPOOD.mjs} +2 -2
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +76 -12
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +6 -6
  14. package/dist/lib/index.js +12 -8
  15. package/dist/lib/index.js.map +1 -1
  16. package/dist/lib/index.mjs +6 -6
  17. package/dist/lib/integrations/index.js +2 -4
  18. package/dist/lib/integrations/index.js.map +1 -1
  19. package/dist/lib/integrations/index.mjs +5 -5
  20. package/dist/lib/integrations/nest/index.js +2 -4
  21. package/dist/lib/integrations/nest/index.js.map +1 -1
  22. package/dist/lib/integrations/nest/index.mjs +3 -3
  23. package/dist/lib/integrations/node-express/index.js +2 -4
  24. package/dist/lib/integrations/node-express/index.js.map +1 -1
  25. package/dist/lib/integrations/node-express/index.mjs +3 -3
  26. package/dist/lib/integrations/node-http/index.js +2 -4
  27. package/dist/lib/integrations/node-http/index.js.map +1 -1
  28. package/dist/lib/integrations/node-http/index.mjs +2 -2
  29. package/dist/service-adapters/index.d.ts +32 -2
  30. package/dist/service-adapters/index.js +65 -5
  31. package/dist/service-adapters/index.js.map +1 -1
  32. package/dist/service-adapters/index.mjs +1 -1
  33. package/package.json +3 -5
  34. package/src/lib/runtime/agui-action.ts +8 -0
  35. package/src/lib/runtime/remote-actions.ts +1 -0
  36. package/src/service-adapters/anthropic/anthropic-adapter.ts +106 -5
  37. package/src/service-adapters/anthropic/utils.ts +1 -1
  38. package/src/service-adapters/openai/openai-adapter.ts +3 -1
  39. package/dist/chunk-QLLV2QVK.mjs.map +0 -1
  40. package/dist/chunk-X76SZ4PE.mjs.map +0 -1
  41. /package/dist/{chunk-Z5WUVWW7.mjs.map → chunk-7QWSTCMV.mjs.map} +0 -0
  42. /package/dist/{chunk-HB5Z72TJ.mjs.map → chunk-AQTTXIMS.mjs.map} +0 -0
  43. /package/dist/{chunk-I5VNKUWI.mjs.map → chunk-N2JYIOSQ.mjs.map} +0 -0
  44. /package/dist/{chunk-IMZSBLG7.mjs.map → chunk-WENKPOOD.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -2,18 +2,18 @@ import {
2
2
  CustomEventNames,
3
3
  LangGraphAgent,
4
4
  LangGraphHttpAgent
5
- } from "./chunk-I5VNKUWI.mjs";
5
+ } from "./chunk-N2JYIOSQ.mjs";
6
6
  import {
7
7
  config,
8
8
  copilotRuntimeNextJSAppRouterEndpoint,
9
9
  copilotRuntimeNextJSPagesRouterEndpoint
10
- } from "./chunk-IMZSBLG7.mjs";
10
+ } from "./chunk-WENKPOOD.mjs";
11
11
  import {
12
12
  copilotRuntimeNestEndpoint
13
- } from "./chunk-Z5WUVWW7.mjs";
13
+ } from "./chunk-7QWSTCMV.mjs";
14
14
  import {
15
15
  copilotRuntimeNodeExpressEndpoint
16
- } from "./chunk-HB5Z72TJ.mjs";
16
+ } from "./chunk-AQTTXIMS.mjs";
17
17
  import {
18
18
  CopilotRuntime,
19
19
  addCustomHeaderPlugin,
@@ -29,7 +29,7 @@ import {
29
29
  getCommonConfig,
30
30
  langGraphPlatformEndpoint,
31
31
  resolveEndpointType
32
- } from "./chunk-X76SZ4PE.mjs";
32
+ } from "./chunk-RGWWA76W.mjs";
33
33
  import "./chunk-SHBDMA63.mjs";
34
34
  import {
35
35
  AnthropicAdapter,
@@ -44,7 +44,7 @@ import {
44
44
  OpenAIAssistantAdapter,
45
45
  RemoteChain,
46
46
  UnifyAdapter
47
- } from "./chunk-QLLV2QVK.mjs";
47
+ } from "./chunk-F7IANE7Z.mjs";
48
48
  import {
49
49
  GuardrailsValidationFailureResponse,
50
50
  MessageStreamInterruptedResponse,
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.10.0-next.0",
47
+ version: "1.10.0-next.10",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -87,7 +87,7 @@ var require_package = __commonJS({
87
87
  "@ag-ui/encoder": "0.0.35",
88
88
  "@ag-ui/langgraph": "0.0.7",
89
89
  "@ag-ui/proto": "0.0.35",
90
- "@anthropic-ai/sdk": "^0.27.3",
90
+ "@anthropic-ai/sdk": "^0.57.0",
91
91
  "@copilotkit/shared": "workspace:*",
92
92
  "@graphql-yoga/plugin-defer-stream": "^3.3.1",
93
93
  "@langchain/aws": "^0.1.9",
@@ -97,7 +97,6 @@ var require_package = __commonJS({
97
97
  "@langchain/langgraph-sdk": "^0.0.70",
98
98
  "@langchain/openai": "^0.4.2",
99
99
  "@scarf/scarf": "^1.3.0",
100
- "@types/ip": "^1.1.3",
101
100
  "class-transformer": "^0.5.1",
102
101
  "class-validator": "^0.14.1",
103
102
  express: "^4.19.2",
@@ -105,7 +104,6 @@ var require_package = __commonJS({
105
104
  "graphql-scalars": "^1.23.0",
106
105
  "graphql-yoga": "^5.3.1",
107
106
  "groq-sdk": "^0.5.0",
108
- ip: "^2.0.1",
109
107
  langchain: "^0.3.3",
110
108
  openai: "^4.85.1",
111
109
  "partial-json": "^0.1.7",
@@ -462,7 +460,7 @@ var OpenAIAdapter = class {
462
460
  tools
463
461
  },
464
462
  ...(forwardedParameters == null ? void 0 : forwardedParameters.maxTokens) && {
465
- max_tokens: forwardedParameters.maxTokens
463
+ max_completion_tokens: forwardedParameters.maxTokens
466
464
  },
467
465
  ...(forwardedParameters == null ? void 0 : forwardedParameters.stop) && {
468
466
  stop: forwardedParameters.stop
@@ -5890,7 +5888,7 @@ var import_shared23 = require("@copilotkit/shared");
5890
5888
 
5891
5889
  // src/lib/runtime/agui-action.ts
5892
5890
  var import_shared21 = require("@copilotkit/shared");
5893
- function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName }) {
5891
+ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, graphqlContext }) {
5894
5892
  const action = {
5895
5893
  name: agent.agentId,
5896
5894
  description: agent.description,
@@ -5911,10 +5909,12 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
5911
5909
  agentsAmount: 1
5912
5910
  });
5913
5911
  let state = {};
5912
+ let config2 = {};
5914
5913
  if (agentStates) {
5915
5914
  const jsonState = agentStates.find((state2) => state2.agentName === agent.agentId);
5916
5915
  if (jsonState) {
5917
5916
  state = (0, import_shared21.parseJson)(jsonState.state, {});
5917
+ config2 = (0, import_shared21.parseJson)(jsonState.config, {});
5918
5918
  }
5919
5919
  }
5920
5920
  agent.state = state;
@@ -5926,6 +5926,7 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
5926
5926
  };
5927
5927
  });
5928
5928
  const forwardedProps = {
5929
+ config: config2,
5929
5930
  ...(metaEvents == null ? void 0 : metaEvents.length) ? {
5930
5931
  command: {
5931
5932
  resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
@@ -5936,7 +5937,9 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
5936
5937
  } : {},
5937
5938
  ...nodeName ? {
5938
5939
  nodeName
5939
- } : {}
5940
+ } : {},
5941
+ // Forward properties from the graphql context to the agent, e.g Authorization token
5942
+ ...graphqlContext.properties
5940
5943
  };
5941
5944
  return agent.legacy_to_be_removed_runAgentBridged({
5942
5945
  tools,
@@ -6118,7 +6121,8 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
6118
6121
  agent,
6119
6122
  metaEvents,
6120
6123
  threadMetadata,
6121
- nodeName
6124
+ nodeName,
6125
+ graphqlContext
6122
6126
  }));
6123
6127
  }
6124
6128
  return result.flat();