dsh-edge 0.23.0-alpha.1 → 0.23.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.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/package.json +1 -1
- package/worker/direct/index.js +468 -468
- package/worker/isolated/index.js +170 -170
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: f888e62dc861742f9d6ec768f9991bc48d407d9a
|
|
6
|
+
README.zh.md: c2d8c137c32688efdde7a3f6327f40929daa4a6e
|
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, glob/grep, goal, todo, 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) is offered by the same runtime, but only to sessions started in the upstream `ptc` agent preset (PTC mode), which isolated deployments offer under its upstream id so the Web client shows its built-in bilingual name. That preset presents every tool through the generated SDK and, as upstream does, does not offer `workflow`, because `run_code` is its only orchestration surface. The default upstream `standard` preset (Standard mode; sessions recorded under the earlier `dsh-edge` id read as `standard`) presents tools natively and keeps `workflow`. As upstream, Settings → Agent presets writes the `agent-presets` settings namespace to choose which offered preset new sessions start on. In PTC mode, 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. `glob` and `grep` keep upstream `dsh-tool-fs-search`'s names, schemas, result text, search cards, and spill of results over 100 paths or 250 matches, but Workers cannot spawn its ripgrep binary, so Edge runs them over the VFS: both skip VCS metadata, `grep` also skips hidden files, binary files, and files over 4 MiB, and neither applies `.gitignore`. `grep` patterns use RE2 syntax (no lookaround or backreferences) through re2js, which matches in linear time, so a pathological pattern cannot stall the Durable Object. A search walks at most 20,000 entries, and `grep` collects at most 20,000 matching lines or 20 MB of their text; past a cap it fails and asks for a narrower path or pattern. Glob syntax that ripgrep 15 rejects (an unclosed `[` or `{`, a reversed range such as `[z-a]`, a dangling `\`) fails as an invalid pattern; nested alternates such as `a{b,{c,d}}` work. A search checks for cancellation before and after each directory listing, so the 30-second tool timeout stops a long walk. As upstream, the file observation policy (`dsh-fs-observation-policy`) guards them: `write` may not overwrite a file the session has not read, `edit` requires a prior read, and a file changed since it was read (by `bash` or the Linux container, for example) fails as stale until it is read again; a restarted session starts with no reads recorded. Goal tools (`ToolGoal`) composed directly with `GoalService` as upstream cordis plugins. The upstream `todo_write` tool (`dsh-tool-todo`) keeps the session's task list, with several tasks allowed in progress as in upstream's composition; its `todos` projection drives the Web client's todo dock. The upstream `present` tool (`dsh-tool-present`) declares workspace files as a turn's deliverables, which the Web client shows as file cards with a sidebar preview; the Edge has no desktop, so it answers the cards' Host check (`/api/present.host`) as unavailable and they offer no native opening. As upstream, `dsh-agent-instructions` loads `AGENTS.md` and `CLAUDE.md` (and their `.local.md` overlays) from the project root (the nearest ancestor directory containing `.git`, or else the session's working directory) down to the working directory, through the workspace VFS, into a 64 KiB baseline message before the first request; a `read`, `write`, or `edit` that reaches a deeper directory adds its instructions to the next request. Workers have no home directory, so the user-global file is `/.dsh/AGENTS.md`. Skill tool via `SkillRegistry`. As upstream `dsh-skill-filesystem`, skills are `<name>/SKILL.md` or `<name>.md` files with `name` and `description` frontmatter under the project's `.dsh/skills` and `.agents/skills` and the user roots `/.dsh/skills` and `/.agents/skills` (Workers have no home directory), read through the workspace VFS, up to 100 entries per root and 64 KiB per skill file; an added or edited skill applies from the next turn. Skills stored through the owner API `GET/PUT/DELETE /api/skills` (`EdgeSkillProvider`, DO KV) rank below them. 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. |
|
|
155
|
+
| Other tools | Web Search, filesystem editor tools, MCP, skills, workflows, jobs, and subagents | Search, file, glob/grep, goal, todo, 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) is offered by the same runtime, but only to sessions started in the upstream `ptc` agent preset (PTC mode), which isolated deployments offer under its upstream id so the Web client shows its built-in bilingual name. That preset presents every tool through the generated SDK and, as upstream does, does not offer `workflow`, because `run_code` is its only orchestration surface. The default upstream `standard` preset (Standard mode; sessions recorded under the earlier `dsh-edge` id read as `standard`) presents tools natively and keeps `workflow`. As upstream, Settings → Agent presets writes the `agent-presets` settings namespace to choose which offered preset new sessions start on. In PTC mode, 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. `glob` and `grep` keep upstream `dsh-tool-fs-search`'s names, schemas, result text, search cards, and spill of results over 100 paths or 250 matches, but Workers cannot spawn its ripgrep binary, so Edge runs them over the VFS: both skip VCS metadata, `grep` also skips hidden files, binary files, and files over 4 MiB, and neither applies `.gitignore`. `grep` patterns use RE2 syntax (no lookaround or backreferences) through re2js, which matches in linear time, so a pathological pattern cannot stall the Durable Object. A search walks at most 20,000 entries, and `grep` collects at most 20,000 matching lines or 20 MB of their text; past a cap it fails and asks for a narrower path or pattern. Glob syntax that ripgrep 15 rejects (an unclosed `[` or `{`, a reversed range such as `[z-a]`, a dangling `\`) fails as an invalid pattern; nested alternates such as `a{b,{c,d}}` work. A search checks for cancellation before and after each directory listing, so the 30-second tool timeout stops a long walk. As upstream, the file observation policy (`dsh-fs-observation-policy`) guards them: `write` may not overwrite a file the session has not read, `edit` requires a prior read, and a file changed since it was read (by `bash` or the Linux container, for example) fails as stale until it is read again; a restarted session starts with no reads recorded. Goal tools (`ToolGoal`) composed directly with `GoalService` as upstream cordis plugins. The upstream `todo_write` tool (`dsh-tool-todo`) keeps the session's task list, with several tasks allowed in progress as in upstream's composition; its `todos` projection drives the Web client's todo dock. The upstream `present` tool (`dsh-tool-present`) declares workspace files as a turn's deliverables, which the Web client shows as file cards with a sidebar preview; the Edge has no desktop, so it answers the cards' Host check (`/api/present.host`) as unavailable and they offer no native opening. As upstream, `dsh-agent-instructions` loads `AGENTS.md` and `CLAUDE.md` (and their `.local.md` overlays) from the project root (the nearest ancestor directory containing `.git`, or else the session's working directory) down to the working directory, through the workspace VFS, into a 64 KiB baseline message before the first request; a `read`, `write`, or `edit` that reaches a deeper directory adds its instructions to the next request. Workers have no home directory, so the user-global file is `/.dsh/AGENTS.md`. Skill tool via `SkillRegistry`. As upstream `dsh-skill-filesystem`, skills are `<name>/SKILL.md` or `<name>.md` files with `name` and `description` frontmatter under the project's `.dsh/skills` and `.agents/skills` and the user roots `/.dsh/skills` and `/.agents/skills` (Workers have no home directory), read through the workspace VFS, up to 100 entries per root and 64 KiB per skill file; an added or edited skill applies from the next turn, and the `/` menu of a session opened after the change lists it; as upstream, the Web client keeps an open session's `/` list until the page reloads. Skills stored through the owner API `GET/PUT/DELETE /api/skills` (`EdgeSkillProvider`, DO KV) rank below them. 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 a 64 MiB, 512 KiB-chunked DO backend for new and pre-attachment deployments, or in private R2 for deployments already pinned to it; 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. The upstream `/goal` command (`dsh-command-goal`) shows, sets, edits, pauses, resumes, or clears the session's goal. Every goal round runs inside an Edge turn, with its workspace, deadline, and live events: a turn stays open while upstream's round driver queues the next round, and a call that arms a goal outside a turn (`/goal`, GoalBar Resume) runs inside a new one. |
|
|
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. Upstream image offload (`dsh-compaction-image-offload`) keeps a turn going when its images exceed the route's budget (600 images per request by default): it marks the oldest occurrences offloaded with an `image/offload` session event and the request is retried. |
|
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、文件、glob/grep、goal、todo、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 模式)由同一运行时提供,但只提供给以上游 `ptc` agent 预设(PTC 模式)开始的会话。isolated 部署沿用上游 id 提供该预设,因此 Web 客户端显示其内置的双语名称。该预设通过生成的 SDK 呈现全部工具,并与上游一样不提供 `workflow`,因为 `run_code` 是它唯一的编排方式。默认使用上游的 `standard` 预设(标准模式;以早先 `dsh-edge` id 记录的会话按 `standard` 读取),以原生方式呈现工具,并保留 `workflow`。与上游一致,Settings → Agent presets 写入 `agent-presets` 设置命名空间,从可用预设中选择新会话的起始预设。在 PTC 模式下,每个程序先用 sucrase 去除类型,再在独立 Dynamic Worker 中运行,受 30 秒 `cpuMs` 上限约束且无出站网络;其中的 `tools.*` 调用经 RPC 桥回到 Durable Object,由其限制为每次运行最多 200 次(每次都是一次写入 session 事件的嵌套工具派发)、参数最多 256 KiB、单次结果最多 2 MiB,嵌套调用仍走审批。文件工具(read/write/edit/read_image)通过 `EdgeFileSystem` 适配 Computer VFS。`glob` 和 `grep` 保持上游 `dsh-tool-fs-search` 的工具名、参数结构、结果文本、搜索卡片,以及超过 100 条路径或 250 条匹配时把完整结果另存为文件;但 Workers 无法启动它所需的 ripgrep 程序,所以 Edge 在 VFS 上运行它们:两者都跳过版本控制元数据目录,`grep` 还跳过隐藏文件、二进制文件和超过 4 MiB 的文件,两者都不应用 `.gitignore`。`grep` 的正则使用 RE2 语法(不支持环视和反向引用),由 re2js 以线性时间匹配,所以病态正则不会卡住 Durable Object。一次搜索最多遍历 20,000 个条目,`grep` 最多收集 20,000 行匹配或 20 MB 文本;超出上限时会失败,并提示缩小路径或模式。ripgrep 15 会拒绝的 glob 语法(未闭合的 `[` 或 `{`、`[z-a]` 这样的反向范围、末尾悬空的 `\`)会作为无效模式报错;`a{b,{c,d}}` 这样的嵌套分组可以使用。搜索在每次列出目录前后检查是否已取消,所以 30 秒的工具超时能中止耗时的遍历。与上游一致,文件观察策略(`dsh-fs-observation-policy`)为它们把关:`write` 不能覆盖本会话尚未读过的文件,`edit` 必须先读过目标文件,读取之后被改动过的文件(例如被 `bash` 或 Linux 容器改动)在重新读取之前会作为过期而失败;会话重启后不保留读取记录。Goal 工具(`ToolGoal`)作为上游 cordis 插件直接与 `GoalService` 组合。上游 `todo_write` 工具(`dsh-tool-todo`)维护会话的任务列表,与上游的组合一样允许多个任务同时进行;它的 `todos` projection 驱动 Web 客户端的待办面板。上游 `present` 工具(`dsh-tool-present`)把工作区文件声明为本 turn 的交付物,Web 客户端将其显示为可在侧边栏预览的文件卡片;Edge 没有桌面,所以对卡片的 Host 检查(`/api/present.host`)回答不可用,卡片不提供用本机应用打开。与上游一样,`dsh-agent-instructions` 在第一次请求前,通过工作区 VFS 从项目根目录(最近一个包含 `.git` 的上级目录,没有则为会话工作目录)到工作目录逐级加载 `AGENTS.md` 和 `CLAUDE.md`(以及它们的 `.local.md` 覆盖文件),合成一条不超过 64 KiB 的基线消息;`read`、`write` 或 `edit` 进入更深的目录时,下一次请求会加入该目录的说明。Workers 没有用户主目录,所以用户全局文件是 `/.dsh/AGENTS.md`。Skill 工具通过 `SkillRegistry` 提供。与上游 `dsh-skill-filesystem` 一致,skill 是带 `name` 和 `description` frontmatter 的 `<name>/SKILL.md` 或 `<name>.md` 文件,位于项目的 `.dsh/skills`、`.agents/skills`,以及用户目录 `/.dsh/skills`、`/.agents/skills`(Workers 没有用户主目录),通过工作区 VFS 读取,每个目录最多读取 100 个条目,每个 skill 文件不超过 64 KiB;新增或修改的 skill 从下一个 turn
|
|
155
|
+
| Other tools | Web Search、filesystem editor tools、MCP、skills、workflows、jobs 和 subagents | Search、文件、glob/grep、goal、todo、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 模式)由同一运行时提供,但只提供给以上游 `ptc` agent 预设(PTC 模式)开始的会话。isolated 部署沿用上游 id 提供该预设,因此 Web 客户端显示其内置的双语名称。该预设通过生成的 SDK 呈现全部工具,并与上游一样不提供 `workflow`,因为 `run_code` 是它唯一的编排方式。默认使用上游的 `standard` 预设(标准模式;以早先 `dsh-edge` id 记录的会话按 `standard` 读取),以原生方式呈现工具,并保留 `workflow`。与上游一致,Settings → Agent presets 写入 `agent-presets` 设置命名空间,从可用预设中选择新会话的起始预设。在 PTC 模式下,每个程序先用 sucrase 去除类型,再在独立 Dynamic Worker 中运行,受 30 秒 `cpuMs` 上限约束且无出站网络;其中的 `tools.*` 调用经 RPC 桥回到 Durable Object,由其限制为每次运行最多 200 次(每次都是一次写入 session 事件的嵌套工具派发)、参数最多 256 KiB、单次结果最多 2 MiB,嵌套调用仍走审批。文件工具(read/write/edit/read_image)通过 `EdgeFileSystem` 适配 Computer VFS。`glob` 和 `grep` 保持上游 `dsh-tool-fs-search` 的工具名、参数结构、结果文本、搜索卡片,以及超过 100 条路径或 250 条匹配时把完整结果另存为文件;但 Workers 无法启动它所需的 ripgrep 程序,所以 Edge 在 VFS 上运行它们:两者都跳过版本控制元数据目录,`grep` 还跳过隐藏文件、二进制文件和超过 4 MiB 的文件,两者都不应用 `.gitignore`。`grep` 的正则使用 RE2 语法(不支持环视和反向引用),由 re2js 以线性时间匹配,所以病态正则不会卡住 Durable Object。一次搜索最多遍历 20,000 个条目,`grep` 最多收集 20,000 行匹配或 20 MB 文本;超出上限时会失败,并提示缩小路径或模式。ripgrep 15 会拒绝的 glob 语法(未闭合的 `[` 或 `{`、`[z-a]` 这样的反向范围、末尾悬空的 `\`)会作为无效模式报错;`a{b,{c,d}}` 这样的嵌套分组可以使用。搜索在每次列出目录前后检查是否已取消,所以 30 秒的工具超时能中止耗时的遍历。与上游一致,文件观察策略(`dsh-fs-observation-policy`)为它们把关:`write` 不能覆盖本会话尚未读过的文件,`edit` 必须先读过目标文件,读取之后被改动过的文件(例如被 `bash` 或 Linux 容器改动)在重新读取之前会作为过期而失败;会话重启后不保留读取记录。Goal 工具(`ToolGoal`)作为上游 cordis 插件直接与 `GoalService` 组合。上游 `todo_write` 工具(`dsh-tool-todo`)维护会话的任务列表,与上游的组合一样允许多个任务同时进行;它的 `todos` projection 驱动 Web 客户端的待办面板。上游 `present` 工具(`dsh-tool-present`)把工作区文件声明为本 turn 的交付物,Web 客户端将其显示为可在侧边栏预览的文件卡片;Edge 没有桌面,所以对卡片的 Host 检查(`/api/present.host`)回答不可用,卡片不提供用本机应用打开。与上游一样,`dsh-agent-instructions` 在第一次请求前,通过工作区 VFS 从项目根目录(最近一个包含 `.git` 的上级目录,没有则为会话工作目录)到工作目录逐级加载 `AGENTS.md` 和 `CLAUDE.md`(以及它们的 `.local.md` 覆盖文件),合成一条不超过 64 KiB 的基线消息;`read`、`write` 或 `edit` 进入更深的目录时,下一次请求会加入该目录的说明。Workers 没有用户主目录,所以用户全局文件是 `/.dsh/AGENTS.md`。Skill 工具通过 `SkillRegistry` 提供。与上游 `dsh-skill-filesystem` 一致,skill 是带 `name` 和 `description` frontmatter 的 `<name>/SKILL.md` 或 `<name>.md` 文件,位于项目的 `.dsh/skills`、`.agents/skills`,以及用户目录 `/.dsh/skills`、`/.agents/skills`(Workers 没有用户主目录),通过工作区 VFS 读取,每个目录最多读取 100 个条目,每个 skill 文件不超过 64 KiB;新增或修改的 skill 从下一个 turn 起生效,变更后打开的会话的 `/` 菜单也会列出它;与上游一致,Web 客户端在页面刷新前保留已打开会话的 `/` 列表。通过 owner 接口 `GET/PUT/DELETE /api/skills` 存储的 skill(`EdgeSkillProvider`,DO KV)优先级低于它们。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 存入新部署与 pre-attachment 部署使用的 64 MiB、按 512 KiB 分块的 DO backend,或存入已固定使用私有 R2 的部署的 R2;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 状态。上游的 `/goal` 命令(`dsh-command-goal`)可以查看、设定、编辑、暂停、恢复或清除会话的目标。每一轮目标都在 Edge 的 turn 内运行,带有工作区、时限和实时事件:上游的轮次驱动排入下一轮期间,turn 保持打开;在 turn 之外启用目标的调用(`/goal`、GoalBar 的恢复)在一个新的 turn 内运行。 |
|
|
158
158
|
| Context compaction | Token 计量、自动压缩和 session 标题生成 | 复用 | 直接安装上游 cordis 插件。上下文压缩、token 计量、工具结果修剪和自动 session 标题生成原样运行。上游的图片卸载(`dsh-compaction-image-offload`)在请求中的图片超出路由预算(默认每个请求 600 张)时让 turn 继续:它用一条 `image/offload` 会话事件把最早的图片标记为已卸载,然后重试请求。 |
|
package/package.json
CHANGED