rocketride 1.0.6 → 1.1.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.
Files changed (159) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/account.js +284 -0
  3. package/dist/cjs/account.js.map +1 -0
  4. package/dist/cjs/billing.js +171 -0
  5. package/dist/cjs/billing.js.map +1 -0
  6. package/dist/cjs/client.js +1208 -756
  7. package/dist/cjs/client.js.map +1 -1
  8. package/dist/cjs/constants.js +10 -1
  9. package/dist/cjs/constants.js.map +1 -1
  10. package/dist/cjs/core/DAPBase.js +4 -1
  11. package/dist/cjs/core/DAPBase.js.map +1 -1
  12. package/dist/cjs/core/DAPClient.js +121 -50
  13. package/dist/cjs/core/DAPClient.js.map +1 -1
  14. package/dist/cjs/core/TransportBase.js +0 -10
  15. package/dist/cjs/core/TransportBase.js.map +1 -1
  16. package/dist/cjs/core/TransportWebSocket.js +30 -19
  17. package/dist/cjs/core/TransportWebSocket.js.map +1 -1
  18. package/dist/cjs/database.js +121 -0
  19. package/dist/cjs/database.js.map +1 -0
  20. package/dist/cjs/index.js +4 -0
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/cjs/schema/Question.js +2 -0
  23. package/dist/cjs/schema/Question.js.map +1 -1
  24. package/dist/cjs/types/account.js +26 -0
  25. package/dist/cjs/types/account.js.map +1 -0
  26. package/dist/cjs/types/billing.js +26 -0
  27. package/dist/cjs/types/billing.js.map +1 -0
  28. package/dist/cjs/types/client.js +14 -0
  29. package/dist/cjs/types/client.js.map +1 -1
  30. package/dist/cjs/types/cprofile.js +26 -0
  31. package/dist/cjs/types/cprofile.js.map +1 -0
  32. package/dist/cjs/types/dashboard.js +26 -0
  33. package/dist/cjs/types/dashboard.js.map +1 -0
  34. package/dist/cjs/types/events.js +5 -1
  35. package/dist/cjs/types/events.js.map +1 -1
  36. package/dist/cjs/types/index.js +5 -0
  37. package/dist/cjs/types/index.js.map +1 -1
  38. package/dist/cjs/types/service.js +85 -0
  39. package/dist/cjs/types/service.js.map +1 -0
  40. package/dist/cli/cli/rocketride.js +335 -113
  41. package/dist/cli/cli/rocketride.js.map +1 -1
  42. package/dist/cli/client/account.js +284 -0
  43. package/dist/cli/client/account.js.map +1 -0
  44. package/dist/cli/client/billing.js +171 -0
  45. package/dist/cli/client/billing.js.map +1 -0
  46. package/dist/cli/client/client.js +1208 -756
  47. package/dist/cli/client/client.js.map +1 -1
  48. package/dist/cli/client/constants.js +10 -1
  49. package/dist/cli/client/constants.js.map +1 -1
  50. package/dist/cli/client/core/DAPBase.js +4 -1
  51. package/dist/cli/client/core/DAPBase.js.map +1 -1
  52. package/dist/cli/client/core/DAPClient.js +121 -50
  53. package/dist/cli/client/core/DAPClient.js.map +1 -1
  54. package/dist/cli/client/core/TransportBase.js +0 -10
  55. package/dist/cli/client/core/TransportBase.js.map +1 -1
  56. package/dist/cli/client/core/TransportWebSocket.js +30 -19
  57. package/dist/cli/client/core/TransportWebSocket.js.map +1 -1
  58. package/dist/cli/client/database.js +121 -0
  59. package/dist/cli/client/database.js.map +1 -0
  60. package/dist/cli/client/index.js +4 -0
  61. package/dist/cli/client/index.js.map +1 -1
  62. package/dist/cli/client/schema/Question.js +2 -0
  63. package/dist/cli/client/schema/Question.js.map +1 -1
  64. package/dist/cli/client/types/account.js +26 -0
  65. package/dist/cli/client/types/account.js.map +1 -0
  66. package/dist/cli/client/types/billing.js +26 -0
  67. package/dist/cli/client/types/billing.js.map +1 -0
  68. package/dist/cli/client/types/client.js +14 -0
  69. package/dist/cli/client/types/client.js.map +1 -1
  70. package/dist/cli/client/types/cprofile.js +26 -0
  71. package/dist/cli/client/types/cprofile.js.map +1 -0
  72. package/dist/cli/client/types/dashboard.js +26 -0
  73. package/dist/cli/client/types/dashboard.js.map +1 -0
  74. package/dist/cli/client/types/events.js +5 -1
  75. package/dist/cli/client/types/events.js.map +1 -1
  76. package/dist/cli/client/types/index.js +5 -0
  77. package/dist/cli/client/types/index.js.map +1 -1
  78. package/dist/cli/client/types/service.js +85 -0
  79. package/dist/cli/client/types/service.js.map +1 -0
  80. package/dist/esm/account.js +280 -0
  81. package/dist/esm/account.js.map +1 -0
  82. package/dist/esm/billing.js +167 -0
  83. package/dist/esm/billing.js.map +1 -0
  84. package/dist/esm/client.js +1208 -756
  85. package/dist/esm/client.js.map +1 -1
  86. package/dist/esm/constants.js +9 -0
  87. package/dist/esm/constants.js.map +1 -1
  88. package/dist/esm/core/DAPBase.js +4 -1
  89. package/dist/esm/core/DAPBase.js.map +1 -1
  90. package/dist/esm/core/DAPClient.js +121 -50
  91. package/dist/esm/core/DAPClient.js.map +1 -1
  92. package/dist/esm/core/TransportBase.js +0 -10
  93. package/dist/esm/core/TransportBase.js.map +1 -1
  94. package/dist/esm/core/TransportWebSocket.js +30 -19
  95. package/dist/esm/core/TransportWebSocket.js.map +1 -1
  96. package/dist/esm/database.js +117 -0
  97. package/dist/esm/database.js.map +1 -0
  98. package/dist/esm/index.js +4 -0
  99. package/dist/esm/index.js.map +1 -1
  100. package/dist/esm/schema/Question.js +2 -0
  101. package/dist/esm/schema/Question.js.map +1 -1
  102. package/dist/esm/types/account.js +25 -0
  103. package/dist/esm/types/account.js.map +1 -0
  104. package/dist/esm/types/billing.js +25 -0
  105. package/dist/esm/types/billing.js.map +1 -0
  106. package/dist/esm/types/client.js +13 -1
  107. package/dist/esm/types/client.js.map +1 -1
  108. package/dist/esm/types/cprofile.js +25 -0
  109. package/dist/esm/types/cprofile.js.map +1 -0
  110. package/dist/esm/types/dashboard.js +25 -0
  111. package/dist/esm/types/dashboard.js.map +1 -0
  112. package/dist/esm/types/events.js +5 -1
  113. package/dist/esm/types/events.js.map +1 -1
  114. package/dist/esm/types/index.js +5 -0
  115. package/dist/esm/types/index.js.map +1 -1
  116. package/dist/esm/types/service.js +82 -0
  117. package/dist/esm/types/service.js.map +1 -0
  118. package/dist/types/account.d.ts +209 -0
  119. package/dist/types/account.d.ts.map +1 -0
  120. package/dist/types/billing.d.ts +135 -0
  121. package/dist/types/billing.d.ts.map +1 -0
  122. package/dist/types/client.d.ts +553 -285
  123. package/dist/types/client.d.ts.map +1 -1
  124. package/dist/types/constants.d.ts +9 -0
  125. package/dist/types/constants.d.ts.map +1 -1
  126. package/dist/types/core/DAPBase.d.ts.map +1 -1
  127. package/dist/types/core/DAPClient.d.ts +89 -7
  128. package/dist/types/core/DAPClient.d.ts.map +1 -1
  129. package/dist/types/core/TransportBase.d.ts +1 -11
  130. package/dist/types/core/TransportBase.d.ts.map +1 -1
  131. package/dist/types/core/TransportWebSocket.d.ts +14 -11
  132. package/dist/types/core/TransportWebSocket.d.ts.map +1 -1
  133. package/dist/types/database.d.ts +90 -0
  134. package/dist/types/database.d.ts.map +1 -0
  135. package/dist/types/index.d.ts +2 -0
  136. package/dist/types/index.d.ts.map +1 -1
  137. package/dist/types/schema/Question.d.ts +3 -1
  138. package/dist/types/schema/Question.d.ts.map +1 -1
  139. package/dist/types/types/account.d.ts +171 -0
  140. package/dist/types/types/account.d.ts.map +1 -0
  141. package/dist/types/types/billing.d.ts +115 -0
  142. package/dist/types/types/billing.d.ts.map +1 -0
  143. package/dist/types/types/client.d.ts +241 -1
  144. package/dist/types/types/client.d.ts.map +1 -1
  145. package/dist/types/types/cprofile.d.ts +67 -0
  146. package/dist/types/types/cprofile.d.ts.map +1 -0
  147. package/dist/types/types/dashboard.d.ts +198 -0
  148. package/dist/types/types/dashboard.d.ts.map +1 -0
  149. package/dist/types/types/events.d.ts +90 -95
  150. package/dist/types/types/events.d.ts.map +1 -1
  151. package/dist/types/types/index.d.ts +5 -0
  152. package/dist/types/types/index.d.ts.map +1 -1
  153. package/dist/types/types/pipeline.d.ts +10 -2
  154. package/dist/types/types/pipeline.d.ts.map +1 -1
  155. package/dist/types/types/service.d.ts +189 -0
  156. package/dist/types/types/service.d.ts.map +1 -0
  157. package/dist/types/types/task.d.ts +5 -1
  158. package/dist/types/types/task.d.ts.map +1 -1
  159. package/package.json +12 -7
