@jonaskahn/relo 0.1.4 → 0.1.5

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 +10 -14
  2. package/lib/install.mjs +44 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -16,19 +16,12 @@
16
16
 
17
17
  ## ▓ CONSOLE
18
18
 
19
- <div align="center">
20
-
21
- https://github.com/user-attachments/assets/cbda11c8-b60c-413b-8a08-03144dd06e7a
22
-
23
- <sub>Demo: using Relo in Codex</sub>
24
- </div>
25
-
26
- | | | |
27
- |------------------------------------------------------------------------------|------------------------------------------------------------------------|---------------------------------------------------------------------|
28
- | Dashboard | Connections | Groups |
29
- | <img src="https://github.com/user-attachments/assets/ba44719e-f176-4d02-9e92-10cf7055a6e8" alt="Dashboard" width="320"> | <img src="https://github.com/user-attachments/assets/b27d9948-1f30-4aac-a0f5-d98109c5522e" alt="Connections" width="320"> | <img src="https://github.com/user-attachments/assets/29ce8e23-925f-4d22-b571-a49d8bc70841" alt="Groups" width="320"> |
30
- | Agent Harness | Add agent | Usage |
31
- | <img src="https://github.com/user-attachments/assets/3e5bfe37-ad48-4c12-a32a-f4901f8f982a" alt="Agent Harness" width="320"> | <img src="https://github.com/user-attachments/assets/f4730cb7-7177-40c0-8d48-905dfde29ba3" alt="Add agent" width="320"> | <img src="https://github.com/user-attachments/assets/42f329be-4d1b-408c-bc8e-87a1237eccf6" alt="Usage" width="320"> |
19
+ | ➤ | ➤➤ | ➤➤➤ |
20
+ |-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
21
+ | Dashboard | Connections | Groups |
22
+ | <img src="https://github.com/user-attachments/assets/ba44719e-f176-4d02-9e92-10cf7055a6e8" alt="Dashboard" width="320"> | <img src="https://github.com/user-attachments/assets/b27d9948-1f30-4aac-a0f5-d98109c5522e" alt="Connections" width="320"> | <img src="https://github.com/user-attachments/assets/29ce8e23-925f-4d22-b571-a49d8bc70841" alt="Groups" width="320"> |
23
+ | Agent Harness | Add agent | Usage |
24
+ | <img src="https://github.com/user-attachments/assets/3e5bfe37-ad48-4c12-a32a-f4901f8f982a" alt="Agent Harness" width="320"> | <img src="https://github.com/user-attachments/assets/f4730cb7-7177-40c0-8d48-905dfde29ba3" alt="Add agent" width="320"> | <img src="https://github.com/user-attachments/assets/42f329be-4d1b-408c-bc8e-87a1237eccf6" alt="Usage" width="320"> |
32
25
 
33
26
  ## Install
34
27
 
@@ -39,6 +32,7 @@ npm i -g @jonaskahn/relo --foreground-scripts
39
32
  ```
40
33
 
41
34
  - Beta, Risk
35
+
42
36
  ```bash
43
37
  npm i -g @jonaskahn/relo@beta --foreground-scripts
44
38
  ```
@@ -77,15 +71,17 @@ something else is listening on port 10101
77
71
  ## Uninstall
78
72
 
79
73
  - Remove and Keep Data
74
+
80
75
  ```bash
81
76
  npm uninstall -g @jonaskahn/relo
82
77
  ```
78
+
83
79
  - Remove and Wipe Data
80
+
84
81
  ```bash
85
82
  relo uninstall --wipe
