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:
@@ -180,19 +180,9 @@ const registerInspectionCommand = (cli: CliInstance, logger: Logger): void => {
|
||||
.enum(["fail", "record-and-continue"])
|
||||
.default("fail")
|
||||
.describe("Behavior when declared artifact integrity does not match"),
|
||||
integrityContinueApproved: z
|
||||
.boolean()
|
||||
.default(false)
|
||||
.describe("Approve continuing after recorded integrity mismatches"),
|
||||
nativeMountApproved: z
|
||||
.boolean()
|
||||
.default(false)
|
||||
.describe("Approve read-only native mounting when required"),
|
||||
}),
|
||||
alias: {
|
||||
integrityPolicy: "integrity-policy",
|
||||
integrityContinueApproved: "integrity-continue-approved",
|
||||
nativeMountApproved: "native-mount-approved",
|
||||
},
|
||||
run: ({ args, options }) =>
|
||||
logCliCommand(logger, "inspect-artifact", () =>
|
||||
@@ -201,8 +191,6 @@ const registerInspectionCommand = (cli: CliInstance, logger: Logger): void => {
|
||||
"inspect_artifact",
|
||||
{
|
||||
integrity_policy: options.integrityPolicy,
|
||||
integrity_continue_approved: options.integrityContinueApproved,
|
||||
native_mount_approved: options.nativeMountApproved,
|
||||
},
|
||||
logger,
|
||||
),
|
||||
|
||||
@@ -6,7 +6,6 @@ import { importManagedReconstructionEvidence } from "../application/ManagedRecon
|
||||
import { planManagedRuntimeCorrelationEvidence } from "../application/ManagedRuntimeCorrelationService.js";
|
||||
import { runProviderAnalysis } from "../application/DirectAnalysis.js";
|
||||
import { parseConfig } from "../config.js";
|
||||
import { loadConfiguredPermissionAuthority } from "../application/PermissionConfiguration.js";
|
||||
import { parseCliJsonInput } from "../cliJsonInput.js";
|
||||
import { projectAnalysisError } from "../domain/errors.js";
|
||||
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
||||
@@ -171,7 +170,7 @@ const registerPlanManagedRuntimeCorrelation = (
|
||||
): void => {
|
||||
cli.command(CLI_COMMANDS.planManagedRuntimeCorrelation, {
|
||||
description:
|
||||
"Plan a separately authorized managed runtime-correlation experiment without executing target code",
|
||||
"Plan a managed runtime-correlation request without probing or executing a runtime",
|
||||
args: z.object({
|
||||
inputJson: z
|
||||
.string()
|
||||
@@ -186,13 +185,8 @@ const registerPlanManagedRuntimeCorrelation = (
|
||||
if (!input.ok) return input.error;
|
||||
const config = parseConfig(environment);
|
||||
if (!config.ok) return projectAnalysisError(config.error);
|
||||
const authority = await loadConfiguredPermissionAuthority(config.value);
|
||||
if (!authority.ok) return projectAnalysisError(authority.error);
|
||||
const result = await planManagedRuntimeCorrelationEvidence(
|
||||
{
|
||||
policy: () => config.value.managedRuntimePolicy,
|
||||
authority: authority.value,
|
||||
},
|
||||
{ configuration: () => config.value.managedRuntimeConfiguration },
|
||||
input.value,
|
||||
);
|
||||
return result.ok ? result.value : projectAnalysisError(result.error);
|
||||
|
||||
@@ -29,37 +29,21 @@ export const registerUtilityCommands = (
|
||||
] as const) {
|
||||
cli.command(command, {
|
||||
description:
|
||||
"Observe or run an approved scenario in one exact native application window",
|
||||
"Observe or run a scenario in one exact native application window",
|
||||
args: z.object({
|
||||
path: z.string().describe("Local native executable or app path"),
|
||||
}),
|
||||
options: z.object({
|
||||
pid: z
|
||||
.number()
|
||||
.int()
|
||||
.positive()
|
||||
.describe("Approved existing application PID"),
|
||||
pid: z.number().int().positive().describe("Existing application PID"),
|
||||
windowId: z
|
||||
.number()
|
||||
.int()
|
||||
.positive()
|
||||
.describe("Exact selected application window ID"),
|
||||
observationApproved: z
|
||||
.boolean()
|
||||
.default(false)
|
||||
.describe("Approve passive observation of this PID/window"),
|
||||
actionsApproved: z
|
||||
.boolean()
|
||||
.default(false)
|
||||
.describe("Independently approve scenario actions"),
|
||||
restore: z
|
||||
.enum(["leave-as-is"])
|
||||
.optional()
|
||||
.describe("Explicit choice to leave application state as-is"),
|
||||
steps: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe("JSON array of approved declarative AX actions or waits"),
|
||||
.describe("JSON array of declarative AX actions or waits"),
|
||||
screenshot: z
|
||||
.boolean()
|
||||
.default(true)
|
||||
@@ -71,15 +55,13 @@ export const registerUtilityCommands = (
|
||||
maxNodes: z
|
||||
.number()
|
||||
.int()
|
||||
.min(1)
|
||||
.max(2000)
|
||||
.positive()
|
||||
.safe()
|
||||
.default(500)
|
||||
.describe("Maximum accessibility nodes per capture"),
|
||||
}),
|
||||
alias: {
|
||||
windowId: "window-id",
|
||||
observationApproved: "observation-approved",
|
||||
actionsApproved: "actions-approved",
|
||||
maxNodes: "max-nodes",
|
||||
},
|
||||
run: ({ args, options }) =>
|
||||
@@ -90,16 +72,11 @@ export const registerUtilityCommands = (
|
||||
{
|
||||
pid: options.pid,
|
||||
window_id: options.windowId,
|
||||
observation_approved: options.observationApproved,
|
||||
screenshot: options.screenshot,
|
||||
accessibility: options.accessibility,
|
||||
max_nodes: options.maxNodes,
|
||||
...(operation === "capture_native_ui_scenario"
|
||||
? {
|
||||
actions_approved: options.actionsApproved,
|
||||
...(options.restore === undefined
|
||||
? {}
|
||||
: { restore: options.restore }),
|
||||
steps:
|
||||
options.steps === undefined
|
||||
? []
|
||||
|
||||
Reference in New Issue
Block a user