mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
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.
18 lines
714 B
JavaScript
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)}`,
|
|
);
|
|
}
|