@vertesia/client 1.0.0-dev.20260128.144200 → 1.0.0-dev.20260203.130115Z

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 (293) hide show
  1. package/package.json +4 -4
  2. package/src/store/HiveMemoryApi.ts +231 -0
  3. package/src/store/IndexingAdminApi.ts +336 -0
  4. package/src/store/IndexingApi.ts +62 -0
  5. package/src/store/QueryApi.ts +110 -0
  6. package/src/store/client.ts +8 -0
  7. package/src/store/index.ts +5 -0
  8. package/lib/cjs/AccountApi.js +0 -85
  9. package/lib/cjs/AccountApi.js.map +0 -1
  10. package/lib/cjs/AccountsApi.js +0 -16
  11. package/lib/cjs/AccountsApi.js.map +0 -1
  12. package/lib/cjs/AnalyticsApi.js +0 -41
  13. package/lib/cjs/AnalyticsApi.js.map +0 -1
  14. package/lib/cjs/ApiKeysApi.js +0 -63
  15. package/lib/cjs/ApiKeysApi.js.map +0 -1
  16. package/lib/cjs/AppsApi.js +0 -119
  17. package/lib/cjs/AppsApi.js.map +0 -1
  18. package/lib/cjs/CommandsApi.js +0 -19
  19. package/lib/cjs/CommandsApi.js.map +0 -1
  20. package/lib/cjs/EnvironmentsApi.js +0 -72
  21. package/lib/cjs/EnvironmentsApi.js.map +0 -1
  22. package/lib/cjs/GroupsApi.js +0 -78
  23. package/lib/cjs/GroupsApi.js.map +0 -1
  24. package/lib/cjs/IamApi.js +0 -53
  25. package/lib/cjs/IamApi.js.map +0 -1
  26. package/lib/cjs/InteractionBase.js +0 -44
  27. package/lib/cjs/InteractionBase.js.map +0 -1
  28. package/lib/cjs/InteractionCatalogApi.js +0 -64
  29. package/lib/cjs/InteractionCatalogApi.js.map +0 -1
  30. package/lib/cjs/InteractionOutput.js +0 -300
  31. package/lib/cjs/InteractionOutput.js.map +0 -1
  32. package/lib/cjs/InteractionResult.example.js +0 -57
  33. package/lib/cjs/InteractionResult.example.js.map +0 -1
  34. package/lib/cjs/InteractionsApi.js +0 -262
  35. package/lib/cjs/InteractionsApi.js.map +0 -1
  36. package/lib/cjs/MCPOAuthApi.js +0 -62
  37. package/lib/cjs/MCPOAuthApi.js.map +0 -1
  38. package/lib/cjs/ProjectsApi.js +0 -72
  39. package/lib/cjs/ProjectsApi.js.map +0 -1
  40. package/lib/cjs/PromptsApi.js +0 -133
  41. package/lib/cjs/PromptsApi.js.map +0 -1
  42. package/lib/cjs/RefsApi.js +0 -14
  43. package/lib/cjs/RefsApi.js.map +0 -1
  44. package/lib/cjs/RunsApi.js +0 -113
  45. package/lib/cjs/RunsApi.js.map +0 -1
  46. package/lib/cjs/SkillsApi.js +0 -39
  47. package/lib/cjs/SkillsApi.js.map +0 -1
  48. package/lib/cjs/StreamSource.js +0 -17
  49. package/lib/cjs/StreamSource.js.map +0 -1
  50. package/lib/cjs/TrainingApi.js +0 -54
  51. package/lib/cjs/TrainingApi.js.map +0 -1
  52. package/lib/cjs/UsersApi.js +0 -13
  53. package/lib/cjs/UsersApi.js.map +0 -1
  54. package/lib/cjs/client.js +0 -360
  55. package/lib/cjs/client.js.map +0 -1
  56. package/lib/cjs/execute.js +0 -158
  57. package/lib/cjs/execute.js.map +0 -1
  58. package/lib/cjs/index.js +0 -22
  59. package/lib/cjs/index.js.map +0 -1
  60. package/lib/cjs/nodejs/NodeStreamSource.js +0 -45
  61. package/lib/cjs/nodejs/NodeStreamSource.js.map +0 -1
  62. package/lib/cjs/nodejs/index.js +0 -18
  63. package/lib/cjs/nodejs/index.js.map +0 -1
  64. package/lib/cjs/package.json +0 -3
  65. package/lib/cjs/store/AnalyzeDocApi.js +0 -56
  66. package/lib/cjs/store/AnalyzeDocApi.js.map +0 -1
  67. package/lib/cjs/store/CollectionsApi.js +0 -131
  68. package/lib/cjs/store/CollectionsApi.js.map +0 -1
  69. package/lib/cjs/store/CommandsApi.js +0 -17
  70. package/lib/cjs/store/CommandsApi.js.map +0 -1
  71. package/lib/cjs/store/DashboardApi.js +0 -182
  72. package/lib/cjs/store/DashboardApi.js.map +0 -1
  73. package/lib/cjs/store/DataApi.js +0 -433
  74. package/lib/cjs/store/DataApi.js.map +0 -1
  75. package/lib/cjs/store/EmailApi.js +0 -103
  76. package/lib/cjs/store/EmailApi.js.map +0 -1
  77. package/lib/cjs/store/EmbeddingsApi.js +0 -29
  78. package/lib/cjs/store/EmbeddingsApi.js.map +0 -1
  79. package/lib/cjs/store/FilesApi.js +0 -237
  80. package/lib/cjs/store/FilesApi.js.map +0 -1
  81. package/lib/cjs/store/ObjectsApi.js +0 -314
  82. package/lib/cjs/store/ObjectsApi.js.map +0 -1
  83. package/lib/cjs/store/PendingAsksApi.js +0 -43
  84. package/lib/cjs/store/PendingAsksApi.js.map +0 -1
  85. package/lib/cjs/store/SchedulesApi.js +0 -103
  86. package/lib/cjs/store/SchedulesApi.js.map +0 -1
  87. package/lib/cjs/store/ToolsApi.js +0 -21
  88. package/lib/cjs/store/ToolsApi.js.map +0 -1
  89. package/lib/cjs/store/TypesApi.js +0 -57
  90. package/lib/cjs/store/TypesApi.js.map +0 -1
  91. package/lib/cjs/store/WorkersApi.js +0 -16
  92. package/lib/cjs/store/WorkersApi.js.map +0 -1
  93. package/lib/cjs/store/WorkflowsApi.js +0 -604
  94. package/lib/cjs/store/WorkflowsApi.js.map +0 -1
  95. package/lib/cjs/store/client.js +0 -81
  96. package/lib/cjs/store/client.js.map +0 -1
  97. package/lib/cjs/store/errors.js +0 -11
  98. package/lib/cjs/store/errors.js.map +0 -1
  99. package/lib/cjs/store/index.js +0 -27
  100. package/lib/cjs/store/index.js.map +0 -1
  101. package/lib/cjs/store/version.js +0 -6
  102. package/lib/cjs/store/version.js.map +0 -1
  103. package/lib/esm/AccountApi.js +0 -82
  104. package/lib/esm/AccountApi.js.map +0 -1
  105. package/lib/esm/AccountsApi.js +0 -13
  106. package/lib/esm/AccountsApi.js.map +0 -1
  107. package/lib/esm/AnalyticsApi.js +0 -38
  108. package/lib/esm/AnalyticsApi.js.map +0 -1
  109. package/lib/esm/ApiKeysApi.js +0 -59
  110. package/lib/esm/ApiKeysApi.js.map +0 -1
  111. package/lib/esm/AppsApi.js +0 -116
  112. package/lib/esm/AppsApi.js.map +0 -1
  113. package/lib/esm/CommandsApi.js +0 -16
  114. package/lib/esm/CommandsApi.js.map +0 -1
  115. package/lib/esm/EnvironmentsApi.js +0 -69
  116. package/lib/esm/EnvironmentsApi.js.map +0 -1
  117. package/lib/esm/GroupsApi.js +0 -74
  118. package/lib/esm/GroupsApi.js.map +0 -1
  119. package/lib/esm/IamApi.js +0 -47
  120. package/lib/esm/IamApi.js.map +0 -1
  121. package/lib/esm/InteractionBase.js +0 -40
  122. package/lib/esm/InteractionBase.js.map +0 -1
  123. package/lib/esm/InteractionCatalogApi.js +0 -60
  124. package/lib/esm/InteractionCatalogApi.js.map +0 -1
  125. package/lib/esm/InteractionOutput.js +0 -293
  126. package/lib/esm/InteractionOutput.js.map +0 -1
  127. package/lib/esm/InteractionResult.example.js +0 -55
  128. package/lib/esm/InteractionResult.example.js.map +0 -1
  129. package/lib/esm/InteractionsApi.js +0 -259
  130. package/lib/esm/InteractionsApi.js.map +0 -1
  131. package/lib/esm/MCPOAuthApi.js +0 -59
  132. package/lib/esm/MCPOAuthApi.js.map +0 -1
  133. package/lib/esm/ProjectsApi.js +0 -69
  134. package/lib/esm/ProjectsApi.js.map +0 -1
  135. package/lib/esm/PromptsApi.js +0 -130
  136. package/lib/esm/PromptsApi.js.map +0 -1
  137. package/lib/esm/RefsApi.js +0 -10
  138. package/lib/esm/RefsApi.js.map +0 -1
  139. package/lib/esm/RunsApi.js +0 -109
  140. package/lib/esm/RunsApi.js.map +0 -1
  141. package/lib/esm/SkillsApi.js +0 -36
  142. package/lib/esm/SkillsApi.js.map +0 -1
  143. package/lib/esm/StreamSource.js +0 -13
  144. package/lib/esm/StreamSource.js.map +0 -1
  145. package/lib/esm/TrainingApi.js +0 -51
  146. package/lib/esm/TrainingApi.js.map +0 -1
  147. package/lib/esm/UsersApi.js +0 -10
  148. package/lib/esm/UsersApi.js.map +0 -1
  149. package/lib/esm/client.js +0 -351
  150. package/lib/esm/client.js.map +0 -1
  151. package/lib/esm/execute.js +0 -118
  152. package/lib/esm/execute.js.map +0 -1
  153. package/lib/esm/index.js +0 -6
  154. package/lib/esm/index.js.map +0 -1
  155. package/lib/esm/nodejs/NodeStreamSource.js +0 -41
  156. package/lib/esm/nodejs/NodeStreamSource.js.map +0 -1
  157. package/lib/esm/nodejs/index.js +0 -2
  158. package/lib/esm/nodejs/index.js.map +0 -1
  159. package/lib/esm/store/AnalyzeDocApi.js +0 -52
  160. package/lib/esm/store/AnalyzeDocApi.js.map +0 -1
  161. package/lib/esm/store/CollectionsApi.js +0 -127
  162. package/lib/esm/store/CollectionsApi.js.map +0 -1
  163. package/lib/esm/store/CommandsApi.js +0 -13
  164. package/lib/esm/store/CommandsApi.js.map +0 -1
  165. package/lib/esm/store/DashboardApi.js +0 -178
  166. package/lib/esm/store/DashboardApi.js.map +0 -1
  167. package/lib/esm/store/DataApi.js +0 -429
  168. package/lib/esm/store/DataApi.js.map +0 -1
  169. package/lib/esm/store/EmailApi.js +0 -99
  170. package/lib/esm/store/EmailApi.js.map +0 -1
  171. package/lib/esm/store/EmbeddingsApi.js +0 -25
  172. package/lib/esm/store/EmbeddingsApi.js.map +0 -1
  173. package/lib/esm/store/FilesApi.js +0 -231
  174. package/lib/esm/store/FilesApi.js.map +0 -1
  175. package/lib/esm/store/ObjectsApi.js +0 -309
  176. package/lib/esm/store/ObjectsApi.js.map +0 -1
  177. package/lib/esm/store/PendingAsksApi.js +0 -39
  178. package/lib/esm/store/PendingAsksApi.js.map +0 -1
  179. package/lib/esm/store/SchedulesApi.js +0 -99
  180. package/lib/esm/store/SchedulesApi.js.map +0 -1
  181. package/lib/esm/store/ToolsApi.js +0 -17
  182. package/lib/esm/store/ToolsApi.js.map +0 -1
  183. package/lib/esm/store/TypesApi.js +0 -53
  184. package/lib/esm/store/TypesApi.js.map +0 -1
  185. package/lib/esm/store/WorkersApi.js +0 -12
  186. package/lib/esm/store/WorkersApi.js.map +0 -1
  187. package/lib/esm/store/WorkflowsApi.js +0 -598
  188. package/lib/esm/store/WorkflowsApi.js.map +0 -1
  189. package/lib/esm/store/client.js +0 -77
  190. package/lib/esm/store/client.js.map +0 -1
  191. package/lib/esm/store/errors.js +0 -7
  192. package/lib/esm/store/errors.js.map +0 -1
  193. package/lib/esm/store/index.js +0 -11
  194. package/lib/esm/store/index.js.map +0 -1
  195. package/lib/esm/store/version.js +0 -3
  196. package/lib/esm/store/version.js.map +0 -1
  197. package/lib/tsconfig.tsbuildinfo +0 -1
  198. package/lib/types/AccountApi.d.ts +0 -59
  199. package/lib/types/AccountApi.d.ts.map +0 -1
  200. package/lib/types/AccountsApi.d.ts +0 -7
  201. package/lib/types/AccountsApi.d.ts.map +0 -1
  202. package/lib/types/AnalyticsApi.d.ts +0 -11
  203. package/lib/types/AnalyticsApi.d.ts.map +0 -1
  204. package/lib/types/ApiKeysApi.d.ts +0 -42
  205. package/lib/types/ApiKeysApi.d.ts.map +0 -1
  206. package/lib/types/AppsApi.d.ts +0 -65
  207. package/lib/types/AppsApi.d.ts.map +0 -1
  208. package/lib/types/CommandsApi.d.ts +0 -10
  209. package/lib/types/CommandsApi.d.ts.map +0 -1
  210. package/lib/types/EnvironmentsApi.d.ts +0 -40
  211. package/lib/types/EnvironmentsApi.d.ts.map +0 -1
  212. package/lib/types/GroupsApi.d.ts +0 -65
  213. package/lib/types/GroupsApi.d.ts.map +0 -1
  214. package/lib/types/IamApi.d.ts +0 -41
  215. package/lib/types/IamApi.d.ts.map +0 -1
  216. package/lib/types/InteractionBase.d.ts +0 -22
  217. package/lib/types/InteractionBase.d.ts.map +0 -1
  218. package/lib/types/InteractionCatalogApi.d.ts +0 -36
  219. package/lib/types/InteractionCatalogApi.d.ts.map +0 -1
  220. package/lib/types/InteractionOutput.d.ts +0 -174
  221. package/lib/types/InteractionOutput.d.ts.map +0 -1
  222. package/lib/types/InteractionResult.example.d.ts +0 -6
  223. package/lib/types/InteractionResult.example.d.ts.map +0 -1
  224. package/lib/types/InteractionsApi.d.ts +0 -183
  225. package/lib/types/InteractionsApi.d.ts.map +0 -1
  226. package/lib/types/MCPOAuthApi.d.ts +0 -45
  227. package/lib/types/MCPOAuthApi.d.ts.map +0 -1
  228. package/lib/types/ProjectsApi.d.ts +0 -28
  229. package/lib/types/ProjectsApi.d.ts.map +0 -1
  230. package/lib/types/PromptsApi.d.ts +0 -106
  231. package/lib/types/PromptsApi.d.ts.map +0 -1
  232. package/lib/types/RefsApi.d.ts +0 -6
  233. package/lib/types/RefsApi.d.ts.map +0 -1
  234. package/lib/types/RunsApi.d.ts +0 -79
  235. package/lib/types/RunsApi.d.ts.map +0 -1
  236. package/lib/types/SkillsApi.d.ts +0 -26
  237. package/lib/types/SkillsApi.d.ts.map +0 -1
  238. package/lib/types/StreamSource.d.ts +0 -7
  239. package/lib/types/StreamSource.d.ts.map +0 -1
  240. package/lib/types/TrainingApi.d.ts +0 -27
  241. package/lib/types/TrainingApi.d.ts.map +0 -1
  242. package/lib/types/UsersApi.d.ts +0 -6
  243. package/lib/types/UsersApi.d.ts.map +0 -1
  244. package/lib/types/client.d.ts +0 -136
  245. package/lib/types/client.d.ts.map +0 -1
  246. package/lib/types/execute.d.ts +0 -37
  247. package/lib/types/execute.d.ts.map +0 -1
  248. package/lib/types/index.d.ts +0 -10
  249. package/lib/types/index.d.ts.map +0 -1
  250. package/lib/types/nodejs/NodeStreamSource.d.ts +0 -9
  251. package/lib/types/nodejs/NodeStreamSource.d.ts.map +0 -1
  252. package/lib/types/nodejs/index.d.ts +0 -1
  253. package/lib/types/nodejs/index.d.ts.map +0 -1
  254. package/lib/types/store/AnalyzeDocApi.d.ts +0 -17
  255. package/lib/types/store/AnalyzeDocApi.d.ts.map +0 -1
  256. package/lib/types/store/CollectionsApi.d.ts +0 -82
  257. package/lib/types/store/CollectionsApi.d.ts.map +0 -1
  258. package/lib/types/store/CommandsApi.d.ts +0 -10
  259. package/lib/types/store/CommandsApi.d.ts.map +0 -1
  260. package/lib/types/store/DashboardApi.d.ts +0 -149
  261. package/lib/types/store/DashboardApi.d.ts.map +0 -1
  262. package/lib/types/store/DataApi.d.ts +0 -392
  263. package/lib/types/store/DataApi.d.ts.map +0 -1
  264. package/lib/types/store/EmailApi.d.ts +0 -185
  265. package/lib/types/store/EmailApi.d.ts.map +0 -1
  266. package/lib/types/store/EmbeddingsApi.d.ts +0 -12
  267. package/lib/types/store/EmbeddingsApi.d.ts.map +0 -1
  268. package/lib/types/store/FilesApi.d.ts +0 -110
  269. package/lib/types/store/FilesApi.d.ts.map +0 -1
  270. package/lib/types/store/ObjectsApi.d.ts +0 -139
  271. package/lib/types/store/ObjectsApi.d.ts.map +0 -1
  272. package/lib/types/store/PendingAsksApi.d.ts +0 -79
  273. package/lib/types/store/PendingAsksApi.d.ts.map +0 -1
  274. package/lib/types/store/SchedulesApi.d.ts +0 -89
  275. package/lib/types/store/SchedulesApi.d.ts.map +0 -1
  276. package/lib/types/store/ToolsApi.d.ts +0 -13
  277. package/lib/types/store/ToolsApi.d.ts.map +0 -1
  278. package/lib/types/store/TypesApi.d.ts +0 -23
  279. package/lib/types/store/TypesApi.d.ts.map +0 -1
  280. package/lib/types/store/WorkersApi.d.ts +0 -6
  281. package/lib/types/store/WorkersApi.d.ts.map +0 -1
  282. package/lib/types/store/WorkflowsApi.d.ts +0 -170
  283. package/lib/types/store/WorkflowsApi.d.ts.map +0 -1
  284. package/lib/types/store/client.d.ts +0 -45
  285. package/lib/types/store/client.d.ts.map +0 -1
  286. package/lib/types/store/errors.d.ts +0 -4
  287. package/lib/types/store/errors.d.ts.map +0 -1
  288. package/lib/types/store/index.d.ts +0 -10
  289. package/lib/types/store/index.d.ts.map +0 -1
  290. package/lib/types/store/version.d.ts +0 -2
  291. package/lib/types/store/version.d.ts.map +0 -1
  292. package/lib/vertesia-client.js +0 -2
  293. package/lib/vertesia-client.js.map +0 -1
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GroupsApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- class GroupsApi extends api_fetch_client_1.ApiTopic {
6
- constructor(parent) {
7
- super(parent, "/groups");
8
- }
9
- /**
10
- * List all groups in the current account
11
- * @param options Query options for filtering and pagination
12
- * @returns Array of UserGroup objects
13
- */
14
- list(options) {
15
- return this.get('/', { query: options });
16
- }
17
- /**
18
- * Create a new group
19
- * @param payload The group data to create
20
- * @returns The created UserGroup object
21
- */
22
- create(payload) {
23
- return this.post('/', { payload });
24
- }
25
- /**
26
- * Retrieve a specific group by ID
27
- * @param groupId The ID of the group to retrieve
28
- * @returns The UserGroup object
29
- */
30
- retrieve(groupId) {
31
- return this.get('/' + groupId);
32
- }
33
- /**
34
- * Update a group
35
- * @param groupId The ID of the group to update
36
- * @param payload The group data to update
37
- * @returns The updated UserGroup object
38
- */
39
- update(groupId, payload) {
40
- return this.put('/' + groupId, { payload });
41
- }
42
- /**
43
- * Delete a group
44
- * @param groupId The ID of the group to delete
45
- * @returns Object with the deleted group ID
46
- */
47
- delete(groupId) {
48
- return this.del('/' + groupId);
49
- }
50
- /**
51
- * List members of a group
52
- * @param groupId The ID of the group
53
- * @returns Array of UserRef objects representing group members
54
- */
55
- listMembers(groupId) {
56
- return this.get('/' + groupId + '/members');
57
- }
58
- /**
59
- * Add a member to a group
60
- * @param groupId The ID of the group
61
- * @param userId The ID of the user to add
62
- * @returns The updated UserGroup object
63
- */
64
- addMember(groupId, userId) {
65
- return this.post('/' + groupId + '/members/' + userId);
66
- }
67
- /**
68
- * Remove a member from a group
69
- * @param groupId The ID of the group
70
- * @param userId The ID of the user to remove
71
- * @returns The updated UserGroup object
72
- */
73
- removeMember(groupId, userId) {
74
- return this.del('/' + groupId + '/members/' + userId);
75
- }
76
- }
77
- exports.GroupsApi = GroupsApi;
78
- //# sourceMappingURL=GroupsApi.js.map
@@ -1 +0,0 @@
1
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,GAAG,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC;IAC1D,CAAC;CACJ;AAhFD,8BAgFC"}
package/lib/cjs/IamApi.js DELETED
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AcesApi = exports.RolesApi = exports.IamApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- const GroupsApi_js_1 = require("./GroupsApi.js");
6
- class IamApi extends api_fetch_client_1.ApiTopic {
7
- constructor(parent) {
8
- super(parent, "/api/v1/iam");
9
- }
10
- aces = new AcesApi(this);
11
- roles = new RolesApi(this);
12
- groups = new GroupsApi_js_1.GroupsApi(this);
13
- }
14
- exports.IamApi = IamApi;
15
- class RolesApi extends api_fetch_client_1.ApiTopic {
16
- constructor(parent) {
17
- super(parent, "/roles");
18
- }
19
- list() {
20
- return this.get('/');
21
- }
22
- }
23
- exports.RolesApi = RolesApi;
24
- class AcesApi extends api_fetch_client_1.ApiTopic {
25
- constructor(parent) {
26
- super(parent, "/aces");
27
- }
28
- /**
29
- * Get the list of all runs
30
- * @param project optional project id to filter by
31
- * @param interaction optional interaction id to filter by
32
- * @returns InteractionResult[]
33
- **/
34
- list(options) {
35
- return this.get('/', { query: { ...options } });
36
- }
37
- /**
38
- * Get an ACE by its Id
39
- * @param id
40
- * @returns InteractionResult
41
- **/
42
- retrieve(id) {
43
- return this.get('/' + id);
44
- }
45
- create(payload) {
46
- return this.post('/', { payload });
47
- }
48
- delete(id) {
49
- return this.del('/' + id);
50
- }
51
- }
52
- exports.AcesApi = AcesApi;
53
- //# sourceMappingURL=IamApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IamApi.js","sourceRoot":"","sources":["../../src/IamApi.ts"],"names":[],"mappings":";;;AACA,iEAAkE;AAClE,iDAA2C;AAU3C,MAAa,MAAO,SAAQ,2BAAQ;IAEhC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,KAAK,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC1B,MAAM,GAAG,IAAI,wBAAS,CAAC,IAAI,CAAC,CAAA;CAC/B;AATD,wBASC;AAED,MAAa,QAAS,SAAQ,2BAAQ;IAElC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC3B,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CAEJ;AAVD,4BAUC;AAGD,MAAa,OAAQ,SAAQ,2BAAQ;IAEjC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC1B,CAAC;IAED;;;;;QAKI;IACJ,IAAI,CAAC,OAAyB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;;;QAII;IACJ,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,OAAyB;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;IAC7B,CAAC;CAEJ;AAjCD,0BAiCC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InteractionBase = void 0;
4
- const client_js_1 = require("./client.js");
5
- const execute_js_1 = require("./execute.js");
6
- class InteractionBase {
7
- id;
8
- client;
9
- constructor(id, clientOrOpts) {
10
- this.id = id;
11
- if (clientOrOpts instanceof client_js_1.VertesiaClient) {
12
- this.client = clientOrOpts;
13
- }
14
- else {
15
- this.client = new client_js_1.VertesiaClient(clientOrOpts);
16
- }
17
- }
18
- retrieve() {
19
- return this.client.interactions.retrieve(this.id);
20
- }
21
- update(payload) {
22
- return this.client.interactions.update(this.id, payload);
23
- }
24
- render(data) {
25
- data;
26
- //TODO
27
- }
28
- /**
29
- * Execute an interaction and return a promise which will be resolved with the executed run when
30
- * the run completes or fails.
31
- * If the onChunk callback is passed then the streaming of the result is enabled.
32
- * The onChunk callback with be called with the next chunk of the result as soon as it is available.
33
- * When all chunks are received the function will return the resolved promise
34
- * @param id of the interaction to execute
35
- * @param payload InteractionExecutionPayload
36
- * @param onChunk callback to be called when the next chunk of the response is available
37
- * @returns the resolved execution run as Promise<ExecutionRun>
38
- */
39
- async execute(payload = {}, onChunk) {
40
- return (0, execute_js_1.executeInteraction)(this.client, this.id, payload, onChunk);
41
- }
42
- }
43
- exports.InteractionBase = InteractionBase;
44
- //# sourceMappingURL=InteractionBase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InteractionBase.js","sourceRoot":"","sources":["../../src/InteractionBase.ts"],"names":[],"mappings":";;;AACA,2CAAkE;AAClE,6CAAkD;AAElD,MAAa,eAAe;IAGL;IAFnB,MAAM,CAAiB;IAEvB,YAAmB,EAAU,EAAE,YAAkD;QAA9D,OAAE,GAAF,EAAE,CAAQ;QACzB,IAAI,YAAY,YAAY,0BAAc,EAAE,CAAC;YACzC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,MAAM,GAAG,IAAI,0BAAc,CAAC,YAAY,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,OAAiC;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,IAAO;QACV,IAAI,CAAC;QACL,MAAM;IACV,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,OAAO,CAAC,UAAuC,EAAE,EACnD,OAAiC;QACjC,OAAO,IAAA,+BAAkB,EAAI,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;CACJ;AAvCD,0CAuCC"}
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InteractionCatalogApi = void 0;
4
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
5
- class InteractionCatalogApi extends api_fetch_client_1.ApiTopic {
6
- constructor(parent) {
7
- super(parent, "/api/v1/interactions/catalog");
8
- }
9
- /**
10
- * List all project interactions
11
- */
12
- list(query = {}) {
13
- return this.get("/", {
14
- query
15
- });
16
- }
17
- /**
18
- * List all stored interactions
19
- */
20
- listStoredInteractions(query = {}) {
21
- return this.get("/stored", {
22
- query
23
- });
24
- }
25
- /**
26
- * List sys interactions
27
- */
28
- listSysInteractions(tag) {
29
- return this.get(`/sys`, {
30
- query: {
31
- tag
32
- }
33
- });
34
- }
35
- /**
36
- * List sys interactions
37
- */
38
- listAppInteractions(appName, tag) {
39
- return this.get(`/apps/${appName}`, {
40
- query: {
41
- tag
42
- }
43
- });
44
- }
45
- /**
46
- * List all app interactions
47
- */
48
- listAllAppInteractions(tag) {
49
- return this.get(`/apps`, {
50
- query: {
51
- tag
52
- }
53
- });
54
- }
55
- /**
56
- * Resolve an interaction given its id to a InCodeInteraction
57
- * @param id Interaction id
58
- */
59
- resolve(id) {
60
- return this.get(`/resolve/${id}`);
61
- }
62
- }
63
- exports.InteractionCatalogApi = InteractionCatalogApi;
64
- //# sourceMappingURL=InteractionCatalogApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InteractionCatalogApi.js","sourceRoot":"","sources":["../../src/InteractionCatalogApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAQlE,MAAa,qBAAsB,SAAQ,2BAAQ;IAC/C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,QAAsD,EAAE;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;YACjB,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,QAAsD,EAAE;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;YACvB,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,GAAY;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACpB,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,OAAe,EAAE,GAAY;QAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,OAAO,EAAE,EAAE;YAChC,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,GAAY;QAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;YACrB,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,EAAU;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;CACJ;AA/DD,sDA+DC"}
@@ -1,300 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InteractionOutput = exports.IS_INTERACTION_OUTPUT = void 0;
4
- exports.enhanceInteractionExecutionResult = enhanceInteractionExecutionResult;
5
- exports.enhanceExecutionRun = enhanceExecutionRun;
6
- exports.createInteractionOutput = createInteractionOutput;
7
- /**
8
- * Symbol used to mark InteractionOutputArray instances.
9
- * This allows us to detect if a CompletionResult[] has already been wrapped.
10
- */
11
- exports.IS_INTERACTION_OUTPUT = Symbol('InteractionOutput');
12
- function enhanceInteractionExecutionResult(r) {
13
- r.result = InteractionOutput.from(r.result);
14
- return r;
15
- }
16
- function enhanceExecutionRun(r) {
17
- r.result = InteractionOutput.from(r.result);
18
- return r;
19
- }
20
- /**
21
- * A convenient wrapper around CompletionResult[] that provides ergonomic accessors
22
- * for different result types (text, JSON/objects, images) from interaction executions.
23
- *
24
- * Use the static from() method to create a proxied array that acts as both
25
- * an array and has these convenience methods.
26
- *
27
- * @template T - The expected type of JSON/object results. Defaults to any.
28
- *
29
- * @example
30
- * ```typescript
31
- * // Recommended: Using the static from() method
32
- * const output = InteractionOutput.from<MyResponse>(run.result);
33
- * output[0]; // CompletionResult (array access)
34
- * output.length; // number (array property)
35
- * const obj = output.object(); // MyResponse (custom method)
36
- * const text = output.text(); // string (custom getter)
37
- *
38
- * // Alternative: Using the class directly (less common)
39
- * const output = new InteractionOutput<MyResponse>(run.result);
40
- * const obj = output.object(); // Returns MyResponse
41
- * const objs = output.objects(); // Returns MyResponse[]
42
- *
43
- * // Override type for specific objects
44
- * interface OtherType { title: string; }
45
- * ```
46
- */
47
- class InteractionOutput {
48
- results;
49
- /**
50
- * The raw completion results array.
51
- * Access this when you need to work with the underlying CompletionResult[] directly.
52
- */
53
- constructor(results) {
54
- this.results = results;
55
- }
56
- /**
57
- * Create an interaction output that acts as both an array and has convenience methods.
58
- * This is the recommended way to work with interaction execution results.
59
- *
60
- * @template T - The expected type of JSON/object results. Defaults to any.
61
- * @param results - The raw CompletionResult array from an interaction execution
62
- * @returns A proxied array with convenience methods
63
- *
64
- * @example
65
- * ```typescript
66
- * interface MyResponse { name: string; age: number; }
67
- * const output = InteractionOutput.from<MyResponse>(run.result);
68
- *
69
- * // Array access
70
- * output[0]; // CompletionResult
71
- * output.length; // number
72
- *
73
- * // Convenience methods
74
- * const obj = output.object(); // MyResponse
75
- * const text = output.text(); // string
76
- * ```
77
- */
78
- static from(results) {
79
- if (!results) {
80
- return createInteractionOutput([]);
81
- }
82
- // Check if already wrapped using the symbol marker
83
- if (results[exports.IS_INTERACTION_OUTPUT]) {
84
- return results;
85
- }
86
- if (Array.isArray(results)) {
87
- return createInteractionOutput(results);
88
- }
89
- else if (typeof results === 'object') {
90
- return createInteractionOutput([{ type: 'json', value: results }]);
91
- }
92
- else {
93
- return createInteractionOutput([{ type: 'text', value: String(results) }]);
94
- }
95
- }
96
- static isInteractionOutputArray(obj) {
97
- return obj && obj[exports.IS_INTERACTION_OUTPUT] === true;
98
- }
99
- get isEmpty() {
100
- return this.results.length === 0;
101
- }
102
- hasObject() {
103
- return this.results.some(r => r.type === 'json');
104
- }
105
- hasText() {
106
- return this.results.some(r => r.type === 'text');
107
- }
108
- hasImage() {
109
- return this.results.some(r => r.type === 'image');
110
- }
111
- /**
112
- * Get the concatenated text from all text results.
113
- * Returns an empty string if no text results exist.
114
- */
115
- text(delimiter = '\n') {
116
- return this.results
117
- .filter(r => r.type === 'text')
118
- .map(r => r.value)
119
- .join(delimiter);
120
- }
121
- /**
122
- * Get an array of all text values from text results.
123
- */
124
- texts() {
125
- return this.results
126
- .filter(r => r.type === 'text')
127
- .map(r => r.value);
128
- }
129
- /**
130
- * Get the first JSON result as a parsed object.
131
- * If no JSON result exists, attempts to parse the concatenated text as JSON.
132
- * @returns The first JSON result typed as T (the class generic type)
133
- * @throws Error if no JSON result found and text cannot be parsed as JSON
134
- */
135
- object() {
136
- const jsonResult = this.results.find(r => r.type === 'json');
137
- if (jsonResult) {
138
- return jsonResult.value;
139
- }
140
- // Fallback: try to parse the other text parts as JSON
141
- return parseCompletionResultAsJson(this.results);
142
- }
143
- /**
144
- * Get all JSON results as parsed objects.
145
- * @returns An array of all JSON results typed as T[] (the class generic type)
146
- */
147
- objects() {
148
- return this.results
149
- .filter(r => r.type === 'json')
150
- .map(r => r.value);
151
- }
152
- /**
153
- * Get a specific JSON result by index as a parsed object.
154
- * @template U - The type of the object at this index. Defaults to T (the class generic).
155
- * @param index - The zero-based index of the JSON result
156
- * @returns The JSON result at the specified index typed as U
157
- * @throws Error if the index is out of bounds
158
- */
159
- objectAt(index) {
160
- let i = 0;
161
- for (const result of this.results) {
162
- if (result.type === 'json') {
163
- if (i === index) {
164
- return result.value;
165
- }
166
- i++;
167
- }
168
- }
169
- throw new Error(`Object at index ${index} not found`);
170
- }
171
- /**
172
- * Get the first image result (base64 data URL or URL).
173
- * @throws Error if no image result exists
174
- */
175
- image() {
176
- const imageResult = this.results.find(r => r.type === 'image');
177
- if (!imageResult) {
178
- throw new Error('No image result found');
179
- }
180
- return imageResult.value;
181
- }
182
- /**
183
- * Get an array of all image values (base64 data URLs or URLs).
184
- */
185
- images() {
186
- return this.results
187
- .filter(r => r.type === 'image')
188
- .map(r => r.value);
189
- }
190
- /**
191
- * Convert all results to a string representation.
192
- * Text and image results are used as-is, JSON results are stringified with the specified indent.
193
- * All parts are joined using the specified separator.
194
- *
195
- * @param separator - The separator to use between parts (default: '\n')
196
- * @param indent - The indentation to use for JSON.stringify (default: 0 = no formatting)
197
- * @returns A string representation of all results
198
- *
199
- * @example
200
- * ```typescript
201
- * const output = InteractionOutput.from(results);
202
- * output.stringify(); // Each part on a new line, compact JSON
203
- * output.stringify('\n\n', 2); // Double newlines between parts, formatted JSON
204
- * output.stringify(' '); // Space-separated, compact JSON
205
- * ```
206
- */
207
- stringify(separator = '\n', indent = 2) {
208
- return this.results
209
- .map(r => {
210
- switch (r.type) {
211
- case 'json':
212
- return JSON.stringify(r.value, null, indent);
213
- default:
214
- return String(r.value);
215
- }
216
- })
217
- .join(separator);
218
- }
219
- /**
220
- * Convert to string representation (concatenated text).
221
- * Useful for template literals or string coercion.
222
- */
223
- toString() {
224
- return this.text();
225
- }
226
- /**
227
- * Convert to JSON representation.
228
- * Attempts to return the first JSON object, falls back to concatenated text.
229
- */
230
- toJSON() {
231
- return this.results;
232
- }
233
- }
234
- exports.InteractionOutput = InteractionOutput;
235
- /**
236
- * Creates a proxied array that acts as both a CompletionResult[] and has InteractionOutput convenience methods.
237
- * Note: It's recommended to use InteractionOutput.from() instead of calling this function directly.
238
- *
239
- * @template T - The expected type of JSON/object results. Defaults to any.
240
- * @param results - The raw CompletionResult array from the interaction execution
241
- * @returns A proxy that behaves as both an array and has convenience methods
242
- *
243
- * @example
244
- * ```typescript
245
- * interface MyResponse { name: string; age: number; }
246
- * const output = createInteractionOutput<MyResponse>(run.result);
247
- *
248
- * // Array access
249
- * output[0]; // CompletionResult
250
- * output.length; // number
251
- * output.map(r => r.type) // string[]
252
- *
253
- * // Convenience methods
254
- * const obj = output.object(); // MyResponse
255
- * const text = output.text(); // string
256
- * const img = output.image(); // string
257
- * ```
258
- */
259
- function createInteractionOutput(results) {
260
- const wrapper = new InteractionOutput(results);
261
- return new Proxy(results, {
262
- get(target, prop, receiver) {
263
- // Return the marker symbol to identify wrapped arrays
264
- if (prop === exports.IS_INTERACTION_OUTPUT) {
265
- return true;
266
- }
267
- // Check if the wrapper has this property/method
268
- if (prop in wrapper) {
269
- const value = wrapper[prop];
270
- // If it's a function, bind it to the wrapper so 'this' works correctly
271
- if (typeof value === 'function') {
272
- return value.bind(wrapper);
273
- }
274
- // For getters and regular properties, just return the value
275
- return value;
276
- }
277
- // Otherwise delegate to the array
278
- return Reflect.get(target, prop, receiver);
279
- }
280
- });
281
- }
282
- function parseCompletionResultAsJson(data) {
283
- let lastError;
284
- for (const part of data) {
285
- if (part.type === "text") {
286
- const text = part.value.trim();
287
- try {
288
- return JSON.parse(text);
289
- }
290
- catch (error) {
291
- lastError = error;
292
- }
293
- }
294
- }
295
- if (!lastError) {
296
- lastError = new Error("No JSON result found and no text available to parse");
297
- }
298
- throw lastError;
299
- }
300
- //# sourceMappingURL=InteractionOutput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InteractionOutput.js","sourceRoot":"","sources":["../../src/InteractionOutput.ts"],"names":[],"mappings":";;;AASA,8EAGC;AAED,kDAGC;AA2QD,0DAwBC;AAjTD;;;GAGG;AACU,QAAA,qBAAqB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEjE,SAAgB,iCAAiC,CAA+B,CAAsC;IACjH,CAAS,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9D,OAAO,CAAyD,CAAC;AACrE,CAAC;AAED,SAAgB,mBAAmB,CAA+B,CAAwB;IACrF,CAAS,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9D,OAAO,CAA2C,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,iBAAiB;IAKE;IAJ5B;;;OAGG;IACH,YAA4B,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAI,CAAC;IAE5D;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,CAAU,OAAyG;QAC1H,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,uBAAuB,CAAI,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,2DAA2D;QAC3D,IAAK,OAAe,CAAC,6BAAqB,CAAC,EAAE,CAAC;YAC1C,OAAO,OAAoC,CAAC;QAChD,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACzB,OAAO,uBAAuB,CAAI,OAA6B,CAAC,CAAC;QACrE,CAAC;aAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,uBAAuB,CAAI,CAAC,EAAE,I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AO,IAAI,CAAC;YAChB,CAAC;YAED,gDAAgD;YAChD,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;gBAClB,MAAM,KAAK,GAAI,OAAe,CAAC,IAAI,CAAC,CAAC;gBACrC,uEAAuE;gBACvE,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;oBAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC/B,CAAC;gBACD,4DAA4D;gBAC5D,OAAO,KAAK,CAAC;YACjB,CAAC;YACD,kCAAkC;YAClC,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC;KACJ,CAA8B,CAAC;AACpC,CAAC;AAGD,SAAS,2BAA2B,CAAC,IAAwB;IACzD,IAAI,SAA4B,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACvB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC;gBACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBAClB,SAAS,GAAG,KAAK,CAAC;YACtB,CAAC;QACL,CAAC;IACL,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,SAAS,GAAG,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,SAAS,CAAC;AACpB,CAAC"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
- /**
3
- * Example usage of InteractionOutput
4
- * This file demonstrates the Proxy-based approach where the result acts as both
5
- * an array and has convenience methods.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const InteractionOutput_js_1 = require("./InteractionOutput.js");
9
- // Sample data
10
- const sampleResults = [
11
- { type: 'text', value: 'Hello, ' },
12
- { type: 'text', value: 'World!' },
13
- { type: 'json', value: { name: 'Alice', age: 30 } },
14
- { type: 'json', value: { title: 'Engineer', level: 'Senior' } },
15
- { type: 'image', value: 'data:image/png;base64,iVBORw0K...' }
16
- ];
17
- // Example 1: Using InteractionOutput.from() (Proxy approach - RECOMMENDED)
18
- console.log('=== Example 1: Proxy Approach ===');
19
- const output = InteractionOutput_js_1.InteractionOutput.from(sampleResults);
20
- // Works as an array
21
- console.log('Array length:', output.length); // 5
22
- console.log('First item:', output[0]); // { type: 'text', value: 'Hello, ' }
23
- console.log('Types:', output.map(r => r.type)); // ['text', 'text', 'json', 'json', 'image']
24
- // Has convenience methods
25
- console.log('All text:', output.text); // 'Hello, World!'
26
- console.log('First object:', output.object()); // { name: 'Alice', age: 30 } (typed as Person)
27
- console.log('All objects:', output.objects()); // [{ name: 'Alice', age: 30 }, { title: 'Engineer', level: 'Senior' }]
28
- console.log('First image:', output.image); // 'data:image/png;base64,iVBORw0K...'
29
- console.log('Second object:', output.objectAt(1)); // { title: 'Engineer', level: 'Senior' } (typed as Job)
30
- // Example 2: Using InteractionOutput class directly
31
- console.log('\n=== Example 2: Class Approach ===');
32
- const wrapper = new InteractionOutput_js_1.InteractionOutput(sampleResults);
33
- // Access through wrapper properties (no array access)
34
- console.log('All text:', wrapper.text);
35
- console.log('Raw results:', wrapper.results); // Original array
36
- console.log('First object:', wrapper.object());
37
- // Example 3: Type safety demonstration
38
- console.log('\n=== Example 3: Type Safety ===');
39
- const contractResults = [
40
- { type: 'json', value: { title: 'Sales Agreement', parties: ['Alice', 'Bob'] } }
41
- ];
42
- const contractOutput = InteractionOutput_js_1.InteractionOutput.from(contractResults);
43
- const contract = contractOutput.object(); // TypeScript knows this is Contract
44
- console.log('Contract title:', contract.title);
45
- console.log('Parties:', contract.parties.join(', '));
46
- // Example 4: Mixed content
47
- console.log('\n=== Example 4: Mixed Content ===');
48
- const mixedResults = [
49
- { type: 'text', value: 'Analysis complete. Results: ' },
50
- { type: 'json', value: { score: 0.95, confidence: 'high' } },
51
- { type: 'text', value: '\nThank you!' }
52
- ];
53
- const mixed = InteractionOutput_js_1.InteractionOutput.from(mixedResults);
54
- console.log('Full text:', mixed.text); // 'Analysis complete. Results: \nThank you!'
55
- console.log('Analysis:', mixed.object()); // { score: 0.95, confidence: 'high' }
56
- console.log('Text parts:', mixed.texts); // ['Analysis complete. Results: ', '\nThank you!']
57
- //# sourceMappingURL=InteractionResult.example.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InteractionResult.example.js","sourceRoot":"","sources":["../../src/InteractionResult.example.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAGH,iEAA2D;AAE3D,cAAc;AACd,MAAM,aAAa,GAAuB;IACtC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;IAClC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;IACjC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE;IACnD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAC/D,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,mCAAmC,EAAE;CAChE,CAAC;AAEF,2EAA2E;AAC3E,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAEjD,MAAM,MAAM,GAAG,wCAAiB,CAAC,IAAI,CAAS,aAAa,CAAC,CAAC;AAE7D,oBAAoB;AACpB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAW,IAAI;AAC3D,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAiB,qCAAqC;AAC5F,OAAO,CAAC,G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