dsh-agy-link 0.6.18 → 0.6.22
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/CHANGELOG.md +160 -0
- package/README.md +5 -2
- package/dist/cli-image.mjs +30527 -28606
- package/dist/client.js +5770 -4264
- package/dist/index.js +13999 -10937
- package/docs/ARCHITECTURE.md +70 -0
- package/docs/CONFIGURATION.md +11 -2
- package/docs/DEVELOPMENT.md +27 -0
- package/docs/README.en.md +1 -1
- package/docs/REFACTORING-PLAN.md +51 -0
- package/docs/REFACTORING-RESULTS.md +52 -0
- package/docs/adr/001-layering.md +25 -0
- package/docs/adr/002-provider-pipeline.md +26 -0
- package/docs/adr/003-error-taxonomy.md +18 -0
- package/docs/adr/004-ui-kit.md +18 -0
- package/package.json +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,165 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.22 (2026-11-13)
|
|
4
|
+
|
|
5
|
+
### English
|
|
6
|
+
|
|
7
|
+
- **Fix(mirror, ptc): drop the top-level `return` from the replay program (fixes #103).** In Code/PTC Mode the generated `run_code` wrapper emitted `return await tools['agy_tool'](...)`; DSH's REPL validator rejects a top-level `return` with `Return statement is not allowed here`, so *every* mirrored agy tool step failed. The wrapper now ends with `await tools['agy_tool'](...)` (final expression), which evaluates in both REPL and function-body runtimes. `parseMirrorInvocation` still accepts legacy `return await` programs; regression test pins both shapes. Thanks to @lzh-marble for the precise report and @fall2wish for PR #104.
|
|
8
|
+
- **Feat(client): hide the header status badge and the per-reply translate button (fixes #105).** Two opt-out switches — `showHeaderBadge` and `showTranslateAction` (default `true`) — are available in the settings panel, via `DSH_AGY_SHOW_HEADER_BADGE` / `DSH_AGY_SHOW_TRANSLATE_ACTION`, and through the guarded `/config` endpoint. The `/status` snapshot feeds them into a single `isUiVisible()` rule; only an explicit `false` hides anything, so a missing/older status payload never makes the UI blink out. On narrow viewports (≤680px) the badge text is hidden by CSS, leaving just the status dot. Translation cards, `/tsl` and auto-translate are unaffected. Covered by config-precedence, HTTP-contract, SSR, jsdom and four-locale dictionary tests.
|
|
9
|
+
- **Fix(pool): an explicit `home` argument now wins over `DSH_STATE_DIR`.** `defaultPoolDir(home)` used to return the parent process's state dir whenever the env var was set, breaking isolated-account path recovery (and the regression test in any environment that exports `DSH_STATE_DIR`). Production callers pass no argument and keep using the state dir.
|
|
10
|
+
- **Fix(transport): the 30s route deadline no longer kills slow translations (code-review blocker).** `/translate` fronts a full agy turn (`translateTimeoutMs` defaults to 120s, medium takes 20–45s); with the general deadline the host answered 504 first and the exactly-once `sendJson` then discarded the real 200. The route now uses `longRouteTimeout(cfg.translateTimeoutMs)` (job budget + 15s slack). `sendJson` swallows aborted-socket write errors so a late timeout callback cannot crash the host, and the manual quota-refresh dedupe entry now belongs to the real work (90s hard cap) instead of a 30s race that let a second `agy /usage` pipeline overlap. Fake-timer regression tests cover both.
|
|
11
|
+
- **Fix(models): a failed catalog discovery no longer self-excites `listModels` (fixes #106).** With an active pool account, every `listModels()` called `forceRefreshAndNotify()`, which unconditionally emitted `llm/adapters-updated`; DSH's browser answered by re-reading the model catalog, closing a `listModels → refresh → announce → listModels` loop. Discovery failure never populated the per-account catalog, so the loop never converged (one `agy models` spawn per cycle). Read paths now use the new throttled `ensureAccountCatalog()` (change-only announcements, per-account 60s retry stamps), and `forceRefreshAndNotify()` no longer announces a failed first discovery while keeping account-switch semantics. A regression test reproduces the browser feedback loop and proves 20 reads → 1 probe → 0 announcements. Thanks to @Rey50 for the analysis and offline reproduction.
|
|
12
|
+
- **Fix(runtime): the idle watchdog no longer kills a healthy child after a blocked host event loop.** libuv runs the timers phase before the poll phase, so an expired watchdog could fire before queued stdout/stderr from an actively-writing child was delivered — a false timeout that also made the two keep-alive tests flake under a fully parallel `npm test` (the Publish gate). One short grace (`WATCHDOG_GRACE_MS`, capped at the run's own idle budget) lets that output re-arm the watchdog; a deterministic test blocks the loop on purpose and asserts the run survives.
|
|
13
|
+
- **Fix(console): "同步中" no longer spins forever — every request now has a hard deadline.**
|
|
14
|
+
- Three independent causes stacked: host routes were bare `void (async () => …)()` IIFEs (a thrown dependency became an unhandled rejection and **no HTTP response at all**), `refresh-quota` awaited a 20s `agy /usage` spawn plus several REST calls before answering, and browser writes had no timeout (only the 3s status poll did).
|
|
15
|
+
- `runRoute()` in `respond.ts` is now the single guard for all 23 async routes: a rejection returns 500, a hang past `ROUTE_TIMEOUT_MS` returns 504, and `sendJson` is exactly-once so a late body cannot write a second head. No duplicated per-route error handling.
|
|
16
|
+
- `refresh-quota` answers immediately with `pending: true` and runs the refresh in the background (deduped per account, with its own deadline so a hung pipeline cannot block future syncs). The existing 3s status poll delivers fresh numbers; the toast now says "syncing" instead of claiming "refreshed".
|
|
17
|
+
- Client `postJson`/`getJson` share one `timedSignal()` helper and a `useBusyAction()` watchdog: no busy flag can outlive `WRITE_TIMEOUT_MS + 5s`. All timeouts live in `src/common/timeouts.ts`.
|
|
18
|
+
- **Fix(models): one source of truth for models & thinking levels — the DSH picker now matches agy exactly, with zero duplicate definitions.**
|
|
19
|
+
- **`xhigh` no longer leaks in as a fake model.** agy 1.5.7 lists `gemini-4-hydrogen-xhigh`; the fold only knew `low/medium/high`, so DSH showed **both** `Gemini 4 Hydrogen` and `Gemini 4 Hydrogen (XHigh)` as separate models. Effort suffixes now come from `agy --help` (`low|medium|high|xhigh|max`) and are matched longest-first, so Hydrogen is ONE model with four levels, `xhigh` rendered as **Extra** (agy's own picker label).
|
|
20
|
+
- **The catalog is agy's catalog.** Fallback lineup refreshed to `agy models` 1.5.7 (adds `gemini-4-hydrogen`, `gemini-pro-orchestrator-g1-pro`; drops the retired Claude 4.6 line and `gemini-4-carbon`, which agy lists as *Unavailable*). Folded entries are now emitted in `agy models`' own order, so Orchestrator sits third, not last. A regression test replays the verbatim 1.5.7 output and asserts the fallback line-up is byte-identical to discovery.
|
|
21
|
+
- **Zero-redundancy vocabulary.** `src/common/reasoning.ts` is now the only definition of the effort list/labels/suffix parsing; `src/common/model-lineup.ts` the only place concrete model ids live. The settings default-effort buttons, the translate/image effort dropdowns, the model-visibility chips and `agy_ask`'s help text are all derived from the live catalog — the four independent hardcoded `low/medium/high` copies are gone. The defaults dropdown now offers `Extra` because the catalog exposes it.
|
|
22
|
+
- `agy_ask`: a level written into the model word (`"gemini-4-hydrogen extra"`) is now honoured as `--effort` instead of being silently dropped.
|
|
23
|
+
- **Fix(release): publishing now retries transient registry failures and verifies the version actually lands.**
|
|
24
|
+
- v0.6.19 and v0.6.20 both got GitHub Releases that were never installable: a single transient `404 Not Found - PUT https://registry.npmjs.org/dsh-agy-link` killed `npm publish`, and nothing checked whether the version was readable. v0.6.21 succeeded minutes later with the same token.
|
|
25
|
+
- `scripts/publish-retry.mjs` now: skips an already-published version (idempotent re-runs), retries only transient errors with backoff, fails fast on fatal auth/version errors, and polls `npm view <name>@<version> version` after a successful publish. Slow registry propagation (2–6 min observed) is a WARNING, not a failed run; `PUBLISH_STRICT_VERIFY=1` makes it fatal for canaries. Publish workflow uses the wrapper.
|
|
26
|
+
- 8 unit tests cover classification, retry/exhaustion, fatal fast-fail, idempotency, and post-publish verification.
|
|
27
|
+
- **Fix(test): widen the watchdog keep-alive tests' timing margin.** Two `proxy-keychain` tests timed out at 800ms whenever a fully parallel `npm test` starved the parent event loop; they are a Publish gate, so the flake could block releases. Child activity now outlives a 2000ms idle budget with the same keep-alive semantics. Full suite: 1028/1028.
|
|
28
|
+
- **Feature: subagent activity streams live into DSH, and local file links open in the native right Sidebar.**
|
|
29
|
+
- **Live subagent progress.** New `src/features/subagent/tracker.ts` follows agy's `brain/<conversationId>/.system_generated/` tree while a run is active: it discovers every `subagents/*.json` descriptor (nesting included), then tails each worker's `transcript.jsonl` and emits one `stepKind: 'subagent'` event per tool call and per planner milestone. A 40-minute delegation no longer looks like a single frozen `invoke_subagent` card — the reasoning channel shows which file each worker reads or edits, which command it runs, which concept art it generates. Every emitted event also refreshes the idle watchdog, because a worker writing to disk is real progress.
|
|
30
|
+
- **Bounded tailing.** Each poll reads only the bytes appended since the previous one and buffers a half-written trailing line, so an hours-long transcript costs one small read per tick instead of a full re-read and re-parse.
|
|
31
|
+
- **Honest failure reporting.** Unexpected tracker errors go to the run logger instead of being swallowed; ordinary churn (a row still being written, a rotated file, a denied read) stays quiet.
|
|
32
|
+
- **Subagent cards.** `invoke_subagent` now reads the flat `Role`/`TypeName` argv agy actually sends, so the mirror presenter and the client card both title the call `Subagent: DeepInvestigator (Deep Game Investigator)`; `toolStepBrief` follows the same keys.
|
|
33
|
+
- **Feature: local file links open in DSH's native right Sidebar.**
|
|
34
|
+
- The provider rewrites `[label](file:///…)` to the plain local path before DSH renders the Markdown (keeping a `#L…` anchor in the form DSH already parses), so a delivered artifact becomes a native file chip whose click opens the right Sidebar — no plugin code involved.
|
|
35
|
+
- Replies that already rendered a raw `file://` anchor are intercepted by the client scanner: clicking the link text opens the same `dsh-resource://file/session/<sessionId>/<path>` address through `ctx.sidebarRight.openResource` (no extra badge — the link is the affordance; a `#L12` anchor rides as `params.line`, and a path inside the workspace travels relative, exactly as `fileAddressFor` builds it). If no preview tab type can claim that address (web/headless profiles) the click falls back to the OS opener instead of reporting a false success.
|
|
36
|
+
- Opening no longer depends on the file's shell association: `/plugins/agy-link/open` resolves `~` paths, `#L12-L40` anchors and Antigravity's `brain/` directories (now media search roots), so an artifact under `~/.dsh/agy-accounts/…` stops 404ing.
|
|
37
|
+
- **Fix(windows): opening a local file honours the registry's modern default app.** `cmd /c start` silently did nothing when the `.md` association pointed at an uninstalled program; the opener now tries PowerShell `Start-Process` first (the ShellExecute path that respects the user's current choice, e.g. VS Code), then `code`/`notepad` for text files, then reveals the file in Explorer, and passes `/select,<path>` as the single argument Explorer expects.
|
|
38
|
+
- **Fix(test): the full suite is green on Windows.** Three cases redirected `HOME` alone although `os.homedir()` reads `USERPROFILE` there — they now redirect both (and no longer risk reading the developer's live token file); a path assertion compared `/`-separated prefixes against `path.join` output; the symlink-escape case is skipped where symlink creation is not permitted. Full suite: 1035/1035 (1 environment skip).
|
|
39
|
+
|
|
40
|
+
### 中文
|
|
41
|
+
|
|
42
|
+
- **修复(镜像, ptc):移除重放程序的顶层 `return`(修复 #103)。** 代码 / PTC 模式下生成的 `run_code` 包装脚本是 `return await tools['agy_tool'](...)`,而 DSH 的 REPL 语法校验不接受顶层 `return`(报 `Return statement is not allowed here`),导致每个 agy 工具步骤的镜像回放都失败。现改为以 `await tools['agy_tool'](...)` 作为末表达式,在 REPL 与函数体两种运行时下都能求值;解析器仍兼容旧的 `return await` 脚本,两种形态均有回归测试。感谢 @lzh-marble 的精确定位与 @fall2wish 的 PR #104。
|
|
43
|
+
- **新增(客户端):可隐藏会话头状态徽标与单条翻译按钮(修复 #105)。** 设置页新增 `showHeaderBadge`、`showTranslateAction` 两个开关(默认开启),同时支持 `DSH_AGY_SHOW_HEADER_BADGE` / `DSH_AGY_SHOW_TRANSLATE_ACTION` 环境变量与受白名单保护的 `/config` 接口。状态快照经统一的 `isUiVisible()` 规则下发:只有显式 `false` 才隐藏,状态未到达或旧宿主没有该字段时保持可见,不会闪退。窄屏(≤680px)下徽标文字自动隐藏、只留状态圆点。译文卡片、`/tsl` 与自动翻译功能均不受影响。配置优先级、HTTP 契约、SSR、jsdom 与四语言字典均有对应测试。
|
|
44
|
+
- **修复(号池):显式传入的 `home` 优先于 `DSH_STATE_DIR`。** 此前只要环境变量存在,`defaultPoolDir(home)` 就忽略参数直接返回父进程状态目录,破坏了隔离子账号的路径恢复逻辑(在导出该变量的环境中也会让回归测试失败)。生产调用不传参数,行为不变。
|
|
45
|
+
- **修复(传输层):30s 通用路由超时不再掐断慢速翻译(代码评审阻断项)。** `/translate` 承载一整轮 agy 调用(`translateTimeoutMs` 缺省 120s,medium 实测 20–45s);套用通用 deadline 会先回 504,而 `sendJson` 的恰好一次语义会丢弃随后真正的 200 —— 「译成人话」在慢速档位必然失败。现改为 `longRouteTimeout(cfg.translateTimeoutMs)`(任务预算 + 15s 宽限)。`sendJson` 同时吞掉客户端断连时的写异常,避免迟到的超时回调拖垮宿主;手动额度刷新的去重条目改由真实工作持有(90s 硬上限),不再被 30s 竞速提前释放而让第二次 `agy /usage` 叠加。两处均有假时钟回归测试。
|
|
46
|
+
- **修复(模型):目录发现失败时不再让 `listModels` 自激循环(修复 #106)。** 存在当前池账号时,每次 `listModels()` 都会调用无条件广播的 `forceRefreshAndNotify()` → 发出 `llm/adapters-updated` → DSH 浏览器重读模型目录 → 再次 `listModels`,形成闭环;而发现失败不会写入该账号的目录缓存,循环永不收敛,每圈还会 spawn 一次 `agy models`。读路径现改走带节流的 `ensureAccountCatalog()`(仅在内容真正变化时广播,按账号记录 60s 重试时间戳),`forceRefreshAndNotify()` 也不再为失败的首次发现广播,同时保留切号时的广播语义。新增回归测试复刻浏览器反馈环,验证 20 次读取 → 1 次探测 → 0 次广播。感谢 @Rey50 的分析与离线复现。
|
|
47
|
+
- **修复(运行时):宿主事件循环被阻塞后,空闲看门狗不再误杀仍在输出的子进程。** libuv 的 timers 阶段先于 poll 阶段,看门狗到期时可能子进程已写入的 stdout/stderr 还排在管道里没被投递,于是被误判为超时;满并发 `npm test` 下这会让两项保活用例偶发失败、挡住发布门禁。现给一次短暂宽限(`WATCHDOG_GRACE_MS`,不超过本次运行的空闲预算),让排队数据重新喂狗;新增确定性测试主动阻塞事件循环并断言运行不超时。
|
|
48
|
+
- **修复(控制台):「同步中」不再无限转圈——所有请求现在都有硬超时。**
|
|
49
|
+
- 三个原因叠加:宿主路由都是裸的 `void (async () => …)()`(依赖抛错会变成未处理的 rejection,**HTTP 永远不响应**);`refresh-quota` 要等 20s 的 `agy /usage` 子进程加若干 REST 调用才返回;而浏览器端写请求没有超时(只有 3s 的状态轮询有)。
|
|
50
|
+
- `respond.ts` 新增 `runRoute()`,作为全部 23 条异步路由的统一守卫:抛错返回 500、超过 `ROUTE_TIMEOUT_MS` 挂起返回 504,`sendJson` 保证只写一次(超时的迟到响应不会二次写 head)。不再有逐路由重复的错误处理。
|
|
51
|
+
- `refresh-quota` 立即返回 `pending: true`,刷新放到后台执行(按账号去重,并带独立超时,避免挂死的流水线永久挡住后续同步)。现有 3s 状态轮询会自动带出最新额度;提示文案改为「正在同步」而不是谎称「已刷新」。
|
|
52
|
+
- 客户端 `postJson`/`getJson` 共用 `timedSignal()`,并有 `useBusyAction()` 兜底:任何 busy 状态都不会超过 `WRITE_TIMEOUT_MS + 5s`。所有超时常量集中在 `src/common/timeouts.ts`。
|
|
53
|
+
- **修复(模型):模型与思考等级收敛为单一事实源——DSH 的模型列表现在与 agy 完全一致,且不再有重复定义。**
|
|
54
|
+
- **`xhigh` 不再被当成独立模型。** agy 1.5.7 列出的是 `gemini-4-hydrogen-xhigh`,而旧的折叠逻辑只认识 `low/medium/high`,于是 DSH 里同时出现了 `Gemini 4 Hydrogen` 和 `Gemini 4 Hydrogen (XHigh)` 两个模型。档位词表现已取自 `agy --help`(`low|medium|high|xhigh|max`)并按**后缀长度降序**匹配:Hydrogen 就是**一个**模型、带四个档位,`xhigh` 显示为 **Extra**(与 agy 自己的菜单一致)。
|
|
55
|
+
- **目录即 agy 目录。** 离线兜底阵容同步到 `agy models` 1.5.7(新增 `gemini-4-hydrogen`、`gemini-pro-orchestrator-g1-pro`;移除已下线的 Claude 4.6 线与 agy 标记为 *Unavailable* 的 `gemini-4-carbon`)。折叠后的条目也按 `agy models` 的原始顺序输出,Orchestrator 因此回到第三位而不是垫底。新增回归测试逐字回放 1.5.7 输出,并断言兜底阵容与真实发现结果完全一致。
|
|
56
|
+
- **词表零冗余。** `src/common/reasoning.ts` 成为档位列表/显示名/后缀解析的唯一定义;`src/common/model-lineup.ts` 成为具体模型 id 的唯一出处。设置页“默认思考强度”按钮、翻译/生图档位下拉、模型显示 chips 与 `agy_ask` 帮助文本全部由实时目录派生——原来四处各自硬编码的 `low/medium/high` 已全部删除;目录里有 `xhigh`,下拉框就自动多出「Extra」。
|
|
57
|
+
- `agy_ask`:写在模型词里的档位(如 `"gemini-4-hydrogen extra"`)现在会被识别为 `--effort`,不再被静默丢弃。
|
|
58
|
+
- **修复(发布):发布遇瞬态故障会自动重试,并校验版本真的可用。**
|
|
59
|
+
- 0.6.19/0.6.20 都建了 GitHub Release 却装不上:一次瞬态 `404 Not Found - PUT registry.npmjs.org` 直接打断 `npm publish`,且没有任何环节检查版本是否可读;0.6.21 用同一 token 几分钟后就成功了。
|
|
60
|
+
- `scripts/publish-retry.mjs`:已发布则跳过(可重复运行)、只对瞬态错误退避重试、鉴权/版本类致命错误立即失败,发布成功后轮询 `npm view` 确认。registry 传播慢(实测 2–6 分钟)只告警不误判失败,canary 可用 `PUBLISH_STRICT_VERIFY=1` 严格化。
|
|
61
|
+
- 8 项单测覆盖错误分类、重试/耗尽、致命快失败、幂等与发布后校验。
|
|
62
|
+
- **修复(测试):加宽 watchdog 保活用例的计时余量。** 两项 `proxy-keychain` 用例在满并发下会被父进程事件循环饿死导致 800ms 误超时;它们是发布门禁,flaky 会挡住发版。现子进程活动长于 2000ms 空闲预算且语义不变;全量 1028/1028。
|
|
63
|
+
|
|
64
|
+
- **新功能:子代理活动实时流式呈现,本地文件链接直接在 DSH 原生右侧边栏打开。**
|
|
65
|
+
- **子代理实时进度。** 新增 `src/features/subagent/tracker.ts`:运行期间跟随 agy 的 `brain/<会话ID>/.system_generated/` 目录树,自动发现每个 `subagents/*.json` 描述文件(含多层嵌套),并增量读取各专员的 `transcript.jsonl`;每次工具调用与每条规划里程碑都会产生一条 `stepKind: 'subagent'` 事件。40 分钟的委派不再只显示一张冻结的 `invoke_subagent` 卡片——思考区会实时显示专员正在读/改哪个文件、执行什么命令、生成哪张概念图。每条事件同时刷新空闲看门狗,因为专员在磁盘上写进度就是真实进展。
|
|
66
|
+
- **增量读取。** 每次轮询只读取上次之后新增的字节,并缓存未写完的最后一行;再长的会话记录每跳只付一次小读取,而不是整篇重读重解析。
|
|
67
|
+
- **失败不再静默。** 非预期的跟踪错误写入运行日志;正常抖动(行还没写完、文件被替换、读取被拒)保持安静。
|
|
68
|
+
- **子代理卡片。** `invoke_subagent` 现在读取 agy 实际发送的扁平 `Role`/`TypeName` 参数,镜像卡片与客户端卡片都显示 `Subagent: DeepInvestigator (Deep Game Investigator)`;`toolStepBrief` 同步。
|
|
69
|
+
- **新功能:本地文件链接在 DSH 原生右侧边栏打开。**
|
|
70
|
+
- Provider 在交给 DSH 渲染前把 `[label](file:///…)` 改写为纯本地路径(行号锚点保留为 DSH 已支持的 `#L…` 形式),于是交付件直接渲染成原生文件 chip,点击即打开右侧边栏,全程无需插件脚本。
|
|
71
|
+
- 已经渲染成裸 `file://` 锚点的历史回复,由客户端扫描器接管点击:点击链接文字即通过 `ctx.sidebarRight.openResource` 打开同一个 `dsh-resource://file/session/<会话ID>/<路径>` 地址(不再挂额外胶囊——链接文字本身就是入口;`#L12` 锚点以 `params.line` 传递,工作区内路径按 `fileAddressFor` 的规则转为相对路径)。若当前配置没有任何预览类型能接收该地址(web/headless 配置),点击回退到系统打开,而不是谎报成功。
|
|
72
|
+
- 打开不再依赖文件关联:`/plugins/agy-link/open` 现在能解析 `~` 路径、`#L12-L40` 锚点与 Antigravity 的 `brain/` 目录(已并入媒体检索根),`~/.dsh/agy-accounts/…` 下的交付件不再 404。
|
|
73
|
+
- **修复(Windows):用系统现代默认程序打开本地文件。** 当 `.md` 关联指向一个已卸载的程序时,`cmd /c start` 会静默失败;现在优先用 PowerShell `Start-Process`(ShellExecute 路径,尊重用户当前选择,例如 VS Code),文本类文件再回退 `code`/`notepad`,最后回退到在资源管理器中定位,并把 `/select,<路径>` 作为 Explorer 期望的单个参数传入。
|
|
74
|
+
- **修复(测试):Windows 下全量回归全绿。** 三处用例只重定向了 `HOME`,而 Windows 的 `os.homedir()` 读的是 `USERPROFILE`——现在两个都重定向(也避免误读开发者真实 token 文件);一处路径断言把 `/` 前缀与 `path.join` 的结果比较;符号链接逃逸用例在不允许创建符号链接的环境下跳过。全量:1035/1035(1 项环境跳过)。
|
|
75
|
+
|
|
76
|
+
## 0.6.21 (2026-11-12)
|
|
77
|
+
|
|
78
|
+
### English
|
|
79
|
+
|
|
80
|
+
- **Fix(catalog, models): Strict real model discovery from `agy models` CLI, account-scoped catalog isolation & eliminated quota pollution.**
|
|
81
|
+
- **Authoritative CLI Discovery**: Completely removed `acc.quotas` injection into runnable model catalogs. Quota buckets (such as `gemini-2.5-flash-thinking`, `gemini-3.8-flash-tiered`, and duplicate `Gemini 3.5 Flash Lite` entries returned by Google Cloud quota APIs) are strictly restricted to quota telemetry and never treated as runnable LLM models.
|
|
82
|
+
- **Account-Scoped Catalog Isolation (`getModelsForAccount`)**: The DSH model picker and Settings panel ("Model visibility") now reflect strictly the active account's models discovered from `agy models`. Claude 4.6 and Claude 5.5 no longer cross-pollinate, and Argon is only shown on Argon-eligible accounts.
|
|
83
|
+
- **Real-Time Account Switch Synchronization**: Switching accounts immediately resolves and refreshes the target account's catalog, updating both the picker and the settings panel with zero redundancy and no ghost models.
|
|
84
|
+
|
|
85
|
+
### 中文
|
|
86
|
+
|
|
87
|
+
- **修复(目录与模型):严格从真实 `agy models` 提取模型列表、账号专属目录隔离与彻底根除配额分桶污染。**
|
|
88
|
+
- **真实 CLI 权威探测**:彻底移除 `getAllKnownModels()` 中对 `acc.quotas` 配额分桶的合流读取。Google Cloud 配额接口返回的内部资源分桶(如 `gemini-2.5-flash-thinking`、`gemini-3.8-flash-tiered` 以及重复命名的 4 个 `Gemini 3.5 Flash Lite`)严格仅用于额度条展示,绝不再当作可运行 LLM 模型混入目录。
|
|
89
|
+
- **账号专属目录隔离(`getModelsForAccount`)**:DSH 右下角模型选择器与设置面板“模型显示”直接绑定当前活动账号通过 `agy models` 真实探查到的模型列表。主账号(Claude 5.5 + Argon)与子账号(Claude 4.6,无 Argon)彻底实现互不污染,消除跨账号冗余。
|
|
90
|
+
- **切账号即时同步**:切换活动账号时,立即在后台以新账号环境执行权威探测、写入账号专属缓存并即时触发 `notifyPicker()` 广播,实现毫秒级无缝刷新。
|
|
91
|
+
|
|
92
|
+
## 0.6.20 (2026-11-12)
|
|
93
|
+
|
|
94
|
+
### English
|
|
95
|
+
|
|
96
|
+
- **Major Architecture: Full-Repository Modular Monolith Refactoring (`refactor/modular-monolith`).**
|
|
97
|
+
- **Zero Monolithic Files**: Refactored the entire codebase into 207 focused, decoupled modules. Every single source file now strictly obeys `<= 600` lines (empty ratchet list, 0 legacy overrides), with target functions `<= 120` lines.
|
|
98
|
+
- **Acyclic Layered Domain Architecture**: Enforced strict unidirectional dependency rules via `scripts/check-architecture.mjs` (0 cyclic dependencies, 0 direction violations) across clearly separated layers:
|
|
99
|
+
- `src/domain/`: Extracted slot state machines, leasing, atomic file locks, and pool administrative scheduling from the legacy monolithic `AccountPoolManager`.
|
|
100
|
+
- `src/provider/`: Decomposed the multi-turn attempt loop into dedicated context assembly, retry policies, and DSH tool event mappers.
|
|
101
|
+
- `src/runtime/`: Modularized agy process execution and SQLite DB trajectory parsing.
|
|
102
|
+
- `src/features/`: Isolated autonomous agent features including the Image Agent, Translation Service, and Warmup Engine.
|
|
103
|
+
- `src/transport/`: Modularized HTTP route handlers across 31 typed REST endpoints.
|
|
104
|
+
- `src/client/`: Split the monolithic frontend bundle into standalone UI panels, toolview renderers, decisions, and compaction components.
|
|
105
|
+
- **Two-Tier Test Suite (Aligned with academic-agent)**:
|
|
106
|
+
- **Inner Loop (TDD Fast-Ring, 0.3s - 1.5s)**: Introduced `pnpm run test:fast` for lightning-fast incremental test execution targeted by Git diff or module keywords.
|
|
107
|
+
- **Outer Loop (Full Regression Gate, 1018 Tests)**: Expanded the comprehensive test suite to 1,018 automated tests with 85%+ branch coverage, including JSDOM browser simulation, SSR DOM rendering fixtures, injectable CLI exit-code harnesses, and 100% route contract coverage.
|
|
108
|
+
- **Feat & Fix(client, media): Clickable local file links, native OS launching, and redesigned glassmorphic lightbox.**
|
|
109
|
+
- **In-App Clickable Local Links**: Intercept clicks on `file://` and local relative links (`.png`, `.mp4`, `.md`, `.txt`, `.pdf`, etc.) in DSH chat, overcoming Chromium's `Not allowed to load local resource` restriction and relative URL 404 navigations. Clicking media opens the in-app Lightbox, while documents/code trigger the native host editor or file manager with instant Toast feedback.
|
|
110
|
+
- **Video Streaming & Range 206 Support**: Added video MIME mappings (`.mp4`, `.webm`, `.mov`, `.mkv`) and HTTP 206 Partial Content Range streaming to `/plugins/agy-link/media`. Built-in Lightbox video player supports instant seeking and smooth scrubbing.
|
|
111
|
+
- **Session-Aware Deep Media Resolution**: `resolveLocalMediaPath` dynamically inspects active DSH session working directories (`header.cwd`) and performs bounded recursive search (up to depth 3) across project folders, resolving deeply nested assets (e.g. `master_continuous/master_montage_6panel.png`) without 404 black screens.
|
|
112
|
+
- **Host OS File Opener API**: Added `/plugins/agy-link/open` endpoint using native platform openers (`open` / `open -R` on macOS, `explorer` / `start` on Windows, `xdg-open` on Linux).
|
|
113
|
+
- **Modern UI Redesign**: Replaced retro monospace/emoji controls with an Apple/Linear-style glassmorphism interface featuring a floating pill island toolbar, crisp vector SVG icons (Zoom, 1:1, Reveal in Finder, Open in App, Copy Path with checkmark animation, Close), and refined chat chips.
|
|
114
|
+
- **Feat(auth, catalog): Direct Token Import, Credential Auto-Healing & Dynamic Model Filtering (#102).**
|
|
115
|
+
- **Direct Token Import**: Add accounts by directly pasting a `refresh_token` string or OAuth JSON document via CLI (`/agy import`), HTTP API, or Settings UI.
|
|
116
|
+
- **Credential Auto-Healing**: Corrupted or missing credentials automatically restore from adjacent `.bak` backup files.
|
|
117
|
+
- **Dynamic Model Scoping**: The model picker and status catalog dynamically synchronize on account switch, isolating Argon permissions per active account.
|
|
118
|
+
|
|
119
|
+
### 中文
|
|
120
|
+
|
|
121
|
+
- **重大架构重构:全仓模块化单体重构(`refactor/modular-monolith`)。**
|
|
122
|
+
- **全仓彻底消除单体大文件**:全代码库拆解重构为 207 个高内聚、低耦合的独立模块。全量源文件严格恪守 `<= 600` 行预算红线(清空历史棘轮,0 遗留违规),目标函数严格 `<= 120` 行。
|
|
123
|
+
- **无环分层领域架构**:通过 `scripts/check-architecture.mjs` 门禁实现单向依赖约束(0 循环依赖,0 越级调用),清晰划分六大层次:
|
|
124
|
+
- `src/domain/`:从原重型 `AccountPoolManager` 中剥离出凭据槽状态机、租约管理、原子文件锁与号池调度管理;
|
|
125
|
+
- `src/provider/`:将多轮请求循环解耦为上下文组装、重试策略与 DSH 原生工具事件映射管道;
|
|
126
|
+
- `src/runtime/`:模块化底层 `agy` 进程执行与 SQLite 数据库轨迹提取;
|
|
127
|
+
- `src/features/`:独立图像生成智能体、划词翻译服务与模型预热保活引擎;
|
|
128
|
+
- `src/transport/`:模块化注册 31 个类型安全的 HTTP REST 接口;
|
|
129
|
+
- `src/client/`:将庞大前端代码拆分为独立的设置面板、工具卡片渲染器、决策流与历史折叠组件。
|
|
130
|
+
- **两级双环极速测试体系(对齐 academic-agent)**:
|
|
131
|
+
- **内环(TDD 极速环,0.3s ~ 1.5s)**:引入 `pnpm run test:fast`,精准基于 Git 变更或关键字毫秒级执行关联单测,告别漫长等待;
|
|
132
|
+
- **外环(全量回归门禁,1018 项测试)**:单测规模跃升至 1,018 项,分支覆盖率突破 85%+,涵盖 JSDOM 前端交互用例、SSR 渲染断言、CLI 退出码矩阵与全部 31 个 HTTP 路由边界测试。
|
|
133
|
+
- **功能与体验重构(客户端与媒体):支持 DSH 对话内直接点击本地文件链接、视频播放、深度路径解析与全新现代化毛玻璃预览 UI。**
|
|
134
|
+
- **DSH 对话内链接直接点击可用**:拦截 `file://` 与本地文件链接(`.png`、`.mp4`、`.md`、`.txt`、`.pdf`、代码文件等)的点击事件,彻底解决 Chromium 浏览器安全沙箱拦截 `file:///`("Not allowed to load local resource")或相对路径 404 导致的链接无法点击问题。点击媒体直接唤起应用内预览,点击文档/代码直接在系统默认编辑器中打开或在访达中定位,并带有全局 Toast 操作反馈。
|
|
135
|
+
- **视频播放与 HTTP 206 Range 边下边播**:`/plugins/agy-link/media` 路由全面支持视频格式(`.mp4`、`.webm`、`.mov`、`.mkv`),并实现 HTTP 206 Partial Content Range 分段传输,支持进度条任意时间点平滑拖拽即时播放。
|
|
136
|
+
- **会话工作区动态感知与 3 层嵌套有界检索**:`resolveLocalMediaPath` 现自动采集 DSH 各活动会话工作目录(`header.cwd`)与常用工作区,支持最多 3 层深度的有界递归匹配,毫秒级定位深层嵌套产物(如 `master_continuous/master_montage_6panel.png` 与 `eren_rumbling_master_78s.mp4`),彻底根除 404 黑屏。
|
|
137
|
+
- **本地系统打开与定位接口**:新增 `/plugins/agy-link/open` 路由,调用系统原生指令(macOS `open` / `open -R`、Windows `explorer` / `start`、Linux `xdg-open`)即时打开文件或在访达中显示。
|
|
138
|
+
- **现代化毛玻璃预览重构**:全面重构 Lightbox 预览与链接胶囊样式,采用 Apple / Linear 风格高透毛玻璃与顶部悬浮药丸工具栏,搭配纯正矢量 SVG 图标(放大、缩小、1:1 复位、访达定位、系统打开、复制路径打勾动画、ESC 关闭),彻底替换粗糙的旧式文本按钮,并提供操作反馈 Toast 浮层。
|
|
139
|
+
- **新增(认证与目录):支持直接导入 Refresh Token / OAuth JSON 快捷登录与凭据备份自愈(#102)。**
|
|
140
|
+
- **Token 直接导入**:支持直接粘贴 `refresh_token` 字符串或 OAuth JSON 凭据导入账号。提供 CLI 命令(`/agy import <token> [别名]` 与 `/agy import-token`)、HTTP API 接口(`POST /plugins/agy-link/pool/import`)以及设置面板("Token 导入" 选项卡)。系统自动换取 Token、验证 Google 身份并就地更新或创建账号,并即时拉取额度。
|
|
141
|
+
- **凭据文件自愈修复**:当凭据文件缺失、截断或损坏时,自动从同目录 `.bak` 备份文件中恢复;启动自检中自动为凭据完整有效的账号清除误标的 `authRequired` 异常标记。
|
|
142
|
+
- **切号动态同步模型列表与权限**:切换活动账号时即时依据新账号权限动态过滤可用模型列表,无 Argon 权限的账号不再在当前状态中残留展示不可用模型;切到不支持 Argon 的账号时自动清理过期的 Argon 活动指针。
|
|
143
|
+
|
|
144
|
+
## 0.6.19 (2026-11-12)
|
|
145
|
+
|
|
146
|
+
### English
|
|
147
|
+
|
|
148
|
+
- **Feat(auth): import accounts directly via refresh token or OAuth JSON document; auto-heal credentials from backup (#102).**
|
|
149
|
+
- **Direct token import**: Added support for adding accounts by directly pasting a `refresh_token` string or token JSON payload. Available via CLI (`/agy import <token> [alias]`), HTTP API (`POST /plugins/agy-link/pool/import`), and the Settings UI ("Token" tab in the Add Account section). Token is exchanged, identity is verified, and the account is added or updated in place with full quota discovery.
|
|
150
|
+
- **Credential auto-healing**: When an account's credential file is missing or corrupted/truncated, it is automatically restored from the adjacent `.bak` backup file. Boot hygiene clears any false `authRequired` state when credentials are restored or valid.
|
|
151
|
+
- **Fix(catalog): dynamically scope model picker and status catalog to the active account on switches.**
|
|
152
|
+
- When switching active accounts, model capabilities are re-evaluated immediately so models without permission (e.g. Argon on standard accounts) are properly filtered out of catalog status.
|
|
153
|
+
- Selecting an account without Argon automatically clears obsolete Argon active account pointers.
|
|
154
|
+
|
|
155
|
+
### 中文
|
|
156
|
+
|
|
157
|
+
- **新增(auth):支持直接导入 Refresh Token / OAuth JSON 快捷登录与凭据备份自愈(#102)。**
|
|
158
|
+
- **Token 直接导入**:支持直接粘贴 `refresh_token` 字符串或 OAuth JSON 凭据导入账号。提供 CLI 命令(`/agy import <token> [别名]` 与 `/agy import-token`)、HTTP API 接口(`POST /plugins/agy-link/pool/import`)以及设置面板("Token 导入" 选项卡)。系统自动换取 Token、验证 Google 身份并就地更新或创建账号,并即时拉取额度。
|
|
159
|
+
- **凭据文件自愈修复**:当凭据文件缺失、截断或损坏时,自动从同目录 `.bak` 备份文件中恢复;启动自检中自动为凭据完整有效的账号清除误标的 `authRequired` 异常标记。
|
|
160
|
+
- **修复(目录):切号时动态同步模型列表与权限状态。**
|
|
161
|
+
- 切换活动账号时即时依据新账号权限动态过滤可用模型列表,无 Argon 权限的账号不再在当前状态中残留展示不可用模型;切到不支持 Argon 的账号时自动清理过期的 Argon 活动指针。
|
|
162
|
+
|
|
3
163
|
## 0.6.18 (2026-11-11)
|
|
4
164
|
|
|
5
165
|
### English
|
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
- 🔄 **顺序耗尽故障转移 (Sequential Drain)**:当前账号额度用尽(触发 429 限流或 5h / 周额度耗尽)时,系统**自动平滑接力至下一个可用账号**,对话完全不中断!
|
|
63
63
|
- 🕰 **额度到期优先轮换 (Quota-Expiry-First)**:多个账号可用时,优先切换到**重置窗口最早到期**的账号,把"还剩很久才重置"的额度留给后面,整体池化利用率最大化。
|
|
64
64
|
- 🧠 **网络抖动智能甄别 (Jitter-Safe Auth)**:代理抖动导致的 keyring 鉴权超时会被自动识别为**可重试的网络错误**而非"登录失效"——基于 agy 本次运行日志的 `keyringAuth` 传输证据精准分类,且粘性"需重新登录"隔离需二次确认,健康账号绝不会被误标。
|
|
65
|
-
- 📊 **官方多 Bucket 配额监控 (Multi-Bucket Quota)**:直接调用 Antigravity 官方专用的 `v1internal:retrieveUserQuotaSummary` 接口,同时展示 **5
|
|
65
|
+
- 📊 **官方多 Bucket 配额监控 (Multi-Bucket Quota)**:直接调用 Antigravity 官方专用的 `v1internal:retrieveUserQuotaSummary` 接口,同时展示 **5小时滚动额度** 与 **7天周额度**。agy 1.5.5 起 Argon 已并入普通 Gemini 池(`/usage` 只返回 Gemini / Claude & GPT 两组),因此不再单独显示 Argon 行;只有服务端仍上报 `Gemini 4 Argon` 独立组时(旧版后端或特定套餐)才额外显示该周额度池。
|
|
66
66
|
- 🔀 **手动切换当前账号 (Manual Switch-Active)**:控制台卡片一键「设为当前使用」,即刻把调度指针钉到指定账号。
|
|
67
67
|
- 🔑 **GUI 内浏览器免粘贴登录 (In-GUI Zero-Paste OAuth)**:点击「➕ 添加账号」自动调起系统浏览器,本地回环监听自动捕获授权凭证,**全程无需手动复制粘贴授权码**。
|
|
68
68
|
- 🎨 **多主题高对比度自适应 (Light & Dark Themes)**:原生适配 DSH 浅色/深色主题,告别发暗发灰与看不清文字,UI 视觉清晰锐利。
|
|
@@ -201,9 +201,12 @@ dsh-agy-image -p "把背景换成夜晚" -i ./day.png -n night_scene --json
|
|
|
201
201
|
|
|
202
202
|
## 🧩 架构与工作原理
|
|
203
203
|
|
|
204
|
+
> 分层、依赖方向与各模块职责见 [docs/ARCHITECTURE.md](./docs/ARCHITECTURE.md);开发与重构门禁见 [docs/DEVELOPMENT.md](./docs/DEVELOPMENT.md)。
|
|
205
|
+
|
|
204
206
|
1. **短生命周期进程驱动**:每一轮 DSH 对话启动一个独立的官方 `agy -p --output-format stream-json` 进程,解析 NDJSON 事件流。
|
|
205
207
|
2. **多账号沙箱机制**:除主账号沿用系统默认 Keychain / HOME 外,所有备用账号在插件私有目录下建立专属 HOME 隔离区,独立写入 agy 格式的标准 OAuth 凭证。Windows 上 agy 的凭据实际存放在机器级 Credential Manager(`gemini:antigravity`),插件因此以「身份级引用计数租约」接管该槽:**同一授权的多个会话并行运行**,只有账号**身份切换**才串行,且由最后一个持有者还原主账号凭据。
|
|
206
|
-
|
|
208
|
+
备用账号的凭据会在同目录保存 `.bak`;原文件缺失时自动恢复。备份包含敏感 OAuth 凭据,应保护账号目录的访问权限;撤销授权或权限不足时仍需重新登录。主账号继续使用系统凭据机制。
|
|
209
|
+
3. **多 Bucket 官方配额汇总**:插件定时后台静默轮询官方 `v1internal:retrieveUserQuotaSummary`,精准掌控每个账号的 5h 滚动削峰水位与 7d 账号阶梯周额度。服务端上报 `Gemini 4 Argon` 独立组时亦同步展示 Argon 独立周池。
|
|
207
210
|
4. **会话级无缝故障转移**:当遭遇 HTTP 429、额度耗尽或凭证异常时,号池调度器自动标记当前账号家族进入冷却(或按额度到期时间择优轮换),并无缝将后续请求路由到池内下一个有效账号。
|
|
208
211
|
5. **失败分类与自愈**:错误按 AUTH / NETWORK / RATE_LIMIT / ELIGIBILITY 等精确分类;网络抖动借由 agy 运行日志自动甄别为可重试故障,绝不误伤健康账号的登录状态。
|
|
209
212
|
6. **辅助通道隔离**:`/tsl` 翻译、会话标题生成、任务目标推导等通过独立专用辅助通道执行,共享号池与冷却机制,不占主会话绑定与工具权限。
|