fix(tools)!: simplify direct invocation and harden boundary contracts (#555)
Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures. Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation. BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { browserContext } from "./cliBrowserContext.js";
|
||||
import { CdpBrowserProvider } from "./browser/CdpBrowserProvider.js";
|
||||
import { HopperProvider } from "./hopper/HopperProvider.js";
|
||||
import { silentLogger } from "./logger.js";
|
||||
import { parseConfig } from "./config.js";
|
||||
@@ -35,31 +36,8 @@ describe("host platform is injected, not read from the ambient process", () => {
|
||||
);
|
||||
});
|
||||
|
||||
describe("configuration is read from an injected environment", () => {
|
||||
it("lets the supplied environment decide whether the operation is available", async () => {
|
||||
// The error projection deliberately redacts specifics, so the meaningful
|
||||
// signal is the outcome: the same helper fails or succeeds purely as a
|
||||
// function of the environment it was handed.
|
||||
const disabled = await browserContext("inspect_web_page", {});
|
||||
expect(disabled.ok).toBe(false);
|
||||
|
||||
const enabled = await browserContext("inspect_web_page", {
|
||||
REA_BROWSER_OBSERVE_ENABLED: "true",
|
||||
REA_BROWSER_CDP_ENDPOINTS_JSON: '["http://127.0.0.1:9222"]',
|
||||
REA_BROWSER_ALLOWED_ORIGINS_JSON: '["https://app.example.test"]',
|
||||
});
|
||||
expect(enabled.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("reports a configuration error from the supplied environment", async () => {
|
||||
const invalid = await browserContext("inspect_web_page", {
|
||||
REA_BROWSER_ALLOWED_ORIGINS: "https://example.test",
|
||||
REA_BROWSER_MAX_BYTES: "not-a-number",
|
||||
});
|
||||
expect(invalid.ok).toBe(false);
|
||||
if (invalid.ok) return;
|
||||
// Projected through the shared analysis-error contract, like every other
|
||||
// CLI failure path.
|
||||
expect(JSON.stringify(invalid.error)).toContain("code");
|
||||
describe("browser CLI provider setup", () => {
|
||||
it("does not require permission policy configuration", () => {
|
||||
expect(browserContext().provider).toBeInstanceOf(CdpBrowserProvider);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user