@copilotkit/runtime 1.50.0-beta.4 → 1.50.0-beta.5

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 (221) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +6 -6
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +10 -10
  6. package/dist/chunk-27JKTS6P.mjs +0 -1704
  7. package/dist/chunk-27JKTS6P.mjs.map +0 -1
  8. package/dist/chunk-2GPTVDTO.mjs +0 -25
  9. package/dist/chunk-2GPTVDTO.mjs.map +0 -1
  10. package/dist/chunk-2OZAGFV3.mjs +0 -43
  11. package/dist/chunk-2OZAGFV3.mjs.map +0 -1
  12. package/dist/chunk-3AJVKDZX.mjs +0 -3097
  13. package/dist/chunk-3AJVKDZX.mjs.map +0 -1
  14. package/dist/chunk-45RCC3ZS.mjs +0 -25
  15. package/dist/chunk-45RCC3ZS.mjs.map +0 -1
  16. package/dist/chunk-4EHJ4XFJ.mjs +0 -25
  17. package/dist/chunk-4EHJ4XFJ.mjs.map +0 -1
  18. package/dist/chunk-4IANB4TC.mjs +0 -25
  19. package/dist/chunk-4IANB4TC.mjs.map +0 -1
  20. package/dist/chunk-4KES76K3.mjs +0 -74
  21. package/dist/chunk-4KES76K3.mjs.map +0 -1
  22. package/dist/chunk-4OGE3SLW.mjs +0 -3100
  23. package/dist/chunk-4OGE3SLW.mjs.map +0 -1
  24. package/dist/chunk-54YJBMCP.mjs +0 -3097
  25. package/dist/chunk-54YJBMCP.mjs.map +0 -1
  26. package/dist/chunk-62NE5S6M.mjs +0 -226
  27. package/dist/chunk-62NE5S6M.mjs.map +0 -1
  28. package/dist/chunk-6ER4SZYH.mjs +0 -74
  29. package/dist/chunk-6ER4SZYH.mjs.map +0 -1
  30. package/dist/chunk-6TNSLHVR.mjs +0 -74
  31. package/dist/chunk-6TNSLHVR.mjs.map +0 -1
  32. package/dist/chunk-6XRUR5UK.mjs +0 -1
  33. package/dist/chunk-6XRUR5UK.mjs.map +0 -1
  34. package/dist/chunk-7V4BK7TZ.mjs +0 -25
  35. package/dist/chunk-7V4BK7TZ.mjs.map +0 -1
  36. package/dist/chunk-7YZIEXD2.mjs +0 -74
  37. package/dist/chunk-7YZIEXD2.mjs.map +0 -1
  38. package/dist/chunk-A4XHOAFU.mjs +0 -25
  39. package/dist/chunk-A4XHOAFU.mjs.map +0 -1
  40. package/dist/chunk-A555KEAD.mjs +0 -6020
  41. package/dist/chunk-A555KEAD.mjs.map +0 -1
  42. package/dist/chunk-AF73TFTX.mjs +0 -74
  43. package/dist/chunk-AF73TFTX.mjs.map +0 -1
  44. package/dist/chunk-AMUJQ6IR.mjs +0 -50
  45. package/dist/chunk-AMUJQ6IR.mjs.map +0 -1
  46. package/dist/chunk-AQG2SVCA.mjs +0 -25
  47. package/dist/chunk-AQG2SVCA.mjs.map +0 -1
  48. package/dist/chunk-BJZHMXND.mjs +0 -74
  49. package/dist/chunk-BJZHMXND.mjs.map +0 -1
  50. package/dist/chunk-CB2OJXF6.mjs +0 -25
  51. package/dist/chunk-CB2OJXF6.mjs.map +0 -1
  52. package/dist/chunk-CEOMFPJU.mjs +0 -6020
  53. package/dist/chunk-CEOMFPJU.mjs.map +0 -1
  54. package/dist/chunk-CZVLR7CC.mjs +0 -175
  55. package/dist/chunk-CZVLR7CC.mjs.map +0 -1
  56. package/dist/chunk-DCEEHMLJ.mjs +0 -1127
  57. package/dist/chunk-DCEEHMLJ.mjs.map +0 -1
  58. package/dist/chunk-DE3CLKUG.mjs +0 -25
  59. package/dist/chunk-DE3CLKUG.mjs.map +0 -1
  60. package/dist/chunk-DTPRUTNV.mjs +0 -25
  61. package/dist/chunk-DTPRUTNV.mjs.map +0 -1
  62. package/dist/chunk-ERUOA47O.mjs +0 -626
  63. package/dist/chunk-ERUOA47O.mjs.map +0 -1
  64. package/dist/chunk-ESSRC64W.mjs +0 -74
  65. package/dist/chunk-ESSRC64W.mjs.map +0 -1
  66. package/dist/chunk-FHD4JECV.mjs +0 -33
  67. package/dist/chunk-FHD4JECV.mjs.map +0 -1
  68. package/dist/chunk-GRAN6K6N.mjs +0 -25
  69. package/dist/chunk-GRAN6K6N.mjs.map +0 -1
  70. package/dist/chunk-I27F2UPA.mjs +0 -175
  71. package/dist/chunk-I27F2UPA.mjs.map +0 -1
  72. package/dist/chunk-IAZKTOQW.mjs +0 -25
  73. package/dist/chunk-IAZKTOQW.mjs.map +0 -1
  74. package/dist/chunk-J6XZ5MFB.mjs +0 -25
  75. package/dist/chunk-J6XZ5MFB.mjs.map +0 -1
  76. package/dist/chunk-JJ32MA4C.mjs +0 -73
  77. package/dist/chunk-JJ32MA4C.mjs.map +0 -1
  78. package/dist/chunk-JJY4ZTHQ.mjs +0 -25
  79. package/dist/chunk-JJY4ZTHQ.mjs.map +0 -1
  80. package/dist/chunk-KEYLBFU2.mjs +0 -3117
  81. package/dist/chunk-KEYLBFU2.mjs.map +0 -1
  82. package/dist/chunk-KQ53L4WZ.mjs +0 -3094
  83. package/dist/chunk-KQ53L4WZ.mjs.map +0 -1
  84. package/dist/chunk-KTELVQ67.mjs +0 -3098
  85. package/dist/chunk-KTELVQ67.mjs.map +0 -1
  86. package/dist/chunk-LPEPX6NH.mjs +0 -25
  87. package/dist/chunk-LPEPX6NH.mjs.map +0 -1
  88. package/dist/chunk-MDXE55DK.mjs +0 -3117
  89. package/dist/chunk-MDXE55DK.mjs.map +0 -1
  90. package/dist/chunk-MMFUVOXH.mjs +0 -73
  91. package/dist/chunk-MMFUVOXH.mjs.map +0 -1
  92. package/dist/chunk-N3Y4U66N.mjs +0 -253
  93. package/dist/chunk-N3Y4U66N.mjs.map +0 -1
  94. package/dist/chunk-O7UYB4MH.mjs +0 -25
  95. package/dist/chunk-O7UYB4MH.mjs.map +0 -1
  96. package/dist/chunk-OFNVQHNM.mjs +0 -3089
  97. package/dist/chunk-OFNVQHNM.mjs.map +0 -1
  98. package/dist/chunk-OFSV5GET.mjs +0 -3074
  99. package/dist/chunk-OFSV5GET.mjs.map +0 -1
  100. package/dist/chunk-OMRST67R.mjs +0 -25
  101. package/dist/chunk-OMRST67R.mjs.map +0 -1
  102. package/dist/chunk-OWIGJONH.mjs +0 -275
  103. package/dist/chunk-OWIGJONH.mjs.map +0 -1
  104. package/dist/chunk-PRZHE74A.mjs +0 -25
  105. package/dist/chunk-PRZHE74A.mjs.map +0 -1
  106. package/dist/chunk-PTYRVXXP.mjs +0 -80
  107. package/dist/chunk-PTYRVXXP.mjs.map +0 -1
  108. package/dist/chunk-R22B5CCO.mjs +0 -25
  109. package/dist/chunk-R22B5CCO.mjs.map +0 -1
  110. package/dist/chunk-SHBDMA63.mjs +0 -141
  111. package/dist/chunk-SHBDMA63.mjs.map +0 -1
  112. package/dist/chunk-SPVXBPRA.mjs +0 -74
  113. package/dist/chunk-SPVXBPRA.mjs.map +0 -1
  114. package/dist/chunk-T72G46ME.mjs +0 -25
  115. package/dist/chunk-T72G46ME.mjs.map +0 -1
  116. package/dist/chunk-TGELROPU.mjs +0 -25
  117. package/dist/chunk-TGELROPU.mjs.map +0 -1
  118. package/dist/chunk-UNX4IAAD.mjs +0 -25
  119. package/dist/chunk-UNX4IAAD.mjs.map +0 -1
  120. package/dist/chunk-V4DHVC7M.mjs +0 -3085
  121. package/dist/chunk-V4DHVC7M.mjs.map +0 -1
  122. package/dist/chunk-VVRFOB66.mjs +0 -25
  123. package/dist/chunk-VVRFOB66.mjs.map +0 -1
  124. package/dist/chunk-W6NVBYM6.mjs +0 -80
  125. package/dist/chunk-W6NVBYM6.mjs.map +0 -1
  126. package/dist/chunk-W7MBACGC.mjs +0 -74
  127. package/dist/chunk-W7MBACGC.mjs.map +0 -1
  128. package/dist/chunk-WMD4XZZS.mjs +0 -25
  129. package/dist/chunk-WMD4XZZS.mjs.map +0 -1
  130. package/dist/chunk-WX2ZNCRT.mjs +0 -74
  131. package/dist/chunk-WX2ZNCRT.mjs.map +0 -1
  132. package/dist/chunk-XWBDEXDA.mjs +0 -153
  133. package/dist/chunk-XWBDEXDA.mjs.map +0 -1
  134. package/dist/chunk-Y2Z62E2T.mjs +0 -74
  135. package/dist/chunk-Y2Z62E2T.mjs.map +0 -1
  136. package/dist/chunk-YO4I6RVI.mjs +0 -25
  137. package/dist/chunk-YO4I6RVI.mjs.map +0 -1
  138. package/dist/chunk-Z6Q5IW6I.mjs +0 -3098
  139. package/dist/chunk-Z6Q5IW6I.mjs.map +0 -1
  140. package/dist/chunk-Z726O3G2.mjs +0 -25
  141. package/dist/chunk-Z726O3G2.mjs.map +0 -1
  142. package/dist/chunk-ZE4SMZZR.mjs +0 -3097
  143. package/dist/chunk-ZE4SMZZR.mjs.map +0 -1
  144. package/dist/chunk-ZULZB33C.mjs +0 -73
  145. package/dist/chunk-ZULZB33C.mjs.map +0 -1
  146. package/dist/chunk-ZVRGXMY7.mjs +0 -25
  147. package/dist/chunk-ZVRGXMY7.mjs.map +0 -1
  148. package/dist/chunk-ZZ35WBYQ.mjs +0 -25
  149. package/dist/chunk-ZZ35WBYQ.mjs.map +0 -1
  150. package/dist/graphql/message-conversion/index.d.ts +0 -18
  151. package/dist/graphql/message-conversion/index.js +0 -725
  152. package/dist/graphql/message-conversion/index.js.map +0 -1
  153. package/dist/graphql/message-conversion/index.mjs +0 -245
  154. package/dist/graphql/message-conversion/index.mjs.map +0 -1
  155. package/dist/graphql/types/base/index.d.ts +0 -6
  156. package/dist/graphql/types/base/index.js +0 -63
  157. package/dist/graphql/types/base/index.js.map +0 -1
  158. package/dist/graphql/types/base/index.mjs +0 -8
  159. package/dist/graphql/types/base/index.mjs.map +0 -1
  160. package/dist/graphql/types/converted/index.d.ts +0 -2
  161. package/dist/graphql/types/converted/index.js +0 -200
  162. package/dist/graphql/types/converted/index.js.map +0 -1
  163. package/dist/graphql/types/converted/index.mjs +0 -19
  164. package/dist/graphql/types/converted/index.mjs.map +0 -1
  165. package/dist/groq-adapter-540da9c3.d.ts +0 -331
  166. package/dist/groq-adapter-a6f5e9d2.d.ts +0 -331
  167. package/dist/groq-adapter-c8aec5c5.d.ts +0 -321
  168. package/dist/index-96b330da.d.ts +0 -119
  169. package/dist/index-adbd78f1.d.ts +0 -154
  170. package/dist/langserve-0c6100e3.d.ts +0 -257
  171. package/dist/langserve-978d5790.d.ts +0 -243
  172. package/dist/langserve-9fc76ce5.d.ts +0 -243
  173. package/dist/lib/cloud/index.d.ts +0 -6
  174. package/dist/lib/cloud/index.js +0 -18
  175. package/dist/lib/cloud/index.js.map +0 -1
  176. package/dist/lib/cloud/index.mjs +0 -1
  177. package/dist/lib/cloud/index.mjs.map +0 -1
  178. package/dist/lib/index.d.ts +0 -212
  179. package/dist/lib/index.js +0 -7843
  180. package/dist/lib/index.js.map +0 -1
  181. package/dist/lib/index.mjs +0 -76
  182. package/dist/lib/index.mjs.map +0 -1
  183. package/dist/lib/integrations/index.d.ts +0 -34
  184. package/dist/lib/integrations/index.js +0 -3052
  185. package/dist/lib/integrations/index.js.map +0 -1
  186. package/dist/lib/integrations/index.mjs +0 -37
  187. package/dist/lib/integrations/index.mjs.map +0 -1
  188. package/dist/lib/integrations/nest/index.d.ts +0 -15
  189. package/dist/lib/integrations/nest/index.js +0 -2959
  190. package/dist/lib/integrations/nest/index.js.map +0 -1
  191. package/dist/lib/integrations/nest/index.mjs +0 -14
  192. package/dist/lib/integrations/nest/index.mjs.map +0 -1
  193. package/dist/lib/integrations/node-express/index.d.ts +0 -15
  194. package/dist/lib/integrations/node-express/index.js +0 -2959
  195. package/dist/lib/integrations/node-express/index.js.map +0 -1
  196. package/dist/lib/integrations/node-express/index.mjs +0 -14
  197. package/dist/lib/integrations/node-express/index.mjs.map +0 -1
  198. package/dist/lib/integrations/node-http/index.d.ts +0 -15
  199. package/dist/lib/integrations/node-http/index.js +0 -2945
  200. package/dist/lib/integrations/node-http/index.js.map +0 -1
  201. package/dist/lib/integrations/node-http/index.mjs +0 -13
  202. package/dist/lib/integrations/node-http/index.mjs.map +0 -1
  203. package/dist/service-adapters/index.d.ts +0 -162
  204. package/dist/service-adapters/index.js +0 -1787
  205. package/dist/service-adapters/index.js.map +0 -1
  206. package/dist/service-adapters/index.mjs +0 -34
  207. package/dist/service-adapters/index.mjs.map +0 -1
  208. package/dist/service-adapters/shared/index.d.ts +0 -9
  209. package/dist/service-adapters/shared/index.js +0 -72
  210. package/dist/service-adapters/shared/index.js.map +0 -1
  211. package/dist/service-adapters/shared/index.mjs +0 -8
  212. package/dist/service-adapters/shared/index.mjs.map +0 -1
  213. package/dist/shared-0a7346ce.d.ts +0 -466
  214. package/dist/shared-35c6eb04.d.ts +0 -448
  215. package/dist/shared-9ed1dc31.d.ts +0 -414
  216. package/dist/shared-da5708fe.d.ts +0 -449
  217. package/dist/utils/index.d.ts +0 -65
  218. package/dist/utils/index.js +0 -175
  219. package/dist/utils/index.js.map +0 -1
  220. package/dist/utils/index.mjs +0 -12
  221. package/dist/utils/index.mjs.map +0 -1
