@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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  copilotRuntimeNodeHttpEndpoint
3
- } from "../../../chunk-SLTWS4D3.mjs";
3
+ } from "../../../chunk-H3ML2MWF.mjs";
4
4
  import "../../../chunk-SHBDMA63.mjs";
5
5
  import "../../../chunk-JTFQ5GIL.mjs";
6
6
  import "../../../chunk-XWBDEXDA.mjs";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.9.2-next.15",
12
+ "version": "1.9.2-next.17",
13
13
  "sideEffects": false,
14
14
  "main": "./dist/index.js",
15
15
  "module": "./dist/index.mjs",
@@ -66,7 +66,7 @@
66
66
  "rxjs": "7.8.1",
67
67
  "type-graphql": "2.0.0-rc.1",
68
68
  "zod": "^3.23.3",
69
- "@copilotkit/shared": "1.9.2-next.15"
69
+ "@copilotkit/shared": "1.9.2-next.17"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@ag-ui/client": ">=0.0.28",
@@ -22,12 +22,16 @@ export function constructAGUIRemoteAction({
22
22
  agentStates,
23
23
  agent,
24
24
  metaEvents,
25
+ threadMetadata,
26
+ nodeName,
25
27
  }: {
26
28
  logger: Logger;
27
29
  messages: Message[];
28
30
  agentStates?: AgentStateInput[];
29
31
  agent: AbstractAgent;
30
32
  metaEvents?: MetaEventInput[];
33
+ threadMetadata?: Record<string, any>;
34
+ nodeName?: string;
31
35
  }) {
32
36
  const action = {
33
37
  name: agent.agentId,
@@ -67,9 +71,11 @@ export function constructAGUIRemoteAction({
67
71
  };
68
72
  });
69
73
 
70
- const forwardedProps = metaEvents.length
71
- ? { command: { resume: metaEvents[0]?.response } }
72
- : undefined;
74
+ const forwardedProps = {
75
+ ...(metaEvents?.length ? { command: { resume: metaEvents[0]?.response } } : {}),
76
+ ...(threadMetadata ? { threadMetadata } : {}),
77
+ ...(nodeName ? { nodeName } : {}),
78
+ };
73
79
 
74
80
  return agent.legacy_to_be_removed_runAgentBridged({
75
81
  tools,
@@ -1392,6 +1392,7 @@ please use an LLM adapter instead.`,
1392
1392
  frontendUrl: url,
1393
1393
  agents: this.agents,
1394
1394
  metaEvents: request.metaEvents,
1395
+ nodeName: request.agentSession?.nodeName,
1395
1396
  });
1396
1397
 
1397
1398
  const configuredActions =
@@ -131,6 +131,7 @@ export async function setupRemoteActions({
131
131
  frontendUrl,
132
132
  agents,
133
133
  metaEvents,
134
+ nodeName,
134
135
  }: {
135
136
  remoteEndpointDefinitions: EndpointDefinition[];
136
137
  graphqlContext: GraphQLContext;
@@ -139,10 +140,13 @@ export async function setupRemoteActions({
139
140
  frontendUrl?: string;
140
141
  agents: Record<string, AbstractAgent>;
141
142
  metaEvents?: MetaEventInput[];
143
+ nodeName?: string;
142
144
  }): Promise<Action[]> {
143
145
  const logger = graphqlContext.logger.child({ component: "remote-actions.fetchRemoteActions" });
144
146
  logger.debug({ remoteEndpointDefinitions }, "Fetching from remote endpoints");
145
147
 
148
+ const threadMetadata = (graphqlContext.properties?.threadMetadata as Record<string, any>) || {};
149
+
146
150
  // Remove duplicates of remoteEndpointDefinitions.url
147
151
  const filtered = remoteEndpointDefinitions.filter((value, index, self) => {
148
152
  if (value.type === EndpointType.LangGraphPlatform) {
@@ -204,6 +208,8 @@ export async function setupRemoteActions({
204
208
  agentStates,
205
209
  agent: agent,
206
210
  metaEvents,
211
+ threadMetadata,
212
+ nodeName,
207
213
  }),
208
214
  );
209
215
  }