@openclaw/diffs 2026.5.9-beta.1 → 2026.5.10-beta.2

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
@@ -106,6 +106,7 @@ Set plugin-wide defaults in `~/.openclaw/openclaw.json`:
106
106
  fileScale: 2,
107
107
  fileMaxWidth: 960,
108
108
  mode: "both",
109
+ ttlSeconds: 21600,
109
110
  },
110
111
  },
111
112
  },
@@ -120,6 +121,7 @@ Security options:
120
121
 
121
122
  - `security.allowRemoteViewer` (default `false`): allows non-loopback access to `/plugins/diffs/view/...` token URLs
122
123
  - `viewerBaseUrl` (optional): persistent viewer-link origin/path fallback for shareable URLs
124
+ - `defaults.ttlSeconds` (default `1800`, max `21600`): default artifact lifetime for viewer and standalone file outputs
123
125
 
124
126
  Example:
125
127
 
package/dist/index.js CHANGED
@@ -107,7 +107,8 @@ const DEFAULT_DIFFS_TOOL_DEFAULTS = {
107
107
  fileQuality: "standard",
108
108
  fileScale: DEFAULT_IMAGE_QUALITY_PROFILES.standard.scale,
109
109
  fileMaxWidth: DEFAULT_IMAGE_QUALITY_PROFILES.standard.maxWidth,
110
- mode: "both"
110
+ mode: "both",
111
+ ttlSeconds: 1800
111
112
  };
112
113
  const DEFAULT_DIFFS_PLUGIN_SECURITY = { allowRemoteViewer: false };
113
114
  const VIEWER_BASE_URL_JSON_SCHEMA = {
@@ -146,7 +147,8 @@ const DiffsPluginJsonSchemaSource = z.strictObject({
146
147
  imageQuality: z.enum(DIFF_IMAGE_QUALITY_PRESETS).optional().describe("Deprecated alias for fileQuality."),
147
148
  imageScale: z.number().min(1).max(4).optional().describe("Deprecated alias for fileScale."),
148
149
  imageMaxWidth: z.number().min(640).max(2400).optional().describe("Deprecated alias for fileMaxWidth."),
149
- mode: z.enum(DIFF_MODES).default(DEFAULT_DIFFS_TOOL_DEFAULTS.mode).optional()
150
+ mode: z.enum(DIFF_MODES).default(DEFAULT_DIFFS_TOOL_DEFAULTS.mode).optional(),
151
+ ttlSeconds: z.number().min(1).max(21600).default(DEFAULT_DIFFS_TOOL_DEFAULTS.ttlSeconds).optional()
150
152
  }).optional(),
151
153
  security: z.strictObject({ allowRemoteViewer: z.boolean().default(DEFAULT_DIFFS_PLUGIN_SECURITY.allowRemoteViewer).optional() }).optional()
152
154
  });
@@ -225,7 +227,8 @@ function resolveDiffsPluginDefaults(config) {
225
227
  fileQuality,
226
228
  fileScale: normalizeFileScale(fileScale, profile.scale),
227
229
  fileMaxWidth: normalizeFileMaxWidth(fileMaxWidth, profile.maxWidth),
228
- mode: normalizeMode$1(defaults.mode)
230
+ mode: normalizeMode$1(defaults.mode),
231
+ ttlSeconds: normalizeTtlSeconds(defaults.ttlSeconds)
229
232
  };
230
233
  }
