@copilotkit/runtime 1.9.2-next.15 → 1.9.2-next.17

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 (34) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{chunk-SBSDOLSI.mjs → chunk-6QK2NO6W.mjs} +2 -2
  3. package/dist/{chunk-WRTZZ52D.mjs → chunk-7EDOHCIU.mjs} +2 -2
  4. package/dist/{chunk-XJBX2ZN2.mjs → chunk-CORCJNXR.mjs} +2 -2
  5. package/dist/{chunk-SLTWS4D3.mjs → chunk-H3ML2MWF.mjs} +26 -13
  6. package/dist/chunk-H3ML2MWF.mjs.map +1 -0
  7. package/dist/{chunk-7ZBTD5PN.mjs → chunk-WXNKOOVD.mjs} +2 -2
  8. package/dist/index.js +25 -12
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +5 -5
  11. package/dist/lib/index.js +25 -12
  12. package/dist/lib/index.js.map +1 -1
  13. package/dist/lib/index.mjs +5 -5
  14. package/dist/lib/integrations/index.js +1 -1
  15. package/dist/lib/integrations/index.js.map +1 -1
  16. package/dist/lib/integrations/index.mjs +4 -4
  17. package/dist/lib/integrations/nest/index.js +1 -1
  18. package/dist/lib/integrations/nest/index.js.map +1 -1
  19. package/dist/lib/integrations/nest/index.mjs +2 -2
  20. package/dist/lib/integrations/node-express/index.js +1 -1
  21. package/dist/lib/integrations/node-express/index.js.map +1 -1
  22. package/dist/lib/integrations/node-express/index.mjs +2 -2
  23. package/dist/lib/integrations/node-http/index.js +1 -1
  24. package/dist/lib/integrations/node-http/index.js.map +1 -1
  25. package/dist/lib/integrations/node-http/index.mjs +1 -1
  26. package/package.json +2 -2
  27. package/src/lib/runtime/agui-action.ts +9 -3
  28. package/src/lib/runtime/copilot-runtime.ts +1 -0
  29. package/src/lib/runtime/remote-actions.ts +6 -0
  30. package/dist/chunk-SLTWS4D3.mjs.map +0 -1
  31. /package/dist/{chunk-SBSDOLSI.mjs.map → chunk-6QK2NO6W.mjs.map} +0 -0
  32. /package/dist/{chunk-WRTZZ52D.mjs.map → chunk-7EDOHCIU.mjs.map} +0 -0
  33. /package/dist/{chunk-XJBX2ZN2.mjs.map → chunk-CORCJNXR.mjs.map} +0 -0
  34. /package/dist/{chunk-7ZBTD5PN.mjs.map → chunk-WXNKOOVD.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  CustomEventNames,
3
3
  LangGraphAgent
4
- } from "./chunk-XJBX2ZN2.mjs";
4
+ } from "./chunk-CORCJNXR.mjs";
5
5
  import {
6
6
  config,
7
7
  copilotRuntimeNextJSAppRouterEndpoint,
8
8
  copilotRuntimeNextJSPagesRouterEndpoint
9
- } from "./chunk-WRTZZ52D.mjs";
9
+ } from "./chunk-7EDOHCIU.mjs";
10
10
  import {
11
11
  copilotRuntimeNestEndpoint
12
- } from "./chunk-7ZBTD5PN.mjs";
12
+ } from "./chunk-WXNKOOVD.mjs";
13
13
  import {
14
14
  copilotRuntimeNodeExpressEndpoint
15
- } from "./chunk-SBSDOLSI.mjs";
15
+ } from "./chunk-6QK2NO6W.mjs";
16
16
  import {
17
17
  CopilotRuntime,
18
18
  addCustomHeaderPlugin,
@@ -28,7 +28,7 @@ import {
28
28
  getCommonConfig,
29
29
  langGraphPlatformEndpoint,
30
30
  resolveEndpointType
31
- } from "./chunk-SLTWS4D3.mjs";
31
+ } from "./chunk-H3ML2MWF.mjs";
32
32
  import "./chunk-SHBDMA63.mjs";
