@benjamolina/pi-antigravity-guard 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -14
- package/dist/accounts.d.ts +94 -0
- package/dist/accounts.js +953 -0
- package/dist/auth-http.d.ts +2 -1
- package/dist/auth-http.js +4 -2
- package/dist/catalog.d.ts +268 -0
- package/dist/catalog.js +265 -1
- package/dist/commands.d.ts +13 -0
- package/dist/commands.js +97 -0
- package/dist/context.d.ts +12 -2
- package/dist/context.js +181 -20
- package/dist/extension.d.ts +2 -2
- package/dist/extension.js +3 -3
- package/dist/project.d.ts +1 -0
- package/dist/project.js +1 -1
- package/dist/provider.d.ts +26 -1
- package/dist/provider.js +621 -23
- package/dist/response.d.ts +8 -0
- package/dist/response.js +59 -0
- package/dist/stream.d.ts +33 -2
- package/dist/stream.js +236 -27
- package/dist/tool-context.d.ts +2 -1
- package/dist/tool-context.js +40 -14
- package/dist/tool-schema.d.ts +2 -0
- package/dist/tool-schema.js +20 -26
- package/package.json +2 -2
package/dist/tool-schema.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION, EMPTY_SCHEMA_PLACEHOLDER_NAME, cleanJSONSchemaForAntigravity, toGeminiSchema, } from "@benjamolina/antigravity-guard-core";
|
|
1
2
|
import { denseArray, fail, freeze, ownData, plainObject } from "./tool-contract.js";
|
|
3
|
+
export { cleanJSONSchemaForAntigravity, toGeminiSchema };
|
|
2
4
|
const MAX_SCHEMA_DEPTH = 32;
|
|
3
5
|
const MAX_SCHEMA_NODES = 2048;
|
|
4
6
|
const MAX_SCHEMA_BYTES = 256 * 1024;
|
|
@@ -218,34 +220,26 @@ function isJsonObject(value) {
|
|
|
218
220
|
function define(target, key, value) {
|
|
219
221
|
Object.defineProperty(target, key, { value, enumerable: true, configurable: false, writable: false });
|
|
220
222
|
}
|
|
221
|
-
const CUSTOM_TOOL_SCHEMA_ALLOW = new Set([
|
|
222
|
-
"type",
|
|
223
|
-
"description",
|
|
224
|
-
"properties",
|
|
225
|
-
"required",
|
|
226
|
-
"items",
|
|
227
|
-
"enum",
|
|
228
|
-
]);
|
|
229
223
|
export function normalizeCustomToolSchema(schema) {
|
|
230
224
|
if (!schema || typeof schema !== "object" || Array.isArray(schema))
|
|
231
225
|
return {};
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
226
|
+
const cleaned = cleanJSONSchemaForAntigravity(schema);
|
|
227
|
+
if (!cleaned || typeof cleaned !== "object" || Array.isArray(cleaned))
|
|
228
|
+
return {};
|
|
229
|
+
const hasProperties = cleaned.properties !== null &&
|
|
230
|
+
typeof cleaned.properties === "object" &&
|
|
231
|
+
!Array.isArray(cleaned.properties) &&
|
|
232
|
+
Object.keys(cleaned.properties).length > 0;
|
|
233
|
+
if (cleaned.type === "object" && !hasProperties) {
|
|
234
|
+
cleaned.properties = {
|
|
235
|
+
[EMPTY_SCHEMA_PLACEHOLDER_NAME]: {
|
|
236
|
+
type: "boolean",
|
|
237
|
+
description: EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION,
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
cleaned.required = Array.isArray(cleaned.required)
|
|
241
|
+
? Array.from(new Set([...cleaned.required, EMPTY_SCHEMA_PLACEHOLDER_NAME]))
|
|
242
|
+
: [EMPTY_SCHEMA_PLACEHOLDER_NAME];
|
|
249
243
|
}
|
|
250
|
-
return
|
|
244
|
+
return cleaned;
|
|
251
245
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benjamolina/pi-antigravity-guard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Pi adapter for Antigravity Guard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@benjamolina/antigravity-guard-core": "0.
|
|
32
|
+
"@benjamolina/antigravity-guard-core": "0.3.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@earendil-works/pi-ai": "*",
|