@copilotkit/runtime 1.8.14-next.0 → 1.8.14-next.2

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 (32) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{chunk-OYTCEK6Z.mjs → chunk-5FDI6FH6.mjs} +2 -2
  3. package/dist/{chunk-USZSBTBI.mjs → chunk-MZSUT6FW.mjs} +2 -2
  4. package/dist/{chunk-JCPSSHWJ.mjs → chunk-RM7LK6G2.mjs} +2 -2
  5. package/dist/{chunk-OEMQGRLR.mjs → chunk-YLRGZOEQ.mjs} +9 -10
  6. package/dist/chunk-YLRGZOEQ.mjs.map +1 -0
  7. package/dist/index.js +8 -9
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +4 -4
  10. package/dist/lib/index.js +8 -9
  11. package/dist/lib/index.js.map +1 -1
  12. package/dist/lib/index.mjs +4 -4
  13. package/dist/lib/integrations/index.js +1 -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 +1 -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 +1 -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 +1 -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/lib/runtime/{agentwire-action.ts → agui-action.ts} +8 -8
  27. package/src/lib/runtime/copilot-runtime.ts +10 -2
  28. package/src/lib/runtime/remote-actions.ts +2 -2
  29. package/dist/chunk-OEMQGRLR.mjs.map +0 -1
  30. /package/dist/{chunk-OYTCEK6Z.mjs.map → chunk-5FDI6FH6.mjs.map} +0 -0
  31. /package/dist/{chunk-USZSBTBI.mjs.map → chunk-MZSUT6FW.mjs.map} +0 -0
  32. /package/dist/{chunk-JCPSSHWJ.mjs.map → chunk-RM7LK6G2.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  copilotRuntimeNodeHttpEndpoint
3
- } from "../../../chunk-OEMQGRLR.mjs";
3
+ } from "../../../chunk-YLRGZOEQ.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.0",
12
+ "version": "1.8.14-next.2",
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.0"
67
+ "@copilotkit/shared": "1.8.14-next.2"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@ag-ui/client": ">=0.0.28",
@@ -7,15 +7,15 @@ import telemetry from "../telemetry-client";
7
7
  import { RemoteAgentHandlerParams } from "./remote-actions";
8
8
 
9
9
  import {
10
- AssistantMessage as AgentWireAssistantMessage,
11
- Message as AgentWireMessage,
10
+ AssistantMessage as AGUIAssistantMessage,
11
+ Message as AGUIMessage,
12
12
  ToolCall,
13
13
  } from "@ag-ui/client";
14
14
 
15
15
  import { AbstractAgent } from "@ag-ui/client";
16
16
  import { parseJson } from "@copilotkit/shared";
17
17
 
18
- export function constructAgentWireRemoteAction({
18
+ export function constructAGUIRemoteAction({
19
19
  logger,
20
20
  messages,
21
21
  agentStates,
@@ -37,7 +37,7 @@ export function constructAgentWireRemoteAction({
37
37
  }: RemoteAgentHandlerParams): Promise<Observable<RuntimeEvent>> => {
38
38
  logger.debug({ actionName: agent.agentId }, "Executing remote agent");
39
39
 
40
- const agentWireMessages = convertMessagesToAgentWire(messages);
40
+ const agentWireMessages = convertMessagesToAGUIMessage(messages);
41
41
  agent.messages = agentWireMessages;
42
42
  agent.threadId = threadId;
43
43
 
@@ -72,8 +72,8 @@ export function constructAgentWireRemoteAction({
72
72
  return [action];
73
73
  }
74
74
 
75
- export function convertMessagesToAgentWire(messages: Message[]): AgentWireMessage[] {
76
- const result: AgentWireMessage[] = [];
75
+ export function convertMessagesToAGUIMessage(messages: Message[]): AGUIMessage[] {
76
+ const result: AGUIMessage[] = [];
77
77
 
78
78
  for (const message of messages) {
79
79
  if (message.isTextMessage()) {
@@ -93,9 +93,9 @@ export function convertMessagesToAgentWire(messages: Message[]): AgentWireMessag
93
93
  };
94
94
 
95
95
  if (message.parentMessageId && result.some((m) => m.id === message.parentMessageId)) {
96
- const parentMessage: AgentWireAssistantMessage | undefined = result.find(
96
+ const parentMessage: AGUIAssistantMessage | undefined = result.find(
97
97
  (m) => m.id === message.parentMessageId,
98
- ) as AgentWireAssistantMessage;
98
+ ) as AGUIAssistantMessage;
99
99
  if (parentMessage.toolCalls === undefined) {
100
100
  parentMessage.toolCalls = [];
101
101
  }
@@ -193,7 +193,16 @@ export interface CopilotRuntimeConstructorParams<T extends Parameter[] | [] = []
193
193
  langserve?: RemoteChainParameters[];
194
194
 
195
195
  /*
196
- * A map of agent names to AgentWire agents.
196
+ * A map of agent names to AGUI agents.
197
+ * Example agent config:
198
+ * ```ts
199
+ * import { AbstractAgent } from "@ag-ui/client";
200
+ * // ...
201
+ * agents: {
202
+ * "support": new CustomerSupportAgent(),
203
+ * "technical": new TechnicalAgent()
204
+ * }
205
+ * ```
197
206
  */
198
207
  agents?: Record<string, AbstractAgent>;
199
208
 
@@ -416,7 +425,6 @@ export class CopilotRuntime<const T extends Parameter[] | [] = []> {
416
425
 
417
426
  return newMessages;
418
427
  }
419
- // --- MCP Instruction Injection Method ---
420
428
 
421
429
  async processRuntimeRequest(request: CopilotRuntimeRequest): Promise<CopilotRuntimeResponse> {
422
430
  const {
@@ -18,7 +18,7 @@ import {
18
18
  } from "@copilotkit/shared";
19
19
  import { MetaEventInput } from "../../graphql/inputs/meta-event.input";
20
20
  import { AbstractAgent } from "@ag-ui/client";
21
- import { constructAgentWireRemoteAction } from "./agentwire-action";
21
+ import { constructAGUIRemoteAction } from "./agui-action";
22
22
 
23
23
  export type EndpointDefinition = CopilotKitEndpoint | LangGraphPlatformEndpoint;
24
24
 
@@ -196,7 +196,7 @@ export async function setupRemoteActions({
196
196
  }
197
197
 
198
198
  result.push(
199
- constructAgentWireRemoteAction({
199
+ constructAGUIRemoteAction({
200
200
  logger,
201
201
  messages,
202
202
  agentStates,