@eddyskywalker/dsh-chatgpt-subscription 0.15.0 → 0.17.0

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/CHANGELOG.md +36 -0
  2. package/README.md +2 -0
  3. package/lib/client.js +190 -11
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +570 -19
  6. package/lib/types/client/antigravity/AntigravitySection.d.ts.map +1 -1
  7. package/lib/types/client/antigravity/locales.d.ts +47 -2
  8. package/lib/types/client/antigravity/locales.d.ts.map +1 -1
  9. package/lib/types/client/kimi-code/locales.d.ts +2 -2
  10. package/lib/types/client/workbuddy/WorkBuddySection.d.ts +36 -0
  11. package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +1 -1
  12. package/lib/types/client/workbuddy/locales.d.ts +18 -0
  13. package/lib/types/client/workbuddy/locales.d.ts.map +1 -1
  14. package/lib/types/host/antigravity/account-pool.d.ts +24 -0
  15. package/lib/types/host/antigravity/account-pool.d.ts.map +1 -1
  16. package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
  17. package/lib/types/host/antigravity/cache-stats.d.ts +166 -0
  18. package/lib/types/host/antigravity/cache-stats.d.ts.map +1 -0
  19. package/lib/types/host/antigravity/mapper.d.ts +75 -3
  20. package/lib/types/host/antigravity/mapper.d.ts.map +1 -1
  21. package/lib/types/host/antigravity/routes.d.ts +1 -1
  22. package/lib/types/host/antigravity/routes.d.ts.map +1 -1
  23. package/lib/types/host/workbuddy/client.d.ts +8 -0
  24. package/lib/types/host/workbuddy/client.d.ts.map +1 -1
  25. package/lib/types/host/workbuddy/model-catalog.d.ts +30 -1
  26. package/lib/types/host/workbuddy/model-catalog.d.ts.map +1 -1
  27. package/lib/types/host/workbuddy/routes.d.ts +7 -0
  28. package/lib/types/host/workbuddy/routes.d.ts.map +1 -1
  29. package/lib/types/shared/antigravity-contracts.d.ts +76 -0
  30. package/lib/types/shared/antigravity-contracts.d.ts.map +1 -1
  31. package/lib/types/shared/workbuddy-contracts.d.ts +42 -0
  32. package/lib/types/shared/workbuddy-contracts.d.ts.map +1 -1
  33. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AntigravitySection.d.ts","sourceRoot":"","sources":["../../../../src/client/antigravity/AntigravitySection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAgBvE,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC;AAED,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CAwfnG"}
