Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

chore(merge): integrate accepted relay sign in [B26,H5]

Corey Olsona615a65aa5fd
diff --cc src/relay.js
index bc46454f,86de93a6..bbb42d66
--- a/src/relay.js
+++ b/src/relay.js
@@@ -1213,18 -1218,16 +1219,20 @@@ export async function revokeRelayPerson
}
/** Sign in with the caller's cancellation signal; no board credential is persisted here. */
- async function deviceSignIn(url, io, { signal, intent } = {}) {
-async function deviceSignIn(url, io, { signal, onSignIn } = {}) {
++async function deviceSignIn(url, io, { signal, intent, onSignIn } = {}) {
cancellationOutcome(signal);
const client = { url };
- const flow = await request(client, '/auth/device/start', { method: 'POST', body: {}, signal }, io);
+ const flow = await request(client, '/auth/device/start', { method: 'POST', body: intent ? { intent } : {}, signal }, io);
try {
cancellationOutcome(signal);
- io.stderr.write(`Sign in with GitHub: open ${flow.verificationURL} and enter ${flow.userCode}\n`);
- const expires = Date.now() + flow.expiresIn * 1000;
+ io.stderr.write(intent
+ ? `Sign in with GitHub for board ${intent.boardName} from ${intent.host}: open ${flow.verificationURL} and enter ${flow.userCode}. After sign-in, confirm the link in your browser: ${flow.confirmationURL}\n`
+ : `Sign in with GitHub: open ${flow.verificationURL} and enter ${flow.userCode}\n`);
+ if (intent && typeof flow.confirmationURL !== 'string') throw new Refused('RELAY_RESPONSE', 'the relay did not provide a board confirmation page; sign in again');
+ let expires = Date.now() + flow.expiresIn * 1000;
+ // The view receives only the public device instructions. The ticket stays in this stack.
+ onSignIn?.({ verificationURL: flow.verificationURL, userCode: flow.userCode, expiresAt: expires, relayUrl: url });
+ let confirmationPending = false;
let signed;
let wait = flow.interval;
do {