@riddledc/openclaw-riddledc 0.5.0 → 0.5.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/CHECKSUMS.txt CHANGED
@@ -1,4 +1,4 @@
1
- 4af93e0faac60c59ef6ca6ff44a81585a92be10209c6c1097409682af461f4c5 dist/index.cjs
1
+ 7b95ce94da8d78fc473eafbfd9103a4a71f9022345f9fe81c965d9e4096d1f81 dist/index.cjs
2
2
  94ce04f0e2d84bf64dd68f0500dfdd2f951287a3deccec87f197261961927f6f dist/index.d.cts
3
3
  94ce04f0e2d84bf64dd68f0500dfdd2f951287a3deccec87f197261961927f6f dist/index.d.ts
4
- 703b5ed128772d5965a2e35dadecea89d5a9be548d879d9fe2884c62bb6648fa dist/index.js
4
+ 3d661c3fc011ed382fa53058e3315d48f86d0f0663d543f3be22581816ddd906 dist/index.js
package/dist/index.cjs CHANGED
@@ -330,7 +330,7 @@ function register(api) {
330
330
  if (Object.keys(opts).length > 0) payload.options = opts;
331
331
  if (params.include) payload.include = params.include;
332
332
  if (params.harInline) payload.harInline = params.harInline;
333
- const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result"] });
333
+ const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result", "data", "urls", "dataset", "sitemap", "visual_diff"] });
334
334
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
335
335
  }
336
336
  },
@@ -370,7 +370,7 @@ function register(api) {
370
370
  if (Object.keys(opts).length > 0) payload.options = opts;
371
371
  if (params.include) payload.include = params.include;
372
372
  if (params.harInline) payload.harInline = params.harInline;
373
- const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result"] });
373
+ const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result", "data", "urls", "dataset", "sitemap", "visual_diff"] });
374
374
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
375
375
  }
376
376
  },
@@ -491,4 +491,60 @@ function register(api) {
491
491
  },
492
492
  { optional: true }
493
493
  );
