@copilotkit/runtime 1.8.9-next.0 → 1.8.10-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 (43) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/__snapshots__/schema/schema.graphql +1 -1
  3. package/dist/{chunk-LFB4PE32.mjs → chunk-2ICQTCH3.mjs} +34 -17
  4. package/dist/chunk-2ICQTCH3.mjs.map +1 -0
  5. package/dist/{chunk-TPDMN2N7.mjs → chunk-F2DLMRBK.mjs} +2 -2
  6. package/dist/{chunk-HEKLYCFM.mjs → chunk-MSBLW6TU.mjs} +2 -2
  7. package/dist/{chunk-AFJ3VQB4.mjs → chunk-PRF2YJTA.mjs} +2 -2
  8. package/dist/{groq-adapter-53d3fa48.d.ts → groq-adapter-4848f8e8.d.ts} +1 -1
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.js +33 -16
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +4 -4
  13. package/dist/{langserve-c9a20fe9.d.ts → langserve-4a5c9217.d.ts} +1 -1
  14. package/dist/lib/index.d.ts +3 -3
  15. package/dist/lib/index.js +33 -16
  16. package/dist/lib/index.js.map +1 -1
  17. package/dist/lib/index.mjs +4 -4
  18. package/dist/lib/integrations/index.d.ts +3 -3
  19. package/dist/lib/integrations/index.js +3 -3
  20. package/dist/lib/integrations/index.js.map +1 -1
  21. package/dist/lib/integrations/index.mjs +4 -4
  22. package/dist/lib/integrations/nest/index.d.ts +2 -2
  23. package/dist/lib/integrations/nest/index.js +3 -3
  24. package/dist/lib/integrations/nest/index.js.map +1 -1
  25. package/dist/lib/integrations/nest/index.mjs +2 -2
  26. package/dist/lib/integrations/node-express/index.d.ts +2 -2
  27. package/dist/lib/integrations/node-express/index.js +3 -3
  28. package/dist/lib/integrations/node-express/index.js.map +1 -1
  29. package/dist/lib/integrations/node-express/index.mjs +2 -2
  30. package/dist/lib/integrations/node-http/index.d.ts +2 -2
  31. package/dist/lib/integrations/node-http/index.js +3 -3
  32. package/dist/lib/integrations/node-http/index.js.map +1 -1
  33. package/dist/lib/integrations/node-http/index.mjs +1 -1
  34. package/dist/service-adapters/index.d.ts +3 -3
  35. package/dist/{shared-df478d34.d.ts → shared-a7b30781.d.ts} +1 -1
  36. package/package.json +2 -2
  37. package/src/graphql/inputs/agent-state.input.ts +1 -1
  38. package/src/lib/runtime/remote-action-constructors.ts +6 -6
  39. package/src/lib/runtime/remote-lg-action.ts +39 -7
  40. package/dist/chunk-LFB4PE32.mjs.map +0 -1
  41. /package/dist/{chunk-TPDMN2N7.mjs.map → chunk-F2DLMRBK.mjs.map} +0 -0
  42. /package/dist/{chunk-HEKLYCFM.mjs.map → chunk-MSBLW6TU.mjs.map} +0 -0
  43. /package/dist/{chunk-AFJ3VQB4.mjs.map → chunk-PRF2YJTA.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.8.10-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 742efbb: - feat: enable setting langgraph config from ui
8
+ - chore: document usage of new config
9
+ - @copilotkit/shared@1.8.10-next.0
10
+
11
+ ## 1.8.9
12
+
13
+ ### Patch Changes
14
+
15
+ - f81a526: - Fix MCP tool schema structure to match interface requirements
16
+ - add utils
17
+ - @copilotkit/shared@1.8.9
18
+
3
19
  ## 1.8.9-next.0
4
20
 
5
21
  ### Patch Changes
@@ -48,7 +48,7 @@ input AgentSessionInput {
48
48
 
49
49
  input AgentStateInput {
50
50
  agentName: String!
51
- configurable: String
51
+ config: String
52
52
  state: String!
53
53
  }
54
54
 
@@ -40,7 +40,7 @@ var require_package = __commonJS({
40
40
  publishConfig: {
41
41
  access: "public"
42
42
  },
43
- version: "1.8.9-next.0",
43
+ version: "1.8.10-next.0",
44
44
  sideEffects: false,
45
45
  main: "./dist/index.js",
46
46
  module: "./dist/index.mjs",
@@ -709,7 +709,7 @@ __name(_ts_metadata8, "_ts_metadata");
709
709
  var AgentStateInput = class {
710
710
  agentName;
711
711
  state;
712
- configurable;
712
+ config;
713
713
  };
714
714
  __name(AgentStateInput, "AgentStateInput");
715
715
  _ts_decorate8([
@@ -725,7 +725,7 @@ _ts_decorate8([
725
725
  nullable: true
726
726
  }),
727
727
  _ts_metadata8("design:type", String)
728
- ], AgentStateInput.prototype, "configurable", void 0);
728
+ ], AgentStateInput.prototype, "config", void 0);
729
729
  AgentStateInput = _ts_decorate8([
730
730
  InputType8()
731
731
  ], AgentStateInput);
@@ -1796,7 +1796,7 @@ async function execute(args) {
1796
1796
  __name(execute, "execute");
1797
1797
  async function streamEvents(controller, args) {
1798
1798
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1799
- const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, configurable, messages, actions, logger: logger2, properties, metaEvents } = args;
1799
+ const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, config: explicitConfig, messages, actions, logger: logger2, properties, metaEvents } = args;
1800
1800
  let nodeName = initialNodeName;
1801
1801
  let state = initialState;
1802
1802
  const { name, assistantId: initialAssistantId } = agent;
@@ -1893,13 +1893,30 @@ async function streamEvents(controller, args) {
1893
1893
  const graphInfo = await client.assistants.getGraph(assistantId);
1894
1894
  const graphSchema = await client.assistants.getSchemas(assistantId);
1895
1895
  const schemaKeys = getSchemaKeys(graphSchema);
1896
- if (configurable) {
1897
- const filteredConfigurable = (schemaKeys == null ? void 0 : schemaKeys.config) ? filterObjectBySchemaKeys(configurable, schemaKeys == null ? void 0 : schemaKeys.config) : configurable;
1898
- await client.assistants.update(assistantId, {
1899
- config: {
1900
- configurable: filteredConfigurable
1901
- }
1896
+ if (explicitConfig) {
1897
+ let filteredConfigurable = retrievedAssistant.config.configurable;
1898
+ if (explicitConfig.configurable) {
1899
+ filteredConfigurable = (schemaKeys == null ? void 0 : schemaKeys.config) ? filterObjectBySchemaKeys(explicitConfig == null ? void 0 : explicitConfig.configurable, schemaKeys == null ? void 0 : schemaKeys.config) : explicitConfig == null ? void 0 : explicitConfig.configurable;
1900
+ }
1901
+ const newConfig = {
1902
+ ...retrievedAssistant.config,
1903
+ ...explicitConfig,
1904
+ configurable: filteredConfigurable
1905
+ };
1906
+ const isRecursionLimitSetToDefault = retrievedAssistant.config.recursion_limit == null && explicitConfig.recursion_limit === 25;
1907
+ const configsAreDifferent = JSON.stringify(newConfig) !== JSON.stringify(retrievedAssistant.config);
1908
+ const isOnlyRecursionLimitDifferent = isRecursionLimitSetToDefault && JSON.stringify({
1909
+ ...newConfig,
1910
+ recursion_limit: null
1911
+ }) === JSON.stringify({
1912
+ ...retrievedAssistant.config,
1913
+ recursion_limit: null
1902
1914
  });
1915
+ if (configsAreDifferent && !isOnlyRecursionLimitDifferent) {
1916
+ await client.assistants.update(assistantId, {
1917
+ config: newConfig
1918
+ });
1919
+ }
1903
1920
  }
1904
1921
  if (payload.input && (schemaKeys == null ? void 0 : schemaKeys.input)) {
1905
1922
  payload.input = filterObjectBySchemaKeys(payload.input, schemaKeys.input);
@@ -2440,12 +2457,12 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
2440
2457
  hashedLgcKey: createHash2("sha256").update(endpoint.langsmithApiKey).digest("hex")
2441
2458
  });
2442
2459
  let state = {};
2443
- let configurable = {};
2460
+ let config = {};
2444
2461
  if (agentStates) {
2445
2462
  const jsonState = agentStates.find((state2) => state2.agentName === name);
2446
2463
  if (jsonState) {
2447
2464
  state = parseJson2(jsonState.state, {});
2448
- configurable = parseJson2(jsonState.configurable, {});
2465
+ config = parseJson2(jsonState.config, {});
2449
2466
  }
2450
2467
  }
2451
2468
  try {
@@ -2463,7 +2480,7 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
2463
2480
  ...additionalMessages
2464
2481
  ],
2465
2482
  state,
2466
- configurable,
2483
+ config,
2467
2484
  properties: graphqlContext.properties,
2468
2485
  actions: tryMap(actionInputsWithoutAgents, (action) => ({
2469
2486
  name: action.name,
@@ -2575,12 +2592,12 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
2575
2592
  agentsAmount: json["agents"].length
2576
2593
  });
2577
2594
  let state = {};
2578
- let configurable = {};
2595
+ let config = {};
2579
2596
  if (agentStates) {
2580
2597
  const jsonState = agentStates.find((state2) => state2.agentName === name);
2581
2598
  if (jsonState) {
2582
2599
  state = parseJson2(jsonState.state, {});
2583
- configurable = parseJson2(jsonState.configurable, {});
2600
+ config = parseJson2(jsonState.config, {});
2584
2601
  }
2585
2602
  }
2586
2603
  const fetchUrl = `${url}/agents/execute`;
@@ -2597,7 +2614,7 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
2597
2614
  ...additionalMessages
2598
2615
  ],
2599
2616
  state,
2600
- configurable,
2617
+ config,
2601
2618
  properties: graphqlContext.properties,
2602
2619
  actions: tryMap(actionInputsWithoutAgents, (action) => ({
2603
2620
  name: action.name,
@@ -5055,4 +5072,4 @@ export {
5055
5072
  getCommonConfig,
5056
5073
  copilotRuntimeNodeHttpEndpoint
5057
5074
  };
5058
- //# sourceMappingURL=chunk-LFB4PE32.mjs.map
5075
+ //# sourceMappingURL=chunk-2ICQTCH3.mjs.map