infiniloom 0.3.0

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/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # infiniloom
2
+
3
+ High-performance repository context generator for LLMs.
4
+
5
+ Transform your codebase into optimized context for Claude, GPT-4, Gemini, and other Large Language Models.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g infiniloom
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Pack repository into Claude-optimized XML
17
+ infiniloom pack /path/to/repo --format xml
18
+
19
+ # Scan repository and show statistics
20
+ infiniloom scan /path/to/repo
21
+
22
+ # Generate repository map with key symbols
23
+ infiniloom map /path/to/repo --budget 2000
24
+ ```
25
+
26
+ ## Commands
27
+
28
+ | Command | Description |
29
+ |---------|-------------|
30
+ | `pack` | Transform repository into LLM-optimized context |
31
+ | `scan` | Analyze repository statistics |
32
+ | `map` | Generate PageRank-based symbol map |
33
+ | `index` | Build symbol index for fast diff context |
34
+ | `diff` | Get context for code changes |
35
+ | `impact` | Analyze change impact |
36
+ | `chunk` | Split repository into manageable pieces |
37
+ | `init` | Create configuration file |
38
+ | `info` | Show version and configuration info |
39
+
40
+ ## Supported Models
41
+
42
+ - **OpenAI**: GPT-5.x, GPT-4o, O3, O1
43
+ - **Anthropic**: Claude
44
+ - **Google**: Gemini
45
+ - **Meta**: Llama, CodeLlama
46
+ - **Others**: Mistral, DeepSeek, Qwen, Cohere, Grok
47
+
48
+ ## Output Formats
49
+
50
+ - **XML** - Optimized for Claude (prompt caching)
51
+ - **Markdown** - Optimized for GPT models
52
+ - **YAML** - Optimized for Gemini
53
+ - **JSON** - For programmatic access
54
+ - **TOON** - Most token-efficient (~40% smaller)
55
+
56
+ ## Alternative Installation
57
+
58
+ If npm installation fails, you can install via:
59
+
60
+ ```bash
61
+ # Cargo (Rust)
62
+ cargo install infiniloom
63
+
64
+ # Homebrew (macOS/Linux)
65
+ brew tap Topos-Labs/infiniloom
66
+ brew install infiniloom
67
+ ```
68
+
69
+ ## Documentation
70
+
71
+ - [Documentation](https://toposlabs.ai/infiniloom/)
72
+ - [GitHub Repository](https://github.com/Topos-Labs/infiniloom)
73
+
74
+ ## License
75
+
76
+ MIT
package/bin/infiniloom ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require("child_process");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+
7
+ const binDir = __dirname;
8
+ const platform = process.platform;
9
+ const binName = platform === "win32" ? "infiniloom.exe" : "infiniloom-bin";
10
+ const binPath = path.join(binDir, binName);
11
+
12
+ if (!fs.existsSync(binPath)) {
13
+ console.error("Error: infiniloom binary not found.");
14
+ console.error("The installation may have failed. Try reinstalling:");
15
+ console.error(" npm uninstall -g infiniloom && npm install -g infiniloom");
16
+ console.error("");
17
+ console.error("Or install via cargo:");
18
+ console.error(" cargo install infiniloom");
19
+ process.exit(1);
20
+ }
21
+
22
+ const child = spawn(binPath, process.argv.slice(2), {
23
+ stdio: "inherit",
24
+ env: process.env,
25
+ });
26
+
27
+ child.on("error", (err) => {
28
+ console.error(`Failed to start infiniloom: ${err.message}`);
29
+ process.exit(1);
30
+ });
31
+
32
+ child.on("close", (code) => {
33
+ process.exit(code || 0);
34
+ });
package/install.js ADDED
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const https = require("https");
6
+ const { execSync, spawn } = require("child_process");
7
+
8
+ const VERSION = require("./package.json").version;
9
+ const REPO = "Topos-Labs/infiniloom";
10
+
11
+ // Map Node.js platform/arch to release artifact names
12
+ function getArtifactInfo() {
13
+ const platform = process.platform;
14
+ const arch = process.arch;
15
+
16
+ const mapping = {
17
+ "darwin-x64": { artifact: "infiniloom-x86_64-apple-darwin.tar.gz", binary: "infiniloom" },
18
+ "darwin-arm64": { artifact: "infiniloom-aarch64-apple-darwin.tar.gz", binary: "infiniloom" },
19
+ "linux-x64": { artifact: "infiniloom-x86_64-unknown-linux-gnu.tar.gz", binary: "infiniloom" },
20
+ "linux-arm64": { artifact: "infiniloom-aarch64-unknown-linux-gnu.tar.gz", binary: "infiniloom" },
21
+ "win32-x64": { artifact: "infiniloom-x86_64-pc-windows-msvc.zip", binary: "infiniloom.exe" },
22
+ "win32-arm64": { artifact: "infiniloom-aarch64-pc-windows-msvc.zip", binary: "infiniloom.exe" },
23
+ };
24
+
25
+ const key = `${platform}-${arch}`;
26
+ const info = mapping[key];
27
+
28
+ if (!info) {
29
+ console.error(`Unsupported platform: ${platform}-${arch}`);
30
+ console.error("Supported: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64, win32-arm64");
31
+ console.error("");
32
+ console.error("Install from source instead:");
33
+ console.error(" cargo install infiniloom");
34
+ process.exit(1);
35
+ }
36
+
37
+ return info;
38
+ }
39
+
40
+ function downloadFile(url, destPath) {
41
+ return new Promise((resolve, reject) => {
42
+ const file = fs.createWriteStream(destPath);
43
+ const request = (url) => {
44
+ https.get(url, { headers: { "User-Agent": "infiniloom-npm" } }, (res) => {
45
+ if (res.statusCode === 302 || res.statusCode === 301) {
46
+ request(res.headers.location);
47
+ return;
48
+ }
49
+ if (res.statusCode !== 200) {
50
+ fs.unlinkSync(destPath);
51
+ reject(new Error(`HTTP ${res.statusCode}: ${res.statusMessage}`));
52
+ return;
53
+ }
54
+ res.pipe(file);
55
+ file.on("finish", () => {
56
+ file.close();
57
+ resolve();
58
+ });
59
+ }).on("error", (err) => {
60
+ fs.unlinkSync(destPath);
61
+ reject(err);
62
+ });
63
+ };
64
+ request(url);
65
+ });
66
+ }
67
+
68
+ async function install() {
69
+ const binDir = path.join(__dirname, "bin");
70
+ const { artifact, binary } = getArtifactInfo();
71
+ const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${artifact}`;
72
+ const tmpDir = path.join(__dirname, ".tmp");
73
+ const archivePath = path.join(tmpDir, artifact);
74
+
75
+ // Create directories
76
+ if (!fs.existsSync(binDir)) fs.mkdirSync(binDir, { recursive: true });
77
+ if (!fs.existsSync(tmpDir)) fs.mkdirSync(tmpDir, { recursive: true });
78
+
79
+ console.log(`Downloading infiniloom v${VERSION}...`);
80
+
81
+ try {
82
+ await downloadFile(url, archivePath);
83
+
84
+ // Extract archive
85
+ if (artifact.endsWith(".tar.gz")) {
86
+ execSync(`tar -xzf "${archivePath}" -C "${tmpDir}"`, { stdio: "pipe" });
87
+ } else if (artifact.endsWith(".zip")) {
88
+ if (process.platform === "win32") {
89
+ execSync(`powershell -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${tmpDir}' -Force"`, { stdio: "pipe" });
90
+ } else {
91
+ execSync(`unzip -o "${archivePath}" -d "${tmpDir}"`, { stdio: "pipe" });
92
+ }
93
+ }
94
+
95
+ // Find and move binary
96
+ const srcPath = path.join(tmpDir, binary);
97
+ const destPath = path.join(binDir, process.platform === "win32" ? "infiniloom.exe" : "infiniloom-bin");
98
+
99
+ if (!fs.existsSync(srcPath)) {
100
+ throw new Error(`Binary not found in archive: ${binary}`);
101
+ }
102
+
103
+ fs.copyFileSync(srcPath, destPath);
104
+ if (process.platform !== "win32") {
105
+ fs.chmodSync(destPath, 0o755);
106
+ }
107
+
108
+ // Clean up
109
+ fs.rmSync(tmpDir, { recursive: true, force: true });
110
+
111
+ console.log(`Infiniloom v${VERSION} installed successfully!`);
112
+ } catch (error) {
113
+ // Clean up on failure
114
+ if (fs.existsSync(tmpDir)) fs.rmSync(tmpDir, { recursive: true, force: true });
115
+
116
+ console.error(`Installation failed: ${error.message}`);
117
+ console.error("");
118
+ console.error("Alternative installation methods:");
119
+ console.error(" cargo install infiniloom");
120
+ console.error(" brew tap Topos-Labs/infiniloom && brew install infiniloom");
121
+ console.error("");
122
+ console.error(`Manual download: https://github.com/${REPO}/releases/tag/v${VERSION}`);
123
+ process.exit(1);
124
+ }
125
+ }
126
+
127
+ install().catch(console.error);
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "infiniloom",
3
+ "version": "0.3.0",
4
+ "description": "High-performance repository context generator for LLMs",
5
+ "bin": {
6
+ "infiniloom": "bin/infiniloom"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node install.js"
10
+ },
11
+ "files": [
12
+ "bin",
13
+ "install.js"
14
+ ],
15
+ "keywords": [
16
+ "infiniloom",
17
+ "llm",
18
+ "context",
19
+ "repository",
20
+ "code-analysis",
21
+ "claude",
22
+ "gpt",
23
+ "gemini",
24
+ "cli"
25
+ ],
26
+ "author": "Topos Labs <hello@toposlabs.ai>",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/Topos-Labs/infiniloom.git",
31
+ "directory": "packages/infiniloom"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/Topos-Labs/infiniloom/issues"
35
+ },
36
+ "homepage": "https://toposlabs.ai/infiniloom/",
37
+ "engines": {
38
+ "node": ">=16"
39
+ },
40
+ "os": [
41
+ "darwin",
42
+ "linux",
43
+ "win32"
44
+ ],
45
+ "cpu": [
46
+ "x64",
47
+ "arm64"
48
+ ],
49
+ "publishConfig": {
50
+ "registry": "https://registry.npmjs.org/",
51
+ "access": "public"
52
+ }
53
+ }