relay-companion 0.1.113 → 0.1.114
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/bin/relay.js +33 -6
- package/overlay/inbox.html +11 -0
- package/package.json +1 -1
package/bin/relay.js
CHANGED
|
@@ -178,14 +178,37 @@ async function applyInstall({
|
|
|
178
178
|
const detail = pill.reason ? ` (${pill.reason})` : "";
|
|
179
179
|
console.log(`Could not install Relay pill autostart${detail}. Run \`relay pill\` to open it.`);
|
|
180
180
|
}
|
|
181
|
+
// Nothing was installed because no agent lives on this machine. This is the
|
|
182
|
+
// single most likely outcome for someone who was sent a relay and followed the
|
|
183
|
+
// instructions, and it used to print the skip lines above and exit 0 -- with
|
|
184
|
+
// the downloadable .command wrapper then adding "Relay is set up." The person
|
|
185
|
+
// ends up with a paired device, a daemon and a pill, and no way to receive a
|
|
186
|
+
// relay in an agent, having been told it worked.
|
|
187
|
+
if (!installed.length) {
|
|
188
|
+
console.log("");
|
|
189
|
+
console.log("Relay could not finish: no agent was found on this machine.");
|
|
190
|
+
console.log("Relay delivers into a coding agent, so it needs one of these installed first:");
|
|
191
|
+
console.log(" Claude Code https://claude.com/claude-code");
|
|
192
|
+
console.log(" Codex https://developers.openai.com/codex");
|
|
193
|
+
console.log("Install one, then run this command again.");
|
|
194
|
+
console.log("");
|
|
195
|
+
console.log(`In the meantime you can read and reply to your relays on the web: ${absoluteWebTarget("/app/relays")}`);
|
|
196
|
+
return { installed, missing, daemon, pill, activations, agentMissing: true };
|
|
197
|
+
}
|
|
198
|
+
|
|
181
199
|
const liveRequirement = liveToolRequirement({ activations, requiredHosts });
|
|
182
|
-
if (requireLiveTools &&
|
|
200
|
+
if (requireLiveTools && !liveRequirement.ok) {
|
|
201
|
+
// Registration only takes effect in a NEW agent session, so the session that
|
|
202
|
+
// ran this command can never report itself ready -- verifyClaudeMcpRegistration
|
|
203
|
+
// returns currentSessionReady:false on every path by construction. Treating
|
|
204
|
+
// that as a failure turned a successful install into `exit 1`, and skipped the
|
|
205
|
+
// open-relay step that is the entire reason the recipient ran this. Say what
|
|
206
|
+
// to do instead of failing.
|
|
183
207
|
const hostLabel = liveRequirement.missingHosts.length
|
|
184
208
|
? liveRequirement.missingHosts.join(" and ")
|
|
185
|
-
: "this
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
);
|
|
209
|
+
: "this agent session";
|
|
210
|
+
console.log("");
|
|
211
|
+
console.log(`Relay is installed. Restart ${hostLabel} (or open a new session) to use it.`);
|
|
189
212
|
}
|
|
190
213
|
return { installed, missing, daemon, pill, activations };
|
|
191
214
|
}
|
|
@@ -196,7 +219,7 @@ async function cmdSetup(flags) {
|
|
|
196
219
|
writeConfig({ companionMode: mode });
|
|
197
220
|
await cmdPair(flags, { promptForDefaults: Boolean(flags.interactive) });
|
|
198
221
|
console.log("");
|
|
199
|
-
await applyInstall({
|
|
222
|
+
const install = await applyInstall({
|
|
200
223
|
requireLiveTools: Boolean(flags["require-live-tools"]) || shouldRequireLiveTools(),
|
|
201
224
|
requiredHosts: requiredLiveHosts(),
|
|
202
225
|
mode,
|
|
@@ -222,6 +245,10 @@ async function cmdSetup(flags) {
|
|
|
222
245
|
console.log(`Relay ${result.relayId} is staged in the Relay pill.`);
|
|
223
246
|
}
|
|
224
247
|
}
|
|
248
|
+
// The relay is opened/staged first -- the recipient should still get the thing
|
|
249
|
+
// they came for -- but setup did not achieve what it claims, so it must not
|
|
250
|
+
// report success. `exitCode` rather than `exit()` so nothing above is truncated.
|
|
251
|
+
if (install?.agentMissing) process.exitCode = 1;
|
|
225
252
|
}
|
|
226
253
|
|
|
227
254
|
/** Install the tools + daemon on a device that is already paired. */
|
package/overlay/inbox.html
CHANGED
|
@@ -3557,6 +3557,7 @@
|
|
|
3557
3557
|
</span>
|
|
3558
3558
|
</div>
|
|
3559
3559
|
<div class="open-actions sv-actions" data-stop="1" role="menu">
|
|
3560
|
+
<button class="oa-item" type="button" role="menuitem" id="svAccount" ${svBusy ? "disabled" : ""}>Account Settings…</button>
|
|
3560
3561
|
<button class="oa-item oa-primary" type="button" role="menuitem" id="svSwitch" ${svBusy ? "disabled" : ""}>Switch Account…</button>
|
|
3561
3562
|
<div class="oa-sep" role="separator"></div>
|
|
3562
3563
|
<button class="oa-item${svSignOutArmed ? " sv-signout-armed" : ""}" type="button" role="menuitem" id="svSignOut" ${svBusy ? "disabled" : ""}>${svSignOutArmed ? "Sign Out — click again to confirm" : "Sign Out"}</button>
|
|
@@ -3597,6 +3598,16 @@
|
|
|
3597
3598
|
for (const z of settingsViewEl.querySelectorAll('[data-stop="1"]')) {
|
|
3598
3599
|
z.addEventListener("click", (e) => e.stopPropagation());
|
|
3599
3600
|
}
|
|
3601
|
+
// Managing addresses lives on the web (Clerk owns verification and the
|
|
3602
|
+
// reverification challenge), so the pill's job is to get you there rather
|
|
3603
|
+
// than to reimplement it. Without this the account panel showed an email the
|
|
3604
|
+
// user had no way to change from the surface they actually live in.
|
|
3605
|
+
const accountEl = document.getElementById("svAccount");
|
|
3606
|
+
if (accountEl) {
|
|
3607
|
+
accountEl.addEventListener("click", () => {
|
|
3608
|
+
if (window.relay.openUrl) window.relay.openUrl("/app/settings");
|
|
3609
|
+
});
|
|
3610
|
+
}
|
|
3600
3611
|
const switchEl = document.getElementById("svSwitch");
|
|
3601
3612
|
if (switchEl) switchEl.addEventListener("click", beginPairFlow);
|
|
3602
3613
|
const signOutEl = document.getElementById("svSignOut");
|