@miphamai/cli 0.6.7 → 0.6.8
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/package.json
CHANGED
|
@@ -35,9 +35,15 @@ export const computerUseTool: ToolDefinition = {
|
|
|
35
35
|
switch (action) {
|
|
36
36
|
case 'screenshot': {
|
|
37
37
|
const result = await takeScreenshot()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
if (!result.success) {
|
|
39
|
+
return { success: false, content: '', error: result.error }
|
|
40
|
+
}
|
|
41
|
+
const dataUrl = result.data!
|
|
42
|
+
const sizeKB = Math.round((dataUrl.length * 0.75) / 1024) // base64 → bytes estimate
|
|
43
|
+
return {
|
|
44
|
+
success: true,
|
|
45
|
+
content: `Screenshot captured (${sizeKB}KB).\n\n${dataUrl}`,
|
|
46
|
+
}
|
|
41
47
|
}
|
|
42
48
|
case 'launch': {
|
|
43
49
|
const result = launchApp(target)
|