@skillful-agents/agent-computer 0.0.5 → 0.0.6
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/ac-core-darwin-arm64 +0 -0
- package/bin/ac-core-darwin-x64 +0 -0
- package/bin/ac-core-win32-arm64.exe +0 -0
- package/bin/ac-core-win32-x64.exe +0 -0
- package/dist/src/platform/resolve.d.ts.map +1 -1
- package/dist/src/platform/resolve.js +4 -15
- package/dist/src/platform/resolve.js.map +1 -1
- package/dist-cjs/src/platform/resolve.js +3 -15
- package/package.json +2 -2
- package/scripts/fix-cjs-resolve.js +27 -0
package/bin/ac-core-darwin-arm64
CHANGED
|
Binary file
|
package/bin/ac-core-darwin-x64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/platform/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/platform/resolve.ts"],"names":[],"mappings":"AAsBA,wBAAgB,aAAa,IAAI,MAAM,CAuDtC"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import { platform, arch } from 'os';
|
|
2
2
|
import { join, dirname } from 'path';
|
|
3
3
|
import { existsSync } from 'fs';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
function getModuleDir() {
|
|
10
|
-
if (typeof __dirname !== 'undefined')
|
|
11
|
-
return __dirname;
|
|
12
|
-
// ESM fallback — eval hides import.meta from the CJS parser
|
|
13
|
-
// eslint-disable-next-line no-eval
|
|
14
|
-
const url = eval('import.meta.url');
|
|
15
|
-
const { fileURLToPath } = require('url');
|
|
16
|
-
return dirname(fileURLToPath(url));
|
|
17
|
-
}
|
|
18
|
-
const _dirname = getModuleDir();
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
// ESM: use import.meta.url directly (CJS build patches this line — see scripts/fix-cjs-resolve.js)
|
|
6
|
+
// @ts-ignore — import.meta.url is valid in ESM; CJS tsconfig rejects it but post-build script fixes it
|
|
7
|
+
const _dirname = dirname(fileURLToPath(import.meta.url));
|
|
19
8
|
/**
|
|
20
9
|
* Find the package root by walking up from __dirname until we find package.json.
|
|
21
10
|
* Works whether running from source (src/platform/) or compiled (dist/src/platform/).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/platform/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/platform/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,mGAAmG;AACnG,uGAAuG;AACvG,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzD;;;GAGG;AACH,SAAS,eAAe;IACtB,IAAI,GAAG,GAAG,QAAQ,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QACtD,GAAG,GA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os");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* - ESM: use import.meta.url (wrapped in eval to avoid CJS parse error)
|
|
11
|
-
*/
|
|
12
|
-
function getModuleDir() {
|
|
13
|
-
if (typeof __dirname !== 'undefined')
|
|
14
|
-
return __dirname;
|
|
15
|
-
// ESM fallback — eval hides import.meta from the CJS parser
|
|
16
|
-
// eslint-disable-next-line no-eval
|
|
17
|
-
const url = eval('import.meta.url');
|
|
18
|
-
const { fileURLToPath } = require('url');
|
|
19
|
-
return (0, path_1.dirname)(fileURLToPath(url));
|
|
20
|
-
}
|
|
21
|
-
const _dirname = getModuleDir();
|
|
7
|
+
// ESM: use import.meta.url directly (CJS build patches this line — see scripts/fix-cjs-resolve.js)
|
|
8
|
+
// @ts-ignore — import.meta.url is valid in ESM; CJS tsconfig rejects it but post-build script fixes it
|
|
9
|
+
const _dirname = __dirname;
|
|
22
10
|
/**
|
|
23
11
|
* Find the package root by walking up from __dirname until we find package.json.
|
|
24
12
|
* Works whether running from source (src/platform/) or compiled (dist/src/platform/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillful-agents/agent-computer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Agent Computer — cross-platform desktop automation CLI for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "tsc && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist-cjs/package.json",
|
|
28
|
+
"build": "tsc && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist-cjs/package.json && node scripts/fix-cjs-resolve.js",
|
|
29
29
|
"build:swift": "cd native/macos && swift build -c release",
|
|
30
30
|
"build:dotnet": "cd native/windows && dotnet build ACCore/ACCore.csproj",
|
|
31
31
|
"build:all": "npm run build && (node -e \"process.exit(process.platform==='win32'?0:1)\" && npm run build:dotnet || npm run build:swift)",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-build script: patch the CJS resolve.js to use __dirname instead of import.meta.url.
|
|
3
|
+
* The ESM build uses import.meta.url directly, but CJS can't parse it.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
6
|
+
import { join, dirname } from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const filePath = join(__dirname, '..', 'dist-cjs', 'src', 'platform', 'resolve.js');
|
|
11
|
+
|
|
12
|
+
let content = readFileSync(filePath, 'utf-8');
|
|
13
|
+
|
|
14
|
+
// Replace the ESM __dirname computation with the CJS global
|
|
15
|
+
content = content.replace(
|
|
16
|
+
/const _dirname = .*fileURLToPath.*import\.meta\.url.*\);/,
|
|
17
|
+
'const _dirname = __dirname;'
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// Remove the url import since we no longer need fileURLToPath
|
|
21
|
+
content = content.replace(
|
|
22
|
+
/const url_1 = require\("url"\);\n?/,
|
|
23
|
+
''
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
writeFileSync(filePath, content);
|
|
27
|
+
console.log('Patched dist-cjs/src/platform/resolve.js for CJS compatibility');
|