494
+ api.registerTool(
495
+ {
496
+ name: "riddle_visual_diff",
497
+ description: "Riddle: visually compare two URLs by screenshotting both and computing a pixel-level diff. Returns change percentage, changed pixel count, and URLs to before/after/diff images. For authenticated comparison, use riddle_script with login steps followed by await visualDiff().",
498
+ parameters: import_typebox.Type.Object({
499
+ url_before: import_typebox.Type.String({ description: "URL to screenshot as the 'before' image" }),
500
+ url_after: import_typebox.Type.String({ description: "URL to screenshot as the 'after' image" }),
501
+ viewport: import_typebox.Type.Optional(import_typebox.Type.Object({
502
+ width: import_typebox.Type.Number({ description: "Viewport width (default: 1280)" }),
503
+ height: import_typebox.Type.Number({ description: "Viewport height (default: 720)" })
504
+ })),
505
+ full_page: import_typebox.Type.Optional(import_typebox.Type.Boolean({ description: "Capture full page (default: true)" })),
506
+ threshold: import_typebox.Type.Optional(import_typebox.Type.Number({ description: "Pixel match threshold 0-1 (default: 0.1)" })),
507
+ selector: import_typebox.Type.Optional(import_typebox.Type.String({ description: "CSS selector to capture instead of full page" })),
508
+ delay_ms: import_typebox.Type.Optional(import_typebox.Type.Number({ description: "Delay after page load before capture (ms)" })),
509
+ cookies_before: import_typebox.Type.Optional(import_typebox.Type.Array(import_typebox.Type.Object({
510
+ name: import_typebox.Type.String(),
511
+ value: import_typebox.Type.String(),
512
+ domain: import_typebox.Type.String(),
513
+ path: import_typebox.Type.Optional(import_typebox.Type.String()),
514
+ secure: import_typebox.Type.Optional(import_typebox.Type.Boolean()),
515
+ httpOnly: import_typebox.Type.Optional(import_typebox.Type.Boolean())
516
+ }), { description: "Cookies for the 'before' URL" })),
517
+ cookies_after: import_typebox.Type.Optional(import_typebox.Type.Array(import_typebox.Type.Object({
518
+ name: import_typebox.Type.String(),
519
+ value: import_typebox.Type.String(),
520
+ domain: import_typebox.Type.String(),
521
+ path: import_typebox.Type.Optional(import_typebox.Type.String()),
522
+ secure: import_typebox.Type.Optional(import_typebox.Type.Boolean()),
523
+ httpOnly: import_typebox.Type.Optional(import_typebox.Type.Boolean())
524
+ }), { description: "Cookies for the 'after' URL" })),
525
+ options: import_typebox.Type.Optional(import_typebox.Type.Record(import_typebox.Type.String(), import_typebox.Type.Any()))
526
+ }),
527
+ async execute(_id, params) {
528
+ const vdOpts = [];
529
+ vdOpts.push(`url_before: '${params.url_before}'`);
530
+ vdOpts.push(`url_after: '${params.url_after}'`);
531
+ if (params.viewport) vdOpts.push(`viewport: { width: ${params.viewport.width || 1280}, height: ${params.viewport.height || 720} }`);
532
+ if (params.full_page === false) vdOpts.push("full_page: false");
533
+ if (params.threshold != null) vdOpts.push(`threshold: ${params.threshold}`);
534
+ if (params.selector) vdOpts.push(`selector: '${params.selector}'`);
535
+ if (params.delay_ms) vdOpts.push(`delay_ms: ${params.delay_ms}`);
536
+ if (params.cookies_before) vdOpts.push(`cookies_before: ${JSON.stringify(params.cookies_before)}`);
537
+ if (params.cookies_after) vdOpts.push(`cookies_after: ${JSON.stringify(params.cookies_after)}`);
538
+ const optsStr = `{ ${vdOpts.join(", ")} }`;
539
+ const payload = {
540
+ url: params.url_before,
541
+ script: `return await visualDiff(${optsStr});`,
542
+ options: { ...params.options || {}, returnResult: true }
543
+ };
544
+ const result = await runWithDefaults(api, payload, { include: ["result", "console", "visual_diff"] });
545
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
546
+ }
547
+ },
548
+ { optional: true }
549
+ );
494
550
  }
package/dist/index.js CHANGED
@@ -306,7 +306,7 @@ function register(api) {
306
306
  if (Object.keys(opts).length > 0) payload.options = opts;
307
307
  if (params.include) payload.include = params.include;
308
308
  if (params.harInline) payload.harInline = params.harInline;
309
- const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result"] });
309
+ const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result", "data", "urls", "dataset", "sitemap", "visual_diff"] });
310
310
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
311
311
  }
312
312
  },
@@ -346,7 +346,7 @@ function register(api) {
346
346
  if (Object.keys(opts).length > 0) payload.options = opts;
347
347
  if (params.include) payload.include = params.include;
348
348
  if (params.harInline) payload.harInline = params.harInline;
349
- const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result"] });
349
+ const result = await runWithDefaults(api, payload, { include: ["screenshot", "console", "result", "data", "urls", "dataset", "sitemap", "visual_diff"] });
350
350
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
351
351
  }
352
352
  },
@@ -467,6 +467,62 @@ function register(api) {
467
467
  },
468
468
  { optional: true }
469
469
  );