@@ -22,9 +22,12 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
  import { DAPClient } from './core/DAPClient.js';
25
- import { DAPMessage, RocketRideClientConfig } from './types/index.js';
26
- import { TASK_STATUS, UPLOAD_RESULT, PIPELINE_RESULT, PipelineConfig } from './types/index.js';
25
+ import { DAPMessage, RocketRideClientConfig, ConnectResult, ServerInfoResult } from './types/index.js';
26
+ import { TASK_STATUS, UPLOAD_RESULT, PIPELINE_RESULT, PipelineConfig, DashboardResponse, ServicesResponse, ServiceDefinition, ValidationResult, CProfileStatusResponse, CProfileStopResponse, CProfileReportResponse } from './types/index.js';
27
27
  import { Question } from './schema/Question.js';
28
+ import { AccountApi } from './account.js';
29
+ import { BillingApi } from './billing.js';
30
+ import { DatabaseApi } from './database.js';
28
31
  /**
29
32
  * Streaming data pipe for sending large datasets to RocketRide pipelines.
30
33
  *
@@ -91,7 +94,8 @@ export declare class DataPipe {
91
94
  * unique pipe ID that is used for subsequent operations.
92
95
  *
93
96
  * @returns This DataPipe instance (for method chaining)
94
- * @throws Error if the pipe is already opened or if the pipeline is not running
97
+ * @throws Error if the pipe is already opened
98
+ * @throws PipeException if the server rejects the open request
95
99
  */
96
100
  open(): Promise<DataPipe>;
97
101
  /**
@@ -101,7 +105,8 @@ export declare class DataPipe {
101
105
  * multiple times to stream large datasets. The pipe must be opened first.
102
106
  *
103
107
  * @param buffer - Data to write, must be a Uint8Array
104
- * @throws Error if the pipe is not opened, buffer is invalid, or write fails
108
+ * @throws Error if the pipe is not opened or buffer is invalid
109
+ * @throws PipeException if the server reports a write failure
105
110
  */
106
111
  write(buffer: Uint8Array): Promise<void>;
107
112
  /**
@@ -112,7 +117,7 @@ export declare class DataPipe {
112
117
  * the pipe cannot be reopened or written to again.
113
118
  *
114
119
  * @returns The processing result from the server, or undefined if already closed
115
- * @throws Error if closing the pipe fails
120
+ * @throws PipeException if the server reports a failure while finalizing the pipe
116
121
  */
117
122
  close(): Promise<PIPELINE_RESULT | undefined>;
118
123
  }
