@xutest1/sdk 0.0.1 → 0.0.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.
@@ -37,7 +37,6 @@ export const createClient = (config = {}) => {
37
37
  return { opts, url };
38
38
  };
39
39
  const request = async (options) => {
40
- // @ts-expect-error
41
40
  const { opts, url } = await beforeRequest(options);
42
41
  const requestInit = {
43
42
  redirect: "follow",
package/dist/server.js CHANGED
@@ -4,9 +4,8 @@ import { join, dirname } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  // Find the ae3code binary from optionalDependencies
6
6
  function findBinary() {
7
- const platform = process.platform; // darwin, linux, win32
8
- const arch = process.arch; // arm64, x64
9
- // Map to package names
7
+ const platform = process.platform;
8
+ const arch = process.arch;
10
9
  const platformMap = {
11
10
  'darwin-arm64': '@xutest1/darwin-arm64',
12
11
  'darwin-x64': '@xutest1/darwin-x64',
@@ -17,25 +16,27 @@ function findBinary() {
17
16
  const key = `${platform}-${arch}`;
18
17
  const pkgName = platformMap[key];
19
18
  if (!pkgName) {
20
- throw new Error(`Unsupported platform: ${key}. Supported: ${Object.keys(platformMap).join(', ')}`);
19
+ console.warn(`No binary package for platform ${key}, falling back to PATH`);
20
+ return 'ae3code';
21
21
  }
22
22
  const binaryName = platform === 'win32' ? 'ae3code.exe' : 'ae3code';
23
- // Try to find the package in node_modules
23
+ // Try to find in node_modules relative to this file
24
+ const __dirname = dirname(fileURLToPath(import.meta.url));
24
25
  const possiblePaths = [
25
- // When installed as dependency
26
- join(dirname(fileURLToPath(import.meta.url)), '..', '..', pkgName, 'bin', binaryName),
27
- // When in node_modules
26
+ // When installed as dependency: node_modules/@xutest1/sdk/dist -> node_modules/@xutest1/darwin-arm64/bin
27
+ join(__dirname, '..', '..', pkgName, 'bin', binaryName),
28
+ // Alternative path
29
+ join(__dirname, '..', '..', '..', pkgName, 'bin', binaryName),
30
+ // From cwd
28
31
  join(process.cwd(), 'node_modules', pkgName, 'bin', binaryName),
29
- // Fallback to global
30
- binaryName,
31
32
  ];
32
33
  for (const p of possiblePaths) {
33
34
  if (existsSync(p)) {
34
35
  return p;
35
36
  }
36
37
  }
37
- // Return the binary name and hope it's in PATH
38
- return binaryName;
38
+ // Fallback to PATH
39
+ return 'ae3code';
39
40
  }
40
41
  export async function createOpencodeServer(options) {
41
42
  options = Object.assign({
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@xutest1/sdk",
3
- "version": "0.0.1",
4
- "description": "Type-safe SDK for A3Code AI coding agent",
5
- "author": "A3Code",
6
- "license": "MIT",
7
- "keywords": ["a3code", "ai", "sdk", "coding", "agent"],
3
+ "version": "0.0.3",
4
+ "description": "A3Code SDK - Build AI agents with agentic coding capabilities",
8
5
  "type": "module",
9
- "main": "./dist/index.js",
10
- "types": "./dist/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
11
8
  "exports": {
12
9
  ".": {
13
10
  "import": "./dist/index.js",
@@ -15,16 +12,20 @@
15
12
  }
16
13
  },
17
14
  "files": ["dist"],
18
- "optionalDependencies": {
19
- "@xutest1/darwin-arm64": "0.0.1",
20
- "@xutest1/darwin-x64": "0.0.1",
21
- "@xutest1/linux-x64": "0.0.1",
22
- "@xutest1/linux-arm64": "0.0.1",
23
- "@xutest1/win32-x64": "0.0.1"
15
+ "scripts": {
16
+ "build": "tsc"
24
17
  },
25
18
  "devDependencies": {
26
- "@tsconfig/node22": "^22.0.0",
27
- "@types/node": "^22.0.0",
28
- "typescript": "^5.7.0"
29
- }
19
+ "@types/node": "^20.0.0",
20
+ "typescript": "^5.0.0"
21
+ },
22
+ "optionalDependencies": {
23
+ "@xutest1/darwin-arm64": "0.0.3",
24
+ "@xutest1/darwin-x64": "0.0.3",
25
+ "@xutest1/linux-x64": "0.0.3",
26
+ "@xutest1/linux-arm64": "0.0.3",
27
+ "@xutest1/win32-x64": "0.0.3"
28
+ },
29
+ "keywords": ["a3code", "ai", "agent", "coding", "sdk", "vllm"],
30
+ "license": "MIT"
30
31
  }