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:
@@ -2,12 +2,10 @@ import { Cli } from "incur";
|
||||
import { z } from "zod";
|
||||
|
||||
import { captureBrowserScenario } from "./application/BrowserScenarioCaptureService.js";
|
||||
import { loadConfiguredPermissionAuthority } from "./application/PermissionConfiguration.js";
|
||||
import { PlaywrightBrowserScenarioProvider } from "./browser/PlaywrightBrowserScenarioProvider.js";
|
||||
import { CLI_COMMANDS } from "./cliCommandNames.js";
|
||||
import { parseCliJsonInput } from "./cliJsonInput.js";
|
||||
import { logCliCommand } from "./cliLogging.js";
|
||||
import { parseConfig } from "./config.js";
|
||||
import { AnalysisInputError, projectAnalysisError } from "./domain/errors.js";
|
||||
import { browserScenarioSchema } from "./domain/browserScenario.js";
|
||||
import type { JsonValue } from "./domain/jsonValue.js";
|
||||
@@ -19,11 +17,10 @@ const OPERATION = "capture_browser_scenario";
|
||||
export const registerBrowserScenarioCommands = (
|
||||
cli: ReturnType<typeof Cli.create>,
|
||||
logger: Logger,
|
||||
environment: Readonly<Record<string, string | undefined>> = process.env,
|
||||
): void => {
|
||||
cli.command(CLI_COMMANDS.captureBrowserScenario, {
|
||||
description:
|
||||
"Run one approved, bounded Playwright browser scenario and return Evidence",
|
||||
"Run one bounded Playwright browser scenario and return Evidence",
|
||||
args: z.object({
|
||||
inputJson: z
|
||||
.string()
|
||||
@@ -36,13 +33,8 @@ export const registerBrowserScenarioCommands = (
|
||||
const scenario = browserScenarioSchema.safeParse(input.value);
|
||||
if (!scenario.success)
|
||||
return cliError(new AnalysisInputError(OPERATION));
|
||||
const config = parseConfig(environment);
|
||||
if (!config.ok) return cliError(config.error);
|
||||
const authority = await loadConfiguredPermissionAuthority(config.value);
|
||||
if (!authority.ok) return cliError(authority.error);
|
||||
const result = await captureBrowserScenario(
|
||||
new PlaywrightBrowserScenarioProvider(),
|
||||
authority.value,
|
||||
scenario.data,
|
||||
);
|
||||
return result.ok ? result.value : cliError(result.error);
|
||||
|
||||
Reference in New Issue
Block a user