Skip to content

Commit 393eeb6

Browse files
committed
fi: JS engine
1 parent 3c9e7fe commit 393eeb6

File tree

14 files changed

+567
-693
lines changed

14 files changed

+567
-693
lines changed

terminator-cli/src/main.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,9 @@ fn sync_all_versions() {
416416
// Sync MCP agent
417417
sync_mcp_agent(&workspace_version);
418418

419+
// Sync Browser Extension
420+
sync_browser_extension(&workspace_version);
421+
419422
// Update Cargo.lock
420423
println!("🔒 Updating Cargo.lock...");
421424
if let Err(e) = run_command("cargo", &["check", "--quiet"]) {
@@ -556,6 +559,42 @@ fn sync_mcp_agent(version: &str) {
556559
println!("✅ MCP agent synced");
557560
}
558561

562+
fn sync_browser_extension(version: &str) {
563+
println!("📦 Syncing browser extension to version {version}...");
564+
565+
let ext_dir = Path::new("terminator/browser-extension");
566+
if !ext_dir.exists() {
567+
println!("⚠️ Browser extension directory not found, skipping");
568+
return;
569+
}
570+
571+
let manifest_path = ext_dir.join("manifest.json");
572+
if manifest_path.exists() {
573+
if let Err(e) = update_json_version(&manifest_path.to_string_lossy(), version) {
574+
eprintln!(
575+
"⚠️ Warning: Failed to update {}: {}",
576+
manifest_path.display(),
577+
e
578+
);
579+
} else {
580+
println!("✅ Updated manifest.json to {version}");
581+
}
582+
}
583+
584+
let build_check_path = ext_dir.join("build_check.json");
585+
if build_check_path.exists() {
586+
if let Err(e) = update_json_version(&build_check_path.to_string_lossy(), version) {
587+
eprintln!(
588+
"⚠️ Warning: Failed to update {}: {}",
589+
build_check_path.display(),
590+
e
591+
);
592+
} else {
593+
println!("✅ Updated build_check.json to {version}");
594+
}
595+
}
596+
}
597+
559598
fn update_package_json(path: &str, version: &str) -> Result<(), Box<dyn std::error::Error>> {
560599
let content = fs::read_to_string(path)?;
561600
let mut pkg: serde_json::Value = serde_json::from_str(&content)?;
@@ -582,6 +621,18 @@ fn update_package_json(path: &str, version: &str) -> Result<(), Box<dyn std::err
582621
Ok(())
583622
}
584623

624+
fn update_json_version(path: &str, version: &str) -> Result<(), Box<dyn std::error::Error>> {
625+
let content = fs::read_to_string(path)?;
626+
let mut json_value: serde_json::Value = serde_json::from_str(&content)?;
627+
628+
json_value["version"] = serde_json::Value::String(version.to_string());
629+
630+
let formatted = serde_json::to_string_pretty(&json_value)?;
631+
fs::write(path, formatted + "\n")?;
632+
633+
Ok(())
634+
}
635+
585636
fn show_status() {
586637
println!("📊 Terminator Project Status");
587638
println!("============================");
@@ -592,11 +643,14 @@ fn show_status() {
592643
// Show package versions
593644
let nodejs_version = get_package_version("bindings/nodejs/package.json");
594645
let mcp_version = get_package_version("terminator-mcp-agent/package.json");
646+
let browser_extension_version =
647+
get_package_version("terminator/browser-extension/manifest.json");
595648

596649
println!();
597650
println!("Package versions:");
598651
println!(" Node.js bindings: {nodejs_version}");
599652
println!(" MCP agent: {mcp_version}");
653+
println!(" Browser extension:{browser_extension_version}");
600654

601655
// Git status
602656
println!();

terminator-mcp-agent/minimal_test_workflow.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)