@realtimex/sdk 1.7.21 → 2.0.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 (66) hide show
  1. package/dist/chunk-ORAAYW4C.mjs +271 -0
  2. package/dist/errors-C98IGxYU.d.mts +168 -0
  3. package/dist/errors-C98IGxYU.d.ts +168 -0
  4. package/dist/index.d.mts +8 -2048
  5. package/dist/index.d.ts +8 -2048
  6. package/dist/index.js +168 -4723
  7. package/dist/index.mjs +7 -3783
  8. package/dist/v1/index.d.mts +3 -56
  9. package/dist/v1/index.d.ts +3 -56
  10. package/dist/v1/index.js +2 -756
  11. package/dist/v1/index.mjs +2 -42
  12. package/package.json +6 -7
  13. package/dist/chunk-Z5GAUBIM.mjs +0 -993
  14. package/dist/errors-NufsyIZ-.d.mts +0 -678
  15. package/dist/errors-NufsyIZ-.d.ts +0 -678
  16. package/skills/realtimex-moderator-sdk/SKILL.md +0 -102
  17. package/skills/realtimex-moderator-sdk/references/activities.md +0 -14
  18. package/skills/realtimex-moderator-sdk/references/agents.md +0 -13
  19. package/skills/realtimex-moderator-sdk/references/api-reference/acpagent.md +0 -105
  20. package/skills/realtimex-moderator-sdk/references/api-reference/activities.md +0 -24
  21. package/skills/realtimex-moderator-sdk/references/api-reference/agent.md +0 -27
  22. package/skills/realtimex-moderator-sdk/references/api-reference/api.md +0 -17
  23. package/skills/realtimex-moderator-sdk/references/api-reference/auth.md +0 -36
  24. package/skills/realtimex-moderator-sdk/references/api-reference/contract.md +0 -27
  25. package/skills/realtimex-moderator-sdk/references/api-reference/core.md +0 -40
  26. package/skills/realtimex-moderator-sdk/references/api-reference/database.md +0 -24
  27. package/skills/realtimex-moderator-sdk/references/api-reference/index.md +0 -43
  28. package/skills/realtimex-moderator-sdk/references/api-reference/llm.md +0 -176
  29. package/skills/realtimex-moderator-sdk/references/api-reference/mcp.md +0 -50
  30. package/skills/realtimex-moderator-sdk/references/api-reference/port.md +0 -21
  31. package/skills/realtimex-moderator-sdk/references/api-reference/stt.md +0 -15
  32. package/skills/realtimex-moderator-sdk/references/api-reference/task.md +0 -62
  33. package/skills/realtimex-moderator-sdk/references/api-reference/tts.md +0 -18
  34. package/skills/realtimex-moderator-sdk/references/api-reference/v1-acpauth.md +0 -21
  35. package/skills/realtimex-moderator-sdk/references/api-reference/v1-acpcommands.md +0 -15
  36. package/skills/realtimex-moderator-sdk/references/api-reference/v1-admin.md +0 -48
  37. package/skills/realtimex-moderator-sdk/references/api-reference/v1-auth.md +0 -18
  38. package/skills/realtimex-moderator-sdk/references/api-reference/v1-channels.md +0 -78
  39. package/skills/realtimex-moderator-sdk/references/api-reference/v1-credentials.md +0 -27
  40. package/skills/realtimex-moderator-sdk/references/api-reference/v1-customthemes.md +0 -24
  41. package/skills/realtimex-moderator-sdk/references/api-reference/v1-desktopbrowser.md +0 -39
  42. package/skills/realtimex-moderator-sdk/references/api-reference/v1-desktopembed.md +0 -24
  43. package/skills/realtimex-moderator-sdk/references/api-reference/v1-desktopruntimesessions.md +0 -33
  44. package/skills/realtimex-moderator-sdk/references/api-reference/v1-document.md +0 -39
  45. package/skills/realtimex-moderator-sdk/references/api-reference/v1-embed.md +0 -27
  46. package/skills/realtimex-moderator-sdk/references/api-reference/v1-openai.md +0 -21
  47. package/skills/realtimex-moderator-sdk/references/api-reference/v1-sttapi.md +0 -12
  48. package/skills/realtimex-moderator-sdk/references/api-reference/v1-system.md +0 -36
  49. package/skills/realtimex-moderator-sdk/references/api-reference/v1-thread.md +0 -26
  50. package/skills/realtimex-moderator-sdk/references/api-reference/v1-users.md +0 -15
  51. package/skills/realtimex-moderator-sdk/references/api-reference/v1-workspace.md +0 -39
  52. package/skills/realtimex-moderator-sdk/references/api-reference/webhook.md +0 -13
  53. package/skills/realtimex-moderator-sdk/references/api-reference.md +0 -1330
  54. package/skills/realtimex-moderator-sdk/references/app-concepts.md +0 -1111
  55. package/skills/realtimex-moderator-sdk/references/browser.md +0 -27
  56. package/skills/realtimex-moderator-sdk/references/channels.md +0 -189
  57. package/skills/realtimex-moderator-sdk/references/credentials.md +0 -111
  58. package/skills/realtimex-moderator-sdk/references/known-issues.md +0 -237
  59. package/skills/realtimex-moderator-sdk/references/llm.md +0 -13
  60. package/skills/realtimex-moderator-sdk/references/mcp.md +0 -13
  61. package/skills/realtimex-moderator-sdk/references/permissions.md +0 -30
  62. package/skills/realtimex-moderator-sdk/references/quickstart.md +0 -16
  63. package/skills/realtimex-moderator-sdk/references/terminal-sessions.md +0 -34
  64. package/skills/realtimex-moderator-sdk/references/workspaces.md +0 -20
  65. package/skills/realtimex-moderator-sdk/scripts/lib/sdk-init.js +0 -140
  66. package/skills/realtimex-moderator-sdk/scripts/rtx.js +0 -1359
