@copilotkit/runtime 1.50.0-beta.8 → 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 (226) hide show
  1. package/CHANGELOG.md +168 -0
  2. package/dist/chunk-27JKTS6P.mjs +1704 -0
  3. package/dist/chunk-27JKTS6P.mjs.map +1 -0
  4. package/dist/chunk-2GPTVDTO.mjs +25 -0
  5. package/dist/chunk-2GPTVDTO.mjs.map +1 -0
  6. package/dist/chunk-2OZAGFV3.mjs +43 -0
  7. package/dist/chunk-2OZAGFV3.mjs.map +1 -0
  8. package/dist/chunk-3AJVKDZX.mjs +3097 -0
  9. package/dist/chunk-3AJVKDZX.mjs.map +1 -0
  10. package/dist/chunk-45RCC3ZS.mjs +25 -0
  11. package/dist/chunk-45RCC3ZS.mjs.map +1 -0
  12. package/dist/chunk-4EHJ4XFJ.mjs +25 -0
  13. package/dist/chunk-4EHJ4XFJ.mjs.map +1 -0
  14. package/dist/chunk-4IANB4TC.mjs +25 -0
  15. package/dist/chunk-4IANB4TC.mjs.map +1 -0
  16. package/dist/chunk-4KES76K3.mjs +74 -0
  17. package/dist/chunk-4KES76K3.mjs.map +1 -0
  18. package/dist/chunk-4OGE3SLW.mjs +3100 -0
  19. package/dist/chunk-4OGE3SLW.mjs.map +1 -0
  20. package/dist/chunk-54YJBMCP.mjs +3097 -0
  21. package/dist/chunk-54YJBMCP.mjs.map +1 -0
  22. package/dist/chunk-62NE5S6M.mjs +226 -0
  23. package/dist/chunk-62NE5S6M.mjs.map +1 -0
  24. package/dist/chunk-6ER4SZYH.mjs +74 -0
  25. package/dist/chunk-6ER4SZYH.mjs.map +1 -0
  26. package/dist/chunk-6TNSLHVR.mjs +74 -0
  27. package/dist/chunk-6TNSLHVR.mjs.map +1 -0
  28. package/dist/chunk-6XRUR5UK.mjs +1 -0
  29. package/dist/chunk-6XRUR5UK.mjs.map +1 -0
  30. package/dist/chunk-7V4BK7TZ.mjs +25 -0
  31. package/dist/chunk-7V4BK7TZ.mjs.map +1 -0
  32. package/dist/chunk-7YZIEXD2.mjs +74 -0
  33. package/dist/chunk-7YZIEXD2.mjs.map +1 -0
  34. package/dist/chunk-A4XHOAFU.mjs +25 -0
  35. package/dist/chunk-A4XHOAFU.mjs.map +1 -0
  36. package/dist/chunk-A555KEAD.mjs +6020 -0
  37. package/dist/chunk-A555KEAD.mjs.map +1 -0
  38. package/dist/chunk-AF73TFTX.mjs +74 -0
  39. package/dist/chunk-AF73TFTX.mjs.map +1 -0
  40. package/dist/chunk-AMUJQ6IR.mjs +50 -0
  41. package/dist/chunk-AMUJQ6IR.mjs.map +1 -0
  42. package/dist/chunk-AQG2SVCA.mjs +25 -0
  43. package/dist/chunk-AQG2SVCA.mjs.map +1 -0
  44. package/dist/chunk-BJZHMXND.mjs +74 -0
  45. package/dist/chunk-BJZHMXND.mjs.map +1 -0
  46. package/dist/chunk-CB2OJXF6.mjs +25 -0
  47. package/dist/chunk-CB2OJXF6.mjs.map +1 -0
  48. package/dist/chunk-CEOMFPJU.mjs +6020 -0
  49. package/dist/chunk-CEOMFPJU.mjs.map +1 -0
  50. package/dist/chunk-CZVLR7CC.mjs +175 -0
  51. package/dist/chunk-CZVLR7CC.mjs.map +1 -0
  52. package/dist/chunk-DCEEHMLJ.mjs +1127 -0
  53. package/dist/chunk-DCEEHMLJ.mjs.map +1 -0
  54. package/dist/chunk-DE3CLKUG.mjs +25 -0
  55. package/dist/chunk-DE3CLKUG.mjs.map +1 -0
  56. package/dist/chunk-DTPRUTNV.mjs +25 -0
  57. package/dist/chunk-DTPRUTNV.mjs.map +1 -0
  58. package/dist/chunk-ERUOA47O.mjs +626 -0
  59. package/dist/chunk-ERUOA47O.mjs.map +1 -0
  60. package/dist/chunk-ESSRC64W.mjs +74 -0
  61. package/dist/chunk-ESSRC64W.mjs.map +1 -0
  62. package/dist/chunk-FHD4JECV.mjs +33 -0
  63. package/dist/chunk-FHD4JECV.mjs.map +1 -0
  64. package/dist/chunk-GRAN6K6N.mjs +25 -0
  65. package/dist/chunk-GRAN6K6N.mjs.map +1 -0
  66. package/dist/chunk-I27F2UPA.mjs +175 -0
  67. package/dist/chunk-I27F2UPA.mjs.map +1 -0
  68. package/dist/chunk-IAZKTOQW.mjs +25 -0
  69. package/dist/chunk-IAZKTOQW.mjs.map +1 -0
  70. package/dist/chunk-J6XZ5MFB.mjs +25 -0
  71. package/dist/chunk-J6XZ5MFB.mjs.map +1 -0
  72. package/dist/chunk-JJ32MA4C.mjs +73 -0
  73. package/dist/chunk-JJ32MA4C.mjs.map +1 -0
  74. package/dist/chunk-JJY4ZTHQ.mjs +25 -0
  75. package/dist/chunk-JJY4ZTHQ.mjs.map +1 -0
  76. package/dist/chunk-KEYLBFU2.mjs +3117 -0
  77. package/dist/chunk-KEYLBFU2.mjs.map +1 -0
  78. package/dist/chunk-KQ53L4WZ.mjs +3094 -0
  79. package/dist/chunk-KQ53L4WZ.mjs.map +1 -0
  80. package/dist/chunk-KTELVQ67.mjs +3098 -0
  81. package/dist/chunk-KTELVQ67.mjs.map +1 -0
  82. package/dist/chunk-LPEPX6NH.mjs +25 -0
  83. package/dist/chunk-LPEPX6NH.mjs.map +1 -0
  84. package/dist/chunk-MDXE55DK.mjs +3117 -0
  85. package/dist/chunk-MDXE55DK.mjs.map +1 -0
  86. package/dist/chunk-MMFUVOXH.mjs +73 -0
  87. package/dist/chunk-MMFUVOXH.mjs.map +1 -0
  88. package/dist/chunk-N3Y4U66N.mjs +253 -0
  89. package/dist/chunk-N3Y4U66N.mjs.map +1 -0
  90. package/dist/chunk-O7UYB4MH.mjs +25 -0
  91. package/dist/chunk-O7UYB4MH.mjs.map +1 -0
  92. package/dist/chunk-OFNVQHNM.mjs +3089 -0
  93. package/dist/chunk-OFNVQHNM.mjs.map +1 -0
  94. package/dist/chunk-OFSV5GET.mjs +3074 -0
  95. package/dist/chunk-OFSV5GET.mjs.map +1 -0
  96. package/dist/chunk-OMRST67R.mjs +25 -0
  97. package/dist/chunk-OMRST67R.mjs.map +1 -0
  98. package/dist/chunk-OWIGJONH.mjs +275 -0
  99. package/dist/chunk-OWIGJONH.mjs.map +1 -0
  100. package/dist/chunk-PRZHE74A.mjs +25 -0
  101. package/dist/chunk-PRZHE74A.mjs.map +1 -0
  102. package/dist/chunk-PTYRVXXP.mjs +80 -0
  103. package/dist/chunk-PTYRVXXP.mjs.map +1 -0
  104. package/dist/chunk-R22B5CCO.mjs +25 -0
  105. package/dist/chunk-R22B5CCO.mjs.map +1 -0
  106. package/dist/chunk-SHBDMA63.mjs +141 -0
  107. package/dist/chunk-SHBDMA63.mjs.map +1 -0
  108. package/dist/chunk-SPVXBPRA.mjs +74 -0
  109. package/dist/chunk-SPVXBPRA.mjs.map +1 -0
  110. package/dist/chunk-T72G46ME.mjs +25 -0
  111. package/dist/chunk-T72G46ME.mjs.map +1 -0
  112. package/dist/chunk-TGELROPU.mjs +25 -0
  113. package/dist/chunk-TGELROPU.mjs.map +1 -0
  114. package/dist/chunk-UNX4IAAD.mjs +25 -0
  115. package/dist/chunk-UNX4IAAD.mjs.map +1 -0
  116. package/dist/chunk-V4DHVC7M.mjs +3085 -0
  117. package/dist/chunk-V4DHVC7M.mjs.map +1 -0
  118. package/dist/chunk-VVRFOB66.mjs +25 -0
  119. package/dist/chunk-VVRFOB66.mjs.map +1 -0
  120. package/dist/chunk-W6NVBYM6.mjs +80 -0
  121. package/dist/chunk-W6NVBYM6.mjs.map +1 -0
  122. package/dist/chunk-W7MBACGC.mjs +74 -0
  123. package/dist/chunk-W7MBACGC.mjs.map +1 -0
  124. package/dist/chunk-WMD4XZZS.mjs +25 -0
  125. package/dist/chunk-WMD4XZZS.mjs.map +1 -0
  126. package/dist/chunk-WX2ZNCRT.mjs +74 -0
  127. package/dist/chunk-WX2ZNCRT.mjs.map +1 -0
  128. package/dist/chunk-XWBDEXDA.mjs +153 -0
  129. package/dist/chunk-XWBDEXDA.mjs.map +1 -0
  130. package/dist/chunk-Y2Z62E2T.mjs +74 -0
  131. package/dist/chunk-Y2Z62E2T.mjs.map +1 -0
  132. package/dist/chunk-YO4I6RVI.mjs +25 -0
  133. package/dist/chunk-YO4I6RVI.mjs.map +1 -0
  134. package/dist/chunk-Z6Q5IW6I.mjs +3098 -0
  135. package/dist/chunk-Z6Q5IW6I.mjs.map +1 -0
  136. package/dist/chunk-Z726O3G2.mjs +25 -0
  137. package/dist/chunk-Z726O3G2.mjs.map +1 -0
  138. package/dist/chunk-ZE4SMZZR.mjs +3097 -0
  139. package/dist/chunk-ZE4SMZZR.mjs.map +1 -0
  140. package/dist/chunk-ZULZB33C.mjs +73 -0
  141. package/dist/chunk-ZULZB33C.mjs.map +1 -0
  142. package/dist/chunk-ZVRGXMY7.mjs +25 -0
  143. package/dist/chunk-ZVRGXMY7.mjs.map +1 -0
  144. package/dist/chunk-ZZ35WBYQ.mjs +25 -0
  145. package/dist/chunk-ZZ35WBYQ.mjs.map +1 -0
  146. package/dist/graphql/message-conversion/index.d.ts +18 -0
  147. package/dist/graphql/message-conversion/index.js +725 -0
  148. package/dist/graphql/message-conversion/index.js.map +1 -0
  149. package/dist/graphql/message-conversion/index.mjs +245 -0
  150. package/dist/graphql/message-conversion/index.mjs.map +1 -0
  151. package/dist/graphql/types/base/index.d.ts +6 -0
  152. package/dist/graphql/types/base/index.js +63 -0
  153. package/dist/graphql/types/base/index.js.map +1 -0
  154. package/dist/graphql/types/base/index.mjs +8 -0
  155. package/dist/graphql/types/base/index.mjs.map +1 -0
  156. package/dist/graphql/types/converted/index.d.ts +2 -0
  157. package/dist/graphql/types/converted/index.js +200 -0
  158. package/dist/graphql/types/converted/index.js.map +1 -0
  159. package/dist/graphql/types/converted/index.mjs +19 -0
  160. package/dist/graphql/types/converted/index.mjs.map +1 -0
  161. package/dist/groq-adapter-540da9c3.d.ts +331 -0
  162. package/dist/groq-adapter-a6f5e9d2.d.ts +331 -0
  163. package/dist/groq-adapter-c8aec5c5.d.ts +321 -0
  164. package/dist/index-96b330da.d.ts +119 -0
  165. package/dist/index-adbd78f1.d.ts +154 -0
  166. package/dist/index.d.ts +67 -8
  167. package/dist/index.js +118 -28
  168. package/dist/index.js.map +1 -1
  169. package/dist/index.mjs +120 -31
  170. package/dist/index.mjs.map +1 -1
  171. package/dist/langserve-0c6100e3.d.ts +257 -0
  172. package/dist/langserve-978d5790.d.ts +243 -0
  173. package/dist/langserve-9fc76ce5.d.ts +243 -0
  174. package/dist/lib/cloud/index.d.ts +6 -0
  175. package/dist/lib/cloud/index.js +18 -0
  176. package/dist/lib/cloud/index.js.map +1 -0
  177. package/dist/lib/cloud/index.mjs +1 -0
  178. package/dist/lib/cloud/index.mjs.map +1 -0
  179. package/dist/lib/index.d.ts +212 -0
  180. package/dist/lib/index.js +7843 -0
  181. package/dist/lib/index.js.map +1 -0
  182. package/dist/lib/index.mjs +76 -0
  183. package/dist/lib/index.mjs.map +1 -0
  184. package/dist/lib/integrations/index.d.ts +34 -0
  185. package/dist/lib/integrations/index.js +3052 -0
  186. package/dist/lib/integrations/index.js.map +1 -0
  187. package/dist/lib/integrations/index.mjs +37 -0
  188. package/dist/lib/integrations/index.mjs.map +1 -0
  189. package/dist/lib/integrations/nest/index.d.ts +15 -0
  190. package/dist/lib/integrations/nest/index.js +2959 -0
  191. package/dist/lib/integrations/nest/index.js.map +1 -0
  192. package/dist/lib/integrations/nest/index.mjs +14 -0
  193. package/dist/lib/integrations/nest/index.mjs.map +1 -0
  194. package/dist/lib/integrations/node-express/index.d.ts +15 -0
  195. package/dist/lib/integrations/node-express/index.js +2959 -0
  196. package/dist/lib/integrations/node-express/index.js.map +1 -0
  197. package/dist/lib/integrations/node-express/index.mjs +14 -0
  198. package/dist/lib/integrations/node-express/index.mjs.map +1 -0
  199. package/dist/lib/integrations/node-http/index.d.ts +15 -0
  200. package/dist/lib/integrations/node-http/index.js +2945 -0
  201. package/dist/lib/integrations/node-http/index.js.map +1 -0
  202. package/dist/lib/integrations/node-http/index.mjs +13 -0
  203. package/dist/lib/integrations/node-http/index.mjs.map +1 -0
  204. package/dist/service-adapters/index.d.ts +162 -0
  205. package/dist/service-adapters/index.js +1787 -0
  206. package/dist/service-adapters/index.js.map +1 -0
  207. package/dist/service-adapters/index.mjs +34 -0
  208. package/dist/service-adapters/index.mjs.map +1 -0
  209. package/dist/service-adapters/shared/index.d.ts +9 -0
  210. package/dist/service-adapters/shared/index.js +72 -0
  211. package/dist/service-adapters/shared/index.js.map +1 -0
  212. package/dist/service-adapters/shared/index.mjs +8 -0
  213. package/dist/service-adapters/shared/index.mjs.map +1 -0
  214. package/dist/shared-0a7346ce.d.ts +466 -0
  215. package/dist/shared-35c6eb04.d.ts +448 -0
  216. package/dist/shared-9ed1dc31.d.ts +414 -0
  217. package/dist/shared-da5708fe.d.ts +449 -0
  218. package/dist/utils/index.d.ts +65 -0
  219. package/dist/utils/index.js +175 -0
  220. package/dist/utils/index.js.map +1 -0
  221. package/dist/utils/index.mjs +12 -0
  222. package/dist/utils/index.mjs.map +1 -0
  223. package/package.json +14 -20
  224. package/src/lib/index.ts +7 -6
  225. package/src/lib/runtime/copilot-runtime.ts +62 -26
  226. package/src/lib/runtime/telemetry-agent-runner.ts +139 -0
