dsh-edge 0.30.0 → 0.31.0-alpha.1
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.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/THIRD_PARTY_NOTICES.md +36 -36
- package/package.json +2 -2
- package/scripts/verify-packed.mjs +1 -1
- package/worker/direct/index.js +1146 -1129
- package/worker/isolated/index.js +17386 -17351
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# last confirmed-consistent state. Both languages carry equal authority.
|
|
3
3
|
# After editing either side, update both and re-record every pair with:
|
|
4
4
|
# pnpm run doc-pairs -- --write
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: eff3f86f1ae2447ab25e6fac213795044b7c6fe9
|
|
6
|
+
README.zh.md: a5d1544d578b0bccb304ae6573aa81f5a7228da3
|
package/README.md
CHANGED
|
@@ -340,7 +340,7 @@ pnpm --filter dsh-edge example:install
|
|
|
340
340
|
- `GET /api/ready` requires the owner cookie and waits for session migration, workspace registration, the browser's session/workspace controllers, and registration of the DeepSeek model adapter. It does not make a provider request. It returns HTTP 503 with `runtime-initialization-failed` if startup fails; public health alone does not prove runtime readiness. Ordinary authenticated routes wait for base initialization without requiring the model adapter, preserving history and recovery access when only model initialization failed.
|
|
341
341
|
- Health does not call the provider, Durable Object, R2, VFS, or shell. The authenticated agent-preset projection reports the pinned backend, temporary cap, deployment-default model, and runtime-derived upstream catalog with session selection scope.
|
|
342
342
|
|
|
343
|
-
Release upgrades automatically normalize the known legacy Edge cancellation records and migrate all outdated session logs, summaries, and blank headers in one SQLite transaction. All old logs are decoded and validated before the first migration write, so incompatible later logs cannot repeatedly consume earlier migration writes on restart. Preflight discards each decoded artifact; migration decodes again in the same synchronous transaction to avoid retaining every history in memory. If any session is incompatible or a write fails, that startup migration is rolled back in full.
|
|
343
|
+
Release upgrades automatically normalize the known legacy Edge cancellation records and migrate all outdated session logs, summaries, and blank headers in one SQLite transaction. All old logs are decoded and validated before the first migration write, so incompatible later logs cannot repeatedly consume earlier migration writes on restart. Preflight discards each decoded artifact; migration decodes again in the same synchronous transaction to avoid retaining every history in memory. If any session is incompatible or a write fails, that startup migration is rolled back in full. Upstream's format restore converts a log in one pass, holding about four times its stored event data in memory, so a legacy session with more than 8 MiB of events is left as stored (with a warning in the Worker log) instead of failing every start; the instance starts, and the Edge treats that session as absent: it is left out of the session list, and reads by id (history, summary, `GET /api/sessions/:sessionId`) answer that it does not exist (#371). Its stored header and events are kept unchanged in the Durable Object; no session is deleted. This transaction covers session-format migration, not arbitrary plugin storage changes or external side effects. The installer matches the Cloudflare Worker version ID from upload output against both public health and authenticated readiness, so an earlier deployment of the same package cannot satisfy the check. The version metadata binding is included in both modes. The installer checks runtime readiness before reporting success; a timeout is reported as unverified, and a confirmed startup failure reports an error with recovery details. It never automatically rolls back Worker code after a schema upgrade. Release tests boot both prebuilt modes with legacy cancellation data, verify continuation, and reject false readiness on incompatible data; the packed npm artifact is also checked for authenticated runtime readiness.
|
|
344
344
|
|
|
345
345
|
SQLite `DELETE` operations consume the daily row-write allowance too. During format migration, Edge compares the number of legacy and current event rows: a single index-backed probe stops once copying current rows would cost more; when copying is cheaper, it writes the migrated compact logs into a replacement table and swaps tables inside the same transaction, avoiding a billed delete for every legacy token delta. Otherwise it replaces only the affected sessions. Current session logs are preserved, and failed migrations roll back the table swap. This reduces migration writes but cannot guarantee that every database fits the Free plan's 100,000 daily row-write allowance; sufficiently large upgrades or earlier daily usage can still exhaust it. Point-in-time recovery restores data, not the account's consumed daily quota.
|
|
346
346
|
|
|
@@ -380,7 +380,7 @@ SQLite `DELETE` operations consume the daily row-write allowance too. During for
|
|
|
380
380
|
- Request bodies are consumed incrementally. Once a route limit is crossed, later chunks are drained without being retained and the route returns 413. File uploads also reject malformed UTF-8.
|
|
381
381
|
- File reads check VFS metadata, then collect the opened byte stream through the same 1 MiB cap. This closes the growth race between `stat()` and `readFile()` without retaining an unbounded value.
|
|
382
382
|
- Image admission fully decodes the declared raster format before writing.
|
|
383
|
-
- As upstream `bash-local`, a command keeps running past the output cap: each stream keeps its last 64,000 bytes inline by default (the Shell card's output cap, 1 KiB to 1 MiB), and the whole stream is saved to `/workspace/.spill/bash-<execution>.<stream>.txt` (deleted with the other spills after 30 days), up to 16 MiB per stream (upstream allows 64 MiB; each 512 KiB costs about five Durable Object rows written, and the
|
|
383
|
+
- As upstream `bash-local`, a command keeps running past the output cap: each stream keeps its last 64,000 bytes inline by default (the Shell card's output cap, 1 KiB to 1 MiB), and the whole stream is saved to `/workspace/.spill/bash-<execution>.<stream>.txt` (deleted with the other spills after 30 days), up to 16 MiB per stream (upstream allows 64 MiB; each 512 KiB costs about five Durable Object rows written, and a deleted file's bytes are freed by the daily sweep once its content has gone unused for a day, #358), past which the file keeps its start and the result says so. Memory stays at the tail plus a 1 MiB write queue per stream: reading the command's output waits while the spill is written. Output under the cap writes nothing. The lightweight shell (just-bash) returns a command's output whole instead of streaming it, so it still stops a command whose output passes 8 MiB (exit 126, reported as `[stopped: …]`); that buffer lives in its isolate, the Durable Object in Direct mode. The bash tool renders upstream's layout: stdout, a `[stderr]` section, `[output truncated; full output: <path>]` per stream, `[timed out after Nms]`, and `[exit code: N]` last, and its terminal card shows the working directory. In the Linux Container, a command finishes once both its output pipes have closed, or 250 ms after its shell exits when a background job started with `&` still holds them; output that job writes afterwards is dropped, and the container keeps running (computerd 0.7.0, #373). A `timeoutMs` above the deployment ceiling is lowered to it, as upstream clamps it; the HTTP exec route still refuses one. `cancelled` reflects an adapter-requested interruption; `timedOut` independently records deadline expiry.
|
|
384
384
|
|
|
385
385
|
### Durability and concurrency
|
|
386
386
|
|
package/README.zh.md
CHANGED
|
@@ -340,7 +340,7 @@ pnpm --filter dsh-edge example:install
|
|
|
340
340
|
- `GET /api/ready` 要求 owner cookie,等待会话迁移、工作区注册、浏览器所需的会话/工作区控制器就绪,以及 DeepSeek 模型适配器完成注册。此检查不会向模型服务发起请求。启动失败时返回 HTTP 503 和 `runtime-initialization-failed`;公开 health 响应不能单独证明运行时可用。普通认证路由只等待基础初始化,不要求模型适配器可用;仅模型初始化失败时,仍保留历史记录和恢复访问。
|
|
341
341
|
- Health 不调用 provider、Durable Object、R2、VFS 或 shell。认证后的 agent-preset projection 会报告固定 backend、临时存储上限、部署默认模型,以及 runtime 实际读取的上游 catalog 与 session 选择范围。
|
|
342
342
|
|
|
343
|
-
Release 升级会自动兼容已知的旧版 Edge 取消记录,并在一个 SQLite
|
|
343
|
+
Release 升级会自动兼容已知的旧版 Edge 取消记录,并在一个 SQLite 事务中迁移所有旧格式会话日志、摘要和空会话头。首次迁移写入前会解码并校验所有旧日志,避免后面的不兼容日志导致每次重启都重复消耗前面会话的迁移写入。预检会释放每份解码结果;迁移阶段在同一同步事务内再次解码,避免把所有历史同时保留在内存中。任一会话不兼容或写入失败时,本次启动的迁移会整体回滚。上游的格式还原一次转换整份日志,内存占用约为事件数据的四倍,因此事件数据超过 8 MiB 的旧格式会话会保持原样(Worker 日志中记录警告),而不是让每次启动都失败;实例照常启动,Edge 把该会话视为不存在:它不出现在会话列表中,按 id 读取(历史、摘要、`GET /api/sessions/:sessionId`)也会回答不存在(#371)。它的会话头和事件原样保留在 Durable Object 中,不会删除任何会话。此事务覆盖会话格式迁移,不涵盖任意插件存储改动或外部副作用。安装器会把上传输出中的 Cloudflare Worker 版本 ID 与公开 health 和经过认证的就绪响应分别比对,同一软件包的旧部署不能满足该检查;两种模式都包含版本元数据绑定。安装器检查运行时就绪状态,通过后才报告成功;超时会报告尚未验证,确认启动失败则报告错误和恢复信息。它不会在存储格式升级后自动回滚 Worker 代码。发布测试使用含旧取消记录的数据启动两种预构建模式,验证继续聊天,并确认不兼容数据不会误报就绪;打包后的 npm 产物也会验证经过认证的运行时就绪状态。
|
|
344
344
|
|
|
345
345
|
SQLite 的 `DELETE` 操作也会消耗每日行写入额度。迁移格式时,Edge 会比较旧格式与当前格式的事件行数:单条利用索引的探测查询在确认复制成本更高时即停止;如果复制当前事件的成本更低,就把迁移后的压缩日志写入替代表,并在同一事务内交换表,避免为每个旧 token 片段支付逐行删除费用;否则只替换需要迁移的会话。已有当前格式日志会保留,迁移失败也会回滚表交换。这会降低迁移写入量,但不能保证所有数据库都满足 Free 计划每日 100,000 行写入额度;数据库足够大或当天已使用较多额度时,仍可能触及上限。时间点恢复恢复的是数据,不会恢复账户已经消耗的每日额度。
|
|
346
346
|
|
|
@@ -380,7 +380,7 @@ SQLite 的 `DELETE` 操作也会消耗每日行写入额度。迁移格式时,
|
|
|
380
380
|
- Request body 会增量消费。一旦越过路由上限,后续 chunk 只会排空而不会保留,路由返回 413。文件上传也会拒绝非法 UTF-8。
|
|
381
381
|
- 读取文件时先检查 VFS metadata,再通过相同的 1 MiB 上限收集已打开的 byte stream,从而关闭 `stat()` 与 `readFile()` 之间的增长竞态,且不保留无界值。
|
|
382
382
|
- 写入前,图片准入会完整解码声明的 raster 格式。
|
|
383
|
-
- 与上游 `bash-local` 一致,输出超过上限后命令会继续运行:每个流内联保留最后 64,000 字节(默认值,即 Shell 卡片的输出上限,可设为 1 KiB 到 1 MiB),整个流保存到 `/workspace/.spill/bash-<execution>.<stream>.txt`(与其他 spill 一样 30 天后删除),每个流最多 16 MiB(上游允许 64 MiB;每 512 KiB 约写 5 行 Durable Object
|
|
383
|
+
- 与上游 `bash-local` 一致,输出超过上限后命令会继续运行:每个流内联保留最后 64,000 字节(默认值,即 Shell 卡片的输出上限,可设为 1 KiB 到 1 MiB),整个流保存到 `/workspace/.spill/bash-<execution>.<stream>.txt`(与其他 spill 一样 30 天后删除),每个流最多 16 MiB(上游允许 64 MiB;每 512 KiB 约写 5 行 Durable Object 数据,已删除文件的字节在其内容闲置一天后由每日清扫释放,#358),超过后文件只保留开头部分,结果中会注明。内存只占尾部加每个流 1 MiB 的写入队列:写 spill 时会暂停读取命令输出。未超过上限的输出不写任何文件。轻量 shell(just-bash)一次性返回命令的完整输出而不是流式输出,所以输出超过 8 MiB 时仍会停止命令(exit 126,显示为 `[stopped: …]`);这块缓冲位于它所在的 isolate 中,Direct 模式下就是 Durable Object。bash 工具按上游格式呈现结果:stdout、`[stderr]` 段、每个流的 `[output truncated; full output: <path>]`、`[timed out after Nms]`,最后是 `[exit code: N]`;终端卡片会显示工作目录。在 Linux Container 中,命令在两个输出管道都关闭后结束;如果用 `&` 启动的后台任务仍占着管道,则在 shell 退出 250 毫秒后结束,该任务之后写出的输出会被丢弃,容器继续运行(computerd 0.7.0,#373)。超过部署上限的 `timeoutMs` 会像上游一样被降到上限;HTTP exec 路由仍会拒绝它。`cancelled` 反映 adapter 请求的中断;`timedOut` 独立记录 deadline expiry。
|
|
384
384
|
|
|
385
385
|
### 持久性与并发
|
|
386
386
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -35,7 +35,7 @@ SOFTWARE.
|
|
|
35
35
|
|
|
36
36
|
## Bundled component inventory
|
|
37
37
|
|
|
38
|
-
`dsh-edge` also applies a version-bound fix to `@cloudflare/computer@0.
|
|
38
|
+
`dsh-edge` also applies a version-bound fix to `@cloudflare/computer@0.7.0`, recorded with its reason in `standalone/patches/audit.json`; the component's license below is unchanged.
|
|
39
39
|
|
|
40
40
|
The following 674 package versions form the conservative, platform-neutral production closure used to assemble the Web and Worker artifacts in this distribution. Platform-specific build binaries that are not distributed in those artifacts are excluded; tree shaking can omit additional code. The inventory and legal texts are generated during packaging rather than referring recipients to a source checkout. License expressions are SPDX identifiers supplied by each package. Dependencies installed separately by npm remain declared in this package's `package.json`.
|
|
41
41
|
|
|
@@ -67,7 +67,7 @@ The following 674 package versions form the conservative, platform-neutral produ
|
|
|
67
67
|
| `@babel/runtime@7.29.7` | `MIT` |
|
|
68
68
|
| `@borewit/text-codec@0.2.2` | `MIT` |
|
|
69
69
|
| `@cfworker/json-schema@4.1.1` | `MIT` |
|
|
70
|
-
| `@cloudflare/computer@0.
|
|
70
|
+
| `@cloudflare/computer@0.7.0` | `MIT` |
|
|
71
71
|
| `@cloudflare/kv-asset-handler@0.5.0` | `MIT OR Apache-2.0` |
|
|
72
72
|
| `@cloudflare/unenv-preset@2.16.1` | `MIT OR Apache-2.0` |
|
|
73
73
|
| `@cspotcode/source-map-support@0.8.1` | `MIT` |
|
|
@@ -5205,6 +5205,40 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
5205
5205
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
5206
5206
|
```
|
|
5207
5207
|
|
|
5208
|
+
### License/notice 6fa9bddd7579
|
|
5209
|
+
|
|
5210
|
+
Applies to:
|
|
5211
|
+
|
|
5212
|
+
- `@cloudflare/computer@0.7.0` (`package metadata fallback`)
|
|
5213
|
+
|
|
5214
|
+
```text
|
|
5215
|
+
The published @cloudflare/computer@0.7.0 package declared MIT but did not include a license or notice file. Attribution from its package metadata: contributors to @cloudflare/computer. Repository: git+https://github.com/cloudflare/computer.git.
|
|
5216
|
+
|
|
5217
|
+
The MIT branch is reproduced for this distribution:
|
|
5218
|
+
|
|
5219
|
+
MIT License
|
|
5220
|
+
|
|
5221
|
+
Published package author: contributors to @cloudflare/computer
|
|
5222
|
+
|
|
5223
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5224
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5225
|
+
in the Software without restriction, including without limitation the rights
|
|
5226
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
5227
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
5228
|
+
furnished to do so, subject to the following conditions:
|
|
5229
|
+
|
|
5230
|
+
The above copyright notice and this permission notice shall be included in all
|
|
5231
|
+
copies or substantial portions of the Software.
|
|
5232
|
+
|
|
5233
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
5234
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
5235
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
5236
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
5237
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
5238
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
5239
|
+
SOFTWARE.
|
|
5240
|
+
```
|
|
5241
|
+
|
|
5208
5242
|
### License/notice 700e990091f6
|
|
5209
5243
|
|
|
5210
5244
|
Applies to:
|
|
@@ -7534,40 +7568,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
7534
7568
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
7535
7569
|
```
|
|
7536
7570
|
|
|
7537
|
-
### License/notice 8f56920dec6e
|
|
7538
|
-
|
|
7539
|
-
Applies to:
|
|
7540
|
-
|
|
7541
|
-
- `@cloudflare/computer@0.3.1` (`package metadata fallback`)
|
|
7542
|
-
|
|
7543
|
-
```text
|
|
7544
|
-
The published @cloudflare/computer@0.3.1 package declared MIT but did not include a license or notice file. Attribution from its package metadata: contributors to @cloudflare/computer. Repository: git+https://github.com/cloudflare/computer.git.
|
|
7545
|
-
|
|
7546
|
-
The MIT branch is reproduced for this distribution:
|
|
7547
|
-
|
|
7548
|
-
MIT License
|
|
7549
|
-
|
|
7550
|
-
Published package author: contributors to @cloudflare/computer
|
|
7551
|
-
|
|
7552
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7553
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7554
|
-
in the Software without restriction, including without limitation the rights
|
|
7555
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7556
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
7557
|
-
furnished to do so, subject to the following conditions:
|
|
7558
|
-
|
|
7559
|
-
The above copyright notice and this permission notice shall be included in all
|
|
7560
|
-
copies or substantial portions of the Software.
|
|
7561
|
-
|
|
7562
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
7563
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
7564
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
7565
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
7566
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
7567
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
7568
|
-
SOFTWARE.
|
|
7569
|
-
```
|
|
7570
|
-
|
|
7571
7571
|
### License/notice 9116bd624634
|
|
7572
7572
|
|
|
7573
7573
|
Applies to:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-edge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0-alpha.1",
|
|
4
4
|
"description": "Your DeepSeek Harness, anywhere — deploy a persistent personal coding agent to Cloudflare Workers in one command",
|
|
5
5
|
"author": "pawaca",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@cfworker/json-schema": "^4.1.1",
|
|
59
|
-
"@cloudflare/computer": "0.
|
|
59
|
+
"@cloudflare/computer": "0.7.0",
|
|
60
60
|
"@cloudflare/workers-types": "5.20260904.1",
|
|
61
61
|
"@deepseek-ai/cordis": "4.0.5",
|
|
62
62
|
"@deepseek-ai/cosmokit": "1.8.6",
|
|
@@ -81,7 +81,7 @@ export function verifyPacked(input) {
|
|
|
81
81
|
|| !noticesText.includes('Copyright (c) 2026 DeepSeek')
|
|
82
82
|
|| !noticesText.includes('## Bundled component inventory')
|
|
83
83
|
|| !noticesText.includes('## Bundled license and notice texts')
|
|
84
|
-
|| !noticesText.includes('`@cloudflare/computer@0.
|
|
84
|
+
|| !noticesText.includes('`@cloudflare/computer@0.7.0` | `MIT`')
|
|
85
85
|
|| !noticesText.includes('`diff@9.0.0` (`LICENSE`)')
|
|
86
86
|
|| !noticesText.includes('Copyright (c) 2009-2015, Kevin Decker')
|
|
87
87
|
|| !noticesText.includes('Redistributions in binary form must reproduce')
|