openowl 0.3.21 → 0.3.23

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/bin/owl CHANGED
@@ -18,7 +18,7 @@ const crypto = require("crypto");
18
18
  const { spawn } = require("child_process");
19
19
 
20
20
  // ── Version check ──────────────────────────────────────────────
21
- const VERSION = "0.3.20";
21
+ const VERSION = "0.3.22";
22
22
  if (process.argv[2] === "--version" || process.argv[2] === "-v") {
23
23
  console.log(`OpenOwl v${VERSION}`);
24
24
  process.exit(0);
@@ -28,7 +28,6 @@ if (process.argv[2] === "--version" || process.argv[2] === "-v") {
28
28
  const BINARIES = {
29
29
  "darwin-arm64": "owl-darwin-arm64",
30
30
  "darwin-x64": "owl-darwin-x86_64",
31
- "win32-x64": "owl-windows-x86_64.exe",
32
31
  };
33
32
 
34
33
  const platformKey = `${os.platform()}-${os.arch()}`;
@@ -155,7 +154,33 @@ process.stdin.on("data", async (chunk) => {
155
154
  }
156
155
 
157
156
  // Intercept tool calls for usage enforcement
158
- if (msg.method === "tools/call" && apiKey) {
157
+ if (msg.method === "tools/call") {
158
+ if (!apiKey) {
159
+ const errorResp = JSON.stringify({
160
+ jsonrpc: "2.0",
161
+ id: msg.id,
162
+ result: {
163
+ content: [
164
+ {
165
+ type: "text",
166
+ text:
167
+ "OpenOwl API key is missing.\n\n" +
168
+ "Setup:\n" +
169
+ " 1. Sign up at https://openowl.dev/signup\n" +
170
+ " 2. Get your API key from https://openowl.dev/dashboard\n" +
171
+ " 3. Save it:\n" +
172
+ " mkdir -p ~/.openowl\n" +
173
+ " echo 'owl-XXXX-XXXX-XXXX' > ~/.openowl/api.key\n\n" +
174
+ "Then restart your AI assistant.",
175
+ },
176
+ ],
177
+ isError: true,
178
+ },
179
+ });
180
+ process.stdout.write(errorResp + "\n");
181
+ continue;
182
+ }
183
+
159
184
  const toolName = msg.params?.name || "unknown";
160
185
  const usage = await checkUsage(apiKey, toolName, machineId);
161
186
 
package/install.js CHANGED
@@ -7,9 +7,8 @@ const path = require("path");
7
7
  const https = require("https");
8
8
  const http = require("http");
9
9
  const { execSync } = require("child_process");
10
- const zlib = require("zlib");
11
10
 
12
- const VERSION = "0.3.20";
11
+ const VERSION = "0.3.23";
13
12
  const BASE_URL =
14
13
  `https://github.com/mihir-kanzariya/openowl-releases/releases/download/v${VERSION}`;
15
14
 
@@ -22,11 +21,6 @@ const PLATFORMS = {
22
21
  url: `${BASE_URL}/owl-darwin-x64.tar.gz`,
23
22
  binary: "owl-darwin-x86_64",
24
23
  },
25
- "win32-x64": {
26
- url: `${BASE_URL}/owl-win32-x64.zip`,
27
- binary: "owl-windows-x86_64.exe",
28
- isZip: true,
29
- },
30
24
  };
31
25
 
32
26
  function getPlatformKey() {
@@ -54,43 +48,6 @@ function download(url) {
54
48
  });
55
49
  }
56
50
 
57
- /**
58
- * Extract a zip file using pure Node.js (no PowerShell dependency).
59
- */
60
- function extractZip(zipBuffer, destDir) {
61
- let offset = 0;
62
- while (offset < zipBuffer.length - 4) {
63
- const sig = zipBuffer.readUInt32LE(offset);
64
- if (sig !== 0x04034b50) break;
65
-
66
- const compressionMethod = zipBuffer.readUInt16LE(offset + 8);
67
- const compressedSize = zipBuffer.readUInt32LE(offset + 18);
68
- const nameLen = zipBuffer.readUInt16LE(offset + 26);
69
- const extraLen = zipBuffer.readUInt16LE(offset + 28);
70
- const nameStart = offset + 30;
71
- const fileName = zipBuffer.toString("utf8", nameStart, nameStart + nameLen);
72
- const dataStart = nameStart + nameLen + extraLen;
73
-
74
- const destPath = path.join(destDir, fileName);
75
-
76
- if (fileName.endsWith("/")) {
77
- fs.mkdirSync(destPath, { recursive: true });
78
- } else {
79
- fs.mkdirSync(path.dirname(destPath), { recursive: true });
80
- const rawData = zipBuffer.slice(dataStart, dataStart + compressedSize);
81
-
82
- if (compressionMethod === 0) {
83
- fs.writeFileSync(destPath, rawData);
84
- } else if (compressionMethod === 8) {
85
- const inflated = zlib.inflateRawSync(rawData);
86
- fs.writeFileSync(destPath, inflated);
87
- }
88
- }
89
-
90
- offset = dataStart + compressedSize;
91
- }
92
- }
93
-
94
51
  async function install() {
95
52
  const platformKey = getPlatformKey();
96
53
  const info = PLATFORMS[platformKey];
@@ -122,19 +79,13 @@ async function install() {
122
79
 
123
80
  fs.mkdirSync(installDir, { recursive: true });
124
81
 
125
- if (info.isZip) {
126
- // Pure Node.js zip extraction — no PowerShell needed
127
- extractZip(archive, installDir);
128
- } else {
129
- // macOS/Linux: use tar
130
- const tmpFile = path.join(os.tmpdir(), `owl-${VERSION}.tar.gz`);
131
- fs.writeFileSync(tmpFile, archive);
132
- execSync(`tar -xzf "${tmpFile}" -C "${installDir}"`, { stdio: "pipe" });
133
- fs.unlinkSync(tmpFile);
134
- }
82
+ const tmpFile = path.join(os.tmpdir(), `owl-${VERSION}.tar.gz`);
83
+ fs.writeFileSync(tmpFile, archive);
84
+ execSync(`tar -xzf "${tmpFile}" -C "${installDir}"`, { stdio: "pipe" });
85
+ fs.unlinkSync(tmpFile);
135
86
 
136
- // Make binary executable (no-op on Windows)
137
- if (fs.existsSync(binaryPath) && os.platform() !== "win32") {
87
+ // Make binary executable
88
+ if (fs.existsSync(binaryPath)) {
138
89
  fs.chmodSync(binaryPath, 0o755);
139
90
  }
140
91
 
@@ -144,11 +95,7 @@ async function install() {
144
95
  console.log(`[OpenOwl] Installed v${VERSION} successfully (${(archive.length / 1024 / 1024).toFixed(1)} MB)`);
145
96
  } catch (err) {
146
97
  console.error(`[OpenOwl] Installation failed: ${err.message}`);
147
- if (os.platform() === "win32") {
148
- console.error("[OpenOwl] Try downloading manually from: https://openowl.dev/quick-setup");
149
- } else {
150
- console.error("[OpenOwl] Try: brew install owl");
151
- }
98
+ console.error("[OpenOwl] Try: brew install mihir-kanzariya/owl/owl");
152
99
  process.exit(1);
153
100
  }
154
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openowl",
3
- "version": "0.3.21",
3
+ "version": "0.3.23",
4
4
  "description": "AI desktop automation MCP server — give your AI eyes and hands. Screen capture, clicking, typing, OCR, window management via MCP protocol.",
5
5
  "homepage": "https://openowl.dev",
6
6
  "author": "Mihir Kanzariya <kanzariyamihir@gmail.com> (https://openowl.dev)",
@@ -30,8 +30,7 @@
30
30
  "openowl"
31
31
  ],
32
32
  "os": [
33
- "darwin",
34
- "win32"
33
+ "darwin"
35
34
  ],
36
35
  "engines": {
37
36
  "node": ">=16"
@@ -39,7 +38,6 @@
39
38
  "files": [
40
39
  "install.js",
41
40
  "bin/owl",
42
- "bin/owl.cmd",
43
41
  "README.md"
44
42
  ]
45
43
  }
package/bin/owl.cmd DELETED
@@ -1,2 +0,0 @@
1
- @echo off
2
- node "%~dp0\owl" %*