1
+ {"version":3,"file":"AntigravitySection.d.ts","sourceRoot":"","sources":["../../../../src/client/antigravity/AntigravitySection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAiBvE,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC;AAwBD,wBAAgB,kBAAkB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CAyiBnG"}
@@ -44,6 +44,21 @@ export declare const zh: {
44
44
  save: string;
45
45
  saved: string;
46
46
  saving: string;
47
+ cacheSection: string;
48
+ cacheDesc: string;
49
+ cacheEmpty: string;
50
+ cacheHitRatio: string;
51
+ cacheCached: string;
52
+ cacheFresh: string;
53
+ cacheRequests: string;
54
+ cacheMiss: string;
55
+ cacheMissIdle: string;
56
+ cacheDriftNone: string;
57
+ cacheDriftContents: string;
58
+ cacheDriftSystemInstruction: string;
59
+ cacheDriftTools: string;
60
+ cacheDriftSessionId: string;
61
+ cacheDriftNewSession: string;
47
62
  quotaSection: string;
48
63
  quotaDesc: string;
49
64
  refreshQuota: string;
@@ -123,6 +138,21 @@ export declare const dictionaries: {
123
138
  save: string;
124
139
  saved: string;
125
140
  saving: string;
141
+ cacheSection: string;
142
+ cacheDesc: string;
143
+ cacheEmpty: string;
144
+ cacheHitRatio: string;
145
+ cacheCached: string;
146
+ cacheFresh: string;
147
+ cacheRequests: string;
148
+ cacheMiss: string;
149
+ cacheMissIdle: string;
150
+ cacheDriftNone: string;
151
+ cacheDriftContents: string;
152
+ cacheDriftSystemInstruction: string;
153
+ cacheDriftTools: string;
154
+ cacheDriftSessionId: string;
155
+ cacheDriftNewSession: string;
126
156
  quotaSection: string;
127
157
  quotaDesc: string;
128
158
  refreshQuota: string;
@@ -200,6 +230,21 @@ export declare const dictionaries: {
200
230
  save: string;
201
231
  saved: string;
202
232
  saving: string;
233
+ cacheSection: string;
234
+ cacheDesc: string;
235
+ cacheEmpty: string;
236
+ cacheHitRatio: string;
237
+ cacheCached: string;
238
+ cacheFresh: string;
239
+ cacheRequests: string;
240
+ cacheMiss: string;
241
+ cacheMissIdle: string;
242
+ cacheDriftNone: string;
243
+ cacheDriftContents: string;
244
+ cacheDriftSystemInstruction: string;
245
+ cacheDriftTools: string;
246
+ cacheDriftSessionId: string;
247
+ cacheDriftNewSession: string;
203
248
  quotaSection: string;
204
249
  quotaDesc: string;
205
250
  refreshQuota: string;
@@ -232,8 +277,8 @@ export declare const dictionaries: {
232
277
  quotaFactsScope: string;
233
278
  composerLabel: string;
234
279
  };
235
- en: Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "refreshToken" | "loading" | "connection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "googleValidation" | "resetPrefix" | "resetUnavailable" | "resetNow" | "timeDayHour" | "timeHourMin" | "timeMin" | "updatedAt" | "loginFailed", string>;
236
- 'en-US': Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "refreshToken" | "loading" | "connection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "googleValidation" | "resetPrefix" | "resetUnavailable" | "resetNow" | "timeDayHour" | "timeHourMin" | "timeMin" | "updatedAt" | "loginFailed", string>;
280
+ en: Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "refreshToken" | "loading" | "connection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheMiss" | "cacheMissIdle" | "cacheDriftNone" | "cacheDriftContents" | "cacheDriftSystemInstruction" | "cacheDriftTools" | "cacheDriftSessionId" | "cacheDriftNewSession" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "googleValidation" | "resetPrefix" | "resetUnavailable" | "resetNow" | "timeDayHour" | "timeHourMin" | "timeMin" | "updatedAt" | "loginFailed", string>;
281
+ 'en-US': Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "refreshToken" | "loading" | "connection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheMiss" | "cacheMissIdle" | "cacheDriftNone" | "cacheDriftContents" | "cacheDriftSystemInstruction" | "cacheDriftTools" | "cacheDriftSessionId" | "cacheDriftNewSession" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "googleValidation" | "resetPrefix" | "resetUnavailable" | "resetNow" | "timeDayHour" | "timeHourMin" | "timeMin" | "updatedAt" | "loginFailed", string>;
237
282
  };
238
283
  export type AntigravityLocaleKey = keyof typeof zh;
239
284
  //# sourceMappingURL=locales.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/antigravity/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,oBAAoB,CAAA;AAI/C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Dd,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CA8D9C,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/antigravity/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,oBAAoB,CAAA;AAI/C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Ed,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CA6E9C,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,EAAE,CAAA"}
@@ -454,8 +454,8 @@ export declare const dictionaries: {
454
454
  readonly quotaFactsScope: string;
455
455
  readonly composerLabel: string;
456
456
  };
457
- en: Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "resetAt" | "copied" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "region" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheOutput" | "cacheRequests" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftTools" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaPlan" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
458
- 'en-US': Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "resetAt" | "copied" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "region" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheOutput" | "cacheRequests" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftTools" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaPlan" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
457
+ en: Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheDriftTools" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "resetAt" | "copied" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "region" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheOutput" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaPlan" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
458
+ 'en-US': Record<"account" | "rotationStrategy" | "accountId" | "relogin" | "tokens" | "title" | "signedOut" | "signedIn" | "plan" | "expires" | "signIn" | "signInAgain" | "signOut" | "loading" | "connection" | "testConnection" | "selectAll" | "unselectAll" | "modelsHint" | "contextWindowReset" | "contextWindowResetAll" | "contextWindowResetAllConfirm" | "save" | "refreshQuota" | "accountPool" | "addAccount" | "accountCount" | "primaryAccount" | "activeAccount" | "setPrimary" | "deleteAccount" | "cooling" | "cooldownLeft" | "clearCooldown" | "needsRelogin" | "strategySequential" | "strategyRoundRobin" | "strategySticky" | "noAccounts" | "email" | "lastUsed" | "accountQuota" | "quotaNone" | "quotaSnapshot" | "quotaResets" | "quotaExhausted" | "quotaWindow" | "quotaUsed" | "quotaFactsScope" | "composerLabel" | "pageDesc" | "signingIn" | "modelsSection" | "enhanced" | "defaultReasoningEffort" | "defaultReasoningEffortHint" | "defaultEffortAuto" | "contextWindowSection" | "contextWindowHint" | "contextWindowNoneEnabled" | "saved" | "saving" | "cacheSection" | "cacheDesc" | "cacheEmpty" | "cacheHitRatio" | "cacheCached" | "cacheFresh" | "cacheRequests" | "cacheDriftTools" | "quotaSection" | "quotaDesc" | "refreshingQuota" | "quotaEmpty" | "updatedAt" | "loginFailed" | "planUnknown" | "cancelSignIn" | "testingConnection" | "testSuccess" | "testFailed" | "routeOwned" | "routeConflict" | "refreshCatalog" | "refreshingCatalog" | "cacheTtl" | "cacheTtlHint" | "cacheTtl1h" | "cacheTtl5m" | "effortLow" | "effortHigh" | "effortMax" | "resetAt" | "copied" | "authenticatedAt" | "openSignInPage" | "wireAnthropic" | "wireOpenai" | "nickname" | "region" | "regionMainland" | "regionGlobal" | "refreshRejected" | "deviceCodeSection" | "deviceCodeHint" | "copyCode" | "userCode" | "codeExpires" | "waitingAuthorization" | "requestingCode" | "oauthHost" | "codingEndpoint" | "capVideo" | "capDynamicTools" | "capImageOnly" | "capNone" | "capVideoFootnote" | "capabilitiesTitle" | "capColMedia" | "capColTools" | "capColNotes" | "capPlan" | "capInputCap" | "capNoTools" | "speedRegular" | "speedHighspeed" | "quotaCost" | "minimumPlan" | "cacheTtlDefault" | "effortNone" | "contextWindowPlan" | "cacheOutput" | "cacheHint" | "cacheExpired" | "cacheDrift" | "cacheDriftFirst" | "cacheDriftStable" | "cacheDriftSystemPrompt" | "cacheDriftCacheKey" | "cacheDriftColdKey" | "preserveThinking" | "preserveOn" | "preserveOff" | "outputCap" | "quotaPlan" | "quotaWallet" | "quotaWalletLimit" | "quotaWalletUsed" | "requests", string>;
459
459
  };
460
460
  export type KimiCodeLocaleKey = keyof typeof zh;
461
461
  //# sourceMappingURL=locales.d.ts.map
@@ -7,7 +7,43 @@
7
7
  * behaviour is unchanged, and this one should stay render-shaped.
8
8
  */
9
9
  import React from 'react';
10
+ import type { WorkBuddyModelCredits, WorkBuddyRegion } from '../../shared/workbuddy-contracts.ts';
10
11
  import { type WorkBuddySectionProps } from './useWorkBuddySection.ts';
12
+ /**
13
+ * The consumption rate of one model, as the settings row states it.
14
+ *
15
+ * The gateway publishes one rate per region and the official CodeBuddy picker
16
+ * spells it beside a model as `6.67x`; the row uses the same shape behind the
17
+ * section's own label. Which rates reach the row depends on what the card knows
18
+ * about the account, and the two cases are deliberately different:
19
+ *
20
+ * - A KNOWN region shows that region's rate and nothing else. Borrowing the
21
+ * sibling region's number would state a price this account never pays —
22
+ * measured 2026-10-09, `deepseek-v4.1-flash` is `0.11` on cn against `0.00`
23
+ * on intl, and the backends reject a model asked of the wrong region anyway.
24
+ * - An UNKNOWN region (no account read back yet) shows both rates when the
25
+ * backends disagree, so the row is honest about the range instead of picking
26
+ * one of them. When they agree there is nothing to disambiguate.
27
+ *
28
+ * The two-region form is assembled entirely from the caller's labels: the
29
+ * qualifier comes from `labels.region(value, key)` and the join from
30
+ * `labels.pair(first, second)`, so the dictionary owns the region nouns, the
31
+ * bracket glyphs AND the separator. Nothing about the two-region string is
32
+ * spelled in this file, which is the point — the glyphs differ per language
33
+ * (`倍率 0.11x(国区) / 0.00x(国际区)` in Chinese,
34
+ * `Multiplier 0.11x (China) / 0.00x (International)` in English) and a
35
+ * separator chosen here would be right in at most one of them.
36
+ *
37
+ * `null` means "this row states no rate"; the caller drops it from the hint
38
+ * array rather than rendering a placeholder, because a guessed rate on a spend
39
+ * figure is worse than a missing one. `'0.00'` is a declaration — this model
40
+ * consumes no allowance — so it renders like any other value.
41
+ */
42
+ export declare function creditMultiplierHint(credits: WorkBuddyModelCredits | undefined, region: WorkBuddyRegion | null, labels: {
43
+ multiplier: string;
44
+ region: (value: string, key: WorkBuddyRegion) => string;
45
+ pair: (first: string, second: string) => string;
46
+ }): string | null;
11
47
  /** Mask a UIN so the card shows identity without publishing the full number. */
12
48
  export declare function maskUin(uin?: string | null): string;
13
49
  export declare function WorkBuddySection({ onModelChange, loadModelDirectory }: WorkBuddySectionProps): React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkBuddySection.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/WorkBuddySection.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAgB1F,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAInD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAyVjH"}
1
+ {"version":3,"file":"WorkBuddySection.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/WorkBuddySection.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAEV,qBAAqB,EAGrB,eAAe,EAChB,MAAM,qCAAqC,CAAA;AAK5C,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAgB1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAAG,SAAS,EAC1C,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,MAAM,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAK,MAAM,CAAA;IACvD,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CAChD,GACA,MAAM,GAAG,IAAI,CA4Bf;AAED,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAInD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CA4WjH"}
@@ -40,6 +40,9 @@ export declare const zh: {
40
40
  readonly unselectAll: "全不选";
41
41
  readonly imageSupport: "图片";
42
42
  readonly textOnly: "纯文本";
43
+ readonly creditMultiplier: "倍率";
44
+ readonly creditMultiplierRegion: "{value}({region})";
45
+ readonly creditMultiplierPair: "{first} / {second}";
43
46
  readonly regionBadge: "区域";
44
47
  readonly unavailableHere: "当前区域不可用";
45
48
  readonly enhanced: "增强功能";
@@ -123,6 +126,9 @@ export declare const en: {
123
126
  readonly unselectAll: "Deselect all";
124
127
  readonly imageSupport: "Images";
125
128
  readonly textOnly: "Text only";
129
+ readonly creditMultiplier: "Multiplier";
130
+ readonly creditMultiplierRegion: "{value} ({region})";
131
+ readonly creditMultiplierPair: "{first} / {second}";
126
132
  readonly regionBadge: "Regions";
127
133
  readonly unavailableHere: "Unavailable in this region";
128
134
  readonly enhanced: "Enhanced features";
@@ -207,6 +213,9 @@ export declare const dictionaries: {
207
213
  readonly unselectAll: "全不选";
208
214
  readonly imageSupport: "图片";
209
215
  readonly textOnly: "纯文本";
216
+ readonly creditMultiplier: "倍率";
217
+ readonly creditMultiplierRegion: "{value}({region})";
218
+ readonly creditMultiplierPair: "{first} / {second}";
210
219
  readonly regionBadge: "区域";
211
220
  readonly unavailableHere: "当前区域不可用";
212
221
  readonly enhanced: "增强功能";
@@ -290,6 +299,9 @@ export declare const dictionaries: {
290
299
  readonly unselectAll: "全不选";
291
300
  readonly imageSupport: "图片";
292
301
  readonly textOnly: "纯文本";
302
+ readonly creditMultiplier: "倍率";
303
+ readonly creditMultiplierRegion: "{value}({region})";
304
+ readonly creditMultiplierPair: "{first} / {second}";
293
305
  readonly regionBadge: "区域";
294
306
  readonly unavailableHere: "当前区域不可用";
295
307
  readonly enhanced: "增强功能";
@@ -373,6 +385,9 @@ export declare const dictionaries: {
373
385
  readonly unselectAll: "Deselect all";
374
386
  readonly imageSupport: "Images";
375
387
  readonly textOnly: "Text only";
388
+ readonly creditMultiplier: "Multiplier";
389
+ readonly creditMultiplierRegion: "{value} ({region})";
390
+ readonly creditMultiplierPair: "{first} / {second}";
376
391
  readonly regionBadge: "Regions";
377
392
  readonly unavailableHere: "Unavailable in this region";
378
393
  readonly enhanced: "Enhanced features";
@@ -456,6 +471,9 @@ export declare const dictionaries: {
456
471
  readonly unselectAll: "Deselect all";
457
472
  readonly imageSupport: "Images";
458
473
  readonly textOnly: "Text only";
474
+ readonly creditMultiplier: "Multiplier";
475
+ readonly creditMultiplierRegion: "{value} ({region})";
476
+ readonly creditMultiplierPair: "{first} / {second}";
459
477
  readonly regionBadge: "Regions";
460
478
  readonly unavailableHere: "Unavailable in this region";
461
479
  readonly enhanced: "Enhanced features";
@@ -1 +1 @@
1
- {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAE3C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFL,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAE3C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFL,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,EAAE,CAAA"}
@@ -22,6 +22,30 @@ export interface AntigravityPoolData {
22
22
  accounts: AntigravityPoolAccount[];
23
23
  }
24
24
  export declare function poolPath(): string;
25
+ /**
26
+ * The rotation strategy this line defaults to, and the reader for it.
27
+ *
28
+ * Sticky rather than the shared core's sequential default, because the account a
29
+ * request is served by may also decide which server-side prefix cache it can
30
+ * reach: each account is a separate quota domain, and an account that changes mid
31
+ * conversation plausibly lands on a cache the previous one had not warmed, so the
32
+ * next turn may reprocess a prefix that was already paid for. Holding the account
33
+ * that served the previous request is the cheap way to not find out the hard way,
34
+ * and a request that is rate limited still falls through to another account.
35
+ *
36
+ * That account identity selects a cache namespace is INFERRED, not measured.
37
+ * Nothing here observes an account-scoped cache metric, no live capture has been
38
+ * taken, and docs/antigravity-claude-cache-audit.md records the upstream position
39
+ * — on-wire session affinity still needs transport diagnostics — against a run
40
+ * that had a single account, so cross-account behaviour was never exercised.
41
+ * The default stands as a design assumption until one of those is done.
42
+ *
43
+ * Only the DEFAULT differs. An explicit stored choice is returned unchanged, and
44
+ * a pool file written before this change carries an explicit 'sequential' — so
45
+ * upgrading does not silently move an existing user onto a different strategy.
46
+ * The shared core keeps its own sequential default for every other line.
47
+ */
48
+ export declare function poolRotationStrategy(value: unknown): AccountRotationStrategy;
25
49
  export declare function parseAntigravityPoolData(value: unknown): AntigravityPoolData;
26
50
  /**
27
51
  * One cached Antigravity snapshot as the shared account card renders it.
@@ -1 +1 @@
1
- {"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity/account-pool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAOxD,OAAO,EACL,mBAAmB,EAEnB,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAA;AAGzB,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAA6B,MAAM,wCAAwC,CAAA;AAE5G,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,sBAAsB,CA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C,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS;IAI7D,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAmB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAwCpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAwBpD,aAAa;CAsL7B"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Per-session cache accounting for the Antigravity line.
3
+ *
4
+ * Antigravity's prompt cache is implicit and server-side: the client sets no
5
+ * cache-control field, and the only evidence that a prefix was reused is the
6
+ * pair `usageMetadata.cachedContentTokenCount` / `promptTokenCount` on each
7
+ * response. A ratio on its own cannot explain itself, so every request also
8
+ * fingerprints the three parts of its body that decide the prefix the service is
9
+ * able to reuse — `request.contents`, `request.systemInstruction` and
10
+ * `request.tools` — and diffs them against the previous request of the same
11
+ * session.
12
+ *
13
+ * Everything here is process-local, scoped by session, and never written to
14
+ * disk: the numbers describe the conversations this host served, and one
15
+ * session's misses must never be blended into another's ratio.
16
+ *
17
+ * KNOWN LIMITATION — the two halves read the request at different scopes.
18
+ *
19
+ * This is a measured fact about this module, not a theory: the prefix snapshots
20
+ * that produce a drift cause are keyed by SESSION alone ({@link
21
+ * sessionScopeKey}), while the token totals are keyed by SESSION AND ACCOUNT
22
+ * ({@link statsScopeKey}). The account is deliberately absent from the snapshot
23
+ * because the account that will answer a request is not known when the body is
24
+ * assembled — the adapter resolves it at the pool, after the fingerprint is
25
+ * taken.
26
+ *
27
+ * What follows from that: when one conversation is served by more than one
28
+ * pooled account (a 429 falls through to the next account mid-session), the
29
+ * three prefix segments and the raw session id are all byte-for-byte unchanged,
30
+ * so the drift comparator reports 'none'. A reader must NOT read that as "the
31
+ * client sent nothing different, so the chill came from the service" — the
32
+ * account did change. The request that reached the service was not the same
33
+ * request, even though every field this module fingerprints is identical.
34
+ *
35
+ * Whether the serving account actually partitions the server-side cache is
36
+ * INFERRED, not measured — the same unverified assumption the account-scoped
37
+ * totals rest on, and the reason no 'account' drift cause exists yet: promoting
38
+ * it to the contract before the assumption is checked would state it as fact.
39
+ * The honest reading of a 'none' beside a rising fresh-token count is "the client
40
+ * prefix held; look at which account served the turn".
41
+ */
42
+ /**
43
+ * The part of a request that changed since that session's previous request.
44
+ *
45
+ * `'none'` means the prefix held, so a cold turn is not explained by anything the
46
+ * client sent IN THE SEGMENTS THIS MODULE FINGERPRINTS — it points at the service
47
+ * or at something the fingerprints cannot see (see the file header's known
48
+ * limitation: the serving account is one such thing). Every other value names the
49
+ * input that broke the prefix, which is the half of the diagnostic a bare hit
50
+ * ratio cannot supply.
51
+ */
52
+ export type AntigravityPrefixDriftCause =
53
+ /** The prefix is unchanged. */
54
+ 'none'
55
+ /** The conversation itself changed. */
56
+ | 'contents'
57
+ /** The system instruction changed. */
58
+ | 'systemInstruction'
59
+ /** The tool list changed. */
60
+ | 'tools'
61
+ /**
62
+ * The session identifier the request carries changed inside one session scope.
63
+ *
64
+ * It names the CLIENT-SIDE string, and deliberately promises nothing about the
65
+ * service's cache: whether that identifier partitions anything server-side is
66
+ * inferred, not measured. In practice this branch is close to unreachable — the
67
+ * scope key trims, so it takes two spellings of one session (a trailing space)
68
+ * to trigger it within a single conversation.
69
+ */
70
+ | 'session-id'
71
+ /** Nothing to compare against: this scope's first request. */
72
+ | 'new-session';
73
+ /** One request's token counts, as the service reported them. */
74
+ export interface AntigravityUsageSample {
75
+ /** Prompt tokens served from the service's cache (`cachedContentTokenCount`). */
76
+ cachedTokens: number;
77
+ /** Prompt tokens it had to process (`promptTokenCount` minus the cached part). */
78
+ freshTokens: number;
79
+ }
80
+ /** Rolling cache totals for one scope. */
81
+ export interface AntigravityCacheStats {
82
+ /** Requests that reported usage. */
83
+ requests: number;
84
+ /** Prompt tokens served from cache across those requests. */
85
+ cachedTokens: number;
86
+ /** Prompt tokens processed afresh across those requests. */
87
+ freshTokens: number;
88
+ /** cachedTokens / (cachedTokens + freshTokens); null until a request reports usage. */
89
+ hitRatio: number | null;
90
+ }
91
+ /** The shape the settings route publishes, and the browser card renders. */
92
+ export interface AntigravityCacheStatsDto extends AntigravityCacheStats {
93
+ /**
94
+ * The most recent request that came back with nothing cached.
95
+ *
96
+ * Only misses are published. A prefix change on its own says nothing: a new
97
+ * user turn always changes `contents`, and that turn still hits the cache for
98
+ * everything before it. Publishing every change made the card read "contents
99
+ * changed" on every single turn — it named the one input that is SUPPOSED to
100
+ * change and hid the one that actually costs: an idle gap that outlived the
101
+ * service's cache.
102
+ */
103
+ lastMiss?: AntigravityCacheMiss;
104
+ }
105
+ /**
106
+ * One total miss, and the two facts that explain it.
107
+ *
108
+ * A miss here means the response reported zero cached tokens — the whole prefix
109
+ * was reprocessed. That is the event worth naming; a partial hit is the normal
110
+ * state of a growing conversation.
111
+ */
112
+ export interface AntigravityCacheMiss {
113
+ /** The segment that changed since this session's previous request. */
114
+ cause: AntigravityPrefixDriftCause;
115
+ /**
116
+ * Milliseconds since this session's previous request, or undefined when this
117
+ * was the session's first. The service's cache expires on idle time it does
118
+ * not disclose, so this is the reading that separates "the conversation
119
+ * restarted" from "the cache timed out while the user was away".
120
+ */
121
+ idleMs?: number;
122
+ /** When the miss was recorded. */
123
+ at: number;
124
+ }
125
+ /**
126
+ * Fingerprint the prefix of a request about to be sent, and attribute whatever
127
+ * changed since this session's previous request.
128
+ *
129
+ * Called once per turn, before the request goes out, so the answer describes the
130
+ * prefix the service will actually see. The reason is remembered for the session
131
+ * as well, so the route can publish the attribution beside the ratio it explains.
132
+ *
133
+ * @param body - The serialized request body, exactly as it will be sent.
134
+ * @param sessionId - Conversation the request belongs to, when it has one.
135
+ * @returns The change attributed to this request.
136
+ */
137
+ export declare function recordCacheRequest(body: string, sessionId?: unknown): AntigravityPrefixDriftCause;
138
+ /**
139
+ * Add one request's reported counts to its session's totals.
140
+ *
141
+ * The scope carries the account as well as the session, because a pooled line
142
+ * can answer one conversation from several accounts and each of those keeps its
143
+ * own cache server-side: one account's cold misses must not be averaged into
144
+ * another's warm hits.
145
+ *
146
+ * @param sample - Token counts the response reported.
147
+ * @param sessionId - Conversation the request belonged to.
148
+ * @param accountId - Pooled account that served it, when the pool is in use.
149
+ */
150
+ export declare function recordCacheUsage(sample: AntigravityUsageSample, sessionId?: unknown, accountId?: string): void;
151
+ /**
152
+ * Cache totals for one account's share of a session, one whole session, or every
153
+ * tracked session.
154
+ *
155
+ * A missing session is not an error: the settings card has no conversation in
156
+ * hand, and the process aggregate is the honest answer there.
157
+ */
158
+ export declare function getCacheStats(sessionId?: string, accountId?: string): AntigravityCacheStatsDto;
159
+ /**
160
+ * Forget one session's numbers, or all of them.
161
+ *
162
+ * Session teardown and test seam: a conversation that ended must not leave its
163
+ * ratio behind to be read as another's.
164
+ */
165
+ export declare function resetCacheStats(sessionId?: string): void;
166
+ //# sourceMappingURL=cache-stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-stats.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity/cache-stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B;AACrC,+BAA+B;AAC7B,MAAM;AACR,uCAAuC;GACrC,UAAU;AACZ,sCAAsC;GACpC,mBAAmB;AACrB,6BAA6B;GAC3B,OAAO;AACT;;;;;;;;GAQG;GACD,YAAY;AACd,8DAA8D;GAC5D,aAAa,CAAA;AAEjB,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAA;IACpB,kFAAkF;IAClF,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAA;IACnB,uFAAuF;IACvF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,4EAA4E;AAC5E,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAA;CAChC;AAiBD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,KAAK,EAAE,2BAA2B,CAAA;IAClC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAA;CACX;AA0ID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,2BAA2B,CAyBjG;AAOD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CA2B9G;AAmDD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,wBAAwB,CAS9F;AAUD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAcxD"}
@@ -1,10 +1,18 @@
1
1
  import { type OutboundContentBlock, type GenerateOptions, type StreamChunk } from '../common/llm-compat.ts';
2
- import type { AttachmentStore } from '@deepseek-ai/dsh-attachment';
2
+ import type { AttachmentStore, ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
3
3
  import { type AntigravityModelDef } from './types.ts';
4
4
  import { type AntigravityToolSchemaOptions } from './tool-schema.ts';
5
5
  export declare function sanitizeToolCallId(id: string, fallbackName: string): string;
6
- /** Attachment seam this route needs: verified bytes for one durable image. */
7
- export type AttachmentImageReader = Pick<AttachmentStore, 'readImage'>;
6
+ /**
7
+ * Attachment seam this route needs: verified bytes for one durable image, and a
8
+ * downscaled request version of one that is larger than the wire wants.
9
+ *
10
+ * Every harness generation in the peer range declares readImageRequest; a
11
+ * backend that cannot derive request versions rejects the call, and that
12
+ * rejection is handled like any other unreadable image. Matching the Claude
13
+ * route's declaration keeps the two scaled routes on one contract.
14
+ */
15
+ export type AttachmentImageReader = Pick<AttachmentStore, 'readImage' | 'readImageRequest'>;
8
16
  /** One durable user image resolved for an in-flight request, or proven unreadable. */
9
17
  export type ResolvedRequestImage = {
10
18
  readonly kind: 'inline';
@@ -21,6 +29,34 @@ export type ResolvedRequestImages = ReadonlyMap<string, ResolvedRequestImage>;
21
29
  * instruction, the conversation text, and the tool declarations.
22
30
  */
23
31
  export declare const MAX_REQUEST_IMAGE_BYTES: number;
32
+ /**
33
+ * Longest edge, in pixels, one image of this request may keep.
34
+ *
35
+ * CHOICE: 1024 px matches the long edge the other scaled routes send, and it is
36
+ * what makes the scaling in {@link resolveRequestImages} effective rather than
37
+ * nominal: the target is computed from the stored image's own dimensions, so the
38
+ * same image yields the same request bytes in every later turn and the prefix
39
+ * Google's implicit cache matches stays byte-stable.
40
+ *
41
+ * The budget stays Antigravity's own 12 MB. The 1.5 MB in
42
+ * host/common/request-images.ts is Kimi's, and that file warns in the same
43
+ * breath that importing one route's number into another refuses the other
44
+ * route's own legal images; Google accepts a request of up to 20 MB.
45
+ */
46
+ export declare const REQUEST_IMAGE_MAX_EDGE = 1024;
47
+ /**
48
+ * Request-version target for one stored image whose long edge is over the
49
+ * ceiling, or undefined when it already fits and is sent as stored.
50
+ *
51
+ * A reference without usable dimensions is sent as stored: there is no basis for
52
+ * choosing a target, and the budget fallback in
53
+ * {@link offloadOldestRequestImages} still applies to it.
54
+ */
55
+ export declare function requestImageTarget(ref: ImageAttachmentRef, edge?: number): {
56
+ width: number;
57
+ height: number;
58
+ maxBytes: number;
59
+ } | undefined;
24
60
  /**
25
61
  * Replace the oldest inline images with a text placeholder once one request
26
62
  * would carry more than {@link MAX_REQUEST_IMAGE_BYTES} of base64 image data.
@@ -31,6 +67,12 @@ export declare const MAX_REQUEST_IMAGE_BYTES: number;
31
67
  * order them, and the placeholder tells the model the image is missing instead
32
68
  * of letting it answer as though the picture were simply blank.
33
69
  *
70
+ * Each occurrence is measured at the size it will actually be sent at, so an
71
+ * image that only fits after scaling is not replaced (see
72
+ * {@link requestImageBytes}). Replacing an image is the LAST resort: it rewrites
73
+ * the retained prefix and costs the next turn its whole implicit cache hit, so
74
+ * it is worth keeping the image count stable for as long as the bytes allow.
75
+ *
34
76
  * @param options - the request about to be built; durable history stays untouched.
35
77
  * @returns the original options when they already fit, otherwise shallow copies.
36
78
  */
@@ -45,12 +87,42 @@ export declare function offloadOldestRequestImages(options: GenerateOptions): Ge
45
87
  * model a text marker, because a turn that silently loses its image is far
46
88
  * harder to diagnose than one that says so.
47
89
  *
90
+ * WHY SCALE INSTEAD OF DROP. `offloadOldestRequestImages` has to replace an
91
+ * image with placeholder text once the request exceeds
92
+ * {@link MAX_REQUEST_IMAGE_BYTES}, and the count it replaces grows with every
93
+ * image added afterwards. Each change rewrites the retained prefix, so Google's
94
+ * implicit cache misses again on the very next turn. An image whose long edge is
95
+ * over {@link REQUEST_IMAGE_MAX_EDGE} is therefore sent as the harness's
96
+ * downscaled request version, which keeps the image COUNT steady and with it the
97
+ * prefix. The stored image and durable history do not change, and an image that
98
+ * already fits is sent byte-for-byte as stored. The drop path stays as the last
99
+ * resort for a request that is over budget even after scaling.
100
+ *
48
101
  * @param options - the exact request about to be built.
49
102
  * @param attachments - durable attachment store; absent when the host wired none.
50
103
  * @param signal - cancellation, forwarded to every attachment read.
51
104
  * @returns one resolution per distinct attachment id, empty when there is no image.
52
105
  */
53
106
  export declare function resolveRequestImages(options: GenerateOptions, attachments: AttachmentImageReader | undefined, signal?: AbortSignal): Promise<ResolvedRequestImages>;
107
+ /**
108
+ * Collapse each run of adjacent pure-text parts into a single part.
109
+ *
110
+ * SSE transport chunks are not semantic content blocks. One answer arrives as
111
+ * hundreds of text deltas, and replaying each delta as its own part adds one
112
+ * part per delta to the request prefix on every later turn of the conversation.
113
+ * Antigravity relies on Google's implicit cache, which matches a byte-stable
114
+ * prefix: the moment the prefix gains a part the previous request did not have,
115
+ * everything after it misses. The Claude route lost 68.84% cache hits to exactly
116
+ * that growth before its deltas were merged; the Gemini route sends the same
117
+ * deltas and needs the same treatment.
118
+ *
119
+ * Merging is restricted to pure text, so signed, opaque, thinking, and tool
120
+ * parts keep their boundaries exactly where the model produced them.
121
+ *
122
+ * @param parts - replay parts in model order; the input is never mutated.
123
+ * @returns parts with every adjacent pure-text run merged into its first member.
124
+ */
125
+ export declare function mergeAdjacentTextParts(parts: ReadonlyArray<Record<string, unknown>>): Array<Record<string, unknown>>;
54
126
  export declare function convertMessages(options: GenerateOptions, model: AntigravityModelDef, runtimeModel: string, images?: ResolvedRequestImages): Array<{
55
127
  role: string;
56
128
  parts: Array<Record<string, unknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity/mapper.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EAEpB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,6BAA6B,CAAA;AAEtF,OAAO,EAQL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAA;AACnB,OAAO,EAA2B,KAAK,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAw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AAK,EAAE,WAAW,GAAG,WAAW,EAAE,CAmB7D"}
@@ -2,6 +2,6 @@ import type { Context } from '@deepseek-ai/cordis';
2
2
  import { FileCredentialStore, FileModelSettingsStore, type AntigravityPreferenceStore } from './token-store.ts';
3
3
  import { AccountPoolStore } from './account-pool.ts';
4
4
  import type { AntigravityWebStatus } from '../../shared/antigravity-contracts.ts';
5
- export declare function getAntigravityWebStatus(store: FileCredentialStore, modelSettings: FileModelSettingsStore, preferences?: AntigravityPreferenceStore, accountPool?: AccountPoolStore): Promise<AntigravityWebStatus>;
5
+ export declare function getAntigravityWebStatus(store: FileCredentialStore, modelSettings: FileModelSettingsStore, preferences?: AntigravityPreferenceStore, accountPool?: AccountPoolStore, sessionId?: string): Promise<AntigravityWebStatus>;
6
6
  export declare function registerAntigravityRoutes(ctx: Context, store: FileCredentialStore, modelSettings: FileModelSettingsStore, preferences?: AntigravityPreferenceStore, fetchFn?: typeof fetch, accountPool?: AccountPoolStore): () => void;
7
7
  //# sourceMappingURL=routes.d.ts.map