@omnicross/core 0.4.2 → 0.4.3

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 (147) hide show
  1. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +11 -184
  2. package/dist/auth/GeminiCodeAssistProjectResolver.d.cts +41 -3
  3. package/dist/auth/GeminiCodeAssistProjectResolver.d.ts +41 -3
  4. package/dist/auth/GeminiCodeAssistProjectResolver.js +12 -185
  5. package/dist/{chunk-POUTD5AM.cjs → chunk-47E3I5PF.cjs} +10 -3
  6. package/dist/{chunk-WX2E2G7H.cjs → chunk-4NAMH4UE.cjs} +79 -51
  7. package/dist/{chunk-LQYS2N47.js → chunk-4RM22ETG.js} +14 -2
  8. package/dist/{chunk-YEVWA4C7.cjs → chunk-57Y2EA2G.cjs} +6 -5
  9. package/dist/chunk-6I4SAWCN.js +24 -0
  10. package/dist/chunk-AFH5CEMF.cjs +38 -0
  11. package/dist/{chunk-KIQ2HA2A.cjs → chunk-BTSADEX4.cjs} +5 -5
  12. package/dist/chunk-CGEZQC2G.cjs +67 -0
  13. package/dist/chunk-E5RCCGE7.cjs +95 -0
  14. package/dist/chunk-EE7VP4O3.js +230 -0
  15. package/dist/chunk-F6P4DIBL.js +95 -0
  16. package/dist/{chunk-BKXC4XM6.cjs → chunk-FORICQ5U.cjs} +15 -11
  17. package/dist/{chunk-PF7YQBKX.js → chunk-FYPKKMB3.js} +6 -2
  18. package/dist/chunk-HRBXQ5AC.js +44 -0
  19. package/dist/{chunk-LFEH7CEO.js → chunk-IDPMD4B7.js} +22 -0
  20. package/dist/{chunk-UPQIWJIE.cjs → chunk-INY54AYX.cjs} +14 -2
  21. package/dist/{chunk-QEOV6Y4E.cjs → chunk-J5XMB5KY.cjs} +359 -170
  22. package/dist/{chunk-C3NPMQTK.js → chunk-JHJRZ75C.js} +14 -10
  23. package/dist/chunk-K6J2RIEX.js +67 -0
  24. package/dist/chunk-KSMK45RD.cjs +45 -0
  25. package/dist/chunk-LL3MZ7O5.cjs +24 -0
  26. package/dist/{chunk-ECZ3ZE2C.js → chunk-M6PKXP6T.js} +4 -29
  27. package/dist/{chunk-PAXJGABW.js → chunk-MPFOC7AT.js} +10 -5
  28. package/dist/{chunk-DKBXDV5U.cjs → chunk-N3MGNLCU.cjs} +49 -44
  29. package/dist/chunk-NDIBVTBZ.cjs +230 -0
  30. package/dist/{chunk-5DJSOFEP.js → chunk-NTF7TLT7.js} +1 -1
  31. package/dist/chunk-ONTTXSRL.js +32 -0
  32. package/dist/{chunk-HN74IGEO.js → chunk-OXBGNEYR.js} +1 -1
  33. package/dist/{chunk-5GXOYVLB.js → chunk-QSOHEDKO.js} +44 -39
  34. package/dist/{chunk-TX3AEV6H.cjs → chunk-RXMF7GNF.cjs} +4 -3
  35. package/dist/{chunk-5TEWZN5J.js → chunk-SWY2LTMR.js} +277 -88
  36. package/dist/{chunk-EUZRH544.js → chunk-TKZ3DZS5.js} +10 -3
  37. package/dist/{chunk-MXI2PWIC.cjs → chunk-UKQHBK4Q.cjs} +1 -32
  38. package/dist/{chunk-3XVDFRCQ.cjs → chunk-UOOLU64V.cjs} +13 -8
  39. package/dist/{chunk-ZSA44G7J.cjs → chunk-VFFCV4J6.cjs} +3 -3
  40. package/dist/{chunk-6DDYNS2B.cjs → chunk-VGBJPHHD.cjs} +36 -14
  41. package/dist/{chunk-2T6D7LWE.cjs → chunk-VYOBVPNB.cjs} +6 -2
  42. package/dist/chunk-WYECWQ3J.cjs +44 -0
  43. package/dist/chunk-X6GHTNDL.cjs +482 -0
  44. package/dist/chunk-XBQTVRMK.js +45 -0
  45. package/dist/{chunk-R4VCO2CB.js → chunk-YEHQ5FXZ.js} +28 -0
  46. package/dist/{chunk-HDXSPXIN.js → chunk-ZBDDPWVQ.js} +4 -3
  47. package/dist/chunk-ZJJBITUN.js +482 -0
  48. package/dist/{chunk-QRXOLINS.js → chunk-ZMERU7D3.js} +3 -2
  49. package/dist/completion/CompletionService.cjs +29 -22
  50. package/dist/completion/CompletionService.js +28 -21
  51. package/dist/completion.cjs +29 -22
  52. package/dist/completion.js +28 -21
  53. package/dist/image-generation.cjs +2 -2
  54. package/dist/image-generation.d.cts +2 -2
  55. package/dist/image-generation.d.ts +2 -2
  56. package/dist/image-generation.js +1 -1
  57. package/dist/index.cjs +40 -29
  58. package/dist/index.d.cts +6 -3
  59. package/dist/index.d.ts +6 -3
  60. package/dist/index.js +40 -29
  61. package/dist/outbound-api/routeResolver.cjs +3 -3
  62. package/dist/outbound-api/routeResolver.d.cts +3 -3
  63. package/dist/outbound-api/routeResolver.d.ts +3 -3
  64. package/dist/outbound-api/routeResolver.js +2 -2
  65. package/dist/outbound-api/types.cjs +6 -2
  66. package/dist/outbound-api/types.d.cts +2 -2
  67. package/dist/outbound-api/types.d.ts +2 -2
  68. package/dist/outbound-api/types.js +7 -3
  69. package/dist/outbound-api.cjs +33 -22
  70. package/dist/outbound-api.d.cts +4 -4
  71. package/dist/outbound-api.d.ts +4 -4
  72. package/dist/outbound-api.js +33 -22
  73. package/dist/pipeline/AccountAllowanceScheduling.cjs +4 -3
  74. package/dist/pipeline/AccountAllowanceScheduling.d.cts +4 -4
  75. package/dist/pipeline/AccountAllowanceScheduling.d.ts +4 -4
  76. package/dist/pipeline/AccountAllowanceScheduling.js +3 -2
  77. package/dist/pipeline/AccountAllowanceStore.cjs +2 -2
  78. package/dist/pipeline/AccountAllowanceStore.js +1 -1
  79. package/dist/pipeline/AuthSource.d.cts +6 -0
  80. package/dist/pipeline/AuthSource.d.ts +6 -0
  81. package/dist/pipeline/SubscriptionAuthSource.cjs +5 -4
  82. package/dist/pipeline/SubscriptionAuthSource.js +4 -3
  83. package/dist/pipeline/SubscriptionAuthStrategy.d.cts +7 -0
  84. package/dist/pipeline/SubscriptionAuthStrategy.d.ts +7 -0
  85. package/dist/pipeline/antigravityQuotaFamily.cjs +16 -0
  86. package/dist/pipeline/antigravityQuotaFamily.d.cts +52 -0
  87. package/dist/pipeline/antigravityQuotaFamily.d.ts +52 -0
  88. package/dist/pipeline/antigravityQuotaFamily.js +16 -0
  89. package/dist/pipeline/upstreamFetch.cjs +3 -3
  90. package/dist/pipeline/upstreamFetch.js +2 -2
  91. package/dist/ports.d.cts +2 -2
  92. package/dist/ports.d.ts +2 -2
  93. package/dist/provider-proxy/ProviderProxy.cjs +29 -22
  94. package/dist/provider-proxy/ProviderProxy.js +28 -21
  95. package/dist/provider-proxy/identity/codexCliHeaders.cjs +4 -2
  96. package/dist/provider-proxy/identity/codexCliHeaders.js +4 -2
  97. package/dist/provider-proxy/identity/openCodeGoHeaders.cjs +17 -0
  98. package/dist/provider-proxy/identity/openCodeGoHeaders.d.cts +71 -0
  99. package/dist/provider-proxy/identity/openCodeGoHeaders.d.ts +71 -0
  100. package/dist/provider-proxy/identity/openCodeGoHeaders.js +17 -0
  101. package/dist/provider-proxy/ingress/providerProxyShared.cjs +29 -22
  102. package/dist/provider-proxy/ingress/providerProxyShared.js +28 -21
  103. package/dist/provider-proxy.cjs +29 -22
  104. package/dist/provider-proxy.d.cts +2 -2
  105. package/dist/provider-proxy.d.ts +2 -2
  106. package/dist/provider-proxy.js +28 -21
  107. package/dist/{routeResolver-STwMz_G4.d.ts → routeResolver-BLTleO4H.d.ts} +1 -1
  108. package/dist/{routeResolver-Da0yvkL1.d.cts → routeResolver-C2z0pp-q.d.cts} +1 -1
  109. package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.cjs +2 -2
  110. package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.js +1 -1
  111. package/dist/transformer/transformers/AnthropicTransformer.cjs +3 -3
  112. package/dist/transformer/transformers/AnthropicTransformer.js +2 -2
  113. package/dist/transformer/transformers/AntigravityTransformer.cjs +31 -0
  114. package/dist/transformer/transformers/AntigravityTransformer.d.cts +104 -0
  115. package/dist/transformer/transformers/AntigravityTransformer.d.ts +104 -0
  116. package/dist/transformer/transformers/AntigravityTransformer.js +31 -0
  117. package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
  118. package/dist/transformer/transformers/GeminiCodeAssistTransformer.d.cts +2 -1
  119. package/dist/transformer/transformers/GeminiCodeAssistTransformer.d.ts +2 -1
  120. package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
  121. package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
  122. package/dist/transformer/transformers/GeminiTransformer.js +2 -2
  123. package/dist/transformer/transformers/antigravityFailover.cjs +30 -0
  124. package/dist/transformer/transformers/antigravityFailover.d.cts +52 -0
  125. package/dist/transformer/transformers/antigravityFailover.d.ts +52 -0
  126. package/dist/transformer/transformers/antigravityFailover.js +30 -0
  127. package/dist/transformer/transformers/antigravityIdentity.cjs +24 -0
  128. package/dist/transformer/transformers/antigravityIdentity.d.cts +76 -0
  129. package/dist/transformer/transformers/antigravityIdentity.d.ts +76 -0
  130. package/dist/transformer/transformers/antigravityIdentity.js +24 -0
  131. package/dist/transformer/transformers.cjs +61 -9
  132. package/dist/transformer/transformers.d.cts +7 -2
  133. package/dist/transformer/transformers.d.ts +7 -2
  134. package/dist/transformer/transformers.js +61 -9
  135. package/dist/transformer/types.d.cts +11 -0
  136. package/dist/transformer/types.d.ts +11 -0
  137. package/dist/transformer.cjs +21 -12
  138. package/dist/transformer.d.cts +3 -0
  139. package/dist/transformer.d.ts +3 -0
  140. package/dist/transformer.js +20 -11
  141. package/dist/{types-Be-yt_6T.d.cts → types-BVwJQ9ZS.d.cts} +3 -0
  142. package/dist/{types-D-oHYusb.d.cts → types-C6m-Db26.d.cts} +25 -4
  143. package/dist/{types-Dvlpjn0d.d.ts → types-Da735j2d.d.ts} +25 -4
  144. package/dist/{types-Dm4_36V4.d.ts → types-VAHRysdP.d.ts} +3 -0
  145. package/package.json +2 -2
  146. package/dist/chunk-4IH4EL7M.cjs +0 -9
  147. package/dist/chunk-XEKD23J5.js +0 -9
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPOUTD5AMcjs = require('../../chunk-POUTD5AM.cjs');
4
- require('../../chunk-6DDYNS2B.cjs');
3
+ var _chunk47E3I5PFcjs = require('../../chunk-47E3I5PF.cjs');
5
4
  require('../../chunk-5RSZYQJH.cjs');