@@ -1,993 +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
- // src/v1/client.ts
36
- var DeveloperApiClient = class {
37
- constructor(baseUrl, apiKey, appId) {
38
- this.baseUrl = baseUrl.replace(/\/$/, "");
39
- this.apiKey = apiKey;
40
- this.appId = appId;
41
- }
42
- getHeaders(extra) {
43
- const headers = {
44
- "Content-Type": "application/json",
45
- "Authorization": `Bearer ${this.apiKey}`
46
- };
47
- if (this.appId) headers["x-app-id"] = this.appId;
48
- return { ...headers, ...extra };
49
- }
50
- async handleResponse(response) {
51
- let data;
52
- try {
53
- data = await response.json();
54
- } catch {
55
- data = {};
56
- }
57
- if (response.ok) return data;
58
- const message = data?.message || data?.error || response.statusText || "Request failed";
59
- switch (response.status) {
60
- case 400:
61
- throw new ValidationError(message);
62
- case 401:
63
- case 403:
64
- throw new AuthenticationError(message);
65
- case 404:
66
- throw new NotFoundError(message);
67
- case 500:
68
- case 502:
69
- case 503:
70
- throw new ServerError(message);
71
- default:
72
- throw new DeveloperApiError(response.status, "API_ERROR", message);
73
- }
74
- }
75
- /**
76
- * Make a JSON request to the v1 API.
77
- */
78
- async request(method, path, body) {
79
- const url = `${this.baseUrl}/api${path}`;
80
- const response = await fetch(url, {
81
- method,
82
- headers: this.getHeaders(),
83
- body: body !== void 0 ? JSON.stringify(body) : void 0
84
- });
85
- return this.handleResponse(response);
86
- }
87
- /**
88
- * Make a multipart/form-data request (e.g. file uploads).
89
- * Do NOT set Content-Type — browser/fetch will set it with the boundary.
90
- */
91
- async requestMultipart(method, path, form) {
92
- const url = `${this.baseUrl}/api${path}`;
93
- const authHeaders = { "Authorization": `Bearer ${this.apiKey}` };
94
- if (this.appId) authHeaders["x-app-id"] = this.appId;
95
- const response = await fetch(url, {
96
- method,
97
- headers: authHeaders,
98
- body: form
99
- });
100
- return this.handleResponse(response);
101
- }
102
- /**
103
- * Make a raw request and return the Response object directly.
104
- * Used for streaming (SSE) endpoints.
105
- */
106
- async requestRaw(method, path, body) {
107
- const url = `${this.baseUrl}/api${path}`;
108
- return fetch(url, {
109
- method,
110
- headers: this.getHeaders(),
111
- body: body !== void 0 ? JSON.stringify(body) : void 0
112
- });
113
- }
114
- };
115
-
116
- // src/v1/modules/v1Auth.ts
117
- var V1AuthModule = class {
118
- constructor(client) {
119
- this.client = client;
120
- }
121
- /**
122
- * Verify the attached Authentication header contains a valid API token.
123
- * @see GET /v1/auth
124
- */
125
- async getAuth() {
126
- return this.client.request("GET", `/v1/auth`);
127
- }
128
- /**
129
- * Relay external browser auth callbacks back to the local Electron renderer. Localhost only; keyed by OAuth state.
130
- * @see POST /v1/auth/external-callback
131
- */
132
- async externalCallback() {
133
- return this.client.request("POST", `/v1/auth/external-callback`);
134
- }
135
- /**
136
- * Poll for a relayed external browser auth callback by OAuth state. Localhost only.
137
- * @see GET /v1/auth/external-callback/{state}
138
- */
139
- async getExternalCallback(state) {
140
- return this.client.request("GET", `/v1/auth/external-callback/${state}`);
141
- }
142
- };
143
-
144
- // src/v1/modules/v1Admin.ts
145
- var V1AdminModule = class {
146
- constructor(client) {
147
- this.client = client;
148
- }
149
- /**
150
- * Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.
151
- * @see GET /v1/admin/is-multi-user-mode
152
- */
153
- async getIsMultiUserMode() {
154
- return this.client.request("GET", `/v1/admin/is-multi-user-mode`);
155
- }
156
- /**
157
- * Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.
158
- * @see GET /v1/admin/users
159
- */
160
- async listUsers() {
161
- return this.client.request("GET", `/v1/admin/users`);
162
- }
163
- /**
164
- * Create a new user with username and password. Methods are disabled until multi user mode is enabled via the UI.
165
- * @see POST /v1/admin/users/new
166
- */
167
- async createUser(body) {
168
- return this.client.request("POST", `/v1/admin/users/new`, body);
169
- }
170
- /**
171
- * Update existing user settings. Methods are disabled until multi user mode is enabled via the UI.
172
- * @see POST /v1/admin/users/{id}
173
- */
174
- async updateUser(id, body) {
175
- return this.client.request("POST", `/v1/admin/users/${id}`, body);
176
- }
177
- /**
178
- * Delete existing user by id. Methods are disabled until multi user mode is enabled via the UI.
179
- * @see DELETE /v1/admin/users/{id}
180
- */
181
- async deleteUser(id) {
182
- return this.client.request("DELETE", `/v1/admin/users/${id}`);
183
- }
184
- /**
185
- * List all existing invitations to instance regardless of status. Methods are disabled until multi user mode is enabled via the UI.
186
- * @see GET /v1/admin/invites
187
- */
188
- async listInvites() {
189
- return this.client.request("GET", `/v1/admin/invites`);
190
- }
191
- /**
192
- * Create a new invite code for someone to use to register with instance. Methods are disabled until multi user mode is enabled via the UI.
193
- * @see POST /v1/admin/invite/new
194
- */
195
- async createInvite(body) {
196
- return this.client.request("POST", `/v1/admin/invite/new`, body);
197
- }
198
- /**
199
- * Deactivates (soft-delete) invite by id. Methods are disabled until multi user mode is enabled via the UI.
200
- * @see DELETE /v1/admin/invite/{id}
201
- */
202
- async deleteInvite(id) {
203
- return this.client.request("DELETE", `/v1/admin/invite/${id}`);
204
- }
205
- /**
206
- * Retrieve a list of users with permissions to access the specified workspace.
207
- * @see GET /v1/admin/workspaces/{workspaceId}/users
208
- */
209
- async listWorkspaceUsers(workspaceId) {
210
- return this.client.request("GET", `/v1/admin/workspaces/${workspaceId}/users`);
211
- }
212
- /**
213
- * Overwrite workspace permissions to only be accessible by the given user ids and admins. Methods are disabled until multi user mode is enabled via the UI.
214
- * @see POST /v1/admin/workspaces/{workspaceId}/update-users
215
- */
216
- async updateUsers(workspaceId, body) {
217
- return this.client.request("POST", `/v1/admin/workspaces/${workspaceId}/update-users`, body);
218
- }
219
- /**
220
- * Set workspace permissions to be accessible by the given user ids and admins. Methods are disabled until multi user mode is enabled via the UI.
221
- * @see POST /v1/admin/workspaces/{workspaceSlug}/manage-users
222
- */
223
- async workspacesManageUsers(workspaceSlug, body) {
224
- return this.client.request("POST", `/v1/admin/workspaces/${workspaceSlug}/manage-users`, body);
225
- }
226
- /**
227
- * All chats in the system ordered by most recent. Methods are disabled until multi user mode is enabled via the UI.
228
- * @see POST /v1/admin/workspace-chats
229
- */
230
- async workspaceChats(body) {
231
- return this.client.request("POST", `/v1/admin/workspace-chats`, body);
232
- }
233
- /**
234
- * Update multi-user preferences for instance. Methods are disabled until multi user mode is enabled via the UI.
235
- * @see POST /v1/admin/preferences
236
- */
237
- async createPreference(body) {
238
- return this.client.request("POST", `/v1/admin/preferences`, body);
239
- }
240
- };
241
-
242
- // src/v1/modules/v1Document.ts
243
- var V1DocumentModule = class {
244
- constructor(client) {
245
- this.client = client;
246
- }
247
- /**
248
- * Upload a new file to RealTimeX to be parsed and prepared for embedding.
249
- * @see POST /v1/document/upload
250
- */
251
- // @upload-stub — multipart upload; wire form manually or use helper
252
- async upload(form) {
253
- return this.client.requestMultipart("POST", `/v1/document/upload`, form);
254
- }
255
- /**
256
- * Upload a new file to a specific folder in RealTimeX to be parsed and prepared for embedding. If the folder does not exist, it will be created.
257
- * @see POST /v1/document/upload/{folderName}
258
- */
259
- // @upload-stub — multipart upload; wire form manually or use helper
260
- async uploadFolder(folderName, form) {
261
- return this.client.requestMultipart("POST", `/v1/document/upload/${folderName}`, form);
262
- }
263
- /**
264
- * Upload a valid URL for RealTimeX to scrape and prepare for embedding. Optionally, specify a comma-separated list of workspace slugs to embed the document into post-upload.
265
- * @see POST /v1/document/upload-link
266
- */
267
- async uploadLink(body) {
268
- return this.client.request("POST", `/v1/document/upload-link`, body);
269
- }
270
- /**
271
- * Upload a file by specifying its raw text content and metadata values without having to upload a file.
272
- * @see POST /v1/document/raw-text
273
- */
274
- async rawText(body) {
275
- return this.client.request("POST", `/v1/document/raw-text`, body);
276
- }
277
- /**
278
- * List of all locally-stored documents in instance
279
- * @see GET /v1/documents
280
- */
281
- async listDocuments() {
282
- return this.client.request("GET", `/v1/documents`);
283
- }
284
- /**
285
- * Get all documents stored in a specific folder.
286
- * @see GET /v1/documents/folder/{folderName}
287
- */
288
- async getFolder(folderName) {
289
- return this.client.request("GET", `/v1/documents/folder/${folderName}`);
290
- }
291
- /**
292
- * Check available filetypes and MIMEs that can be uploaded.
293
- * @see GET /v1/document/accepted-file-types
294
- */
295
- async listAcceptedFileTypes() {
296
- return this.client.request("GET", `/v1/document/accepted-file-types`);
297
- }
298
- /**
299
- * Get the known available metadata schema for when doing a raw-text upload and the acceptable type of value for each key.
300
- * @see GET /v1/document/metadata-schema
301
- */
302
- async getMetadataSchema() {
303
- return this.client.request("GET", `/v1/document/metadata-schema`);
304
- }
305
- /**
306
- * Get a single document by its unique RealTimeX document name
307
- * @see GET /v1/document/{docName}
308
- */
309
- async getDocument(docName) {
310
- return this.client.request("GET", `/v1/document/${docName}`);
311
- }
312
- /**
313
- * Create a new folder inside the documents storage directory.
314
- * @see POST /v1/document/create-folder
315
- */
316
- async createFolder(body) {
317
- return this.client.request("POST", `/v1/document/create-folder`, body);
318
- }
319
- /**
320
- * Remove a folder and all its contents from the documents storage directory.
321
- * @see DELETE /v1/document/remove-folder
322
- */
323
- async deleteRemoveFolder() {
324
- return this.client.request("DELETE", `/v1/document/remove-folder`);
325
- }
326
- /**
327
- * Move files within the documents storage directory.
328
- * @see POST /v1/document/move-files
329
- */
330
- async moveFiles(body) {
331
- return this.client.request("POST", `/v1/document/move-files`, body);
332
- }
333
- };
334
-
335
- // src/v1/modules/v1Workspace.ts
336
- var V1WorkspaceModule = class {
337
- constructor(client) {
338
- this.client = client;
339
- }
340
- /**
341
- * Create a new workspace
342
- * @see POST /v1/workspace/new
343
- */
344
- async createWorkspace(body) {
345
- return this.client.request("POST", `/v1/workspace/new`, body);
346
- }
347
- /**
348
- * List all current workspaces
349
- * @see GET /v1/workspaces
350
- */
351
- async listWorkspaces() {
352
- return this.client.request("GET", `/v1/workspaces`);
353
- }
354
- /**
355
- * Get a workspace by its unique slug.
356
- * @see GET /v1/workspace/{slug}
357
- */
358
- async getWorkspace(slug) {
359
- return this.client.request("GET", `/v1/workspace/${slug}`);
360
- }
361
- /**
362
- * Deletes a workspace by its slug.
363
- * @see DELETE /v1/workspace/{slug}
364
- */
365
- async deleteWorkspace(slug) {
366
- return this.client.request("DELETE", `/v1/workspace/${slug}`);
367
- }
368
- /**
369
- * Update workspace settings by its unique slug.
370
- * @see POST /v1/workspace/{slug}/update
371
- */
372
- async updateWorkspace(slug, body) {
373
- return this.client.request("POST", `/v1/workspace/${slug}/update`, body);
374
- }
375
- /**
376
- * Get a workspaces chats regardless of user by its unique slug.
377
- * @see GET /v1/workspace/{slug}/chats
378
- */
379
- async listChats(slug) {
380
- return this.client.request("GET", `/v1/workspace/${slug}/chats`);
381
- }
382
- /**
383
- * Add or remove documents from a workspace by its unique slug.
384
- * @see POST /v1/workspace/{slug}/update-embeddings
385
- */
386
- async updateEmbeddings(slug, body) {
387
- return this.client.request("POST", `/v1/workspace/${slug}/update-embeddings`, body);
388
- }
389
- /**
390
- * Add or remove pin from a document in a workspace by its unique slug.
391
- * @see POST /v1/workspace/{slug}/update-pin
392
- */
393
- async updatePin(slug, body) {
394
- return this.client.request("POST", `/v1/workspace/${slug}/update-pin`, body);
395
- }
396
- /**
397
- * Execute a chat with a workspace
398
- * @see POST /v1/workspace/{slug}/chat
399
- */
400
- async chat(slug, body) {
401
- return this.client.request("POST", `/v1/workspace/${slug}/chat`, body);
402
- }
403
- /**
404
- * Execute a streamable chat with a workspace
405
- * @see POST /v1/workspace/{slug}/stream-chat
406
- */
407
- // @streaming-stub — implement SSE parsing in overrides/v1WorkspaceStreaming.ts
408
- async streamChat(slug, body) {
409
- return this.client.requestRaw("POST", `/v1/workspace/${slug}/stream-chat`, body);
410
- }
411
- /**
412
- * Perform a vector similarity search in a workspace
413
- * @see POST /v1/workspace/{slug}/vector-search
414
- */
415
- async vectorSearch(slug, body) {
416
- return this.client.request("POST", `/v1/workspace/${slug}/vector-search`, body);
417
- }
418
- };
419
-
420
- // src/v1/modules/v1System.ts
421
- var V1SystemModule = class {
422
- constructor(client) {
423
- this.client = client;
424
- }
425
- /**
426
- * Dump all settings to file storage
427
- * @see GET /v1/system/env-dump
428
- */
429
- async getEnvDump() {
430
- return this.client.request("GET", `/v1/system/env-dump`);
431
- }
432
- /**
433
- * Get all current system settings that are defined.
434
- * @see GET /v1/system
435
- */
436
- async getSystem() {
437
- return this.client.request("GET", `/v1/system`);
438
- }
439
- /**
440
- * Number of all vectors in connected vector database
441
- * @see GET /v1/system/vector-count
442
- */
443
- async getVectorCount() {
444
- return this.client.request("GET", `/v1/system/vector-count`);
445
- }
446
- /**
447
- * Update a system setting or preference.
448
- * @see POST /v1/system/update-env
449
- */
450
- async updateEnv(body) {
451
- return this.client.request("POST", `/v1/system/update-env`, body);
452
- }
453
- /**
454
- * Export all of the chats from the system in a known format. Output depends on the type sent. Will be send with the correct header for the output.
455
- * @see GET /v1/system/export-chats
456
- */
457
- async listExportChats() {
458
- return this.client.request("GET", `/v1/system/export-chats`);
459
- }
460
- /**
461
- * Permanently remove documents from the system.
462
- * @see DELETE /v1/system/remove-documents
463
- */
464
- async deleteRemoveDocument() {
465
- return this.client.request("DELETE", `/v1/system/remove-documents`);
466
- }
467
- /**
468
- * Returns a health check object with server uptime and version.
469
- * @see GET /v1/system/health
470
- */
471
- async getHealth() {
472
- return this.client.request("GET", `/v1/system/health`);
473
- }
474
- /**
475
- * Returns a health check object with server uptime and version.
476
- * @see GET /v1/system/health-version-2
477
- */
478
- async getHealthVersion2() {
479
- return this.client.request("GET", `/v1/system/health-version-2`);
480
- }
481
- /**
482
- * Returns a health check object with server uptime and version.
483
- * @see GET /v1/system/health-version-3
484
- */
485
- async getHealthVersion3() {
486
- return this.client.request("GET", `/v1/system/health-version-3`);
487
- }
488
- };
489
-
490
- // src/v1/modules/v1Thread.ts
491
- var V1ThreadModule = class {
492
- constructor(client) {
493
- this.client = client;
494
- }
495
- /**
496
- * Create a new workspace thread
497
- * @see POST /v1/workspace/{slug}/thread/new
498
- */
499
- async createThread(slug, body) {
500
- return this.client.request("POST", `/v1/workspace/${slug}/thread/new`, body);
501
- }
502
- /**
503
- * Update thread settings by its unique slug.
504
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/update
505
- */
506
- async updateThread(slug, threadSlug, body) {
507
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/update`, body);
508
- }
509
- /**
510
- * Delete a workspace thread
511
- * @see DELETE /v1/workspace/{slug}/thread/{threadSlug}
512
- */
513
- async deleteThread(slug, threadSlug) {
514
- return this.client.request("DELETE", `/v1/workspace/${slug}/thread/${threadSlug}`);
515
- }
516
- /**
517
- * Get chats for a workspace thread
518
- * @see GET /v1/workspace/{slug}/thread/{threadSlug}/chats
519
- */
520
- async listChats(slug, threadSlug) {
521
- return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/chats`);
522
- }
523
- /**
524
- * Chat with a workspace thread
525
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/chat
526
- */
527
- async chat(slug, threadSlug, body) {
528
- return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/chat`, body);
529
- }
530
- /**
531
- * Stream chat with a workspace thread
532
- * @see POST /v1/workspace/{slug}/thread/{threadSlug}/stream-chat
533
- */
534
- // @streaming-stub — implement SSE parsing in overrides/v1ThreadStreaming.ts
535
- async streamChat(slug, threadSlug, body) {
536
- return this.client.requestRaw("POST", `/v1/workspace/${slug}/thread/${threadSlug}/stream-chat`, body);
537
- }
538
- };
539
-
540
- // src/v1/modules/v1Users.ts
541
- var V1UsersModule = class {
542
- constructor(client) {
543
- this.client = client;
544
- }
545
- /**
546
- * List all users
547
- * @see GET /v1/users
548
- */
549
- async listUsers() {
550
- return this.client.request("GET", `/v1/users`);
551
- }
552
- /**
553
- * Issue a temporary auth token for a user
554
- * @see GET /v1/users/{id}/issue-auth-token
555
- */
556
- async getIssueAuthToken(id) {
557
- return this.client.request("GET", `/v1/users/${id}/issue-auth-token`);
558
- }
559
- };
560
-
561
- // src/v1/modules/v1OpenAI.ts
562
- var V1OpenAIModule = class {
563
- constructor(client) {
564
- this.client = client;
565
- }
566
- /**
567
- * Get all available "models" which are workspaces you can use for chatting.
568
- * @see GET /v1/openai/models
569
- */
570
- async listModels() {
571
- return this.client.request("GET", `/v1/openai/models`);
572
- }
573
- /**
574
- * Execute a chat with a workspace with OpenAI compatibility. Supports streaming as well. Model must be a workspace slug from /models.
575
- * @see POST /v1/openai/chat/completions
576
- */
577
- async chatCompletions(body) {
578
- return this.client.request("POST", `/v1/openai/chat/completions`, body);
579
- }
580
- /**
581
- * Get the embeddings of any arbitrary text string. This will use the embedder provider set in the system. Please ensure the token length of each string fits within the context of your embedder model.
582
- * @see POST /v1/openai/embeddings
583
- */
584
- async createEmbedding(body) {
585
- return this.client.request("POST", `/v1/openai/embeddings`, body);
586
- }
587
- /**
588
- * List all the vector database collections connected to RealTimeX. These are essentially workspaces but return their unique vector db identifier - this is the same as the workspace slug.
589
- * @see GET /v1/openai/vector_stores
590
- */
591
- async listVectorStores() {
592
- return this.client.request("GET", `/v1/openai/vector_stores`);
593
- }
594
- };
595
-
596
- // src/v1/modules/v1Embed.ts
597
- var V1EmbedModule = class {
598
- constructor(client) {
599
- this.client = client;
600
- }
601
- /**
602
- * List all active embeds
603
- * @see GET /v1/embed
604
- */
605
- async getEmbed() {
606
- return this.client.request("GET", `/v1/embed`);
607
- }
608
- /**
609
- * Get all chats for a specific embed
610
- * @see GET /v1/embed/{embedUuid}/chats
611
- */
612
- async listChats(embedUuid) {
613
- return this.client.request("GET", `/v1/embed/${embedUuid}/chats`);
614
- }
615
- /**
616
- * Get chats for a specific embed and session
617
- * @see GET /v1/embed/{embedUuid}/chats/{sessionUuid}
618
- */
619
- async getChat(embedUuid, sessionUuid) {
620
- return this.client.request("GET", `/v1/embed/${embedUuid}/chats/${sessionUuid}`);
621
- }
622
- /**
623
- * Create a new embed configuration
624
- * @see POST /v1/embed/new
625
- */
626
- async createEmbed(body) {
627
- return this.client.request("POST", `/v1/embed/new`, body);
628
- }
629
- /**
630
- * Update an existing embed configuration
631
- * @see POST /v1/embed/{embedUuid}
632
- */
633
- async updateEmbed(embedUuid, body) {
634
- return this.client.request("POST", `/v1/embed/${embedUuid}`, body);
635
- }
636
- /**
637
- * Delete an existing embed configuration
638
- * @see DELETE /v1/embed/{embedUuid}
639
- */
640
- async deleteEmbed(embedUuid) {
641
- return this.client.request("DELETE", `/v1/embed/${embedUuid}`);
642
- }
643
- };
644
-
645
- // src/v1/modules/v1Channels.ts
646
- var V1ChannelsModule = class {
647
- constructor(client) {
648
- this.client = client;
649
- }
650
- /**
651
- * List configured channel plugins without exposing encrypted plugin configuration.
652
- * @see GET /v1/channels/plugins
653
- */
654
- async listPlugins() {
655
- return this.client.request("GET", `/v1/channels/plugins`);
656
- }
657
- /**
658
- * Create a channel plugin. The request may include provider credentials in config, but credentials are never returned.
659
- * @see POST /v1/channels/plugins
660
- */
661
- async createPlugin(body) {
662
- return this.client.request("POST", `/v1/channels/plugins`, body);
663
- }
664
- /**
665
- * Get editable non-secret channel plugin configuration.
666
- * @see GET /v1/channels/plugins/{id}/config
667
- */
668
- async getConfig(id) {
669
- return this.client.request("GET", `/v1/channels/plugins/${id}/config`);
670
- }
671
- /**
672
- * Update a channel plugin. Config values are encrypted before storage.
673
- * @see POST /v1/channels/plugins/{id}/update
674
- */
675
- async updatePlugin(id, body) {
676
- return this.client.request("POST", `/v1/channels/plugins/${id}/update`, body);
677
- }
678
- /**
679
- * Delete a channel plugin and stop any running plugin instance.
680
- * @see DELETE /v1/channels/plugins/{id}
681
- */
682
- async deletePlugin(id) {
683
- return this.client.request("DELETE", `/v1/channels/plugins/${id}`);
684
- }
685
- /**
686
- * Enable and start a channel plugin.
687
- * @see POST /v1/channels/plugins/{id}/start
688
- */
689
- async pluginsStart(id) {
690
- return this.client.request("POST", `/v1/channels/plugins/${id}/start`);
691
- }
692
- /**
693
- * Disable and stop a channel plugin.
694
- * @see POST /v1/channels/plugins/{id}/stop
695
- */
696
- async pluginsStop(id) {
697
- return this.client.request("POST", `/v1/channels/plugins/${id}/stop`);
698
- }
699
- /**
700
- * Test channel provider credentials without saving a plugin.
701
- * @see POST /v1/channels/plugins/test
702
- */
703
- async pluginsTest(body) {
704
- return this.client.request("POST", `/v1/channels/plugins/test`, body);
705
- }
706
- /**
707
- * Get runtime status for all running channel plugins.
708
- * @see GET /v1/channels/status
709
- */
710
- async getStatus() {
711
- return this.client.request("GET", `/v1/channels/status`);
712
- }
713
- /**
714
- * Start a QR login flow for Zalo personal or WhatsApp plugins.
715
- * @see POST /v1/channels/plugins/{id}/qr-login/start
716
- */
717
- async pluginsQrLoginStart(id, body) {
718
- return this.client.request("POST", `/v1/channels/plugins/${id}/qr-login/start`, body);
719
- }
720
- /**
721
- * Poll QR login status for Zalo personal or WhatsApp plugins.
722
- * @see GET /v1/channels/plugins/{id}/qr-login/state
723
- */
724
- async getState(id) {
725
- return this.client.request("GET", `/v1/channels/plugins/${id}/qr-login/state`);
726
- }
727
- /**
728
- * Cancel a QR login flow for Zalo personal or WhatsApp plugins.
729
- * @see POST /v1/channels/plugins/{id}/qr-login/cancel
730
- */
731
- async pluginsQrLoginCancel(id) {
732
- return this.client.request("POST", `/v1/channels/plugins/${id}/qr-login/cancel`);
733
- }
734
- /**
735
- * Log out a QR-authenticated Zalo personal or WhatsApp plugin and clear stored credentials.
736
- * @see POST /v1/channels/plugins/{id}/logout
737
- */
738
- async pluginsLogout(id) {
739
- return this.client.request("POST", `/v1/channels/plugins/${id}/logout`);
740
- }
741
- /**
742
- * Update safe channel policies for Zalo personal or WhatsApp plugins without overwriting credentials.
743
- * @see POST /v1/channels/plugins/{id}/policies
744
- */
745
- async pluginsPolicies(id, body) {
746
- return this.client.request("POST", `/v1/channels/plugins/${id}/policies`, body);
747
- }
748
- /**
749
- * Search a Zalo personal friends directory.
750
- * @see GET /v1/channels/plugins/{id}/directory/friends
751
- */
752
- async listDirectoryFriends(id) {
753
- return this.client.request("GET", `/v1/channels/plugins/${id}/directory/friends`);
754
- }
755
- /**
756
- * Search a Zalo personal groups directory.
757
- * @see GET /v1/channels/plugins/{id}/directory/groups
758
- */
759
- async listDirectoryGroups(id) {
760
- return this.client.request("GET", `/v1/channels/plugins/${id}/directory/groups`);
761
- }
762
- /**
763
- * List pending pairing codes for a channel plugin.
764
- * @see GET /v1/channels/plugins/{id}/pairing-codes
765
- */
766
- async listPluginPairingCodes(id) {
767
- return this.client.request("GET", `/v1/channels/plugins/${id}/pairing-codes`);
768
- }
769
- /**
770
- * Generate a pairing code for a channel plugin.
771
- * @see POST /v1/channels/plugins/{id}/pairing-codes
772
- */
773
- async pluginsPairingCodes(id, body) {
774
- return this.client.request("POST", `/v1/channels/plugins/${id}/pairing-codes`, body);
775
- }
776
- /**
777
- * Approve a channel pairing code.
778
- * @see POST /v1/channels/pairing-codes/{id}/approve
779
- */
780
- async pairingCodesApprove(id) {
781
- return this.client.request("POST", `/v1/channels/pairing-codes/${id}/approve`);
782
- }
783
- /**
784
- * Reject a channel pairing code.
785
- * @see POST /v1/channels/pairing-codes/{id}/reject
786
- */
787
- async pairingCodesReject(id) {
788
- return this.client.request("POST", `/v1/channels/pairing-codes/${id}/reject`);
789
- }
790
- /**
791
- * List channel users for a plugin.
792
- * @see GET /v1/channels/plugins/{id}/users
793
- */
794
- async listPluginUsers(id) {
795
- return this.client.request("GET", `/v1/channels/plugins/${id}/users`);
796
- }
797
- /**
798
- * Set authorization for a channel user.
799
- * @see POST /v1/channels/plugins/{id}/users/{userId}/authorization
800
- */
801
- async pluginsUsersAuthorization(id, userId, body) {
802
- return this.client.request("POST", `/v1/channels/plugins/${id}/users/${userId}/authorization`, body);
803
- }
804
- /**
805
- * Remove a channel user from a plugin.
806
- * @see DELETE /v1/channels/plugins/{id}/users/{userId}
807
- */
808
- async deleteUser(id, userId) {
809
- return this.client.request("DELETE", `/v1/channels/plugins/${id}/users/${userId}`);
810
- }
811
- };
812
-
813
- // src/v1/modules/v1DesktopRuntimeSessions.ts
814
- var V1DesktopRuntimeSessionsModule = class {
815
- constructor(client) {
816
- this.client = client;
817
- }
818
- /**
819
- * Open the shared terminal launcher in the Electron desktop app.
820
- * @see POST /sdk/desktop/runtime-sessions/open-launcher
821
- */
822
- async openLauncher(body) {
823
- return this.client.request("POST", `/sdk/desktop/runtime-sessions/open-launcher`, body);
824
- }
825
- /**
826
- * Launch a local PTY-backed shell terminal in the Electron desktop app.
827
- * @see POST /sdk/desktop/runtime-sessions/launch-terminal-shell
828
- */
829
- async launchTerminalShell(body) {
830
- return this.client.request("POST", `/sdk/desktop/runtime-sessions/launch-terminal-shell`, body);
831
- }
832
- /**
833
- * Launch a local PTY-backed CLI agent terminal in the Electron desktop app.
834
- * @see POST /sdk/desktop/runtime-sessions/launch-terminal-cli-agent
835
- */
836
- async launchTerminalCliAgent(body) {
837
- return this.client.request("POST", `/sdk/desktop/runtime-sessions/launch-terminal-cli-agent`, body);
838
- }
839
- /**
840
- * List desktop PTY-backed runtime sessions currently known to the Electron app.
841
- * @see GET /sdk/desktop/runtime-sessions
842
- */
843
- async listRuntimeSessions() {
844
- return this.client.request("GET", `/sdk/desktop/runtime-sessions`);
845
- }
846
- /**
847
- * Fetch one desktop PTY-backed runtime session by runtime session ID or PTY session ID.
848
- * @see GET /sdk/desktop/runtime-sessions/{sessionId}
849
- */
850
- async getRuntimeSession(sessionId) {
851
- return this.client.request("GET", `/sdk/desktop/runtime-sessions/${sessionId}`);
852
- }
853
- /**
854
- * Close an existing desktop runtime session.
855
- * @see DELETE /sdk/desktop/runtime-sessions/{sessionId}
856
- */
857
- async deleteRuntimeSession(sessionId) {
858
- return this.client.request("DELETE", `/sdk/desktop/runtime-sessions/${sessionId}`);
859
- }
860
- /**
861
- * Write input to an existing desktop runtime session. Use `message` to submit a CLI turn or `input` for raw PTY data.
862
- * @see POST /sdk/desktop/runtime-sessions/{sessionId}/write
863
- */
864
- async write(sessionId, body) {
865
- return this.client.request("POST", `/sdk/desktop/runtime-sessions/${sessionId}/write`, body);
866
- }
867
- /**
868
- * Approve or deny a pending desktop runtime session action.
869
- * @see POST /sdk/desktop/runtime-sessions/{sessionId}/permission
870
- */
871
- async permission(sessionId, body) {
872
- return this.client.request("POST", `/sdk/desktop/runtime-sessions/${sessionId}/permission`, body);
873
- }
874
- };
875
-
876
- // src/v1/modules/v1DesktopBrowser.ts
877
- var V1DesktopBrowserModule = class {
878
- constructor(client) {
879
- this.client = client;
880
- }
881
- /**
882
- * List RealTimeX Browser sessions available in the Electron desktop app.
883
- * @see GET /sdk/desktop/browser/sessions
884
- */
885
- async listSessions() {
886
- return this.client.request("GET", `/sdk/desktop/browser/sessions`);
887
- }
888
- /**
889
- * Create a named RealTimeX Browser session in the Electron desktop app.
890
- * @see POST /sdk/desktop/browser/sessions
891
- */
892
- async createSession(body) {
893
- return this.client.request("POST", `/sdk/desktop/browser/sessions`, body);
894
- }
895
- /**
896
- * Get a specific RealTimeX Browser session by session name.
897
- * @see GET /sdk/desktop/browser/sessions/{sessionName}
898
- */
899
- async getSession(sessionName) {
900
- return this.client.request("GET", `/sdk/desktop/browser/sessions/${sessionName}`);
901
- }
902
- /**
903
- * Delete a named RealTimeX Browser session from the Electron desktop app.
904
- * @see DELETE /sdk/desktop/browser/sessions/{sessionName}
905
- */
906
- async deleteSession(sessionName) {
907
- return this.client.request("DELETE", `/sdk/desktop/browser/sessions/${sessionName}`);
908
- }
909
- /**
910
- * Create a RealTimeX Browser tab, optionally launching the browser session if needed.
911
- * @see POST /sdk/desktop/browser/tabs
912
- */
913
- async createTab(body) {
914
- return this.client.request("POST", `/sdk/desktop/browser/tabs`, body);
915
- }
916
- /**
917
- * Get a RealTimeX Browser tab snapshot by tab reference.
918
- * @see GET /sdk/desktop/browser/tabs/{tabRef}
919
- */
920
- async getTab(tabRef) {
921
- return this.client.request("GET", `/sdk/desktop/browser/tabs/${tabRef}`);
922
- }
923
- /**
924
- * Close an existing RealTimeX Browser tab.
925
- * @see DELETE /sdk/desktop/browser/tabs/{tabRef}
926
- */
927
- async deleteTab(tabRef) {
928
- return this.client.request("DELETE", `/sdk/desktop/browser/tabs/${tabRef}`);
929
- }
930
- /**
931
- * Evaluate JavaScript in a specific RealTimeX Browser tab.
932
- * @see POST /sdk/desktop/browser/tabs/{tabRef}/evaluate
933
- */
934
- async evaluateTab(tabRef, body) {
935
- return this.client.request("POST", `/sdk/desktop/browser/tabs/${tabRef}/evaluate`, body);
936
- }
937
- /**
938
- * Focus an existing RealTimeX Browser tab.
939
- * @see POST /sdk/desktop/browser/tabs/{tabRef}/focus
940
- */
941
- async focusTab(tabRef, body) {
942
- return this.client.request("POST", `/sdk/desktop/browser/tabs/${tabRef}/focus`, body);
943
- }
944
- /**
945
- * Navigate an existing RealTimeX Browser tab to a new URL.
946
- * @see POST /sdk/desktop/browser/tabs/{tabRef}/navigate
947
- */
948
- async navigateTab(tabRef, body) {
949
- return this.client.request("POST", `/sdk/desktop/browser/tabs/${tabRef}/navigate`, body);
950
- }
951
- };
952
-
953
- // src/v1/namespace.ts
954
- var V1ApiNamespace = class {
955
- // [GENERATED-PROPS-END]
956
- constructor(baseUrl, apiKey, appId) {
957
- this._client = new DeveloperApiClient(baseUrl, apiKey, appId);
958
- this.auth = new V1AuthModule(this._client);
959
- this.admin = new V1AdminModule(this._client);
960
- this.document = new V1DocumentModule(this._client);
961
- this.workspace = new V1WorkspaceModule(this._client);
962
- this.system = new V1SystemModule(this._client);
963
- this.thread = new V1ThreadModule(this._client);
964
- this.users = new V1UsersModule(this._client);
965
- this.openai = new V1OpenAIModule(this._client);
966
- this.embed = new V1EmbedModule(this._client);
967
- this.channels = new V1ChannelsModule(this._client);
968
- this.desktopRuntimeSessions = new V1DesktopRuntimeSessionsModule(this._client);
969
- this.desktopBrowser = new V1DesktopBrowserModule(this._client);
970
- }
971
- };
972
-
973
- export {
974
- DeveloperApiError,
975
- AuthenticationError,
976
- NotFoundError,
977
- ValidationError,
978
- ServerError,
979
- DeveloperApiClient,
980
- V1AuthModule,
981
- V1AdminModule,
982
- V1DocumentModule,
983
- V1WorkspaceModule,
984
- V1SystemModule,
985
- V1ThreadModule,
986
- V1UsersModule,
987
- V1OpenAIModule,
988
- V1EmbedModule,
989
- V1ChannelsModule,
990
- V1DesktopRuntimeSessionsModule,
991
- V1DesktopBrowserModule,
992
- V1ApiNamespace
993
- };