dsh-agy-link 0.6.50 → 0.6.52

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,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.52 (2026-11-21)
4
+
5
+ ### English
6
+
7
+ - **Fix(commands/goal & plan): align DSH `/goal`, `/plan`, and `/agy` bridges 1-to-1 with zero redundancy and strict idempotency.**
8
+ - **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.
9
+ - **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()`.
10
+ - **`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.
11
+ - **Refactor(host/commands/routes): remove duplication and enforce idempotency across config, MCP bridge, session, pool, and image utilities.**
12
+ - 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()`.
13
+ - 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.
14
+ - 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.
15
+
16
+ ### 中文
17
+
18
+ - **修复(命令/Goal 与 Plan):使 DSH `/goal`、`/plan` 与 `/agy` 桥接及状态机与 `agy` 一一对齐,零冗余且严格幂等。**
19
+ - **对齐 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。
20
+ - **Plan 模式与 `exit_plan_mode` 续接**:`isPlanMode()` 综合读取实时会话状态(`ctx.planMode` / `plan/change`)、`options.system`(`plan:policy`)及审批结果;`classifyPlanToolContinuation()` 仅在用户取消/驳回审查时短路结束,审批通过或带反馈继续规划时会继续驱动 `agy` 执行/修订,并在 `buildChatPromptText()` 中对已绑定会话保留 `agytc-bridge-*` 工具结果文本;`buildPlanExitToolCallBlock()` 自动补全 `# ` 标题前缀并使用不与镜像工具 ID 冲突的单调 `agytc-bridge-plan-*` ID。
21
+ - **`EventMapper` 与续接一致性**:仅在 `goalContext.goalId` 明确存在时合成 `update_goal`;`isSyntheticHarnessMessage()` 补充识别 `'plan-mode'` 与 `'<goal_blocked>'`;`hasFinishableEventFrom()` 将 `CANCELED`/`CANCELLED` 识别为终止状态。
22
+ - **重构(宿主/命令/路由):消除全项目冗余与非幂等问题,补齐校验与清理逻辑。**
23
+ - 收敛 `dsh-goal.ts` 的消息文本提取(复用 `prompt-text.ts`)、`registerBridgeMcpConfig()` / `teardownBridgeState()` 的 MCP 配置幂等注册与清理,以及 `dropMostRecentBinding()` / `dropSessionBindings()`。
24
+ - 修复 `setOverride()` 重复写盘、`copyArtifact()` 同路径复制、`/agy remove-account` 清理残留账号绑定与重复刷新选择器、`/agy effort`/`mode`/`workspace`(保留含空格路径)及 `/config` 的 `permissionMode` 校验。
25
+ - 修复 `IMAGE_PATH_RE` 对 Windows 盘符路径及 `.bmp` 的匹配问题,统一 `QuotaService.refreshAllQuotas(true)` 在 Windows 下通过 `sweepAccountsByEgress()` 执行并尊重 `forceConcurrency`,并使 `test/services.test.ts` 的 mock `agy` 脚本跨平台兼容。
26
+
27
+ ## 0.6.51 (2026-11-21)
28
+
29
+ ### English
30
+
31
+ - **Fix(quota): a successful CLI refresh now clears the stale `quotaUnavailable` marker (fixes #151).** The CLI-first path returns as soon as it has families, before the REST/summary branch that owns `clearQuotaUnavailable`. A marker written while the summary endpoint was down therefore outlived the successful refresh: the panel kept showing "quota refresh failed · endpoint unreachable · data from 19:02" while the stored quotas advanced past 22:44. Fresh CLI data is authoritative for this account, so the marker is cleared on that path too.
32
+ - **Fix(client): the decision chips speak the host language (fixes #153, part 1).** `installDecisionChips()` injected hardcoded Simplified Chinese: the header, the button tooltips, and — worst of all — the text written into the composer, so an English-configured host received a Chinese prefix as its own prompt. The copy now goes through the plugin's `locale` binding with English fallbacks, and the four locales define `decision.quickFill` / `decision.insertTooltip` / `decision.insertPayload`. An existing test that asserted the Chinese payload was updated to assert the localized one.
33
+
34
+ ### 中文
35
+
36
+ - **修复(额度):CLI 刷新成功后清除陈旧的 `quotaUnavailable` 标记(修复 #151)。** CLI 优先路径拿到 families 就返回,早于拥有 `clearQuotaUnavailable` 的 REST/汇总分支。于是在汇总接口不可达期间写入的标记会比成功刷新活得更久:面板一直显示「配额刷新失败 · 接口不可达 · 数据停留在 19:02」,而存储的额度其实已推进到 22:44 之后。CLI 的新鲜数据对该账号是权威的,因此这条路径也要清除标记。
37
+ - **修复(客户端):决策芯片改用宿主语言(修复 #153 第一部分)。** `installDecisionChips()` 硬编码了简体中文:标题、按钮 tooltip,以及**最糟的**——直接写进输入框的文本,导致英文配置的宿主把中文前缀当作自己的 prompt。文案现在走插件的 `locale` 绑定并带英文兜底,四个语言都新增 `decision.quickFill` / `decision.insertTooltip` / `decision.insertPayload`。一条原本断言中文 payload 的既有测试已改为断言本地化后的文本。
38
+
3
39
  ## 0.6.50 (2026-11-21)
4
40
 
5
41
  ### English