231
234
  function resolveDiffsPluginSecurity(config) {
@@ -279,6 +282,10 @@ function normalizeFileMaxWidth(fileMaxWidth, fallback) {
279
282
  function normalizeMode$1(mode) {
280
283
  return mode && DIFF_MODES.includes(mode) ? mode : DEFAULT_DIFFS_TOOL_DEFAULTS.mode;
281
284
  }
285
+ function normalizeTtlSeconds(ttlSeconds) {
286
+ if (ttlSeconds === void 0 || !Number.isFinite(ttlSeconds)) return DEFAULT_DIFFS_TOOL_DEFAULTS.ttlSeconds;
287
+ return Math.min(Math.max(Math.floor(ttlSeconds), 1), 21600);
288
+ }
282
289
  function resolveDiffImageRenderOptions(params) {
283
290
  const format = normalizeFileFormat(params.fileFormat ?? params.imageFormat ?? params.format ?? params.defaults.fileFormat);
284
291
  const qualityOverrideProvided = params.fileQuality !== void 0 || params.imageQuality !== void 0;
@@ -1777,7 +1784,7 @@ function createDiffsTool(params) {
1777
1784
  const theme = normalizeTheme(toolParams.theme, params.defaults.theme);
1778
1785
  const layout = normalizeLayout(toolParams.layout, params.defaults.layout);
1779
1786
  const expandUnchanged = toolParams.expandUnchanged === true;
1780
- const ttlMs = normalizeTtlMs(toolParams.ttlSeconds);
1787
+ const ttlMs = normalizeTtlMs(toolParams.ttlSeconds ?? params.defaults.ttlSeconds);
1781
1788
  const image = resolveDiffImageRenderOptions({
1782
1789
  defaults: params.defaults,
1783
1790
  fileFormat: normalizeOutputFormat(toolParams.fileFormat ?? toolParams.imageFormat ?? toolParams.format),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "diffs",
3
3
  "activation": {
4
- "onStartup": false
4
+ "onStartup": true
5
5
  },
6
6
  "name": "Diffs",
7
7
  "description": "Read-only diff viewer and file renderer for agents.",
@@ -75,6 +75,10 @@
75
75
  "label": "Default Output Mode",
76
76
  "help": "Tool default when mode is omitted. Use view for canvas/gateway viewer, file for PNG/PDF, or both."
77
77
  },
78
+ "defaults.ttlSeconds": {
79
+ "label": "Default Artifact TTL",
80
+ "help": "Default lifetime in seconds for diff viewer and file artifacts. Maximum: 21600."
81
+ },
78
82
  "security.allowRemoteViewer": {
79
83
  "label": "Allow Remote Viewer",
80
84
  "help": "Allow non-loopback access to diff viewer URLs when the token path is known."
@@ -190,6 +194,12 @@
190
194
  "type": "string",
191
195
  "enum": ["view", "image", "file", "both"],
192
196
  "default": "both"
197
+ },
198
+ "ttlSeconds": {
199
+ "type": "number",
200
+ "minimum": 1,
201
+ "maximum": 21600,
202
+ "default": 1800
193
203
  }
194
204
  }
195
205
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/diffs",
3
- "version": "2026.5.9-beta.1",
3
+ "version": "2026.5.10-beta.2",
4
4
  "description": "OpenClaw diff viewer plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@
11
11
  "build:viewer": "bun build src/viewer-client.ts --target browser --format esm --minify --outfile assets/viewer-runtime.js"
12
12
  },
13
13
  "dependencies": {
14
- "@pierre/diffs": "1.1.20",
14
+ "@pierre/diffs": "1.1.21",
15
15
  "@pierre/theme": "0.0.29",
16
16
  "playwright-core": "1.59.1",
17
17
  "typebox": "1.1.38"
@@ -30,10 +30,10 @@
30
30
  "minHostVersion": ">=2026.4.30"
31
31
  },
32
32
  "compat": {
33
- "pluginApi": ">=2026.5.9-beta.1"
33
+ "pluginApi": ">=2026.5.10-beta.2"
34
34
  },
35
35
  "build": {
36
- "openclawVersion": "2026.5.9-beta.1",
36
+ "openclawVersion": "2026.5.10-beta.2",
37
37
  "staticAssets": [
38
38
  {
39
39
  "source": "./assets/viewer-runtime.js",
@@ -56,7 +56,7 @@
56
56
  "skills/**"
57
57
  ],
58
58
  "peerDependencies": {
59
- "openclaw": ">=2026.5.9-beta.1"
59
+ "openclaw": ">=2026.5.10-beta.2"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "openclaw": {