dsh-agy-link 0.6.42 → 0.6.43

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.43 (2026-11-20)
4
+
5
+ ### English
6
+
7
+ - **Fix(host): workspace files no longer 403 on every `/open` and `/media` request (fixes #139).** `activeCwds()` asserted a `values()` method on DSH's session service and guarded it with `typeof … === 'function'`; the real store exposes `list()`/`get(id)`, so the guard was always false and the function always returned `[]`. Every session workspace therefore fell outside the allowed roots and any file link inside it was refused with "path outside allowed workspace roots". It now reads `list()` (falling back to `values()` for hosts that publish that shape) and de-duplicates cwds; a throwing/unusable service still degrades to empty.
8
+ - **Fix(adapter): a DSH context message no longer looks like a user steer (fixes #138).** `detectContinuation()` only skipped trailing `source.kind === 'plugin' && form === 'snapshot'`, but DSH 0.2.2 producers each use their own kind (`time-context`, `agent-instructions`, `plugin:<name>` — dsh-llm has no catch-all `plugin` kind). Any of them after a tool result made the adapter treat the continuation as a fresh user request: it aborted the live agy run, injected "the previous turn was interrupted … respond only to the newest request", and the in-progress work was dropped. The scan now skips exactly what `isSyntheticHarnessMessage()` classifies as harness-injected (that predicate gained `agent-instructions` and the `plugin:<name>` family), while a real typed message — and any unknown boundary — still ends the scan as before.
9
+
10
+ ### 中文
11
+
12
+ - **修复(host):工作区文件不再在每次 `/open` 与 `/media` 请求上 403(修复 #139)。** `activeCwds()` 对 DSH 会话服务断言了 `values()` 并用 `typeof … === 'function'` 守卫;而真实的 store 只暴露 `list()` / `get(id)`,于是守卫恒为 false、函数永远返回 `[]`。所有会话工作区因此落在白名单之外,工作区内的文件链接一律被拒并报 "path outside allowed workspace roots"。现在读取 `list()`(对只提供 `values()` 的宿主回退),并去重 cwd;抛错时仍降级为空。
13
+ - **修复(adapter):DSH 的上下文消息不再被误判为用户插话(修复 #138)。** `detectContinuation()` 原先只跳过末尾 `source.kind === 'plugin' && form === 'snapshot'`,但 DSH 0.2.2 的各个生产者各有自己的 kind(`time-context`、`agent-instructions`、`plugin:<name>`——dsh-llm 并没有统一的 `plugin` kind)。工具结果之后只要出现其中之一,适配器就会把续接当成新的用户请求:中止正在运行的 agy run、注入「上一轮被中断…只回应最新请求」,进行中的工作被放弃。现在扫描只跳过 `isSyntheticHarnessMessage()` 认定为宿主注入的消息(该判定新增 `agent-instructions` 与 `plugin:<name>` 家族),真实用户文本与任何未知边界仍会像以前一样终止扫描。
14
+
3
15
  ## 0.6.42 (2026-11-20)
4
16
 
5
17
  ### English
@@ -5798,7 +5798,8 @@ function isSyntheticHarnessMessage(m) {
5798
5798
  const src = m.source;
5799
5799
  const kind = src?.kind;
5800
5800
  if (kind !== void 0 && kind !== "" && kind !== "user") {
5801
- if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "synthetic") return true;
5801
+ if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "agent-instructions" || kind === "synthetic") return true;
5802
+ if (kind.startsWith("plugin:")) return true;
5802
5803
  if (kind === "plugin" && src.form === "snapshot") return true;
5803
5804
  }
5804
5805
  const text = textOf(m).trim();
@@ -34854,8 +34855,8 @@ function toolCallIdOf(m) {
34854
34855
  function detectContinuation(messages) {
34855
34856
  let i = messages.length - 1;
34856
34857
  while (i >= 0) {
34857
- const snapshot = messages[i];
34858
- if (snapshot.source?.kind !== "plugin" || snapshot.source.form !== "snapshot") break;
34858
+ if (messages[i].role !== "user") break;
34859
+ if (!isSyntheticHarnessMessage(messages[i])) break;
34859
34860
  i--;
34860
34861
  }
34861
34862
  const last = messages[i];
package/dist/index.js CHANGED
@@ -33220,7 +33220,8 @@ function isSyntheticHarnessMessage(m) {
33220
33220
  const src = m.source;
33221
33221
  const kind = src?.kind;
33222
33222
  if (kind !== void 0 && kind !== "" && kind !== "user") {
33223
- if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "synthetic") return true;
33223
+ if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "agent-instructions" || kind === "synthetic") return true;
33224
+ if (kind.startsWith("plugin:")) return true;
33224
33225
  if (kind === "plugin" && src.form === "snapshot") return true;
33225
33226
  }
33226
33227
  const text = textOf(m).trim();
@@ -35647,8 +35648,8 @@ function toolCallIdOf(m) {
35647
35648
  function detectContinuation(messages) {
35648
35649
  let i = messages.length - 1;
35649
35650
  while (i >= 0) {
35650
- const snapshot = messages[i];
35651
- if (snapshot.source?.kind !== "plugin" || snapshot.source.form !== "snapshot") break;
35651
+ if (messages[i].role !== "user") break;
35652
+ if (!isSyntheticHarnessMessage(messages[i])) break;
35652
35653
  i--;
35653
35654
  }
35654
35655
  const last = messages[i];
@@ -41544,7 +41545,8 @@ function createHostServices(ctx, entryConfig = {}) {
41544
41545
  const list = [];
41545
41546
  try {
41546
41547
  const svc = sessionsSvc();
41547
- if (typeof svc?.values === "function") for (const s of svc.values()) {
41548
+ const source = typeof svc?.list === "function" ? svc.list() : typeof svc?.values === "function" ? svc.values() : [];
41549
+ for (const s of source) {
41548
41550
  const cwd = s?.header?.cwd;
41549
41551
  if (cwd && !list.includes(cwd)) list.push(cwd);
41550
41552
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.6.42",
3
+ "version": "0.6.43",
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",