33
33
  import {
34
34
  AnthropicAdapter,
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.9.2-next.15",
47
+ version: "1.9.2-next.17",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -5052,7 +5052,7 @@ please use an LLM adapter instead.`
5052
5052
  }
5053
5053
  }
5054
5054
  async getServerSideActions(request) {
5055
- var _a, _b;
5055
+ var _a, _b, _c;
5056
5056
  const { graphqlContext, messages: rawMessages, agentStates, url } = request;
5057
5057
  const inputMessages = convertGqlInputToMessages(rawMessages);
5058
5058
  const langserveFunctions = [];
@@ -5075,7 +5075,8 @@ please use an LLM adapter instead.`
5075
5075
  agentStates,
5076
5076
  frontendUrl: url,
5077
5077
  agents: this.agents,
5078
- metaEvents: request.metaEvents
5078
+ metaEvents: request.metaEvents,
5079
+ nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName
5079
5080
  });
5080
5081
  const configuredActions = typeof this.actions === "function" ? this.actions({
5081
5082
  properties: graphqlContext.properties,
@@ -5084,7 +5085,7 @@ please use an LLM adapter instead.`
5084
5085
  const requestSpecificMCPActions = [];
5085
5086
  if (this.createMCPClientImpl) {
5086
5087
  const baseEndpoints = this.mcpServersConfig || [];
5087
- const requestEndpoints = ((_a = graphqlContext.properties) == null ? void 0 : _a.mcpServers) || ((_b = graphqlContext.properties) == null ? void 0 : _b.mcpEndpoints) || [];
5088
+ const requestEndpoints = ((_b = graphqlContext.properties) == null ? void 0 : _b.mcpServers) || ((_c = graphqlContext.properties) == null ? void 0 : _c.mcpEndpoints) || [];
5088
5089
  const effectiveEndpointsMap = /* @__PURE__ */ new Map();
5089
5090
  [
5090
5091
  ...baseEndpoints
@@ -5818,7 +5819,7 @@ var import_shared23 = require("@copilotkit/shared");
5818
5819
 
5819
5820
  // src/lib/runtime/agui-action.ts
5820
5821
  var import_shared21 = require("@copilotkit/shared");
5821
- function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents }) {
5822
+ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName }) {
5822
5823
  const action = {
5823
5824
  name: agent.agentId,
5824
5825
  description: agent.description,
@@ -5853,11 +5854,19 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
5853
5854
  parameters: JSON.parse(input.jsonSchema)
5854
5855
  };
5855
5856
  });
5856
- const forwardedProps = metaEvents.length ? {
5857
- command: {
5858
- resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
5859
- }
5860
- } : void 0;
5857
+ const forwardedProps = {
5858
+ ...(metaEvents == null ? void 0 : metaEvents.length) ? {
5859
+ command: {
5860
+ resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
5861
+ }
5862
+ } : {},
5863
+ ...threadMetadata ? {
5864
+ threadMetadata
5865
+ } : {},
5866
+ ...nodeName ? {
5867
+ nodeName
5868
+ } : {}
5869
+ };
5861
5870
  return agent.legacy_to_be_removed_runAgentBridged({
5862
5871
  tools,
5863
5872
  forwardedProps
@@ -5971,13 +5980,15 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
5971
5980
  }
5972
5981
  }
5973
5982
  __name(fetchRemoteInfo, "fetchRemoteInfo");
5974
- async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents }) {
5983
+ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName }) {
5984
+ var _a;
5975
5985
  const logger2 = graphqlContext.logger.child({
5976
5986
  component: "remote-actions.fetchRemoteActions"
5977
5987
  });
5978
5988
  logger2.debug({
5979
5989
  remoteEndpointDefinitions
5980
5990
  }, "Fetching from remote endpoints");
5991
+ const threadMetadata = ((_a = graphqlContext.properties) == null ? void 0 : _a.threadMetadata) || {};
5981
5992
  const filtered = remoteEndpointDefinitions.filter((value, index, self) => {
5982
5993
  if (value.type === "langgraph-platform") {
5983
5994
  return value;
@@ -6034,7 +6045,9 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
6034
6045
  messages,
6035
6046
  agentStates,
6036
6047
  agent,
6037
- metaEvents
6048
+ metaEvents,
6049
+ threadMetadata,
6050
+ nodeName
6038
6051
  }));
6039
6052
  }
6040
6053
  return result.flat();