@popoverai/dotrequirements 0.20.2 → 0.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/browsertest.js +12 -10
- package/package.json +1 -1
|
@@ -4,18 +4,20 @@ import { getProjectInfo, readProjectSettings, } from '../utils/project-settings.
|
|
|
4
4
|
import { loadAllRequirements, getRequirementTree, formatRequirement, } from '../mcp/requirements.js';
|
|
5
5
|
const execFileAsync = promisify(execFile);
|
|
6
6
|
function extractResults(parsed) {
|
|
7
|
-
// Handle wrapper object format from browser-automation
|
|
8
|
-
if (parsed &&
|
|
9
|
-
typeof parsed === 'object' &&
|
|
10
|
-
'structured_output' in parsed &&
|
|
11
|
-
parsed.structured_output?.results) {
|
|
12
|
-
const results = parsed.structured_output.results;
|
|
13
|
-
if (Array.isArray(results))
|
|
14
|
-
return results;
|
|
15
|
-
}
|
|
16
|
-
// Handle plain array format (legacy)
|
|
17
7
|
if (Array.isArray(parsed))
|
|
18
8
|
return parsed;
|
|
9
|
+
if (parsed && typeof parsed === 'object') {
|
|
10
|
+
const obj = parsed;
|
|
11
|
+
// { results: [...] } format
|
|
12
|
+
if (Array.isArray(obj.results))
|
|
13
|
+
return obj.results;
|
|
14
|
+
// { structured_output: { results: [...] } } format
|
|
15
|
+
if (obj.structured_output && typeof obj.structured_output === 'object') {
|
|
16
|
+
const so = obj.structured_output;
|
|
17
|
+
if (Array.isArray(so.results))
|
|
18
|
+
return so.results;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
19
21
|
throw new Error('Unexpected browser-automation output format');
|
|
20
22
|
}
|
|
21
23
|
export async function browserTestCommand(requirementKey, url, options) {
|