@xutest1/sdk 0.0.1 → 0.0.2

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
@@ -1,50 +1,11 @@
1
1
  import { spawn } from "node:child_process";
2
- import { existsSync } from "node:fs";
3
- import { join, dirname } from "node:path";
4
- import { fileURLToPath } from "node:url";
5
- // Find the ae3code binary from optionalDependencies
6
- function findBinary() {
7
- const platform = process.platform; // darwin, linux, win32
8
- const arch = process.arch; // arm64, x64
9
- // Map to package names
10
- const platformMap = {
11
- 'darwin-arm64': '@xutest1/darwin-arm64',
12
- 'darwin-x64': '@xutest1/darwin-x64',
13
- 'linux-x64': '@xutest1/linux-x64',
14
- 'linux-arm64': '@xutest1/linux-arm64',
15
- 'win32-x64': '@xutest1/win32-x64',
16
- };
17
- const key = `${platform}-${arch}`;
18
- const pkgName = platformMap[key];
19
- if (!pkgName) {
20
- throw new Error(`Unsupported platform: ${key}. Supported: ${Object.keys(platformMap).join(', ')}`);
21
- }
22
- const binaryName = platform === 'win32' ? 'ae3code.exe' : 'ae3code';
23
- // Try to find the package in node_modules
24
- const possiblePaths = [
25
- // When installed as dependency
26
- join(dirname(fileURLToPath(import.meta.url)), '..', '..', pkgName, 'bin', binaryName),
27
- // When in node_modules
28
- join(process.cwd(), 'node_modules', pkgName, 'bin', binaryName),
29
- // Fallback to global
30
- binaryName,
31
- ];
32
- for (const p of possiblePaths) {
33
- if (existsSync(p)) {
34
- return p;
35
- }
36
- }
37
- // Return the binary name and hope it's in PATH
38
- return binaryName;
39
- }
40
2
  export async function createOpencodeServer(options) {
41
3
  options = Object.assign({
42
4
  hostname: "127.0.0.1",
43
5
  port: 4096,
44
6
  timeout: 5000,
45
7
  }, options ?? {});
46
- const binaryPath = findBinary();
47
- const proc = spawn(binaryPath, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
8
+ const proc = spawn(`ae3code`, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
48
9
  signal: options.signal,
49
10
  env: {
50
11
  ...process.env,
@@ -114,8 +75,7 @@ export function createOpencodeTui(options) {
114
75
  if (options?.agent) {
115
76
  args.push(`--agent=${options.agent}`);
116
77
  }
117
- const binaryPath = findBinary();
118
- const proc = spawn(binaryPath, args, {
78
+ const proc = spawn(`ae3code`, args, {
119
79
  signal: options?.signal,
120
80
  stdio: "inherit",
121
81
  env: {
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.2",
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,22 @@
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"
17
+ },
18
+ "dependencies": {
24
19
  },
25
20
  "devDependencies": {
26
- "@tsconfig/node22": "^22.0.0",
27
- "@types/node": "^22.0.0",
28
- "typescript": "^5.7.0"
29
- }
21
+ "@types/node": "^20.0.0",
22
+ "typescript": "^5.0.0"
23
+ },
24
+ "optionalDependencies": {
25
+ "@xutest1/darwin-arm64": "0.0.2",
26
+ "@xutest1/darwin-x64": "0.0.2",
27
+ "@xutest1/linux-x64": "0.0.2",
28
+ "@xutest1/linux-arm64": "0.0.2",
29
+ "@xutest1/win32-x64": "0.0.2"
30
+ },
31
+ "keywords": ["a3code", "ai", "agent", "coding", "sdk", "vllm"],
32
+ "license": "MIT"
30
33
  }