@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 +11 -3
- package/dist/index.js +11 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
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
|
|
94
|
-
|
|
95
|
-
result.screenshot
|
|
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
|
|
70
|
-
|
|
71
|
-
result.screenshot
|
|
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);
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.
|
|
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",
|