Files
rea/scripts/verify-package-unknown-provider.mjs
T
morluto 48ff37f6ea fix(verifiers): consolidate shared helper ownership
Use JSON.parse directly in package verification and retain one parsed Cursor recovery snapshot. Route native command source loading through the shared transform-service owner so completed command cleanup leaves no transform child.

Preserve JSONC validation and caller inputs. Cover the actual public source-loading lifecycle with an authored command and verified process lineage.
2026-10-24 22:28:39 +08:00

18 lines
714 B
JavaScript

/** Verify that an unknown --provider is rejected by the packaged CLI. */
export async function verifyUnknownProvider({ commands, cli, environment }) {
const unknownProviderExecution = await commands.runWithStatus(
cli,
["analyze", process.execPath, "--provider", "missing-provider", "--json"],
environment,
);
const unknownProvider = JSON.parse(unknownProviderExecution.stdout);
if (
unknownProviderExecution.status !== 1 ||
unknownProvider.details?.selection_reason !== "unknown_provider" ||
unknownProvider.details?.requested_provider_id !== "missing-provider"
)
throw new Error(
`packaged CLI provider selection failed: ${JSON.stringify(unknownProvider)}`,
);
}