@@ -0,0 +1,119 @@
1
+ import { BaseMessageInput } from './graphql/types/base/index.js';
2
+
3
+ declare enum MessageRole {
4
+ user = "user",
5
+ assistant = "assistant",
6
+ system = "system",
7
+ tool = "tool",
8
+ developer = "developer"
9
+ }
10
+ declare enum ActionInputAvailability {
11
+ disabled = "disabled",
12
+ enabled = "enabled",
13
+ remote = "remote"
14
+ }
15
+
16
+ declare class MessageInput extends BaseMessageInput {
17
+ textMessage?: TextMessageInput;
18
+ actionExecutionMessage?: ActionExecutionMessageInput;
19
+ resultMessage?: ResultMessageInput;
20
+ agentStateMessage?: AgentStateMessageInput;
21
+ imageMessage?: ImageMessageInput;
22
+ }
23
+ declare class TextMessageInput {
24
+ content: string;
25
+ parentMessageId?: string;
26
+ role: MessageRole;
27
+ }
28
+ declare class ActionExecutionMessageInput {
29
+ name: string;
30
+ arguments: string;
31
+ parentMessageId?: string;
32
+ scope?: String;
33
+ }
34
+ declare class ResultMessageInput {
35
+ actionExecutionId: string;
36
+ actionName: string;
37
+ parentMessageId?: string;
38
+ result: string;
39
+ }
40
+ declare class AgentStateMessageInput {
41
+ threadId: string;
42
+ agentName: string;
43
+ role: MessageRole;
44
+ state: string;
45
+ running: boolean;
46
+ nodeName: string;
47
+ runId: string;
48
+ active: boolean;
49
+ }
50
+ declare class ImageMessageInput {
51
+ format: string;
52
+ bytes: string;
53
+ parentMessageId?: string;
54
+ role: MessageRole;
55
+ }
56
+
57
+ type MessageType = "TextMessage" | "ActionExecutionMessage" | "ResultMessage" | "AgentStateMessage" | "ImageMessage";
58
+ declare class Message extends BaseMessageInput {
59
+ type: MessageType;
60
+ isTextMessage(): this is TextMessage;
61
+ isActionExecutionMessage(): this is ActionExecutionMessage;
62
+ isResultMessage(): this is ResultMessage;
63
+ isAgentStateMessage(): this is AgentStateMessage;
64
+ isImageMessage(): this is ImageMessage;
65
+ }
66
+ declare class TextMessage extends Message implements TextMessageInput {
67
+ type: MessageType;
68
+ content: string;
69
+ role: MessageRole;
70
+ parentMessageId?: string;
71
+ }
72
+ declare class ActionExecutionMessage extends Message implements Omit<ActionExecutionMessageInput, "arguments" | "scope"> {
73
+ type: MessageType;
74
+ name: string;
75
+ arguments: Record<string, any>;
76
+ parentMessageId?: string;
77
+ }
78
+ declare class ResultMessage extends Message implements ResultMessageInput {
79
+ type: MessageType;
80
+ actionExecutionId: string;
81
+ actionName: string;
82
+ result: string;
83
+ static encodeResult(result: any, error?: {
84
+ code: string;
85
+ message: string;
86
+ } | string | Error): string;
87
+ static decodeResult(result: string): {
88
+ error?: {
89
+ code: string;
90
+ message: string;
91
+ };
92
+ result: string;
93
+ };
94
+ hasError(): boolean;
95
+ getError(): {
96
+ code: string;
97
+ message: string;
98
+ } | undefined;
99
+ }
100
+ declare class AgentStateMessage extends Message implements Omit<AgentStateMessageInput, "state"> {
101
+ type: MessageType;
102
+ threadId: string;
103
+ agentName: string;
104
+ nodeName: string;
105
+ runId: string;
106
+ active: boolean;
107
+ role: MessageRole;
108
+ state: any;
109
+ running: boolean;
110
+ }
111
+ declare class ImageMessage extends Message implements ImageMessageInput {
112
+ type: MessageType;
113
+ format: string;
114
+ bytes: string;
115
+ role: MessageRole;
116
+ parentMessageId?: string;
117
+ }
118
+
119
+ export { ActionInputAvailability as A, ImageMessage as I, Message as M, ResultMessage as R, TextMessage as T, ActionExecutionMessage as a, MessageInput as b, MessageType as c, AgentStateMessage as d };
@@ -0,0 +1,154 @@
1
+ import { BaseMessageInput } from './graphql/types/base/index.js';
2
+
3
+ declare enum MessageRole {
4
+ assistant = "assistant",
5
+ developer = "developer",
6
+ system = "system",
7
+ tool = "tool",
8
+ user = "user"
9
+ }
10
+ declare enum ActionInputAvailability {
11
+ disabled = "disabled",
12
+ enabled = "enabled",
13
+ remote = "remote"
14
+ }
15
+
16
+ declare class MessageInput extends BaseMessageInput {
17
+ textMessage?: TextMessageInput;
18
+ actionExecutionMessage?: ActionExecutionMessageInput;
19
+ resultMessage?: ResultMessageInput;
20
+ agentStateMessage?: AgentStateMessageInput;
21
+ imageMessage?: ImageMessageInput;
22
+ }
23
+ declare class TextMessageInput {
24
+ content: string;
25
+ parentMessageId?: string;
26
+ role: MessageRole;
27
+ }
28
+ declare class ActionExecutionMessageInput {
29
+ name: string;
30
+ arguments: string;
31
+ parentMessageId?: string;
32
+ scope?: String;
33
+ }
34
+ declare class ResultMessageInput {
35
+ actionExecutionId: string;
36
+ actionName: string;
37
+ parentMessageId?: string;
38
+ result: string;
39
+ }
40
+ declare class AgentStateMessageInput {
41
+ threadId: string;
42
+ agentName: string;
43
+ role: MessageRole;
44
+ state: string;
45
+ running: boolean;
46
+ nodeName: string;
47
+ runId: string;
48
+ active: boolean;
49
+ }
50
+ declare class ImageMessageInput {
51
+ format: string;
52
+ bytes: string;
53
+ parentMessageId?: string;
54
+ role: MessageRole;
55
+ }
56
+
57
+ declare enum MessageStatusCode {
58
+ Pending = "pending",
59
+ Success = "success",
60
+ Failed = "failed"
61
+ }
62
+ declare class BaseMessageStatus {
63
+ code: MessageStatusCode;
64
+ }
65
+ declare class PendingMessageStatus extends BaseMessageStatus {
66
+ code: MessageStatusCode;
67
+ }
68
+ declare class SuccessMessageStatus extends BaseMessageStatus {
69
+ code: MessageStatusCode;
70
+ }
71
+ declare class FailedMessageStatus extends BaseMessageStatus {
72
+ code: MessageStatusCode;
73
+ reason: string;
74
+ }
75
+ declare const MessageStatusUnion: PendingMessageStatus | SuccessMessageStatus | FailedMessageStatus;
76
+ type MessageStatus = typeof MessageStatusUnion;
77
+
78
+ declare abstract class BaseMessageOutput {
79
+ id: string;
80
+ createdAt: Date;
81
+ status: typeof MessageStatusUnion;
82
+ }
83
+
84
+ type MessageType = "TextMessage" | "ActionExecutionMessage" | "ResultMessage" | "AgentStateMessage" | "ImageMessage";
85
+ declare class Message {
86
+ type: MessageType;
87
+ id: BaseMessageOutput["id"];
88
+ createdAt: BaseMessageOutput["createdAt"];
89
+ status: MessageStatus;
90
+ constructor(props: any);
91
+ isTextMessage(): this is TextMessage;
92
+ isActionExecutionMessage(): this is ActionExecutionMessage;
93
+ isResultMessage(): this is ResultMessage;
94
+ isAgentStateMessage(): this is AgentStateMessage;
95
+ isImageMessage(): this is ImageMessage;
96
+ }
97
+ declare const Role: typeof MessageRole;
98
+ type MessageConstructorOptions = Partial<Message>;
99
+ type TextMessageConstructorOptions = MessageConstructorOptions & TextMessageInput;
100
+ declare class TextMessage extends Message implements TextMessageConstructorOptions {
101
+ content: TextMessageInput["content"];
102
+ parentMessageId: TextMessageInput["parentMessageId"];
103
+ role: TextMessageInput["role"];
104
+ type: "TextMessage";
105
+ constructor(props: TextMessageConstructorOptions);
106
+ }
107
+ declare class ActionExecutionMessage extends Message implements Omit<ActionExecutionMessageInput, "arguments" | "scope"> {
108
+ type: MessageType;
109
+ name: string;
110
+ arguments: Record<string, any>;
111
+ parentMessageId?: string;
112
+ }
113
+ declare class ResultMessage extends Message implements ResultMessageInput {
114
+ type: MessageType;
115
+ actionExecutionId: string;
116
+ actionName: string;
117
+ result: string;
118
+ static encodeResult(result: any, error?: {
119
+ code: string;
120
+ message: string;
121
+ } | string | Error): string;
122
+ static decodeResult(result: string): {
123
+ error?: {
124
+ code: string;
125
+ message: string;
126
+ };
127
+ result: string;
128
+ };
129
+ hasError(): boolean;
130
+ getError(): {
131
+ code: string;
132
+ message: string;
133
+ } | undefined;
134
+ }
135
+ declare class AgentStateMessage extends Message implements Omit<AgentStateMessageInput, "state"> {
136
+ type: MessageType;
137
+ threadId: string;
138
+ agentName: string;
139
+ nodeName: string;
140
+ runId: string;
141
+ active: boolean;
142
+ role: MessageRole;
143
+ state: any;
144
+ running: boolean;
145
+ }
146
+ declare class ImageMessage extends Message implements ImageMessageInput {
147
+ type: MessageType;
148
+ format: string;
149
+ bytes: string;
150
+ role: MessageRole;
151
+ parentMessageId?: string;
152
+ }
153
+
154
+ export { ActionExecutionMessage as A, ImageMessage as I, Message as M, ResultMessage as R, TextMessage as T, MessageInput as a, ActionInputAvailability as b, MessageType as c, Role as d, AgentStateMessage as e };
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import Anthropic from '@anthropic-ai/sdk';
9
9
  import * as graphql from 'graphql';
