rocketride 1.0.6 → 1.1.1

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