Bundle Pluginsource linkedVerified

Diffsv2026.7.1

OpenClaw read-only diff viewer plugin and file renderer for agents.

@openclaw/diffs·runtime diffs·by @openclaw
openclaw bundles install clawhub:@openclaw/diffs
Latest release: v2026.7.1Download zip

Compatibility

Built With Open Claw Version
2026.7.1
Min Gateway Version
>=2026.4.30
Plugin Api Range
>=2026.7.1
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The plugin's stated purpose is read-only diff viewing and PNG/PDF rendering; the artifacts implement a single diffs tool that accepts provided before/after text or patches and returns viewer/file outputs.
Instruction Scope
It bundles a companion skill and prepends tool-use guidance at prompt build time, but the guidance is disclosed and limited to using the diffs, canvas, and message tools for presenting rendered diffs.
Install Mechanism
The package is an official trusted @openclaw plugin with source-linked metadata, no install scripts, no MCP servers, and a normal OpenClaw plugin manifest.
Credentials
The plugin uses temporary filesystem storage, a local HTTP route, and Playwright/Chromium for rendering, which are proportionate to generating viewer URLs and PNG/PDF artifacts.
Persistence & Privilege
Diff artifacts are stored under the OpenClaw temp directory with tokenized access and TTL limits up to 21600 seconds; remote viewer access is disabled by default and there is no credential or profile-store access.
Scan Findings in Context
[suspicious.obfuscated_code] expected: The flagged viewer-runtime.js is a large bundled/minified browser asset containing diff rendering and syntax-highlighting data; this matches the plugin's UI purpose and is not supported by other malicious signals.
[SkillSpector clean] expected: SkillSpector reported no issues, consistent with the narrow companion skill text.
[VirusTotal clean] expected: VirusTotal reported no malicious or suspicious engine detections; this is supporting telemetry, not the basis for the verdict by itself.
Assessment
Install if you want agents to generate shareable diff viewers or PNG/PDF diff files. Be aware that diff contents are temporarily written to the local temp directory and may be reachable by anyone who has the tokenized viewer URL during its TTL; keep remote viewer access disabled unless you intentionally need shareable links.
!
dist/assets/viewer-runtime.js:1
Potential obfuscated payload detected.
About static analysis
These patterns were detected by automated regex scanning. They may be normal for skills that integrate with external APIs. Check the VirusTotal and OpenClaw results above for context-aware analysis.

Verification

Tier
source linked
Scope
artifact only
Summary
Validated package structure and linked the release to source metadata.
Commit
2d2ddc43d0dc
Tag
refs/tags/v2026.7.1
Provenance
No
Scan status
clean

Tags

alpha
2026.5.19-alpha.1
beta
2026.7.2-beta.3
latest
2026.7.1

@openclaw/diffs

Read-only diff viewer plugin for OpenClaw agents.

Install

openclaw plugins install @openclaw/diffs

Restart the Gateway after installing or updating the plugin.

It gives agents one tool, diffs, that can:

  • render a gateway-hosted diff viewer for canvas use
  • render the same diff to a file (PNG or PDF)
  • accept either arbitrary before and after text or a unified patch

What Agents Get

The tool can return:

  • details.changed: false when before/after inputs are identical and no artifact was rendered; true for rendered results
  • details.viewerUrl: a gateway URL that can be opened in the canvas
  • details.filePath: a local rendered artifact path when file rendering is requested
  • details.fileFormat: the rendered file format (png or pdf)
  • details.artifactId and details.expiresAt: artifact identity and TTL metadata
  • details.context: available routing metadata such as agentId, sessionId, messageChannel, and agentAccountId

When the plugin is enabled, it also ships a companion skill from skills/ and prepends stable tool-usage guidance into system-prompt space via before_prompt_build. The hook uses prependSystemContext, so the guidance stays out of user-prompt space while still being available every turn.

This means an agent can:

  • call diffs with mode=view, then pass details.viewerUrl to canvas present
  • call diffs with mode=file, then send the file through the normal message tool using path or filePath
  • call diffs with mode=both when it wants both outputs

Tool Inputs

Before and after:

{
  "before": "# Hello\n\nOne",
  "after": "# Hello\n\nTwo",
  "path": "docs/example.md",
  "mode": "view"
}

Patch:

{
  "patch": "diff --git a/src/example.ts b/src/example.ts\n--- a/src/example.ts\n+++ b/src/example.ts\n@@ -1 +1 @@\n-const x = 1;\n+const x = 2;\n",
  "mode": "both"
}

