dsh-agy-acp 0.1.0 → 0.1.1

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/docs/changelog.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  [返回主页](../README.md) · [配置参考](configuration.md) · [接口参考](reference.md) · [开发与发布](development.md)
4
4
 
5
+ ## [0.1.1] - 2026-11-14
6
+
7
+ ### 修复
8
+ - 修复按需查询账号额度(`runQuotaExecCommand`)调用宿主 `ctx.subprocess.spawn` 时缺少必填 `graceMs` 且未嵌套 `stdio` 导致失败的问题,并从 `AgyWorkerService._doQuotaQuery` 显式透传 `config.graceMs`。
9
+ - 补充 `test/acp-quota.test.mjs` 对 `SubprocessSpawnSpec`(`stdio` 与 `graceMs`)的契约回归校验。
10
+
5
11
  ## [0.1.0] - 2026-11-14
6
12
 
7
13
  ### 新增
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-agy-acp",
3
3
  "displayName": "Antigravity ACP Worker",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "description": "Antigravity CLI (agy) ACP bridge for DeepSeek Harness: resumable worker turns, background job wakeup, semaphore queuing, four-tier permission gating, zero-sidecar SQLite token ledger, and on-demand quota inspection.",
6
6
  "license": "MIT",
7
7
  "author": "higekibaka",
package/src/acp-client.js CHANGED
@@ -22,7 +22,7 @@ const executableMod = require('./executable.js');
22
22
  const imagesMod = require('./images.js');
23
23
 
24
24
  const PLUGIN_NAME = 'dsh-agy-acp';
25
- const PLUGIN_VERSION = '0.1.0';
25
+ const PLUGIN_VERSION = '0.1.1';
26
26
  const PROTOCOL_VERSION = 1;
27
27
  const MAX_LINE_BYTES = 8 * 1024 * 1024;
28
28
 
package/src/quota.js CHANGED
@@ -232,6 +232,11 @@ async function runQuotaExecCommand(subprocess, executable, args, options = {}) {
232
232
  throw new Error('宿主未提供 subprocess.spawn,无法查询 agy 额度');
233
233
  }
234
234
  const timeoutMs = clampQuotaTimeout(options.timeoutMs);
235
+ const rawGrace = Number(options.graceMs ?? 1500);
236
+ const graceMs =
237
+ Number.isFinite(rawGrace) && rawGrace > 0
238
+ ? Math.min(2147483647, Math.max(1, Math.trunc(rawGrace)))
239
+ : 1500;
235
240
  const controller = new AbortController();
236
241
  let timedOut = false;
237
242
  let timer = null;
@@ -244,9 +249,12 @@ async function runQuotaExecCommand(subprocess, executable, args, options = {}) {
244
249
  handle = await subprocess.spawn({
245
250
  argv: [executable, ...args],
246
251
  cwd: options.cwd || os.tmpdir(),
247
- stdin: 'pipe',
248
- stdout: { mode: 'collect', maxBytes: 2 * 1024 * 1024 },
249
- stderr: { mode: 'collect', maxBytes: 16 * 1024 },
252
+ stdio: {
253
+ stdin: 'pipe',
254
+ stdout: { maxBytes: 2 * 1024 * 1024 },
255
+ stderr: { maxBytes: 16 * 1024 },
256
+ },
257
+ graceMs,
250
258
  });
251
259
 
252
260
  if (handle.stdin && typeof handle.stdin.end === 'function') {
@@ -1740,7 +1740,7 @@ class AgyWorkerService {
1740
1740
  this.subprocess,
1741
1741
  executable,
1742
1742
  ['-p', '/usage', '--output-format', 'json'],
1743
- { timeoutMs: quotaMod.QUOTA_HARD_TIMEOUT_MS }
1743
+ { timeoutMs: quotaMod.QUOTA_HARD_TIMEOUT_MS, graceMs: this.config.graceMs }
1744
1744
  );
1745
1745
  let creditsStdout = null;
1746
1746
  if (includeCredits) {
@@ -1748,7 +1748,7 @@ class AgyWorkerService {
1748
1748
  this.subprocess,
1749
1749
  executable,
1750
1750
  ['-p', '/credits', '--output-format', 'json'],
1751
- { timeoutMs: quotaMod.QUOTA_HARD_TIMEOUT_MS }
1751
+ { timeoutMs: quotaMod.QUOTA_HARD_TIMEOUT_MS, graceMs: this.config.graceMs }
1752
1752
  );
1753
1753
  creditsStdout = creditsRes.stdout;
1754
1754
  }