86
83
  ```
87
84
 
88
-
89
85
  ## Links
90
86
 
91
87
  [Source](https://github.com/jonaskahn/relo) · [Releases](https://github.com/jonaskahn/relo/releases) · [Docs](https://github.com/jonaskahn/relo#readme)
package/lib/install.mjs CHANGED
@@ -5,7 +5,9 @@
5
5
  // package put it there: two installs would fight over the name, the home
6
6
  // directory, and the ports. A relo running from this home is quiesced before
7
7
  // its binary is replaced -- its daemon is stopped and the ports it served
8
- // are freed -- and the install asks whether to start the new one.
8
+ // are freed -- and before the download the install asks whether to start the
9
+ // new one; the answers carry the rest of the run, so once the work begins it
10
+ // never waits on keys again.
9
11
  //
10
12
  // The binary always comes from a GitHub release: the one --relo-version names,
11
13
  // the one this package was published as when that is a prerelease, or the
@@ -151,6 +153,33 @@ try {
151
153
  version ? `v${version}` : 'latest release',
152
154
  `${asset.os} · ${asset.arch}`.toUpperCase()
153
155
  ]);
156
+ // The questions come first, install.sh's way: the preflight hears the
157
+ // choices while the screen is fresh, and the run the answers carry --
158
+ // conflict, download, install, start -- never waits on keys again. With
159
+ // no terminal to ask on nothing is asked or started: an automated
160
+ // install must not launch a daemon.
161
+ separator();
162
+ const labels = ['YES', 'NO'];
163
+ const startNow = interactive()
164
+ ? await askStart({
165
+ labels,
166
+ onQuestion: (at) => choices('START RELO AFTER INSTALL?', labels, at),
167
+ onAnswer: (value) => chosen('START RELO AFTER INSTALL?', value)
168
+ })
169
+ : 'unattended';
170
+ if (startNow !== 'yes' && startNow !== 'no') {
171
+ note('Running without prompts. Start later: relo daemon start');
172
+ }
173
+ // install.sh pairs the two: the login question only follows a yes on
174
+ // starting, so an install that starts nothing registers nothing.
175
+ let loginNow = 'no';
176
+ if (startNow === 'yes' && interactive()) {
177
+ loginNow = await askStart({
178
+ labels,
179
+ onQuestion: (at) => choices('START RELO AT LOGIN?', labels, at),
180
+ onAnswer: (value) => chosen('START RELO AT LOGIN?', value)
181
+ });
182
+ }
154
183
  step(label('CONFLICT'));
155
184
  // One binary answers the relo command now, whether it came from this
156
185
  // package or an installer, so a command this package did not install
@@ -182,17 +211,7 @@ try {
182
211
  done(`${label('CONFLICT')} no other relo install`);
183
212
 
184
213
  const destination = await fromRelease(tag, asset, startedAt);
185
- separator();
186
- const question = 'START RELO NOW?';
187
- const labels = ['YES', 'NO'];
188
- const answer = interactive()
189
- ? await askStart({
190
- labels,
191
- onQuestion: (at) => choices(question, labels, at),
192
- onAnswer: (value) => chosen(question, value)
193
- })
194
- : await askStart();
195
- if (answer === 'yes') {
214
+ if (startNow === 'yes') {
196
215
  closeScreen();
197
216
  // The daemon's error goes into the result block rather than through
198
217
  // the screen: a start refused before it spawned anything names the
@@ -210,6 +229,19 @@ try {
210
229
  : 'start it later: relo daemon start'
211
230
  );
212
231
  }
232
+ // The login item belongs to the binary, not to a running daemon, so
233
+ // the toggle runs after a refused start too. A disable goes after
234
+ // the start because the headless start reconciles the item from the
235
+ // config default on the way up; disabling first would be undone.
236
+ if (loginNow === 'yes') {
237
+ const enabled = spawnSync(destination, ['autostart', 'enable'], { stdio: 'ignore' });
238
+ if (enabled.status === 0) done('autostart enabled');
239
+ else note('register it later: relo autostart enable');
240
+ } else if (loginNow === 'no') {
241
+ const disabled = spawnSync(destination, ['autostart', 'disable'], { stdio: 'ignore' });
242
+ if (disabled.status === 0) done('autostart stays off');
243
+ else note('remove it later: relo autostart disable');
244
+ }
213
245
  } else {
214
246
  note('start it later: relo daemon start');
215
247
  closeScreen();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonaskahn/relo",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "One local proxy that lets Codex, Claude Code, Cursor and Grok, etc. Talk to any model, any provider with no config changes",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",