feat: add passive website reverse engineering
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from "../src/contracts/toolContracts.js";
|
||||
import { NATIVE_TOOL_CONTRACTS } from "../src/contracts/nativeToolContracts.js";
|
||||
import { ARTIFACT_TOOL_CONTRACTS } from "../src/contracts/artifactToolContracts.js";
|
||||
import { BROWSER_TOOL_CONTRACTS } from "../src/contracts/browserToolContracts.js";
|
||||
import {
|
||||
enhancedOutputSchemas,
|
||||
officialOutputSchemas,
|
||||
@@ -34,8 +35,9 @@ describe("tool contract surface", () => {
|
||||
...ENHANCED_TOOL_CONTRACTS,
|
||||
...NATIVE_TOOL_CONTRACTS,
|
||||
...ARTIFACT_TOOL_CONTRACTS,
|
||||
...BROWSER_TOOL_CONTRACTS,
|
||||
];
|
||||
expect(contracts).toHaveLength(50);
|
||||
expect(contracts).toHaveLength(52);
|
||||
for (const contract of contracts) {
|
||||
const inputSchema = z.toJSONSchema(contract.inputSchema, {
|
||||
target: "draft-07",
|
||||
@@ -50,7 +52,9 @@ describe("tool contract surface", () => {
|
||||
expect(contract.annotations).toMatchObject({
|
||||
idempotentHint: true,
|
||||
});
|
||||
expect(contract.annotations.openWorldHint).toBe(false);
|
||||
expect(contract.annotations.openWorldHint).toBe(
|
||||
contract.kind === "browser-provider",
|
||||
);
|
||||
expect(typeof contract.annotations.readOnlyHint).toBe("boolean");
|
||||
expect(typeof contract.annotations.destructiveHint).toBe("boolean");
|
||||
expect(contract.examples).toHaveLength(1);
|
||||
@@ -136,15 +140,16 @@ describe("tool contract surface", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("publishes no unconstrained output-schema holes across all 68 tools", () => {
|
||||
it("publishes no unconstrained output-schema holes across all 70 tools", () => {
|
||||
const contracts = [
|
||||
...OFFICIAL_TOOL_CONTRACTS,
|
||||
...ENHANCED_TOOL_CONTRACTS,
|
||||
...NATIVE_TOOL_CONTRACTS,
|
||||
...ARTIFACT_TOOL_CONTRACTS,
|
||||
...BROWSER_TOOL_CONTRACTS,
|
||||
...SESSION_TOOL_CONTRACTS,
|
||||
];
|
||||
expect(contracts).toHaveLength(68);
|
||||
expect(contracts).toHaveLength(70);
|
||||
for (const contract of contracts) {
|
||||
const schema = z.toJSONSchema(contract.outputSchema, {
|
||||
target: "draft-07",
|
||||
|
||||
Reference in New Issue
Block a user