Useful options:

  • mode: view, file, or both Deprecated alias: image behaves like file and is still accepted for backward compatibility.
  • layout: unified or split
  • theme: light or dark (default: dark)
  • fileFormat: png or pdf (default: png)
  • fileQuality: standard, hq, or print
  • fileScale: device scale override (1-4)
  • fileMaxWidth: max width override in CSS pixels (640-2400)
  • expandUnchanged: expand unchanged sections (per-call option only, not a plugin default key)
  • path: display name for before and after input
  • lang: language hint for before/after input; unknown values fall back to plain text
  • Default syntax highlighting covers common source, config, and documentation languages. Install diffs-language-pack for the extended language catalog.
  • title: explicit viewer title
  • ttlSeconds: artifact lifetime for viewer and standalone file outputs
  • baseUrl: override the gateway base URL used in the returned viewer link (origin or origin+base path only; no query/hash)
  • viewerBaseUrl plugin config: persistent fallback used when a tool call omits baseUrl

Legacy input aliases still accepted for backward compatibility:

  • format -> fileFormat
  • imageFormat -> fileFormat
  • imageQuality -> fileQuality
  • imageScale -> fileScale
  • imageMaxWidth -> fileMaxWidth

Input safety limits:

  • before and after: max 512 KiB each
  • patch: max 2 MiB
  • patch rendering cap: max 128 files / 120,000 lines

Plugin Defaults

Set plugin-wide defaults in ~/.openclaw/openclaw.json:

{
  plugins: {
    entries: {
      diffs: {
        enabled: true,
        config: {
          defaults: {
            fontFamily: "Fira Code",
            fontSize: 15,
            lineSpacing: 1.6,
            layout: "unified",
            showLineNumbers: true,
            diffIndicators: "bars",
            wordWrap: true,
            background: true,
            theme: "dark",
            fileFormat: "png",
            fileQuality: "standard",
            fileScale: 2,
            fileMaxWidth: 960,
            mode: "both",
            ttlSeconds: 21600,
          },
        },
      },
    },
  },
}

Explicit tool parameters still win over these defaults.

Docs

Package

  • Plugin id: diffs
  • Package: @openclaw/diffs
  • Minimum OpenClaw host: 2026.4.30

Security options:

  • security.allowRemoteViewer (default false): allows non-loopback access to /plugins/diffs/view/... token URLs
  • viewerBaseUrl (optional): persistent viewer-link origin/path fallback for shareable URLs
  • defaults.ttlSeconds (default 1800, max 21600): default artifact lifetime for viewer and standalone file outputs

Example:

{
  plugins: {
    entries: {
      diffs: {
        enabled: true,
        config: {
          viewerBaseUrl: "https://gateway.example.com/openclaw",
        },
      },
    },
  },
}

Example Agent Prompts

Open in canvas:

Use the `diffs` tool in `view` mode for this before and after content, then open the returned viewer URL in the canvas.

Path: docs/example.md

Before:
# Hello

This is version one.

After:
# Hello

This is version two.

Render a file (PNG or PDF):

Use the `diffs` tool in `file` mode for this before and after input. After it returns `details.filePath`, use the `message` tool with `path` or `filePath` to send me the rendered diff file.

Path: README.md

Before:
OpenClaw supports plugins.

After:
OpenClaw supports plugins and hosted diff views.

Do both:

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.

Path: src/demo.ts

Before:
const status = "old";

After:
const status = "new";

Patch input:

Use the `diffs` tool with this unified patch in `view` mode. After it returns the viewer URL, present it in the canvas.

diff --git a/src/example.ts b/src/example.ts
--- a/src/example.ts
+++ b/src/example.ts
@@ -1,3 +1,3 @@
 export function add(a: number, b: number) {
-  return a + b;
+  return a + b + 1;
 }

Notes

  • Multi-file patches start with a changed-files summary card: totals, per-file +N/-N stats, change badges, and anchor links.
  • Rendered PNG/PDF files keep the per-file header counts but omit the interactive view toggles.
  • The viewer is hosted locally through the gateway under /plugins/diffs/....
  • Artifacts are ephemeral and stored in the plugin temp subfolder ($TMPDIR/openclaw-diffs).
  • Default viewer URLs use loopback (127.0.0.1) unless you set plugin viewerBaseUrl, pass baseUrl, or use gateway.bind=custom + gateway.customBindHost.
  • 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.
  • 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.
  • Remote viewer misses are throttled to reduce token-guess abuse.
  • PNG or PDF rendering requires a Chromium-compatible browser. Set browser.executablePath if auto-detection is not enough.
  • If your delivery channel compresses images heavily (for example Telegram or WhatsApp), prefer fileFormat: "pdf" to preserve readability.
  • N unmodified lines rows may not always include expand controls for patch input, because many patch hunks do not carry full expandable context data.
  • Diff rendering is powered by Diffs.