@@ -134,9 +139,23 @@ export declare class DataPipe {
134
139
  * - Server connectivity testing (ping)
135
140
  * - Full TypeScript type safety
136
141
  */
142
+ /**
143
+ * Identifies a monitor subscription key.
144
+ *
145
+ * - `{ token }` — monitors a specific running task by its session token.
146
+ * - `{ projectId, source }` — monitors a project/source regardless of task.
147
+ */
148
+ export type MonitorKey = {
149
+ token: string;
150
+ } | {
151
+ projectId: string;
152
+ source: string;
153
+ pipeId?: number;
154
+ };
137
155
  export declare class RocketRideClient extends DAPClient {
138
156
  private _uri;
139
157
  private _apikey?;
158
+ private _wsPath?;
140
159
  private _env;
141
160
  private _callerOnEvent?;
142
161
  private _callerOnConnected?;
@@ -147,14 +166,21 @@ export declare class RocketRideClient extends DAPClient {
147
166
  private _nextChatId;
148
167
  /** Maps pipe_id → SSE callback for pipe-scoped real-time event dispatch. */
149
168
  readonly _ssePipeCallbacks: Map<number, (type: string, data: Record<string, unknown>) => Promise<void>>;
169
+ private _desiredState;
170
+ private _authenticated;
150
171
  private _persist;
151
- private _reconnectTimeout?;
152
- private _manualDisconnect;
153
- private _maxRetryTime?;
154
- private _retryStartTime?;
172
+ private _reconnectTimer?;
155
173
  private _currentReconnectDelay;
156
- /** True after onConnected has been invoked; used to only invoke onDisconnected when we had a connection. */
157
- private _didNotifyConnected;
174
+ /** Reference-counted monitor subscriptions: keyString Map<eventType, refCount> */
175
+ private _monitorKeys;
176
+ /** Lazily-created account API namespace. */
177
+ private _account?;
178
+ /** Lazily-created billing API namespace. */
179
+ private _billing?;
180
+ /** Lazily-created database API namespace. */
181
+ private _database?;
182
+ /** Optional trace callback for observing all call() traffic. */
183
+ private _onTrace?;
158
184
  /**
159
185
  * Creates a new RocketRideClient instance.
160
186
  *
@@ -209,6 +235,27 @@ export declare class RocketRideClient extends DAPClient {
209
235
  * passing it to the client or doing your own validation.
210
236
  */
211
237
  static normalizeUri(uri: string): string;
238
+ /**
239
+ * Probe a server for its capabilities without authenticating.
240
+ *
241
+ * Creates a temporary public connection and sends an
242
+ * ``rrext_public_probe`` command. The server responds with version,
243
+ * capabilities, platform, and public apps without requiring credentials.
244
+ *
245
+ * @param uri - Server URI (e.g. ``"localhost:5565"``, ``"https://cloud.rocketride.ai"``)
246
+ * @param timeout - Optional timeout in ms for the entire operation
247
+ * @returns Server info including version and capability tags
248
+ * @throws Error if the server is unreachable or does not support probes
249
+ *
250
+ * @example
251
+ * ```typescript
252
+ * const info = await RocketRideClient.getServerInfo('localhost:5565');
253
+ * if (info.capabilities.includes('saas')) {
254
+ * // Show cloud sign-in options
255
+ * }
256
+ * ```
257
+ */
258
+ static getServerInfo(uri: string, timeout?: number): Promise<ServerInfoResult>;
212
259
  /**
213
260
  * Normalize a user-provided URI into a fully-formed WebSocket address.
214
261
  * Builds on normalizeUri, then converts to ws/wss and appends /task/service.
@@ -223,61 +270,137 @@ export declare class RocketRideClient extends DAPClient {
223
270
  */
224
271
  private _setAuth;
225
272
  /**
226
- * Clear any pending reconnection timeout.
273
+ * Create transport if needed and open the WebSocket. No auth.
227
274
  */
228
- private _clearReconnectTimeout;
275
+ private _internalAttach;
229
276
  /**
230
- * Single place for physical connection. Creates transport if needed, then
231
- * calls DAPClient.connect (transport connect + auth handshake + onConnected).
277
+ * Send the ``auth`` DAP command over the open transport.
278
+ * Sets ``_authenticated`` and ``_connectResult`` on success.
279
+ * Throws ``AuthenticationException`` on failure (transport stays open).
232
280
  */
233
- private _internalConnect;
281
+ private _internalLogin;
234
282
  /**
235
- * Single place for physical disconnect. Closes the transport directly,
236
- * which triggers onDisconnected via the transport callback.
283
+ * Send the ``deauth`` DAP command to revert to unauthenticated.
284
+ */
285
+ private _internalLogout;
286
+ /**
287
+ * Close the transport. Triggers onDisconnected via the transport callback.
237
288
  */
238
289
  private _internalDisconnect;
239
290
  /**
240
- * Try to connect; on auth error notify and stop; on other error notify and
241
- * reschedule with exponential backoff. Used by persist-mode connect() and
242
- * by the reconnect timer.
291
+ * Clear the reconnect timer if active.
243
292
  */
244
- private _attemptConnection;
293
+ private _clearReconnectTimer;
245
294
  /**
246
- * Schedule a reconnection attempt with exponential backoff.
295
+ * Reconnect engine driven by ``_desiredState``.
296
+ *
297
+ * Schedules a timer that re-attaches (and re-logins if the user had
298
+ * been authenticated). Checks ``_desiredState`` after every await so
299
+ * user actions mid-reconnect are respected immediately.
300
+ *
301
+ * Linear backoff: 250ms → 500ms → ... → 15 000ms cap.
247
302
  */
248
303
  private _scheduleReconnect;
304
+ /**
305
+ * Attach to a RocketRide server (open WebSocket, no auth).
306
+ *
307
+ * If ``uri`` is provided and differs from the current URI, detaches
308
+ * first. If already attached to the same URI, this is a no-op.
309
+ *
310
+ * After attach, public APIs (``rrext_public_*``) are available.
311
+ *
312
+ * @param uri - Server URI override. Updates the stored URI if provided.
313
+ * @param options - Optional timeout for the WebSocket handshake.
314
+ */
315
+ attach(uri?: string, options?: {
316
+ timeout?: number;
317
+ }): Promise<void>;
318
+ /**
319
+ * Detach from the server (close WebSocket, cancel reconnection).
320
+ *
321
+ * Sets ``_desiredState`` to ``'detached'`` so the reconnect engine
322
+ * stops and ``onDisconnected`` does not restart it.
323
+ */
324
+ detach(): Promise<void>;
325
+ /**
326
+ * True when the WebSocket transport is connected (regardless of auth).
327
+ */
328
+ isAttached(): boolean;
329
+ /**
330
+ * Authenticate over an attached transport.
331
+ *
332
+ * If ``uri`` is provided and differs, detaches and re-attaches first.
333
+ * If ``auth`` is provided and differs from the current credential,
334
+ * logs out (best-effort) before logging in with the new credential.
335
+ * If already authenticated with the same credential, this is a no-op.
336
+ *
337
+ * @param credential - API key, rr_ token, or PKCE code object.
338
+ * @param options - Optional URI override and/or timeout.
339
+ * @returns ConnectResult with user identity on success.
340
+ * @throws AuthenticationException on auth failure (transport stays attached).
341
+ */
342
+ login(credential?: string | {
343
+ code: string;
344
+ verifier: string;
345
+ redirectUri: string;
346
+ }, options?: {
347
+ uri?: string;
348
+ timeout?: number;
349
+ }): Promise<ConnectResult>;
350
+ /**
351
+ * Deauthenticate: sends ``deauth`` to the server, clears client auth state.
352
+ * The transport stays attached — public APIs continue to work.
353
+ */
354
+ logout(): Promise<void>;
355
+ /**
356
+ * True when the auth handshake has succeeded on the current connection.
357
+ */
358
+ isAuthenticated(): boolean;
249
359
  /**
250
360
  * Check if the client is currently connected to the RocketRide server.
361
+ * Equivalent to ``isAttached()`` — kept for backward compatibility.
251
362
  */
252
363
  isConnected(): boolean;
253
364
  /**
254
- * Connect to the RocketRide server.
365
+ * Connect to the RocketRide server and authenticate in a single call.
366
+ *
367
+ * Backward-compatible wrapper around ``attach()`` + ``login()``.
368
+ * Sends the credential as the first DAP message and returns the full
369
+ * ConnectResult (user identity + organizations + teams) on success.
255
370
  *
256
- * Must be called before executing pipelines or other operations.
257
- * In persist mode, enables automatic reconnection on disconnect and on initial failure
258
- * (calls onConnectError on each failed attempt and keeps retrying).
259
- * @param options - Optional timeout (number) or connection parameters object with uri, auth, and timeout.
371
+ * @param credential - API key / Zitadel access_token / rr_ user token / PKCE code object.
372
+ * @param options - Optional overrides: uri and/or timeout.
260
373
  */
261
- connect(options?: number | {
374
+ connect(credential?: string | {
375
+ code: string;
376
+ verifier: string;
377
+ redirectUri: string;
378
+ }, options?: {
262
379
  uri?: string;
263
- auth?: string;
264
380
  timeout?: number;
265
- }): Promise<void>;
381
+ }): Promise<ConnectResult>;
382
+ /**
383
+ * Get the ConnectResult from the last successful connect().
384
+ * Returns undefined if not connected or not yet authenticated.
385
+ */
386
+ getAccountInfo(): ConnectResult | undefined;
387
+ /**
388
+ * Returns the ID of the user's primary organization.
389
+ */
390
+ getOrgId(): string | undefined;
266
391
  /**
267
392
  * Disconnect from the RocketRide server and stop automatic reconnection.
268
- *
269
- * Should be called when finished with the client to clean up resources.
393
+ * Backward-compatible wrapper around ``logout()`` + ``detach()``.
270
394
  */
271
395
  disconnect(): Promise<void>;
272
396
  /**
273
- * Update server URI and/or auth at runtime. If currently connected,
274
- * disconnects and reconnects with the new params. In persist mode,
275
- * reconnection is scheduled only if we were connected.
276
- */
277
- setConnectionParams(options: {
278
- uri?: string;
279
- auth?: string;
280
- }): Promise<void>;
397
+ * Update the environment variables used for pipeline substitution.
398
+ *
399
+ * The env dictionary is used by {@link use} and {@link validate} to replace
400
+ // ============================================================================
401
+ // PING METHODS
402
+ // ============================================================================
403
+
281
404
  /**
282
405
  * Test connectivity to the RocketRide server.
283
406
  *
@@ -286,17 +409,6 @@ export declare class RocketRideClient extends DAPClient {
286
409
  * and measuring response times.
287
410
  */
288
411
  ping(token?: string): Promise<void>;
289
- /**
290
- * Substitute environment variables in a string.
291
- * Replaces ${ROCKETRIDE_*} patterns with values from client's env dictionary.
292
- * If variable is not found, leaves it unchanged.
293
- */
294
- private substituteEnvVars;
295
- /**
296
- * Recursively process an object/array to substitute environment variables.
297
- * Only processes string values, leaving other types unchanged.
298
- */
299
- private processEnvSubstitution;
300
412
  /**
301
413
  * Load Node.js fs/promises at runtime without static imports.
302
414
  * This keeps browser bundles free of Node built-ins while preserving Node features.
@@ -334,7 +446,7 @@ export declare class RocketRideClient extends DAPClient {
334
446
  validate(options: {
335
447
  pipeline: PipelineConfig | Record<string, unknown>;
336
448
  source?: string;
337
- }): Promise<Record<string, unknown>>;
449
+ }): Promise<ValidationResult>;
338
450
  /**
339
451
  * Start an RocketRide pipeline for processing data.
340
452
  *
@@ -389,6 +501,12 @@ export declare class RocketRideClient extends DAPClient {
389
501
  ttl?: number;
390
502
  /** Pipeline trace level. When set, captures every lane write and invoke call in the response under '_trace'. */
391
503
  pipelineTraceLevel?: 'none' | 'metadata' | 'summary' | 'full';
504
+ /** Optional display name for the task (e.g. shown in dashboard). */
505
+ name?: string;
506
+ /** ROCKETRIDE_* environment overrides merged on top of server-side env. */
507
+ env?: Record<string, string>;
508
+ /** Team ID to run the task under. Defaults to the user's default team. */
509
+ teamId?: string;
392
510
  }): Promise<Record<string, unknown> & {
393
511
  token: string;
394
512
  }>;
@@ -396,10 +514,56 @@ export declare class RocketRideClient extends DAPClient {
396
514
  * Terminate a running pipeline.
397
515
  */
398
516
  terminate(token: string): Promise<void>;
517
+ /**
518
+ * Restart a running pipeline with a new configuration.
519
+ *
520
+ * Looks up the existing task by project/source, terminates it, and
521
+ * starts a new execution in one server round-trip.
522
+ *
523
+ * @param options.token - Existing task token (optional, resolved server-side if omitted).
524
+ * @param options.projectId - The project identifier.
525
+ * @param options.source - The source component identifier.
526
+ * @param options.pipeline - The pipeline configuration to restart with.
527
+ */
528
+ restart(options: {
529
+ token?: string;
530
+ projectId: string;
531
+ source: string;
532
+ pipeline: Record<string, unknown>;
533
+ }): Promise<void>;
399
534
  /**
400
535
  * Get the current status of a running pipeline.
536
+ *
537
+ * By default this call is bounded to 15s so callers/tests don't hang forever if the engine
538
+ * stops responding mid-request (especially important in CI). Pass `{ timeout: false }` to
539
+ * restore the previous behavior of using only the client-level request timeout (if any).
540
+ */
541
+ getTaskStatus(token: string, options?: {
542
+ timeout?: number | false;
543
+ }): Promise<TASK_STATUS>;
544
+ /**
545
+ * Resolve a running task's token from its project ID and source component.
546
+ *
547
+ * The token is required for operations like terminate and restart.
548
+ * Returns undefined if no task is currently running for the given project/source.
549
+ *
550
+ * @param options.projectId - The project identifier.
551
+ * @param options.source - The source component identifier.
401
552
  */
402
- getTaskStatus(token: string): Promise<TASK_STATUS>;
553
+ getTaskToken(options: {
554
+ projectId: string;
555
+ source: string;
556
+ }): Promise<string | undefined>;
557
+ /**
558
+ * Returns the unresolved pipeline for a running task.
559
+ *
560
+ * The pipeline is returned exactly as stored — ${ROCKETRIDE_*} placeholders are
561
+ * NOT substituted, so no secrets are included in the response.
562
+ *
563
+ * @param token - Task token returned by {@link getTaskToken}.
564
+ * @returns The unresolved pipeline dict, or undefined if the task is not found.
565
+ */
566
+ getTaskPipeline(token: string): Promise<Record<string, unknown> | undefined>;
403
567
  /** Return objinfo with size set; never 0 (parse filter skips "empty"). */
404
568
  private _objinfoWithSize;
405
569
  /**
@@ -472,295 +636,343 @@ export declare class RocketRideClient extends DAPClient {
472
636
  */
473
637
  onConnectError(error: Error): Promise<void>;
474
638
  /**
475
- * Handle connected events from the RocketRide server.
639
+ * Handle transport-level connected event.
640
+ *
641
+ * With the attach/login split, this fires when the WebSocket opens
642
+ * (before auth). The ``_internalLogin`` method handles the auth
643
+ * notification separately, so this is intentionally minimal.
476
644
  */
477
645
  onConnected(connectionInfo: string): Promise<void>;
478
646
  /**
479
- * Handle disconnected events from the RocketRide server.
480
- * Only invokes the user's onDisconnected if onConnected had previously been called
481
- * (so "disconnect without ever connecting" does not fire the user callback).
647
+ * Handle transport disconnection.
648
+ *
649
+ * Clears transport and auth state, notifies the user callback,
650
+ * then consults ``_desiredState`` to decide whether to reconnect.
482
651
  */
483
652
  onDisconnected(reason: string, hasError: boolean): Promise<void>;
484
653
  /**
485
654
  * Subscribe to specific types of events from the server.
655
+ * @deprecated Use {@link addMonitor} / {@link removeMonitor} instead.
486
656
  */
487
657
  setEvents(token: string, eventTypes: string[], pipeId?: number): Promise<void>;
488
658
  /**
489
- * Save or update a project pipeline.
659
+ * Add a monitor subscription. If the key already exists, the new types are
660
+ * merged via reference counting and the merged set is sent to the server.
490
661
  *
491
- * Stores a project pipeline configuration on the server. If the project
492
- * already exists, it will be updated. Use expectedVersion to ensure
493
- * you're updating the version you expect (prevents conflicts).
662
+ * @param key - Monitor key: `{ token }` for a running task, or `{ projectId, source }` for a project.
663
+ * @param types - Event types to subscribe to (e.g. `['summary', 'flow']`).
664
+ */
665
+ addMonitor(key: MonitorKey, types: string[]): Promise<void>;
666
+ /**
667
+ * Remove a monitor subscription. Decrements reference counts for the given
668
+ * types. Only unsubscribes a type from the server when its count reaches 0.
494
669
  *
495
- * @param options - Save project options
496
- * @param options.projectId - Unique identifier for the project
497
- * @param options.pipeline - Pipeline configuration object
498
- * @param options.expectedVersion - Expected current version for atomic updates (optional)
499
- * @returns Promise resolving to save result with success status, projectId, and new version
500
- * @throws Error if save fails due to version mismatch, storage error, or invalid input
670
+ * @param key - Monitor key (must match the key used in addMonitor).
671
+ * @param types - Event types to unsubscribe from.
672
+ */
673
+ removeMonitor(key: MonitorKey, types: string[]): Promise<void>;
674
+ /**
675
+ * Send the merged type list for a monitor key to the server.
676
+ */
677
+ private _syncMonitor;
678
+ /**
679
+ * Replay all active monitor subscriptions to the server.
680
+ * Called automatically after reconnection.
681
+ */
682
+ private _resubscribeAllMonitors;
683
+ /**
684
+ * Convert a MonitorKey to a stable string for map lookup.
685
+ */
686
+ private _monitorKeyToString;
687
+ /**
688
+ * Reverse a key-string back to a MonitorKey (for resubscribeAll).
689
+ */
690
+ private _monitorStringToKey;
691
+ /**
692
+ * Persist a pipeline configuration as a named template in the account store.
501
693
  *
502
- * @example
503
- * ```typescript
504
- * // Save a new project
505
- * const result = await client.saveProject({
506
- * projectId: 'proj-123',
507
- * pipeline: {
508
- * name: 'Data Processor',
509
- * source: 'source_1',
510
- * components: [...]
511
- * }
512
- * });
513
- * console.log(`Saved version: ${result.version}`);
514
- *
515
- * // Update existing project with version check
516
- * const existing = await client.getProject({ projectId: 'proj-123' });
517
- * existing.name = 'Updated Name';
518
- * const updated = await client.saveProject({
519
- * projectId: 'proj-123',
520
- * pipeline: existing,
521
- * expectedVersion: existing.version
522
- * });
523
- * ```
694
+ * Templates are stored as JSON files under `.templates/<templateId>.json`.
695
+ * Saving a template with an existing ID overwrites the previous version.
696
+ *
697
+ * @param options.templateId - Unique identifier for the template (no path separators)
698
+ * @param options.pipeline - Pipeline configuration object to save
699
+ * @throws Error if templateId is invalid or pipeline is not a non-empty object
524
700
  */
525
- saveProject(options: {
526
- projectId: string;
701
+ saveTemplate(options: {
702
+ templateId: string;
527
703
  pipeline: Record<string, any>;
528
- expectedVersion?: string;
529
- }): Promise<{
530
- success: boolean;
531
- project_id: string;
532
- version: string;
533
- }>;
704
+ }): Promise<void>;
534
705
  /**
535
- * Retrieve a project by its ID.
706
+ * Retrieve a previously saved pipeline template from the account store.
536
707
  *
537
- * Fetches the complete pipeline configuration and current version for
538
- * the specified project. Use this before updating to get the current
539
- * version for atomic updates.
708
+ * @param options.templateId - Unique identifier of the template to retrieve
709
+ * @returns The pipeline configuration object that was saved
710
+ * @throws Error if the template does not exist or templateId is invalid
711
+ */
712
+ getTemplate(options: {
713
+ templateId: string;
714
+ }): Promise<Record<string, any>>;
715
+ /**
716
+ * Delete a pipeline template from the account store.
540
717
  *
541
- * @param options - Get project options
542
- * @param options.projectId - Unique identifier of the project to retrieve
543
- * @returns Promise resolving to project data with success status, pipeline, and version
544
- * @throws Error if project doesn't exist or retrieval fails
718
+ * @param options.templateId - Unique identifier of the template to delete
719
+ * @throws Error if the template does not exist or templateId is invalid
720
+ */
721
+ deleteTemplate(options: {
722
+ templateId: string;
723
+ }): Promise<void>;
724
+ /**
725
+ * List all pipeline templates stored in the account store.
545
726
  *
546
- * @example
547
- * ```typescript
548
- * // Get a project
549
- * try {
550
- * const project = await client.getProject({ projectId: 'proj-123' });
551
- * console.log(`Project: ${project.name}`);
552
- * console.log(`Version: ${project.version}`);
553
- * } catch (error) {
554
- * if (error.message.includes('NOT_FOUND')) {
555
- * console.log("Project doesn't exist");
556
- * }
557
- * }
727
+ * Reads the `.templates` directory, parses each `.json` file, and extracts
728
+ * a summary for each template. Files that cannot be parsed are silently
729
+ * skipped so a single corrupt template does not break the entire listing.
558
730
  *
559
- * // Before updating - get current version
560
- * const project = await client.getProject({ projectId: 'proj-123' });
561
- * project.name = 'Updated';
562
- * await client.saveProject({
563
- * projectId: 'proj-123',
564
- * pipeline: project,
565
- * expectedVersion: project.version
566
- * });
567
- * ```
731
+ * @returns Array of template summaries sorted in directory-listing order.
732
+ * Each entry contains the template ID, display name, source components,
733
+ * and total component count.
734
+ */
735
+ getAllTemplates(): Promise<Array<{
736
+ id: string;
737
+ name: string;
738
+ sources: any[];
739
+ totalComponents: number;
740
+ }>>;
741
+ /**
742
+ * Persist a pipeline execution log to the account store.
743
+ *
744
+ * Logs are stored under `.logs/<projectId>/<source>-<startTime>.log`.
745
+ * The filename is derived from `contents.body.startTime` so logs are
746
+ * naturally sortable by execution start time.
747
+ *
748
+ * @param options.projectId - Project identifier that owns this log
749
+ * @param options.source - Source component identifier the log is associated with
750
+ * @param options.contents - Log payload; must contain `body.startTime`
751
+ * @returns The generated filename (e.g. `"ingest-1714000000000.log"`)
752
+ * @throws Error if any ID is invalid, contents is not an object, or startTime is missing
568
753
  */
569
- getProject(options: {
754
+ saveLog(options: {
570
755
  projectId: string;
571
- }): Promise<{
572
- success: boolean;
573
- pipeline: Record<string, any>;
574
- version: string;
575
- }>;
756
+ source: string;
757
+ contents: Record<string, any>;
758
+ }): Promise<string>;
576
759
  /**
577
- * Delete a project by its ID.
760
+ * Retrieve a previously saved pipeline execution log from the account store.
578
761
  *
579
- * Permanently removes a project from storage. Optionally verify the
580
- * version before deletion to ensure you're deleting the version you
581
- * expect (prevents accidental deletion of modified projects).
762
+ * @param options.projectId - Project identifier that owns the log
763
+ * @param options.name - Filename of the log (as returned by saveLog)
764
+ * @returns The log payload that was saved
765
+ * @throws Error if the log does not exist or projectId is invalid
766
+ */
767
+ getLog(options: {
768
+ projectId: string;
769
+ name: string;
770
+ }): Promise<Record<string, any>>;
771
+ /**
772
+ * Delete a pipeline execution log from the account store.
582
773
  *
583
- * @param options - Delete project options
584
- * @param options.projectId - Unique identifier of the project to delete
585
- * @param options.expectedVersion - Expected current version for atomic deletion (required)
586
- * @returns Promise resolving to deletion result with success status and message
587
- * @throws Error if project doesn't exist, version mismatch, or deletion fails
774
+ * @param options.projectId - Project identifier that owns the log
775
+ * @param options.name - Filename of the log to delete
776
+ * @throws Error if the log does not exist or projectId is invalid
777
+ */
778
+ deleteLog(options: {
779
+ projectId: string;
780
+ name: string;
781
+ }): Promise<void>;
782
+ /**
783
+ * List pipeline execution logs stored for a project, optionally filtered by source.
588
784
  *
589
- * @example
590
- * ```typescript
591
- * // Safe deletion with version check
592
- * const project = await client.getProject({ projectId: 'proj-123' });
593
- * try {
594
- * const result = await client.deleteProject({
595
- * projectId: 'proj-123',
596
- * expectedVersion: project.version
597
- * });
598
- * console.log('Project deleted successfully');
599
- * } catch (error) {
600
- * if (error.message.includes('CONFLICT')) {
601
- * console.log('Project was modified, deletion cancelled');
602
- * }
603
- * }
604
- * ```
785
+ * Results are sorted ascending by `modified` timestamp so the oldest log
786
+ * appears first. The caller can page through or slice the array as needed.
787
+ *
788
+ * @param options.projectId - Project identifier whose logs to list
789
+ * @param options.source - Optional source component filter; when set, only logs
790
+ * whose filename starts with `<source>-` are returned
791
+ * @returns Array of log name and optional modified timestamp, sorted oldest-first
792
+ * @throws Error if projectId (or source when provided) is invalid
605
793
  */
606
- deleteProject(options: {
794
+ listLogs(options: {
607
795
  projectId: string;
608
- expectedVersion?: string;
609
- }): Promise<{
610
- success: boolean;
611
- message: string;
796
+ source?: string;
797
+ }): Promise<Array<{
798
+ name: string;
799
+ modified?: number;
800
+ }>>;
801
+ /**
802
+ * Open a file handle for reading or writing.
803
+ *
804
+ * @param path - Relative path within the account store
805
+ * @param mode - 'r' for read, 'w' for write (default: 'r')
806
+ * @param offset - Initial byte offset (read mode only)
807
+ * @returns Object with 'handle' (string). Read mode also includes 'size' (number).
808
+ */
809
+ fsOpen(path: string, mode?: 'r' | 'w'): Promise<{
810
+ handle: string;
811
+ size?: number;
612
812
  }>;
613
813
  /**
614
- * List all projects for the current user.
814
+ * Read data from an open read handle.
615
815
  *
616
- * Retrieves a summary of all projects stored for the authenticated user.
617
- * Each project summary includes the ID, name, list of data sources, and total component count.
816
+ * @param handle - Handle ID returned by fsOpen
817
+ * @param offset - Byte offset to read from
818
+ * @param length - Max bytes to read (default 4 MB). Empty Uint8Array indicates EOF.
819
+ * @returns The bytes read
820
+ */
821
+ fsRead(handle: string, offset?: number, length?: number): Promise<Uint8Array>;
822
+ /**
823
+ * Write data to an open write handle.
824
+ *
825
+ * @param handle - Handle ID returned by fsOpen
826
+ * @param data - Raw bytes to write
827
+ * @returns Number of bytes written
828
+ */
829
+ fsWrite(handle: string, data: Uint8Array): Promise<number>;
830
+ /**
831
+ * Close a file handle.
618
832
  *
619
- * @returns Promise resolving to list result with success status, projects array, and count
620
- * @throws Error if retrieval fails
833
+ * @param handle - Handle ID returned by fsOpen
834
+ * @param mode - 'r' or 'w' (must match the mode used in fsOpen)
835
+ */
836
+ fsClose(handle: string, mode: 'r' | 'w'): Promise<void>;
837
+ /**
838
+ * Delete a file.
621
839
  *
622
- * @example
623
- * ```typescript
624
- * // List all projects
625
- * const result = await client.getAllProjects();
626
- * console.log(`Found ${result.count} projects:`);
627
- * for (const project of result.projects) {
628
- * console.log(`- ${project.id}: ${project.name} (${project.totalComponents} components)`);
629
- * for (const source of project.sources) {
630
- * console.log(` * ${source.name} (${source.provider})`);
631
- * }
632
- * }
840
+ * @param path - Relative path within the account store
841
+ * @throws Error if file does not exist or delete fails
842
+ */
843
+ fsDelete(path: string): Promise<void>;
844
+ /**
845
+ * List immediate children of a directory.
633
846
  *
634
- * // Find specific project
635
- * const result = await client.getAllProjects();
636
- * const myProject = result.projects.find(p => p.id === 'proj-123');
637
- * ```
847
+ * @param path - Relative directory path (default: account root)
848
+ * @returns Directory entries with name and type (file or dir)
638
849
  */
639
- getAllProjects(): Promise<{
640
- success: boolean;
641
- projects: Array<{
642
- id: string;
850
+ fsListDir(path?: string): Promise<{
851
+ entries: Array<{
643
852
  name: string;
644
- sources: Array<{
645
- id: string;
646
- provider: string;
647
- name: string;
648
- }>;
649
- totalComponents: number;
853
+ type: 'file' | 'dir';
854
+ size?: number;
855
+ modified?: number;
650
856
  }>;
651
857
  count: number;
652
858
  }>;
653
859
  /**
654
- * Save or update a template pipeline.
860
+ * Create a directory.
655
861
  *
656
- * Stores a template pipeline configuration on the server. Templates are system-wide
657
- * and accessible to all users. If the template already exists, it will be updated.
658
- * Use expectedVersion to ensure you're updating the version you expect.
862
+ * @param path - Relative directory path
863
+ */
864
+ fsMkdir(path: string): Promise<void>;
865
+ /**
866
+ * Remove a directory.
659
867
  *
660
- * @param options - Save template options
661
- * @param options.templateId - Unique identifier for the template
662
- * @param options.pipeline - Pipeline configuration object
663
- * @param options.expectedVersion - Expected current version for atomic updates (optional)
664
- * @returns Promise resolving to save result with success status, templateId, and new version
665
- * @throws Error if save fails due to version mismatch, storage error, or invalid input
868
+ * @param path - Relative directory path
869
+ * @param recursive - If true, delete contents recursively (default: false)
870
+ * @throws Error if directory is not empty (when recursive is false) or delete fails
666
871
  */
667
- saveTemplate(options: {
668
- templateId: string;
669
- pipeline: Record<string, any>;
670
- expectedVersion?: string;
671
- }): Promise<{
672
- success: boolean;
673
- template_id: string;
674
- version: string;
675
- }>;
872
+ fsRmdir(path: string, recursive?: boolean): Promise<void>;
676
873
  /**
677
- * Retrieve a template by its ID.
874
+ * Get file or directory metadata.
875
+ *
876
+ * @param path - Relative path within the account store
877
+ * @returns Metadata including existence, type, size (bytes), and modified epoch timestamp (for files)
678
878
  */
679
- getTemplate(options: {
680
- templateId: string;
681
- }): Promise<{
682
- success: boolean;
683
- pipeline: Record<string, any>;
684
- version: string;
879
+ fsStat(path: string): Promise<{
880
+ exists: boolean;
881
+ type?: 'file' | 'dir';
882
+ size?: number;
883
+ modified?: number;
685
884
  }>;
686
885
  /**
687
- * Delete a template by its ID.
886
+ * Rename a file or directory.
887
+ *
888
+ * On object stores this is implemented as copy + delete. For directories,
889
+ * all contents are moved recursively.
890
+ *
891
+ * @param oldPath - Current relative path within the account store
892
+ * @param newPath - New relative path within the account store
893
+ * @throws Error if oldPath does not exist or rename fails
688
894
  */
689
- deleteTemplate(options: {
690
- templateId: string;
691
- expectedVersion?: string;
692
- }): Promise<{
693
- success: boolean;
694
- message: string;
695
- }>;
895
+ fsRename(oldPath: string, newPath: string): Promise<void>;
896
+ /** Read a file as a UTF-8 string. */
897
+ fsReadString(path: string): Promise<string>;
898
+ /** Write a UTF-8 string to a file. */
899
+ fsWriteString(path: string, text: string): Promise<void>;
900
+ /** Read a JSON file. */
901
+ fsReadJson<T = any>(path: string): Promise<T>;
902
+ /** Write an object as JSON. */
903
+ fsWriteJson(path: string, obj: any): Promise<void>;
696
904
  /**
697
- * List all templates.
905
+ * Characters that are illegal in store paths and IDs on all supported
906
+ * platforms (Windows, Linux, macOS, and object-storage back-ends).
907
+ *
908
+ * `\x00` is the null byte; the rest are shell/filesystem metacharacters
909
+ * that would cause ambiguous or dangerous behaviour in path construction.
698
910
  */
699
- getAllTemplates(): Promise<{
700
- success: boolean;
701
- templates: Array<{
702
- id: string;
703
- name: string;
704
- sources: Array<{
705
- id: string;
706
- provider: string;
707
- name: string;
708
- }>;
709
- totalComponents: number;
710
- }>;
711
- count: number;
712
- }>;
911
+ private static readonly INVALID_PATH_CHARS;
713
912
  /**
714
- * Save a log file for a source run.
913
+ * Validate a relative path intended for the account file store.
914
+ *
915
+ * Splits the path on `/` (after normalising backslashes) and checks every
916
+ * segment for path-traversal attempts (`..`) and forbidden characters.
917
+ * Empty segments (from leading/trailing/double slashes) are skipped because
918
+ * they carry no security risk on the server side.
919
+ *
920
+ * @param path - Relative path to validate (e.g. `.templates/my-pipe.json`)
921
+ * @throws Error if any segment is `..` or contains illegal characters
715
922
  */
716
- saveLog(options: {
717
- projectId: string;
718
- source: string;
719
- contents: Record<string, any>;
720
- }): Promise<{
721
- success: boolean;
722
- filename: string;
723
- }>;
923
+ private validateStorePath;
724
924
  /**
725
- * Get a log file by source name and start time.
925
+ * Validate a single identifier (projectId, source, templateId, etc.) used
926
+ * to construct store paths.
927
+ *
928
+ * IDs must be non-empty strings that contain no path separators and no
929
+ * characters from the forbidden set. This prevents an ID from escaping its
930
+ * intended directory when interpolated into a path.
931
+ *
932
+ * @param value - The identifier string to validate
933
+ * @param name - Human-readable field name used in error messages (e.g. `"projectId"`)
934
+ * @throws Error if value is empty, contains path separators, or contains illegal characters
726
935
  */
727
- getLog(options: {
728
- projectId: string;
729
- source: string;
730
- startTime: number;
731
- }): Promise<{
732
- success: boolean;
733
- contents: Record<string, any>;
734
- }>;
936
+ private validateId;
735
937
  /**
736
- * List log files for a project.
938
+ * Retrieve a server dashboard snapshot.
939
+ *
940
+ * Returns the current state of all connections, tasks, and aggregate
941
+ * metrics from the server. Requires 'task.monitor' permission.
942
+ *
943
+ * @returns DashboardResponse containing overview, connections, and tasks
737
944
  */
738
- listLogs(options: {
739
- projectId: string;
740
- source?: string;
741
- page?: number;
742
- }): Promise<{
743
- success: boolean;
744
- logs: string[];
745
- count: number;
746
- total_count: number;
747
- page: number;
748
- total_pages: number;
749
- }>;
945
+ getDashboard(): Promise<DashboardResponse>;
750
946
  /**
751
- * Send an arbitrary DAP command with command name, arguments, and optional token.
947
+ * Start a cProfile profiling session on the server process or a pipeline.
752
948
  *
753
- * This is a convenience method for callers that don't want to construct
754
- * full DAPMessage objects. It builds the request internally and delegates
755
- * to the underlying request() method.
949
+ * @param target - Task token to profile a pipeline subprocess, or
950
+ * undefined/null to profile the server process itself.
951
+ * @param session - Optional human-readable session name.
952
+ * @returns Status object with session info and start time.
953
+ */
954
+ cprofileStart(target?: string | null, session?: string): Promise<CProfileStatusResponse>;
955
+ /**
956
+ * Stop the active cProfile profiling session.
957
+ *
958
+ * @param target - Task token if profiling a pipeline, or undefined for server.
959
+ * @returns Result with session name and runtime.
960
+ */
961
+ cprofileStop(target?: string | null): Promise<CProfileStopResponse>;
962
+ /**
963
+ * Get the current cProfile profiling status.
964
+ *
965
+ * @param target - Task token if querying a pipeline, or undefined for server.
966
+ * @returns Status indicating active/inactive, owner, runtime.
967
+ */
968
+ cprofileStatus(target?: string | null): Promise<CProfileStatusResponse>;
969
+ /**
970
+ * Get the full cProfile report from the last completed session.
756
971
  *
757
- * @param command - The DAP command name (e.g., 'rrext_services', 'rrext_monitor')
758
- * @param args - Optional arguments for the command
759
- * @param token - Optional task/session token
760
- * @param timeout - Optional per-request timeout in ms
761
- * @returns The response DAPMessage from the server
972
+ * @param target - Task token if querying a pipeline, or undefined for server.
973
+ * @returns Object containing the full pstats text report.
762
974
  */
763
- dapRequest(command: string, args?: Record<string, unknown>, token?: string, timeout?: number): Promise<DAPMessage>;
975
+ cprofileReport(target?: string | null): Promise<CProfileReportResponse>;
764
976
  /**
765
977
  * Async disposal support for 'await using' pattern.
766
978
  * Equivalent to Python's __aexit__
@@ -797,7 +1009,7 @@ export declare class RocketRideClient extends DAPClient {
797
1009
  * }
798
1010
  * ```
799
1011
  */
800
- getServices(): Promise<Record<string, unknown>>;
1012
+ getServices(): Promise<ServicesResponse>;
801
1013
  /**
802
1014
  * Retrieve a specific service definition from the server.
803
1015
  *
@@ -820,7 +1032,7 @@ export declare class RocketRideClient extends DAPClient {
820
1032
  * }
821
1033
  * ```
822
1034
  */
823
- getService(service: string): Promise<Record<string, unknown> | undefined>;
1035
+ getService(service: string): Promise<ServiceDefinition | undefined>;
824
1036
  /**
825
1037
  * Get connection information (TypeScript-specific convenience)
826
1038
  */
@@ -833,6 +1045,62 @@ export declare class RocketRideClient extends DAPClient {
833
1045
  * Get API key (for debugging/validation)
834
1046
  */
835
1047
  getApiKey(): string | undefined;
1048
+ /**
1049
+ * Lazily-initialised account API namespace.
1050
+ *
1051
+ * Provides typed methods for managing the authenticated user's profile,
1052
+ * API keys, organization, members, and teams.
1053
+ *
1054
+ * @example
1055
+ * ```typescript
1056
+ * const profile = await client.account.getProfile();
1057
+ * ```
1058
+ */
1059
+ get account(): AccountApi;
1060
+ /**
1061
+ * Lazily-initialised billing API namespace.
1062
+ *
1063
+ * Provides typed methods for managing subscriptions, Stripe checkout
1064
+ * sessions, billing portal access, and compute credit wallets.
1065
+ *
1066
+ * @example
1067
+ * ```typescript
1068
+ * const details = await client.billing.getDetails(orgId);
1069
+ * ```
1070
+ */
1071
+ get billing(): BillingApi;
1072
+ /**
1073
+ * Lazily-initialised database API namespace.
1074
+ *
1075
+ * Provides direct SQL/Cypher execution against database pipelines, bypassing
1076
+ * the LLM translation layer that {@link RocketRideClient.chat} uses.
1077
+ *
1078
+ * @example
1079
+ * ```typescript
1080
+ * const result = await client.database.query({ token, sql: 'SELECT 1' });
1081
+ * ```
1082
+ */
1083
+ get database(): DatabaseApi;
1084
+ /**
1085
+ * Sends a DAP command, unwraps the response body, and throws on failure.
1086
+ *
1087
+ * This is the single public entry point for all typed DAP operations.
1088
+ * The {@link AccountApi} and {@link BillingApi} namespaces delegate here.
1089
+ *
1090
+ * If an `onTrace` callback was provided in the constructor config, it is
1091
+ * invoked before the request (TraceType.Request) and after completion
1092
+ * (TraceType.Success or TraceType.Error).
1093
+ *
1094
+ * @param command - DAP command name (e.g. "rrext_account_me").
1095
+ * @param args - Key/value arguments forwarded in the request.
1096
+ * @param options - Optional token (for task-scoped calls) and timeout in ms.
1097
+ * @returns The `body` field of a successful DAP response.
1098
+ * @throws Error if the server signals failure.
1099
+ */
1100
+ call<T = any>(command: string, args?: Record<string, unknown>, options?: {
1101
+ token?: string;
1102
+ timeout?: number;
1103
+ }): Promise<T>;
836
1104
  }
837
1105
  export { RocketRideClient as default };
838
1106
  //# sourceMappingURL=client.d.ts.map