mirror of
https://github.com/morluto/rea
synced 2026-10-25 22:08:11 -04:00
d9660eb032
Join canonical owned command cleanup before releasing package verifier workspaces. Replace raw package command wrappers, the updater supervisor, WASM cleanup composite, and boolean-only retention with explicit capability ownership. Preserve selected environments, npm arguments, no-deadline calls, clean exit status, and distinct aggregate/per-stream output budgets. Exercise actual timeout descendants, cancellation, retained cleanup retry, and workspace admission.
58 lines
1.6 KiB
JavaScript
58 lines
1.6 KiB
JavaScript
import { json } from "./lib/verify-package-core.mjs";
|
|
import {
|
|
expandCapabilitiesOutput,
|
|
expandProviderOutput,
|
|
} from "./lib/mcp-verifier-results.mjs";
|
|
|
|
/** Verify packaged capabilities, providers, and non-Linux search results. */
|
|
export async function verifyPackageCapabilitiesAndSearch({
|
|
commands,
|
|
cli,
|
|
environment,
|
|
}) {
|
|
const capabilities = expandCapabilitiesOutput(
|
|
json(await commands.run(cli, ["capabilities", "--json"], environment)),
|
|
);
|
|
if (!Array.isArray(capabilities.capabilities))
|
|
throw new Error("packaged capabilities CLI failed");
|
|
const providers = expandProviderOutput(
|
|
json(await commands.run(cli, ["providers", "--json"], environment)),
|
|
);
|
|
const candidates = providers.analysis_provider_candidates;
|
|
if (
|
|
!Array.isArray(candidates) ||
|
|
candidates.some(
|
|
(candidate) =>
|
|
typeof candidate?.provider?.id !== "string" ||
|
|
candidate.selected !== false,
|
|
) ||
|
|
providers.analysis_provider_binding !== null ||
|
|
candidates.find(({ provider }) => provider?.id === "hopper")?.target_support
|
|
?.status !== "unknown"
|
|
)
|
|
throw new Error("packaged providers CLI failed");
|
|
if (process.platform !== "linux") {
|
|
const searchResult = json(
|
|
await commands.run(
|
|
cli,
|
|
[
|
|
"search",
|
|
process.execPath,
|
|
"fixture",
|
|
"--provider",
|
|
"hopper",
|
|
"--json",
|
|
],
|
|
environment,
|
|
),
|
|
);
|
|
if (
|
|
searchResult.operation !== "search_strings" ||
|
|
!Array.isArray(searchResult.normalized_result)
|
|
)
|
|
throw new Error(
|
|
`packaged search CLI failed: ${JSON.stringify(searchResult)}`,
|
|
);
|
|
}
|
|
}
|