agent-browser 0.8.4 → 0.8.6
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/scripts/sync-version.js
CHANGED
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
* Run this script before building or releasing.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { execSync } from "child_process";
|
|
8
9
|
import { readFileSync, writeFileSync } from "fs";
|
|
9
10
|
import { dirname, join } from "path";
|
|
10
11
|
import { fileURLToPath } from "url";
|
|
11
12
|
|
|
12
13
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
14
|
const rootDir = join(__dirname, "..");
|
|
15
|
+
const cliDir = join(rootDir, "cli");
|
|
14
16
|
|
|
15
17
|
// Read version from package.json (single source of truth)
|
|
16
18
|
const packageJson = JSON.parse(
|
|
@@ -21,17 +23,19 @@ const version = packageJson.version;
|
|
|
21
23
|
console.log(`Syncing version ${version} to all config files...`);
|
|
22
24
|
|
|
23
25
|
// Update Cargo.toml
|
|
24
|
-
const cargoTomlPath = join(
|
|
26
|
+
const cargoTomlPath = join(cliDir, "Cargo.toml");
|
|
25
27
|
let cargoToml = readFileSync(cargoTomlPath, "utf-8");
|
|
26
28
|
const cargoVersionRegex = /^version\s*=\s*"[^"]*"/m;
|
|
27
29
|
const newCargoVersion = `version = "${version}"`;
|
|
28
30
|
|
|
31
|
+
let cargoTomlUpdated = false;
|
|
29
32
|
if (cargoVersionRegex.test(cargoToml)) {
|
|
30
33
|
const oldMatch = cargoToml.match(cargoVersionRegex)?.[0];
|
|
31
34
|
if (oldMatch !== newCargoVersion) {
|
|
32
35
|
cargoToml = cargoToml.replace(cargoVersionRegex, newCargoVersion);
|
|
33
36
|
writeFileSync(cargoTomlPath, cargoToml);
|
|
34
37
|
console.log(` Updated cli/Cargo.toml: ${oldMatch} -> ${newCargoVersion}`);
|
|
38
|
+
cargoTomlUpdated = true;
|
|
35
39
|
} else {
|
|
36
40
|
console.log(` cli/Cargo.toml already up to date`);
|
|
37
41
|
}
|
|
@@ -40,4 +44,26 @@ if (cargoVersionRegex.test(cargoToml)) {
|
|
|
40
44
|
process.exit(1);
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
// Update Cargo.lock to match Cargo.toml
|
|
48
|
+
if (cargoTomlUpdated) {
|
|
49
|
+
try {
|
|
50
|
+
execSync("cargo update -p agent-browser --offline", {
|
|
51
|
+
cwd: cliDir,
|
|
52
|
+
stdio: "pipe",
|
|
53
|
+
});
|
|
54
|
+
console.log(` Updated cli/Cargo.lock`);
|
|
55
|
+
} catch {
|
|
56
|
+
// --offline may fail if package not in cache, try without it
|
|
57
|
+
try {
|
|
58
|
+
execSync("cargo update -p agent-browser", {
|
|
59
|
+
cwd: cliDir,
|
|
60
|
+
stdio: "pipe",
|
|
61
|
+
});
|
|
62
|
+
console.log(` Updated cli/Cargo.lock`);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
console.error(` Warning: Could not update Cargo.lock: ${e.message}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
43
69
|
console.log("Version sync complete.");
|