@copilotkit/runtime 1.8.14-next.1 → 1.8.14-next.3

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 (33) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{chunk-F4NU7EVL.mjs → chunk-6P6VMQLZ.mjs} +28 -14
  3. package/dist/chunk-6P6VMQLZ.mjs.map +1 -0
  4. package/dist/{chunk-KTTUYDBP.mjs → chunk-BMA7V5T7.mjs} +2 -2
  5. package/dist/{chunk-WUBMXNOG.mjs → chunk-C7XHY7LW.mjs} +2 -2
  6. package/dist/{chunk-JJBN24EK.mjs → chunk-T2RKWYXN.mjs} +2 -2
  7. package/dist/index.js +27 -13
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +27 -13
  11. package/dist/lib/index.js.map +1 -1
  12. package/dist/lib/index.mjs +4 -4
  13. package/dist/lib/integrations/index.js +44 -1
  14. package/dist/lib/integrations/index.js.map +1 -1
  15. package/dist/lib/integrations/index.mjs +4 -4
  16. package/dist/lib/integrations/nest/index.js +44 -1
  17. package/dist/lib/integrations/nest/index.js.map +1 -1
  18. package/dist/lib/integrations/nest/index.mjs +2 -2
  19. package/dist/lib/integrations/node-express/index.js +44 -1
  20. package/dist/lib/integrations/node-express/index.js.map +1 -1
  21. package/dist/lib/integrations/node-express/index.mjs +2 -2
  22. package/dist/lib/integrations/node-http/index.js +44 -1
  23. package/dist/lib/integrations/node-http/index.js.map +1 -1
  24. package/dist/lib/integrations/node-http/index.mjs +1 -1
  25. package/package.json +2 -2
  26. package/src/graphql/resolvers/copilot.resolver.ts +14 -0
  27. package/src/lib/runtime/{agentwire-action.ts → agui-action.ts} +13 -8
  28. package/src/lib/runtime/copilot-runtime.ts +11 -2
  29. package/src/lib/runtime/remote-actions.ts +5 -2
  30. package/dist/chunk-F4NU7EVL.mjs.map +0 -1
  31. /package/dist/{chunk-KTTUYDBP.mjs.map → chunk-BMA7V5T7.mjs.map} +0 -0
  32. /package/dist/{chunk-WUBMXNOG.mjs.map → chunk-C7XHY7LW.mjs.map} +0 -0
  33. /package/dist/{chunk-JJBN24EK.mjs.map → chunk-T2RKWYXN.mjs.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-F4NU7EVL.mjs";
5
+ } from "./chunk-6P6VMQLZ.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
22
22
  export {
23
23
  copilotRuntimeNodeExpressEndpoint
24
24
  };
25
- //# sourceMappingURL=chunk-KTTUYDBP.mjs.map
25
+ //# sourceMappingURL=chunk-BMA7V5T7.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  copilotRuntimeNodeHttpEndpoint,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-F4NU7EVL.mjs";
5
+ } from "./chunk-6P6VMQLZ.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-WUBMXNOG.mjs.map
25
+ //# sourceMappingURL=chunk-C7XHY7LW.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  getCommonConfig,
3
3
  getRuntimeInstanceTelemetryInfo,
4
4
  telemetry_client_default
5
- } from "./chunk-F4NU7EVL.mjs";
5
+ } from "./chunk-6P6VMQLZ.mjs";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-FHD4JECV.mjs";
@@ -77,4 +77,4 @@ export {
77
77
  config,
78
78
  copilotRuntimeNextJSPagesRouterEndpoint
79
79
  };
80
- //# sourceMappingURL=chunk-JJBN24EK.mjs.map
80
+ //# sourceMappingURL=chunk-T2RKWYXN.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.8.14-next.1",
47
+ version: "1.8.14-next.3",
48
48
  sideEffects: false,
49
49
  main: "./dist/index.js",
50
50
  module: "./dist/index.mjs",
@@ -3945,9 +3945,9 @@ __name(createHeaders, "createHeaders");
3945
3945
  // src/lib/runtime/remote-actions.ts
3946
3946
  var import_shared15 = require("@copilotkit/shared");
3947
3947
 
3948
- // src/lib/runtime/agentwire-action.ts
3948
+ // src/lib/runtime/agui-action.ts
3949
3949
  var import_shared13 = require("@copilotkit/shared");
