@projectservan8n/cnapse 0.7.0 → 0.8.0

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.
@@ -1,65 +0,0 @@
1
- /**
2
- * Vision tools - Screenshot capture and AI description
3
- */
4
-
5
- import { describeScreen, captureScreenshot } from '../lib/vision.js';
6
-
7
- export interface ScreenshotResult {
8
- success: boolean;
9
- screenshot?: string; // base64
10
- error?: string;
11
- }
12
-
13
- export interface VisionResult {
14
- success: boolean;
15
- description?: string;
16
- screenshot?: string; // base64
17
- error?: string;
18
- }
19
-
20
- /**
21
- * Take a screenshot and return as base64
22
- */
23
- export async function takeScreenshot(): Promise<ScreenshotResult> {
24
- try {
25
- const screenshot = await captureScreenshot();
26
- if (!screenshot) {
27
- return { success: false, error: 'Failed to capture screenshot' };
28
- }
29
- return { success: true, screenshot };
30
- } catch (error) {
31
- return {
32
- success: false,
33
- error: error instanceof Error ? error.message : 'Screenshot failed',
34
- };
35
- }
36
- }
37
-
38
- /**
39
- * Capture screen and get AI description of what's visible
40
- */
41
- export async function describeCurrentScreen(): Promise<VisionResult> {
42
- try {
43
- const result = await describeScreen();
44
- return {
45
- success: true,
46
- description: result.description,
47
- screenshot: result.screenshot,
48
- };
49
- } catch (error) {
50
- return {
51
- success: false,
52
- error: error instanceof Error ? error.message : 'Vision analysis failed',
53
- };
54
- }
55
- }
56
-
57
- /**
58
- * Get all vision tools for the executor
59
- */
60
- export function getVisionTools() {
61
- return {
62
- takeScreenshot,
63
- describeCurrentScreen,
64
- };
65
- }