dsh-antigravity-auth 0.1.1 → 0.1.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.
- package/CHANGELOG.md +11 -0
- package/README.md +4 -3
- package/README.zh.md +4 -3
- package/lib/llm-adapter.js +288 -56
- package/lib/replay.js +2 -1
- package/lib/types/llm-adapter.d.ts +1 -0
- package/lib/types/llm-adapter.d.ts.map +1 -1
- package/lib/types/replay.d.ts +1 -1
- package/lib/types/replay.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.1.3] - 2026-08-31
|
|
6
|
+
|
|
7
|
+
- Restored reliable Claude Opus tool selection by preserving the complete DSH system prompt and applying the audited Claude tool instruction, strict parameter descriptions, and validated function-calling mode.
|
|
8
|
+
- Fixed Claude continuation after parallel tool execution by preserving call/response IDs, applying the safe thought-signature sentinel, dropping unsigned reasoning replay, and grouping correlated function responses.
|
|
9
|
+
- Mapped exact bounded Antigravity context-window overflow responses into DSH compaction recovery while retaining fail-closed parsing, timeout, response-size, frame-size, depth, and redaction limits.
|
|
10
|
+
|
|
11
|
+
## [0.1.2] - 2026-08-27
|
|
12
|
+
|
|
13
|
+
- Kept the Antigravity provider visible in DSH's stock model catalog during explicitly allowlisted transient live-discovery failures by falling back to the audited pinned text snapshot.
|
|
14
|
+
- Preserved fail-closed handling for missing authentication, authorization denial, cancellation, attribution rejection, unknown failures, and successful live catalogs with no supported-model intersection.
|
|
15
|
+
|
|
5
16
|
## [0.1.1] - 2026-08-25
|
|
6
17
|
|
|
7
18
|
- Fixed Windows reads of auth, capability-gate, and controlled live-image records by applying `0700`/`0600` mode rejection only on POSIX while retaining symlink, file-type, size, schema, and content validation on every platform.
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
English | [中文](README.zh.md)
|
|
7
7
|
|
|
8
|
-
Current release: **v0.1.
|
|
8
|
+
Current release: **v0.1.2**
|
|
9
9
|
|
|
10
10
|
A self-contained [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
11
11
|
**Antigravity Capability Bundle**. It integrates Antigravity's private OAuth session
|
|
@@ -39,6 +39,7 @@ and Wire Identity for:
|
|
|
39
39
|
|
|
40
40
|
- Registers the `google-antigravity` provider through DSH's public `LlmAdapter` seam.
|
|
41
41
|
- Intersects the pinned community model catalog with live account discovery.
|
|
42
|
+
- Keeps DSH's stock model selector usable when live discovery is temporarily unavailable or drifts by falling back to the pinned text snapshot; Settings still reports the live-catalog state. A successful empty intersection stays empty, while missing authentication, authorization denial, cancellation, and explicit attribution rejection remain fail-closed.
|
|
42
43
|
- Supports streaming with pre-delta authentication replay and preserve-by-id function call correlation across fragmented provider names.
|
|
43
44
|
|
|
44
45
|
### Web Search
|
|
@@ -99,7 +100,7 @@ git clone https://github.com/suntianc/dsh-antigravity-auth.git
|
|
|
99
100
|
cd dsh-antigravity-auth
|
|
100
101
|
pnpm install
|
|
101
102
|
pnpm pack
|
|
102
|
-
dsh plugin --profile web add ./dsh-antigravity-auth-0.1.
|
|
103
|
+
dsh plugin --profile web add ./dsh-antigravity-auth-0.1.2.tgz
|
|
103
104
|
```
|
|
104
105
|
|
|
105
106
|
## Upgrade
|
|
@@ -107,7 +108,7 @@ dsh plugin --profile web add ./dsh-antigravity-auth-0.1.1.tgz
|
|
|
107
108
|
Stop the running `dsh web` process and update the Web profile:
|
|
108
109
|
|
|
109
110
|
```sh
|
|
110
|
-
dsh plugin --profile web add dsh-antigravity-auth@0.1.
|
|
111
|
+
dsh plugin --profile web add dsh-antigravity-auth@0.1.2
|
|
111
112
|
dsh plugin --profile web list
|
|
112
113
|
```
|
|
113
114
|
|
package/README.zh.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
[English](README.md) | 中文
|
|
7
7
|
|
|
8
|
-
当前版本:**v0.1.
|
|
8
|
+
当前版本:**v0.1.2**
|
|
9
9
|
|
|
10
10
|
这是一个自包含的 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
11
11
|
**Antigravity 能力包**。它集成了 Antigravity 的私有 OAuth 登录态与 Wire Identity 线路身份,提供:
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
- 通过 DSH 公开的 `LlmAdapter` 接口注册 `google-antigravity` 提供方。
|
|
38
38
|
- 将已审计的固定社区模型快照与真实登录账号的可用模型取交集。
|
|
39
|
+
- 当真实模型发现暂时不可用或发生协议漂移时,DSH 内置模型选择器会回退到固定文本模型快照,设置页仍诚实显示 live catalog 状态;成功但零交集的结果仍保持为空,未登录、授权拒绝、取消与明确的 attribution 拒绝仍保持 fail-closed。
|
|
39
40
|
- 流式传输支持首个数据块前的一次认证重放,并支持跨分片提供方函数名的 call-id 稳定关联。
|
|
40
41
|
|
|
41
42
|
### 网页搜索
|
|
@@ -91,7 +92,7 @@ git clone https://github.com/suntianc/dsh-antigravity-auth.git
|
|
|
91
92
|
cd dsh-antigravity-auth
|
|
92
93
|
pnpm install
|
|
93
94
|
pnpm pack
|
|
94
|
-
dsh plugin --profile web add ./dsh-antigravity-auth-0.1.
|
|
95
|
+
dsh plugin --profile web add ./dsh-antigravity-auth-0.1.2.tgz
|
|
95
96
|
```
|
|
96
97
|
|
|
97
98
|
## 升级
|
|
@@ -99,7 +100,7 @@ dsh plugin --profile web add ./dsh-antigravity-auth-0.1.1.tgz
|
|
|
99
100
|
先停止正在运行的 `dsh web`,再将 Web Profile 更新到当前版本:
|
|
100
101
|
|
|
101
102
|
```sh
|
|
102
|
-
dsh plugin --profile web add dsh-antigravity-auth@0.1.
|
|
103
|
+
dsh plugin --profile web add dsh-antigravity-auth@0.1.2
|
|
103
104
|
dsh plugin --profile web list
|
|
104
105
|
```
|
|
105
106
|
|
package/lib/llm-adapter.js
CHANGED
|
@@ -2,9 +2,9 @@ import { a as DEFAULT_PRIVATE_RESPONSE_HEADER_TIMEOUT_MS, d as privateStatusErro
|
|
|
2
2
|
import { ANTIGRAVITY_WIRE_ORIGIN } from "./wire-identity.js";
|
|
3
3
|
import { t as classifyPrivateFailure } from "./private-failure-B9vzUkQ7.js";
|
|
4
4
|
import { antigravityModelFamily, buildFunctionDeclarations, compatibleReplayState, createReplayState } from "./replay.js";
|
|
5
|
-
import { AgyRequestSessionStore, applyClaudeTransforms, applyGeminiTransforms, buildAgyAgentRequestMetadata, fnv1a64Signed, getPublicModelDefinitions, getResolverAliasMap, resolveModelWithTier } from "@cortexkit/antigravity-auth-core";
|
|
5
|
+
import { AgyRequestSessionStore, CLAUDE_DESCRIPTION_PROMPT, CLAUDE_TOOL_SYSTEM_INSTRUCTION, SKIP_THOUGHT_SIGNATURE, applyClaudeTransforms, applyGeminiTransforms, buildAgyAgentRequestMetadata, fnv1a64Signed, getPublicModelDefinitions, getResolverAliasMap, resolveModelWithTier } from "@cortexkit/antigravity-auth-core";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
|
-
import { CallId, LlmAdapter, LlmError, ReasoningEffortId, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
|
|
7
|
+
import { CONTEXT_WINDOW_EXCEEDED_CODE, CallId, LlmAdapter, LlmError, ReasoningEffortId, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
|
|
8
8
|
//#region src/llm-adapter.ts
|
|
9
9
|
/** Public DSH LLM adapter for the single Antigravity provider route. */
|
|
10
10
|
const ANTIGRAVITY_PROVIDER = "google-antigravity";
|
|
@@ -14,6 +14,9 @@ const ANTIGRAVITY_AVAILABLE_MODELS_ENDPOINT = `${ANTIGRAVITY_WIRE_ORIGIN}/v1inte
|
|
|
14
14
|
const ANTIGRAVITY_LLM_ROUTE = ANTIGRAVITY_PROVIDER;
|
|
15
15
|
const MODEL_CATALOG_TTL_MS = 3e4;
|
|
16
16
|
const MAX_MODEL_CATALOG_BYTES = 262144;
|
|
17
|
+
const MAX_PROVIDER_ERROR_BYTES = 65536;
|
|
18
|
+
const MAX_PROVIDER_ERROR_FRAME_BYTES = 16384;
|
|
19
|
+
const MAX_PROVIDER_ERROR_JSON_DEPTH = 8;
|
|
17
20
|
const MAX_PROVIDER_PARTS = 4096;
|
|
18
21
|
/** Adapter that owns exactly one provider route and no fallback route. */
|
|
19
22
|
var AntigravityAdapter = class extends LlmAdapter {
|
|
@@ -78,6 +81,7 @@ var AntigravityAdapter = class extends LlmAdapter {
|
|
|
78
81
|
}
|
|
79
82
|
async listModels(provider, signal) {
|
|
80
83
|
this.providerInfo(provider);
|
|
84
|
+
const snapshot = this.pinnedTextModelInfos();
|
|
81
85
|
let available;
|
|
82
86
|
try {
|
|
83
87
|
available = await this.readLiveModelIds(signal);
|
|
@@ -85,9 +89,13 @@ var AntigravityAdapter = class extends LlmAdapter {
|
|
|
85
89
|
} catch (error) {
|
|
86
90
|
const state = error instanceof LlmError && error.code === "PROTOCOL_DRIFT" ? "protocol-drift" : "refresh-failed";
|
|
87
91
|
this.catalogView = createCatalogView(this.definitions, state, void 0, (/* @__PURE__ */ new Date()).toISOString());
|
|
88
|
-
throw error;
|
|
92
|
+
if (!canFallBackToPinnedTextSnapshot(error)) throw error;
|
|
93
|
+
return snapshot;
|
|
89
94
|
}
|
|
90
|
-
return
|
|
95
|
+
return snapshot.filter((model) => available.has(model.id));
|
|
96
|
+
}
|
|
97
|
+
pinnedTextModelInfos() {
|
|
98
|
+
return Object.values(this.definitions).filter((definition) => !definition.modalities.output.includes("image")).map((definition) => ({
|
|
91
99
|
provider: ANTIGRAVITY_PROVIDER,
|
|
92
100
|
id: definition.id,
|
|
93
101
|
name: cleanModelDisplayName(definition.name),
|
|
@@ -152,6 +160,14 @@ var AntigravityAdapter = class extends LlmAdapter {
|
|
|
152
160
|
replayed = true;
|
|
153
161
|
continue;
|
|
154
162
|
}
|
|
163
|
+
if (response.status === 400 && await responseReportsContextWindowExceeded(response, {
|
|
164
|
+
...signal === void 0 ? {} : { signal },
|
|
165
|
+
idleTimeoutMs: this.options.idleTimeoutMs,
|
|
166
|
+
totalTimeoutMs: this.options.totalTimeoutMs,
|
|
167
|
+
maxResponseBytes: this.options.maxResponseBytes,
|
|
168
|
+
maxFrameBytes: this.options.maxFrameBytes
|
|
169
|
+
})) throw contextWindowExceededError(response.status);
|
|
170
|
+
await cancelResponse(response);
|
|
155
171
|
throw toLlmError(statusError);
|
|
156
172
|
}
|
|
157
173
|
try {
|
|
@@ -237,7 +253,7 @@ var AntigravityAdapter = class extends LlmAdapter {
|
|
|
237
253
|
usage
|
|
238
254
|
};
|
|
239
255
|
if (eventError !== void 0) {
|
|
240
|
-
yield finishChunk("error", safeProviderErrorCode(eventError.code), safeProviderStatus(eventError.status));
|
|
256
|
+
yield finishChunk("error", eventError.contextWindowExceeded === true ? CONTEXT_WINDOW_EXCEEDED_CODE : safeProviderErrorCode(eventError.code), safeProviderStatus(eventError.status));
|
|
241
257
|
return;
|
|
242
258
|
}
|
|
243
259
|
if (isAborted(options.signal)) {
|
|
@@ -273,7 +289,7 @@ var AntigravityAdapter = class extends LlmAdapter {
|
|
|
273
289
|
responseHeaderTimeoutMs: this.options.responseHeaderTimeoutMs
|
|
274
290
|
});
|
|
275
291
|
} catch (error) {
|
|
276
|
-
const failure =
|
|
292
|
+
const failure = toModelCatalogError(error, signal, "provider");
|
|
277
293
|
this.rememberCatalogFailure(credential.projectId, failure);
|
|
278
294
|
throw failure;
|
|
279
295
|
}
|
|
@@ -285,8 +301,18 @@ var AntigravityAdapter = class extends LlmAdapter {
|
|
|
285
301
|
...signal === void 0 ? {} : { signal },
|
|
286
302
|
responseHeaderTimeoutMs: this.options.responseHeaderTimeoutMs
|
|
287
303
|
});
|
|
288
|
-
if (retryResponse.ok)
|
|
289
|
-
|
|
304
|
+
if (retryResponse.ok) {
|
|
305
|
+
await cancelResponse(response);
|
|
306
|
+
response = retryResponse;
|
|
307
|
+
} else await cancelResponse(retryResponse);
|
|
308
|
+
} catch (error) {
|
|
309
|
+
const failure = toModelCatalogError(error, signal, "provider");
|
|
310
|
+
if (failure.code === "CANCELLED" || failure.code === "GATE_0_ATTRIBUTION") {
|
|
311
|
+
await cancelResponse(response);
|
|
312
|
+
this.rememberCatalogFailure(credential.projectId, failure);
|
|
313
|
+
throw failure;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
290
316
|
const statusError = privateStatusError(response.status);
|
|
291
317
|
if (statusError !== void 0) {
|
|
292
318
|
await cancelResponse(response);
|
|
@@ -307,7 +333,7 @@ var AntigravityAdapter = class extends LlmAdapter {
|
|
|
307
333
|
maxBytes: Math.min(this.options.maxResponseBytes, MAX_MODEL_CATALOG_BYTES)
|
|
308
334
|
}));
|
|
309
335
|
} catch (error) {
|
|
310
|
-
const failure = error
|
|
336
|
+
const failure = toModelCatalogError(error, signal, "protocol");
|
|
311
337
|
this.rememberCatalogFailure(credential.projectId, failure);
|
|
312
338
|
throw failure;
|
|
313
339
|
}
|
|
@@ -534,10 +560,35 @@ async function buildAntigravityGeneratePayloadForAdapter(options, credential, se
|
|
|
534
560
|
requestType: "agent"
|
|
535
561
|
};
|
|
536
562
|
}
|
|
563
|
+
function groupClaudeFunctionResponses(contents, model) {
|
|
564
|
+
if (antigravityModelFamily(model) !== "claude") return contents;
|
|
565
|
+
const grouped = [];
|
|
566
|
+
let pendingResponses = [];
|
|
567
|
+
const flushResponses = () => {
|
|
568
|
+
if (pendingResponses.length === 0) return;
|
|
569
|
+
grouped.push({
|
|
570
|
+
role: "user",
|
|
571
|
+
parts: pendingResponses
|
|
572
|
+
});
|
|
573
|
+
pendingResponses = [];
|
|
574
|
+
};
|
|
575
|
+
for (const content of contents) {
|
|
576
|
+
const rawParts = Array.isArray(content.parts) ? content.parts : [];
|
|
577
|
+
const responseParts = rawParts.filter((part) => isRecord(part) && isRecord(part.functionResponse));
|
|
578
|
+
if (content.role === "user" && rawParts.length > 0 && responseParts.length === rawParts.length) {
|
|
579
|
+
pendingResponses.push(...responseParts);
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
flushResponses();
|
|
583
|
+
grouped.push(content);
|
|
584
|
+
}
|
|
585
|
+
flushResponses();
|
|
586
|
+
return grouped;
|
|
587
|
+
}
|
|
537
588
|
function buildPayloadFromContents(options, credential, contents) {
|
|
538
589
|
const wireModel = resolveWireModel(options.model);
|
|
539
|
-
const request = { contents };
|
|
540
|
-
if (options.system !== void 0 && options.system.trim().length > 0) request.systemInstruction = { parts: [{ text: options.system
|
|
590
|
+
const request = { contents: groupClaudeFunctionResponses(contents, options.model) };
|
|
591
|
+
if (options.system !== void 0 && options.system.trim().length > 0) request.systemInstruction = { parts: [{ text: options.system }] };
|
|
541
592
|
const generationConfig = {};
|
|
542
593
|
if (options.maxTokens !== void 0) generationConfig.maxOutputTokens = boundedInteger(options.maxTokens, 1, 1e6, "maxTokens");
|
|
543
594
|
if (options.temperature !== void 0) generationConfig.temperature = boundedNumber(options.temperature, -100, 100, "temperature");
|
|
@@ -550,19 +601,21 @@ function buildPayloadFromContents(options, credential, contents) {
|
|
|
550
601
|
}
|
|
551
602
|
const resolved = resolveModelWithTier(options.model, { cli_first: false });
|
|
552
603
|
const thinkingLevel = normalizeReasoningEffort(options.reasoningEffort) ?? resolved.thinkingLevel;
|
|
553
|
-
if (wireModel.toLowerCase().includes("claude"))
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
...resolved.thinkingBudget === void 0 ? {} : {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
604
|
+
if (wireModel.toLowerCase().includes("claude")) {
|
|
605
|
+
applyClaudeToolHardening(request);
|
|
606
|
+
applyClaudeTransforms(request, {
|
|
607
|
+
model: wireModel,
|
|
608
|
+
...resolved.thinkingBudget === void 0 ? {} : { tierThinkingBudget: resolved.thinkingBudget },
|
|
609
|
+
...options.reasoningEffort === void 0 && resolved.thinkingBudget === void 0 ? {} : { normalizedThinking: {
|
|
610
|
+
includeThoughts: true,
|
|
611
|
+
...resolved.thinkingBudget === void 0 ? {} : { thinkingBudget: resolved.thinkingBudget }
|
|
612
|
+
} },
|
|
613
|
+
cleanJSONSchema: (value) => isRecord(value) ? value : {
|
|
614
|
+
type: "object",
|
|
615
|
+
properties: {}
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
} else applyGeminiTransforms(request, {
|
|
566
619
|
model: wireModel,
|
|
567
620
|
...thinkingLevel === void 0 ? {} : { tierThinkingLevel: thinkingLevel },
|
|
568
621
|
...resolved.thinkingBudget === void 0 ? {} : { tierThinkingBudget: resolved.thinkingBudget },
|
|
@@ -578,37 +631,115 @@ function buildPayloadFromContents(options, credential, contents) {
|
|
|
578
631
|
request
|
|
579
632
|
};
|
|
580
633
|
}
|
|
634
|
+
function applyClaudeToolHardening(request) {
|
|
635
|
+
if (!Array.isArray(request.tools) || request.tools.length === 0) return;
|
|
636
|
+
request.tools = request.tools.map((tool) => {
|
|
637
|
+
if (!isRecord(tool) || !Array.isArray(tool.functionDeclarations)) return tool;
|
|
638
|
+
return {
|
|
639
|
+
...tool,
|
|
640
|
+
functionDeclarations: tool.functionDeclarations.map((declaration) => hardenClaudeToolDeclaration(declaration))
|
|
641
|
+
};
|
|
642
|
+
});
|
|
643
|
+
const instructionPart = { text: CLAUDE_TOOL_SYSTEM_INSTRUCTION };
|
|
644
|
+
const existing = request.systemInstruction;
|
|
645
|
+
if (isRecord(existing) && Array.isArray(existing.parts)) {
|
|
646
|
+
if (existing.parts.some((part) => isRecord(part) && typeof part.text === "string" && part.text.includes("CRITICAL TOOL USAGE INSTRUCTIONS"))) return;
|
|
647
|
+
request.systemInstruction = {
|
|
648
|
+
...existing,
|
|
649
|
+
parts: [...existing.parts, instructionPart]
|
|
650
|
+
};
|
|
651
|
+
} else if (typeof existing === "string") request.systemInstruction = {
|
|
652
|
+
role: "user",
|
|
653
|
+
parts: [{ text: existing }, instructionPart]
|
|
654
|
+
};
|
|
655
|
+
else request.systemInstruction = {
|
|
656
|
+
role: "user",
|
|
657
|
+
parts: [instructionPart]
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
function hardenClaudeToolDeclaration(value) {
|
|
661
|
+
if (!isRecord(value)) return value;
|
|
662
|
+
const description = typeof value.description === "string" ? value.description : "";
|
|
663
|
+
if (description.includes("STRICT PARAMETERS:")) return value;
|
|
664
|
+
const schema = isRecord(value.parameters) ? value.parameters : void 0;
|
|
665
|
+
const properties = schema !== void 0 && isRecord(schema.properties) ? schema.properties : void 0;
|
|
666
|
+
if (properties === void 0 || Object.keys(properties).length === 0) return value;
|
|
667
|
+
const required = new Set(Array.isArray(schema?.required) ? schema.required.filter((item) => typeof item === "string") : []);
|
|
668
|
+
const parameters = Object.entries(properties).map(([name, property]) => {
|
|
669
|
+
const requiredHint = required.has(name) ? ", REQUIRED" : "";
|
|
670
|
+
return `${name} (${claudeToolTypeHint(property)}${requiredHint})`;
|
|
671
|
+
});
|
|
672
|
+
return {
|
|
673
|
+
...value,
|
|
674
|
+
description: description + CLAUDE_DESCRIPTION_PROMPT.replace("{params}", parameters.join(", "))
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function claudeToolTypeHint(value) {
|
|
678
|
+
if (!isRecord(value)) return "unknown";
|
|
679
|
+
if (Array.isArray(value.enum)) return value.enum.length <= 5 ? `string ENUM[${value.enum.map((item) => JSON.stringify(item)).join(", ")}]` : `string ENUM[${value.enum.length} options]`;
|
|
680
|
+
const type = typeof value.type === "string" ? value.type : "unknown";
|
|
681
|
+
if (type === "array") {
|
|
682
|
+
if (!isRecord(value.items)) return "ARRAY";
|
|
683
|
+
const itemType = typeof value.items.type === "string" ? value.items.type : "unknown";
|
|
684
|
+
if (itemType !== "object") return `ARRAY_OF_${itemType.toUpperCase()}`;
|
|
685
|
+
if (!isRecord(value.items.properties)) return "ARRAY_OF_OBJECTS";
|
|
686
|
+
const nestedRequired = new Set(Array.isArray(value.items.required) ? value.items.required.filter((item) => typeof item === "string") : []);
|
|
687
|
+
return `ARRAY_OF_OBJECTS[${Object.entries(value.items.properties).map(([name, property]) => {
|
|
688
|
+
return `${name}: ${isRecord(property) && typeof property.type === "string" ? property.type : "unknown"}${nestedRequired.has(name) ? " REQUIRED" : ""}`;
|
|
689
|
+
}).join(", ")}]`;
|
|
690
|
+
}
|
|
691
|
+
if (type === "object" && isRecord(value.properties)) {
|
|
692
|
+
const nestedRequired = new Set(Array.isArray(value.required) ? value.required.filter((item) => typeof item === "string") : []);
|
|
693
|
+
return `object{${Object.entries(value.properties).map(([name, property]) => {
|
|
694
|
+
return `${name}: ${isRecord(property) && typeof property.type === "string" ? property.type : "unknown"}${nestedRequired.has(name) ? " REQUIRED" : ""}`;
|
|
695
|
+
}).join(", ")}}`;
|
|
696
|
+
}
|
|
697
|
+
return type;
|
|
698
|
+
}
|
|
581
699
|
function mapMessage(message, model, toolNames) {
|
|
582
700
|
const parts = [];
|
|
583
701
|
const replayBlocks = compatibleReplayState(message, "google-antigravity", model, contentKinds(message))?.blocks ?? [];
|
|
702
|
+
const isClaude = antigravityModelFamily(model) === "claude";
|
|
703
|
+
let replayIndex = 0;
|
|
704
|
+
let sawClaudeFunctionCall = false;
|
|
584
705
|
for (const block of message.content) {
|
|
585
|
-
const
|
|
586
|
-
const
|
|
706
|
+
const replayKind = block.type === "text" || block.type === "reasoning" || block.type === "tool-call" ? block.type : void 0;
|
|
707
|
+
const replayBlock = replayKind === void 0 ? void 0 : replayBlocks[replayIndex++];
|
|
708
|
+
const replaySignature = replayBlock !== void 0 && replayBlock.kind === replayKind ? replayBlock.signature : void 0;
|
|
709
|
+
const blockSignature = block.signature ?? block.thoughtSignature ?? replaySignature;
|
|
587
710
|
if (block.type === "text") {
|
|
588
711
|
if (block.text.length === 0 && message.content.length > 1) continue;
|
|
589
712
|
parts.push({
|
|
590
713
|
text: block.text,
|
|
591
714
|
...blockSignature === void 0 ? {} : { thoughtSignature: blockSignature }
|
|
592
715
|
});
|
|
593
|
-
} else if (block.type === "reasoning")
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
716
|
+
} else if (block.type === "reasoning") {
|
|
717
|
+
if (isClaude && blockSignature === void 0) continue;
|
|
718
|
+
parts.push({
|
|
719
|
+
text: block.text,
|
|
720
|
+
thought: true,
|
|
721
|
+
...blockSignature === void 0 ? {} : { thoughtSignature: blockSignature }
|
|
722
|
+
});
|
|
723
|
+
} else if (block.type === "tool-call") {
|
|
724
|
+
const callId = rememberToolName(toolNames, block.id, block.name);
|
|
725
|
+
const signature = isClaude ? sawClaudeFunctionCall ? void 0 : blockSignature ?? SKIP_THOUGHT_SIGNATURE : blockSignature;
|
|
726
|
+
sawClaudeFunctionCall ||= isClaude;
|
|
600
727
|
parts.push({
|
|
601
728
|
functionCall: {
|
|
729
|
+
...isClaude ? { id: callId } : {},
|
|
602
730
|
name: block.name,
|
|
603
731
|
args: parseJsonObject(block.arguments)
|
|
604
732
|
},
|
|
605
|
-
...
|
|
733
|
+
...signature === void 0 ? {} : { thoughtSignature: signature }
|
|
606
734
|
});
|
|
607
|
-
} else if (block.type === "tool-result")
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
735
|
+
} else if (block.type === "tool-result") {
|
|
736
|
+
const callId = requireToolCallId(block.toolCallId);
|
|
737
|
+
parts.push({ functionResponse: {
|
|
738
|
+
...isClaude ? { id: callId } : {},
|
|
739
|
+
name: requireToolName(toolNames, callId),
|
|
740
|
+
response: { content: blocksToText(block.content) }
|
|
741
|
+
} });
|
|
742
|
+
} else if (block.type === "image") throw new LlmError("Antigravity text requests do not accept unresolved image blocks", "UNSUPPORTED_MODALITY");
|
|
612
743
|
}
|
|
613
744
|
return {
|
|
614
745
|
role: message.role === "assistant" ? "model" : "user",
|
|
@@ -620,9 +751,14 @@ async function mapMessageWithAttachments(message, model, toolNames, attachments,
|
|
|
620
751
|
if (attachments === void 0) throw new LlmError("Antigravity image input requires the Host AttachmentStore", "UNSUPPORTED_MODALITY");
|
|
621
752
|
const replayBlocks = compatibleReplayState(message, "google-antigravity", model, contentKinds(message))?.blocks ?? [];
|
|
622
753
|
const parts = [];
|
|
754
|
+
const isClaude = antigravityModelFamily(model) === "claude";
|
|
755
|
+
let replayIndex = 0;
|
|
756
|
+
let sawClaudeFunctionCall = false;
|
|
623
757
|
for (const block of message.content) {
|
|
624
|
-
const
|
|
625
|
-
const
|
|
758
|
+
const replayKind = block.type === "text" || block.type === "reasoning" || block.type === "tool-call" ? block.type : void 0;
|
|
759
|
+
const replayBlock = replayKind === void 0 ? void 0 : replayBlocks[replayIndex++];
|
|
760
|
+
const replaySignature = replayBlock !== void 0 && replayBlock.kind === replayKind ? replayBlock.signature : void 0;
|
|
761
|
+
const blockSignature = block.signature ?? block.thoughtSignature ?? replaySignature;
|
|
626
762
|
if (block.type === "image") {
|
|
627
763
|
const stored = await attachments.readImage(block.attachment, signal);
|
|
628
764
|
parts.push({ inlineData: {
|
|
@@ -635,24 +771,33 @@ async function mapMessageWithAttachments(message, model, toolNames, attachments,
|
|
|
635
771
|
text: block.text,
|
|
636
772
|
...blockSignature === void 0 ? {} : { thoughtSignature: blockSignature }
|
|
637
773
|
});
|
|
638
|
-
} else if (block.type === "reasoning")
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
774
|
+
} else if (block.type === "reasoning") {
|
|
775
|
+
if (isClaude && blockSignature === void 0) continue;
|
|
776
|
+
parts.push({
|
|
777
|
+
text: block.text,
|
|
778
|
+
thought: true,
|
|
779
|
+
...blockSignature === void 0 ? {} : { thoughtSignature: blockSignature }
|
|
780
|
+
});
|
|
781
|
+
} else if (block.type === "tool-call") {
|
|
782
|
+
const callId = rememberToolName(toolNames, block.id, block.name);
|
|
783
|
+
const signature = isClaude ? sawClaudeFunctionCall ? void 0 : blockSignature ?? SKIP_THOUGHT_SIGNATURE : blockSignature;
|
|
784
|
+
sawClaudeFunctionCall ||= isClaude;
|
|
645
785
|
parts.push({
|
|
646
786
|
functionCall: {
|
|
787
|
+
...isClaude ? { id: callId } : {},
|
|
647
788
|
name: block.name,
|
|
648
789
|
args: parseJsonObject(block.arguments)
|
|
649
790
|
},
|
|
650
|
-
...
|
|
791
|
+
...signature === void 0 ? {} : { thoughtSignature: signature }
|
|
651
792
|
});
|
|
652
|
-
} else if (block.type === "tool-result")
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
793
|
+
} else if (block.type === "tool-result") {
|
|
794
|
+
const callId = requireToolCallId(block.toolCallId);
|
|
795
|
+
parts.push({ functionResponse: {
|
|
796
|
+
...isClaude ? { id: callId } : {},
|
|
797
|
+
name: requireToolName(toolNames, callId),
|
|
798
|
+
response: { content: blocksToText(block.content) }
|
|
799
|
+
} });
|
|
800
|
+
}
|
|
656
801
|
}
|
|
657
802
|
return {
|
|
658
803
|
role: message.role === "assistant" ? "model" : "user",
|
|
@@ -661,16 +806,21 @@ async function mapMessageWithAttachments(message, model, toolNames, attachments,
|
|
|
661
806
|
}
|
|
662
807
|
function rememberToolName(toolNames, callId, name) {
|
|
663
808
|
if (name.length === 0 || name.length > 256 || containsControl(name)) throw new LlmError("The tool call name is invalid", "INVALID_ARGS");
|
|
664
|
-
const id =
|
|
809
|
+
const id = requireToolCallId(callId);
|
|
665
810
|
const existing = toolNames.get(id);
|
|
666
811
|
if (existing !== void 0 && existing !== name) throw new LlmError("A tool call id was reused with a different name", "INVALID_ARGS");
|
|
667
812
|
toolNames.set(id, name);
|
|
813
|
+
return id;
|
|
668
814
|
}
|
|
669
815
|
function requireToolName(toolNames, callId) {
|
|
670
|
-
const name = toolNames.get(
|
|
816
|
+
const name = toolNames.get(requireToolCallId(callId));
|
|
671
817
|
if (name === void 0) throw new LlmError("A tool result did not match a prior tool call", "INVALID_ARGS");
|
|
672
818
|
return name;
|
|
673
819
|
}
|
|
820
|
+
function requireToolCallId(value) {
|
|
821
|
+
if (typeof value !== "string" || value.length === 0 || value.length > 512 || containsControl(value)) throw new LlmError("The tool call id is invalid", "INVALID_ARGS");
|
|
822
|
+
return value;
|
|
823
|
+
}
|
|
674
824
|
function normalizeReasoningEffort(value) {
|
|
675
825
|
if (value === void 0) return void 0;
|
|
676
826
|
const normalized = String(value).toLowerCase();
|
|
@@ -779,11 +929,83 @@ function parsePart(value) {
|
|
|
779
929
|
function errorDetails(value) {
|
|
780
930
|
const status = numberValue(value.status);
|
|
781
931
|
const code = stringValue(value.code);
|
|
932
|
+
const contextWindowExceeded = providerErrorReportsContextWindowExceeded(value, 0);
|
|
782
933
|
return {
|
|
783
934
|
...status === void 0 ? {} : { status },
|
|
784
|
-
...code === void 0 ? {} : { code }
|
|
935
|
+
...code === void 0 ? {} : { code },
|
|
936
|
+
...contextWindowExceeded ? { contextWindowExceeded: true } : {}
|
|
785
937
|
};
|
|
786
938
|
}
|
|
939
|
+
async function responseReportsContextWindowExceeded(response, options) {
|
|
940
|
+
try {
|
|
941
|
+
for await (const event of iteratePrivateSse(response, {
|
|
942
|
+
...options.signal === void 0 ? {} : { signal: options.signal },
|
|
943
|
+
idleTimeoutMs: options.idleTimeoutMs,
|
|
944
|
+
totalTimeoutMs: options.totalTimeoutMs,
|
|
945
|
+
maxBytes: Math.min(MAX_PROVIDER_ERROR_BYTES, options.maxResponseBytes),
|
|
946
|
+
maxFrameBytes: Math.min(MAX_PROVIDER_ERROR_FRAME_BYTES, options.maxFrameBytes)
|
|
947
|
+
})) if (providerErrorEnvelopeReportsContextWindowExceeded(event.data.replace(/^\)\]\}'(?:\r?\n)?/u, ""), 0)) return true;
|
|
948
|
+
return false;
|
|
949
|
+
} catch (error) {
|
|
950
|
+
if (error instanceof PrivateTransportError && error.code === "cancelled") throw toLlmError(error);
|
|
951
|
+
if (isAborted(options.signal)) throw new LlmError("The Antigravity request was cancelled", "CANCELLED");
|
|
952
|
+
return false;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
function providerErrorReportsContextWindowExceeded(value, depth) {
|
|
956
|
+
if (depth > MAX_PROVIDER_ERROR_JSON_DEPTH) return false;
|
|
957
|
+
if (typeof value.message === "string") {
|
|
958
|
+
if (isExactContextWindowExceededMessage(value.message)) return true;
|
|
959
|
+
if (providerErrorEnvelopeReportsContextWindowExceeded(value.message, depth + 1)) return true;
|
|
960
|
+
}
|
|
961
|
+
return isRecord(value.error) && providerErrorReportsContextWindowExceeded(value.error, depth + 1);
|
|
962
|
+
}
|
|
963
|
+
function providerErrorEnvelopeReportsContextWindowExceeded(value, depth) {
|
|
964
|
+
if (depth > MAX_PROVIDER_ERROR_JSON_DEPTH || value.length === 0 || value.length > MAX_PROVIDER_ERROR_BYTES) return false;
|
|
965
|
+
const json = value.trim();
|
|
966
|
+
if (!json.startsWith("{") || !jsonDepthIsBounded(json, MAX_PROVIDER_ERROR_JSON_DEPTH)) return false;
|
|
967
|
+
try {
|
|
968
|
+
const parsed = JSON.parse(json);
|
|
969
|
+
return isRecord(parsed) && isRecord(parsed.error) ? providerErrorReportsContextWindowExceeded(parsed.error, depth + 1) : false;
|
|
970
|
+
} catch {
|
|
971
|
+
return false;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
function isExactContextWindowExceededMessage(value) {
|
|
975
|
+
const match = /^prompt is too long: ([0-9]{1,16}) tokens > ([0-9]{1,16}) maximum$/u.exec(value);
|
|
976
|
+
const actual = match?.[1];
|
|
977
|
+
const maximum = match?.[2];
|
|
978
|
+
return actual !== void 0 && maximum !== void 0 && BigInt(actual) > BigInt(maximum);
|
|
979
|
+
}
|
|
980
|
+
function jsonDepthIsBounded(value, maxDepth) {
|
|
981
|
+
let depth = 0;
|
|
982
|
+
let inString = false;
|
|
983
|
+
let escaped = false;
|
|
984
|
+
for (const character of value) {
|
|
985
|
+
if (inString) {
|
|
986
|
+
if (escaped) escaped = false;
|
|
987
|
+
else if (character === "\\") escaped = true;
|
|
988
|
+
else if (character === "\"") inString = false;
|
|
989
|
+
continue;
|
|
990
|
+
}
|
|
991
|
+
if (character === "\"") {
|
|
992
|
+
inString = true;
|
|
993
|
+
continue;
|
|
994
|
+
}
|
|
995
|
+
if (character === "{" || character === "[") {
|
|
996
|
+
depth += 1;
|
|
997
|
+
if (depth > maxDepth) return false;
|
|
998
|
+
} else if (character === "}" || character === "]") {
|
|
999
|
+
depth -= 1;
|
|
1000
|
+
if (depth < 0) return false;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
return depth === 0 && !inString && !escaped;
|
|
1004
|
+
}
|
|
1005
|
+
function contextWindowExceededError(status) {
|
|
1006
|
+
const message = "The Antigravity request exceeded the model context window";
|
|
1007
|
+
return status === void 0 ? new LlmError(message, CONTEXT_WINDOW_EXCEEDED_CODE) : new LlmError(message, CONTEXT_WINDOW_EXCEEDED_CODE, { status });
|
|
1008
|
+
}
|
|
787
1009
|
function parseUsage(value) {
|
|
788
1010
|
if (!isRecord(value)) return void 0;
|
|
789
1011
|
const input = numberValue(value.promptTokenCount ?? value.inputTokenCount);
|
|
@@ -864,6 +1086,16 @@ const LLM_FAILURE_CODES = {
|
|
|
864
1086
|
network: "NETWORK",
|
|
865
1087
|
failed: "PROVIDER_ERROR"
|
|
866
1088
|
};
|
|
1089
|
+
function canFallBackToPinnedTextSnapshot(error) {
|
|
1090
|
+
if (!(error instanceof LlmError)) return false;
|
|
1091
|
+
return error.code === "RATE_LIMIT" || error.code === "TIMEOUT" || error.code === "PROTOCOL_DRIFT" || error.code === "RESPONSE_LIMIT" || error.code === "UPSTREAM" || error.code === "NETWORK";
|
|
1092
|
+
}
|
|
1093
|
+
function toModelCatalogError(error, signal, fallback) {
|
|
1094
|
+
if (isAborted(signal)) return new LlmError("The Antigravity live model catalog request was cancelled", "CANCELLED");
|
|
1095
|
+
if (error instanceof LlmError) return error;
|
|
1096
|
+
if (error instanceof PrivateTransportError || fallback === "provider") return toLlmError(error);
|
|
1097
|
+
return new LlmError("The Antigravity live model catalog did not match the audited schema", "PROTOCOL_DRIFT");
|
|
1098
|
+
}
|
|
867
1099
|
function toLlmError(error) {
|
|
868
1100
|
if (error instanceof LlmError) return error;
|
|
869
1101
|
if (error instanceof PrivateTransportError) {
|
package/lib/replay.js
CHANGED
|
@@ -24,7 +24,7 @@ function createReplayState(model, family, finish, blocks) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
/** Validate replay metadata before it can affect a later private request. */
|
|
27
|
-
function compatibleReplayState(message, provider, model,
|
|
27
|
+
function compatibleReplayState(message, provider, model, blockKinds) {
|
|
28
28
|
if (provider !== "google-antigravity" || message.role !== "assistant") return void 0;
|
|
29
29
|
const provenance = isRecord(message.source) ? message.source : void 0;
|
|
30
30
|
if (provenance !== void 0 && provenance.kind === "model" && (provenance.provider !== provider || provenance.model !== model)) return void 0;
|
|
@@ -42,6 +42,7 @@ function compatibleReplayState(message, provider, model, _blockKinds) {
|
|
|
42
42
|
...signature === void 0 ? {} : { signature }
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
if (blockKinds !== void 0 && (blocks.length !== blockKinds.length || blocks.some((block, index) => block.kind !== blockKinds[index]))) return void 0;
|
|
45
46
|
const finish = value.response.finish === void 0 ? void 0 : safeFinish(value.response.finish);
|
|
46
47
|
if (value.response.finish !== void 0 && finish === void 0) return void 0;
|
|
47
48
|
return {
|
|
@@ -54,6 +54,7 @@ export declare class AntigravityAdapter extends LlmAdapter {
|
|
|
54
54
|
/** Refresh the advisory catalog and collapse failures into browser-safe state. */
|
|
55
55
|
modelCatalog(signal?: AbortSignal, forceRefresh?: boolean): Promise<AntigravityModelCatalogView>;
|
|
56
56
|
listModels(provider: string, signal?: AbortSignal): Promise<readonly LlmModelInfo[]>;
|
|
57
|
+
private pinnedTextModelInfos;
|
|
57
58
|
resolveModel(provider: string, model: string, _signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
58
59
|
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
59
60
|
private streamResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-adapter.d.ts","sourceRoot":"","sources":["../../src/llm-adapter.ts"],"names":[],"mappings":"AAAA,wEAAwE;
|
|
1
|
+
{"version":3,"file":"llm-adapter.d.ts","sourceRoot":"","sources":["../../src/llm-adapter.ts"],"names":[],"mappings":"AAAA,wEAAwE;AAgBxE,OAAO,EAGL,UAAU,EAGV,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACZ,eAAe,EACf,oBAAoB,EAGpB,WAAW,EAEZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACxF,OAAO,EAWL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAA;AAU/B,OAAO,KAAK,EAAgC,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAEnG,eAAO,MAAM,oBAAoB,EAAG,oBAA6B,CAAA;AACjE,eAAO,MAAM,2BAA2B,sDAAiF,CAAA;AACzH,eAAO,MAAM,6BAA6B,wCAAmE,CAAA;AAC7G,eAAO,MAAM,qCAAqC,6CAAwE,CAAA;AAC1H,eAAO,MAAM,qBAAqB,sBAAuB,CAAA;AAQzD,MAAM,WAAW,+BAA+B;IAC9C,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;CACrH;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,YAAY,CAAC,GAAG,+BAA+B,CAAA;IAC1F,uEAAuE;IACvE,QAAQ,CAAC,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9B,+EAA+E;IAC/E,eAAe,IAAI,2BAA2B;IAI9C,kFAAkF;IAC5E,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,YAAY,UAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAWrF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAkBnG,OAAO,CAAC,oBAAoB;IAWb,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqBlG,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAyE7D,cAAc;YAsFf,gBAAgB;IA0F9B,OAAO,CAAC,sBAAsB;YAQhB,cAAc;CAO7B;AA8MD,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAM7H"}
|
package/lib/types/replay.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface AntigravityReplayState extends ReplayEnvelope {
|
|
|
21
21
|
/** Keep only provider-issued signatures and bounded response facts. */
|
|
22
22
|
export declare function createReplayState(model: string, family: AntigravityReplayResponse['family'], finish: string | undefined, blocks: readonly AntigravityReplayBlock[]): AntigravityReplayState;
|
|
23
23
|
/** Validate replay metadata before it can affect a later private request. */
|
|
24
|
-
export declare function compatibleReplayState(message: Message, provider: string, model: string,
|
|
24
|
+
export declare function compatibleReplayState(message: Message, provider: string, model: string, blockKinds?: readonly ReplayBlockKind[]): AntigravityReplayState | undefined;
|
|
25
25
|
/** Return the block family without allowing a model alias to cross families. */
|
|
26
26
|
export declare function antigravityModelFamily(model: string): AntigravityReplayResponse['family'];
|
|
27
27
|
/** Convert DSH schemas to the small function-declaration subset accepted privately. */
|
|
@@ -1 +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