neosh 0.0.0 → 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.
Files changed (3) hide show
  1. package/README.md +32 -15
  2. package/bin/neosh.js +66 -0
  3. package/package.json +27 -5
package/README.md CHANGED
@@ -1,29 +1,46 @@
1
1
  # neosh
2
2
 
3
- This npm package is a **name reservation**. It installs nothing.
3
+ **Neovim for controlling AI agents.** A terminal workspace where every feature is a plugin.
4
4
 
5
- neosh is a terminal-first agent workspace, and it is a Rust binary rather than a Node program.
6
- Install it one of these ways:
5
+ ```sh
6
+ npm install -g neosh
7
+ neosh
8
+ ```
9
+
10
+ No API key needed to start — an existing `claude` login works as is.
11
+
12
+ This package is a launcher. The binary itself arrives as one of four platform packages
13
+ (`@neosh/cli-darwin-arm64` and siblings), and npm installs only the one that runs on your machine.
14
+ There is no `postinstall` download, so `--ignore-scripts` and offline caches both work.
15
+
16
+ macOS and Linux only: the workspace talks to its terminals over a Unix socket, so there is nothing
17
+ to ship for Windows yet.
18
+
19
+ ## Other ways in
7
20
 
8
21
  ```sh
9
22
  brew install neoswarm/tap/neosh # macOS and Linux
10
23
  cargo install neosh # from source, needs a Rust toolchain
24
+ curl -fsSL https://neoswarm.dev/install.sh | sh
11
25
  ```
12
26
 
