@omirion/orbit-sdk 0.3.1 → 0.5.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.
- package/README.md +4 -1
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -1
- package/dist/index.d.ts +68 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/examples/device-rpc-flow/README.md +1 -1
- package/examples/device-rpc-flow/index.tsx +4 -2
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ A terminal UI demo of `@omirion/orbit-sdk` built with [Ink](https://github.com/v
|
|
|
5
5
|
1. **List devices**. `orbit.devices.list()`
|
|
6
6
|
2. **Select the first one**. `orbit.devices.get(id)` (the full device carries the `deviceTypeSlug` needed to decode telemetry)
|
|
7
7
|
3. **Show latest telemetry**. `orbit.telemetry.latest(id)` joined to the type manifest via `decodeSample()`
|
|
8
|
-
4. **Run the RPC command flow**. A sequence of `orbit.commands.exec(id, { name, args })` calls, run in order, stopping at the first failure
|
|
8
|
+
4. **Run the RPC command flow**. A sequence of `orbit.commands.exec(id, { name, args, requestId })` calls, run in order, stopping at the first failure
|
|
9
9
|
|
|
10
10
|
The command flow drives an attached Android device over adb:
|
|
11
11
|
|
|
@@ -433,11 +433,13 @@ function App() {
|
|
|
433
433
|
if (i > 0 && COMMAND_DELAY_MS > 0) await sleep(COMMAND_DELAY_MS);
|
|
434
434
|
dispatch({ type: "cmd", i, status: "active" });
|
|
435
435
|
try {
|
|
436
|
-
const
|
|
436
|
+
const commandRequest = {
|
|
437
|
+
requestId: crypto.randomUUID(),
|
|
437
438
|
name: COMMANDS[i].name,
|
|
438
439
|
args: COMMANDS[i].args,
|
|
439
440
|
timeoutMs: 15000,
|
|
440
|
-
}
|
|
441
|
+
};
|
|
442
|
+
const result = await orbit.commands.exec(device.id, commandRequest);
|
|
441
443
|
if (result.success) {
|
|
442
444
|
dispatch({ type: "cmd", i, status: "ok", result });
|
|
443
445
|
} else {
|