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.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
chore(merge): integrate accepted local board bridge [N26]
Corey Olsoncb388ec70c38
diff --cc src/cockpit.jsindex 00248201,e589d13e..4cea4c8f--- a/src/cockpit.js+++ b/src/cockpit.js@@@ -97,10 -91,7 +97,11 @@@ export function cockpitPage(key = '',<h2>No boards yet</h2><p>Run <code>pullboard init</code> in a git repo, or ask an agent to. Its board shows up here by itself.</p></section>+ <p class="empty" id="project-loading" role="status" hidden>Loading project…</p>+ <section class="card-panel" id="local-note" role="status" hidden>+ <p id="local-note-text"></p>+ <p id="local-note-links" hidden><a id="local-note-view" href="http://127.0.0.1:4890/local/view">Open the local view</a> <a id="local-note-sign-in" hidden>Sign in to see linked boards</a> <button class="ghost" id="local-note-retry" type="button">Try again</button></p>+ </section><section class="card-panel snapshot-controls" id="snapshot-controls" ${snapshot ? '' : 'hidden'} aria-label="Snapshot replay"><span>Read-only snapshot</span><button class="ghost" id="replay-play" type="button">Play from first event</button>@@@ -283,93 -225,9 +284,93 @@@ let deferredClickRender = falseconst addressedShouts = new Map();const $ = (id) => document.getElementById(id);+/** Say in one line what the page is doing about this machine's view, or why it cannot read it, with the ways on. */+function localNote(text, ways = false) {+ $('local-note').hidden = !text;+ $('local-note-text').textContent = text || '';+ $('local-note-links').hidden = !ways;+ $('local-note-view').href = (localSession?.origin || LOCAL_VIEW) + '/local/view';+ $('local-note-sign-in').hidden = !hosted.signIn || hosted.relaySession;+ if (hosted.signIn) $('local-note-sign-in').href = hosted.signIn;+}++/** Hide the relay's own banner, which speaks for the relay, on a page the relay does not serve this time. */+function hideRelayNotice() {+ const banner = document.getElementById('relay-notice');+ if (banner) banner.hidden = true;+}++/** Send this tab on the round trip to the local view, which sends it straight back here; two tries in a row at most. */+function localTrip(base) {+ const trips = Number(tabValue(LOCAL_TRIPS) || 0);+ if (trips >= 2) {+ tabValue(LOCAL_TRIPS, null);+ localNote('The local view did not give this page a session it accepts. Open the local view, or try again.', true);+ return false;+ }+ tabValue(LOCAL_TRIPS, String(trips + 1));+ location.assign(base + '/local/connect');+ return true;+}++/** The local view refused this tab's secret, as after a restart with a new one: go round again for it, unasked. */+function localExpired() {+ const base = localSession.origin;+ localSession = null;+ localConfirmed = false;+ tabValue(LOCAL_TAB, null);+ localTrip(base);+}++/**+ * Reach this machine's view: say first why the browser may ask about local network access, then read the view's+ * public protocol, which holds no secret and no board, and take the session the round trip brought back. It is+ * 'local' when the page now reads the local view, 'away' when the browser is on the round trip, and 'unreachable'+ * when the page cannot read it, with what it knows of why on the page.+ */+async function connectLocal() {+ const base = localSession?.origin || LOCAL_VIEW;+ let permission = null;+ for (const name of ['loopback-network', 'local-network-access']) {+ try { permission = (await navigator.permissions.query({ name })).state; break; } catch { /* this browser has no such permission */ }+ }+ if (permission === 'denied') {+ localNote('This browser has refused this page access to apps on this device, so it cannot read the board running here. Allow it in the site settings for app.pullboard.dev, or open the local view.', true);+ return 'unreachable';+ }+ if (permission !== 'granted') {+ localNote('Your browser may ask to let this page reach apps on this device: allow it, and the page reads the board pullboard view runs here, which never leaves this machine.');+ // The line is on screen before the request that can raise the browser's prompt.+ await new Promise((painted) => requestAnimationFrame(() => requestAnimationFrame(painted)));+ }+ let reply;+ try { reply = await fetch(base + '/local/protocol', { signal: AbortSignal.timeout(3000), credentials: 'omit', redirect: 'error' }); }+ catch {+ localNote('This page cannot reach a local view: pullboard view may not be running, this browser may have refused it access to this device, or the installed Pullboard may be older than this page. Start pullboard view and try again, or open the link it printed.', true);+ return 'unreachable';+ }+ let protocol = null;+ try { protocol = await reply.json(); } catch { /* not this protocol */ }+ if (!reply.ok || protocol?.version !== 1 || protocol?.apiVersion !== 1 || protocol?.hostedOrigin !== location.origin) {+ localNote('The installed Pullboard does not match this page. Open the link pullboard view printed, or update Pullboard.', true);+ return 'unreachable';+ }+ if (!localSession) return localTrip(base) ? 'away' : 'unreachable';+ connection.base = localSession.origin;+ connection.headers = { 'x-pullboard-key': localSession.key };+ readOnly = false;+ requests = false;+ transportModule = null;+ transport = null;+ document.body.classList.remove('read-only', 'requests');+ hideRelayNotice();+ localNote(null);+ return 'local';+}+/** Mark primary pointer targets whose click would be lost if a refresh replaces them. */function holdClickPointer(event) {- if (!event.isPrimary || event.button !== 0 || !(event.target instanceof Element && event.target.closest('#pipeline .pipeline-item, #spec-detail [data-row-decision="decline"], #spec-decline-submit'))) return;+ if (!event.isPrimary || event.button !== 0 || !(event.target instanceof Element && event.target.closest('#pipeline .pipeline-item, #spec-detail [data-row-decision="decline"], #spec-decline-submit, #roadmap-panel [data-roadmap-jump]'))) return;heldClickPointer = event.pointerId;}