openvibers/openvibe.sdk Commits
feat(sdk): expose DM view preferences (#154)
Changes
@@@ -1,5 +1,9 @@# Changelog++## 0.122.0 (2026-11-09)++++- dms.viewPreference() and setViewPreference(): a conversation's saved view, bubbles or room++## 0.121.0 (2026-11-09)- ov.cam.settings.get/put: a person's saved camera choices (Cam #116)@@@ -10,7 +10,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags> Supported browser and server clients for the OpenVibe platform.--**Status:** alpha, v0.121.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.122.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.@@@ -19,7 +19,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tagsAfter v0.97.1 is tagged:```bash--npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.121.0++npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.122.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).@@@ -3,7 +3,7 @@"stage": "alpha","code": true,"wave": "W2",-- "version": "0.121.0",++ "version": "0.122.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",@@@ -1,4 +1,4 @@--// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.121.0, MIT). Do not edit.++// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.122.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, mediaUpload, ui, community, homeFeed, bot, search, bench, meme, vision, themes, design, redact, chat, ai, credentials, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity./* eslint-disable */@@@ -56,7 +56,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.121.0';++const SDK_VERSION = '0.122.0';module.exports = {createClient,@@@ -4797,6 +4797,9 @@ function createChatClient(client, defaults = {}) {blocks: (o = {}) => call({ path: '/api/dm/blocks' }, o),block: (userId, o = {}) => call({ method: 'POST', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),unblock: (userId, o = {}) => call({ method: 'DELETE', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),++ /** Saved view for one conversation: { view: 'bubbles' | 'room' }. */++ viewPreference: (id, o = {}) => call({ path: `${conv(id)}/view` }, o),++ setViewPreference: (id, view, o = {}) => call({ method: 'PUT', path: `${conv(id)}/view`, json: { view }, ...once }, o),},/** Every message you sent that is still visible: { username, total, truncated, messages } (JSON). */exportMine: (o = {}) => call({ path: '/api/chat/me/export' }, o),@@@ -1,12 +1,12 @@{"name": "openvibe-sdk",-- "version": "0.121.0",++ "version": "0.122.0","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "openvibe-sdk",-- "version": "0.121.0",++ "version": "0.122.0","license": "MIT","bin": {"openvibe-download": "bin/openvibe-download.js"@@@ -1,6 +1,6 @@{"name": "openvibe-sdk",-- "version": "0.121.0",++ "version": "0.122.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",@@@ -83,6 +83,9 @@ function createChatClient(client, defaults = {}) {blocks: (o = {}) => call({ path: '/api/dm/blocks' }, o),block: (userId, o = {}) => call({ method: 'POST', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),unblock: (userId, o = {}) => call({ method: 'DELETE', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),++ /** Saved view for one conversation: { view: 'bubbles' | 'room' }. */++ viewPreference: (id, o = {}) => call({ path: `${conv(id)}/view` }, o),++ setViewPreference: (id, view, o = {}) => call({ method: 'PUT', path: `${conv(id)}/view`, json: { view }, ...once }, o),},/** Every message you sent that is still visible: { username, total, truncated, messages } (JSON). */exportMine: (o = {}) => call({ path: '/api/chat/me/export' }, o),@@@ -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.121.0';++const SDK_VERSION = '0.122.0';module.exports = {createClient,@@@ -42,6 +42,8 @@ run([await chat.dms.create([42], { name: 'pair' });await chat.dms.send(7, 'hi');await chat.dms.messages(7, { limit: 20 });++ await chat.dms.viewPreference(7);++ await chat.dms.setViewPreference(7, 'bubbles');await chat.global.history({ after_id: 5 });const got = srv.requests.map((r) => [r.method, r.url, r.body && String(r.body).length ? JSON.parse(String(r.body)) : null]);assert.deepEqual(got, [@@@ -52,6 +54,8 @@ run([['POST', '/api/dm/conversations', { user_ids: [42], name: 'pair' }],['POST', '/api/dm/conversations/7/messages', { message: 'hi' }],['GET', '/api/dm/conversations/7/messages?limit=20', null],++ ['GET', '/api/dm/conversations/7/view', null],++ ['PUT', '/api/dm/conversations/7/view', { view: 'bubbles' }],['GET', '/api/chat/global/history?after_id=5', null],]);assert.equal(srv.requests[0].headers.authorization, 'Bearer user-jwt');@@@ -72,7 +72,7 @@ run([})().catch((err) => { console.error(err); process.exit(1); });`;const res = execFileSync(process.execPath, ['-e', script], { cwd: app, encoding: 'utf8' });assert.match(res, new RegExp(`consumer ok: ${subpaths.length} subpaths \\+ the browser bundle`));-- assert.equal(subpaths.length, 98); // Adds the upload client and the UI entry (0.121.0); the wallet came in 0.119.0.++ assert.equal(subpaths.length, 98); // Adds the upload client and the UI entry (0.122.0); the wallet came in 0.119.0.assert.ok(!fs.existsSync(path.join(app, 'node_modules/openvibe-contracts')), 'the optional peer is not installed');} finally {fs.rmSync(tmp, { recursive: true, force: true });@@@ -2,6 +2,7 @@ import type { OpenVibeClient } from './core';type Opts = { signal?: AbortSignal };type Json = Record<string, unknown>;++export type ChatMessageView = 'bubbles' | 'room';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 }>;@@@ -38,6 +39,8 @@ export interface ChatClient {blocks(opts?: Opts): Promise<Json>;block(userId: number | string, opts?: Opts): Promise<Json>;unblock(userId: number | string, opts?: Opts): Promise<Json>;++ viewPreference(id: number | string, opts?: Opts): Promise<{ view: ChatMessageView; conversation_id: number }>;++ setViewPreference(id: number | string, view: ChatMessageView, opts?: Opts): Promise<{ view: ChatMessageView; conversation_id: number }>;};exportMine(opts?: Opts): Promise<{ username: string; exported_at: string; total: number; truncated: boolean; messages: Json[] }>;vibe: {
@@ -1,5 +1,9 @@
@@ -1,5 +1,9 @@
# Changelog
# Changelog
+## 0.122.0 (2026-11-09)
+
+- dms.viewPreference() and setViewPreference(): a conversation's saved view, bubbles or room
+
## 0.121.0 (2026-11-09)
## 0.121.0 (2026-11-09)
- ov.cam.settings.get/put: a person's saved camera choices (Cam #116)
- ov.cam.settings.get/put: a person's saved camera choices (Cam #116)
@@ -10,7 +10,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags
@@ -10,7 +10,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags
> Supported browser and server clients for the OpenVibe platform.
> Supported browser and server clients for the OpenVibe platform.
-**Status:** alpha, v0.121.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.122.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.
**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.
**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.
@@ -19,7 +19,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags
@@ -19,7 +19,7 @@ npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags
After v0.97.1 is tagged:
After v0.97.1 is tagged:
```bash
```bash
-npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.121.0
+npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.122.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).
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).
@@ -3,7 +3,7 @@
@@ -3,7 +3,7 @@
"stage": "alpha",
"stage": "alpha",
"code": true,
"code": true,
"wave": "W2",
"wave": "W2",
- "version": "0.121.0",
+ "version": "0.122.0",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30",
"deployed": false,
"deployed": false,
"deployment": "none: a package released as git tags; services and apps pin a tag",
"deployment": "none: a package released as git tags; services and apps pin a tag",
@@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
-// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.121.0, MIT). Do not edit.
+// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.122.0, MIT). Do not edit.
// One self-contained ES module: core at the top level plus the browser-safe subpaths as namespaces
// 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, mediaUpload, ui, community, homeFeed, bot, search, bench, meme, vision, themes, design, redact, chat, ai, credentials, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
// (auth, locker, registry, trust, modules, realtime, media, cam, mediaUpload, ui, community, homeFeed, bot, search, bench, meme, vision, themes, design, redact, chat, ai, credentials, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
/* eslint-disable */
/* eslint-disable */
@@ -56,7 +56,7 @@ const { paginate, offsetPager } = __load(7);
@@ -56,7 +56,7 @@ const { paginate, offsetPager } = __load(7);
const semver = __load(6);
const semver = __load(6);
/** The package version (test/version.test.js keeps it equal to package.json). */
/** The package version (test/version.test.js keeps it equal to package.json). */
-const SDK_VERSION = '0.121.0';
+const SDK_VERSION = '0.122.0';
module.exports = {
module.exports = {
createClient,
createClient,
@@ -4797,6 +4797,9 @@ function createChatClient(client, defaults = {}) {
@@ -4797,6 +4797,9 @@ function createChatClient(client, defaults = {}) {
blocks: (o = {}) => call({ path: '/api/dm/blocks' }, o),
blocks: (o = {}) => call({ path: '/api/dm/blocks' }, o),
block: (userId, o = {}) => call({ method: 'POST', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
block: (userId, o = {}) => call({ method: 'POST', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
unblock: (userId, o = {}) => call({ method: 'DELETE', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
unblock: (userId, o = {}) => call({ method: 'DELETE', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
+ /** Saved view for one conversation: { view: 'bubbles' | 'room' }. */
+ viewPreference: (id, o = {}) => call({ path: `${conv(id)}/view` }, o),
+ setViewPreference: (id, view, o = {}) => call({ method: 'PUT', path: `${conv(id)}/view`, json: { view }, ...once }, o),
},
},
/** Every message you sent that is still visible: { username, total, truncated, messages } (JSON). */
/** Every message you sent that is still visible: { username, total, truncated, messages } (JSON). */
exportMine: (o = {}) => call({ path: '/api/chat/me/export' }, o),
exportMine: (o = {}) => call({ path: '/api/chat/me/export' }, o),
@@ -1,12 +1,12 @@
@@ -1,12 +1,12 @@
{
{
"name": "openvibe-sdk",
"name": "openvibe-sdk",
- "version": "0.121.0",
+ "version": "0.122.0",
"lockfileVersion": 3,
"lockfileVersion": 3,
"requires": true,
"requires": true,
"packages": {
"packages": {
"": {
"": {
"name": "openvibe-sdk",
"name": "openvibe-sdk",
- "version": "0.121.0",
+ "version": "0.122.0",
"license": "MIT",
"license": "MIT",
"bin": {
"bin": {
"openvibe-download": "bin/openvibe-download.js"
"openvibe-download": "bin/openvibe-download.js"
@@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
{
{
"name": "openvibe-sdk",
"name": "openvibe-sdk",
- "version": "0.121.0",
+ "version": "0.122.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.",
"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",
"main": "index.js",
"types": "types/index.d.ts",
"types": "types/index.d.ts",
@@ -83,6 +83,9 @@ function createChatClient(client, defaults = {}) {
@@ -83,6 +83,9 @@ function createChatClient(client, defaults = {}) {
blocks: (o = {}) => call({ path: '/api/dm/blocks' }, o),
blocks: (o = {}) => call({ path: '/api/dm/blocks' }, o),
block: (userId, o = {}) => call({ method: 'POST', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
block: (userId, o = {}) => call({ method: 'POST', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
unblock: (userId, o = {}) => call({ method: 'DELETE', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
unblock: (userId, o = {}) => call({ method: 'DELETE', path: `/api/dm/blocks/${enc(userId)}`, ...once }, o),
+ /** Saved view for one conversation: { view: 'bubbles' | 'room' }. */
+ viewPreference: (id, o = {}) => call({ path: `${conv(id)}/view` }, o),
+ setViewPreference: (id, view, o = {}) => call({ method: 'PUT', path: `${conv(id)}/view`, json: { view }, ...once }, o),
},
},
/** Every message you sent that is still visible: { username, total, truncated, messages } (JSON). */
/** Every message you sent that is still visible: { username, total, truncated, messages } (JSON). */
exportMine: (o = {}) => call({ path: '/api/chat/me/export' }, o),
exportMine: (o = {}) => call({ path: '/api/chat/me/export' }, o),
@@ -8,7 +8,7 @@ const { paginate, offsetPager } = require('./paginate');
@@ -8,7 +8,7 @@ const { paginate, offsetPager } = require('./paginate');
const semver = require('./semver');
const semver = require('./semver');
/** The package version (test/version.test.js keeps it equal to package.json). */
/** The package version (test/version.test.js keeps it equal to package.json). */
-const SDK_VERSION = '0.121.0';
+const SDK_VERSION = '0.122.0';
module.exports = {
module.exports = {
createClient,
createClient,
@@ -42,6 +42,8 @@ run([
@@ -42,6 +42,8 @@ run([
await chat.dms.create([42], { name: 'pair' });
await chat.dms.create([42], { name: 'pair' });
await chat.dms.send(7, 'hi');
await chat.dms.send(7, 'hi');
await chat.dms.messages(7, { limit: 20 });
await chat.dms.messages(7, { limit: 20 });
+ await chat.dms.viewPreference(7);
+ await chat.dms.setViewPreference(7, 'bubbles');
await chat.global.history({ after_id: 5 });
await chat.global.history({ after_id: 5 });
const got = srv.requests.map((r) => [r.method, r.url, r.body && String(r.body).length ? JSON.parse(String(r.body)) : null]);
const got = srv.requests.map((r) => [r.method, r.url, r.body && String(r.body).length ? JSON.parse(String(r.body)) : null]);
assert.deepEqual(got, [
assert.deepEqual(got, [
@@ -52,6 +54,8 @@ run([
@@ -52,6 +54,8 @@ run([
['POST', '/api/dm/conversations', { user_ids: [42], name: 'pair' }],
['POST', '/api/dm/conversations', { user_ids: [42], name: 'pair' }],
['POST', '/api/dm/conversations/7/messages', { message: 'hi' }],
['POST', '/api/dm/conversations/7/messages', { message: 'hi' }],
['GET', '/api/dm/conversations/7/messages?limit=20', null],
['GET', '/api/dm/conversations/7/messages?limit=20', null],
+ ['GET', '/api/dm/conversations/7/view', null],
+ ['PUT', '/api/dm/conversations/7/view', { view: 'bubbles' }],
['GET', '/api/chat/global/history?after_id=5', null],
['GET', '/api/chat/global/history?after_id=5', null],
]);
]);
assert.equal(srv.requests[0].headers.authorization, 'Bearer user-jwt');
assert.equal(srv.requests[0].headers.authorization, 'Bearer user-jwt');
@@ -72,7 +72,7 @@ run([
@@ -72,7 +72,7 @@ run([
})().catch((err) => { console.error(err); process.exit(1); });`;
})().catch((err) => { console.error(err); process.exit(1); });`;
const res = execFileSync(process.execPath, ['-e', script], { cwd: app, encoding: 'utf8' });
const res = execFileSync(process.execPath, ['-e', script], { cwd: app, encoding: 'utf8' });
assert.match(res, new RegExp(`consumer ok: ${subpaths.length} subpaths \\+ the browser bundle`));
assert.match(res, new RegExp(`consumer ok: ${subpaths.length} subpaths \\+ the browser bundle`));
- assert.equal(subpaths.length, 98); // Adds the upload client and the UI entry (0.121.0); the wallet came in 0.119.0.
+ assert.equal(subpaths.length, 98); // Adds the upload client and the UI entry (0.122.0); the wallet came in 0.119.0.
assert.ok(!fs.existsSync(path.join(app, 'node_modules/openvibe-contracts')), 'the optional peer is not installed');
assert.ok(!fs.existsSync(path.join(app, 'node_modules/openvibe-contracts')), 'the optional peer is not installed');
} finally {
} finally {
fs.rmSync(tmp, { recursive: true, force: true });
fs.rmSync(tmp, { recursive: true, force: true });
@@ -2,6 +2,7 @@ import type { OpenVibeClient } from './core';
@@ -2,6 +2,7 @@ import type { OpenVibeClient } from './core';
type Opts = { signal?: AbortSignal };
type Opts = { signal?: AbortSignal };
type Json = Record<string, unknown>;
type Json = Record<string, unknown>;
+export type ChatMessageView = 'bubbles' | 'room';
export interface ChatClient {
export interface ChatClient {
/** Ask Vibe using Auto, one catalogue model, or two to three models side by side. */
/** 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 }>;
ask(input: { message: string; models?: string[]; slug?: string; fresh?: boolean; system_prompt?: string; temperature?: number }, opts?: Opts): Promise<{ chat: Json; message: Json }>;
@@ -38,6 +39,8 @@ export interface ChatClient {
@@ -38,6 +39,8 @@ export interface ChatClient {
blocks(opts?: Opts): Promise<Json>;
blocks(opts?: Opts): Promise<Json>;
block(userId: number | string, opts?: Opts): Promise<Json>;
block(userId: number | string, opts?: Opts): Promise<Json>;
unblock(userId: number | string, opts?: Opts): Promise<Json>;
unblock(userId: number | string, opts?: Opts): Promise<Json>;
+ viewPreference(id: number | string, opts?: Opts): Promise<{ view: ChatMessageView; conversation_id: number }>;
+ setViewPreference(id: number | string, view: ChatMessageView, opts?: Opts): Promise<{ view: ChatMessageView; conversation_id: number }>;
};
};
exportMine(opts?: Opts): Promise<{ username: string; exported_at: string; total: number; truncated: boolean; messages: Json[] }>;
exportMine(opts?: Opts): Promise<{ username: string; exported_at: string; total: number; truncated: boolean; messages: Json[] }>;
vibe: {
vibe: {