automify 0.1.1 → 0.1.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/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/automify)
|
|
6
6
|
[](./LICENSE)
|
|
7
|
-
[](https://nodejs.org/)
|
|
8
8
|
|
|
9
9
|
`Automify` is a Node.js library for AI computer use and command use across web apps, terminals, native desktops, Docker CLI sandboxes, and Docker-backed Linux desktops.
|
|
10
10
|
|
|
@@ -48,7 +48,15 @@ Chromium is installed by the package `postinstall` script. Skip it with:
|
|
|
48
48
|
AUTOMIFY_SKIP_BROWSER_INSTALL=1 npm install automify
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
Requirements: Node.js `
|
|
51
|
+
Requirements: Node.js `20.12.2+` and a provider config. OpenAI examples use `gpt-5.5`.
|
|
52
|
+
|
|
53
|
+
Automify is published as an ES module package, so the examples use modern `import` syntax:
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { initAutomify } from "automify";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Use this from an ES module project (`"type": "module"` in `package.json`) or from `.mjs` files. In CommonJS projects, use dynamic `import()` from your `require`-based files instead.
|
|
52
60
|
|
|
53
61
|
Zod support is optional. Install Zod only if you want to build structured outputs from Zod schemas:
|
|
54
62
|
|
|
@@ -190,10 +198,10 @@ try {
|
|
|
190
198
|
|
|
191
199
|
### Desktop Computer Use
|
|
192
200
|
|
|
193
|
-
Local desktop computer use is optional because OS control
|
|
201
|
+
Local desktop computer use is optional. Install it with the command below; it may take a while because it compiles native desktop dependencies. When you use the local desktop adapter, your OS may ask for permission to control the desktop.
|
|
194
202
|
|
|
195
203
|
```bash
|
|
196
|
-
|
|
204
|
+
npx automify-install-desktop
|
|
197
205
|
```
|
|
198
206
|
|
|
199
207
|
```js
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLocalDesktopComputer, initAutomify } from "../src/index.js";
|
|
2
2
|
|
|
3
|
-
// Run `
|
|
3
|
+
// Run `npx automify-install-desktop` once before using createLocalDesktopComputer().
|
|
4
4
|
const automify = initAutomify({
|
|
5
5
|
provider: {
|
|
6
6
|
type: "openai",
|
|
@@ -3,7 +3,7 @@ import { tmpdir } from "node:os";
|
|
|
3
3
|
|
|
4
4
|
import { createLocalDesktopComputer, initAutomify } from "../src/index.js";
|
|
5
5
|
|
|
6
|
-
// Run `
|
|
6
|
+
// Run `npx automify-install-desktop` once before using createLocalDesktopComputer().
|
|
7
7
|
const automify = initAutomify({
|
|
8
8
|
provider: {
|
|
9
9
|
type: "openai",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "automify",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "AI computer use for browser, CLI, and desktop in Node.js.",
|
|
5
5
|
"homepage": "https://aldovincenti.github.io/automify",
|
|
6
6
|
"bugs": {
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"types": "src/index.d.ts",
|
|
16
|
+
"bin": {
|
|
17
|
+
"automify-install-desktop": "./scripts/install-desktop.js"
|
|
18
|
+
},
|
|
16
19
|
"exports": {
|
|
17
20
|
".": {
|
|
18
21
|
"types": "./src/index.d.ts",
|
|
@@ -43,7 +46,7 @@
|
|
|
43
46
|
"format:check": "prettier --check ."
|
|
44
47
|
},
|
|
45
48
|
"dependencies": {
|
|
46
|
-
"jimp": "^
|
|
49
|
+
"jimp": "^1.6.1",
|
|
47
50
|
"playwright": ">=1.40.0"
|
|
48
51
|
},
|
|
49
52
|
"peerDependencies": {
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
}
|
|
56
59
|
},
|
|
57
60
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
61
|
+
"node": ">=20.12.2"
|
|
59
62
|
},
|
|
60
63
|
"keywords": [
|
|
61
64
|
"automation",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { spawnSync } from "node:child_process";
|
|
2
3
|
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
4
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -23,7 +24,7 @@ const platformPackageDir = join(nutScope, `libnut-${process.platform}`);
|
|
|
23
24
|
const macPermissionsPackageDir = join(nutScope, "node-mac-permissions");
|
|
24
25
|
|
|
25
26
|
const runtimeDependencies = [
|
|
26
|
-
"jimp@
|
|
27
|
+
"jimp@1.6.1",
|
|
27
28
|
"node-abort-controller@3.1.1",
|
|
28
29
|
"clipboardy@2.3.0",
|
|
29
30
|
"bindings@1.5.0"
|
|
@@ -123,7 +124,7 @@ function checkBuildPrerequisites() {
|
|
|
123
124
|
if (missing.length === 0) return;
|
|
124
125
|
|
|
125
126
|
console.error(`Missing required desktop build tool(s): ${missing.join(", ")}`);
|
|
126
|
-
console.error("Install the native build prerequisites, then rerun:
|
|
127
|
+
console.error("Install the native build prerequisites, then rerun: npx automify-install-desktop");
|
|
127
128
|
|
|
128
129
|
if (process.platform === "darwin") {
|
|
129
130
|
console.error("macOS: install Xcode Command Line Tools with `xcode-select --install` and install CMake.");
|
package/src/lib/automify.js
CHANGED
|
@@ -715,10 +715,10 @@ async function resizeScreenshot(screenshot, target, options, automify) {
|
|
|
715
715
|
}
|
|
716
716
|
|
|
717
717
|
try {
|
|
718
|
-
const {
|
|
718
|
+
const { Jimp, JimpMime } = await import("jimp");
|
|
719
719
|
const image = await Jimp.read(Buffer.from(screenshot));
|
|
720
|
-
image.resize(target.width, target.height);
|
|
721
|
-
return image.
|
|
720
|
+
image.resize({ w: target.width, h: target.height });
|
|
721
|
+
return image.getBuffer(JimpMime.png);
|
|
722
722
|
} catch (error) {
|
|
723
723
|
debugLog(automify.debug, "automify", "screenshot_resize_skipped", {
|
|
724
724
|
reason: error?.message,
|
|
@@ -432,7 +432,7 @@ async function importNut() {
|
|
|
432
432
|
return await import("@nut-tree/nut-js");
|
|
433
433
|
} catch (error) {
|
|
434
434
|
throw new AutomifyError(
|
|
435
|
-
"createLocalDesktopComputer requires the local desktop adapter dependency built from source. Install it with:
|
|
435
|
+
"createLocalDesktopComputer requires the local desktop adapter dependency built from source. Install it with: npx automify-install-desktop",
|
|
436
436
|
{ cause: error }
|
|
437
437
|
);
|
|
438
438
|
}
|