dsh-edge 0.16.0 → 0.17.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 +1 -1
- package/README.zh.md +1 -1
- package/THIRD_PARTY_NOTICES.md +243 -1
- package/package.json +6 -1
- package/scripts/activation.mjs +3 -2
- package/scripts/cli.mjs +2 -12
- package/scripts/install.d.mts +4 -6
- package/scripts/install.mjs +9 -19
- package/scripts/runtime-providers.d.mts +20 -0
- package/scripts/runtime-providers.mjs +66 -0
- package/scripts/verify-packed.mjs +2 -0
- package/worker/direct/index.js +1692 -1168
- package/worker/isolated/index.js +1349 -825
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: 61c8c92943e094a3e111bf006959484d73305eb8
|
|
6
|
+
README.zh.md: 782384c937122aeba4615209290089361d63f035
|
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ This reference separates code that runs natively in Workers, code adapted at an
|
|
|
152
152
|
| Directory picker | `ctx.directoryPicker` seam with the `-native` OS chooser or the `-browse` filesystem backend, chosen at boot by `dsh-host-directory-picker-auto`, plus the Web browse dialog | Reused with an Edge browse backend | Install the upstream seam and pin the upstream `dsh-client-ui-directory-picker-browse` dialog in the Web roster; Edge answers the `browse` capability from the `/workspace` Computer VFS one level per call, rooted at `/workspace` with the upstream hidden, bound, and failure vocabulary, so the upstream `DirectoryPickerController` serves `directoryPicker/list` and `createDirectory` and refuses the native `pick`. |
|
|
153
153
|
| Conversation file links | `session/openWorkspacePath` hands a clicked path to the Host desktop opener through `dsh-native-command`; `session/canOpenWorkspacePath` gates the affordance | Adapted at the upstream `SessionControllerInternals` seam plus a Web download fallback | Compose `SessionController` with Edge internals so the native probe answers false and an open attempt fails with a readable reason instead of a `child_process` error. The V3 Web client opens file links in its right-sidebar preview. Edge composes the upstream `workspaceFiles` controller over request-scoped VFS reads, including bounded text/byte windows and metadata subscriptions. The legacy `ctx.remote.session.openWorkspacePath` fallback and owner-authenticated `GET /api/workspace/file` download remain available. |
|
|
154
154
|
| Existing Web UI | Runtime-loaded shell and `dsh.client` plugin graph | Reused with generic composition fallbacks | Assemble the upstream shell and supported upstream client bundles as Worker assets. Shared slot-occupancy rules hide actions whose provider is absent; Cloudflare serves ordinary assets directly, while `/`, `/login`, and `/api/*` enter the Worker for owner access control. The assembled asset policy prevents every direct or SPA-fallback shell alias from being framed. |
|
|
155
|
-
| Other tools | Web Search, filesystem editor tools, MCP, skills, workflows, jobs, and subagents | Search, file, goal, skill, and MCP tools ported;
|
|
155
|
+
| Other tools | Web Search, filesystem editor tools, MCP, skills, workflows, jobs, and subagents | Search, file, goal, skill, and MCP tools ported; workflow and run_code ported for the isolated build | Reuse upstream DeepSeek Web Search with its 30-second tool-call timeout. The upstream `workflow` tool is offered only by the Dynamic Worker runtime (the isolated, Paid-plan build); the Direct build does not register it. Each run loads its script into its own Dynamic Worker with no outbound network and a 30-second Worker Loader `cpuMs` limit (enforced by the Cloudflare runtime, not by local development), because workerd forbids in-process `eval`/`new Function`/`node:vm`; `agent()`, `phase()`, and `log()` cross an RPC bridge to the Durable Object, which enforces the caps: at most 4 children run at once (below the Workers six-connection limit) and one run starts at most 100 children to bound child-session row writes. The upstream `run_code` tool (`dsh-tools` PTC mode, enabled as `both` alongside the native tools) is offered by the same runtime: each program is type-stripped with sucrase and runs in its own Dynamic Worker with a 30-second `cpuMs` limit and no outbound network; its `tools.*` calls cross an RPC bridge where the Durable Object caps them at 200 per run (each is a nested tool dispatch with its own session events), 256 KiB of arguments, and 2 MiB per result, and nested calls stay approval-gated. File tools (read/write/edit/read_image) adapted via `EdgeFileSystem` backed by Computer VFS. Goal tools (`ToolGoal`) composed directly with `GoalService` as upstream cordis plugins. Skill tool via `SkillRegistry` + `EdgeSkillProvider` (DO KV-backed); owner CRUD at `GET/PUT/DELETE /api/skills`. MCP client (`dsh-mcp-client`) installed; Streamable HTTP transport only (stdio unavailable on Workers). Configure servers in Settings → DSH Edge → MCP Servers; tools appear as `mcp__<serverName>__<tool>`. Add the remaining tools individually against Worker-compatible capabilities; do not advertise unavailable host behavior. |
|
|
156
156
|
| Attachments | Local attachment storage, upstream image references, composer, gallery, lightbox, and provider conversion | Adapted at the native storage seam | Reuse upstream `AttachmentStore`, admission, protocol, authorization, UI, and DeepSeek conversion unchanged. Store immutable PNG/JPEG bytes under their SHA-256 identities in private R2 for new permanent deployments or in a 64 MiB, 512 KiB-chunked DO backend for temporary deployments and owners who select it while upgrading a pre-attachment Worker; session events retain only upstream refs. The first backend is pinned per owner instance so claiming or upgrading cannot strand existing references. |
|
|
157
157
|
| Goal tracking | `GoalService` with create/edit/pause/resume/complete/clear mutations and GoalBar UI | Reused | Install upstream `GoalService` and `ToolGoal` as cordis plugins (direct composition). Browser GoalBar mutations route through `TypertGatewayService` at `/api/goals/<method>`. `SessionProjectionCache` persists goal state across DO restart. |
|
|
158
158
|
| Context compaction | Token metering, automatic compaction, and session title generation | Reused | Install upstream cordis plugins directly. Context compaction, token metering, tool-result pruning, and automatic session title generation run unchanged. |
|
package/README.zh.md
CHANGED
|
@@ -152,7 +152,7 @@ curl -b /tmp/dsh-edge-cookie -N -X POST -H 'content-type: application/json' \
|
|
|
152
152
|
| Directory picker | `ctx.directoryPicker` seam,由 `dsh-host-directory-picker-auto` 在启动时选择 `-native` OS 选择器或 `-browse` 文件系统 backend,加 Web browse 对话框 | 复用并提供 Edge browse backend | 安装上游 seam,并把上游 `dsh-client-ui-directory-picker-browse` 对话框固定进 Web roster;Edge 从 `/workspace` Computer VFS 按每次一层回答 `browse` capability,以 `/workspace` 为根并沿用上游的 hidden、bound 与失败词汇,因此上游 `DirectoryPickerController` 提供 `directoryPicker/list` 与 `createDirectory`,并拒绝原生 `pick`。 |
|
|
153
153
|
| 对话文件链接 | `session/openWorkspacePath` 经 `dsh-native-command` 把点击的路径交给宿主桌面打开器;`session/canOpenWorkspacePath` 决定是否展示该入口 | 在上游 `SessionControllerInternals` seam 适配,加 Web 端下载回退 | 用 Edge internals 组合 `SessionController`,让原生探测返回 false、打开尝试以可读原因失败而不是 `child_process` 错误。V3 Web 客户端在右侧栏预览文件链接。Edge 将上游 `workspaceFiles` 控制器接入请求作用域内的 VFS 读取,支持有界文本/字节分页和元数据订阅。旧版 `ctx.remote.session.openWorkspacePath` 回退以及经 owner 鉴权的 `GET /api/workspace/file` 下载仍然可用。 |
|
|
154
154
|
| Existing Web UI | 运行时加载的 shell 和 `dsh.client` 插件 graph | 复用并采用通用 composition fallback | 把上游 shell 和受支持的上游客户端包组装成 Worker 静态资源;共享的 slot occupancy 规则会隐藏缺少 provider 的 action。Cloudflare 直接提供普通资源,`/`、`/login` 与 `/api/*` 则进入 Worker 执行 owner access control。组装后的 asset policy 会阻止所有直接或 SPA-fallback shell alias 被嵌入 frame。 |
|
|
155
|
-
| Other tools | Web Search、filesystem editor tools、MCP、skills、workflows、jobs 和 subagents | Search、文件、goal、skill 和 MCP 工具已移植;
|
|
155
|
+
| Other tools | Web Search、filesystem editor tools、MCP、skills、workflows、jobs 和 subagents | Search、文件、goal、skill 和 MCP 工具已移植;workflow 与 run_code 已在 isolated 构建中移植 | 复用上游 DeepSeek Web Search 及其 30 秒 tool-call timeout。上游 `workflow` 工具仅由 Dynamic Worker 运行时提供(isolated、Paid 计划构建);Direct 构建不注册该工具。由于 workerd 禁止在进程内使用 `eval`/`new Function`/`node:vm`,每次运行都会把脚本加载到独立的 Dynamic Worker 中执行,该 Worker 无出站网络,并受 30 秒 Worker Loader `cpuMs` 上限约束(由 Cloudflare 运行时强制执行,本地开发环境不执行);`agent()`、`phase()`、`log()` 经 RPC 桥回到 Durable Object,由其执行各项上限:同时最多运行 4 个子 agent(低于 Workers 六连接上限),单次运行最多启动 100 个子 agent,以限制子会话的行写入。上游 `run_code` 工具(`dsh-tools` PTC 模式,以 `both` 与原生工具并存)由同一运行时提供:每个程序先用 sucrase 去除类型,再在独立 Dynamic Worker 中运行,受 30 秒 `cpuMs` 上限约束且无出站网络;其中的 `tools.*` 调用经 RPC 桥回到 Durable Object,由其限制为每次运行最多 200 次(每次都是一次写入 session 事件的嵌套工具派发)、参数最多 256 KiB、单次结果最多 2 MiB,嵌套调用仍走审批。文件工具(read/write/edit/read_image)通过 `EdgeFileSystem` 适配 Computer VFS。Goal 工具(`ToolGoal`)作为上游 cordis 插件直接与 `GoalService` 组合。Skill 工具通过 `SkillRegistry` + `EdgeSkillProvider`(DO KV 存储);owner CRUD 接口 `GET/PUT/DELETE /api/skills`。MCP client(`dsh-mcp-client`)已安装;仅支持 Streamable HTTP transport(Workers 上不可用 stdio)。在 Settings → DSH Edge → MCP Servers 中配置服务器;工具名格式为 `mcp__<serverName>__<tool>`。逐个针对 Worker-compatible capabilities 增加其余工具,不宣称不可用的 host 行为。 |
|
|
156
156
|
| Attachments | 本地 attachment storage、上游 image reference、composer、gallery、lightbox 与 provider conversion | 在原生 storage seam 上适配 | 原样复用上游 `AttachmentStore`、admission、协议、授权、UI 与 DeepSeek conversion。PNG/JPEG 不可变字节按 SHA-256 identity 存入新永久部署的私有 R2,或存入临时部署以及升级旧版 Worker 时由 owner 选择的 64 MiB、按 512 KiB 分块的 DO backend;session event 只保留上游 ref。每个 owner instance 首次选择的 backend 会被固定,认领或升级不会让既有引用失联。 |
|
|
157
157
|
| Goal tracking | `GoalService` 提供 create/edit/pause/resume/complete/clear mutation 与 GoalBar UI | 复用 | 作为 cordis 插件安装上游 `GoalService` 和 `ToolGoal`(直接组合)。浏览器 GoalBar mutation 通过 `TypertGatewayService` 路由到 `/api/goals/<method>`。`SessionProjectionCache` 在 DO 重启后持久化 goal 状态。 |
|
|
158
158
|
| Context compaction | Token 计量、自动压缩和 session 标题生成 | 复用 | 直接安装上游 cordis 插件。上下文压缩、token 计量、工具结果修剪和自动 session 标题生成原样运行。 |
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -35,7 +35,7 @@ SOFTWARE.
|
|
|
35
35
|
|
|
36
36
|
## Bundled component inventory
|
|
37
37
|
|
|
38
|
-
The following
|
|
38
|
+
The following 596 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`.
|
|
39
39
|
|
|
40
40
|
| Component | License |
|
|
41
41
|
| --- | --- |
|
|
@@ -302,8 +302,10 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
302
302
|
| `@jitl/quickjs-wasmfile-release-asyncify@0.32.0` | `MIT` |
|
|
303
303
|
| `@jitl/quickjs-wasmfile-release-sync@0.32.0` | `MIT` |
|
|
304
304
|
| `@joplin/turndown-plugin-gfm@1.0.67` | `MIT` |
|
|
305
|
+
| `@jridgewell/gen-mapping@0.3.13` | `MIT` |
|
|
305
306
|
| `@jridgewell/resolve-uri@3.1.2` | `MIT` |
|
|
306
307
|
| `@jridgewell/sourcemap-codec@1.5.5` | `MIT` |
|
|
308
|
+
| `@jridgewell/trace-mapping@0.3.31` | `MIT` |
|
|
307
309
|
| `@jridgewell/trace-mapping@0.3.9` | `MIT` |
|
|
308
310
|
| `@mixmark-io/domino@2.2.0` | `BSD-2-Clause` |
|
|
309
311
|
| `@modelcontextprotocol/sdk@1.30.0` | `MIT` |
|
|
@@ -360,6 +362,7 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
360
362
|
| `agent-base@7.1.4` | `MIT` |
|
|
361
363
|
| `ajv@8.20.0` | `MIT` |
|
|
362
364
|
| `ajv-formats@3.0.1` | `MIT` |
|
|
365
|
+
| `any-promise@1.3.0` | `MIT` |
|
|
363
366
|
| `anynum@1.0.1` | `MIT` |
|
|
364
367
|
| `argparse@2.0.1` | `Python-2.0` |
|
|
365
368
|
| `balanced-match@4.0.4` | `MIT` |
|
|
@@ -381,6 +384,7 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
381
384
|
| `chokidar@5.0.0` | `MIT` |
|
|
382
385
|
| `chownr@1.1.4` | `ISC` |
|
|
383
386
|
| `commander@15.0.0` | `MIT` |
|
|
387
|
+
| `commander@4.1.1` | `MIT` |
|
|
384
388
|
| `commander@6.2.1` | `MIT` |
|
|
385
389
|
| `compare-versions@6.1.1` | `MIT` |
|
|
386
390
|
| `compressible@2.0.18` | `MIT` |
|
|
@@ -430,6 +434,7 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
430
434
|
| `fast-uri@3.1.7` | `BSD-3-Clause` |
|
|
431
435
|
| `fast-xml-builder@1.3.1` | `MIT` |
|
|
432
436
|
| `fast-xml-parser@5.11.0` | `MIT` |
|
|
437
|
+
| `fdir@6.5.0` | `MIT` |
|
|
433
438
|
| `fetch-blob@3.2.0` | `MIT` |
|
|
434
439
|
| `fflate@0.8.3` | `MIT` |
|
|
435
440
|
| `figures@6.1.0` | `MIT` |
|
|
@@ -489,6 +494,7 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
489
494
|
| `jws@4.0.1` | `MIT` |
|
|
490
495
|
| `kleur@4.1.5` | `MIT` |
|
|
491
496
|
| `koffi@3.1.6` | `MIT` |
|
|
497
|
+
| `lines-and-columns@1.2.4` | `MIT` |
|
|
492
498
|
| `long@5.3.2` | `Apache-2.0` |
|
|
493
499
|
| `math-intrinsics@1.1.0` | `MIT` |
|
|
494
500
|
| `media-typer@1.1.1` | `MIT` |
|
|
@@ -503,6 +509,7 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
503
509
|
| `modern-tar@0.7.7` | `MIT` |
|
|
504
510
|
| `ms@2.0.0` | `MIT` |
|
|
505
511
|
| `ms@2.1.3` | `MIT` |
|
|
512
|
+
| `mz@2.7.0` | `MIT` |
|
|
506
513
|
| `napi-build-utils@2.0.0` | `MIT` |
|
|
507
514
|
| `negotiator@0.6.4` | `MIT` |
|
|
508
515
|
| `negotiator@1.1.0` | `MIT` |
|
|
@@ -535,6 +542,7 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
535
542
|
| `pathe@2.0.3` | `MIT` |
|
|
536
543
|
| `picocolors@1.1.1` | `ISC` |
|
|
537
544
|
| `picomatch@4.0.7` | `MIT` |
|
|
545
|
+
| `pirates@4.0.7` | `MIT` |
|
|
538
546
|
| `pkce-challenge@5.0.1` | `MIT` |
|
|
539
547
|
| `powershell-utils@0.1.0` | `MIT` |
|
|
540
548
|
| `powershell-utils@0.2.0` | `MIT` |
|
|
@@ -586,12 +594,17 @@ The following 583 package versions form the conservative, platform-neutral produ
|
|
|
586
594
|
| `strip-json-comments@2.0.1` | `MIT` |
|
|
587
595
|
| `strnum@2.4.2` | `MIT` |
|
|
588
596
|
| `strtok3@10.3.5` | `MIT` |
|
|
597
|
+
| `sucrase@3.35.1` | `MIT` |
|
|
589
598
|
| `supports-color@10.2.2` | `MIT` |
|
|
590
599
|
| `tar-fs@2.1.5` | `MIT` |
|
|
591
600
|
| `tar-stream@2.2.0` | `MIT` |
|
|
601
|
+
| `thenify@3.3.1` | `MIT` |
|
|
602
|
+
| `thenify-all@1.6.0` | `MIT` |
|
|
603
|
+
| `tinyglobby@0.2.17` | `MIT` |
|
|
592
604
|
| `toidentifier@1.0.1` | `MIT` |
|
|
593
605
|
| `token-types@6.1.2` | `MIT` |
|
|
594
606
|
| `ts-algebra@2.0.0` | `MIT` |
|
|
607
|
+
| `ts-interface-checker@0.1.13` | `Apache-2.0` |
|
|
595
608
|
| `tslib@2.8.1` | `0BSD` |
|
|
596
609
|
| `tunnel-agent@0.6.0` | `Apache-2.0` |
|
|
597
610
|
| `turndown@7.2.4` | `MIT` |
|
|
@@ -766,6 +779,36 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
766
779
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
767
780
|
```
|
|
768
781
|
|
|
782
|
+
### License/notice 0371d7e49a54
|
|
783
|
+
|
|
784
|
+
Applies to:
|
|
785
|
+
|
|
786
|
+
- `thenify@3.3.1` (`LICENSE`)
|
|
787
|
+
|
|
788
|
+
```text
|
|
789
|
+
The MIT License (MIT)
|
|
790
|
+
|
|
791
|
+
Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and contributors
|
|
792
|
+
|
|
793
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
794
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
795
|
+
in the Software without restriction, including without limitation the rights
|
|
796
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
797
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
798
|
+
furnished to do so, subject to the following conditions:
|
|
799
|
+
|
|
800
|
+
The above copyright notice and this permission notice shall be included in
|
|
801
|
+
all copies or substantial portions of the Software.
|
|
802
|
+
|
|
803
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
804
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
805
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
806
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
807
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
808
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
809
|
+
THE SOFTWARE.
|
|
810
|
+
```
|
|
811
|
+
|
|
769
812
|
### License/notice 04acffac8ee6
|
|
770
813
|
|
|
771
814
|
Applies to:
|
|
@@ -985,6 +1028,36 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
|
985
1028
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
986
1029
|
```
|
|
987
1030
|
|
|
1031
|
+
### License/notice 0ccfcc479458
|
|
1032
|
+
|
|
1033
|
+
Applies to:
|
|
1034
|
+
|
|
1035
|
+
- `mz@2.7.0` (`LICENSE`)
|
|
1036
|
+
|
|
1037
|
+
```text
|
|
1038
|
+
The MIT License (MIT)
|
|
1039
|
+
|
|
1040
|
+
Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
|
|
1041
|
+
|
|
1042
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1043
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
1044
|
+
in the Software without restriction, including without limitation the rights
|
|
1045
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1046
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
1047
|
+
furnished to do so, subject to the following conditions:
|
|
1048
|
+
|
|
1049
|
+
The above copyright notice and this permission notice shall be included in
|
|
1050
|
+
all copies or substantial portions of the Software.
|
|
1051
|
+
|
|
1052
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1053
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1054
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1055
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1056
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1057
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1058
|
+
THE SOFTWARE.
|
|
1059
|
+
```
|
|
1060
|
+
|
|
988
1061
|
### License/notice 0e8d2550baea
|
|
989
1062
|
|
|
990
1063
|
Applies to:
|
|
@@ -1268,6 +1341,52 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
1268
1341
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1269
1342
|
```
|
|
1270
1343
|
|
|
1344
|
+
### License/notice 15e7786c7e68
|
|
1345
|
+
|
|
1346
|
+
Applies to:
|
|
1347
|
+
|
|
1348
|
+
- `fdir@6.5.0` (`LICENSE`)
|
|
1349
|
+
|
|
1350
|
+
```text
|
|
1351
|
+
Copyright 2023 Abdullah Atta
|
|
1352
|
+
|
|
1353
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1354
|
+
|
|
1355
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1356
|
+
|
|
1357
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1358
|
+
```
|
|
1359
|
+
|
|
1360
|
+
### License/notice 1b31e7ac2b89
|
|
1361
|
+
|
|
1362
|
+
Applies to:
|
|
1363
|
+
|
|
1364
|
+
- `sucrase@3.35.1` (`LICENSE`)
|
|
1365
|
+
|
|
1366
|
+
```text
|
|
1367
|
+
The MIT License (MIT)
|
|
1368
|
+
|
|
1369
|
+
Copyright (c) 2012-2018 various contributors (see AUTHORS)
|
|
1370
|
+
|
|
1371
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1372
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
1373
|
+
in the Software without restriction, including without limitation the rights
|
|
1374
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1375
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
1376
|
+
furnished to do so, subject to the following conditions:
|
|
1377
|
+
|
|
1378
|
+
The above copyright notice and this permission notice shall be included in all
|
|
1379
|
+
copies or substantial portions of the Software.
|
|
1380
|
+
|
|
1381
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1382
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1383
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1384
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1385
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1386
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1387
|
+
SOFTWARE.
|
|
1388
|
+
```
|
|
1389
|
+
|
|
1271
1390
|
### License/notice 1d660eff8965
|
|
1272
1391
|
|
|
1273
1392
|
Applies to:
|
|
@@ -2916,6 +3035,36 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
2916
3035
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
2917
3036
|
```
|
|
2918
3037
|
|
|
3038
|
+
### License/notice 4918b99deb04
|
|
3039
|
+
|
|
3040
|
+
Applies to:
|
|
3041
|
+
|
|
3042
|
+
- `tinyglobby@0.2.17` (`LICENSE`)
|
|
3043
|
+
|
|
3044
|
+
```text
|
|
3045
|
+
MIT License
|
|
3046
|
+
|
|
3047
|
+
Copyright (c) 2024 Madeline Gurriarán
|
|
3048
|
+
|
|
3049
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3050
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
3051
|
+
in the Software without restriction, including without limitation the rights
|
|
3052
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3053
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
3054
|
+
furnished to do so, subject to the following conditions:
|
|
3055
|
+
|
|
3056
|
+
The above copyright notice and this permission notice shall be included in all
|
|
3057
|
+
copies or substantial portions of the Software.
|
|
3058
|
+
|
|
3059
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3060
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3061
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3062
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3063
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3064
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
3065
|
+
SOFTWARE.
|
|
3066
|
+
```
|
|
3067
|
+
|
|
2919
3068
|
### License/notice 49e71b973753
|
|
2920
3069
|
|
|
2921
3070
|
Applies to:
|
|
@@ -3165,6 +3314,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
3165
3314
|
Applies to:
|
|
3166
3315
|
|
|
3167
3316
|
- `commander@15.0.0` (`LICENSE`)
|
|
3317
|
+
- `commander@4.1.1` (`LICENSE`)
|
|
3168
3318
|
- `commander@6.2.1` (`LICENSE`)
|
|
3169
3319
|
|
|
3170
3320
|
```text
|
|
@@ -4351,6 +4501,7 @@ Applies to:
|
|
|
4351
4501
|
- `@aws-crypto/sha256-js@5.2.0` (`LICENSE`)
|
|
4352
4502
|
- `@aws-crypto/util@5.2.0` (`LICENSE`)
|
|
4353
4503
|
- `detect-libc@2.1.2` (`LICENSE`)
|
|
4504
|
+
- `ts-interface-checker@0.1.13` (`LICENSE`)
|
|
4354
4505
|
|
|
4355
4506
|
```text
|
|
4356
4507
|
Apache License
|
|
@@ -5244,6 +5395,34 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
5244
5395
|
SOFTWARE.
|
|
5245
5396
|
```
|
|
5246
5397
|
|
|
5398
|
+
### License/notice 7b3e0db83c00
|
|
5399
|
+
|
|
5400
|
+
Applies to:
|
|
5401
|
+
|
|
5402
|
+
- `any-promise@1.3.0` (`LICENSE`)
|
|
5403
|
+
|
|
5404
|
+
```text
|
|
5405
|
+
Copyright (C) 2014-2016 Kevin Beaty
|
|
5406
|
+
|
|
5407
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5408
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5409
|
+
in the Software without restriction, including without limitation the rights
|
|
5410
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
5411
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
5412
|
+
furnished to do so, subject to the following conditions:
|
|
5413
|
+
|
|
5414
|
+
The above copyright notice and this permission notice shall be included in
|
|
5415
|
+
all copies or substantial portions of the Software.
|
|
5416
|
+
|
|
5417
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
5418
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
5419
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
5420
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
5421
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
5422
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
5423
|
+
THE SOFTWARE.
|
|
5424
|
+
```
|
|
5425
|
+
|
|
5247
5426
|
### License/notice 7bc07978a66d
|
|
5248
5427
|
|
|
5249
5428
|
Applies to:
|
|
@@ -6498,6 +6677,36 @@ MIT License
|
|
|
6498
6677
|
SOFTWARE
|
|
6499
6678
|
```
|
|
6500
6679
|
|
|
6680
|
+
### License/notice 8ecd0fb4cd2c
|
|
6681
|
+
|
|
6682
|
+
Applies to:
|
|
6683
|
+
|
|
6684
|
+
- `lines-and-columns@1.2.4` (`LICENSE`)
|
|
6685
|
+
|
|
6686
|
+
```text
|
|
6687
|
+
The MIT License (MIT)
|
|
6688
|
+
|
|
6689
|
+
Copyright (c) 2015 Brian Donovan
|
|
6690
|
+
|
|
6691
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6692
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6693
|
+
in the Software without restriction, including without limitation the rights
|
|
6694
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
6695
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
6696
|
+
furnished to do so, subject to the following conditions:
|
|
6697
|
+
|
|
6698
|
+
The above copyright notice and this permission notice shall be included in
|
|
6699
|
+
all copies or substantial portions of the Software.
|
|
6700
|
+
|
|
6701
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
6702
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
6703
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
6704
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
6705
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
6706
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
6707
|
+
THE SOFTWARE.
|
|
6708
|
+
```
|
|
6709
|
+
|
|
6501
6710
|
### License/notice 8f08c824b2bb
|
|
6502
6711
|
|
|
6503
6712
|
Applies to:
|
|
@@ -6686,7 +6895,9 @@ SOFTWARE.
|
|
|
6686
6895
|
|
|
6687
6896
|
Applies to:
|
|
6688
6897
|
|
|
6898
|
+
- `@jridgewell/gen-mapping@0.3.13` (`LICENSE`)
|
|
6689
6899
|
- `@jridgewell/sourcemap-codec@1.5.5` (`LICENSE`)
|
|
6900
|
+
- `@jridgewell/trace-mapping@0.3.31` (`LICENSE`)
|
|
6690
6901
|
|
|
6691
6902
|
```text
|
|
6692
6903
|
Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
|
|
@@ -8422,6 +8633,36 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
8422
8633
|
SOFTWARE.
|
|
8423
8634
|
```
|
|
8424
8635
|
|
|
8636
|
+
### License/notice c0c5f371c09e
|
|
8637
|
+
|
|
8638
|
+
Applies to:
|
|
8639
|
+
|
|
8640
|
+
- `pirates@4.0.7` (`LICENSE`)
|
|
8641
|
+
|
|
8642
|
+
```text
|
|
8643
|
+
MIT License
|
|
8644
|
+
|
|
8645
|
+
Copyright (c) 2016-2018 Ari Porad
|
|
8646
|
+
|
|
8647
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8648
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8649
|
+
in the Software without restriction, including without limitation the rights
|
|
8650
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8651
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8652
|
+
furnished to do so, subject to the following conditions:
|
|
8653
|
+
|
|
8654
|
+
The above copyright notice and this permission notice shall be included in all
|
|
8655
|
+
copies or substantial portions of the Software.
|
|
8656
|
+
|
|
8657
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
8658
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
8659
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
8660
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
8661
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
8662
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
8663
|
+
SOFTWARE.
|
|
8664
|
+
```
|
|
8665
|
+
|
|
8425
8666
|
### License/notice c216320ffa9b
|
|
8426
8667
|
|
|
8427
8668
|
Applies to:
|
|
@@ -9121,6 +9362,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
9121
9362
|
Applies to:
|
|
9122
9363
|
|
|
9123
9364
|
- `ee-first@1.1.1` (`LICENSE`)
|
|
9365
|
+
- `thenify-all@1.6.0` (`LICENSE`)
|
|
9124
9366
|
|
|
9125
9367
|
```text
|
|
9126
9368
|
The MIT License (MIT)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-edge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"@deepseek-ai/dsh-attachment": "0.1.5-rc.2",
|
|
71
71
|
"@deepseek-ai/dsh-brand": "0.1.5-rc.2",
|
|
72
72
|
"@deepseek-ai/dsh-client-store": "0.1.5-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-code-runtime": "0.1.5-rc.2",
|
|
73
74
|
"@deepseek-ai/dsh-commands": "0.1.5-rc.2",
|
|
74
75
|
"@deepseek-ai/dsh-compaction": "0.1.5-rc.2",
|
|
75
76
|
"@deepseek-ai/dsh-compaction-basic": "0.1.5-rc.2",
|
|
@@ -127,6 +128,7 @@
|
|
|
127
128
|
"@deepseek-ai/dsh-tool-skill": "0.1.5-rc.2",
|
|
128
129
|
"@deepseek-ai/dsh-tool-subagent": "0.1.5-rc.2",
|
|
129
130
|
"@deepseek-ai/dsh-tool-web": "0.1.5-rc.2",
|
|
131
|
+
"@deepseek-ai/dsh-tool-workflow": "0.1.5-rc.2",
|
|
130
132
|
"@deepseek-ai/dsh-tools": "0.1.5-rc.2",
|
|
131
133
|
"@deepseek-ai/dsh-typert-protocol": "0.1.5-rc.2",
|
|
132
134
|
"@deepseek-ai/dsh-typert-registry": "0.1.5-rc.2",
|
|
@@ -136,14 +138,17 @@
|
|
|
136
138
|
"@deepseek-ai/dsh-web": "0.1.5-rc.2",
|
|
137
139
|
"@deepseek-ai/dsh-web-fetch-http": "0.1.5-rc.2",
|
|
138
140
|
"@deepseek-ai/dsh-web-search-deepseek": "0.1.5-rc.2",
|
|
141
|
+
"@deepseek-ai/dsh-workflow": "0.1.5-rc.2",
|
|
139
142
|
"@deepseek-ai/dsh-workspace": "0.1.5-rc.2",
|
|
140
143
|
"@deepseek-ai/schemastery": "3.18.2",
|
|
141
144
|
"@mixmark-io/domino": "2.2.0",
|
|
142
145
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
146
|
+
"acorn": "8.18.0",
|
|
143
147
|
"fast-png": "8.0.0",
|
|
144
148
|
"jpeg-js": "0.4.4",
|
|
145
149
|
"just-bash": "3.4.2",
|
|
146
150
|
"playwright": "^1.49.0",
|
|
151
|
+
"sucrase": "3.35.1",
|
|
147
152
|
"typescript": "^6.0.3",
|
|
148
153
|
"vitest": "^4.1.8",
|
|
149
154
|
"ws": "^8.21.0"
|
package/scripts/activation.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { setTimeout as sleep } from 'node:timers/promises'
|
|
2
2
|
import edgePackage from '../package.json' with { type: 'json' }
|
|
3
|
+
import { isRuntimeMode, RUNTIME_MODES } from './runtime-providers.mjs'
|
|
3
4
|
|
|
4
5
|
export const ACTIVATION_WAIT_MS = 45_000
|
|
5
6
|
export const ACTIVATION_REQUEST_TIMEOUT_MS = 4_000
|
|
@@ -21,7 +22,7 @@ export async function observePublicActivation({
|
|
|
21
22
|
sleepImpl = sleep,
|
|
22
23
|
waitMs = ACTIVATION_WAIT_MS,
|
|
23
24
|
} = {}) {
|
|
24
|
-
if (mode
|
|
25
|
+
if (!isRuntimeMode(mode)) throw new Error('A runtime mode is required.')
|
|
25
26
|
if (!Number.isFinite(waitMs) || waitMs < 0) throw new Error('Activation wait must be non-negative.')
|
|
26
27
|
if (!Number.isFinite(requestTimeoutMs) || requestTimeoutMs <= 0) {
|
|
27
28
|
throw new Error('Activation request timeout must be positive.')
|
|
@@ -33,7 +34,7 @@ export async function observePublicActivation({
|
|
|
33
34
|
const expected = {
|
|
34
35
|
workerVersionId: versionId,
|
|
35
36
|
deploymentId: `dsh-edge@${edgePackage.version}/${mode}`,
|
|
36
|
-
shell: mode
|
|
37
|
+
shell: RUNTIME_MODES[mode].expectedShell,
|
|
37
38
|
}
|
|
38
39
|
const startedAt = now()
|
|
39
40
|
const deadline = startedAt + waitMs
|
package/scripts/cli.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
InstallerOutputError,
|
|
13
13
|
installEdge,
|
|
14
14
|
} from './install.mjs'
|
|
15
|
+
import { runtimeModeChoices } from './runtime-providers.mjs'
|
|
15
16
|
|
|
16
17
|
const INTERRUPT_EXIT_CODES = new Map([
|
|
17
18
|
['SIGHUP', 129],
|
|
@@ -93,18 +94,7 @@ export function createInstallerUi(
|
|
|
93
94
|
message: 'Choose a runtime',
|
|
94
95
|
signal,
|
|
95
96
|
initialValue: 'direct',
|
|
96
|
-
options:
|
|
97
|
-
{
|
|
98
|
-
value: 'direct',
|
|
99
|
-
label: 'Free — Direct Shell',
|
|
100
|
-
hint: 'recommended; runs on Workers Free',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
value: 'isolated',
|
|
104
|
-
label: 'Isolated — Dynamic Worker',
|
|
105
|
-
hint: 'requires Workers Paid (starting at $5/month)',
|
|
106
|
-
},
|
|
107
|
-
],
|
|
97
|
+
options: runtimeModeChoices(),
|
|
108
98
|
})))
|
|
109
99
|
},
|
|
110
100
|
async selectAccount(choices) {
|
package/scripts/install.d.mts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { RuntimeMode } from './runtime-providers.mjs'
|
|
2
|
+
|
|
3
|
+
export type { RuntimeMode }
|
|
4
|
+
export { RUNTIME_MODES } from './runtime-providers.mjs'
|
|
2
5
|
export type InstallerCommand = 'install' | 'upgrade'
|
|
3
6
|
export type AttachmentStorage = 'private-r2' | 'temporary-do'
|
|
4
7
|
|
|
@@ -77,11 +80,6 @@ export interface InstallResult {
|
|
|
77
80
|
|
|
78
81
|
export const DEFAULT_WORKER_NAME: string
|
|
79
82
|
export const LOGIN_PROFILE: string
|
|
80
|
-
export const RUNTIME_MODES: Readonly<Record<RuntimeMode, Readonly<{
|
|
81
|
-
environment: string
|
|
82
|
-
expectedShell: string
|
|
83
|
-
label: string
|
|
84
|
-
}>>>
|
|
85
83
|
export class InstallCancelledError extends Error {}
|
|
86
84
|
export class InstallerOutputError extends Error {
|
|
87
85
|
readonly stream: 'stderr' | 'stdout'
|
package/scripts/install.mjs
CHANGED
|
@@ -8,22 +8,12 @@ import { setTimeout as sleep } from 'node:timers/promises'
|
|
|
8
8
|
import { fileURLToPath } from 'node:url'
|
|
9
9
|
import { execa } from 'execa'
|
|
10
10
|
import { writePrebuiltModeWranglerConfig } from './wrangler-config.mjs'
|
|
11
|
+
import { isRuntimeMode, RUNTIME_MODES } from './runtime-providers.mjs'
|
|
12
|
+
|
|
13
|
+
export { RUNTIME_MODES }
|
|
11
14
|
|
|
12
15
|
export const DEFAULT_WORKER_NAME = 'dsh-edge'
|
|
13
16
|
export const LOGIN_PROFILE = 'dsh-edge-install'
|
|
14
|
-
export const RUNTIME_MODES = Object.freeze({
|
|
15
|
-
direct: Object.freeze({
|
|
16
|
-
environment: '',
|
|
17
|
-
expectedShell: 'just-bash-direct',
|
|
18
|
-
label: 'Free — Direct Shell',
|
|
19
|
-
}),
|
|
20
|
-
isolated: Object.freeze({
|
|
21
|
-
environment: 'isolated',
|
|
22
|
-
expectedShell: 'just-bash-isolated',
|
|
23
|
-
label: 'Isolated — Dynamic Worker',
|
|
24
|
-
}),
|
|
25
|
-
})
|
|
26
|
-
|
|
27
17
|
const appDirectory = fileURLToPath(new URL('..', import.meta.url))
|
|
28
18
|
const require = createRequire(import.meta.url)
|
|
29
19
|
const WRANGLER_CLI = require.resolve('wrangler')
|
|
@@ -163,7 +153,7 @@ class R2SubscriptionUnavailableError extends Error {
|
|
|
163
153
|
export function accountChoices(mode, accounts, command = 'install') {
|
|
164
154
|
requireRuntimeMode(mode)
|
|
165
155
|
const choices = []
|
|
166
|
-
if (mode
|
|
156
|
+
if (!RUNTIME_MODES[mode].paid && command === 'install') {
|
|
167
157
|
choices.push({
|
|
168
158
|
value: 'temporary',
|
|
169
159
|
label: 'Temporary account — no Cloudflare login',
|
|
@@ -340,7 +330,7 @@ export function wranglerDeployArgs({
|
|
|
340
330
|
temporary = false,
|
|
341
331
|
}) {
|
|
342
332
|
requireRuntimeMode(mode)
|
|
343
|
-
if (temporary && mode
|
|
333
|
+
if (temporary && RUNTIME_MODES[mode].paid) {
|
|
344
334
|
throw new Error('Temporary accounts support only the Free direct runtime.')
|
|
345
335
|
}
|
|
346
336
|
const args = [
|
|
@@ -564,7 +554,7 @@ export async function installEdge({
|
|
|
564
554
|
if (temporary && command === 'upgrade') {
|
|
565
555
|
throw new Error('Temporary accounts cannot be upgraded before they are claimed.')
|
|
566
556
|
}
|
|
567
|
-
if (temporary && mode
|
|
557
|
+
if (temporary && RUNTIME_MODES[mode].paid) {
|
|
568
558
|
throw new Error('Temporary accounts support only the Free direct runtime.')
|
|
569
559
|
}
|
|
570
560
|
const account = temporary
|
|
@@ -646,7 +636,7 @@ export async function installEdge({
|
|
|
646
636
|
modeLabel: RUNTIME_MODES[mode].label,
|
|
647
637
|
accountLabel: temporary ? 'Temporary account' : account.name,
|
|
648
638
|
workerName,
|
|
649
|
-
paid: mode
|
|
639
|
+
paid: RUNTIME_MODES[mode].paid,
|
|
650
640
|
temporary,
|
|
651
641
|
attachmentStorage,
|
|
652
642
|
})
|
|
@@ -1261,7 +1251,7 @@ function pickEnvironment(environment, keys) {
|
|
|
1261
1251
|
}
|
|
1262
1252
|
|
|
1263
1253
|
function requireRuntimeMode(mode) {
|
|
1264
|
-
if (!
|
|
1254
|
+
if (!isRuntimeMode(mode)) {
|
|
1265
1255
|
throw new Error(`Unsupported runtime mode: ${String(mode)}`)
|
|
1266
1256
|
}
|
|
1267
1257
|
}
|
|
@@ -1329,7 +1319,7 @@ function formatDeployFailure(mode, result) {
|
|
|
1329
1319
|
: `Cloudflare did not accept the Worker upload${code === undefined ? '' : ` (code ${code})`}: ${firstError}`
|
|
1330
1320
|
}
|
|
1331
1321
|
const failure = `${detail} Run the command again with --verbose to inspect Wrangler output.`
|
|
1332
|
-
if (mode !==
|
|
1322
|
+
if (RUNTIME_MODES[mode]?.paid !== true) return failure
|
|
1333
1323
|
return `${failure}\nThe isolated runtime requires the Workers Paid plan (starting at $5/month). `
|
|
1334
1324
|
+ 'Enable Workers Paid for this account or install the Free direct runtime.'
|
|
1335
1325
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type RuntimeMode = 'direct' | 'isolated'
|
|
2
|
+
export type RuntimeProviderId = 'direct' | 'dynamic-worker'
|
|
3
|
+
export type RuntimeCapability = 'bash' | 'coding' | 'subprocess'
|
|
4
|
+
|
|
5
|
+
export const RUNTIME_PROVIDERS: Readonly<Record<RuntimeProviderId, Readonly<{
|
|
6
|
+
id: RuntimeProviderId
|
|
7
|
+
capabilities: readonly RuntimeCapability[]
|
|
8
|
+
plan: 'free' | 'paid'
|
|
9
|
+
shell: 'just-bash-direct' | 'just-bash-isolated'
|
|
10
|
+
}>>>
|
|
11
|
+
export const RUNTIME_MODES: Readonly<Record<RuntimeMode, Readonly<{
|
|
12
|
+
environment: string
|
|
13
|
+
expectedShell: 'just-bash-direct' | 'just-bash-isolated'
|
|
14
|
+
label: string
|
|
15
|
+
hint: string
|
|
16
|
+
paid: boolean
|
|
17
|
+
providers: readonly RuntimeProviderId[]
|
|
18
|
+
}>>>
|
|
19
|
+
export function runtimeModeChoices(): Array<{ value: RuntimeMode; label: string; hint: string }>
|
|
20
|
+
export function isRuntimeMode(mode: unknown): mode is RuntimeMode
|