cruma 0.0.0 → 1.0.14
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 +3 -6
- package/bin/cruma.js +4 -9
- package/lib/launcher.js +64 -0
- package/package.json +18 -8
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cruma
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This `0.0.0` release only reserves the package name. It does not download or run anything: running it prints install instructions and exits. The real npm distribution of the `cruma` agent, which will make `npx cruma proxy http 3000` work, is coming soon.
|
|
6
|
-
|
|
7
|
-
Until then, install the agent with Homebrew (`brew install --cask umbra-yurei/brew/cruma` on macOS, `brew install umbra-yurei/brew/cruma` on Linux) or from the Microsoft Store. See https://cruma.io.
|
|
3
|
+
Install and run the Cruma tunnel agent with `npx -y cruma proxy http 3000` or
|
|
4
|
+
`cruma mcp`.
|
package/bin/cruma.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
" Linux: brew install umbra-yurei/brew/cruma",
|
|
7
|
-
" Windows: Microsoft Store (search \"Cruma\")",
|
|
8
|
-
"More: https://cruma.io",
|
|
9
|
-
].join("\n"));
|
|
10
|
-
process.exit(1);
|
|
2
|
+
|
|
3
|
+
import { run } from "../lib/launcher.js";
|
|
4
|
+
|
|
5
|
+
run(process.argv.slice(2));
|
package/lib/launcher.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const LAUNCHER_MANIFEST = require("../package.json");
|
|
7
|
+
|
|
8
|
+
export function platformKey(platform, architecture) {
|
|
9
|
+
return `${platform}-${architecture}`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function selectPackage(platform, architecture, optionalDependencies = LAUNCHER_MANIFEST.optionalDependencies) {
|
|
13
|
+
const packageName = `@cruma-io/cli-${platformKey(platform, architecture)}`;
|
|
14
|
+
|
|
15
|
+
if (optionalDependencies[packageName] === undefined) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
`Cruma does not support ${platform}/${architecture}. Supported platforms: ${Object.keys(optionalDependencies).map((dependency) => dependency.replace("@cruma-io/cli-", "")).join(", ")}.`
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return packageName;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function binaryPath(platform, architecture) {
|
|
25
|
+
const packageName = selectPackage(platform, architecture);
|
|
26
|
+
let manifestPath;
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
manifestPath = require.resolve(`${packageName}/package.json`);
|
|
30
|
+
} catch {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`The ${packageName} package is not installed for ${platform}/${architecture}. Reinstall cruma with npm.`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const manifest = require(manifestPath);
|
|
37
|
+
return join(dirname(manifestPath), manifest.crumaBinary);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function run(argumentsToForward, environment = process.env) {
|
|
41
|
+
let executable;
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
executable = binaryPath(process.platform, process.arch);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error(`cruma: ${error.message}`);
|
|
47
|
+
process.exitCode = 1;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const result = spawnSync(executable, argumentsToForward, {
|
|
52
|
+
env: environment,
|
|
53
|
+
stdio: "inherit"
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
if (result.error !== undefined) {
|
|
57
|
+
console.error(`cruma: unable to start bundled agent: ${result.error.message}`);
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
} else if (result.signal !== null) {
|
|
60
|
+
process.kill(process.pid, result.signal);
|
|
61
|
+
} else {
|
|
62
|
+
process.exitCode = result.status ?? 1;
|
|
63
|
+
}
|
|
64
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cruma",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"license": "
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
3
|
+
"version": "1.0.14",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Cruma tunnel agent",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"bin": {
|
|
8
|
+
"cruma": "bin/cruma.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"lib",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"optionalDependencies": {
|
|
16
|
+
"@cruma-io/cli-darwin-arm64": "1.0.14",
|
|
17
|
+
"@cruma-io/cli-linux-arm64": "1.0.14",
|
|
18
|
+
"@cruma-io/cli-linux-x64": "1.0.14",
|
|
19
|
+
"@cruma-io/cli-win32-x64": "1.0.14"
|
|
20
|
+
}
|
|
11
21
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Cruma
|
|
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.
|