dsh-agy 0.4.5 → 0.4.6

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.
Files changed (33) hide show
  1. package/README.md +8 -3
  2. package/lib/{accounts-BOuz6_Sh.mjs → accounts-DtIsWCeF.mjs} +15 -11
  3. package/lib/{accounts-BOuz6_Sh.mjs.map → accounts-DtIsWCeF.mjs.map} +1 -1
  4. package/lib/cli/index.mjs +6 -6
  5. package/lib/client.js +181 -23
  6. package/lib/{constants-CmA9wXNe.mjs → constants-AdsD4sKh.mjs} +3 -3
  7. package/lib/{constants-CmA9wXNe.mjs.map → constants-AdsD4sKh.mjs.map} +1 -1
  8. package/lib/{exchange-C-tndv7j.mjs → exchange-B_rHhU8K.mjs} +3 -3
  9. package/lib/{exchange-C-tndv7j.mjs.map → exchange-B_rHhU8K.mjs.map} +1 -1
  10. package/lib/{import-SxPDjH3u.mjs → import-BqyA9tzt.mjs} +4 -4
  11. package/lib/{import-SxPDjH3u.mjs.map → import-BqyA9tzt.mjs.map} +1 -1
  12. package/lib/index.mjs +2 -2
  13. package/lib/{models-CjB0rXtI.mjs → models-D_54Ro5z.mjs} +3 -3
  14. package/lib/{models-CjB0rXtI.mjs.map → models-D_54Ro5z.mjs.map} +1 -1
  15. package/lib/{parse-D3InNyUx.mjs → parse-CeJc7cHo.mjs} +108 -8
  16. package/lib/parse-CeJc7cHo.mjs.map +1 -0
  17. package/lib/{plugin-common-Dwa1K13O.mjs → plugin-common-BlGbNHxX.mjs} +267 -10
  18. package/lib/plugin-common-BlGbNHxX.mjs.map +1 -0
  19. package/lib/{proxy-BbuQX5U9.mjs → proxy-B7VnbAfO.mjs} +5 -2
  20. package/lib/proxy-B7VnbAfO.mjs.map +1 -0
  21. package/lib/{quota-summary-DEA3P3Zh.mjs → quota-summary-DarIZkmo.mjs} +3 -3
  22. package/lib/{quota-summary-DEA3P3Zh.mjs.map → quota-summary-DarIZkmo.mjs.map} +1 -1
  23. package/lib/{translate-Cq6PGO4b.mjs → translate-vh3M5H_9.mjs} +7 -6
  24. package/lib/translate-vh3M5H_9.mjs.map +1 -0
  25. package/lib/web/plugin.d.mts +23 -1
  26. package/lib/web/plugin.d.mts.map +1 -1
  27. package/lib/web/plugin.mjs +86 -19
  28. package/lib/web/plugin.mjs.map +1 -1
  29. package/package.json +1 -1
  30. package/lib/parse-D3InNyUx.mjs.map +0 -1
  31. package/lib/plugin-common-Dwa1K13O.mjs.map +0 -1
  32. package/lib/proxy-BbuQX5U9.mjs.map +0 -1
  33. package/lib/translate-Cq6PGO4b.mjs.map +0 -1
package/README.md CHANGED
@@ -19,10 +19,11 @@ fingerprinting, and both CLI and web management.
19
19
  selection (family-scoped quotas, OMP-aligned ranking), automatic rotation on
20
20
  rate limits, per-account cooldown to the real reset time, per-account device
21
21
  fingerprints.
22
- - **Inline Settings UI**: an Antigravity section inside DSH Settings with four
22
+ - **Inline Settings UI**: an Antigravity section inside DSH Settings with five
23
23
  tabs — accounts (login, activation, grouped 5-hour/weekly quota windows, test
24
- calls, fingerprint and proxy management), models (per-model visibility), usage
25
- (cumulative token and request statistics), and credentials (import/export).
24
+ calls, fingerprint and proxy management), models (per-model visibility), config
25
+ (thinking budgets, multimodal inline limit), usage (cumulative token and request
26
+ statistics), and credentials (import/export).
26
27
  No separate page: the surface only exists where DSH Settings does.
27
28
  - **Quota badge in the session header**: the tightest of the active account's
28
29
  tracked windows (5-hour vs weekly) as a single figure, with the per-window
@@ -240,6 +241,8 @@ counter.
240
241
  | `DSH_AGY_DISABLE=1` | Kill switch: the plugin registers nothing (provider + Settings section + header quota badge + OAuth callback) and the CLI refuses to run. |
