rocketride 1.0.2 → 1.0.4
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.
- package/README.md +54 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# RocketRide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript/JavaScript SDK for the RocketRide Engine - build, run, and manage AI pipelines from Node.js or the browser.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
+
# NPM
|
|
8
9
|
npm install rocketride
|
|
9
|
-
#
|
|
10
|
+
# Yarn
|
|
11
|
+
yarn add rocketride
|
|
12
|
+
# PNPM
|
|
10
13
|
pnpm add rocketride
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
## Quick Start
|
|
14
|
-
|
|
15
16
|
```typescript
|
|
16
17
|
import { RocketRideClient } from 'rocketride';
|
|
17
18
|
|
|
@@ -20,21 +21,42 @@ const client = new RocketRideClient({
|
|
|
20
21
|
uri: 'https://cloud.rocketride.ai',
|
|
21
22
|
});
|
|
22
23
|
await client.connect();
|
|
23
|
-
const { token } = await client.use({ filepath: './pipeline.
|
|
24
|
+
const { token } = await client.use({ filepath: './pipeline.pipe' });
|
|
24
25
|
const result = await client.send(token, 'Hello, pipeline!', { name: 'input.txt' }, 'text/plain');
|
|
25
26
|
console.log(result);
|
|
26
27
|
await client.terminate(token);
|
|
27
28
|
await client.disconnect();
|
|
28
29
|
```
|
|
29
30
|
|
|
31
|
+
Don't have a pipeline yet? Visit [RocketRide on GitHub](https://github.com/rocketride-org/rocketride-server) or download the extension directly in your IDE.
|
|
32
|
+
|
|
33
|
+
<p align="center">
|
|
34
|
+
<img src="https://raw.githubusercontent.com/rocketride-org/rocketride-server/develop/images/install.png" alt="Install RocketRide extension" width="600">
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
## What is RocketRide?
|
|
38
|
+
|
|
39
|
+
[RocketRide](https://rocketride.org) is an open source, developer-native AI pipeline platform.
|
|
40
|
+
It lets you build, debug, and deploy production AI workflows without leaving your IDE -
|
|
41
|
+
using a visual drag-and-drop canvas or code-first with TypeScript and Python SDKs.
|
|
42
|
+
|
|
43
|
+
- **50+ ready-to-use nodes** - 13 LLM providers, 8 vector databases, OCR, NER, PII anonymization, and more
|
|
44
|
+
- **High-performance C++ engine** - production-grade speed and reliability
|
|
45
|
+
- **Deploy anywhere** - locally, on-premises, or self-hosted with Docker
|
|
46
|
+
- **MIT licensed** - fully open source, OSI-compliant
|
|
47
|
+
|
|
48
|
+
You build your `.pipe` - and you run it against the fastest AI runtime available.
|
|
49
|
+
|
|
50
|
+
<img src="https://raw.githubusercontent.com/rocketride-org/rocketride-server/develop/docs/images/canvas.png" alt="RocketRide visual canvas builder" width="800">
|
|
51
|
+
|
|
30
52
|
## Features
|
|
31
53
|
|
|
32
|
-
- **Pipeline execution**
|
|
33
|
-
- **Chat**
|
|
34
|
-
- **Event streaming**
|
|
35
|
-
- **File upload**
|
|
36
|
-
- **Connection lifecycle**
|
|
37
|
-
- **Full TypeScript support**
|
|
54
|
+
- **Pipeline execution** - Start with `use()`, send data via `send()`, `sendFiles()`, or `pipe()`
|
|
55
|
+
- **Chat** - Conversational AI via `chat()` and `Question`
|
|
56
|
+
- **Event streaming** - Real-time events via `onEvent` and `setEvents()`
|
|
57
|
+
- **File upload** - `sendFiles()` with progress; streaming with `pipe()`
|
|
58
|
+
- **Connection lifecycle** - Optional persist mode, reconnection, and callbacks (`onConnected`, `onDisconnected`, `onConnectError`)
|
|
59
|
+
- **Full TypeScript support** - Complete type definitions
|
|
38
60
|
|
|
39
61
|
---
|
|
40
62
|
|
|
@@ -53,14 +75,14 @@ Configuration object passed to `new RocketRideClient(config)`.
|
|
|
53
75
|
| `maxRetryTime` | `number` | No | Max time in ms to keep retrying connection. Default: no limit. **Use** (e.g. 300000 for 5 min) so you can show "gave up" after a bounded time instead of retrying forever. |
|
|
54
76
|
| `requestTimeout` | `number` | No | Default timeout in ms for each request; overridable per `request()` call. Prevents a single slow DAP call from hanging indefinitely. |
|
|
55
77
|
| `onConnected` | `(info?: string) => Promise<void>` | No | Called when connection is established. **Use** to refresh UI, refetch services, or clear "connecting" state. |
|
|
56
|
-
| `onDisconnected` | `(reason?: string, hasError?: boolean) => Promise<void>` | No | Called when connection is lost **only if** `onConnected` was already called. So "failed to connect in the first place" does *not* fire this
|
|
78
|
+
| `onDisconnected` | `(reason?: string, hasError?: boolean) => Promise<void>` | No | Called when connection is lost **only if** `onConnected` was already called. So "failed to connect in the first place" does *not* fire this - use `onConnectError` for that. **Do not** call `client.disconnect()` here if you want the client to auto-reconnect in persist mode. |
|
|
57
79
|
| `onConnectError` | `(message: string) => void \| Promise<void>` | No | Called on each failed connection attempt (e.g. while retrying in persist mode). **Use** to show "Connection failed: ..." or "Still connecting..."; on auth failure the client stops retrying, so you can prompt the user to fix credentials and call `connect()` again. |
|
|
58
80
|
| `onEvent` | `(event: DAPMessage) => Promise<void>` | No | Called for each server event (e.g. upload progress, task status). **Use** to drive progress bars or status text; event type is `event.event`, payload in `event.body`. |
|
|
59
81
|
| `onProtocolMessage` | `(message: string) => void` | No | Optional; for logging raw DAP messages. Helpful when debugging protocol issues. |
|
|
60
82
|
| `onDebugMessage` | `(message: string) => void` | No | Optional; for debug output. |
|
|
61
83
|
| `module` | `string` | No | Client name for logging. Default: `CLIENT-0`, `CLIENT-1`, ... |
|
|
62
84
|
|
|
63
|
-
**Example
|
|
85
|
+
**Example - long-lived app with persist and status:**
|
|
64
86
|
|
|
65
87
|
```typescript
|
|
66
88
|
const client = new RocketRideClient({
|
|
@@ -97,10 +119,10 @@ await client.connect();
|
|
|
97
119
|
|
|
98
120
|
| Method | Signature | Returns | Description |
|
|
99
121
|
| --------------------- | --------- | ------- | ----------- |
|
|
100
|
-
| `connect` | `connect(timeout?: number): Promise<void>` |
|
|
101
|
-
| `disconnect` | `disconnect(): Promise<void>` |
|
|
122
|
+
| `connect` | `connect(timeout?: number): Promise<void>` | - | Opens the WebSocket and performs DAP auth. Optional `timeout` (ms) bounds the connect + auth handshake (non-persist only; in persist mode timeout is not applied). In **persist** mode, if this fails the client calls `onConnectError` and schedules retries (exponential backoff); on **auth** failure it does *not* retry so the app can fix credentials and call `connect()` again. |
|
|
123
|
+
| `disconnect` | `disconnect(): Promise<void>` | - | Closes the connection and cancels any pending reconnection. Call when the user explicitly disconnects or the app is shutting down. |
|
|
102
124
|
| `isConnected` | `isConnected(): boolean` | `boolean` | Whether the client is currently connected. Use before calling `use()` or `send()` to avoid confusing errors. |
|
|
103
|
-
| `setConnectionParams` | `setConnectionParams(options: { uri?: string; auth?: string }): Promise<void>` |
|
|
125
|
+
| `setConnectionParams` | `setConnectionParams(options: { uri?: string; auth?: string }): Promise<void>` | - | Updates server URI and/or auth at runtime. If currently connected, disconnects and reconnects with the new params (in persist mode, reconnection is scheduled; otherwise reconnects once). Use when the user changes server or credentials without creating a new client. |
|
|
104
126
|
|
|
105
127
|
**How to use:** For one-off scripts, call `connect()` once, do your work, then `disconnect()`. For UIs, use `persist: true` and rely on the client to reconnect; only call `disconnect()` when the user logs out or you are done with the client. The client supports `await using` (Symbol.asyncDispose) for automatic disconnect when exiting scope.
|
|
106
128
|
|
|
@@ -113,7 +135,7 @@ await client.connect();
|
|
|
113
135
|
| `dapRequest` | `dapRequest(command: string, args?: Record<string, unknown>, token?: string, timeout?: number): Promise<DAPMessage>` | `Promise<DAPMessage>` | Shorthand: builds a request and sends it in one call. Equivalent to `buildRequest()` + `request()`. |
|
|
114
136
|
| `didFail` | `didFail(response: DAPMessage): boolean` | `boolean` | Returns `true` when the server indicated failure (`success === false`). Use after `request()` to decide whether to use `body` or surface `message` as an error. |
|
|
115
137
|
|
|
116
|
-
**Example
|
|
138
|
+
**Example - custom DAP command:**
|
|
117
139
|
|
|
118
140
|
```typescript
|
|
119
141
|
const req = client.buildRequest('rrext_monitor', { token, arguments: { types: ['apaevt_status_upload'] } });
|
|
@@ -127,12 +149,12 @@ if (client.didFail(res)) throw new Error(res.message);
|
|
|
127
149
|
| --------------- | --------- | ------- | ----------- |
|
|
128
150
|
| `use` | `use(options?: { token?: string; filepath?: string; pipeline?: PipelineConfig; source?: string; threads?: number; useExisting?: boolean; args?: string[]; ttl?: number }): Promise<Record<string, any> & { token: string }>` | `Promise<{ token: string, ... }>` | Starts a pipeline. You must pass either `pipeline` (object) or `filepath` (path to a JSON file; Node only). The client substitutes `${ROCKETRIDE_*}` in the config from its `env` (or `.env`). Returns at least `token`; use that token for `send()`, `sendFiles()`, `pipe()`, `chat()`, `getTaskStatus()`, and `terminate()`. |
|
|
129
151
|
| `validate` | `validate(options: { pipeline: PipelineConfig \| Record<string, unknown>; source?: string }): Promise<Record<string, unknown>>` | `Promise<Record<string, unknown>>` | Validates a pipeline configuration without starting it. Returns validation results (e.g. errors, warnings). Use to check pipeline correctness before `use()`. |
|
|
130
|
-
| `terminate` | `terminate(token: string): Promise<void>` |
|
|
152
|
+
| `terminate` | `terminate(token: string): Promise<void>` | - | Stops the pipeline for that token and frees server resources. Call when the user cancels or when you are done sending data. |
|
|
131
153
|
| `getTaskStatus` | `getTaskStatus(token: string): Promise<TASK_STATUS>` | `Promise<TASK_STATUS>` | Returns current task status: e.g. `completedCount`, `totalCount`, `completed`, `state`, `exitCode`. Use to poll until `completed` is true or to show progress. |
|
|
132
154
|
|
|
133
155
|
**Why `use()` returns a token:** The server runs each pipeline as a separate task. The token identifies that task so all subsequent operations (sending data, chat, status, terminate) target the right pipeline.
|
|
134
156
|
|
|
135
|
-
**Example
|
|
157
|
+
**Example - start from file and poll until done:**
|
|
136
158
|
|
|
137
159
|
```typescript
|
|
138
160
|
const { token } = await client.use({ filepath: './pipeline.json', ttl: 3600 });
|
|
@@ -156,13 +178,13 @@ await client.terminate(token);
|
|
|
156
178
|
|
|
157
179
|
**When to use `pipe` vs `send`:** Use `send()` when you have a single blob (e.g. a string or one `Uint8Array`) and don't need to stream. Use `pipe()` when you are reading a large file in chunks, or when data arrives incrementally (e.g. from a stream or multiple buffers).
|
|
158
180
|
|
|
159
|
-
**Example
|
|
181
|
+
**Example - send a string:**
|
|
160
182
|
|
|
161
183
|
```typescript
|
|
162
184
|
const result = await client.send(token, 'Hello, pipeline!', { name: 'greeting.txt' }, 'text/plain');
|
|
163
185
|
```
|
|
164
186
|
|
|
165
|
-
**Example
|
|
187
|
+
**Example - stream chunks with a pipe:**
|
|
166
188
|
|
|
167
189
|
```typescript
|
|
168
190
|
const pipe = await client.pipe(token, { name: 'data.json' }, 'application/json');
|
|
@@ -175,7 +197,7 @@ const result = await pipe.close();
|
|
|
175
197
|
|
|
176
198
|
| Method | Signature | Returns | Description |
|
|
177
199
|
| ----------- | --------- | ------- | ----------- |
|
|
178
|
-
| `setEvents` | `setEvents(token: string, eventTypes: string[]): Promise<void>` |
|
|
200
|
+
| `setEvents` | `setEvents(token: string, eventTypes: string[]): Promise<void>` | - | Subscribes this task to the given event types (e.g. `apaevt_status_upload`, `apaevt_status_processing`). After this, those events are delivered to your `onEvent` callback. Call after `use()` and before or while sending data. |
|
|
179
201
|
|
|
180
202
|
### Services, validation, and ping
|
|
181
203
|
|
|
@@ -183,7 +205,7 @@ const result = await pipe.close();
|
|
|
183
205
|
| ------------- | --------- | ------- | ----------- |
|
|
184
206
|
| `getServices` | `getServices(): Promise<Record<string, any>>` | `Promise<Record<string, any>>` | Returns all service/connector definitions from the server (schemas, UI schemas). Use to discover what pipelines or features the server supports. |
|
|
185
207
|
| `getService` | `getService(service: string): Promise<Record<string, any> \| undefined>` | `Promise<Record<string, any> \| undefined>` | Returns the definition for one service by name. Throws if the request fails. |
|
|
186
|
-
| `ping` | `ping(token?: string): Promise<void>` |
|
|
208
|
+
| `ping` | `ping(token?: string): Promise<void>` | - | Lightweight liveness check. Throws if the server responds with an error. Optional `token` for task-scoped ping. |
|
|
187
209
|
|
|
188
210
|
### Chat
|
|
189
211
|
|
|
@@ -220,7 +242,7 @@ Returned by `client.pipe()`. Represents one streaming upload: **open** -> one or
|
|
|
220
242
|
| Method | Signature | Returns | Description |
|
|
221
243
|
| ------- | --------- | ------- | ----------- |
|
|
222
244
|
| `open` | `open(): Promise<DataPipe>` | `Promise<DataPipe>` | Opens the pipe on the server. Must be called before `write()`. |
|
|
223
|
-
| `write` | `write(buffer: Uint8Array): Promise<void>` |
|
|
245
|
+
| `write` | `write(buffer: Uint8Array): Promise<void>` | - | Writes a chunk. Pipe must be open. |
|
|
224
246
|
| `close` | `close(): Promise<PIPELINE_RESULT \| undefined>` | `Promise<PIPELINE_RESULT \| undefined>` | Closes the pipe and returns the processing result. No-op if already closed. |
|
|
225
247
|
|
|
226
248
|
---
|
|
@@ -432,27 +454,13 @@ await client.disconnect();
|
|
|
432
454
|
|
|
433
455
|
---
|
|
434
456
|
|
|
435
|
-
##
|
|
436
|
-
|
|
437
|
-
Source location in the repository:
|
|
438
|
-
|
|
439
|
-
```text
|
|
440
|
-
packages/client-typescript/
|
|
441
|
-
├── src/
|
|
442
|
-
│ ├── client/ # Main client (RocketRideClient, DAP, transport)
|
|
443
|
-
│ │ ├── core/ # DAPClient, DAPBase, TransportBase, TransportWebSocket
|
|
444
|
-
│ │ ├── exceptions/
|
|
445
|
-
│ │ ├── schema/ # Question, Doc, DocFilter, etc.
|
|
446
|
-
│ │ └── types/
|
|
447
|
-
│ └── cli/ # CLI (rocketride command)
|
|
448
|
-
├── tests/
|
|
449
|
-
├── package.json
|
|
450
|
-
├── tsconfig.json
|
|
451
|
-
└── README.md
|
|
452
|
-
```
|
|
457
|
+
## Links
|
|
453
458
|
|
|
454
|
-
|
|
459
|
+
- [Documentation](https://docs.rocketride.org/)
|
|
460
|
+
- [GitHub](https://github.com/rocketride-org/rocketride-server)
|
|
461
|
+
- [Discord](https://discord.gg/9hr3tdZmEG)
|
|
462
|
+
- [Contributing](https://github.com/rocketride-org/rocketride-server/blob/develop/CONTRIBUTING.md)
|
|
455
463
|
|
|
456
464
|
## License
|
|
457
465
|
|
|
458
|
-
MIT
|
|
466
|
+
MIT - see [LICENSE](https://github.com/rocketride-org/rocketride-server/blob/develop/LICENSE).
|