dsh-agy-link 0.6.41 → 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 +24 -0
- package/dist/cli-image.mjs +4 -3
- package/dist/client.js +4 -0
- package/dist/index.js +34 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
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
|
+
|
|
15
|
+
## 0.6.42 (2026-11-20)
|
|
16
|
+
|
|
17
|
+
### English
|
|
18
|
+
|
|
19
|
+
- **Fix(quota): a free-tier account's refused summary is suppressed instead of retried every hour (fixes #137).** A Google account without a paid Antigravity subscription has no 5h window, so `retrieveUserQuotaSummary` answers `403 PERMISSION_DENIED` — without any "licence" wording. `classifySummaryRefusal()` therefore classified it as a generic `http` failure, `quotaUnavailable` recorded it as `partial`/`unreachable`, and `quotaSummarySuppressed()` only honours `no_license`: the hourly background poll kept repeating the same 403 forever. There is now a distinct **`no_summary_access`** verdict (403 + `PERMISSION_DENIED`), recorded with a **7-day** retry window aligned to the weekly quota cycle (an unlicensed account keeps its 6h window, since a fresh licence can arrive at any time).
|
|
20
|
+
- **The two kinds of suppression are now separate**, which matters because they have different scope: `quotaSummarySuppressed()` skips only the summary call (the pipeline still refreshes `fetchAvailableModels` / user quota), while the new `accountPollSuppressed()` decides whether an account leaves the background poll entirely — and only a licence-less account does. Folding the free-tier case into `no_license` would have frozen its model list, so it keeps polling and merely stops hammering the refused endpoint. The console now says "free-tier account · weekly quota only" instead of a generic refresh failure (four locales).
|
|
21
|
+
|
|
22
|
+
### 中文
|
|
23
|
+
|
|
24
|
+
- **修复(额度):免费账号被拒绝的汇总请求改为压制,而不再每小时重试(修复 #137)。** 未购买 Antigravity 付费订阅的 Google 账号没有 5 小时窗口,`retrieveUserQuotaSummary` 直接返回 `403 PERMISSION_DENIED`——正文不含任何 `licence` 字样。因此 `classifySummaryRefusal()` 把它归为通用 `http` 失败,`quotaUnavailable` 记成 `partial`/`unreachable`,而 `quotaSummarySuppressed()` 只认 `no_license`:后台每小时轮询就一直重复同一个 403。现在新增独立的 **`no_summary_access`** 判定(403 + `PERMISSION_DENIED`),并按**7 天**(对齐周配额周期)压制;无许可账号仍保持 6 小时窗口,以便新许可随时恢复。
|
|
25
|
+
- **两类压制现在拆开**,因为作用域不同:`quotaSummarySuppressed()` 只跳过汇总请求(管道仍刷新 `fetchAvailableModels` / 用户额度),新增的 `accountPollSuppressed()` 才决定账号是否完全退出后台轮询——只有「无许可」账号如此。若把免费账号并进 `no_license`,会连带冻结它的模型列表,所以它继续参与轮询、只是不再打那个必然被拒的端点。控制台文案改为「免费账号 · 仅限周配额」,不再是通用的刷新失败(四语言)。
|
|
26
|
+
|
|
3
27
|
## 0.6.41 (2026-11-19)
|
|
4
28
|
|
|
5
29
|
### English
|
package/dist/cli-image.mjs
CHANGED
|
@@ -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
|
-
|
|
34858
|
-
if (
|
|
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/client.js
CHANGED
|
@@ -80,6 +80,7 @@ window.__ModuleLoader__.load({
|
|
|
80
80
|
"quota.refreshInProgress": "该账号正在刷新中,请稍候",
|
|
81
81
|
"quota.unavailableTitle": "配额刷新失败",
|
|
82
82
|
"quota.unavailable.no_license": "此账号无有效许可(接口 403)",
|
|
83
|
+
"quota.unavailable.no_summary_access": "免费账号 · 仅限周配额(汇总接口被拒绝)",
|
|
83
84
|
"quota.unavailable.auth": "登录凭据已失效(401)",
|
|
84
85
|
"quota.unavailable.unreachable": "配额接口不可达",
|
|
85
86
|
"quota.unavailable.partial": "只取到模型级数据,5 小时/周额度未更新",
|
|
@@ -308,6 +309,7 @@ window.__ModuleLoader__.load({
|
|
|
308
309
|
"quota.refreshInProgress": "A refresh is already running for this account",
|
|
309
310
|
"quota.unavailableTitle": "Quota refresh failed",
|
|
310
311
|
"quota.unavailable.no_license": "this account has no valid license (HTTP 403)",
|
|
312
|
+
"quota.unavailable.no_summary_access": "free-tier account · weekly quota only (the summary endpoint is refused)",
|
|
311
313
|
"quota.unavailable.auth": "the login credential is no longer valid (401)",
|
|
312
314
|
"quota.unavailable.unreachable": "the quota endpoints are unreachable",
|
|
313
315
|
"quota.unavailable.partial": "only per-model data arrived; 5-hour/weekly figures are stale",
|
|
@@ -536,6 +538,7 @@ window.__ModuleLoader__.load({
|
|
|
536
538
|
"quota.refreshInProgress": "Já existe uma atualização em andamento para esta conta",
|
|
537
539
|
"quota.unavailableTitle": "Falha ao atualizar a cota",
|
|
538
540
|
"quota.unavailable.no_license": "esta conta não tem uma licença válida (HTTP 403)",
|
|
541
|
+
"quota.unavailable.no_summary_access": "conta gratuita · apenas cota semanal (o resumo é recusado)",
|
|
539
542
|
"quota.unavailable.auth": "a credencial de acesso não é mais válida (401)",
|
|
540
543
|
"quota.unavailable.unreachable": "não é possível alcançar os serviços de cota",
|
|
541
544
|
"quota.unavailable.partial": "só chegaram dados por modelo; os números de 5 h/semana estão desatualizados",
|
|
@@ -764,6 +767,7 @@ window.__ModuleLoader__.load({
|
|
|
764
767
|
"quota.refreshInProgress": "Ya hay una actualización en curso para esta cuenta",
|
|
765
768
|
"quota.unavailableTitle": "No se pudo actualizar la cuota",
|
|
766
769
|
"quota.unavailable.no_license": "esta cuenta no tiene una licencia válida (HTTP 403)",
|
|
770
|
+
"quota.unavailable.no_summary_access": "cuenta gratuita · solo cuota semanal (el resumen se rechaza)",
|
|
767
771
|
"quota.unavailable.auth": "la credencial de acceso ya no es válida (401)",
|
|
768
772
|
"quota.unavailable.unreachable": "no se puede alcanzar los servicios de cuota",
|
|
769
773
|
"quota.unavailable.partial": "solo llegaron datos por modelo; las cifras de 5 h/semana están desactualizadas",
|
package/dist/index.js
CHANGED
|
@@ -574,6 +574,19 @@ function modelFamilyOf(modelId) {
|
|
|
574
574
|
* be retried normally.
|
|
575
575
|
*/
|
|
576
576
|
function quotaSummarySuppressed(account, now = Date.now()) {
|
|
577
|
+
const state = account.quotaUnavailable;
|
|
578
|
+
if (state === void 0) return false;
|
|
579
|
+
if (state.reason !== "no_license" && state.reason !== "no_summary_access") return false;
|
|
580
|
+
return state.retryAfter > now;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Whether the account should leave the background poll ENTIRELY.
|
|
584
|
+
*
|
|
585
|
+
* Only a licence-less account qualifies: it can produce no quota data at all.
|
|
586
|
+
* A free-tier account whose SUMMARY is refused still refreshes its model list
|
|
587
|
+
* and user quota, so skipping it would freeze the picker (issue #137).
|
|
588
|
+
*/
|
|
589
|
+
function accountPollSuppressed(account, now = Date.now()) {
|
|
577
590
|
const state = account.quotaUnavailable;
|
|
578
591
|
if (state === void 0) return false;
|
|
579
592
|
if (state.reason !== "no_license") return false;
|
|
@@ -655,7 +668,7 @@ function shouldPollAccount(account) {
|
|
|
655
668
|
if (!account.enabled) return false;
|
|
656
669
|
if (account.authRequired) return false;
|
|
657
670
|
const now = Date.now();
|
|
658
|
-
if (
|
|
671
|
+
if (accountPollSuppressed(account, now)) return false;
|
|
659
672
|
for (const cd of Object.values(account.cooldowns ?? {})) if (cd && cd.cooldownUntil > now) return false;
|
|
660
673
|
return true;
|
|
661
674
|
}
|
|
@@ -3111,6 +3124,12 @@ const QUOTA_ENDPOINT_DOWN_MS = 6e5;
|
|
|
3111
3124
|
*/
|
|
3112
3125
|
const QUOTA_LICENSE_RETRY_MS = 216e5;
|
|
3113
3126
|
/**
|
|
3127
|
+
* How long a free-tier account's refused summary call stays suppressed.
|
|
3128
|
+
* Aligned with the weekly quota window: the verdict only changes when the
|
|
3129
|
+
* account's entitlement does, which cannot happen within hours (#137).
|
|
3130
|
+
*/
|
|
3131
|
+
const QUOTA_FREE_TIER_RETRY_MS = 6048e5;
|
|
3132
|
+
/**
|
|
3114
3133
|
* Grace the idle watchdog grants before killing a quiet child. libuv runs the
|
|
3115
3134
|
* timers phase BEFORE the poll phase: when the DSH host's event loop is blocked
|
|
3116
3135
|
* (a large parse, many parallel workers), an expired watchdog can fire before
|
|
@@ -33201,7 +33220,8 @@ function isSyntheticHarnessMessage(m) {
|
|
|
33201
33220
|
const src = m.source;
|
|
33202
33221
|
const kind = src?.kind;
|
|
33203
33222
|
if (kind !== void 0 && kind !== "" && kind !== "user") {
|
|
33204
|
-
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;
|
|
33205
33225
|
if (kind === "plugin" && src.form === "snapshot") return true;
|
|
33206
33226
|
}
|
|
33207
33227
|
const text = textOf(m).trim();
|
|
@@ -35628,8 +35648,8 @@ function toolCallIdOf(m) {
|
|
|
35628
35648
|
function detectContinuation(messages) {
|
|
35629
35649
|
let i = messages.length - 1;
|
|
35630
35650
|
while (i >= 0) {
|
|
35631
|
-
|
|
35632
|
-
if (
|
|
35651
|
+
if (messages[i].role !== "user") break;
|
|
35652
|
+
if (!isSyntheticHarnessMessage(messages[i])) break;
|
|
35633
35653
|
i--;
|
|
35634
35654
|
}
|
|
35635
35655
|
const last = messages[i];
|
|
@@ -39546,6 +39566,7 @@ function buildFamilyQuotas(params) {
|
|
|
39546
39566
|
function unavailableReason(failure, hasModelData) {
|
|
39547
39567
|
if (failure === null) return hasModelData ? "partial" : "unreachable";
|
|
39548
39568
|
if (failure.kind === "no_license") return "no_license";
|
|
39569
|
+
if (failure.kind === "no_summary_access") return "no_summary_access";
|
|
39549
39570
|
if (failure.kind === "auth") return "auth";
|
|
39550
39571
|
if (failure.kind === "network") return "unreachable";
|
|
39551
39572
|
return hasModelData ? "partial" : "unreachable";
|
|
@@ -39640,10 +39661,11 @@ async function refreshAccountQuotaPipeline(deps, account, force = false) {
|
|
|
39640
39661
|
const failure = deps.summaryFailure?.() ?? null;
|
|
39641
39662
|
const reason = unavailableReason(failure, Object.keys(modelsCatalog).length > 0);
|
|
39642
39663
|
const previous = account.quotaUnavailable;
|
|
39664
|
+
const retryMs = reason === "no_summary_access" ? QUOTA_FREE_TIER_RETRY_MS : QUOTA_LICENSE_RETRY_MS;
|
|
39643
39665
|
deps.pool.noteQuotaUnavailable(account.id, {
|
|
39644
39666
|
reason,
|
|
39645
39667
|
since: previous?.reason === reason ? previous.since : now,
|
|
39646
|
-
retryAfter: now +
|
|
39668
|
+
retryAfter: now + retryMs,
|
|
39647
39669
|
...failure?.detail === void 0 ? {} : { detail: failure.detail }
|
|
39648
39670
|
});
|
|
39649
39671
|
}
|
|
@@ -39801,6 +39823,11 @@ function classifySummaryRefusal(status, bodyText = "") {
|
|
|
39801
39823
|
status,
|
|
39802
39824
|
...detail === void 0 ? {} : { detail }
|
|
39803
39825
|
};
|
|
39826
|
+
if (status === 403 && detail === "PERMISSION_DENIED") return {
|
|
39827
|
+
kind: "no_summary_access",
|
|
39828
|
+
status,
|
|
39829
|
+
detail
|
|
39830
|
+
};
|
|
39804
39831
|
return {
|
|
39805
39832
|
kind: "http",
|
|
39806
39833
|
status,
|
|
@@ -41518,7 +41545,8 @@ function createHostServices(ctx, entryConfig = {}) {
|
|
|
41518
41545
|
const list = [];
|
|
41519
41546
|
try {
|
|
41520
41547
|
const svc = sessionsSvc();
|
|
41521
|
-
|
|
41548
|
+
const source = typeof svc?.list === "function" ? svc.list() : typeof svc?.values === "function" ? svc.values() : [];
|
|
41549
|
+
for (const s of source) {
|
|
41522
41550
|
const cwd = s?.header?.cwd;
|
|
41523
41551
|
if (cwd && !list.includes(cwd)) list.push(cwd);
|
|
41524
41552
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agy-link",
|
|
3
|
-
"version": "0.6.
|
|
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",
|