@benjamolina/pi-antigravity-guard 0.4.6 → 0.4.7
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/README.md +3 -3
- package/dist/catalog.d.ts +5 -4
- package/dist/catalog.js +10 -9
- package/dist/context.d.ts +2 -1
- package/dist/context.js +9 -2
- package/dist/tool-context.js +2 -2
- package/dist/tool-schema.d.ts +1 -0
- package/dist/tool-schema.js +31 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,9 +22,9 @@ All seven rows below are registered for text. The exact `antigravity-gemini-3.8-
|
|
|
22
22
|
| `antigravity-gemini-3.7-flash` | off, low, medium, high | Enabled (off, low, medium, high) | pi-json-tool-loop/gemini-3.7-flash-off-v1 |
|
|
23
23
|
| `antigravity-gemini-3.6-flash` | off, low, medium, high | Enabled (off, low, medium, high) | pi-json-tool-loop/gemini-3.6-flash-off-v1 |
|
|
24
24
|
| `antigravity-gemini-3.1-pro` | off, low, high | Enabled (off, low, high) | pi-json-tool-loop/gemini-3.1-pro-off-v1 |
|
|
25
|
-
| `antigravity-claude-sonnet-4.6` | off, high |
|
|
26
|
-
| `antigravity-claude-opus-4.6-thinking` | off, high |
|
|
27
|
-
| `antigravity-gpt-oss-120b` | off, medium |
|
|
25
|
+
| `antigravity-claude-sonnet-4.6` | off, high | Enabled (off, high) | pi-json-tool-loop/claude-sonnet-4.6-off-v1 |
|
|
26
|
+
| `antigravity-claude-opus-4.6-thinking` | off, high | Enabled (off, high) | pi-json-tool-loop/claude-opus-4.6-thinking-off-v1 |
|
|
27
|
+
| `antigravity-gpt-oss-120b` | off, medium | Enabled (off, medium) | pi-json-tool-loop/gpt-oss-120b-off-v1 |
|
|
28
28
|
|
|
29
29
|
`off` is available for every row even though it is omitted from Pi's level map; omitted reasoning also selects that row's `off` route. Unsupported levels are not advertised and are rejected before transport. `antigravity-gemini-3.5-flash` is not registered or advertised as supported because its recorded HTTP-200 response lacks the strict terminal metadata required for admission. A future `fixture-qualified` route remains disabled for ordinary tool use; only separately authorized direct validation for the exact route may make it enabled.
|
|
30
30
|
|
package/dist/catalog.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ export interface ToolEvidenceRef {
|
|
|
8
8
|
readonly wireModel: string;
|
|
9
9
|
}
|
|
10
10
|
export declare const GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE: "gemini-parameters-json-schema";
|
|
11
|
-
export
|
|
11
|
+
export declare const CLAUDE_CUSTOM_PARAMETERS_PROFILE: "claude-custom-parameters";
|
|
12
|
+
export type ToolSchemaProfile = typeof GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE | typeof CLAUDE_CUSTOM_PARAMETERS_PROFILE;
|
|
12
13
|
export type ToolCapability = {
|
|
13
14
|
readonly state: "disabled";
|
|
14
15
|
readonly contractRevision: 1;
|
|
@@ -316,7 +317,7 @@ declare const CATALOG: readonly [{
|
|
|
316
317
|
};
|
|
317
318
|
};
|
|
318
319
|
readonly replay: {
|
|
319
|
-
readonly kind: "
|
|
320
|
+
readonly kind: "same-public-model";
|
|
320
321
|
};
|
|
321
322
|
readonly response: {
|
|
322
323
|
readonly kind: "gemini-envelope";
|
|
@@ -356,7 +357,7 @@ declare const CATALOG: readonly [{
|
|
|
356
357
|
};
|
|
357
358
|
};
|
|
358
359
|
readonly replay: {
|
|
359
|
-
readonly kind: "
|
|
360
|
+
readonly kind: "same-public-model";
|
|
360
361
|
};
|
|
361
362
|
readonly response: {
|
|
362
363
|
readonly kind: "gemini-envelope";
|
|
@@ -394,7 +395,7 @@ declare const CATALOG: readonly [{
|
|
|
394
395
|
};
|
|
395
396
|
};
|
|
396
397
|
readonly replay: {
|
|
397
|
-
readonly kind: "
|
|
398
|
+
readonly kind: "same-public-model";
|
|
398
399
|
};
|
|
399
400
|
readonly response: {
|
|
400
401
|
readonly kind: "gemini-envelope";
|
package/dist/catalog.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ANSWER_RESERVE = 1024;
|
|
2
2
|
export const GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE = "gemini-parameters-json-schema";
|
|
3
|
+
export const CLAUDE_CUSTOM_PARAMETERS_PROFILE = "claude-custom-parameters";
|
|
3
4
|
const CATALOG = freeze(defineCatalog([{
|
|
4
5
|
publicId: "antigravity-gemini-3.8-flash",
|
|
5
6
|
descriptor: {
|
|
@@ -72,10 +73,10 @@ const CATALOG = freeze(defineCatalog([{
|
|
|
72
73
|
maxTokens: 64_000,
|
|
73
74
|
},
|
|
74
75
|
routes: {
|
|
75
|
-
off: { wireModel: "claude-sonnet-4-6", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools:
|
|
76
|
-
high: { wireModel: "claude-sonnet-4-6", thinking: { kind: "budget", budget: 1024, includeThoughts: true }, tools:
|
|
76
|
+
off: { wireModel: "claude-sonnet-4-6", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools: enabled({ record: "pi-json-tool-loop", revision: "claude-sonnet-4.6-off-v1", publicModelId: "antigravity-claude-sonnet-4.6", reasoning: "off", wireModel: "claude-sonnet-4-6" }, CLAUDE_CUSTOM_PARAMETERS_PROFILE) },
|
|
77
|
+
high: { wireModel: "claude-sonnet-4-6", thinking: { kind: "budget", budget: 1024, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "claude-sonnet-4.6-high-v1", publicModelId: "antigravity-claude-sonnet-4.6", reasoning: "high", wireModel: "claude-sonnet-4-6" }, CLAUDE_CUSTOM_PARAMETERS_PROFILE) },
|
|
77
78
|
},
|
|
78
|
-
replay: { kind: "
|
|
79
|
+
replay: { kind: "same-public-model" },
|
|
79
80
|
response: { kind: "gemini-envelope", family: "claude" },
|
|
80
81
|
}, {
|
|
81
82
|
publicId: "antigravity-claude-opus-4.6-thinking",
|
|
@@ -86,10 +87,10 @@ const CATALOG = freeze(defineCatalog([{
|
|
|
86
87
|
maxTokens: 64_000,
|
|
87
88
|
},
|
|
88
89
|
routes: {
|
|
89
|
-
off: { wireModel: "claude-opus-4-6-thinking", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools:
|
|
90
|
-
high: { wireModel: "claude-opus-4-6-thinking", thinking: { kind: "budget", budget: 1024, includeThoughts: true }, tools:
|
|
90
|
+
off: { wireModel: "claude-opus-4-6-thinking", thinking: { kind: "budget", budget: 0, includeThoughts: false }, tools: enabled({ record: "pi-json-tool-loop", revision: "claude-opus-4.6-thinking-off-v1", publicModelId: "antigravity-claude-opus-4.6-thinking", reasoning: "off", wireModel: "claude-opus-4-6-thinking" }, CLAUDE_CUSTOM_PARAMETERS_PROFILE) },
|
|
91
|
+
high: { wireModel: "claude-opus-4-6-thinking", thinking: { kind: "budget", budget: 1024, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "claude-opus-4.6-thinking-high-v1", publicModelId: "antigravity-claude-opus-4.6-thinking", reasoning: "high", wireModel: "claude-opus-4-6-thinking" }, CLAUDE_CUSTOM_PARAMETERS_PROFILE) },
|
|
91
92
|
},
|
|
92
|
-
replay: { kind: "
|
|
93
|
+
replay: { kind: "same-public-model" },
|
|
93
94
|
response: { kind: "gemini-envelope", family: "claude" },
|
|
94
95
|
}, {
|
|
95
96
|
publicId: "antigravity-gpt-oss-120b",
|
|
@@ -100,10 +101,10 @@ const CATALOG = freeze(defineCatalog([{
|
|
|
100
101
|
maxTokens: 32_768,
|
|
101
102
|
},
|
|
102
103
|
routes: {
|
|
103
|
-
off: { wireModel: "gpt-oss-120b-medium", thinking: { kind: "omit" }, tools:
|
|
104
|
-
medium: { wireModel: "gpt-oss-120b-medium", thinking: { kind: "budget", budget: 8192, includeThoughts: true }, tools:
|
|
104
|
+
off: { wireModel: "gpt-oss-120b-medium", thinking: { kind: "omit" }, tools: enabled({ record: "pi-json-tool-loop", revision: "gpt-oss-120b-off-v1", publicModelId: "antigravity-gpt-oss-120b", reasoning: "off", wireModel: "gpt-oss-120b-medium" }, CLAUDE_CUSTOM_PARAMETERS_PROFILE) },
|
|
105
|
+
medium: { wireModel: "gpt-oss-120b-medium", thinking: { kind: "budget", budget: 8192, includeThoughts: true }, tools: enabled({ record: "pi-json-tool-loop", revision: "gpt-oss-120b-medium-v1", publicModelId: "antigravity-gpt-oss-120b", reasoning: "medium", wireModel: "gpt-oss-120b-medium" }, CLAUDE_CUSTOM_PARAMETERS_PROFILE) },
|
|
105
106
|
},
|
|
106
|
-
replay: { kind: "
|
|
107
|
+
replay: { kind: "same-public-model" },
|
|
107
108
|
response: { kind: "gemini-envelope", family: "gpt-oss" },
|
|
108
109
|
}]));
|
|
109
110
|
const lookup = new Map(CATALOG.map((entry) => [entry.publicId, entry]));
|
package/dist/context.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ interface Content {
|
|
|
17
17
|
interface GeminiFunctionDeclaration {
|
|
18
18
|
readonly name: string;
|
|
19
19
|
readonly description: string;
|
|
20
|
-
readonly parametersJsonSchema
|
|
20
|
+
readonly parametersJsonSchema?: object;
|
|
21
|
+
readonly parameters?: object;
|
|
21
22
|
}
|
|
22
23
|
export interface GenerationRequest {
|
|
23
24
|
project: string;
|
package/dist/context.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getCatalogEntry, resolveGenerationSelection } from "./catalog.js";
|
|
1
|
+
import { CLAUDE_CUSTOM_PARAMETERS_PROFILE, getCatalogEntry, resolveGenerationSelection } from "./catalog.js";
|
|
2
|
+
import { normalizeCustomToolSchema } from "./tool-schema.js";
|
|
2
3
|
import { hasToolContext, prepareToolContext, replayToolHistory } from "./tool-context.js";
|
|
3
4
|
const MAX_TEXT_BYTES = 8 * 1024 * 1024;
|
|
4
5
|
const PROVIDER = "antigravity-guard";
|
|
@@ -36,7 +37,13 @@ export function serializeContext(input, injectedSelection, onDiagnostics) {
|
|
|
36
37
|
contents,
|
|
37
38
|
...(systemInstruction ? { systemInstruction } : {}),
|
|
38
39
|
...(prepared ? {
|
|
39
|
-
tools: [{ functionDeclarations: prepared.declarations.map(({ name, description, parameters }) => ({
|
|
40
|
+
tools: [{ functionDeclarations: prepared.declarations.map(({ name, description, parameters }) => ({
|
|
41
|
+
name,
|
|
42
|
+
description,
|
|
43
|
+
...(selection.tools.state === "enabled" && selection.tools.schemaProfile === CLAUDE_CUSTOM_PARAMETERS_PROFILE
|
|
44
|
+
? { parameters: normalizeCustomToolSchema(parameters) }
|
|
45
|
+
: { parametersJsonSchema: parameters }),
|
|
46
|
+
})) }],
|
|
40
47
|
...(prepared.mode === "NONE" ? { toolConfig: { functionCallingConfig: { mode: "NONE" } } } : {}),
|
|
41
48
|
} : {}),
|
|
42
49
|
generationConfig,
|
package/dist/tool-context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { canonicalJson, ToolPreflightError } from "./tool-contract.js";
|
|
2
|
-
import { GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE } from "./catalog.js";
|
|
2
|
+
import { CLAUDE_CUSTOM_PARAMETERS_PROFILE, GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE } from "./catalog.js";
|
|
3
3
|
import { normalizeToolDeclarations } from "./tool-schema.js";
|
|
4
4
|
export function hasToolContext(context) {
|
|
5
5
|
if (!isRecord(context))
|
|
@@ -18,7 +18,7 @@ export function hasToolContext(context) {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
export function prepareToolContext(tools, choice, schemaProfile) {
|
|
21
|
-
if (schemaProfile !== GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE)
|
|
21
|
+
if (schemaProfile !== GEMINI_PARAMETERS_JSON_SCHEMA_PROFILE && schemaProfile !== CLAUDE_CUSTOM_PARAMETERS_PROFILE)
|
|
22
22
|
throw new ToolPreflightError("PI_TOOL_SCHEMA_PROFILE_UNSUPPORTED", "tools", "$");
|
|
23
23
|
const declarations = normalizeToolDeclarations(tools ?? []);
|
|
24
24
|
if (!declarations.length) {
|
package/dist/tool-schema.d.ts
CHANGED
package/dist/tool-schema.js
CHANGED
|
@@ -210,3 +210,34 @@ function isJsonObject(value) {
|
|
|
210
210
|
function define(target, key, value) {
|
|
211
211
|
Object.defineProperty(target, key, { value, enumerable: true, configurable: false, writable: false });
|
|
212
212
|
}
|
|
213
|
+
const CUSTOM_TOOL_SCHEMA_ALLOW = new Set([
|
|
214
|
+
"type",
|
|
215
|
+
"description",
|
|
216
|
+
"properties",
|
|
217
|
+
"required",
|
|
218
|
+
"items",
|
|
219
|
+
"enum",
|
|
220
|
+
]);
|
|
221
|
+
export function normalizeCustomToolSchema(schema) {
|
|
222
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema))
|
|
223
|
+
return {};
|
|
224
|
+
const out = {};
|
|
225
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
226
|
+
if (!CUSTOM_TOOL_SCHEMA_ALLOW.has(key))
|
|
227
|
+
continue;
|
|
228
|
+
if (key === "properties" && value && typeof value === "object" && !Array.isArray(value)) {
|
|
229
|
+
const props = {};
|
|
230
|
+
for (const [propName, propSchema] of Object.entries(value)) {
|
|
231
|
+
props[propName] = normalizeCustomToolSchema(propSchema);
|
|
232
|
+
}
|
|
233
|
+
out.properties = props;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (key === "items") {
|
|
237
|
+
out.items = normalizeCustomToolSchema(value);
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
out[key] = value;
|
|
241
|
+
}
|
|
242
|
+
return out;
|
|
243
|
+
}
|