10
10
  import * as pino from 'pino';
11
11
  import { YogaInitialContext, createYoga } from 'graphql-yoga';
12
- import { CopilotRuntimeOptions, CopilotRuntime as CopilotRuntime$1 } from '@copilotkitnext/runtime';
12
+ import { CopilotRuntimeOptions, CopilotRuntime as CopilotRuntime$1, AgentRunner } from '@copilotkitnext/runtime';
13
13
  import { AbstractAgent } from '@ag-ui/client';
14
14
  import * as http from 'http';
15
15
  import { ServerResponse, IncomingMessage } from 'http';
@@ -1370,31 +1370,90 @@ declare function copilotRuntimeNestEndpoint(options: CreateCopilotRuntimeServerO
1370
1370
  }, res: http.ServerResponse) => Promise<void>;
1371
1371
 
1372
1372
  /**
1373
- * @deprecated LangGraphAgent import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
1373
+ * TelemetryAgentRunner - A wrapper around AgentRunner that adds telemetry
1374
+ * for agent execution streams.
1375
+ *
1376
+ * This captures the following telemetry events:
1377
+ * - oss.runtime.agent_execution_stream_started - when an agent execution starts
1378
+ * - oss.runtime.agent_execution_stream_ended - when an agent execution completes
1379
+ * - oss.runtime.agent_execution_stream_errored - when an agent execution fails
1380
+ */
1381
+
1382
+ /**
1383
+ * Configuration options for TelemetryAgentRunner
1384
+ */
1385
+ interface TelemetryAgentRunnerConfig {
1386
+ /**
1387
+ * The underlying runner to delegate to
1388
+ * If not provided, defaults to InMemoryAgentRunner
1389
+ */
1390
+ runner?: AgentRunner;
1391
+ /**
1392
+ * Optional LangSmith API key (will be hashed for telemetry)
1393
+ */
1394
+ langsmithApiKey?: string;
1395
+ }
1396
+ /**
1397
+ * An AgentRunner wrapper that adds telemetry tracking for agent executions.
1398
+ *
1399
+ * Usage:
1400
+ * ```ts
1401
+ * const runtime = new CopilotRuntime({
1402
+ * runner: new TelemetryAgentRunner(),
1403
+ * // or with custom runner:
1404
+ * runner: new TelemetryAgentRunner({ runner: customRunner }),
1405
+ * });
1406
+ * ```
1407
+ */
1408
+ declare class TelemetryAgentRunner implements AgentRunner {
1409
+ private readonly _runner;
1410
+ private readonly hashedLgcKey;
1411
+ constructor(config?: TelemetryAgentRunnerConfig);
1412
+ /**
1413
+ * Runs an agent with telemetry tracking.
1414
+ * Wraps the underlying runner's Observable stream with telemetry events.
1415
+ */
1416
+ run(...args: Parameters<AgentRunner["run"]>): ReturnType<AgentRunner["run"]>;
1417
+ /**
1418
+ * Delegates to the underlying runner's connect method
1419
+ */
1420
+ connect(...args: Parameters<AgentRunner["connect"]>): ReturnType<AgentRunner["connect"]>;
1421
+ /**
1422
+ * Delegates to the underlying runner's isRunning method
1423
+ */
1424
+ isRunning(...args: Parameters<AgentRunner["isRunning"]>): ReturnType<AgentRunner["isRunning"]>;
1425
+ /**
1426
+ * Delegates to the underlying runner's stop method
1427
+ */
1428
+ stop(...args: Parameters<AgentRunner["stop"]>): ReturnType<AgentRunner["stop"]>;
1429
+ }
1430
+
1431
+ /**
1432
+ * @deprecated LangGraphAgent import from `@copilotkit/runtime` is deprecated. Please import it from `@copilotkit/runtime/langgraph` instead
1374
1433
  */
