@openclaw/diffs 2026.7.2-beta.7 → 2026.8.1-beta.3

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.
package/README.md CHANGED
@@ -12,7 +12,7 @@ Restart the Gateway after installing or updating the plugin.
12
12
 
13
13
  It gives agents one tool, `diffs`, that can:
14
14
 
15
- - render a gateway-hosted diff viewer for canvas use
15
+ - render a gateway-hosted diff viewer
16
16
  - render the same diff to a file (PNG or PDF)
17
17
  - accept either arbitrary `before` and `after` text or a unified patch
18
18
 
@@ -21,7 +21,7 @@ It gives agents one tool, `diffs`, that can:
21
21
  The tool can return:
22
22
 
23
23
  - `details.changed`: `false` when before/after inputs are identical and no artifact was rendered; `true` for rendered results
24
- - `details.viewerUrl`: a gateway URL that can be opened in the canvas
24
+ - `details.viewerUrl`: a gateway URL that can be opened in the operator's browser
25
25
  - `details.filePath`: a local rendered artifact path when file rendering is requested
26
26
  - `details.fileFormat`: the rendered file format (`png` or `pdf`)
27
27
  - `details.artifactId` and `details.expiresAt`: artifact identity and TTL metadata
@@ -31,7 +31,7 @@ When the plugin is enabled, it also ships a companion skill from `skills/` and p
31
31
 
32
32
  This means an agent can:
33
33
 
34
- - call `diffs` with `mode=view`, then pass `details.viewerUrl` to `canvas present`
34
+ - call `diffs` with `mode=view`, then return `details.viewerUrl` for the operator to open
35
35
  - call `diffs` with `mode=file`, then send the file through the normal `message` tool using `path` or `filePath`
36
36
  - call `diffs` with `mode=both` when it wants both outputs
37
37
 
@@ -154,10 +154,10 @@ Example:
154
154
 
155
155
  ## Example Agent Prompts
156
156
 
157
- Open in canvas:
157
+ Open in the browser:
158
158
 
159
159
  ```text
160
- Use the `diffs` tool in `view` mode for this before and after content, then open the returned viewer URL in the canvas.
160
+ Use the `diffs` tool in `view` mode for this before and after content, then return the viewer URL.
161
161
 
162
162
  Path: docs/example.md
163
163
 
@@ -189,7 +189,7 @@ OpenClaw supports plugins and hosted diff views.
189
189
  Do both:
190
190
 
191
191
  ```text
192
- Use the `diffs` tool in `both` mode for this diff. Open the viewer in the canvas and then send the rendered file by passing `details.filePath` to the `message` tool.
192
+ Use the `diffs` tool in `both` mode for this diff. Return the viewer URL and then send the rendered file by passing `details.filePath` to the `message` tool.
193
193
 
194
194
  Path: src/demo.ts
195
195
 
@@ -203,7 +203,7 @@ const status = "new";
203
203
  Patch input:
204
204
 
205
205
  ```text
206
- Use the `diffs` tool with this unified patch in `view` mode. After it returns the viewer URL, present it in the canvas.
206
+ Use the `diffs` tool with this unified patch in `view` mode. Return its viewer URL.
207
207
 
208
208
  diff --git a/src/example.ts b/src/example.ts
209
209
  --- a/src/example.ts
@@ -222,7 +222,7 @@ diff --git a/src/example.ts b/src/example.ts
222
222
  - The viewer is hosted locally through the gateway under `/plugins/diffs/...`.
223
223
  - Viewer HTML and metadata are ephemeral SQLite plugin blobs. The URL token is returned to the caller while SQLite stores only its SHA-256 hash.
224
224
  - Rendered PNG/PDF files remain temporary materializations in `$TMPDIR/openclaw-diffs` because delivery APIs require a file path. No JSON metadata sidecars are written or imported.
225
- - Default viewer URLs use loopback (`127.0.0.1`) unless you set plugin `viewerBaseUrl`, pass `baseUrl`, or use `gateway.bind=custom` + `gateway.customBindHost`.
225
+ - Default viewer URLs use `gateway.publicOrigin` when configured, then the existing bind-aware Gateway fallback. Plugin `viewerBaseUrl` and per-call `baseUrl` take precedence.
226
226
  - If `gateway.trustedProxies` includes loopback for a same-host proxy (for example Tailscale Serve), raw `127.0.0.1` viewer requests without forwarded client-IP headers fail closed by design.
227
227
  - In that topology, prefer `mode=file` / `mode=both` for attachments, or intentionally enable remote viewers and set plugin `viewerBaseUrl` (or pass a proxy/public `baseUrl`) when you need a shareable viewer URL.
228
228
  - Remote viewer misses are throttled to reduce token-guess abuse.