Files
callstack__agent-device/scripts/help-conformance-expectations.mjs
Michał Pierzchała ab913c9720 feat: strengthen agent help benchmarks (#1404)
* feat: strengthen agent help benchmarks

* fix: harden help benchmark review findings

* fix: close help benchmark validation bypasses

* fix: make selector scoring quote-insensitive
2026-07-27 10:17:46 +02:00

22 lines
807 B
JavaScript

export function opensAndCloses({ commands }) {
return hasAgentDeviceCommand(commands, 'open') && hasAgentDeviceCommand(commands, 'close');
}
export function usesValidationPrep({ commands }) {
const buildIndex = commands.findIndex(isSupportedBuildCommand);
if (buildIndex < 0) return false;
return commands.slice(buildIndex + 1).some((command) => isPnpmScript(command, 'clean:daemon'));
}
function hasAgentDeviceCommand(commands, command) {
return commands.some((line) => new RegExp(`^agent-device\\s+${command}(?:\\s|$)`).test(line));
}
function isSupportedBuildCommand(command) {
return isPnpmScript(command, 'build') || isPnpmScript(command, 'build:android');
}
function isPnpmScript(command, script) {
return new RegExp(`^pnpm\\s+(?:run\\s+)?${script}(?:\\s|$)`).test(command ?? '');
}