@copilotkit/runtime 1.50.0-beta.9 → 1.50.0

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 (182) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/dist/chunk-27JKTS6P.mjs +1704 -0
  3. package/dist/chunk-27JKTS6P.mjs.map +1 -0
  4. package/dist/{chunk-FMU55SEU.mjs → chunk-2GPTVDTO.mjs} +2 -2
  5. package/dist/chunk-3AJVKDZX.mjs +3097 -0
  6. package/dist/chunk-3AJVKDZX.mjs.map +1 -0
  7. package/dist/{chunk-BJEYMRDD.mjs → chunk-45RCC3ZS.mjs} +2 -2
  8. package/dist/chunk-4EHJ4XFJ.mjs +25 -0
  9. package/dist/chunk-4EHJ4XFJ.mjs.map +1 -0
  10. package/dist/chunk-4IANB4TC.mjs +25 -0
  11. package/dist/chunk-4IANB4TC.mjs.map +1 -0
  12. package/dist/{chunk-Z752VE75.mjs → chunk-4KES76K3.mjs} +2 -2
  13. package/dist/chunk-4OGE3SLW.mjs +3100 -0
  14. package/dist/chunk-4OGE3SLW.mjs.map +1 -0
  15. package/dist/chunk-54YJBMCP.mjs +3097 -0
  16. package/dist/chunk-54YJBMCP.mjs.map +1 -0
  17. package/dist/chunk-6ER4SZYH.mjs +74 -0
  18. package/dist/chunk-6ER4SZYH.mjs.map +1 -0
  19. package/dist/chunk-6TNSLHVR.mjs +74 -0
  20. package/dist/chunk-6TNSLHVR.mjs.map +1 -0
  21. package/dist/chunk-7V4BK7TZ.mjs +25 -0
  22. package/dist/chunk-7V4BK7TZ.mjs.map +1 -0
  23. package/dist/chunk-7YZIEXD2.mjs +74 -0
  24. package/dist/chunk-7YZIEXD2.mjs.map +1 -0
  25. package/dist/chunk-A4XHOAFU.mjs +25 -0
  26. package/dist/chunk-A4XHOAFU.mjs.map +1 -0
  27. package/dist/chunk-A555KEAD.mjs +6020 -0
  28. package/dist/chunk-A555KEAD.mjs.map +1 -0
  29. package/dist/chunk-AF73TFTX.mjs +74 -0
  30. package/dist/chunk-AF73TFTX.mjs.map +1 -0
  31. package/dist/chunk-AQG2SVCA.mjs +25 -0
  32. package/dist/chunk-AQG2SVCA.mjs.map +1 -0
  33. package/dist/chunk-BJZHMXND.mjs +74 -0
  34. package/dist/chunk-BJZHMXND.mjs.map +1 -0
  35. package/dist/chunk-CB2OJXF6.mjs +25 -0
  36. package/dist/chunk-CB2OJXF6.mjs.map +1 -0
  37. package/dist/chunk-CEOMFPJU.mjs +6020 -0
  38. package/dist/chunk-CEOMFPJU.mjs.map +1 -0
  39. package/dist/chunk-CZVLR7CC.mjs +175 -0
  40. package/dist/chunk-CZVLR7CC.mjs.map +1 -0
  41. package/dist/{chunk-SBCOROE4.mjs → chunk-DCEEHMLJ.mjs} +16 -1
  42. package/dist/chunk-DCEEHMLJ.mjs.map +1 -0
  43. package/dist/chunk-DE3CLKUG.mjs +25 -0
  44. package/dist/chunk-DE3CLKUG.mjs.map +1 -0
  45. package/dist/chunk-DTPRUTNV.mjs +25 -0
  46. package/dist/chunk-DTPRUTNV.mjs.map +1 -0
  47. package/dist/{chunk-TTUAEJLD.mjs → chunk-ERUOA47O.mjs} +11 -2
  48. package/dist/chunk-ERUOA47O.mjs.map +1 -0
  49. package/dist/chunk-ESSRC64W.mjs +74 -0
  50. package/dist/chunk-ESSRC64W.mjs.map +1 -0
  51. package/dist/chunk-GRAN6K6N.mjs +25 -0
  52. package/dist/chunk-GRAN6K6N.mjs.map +1 -0
  53. package/dist/chunk-I27F2UPA.mjs +175 -0
  54. package/dist/chunk-I27F2UPA.mjs.map +1 -0
  55. package/dist/chunk-IAZKTOQW.mjs +25 -0
  56. package/dist/chunk-IAZKTOQW.mjs.map +1 -0
  57. package/dist/chunk-J6XZ5MFB.mjs +25 -0
  58. package/dist/chunk-J6XZ5MFB.mjs.map +1 -0
  59. package/dist/chunk-JJ32MA4C.mjs +73 -0
  60. package/dist/chunk-JJ32MA4C.mjs.map +1 -0
  61. package/dist/chunk-JJY4ZTHQ.mjs +25 -0
  62. package/dist/chunk-JJY4ZTHQ.mjs.map +1 -0
  63. package/dist/chunk-KEYLBFU2.mjs +3117 -0
  64. package/dist/chunk-KEYLBFU2.mjs.map +1 -0
  65. package/dist/chunk-KQ53L4WZ.mjs +3094 -0
  66. package/dist/chunk-KQ53L4WZ.mjs.map +1 -0
  67. package/dist/chunk-KTELVQ67.mjs +3098 -0
  68. package/dist/chunk-KTELVQ67.mjs.map +1 -0
  69. package/dist/chunk-LPEPX6NH.mjs +25 -0
  70. package/dist/chunk-LPEPX6NH.mjs.map +1 -0
  71. package/dist/chunk-MDXE55DK.mjs +3117 -0
  72. package/dist/chunk-MDXE55DK.mjs.map +1 -0
  73. package/dist/chunk-MMFUVOXH.mjs +73 -0
  74. package/dist/chunk-MMFUVOXH.mjs.map +1 -0
  75. package/dist/chunk-N3Y4U66N.mjs +253 -0
  76. package/dist/chunk-N3Y4U66N.mjs.map +1 -0
  77. package/dist/chunk-O7UYB4MH.mjs +25 -0
  78. package/dist/chunk-O7UYB4MH.mjs.map +1 -0
  79. package/dist/chunk-OFNVQHNM.mjs +3089 -0
  80. package/dist/chunk-OFNVQHNM.mjs.map +1 -0
  81. package/dist/{chunk-DZV4ZIAR.mjs → chunk-OFSV5GET.mjs} +17 -6
  82. package/dist/chunk-OFSV5GET.mjs.map +1 -0
  83. package/dist/chunk-OMRST67R.mjs +25 -0
  84. package/dist/chunk-OMRST67R.mjs.map +1 -0
  85. package/dist/chunk-PRZHE74A.mjs +25 -0
  86. package/dist/chunk-PRZHE74A.mjs.map +1 -0
  87. package/dist/chunk-PTYRVXXP.mjs +80 -0
  88. package/dist/chunk-PTYRVXXP.mjs.map +1 -0
  89. package/dist/chunk-R22B5CCO.mjs +25 -0
  90. package/dist/chunk-R22B5CCO.mjs.map +1 -0
  91. package/dist/chunk-SHBDMA63.mjs +141 -0
  92. package/dist/chunk-SHBDMA63.mjs.map +1 -0
  93. package/dist/chunk-SPVXBPRA.mjs +74 -0
  94. package/dist/chunk-SPVXBPRA.mjs.map +1 -0
  95. package/dist/chunk-T72G46ME.mjs +25 -0
  96. package/dist/chunk-T72G46ME.mjs.map +1 -0
  97. package/dist/chunk-TGELROPU.mjs +25 -0
  98. package/dist/chunk-TGELROPU.mjs.map +1 -0
  99. package/dist/chunk-UNX4IAAD.mjs +25 -0
  100. package/dist/chunk-UNX4IAAD.mjs.map +1 -0
  101. package/dist/chunk-V4DHVC7M.mjs +3085 -0
  102. package/dist/chunk-V4DHVC7M.mjs.map +1 -0
  103. package/dist/chunk-VVRFOB66.mjs +25 -0
  104. package/dist/chunk-VVRFOB66.mjs.map +1 -0
  105. package/dist/chunk-W6NVBYM6.mjs +80 -0
  106. package/dist/chunk-W6NVBYM6.mjs.map +1 -0
  107. package/dist/chunk-W7MBACGC.mjs +74 -0
  108. package/dist/chunk-W7MBACGC.mjs.map +1 -0
  109. package/dist/chunk-WMD4XZZS.mjs +25 -0
  110. package/dist/chunk-WMD4XZZS.mjs.map +1 -0
  111. package/dist/chunk-WX2ZNCRT.mjs +74 -0
  112. package/dist/chunk-WX2ZNCRT.mjs.map +1 -0
  113. package/dist/chunk-Y2Z62E2T.mjs +74 -0
  114. package/dist/chunk-Y2Z62E2T.mjs.map +1 -0
  115. package/dist/chunk-YO4I6RVI.mjs +25 -0
  116. package/dist/chunk-YO4I6RVI.mjs.map +1 -0
  117. package/dist/chunk-Z6Q5IW6I.mjs +3098 -0
  118. package/dist/chunk-Z6Q5IW6I.mjs.map +1 -0
  119. package/dist/chunk-Z726O3G2.mjs +25 -0
  120. package/dist/chunk-Z726O3G2.mjs.map +1 -0
  121. package/dist/chunk-ZE4SMZZR.mjs +3097 -0
  122. package/dist/chunk-ZE4SMZZR.mjs.map +1 -0
  123. package/dist/chunk-ZULZB33C.mjs +73 -0
  124. package/dist/chunk-ZULZB33C.mjs.map +1 -0
  125. package/dist/chunk-ZVRGXMY7.mjs +25 -0
  126. package/dist/chunk-ZVRGXMY7.mjs.map +1 -0
  127. package/dist/chunk-ZZ35WBYQ.mjs +25 -0
  128. package/dist/chunk-ZZ35WBYQ.mjs.map +1 -0
  129. package/dist/graphql/types/converted/index.d.ts +1 -1
  130. package/dist/graphql/types/converted/index.js +16 -110
  131. package/dist/graphql/types/converted/index.js.map +1 -1
  132. package/dist/graphql/types/converted/index.mjs +2 -3
  133. package/dist/{groq-adapter-50bc6e4a.d.ts → groq-adapter-540da9c3.d.ts} +6 -1
  134. package/dist/groq-adapter-a6f5e9d2.d.ts +331 -0
  135. package/dist/groq-adapter-c8aec5c5.d.ts +321 -0
  136. package/dist/index-96b330da.d.ts +119 -0
  137. package/dist/index.d.ts +67 -8
  138. package/dist/index.js +118 -28
  139. package/dist/index.js.map +1 -1
  140. package/dist/index.mjs +120 -31
  141. package/dist/index.mjs.map +1 -1
  142. package/dist/langserve-0c6100e3.d.ts +257 -0
  143. package/dist/langserve-978d5790.d.ts +243 -0
  144. package/dist/{langserve-74a52292.d.ts → langserve-9fc76ce5.d.ts} +1 -0
  145. package/dist/lib/index.d.ts +5 -59
  146. package/dist/lib/index.js +3702 -803
  147. package/dist/lib/index.js.map +1 -1
  148. package/dist/lib/index.mjs +20 -18
  149. package/dist/lib/integrations/index.d.ts +15 -9
  150. package/dist/lib/integrations/index.js +215 -187
  151. package/dist/lib/integrations/index.js.map +1 -1
  152. package/dist/lib/integrations/index.mjs +8 -7
  153. package/dist/lib/integrations/nest/index.d.ts +5 -6
  154. package/dist/lib/integrations/nest/index.js +197 -175
  155. package/dist/lib/integrations/nest/index.js.map +1 -1
  156. package/dist/lib/integrations/nest/index.mjs +6 -5
  157. package/dist/lib/integrations/node-express/index.d.ts +5 -6
  158. package/dist/lib/integrations/node-express/index.js +197 -175
  159. package/dist/lib/integrations/node-express/index.js.map +1 -1
  160. package/dist/lib/integrations/node-express/index.mjs +6 -5
  161. package/dist/lib/integrations/node-http/index.d.ts +5 -6
  162. package/dist/lib/integrations/node-http/index.js +197 -175
  163. package/dist/lib/integrations/node-http/index.js.map +1 -1
  164. package/dist/lib/integrations/node-http/index.mjs +5 -4
  165. package/dist/service-adapters/index.d.ts +7 -11
  166. package/dist/service-adapters/index.js +8 -21
  167. package/dist/service-adapters/index.js.map +1 -1
  168. package/dist/service-adapters/index.mjs +2 -4
  169. package/dist/shared-0a7346ce.d.ts +466 -0
  170. package/dist/{shared-f6d43ef8.d.ts → shared-35c6eb04.d.ts} +3 -1
  171. package/dist/shared-9ed1dc31.d.ts +414 -0
  172. package/dist/shared-da5708fe.d.ts +449 -0
  173. package/package.json +14 -20
  174. package/src/lib/index.ts +7 -6
  175. package/src/lib/runtime/copilot-runtime.ts +62 -26
  176. package/src/lib/runtime/telemetry-agent-runner.ts +139 -0
  177. package/dist/chunk-DZV4ZIAR.mjs.map +0 -1
  178. package/dist/chunk-SBCOROE4.mjs.map +0 -1
  179. package/dist/chunk-TTUAEJLD.mjs.map +0 -1
  180. /package/dist/{chunk-FMU55SEU.mjs.map → chunk-2GPTVDTO.mjs.map} +0 -0
  181. /package/dist/{chunk-BJEYMRDD.mjs.map → chunk-45RCC3ZS.mjs.map} +0 -0
  182. /package/dist/{chunk-Z752VE75.mjs.map → chunk-4KES76K3.mjs.map} +0 -0
