@realtimex/sdk 1.5.1 → 1.7.0

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.
@@ -0,0 +1,435 @@
1
+ /**
2
+ * DeveloperApiClient - HTTP client for the RealtimeX v1 Developer API.
3
+ *
4
+ * Supports two authentication modes:
5
+ * - API Key: Authorization: Bearer <apiKey>
6
+ * - App ID: x-app-id header (for LocalApp / SDK agent authentication)
7
+ *
8
+ * When both are provided, x-app-id takes priority on the server side.
9
+ */
10
+ declare class DeveloperApiClient {
11
+ private readonly baseUrl;
12
+ private readonly apiKey;
13
+ private readonly appId?;
14
+ constructor(baseUrl: string, apiKey: string, appId?: string);
15
+ private getHeaders;
16
+ private handleResponse;
17
+ /**
18
+ * Make a JSON request to the v1 API.
19
+ */
20
+ request<T = unknown>(method: string, path: string, body?: unknown): Promise<T>;
21
+ /**
22
+ * Make a multipart/form-data request (e.g. file uploads).
23
+ * Do NOT set Content-Type — browser/fetch will set it with the boundary.
24
+ */
25
+ requestMultipart<T = unknown>(method: string, path: string, form: FormData): Promise<T>;
26
+ /**
27
+ * Make a raw request and return the Response object directly.
28
+ * Used for streaming (SSE) endpoints.
29
+ */
30
+ requestRaw(method: string, path: string, body?: unknown): Promise<Response>;
31
+ }
32
+
33
+ declare class V1AuthModule {
34
+ private readonly client;
35
+ constructor(client: DeveloperApiClient);
36
+ /**
37
+ * Verify the attached Authentication header contains a valid API token.
38
+ * @see GET /v1/auth
39
+ */
40
+ getAuth(): Promise<unknown>;
41
+ }
42
+
43
+ declare class V1AdminModule {
44
+ private readonly client;
45
+ constructor(client: DeveloperApiClient);
46
+ /**
47
+ * Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.
48
+ * @see GET /v1/admin/is-multi-user-mode
49
+ */
50
+ getIsMultiUserMode(): Promise<unknown>;
51
+ /**
52
+ * Check to see if the instance is in multi-user-mode first. Methods are disabled until multi user mode is enabled via the UI.
53
+ * @see GET /v1/admin/users
54
+ */
55
+ listUsers(): Promise<unknown>;
56
+ /**
57
+ * Create a new user with username and password. Methods are disabled until multi user mode is enabled via the UI.
58
+ * @see POST /v1/admin/users/new
59
+ */
60
+ createUser(body?: Record<string, unknown>): Promise<unknown>;
61
+ /**
62
+ * Update existing user settings. Methods are disabled until multi user mode is enabled via the UI.
63
+ * @see POST /v1/admin/users/{id}
64
+ */
65
+ updateUser(id: string, body?: Record<string, unknown>): Promise<unknown>;
66
+ /**
67
+ * Delete existing user by id. Methods are disabled until multi user mode is enabled via the UI.
68
+ * @see DELETE /v1/admin/users/{id}
69
+ */
70
+ deleteUser(id: string): Promise<unknown>;
71
+ /**
72
+ * List all existing invitations to instance regardless of status. Methods are disabled until multi user mode is enabled via the UI.
73
+ * @see GET /v1/admin/invites
74
+ */
75
+ listInvites(): Promise<unknown>;
76
+ /**
77
+ * 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.
78
+ * @see POST /v1/admin/invite/new
79
+ */
80
+ createInvite(body?: Record<string, unknown>): Promise<unknown>;
81
+ /**
82
+ * Deactivates (soft-delete) invite by id. Methods are disabled until multi user mode is enabled via the UI.
83
+ * @see DELETE /v1/admin/invite/{id}
84
+ */
85
+ deleteInvite(id: string): Promise<unknown>;
86
+ /**
87
+ * Retrieve a list of users with permissions to access the specified workspace.
88
+ * @see GET /v1/admin/workspaces/{workspaceId}/users
89
+ */
90
+ listWorkspaceUsers(workspaceId: string): Promise<unknown>;
91
+ /**
92
+ * 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.
93
+ * @see POST /v1/admin/workspaces/{workspaceId}/update-users
94
+ */
95
+ updateUsers(workspaceId: string, body?: Record<string, unknown>): Promise<unknown>;
96
+ /**
97
+ * 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.
98
+ * @see POST /v1/admin/workspaces/{workspaceSlug}/manage-users
99
+ */
100
+ workspacesManageUsers(workspaceSlug: string, body?: Record<string, unknown>): Promise<unknown>;
101
+ /**
102
+ * All chats in the system ordered by most recent. Methods are disabled until multi user mode is enabled via the UI.
103
+ * @see POST /v1/admin/workspace-chats
104
+ */
105
+ workspaceChats(body?: Record<string, unknown>): Promise<unknown>;
106
+ /**
107
+ * Update multi-user preferences for instance. Methods are disabled until multi user mode is enabled via the UI.
108
+ * @see POST /v1/admin/preferences
109
+ */
110
+ createPreference(body?: Record<string, unknown>): Promise<unknown>;
111
+ }
112
+
113
+ declare class V1DocumentModule {
114
+ private readonly client;
115
+ constructor(client: DeveloperApiClient);
116
+ /**
117
+ * Upload a new file to RealTimeX to be parsed and prepared for embedding.
118
+ * @see POST /v1/document/upload
119
+ */
120
+ upload(form: FormData): Promise<unknown>;
121
+ /**
122
+ * 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.
123
+ * @see POST /v1/document/upload/{folderName}
124
+ */
125
+ uploadFolder(folderName: string, form: FormData): Promise<unknown>;
126
+ /**
127
+ * 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.
128
+ * @see POST /v1/document/upload-link
129
+ */
130
+ uploadLink(body?: Record<string, unknown>): Promise<unknown>;
131
+ /**
132
+ * Upload a file by specifying its raw text content and metadata values without having to upload a file.
133
+ * @see POST /v1/document/raw-text
134
+ */
135
+ rawText(body?: Record<string, unknown>): Promise<unknown>;
136
+ /**
137
+ * List of all locally-stored documents in instance
138
+ * @see GET /v1/documents
139
+ */
140
+ listDocuments(): Promise<unknown>;
141
+ /**
142
+ * Get all documents stored in a specific folder.
143
+ * @see GET /v1/documents/folder/{folderName}
144
+ */
145
+ getFolder(folderName: string): Promise<unknown>;
146
+ /**
147
+ * Check available filetypes and MIMEs that can be uploaded.
148
+ * @see GET /v1/document/accepted-file-types
149
+ */
150
+ listAcceptedFileTypes(): Promise<unknown>;
151
+ /**
152
+ * Get the known available metadata schema for when doing a raw-text upload and the acceptable type of value for each key.
153
+ * @see GET /v1/document/metadata-schema
154
+ */
155
+ getMetadataSchema(): Promise<unknown>;
156
+ /**
157
+ * Get a single document by its unique RealTimeX document name
158
+ * @see GET /v1/document/{docName}
159
+ */
160
+ getDocument(docName: string): Promise<unknown>;
161
+ /**
162
+ * Create a new folder inside the documents storage directory.
163
+ * @see POST /v1/document/create-folder
164
+ */
165
+ createFolder(body?: Record<string, unknown>): Promise<unknown>;
166
+ /**
167
+ * Remove a folder and all its contents from the documents storage directory.
168
+ * @see DELETE /v1/document/remove-folder
169
+ */
170
+ deleteRemoveFolder(): Promise<unknown>;
171
+ /**
172
+ * Move files within the documents storage directory.
173
+ * @see POST /v1/document/move-files
174
+ */
175
+ moveFiles(body?: Record<string, unknown>): Promise<unknown>;
176
+ }
177
+
178
+ declare class V1WorkspaceModule {
179
+ private readonly client;
180
+ constructor(client: DeveloperApiClient);
181
+ /**
182
+ * Create a new workspace
183
+ * @see POST /v1/workspace/new
184
+ */
185
+ createWorkspace(body?: Record<string, unknown>): Promise<unknown>;
186
+ /**
187
+ * List all current workspaces
188
+ * @see GET /v1/workspaces
189
+ */
190
+ listWorkspaces(): Promise<unknown>;
191
+ /**
192
+ * Get a workspace by its unique slug.
193
+ * @see GET /v1/workspace/{slug}
194
+ */
195
+ getWorkspace(slug: string): Promise<unknown>;
196
+ /**
197
+ * Deletes a workspace by its slug.
198
+ * @see DELETE /v1/workspace/{slug}
199
+ */
200
+ deleteWorkspace(slug: string): Promise<unknown>;
201
+ /**
202
+ * Update workspace settings by its unique slug.
203
+ * @see POST /v1/workspace/{slug}/update
204
+ */
205
+ updateWorkspace(slug: string, body?: Record<string, unknown>): Promise<unknown>;
206
+ /**
207
+ * Get a workspaces chats regardless of user by its unique slug.
208
+ * @see GET /v1/workspace/{slug}/chats
209
+ */
210
+ listChats(slug: string): Promise<unknown>;
211
+ /**
212
+ * Add or remove documents from a workspace by its unique slug.
213
+ * @see POST /v1/workspace/{slug}/update-embeddings
214
+ */
215
+ updateEmbeddings(slug: string, body?: Record<string, unknown>): Promise<unknown>;
216
+ /**
217
+ * Add or remove pin from a document in a workspace by its unique slug.
218
+ * @see POST /v1/workspace/{slug}/update-pin
219
+ */
220
+ updatePin(slug: string, body?: Record<string, unknown>): Promise<unknown>;
221
+ /**
222
+ * Execute a chat with a workspace
223
+ * @see POST /v1/workspace/{slug}/chat
224
+ */
225
+ chat(slug: string, body?: Record<string, unknown>): Promise<unknown>;
226
+ /**
227
+ * Execute a streamable chat with a workspace
228
+ * @see POST /v1/workspace/{slug}/stream-chat
229
+ */
230
+ streamChat(slug: string, body?: Record<string, unknown>): Promise<Response>;
231
+ /**
232
+ * Perform a vector similarity search in a workspace
233
+ * @see POST /v1/workspace/{slug}/vector-search
234
+ */
235
+ vectorSearch(slug: string, body?: Record<string, unknown>): Promise<unknown>;
236
+ }
237
+
238
+ declare class V1SystemModule {
239
+ private readonly client;
240
+ constructor(client: DeveloperApiClient);
241
+ /**
242
+ * Dump all settings to file storage
243
+ * @see GET /v1/system/env-dump
244
+ */
245
+ getEnvDump(): Promise<unknown>;
246
+ /**
247
+ * Get all current system settings that are defined.
248
+ * @see GET /v1/system
249
+ */
250
+ getSystem(): Promise<unknown>;
251
+ /**
252
+ * Number of all vectors in connected vector database
253
+ * @see GET /v1/system/vector-count
254
+ */
255
+ getVectorCount(): Promise<unknown>;
256
+ /**
257
+ * Update a system setting or preference.
258
+ * @see POST /v1/system/update-env
259
+ */
260
+ updateEnv(body?: Record<string, unknown>): Promise<unknown>;
261
+ /**
262
+ * 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.
263
+ * @see GET /v1/system/export-chats
264
+ */
265
+ listExportChats(): Promise<unknown>;
266
+ /**
267
+ * Permanently remove documents from the system.
268
+ * @see DELETE /v1/system/remove-documents
269
+ */
270
+ deleteRemoveDocument(): Promise<unknown>;
271
+ /**
272
+ * Returns a health check object with server uptime and version.
273
+ * @see GET /v1/system/health
274
+ */
275
+ getHealth(): Promise<unknown>;
276
+ }
277
+
278
+ declare class V1ThreadModule {
279
+ private readonly client;
280
+ constructor(client: DeveloperApiClient);
281
+ /**
282
+ * Create a new workspace thread
283
+ * @see POST /v1/workspace/{slug}/thread/new
284
+ */
285
+ createThread(slug: string, body?: Record<string, unknown>): Promise<unknown>;
286
+ /**
287
+ * Update thread settings by its unique slug.
288
+ * @see POST /v1/workspace/{slug}/thread/{threadSlug}/update
289
+ */
290
+ updateThread(slug: string, threadSlug: string, body?: Record<string, unknown>): Promise<unknown>;
291
+ /**
292
+ * Delete a workspace thread
293
+ * @see DELETE /v1/workspace/{slug}/thread/{threadSlug}
294
+ */
295
+ deleteThread(slug: string, threadSlug: string): Promise<unknown>;
296
+ /**
297
+ * Get chats for a workspace thread
298
+ * @see GET /v1/workspace/{slug}/thread/{threadSlug}/chats
299
+ */
300
+ listChats(slug: string, threadSlug: string): Promise<unknown>;
301
+ /**
302
+ * Chat with a workspace thread
303
+ * @see POST /v1/workspace/{slug}/thread/{threadSlug}/chat
304
+ */
305
+ chat(slug: string, threadSlug: string, body?: Record<string, unknown>): Promise<unknown>;
306
+ /**
307
+ * Stream chat with a workspace thread
308
+ * @see POST /v1/workspace/{slug}/thread/{threadSlug}/stream-chat
309
+ */
310
+ streamChat(slug: string, threadSlug: string, body?: Record<string, unknown>): Promise<Response>;
311
+ }
312
+
313
+ declare class V1UsersModule {
314
+ private readonly client;
315
+ constructor(client: DeveloperApiClient);
316
+ /**
317
+ * List all users
318
+ * @see GET /v1/users
319
+ */
320
+ listUsers(): Promise<unknown>;
321
+ /**
322
+ * Issue a temporary auth token for a user
323
+ * @see GET /v1/users/{id}/issue-auth-token
324
+ */
325
+ getIssueAuthToken(id: string): Promise<unknown>;
326
+ }
327
+
328
+ declare class V1OpenAIModule {
329
+ private readonly client;
330
+ constructor(client: DeveloperApiClient);
331
+ /**
332
+ * Get all available "models" which are workspaces you can use for chatting.
333
+ * @see GET /v1/openai/models
334
+ */
335
+ listModels(): Promise<unknown>;
336
+ /**
337
+ * Execute a chat with a workspace with OpenAI compatibility. Supports streaming as well. Model must be a workspace slug from /models.
338
+ * @see POST /v1/openai/chat/completions
339
+ */
340
+ chatCompletions(body?: Record<string, unknown>): Promise<unknown>;
341
+ /**
342
+ * 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.
343
+ * @see POST /v1/openai/embeddings
344
+ */
345
+ createEmbedding(body?: Record<string, unknown>): Promise<unknown>;
346
+ /**
347
+ * 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.
348
+ * @see GET /v1/openai/vector_stores
349
+ */
350
+ listVectorStores(): Promise<unknown>;
351
+ }
352
+
353
+ declare class V1EmbedModule {
354
+ private readonly client;
355
+ constructor(client: DeveloperApiClient);
356
+ /**
357
+ * List all active embeds
358
+ * @see GET /v1/embed
359
+ */
360
+ getEmbed(): Promise<unknown>;
361
+ /**
362
+ * Get all chats for a specific embed
363
+ * @see GET /v1/embed/{embedUuid}/chats
364
+ */
365
+ listChats(embedUuid: string): Promise<unknown>;
366
+ /**
367
+ * Get chats for a specific embed and session
368
+ * @see GET /v1/embed/{embedUuid}/chats/{sessionUuid}
369
+ */
370
+ getChat(embedUuid: string, sessionUuid: string): Promise<unknown>;
371
+ /**
372
+ * Create a new embed configuration
373
+ * @see POST /v1/embed/new
374
+ */
375
+ createEmbed(body?: Record<string, unknown>): Promise<unknown>;
376
+ /**
377
+ * Update an existing embed configuration
378
+ * @see POST /v1/embed/{embedUuid}
379
+ */
380
+ updateEmbed(embedUuid: string, body?: Record<string, unknown>): Promise<unknown>;
381
+ /**
382
+ * Delete an existing embed configuration
383
+ * @see DELETE /v1/embed/{embedUuid}
384
+ */
385
+ deleteEmbed(embedUuid: string): Promise<unknown>;
386
+ }
387
+
388
+ /**
389
+ * V1ApiNamespace - Container for all RealtimeX Developer API (v1) modules.
390
+ *
391
+ * Usage:
392
+ * const sdk = new RealtimeXSDK({ realtimex: { apiKey: 'sk-...' } });
393
+ * await sdk.v1?.workspace.listWorkspaces();
394
+ * await sdk.v1?.admin.listUsers();
395
+ *
396
+ * Regenerate modules: node scripts/generate-v1-sdk.mjs --force
397
+ */
398
+
399
+ declare class V1ApiNamespace {
400
+ /** @internal Shared HTTP client used by all v1 modules */
401
+ readonly _client: DeveloperApiClient;
402
+ auth: V1AuthModule;
403
+ admin: V1AdminModule;
404
+ document: V1DocumentModule;
405
+ workspace: V1WorkspaceModule;
406
+ system: V1SystemModule;
407
+ thread: V1ThreadModule;
408
+ users: V1UsersModule;
409
+ openai: V1OpenAIModule;
410
+ embed: V1EmbedModule;
411
+ constructor(baseUrl: string, apiKey: string, appId?: string);
412
+ }
413
+
414
+ /**
415
+ * RealtimeX SDK - Developer API (v1) Error Classes
416
+ */
417
+ declare class DeveloperApiError extends Error {
418
+ readonly status: number;
419
+ readonly code: string;
420
+ constructor(status: number, code: string, message: string);
421
+ }
422
+ declare class AuthenticationError extends DeveloperApiError {
423
+ constructor(message?: string);
424
+ }
425
+ declare class NotFoundError extends DeveloperApiError {
426
+ constructor(message?: string);
427
+ }
428
+ declare class ValidationError extends DeveloperApiError {
429
+ constructor(message: string);
430
+ }
431
+ declare class ServerError extends DeveloperApiError {
432
+ constructor(message?: string);
433
+ }
434
+
435
+ export { AuthenticationError as A, DeveloperApiClient as D, NotFoundError as N, ServerError as S, V1ApiNamespace as V, DeveloperApiError as a, ValidationError as b, V1AuthModule as c, V1AdminModule as d, V1DocumentModule as e, V1WorkspaceModule as f, V1SystemModule as g, V1ThreadModule as h, V1UsersModule as i, V1OpenAIModule as j, V1EmbedModule as k };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,6 @@
1
+ import { V as V1ApiNamespace } from './errors-DXKB6v1J.mjs';
2
+ export { A as AuthenticationError, D as DeveloperApiClient, a as DeveloperApiError, N as NotFoundError, S as ServerError, b as ValidationError } from './errors-DXKB6v1J.mjs';
3
+
1
4
  /**
2
5
  * RealtimeX Local App SDK - Types
3
6
  */
