feat(native): add inspection primitives, dispatch traces and approved UI observation (#500)
* fix(hopper): normalize string-backed addresses and update verification * feat(native): add inspection primitives, dispatch traces and approved UI observation * test: prioritize real artifact E2E and captured golden regressions * fix(process): queue observed output before reactive rendering actions * test: prune redundant cases and strengthen boundary assertions * fix(cli): route native value tracing through shared workflows * test: replace synthetic success with real workflows and captured data * fix(catalog): separate portable metadata from native host availability
This commit is contained in:
@@ -2,17 +2,22 @@ import { describe, expect, it } from "vitest";
|
||||
|
||||
import { parseConfig } from "../config.js";
|
||||
import { silentLogger } from "../logger.js";
|
||||
import { HopperProvider } from "./HopperProvider.js";
|
||||
import {
|
||||
HopperProvider,
|
||||
HOPPER_PROVIDER_TOOL_CONTRACTS,
|
||||
} from "./HopperProvider.js";
|
||||
|
||||
describe("Hopper provider capabilities", () => {
|
||||
it("publishes deterministic descriptors and resists caller mutation", () => {
|
||||
const config = parseConfig({});
|
||||
expect(config.ok).toBe(true);
|
||||
if (!config.ok) return;
|
||||
if (!config.ok) throw new Error("expected valid configuration");
|
||||
const provider = new HopperProvider(config.value, silentLogger);
|
||||
const capabilities = provider.capabilities();
|
||||
const published = structuredClone(capabilities);
|
||||
expect(capabilities).toHaveLength(37);
|
||||
expect(capabilities.map(({ operation }) => operation)).toEqual(
|
||||
HOPPER_PROVIDER_TOOL_CONTRACTS.map(({ name }) => name),
|
||||
);
|
||||
expect(new Set(capabilities.map(({ operation }) => operation)).size).toBe(
|
||||
capabilities.length,
|
||||
);
|
||||
|
||||
@@ -44,7 +44,13 @@ const MUTATING_OPERATIONS = new Set([
|
||||
|
||||
/** Tool contracts implemented directly by the Hopper adapter. */
|
||||
export const HOPPER_PROVIDER_TOOL_CONTRACTS = Object.freeze([
|
||||
...GENERATED_MCP_TOOL_CATALOG.filter(({ kind }) => kind === "official-proxy"),
|
||||
...GENERATED_MCP_TOOL_CATALOG.filter(
|
||||
({ kind, name }) =>
|
||||
kind === "official-proxy" &&
|
||||
name !== "inspect_native_data_type" &&
|
||||
name !== "inspect_native_instruction" &&
|
||||
name !== "resolve_native_call_targets",
|
||||
),
|
||||
...GENERATED_MCP_TOOL_CATALOG.filter(
|
||||
({ name }) => name === "analyze_function",
|
||||
),
|
||||
|
||||
@@ -44,20 +44,6 @@ describe("Hopper provider discovery", () => {
|
||||
diagnostics: { target_kind: "archive", target_format: "asar" },
|
||||
});
|
||||
});
|
||||
|
||||
it("advertises byte reads as an available operation", () => {
|
||||
const capabilities = provider(process.execPath).capabilities();
|
||||
expect(
|
||||
capabilities.find(({ operation }) => operation === "read_bytes"),
|
||||
).toMatchObject({
|
||||
available: true,
|
||||
});
|
||||
expect(
|
||||
capabilities.find(
|
||||
({ operation }) => operation === "address_to_file_offset",
|
||||
),
|
||||
).toMatchObject({ available: true });
|
||||
});
|
||||
});
|
||||
|
||||
const provider = (launcherPath: string): HopperProvider => {
|
||||
|
||||
@@ -20,6 +20,6 @@ describe("Hopper response stream", () => {
|
||||
stream.push(`${line}\n`);
|
||||
|
||||
expect(failures).toEqual([]);
|
||||
expect(messages).toHaveLength(1);
|
||||
expect(messages).toEqual([JSON.parse(line)]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user