@realtimex/sdk 2.0.16 → 2.0.18

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.
@@ -1,41 +0,0 @@
1
- // src/v1/errors.ts
2
- var DeveloperApiError = class extends Error {
3
- constructor(status, code, message) {
4
- super(message);
5
- this.status = status;
6
- this.code = code;
7
- this.name = "DeveloperApiError";
8
- }
9
- };
10
- var AuthenticationError = class extends DeveloperApiError {
11
- constructor(message = "Invalid or missing API key") {
12
- super(403, "AUTHENTICATION_ERROR", message);
13
- this.name = "AuthenticationError";
14
- }
15
- };
16
- var NotFoundError = class extends DeveloperApiError {
17
- constructor(message = "Resource not found") {
18
- super(404, "NOT_FOUND", message);
19
- this.name = "NotFoundError";
20
- }
21
- };
22
- var ValidationError = class extends DeveloperApiError {
23
- constructor(message) {
24
- super(400, "VALIDATION_ERROR", message);
25
- this.name = "ValidationError";
26
- }
27
- };
28
- var ServerError = class extends DeveloperApiError {
29
- constructor(message = "Internal server error") {
30
- super(500, "SERVER_ERROR", message);
31
- this.name = "ServerError";
32
- }
33
- };
34
-
35
- export {
36
- DeveloperApiError,
37
- AuthenticationError,
38
- NotFoundError,
39
- ValidationError,
40
- ServerError
41
- };
@@ -1,567 +0,0 @@
1
- import {
2
- AuthenticationError,
3
- DeveloperApiError,
4
- NotFoundError,
5
- ServerError,
6
- ValidationError
7
- } from "./chunk-UPXEAZIT.mjs";
8
-
9
- // src/v1/client.ts
10
- var DeveloperApiClient = class {
11
- constructor(baseUrl, apiKey, appId) {
12
- this.baseUrl = baseUrl.replace(/\/$/, "");
13
- this.apiKey = apiKey;
14
- this.appId = appId;
15
- }
16
- getHeaders(extra) {
17
- const headers = {
18
- "Content-Type": "application/json",
19
- "Authorization": `Bearer ${this.apiKey}`
20
- };
21
- if (this.appId) headers["x-app-id"] = this.appId;
22
- return { ...headers, ...extra };
23
- }
24
- async handleResponse(response) {
25
- let data;
26
- try {
27
- data = await response.json();
28
- } catch {
29
- data = {};
30
- }
31
- if (response.ok) return data;
32
- const message = data?.message || data?.error || response.statusText || "Request failed";
33
- switch (response.status) {
34
- case 400:
35
- throw new ValidationError(message);
36
- case 401:
37
- case 403:
38
- throw new AuthenticationError(message);
39
- case 404:
40
- throw new NotFoundError(message);
41
- case 500:
42
- case 502:
43
- case 503:
44
- throw new ServerError(message);
45
- default:
46
- throw new DeveloperApiError(response.status, "API_ERROR", message);
47
- }
48
- }
49
- /**
50
- * Make a JSON request to the v1 API.
51
- */
52
- async request(method, path, body) {
53
- const url = `${this.baseUrl}/api${path}`;
54
- const response = await fetch(url, {
55
- method,
56
- headers: this.getHeaders(),
57
- body: body !== void 0 ? JSON.stringify(body) : void 0
58
- });
59
- return this.handleResponse(response);
60
- }
61
- /**
62
- * Make a multipart/form-data request (e.g. file uploads).
63
- * Do NOT set Content-Type — browser/fetch will set it with the boundary.
64
- */
65
- async requestMultipart(method, path, form) {
66
- const url = `${this.baseUrl}/api${path}`;
67
- const authHeaders = { "Authorization": `Bearer ${this.apiKey}` };
68
- if (this.appId) authHeaders["x-app-id"] = this.appId;
69
- const response = await fetch(url, {
70
- method,
71
- headers: authHeaders,
72
- body: form
73
- });
74
- return this.handleResponse(response);
75
- }
76
- /**
77
- * Make a raw request and return the Response object directly.
78
- * Used for streaming (SSE) endpoints.
79
- */
80
- async requestRaw(method, path, body) {
81
- const url = `${this.baseUrl}/api${path}`;
82
- return fetch(url, {
83
- method,
84
- headers: this.getHeaders(),
85
- body: body !== void 0 ? JSON.stringify(body) : void 0
86
- });
87
- }
88
- };
89
-
90
- // src/v1/modules/v1Chat.ts
91
- var V1ChatModule = class {
92
- constructor(client) {
93
- this.client = client;
94
- }
95
- /**
96
- * Stream a chat response for a workspace default thread.
97
- * @see POST /v1/workspace/{slug}/stream-chat
98
- */
99
- // @streaming-stub — implement SSE parsing in overrides/v1ChatStreaming.ts
100
- async streamWorkspaceChat(slug, body) {
101
- return this.client.requestRaw("POST", `/v1/workspace/${slug}/stream-chat`, body);
102
- }
103
- /**
104
- * Stream a chat response for a workspace thread.
105
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/stream-chat
106
- */
107
- // @streaming-stub — implement SSE parsing in overrides/v1ChatStreaming.ts
108
- async streamThreadChat(slug, threadSlug, body) {
109
- return this.client.requestRaw("POST", `/v1/workspace/${slug}/thread/${threadSlug}/stream-chat`, body);
110
- }
111
- };
112
-
113
- // src/v1/modules/v1Workspace.ts
114
- var V1WorkspaceModule = class {
115
- constructor(client) {
116
- this.client = client;
117
- }
118
- /**
119
- * List workspaces using the app workspace list behavior.
120
- * @see GET /v1/workspaces
121
- */
122
- async listWorkspaces() {
123
- return this.client.request("GET", `/v1/workspaces`);
124
- }
125
- /**
126
- * Create a workspace using the app workspace creation behavior.
127
- * @see POST /v1/workspace/new
128
- */
129
- async createWorkspace(body) {
130
- return this.client.request("POST", `/v1/workspace/new`, body);
131
- }
132
- /**
133
- * Search workspaces and threads.
134
- * @see POST /v1/workspace/search
135
- */
136
- async searchWorkspaces(body) {
137
- return this.client.request("POST", `/v1/workspace/search`, body);
138
- }
139
- /**
140
- * Get a workspace by slug.
141
- * @see GET /v1/workspace/{slug}
142
- */
143
- async getWorkspace(slug) {
144
- return this.client.request("GET", `/v1/workspace/${slug}`);
145
- }
146
- /**
147
- * Delete a workspace.
148
- * @see DELETE /v1/workspace/{slug}
149
- */
150
- async deleteWorkspace(slug) {
151
- return this.client.request("DELETE", `/v1/workspace/${slug}`);
152
- }
153
- /**
154
- * Get document content for a workspace document.
155
- * @see GET /v1/workspace/{slug}/document/{docPath}
156
- */
157
- async getWorkspaceDocument(slug, docPath) {
158
- return this.client.request("GET", `/v1/workspace/${slug}/document/${docPath}`);
159
- }
160
- /**
161
- * Get or create workspace config.
162
- * @see GET /v1/workspace/{slug}/config
163
- */
164
- async getWorkspaceConfig(slug) {
165
- return this.client.request("GET", `/v1/workspace/${slug}/config`);
166
- }
167
- /**
168
- * Update workspace config.
169
- * @see POST /v1/workspace/{slug}/config
170
- */
171
- async updateWorkspaceConfig(slug, body) {
172
- return this.client.request("POST", `/v1/workspace/${slug}/config`, body);
173
- }
174
- /**
175
- * Update workspace settings by slug.
176
- * @see POST /v1/workspace/{slug}/update
177
- */
178
- async updateWorkspace(slug, body) {
179
- return this.client.request("POST", `/v1/workspace/${slug}/update`, body);
180
- }
181
- /**
182
- * Generate a local LLM tuning suggestion.
183
- * @see POST /v1/workspace/{slug}/local-llm-tuning-suggestion
184
- */
185
- async suggestWorkspaceLocalLlmTuning(slug, body) {
186
- return this.client.request("POST", `/v1/workspace/${slug}/local-llm-tuning-suggestion`, body);
187
- }
188
- /**
189
- * Upload a document to workspace documents.
190
- * @see POST /v1/workspace/{slug}/upload
191
- */
192
- // @upload-stub — multipart upload; wire form manually or use helper
193
- async uploadWorkspaceDocument(slug, form) {
194
- return this.client.requestMultipart("POST", `/v1/workspace/${slug}/upload`, form);
195
- }
196
- /**
197
- * Upload a link to workspace documents.
198
- * @see POST /v1/workspace/{slug}/upload-link
199
- */
200
- async uploadWorkspaceLink(slug, body) {
201
- return this.client.request("POST", `/v1/workspace/${slug}/upload-link`, body);
202
- }
203
- /**
204
- * Update workspace document embeddings.
205
- * @see POST /v1/workspace/{slug}/update-embeddings
206
- */
207
- async updateWorkspaceEmbeddings(slug, body) {
208
- return this.client.request("POST", `/v1/workspace/${slug}/update-embeddings`, body);
209
- }
210
- /**
211
- * Reset workspace vector database records.
212
- * @see DELETE /v1/workspace/{slug}/reset-vector-db
213
- */
214
- async resetWorkspaceVectorDb(slug) {
215
- return this.client.request("DELETE", `/v1/workspace/${slug}/reset-vector-db`);
216
- }
217
- /**
218
- * Get workspace LLM provider metadata.
219
- * @see GET /v1/workspace/{slug}/llm-provider
220
- */
221
- async getWorkspaceLlmProvider(slug) {
222
- return this.client.request("GET", `/v1/workspace/${slug}/llm-provider`);
223
- }
224
- /**
225
- * Get workspace vision availability.
226
- * @see GET /v1/workspace/{slug}/vision-availability
227
- */
228
- async getWorkspaceVisionAvailability(slug) {
229
- return this.client.request("GET", `/v1/workspace/${slug}/vision-availability`);
230
- }
231
- /**
232
- * Get workspace chats.
233
- * @see GET /v1/workspace/{slug}/chats
234
- */
235
- async getWorkspaceChats(slug) {
236
- return this.client.request("GET", `/v1/workspace/${slug}/chats`);
237
- }
238
- /**
239
- * Get workspace terminal session details.
240
- * @see GET /v1/workspace/{slug}/terminal-session-details
241
- */
242
- async getWorkspaceTerminalSessionDetails(slug) {
243
- return this.client.request("GET", `/v1/workspace/${slug}/terminal-session-details`);
244
- }
245
- /**
246
- * Persist terminal UI events.
247
- * @see POST /v1/workspace/{slug}/terminal-ui-events
248
- */
249
- async persistWorkspaceTerminalUiEvents(slug, body) {
250
- return this.client.request("POST", `/v1/workspace/${slug}/terminal-ui-events`, body);
251
- }
252
- /**
253
- * Persist a linked terminal message.
254
- * @see POST /v1/workspace/{slug}/linked-terminal-message
255
- */
256
- async createWorkspaceLinkedTerminalMessage(slug, body) {
257
- return this.client.request("POST", `/v1/workspace/${slug}/linked-terminal-message`, body);
258
- }
259
- /**
260
- * Delete selected workspace chats.
261
- * @see DELETE /v1/workspace/{slug}/delete-chats
262
- */
263
- async deleteWorkspaceChats(slug, body) {
264
- return this.client.request("DELETE", `/v1/workspace/${slug}/delete-chats`, body);
265
- }
266
- /**
267
- * Delete edited workspace chats from a starting id.
268
- * @see DELETE /v1/workspace/{slug}/delete-edited-chats
269
- */
270
- async deleteEditedWorkspaceChats(slug, body) {
271
- return this.client.request("DELETE", `/v1/workspace/${slug}/delete-edited-chats`, body);
272
- }
273
- /**
274
- * Update a workspace chat response.
275
- * @see POST /v1/workspace/{slug}/update-chat
276
- */
277
- async updateWorkspaceChat(slug, body) {
278
- return this.client.request("POST", `/v1/workspace/${slug}/update-chat`, body);
279
- }
280
- /**
281
- * Update workspace chat feedback.
282
- * @see POST /v1/workspace/{slug}/chat-feedback/{chatId}
283
- */
284
- async updateWorkspaceChatFeedback(slug, chatId, body) {
285
- return this.client.request("POST", `/v1/workspace/${slug}/chat-feedback/${chatId}`, body);
286
- }
287
- /**
288
- * Get suggested messages for a workspace.
289
- * @see GET /v1/workspace/{slug}/suggested-messages
290
- */
291
- async getWorkspaceSuggestedMessages(slug) {
292
- return this.client.request("GET", `/v1/workspace/${slug}/suggested-messages`);
293
- }
294
- /**
295
- * Save suggested messages for a workspace.
296
- * @see POST /v1/workspace/{slug}/suggested-messages
297
- */
298
- async saveWorkspaceSuggestedMessages(slug, body) {
299
- return this.client.request("POST", `/v1/workspace/${slug}/suggested-messages`, body);
300
- }
301
- /**
302
- * Update workspace document pin status.
303
- * @see POST /v1/workspace/{slug}/update-pin
304
- */
305
- async updateWorkspaceDocumentPin(slug, body) {
306
- return this.client.request("POST", `/v1/workspace/${slug}/update-pin`, body);
307
- }
308
- /**
309
- * Generate text-to-speech audio for a workspace chat.
310
- * @see GET /v1/workspace/{slug}/tts/{chatId}
311
- */
312
- async getWorkspaceChatTts(slug, chatId) {
313
- return this.client.request("GET", `/v1/workspace/${slug}/tts/${chatId}`);
314
- }
315
- /**
316
- * Get a workspace profile picture.
317
- * @see GET /v1/workspace/{slug}/pfp
318
- */
319
- async getWorkspaceProfilePicture(slug) {
320
- return this.client.request("GET", `/v1/workspace/${slug}/pfp`);
321
- }
322
- /**
323
- * Upload a workspace profile picture.
324
- * @see POST /v1/workspace/{slug}/upload-pfp
325
- */
326
- // @upload-stub — multipart upload; wire form manually or use helper
327
- async uploadWorkspaceProfilePicture(slug, form) {
328
- return this.client.requestMultipart("POST", `/v1/workspace/${slug}/upload-pfp`, form);
329
- }
330
- /**
331
- * Remove a workspace profile picture.
332
- * @see DELETE /v1/workspace/{slug}/remove-pfp
333
- */
334
- async removeWorkspaceProfilePicture(slug) {
335
- return this.client.request("DELETE", `/v1/workspace/${slug}/remove-pfp`);
336
- }
337
- /**
338
- * Fork the workspace default thread.
339
- * @see POST /v1/workspace/{slug}/thread/fork
340
- */
341
- async forkThread(slug, body) {
342
- return this.client.request("POST", `/v1/workspace/${slug}/thread/fork`, body);
343
- }
344
- /**
345
- * Hide a workspace chat.
346
- * @see PUT /v1/workspace/workspace-chats/{id}
347
- */
348
- async hideWorkspaceChat(id) {
349
- return this.client.request("PUT", `/v1/workspace/workspace-chats/${id}`);
350
- }
351
- /**
352
- * Upload and embed a document.
353
- * @see POST /v1/workspace/{slug}/upload-and-embed
354
- */
355
- // @upload-stub — multipart upload; wire form manually or use helper
356
- async uploadAndEmbedWorkspaceDocument(slug, form) {
357
- return this.client.requestMultipart("POST", `/v1/workspace/${slug}/upload-and-embed`, form);
358
- }
359
- /**
360
- * Remove and unembed a document.
361
- * @see DELETE /v1/workspace/{slug}/remove-and-unembed
362
- */
363
- async removeAndUnembedWorkspaceDocument(slug, body) {
364
- return this.client.request("DELETE", `/v1/workspace/${slug}/remove-and-unembed`, body);
365
- }
366
- /**
367
- * Get workspace prompt history.
368
- * @see GET /v1/workspace/{slug}/prompt-history
369
- */
370
- async getWorkspacePromptHistory(slug) {
371
- return this.client.request("GET", `/v1/workspace/${slug}/prompt-history`);
372
- }
373
- /**
374
- * Clear workspace prompt history.
375
- * @see DELETE /v1/workspace/{slug}/prompt-history
376
- */
377
- async deleteWorkspacePromptHistory(slug) {
378
- return this.client.request("DELETE", `/v1/workspace/${slug}/prompt-history`);
379
- }
380
- /**
381
- * Delete a workspace prompt history entry.
382
- * @see DELETE /v1/workspace/{slug}/prompt-history/{id}
383
- */
384
- async deleteWorkspacePromptHistoryEntry(slug, id) {
385
- return this.client.request("DELETE", `/v1/workspace/${slug}/prompt-history/${id}`);
386
- }
387
- /**
388
- * Validate search provider configuration.
389
- * @see POST /v1/workspace/{slug}/search/validate
390
- */
391
- async validateWorkspaceSearchProvider(slug, body) {
392
- return this.client.request("POST", `/v1/workspace/${slug}/search/validate`, body);
393
- }
394
- };
395
-
396
- // src/v1/modules/v1Thread.ts
397
- var V1ThreadModule = class {
398
- constructor(client) {
399
- this.client = client;
400
- }
401
- /**
402
- * Create a workspace thread.
403
- * @see POST /v1/workspace/{slug}/thread/new
404
- */
405
- async createThread(slug) {
406
- return this.client.request("POST", `/v1/workspace/${slug}/thread/new`);
407
- }
408
- /**
409
- * List workspace threads.
410
- * @see GET /v1/workspace/{slug}/threads
411
- */
412
- async listThreads(slug) {
413
- return this.client.request("GET", `/v1/workspace/${slug}/threads`);
414
- }
415
- /**
416
- * Open an SSE stream for workspace thread events.
417
- * @see GET /v1/workspace/{slug}/thread-events
418
- */
419
- async openThreadEventsStream(slug) {
420
- return this.client.request("GET", `/v1/workspace/${slug}/thread-events`);
421
- }
422
- /**
423
- * Get a workspace thread.
424
- * @see GET /v1/workspace/{slug}/thread/{threadSlug}
425
- */
426
- async getThread(slug, threadSlug) {
427
- return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}`);
428
- }
429
- /**
430
- * Delete a workspace thread.
431
- * @see DELETE /v1/workspace/{slug}/thread/{threadSlug}
432
- */
433
- async deleteThread(slug, threadSlug) {
434
- return this.client.request("DELETE", `/v1/workspace/${slug}/thread/${threadSlug}`);
435
- }
436
- /**
437
- * Get thread vision availability.
438
- * @see GET /v1/workspace/{slug}/thread/{threadSlug}/vision-availability
439
- */
440
- async getThreadVisionAvailability(slug, threadSlug) {
441
- return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/vision-availability`);
442
- }
443
- /**
444
- * Promote a thread into a tracked goal.
445
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/goal
446
- */
447
- async createThreadGoal(slug, threadSlug, body) {
448
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/goal`, body);
449
- }
450
- /**
451
- * Draft a terminal goal for a workspace.
452
- * @see POST /v1/workspace/{slug}/terminal-goal-draft
453
- */
454
- async draftWorkspaceTerminalGoal(slug, body) {
455
- return this.client.request("POST", `/v1/workspace/${slug}/terminal-goal-draft`, body);
456
- }
457
- /**
458
- * Create a terminal goal for a workspace.
459
- * @see POST /v1/workspace/{slug}/terminal-goal
460
- */
461
- async createWorkspaceTerminalGoal(slug, body) {
462
- return this.client.request("POST", `/v1/workspace/${slug}/terminal-goal`, body);
463
- }
464
- /**
465
- * Draft a terminal goal for a workspace thread.
466
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-goal-draft
467
- */
468
- async draftThreadTerminalGoal(slug, threadSlug, body) {
469
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-goal-draft`, body);
470
- }
471
- /**
472
- * Create a terminal goal for a workspace thread.
473
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-goal
474
- */
475
- async createThreadTerminalGoal(slug, threadSlug, body) {
476
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-goal`, body);
477
- }
478
- /**
479
- * Bulk delete workspace threads.
480
- * @see DELETE /v1/workspace/{slug}/thread-bulk-delete
481
- */
482
- async bulkDeleteThreads(slug, body) {
483
- return this.client.request("DELETE", `/v1/workspace/${slug}/thread-bulk-delete`, body);
484
- }
485
- /**
486
- * Get workspace thread chats.
487
- * @see GET /v1/workspace/{slug}/thread/{threadSlug}/chats
488
- */
489
- async getThreadChats(slug, threadSlug) {
490
- return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/chats`);
491
- }
492
- /**
493
- * Get thread terminal session details.
494
- * @see GET /v1/workspace/{slug}/thread/{threadSlug}/terminal-session-details
495
- */
496
- async getThreadTerminalSessionDetails(slug, threadSlug) {
497
- return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-session-details`);
498
- }
499
- /**
500
- * Update a workspace thread.
501
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/update
502
- */
503
- async updateThread(slug, threadSlug, body) {
504
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/update`, body);
505
- }
506
- /**
507
- * Delete edited chats from a thread.
508
- * @see DELETE /v1/workspace/{slug}/thread/{threadSlug}/delete-edited-chats
509
- */
510
- async deleteEditedThreadChats(slug, threadSlug, body) {
511
- return this.client.request("DELETE", `/v1/workspace/${slug}/thread/${threadSlug}/delete-edited-chats`, body);
512
- }
513
- /**
514
- * Update a thread chat response.
515
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/update-chat
516
- */
517
- async updateThreadChat(slug, threadSlug, body) {
518
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/update-chat`, body);
519
- }
520
- /**
521
- * Persist terminal UI events for a workspace thread.
522
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-ui-events
523
- */
524
- async persistThreadTerminalUiEvents(slug, threadSlug, body) {
525
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-ui-events`, body);
526
- }
527
- /**
528
- * Persist a linked terminal message for a workspace thread.
529
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/linked-terminal-message
530
- */
531
- async createThreadLinkedTerminalMessage(slug, threadSlug, body) {
532
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/linked-terminal-message`, body);
533
- }
534
- /**
535
- * Coordinate a task into a workspace thread.
536
- * @see POST /v1/workspace/{slug}/thread/coordinate-task
537
- */
538
- async coordinateThreadTask(slug, body) {
539
- return this.client.request("POST", `/v1/workspace/${slug}/thread/coordinate-task`, body);
540
- }
541
- /**
542
- * Open an SSE stream for external workspace thread chat events.
543
- * @see GET /v1/workspace/{slug}/thread/{threadSlug}/chat-stream
544
- */
545
- async openThreadChatStream(slug, threadSlug) {
546
- return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/chat-stream`);
547
- }
548
- };
549
-
550
- // src/v1/namespace.ts
551
- var V1ApiNamespace = class {
552
- // [GENERATED-PROPS-END]
553
- constructor(baseUrl, apiKey, appId) {
554
- this._client = new DeveloperApiClient(baseUrl, apiKey, appId);
555
- this.chat = new V1ChatModule(this._client);
556
- this.workspace = new V1WorkspaceModule(this._client);
557
- this.thread = new V1ThreadModule(this._client);
558
- }
559
- };
560
-
561
- export {
562
- DeveloperApiClient,
563
- V1ChatModule,
564
- V1WorkspaceModule,
565
- V1ThreadModule,
566
- V1ApiNamespace
567
- };
@@ -1,54 +0,0 @@
1
- declare class CliApiClient {
2
- private readonly baseUrl;
3
- private readonly apiKey;
4
- private readonly appId?;
5
- constructor(baseUrl: string, apiKey: string, appId?: string);
6
- private getHeaders;
7
- private handleResponse;
8
- request<T = unknown>(method: string, path: string, body?: unknown): Promise<T>;
9
- }
10
-
11
- interface NameRequest {
12
- name: string;
13
- }
14
- interface CreateThreadRequest {
15
- name?: string;
16
- }
17
- interface WorkspaceDefaultAgentRequest {
18
- canonical: string;
19
- providerId?: string;
20
- modelId?: string;
21
- }
22
- interface SendLlmMessageRequest {
23
- message: string;
24
- chatProvider: string;
25
- chatModel: string;
26
- attachments?: Record<string, unknown>[];
27
- webSearchEnabled?: boolean;
28
- thinkingEffort?: string;
29
- chatTuningConfig?: Record<string, unknown>;
30
- [key: string]: unknown;
31
- }
32
- declare class CliApiNamespace {
33
- /** @internal Shared HTTP client used by all CLI API methods */
34
- readonly _client: CliApiClient;
35
- constructor(baseUrl: string, apiKey: string, appId?: string);
36
- prepare(): Promise<unknown>;
37
- listWorkspaces(): Promise<unknown>;
38
- createWorkspace(body: NameRequest): Promise<unknown>;
39
- getWorkspace(workspaceSlug: string): Promise<unknown>;
40
- renameWorkspace(workspaceSlug: string, body: NameRequest): Promise<unknown>;
41
- deleteWorkspace(workspaceSlug: string): Promise<unknown>;
42
- setWorkspaceDefaultAgent(workspaceSlug: string, body: WorkspaceDefaultAgentRequest): Promise<unknown>;
43
- clearWorkspaceDefaultAgent(workspaceSlug: string): Promise<unknown>;
44
- listThreads(workspaceSlug: string): Promise<unknown>;
45
- createThread(workspaceSlug: string, body?: CreateThreadRequest): Promise<unknown>;
46
- getThread(workspaceSlug: string, threadSlug: string): Promise<unknown>;
47
- renameThread(workspaceSlug: string, threadSlug: string, body: NameRequest): Promise<unknown>;
48
- deleteThread(workspaceSlug: string, threadSlug: string): Promise<unknown>;
49
- sendLlmMessage(workspaceSlug: string, threadSlug: string, body: SendLlmMessageRequest): Promise<unknown>;
50
- listLlmProviders(): Promise<unknown>;
51
- listLlmModels(provider: string): Promise<unknown>;
52
- }
53
-
54
- export { CliApiClient, CliApiNamespace, type CreateThreadRequest, type NameRequest, type SendLlmMessageRequest, type WorkspaceDefaultAgentRequest };