241
242
  | `DSH_AGY_FINGERPRINT_MODE=stable` | One fixed client identity per account — no per-request header randomization, no fingerprint regeneration (OMP-style fixed-client posture). Default `dynamic` keeps per-request randomization. |
242
243
  | `DSH_AGY_HEALTH_INTERVAL_MS=<ms>` | Background batch health probe inside the harness (refresh + userinfo on the configured interval); off by default. |
244
+ | `DSH_AGY_IDLE_TIMEOUT_MS=<ms>` | Silence budget for one SSE body read (default `180000`, 3 min; `0` disables). A body that stops producing bytes is abandoned instead of hanging the turn; any byte resets it, so a long reasoning pause is untouched. `AGY_IDLE_TIMEOUT_MS` is accepted as an alias. |
245
+ | `DSH_AGY_MULTIMODAL_MAX_INLINE_MB=<mb>` | Per-file cap for inlining non-image multimodal files, in MB (1–100). Overrides the Config tab setting; an unparseable or out-of-range value is ignored, leaving the stored value or the 20MB default in force. |
243
246
  | `AGY_CLIENT_ID` / `AGY_CLIENT_SECRET` | BYO OAuth app escape hatch: override the embedded public Antigravity client credentials. |
244
247
 
245
248
  ### About cache hits: why not 99% like DeepSeek V4?
@@ -284,6 +287,8 @@ folder afterwards, an old-version process is still running, and a warning says s
284
287
  `~/.dsh/agy/agy-fingerprint-data.json` — no code release needed to keep them current.
285
288
  - Model visibility: `~/.dsh/agy/agy-models.json` (0600) — the hidden-model blacklist.
286
289
  Holds only the models you switched off, so re-enabling one removes its entry.
290
+ - Multimodal inline cap: `~/.dsh/agy/agy-multimodal.json` (0600) — the per-file inline
291
+ limit in MB. An absent field means the built-in 20MB default.
287
292
  - Usage statistics: `~/.dsh/agy/agy-stats.json` (0600) — cumulative counters plus a
288
293
  rolling 30-day window. Counts are merged under a file lock, so several
289
294
  processes (Desktop, a web-profile server, the CLI) record concurrently without
@@ -1,5 +1,5 @@
1
- import { _ as setResolvedAgyVersion, a as AGY_PLATFORM_ENUM, b as QUOTA_WINDOWS, d as antigravityUserAgent, g as resolveAgyClientCredentials, l as OAUTH_TOKEN_URL, p as currentAgyVersion, t as AGY_CLIENT_ID, v as AgyAuthError, x as isProxyRouted, y as AgyPoolBlockedError } from "./constants-CmA9wXNe.mjs";
2
- import { a as probeFetch, l as redactCredentials, o as proxiedFetch, r as isProxyUnreachableError, t as accountFetch } from "./proxy-BbuQX5U9.mjs";
1
+ import { _ as setResolvedAgyVersion, a as AGY_PLATFORM_ENUM, b as QUOTA_WINDOWS, d as antigravityUserAgent, g as resolveAgyClientCredentials, l as OAUTH_TOKEN_URL, p as currentAgyVersion, t as AGY_CLIENT_ID, v as AgyAuthError, x as isProxyRouted, y as AgyPoolBlockedError } from "./constants-AdsD4sKh.mjs";
2
+ import { a as probeFetch, l as redactCredentials, o as proxiedFetch, r as isProxyUnreachableError, t as accountFetch } from "./proxy-B7VnbAfO.mjs";
3
3
  import { i as generateAntigravityRequestId, r as deriveAntigravitySessionId } from "./identity-Ci8EGc1F.mjs";
4
4
  import { i as parseRefreshParts, n as calculateTokenExpiry, r as formatRefreshParts, t as accessTokenExpired } from "./auth-DPPVFwio.mjs";
5
5
  import { createCipheriv, createDecipheriv, createHash, randomBytes, randomUUID } from "node:crypto";
