@omicverse/omicos 0.2.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.
Files changed (2) hide show
  1. package/bin/omicos.js +59 -0
  2. package/package.json +29 -0
package/bin/omicos.js ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ // Thin launcher for the omicos native binary. Resolves the per-platform
3
+ // package (@omicverse/omicos-<os>-<cpu>) installed as an optionalDependency
4
+ // and execs its bundled binary. Mirrors the codex-cli pattern.
5
+ "use strict";
6
+
7
+ const { spawnSync } = require("node:child_process");
8
+
9
+ const PKG_BY_TRIPLE = {
10
+ "x86_64-unknown-linux-musl": "@omicverse/omicos-linux-x64",
11
+ "aarch64-unknown-linux-musl": "@omicverse/omicos-linux-arm64",
12
+ "x86_64-apple-darwin": "@omicverse/omicos-darwin-x64",
13
+ "aarch64-apple-darwin": "@omicverse/omicos-darwin-arm64",
14
+ "x86_64-pc-windows-msvc": "@omicverse/omicos-win32-x64",
15
+ "aarch64-pc-windows-msvc": "@omicverse/omicos-win32-arm64",
16
+ };
17
+
18
+ function targetTriple() {
19
+ const { platform, arch } = process;
20
+ if (platform === "linux" || platform === "android") {
21
+ if (arch === "x64") return "x86_64-unknown-linux-musl";
22
+ if (arch === "arm64") return "aarch64-unknown-linux-musl";
23
+ } else if (platform === "darwin") {
24
+ if (arch === "x64") return "x86_64-apple-darwin";
25
+ if (arch === "arm64") return "aarch64-apple-darwin";
26
+ } else if (platform === "win32") {
27
+ if (arch === "x64") return "x86_64-pc-windows-msvc";
28
+ if (arch === "arm64") return "aarch64-pc-windows-msvc";
29
+ }
30
+ return null;
31
+ }
32
+
33
+ const triple = targetTriple();
34
+ const pkg = triple && PKG_BY_TRIPLE[triple];
35
+ if (!pkg) {
36
+ console.error(
37
+ `omicos: unsupported platform ${process.platform}/${process.arch}`
38
+ );
39
+ process.exit(1);
40
+ }
41
+
42
+ const binName = process.platform === "win32" ? "omicos.exe" : "omicos";
43
+ let binPath;
44
+ try {
45
+ binPath = require.resolve(`${pkg}/bin/${binName}`);
46
+ } catch (_e) {
47
+ console.error(
48
+ `omicos: native package "${pkg}" is not installed.\n` +
49
+ `Reinstall to fetch it: npm install -g @omicverse/omicos`
50
+ );
51
+ process.exit(1);
52
+ }
53
+
54
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
55
+ if (result.error) {
56
+ console.error(`omicos: failed to launch native binary: ${result.error.message}`);
57
+ process.exit(1);
58
+ }
59
+ process.exit(result.status === null ? 1 : result.status);
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@omicverse/omicos",
3
+ "version": "0.2.1",
4
+ "description": "OmicOS — agentic omics-analysis runtime & CLI (omicos-core). Installs the matching native binary for your platform.",
5
+ "bin": {
6
+ "omicos": "bin/omicos.js"
7
+ },
8
+ "files": [
9
+ "bin"
10
+ ],
11
+ "engines": {
12
+ "node": ">=16"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/PrimorDecode/omicos-core.git"
17
+ },
18
+ "optionalDependencies": {
19
+ "@omicverse/omicos-linux-x64": "0.2.1",
20
+ "@omicverse/omicos-linux-arm64": "0.2.1",
21
+ "@omicverse/omicos-darwin-x64": "0.2.1",
22
+ "@omicverse/omicos-darwin-arm64": "0.2.1",
23
+ "@omicverse/omicos-win32-x64": "0.2.1",
24
+ "@omicverse/omicos-win32-arm64": "0.2.1"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ }
29
+ }