arxo 0.0.1 → 0.1.0-beta.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Arxo
3
+ Copyright (c) 2026 Arxo
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -19,3 +19,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
+
23
+ ---
24
+
25
+ This license applies only to the JavaScript/Node components, documentation, and
26
+ other source material in this repository. Native binaries (e.g. arxo-mcp)
27
+ included in packages are proprietary software and are not licensed under the
28
+ MIT License. Use of those binaries is permitted under the terms of each
29
+ package distribution.
package/README.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # arxo
2
2
 
3
- Minimal CLI placeholder. Architecture tooling coming soon.
3
+ Architecture analysis for AI-native codebases.
4
+
5
+ Arxo analyzes the dependency graph and call patterns of your project and surfaces structural risks — circular dependencies, unsafe agent boundaries, and governance gaps in AI configurations.
6
+
7
+ ## Public metrics
8
+
9
+ | Metric | What it detects |
10
+ |--------|-----------------|
11
+ | `scc` | Circular dependency clusters (strongly connected components) |
12
+ | `agent_architecture` | Unsafe patterns in LLM/agent code: tool call risks, memory isolation, MCP server shadow usage |
13
+ | `openclaw_architecture` | Security and governance gaps in OpenClaw AI config files |
14
+
15
+ Supports TypeScript and Python.
4
16
 
5
17
  ## Install
6
18
 
@@ -11,23 +23,20 @@ npm install -g arxo
11
23
  ## Usage
12
24
 
13
25
  ```bash
14
- arxo --help
15
- arxo --version
16
- ```
17
-
18
- ## Publish (from monorepo)
26
+ # Analyze current directory (default) or a path
27
+ arxo analyze [path]
19
28
 
20
- From repo root:
29
+ # Generate an HTML report (report.html) and open it in your browser
30
+ arxo analyze --html
21
31
 
22
- ```bash
23
- cd arxo-npm
24
- npm login
25
- npm publish --access public
32
+ # List available metrics
33
+ arxo metrics list
26
34
  ```
27
35
 
28
- - `repository` in `package.json` points at this monorepo and `directory: "arxo-npm"` so npm/GitHub link to this folder.
29
- - Check name availability first: https://www.npmjs.com/package/arxo
36
+ ## MCP (AI assistant integration)
37
+
38
+ Arxo ships an MCP server. Add it to Cursor or Claude Desktop and your AI assistant can query your architecture directly.
30
39
 
31
40
  ## License
32
41
 
33
- MIT
42
+ The launcher and scripts in this package are MIT. The arxo native binary is proprietary; use is permitted under the terms of this distribution.
Binary file
Binary file
Binary file
Binary file
package/bin/arxo.js CHANGED
@@ -1,29 +1,50 @@
1
1
  #!/usr/bin/env node
2
+ /**
3
+ * Arxo CLI launcher. Runs the platform-specific native binary from bin/ when present
4
+ * (after prepare-from-dist). Supports multi-platform: arxo-<platform>-<arch> or arxo-win32-x64.exe.
5
+ * Falls back to legacy bin/arxo or bin/arxo.exe for single-binary installs.
6
+ */
7
+ const path = require('path');
8
+ const fs = require('fs');
9
+ const { spawnSync } = require('child_process');
2
10
 
11
+ const binDir = path.join(__dirname);
12
+ const isWin = process.platform === 'win32';
13
+ const arch = process.arch; // 'x64', 'arm64', 'ia32'
14
+
15
+ // Multi-platform binary name (Node-style: darwin-x64, linux-arm64, win32-x64.exe)
16
+ const platformName = isWin ? `win32-${arch}.exe` : `${process.platform}-${arch}`;
17
+ const multiPlatformBin = path.join(binDir, `arxo-${platformName}`);
18
+
19
+ // Legacy single-binary names
20
+ const legacyBin = path.join(binDir, isWin ? 'arxo.exe' : 'arxo');
21
+
22
+ const nativeBin = fs.existsSync(multiPlatformBin) ? multiPlatformBin : legacyBin;
3
23
  const args = process.argv.slice(2);
4
- const has = (s) => args.includes(s) || args.includes(s + "=");
5
24
 
