@vibedev-si/dsh-vibedev 0.5.3 → 0.7.0
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 +46 -1
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/client/client.account-center.js +465 -5
- package/client/client.js +533 -30
- package/lib/announcements/routes.d.ts +70 -0
- package/lib/content/errors.d.ts +44 -0
- package/lib/content/service.d.ts +99 -0
- package/lib/contracts.d.ts +2 -2
- package/lib/gateway/http.d.ts +15 -3
- package/lib/index.d.ts +8 -0
- package/lib/index.js +711 -91
- package/lib/runtime.d.ts +2 -0
- package/lib/tools/image.d.ts +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
本插件由 `dsh-media` 改名而来,见下面的「从 dsh-media 升级」。
|
|
12
12
|
|
|
13
|
+
## 0.7.0 用户可见更新
|
|
14
|
+
|
|
15
|
+
账户中心新增「消息」页:VibeDev 的版本更新、服务调整和账号通知都发在这里。有未读时,侧栏账号头像右上角出现红点,账号菜单里的「消息」一行带上未读数。`popup` 类型的公告一次启动最多弹一次:「知道了」发出已读回执,「稍后」和「查看全部消息」只关掉弹窗、不标为已读,红点和未读数会留着。网关还没上线这两个读取接口时,这一块安静地不出现,其它功能不受影响。见[消息读取契约](docs/announcements-read-contract.md)。
|
|
16
|
+
|
|
17
|
+
生成图片默认不再进对话上下文:`image_generate` 只把保存路径交给模型,模型要看时用 `read_image` 读那张图,这时它才出现在对话里、也才计入那一次请求。以前每张生成的图都会跟着后面每一次请求发送;超过请求的图片上限后,宿主会把历史里最早的图片改写成占位文本——那是重写历史中段,整段对话的缓存随之失效,生成十张左右就会来一次。顺带请求体从可能的二十几兆降到几百字节,首字更快。需要每轮都发给模型时,打开设置里的「把生成的图片发给模型」;只是这一次要看,给 `image_generate` 传 `attach: true`。
|
|
18
|
+
|
|
19
|
+
## 0.6.0 用户可见更新
|
|
20
|
+
|
|
21
|
+
新增给其他插件用的宿主服务 `vibedevContent`:影视工作台用它读取创作库(目录、按内容哈希下载并核对哈希的文件、登录状态)。要等网关的创作库接口上线、影视工作台接上之后才生效,这一版本身没有用户能看到的变化;媒体工具、模型和账户页一个字节都不变。见下文「给其他插件用」。
|
|
22
|
+
|
|
13
23
|
## 0.5.3 用户可见更新
|
|
14
24
|
|
|
15
25
|
旧充值返利比例为 0 时,邀请返利页对旧充值模式的好友写明“旧充值返利已停止,目前不产生返利”,不再显示“按 0% 返利”;读不到比例时写明暂时无法读取,不再说按充值金额返利。
|
|
@@ -211,7 +221,7 @@
|
|
|
211
221
|
|
|
212
222
|
| 工具 | 用途 |
|
|
213
223
|
| --- | --- |
|
|
214
|
-
| `image_generate` |
|
|
224
|
+
| `image_generate` | 生成图片;带参考图时用来改图、换风格或把产品放进场景。结果只给保存路径,Agent 要看时用 `read_image` 读那张图。 |
|
|
215
225
|
| `video_generate` | 生成视频,在后台运行,一般 1 到 10 分钟。完成后会通知 Agent,文件保存在 `media/videos/`。 |
|
|
216
226
|
| `audio_generate` | 生成音乐(可以自带歌词)、一期播客(围绕一个话题或一个网页),或一段语音(朗读文字,可以用参考音频指定音色)。 |
|
|
217
227
|
| `audio_transcribe` | 把语音转成文字(以文件上传,语言和时长限制以模型声明为准,目前常见为普通话)。 |
|
|
@@ -219,6 +229,14 @@
|
|
|
219
229
|
| `media_tasks` | 查看进行中和已完成的视频、音频任务。 |
|
|
220
230
|
| `media_account` | 查看用的是哪个 VibeDev 账号;登录或退出(和侧边栏、设置里的登录是同一个)。 |
|
|
221
231
|
|
|
232
|
+
### 生成的图片与上下文
|
|
233
|
+
|
|
234
|
+
生成的图片保存在 `media/images/`(或设置里的保存目录),但**默认不进对话上下文**:工具结果只写回保存路径,模型要看的时候用 `read_image` 读那张图,这时图片才进入对话、也才计入这一次请求。同一张图重复读,附件按内容寻址不会重复存字节,但每次读都会在上下文里多出一个图片位置,所以看过就不必反复读。
|
|
235
|
+
|
|
236
|
+
这么做是为了缓存:一次请求里的图片有自己的张数和字节上限(默认 50 张、20 MiB),超过之后宿主会把历史里最早的图片改写成占位文本。那等于重写历史中段,后面整段对话的缓存都会失效——生成的图越多,这种整体重算越频繁。图片不进上下文,这条路就不会被触发。
|
|
237
|
+
|
|
238
|
+
确需每轮都发给模型时,在设置里打开「把生成的图片发给模型」,或给单次调用传 `attach: true`。
|
|
239
|
+
|
|
222
240
|
### 参考素材
|
|
223
241
|
|
|
224
242
|
参考图、参考视频、参考音频、首帧和尾帧可以用下面几种方式给出:
|
|
@@ -257,6 +275,7 @@
|
|
|
257
275
|
| 设置 | 默认值 | 说明 |
|
|
258
276
|
| --- | --- | --- |
|
|
259
277
|
| 每次付费生成前先询问 | 关 | 打开后,每次媒体生成前先确认费用。 |
|
|
278
|
+
| 把生成的图片发给模型 | 关 | 打开后每次生成都把图片发给模型;默认只给路径,由模型用 `read_image` 自己读。 |
|
|
260
279
|
| 保存目录 | `media` | 相对于工作区。 |
|
|
261
280
|
| Claude 提示词缓存保留时间 | 默认 | 可选默认、5分钟、1小时;保存后用于后续 Claude Messages 请求,默认不是关闭缓存。 |
|
|
262
281
|
| 默认生图 / 视频 / 音乐 / 播客 / 语音合成 / 转写模型 | 空 | 留空时由 Agent 按模型目录选择;可以填模型 id 或别名。 |
|
|
@@ -279,6 +298,22 @@
|
|
|
279
298
|
|
|
280
299
|
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`。
|
|
281
300
|
|
|
301
|
+
### 创作库:`vibedevContent`(0.6.0)
|
|
302
|
+
|
|
303
|
+
影视工作台读「创作库」也走账号插件,凭据一样不离开这里。影视工作台(dsh-film)在 `src/library/source.ts` 里用 `ctx.get('vibedevContent')` 找到它,和找 `vibedevMedia` 一模一样。服务名 `vibedevContent`,三个方法:
|
|
304
|
+
|
|
305
|
+
| 方法 | 参数 | 返回 |
|
|
306
|
+
| --- | --- | --- |
|
|
307
|
+
| `account()` | 无 | 与 `vibedevMedia.account()` 同一个形状:`{ gatewayOrigin, signedIn, userId?, revision? }` |
|
|
308
|
+
| `catalog(request)` | `{ etag?, signal? }`:上次拿到的 `etag`;取消这次读取的 `AbortSignal` | `{ notModified: true }`(内容没变),或 `{ notModified: false, etag, body }`(`body` 是解析好的目录 JSON) |
|
|
309
|
+
| `file(request)` | `{ sha256, extension, signal? }`:目录登记的内容哈希(64 位十六进制),以及带点或不带点的扩展名 | `Uint8Array`:已经核对过哈希的文件字节 |
|
|
310
|
+
|
|
311
|
+
`catalog()` 走 `GET /v1/film-library/catalog`,传 `etag` 时带 `If-None-Match`,网关回 304 就只回 `notModified`;`file()` 走 `GET /v1/film-library/blobs/{sha256}{扩展名}`。
|
|
312
|
+
|
|
313
|
+
`extension` 写 `.webp` 或 `webp` 都行,只接受 `.zip`、`.webp`、`.mp3`、`.ogg`、`.wav`;单个文件上限 8 MB(网关自己限 5 MB)。网关用一次 3xx 跳转给出临时下载地址时,由插件自己跟这一次跳转(301、302、303、307、308 都认,再跳一次就算拒绝):跳转那一跳不带凭据;那一跳除了 429 之外收到任何 4xx,一律当作「网关给出的下载地址被拒绝,请稍后重试。」(`GATEWAY_BAD_RESPONSE`,可重试)——不带凭据的请求被拒,既不是这个用户的登录问题,也不是文件真的没了;429 仍按限流处理,5xx 和连不上仍按网关故障处理。
|
|
314
|
+
|
|
315
|
+
失败抛 `ContentError`,`code` 和 `status` 都在错误对象顶层(宿主的调用方只读这两个):`NOT_SIGNED_IN`(`status: 401`)、`NOT_FOUND`(404)、`RATE_LIMITED`(429,带 `retryAfterMs`)、`REFUSED`(其余 4xx)、`GATEWAY_ERROR`(5xx)、`GATEWAY_BAD_RESPONSE`、`NETWORK_ERROR`、`INVALID_REQUEST`、`BLOB_TOO_LARGE`、`HASH_MISMATCH`、`ABORTED`。`status` 只在网关确实对这次请求答复了 HTTP 状态时带上:标了状态码的那几类一定带;`GATEWAY_BAD_RESPONSE` 和 `BLOB_TOO_LARGE` 有时带(下载地址被拒绝的那一类不带,所以它不会被当成「需要登录」或「没有这个文件」);`NETWORK_ERROR`、`INVALID_REQUEST`、`HASH_MISMATCH`、`ABORTED` 不带。每条错误的 `message` 都是一句可以直接给用户看的中文,细节留在 `cause` 里。
|
|
316
|
+
|
|
282
317
|
## 开发
|
|
283
318
|
|
|
284
319
|
```bash
|
|
@@ -299,6 +334,16 @@ npm run build
|
|
|
299
334
|
|
|
300
335
|
## English
|
|
301
336
|
|
|
337
|
+
### What changes in 0.7.0
|
|
338
|
+
|
|
339
|
+
The account center gains a Messages page for VibeDev's version updates, service changes and account notices. While something is unread, the sidebar avatar carries a red dot and the account menu's Messages row shows the count. A `popup` announcement interrupts at most once per launch: Got it sends the read receipt, while Later and See all messages only close it and mark nothing read, so the dot and the count stay. Until the gateway serves these reads the whole thing stays quiet. See the [messages read contract](docs/announcements-read-contract.md).
|
|
340
|
+
|
|
341
|
+
Generated images stay out of the conversation by default: `image_generate` returns the saved paths, and the model reads a picture with `read_image` when it needs to look, at which point it appears in the conversation and counts for that one request. Before, every generated picture rode along with every later request; once a request passed the host's image limits it rewrote the oldest images into placeholders, which rewrote the middle of the history and invalidated the whole prompt cache, roughly every ten images. The request body also drops from as much as some twenty megabytes to a few hundred bytes, so the first token comes sooner. To send every picture to the model, turn on "Send generated images to the model" in Settings; for a single call, pass `attach: true`.
|
|
342
|
+
|
|
343
|
+
### What changes in 0.6.0
|
|
344
|
+
|
|
345
|
+
A new host service for other plugins, `vibedevContent`: the film workbench uses it to read the creative library (its catalog, files downloaded by content hash and checked against that hash, and the signed-in state). It takes effect only once the gateway's creative-library endpoints are live and the film workbench is wired to it — this version alone changes nothing a user can see, and the media tools, models and account pages are untouched. See "给其他插件用 / for other plugins" below.
|
|
346
|
+
|
|
302
347
|
### What changes in 0.5.3
|
|
303
348
|
|
|
304
349
|
When the old top-up rate is 0, the affiliate page says old top-up rebates have stopped and nothing is earned now for invitees on the old top-up rule, instead of showing a 0% rate. When the rate cannot be read, it says so instead of describing top-up rebates.
|
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
THIRD-PARTY NOTICES · @vibedev-si/dsh-vibedev 0.
|
|
1
|
+
THIRD-PARTY NOTICES · @vibedev-si/dsh-vibedev 0.7.0
|
|
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.
|