@@ -0,0 +1,257 @@
1
+ import { A as ActionInputAvailability, T as TextMessage, a as ActionExecutionMessage, R as ResultMessage, M as Message } from './index-96b330da.js';
2
+ import * as rxjs from 'rxjs';
3
+ import { Subject, ReplaySubject } from 'rxjs';
4
+ import { Action, Parameter } from '@copilotkit/shared';
5
+
6
+ declare class ActionInput {
7
+ name: string;
8
+ description: string;
9
+ jsonSchema: string;
10
+ available?: ActionInputAvailability;
11
+ }
12
+
13
+ declare enum GuardrailsResultStatus {
14
+ ALLOWED = "allowed",
15
+ DENIED = "denied"
16
+ }
17
+ declare class GuardrailsResult {
18
+ status: GuardrailsResultStatus;
19
+ reason?: string;
20
+ }
21
+
22
+ declare enum RuntimeEventTypes {
23
+ TextMessageStart = "TextMessageStart",
24
+ TextMessageContent = "TextMessageContent",
25
+ TextMessageEnd = "TextMessageEnd",
26
+ ActionExecutionStart = "ActionExecutionStart",
27
+ ActionExecutionArgs = "ActionExecutionArgs",
28
+ ActionExecutionEnd = "ActionExecutionEnd",
29
+ ActionExecutionResult = "ActionExecutionResult",
30
+ AgentStateMessage = "AgentStateMessage",
31
+ MetaEvent = "MetaEvent",
32
+ RunError = "RunError"
33
+ }
34
+ declare enum RuntimeMetaEventName {
35
+ LangGraphInterruptEvent = "LangGraphInterruptEvent",
36
+ LangGraphInterruptResumeEvent = "LangGraphInterruptResumeEvent",
37
+ CopilotKitLangGraphInterruptEvent = "CopilotKitLangGraphInterruptEvent"
38
+ }
39
+ type RunTimeMetaEvent = {
40
+ type: RuntimeEventTypes.MetaEvent;
41
+ name: RuntimeMetaEventName.LangGraphInterruptEvent;
42
+ value: string;
43
+ } | {
44
+ type: RuntimeEventTypes.MetaEvent;
45
+ name: RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent;
46
+ data: {
47
+ value: string;
48
+ messages: (TextMessage | ActionExecutionMessage | ResultMessage)[];
49
+ };
50
+ } | {
51
+ type: RuntimeEventTypes.MetaEvent;
52
+ name: RuntimeMetaEventName.LangGraphInterruptResumeEvent;
53
+ data: string;
54
+ };
55
+ type RuntimeErrorEvent = {
56
+ type: RuntimeEventTypes.RunError;
57
+ message: string;
58
+ code?: string;
59
+ };
60
+ type RuntimeEvent = {
61
+ type: RuntimeEventTypes.TextMessageStart;
62
+ messageId: string;
63
+ parentMessageId?: string;
64
+ } | {
65
+ type: RuntimeEventTypes.TextMessageContent;
66
+ messageId: string;
67
+ content: string;
68
+ } | {
69
+ type: RuntimeEventTypes.TextMessageEnd;
70
+ messageId: string;
71
+ } | {
72
+ type: RuntimeEventTypes.ActionExecutionStart;
73
+ actionExecutionId: string;
74
+ actionName: string;
75
+ parentMessageId?: string;
76
+ } | {
77
+ type: RuntimeEventTypes.ActionExecutionArgs;
78
+ actionExecutionId: string;
79
+ args: string;
80
+ } | {
81
+ type: RuntimeEventTypes.ActionExecutionEnd;
82
+ actionExecutionId: string;
83
+ } | {
84
+ type: RuntimeEventTypes.ActionExecutionResult;
85
+ actionName: string;
86
+ actionExecutionId: string;
87
+ result: string;
88
+ } | {
89
+ type: RuntimeEventTypes.AgentStateMessage;
90
+ threadId: string;
91
+ agentName: string;
92
+ nodeName: string;
93
+ runId: string;
94
+ active: boolean;
95
+ role: string;
96
+ state: string;
97
+ running: boolean;
98
+ } | RunTimeMetaEvent | RuntimeErrorEvent;
99
+ type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
100
+ declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
101
+ constructor();
102
+ sendTextMessageStart({ messageId, parentMessageId, }: {
103
+ messageId: string;
104
+ parentMessageId?: string;
105
+ }): void;
106
+ sendTextMessageContent({ messageId, content }: {
107
+ messageId: string;
108
+ content: string;
109
+ }): void;
110
+ sendTextMessageEnd({ messageId }: {
111
+ messageId: string;
112
+ }): void;
113
+ sendTextMessage(messageId: string, content: string): void;
114
+ sendActionExecutionStart({ actionExecutionId, actionName, parentMessageId, }: {
115
+ actionExecutionId: string;
116
+ actionName: string;
117
+ parentMessageId?: string;
118
+ }): void;
119
+ sendActionExecutionArgs({ actionExecutionId, args, }: {
120
+ actionExecutionId: string;
121
+ args: string;
122
+ }): void;
123
+ sendActionExecutionEnd({ actionExecutionId }: {
124
+ actionExecutionId: string;
125
+ }): void;
126
+ sendActionExecution({ actionExecutionId, actionName, args, parentMessageId, }: {
127
+ actionExecutionId: string;
128
+ actionName: string;
129
+ args: string;
130
+ parentMessageId?: string;
131
+ }): void;
132
+ sendActionExecutionResult({ actionExecutionId, actionName, result, error, }: {
133
+ actionExecutionId: string;
134
+ actionName: string;
135
+ result?: string;
136
+ error?: {
137
+ code: string;
138
+ message: string;
139
+ };
140
+ }): void;
141
+ sendAgentStateMessage({ threadId, agentName, nodeName, runId, active, role, state, running, }: {
142
+ threadId: string;
143
+ agentName: string;
144
+ nodeName: string;
145
+ runId: string;
146
+ active: boolean;
147
+ role: string;
148
+ state: string;
149
+ running: boolean;
150
+ }): void;
151
+ }
152
+ declare class RuntimeEventSource {
153
+ private eventStream$;
154
+ private callback;
155
+ private errorHandler?;
156
+ private errorContext?;
157
+ constructor(params?: {
158
+ errorHandler?: (error: any, context: any) => Promise<void>;
159
+ errorContext?: any;
160
+ });
161
+ stream(callback: EventSourceCallback): Promise<void>;
162
+ sendErrorMessageToChat(message?: string): void;
163
+ processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents, threadId, }: {
164
+ serverSideActions: Action<any>[];
165
+ guardrailsResult$?: Subject<GuardrailsResult>;
166
+ actionInputsWithoutAgents: ActionInput[];
167
+ threadId: string;
168
+ }): rxjs.Observable<RuntimeEvent>;
169
+ }
170
+
171
+ declare class ForwardedParametersInput {
172
+ model?: string;
173
+ maxTokens?: number;
174
+ stop?: string[];
175
+ toolChoice?: String;
176
+ toolChoiceFunctionName?: string;
177
+ temperature?: number;
178
+ }
179
+
180
+ /**
181
+ * The extensions input is used to pass additional information to the copilot runtime, specific to a
182
+ * service adapter or agent framework.
183
+ */
184
+ declare class ExtensionsInput {
185
+ openaiAssistantAPI?: OpenAIApiAssistantAPIInput;
186
+ }
187
+ declare class OpenAIApiAssistantAPIInput {
188
+ runId?: string;
189
+ threadId?: string;
190
+ }
191
+
192
+ /**
193
+ * The extensions response is used to receive additional information from the copilot runtime, specific to a
194
+ * service adapter or agent framework.
195
+ *
196
+ * Next time a request to the runtime is made, the extensions response will be included in the request as input.
197
+ */
198
+ declare class ExtensionsResponse {
199
+ openaiAssistantAPI?: OpenAIApiAssistantAPIResponse;
200
+ }
201
+ declare class OpenAIApiAssistantAPIResponse {
202
+ runId?: string;
203
+ threadId?: string;
204
+ }
205
+
206
+ declare class AgentSessionInput {
207
+ agentName: string;
208
+ threadId?: string;
209
+ nodeName?: string;
210
+ }
211
+
212
+ declare class AgentStateInput {
213
+ agentName: string;
214
+ state: string;
215
+ config?: string;
216
+ }
217
+
218
+ interface CopilotRuntimeChatCompletionRequest {
219
+ eventSource: RuntimeEventSource;
220
+ messages: Message[];
221
+ actions: ActionInput[];
222
+ model?: string;
223
+ threadId?: string;
224
+ runId?: string;
225
+ forwardedParameters?: ForwardedParametersInput;
226
+ extensions?: ExtensionsInput;
227
+ agentSession?: AgentSessionInput;
228
+ agentStates?: AgentStateInput[];
229
+ }
230
+ interface CopilotRuntimeChatCompletionResponse {
231
+ threadId: string;
232
+ runId?: string;
233
+ extensions?: ExtensionsResponse;
234
+ }
235
+ interface CopilotServiceAdapter {
236
+ process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
237
+ }
238
+
239
+ interface RemoteChainParameters {
240
+ name: string;
241
+ description: string;
242
+ chainUrl: string;
243
+ parameters?: Parameter[];
244
+ parameterType?: "single" | "multi";
245
+ }
246
+ declare class RemoteChain {
247
+ name: string;
248
+ description: string;
249
+ chainUrl: string;
250
+ parameters?: Parameter[];
251
+ parameterType: "single" | "multi";
252
+ constructor(options: RemoteChainParameters);
253
+ toAction(): Promise<Action<any>>;
254
+ inferLangServeParameters(): Promise<void>;
255
+ }
256
+
257
+ export { ActionInput as A, CopilotRuntimeChatCompletionRequest as C, ExtensionsInput as E, ForwardedParametersInput as F, RemoteChainParameters as R, CopilotRuntimeChatCompletionResponse as a, CopilotServiceAdapter as b, RemoteChain as c, AgentSessionInput as d, AgentStateInput as e, RuntimeEventSource as f, ExtensionsResponse as g };
@@ -0,0 +1,243 @@
1
+ import { T as TextMessage, A as ActionExecutionMessage, R as ResultMessage, b as ActionInputAvailability, M as Message } from './index-adbd78f1.js';
2
+ import { ReplaySubject } from 'rxjs';
3
+ import { Parameter, Action } from '@copilotkit/shared';
4
+
5
+ /**
6
+ * The extensions response is used to receive additional information from the copilot runtime, specific to a
7
+ * service adapter or agent framework.
8
+ *
9
+ * Next time a request to the runtime is made, the extensions response will be included in the request as input.
10
+ */
11
+ declare class ExtensionsResponse {
12
+ openaiAssistantAPI?: OpenAIApiAssistantAPIResponse;
13
+ }
14
+ declare class OpenAIApiAssistantAPIResponse {
15
+ runId?: string;
16
+ threadId?: string;
17
+ }
18
+
19
+ declare enum RuntimeEventTypes {
20
+ TextMessageStart = "TextMessageStart",
21
+ TextMessageContent = "TextMessageContent",
22
+ TextMessageEnd = "TextMessageEnd",
23
+ ActionExecutionStart = "ActionExecutionStart",
24
+ ActionExecutionArgs = "ActionExecutionArgs",
25
+ ActionExecutionEnd = "ActionExecutionEnd",
26
+ ActionExecutionResult = "ActionExecutionResult",
27
+ AgentStateMessage = "AgentStateMessage",
28
+ MetaEvent = "MetaEvent",
29
+ RunError = "RunError"
30
+ }
31
+ declare enum RuntimeMetaEventName {
32
+ LangGraphInterruptEvent = "LangGraphInterruptEvent",
33
+ LangGraphInterruptResumeEvent = "LangGraphInterruptResumeEvent",
34
+ CopilotKitLangGraphInterruptEvent = "CopilotKitLangGraphInterruptEvent"
35
+ }
36
+ type RunTimeMetaEvent = {
37
+ type: RuntimeEventTypes.MetaEvent;
38
+ name: RuntimeMetaEventName.LangGraphInterruptEvent;
39
+ value: string;
40
+ } | {
41
+ type: RuntimeEventTypes.MetaEvent;
42
+ name: RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent;
43
+ data: {
44
+ value: string;
45
+ messages: (TextMessage | ActionExecutionMessage | ResultMessage)[];
46
+ };
47
+ } | {
48
+ type: RuntimeEventTypes.MetaEvent;
49
+ name: RuntimeMetaEventName.LangGraphInterruptResumeEvent;
50
+ data: string;
51
+ };
52
+ type RuntimeErrorEvent = {
53
+ type: RuntimeEventTypes.RunError;
54
+ message: string;
55
+ code?: string;
56
+ };
57
+ type RuntimeEvent = {
58
+ type: RuntimeEventTypes.TextMessageStart;
59
+ messageId: string;
60
+ parentMessageId?: string;
61
+ } | {
62
+ type: RuntimeEventTypes.TextMessageContent;
63
+ messageId: string;
64
+ content: string;
65
+ } | {
66
+ type: RuntimeEventTypes.TextMessageEnd;
67
+ messageId: string;
68
+ } | {
69
+ type: RuntimeEventTypes.ActionExecutionStart;
70
+ actionExecutionId: string;
71
+ actionName: string;
72
+ parentMessageId?: string;
73
+ } | {
74
+ type: RuntimeEventTypes.ActionExecutionArgs;
75
+ actionExecutionId: string;
76
+ args: string;
77
+ } | {
78
+ type: RuntimeEventTypes.ActionExecutionEnd;
79
+ actionExecutionId: string;
80
+ } | {
81
+ type: RuntimeEventTypes.ActionExecutionResult;
82
+ actionName: string;
83
+ actionExecutionId: string;
84
+ result: string;
85
+ } | {
86
+ type: RuntimeEventTypes.AgentStateMessage;
87
+ threadId: string;
88
+ agentName: string;
89
+ nodeName: string;
90
+ runId: string;
91
+ active: boolean;
92
+ role: string;
93
+ state: string;
94
+ running: boolean;
95
+ } | RunTimeMetaEvent | RuntimeErrorEvent;
96
+ type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
97
+ declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
98
+ constructor();
99
+ sendTextMessageStart({ messageId, parentMessageId, }: {
100
+ messageId: string;
101
+ parentMessageId?: string;
102
+ }): void;
103
+ sendTextMessageContent({ messageId, content }: {
104
+ messageId: string;
105
+ content: string;
106
+ }): void;
107
+ sendTextMessageEnd({ messageId }: {
108
+ messageId: string;
109
+ }): void;
110
+ sendTextMessage(messageId: string, content: string): void;
111
+ sendActionExecutionStart({ actionExecutionId, actionName, parentMessageId, }: {
112
+ actionExecutionId: string;
113
+ actionName: string;
114
+ parentMessageId?: string;
115
+ }): void;
116
+ sendActionExecutionArgs({ actionExecutionId, args, }: {
117
+ actionExecutionId: string;
118
+ args: string;
119
+ }): void;
120
+ sendActionExecutionEnd({ actionExecutionId }: {
121
+ actionExecutionId: string;
122
+ }): void;
123
+ sendActionExecution({ actionExecutionId, actionName, args, parentMessageId, }: {
124
+ actionExecutionId: string;
125
+ actionName: string;
126
+ args: string;
127
+ parentMessageId?: string;
128
+ }): void;
129
+ sendActionExecutionResult({ actionExecutionId, actionName, result, error, }: {
130
+ actionExecutionId: string;
131
+ actionName: string;
132
+ result?: string;
133
+ error?: {
134
+ code: string;
135
+ message: string;
136
+ };
137
+ }): void;
138
+ sendAgentStateMessage({ threadId, agentName, nodeName, runId, active, role, state, running, }: {
139
+ threadId: string;
140
+ agentName: string;
141
+ nodeName: string;
142
+ runId: string;
143
+ active: boolean;
144
+ role: string;
145
+ state: string;
146
+ running: boolean;
147
+ }): void;
148
+ }
149
+ declare class RuntimeEventSource {
150
+ private eventStream$;
151
+ private callback;
152
+ private errorHandler?;
153
+ private errorContext?;
154
+ constructor(params?: {
155
+ errorHandler?: (error: any, context: any) => Promise<void>;
156
+ errorContext?: any;
157
+ });
158
+ stream(callback: EventSourceCallback): Promise<void>;
159
+ }
160
+
161
+ declare class ActionInput {
162
+ name: string;
163
+ description: string;
164
+ jsonSchema: string;
165
+ available?: ActionInputAvailability;
166
+ }
167
+
168
+ declare class ForwardedParametersInput {
169
+ model?: string;
170
+ maxTokens?: number;
171
+ stop?: string[];
172
+ toolChoice?: String;
173
+ toolChoiceFunctionName?: string;
174
+ temperature?: number;
175
+ }
176
+
177
+ /**
178
+ * The extensions input is used to pass additional information to the copilot runtime, specific to a
179
+ * service adapter or agent framework.
180
+ */
181
+ declare class ExtensionsInput {
182
+ openaiAssistantAPI?: OpenAIApiAssistantAPIInput;
183
+ }
184
+ declare class OpenAIApiAssistantAPIInput {
185
+ runId?: string;
186
+ threadId?: string;
187
+ }
188
+
189
+ declare class AgentSessionInput {
190
+ agentName: string;
191
+ threadId?: string;
192
+ nodeName?: string;
193
+ }
194
+
195
+ declare class AgentStateInput {
196
+ agentName: string;
197
+ state: string;
198
+ config?: string;
199
+ }
200
+
201
+ interface CopilotRuntimeChatCompletionRequest {
202
+ eventSource: RuntimeEventSource;
203
+ messages: Message[];
204
+ actions: ActionInput[];
205
+ model?: string;
206
+ threadId?: string;
207
+ runId?: string;
208
+ forwardedParameters?: ForwardedParametersInput;
209
+ extensions?: ExtensionsInput;
210
+ agentSession?: AgentSessionInput;
211
+ agentStates?: AgentStateInput[];
212
+ }
213
+ interface CopilotRuntimeChatCompletionResponse {
214
+ threadId: string;
215
+ runId?: string;
216
+ extensions?: ExtensionsResponse;
217
+ }
218
+ interface CopilotServiceAdapter {
219
+ provider?: string;
220
+ model?: string;
221
+ process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
222
+ name?: string;
223
+ }
224
+
225
+ interface RemoteChainParameters {
226
+ name: string;
227
+ description: string;
228
+ chainUrl: string;
229
+ parameters?: Parameter[];
230
+ parameterType?: "single" | "multi";
231
+ }
232
+ declare class RemoteChain {
233
+ name: string;
234
+ description: string;
235
+ chainUrl: string;
236
+ parameters?: Parameter[];
237
+ parameterType: "single" | "multi";
238
+ constructor(options: RemoteChainParameters);
239
+ toAction(): Promise<Action<any>>;
240
+ inferLangServeParameters(): Promise<void>;
241
+ }
242
+
243
+ export { CopilotRuntimeChatCompletionRequest as C, RemoteChainParameters as R, CopilotRuntimeChatCompletionResponse as a, CopilotServiceAdapter as b, RemoteChain as c };
@@ -219,6 +219,7 @@ interface CopilotServiceAdapter {
219
219
  provider?: string;
220
220
  model?: string;
221
221
  process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
222
+ name?: string;
222
223
  }
