dsh-agy-link 0.6.26 → 0.6.27

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.27 (2026-11-15)
4
+
5
+ ### English
6
+
7
+ - **Fix(security): DSH plan mode is now read-only at the agy layer (issue #113, part 2).** `permissionMode` was always taken from the static config (default `skip` → `--dangerously-skip-permissions`), so during a plan-mode turn agy could still write files and the `exit_plan_mode` approval card only constrained the prompt. A new `effectivePermissionMode()` forces `--mode plan` when the host is in plan mode, using the presence of the `exit_plan_mode` tool as a **current-turn** signal so exiting plan mode immediately restores the configured mode; auxiliary calls keep their existing read-only policy. Pure decision matrix + real-spawn argv regression tests.
8
+ - **Not planned: interactive `ask_question` / `/grill-me` (issue #113, part 1).** This is not a filter bug: agy's `-p` / `--input-format stream-json` print mode is one-way and auto-answers `ask_question` with `User Skipped`. Making it interactive requires replacing the bridge's transport with ACP (`agy acp`, stdio JSON-RPC) — a different session lifecycle, streaming protocol and tool-mirroring path, i.e. a separate architectural project, not a patch. The question card rendering already exists; it appears after the turn because print mode cannot pause. Tracked in the issue reply, not shipped here.
9
+
10
+ ### 中文
11
+
12
+ - **修复(安全):DSH plan mode 在 agy 层也强制只读(issue #113 第 2 项)。** `permissionMode` 此前只取静态配置(缺省 `skip` → `--dangerously-skip-permissions`),所以规划轮次里 agy 仍能直接写文件,`exit_plan_mode` 审批卡只约束了提示词。新增 `effectivePermissionMode()`:当宿主处于 plan mode 时强制 `--mode plan`,并以「本轮提供了 `exit_plan_mode` 工具」作为当前轮次信号(避免历史里的 plan 提示词让会话永久只读),退出 plan mode 立即恢复配置值;辅助调用沿用既有只读策略。纯函数矩阵 + 真实 spawn argv 双重回归测试。
13
+ - **暂不实现:交互式 `ask_question` / `/grill-me`(issue #113 第 1 项)。** 这不是过滤逻辑缺陷:agy 的 `-p` / `--input-format stream-json` 是单向 print 模式,会把 `ask_question` 自动回填 `User Skipped`。要真正交互必须把桥接层传输协议换成 ACP(`agy acp`,stdio JSON-RPC),涉及完全不同的会话生命周期、流式协议与工具镜像链路,属于独立架构项目而非补丁。问题卡片渲染已存在,只是因为 print 模式无法暂停而出现在轮次结束之后。已在 issue 回复中说明,本版本不发布该能力。
14
+
3
15
  ## 0.6.26 (2026-11-15)
4
16
 
5
17
  ### English
@@ -1502,6 +1502,20 @@ function defaultPoolData() {
1502
1502
  }
1503
1503
  //#endregion
1504
1504
  //#region src/provider/call-context.ts
1505
+ /**
1506
+ * Effective agy permission mode for one turn.
1507
+ *
1508
+ * DSH plan mode is a READ-ONLY contract. `cfg.permissionMode` is static and
1509
+ * defaults to `skip` (`--dangerously-skip-permissions`); without this override
1510
+ * agy can write files while the host believes it is only planning (issue #113).
1511
+ * The caller supplies `dshPlanMode` from a CURRENT-turn signal (the host only
1512
+ * exposes `exit_plan_mode` while plan mode is active), never from stale
1513
+ * history, so exiting plan mode restores the configured mode immediately.
1514
+ * Auxiliary calls already have their own read-only policy.
1515
+ */
1516
+ function effectivePermissionMode(configured, dshPlanMode, isAux) {
1517
+ return dshPlanMode && !isAux ? "plan" : configured;
1518
+ }
1505
1519
  function resolveCallContext(input) {
1506
1520
  const { options, cfg, bin } = input;
1507
1521
  if (!bin) throw new LlmError("agy binary not found on PATH — install it via https://antigravity.google/docs/cli/install", Err.AGY_NOT_INSTALLED);
@@ -34030,6 +34044,7 @@ var AgyAdapter = class extends LlmAdapter {
34030
34044
  const goalContext = resolveGoalContext(options.messages, liveGoal);
34031
34045
  const supportsGoalUpdate = Boolean(options.tools?.some((t) => t.name === "update_goal"));
34032
34046
  const supportsPlanExit = Boolean(options.tools?.some((t) => t.name === "exit_plan_mode")) && isPlanMode(options.messages);
34047
+ const agyPermissionMode = effectivePermissionMode(permissionMode, supportsPlanExit, isAux);
34033
34048
  const continuation = detectContinuation(options.messages);
34034
34049
  if (continuation !== null) {
34035
34050
  const rec = this.deps.runs.get(continuation.runId);
@@ -34209,7 +34224,7 @@ var AgyAdapter = class extends LlmAdapter {
34209
34224
  }, {
34210
34225
  cfg,
34211
34226
  bin,
34212
- permissionMode,
34227
+ permissionMode: agyPermissionMode,
34213
34228
  sessionKey,
34214
34229
  workspaceRoot,
34215
34230
  isAux,
package/dist/index.js CHANGED
@@ -2916,6 +2916,20 @@ async function runAgyOnce(deps, req) {
2916
2916
  }
2917
2917
  //#endregion
2918
2918
  //#region src/provider/call-context.ts
2919
+ /**
2920
+ * Effective agy permission mode for one turn.
2921
+ *
2922
+ * DSH plan mode is a READ-ONLY contract. `cfg.permissionMode` is static and
2923
+ * defaults to `skip` (`--dangerously-skip-permissions`); without this override
2924
+ * agy can write files while the host believes it is only planning (issue #113).
2925
+ * The caller supplies `dshPlanMode` from a CURRENT-turn signal (the host only
2926
+ * exposes `exit_plan_mode` while plan mode is active), never from stale
2927
+ * history, so exiting plan mode restores the configured mode immediately.
2928
+ * Auxiliary calls already have their own read-only policy.
2929
+ */
2930
+ function effectivePermissionMode(configured, dshPlanMode, isAux) {
2931
+ return dshPlanMode && !isAux ? "plan" : configured;
2932
+ }
2919
2933
  function resolveCallContext(input) {
2920
2934
  const { options, cfg, bin } = input;
2921
2935
  if (!bin) throw new LlmError("agy binary not found on PATH — install it via https://antigravity.google/docs/cli/install", Err.AGY_NOT_INSTALLED);
@@ -34549,6 +34563,7 @@ var AgyAdapter = class extends LlmAdapter {
34549
34563
  const goalContext = resolveGoalContext(options.messages, liveGoal);
34550
34564
  const supportsGoalUpdate = Boolean(options.tools?.some((t) => t.name === "update_goal"));
34551
34565
  const supportsPlanExit = Boolean(options.tools?.some((t) => t.name === "exit_plan_mode")) && isPlanMode(options.messages);
34566
+ const agyPermissionMode = effectivePermissionMode(permissionMode, supportsPlanExit, isAux);
34552
34567
  const continuation = detectContinuation(options.messages);
34553
34568
  if (continuation !== null) {
34554
34569
  const rec = this.deps.runs.get(continuation.runId);
@@ -34728,7 +34743,7 @@ var AgyAdapter = class extends LlmAdapter {
34728
34743
  }, {
34729
34744
  cfg,
34730
34745
  bin,
34731
- permissionMode,
34746
+ permissionMode: agyPermissionMode,
34732
34747
  sessionKey,
34733
34748
  workspaceRoot,
34734
34749
  isAux,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.6.26",
3
+ "version": "0.6.27",
4
4
  "description": "Google Antigravity (agy CLI) models for DeepSeek Harness — stream Gemini/Claude/GPT-OSS subscriptions into DSH with thinking, tool activity, token usage and in-GUI Google OAuth login.",
5
5
  "type": "module",
6
6
  "license": "MIT",