ace-tool-rs 0.1.5 → 0.1.7

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.
Files changed (3) hide show
  1. package/README.md +88 -0
  2. package/package.json +2 -2
  3. package/run.js +14 -10
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # ace-tool-rs npm shim
2
+
3
+ This npm package provides a convenient way to install and run `ace-tool-rs` via npm/npx.
4
+
5
+ ## How It Works
6
+
7
+ This is a **shim package** that automatically downloads the appropriate pre-built binary for your platform from GitHub Releases when first run. The binary is cached locally for subsequent invocations.
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ # Run directly with npx (no installation needed)
13
+ npx ace-tool-rs --base-url <API_URL> --token <AUTH_TOKEN>
14
+
15
+ # Or install globally
16
+ npm install -g ace-tool-rs
17
+ ace-tool-rs --base-url <API_URL> --token <AUTH_TOKEN>
18
+ ```
19
+
20
+ ## Supported Platforms
21
+
22
+ | Platform | Architecture | Status |
23
+ |----------|--------------|--------|
24
+ | Windows | x64 | Supported |
25
+ | macOS | x64, ARM64 | Supported (universal binary) |
26
+ | Linux | x64 | Supported |
27
+
28
+ ## Cache Location
29
+
30
+ Downloaded binaries are cached in platform-specific directories:
31
+
32
+ | Platform | Cache Path |
33
+ |----------|------------|
34
+ | Windows | `%LOCALAPPDATA%\ace-tool-rs\<version>\` |
35
+ | macOS | `~/Library/Caches/ace-tool-rs/<version>/` |
36
+ | Linux | `$XDG_CACHE_HOME/ace-tool-rs/<version>/` or `~/.cache/ace-tool-rs/<version>/` |
37
+
38
+ The cache is versioned, so upgrading the npm package will download a new binary matching that version.
39
+
40
+ ## Environment Variables
41
+
42
+ | Variable | Description |
43
+ |----------|-------------|
44
+ | `GITHUB_TOKEN` | GitHub personal access token to avoid rate limits when downloading |
45
+
46
+ ## Requirements
47
+
48
+ - Node.js 14.14.0 or later
49
+ - `tar` command (Linux/macOS) or PowerShell 5.0+ (Windows) for extraction
50
+
51
+ ## Troubleshooting
52
+
53
+ ### Download Fails
54
+
55
+ If automatic download fails, you can:
56
+
57
+ 1. **Manual download**: Download the appropriate binary from [GitHub Releases](https://github.com/missdeer/ace-tool-rs/releases) and place it in the cache directory.
58
+
59
+ 2. **Install via Cargo**: If you have Rust installed:
60
+ ```bash
61
+ cargo install ace-tool-rs
62
+ ```
63
+
64
+ 3. **Set GITHUB_TOKEN**: If you're hitting GitHub API rate limits:
65
+ ```bash
66
+ export GITHUB_TOKEN=your_github_token
67
+ npx ace-tool-rs --base-url <API_URL> --token <AUTH_TOKEN>
68
+ ```
69
+
70
+ ### Binary Not Found After Extraction
71
+
72
+ Ensure your system has the required extraction tools:
73
+ - **Windows**: PowerShell 5.0+ with `Expand-Archive` cmdlet
74
+ - **Linux/macOS**: `tar` command
75
+
76
+ ## How the Shim Works
77
+
78
+ 1. On first run, checks if the binary exists in the cache directory
79
+ 2. If not found, queries GitHub API for the release matching the npm package version
80
+ 3. Downloads the platform-appropriate archive (`.zip` for Windows, `.tar.gz` for others)
81
+ 4. Extracts the binary to the cache directory
82
+ 5. Executes the binary with all provided arguments
83
+
84
+ ## License
85
+
86
+ This package is part of [ace-tool-rs](https://github.com/missdeer/ace-tool-rs) and is licensed under GPL-3.0.
87
+
88
+ For commercial use, please contact missdeer@gmail.com for licensing options.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ace-tool-rs",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "MCP server for codebase indexing, semantic search, and prompt enhancement",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  "cli"
23
23
  ],
24
24
  "bin": {
25
- "ace-tool-rs": "./run.js"
25
+ "ace-tool-rs": "run.js"
26
26
  },
27
27
  "files": [
28
28
  "run.js"
package/run.js CHANGED
@@ -88,19 +88,23 @@ function getAssetName() {
88
88
  // macOS uses universal binary (supports both x64 and arm64)
89
89
  return "ace-tool-rs_Darwin_universal.tar.gz";
90
90
  case "linux":
91
- if (arch !== "x64") {
92
- throw new Error(
93
- `Unsupported architecture: ${arch} on Linux. Only x64 is supported.`
94
- );
91
+ if (arch === "x64") {
92
+ return "ace-tool-rs_Linux_x86_64.tar.gz";
93
+ } else if (arch === "arm64") {
94
+ return "ace-tool-rs_Linux_aarch64.tar.gz";
95
95
  }
96
- return "ace-tool-rs_Linux_x86_64.tar.gz";
96
+ throw new Error(
97
+ `Unsupported architecture: ${arch} on Linux. Only x64 and arm64 are supported.`
98
+ );
97
99
  case "win32":
98
- if (arch !== "x64") {
99
- throw new Error(
100
- `Unsupported architecture: ${arch} on Windows. Only x64 is supported.`
101
- );
100
+ if (arch === "x64") {
101
+ return "ace-tool-rs_Windows_x86_64.zip";
102
+ } else if (arch === "arm64") {
103
+ return "ace-tool-rs_Windows_aarch64.zip";
102
104
  }
103
- return "ace-tool-rs_Windows_x86_64.zip";
105
+ throw new Error(
106
+ `Unsupported architecture: ${arch} on Windows. Only x64 and arm64 are supported.`
107
+ );
104
108
  default:
105
109
  throw new Error(`Unsupported platform: ${platform}`);
106
110
  }