austere-axi 0.15.0 → 0.16.0

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/README.md CHANGED
@@ -50,7 +50,7 @@ Repeat until it is right. When you are done, press **Done** (or **Send & finish*
50
50
 
51
51
  ## What else it does
52
52
 
53
- - **Bring in a teammate.** Ask your agent to publish the page and invite someone by name. Each person gets their own link, and their notes appear under their name. You see their notes first and decide which ones go to the agent. [More on sharing](docs/hosted-pages.md). On your own network, the hub's **Settings** makes a named link, lets people ask for access, and shows who has it ([Team review](docs/team-review.md), [Settings](docs/hub.md#settings)).
53
+ - **Bring in a teammate.** Ask your agent to publish the page and invite someone by name (turn cloud features on first: `austere-axi cloud on`, or **Settings → Cloud**). Each person gets their own link, and their notes appear under their name. You see their notes first and decide which ones go to the agent. [More on sharing](docs/hosted-pages.md). On your own network, the hub's **Settings** makes a named link, lets people ask for access, and shows who has it ([Team review](docs/team-review.md), [Settings](docs/hub.md#settings)).
54
54
  - **Review from your phone.** The review page has a phone layout. This needs [Tailscale](https://tailscale.com) on your computer and phone. [How it works](docs/how-it-works.md#the-review-loop).
55
55
  - **Send someone a copy.** "Download standalone HTML" in the page's ⋯ menu saves the page as one file that opens in any browser, offline.
56
56
  - **Nothing gets lost.** Every note is saved the moment you send it. If the agent is busy or your computer restarts, the notes are waiting when the agent comes back.
@@ -98,7 +98,7 @@ With austere-axi the agent writes a short outline that names what goes on the pa
98
98
  ## Private by default
99
99
 
100
100
  - It runs on your own computer. Local review needs no account and no sign-up.
101
- - Your pages and notes stay on your computer unless you choose to publish a page.
101
+ - Your pages and notes stay on your computer unless you choose to publish a page. Cloud features are off by default; until you turn them on (`austere-axi cloud on`, or the hub's **Settings → Cloud**), nothing is sent to the hosted service.
102
102
  - A published page is invite-only unless you ask for an open link, and it expires 30 days after you last published it. Hosted review needs a sign-in: reviewers sign in with the email you granted the page to (or open their invite link), and `austere-axi cloud login` makes you the owner of all your hosted pages.
103
103
  - It is free and open source (MIT license).
104
104
 
package/dist/austere.js CHANGED
@@ -1759,12 +1759,12 @@ dataLane = Group("DATA STORES WITH A HEADING LONGER THAN THE COLUMN IS WIDE", [c
1759
1759
  <button type="button" data-act="queue" class="primary">Add to queue</button>
1760
1760
  </span>
1761
1761
  </div>
1762
- </div>`,document.body.appendChild(o);let r=o.querySelector(".austere-hover"),n=o.querySelector(".austere-hover-label"),i=o.querySelector(".austere-selbtn"),s=o.querySelector(".austere-pop"),l=o.querySelector(".austere-pop-path"),u=o.querySelector(".austere-pop-quote"),d=o.querySelector("textarea"),p=o.querySelector('[data-act="history"]'),f={},m=!1;function x(){let K=v&&f[v.targetId]||0;p.hidden=K<2,p.textContent=`History (${K})`}d.addEventListener("focus",()=>e({type:"writing",on:!0})),d.addEventListener("blur",()=>e({type:"writing",on:!1}));let v=null,w=null,b=0,k=null,S=K=>K instanceof Element&&!!K.closest(`[${xv}]`),I=K=>K instanceof Element&&K.closest("[data-oui-id]")||null;function C(K,ue,me=4){K.style.left=`${ue.left-me}px`,K.style.top=`${ue.top-me}px`,K.style.width=`${ue.width+me*2}px`,K.style.height=`${ue.height+me*2}px`}let M=null,A=null,D=null;function z(K,ue){let me=ue?Re(ue):MX(K);r.style.visibility=me?"":"hidden",me&&C(r,me)}function T(K,ue=null,me=K&&ue?TEt(K,ue):null,Ce=NEt(ue)){if(M=K,A=ue,D=me,!K){r.hidden=!0;return}z(K,ue),n.textContent=`${K.getAttribute("data-oui-id")} \xB7 ${K.getAttribute("data-oui-c")}${Ce}`,r.hidden=!1}function O(K){a!=="annotate"||!s.hidden||(k=K.target,!b&&(b=requestAnimationFrame(()=>{b=0;let ue=k;if(!(ue instanceof Element)||S(ue))return;let me=I(ue);T(me,me&&AEt(me,ue))})))}function B(){let K=window.getSelection();return!!K&&!K.isCollapsed&&K.toString().trim().length>0}function P(K){if(a!=="annotate"||S(K.target))return;if(!s.hidden){K.preventDefault(),K.stopPropagation();return}if(B())return;let ue=K.target;if(!(ue instanceof Element)||!K.altKey&&ue.closest(hOa))return;let me=I(ue);me&&(K.preventDefault(),K.stopPropagation(),te({target:me,el:ue,point:{x:K.clientX,y:K.clientY}}))}function H(){if(a!=="annotate"||!s.hidden)return;let K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount){i.hidden=!0,w=null;return}let ue=K.toString().trim(),me=K.getRangeAt(0),Ce=me.commonAncestorContainer,we=Ce instanceof Element?Ce:Ce.parentElement,Y=I(we);if(!ue||!we||!Y||S(we)){i.hidden=!0,w=null;return}let se=me.getBoundingClientRect();w={target:Y,el:we,selection:eh(ue,600),point:{x:se.left,y:se.bottom}},i.hidden=!1;let xe=i.offsetWidth||140;i.style.left=`${Math.max(8,Math.min(window.innerWidth-xe-8,se.left+se.width/2-xe/2))}px`,i.style.top=`${Math.max(8,Math.min(window.innerHeight-40,se.bottom+8))}px`}let V=0;function W(){clearTimeout(V),V=window.setTimeout(H,120)}i.addEventListener("mousedown",K=>K.preventDefault()),i.addEventListener("click",K=>{K.preventDefault(),K.stopPropagation(),w&&te(w),i.hidden=!0});function Z(){let K=v;K&&(l.textContent="",K.path.forEach((ue,me)=>{let Ce=document.createElement("button");if(Ce.type="button",Ce.className="austere-chip"+(ue.id===K.targetId?" active":""),Ce.textContent=ue.id,Ce.title=ue.component,Ce.addEventListener("click",()=>{K.targetId=ue.id,K.component=ue.component,x();let we=me===K.path.length-1;if(!K.target.isConnected){let se=K.path[K.path.length-1].id;K.target=document.querySelector(`[data-oui-id="${CSS.escape(se)}"]`)??K.target}let Y=`[data-oui-id="${CSS.escape(ue.id)}"]`;T(K.target.closest(Y)??document.querySelector(Y),we?K.piece:null,we?K.relocate:null,we?K.pieceLabel:""),st(),Z(),d.focus()}),l.appendChild(Ce),me<K.path.length-1){let we=document.createElement("span");we.className="austere-chip-sep",we.textContent="\u203A",l.appendChild(we)}}))}function te({target:K,el:ue,selection:me,point:Ce}){let we=gOa(K),Y=yOa(K,ue),se=_X(K,ue),xe=AEt(K,ue),le;if(!me){let Lt=se||ue;le=eh((Lt instanceof HTMLElement?Lt.innerText:void 0)||Lt.textContent,200)||void 0,se&&le===Y?.part&&(le=void 0)}let rt=REt(K);e({type:"focus",id:rt.id}),v={target:K,piece:xe,relocate:xe&&TEt(K,xe),pieceLabel:NEt(xe),targetId:rt.id,component:rt.component,path:we,selection:me||void 0,excerpt:le,detail:Y},Z(),x();let Ze=me||le||Y?.part||"";u.textContent=eh(Ze,220),u.hidden=!Ze,d.value="",r.hidden=!0,i.hidden=!0,T(K,xe,v.relocate,v.pieceLabel),r.classList.add("locked"),s.hidden=!1,ae(Ce),d.focus()}function ae(K){if(window.innerWidth<640){s.classList.add("sheet"),s.style.left=s.style.top="";return}s.classList.remove("sheet");let ue=s.offsetWidth||360,me=s.offsetHeight||200,Ce=K.x+12,we=K.y+12;Ce+ue>window.innerWidth-8&&(Ce=Math.max(8,K.x-ue-12)),we+me>window.innerHeight-8&&(we=Math.max(8,K.y-me-12)),s.style.left=`${Ce}px`,s.style.top=`${we}px`}function q(){document.activeElement===d&&d.blur(),s.hidden=!0,r.classList.remove("locked"),r.hidden=!0,v=null}function ne(){let K=d.value.trim();if(!v)return;if(!K&&!v.selection){d.focus(),d.classList.add("shake"),setTimeout(()=>d.classList.remove("shake"),400);return}let ue={kind:"annotation",target:v.targetId,component:v.component,path:v.path.map(we=>we.id),note:K};v.selection&&(ue.selection=v.selection),v.excerpt&&!v.selection&&(ue.excerpt=v.excerpt),v.detail&&v.targetId===v.path[v.path.length-1].id&&(ue.detail=v.detail),e({type:"annotate",item:ue});let me=v.targetId,Ce=ue.detail?A:null;q(),window.getSelection()?.removeAllRanges(),Ce?.isConnected?Ve(Ce,"queued"):Ee([me],"queued")}s.addEventListener("click",K=>{let ue=K.target instanceof Element?K.target.closest("[data-act]")?.getAttribute("data-act"):void 0;ue==="cancel"&&q(),ue==="queue"&&ne(),ue==="history"&&v&&e({type:"history",id:v.targetId})}),d.addEventListener("keydown",K=>{K.key==="Enter"&&!K.shiftKey&&!K.isComposing?(K.preventDefault(),ne()):K.key==="Escape"&&(K.preventDefault(),d.value.trim()||q())}),document.addEventListener("mousemove",O,{passive:!0}),document.addEventListener("click",P,!0),document.addEventListener("mouseup",W),document.addEventListener("keyup",K=>{(K.shiftKey||K.key.startsWith("Arrow"))&&W()}),document.addEventListener("selectionchange",()=>{"ontouchstart"in window&&W()}),document.addEventListener("keydown",K=>{(K.metaKey||K.ctrlKey)&&(K.key==="i"||K.key==="I")?(K.preventDefault(),e({type:"toggle-mode"})):m&&(K.metaKey||K.ctrlKey)&&!K.altKey&&(K.key==="k"||K.key==="K")&&(K.preventDefault(),e({type:"quick-switch"}))}),window.addEventListener("scroll",()=>{if(!s.hidden)return Pe();r.hidden=!0,i.hidden=!0},{passive:!0}),document.addEventListener("mouseleave",()=>{s.hidden&&(r.hidden=!0)});function fe(K,ue,me,Ce=new Set){if(Ce.has(K))return[];Ce.add(K);let we=document.querySelectorAll(`[data-oui-id="${CSS.escape(K)}"]`);return we.length?Array.from(we):!ue||!me?[]:me(ue,K).flatMap(Y=>fe(Y,ue,me,Ce))}function U(K,ue,me){let Ce=new Set;for(let we of K)for(let Y of fe(we,ue,me))Ce.add(Y);return Array.from(Ce).filter(we=>!Array.from(Ce).some(Y=>Y!==we&&Y.contains(we)))}function Be(K,ue){let me=document.createElement("div");return me.setAttribute(xv,""),me.className=ue,me.style.left=`${K.left+window.scrollX-4}px`,me.style.top=`${K.top+window.scrollY-4}px`,me.style.width=`${K.width+8}px`,me.style.height=`${K.height+8}px`,me}function We(K){if(getComputedStyle(K).display!=="contents")return CX(K);let[ue,me,Ce,we]=[1/0,1/0,-1/0,-1/0],Y=xe=>{!xe.width&&!xe.height||([ue,me,Ce,we]=[Math.min(ue,xe.left),Math.min(me,xe.top),Math.max(Ce,xe.right),Math.max(we,xe.bottom)])},se=xe=>{for(let le of xe.childNodes)if(le instanceof Element)getComputedStyle(le).display==="contents"?se(le):Y(CX(le));else if(le.nodeType===Node.TEXT_NODE&&le.textContent?.trim()){let rt=document.createRange();rt.selectNodeContents(le),Y(rt.getBoundingClientRect())}};return se(K),{left:ue,top:me,right:Ce,bottom:we}}function Oe(K){for(let ue=K.closest("[hidden='until-found']");ue?.parentElement;ue=K.closest("[hidden='until-found']"))K=ue.parentElement;return K}function Re(K){let ue=Oe(K),{left:me,top:Ce,right:we,bottom:Y}=We(ue),se=we===me,xe=Y===Ce;if(se&&xe)return null;for(let Ze=ue.parentElement;Ze&&Ze!==document.body;Ze=Ze.parentElement){let Lt=getComputedStyle(Ze),Ut=Lt.overflowX!=="visible",Ga=Lt.overflowY!=="visible";if(!Ut&&!Ga||Lt.display==="contents")continue;let Na=Ze.getBoundingClientRect();Ut&&([me,we]=[Math.max(me,Na.left),Math.min(we,Na.right)]),Ga&&([Ce,Y]=[Math.max(Ce,Na.top),Math.min(Y,Na.bottom)])}let le=se?we>=me:we>me,rt=xe?Y>=Ce:Y>Ce;return le&&rt?{left:me,top:Ce,width:we-me,height:Y-Ce}:null}function Ve(K,ue){let me=Re(K);if(!me)return;let Ce=Be(me,`austere-flash ${ue}`);document.body.appendChild(Ce),setTimeout(()=>Ce.remove(),2400)}function Ee(K,ue="changed",me,Ce){let we=U(K,me,Ce);for(let Y of we)Ve(Y,ue);return we}function re(K,ue,me){let Ce=fe(K,ue,me);if(!Ce.length)return!1;for(let se=Ce[0].closest("[hidden='until-found']");se;se=Ce[0].closest("[hidden='until-found']"))se.removeAttribute("hidden"),se.dispatchEvent(new Event("beforematch"));let we=MX(Ce[0]),Y=we.top+window.scrollY-Math.max(24,(window.innerHeight-we.height)/3);return window.scrollTo({top:Math.max(0,Y),behavior:"smooth"}),setTimeout(()=>Ee([K],"changed",ue,me),350),!0}let J=document.createElement("div");J.setAttribute(xv,""),o.appendChild(J);let ie=null,ge=0,Ae=document.createElement("div");Ae.setAttribute(xv,""),o.appendChild(Ae);let Me=[];function ct(){let[K,ue]=ie&&t?t():[],me=[],Ce=[];for(let we of ie?U(ie,K,ue):[]){let Y=Re(we);Y&&(me.push(we),Ce.push(Y))}return J.replaceChildren(...Ce.map(we=>Be(we,"austere-mark"))),me}function st(){if(!(r.hidden||!M)){if(!M.isConnected){let K=M.getAttribute("data-oui-id");M=document.querySelector(`[data-oui-id="${CSS.escape(K)}"]`)}M&&A&&!A.isConnected&&(A=D?.(M)??A),M?z(M,A):r.hidden=!0}}function Pe(){ge||!ie&&r.hidden&&!Me.length||(ge=requestAnimationFrame(()=>{ge=0,ie&&ct(),Me.length&&St(),st()}))}window.addEventListener("resize",Pe,{passive:!0}),new ResizeObserver(Pe).observe(document.body),new MutationObserver(K=>{K.some(ue=>!S(ue.target.nodeType===1?ue.target:ue.target.parentElement))&&Pe()}).observe(document.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class","style","hidden","open","x","y","width","height","d","transform","viewBox"]}),document.addEventListener("scroll",K=>{K.target!==document&&Pe()},{capture:!0,passive:!0});function Ft(K,ue=!1){ie=K.length?K:null;let me=ct();if(ue&&me.length){let Ce=me.map(we=>MX(Oe(we)));if(!Ce.some(we=>we.bottom>0&&we.top<window.innerHeight)){let we=Ce[0],Y=we.top+window.scrollY-Math.max(24,(window.innerHeight-we.height)/3);window.scrollTo({top:Math.max(0,Y),behavior:"smooth"})}}return me.length}function St(){let[K,ue]=Me.length&&t?t():[],me=new Map;for(let we of Me)me.set(we.statement,[...me.get(we.statement)??[],we]);let Ce=[];for(let[we,Y]of me){let se=!1;for(let xe of U([we],K,ue)){let le=Re(xe);if(!le)continue;let rt=Be(le,"austere-focus");if(rt.style.setProperty("--austere-viewer",Y[0].colour),!se){se=!0;let Ze=document.createElement("div");Ze.className="austere-focus-names";for(let Lt of Y){let Ut=document.createElement("span");Ut.textContent=Lt.name,Ut.style.background=Lt.colour,Ze.appendChild(Ut)}rt.appendChild(Ze)}Ce.push(rt)}}Ae.replaceChildren(...Ce)}function qt(K){Me=K,St()}return{setQuickSwitch(K){m=K},setHistory(K){f=K,v&&x()},setMode(K){a=K==="annotate"?"annotate":"explore",document.documentElement.classList.toggle("austere-annotating",a==="annotate"),a!=="annotate"&&(q(),i.hidden=!0,r.hidden=!0)},flash:Ee,reveal:re,highlight:Ft,focus:qt}}var DEt={shadcn:{name:"@austere-axi/pack-shadcn",version:"0.15.0",components:["Progress","Avatar","AvatarGroup","Tooltip","HoverCard","Breadcrumb","BreadcrumbItem","Kbd","Skeleton","Calendar","Timeline","TimelineItem"]}};function xOa(e){let t=e.lastIndexOf("@");return t<=0?{name:e,version:""}:{name:e.slice(0,t),version:e.slice(t+1)}}var vOa=/^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,bOa=/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;function OEt(e){let t=[];for(let a of String(e||"").split(",")){let[o,r]=a.trim().split(/\s+/);if(!o)continue;let{name:n,version:i}=xOa(o);!vOa.test(n)||!bOa.test(i)||t.some(s=>s.name===n)||t.push(r&&/^sha(256|384|512)-[A-Za-z0-9+/=]+$/.test(r)?{name:n,version:i,integrity:r}:{name:n,version:i})}return t}var PEt="https://cdn.jsdelivr.net/npm";function BEt(e=document){let t=e.querySelector('meta[name="austere-packs"]');return t?OEt(t.getAttribute("content")||""):[]}function FEt(e,t){let a=[...t];for(let[o,r]of Object.entries(DEt))a.some(n=>n.name===r.name)||r.components.some(n=>new RegExp(`\\b${n}\\s*\\(`).test(e))&&a.push({name:r.name,version:r.version,bundled:o});return a}function AX(){return/\/__austere\/$/.test(w2)}function kOa(e){if(e.bundled)return{src:F4(`packs/${e.bundled}/pack.js`)||`${PEt}/austere-axi@${e.version}/dist/packs/${e.bundled}/pack.js`};if(AX()){let t=e.integrity?`?integrity=${encodeURIComponent(e.integrity)}`:"";return{src:`${w2}installed-packs/${encodeURIComponent(`${e.name}@${e.version}`)}/pack.js${t}`}}return{src:`${PEt}/${e.name}@${e.version}/dist/pack.js`,integrity:e.integrity}}function wOa(e,t){return new Promise((a,o)=>{let r=document.createElement("script");r.src=e,r.async=!0,t&&(r.integrity=t,r.crossOrigin="anonymous"),r.onload=()=>a(),r.onerror=()=>o(new Error(`could not load ${e}`)),document.head.appendChild(r)})}async function qEt(e,{onError:t}={}){let a=e.filter(o=>!hl().some(r=>r.name===o.name));return await Promise.all(a.map(o=>{let{src:r,integrity:n}=kOa(o);return wOa(r,n).then(()=>{hl().some(i=>i.name===o.name)||t?.(o,new Error(`${r} loaded but did not register pack ${o.name}`))},i=>t?.(o,i))})),hl()}function HEt(e){for(let t of e){if(!t.css)continue;let a=`austere-pack-css-${t.name.replace(/[^a-z0-9]/gi,"-")}`;if(document.getElementById(a))continue;let o=document.createElement("style");o.id=a,o.textContent=t.css,document.head.appendChild(o)}}var SOa=/[A-Za-z_$]/;function LOa(e){let t=[],a=String(e??""),o=0,r=1,n=a.length;for(;o<n;){let i=a[o];if(i===`
1762
+ </div>`,document.body.appendChild(o);let r=o.querySelector(".austere-hover"),n=o.querySelector(".austere-hover-label"),i=o.querySelector(".austere-selbtn"),s=o.querySelector(".austere-pop"),l=o.querySelector(".austere-pop-path"),u=o.querySelector(".austere-pop-quote"),d=o.querySelector("textarea"),p=o.querySelector('[data-act="history"]'),f={},m=!1;function x(){let K=v&&f[v.targetId]||0;p.hidden=K<2,p.textContent=`History (${K})`}d.addEventListener("focus",()=>e({type:"writing",on:!0})),d.addEventListener("blur",()=>e({type:"writing",on:!1}));let v=null,w=null,b=0,k=null,S=K=>K instanceof Element&&!!K.closest(`[${xv}]`),I=K=>K instanceof Element&&K.closest("[data-oui-id]")||null;function C(K,ue,me=4){K.style.left=`${ue.left-me}px`,K.style.top=`${ue.top-me}px`,K.style.width=`${ue.width+me*2}px`,K.style.height=`${ue.height+me*2}px`}let M=null,A=null,D=null;function z(K,ue){let me=ue?Re(ue):MX(K);r.style.visibility=me?"":"hidden",me&&C(r,me)}function T(K,ue=null,me=K&&ue?TEt(K,ue):null,Ce=NEt(ue)){if(M=K,A=ue,D=me,!K){r.hidden=!0;return}z(K,ue),n.textContent=`${K.getAttribute("data-oui-id")} \xB7 ${K.getAttribute("data-oui-c")}${Ce}`,r.hidden=!1}function O(K){a!=="annotate"||!s.hidden||(k=K.target,!b&&(b=requestAnimationFrame(()=>{b=0;let ue=k;if(!(ue instanceof Element)||S(ue))return;let me=I(ue);T(me,me&&AEt(me,ue))})))}function B(){let K=window.getSelection();return!!K&&!K.isCollapsed&&K.toString().trim().length>0}function P(K){if(a!=="annotate"||S(K.target))return;if(!s.hidden){K.preventDefault(),K.stopPropagation();return}if(B())return;let ue=K.target;if(!(ue instanceof Element)||!K.altKey&&ue.closest(hOa))return;let me=I(ue);me&&(K.preventDefault(),K.stopPropagation(),te({target:me,el:ue,point:{x:K.clientX,y:K.clientY}}))}function H(){if(a!=="annotate"||!s.hidden)return;let K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount){i.hidden=!0,w=null;return}let ue=K.toString().trim(),me=K.getRangeAt(0),Ce=me.commonAncestorContainer,we=Ce instanceof Element?Ce:Ce.parentElement,Y=I(we);if(!ue||!we||!Y||S(we)){i.hidden=!0,w=null;return}let se=me.getBoundingClientRect();w={target:Y,el:we,selection:eh(ue,600),point:{x:se.left,y:se.bottom}},i.hidden=!1;let xe=i.offsetWidth||140;i.style.left=`${Math.max(8,Math.min(window.innerWidth-xe-8,se.left+se.width/2-xe/2))}px`,i.style.top=`${Math.max(8,Math.min(window.innerHeight-40,se.bottom+8))}px`}let V=0;function W(){clearTimeout(V),V=window.setTimeout(H,120)}i.addEventListener("mousedown",K=>K.preventDefault()),i.addEventListener("click",K=>{K.preventDefault(),K.stopPropagation(),w&&te(w),i.hidden=!0});function Z(){let K=v;K&&(l.textContent="",K.path.forEach((ue,me)=>{let Ce=document.createElement("button");if(Ce.type="button",Ce.className="austere-chip"+(ue.id===K.targetId?" active":""),Ce.textContent=ue.id,Ce.title=ue.component,Ce.addEventListener("click",()=>{K.targetId=ue.id,K.component=ue.component,x();let we=me===K.path.length-1;if(!K.target.isConnected){let se=K.path[K.path.length-1].id;K.target=document.querySelector(`[data-oui-id="${CSS.escape(se)}"]`)??K.target}let Y=`[data-oui-id="${CSS.escape(ue.id)}"]`;T(K.target.closest(Y)??document.querySelector(Y),we?K.piece:null,we?K.relocate:null,we?K.pieceLabel:""),st(),Z(),d.focus()}),l.appendChild(Ce),me<K.path.length-1){let we=document.createElement("span");we.className="austere-chip-sep",we.textContent="\u203A",l.appendChild(we)}}))}function te({target:K,el:ue,selection:me,point:Ce}){let we=gOa(K),Y=yOa(K,ue),se=_X(K,ue),xe=AEt(K,ue),le;if(!me){let Lt=se||ue;le=eh((Lt instanceof HTMLElement?Lt.innerText:void 0)||Lt.textContent,200)||void 0,se&&le===Y?.part&&(le=void 0)}let rt=REt(K);e({type:"focus",id:rt.id}),v={target:K,piece:xe,relocate:xe&&TEt(K,xe),pieceLabel:NEt(xe),targetId:rt.id,component:rt.component,path:we,selection:me||void 0,excerpt:le,detail:Y},Z(),x();let Ze=me||le||Y?.part||"";u.textContent=eh(Ze,220),u.hidden=!Ze,d.value="",r.hidden=!0,i.hidden=!0,T(K,xe,v.relocate,v.pieceLabel),r.classList.add("locked"),s.hidden=!1,ae(Ce),d.focus()}function ae(K){if(window.innerWidth<640){s.classList.add("sheet"),s.style.left=s.style.top="";return}s.classList.remove("sheet");let ue=s.offsetWidth||360,me=s.offsetHeight||200,Ce=K.x+12,we=K.y+12;Ce+ue>window.innerWidth-8&&(Ce=Math.max(8,K.x-ue-12)),we+me>window.innerHeight-8&&(we=Math.max(8,K.y-me-12)),s.style.left=`${Ce}px`,s.style.top=`${we}px`}function q(){document.activeElement===d&&d.blur(),s.hidden=!0,r.classList.remove("locked"),r.hidden=!0,v=null}function ne(){let K=d.value.trim();if(!v)return;if(!K&&!v.selection){d.focus(),d.classList.add("shake"),setTimeout(()=>d.classList.remove("shake"),400);return}let ue={kind:"annotation",target:v.targetId,component:v.component,path:v.path.map(we=>we.id),note:K};v.selection&&(ue.selection=v.selection),v.excerpt&&!v.selection&&(ue.excerpt=v.excerpt),v.detail&&v.targetId===v.path[v.path.length-1].id&&(ue.detail=v.detail),e({type:"annotate",item:ue});let me=v.targetId,Ce=ue.detail?A:null;q(),window.getSelection()?.removeAllRanges(),Ce?.isConnected?Ve(Ce,"queued"):Ee([me],"queued")}s.addEventListener("click",K=>{let ue=K.target instanceof Element?K.target.closest("[data-act]")?.getAttribute("data-act"):void 0;ue==="cancel"&&q(),ue==="queue"&&ne(),ue==="history"&&v&&e({type:"history",id:v.targetId})}),d.addEventListener("keydown",K=>{K.key==="Enter"&&!K.shiftKey&&!K.isComposing?(K.preventDefault(),ne()):K.key==="Escape"&&(K.preventDefault(),d.value.trim()||q())}),document.addEventListener("mousemove",O,{passive:!0}),document.addEventListener("click",P,!0),document.addEventListener("mouseup",W),document.addEventListener("keyup",K=>{(K.shiftKey||K.key.startsWith("Arrow"))&&W()}),document.addEventListener("selectionchange",()=>{"ontouchstart"in window&&W()}),document.addEventListener("keydown",K=>{(K.metaKey||K.ctrlKey)&&(K.key==="i"||K.key==="I")?(K.preventDefault(),e({type:"toggle-mode"})):m&&(K.metaKey||K.ctrlKey)&&!K.altKey&&(K.key==="k"||K.key==="K")&&(K.preventDefault(),e({type:"quick-switch"}))}),window.addEventListener("scroll",()=>{if(!s.hidden)return Pe();r.hidden=!0,i.hidden=!0},{passive:!0}),document.addEventListener("mouseleave",()=>{s.hidden&&(r.hidden=!0)});function fe(K,ue,me,Ce=new Set){if(Ce.has(K))return[];Ce.add(K);let we=document.querySelectorAll(`[data-oui-id="${CSS.escape(K)}"]`);return we.length?Array.from(we):!ue||!me?[]:me(ue,K).flatMap(Y=>fe(Y,ue,me,Ce))}function U(K,ue,me){let Ce=new Set;for(let we of K)for(let Y of fe(we,ue,me))Ce.add(Y);return Array.from(Ce).filter(we=>!Array.from(Ce).some(Y=>Y!==we&&Y.contains(we)))}function Be(K,ue){let me=document.createElement("div");return me.setAttribute(xv,""),me.className=ue,me.style.left=`${K.left+window.scrollX-4}px`,me.style.top=`${K.top+window.scrollY-4}px`,me.style.width=`${K.width+8}px`,me.style.height=`${K.height+8}px`,me}function We(K){if(getComputedStyle(K).display!=="contents")return CX(K);let[ue,me,Ce,we]=[1/0,1/0,-1/0,-1/0],Y=xe=>{!xe.width&&!xe.height||([ue,me,Ce,we]=[Math.min(ue,xe.left),Math.min(me,xe.top),Math.max(Ce,xe.right),Math.max(we,xe.bottom)])},se=xe=>{for(let le of xe.childNodes)if(le instanceof Element)getComputedStyle(le).display==="contents"?se(le):Y(CX(le));else if(le.nodeType===Node.TEXT_NODE&&le.textContent?.trim()){let rt=document.createRange();rt.selectNodeContents(le),Y(rt.getBoundingClientRect())}};return se(K),{left:ue,top:me,right:Ce,bottom:we}}function Oe(K){for(let ue=K.closest("[hidden='until-found']");ue?.parentElement;ue=K.closest("[hidden='until-found']"))K=ue.parentElement;return K}function Re(K){let ue=Oe(K),{left:me,top:Ce,right:we,bottom:Y}=We(ue),se=we===me,xe=Y===Ce;if(se&&xe)return null;for(let Ze=ue.parentElement;Ze&&Ze!==document.body;Ze=Ze.parentElement){let Lt=getComputedStyle(Ze),Ut=Lt.overflowX!=="visible",Ga=Lt.overflowY!=="visible";if(!Ut&&!Ga||Lt.display==="contents")continue;let Na=Ze.getBoundingClientRect();Ut&&([me,we]=[Math.max(me,Na.left),Math.min(we,Na.right)]),Ga&&([Ce,Y]=[Math.max(Ce,Na.top),Math.min(Y,Na.bottom)])}let le=se?we>=me:we>me,rt=xe?Y>=Ce:Y>Ce;return le&&rt?{left:me,top:Ce,width:we-me,height:Y-Ce}:null}function Ve(K,ue){let me=Re(K);if(!me)return;let Ce=Be(me,`austere-flash ${ue}`);document.body.appendChild(Ce),setTimeout(()=>Ce.remove(),2400)}function Ee(K,ue="changed",me,Ce){let we=U(K,me,Ce);for(let Y of we)Ve(Y,ue);return we}function re(K,ue,me){let Ce=fe(K,ue,me);if(!Ce.length)return!1;for(let se=Ce[0].closest("[hidden='until-found']");se;se=Ce[0].closest("[hidden='until-found']"))se.removeAttribute("hidden"),se.dispatchEvent(new Event("beforematch"));let we=MX(Ce[0]),Y=we.top+window.scrollY-Math.max(24,(window.innerHeight-we.height)/3);return window.scrollTo({top:Math.max(0,Y),behavior:"smooth"}),setTimeout(()=>Ee([K],"changed",ue,me),350),!0}let J=document.createElement("div");J.setAttribute(xv,""),o.appendChild(J);let ie=null,ge=0,Ae=document.createElement("div");Ae.setAttribute(xv,""),o.appendChild(Ae);let Me=[];function ct(){let[K,ue]=ie&&t?t():[],me=[],Ce=[];for(let we of ie?U(ie,K,ue):[]){let Y=Re(we);Y&&(me.push(we),Ce.push(Y))}return J.replaceChildren(...Ce.map(we=>Be(we,"austere-mark"))),me}function st(){if(!(r.hidden||!M)){if(!M.isConnected){let K=M.getAttribute("data-oui-id");M=document.querySelector(`[data-oui-id="${CSS.escape(K)}"]`)}M&&A&&!A.isConnected&&(A=D?.(M)??A),M?z(M,A):r.hidden=!0}}function Pe(){ge||!ie&&r.hidden&&!Me.length||(ge=requestAnimationFrame(()=>{ge=0,ie&&ct(),Me.length&&St(),st()}))}window.addEventListener("resize",Pe,{passive:!0}),new ResizeObserver(Pe).observe(document.body),new MutationObserver(K=>{K.some(ue=>!S(ue.target.nodeType===1?ue.target:ue.target.parentElement))&&Pe()}).observe(document.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class","style","hidden","open","x","y","width","height","d","transform","viewBox"]}),document.addEventListener("scroll",K=>{K.target!==document&&Pe()},{capture:!0,passive:!0});function Ft(K,ue=!1){ie=K.length?K:null;let me=ct();if(ue&&me.length){let Ce=me.map(we=>MX(Oe(we)));if(!Ce.some(we=>we.bottom>0&&we.top<window.innerHeight)){let we=Ce[0],Y=we.top+window.scrollY-Math.max(24,(window.innerHeight-we.height)/3);window.scrollTo({top:Math.max(0,Y),behavior:"smooth"})}}return me.length}function St(){let[K,ue]=Me.length&&t?t():[],me=new Map;for(let we of Me)me.set(we.statement,[...me.get(we.statement)??[],we]);let Ce=[];for(let[we,Y]of me){let se=!1;for(let xe of U([we],K,ue)){let le=Re(xe);if(!le)continue;let rt=Be(le,"austere-focus");if(rt.style.setProperty("--austere-viewer",Y[0].colour),!se){se=!0;let Ze=document.createElement("div");Ze.className="austere-focus-names";for(let Lt of Y){let Ut=document.createElement("span");Ut.textContent=Lt.name,Ut.style.background=Lt.colour,Ze.appendChild(Ut)}rt.appendChild(Ze)}Ce.push(rt)}}Ae.replaceChildren(...Ce)}function qt(K){Me=K,St()}return{setQuickSwitch(K){m=K},setHistory(K){f=K,v&&x()},setMode(K){a=K==="annotate"?"annotate":"explore",document.documentElement.classList.toggle("austere-annotating",a==="annotate"),a!=="annotate"&&(q(),i.hidden=!0,r.hidden=!0)},flash:Ee,reveal:re,highlight:Ft,focus:qt}}var DEt={shadcn:{name:"@austere-axi/pack-shadcn",version:"0.16.0",components:["Progress","Avatar","AvatarGroup","Tooltip","HoverCard","Breadcrumb","BreadcrumbItem","Kbd","Skeleton","Calendar","Timeline","TimelineItem"]}};function xOa(e){let t=e.lastIndexOf("@");return t<=0?{name:e,version:""}:{name:e.slice(0,t),version:e.slice(t+1)}}var vOa=/^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,bOa=/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;function OEt(e){let t=[];for(let a of String(e||"").split(",")){let[o,r]=a.trim().split(/\s+/);if(!o)continue;let{name:n,version:i}=xOa(o);!vOa.test(n)||!bOa.test(i)||t.some(s=>s.name===n)||t.push(r&&/^sha(256|384|512)-[A-Za-z0-9+/=]+$/.test(r)?{name:n,version:i,integrity:r}:{name:n,version:i})}return t}var PEt="https://cdn.jsdelivr.net/npm";function BEt(e=document){let t=e.querySelector('meta[name="austere-packs"]');return t?OEt(t.getAttribute("content")||""):[]}function FEt(e,t){let a=[...t];for(let[o,r]of Object.entries(DEt))a.some(n=>n.name===r.name)||r.components.some(n=>new RegExp(`\\b${n}\\s*\\(`).test(e))&&a.push({name:r.name,version:r.version,bundled:o});return a}function AX(){return/\/__austere\/$/.test(w2)}function kOa(e){if(e.bundled)return{src:F4(`packs/${e.bundled}/pack.js`)||`${PEt}/austere-axi@${e.version}/dist/packs/${e.bundled}/pack.js`};if(AX()){let t=e.integrity?`?integrity=${encodeURIComponent(e.integrity)}`:"";return{src:`${w2}installed-packs/${encodeURIComponent(`${e.name}@${e.version}`)}/pack.js${t}`}}return{src:`${PEt}/${e.name}@${e.version}/dist/pack.js`,integrity:e.integrity}}function wOa(e,t){return new Promise((a,o)=>{let r=document.createElement("script");r.src=e,r.async=!0,t&&(r.integrity=t,r.crossOrigin="anonymous"),r.onload=()=>a(),r.onerror=()=>o(new Error(`could not load ${e}`)),document.head.appendChild(r)})}async function qEt(e,{onError:t}={}){let a=e.filter(o=>!hl().some(r=>r.name===o.name));return await Promise.all(a.map(o=>{let{src:r,integrity:n}=kOa(o);return wOa(r,n).then(()=>{hl().some(i=>i.name===o.name)||t?.(o,new Error(`${r} loaded but did not register pack ${o.name}`))},i=>t?.(o,i))})),hl()}function HEt(e){for(let t of e){if(!t.css)continue;let a=`austere-pack-css-${t.name.replace(/[^a-z0-9]/gi,"-")}`;if(document.getElementById(a))continue;let o=document.createElement("style");o.id=a,o.textContent=t.css,document.head.appendChild(o)}}var SOa=/[A-Za-z_$]/;function LOa(e){let t=[],a=String(e??""),o=0,r=1,n=a.length;for(;o<n;){let i=a[o];if(i===`
1763
1763
  `){r++,o++;continue}if(i===" "||i===" "||i==="\r"){o++;continue}if(i==="#"||i==="/"&&a[o+1]==="/"){for(;o<n&&a[o]!==`
1764
1764
  `;)o++;continue}let s=o,l=r,u=0,d=null,p=!1;for(;o<n;){let x=a[o];if(d){p?p=!1:x==="\\"?p=!0:x===d&&(d=null),x===`
1765
1765
  `&&r++,o++;continue}if(x==='"'||x==="'"){d=x,o++;continue}if(x==="#"||x==="/"&&a[o+1]==="/"){for(;o<n&&a[o]!==`
1766
1766
  `;)o++;continue}if(x==="("||x==="["||x==="{")u++;else if(x===")"||x==="]"||x==="}")u=Math.max(0,u-1);else if(x===`
1767
- `){if(u===0&&!IOa(a,o+1))break;r++}o++}let f=a.slice(s,o).replace(/\s+$/,""),m=/^\s*([A-Za-z_$][\w$]*)\s*=/.exec(f);m&&SOa.test(m[1][0])&&t.push({id:m[1],text:f,line:l,endLine:r})}return t}function IOa(e,t){let a=t;for(;a<e.length&&(e[a]===" "||e[a]===" ");)a++;return e[a]==="?"||e[a]===":"}function th(e){let t=new Map;for(let a of LOa(e))t.set(a.id,a);return t}function VEt(e,t){let a=th(e),o=th(t),r=[];for(let[n,i]of o){let s=a.get(n);(!s||jEt(s.text)!==jEt(i.text))&&r.push(n)}return r}function I9(e,t){let a=new RegExp(`(^|[^\\w$])${COa(t)}(?![\\w$])`),o=[];for(let[r,n]of e){if(r===t)continue;let i=n.text.slice(n.text.indexOf("=")+1);a.test(MOa(i))&&o.push(r)}return o}function MOa(e){return e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/gs,'""')}function jEt(e){return e.replace(/\s+/g," ").trim()}function COa(e){return e.replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")}var bv=oe(mt(),1),RX="0.15.0",_Oa='script[type="text/openui"], script[type="text/openui-lang"]';function AOa(){if(document.getElementById("austere-styles"))return;let e=document.createElement("style");if(e.id="austere-styles",e.textContent=[Sre,bre,kre,wre].join(`
1767
+ `){if(u===0&&!IOa(a,o+1))break;r++}o++}let f=a.slice(s,o).replace(/\s+$/,""),m=/^\s*([A-Za-z_$][\w$]*)\s*=/.exec(f);m&&SOa.test(m[1][0])&&t.push({id:m[1],text:f,line:l,endLine:r})}return t}function IOa(e,t){let a=t;for(;a<e.length&&(e[a]===" "||e[a]===" ");)a++;return e[a]==="?"||e[a]===":"}function th(e){let t=new Map;for(let a of LOa(e))t.set(a.id,a);return t}function VEt(e,t){let a=th(e),o=th(t),r=[];for(let[n,i]of o){let s=a.get(n);(!s||jEt(s.text)!==jEt(i.text))&&r.push(n)}return r}function I9(e,t){let a=new RegExp(`(^|[^\\w$])${COa(t)}(?![\\w$])`),o=[];for(let[r,n]of e){if(r===t)continue;let i=n.text.slice(n.text.indexOf("=")+1);a.test(MOa(i))&&o.push(r)}return o}function MOa(e){return e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/gs,'""')}function jEt(e){return e.replace(/\s+/g," ").trim()}function COa(e){return e.replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")}var bv=oe(mt(),1),RX="0.16.0",_Oa='script[type="text/openui"], script[type="text/openui-lang"]';function AOa(){if(document.getElementById("austere-styles"))return;let e=document.createElement("style");if(e.id="austere-styles",e.textContent=[Sre,bre,kre,wre].join(`
1768
1768
  `),document.head.appendChild(e),!document.querySelector('meta[name="viewport"]')){let t=document.createElement("meta");t.name="viewport",t.content="width=device-width, initial-scale=1",document.head.appendChild(t)}document.documentElement.classList.add("austere"),document.documentElement.style.colorScheme="dark"}function WEt(e){if(!e||typeof e!="object")return;let t={},a=Object.entries(e);for(let[o,r]of a)if(!o.startsWith("$"))if(r&&typeof r=="object"&&!Array.isArray(r))if("value"in r&&Object.keys(r).length<=3)t[o]=r.value;else{let n=WEt(r);n&&Object.keys(n).length&&(t[o]=n)}else t[o]=r;return Object.keys(t).length?t:void 0}function NOa(e){return!!e&&typeof e=="object"&&"austere"in e&&e.austere===1&&"type"in e&&typeof e.type=="string"}function TOa(){let e=window.parent&&window.parent!==window,t=new Map,a=o=>{e&&window.parent.postMessage({austere:1,...o},"*")};return window.addEventListener("message",o=>{if(o.source!==window.parent)return;let r=o.data;NOa(r)&&t.get(r.type)?.forEach(n=>n(r))}),{framed:e,connected:!1,send:a,on(o,r){let n=r,i=t.get(o)??new Set;return t.set(o,i),i.add(n),()=>{i.delete(n)}}}}function ZEt(e,t){e.framed?e.send({type:"open-url",url:t}):window.open(t,"_blank","noopener")}function NX(e){let t=document.createElement("div");t.className="austere-toast",t.setAttribute("data-austere-ui",""),t.textContent=e,document.body.appendChild(t),setTimeout(()=>t.classList.add("out"),2600),setTimeout(()=>t.remove(),3100)}function ROa(e){let t=[e.message];return e.form&&t.push(`form: ${JSON.stringify(e.form)}`),e.context!==void 0&&t.push(`context: ${JSON.stringify(e.context)}`),t.join(`
1769
1769
  `)}var TX=null,XEt=new Set,vv=yv,UEt="";function EOa(e,t){XEt.add(e.name);let a=!e.bundled&&AX()?" (`austere-axi check <file>` says why)":"";Ec({source:"pack",component:e.name,message:`pack ${e.name}@${e.version}: ${t.message}${a}`})}function zOa(){let e=hl(),t=e.map(a=>`${a.name}@${a.version}`).join(",");if(t===UEt)return vv;UEt=t,HEt(e);try{vv=e.length?IX(e.flatMap(a=>a.components),{onSkip:(a,o)=>Ec({source:"pack",component:a.name,message:o})}):yv}catch(a){Ec({source:"pack",message:`packs could not be added (${a.message}); rendering without them`}),vv=yv}return window.__austere.library=vv,vv}async function YEt(e){TX||(TX=BEt());let t=FEt(e,TX).filter(a=>!XEt.has(a.name));return t.some(a=>!hl().some(o=>o.name===a.name))&&await qEt(t,{onError:EOa}),zOa()}function DOa({programRef:e,initialLibrary:t,bridge:a,annotator:o,initialState:r}){let[n,i]=(0,Di.useState)({program:e.current,library:t}),s=n.program,l=(0,Di.useRef)(null);(0,Di.useEffect)(()=>a.on("source",async({program:f})=>{if(typeof f!="string"||f===e.current)return;let m=VEt(e.current,f);e.current=f,o?.highlight([]);let x=await YEt(f);e.current===f&&(l.current=m,i({program:f,library:x}))}),[a]),(0,Di.useEffect)(()=>a.on("reveal",({id:f})=>{o?.reveal(f,th(e.current),I9)}),[a,o]),(0,Di.useEffect)(()=>{let f=l.current;if(!f)return;l.current=null;let m=setTimeout(()=>{let x=th(e.current),v=f.filter(w=>w!=="root");o?.flash(v,"changed",x,I9),a.send({type:"changes",ids:v})},120);return()=>clearTimeout(m)},[s,o,a]);let u=(0,Di.useCallback)(f=>{if(f.type==="open_url"){let v=f.params?.url;typeof v=="string"&&/^(https?:|mailto:)/i.test(v)&&ZEt(a,v);return}if(f.type!=="continue_conversation")return;let m={kind:"action",message:f.humanFriendlyMessage||"(button)"},x=WEt(f.formState);if(x&&(m.form=x),f.params?.context!==void 0&&(m.context=f.params.context),a.connected)a.send({type:"action",item:m}),NX("Queued for the agent \u2014 press Send when ready");else{let v=ROa(m);navigator.clipboard?.writeText(v).then(()=>NX("Copied \u2014 paste it to your agent"),()=>NX(v))}},[a]),d=(0,Di.useCallback)(f=>{a.send({type:"errors",errors:(f||[]).map(m=>({source:m.source,code:m.code,statementId:m.statementId,message:m.message,hint:m.hint}))})},[a]),p=(0,Di.useCallback)(f=>a.send({type:"state",state:f}),[a]);return(0,bv.jsx)(vre,{mode:"dark",children:(0,bv.jsx)("main",{className:"austere-page",children:(0,bv.jsx)(b2,{response:s,library:n.library,isStreaming:!1,onAction:u,onError:d,onStateUpdate:p,initialState:r})})})}function $Et(){AOa();let t=document.querySelector(_Oa)?.textContent??"",a=document.createElement("div");a.id="austere-root",document.body.appendChild(a);let o=TOa(),r={current:t},n=null,i=null,s=YEt(t),l=f=>i||(i=s.then(m=>(0,GEt.createRoot)(a).render((0,bv.jsx)(DOa,{programRef:r,initialLibrary:m,bridge:o,annotator:n,initialState:f}))));if(!o.framed){l(void 0);return}let u={program:null,map:new Map},p=zEt({post:f=>o.send(f),lookup:()=>(u.program!==r.current&&(u={program:r.current,map:th(r.current)}),[u.map,I9])});n=p,o.on("highlight",({ids:f,scroll:m})=>{p.highlight(Array.isArray(f)?f.filter(x=>typeof x=="string"):[],!!m)}),o.on("history-counts",({counts:f})=>{let m={};if(f&&typeof f=="object")for(let[x,v]of Object.entries(f).slice(0,2e3))typeof v=="number"&&Number.isInteger(v)&&v>0&&(m[x]=v);p.setHistory(m)}),o.on("presence",({marks:f})=>{let m=x=>{let v=x;return!!v&&typeof v.statement=="string"&&typeof v.name=="string"&&typeof v.colour=="string"&&/^#[0-9a-f]{6}$/i.test(v.colour)};p.focus(Array.isArray(f)?f.filter(m).slice(0,50):[])}),document.addEventListener("click",f=>{if(f.defaultPrevented||f.button!==0)return;let m=f.target instanceof Element?f.target.closest("a[href]"):null;if(!(m instanceof HTMLAnchorElement)||!/^(https?|mailto):/i.test(m.href)||m.protocol===location.protocol&&m.host===location.host)return;let x=(m.getAttribute("target")||"").toLowerCase();!x||x==="_self"||(f.preventDefault(),ZEt(o,m.href))}),JQ(f=>o.send({type:"runtime-error",error:f})),o.on("init",async f=>{if(o.connected=!0,p.setMode(f.mode),p.setQuickSwitch(f.quickSwitch===!0),await l(f.state||void 0),f.scrollY>0){let m=0,x=()=>{window.scrollTo(0,f.scrollY),Math.abs(window.scrollY-f.scrollY)>2&&++m<20&&setTimeout(x,50)};setTimeout(x,30)}o.send({type:"ready",title:document.title,version:RX})}),o.on("mode",f=>p.setMode(f.mode)),window.addEventListener("scroll",()=>o.send({type:"scroll",y:window.scrollY}),{passive:!0}),o.send({type:"hello",title:document.title,version:RX}),setTimeout(()=>l(void 0),600)}window.__austere={version:RX,library:yv,packs:hl};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$Et,{once:!0}):setTimeout($Et,0);})();
1770
1770
  }
package/dist/catalog.json CHANGED
@@ -1 +1 @@
1
- {"format":1,"pack":"core","version":"0.15.0","groups":[{"name":"Layout","notes":["- A page is root = Stack([...sections], \"column\", \"l\"). Each section is a Card([CardHeader(title, subtitle), ...content]).","- Side by side: Stack([a, b], \"row\", \"m\", \"stretch\", \"start\", true). Cards in a row share the width.","- Tabs for alternative views, Accordion for detail the reader may skip, Steps for ordered procedures. Several blocks in one Card: label each with InlineHeader.","- Card children must match its list; anything else (Accordion, Tag, a Callout row) can sit in a Stack inside the Card, or directly in root's Stack."]},{"name":"Content","notes":["- MarkDownRenderer for prose, bullet lists and inline code; one statement per paragraph group so each is annotatable.","- Callout for the one thing the reader must not miss: a risk, a decision needed, a caveat.","- CodeBlock for a whole snippet. Image src may be a path relative to the artifact file.","- Architecture for systems: services, stores, queues, trust boundaries. Name every Node, Edge and Group. Over ~15 nodes, use lanes or split the diagram.","- lanes: for systems split by owner, repo or tier. Groups are the columns, left to right as listed; put every node in one, in reading order (plain groups for a heading without a frame). About 4 columns fit a laptop; wider ones scroll (check warns). Phones get the lanes stacked as bands. Pin row only to put boxes side by side or line them up.","- Diff for code changes: show the hunks that matter, not whole files. Hunk counts are recomputed, so only start lines matter."]},{"name":"Data","notes":["- Table is COLUMN-oriented: Table([Col(\"Option\", names), Col(\"Effort\", efforts), Col(\"Risk\", risks)]). Col data may mix strings and components, e.g. [\"n/a\", Tag(\"high\", null, \"sm\", \"danger\")]. Cells are plain text (no markdown) and wrap; Col type \"number\" for figures.","- EntityList for key/value facts; OverviewCardBlock + OverviewCardItem + MetricIndicatorInline for a KPI row.","- EditableTable when the reviewer should correct or fill in values; edits arrive with the next @ToAssistant from its Form.","- Icon names are lucide kebab-case (circle-check, triangle-alert, git-branch)."]},{"name":"Charts","notes":["- Charts take column arrays: BarChart(labels, [Series(\"p50\", [..]), Series(\"p99\", [..])], \"grouped\", \"Week\", \"ms\").","- PieChart(labels, values) with plain number arrays."]},{"name":"Forms","notes":["- Form(name, buttons, fields). Define each FormControl as its own statement. Never nest a Form in a Form.","- To ask the reviewer to decide: OptionCards or RadioGroup inside a Form whose button is Button(\"Send decision\", @ToAssistant(\"Decision: rollout strategy\"), \"primary\"). The values arrive with that message as form: {<formName>: {<fieldName>: value}}; no context needed. Reviewers can always annotate and message, so add a notes field only when it belongs with the decision.","- OptionCards(\"pick\", \"single\", [OptionCard(\"a\", \"Option A\", \"why\", Icon(\"zap\")), OptionCard(\"b\", \"Option B\")], {required: true}, \"a\") — the last argument pre-selects.","- rules: {required: true, minLength: 10, ...}; the renderer shows the messages."]},{"name":"Buttons","notes":["- @ToAssistant(message, context?) queues a message to the agent; @OpenUrl(url) opens a link. A Button with no action sends its label.","- Use buttons for follow-ups the reviewer can pick in one click: \"Go with option B\", \"Split this into two PRs\"."]}],"components":[{"name":"Card","group":"Layout","signature":"Card(children: (TextContent | MarkDownRenderer | CardHeader | Callout | CodeBlock | Image | Separator | HorizontalBarChart | PieChart | ScatterChart | AreaChart | BarChart | LineChart | Table | TagBlock | Form | Buttons | Steps | InlineHeader | EntityList | EditableTable | OverviewCardBlock | Tabs | Stack | Architecture | Diff | FileTree | Progress | Avatar | AvatarGroup | Tooltip | HoverCard | Breadcrumb | Kbd | Skeleton | Calendar | Timeline)[], variant?: \"card\" | \"sunk\" | \"clear\", direction?: \"row\" | \"column\", gap?: \"none\" | \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"2xl\", align?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\", justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\", wrap?: boolean)","description":"Styled container. variant: \"card\" (default, elevated) | \"sunk\" (recessed) | \"clear\" (transparent). Always full width. Accepts all Stack flex params (default: direction \"column\"). Cards flex to share space in row/wrap layouts.","tier":"core","pack":"core","examples":[]},{"name":"CardHeader","group":"Layout","signature":"CardHeader(title?: string, subtitle?: string)","description":"Header with optional title and subtitle","tier":"core","pack":"core","examples":[]},{"name":"TextContent","group":"Content","signature":"TextContent(text: string, size?: \"small\" | \"default\" | \"large\" | \"small-heavy\" | \"large-heavy\")","description":"Text block. Supports markdown. Optional size: \"small\" | \"default\" | \"large\" | \"small-heavy\" | \"large-heavy\".","tier":"core","pack":"core","examples":[]},{"name":"MarkDownRenderer","group":"Content","signature":"MarkDownRenderer(textMarkdown: string, variant?: \"clear\" | \"card\" | \"sunk\")","description":"Renders markdown text with optional container variant","tier":"core","pack":"core","examples":[]},{"name":"Callout","group":"Content","signature":"Callout(variant: \"info\" | \"warning\" | \"error\" | \"success\" | \"neutral\", title: string, description: string, visible?: $binding<boolean>)","description":"Callout banner. Optional visible is a reactive $boolean — auto-dismisses after 3s by setting $visible to false.","tier":"core","pack":"core","examples":[]},{"name":"Image","group":"Content","signature":"Image(alt: string, src?: string)","description":"Image with alt text and optional URL","tier":"core","pack":"core","examples":[]},{"name":"CodeBlock","group":"Content","signature":"CodeBlock(language: string, codeString: string)","description":"Syntax-highlighted code block","tier":"core","pack":"core","examples":[]},{"name":"InlineHeader","group":"Layout","signature":"InlineHeader(heading: string, description?: string)","description":"Compact section heading with an optional one-line description, for use inside cards.","tier":"core","pack":"core","examples":[]},{"name":"Table","group":"Data","signature":"Table(columns: Col[])","description":"Data table — column-oriented. Each Col holds its own data array.","tier":"core","pack":"core","examples":[]},{"name":"Col","group":"Data","signature":"Col(label: string, data: any, type?: \"string\" | \"number\" | \"action\")","description":"Column definition — holds label + data array","tier":"core","pack":"core","examples":[]},{"name":"EditableTable","group":"Data","signature":"EditableTable(name?: string, columns?: {type: \"text\" | \"number\" | \"date-single\" | \"select\" | \"url\", key?: string, header?: string, width?: number, options?: {value: string, label: string}[]}[], data?: {id: string, values: (string | number)[]}[])","description":"Spreadsheet-like table whose cells the user can edit inline (text, number, url, date, select columns); edits are saved back as a form field","tier":"extended","pack":"core","examples":[]},{"name":"BarChart","group":"Charts","signature":"BarChart(labels: string[], series: Series[], variant?: \"grouped\" | \"stacked\", xLabel?: string, yLabel?: string, height?: number)","description":"Vertical bars; use for comparing values across categories with one or more series","tier":"core","pack":"core","examples":[]},{"name":"LineChart","group":"Charts","signature":"LineChart(labels: string[], series: Series[], variant?: \"linear\" | \"natural\" | \"step\", xLabel?: string, yLabel?: string, height?: number)","description":"Lines over categories; use for trends and continuous data over time","tier":"core","pack":"core","examples":[]},{"name":"AreaChart","group":"Charts","signature":"AreaChart(labels: string[], series: Series[], variant?: \"linear\" | \"natural\" | \"step\", xLabel?: string, yLabel?: string, height?: number)","description":"Filled area under lines; use for cumulative totals or volume trends over time","tier":"extended","pack":"core","examples":[]},{"name":"HorizontalBarChart","group":"Charts","signature":"HorizontalBarChart(labels: string[], series: Series[], variant?: \"grouped\" | \"stacked\", xLabel?: string, yLabel?: string)","description":"Horizontal bars; prefer when category labels are long or for ranked lists","tier":"extended","pack":"core","examples":[]},{"name":"Series","group":"Charts","signature":"Series(category: string, values: number[])","description":"One data series","tier":"core","pack":"core","examples":[]},{"name":"PieChart","group":"Charts","signature":"PieChart(labels: string[], values: number[], variant?: \"pie\" | \"donut\", appearance?: \"circular\" | \"semiCircular\")","description":"Circular slices; use plucked arrays: PieChart(data.categories, data.values)","tier":"core","pack":"core","examples":[]},{"name":"ScatterChart","group":"Charts","signature":"ScatterChart(datasets: ScatterSeries[], xLabel?: string, yLabel?: string)","description":"X/Y scatter plot; use for correlations, distributions, and clustering","tier":"extended","pack":"core","examples":[]},{"name":"ScatterSeries","group":"Charts","signature":"ScatterSeries(name: string, points: Point[])","description":"Named dataset","tier":"extended","pack":"core","examples":[]},{"name":"Point","group":"Charts","signature":"Point(x: number, y: number, z?: number)","description":"Data point with numeric coordinates","tier":"extended","pack":"core","examples":[]},{"name":"Form","group":"Forms","signature":"Form(name: string, buttons: Buttons, fields?: FormControl[])","description":"Form container with fields and explicit action buttons","tier":"core","pack":"core","examples":[]},{"name":"FormControl","group":"Forms","signature":"FormControl(label: string, input: Input | TextArea | Select | Slider | CheckBoxGroup | RadioGroup | Chips | OptionCards, hint?: string)","description":"Field with label, input component, and optional hint text","tier":"core","pack":"core","examples":[]},{"name":"Label","group":"Forms","signature":"Label(text: string)","description":"Text label","tier":"extended","pack":"core","examples":[]},{"name":"Input","group":"Forms","signature":"Input(name: string, placeholder?: string, type?: \"text\" | \"email\" | \"password\" | \"number\" | \"url\", rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>)","description":"","tier":"core","pack":"core","examples":[]},{"name":"TextArea","group":"Forms","signature":"TextArea(name: string, placeholder?: string, rows?: number, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>)","description":"","tier":"core","pack":"core","examples":[]},{"name":"Select","group":"Forms","signature":"Select(name: string, items: SelectItem[], placeholder?: string, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>, size?: \"small\" | \"medium\" | \"large\")","description":"","tier":"core","pack":"core","examples":[]},{"name":"SelectItem","group":"Forms","signature":"SelectItem(value: string, label: string)","description":"Option for Select","tier":"core","pack":"core","examples":[]},{"name":"Slider","group":"Forms","signature":"Slider(name: string, variant: \"continuous\" | \"discrete\", min: number, max: number, step?: number, defaultValue?: number[], label?: string, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<number[]>)","description":"Numeric slider input; supports continuous and discrete (stepped) variants","tier":"extended","pack":"core","examples":[]},{"name":"CheckBoxGroup","group":"Forms","signature":"CheckBoxGroup(name: string, items: CheckBoxItem[], rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<Record<string, boolean>>)","description":"","tier":"extended","pack":"core","examples":[]},{"name":"CheckBoxItem","group":"Forms","signature":"CheckBoxItem(label: string, description: string, name: string, defaultChecked?: boolean)","description":"","tier":"extended","pack":"core","examples":[]},{"name":"RadioGroup","group":"Forms","signature":"RadioGroup(name: string, items: RadioItem[], defaultValue?: string, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>)","description":"","tier":"core","pack":"core","examples":[]},{"name":"RadioItem","group":"Forms","signature":"RadioItem(label: string, description: string, value: string)","description":"","tier":"core","pack":"core","examples":[]},{"name":"SwitchGroup","group":"Forms","signature":"SwitchGroup(name: string, items: SwitchItem[], variant?: \"clear\" | \"card\" | \"sunk\", value?: $binding<Record<string, boolean>>)","description":"Group of switch toggles","tier":"extended","pack":"core","examples":[]},{"name":"SwitchItem","group":"Forms","signature":"SwitchItem(label?: string, description?: string, name: string, defaultChecked?: boolean)","description":"Individual switch toggle","tier":"extended","pack":"core","examples":[]},{"name":"ChipItem","group":"Forms","signature":"ChipItem(value: string, label: string, icon?: Icon, disabled?: boolean)","description":"A single selectable chip inside a Chips group, with a value, label and optional icon.","tier":"extended","pack":"core","examples":[]},{"name":"Chips","group":"Forms","signature":"Chips(name: string, type?: \"single\" | \"multiple\", items?: ChipItem[], rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, defaultValue?: string | string[])","description":"A form field of compact selectable chips for choosing one or many short options; the selection is stored under `name`.","tier":"extended","pack":"core","examples":[]},{"name":"OptionCard","group":"Forms","signature":"OptionCard(value: string, title: string, subtitle?: string, topContent?: Icon | Image, disabled?: boolean)","description":"A single selectable card inside an OptionCards group, with a value, title, optional subtitle and an optional Icon or Image on top.","tier":"core","pack":"core","examples":[]},{"name":"OptionCards","group":"Forms","signature":"OptionCards(name: string, type?: \"single\" | \"multiple\", items?: OptionCard[], rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, defaultValue?: string | string[])","description":"A form field of selectable cards (title, optional subtitle, optional icon or image) laid out in a responsive grid for choosing one or many options; the selection is stored under `name`.","tier":"core","pack":"core","examples":[]},{"name":"Button","group":"Buttons","signature":"Button(label: string, action?: ActionExpression, variant?: \"primary\" | \"secondary\" | \"tertiary\", type?: \"normal\" | \"destructive\", size?: \"extra-small\" | \"small\" | \"medium\" | \"large\")","description":"Clickable button","tier":"core","pack":"core","examples":[]},{"name":"Buttons","group":"Buttons","signature":"Buttons(buttons: Button[], direction?: \"row\" | \"column\")","description":"Group of Button components. direction: \"row\" (default) | \"column\".","tier":"core","pack":"core","examples":[]},{"name":"Stack","group":"Layout","signature":"Stack(children: any[], direction?: \"row\" | \"column\", gap?: \"none\" | \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"2xl\", align?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\", justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\", wrap?: boolean)","description":"Flex container. direction: \"row\"|\"column\" (default \"column\"). gap: \"none\"|\"xs\"|\"s\"|\"m\"|\"l\"|\"xl\"|\"2xl\" (default \"m\"). align: \"start\"|\"center\"|\"end\"|\"stretch\"|\"baseline\". justify: \"start\"|\"center\"|\"end\"|\"between\"|\"around\"|\"evenly\".","tier":"core","pack":"core","examples":[]},{"name":"Tabs","group":"Layout","signature":"Tabs(items: TabItem[])","description":"Tabbed container","tier":"core","pack":"core","examples":[]},{"name":"TabItem","group":"Layout","signature":"TabItem(value: string, trigger: string, content: (TextContent | MarkDownRenderer | CardHeader | Callout | CodeBlock | Image | Separator | HorizontalBarChart | PieChart | ScatterChart | AreaChart | BarChart | LineChart | Table | TagBlock | Form | Buttons | Steps | InlineHeader | EntityList | EditableTable | OverviewCardBlock | Architecture | Diff | FileTree | Progress | Avatar | AvatarGroup | Tooltip | HoverCard | Breadcrumb | Kbd | Skeleton | Calendar | Timeline)[])","description":"value is unique id, trigger is tab label, content is array of components","tier":"core","pack":"core","examples":[]},{"name":"Accordion","group":"Layout","signature":"Accordion(items: AccordionItem[])","description":"Collapsible sections","tier":"core","pack":"core","examples":[]},{"name":"AccordionItem","group":"Layout","signature":"AccordionItem(value: string, trigger: string, content: (TextContent | MarkDownRenderer | CardHeader | Callout | CodeBlock | Image | Separator | HorizontalBarChart | PieChart | ScatterChart | AreaChart | BarChart | LineChart | Table | TagBlock | Form | Buttons | Steps | InlineHeader | EntityList | EditableTable | OverviewCardBlock | Architecture | Diff | FileTree | Progress | Avatar | AvatarGroup | Tooltip | HoverCard | Breadcrumb | Kbd | Skeleton | Calendar | Timeline)[])","description":"value is unique id, trigger is section title","tier":"core","pack":"core","examples":[]},{"name":"Steps","group":"Layout","signature":"Steps(items: StepsItem[])","description":"Step-by-step guide","tier":"core","pack":"core","examples":[]},{"name":"StepsItem","group":"Layout","signature":"StepsItem(title: string, details: string)","description":"title and details text for one step","tier":"core","pack":"core","examples":[]},{"name":"Separator","group":"Layout","signature":"Separator(orientation?: \"horizontal\" | \"vertical\", decorative?: boolean)","description":"Visual divider between content sections","tier":"core","pack":"core","examples":[]},{"name":"TagBlock","group":"Data","signature":"TagBlock(tags: string[], size?: \"sm\" | \"md\" | \"lg\")","description":"tags is an array of strings; optional size sm | md | lg","tier":"extended","pack":"core","examples":[]},{"name":"Tag","group":"Data","signature":"Tag(text: string, icon?: Icon, size?: \"sm\" | \"md\" | \"lg\", variant?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\")","description":"Styled tag/badge with optional Icon and variant","tier":"core","pack":"core","examples":[]},{"name":"Icon","group":"Data","signature":"Icon(name: string, category?: string)","description":"A lucide icon by kebab-case name (e.g. 'circle-check'). Optional category picks a topical fallback when the name doesn't resolve.","tier":"core","pack":"core","examples":[]},{"name":"EntityList","group":"Data","signature":"EntityList(rows?: {left: string, right: string, rightVariant?: \"text\" | \"number\"}[], size?: \"small\" | \"default\", header?: {left: string, right: string, rightVariant?: \"text\" | \"number\"}, footer?: {left: string, right: string, rightVariant?: \"text\" | \"number\"})","description":"Two-column key/value rows (left label, right value). size 'default' supports optional header and footer rows; rightVariant 'number' uses tabular numbers.","tier":"core","pack":"core","examples":[]},{"name":"Text","group":"Data","signature":"Text(variant?: \"text\" | \"number\", value: string, subtext?: string, subtextVariant?: \"text\" | \"number\" | \"metric\", size?: \"xs\" | \"sm\" | \"md\" | \"lg\")","description":"Plain text line with optional subtext. variant 'number' uses tabular number styling; subtextVariant 'metric' colors a leading +/- subtext green/red.","tier":"core","pack":"core","examples":[]},{"name":"BoldText","group":"Data","signature":"BoldText(variant?: \"text\" | \"number\", value: string, subtext?: string, subtextVariant?: \"text\" | \"number\" | \"metric\", size?: \"xs\" | \"sm\" | \"md\" | \"lg\")","description":"Emphasized (bold) text line with optional subtext. variant 'number' uses tabular number styling; subtextVariant 'metric' colors a leading +/- subtext green/red.","tier":"extended","pack":"core","examples":[]},{"name":"IconText","group":"Data","signature":"IconText(icon: Icon, iconVariant?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"inverted\" | \"filled\" | \"soft\", iconSize?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"sm\" | \"md\" | \"lg\", title: string, subtitle?: string, bold?: boolean, layout?: \"horizontal\" | \"vertical\")","description":"An icon badge with a title and optional subtitle, laid out horizontally or vertically. iconVariant sets the badge color.","tier":"extended","pack":"core","examples":[]},{"name":"MetricIndicatorInline","group":"Data","signature":"MetricIndicatorInline(value: string, subtext?: string, trend?: {direction: \"up\" | \"down\", value: number})","description":"Headline metric value with an optional +/- percentage trend and subtext, all on one line.","tier":"core","pack":"core","examples":[]},{"name":"OverviewCardItem","group":"Data","signature":"OverviewCardItem(id?: string, top: IconText | Text, bottom?: MetricIndicatorInline)","description":"One overview card: a heading slot at the top (IconText, ImageText or Text) and an optional MetricIndicatorInline at the bottom.","tier":"core","pack":"core","examples":[]},{"name":"OverviewCardBlock","group":"Data","signature":"OverviewCardBlock(items: OverviewCardItem[], layout?: \"grid\" | \"carousel\", responsive?: boolean, action?: ActionExpression, gap?: number | string)","description":"A grid or horizontal carousel of compact overview cards, each with a heading (icon/image/text) on top and an inline metric below; optionally clickable with a shared action.","tier":"core","pack":"core","examples":[]},{"name":"Architecture","group":"Content","signature":"Architecture(nodes: Node[], edges: Edge[], groups?: Group[], direction?: \"auto\" | \"right\" | \"down\" | \"lanes\")","description":"System diagram laid out automatically: write no coordinates. Every Node, Edge and Group is its own statement and click target. direction auto (default) runs right when that fits the page legibly, else down; lanes makes each top-level Group a column.","tier":"core","pack":"core","examples":["platformMap = Architecture([browser, edge, api, sessions, cache], [toEdge, toApi, readSessions, readCache], [vpc])\nbrowser = Node(\"Browser\", \"external\")\nedge = Node(\"Edge worker\", \"cloud\", \"Cloudflare\")\napi = Node(\"API\", \"backend\", \"Node :8080\")\nsessions = Node(\"Sessions\", \"database\", \"Postgres\", \"new\")\ncache = Node(\"Redis\", \"database\", \"read-through\")\ntoEdge = Edge(browser, edge, \"HTTPS\", \"emphasis\")\ntoApi = Edge(edge, api)\nreadSessions = Edge(api, sessions, \"SQL\")\nreadCache = Edge(api, cache, \"cache\", \"dashed\")\nvpc = Group(\"Platform VPC\", [api, sessions, cache])","ownership = Architecture([web, ordersApi, ledger, ordersDb, billingJob], [placeOrder, writeOrder, readOrders, postLedger], [clients, ordersRepo, billingRepo], \"lanes\")\nweb = Node(\"Web app\", \"frontend\")\nordersApi = Node(\"Orders API\", \"backend\", \"Node :8080\")\nordersDb = Node(\"orders table\", \"database\", \"Postgres\", null, \"success\")\nbillingJob = Node(\"Nightly billing\", \"backend\", \"cron 02:00\")\nledger = Node(\"Ledger\", \"database\", \"append-only\", null, \"info\")\nplaceOrder = Edge(web, ordersApi, \"POST /orders\")\nwriteOrder = Edge(ordersApi, ordersDb, \"insert\")\nreadOrders = Edge(billingJob, ordersDb, \"read unbilled\", null, \"danger\")\npostLedger = Edge(billingJob, ledger, \"post\")\nclients = Group(\"CLIENTS\", [web], \"plain\")\nordersRepo = Group(\"orders-service\", [ordersApi, ordersDb])\nbillingRepo = Group(\"billing\", [billingJob, ledger])"]},{"name":"Node","group":"Content","signature":"Node(label: string, kind?: \"frontend\" | \"backend\" | \"database\" | \"messagebus\" | \"cloud\" | \"security\" | \"external\", detail?: string, tag?: string, tone?: \"info\" | \"success\" | \"warning\" | \"danger\" | \"strong\", row?: number)","description":"A box in an Architecture. kind sets icon and color (default backend); detail is monospace, up to 2 lines (\\n breaks); tag is a small chip such as \"new\"; tone tints it (danger = risk, strong = where it ends); row pins it to a row (1, 2, ...) in lanes.","tier":"core","pack":"core","examples":[]},{"name":"Edge","group":"Content","signature":"Edge(from: Node, to: Node, label?: string, style?: \"solid\" | \"dashed\" | \"emphasis\" | \"security\", tone?: \"info\" | \"success\" | \"warning\" | \"danger\")","description":"An arrow between two Node statements (pass their names, not strings). style: dashed for async, emphasis for the main path, security for auth or trust flows. tone colors it, e.g. danger for a risky write, success for a read.","tier":"core","pack":"core","examples":[]},{"name":"Group","group":"Content","signature":"Group(label: string, members: Node[], kind?: \"region\" | \"security\" | \"plain\")","description":"A boundary around Node statements (a VPC, a cluster, a trust zone); members still sit where their edges put them. A group whose members are a subset of another's is drawn inside it; kind security draws it red, plain draws only its name.","tier":"core","pack":"core","examples":[]},{"name":"Diff","group":"Content","signature":"Diff(patch: string, title?: string)","description":"Unified diff (git diff output, one or more files) with line numbers. patch is a raw multi-line string. Clicked lines reach the agent as file:+line.","tier":"core","pack":"core","examples":["retryPatch = Diff(\"diff --git a/src/retry.ts b/src/retry.ts\n--- a/src/retry.ts\n+++ b/src/retry.ts\n@@ -10,2 +10,3 @@\n- for (let i = 0; i < 3; i++) {\n+ for (let i = 0; i < MAX_ATTEMPTS; i++) {\n+ if (i > 0) await sleep(backoff(i));\")"]},{"name":"FileTree","group":"Data","signature":"FileTree(entries: string[])","description":"File tree, one path per entry, optionally prefixed with a git status code (A new, M modified, D deleted, R old -> new) and suffixed with \" # note\". Folders are inferred. Clicked files and folders reach the agent by path.","tier":"core","pack":"core","examples":["changedFiles = FileTree([\"M src/session/store.ts # read-through to Postgres\", \"A src/session/pg-store.ts\", \"A migrations/0042_sessions.sql # table + expiry index\", \"R src/session/redis.ts -> src/session/redis-cache.ts\", \"D src/session/legacy.ts\", \"M src/config.ts # SESSIONS_PG flag\"])"]},{"name":"Progress","group":"Data","signature":"Progress(value: number, label?: string, max?: number)","description":"Progress bar. value counts toward max (default 100); label names what is progressing. Shows a percentage.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["migration = Progress(64, \"Rows migrated\")"]},{"name":"Avatar","group":"Data","signature":"Avatar(name: string, src?: string, size?: \"md\" | \"lg\")","description":"Round avatar for a person. Shows the initials of name; src is an optional https image URL.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["owner = Avatar(\"Ada Lovelace\")"]},{"name":"AvatarGroup","group":"Data","signature":"AvatarGroup(avatars: Avatar[], max?: number)","description":"Overlapping Avatars, for reviewers or owners. max (default 4) shows the rest as +N.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["team = AvatarGroup([ada, grace, linus], 2)\nada = Avatar(\"Ada Lovelace\")\ngrace = Avatar(\"Grace Hopper\")\nlinus = Avatar(\"Linus Torvalds\")"]},{"name":"Tooltip","group":"Content","signature":"Tooltip(text: string, tip: string)","description":"Inline text with a short hint on hover or focus (a term and its definition). Keep tip to one line.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["term = Tooltip(\"idempotent\", \"Safe to run twice with the same result.\")"]},{"name":"HoverCard","group":"Content","signature":"HoverCard(text: string, title: string, body?: string)","description":"Inline text that shows a small card (title and a line or two of body) on hover or focus, e.g. a person or a service.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["svc = HoverCard(\"billing-api\", \"billing-api\", \"Owns invoices and refunds. On call: payments team.\")"]},{"name":"Breadcrumb","group":"Content","signature":"Breadcrumb(items: BreadcrumbItem[])","description":"Path trail such as Repo / Package / File, from BreadcrumbItems. Each item is a click target.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["trail = Breadcrumb([repo, pkg, file])\nrepo = BreadcrumbItem(\"austere-axi\")\npkg = BreadcrumbItem(\"packs\")\nfile = BreadcrumbItem(\"shadcn\")"]},{"name":"BreadcrumbItem","group":"Content","signature":"BreadcrumbItem(label: string, href?: string)","description":"One step of a Breadcrumb. href is optional; the last item is the current page.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":[]},{"name":"Kbd","group":"Content","signature":"Kbd(keys: string)","description":"Keyboard shortcut. keys joins keys with \"+\", e.g. \"Ctrl+K\"; each key is drawn as a key cap.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["shortcut = Kbd(\"Ctrl+Shift+P\")"]},{"name":"Skeleton","group":"Content","signature":"Skeleton(lines?: number, shape?: \"lines\" | \"avatar\")","description":"Grey placeholder block for content not yet written or loaded (default 3 lines). shape avatar adds a round head.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["pending = Skeleton(3, \"avatar\")"]},{"name":"Calendar","group":"Data","signature":"Calendar(month: string, highlights?: string[])","description":"Read-only month grid (not a date picker). month is \"YYYY-MM\"; highlights lists \"YYYY-MM-DD\" or \"YYYY-MM-DD label\" entries to mark, e.g. a freeze or a release. Marked days are click targets.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["window = Calendar(\"2026-11\", [\"2026-11-04 Code freeze\", \"2026-11-12 Release\", \"2026-11-13\"])"]},{"name":"Timeline","group":"Content","signature":"Timeline(items: TimelineItem[])","description":"Vertical history or schedule of TimelineItems, oldest first. Each item is a click target.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["history = Timeline([found, fixed, rollout])\nfound = TimelineItem(\"Bug found\", \"Oct 28\", \"Retries double-charge on timeout.\")\nfixed = TimelineItem(\"Fix merged\", \"Oct 29\", \"Idempotency key added.\", \"current\")\nrollout = TimelineItem(\"Rollout\", \"Nov 3\", \"\", \"upcoming\")"]},{"name":"TimelineItem","group":"Content","signature":"TimelineItem(title: string, date?: string, detail?: string, state?: \"done\" | \"current\" | \"upcoming\")","description":"One event in a Timeline. state: done (default), current or upcoming.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":[]}]}
1
+ {"format":1,"pack":"core","version":"0.16.0","groups":[{"name":"Layout","notes":["- A page is root = Stack([...sections], \"column\", \"l\"). Each section is a Card([CardHeader(title, subtitle), ...content]).","- Side by side: Stack([a, b], \"row\", \"m\", \"stretch\", \"start\", true). Cards in a row share the width.","- Tabs for alternative views, Accordion for detail the reader may skip, Steps for ordered procedures. Several blocks in one Card: label each with InlineHeader.","- Card children must match its list; anything else (Accordion, Tag, a Callout row) can sit in a Stack inside the Card, or directly in root's Stack."]},{"name":"Content","notes":["- MarkDownRenderer for prose, bullet lists and inline code; one statement per paragraph group so each is annotatable.","- Callout for the one thing the reader must not miss: a risk, a decision needed, a caveat.","- CodeBlock for a whole snippet. Image src may be a path relative to the artifact file.","- Architecture for systems: services, stores, queues, trust boundaries. Name every Node, Edge and Group. Over ~15 nodes, use lanes or split the diagram.","- lanes: for systems split by owner, repo or tier. Groups are the columns, left to right as listed; put every node in one, in reading order (plain groups for a heading without a frame). About 4 columns fit a laptop; wider ones scroll (check warns). Phones get the lanes stacked as bands. Pin row only to put boxes side by side or line them up.","- Diff for code changes: show the hunks that matter, not whole files. Hunk counts are recomputed, so only start lines matter."]},{"name":"Data","notes":["- Table is COLUMN-oriented: Table([Col(\"Option\", names), Col(\"Effort\", efforts), Col(\"Risk\", risks)]). Col data may mix strings and components, e.g. [\"n/a\", Tag(\"high\", null, \"sm\", \"danger\")]. Cells are plain text (no markdown) and wrap; Col type \"number\" for figures.","- EntityList for key/value facts; OverviewCardBlock + OverviewCardItem + MetricIndicatorInline for a KPI row.","- EditableTable when the reviewer should correct or fill in values; edits arrive with the next @ToAssistant from its Form.","- Icon names are lucide kebab-case (circle-check, triangle-alert, git-branch)."]},{"name":"Charts","notes":["- Charts take column arrays: BarChart(labels, [Series(\"p50\", [..]), Series(\"p99\", [..])], \"grouped\", \"Week\", \"ms\").","- PieChart(labels, values) with plain number arrays."]},{"name":"Forms","notes":["- Form(name, buttons, fields). Define each FormControl as its own statement. Never nest a Form in a Form.","- To ask the reviewer to decide: OptionCards or RadioGroup inside a Form whose button is Button(\"Send decision\", @ToAssistant(\"Decision: rollout strategy\"), \"primary\"). The values arrive with that message as form: {<formName>: {<fieldName>: value}}; no context needed. Reviewers can always annotate and message, so add a notes field only when it belongs with the decision.","- OptionCards(\"pick\", \"single\", [OptionCard(\"a\", \"Option A\", \"why\", Icon(\"zap\")), OptionCard(\"b\", \"Option B\")], {required: true}, \"a\") — the last argument pre-selects.","- rules: {required: true, minLength: 10, ...}; the renderer shows the messages."]},{"name":"Buttons","notes":["- @ToAssistant(message, context?) queues a message to the agent; @OpenUrl(url) opens a link. A Button with no action sends its label.","- Use buttons for follow-ups the reviewer can pick in one click: \"Go with option B\", \"Split this into two PRs\"."]}],"components":[{"name":"Card","group":"Layout","signature":"Card(children: (TextContent | MarkDownRenderer | CardHeader | Callout | CodeBlock | Image | Separator | HorizontalBarChart | PieChart | ScatterChart | AreaChart | BarChart | LineChart | Table | TagBlock | Form | Buttons | Steps | InlineHeader | EntityList | EditableTable | OverviewCardBlock | Tabs | Stack | Architecture | Diff | FileTree | Progress | Avatar | AvatarGroup | Tooltip | HoverCard | Breadcrumb | Kbd | Skeleton | Calendar | Timeline)[], variant?: \"card\" | \"sunk\" | \"clear\", direction?: \"row\" | \"column\", gap?: \"none\" | \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"2xl\", align?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\", justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\", wrap?: boolean)","description":"Styled container. variant: \"card\" (default, elevated) | \"sunk\" (recessed) | \"clear\" (transparent). Always full width. Accepts all Stack flex params (default: direction \"column\"). Cards flex to share space in row/wrap layouts.","tier":"core","pack":"core","examples":[]},{"name":"CardHeader","group":"Layout","signature":"CardHeader(title?: string, subtitle?: string)","description":"Header with optional title and subtitle","tier":"core","pack":"core","examples":[]},{"name":"TextContent","group":"Content","signature":"TextContent(text: string, size?: \"small\" | \"default\" | \"large\" | \"small-heavy\" | \"large-heavy\")","description":"Text block. Supports markdown. Optional size: \"small\" | \"default\" | \"large\" | \"small-heavy\" | \"large-heavy\".","tier":"core","pack":"core","examples":[]},{"name":"MarkDownRenderer","group":"Content","signature":"MarkDownRenderer(textMarkdown: string, variant?: \"clear\" | \"card\" | \"sunk\")","description":"Renders markdown text with optional container variant","tier":"core","pack":"core","examples":[]},{"name":"Callout","group":"Content","signature":"Callout(variant: \"info\" | \"warning\" | \"error\" | \"success\" | \"neutral\", title: string, description: string, visible?: $binding<boolean>)","description":"Callout banner. Optional visible is a reactive $boolean — auto-dismisses after 3s by setting $visible to false.","tier":"core","pack":"core","examples":[]},{"name":"Image","group":"Content","signature":"Image(alt: string, src?: string)","description":"Image with alt text and optional URL","tier":"core","pack":"core","examples":[]},{"name":"CodeBlock","group":"Content","signature":"CodeBlock(language: string, codeString: string)","description":"Syntax-highlighted code block","tier":"core","pack":"core","examples":[]},{"name":"InlineHeader","group":"Layout","signature":"InlineHeader(heading: string, description?: string)","description":"Compact section heading with an optional one-line description, for use inside cards.","tier":"core","pack":"core","examples":[]},{"name":"Table","group":"Data","signature":"Table(columns: Col[])","description":"Data table — column-oriented. Each Col holds its own data array.","tier":"core","pack":"core","examples":[]},{"name":"Col","group":"Data","signature":"Col(label: string, data: any, type?: \"string\" | \"number\" | \"action\")","description":"Column definition — holds label + data array","tier":"core","pack":"core","examples":[]},{"name":"EditableTable","group":"Data","signature":"EditableTable(name?: string, columns?: {type: \"text\" | \"number\" | \"date-single\" | \"select\" | \"url\", key?: string, header?: string, width?: number, options?: {value: string, label: string}[]}[], data?: {id: string, values: (string | number)[]}[])","description":"Spreadsheet-like table whose cells the user can edit inline (text, number, url, date, select columns); edits are saved back as a form field","tier":"extended","pack":"core","examples":[]},{"name":"BarChart","group":"Charts","signature":"BarChart(labels: string[], series: Series[], variant?: \"grouped\" | \"stacked\", xLabel?: string, yLabel?: string, height?: number)","description":"Vertical bars; use for comparing values across categories with one or more series","tier":"core","pack":"core","examples":[]},{"name":"LineChart","group":"Charts","signature":"LineChart(labels: string[], series: Series[], variant?: \"linear\" | \"natural\" | \"step\", xLabel?: string, yLabel?: string, height?: number)","description":"Lines over categories; use for trends and continuous data over time","tier":"core","pack":"core","examples":[]},{"name":"AreaChart","group":"Charts","signature":"AreaChart(labels: string[], series: Series[], variant?: \"linear\" | \"natural\" | \"step\", xLabel?: string, yLabel?: string, height?: number)","description":"Filled area under lines; use for cumulative totals or volume trends over time","tier":"extended","pack":"core","examples":[]},{"name":"HorizontalBarChart","group":"Charts","signature":"HorizontalBarChart(labels: string[], series: Series[], variant?: \"grouped\" | \"stacked\", xLabel?: string, yLabel?: string)","description":"Horizontal bars; prefer when category labels are long or for ranked lists","tier":"extended","pack":"core","examples":[]},{"name":"Series","group":"Charts","signature":"Series(category: string, values: number[])","description":"One data series","tier":"core","pack":"core","examples":[]},{"name":"PieChart","group":"Charts","signature":"PieChart(labels: string[], values: number[], variant?: \"pie\" | \"donut\", appearance?: \"circular\" | \"semiCircular\")","description":"Circular slices; use plucked arrays: PieChart(data.categories, data.values)","tier":"core","pack":"core","examples":[]},{"name":"ScatterChart","group":"Charts","signature":"ScatterChart(datasets: ScatterSeries[], xLabel?: string, yLabel?: string)","description":"X/Y scatter plot; use for correlations, distributions, and clustering","tier":"extended","pack":"core","examples":[]},{"name":"ScatterSeries","group":"Charts","signature":"ScatterSeries(name: string, points: Point[])","description":"Named dataset","tier":"extended","pack":"core","examples":[]},{"name":"Point","group":"Charts","signature":"Point(x: number, y: number, z?: number)","description":"Data point with numeric coordinates","tier":"extended","pack":"core","examples":[]},{"name":"Form","group":"Forms","signature":"Form(name: string, buttons: Buttons, fields?: FormControl[])","description":"Form container with fields and explicit action buttons","tier":"core","pack":"core","examples":[]},{"name":"FormControl","group":"Forms","signature":"FormControl(label: string, input: Input | TextArea | Select | Slider | CheckBoxGroup | RadioGroup | Chips | OptionCards, hint?: string)","description":"Field with label, input component, and optional hint text","tier":"core","pack":"core","examples":[]},{"name":"Label","group":"Forms","signature":"Label(text: string)","description":"Text label","tier":"extended","pack":"core","examples":[]},{"name":"Input","group":"Forms","signature":"Input(name: string, placeholder?: string, type?: \"text\" | \"email\" | \"password\" | \"number\" | \"url\", rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>)","description":"","tier":"core","pack":"core","examples":[]},{"name":"TextArea","group":"Forms","signature":"TextArea(name: string, placeholder?: string, rows?: number, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>)","description":"","tier":"core","pack":"core","examples":[]},{"name":"Select","group":"Forms","signature":"Select(name: string, items: SelectItem[], placeholder?: string, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>, size?: \"small\" | \"medium\" | \"large\")","description":"","tier":"core","pack":"core","examples":[]},{"name":"SelectItem","group":"Forms","signature":"SelectItem(value: string, label: string)","description":"Option for Select","tier":"core","pack":"core","examples":[]},{"name":"Slider","group":"Forms","signature":"Slider(name: string, variant: \"continuous\" | \"discrete\", min: number, max: number, step?: number, defaultValue?: number[], label?: string, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<number[]>)","description":"Numeric slider input; supports continuous and discrete (stepped) variants","tier":"extended","pack":"core","examples":[]},{"name":"CheckBoxGroup","group":"Forms","signature":"CheckBoxGroup(name: string, items: CheckBoxItem[], rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<Record<string, boolean>>)","description":"","tier":"extended","pack":"core","examples":[]},{"name":"CheckBoxItem","group":"Forms","signature":"CheckBoxItem(label: string, description: string, name: string, defaultChecked?: boolean)","description":"","tier":"extended","pack":"core","examples":[]},{"name":"RadioGroup","group":"Forms","signature":"RadioGroup(name: string, items: RadioItem[], defaultValue?: string, rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, value?: $binding<string>)","description":"","tier":"core","pack":"core","examples":[]},{"name":"RadioItem","group":"Forms","signature":"RadioItem(label: string, description: string, value: string)","description":"","tier":"core","pack":"core","examples":[]},{"name":"SwitchGroup","group":"Forms","signature":"SwitchGroup(name: string, items: SwitchItem[], variant?: \"clear\" | \"card\" | \"sunk\", value?: $binding<Record<string, boolean>>)","description":"Group of switch toggles","tier":"extended","pack":"core","examples":[]},{"name":"SwitchItem","group":"Forms","signature":"SwitchItem(label?: string, description?: string, name: string, defaultChecked?: boolean)","description":"Individual switch toggle","tier":"extended","pack":"core","examples":[]},{"name":"ChipItem","group":"Forms","signature":"ChipItem(value: string, label: string, icon?: Icon, disabled?: boolean)","description":"A single selectable chip inside a Chips group, with a value, label and optional icon.","tier":"extended","pack":"core","examples":[]},{"name":"Chips","group":"Forms","signature":"Chips(name: string, type?: \"single\" | \"multiple\", items?: ChipItem[], rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, defaultValue?: string | string[])","description":"A form field of compact selectable chips for choosing one or many short options; the selection is stored under `name`.","tier":"extended","pack":"core","examples":[]},{"name":"OptionCard","group":"Forms","signature":"OptionCard(value: string, title: string, subtitle?: string, topContent?: Icon | Image, disabled?: boolean)","description":"A single selectable card inside an OptionCards group, with a value, title, optional subtitle and an optional Icon or Image on top.","tier":"core","pack":"core","examples":[]},{"name":"OptionCards","group":"Forms","signature":"OptionCards(name: string, type?: \"single\" | \"multiple\", items?: OptionCard[], rules?: {required?: boolean, email?: boolean, url?: boolean, numeric?: boolean, min?: number, max?: number, minLength?: number, maxLength?: number, pattern?: string}, defaultValue?: string | string[])","description":"A form field of selectable cards (title, optional subtitle, optional icon or image) laid out in a responsive grid for choosing one or many options; the selection is stored under `name`.","tier":"core","pack":"core","examples":[]},{"name":"Button","group":"Buttons","signature":"Button(label: string, action?: ActionExpression, variant?: \"primary\" | \"secondary\" | \"tertiary\", type?: \"normal\" | \"destructive\", size?: \"extra-small\" | \"small\" | \"medium\" | \"large\")","description":"Clickable button","tier":"core","pack":"core","examples":[]},{"name":"Buttons","group":"Buttons","signature":"Buttons(buttons: Button[], direction?: \"row\" | \"column\")","description":"Group of Button components. direction: \"row\" (default) | \"column\".","tier":"core","pack":"core","examples":[]},{"name":"Stack","group":"Layout","signature":"Stack(children: any[], direction?: \"row\" | \"column\", gap?: \"none\" | \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"2xl\", align?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\", justify?: \"start\" | \"center\" | \"end\" | \"between\" | \"around\" | \"evenly\", wrap?: boolean)","description":"Flex container. direction: \"row\"|\"column\" (default \"column\"). gap: \"none\"|\"xs\"|\"s\"|\"m\"|\"l\"|\"xl\"|\"2xl\" (default \"m\"). align: \"start\"|\"center\"|\"end\"|\"stretch\"|\"baseline\". justify: \"start\"|\"center\"|\"end\"|\"between\"|\"around\"|\"evenly\".","tier":"core","pack":"core","examples":[]},{"name":"Tabs","group":"Layout","signature":"Tabs(items: TabItem[])","description":"Tabbed container","tier":"core","pack":"core","examples":[]},{"name":"TabItem","group":"Layout","signature":"TabItem(value: string, trigger: string, content: (TextContent | MarkDownRenderer | CardHeader | Callout | CodeBlock | Image | Separator | HorizontalBarChart | PieChart | ScatterChart | AreaChart | BarChart | LineChart | Table | TagBlock | Form | Buttons | Steps | InlineHeader | EntityList | EditableTable | OverviewCardBlock | Architecture | Diff | FileTree | Progress | Avatar | AvatarGroup | Tooltip | HoverCard | Breadcrumb | Kbd | Skeleton | Calendar | Timeline)[])","description":"value is unique id, trigger is tab label, content is array of components","tier":"core","pack":"core","examples":[]},{"name":"Accordion","group":"Layout","signature":"Accordion(items: AccordionItem[])","description":"Collapsible sections","tier":"core","pack":"core","examples":[]},{"name":"AccordionItem","group":"Layout","signature":"AccordionItem(value: string, trigger: string, content: (TextContent | MarkDownRenderer | CardHeader | Callout | CodeBlock | Image | Separator | HorizontalBarChart | PieChart | ScatterChart | AreaChart | BarChart | LineChart | Table | TagBlock | Form | Buttons | Steps | InlineHeader | EntityList | EditableTable | OverviewCardBlock | Architecture | Diff | FileTree | Progress | Avatar | AvatarGroup | Tooltip | HoverCard | Breadcrumb | Kbd | Skeleton | Calendar | Timeline)[])","description":"value is unique id, trigger is section title","tier":"core","pack":"core","examples":[]},{"name":"Steps","group":"Layout","signature":"Steps(items: StepsItem[])","description":"Step-by-step guide","tier":"core","pack":"core","examples":[]},{"name":"StepsItem","group":"Layout","signature":"StepsItem(title: string, details: string)","description":"title and details text for one step","tier":"core","pack":"core","examples":[]},{"name":"Separator","group":"Layout","signature":"Separator(orientation?: \"horizontal\" | \"vertical\", decorative?: boolean)","description":"Visual divider between content sections","tier":"core","pack":"core","examples":[]},{"name":"TagBlock","group":"Data","signature":"TagBlock(tags: string[], size?: \"sm\" | \"md\" | \"lg\")","description":"tags is an array of strings; optional size sm | md | lg","tier":"extended","pack":"core","examples":[]},{"name":"Tag","group":"Data","signature":"Tag(text: string, icon?: Icon, size?: \"sm\" | \"md\" | \"lg\", variant?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\")","description":"Styled tag/badge with optional Icon and variant","tier":"core","pack":"core","examples":[]},{"name":"Icon","group":"Data","signature":"Icon(name: string, category?: string)","description":"A lucide icon by kebab-case name (e.g. 'circle-check'). Optional category picks a topical fallback when the name doesn't resolve.","tier":"core","pack":"core","examples":[]},{"name":"EntityList","group":"Data","signature":"EntityList(rows?: {left: string, right: string, rightVariant?: \"text\" | \"number\"}[], size?: \"small\" | \"default\", header?: {left: string, right: string, rightVariant?: \"text\" | \"number\"}, footer?: {left: string, right: string, rightVariant?: \"text\" | \"number\"})","description":"Two-column key/value rows (left label, right value). size 'default' supports optional header and footer rows; rightVariant 'number' uses tabular numbers.","tier":"core","pack":"core","examples":[]},{"name":"Text","group":"Data","signature":"Text(variant?: \"text\" | \"number\", value: string, subtext?: string, subtextVariant?: \"text\" | \"number\" | \"metric\", size?: \"xs\" | \"sm\" | \"md\" | \"lg\")","description":"Plain text line with optional subtext. variant 'number' uses tabular number styling; subtextVariant 'metric' colors a leading +/- subtext green/red.","tier":"core","pack":"core","examples":[]},{"name":"BoldText","group":"Data","signature":"BoldText(variant?: \"text\" | \"number\", value: string, subtext?: string, subtextVariant?: \"text\" | \"number\" | \"metric\", size?: \"xs\" | \"sm\" | \"md\" | \"lg\")","description":"Emphasized (bold) text line with optional subtext. variant 'number' uses tabular number styling; subtextVariant 'metric' colors a leading +/- subtext green/red.","tier":"extended","pack":"core","examples":[]},{"name":"IconText","group":"Data","signature":"IconText(icon: Icon, iconVariant?: \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"inverted\" | \"filled\" | \"soft\", iconSize?: \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"sm\" | \"md\" | \"lg\", title: string, subtitle?: string, bold?: boolean, layout?: \"horizontal\" | \"vertical\")","description":"An icon badge with a title and optional subtitle, laid out horizontally or vertically. iconVariant sets the badge color.","tier":"extended","pack":"core","examples":[]},{"name":"MetricIndicatorInline","group":"Data","signature":"MetricIndicatorInline(value: string, subtext?: string, trend?: {direction: \"up\" | \"down\", value: number})","description":"Headline metric value with an optional +/- percentage trend and subtext, all on one line.","tier":"core","pack":"core","examples":[]},{"name":"OverviewCardItem","group":"Data","signature":"OverviewCardItem(id?: string, top: IconText | Text, bottom?: MetricIndicatorInline)","description":"One overview card: a heading slot at the top (IconText, ImageText or Text) and an optional MetricIndicatorInline at the bottom.","tier":"core","pack":"core","examples":[]},{"name":"OverviewCardBlock","group":"Data","signature":"OverviewCardBlock(items: OverviewCardItem[], layout?: \"grid\" | \"carousel\", responsive?: boolean, action?: ActionExpression, gap?: number | string)","description":"A grid or horizontal carousel of compact overview cards, each with a heading (icon/image/text) on top and an inline metric below; optionally clickable with a shared action.","tier":"core","pack":"core","examples":[]},{"name":"Architecture","group":"Content","signature":"Architecture(nodes: Node[], edges: Edge[], groups?: Group[], direction?: \"auto\" | \"right\" | \"down\" | \"lanes\")","description":"System diagram laid out automatically: write no coordinates. Every Node, Edge and Group is its own statement and click target. direction auto (default) runs right when that fits the page legibly, else down; lanes makes each top-level Group a column.","tier":"core","pack":"core","examples":["platformMap = Architecture([browser, edge, api, sessions, cache], [toEdge, toApi, readSessions, readCache], [vpc])\nbrowser = Node(\"Browser\", \"external\")\nedge = Node(\"Edge worker\", \"cloud\", \"Cloudflare\")\napi = Node(\"API\", \"backend\", \"Node :8080\")\nsessions = Node(\"Sessions\", \"database\", \"Postgres\", \"new\")\ncache = Node(\"Redis\", \"database\", \"read-through\")\ntoEdge = Edge(browser, edge, \"HTTPS\", \"emphasis\")\ntoApi = Edge(edge, api)\nreadSessions = Edge(api, sessions, \"SQL\")\nreadCache = Edge(api, cache, \"cache\", \"dashed\")\nvpc = Group(\"Platform VPC\", [api, sessions, cache])","ownership = Architecture([web, ordersApi, ledger, ordersDb, billingJob], [placeOrder, writeOrder, readOrders, postLedger], [clients, ordersRepo, billingRepo], \"lanes\")\nweb = Node(\"Web app\", \"frontend\")\nordersApi = Node(\"Orders API\", \"backend\", \"Node :8080\")\nordersDb = Node(\"orders table\", \"database\", \"Postgres\", null, \"success\")\nbillingJob = Node(\"Nightly billing\", \"backend\", \"cron 02:00\")\nledger = Node(\"Ledger\", \"database\", \"append-only\", null, \"info\")\nplaceOrder = Edge(web, ordersApi, \"POST /orders\")\nwriteOrder = Edge(ordersApi, ordersDb, \"insert\")\nreadOrders = Edge(billingJob, ordersDb, \"read unbilled\", null, \"danger\")\npostLedger = Edge(billingJob, ledger, \"post\")\nclients = Group(\"CLIENTS\", [web], \"plain\")\nordersRepo = Group(\"orders-service\", [ordersApi, ordersDb])\nbillingRepo = Group(\"billing\", [billingJob, ledger])"]},{"name":"Node","group":"Content","signature":"Node(label: string, kind?: \"frontend\" | \"backend\" | \"database\" | \"messagebus\" | \"cloud\" | \"security\" | \"external\", detail?: string, tag?: string, tone?: \"info\" | \"success\" | \"warning\" | \"danger\" | \"strong\", row?: number)","description":"A box in an Architecture. kind sets icon and color (default backend); detail is monospace, up to 2 lines (\\n breaks); tag is a small chip such as \"new\"; tone tints it (danger = risk, strong = where it ends); row pins it to a row (1, 2, ...) in lanes.","tier":"core","pack":"core","examples":[]},{"name":"Edge","group":"Content","signature":"Edge(from: Node, to: Node, label?: string, style?: \"solid\" | \"dashed\" | \"emphasis\" | \"security\", tone?: \"info\" | \"success\" | \"warning\" | \"danger\")","description":"An arrow between two Node statements (pass their names, not strings). style: dashed for async, emphasis for the main path, security for auth or trust flows. tone colors it, e.g. danger for a risky write, success for a read.","tier":"core","pack":"core","examples":[]},{"name":"Group","group":"Content","signature":"Group(label: string, members: Node[], kind?: \"region\" | \"security\" | \"plain\")","description":"A boundary around Node statements (a VPC, a cluster, a trust zone); members still sit where their edges put them. A group whose members are a subset of another's is drawn inside it; kind security draws it red, plain draws only its name.","tier":"core","pack":"core","examples":[]},{"name":"Diff","group":"Content","signature":"Diff(patch: string, title?: string)","description":"Unified diff (git diff output, one or more files) with line numbers. patch is a raw multi-line string. Clicked lines reach the agent as file:+line.","tier":"core","pack":"core","examples":["retryPatch = Diff(\"diff --git a/src/retry.ts b/src/retry.ts\n--- a/src/retry.ts\n+++ b/src/retry.ts\n@@ -10,2 +10,3 @@\n- for (let i = 0; i < 3; i++) {\n+ for (let i = 0; i < MAX_ATTEMPTS; i++) {\n+ if (i > 0) await sleep(backoff(i));\")"]},{"name":"FileTree","group":"Data","signature":"FileTree(entries: string[])","description":"File tree, one path per entry, optionally prefixed with a git status code (A new, M modified, D deleted, R old -> new) and suffixed with \" # note\". Folders are inferred. Clicked files and folders reach the agent by path.","tier":"core","pack":"core","examples":["changedFiles = FileTree([\"M src/session/store.ts # read-through to Postgres\", \"A src/session/pg-store.ts\", \"A migrations/0042_sessions.sql # table + expiry index\", \"R src/session/redis.ts -> src/session/redis-cache.ts\", \"D src/session/legacy.ts\", \"M src/config.ts # SESSIONS_PG flag\"])"]},{"name":"Progress","group":"Data","signature":"Progress(value: number, label?: string, max?: number)","description":"Progress bar. value counts toward max (default 100); label names what is progressing. Shows a percentage.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["migration = Progress(64, \"Rows migrated\")"]},{"name":"Avatar","group":"Data","signature":"Avatar(name: string, src?: string, size?: \"md\" | \"lg\")","description":"Round avatar for a person. Shows the initials of name; src is an optional https image URL.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["owner = Avatar(\"Ada Lovelace\")"]},{"name":"AvatarGroup","group":"Data","signature":"AvatarGroup(avatars: Avatar[], max?: number)","description":"Overlapping Avatars, for reviewers or owners. max (default 4) shows the rest as +N.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["team = AvatarGroup([ada, grace, linus], 2)\nada = Avatar(\"Ada Lovelace\")\ngrace = Avatar(\"Grace Hopper\")\nlinus = Avatar(\"Linus Torvalds\")"]},{"name":"Tooltip","group":"Content","signature":"Tooltip(text: string, tip: string)","description":"Inline text with a short hint on hover or focus (a term and its definition). Keep tip to one line.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["term = Tooltip(\"idempotent\", \"Safe to run twice with the same result.\")"]},{"name":"HoverCard","group":"Content","signature":"HoverCard(text: string, title: string, body?: string)","description":"Inline text that shows a small card (title and a line or two of body) on hover or focus, e.g. a person or a service.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["svc = HoverCard(\"billing-api\", \"billing-api\", \"Owns invoices and refunds. On call: payments team.\")"]},{"name":"Breadcrumb","group":"Content","signature":"Breadcrumb(items: BreadcrumbItem[])","description":"Path trail such as Repo / Package / File, from BreadcrumbItems. Each item is a click target.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["trail = Breadcrumb([repo, pkg, file])\nrepo = BreadcrumbItem(\"austere-axi\")\npkg = BreadcrumbItem(\"packs\")\nfile = BreadcrumbItem(\"shadcn\")"]},{"name":"BreadcrumbItem","group":"Content","signature":"BreadcrumbItem(label: string, href?: string)","description":"One step of a Breadcrumb. href is optional; the last item is the current page.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":[]},{"name":"Kbd","group":"Content","signature":"Kbd(keys: string)","description":"Keyboard shortcut. keys joins keys with \"+\", e.g. \"Ctrl+K\"; each key is drawn as a key cap.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["shortcut = Kbd(\"Ctrl+Shift+P\")"]},{"name":"Skeleton","group":"Content","signature":"Skeleton(lines?: number, shape?: \"lines\" | \"avatar\")","description":"Grey placeholder block for content not yet written or loaded (default 3 lines). shape avatar adds a round head.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["pending = Skeleton(3, \"avatar\")"]},{"name":"Calendar","group":"Data","signature":"Calendar(month: string, highlights?: string[])","description":"Read-only month grid (not a date picker). month is \"YYYY-MM\"; highlights lists \"YYYY-MM-DD\" or \"YYYY-MM-DD label\" entries to mark, e.g. a freeze or a release. Marked days are click targets.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["window = Calendar(\"2026-11\", [\"2026-11-04 Code freeze\", \"2026-11-12 Release\", \"2026-11-13\"])"]},{"name":"Timeline","group":"Content","signature":"Timeline(items: TimelineItem[])","description":"Vertical history or schedule of TimelineItems, oldest first. Each item is a click target.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":["history = Timeline([found, fixed, rollout])\nfound = TimelineItem(\"Bug found\", \"Oct 28\", \"Retries double-charge on timeout.\")\nfixed = TimelineItem(\"Fix merged\", \"Oct 29\", \"Idempotency key added.\", \"current\")\nrollout = TimelineItem(\"Rollout\", \"Nov 3\", \"\", \"upcoming\")"]},{"name":"TimelineItem","group":"Content","signature":"TimelineItem(title: string, date?: string, detail?: string, state?: \"done\" | \"current\" | \"upcoming\")","description":"One event in a Timeline. state: done (default), current or upcoming.","tier":"extended","pack":"@austere-axi/pack-shadcn","examples":[]}]}
@@ -1,3 +1,3 @@
1
- (()=>{function t(e,s={},...n){let a=document.createElement(e);for(let[o,l]of Object.entries(s))l==null||l===!1||(o==="class"?a.className=String(l):o.startsWith("on")?typeof l=="function"&&a.addEventListener(o.slice(2),l):o==="text"?a.textContent=String(l):o==="html"?a.innerHTML=String(l):a.setAttribute(o,l===!0?"":String(l)));for(let o of n.flat())o!=null&&o!==!1&&a.append(o instanceof Node?o:document.createTextNode(String(o)));return a}var Ee="http://www.w3.org/2000/svg",p=e=>["path",{d:e}],R=(e,s,n,a={})=>["circle",{cx:e,cy:s,r:n,...a}],_e=(e,s,n,a,o)=>["rect",{x:e,y:s,width:n,height:a,rx:o}],ut={inbox:[p("M22 12h-6l-2 3h-4l-2-3H2"),p("M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z")],file:[p("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),p("M14 3v5h5")],message:[p("M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z")],annotate:[p("M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"),p("M12 7v6M9 10h6")],explore:[p("m5 4 6 15 2-6 6-2z")],terminal:[p("m5 8 4 4-4 4"),p("M12 17h7")],sliders:[p("M4 6h8"),p("M18 6h2"),R(15,6,2.5),p("M4 12h2"),p("M12 12h8"),R(9,12,2.5),p("M4 18h8"),p("M18 18h2"),R(15,18,2.5)],search:[R(11,11,7),p("m20 20-3.5-3.5")],chevronDown:[p("m6 9 6 6 6-6")],chevronRight:[p("m9 6 6 6-6 6")],pencil:[p("M12 20h8"),p("M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z")],person:[R(12,8,3.5),p("M5 20a7 7 0 0 1 14 0")],alert:[p("M12 4 3 19h18z"),p("M12 10v4"),p("M12 16.6v.4")],bolt:[p("M13 3 5 13h6l-1 8 8-10h-6z")],waiting:[R(12,12,8,{"stroke-dasharray":"3.2 3.2"})],archive:[_e(3,4,18,4,1),p("M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8"),p("M10 12h4")],branch:[R(6,5,2),R(6,19,2),R(18,8,2),p("M6 7v10"),p("M18 10c0 4-4 5-12 5")],clock:[R(12,12,8),p("M12 8v4l3 2")],arrowRight:[p("M5 12h14M13 6l6 6-6 6")],close:[p("M6 6l12 12M18 6 6 18")],panel:[_e(3,4,18,16,2),p("M15 4v16")],menu:[p("M4 6h16M4 12h16M4 18h16")],check:[p("m5 12 5 5 9-10")]};function j(e,{size:s=16,width:n=1.7,label:a,cls:o}={}){return he(ut[e],{size:s,width:n,label:a,cls:o})}function he(e,{size:s=16,width:n=1.7,label:a,cls:o}={}){let l=document.createElementNS(Ee,"svg"),r=(u,d)=>{for(let[h,_]of Object.entries(d))u.setAttribute(h,String(_))};r(l,{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round","stroke-linejoin":"round",class:`icon${o?` ${o}`:""}`}),a?r(l,{role:"img","aria-label":a}):l.setAttribute("aria-hidden","true");for(let[u,d]of e){let h=document.createElementNS(Ee,u);r(h,d),l.append(h)}return l}var ht=[{id:"people",label:"People and access"},{id:"network",label:"Network"},{id:"review",label:"Review defaults"},{id:"projects",label:"Projects"},{id:"about",label:"About"}],pt=[["path",{d:"M12 5v14M5 12h14"}]];async function Re(e,s={}){let n;try{n=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)})}catch{return{ok:!1,error:"Could not reach austere-axi. Check that it is still running, then reload."}}let a=await n.json().catch(()=>({}));return n.ok?{ok:!0,data:a}:{ok:!1,error:a.error||`austere-axi answered ${n.status}`}}var gt={link:"Named link",request:"Approved request",tailscale:"Tailscale login"};function q(e){return e.split("`").map((s,n)=>n%2?t("code",{text:s}):s)}function A(e,s){return t("label",{class:"field"},t("span",{text:e}),s)}function D(e,s,n,a){let o=t("select",{name:e,"aria-label":a},s.map(([l,r])=>t("option",{value:l,text:r,selected:l===n})));return o.addEventListener("change",()=>o.dataset.touched="1"),o}function Ae(e,s={}){return t("input",{type:"checkbox",role:"switch",class:"toggle",checked:e,...s})}function ae(e,s,n,a=null){return t("div",{class:"set-head"},t("div",{class:"set-head-text"},t("h2",{id:`set-${e}-h`,text:s}),t("p",{class:"summary"},n)),a)}function U(e,s,n,a,o=""){let l=`set-h-${e}`;return t("section",{class:`set-part${o?` ${o}`:""}`,"aria-labelledby":l},t("h3",{id:l},s,n==null?null:t("span",{class:"n",text:` \xB7 ${n}`})),a)}function mt(e){let s=e.trim().charAt(0).toUpperCase();return t("span",{class:"set-avatar","aria-hidden":"true"},s||j("person",{size:16,width:1.8}))}function wt(e,s){return t("div",{class:"set-cmd"},t("code",{text:s}),t("button",{type:"button",class:"btn",text:"Copy","aria-label":`Copy ${s}`,onclick:()=>re(e,s,"The command")}))}function pe(e){return e.dataset.touched?e.value==="auto":void 0}function ie(e,s,n){let a=[];if(s&&a.push(["page","This page"]),n)a.push([`project:${n.id}`,`Every page in ${n.name}`]);else for(let o of e)a.push([`project:${o.id}`,`Every page in ${o.name}`]);return a.push(["all","Every page"]),a}function oe(e){return e.startsWith("project:")?{scope:"project",project:e.slice(8)}:{scope:e}}var ge=[["hold","Hold notes for me"],["auto","Send notes straight to the agent"]];async function Me(e){let[s,n,a,o,l]=await Promise.all([e.get("/hub/api/settings"),e.get("/hub/api/people"),e.get("/hub/api/people/requests"),e.get("/hub/api/projects"),e.get("/hub/api/pages")]),r=o.projects,u=s.review.auto?"auto":"hold",d=async(i,f,y)=>{let g=await Re(i,f);e.say(g.ok?y(g.data):g.error),g.ok&&e.again()},h=(i,f,y={})=>t("button",{type:"button",class:"btn ghost",text:i,onclick:()=>{f()},...y}),_=i=>{let f=i.file?e.tilde(i.file):"a page no longer in the hub",y=[i.verifiedLogin?`${i.verifiedLogin}${i.tailscaleDevice?` on ${i.tailscaleDevice}`:""} (verified by Tailscale)`:null,i.addr,i.host?`(${i.host})`:null,i.browser].filter(Boolean).join(" \xB7 "),g=D("scope",ie(r,!!i.file,i.project),"page",`What ${i.name} can review`),v=D("mode",ge,u,`Where ${i.name}'s notes go`);return t("li",{class:"set-ask","data-request":i.id},mt(i.name),t("div",{class:"set-who"},t("span",{class:"row-title",text:i.name}),t("span",{class:"meta",text:`Asks for ${f} \xB7 ${e.when(i.createdAt)}`}),y?t("span",{class:"meta",text:y}):null),t("div",{class:"set-actions"},g,v,h("Approve",()=>d(`/hub/api/people/requests/${i.id}/approve`,{...oe(g.value),auto:pe(v)},I=>`${i.name} is in: ${I.device?.reaches??"approved"}. The browser that asked opens the page by itself.`),{class:"btn primary"}),h("Deny",()=>d(`/hub/api/people/requests/${i.id}/deny`,{},()=>`Denied ${i.name}. That browser may ask again.`)),h("Block",()=>d(`/hub/api/people/requests/${i.id}/block`,{},()=>`Blocked ${i.name}'s browser: it can no longer ask.`),{class:"btn ghost danger"})))},L=(i,f,y)=>{let g=Ae(f);return g.addEventListener("change",()=>{d("/hub/api/people/requests/switch",y?{on:g.checked,project:y}:{on:g.checked},()=>`Requests ${g.checked?"on":"off"} ${y?`for ${i}`:"for every page"}.`)}),t("label",{class:"switch"},t("span",{class:"set-switch-text",text:i}),g)},w=new Map(a.switch.projects.map(i=>[i.id,i.on])),m=t("div",{class:"switches"},L("Every page",a.switch.all,null),r.length?t("p",{class:"meta",text:"A project's own choice wins over every page's:"}):null,r.map(i=>L(i.name,w.get(i.id)??a.switch.all,i.id))),b=i=>t("li",{class:"set-line","data-link":i.id},t("div",{class:"set-who"},t("span",{class:"row-title",text:i.name}),t("span",{class:"meta",text:`Reaches ${i.reaches} \xB7 ${i.auto?"notes go straight to the agent":"notes held for you"} \xB7 ${i.reusable?"old-style link: any browser can use it, no expiry":`made ${e.when(i.createdAt)}, expires ${e.when(i.expiresAt)}`}`})),t("div",{class:"set-actions"},i.link?h("Copy link",()=>re(e,i.link,`${i.name}'s link`),{class:"btn"}):null,i.reusable?h("Make single-use",()=>d(`/hub/api/people/${i.id}/single-use`,{},()=>`${i.name}'s link now works once and expires in 7 days. Send the new link; the old one stopped.`)):null,h("Cancel link",()=>d(`/hub/api/people/${i.id}/revoke`,{},()=>`Cancelled ${i.name}'s link.`),{"aria-label":`Cancel ${i.name}'s link`}))),$=(i,f,y=null)=>t("div",{class:"set-cell"},t("span",{class:"set-lbl",text:`${i}: `}),t("span",{text:f}),y?t("span",{class:"meta",text:y}):null),te=i=>{let f=D("scope",[["","Change what they reach\u2026"],...ie(r,!1,null)],"",`What ${i.name} can review`);f.addEventListener("change",()=>{f.value&&d(`/hub/api/people/${i.id}/scope`,oe(f.value),v=>`${i.name} now reaches ${v.reaches}.`)});let y=()=>{let v=prompt(`New name for ${i.name}`,i.name);v&&v.trim()&&v.trim()!==i.name&&d(`/hub/api/people/${i.id}/rename`,{name:v.trim()},I=>`Renamed ${i.name} to ${I.name}.`)},g=i.lastAddr?`from ${i.lastAddr}${i.lastHost?` (${i.lastHost})`:""}`:null;return t("li",{class:"set-dev","data-device":i.id},t("div",{class:"set-cell name"},t("span",{class:"row-title",text:i.name}),i.verifiedLogin?t("span",{class:"meta verified",text:`Tailscale: ${i.verifiedLogin} (verified)`}):null),$("Got in by",gt[i.origin]??i.origin,e.when(i.claimedAt)),$("Reaches",i.reaches),$("Notes go",i.auto?"Straight to the agent":"Held for you"),$("Last seen",i.lastSeenAt?e.when(i.lastSeenAt):"Not seen yet",g),t("div",{class:"set-actions"},e.notesOf({id:i.id,name:i.name}),h("Rename",y,{class:"btn text","aria-label":`Rename ${i.name}`}),h("Revoke",()=>confirm(`Revoke ${i.name}? Their open pages stop at once.`)&&d(`/hub/api/people/${i.id}/revoke`,{},()=>`Revoked ${i.name}. Their open pages stopped.`),{class:"btn text danger","aria-label":`Revoke ${i.name}`}),f))},se=n.devices.length?t("div",{class:"set-devices"},t("div",{class:"set-dev-head","aria-hidden":"true"},["Device","Got in by","Reaches","Notes go","Last seen",""].map(i=>t("span",{text:i}))),t("ul",{class:"set-dev-list"},n.devices.map(te))):e.empty("No device has access yet."),O=ft(e,l.pages,r,u,s.network.share!=null),F=U("new-link","New link",null,O),Ze=()=>{F.scrollIntoView({block:"start"}),F.querySelector("input[name=name]")?.focus({preventScroll:!0})},ne=a.waiting.length,et=t("section",{id:"set-people",class:"set","aria-labelledby":"set-people-h"},ae("people","People and access",q("Who may open your pages from another device, and what they reach. A link works for one browser: the first one that opens it. At a terminal: `austere-axi share`."),t("button",{type:"button",class:"btn",onclick:Ze},he(pt,{size:14,width:2}),"New link")),U("waiting","Waiting for access",ne,ne?t("ul",{class:"set-asks"},a.waiting.map(_)):e.empty("Nobody is asking."),ne?"waiting":""),U("links","Links nobody has opened yet",n.links.length,n.links.length?t("ul",{class:"set-lines"},n.links.map(b)):e.empty("None.")),U("devices","Devices with access",n.devices.length,se),F,a.blocked.length?U("blocked","Blocked",a.blocked.length,t("ul",{class:"set-lines"},a.blocked.map(i=>t("li",{class:"set-line"},t("div",{class:"set-who"},t("span",{class:"row-title",text:i.name}),t("span",{class:"meta",text:[i.addr,i.host,i.browser,e.when(i.decidedAt)].filter(Boolean).join(" \xB7 ")})))))):null,U("ask","Browsers without a link may ask for access",null,m,"set-asking")),S=s.network,tt={this_computer:"this computer",tailscale:"Tailscale",local_network:"local network, reviewers only",added:"added at a terminal"},st={link_url:"set by AUSTERE_AXI_LINK_URL",link_host:"set by AUSTERE_AXI_LINK_HOST",tailscale:"this computer's Tailscale address",host:"the address AUSTERE_AXI_HOST names",lan:"the local-network address you switched on"},H=S.always_on,nt=H.mode==="service"?`On: ${H.supervisor==="launchd"?"launchd":"systemd"} runs it${H.unit?` (${H.unit})`:""} and starts it again when it stops.`:H.mode==="kept_on"?"On while this process runs: it was started to stay on, but no service starts it again after a restart of the computer.":`Off: it stops after ${e.plural(H.idle_minutes??30,"minute")} without use, and the next command starts it again.`,at=t("section",{id:"set-network",class:"set","aria-labelledby":"set-network-h"},ae("network","Network","Where this server can be reached. It never listens on every address."),t("div",{class:"set-block"},t("span",{class:"set-label",text:"Answers on"}),t("ul",{class:"plain set-addrs"},S.addresses.map(i=>t("li",{"data-kind":i.kind},t("code",{text:i.url}),t("span",{class:"k",text:tt[i.kind]}),S.share?.url===i.url?t("span",{class:"set-pill",text:"Address to share"}):null)))),t("div",{class:"set-block"},t("span",{class:"set-label",text:"Address to share"}),t("div",{class:"share-addr"},S.share?[t("code",{text:S.share.url}),h("Copy",()=>re(e,S.share.url,"The address"),{class:"btn"}),t("span",{class:"meta",text:st[S.share.from]})]:t("span",{class:"warn",text:"None: only this computer can reach the server, so no link can be shared. Start Tailscale, switch on the local network below, or set AUSTERE_AXI_HOST at a terminal."}))),t("div",{class:"set-block"},t("span",{class:"set-label",text:"Tailscale"}),t("span",{text:S.tailscale?`${S.tailscale.dns_name?`${S.tailscale.dns_name} \xB7 `:""}${S.tailscale.ip}`:"Not running here."})),t("div",{class:"set-block setting","data-slot":"tailscale-identity"},vt(S.tailscale_names,r,u,d)),t("div",{class:"set-block setting","data-slot":"local-network"},bt(S.lan,d)),t("div",{class:"set-block","data-always":H.mode},t("span",{class:"set-title",text:"Always on"}),t("span",{class:"meta",text:nt}),H.mode==="service"?null:[t("span",{class:"meta",text:"To keep it running, at a terminal:"}),wt(e,"austere-axi server install")])),je=(i,f,y)=>{let g=`set-mode-${i}`,v=t("input",{type:"radio",id:g,name:"default-mode",value:i,checked:i===u,"aria-describedby":`${g}-d`});return v.addEventListener("change",()=>{d("/hub/api/settings/review",{auto:i==="auto"},I=>I.message)}),t("div",{class:"set-opt"},v,t("label",{for:g,text:f}),t("span",{class:"meta",id:`${g}-d`,text:y}))},ue=s.review.viewing,it=t("section",{id:"set-review",class:"set","aria-labelledby":"set-review-h"},ae("review","Review defaults",q("For reviewers you let in from now on, unless you say otherwise when you share or approve. Those already in keep their own. At a terminal: `austere-axi share default hold|auto`.")),t("fieldset",{class:"modes"},t("legend",{text:"A new reviewer's notes"}),je("hold","Hold them for me","You read each note and decide which ones the agent gets"),je("auto","Send them straight to the agent","Not available on pages an agent is attached to")),U("viewing","On pages now",ue.length,ue.length?t("ul",{class:"set-viewing"},ue.map(i=>t("li",{},t("a",{class:"row-title",href:`/hub/open/${i.id}`,title:i.file,text:i.title}),t("span",{class:"meta",text:i.viewers.map(f=>f.role==="owner"?"you":f.name).join(", ")})))):e.empty("Nobody has a page open."))),ot=new Set(s.gone_folders),rt=i=>{let f=()=>{let g=prompt(`New name for ${i.name}`,i.name);g&&g.trim()&&g.trim()!==i.name&&d(`/hub/api/projects/${i.id}/rename`,{name:g.trim()},v=>v.message)},y=g=>{let v=ot.has(g),I=()=>(!v||confirm(`${g} is gone. Forget it and archive its pages? Their notes are kept.`))&&d(`/hub/api/projects/${i.id}/forget-root`,{root:g,drop:v},dt=>dt.message);return t("li",{class:v?"gone":""},t("code",{text:e.tilde(g),title:g}),v?t("span",{class:"set-gone",text:"folder is gone"}):null,i.roots.length>1||v?h(v?"Forget the missing folder":"Forget",I,{class:v?"btn":"btn text","aria-label":`Forget the folder ${g}`}):null)};return t("li",{class:"set-line","data-project":i.id},t("div",{class:"set-who"},t("span",{class:"row-title"},i.name,t("span",{class:"set-dim",text:` \xB7 ${e.plural(i.pages,"page")} \xB7 ${e.plural(i.roots.length,"folder")}`})),t("ul",{class:"plain folders"},i.roots.map(y)),i.same_as?t("p",{class:"same"},`Same repository as ${i.same_as.name}. `,h(`Merge into ${i.same_as.name}`,()=>confirm(`Move the folders and pages of ${i.name} into ${i.same_as.name}? ${i.name} goes away.`)&&d(`/hub/api/projects/${i.same_as.id}/merge`,{from:i.id},g=>g.message))):null),t("div",{class:"set-actions"},h("Rename",f,{"aria-label":`Rename ${i.name}`})))},lt=t("section",{id:"set-projects",class:"set","aria-labelledby":"set-projects-h"},ae("projects","Projects",q("A project is a name and the folders its pages live in. Worktrees of one repository share a project. At a terminal: `austere-axi project`.")),r.length?t("ul",{class:"set-lines set-flush"},r.map(rt)):t("div",{class:"set-block"},e.empty("No projects yet.")),t("div",{class:"missing set-foot"},s.missing?[t("span",{text:`${e.plural(s.missing,"page")} opened for review ${s.missing===1?"has":"have"} a file that is gone. Archiving keeps ${s.missing===1?"its":"their"} notes.`}),h("Archive missing pages",()=>d("/hub/api/projects/archive-missing",{},i=>i.message))]:t("span",{text:"No page opened for review has a missing file."}))),ct=t("section",{id:"set-about",class:"set","aria-labelledby":"set-about-h"},t("div",{class:"set-head"},t("h2",{id:"set-about-h",text:"About"})),t("dl",{class:"facts"},t("dt",{text:"Version"}),t("dd",{text:s.about.version}),t("dt",{text:"State folder"}),t("dd",{},t("code",{text:e.tilde(s.about.state_dir),title:s.about.state_dir})),t("dt",{text:"Port"}),t("dd",{text:String(S.port)})),t("div",{class:"set-block"},s.about.newer_cli?t("p",{class:"warn note-older"},q(`This server runs ${s.about.version}, older than the austere-axi ${s.about.newer_cli} you use at the terminal. Restart it to update: \`austere-axi server restart\`.`)):null,t("p",{class:"meta"},q("Stays at a terminal: anything that runs a command, such as `server install`, `adapter set` and `trigger add`."))));return[t("div",{class:"set-page"},t("div",{class:"set-top"},t("h1",{text:"Settings"}),t("p",{class:"summary",text:"This server only: who can review, where it is reachable, and how. Hosted pages keep their own invites."})),t("nav",{class:"set-nav","aria-label":"Settings sections"},ht.map(i=>{let f=i.id==="people"?ne:0;return t("a",{href:`#set-${i.id}`,class:f?"waiting":"","aria-label":f?`${i.label}, ${f} waiting`:null,onclick:y=>{y.preventDefault(),document.getElementById(`set-${i.id}`)?.scrollIntoView({block:"start"})}},i.label,f?t("span",{class:"n",text:String(f)}):null)})),et,t("div",{class:"set-grid"},at,t("div",{class:"set-col"},it,ct)),lt)]}function re(e,s,n){if(!navigator.clipboard)return e.say(`Copy it by hand: ${s}`);navigator.clipboard.writeText(s).then(()=>e.say(`${n} is copied.`),()=>e.say(`Copy it by hand: ${s}`))}function ft(e,s,n,a,o){if(!o)return e.empty("Only this computer can reach the server, so a link would not open anywhere else. See Network.");if(!s.length)return e.empty("No page is open for review yet. Open one, then share it here or from its menu.");let l=t("input",{type:"text",name:"name",maxlength:"40",required:!0,placeholder:"Their name","aria-label":"Their name",autocomplete:"off"}),r=t("select",{name:"page","aria-label":"Page"},s.map(m=>t("option",{value:m.open_id,text:`${m.title||m.rel_path} \xB7 ${m.project}`}))),u=()=>{let m=s.find(b=>b.open_id===r.value);return m?{id:m.project_id,name:m.project}:null},d=t("select",{name:"scope","aria-label":"They can review"}),h=()=>d.replaceChildren(...ie(n,!0,u()).map(([m,b])=>t("option",{value:m,text:b})));h(),r.addEventListener("change",h);let _=D("mode",ge,a,"Their notes"),L=t("p",{class:"error",role:"alert",hidden:!0}),w=t("form",{class:"new-link"},A("Name",l),A("Page",r),A("They can review",d),A("Their notes",_),t("button",{type:"submit",class:"btn primary",text:"Create link"}));return w.addEventListener("submit",async m=>{m.preventDefault();let b=await Re("/hub/api/people/share",{page:r.value,name:l.value,...oe(d.value),auto:pe(_)});if(!b.ok){L.textContent=b.error,L.hidden=!1;return}let $=b.data;e.say(`Link for ${$.name}, reaching ${$.reaches}: ${$.link} \u2014 works once, until ${new Date($.expiresAt).toLocaleString()} if nobody opens it. Send it only to ${$.name}.`,t("button",{type:"button",class:"btn tiny",text:"Copy link",onclick:()=>re(e,$.link,"The link")})),e.again()}),t("div",{class:"set-form"},w,L)}function vt(e,s,n,a){let o=e?"On: a reviewer who comes in over Tailscale is named by Tailscale (login and device, shown as verified). Asked only for connections to this server's Tailscale address, never from a header.":"Off: the server does not listen on Tailscale here, so nobody is named by it. A reviewer is known by the device you let in.",l=t("input",{type:"text",name:"login",maxlength:"200",required:!0,placeholder:"ana@example.com","aria-label":"Tailscale login",autocomplete:"off"}),r=t("input",{type:"text",name:"name",maxlength:"40",placeholder:"Name to show (default: the login)","aria-label":"Name to show",autocomplete:"off"}),u=ie(s,!1,null),d=D("scope",u,u[0][0],"They can review"),h=D("mode",ge,n,"Their notes"),_=t("form",{class:"login-form","data-form":"tailscale-login"},A("Tailscale login",l),A("Name",r),A("They can review",d),A("Their notes",h),t("button",{type:"submit",class:"btn",text:"Let in"}));return _.addEventListener("submit",L=>{L.preventDefault(),a("/hub/api/people/tailscale",{login:l.value.trim(),name:r.value.trim()||void 0,...oe(d.value),auto:pe(h)},w=>`${w.verifiedLogin??w.name} is in on any of their Tailscale devices: ${w.reaches}. Listed under Devices; Revoke there.`)}),[t("span",{class:"set-title",text:"Names from Tailscale"}),t("span",{class:"meta",text:o}),t("p",{class:"meta"},q("A Tailscale login gets in without a link or a request: any device signed in to Tailscale as that login opens what it reaches, over Tailscale only. At a terminal: `austere-axi share tailscale <login> --all`.")),_]}var Le="Traffic on this network is not encrypted. Others on the same network could read pages, notes and reviewers' access. Use it on a network you trust, or use Tailscale or HTTPS.";function bt(e,s){let n=e.address!=null,a=e.choices.map(u=>[u.address,`${u.address} (${u.iface})`]);e.address&&!a.some(([u])=>u===e.address)&&a.unshift([e.address,`${e.address} (not on this computer now)`]);let o=D("lan-address",a,e.address??a[0]?.[0]??"","Address on the local network");o.disabled=n||!a.length;let l=Ae(n,{disabled:!a.length,"aria-describedby":"lan-warn"});l.addEventListener("change",()=>{if(l.checked&&!confirm(`Listen on ${o.value}? ${Le}`)){l.checked=!1;return}s("/hub/api/settings/network",{lan:l.checked?o.value:null},u=>u.message)});let r=n?e.listening?`on at ${e.url}`:`on, but this computer does not have ${e.address} now`:"off";return[t("label",{class:"switch"},t("span",{class:"set-switch-text"},t("span",{class:"set-title",text:"Local network"}),t("span",{class:"meta",text:`Listen on the local network: ${r}`})),l),a.length?t("div",{class:"login-form"},A("Address",o)):t("span",{class:"meta",text:"This computer is on no local network."}),t("p",{class:"meta",id:"lan-warn"},q(`Reviewers only: the owner never signs in there, and no link with the owner key points there. ${Le} At a terminal: \`austere-axi server lan <address>\`.`))]}var we=window.__AUSTERE_HUB__??{version:"",home:"",sep:"/"},ye=[{id:"inbox",label:"Inbox",icon:"inbox"},{id:"pages",label:"Pages",icon:"file"},{id:"notes",label:"Notes",icon:"message"},{id:"runs",label:"Runs",icon:"terminal"},{id:"settings",label:"Settings",icon:"sliders"}],Pe=e=>ye.some(s=>s.id===e),xe="austere:hub:view",De="austere:hub:closed-projects";function Be(e,s){try{let n=localStorage.getItem(e);return n==null?s:JSON.parse(n)}catch{return s}}function $e(e,s){try{localStorage.setItem(e,JSON.stringify(s))}catch{}}function ze(){let e=new URLSearchParams(location.search),s=e.get("view"),n=e.has("all")?"all":e.has("archived")?"archived":"open",a;if(s==="search"||Pe(s))a=s;else if(e.get("q"))a="search";else if(n!=="open")a="pages";else{let o=Be(xe,"inbox");a=Pe(o)?o:"inbox"}return{view:a,project:e.get("project")||"",pagesView:n,q:e.get("q")||"",status:e.get("status")||"",author:e.get("author")||"",device:e.get("device")||""}}function B(e){let s=new URLSearchParams;return s.set("view",e.view),e.project&&s.set("project",e.project),e.view==="pages"&&e.pagesView!=="open"&&s.set(e.pagesView,"1"),(e.view==="search"||e.view==="notes")&&e.q&&s.set("q",e.q),e.view==="notes"&&(e.status&&s.set("status",e.status),e.author&&s.set("author",e.author),e.device&&s.set("device",e.device)),`/?${s}`}var c=ze(),We=c.view==="search"?"inbox":c.view;function x(e,s,n=`${s}s`){return`${e} ${e===1?s:n}`}function W(e){if(!e)return"";let s=new Date(e),n=new Date,a=(l,r)=>l.toDateString()===r.toDateString(),o=s.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",hour12:!1});return a(s,n)?`Today ${o}`:a(s,new Date(Date.now()-864e5))?`Yesterday ${o}`:`${s.toLocaleDateString("en",{weekday:"short",month:"short",day:"numeric",year:s.getFullYear()===n.getFullYear()?void 0:"numeric"})} ${o}`}function ke(e){let s=we.home;return s&&(e===s||e.startsWith(s+we.sep))?`~${e.slice(s.length)}`:e}function Se(e,s){if(e.length<=s)return e;let n=Math.floor((s-1)/2);return`${e.slice(0,s-1-n)}\u2026${e.slice(e.length-n)}`}var de=e=>e.split(/[\\/]/).pop()||e,z=e=>e.title||de(e.rel_path),yt={listening:"an agent is listening",nobody:"nobody is taking them"},xt={open:"unanswered",received:"unanswered",addressed:"answered",held:"held for you"},$t="http://www.w3.org/2000/svg";function kt(){let e=(n,a)=>{let o=document.createElementNS($t,n);for(let[l,r]of Object.entries(a))o.setAttribute(l,r);return o},s=e("svg",{class:"logo",width:"24",height:"24",viewBox:"0 0 32 32","aria-hidden":"true"});return s.append(e("rect",{class:"logo-ground",width:"32",height:"32",rx:"7"}),e("rect",{class:"logo-edge",x:"1",y:"1",width:"30",height:"30",rx:"6"}),e("path",{class:"logo-a",d:"M9 23 16 8l7 15M11.5 18h9"})),s}document.body.append(t("div",{class:"hub"},t("aside",{class:"side",id:"side","aria-label":"Projects and views"},t("div",{class:"brand"},kt(),t("a",{href:"/?view=inbox",text:"austere-axi"}),t("small",{text:we.version})),t("form",{class:"search",role:"search"},t("label",{class:"search-box"},j("search",{size:15,width:1.8}),t("input",{type:"search",name:"q",placeholder:"Search pages and parts","aria-label":"Search pages and parts",autocomplete:"off"}))),t("nav",{class:"views","aria-label":"Views"}),t("div",{class:"side-h"},t("span",{text:"Projects"}),t("a",{class:"all-projects",href:"/",hidden:!0,text:"All"})),t("ul",{class:"projects"})),t("div",{class:"scrim"}),t("div",{class:"main"},t("header",{class:"top"},t("button",{type:"button",class:"side-toggle","aria-controls":"side","aria-expanded":"false"},j("menu",{size:18}),t("span",{class:"side-toggle-text",text:"Projects"})),t("button",{type:"button",class:"top-search","aria-label":"Search pages and parts"},j("search",{size:20,width:1.8}))),t("div",{class:"status",role:"status","aria-live":"polite"}),t("main",{class:"content",id:"content",tabindex:"-1"}),t("nav",{class:"tabbar","aria-label":"Views"}))));var k=e=>document.querySelector(e),St=k("#content"),Tt=k(".status"),X=k(".search input"),Ge=window.matchMedia("(max-width: 860px)");function Te(){k(".side").inert=Ge.matches&&!document.documentElement.classList.contains("side-open")}function Z(e){if(document.documentElement.classList.toggle("side-open",e),k(".side-toggle").setAttribute("aria-expanded",String(e)),Te(),e){let s=k(".views a");(s&&s.getClientRects().length?s:k(".brand a"))?.focus()}}Ge.addEventListener("change",Te);Te();k(".side-toggle").addEventListener("click",()=>Z(!document.documentElement.classList.contains("side-open")));k(".top-search").addEventListener("click",()=>{Z(!0),X.focus()});k(".scrim").addEventListener("click",()=>Z(!1));document.addEventListener("keydown",e=>{e.key==="Escape"&&document.documentElement.classList.contains("side-open")&&(Z(!1),k(".side-toggle").focus())});function J(e,...s){Tt.replaceChildren(...e?[t("span",{text:e}),...s]:[])}var le=class extends Error{};async function P(e){let s=await fetch(e,{headers:{accept:"application/json"}});if(s.status===403)throw new le("This browser is not signed in as the owner. Run `austere-axi hub open` to sign in again.");if(!s.ok)throw new Error(`austere-axi answered ${s.status}`);return await s.json()}async function Ne(e,s={}){try{let n=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)});return n.ok?await n.json():null}catch{return null}}var fe="Could not reach austere-axi. Check that it is still running, then reload.",jt=e=>e instanceof le?e.message:fe;function G(e){let n=new URLSearchParams(Object.entries(e).filter(([,a])=>a!=="")).toString();return n?`?${n}`:""}function T(e,s={}){return`/hub/open/${e}${G(s)}`}function He(e){let s=[e.unanswered?`${e.unanswered} unanswered`:"",e.listening?"agent listening":"",e.missing?"missing":"",e.archived?"archived":""].filter(Boolean);return t("a",{class:`chip${e.unanswered?" waiting":""}${e.missing?" gone":""}`,href:T(e.id),title:`${e.label} \xB7 ${e.file}`,"data-copy":e.id},j("branch",{size:12,width:2}),t("span",{class:"chip-label",text:Se(e.label,28)}),s.length?t("span",{class:"chip-note",text:s.join(" \xB7 ")}):null)}var Ce=3;function Fe(e,s=2){if(e.length<s||!e.length)return null;let n=e.slice(Ce);return t("div",{class:"chips"},e.slice(0,Ce).map(He),n.length?t("details",{class:"more"},t("summary",{text:`+${n.length} more`}),t("div",{class:"chips"},n.map(He))):null)}function Ke(e){let s=e.copies.length===1?e.copies[0]:null;if(!s){let n=[x(e.copies.length,"copy","copies")];return e.copies.every(a=>a.missing)?n.push(t("em",{class:"gone",text:"missing"})):e.copies.some(a=>a.listening)&&n.push(t("em",{class:"live",text:"agent listening"})),n}return[s.missing?t("em",{class:"gone",text:"missing"}):null,s.archived?t("em",{text:"archived"}):null,s.checked?t("em",{text:"checked"}):null,s.listening?t("em",{class:"live",text:"agent listening"}):null]}function N(e){return e.filter(n=>n!=null&&n!==!1&&n!=="").flatMap((n,a)=>a?[" \xB7 ",n]:[n])}function Et(e){let s=[];if(e.changed&&s.push(t("li",{class:"need",text:`Changed since you looked: ${x(e.changed,"revision")}`})),e.held&&s.push(t("li",{class:"need",text:`${x(e.held,"note")} held for you to release`})),e.failed){let n=e.copies.find(a=>a.failed_run)?.failed_run;s.push(t("li",{class:"need fail",text:`Agent run failed${n?.reason?` (${n.reason.replace(/_/g," ")})`:""}${n?.ended_at?` \xB7 ${W(n.ended_at)}`:""}`}))}if(e.taker){let n=e.unanswered-e.held;s.push(t("li",{class:`wait ${e.taker}${e.run_active?" active":""}`},t("span",{class:"lead",text:x(n,"unanswered note")}),` \xB7 ${e.taker==="attach_on"?e.run_active?"agent on: a run is working on them":"agent on: your next note starts a run":yt[e.taker]}`))}return s.length?t("ul",{class:"why"},s):null}function _t(e){return e.length?t("ul",{class:"previews"},e.map(s=>t("li",{},t("span",{class:"quote",text:s.text||"(no text)"}),t("span",{class:"by"},N([s.author||"You",s.target?t("span",{},"on ",t("code",{class:"target",text:s.target})):null,s.label,xt[s.status]??s.status]))))):null}function Lt(e){return e.group==="needs_you"?e.failed?["alert","red"]:e.held?["person","amber"]:["pencil","amber"]:e.group==="waiting_on_agent"?e.run_active||e.taker==="listening"?["bolt","green"]:e.taker==="attach_on"?["bolt","grey"]:["waiting","grey"]:["file","plain"]}function Rt(e){return e.taker==="nobody"?t("a",{class:"btn fill",href:T(e.open_id,{attach:"1"}),text:"Turn agent on"}):e.group!=="needs_you"?null:e.changed?t("a",{class:"btn fill",href:T(e.open_id),text:"Review changes"}):e.held?t("a",{class:"btn fill",href:T(e.open_id),text:"Open held notes"}):null}function Je(e,s=!1){let n=`${s?"Unarchive":"Archive"} ${z(e)}`,a=s?"Bring this page back to the lists":e.copies.length>1?"Put every copy of this page away; its notes are kept":"Put this page away; its notes are kept",o=s?t("button",{type:"button",class:"btn ghost",text:"Unarchive",title:a,"aria-label":n,onclick:()=>{Ve(e,o,"unarchive")}}):t("button",{type:"button",class:"icon-btn",title:a,"aria-label":n,onclick:()=>{Ve(e,o,"archive")}},j("archive"));return o}function Xe(e,s={}){let n=e.copies.find(d=>d.id===e.open_id)??e.copies[0],a=[e.unanswered?t("b",{class:"open",text:`${e.unanswered} unanswered`}):null,e.addressed?`${e.addressed} answered`:null],o=N([...Ke(e),...a]),[l,r]=Lt(e),u=W(e.activity);return t("li",{class:`row page-row ${e.group}`,"data-page":e.id},t("span",{class:`tile ${r}`,"aria-hidden":"true"},j(l,{size:16,width:1.8})),t("div",{class:"row-main"},t("a",{class:"row-title",href:T(e.open_id),title:n?.file??""},z(e)),t("span",{class:"path",text:s.showProject?`${e.project} / ${e.rel_path}`:e.rel_path}),o.length?t("span",{class:"meta"},o):null,Et(e),_t(s.notes??[]),Fe(e.copies)),t("div",{class:"row-actions"},u?t("span",{class:"when",text:u}):null,Rt(e),Je(e,s.archivedView)))}async function Ve(e,s,n){if(s.disabled)return;s.disabled=!0;let a=await Ne(`/hub/api/page/${e.open_id}/${n}`);if(!a)return s.disabled=!1,J(`Could not ${n} ${z(e)}. ${fe}`);let o=n==="archive"?"unarchive":"archive",l=t("button",{type:"button",class:"btn tiny",text:"Undo",onclick:async()=>{if(!l.disabled){if(l.disabled=!0,!await Ne(`/hub/api/page/${e.open_id}/${o}`,{ids:a.ids}))return l.disabled=!1,J(`Could not undo. ${fe}`,l);J(""),C(),Y()}}});J(`${n==="archive"?"Archived":"Unarchived"} ${z(e)}.`,l),C(),Y()}function ve(e,s,n,a=null,o=""){let l=`h-${e.toLowerCase().replace(/[^a-z]+/g,"-")}`;return t("section",{class:o,"aria-labelledby":l},t("h2",{id:l},e,s==null?null:t("span",{class:"n",text:String(s)}),a),n)}function E(...e){return t("p",{class:"empty"},e)}function M(e,s){let n={...c,...e};return t("a",{href:B(n),onclick:a=>V(a,e),text:s})}var ce=[],Qe=[];function Q(e){return c.project?t("p",{class:"filter"},`Project ${e?.name?ke(e.name):c.project}`," \xB7 ",M({project:""},"all projects")):null}function me(e,s,n,a,o){let l=`h-${e.toLowerCase().replace(/[^a-z]+/g,"-")}`;return t("section",{class:o,"aria-labelledby":l},t("div",{class:"sec-h"},t("h2",{id:l},e,t("span",{class:"n",text:String(s)})),t("p",{class:"hint",text:n})),a)}async function At(){let e=await P(`/hub/api/inbox${G({project:c.project})}`),s=e.needs_you.length+e.waiting_on_agent.length+e.quiet.length,n=!c.project,a=r=>t("ul",{class:"rows card"},r.map(u=>Xe(u,{showProject:n,notes:u.notes})));if(!s)return[t("header",{class:"view-h"},t("h1",{text:"Inbox"})),Q(e.project),E(c.project?"Nothing is open for review in this project.":"No pages yet. Open one for review with austere-axi and it shows up here.")];let o=e.waiting_on_agent.length,l=N([e.needs_you.length?t("span",{class:"need",text:`${x(e.needs_you.length,"page needs","pages need")} you`}):"nothing needs you",o?`${o} ${o===1?"waits":"wait"} on an agent`:null,e.quiet.length?`${e.quiet.length} quiet`:null,e.held?`${x(e.held,"note")} held for release`:null,e.failed_runs.length?x(e.failed_runs.length,"failed run"):null]);return[t("header",{class:"view-h"},t("h1",{text:"Inbox"}),t("p",{class:"summary"},l)),Q(e.project),me("Needs you",e.needs_you.length,"The agent changed the page, a teammate's notes wait for you, or a run failed",e.needs_you.length?a(e.needs_you):E("Nothing changed since you looked, no note is held for you and no run failed."),"group needs"),me("Waiting on agent",o,"Notes no agent has answered yet, and who takes them",o?a(e.waiting_on_agent):E("No unanswered notes."),"group waiting"),me("Quiet",e.quiet.length,"Open for review, nothing waiting",e.quiet.length?a(e.quiet):E("Every page has something going on."),"group quiet")]}var Oe=[{id:"open",label:"Open",count:"open"},{id:"all",label:"Everything",count:"everything"},{id:"archived",label:"Archived",count:"archived"}],Mt={needs_you:"Needs you",waiting_on_agent:"Waiting on agent",quiet:"Quiet"};function Pt(e){return e.changed?t("span",{class:"why-short need",text:"Changed since you looked"}):e.held?t("span",{class:"why-short need",text:`${x(e.held,"note")} held for you`}):e.failed?t("span",{class:"why-short fail",text:"Agent run failed"}):e.taker==="attach_on"?t("span",{class:`why-short${e.run_active?" live":""}`,text:e.run_active?"A run is working on them":"Agent on: your next note starts a run"}):e.taker==="nobody"?t("span",{class:"why-short"},"Nobody is taking them \xB7 ",t("a",{href:T(e.open_id,{attach:"1"}),text:"Turn agent on"})):null}function Nt(e,s){let n=e.copies.find(r=>r.id===e.open_id)??e.copies[0],a=N([e.unanswered?t("b",{class:"open",text:`${e.unanswered} unanswered`}):null,e.addressed?`${e.addressed} answered`:null]),o=N(Ke(e)),l=e.failed?"fail":e.group==="needs_you"?"need":e.run_active||e.taker==="listening"?"live":"idle";return t("li",{class:`row page-row trow ${e.group}`,"data-page":e.id},t("div",{class:"t-page"},t("span",{class:`dot ${l}`,role:"img","aria-label":e.failed?"Agent run failed":Mt[e.group]??e.group}),t("div",{class:"row-main"},t("a",{class:"row-title",href:T(e.open_id),title:n?.file??""},z(e)),t("span",{class:"path",text:e.rel_path}))),t("div",{class:"t-copies"},Fe(e.copies,1)),t("div",{class:"t-notes"},a.length?t("span",{class:"t-count"},a):null,Pt(e),o.length?t("span",{class:"meta"},o):null),t("span",{class:"when",text:W(e.activity)}),t("div",{class:"row-actions"},Je(e,s)))}async function Ht(){let e=await P(`/hub/api/pages${G({project:c.project,view:c.pagesView})}`),{counts:s}=e,n=t("nav",{class:"seg","aria-label":"Which pages"},Oe.map(w=>{let m=M({pagesView:w.id},w.label);return w.id===c.pagesView&&m.setAttribute("aria-current","page"),m.append(" ",t("span",{class:"n",text:String(s[w.count])})),m})),a=e.pages.reduce((w,m)=>w+m.unanswered,0),o=new Set(e.pages.map(w=>w.project_id)).size,l=[t("header",{class:"view-h split"},t("div",{},t("h1",{text:"Pages"}),t("p",{class:"summary",text:N([`${x(e.pages.length,"page")} in ${x(o,"project")}`,a?x(a,"unanswered note"):null]).join("")})),n),Q(e.project)];if(!e.pages.length){let w=Oe.filter(b=>b.id!==c.pagesView&&s[b.count]>0).map(b=>M({pagesView:b.id},`${b.label} (${s[b.count]})`));if(s.everything===0&&!c.project)return[...l,E("No pages yet. Open one for review with austere-axi and it shows up here.")];if(c.pagesView==="archived")return[...l,E("No archived pages.",...w.length?[" See: ",...N(w),"."]:[])];let m=["Nothing is open for review."];return s.checked&&m.push(` ${x(s.checked,"page was","pages were")} checked but never opened: `,M({pagesView:"all"},"show them"),"."),s.archived&&m.push(` ${s.archived} archived: `,M({pagesView:"archived"},"show"),"."),[...l,E(...m)]}let r=new Map;for(let w of e.pages){let m=r.get(w.project_id);m||r.set(w.project_id,m=[]),m.push(w)}let u=new Map(ce.map(w=>[w.id,w])),d=c.pagesView==="archived",h=[];for(let[w,m]of r){let b=u.get(w),$=b?.roots??[],te=m.reduce((O,F)=>O+F.unanswered,0),se=$.length?`${Se(ke($[0]),48)}${$.length>1?` \xB7 +${$.length-1} more ${$.length===2?"folder":"folders"}`:""}`:"";h.push(t("li",{class:"proj-row"},t("h2",{},M({project:w},m[0].project)),se?t("small",{class:"path",title:$.join(`
2
- `),text:se}):null,te?t("span",{class:`proj-wait${m.some(O=>O.needs_you)?" need":""}`,text:`${te} unanswered`}):null,b?.same_as?t("p",{class:"same"},`Same repository as project ${b.same_as.name}: `,t("code",{text:b.same_as.merge})):null),...m.map(O=>Nt(O,d)))}let _=t("div",{class:`table card pages-table${d?" archived":""}`},t("div",{class:"thead","aria-hidden":"true"},["Page","Copies","Notes","Last activity",""].map(w=>t("span",{text:w}))),t("ul",{class:"rows"},h)),L=c.pagesView==="open"&&s.checked?t("p",{class:"foot"},`${x(s.checked,"more page was","more pages were")} checked but never opened for review. `,M({pagesView:"all"},"Show them")):null;return[...l,_,L]}var Ct={open:"Unanswered",received:"Unanswered",addressed:"Answered",held:"Held for you"};async function Vt(){let e=await P(`/hub/api/notes${G({project:c.project,q:c.q,status:c.status,author:c.author,device:c.device})}`),s=(r,u,d)=>t("option",{value:r,selected:d===r,text:u}),n=t("form",{class:"filters",onsubmit:r=>{r.preventDefault();let u=new FormData(r.target);V(null,{q:String(u.get("q")??""),status:String(u.get("status")??""),author:String(u.get("author")??"")})}},t("label",{class:"search-box"},j("search",{size:15,width:1.8}),t("input",{type:"search",name:"q",value:c.q,placeholder:"Search notes, targets, page titles","aria-label":"Search notes"})),t("select",{name:"status","aria-label":"Status"},s("","All",c.status),s("unanswered","Unanswered",c.status),s("answered","Answered",c.status)),e.authors.length?t("select",{name:"author","aria-label":"Author"},s("","Everyone",c.author),s("owner","Owner",c.author),e.authors.map(r=>s(r,r,c.author))):null,t("button",{type:"submit",class:"btn",text:"Filter"})),a=e.notes.filter(r=>r.status!=="addressed").length,o=e.notes.map(r=>{let u=r.label&&r.label!==r.project?`${r.project} \xB7 ${r.label}`:r.project,d=r.status==="addressed"?"done":r.status==="held"?"waiting held":"waiting",h=W(r.at);return t("li",{class:"note"},t("span",{class:`st ${d}`},t("span",{class:"st-dot","aria-hidden":"true"}),Ct[r.status]??r.status),t("div",{class:"note-main"},t("a",{href:T(r.artifact_id),title:r.file},t("p",{class:"quote",text:r.text||"(no text)"})),t("span",{class:"meta"},r.author?t("b",{class:"by",text:r.author}):null,r.remote?t("span",{text:"hosted page"}):null,r.target?[t("span",{text:"on"}),t("code",{class:"target",text:r.target})]:null,t("span",{text:"in"}),t("a",{href:T(r.artifact_id),text:r.title||de(r.file)}),u?t("span",{text:`\xB7 ${u}`}):null)),h?t("span",{class:"when",text:h}):null)}),l=c.q||c.project||c.author||c.device||c.status;return[t("header",{class:"view-h"},t("h1",{text:"Notes"}),t("p",{class:"summary",text:`${l?"Newest first":"Every note on every page, newest first"} \xB7 ${x(e.notes.length,"note")}${a?` \xB7 ${a} unanswered`:""}`})),n,Q(e.project),e.device?t("p",{class:"filter"},`Device ${e.device.name} (${e.device.id}) \xB7 `,M({device:""},"everyone")):null,o.length?t("ul",{class:"notes card"},o):E(l?"No notes match.":"No notes yet.")]}var Ot={queued:"Queued",waiting_for_session:"Waiting for its session",running:"Running",done:"Done",failed:"Failed",stopped:"Stopped",interrupted:"Interrupted"};async function It(){let e=await P(`/hub/api/runs${G({project:c.project})}`),s=n=>{let a=n.started_at&&n.ended_at?`${Math.max(1,Math.round((n.ended_at-n.started_at)/1e3))} s`:"";return t("li",{class:`run ${n.status}`},t("span",{class:`rstat ${n.status}`},t("span",{class:"st-dot","aria-hidden":"true"}),Ot[n.status]??n.status),t("div",{class:"run-main"},n.artifact_id?t("a",{href:T(n.artifact_id),title:n.file??"",text:n.title||de(n.file??n.artifact_id)}):t("span",{text:n.kind==="trigger"?"Trigger run":"Run"}),n.reason?t("span",{class:"run-why",text:n.reason.replace(/_/g," ")}):null),t("span",{class:"agent",text:N([n.harness,n.mode]).join("")}),t("span",{class:"when",text:W(n.started_at)}),t("span",{class:"took",text:a}))};return[t("header",{class:"view-h"},t("h1",{text:"Runs"}),t("p",{class:"summary",text:"Agent runs your notes started on pages where the agent is on, newest first"})),Q(e.project),e.runs.length?t("div",{class:"table card runs-table"},t("div",{class:"thead","aria-hidden":"true"},["Status","Page","Agent","Started","Took"].map(n=>t("span",{text:n}))),t("ul",{class:"runs"},e.runs.map(s))):E("No runs yet. Turn an agent on in a page's Agent menu and the owner's notes start one.")]}async function Ut(){let e=await P(`/hub/api/search${G({q:c.q})}`),s=n=>t("li",{class:"part"},t("a",{href:T(n.artifact_id,{part:n.statement}),title:n.file},t("span",{class:"part-title",text:`${n.title||de(n.file)} \xB7 ${n.statement}`}),t("span",{class:"snippet",text:n.snippet})),t("span",{class:"meta",text:N([n.component||null,n.copy]).join("")}));return[t("header",{class:"view-h"},t("h1",{},"Search: ",t("q",{text:e.q}))),ve("Pages",e.pages.length,e.pages.length?t("ul",{class:"rows card"},e.pages.map(n=>Xe(n,{showProject:!0}))):E("No page title, path or project matches.")),ve("Parts",e.parts.length,e.parts.length?t("ul",{class:"parts card"},e.parts.map(s)):E("No part of a page says that."))]}var qt={say:J,again:()=>{C(),Y()},when:W,tilde:ke,plural:x,section:ve,empty:E,notesOf:e=>M({view:"notes",device:e.id,project:"",q:"",status:"",author:""},`Notes by ${e.name}`),get:P},Dt={inbox:At,pages:Ht,notes:Vt,runs:It,settings:()=>Me(qt),search:Ut},Ie=0;async function C(){let e=++Ie;document.title=`${c.view==="search"?"Search":ye.find(n=>n.id===c.view)?.label} \xB7 austere-axi hub`;for(let n of document.querySelectorAll(".views a, .tabbar a"))n.dataset.view===c.view?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current");X.value=c.view==="search"?c.q:"";let s;try{s=await Dt[c.view]()}catch(n){s=[t("p",{class:"error",text:jt(n)})]}e===Ie&&St.replaceChildren(...s.filter(n=>n!=null&&n!==!1).map(n=>typeof n=="number"?String(n):n))}function V(e,s,n=!0){let a=e;a&&(a.metaKey||a.ctrlKey||a.shiftKey||a.button===1)||(e?.preventDefault(),c.view!=="search"&&(We=c.view),c={...c,...s},s.view&&s.view!=="notes"&&s.view!=="search"&&(c={...c,q:"",status:"",author:"",device:""}),c.view!=="search"&&$e(xe,c.view),n?history.pushState(null,"",B(c)):history.replaceState(null,"",B(c)),Z(!1),ee(),C())}window.addEventListener("popstate",()=>{c=ze(),ee(),C()});var be=0;X.addEventListener("input",()=>{clearTimeout(be),be=window.setTimeout(()=>{let e=X.value.trim();e?V(null,{view:"search",q:e},c.view!=="search"):c.view==="search"&&V(null,{view:We,q:""})},200)});k(".search").addEventListener("submit",e=>{e.preventDefault(),clearTimeout(be);let s=X.value.trim();s&&V(null,{view:"search",q:s},c.view!=="search")});function Ue(e,s,n){return ye.map(a=>t("a",{href:B({...c,view:a.id}),"data-view":a.id,"aria-current":c.view===a.id?"page":!1,onclick:o=>V(o,{view:a.id})},j(a.icon,e?{size:20,width:1.8}:{}),t("span",{class:"label",text:a.label}),a.id==="inbox"&&s?t("span",{class:"count need",title:`${x(s,"page needs","pages need")} you`,text:String(s)}):null,a.id==="settings"&&n?t("span",{class:"count need",title:`${x(n,"person asks","people ask")} for access`,text:String(n)}):null))}function Bt(e,s){k(".views").replaceChildren(...Ue(!1,e,s)),k(".tabbar").replaceChildren(...Ue(!0,e,s))}var K=new Set(Be(De,[])),qe=()=>t("span",{class:"dot need",role:"img","aria-label":"Needs you"});function ee(){Bt(ce.reduce((a,o)=>a+o.needs_you,0),Ye);let e=k(".all-projects");e.hidden=!c.project,e.href=B({...c,project:""}),e.onclick=a=>V(a,{project:""});let s=new Map;for(let a of Qe){let o=s.get(a.project_id);o||s.set(a.project_id,o=[]),o.push(a)}let n=ce.filter(a=>a.pages>0||c.project===a.id||c.project===a.name).map(a=>{let o=c.project===a.id||c.project===a.name,l=!K.has(a.id),r=s.get(a.id)??[],u=t("button",{type:"button",class:"proj-toggle","aria-expanded":String(l),"aria-label":`${l?"Hide":"Show"} the pages of ${a.name}`,onclick:()=>{K.has(a.id)?K.delete(a.id):K.add(a.id),$e(De,[...K]),ee()}},j("chevronRight",{size:14,width:2}));return t("li",{class:`proj${o?" selected":""}`},t("div",{class:"proj-head"},u,t("a",{class:"proj-link",href:B({...c,project:a.id}),title:a.roots.join(`
3
- `),"aria-current":o?"true":!1,onclick:d=>V(d,{project:a.id}),text:a.name}),a.unanswered?t("span",{class:`count${a.needs_you?" need":""}`,title:x(a.unanswered,"unanswered note"),text:String(a.unanswered)}):a.needs_you?qe():null),l?t("ul",{class:"proj-pages"},r.map(d=>t("li",{},t("a",{href:T(d.open_id),title:d.rel_path,class:d.needs_you?"need":""},t("span",{class:"pg-title",text:z(d)}),d.needs_you?qe():d.unanswered?t("span",{class:"count",title:x(d.unanswered,"unanswered note"),text:String(d.unanswered)}):null),d.copies.length>1?t("div",{class:"mini-chips"},d.copies.map(h=>t("a",{class:`mini-chip${h.unanswered?" waiting":""}`,href:T(h.id),title:`${h.label} \xB7 ${h.file}`,text:Se(h.label,18)}))):null))):null)});k(".projects").replaceChildren(...n.length?n:[t("li",{class:"side-empty",text:"No projects yet."})])}var Ye=0;async function Y(){try{let[e,s,n]=await Promise.all([P("/hub/api/projects"),P("/hub/api/pages"),P("/hub/api/people/requests")]);ce=e.projects,Qe=s.pages,Ye=n.waiting.length}catch{}ee()}document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(Y(),C())});history.replaceState(null,"",B(c));c.view!=="search"&&$e(xe,c.view);ee();Y().then(()=>{c.view==="pages"&&C()});C();})();
1
+ (()=>{function t(e,s={},...n){let a=document.createElement(e);for(let[o,l]of Object.entries(s))l==null||l===!1||(o==="class"?a.className=String(l):o.startsWith("on")?typeof l=="function"&&a.addEventListener(o.slice(2),l):o==="text"?a.textContent=String(l):o==="html"?a.innerHTML=String(l):a.setAttribute(o,l===!0?"":String(l)));for(let o of n.flat())o!=null&&o!==!1&&a.append(o instanceof Node?o:document.createTextNode(String(o)));return a}var Re="http://www.w3.org/2000/svg",p=e=>["path",{d:e}],A=(e,s,n,a={})=>["circle",{cx:e,cy:s,r:n,...a}],Ae=(e,s,n,a,o)=>["rect",{x:e,y:s,width:n,height:a,rx:o}],gt={inbox:[p("M22 12h-6l-2 3h-4l-2-3H2"),p("M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z")],file:[p("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),p("M14 3v5h5")],message:[p("M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z")],annotate:[p("M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"),p("M12 7v6M9 10h6")],explore:[p("m5 4 6 15 2-6 6-2z")],terminal:[p("m5 8 4 4-4 4"),p("M12 17h7")],sliders:[p("M4 6h8"),p("M18 6h2"),A(15,6,2.5),p("M4 12h2"),p("M12 12h8"),A(9,12,2.5),p("M4 18h8"),p("M18 18h2"),A(15,18,2.5)],search:[A(11,11,7),p("m20 20-3.5-3.5")],chevronDown:[p("m6 9 6 6 6-6")],chevronRight:[p("m9 6 6 6-6 6")],pencil:[p("M12 20h8"),p("M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z")],person:[A(12,8,3.5),p("M5 20a7 7 0 0 1 14 0")],alert:[p("M12 4 3 19h18z"),p("M12 10v4"),p("M12 16.6v.4")],bolt:[p("M13 3 5 13h6l-1 8 8-10h-6z")],waiting:[A(12,12,8,{"stroke-dasharray":"3.2 3.2"})],archive:[Ae(3,4,18,4,1),p("M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8"),p("M10 12h4")],branch:[A(6,5,2),A(6,19,2),A(18,8,2),p("M6 7v10"),p("M18 10c0 4-4 5-12 5")],clock:[A(12,12,8),p("M12 8v4l3 2")],arrowRight:[p("M5 12h14M13 6l6 6-6 6")],close:[p("M6 6l12 12M18 6 6 18")],panel:[Ae(3,4,18,16,2),p("M15 4v16")],menu:[p("M4 6h16M4 12h16M4 18h16")],check:[p("m5 12 5 5 9-10")]};function j(e,{size:s=16,width:n=1.7,label:a,cls:o}={}){return ge(gt[e],{size:s,width:n,label:a,cls:o})}function ge(e,{size:s=16,width:n=1.7,label:a,cls:o}={}){let l=document.createElementNS(Re,"svg"),r=(u,d)=>{for(let[h,L]of Object.entries(d))u.setAttribute(h,String(L))};r(l,{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round","stroke-linejoin":"round",class:`icon${o?` ${o}`:""}`}),a?r(l,{role:"img","aria-label":a}):l.setAttribute("aria-hidden","true");for(let[u,d]of e){let h=document.createElementNS(Re,u);r(h,d),l.append(h)}return l}var mt=[{id:"people",label:"People and access"},{id:"network",label:"Network"},{id:"review",label:"Review defaults"},{id:"cloud",label:"Cloud"},{id:"projects",label:"Projects"},{id:"about",label:"About"}],ft=[["path",{d:"M12 5v14M5 12h14"}]];async function Pe(e,s={}){let n;try{n=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)})}catch{return{ok:!1,error:"Could not reach austere-axi. Check that it is still running, then reload."}}let a=await n.json().catch(()=>({}));return n.ok?{ok:!0,data:a}:{ok:!1,error:a.error||`austere-axi answered ${n.status}`}}var wt={link:"Named link",request:"Approved request",tailscale:"Tailscale login"};function V(e){return e.split("`").map((s,n)=>n%2?t("code",{text:s}):s)}function M(e,s){return t("label",{class:"field"},t("span",{text:e}),s)}function D(e,s,n,a){let o=t("select",{name:e,"aria-label":a},s.map(([l,r])=>t("option",{value:l,text:r,selected:l===n})));return o.addEventListener("change",()=>o.dataset.touched="1"),o}function me(e,s={}){return t("input",{type:"checkbox",role:"switch",class:"toggle",checked:e,...s})}function X(e,s,n,a=null){return t("div",{class:"set-head"},t("div",{class:"set-head-text"},t("h2",{id:`set-${e}-h`,text:s}),t("p",{class:"summary"},n)),a)}function B(e,s,n,a,o=""){let l=`set-h-${e}`;return t("section",{class:`set-part${o?` ${o}`:""}`,"aria-labelledby":l},t("h3",{id:l},s,n==null?null:t("span",{class:"n",text:` \xB7 ${n}`})),a)}function vt(e){let s=e.trim().charAt(0).toUpperCase();return t("span",{class:"set-avatar","aria-hidden":"true"},s||j("person",{size:16,width:1.8}))}function bt(e,s){return t("div",{class:"set-cmd"},t("code",{text:s}),t("button",{type:"button",class:"btn",text:"Copy","aria-label":`Copy ${s}`,onclick:()=>ce(e,s,"The command")}))}function fe(e){return e.dataset.touched?e.value==="auto":void 0}function re(e,s,n){let a=[];if(s&&a.push(["page","This page"]),n)a.push([`project:${n.id}`,`Every page in ${n.name}`]);else for(let o of e)a.push([`project:${o.id}`,`Every page in ${o.name}`]);return a.push(["all","Every page"]),a}function le(e){return e.startsWith("project:")?{scope:"project",project:e.slice(8)}:{scope:e}}var we=[["hold","Hold notes for me"],["auto","Send notes straight to the agent"]];async function Ne(e){let[s,n,a,o,l]=await Promise.all([e.get("/hub/api/settings"),e.get("/hub/api/people"),e.get("/hub/api/people/requests"),e.get("/hub/api/projects"),e.get("/hub/api/pages")]),r=o.projects,u=s.review.auto?"auto":"hold",d=async(i,w,y)=>{let g=await Pe(i,w);e.say(g.ok?y(g.data):g.error),g.ok&&e.again()},h=(i,w,y={})=>t("button",{type:"button",class:"btn ghost",text:i,onclick:()=>{w()},...y}),L=i=>{let w=i.file?e.tilde(i.file):"a page no longer in the hub",y=[i.verifiedLogin?`${i.verifiedLogin}${i.tailscaleDevice?` on ${i.tailscaleDevice}`:""} (verified by Tailscale)`:null,i.addr,i.host?`(${i.host})`:null,i.browser].filter(Boolean).join(" \xB7 "),g=D("scope",re(r,!!i.file,i.project),"page",`What ${i.name} can review`),v=D("mode",we,u,`Where ${i.name}'s notes go`);return t("li",{class:"set-ask","data-request":i.id},vt(i.name),t("div",{class:"set-who"},t("span",{class:"row-title",text:i.name}),t("span",{class:"meta",text:`Asks for ${w} \xB7 ${e.when(i.createdAt)}`}),y?t("span",{class:"meta",text:y}):null),t("div",{class:"set-actions"},g,v,h("Approve",()=>d(`/hub/api/people/requests/${i.id}/approve`,{...le(g.value),auto:fe(v)},q=>`${i.name} is in: ${q.device?.reaches??"approved"}. The browser that asked opens the page by itself.`),{class:"btn primary"}),h("Deny",()=>d(`/hub/api/people/requests/${i.id}/deny`,{},()=>`Denied ${i.name}. That browser may ask again.`)),h("Block",()=>d(`/hub/api/people/requests/${i.id}/block`,{},()=>`Blocked ${i.name}'s browser: it can no longer ask.`),{class:"btn ghost danger"})))},_=(i,w,y)=>{let g=me(w);return g.addEventListener("change",()=>{d("/hub/api/people/requests/switch",y?{on:g.checked,project:y}:{on:g.checked},()=>`Requests ${g.checked?"on":"off"} ${y?`for ${i}`:"for every page"}.`)}),t("label",{class:"switch"},t("span",{class:"set-switch-text",text:i}),g)},f=new Map(a.switch.projects.map(i=>[i.id,i.on])),m=t("div",{class:"switches"},_("Every page",a.switch.all,null),r.length?t("p",{class:"meta",text:"A project's own choice wins over every page's:"}):null,r.map(i=>_(i.name,f.get(i.id)??a.switch.all,i.id))),b=i=>t("li",{class:"set-line","data-link":i.id},t("div",{class:"set-who"},t("span",{class:"row-title",text:i.name}),t("span",{class:"meta",text:`Reaches ${i.reaches} \xB7 ${i.auto?"notes go straight to the agent":"notes held for you"} \xB7 ${i.reusable?"old-style link: any browser can use it, no expiry":`made ${e.when(i.createdAt)}, expires ${e.when(i.expiresAt)}`}`})),t("div",{class:"set-actions"},i.link?h("Copy link",()=>ce(e,i.link,`${i.name}'s link`),{class:"btn"}):null,i.reusable?h("Make single-use",()=>d(`/hub/api/people/${i.id}/single-use`,{},()=>`${i.name}'s link now works once and expires in 7 days. Send the new link; the old one stopped.`)):null,h("Cancel link",()=>d(`/hub/api/people/${i.id}/revoke`,{},()=>`Cancelled ${i.name}'s link.`),{"aria-label":`Cancel ${i.name}'s link`}))),k=(i,w,y=null)=>t("div",{class:"set-cell"},t("span",{class:"set-lbl",text:`${i}: `}),t("span",{text:w}),y?t("span",{class:"meta",text:y}):null),ae=i=>{let w=D("scope",[["","Change what they reach\u2026"],...re(r,!1,null)],"",`What ${i.name} can review`);w.addEventListener("change",()=>{w.value&&d(`/hub/api/people/${i.id}/scope`,le(w.value),v=>`${i.name} now reaches ${v.reaches}.`)});let y=()=>{let v=prompt(`New name for ${i.name}`,i.name);v&&v.trim()&&v.trim()!==i.name&&d(`/hub/api/people/${i.id}/rename`,{name:v.trim()},q=>`Renamed ${i.name} to ${q.name}.`)},g=i.lastAddr?`from ${i.lastAddr}${i.lastHost?` (${i.lastHost})`:""}`:null;return t("li",{class:"set-dev","data-device":i.id},t("div",{class:"set-cell name"},t("span",{class:"row-title",text:i.name}),i.verifiedLogin?t("span",{class:"meta verified",text:`Tailscale: ${i.verifiedLogin} (verified)`}):null),k("Got in by",wt[i.origin]??i.origin,e.when(i.claimedAt)),k("Reaches",i.reaches),k("Notes go",i.auto?"Straight to the agent":"Held for you"),k("Last seen",i.lastSeenAt?e.when(i.lastSeenAt):"Not seen yet",g),t("div",{class:"set-actions"},e.notesOf({id:i.id,name:i.name}),h("Rename",y,{class:"btn text","aria-label":`Rename ${i.name}`}),h("Revoke",()=>confirm(`Revoke ${i.name}? Their open pages stop at once.`)&&d(`/hub/api/people/${i.id}/revoke`,{},()=>`Revoked ${i.name}. Their open pages stopped.`),{class:"btn text danger","aria-label":`Revoke ${i.name}`}),w))},ie=n.devices.length?t("div",{class:"set-devices"},t("div",{class:"set-dev-head","aria-hidden":"true"},["Device","Got in by","Reaches","Notes go","Last seen",""].map(i=>t("span",{text:i}))),t("ul",{class:"set-dev-list"},n.devices.map(ae))):e.empty("No device has access yet."),U=yt(e,l.pages,r,u,s.network.share!=null),K=B("new-link","New link",null,U),tt=()=>{K.scrollIntoView({block:"start"}),K.querySelector("input[name=name]")?.focus({preventScroll:!0})},oe=a.waiting.length,st=t("section",{id:"set-people",class:"set","aria-labelledby":"set-people-h"},X("people","People and access",V("Who may open your pages from another device, and what they reach. A link works for one browser: the first one that opens it. At a terminal: `austere-axi share`."),t("button",{type:"button",class:"btn",onclick:tt},ge(ft,{size:14,width:2}),"New link")),B("waiting","Waiting for access",oe,oe?t("ul",{class:"set-asks"},a.waiting.map(L)):e.empty("Nobody is asking."),oe?"waiting":""),B("links","Links nobody has opened yet",n.links.length,n.links.length?t("ul",{class:"set-lines"},n.links.map(b)):e.empty("None.")),B("devices","Devices with access",n.devices.length,ie),K,a.blocked.length?B("blocked","Blocked",a.blocked.length,t("ul",{class:"set-lines"},a.blocked.map(i=>t("li",{class:"set-line"},t("div",{class:"set-who"},t("span",{class:"row-title",text:i.name}),t("span",{class:"meta",text:[i.addr,i.host,i.browser,e.when(i.decidedAt)].filter(Boolean).join(" \xB7 ")})))))):null,B("ask","Browsers without a link may ask for access",null,m,"set-asking")),S=s.network,nt={this_computer:"this computer",tailscale:"Tailscale",local_network:"local network, reviewers only",added:"added at a terminal"},at={link_url:"set by AUSTERE_AXI_LINK_URL",link_host:"set by AUSTERE_AXI_LINK_HOST",tailscale:"this computer's Tailscale address",host:"the address AUSTERE_AXI_HOST names",lan:"the local-network address you switched on"},C=S.always_on,it=C.mode==="service"?`On: ${C.supervisor==="launchd"?"launchd":"systemd"} runs it${C.unit?` (${C.unit})`:""} and starts it again when it stops.`:C.mode==="kept_on"?"On while this process runs: it was started to stay on, but no service starts it again after a restart of the computer.":`Off: it stops after ${e.plural(C.idle_minutes??30,"minute")} without use, and the next command starts it again.`,ot=t("section",{id:"set-network",class:"set","aria-labelledby":"set-network-h"},X("network","Network","Where this server can be reached. It never listens on every address."),t("div",{class:"set-block"},t("span",{class:"set-label",text:"Answers on"}),t("ul",{class:"plain set-addrs"},S.addresses.map(i=>t("li",{"data-kind":i.kind},t("code",{text:i.url}),t("span",{class:"k",text:nt[i.kind]}),S.share?.url===i.url?t("span",{class:"set-pill",text:"Address to share"}):null)))),t("div",{class:"set-block"},t("span",{class:"set-label",text:"Address to share"}),t("div",{class:"share-addr"},S.share?[t("code",{text:S.share.url}),h("Copy",()=>ce(e,S.share.url,"The address"),{class:"btn"}),t("span",{class:"meta",text:at[S.share.from]})]:t("span",{class:"warn",text:"None: only this computer can reach the server, so no link can be shared. Start Tailscale, switch on the local network below, or set AUSTERE_AXI_HOST at a terminal."}))),t("div",{class:"set-block"},t("span",{class:"set-label",text:"Tailscale"}),t("span",{text:S.tailscale?`${S.tailscale.dns_name?`${S.tailscale.dns_name} \xB7 `:""}${S.tailscale.ip}`:"Not running here."})),t("div",{class:"set-block setting","data-slot":"tailscale-identity"},xt(S.tailscale_names,r,u,d)),t("div",{class:"set-block setting","data-slot":"local-network"},kt(S.lan,d)),t("div",{class:"set-block","data-always":C.mode},t("span",{class:"set-title",text:"Always on"}),t("span",{class:"meta",text:it}),C.mode==="service"?null:[t("span",{class:"meta",text:"To keep it running, at a terminal:"}),bt(e,"austere-axi server install")])),_e=(i,w,y)=>{let g=`set-mode-${i}`,v=t("input",{type:"radio",id:g,name:"default-mode",value:i,checked:i===u,"aria-describedby":`${g}-d`});return v.addEventListener("change",()=>{d("/hub/api/settings/review",{auto:i==="auto"},q=>q.message)}),t("div",{class:"set-opt"},v,t("label",{for:g,text:w}),t("span",{class:"meta",id:`${g}-d`,text:y}))},pe=s.review.viewing,rt=t("section",{id:"set-review",class:"set","aria-labelledby":"set-review-h"},X("review","Review defaults",V("For reviewers you let in from now on, unless you say otherwise when you share or approve. Those already in keep their own. At a terminal: `austere-axi share default hold|auto`.")),t("fieldset",{class:"modes"},t("legend",{text:"A new reviewer's notes"}),_e("hold","Hold them for me","You read each note and decide which ones the agent gets"),_e("auto","Send them straight to the agent","Not available on pages an agent is attached to")),B("viewing","On pages now",pe.length,pe.length?t("ul",{class:"set-viewing"},pe.map(i=>t("li",{},t("a",{class:"row-title",href:`/hub/open/${i.id}`,title:i.file,text:i.title}),t("span",{class:"meta",text:i.viewers.map(w=>w.role==="owner"?"you":w.name).join(", ")})))):e.empty("Nobody has a page open."))),lt=new Set(s.gone_folders),ct=i=>{let w=()=>{let g=prompt(`New name for ${i.name}`,i.name);g&&g.trim()&&g.trim()!==i.name&&d(`/hub/api/projects/${i.id}/rename`,{name:g.trim()},v=>v.message)},y=g=>{let v=lt.has(g),q=()=>(!v||confirm(`${g} is gone. Forget it and archive its pages? Their notes are kept.`))&&d(`/hub/api/projects/${i.id}/forget-root`,{root:g,drop:v},pt=>pt.message);return t("li",{class:v?"gone":""},t("code",{text:e.tilde(g),title:g}),v?t("span",{class:"set-gone",text:"folder is gone"}):null,i.roots.length>1||v?h(v?"Forget the missing folder":"Forget",q,{class:v?"btn":"btn text","aria-label":`Forget the folder ${g}`}):null)};return t("li",{class:"set-line","data-project":i.id},t("div",{class:"set-who"},t("span",{class:"row-title"},i.name,t("span",{class:"set-dim",text:` \xB7 ${e.plural(i.pages,"page")} \xB7 ${e.plural(i.roots.length,"folder")}`})),t("ul",{class:"plain folders"},i.roots.map(y)),i.same_as?t("p",{class:"same"},`Same repository as ${i.same_as.name}. `,h(`Merge into ${i.same_as.name}`,()=>confirm(`Move the folders and pages of ${i.name} into ${i.same_as.name}? ${i.name} goes away.`)&&d(`/hub/api/projects/${i.same_as.id}/merge`,{from:i.id},g=>g.message))):null),t("div",{class:"set-actions"},h("Rename",w,{"aria-label":`Rename ${i.name}`})))},dt=t("section",{id:"set-projects",class:"set","aria-labelledby":"set-projects-h"},X("projects","Projects",V("A project is a name and the folders its pages live in. Worktrees of one repository share a project. At a terminal: `austere-axi project`.")),r.length?t("ul",{class:"set-lines set-flush"},r.map(ct)):t("div",{class:"set-block"},e.empty("No projects yet.")),t("div",{class:"missing set-foot"},s.missing?[t("span",{text:`${e.plural(s.missing,"page")} opened for review ${s.missing===1?"has":"have"} a file that is gone. Archiving keeps ${s.missing===1?"its":"their"} notes.`}),h("Archive missing pages",()=>d("/hub/api/projects/archive-missing",{},i=>i.message))]:t("span",{text:"No page opened for review has a missing file."}))),R=s.cloud,J=me(R.on,{"aria-describedby":"set-cloud-state"});J.addEventListener("change",()=>{if(!J.checked&&R.published&&!confirm(`Turn cloud features off? Pages published from this machine (${R.published}) stay up on the service, but their notes stop reaching you here until you turn cloud back on.`)){J.checked=!0;return}d("/hub/api/settings/cloud",{on:J.checked},i=>i.message)});let ut=t("section",{id:"set-cloud",class:"set","aria-labelledby":"set-cloud-h"},X("cloud","Cloud",V("Hosted share links: `publish`, `clone`, `cloud login` and the sync of hosted pages. Off by default; off, only local features work and nothing reaches the hosted service. At a terminal: `austere-axi cloud on|off`.")),t("div",{class:"set-block setting","data-slot":"cloud"},t("label",{class:"switch"},t("span",{class:"set-switch-text"},t("span",{class:"set-title",text:"Cloud features"}),t("span",{class:"meta",id:"set-cloud-state",text:R.on?`On: talks to ${R.service}.`:"Off: only local features work."})),J),R.account?t("span",{class:"meta",text:`Signed in as ${R.account}.`}):null,R.published?t("span",{class:"meta",text:`${e.plural(R.published,"page")} published from this machine${R.on?".":": still up on the service, not synced while cloud is off."}`}):null)),ht=t("section",{id:"set-about",class:"set","aria-labelledby":"set-about-h"},t("div",{class:"set-head"},t("h2",{id:"set-about-h",text:"About"})),t("dl",{class:"facts"},t("dt",{text:"Version"}),t("dd",{text:s.about.version}),t("dt",{text:"State folder"}),t("dd",{},t("code",{text:e.tilde(s.about.state_dir),title:s.about.state_dir})),t("dt",{text:"Port"}),t("dd",{text:String(S.port)})),t("div",{class:"set-block"},s.about.newer_cli?t("p",{class:"warn note-older"},V(`This server runs ${s.about.version}, older than the austere-axi ${s.about.newer_cli} you use at the terminal. Restart it to update: \`austere-axi server restart\`.`)):null,t("p",{class:"meta"},V("Stays at a terminal: anything that runs a command, such as `server install`, `adapter set` and `trigger add`."))));return[t("div",{class:"set-page"},t("div",{class:"set-top"},t("h1",{text:"Settings"}),t("p",{class:"summary",text:"This server only: who can review, where it is reachable, and how. Hosted pages keep their own invites."})),t("nav",{class:"set-nav","aria-label":"Settings sections"},mt.map(i=>{let w=i.id==="people"?oe:0;return t("a",{href:`#set-${i.id}`,class:w?"waiting":"","aria-label":w?`${i.label}, ${w} waiting`:null,onclick:y=>{y.preventDefault(),document.getElementById(`set-${i.id}`)?.scrollIntoView({block:"start"})}},i.label,w?t("span",{class:"n",text:String(w)}):null)})),st,t("div",{class:"set-grid"},ot,t("div",{class:"set-col"},rt,ut,ht)),dt)]}function ce(e,s,n){if(!navigator.clipboard)return e.say(`Copy it by hand: ${s}`);navigator.clipboard.writeText(s).then(()=>e.say(`${n} is copied.`),()=>e.say(`Copy it by hand: ${s}`))}function yt(e,s,n,a,o){if(!o)return e.empty("Only this computer can reach the server, so a link would not open anywhere else. See Network.");if(!s.length)return e.empty("No page is open for review yet. Open one, then share it here or from its menu.");let l=t("input",{type:"text",name:"name",maxlength:"40",required:!0,placeholder:"Their name","aria-label":"Their name",autocomplete:"off"}),r=t("select",{name:"page","aria-label":"Page"},s.map(m=>t("option",{value:m.open_id,text:`${m.title||m.rel_path} \xB7 ${m.project}`}))),u=()=>{let m=s.find(b=>b.open_id===r.value);return m?{id:m.project_id,name:m.project}:null},d=t("select",{name:"scope","aria-label":"They can review"}),h=()=>d.replaceChildren(...re(n,!0,u()).map(([m,b])=>t("option",{value:m,text:b})));h(),r.addEventListener("change",h);let L=D("mode",we,a,"Their notes"),_=t("p",{class:"error",role:"alert",hidden:!0}),f=t("form",{class:"new-link"},M("Name",l),M("Page",r),M("They can review",d),M("Their notes",L),t("button",{type:"submit",class:"btn primary",text:"Create link"}));return f.addEventListener("submit",async m=>{m.preventDefault();let b=await Pe("/hub/api/people/share",{page:r.value,name:l.value,...le(d.value),auto:fe(L)});if(!b.ok){_.textContent=b.error,_.hidden=!1;return}let k=b.data;e.say(`Link for ${k.name}, reaching ${k.reaches}: ${k.link} \u2014 works once, until ${new Date(k.expiresAt).toLocaleString()} if nobody opens it. Send it only to ${k.name}.`,t("button",{type:"button",class:"btn tiny",text:"Copy link",onclick:()=>ce(e,k.link,"The link")})),e.again()}),t("div",{class:"set-form"},f,_)}function xt(e,s,n,a){let o=e?"On: a reviewer who comes in over Tailscale is named by Tailscale (login and device, shown as verified). Asked only for connections to this server's Tailscale address, never from a header.":"Off: the server does not listen on Tailscale here, so nobody is named by it. A reviewer is known by the device you let in.",l=t("input",{type:"text",name:"login",maxlength:"200",required:!0,placeholder:"ana@example.com","aria-label":"Tailscale login",autocomplete:"off"}),r=t("input",{type:"text",name:"name",maxlength:"40",placeholder:"Name to show (default: the login)","aria-label":"Name to show",autocomplete:"off"}),u=re(s,!1,null),d=D("scope",u,u[0][0],"They can review"),h=D("mode",we,n,"Their notes"),L=t("form",{class:"login-form","data-form":"tailscale-login"},M("Tailscale login",l),M("Name",r),M("They can review",d),M("Their notes",h),t("button",{type:"submit",class:"btn",text:"Let in"}));return L.addEventListener("submit",_=>{_.preventDefault(),a("/hub/api/people/tailscale",{login:l.value.trim(),name:r.value.trim()||void 0,...le(d.value),auto:fe(h)},f=>`${f.verifiedLogin??f.name} is in on any of their Tailscale devices: ${f.reaches}. Listed under Devices; Revoke there.`)}),[t("span",{class:"set-title",text:"Names from Tailscale"}),t("span",{class:"meta",text:o}),t("p",{class:"meta"},V("A Tailscale login gets in without a link or a request: any device signed in to Tailscale as that login opens what it reaches, over Tailscale only. At a terminal: `austere-axi share tailscale <login> --all`.")),L]}var Me="Traffic on this network is not encrypted. Others on the same network could read pages, notes and reviewers' access. Use it on a network you trust, or use Tailscale or HTTPS.";function kt(e,s){let n=e.address!=null,a=e.choices.map(u=>[u.address,`${u.address} (${u.iface})`]);e.address&&!a.some(([u])=>u===e.address)&&a.unshift([e.address,`${e.address} (not on this computer now)`]);let o=D("lan-address",a,e.address??a[0]?.[0]??"","Address on the local network");o.disabled=n||!a.length;let l=me(n,{disabled:!a.length,"aria-describedby":"lan-warn"});l.addEventListener("change",()=>{if(l.checked&&!confirm(`Listen on ${o.value}? ${Me}`)){l.checked=!1;return}s("/hub/api/settings/network",{lan:l.checked?o.value:null},u=>u.message)});let r=n?e.listening?`on at ${e.url}`:`on, but this computer does not have ${e.address} now`:"off";return[t("label",{class:"switch"},t("span",{class:"set-switch-text"},t("span",{class:"set-title",text:"Local network"}),t("span",{class:"meta",text:`Listen on the local network: ${r}`})),l),a.length?t("div",{class:"login-form"},M("Address",o)):t("span",{class:"meta",text:"This computer is on no local network."}),t("p",{class:"meta",id:"lan-warn"},V(`Reviewers only: the owner never signs in there, and no link with the owner key points there. ${Me} At a terminal: \`austere-axi server lan <address>\`.`))]}var be=window.__AUSTERE_HUB__??{version:"",home:"",sep:"/"},$e=[{id:"inbox",label:"Inbox",icon:"inbox"},{id:"pages",label:"Pages",icon:"file"},{id:"notes",label:"Notes",icon:"message"},{id:"runs",label:"Runs",icon:"terminal"},{id:"settings",label:"Settings",icon:"sliders"}],He=e=>$e.some(s=>s.id===e),Se="austere:hub:view",ze="austere:hub:closed-projects";function We(e,s){try{let n=localStorage.getItem(e);return n==null?s:JSON.parse(n)}catch{return s}}function Te(e,s){try{localStorage.setItem(e,JSON.stringify(s))}catch{}}function Ge(){let e=new URLSearchParams(location.search),s=e.get("view"),n=e.has("all")?"all":e.has("archived")?"archived":"open",a;if(s==="search"||He(s))a=s;else if(e.get("q"))a="search";else if(n!=="open")a="pages";else{let o=We(Se,"inbox");a=He(o)?o:"inbox"}return{view:a,project:e.get("project")||"",pagesView:n,q:e.get("q")||"",status:e.get("status")||"",author:e.get("author")||"",device:e.get("device")||""}}function z(e){let s=new URLSearchParams;return s.set("view",e.view),e.project&&s.set("project",e.project),e.view==="pages"&&e.pagesView!=="open"&&s.set(e.pagesView,"1"),(e.view==="search"||e.view==="notes")&&e.q&&s.set("q",e.q),e.view==="notes"&&(e.status&&s.set("status",e.status),e.author&&s.set("author",e.author),e.device&&s.set("device",e.device)),`/?${s}`}var c=Ge(),Fe=c.view==="search"?"inbox":c.view;function x(e,s,n=`${s}s`){return`${e} ${e===1?s:n}`}function G(e){if(!e)return"";let s=new Date(e),n=new Date,a=(l,r)=>l.toDateString()===r.toDateString(),o=s.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",hour12:!1});return a(s,n)?`Today ${o}`:a(s,new Date(Date.now()-864e5))?`Yesterday ${o}`:`${s.toLocaleDateString("en",{weekday:"short",month:"short",day:"numeric",year:s.getFullYear()===n.getFullYear()?void 0:"numeric"})} ${o}`}function je(e){let s=be.home;return s&&(e===s||e.startsWith(s+be.sep))?`~${e.slice(s.length)}`:e}function Ee(e,s){if(e.length<=s)return e;let n=Math.floor((s-1)/2);return`${e.slice(0,s-1-n)}\u2026${e.slice(e.length-n)}`}var he=e=>e.split(/[\\/]/).pop()||e,W=e=>e.title||he(e.rel_path),$t={listening:"an agent is listening",nobody:"nobody is taking them"},St={open:"unanswered",received:"unanswered",addressed:"answered",held:"held for you"},Tt="http://www.w3.org/2000/svg";function jt(){let e=(n,a)=>{let o=document.createElementNS(Tt,n);for(let[l,r]of Object.entries(a))o.setAttribute(l,r);return o},s=e("svg",{class:"logo",width:"24",height:"24",viewBox:"0 0 32 32","aria-hidden":"true"});return s.append(e("rect",{class:"logo-ground",width:"32",height:"32",rx:"7"}),e("rect",{class:"logo-edge",x:"1",y:"1",width:"30",height:"30",rx:"6"}),e("path",{class:"logo-a",d:"M9 23 16 8l7 15M11.5 18h9"})),s}document.body.append(t("div",{class:"hub"},t("aside",{class:"side",id:"side","aria-label":"Projects and views"},t("div",{class:"brand"},jt(),t("a",{href:"/?view=inbox",text:"austere-axi"}),t("small",{text:be.version})),t("form",{class:"search",role:"search"},t("label",{class:"search-box"},j("search",{size:15,width:1.8}),t("input",{type:"search",name:"q",placeholder:"Search pages and parts","aria-label":"Search pages and parts",autocomplete:"off"}))),t("nav",{class:"views","aria-label":"Views"}),t("div",{class:"side-h"},t("span",{text:"Projects"}),t("a",{class:"all-projects",href:"/",hidden:!0,text:"All"})),t("ul",{class:"projects"})),t("div",{class:"scrim"}),t("div",{class:"main"},t("header",{class:"top"},t("button",{type:"button",class:"side-toggle","aria-controls":"side","aria-expanded":"false"},j("menu",{size:18}),t("span",{class:"side-toggle-text",text:"Projects"})),t("button",{type:"button",class:"top-search","aria-label":"Search pages and parts"},j("search",{size:20,width:1.8}))),t("div",{class:"status",role:"status","aria-live":"polite"}),t("main",{class:"content",id:"content",tabindex:"-1"}),t("nav",{class:"tabbar","aria-label":"Views"}))));var $=e=>document.querySelector(e),Et=$("#content"),Lt=$(".status"),Z=$(".search input"),Ke=window.matchMedia("(max-width: 860px)");function Le(){$(".side").inert=Ke.matches&&!document.documentElement.classList.contains("side-open")}function se(e){if(document.documentElement.classList.toggle("side-open",e),$(".side-toggle").setAttribute("aria-expanded",String(e)),Le(),e){let s=$(".views a");(s&&s.getClientRects().length?s:$(".brand a"))?.focus()}}Ke.addEventListener("change",Le);Le();$(".side-toggle").addEventListener("click",()=>se(!document.documentElement.classList.contains("side-open")));$(".top-search").addEventListener("click",()=>{se(!0),Z.focus()});$(".scrim").addEventListener("click",()=>se(!1));document.addEventListener("keydown",e=>{e.key==="Escape"&&document.documentElement.classList.contains("side-open")&&(se(!1),$(".side-toggle").focus())});function Y(e,...s){Lt.replaceChildren(...e?[t("span",{text:e}),...s]:[])}var de=class extends Error{};async function N(e){let s=await fetch(e,{headers:{accept:"application/json"}});if(s.status===403)throw new de("This browser is not signed in as the owner. Run `austere-axi hub open` to sign in again.");if(!s.ok)throw new Error(`austere-axi answered ${s.status}`);return await s.json()}async function Ce(e,s={}){try{let n=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)});return n.ok?await n.json():null}catch{return null}}var ye="Could not reach austere-axi. Check that it is still running, then reload.",_t=e=>e instanceof de?e.message:ye;function F(e){let n=new URLSearchParams(Object.entries(e).filter(([,a])=>a!=="")).toString();return n?`?${n}`:""}function T(e,s={}){return`/hub/open/${e}${F(s)}`}function Ve(e){let s=[e.unanswered?`${e.unanswered} unanswered`:"",e.listening?"agent listening":"",e.missing?"missing":"",e.archived?"archived":""].filter(Boolean);return t("a",{class:`chip${e.unanswered?" waiting":""}${e.missing?" gone":""}`,href:T(e.id),title:`${e.label} \xB7 ${e.file}`,"data-copy":e.id},j("branch",{size:12,width:2}),t("span",{class:"chip-label",text:Ee(e.label,28)}),s.length?t("span",{class:"chip-note",text:s.join(" \xB7 ")}):null)}var Oe=3;function Je(e,s=2){if(e.length<s||!e.length)return null;let n=e.slice(Oe);return t("div",{class:"chips"},e.slice(0,Oe).map(Ve),n.length?t("details",{class:"more"},t("summary",{text:`+${n.length} more`}),t("div",{class:"chips"},n.map(Ve))):null)}function Xe(e){let s=e.copies.length===1?e.copies[0]:null;if(!s){let n=[x(e.copies.length,"copy","copies")];return e.copies.every(a=>a.missing)?n.push(t("em",{class:"gone",text:"missing"})):e.copies.some(a=>a.listening)&&n.push(t("em",{class:"live",text:"agent listening"})),n}return[s.missing?t("em",{class:"gone",text:"missing"}):null,s.archived?t("em",{text:"archived"}):null,s.checked?t("em",{text:"checked"}):null,s.listening?t("em",{class:"live",text:"agent listening"}):null]}function H(e){return e.filter(n=>n!=null&&n!==!1&&n!=="").flatMap((n,a)=>a?[" \xB7 ",n]:[n])}function Rt(e){let s=[];if(e.changed&&s.push(t("li",{class:"need",text:`Changed since you looked: ${x(e.changed,"revision")}`})),e.held&&s.push(t("li",{class:"need",text:`${x(e.held,"note")} held for you to release`})),e.failed){let n=e.copies.find(a=>a.failed_run)?.failed_run;s.push(t("li",{class:"need fail",text:`Agent run failed${n?.reason?` (${n.reason.replace(/_/g," ")})`:""}${n?.ended_at?` \xB7 ${G(n.ended_at)}`:""}`}))}if(e.taker){let n=e.unanswered-e.held;s.push(t("li",{class:`wait ${e.taker}${e.run_active?" active":""}`},t("span",{class:"lead",text:x(n,"unanswered note")}),` \xB7 ${e.taker==="attach_on"?e.run_active?"agent on: a run is working on them":"agent on: your next note starts a run":$t[e.taker]}`))}return s.length?t("ul",{class:"why"},s):null}function At(e){return e.length?t("ul",{class:"previews"},e.map(s=>t("li",{},t("span",{class:"quote",text:s.text||"(no text)"}),t("span",{class:"by"},H([s.author||"You",s.target?t("span",{},"on ",t("code",{class:"target",text:s.target})):null,s.label,St[s.status]??s.status]))))):null}function Mt(e){return e.group==="needs_you"?e.failed?["alert","red"]:e.held?["person","amber"]:["pencil","amber"]:e.group==="waiting_on_agent"?e.run_active||e.taker==="listening"?["bolt","green"]:e.taker==="attach_on"?["bolt","grey"]:["waiting","grey"]:["file","plain"]}function Pt(e){return e.taker==="nobody"?t("a",{class:"btn fill",href:T(e.open_id,{attach:"1"}),text:"Turn agent on"}):e.group!=="needs_you"?null:e.changed?t("a",{class:"btn fill",href:T(e.open_id),text:"Review changes"}):e.held?t("a",{class:"btn fill",href:T(e.open_id),text:"Open held notes"}):null}function Qe(e,s=!1){let n=`${s?"Unarchive":"Archive"} ${W(e)}`,a=s?"Bring this page back to the lists":e.copies.length>1?"Put every copy of this page away; its notes are kept":"Put this page away; its notes are kept",o=s?t("button",{type:"button",class:"btn ghost",text:"Unarchive",title:a,"aria-label":n,onclick:()=>{Ie(e,o,"unarchive")}}):t("button",{type:"button",class:"icon-btn",title:a,"aria-label":n,onclick:()=>{Ie(e,o,"archive")}},j("archive"));return o}function Ye(e,s={}){let n=e.copies.find(d=>d.id===e.open_id)??e.copies[0],a=[e.unanswered?t("b",{class:"open",text:`${e.unanswered} unanswered`}):null,e.addressed?`${e.addressed} answered`:null],o=H([...Xe(e),...a]),[l,r]=Mt(e),u=G(e.activity);return t("li",{class:`row page-row ${e.group}`,"data-page":e.id},t("span",{class:`tile ${r}`,"aria-hidden":"true"},j(l,{size:16,width:1.8})),t("div",{class:"row-main"},t("a",{class:"row-title",href:T(e.open_id),title:n?.file??""},W(e)),t("span",{class:"path",text:s.showProject?`${e.project} / ${e.rel_path}`:e.rel_path}),o.length?t("span",{class:"meta"},o):null,Rt(e),At(s.notes??[]),Je(e.copies)),t("div",{class:"row-actions"},u?t("span",{class:"when",text:u}):null,Pt(e),Qe(e,s.archivedView)))}async function Ie(e,s,n){if(s.disabled)return;s.disabled=!0;let a=await Ce(`/hub/api/page/${e.open_id}/${n}`);if(!a)return s.disabled=!1,Y(`Could not ${n} ${W(e)}. ${ye}`);let o=n==="archive"?"unarchive":"archive",l=t("button",{type:"button",class:"btn tiny",text:"Undo",onclick:async()=>{if(!l.disabled){if(l.disabled=!0,!await Ce(`/hub/api/page/${e.open_id}/${o}`,{ids:a.ids}))return l.disabled=!1,Y(`Could not undo. ${ye}`,l);Y(""),O(),te()}}});Y(`${n==="archive"?"Archived":"Unarchived"} ${W(e)}.`,l),O(),te()}function xe(e,s,n,a=null,o=""){let l=`h-${e.toLowerCase().replace(/[^a-z]+/g,"-")}`;return t("section",{class:o,"aria-labelledby":l},t("h2",{id:l},e,s==null?null:t("span",{class:"n",text:String(s)}),a),n)}function E(...e){return t("p",{class:"empty"},e)}function P(e,s){let n={...c,...e};return t("a",{href:z(n),onclick:a=>I(a,e),text:s})}var ue=[],Ze=[];function ee(e){return c.project?t("p",{class:"filter"},`Project ${e?.name?je(e.name):c.project}`," \xB7 ",P({project:""},"all projects")):null}function ve(e,s,n,a,o){let l=`h-${e.toLowerCase().replace(/[^a-z]+/g,"-")}`;return t("section",{class:o,"aria-labelledby":l},t("div",{class:"sec-h"},t("h2",{id:l},e,t("span",{class:"n",text:String(s)})),t("p",{class:"hint",text:n})),a)}async function Nt(){let e=await N(`/hub/api/inbox${F({project:c.project})}`),s=e.needs_you.length+e.waiting_on_agent.length+e.quiet.length,n=!c.project,a=r=>t("ul",{class:"rows card"},r.map(u=>Ye(u,{showProject:n,notes:u.notes})));if(!s)return[t("header",{class:"view-h"},t("h1",{text:"Inbox"})),ee(e.project),E(c.project?"Nothing is open for review in this project.":"No pages yet. Open one for review with austere-axi and it shows up here.")];let o=e.waiting_on_agent.length,l=H([e.needs_you.length?t("span",{class:"need",text:`${x(e.needs_you.length,"page needs","pages need")} you`}):"nothing needs you",o?`${o} ${o===1?"waits":"wait"} on an agent`:null,e.quiet.length?`${e.quiet.length} quiet`:null,e.held?`${x(e.held,"note")} held for release`:null,e.failed_runs.length?x(e.failed_runs.length,"failed run"):null]);return[t("header",{class:"view-h"},t("h1",{text:"Inbox"}),t("p",{class:"summary"},l)),ee(e.project),ve("Needs you",e.needs_you.length,"The agent changed the page, a teammate's notes wait for you, or a run failed",e.needs_you.length?a(e.needs_you):E("Nothing changed since you looked, no note is held for you and no run failed."),"group needs"),ve("Waiting on agent",o,"Notes no agent has answered yet, and who takes them",o?a(e.waiting_on_agent):E("No unanswered notes."),"group waiting"),ve("Quiet",e.quiet.length,"Open for review, nothing waiting",e.quiet.length?a(e.quiet):E("Every page has something going on."),"group quiet")]}var Ue=[{id:"open",label:"Open",count:"open"},{id:"all",label:"Everything",count:"everything"},{id:"archived",label:"Archived",count:"archived"}],Ht={needs_you:"Needs you",waiting_on_agent:"Waiting on agent",quiet:"Quiet"};function Ct(e){return e.changed?t("span",{class:"why-short need",text:"Changed since you looked"}):e.held?t("span",{class:"why-short need",text:`${x(e.held,"note")} held for you`}):e.failed?t("span",{class:"why-short fail",text:"Agent run failed"}):e.taker==="attach_on"?t("span",{class:`why-short${e.run_active?" live":""}`,text:e.run_active?"A run is working on them":"Agent on: your next note starts a run"}):e.taker==="nobody"?t("span",{class:"why-short"},"Nobody is taking them \xB7 ",t("a",{href:T(e.open_id,{attach:"1"}),text:"Turn agent on"})):null}function Vt(e,s){let n=e.copies.find(r=>r.id===e.open_id)??e.copies[0],a=H([e.unanswered?t("b",{class:"open",text:`${e.unanswered} unanswered`}):null,e.addressed?`${e.addressed} answered`:null]),o=H(Xe(e)),l=e.failed?"fail":e.group==="needs_you"?"need":e.run_active||e.taker==="listening"?"live":"idle";return t("li",{class:`row page-row trow ${e.group}`,"data-page":e.id},t("div",{class:"t-page"},t("span",{class:`dot ${l}`,role:"img","aria-label":e.failed?"Agent run failed":Ht[e.group]??e.group}),t("div",{class:"row-main"},t("a",{class:"row-title",href:T(e.open_id),title:n?.file??""},W(e)),t("span",{class:"path",text:e.rel_path}))),t("div",{class:"t-copies"},Je(e.copies,1)),t("div",{class:"t-notes"},a.length?t("span",{class:"t-count"},a):null,Ct(e),o.length?t("span",{class:"meta"},o):null),t("span",{class:"when",text:G(e.activity)}),t("div",{class:"row-actions"},Qe(e,s)))}async function Ot(){let e=await N(`/hub/api/pages${F({project:c.project,view:c.pagesView})}`),{counts:s}=e,n=t("nav",{class:"seg","aria-label":"Which pages"},Ue.map(f=>{let m=P({pagesView:f.id},f.label);return f.id===c.pagesView&&m.setAttribute("aria-current","page"),m.append(" ",t("span",{class:"n",text:String(s[f.count])})),m})),a=e.pages.reduce((f,m)=>f+m.unanswered,0),o=new Set(e.pages.map(f=>f.project_id)).size,l=[t("header",{class:"view-h split"},t("div",{},t("h1",{text:"Pages"}),t("p",{class:"summary",text:H([`${x(e.pages.length,"page")} in ${x(o,"project")}`,a?x(a,"unanswered note"):null]).join("")})),n),ee(e.project)];if(!e.pages.length){let f=Ue.filter(b=>b.id!==c.pagesView&&s[b.count]>0).map(b=>P({pagesView:b.id},`${b.label} (${s[b.count]})`));if(s.everything===0&&!c.project)return[...l,E("No pages yet. Open one for review with austere-axi and it shows up here.")];if(c.pagesView==="archived")return[...l,E("No archived pages.",...f.length?[" See: ",...H(f),"."]:[])];let m=["Nothing is open for review."];return s.checked&&m.push(` ${x(s.checked,"page was","pages were")} checked but never opened: `,P({pagesView:"all"},"show them"),"."),s.archived&&m.push(` ${s.archived} archived: `,P({pagesView:"archived"},"show"),"."),[...l,E(...m)]}let r=new Map;for(let f of e.pages){let m=r.get(f.project_id);m||r.set(f.project_id,m=[]),m.push(f)}let u=new Map(ue.map(f=>[f.id,f])),d=c.pagesView==="archived",h=[];for(let[f,m]of r){let b=u.get(f),k=b?.roots??[],ae=m.reduce((U,K)=>U+K.unanswered,0),ie=k.length?`${Ee(je(k[0]),48)}${k.length>1?` \xB7 +${k.length-1} more ${k.length===2?"folder":"folders"}`:""}`:"";h.push(t("li",{class:"proj-row"},t("h2",{},P({project:f},m[0].project)),ie?t("small",{class:"path",title:k.join(`
2
+ `),text:ie}):null,ae?t("span",{class:`proj-wait${m.some(U=>U.needs_you)?" need":""}`,text:`${ae} unanswered`}):null,b?.same_as?t("p",{class:"same"},`Same repository as project ${b.same_as.name}: `,t("code",{text:b.same_as.merge})):null),...m.map(U=>Vt(U,d)))}let L=t("div",{class:`table card pages-table${d?" archived":""}`},t("div",{class:"thead","aria-hidden":"true"},["Page","Copies","Notes","Last activity",""].map(f=>t("span",{text:f}))),t("ul",{class:"rows"},h)),_=c.pagesView==="open"&&s.checked?t("p",{class:"foot"},`${x(s.checked,"more page was","more pages were")} checked but never opened for review. `,P({pagesView:"all"},"Show them")):null;return[...l,L,_]}var It={open:"Unanswered",received:"Unanswered",addressed:"Answered",held:"Held for you"};async function Ut(){let e=await N(`/hub/api/notes${F({project:c.project,q:c.q,status:c.status,author:c.author,device:c.device})}`),s=(r,u,d)=>t("option",{value:r,selected:d===r,text:u}),n=t("form",{class:"filters",onsubmit:r=>{r.preventDefault();let u=new FormData(r.target);I(null,{q:String(u.get("q")??""),status:String(u.get("status")??""),author:String(u.get("author")??"")})}},t("label",{class:"search-box"},j("search",{size:15,width:1.8}),t("input",{type:"search",name:"q",value:c.q,placeholder:"Search notes, targets, page titles","aria-label":"Search notes"})),t("select",{name:"status","aria-label":"Status"},s("","All",c.status),s("unanswered","Unanswered",c.status),s("answered","Answered",c.status)),e.authors.length?t("select",{name:"author","aria-label":"Author"},s("","Everyone",c.author),s("owner","Owner",c.author),e.authors.map(r=>s(r,r,c.author))):null,t("button",{type:"submit",class:"btn",text:"Filter"})),a=e.notes.filter(r=>r.status!=="addressed").length,o=e.notes.map(r=>{let u=r.label&&r.label!==r.project?`${r.project} \xB7 ${r.label}`:r.project,d=r.status==="addressed"?"done":r.status==="held"?"waiting held":"waiting",h=G(r.at);return t("li",{class:"note"},t("span",{class:`st ${d}`},t("span",{class:"st-dot","aria-hidden":"true"}),It[r.status]??r.status),t("div",{class:"note-main"},t("a",{href:T(r.artifact_id),title:r.file},t("p",{class:"quote",text:r.text||"(no text)"})),t("span",{class:"meta"},r.author?t("b",{class:"by",text:r.author}):null,r.remote?t("span",{text:"hosted page"}):null,r.target?[t("span",{text:"on"}),t("code",{class:"target",text:r.target})]:null,t("span",{text:"in"}),t("a",{href:T(r.artifact_id),text:r.title||he(r.file)}),u?t("span",{text:`\xB7 ${u}`}):null)),h?t("span",{class:"when",text:h}):null)}),l=c.q||c.project||c.author||c.device||c.status;return[t("header",{class:"view-h"},t("h1",{text:"Notes"}),t("p",{class:"summary",text:`${l?"Newest first":"Every note on every page, newest first"} \xB7 ${x(e.notes.length,"note")}${a?` \xB7 ${a} unanswered`:""}`})),n,ee(e.project),e.device?t("p",{class:"filter"},`Device ${e.device.name} (${e.device.id}) \xB7 `,P({device:""},"everyone")):null,o.length?t("ul",{class:"notes card"},o):E(l?"No notes match.":"No notes yet.")]}var qt={queued:"Queued",waiting_for_session:"Waiting for its session",running:"Running",done:"Done",failed:"Failed",stopped:"Stopped",interrupted:"Interrupted"};async function Bt(){let e=await N(`/hub/api/runs${F({project:c.project})}`),s=n=>{let a=n.started_at&&n.ended_at?`${Math.max(1,Math.round((n.ended_at-n.started_at)/1e3))} s`:"";return t("li",{class:`run ${n.status}`},t("span",{class:`rstat ${n.status}`},t("span",{class:"st-dot","aria-hidden":"true"}),qt[n.status]??n.status),t("div",{class:"run-main"},n.artifact_id?t("a",{href:T(n.artifact_id),title:n.file??"",text:n.title||he(n.file??n.artifact_id)}):t("span",{text:n.kind==="trigger"?"Trigger run":"Run"}),n.reason?t("span",{class:"run-why",text:n.reason.replace(/_/g," ")}):null),t("span",{class:"agent",text:H([n.harness,n.mode]).join("")}),t("span",{class:"when",text:G(n.started_at)}),t("span",{class:"took",text:a}))};return[t("header",{class:"view-h"},t("h1",{text:"Runs"}),t("p",{class:"summary",text:"Agent runs your notes started on pages where the agent is on, newest first"})),ee(e.project),e.runs.length?t("div",{class:"table card runs-table"},t("div",{class:"thead","aria-hidden":"true"},["Status","Page","Agent","Started","Took"].map(n=>t("span",{text:n}))),t("ul",{class:"runs"},e.runs.map(s))):E("No runs yet. Turn an agent on in a page's Agent menu and the owner's notes start one.")]}async function Dt(){let e=await N(`/hub/api/search${F({q:c.q})}`),s=n=>t("li",{class:"part"},t("a",{href:T(n.artifact_id,{part:n.statement}),title:n.file},t("span",{class:"part-title",text:`${n.title||he(n.file)} \xB7 ${n.statement}`}),t("span",{class:"snippet",text:n.snippet})),t("span",{class:"meta",text:H([n.component||null,n.copy]).join("")}));return[t("header",{class:"view-h"},t("h1",{},"Search: ",t("q",{text:e.q}))),xe("Pages",e.pages.length,e.pages.length?t("ul",{class:"rows card"},e.pages.map(n=>Ye(n,{showProject:!0}))):E("No page title, path or project matches.")),xe("Parts",e.parts.length,e.parts.length?t("ul",{class:"parts card"},e.parts.map(s)):E("No part of a page says that."))]}var zt={say:Y,again:()=>{O(),te()},when:G,tilde:je,plural:x,section:xe,empty:E,notesOf:e=>P({view:"notes",device:e.id,project:"",q:"",status:"",author:""},`Notes by ${e.name}`),get:N},Wt={inbox:Nt,pages:Ot,notes:Ut,runs:Bt,settings:()=>Ne(zt),search:Dt},qe=0;async function O(){let e=++qe;document.title=`${c.view==="search"?"Search":$e.find(n=>n.id===c.view)?.label} \xB7 austere-axi hub`;for(let n of document.querySelectorAll(".views a, .tabbar a"))n.dataset.view===c.view?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current");Z.value=c.view==="search"?c.q:"";let s;try{s=await Wt[c.view]()}catch(n){s=[t("p",{class:"error",text:_t(n)})]}e===qe&&Et.replaceChildren(...s.filter(n=>n!=null&&n!==!1).map(n=>typeof n=="number"?String(n):n))}function I(e,s,n=!0){let a=e;a&&(a.metaKey||a.ctrlKey||a.shiftKey||a.button===1)||(e?.preventDefault(),c.view!=="search"&&(Fe=c.view),c={...c,...s},s.view&&s.view!=="notes"&&s.view!=="search"&&(c={...c,q:"",status:"",author:"",device:""}),c.view!=="search"&&Te(Se,c.view),n?history.pushState(null,"",z(c)):history.replaceState(null,"",z(c)),se(!1),ne(),O())}window.addEventListener("popstate",()=>{c=Ge(),ne(),O()});var ke=0;Z.addEventListener("input",()=>{clearTimeout(ke),ke=window.setTimeout(()=>{let e=Z.value.trim();e?I(null,{view:"search",q:e},c.view!=="search"):c.view==="search"&&I(null,{view:Fe,q:""})},200)});$(".search").addEventListener("submit",e=>{e.preventDefault(),clearTimeout(ke);let s=Z.value.trim();s&&I(null,{view:"search",q:s},c.view!=="search")});function Be(e,s,n){return $e.map(a=>t("a",{href:z({...c,view:a.id}),"data-view":a.id,"aria-current":c.view===a.id?"page":!1,onclick:o=>I(o,{view:a.id})},j(a.icon,e?{size:20,width:1.8}:{}),t("span",{class:"label",text:a.label}),a.id==="inbox"&&s?t("span",{class:"count need",title:`${x(s,"page needs","pages need")} you`,text:String(s)}):null,a.id==="settings"&&n?t("span",{class:"count need",title:`${x(n,"person asks","people ask")} for access`,text:String(n)}):null))}function Gt(e,s){$(".views").replaceChildren(...Be(!1,e,s)),$(".tabbar").replaceChildren(...Be(!0,e,s))}var Q=new Set(We(ze,[])),De=()=>t("span",{class:"dot need",role:"img","aria-label":"Needs you"});function ne(){Gt(ue.reduce((a,o)=>a+o.needs_you,0),et);let e=$(".all-projects");e.hidden=!c.project,e.href=z({...c,project:""}),e.onclick=a=>I(a,{project:""});let s=new Map;for(let a of Ze){let o=s.get(a.project_id);o||s.set(a.project_id,o=[]),o.push(a)}let n=ue.filter(a=>a.pages>0||c.project===a.id||c.project===a.name).map(a=>{let o=c.project===a.id||c.project===a.name,l=!Q.has(a.id),r=s.get(a.id)??[],u=t("button",{type:"button",class:"proj-toggle","aria-expanded":String(l),"aria-label":`${l?"Hide":"Show"} the pages of ${a.name}`,onclick:()=>{Q.has(a.id)?Q.delete(a.id):Q.add(a.id),Te(ze,[...Q]),ne()}},j("chevronRight",{size:14,width:2}));return t("li",{class:`proj${o?" selected":""}`},t("div",{class:"proj-head"},u,t("a",{class:"proj-link",href:z({...c,project:a.id}),title:a.roots.join(`
3
+ `),"aria-current":o?"true":!1,onclick:d=>I(d,{project:a.id}),text:a.name}),a.unanswered?t("span",{class:`count${a.needs_you?" need":""}`,title:x(a.unanswered,"unanswered note"),text:String(a.unanswered)}):a.needs_you?De():null),l?t("ul",{class:"proj-pages"},r.map(d=>t("li",{},t("a",{href:T(d.open_id),title:d.rel_path,class:d.needs_you?"need":""},t("span",{class:"pg-title",text:W(d)}),d.needs_you?De():d.unanswered?t("span",{class:"count",title:x(d.unanswered,"unanswered note"),text:String(d.unanswered)}):null),d.copies.length>1?t("div",{class:"mini-chips"},d.copies.map(h=>t("a",{class:`mini-chip${h.unanswered?" waiting":""}`,href:T(h.id),title:`${h.label} \xB7 ${h.file}`,text:Ee(h.label,18)}))):null))):null)});$(".projects").replaceChildren(...n.length?n:[t("li",{class:"side-empty",text:"No projects yet."})])}var et=0;async function te(){try{let[e,s,n]=await Promise.all([N("/hub/api/projects"),N("/hub/api/pages"),N("/hub/api/people/requests")]);ue=e.projects,Ze=s.pages,et=n.waiting.length}catch{}ne()}document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(te(),O())});history.replaceState(null,"",z(c));c.view!=="search"&&Te(Se,c.view);ne();te().then(()=>{c.view==="pages"&&O()});O();})();
package/dist/cli.mjs CHANGED
@@ -23605,7 +23605,7 @@ var init_paths = __esm({
23605
23605
  HERE = path.dirname(fileURLToPath(import.meta.url));
23606
23606
  BUNDLED = true;
23607
23607
  ASSET_DIR = BUNDLED ? HERE : path.resolve(HERE, "../../dist");
23608
- VERSION = true ? "0.15.0" : packageVersion();
23608
+ VERSION = true ? "0.16.0" : packageVersion();
23609
23609
  CLI_ENTRY = BUNDLED ? fileURLToPath(import.meta.url) : path.resolve(HERE, "main.ts");
23610
23610
  REAL_PORT = 4388;
23611
23611
  securedDir = null;
@@ -36345,7 +36345,28 @@ function saveAccount(account, url2) {
36345
36345
  if (url2) cur.url = url2;
36346
36346
  writeFile(cur);
36347
36347
  }
36348
+ function settingsFile() {
36349
+ return path15.join(stateDir(), "settings.json");
36350
+ }
36351
+ function cloudEnabled() {
36352
+ try {
36353
+ const raw = JSON.parse(fs20.readFileSync(settingsFile(), "utf8"));
36354
+ return !!raw && typeof raw === "object" && "cloud" in raw && raw.cloud === true;
36355
+ } catch {
36356
+ return false;
36357
+ }
36358
+ }
36359
+ function setCloudEnabled(on2) {
36360
+ const file3 = settingsFile();
36361
+ const tmp = `${file3}.${process.pid}.tmp`;
36362
+ fs20.writeFileSync(tmp, JSON.stringify({ cloud: on2 }, null, 2) + "\n", { mode: 384 });
36363
+ fs20.renameSync(tmp, file3);
36364
+ }
36365
+ function requireCloud() {
36366
+ if (!cloudEnabled()) throw new CloudError("cloud features are off, so only local review works: turn them on in Settings \u2192 Cloud, or run `austere-axi cloud on`", void 0, CLOUD_OFF);
36367
+ }
36348
36368
  function stateFor(url2) {
36369
+ requireCloud();
36349
36370
  const state = readCloud();
36350
36371
  if ((state.token || state.account) && state.url && state.url !== url2) {
36351
36372
  throw new CloudError(
@@ -36408,6 +36429,7 @@ async function call(base, method, route, opts = {}) {
36408
36429
  headers["content-type"] = opts.body.type;
36409
36430
  headers["content-encoding"] = "gzip";
36410
36431
  }
36432
+ requireCloud();
36411
36433
  let res;
36412
36434
  try {
36413
36435
  res = await fetch(base + route, { method, headers, body: payload, redirect: "error" });
@@ -36446,6 +36468,7 @@ function tokenExp(jwt2) {
36446
36468
  }
36447
36469
  }
36448
36470
  async function workos(apiBase, route, form) {
36471
+ requireCloud();
36449
36472
  let res;
36450
36473
  try {
36451
36474
  res = await fetch(apiBase + route, {
@@ -36560,6 +36583,7 @@ async function whoami() {
36560
36583
  return { email: me2.user.email, name: typeof me2.user.name === "string" ? me2.user.name : "", pages: typeof me2.pages === "number" ? me2.pages : 0 };
36561
36584
  }
36562
36585
  function ownerSocket(base, credential2, id) {
36586
+ requireCloud();
36563
36587
  const url2 = `${base.replace(/^http/, "ws")}/api/pages/${encodeURIComponent(id)}/sync?cli=${encodeURIComponent(VERSION)}`;
36564
36588
  const jwt2 = credential2.includes(".");
36565
36589
  const headers = { "user-agent": `austere-axi/${VERSION}` };
@@ -36843,7 +36867,7 @@ async function clonePage(id, abs) {
36843
36867
  writeCloud(state);
36844
36868
  return { id, file: abs, url: `${base}/p/${id}`, title: page?.title ?? readArtifact(html).title };
36845
36869
  }
36846
- var DEFAULT_CLOUD_URL, PAGE_ID_RE, SOCKET_TIMEOUT_MS, MAX_INVITE_NAME, INVITE_TOKEN_RE, str2, sleep3, CloudError, REFRESH_MARGIN_S, fresh, HOSTED_PACK_TAG_RE;
36870
+ var DEFAULT_CLOUD_URL, PAGE_ID_RE, SOCKET_TIMEOUT_MS, MAX_INVITE_NAME, INVITE_TOKEN_RE, str2, sleep3, CloudError, CLOUD_OFF, REFRESH_MARGIN_S, fresh, HOSTED_PACK_TAG_RE;
36847
36871
  var init_cloud = __esm({
36848
36872
  "src/cli/cloud.ts"() {
36849
36873
  "use strict";
@@ -36871,6 +36895,7 @@ var init_cloud = __esm({
36871
36895
  this.code = code;
36872
36896
  }
36873
36897
  };
36898
+ CLOUD_OFF = "cloud_off";
36874
36899
  REFRESH_MARGIN_S = 60;
36875
36900
  fresh = (a) => tokenExp(a.accessToken) - REFRESH_MARGIN_S > Date.now() / 1e3;
36876
36901
  HOSTED_PACK_TAG_RE = /<script\b[^>]*\bsrc\s*=\s*["'](?:\/rt\/[^/"']+\/packs\/[a-z0-9-]+\.js|\/pk\/[0-9a-f]{64}\.js)["'][^>]*>\s*<\/script\s*>\n?/gi;
@@ -37670,7 +37695,7 @@ function resolveTarget(db, artifactId, setting) {
37670
37695
  return { mode: setting.mode, harness: session2.harness, session: session2 };
37671
37696
  }
37672
37697
  function autoConflict(db, file3, artifactId, liveAuto = (_, fallback) => fallback) {
37673
- const entry = readCloud().pages[file3];
37698
+ const entry = cloudEnabled() ? readCloud().pages[file3] : void 0;
37674
37699
  if (entry && (entry.auto || liveAuto(entry.id, entry.auto))) return `${file3} is published with --auto: reviewers' notes reach the agent without the owner`;
37675
37700
  const projectId = db.prepare("SELECT project_id FROM artifacts WHERE id = ?").get(artifactId)?.project_id ?? null;
37676
37701
  const auto = new DeviceStore(db).autoNames(artifactId, projectId);
@@ -39608,8 +39633,9 @@ var init_peer = __esm({
39608
39633
  this.clientId = clientId;
39609
39634
  }
39610
39635
  // ── what the server calls ──
39611
- /** Server start: one pull for every published page, and the queue left from last time. */
39636
+ /** Server start, or cloud features turned on: one pull for every published page, and the queue left from last time. */
39612
39637
  start() {
39638
+ if (!cloudEnabled()) return;
39613
39639
  const state = readCloud();
39614
39640
  if (!hasOwner(state)) return;
39615
39641
  for (const [file3, e] of Object.entries(state.pages)) this.kick(this.link(e.id, file3), { pull: true });
@@ -39672,6 +39698,7 @@ var init_peer = __esm({
39672
39698
  * Call it in the transaction that changed them, so the change and its mutation commit together.
39673
39699
  */
39674
39700
  settled(entries, name2, s) {
39701
+ if (!cloudEnabled()) return;
39675
39702
  for (const e of entries) {
39676
39703
  if (!e.remoteId) continue;
39677
39704
  const cut = e.remoteId.indexOf("/");
@@ -39725,9 +39752,19 @@ var init_peer = __esm({
39725
39752
  if (link.ws) this.drop(link, link.ws);
39726
39753
  }
39727
39754
  }
39755
+ /** Cloud features were turned off: every socket closes, no retry stays pending, and whoever waits hears now. start() picks up again. */
39756
+ pause() {
39757
+ for (const link of this.links.values()) {
39758
+ clearTimeout(link.retry ?? void 0);
39759
+ link.retry = null;
39760
+ if (link.ws) this.drop(link, link.ws);
39761
+ this.down(link);
39762
+ }
39763
+ }
39728
39764
  // ── links and sockets ──
39729
- /** The link for a published file (cloud.json is read again: `publish` may have run since). */
39765
+ /** The link for a published file (cloud.json is read again: `publish` may have run since); none while cloud features are off. */
39730
39766
  linkFor(file3) {
39767
+ if (!cloudEnabled()) return null;
39731
39768
  const state = readCloud();
39732
39769
  const e = hasOwner(state) ? state.pages[file3] : void 0;
39733
39770
  return e ? this.link(e.id, file3) : null;
@@ -39757,7 +39794,7 @@ var init_peer = __esm({
39757
39794
  return link;
39758
39795
  }
39759
39796
  wanted(link) {
39760
- if (link.stopped || this.closed) return false;
39797
+ if (link.stopped || this.closed || !cloudEnabled()) return false;
39761
39798
  if (link.pullWanted || link.pulls.length) return true;
39762
39799
  const s = this.host.store.byFile(link.file);
39763
39800
  if (s && this.host.listening(s)) return true;
@@ -39782,7 +39819,7 @@ var init_peer = __esm({
39782
39819
  credential(state).then(
39783
39820
  (cred) => {
39784
39821
  link.connecting = false;
39785
- if (!link.ws && !link.stopped && !this.closed) this.open(link, base, cred);
39822
+ if (!link.ws && !link.stopped && !this.closed && cloudEnabled()) this.open(link, base, cred);
39786
39823
  },
39787
39824
  (err) => {
39788
39825
  link.connecting = false;
@@ -41260,6 +41297,7 @@ data: ${JSON.stringify({ state: "revoked" })}
41260
41297
  if (route === "share/list") return send(res, 200, accessList(url2.searchParams.get("links") === "1"));
41261
41298
  if (route === "share/requests" && req.method === "GET") return send(res, 200, requestsList());
41262
41299
  if (route === "share/default" && req.method === "GET") return send(res, 200, { auto: requests.defaultAuto() });
41300
+ if (route === "settings/cloud" && req.method === "GET") return send(res, 200, cloudView());
41263
41301
  if (route === "settings/lan" && req.method === "GET") return send(res, 200, settingsView().network.lan);
41264
41302
  if (req.method !== "POST") return send(res, 405, { error: "POST expected" });
41265
41303
  const body = await readBody(req);
@@ -41280,6 +41318,11 @@ data: ${JSON.stringify({ state: "revoked" })}
41280
41318
  if (!done.revoked.length) return send(res, 404, { error: "no link or device matches that name or id" });
41281
41319
  return send(res, 200, done);
41282
41320
  }
41321
+ if (route === "settings/cloud") {
41322
+ if (typeof body.on !== "boolean") return send(res, 400, { error: "on must be true or false" });
41323
+ setCloud(body.on);
41324
+ return send(res, 200, cloudView());
41325
+ }
41283
41326
  if (route === "settings/lan") {
41284
41327
  const lan = body.lan;
41285
41328
  if (lan !== null && typeof lan !== "string") return send(res, 400, { error: "lan must be one of this computer's local-network addresses, or null" });
@@ -41706,6 +41749,16 @@ data: ${JSON.stringify({ state: "revoked" })}
41706
41749
  const from = process.env.AUSTERE_AXI_LINK_HOST ? "link_host" : tailnet && listeners.has(tailnet.ip) ? "tailscale" : "host";
41707
41750
  return { url: `http://${host}:${port}`, from };
41708
41751
  }
41752
+ function cloudView() {
41753
+ const state = readCloud();
41754
+ return { on: cloudEnabled(), service: state.url || cloudUrl(), account: state.account?.user.email ?? null, published: Object.keys(state.pages).length };
41755
+ }
41756
+ function setCloud(on2) {
41757
+ setCloudEnabled(on2);
41758
+ if (on2) peer.start();
41759
+ else peer.pause();
41760
+ log("settings-cloud", on2 ? "on" : "off");
41761
+ }
41709
41762
  function settingsView() {
41710
41763
  const addresses = Array.from(listeners.keys()).map((host) => ({
41711
41764
  kind: host === "127.0.0.1" ? "this_computer" : host === tailnetBound ? "tailscale" : host === lanHost ? "local_network" : "added",
@@ -41736,6 +41789,7 @@ data: ${JSON.stringify({ state: "revoked" })}
41736
41789
  }
41737
41790
  },
41738
41791
  review: { auto: requests.defaultAuto(), viewing },
41792
+ cloud: cloudView(),
41739
41793
  missing: hub.missingCopies().length,
41740
41794
  gone_folders: listProjects(hub.db).flatMap((p) => p.roots.filter((r) => !fs31.existsSync(r.root)).map((r) => r.root)),
41741
41795
  about: { version: VERSION, state_dir: stateDir(), newer_cli: newestCli }
@@ -41756,6 +41810,11 @@ data: ${JSON.stringify({ state: "revoked" })}
41756
41810
  log("settings-review", body.auto ? "auto" : "hold");
41757
41811
  return done(body.auto ? "New reviewers' notes go straight to the agent." : "New reviewers' notes wait for you.");
41758
41812
  }
41813
+ if (route === "settings/cloud") {
41814
+ if (typeof body.on !== "boolean") return send(res, 400, { error: "on must be true or false" });
41815
+ setCloud(body.on);
41816
+ return done(body.on ? "Cloud features are on: publish, clone and hosted-page sync work." : "Cloud features are off: only local features work, and nothing reaches the service.");
41817
+ }
41759
41818
  if (route === "settings/network") {
41760
41819
  const lan = body.lan;
41761
41820
  if (lan !== null && typeof lan !== "string") return send(res, 400, { error: "lan must be one of this computer's local-network addresses, or null" });
@@ -42246,7 +42305,7 @@ ${message}`;
42246
42305
  }
42247
42306
  if (sub === "/agent-prompt" && req.method === "GET") {
42248
42307
  const state = readCloud();
42249
- const entry = hasOwner(state) ? state.pages[s.file] : void 0;
42308
+ const entry = cloudEnabled() && hasOwner(state) ? state.pages[s.file] : void 0;
42250
42309
  const hosted = entry ? { url: `${state.url || cloudUrl()}/p/${entry.id}`, auto: peer.liveAuto(entry.id, entry.auto) } : void 0;
42251
42310
  const p = projectOfPage(s);
42252
42311
  const shared = p ? projectPolls.get(p.id) : void 0;
@@ -44002,7 +44061,7 @@ ENV
44002
44061
  AUSTERE_AXI_PORT (the running server's, else the service's, else 4388) AUSTERE_AXI_STATE_DIR (~/.austere-axi) AUSTERE_AXI_NO_OPEN=1
44003
44062
  AUSTERE_AXI_HOST AUSTERE_AXI_NO_TAILSCALE=1
44004
44063
  AUSTERE_AXI_IDLE_TIMEOUT_MS (1800000) AUSTERE_AXI_PERSIST=1 AUSTERE_AXI_ALLOWED_HOSTS AUSTERE_AXI_LINK_URL
44005
- AUSTERE_AXI_NPM_REGISTRY CHROME_PATH (check --render) AUSTERE_AXI_CLOUD_URL (https://austere.blundertech.com)
44064
+ AUSTERE_AXI_NPM_REGISTRY CHROME_PATH (check --render) AUSTERE_AXI_CLOUD_URL (https://austere.blundertech.com; used only with \`${BIN5} cloud on\`)
44006
44065
  A scope's token variable (registry add --token-env), sent only to that scope's registry
44007
44066
  `;
44008
44067
  }
@@ -44262,10 +44321,10 @@ var COMMANDS = {
44262
44321
  example: 'publish plan.html --invite "Ana" --invite "Ben"'
44263
44322
  },
44264
44323
  cloud: {
44265
- usage: "cloud login | cloud logout | cloud whoami",
44266
- summary: "your account on the hosted service (WorkOS sign-in: email code, Google, GitHub, passkey). `cloud login` prints a code and opens the browser to approve it, once per machine; you are then the owner of all your hosted pages, from every machine you log in on and in the browser with the same account, and pages this machine published before become the account's. `cloud whoami` prints the account, `cloud logout` forgets it here. Only for hosted pages: the local server needs no account",
44324
+ usage: "cloud on | cloud off | cloud status | cloud login | cloud logout | cloud whoami",
44325
+ summary: "cloud features: publish, clone, cloud login|whoami and the sync of hosted pages. Off by default: only local features work and nothing reaches the hosted service. `cloud on` and `cloud off` flip the switch (Settings \u2192 Cloud does the same), `cloud status` prints it. Your account on the hosted service (WorkOS sign-in: email code, Google, GitHub, passkey): `cloud login` prints a code and opens the browser to approve it, once per machine; you are then the owner of all your hosted pages, from every machine you log in on and in the browser with the same account, and pages this machine published before become the account's. `cloud whoami` prints the account, `cloud logout` forgets it here. Only for hosted pages: the local server needs no account",
44267
44326
  flags: {},
44268
- example: "cloud login"
44327
+ example: "cloud on | cloud login"
44269
44328
  },
44270
44329
  clone: {
44271
44330
  usage: "clone [<id> [<file>]]",
@@ -46385,8 +46444,10 @@ async function cmdPublish(args, flags) {
46385
46444
  }
46386
46445
  }
46387
46446
  async function cmdCloud(sub, rest) {
46388
- if (sub !== "login" && sub !== "logout" && sub !== "whoami") return usage(`cloud needs login, logout or whoami${sub ? `, not ${sub}` : ""}`, "cloud");
46447
+ const subs = ["on", "off", "status", "login", "logout", "whoami"];
46448
+ if (!sub || !subs.includes(sub)) return usage(`cloud needs on, off, status, login, logout or whoami${sub ? `, not ${sub}` : ""}`, "cloud");
46389
46449
  if (rest.length) return usage(`cloud ${sub} takes no arguments; it got ${rest.map((a) => `"${a}"`).join(" ")}`, "cloud");
46450
+ if (sub === "on" || sub === "off" || sub === "status") return cloudSwitch(sub);
46390
46451
  try {
46391
46452
  if (sub === "logout") {
46392
46453
  const was = await logout();
@@ -46422,6 +46483,22 @@ async function cmdCloud(sub, rest) {
46422
46483
  fail2(err.message, { http: err.status, code: err.code });
46423
46484
  }
46424
46485
  }
46486
+ async function cloudSwitch(sub) {
46487
+ await ensureServer();
46488
+ const r = sub === "status" ? await request("GET", "/api/settings/cloud") : await request("POST", "/api/settings/cloud", { on: sub === "on" });
46489
+ if (r.status === 404) return fail2(`the running server is older than this CLI and does not know cloud ${sub}: run \`${BIN5} stop\` (or restart its service), then try again`);
46490
+ if (r.status !== 200) return fail2(r.data?.error || `cloud ${sub} failed (${r.status})`);
46491
+ const c = r.data;
46492
+ print2({
46493
+ status: sub === "status" ? void 0 : "saved",
46494
+ cloud: c.on ? "on" : "off",
46495
+ service: c.on ? c.service : void 0,
46496
+ account: c.account ?? void 0,
46497
+ published: c.published || void 0,
46498
+ note: c.on ? "publish, clone and the sync of hosted pages talk to the service." : `Only local features work; nothing reaches the hosted service.${c.published ? " Published pages stay up there but do not sync, and publish rm needs cloud on." : ""}`,
46499
+ next: c.on ? void 0 : `${BIN5} cloud on`
46500
+ });
46501
+ }
46425
46502
  async function cmdClone(args) {
46426
46503
  const [id, file3, ...more] = args;
46427
46504
  if (more.length) return usage(`clone takes an id and a file; it got ${args.map((a) => `"${a}"`).join(" ")}`, "clone");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "format": 1,
3
3
  "pack": "@austere-axi/pack-shadcn",
4
- "version": "0.15.0",
4
+ "version": "0.16.0",
5
5
  "groups": [
6
6
  {
7
7
  "name": "Data",
@@ -195,7 +195,7 @@
195
195
  }
196
196
  ],
197
197
  "api": 1,
198
- "integrity": "sha384-T+5QU8kf8F6eUM1MLqMyd6X4lEwXmARHKBpnEt1kks5kQWCRf+L1aQj8t2EaTKSX",
198
+ "integrity": "sha384-2XGsgAVHPblex4OPFPTN5DhB+sSMBUtoHgkS0sSgZ0LCs01OQmycYd7EcGI6RNC9",
199
199
  "size": 16495,
200
200
  "css": true,
201
201
  "defs": {
@@ -66,4 +66,4 @@ rollout = TimelineItem("Rollout", "Nov 3", "", "upcoming")`});var he=`.sh-muted
66
66
  .sh-timeline-item.is-upcoming .sh-timeline-dot { background: transparent; border: 1px solid var(--austere-muted); }
67
67
  .sh-timeline-body { min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
68
68
  .sh-timeline-head { display: flex; flex-wrap: wrap; gap: 4px 12px; }
69
- `;var y={components:[ee,M,te,ae,se,oe,H,ie,le,me,ue,K],css:he};var ge=t(l());(0,ge.registerPack)({name:"@austere-axi/pack-shadcn",version:"0.15.0",api:1,components:[].concat(y&&y.components?y.components:y),css:y&&y.css});})();
69
+ `;var y={components:[ee,M,te,ae,se,oe,H,ie,le,me,ue,K],css:he};var ge=t(l());(0,ge.registerPack)({name:"@austere-axi/pack-shadcn",version:"0.16.0",api:1,components:[].concat(y&&y.components?y.components:y),css:y&&y.css});})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "austere-axi",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Agent-authored review artifacts in OpenUI Lang: a few hundred tokens instead of a whole HTML page, with statement-level annotations fed back to the agent.",
5
5
  "mcpName": "io.github.MandalorianBatman/austere-axi",
6
6
  "type": "module",