@copilotkit/runtime 1.8.14-next.2 → 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 +7 -0
  2. package/dist/{chunk-YLRGZOEQ.mjs → chunk-6P6VMQLZ.mjs} +22 -7
  3. package/dist/chunk-6P6VMQLZ.mjs.map +1 -0
  4. package/dist/{chunk-MZSUT6FW.mjs → chunk-BMA7V5T7.mjs} +2 -2
  5. package/dist/{chunk-RM7LK6G2.mjs → chunk-C7XHY7LW.mjs} +2 -2
  6. package/dist/{chunk-5FDI6FH6.mjs → chunk-T2RKWYXN.mjs} +2 -2
  7. package/dist/index.js +21 -6
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +21 -6
  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/agui-action.ts +5 -0
  28. package/src/lib/runtime/copilot-runtime.ts +1 -0
  29. package/src/lib/runtime/remote-actions.ts +3 -0
  30. package/dist/chunk-YLRGZOEQ.mjs.map +0 -1
  31. /package/dist/{chunk-MZSUT6FW.mjs.map → chunk-BMA7V5T7.mjs.map} +0 -0
  32. /package/dist/{chunk-RM7LK6G2.mjs.map → chunk-C7XHY7LW.mjs.map} +0 -0
  33. /package/dist/{chunk-5FDI6FH6.mjs.map → chunk-T2RKWYXN.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  copilotRuntimeNodeHttpEndpoint
3
- } from "../../../chunk-YLRGZOEQ.mjs";
3
+ } from "../../../chunk-6P6VMQLZ.mjs";
4
4
  import "../../../chunk-MVKCCH5U.mjs";
5
5
  import "../../../chunk-5BIEM2UU.mjs";
6
6
  import "../../../chunk-SHBDMA63.mjs";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.8.14-next.2",
12
+ "version": "1.8.14-next.3",
13
13
  "sideEffects": false,
14
14
  "main": "./dist/index.js",
15
15
  "module": "./dist/index.mjs",
@@ -64,7 +64,7 @@
64
64
  "rxjs": "^7.8.1",
65
65
  "type-graphql": "2.0.0-rc.1",
66
66
  "zod": "^3.23.3",
67
- "@copilotkit/shared": "1.8.14-next.2"
67
+ "@copilotkit/shared": "1.8.14-next.3"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@ag-ui/client": ">=0.0.28",
@@ -53,6 +53,7 @@ import {
53
53
  import telemetry from "../../lib/telemetry-client";
54
54
  import { randomId } from "@copilotkit/shared";
55
55
  import { AgentsResponse } from "../types/agents-response.type";
56
+ import { LangGraphEventTypes } from "../../agents/langgraph/events";
56
57
 
57
58
  const invokeGuardrails = async ({
58
59
  baseUrl,
@@ -263,6 +264,19 @@ export class CopilotResolver {
263
264
  return;
264
265
  }
265
266
  switch (event.name) {
267
+ // @ts-ignore
268
+ case LangGraphEventTypes.OnInterrupt:
269
+ push(
270
+ plainToInstance(LangGraphInterruptEvent, {
271
+ // @ts-ignore
272
+ type: event.type,
273
+ // @ts-ignore
274
+ name: RuntimeMetaEventName.LangGraphInterruptEvent,
275
+ // @ts-ignore
276
+ value: event.value,
277
+ }),
278
+ );
279
+ break;
266
280
  case RuntimeMetaEventName.LangGraphInterruptEvent:
267
281
  push(
268
282
  plainToInstance(LangGraphInterruptEvent, {
@@ -14,17 +14,20 @@ import {
14
14
 
15
15
  import { AbstractAgent } from "@ag-ui/client";
16
16
  import { parseJson } from "@copilotkit/shared";
17
+ import { MetaEventInput } from "../../graphql/inputs/meta-event.input";
17
18
 
18
19
  export function constructAGUIRemoteAction({
19
20
  logger,
20
21
  messages,
21
22
  agentStates,
22
23
  agent,
24
+ metaEvents,
23
25
  }: {
24
26
  logger: Logger;
25
27
  messages: Message[];
26
28
  agentStates?: AgentStateInput[];
27
29
  agent: AbstractAgent;
30
+ metaEvents?: MetaEventInput[];
28
31
  }) {
29
32
  const action = {
30
33
  name: agent.agentId,
@@ -66,6 +69,8 @@ export function constructAGUIRemoteAction({
66
69
 
67
70
  return agent.legacy_to_be_removed_runAgentBridged({
68
71
  tools,
72
+ // @ts-ignore
73
+ resume: metaEvents[0]?.response,
69
74
  }) as Observable<RuntimeEvent>;
70
75
  },
71
76
  };
@@ -1130,6 +1130,7 @@ please use an LLM adapter instead.`,
1130
1130
  agentStates,
1131
1131
  frontendUrl: url,
1132
1132
  agents: this.agents,
1133
+ metaEvents: request.metaEvents,
1133
1134
  });
1134
1135
 
1135
1136
  const configuredActions =
@@ -130,6 +130,7 @@ export async function setupRemoteActions({
130
130
  agentStates,
131
131
  frontendUrl,
132
132
  agents,
133
+ metaEvents,
133
134
  }: {
134
135
  remoteEndpointDefinitions: EndpointDefinition[];
135
136
  graphqlContext: GraphQLContext;
@@ -137,6 +138,7 @@ export async function setupRemoteActions({
137
138
  agentStates?: AgentStateInput[];
138
139
  frontendUrl?: string;
139
140
  agents: Record<string, AbstractAgent>;
141
+ metaEvents?: MetaEventInput[];
140
142
  }): Promise<Action[]> {
141
143
  const logger = graphqlContext.logger.child({ component: "remote-actions.fetchRemoteActions" });
142
144
  logger.debug({ remoteEndpointDefinitions }, "Fetching from remote endpoints");
@@ -201,6 +203,7 @@ export async function setupRemoteActions({
201
203
  messages,
202
204
  agentStates,
203
205
  agent: agent,
206
+ metaEvents,
204
207
  }),
205
208
  );
206
209
  }