@human-agent/rago 0.3.0 → 0.5.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 CHANGED
@@ -1,21 +1,53 @@
1
- # RAGO Agent — native MCP for local-first retrieval
2
-
3
- Run the same npm package on supported Windows, macOS and Linux machines:
4
-
5
- ```sh
6
- npx --yes @human-agent/rago
7
- ```
8
-
9
- The command starts the RAGO native Rust Agent on `127.0.0.1:47743` and prints a one-time local pairing code. No RAGO account or internet connection is needed **after the package has been installed**. Folder permissions are granted through the native on-device picker, not by arbitrary MCP callers or webpage parameters.
10
-
11
- For a local MCP client that supports stdio, configure:
12
-
13
- ```json
14
- {"command":"npx","args":["--yes","@human-agent/rago","--mcp-stdio"]}
15
- ```
16
-
17
- On first use after upgrading from a pre-identity RAGO QA bundle, reapprove existing folders through the on-device picker; old grants fail closed and their indexes are not reused.\n\nThe MCP server offers separate BM25, FractalRAG and ripgrep search tools; the host LLM chooses a tool. Each request names an actual device and native absolute path; the Rust Agent restricts access to human-approved folders and their requested subtrees. The relay and Siglet login are optional and are not required for local operation.
18
-
19
- The package embeds native RAGO, FractalRAG and ripgrep binaries for `win32-x64`, `darwin-x64`, `darwin-arm64`, `linux-x64` and `linux-arm64`. FractalRAG and ripgrep third-party license notices are included in `notices/`. There are no install-time download/build scripts. Install or cache this package first if you intend to work offline.
20
-
21
- For an interactive version check, run `npx --yes @human-agent/rago --check-bundle`. To configure a local browser session, start the Agent normally and use the one-time pairing code in the RAGO static frontend. The code is local-only and must not be shared with a remote website.
1
+ # RAGO Agent — native MCP for local-first retrieval
2
+
3
+ Use the same npm command on supported Windows, macOS and Linux machines. npm installs the small loader and only the native package for your OS and CPU. Node.js 20 or later is required.
4
+
5
+ ## Local setup — no account or browser pairing
6
+
7
+ ```sh
8
+ npx --yes @human-agent/rago
9
+ ```
10
+
11
+ Type setup in the terminal. In the native setup, authorize folders with the operating system's folder picker, index or revoke them, and explicitly enable Local MCP. No caller-supplied filesystem path can grant access. The first package download needs internet; the installed or cached Agent works offline.
12
+
13
+ Folder authorization requires the native desktop folder picker. If no desktop display is available, folder selection fails without blocking the Agent. A browser or MCP caller cannot supply a path to create a Folder Grant.
14
+
15
+ Keep RAGO running. Connect a local HTTP MCP client to `http://127.0.0.1:47743/mcp` with the `Authorization: Bearer <local MCP bearer>` header printed in the terminal. The bearer is separate from the browser pairing code and regenerated on Agent restart. The HTTP endpoint is loopback-only, uses JSON POST requests and shares the same authorized folders and tools as stdio.
16
+
17
+ If your MCP client instead launches its own stdio process, configure:
18
+
19
+ ```json
20
+ {"command":"npx","args":["--yes","@human-agent/rago","--mcp-stdio"]}
21
+ ```
22
+
23
+ If your Windows MCP client requires a command wrapper for npx.cmd, use its documented Windows stdio launch configuration. The RAGO Agent exposes separate BM25, FractalRAG and ripgrep retrieval tools. Each request names an actual device and native absolute path; the Rust Agent restricts retrieval to human-approved folders and their requested subtrees.
24
+
25
+ ## Optional browser management
26
+
27
+ ```sh
28
+ npx --yes @human-agent/rago
29
+ ```
30
+
31
+ The default HTTP Agent starts its loopback management endpoint at 127.0.0.1:47743 and prints a one-time pairing code. Pair only to manage your local Agent with the trusted RAGO portal. Never share the code with an untrusted site. Pairing is not required by either local MCP transport.
32
+
33
+ ## Optional local semantic search
34
+
35
+ Lexical search is the default and works without an embedding model. To enable on-device semantic retrieval, pair the local Agent with the trusted portal, open Settings, and choose Download & Enable under Semantic Search. Alternatively, choose S in the native terminal setup. Review the [Gemma terms](https://ai.google.dev/gemma/terms) and [prohibited use policy](https://ai.google.dev/gemma/prohibited_use_policy) before consenting.
36
+
37
+ The model is the pinned EmbeddingGemma 300M ONNX Q4 revision; downloading its verified assets requires 218,727,651 bytes (about 218.7 MB), plus local cache and index space. RAGO does not download it automatically. After verification and indexing, semantic retrieval runs on the CPU without an embedding API; lexical search remains available. The portal shows preparation progress and folder readiness. Cancel or disable in Settings (or choose C in terminal setup) to stop preparation and return to lexical mode while retaining the downloaded model. After changing or reindexing folders, rebuild Semantic Search if Settings reports that an index is needed.
38
+
39
+ To preserve exact folder boundaries, a narrower subfolder request uses lexical retrieval rather than the broader semantic index. A semantic inference error also falls back to lexical retrieval; inspect the returned retrieval_mode and local status. PDF extraction reconstructs text from embedded glyphs and positions; scanned images without a text layer are not OCRed and may be skipped.
40
+
41
+ ## Optional RAGO Online
42
+
43
+ ```sh
44
+ npx --yes @human-agent/rago@latest --remote
45
+ ```
46
+
47
+ Local HTTP remains available; this option additionally connects to RAGO Online. The Agent identifies the device itself, opens the RAGO verification page for explicit account-owner approval, and receives its credential directly. Sign in through Siglet if needed. Never approve a device unless you initiated the request and its verification code matches the terminal. No manual Device ID or device credential is needed. Later runs reuse the local identity and saved authorization; revocation requires renewed explicit approval.
48
+
49
+ Keep the Remote Agent running while an authorized host searches. Approve folders and enable MCP locally first, then authorize the host independently in Remote Devices. The remote MCP endpoint is https://rago.siglet.app/mcp. Remote requires a compatible deployed RAGO portal. Local grants and indexes remain on the device and are independent of the relay and account.
50
+
51
+ The loader uses exact-version optional dependencies for win32-x64, darwin-x64, darwin-arm64, linux-x64 and linux-arm64. Each native package contains only rago, frag and rg for its target, plus integrity metadata and notices. npm performs native selection; no custom download or install script is used. Keep optional dependencies enabled. Bundle integrity is checked automatically at startup. To verify explicitly, run npx --yes @human-agent/rago --check-bundle.
52
+
53
+ Run `npx --yes @human-agent/rago --help` for the full command and transport selection.
package/bin/frag.cjs CHANGED
File without changes
package/bin/launch.cjs CHANGED
@@ -1,44 +1,83 @@
1
- "use strict";
2
- const { spawn } = require("node:child_process");
3
- const { existsSync } = require("node:fs");
4
- const { join } = require("node:path");
5
-
6
- const targets = new Set(["win32-x64", "darwin-x64", "darwin-arm64", "linux-x64", "linux-arm64"]);
7
-
8
- function binaryPath(command, platform = process.platform, arch = process.arch) {
9
- const target = platform + "-" + arch;
10
- if (!targets.has(target)) {
11
- throw new Error("Unsupported RAGO platform: " + target);
12
- }
13
- const executable = command + (platform === "win32" ? ".exe" : "");
14
- return join(__dirname, "..", "prebuilt", target, executable);
15
- }
16
-
17
- function launch(command) {
18
- try {
19
- const executable = binaryPath(command);
20
- if (!existsSync(executable)) {
21
- throw new Error("Native RAGO bundle is missing: " + process.platform + "-" + process.arch);
22
- }
23
- const child = spawn(executable, process.argv.slice(2), { stdio: "inherit", windowsHide: true });
24
- child.on("error", (error) => {
25
- process.stderr.write("RAGO launch failed: " + error.message + "\n");
26
- process.exitCode = 1;
27
- });
28
- child.on("exit", (code, signal) => {
29
- process.exitCode = code === null ? (signal ? 1 : 0) : code;
30
- });
31
- for (const signal of ["SIGINT", "SIGTERM"]) {
32
- process.on(signal, () => {
33
- if (!child.killed) {
34
- child.kill(signal);
35
- }
36
- });
37
- }
38
- } catch (error) {
39
- process.stderr.write("RAGO: " + error.message + "\n");
40
- process.exitCode = 1;
41
- }
42
- }
43
-
44
- module.exports = { binaryPath, launch };
1
+ "use strict";
2
+ const { spawn } = require("node:child_process");
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+ const crypto = require("node:crypto");
6
+
7
+ const targets = new Set(["win32-x64", "darwin-x64", "darwin-arm64", "linux-x64", "linux-arm64"]);
8
+ const commands = { rago: "rago", frag: "frag", ripgrep: "rg" };
9
+
10
+ function targetPackage(platform = process.platform, arch = process.arch) {
11
+ const target = platform + "-" + arch;
12
+ if (!targets.has(target)) throw new Error("Unsupported RAGO platform: " + target);
13
+ return "@human-agent/rago-" + target;
14
+ }
15
+
16
+ function digest(bytes) {
17
+ return crypto.createHash("sha256").update(bytes).digest("hex");
18
+ }
19
+ function regular(file) {
20
+ const st = fs.lstatSync(file);
21
+ if (!st.isFile() || st.isSymbolicLink() || !st.size) throw new Error("Invalid RAGO bundle file: " + path.basename(file));
22
+ return fs.readFileSync(file);
23
+ }
24
+ function binaryPath(command, platform = process.platform, arch = process.arch) {
25
+ if (command !== "rago" && command !== "frag") throw new Error("Unknown RAGO CLI");
26
+ const target = platform + "-" + arch;
27
+ const name = targetPackage(platform, arch);
28
+ const loader = require("../package.json");
29
+ const pins = require("../pins.json");
30
+ if (pins.schema !== 1 || pins.version !== loader.version || loader.optionalDependencies?.[name] !== loader.version) {
31
+ throw new Error("Invalid RAGO loader version or integrity pins");
32
+ }
33
+ let metadata;
34
+ try {
35
+ metadata = require.resolve(name + "/package.json");
36
+ } catch {
37
+ throw new Error("Native RAGO package missing: " + name + "@" + loader.version + ". Reinstall with optional dependencies enabled.");
38
+ }
39
+ const root = path.dirname(metadata);
40
+ const pkg = JSON.parse(regular(metadata).toString("utf8"));
41
+ if (pkg.name !== name || pkg.version !== loader.version
42
+ || JSON.stringify(pkg.os) !== JSON.stringify([platform])
43
+ || JSON.stringify(pkg.cpu) !== JSON.stringify([arch])) {
44
+ throw new Error("Native RAGO package identity mismatch: " + target);
45
+ }
46
+ const manifestBytes = regular(path.join(root, "bundle.json"));
47
+ if (digest(manifestBytes) !== pins.targets?.[target]) throw new Error("Native RAGO manifest integrity mismatch: " + target);
48
+ const manifest = JSON.parse(manifestBytes.toString("utf8"));
49
+ if (manifest.schema !== 1 || manifest.target !== target) throw new Error("Native RAGO manifest target mismatch");
50
+ const suffix = platform === "win32" ? ".exe" : "";
51
+ for (const [key, binary] of Object.entries(commands)) {
52
+ if (digest(regular(path.join(root, binary + suffix))) !== manifest[key]?.sha256) {
53
+ throw new Error("Native RAGO executable integrity mismatch: " + binary);
54
+ }
55
+ }
56
+ return path.join(root, command + suffix);
57
+ }
58
+
59
+ function launch(command) {
60
+ try {
61
+ const executable = binaryPath(command);
62
+ const child = spawn(executable, process.argv.slice(2), { stdio: "inherit", windowsHide: true });
63
+ child.on("error", (error) => {
64
+ process.stderr.write("RAGO launch failed: " + error.message + "\n");
65
+ process.exitCode = 1;
66
+ });
67
+ child.on("exit", (code, signal) => {
68
+ process.exitCode = code === null ? (signal ? 1 : 0) : code;
69
+ });
70
+ for (const signal of ["SIGINT", "SIGTERM"]) {
71
+ process.on(signal, () => {
72
+ if (!child.killed) {
73
+ child.kill(signal);
74
+ }
75
+ });
76
+ }
77
+ } catch (error) {
78
+ process.stderr.write("RAGO: " + error.message + "\n");
79
+ process.exitCode = 1;
80
+ }
81
+ }
82
+
83
+ module.exports = { targetPackage, binaryPath, launch };
package/bin/rago.cjs CHANGED
File without changes
package/package.json CHANGED
@@ -1,22 +1,24 @@
1
1
  {
2
2
  "name": "@human-agent/rago",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "RAGO native MCP and local-first retrieval for Windows, macOS and Linux",
5
5
  "bin": {
6
6
  "rago": "bin/rago.cjs",
7
- "fractalrag": "bin/fractalrag.cjs",
8
7
  "frag": "bin/frag.cjs"
9
8
  },
10
9
  "files": [
11
10
  "bin/*.cjs",
12
- "prebuilt/**",
13
- "notices/**",
11
+ "pins.json",
14
12
  "README.md"
15
13
  ],
16
- "scripts": {
17
- "prepack": "node scripts/verify.cjs"
18
- },
19
14
  "engines": {
20
15
  "node": ">=20"
16
+ },
17
+ "optionalDependencies": {
18
+ "@human-agent/rago-win32-x64": "0.5.0",
19
+ "@human-agent/rago-darwin-x64": "0.5.0",
20
+ "@human-agent/rago-darwin-arm64": "0.5.0",
21
+ "@human-agent/rago-linux-x64": "0.5.0",
22
+ "@human-agent/rago-linux-arm64": "0.5.0"
21
23
  }
22
24
  }
package/pins.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "schema": 1,
3
+ "version": "0.5.0",
4
+ "targets": {
5
+ "win32-x64": "c7c57df059742cd41fcd37946216bf25f71b6f5eb8e83d69050193c4e79c1b9f",
6
+ "darwin-x64": "3eaffb90b8d15f1c14254550e7647368d29372826407d326ae1d20dda51ba286",
7
+ "darwin-arm64": "d04e9a3f44d5d0f16b959bd10c971c0afb2e44550607c10efb80612198428cd5",
8
+ "linux-x64": "b3a9aec14d4dd99a0f03b35b4823a5898f4c5dedcaeec29f10754c5d37b2d174",
9
+ "linux-arm64": "8902b06094daa78028cd72c21d9a4cbd41b23452cc387eebc6802d6f25b0523a"
10
+ }
11
+ }
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- require("./launch.cjs").launch("fractalrag");
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 VDG Solutions
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Andrew Gallant
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,24 +0,0 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <http://unlicense.org/>
@@ -1,16 +0,0 @@
1
- {
2
- "schema": 1,
3
- "target": "darwin-arm64",
4
- "rago": {
5
- "sha256": "924e02f78a89bb5d86026e34c8249d7df0d13254e4bcd41fe603a66f426f9513"
6
- },
7
- "fractalrag": {
8
- "sha256": "4bbb122ecca0191530e1c5c696f0d4b8d73d40dbb4f25e3c10ff85ac1bac9501"
9
- },
10
- "frag": {
11
- "sha256": "2470521cb5a7f0da4c6e921b35c581f61e675ecd4f1af9f1ddaf1fe9492ea2a7"
12
- },
13
- "ripgrep": {
14
- "sha256": "d8335e316eb567660ea76eaabf1d827ea0092d8ec9bbcc85dd0b951fa0556029"
15
- }
16
- }
Binary file
Binary file
Binary file
Binary file
@@ -1,16 +0,0 @@
1
- {
2
- "schema": 1,
3
- "target": "darwin-x64",
4
- "rago": {
5
- "sha256": "c5df30a8d3d50dfab744d2c3831517b054614e71d0436eae92fcb7b1a8e185e8"
6
- },
7
- "fractalrag": {
8
- "sha256": "0b53396d38789ddbf65aefd69abbfcb1f6620dd50b988778ca02824a5b8d96bb"
9
- },
10
- "frag": {
11
- "sha256": "68019547bd4ce277de38941dbbb9d7cf53f9c9466044d9b36f429a156e62537e"
12
- },
13
- "ripgrep": {
14
- "sha256": "85c546cb08b1086610945a723bc27e5bb58a34ee928eaafb00ca78adef6596d7"
15
- }
16
- }
Binary file
Binary file
Binary file
Binary file
@@ -1,16 +0,0 @@
1
- {
2
- "schema": 1,
3
- "target": "linux-arm64",
4
- "rago": {
5
- "sha256": "ba1c1da36d2d4dc5f938a8b1688580d4becc333566d6f723601da0b952217710"
6
- },
7
- "fractalrag": {
8
- "sha256": "f9cdd7f5d6752965d3ff11a61815e418e2391d9f00669a2ba9b425f84fdcf898"
9
- },
10
- "frag": {
11
- "sha256": "64e3ab772a83bfaff1d6fb2cbbe4daae3525d68ea8c7989c527c15bd2396725f"
12
- },
13
- "ripgrep": {
14
- "sha256": "6f019a99b6fecc2b45c0d8b0dbbb243811d4c24fc7e1ed10949bbb07a6cdb69f"
15
- }
16
- }
Binary file
Binary file
Binary file
Binary file
@@ -1,16 +0,0 @@
1
- {
2
- "schema": 1,
3
- "target": "linux-x64",
4
- "rago": {
5
- "sha256": "24b9f88804404135e1635a7c5121a47797f56e92f330b9e0cdc5d3b0d6f06b17"
6
- },
7
- "fractalrag": {
8
- "sha256": "3f60820ded12c45fcd58876b632af0412ad5eef659bd342b953243effd3493ff"
9
- },
10
- "frag": {
11
- "sha256": "6f9e1f84021b68e8fb0ccc980fe68912491f1d3c8c1f46344f9669bed049dbed"
12
- },
13
- "ripgrep": {
14
- "sha256": "e960e58966965f212650aaa6ee330f505c954d5c7712b497e322ee4eda7030db"
15
- }
16
- }
Binary file
Binary file
Binary file
Binary file
@@ -1,16 +0,0 @@
1
- {
2
- "schema": 1,
3
- "target": "win32-x64",
4
- "rago": {
5
- "sha256": "a09531283f0949f8423f8f6a6d41e2c571632466bf60c71c61cfd4bf013ea596"
6
- },
7
- "fractalrag": {
8
- "sha256": "24bfc0eb18a3c060a2d44d3c203095200c6f90cde8254873b16929a2820c6356"
9
- },
10
- "frag": {
11
- "sha256": "ae824c5b4e91204c5dd0d0ce89cbbf0c479d25668da723a432408e432ca0e420"
12
- },
13
- "ripgrep": {
14
- "sha256": "723228522320d876e732e041a8525ea4f2e63bc056856f0d731b8742111716c4"
15
- }
16
- }
Binary file
Binary file
Binary file
Binary file