1375
1434
  declare class LangGraphAgent {
1376
1435
  constructor();
1377
1436
  }
1378
1437
  /**
1379
- * @deprecated LangGraphHttpAgent import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
1438
+ * @deprecated LangGraphHttpAgent import from `@copilotkit/runtime` is deprecated. Please import it from `@copilotkit/runtime/langgraph` instead
1380
1439
  */
1381
1440
  declare class LangGraphHttpAgent {
1382
1441
  constructor();
1383
1442
  }
1384
1443
  /**
1385
- * @deprecated TextMessageEvents import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
1444
+ * @deprecated TextMessageEvents import from `@copilotkit/runtime` is deprecated. Please import it from `@copilotkit/runtime/langgraph` instead
1386
1445
  */
1387
1446
  type TextMessageEvents = any;
1388
1447
  /**
1389
- * @deprecated ToolCallEvents import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
1448
+ * @deprecated ToolCallEvents import from `@copilotkit/runtime` is deprecated. Please import it from `@copilotkit/runtime/langgraph` instead
1390
1449
  */
1391
1450
  type ToolCallEvents = any;
1392
1451
  /**
1393
- * @deprecated CustomEventNames import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
1452
+ * @deprecated CustomEventNames import from `@copilotkit/runtime` is deprecated. Please import it from `@copilotkit/runtime/langgraph` instead
1394
1453
  */
