Versions 301 to 302
new file, 117 lines
1+// abso login --web: a staging website session for the person a box is signed in as, opened in an agent's own browser, with
2+// no secret in the agent's hands. The website's /login/handoff takes this box's sign-in (or a test account's PAT, from a file)
3+// and answers a one-use link that works for a minute; opening it signs that browser in. Only the link is printed: never the
5+
8+
9+/** The website beside each staging server. Prod has none here: agents never sign in to the website on prod. */
11+ "https://abso-staging.chrisazy.workers.dev": "https://abso-website-staging.chrisazy.workers.dev",
12+ "https://avcs-staging.chrisazy.workers.dev": "https://abso-website-staging.chrisazy.workers.dev",
14+
15+/** What the website answers: the link, when it stops working, and who and until when it signs in. */
23+
24+/** The website a server's handoff goes to: --site as given (https only), else the staging site beside it. */
43+ `abso login --web is for staging: ${origin} has no staging website beside it that abso knows, and agents never sign in to the website on prod. --site names one.`,
47+
60+
65+
66+/** Asks the website for a handoff link with `credential` (a box sign-in or a PAT) in Authorization. */
67+export async function webHandoff(site: string, credential: string, fetcher: typeof fetch = fetch): Promise<Handoff> {
77+ throw new UsageError(`couldn't reach ${site}: ${scrubbed((err as Error).message, credential)}`);
109+
114+ `Open this link in your browser within ${seconds} seconds. It signs that browser in to ${site} as ${h.name}, until ${h.sessionEnds}, and works once:`,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 301 302 client/src/web-session.ts --json
- JSON
- /christopher/abso-core/compare/301..302?file=client%2Fsrc%2Fweb-session.ts&format=json