@@ -2107,7 +2107,7 @@ var AgySessionManager = class AgySessionManager {
2107
2107
  try {
2108
2108
  const auth = await this.accessTokenFor(account);
2109
2109
  if (!auth) return [];
2110
- const { fetchQuotaSummary } = await import("./quota-summary-DEA3P3Zh.mjs");
2110
+ const { fetchQuotaSummary } = await import("./quota-summary-DarIZkmo.mjs");
2111
2111
  const routed = accountFetch({ proxyUrl: account.proxy });
2112
2112
  const bounded = (input, init) => {
2113
2113
  const timeout = AbortSignal.timeout(AgySessionManager.QUOTA_FETCH_TIMEOUT_MS);
@@ -2245,7 +2245,7 @@ var AgySessionManager = class AgySessionManager {
2245
2245
  try {
2246
2246
  const auth = await this.accessTokenFor(account);
2247
2247
  if (!auth) return null;
2248
- const { fetchAvailableModels } = await import("./models-CjB0rXtI.mjs").then((n) => n.r);
2248
+ const { fetchAvailableModels } = await import("./models-D_54Ro5z.mjs").then((n) => n.r);
2249
2249
  const routed = accountFetch({ proxyUrl: account.proxy });
2250
2250
  const bounded = (input, init) => {
2251
2251
  const timeout = AbortSignal.timeout(AgySessionManager.QUOTA_FETCH_TIMEOUT_MS);
@@ -2427,7 +2427,7 @@ var AgySessionManager = class AgySessionManager {
2427
2427
  }
2428
2428
  const key = this.accountKey(picked.account);
2429
2429
  if (!picked.account.projectId && !this.projectRetryFailed.has(key)) try {
2430
- const { loadCodeAssist } = await import("./exchange-C-tndv7j.mjs").then((n) => n.n);
2430
+ const { loadCodeAssist } = await import("./exchange-B_rHhU8K.mjs").then((n) => n.n);
2431
2431
  const { projectId } = await loadCodeAssist(auth.access, { proxyUrl: picked.account.proxy });
2432
2432
  if (projectId) {
2433
2433
  await this.store.mutate((s) => {
@@ -2590,9 +2590,9 @@ var AgySessionManager = class AgySessionManager {
2590
2590
  };
2591
2591
  try {
2592
2592
  const account = session.account.email ?? session.account.id;
2593
- const { toAgyRequestBody } = await import("./translate-Cq6PGO4b.mjs").then((n) => n.n);
2594
- const { fetchAgyFirstOk } = await import("./constants-CmA9wXNe.mjs").then((n) => n.f);
2595
- const { parseAgySse } = await import("./parse-D3InNyUx.mjs").then((n) => n.r);
2593
+ const { toAgyRequestBody } = await import("./translate-vh3M5H_9.mjs").then((n) => n.n);
2594
+ const { fetchAgyFirstOk } = await import("./constants-AdsD4sKh.mjs").then((n) => n.f);
2595
+ const { parseAgySse } = await import("./parse-CeJc7cHo.mjs").then((n) => n.i);
2596
2596
  const requestId = generateAntigravityRequestId();
2597
2597
  const body = toAgyRequestBody({
2598
2598
  provider: "agy",
@@ -2625,7 +2625,8 @@ var AgySessionManager = class AgySessionManager {
2625
2625
  const response = await fetchAgyFirstOk("/v1internal:streamGenerateContent?alt=sse", {
2626
2626
  method: "POST",
2627
2627
  headers,
2628
- body: JSON.stringify(body)
2628
+ body: JSON.stringify(body),
2629
+ signal: options.signal
2629
2630
  }, accountFetch(routing), routing);
2630
2631
  if (!response.ok) {
2631
2632
  const text = await response.text().catch(() => "");
@@ -2657,7 +2658,10 @@ var AgySessionManager = class AgySessionManager {
2657
2658
  const text = [];
2658
2659
  let usage;
2659
2660
  let ttftMs;
2660
- for await (const chunk of parseAgySse(response.body)) if (chunk.type === "usage") usage = {
2661
+ for await (const chunk of parseAgySse(response.body, {
2662
+ signal: options.signal,
2663
+ idleTimeoutMs: options.idleTimeoutMs
2664
+ })) if (chunk.type === "usage") usage = {
2661
2665
  input: chunk.usage.inputTokens,
2662
2666
  output: chunk.usage.outputTokens,
2663
2667
  cacheRead: chunk.usage.cacheReadTokens ?? 0,
@@ -3033,4 +3037,4 @@ var JsonAccountStore = class {
3033
3037
  //#endregion
3034
3038
  export { isSessionAccumulationOverflow as C, describeFetchError as S, persistMasterKey as _, generateFingerprint as a, classifyFetchError as b, resolveAntigravityVersionBounded as c, agyDataFile as d, migrateToAgyDir as f, loadMasterKey as g, deriveKey as h, isAgyDisabled as i, clearExpiredState as l, createAesGcmCodec as m, maskProxyUrl as n, recordFingerprintVersion as o, MASTER_KEY_REF as p, AgySessionManager as r, resolveAntigravityVersion as s, JsonAccountStore as t, pickProbeProxyUrl as u, resolveDshHome as v, classifyHttpError as x, resolveMasterKeyCodec as y };
3035
3039
 
3036
- //# sourceMappingURL=accounts-BOuz6_Sh.mjs.map
3040
+ //# sourceMappingURL=accounts-DtIsWCeF.mjs.map