@agentuity/server 1.0.1 → 1.0.2

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 (281) hide show
  1. package/AGENTS.md +38 -34
  2. package/dist/api/api.d.ts +32 -2
  3. package/dist/api/api.d.ts.map +1 -1
  4. package/dist/api/api.js +14 -2
  5. package/dist/api/api.js.map +1 -1
  6. package/dist/api/apikey/create.d.ts +12 -2
  7. package/dist/api/apikey/create.d.ts.map +1 -1
  8. package/dist/api/apikey/create.js +2 -2
  9. package/dist/api/apikey/create.js.map +1 -1
  10. package/dist/api/apikey/delete.d.ts +9 -0
  11. package/dist/api/apikey/delete.d.ts.map +1 -1
  12. package/dist/api/apikey/delete.js +1 -1
  13. package/dist/api/apikey/delete.js.map +1 -1
  14. package/dist/api/apikey/get.d.ts +21 -2
  15. package/dist/api/apikey/get.d.ts.map +1 -1
  16. package/dist/api/apikey/get.js +2 -2
  17. package/dist/api/apikey/get.js.map +1 -1
  18. package/dist/api/apikey/index.d.ts +1 -0
  19. package/dist/api/apikey/index.d.ts.map +1 -1
  20. package/dist/api/apikey/index.js +1 -0
  21. package/dist/api/apikey/index.js.map +1 -1
  22. package/dist/api/apikey/list.d.ts +1 -2
  23. package/dist/api/apikey/list.d.ts.map +1 -1
  24. package/dist/api/apikey/list.js +1 -1
  25. package/dist/api/apikey/list.js.map +1 -1
  26. package/dist/api/db/index.d.ts +3 -3
  27. package/dist/api/db/index.d.ts.map +1 -1
  28. package/dist/api/db/index.js +3 -3
  29. package/dist/api/db/index.js.map +1 -1
  30. package/dist/api/db/logs.d.ts +14 -2
  31. package/dist/api/db/logs.d.ts.map +1 -1
  32. package/dist/api/db/logs.js +4 -4
  33. package/dist/api/db/logs.js.map +1 -1
  34. package/dist/api/db/query.d.ts +14 -1
  35. package/dist/api/db/query.d.ts.map +1 -1
  36. package/dist/api/db/query.js +2 -2
  37. package/dist/api/db/query.js.map +1 -1
  38. package/dist/api/db/tables.d.ts +1 -1
  39. package/dist/api/db/tables.d.ts.map +1 -1
  40. package/dist/api/db/tables.js +1 -1
  41. package/dist/api/db/tables.js.map +1 -1
  42. package/dist/api/eval/get.d.ts +1 -2
  43. package/dist/api/eval/get.d.ts.map +1 -1
  44. package/dist/api/eval/get.js +1 -1
  45. package/dist/api/eval/get.js.map +1 -1
  46. package/dist/api/eval/index.d.ts +4 -4
  47. package/dist/api/eval/index.d.ts.map +1 -1
  48. package/dist/api/eval/index.js +4 -4
  49. package/dist/api/eval/index.js.map +1 -1
  50. package/dist/api/eval/list.d.ts +12 -2
  51. package/dist/api/eval/list.d.ts.map +1 -1
  52. package/dist/api/eval/list.js +2 -2
  53. package/dist/api/eval/list.js.map +1 -1
  54. package/dist/api/eval/run-get.d.ts +1 -2
  55. package/dist/api/eval/run-get.d.ts.map +1 -1
  56. package/dist/api/eval/run-get.js +1 -1
  57. package/dist/api/eval/run-get.js.map +1 -1
  58. package/dist/api/eval/run-list.d.ts +18 -2
  59. package/dist/api/eval/run-list.d.ts.map +1 -1
  60. package/dist/api/eval/run-list.js +2 -2
  61. package/dist/api/eval/run-list.js.map +1 -1
  62. package/dist/api/index.d.ts +1 -0
  63. package/dist/api/index.d.ts.map +1 -1
  64. package/dist/api/index.js +1 -0
  65. package/dist/api/index.js.map +1 -1
  66. package/dist/api/machine/machine.d.ts +134 -3
  67. package/dist/api/machine/machine.d.ts.map +1 -1
  68. package/dist/api/machine/machine.js +11 -11
  69. package/dist/api/machine/machine.js.map +1 -1
  70. package/dist/api/org/env-delete.d.ts +10 -3
  71. package/dist/api/org/env-delete.d.ts.map +1 -1
  72. package/dist/api/org/env-delete.js +2 -2
  73. package/dist/api/org/env-delete.js.map +1 -1
  74. package/dist/api/org/env-get.d.ts +14 -1
  75. package/dist/api/org/env-get.d.ts.map +1 -1
  76. package/dist/api/org/env-get.js +2 -2
  77. package/dist/api/org/env-get.js.map +1 -1
  78. package/dist/api/org/env-update.d.ts +10 -3
  79. package/dist/api/org/env-update.d.ts.map +1 -1
  80. package/dist/api/org/env-update.js +2 -2
  81. package/dist/api/org/env-update.js.map +1 -1
  82. package/dist/api/org/list.d.ts +2 -3
  83. package/dist/api/org/list.d.ts.map +1 -1
  84. package/dist/api/org/list.js +2 -2
  85. package/dist/api/org/list.js.map +1 -1
  86. package/dist/api/org/resources.d.ts +4 -5
  87. package/dist/api/org/resources.d.ts.map +1 -1
  88. package/dist/api/org/resources.js +4 -4
  89. package/dist/api/org/resources.js.map +1 -1
  90. package/dist/api/project/agent.d.ts +1 -2
  91. package/dist/api/project/agent.d.ts.map +1 -1
  92. package/dist/api/project/agent.js +1 -1
  93. package/dist/api/project/agent.js.map +1 -1
  94. package/dist/api/project/create.d.ts +3 -3
  95. package/dist/api/project/create.d.ts.map +1 -1
  96. package/dist/api/project/create.js +3 -3
  97. package/dist/api/project/create.js.map +1 -1
  98. package/dist/api/project/delete.d.ts +4 -0
  99. package/dist/api/project/delete.d.ts.map +1 -1
  100. package/dist/api/project/delete.js +1 -1
  101. package/dist/api/project/delete.js.map +1 -1
  102. package/dist/api/project/deploy.d.ts +168 -9
  103. package/dist/api/project/deploy.d.ts.map +1 -1
  104. package/dist/api/project/deploy.js +23 -23
  105. package/dist/api/project/deploy.js.map +1 -1
  106. package/dist/api/project/deployment.d.ts +27 -3
  107. package/dist/api/project/deployment.d.ts.map +1 -1
  108. package/dist/api/project/deployment.js +3 -3
  109. package/dist/api/project/deployment.js.map +1 -1
  110. package/dist/api/project/env-delete.d.ts +2 -2
  111. package/dist/api/project/env-delete.d.ts.map +1 -1
  112. package/dist/api/project/env-delete.js +5 -1
  113. package/dist/api/project/env-delete.js.map +1 -1
  114. package/dist/api/project/env-update.d.ts +2 -2
  115. package/dist/api/project/env-update.d.ts.map +1 -1
  116. package/dist/api/project/env-update.js +1 -1
  117. package/dist/api/project/env-update.js.map +1 -1
  118. package/dist/api/project/exists.d.ts +2 -2
  119. package/dist/api/project/exists.d.ts.map +1 -1
  120. package/dist/api/project/exists.js +1 -1
  121. package/dist/api/project/exists.js.map +1 -1
  122. package/dist/api/project/get.d.ts +3 -3
  123. package/dist/api/project/get.d.ts.map +1 -1
  124. package/dist/api/project/get.js +2 -2
  125. package/dist/api/project/get.js.map +1 -1
  126. package/dist/api/project/list.d.ts +11 -2
  127. package/dist/api/project/list.d.ts.map +1 -1
  128. package/dist/api/project/list.js +4 -3
  129. package/dist/api/project/list.js.map +1 -1
  130. package/dist/api/project/malware.d.ts +14 -7
  131. package/dist/api/project/malware.d.ts.map +1 -1
  132. package/dist/api/project/malware.js +9 -9
  133. package/dist/api/project/malware.js.map +1 -1
  134. package/dist/api/project/update-region.d.ts +4 -0
  135. package/dist/api/project/update-region.d.ts.map +1 -1
  136. package/dist/api/project/update-region.js +1 -1
  137. package/dist/api/project/update-region.js.map +1 -1
  138. package/dist/api/region/create.d.ts +18 -4
  139. package/dist/api/region/create.d.ts.map +1 -1
  140. package/dist/api/region/create.js +5 -5
  141. package/dist/api/region/create.js.map +1 -1
  142. package/dist/api/region/delete.d.ts +17 -4
  143. package/dist/api/region/delete.d.ts.map +1 -1
  144. package/dist/api/region/delete.js +5 -5
  145. package/dist/api/region/delete.js.map +1 -1
  146. package/dist/api/region/list.d.ts +2 -3
  147. package/dist/api/region/list.d.ts.map +1 -1
  148. package/dist/api/region/list.js +2 -2
  149. package/dist/api/region/list.js.map +1 -1
  150. package/dist/api/region/resources.d.ts +2 -3
  151. package/dist/api/region/resources.d.ts.map +1 -1
  152. package/dist/api/region/resources.js +2 -2
  153. package/dist/api/region/resources.js.map +1 -1
  154. package/dist/api/sandbox/cli-list.d.ts +99 -0
  155. package/dist/api/sandbox/cli-list.d.ts.map +1 -0
  156. package/dist/api/sandbox/cli-list.js +63 -0
  157. package/dist/api/sandbox/cli-list.js.map +1 -0
  158. package/dist/api/sandbox/files.d.ts +100 -0
  159. package/dist/api/sandbox/files.d.ts.map +1 -1
  160. package/dist/api/sandbox/files.js +16 -16
  161. package/dist/api/sandbox/files.js.map +1 -1
  162. package/dist/api/sandbox/index.d.ts +5 -1
  163. package/dist/api/sandbox/index.d.ts.map +1 -1
  164. package/dist/api/sandbox/index.js +3 -1
  165. package/dist/api/sandbox/index.js.map +1 -1
  166. package/dist/api/sandbox/resolve.d.ts +52 -0
  167. package/dist/api/sandbox/resolve.d.ts.map +1 -0
  168. package/dist/api/sandbox/resolve.js +71 -0
  169. package/dist/api/sandbox/resolve.js.map +1 -0
  170. package/dist/api/sandbox/run.d.ts.map +1 -1
  171. package/dist/api/sandbox/run.js +6 -0
  172. package/dist/api/sandbox/run.js.map +1 -1
  173. package/dist/api/session/get.d.ts +123 -8
  174. package/dist/api/session/get.d.ts.map +1 -1
  175. package/dist/api/session/get.js +8 -8
  176. package/dist/api/session/get.js.map +1 -1
  177. package/dist/api/session/index.d.ts +3 -6
  178. package/dist/api/session/index.d.ts.map +1 -1
  179. package/dist/api/session/index.js +3 -3
  180. package/dist/api/session/index.js.map +1 -1
  181. package/dist/api/session/list.d.ts +2 -2
  182. package/dist/api/session/list.d.ts.map +1 -1
  183. package/dist/api/session/list.js +2 -2
  184. package/dist/api/session/list.js.map +1 -1
  185. package/dist/api/session/logs.d.ts +19 -2
  186. package/dist/api/session/logs.d.ts.map +1 -1
  187. package/dist/api/session/logs.js +4 -4
  188. package/dist/api/session/logs.js.map +1 -1
  189. package/dist/api/stream/get.d.ts +59 -0
  190. package/dist/api/stream/get.d.ts.map +1 -0
  191. package/dist/api/stream/get.js +40 -0
  192. package/dist/api/stream/get.js.map +1 -0
  193. package/dist/api/stream/index.d.ts +4 -0
  194. package/dist/api/stream/index.d.ts.map +1 -0
  195. package/dist/api/stream/index.js +4 -0
  196. package/dist/api/stream/index.js.map +1 -0
  197. package/dist/api/stream/list.d.ts +108 -0
  198. package/dist/api/stream/list.d.ts.map +1 -0
  199. package/dist/api/stream/list.js +71 -0
  200. package/dist/api/stream/list.js.map +1 -0
  201. package/dist/api/stream/util.d.ts +23 -0
  202. package/dist/api/stream/util.d.ts.map +1 -0
  203. package/dist/api/stream/util.js +3 -0
  204. package/dist/api/stream/util.js.map +1 -0
  205. package/dist/api/thread/delete.d.ts +10 -3
  206. package/dist/api/thread/delete.d.ts.map +1 -1
  207. package/dist/api/thread/delete.js +2 -2
  208. package/dist/api/thread/delete.js.map +1 -1
  209. package/dist/api/thread/get.d.ts +23 -5
  210. package/dist/api/thread/get.d.ts.map +1 -1
  211. package/dist/api/thread/get.js +2 -2
  212. package/dist/api/thread/get.js.map +1 -1
  213. package/dist/api/thread/index.d.ts +4 -4
  214. package/dist/api/thread/index.d.ts.map +1 -1
  215. package/dist/api/thread/index.js +4 -4
  216. package/dist/api/thread/index.js.map +1 -1
  217. package/dist/api/thread/list.d.ts +4 -5
  218. package/dist/api/thread/list.d.ts.map +1 -1
  219. package/dist/api/thread/list.js +3 -4
  220. package/dist/api/thread/list.js.map +1 -1
  221. package/dist/api/user/whoami.d.ts +6 -3
  222. package/dist/api/user/whoami.d.ts.map +1 -1
  223. package/dist/api/user/whoami.js +3 -3
  224. package/dist/api/user/whoami.js.map +1 -1
  225. package/package.json +4 -4
  226. package/src/api/api.ts +23 -2
  227. package/src/api/apikey/create.ts +2 -2
  228. package/src/api/apikey/delete.ts +1 -1
  229. package/src/api/apikey/get.ts +2 -2
  230. package/src/api/apikey/index.ts +1 -0
  231. package/src/api/apikey/list.ts +1 -1
  232. package/src/api/db/index.ts +17 -2
  233. package/src/api/db/logs.ts +6 -6
  234. package/src/api/db/query.ts +2 -2
  235. package/src/api/db/tables.ts +1 -1
  236. package/src/api/eval/get.ts +1 -1
  237. package/src/api/eval/index.ts +16 -4
  238. package/src/api/eval/list.ts +2 -2
  239. package/src/api/eval/run-get.ts +1 -1
  240. package/src/api/eval/run-list.ts +2 -2
  241. package/src/api/index.ts +1 -0
  242. package/src/api/machine/machine.ts +15 -11
  243. package/src/api/org/env-delete.ts +4 -4
  244. package/src/api/org/env-get.ts +3 -3
  245. package/src/api/org/env-update.ts +4 -4
  246. package/src/api/org/list.ts +2 -2
  247. package/src/api/org/resources.ts +4 -4
  248. package/src/api/project/agent.ts +1 -1
  249. package/src/api/project/create.ts +4 -4
  250. package/src/api/project/delete.ts +1 -1
  251. package/src/api/project/deploy.ts +32 -32
  252. package/src/api/project/deployment.ts +3 -3
  253. package/src/api/project/env-delete.ts +10 -6
  254. package/src/api/project/env-update.ts +2 -2
  255. package/src/api/project/exists.ts +2 -2
  256. package/src/api/project/get.ts +3 -3
  257. package/src/api/project/list.ts +13 -13
  258. package/src/api/project/malware.ts +12 -12
  259. package/src/api/project/update-region.ts +1 -1
  260. package/src/api/region/create.ts +5 -5
  261. package/src/api/region/delete.ts +5 -5
  262. package/src/api/region/list.ts +2 -2
  263. package/src/api/region/resources.ts +2 -2
  264. package/src/api/sandbox/cli-list.ts +99 -0
  265. package/src/api/sandbox/files.ts +16 -16
  266. package/src/api/sandbox/index.ts +21 -0
  267. package/src/api/sandbox/resolve.ts +98 -0
  268. package/src/api/sandbox/run.ts +6 -1
  269. package/src/api/session/get.ts +13 -13
  270. package/src/api/session/index.ts +3 -6
  271. package/src/api/session/list.ts +2 -2
  272. package/src/api/session/logs.ts +4 -4
  273. package/src/api/stream/get.ts +51 -0
  274. package/src/api/stream/index.ts +3 -0
  275. package/src/api/stream/list.ts +111 -0
  276. package/src/api/stream/util.ts +3 -0
  277. package/src/api/thread/delete.ts +4 -4
  278. package/src/api/thread/get.ts +5 -7
  279. package/src/api/thread/index.ts +4 -4
  280. package/src/api/thread/list.ts +4 -6
  281. package/src/api/user/whoami.ts +3 -3
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ import { APIClient, APIResponseSchema } from '../api';
3
+ import { StreamResponseError } from './util';
4
+
5
+ const StreamDetailSchema = z.object({
6
+ id: z.string().describe('the stream id'),
7
+ namespace: z.string().describe('the stream namespace'),
8
+ metadata: z.record(z.string(), z.string()).describe('stream metadata'),
9
+ url: z.string().describe('public URL to access the stream'),
10
+ sizeBytes: z.number().describe('size in bytes'),
11
+ createdAt: z.string().nullable().describe('ISO 8601 creation timestamp'),
12
+ updatedAt: z.string().nullable().describe('ISO 8601 last update timestamp'),
13
+ startedAt: z.string().nullable().describe('ISO 8601 stream start timestamp'),
14
+ endedAt: z.string().nullable().describe('ISO 8601 stream end timestamp'),
15
+ expiresAt: z.string().nullable().describe('ISO 8601 expiration timestamp or null'),
16
+ orgId: z.string().describe('the organization id'),
17
+ projectId: z.string().nullable().describe('the project id'),
18
+ completed: z.boolean().describe('whether the stream upload is completed'),
19
+ headers: z.record(z.string(), z.string()).describe('stream headers'),
20
+ chunks: z.number().describe('number of chunks'),
21
+ });
22
+
23
+ const StreamDetailResponseSchema = APIResponseSchema(StreamDetailSchema);
24
+
25
+ export type StreamDetailResponse = z.infer<typeof StreamDetailResponseSchema>;
26
+ export type StreamDetail = z.infer<typeof StreamDetailSchema>;
27
+
28
+ /**
29
+ * Get a specific stream by ID.
30
+ *
31
+ * @param client - The API client
32
+ * @param id - The stream ID
33
+ * @returns A promise that resolves to the stream details
34
+ *
35
+ * @example
36
+ * const stream = await streamGet(client, 'stream_abc123');
37
+ * console.log(`Namespace: ${stream.namespace}, Size: ${stream.sizeBytes} bytes`);
38
+ */
39
+ export async function streamGet(client: APIClient, id: string): Promise<StreamDetail> {
40
+ const resp = await client.request<StreamDetailResponse>(
41
+ 'GET',
42
+ `/cli/stream/${encodeURIComponent(id)}`,
43
+ StreamDetailResponseSchema
44
+ );
45
+
46
+ if (resp.success) {
47
+ return resp.data;
48
+ }
49
+
50
+ throw new StreamResponseError({ message: resp.message });
51
+ }
@@ -0,0 +1,3 @@
1
+ export * from './get';
2
+ export * from './list';
3
+ export * from './util';
@@ -0,0 +1,111 @@
1
+ import { z } from 'zod';
2
+ import { APIClient, APIResponseSchema } from '../api';
3
+ import { StreamResponseError } from './util';
4
+
5
+ const StreamInfoSchema = z.object({
6
+ id: z.string().describe('the stream id'),
7
+ namespace: z.string().describe('the stream namespace'),
8
+ metadata: z.record(z.string(), z.string()).describe('stream metadata'),
9
+ url: z.string().describe('public URL to access the stream'),
10
+ sizeBytes: z.number().describe('size in bytes'),
11
+ expiresAt: z.string().nullable().describe('ISO 8601 expiration timestamp or null'),
12
+ orgId: z.string().describe('the organization id'),
13
+ projectId: z.string().nullable().describe('the project id'),
14
+ projectName: z.string().nullable().describe('the project name'),
15
+ });
16
+
17
+ const StreamListDataSchema = z.object({
18
+ streams: z.array(StreamInfoSchema).describe('list of streams'),
19
+ total: z.number().describe('total count of matching streams'),
20
+ });
21
+
22
+ const StreamListResponseSchema = APIResponseSchema(StreamListDataSchema);
23
+
24
+ export type StreamListResponse = z.infer<typeof StreamListResponseSchema>;
25
+ export type StreamListData = z.infer<typeof StreamListDataSchema>;
26
+ export type StreamInfo = z.infer<typeof StreamInfoSchema>;
27
+
28
+ export interface StreamListOptions {
29
+ /**
30
+ * Filter by specific project ID
31
+ */
32
+ projectId?: string;
33
+ /**
34
+ * Filter by specific organization ID
35
+ */
36
+ orgId?: string;
37
+ /**
38
+ * Filter by stream namespace
39
+ */
40
+ namespace?: string;
41
+ /**
42
+ * Maximum number of streams to return (default: 100, max: 1000)
43
+ */
44
+ limit?: number;
45
+ /**
46
+ * Number of streams to skip for pagination
47
+ */
48
+ offset?: number;
49
+ /**
50
+ * Filter by metadata key-value pairs
51
+ */
52
+ metadata?: Record<string, string>;
53
+ }
54
+
55
+ /**
56
+ * List streams with optional filtering.
57
+ *
58
+ * If no projectId or orgId is provided, returns streams from all orgs the user is a member of.
59
+ *
60
+ * @param client - The API client
61
+ * @param options - Filtering and pagination options
62
+ * @returns A promise that resolves to the list of streams with metadata
63
+ *
64
+ * @example
65
+ * // List all streams across all orgs
66
+ * const result = await streamList(client);
67
+ * console.log(`Found ${result.total} streams`);
68
+ *
69
+ * @example
70
+ * // List streams for a specific project
71
+ * const result = await streamList(client, { projectId: 'proj_123' });
72
+ *
73
+ * @example
74
+ * // List streams with namespace filter
75
+ * const result = await streamList(client, { namespace: 'agent-logs' });
76
+ *
77
+ * @example
78
+ * // List streams with metadata filter
79
+ * const result = await streamList(client, {
80
+ * metadata: { type: 'export', env: 'production' }
81
+ * });
82
+ */
83
+ export async function streamList(
84
+ client: APIClient,
85
+ options: StreamListOptions = {}
86
+ ): Promise<StreamListData> {
87
+ const { projectId, orgId, namespace, limit, offset, metadata } = options;
88
+ const params = new URLSearchParams();
89
+
90
+ if (projectId) params.set('projectId', projectId);
91
+ if (orgId) params.set('orgId', orgId);
92
+ if (namespace) params.set('namespace', namespace);
93
+ if (limit !== undefined) params.set('limit', limit.toString());
94
+ if (offset !== undefined) params.set('offset', offset.toString());
95
+ if (metadata && Object.keys(metadata).length > 0) {
96
+ params.set('metadata', JSON.stringify(metadata));
97
+ }
98
+
99
+ const queryString = params.toString();
100
+ const resp = await client.request<StreamListResponse>(
101
+ 'GET',
102
+ `/cli/stream${queryString ? `?${queryString}` : ''}`,
103
+ StreamListResponseSchema
104
+ );
105
+
106
+ if (resp.success) {
107
+ return resp.data;
108
+ }
109
+
110
+ throw new StreamResponseError({ message: resp.message });
111
+ }
@@ -0,0 +1,3 @@
1
+ import { StructuredError } from '@agentuity/core';
2
+
3
+ export const StreamResponseError = StructuredError('StreamResponseError');
@@ -2,14 +2,14 @@ import { z } from 'zod';
2
2
  import { APIClient, APIResponseSchemaNoData } from '../api';
