@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
@@ -9,7 +9,7 @@ import {
9
9
  EmptyAdapter,
10
10
  RemoteChain,
11
11
  streamLangChainResponse
12
- } from "./chunk-QLLV2QVK.mjs";
12
+ } from "./chunk-F7IANE7Z.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.10.0-next.0",
43
+ version: "1.10.0-next.10",
44
44
  sideEffects: false,
45
45
  main: "./dist/index.js",
46
46
  module: "./dist/index.mjs",
@@ -83,7 +83,7 @@ var require_package = __commonJS({
83
83
  "@ag-ui/encoder": "0.0.35",
84
84
  "@ag-ui/langgraph": "0.0.7",
85
85
  "@ag-ui/proto": "0.0.35",
86
- "@anthropic-ai/sdk": "^0.27.3",
86
+ "@anthropic-ai/sdk": "^0.57.0",
87
87
  "@copilotkit/shared": "workspace:*",
88
88
  "@graphql-yoga/plugin-defer-stream": "^3.3.1",
89
89
  "@langchain/aws": "^0.1.9",
@@ -93,7 +93,6 @@ var require_package = __commonJS({
93
93
  "@langchain/langgraph-sdk": "^0.0.70",
94
94
  "@langchain/openai": "^0.4.2",
95
95
  "@scarf/scarf": "^1.3.0",
96
- "@types/ip": "^1.1.3",
97
96
  "class-transformer": "^0.5.1",
98
97
  "class-validator": "^0.14.1",
99
98
  express: "^4.19.2",
@@ -101,7 +100,6 @@ var require_package = __commonJS({
101
100
  "graphql-scalars": "^1.23.0",
102
101
  "graphql-yoga": "^5.3.1",
103
102
  "groq-sdk": "^0.5.0",
104
- ip: "^2.0.1",
105
103
  langchain: "^0.3.3",
106
104
  openai: "^4.85.1",
107
105
  "partial-json": "^0.1.7",
@@ -4372,7 +4370,7 @@ import { CopilotKitLowLevelError as CopilotKitLowLevelError6, ResolvedCopilotKit
4372
4370
 
4373
4371
  // src/lib/runtime/agui-action.ts
4374
4372
  import { parseJson as parseJson3 } from "@copilotkit/shared";
4375
- function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName }) {
4373
+ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, graphqlContext }) {
4376
4374
  const action = {
4377
4375
  name: agent.agentId,
4378
4376
  description: agent.description,
@@ -4393,10 +4391,12 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
4393
4391
  agentsAmount: 1
4394
4392
  });
4395
4393
  let state = {};
4394
+ let config = {};
4396
4395
  if (agentStates) {
4397
4396
  const jsonState = agentStates.find((state2) => state2.agentName === agent.agentId);
4398
4397
  if (jsonState) {
4399
4398
  state = parseJson3(jsonState.state, {});
4399
+ config = parseJson3(jsonState.config, {});
4400
4400
  }
4401
4401
  }
4402
4402
  agent.state = state;
@@ -4408,6 +4408,7 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
4408
4408
  };
4409
4409
  });
4410
4410
  const forwardedProps = {
4411
+ config,
4411
4412
  ...(metaEvents == null ? void 0 : metaEvents.length) ? {
4412
4413
  command: {
4413
4414
  resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
@@ -4418,7 +4419,9 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
4418
4419
  } : {},
4419
4420
  ...nodeName ? {
4420
4421
  nodeName
4421
- } : {}
4422
+ } : {},
4423
+ // Forward properties from the graphql context to the agent, e.g Authorization token
4424
+ ...graphqlContext.properties
4422
4425
  };
4423
4426
  return agent.legacy_to_be_removed_runAgentBridged({
4424
4427
  tools,
@@ -4600,7 +4603,8 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
4600
4603
  agent,
4601
4604
  metaEvents,
4602
4605
  threadMetadata,
4603
- nodeName
4606
+ nodeName,
4607
+ graphqlContext
4604
4608
  }));
4605
4609
  }
4606
4610
  return result.flat();
@@ -5919,4 +5923,4 @@ export {
5919
5923
  getCommonConfig,
5920
5924
  copilotRuntimeNodeHttpEndpoint
5921
5925
  };
5922
- //# sourceMappingURL=chunk-X76SZ4PE.mjs.map
5926
+ //# sourceMappingURL=chunk-RGWWA76W.mjs.map