@vibedev-si/dsh-vibedev 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/lib/gateway/catalog.d.ts +13 -0
- package/lib/index.js +24 -0
- package/lib/service.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -153,6 +153,8 @@
|
|
|
153
153
|
|
|
154
154
|
插件注册了一个 `vibedevMedia` 服务,其他插件可以用它生成图片和视频,走的是同一套模型选择、参考素材检查、幂等提交和后台保存。影视工作台([dsh-film](https://github.com/VibeDev-Si/dsh-film))的分镜画布就是通过它生成的。调用方已经向用户显示过价格,所以不会再触发「每次付费生成前先询问」。
|
|
155
155
|
|
|
156
|
+
0.3.8 起,`models()` 返回的图片模型会带上网关为它声明的尺寸档位和画面比例:网关 `/v1/models` 里的 `capabilities.image_sizes` 对应 `imageSizes`(如 `["1K", "1.5K", "2K", "4K"]`),`capabilities.image_ratios` 对应 `imageRatios`(如 `["1:1", "16:9", "9:16"]`),供影视工作台的图片节点列出可选项。每个模型各用自己的列表,按网关给的顺序和写法原样保留(`1.5K`、`3K` 不换算、不补全),只去掉非文字、空白和重复的项;没有声明、声明为空列表或格式不对时就不带这两个字段,不影响其余模型和整个列表。模型列表刷新后这两个字段随之更新,网关删掉的选项会消失。它们只是能力说明,不会出现在生成请求里:图片请求仍然只发送 `model`、`prompt`、`n`、`size`(像素宽高)和 `quality`。
|
|
157
|
+
|
|
156
158
|
## 开发
|
|
157
159
|
|
|
158
160
|
```bash
|
|
@@ -202,6 +204,8 @@ Everything is paid from your VibeDev balance; the DeepSeek account stays DeepSee
|
|
|
202
204
|
|
|
203
205
|
**New models without signing out (0.3.7)**: models the gateway publishes or withdraws now reach the picker on the next look at the account. Opening the balance card (resting the pointer on the sidebar's VibeDev row) or the account menu when the balance shown is more than 10 s old, Refresh on the card or in Settings → VibeDev Account, and opening that Settings page read the account with `?fresh=1`; the Host then reads the model catalog (`GET /v1/models`) again as well — at most once a minute and one read at a time, without making the balance wait. A list that changed republishes the picker's VibeDev group at once and reaches the "N models" line in Settings through the account route's long poll; a failed read keeps the list as it was. When nobody opens anything, the catalog is read as before: at start, on every sign-in, sign-out or account change, and every `catalogRefreshMinutes` (30 by default) — there is no other polling.
|
|
204
206
|
|
|
207
|
+
**Image sizes and ratios for the film workbench (0.3.8)**: an image model in the gateway catalog may declare its size tiers and aspect ratios (`capabilities.image_sizes`, such as `["1K", "1.5K", "2K", "4K"]`, and `capabilities.image_ratios`, such as `["1:1", "16:9", "9:16"]`); `vibedevMedia.models()` now hands them over on that model as `imageSizes` and `imageRatios`, for the image node's pickers. Each model keeps its own lists exactly as the gateway writes them, in its order — nothing is invented, converted or sorted (`1.5K` and `3K` stay as they are) — with entries that are not text, are blank or repeat an earlier one left out. A model that declares nothing, an empty list or a malformed one carries neither field, and nothing else in the catalog is affected. The lists follow the catalog through its cache and every refresh, so options the gateway drops disappear. They are capabilities, never request parameters: an image request still sends only `model`, `prompt`, `n`, `size` (pixels) and `quality`, and video models keep their own `ratios` and `resolutions`.
|
|
208
|
+
|
|
205
209
|
**Web search**: the plugin registers the web search provider `vibedev-gateway`, signed in with your VibeDev account. Registering does not select it: DeepSeek Harness keeps its own search unless the profile sets `searchProvider: vibedev-gateway` on the `web` row (the VibeDev app does). Searching is free, but the gateway refuses every request, searches included, while the balance is zero.
|
|
206
210
|
|
|
207
211
|
**Media tools**: `image_generate`, `video_generate` (runs as a background job), `audio_generate` (music, a podcast or speech), `audio_transcribe` (a multipart file upload; languages and limits as each model declares), `media_models`, `media_tasks` and `media_account`. Reference images, videos and audio, and first and last frames, can each be a workspace path, an http(s) link, or `chat:1` for the most recent matching file you attached. A request the model cannot serve is refused before anything is uploaded or charged.
|
|
@@ -216,7 +220,7 @@ Everything is paid from your VibeDev balance; the DeepSeek account stays DeepSee
|
|
|
216
220
|
|
|
217
221
|
**Privacy**: prompts and reference media are sent to the VibeDev gateway, which forwards them to the model provider. The plugin's own sign-in is kept in the DeepSeek Harness credential store, and task records under `dsh-media/` in the DeepSeek Harness data folder (the former name, kept so an upgrade loses nothing).
|
|
218
222
|
|
|
219
|
-
**For other plugins**: the `vibedevMedia` service generates images, videos and audio (`startAudio`: music, podcasts and speech) through the same model choice, reference checks, idempotent submission and background saving; the film workbench ([dsh-film](https://github.com/VibeDev-Si/dsh-film)) storyboard uses it. `audioForms()` describes the form of each audio model (only its declared fields, choices and limits, and its price). `videoQuote(request)` quotes a video request from the cached catalog alone (no upload, no submission): a video Token estimate with its rule and basis, a legacy estimate, or why there is none. Task views carry `settlement`, `settlementPendingReason`, `chargedCny` (only once settled, exactly as the gateway wrote it) and `billing.tokens`. Every task is read the same way: `task` (as recorded), `refreshTask` (ask the gateway again — fresh links, settlement; a query, never a submission), `onTask` (each change) and `result` (the files to play or download). Pass the same `operationId` when one click is retried: its task is returned and nothing is submitted twice.
|
|
223
|
+
**For other plugins**: the `vibedevMedia` service generates images, videos and audio (`startAudio`: music, podcasts and speech) through the same model choice, reference checks, idempotent submission and background saving; the film workbench ([dsh-film](https://github.com/VibeDev-Si/dsh-film)) storyboard uses it. `models()` lists the account's media models; an image model carries the size tiers and ratios it declares (`imageSizes`, `imageRatios`). `audioForms()` describes the form of each audio model (only its declared fields, choices and limits, and its price). `videoQuote(request)` quotes a video request from the cached catalog alone (no upload, no submission): a video Token estimate with its rule and basis, a legacy estimate, or why there is none. Task views carry `settlement`, `settlementPendingReason`, `chargedCny` (only once settled, exactly as the gateway wrote it) and `billing.tokens`. Every task is read the same way: `task` (as recorded), `refreshTask` (ask the gateway again — fresh links, settlement; a query, never a submission), `onTask` (each change) and `result` (the files to play or download). Pass the same `operationId` when one click is retried: its task is returned and nothing is submitted twice.
|
|
220
224
|
|
|
221
225
|
**Third-party code**: the model route in `src/llm/` is ported from the VibeDev app; `context.ts`, `replay.ts` and `stream.ts` are copied from DeepSeek Harness's `@deepseek-ai/dsh-llm-pi-ai` (MIT). The licences of the bundled pi-ai, Anthropic SDK, OpenAI SDK and their dependencies are in `THIRD-PARTY-NOTICES.txt`.
|
|
222
226
|
|
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
THIRD-PARTY NOTICES · @vibedev-si/dsh-vibedev 0.3.
|
|
1
|
+
THIRD-PARTY NOTICES · @vibedev-si/dsh-vibedev 0.3.8
|
|
2
2
|
|
|
3
3
|
This package bundles code from the projects below. Each is used under the licence that
|
|
4
4
|
follows its name; the licence texts are reproduced as the projects ship them.
|
package/lib/gateway/catalog.d.ts
CHANGED
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
* `billing_unit` and the declared limits (references, output formats and their
|
|
15
15
|
* sample rates). An audio model that declares no kind is listed but cannot be
|
|
16
16
|
* chosen for generation: neither its name nor its id decides what it makes.
|
|
17
|
+
*
|
|
18
|
+
* Image models may declare their size tiers and aspect ratios
|
|
19
|
+
* (`capabilities.image_sizes`, `capabilities.image_ratios`); they are read as
|
|
20
|
+
* `imageSizes` / `imageRatios` for the film workbench's pickers, exactly as
|
|
21
|
+
* listed, and are never sent in a request.
|
|
17
22
|
* @module dsh-vibedev/gateway/catalog
|
|
18
23
|
*/
|
|
19
24
|
/** What a media model produces. */
|
|
@@ -213,6 +218,14 @@ export interface MediaModel {
|
|
|
213
218
|
/** Endpoints the catalog lists for the model. */
|
|
214
219
|
readonly endpoints: readonly string[];
|
|
215
220
|
readonly inputModalities: readonly string[];
|
|
221
|
+
/**
|
|
222
|
+
* Image models: the size tiers (`1K`, `1.5K`, `2K`, `4K`, …) and the aspect ratios (`16:9`, …) the model declares
|
|
223
|
+
* (`capabilities.image_sizes` / `capabilities.image_ratios`), for the film workbench's pickers. Kept as the gateway
|
|
224
|
+
* lists them — its order, its spelling, nothing invented or converted — with non-text, blank and repeated entries
|
|
225
|
+
* left out; absent when not declared (or declared empty). Capability metadata only: never sent in a request.
|
|
226
|
+
*/
|
|
227
|
+
readonly imageSizes?: readonly string[];
|
|
228
|
+
readonly imageRatios?: readonly string[];
|
|
216
229
|
readonly pricing?: MediaPricing;
|
|
217
230
|
/** Video Token pricing (`video_pricing`); a model with it is never quoted from `pricing`. */
|
|
218
231
|
readonly videoPricing?: VideoTokenPricing;
|
package/lib/index.js
CHANGED
|
@@ -5275,6 +5275,24 @@ function durationList(value) {
|
|
|
5275
5275
|
return Array.isArray(value) && value.every((item) => positive(item) !== void 0) ? [...value] : void 0;
|
|
5276
5276
|
}
|
|
5277
5277
|
/**
|
|
5278
|
+
* A declared list of options (image size tiers, aspect ratios) as the gateway gives it: text entries with their
|
|
5279
|
+
* surrounding blanks trimmed, in the gateway's order, the first of any repeat kept. Entries that are not text or are
|
|
5280
|
+
* blank are left out; nothing is invented, converted, reordered or sorted (`1.5K` and `3K` stay as they are, and so
|
|
5281
|
+
* does their case). A value that is not a list, or a list with nothing usable in it, declares nothing.
|
|
5282
|
+
* @param value - the declared value.
|
|
5283
|
+
* @returns the options, or undefined when none are declared.
|
|
5284
|
+
*/
|
|
5285
|
+
function optionList(value) {
|
|
5286
|
+
if (!Array.isArray(value)) return void 0;
|
|
5287
|
+
const options = [];
|
|
5288
|
+
for (const item of value) {
|
|
5289
|
+
if (typeof item !== "string") continue;
|
|
5290
|
+
const option = item.trim();
|
|
5291
|
+
if (option !== "" && !options.includes(option)) options.push(option);
|
|
5292
|
+
}
|
|
5293
|
+
return options.length === 0 ? void 0 : options;
|
|
5294
|
+
}
|
|
5295
|
+
/**
|
|
5278
5296
|
* Parse the versioned modes block of a `video` capability block.
|
|
5279
5297
|
* @param raw - the `video` block.
|
|
5280
5298
|
* @returns the modes, an unreadable version, or nothing when the block declares no modes.
|
|
@@ -5779,6 +5797,8 @@ function parseMediaCatalog(body) {
|
|
|
5779
5797
|
...parseVideoCapabilities(capabilities),
|
|
5780
5798
|
...parseVideoCapabilities(record$3(entry.video) ?? {})
|
|
5781
5799
|
};
|
|
5800
|
+
const imageSizes = kind === "image" ? optionList(field(capabilities, "image_sizes")) : void 0;
|
|
5801
|
+
const imageRatios = kind === "image" ? optionList(field(capabilities, "image_ratios")) : void 0;
|
|
5782
5802
|
const audioKind = audio?.generationKind === void 0 || audio.generationKind === "transcription" ? void 0 : audio.generationKind;
|
|
5783
5803
|
models.push({
|
|
5784
5804
|
id,
|
|
@@ -5788,6 +5808,8 @@ function parseMediaCatalog(body) {
|
|
|
5788
5808
|
inputModalities,
|
|
5789
5809
|
...aliases.length === 0 ? {} : { aliases },
|
|
5790
5810
|
...description === void 0 ? {} : { description },
|
|
5811
|
+
...imageSizes === void 0 ? {} : { imageSizes },
|
|
5812
|
+
...imageRatios === void 0 ? {} : { imageRatios },
|
|
5791
5813
|
...pricing === void 0 ? {} : { pricing },
|
|
5792
5814
|
...videoPricing === void 0 ? {} : { videoPricing },
|
|
5793
5815
|
...videoPricingIssue === void 0 ? {} : { videoPricingIssue },
|
|
@@ -8830,6 +8852,8 @@ var MediaHostService = class {
|
|
|
8830
8852
|
}
|
|
8831
8853
|
/**
|
|
8832
8854
|
* The media models this account can use (cached briefly; renewed after a sign-in, sign-out or account switch).
|
|
8855
|
+
* An image model carries the size tiers and aspect ratios it declares (`imageSizes`, `imageRatios`) — options to
|
|
8856
|
+
* offer, exactly as the gateway lists them, absent when it declares none; they are never request parameters.
|
|
8833
8857
|
* @param signal - cancels the request.
|
|
8834
8858
|
* @returns the models in catalog order.
|
|
8835
8859
|
*/
|
package/lib/service.d.ts
CHANGED
|
@@ -80,6 +80,8 @@ export declare class MediaHostService {
|
|
|
80
80
|
private call;
|
|
81
81
|
/**
|
|
82
82
|
* The media models this account can use (cached briefly; renewed after a sign-in, sign-out or account switch).
|
|
83
|
+
* An image model carries the size tiers and aspect ratios it declares (`imageSizes`, `imageRatios`) — options to
|
|
84
|
+
* offer, exactly as the gateway lists them, absent when it declares none; they are never request parameters.
|
|
83
85
|
* @param signal - cancels the request.
|
|
84
86
|
* @returns the models in catalog order.
|
|
85
87
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibedev-si/dsh-vibedev",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "VibeDev 账号与模型:在 DeepSeek Harness 里登录 VibeDev,与 DeepSeek 账号并存,使用 VibeDev 网关的模型(Claude、GPT 等),并生成图片、视频、音乐和播客 · VibeDev account and models for DeepSeek Harness: sign in to VibeDev next to the DeepSeek account and use the VibeDev gateway's models (Claude, GPT and more), plus image, video, music and podcast generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|