@@ -1660,6 +1663,32 @@ declare class AuthModule {
1660
1663
  getAccessToken(): Promise<AuthTokenResponse | null>;
1661
1664
  }
1662
1665
 
1666
+ /**
1667
+ * Credentials Module — read-only access to user-managed credentials
1668
+ *
1669
+ * Credential values are encrypted at rest and decrypted only on get().
1670
+ * Values should NEVER be printed to stdout or included in agent responses.
1671
+ */
1672
+
1673
+ interface CredentialInfo {
1674
+ name: string;
1675
+ type: "http_header" | "query_auth" | "basic_auth" | "env_var";
1676
+ metadata: Record<string, any> | null;
1677
+ }
1678
+ interface CredentialPayload {
1679
+ name: string;
1680
+ type: string;
1681
+ payload: Record<string, string>;
1682
+ }
1683
+ declare class CredentialsModule {
1684
+ private httpClient;
1685
+ constructor(httpClient: HttpClient);
1686
+ /** List available credentials (names and types, no values). */
1687
+ list(): Promise<CredentialInfo[]>;
1688
+ /** Get a credential's decrypted payload by name. */
1689
+ get(name: string): Promise<CredentialPayload>;
1690
+ }
1691
+
1663
1692
  interface ContractHttpClientConfig {
1664
1693
  baseUrl: string;
1665
1694
  appId?: string;
@@ -1987,6 +2016,12 @@ declare class RealtimeXSDK {
1987
2016
  contractRuntime: ContractRuntime;
1988
2017
  database: DatabaseModule;
1989
2018
  auth: AuthModule;
2019
+ credentials: CredentialsModule;
2020
+ /**
2021
+ * Developer API (v1) — requires apiKey to be set in config.
2022
+ * Provides access to workspace management, admin, documents, system settings, and more.
2023
+ */
2024
+ v1: V1ApiNamespace | undefined;
1990
2025
  readonly appId: string;
1991
2026
  readonly appName: string | undefined;
1992
2027
  readonly apiKey: string | undefined;
@@ -2021,4 +2056,4 @@ declare class RealtimeXSDK {
2021
2056
  getAppDataDir(): Promise<string>;
2022
2057
  }
2023
2058
 
2024
- export { type ACPAdapterContext, type ACPAdapterTelemetryEvent, type ACPAdapterTelemetrySink, ACPContractAdapter, type ACPContractAdapterOptions, type ACPContractRuntime, ACPEventMapper, type ACPExecutionReference, type ACPNotifier, ACPPermissionBridge, type ACPSessionToolUpdate, type ACPSessionUpdateParams, ACPTelemetry, type ACPTextContent, type ACPToolInvocation, type ACPToolKind, type ACPToolStatus, type AcpAgentInfo, AcpAgentModule, type AcpAttachment, type AcpChatResponse, type AcpPermissionDecision, type AcpRuntimeOptionPatch, type AcpSession, type AcpSessionOptions, type AcpSessionStatus, type AcpStreamEvent, ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, AuthModule, type AuthProvider, type AuthTokenResponse, CONTRACT_ATTEMPT_PREFIX, CONTRACT_EVENT_ID_HEADER, CONTRACT_SIGNATURE_ALGORITHM, CONTRACT_SIGNATURE_HEADER, type CanonicalToolDefinition, type ChatContentBlock, type ChatCustomBlock, type ChatFileBlock, type ChatImageUrlBlock, type ChatMessage, type ChatMessageContent, type ChatOptions, type ChatResponse, type ChatTextBlock, ClaudeToolAdapter, type ClaudeToolCall, type ClaudeToolDefinition, type ClaudeToolResult, CodexToolAdapter, type CodexToolCall, type CodexToolDefinition, type CodexToolResult, ContractCache, type ContractCallbackMetadata, type ContractCallbackRules, type ContractCapability, type ContractCapabilityTrigger, ContractClient, type ContractClientOptions, type ContractDiscoveryResponse, ContractError, type ContractEventType, ContractHttpClient, type ContractHttpClientConfig, type ContractInvokePayload, ContractModule, ContractRuntime, type ContractRuntimeInterface, type ContractRuntimeOptions, type ContractSignInput, type ContractStrictness, ContractValidationError, type DatabaseConfig, DatabaseModule, type EmbedOptions, type EmbedResponse, type ExecutionContext, type ExecutionResult, type GeminiFunctionDeclaration, GeminiToolAdapter, type GeminiToolCall, type GeminiToolResult, type GetToolsInput, type HostToolAdapter, type IngestExecutionEventInput, LLMModule, LLMPermissionError, LLMProviderError, LOCAL_APP_CONTRACT_VERSION, type LegacyLocalAppContractShape, type LifecycleEventType, type LocalAppCapabilitiesResponse, type LocalAppCapabilityDetailResponse, type LocalAppCapabilitySearchResponse, type LocalAppContractDefinition, type LocalAppContractResponse, type LocalAppContractV1, MCPModule, type MCPServer, type MCPTool, type MCPToolResult, PermissionDeniedError, type PermissionOption, PermissionRequiredError, PortModule, type ProjectToolsInput, type Provider, type ProviderKind, type ProvidersResponse, RealtimeXSDK, RetryPolicy, type RetryPolicyOptions, type RuntimeExecutionEvent, RuntimeTransportError, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, ScopeDeniedError, ScopeGuard, StaticAuthProvider, type StaticAuthProviderOptions, type StreamChunk, type StreamChunkEvent, type SyncTokenResponse, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type ToolCall, ToolNotFoundError, ToolProjector, ToolValidationError, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace, buildContractIdempotencyKey, buildContractSignatureMessage, canonicalEventToLegacyAction, createContractEventId, hashContractPayload, normalizeAttemptId, normalizeContractEvent, normalizeLocalAppContractV1, normalizeSchema, parseAttemptRunId, signContractEvent, toStableToolName };
2059
+ export { type ACPAdapterContext, type ACPAdapterTelemetryEvent, type ACPAdapterTelemetrySink, ACPContractAdapter, type ACPContractAdapterOptions, type ACPContractRuntime, ACPEventMapper, type ACPExecutionReference, type ACPNotifier, ACPPermissionBridge, type ACPSessionToolUpdate, type ACPSessionUpdateParams, ACPTelemetry, type ACPTextContent, type ACPToolInvocation, type ACPToolKind, type ACPToolStatus, type AcpAgentInfo, AcpAgentModule, type AcpAttachment, type AcpChatResponse, type AcpPermissionDecision, type AcpRuntimeOptionPatch, type AcpSession, type AcpSessionOptions, type AcpSessionStatus, type AcpStreamEvent, ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, AuthModule, type AuthProvider, type AuthTokenResponse, CONTRACT_ATTEMPT_PREFIX, CONTRACT_EVENT_ID_HEADER, CONTRACT_SIGNATURE_ALGORITHM, CONTRACT_SIGNATURE_HEADER, type CanonicalToolDefinition, type ChatContentBlock, type ChatCustomBlock, type ChatFileBlock, type ChatImageUrlBlock, type ChatMessage, type ChatMessageContent, type ChatOptions, type ChatResponse, type ChatTextBlock, ClaudeToolAdapter, type ClaudeToolCall, type ClaudeToolDefinition, type ClaudeToolResult, CodexToolAdapter, type CodexToolCall, type CodexToolDefinition, type CodexToolResult, ContractCache, type ContractCallbackMetadata, type ContractCallbackRules, type ContractCapability, type ContractCapabilityTrigger, ContractClient, type ContractClientOptions, type ContractDiscoveryResponse, ContractError, type ContractEventType, ContractHttpClient, type ContractHttpClientConfig, type ContractInvokePayload, ContractModule, ContractRuntime, type ContractRuntimeInterface, type ContractRuntimeOptions, type ContractSignInput, type ContractStrictness, ContractValidationError, type DatabaseConfig, DatabaseModule, type EmbedOptions, type EmbedResponse, type ExecutionContext, type ExecutionResult, type GeminiFunctionDeclaration, GeminiToolAdapter, type GeminiToolCall, type GeminiToolResult, type GetToolsInput, type HostToolAdapter, type IngestExecutionEventInput, LLMModule, LLMPermissionError, LLMProviderError, LOCAL_APP_CONTRACT_VERSION, type LegacyLocalAppContractShape, type LifecycleEventType, type LocalAppCapabilitiesResponse, type LocalAppCapabilityDetailResponse, type LocalAppCapabilitySearchResponse, type LocalAppContractDefinition, type LocalAppContractResponse, type LocalAppContractV1, MCPModule, type MCPServer, type MCPTool, type MCPToolResult, PermissionDeniedError, type PermissionOption, PermissionRequiredError, PortModule, type ProjectToolsInput, type Provider, type ProviderKind, type ProvidersResponse, RealtimeXSDK, RetryPolicy, type RetryPolicyOptions, type RuntimeExecutionEvent, RuntimeTransportError, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, ScopeDeniedError, ScopeGuard, StaticAuthProvider, type StaticAuthProviderOptions, type StreamChunk, type StreamChunkEvent, type SyncTokenResponse, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type ToolCall, ToolNotFoundError, ToolProjector, ToolValidationError, type TriggerAgentPayload, type TriggerAgentResponse, V1ApiNamespace, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace, buildContractIdempotencyKey, buildContractSignatureMessage, canonicalEventToLegacyAction, createContractEventId, hashContractPayload, normalizeAttemptId, normalizeContractEvent, normalizeLocalAppContractV1, normalizeSchema, parseAttemptRunId, signContractEvent, toStableToolName };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { V as V1ApiNamespace } from './errors-DXKB6v1J.js';
2
+ export { A as AuthenticationError, D as DeveloperApiClient, a as DeveloperApiError, N as NotFoundError, S as ServerError, b as ValidationError } from './errors-DXKB6v1J.js';
3
+
1
4
  /**
2
5
  * RealtimeX Local App SDK - Types
3
6
  */
@@ -1660,6 +1663,32 @@ declare class AuthModule {
1660
1663
  getAccessToken(): Promise<AuthTokenResponse | null>;
1661
1664
  }
1662
1665
 
1666
+ /**
1667
+ * Credentials Module — read-only access to user-managed credentials
1668
+ *
1669
+ * Credential values are encrypted at rest and decrypted only on get().
1670
+ * Values should NEVER be printed to stdout or included in agent responses.
1671
+ */
1672
+
1673
+ interface CredentialInfo {
1674
+ name: string;
1675
+ type: "http_header" | "query_auth" | "basic_auth" | "env_var";
1676
+ metadata: Record<string, any> | null;
1677
+ }
1678
+ interface CredentialPayload {
1679
+ name: string;
1680
+ type: string;
1681
+ payload: Record<string, string>;
1682
+ }
1683
+ declare class CredentialsModule {
1684
+ private httpClient;
1685
+ constructor(httpClient: HttpClient);
1686
+ /** List available credentials (names and types, no values). */
1687
+ list(): Promise<CredentialInfo[]>;
1688
+ /** Get a credential's decrypted payload by name. */
1689
+ get(name: string): Promise<CredentialPayload>;
1690
+ }
1691
+
1663
1692
  interface ContractHttpClientConfig {
1664
1693
  baseUrl: string;
1665
1694
  appId?: string;
@@ -1987,6 +2016,12 @@ declare class RealtimeXSDK {
1987
2016
  contractRuntime: ContractRuntime;
1988
2017
  database: DatabaseModule;
1989
2018
  auth: AuthModule;
2019
+ credentials: CredentialsModule;
2020
+ /**
2021
+ * Developer API (v1) — requires apiKey to be set in config.
2022
+ * Provides access to workspace management, admin, documents, system settings, and more.
2023
+ */
2024
+ v1: V1ApiNamespace | undefined;
1990
2025
  readonly appId: string;
1991
2026
  readonly appName: string | undefined;
1992
2027
  readonly apiKey: string | undefined;
@@ -2021,4 +2056,4 @@ declare class RealtimeXSDK {
2021
2056
  getAppDataDir(): Promise<string>;
2022
2057
  }
2023
2058
 
2024
- export { type ACPAdapterContext, type ACPAdapterTelemetryEvent, type ACPAdapterTelemetrySink, ACPContractAdapter, type ACPContractAdapterOptions, type ACPContractRuntime, ACPEventMapper, type ACPExecutionReference, type ACPNotifier, ACPPermissionBridge, type ACPSessionToolUpdate, type ACPSessionUpdateParams, ACPTelemetry, type ACPTextContent, type ACPToolInvocation, type ACPToolKind, type ACPToolStatus, type AcpAgentInfo, AcpAgentModule, type AcpAttachment, type AcpChatResponse, type AcpPermissionDecision, type AcpRuntimeOptionPatch, type AcpSession, type AcpSessionOptions, type AcpSessionStatus, type AcpStreamEvent, ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, AuthModule, type AuthProvider, type AuthTokenResponse, CONTRACT_ATTEMPT_PREFIX, CONTRACT_EVENT_ID_HEADER, CONTRACT_SIGNATURE_ALGORITHM, CONTRACT_SIGNATURE_HEADER, type CanonicalToolDefinition, type ChatContentBlock, type ChatCustomBlock, type ChatFileBlock, type ChatImageUrlBlock, type ChatMessage, type ChatMessageContent, type ChatOptions, type ChatResponse, type ChatTextBlock, ClaudeToolAdapter, type ClaudeToolCall, type ClaudeToolDefinition, type ClaudeToolResult, CodexToolAdapter, type CodexToolCall, type CodexToolDefinition, type CodexToolResult, ContractCache, type ContractCallbackMetadata, type ContractCallbackRules, type ContractCapability, type ContractCapabilityTrigger, ContractClient, type ContractClientOptions, type ContractDiscoveryResponse, ContractError, type ContractEventType, ContractHttpClient, type ContractHttpClientConfig, type ContractInvokePayload, ContractModule, ContractRuntime, type ContractRuntimeInterface, type ContractRuntimeOptions, type ContractSignInput, type ContractStrictness, ContractValidationError, type DatabaseConfig, DatabaseModule, type EmbedOptions, type EmbedResponse, type ExecutionContext, type ExecutionResult, type GeminiFunctionDeclaration, GeminiToolAdapter, type GeminiToolCall, type GeminiToolResult, type GetToolsInput, type HostToolAdapter, type IngestExecutionEventInput, LLMModule, LLMPermissionError, LLMProviderError, LOCAL_APP_CONTRACT_VERSION, type LegacyLocalAppContractShape, type LifecycleEventType, type LocalAppCapabilitiesResponse, type LocalAppCapabilityDetailResponse, type LocalAppCapabilitySearchResponse, type LocalAppContractDefinition, type LocalAppContractResponse, type LocalAppContractV1, MCPModule, type MCPServer, type MCPTool, type MCPToolResult, PermissionDeniedError, type PermissionOption, PermissionRequiredError, PortModule, type ProjectToolsInput, type Provider, type ProviderKind, type ProvidersResponse, RealtimeXSDK, RetryPolicy, type RetryPolicyOptions, type RuntimeExecutionEvent, RuntimeTransportError, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, ScopeDeniedError, ScopeGuard, StaticAuthProvider, type StaticAuthProviderOptions, type StreamChunk, type StreamChunkEvent, type SyncTokenResponse, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type ToolCall, ToolNotFoundError, ToolProjector, ToolValidationError, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace, buildContractIdempotencyKey, buildContractSignatureMessage, canonicalEventToLegacyAction, createContractEventId, hashContractPayload, normalizeAttemptId, normalizeContractEvent, normalizeLocalAppContractV1, normalizeSchema, parseAttemptRunId, signContractEvent, toStableToolName };
2059
+ export { type ACPAdapterContext, type ACPAdapterTelemetryEvent, type ACPAdapterTelemetrySink, ACPContractAdapter, type ACPContractAdapterOptions, type ACPContractRuntime, ACPEventMapper, type ACPExecutionReference, type ACPNotifier, ACPPermissionBridge, type ACPSessionToolUpdate, type ACPSessionUpdateParams, ACPTelemetry, type ACPTextContent, type ACPToolInvocation, type ACPToolKind, type ACPToolStatus, type AcpAgentInfo, AcpAgentModule, type AcpAttachment, type AcpChatResponse, type AcpPermissionDecision, type AcpRuntimeOptionPatch, type AcpSession, type AcpSessionOptions, type AcpSessionStatus, type AcpStreamEvent, ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, AuthModule, type AuthProvider, type AuthTokenResponse, CONTRACT_ATTEMPT_PREFIX, CONTRACT_EVENT_ID_HEADER, CONTRACT_SIGNATURE_ALGORITHM, CONTRACT_SIGNATURE_HEADER, type CanonicalToolDefinition, type ChatContentBlock, type ChatCustomBlock, type ChatFileBlock, type ChatImageUrlBlock, type ChatMessage, type ChatMessageContent, type ChatOptions, type ChatResponse, type ChatTextBlock, ClaudeToolAdapter, type ClaudeToolCall, type ClaudeToolDefinition, type ClaudeToolResult, CodexToolAdapter, type CodexToolCall, type CodexToolDefinition, type CodexToolResult, ContractCache, type ContractCallbackMetadata, type ContractCallbackRules, type ContractCapability, type ContractCapabilityTrigger, ContractClient, type ContractClientOptions, type ContractDiscoveryResponse, ContractError, type ContractEventType, ContractHttpClient, type ContractHttpClientConfig, type ContractInvokePayload, ContractModule, ContractRuntime, type ContractRuntimeInterface, type ContractRuntimeOptions, type ContractSignInput, type ContractStrictness, ContractValidationError, type DatabaseConfig, DatabaseModule, type EmbedOptions, type EmbedResponse, type ExecutionContext, type ExecutionResult, type GeminiFunctionDeclaration, GeminiToolAdapter, type GeminiToolCall, type GeminiToolResult, type GetToolsInput, type HostToolAdapter, type IngestExecutionEventInput, LLMModule, LLMPermissionError, LLMProviderError, LOCAL_APP_CONTRACT_VERSION, type LegacyLocalAppContractShape, type LifecycleEventType, type LocalAppCapabilitiesResponse, type LocalAppCapabilityDetailResponse, type LocalAppCapabilitySearchResponse, type LocalAppContractDefinition, type LocalAppContractResponse, type LocalAppContractV1, MCPModule, type MCPServer, type MCPTool, type MCPToolResult, PermissionDeniedError, type PermissionOption, PermissionRequiredError, PortModule, type ProjectToolsInput, type Provider, type ProviderKind, type ProvidersResponse, RealtimeXSDK, RetryPolicy, type RetryPolicyOptions, type RuntimeExecutionEvent, RuntimeTransportError, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, ScopeDeniedError, ScopeGuard, StaticAuthProvider, type StaticAuthProviderOptions, type StreamChunk, type StreamChunkEvent, type SyncTokenResponse, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type ToolCall, ToolNotFoundError, ToolProjector, ToolValidationError, type TriggerAgentPayload, type TriggerAgentResponse, V1ApiNamespace, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace, buildContractIdempotencyKey, buildContractSignatureMessage, canonicalEventToLegacyAction, createContractEventId, hashContractPayload, normalizeAttemptId, normalizeContractEvent, normalizeLocalAppContractV1, normalizeSchema, parseAttemptRunId, signContractEvent, toStableToolName };