pi-agent-browser-native 0.8.0 → 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
CHANGED
package/docs/platform-smoke.md
CHANGED
|
@@ -42,7 +42,7 @@ npm run verify -- platform-smoke run --target ubuntu --suite platform-build
|
|
|
42
42
|
|
|
43
43
|
With maintainer approval, local macOS execution can replace localhost SSH. Routine GitHub Actions has no Windows job; the separate Crabbox/Parallels release target remains as documented above. Record alternate native checks separately from Crabbox SSH or Parallels results. The default `release` and `prepublishOnly` commands still select the Crabbox matrix; record alternate suite evidence separately rather than reporting those commands as passed.
|
|
44
44
|
|
|
45
|
-
On macOS, run the unchanged commands returned by `buildPlatformBuildCommand('macos', 'pi-agent-browser-native', 24)` and `buildBrowserDogfoodCommand('macos', '0.38.1', true)` in [`scripts/platform-smoke/targets.mjs`](../scripts/platform-smoke/targets.mjs), serially in a clean private source copy. Use private HOME, npm and Pi settings, and headless browser profiles. No Remote Login or host security change is required.
|
|
45
|
+
On macOS, run the unchanged commands returned by `buildPlatformBuildCommand('macos', 'pi-agent-browser-native', '24.21.0')` and `buildBrowserDogfoodCommand('macos', '0.38.1', true)` in [`scripts/platform-smoke/targets.mjs`](../scripts/platform-smoke/targets.mjs), serially in a clean private source copy. Use private HOME, npm and Pi settings, and headless browser profiles. No Remote Login or host security change is required.
|
|
46
46
|
|
|
47
47
|
Retain the exact source head/tree, package and tool versions, native OS/architecture, generated commands, stdout/stderr, every `PLATFORM_*` exit marker, actual Pi registration output, dogfood JSON and verified screenshot. Check the suite assertions below and clean up only the run's processes and temporary files. These alternatives do not waive Ubuntu or any non-platform release check.
|
|
48
48
|
|
|
@@ -88,7 +88,7 @@ The configured upstream `agent-browser` baseline is imported from [`scripts/agen
|
|
|
88
88
|
|
|
89
89
|
Crabbox does not install project runtime tools. The macOS host, Ubuntu image, and Windows template must already provide:
|
|
90
90
|
|
|
91
|
-
- Node/npm at or above the
|
|
91
|
+
- Node/npm at or above the full Node version declared by `package.json` `engines.node` and used by [`platform-smoke.config.mjs`](../platform-smoke.config.mjs).
|
|
92
92
|
- Git and `tar`.
|
|
93
93
|
- Upstream `agent-browser` matching this wrapper’s capability baseline. The Ubuntu target gets it from [`scripts/platform-smoke/linux-image/Dockerfile`](../scripts/platform-smoke/linux-image/Dockerfile); the Windows template gets it from the shared `pi-extension-windows-template` snapshot named in [`platform-smoke.config.mjs`](../platform-smoke.config.mjs) (currently `crabbox-ready-ab-0.33.0`, a child of the shared `crabbox-ready` base used by other projects' linked clones).
|
|
94
94
|
- Browser/runtime dependencies needed by upstream `agent-browser`.
|
|
@@ -102,7 +102,7 @@ Each required target runs `platform-build` and `browser-dogfood-smoke` on one Cr
|
|
|
102
102
|
|
|
103
103
|
### `platform-build`
|
|
104
104
|
|
|
105
|
-
1. Verify the target Node
|
|
105
|
+
1. Verify the target's full Node version.
|
|
106
106
|
2. Run `npm ci` in the synced checkout.
|
|
107
107
|
3. Run `npm run verify -- platform-target`, a fast target-local gate covering generated docs, TypeScript, package/platform harness tests, and runtime planning. The full unit/fake suite still runs once in the host default gate before the release matrix starts; target-local smoke must not duplicate that full suite on every OS. Browser subprocess behavior is then exercised by the target-local `browser-dogfood-smoke` suite against the real upstream binary.
|
|
108
108
|
4. Run `npm pack`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Platform smoke configuration for pi-agent-browser-native.
|
|
2
2
|
// Crabbox owns the target lease/sync loop; this file is the project source of truth for release-blocking platform coverage.
|
|
3
3
|
|
|
4
|
+
import packageJson from "./package.json" with { type: "json" };
|
|
4
5
|
import { CAPABILITY_BASELINE } from "./scripts/agent-browser-capability-baseline.mjs";
|
|
5
6
|
|
|
6
7
|
const PLATFORM_SMOKE_AGENT_BROWSER_VERSION = CAPABILITY_BASELINE.targetVersion;
|
|
@@ -26,6 +27,6 @@ export default {
|
|
|
26
27
|
// Parent crabbox-ready remains for other projects' linked clones.
|
|
27
28
|
snapshot: "crabbox-ready-ab-0.34.0-d",
|
|
28
29
|
},
|
|
29
|
-
|
|
30
|
+
nodeValidationVersion: packageJson.engines.node.replace(/^>=/, ""),
|
|
30
31
|
agentBrowserVersion: PLATFORM_SMOKE_AGENT_BROWSER_VERSION,
|
|
31
32
|
};
|
|
@@ -234,7 +234,7 @@ export async function runDoctor(config) {
|
|
|
234
234
|
const failures = { count: 0 };
|
|
235
235
|
const packageName = config?.packageName ?? "pi-agent-browser-native";
|
|
236
236
|
const artifactRoot = config?.artifactRoot ?? ".artifacts/platform-smoke";
|
|
237
|
-
const
|
|
237
|
+
const nodeVersion = config?.nodeValidationVersion;
|
|
238
238
|
const agentBrowserVersion = config?.agentBrowserVersion;
|
|
239
239
|
|
|
240
240
|
console.log("\n── Platform smoke config ──");
|
|
@@ -280,9 +280,8 @@ export async function runDoctor(config) {
|
|
|
280
280
|
else ok(`${name}: ${output.split(/\r?\n/)[0]}`);
|
|
281
281
|
}
|
|
282
282
|
const localNode = shell("node --version");
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
else fail(`host Node major ${localNodeMajor || "unknown"} < ${nodeMajor}`, failures);
|
|
283
|
+
if (nodeVersion && localNode && versionAtLeast(localNode, nodeVersion)) ok(`host Node ${localNode} >= ${nodeVersion}`);
|
|
284
|
+
else fail(`host Node ${localNode || "unknown"} < ${nodeVersion ?? "configured minimum"}`, failures);
|
|
286
285
|
checkAgentBrowserVersion(agentBrowserVersion, failures);
|
|
287
286
|
|
|
288
287
|
console.log("\n── Crabbox providers ──");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
param(
|
|
2
2
|
[Parameter(Mandatory=$true)][string]$PackageName,
|
|
3
|
-
[Parameter(Mandatory=$true)][
|
|
3
|
+
[Parameter(Mandatory=$true)][string]$NodeValidationVersion
|
|
4
4
|
)
|
|
5
5
|
|
|
6
6
|
$ErrorActionPreference = "Continue"
|
|
@@ -20,10 +20,9 @@ Write-Output "Starting platform-build in $SourceRoot at $((Get-Date).ToUniversal
|
|
|
20
20
|
Write-Output "PLATFORM_RUN_ROOT=$RunRoot"
|
|
21
21
|
|
|
22
22
|
$NodeVersion = (& node --version 2>$null)
|
|
23
|
-
$NodeMajor = 0
|
|
24
|
-
if ($NodeVersion -match '^v?(\d+)\.') { $NodeMajor = [int]$Matches[1] }
|
|
25
23
|
Write-Output "PLATFORM_NODE_VERSION=$NodeVersion"
|
|
26
|
-
$NodeVersionExit =
|
|
24
|
+
$NodeVersionExit = 1
|
|
25
|
+
try { if ([version]$NodeVersion.TrimStart("v") -ge [version]$NodeValidationVersion) { $NodeVersionExit = 0 } } catch {}
|
|
27
26
|
Write-Output "PLATFORM_NODE_VERSION_EXIT=$NodeVersionExit"
|
|
28
27
|
|
|
29
28
|
& npm ci 2>&1
|
|
@@ -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 },
|