6
- if (has("--version") || has("-v")) {
7
- const pkg = require("../package.json");
8
- console.log("arxo " + pkg.version);
9
- process.exit(0);
25
+ if (fs.existsSync(nativeBin)) {
26
+ const result = spawnSync(nativeBin, args, { stdio: 'inherit', windowsHide: true });
27
+ process.exitCode = result.status != null ? result.status : 1;
28
+ process.exit(process.exitCode);
10
29
  }
11
30
 
12
- if (has("--help") || has("-h")) {
31
+ // No native binary (e.g. dev before prepare-from-dist)
32
+ const has = (s) => args.includes(s) || args.includes(s + '=');
33
+ if (has('--version') || has('-v')) {
34
+ const pkg = require(path.join(binDir, '..', 'package.json'));
35
+ console.log('arxo ' + pkg.version);
36
+ process.exit(0);
37
+ }
38
+ if (has('--help') || has('-h')) {
13
39
  console.log(`
14
- arxo — architecture tooling (placeholder)
40
+ arxo — architecture analysis (scc, agent_architecture, openclaw_architecture)
15
41
 
16
42
  Usage:
17
- arxo [options]
18
-
19
- Options:
20
- -h, --help Show this help
21
- -v, --version Show version
22
-
23
- Not implemented yet. Full CLI coming soon.
43
+ arxo analyze [path]
44
+ arxo metrics list
24
45
  `);
25
46
  process.exit(0);
26
47
  }
27
48
 
28
- console.log("arxo: Not implemented yet.");
29
- process.exit(0);
49
+ console.error('arxo: Native binary not found for this platform. Reinstall with: npm install -g arxo');
50
+ process.exit(1);
package/package.json CHANGED
@@ -1,18 +1,33 @@
1
1
  {
2
2
  "name": "arxo",
3
- "version": "0.0.1",
4
- "description": "CLI placeholder architecture tooling (coming soon)",
3
+ "version": "0.1.0-beta.1",
4
+ "description": "Architecture analysis CLI — scc, agent_architecture, openclaw_architecture for TypeScript and Python",
5
5
  "bin": {
6
6
  "arxo": "bin/arxo.js"
7
7
  },
8
- "files": ["bin", "LICENSE", "README.md"],
8
+ "files": [
9
+ "bin",
10
+ "scripts",
11
+ "LICENSE",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "postinstall": "node scripts/postinstall.js",
16
+ "prepare-npm": "bash scripts/prepare-from-dist.sh"
17
+ },
9
18
  "repository": {
10
19
  "type": "git",
11
- "url": "https://github.com/arxo-io/arxo-cli.git"
20
+ "url": "https://github.com/arxohq/arxo.git"
12
21
  },
13
22
  "license": "MIT",
14
- "keywords": ["cli", "architecture"],
23
+ "keywords": [
24
+ "cli",
25
+ "architecture",
26
+ "agent",
27
+ "llm",
28
+ "mcp"
29
+ ],
15
30
  "engines": {
16
31
  "node": ">=14"
17
32
  }
18
- }
33
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Detect platform triple for arxo-engine binary (must match arxo-loader platform.rs).
4
+ * Usage: node scripts/platform.js → e.g. "x86_64-unknown-linux-gnu"
5
+ */
6
+ const os = require('os');
7
+ const arch = os.arch();
8
+ const platform = os.platform();
9
+
10
+ const map = {
11
+ linux: { x64: 'x86_64-unknown-linux-gnu', arm64: 'aarch64-unknown-linux-gnu' },
12
+ darwin: { x64: 'x86_64-apple-darwin', arm64: 'aarch64-apple-darwin' },
13
+ win32: { x64: 'x86_64-pc-windows-msvc', arm64: 'x86_64-pc-windows-msvc' },
14
+ };
15
+
16
+ const a = arch === 'x64' || arch === 'x86_64' ? 'x64' : arch === 'arm64' || arch === 'aarch64' ? 'arm64' : null;
17
+ const triple = map[platform] && map[platform][a] ? map[platform][a] : null;
18
+ if (triple) {
19
+ console.log(triple);
20
+ } else {
21
+ console.error('Unsupported platform: ' + platform + '/' + arch);
22
+ process.exit(1);
23
+ }
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall: optionally download arxo-engine for current platform.
4
+ * Reads version from releases/version.json or env ARCH0_ENGINE_VERSION.
5
+ * Skips if ARCH0_SKIP_ENGINE_DOWNLOAD=1. Exits 0 on any error so npm install never fails.
6
+ */
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+ const { execSync } = require('child_process');
10
+
11
+ if (process.env.ARCH0_SKIP_ENGINE_DOWNLOAD === '1') process.exit(0);
12
+
13
+ const releasesRoot = path.resolve(__dirname, '../..');
14
+ let version = process.env.ARCH0_ENGINE_VERSION;
15
+ if (!version) {
16
+ try {
17
+ const v = JSON.parse(fs.readFileSync(path.join(releasesRoot, 'version.json'), 'utf8'));
18
+ version = v.engine_version || v.version || 'latest';
19
+ } catch (_) {
20
+ version = 'latest';
21
+ }
22
+ }
23
+
24
+ let triple;
25
+ try {
26
+ triple = execSync('node "' + path.join(__dirname, 'platform.js') + '"', { encoding: 'utf8' }).trim();
27
+ } catch (_) {
28
+ process.exit(0);
29
+ }
30
+
31
+ const isWin = triple.includes('windows');
32
+ const ext = isWin ? 'dll' : triple.includes('darwin') ? 'dylib' : 'so';
33
+ const prefix = isWin ? '' : 'lib';
34
+ const libName = prefix + 'arxo_engine.' + ext;
35
+ const CDN = process.env.ARXO_CDN_URL || 'https://releases.arxo.io';
36
+ const url = CDN + '/v' + version + '/arxo-engine-' + triple + '/' + libName;
37
+ const cacheDir = path.join(process.env.XDG_CACHE_HOME || path.join(process.env.HOME || process.env.USERPROFILE || '', '.cache'), 'arxo', 'engine', 'v' + version);
38
+ const dest = path.join(cacheDir, libName);
39
+ if (fs.existsSync(dest)) process.exit(0);
40
+
41
+ try {
42
+ fs.mkdirSync(cacheDir, { recursive: true });
43
+ } catch (_) {
44
+ process.exit(0);
45
+ }
46
+
47
+ const https = require('https');
48
+ const http = require('http');
49
+ const mod = url.startsWith('https') ? https : http;
50
+ mod.get(url, (res) => {
51
+ if (res.statusCode !== 200) return;
52
+ const file = fs.createWriteStream(dest);
53
+ res.pipe(file);
54
+ file.on('finish', () => file.close());
55
+ }).on('error', () => {});
56
+ process.exit(0);
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ # Copy public CLI binary(ies) from releases/dist/public into releases/npm/bin for npm publish.
3
+ # Multi-platform: copies all arxo-<platform>-<arch> and arxo-win32-x64.exe.
4
+ # Single-platform fallback: copies arxo or arxo.exe if no platform-named binaries exist.
5
+ # Run from repo root after ./releases/scripts/release.sh (or after building CLI for each target).
6
+ set -e
7
+
8
+ REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
9
+ DIST="$REPO_ROOT/releases/dist/public"
10
+ NPM_BIN="$REPO_ROOT/releases/npm/bin"
11
+ mkdir -p "$NPM_BIN"
12
+
13
+ copied=0
14
+ # CLI only: arxo-<platform>-<arch> or arxo-win32-x64.exe (exclude arxo-mcp*)
15
+ for f in "$DIST"/arxo-darwin-* "$DIST"/arxo-linux-* "$DIST"/arxo-win32-*; do
16
+ [ -f "$f" ] || continue
17
+ name=$(basename "$f")
18
+ cp "$f" "$NPM_BIN/$name"
19
+ [ -x "$f" ] || chmod +x "$NPM_BIN/$name" 2>/dev/null || true
20
+ echo "Copied $DIST/$name -> $NPM_BIN/$name"
21
+ copied=$((copied + 1))
22
+ done
23
+ if [ "$copied" -eq 0 ]; then
24
+ # No platform-named binaries; try legacy single binary
25
+ if [ -f "$DIST/arxo" ]; then
26
+ cp "$DIST/arxo" "$NPM_BIN/arxo"
27
+ chmod +x "$NPM_BIN/arxo"
28
+ echo "Copied $DIST/arxo -> $NPM_BIN/arxo"
29
+ elif [ -f "$DIST/arxo.exe" ]; then
30
+ cp "$DIST/arxo.exe" "$NPM_BIN/arxo.exe"
31
+ echo "Copied $DIST/arxo.exe -> $NPM_BIN/arxo.exe"
32
+ else
33
+ echo "No public CLI binary at $DIST (arxo, arxo.exe, or arxo-<platform>-<arch>). Run ./releases/scripts/release.sh first." >&2
34
+ exit 1
35
+ fi
36
+ fi