dsh-agy-link 0.6.18 → 0.6.21
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 +87 -0
- package/README.md +5 -2
- package/dist/cli-image.mjs +29882 -28420
- package/dist/client.js +5193 -4049
- package/dist/index.js +13931 -11559
- package/docs/ARCHITECTURE.md +70 -0
- 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,92 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.21 (2026-11-12)
|
|
4
|
+
|
|
5
|
+
### English
|
|
6
|
+
|
|
7
|
+
- **Fix(catalog, models): Strict real model discovery from `agy models` CLI, account-scoped catalog isolation & eliminated quota pollution.**
|
|
8
|
+
- **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.
|
|
9
|
+
- **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.
|
|
10
|
+
- **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.
|
|
11
|
+
|
|
12
|
+
### 中文
|
|
13
|
+
|
|
14
|
+
- **修复(目录与模型):严格从真实 `agy models` 提取模型列表、账号专属目录隔离与彻底根除配额分桶污染。**
|
|
15
|
+
- **真实 CLI 权威探测**:彻底移除 `getAllKnownModels()` 中对 `acc.quotas` 配额分桶的合流读取。Google Cloud 配额接口返回的内部资源分桶(如 `gemini-2.5-flash-thinking`、`gemini-3.8-flash-tiered` 以及重复命名的 4 个 `Gemini 3.5 Flash Lite`)严格仅用于额度条展示,绝不再当作可运行 LLM 模型混入目录。
|
|
16
|
+
- **账号专属目录隔离(`getModelsForAccount`)**:DSH 右下角模型选择器与设置面板“模型显示”直接绑定当前活动账号通过 `agy models` 真实探查到的模型列表。主账号(Claude 5.5 + Argon)与子账号(Claude 4.6,无 Argon)彻底实现互不污染,消除跨账号冗余。
|
|
17
|
+
- **切账号即时同步**:切换活动账号时,立即在后台以新账号环境执行权威探测、写入账号专属缓存并即时触发 `notifyPicker()` 广播,实现毫秒级无缝刷新。
|
|
18
|
+
|
|
19
|
+
## 0.6.20 (2026-11-12)
|
|
20
|
+
|
|
21
|
+
### English
|
|
22
|
+
|
|
23
|
+
- **Major Architecture: Full-Repository Modular Monolith Refactoring (`refactor/modular-monolith`).**
|
|
24
|
+
- **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.
|
|
25
|
+
- **Acyclic Layered Domain Architecture**: Enforced strict unidirectional dependency rules via `scripts/check-architecture.mjs` (0 cyclic dependencies, 0 direction violations) across clearly separated layers:
|
|
26
|
+
- `src/domain/`: Extracted slot state machines, leasing, atomic file locks, and pool administrative scheduling from the legacy monolithic `AccountPoolManager`.
|
|
27
|
+
- `src/provider/`: Decomposed the multi-turn attempt loop into dedicated context assembly, retry policies, and DSH tool event mappers.
|
|
28
|
+
- `src/runtime/`: Modularized agy process execution and SQLite DB trajectory parsing.
|
|
29
|
+
- `src/features/`: Isolated autonomous agent features including the Image Agent, Translation Service, and Warmup Engine.
|
|
30
|
+
- `src/transport/`: Modularized HTTP route handlers across 31 typed REST endpoints.
|
|
31
|
+
- `src/client/`: Split the monolithic frontend bundle into standalone UI panels, toolview renderers, decisions, and compaction components.
|
|
32
|
+
- **Two-Tier Test Suite (Aligned with academic-agent)**:
|
|
33
|
+
- **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.
|
|
34
|
+
- **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.
|
|
35
|
+
- **Feat & Fix(client, media): Clickable local file links, native OS launching, and redesigned glassmorphic lightbox.**
|
|
36
|
+
- **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.
|
|
37
|
+
- **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.
|
|
38
|
+
- **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.
|
|
39
|
+
- **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).
|
|
40
|
+
- **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.
|
|
41
|
+
- **Feat(auth, catalog): Direct Token Import, Credential Auto-Healing & Dynamic Model Filtering (#102).**
|
|
42
|
+
- **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.
|
|
43
|
+
- **Credential Auto-Healing**: Corrupted or missing credentials automatically restore from adjacent `.bak` backup files.
|
|
44
|
+
- **Dynamic Model Scoping**: The model picker and status catalog dynamically synchronize on account switch, isolating Argon permissions per active account.
|
|
45
|
+
|
|
46
|
+
### 中文
|
|
47
|
+
|
|
48
|
+
- **重大架构重构:全仓模块化单体重构(`refactor/modular-monolith`)。**
|
|
49
|
+
- **全仓彻底消除单体大文件**:全代码库拆解重构为 207 个高内聚、低耦合的独立模块。全量源文件严格恪守 `<= 600` 行预算红线(清空历史棘轮,0 遗留违规),目标函数严格 `<= 120` 行。
|
|
50
|
+
- **无环分层领域架构**:通过 `scripts/check-architecture.mjs` 门禁实现单向依赖约束(0 循环依赖,0 越级调用),清晰划分六大层次:
|
|
51
|
+
- `src/domain/`:从原重型 `AccountPoolManager` 中剥离出凭据槽状态机、租约管理、原子文件锁与号池调度管理;
|
|
52
|
+
- `src/provider/`:将多轮请求循环解耦为上下文组装、重试策略与 DSH 原生工具事件映射管道;
|
|
53
|
+
- `src/runtime/`:模块化底层 `agy` 进程执行与 SQLite 数据库轨迹提取;
|
|
54
|
+
- `src/features/`:独立图像生成智能体、划词翻译服务与模型预热保活引擎;
|
|
55
|
+
- `src/transport/`:模块化注册 31 个类型安全的 HTTP REST 接口;
|
|
56
|
+
- `src/client/`:将庞大前端代码拆分为独立的设置面板、工具卡片渲染器、决策流与历史折叠组件。
|
|
57
|
+
- **两级双环极速测试体系(对齐 academic-agent)**:
|
|
58
|
+
- **内环(TDD 极速环,0.3s ~ 1.5s)**:引入 `pnpm run test:fast`,精准基于 Git 变更或关键字毫秒级执行关联单测,告别漫长等待;
|
|
59
|
+
- **外环(全量回归门禁,1018 项测试)**:单测规模跃升至 1,018 项,分支覆盖率突破 85%+,涵盖 JSDOM 前端交互用例、SSR 渲染断言、CLI 退出码矩阵与全部 31 个 HTTP 路由边界测试。
|
|
60
|
+
- **功能与体验重构(客户端与媒体):支持 DSH 对话内直接点击本地文件链接、视频播放、深度路径解析与全新现代化毛玻璃预览 UI。**
|
|
61
|
+
- **DSH 对话内链接直接点击可用**:拦截 `file://` 与本地文件链接(`.png`、`.mp4`、`.md`、`.txt`、`.pdf`、代码文件等)的点击事件,彻底解决 Chromium 浏览器安全沙箱拦截 `file:///`("Not allowed to load local resource")或相对路径 404 导致的链接无法点击问题。点击媒体直接唤起应用内预览,点击文档/代码直接在系统默认编辑器中打开或在访达中定位,并带有全局 Toast 操作反馈。
|
|
62
|
+
- **视频播放与 HTTP 206 Range 边下边播**:`/plugins/agy-link/media` 路由全面支持视频格式(`.mp4`、`.webm`、`.mov`、`.mkv`),并实现 HTTP 206 Partial Content Range 分段传输,支持进度条任意时间点平滑拖拽即时播放。
|
|
63
|
+
- **会话工作区动态感知与 3 层嵌套有界检索**:`resolveLocalMediaPath` 现自动采集 DSH 各活动会话工作目录(`header.cwd`)与常用工作区,支持最多 3 层深度的有界递归匹配,毫秒级定位深层嵌套产物(如 `master_continuous/master_montage_6panel.png` 与 `eren_rumbling_master_78s.mp4`),彻底根除 404 黑屏。
|
|
64
|
+
- **本地系统打开与定位接口**:新增 `/plugins/agy-link/open` 路由,调用系统原生指令(macOS `open` / `open -R`、Windows `explorer` / `start`、Linux `xdg-open`)即时打开文件或在访达中显示。
|
|
65
|
+
- **现代化毛玻璃预览重构**:全面重构 Lightbox 预览与链接胶囊样式,采用 Apple / Linear 风格高透毛玻璃与顶部悬浮药丸工具栏,搭配纯正矢量 SVG 图标(放大、缩小、1:1 复位、访达定位、系统打开、复制路径打勾动画、ESC 关闭),彻底替换粗糙的旧式文本按钮,并提供操作反馈 Toast 浮层。
|
|
66
|
+
- **新增(认证与目录):支持直接导入 Refresh Token / OAuth JSON 快捷登录与凭据备份自愈(#102)。**
|
|
67
|
+
- **Token 直接导入**:支持直接粘贴 `refresh_token` 字符串或 OAuth JSON 凭据导入账号。提供 CLI 命令(`/agy import <token> [别名]` 与 `/agy import-token`)、HTTP API 接口(`POST /plugins/agy-link/pool/import`)以及设置面板("Token 导入" 选项卡)。系统自动换取 Token、验证 Google 身份并就地更新或创建账号,并即时拉取额度。
|
|
68
|
+
- **凭据文件自愈修复**:当凭据文件缺失、截断或损坏时,自动从同目录 `.bak` 备份文件中恢复;启动自检中自动为凭据完整有效的账号清除误标的 `authRequired` 异常标记。
|
|
69
|
+
- **切号动态同步模型列表与权限**:切换活动账号时即时依据新账号权限动态过滤可用模型列表,无 Argon 权限的账号不再在当前状态中残留展示不可用模型;切到不支持 Argon 的账号时自动清理过期的 Argon 活动指针。
|
|
70
|
+
|
|
71
|
+
## 0.6.19 (2026-11-12)
|
|
72
|
+
|
|
73
|
+
### English
|
|
74
|
+
|
|
75
|
+
- **Feat(auth): import accounts directly via refresh token or OAuth JSON document; auto-heal credentials from backup (#102).**
|
|
76
|
+
- **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.
|
|
77
|
+
- **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.
|
|
78
|
+
- **Fix(catalog): dynamically scope model picker and status catalog to the active account on switches.**
|
|
79
|
+
- 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.
|
|
80
|
+
- Selecting an account without Argon automatically clears obsolete Argon active account pointers.
|
|
81
|
+
|
|
82
|
+
### 中文
|
|
83
|
+
|
|
84
|
+
- **新增(auth):支持直接导入 Refresh Token / OAuth JSON 快捷登录与凭据备份自愈(#102)。**
|
|
85
|
+
- **Token 直接导入**:支持直接粘贴 `refresh_token` 字符串或 OAuth JSON 凭据导入账号。提供 CLI 命令(`/agy import <token> [别名]` 与 `/agy import-token`)、HTTP API 接口(`POST /plugins/agy-link/pool/import`)以及设置面板("Token 导入" 选项卡)。系统自动换取 Token、验证 Google 身份并就地更新或创建账号,并即时拉取额度。
|
|
86
|
+
- **凭据文件自愈修复**:当凭据文件缺失、截断或损坏时,自动从同目录 `.bak` 备份文件中恢复;启动自检中自动为凭据完整有效的账号清除误标的 `authRequired` 异常标记。
|
|
87
|
+
- **修复(目录):切号时动态同步模型列表与权限状态。**
|
|
88
|
+
- 切换活动账号时即时依据新账号权限动态过滤可用模型列表,无 Argon 权限的账号不再在当前状态中残留展示不可用模型;切到不支持 Argon 的账号时自动清理过期的 Argon 活动指针。
|
|
89
|
+
|
|
3
90
|
## 0.6.18 (2026-11-11)
|
|
4
91
|
|
|
5
92
|
### 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 4 Carbon 都并入普通 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` 翻译、会话标题生成、任务目标推导等通过独立专用辅助通道执行,共享号池与冷却机制,不占主会话绑定与工具权限。
|