5
+ require('../../chunk-VGBJPHHD.cjs');
6
6
  require('../../chunk-77USGNRW.cjs');
7
7
  require('../../chunk-IUL4VWNU.cjs');
8
8
 
9
9
 
10
- exports.AnthropicTransformer = _chunkPOUTD5AMcjs.AnthropicTransformer;
10
+ exports.AnthropicTransformer = _chunk47E3I5PFcjs.AnthropicTransformer;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  AnthropicTransformer
3
- } from "../../chunk-EUZRH544.js";
4
- import "../../chunk-LFEH7CEO.js";
3
+ } from "../../chunk-TKZ3DZS5.js";
5
4
  import "../../chunk-FU7EAR73.js";
5
+ import "../../chunk-IDPMD4B7.js";
6
6
  import "../../chunk-WYVGULTQ.js";
7
7
  import "../../chunk-ZLNHPUFA.js";
8
8
  export {
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ var _chunkX6GHTNDLcjs = require('../../chunk-X6GHTNDL.cjs');
11
+ require('../../chunk-E5RCCGE7.cjs');
12
+ require('../../chunk-KSMK45RD.cjs');
13
+ require('../../chunk-NDIBVTBZ.cjs');
14
+ require('../../chunk-N3MGNLCU.cjs');
15
+ require('../../chunk-4NAMH4UE.cjs');
16
+ require('../../chunk-77USGNRW.cjs');
17
+ require('../../chunk-IUL4VWNU.cjs');
18
+ require('../../chunk-VFFCV4J6.cjs');
19
+ require('../../chunk-235MXAGX.cjs');
20
+ require('../../chunk-VYOBVPNB.cjs');
21
+ require('../../chunk-NKVZ6Z3Y.cjs');
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ exports.ANTIGRAVITY_ENDPOINT = _chunkX6GHTNDLcjs.ANTIGRAVITY_ENDPOINT; exports.ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION = _chunkX6GHTNDLcjs.ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION; exports.ANTIGRAVITY_FORCED_TOOL_DIRECTIVE = _chunkX6GHTNDLcjs.ANTIGRAVITY_FORCED_TOOL_DIRECTIVE; exports.AntigravityTransformer = _chunkX6GHTNDLcjs.AntigravityTransformer; exports.buildAntigravityUrl = _chunkX6GHTNDLcjs.buildAntigravityUrl; exports.checkForcedToolAssetDrift = _chunkX6GHTNDLcjs.checkForcedToolAssetDrift; exports.deriveAntigravitySessionId = _chunkX6GHTNDLcjs.deriveAntigravitySessionId; exports.resolveAntigravityWireModelId = _chunkX6GHTNDLcjs.resolveAntigravityWireModelId;
@@ -0,0 +1,104 @@
1
+ import { ThinkLevel } from '@omnicross/contracts/completion-types';
2
+ import { Transformer, TransformerLogger, UnifiedChatRequest, LLMProvider, TransformerContext } from '../types.cjs';
3
+ import '@omnicross/contracts/llm-config';
4
+
5
+ /**
6
+ * AntigravityTransformer — the Antigravity subscription's Cloud Code Assist
7
+ * envelope (`daily-cloudcode-pa.googleapis.com`, antigravity-subscription-
8
+ * provider design D2/D3/D4).
9
+ *
10
+ * Antigravity shares the gemini-cli CCA wire's INNER body (the standard
11
+ * `generateContent` request nested under `request`, the same SSE `.response`
12
+ * peeling) — so this transformer consumes the SAME shared components as
13
+ * `GeminiCodeAssistTransformer` (`ccaEnvelope` + the gemini request/response
14
+ * utils) and layers ONLY the antigravity-specific OUTER differences on top:
15
+ *
16
+ * Request (antigravity envelope):
17
+ * {
18
+ * project: <resolved project id>, // REQUIRED (always resolved)
19
+ * model: <WIRE model id>, // post effort/thinking variant routing
20
+ * requestId: "agent/<uuid>/<ts>/<uuid>/<step>",
21
+ * userAgent: "antigravity",
22
+ * requestType: "agent",
23
+ * request: { // standard generateContent body
24
+ * contents, systemInstruction (role "user"), tools, toolConfig,
25
+ * generationConfig, sessionId, labels
26
+ * }
27
+ * }
28
+ *
29
+ * Per-family decoration (ONE dispatch profile — the family differences live
30
+ * HERE, not in per-model transformer selection; design D3):
31
+ * - Gemini / gpt-oss: effort variant id routing (`gemini-3.5-flash`+low →
32
+ * `gemini-3.5-flash-extra-low` etc.), per-wire-id `maxOutputTokens`
33
+ * profile clamp, forced-tool directive injection (a STATIC pinned asset),
34
+ * `labels.model_enum` telemetry token, VALIDATED tool mode default.
35
+ * - Claude: thinking variant as an INDEPENDENT wire id, legacy
36
+ * `parameters` tool schema (NOT `parametersJsonSchema`), the
37
+ * `anthropic-beta` interleaved-thinking header, NO `model_enum` label,
38
+ * ALWAYS VALIDATED tool mode.
39
+ *
40
+ * Masquerade: the antigravity/hub User-Agent (version hot-probed with a
41
+ * pinned 2.8.0 fallback — `antigravityIdentity`); the auth strategy
42
+ * re-stamps the same value after the chain, keeping one source.
43
+ *
44
+ * URL: `${daily-cloudcode-pa}/v1internal:streamGenerateContent?alt=sse`
45
+ * (the sandbox failover swap is applied by the dispatch retry seam, not
46
+ * here — the transformer emits the primary endpoint URL).
47
+ *
48
+ * @module transformer/transformers/AntigravityTransformer
49
+ */
50
+
51
+ /**
52
+ * The forced-tool directive, pinned as a STATIC asset (design D4): a frozen
53
+ * copy of the reference client's instruction (source version 2.8.0). It does
54
+ * NOT follow the hot-probed UA version — a drift between the probe and this
55
+ * pin only logs a hint (see `checkForcedToolAssetDrift`).
56
+ */
57
+ declare const ANTIGRAVITY_FORCED_TOOL_DIRECTIVE = "TOOL-ONLY TURN. This turn accepts a tool call and nothing else; a text reply here is discarded unread and you will be re-prompted. Emit the tool call now.";
58
+ /** The version the forced-tool asset above was frozen from. */
59
+ declare const ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION = "2.8.0";
60
+ /**
61
+ * When the hot-probed UA version drifts from the forced-tool asset's frozen
62
+ * version, log a hint for manual review (design D4: pin + 人工复查 — the asset
63
+ * NEVER auto-follows the probe).
64
+ */
65
+ declare function checkForcedToolAssetDrift(currentVersion: string, log?: (message: string) => void): void;
66
+ interface AntigravityWireResolution {
67
+ /** The upstream wire model id (post variant routing). */
68
+ wireModelId: string;
69
+ /** Whether a variant route engaged (the wire id encodes the effort). */
70
+ variantEngaged: boolean;
71
+ /** The negotiated effort level (undefined when the request carried none). */
72
+ effort: ThinkLevel | undefined;
73
+ }
74
+ /**
75
+ * Resolve the logical model + the request's reasoning intent to the upstream
76
+ * WIRE model id. Effort participation is driven by the CANONICAL registry's
77
+ * `thinkingLevels` (no per-provider negotiation branch): a model with no
78
+ * non-none thinking levels never routes a variant. Exported for tests.
79
+ */
80
+ declare function resolveAntigravityWireModelId(logicalModelId: string, request: UnifiedChatRequest, provider?: Pick<LLMProvider, 'modelConfigs'>): AntigravityWireResolution;
81
+ /** The antigravity generateContent endpoint base (primary; failover swaps host). */
82
+ declare const ANTIGRAVITY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
83
+ /** Build the antigravity generateContent URL (colon-method, shared construction). */
84
+ declare function buildAntigravityUrl(stream: boolean, base?: string): string;
85
+ /** `-<decimal>` signed session id from the first user text's SHA-256 (stable per conversation). */
86
+ declare function deriveAntigravitySessionId(text: string): string;
87
+ /**
88
+ * AntigravityTransformer — registered under `antigravity`. Consumes the shared
89
+ * CCA envelope components; see the module doc for the wire shape.
90
+ */
91
+ declare class AntigravityTransformer implements Transformer {
92
+ static TransformerName: string;
93
+ name: string;
94
+ logger?: TransformerLogger;
95
+ /** The URL is built per-request (colon-method, no fixed endpoint pattern). */
96
+ endPoint: undefined;
97
+ transformRequestIn(request: UnifiedChatRequest, provider: LLMProvider, _context: TransformerContext): Promise<Record<string, unknown>>;
98
+ /** antigravity request → unified (endpoint-decode parity with the gemini one). */
99
+ transformRequestOut(request: unknown, _context: TransformerContext): Promise<UnifiedChatRequest>;
100
+ /** antigravity response → OpenAI-compatible: peel `.response`, delegate. */
101
+ transformResponseOut(response: Response, _context: TransformerContext): Promise<Response>;
102
+ }
103
+
104
+ export { ANTIGRAVITY_ENDPOINT, ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION, ANTIGRAVITY_FORCED_TOOL_DIRECTIVE, AntigravityTransformer, type AntigravityWireResolution, buildAntigravityUrl, checkForcedToolAssetDrift, deriveAntigravitySessionId, resolveAntigravityWireModelId };
@@ -0,0 +1,104 @@
1
+ import { ThinkLevel } from '@omnicross/contracts/completion-types';
2
+ import { Transformer, TransformerLogger, UnifiedChatRequest, LLMProvider, TransformerContext } from '../types.js';
3
+ import '@omnicross/contracts/llm-config';
4
+
5
+ /**
6
+ * AntigravityTransformer — the Antigravity subscription's Cloud Code Assist
7
+ * envelope (`daily-cloudcode-pa.googleapis.com`, antigravity-subscription-
8
+ * provider design D2/D3/D4).
9
+ *
10
+ * Antigravity shares the gemini-cli CCA wire's INNER body (the standard
11
+ * `generateContent` request nested under `request`, the same SSE `.response`
12
+ * peeling) — so this transformer consumes the SAME shared components as
13
+ * `GeminiCodeAssistTransformer` (`ccaEnvelope` + the gemini request/response
14
+ * utils) and layers ONLY the antigravity-specific OUTER differences on top:
15
+ *
16
+ * Request (antigravity envelope):
17
+ * {
18
+ * project: <resolved project id>, // REQUIRED (always resolved)
19
+ * model: <WIRE model id>, // post effort/thinking variant routing
20
+ * requestId: "agent/<uuid>/<ts>/<uuid>/<step>",
21
+ * userAgent: "antigravity",
22
+ * requestType: "agent",
23
+ * request: { // standard generateContent body
24
+ * contents, systemInstruction (role "user"), tools, toolConfig,
25
+ * generationConfig, sessionId, labels
26
+ * }
27
+ * }
28
+ *
29
+ * Per-family decoration (ONE dispatch profile — the family differences live
30
+ * HERE, not in per-model transformer selection; design D3):
31
+ * - Gemini / gpt-oss: effort variant id routing (`gemini-3.5-flash`+low →
32
+ * `gemini-3.5-flash-extra-low` etc.), per-wire-id `maxOutputTokens`
33
+ * profile clamp, forced-tool directive injection (a STATIC pinned asset),
34
+ * `labels.model_enum` telemetry token, VALIDATED tool mode default.
35
+ * - Claude: thinking variant as an INDEPENDENT wire id, legacy
36
+ * `parameters` tool schema (NOT `parametersJsonSchema`), the
37
+ * `anthropic-beta` interleaved-thinking header, NO `model_enum` label,
38
+ * ALWAYS VALIDATED tool mode.
39
+ *
40
+ * Masquerade: the antigravity/hub User-Agent (version hot-probed with a
41
+ * pinned 2.8.0 fallback — `antigravityIdentity`); the auth strategy
42
+ * re-stamps the same value after the chain, keeping one source.
43
+ *
44
+ * URL: `${daily-cloudcode-pa}/v1internal:streamGenerateContent?alt=sse`
45
+ * (the sandbox failover swap is applied by the dispatch retry seam, not
46
+ * here — the transformer emits the primary endpoint URL).
47
+ *
48
+ * @module transformer/transformers/AntigravityTransformer
49
+ */
50
+
51
+ /**
52
+ * The forced-tool directive, pinned as a STATIC asset (design D4): a frozen
53
+ * copy of the reference client's instruction (source version 2.8.0). It does
54
+ * NOT follow the hot-probed UA version — a drift between the probe and this
55
+ * pin only logs a hint (see `checkForcedToolAssetDrift`).
56
+ */
57
+ declare const ANTIGRAVITY_FORCED_TOOL_DIRECTIVE = "TOOL-ONLY TURN. This turn accepts a tool call and nothing else; a text reply here is discarded unread and you will be re-prompted. Emit the tool call now.";
58
+ /** The version the forced-tool asset above was frozen from. */
59
+ declare const ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION = "2.8.0";
60
+ /**
61
+ * When the hot-probed UA version drifts from the forced-tool asset's frozen
62
+ * version, log a hint for manual review (design D4: pin + 人工复查 — the asset
63
+ * NEVER auto-follows the probe).
64
+ */
65
+ declare function checkForcedToolAssetDrift(currentVersion: string, log?: (message: string) => void): void;
66
+ interface AntigravityWireResolution {
67
+ /** The upstream wire model id (post variant routing). */
68
+ wireModelId: string;
69
+ /** Whether a variant route engaged (the wire id encodes the effort). */
70
+ variantEngaged: boolean;
71
+ /** The negotiated effort level (undefined when the request carried none). */
72
+ effort: ThinkLevel | undefined;
73
+ }
74
+ /**
75
+ * Resolve the logical model + the request's reasoning intent to the upstream
76
+ * WIRE model id. Effort participation is driven by the CANONICAL registry's
77
+ * `thinkingLevels` (no per-provider negotiation branch): a model with no
78
+ * non-none thinking levels never routes a variant. Exported for tests.
79
+ */
80
+ declare function resolveAntigravityWireModelId(logicalModelId: string, request: UnifiedChatRequest, provider?: Pick<LLMProvider, 'modelConfigs'>): AntigravityWireResolution;
81
+ /** The antigravity generateContent endpoint base (primary; failover swaps host). */
82
+ declare const ANTIGRAVITY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
83
+ /** Build the antigravity generateContent URL (colon-method, shared construction). */
84
+ declare function buildAntigravityUrl(stream: boolean, base?: string): string;
85
+ /** `-<decimal>` signed session id from the first user text's SHA-256 (stable per conversation). */
86
+ declare function deriveAntigravitySessionId(text: string): string;
87
+ /**
88
+ * AntigravityTransformer — registered under `antigravity`. Consumes the shared
89
+ * CCA envelope components; see the module doc for the wire shape.
90
+ */
91
+ declare class AntigravityTransformer implements Transformer {
92
+ static TransformerName: string;
93
+ name: string;
94
+ logger?: TransformerLogger;
95
+ /** The URL is built per-request (colon-method, no fixed endpoint pattern). */
96
+ endPoint: undefined;
97
+ transformRequestIn(request: UnifiedChatRequest, provider: LLMProvider, _context: TransformerContext): Promise<Record<string, unknown>>;
98
+ /** antigravity request → unified (endpoint-decode parity with the gemini one). */
99
+ transformRequestOut(request: unknown, _context: TransformerContext): Promise<UnifiedChatRequest>;
100
+ /** antigravity response → OpenAI-compatible: peel `.response`, delegate. */
101
+ transformResponseOut(response: Response, _context: TransformerContext): Promise<Response>;
102
+ }
103
+
104
+ export { ANTIGRAVITY_ENDPOINT, ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION, ANTIGRAVITY_FORCED_TOOL_DIRECTIVE, AntigravityTransformer, type AntigravityWireResolution, buildAntigravityUrl, checkForcedToolAssetDrift, deriveAntigravitySessionId, resolveAntigravityWireModelId };
@@ -0,0 +1,31 @@
1
+ import {
2
+ ANTIGRAVITY_ENDPOINT,
3
+ ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION,
4
+ ANTIGRAVITY_FORCED_TOOL_DIRECTIVE,
5
+ AntigravityTransformer,
6
+ buildAntigravityUrl,
7
+ checkForcedToolAssetDrift,
8
+ deriveAntigravitySessionId,
9
+ resolveAntigravityWireModelId
10
+ } from "../../chunk-ZJJBITUN.js";
11
+ import "../../chunk-F6P4DIBL.js";
12
+ import "../../chunk-XBQTVRMK.js";
13
+ import "../../chunk-EE7VP4O3.js";
14
+ import "../../chunk-QSOHEDKO.js";
15
+ import "../../chunk-YEHQ5FXZ.js";
16
+ import "../../chunk-WYVGULTQ.js";
17
+ import "../../chunk-ZLNHPUFA.js";
18
+ import "../../chunk-NTF7TLT7.js";
19
+ import "../../chunk-3WD4HTR2.js";
20
+ import "../../chunk-FYPKKMB3.js";
21
+ import "../../chunk-GL6XM527.js";
22
+ export {
23
+ ANTIGRAVITY_ENDPOINT,
24
+ ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION,
25
+ ANTIGRAVITY_FORCED_TOOL_DIRECTIVE,
26
+ AntigravityTransformer,
27
+ buildAntigravityUrl,
28
+ checkForcedToolAssetDrift,
29
+ deriveAntigravitySessionId,
30
+ resolveAntigravityWireModelId
31
+ };
@@ -5,8 +5,8 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkDKBXDV5Ucjs = require('../../chunk-DKBXDV5U.cjs');
9
- require('../../chunk-WX2E2G7H.cjs');
8
+ var _chunkN3MGNLCUcjs = require('../../chunk-N3MGNLCU.cjs');
9
+ require('../../chunk-4NAMH4UE.cjs');
10
10
  require('../../chunk-77USGNRW.cjs');
11
11
  require('../../chunk-IUL4VWNU.cjs');
12
12
 
@@ -16,4 +16,4 @@ require('../../chunk-IUL4VWNU.cjs');
16
16
 
17
17
 
18
18
 
19
- exports.GeminiCodeAssistTransformer = _chunkDKBXDV5Ucjs.GeminiCodeAssistTransformer; exports.buildCodeAssistUrl = _chunkDKBXDV5Ucjs.buildCodeAssistUrl; exports.getGeminiCliIdentityHeaders = _chunkDKBXDV5Ucjs.getGeminiCliIdentityHeaders; exports.getGeminiCliUserAgent = _chunkDKBXDV5Ucjs.getGeminiCliUserAgent; exports.resolveCodeAssistApiVersion = _chunkDKBXDV5Ucjs.resolveCodeAssistApiVersion; exports.resolveCodeAssistEndpoint = _chunkDKBXDV5Ucjs.resolveCodeAssistEndpoint;
19
+ exports.GeminiCodeAssistTransformer = _chunkN3MGNLCUcjs.GeminiCodeAssistTransformer; exports.buildCodeAssistUrl = _chunkN3MGNLCUcjs.buildCodeAssistUrl; exports.getGeminiCliIdentityHeaders = _chunkN3MGNLCUcjs.getGeminiCliIdentityHeaders; exports.getGeminiCliUserAgent = _chunkN3MGNLCUcjs.getGeminiCliUserAgent; exports.resolveCodeAssistApiVersion = _chunkN3MGNLCUcjs.resolveCodeAssistApiVersion; exports.resolveCodeAssistEndpoint = _chunkN3MGNLCUcjs.resolveCodeAssistEndpoint;
@@ -58,7 +58,8 @@ declare function getGeminiCliUserAgent(modelId?: string): string;
58
58
  /** The static client-identity headers every Code Assist request carries. */
59
59
  declare function getGeminiCliIdentityHeaders(modelId?: string): Record<string, string>;
60
60
  /**
61
- * Build the Code Assist URL: `${base}/${version}:${method}`.
61
+ * Build the Code Assist URL (shared colon-method construction, see
62
+ * `ccaEnvelope.buildCcaMethodUrl`): `${base}/${version}:${method}`.
62
63
  * NOTE: no `/models/<model>` segment — the model goes in the body.
63
64
  */
64
65
  declare function buildCodeAssistUrl(stream: boolean): string;
@@ -58,7 +58,8 @@ declare function getGeminiCliUserAgent(modelId?: string): string;
58
58
  /** The static client-identity headers every Code Assist request carries. */
59
59
  declare function getGeminiCliIdentityHeaders(modelId?: string): Record<string, string>;
60
60
  /**
61
- * Build the Code Assist URL: `${base}/${version}:${method}`.
61
+ * Build the Code Assist URL (shared colon-method construction, see
62
+ * `ccaEnvelope.buildCcaMethodUrl`): `${base}/${version}:${method}`.
62
63
  * NOTE: no `/models/<model>` segment — the model goes in the body.
63
64
  */
64
65
  declare function buildCodeAssistUrl(stream: boolean): string;
@@ -5,8 +5,8 @@ import {
5
5
  getGeminiCliUserAgent,
6
6
  resolveCodeAssistApiVersion,
7
7
  resolveCodeAssistEndpoint
8
- } from "../../chunk-5GXOYVLB.js";
9
- import "../../chunk-R4VCO2CB.js";
8
+ } from "../../chunk-QSOHEDKO.js";
9
+ import "../../chunk-YEHQ5FXZ.js";
10
10
  import "../../chunk-WYVGULTQ.js";
