@realtimex/sdk 1.7.28 → 2.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 (66) hide show
  1. package/dist/chunk-DZUAP6FW.mjs +598 -0
  2. package/dist/errors-DwEt8WYf.d.mts +399 -0
  3. package/dist/errors-DwEt8WYf.d.ts +399 -0
  4. package/dist/index.d.mts +8 -2048
  5. package/dist/index.d.ts +8 -2048
  6. package/dist/index.js +308 -4537
  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 +255 -681
  11. package/dist/v1/index.mjs +4 -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 -1276
  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 -171
  66. package/skills/realtimex-moderator-sdk/scripts/rtx.js +0 -1359
@@ -1,1330 +0,0 @@
1
- # RealTimeX SDK — API Reference
2
-
3
- > Auto-generated from `@realtimex/sdk` source · v**1.7.28** · 2026-06-02
4
-
5
- **Package:** `@realtimex/sdk` (CJS) · **Server:** `http://localhost:3001`
6
- **Developer Mode auth:** `Authorization: Bearer <apiKey>`
7
-
8
- ---
9
-
10
- ## Available Permissions
11
-
12
- | Permission | Grants access to |
13
- |------------|------------------|
14
- | `api.agents` | `sdk.api.getAgents()` |
15
- | `api.workspaces` | `sdk.api.getWorkspaces()` |
16
- | `api.threads` | `sdk.api.getThreads()` |
17
- | `api.task` | `sdk.api.getTask()` |
18
- | `webhook.trigger` | webhook trigger, task events |
19
- | `activities.read` | `sdk.activities.list/get()` |
20
- | `activities.write` | `sdk.activities.insert/update/delete()` |
21
- | `llm.chat` | `sdk.llm.chat/chatStream()` |
22
- | `llm.embed` | `sdk.llm.embed()` |
23
- | `llm.providers` | `sdk.llm.chatProviders/embedProviders()` |
24
- | `vectors.read` | `sdk.llm.vectors.query/listWorkspaces()` |
25
- | `vectors.write` | `sdk.llm.vectors.upsert/delete()` |
26
- | `tts.generate` | `sdk.tts.speak/speakStream()` |
27
- | `mcp.servers` | `sdk.mcp.getServers()` |
28
- | `mcp.tools` | `sdk.mcp.getTools/executeTool()` |
29
- | `acp.agent` | `sdk.acpAgent.*` |
30
- | `desktop.runtime-sessions` | `sdk.desktopRuntimeSessions.*` |
31
- | `desktop.browser` | `sdk.desktopBrowser.*` |
32
-
33
- ---
34
-
35
- ## sdk.desktopRuntimeSessions — Desktop Terminal Sessions
36
-
37
- Use this module for visible Electron terminal sessions. This is the correct path for:
38
- - launching a shell terminal
39
- - launching Claude/Gemini/Qwen in a terminal
40
- - listing existing terminal sessions
41
- - sending more input to an existing terminal
42
- - approving terminal prompts
43
- - closing a terminal session
44
-
45
- Do not use ACP for these unless the user explicitly asks for ACP/headless mode.
46
- If the current process was spawned by RealtimeX, prefer `process.env.RTX_WORKSPACE_SLUG` and `process.env.RTX_THREAD_SLUG` as default context before guessing or asking the user.
47
- Always resolve current workspace/thread context first when a terminal action needs it: explicit user input > spawned-process env > list workspaces/threads > ask user if still ambiguous.
48
-
49
- ### `V1DesktopRuntimeSessionsModule`
50
-
51
- ```ts
52
- async openLauncher(body?: { workspaceSlug?: string; threadSlug?: string; presentationMode?: 'panel' | 'tab'; preferredAgentName?: string; preferredAgentProviderId?: string; }): Promise<unknown>
53
- async launchTerminalShell(body?: { workspaceSlug?: string; threadSlug?: string; presentationMode?: 'panel' | 'tab'; title?: string; subtitle?: string; initialCommand?: string; initialCommandMode?: 'direct' | 'prefill' | 'shell'; }): Promise<unknown>
54
- async launchTerminalCliAgent(body?: { workspaceSlug?: string; threadSlug?: string; agentName: string; providerId?: string; modelId?: string; presentationMode?: 'panel' | 'tab'; message?: string; }): Promise<unknown>
55
- async listRuntimeSessions(): Promise<unknown>
56
- async getRuntimeSession(sessionId: string): Promise<unknown>
57
- async write(sessionId: string, body?: { message?: string; input?: string; }): Promise<unknown>
58
- async permission(sessionId: string, body?: { outcome: 'approved' | 'denied'; actionId?: string; requestId?: string; optionId?: string; optionLabel?: string; input?: string; reason?: string; }): Promise<unknown>
59
- async deleteRuntimeSession(sessionId: string): Promise<unknown>
60
- ```
61
-
62
- ### Correct examples
63
-
64
- Launch Claude in a terminal:
65
-
66
- ```js
67
- await sdk.desktopRuntimeSessions.launchTerminalCliAgent({
68
- workspaceSlug: 'agent-heartbeat',
69
- threadSlug: 'ambient-agent-week-agent-heartbeat-2026-w17',
70
- agentName: 'claude',
71
- providerId: 'claude-cli',
72
- presentationMode: 'panel',
73
- message: 'what is current working dir'
74
- });
75
- ```
76
-
77
- Launch a shell and run `pwd`:
78
-
79
- ```js
80
- await sdk.desktopRuntimeSessions.launchTerminalShell({
81
- workspaceSlug: 'agent-heartbeat',
82
- threadSlug: 'ambient-agent-week-agent-heartbeat-2026-w17',
83
- presentationMode: 'panel',
84
- initialCommand: 'pwd',
85
- initialCommandMode: 'direct'
86
- });
87
- ```
88
-
89
- Default rule: when launching a shell with an initial command, prefer `initialCommandMode: 'direct'` unless the user explicitly wants prefill-only behavior.
90
-
91
- Common mistake:
92
-
93
- ```js
94
- // ❌ WRONG
95
- await sdk.desktopRuntimeSessions.launchTerminalCliAgent({
96
- agentName: 'claude-cli'
97
- });
98
-
99
- // ✅ CORRECT
100
- await sdk.desktopRuntimeSessions.launchTerminalCliAgent({
101
- agentName: 'claude',
102
- providerId: 'claude-cli'
103
- });
104
- ```
105
-
106
- Compatibility: `sdk.v1.desktopRuntimeSessions` remains available, but prefer the top-level alias.
107
-
108
- ---
109
-
110
- ## sdk.desktopBrowser — RealTimeX Browser
111
-
112
- Use this module for the managed RealTimeX Browser control plane. This is the correct path for:
113
- - listing named browser sessions
114
- - creating a named browser session
115
- - opening the initial URL for a new browser session
116
- - reading/evaluating/focusing/navigating/closing managed browser tabs
117
-
118
- Do not use ACP for these unless the user explicitly asks for ACP browser handoff behavior.
119
- Do not use desktop terminal sessions for browser tabs.
120
- For page interaction and automation after the session is running, prefer the `agent-browser` skill against the session's CDP port.
121
- If the user needs a different URL, create a new browser session first instead of relying on opening another managed tab.
122
-
123
- ### `V1DesktopBrowserModule`
124
-
125
- ```ts
126
- async listSessions(): Promise<unknown>
127
- async createSession(body: { sessionName: string; remoteDebugPort?: number; }): Promise<unknown>
128
- async getSession(sessionName: string): Promise<unknown>
129
- async deleteSession(sessionName: string): Promise<unknown>
130
- async createTab(body: { sessionName?: string; url: string; focus?: boolean; focusWindow?: boolean; }): Promise<unknown>
131
- async getTab(tabRef: string): Promise<unknown>
132
- async evaluateTab(tabRef: string, body: { expression: string; userGesture?: boolean; }): Promise<unknown>
133
- async focusTab(tabRef: string, body?: { focusWindow?: boolean; }): Promise<unknown>
134
- async navigateTab(tabRef: string, body: { url: string; focus?: boolean; focusWindow?: boolean; }): Promise<unknown>
135
- async deleteTab(tabRef: string): Promise<unknown>
136
- ```
137
-
138
- ### Correct examples
139
-
140
- ```js
141
- await sdk.desktopBrowser.createSession({
142
- sessionName: 'github-review'
143
- });
144
-
145
- await sdk.desktopBrowser.createTab({
146
- sessionName: 'github-review',
147
- url: 'https://example.com'
148
- });
149
-
150
- const session = await sdk.desktopBrowser.getSession('github-review');
151
- const port = session?.session?.remoteDebugPort || session?.runtime?.remoteDebugPort;
152
- // Then use the agent-browser skill against http://127.0.0.1:${port}
153
-
154
- await sdk.desktopBrowser.navigateTab('cli-browser:9555:tab:3', {
155
- url: 'https://docs.realtimex.ai',
156
- focus: true,
157
- focusWindow: true
158
- });
159
-
160
- await sdk.desktopBrowser.evaluateTab('cli-browser:9555:tab:3', {
161
- expression: 'document.title',
162
- userGesture: true
163
- });
164
- ```
165
-
166
- Prefer normal named sessions like `github-review` or `docs-research`.
167
- Avoid mutating reserved/system-managed sessions like `acp-*` unless the user explicitly asks for internal ACP browser flows.
168
- Compatibility: `sdk.v1.desktopBrowser` remains available, but prefer the top-level alias.
169
-
170
- ---
171
-
172
- ## Core — RealtimeXSDK
173
-
174
- ### `RealtimeXSDK`
175
-
176
- **Public properties:**
177
- - `activities: ActivitiesModule`
178
- - `webhook: WebhookModule`
179
- - `api: ApiModule`
180
- - `task: TaskModule`
181
- - `port: PortModule`
182
- - `llm: LLMModule`
183
- - `tts: TTSModule`
184
- - `stt: STTModule`
185
- - `agent: AgentModule`
186
- - `acpAgent: AcpAgentModule`
187
- - `mcp: MCPModule`
188
- - `contract: ContractModule`
189
- - `contractRuntime: ContractRuntime`
190
- - `database: DatabaseModule`
191
- - `auth: AuthModule`
192
- - `credentials: CredentialsModule`
193
- - `v1: V1ApiNamespace | undefined`
194
- - `desktopRuntimeSessions: V1DesktopRuntimeSessionsModule | undefined`
195
- - `desktopBrowser: V1DesktopBrowserModule | undefined`
196
-
197
- ```ts
198
- // Developer API (v1) — requires apiKey to be set in config.
199
- async register(permissions?: string[]): void
200
-
201
- // Get environment variable (works in Node.js and browser)
202
- async ping(): Promise<
203
-
204
- // Get the absolute path to the data directory for this app.
205
- async getAppDataDir(): Promise<string>
206
- ```
207
-
208
- ---
209
-
210
- ## sdk.api — Agents, Workspaces, Threads, Tasks
211
-
212
- ### `ApiModule`
213
-
214
- ```ts
215
- async getAgents(): Promise<Agent[]>
216
-
217
- async getWorkspaces(): Promise<Workspace[]>
218
-
219
- async getThreads(workspaceSlug: string): Promise<Thread[]>
220
-
221
- async getTask(taskUuid: string): Promise<Task>
222
- ```
223
-
224
- ---
225
-
226
- ## sdk.activities — Activities CRUD
227
-
228
- ### `ActivitiesModule`
229
-
230
- ```ts
231
- // Request a single permission from Electron via internal API
232
- async insert(rawData: Record<string, unknown>): Promise<Activity>
233
-
234
- // Update an existing activity
235
- async update(id: string, updates: Partial<Activity>): Promise<Activity>
236
-
237
- // Delete an activity
238
- async delete(id: string): Promise<void>
239
-
240
- // Get a single activity by ID
241
- async get(id: string): Promise<Activity | null>
242
-
243
- // List activities with optional filters
244
- async list(options?: { status?: string; limit?: number; offset?: number }): Promise<Activity[]>
245
- ```
246
-
247
- ---
248
-
249
- ## sdk.task — Task Lifecycle Reporting
250
-
251
- ### `TaskModule`
252
-
253
- ```ts
254
- // Configure callback signing behavior.
255
- configureContract(config: { callbackSecret?: string; signCallbacksByDefault?: boolean }): void
256
-
257
- // Claim a task before processing.
258
- async claim(taskUuid: string, options: TaskEventOptions = {}): Promise<TaskStatusResponse>
259
-
260
- // Alias for claim()
261
- async claimed(taskUuid: string, options: TaskEventOptions = {}): Promise<TaskStatusResponse>
262
-
263
- // Mark task as processing.
264
- async start(taskUuid: string, machineIdOrOptions?: string | TaskEventOptions): Promise<TaskStatusResponse>
265
-
266
- // Report incremental task progress.
267
- async progress(taskUuid: string, progressData: Record<string, unknown> = {}, options: TaskEventOptions = {}): Promise<TaskStatusResponse>
268
-
269
- // Mark task as completed with result.
270
- async complete(taskUuid: string, result: Record<string, unknown> = {}, machineIdOrOptions?: string | TaskEventOptions): Promise<TaskStatusResponse>
271
-
272
- // Mark task as failed with error.
273
- async fail(taskUuid: string, error: string, machineIdOrOptions?: string | TaskEventOptions): Promise<TaskStatusResponse>
274
-
275
- // Mark task as canceled.
276
- async cancel(taskUuid: string, reason?: string, options: TaskEventOptions = {}): Promise<TaskStatusResponse>
277
- ```
278
-
279
- #### `TaskStatusResponse`
280
-
281
- ```ts
282
- success: boolean
283
- task_uuid: string
284
- status: string
285
- event_id?: string
286
- attempt_id?: string
287
- event_type?: ContractEventType | string
288
- deduplicated?: boolean
289
- duplicate?: boolean
290
- message?: string
291
- ```
292
-
293
- #### `TaskEventOptions`
294
-
295
- ```ts
296
- machineId?: string
297
- attemptId?: string | number
298
- eventId?: string
299
- timestamp?: string
300
- callbackUrl?: string
301
- callbackSecret?: string
302
- sign?: boolean
303
- userEmail?: string
304
- activityId?: string
305
- tableName?: string
306
- ```
307
-
308
- ---
309
-
310
- ## sdk.webhook — Webhook Trigger
311
-
312
- ### `WebhookModule`
313
-
314
- ```ts
315
- async triggerAgent(payload: TriggerAgentPayload): Promise<TriggerAgentResponse>
316
-
317
- async ping(): Promise<
318
- ```
319
-
320
- ---
321
-
322
- ## sdk.llm — LLM Chat, Embed, Vector Search
323
-
324
- ### `LLMModule`
325
-
326
- **Public properties:**
327
- - `vectors: VectorStore`
328
-
329
- ```ts
330
- // Request a single permission from Electron via internal API
331
- async chatProviders(): Promise<ProvidersResponse>
332
-
333
- // Get only configured embedding providers
334
- async embedProviders(): Promise<ProvidersResponse>
335
-
336
- // Send a chat completion request (synchronous)
337
- async chat(messages: ChatMessage[], options: ChatOptions = {}): Promise<ChatResponse>
338
-
339
- // Send a streaming chat completion request (SSE)
340
- async *chatStream(messages: ChatMessage[], options: ChatOptions = {}): AsyncGenerator<StreamChunk, void, unknown>
341
-
342
- // Generate vector embeddings from text
343
- async embed(input: string | string[], options: EmbedOptions = {}): Promise<EmbedResponse>
344
-
345
- // Helper: Embed text and store as vectors in one call
346
- async embedAndStore(params: { texts: string[]; documentId?: string; workspaceId?: string; idPrefix?: string; provider?: string; model?: string; }): Promise<VectorUpsertResponse>
347
-
348
- // Helper: Search similar documents by text query
349
- async search(query: string, options: VectorQueryOptions = {}): Promise<VectorQueryResult[]>
350
- ```
351
-
352
- ### `VectorStore` *(accessed as `sdk.llm.vectors`)*
353
-
354
- ```ts
355
- // Request a single permission from Electron via internal API
356
- async upsert(vectors: VectorRecord[], options: VectorUpsertOptions = {}): Promise<VectorUpsertResponse>
357
-
358
- // Query similar vectors by embedding
359
- async query(vector: number[], options: VectorQueryOptions = {}): Promise<VectorQueryResponse>
360
-
361
- // Delete vectors from storage
362
- async delete(options: VectorDeleteOptions): Promise<VectorDeleteResponse>
363
-
364
- // List all available workspaces (namespaces) for this app
365
- async listWorkspaces(): Promise<VectorListWorkspacesResponse>
366
-
367
- // Register a custom vector database configuration for this app
368
- async registerConfig(provider: string, config: Record<string, any>): Promise<VectorRegisterResponse>
369
-
370
- // List all supported vector database providers and their configuration requirements
371
- async listProviders(): Promise<VectorProvidersResponse>
372
-
373
- // Get the current vector database configuration for this app
374
- async getConfig(): Promise<VectorConfigResponse>
375
- ```
376
-
377
- #### `ChatOptions`
378
-
379
- ```ts
380
- model?: string
381
- provider?: string
382
- temperature?: number
383
- max_tokens?: number
384
- response_format?: { type: string }
385
- ```
386
-
387
- #### `ChatResponse`
388
-
389
- ```ts
390
- success: boolean
391
- response?: {
392
- content: string
393
- model: string
394
- provider?: string
395
- metrics?: {
396
- prompt_tokens: number
397
- completion_tokens: number
398
- total_tokens: number
399
- duration?: number
400
- outputTps?: number
401
- error?: string
402
- code?: string
403
- ```
404
-
405
- #### `StreamChunk`
406
-
407
- ```ts
408
- uuid?: string
409
- type?: string
410
- textResponse?: string
411
- close?: boolean
412
- error?: boolean
413
- ```
414
-
415
- #### `EmbedOptions`
416
-
417
- ```ts
418
- provider?: string
419
- model?: string
420
- ```
421
-
422
- #### `EmbedResponse`
423
-
424
- ```ts
425
- success: boolean
426
- embeddings?: number[][]
427
- provider?: string
428
- model?: string
429
- dimensions?: number
430
- error?: string
431
- code?: string
432
- errors?: string[]
433
- ```
434
-
435
- #### `VectorRecord`
436
-
437
- ```ts
438
- id: string
439
- vector: number[]
440
- metadata?: {
441
- text?: string
442
- documentId?: string
443
- workspaceId?: string
444
- ```
445
-
446
- #### `VectorUpsertOptions`
447
-
448
- ```ts
449
- workspaceId?: string
450
- ```
451
-
452
- #### `VectorQueryOptions`
453
-
454
- ```ts
455
- topK?: number
456
- filter?: {
457
- workspaceId?: string
458
- documentId?: string
459
- workspaceId?: string
460
- provider?: string
461
- model?: string
462
- ```
463
-
464
- #### `VectorQueryResult`
465
-
466
- ```ts
467
- id: string
468
- score: number
469
- metadata?: {
470
- text?: string
471
- documentId?: string
472
- workspaceId?: string
473
- ```
474
-
475
- #### `VectorDeleteOptions`
476
-
477
- ```ts
478
- workspaceId?: string
479
- deleteAll: true
480
- ```
481
-
482
- #### `VectorListWorkspacesResponse`
483
-
484
- ```ts
485
- success: boolean
486
- workspaces?: string[]
487
- error?: string
488
- code?: string
489
- error_message?: string
490
- ```
491
-
492
- ---
493
-
494
- ## sdk.mcp — MCP Server Tools
495
-
496
- ### `MCPModule` *(extends ApiModule)*
497
-
498
- ```ts
499
- super(realtimexUrl, appId, appName, apiKey): void
500
-
501
- // List configured MCP servers.
502
- async getServers(provider: 'local' | 'remote' | 'all' = 'all'): Promise<MCPServer[]>
503
-
504
- // List available tools for a specific MCP server.
505
- async getTools(serverName: string, provider: 'local' | 'remote' = 'local'): Promise<MCPTool[]>
506
-
507
- // Execute a tool on an MCP server.
508
- async executeTool(serverName: string, toolName: string, args: Record<string, any> = {}, provider: 'local' | 'remote' = 'local'): Promise<any>
509
- ```
510
-
511
- #### `MCPServer`
512
-
513
- ```ts
514
- name: string
515
- display_name: string
516
- description: string | null
517
- server_type: string
518
- enabled: boolean
519
- provider: 'local' | 'remote'
520
- tags: string[]
521
- ```
522
-
523
- #### `MCPTool`
524
-
525
- ```ts
526
- name: string
527
- description: string | null
528
- ```
529
-
530
- #### `MCPToolResult`
531
-
532
- ```ts
533
- success: boolean
534
- server: string
535
- tool: string
536
- provider: string
537
- result: any
538
- error?: string
539
- ```
540
-
541
- ---
542
-
543
- ## sdk.acpAgent — ACP CLI Agent Sessions
544
-
545
- ### `AcpAgentModule`
546
-
547
- ```ts
548
- // List available CLI agents. Pass includeModels to get model lists per agent.
549
- async listAgents(opts?: { includeModels?: boolean; }): Promise<AcpAgentInfo[]>
550
-
551
- // Create and initialize a new ACP session. Spawns the CLI agent process.
552
- async createSession(options: AcpSessionOptions): Promise<AcpSession>
553
-
554
- // Get session status and runtime options.
555
- async getSession(sessionKey: string): Promise<AcpSessionStatus>
556
-
557
- // List active ACP sessions owned by this app.
558
- async listSessions(): Promise<AcpSessionStatus[]>
559
-
560
- // Update runtime options (applied on next turn).
561
- async patchSession(sessionKey: string, patch: AcpRuntimeOptionPatch): Promise<void>
562
-
563
- // Close session and stop the agent process.
564
- async closeSession(sessionKey: string, reason?: string): Promise<void>
565
-
566
- // Synchronous turn — waits for completion, returns full response.
567
- async chat(sessionKey: string, message: string, attachments?: AcpAttachment[]): Promise<AcpChatResponse>
568
-
569
- // Streaming turn via SSE. Yields events as they arrive.
570
- async *streamChat(sessionKey: string, message: string, attachments?: AcpAttachment[]): AsyncIterableIterator<AcpStreamEvent>
571
-
572
- // Cancel the active turn on a session.
573
- async cancelTurn(sessionKey: string, reason?: string): Promise<void>
574
-
575
- // Resolve a pending permission request (call while SSE stream is active).
576
- async resolvePermission(sessionKey: string, decision: AcpPermissionDecision): Promise<
577
-
578
- // Convenience: create session + first sync chat in one call.
579
- async startChat(message: string, options: AcpSessionOptions): Promise<
580
- ```
581
-
582
- #### `AcpSessionOptions`
583
-
584
- ```ts
585
- agent_id: string
586
- cwd?: string
587
- label?: string
588
- model?: string
589
- approvalPolicy?: "approve-all" | "approve-reads" | "deny-all"
590
- forwardedProvider?: string
591
- ```
592
-
593
- #### `AcpSession`
594
-
595
- ```ts
596
- session_key: string
597
- agent_id: string
598
- state: "initializing" | "ready" | "stale" | "closed"
599
- backend_id: string
600
- created_at: string
601
- ```
602
-
603
- #### `AcpSessionStatus`
604
-
605
- ```ts
606
- runtime_options: AcpRuntimeOptionPatch
607
- last_activity_at: string | null
608
- last_error?: string
609
- ```
610
-
611
- #### `AcpRuntimeOptionPatch`
612
-
613
- ```ts
614
- model?: string
615
- cwd?: string
616
- timeoutSeconds?: number
617
- runtimeMode?: string
618
- approvalPolicy?: "approve-all" | "approve-reads" | "deny-all"
619
- ```
620
-
621
- #### `AcpAttachment`
622
-
623
- ```ts
624
- contentString: string
625
- mime: string
626
- ```
627
-
628
- #### `AcpChatResponse`
629
-
630
- ```ts
631
- text: string
632
- stop_reason?: string
633
- ```
634
-
635
- #### `AcpStreamEvent`
636
-
637
- #### `AcpPermissionDecision`
638
-
639
- ```ts
640
- requestId: string
641
- optionId: string
642
- outcome?: string
643
- ```
644
-
645
- ---
646
-
647
- ## sdk.agent — LLM Agent Sessions (REST/SSE)
648
-
649
- ### `AgentModule`
650
-
651
- ```ts
652
- // Create a new agent session
653
- async createSession(options?: AgentSessionOptions): Promise<AgentSession>
654
-
655
- // Chat within a session (synchronous)
656
- async chat(sessionId: string, message: string): Promise<AgentChatResponse>
657
-
658
- // Stream chat within a session
659
- async *streamChat(sessionId: string, message: string): AsyncIterableIterator<StreamChunkEvent>
660
-
661
- // Get session information
662
- async getSession(sessionId: string): Promise<AgentSessionInfo>
663
-
664
- // Close and delete a session
665
- async closeSession(sessionId: string): Promise<void>
666
-
667
- // Helper: Create session and send first message in one call
668
- async startChat(message: string, options?: AgentSessionOptions): Promise<
669
- ```
670
-
671
- ---
672
-
673
- ## sdk.tts — Text-to-Speech
674
-
675
- ### `TTSModule`
676
-
677
- ```ts
678
- // Request a single permission from Electron via internal API
679
- async speak(text: string, options: TTSOptions = {}): Promise<ArrayBuffer>
680
-
681
- // Generate speech from text with streaming (yields decoded audio chunks)
682
- async *speakStream(text: string, options: TTSOptions = {}): AsyncGenerator<TTSChunk>
683
-
684
- // List available TTS providers with configuration options
685
- async listProviders(): Promise<TTSProvider[]>
686
- ```
687
-
688
- ---
689
-
690
- ## sdk.stt — Speech-to-Text
691
-
692
- ### `STTModule` *(extends ApiModule)*
693
-
694
- ```ts
695
- // Get available STT providers and their models.
696
- async listProviders(): Promise<STTProvider[]>
697
-
698
- // Listen to microphone and transcribe speech to text.
699
- async listen(options: STTListenOptions): Promise<STTResponse>
700
- ```
701
-
702
- ---
703
-
704
- ## sdk.contract — Local App Contract
705
-
706
- ### `ContractModule`
707
-
708
- ```ts
709
- async getLocalAppV1(forceRefresh = false): Promise<LocalAppContractDefinition>
710
-
711
- async listCapabilities(forceRefresh = false): Promise<ContractCapability[]>
712
-
713
- async searchCapabilities(query: string): Promise<ContractCapability[]>
714
-
715
- async describeCapability(capabilityId: string): Promise<ContractCapability>
716
-
717
- async search(query: string): Promise<ContractCapability[]>
718
-
719
- async describe(capabilityId: string): Promise<ContractCapability>
720
-
721
- async invoke(payload: ContractInvokePayload): Promise<TriggerAgentResponse>
722
-
723
- getCachedCatalogHash(): string | null
724
-
725
- clearCache(): void
726
- ```
727
-
728
- ---
729
-
730
- ## sdk.database — Supabase Config
731
-
732
- ### `DatabaseModule`
733
-
734
- ```ts
735
- // Get the Supabase database configuration for this app.
736
- async getConfig(): Promise<DatabaseConfig>
737
- ```
738
-
739
- #### `DatabaseConfig`
740
-
741
- > Database Module - Retrieve Supabase config from RealtimeX Main App
742
-
743
- ```ts
744
- url: string
745
- anonKey: string
746
- mode: 'compatible' | 'custom'
747
- tables: string[]
748
- max_concurrent_tasks: number
749
- ```
750
-
751
- ---
752
-
753
- ## sdk.auth — Auth Token
754
-
755
- ### `AuthModule`
756
-
757
- ```ts
758
- // Push a Supabase access token to the Main App.
759
- async syncSupabaseToken(token: string): Promise<SyncTokenResponse>
760
-
761
- // Retrieve the current Keycloak access token from Main App.
762
- async getAccessToken(): Promise<AuthTokenResponse | null>
763
- ```
764
-
765
- #### `AuthTokenResponse`
766
-
767
- > Auth Module - Authentication helpers for RealtimeX SDK
768
-
769
- ```ts
770
- token: string
771
- hasToken: boolean
772
- syncedAt: string | null
773
- source: string | null
774
- ```
775
-
776
- #### `SyncTokenResponse`
777
-
778
- ```ts
779
- success: boolean
780
- message: string
781
- hasToken: boolean
782
- syncedAt: string | null
783
- source: string | null
784
- ```
785
-
786
- ---
787
-
788
- ## sdk.port — Port Management
789
-
790
- ### `PortModule`
791
-
792
- ```ts
793
- // Get suggested port from environment (RTX_PORT) or default
794
- getSuggestedPort(): number
795
-
796
- // Check if a port is available on a specific host
797
- async isPortAvailable(port: number): Promise<boolean>
798
-
799
- // Find an available port starting from the suggested port
800
- async findAvailablePort(startPort?: number, maxAttempts: number = 100): Promise<number>
801
-
802
- // Get a ready-to-use port
803
- async getPort(): Promise<number>
804
- ```
805
-
806
- ---
807
-
808
- ## sdk.v1.acpAuth — v1 Acp Auth
809
-
810
- ### `V1AcpAuthModule`
811
-
812
- ```ts
813
- // @see GET /v1/acp/auth/profiles
814
- async listProfiles(): Promise<unknown>
815
-
816
- // @see POST /v1/acp/auth/profiles
817
- async createProfile(): Promise<unknown>
818
-
819
- // @see GET /v1/acp/auth/status
820
- async getStatus(): Promise<unknown>
821
-
822
- // @see DELETE /v1/acp/auth/profiles/{id}
823
- async deleteProfile(id: string): Promise<unknown>
824
- ```
825
-
826
- ---
827
-
828
- ## sdk.v1.acpCommands — v1 Acp Commands
829
-
830
- ### `V1AcpCommandsModule`
831
-
832
- ```ts
833
- // @see POST /v1/acp/command
834
- async createCommand(): Promise<unknown>
835
-
836
- // @see POST /v1/acp/command/permission-decision
837
- async permissionDecision(): Promise<unknown>
838
- ```
839
-
840
- ---
841
-
842
- ## sdk.v1.admin — v1 Admin
843
-
844
- ### `V1AdminModule`
845
-
846
- ```ts
847
- // Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.
848
- async getIsMultiUserMode(): Promise<unknown>
849
-
850
- // Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.
851
- async listUsers(): Promise<unknown>
852
-
853
- // Create a new user with username and password. Methods are disabled until multi user mode is enabled via the UI.
854
- async createUser(body?: Record<string, unknown>): Promise<unknown>
855
-
856
- // Update existing user settings. Methods are disabled until multi user mode is enabled via the UI.
857
- async updateUser(id: string, body?: Record<string, unknown>): Promise<unknown>
858
-
859
- // Delete existing user by id. Methods are disabled until multi user mode is enabled via the UI.
860
- async deleteUser(id: string): Promise<unknown>
861
-
862
- // List all existing invitations to instance regardless of status. Methods are disabled until multi user mode is enabled via the UI.
863
- async listInvites(): Promise<unknown>
864
-
865
- // 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.
866
- async createInvite(body?: Record<string, unknown>): Promise<unknown>
867
-
868
- // Deactivates (soft-delete) invite by id. Methods are disabled until multi user mode is enabled via the UI.
869
- async deleteInvite(id: string): Promise<unknown>
870
-
871
- // Retrieve a list of users with permissions to access the specified workspace.
872
- async listWorkspaceUsers(workspaceId: string): Promise<unknown>
873
-
874
- // 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.
875
- async updateUsers(workspaceId: string, body?: Record<string, unknown>): Promise<unknown>
876
-
877
- // 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.
878
- async workspacesManageUsers(workspaceSlug: string, body?: Record<string, unknown>): Promise<unknown>
879
-
880
- // All chats in the system ordered by most recent. Methods are disabled until multi user mode is enabled via the UI.
881
- async workspaceChats(body?: Record<string, unknown>): Promise<unknown>
882
-
883
- // Update multi-user preferences for instance. Methods are disabled until multi user mode is enabled via the UI.
884
- async createPreference(body?: Record<string, unknown>): Promise<unknown>
885
- ```
886
-
887
- ---
888
-
889
- ## sdk.v1.auth — v1 Auth
890
-
891
- ### `V1AuthModule`
892
-
893
- ```ts
894
- // Verify the attached Authentication header contains a valid API token.
895
- async getAuth(): Promise<unknown>
896
-
897
- // Relay external browser auth callbacks back to the local Electron renderer. Localhost only; keyed by OAuth state.
898
- async externalCallback(): Promise<unknown>
899
-
900
- // Poll for a relayed external browser auth callback by OAuth state. Localhost only.
901
- async getExternalCallback(state: string): Promise<unknown>
902
- ```
903
-
904
- ---
905
-
906
- ## sdk.v1.channels — v1 Channels
907
-
908
- ### `V1ChannelsModule`
909
-
910
- ```ts
911
- // List configured channel plugins without exposing encrypted plugin configuration.
912
- async listPlugins(): Promise<unknown>
913
-
914
- // Create a channel plugin. The request may include provider credentials in config, but credentials are never returned.
915
- async createPlugin(body?: Record<string, unknown>): Promise<unknown>
916
-
917
- // Get editable non-secret channel plugin configuration.
918
- async getConfig(id: string): Promise<unknown>
919
-
920
- // Update a channel plugin. Config values are encrypted before storage.
921
- async updatePlugin(id: string, body?: Record<string, unknown>): Promise<unknown>
922
-
923
- // Delete a channel plugin and stop any running plugin instance.
924
- async deletePlugin(id: string): Promise<unknown>
925
-
926
- // Enable and start a channel plugin.
927
- async pluginsStart(id: string): Promise<unknown>
928
-
929
- // Disable and stop a channel plugin.
930
- async pluginsStop(id: string): Promise<unknown>
931
-
932
- // Test channel provider credentials without saving a plugin.
933
- async pluginsTest(body?: Record<string, unknown>): Promise<unknown>
934
-
935
- // Get runtime status for all running channel plugins.
936
- async getStatus(): Promise<unknown>
937
-
938
- // Start a QR login flow for Zalo personal or WhatsApp plugins.
939
- async pluginsQrLoginStart(id: string, body?: Record<string, unknown>): Promise<unknown>
940
-
941
- // Poll QR login status for Zalo personal or WhatsApp plugins.
942
- async getState(id: string): Promise<unknown>
943
-
944
- // Cancel a QR login flow for Zalo personal or WhatsApp plugins.
945
- async pluginsQrLoginCancel(id: string): Promise<unknown>
946
-
947
- // Log out a QR-authenticated Zalo personal or WhatsApp plugin and clear stored credentials.
948
- async pluginsLogout(id: string): Promise<unknown>
949
-
950
- // Update safe channel policies for Zalo personal or WhatsApp plugins without overwriting credentials.
951
- async pluginsPolicies(id: string, body?: Record<string, unknown>): Promise<unknown>
952
-
953
- // Search a Zalo personal friends directory.
954
- async listDirectoryFriends(id: string): Promise<unknown>
955
-
956
- // Search a Zalo personal groups directory.
957
- async listDirectoryGroups(id: string): Promise<unknown>
958
-
959
- // List pending pairing codes for a channel plugin.
960
- async listPluginPairingCodes(id: string): Promise<unknown>
961
-
962
- // Generate a pairing code for a channel plugin.
963
- async pluginsPairingCodes(id: string, body?: Record<string, unknown>): Promise<unknown>
964
-
965
- // Approve a channel pairing code.
966
- async pairingCodesApprove(id: string): Promise<unknown>
967
-
968
- // Reject a channel pairing code.
969
- async pairingCodesReject(id: string): Promise<unknown>
970
-
971
- // List channel users for a plugin.
972
- async listPluginUsers(id: string): Promise<unknown>
973
-
974
- // Set authorization for a channel user.
975
- async pluginsUsersAuthorization(id: string, userId: string, body?: Record<string, unknown>): Promise<unknown>
976
-
977
- // Remove a channel user from a plugin.
978
- async deleteUser(id: string, userId: string): Promise<unknown>
979
- ```
980
-
981
- ---
982
-
983
- ## sdk.v1.credentials — v1 Credentials
984
-
985
- ### `V1CredentialsModule`
986
-
987
- ```ts
988
- // @see POST /v1/credentials
989
- async createCredential(): Promise<unknown>
990
-
991
- // @see GET /v1/credentials
992
- async listCredentials(): Promise<unknown>
993
-
994
- // @see GET /v1/credentials/{id}
995
- async getCredential(id: string): Promise<unknown>
996
-
997
- // @see PUT /v1/credentials/{id}
998
- async replaceCredential(id: string): Promise<unknown>
999
-
1000
- // @see DELETE /v1/credentials/{id}
1001
- async deleteCredential(id: string): Promise<unknown>
1002
-
1003
- // @see POST /v1/credentials/{id}/restore
1004
- async restore(id: string): Promise<unknown>
1005
- ```
1006
-
1007
- ---
1008
-
1009
- ## sdk.v1.customThemes — v1 Custom Themes
1010
-
1011
- ### `V1CustomThemesModule`
1012
-
1013
- ```ts
1014
- // @see GET /v1/custom-themes
1015
- async listCustomThemes(): Promise<unknown>
1016
-
1017
- // @see GET /v1/custom-themes/{id}
1018
- async getCustomTheme(id: string): Promise<unknown>
1019
-
1020
- // @see POST /v1/custom-themes/{id}
1021
- async updateCustomTheme(id: string): Promise<unknown>
1022
-
1023
- // @see DELETE /v1/custom-themes/{id}
1024
- async deleteCustomTheme(id: string): Promise<unknown>
1025
-
1026
- // @see POST /v1/custom-themes/new
1027
- async createCustomTheme(): Promise<unknown>
1028
- ```
1029
-
1030
- ---
1031
-
1032
- ## sdk.v1.desktopBrowser — v1 Desktop Browser
1033
-
1034
- ### `V1DesktopBrowserModule`
1035
-
1036
- ```ts
1037
- // List RealTimeX Browser sessions available in the Electron desktop app.
1038
- async listSessions(): Promise<unknown>
1039
-
1040
- // Create a named RealTimeX Browser session in the Electron desktop app.
1041
- async createSession(body?: Record<string, unknown>): Promise<unknown>
1042
-
1043
- // Get a specific RealTimeX Browser session by session name.
1044
- async getSession(sessionName: string): Promise<unknown>
1045
-
1046
- // Delete a named RealTimeX Browser session from the Electron desktop app.
1047
- async deleteSession(sessionName: string): Promise<unknown>
1048
-
1049
- // Create a RealTimeX Browser tab, optionally launching the browser session if needed.
1050
- async createTab(body?: Record<string, unknown>): Promise<unknown>
1051
-
1052
- // Get a RealTimeX Browser tab snapshot by tab reference.
1053
- async getTab(tabRef: string): Promise<unknown>
1054
-
1055
- // Close an existing RealTimeX Browser tab.
1056
- async deleteTab(tabRef: string): Promise<unknown>
1057
-
1058
- // Evaluate JavaScript in a specific RealTimeX Browser tab.
1059
- async evaluateTab(tabRef: string, body?: Record<string, unknown>): Promise<unknown>
1060
-
1061
- // Focus an existing RealTimeX Browser tab.
1062
- async focusTab(tabRef: string, body?: Record<string, unknown>): Promise<unknown>
1063
-
1064
- // Navigate an existing RealTimeX Browser tab to a new URL.
1065
- async navigateTab(tabRef: string, body?: Record<string, unknown>): Promise<unknown>
1066
- ```
1067
-
1068
- ---
1069
-
1070
- ## sdk.v1.desktopEmbed — v1 Desktop Embed
1071
-
1072
- ### `V1DesktopEmbedModule`
1073
-
1074
- ```ts
1075
- // @see GET /v1/desktop-public-embed/status
1076
- async getStatus(): Promise<unknown>
1077
-
1078
- // @see POST /v1/desktop-public-embed/exposures
1079
- async createExposure(): Promise<unknown>
1080
-
1081
- // @see POST /v1/desktop-public-embed/exposures/{exposureId}/heartbeat
1082
- async exposuresHeartbeat(exposureId: string): Promise<unknown>
1083
-
1084
- // @see GET /v1/desktop-public-embed/exposures/{exposureId}
1085
- async getExposure(exposureId: string): Promise<unknown>
1086
-
1087
- // @see DELETE /v1/desktop-public-embed/exposures/{exposureId}
1088
- async deleteExposure(exposureId: string): Promise<unknown>
1089
- ```
1090
-
1091
- ---
1092
-
1093
- ## sdk.v1.desktopRuntimeSessions — v1 Desktop Runtime Sessions
1094
-
1095
- ### `V1DesktopRuntimeSessionsModule`
1096
-
1097
- ```ts
1098
- // Open the shared terminal launcher in the Electron desktop app.
1099
- async openLauncher(body?: Record<string, unknown>): Promise<unknown>
1100
-
1101
- // Launch a local PTY-backed shell terminal in the Electron desktop app.
1102
- async launchTerminalShell(body?: Record<string, unknown>): Promise<unknown>
1103
-
1104
- // Launch a local PTY-backed CLI agent terminal in the Electron desktop app.
1105
- async launchTerminalCliAgent(body?: Record<string, unknown>): Promise<unknown>
1106
-
1107
- // List desktop PTY-backed runtime sessions currently known to the Electron app.
1108
- async listRuntimeSessions(): Promise<unknown>
1109
-
1110
- // Fetch one desktop PTY-backed runtime session by runtime session ID or PTY session ID.
1111
- async getRuntimeSession(sessionId: string): Promise<unknown>
1112
-
1113
- // Close an existing desktop runtime session.
1114
- async deleteRuntimeSession(sessionId: string): Promise<unknown>
1115
-
1116
- // Write input to an existing desktop runtime session. Use `message` to submit a CLI turn or `input` for raw PTY data.
1117
- async write(sessionId: string, body?: Record<string, unknown>): Promise<unknown>
1118
-
1119
- // Approve or deny a pending desktop runtime session action.
1120
- async permission(sessionId: string, body?: Record<string, unknown>): Promise<unknown>
1121
- ```
1122
-
1123
- ---
1124
-
1125
- ## sdk.v1.document — v1 Document
1126
-
1127
- ### `V1DocumentModule`
1128
-
1129
- ```ts
1130
- // Upload a new file to RealTimeX to be parsed and prepared for embedding.
1131
- async uploadLink(body?: Record<string, unknown>): Promise<unknown>
1132
-
1133
- // Upload a file by specifying its raw text content and metadata values without having to upload a file.
1134
- async rawText(body?: Record<string, unknown>): Promise<unknown>
1135
-
1136
- // List of all locally-stored documents in instance
1137
- async listDocuments(): Promise<unknown>
1138
-
1139
- // Get all documents stored in a specific folder.
1140
- async getFolder(folderName: string): Promise<unknown>
1141
-
1142
- // Check available filetypes and MIMEs that can be uploaded.
1143
- async listAcceptedFileTypes(): Promise<unknown>
1144
-
1145
- // Get the known available metadata schema for when doing a raw-text upload and the acceptable type of value for each key.
1146
- async getMetadataSchema(): Promise<unknown>
1147
-
1148
- // Get a single document by its unique RealTimeX document name
1149
- async getDocument(docName: string): Promise<unknown>
1150
-
1151
- // Create a new folder inside the documents storage directory.
1152
- async createFolder(body?: Record<string, unknown>): Promise<unknown>
1153
-
1154
- // Remove a folder and all its contents from the documents storage directory.
1155
- async deleteRemoveFolder(): Promise<unknown>
1156
-
1157
- // Move files within the documents storage directory.
1158
- async moveFiles(body?: Record<string, unknown>): Promise<unknown>
1159
- ```
1160
-
1161
- ---
1162
-
1163
- ## sdk.v1.embed — v1 Embed
1164
-
1165
- ### `V1EmbedModule`
1166
-
1167
- ```ts
1168
- // List all active embeds
1169
- async getEmbed(): Promise<unknown>
1170
-
1171
- // Get all chats for a specific embed
1172
- async listChats(embedUuid: string): Promise<unknown>
1173
-
1174
- // Get chats for a specific embed and session
1175
- async getChat(embedUuid: string, sessionUuid: string): Promise<unknown>
1176
-
1177
- // Create a new embed configuration
1178
- async createEmbed(body?: Record<string, unknown>): Promise<unknown>
1179
-
1180
- // Update an existing embed configuration
1181
- async updateEmbed(embedUuid: string, body?: Record<string, unknown>): Promise<unknown>
1182
-
1183
- // Delete an existing embed configuration
1184
- async deleteEmbed(embedUuid: string): Promise<unknown>
1185
- ```
1186
-
1187
- ---
1188
-
1189
- ## sdk.v1.openAI — v1 Open A I
1190
-
1191
- ### `V1OpenAIModule`
1192
-
1193
- ```ts
1194
- // Get all available "models" which are workspaces you can use for chatting.
1195
- async listModels(): Promise<unknown>
1196
-
1197
- // Execute a chat with a workspace with OpenAI compatibility. Supports streaming as well. Model must be a workspace slug from /models.
1198
- async chatCompletions(body?: Record<string, unknown>): Promise<unknown>
1199
-
1200
- // 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.
1201
- async createEmbedding(body?: Record<string, unknown>): Promise<unknown>
1202
-
1203
- // 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.
1204
- async listVectorStores(): Promise<unknown>
1205
- ```
1206
-
1207
- ---
1208
-
1209
- ## sdk.v1.sttApi — v1 Stt Api
1210
-
1211
- ### `V1SttApiModule`
1212
-
1213
- ```ts
1214
- // @see POST /v1/stt/groq/transcribe
1215
- async groqTranscribe(body?: Record<string, unknown>): Promise<unknown>
1216
- ```
1217
-
1218
- ---
1219
-
1220
- ## sdk.v1.system — v1 System
1221
-
1222
- ### `V1SystemModule`
1223
-
1224
- ```ts
1225
- // Dump all settings to file storage
1226
- async getEnvDump(): Promise<unknown>
1227
-
1228
- // Get all current system settings that are defined.
1229
- async getSystem(): Promise<unknown>
1230
-
1231
- // Number of all vectors in connected vector database
1232
- async getVectorCount(): Promise<unknown>
1233
-
1234
- // Update a system setting or preference.
1235
- async updateEnv(body?: Record<string, unknown>): Promise<unknown>
1236
-
1237
- // 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.
1238
- async listExportChats(): Promise<unknown>
1239
-
1240
- // Permanently remove documents from the system.
1241
- async deleteRemoveDocument(): Promise<unknown>
1242
-
1243
- // Returns a health check object with server uptime and version.
1244
- async getHealth(): Promise<unknown>
1245
-
1246
- // Returns a health check object with server uptime and version.
1247
- async getHealthVersion2(): Promise<unknown>
1248
-
1249
- // Returns a health check object with server uptime and version.
1250
- async getHealthVersion3(): Promise<unknown>
1251
- ```
1252
-
1253
- ---
1254
-
1255
- ## sdk.v1.thread — v1 Thread
1256
-
1257
- ### `V1ThreadModule`
1258
-
1259
- ```ts
1260
- // Create a new workspace thread
1261
- async createThread(slug: string, body?: Record<string, unknown>): Promise<unknown>
1262
-
1263
- // Update thread settings by its unique slug.
1264
- async updateThread(slug: string, threadSlug: string, body?: Record<string, unknown>): Promise<unknown>
1265
-
1266
- // Delete a workspace thread
1267
- async deleteThread(slug: string, threadSlug: string): Promise<unknown>
1268
-
1269
- // Get chats for a workspace thread
1270
- async listChats(slug: string, threadSlug: string): Promise<unknown>
1271
-
1272
- // Chat with a workspace thread
1273
- async chat(slug: string, threadSlug: string, body?: Record<string, unknown>): Promise<unknown>
1274
-
1275
- async streamChat(slug: string, threadSlug: string, body?: Record<string, unknown>): Promise<Response>
1276
- ```
1277
-
1278
- ---
1279
-
1280
- ## sdk.v1.users — v1 Users
1281
-
1282
- ### `V1UsersModule`
1283
-
1284
- ```ts
1285
- // List all users
1286
- async listUsers(): Promise<unknown>
1287
-
1288
- // Issue a temporary auth token for a user
1289
- async getIssueAuthToken(id: string): Promise<unknown>
1290
- ```
1291
-
1292
- ---
1293
-
1294
- ## sdk.v1.workspace — v1 Workspace
1295
-
1296
- ### `V1WorkspaceModule`
1297
-
1298
- ```ts
1299
- // Create a new workspace
1300
- async createWorkspace(body?: Record<string, unknown>): Promise<unknown>
1301
-
1302
- // List all current workspaces
1303
- async listWorkspaces(): Promise<unknown>
1304
-
1305
- // Get a workspace by its unique slug.
1306
- async getWorkspace(slug: string): Promise<unknown>
1307
-
1308
- // Deletes a workspace by its slug.
1309
- async deleteWorkspace(slug: string): Promise<unknown>
1310
-
1311
- // Update workspace settings by its unique slug.
1312
- async updateWorkspace(slug: string, body?: Record<string, unknown>): Promise<unknown>
1313
-
1314
- // Get a workspaces chats regardless of user by its unique slug.
1315
- async listChats(slug: string): Promise<unknown>
1316
-
1317
- // Add or remove documents from a workspace by its unique slug.
1318
- async updateEmbeddings(slug: string, body?: Record<string, unknown>): Promise<unknown>
1319
-
1320
- // Add or remove pin from a document in a workspace by its unique slug.
1321
- async updatePin(slug: string, body?: Record<string, unknown>): Promise<unknown>
1322
-
1323
- // Execute a chat with a workspace
1324
- async chat(slug: string, body?: Record<string, unknown>): Promise<unknown>
1325
-
1326
- // Execute a streamable chat with a workspace
1327
- async vectorSearch(slug: string, body?: Record<string, unknown>): Promise<unknown>
1328
- ```
1329
-
1330
- ---