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.
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import type { ExecutionOptions } from "./AnalysisProvider.js";
|
|
import type { BrowserScenarioCapturePort } from "./BrowserScenarioCapturePort.js";
|
|
import { createBrowserScenarioEvidence } from "./BrowserScenarioEvidence.js";
|
|
import {
|
|
AnalysisCapabilityUnavailableError,
|
|
type AnalysisError,
|
|
} from "../domain/errors.js";
|
|
import type { Evidence } from "../domain/evidence.js";
|
|
import type { BrowserScenario } from "../domain/browserScenario.js";
|
|
import { err, type Result } from "../domain/result.js";
|
|
|
|
const OPERATION = "capture_browser_scenario" as const;
|
|
const PROVIDER_ID = "rea-playwright-browser-scenario";
|
|
|
|
/** Execute one controlled browser scenario using its explicit request scope. */
|
|
export const captureBrowserScenario = async (
|
|
provider: BrowserScenarioCapturePort | undefined,
|
|
scenario: BrowserScenario,
|
|
options: ExecutionOptions = {},
|
|
): Promise<Result<Evidence, AnalysisError>> => {
|
|
if (provider === undefined)
|
|
return err(
|
|
new AnalysisCapabilityUnavailableError(
|
|
PROVIDER_ID,
|
|
OPERATION,
|
|
"browser scenario provider is not configured",
|
|
),
|
|
);
|
|
const captured = await provider.captureScenario(scenario, options);
|
|
return captured.ok
|
|
? {
|
|
ok: true,
|
|
value: createBrowserScenarioEvidence(
|
|
scenario,
|
|
captured.value,
|
|
provider.identity(),
|
|
),
|
|
}
|
|
: captured;
|
|
};
|