@@ -1,200 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/graphql/types/converted/index.ts
21
- var converted_exports = {};
22
- __export(converted_exports, {
23
- ActionExecutionMessage: () => ActionExecutionMessage,
24
- AgentStateMessage: () => AgentStateMessage,
25
- ImageMessage: () => ImageMessage,
26
- Message: () => Message,
27
- ResultMessage: () => ResultMessage,
28
- TextMessage: () => TextMessage
29
- });
30
- module.exports = __toCommonJS(converted_exports);
31
-
32
- // src/graphql/types/base/index.ts
33
- var import_type_graphql = require("type-graphql");
34
- function _ts_decorate(decorators, target, key, desc) {
35
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
37
- r = Reflect.decorate(decorators, target, key, desc);
38
- else
39
- for (var i = decorators.length - 1; i >= 0; i--)
40
- if (d = decorators[i])
41
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
42
- return c > 3 && r && Object.defineProperty(target, key, r), r;
43
- }
44
- __name(_ts_decorate, "_ts_decorate");
45
- function _ts_metadata(k, v) {
46
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
47
- return Reflect.metadata(k, v);
48
- }
49
- __name(_ts_metadata, "_ts_metadata");
50
- var BaseMessageInput = class {
51
- id;
52
- createdAt;
53
- };
54
- __name(BaseMessageInput, "BaseMessageInput");
55
- _ts_decorate([
56
- (0, import_type_graphql.Field)(() => String),
57
- _ts_metadata("design:type", String)
58
- ], BaseMessageInput.prototype, "id", void 0);
59
- _ts_decorate([
60
- (0, import_type_graphql.Field)(() => Date),
61
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
62
- ], BaseMessageInput.prototype, "createdAt", void 0);
63
- BaseMessageInput = _ts_decorate([
64
- (0, import_type_graphql.InputType)()
65
- ], BaseMessageInput);
66
-
67
- // src/graphql/types/converted/index.ts
68
- var Message = class extends BaseMessageInput {
69
- type;
70
- isTextMessage() {
71
- return this.type === "TextMessage";
72
- }
73
- isActionExecutionMessage() {
74
- return this.type === "ActionExecutionMessage";
75
- }
76
- isResultMessage() {
77
- return this.type === "ResultMessage";
78
- }
79
- isAgentStateMessage() {
80
- return this.type === "AgentStateMessage";
81
- }
82
- isImageMessage() {
83
- return this.type === "ImageMessage";
84
- }
85
- };
86
- __name(Message, "Message");
87
- var TextMessage = class extends Message {
88
- type = "TextMessage";
89
- content;
90
- role;
91
- parentMessageId;
92
- };
93
- __name(TextMessage, "TextMessage");
94
- var ActionExecutionMessage = class extends Message {
95
- type = "ActionExecutionMessage";
96
- name;
97
- arguments;
98
- parentMessageId;
99
- };
100
- __name(ActionExecutionMessage, "ActionExecutionMessage");
101
- var ResultMessage = class extends Message {
102
- type = "ResultMessage";
103
- actionExecutionId;
104
- actionName;
105
- result;
106
- static encodeResult(result, error) {
107
- const errorObj = error ? typeof error === "string" ? {
108
- code: "ERROR",
109
- message: error
110
- } : error instanceof Error ? {
111
- code: "ERROR",
112
- message: error.message
113
- } : error : void 0;
114
- if (errorObj) {
115
- return JSON.stringify({
116
- error: errorObj,
117
- result: result || ""
118
- });
119
- }
120
- if (result === void 0) {
121
- return "";
122
- }
123
- return typeof result === "string" ? result : JSON.stringify(result);
124
- }
125
- static decodeResult(result) {
126
- if (!result) {
127
- return {
128
- result: ""
129
- };
130
- }
131
- try {
132
- const parsed = JSON.parse(result);
133
- if (parsed && typeof parsed === "object") {
134
- if ("error" in parsed) {
135
- return {
136
- error: parsed.error,
137
- result: parsed.result || ""
138
- };
139
- }
140
- return {
141
- result: JSON.stringify(parsed)
142
- };
143
- }
144
- return {
145
- result
146
- };
147
- } catch (e) {
148
- return {
149
- result
150
- };
151
- }
152
- }
153
- hasError() {
154
- try {
155
- const { error } = ResultMessage.decodeResult(this.result);
156
- return !!error;
157
- } catch {
158
- return false;
159
- }
160
- }
161
- getError() {
162
- try {
163
- const { error } = ResultMessage.decodeResult(this.result);
164
- return error;
165
- } catch {
166
- return void 0;
167
- }
168
- }
169
- };
170
- __name(ResultMessage, "ResultMessage");
171
- var AgentStateMessage = class extends Message {
172
- type = "AgentStateMessage";
173
- threadId;
174
- agentName;
175
- nodeName;
176
- runId;
177
- active;
178
- role;
179
- state;
180
- running;
181
- };
182
- __name(AgentStateMessage, "AgentStateMessage");
183
- var ImageMessage = class extends Message {
184
- type = "ImageMessage";
185
- format;
186
- bytes;
187
- role;
188
- parentMessageId;
189
- };
190
- __name(ImageMessage, "ImageMessage");
191
- // Annotate the CommonJS export names for ESM import in node:
192
- 0 && (module.exports = {
193
- ActionExecutionMessage,
194
- AgentStateMessage,
195
- ImageMessage,
196
- Message,
197
- ResultMessage,
198
- TextMessage
199
- });
200
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/graphql/types/converted/index.ts","../../../../src/graphql/types/base/index.ts"],"sourcesContent":["import {\n ActionExecutionMessageInput,\n ResultMessageInput,\n TextMessageInput,\n AgentStateMessageInput,\n ImageMessageInput,\n} from \"../../inputs/message.input\";\nimport { BaseMessageInput } from \"../base\";\nimport { MessageRole } from \"../enums\";\n\nexport type MessageType =\n | \"TextMessage\"\n | \"ActionExecutionMessage\"\n | \"ResultMessage\"\n | \"AgentStateMessage\"\n | \"ImageMessage\";\n\nexport class Message extends BaseMessageInput {\n type: MessageType;\n\n isTextMessage(): this is TextMessage {\n return this.type === \"TextMessage\";\n }\n\n isActionExecutionMessage(): this is ActionExecutionMessage {\n return this.type === \"ActionExecutionMessage\";\n }\n\n isResultMessage(): this is ResultMessage {\n return this.type === \"ResultMessage\";\n }\n\n isAgentStateMessage(): this is AgentStateMessage {\n return this.type === \"AgentStateMessage\";\n }\n\n isImageMessage(): this is ImageMessage {\n return this.type === \"ImageMessage\";\n }\n}\n\nexport class TextMessage extends Message implements TextMessageInput {\n type: MessageType = \"TextMessage\";\n content: string;\n role: MessageRole;\n parentMessageId?: string;\n}\n\nexport class ActionExecutionMessage\n extends Message\n implements Omit<ActionExecutionMessageInput, \"arguments\" | \"scope\">\n{\n type: MessageType = \"ActionExecutionMessage\";\n name: string;\n arguments: Record<string, any>;\n parentMessageId?: string;\n}\n\nexport class ResultMessage extends Message implements ResultMessageInput {\n type: MessageType = \"ResultMessage\";\n actionExecutionId: string;\n actionName: string;\n result: string;\n\n static encodeResult(\n result: any,\n error?: { code: string; message: string } | string | Error,\n ): string {\n const errorObj = error\n ? typeof error === \"string\"\n ? { code: \"ERROR\", message: error }\n : error instanceof Error\n ? { code: \"ERROR\", message: error.message }\n : error\n : undefined;\n\n if (errorObj) {\n return JSON.stringify({\n error: errorObj,\n result: result || \"\",\n });\n }\n if (result === undefined) {\n return \"\";\n }\n return typeof result === \"string\" ? result : JSON.stringify(result);\n }\n\n static decodeResult(result: string): {\n error?: { code: string; message: string };\n result: string;\n } {\n if (!result) {\n return { result: \"\" };\n }\n try {\n const parsed = JSON.parse(result);\n if (parsed && typeof parsed === \"object\") {\n if (\"error\" in parsed) {\n return {\n error: parsed.error,\n result: parsed.result || \"\",\n };\n }\n return { result: JSON.stringify(parsed) };\n }\n return { result };\n } catch (e) {\n return { result };\n }\n }\n\n hasError(): boolean {\n try {\n const { error } = ResultMessage.decodeResult(this.result);\n return !!error;\n } catch {\n return false;\n }\n }\n\n getError(): { code: string; message: string } | undefined {\n try {\n const { error } = ResultMessage.decodeResult(this.result);\n return error;\n } catch {\n return undefined;\n }\n }\n}\n\nexport class AgentStateMessage extends Message implements Omit<AgentStateMessageInput, \"state\"> {\n type: MessageType = \"AgentStateMessage\";\n threadId: string;\n agentName: string;\n nodeName: string;\n runId: string;\n active: boolean;\n role: MessageRole;\n state: any;\n running: boolean;\n}\n\nexport class ImageMessage extends Message implements ImageMessageInput {\n type: MessageType = \"ImageMessage\";\n format: string;\n bytes: string;\n role: MessageRole;\n parentMessageId?: string;\n}\n","import { Field, InputType } from \"type-graphql\";\n\n@InputType()\nexport class BaseMessageInput {\n @Field(() => String)\n id: string;\n\n @Field(() => Date)\n createdAt: Date;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA;;;;;;;;;;;;ACPA,0BAAiC;;;;;;;;;;;;;;;;;AAG1B,IAAMA,mBAAN,MAAMA;EAEXC;EAGAC;AACF;AANaF;;MACVG,2BAAM,MAAMC,MAAAA;;GADFJ,iBAAAA,WAAAA,MAAAA,MAAAA;;MAIVG,2BAAM,MAAME,IAAAA;qCACF,SAAA,cAAA,SAAA,IAAA;GALAL,iBAAAA,WAAAA,aAAAA,MAAAA;AAAAA,mBAAAA,aAAAA;MADZM,+BAAAA;GACYN,gBAAAA;;;ADcN,IAAMO,UAAN,cAAsBC,iBAAAA;EAC3BC;EAEAC,gBAAqC;AACnC,WAAO,KAAKD,SAAS;EACvB;EAEAE,2BAA2D;AACzD,WAAO,KAAKF,SAAS;EACvB;EAEAG,kBAAyC;AACvC,WAAO,KAAKH,SAAS;EACvB;EAEAI,sBAAiD;AAC/C,WAAO,KAAKJ,SAAS;EACvB;EAEAK,iBAAuC;AACrC,WAAO,KAAKL,SAAS;EACvB;AACF;AAtBaF;AAwBN,IAAMQ,cAAN,cAA0BR,QAAAA;EAC/BE,OAAoB;EACpBO;EACAC;EACAC;AACF;AALaH;AAON,IAAMI,yBAAN,cACGZ,QAAAA;EAGRE,OAAoB;EACpBW;EACAC;EACAH;AACF;AARaC;AAUN,IAAMG,gBAAN,cAA4Bf,QAAAA;EACjCE,OAAoB;EACpBc;EACAC;EACAC;EAEA,OAAOC,aACLD,QACAE,OACQ;AACR,UAAMC,WAAWD,QACb,OAAOA,UAAU,WACf;MAAEE,MAAM;MAASC,SAASH;IAAM,IAChCA,iBAAiBI,QACf;MAAEF,MAAM;MAASC,SAASH,MAAMG;IAAQ,IACxCH,QACJK;AAEJ,QAAIJ,UAAU;AACZ,aAAOK,KAAKC,UAAU;QACpBP,OAAOC;QACPH,QAAQA,UAAU;MACpB,CAAA;IACF;AACA,QAAIA,WAAWO,QAAW;AACxB,aAAO;IACT;AACA,WAAO,OAAOP,WAAW,WAAWA,SAASQ,KAAKC,UAAUT,MAAAA;EAC9D;EAEA,OAAOU,aAAaV,QAGlB;AACA,QAAI,CAACA,QAAQ;AACX,aAAO;QAAEA,QAAQ;MAAG;IACtB;AACA,QAAI;AACF,YAAMW,SAASH,KAAKI,MAAMZ,MAAAA;AAC1B,UAAIW,UAAU,OAAOA,WAAW,UAAU;AACxC,YAAI,WAAWA,QAAQ;AACrB,iBAAO;YACLT,OAAOS,OAAOT;YACdF,QAAQW,OAAOX,UAAU;UAC3B;QACF;AACA,eAAO;UAAEA,QAAQQ,KAAKC,UAAUE,MAAAA;QAAQ;MAC1C;AACA,aAAO;QAAEX;MAAO;IAClB,SAASa,GAAP;AACA,aAAO;QAAEb;MAAO;IAClB;EACF;EAEAc,WAAoB;AAClB,QAAI;AACF,YAAM,EAAEZ,MAAK,IAAKL,cAAca,aAAa,KAAKV,MAAM;AACxD,aAAO,CAAC,CAACE;IACX,QAAE;AACA,aAAO;IACT;EACF;EAEAa,WAA0D;AACxD,QAAI;AACF,YAAM,EAAEb,MAAK,IAAKL,cAAca,aAAa,KAAKV,MAAM;AACxD,aAAOE;IACT,QAAE;AACA,aAAOK;IACT;EACF;AACF;AAvEaV;AAyEN,IAAMmB,oBAAN,cAAgClC,QAAAA;EACrCE,OAAoB;EACpBiC;EACAC;EACAC;EACAC;EACAC;EACA7B;EACA8B;EACAC;AACF;AAVaP;AAYN,IAAMQ,eAAN,cAA2B1C,QAAAA;EAChCE,OAAoB;EACpByC;EACAC;EACAlC;EACAC;AACF;AANa+B;","names":["BaseMessageInput","id","createdAt","Field","String","Date","InputType","Message","BaseMessageInput","type","isTextMessage","isActionExecutionMessage","isResultMessage","isAgentStateMessage","isImageMessage","TextMessage","content","role","parentMessageId","ActionExecutionMessage","name","arguments","ResultMessage","actionExecutionId","actionName","result","encodeResult","error","errorObj","code","message","Error","undefined","JSON","stringify","decodeResult","parsed","parse","e","hasError","getError","AgentStateMessage","threadId","agentName","nodeName","runId","active","state","running","ImageMessage","format","bytes"]}
@@ -1,19 +0,0 @@
1
- import {
2
- ActionExecutionMessage,
3
- AgentStateMessage,
4
- ImageMessage,
5
- Message,
6
- ResultMessage,
7
- TextMessage
8
- } from "../../../chunk-SHBDMA63.mjs";
9
- import "../../../chunk-2OZAGFV3.mjs";
10
- import "../../../chunk-FHD4JECV.mjs";
11
- export {
12
- ActionExecutionMessage,
13
- AgentStateMessage,
14
- ImageMessage,
15
- Message,
16
- ResultMessage,
17
- TextMessage
18
- };
19
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,331 +0,0 @@
1
- import OpenAI from 'openai';
2
- import { b as CopilotServiceAdapter, C as CopilotRuntimeChatCompletionRequest, a as CopilotRuntimeChatCompletionResponse } from './langserve-9fc76ce5.js';
3
- import { BaseMessageChunk, AIMessage, AIMessageChunk, BaseMessage } from '@langchain/core/messages';
4
- import { DynamicStructuredTool } from '@langchain/core/tools';
5
- import { IterableReadableStream, IterableReadableStreamInterface } from '@langchain/core/utils/stream';
6
- import { Groq } from 'groq-sdk';
7
-
8
- /**
9
- * Copilot Runtime adapter for OpenAI.
10
- *
11
- * ## Example
12
- *
13
- * ```ts
14
- * import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";
15
- * import OpenAI from "openai";
16
- *
17
- * const copilotKit = new CopilotRuntime();
18
- *
19
- * const openai = new OpenAI({
20
- * organization: "<your-organization-id>", // optional
21
- * apiKey: "<your-api-key>",
22
- * });
23
- *
24
- * return new OpenAIAdapter({ openai });
25
- * ```
26
- *
27
- * ## Example with Azure OpenAI
28
- *
29
- * ```ts
30
- * import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";
31
- * import OpenAI from "openai";
32
- *
33
- * // The name of your Azure OpenAI Instance.
34
- * // https://learn.microsoft.com/en-us/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal#create-a-resource
35
- * const instance = "<your instance name>";
36
- *
37
- * // Corresponds to your Model deployment within your OpenAI resource, e.g. my-gpt35-16k-deployment
38
- * // Navigate to the Azure OpenAI Studio to deploy a model.
39
- * const model = "<your model>";
40
- *
41
- * const apiKey = process.env["AZURE_OPENAI_API_KEY"];
42
- * if (!apiKey) {
43
- * throw new Error("The AZURE_OPENAI_API_KEY environment variable is missing or empty.");
44
- * }
45
- *
46
- * const copilotKit = new CopilotRuntime();
47
- *
48
- * const openai = new OpenAI({
49
- * apiKey,
50
- * baseURL: `https://${instance}.openai.azure.com/openai/deployments/${model}`,
51
- * defaultQuery: { "api-version": "2024-04-01-preview" },
52
- * defaultHeaders: { "api-key": apiKey },
53
- * });
54
- *
55
- * return new OpenAIAdapter({ openai });
56
- * ```
57
- */
58
-
59
- interface OpenAIAdapterParams {
60
- /**
61
- * An optional OpenAI instance to use. If not provided, a new instance will be
62
- * created.
63
- */
64
- openai?: OpenAI;
65
- /**
66
- * The model to use.
67
- */
68
- model?: string;
69
- /**
70
- * Whether to disable parallel tool calls.
71
- * You can disable parallel tool calls to force the model to execute tool calls sequentially.
72
- * This is useful if you want to execute tool calls in a specific order so that the state changes
73
- * introduced by one tool call are visible to the next tool call. (i.e. new actions or readables)
74
- *
75
- * @default false
76
- */
77
- disableParallelToolCalls?: boolean;
78
- /**
79
- * Whether to keep the role in system messages as "System".
80
- * By default, it is converted to "developer", which is used by newer OpenAI models
81
- *
82
- * @default false
83
- */
84
- keepSystemRole?: boolean;
85
- }
86
- declare class OpenAIAdapter implements CopilotServiceAdapter {
87
- model: string;
88
- provider: string;
89
- private disableParallelToolCalls;
90
- private _openai;
91
- private keepSystemRole;
92
- get openai(): OpenAI;
93
- get name(): string;
94
- constructor(params?: OpenAIAdapterParams);
95
- process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
96
- }
97
-
98
- type LangChainBaseMessageChunkStream = IterableReadableStream<BaseMessageChunk>;
99
- type LangChainAIMessageChunkStream = IterableReadableStreamInterface<AIMessageChunk>;
100
- type LangChainReturnType = LangChainBaseMessageChunkStream | LangChainAIMessageChunkStream | BaseMessageChunk | string | AIMessage;
101
-
102
- /**
103
- * Copilot Runtime adapter for LangChain.
104
- *
105
- * ## Example
106
- *
107
- * ```ts
108
- * import { CopilotRuntime, LangChainAdapter } from "@copilotkit/runtime";
109
- * import { ChatOpenAI } from "@langchain/openai";
110
- *
111
- * const copilotKit = new CopilotRuntime();
112
- *
113
- * const model = new ChatOpenAI({
114
- * model: "gpt-4o",
115
- * apiKey: "<your-api-key>",
116
- * });
117
- *
118
- * return new LangChainAdapter({
119
- * chainFn: async ({ messages, tools }) => {
120
- * return model.bindTools(tools).stream(messages);
121
- * // or optionally enable strict mode
122
- * // return model.bindTools(tools, { strict: true }).stream(messages);
123
- * }
124
- * });
125
- * ```
126
- *
127
- * The asynchronous handler function (`chainFn`) can return any of the following:
128
- *
129
- * - A simple `string` response
130
- * - A LangChain stream (`IterableReadableStream`)
131
- * - A LangChain `BaseMessageChunk` object
132
- * - A LangChain `AIMessage` object
133
- */
134
-
135
- interface ChainFnParameters {
136
- model: string;
137
- messages: BaseMessage[];
138
- tools: DynamicStructuredTool[];
139
- threadId?: string;
140
- runId?: string;
141
- }
142
- interface LangChainAdapterOptions {
143
- /**
144
- * A function that uses the LangChain API to generate a response.
145
- */
146
- chainFn: (parameters: ChainFnParameters) => Promise<LangChainReturnType>;
147
- }
148
- declare class LangChainAdapter implements CopilotServiceAdapter {
149
- private options;
150
- /**
151
- * To use LangChain as a backend, provide a handler function to the adapter with your custom LangChain logic.
152
- */
153
- get name(): string;
154
- constructor(options: LangChainAdapterOptions);
155
- process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
156
- }
157
-
158
- interface GoogleGenerativeAIAdapterOptions {
159
- /**
160
- * A custom Google Generative AI model to use.
161
- */
162
- model?: string;
163
- /**
164
- * The API key to use.
165
- */
166
- apiKey?: string;
167
- }
168
- declare class GoogleGenerativeAIAdapter extends LangChainAdapter {
169
- provider: string;
170
- model: string;
171
- constructor(options?: GoogleGenerativeAIAdapterOptions);
172
- }
173
-
174
- /**
175
- * Copilot Runtime adapter for the OpenAI Assistant API.
176
- *
177
- * ## Example
178
- *
179
- * ```ts
180
- * import { CopilotRuntime, OpenAIAssistantAdapter } from "@copilotkit/runtime";
181
- * import OpenAI from "openai";
182
- *
183
- * const copilotKit = new CopilotRuntime();
184
- *
185
- * const openai = new OpenAI({
186
- * organization: "<your-organization-id>",
187
- * apiKey: "<your-api-key>",
188
- * });
189
- *
190
- * return new OpenAIAssistantAdapter({
191
- * openai,
192
- * assistantId: "<your-assistant-id>",
193
- * codeInterpreterEnabled: true,
194
- * fileSearchEnabled: true,
195
- * });
196
- * ```
197
- */
198
-
199
- interface OpenAIAssistantAdapterParams {
200
- /**
201
- * The ID of the assistant to use.
202
- */
203
- assistantId: string;
204
- /**
205
- * An optional OpenAI instance to use. If not provided, a new instance will be created.
206
- */
207
- openai?: OpenAI;
208
- /**
209
- * Whether to enable code interpretation.
210
- * @default true
211
- */
212
- codeInterpreterEnabled?: boolean;
213
- /**
214
- * Whether to enable file search.
215
- * @default true
216
- */
217
- fileSearchEnabled?: boolean;
218
- /**
219
- * Whether to disable parallel tool calls.
220
- * You can disable parallel tool calls to force the model to execute tool calls sequentially.
221
- * This is useful if you want to execute tool calls in a specific order so that the state changes
222
- * introduced by one tool call are visible to the next tool call. (i.e. new actions or readables)
223
- *
224
- * @default false
225
- */
226
- disableParallelToolCalls?: boolean;
227
- /**
228
- * Whether to keep the role in system messages as "System".
229
- * By default, it is converted to "developer", which is used by newer OpenAI models
230
- *
231
- * @default false
232
- */
233
- keepSystemRole?: boolean;
234
- }
235
- declare class OpenAIAssistantAdapter implements CopilotServiceAdapter {
236
- private openai;
237
- private codeInterpreterEnabled;
238
- private assistantId;
239
- private fileSearchEnabled;
240
- private disableParallelToolCalls;
241
- private keepSystemRole;
242
- get name(): string;
243
- constructor(params: OpenAIAssistantAdapterParams);
244
- process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
245
- private submitToolOutputs;
246
- private submitUserMessage;
247
- private streamResponse;
248
- }
249
-
250
- /**
251
- * CopilotKit Adapter for Unify
252
- *
253
- * <RequestExample>
254
- * ```jsx CopilotRuntime Example
255
- * const copilotKit = new CopilotRuntime();
256
- * return copilotKit.response(req, new UnifyAdapter());
257
- * ```
258
- * </RequestExample>
259
- *
260
- * You can easily set the model to use by passing it to the constructor.
261
- * ```jsx
262
- * const copilotKit = new CopilotRuntime();
263
- * return copilotKit.response(
264
- * req,
265
- * new UnifyAdapter({ model: "llama-3-8b-chat@fireworks-ai" }),
266
- * );
267
- * ```
268
- */
269
-
270
- interface UnifyAdapterParams {
271
- apiKey?: string;
272
- model: string;
273
- }
274
- declare class UnifyAdapter implements CopilotServiceAdapter {
275
- private apiKey;
276
- model: string;
277
- private start;
278
- provider: string;
279
- get name(): string;
280
- constructor(options?: UnifyAdapterParams);
281
- process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
282
- }
283
-
284
- /**
285
- * Copilot Runtime adapter for Groq.
286
- *
287
- * ## Example
288
- *
289
- * ```ts
290
- * import { CopilotRuntime, GroqAdapter } from "@copilotkit/runtime";
291
- * import { Groq } from "groq-sdk";
292
- *
293
- * const groq = new Groq({ apiKey: process.env["GROQ_API_KEY"] });
294
- *
295
- * const copilotKit = new CopilotRuntime();
296
- *
297
- * return new GroqAdapter({ groq, model: "<model-name>" });
298
- * ```
299
- */
300
-
301
- interface GroqAdapterParams {
302
- /**
303
- * An optional Groq instance to use.
304
- */
305
- groq?: Groq;
306
- /**
307
- * The model to use.
308
- */
309
- model?: string;
310
- /**
311
- * Whether to disable parallel tool calls.
312
- * You can disable parallel tool calls to force the model to execute tool calls sequentially.
313
- * This is useful if you want to execute tool calls in a specific order so that the state changes
314
- * introduced by one tool call are visible to the next tool call. (i.e. new actions or readables)
315
- *
316
- * @default false
317
- */
318
- disableParallelToolCalls?: boolean;
319
- }
320
- declare class GroqAdapter implements CopilotServiceAdapter {
321
- model: string;
322
- provider: string;
323
- private disableParallelToolCalls;
324
- private _groq;
325
- get groq(): Groq;
326
- get name(): string;
327
- constructor(params?: GroqAdapterParams);
328
- process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
329
- }
330
-
331
- export { GoogleGenerativeAIAdapter as G, LangChainAdapter as L, OpenAIAdapterParams as O, UnifyAdapterParams as U, OpenAIAdapter as a, OpenAIAssistantAdapterParams as b, OpenAIAssistantAdapter as c, UnifyAdapter as d, GroqAdapterParams as e, GroqAdapter as f };