dsh-agy-link 0.6.51 → 0.6.53

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 CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.53 (2026-11-21)
4
+
5
+ ### English
6
+
7
+ - **Feat(settings): the model list becomes a tick-list over the real selectable universe (merges PR #149, closes #131).** The "Model visibility" block was a deny-list of chips fed only by `agy models`, so a host without the CLI offered the 7 static fallback rows while the account pool already knew that account could run 23+ models — the picker looked broken.
8
+ - **Ticking writes an allow-list.** `selectedModels` (`POST /config`, `DSH_AGY_SELECTED_MODELS`) is applied after `hiddenModels`, so a denied model stays denied (and its chip says why). An empty selection still means "no restriction", which keeps the shipped default byte-for-byte and makes unticking the last model unable to blank the picker.
9
+ - **New pure module `src/domain/models/quota-catalog.ts`** folds `accounts[].quotas.<family>.models[]` into catalog entries (same effort-folding rules as the CLI list) and merges them into whatever `agy models` discovered — CLI order and naming stay authoritative, quota rows only contribute models the catalog never mentioned. `/status` scopes this to the active account (or the whole pool under `poolWideCatalog`) and echoes `selectedModels`; model resolution merges the same way so a quota-only model still resolves.
10
+ - **Resolution is deliberately NOT filtered**: a session already running a model the user later untickes keeps resolving it — unticking must not break in-flight work. Only `listModels` (the picker) filters.
11
+ - Merge note: the PR's inline config validation was replaced by the unified `validateConfigValue()` that landed in v0.6.52, extended to cover `selectedModels`, and the maintainer-owned `CHANGELOG.md`/`package.json` were kept.
12
+
13
+ ### 中文
14
+
15
+ - **特性(设置):模型列表改为「真实可选集合」的勾选清单(合并 PR #149,关闭 #131)。** 原「模型可见性」是只由 `agy models` 供数的**拒绝清单**,于是没有 CLI 的宿主只列出 7 条静态兜底、而账号池其实知道该账号能跑 23+ 个模型——选择器看起来像坏了。
16
+ - **勾选写入允许清单。** `selectedModels`(`POST /config`、`DSH_AGY_SELECTED_MODELS`)在 `hiddenModels` **之后**应用,因此被拒绝的模型仍然隐藏(chip 会说明原因);空选择仍表示「无限制」,默认配置逐字节不变,也不会因为取消最后一个勾选而把选择器清空。
17
+ - **新增纯模块 `src/domain/models/quota-catalog.ts`**:把 `accounts[].quotas.<family>.models[]` 折叠成目录条目(与 CLI 列表同一套 effort 折叠规则),再并入 `agy models` 的结果——CLI 的顺序与命名保持权威,配额行只贡献目录里从未出现的模型。`/status` 按活跃账号(或 `poolWideCatalog` 下的整池)限定范围并回显 `selectedModels`;模型解析同样合并,使「只有配额快照才知道」的模型仍可解析。
18
+ - **解析刻意不做过滤**:用户后来取消勾选的模型,已在运行的会话仍能解析——取消勾选不得打断进行中的工作。只有 `listModels`(选择器)过滤。
19
+ - 合并说明:PR 内联的配置校验已替换为 v0.6.52 引入的统一 `validateConfigValue()` 并补充 `selectedModels`;维护者自有的 `CHANGELOG.md`/`package.json` 保持。
20
+
21
+ ## 0.6.52 (2026-11-21)
22
+
23
+ ### English
24
+
25
+ - **Fix(commands/goal & plan): align DSH `/goal`, `/plan`, and `/agy` bridges 1-to-1 with zero redundancy and strict idempotency.**
26
+ - **DSH GoalService parity (`/agy goal`)**: `handleGoal` now delegates to DSH `ctx.goals` (`GoalService`) when present, adding `set` and `edit` subcommands, keeping `activation` (`armed`/`disarmed`), `goal/changed` broadcasts, and `roundsStarted` accurate, and turning repeated `pause`/`resume`/`complete`/`clear` calls into idempotent no-ops. Its fallback event-log path enforces DSH `goalProjectionDefinition` fold invariants (blocking illegal transitions like `complete -> pause` or empty `clear`), and `resolveSessionGoal()` no longer skips `edit` events.
27
+ - **Plan mode & `exit_plan_mode` continuation**: `isPlanMode()` consults live session state (`ctx.planMode` / `plan/change`), `options.system` (`plan:policy`), and approved/rejected `exit_plan_mode` tool results; `classifyPlanToolContinuation()` only short-circuits on dismissal so approved plans execute outside `--mode plan` and keep-planning feedback re-runs cleanly; `buildChatPromptText()` preserves `agytc-bridge-*` tool results even on bound conversations; `buildPlanExitToolCallBlock()` ensures a leading `# ` heading and uses monotonic callIds excluded from `parseMirrorCallId()`.
28
+ - **`EventMapper` & continuation safety**: `EventMapper` only synthesizes `update_goal` when `goalContext.goalId` is defined; `isSyntheticHarnessMessage()` recognizes `'plan-mode'` and `'<goal_blocked>'`; `hasFinishableEventFrom()` treats `CANCELED`/`CANCELLED` as terminal states.
29
+ - **Refactor(host/commands/routes): remove duplication and enforce idempotency across config, MCP bridge, session, pool, and image utilities.**
30
+ - Deduplicated message-text helpers in `src/host/dsh-goal.ts` (reusing `prompt-text.ts`), MCP bridge registration via `registerBridgeMcpConfig()` / `teardownBridgeState()`, and session binding removal via `dropMostRecentBinding()` / `dropSessionBindings()`.
31
+ - Made `setOverride()` disk writes, `copyArtifact()` (when `source === target`), `/agy remove-account` (`cleanupStaleAccounts?.()` + non-duplicated `notifyPicker`), `/agy effort`/`mode`/`workspace` (spaces preserved from `ctx.raw`), and `/config` `permissionMode` validation consistent and idempotent.
32
+ - Fixed Windows drive/WSL path + `.bmp` extraction in `IMAGE_PATH_RE` (`src/features/image/prompt.ts`), unified Windows manual quota sweeps in `QuotaService.refreshAllQuotas(true)` through `sweepAccountsByEgress()` honoring `forceConcurrency`, and made `test/services.test.ts`'s mock `agy` stub cross-platform.
33
+
34
+ ### 中文
35
+
36
+ - **修复(命令/Goal 与 Plan):使 DSH `/goal`、`/plan` 与 `/agy` 桥接及状态机与 `agy` 一一对齐,零冗余且严格幂等。**
37
+ - **对齐 DSH `GoalService`(`/agy goal`)**:优先委托给 DSH `ctx.goals`(`GoalService`),补全 `set` 与 `edit` 子命令,确保 `activation`(`armed`/`disarmed`)、`goal/changed` 事件和 `roundsStarted` 计数准确;重复执行 `pause`/`resume`/`complete`/`clear` 改为幂等空操作;事件日志回退路径严格遵循 DSH `goalProjectionDefinition` 折叠约束(阻止 `complete -> pause` 等非法跃迁);修复 `resolveSessionGoal()` 跳过 `edit` 事件导致状态陈旧的 bug。
38
+ - **Plan 模式与 `exit_plan_mode` 续接**:`isPlanMode()` 综合读取实时会话状态(`ctx.planMode` / `plan/change`)、`options.system`(`plan:policy`)及审批结果;`classifyPlanToolContinuation()` 仅在用户取消/驳回审查时短路结束,审批通过或带反馈继续规划时会继续驱动 `agy` 执行/修订,并在 `buildChatPromptText()` 中对已绑定会话保留 `agytc-bridge-*` 工具结果文本;`buildPlanExitToolCallBlock()` 自动补全 `# ` 标题前缀并使用不与镜像工具 ID 冲突的单调 `agytc-bridge-plan-*` ID。
39
+ - **`EventMapper` 与续接一致性**:仅在 `goalContext.goalId` 明确存在时合成 `update_goal`;`isSyntheticHarnessMessage()` 补充识别 `'plan-mode'` 与 `'<goal_blocked>'`;`hasFinishableEventFrom()` 将 `CANCELED`/`CANCELLED` 识别为终止状态。
40
+ - **重构(宿主/命令/路由):消除全项目冗余与非幂等问题,补齐校验与清理逻辑。**
41
+ - 收敛 `dsh-goal.ts` 的消息文本提取(复用 `prompt-text.ts`)、`registerBridgeMcpConfig()` / `teardownBridgeState()` 的 MCP 配置幂等注册与清理,以及 `dropMostRecentBinding()` / `dropSessionBindings()`。
42
+ - 修复 `setOverride()` 重复写盘、`copyArtifact()` 同路径复制、`/agy remove-account` 清理残留账号绑定与重复刷新选择器、`/agy effort`/`mode`/`workspace`(保留含空格路径)及 `/config` 的 `permissionMode` 校验。
43
+ - 修复 `IMAGE_PATH_RE` 对 Windows 盘符路径及 `.bmp` 的匹配问题,统一 `QuotaService.refreshAllQuotas(true)` 在 Windows 下通过 `sweepAccountsByEgress()` 执行并尊重 `forceConcurrency`,并使 `test/services.test.ts` 的 mock `agy` 脚本跨平台兼容。
44
+
3
45
  ## 0.6.51 (2026-11-21)
4
46
 
5
47
  ### English