3
3
  import { ThreadResponseError } from './util';
4
4
 
5
- const _ThreadDeleteRequestSchema = z.object({
5
+ export const _ThreadDeleteRequestSchema = z.object({
6
6
  id: z.string().describe('the thread id'),
7
7
  });
8
8
 
9
- const ThreadDeleteResponseSchema = APIResponseSchemaNoData();
9
+ export const ThreadDeleteResponseSchema = APIResponseSchemaNoData();
10
10
 
11
- type ThreadDeleteRequest = z.infer<typeof _ThreadDeleteRequestSchema>;
12
- type ThreadDeleteResponse = z.infer<typeof ThreadDeleteResponseSchema>;
11
+ export type ThreadDeleteRequest = z.infer<typeof _ThreadDeleteRequestSchema>;
12
+ export type ThreadDeleteResponse = z.infer<typeof ThreadDeleteResponseSchema>;
13
13
 
14
14
  /**
15
15
  * Delete a thread by id
@@ -1,18 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  import { APIClient, APIResponseSchema } from '../api';
3
- import { ThreadSchema } from './list';
3
+ import { ThreadSchema, type Thread } from './list';
4
4
  import { ThreadResponseError } from './util';
5
5
 
6
- const _ThreadGetRequestSchema = z.object({
6
+ export const _ThreadGetRequestSchema = z.object({
7
7
  id: z.string().describe('the thread id'),
8
8
  });
9
9
 
10
- const ThreadGetResponseSchema = APIResponseSchema(ThreadSchema);
10
+ export const ThreadGetResponseSchema = APIResponseSchema(ThreadSchema);
11
11
 
12
- type ThreadGetRequest = z.infer<typeof _ThreadGetRequestSchema>;
13
- type ThreadGetResponse = z.infer<typeof ThreadGetResponseSchema>;
14
-
15
- export type Thread = z.infer<typeof ThreadSchema>;
12
+ export type ThreadGetRequest = z.infer<typeof _ThreadGetRequestSchema>;
13
+ export type ThreadGetResponse = z.infer<typeof ThreadGetResponseSchema>;
16
14
 
17
15
  /**
18
16
  * Get a single thread by id
@@ -1,4 +1,4 @@
1
- export { threadGet, type Thread } from './get';
2
- export { threadList, type ThreadList, type ThreadListOptions, ThreadSchema } from './list';
3
- export { threadDelete } from './delete';
4
- export { ThreadResponseError } from './util';
1
+ export * from './get';
2
+ export * from './list';
3
+ export * from './delete';
4
+ export * from './util';
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { APIClient, APIResponseSchema } from '../api';
3
3
  import { ThreadResponseError } from './util';
4
4
 
5
- const ThreadSchema = z.object({
5
+ export const ThreadSchema = z.object({
6
6
  id: z.string().describe('the thread id'),
7
7
  created_at: z.string().describe('the creation timestamp'),
8
8
  updated_at: z.string().describe('the last update timestamp'),
@@ -19,14 +19,12 @@ const ThreadSchema = z.object({
19
19
  .describe('unencrypted key-value metadata'),
20
20
  });
21
21
 
22
- export { ThreadSchema };
22
+ export const ThreadListResponseData = z.array(ThreadSchema);
23
23
 
24
- const ThreadListResponse = z.array(ThreadSchema);
25
-
26
- const ThreadListResponseSchema = APIResponseSchema(ThreadListResponse);
24
+ export const ThreadListResponseSchema = APIResponseSchema(ThreadListResponseData);
27
25
 
28
26
  export type ThreadListResponse = z.infer<typeof ThreadListResponseSchema>;
29
- export type ThreadList = z.infer<typeof ThreadListResponse>;
27
+ export type ThreadList = z.infer<typeof ThreadListResponseData>;
30
28
  export type Thread = z.infer<typeof ThreadSchema>;
31
29
 
32
30
  export interface ThreadListOptions {
@@ -2,17 +2,17 @@ import { z } from 'zod';
2
2
  import { APIResponseSchema, APIClient } from '../api';
3
3
  import { UserResponseError } from './util';
4
4
 
5
- const OrganizationSchema = z.object({
5
+ export const OrganizationSchema = z.object({
6
6
  id: z.string().describe('the unique id for the organization'),
7
7
  name: z.string().describe('the name of the organization'),
8
8
  });
9
9
 
10
- const WhoamiResponse = z.object({
10
+ export const WhoamiResponse = z.object({
11
11
  firstName: z.string().describe('the first name of the user'),
12
12
  lastName: z.string().describe('the last name of the user'),
13
13
  organizations: z.array(OrganizationSchema).describe('the organizations the user is a member of'),
14
14
  });
15
- const WhoamiResponseSchema = APIResponseSchema(WhoamiResponse);
15
+ export const WhoamiResponseSchema = APIResponseSchema(WhoamiResponse);
16
16
 
17
17
  export type WhoamiResponse = z.infer<typeof WhoamiResponseSchema>;
18
18
  export type User = z.infer<typeof WhoamiResponse>;