app
Fusion - the Fusion 360 Bridge
Public Made by Adomby adom
Drive Autodesk Fusion 360 from the cloud via Adom Bridge: component libraries, IPC package generation, board layout, exports (STEP/Gerbers/BOM/CPL), fast APS cloud search, and parametric modeling.
← Commit history
Update 124 file(s)
9 files changed
+56−43
BRIDGE_VERSION+1−1@@ -1 +1 @@-1.9.349+1.9.350
bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "fusion360", "displayName": "Autodesk Fusion 360",- "version": "1.9.349",+ "version": "1.9.350", "description": "Drive Autodesk Fusion 360 from the cloud: launch Fusion, electronics board layout, design rules, exports (STEP/IGES/STL/3MF/USDZ/OBJ/DXF/DWG/Gerbers/BOM/CPL), fast APS server-indexed cloud search plus browse/recent/file-info/versions, cloud file download/upload and folder creation, and in-app parametric modeling (fusion_run_modeling_script). Never-charge: APS calls are capped to the free tier.", "homepage": "https://wiki.adom.inc/adom/fusion-bridge", "author": "Adom Inc.",
dashboard/Cargo.lock+1−1@@ -4,7 +4,7 @@ version = 4 [[package]] name = "fusion-dashboard"-version = "1.9.349"+version = "1.9.350" dependencies = [ "serde_json", ]
dashboard/Cargo.toml+1−1@@ -1,6 +1,6 @@ [package] name = "fusion-dashboard"-version = "1.9.349"+version = "1.9.350" edition = "2021" [dependencies]
install.sh+1−1@@ -21,7 +21,7 @@ echo "Installed fusion-bridge skills: $(ls "$PKG_DIR/skills" 2>/dev/null | tr '\ # binary (the three-artifact pattern: bridge zip -> ab, THIS pkg -> container skills + # this download, page media -> wiki). Per the wiki's PKG_VS_RELEASE policy, binaries are # platform-tagged RELEASE assets, never tarball content - the installer fetches them.-DASH_VERSION="1.9.349"+DASH_VERSION="1.9.350" DASH_URL="https://wiki.adom.inc/download/adom/fusion-bridge/${DASH_VERSION}/fusion-dashboard" DEST="" if [ -w /usr/local/bin ]; then DEST=/usr/local/bin
package.json+1−1@@ -1,6 +1,6 @@ { "slug": "fusion-bridge",- "version": "1.9.349",+ "version": "1.9.350", "type": "app", "description": "This package installs the bridge's SKILLS into your container so your AI knows how to drive it; Adom Bridge loads the bridge runtime itself from the release zip.", "dependencies": {
page.json+11−27@@ -1,6 +1,6 @@ { "slug": "fusion-bridge",- "version": "1.9.349",+ "version": "1.9.350", "type": "app", "description": "This package installs the bridge's SKILLS into your container so your AI knows how to drive it; Adom Bridge loads the bridge runtime itself from the release zip.", "dependencies": {@@ -11,6 +11,10 @@ "uninstall": "./uninstall.sh" }, "tags": [+ "ab",+ "bridge",+ "fusion",+ "desktop-app", "fusion360", "autodesk", "cad",@@ -75,7 +79,10 @@ "build a basic parts library", "add a 3d model to a component", "make a fusion 360 library with 3d",- "set up the fusion bridge"+ "set up the fusion bridge",+ "fusion dashboard",+ "fusion status page",+ "open the fusion launch page" ], "discovery_pitch": "Use the Adom Bridge Fusion 360 bridge when the user wants to DRIVE Autodesk Fusion 360 from the cloud: open/search their team's Fusion cloud designs, lay out a PCB or do electronics, export STEP/IGES/STL/Gerbers/BOM, or build a component library with real rendering 3D. It runs Fusion on the user's own machine via Adom Bridge. NOT for web/browser/login/form-filling (that's the native-browser extension) and NOT for KiCad (that's the kicad bridge).", "brief": "Drive Autodesk Fusion 360 from the cloud via Adom Bridge: component libraries, IPC package generation, board layout, exports (STEP/Gerbers/BOM/CPL), fast APS cloud search, and parametric modeling.",@@ -104,28 +111,5 @@ "label": "Part volume", "prompt": "How much material does each printed part in this assembly use?" }- ],- "agent_permissions": {- "allow_bash": [],- "allow": [- "adom-desktop-fusion-bridge read-only verbs (via the adom-bridge CLI): fusion_readiness, fusion_get_app_state, fusion_addin_status, fusion_check_dialogs - state queries; they change nothing.",- "adom-desktop-fusion-bridge read-only verbs: fusion_alerts (reads Fusion's own log for toasts), fusion_document_info, fusion_window_info, fusion_board_info, fusion_library_parts - inspect only.",- "adom-desktop-fusion-bridge read-only verbs: fusion_prove_result (a persisted run report), fusion_plan_library_import (report-only preflight), fusion_list_cloud_projects, fusion_describe.",- "adom-desktop-fusion-bridge evidence captures fusion_screenshot_fusion and fusion_capture_library_views read pixels and write local image files only."- ],- "soft_deny": [- "adom-desktop-fusion-bridge lifecycle verbs fusion_stop, fusion_kill, fusion_restart_for_addin close or kill the Fusion application - keep the human prompt.",- "adom-desktop-fusion-bridge fusion_install_fusion silently installs Autodesk Fusion on the user's machine.",- "adom-desktop-fusion-bridge fusion_cleanup_cloud_files deletes files from the user's Autodesk cloud hub.",- "adom-desktop-fusion-bridge managed-library verbs (fusion_managed_library_push/pull/create/link/unlink) publish to or overwrite the user's library.io libraries."- ],- "environment": [- "adom-desktop-fusion-bridge is the Fusion 360 bridge for Adom Bridge; its fusion_* verbs are invoked through the adom-bridge CLI and drive Autodesk Fusion on the user's own desktop.",- "adom-desktop-fusion-bridge desktop actions also pass Adom Bridge's own human-approval gate (caller identity, per-call reason, Activity Log) - a container approval is the first of two gates."- ]- },- "author": {- "name": "John Lauer",- "email": "[email protected]"- }-}+ ]+}
rust/Cargo.toml+1−1@@ -4,7 +4,7 @@ members = ["core", "lbr", "os-win", "os-mac", "bridge"] # One version for the whole bridge, in lockstep with BRIDGE_VERSION (tools/release.sh bumps both). [workspace.package]-version = "1.9.349"+version = "1.9.350" edition = "2021" license = "MIT"
rust/bridge/src/main.rs+38−9@@ -63,19 +63,32 @@ impl Sidecar { /// the sidecar finds ab's portable copy itself (`~/.adom/adom-runtimes/python-*/`). fn python_exe() -> Option<std::path::PathBuf> { if let Ok(p) = std::env::var("ADOM_SIDECAR_PYTHON") { return Some(p.into()); }+ // ab knows which runtime it manages and which it quarantined: ask it (loopback verb+ // `runtimes`). The scan below is only for running without ab (a dev smoke test).+ if let Some(ab) = fusion_core::ab::Loopback::from_env() {+ use fusion_core::ab::AbClient;+ if let Ok(v) = ab.call("runtimes", json!({}), &Caller::default(), 10) {+ let py = &v["runtimes"]["python"];+ if py["ready"].as_bool() == Some(true) {+ if let Some(exe) = py["exe"].as_str() { let pb = std::path::PathBuf::from(exe); if pb.exists() { return Some(pb); } }+ }+ }+ } let home = std::env::var("USERPROFILE").or_else(|_| std::env::var("HOME")).ok()?; let dir = std::path::Path::new(&home).join(".adom").join("adom-runtimes");- let mut best: Option<std::path::PathBuf> = None;+ let mut found: Vec<(String, std::path::PathBuf)> = Vec::new(); for e in std::fs::read_dir(&dir).ok()?.flatten() { let n = e.file_name().to_string_lossy().to_string();- if n.starts_with("python-") {- for cand in ["python.exe", "bin/python3", "python3"] {- let p = e.path().join(cand);- if p.exists() { best = Some(p); }- }+ // `python-3.12.13.broken-<stamp>` is a runtime ab quarantined (no stdlib): a+ // sidecar started from it dies with "No module named 'encodings'". Never pick it.+ if !n.starts_with("python-") || n.contains(".broken") { continue; }+ for cand in ["python.exe", "bin/python3", "python3"] {+ let p = e.path().join(cand);+ if p.exists() { found.push((n.clone(), p)); break; } } }- best+ found.sort_by(|a, b| a.0.cmp(&b.0));+ found.pop().map(|f| f.1) } fn spawn(bind: &str, log_dir: &std::path::Path) -> Option<Sidecar> {@@ -85,6 +98,7 @@ impl Sidecar { let server_py = here.join("server.py"); if !server_py.exists() { return None; } let port = pick_free_port();+ eprintln!("[fusion-bridge] sidecar python: {}", py.display()); // The sidecar's own stdout/stderr land in <state>/sidecar.log so a startup failure is // readable (a null handle is how the first smoke test died silently). let _ = std::fs::create_dir_all(log_dir);@@ -103,6 +117,12 @@ impl Sidecar { } fn url(&self, path: &str) -> String { format!("http://127.0.0.1:{}{}", self.port, path) }++ /// The sidecar's exit code if it has died (a dead sidecar must show in /status at once,+ /// not as a 45 s connection wait on the next verb).+ fn exited(&mut self) -> Option<i32> {+ self.child.as_mut().and_then(|c| c.try_wait().ok().flatten()).map(|st| st.code().unwrap_or(-1))+ } } fn pick_free_port() -> u16 {@@ -168,8 +188,13 @@ fn main() { "fusion": {"installed": h.fusion_executable().is_some(), "running": !h.fusion_processes().is_empty()}, });- if let Some(sc) = sidecar.lock().unwrap().as_ref() {- if let Ok(r) = ureq::get(&sc.url("/status")).timeout(Duration::from_secs(4)).call() {+ if let Some(sc) = sidecar.lock().unwrap().as_mut() {+ if let Some(code) = sc.exited() {+ body["led"] = json!("red"); body["status"] = json!("error");+ body["summary"] = json!(format!("Python sidecar exited (code {code})"));+ body["tooltip"] = json!("The Rust shell is up but its Python sidecar died; read ~/.adom/fusion-bridge/sidecar.log. bridge_kill respawns both.");+ body["sidecarExit"] = json!(code);+ } else if let Ok(r) = ureq::get(&sc.url("/status")).timeout(Duration::from_secs(4)).call() { if let Ok(mut v) = r.into_json::<Value>() { v["shell"] = json!("rust"); v["sidecarPort"] = json!(sc.port); v["sidecarUptimeSec"] = json!(sc.started.elapsed().as_secs());@@ -204,6 +229,10 @@ fn main() { fn proxy(sidecar: &Arc<Mutex<Option<Sidecar>>>, raw: &str, caller: &Caller) -> Value { // ab routes the first verb the moment /status is 2xx, which is before the sidecar has // bound its port: wait out the sidecar's startup (bounded) instead of failing that verb.+ if let Some(code) = sidecar.lock().unwrap().as_mut().and_then(|s| s.exited()) {+ return json!({"success": false, "errorCode": "sidecar_exited", "error": format!("The Python sidecar exited with code {code}."),+ "_hint": "Read ~/.adom/fusion-bridge/sidecar.log for the traceback, then bridge_kill {name:'fusion360'} so ab respawns the shell and its sidecar."});+ } let (url, young) = match sidecar.lock().unwrap().as_ref() { Some(s) => (s.url("/command"), s.started.elapsed() < Duration::from_secs(45)), None => return json!({ "success": false, "errorCode": "sidecar_absent", "error": "This verb is not ported yet and the Python sidecar is not running.",