openvibers/openvibe.sdk Commits
Publish a Bot client (openvibe-sdk/bot) (#13)
OP OpenVibers committed 5 Oct 2026 · tag v0.30. · 0 files, +0 −0
## Files changed
- **`src/bot.js`** (new) — `openvibe-sdk/bot`, the OpenVibe.Bot client following `src/community.js`: `createBotClient(client, {actingSubject?})` with `robots.list/get/create/update/delete/pairingCode`, `robots.operators.list/add/remove`, `robots.devices`, `robots.streaming.get/set`, `robots.audit`/`iterateAudit`, `robots.estop`/`clearEstop`, `robots.command` (`bot.command@1`), `devices.rotate`/`revoke`, public `profiles`/`kits`, `pair` (never retried), `as(subject)` and `headers()`. Service calls send `X-OV-Subject`; browser-safe (relative requires only).
- **`types/bot.d.ts`** (new) — declares every runtime export (Robots/Devices/Profiles/Kits/Command types) for `types.test.js`.
- **`test/bot.test.js`** (new) — stub-server tests for acting headers, `as()` isolation, null-on-404, commands pass-through and refusals, all manage/control/streaming/device routes, public reads, pairing's missing Idempotency-Key, browser mode, and validation of the Contracts `bot.*` fixtures (valid and invalid) against `openvibe-contracts`.
- **`esm/bot.mjs`** (new, generated by `scripts/esm.js`) — ESM entry re-exporting the CJS module.
- **`index.js` / `browser.js`** — expose the `bot` namespace on the Node and browser entries.
- **`types/index.d.ts` / `types/bundle.d.ts`** — declare the `bot` namespace (and in the bundle's `sdk` shape).
- **`scripts/esm.js`** — added `bot.mjs` to `ENTRIES`; **`scripts/browser-bundle.js`** — doc comment now lists `bot` (the bundle itself is generated from `browser.js`).
- **`package.json`** — added the `./bot` export (`types`/`import`/`default`), version `0.30.0`, description mentions Bot robots.
- **`package-lock.json`**, **`src/core/index.js`** — version kept in step with `package.json` (`SDK_VERSION`).
- **`esm/index.mjs`**, **`browser/openvibe-sdk.mjs`** (generated) — regenerated; only the new module, index shifts and version/comment changed.
- **`test/browser-entries.test.js`**, **`test/bundle.test.js`**, **`test/pack.test.js`** — added `src/bot.js` to the scanned/must lists, `bot` to the bundle namespaces, bot files to the tarball checks, and the subpath count 40 → 41.
- **`README.md`** — new `openvibe-sdk/bot` API-table row, bundle namespace lists, and a "Not wrapped yet" Bot bullet.
- **`STATUS.json`** — feature line for bot, version `0.30.0`; **`CHANGELOG.md`** — `0.30.0` entry.
## Tests run
- `ov test bot.test.js` → `1/1 passed` (run before the change was cached as green).
- `ov test bot.test.js esm.test.js bundle.test.js browser-entries.test.js types.test.js version.test.js pack.test.js` → `6 passed, 1 skipped (unchanged since green)`; the skipped one is `bot.test.js`, already green.
- Also `node --check src/bot.js test/bot.test.js`, JSON validation of `package.json`/`package-lock.json`/`STATUS.json`, and resolution of `openvibe-sdk/bot` by name.
## Notes
- I bumped the minor to **0.30.0** because the repo releases a new subpath as a minor and `version.test.js` ties the lockfile, `SDK_VERSION`, CHANGELOG and bundle together.
- Not wrapped (documented in the module, README and CHANGELOG as intentionally out of scope): the operator WebSocket `/control` (Realtime `bot.command@1`), `POST /devices/bind` (Network node token), and the internal Run→Bot `bot.job.dispatch` API (service-to-service, never delegated).
- I did not run the whole suite, per instructions; the full `npm test` runs in CI's verify after the push.
This commit has no diff to show.