@horon-ai/horon 0.0.0 → 0.1.17

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 ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jeremy Huang
4
+ Copyright (c) 2026 horon-ai
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,52 @@
1
- # @horon-ai/horon
1
+ # `@horon-ai/horon`
2
2
 
3
- Placeholder `0.0.0` that reserves this name for npm trusted publishing.
4
- It contains no code. Real versions are published from github.com/horon-ai/agent.
3
+ The Horon CLI: an autonomous agent runtime with a terminal client.
4
+
5
+ > **Not published yet.** The registry names are reserved with empty `0.0.0`
6
+ > placeholders, so `npm install -g @horon-ai/horon` currently installs a launcher
7
+ > with no runtime behind it. Until publishing is enabled, install from the
8
+ > release installer in `docs/release/INSTALL.md`, the container image
9
+ > `ghcr.io/horon-ai/agent`, or a source checkout.
10
+
11
+ ```sh
12
+ npm install -g @horon-ai/horon
13
+ horon --version
14
+ horon # starts the terminal client on a TTY
15
+ ```
16
+
17
+ The `horon` and `hrn` commands are the same launcher. `horon` with no arguments
18
+ opens the terminal client; every other subcommand runs the agent without one
19
+ (`horon --help` lists them). `HORON_NO_TUI=1` skips the client on a TTY and
20
+ prints the reason instead.
21
+
22
+ ## How the install works
23
+
24
+ This package holds no binaries. It depends optionally on one package per
25
+ platform and runs the one that matches the machine:
26
+
27
+ | Package | Platform |
28
+ | --- | --- |
29
+ | `@horon-ai/horon-linux-x64` | Linux x86_64 |
30
+ | `@horon-ai/horon-linux-arm64` | Linux aarch64 |
31
+ | `@horon-ai/horon-darwin-x64` | macOS Intel |
32
+ | `@horon-ai/horon-darwin-arm64` | macOS Apple Silicon |
33
+ | `@horon-ai/horon-win32-x64` | Windows x86_64 |
34
+ | `@horon-ai/horon-win32-arm64` | Windows ARM64 |
35
+
36
+ Optional dependencies are how npm expresses a platform-specific package, so a
37
+ global install only downloads the matching one. If npm was run with
38
+ `--omit=optional`, or the platform is not in the table, the launcher exits 1 and
39
+ names the missing package; reinstall with `npm install -g --include=optional
40
+ @horon-ai/horon`.
41
+
42
+ The launcher sets `HORON_AGENT_NO_AUTO_UPDATE=1` for the binary it starts. The
43
+ npm package pins one release for both the agent and `horon-tui`, and the
44
+ binary's own updater would replace them with a different build.
45
+
46
+ ## Not a Node library
47
+
48
+ Nothing here is importable API. The CLI is the Rust `horon-agent` and
49
+ `horon-tui` binaries; this package only finds and starts them.
50
+
51
+ Releases and the full documentation live at
52
+ [github.com/horon-ai/agent](https://github.com/horon-ai/agent).
package/bin/horon.js ADDED
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ // Launch the Horon CLI installed through npm.
3
+ //
4
+ // Each supported platform ships its binaries in its own package, so this
5
+ // launcher only picks the right package, forwards the arguments and
6
+ // environment, and hands the terminal to the child. No CLI behaviour lives
7
+ // here: the headless agent and the terminal client are the Rust binaries.
8
+ "use strict";
9
+
10
+ const path = require("node:path");
11
+ const { spawnSync } = require("node:child_process");
12
+
13
+ // Platform key -> npm package that carries that platform's binaries.
14
+ const PACKAGES = {
15
+ "linux-x64": "@horon-ai/horon-linux-x64",
16
+ "linux-arm64": "@horon-ai/horon-linux-arm64",
17
+ "darwin-x64": "@horon-ai/horon-darwin-x64",
18
+ "darwin-arm64": "@horon-ai/horon-darwin-arm64",
19
+ "win32-x64": "@horon-ai/horon-win32-x64",
20
+ "win32-arm64": "@horon-ai/horon-win32-arm64",
21
+ };
22
+
23
+ // The npm install cannot fall back to a source build, so a missing optional
24
+ // dependency is a reinstall with optional dependencies enabled, not a crash.
25
+ const INSTALL_HINT =
26
+ "reinstall with optional dependencies enabled: npm install -g --include=optional @horon-ai/horon";
27
+
28
+ function platformKey(platform = process.platform, arch = process.arch) {
29
+ return `${platform}-${arch}`;
30
+ }
31
+
32
+ function entryName(platform) {
33
+ return platform === "win32" ? "horon-agent.exe" : "horon-agent";
34
+ }
35
+
36
+ // Absolute path of the CLI binary inside the platform package. The platform
37
+ // packages declare no `exports` map, so resolving their package.json yields the
38
+ // directory npm installed them into.
39
+ function resolveEntry(platform, arch) {
40
+ const name = PACKAGES[platformKey(platform, arch)];
41
+ if (name === undefined) {
42
+ return undefined;
43
+ }
44
+ return path.join(path.dirname(require.resolve(`${name}/package.json`)), "bin", entryName(platform));
45
+ }
46
+
47
+ function fail(message) {
48
+ process.stderr.write(`horon: ${message}\n`);
49
+ return 1;
50
+ }
51
+
52
+ function main(argv = process.argv.slice(2), platform = process.platform, arch = process.arch) {
53
+ const key = platformKey(platform, arch);
54
+ const name = PACKAGES[key];
55
+ if (name === undefined) {
56
+ return fail(
57
+ `${key} is not a supported platform. Supported: ${Object.keys(PACKAGES).join(", ")}. ${INSTALL_HINT}`,
58
+ );
59
+ }
60
+
61
+ let entry;
62
+ try {
63
+ entry = resolveEntry(platform, arch);
64
+ } catch (error) {
65
+ if (error.code !== "MODULE_NOT_FOUND") {
66
+ throw error;
67
+ }
68
+ return fail(`the platform package ${name} is not installed. ${INSTALL_HINT}`);
69
+ }
70
+
71
+ // The npm package pins a version and ships `horon-tui` beside the agent, and
72
+ // the binary's own updater would replace both with a different release.
73
+ const env = { ...process.env, HORON_AGENT_NO_AUTO_UPDATE: "1" };
74
+
75
+ // The child owns the terminal while it runs. Ignoring the signals here keeps
76
+ // an interrupt from killing the wrapper before the CLI can handle it.
77
+ const ignore = () => {};
78
+ process.on("SIGINT", ignore);
79
+ process.on("SIGTERM", ignore);
80
+ const result = spawnSync(entry, argv, { stdio: "inherit", env });
81
+ process.removeListener("SIGINT", ignore);
82
+ process.removeListener("SIGTERM", ignore);
83
+
84
+ if (result.error) {
85
+ return fail(`could not start ${entry} from ${name}: ${result.error.message}`);
86
+ }
87
+ if (result.signal) {
88
+ process.kill(process.pid, result.signal);
89
+ return 1;
90
+ }
91
+ return result.status === null ? 1 : result.status;
92
+ }
93
+
94
+ module.exports = { PACKAGES, INSTALL_HINT, platformKey, entryName, resolveEntry, main };
95
+
96
+ if (require.main === module) {
97
+ process.exitCode = main();
98
+ }
package/package.json CHANGED
@@ -1,16 +1,33 @@
1
1
  {
2
2
  "name": "@horon-ai/horon",
3
- "version": "0.0.0",
4
- "description": "horon CLI (horon, hrn) — placeholder that reserves the name; real releases ship the native binaries through per-platform packages",
3
+ "version": "0.1.17",
4
+ "description": "Horon CLI: the autonomous agent runtime and its terminal client",
5
5
  "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/horon-ai/agent.git"
6
+ "bin": {
7
+ "horon": "bin/horon.js",
8
+ "hrn": "bin/horon.js"
9
9
  },
10
- "homepage": "https://github.com/horon-ai/agent",
11
10
  "files": [
11
+ "bin",
12
+ "LICENSE",
12
13
  "README.md"
13
14
  ],
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/horon-ai/agent.git",
21
+ "directory": "packages/npm/horon"
22
+ },
23
+ "optionalDependencies": {
24
+ "@horon-ai/horon-linux-x64": "0.1.17",
25
+ "@horon-ai/horon-linux-arm64": "0.1.17",
26
+ "@horon-ai/horon-darwin-x64": "0.1.17",
27
+ "@horon-ai/horon-darwin-arm64": "0.1.17",
28
+ "@horon-ai/horon-win32-x64": "0.1.17",
29
+ "@horon-ai/horon-win32-arm64": "0.1.17"
30
+ },
14
31
  "publishConfig": {
15
32
  "access": "public"
16
33
  }