rebon 0.0.2 → 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 (3) hide show
  1. package/README.md +14 -11
  2. package/bin/rebon.js +54 -17
  3. package/package.json +5 -2
package/README.md CHANGED
@@ -1,23 +1,26 @@
1
1
  # rebon
2
2
 
3
- The full **Rebon** agent CLI is published as **[`@rebon/cli`](https://www.npmjs.com/package/@rebon/cli)**.
4
-
5
- Install it with:
3
+ The Rebon agent CLI — an agent for coding and more. Install it globally:
6
4
 
7
5
  ```sh
8
- npm install -g @rebon/cli@latest
6
+ npm install -g rebon
9
7
  ```
10
8
 
11
- Then run `rebon`.
9
+ Then run:
10
+
11
+ ```sh
12
+ rebon
13
+ ```
12
14
 
13
- ## About this package
15
+ ## What this installs
14
16
 
15
- This bare `rebon` package is currently a **placeholder** that reserves the
16
- name. In a future release it will become a thin wrapper that depends on
17
- `@rebon/cli` and forwards the `rebon` command, so that:
17
+ `rebon` is a thin wrapper around **[`@rebon/cli`](https://www.npmjs.com/package/@rebon/cli)**.
18
+ Installing `rebon` pulls in `@rebon/cli` plus the matching prebuilt binary for
19
+ your platform, and forwards the `rebon` command to it. You can also install the
20
+ scoped package directly if you prefer:
18
21
 
19
22
  ```sh
20
- npm install -g rebon
23
+ npm install -g @rebon/cli@latest
21
24
  ```
22
25
 
23
- installs the complete CLI. Until then, use `@rebon/cli` above.
26
+ Both give you the same `rebon` command.
package/bin/rebon.js CHANGED
@@ -1,21 +1,58 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
 
4
- // Placeholder launcher for the bare `rebon` package. The full Rebon agent CLI
5
- // ships as @rebon/cli; this package exists to hold the bare name and will be
6
- // converted into a thin wrapper that depends on @rebon/cli in a future release.
7
- const message = [
8
- "",
9
- " Rebon is published as @rebon/cli.",
10
- "",
11
- " Install the full agent CLI with:",
12
- "",
13
- " npm install -g @rebon/cli@latest",
14
- "",
15
- " (The bare `rebon` package is currently a placeholder; a future",
16
- " release will make it forward to @rebon/cli automatically.)",
17
- "",
18
- ].join("\n");
4
+ // `rebon` is a thin wrapper around @rebon/cli: it depends on @rebon/cli and
5
+ // forwards to its launcher, so `npm install -g rebon` gives the full CLI
6
+ // (@rebon/cli pulls in the matching prebuilt platform binary as an
7
+ // optionalDependency). Args, stdio, exit code and signals are passed through.
8
+ const path = require("path");
9
+ const { spawn } = require("child_process");
19
10
 
20
- console.log(message);
21
- process.exit(0);
11
+ function fail(message) {
12
+ console.error(`rebon: ${message}`);
13
+ process.exit(1);
14
+ }
15
+
16
+ let target;
17
+ try {
18
+ const pkgJsonPath = require.resolve("@rebon/cli/package.json", {
19
+ paths: [__dirname],
20
+ });
21
+ const pkg = require(pkgJsonPath);
22
+ const bin = pkg && pkg.bin;
23
+ const rel = typeof bin === "string" ? bin : bin && bin.rebon;
24
+ if (!rel) {
25
+ fail(
26
+ "@rebon/cli does not declare a rebon bin target. Reinstall: npm install -g rebon",
27
+ );
28
+ }
29
+ target = path.resolve(path.dirname(pkgJsonPath), rel);
30
+ } catch (error) {
31
+ fail(
32
+ `could not locate @rebon/cli. Reinstall with 'npm install -g rebon' ` +
33
+ `(installing with --omit=optional breaks it). (${error.message})`,
34
+ );
35
+ }
36
+
37
+ const child = spawn(process.execPath, [target, ...process.argv.slice(2)], {
38
+ stdio: "inherit",
39
+ windowsHide: false,
40
+ });
41
+
42
+ child.on("error", (error) => {
43
+ fail(
44
+ `failed to start @rebon/cli at ${target}. Reinstall with 'npm install -g rebon'. (${error.message})`,
45
+ );
46
+ });
47
+
48
+ child.on("exit", (code, signal) => {
49
+ if (signal) {
50
+ try {
51
+ process.kill(process.pid, signal);
52
+ } catch (_) {
53
+ process.exit(1);
54
+ }
55
+ return;
56
+ }
57
+ process.exit(code === null ? 1 : code);
58
+ });
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "rebon",
3
- "version": "0.0.2",
4
- "description": "Rebon agent CLI — install @rebon/cli for the full tool. This bare package will become a thin wrapper around it.",
3
+ "version": "0.2.1",
4
+ "description": "Rebon agent CLI for coding and more. Installs @rebon/cli.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "homepage": "https://github.com/Quorafind/Rebon-Releases",
7
7
  "keywords": ["rebon", "cli", "agent", "coding-agent", "ai"],
8
8
  "bin": {
9
9
  "rebon": "bin/rebon.js"
10
10
  },
11
+ "dependencies": {
12
+ "@rebon/cli": "^0.2.1"
13
+ },
11
14
  "files": [
12
15
  "bin",
13
16
  "README.md"