{"ok":true,"value":{"id":"dsh-update-detector","name":"dsh-update-detector","version":"0.1.3","developer":"DeepSeek Harness","description":"检测上游 harness 更新，并驱动 update-status.json 状态机。","sha256":"85b53fe040df6616ce744445f1cfd7e794311650b1368275ca97978bff412434","byteSize":57409,"publishedAt":"2026-08-23T15:09:32.764Z","updatedAt":"2026-09-21T17:16:40.762Z","releasedAt":"2026-09-21T17:16:40.762Z","packageName":"dsh-update-detector","loaderId":"dsh-update-detector","changelog":"","readme":{"md":"# dsh-update-detector\n\nEnglish | [中文](README.zh.md)\n\nDetects Harness updates and serves `/dsh-update/` on the existing Web server. Version 0.1.2 is detect-only: it does not install updates or restart Harness.\n\n## Behavior\n\nA valid configuration schedules a startup check after two seconds and subsequent checks at `checkIntervalMinutes`. Opening the page reads status; its manual-check button requests a coalesced check. A check fetches from `origin` and compares commit ancestry. Fetch updates Git metadata, but the plugin never pulls, checks out, resets, stashes, installs, builds, or restarts Harness.\n\nThe default `stable` target accepts only `vX.Y.Z` and `dsh-vX.Y.Z` tags, without leading-zero components or prerelease suffixes. Annotated tags use their peeled commit. A checkout containing the release is not behind; a divergent history or an upstream with no stable tags is reported as unavailable. Branch tracking requires an explicit `ref`, such as `origin/master`.\n\nTracked changes and ordinary untracked files count as repository dirt. Existing executor states (`busy`, `preparing`, `ready`, `restarting`, `running`) remain read-only and block checks. The archived executor is an inert refusal stub with exit code 3; its LaunchAgent template must not be installed.\n\n## Configuration\n\nConfiguration is resolved once per plugin application: defaults, then Cordis `Config`, then `$DSH_HOME/update-config.json`. Unknown keys are ignored. Invalid values, malformed files, and unreadable configuration produce visible problems and disable checks. An explicitly invalid checkout path never selects a different repository. Reapply the plugin or restart the service after changing configuration.\n\n| Key | Accepted Value | Default |\n| --- | --- | --- |\n| `checkIntervalMinutes` | Number from 1 to 35791 | `360` |\n| `maxOutputBytes` | Integer from 1 to 16777216, per command stream | `1048576` |\n| `graceMs` | Integer from 1 to 60000, termination grace in milliseconds | `1000` |\n| `harnessPath` | Existing local Harness checkout | Local checkout discovery |\n| `target` | `stable` or `branch` | `stable` |\n| `ref` | Explicit Git ref for branch tracking; cannot start with `-` | Unset |\n| `notify` | Boolean, reserved; notifications are not implemented | `true` |\n\nThe plugin requires `webServer`, `connection`, and `subprocess`. Commands use the injected managed subprocess service and its scrubbed environment. Fetch and remote-tag queries have 60-second deadlines; local probes have five-second deadlines. Output truncation fails the command instead of comparing a retained tail. Runner status codes are `-1` for execution failure, `-2` for cancellation or timeout, and `-3` for output overflow.\n\nDisposal stops scheduling, deregisters page and RPC handlers, cancels active commands, and waits for process-tree exit and asynchronous deregistration. Concurrent disposers await the same completion. Cancelled checks cannot write durable status after teardown.\n\n## HTTP and RPC\n\nThe page supports GET and HEAD at `/dsh-update`, `/dsh-update/`, and `/dsh-update/index.html`. Connection registers the loopback-only `/dsh-update` RPC channel with its trusted-Host and cross-origin checks.\n\n| Endpoint | Behavior |\n| --- | --- |\n| `status` | Durable status plus a read-only Git dirt probe; invalid configuration skips the probe |\n| `readiness` | Configuration, problems, and capabilities without running Git |\n| `check` | Coalesced fetch and comparison; invalid configuration, missing checkout, and legacy busy state are refused |\n| `update`, `restart`, `apply`, `kill` | Explicit not-supported errors |\n\nRPC requests POST to `/dsh-update/<endpoint>` with JSON `{ \"type\": \"client-request\", \"rpcId\": \"request-id\", \"method\": \"<endpoint>\", \"payload\": {} }`. Responses use `{ \"type\": \"server-response\", \"rpcId\": \"request-id\", \"result\": ... }`. Status persists in `$DSH_HOME/update-status.json`; existing status fields and unknown legacy fields are preserved.\n\n## Development\n\nRun `node --test 'tests/*.test.mjs'`. Tests use temporary homes, fake Git responses, and explicit runner injection. They cover ancestry decisions, configuration rejection, durable state, output bounds, independently gated process-tree exit, repeated disposal, and page/RPC registration. Tests do not fetch the real Harness repository or write its user profile.\n\n## Known Limitations and Deferred Work\n\nThe plugin assumes a local checkout and matching host subprocess provider, with `/usr/bin/git` as its default executable. It does not provide an update executor, notifications, or rollback of Harness itself. Replacing plugin files does not prove that the running Node process loaded them; service activation requires a verified reload or restart.\n\n## Model Experience\n\nNone, as this plugin contributes no model prompt, tool schema, or model-visible messages.\n\n#### KV Cache effect\n\nThe plugin does not alter model requests or their reusable prefixes.\n","zhMd":"# dsh-update-detector\n\n[English](README.md) | 中文\n\n检测 Harness 更新，并在既有 Web 服务上提供 `/dsh-update/`。0.1.2 仅负责检测，不安装更新，也不重启 Harness。\n\n## 行为\n\n配置有效时，启动两秒后进行首次检查，随后按 `checkIntervalMinutes` 定时检查。打开页面只读取状态；手动检查按钮请求一次可合并的检查。检查从 `origin` 获取提交，并比较祖先关系。Fetch 会更新 Git 元数据，但插件不会 pull、checkout、reset、stash、安装、构建或重启 Harness。\n\n默认 `stable` 目标仅接受 `vX.Y.Z` 和 `dsh-vX.Y.Z` 标签，不接受版本分量前导零或预发布后缀。注释标签使用 peeled 提交。已经包含目标发布的本地提交不算落后；历史分叉或上游没有稳定标签时，会明确报告无法比较。跟踪分支必须显式配置 `ref`，例如 `origin/master`。\n\n已跟踪文件的修改和普通未跟踪文件都计入本地改动。遗留执行器状态 `busy`、`preparing`、`ready`、`restarting`、`running` 保持只读，并阻止检查。归档执行器是退出码为 3 的拒绝桩；不可安装其 LaunchAgent 模板。\n\n## 配置\n\n每次应用插件时仅解析一份配置：内置默认值、Cordis `Config`、`$DSH_HOME/update-config.json` 依次覆盖。未知键被忽略。非法值、畸形文件或不可读配置会产生可见问题，并禁用检查。显式配置的仓库路径非法时，不会改选另一个仓库。修改配置后需要重新应用插件或重启服务。\n\n| 键 | 有效值 | 默认值 |\n| --- | --- | --- |\n| `checkIntervalMinutes` | 1 到 35791 的数值 | `360` |\n| `maxOutputBytes` | 1 到 16777216 的整数，每条命令单流的字节上限 | `1048576` |\n| `graceMs` | 1 到 60000 的整数，终止宽限毫秒数 | `1000` |\n| `harnessPath` | 存在的本地 Harness 仓库 | 探测本地仓库 |\n| `target` | `stable` 或 `branch` | `stable` |\n| `ref` | 分支跟踪所需的显式 Git 引用，不能以 `-` 开头 | 未设置 |\n| `notify` | 布尔值，保留字段；尚未实现通知 | `true` |\n\n插件依赖 `webServer`、`connection` 和 `subprocess`。命令通过注入的受管子进程服务执行，沿用该服务清理后的环境。Fetch 和远端标签查询的超时为 60 秒，本地探测为 5 秒。输出被截断时，命令直接失败，不会拿保留的尾部内容参与比较。执行器返回码 `-1` 表示执行失败，`-2` 表示取消或超时，`-3` 表示输出超限。\n\n卸载时停止调度、注销页面及 RPC、中止在途命令，并等待进程树退出及异步注销完成。并发卸载调用等待同一次完成。已取消的检查不能在卸载完成后写入持久状态。\n\n## HTTP 与 RPC\n\n页面在 `/dsh-update`、`/dsh-update/`、`/dsh-update/index.html` 支持 GET 和 HEAD。Connection 注册仅允许本机访问的 `/dsh-update` RPC 通道，并执行可信 Host 及跨源检查。\n\n| 端点 | 行为 |\n| --- | --- |\n| `status` | 持久状态加只读 Git 改动探测；配置非法时跳过探测 |\n| `readiness` | 配置、问题及能力摘要，不执行 Git |\n| `check` | 合并的 fetch 和比较；拒绝非法配置、缺失仓库和遗留忙碌状态 |\n| `update`、`restart`、`apply`、`kill` | 明确返回不支持错误 |\n\nRPC 向 `/dsh-update/<endpoint>` POST JSON：`{ \"type\": \"client-request\", \"rpcId\": \"request-id\", \"method\": \"<endpoint>\", \"payload\": {} }`。响应为 `{ \"type\": \"server-response\", \"rpcId\": \"request-id\", \"result\": ... }`。状态保存在 `$DSH_HOME/update-status.json`，保留既有字段及未知的遗留字段。\n\n## 开发\n\n运行 `node --test 'tests/*.test.mjs'`。测试使用临时主目录、模拟 Git 响应和显式注入的执行器，覆盖祖先关系、配置拒绝、持久状态、输出限制、独立控制的进程树退出、重复卸载及页面与 RPC 注册。不获取真实 Harness 仓库的更新，也不修改真实用户配置。\n\n## 已知限制与后续工作\n\n插件要求本地仓库及匹配的主机子进程服务，默认可执行文件为 `/usr/bin/git`。不提供更新执行器、桌面通知或 Harness 自身的回退。替换插件文件不代表运行中的 Node 进程已经加载新代码；启用新代码需要经过验证的重新加载或服务重启。\n\n## 模型体验\n\n插件不提供模型提示词、工具定义或模型可见消息。\n\n#### KV 缓存影响\n\n插件不改变模型请求或可复用的请求前缀。\n"},"versions":[{"version":"0.1.3","changelog":"","sha256":"85b53fe040df6616ce744445f1cfd7e794311650b1368275ca97978bff412434","byteSize":57409,"releasedAt":"2026-09-21T17:16:40.762Z","reviewStatus":"approved"},{"version":"0.1.2","changelog":"0.1.2 安全改造：只读检测 + 手动检查。移除自动更新执行链；update/restart/apply/kill 端点明确 not-supported；配置统一分层校验（fail-visible）；检查间隔上限 1..35791 分钟；分支目标按祖先关系判定；非构造型 apply 使返回的清理函数被 Cordis 收集，fiber.dispose 统一反注册页面路由与 RPC。","sha256":"096bb3b61ccd96849a323d7b5bf132121ea258e7f8541bb016bc7a53983f8a79","byteSize":56758,"releasedAt":"2026-09-08T09:50:27.484Z","reviewStatus":"approved"},{"version":"0.1.1","changelog":"Catalog distribution of the update detector with vendored lib and executor.","sha256":"e198402ef3953333a12506153a4b6e42c6d81f2e51ae0adc731c79418ed80a33","byteSize":11809,"releasedAt":"2026-08-23T15:09:32.764Z","reviewStatus":"approved"}],"urls":{"html":"https://addon.dshdo.com/plugins/dsh-update-detector","markdown":"https://addon.dshdo.com/plugins/dsh-update-detector.md","json":"https://addon.dshdo.com/v1/plugins/dsh-update-detector","tarball":"https://addon.dshdo.com/v1/plugins/dsh-update-detector/versions/0.1.3/tarball"}}}