openvibers/openvibe.sdk Commits
BA3: the batches say what cancelling does (#135)
Changes
@@@ -1,5 +1,14 @@# Changelog++## 0.98.1 (2026-11-07)++++- `ai.batches.cancel` says what cancelling does: only the prompts that never had a run are cancelled, and++ nothing is charged for them. A prompt that already has a run (the provider is working on it) goes on and++ settles on its own path: it keeps its status, the answer says so, and nobody is told it was not charged.++ The batch itself is cancelled only when nothing is left in flight. The same note is on `AiBatchItem.reason`.++ No runtime change.++++## 0.98.0 (2026-11-07)- `ai.runs.create` (and the direct operations) may ask for the class the caller may wait in:@@@ -2,7 +2,7 @@> Supported browser and server clients for the OpenVibe platform.--**Status:** alpha, v0.98.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.98.1 (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.98.0++npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.98.1```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.98.0",++ "version": "0.98.1","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.98.0, MIT). Do not edit.++// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.98.1, MIT). Do not edit.// One self-contained ES module: core at the top level plus the browser-safe subpaths as namespaces// (auth, locker, registry, modules, realtime, media, community, bot, search, bench, meme, vision, themes, redact, chat, ai, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity./* eslint-disable */@@@ -48,7 +48,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.98.0';++const SDK_VERSION = '0.98.1';module.exports = {createClient,@@@ -4692,7 +4692,13 @@ function createAiClient(client, defaults = {}) {list: (query = {}, o = {}) => call({ path: '/api/v1/batches', query }, o),/** One batch with its items → { batch } (null when there is no such batch) */get: (id, o = {}) => orNull(call({ path: `/api/v1/batches/${enc(id)}` }, o)),-- /** Cancel a batch: the items that had not run are cancelled and nothing is charged for them → { batch } */++ /**++ * Cancel a batch → { batch }++ *++ * Only the prompts that never had a run are cancelled, and nothing is charged for them. A prompt++ * that already has a run (the provider is working on it) goes on and settles on its own path: it++ * keeps its status, the answer says so, and nobody is told it was not charged.++ */cancel: (id, o = {}) => call({ method: 'POST', path: `/api/v1/batches/${enc(id)}/cancel`, idempotencyKey: false }, o),};@@@ -1,12 +1,12 @@{"name": "openvibe-sdk",-- "version": "0.98.0",++ "version": "0.98.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "openvibe-sdk",-- "version": "0.98.0",++ "version": "0.98.1","license": "MIT","bin": {"openvibe-download": "bin/openvibe-download.js"@@@ -1,6 +1,6 @@{"name": "openvibe-sdk",-- "version": "0.98.0",++ "version": "0.98.1","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",@@@ -106,7 +106,13 @@ function createAiClient(client, defaults = {}) {list: (query = {}, o = {}) => call({ path: '/api/v1/batches', query }, o),/** One batch with its items → { batch } (null when there is no such batch) */get: (id, o = {}) => orNull(call({ path: `/api/v1/batches/${enc(id)}` }, o)),-- /** Cancel a batch: the items that had not run are cancelled and nothing is charged for them → { batch } */++ /**++ * Cancel a batch → { batch }++ *++ * Only the prompts that never had a run are cancelled, and nothing is charged for them. A prompt++ * that already has a run (the provider is working on it) goes on and settles on its own path: it++ * keeps its status, the answer says so, and nobody is told it was not charged.++ */cancel: (id, o = {}) => call({ method: 'POST', path: `/api/v1/batches/${enc(id)}/cancel`, idempotencyKey: false }, 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.98.0';++const SDK_VERSION = '0.98.1';module.exports = {createClient,@@@ -22,7 +22,9 @@ export interface AiBatchItem {idx: number;status: 'queued' | 'waiting' | 'running' | 'succeeded' | 'failed' | 'expired' | 'cancelled' | string;model?: string | null; run_id?: string | null; answer?: string | null;-- error_code?: string | null; error_detail?: string | null; reason?: string | null; capacity?: string | null;++ error_code?: string | null; error_detail?: string | null;++ /** The plain note about the prompt: it expired (it was not charged), it was cancelled before it ran (it was not charged), or it was already sent to the provider (it finishes and is charged). */++ reason?: string | null; capacity?: string | null;route_provider?: string | null; route_model?: string | null;cost_nano_usd?: string | null; absorbed_nano_usd?: string | null; charged_nano_usd?: string | null;deadline_at?: string; created_at?: string; updated_at?: string;@@@ -42,6 +44,7 @@ export interface AiBatches {create(items: Array<string | { prompt: string; model?: string }>, opts?: { model?: string; deadlineHours?: number; idempotencyKey?: string; signal?: AbortSignal }): Promise<{ batch: AiBatch }>;list(query?: Record<string, string | number>, opts?: { signal?: AbortSignal }): Promise<{ batches: AiBatch[]; [field: string]: unknown }>;get(id: string, opts?: { signal?: AbortSignal }): Promise<{ batch: AiBatch } | null>;++ /** Cancels a batch: only the prompts that never had a run are cancelled, and nothing is charged for them; a prompt that already has a run goes on and settles on its own path. */cancel(id: string, opts?: { signal?: AbortSignal }): Promise<{ batch: AiBatch }>;}type Op = (input?: Record<string, unknown>, opts?: Omit<RunOptions, 'version' | 'onBehalfOf'>) => Promise<RunResponse>;
@@ -1,5 +1,14 @@
@@ -1,5 +1,14 @@
# Changelog
# Changelog
+## 0.98.1 (2026-11-07)
+
+- `ai.batches.cancel` says what cancelling does: only the prompts that never had a run are cancelled, and
+ nothing is charged for them. A prompt that already has a run (the provider is working on it) goes on and
+ settles on its own path: it keeps its status, the answer says so, and nobody is told it was not charged.
+ The batch itself is cancelled only when nothing is left in flight. The same note is on `AiBatchItem.reason`.
+ No runtime change.
+
+
## 0.98.0 (2026-11-07)
## 0.98.0 (2026-11-07)
- `ai.runs.create` (and the direct operations) may ask for the class the caller may wait in:
- `ai.runs.create` (and the direct operations) may ask for the class the caller may wait in:
@@ -2,7 +2,7 @@
@@ -2,7 +2,7 @@
> Supported browser and server clients for the OpenVibe platform.
> Supported browser and server clients for the OpenVibe platform.
-**Status:** alpha, v0.98.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.98.1 (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.
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
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.98.0
+npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.98.1
```
```
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.98.0",
+ "version": "0.98.1",
"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.98.0, MIT). Do not edit.
+// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.98.1, 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, modules, realtime, media, community, bot, search, bench, meme, vision, themes, redact, chat, ai, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
// (auth, locker, registry, modules, realtime, media, community, bot, search, bench, meme, vision, themes, redact, chat, ai, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
/* eslint-disable */
/* eslint-disable */
@@ -48,7 +48,7 @@ const { paginate, offsetPager } = __load(7);
@@ -48,7 +48,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.98.0';
+const SDK_VERSION = '0.98.1';
module.exports = {
module.exports = {
createClient,
createClient,
@@ -4692,7 +4692,13 @@ function createAiClient(client, defaults = {}) {
@@ -4692,7 +4692,13 @@ function createAiClient(client, defaults = {}) {
list: (query = {}, o = {}) => call({ path: '/api/v1/batches', query }, o),
list: (query = {}, o = {}) => call({ path: '/api/v1/batches', query }, o),
/** One batch with its items → { batch } (null when there is no such batch) */
/** One batch with its items → { batch } (null when there is no such batch) */
get: (id, o = {}) => orNull(call({ path: `/api/v1/batches/${enc(id)}` }, o)),
get: (id, o = {}) => orNull(call({ path: `/api/v1/batches/${enc(id)}` }, o)),
- /** Cancel a batch: the items that had not run are cancelled and nothing is charged for them → { batch } */
+ /**
+ * Cancel a batch → { batch }
+ *
+ * Only the prompts that never had a run are cancelled, and nothing is charged for them. A prompt
+ * that already has a run (the provider is working on it) goes on and settles on its own path: it
+ * keeps its status, the answer says so, and nobody is told it was not charged.
+ */
cancel: (id, o = {}) => call({ method: 'POST', path: `/api/v1/batches/${enc(id)}/cancel`, idempotencyKey: false }, o),
cancel: (id, o = {}) => call({ method: 'POST', path: `/api/v1/batches/${enc(id)}/cancel`, idempotencyKey: false }, o),
};
};
@@ -1,12 +1,12 @@
@@ -1,12 +1,12 @@
{
{
"name": "openvibe-sdk",
"name": "openvibe-sdk",
- "version": "0.98.0",
+ "version": "0.98.1",
"lockfileVersion": 3,
"lockfileVersion": 3,
"requires": true,
"requires": true,
"packages": {
"packages": {
"": {
"": {
"name": "openvibe-sdk",
"name": "openvibe-sdk",
- "version": "0.98.0",
+ "version": "0.98.1",
"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.98.0",
+ "version": "0.98.1",
"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",
@@ -106,7 +106,13 @@ function createAiClient(client, defaults = {}) {
@@ -106,7 +106,13 @@ function createAiClient(client, defaults = {}) {
list: (query = {}, o = {}) => call({ path: '/api/v1/batches', query }, o),
list: (query = {}, o = {}) => call({ path: '/api/v1/batches', query }, o),
/** One batch with its items → { batch } (null when there is no such batch) */
/** One batch with its items → { batch } (null when there is no such batch) */
get: (id, o = {}) => orNull(call({ path: `/api/v1/batches/${enc(id)}` }, o)),
get: (id, o = {}) => orNull(call({ path: `/api/v1/batches/${enc(id)}` }, o)),
- /** Cancel a batch: the items that had not run are cancelled and nothing is charged for them → { batch } */
+ /**
+ * Cancel a batch → { batch }
+ *
+ * Only the prompts that never had a run are cancelled, and nothing is charged for them. A prompt
+ * that already has a run (the provider is working on it) goes on and settles on its own path: it
+ * keeps its status, the answer says so, and nobody is told it was not charged.
+ */
cancel: (id, o = {}) => call({ method: 'POST', path: `/api/v1/batches/${enc(id)}/cancel`, idempotencyKey: false }, o),
cancel: (id, o = {}) => call({ method: 'POST', path: `/api/v1/batches/${enc(id)}/cancel`, idempotencyKey: false }, 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.98.0';
+const SDK_VERSION = '0.98.1';
module.exports = {
module.exports = {
createClient,
createClient,
@@ -22,7 +22,9 @@ export interface AiBatchItem {
@@ -22,7 +22,9 @@ export interface AiBatchItem {
idx: number;
idx: number;
status: 'queued' | 'waiting' | 'running' | 'succeeded' | 'failed' | 'expired' | 'cancelled' | string;
status: 'queued' | 'waiting' | 'running' | 'succeeded' | 'failed' | 'expired' | 'cancelled' | string;
model?: string | null; run_id?: string | null; answer?: string | null;
model?: string | null; run_id?: string | null; answer?: string | null;
- error_code?: string | null; error_detail?: string | null; reason?: string | null; capacity?: string | null;
+ error_code?: string | null; error_detail?: string | null;
+ /** The plain note about the prompt: it expired (it was not charged), it was cancelled before it ran (it was not charged), or it was already sent to the provider (it finishes and is charged). */
+ reason?: string | null; capacity?: string | null;
route_provider?: string | null; route_model?: string | null;
route_provider?: string | null; route_model?: string | null;
cost_nano_usd?: string | null; absorbed_nano_usd?: string | null; charged_nano_usd?: string | null;
cost_nano_usd?: string | null; absorbed_nano_usd?: string | null; charged_nano_usd?: string | null;
deadline_at?: string; created_at?: string; updated_at?: string;
deadline_at?: string; created_at?: string; updated_at?: string;
@@ -42,6 +44,7 @@ export interface AiBatches {
@@ -42,6 +44,7 @@ export interface AiBatches {
create(items: Array<string | { prompt: string; model?: string }>, opts?: { model?: string; deadlineHours?: number; idempotencyKey?: string; signal?: AbortSignal }): Promise<{ batch: AiBatch }>;
create(items: Array<string | { prompt: string; model?: string }>, opts?: { model?: string; deadlineHours?: number; idempotencyKey?: string; signal?: AbortSignal }): Promise<{ batch: AiBatch }>;
list(query?: Record<string, string | number>, opts?: { signal?: AbortSignal }): Promise<{ batches: AiBatch[]; [field: string]: unknown }>;
list(query?: Record<string, string | number>, opts?: { signal?: AbortSignal }): Promise<{ batches: AiBatch[]; [field: string]: unknown }>;
get(id: string, opts?: { signal?: AbortSignal }): Promise<{ batch: AiBatch } | null>;
get(id: string, opts?: { signal?: AbortSignal }): Promise<{ batch: AiBatch } | null>;
+ /** Cancels a batch: only the prompts that never had a run are cancelled, and nothing is charged for them; a prompt that already has a run goes on and settles on its own path. */
cancel(id: string, opts?: { signal?: AbortSignal }): Promise<{ batch: AiBatch }>;
cancel(id: string, opts?: { signal?: AbortSignal }): Promise<{ batch: AiBatch }>;
}
}
type Op = (input?: Record<string, unknown>, opts?: Omit<RunOptions, 'version' | 'onBehalfOf'>) => Promise<RunResponse>;
type Op = (input?: Record<string, unknown>, opts?: Omit<RunOptions, 'version' | 'onBehalfOf'>) => Promise<RunResponse>;