@riddledc/openclaw-riddledc 0.3.1 → 0.3.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/dist/index.cjs CHANGED
@@ -90,9 +90,17 @@ async function writeArtifactBinary(workspace, subdir, filename, base64Content) {
90
90
  }
91
91
  async function applySafetySpec(result, opts) {
92
92
  const jobId = result.job_id ?? "unknown";
93
- if (result.screenshot != null && typeof result.screenshot === "string") {
94
- const ref = await writeArtifactBinary(opts.workspace, "screenshots", `${jobId}.png`, result.screenshot);
95
- result.screenshot = { saved: ref.path, sizeBytes: ref.sizeBytes };
93
+ if (result.screenshot != null) {
94
+ let base64Data = null;
95
+ if (typeof result.screenshot === "string") {
96
+ base64Data = result.screenshot;
97
+ } else if (typeof result.screenshot === "object" && result.screenshot.data) {
98
+ base64Data = result.screenshot.data;
99
+ }
100
+ if (base64Data) {
101
+ const ref = await writeArtifactBinary(opts.workspace, "screenshots", `${jobId}.png`, base64Data);
102
+ result.screenshot = { saved: ref.path, sizeBytes: ref.sizeBytes };
103
+ }
96
104
  }
97
105
  if (result.rawPngBase64 != null) {
98
106
  const ref = await writeArtifactBinary(opts.workspace, "screenshots", `${jobId}.png`, result.rawPngBase64);
package/dist/index.js CHANGED
@@ -66,9 +66,17 @@ async function writeArtifactBinary(workspace, subdir, filename, base64Content) {
66
66
  }
67
67
  async function applySafetySpec(result, opts) {
68
68
  const jobId = result.job_id ?? "unknown";
69
- if (result.screenshot != null && typeof result.screenshot === "string") {
70
- const ref = await writeArtifactBinary(opts.workspace, "screenshots", `${jobId}.png`, result.screenshot);
71
- result.screenshot = { saved: ref.path, sizeBytes: ref.sizeBytes };
69
+ if (result.screenshot != null) {
70
+ let base64Data = null;
71
+ if (typeof result.screenshot === "string") {
72
+ base64Data = result.screenshot;
73
+ } else if (typeof result.screenshot === "object" && result.screenshot.data) {
74
+ base64Data = result.screenshot.data;
75
+ }
76
+ if (base64Data) {
77
+ const ref = await writeArtifactBinary(opts.workspace, "screenshots", `${jobId}.png`, base64Data);
78
+ result.screenshot = { saved: ref.path, sizeBytes: ref.sizeBytes };
79
+ }
72
80
  }
73
81
  if (result.rawPngBase64 != null) {
74
82
  const ref = await writeArtifactBinary(opts.workspace, "screenshots", `${jobId}.png`, result.rawPngBase64);
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-riddledc",
3
3
  "name": "Riddle",
4
4
  "description": "Riddle (riddledc.com) hosted browser API tools for OpenClaw agents.",
5
- "version": "0.3.1",
5
+ "version": "0.3.2",
6
6
  "notes": "0.3.1: Screenshots now saved to workspace files instead of inline base64 to prevent context bloat.",
7
7
  "configSchema": {
8
8
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/openclaw-riddledc",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "OpenClaw integration package for RiddleDC (no secrets).",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",