470
+ api.registerTool(
471
+ {
472
+ name: "riddle_visual_diff",
473
+ description: "Riddle: visually compare two URLs by screenshotting both and computing a pixel-level diff. Returns change percentage, changed pixel count, and URLs to before/after/diff images. For authenticated comparison, use riddle_script with login steps followed by await visualDiff().",
474
+ parameters: Type.Object({
475
+ url_before: Type.String({ description: "URL to screenshot as the 'before' image" }),
476
+ url_after: Type.String({ description: "URL to screenshot as the 'after' image" }),
477
+ viewport: Type.Optional(Type.Object({
478
+ width: Type.Number({ description: "Viewport width (default: 1280)" }),
479
+ height: Type.Number({ description: "Viewport height (default: 720)" })
480
+ })),
481
+ full_page: Type.Optional(Type.Boolean({ description: "Capture full page (default: true)" })),
482
+ threshold: Type.Optional(Type.Number({ description: "Pixel match threshold 0-1 (default: 0.1)" })),
483
+ selector: Type.Optional(Type.String({ description: "CSS selector to capture instead of full page" })),
484
+ delay_ms: Type.Optional(Type.Number({ description: "Delay after page load before capture (ms)" })),
485
+ cookies_before: Type.Optional(Type.Array(Type.Object({
486
+ name: Type.String(),
487
+ value: Type.String(),
488
+ domain: Type.String(),
489
+ path: Type.Optional(Type.String()),
490
+ secure: Type.Optional(Type.Boolean()),
491
+ httpOnly: Type.Optional(Type.Boolean())
492
+ }), { description: "Cookies for the 'before' URL" })),
493
+ cookies_after: Type.Optional(Type.Array(Type.Object({
494
+ name: Type.String(),
495
+ value: Type.String(),
496
+ domain: Type.String(),
497
+ path: Type.Optional(Type.String()),
498
+ secure: Type.Optional(Type.Boolean()),
499
+ httpOnly: Type.Optional(Type.Boolean())
500
+ }), { description: "Cookies for the 'after' URL" })),
501
+ options: Type.Optional(Type.Record(Type.String(), Type.Any()))
502
+ }),
503
+ async execute(_id, params) {
504
+ const vdOpts = [];
505
+ vdOpts.push(`url_before: '${params.url_before}'`);
506
+ vdOpts.push(`url_after: '${params.url_after}'`);
507
+ if (params.viewport) vdOpts.push(`viewport: { width: ${params.viewport.width || 1280}, height: ${params.viewport.height || 720} }`);
508
+ if (params.full_page === false) vdOpts.push("full_page: false");
509
+ if (params.threshold != null) vdOpts.push(`threshold: ${params.threshold}`);
510
+ if (params.selector) vdOpts.push(`selector: '${params.selector}'`);
511
+ if (params.delay_ms) vdOpts.push(`delay_ms: ${params.delay_ms}`);
512
+ if (params.cookies_before) vdOpts.push(`cookies_before: ${JSON.stringify(params.cookies_before)}`);
513
+ if (params.cookies_after) vdOpts.push(`cookies_after: ${JSON.stringify(params.cookies_after)}`);
514
+ const optsStr = `{ ${vdOpts.join(", ")} }`;
515
+ const payload = {
516
+ url: params.url_before,
517
+ script: `return await visualDiff(${optsStr});`,
518
+ options: { ...params.options || {}, returnResult: true }
519
+ };
520
+ const result = await runWithDefaults(api, payload, { include: ["result", "console", "visual_diff"] });
521
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
522
+ }
523
+ },
524
+ { optional: true }
525
+ );
470
526
  }
471
527
  export {
472
528
  register as default
@@ -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.5.0",
5
+ "version": "0.5.3",
6
6
  "notes": "0.4.0: Added riddle_scrape, riddle_map, riddle_crawl convenience tools. Updated riddle_steps and riddle_script descriptions with data extraction capabilities.",
7
7
  "type": "plugin",
8
8
  "bundledSkills": [],
@@ -35,7 +35,8 @@
35
35
  "riddle_run",
36
36
  "riddle_scrape",
37
37
  "riddle_map",
38
- "riddle_crawl"
38
+ "riddle_crawl",
39
+ "riddle_visual_diff"
39
40
  ],
40
41
  "invokes": [],
41
42
  "note": "Provides tools for agent use; does not invoke other agent tools"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/openclaw-riddledc",
3
- "version": "0.5.0",
3
+ "version": "0.5.3",
4
4
  "description": "OpenClaw integration package for RiddleDC (no secrets).",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",