fusion-link
Local-first connection daemon for the Fusion ecosystem. It is the device-side half of the fusion-mlx.cn cloud console: an always-on daemon on the user's Mac that maintains an outbound-only WSS connection to the cloud broker, reports device health, relays cloud-initiated tasks to the local fusion-gateway, and streams progress back to the browser.
One sentence: fusion-link is the "online presence" and "reachability" of a local Fusion system on fusion-mlx.cn.
- PRD:
architecture/fusion-link-prd-1125.md(monorepo root) - M1 MVP scope: FR-1 / FR-2 / FR-3 / FR-4 / FR-6
- Cloud broker: separate binary (
cmd/fusion-broker) in thefusion-opsrepo (PRD §11.1)
Architecture
[browser] --HTTPS--> [fusion-site / VPS]
| broker (VPS, 127.0.0.1 only, nginx never exposes it)
^ WSS (device-initiated, token + device fingerprint)
[fusion-link daemon (this repo, local Mac, fusion-sv managed)]
| loopback HTTP only
[fusion-gateway :11432 -> mlx/rag/artifacts/office (all local)]
Zero inbound exposure: the daemon only dials out. Tasks execute locally; only summaries, progress and optional artifact previews leave the machine (full-text files never do, by default).
WSS protocol (PRD §7)
Envelope: {v: 1, type, ts, device_id, seq, payload}, JSON only, seq + ack for reliable ordered delivery.
| type | direction | meaning |
|---|---|---|
hello / hello_ack |
up | registration: credential, version, capabilities |
heartbeat |
up | 30s heartbeat + local service health snapshot |
task.dispatch |
down | task instruction (id, type, params, TTL) |
task.event |
up | state machine events: pending / running / awaiting_local_confirm / succeeded / failed / cancelled |
task.result |
up | result summary + artifact references |
config.update |
down | policy/quota changes |
ack |
both | delivery acknowledgement up to ack_seq |
error |
both | E_AUTH / E_QUOTA / E_OFFLINE / E_UNSUPPORTED / E_LOCAL_FAIL |
All uplink messages are journaled in a persistent outbox (~/.fusion-link/outbox.json) and replayed until the broker acks them — events survive disconnects and crashes (FR-6). Because the current broker does not ack heartbeats or task events, heartbeat entries are cleared on hello_ack and the journal is capped at 500 entries (oldest dropped first). Reconnect uses exponential backoff with jitter (1s base, 60s cap).
Install
Homebrew (macOS / Linux):
brew install dahai80/tap/fusion-link
pip (ships the compiled binary as a Python wheel):
pip install fusion-link
From source: requires Rust 1.85+ (edition 2024).
cargo build --release
Prebuilt binaries (.tar.gz + sha256) for aarch64/x86_64-apple-darwin and x86_64-unknown-linux-musl are attached to each GitHub release.
Build & test
cargo build --release
cargo test # unit + integration (mock broker & gateway)
cargo clippy --all-targets -- -D warnings
cargo fmt --all --check
Usage
# 1. Bind device (one-time code from the fusion-mlx.cn console)
fusion-link bind <code>
# 2. Check state
fusion-link status
# 3. Run the daemon (foreground; start.sh manages pidfile + logs)
./start.sh start
./start.sh status
./start.sh log
./start.sh stop
Default task route: shell.chat -> POST http://127.0.0.1:11432/api/v1/shell/chat/completions. Unsupported task types are rejected with E_UNSUPPORTED and a reason (FR-3).
Configuration
~/.fusion-link/config.toml (all keys optional; file is authoritative when present). Env overrides: FUSION_LINK_BROKER_URL, FUSION_LINK_BIND_URL, FUSION_LINK_GATEWAY_URL, FUSION_LINK_GATEWAY_TOKEN, FUSION_LINK_STATE_DIR, FUSION_LINK_HEARTBEAT_SECS.
| key | default |
|---|---|
broker_url |
wss://fusion-mlx.cn/link/ws |
bind_url |
https://fusion-mlx.cn/api/link/bind |
gateway_url |
http://127.0.0.1:11432 |
heartbeat_secs |
15 (broker read deadline is 30s; stay under it) |
state_dir |
~/.fusion-link |
task_routes |
shell.chat route |
probes |
mlx :11434, gateway :11432, rag :11436, artifacts :11451, office :11485, office-api :11492 |
Health snapshots carry service name + boolean status only (NFR-2); heartbeat stays under 1KB (NFR-3).
Credential storage
Device credential (device_id + token + fingerprint) is stored in the macOS login keychain via the security CLI (service name fusion-link). The fingerprint derives from IOPlatformUUID. fusion-link unbind removes the credential and local outbox state.
Supervision
start.sh follows the fusion-supervisor management contract (NFR-6): pidfile at ~/.fusion-link/fusion-link.pid, logs at ~/.fusion-link/fusion-link.log. Once registered, fusion-sv handles start/stop and crash recovery.
Status
M1 MVP (2026-11): FR-1/2/3/4/6 implemented daemon-side. Broker (fusion-ops repo) and console pages are separate deliverables; the default broker_url is a placeholder until the broker endpoint goes live. M2 scope (FR-5/7/8/11/12) tracked in the PRD milestones.
License
Apache-2.0
Metadata
Release files for fusion-link 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fusion_link-0.1.2-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details for fusion_link-0.1.2-py3-none-musllinux_1_2_x86_64.whl |
| fusion_link-0.1.2-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for fusion_link-0.1.2-py3-none-macosx_11_0_arm64.whl |
| fusion_link-0.1.2-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details for fusion_link-0.1.2-py3-none-macosx_10_12_x86_64.whl |
Total release size: 9.5 MB
Release files / fusion_link-0.1.2-py3-none-musllinux_1_2_x86_64.whl
| Download URL | fusion_link-0.1.2-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
767ba2d67f2ca31d7a53ef7f97aa8d06585b01bbc692ab5c0e052e5ff945fc84
|
|
BLAKE2b-256 checksum How to use checksums |
8a402ad593dd5fc5e35953342a9c0c4154926f424bd52f14ef8abb8553192d3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logRelease files / fusion_link-0.1.2-py3-none-macosx_11_0_arm64.whl
| Download URL | fusion_link-0.1.2-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
26a10608c74197fabbc79664e7919ca5ae74cc789fd88c25c9e229661be1b285
|
|
BLAKE2b-256 checksum How to use checksums |
e963ce3b5ed40edd500373d24666b03df4dd12fc9141a3ad417e57daf2b0d96e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logRelease files / fusion_link-0.1.2-py3-none-macosx_10_12_x86_64.whl
| Download URL | fusion_link-0.1.2-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
cda6b8318d1064a21088073e1a7ab4768f2848c9817a6b4e90960b3dadca3e58
|
|
BLAKE2b-256 checksum How to use checksums |
5417b9f0dc4fa31b54ca264a42ddd4a646a123e83c108b5456c07d9ffef90f92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logSecurity for fusion-link 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 3 files in this release have been uploaded with provenance metadata.
Attestation for fusion_link-0.1.2-py3-none-musllinux_1_2_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.