@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
package/dist/index.mjs CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  config,
4
4
  copilotRuntimeNextJSAppRouterEndpoint,
5
5
  copilotRuntimeNextJSPagesRouterEndpoint
6
- } from "./chunk-JJBN24EK.mjs";
6
+ } from "./chunk-T2RKWYXN.mjs";
7
7
  import {
8
8
  copilotRuntimeNestEndpoint
9
- } from "./chunk-WUBMXNOG.mjs";
9
+ } from "./chunk-C7XHY7LW.mjs";
10
10
  import {
11
11
  copilotRuntimeNodeExpressEndpoint
12
- } from "./chunk-KTTUYDBP.mjs";
12
+ } from "./chunk-BMA7V5T7.mjs";
13
13
  import {
14
14
  CopilotRuntime,
15
15
  addCustomHeaderPlugin,
@@ -25,7 +25,7 @@ import {
25
25
  getCommonConfig,
26
26
  langGraphPlatformEndpoint,
27
27
  resolveEndpointType
28
- } from "./chunk-F4NU7EVL.mjs";
28
+ } from "./chunk-6P6VMQLZ.mjs";
29
29
  import {
30
30
  AnthropicAdapter,
31
31
  EmptyAdapter,
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.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",
@@ -3936,9 +3936,9 @@ __name(createHeaders, "createHeaders");
3936
3936
  // src/lib/runtime/remote-actions.ts
3937
3937
  var import_shared15 = require("@copilotkit/shared");
3938
3938
 
3939
- // src/lib/runtime/agentwire-action.ts
3939
+ // src/lib/runtime/agui-action.ts
3940
3940
  var import_shared13 = require("@copilotkit/shared");
3941
- function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates, agent }) {
3941
+ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents }) {
3942
3942
  const action = {
3943
3943
  name: agent.agentId,
3944
3944
  description: agent.description,
@@ -3946,10 +3946,11 @@ function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates
3946
3946
  handler: async (_args) => {
3947
3947
  },
3948
3948
  remoteAgentHandler: async ({ actionInputsWithoutAgents, threadId }) => {
3949
+ var _a;
3949
3950
  logger2.debug({
3950
3951
  actionName: agent.agentId
3951
3952
  }, "Executing remote agent");
3952
- const agentWireMessages = convertMessagesToAgentWire(messages);
3953
+ const agentWireMessages = convertMessagesToAGUIMessage(messages);
3953
3954
  agent.messages = agentWireMessages;
3954
3955
  agent.threadId = threadId;
3955
3956
  telemetry_client_default.capture("oss.runtime.remote_action_executed", {
@@ -3973,7 +3974,9 @@ function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates
3973
3974
  };
3974
3975
  });
3975
3976
  return agent.legacy_to_be_removed_runAgentBridged({
3976
- tools
3977
+ tools,
3978
+ // @ts-ignore
3979
+ resume: (_a = metaEvents[0]) == null ? void 0 : _a.response
3977
3980
  });
3978
3981
  }
3979
3982
  };
@@ -3981,8 +3984,8 @@ function constructAgentWireRemoteAction({ logger: logger2, messages, agentStates
3981
3984
  action
3982
3985
  ];
3983
3986
  }
3984
- __name(constructAgentWireRemoteAction, "constructAgentWireRemoteAction");
3985
- function convertMessagesToAgentWire(messages) {
3987
+ __name(constructAGUIRemoteAction, "constructAGUIRemoteAction");
3988
+ function convertMessagesToAGUIMessage(messages) {
3986
3989
  const result = [];
3987
3990
  for (const message of messages) {
3988
3991
  if (message.isTextMessage()) {
@@ -4026,7 +4029,7 @@ function convertMessagesToAgentWire(messages) {
4026
4029
  }
4027
4030
  return result;
4028
4031
  }
4029
- __name(convertMessagesToAgentWire, "convertMessagesToAgentWire");
4032
+ __name(convertMessagesToAGUIMessage, "convertMessagesToAGUIMessage");
4030
4033
 
4031
4034
  // src/lib/runtime/remote-actions.ts
4032
4035
  var EndpointType;
@@ -4084,7 +4087,7 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
4084
4087
  }
4085
4088
  }
4086
4089
  __name(fetchRemoteInfo, "fetchRemoteInfo");
4087
- async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents }) {
4090
+ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents }) {
4088
4091
  const logger2 = graphqlContext.logger.child({
4089
4092
  component: "remote-actions.fetchRemoteActions"
4090
4093
  });
@@ -4142,11 +4145,12 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
4142
4145
  } else if (agent.agentId === void 0) {
4143
4146
  agent.agentId = key;
4144
4147
  }
4145
- result.push(constructAgentWireRemoteAction({
4148
+ result.push(constructAGUIRemoteAction({
4146
4149
  logger: logger2,
4147
4150
  messages,
4148
4151
  agentStates,
4149
- agent
4152
+ agent,
4153
+ metaEvents
4150
4154
  }));
4151
4155
  }
4152
4156
  return result.flat();
@@ -4640,7 +4644,6 @@ var CopilotRuntime = class {
4640
4644
  }
4641
4645
  return newMessages;
4642
4646
  }
4643
- // --- MCP Instruction Injection Method ---
4644
4647
  async processRuntimeRequest(request) {
4645
4648
  var _a, _b, _c, _d, _e;
4646
4649
  const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey } = request;
@@ -5210,7 +5213,8 @@ please use an LLM adapter instead.`
5210
5213
  messages: inputMessages,
5211
5214
  agentStates,
5212
5215
  frontendUrl: url,
5213
- agents: this.agents
5216
+ agents: this.agents,
5217
+ metaEvents: request.metaEvents
5214
5218
  });
5215
5219
  const configuredActions = typeof this.actions === "function" ? this.actions({
5216
5220
  properties: graphqlContext.properties,
@@ -5918,6 +5922,16 @@ var CopilotResolver = class {
5918
5922
  return;
5919
5923
  }
5920
5924
  switch (event.name) {
5925
+ case LangGraphEventTypes.OnInterrupt:
5926
+ push((0, import_class_transformer3.plainToInstance)(LangGraphInterruptEvent, {
5927
+ // @ts-ignore
5928
+ type: event.type,
5929
+ // @ts-ignore
5930
+ name: RuntimeMetaEventName.LangGraphInterruptEvent,
5931
+ // @ts-ignore
5932
+ value: event.value
5933
+ }));
5934
+ break;
5921
5935
  case RuntimeMetaEventName.LangGraphInterruptEvent:
5922
5936
  push((0, import_class_transformer3.plainToInstance)(LangGraphInterruptEvent, {
5923
5937
  type: event.type,