13
- …or take a prebuilt binary from [the releases page](https://github.com/neoswarm/neosh/releases).
27
+ Prebuilt binaries are on [the releases page](https://github.com/neoswarm/neosh/releases).
14
28
 
15
- The npm packages that *are* real are the plugin ones — `@neosh/api` is what a plugin author writes
16
- against:
29
+ ## What it is
17
30
 
18
- ```sh
19
- npm install --save-dev @neosh/api
20
- ```
31
+ The workspace is a process and your terminals are viewers of it. Each terminal is somewhere in the
32
+ workspace its own conversation, scroll and panels — while the turns are shared, so closing one
33
+ does not stop the work and `neosh` puts you back where you were.
34
+
35
+ The thesis is that extensibility is the product: every capability ships on the same public API a
36
+ third-party plugin author would use, and the sidebar, the model switcher, the palette, git and the
37
+ approval prompts are all ordinary plugins written against exactly that surface. If you can see it,
38
+ a plugin can replace it.
39
+
40
+ Writing one starts with [`@neosh/api`](https://www.npmjs.com/package/@neosh/api).
21
41
 
22
- Everything else lives at <https://github.com/neoswarm/neosh>.
42
+ Documentation: <https://github.com/neoswarm/neosh>.
23
43
 
24
- ## Why is this here?
44
+ ## Licence
25
45
 
26
- Two reasons. It keeps the name pointing at the real project rather than at whatever someone else
27
- publishes under it. And npm cannot attach a trusted publisher to a package that does not exist yet,
28
- so a package has to be created before its releases can be tokenless — this one is created and then
29
- left alone.
46
+ MIT.
package/bin/neosh.js ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // The binary lives in a platform package — `@neosh/cli-darwin-arm64` and its three siblings — each
5
+ // declaring `os` and `cpu`, so npm installs exactly the one that runs here and skips the rest. This
6
+ // file is the `bin` npm puts on PATH, and all it does is find that binary and become it.
7
+ //
8
+ // No `postinstall` download, deliberately: a script that fetches at install time fails closed under
9
+ // `--ignore-scripts`, which is the default in an increasing number of CI setups and the first thing
10
+ // a security review turns on. An optional dependency is resolved by npm itself, offline caches
11
+ // work, and a lockfile pins the binary the way it pins everything else.
12
+
13
+ const { spawn } = require("node:child_process");
14
+
15
+ const TARGETS = {
16
+ "darwin arm64": "@neosh/cli-darwin-arm64",
17
+ "darwin x64": "@neosh/cli-darwin-x64",
18
+ "linux x64": "@neosh/cli-linux-x64",
19
+ "linux arm64": "@neosh/cli-linux-arm64",
20
+ };
21
+
22
+ const key = `${process.platform} ${process.arch}`;
23
+ const pkg = TARGETS[key];
24
+
25
+ if (!pkg) {
26
+ // Windows lands here, and says why rather than looking broken: the workspace talks to its
27
+ // terminals over a Unix socket, so there is no binary to have installed.
28
+ const what = process.platform === "win32" ? "Windows" : key;
29
+ console.error(`neosh: no prebuilt binary for ${what}.`);
30
+ console.error("neosh runs on macOS and Linux. See https://github.com/neoswarm/neosh");
31
+ process.exit(1);
32
+ }
33
+
34
+ let binary;
35
+ try {
36
+ binary = require.resolve(`${pkg}/bin/neosh`);
37
+ } catch {
38
+ // npm skips an optional dependency whose install failed and carries on, so a missing platform
39
+ // package is an ordinary outcome rather than an impossible one — and the fix is a command.
40
+ console.error(`neosh: the ${pkg} package is missing.`);
41
+ console.error("Reinstall with `npm install -g neosh`, or take a binary from");
42
+ console.error("https://github.com/neoswarm/neosh/releases");
43
+ process.exit(1);
44
+ }
45
+
46
+ // `spawn` with inherited stdio rather than `spawnSync`: neosh is a full-screen terminal program
47
+ // that wants the tty, and it has signals to receive — `^C` has to reach the agent, not this shim.
48
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
49
+
50
+ // Forward the signals a terminal sends, so `^C` and a `kill` both land on the real process. The
51
+ // shim staying alive until the child is gone is what makes `neosh` in a script behave like neosh.
52
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT"]) {
53
+ process.on(signal, () => child.kill(signal));
54
+ }
55
+
56
+ child.on("error", (err) => {
57
+ console.error(`neosh: could not start ${binary}: ${err.message}`);
58
+ process.exit(1);
59
+ });
60
+
61
+ child.on("exit", (code, signal) => {
62
+ // A process killed by a signal did not exit with a code, and reporting 0 there would tell a
63
+ // shell the run succeeded. 128 + n is what a shell reports for exactly this.
64
+ if (signal) process.exit(128 + (require("node:os").constants.signals[signal] ?? 0));
65
+ process.exit(code ?? 0);
66
+ });
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "neosh",
3
- "version": "0.0.0",
4
- "description": "Reserved for neosh, a terminal-first agent workspace. neosh is a Rust binary \u2014 install it from https://github.com/neoswarm/neosh/releases, `brew install neoswarm/tap/neosh`, or `cargo install neosh`. This package is a name reservation and installs nothing.",
3
+ "version": "0.3.0",
4
+ "description": "Neovim for controlling AI agents. A terminal workspace where every feature is a plugin.",
5
5
  "license": "MIT",
6
+ "bin": {
7
+ "neosh": "bin/neosh.js"
8
+ },
6
9
  "keywords": [
7
- "neosh"
10
+ "neosh",
11
+ "agent",
12
+ "tui",
13
+ "ai",
14
+ "terminal"
8
15
  ],
9
16
  "homepage": "https://github.com/neoswarm/neosh",
10
17
  "repository": {
@@ -12,7 +19,22 @@
12
19
  "url": "git+https://github.com/neoswarm/neosh.git",
13
20
  "directory": "npm/neosh"
14
21
  },
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "os": [
26
+ "darwin",
27
+ "linux"
28
+ ],
15
29
  "files": [
16
- "README.md"
17
- ]
30
+ "bin",
31
+ "README.md",
32
+ "!._*"
33
+ ],
34
+ "optionalDependencies": {
35
+ "@neosh/cli-darwin-arm64": "0.3.0",
36
+ "@neosh/cli-darwin-x64": "0.3.0",
37
+ "@neosh/cli-linux-x64": "0.3.0",
38
+ "@neosh/cli-linux-arm64": "0.3.0"
39
+ }
18
40
  }