@vibedev-si/dsh-vibedev 0.3.6 → 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 +9 -2
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/lib/account/index.d.ts +20 -3
- package/lib/gateway/catalog.d.ts +13 -0
- package/lib/index.d.ts +4 -1
- package/lib/index.js +60 -5
- package/lib/llm/index.d.ts +6 -2
- package/lib/service.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
- 没登录就用了 VibeDev 的模型,或登录已失效时,对话里会提示到侧边栏或设置里登录;余额不足时会提示并给出充值链接。这些提示和 DeepSeek 账号的登录、充值提示是分开的。
|
|
79
79
|
- 访问令牌过期时插件会自动续期并重发请求,不会重复输出。
|
|
80
80
|
- 网关到上游模型服务的连接中途断开(例如 `upstream_http2_stream_error`、上游响应流被中断)属于可恢复的传输故障,会和超时、5xx、限流一样按退避自动重试,不再直接判定成一次不可重试的失败;重试会重新发起该次请求,已经输出的内容不会续写。
|
|
81
|
+
- 0.3.7 起,网关新上架或下架的模型不用退出重新登录就能看到:指针停在侧边栏的 VibeDev 账号行上打开余额卡片、打开账号菜单(显示的余额超过 10 秒时),以及点「刷新」或打开「设置 → VibeDev 账号」时,插件在重新读取余额的同时也重新读取模型列表,最多每分钟一次;余额照常立刻显示,不等模型列表。模型有变化时,选择器里的「VibeDev」组和设置页的「N 个模型」随即更新。没人操作时,仍按原来的方式在启动、登录或切换账号时以及每 30 分钟(`catalogRefreshMinutes`)读取一次,不会定时轮询。
|
|
81
82
|
|
|
82
83
|
## 网页搜索
|
|
83
84
|
|
|
@@ -136,7 +137,7 @@
|
|
|
136
137
|
| 保存目录 | `media` | 相对于工作区。 |
|
|
137
138
|
| 默认生图 / 视频 / 音乐 / 播客 / 语音合成 / 转写模型 | 空 | 留空时由 Agent 按模型目录选择;可以填模型 id 或别名。 |
|
|
138
139
|
|
|
139
|
-
另有几项只能在配置文件(`cordis.patch.yml` 中 `dsh-vibedev` 一行)里改:`displayName`(模型选择器里显示的组名,默认 `VibeDev`)、`preferredModels`(排在最前的 VibeDev 模型)、`openBrowserOnSignIn`(登录时是否自动打开系统浏览器,默认开)、`catalogRefreshMinutes
|
|
140
|
+
另有几项只能在配置文件(`cordis.patch.yml` 中 `dsh-vibedev` 一行)里改:`displayName`(模型选择器里显示的组名,默认 `VibeDev`)、`preferredModels`(排在最前的 VibeDev 模型)、`openBrowserOnSignIn`(登录时是否自动打开系统浏览器,默认开)、`catalogRefreshMinutes`(模型目录定时刷新间隔,默认 30 分钟;是没人打开余额卡片、账号菜单或设置时的兜底)、`client`(登录时报给网关的客户端名称,默认 `vibedev-plugin`)、`primary`(作为应用的主账号显示,默认关,VibeDev 应用里开)。
|
|
140
141
|
|
|
141
142
|
## 从 dsh-media 升级
|
|
142
143
|
|
|
@@ -152,6 +153,8 @@
|
|
|
152
153
|
|
|
153
154
|
插件注册了一个 `vibedevMedia` 服务,其他插件可以用它生成图片和视频,走的是同一套模型选择、参考素材检查、幂等提交和后台保存。影视工作台([dsh-film](https://github.com/VibeDev-Si/dsh-film))的分镜画布就是通过它生成的。调用方已经向用户显示过价格,所以不会再触发「每次付费生成前先询问」。
|
|
154
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
|
+
|
|
155
158
|
## 开发
|
|
156
159
|
|
|
157
160
|
```bash
|
|
@@ -199,6 +202,10 @@ Everything is paid from your VibeDev balance; the DeepSeek account stays DeepSee
|
|
|
199
202
|
|
|
200
203
|
**Models**: the list comes from the VibeDev gateway for your account, so nothing is listed before you sign in; models appear right after, without a restart. Using a VibeDev model while signed out, or after the sign-in has ended, asks you to sign in; a used-up balance says so with the top-up link. These messages are separate from the DeepSeek account's. An expired access token is renewed and the request sent again, without repeating any output.
|
|
201
204
|
|
|
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.
|
|
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
|
+
|
|
202
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.
|
|
203
210
|
|
|
204
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.
|
|
@@ -213,7 +220,7 @@ Everything is paid from your VibeDev balance; the DeepSeek account stays DeepSee
|
|
|
213
220
|
|
|
214
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).
|
|
215
222
|
|
|
216
|
-
**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.
|
|
217
224
|
|
|
218
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`.
|
|
219
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/account/index.d.ts
CHANGED
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
* when it was read, a sign-in waiting for the browser, and how many VibeDev
|
|
10
10
|
* models the pickers list; `?fresh=1` reads the balance again (a read that
|
|
11
11
|
* fails keeps the last balance, says when it was read, and says the read
|
|
12
|
-
* failed)
|
|
13
|
-
*
|
|
12
|
+
* failed) and, at most once a minute, the model catalog too (without waiting
|
|
13
|
+
* for it: a list that changed reaches the pages through the long poll);
|
|
14
|
+
* `?since=<revision>` holds the request until the person, the balance or the
|
|
15
|
+
* model list changes (a charge is read again right after it ends), so the pages
|
|
14
16
|
* show a new balance within seconds instead of on their next minute poll;
|
|
15
17
|
* - `POST /api/dsh-vibedev/account/sign-in` — `{ open?: boolean }`: start the
|
|
16
18
|
* plugin's own sign-in; answers the authorization link (`open: false` leaves
|
|
@@ -102,6 +104,11 @@ export interface AccountServiceOptions {
|
|
|
102
104
|
count: number;
|
|
103
105
|
hidden?: 'signed-out' | 'host-account';
|
|
104
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Read the route's model catalog again (the route's `refresh()`; it republishes a changed list to the pickers).
|
|
109
|
+
* Started without waiting by an explicit read of the account, at most once a minute.
|
|
110
|
+
*/
|
|
111
|
+
readonly refreshCatalog?: () => Promise<void>;
|
|
105
112
|
/** Present the VibeDev account as the app's main account. */
|
|
106
113
|
readonly primary?: boolean;
|
|
107
114
|
readonly fetch?: typeof globalThis.fetch;
|
|
@@ -130,6 +137,9 @@ export declare class AccountService {
|
|
|
130
137
|
private lastGood;
|
|
131
138
|
/** The latest read failed, after the last one that succeeded. */
|
|
132
139
|
private failure;
|
|
140
|
+
/** When the last catalog read an explicit read started began, and that read while it runs. */
|
|
141
|
+
private catalogReadAt;
|
|
142
|
+
private catalogRead;
|
|
133
143
|
/**
|
|
134
144
|
* @param options - origin, credential chain, the plugin's sign-in and the route's model state.
|
|
135
145
|
*/
|
|
@@ -157,9 +167,16 @@ export declare class AccountService {
|
|
|
157
167
|
wait(since: number, signal?: AbortSignal): Promise<void>;
|
|
158
168
|
/** Links to the gateway's pages. */
|
|
159
169
|
links(): AccountView['links'];
|
|
170
|
+
/**
|
|
171
|
+
* Read the model catalog again, without waiting for it: at most one read a minute and one at a time. A read that
|
|
172
|
+
* changed the list (a model the gateway published or withdrew) is told to the pages at once, through the long
|
|
173
|
+
* poll; one that changed nothing, or failed, tells them nothing.
|
|
174
|
+
*/
|
|
175
|
+
private refreshModels;
|
|
160
176
|
/**
|
|
161
177
|
* The account as it stands.
|
|
162
|
-
* @param fresh - read the balance again instead of reusing a recent read
|
|
178
|
+
* @param fresh - read the balance again instead of reusing a recent read, and the model catalog with it (at most
|
|
179
|
+
* once a minute; the answer does not wait for it).
|
|
163
180
|
* @returns the view.
|
|
164
181
|
*/
|
|
165
182
|
view(fresh?: boolean): Promise<AccountView>;
|
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.d.ts
CHANGED
|
@@ -49,7 +49,10 @@ export interface Config {
|
|
|
49
49
|
preferredModels: string[];
|
|
50
50
|
/** Open the system browser when a sign-in starts (off: the page opens the link itself). */
|
|
51
51
|
openBrowserOnSignIn: boolean;
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Minutes between catalog reads while the app runs: the fallback that keeps the pickers current when nobody opens
|
|
54
|
+
* the balance card, the account menu or Settings (each of those reads the catalog too, at most once a minute).
|
|
55
|
+
*/
|
|
53
56
|
catalogRefreshMinutes: number;
|
|
54
57
|
/** Ask the user before each paid request. */
|
|
55
58
|
confirmSpending: Volatile<boolean>;
|
package/lib/index.js
CHANGED
|
@@ -41,6 +41,13 @@ const WAIT_MS = 8e3;
|
|
|
41
41
|
const SETTLE_READS_MS = [1500, 8e3];
|
|
42
42
|
/** Reads after charges are at least this far apart. */
|
|
43
43
|
const MIN_READ_SPACING_MS = 5e3;
|
|
44
|
+
/**
|
|
45
|
+
* An explicit read of the account (`?fresh=1`: the balance card opening on a balance older than 10 s, the account
|
|
46
|
+
* menu, 刷新, Settings opening) also reads the model catalog again, at most once in this long. The route's own reads
|
|
47
|
+
* (at start, on a sign-in change, every `catalogRefreshMinutes`) are untouched: they are what keeps the pickers
|
|
48
|
+
* current when nobody opens anything.
|
|
49
|
+
*/
|
|
50
|
+
const CATALOG_REFRESH_GAP_MS = 6e4;
|
|
44
51
|
const record$9 = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
45
52
|
const text$8 = (value) => typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
46
53
|
/**
|
|
@@ -82,6 +89,9 @@ var AccountService = class {
|
|
|
82
89
|
lastGood;
|
|
83
90
|
/** The latest read failed, after the last one that succeeded. */
|
|
84
91
|
failure;
|
|
92
|
+
/** When the last catalog read an explicit read started began, and that read while it runs. */
|
|
93
|
+
catalogReadAt = Number.NEGATIVE_INFINITY;
|
|
94
|
+
catalogRead;
|
|
85
95
|
/**
|
|
86
96
|
* @param options - origin, credential chain, the plugin's sign-in and the route's model state.
|
|
87
97
|
*/
|
|
@@ -168,18 +178,36 @@ var AccountService = class {
|
|
|
168
178
|
};
|
|
169
179
|
}
|
|
170
180
|
/**
|
|
181
|
+
* Read the model catalog again, without waiting for it: at most one read a minute and one at a time. A read that
|
|
182
|
+
* changed the list (a model the gateway published or withdrew) is told to the pages at once, through the long
|
|
183
|
+
* poll; one that changed nothing, or failed, tells them nothing.
|
|
184
|
+
*/
|
|
185
|
+
refreshModels() {
|
|
186
|
+
const refresh = this.options.refreshCatalog;
|
|
187
|
+
if (refresh === void 0 || this.catalogRead !== void 0 || this.now() - this.catalogReadAt < CATALOG_REFRESH_GAP_MS) return;
|
|
188
|
+
this.catalogReadAt = this.now();
|
|
189
|
+
const before = JSON.stringify(this.options.models());
|
|
190
|
+
const read = Promise.resolve().then(() => refresh()).then(() => {
|
|
191
|
+
if (JSON.stringify(this.options.models()) !== before) this.changed();
|
|
192
|
+
}, () => void 0).finally(() => {
|
|
193
|
+
if (this.catalogRead === read) this.catalogRead = void 0;
|
|
194
|
+
});
|
|
195
|
+
this.catalogRead = read;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
171
198
|
* The account as it stands.
|
|
172
|
-
* @param fresh - read the balance again instead of reusing a recent read
|
|
199
|
+
* @param fresh - read the balance again instead of reusing a recent read, and the model catalog with it (at most
|
|
200
|
+
* once a minute; the answer does not wait for it).
|
|
173
201
|
* @returns the view.
|
|
174
202
|
*/
|
|
175
203
|
async view(fresh = false) {
|
|
176
204
|
const credential = await this.options.chain.resolve().catch(() => void 0);
|
|
205
|
+
if (fresh && credential !== void 0) this.refreshModels();
|
|
177
206
|
const source = credential === void 0 ? "none" : credential.kind === "account" ? "host" : credential.kind;
|
|
178
207
|
const pending = this.options.login.pendingSignIn();
|
|
179
208
|
const attempt = this.options.login.signInAttempt();
|
|
180
209
|
const base = {
|
|
181
210
|
source,
|
|
182
|
-
models: this.options.models(),
|
|
183
211
|
links: this.links(),
|
|
184
212
|
primary: this.options.primary === true,
|
|
185
213
|
...pending === void 0 ? {} : { pending },
|
|
@@ -187,6 +215,7 @@ var AccountService = class {
|
|
|
187
215
|
};
|
|
188
216
|
if (credential === void 0) return {
|
|
189
217
|
...base,
|
|
218
|
+
models: this.options.models(),
|
|
190
219
|
revision: this.revision
|
|
191
220
|
};
|
|
192
221
|
const [grantUser, read] = await Promise.all([credential.kind === "plugin" ? this.options.login.user().catch(() => void 0) : Promise.resolve(void 0), this.me(credential.token, fresh)]);
|
|
@@ -196,6 +225,7 @@ var AccountService = class {
|
|
|
196
225
|
const failedAt = this.failure?.token === credential.token ? this.failure.at : void 0;
|
|
197
226
|
return {
|
|
198
227
|
...base,
|
|
228
|
+
models: this.options.models(),
|
|
199
229
|
...user === void 0 ? {} : { user },
|
|
200
230
|
...me.balance === void 0 ? {} : { balance: me.balance },
|
|
201
231
|
...me.readAt === void 0 ? {} : { readAt: me.readAt },
|
|
@@ -5245,6 +5275,24 @@ function durationList(value) {
|
|
|
5245
5275
|
return Array.isArray(value) && value.every((item) => positive(item) !== void 0) ? [...value] : void 0;
|
|
5246
5276
|
}
|
|
5247
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
|
+
/**
|
|
5248
5296
|
* Parse the versioned modes block of a `video` capability block.
|
|
5249
5297
|
* @param raw - the `video` block.
|
|
5250
5298
|
* @returns the modes, an unreadable version, or nothing when the block declares no modes.
|
|
@@ -5749,6 +5797,8 @@ function parseMediaCatalog(body) {
|
|
|
5749
5797
|
...parseVideoCapabilities(capabilities),
|
|
5750
5798
|
...parseVideoCapabilities(record$3(entry.video) ?? {})
|
|
5751
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;
|
|
5752
5802
|
const audioKind = audio?.generationKind === void 0 || audio.generationKind === "transcription" ? void 0 : audio.generationKind;
|
|
5753
5803
|
models.push({
|
|
5754
5804
|
id,
|
|
@@ -5758,6 +5808,8 @@ function parseMediaCatalog(body) {
|
|
|
5758
5808
|
inputModalities,
|
|
5759
5809
|
...aliases.length === 0 ? {} : { aliases },
|
|
5760
5810
|
...description === void 0 ? {} : { description },
|
|
5811
|
+
...imageSizes === void 0 ? {} : { imageSizes },
|
|
5812
|
+
...imageRatios === void 0 ? {} : { imageRatios },
|
|
5761
5813
|
...pricing === void 0 ? {} : { pricing },
|
|
5762
5814
|
...videoPricing === void 0 ? {} : { videoPricing },
|
|
5763
5815
|
...videoPricingIssue === void 0 ? {} : { videoPricingIssue },
|
|
@@ -8800,6 +8852,8 @@ var MediaHostService = class {
|
|
|
8800
8852
|
}
|
|
8801
8853
|
/**
|
|
8802
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.
|
|
8803
8857
|
* @param signal - cancels the request.
|
|
8804
8858
|
* @returns the models in catalog order.
|
|
8805
8859
|
*/
|
|
@@ -10846,7 +10900,7 @@ const Config = Schema.object({
|
|
|
10846
10900
|
displayName: "模型选择器里显示的名称",
|
|
10847
10901
|
preferredModels: "排在最前的 VibeDev 模型(按顺序,留空按网关顺序)",
|
|
10848
10902
|
openBrowserOnSignIn: "登录时自动打开系统浏览器",
|
|
10849
|
-
catalogRefreshMinutes: "
|
|
10903
|
+
catalogRefreshMinutes: "模型目录定时刷新间隔(分钟;没人打开余额卡片、账号菜单或设置时的兜底)",
|
|
10850
10904
|
confirmSpending: "每次付费生成前先询问(默认关闭)",
|
|
10851
10905
|
outputDir: "保存目录(相对于工作区)",
|
|
10852
10906
|
imageModel: "默认生图模型(留空由 Agent 按目录选择)",
|
|
@@ -10865,7 +10919,7 @@ const Config = Schema.object({
|
|
|
10865
10919
|
displayName: "Name the model pickers show",
|
|
10866
10920
|
preferredModels: "VibeDev models listed first, in this order (empty: the gateway's order)",
|
|
10867
10921
|
openBrowserOnSignIn: "Open the system browser when signing in",
|
|
10868
|
-
catalogRefreshMinutes: "Model catalog refresh interval (
|
|
10922
|
+
catalogRefreshMinutes: "Model catalog refresh interval in minutes (the fallback when nobody opens the balance card, the account menu or Settings)",
|
|
10869
10923
|
confirmSpending: "Ask before each paid generation (off by default)",
|
|
10870
10924
|
outputDir: "Output folder (relative to the workspace)",
|
|
10871
10925
|
imageModel: "Default image model (empty: the agent chooses from the catalog)",
|
|
@@ -11012,7 +11066,8 @@ function apply(ctx, config) {
|
|
|
11012
11066
|
models: () => ({
|
|
11013
11067
|
count: route?.models().length ?? 0,
|
|
11014
11068
|
...route?.hidden() === void 0 ? {} : { hidden: route.hidden() }
|
|
11015
|
-
})
|
|
11069
|
+
}),
|
|
11070
|
+
refreshCatalog: () => route?.refresh() ?? Promise.resolve()
|
|
11016
11071
|
});
|
|
11017
11072
|
account = accountService;
|
|
11018
11073
|
const latency = new LatencyProbe({
|
package/lib/llm/index.d.ts
CHANGED
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
* The catalog comes from the gateway (`GET /v1/models`) with the credential
|
|
7
7
|
* requests use, so nothing is listed before a sign-in: the catalog is per
|
|
8
8
|
* account. It is read at start, on every sign-in, sign-out or account change,
|
|
9
|
-
* and every `catalogRefreshMinutes
|
|
10
|
-
*
|
|
9
|
+
* and every `catalogRefreshMinutes` (30 by default) — what keeps the pickers
|
|
10
|
+
* current when nobody opens anything — and, at most once a minute, when an
|
|
11
|
+
* account page reads the account fresh (the balance card or the account menu
|
|
12
|
+
* opening on a balance older than 10 s, 刷新, Settings opening; see
|
|
13
|
+
* account/index.ts). A changed catalog republishes the route so pickers update
|
|
14
|
+
* without a restart.
|
|
11
15
|
*
|
|
12
16
|
* Inside the VibeDev app the host account already serves these models on the
|
|
13
17
|
* app's own account channel; when the credential comes from the host account
|
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",
|