openvibers/openvibe.sdk Commits

Add Vibe compare methods to SDK (0.109.0) (#148)

OP OpenVibers committed 4 days ago · 44c2196f8b · 10 files, +50 −10

* Add Vibe compare methods to SDK

* Merge main into Vibe compare SDK PR

* Release 0.109.0

Changes

ddiff --git a/CHANGELOG.md b/CHANGELOG.md
iindex 06a3d30..77a3a20 100644
---- a/CHANGELOG.md
++++ b/CHANGELOG.md
@@@ -1,5 +1,9 @@
# Changelog
++## 0.109.0 — 2026-11-09
++
++- Add Vibe compare methods to `openvibe-sdk/chat` for submitting answers and recording a user's preferred model.
++
## 0.108.0 — 2026-11-09
- Add daily quest reads, progress, step type listings and reviewable step contributions to `openvibe-sdk/quest`.
ddiff --git a/README.md b/README.md
iindex a220b7c..9f35e1c 100644
---- a/README.md
++++ b/README.md
@@@ -2,7 +2,7 @@
> Supported browser and server clients for the OpenVibe platform.
--**Status:** alpha, v0.108.0 (the five 1.0 core entries — `core`, `auth`, `events`, `db` and `media` — are frozen: their exported names change only with a major release; roadmap Wave 2; developer apps from Wave 20; Media objects v2 from Wave 4; the Tools platform API; Search, Chat, AI, Vision and consent clients; sign-in with recovery and a client health check). Every release is tagged (see [CHANGELOG.md](CHANGELOG.md)). Tested against local stub servers and the built-in mock platform only, never against the live platform. Services pin release tags; each repository's `STATUS.json` names the one it uses.
++**Status:** alpha, v0.109.0 (the five 1.0 core entries — `core`, `auth`, `events`, `db` and `media` — are frozen: their exported names change only with a major release; roadmap Wave 2; developer apps from Wave 20; Media objects v2 from Wave 4; the Tools platform API; Search, Chat, AI, Vision and consent clients; sign-in with recovery and a client health check). Every release is tagged (see [CHANGELOG.md](CHANGELOG.md)). Tested against local stub servers and the built-in mock platform only, never against the live platform. Services pin release tags; each repository's `STATUS.json` names the one it uses.
**Plan:** OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30.
**License:** MIT ([LICENSE](LICENSE)). This package is a library that apps outside the network embed, so it uses MIT. The OpenVibe services themselves stay AGPL-3.0.
@@@ -11,7 +11,7 @@
After v0.97.1 is tagged:
```bash
--npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.108.0
++npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.109.0
```
It has no runtime dependencies. It needs Node ≥ 20, or any browser with `fetch`, Web Crypto and `TextDecoder`. There is no build step. The package is CommonJS with ESM entry points (`import` works). Each subpath has its own `.d.ts`. For a page with no bundler, `browser/openvibe-sdk.mjs` is one self-contained ES module of the browser-safe subpaths (see [Browser without a bundler](#browser-without-a-bundler)). It does not depend on `openvibe-contracts` at runtime: it copies the contract types it uses (from the temporary Contracts sharing branch, a devDependency the tests check them against).
@@@ -184,7 +184,7 @@ Until OpenVibe.Tools serves the gateway facade (Tools S6), point the jobs client
| `openvibe-sdk/search` | both | `createSearchClient(client, {actingSubject?})`: `query(text, {owner, type, lang, filter, facets, limit, cursor})`, `iterate(text, {…, max})`, `suggest(text, {owner, type, limit})`, `document(owner, type, id)` (null when missing or not visible) |
| `openvibe-sdk/limits` | node | `createActorLimiter({limits: {minute, hour, day}, actor?, maxActors?, onLimited?})` → `limits(name, {minute?, hour?, day?})` Express middleware: per-actor fixed windows at a capability boundary (service principal, else the signed-in person, else `ip:`), 429 problem+json `rate_limited` with Retry-After before the handler; `defaultActor(req)`, `.stats()` |
| `openvibe-sdk/account-data` | node | `createAccountData({db, service, tables: [{table, subject, value?, file?, columns?, erase?}], extraExport?, extraErase?})` → `.apply(event, {send})`, `.consumer({secrets, send, onEvent?})` (a POST /internal/events handler), `.exportPart(subject)`, `.erase(subjects)`, `.ensureSchema()`; `createNetworkSender({networkInternalUrl, clientId, clientSecret})`; `startSubscriptions({eventsUrl, endpoint, secret, networkInternalUrl, clientId, clientSecret})` (the two Events subscriptions, created at boot when missing): a service's share of account export and deletion (ADR-033), idempotent per export/deletion id; telemetry is covered once here (the person's `telemetry_samples` exported as `telemetry.json`, its `subject` set to NULL and the sample kept) unless the table is listed; `uncovered(db, {tables, taskKeyed?, exempt?})` lists the tables with a person column (`subject`, `owner`, `created_by`, `user_id`, `person`) that nothing covers, for a service test to assert is empty |
--| `openvibe-sdk/chat` | both | `createChatClient(client)`: `global.send/history/search`, `rooms.*` (list, create, get, update, messages, send, deleteMessage, join, leave, read, members, setMember), `dms.*` (list, create, get, messages, send, deleteMessage, read, unread, blocks, block, unblock), `exportMine()`, `vibe.*` (list, start, rename, remove: chats with Vibe), `inboxes.*` (list, create, get, update, remove, addMember, removeMember, conversations, messages, reply, setStatus, read, identity, replies, saveReply, deleteReply, webhooks, addWebhook, testWebhook, removeWebhook: a support inbox's team), `support.*` (list, messages, send: their own conversations with sites' chats), `feeds.*` (mine, create, update, rotateKey, remove, view, onLive). With no account: `createInboxVisitor(client, { inbox, token, user, account })` (visit, send, messages, handoff, rate: your own panel for an inbox, from any site) and `createFeedPublisher(client, { feed, key })` (hello, publish, claudeCode: vibe coding events with the feed's key) |
++| `openvibe-sdk/chat` | both | `createChatClient(client)`: `ask({ message, models })`, `pick(messageId, model)`, `prefer(messageId, model)`, `global.send/history/search`, `rooms.*` (list, create, get, update, messages, send, deleteMessage, join, leave, read, members, setMember), `dms.*` (list, create, get, messages, send, deleteMessage, read, unread, blocks, block, unblock), `exportMine()`, `vibe.*` (list, start, rename, remove: chats with Vibe), `inboxes.*` (list, create, get, update, remove, addMember, removeMember, conversations, messages, reply, setStatus, read, identity, replies, saveReply, deleteReply, webhooks, addWebhook, testWebhook, removeWebhook: a support inbox's team), `support.*` (list, messages, send: their own conversations with sites' chats), `feeds.*` (mine, create, update, rotateKey, remove, view, onLive). With no account: `createInboxVisitor(client, { inbox, token, user, account })` (visit, send, messages, handoff, rate: your own panel for an inbox, from any site) and `createFeedPublisher(client, { feed, key })` (hello, publish, claudeCode: vibe coding events with the feed's key) |
| `openvibe-sdk/ai` | both | `createAiClient(client)`: `runs.create(workflow, input, {wait, idempotencyKey, latency, deadlineHours, …})`, `runs.get/list/cancel/retry/citations/addCitations/waitFor`, `batches.create/get/list/cancel`, `chat/generate/summarize/classify/extract/enrich/embed`. A run may ask for the class it may wait in (`latency`: `interactive`, `background`, `batch`; `deadlineHours`: 1–72 for a batch run); `waitFor` gives a batch run back pending rather than throwing when the wait is over — the answer comes with the run's completion event or webhook. |
| `openvibe-sdk/jobs` | both | `createJobsClient(client, {baseUrl?})`: `submit` (Idempotency-Key), `get`, `cancel`, `retry`, `reference`, `unreference`, `events` (SSE, reattaches), `wait`, `file` (raw Response); `isTerminal()`. Default origin: the Tools gateway's jobs facade |
| `openvibe-sdk/tools` | both | `createToolsClient(client, {baseUrl?, anonymousReads?})`: `list({family, q, execution, api, status})`, `get(id)`, `schema(id)`, `run(id, input, {files, waitMs, idempotencyKey, signal, timeoutMs})` (+ `.wait()`), `jobs`; `ToolRunError`, `isToolRunError()` |
@@@ -645,6 +645,16 @@ Part of the [OpenVibe network](https://openvibe.network). Built in the open by [
### Locker: end-to-end encryption (Node and the browser)
`openvibe-sdk/locker` seals anything and opens it again: the Locker envelope (`locker.envelope@1`), the three locks (people, password, link), streams for files, person key pairs and the eight-word fingerprint, `wrapFor` and `rewrap` for sharing, `recoveryWords` for the phrase to write down, `inspect` for what an envelope says about itself, and opening a people lock by key. `openvibe-sdk/locker/server` gives a service the header checks without a key. WebCrypto only, in Node and the browser. See [the locker module](docs/locker.md).
++
++### Compare answers in Chat
++
++```js
++const ov = createChatClient(client);
++const { chat, message } = await ov.ask({ message: "Explain this tradeoff", models: ["deepseek/deepseek-chat", "qwen/qwen3-32b"] });
++// Read /api/vibe/chat?slug=<chat.slug> to show each model answer and its receipt.
++await ov.pick(message.id, "qwen/qwen3-32b");
++```
++
# AI comparison and Arena
Read Report's public AI data and create or vote on Exchange Arena rounds:
@@@ -660,3 +670,4 @@ const exchange = require('openvibe-sdk/exchange').createExchangeClient({ develop
const round = await exchange.arena.start({ prompt: 'Explain a binary search.', category: 'code', entries });
await exchange.arena.vote(round.id, 'left');
```
++```
ddiff --git a/STATUS.json b/STATUS.json
iindex a5f00be..aea2f14 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -3,7 +3,7 @@
"stage": "alpha",
"code": true,
"wave": "W2",
-- "version": "0.108.0",
++ "version": "0.109.0",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30",
"deployed": false,
"deployment": "none: a package released as git tags; services and apps pin a tag",
ddiff --git a/browser/openvibe-sdk.mjs b/browser/openvibe-sdk.mjs
iindex 8e24903..e9dc5eb 100644
---- a/browser/openvibe-sdk.mjs
++++ b/browser/openvibe-sdk.mjs
@@@ -1,4 +1,4 @@
--// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.108.0, MIT). Do not edit.
++// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.109.0, MIT). Do not edit.
// One self-contained ES module: core at the top level plus the browser-safe subpaths as namespaces
// (auth, locker, registry, trust, modules, realtime, media, cam, community, homeFeed, bot, search, bench, meme, vision, themes, redact, chat, ai, credentials, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
/* eslint-disable */
@@@ -52,7 +52,7 @@ const { paginate, offsetPager } = __load(7);
const semver = __load(6);
/** The package version (test/version.test.js keeps it equal to package.json). */
--const SDK_VERSION = '0.108.0';
++const SDK_VERSION = '0.109.0';
module.exports = {
createClient,
@@@ -4565,6 +4565,10 @@ function createChatClient(client, defaults = {}) {
const feed = (id) => `/api/chat/feeds/${enc(id)}`;
return {
++ /** Vibe's model comparison API, authenticated as the person. */
++ ask: (input, o = {}) => call({ method: 'POST', path: '/api/vibe/ask', json: input, ...once }, o),
++ pick: (messageId, model, o = {}) => call({ method: 'POST', path: '/api/vibe/pick', json: { message_id: messageId, model }, ...once }, o),
++ prefer: (messageId, model, o = {}) => call({ method: 'POST', path: '/api/vibe/prefer', json: { message_id: messageId, model }, ...once }, o),
global: {
/** { messages, … } — the global feed; query: limit, after_id (a delta after a message id). */
history: (query = {}, o = {}) => call({ path: '/api/chat/global/history', query }, o),
ddiff --git a/package-lock.json b/package-lock.json
iindex 53568ed..aed0126 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -1,12 +1,12 @@
{
"name": "openvibe-sdk",
-- "version": "0.108.0",
++ "version": "0.109.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openvibe-sdk",
-- "version": "0.108.0",
++ "version": "0.109.0",
"license": "MIT",
"bin": {
"openvibe-download": "bin/openvibe-download.js"
ddiff --git a/package.json b/package.json
iindex 3c87c44..605b410 100644
---- a/package.json
++++ b/package.json
@@@ -1,6 +1,6 @@
{
"name": "openvibe-sdk",
-- "version": "0.108.0",
++ "version": "0.109.0",
"description": "Supported browser and server clients for the OpenVibe platform: auth (incl. developer apps), registry discovery, identity, user modules, events, realtime, media, community, Bot robots, search, chat, AI runs, Tools (registry, run API and jobs), VIP memberships and developer projects, the async PostgreSQL data layer (db) and the Valkey cache, limits store, queue and pub/sub, with deadlines, safe retries, problem errors and trace propagation.",
"main": "index.js",
"types": "types/index.d.ts",
ddiff --git a/src/chat.js b/src/chat.js
iindex c623a4d..8de734d 100644
---- a/src/chat.js
++++ b/src/chat.js
@@@ -41,6 +41,10 @@ function createChatClient(client, defaults = {}) {
const feed = (id) => `/api/chat/feeds/${enc(id)}`;
return {
++ /** Vibe's model comparison API, authenticated as the person. */
++ ask: (input, o = {}) => call({ method: 'POST', path: '/api/vibe/ask', json: input, ...once }, o),
++ pick: (messageId, model, o = {}) => call({ method: 'POST', path: '/api/vibe/pick', json: { message_id: messageId, model }, ...once }, o),
++ prefer: (messageId, model, o = {}) => call({ method: 'POST', path: '/api/vibe/prefer', json: { message_id: messageId, model }, ...once }, o),
global: {
/** { messages, … } — the global feed; query: limit, after_id (a delta after a message id). */
history: (query = {}, o = {}) => call({ path: '/api/chat/global/history', query }, o),
ddiff --git a/src/core/index.js b/src/core/index.js
iindex 145b34f..f8a15b3 100644
---- a/src/core/index.js
++++ b/src/core/index.js
@@@ -8,7 +8,7 @@ const { paginate, offsetPager } = require('./paginate');
const semver = require('./semver');
/** The package version (test/version.test.js keeps it equal to package.json). */
--const SDK_VERSION = '0.108.0';
++const SDK_VERSION = '0.109.0';
module.exports = {
createClient,
ddiff --git a/test/chat.test.js b/test/chat.test.js
iindex 63ce21b..479d054 100644
---- a/test/chat.test.js
++++ b/test/chat.test.js
@@@ -19,6 +19,19 @@ async function chatStub() {
}
run([
++ ['Vibe comparison sends models and records a pick and preference', async () => {
++ const srv = await chatStub();
++ const chat = createChatClient(createClient({ baseUrls: { chat: srv.url }, token: 'person-token' }));
++ await chat.ask({ message: 'Explain this', models: ['maker/one', 'maker/two'] });
++ await chat.pick(42, 'maker/two');
++ await chat.prefer(42, 'maker/two');
++ assert.deepEqual(srv.requests.map((r) => [r.method, r.url, JSON.parse(String(r.body))]), [
++ ['POST', '/api/vibe/ask', { message: 'Explain this', models: ['maker/one', 'maker/two'] }],
++ ['POST', '/api/vibe/pick', { message_id: 42, model: 'maker/two' }],
++ ['POST', '/api/vibe/prefer', { message_id: 42, model: 'maker/two' }],
++ ]);
++ await srv.close();
++ }],
['global, rooms and DMs go to the right paths with the right bodies', async () => {
const srv = await chatStub();
const chat = createChatClient(createClient({ baseUrls: { chat: srv.url }, token: 'user-jwt', retries: 2 }));
ddiff --git a/types/chat.d.ts b/types/chat.d.ts
iindex 4ccd680..0892b06 100644
---- a/types/chat.d.ts
++++ b/types/chat.d.ts
@@@ -3,6 +3,10 @@ import type { OpenVibeClient } from './core';
type Opts = { signal?: AbortSignal };
type Json = Record<string, unknown>;
export interface ChatClient {
++ /** Ask Vibe using Auto, one catalogue model, or two to three models side by side. */
++ ask(input: { message: string; models?: string[]; slug?: string; fresh?: boolean; system_prompt?: string; temperature?: number }, opts?: Opts): Promise<{ chat: Json; message: Json }>;
++ pick(messageId: number, model: string, opts?: Opts): Promise<{ chat: Json; model: string }>;
++ prefer(messageId: number, model: string, opts?: Opts): Promise<{ recorded: boolean; model: string }>;
global: {
history(query?: { limit?: number; after_id?: number }, opts?: Opts): Promise<Json>;
send(message: string, extra?: { reply_to_id?: number; auto_delete_minutes?: number }, opts?: Opts): Promise<Json>;