223
224
 
224
225
  interface RemoteChainParameters {
@@ -1,6 +1,6 @@
1
- export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-50bc6e4a.js';
2
- export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams_BASE, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, n as MCPClient, o as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, q as convertMCPToolsToActions, l as copilotKitEndpoint, c as createContext, h as createLogger, p as extractParametersFromSchema, s as generateMcpToolInstructions, g as getCommonConfig, m as langGraphPlatformEndpoint, r as resolveEndpointType } from '../shared-f6d43ef8.js';
3
- export { config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
1
+ export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-c8aec5c5.js';
2
+ export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from '../shared-0a7346ce.js';
3
+ export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
4
4
  export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
5
5
  export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js';
6
6
  export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
@@ -10,8 +10,8 @@ import { LangGraphAgent as LangGraphAgent$1, LangGraphAgentConfig, ProcessedEven
10
10
  export { LangGraphHttpAgent } from '@ag-ui/langgraph';
11
11
  import { Message } from '@langchain/langgraph-sdk/dist/types.messages';
12
12
  import 'openai';
13
- import '../langserve-74a52292.js';
14
- import '../index-adbd78f1.js';
13
+ import '../langserve-0c6100e3.js';
14
+ import '../index-96b330da.js';
15
15
  import '../graphql/types/base/index.js';
16
16
  import '@copilotkit/shared';
17
17
  import '@langchain/core/messages';
@@ -21,7 +21,6 @@ import 'groq-sdk';
21
21
  import 'graphql';
22
22
  import 'pino';
23
23
  import 'graphql-yoga';
24
- import '@copilotkitnext/runtime';
25
24
  import './cloud/index.js';
26
25
 
27
26
  interface CopilotKitStateEnrichment {
@@ -45,7 +44,6 @@ declare enum CustomEventNames {
45
44
  }
46
45
  declare class LangGraphAgent extends LangGraphAgent$1 {
47
46
  constructor(config: LangGraphAgentConfig);
48
- clone(): LangGraphAgent;
49
47
  dispatchEvent(event: ProcessedEvents): boolean;
50
48
  run(input: RunAgentInput): rxjs.Observable<{
51
49
  type: EventType.TEXT_MESSAGE_START;
@@ -177,60 +175,8 @@ declare class LangGraphAgent extends LangGraphAgent$1 {
177
175
  type: EventType.RUN_STARTED;
178
176
  threadId: string;
179
177
  runId: string;
180
- parentRunId?: string | undefined;
181
178
  timestamp?: number | undefined;
182
179
  rawEvent?: any;
183
- input?: {
184
- threadId: string;
185
- runId: string;
186
- messages: ({
187
- id: string;
188
- role: "developer";
189
- content: string;
190
- name?: string | undefined;
191
- } | {
192
- id: string;
193
- role: "system";
194
- content: string;
195
- name?: string | undefined;
196
- } | {
197
- id: string;
198
- role: "assistant";
199
- name?: string | undefined;
200
- content?: string | undefined;
201
- toolCalls?: {
202
- function: {
203
- name: string;
204
- arguments: string;
205
- };
206
- type: "function";
207
- id: string;
208
- }[] | undefined;
209
- } | {
210
- id: string;
211
- role: "user";
212
- content: string;
213
- name?: string | undefined;
214
- } | {
215
- id: string;
216
- role: "tool";
217
- content: string;
218
- toolCallId: string;
219
- error?: string | undefined;
220
- })[];
221
- tools: {
222
- name: string;
223
- description: string;
224
- parameters?: any;
225
- }[];
226
- context: {
227
- value: string;
228
- description: string;
229
- }[];
230
- parentRunId?: string | undefined;
231
- state?: any;
232
- forwardedProps?: any;
233
- } | undefined;
234
180
  } | {
235
181
  type: EventType.RUN_FINISHED;
236
182
  threadId: string;