refactor(provider): declare deep capabilities from source (#892)
This commit is contained in:
@@ -34,11 +34,11 @@ import { JADX_PROVIDER_IDENTITY } from "../../../src/android/JadxRelease.js";
|
||||
import { TOOL_CONTRACTS } from "../../../src/contracts/toolContracts.js";
|
||||
import {
|
||||
HOPPER_PROVIDER_IDENTITY,
|
||||
HOPPER_PROVIDER_TOOL_CONTRACTS,
|
||||
HOPPER_OPERATIONS,
|
||||
} from "../../../src/hopper/HopperProvider.js";
|
||||
import {
|
||||
GHIDRA_PROVIDER_IDENTITY,
|
||||
GHIDRA_PROVIDER_TOOL_CONTRACTS,
|
||||
GHIDRA_OPERATIONS,
|
||||
} from "../../../src/ghidra/GhidraProvider.js";
|
||||
import { NATIVE_MACOS_PROVIDER_IDENTITY } from "../../../src/native/NativeMacOSProvider.js";
|
||||
import { IDA_PROVIDER_IDENTITY } from "../../../src/ida/IdaProvider.js";
|
||||
@@ -130,11 +130,11 @@ describe("canonical product catalog", () => {
|
||||
expect(
|
||||
catalog.providers.find(({ id }) => id === HOPPER_PROVIDER_IDENTITY.id)
|
||||
?.capabilities,
|
||||
).toEqual(HOPPER_PROVIDER_TOOL_CONTRACTS.map(({ name }) => name).sort());
|
||||
).toEqual([...HOPPER_OPERATIONS].sort());
|
||||
expect(
|
||||
catalog.providers.find(({ id }) => id === GHIDRA_PROVIDER_IDENTITY.id)
|
||||
?.capabilities,
|
||||
).toEqual(GHIDRA_PROVIDER_TOOL_CONTRACTS.map(({ name }) => name).sort());
|
||||
).toEqual([...GHIDRA_OPERATIONS].sort());
|
||||
expect(
|
||||
catalog.providers.find(
|
||||
({ id }) => id === CDP_ELECTRON_PROVIDER_IDENTITY.id,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, onTestFinished, vi } from "vitest";
|
||||
|
||||
import { HOPPER_PROVIDER_TOOL_CONTRACTS } from "../../../../src/hopper/HopperProvider.js";
|
||||
import { HOPPER_OPERATIONS } from "../../../../src/hopper/HopperProvider.js";
|
||||
import { HopperClient } from "../../../../src/hopper/HopperClient.js";
|
||||
import type { HopperDiagnostic } from "../../../../src/hopper/HopperDiagnostics.js";
|
||||
import { providerCleanupFailure } from "../../../../src/hopper/HopperDiagnostics.js";
|
||||
@@ -74,11 +74,9 @@ describe("HopperClient protocol", () => {
|
||||
it("routes every established operation through the authenticated bridge", async () => {
|
||||
const client = await startClient();
|
||||
const results = await Promise.all(
|
||||
HOPPER_PROVIDER_TOOL_CONTRACTS.map(({ name }) =>
|
||||
client.callTool(name, {}),
|
||||
),
|
||||
HOPPER_OPERATIONS.map((name) => client.callTool(name, {})),
|
||||
);
|
||||
expect(results).toHaveLength(HOPPER_PROVIDER_TOOL_CONTRACTS.length);
|
||||
expect(results).toHaveLength(HOPPER_OPERATIONS.length);
|
||||
expect(results.every((result) => result.ok)).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user