3950
- function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates, agent }) {
3950
+ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents }) {
3951
3951
  const action = {
3952
3952
  name: agent.agentId,
3953
3953
  description: agent.description,
@@ -3955,10 +3955,11 @@ function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates
3955
3955
  handler: async (_args) => {
3956
3956
  },
3957
3957
  remoteAgentHandler: async ({ actionInputsWithoutAgents, threadId }) => {
3958
+ var _a;
3958
3959
  logger2.debug({
3959
3960
  actionName: agent.agentId
3960
3961
  }, "Executing remote agent");
3961
- const agentWireMessages = convertMessagesToAgentWire(messages);
3962
+ const agentWireMessages = convertMessagesToAGUIMessage(messages);
3962
3963
  agent.messages = agentWireMessages;
3963
3964
  agent.threadId = threadId;
3964
3965
  telemetry_client_default.capture("oss.runtime.remote_action_executed", {
@@ -3982,7 +3983,9 @@ function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates
3982
3983
  };
3983
3984
  });
3984
3985
  return agent.legacy_to_be_removed_runAgentBridged({
3985
- tools
3986
+ tools,
3987
+ // @ts-ignore
3988
+ resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
3986
3989
  });
3987
3990
  }
3988
3991
  };
@@ -3990,8 +3993,8 @@ function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates
3990
3993
  action
3991
3994
  ];
3992
3995
  }
3993
- __name(constructAgentWireRemoteAction, "constructAgentWireRemoteAction");
3994
- function convertMessagesToAgentWire(messages) {
3996
+ __name(constructAGUIRemoteAction, "constructAGUIRemoteAction");
3997
+ function convertMessagesToAGUIMessage(messages) {
3995
3998
  const result = [];
3996
3999
  for (const message of messages) {
3997
4000
  if (message.isTextMessage()) {
@@ -4035,7 +4038,7 @@ function convertMessagesToAgentWire(messages) {
4035
4038
  }
4036
4039
  return result;
4037
4040
  }
4038
- __name(convertMessagesToAgentWire, "convertMessagesToAgentWire");
4041
+ __name(convertMessagesToAGUIMessage, "convertMessagesToAGUIMessage");
4039
4042
 
4040
4043
  // src/lib/runtime/remote-actions.ts
4041
4044
  var EndpointType;
@@ -4093,7 +4096,7 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
4093
4096
  }
4094
4097
  }
4095
4098
  __name(fetchRemoteInfo, "fetchRemoteInfo");
4096
- async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents }) {
4099
+ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents }) {
4097
4100
  const logger2 = graphqlContext.logger.child({
4098
4101
  component: "remote-actions.fetchRemoteActions"
4099
4102
  });
@@ -4151,11 +4154,12 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
4151
4154
  } else if (agent.agentId === void 0) {
4152
4155
  agent.agentId = key;
4153
4156
  }
4154
- result.push(constructAgentWireRemoteAction({
4157
+ result.push(constructAGUIRemoteAction({
4155
4158
  logger: logger2,
4156
4159
  messages,
4157
4160
  agentStates,
4158
- agent
4161
+ agent,
4162
+ metaEvents
4159
4163
  }));
4160
4164
  }
4161
4165
  return result.flat();
@@ -5024,7 +5028,6 @@ var CopilotRuntime = class {
5024
5028
  }
5025
5029
  return newMessages;
5026
5030
  }
5027
- // --- MCP Instruction Injection Method ---
5028
5031
  async processRuntimeRequest(request) {
5029
5032
  var _a, _b, _c, _d, _e;
5030
5033
  const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey } = request;
@@ -5594,7 +5597,8 @@ please use an LLM adapter instead.`
5594
5597
  messages: inputMessages,
5595
5598
  agentStates,
5596
5599
  frontendUrl: url,
5597
- agents: this.agents
5600
+ agents: this.agents,
5601
+ metaEvents: request.metaEvents
5598
5602
  });
5599
5603
  const configuredActions = typeof this.actions === "function" ? this.actions({
5600
5604
  properties: graphqlContext.properties,
@@ -6302,6 +6306,16 @@ var CopilotResolver = class {
6302
6306
  return;
6303
6307
  }
6304
6308
  switch (event.name) {
6309
+ case LangGraphEventTypes.OnInterrupt:
6310
+ push((0, import_class_transformer3.plainToInstance)(LangGraphInterruptEvent, {
6311
+ // @ts-ignore
6312
+ type: event.type,
6313
+ // @ts-ignore
6314
+ name: RuntimeMetaEventName.LangGraphInterruptEvent,
6315
+ // @ts-ignore
6316
+ value: event.value
6317
+ }));
6318
+ break;
6305
6319
  case RuntimeMetaEventName.LangGraphInterruptEvent:
6306
6320
  push((0, import_class_transformer3.plainToInstance)(LangGraphInterruptEvent, {
6307
6321
  type: event.type,