mlclaw 0.3.8 → 0.4.0

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.
@@ -162,6 +162,25 @@ Use local gateway mode when the user wants the gateway on their machine:
162
162
  npx mlclaw@latest bootstrap --gateway local --name mlclaw
163
163
  ```
164
164
 
165
+ After the first setup, `mlclaw bootstrap` and `mlclaw configure` automatically
166
+ select the only local deployment. Use the same command to reconfigure or resume
167
+ it. If local configuration is missing, interactive bootstrap can recover a
168
+ validated deployment marker from an owned Storage Bucket; credentials and
169
+ machine-specific container bindings must be supplied again.
170
+
171
+ Tailnet access is explicit:
172
+
173
+ ```bash
174
+ npx mlclaw@latest bootstrap --gateway local --tailscale=direct
175
+ npx mlclaw@latest bootstrap --gateway local --tailscale=serve
176
+ npx mlclaw@latest bootstrap --gateway local --tailscale=off
177
+ ```
178
+
179
+ Direct mode binds loopback and the exact Tailscale IPv4 address. Serve mode
180
+ keeps the gateway on loopback and creates one HTTPS Serve mapping. A Serve
181
+ administrator approval prompt is resumable: approve the printed URL, then run
182
+ bootstrap again.
183
+
165
184
  If the user has multiple Docker engines, pin the intended context:
166
185
 
167
186
  ```bash
@@ -185,7 +204,7 @@ Default/recommended:
185
204
  ```bash
186
205
  npx mlclaw@latest bootstrap \
187
206
  --name mlclaw \
188
- --model huggingface/google/gemma-4-26B-A4B-it:deepinfra
207
+ --model huggingface/zai-org/GLM-5.2:fireworks-ai
189
208
  ```
190
209
 
191
210
  Known useful router-compatible choices:
package/Dockerfile CHANGED
@@ -2,7 +2,7 @@ ARG OPENCLAW_VERSION=2026.7.1
2
2
  ARG OPENCLAW_BASE_IMAGE=ghcr.io/openclaw/openclaw:${OPENCLAW_VERSION}
3
3
  ARG BROKERKIT_PLUGIN_VERSION=0.2.1
4
4
  ARG BROKERKIT_VERSION=hf-broker/v0.1.0
5
- ARG MLCLAW_RUNTIME_IMAGE=ghcr.io/osolmaz/mlclaw:0.3.8-openclaw-2026.7.1
5
+ ARG MLCLAW_RUNTIME_IMAGE=ghcr.io/osolmaz/mlclaw:0.4.0-openclaw-2026.7.1
6
6
 
7
7
  FROM golang:1.26.5-bookworm AS hf-broker-build
8
8
  ARG BROKERKIT_VERSION
package/README.md CHANGED
@@ -62,10 +62,9 @@ npx mlclaw@latest bootstrap --name mlclaw
62
62
 
63
63
  This creates:
64
64
 
65
- - a private Storage Bucket for OpenClaw state;
66
- - a private Docker Space for the browser gateway;
67
- - no explicit Space hardware request; Hugging Face uses the default free CPU
68
- hardware unless you pass `--hardware`;
65
+ - a private Docker Space for the browser gateway when the account can host it;
66
+ - a private Storage Bucket for OpenClaw state after the Space is accepted;
67
+ - no explicit Space hardware request unless you pass `--hardware`;
69
68
  - a Docker Space that starts from the prebuilt `ghcr.io/osolmaz/mlclaw` image;
70
69
  - Hugging Face OAuth metadata for browser auth, Hugging Face MCP, and Research
71
70
  Agent access in the Space README;
@@ -75,6 +74,19 @@ This creates:
75
74
  Broker process;
76
75
  - a local deployment manifest under `~/.config/mlclaw`.
77
76
 
77
+ Hugging Face currently requires PRO for Docker Space hosting. When creation is
78
+ rejected for that reason, interactive bootstrap checks for a usable local
79
+ Docker or rootless Podman engine and offers to run the same gateway locally.
80
+ No bucket is created before hosted eligibility is known. Bootstrap does not
81
+ install a container engine or change daemon permissions.
82
+
83
+ Automation fails instead of changing execution location implicitly. Opt in to
84
+ the same fallback with:
85
+
86
+ ```bash
87
+ npx mlclaw@latest bootstrap --yes --allow-local-fallback
88
+ ```
89
+
78
90
  Open the Space, sign in with your Hugging Face account, and use the OpenClaw
79
91
  browser gateway directly. The gateway includes a small ML Claw control link
80
92
  for settings, status, credentials, and sign out.
@@ -139,9 +151,60 @@ You can run the gateway locally instead of inside a Space:
139
151
  npx mlclaw@latest bootstrap --gateway local --name mlclaw