11
11
  import "../../chunk-ZLNHPUFA.js";
12
12
  export {
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkKIQ2HA2Acjs = require('../../chunk-KIQ2HA2A.cjs');
4
- require('../../chunk-WX2E2G7H.cjs');
3
+ var _chunkBTSADEX4cjs = require('../../chunk-BTSADEX4.cjs');
4
+ require('../../chunk-4NAMH4UE.cjs');
5
5
  require('../../chunk-77USGNRW.cjs');
6
6
  require('../../chunk-IUL4VWNU.cjs');
7
7
 
8
8
 
9
- exports.GeminiTransformer = _chunkKIQ2HA2Acjs.GeminiTransformer;
9
+ exports.GeminiTransformer = _chunkBTSADEX4cjs.GeminiTransformer;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GeminiTransformer
3
- } from "../../chunk-HN74IGEO.js";
4
- import "../../chunk-R4VCO2CB.js";
3
+ } from "../../chunk-OXBGNEYR.js";
4
+ import "../../chunk-YEHQ5FXZ.js";
5
5
  import "../../chunk-WYVGULTQ.js";
6
6
  import "../../chunk-ZLNHPUFA.js";
7
7
  export {
@@ -0,0 +1,30 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+ var _chunkCGEZQC2Gcjs = require('../../chunk-CGEZQC2G.cjs');
10
+ require('../../chunk-X6GHTNDL.cjs');
11
+ require('../../chunk-E5RCCGE7.cjs');
12
+ require('../../chunk-KSMK45RD.cjs');
13
+ require('../../chunk-NDIBVTBZ.cjs');
14
+ require('../../chunk-N3MGNLCU.cjs');
15
+ require('../../chunk-4NAMH4UE.cjs');
16
+ require('../../chunk-77USGNRW.cjs');
17
+ require('../../chunk-IUL4VWNU.cjs');
18
+ require('../../chunk-VFFCV4J6.cjs');
19
+ require('../../chunk-235MXAGX.cjs');
20
+ require('../../chunk-VYOBVPNB.cjs');
21
+ require('../../chunk-NKVZ6Z3Y.cjs');
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+ exports.ANTIGRAVITY_SANDBOX_ENDPOINT = _chunkCGEZQC2Gcjs.ANTIGRAVITY_SANDBOX_ENDPOINT; exports.__resetAntigravityFailoverState = _chunkCGEZQC2Gcjs.__resetAntigravityFailoverState; exports.fetchWithAntigravityFailover = _chunkCGEZQC2Gcjs.fetchWithAntigravityFailover; exports.isAntigravityRetryableFailure = _chunkCGEZQC2Gcjs.isAntigravityRetryableFailure; exports.isAntigravitySandboxFailoverEnabled = _chunkCGEZQC2Gcjs.isAntigravitySandboxFailoverEnabled; exports.maybeAntigravityFailoverUrl = _chunkCGEZQC2Gcjs.maybeAntigravityFailoverUrl; exports.setAntigravitySandboxFailover = _chunkCGEZQC2Gcjs.setAntigravitySandboxFailover;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * antigravityFailover — the OPTIONAL production→sandbox endpoint failover for
3
+ * the antigravity subscription (antigravity-subscription-provider design D5).
4
+ *
5
+ * The primary endpoint is `daily-cloudcode-pa.googleapis.com`; the failover
6
+ * target is `daily-cloudcode-pa.sandbox.googleapis.com`. The switch is GATED
7
+ * by the daemon config flag `antigravity.sandboxFailover` (default OFF):
8
+ * - OFF ⇒ a retryable upstream error is NEVER switched (the original error
9
+ * semantics surface unchanged),
10
+ * - ON ⇒ a RETRYABLE error (see `isAntigravityRetryableFailure`) on the
11
+ * primary endpoint swaps the NEXT attempt to the sandbox host.
12
+ *
13
+ * v1 deliberately has NO health-probe-driven auto-switching (design D5).
14
+ *
15
+ * The dispatch retry seams (the daemon `SubscriptionDispatcher` loop and the
16
+ * core `/v1/messages` subscription retry wrapper) call
17
+ * `maybeAntigravityFailoverUrl(currentUrl, status, bodyText)` after a failed
18
+ * attempt; a non-null return is the URL to retry once.
19
+ *
20
+ * @module transformer/transformers/antigravityFailover
21
+ */
22
+ /** The sandbox failover endpoint host base. */
23
+ declare const ANTIGRAVITY_SANDBOX_ENDPOINT = "https://daily-cloudcode-pa.sandbox.googleapis.com";
24
+ /** Set the failover switch (daemon `applyConfig` wires this; default OFF). */
25
+ declare function setAntigravitySandboxFailover(enabled: boolean): void;
26
+ /** Read the switch (tests + diagnostics). */
27
+ declare function isAntigravitySandboxFailoverEnabled(): boolean;
28
+ /** Reset the switch + latch (test seam). */
29
+ declare function __resetAntigravityFailoverState(): void;
30
+ /**
31
+ * Whether a failed antigravity attempt is RETRYABLE on the alternate endpoint
32
+ * (aligned with the reference client's retryable classification):
33
+ * - transport errors (status-less throw — ECONNRESET/ETIMEDOUT shape),
34
+ * - 429 (rate limit),
35
+ * - 400/404 whose body reads as "model unavailable / not found" (the two
36
+ * environments route models differently),
37
+ * - 5xx (upstream-side failure).
38
+ */
39
+ declare function isAntigravityRetryableFailure(status: number | null, bodyText?: string): boolean;
40
+ /**
41
+ * The failover decision for one failed attempt. Returns the SANDBOX URL to
42
+ * retry when (a) the switch is ON, (b) the failure is retryable, and (c) the
43
+ * failed URL was the PRIMARY endpoint (a sandbox failure never fails BACK to
44
+ * production — one direction only); otherwise `null` (surface the original
45
+ * error). `methodPath` is the tail of the failed URL (e.g.
46
+ * `/v1internal:streamGenerateContent?alt=sse`) so the retry keeps the same
47
+ * method.
48
+ */
49
+ declare function maybeAntigravityFailoverUrl(failedUrl: string, status: number | null, bodyText?: string, methodPath?: string): string | null;
50
+ declare function fetchWithAntigravityFailover(url: string, fetcher: (url: string) => Promise<Response>, signal?: AbortSignal): Promise<Response>;
51
+
52
+ export { ANTIGRAVITY_SANDBOX_ENDPOINT, __resetAntigravityFailoverState, fetchWithAntigravityFailover, isAntigravityRetryableFailure, isAntigravitySandboxFailoverEnabled, maybeAntigravityFailoverUrl, setAntigravitySandboxFailover };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * antigravityFailover — the OPTIONAL production→sandbox endpoint failover for
3
+ * the antigravity subscription (antigravity-subscription-provider design D5).
4
+ *
5
+ * The primary endpoint is `daily-cloudcode-pa.googleapis.com`; the failover
6
+ * target is `daily-cloudcode-pa.sandbox.googleapis.com`. The switch is GATED
7
+ * by the daemon config flag `antigravity.sandboxFailover` (default OFF):
8
+ * - OFF ⇒ a retryable upstream error is NEVER switched (the original error
9
+ * semantics surface unchanged),
10
+ * - ON ⇒ a RETRYABLE error (see `isAntigravityRetryableFailure`) on the
11
+ * primary endpoint swaps the NEXT attempt to the sandbox host.
12
+ *
13
+ * v1 deliberately has NO health-probe-driven auto-switching (design D5).
14
+ *
15
+ * The dispatch retry seams (the daemon `SubscriptionDispatcher` loop and the
16
+ * core `/v1/messages` subscription retry wrapper) call
17
+ * `maybeAntigravityFailoverUrl(currentUrl, status, bodyText)` after a failed
18
+ * attempt; a non-null return is the URL to retry once.
19
+ *
20
+ * @module transformer/transformers/antigravityFailover
21
+ */
22
+ /** The sandbox failover endpoint host base. */
23
+ declare const ANTIGRAVITY_SANDBOX_ENDPOINT = "https://daily-cloudcode-pa.sandbox.googleapis.com";
24
+ /** Set the failover switch (daemon `applyConfig` wires this; default OFF). */
25
+ declare function setAntigravitySandboxFailover(enabled: boolean): void;
26
+ /** Read the switch (tests + diagnostics). */
27
+ declare function isAntigravitySandboxFailoverEnabled(): boolean;
28
+ /** Reset the switch + latch (test seam). */
29
+ declare function __resetAntigravityFailoverState(): void;
30
+ /**
31
+ * Whether a failed antigravity attempt is RETRYABLE on the alternate endpoint
32
+ * (aligned with the reference client's retryable classification):
33
+ * - transport errors (status-less throw — ECONNRESET/ETIMEDOUT shape),
34
+ * - 429 (rate limit),
35
+ * - 400/404 whose body reads as "model unavailable / not found" (the two
36
+ * environments route models differently),
37
+ * - 5xx (upstream-side failure).
38
+ */
39
+ declare function isAntigravityRetryableFailure(status: number | null, bodyText?: string): boolean;
40
+ /**
41
+ * The failover decision for one failed attempt. Returns the SANDBOX URL to
42
+ * retry when (a) the switch is ON, (b) the failure is retryable, and (c) the
43
+ * failed URL was the PRIMARY endpoint (a sandbox failure never fails BACK to
44
+ * production — one direction only); otherwise `null` (surface the original
45
+ * error). `methodPath` is the tail of the failed URL (e.g.
46
+ * `/v1internal:streamGenerateContent?alt=sse`) so the retry keeps the same
47
+ * method.
48
+ */
49
+ declare function maybeAntigravityFailoverUrl(failedUrl: string, status: number | null, bodyText?: string, methodPath?: string): string | null;
50
+ declare function fetchWithAntigravityFailover(url: string, fetcher: (url: string) => Promise<Response>, signal?: AbortSignal): Promise<Response>;
51
+
52
+ export { ANTIGRAVITY_SANDBOX_ENDPOINT, __resetAntigravityFailoverState, fetchWithAntigravityFailover, isAntigravityRetryableFailure, isAntigravitySandboxFailoverEnabled, maybeAntigravityFailoverUrl, setAntigravitySandboxFailover };
@@ -0,0 +1,30 @@
1
+ import {
2
+ ANTIGRAVITY_SANDBOX_ENDPOINT,
3
+ __resetAntigravityFailoverState,
4
+ fetchWithAntigravityFailover,
5
+ isAntigravityRetryableFailure,
6
+ isAntigravitySandboxFailoverEnabled,
7
+ maybeAntigravityFailoverUrl,
8
+ setAntigravitySandboxFailover
9
+ } from "../../chunk-K6J2RIEX.js";
10
+ import "../../chunk-ZJJBITUN.js";
11
+ import "../../chunk-F6P4DIBL.js";
12
+ import "../../chunk-XBQTVRMK.js";
13
+ import "../../chunk-EE7VP4O3.js";
14
+ import "../../chunk-QSOHEDKO.js";
15
+ import "../../chunk-YEHQ5FXZ.js";
16
+ import "../../chunk-WYVGULTQ.js";
17
+ import "../../chunk-ZLNHPUFA.js";
18
+ import "../../chunk-NTF7TLT7.js";
19
+ import "../../chunk-3WD4HTR2.js";
20
+ import "../../chunk-FYPKKMB3.js";
21
+ import "../../chunk-GL6XM527.js";
22
+ export {
23
+ ANTIGRAVITY_SANDBOX_ENDPOINT,
24
+ __resetAntigravityFailoverState,
25
+ fetchWithAntigravityFailover,
26
+ isAntigravityRetryableFailure,
27
+ isAntigravitySandboxFailoverEnabled,
28
+ maybeAntigravityFailoverUrl,
29
+ setAntigravitySandboxFailover
30
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ var _chunkE5RCCGE7cjs = require('../../chunk-E5RCCGE7.cjs');
11
+ require('../../chunk-VFFCV4J6.cjs');
12
+ require('../../chunk-235MXAGX.cjs');
13
+ require('../../chunk-VYOBVPNB.cjs');
14
+ require('../../chunk-NKVZ6Z3Y.cjs');
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+ exports.ANTIGRAVITY_MODEL_WIRE_PROFILES = _chunkE5RCCGE7cjs.ANTIGRAVITY_MODEL_WIRE_PROFILES; exports.DEFAULT_ANTIGRAVITY_VERSION = _chunkE5RCCGE7cjs.DEFAULT_ANTIGRAVITY_VERSION; exports.__resetAntigravityVersionCache = _chunkE5RCCGE7cjs.__resetAntigravityVersionCache; exports.ensureAntigravityVersion = _chunkE5RCCGE7cjs.ensureAntigravityVersion; exports.getAntigravityModelWireProfile = _chunkE5RCCGE7cjs.getAntigravityModelWireProfile; exports.getAntigravityUserAgent = _chunkE5RCCGE7cjs.getAntigravityUserAgent; exports.getAntigravityVersion = _chunkE5RCCGE7cjs.getAntigravityVersion; exports.parseAntigravityManifestVersion = _chunkE5RCCGE7cjs.parseAntigravityManifestVersion;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * antigravityIdentity — the Antigravity client's masquerade identity (UA
3
+ * version hot-probe + per-wire-id request profiles).
4
+ *
5
+ * The Antigravity backend gates newer models on the client version carried by
6
+ * the `User-Agent`. The exact shape, captured from the real `antigravity/hub`
7
+ * client:
8
+ *
9
+ * antigravity/hub/2.8.0 (aidev_client; os_type=darwin; arch=arm64; cl=963137146)
10
+ *
11
+ * Resolution ladder for the version (three layers, task D4):
12
+ * 1. `ANTIGRAVITY_VERSION` env — when set, the manifest probe is SKIPPED
13
+ * entirely and the env value wins,
14
+ * 2. the official electron-builder update manifest, cached for one hour with
15
+ * a 5s timeout (in-flight calls share the single probe),
16
+ * 3. the pinned fallback `2.8.0` (any probe failure — timeout, non-200,
17
+ * unparseable body — silently keeps this valid).
18
+ *
19
+ * The probe NEVER blocks a caller: `ensureAntigravityVersion()` is fire- and
20
+ * forget-able; every consumer reads `getAntigravityUserAgent()` synchronously,
21
+ * which falls back to the pinned version until a probe succeeds. `os_type` /
22
+ * `arch` are pinned to the darwin/arm64 reference client the wire constants
23
+ * were captured from (the backend does not validate `cl`).
24
+ *
25
+ * Env escape hatches: `ANTIGRAVITY_VERSION` / `ANTIGRAVITY_CL` /
26
+ * `ANTIGRAVITY_OS` / `ANTIGRAVITY_ARCH`. Any override suppresses automatic
27
+ * version discovery while the other fields retain their pinned defaults.
28
+ *
29
+ * @module transformer/transformers/antigravityIdentity
30
+ */
31
+ /** The offline/pinned fallback version (captured from the reference client). */
32
+ declare const DEFAULT_ANTIGRAVITY_VERSION = "2.8.0";
33
+ /** Injectable fetch for the manifest probe (tests inject a fake transport). */
34
+ type AntigravityVersionFetcher = (url: string, init?: RequestInit) => Promise<Response>;
35
+ /** Test seam — drop the discovered version + in-flight probe. */
36
+ declare function __resetAntigravityVersionCache(): void;
37
+ /** Current version: env override → manifest-discovered → pinned fallback. */
38
+ declare function getAntigravityVersion(): string;
39
+ /**
40
+ * Extract the client version from an electron-builder update manifest (YAML).
41
+ * Returns `null` when no well-formed `version:` line is present. Pure.
42
+ */
43
+ declare function parseAntigravityManifestVersion(yamlText: string): string | null;
44
+ /**
45
+ * Resolve the latest version from the official update manifest. Success is
46
+ * cached for one hour; failures retain the last known version (or the pin)
47
+ * and back off for one minute. Explicit identity overrides skip the probe.
48
+ * Never rejects.
49
+ */
50
+ declare function ensureAntigravityVersion(fetcher?: AntigravityVersionFetcher, signal?: AbortSignal): Promise<void>;
51
+ /**
52
+ * The Antigravity `User-Agent` value. `cl` is not validated by the backend
53
+ * (only the version gates), so the captured constant stands unless overridden.
54
+ */
55
+ declare function getAntigravityUserAgent(): string;
56
+ /**
57
+ * Per-wire-id Antigravity CCA request constants, captured from the reference
58
+ * client against `daily-cloudcode-pa`:
59
+ * - `modelEnum` is the opaque `labels.model_enum` telemetry token — OPTIONAL
60
+ * because Anthropic-backed wire ids are accepted without one,
61
+ * - `maxOutputTokens` is the fixed `generationConfig.maxOutputTokens` the
62
+ * backend enforces regardless of the thinking budget (Claude caps at
63
+ * 64000 — a larger value is a 400; Gemini ids take the discovered cap).
64
+ *
65
+ * Keyed by the routed upstream WIRE id (post effort/thinking variant mapping),
66
+ * not the logical id. Ids without an entry keep the request's own value.
67
+ */
68
+ interface AntigravityModelWireProfile {
69
+ modelEnum?: string;
70
+ maxOutputTokens: number;
71
+ }
72
+ declare const ANTIGRAVITY_MODEL_WIRE_PROFILES: Readonly<Record<string, AntigravityModelWireProfile>>;
73
+ /** Look up the wire profile for a routed (post-variant) model id. */
74
+ declare function getAntigravityModelWireProfile(wireModelId: string): AntigravityModelWireProfile | undefined;
75
+
76
+ export { ANTIGRAVITY_MODEL_WIRE_PROFILES, type AntigravityModelWireProfile, type AntigravityVersionFetcher, DEFAULT_ANTIGRAVITY_VERSION, __resetAntigravityVersionCache, ensureAntigravityVersion, getAntigravityModelWireProfile, getAntigravityUserAgent, getAntigravityVersion, parseAntigravityManifestVersion };