pi-agent-browser-native 0.7.1 → 0.8.1
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/CHANGELOG.md +21 -0
- package/README.md +6 -6
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/diagnostics.js +7 -80
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/final-result.js +4 -4
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/prepare.js +9 -2
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/process-output.js +26 -9
- package/dist/extensions/agent-browser/lib/orchestration/browser-run/session-state.js +30 -3
- package/dist/extensions/agent-browser/lib/playbook.js +1 -1
- package/dist/extensions/agent-browser/lib/runtime.js +50 -46
- package/dist/extensions/agent-browser/lib/session-page-state.js +17 -7
- package/dist/extensions/agent-browser/lib/tool-surface.js +0 -1
- package/dist/extensions/agent-browser/lib/web-search.js +5 -3
- package/docs/ARCHITECTURE.md +4 -4
- package/docs/COMMAND_REFERENCE.md +5 -3
- package/docs/RELEASE.md +3 -3
- package/docs/SUPPORT_MATRIX.md +4 -4
- package/docs/TOOL_CONTRACT.md +6 -4
- package/docs/platform-smoke.md +3 -3
- package/package.json +10 -15
- package/platform-smoke.config.mjs +2 -1
- package/scripts/platform-smoke/doctor.mjs +3 -4
- package/scripts/platform-smoke/platform-build-windows.ps1 +3 -4
- package/scripts/platform-smoke/targets.mjs +10 -8
|
@@ -254,9 +254,13 @@ export function createLeaseWarmupFailureResult(config, targetName, warmupResult,
|
|
|
254
254
|
return { ok: false, suiteDir, assertions };
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
export function
|
|
257
|
+
export function nodeVersionAtLeast(actual, minimum) {
|
|
258
|
+
return /^v?\d+\.\d+\.\d+$/.test(actual) && actual.replace(/^v/, "").localeCompare(minimum, undefined, { numeric: true }) >= 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function buildPlatformBuildCommand(targetName, packageName, nodeValidationVersion) {
|
|
258
262
|
if (platformFor(targetName) === "powershell") {
|
|
259
|
-
return `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\\scripts\\platform-smoke\\platform-build-windows.ps1 -PackageName ${psSingleQuote(packageName)} -
|
|
263
|
+
return `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\\scripts\\platform-smoke\\platform-build-windows.ps1 -PackageName ${psSingleQuote(packageName)} -NodeValidationVersion ${psSingleQuote(nodeValidationVersion)}`;
|
|
260
264
|
}
|
|
261
265
|
|
|
262
266
|
const lines = [];
|
|
@@ -268,10 +272,8 @@ export function buildPlatformBuildCommand(targetName, packageName = "pi-agent-br
|
|
|
268
272
|
lines.push(`mkdir -p "$PACK_DIR" "$PI_PROJECT"`);
|
|
269
273
|
lines.push(`echo "PLATFORM_RUN_ROOT=$RUN_ROOT"`);
|
|
270
274
|
lines.push(`NODE_VERSION=$(node --version)`);
|
|
271
|
-
lines.push(`NODE_MAJOR="${"${NODE_VERSION#v}"}"`);
|
|
272
|
-
lines.push(`NODE_MAJOR="${"${NODE_MAJOR%%.*}"}"`);
|
|
273
275
|
lines.push(`echo "PLATFORM_NODE_VERSION=$NODE_VERSION"`);
|
|
274
|
-
lines.push(`if [
|
|
276
|
+
lines.push(`if node -e 'process.exit(process.versions.node.localeCompare(process.argv[1], undefined, { numeric: true }) < 0 ? 1 : 0)' ${shellQuote(nodeValidationVersion)}; then NODE_VERSION_EXIT=0; else NODE_VERSION_EXIT=1; fi`);
|
|
275
277
|
lines.push(`echo "PLATFORM_NODE_VERSION_EXIT=$NODE_VERSION_EXIT"`);
|
|
276
278
|
lines.push(`npm ci 2>&1`);
|
|
277
279
|
lines.push(`NPM_CI_EXIT=$?`);
|
|
@@ -418,7 +420,7 @@ async function runPlatformBuildSuite(config, targetName, suiteName, leaseSession
|
|
|
418
420
|
const startedAt = Date.now();
|
|
419
421
|
const platform = platformFor(targetName);
|
|
420
422
|
const slug = `${config.packageName}-${targetName}`;
|
|
421
|
-
const command = buildPlatformBuildCommand(targetName, config.packageName, config.
|
|
423
|
+
const command = buildPlatformBuildCommand(targetName, config.packageName, config.nodeValidationVersion);
|
|
422
424
|
mkdirSync(dirname(suiteDir), { recursive: true });
|
|
423
425
|
writeFileSync(resolve(suiteDir, "target.json"), JSON.stringify(targetEvidence(config, targetName, runId, slug), null, 2));
|
|
424
426
|
writeFileSync(resolve(suiteDir, "suite.json"), JSON.stringify({ suiteName, modelCalls: 0 }, null, 2));
|
|
@@ -453,7 +455,7 @@ async function runPlatformBuildSuite(config, targetName, suiteName, leaseSession
|
|
|
453
455
|
|
|
454
456
|
const stdout = result.stdout;
|
|
455
457
|
const listOutput = section(stdout, "PI_LIST_STDOUT");
|
|
456
|
-
const
|
|
458
|
+
const nodeVersion = marker(stdout, "PLATFORM_NODE_VERSION");
|
|
457
459
|
const secretViolations = [
|
|
458
460
|
...scanForSecrets(`${result.stdout}\n${result.stderr}`, secretValues),
|
|
459
461
|
...scanArtifactTextFiles(suiteDir, secretValues).map((finding) => `${finding.file}: ${finding.violation}`),
|
|
@@ -461,7 +463,7 @@ async function runPlatformBuildSuite(config, targetName, suiteName, leaseSession
|
|
|
461
463
|
const checks = [
|
|
462
464
|
{ id: "command-exit-zero", fn: () => result.code === 0, error: `exit ${result.code}` },
|
|
463
465
|
{ id: "platform-marker", fn: () => stdout.includes("PLATFORM_BUILD_OK") },
|
|
464
|
-
{ id: "node-version", fn: () =>
|
|
466
|
+
{ id: "node-version", fn: () => nodeVersionAtLeast(nodeVersion, config.nodeValidationVersion), error: `Node ${nodeVersion || "unknown"} < ${config.nodeValidationVersion}` },
|
|
465
467
|
{ id: "npm-ci", fn: () => /PLATFORM_NPM_CI_EXIT=0/.test(stdout) },
|
|
466
468
|
{ id: "npm-run-verify", fn: () => /PLATFORM_VERIFY_EXIT=0/.test(stdout) },
|
|
467
469
|
{ id: "npm-pack", fn: () => /PLATFORM_NPM_PACK_EXIT=0/.test(stdout) && marker(stdout, "PLATFORM_PACKED_TARBALL").length > 0 },
|