@vertesia/client 0.80.0 → 0.80.1

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 (250) hide show
  1. package/package.json +3 -3
  2. package/src/client.test.ts +3 -0
  3. package/src/client.ts +6 -1
  4. package/src/store/WorkersApi.ts +17 -0
  5. package/src/store/client.ts +2 -2
  6. package/lib/cjs/AccountApi.js +0 -85
  7. package/lib/cjs/AccountApi.js.map +0 -1
  8. package/lib/cjs/AccountsApi.js +0 -16
  9. package/lib/cjs/AccountsApi.js.map +0 -1
  10. package/lib/cjs/AnalyticsApi.js +0 -13
  11. package/lib/cjs/AnalyticsApi.js.map +0 -1
  12. package/lib/cjs/ApiKeysApi.js +0 -63
  13. package/lib/cjs/ApiKeysApi.js.map +0 -1
  14. package/lib/cjs/AppsApi.js +0 -119
  15. package/lib/cjs/AppsApi.js.map +0 -1
  16. package/lib/cjs/CommandsApi.js +0 -19
  17. package/lib/cjs/CommandsApi.js.map +0 -1
  18. package/lib/cjs/EnvironmentsApi.js +0 -58
  19. package/lib/cjs/EnvironmentsApi.js.map +0 -1
  20. package/lib/cjs/GroupsApi.js +0 -78
  21. package/lib/cjs/GroupsApi.js.map +0 -1
  22. package/lib/cjs/IamApi.js +0 -53
  23. package/lib/cjs/IamApi.js.map +0 -1
  24. package/lib/cjs/InteractionBase.js +0 -44
  25. package/lib/cjs/InteractionBase.js.map +0 -1
  26. package/lib/cjs/InteractionCatalogApi.js +0 -64
  27. package/lib/cjs/InteractionCatalogApi.js.map +0 -1
  28. package/lib/cjs/InteractionOutput.js +0 -300
  29. package/lib/cjs/InteractionOutput.js.map +0 -1
  30. package/lib/cjs/InteractionResult.example.js +0 -57
  31. package/lib/cjs/InteractionResult.example.js.map +0 -1
  32. package/lib/cjs/InteractionsApi.js +0 -243
  33. package/lib/cjs/InteractionsApi.js.map +0 -1
  34. package/lib/cjs/ProjectsApi.js +0 -53
  35. package/lib/cjs/ProjectsApi.js.map +0 -1
  36. package/lib/cjs/PromptsApi.js +0 -133
  37. package/lib/cjs/PromptsApi.js.map +0 -1
  38. package/lib/cjs/RefsApi.js +0 -14
  39. package/lib/cjs/RefsApi.js.map +0 -1
  40. package/lib/cjs/RunsApi.js +0 -113
  41. package/lib/cjs/RunsApi.js.map +0 -1
  42. package/lib/cjs/SkillsApi.js +0 -39
  43. package/lib/cjs/SkillsApi.js.map +0 -1
  44. package/lib/cjs/StreamSource.js +0 -17
  45. package/lib/cjs/StreamSource.js.map +0 -1
  46. package/lib/cjs/TrainingApi.js +0 -54
  47. package/lib/cjs/TrainingApi.js.map +0 -1
  48. package/lib/cjs/UsersApi.js +0 -13
  49. package/lib/cjs/UsersApi.js.map +0 -1
  50. package/lib/cjs/client.js +0 -345
  51. package/lib/cjs/client.js.map +0 -1
  52. package/lib/cjs/execute.js +0 -158
  53. package/lib/cjs/execute.js.map +0 -1
  54. package/lib/cjs/index.js +0 -22
  55. package/lib/cjs/index.js.map +0 -1
  56. package/lib/cjs/nodejs/NodeStreamSource.js +0 -45
  57. package/lib/cjs/nodejs/NodeStreamSource.js.map +0 -1
  58. package/lib/cjs/nodejs/index.js +0 -18
  59. package/lib/cjs/nodejs/index.js.map +0 -1
  60. package/lib/cjs/package.json +0 -3
  61. package/lib/cjs/store/AgentsApi.js +0 -16
  62. package/lib/cjs/store/AgentsApi.js.map +0 -1
  63. package/lib/cjs/store/AnalyzeDocApi.js +0 -56
  64. package/lib/cjs/store/AnalyzeDocApi.js.map +0 -1
  65. package/lib/cjs/store/CollectionsApi.js +0 -131
  66. package/lib/cjs/store/CollectionsApi.js.map +0 -1
  67. package/lib/cjs/store/CommandsApi.js +0 -17
  68. package/lib/cjs/store/CommandsApi.js.map +0 -1
  69. package/lib/cjs/store/EmbeddingsApi.js +0 -29
  70. package/lib/cjs/store/EmbeddingsApi.js.map +0 -1
  71. package/lib/cjs/store/FilesApi.js +0 -225
  72. package/lib/cjs/store/FilesApi.js.map +0 -1
  73. package/lib/cjs/store/ObjectsApi.js +0 -283
  74. package/lib/cjs/store/ObjectsApi.js.map +0 -1
  75. package/lib/cjs/store/TypesApi.js +0 -57
  76. package/lib/cjs/store/TypesApi.js.map +0 -1
  77. package/lib/cjs/store/WorkflowsApi.js +0 -414
  78. package/lib/cjs/store/WorkflowsApi.js.map +0 -1
  79. package/lib/cjs/store/client.js +0 -71
  80. package/lib/cjs/store/client.js.map +0 -1
  81. package/lib/cjs/store/errors.js +0 -11
  82. package/lib/cjs/store/errors.js.map +0 -1
  83. package/lib/cjs/store/index.js +0 -23
  84. package/lib/cjs/store/index.js.map +0 -1
  85. package/lib/cjs/store/version.js +0 -6
  86. package/lib/cjs/store/version.js.map +0 -1
  87. package/lib/esm/AccountApi.js +0 -82
  88. package/lib/esm/AccountApi.js.map +0 -1
  89. package/lib/esm/AccountsApi.js +0 -13
  90. package/lib/esm/AccountsApi.js.map +0 -1
  91. package/lib/esm/AnalyticsApi.js +0 -10
  92. package/lib/esm/AnalyticsApi.js.map +0 -1
  93. package/lib/esm/ApiKeysApi.js +0 -59
  94. package/lib/esm/ApiKeysApi.js.map +0 -1
  95. package/lib/esm/AppsApi.js +0 -116
  96. package/lib/esm/AppsApi.js.map +0 -1
  97. package/lib/esm/CommandsApi.js +0 -16
  98. package/lib/esm/CommandsApi.js.map +0 -1
  99. package/lib/esm/EnvironmentsApi.js +0 -55
  100. package/lib/esm/EnvironmentsApi.js.map +0 -1
  101. package/lib/esm/GroupsApi.js +0 -74
  102. package/lib/esm/GroupsApi.js.map +0 -1
  103. package/lib/esm/IamApi.js +0 -47
  104. package/lib/esm/IamApi.js.map +0 -1
  105. package/lib/esm/InteractionBase.js +0 -40
  106. package/lib/esm/InteractionBase.js.map +0 -1
  107. package/lib/esm/InteractionCatalogApi.js +0 -60
  108. package/lib/esm/InteractionCatalogApi.js.map +0 -1
  109. package/lib/esm/InteractionOutput.js +0 -293
  110. package/lib/esm/InteractionOutput.js.map +0 -1
  111. package/lib/esm/InteractionResult.example.js +0 -55
  112. package/lib/esm/InteractionResult.example.js.map +0 -1
  113. package/lib/esm/InteractionsApi.js +0 -240
  114. package/lib/esm/InteractionsApi.js.map +0 -1
  115. package/lib/esm/ProjectsApi.js +0 -50
  116. package/lib/esm/ProjectsApi.js.map +0 -1
  117. package/lib/esm/PromptsApi.js +0 -130
  118. package/lib/esm/PromptsApi.js.map +0 -1
  119. package/lib/esm/RefsApi.js +0 -10
  120. package/lib/esm/RefsApi.js.map +0 -1
  121. package/lib/esm/RunsApi.js +0 -109
  122. package/lib/esm/RunsApi.js.map +0 -1
  123. package/lib/esm/SkillsApi.js +0 -36
  124. package/lib/esm/SkillsApi.js.map +0 -1
  125. package/lib/esm/StreamSource.js +0 -13
  126. package/lib/esm/StreamSource.js.map +0 -1
  127. package/lib/esm/TrainingApi.js +0 -51
  128. package/lib/esm/TrainingApi.js.map +0 -1
  129. package/lib/esm/UsersApi.js +0 -10
  130. package/lib/esm/UsersApi.js.map +0 -1
  131. package/lib/esm/client.js +0 -336
  132. package/lib/esm/client.js.map +0 -1
  133. package/lib/esm/execute.js +0 -118
  134. package/lib/esm/execute.js.map +0 -1
  135. package/lib/esm/index.js +0 -6
  136. package/lib/esm/index.js.map +0 -1
  137. package/lib/esm/nodejs/NodeStreamSource.js +0 -41
  138. package/lib/esm/nodejs/NodeStreamSource.js.map +0 -1
  139. package/lib/esm/nodejs/index.js +0 -2
  140. package/lib/esm/nodejs/index.js.map +0 -1
  141. package/lib/esm/store/AgentsApi.js +0 -12
  142. package/lib/esm/store/AgentsApi.js.map +0 -1
  143. package/lib/esm/store/AnalyzeDocApi.js +0 -52
  144. package/lib/esm/store/AnalyzeDocApi.js.map +0 -1
  145. package/lib/esm/store/CollectionsApi.js +0 -127
  146. package/lib/esm/store/CollectionsApi.js.map +0 -1
  147. package/lib/esm/store/CommandsApi.js +0 -13
  148. package/lib/esm/store/CommandsApi.js.map +0 -1
  149. package/lib/esm/store/EmbeddingsApi.js +0 -25
  150. package/lib/esm/store/EmbeddingsApi.js.map +0 -1
  151. package/lib/esm/store/FilesApi.js +0 -219
  152. package/lib/esm/store/FilesApi.js.map +0 -1
  153. package/lib/esm/store/ObjectsApi.js +0 -279
  154. package/lib/esm/store/ObjectsApi.js.map +0 -1
  155. package/lib/esm/store/TypesApi.js +0 -53
  156. package/lib/esm/store/TypesApi.js.map +0 -1
  157. package/lib/esm/store/WorkflowsApi.js +0 -408
  158. package/lib/esm/store/WorkflowsApi.js.map +0 -1
  159. package/lib/esm/store/client.js +0 -67
  160. package/lib/esm/store/client.js.map +0 -1
  161. package/lib/esm/store/errors.js +0 -7
  162. package/lib/esm/store/errors.js.map +0 -1
  163. package/lib/esm/store/index.js +0 -7
  164. package/lib/esm/store/index.js.map +0 -1
  165. package/lib/esm/store/version.js +0 -3
  166. package/lib/esm/store/version.js.map +0 -1
  167. package/lib/tsconfig.tsbuildinfo +0 -1
  168. package/lib/types/AccountApi.d.ts +0 -59
  169. package/lib/types/AccountApi.d.ts.map +0 -1
  170. package/lib/types/AccountsApi.d.ts +0 -7
  171. package/lib/types/AccountsApi.d.ts.map +0 -1
  172. package/lib/types/AnalyticsApi.d.ts +0 -6
  173. package/lib/types/AnalyticsApi.d.ts.map +0 -1
  174. package/lib/types/ApiKeysApi.d.ts +0 -42
  175. package/lib/types/ApiKeysApi.d.ts.map +0 -1
  176. package/lib/types/AppsApi.d.ts +0 -65
  177. package/lib/types/AppsApi.d.ts.map +0 -1
  178. package/lib/types/CommandsApi.d.ts +0 -10
  179. package/lib/types/CommandsApi.d.ts.map +0 -1
  180. package/lib/types/EnvironmentsApi.d.ts +0 -30
  181. package/lib/types/EnvironmentsApi.d.ts.map +0 -1
  182. package/lib/types/GroupsApi.d.ts +0 -65
  183. package/lib/types/GroupsApi.d.ts.map +0 -1
  184. package/lib/types/IamApi.d.ts +0 -41
  185. package/lib/types/IamApi.d.ts.map +0 -1
  186. package/lib/types/InteractionBase.d.ts +0 -22
  187. package/lib/types/InteractionBase.d.ts.map +0 -1
  188. package/lib/types/InteractionCatalogApi.d.ts +0 -36
  189. package/lib/types/InteractionCatalogApi.d.ts.map +0 -1
  190. package/lib/types/InteractionOutput.d.ts +0 -174
  191. package/lib/types/InteractionOutput.d.ts.map +0 -1
  192. package/lib/types/InteractionResult.example.d.ts +0 -6
  193. package/lib/types/InteractionResult.example.d.ts.map +0 -1
  194. package/lib/types/InteractionsApi.d.ts +0 -165
  195. package/lib/types/InteractionsApi.d.ts.map +0 -1
  196. package/lib/types/ProjectsApi.d.ts +0 -18
  197. package/lib/types/ProjectsApi.d.ts.map +0 -1
  198. package/lib/types/PromptsApi.d.ts +0 -106
  199. package/lib/types/PromptsApi.d.ts.map +0 -1
  200. package/lib/types/RefsApi.d.ts +0 -6
  201. package/lib/types/RefsApi.d.ts.map +0 -1
  202. package/lib/types/RunsApi.d.ts +0 -79
  203. package/lib/types/RunsApi.d.ts.map +0 -1
  204. package/lib/types/SkillsApi.d.ts +0 -26
  205. package/lib/types/SkillsApi.d.ts.map +0 -1
  206. package/lib/types/StreamSource.d.ts +0 -7
  207. package/lib/types/StreamSource.d.ts.map +0 -1
  208. package/lib/types/TrainingApi.d.ts +0 -27
  209. package/lib/types/TrainingApi.d.ts.map +0 -1
  210. package/lib/types/UsersApi.d.ts +0 -6
  211. package/lib/types/UsersApi.d.ts.map +0 -1
  212. package/lib/types/client.d.ts +0 -125
  213. package/lib/types/client.d.ts.map +0 -1
  214. package/lib/types/execute.d.ts +0 -37
  215. package/lib/types/execute.d.ts.map +0 -1
  216. package/lib/types/index.d.ts +0 -10
  217. package/lib/types/index.d.ts.map +0 -1
  218. package/lib/types/nodejs/NodeStreamSource.d.ts +0 -9
  219. package/lib/types/nodejs/NodeStreamSource.d.ts.map +0 -1
  220. package/lib/types/nodejs/index.d.ts +0 -1
  221. package/lib/types/nodejs/index.d.ts.map +0 -1
  222. package/lib/types/store/AgentsApi.d.ts +0 -6
  223. package/lib/types/store/AgentsApi.d.ts.map +0 -1
  224. package/lib/types/store/AnalyzeDocApi.d.ts +0 -17
  225. package/lib/types/store/AnalyzeDocApi.d.ts.map +0 -1
  226. package/lib/types/store/CollectionsApi.d.ts +0 -82
  227. package/lib/types/store/CollectionsApi.d.ts.map +0 -1
  228. package/lib/types/store/CommandsApi.d.ts +0 -10
  229. package/lib/types/store/CommandsApi.d.ts.map +0 -1
  230. package/lib/types/store/EmbeddingsApi.d.ts +0 -12
  231. package/lib/types/store/EmbeddingsApi.d.ts.map +0 -1
  232. package/lib/types/store/FilesApi.d.ts +0 -103
  233. package/lib/types/store/FilesApi.d.ts.map +0 -1
  234. package/lib/types/store/ObjectsApi.d.ts +0 -117
  235. package/lib/types/store/ObjectsApi.d.ts.map +0 -1
  236. package/lib/types/store/TypesApi.d.ts +0 -23
  237. package/lib/types/store/TypesApi.d.ts.map +0 -1
  238. package/lib/types/store/WorkflowsApi.d.ts +0 -62
  239. package/lib/types/store/WorkflowsApi.d.ts.map +0 -1
  240. package/lib/types/store/client.d.ts +0 -35
  241. package/lib/types/store/client.d.ts.map +0 -1
  242. package/lib/types/store/errors.d.ts +0 -4
  243. package/lib/types/store/errors.d.ts.map +0 -1
  244. package/lib/types/store/index.d.ts +0 -6
  245. package/lib/types/store/index.d.ts.map +0 -1
  246. package/lib/types/store/version.d.ts +0 -2
  247. package/lib/types/store/version.d.ts.map +0 -1
  248. package/lib/vertesia-client.js +0 -2
  249. package/lib/vertesia-client.js.map +0 -1
  250. package/src/store/AgentsApi.ts +0 -17
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodeStreamSource = void 0;
4
- const web_1 = require("node:stream/web");
5
- const StreamSource_js_1 = require("../StreamSource.js");
6
- /**
7
- * A stream source that wraps a Node.js Readable stream.
8
- * This class is only works in Node.js environments.
9
- */
10
- class NodeStreamSource extends StreamSource_js_1.StreamSource {
11
- constructor(stream, name, type, id) {
12
- super(readableToWebStream(stream), name, type, id);
13
- }
14
- }
15
- exports.NodeStreamSource = NodeStreamSource;
16
- function readableToWebStream(stream) {
17
- if (web_1.ReadableStream.from) {
18
- return web_1.ReadableStream.from(stream);
19
- }
20
- else {
21
- return readableToWebStream_BUN(stream);
22
- }
23
- }
24
- /**
25
- * Bun implementation since bun is not yet supporting NodeReadableStream.from
26
- * @returns
27
- */
28
- function readableToWebStream_BUN(stream) {
29
- const it = stream[Symbol.asyncIterator]();
30
- return new ReadableStream({
31
- async pull(controller) {
32
- const { value, done } = await it.next();
33
- if (done) {
34
- controller.close();
35
- }
36
- else {
37
- controller.enqueue(value);
38
- }
39
- },
40
- cancel() {
41
- it.return?.();
42
- }
43
- });
44
- }
45
- //# sourceMappingURL=NodeStreamSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodeStreamSource.js","sourceRoot":"","sources":["../../../src/nodejs/NodeStreamSource.ts"],"names":[],"mappings":";;;AACA,yCAAuE;AACvE,wDAAkD;AAGlD;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,8BAAY;IAC9C,YAAY,MAAgB,EAAE,IAAY,EAAE,IAAa,EAAE,EAAW;QAClE,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;CACJ;AAJD,4CAIC;AAED,SAAS,mBAAmB,CAAsB,MAAgB;IAC9D,IAAI,oBAAkB,CAAC,IAAI,EAAE,CAAC;QAC1B,OAAO,oBAAkB,CAAC,IAAI,CAAC,MAAM,CAAsB,CAAC;IAChE,CAAC;SAAM,CAAC;QACJ,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAsB,MAAgB;IAClE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;IAC1C,OAAO,IAAI,cAAc,CAAI;QACzB,KAAK,CAAC,IAAI,CAAC,UAAU;YACjB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;YACxC,IAAI,IAAI,EAAE,CAAC;gBACP,UAAU,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACJ,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC;QACD,MAAM;YACF,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB,CAAC;KACJ,CAAC,CAAC;AACP,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./NodeStreamSource.js"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nodejs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgentsApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- class AgentsApi extends api_fetch_client_1.ApiTopic {
6
- constructor(parent) {
7
- super(parent, "/api/v1/agents");
8
- }
9
- async deploy(payload) {
10
- return this.post('/', {
11
- payload
12
- });
13
- }
14
- }
15
- exports.AgentsApi = AgentsApi;
16
- //# sourceMappingURL=AgentsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentsApi.js","sourceRoot":"","sources":["../../../src/store/AgentsApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAIlE,MAAa,SAAU,SAAQ,2BAAQ;IAEnC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAqC;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;CAEJ;AAZD,8BAYC"}
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalyzeDocApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- class AnalyzeDocApi extends api_fetch_client_1.ApiTopic {
6
- objectId;
7
- constructor(parent, objectId) {
8
- super(parent, `/${objectId}/analyze`);
9
- this.objectId = objectId;
10
- }
11
- async start(payload) {
12
- return this.post("/", { payload });
13
- }
14
- async getStatus() {
15
- return this.get("/status");
16
- }
17
- async getResults() {
18
- return this.get("/results");
19
- }
20
- async adaptTables(payload) {
21
- return this.post("/adapt_tables", { payload });
22
- }
23
- async getAdaptedTables(runId, query) {
24
- const path = runId ? `/adapt_tables/${runId}` : "/adapt_tables";
25
- // Build query parameters
26
- const queryParams = {};
27
- if (query?.format)
28
- queryParams.format = query.format;
29
- if (query?.raw !== undefined)
30
- queryParams.raw = query.raw;
31
- // If format is CSV, set response type to text to avoid automatic JSON parsing
32
- const options = { query: queryParams };
33
- if (query?.format === 'csv') {
34
- options.responseType = 'text';
35
- }
36
- return this.get(path, options);
37
- }
38
- async getXml() {
39
- return this.get("/xml");
40
- }
41
- async getTables(format) {
42
- const options = {};
43
- if (format) {
44
- options.query = { format: format };
45
- }
46
- return this.get("/tables", options);
47
- }
48
- async getImages() {
49
- return this.get("/images");
50
- }
51
- async getAnnotated() {
52
- return this.get("/annotated");
53
- }
54
- }
55
- exports.AnalyzeDocApi = AnalyzeDocApi;
56
- //# sourceMappingURL=AnalyzeDocApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnalyzeDocApi.js","sourceRoot":"","sources":["../../../src/store/AnalyzeDocApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAGlE,MAAa,aAAc,SAAQ,2BAAQ;IACA;IAAvC,YAAY,MAAkB,EAAS,QAAgB;QACnD,KAAK,CAAC,MAAM,EAAE,IAAI,QAAQ,UAAU,CAAC,CAAC;QADH,aAAQ,GAAR,QAAQ,CAAQ;IAEvD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAA6B;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA2B;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,KAAc,EAAE,KAAoC;QACvE,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,iBAAiB,KAAK,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;QAEhE,yBAAyB;QACzB,MAAM,WAAW,GAAQ,EAAE,CAAC;QAC5B,IAAI,KAAK,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QACrD,IAAI,KAAK,EAAE,GAAG,KAAK,SAAS;YAAE,WAAW,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;QAE1D,8EAA8E;QAC9E,MAAM,OAAO,GAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAC5C,IAAI,KAAK,EAAE,MAAM,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC;QAClC,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAA2B;QACvC,MAAM,OAAO,GAAQ,EAAE,CAAC;QACxB,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,KAAK,GAAG,EAAC,MAAM,EAAE,MAAM,EAAC,CAAA;QACpC,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,YAAY;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;CACJ;AAzDD,sCAyDC"}
@@ -1,131 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CollectionsApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- class CollectionsApi extends api_fetch_client_1.ApiTopic {
6
- constructor(parent) {
7
- super(parent, "/api/v1/collections");
8
- }
9
- /**
10
- * List collections
11
- * @param payload: CollectionSearchPayload
12
- * @returns CollectionItem[] list of collections
13
- **/
14
- search(payload) {
15
- return this.post("/search", { payload });
16
- }
17
- /**
18
- * Compute facets for List collections
19
- * @param query: ComputeCollectionFacetPayload
20
- * @returns ComputeFacetsResponse list of facets
21
- **/
22
- computeListFacets(query) {
23
- return this.post("/facets", {
24
- payload: query
25
- });
26
- }
27
- /**
28
- * Get the collection data without members
29
- * @param collectionId
30
- * @returns
31
- */
32
- retrieve(collectionId) {
33
- return this.get(`/${collectionId}`);
34
- }
35
- create(payload) {
36
- return this.post(`/`, {
37
- payload
38
- });
39
- }
40
- update(collectionId, payload) {
41
- return this.put(`/${collectionId}`, {
42
- payload
43
- });
44
- }
45
- addMembers(collectionId, members) {
46
- return this.post(`/${collectionId}/members`, {
47
- payload: {
48
- action: 'add',
49
- members
50
- }
51
- });
52
- }
53
- listMembers(collectionId, payload) {
54
- return this.get(`/${collectionId}/members`, {
55
- query: {
56
- ...payload
57
- }
58
- });
59
- }
60
- computeFacets(collectionId, query) {
61
- return this.post(`/${collectionId}/facets`, {
62
- payload: query
63
- });
64
- }
65
- searchMembers(collectionId, payload) {
66
- return this.post(`/${collectionId}/search`, { payload });
67
- }
68
- deleteMembers(collectionId, members) {
69
- return this.post(`/${collectionId}/members`, {
70
- payload: {
71
- action: 'delete',
72
- members
73
- }
74
- });
75
- }
76
- addChildren(collectionId, children) {
77
- return this.post(`/${collectionId}/children`, {
78
- payload: {
79
- action: 'add',
80
- children
81
- }
82
- });
83
- }
84
- deleteChildren(collectionId, children) {
85
- return this.post(`/${collectionId}/children`, {
86
- payload: {
87
- action: 'delete',
88
- children
89
- }
90
- });
91
- }
92
- searchChildren(collectionId, query = {}) {
93
- return this.post(`/${collectionId}/children/search`, {
94
- payload: query
95
- });
96
- }
97
- delete(id) {
98
- return this.del(`/${id}`);
99
- }
100
- /**
101
- * Update collection permissions and propagate to member objects
102
- * @param collectionId - The collection ID
103
- * @param permissions - Map of permission types to principal arrays
104
- * @returns Object with collection id, updated security, and number of objects updated
105
- */
106
- updatePermissions(collectionId, permissions) {
107
- return this.put(`/${collectionId}/permissions`, {
108
- payload: permissions
109
- });
110
- }
111
- /**
112
- * Manually trigger permission propagation from collection to member objects
113
- * Useful for debugging and fixing permission issues
114
- * @param collectionId - The collection ID
115
- * @returns Object with collection id, message, and number of objects updated
116
- */
117
- propagatePermissions(collectionId) {
118
- return this.post(`/${collectionId}/propagate-permissions`);
119
- }
120
- /**
121
- * Manually trigger shared properties propagation from collection to member objects
122
- * Useful for debugging and fixing shared properties issues
123
- * @param collectionId - The collection ID
124
- * @returns Object with collection id, message, and number of objects updated
125
- */
126
- propagateSharedProperties(collectionId) {
127
- return this.post(`/${collectionId}/propagate-shared-props`);
128
- }
129
- }
130
- exports.CollectionsApi = CollectionsApi;
131
- //# sourceMappingURL=CollectionsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollectionsApi.js","sourceRoot":"","sources":["../../../src/store/CollectionsApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAKlE,MAAa,cAAe,SAAQ,2BAAQ;IAExC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAqC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,KAAoC;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACxB,OAAO,EAAE,KAAK;SACjB,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,YAAoB;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,OAAgC;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,YAAoB,EAAE,OAAyC;QAClE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,EAA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J,CAAC,CAAC;IACP,CAAC;IAED,cAAc,CAAC,YAAoB,EAAE,QAAsC,EAAE;QACzE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,YAAY,kBAAkB,EAAE;YACjD,OAAO,EAAE,KAAK;SACjB,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,iBAAiB,CAAC,YAAoB,EAAE,WAAqC;QAIzE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,cAAc,EAAE;YAC5C,OAAO,EAAE,WAAW;SACvB,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACH,oBAAoB,CAAC,YAAoB;QAKrC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,YAAY,wBAAwB,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;OAKG;IACH,yBAAyB,CAAC,YAAoB;QAK1C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,YAAY,yBAAyB,CAAC,CAAC;IAChE,CAAC;CAGJ;AAhKD,wCAgKC"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandsApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- const EmbeddingsApi_js_1 = require("./EmbeddingsApi.js");
6
- /**
7
- * @deprecated use EmbeddingsApi instead
8
- * @see EmbeddingsApi
9
- */
10
- class CommandsApi extends api_fetch_client_1.ApiTopic {
11
- constructor(parent) {
12
- super(parent, "/api/v1/commands");
13
- }
14
- embeddings = new EmbeddingsApi_js_1.EmbeddingsApi(this, "/embeddings");
15
- }
16
- exports.CommandsApi = CommandsApi;
17
- //# sourceMappingURL=CommandsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandsApi.js","sourceRoot":"","sources":["../../../src/store/CommandsApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAClE,yDAAmD;AAEnD;;;GAGG;AACH,MAAa,WAAY,SAAQ,2BAAQ;IAErC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,UAAU,GAAG,IAAI,gCAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;CACvD;AAPD,kCAOC"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmbeddingsApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- /**
6
- * @since 0.52.0
7
- */
8
- class EmbeddingsApi extends api_fetch_client_1.ApiTopic {
9
- constructor(parent, basePath = "/api/v1/embeddings") {
10
- super(parent, basePath);
11
- }
12
- async status(type) {
13
- return this.get(type + "/status");
14
- }
15
- async activate(type, config) {
16
- if (!config.environment) {
17
- throw new Error("Invalid configuration: select environment");
18
- }
19
- return this.post(type + "/enable", { payload: config });
20
- }
21
- async disable(type) {
22
- return this.post(type + "/disable");
23
- }
24
- async recalculate(type) {
25
- return this.post(type + "/recalculate");
26
- }
27
- }
28
- exports.EmbeddingsApi = EmbeddingsApi;
29
- //# sourceMappingURL=EmbeddingsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmbeddingsApi.js","sourceRoot":"","sources":["../../../src/store/EmbeddingsApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAQlE;;GAEG;AACH,MAAa,aAAc,SAAQ,2BAAQ;IAEvC,YAAY,MAAkB,EAAE,WAAmB,oBAAoB;QACnE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAA6B;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,IAA6B,EAAE,MAA+C;QAEzF,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAA6B;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,IAA6B;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC,CAAC;IAC5C,CAAC;CAEJ;AA3BD,sCA2BC"}
@@ -1,225 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FilesApi = exports.ARTIFACTS_PREFIX = exports.MEMORIES_PREFIX = void 0;
4
- exports.getMemoryFilePath = getMemoryFilePath;
5
- exports.getAgentArtifactPath = getAgentArtifactPath;
6
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
7
- const StreamSource_js_1 = require("../StreamSource.js");
8
- exports.MEMORIES_PREFIX = "memories";
9
- exports.ARTIFACTS_PREFIX = "agents";
10
- function getMemoryFilePath(name) {
11
- const nameWithExt = name.endsWith(".tar.gz") ? name : name + ".tar.gz";
12
- return `${exports.MEMORIES_PREFIX}/${nameWithExt}`;
13
- }
14
- /**
15
- * Build the storage path for an agent artifact
16
- * @param runId - The workflow run ID
17
- * @param name - The artifact filename
18
- */
19
- function getAgentArtifactPath(runId, name) {
20
- return `${exports.ARTIFACTS_PREFIX}/${runId}/${name}`;
21
- }
22
- class FilesApi extends api_fetch_client_1.ApiTopic {
23
- constructor(parent) {
24
- super(parent, "/api/v1/files");
25
- }
26
- async deleteFile(path, prefix) {
27
- const res = await this.delete(`/${path}`, { query: { prefix } });
28
- return res.count;
29
- }
30
- /**
31
- * get the metadata of a blob given its URI. Supported URI are:
32
- * starting with s3:// and gs://.
33
- * For s3 blobs use #region to specify the region. Ex: s3://bucket/key#us-west-2
34
- * @param uri
35
- * @returns
36
- */
37
- getMetadata(uri) {
38
- return this.get("/metadata", {
39
- query: {
40
- file: uri,
41
- },
42
- });
43
- }
44
- /**
45
- * Set custom metadata on a file
46
- * @param file - The file path or URI
47
- * @param metadata - Custom metadata key-value pairs
48
- * @returns Success status
49
- */
50
- setFileMetadata(file, metadata) {
51
- const payload = { file, metadata };
52
- return this.put("/metadata", { payload });
53
- }
54
- /**
55
- * Get or create a bucket for the project. If the bucket already exists, it does nothing.
56
- * The bucket URI is returned.
57
- * @returns
58
- */
59
- getOrCreateBucket() {
60
- return this.post("/bucket");
61
- }
62
- getUploadUrl(payload) {
63
- return this.post("/upload-url", {
64
- payload,
65
- });
66
- }
67
- // Strictly typed: provide either simple args or a full payload via a separate method
68
- getDownloadUrl(file, name, disposition) {
69
- const payload = { file, name, disposition };
70
- return this.post("/download-url", { payload });
71
- }
72
- getDownloadUrlWithOptions(payload) {
73
- return this.post("/download-url", { payload });
74
- }
75
- /**
76
- * Upload content to a file and return the full path (including bucket name) of the uploaded file
77
- * @param source
78
- * @returns
79
- */
80
- async uploadFile(source) {
81
- const isStream = source instanceof StreamSource_js_1.StreamSource;
82
- const { url, id, path } = await this.getUploadUrl(source);
83
- await fetch(url, {
84
- method: "PUT",
85
- body: isStream ? source.stream : source,
86
- //@ts-ignore: duplex is not in the types. See https://github.com/node-fetch/node-fetch/issues/1769
87
- duplex: isStream ? "half" : undefined,
88
- headers: {
89
- "Content-Type": source.type || "application/gzip",
90
- },
91
- })
92
- .then((res) => {
93
- if (res.ok) {
94
- return res;
95
- }
96
- else {
97
- console.log(res);
98
- throw new Error(`Failed to upload file: ${res.statusText}`);
99
- }
100
- })
101
- .catch((err) => {
102
- console.error("Failed to upload file", { err, url, id, path });
103
- throw err;
104
- });
105
- return id;
106
- }
107
- /**
108
- *
109
- * @param location can be a relative path in the project, a reference to a cloud storage, or a accessible HTTPS URL (typically signed URL)
110
- * @returns ReadableStream
111
- */
112
- async downloadFile(location) {
113
- //if start with HTTPS, no download url needed - assume it's signed already
114
- const needSign = !location.startsWith("https:");
115
- const { url } = needSign
116
- ? await this.getDownloadUrl(location)
117
- : { url: location };
118
- const res = await fetch(url, {
119
- method: "GET",
120
- })
121
- .then((res) => {
122
- if (res.ok) {
123
- return res;
124
- }
125
- else if (res.status === 404) {
126
- throw new Error(`File at ${url} not found`); //TODO: type fetch error better with a fetch error class
127
- }
128
- else if (res.status === 403) {
129
- throw new Error(`File at ${url} is forbidden`);
130
- }
131
- else {
132
- console.log(res);
133
- throw new Error(`Failed to download file ${location}: ${res.statusText}`);
134
- }
135
- })
136
- .catch((err) => {
137
- console.error(`Failed to download file ${location}.`, err);
138
- throw err;
139
- });
140
- if (!res.body) {
141
- throw new Error(`No body in response while downloading file ${location}`);
142
- }
143
- return res.body;
144
- }
145
- async uploadMemoryPack(source) {
146
- const fileId = getMemoryFilePath(source.name);
147
- const nameWithExt = source.name.endsWith(".tar.gz")
148
- ? source.name
149
- : source.name + ".tar.gz";
150
- if (source instanceof File) {
151
- let file = source;
152
- return this.uploadFile(new StreamSource_js_1.StreamSource(file.stream(), nameWithExt, file.type, fileId));
153
- }
154
- else {
155
- return this.uploadFile(new StreamSource_js_1.StreamSource(source.stream, nameWithExt, source.type, fileId));
156
- }
157
- }
158
- async downloadMemoryPack(name, gunzip = false) {
159
- let stream = await this.downloadFile(getMemoryFilePath(name));
160
- if (gunzip) {
161
- const ds = new DecompressionStream("gzip");
162
- stream = stream.pipeThrough(ds);
163
- }
164
- return stream;
165
- }
166
- // ==================== Agent Artifact Methods ====================
167
- /**
168
- * List files by prefix
169
- * @param prefix - Path prefix to filter files
170
- * @returns Array of file paths matching the prefix
171
- */
172
- listByPrefix(prefix) {
173
- return this.get("/list", { query: { prefix } });
174
- }
175
- /**
176
- * Upload an artifact for an agent run
177
- * @param runId - The workflow run ID
178
- * @param name - Artifact name (e.g., "output.json")
179
- * @param source - File content source
180
- * @returns The full path of the uploaded artifact
181
- */
182
- async uploadArtifact(runId, name, source) {
183
- const artifactPath = getAgentArtifactPath(runId, name);
184
- if (source instanceof File) {
185
- const file = source;
186
- return this.uploadFile(new StreamSource_js_1.StreamSource(file.stream(), name, file.type, artifactPath));
187
- }
188
- else {
189
- return this.uploadFile(new StreamSource_js_1.StreamSource(source.stream, name, source.type, artifactPath));
190
- }
191
- }
192
- /**
193
- * Download an artifact from an agent run
194
- * @param runId - The workflow run ID
195
- * @param name - Artifact name
196
- * @returns ReadableStream of the artifact content
197
- */
198
- async downloadArtifact(runId, name) {
199
- const artifactPath = getAgentArtifactPath(runId, name);
200
- return this.downloadFile(artifactPath);
201
- }
202
- /**
203
- * Get download URL for an artifact
204
- * @param runId - The workflow run ID
205
- * @param name - Artifact name
206
- * @param disposition - Content disposition (inline or attachment)
207
- * @returns Signed URL response
208
- */
209
- getArtifactDownloadUrl(runId, name, disposition) {
210
- const artifactPath = getAgentArtifactPath(runId, name);
211
- return this.getDownloadUrl(artifactPath, name, disposition);
212
- }
213
- /**
214
- * List artifacts for an agent run
215
- * @param runId - The workflow run ID
216
- * @returns Array of artifact file paths
217
- */
218
- async listArtifacts(runId) {
219
- const prefix = `${exports.ARTIFACTS_PREFIX}/${runId}/`;
220
- const result = await this.listByPrefix(prefix);
221
- return result.files;
222
- }
223
- }
224
- exports.FilesApi = FilesApi;
225
- //# sourceMappingURL=FilesApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FilesApi.js","sourceRoot":"","sources":["../../../src/store/FilesApi.ts"],"names":[],"mappings":";;;AAYA,8CAGC;AAOD,oDAEC;AAxBD,iEAAkE;AAOlE,wDAAkD;AAErC,QAAA,eAAe,GAAG,UAAU,CAAC;AAC7B,QAAA,gBAAgB,GAAG,QAAQ,CAAC;AAEzC,SAAgB,iBAAiB,CAAC,IAAY;IAC1C,MAAM,WAAW,GAAG,IAAI,CAAC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