1395
1454
  type CustomEventNames = any;
1396
1455
  /**
1397
- * @deprecated PredictStateTool import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
1456
+ * @deprecated PredictStateTool import from `@copilotkit/runtime` is deprecated. Please import it from `@copilotkit/runtime/langgraph` instead
1398
1457
  */
1399
1458
  type PredictStateTool = any;
1400
1459
 
@@ -1443,4 +1502,4 @@ declare class UnknownErrorResponse extends FailedResponseStatus {
1443
1502
  });
1444
1503
  }
1445
1504
 
1446
- export { AnthropicAdapter, AnthropicAdapterParams, AnthropicPromptCachingConfig, BedrockAdapter, BedrockAdapterParams, CommonConfig, CopilotRequestContextProperties, CopilotRuntime, CopilotRuntimeChatCompletionRequest, CopilotRuntimeChatCompletionResponse, CopilotRuntimeConstructorParams_BASE, CopilotRuntimeLogger, CopilotServiceAdapter, CreateCopilotRuntimeServerOptions, CustomEventNames, EmptyAdapter, ExperimentalEmptyAdapter, ExperimentalOllamaAdapter, GoogleGenerativeAIAdapter, GraphQLContext, GroqAdapter, GroqAdapterParams, GuardrailsValidationFailureResponse, LangChainAdapter, LangGraphAgent, LangGraphHttpAgent, LogLevel, MCPClient, MCPEndpointConfig, MCPTool, MessageStreamInterruptedResponse, OpenAIAdapter, OpenAIAdapterParams, OpenAIAssistantAdapter, OpenAIAssistantAdapterParams, PredictStateTool, RemoteChain, RemoteChainParameters, TextMessageEvents, ToolCallEvents, UnifyAdapter, UnifyAdapterParams, UnknownErrorResponse, addCustomHeaderPlugin, buildSchema, config, convertMCPToolsToActions, convertServiceAdapterError, copilotKitEndpoint, copilotRuntimeNestEndpoint, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint, copilotRuntimeNodeExpressEndpoint, copilotRuntimeNodeHttpEndpoint, createContext, createLogger, extractParametersFromSchema, generateMcpToolInstructions, getCommonConfig, langGraphPlatformEndpoint, readableStreamToNodeStream, resolveEndpointType };
1505
+ export { AnthropicAdapter, AnthropicAdapterParams, AnthropicPromptCachingConfig, BedrockAdapter, BedrockAdapterParams, CommonConfig, CopilotRequestContextProperties, CopilotRuntime, CopilotRuntimeChatCompletionRequest, CopilotRuntimeChatCompletionResponse, CopilotRuntimeConstructorParams_BASE, CopilotRuntimeLogger, CopilotServiceAdapter, CreateCopilotRuntimeServerOptions, CustomEventNames, EmptyAdapter, ExperimentalEmptyAdapter, ExperimentalOllamaAdapter, GoogleGenerativeAIAdapter, GraphQLContext, GroqAdapter, GroqAdapterParams, GuardrailsValidationFailureResponse, LangChainAdapter, LangGraphAgent, LangGraphHttpAgent, LogLevel, MCPClient, MCPEndpointConfig, MCPTool, MessageStreamInterruptedResponse, OpenAIAdapter, OpenAIAdapterParams, OpenAIAssistantAdapter, OpenAIAssistantAdapterParams, PredictStateTool, RemoteChain, RemoteChainParameters, TelemetryAgentRunner, TelemetryAgentRunnerConfig, TextMessageEvents, ToolCallEvents, UnifyAdapter, UnifyAdapterParams, UnknownErrorResponse, addCustomHeaderPlugin, buildSchema, config, convertMCPToolsToActions, convertServiceAdapterError, copilotKitEndpoint, copilotRuntimeNestEndpoint, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint, copilotRuntimeNodeExpressEndpoint, copilotRuntimeNodeHttpEndpoint, createContext, createLogger, extractParametersFromSchema, generateMcpToolInstructions, getCommonConfig, langGraphPlatformEndpoint, readableStreamToNodeStream, resolveEndpointType };
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ var require_package = __commonJS({
72
72
  publishConfig: {
73
73
  access: "public"
74
74
  },
75
- version: "1.50.0-beta.8",
75
+ version: "1.50.0",
76
76
  sideEffects: false,
77
77
  main: "./dist/index.js",
78
78
  module: "./dist/index.mjs",
@@ -123,12 +123,14 @@ var require_package = __commonJS({
123
123
  vitest: "^3.2.4"
124
124
  },
125
125
  dependencies: {
126
+ "@ag-ui/client": "^0.0.42",
127
+ "@ag-ui/core": "^0.0.42",
128
+ "@ag-ui/langgraph": "^0.0.20",
126
129
  "@copilotkit/shared": "workspace:*",
127
- "@copilotkitnext/agent": "0.0.28",
128
- "@copilotkitnext/runtime": "0.0.28",
130
+ "@copilotkitnext/agent": "0.0.31",
131
+ "@copilotkitnext/runtime": "0.0.31",
129
132
  "@graphql-yoga/plugin-defer-stream": "^3.3.1",
130
133
  "@hono/node-server": "^1.13.5",
131
- "@langchain/core": "^0.3.38",
132
134
  "@scarf/scarf": "^1.3.0",
133
135
  "class-transformer": "^0.5.1",
134
136
  "class-validator": "^0.14.1",
@@ -136,7 +138,6 @@ var require_package = __commonJS({
136
138
  "graphql-scalars": "^1.23.0",
137
139
  "graphql-yoga": "^5.3.1",
138
140
  hono: "^4.10.3",
139
- langchain: "^0.3.3",
140
141
  openai: "^4.85.1",
141
142
  "partial-json": "^0.1.7",
142
143
  pino: "^9.2.0",
@@ -148,27 +149,20 @@ var require_package = __commonJS({
148
149
  },
149
150
  peerDependencies: {
150
151
  "@anthropic-ai/sdk": "^0.57.0",
151
- "@ag-ui/client": "^0.0.42",
152
- "@ag-ui/core": ">=0.0.42",
153
- "@ag-ui/encoder": ">=0.0.42",
154
- "@ag-ui/langgraph": ">=0.0.20",
155
- "@ag-ui/proto": ">=0.0.42",
156
- "@langchain/aws": "^0.1.9",
157
- "@langchain/community": "^0.3.58",
158
- "@langchain/google-gauth": "^0.1.0",
159
- "@langchain/langgraph-sdk": "^0.0.70",
160
- "@langchain/openai": "^0.4.2",
152
+ "@langchain/aws": ">=0.1.9",
153
+ "@langchain/core": ">=0.3.66",
154
+ "@langchain/community": ">=0.3.58",
155
+ "@langchain/google-gauth": ">=0.1.0",
156
+ "@langchain/langgraph-sdk": ">=0.1.2",
157
+ "@langchain/openai": ">=0.4.2",
161
158
  "groq-sdk": ">=0.3.0 <1.0.0",
162
- langchain: "^0.3.3",
159
+ langchain: ">=0.3.3",
163
160
  openai: "^4.85.1"
164
161
  },
165
162
  peerDependenciesMeta: {
166
163
  "@anthropic-ai/sdk": {
167
164
  optional: true
168
165
  },
169
- "@ag-ui/langgraph": {
170
- optional: true
171
- },
172
166
  "@langchain/aws": {
173
167
  optional: true
174
168
  },
@@ -3240,6 +3234,82 @@ function aguiMessageWithImageToGQLMessage(message) {
3240
3234
  });
3241
3235
  }
3242
3236
  __name(aguiMessageWithImageToGQLMessage, "aguiMessageWithImageToGQLMessage");
3237
+ var TelemetryAgentRunner = class {
3238
+ _runner;
3239
+ hashedLgcKey;
3240
+ constructor(config2) {
3241
+ this._runner = (config2 == null ? void 0 : config2.runner) ?? new runtime.InMemoryAgentRunner();
3242
+ this.hashedLgcKey = (config2 == null ? void 0 : config2.langsmithApiKey) ? crypto.createHash("sha256").update(config2.langsmithApiKey).digest("hex") : void 0;
3243
+ }
3244
+ /**
3245
+ * Runs an agent with telemetry tracking.
3246
+ * Wraps the underlying runner's Observable stream with telemetry events.
3247
+ */
3248
+ run(...args) {
3249
+ const streamInfo = {
3250
+ hashedLgcKey: this.hashedLgcKey
3251
+ };
3252
+ let streamErrored = false;
3253
+ telemetry_client_default.capture("oss.runtime.agent_execution_stream_started", {
3254
+ hashedLgcKey: this.hashedLgcKey
3255
+ });
3256
+ return this._runner.run(...args).pipe(
3257
+ // Extract metadata from events if available
3258
+ rxjs.tap((event) => {
3259
+ var _a;
3260
+ const rawEvent = event.rawEvent;
3261
+ if (rawEvent == null ? void 0 : rawEvent.data) {
3262
+ const data = rawEvent.data;
3263
+ if ((_a = data == null ? void 0 : data.output) == null ? void 0 : _a.model) {
3264
+ streamInfo.model = data.output.model;
3265
+ streamInfo.provider = data.output.model;
3266
+ }
3267
+ }
3268
+ if (rawEvent == null ? void 0 : rawEvent.metadata) {
3269
+ const metadata = rawEvent.metadata;
3270
+ if (metadata == null ? void 0 : metadata.langgraph_host) {
3271
+ streamInfo.langGraphHost = metadata.langgraph_host;
3272
+ }
3273
+ if (metadata == null ? void 0 : metadata.langgraph_version) {
3274
+ streamInfo.langGraphVersion = metadata.langgraph_version;
3275
+ }
3276
+ }
3277
+ }),
3278
+ rxjs.catchError((error) => {
3279
+ streamErrored = true;
3280
+ telemetry_client_default.capture("oss.runtime.agent_execution_stream_errored", {
3281
+ ...streamInfo,
3282
+ error: error instanceof Error ? error.message : String(error)
3283
+ });
3284
+ throw error;
3285
+ }),
3286
+ rxjs.finalize(() => {
3287
+ if (!streamErrored) {
3288
+ telemetry_client_default.capture("oss.runtime.agent_execution_stream_ended", streamInfo);
3289
+ }
3290
+ })
3291
+ );
3292
+ }
3293
+ /**
3294
+ * Delegates to the underlying runner's connect method
3295
+ */
3296
+ connect(...args) {
3297
+ return this._runner.connect(...args);
3298
+ }
3299
+ /**
3300
+ * Delegates to the underlying runner's isRunning method
3301
+ */
3302
+ isRunning(...args) {
3303
+ return this._runner.isRunning(...args);
3304
+ }
3305
+ /**
3306
+ * Delegates to the underlying runner's stop method
3307
+ */
3308
+ stop(...args) {
3309
+ return this._runner.stop(...args);
3310
+ }
3311
+ };
3312
+ __name(TelemetryAgentRunner, "TelemetryAgentRunner");
3243
3313
 
3244
3314
  // src/lib/runtime/types.ts
3245
3315
  var EndpointType;
@@ -3393,12 +3463,16 @@ var CopilotRuntime = class {
3393
3463
  constructor(params) {
3394
3464
  const agents = (params == null ? void 0 : params.agents) ?? {};
3395
3465
  const endpointAgents = this.assignEndpointsToAgents((params == null ? void 0 : params.remoteEndpoints) ?? []);
3466
+ const baseRunner = (params == null ? void 0 : params.runner) ?? new runtime.InMemoryAgentRunner();
3467
+ const runner = shared.isTelemetryDisabled() ? baseRunner : new TelemetryAgentRunner({
3468
+ runner: baseRunner
3469
+ });
3396
3470
  this.runtimeArgs = {
3397
3471
  agents: {
3398
3472
  ...endpointAgents,
3399
3473
  ...agents
3400
3474
  },
3401
- runner: (params == null ? void 0 : params.runner) ?? new runtime.InMemoryAgentRunner(),
3475
+ runner,
3402
3476
  // TODO: add support for transcriptionService from CopilotRuntimeOptionsVNext once it is ready
3403
3477
  // transcriptionService: params?.transcriptionService,
3404
3478
  beforeRequestMiddleware: this.createOnBeforeRequestHandler(params).bind(this),
@@ -3424,6 +3498,7 @@ var CopilotRuntime = class {
3424
3498
  }
3425
3499
  handleServiceAdapter(serviceAdapter) {
3426
3500
  this.runtimeArgs.agents = Promise.resolve(this.runtimeArgs.agents ?? {}).then(async (agents) => {
3501
+ var _a;
3427
3502
  let agentsList = agents;
3428
3503
  const isAgentsListEmpty = !Object.keys(agents).length;
3429
3504
  const hasServiceAdapter = Boolean(serviceAdapter);
@@ -3441,10 +3516,11 @@ var CopilotRuntime = class {
3441
3516
  model: `${serviceAdapter.provider}/${serviceAdapter.model}`
3442
3517
  });
3443
3518
  }
3444
- if (this.params.actions) {
3519
+ const actions = (_a = this.params) == null ? void 0 : _a.actions;
3520
+ if (actions) {
3445
3521
  const mcpTools = await this.getToolsFromMCP();
3446
3522
  agentsList = this.assignToolsToAgents(agents, [
3447
- ...this.getToolsFromActions(this.params.actions),
3523
+ ...this.getToolsFromActions(actions),
3448
3524
  ...mcpTools
3449
3525
  ]);
3450
3526
  }
@@ -3491,11 +3567,24 @@ var CopilotRuntime = class {
3491
3567
  }
3492
3568
  createOnBeforeRequestHandler(params) {
3493
3569
  return async (hookParams) => {
3494
- var _a, _b;
3495
- (_a = params == null ? void 0 : params.beforeRequestMiddleware) == null ? void 0 : _a.call(params, hookParams);
3496
- if ((_b = params == null ? void 0 : params.middleware) == null ? void 0 : _b.onBeforeRequest) {
3497
- const { request, runtime, path } = hookParams;
3498
- const body = await shared.readBody(request);
3570
+ var _a, _b, _c, _d;
3571
+ const { request } = hookParams;
3572
+ const publicApiKey = request.headers.get("x-copilotcloud-public-api-key");
3573
+ const body = await shared.readBody(request);
3574
+ const forwardedProps = body.forwardedProps;
3575
+ const cloudBaseUrl = process.env.COPILOT_CLOUD_BASE_URL || "https://api.cloud.copilotkit.ai";
3576
+ telemetry_client_default.capture("oss.runtime.copilot_request_created", {
3577
+ "cloud.guardrails.enabled": ((_a = forwardedProps == null ? void 0 : forwardedProps.cloud) == null ? void 0 : _a.guardrails) !== void 0,
3578
+ requestType: ((_b = forwardedProps == null ? void 0 : forwardedProps.metadata) == null ? void 0 : _b.requestType) ?? "unknown",
3579
+ "cloud.api_key_provided": !!publicApiKey,
3580
+ ...publicApiKey ? {
3581
+ "cloud.public_api_key": publicApiKey
3582
+ } : {},
3583
+ "cloud.base_url": cloudBaseUrl
3584
+ });
3585
+ (_c = params == null ? void 0 : params.beforeRequestMiddleware) == null ? void 0 : _c.call(params, hookParams);
3586
+ if ((_d = params == null ? void 0 : params.middleware) == null ? void 0 : _d.onBeforeRequest) {
3587
+ const { request: request2, runtime, path } = hookParams;
3499
3588
  const gqlMessages = aguiToGQL(body.messages).reduce((acc, msg) => {
3500
3589
  if ("role" in msg && msg.role === "user") {
3501
3590
  acc.inputMessages.push(msg);
@@ -3513,7 +3602,7 @@ var CopilotRuntime = class {
3513
3602
  runId: body.runId,
3514
3603
  inputMessages,
3515
3604
  properties: body.forwardedProps,
3516
- url: request.url
3605
+ url: request2.url
3517
3606
  });
3518
3607
  }
3519
3608
  };
@@ -5492,6 +5581,7 @@ exports.MessageStreamInterruptedResponse = MessageStreamInterruptedResponse;
5492
5581
  exports.OpenAIAdapter = OpenAIAdapter;
5493
5582
  exports.OpenAIAssistantAdapter = OpenAIAssistantAdapter;
5494
5583
  exports.RemoteChain = RemoteChain;
5584
+ exports.TelemetryAgentRunner = TelemetryAgentRunner;
5495
5585
  exports.UnifyAdapter = UnifyAdapter;
5496
5586
  exports.UnknownErrorResponse = UnknownErrorResponse;
5497
5587
  exports.addCustomHeaderPlugin = addCustomHeaderPlugin;