- luxe remote puts the sessions on your computer in reach of your own phone or tablet over Tailscale: write, steer, answer prompts, send photos, browse files, diffs and GitHub, with a paired device and your own Tailscale login. - luxe join lets another program on the same machine join a running session over the RPC protocol. - An AGENTS.md in a subfolder reaches the model the first time it works there. - Long sessions stay fast: no stall before each model call, lighter memory, cheaper drawing. - A session is open in one Luxe at a time, web_search shares results across its phrasings, and a grep glob starting with ! excludes. The CHANGELOG has the full list.
38 lines
1.5 KiB
JavaScript
38 lines
1.5 KiB
JavaScript
// @ts-check
|
|
// Pairing from inside the app. A scanned code opens Safari, and an app kept on the home screen has
|
|
// cookies of its own, copied from Safari only when it was added, so one that lost its pairing
|
|
// can't get it back by scanning. Pasting the invitation link here pairs the app itself.
|
|
|
|
import { useState } from "preact/hooks";
|
|
import { fieldOf, html } from "./html.js";
|
|
|
|
/**
|
|
* The invitation in `text`: the link `luxe remote pair` prints, or the part after its `#`.
|
|
* @param {string} text @returns {string | null}
|
|
*/
|
|
export function invitationFrom(text) {
|
|
const token = text.trim().split("#").pop() ?? "";
|
|
return /^[A-Za-z0-9_-]+$/.test(token) ? token : null;
|
|
}
|
|
|
|
/** What an unpaired device is told, and a field for the link. */
|
|
export function PairWithLink() {
|
|
const [text, setText] = useState("");
|
|
const token = invitationFrom(text);
|
|
/** @param {SubmitEvent} event */
|
|
const submit = (event) => {
|
|
event.preventDefault();
|
|
if (token) location.assign(`/pair#${token}`);
|
|
};
|
|
return html`<section class="pairing">
|
|
<p>Run <code>luxe remote pair</code> on your computer, then scan its QR code or paste its link
|
|
here.</p>
|
|
<form class="pair-link" onSubmit=${submit}>
|
|
<input type="text" inputmode="url" placeholder="https://…/pair#…" value=${text} autocapitalize="off"
|
|
autocorrect="off" spellcheck="false" aria-label="Invitation link"
|
|
onInput=${(/** @type {Event} */ event) => setText(fieldOf(event).value)} />
|
|
<button type="submit" disabled=${!token}>Pair</button>
|
|
</form>
|
|
</section>`;
|
|
}
|