openvibers/openvibe.sdk Commits

Add M1 home and feed SDK methods (#146)

OP OpenVibers committed 4 days ago · 19ac825180 · 20 files, +195 −60

* Add home and feed client methods

* Refresh SDK browser bundle and API surface

* Declare home feed in browser bundle types

* SDK 0.106.0: the home screen and feed client, on Contracts v0.352.0

Merges main (0.105.0); pins openvibe-contracts v0.352.0 (the M1 contracts); version 0.106.0 in package.json, the lock,
SDK_VERSION, STATUS, README and the browser bundle; contract types re-copied; the pack test counts 93 subpaths.

Changes

ddiff --git a/CHANGELOG.md b/CHANGELOG.md
iindex 07b2643..27a6731 100644
---- a/CHANGELOG.md
++++ b/CHANGELOG.md
@@@ -1,5 +1,9 @@
# Changelog
++## 0.106.0 (2026-11-09)
++
++- Add `openvibe-sdk/home-feed` and `homeFeed` to the top-level and browser exports, with home layout, Today frame, and personal feed methods.
++
## 0.105.0 (2026-11-09)
- Add Report AI leaderboard, model, provider, comparison and picks reads, plus Exchange Arena start and vote methods.
ddiff --git a/README.md b/README.md
iindex a87d768..9273536 100644
---- a/README.md
++++ b/README.md
@@@ -2,7 +2,7 @@
> Supported browser and server clients for the OpenVibe platform.
--**Status:** alpha, v0.105.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.106.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.105.0
++npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.106.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).
@@@ -175,6 +175,7 @@ Until OpenVibe.Tools serves the gateway facade (Tools S6), point the jobs client
| `openvibe-sdk/realtime` | both | `subscribe(topics, onEvent, {lastEventId, onGap, …})`, `createRealtimeClient(client)`, `parseSSE(body)` |
| `openvibe-sdk/media` | both (credentials: server) | `createMediaClient(client, {app, apiKey?, actingUserId?})`: `files.upload/list/iterate/get/delete`; `mediaUrls(origin)` public URL helpers; `createObjectsClient({app, baseUrl?, tokenClient \| apiKey \| client})`: object API v2 `upload` (single or multipart by size, resumable), `resume`, `get`, `signedUrl`, `delete`, `list`, `iterate`, and `jobs.create/get/list/approve/cancel/wait`; Media's origin from the platform descriptor when `baseUrl` is omitted |
| `openvibe-sdk/community` | both | `createCommunityClient(client, {actingSubject?, origin?, sourceRef?, staff?})`: `pastes.list/iterate/get/create/update/delete/fork/like/copy/versions/byUser/config`, `pastes.comments.list/create/delete`, `as(subject)` |
++| `openvibe-sdk/home-feed` | both | `createHomeFeedClient(client)` gives `ov.home.get()/set(layout)`, `ov.network.today()`, `ov.feed.list({ for: 'me', cursor })`, `ov.feed.post(text)`, and `ov.feed.contribute({ id, text, url })`. Personal calls need a user Bearer token; contribution needs an app token granted `community.pulse.contribute`. Today is public and cached by Network for five minutes. |
| `openvibe-sdk/bot` | both | `createBotClient(client, {actingSubject?})`: OpenVibe.Bot robots. `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.list/get` and `kits.list/get`, `pair` (the agent's one-time code, never retried), `as(subject)`; a service acts for a person with `X-OV-Subject` (capabilities `bot.robot.read`/`manage`/`control`, `bot.device.connect`) |
| `openvibe-sdk/themes` | both | `createThemesClient(client)`: `catalog({mode, search, sort, limit})` (seasonal themes carry `season`), `get(idOrSlug)` (null when missing), `export(idOrSlug)`, `active()` (`{theme_id, custom_variables, display}`), `set(themeId, {custom})`, `setDisplay({motion, text, seasonal})`, `seasons({date})`, `submissions()`, `submit(theme)`, `import(file)`. In the browser: `followTheme(fn)` calls back now and on every theme, display or season change with `readTheme()` (`{id, mode, tokens, display: {motion, text, textScale, seasonal, calm}, season, seasonMark}`) and returns `stop()`, for a canvas or game to keep up; `applyTheme(vars, {root})`, `seasonOn(date, seasons)`, `onColor(hex)`, `DISPLAY_OPTIONS`, `TOKENS` |
| `openvibe-sdk/bench` | both | `createBenchClient(client, {actingSubject?})`: `kinds.list/get`, `tasks.create/get`, `rounds.create/get`, `entries.submit`, `judgements.next/cast`, `boards.get`, `models.get`, `datasets.get/iterate`, `evals.create/get/run/results`, `mcpTools()`. Audience `openvibe.bench`; service id `bench`. |
ddiff --git a/STATUS.json b/STATUS.json
iindex 9faae50..2dd709d 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -3,7 +3,7 @@
"stage": "alpha",
"code": true,
"wave": "W2",
-- "version": "0.105.0",
++ "version": "0.106.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.js b/browser.js
iindex eea053d..a7f3b10 100644
---- a/browser.js
++++ b/browser.js
@@@ -15,6 +15,7 @@ module.exports = {
realtime: require('./src/realtime'),
media: require('./src/media'),
community: require('./src/community'),
++ homeFeed: require('./src/home-feed'),
bot: require('./src/bot'),
search: require('./src/search'),
bench: require('./src/bench'),
ddiff --git a/browser/openvibe-sdk.mjs b/browser/openvibe-sdk.mjs
iindex dc21208..317a0a6 100644
---- a/browser/openvibe-sdk.mjs
++++ b/browser/openvibe-sdk.mjs
@@@ -1,6 +1,6 @@
--// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.105.0, MIT). Do not edit.
++// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.106.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, community, 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.
++// (auth, locker, registry, trust, modules, realtime, media, 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 */
const __defs = [
// ── 0: browser.js ──────────────────────────────────────────────────
@@@ -22,20 +22,21 @@ module.exports = {
realtime: __load(23),
media: __load(24),
community: __load(26),
-- bot: __load(27),
-- search: __load(28),
-- bench: __load(29),
-- meme: __load(30),
-- vision: __load(31),
-- themes: __load(32),
-- redact: __load(33),
-- chat: __load(34),
-- ai: __load(35),
-- credentials: __load(36),
-- jobs: __load(37),
-- tools: __load(39),
-- projects: __load(40),
-- geo: __load(41),
++ homeFeed: __load(27),
++ bot: __load(28),
++ search: __load(29),
++ bench: __load(30),
++ meme: __load(31),
++ vision: __load(32),
++ themes: __load(33),
++ redact: __load(34),
++ chat: __load(35),
++ ai: __load(36),
++ credentials: __load(37),
++ jobs: __load(38),
++ tools: __load(40),
++ projects: __load(41),
++ geo: __load(42),
};
},
// ── 1: src/core/index.js ───────────────────────────────────────────
@@@ -50,7 +51,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.105.0';
++const SDK_VERSION = '0.106.0';
module.exports = {
createClient,
@@@ -3341,7 +3342,34 @@ function createCommunityClient(client, defaults = {}) {
module.exports = { createCommunityClient, actingHeaders };
},
--// ── 27: src/bot.js ──────────────────────────────────────────────────
++// ── 27: src/home-feed.js ────────────────────────────────────────────
++function (module, exports) {
++'use strict';
++/** The menu's portable Home layout, network day counts and personal wall. Pass a user-token core client;
++ * contribute() needs an app token with the person's community.pulse.contribute grant. */
++function createHomeFeedClient(client, { networkBaseUrl, communityBaseUrl } = {}) {
++ if (!client || typeof client.json !== 'function') throw new TypeError('createHomeFeedClient: pass an openvibe-sdk/core client');
++ const network = (opts) => client.json({ service: 'network', baseUrl: networkBaseUrl, audience: 'openvibe.network', ...opts });
++ const community = (opts) => client.json({ service: 'community', baseUrl: communityBaseUrl, audience: 'openvibe.community', ...opts });
++ return {
++ home: {
++ get: ({ signal } = {}) => network({ path: '/api/v1/me/home-screen', signal }),
++ set: (layout, { signal } = {}) => network({ method: 'PUT', path: '/api/v1/me/home-screen', json: layout, signal }),
++ },
++ network: {
++ today: ({ signal } = {}) => network({ path: '/api/v1/frame/today', auth: false, signal }),
++ },
++ feed: {
++ list: ({ for: audience = 'me', cursor, signal } = {}) => community({ path: '/api/v1/pulse', query: { for: audience, cursor }, signal }),
++ post: (text, { link, signal } = {}) => community({ method: 'POST', path: '/api/v1/me/status', json: { text, ...(link ? { link } : {}) }, idempotencyKey: false, signal }),
++ contribute: (item, { signal } = {}) => community({ method: 'POST', path: '/api/v1/pulse/items', json: item, idempotencyKey: false, signal }),
++ },
++ };
++}
++
++module.exports = { createHomeFeedClient };
++},
++// ── 28: src/bot.js ──────────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -3563,7 +3591,7 @@ function createBotClient(client, defaults = {}) {
module.exports = { createBotClient, actingHeaders };
},
--// ── 28: src/search.js ───────────────────────────────────────────────
++// ── 29: src/search.js ───────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -3676,7 +3704,7 @@ function createSearchClient(client, defaults = {}) {
module.exports = { createSearchClient, queryOf, fabricOf };
},
--// ── 29: src/bench.js ────────────────────────────────────────────────
++// ── 30: src/bench.js ────────────────────────────────────────────────
function (module, exports) {
'use strict';
/** openvibe-sdk/bench: OpenVibe.Bench's JSON API and streamed open dataset. Browser-safe. */
@@@ -3777,7 +3805,7 @@ function createBenchClient(client, defaults = {}) {
module.exports = { createBenchClient };
},
--// ── 30: src/meme.js ─────────────────────────────────────────────────
++// ── 31: src/meme.js ─────────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -3845,7 +3873,7 @@ function createMemeClient(client, defaults = {}) {
module.exports = { createMemeClient };
},
--// ── 31: src/vision.js ───────────────────────────────────────────────
++// ── 32: src/vision.js ───────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -4003,7 +4031,7 @@ function pick(o, keys) {
module.exports = { createVisionClient, DEFAULT_AUDIENCE };
},
--// ── 32: src/themes.js ───────────────────────────────────────────────
++// ── 33: src/themes.js ───────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -4153,7 +4181,7 @@ function followTheme(fn, opts = {}) {
module.exports = { createThemesClient, followTheme, readTheme, applyTheme, seasonOn, onColor, DISPLAY_OPTIONS, TOKENS };
},
--// ── 33: src/redact.js ───────────────────────────────────────────────
++// ── 34: src/redact.js ───────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -4400,7 +4428,7 @@ function onlySecret(text) {
module.exports = { redact, onlySecret };
},
--// ── 34: src/chat.js ─────────────────────────────────────────────────
++// ── 35: src/chat.js ─────────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -4642,7 +4670,7 @@ function createFeedPublisher(client, { feed, key, baseUrl } = {}) {
module.exports = { createChatClient, createInboxVisitor, createFeedPublisher };
},
--// ── 35: src/ai.js ───────────────────────────────────────────────────
++// ── 36: src/ai.js ───────────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -4774,7 +4802,7 @@ function createAiClient(client, defaults = {}) {
module.exports = { createAiClient, TERMINAL, OPS, CLASSES };
},
--// ── 36: src/credentials.js ──────────────────────────────────────────
++// ── 37: src/credentials.js ──────────────────────────────────────────
function (module, exports) {
'use strict';
@@@ -4792,7 +4820,7 @@ function createCredentialsClient(client, defaults = {}) {
module.exports = { createCredentialsClient };
},
--// ── 37: src/jobs.js ─────────────────────────────────────────────────
++// ── 38: src/jobs.js ─────────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -4830,7 +4858,7 @@ function (module, exports) {
*/
const { OpenVibeError, isOpenVibeError } = __load(3);
const { newIdempotencyKey } = __load(5);
--const { appendFiles } = __load(38);
++const { appendFiles } = __load(39);
const { parseSSE } = __load(23);
const TERMINAL = new Set(['succeeded', 'failed', 'cancelled']);
@@@ -4994,7 +5022,7 @@ function createJobsClient(client, { baseUrl, service = 'tools', audience = 'open
module.exports = { createJobsClient, isTerminal, TERMINAL_STATES: [...TERMINAL] };
},
--// ── 38: src/core/form.js ────────────────────────────────────────────
++// ── 39: src/core/form.js ────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -5028,7 +5056,7 @@ function appendFiles(form, list, where) {
module.exports = { isBlob, isUpload, appendFiles };
},
--// ── 39: src/tools.js ────────────────────────────────────────────────
++// ── 40: src/tools.js ────────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -5062,8 +5090,8 @@ function (module, exports) {
*/
const { OpenVibeError, isOpenVibeError } = __load(3);
const { newIdempotencyKey } = __load(5);
--const { isUpload, appendFiles } = __load(38);
--const { createJobsClient } = __load(37);
++const { isUpload, appendFiles } = __load(39);
++const { createJobsClient } = __load(38);
const enc = encodeURIComponent;
const ID_RE = /^[a-z][a-z0-9-]{0,39}$/;
@@@ -5313,7 +5341,7 @@ function createToolsClient(client, { baseUrl, service = 'tools', audience = 'ope
module.exports = { createToolsClient, ToolRunError, isToolRunError };
},
--// ── 40: src/projects.js ─────────────────────────────────────────────
++// ── 41: src/projects.js ─────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -5429,7 +5457,7 @@ function createProjectsClient(client, { baseUrl } = {}) {
module.exports = { createProjectsClient };
},
--// ── 41: src/geo.js ──────────────────────────────────────────────────
++// ── 42: src/geo.js ──────────────────────────────────────────────────
function (module, exports) {
'use strict';
/**
@@@ -5509,8 +5537,8 @@ export const {
startSpan, contextFromHeaders, ulid, newEventId, newIdempotencyKey, isActingSubjectId,
satisfiesRange, compareVersions, CONTRACTS_RANGE, DEFAULT_NETWORK, SDK_VERSION, auth,
locker, registry, trust, modules, realtime, media,
-- community, bot, search, bench, meme, vision,
-- themes, redact, chat, ai, credentials, jobs,
-- tools, projects, geo,
++ community, homeFeed, bot, search, bench, meme,
++ vision, themes, redact, chat, ai, credentials,
++ jobs, tools, projects, geo,
} = sdk;
export default sdk;
ddiff --git a/docs/api-surface.json b/docs/api-surface.json
iindex c101a90..ef2d353 100644
---- a/docs/api-surface.json
++++ b/docs/api-surface.json
@@@ -155,6 +155,11 @@
"createGeoClient"
]
},
++ "homeFeed": {
++ "object": [
++ "createHomeFeedClient"
++ ]
++ },
"host": {
"object": [
"createHostClient"
@@@ -723,6 +728,9 @@
},
"createGovernor": "function"
},
++ "openvibe-sdk/home-feed": {
++ "createHomeFeedClient": "function"
++ },
"openvibe-sdk/host": {
"createHostClient": "function"
},
ddiff --git a/esm/home-feed.mjs b/esm/home-feed.mjs
nnew file mode 100644
iindex 0000000..da140ec
---- /dev/null
++++ b/esm/home-feed.mjs
@@@ -0,0 +1,7 @@
++// Generated by scripts/esm.js from src/home-feed.js. Do not edit.
++import cjs from '../src/home-feed.js';
++
++export const {
++ createHomeFeedClient,
++} = cjs;
++export default cjs;
ddiff --git a/esm/index.mjs b/esm/index.mjs
iindex f65ca0f..ac00385 100644
---- a/esm/index.mjs
++++ b/esm/index.mjs
@@@ -6,13 +6,13 @@ export const {
startSpan, contextFromHeaders, ulid, newEventId, newIdempotencyKey, isActingSubjectId,
satisfiesRange, compareVersions, CONTRACTS_RANGE, DEFAULT_NETWORK, SDK_VERSION, report,
share, locker, auth, registry, identity, trust,
-- modules, events, realtime, media, community, bot,
-- search, bench, meme, vision, themes, redact,
-- chat, chatApps, ai, credentials, jobs, tools,
-- projects, resources, vip, quest, live, inventory,
-- tips, blog, reviews, wiki, coupons, deals,
-- trade, space, host, news, food, actor,
-- run, video, work, zone, play, download,
-- openre, geo, usage, commerce, telemetry,
++ modules, events, realtime, media, community, homeFeed,
++ bot, search, bench, meme, vision, themes,
++ redact, chat, chatApps, ai, credentials, jobs,
++ tools, projects, resources, vip, quest, live,
++ inventory, tips, blog, reviews, wiki, coupons,
++ deals, trade, space, host, news, food,
++ actor, run, video, work, zone, play,
++ download, openre, geo, usage, commerce, telemetry,
} = cjs;
export default cjs;
ddiff --git a/index.js b/index.js
iindex c23f7e9..eacd4bc 100644
---- a/index.js
++++ b/index.js
@@@ -20,6 +20,7 @@ module.exports = {
realtime: require('./src/realtime'),
media: require('./src/media'),
community: require('./src/community'),
++ homeFeed: require('./src/home-feed'),
bot: require('./src/bot'),
search: require('./src/search'),
bench: require('./src/bench'),
ddiff --git a/package-lock.json b/package-lock.json
iindex d506d8a..72caf86 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -1,12 +1,12 @@
{
"name": "openvibe-sdk",
-- "version": "0.105.0",
++ "version": "0.106.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openvibe-sdk",
-- "version": "0.105.0",
++ "version": "0.106.0",
"license": "MIT",
"bin": {
"openvibe-download": "bin/openvibe-download.js"
@@@ -14,7 +14,7 @@
"devDependencies": {
"@electric-sql/pglite": "^0.5.8",
"iovalkey": "^0.4.0",
-- "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.351.0",
++ "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.352.0",
"pg": "^8.23.0"
},
"engines": {
@@@ -198,9 +198,9 @@
"license": "MIT"
},
"node_modules/openvibe-contracts": {
-- "version": "0.351.0",
-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.351.0",
-- "integrity": "sha512-XfI7OqI78iYHCJ/+n++R0Zrot6OR/dH1DMdL1guZdEX6x/YJ3UF3FCmRjljk4r0GEXmrUlNr1iL6CR9Jfx0uOg==",
++ "version": "0.352.0",
++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.352.0",
++ "integrity": "sha512-TN02BrMU4jzXYZ0rjp5dmLbQI06h5tT6miISS6zS7E7/UFI+fGFidTVtQpZXEYG8gppGEo2UEtZ//hk9kkASyQ==",
"dev": true,
"license": "AGPL-3.0-only",
"dependencies": {
ddiff --git a/package.json b/package.json
iindex 216a241..afb3179 100644
---- a/package.json
++++ b/package.json
@@@ -1,6 +1,6 @@
{
"name": "openvibe-sdk",
-- "version": "0.105.0",
++ "version": "0.106.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",
@@@ -293,6 +293,12 @@
"import": "./esm/menu.mjs",
"default": "./src/menu/index.js"
},
++ "./home-feed": {
++ "types": "./types/home-feed.d.ts",
++ "browser": "./src/home-feed.js",
++ "import": "./esm/home-feed.mjs",
++ "default": "./src/home-feed.js"
++ },
"./geo": {
"types": "./types/geo.d.ts",
"import": "./esm/geo.mjs",
@@@ -578,7 +584,7 @@
"devDependencies": {
"@electric-sql/pglite": "^0.5.8",
"iovalkey": "^0.4.0",
-- "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.351.0",
++ "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.352.0",
"pg": "^8.23.0"
},
"peerDependencies": {
ddiff --git a/scripts/esm.js b/scripts/esm.js
iindex e991ae4..14bac27 100644
---- a/scripts/esm.js
++++ b/scripts/esm.js
@@@ -101,6 +101,7 @@ const ENTRIES = {
'vip.mjs': '../src/vip.js',
'frame.mjs': '../src/frame.js',
'menu.mjs': '../src/menu/index.js',
++ 'home-feed.mjs': '../src/home-feed.js',
'service.mjs': '../src/service/index.js',
'testing.mjs': '../src/testing/index.js',
};
ddiff --git a/src/core/index.js b/src/core/index.js
iindex 3f1f5c4..5269dcc 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.105.0';
++const SDK_VERSION = '0.106.0';
module.exports = {
createClient,
ddiff --git a/src/home-feed.js b/src/home-feed.js
nnew file mode 100644
iindex 0000000..aa26817
---- /dev/null
++++ b/src/home-feed.js
@@@ -0,0 +1,24 @@
++'use strict';
++/** The menu's portable Home layout, network day counts and personal wall. Pass a user-token core client;
++ * contribute() needs an app token with the person's community.pulse.contribute grant. */
++function createHomeFeedClient(client, { networkBaseUrl, communityBaseUrl } = {}) {
++ if (!client || typeof client.json !== 'function') throw new TypeError('createHomeFeedClient: pass an openvibe-sdk/core client');
++ const network = (opts) => client.json({ service: 'network', baseUrl: networkBaseUrl, audience: 'openvibe.network', ...opts });
++ const community = (opts) => client.json({ service: 'community', baseUrl: communityBaseUrl, audience: 'openvibe.community', ...opts });
++ return {
++ home: {
++ get: ({ signal } = {}) => network({ path: '/api/v1/me/home-screen', signal }),
++ set: (layout, { signal } = {}) => network({ method: 'PUT', path: '/api/v1/me/home-screen', json: layout, signal }),
++ },
++ network: {
++ today: ({ signal } = {}) => network({ path: '/api/v1/frame/today', auth: false, signal }),
++ },
++ feed: {
++ list: ({ for: audience = 'me', cursor, signal } = {}) => community({ path: '/api/v1/pulse', query: { for: audience, cursor }, signal }),
++ post: (text, { link, signal } = {}) => community({ method: 'POST', path: '/api/v1/me/status', json: { text, ...(link ? { link } : {}) }, idempotencyKey: false, signal }),
++ contribute: (item, { signal } = {}) => community({ method: 'POST', path: '/api/v1/pulse/items', json: item, idempotencyKey: false, signal }),
++ },
++ };
++}
++
++module.exports = { createHomeFeedClient };
ddiff --git a/test/home-feed.test.js b/test/home-feed.test.js
nnew file mode 100644
iindex 0000000..e95f898
---- /dev/null
++++ b/test/home-feed.test.js
@@@ -0,0 +1,31 @@
++'use strict';
++const assert = require('node:assert/strict');
++const { createHomeFeedClient } = require('../src/home-feed');
++
++(async () => {
++ const calls = [];
++ const client = { json: async (opts) => { calls.push(opts); return opts; } };
++ const ov = createHomeFeedClient(client);
++ const layout = { home: ['live'], folders: [] };
++ await ov.home.get();
++ await ov.home.set(layout);
++ await ov.network.today();
++ await ov.feed.list({ for: 'me', cursor: 'next' });
++ await ov.feed.post('Hello', { link: 'https://openvibe.live/' });
++ await ov.feed.contribute({ id: 'update-1', text: 'New thing', url: 'https://example.test/' });
++ assert.deepEqual(calls.map((c) => [c.service, c.method || 'GET', c.path]), [
++ ['network', 'GET', '/api/v1/me/home-screen'], ['network', 'PUT', '/api/v1/me/home-screen'],
++ ['network', 'GET', '/api/v1/frame/today'], ['community', 'GET', '/api/v1/pulse'],
++ ['community', 'POST', '/api/v1/me/status'], ['community', 'POST', '/api/v1/pulse/items'],
++ ]);
++ assert.deepEqual(calls[1].json, layout);
++ assert.equal(calls[2].auth, false);
++ assert.deepEqual(calls[3].query, { for: 'me', cursor: 'next' });
++ assert.equal(calls[4].idempotencyKey, false);
++ assert.equal(calls[5].idempotencyKey, false);
++ const esm = await import('../esm/home-feed.mjs');
++ assert.equal(typeof esm.createHomeFeedClient, 'function');
++ const packageEntry = await import('openvibe-sdk/home-feed');
++ assert.equal(typeof packageEntry.createHomeFeedClient, 'function');
++ console.log('home-feed: passed');
++})().catch((err) => { console.error(err); process.exitCode = 1; });
ddiff --git a/test/pack.test.js b/test/pack.test.js
iindex 0f18116..aa932f4 100644
---- a/test/pack.test.js
++++ b/test/pack.test.js
@@@ -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, 92); // Adds the Report AI comparison client (0.105.0); 91 had the trust and AI credentials clients.
++ assert.equal(subpaths.length, 93); // Adds the home and feed client (0.106.0); 92 had the Report AI comparison client.
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 });
ddiff --git a/types/bundle.d.ts b/types/bundle.d.ts
iindex 502e3dc..0aacccb 100644
---- a/types/bundle.d.ts
++++ b/types/bundle.d.ts
@@@ -5,6 +5,7 @@ import * as modules from './modules';
import * as realtime from './realtime';
import * as media from './media';
import * as community from './community';
++import * as homeFeed from './home-feed';
import * as bot from './bot';
import * as search from './search';
import * as bench from './bench';
@@@ -30,6 +31,7 @@ export * as modules from './modules';
export * as realtime from './realtime';
export * as media from './media';
export * as community from './community';
++export * as homeFeed from './home-feed';
export * as bot from './bot';
export * as search from './search';
export * as bench from './bench';
@@@ -49,6 +51,6 @@ export * as trust from './trust';
declare const sdk: typeof core & {
auth: typeof auth; registry: typeof registry; modules: typeof modules; realtime: typeof realtime;
-- media: typeof media; community: typeof community; bot: typeof bot; search: typeof search; bench: typeof bench; meme: typeof meme; vision: typeof vision; themes: typeof themes; redact: typeof redact; chat: typeof chat; ai: typeof ai; credentials: typeof credentials; jobs: typeof jobs; tools: typeof tools; projects: typeof projects; geo: typeof geo; locker: typeof locker; trust: typeof trust;
++ media: typeof media; community: typeof community; homeFeed: typeof homeFeed; bot: typeof bot; search: typeof search; bench: typeof bench; meme: typeof meme; vision: typeof vision; themes: typeof themes; redact: typeof redact; chat: typeof chat; ai: typeof ai; credentials: typeof credentials; jobs: typeof jobs; tools: typeof tools; projects: typeof projects; geo: typeof geo; locker: typeof locker; trust: typeof trust;
};
export default sdk;
ddiff --git a/types/contracts.d.ts b/types/contracts.d.ts
iindex 29b571e..0dc268c 100644
---- a/types/contracts.d.ts
++++ b/types/contracts.d.ts
@@@ -76,6 +76,10 @@ export type ServiceTokenClaims = {
* The person who authorized an app through the authorization-code flow, or the owner an agent acts for (always present on agent tokens). Also present on a node token that asks for an audience where the machine acts for its owner (Agent Streams S1: openvibe.live and live.agent_stream.publish); absent on every other client_credentials token.
*/
on_behalf_of?: string;
++ /**
++ * Signed display name of a developer app, for attribution such as via <app>.
++ */
++ app_name?: string;
/**
* App tokens from the authorization-code flow (0.310.0): the purposes the person (on_behalf_of) granted this app at sign-in and that are still active when the token is issued, the claim network.consent-claim@1 defines. Present when the sign-in asked for consent:<purpose> scopes, [] when none is granted, absent otherwise.
*
ddiff --git a/types/home-feed.d.ts b/types/home-feed.d.ts
nnew file mode 100644
iindex 0000000..1597a12
---- /dev/null
++++ b/types/home-feed.d.ts
@@@ -0,0 +1,16 @@
++import type { OpenVibeClient } from './core';
++
++export interface HomeLayout { home: string[]; folders: Array<{ id: string; name: string; apps: string[] }>; updated_at?: string | null; }
++export interface TodayPoint { day: string; people: number | null; streams: number | null; posts: number | null; new_videos: number | null; }
++export interface Today { day: string; people_today: number | null; streams_today: number | null; posts_today: number | null; new_videos_today: number | null; series: TodayPoint[]; updated_at: string; }
++export interface FeedItem { id: number; source: { service: string; type: string; id: string }; title: string; url: string; label: string | null; via?: string; picture_url?: string; actor: Record<string, unknown> | null; occurred_at: string | null; }
++export interface HomeFeedClient {
++ home: { get(opts?: { signal?: AbortSignal }): Promise<HomeLayout>; set(layout: HomeLayout, opts?: { signal?: AbortSignal }): Promise<HomeLayout> };
++ network: { today(opts?: { signal?: AbortSignal }): Promise<Today> };
++ feed: {
++ list(opts?: { for?: 'me'; cursor?: string; signal?: AbortSignal }): Promise<{ items: FeedItem[]; next_cursor: string | null }>;
++ post(text: string, opts?: { link?: string; signal?: AbortSignal }): Promise<{ id: number; post_id: number; text: string; url: string; created_at: string }>;
++ contribute(item: { id: string; text: string; url: string; picture_url?: string }, opts?: { signal?: AbortSignal }): Promise<{ item: FeedItem; created: boolean }>;
++ };
++}
++export declare function createHomeFeedClient(client: OpenVibeClient, opts?: { networkBaseUrl?: string; communityBaseUrl?: string }): HomeFeedClient;
ddiff --git a/types/index.d.ts b/types/index.d.ts
iindex 199b952..9224c0c 100644
---- a/types/index.d.ts
++++ b/types/index.d.ts
@@@ -10,6 +10,7 @@ export * as events from './events';
export * as realtime from './realtime';
export * as media from './media';
export * as community from './community';
++export * as homeFeed from './home-feed';
export * as bot from './bot';
export * as search from './search';
export * as bench from './bench';