@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
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-SLTWS4D3.mjs";
5
+ } from "./chunk-H3ML2MWF.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
22
22
  export {
23
23
  copilotRuntimeNestEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-7ZBTD5PN.mjs.map
25
+ //# sourceMappingURL=chunk-WXNKOOVD.mjs.map
package/dist/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",
@@ -5506,7 +5506,7 @@ please use an LLM adapter instead.`
5506
5506
  }
5507
5507
  }
5508
5508
  async getServerSideActions(request) {
5509
- var _a, _b;
5509
+ var _a, _b, _c;
5510
5510
  const { graphqlContext, messages: rawMessages, agentStates, url } = request;
5511
5511
  const inputMessages = convertGqlInputToMessages(rawMessages);
5512
5512
  const langserveFunctions = [];
@@ -5529,7 +5529,8 @@ please use an LLM adapter instead.`
5529
5529
  agentStates,
5530
5530
  frontendUrl: url,
5531
5531
  agents: this.agents,
5532
- metaEvents: request.metaEvents
5532
+ metaEvents: request.metaEvents,
5533
+ nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName
5533
5534
  });
5534
5535
  const configuredActions = typeof this.actions === "function" ? this.actions({
5535
5536
  properties: graphqlContext.properties,
@@ -5538,7 +5539,7 @@ please use an LLM adapter instead.`
5538
5539
  const requestSpecificMCPActions = [];
5539
5540
  if (this.createMCPClientImpl) {
5540
5541
  const baseEndpoints = this.mcpServersConfig || [];
5541
- const requestEndpoints = ((_a = graphqlContext.properties) == null ? void 0 : _a.mcpServers) || ((_b = graphqlContext.properties) == null ? void 0 : _b.mcpEndpoints) || [];
5542
+ const requestEndpoints = ((_b = graphqlContext.properties) == null ? void 0 : _b.mcpServers) || ((_c = graphqlContext.properties) == null ? void 0 : _c.mcpEndpoints) || [];
5542
5543
  const effectiveEndpointsMap = /* @__PURE__ */ new Map();
5543
5544
  [
5544
5545
  ...baseEndpoints
@@ -6272,7 +6273,7 @@ var import_shared26 = require("@copilotkit/shared");
6272
6273
 
6273
6274
  // src/lib/runtime/agui-action.ts
6274
6275
  var import_shared24 = require("@copilotkit/shared");
6275
- function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents }) {
6276
+ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName }) {
6276
6277
  const action = {
6277
6278
  name: agent.agentId,
6278
6279
  description: agent.description,
@@ -6307,11 +6308,19 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
6307
6308
  parameters: JSON.parse(input.jsonSchema)
6308
6309
  };
6309
6310
  });
6310
- const forwardedProps = metaEvents.length ? {
6311
- command: {
6312
- resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
6313
- }
6314
- } : void 0;
6311
+ const forwardedProps = {
6312
+ ...(metaEvents == null ? void 0 : metaEvents.length) ? {
6313
+ command: {
6314
+ resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
6315
+ }
6316
+ } : {},
6317
+ ...threadMetadata ? {
6318
+ threadMetadata
6319
+ } : {},
6320
+ ...nodeName ? {
6321
+ nodeName
6322
+ } : {}
6323
+ };
6315
6324
  return agent.legacy_to_be_removed_runAgentBridged({
6316
6325
  tools,
6317
6326
  forwardedProps
@@ -6425,13 +6434,15 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
6425
6434
  }
6426
6435
  }
6427
6436
  __name(fetchRemoteInfo, "fetchRemoteInfo");
6428
- async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents }) {
6437
+ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName }) {
6438
+ var _a;
6429
6439
  const logger2 = graphqlContext.logger.child({
6430
6440
  component: "remote-actions.fetchRemoteActions"
6431
6441
  });
6432
6442
  logger2.debug({
6433
6443
  remoteEndpointDefinitions
6434
6444
  }, "Fetching from remote endpoints");
6445
+ const threadMetadata = ((_a = graphqlContext.properties) == null ? void 0 : _a.threadMetadata) || {};
6435
6446
  const filtered = remoteEndpointDefinitions.filter((value, index, self) => {
6436
6447
  if (value.type === "langgraph-platform") {
6437
6448
  return value;
@@ -6488,7 +6499,9 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
6488
6499
  messages,
6489
6500
  agentStates,
6490
6501
  agent,
6491
- metaEvents
6502
+ metaEvents,
6503
+ threadMetadata,
6504
+ nodeName
6492
6505
  }));
6493
6506
  }
6494
6507
  return result.flat();