dsh-agy-link 0.6.44 → 0.6.45

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.45 (2026-11-20)
4
+
5
+ ### English
6
+
7
+ - **Fix(quota): the free-tier verdict is decided by the API status, so the branch is no longer dead code (fixes #142).** The refusal classifier checked the `license` phrase before `PERMISSION_DENIED`, and a real 403 can carry **both** — so the free-tier branch added in v0.6.42 never ran and those accounts stayed on the 6h licence window instead of the 7-day free-tier one. `PERMISSION_DENIED` (the structured API-level detail) now wins, and a licence phrase **without** it still yields `no_license`, so both branches stay reachable and are pinned by tests.
8
+ - **Fix(client): a file link actually opens in the right Sidebar preview (fixes #141).** `canPreviewFiles()` probed `sidebarRightTabs.get()` with the tab **type id**, but that method is keyed by tab **kind** (`'text'`), so the probe always returned `undefined` and every click fell through to the OS opener. It now looks the id up in `entries()` and falls back to `get('text')` while confirming the returned id, so an unrelated text tab is never mistaken for the preview. `normalizeLocalPath()` also percent-decodes now (after the `?#` split, before separator normalization), so an encoded href (`Bio%20Fuel%20Cell`, `%5C`) matches the session cwd instead of being re-encoded into a path that does not exist.
9
+ - Two existing client tests encoded the *wrong* registry contract (mocking `get()` by id); they now mock the real one, which is what let this bug pass CI.
10
+
11
+ ### 中文
12
+
13
+ - **修复(额度):免费档判定改由 API 状态决定,分支不再不可达(修复 #142)。** 拒绝分类器先匹配 `license` 字样再匹配 `PERMISSION_DENIED`,而真实 403 **两者并存**——于是 v0.6.42 新增的免费档分支从未执行,这类账号仍停留在 6 小时许可窗口而非 7 天免费档窗口。现在结构化的 `PERMISSION_DENIED` 优先;**仅含** license 字样而无该状态时仍判 `no_license`,两个分支都保持可达并有测试锁定。
14
+ - **修复(客户端):文件链接终于进右侧边栏预览(修复 #141)。** `canPreviewFiles()` 用标签**类型 id** 去查 `sidebarRightTabs.get()`,但该方法以标签 **kind**(`'text'`)为键,探测恒为 `undefined`,每次点击都落到系统程序。现在先在 `entries()` 里按 id 查,回退到 `get('text')` 时再核对返回值的 id,避免把别的 text 标签误认成预览。`normalizeLocalPath()` 也补上百分号解码(在 `?#` 拆分之后、分隔符归一之前),因此被编码的 href(`Bio%20Fuel%20Cell`、`%5C`)能与会话 cwd 对上,而不是被二次编码成不存在的路径。
15
+ - 两个既有客户端测试固化的正是**错误的**注册表契约(把 `get()` 当 id 查询用),现已改为真实契约——这正是该 bug 能通过 CI 的原因。
16
+
3
17
  ## 0.6.44 (2026-11-20)
4
18
 
5
19
  ### English
package/dist/client.js CHANGED
@@ -2693,15 +2693,30 @@ window.__ModuleLoader__.load({
2693
2693
  const normalized = filePath.replace(/\\/g, "/").replace(/^(?:\.\/)+/, "");
2694
2694
  return `dsh-resource://file/session/${encodeSegment(sessionId)}/${normalized.split("/").map(encodeSegment).join("/")}`;
2695
2695
  }
2696
- /** `file:///C:/x` | `file://C:/x` | `C:\x` → `C:/x`, dropping a `#L12` / `?v=1` suffix. */
2696
+ /**
2697
+ * `file:///C:/x` | `file://C:/x` | `C:\x` → `C:/x`, dropping a `#L12` / `?v=1` suffix.
2698
+ *
2699
+ * Percent-decoding happens AFTER the `?#` split (so `%3F` in a name is not
2700
+ * mistaken for a query) and before the separator normalization: an encoded href
2701
+ * (`Bio%20Fuel%20Cell`, `%5C`) otherwise never matches the session cwd, and the
2702
+ * address is then rebuilt with a second round of encoding (issue #141).
2703
+ */
2697
2704
  function normalizeLocalPath(raw) {
2698
2705
  let p = raw.trim();
2699
2706
  if (p.startsWith("file://")) {
2700
2707
  p = p.slice(7);
2701
2708
  if (/^\/[A-Za-z]:/.test(p)) p = p.slice(1);
2702
2709
  }
2703
- const [pathPart] = p.replace(/\\/g, "/").split(/[?#]/);
2704
- return (pathPart ?? "").replace(/^(?:\.\/)+/, "");
2710
+ const [pathPart] = p.split(/[?#]/);
2711
+ return decodePercent(pathPart ?? "").replace(/\\/g, "/").replace(/^(?:\.\/)+/, "");
2712
+ }
2713
+ /** Decode a percent-encoded path, keeping the raw text when it is malformed. */
2714
+ function decodePercent(value) {
2715
+ try {
2716
+ return decodeURIComponent(value);
2717
+ } catch {
2718
+ return value;
2719
+ }
2705
2720
  }
2706
2721
  function sidebarRightOf(ctx) {
2707
2722
  const sidebarRight = service$1(ctx, "sidebarRight");
@@ -2714,7 +2729,9 @@ window.__ModuleLoader__.load({
2714
2729
  */
2715
2730
  function canPreviewFiles(ctx) {
2716
2731
  const tabs = service$1(ctx, "sidebarRightTabs");
2717
- return tabs?.get?.(DOCUMENT_PREVIEW_TAB) !== void 0 && tabs?.get?.(DOCUMENT_PREVIEW_TAB) !== null;
2732
+ const registered = tabs?.entries?.();
2733
+ if (Array.isArray(registered) && registered.some((entry) => entry?.id === DOCUMENT_PREVIEW_TAB)) return true;
2734
+ return tabs?.get?.("text")?.id === DOCUMENT_PREVIEW_TAB;
2718
2735
  }
2719
2736
  function mountedSessionId(sidebarRight) {
2720
2737
  const mounted = sidebarRight.mounted?.getSnapshot?.();
package/dist/index.js CHANGED
@@ -39831,16 +39831,16 @@ function classifySummaryRefusal(status, bodyText = "") {
39831
39831
  status,
39832
39832
  ...detail === void 0 ? {} : { detail }
39833
39833
  };
39834
- if (status === 403 && /licen[cs]e/i.test(bodyText)) return {
39835
- kind: "no_license",
39836
- status,
39837
- ...detail === void 0 ? {} : { detail }
39838
- };
39839
39834
  if (status === 403 && detail === "PERMISSION_DENIED") return {
39840
39835
  kind: "no_summary_access",
39841
39836
  status,
39842
39837
  detail
39843
39838
  };
39839
+ if (status === 403 && /licen[cs]e/i.test(bodyText)) return {
39840
+ kind: "no_license",
39841
+ status,
39842
+ ...detail === void 0 ? {} : { detail }
39843
+ };
39844
39844
  return {
39845
39845
  kind: "http",
39846
39846
  status,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.6.44",
3
+ "version": "0.6.45",
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",