140
152
  ```
141
153
 
142
- Local mode uses Docker on your machine and the same private Storage Bucket.
143
- It avoids Hugging Face messaging egress limits because Telegram traffic comes
144
- from your network.
154
+ Local mode uses a ready Docker-compatible engine or rootless Podman on your
155
+ machine and the same private Storage Bucket. Runtime selection is deterministic:
156
+ the existing manifest binding wins, an explicit choice comes next, and
157
+ `auto` probes Docker before Podman. Select one explicitly when needed:
158
+
159
+ ```bash
160
+ npx mlclaw@latest bootstrap --gateway local --container-runtime docker
161
+ npx mlclaw@latest bootstrap --gateway local --container-runtime podman
162
+ ```
163
+
164
+ Bootstrap is also the reconfiguration command. With one known deployment,
165
+ rerun `mlclaw bootstrap` or `mlclaw configure` without `--name`; ML Claw selects
166
+ it, shows only configuration changes, and verifies no-op runs without restarting
167
+ a healthy gateway. If the local cache is missing, interactive bootstrap can
168
+ recover a deployment from its validated marker in an owned Storage Bucket.
169
+ Recovery never invents a replacement encryption key: restore the deployment's
170
+ existing `MLCLAW_CREDENTIAL_KEY` in the environment for the recovery run. ML
171
+ Claw verifies its stored SHA-256 fingerprint before changing the runtime.
172
+
173
+ Cross-host reconciliation uses a generated private Hugging Face model repository
174
+ per deployment as its control lock. Parent-commit compare-and-swap prevents two
175
+ controllers from acquiring the same deployment lease concurrently.
176
+
177
+ The local control plane is published only on loopback. The default URL is
178
+ `http://127.0.0.1:7860`; choose another unprivileged port with `--local-port`
179
+ when needed. On a remote host, use the SSH forwarding command printed by the
180
+ CLI, then open the same loopback URL in your local browser. The CLI prints a
181
+ private fragment-based access link that is exchanged for an HTTP-only browser
182
+ session; rerun `mlclaw gateway status <agent>` to retrieve it.
183
+
184
+ To reach the gateway from other devices on your private tailnet, choose direct
185
+ HTTP over Tailscale or an HTTPS Tailscale Serve mapping:
186
+
187
+ ```bash
188
+ npx mlclaw@latest bootstrap --gateway local --tailscale=direct
189
+ npx mlclaw@latest bootstrap --gateway local --tailscale=serve
190
+ mlclaw gateway start mlclaw --tailscale=off
191
+ ```
192
+
193
+ Interactive bootstrap offers this option when Tailscale is installed, signed
194
+ in, and online; it remains off by default. Direct mode publishes only loopback
195
+ and the node's exact Tailscale IPv4 address. Traffic is HTTP in the browser but
196
+ encrypted between tailnet peers by Tailscale. Serve mode keeps the container on
197
+ loopback and owns one scoped HTTPS handler. ML Claw keeps its own browser
198
+ session authentication in front of OpenClaw in both modes, never enables
199
+ Funnel, and never resets unrelated Serve handlers. Use `--tailscale-port
200
+ <port>` for a non-default port. If Serve needs tailnet administrator approval,
201
+ the loopback gateway remains running; approve the printed URL and rerun
202
+ `mlclaw bootstrap` to resume.
203
+
204
+ Docker Desktop, OrbStack, Colima, Rancher Desktop, and other Docker-compatible
205
+ engines are used through Docker contexts. On Windows, Podman machine
206
+ connections are supported through the Podman CLI. Local mode avoids Hugging
207
+ Face messaging egress limits because Telegram traffic comes from your network.
145
208
 
146
209
  Move between local and Space without losing state:
147
210
 
@@ -163,9 +226,9 @@ mlclaw gateway stop mlclaw
163
226
  mlclaw gateway start mlclaw
164
227
  ```
165
228
 
166
- Local Docker deployments are pinned to the Docker context used at bootstrap
167
- time. Rebind explicitly if you move between Docker Desktop, OrbStack, Colima,
168
- or another Docker engine:
229
+ Local deployments are pinned to their selected engine and connection. Rebind
230
+ Docker deployments explicitly if you move between Docker Desktop, OrbStack,
231
+ Colima, or another Docker engine:
169
232
 
170
233
  ```bash
171
234
  mlclaw gateway rebind mlclaw --docker-context desktop-linux
@@ -9814,15 +9814,16 @@ async function main(argv) {
9814
9814
  return runStageWorker(liveDir);
9815
9815
  }
9816
9816
  const config = resolveSyncConfig();
9817
+ if (argv[0] === "prepare-restore") {
9818
+ await prepareRestore(config);
9819
+ return 0;
9820
+ }
9817
9821
  const hub = makeHub(config);
9818
9822
  if (!hub) {
9819
9823
  logError("OPENCLAW_HF_STATE_BUCKET is not set; state will NOT survive restarts");
9820
9824
  }
9821
9825
  const mode = argv[0];
9822
9826
  switch (mode) {
9823
- case "prepare-restore":
9824
- await prepareRestore(config);
9825
- return 0;
9826
9827
  case "restore": {
9827
9828
  if (!hub) {
9828
9829
  return 0;