brane 0.3.3 → 0.3.4
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/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@ page, which is also what triggers its publish (see
|
|
|
6
6
|
[docs/releasing.md](docs/releasing.md)). This file is the summary that
|
|
7
7
|
travels in the npm tarball.
|
|
8
8
|
|
|
9
|
+
## 0.3.4 - 2026-10-14
|
|
10
|
+
|
|
11
|
+
- "All narratives" in the narrative switcher pushes the list in this tab
|
|
12
|
+
again, so Back returns to the narrative; 0.3.3 opened it in a new tab
|
|
13
|
+
on every click. It is still a link, so a ⌘-click opens a new tab, and
|
|
14
|
+
that tab lands on the same daemon
|
|
15
|
+
([#611](https://github.com/benjamn/brane/pull/611)).
|
|
16
|
+
|
|
17
|
+
Published while the repository is private, so like 0.3.0–0.3.3 it
|
|
18
|
+
carries no npm provenance attestation.
|
|
19
|
+
|
|
9
20
|
## 0.3.3 - 2026-10-14
|
|
10
21
|
|
|
11
22
|
- A fresh `npm install brane` audits clean. The math syntax extension
|
package/docs/view-urls.md
CHANGED
|
@@ -56,15 +56,12 @@ pins, Files path and line, the `?scrollToSeq=` selection) goes through
|
|
|
56
56
|
since the stack did not grow. So the URL keeps that state and Back returns to
|
|
57
57
|
it, but it never costs an extra Back: browsing ten files is one entry, not ten.
|
|
58
58
|
A bare link to the narrative you are in, with no seq, goes nowhere. The list
|
|
59
|
-
is a jump too:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
no tab to open, and on iOS a `_blank` link from a home-screen app lands in a
|
|
66
|
-
browser view that shares none of its storage, so it would open on the meld
|
|
67
|
-
screen. So does
|
|
59
|
+
is a jump too: **All narratives** in the switcher pushes it, so Back returns
|
|
60
|
+
to the narrative, whether or not a list was already beneath. It is an anchor
|
|
61
|
+
like the prose links, so a ⌘-click opens the list in a new tab instead, on
|
|
62
|
+
the same daemon (see "A new tab names its daemon" below). (In 0.3.3 every
|
|
63
|
+
click opened a new tab; that was undone.) So does a swipe down on the
|
|
64
|
+
narrative's header card, which dismisses it. So does
|
|
68
65
|
**Archive** in the narrative's 🦠 menu, once the daemon has confirmed it (the
|
|
69
66
|
pushed list fetches on mount, and nothing is broadcast to correct a fetch that
|
|
70
67
|
raced the archive); Back returns to the archived narrative. Archiving from the
|
|
@@ -151,8 +148,8 @@ starts with none: ⌘-click, middle-click, long-press "Open in New Tab" and
|
|
|
151
148
|
this browser's *default* daemon, which on a shared app with several melded
|
|
152
149
|
need not be the one the link came from. So every in-app anchor names it:
|
|
153
150
|
`inAppLinkProps` (the `@nid`, `nid:seq` and file links in prose, the narrate
|
|
154
|
-
rows in tool groups
|
|
155
|
-
|
|
151
|
+
rows in tool groups, **All narratives**) renders its href with
|
|
152
|
+
`#daemon=<home brane_id>` (`DAEMON_PARAM`, `withDaemonFragment`),
|
|
156
153
|
while a plain click still navigates in place by the clean path. It goes in the
|
|
157
154
|
fragment because it says which daemon, not what you are looking at: it is a
|
|
158
155
|
connection param (`CONNECTION_PARAMS`), and like the token it never reaches the
|
|
@@ -23,7 +23,7 @@ __d(function(g,r,i,a,m,e,d){
|
|
|
23
23
|
"use strict";var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(t,o,f){var l=null;if(void 0!==f&&(l=""+f),void 0!==o.key&&(l=""+o.key),"key"in o)for(var y in f={},o)"key"!==y&&(f[y]=o[y]);else f=o;return o=f.ref,{$$typeof:n,type:t,key:l,ref:void 0!==o?o:null,props:f}}e.Fragment=t,e.jsx=o,e.jsxs=o},7,[]);
|
|
24
24
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},8,[9]);
|
|
25
25
|
__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./[nid].tsx":{enumerable:!0,get:()=>r(d[0])},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])},"./index.tsx":{enumerable:!0,get:()=>r(d[2])}});function n(n){return t[n]}n.keys=function(){return Object.keys(t)},n.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=n},9,[10,736,981]);
|
|
26
|
-
__d(function(g,r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return se}});var t=r(_d[0]),n=e(r(_d[1])),o=e(r(_d[2])),a=e(r(_d[3])),s=e(r(_d[4]));r(_d[5]);var l=e(r(_d[6])),i=e(r(_d[7])),c=e(r(_d[8])),u=e(r(_d[9]));r(_d[10]);var d=r(_d[11]),f=r(_d[12]),h=r(_d[13]),b=r(_d[14]),m=e(r(_d[15])),p=e(r(_d[16])),y=e(r(_d[17])),v=r(_d[18]),x=r(_d[19]),w=r(_d[20]),S=r(_d[21]),C=r(_d[22]),T=r(_d[23]),j=r(_d[24]),R=e(r(_d[25])),k=r(_d[26]),P=r(_d[27]),A=r(_d[28]),I=r(_d[29]),E=e(I),_=e(r(_d[30])),L=e(r(_d[31])),M=e(r(_d[32])),N=r(_d[33]),z=r(_d[34]),q=r(_d[35]),$=r(_d[36]),F=r(_d[37]),B=r(_d[38]),H=r(_d[39]),O=r(_d[40]);function D(e,t=!1){const n=new Date(e),o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][n.getDay()],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],s=n.getDate(),l=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"});if(t)return`${o} ${a} ${s}, ${n.getFullYear()} ${l}`;const i=new Date,c=n.getFullYear()===i.getFullYear();return c&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()?`${o} ${l}`:c?`${o} ${a} ${s} ${l}`:`${o} ${a} ${s}, ${n.getFullYear()} ${l}`}function W(e){return"agent_signal"===e}const G=(0,t.memo)(function({uri:e,onPress:n}){const[o,s]=(0,t.useState)(null);(0,t.useEffect)(()=>{a.default.getSize(e,(e,t)=>s({w:e,h:t}),()=>s({w:200,h:150}))},[e]);const i=o?Math.min(200/o.w,150/o.h):1,c=o?Math.round(o.w*i):200,u=o?Math.round(o.h*i):150;return(0,O.jsx)(l.default,{onPress:n,children:(0,O.jsx)(a.default,{source:{uri:e},style:{width:c,height:u,borderRadius:8},resizeMode:"cover"})})}),X=(0,t.memo)(function({item:e,nid:t,agentType:a,foldPath:s,conn:i,selection:c,palette:u=0,onImagePress:d,onForeignPress:f,onFilePress:h,fileHref:m,onTimestampPress:p}){const y=(0,w.useIsSelected)(c,e.seq),v="human_signal"===e.type;const x=W(e.type),C=(0,z.isSystemEvent)(e.type),T=i&&e.payloads?e.payloads.filter(b.isInlinePayload):[],j=i&&e.payloads?e.payloads.filter(e=>!(0,b.isInlinePayload)(e)):[],R=(0,O.jsxs)(O.Fragment,{children:[(e.source||C)&&(0,O.jsxs)(n.default,{style:le.bubbleSourceRow,children:[x&&e.source&&(0,O.jsx)(l.default,{onPress:()=>f?.(e.source,e.time),style:le.bubbleSourcePress,children:(0,O.jsx)(o.default,{style:[le.bubbleSource,le.bubbleSourceLink,{color:(0,S.speakerColor)(e.source,u)}],children:e.source})}),(0,O.jsx)(l.default,{onPress:()=>p?.(e.seq),style:[le.bubbleSourcePress,x&&le.bubbleSourceAfterLink],children:(0,O.jsx)(o.default,{style:[le.bubbleSource,x&&e.source&&{color:(0,S.speakerColor)(e.source,u)},C&&le.bubbleSourceSystem],children:C?`system (${t}:${e.seq})`:v?`you (${t}:${e.seq})`:x?`(${t}:${e.seq})`:`${e.source}:${e.seq}`})}),(0,O.jsx)(L.default,{text:`${t}:${e.seq}`,size:9,padding:3,marginLeft:1,translateY:-1})]}),e.content?(0,O.jsx)(k.MarkdownContent,{content:C?(0,z.systemLine)({type:e.type,content:e.content},{agent:a??(0,z.agentTypeOf)(t),fold:s}):e.content,foreign:x,system:C,onFilePress:h,fileHref:m}):null,T.length>0&&i&&(0,O.jsx)(n.default,{style:le.payloadsContainer,children:T.map(e=>(0,O.jsx)(G,{uri:(0,b.payloadUrl)(i,e),onPress:()=>d?.((0,b.payloadUrl)(i,e))},e))}),j.length>0&&i&&(0,O.jsx)(n.default,{style:le.payloadsContainer,children:j.map(e=>{const t=(0,A.downloadNameFor)(e),n=(0,b.payloadUrl)(i,e);return(0,O.jsx)(l.default,{onPress:()=>{"undefined"!=typeof window&&(0,A.downloadUrl)(n,t).catch(e=>console.error("Payload download failed:",e))},style:le.filePayload,children:(0,O.jsx)(o.default,{style:le.filePayloadText,children:t})},e)})}),(0,O.jsx)(l.default,{onPress:()=>p?.(e.seq),style:le.bubbleTimePress,children:(0,O.jsx)(o.default,{style:le.bubbleTime,children:D(e.time)})})]}),P=[le.bubble,C?le.bubbleSystem:v?le.bubbleOperator:x?[le.bubbleForeign,{backgroundColor:(0,S.speakerBgColor)(e.source||"unknown",u)}]:le.bubbleAgent,y&&le.bubbleSelected];return(0,O.jsx)(n.default,{style:[le.bubbleRow,v?le.bubbleRowRight:x||C?le.bubbleRowCenter:le.bubbleRowLeft],children:(0,O.jsx)(n.default,{dataSet:{bubble:String(e.seq)},style:P,children:R})})}),U=(0,t.memo)(function({conn:e,nid:s,loadEvents:i,chatActive:c,selection:u,onDeselect:d}){const h=(0,w.useSelectedSeqs)(u),[m,p]=(0,t.useState)(!1),[y,v]=(0,t.useState)(!1),[x,S]=(0,t.useState)([]),C=(0,t.useRef)(null),T=(0,t.useRef)(null),j=(0,t.useRef)(!1),R=(0,t.useRef)(!1),k=(0,f.useIsFocused)(),P=c&&k;R.current=P;const A=(0,t.useRef)(""),I=(0,t.useRef)(null),E=`brane:draft:${s}`;(0,t.useEffect)(()=>{try{const e=localStorage.getItem(E);if(e&&(A.current=e,v(e.trim().length>0),T.current)){T.current.value=e}}catch{}return()=>{I.current&&clearTimeout(I.current);try{const e=A.current;e.trim()?localStorage.setItem(E,e):localStorage.removeItem(E)}catch{}}},[E]);const _=(0,t.useCallback)(e=>{A.current=e;const t=0===e.trim().length;v(e=>e===!t?e:!t),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{try{e.trim()?localStorage.setItem(E,e):localStorage.removeItem(E)}catch{}},300)},[E]);(0,t.useEffect)(()=>{const e=T.current;if(!e)return;if(!P)return void(document.activeElement===e&&e.blur());if(!window.matchMedia?.("(pointer: fine)").matches)return;const t=requestAnimationFrame(()=>{try{e.focus({preventScroll:!0})}catch{e.focus()}});return()=>cancelAnimationFrame(t)},[P]),(0,t.useEffect)(()=>{if(!P)return;const e=e=>{if(!R.current)return;const t=e.target,n=t?.tagName;if("INPUT"===n||"TEXTAREA"===n||t?.isContentEditable)return;if(e.metaKey||e.ctrlKey||e.altKey)return;if(e.isComposing)return;if(1!==e.key.length)return;const o=T.current;if(!o)return;e.preventDefault();const a=(o.value||"")+e.key;o.value=a,o.focus({preventScroll:!0});try{o.setSelectionRange(a.length,a.length)}catch{}_(a)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[P,_]),(0,t.useEffect)(()=>{if(!k)return;const e=e=>{const t=e.clipboardData?.items;if(t)for(const e of Array.from(t)){if(!e.type.startsWith("image/"))continue;const t=e.getAsFile();if(!t)continue;const n=new FileReader;n.onload=()=>{const e=n.result,o=e.split(",")[1],a=t.type.split("/")[1]||"png";S(t=>[...t,{id:`${Date.now()}_${Math.random().toString(36).slice(2,6)}`,filename:`paste_${Date.now()}.${a}`,data:o,uri:e}])},n.readAsDataURL(t)}};return document.addEventListener("paste",e),()=>document.removeEventListener("paste",e)},[k]);const L=(0,t.useCallback)(()=>{if(!C.current){const e=document.createElement("input");e.type="file",e.accept="*/*",e.multiple=!0,e.style.display="none",e.addEventListener("change",()=>{const t=e.files;if(t){for(const e of Array.from(t)){const t=new FileReader;t.onload=()=>{const n=t.result,o=n.split(",")[1];S(t=>[...t,{id:String(Date.now())+e.name,filename:e.name,data:o,uri:n}])},t.readAsDataURL(e)}e.value=""}}),document.body.appendChild(e),C.current=e}C.current.click()},[]);(0,t.useEffect)(()=>()=>{C.current&&(C.current.remove(),C.current=null)},[]);const M=(0,t.useCallback)(e=>{S(t=>t.filter(t=>t.id!==e))},[]),N=(0,t.useCallback)(async()=>{const t=A.current.trim();if(!e||!s||!t&&0===x.length)return;const n=x.length>0?x.map(e=>({filename:e.filename,data:e.data})):void 0;p(!0),S([]);try{await(0,b.sendSignal)(e,s,t||"(attachment)","web",n,[...h]),h.length>0&&d(),A.current="",v(!1);try{localStorage.removeItem(E)}catch{}if(T.current){const e=T.current;"function"==typeof e.clear?e.clear():e.value=""}j.current=!0,i()}catch{}finally{p(!1)}},[e,s,E,x,h,d,i]);return(0,t.useEffect)(()=>{if(m)return;if(!j.current)return;if(j.current=!1,!R.current)return;const e=T.current;if(e)try{e.focus({preventScroll:!0})}catch{e.focus()}},[m]),(0,O.jsxs)(O.Fragment,{children:[x.length>0&&(0,O.jsx)(n.default,{style:le.pendingPayloadsRow,dataSet:{composer:"1"},children:x.map(e=>(0,O.jsxs)(n.default,{style:le.pendingPayloadThumb,children:[(0,b.isInlinePayload)(e.filename)?(0,O.jsx)(a.default,{source:{uri:e.uri},style:le.pendingPayloadImage,resizeMode:"cover"}):(0,O.jsx)(n.default,{style:[le.pendingPayloadImage,{justifyContent:"center",alignItems:"center",backgroundColor:"rgba(255,255,255,0.1)"}],children:(0,O.jsx)(o.default,{style:{color:"#aaa",fontSize:10},numberOfLines:2,children:e.filename.split(".").pop()})}),(0,O.jsx)(l.default,{style:le.pendingPayloadRemove,onPress:()=>M(e.id),children:(0,O.jsx)(o.default,{style:le.pendingPayloadRemoveText,children:"\xd7"})})]},e.id))}),(0,O.jsxs)(n.default,{style:le.inputRow,dataSet:{composer:"1"},children:[(0,O.jsx)(l.default,{onPress:L,accessibilityLabel:"Attach file",style:({hovered:e,pressed:t})=>[le.attachButton,(e||t)&&le.circleGlowActive],children:(0,O.jsx)(o.default,{style:le.attachText,children:"\ud83e\uddeb"})}),(0,O.jsx)("textarea",{ref:T,style:{flex:1,backgroundColor:"#111",color:"#e0e0e0",borderRadius:20,paddingLeft:16,paddingRight:16,paddingTop:6,paddingBottom:6,fontSize:16,border:"1px solid #555",resize:"none",overflow:"auto",maxHeight:120,fieldSizing:"content",fontFamily:"system-ui, -apple-system, sans-serif",outline:"none",lineHeight:"22px",boxSizing:"border-box"},onChange:e=>_(e.target.value),placeholder:"Compose message...",disabled:m,autoComplete:"off",autoCorrect:"on",spellCheck:!0,inputMode:"text",rows:1}),(0,O.jsx)(l.default,{style:[le.sendButton,!m&&(y||x.length>0)&&le.circleGlowSend],onPress:N,disabled:m||!y&&0===x.length,children:(0,O.jsx)(o.default,{style:[le.sendText,(m||!y&&0===x.length)&&le.sendTextInactive],children:"\ud83e\udd8b"})})]})]})}),Y=(0,t.memo)(function({nid:e,narrativeSummary:a,narrativeFoldPath:s,narrativeRole:i,narrativeStatus:c,narrativeMcpConnected:u,narrativeAwaiting:d,palette:f,narrativeCreatedAt:h,narrativeLastActivity:b,cost:m,archived:p,selection:S,openSwitcher:C,onDismiss:R,onDownload:k,onTerminate:P,onRevive:A,onTwin:I,onArchiveToggle:E,onRecolor:_,onShowQr:L,onIsolateDaemon:M,isIsolated:N,canIsolate:z}){const[q,$]=(0,t.useState)(!1),F=(0,w.useSelectedSeqs)(S).length,B=!!(i||s||h),H=(0,x.isAwaiting)({mcpConnected:u,awaiting:d})?(0,x.awaitingGlow)((0,T.glowHueFor)(e)):void 0,D=(0,t.useRef)(null),W=(0,t.useRef)(!1),G={onTouchStart:e=>{W.current=!1;const t=e.nativeEvent;D.current=q?null:{x:t.pageX,y:t.pageY}},onTouchEnd:e=>{const t=D.current;if(D.current=null,!t)return;const n=e.nativeEvent,o=n.pageX-t.x,a=n.pageY-t.y;a>60&&a>1.5*Math.abs(o)&&(W.current=!0,R())},onTouchCancel:()=>{D.current=null}};return(0,O.jsxs)(n.default,Object.assign({style:[le.header,le.glowTransition,H?{boxShadow:H}:null]},G,{children:[(0,O.jsxs)(l.default,{style:le.headerTitleContainer,onPress:()=>{W.current?W.current=!1:C()},children:[(0,O.jsx)(j.NarrativeIdentity,{id:e,foldPath:s,align:"center"}),B?(0,O.jsx)(j.NarrativeMetaLine,{role:i,cost:m,createdAt:h??void 0,lastActivity:b,status:c,mcpConnected:u,style:{marginTop:4}}):null,a?(0,O.jsx)("div",{style:{position:"relative",marginRight:8},children:(0,O.jsx)("div",{className:"no-scrollbar",style:{overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",WebkitOverflowScrolling:"touch",maskImage:"linear-gradient(to right, #000 calc(100% - 60px), transparent)",WebkitMaskImage:"linear-gradient(to right, #000 calc(100% - 60px), transparent)"},children:(0,O.jsx)(o.default,{style:le.headerSummary,children:a})})}):null]}),(0,O.jsxs)("div",{style:{position:"relative"},children:[(0,O.jsx)(l.default,{onPress:()=>$(e=>!e),style:le.reloadButton,hitSlop:8,children:(0,O.jsx)(o.default,{style:[le.reloadText,q&&le.reloadTextActive],children:"\ud83e\udda0"})}),q&&(0,O.jsx)(y.default,{items:(0,v.narrativeMenuItems)({role:i,status:c,mcpConnected:u,archived:p,isIsolated:N,canIsolate:z,selectedCount:F,onMeld:()=>{$(!1),L()},onIsolate:()=>{$(!1),M()},onExport:e=>{$(!1),k(e)},onRecolor:()=>{$(!1),_()},onTwin:()=>{$(!1),I()},onRevive:()=>{$(!1),A()},onEnd:()=>{$(!1),P()},onArchiveToggle:()=>{$(!1),E()}}),onClose:()=>$(!1)})]})]}))}),V={headerShown:!1},J=new Map;function K(e){return null!=e.cost_amount&&e.cost_unit?{amount:e.cost_amount,unit:e.cost_unit}:null}const Q=300,Z={flex:1,minHeight:0,display:"flex",flexDirection:"column-reverse",overflowY:"auto",overflowX:"hidden"},ee={marginBottom:"auto"},te=.3;function ne(e,t){const n=e?.querySelector(`[data-seq="${t}"]`);if(!e||!n)return!1;const o=n.getBoundingClientRect().top-e.getBoundingClientRect().top;return e.scrollTop+=o-e.clientHeight*te,!0}const re='button, a[href], [role="button"], [role="link"], [role="menuitem"]';function oe(e){return e?J.get(e)??{}:{}}function ae(e,t){const n=J.get(e)??{};J.set(e,Object.assign({},n,t))}function se(){const e=(0,f.useIsFocused)(),{nid:y,scrollTo:S,scrollToSeq:k,tab:A,pinned:L,path:z,line:D}=(0,d.useLocalSearchParams)(),W=(0,d.useRouter)(),{conn:G,subscribe:J,unsubscribe:te,onHint:se,onMeta:ie,onStatus:ce,onToolUses:ue,narrativeIds:de}=(0,h.useBrane)(),[fe,he]=(0,t.useState)([]),[ge,be]=(0,t.useState)(()=>new Map),me=(0,t.useRef)(0),pe=(0,t.useRef)(Number.MAX_SAFE_INTEGER),[ye,ve]=(0,t.useState)(()=>z??""),[xe,we]=(0,t.useState)(()=>(0,F.parseLineSpec)(D).line),[Se,Ce]=(0,t.useState)(()=>(0,F.parseLineSpec)(D).lineEnd),Te=y?`brane:files:${y}`:null,je=y?`brane:tabs:${y}`:null,Re=(0,t.useRef)(null),[ke,Pe]=(0,t.useState)(()=>(0,F.parseActiveTab)(A)),[Ae,Ie]=(0,t.useState)(()=>(0,F.parsePinnedTabs)(L)),Ee=(0,t.useRef)(y??null);(0,t.useEffect)(()=>{if(!y)return;if(Ee.current===y)return;Ee.current=y;const e=(0,F.parseLineSpec)(D);ve(z??""),we(e.line),Ce(e.lineEnd)},[y]);const Le=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(!Te||!y)return;if(Le.current===y)return;if(Le.current=y,z)return;let e=null;try{e=sessionStorage.getItem(Te)}catch{return}if(!e)return;let t=null;try{t=JSON.parse(e)}catch{}if(!t?.path)return;ve(t.path),we(t.line),Ce(t.lineEnd);const n=t.line?t.lineEnd&&t.lineEnd>t.line?`${t.line}-${t.lineEnd}`:String(t.line):void 0;W.setParams({path:t.path,line:n})},[y]),(0,t.useEffect)(()=>{if(Te)try{if(ye){const e={path:ye};xe&&(e.line=xe),Se&&(e.lineEnd=Se),sessionStorage.setItem(Te,JSON.stringify(e))}else sessionStorage.removeItem(Te)}catch{}},[Te,ye,xe,Se]),(0,t.useEffect)(()=>{if(je&&Re.current===y)try{sessionStorage.setItem(je,JSON.stringify({tab:ke,pinned:(0,F.serializePinned)(Ae)}))}catch{}},[je,y,ke,Ae]);const Me=(0,t.useMemo)(()=>(0,H.visiblePanes)(ke,Ae),[ke,Ae]),Ne=(0,t.useMemo)(()=>{const e=e=>{const t=Me.indexOf(e),n=Me.length;return t<0||1===n?{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:t<0?0:1,backgroundColor:"#111",pointerEvents:t<0?"none":"auto"}:{position:"absolute",top:0,bottom:0,left:t/n*100+"%",width:100/n+"%",zIndex:1,backgroundColor:"#111",borderLeftWidth:t>0?c.default.hairlineWidth:0,borderLeftColor:"#555"}};return{chat:e("chat"),terminal:e("terminal"),files:e("files")}},[Me]),ze=1===Me.length,[qe,$e]=(0,t.useState)(null),[Fe,Be]=(0,t.useState)(!1),[He,Oe]=(0,t.useState)(!1),[De,We]=(0,t.useState)(()=>oe(y).summary??null),[Ge,Xe]=(0,t.useState)(()=>oe(y).agent_type??null),[Ue,Ye]=(0,t.useState)(()=>oe(y).role??null),[Ve,Je]=(0,t.useState)(()=>oe(y).archived??!1),[Ke,Qe]=(0,t.useState)(()=>oe(y).fold_path??null),[Ze,et]=(0,t.useState)(()=>oe(y).status??null),[tt,nt]=(0,t.useState)(()=>oe(y).mcp_connected??!1),[rt,ot]=(0,t.useState)(!1),[at,st]=(0,t.useState)(()=>oe(y).created_at??null),[lt,it]=(0,t.useState)(()=>oe(y).last_activity??null),[ct,ut]=(0,t.useState)(()=>K(oe(y)));(0,t.useEffect)(()=>{const e=oe(y);We(e.summary??null),Xe(e.agent_type??null),Ye(e.role??null),Je(e.archived??!1),Qe(e.fold_path??null),et(e.status??null),nt(e.mcp_connected??!1),ot(!1),st(e.created_at??null),it(e.last_activity??null),ut(K(e))},[y]);const[dt,ft]=(0,t.useState)(!1),[ht,gt]=(0,t.useState)([]),[bt,mt]=(0,t.useState)(!1),[pt,yt]=(0,t.useState)(null),vt=(0,t.useMemo)(()=>(0,q.collectKnownNids)({viewing:y,pushed:[...de].map(e=>({id:e})),listed:pt}),[y,de,pt]),xt=(0,w.useMessageSelection)(y),wt=(0,t.useRef)(0),[St,Ct]=(0,t.useState)(()=>(0,C.readRecolorSalt)(y));(0,t.useEffect)(()=>Ct((0,C.readRecolorSalt)(y)),[y]);const Tt=(0,t.useCallback)(()=>{(0,T.recolorGlowHue)(y),Ct((0,C.bumpRecolorSalt)(y))},[y]),jt=(0,t.useRef)(null),Rt=(0,t.useRef)(null),kt=(0,t.useRef)(!1),Pt=(0,t.useRef)(!0),[At,It]=(0,t.useState)(!0),[Et,_t]=(0,t.useState)(!0),[Lt,Mt]=(0,t.useState)(!0),Nt=(0,t.useRef)(null),zt=(0,t.useRef)(null),qt=(0,t.useRef)(!0);qt.current=Me.includes("chat");const $t=(0,t.useRef)(0),Ft=(0,t.useRef)(S?Number(S):0),Bt=(0,t.useRef)(k?Number(k):0),Ht=(0,t.useRef)(!1),[Ot,Dt]=(0,t.useState)(!1),[Wt,Gt]=(0,t.useState)(!0),Xt=(0,t.useRef)(!1),Ut=(0,t.useRef)(!1),Yt=(0,t.useRef)(null),Vt=(0,t.useRef)(!1),Jt=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(Me.includes("chat")&&!Vt.current){const e=Bt.current,t=Ft.current;if((e||t)&&0===fe.length)return;Vt.current=!0,$t.current=Date.now();let n=-1;if(e&&fe.length>0)n=fe.findIndex(t=>t.seq===e),n>=0&&xt.replace([e]),Bt.current=0;else if(t&&fe.length>0){let e=1/0;for(let o=0;o<fe.length;o++){const a=Math.abs(fe[o].time-t);a<e&&(e=a,n=o)}Ft.current=0}if(n>=0){Ut.current=!0;const e=setTimeout(()=>{Ut.current=!1},2e3);return ne(jt.current,fe[n].seq),()=>clearTimeout(e)}Pt.current=!0,It(!0)}Me.includes("terminal")&&(Jt.current=!0)},[Me,fe.length]);const Kt=(0,t.useCallback)(()=>{jt.current?.scrollTo({top:0})},[]),Qt=(0,t.useCallback)(()=>{const e=jt.current;e?.scrollTo({top:-e.scrollHeight,behavior:"smooth"})},[]),Zt=(0,t.useRef)(!1),en=(0,t.useRef)(!1),tn=(0,t.useCallback)(async()=>{if(G&&y)if(Zt.current)en.current=!0;else{Zt.current=!0;try{do{en.current=!1;const e=await(0,b.fetchEvents)(G,y,wt.current);e.events.length>0&&(he(t=>{const n=t.length>0?t[t.length-1].seq:0,o=e.events.filter(e=>e.seq>n);return o.length>0?[...t,...o]:t}),wt.current=e.events[e.events.length-1].seq)}while(en.current)}finally{Zt.current=!1}}},[G,y]),nn=(0,t.useCallback)(async()=>{if(G&&y&&!Xt.current&&Wt){Xt.current=!0;try{const e=fe.length>0?fe[0].seq:1/0,t=await(0,b.fetchEventsBefore)(G,y,e,50);t.events.length>0&&he(e=>{const n=e.length>0?e[0].seq:1/0,o=t.events.filter(e=>e.seq<n);return o.length>0?[...o,...e]:e}),(t.events.length<50||t.events.length>0&&t.events[0].seq<=t.min_seq)&&Gt(!1)}finally{Xt.current=!1}}},[G,y,fe,Wt]),rn=(0,t.useCallback)(e=>{0!==e.length&&be(t=>{let n=null;for(const o of e){const e=(n??t).get(o.dedup_key);e&&e.rev>=o.rev||(n||(n=new Map(t)),n.set(o.dedup_key,o),o.rev>me.current&&(me.current=o.rev))}return n??t})},[]);(0,t.useEffect)(()=>{if(!G||!y||0===fe.length)return;const e=Math.max(0,fe[0].seq-1),t=pe.current;e>=t||(pe.current=e,(0,b.fetchAllToolUseWindow)(G,y,{afterSeqGte:e,afterSeqLt:t===Number.MAX_SAFE_INTEGER?void 0:t},rn).catch(()=>{pe.current=Number.MAX_SAFE_INTEGER}))},[G,y,fe,rn]),(0,t.useEffect)(()=>{if(G&&y)return ue((e,t,n)=>{e===y&&(t?rn(t):(0,b.fetchAllToolUsesSince)(G,y,me.current,rn).catch(()=>{pe.current=Number.MAX_SAFE_INTEGER}))})},[G,y,ue,rn]),(0,t.useEffect)(()=>{if(!G||!y)return;const e=`${G.host}|${G.token}|${y}`;if(Yt.current===e)return;Yt.current=e,he([]),Gt(!0),wt.current=0,be(new Map),me.current=0,pe.current=Number.MAX_SAFE_INTEGER;const t=Bt.current;Ft.current;(async()=>{try{if(t){const e=Math.floor(25),n=Math.max(0,t-e-1),o=await(0,b.fetchEvents)(G,y,n,50);o.events.length>0?(he(o.events),wt.current=o.events[o.events.length-1].seq,Gt(o.events[0].seq>1)):(wt.current=o.seq,Gt(!1))}else{const e=await(0,b.fetchEventsBefore)(G,y,Number.MAX_SAFE_INTEGER,50);e.events.length>0?(he(e.events),wt.current=e.events[e.events.length-1].seq,(e.events.length<50||e.events[0].seq<=e.min_seq)&&Gt(!1)):(wt.current=0,Gt(!1))}}catch{tn()}})()},[G,y]);const on=(0,t.useCallback)(e=>{if(!y)return;e.summary&&(We(e.summary),ae(y,{summary:e.summary})),e.agent_type&&(Xe(e.agent_type),ae(y,{agent_type:e.agent_type})),e.role&&(Ye(e.role),ae(y,{role:e.role})),Qe(e.fold_path??null),ae(y,{fold_path:e.fold_path??null});const t=!!e.archived;Je(t),ae(y,{archived:t}),e.status&&(et(e.status),ae(y,{status:e.status}));const n=!!e.mcp_connected;nt(n),ae(y,{mcp_connected:n}),ot(!!e.awaiting),st(e.created_at??null),ae(y,{created_at:e.created_at}),it(e.last_activity??null),ae(y,{last_activity:e.last_activity??null}),ut(K({cost_amount:e.cost_amount,cost_unit:e.cost_unit})),ae(y,{cost_amount:e.cost_amount??null,cost_unit:e.cost_unit??null})},[y]);(0,t.useEffect)(()=>{G&&y&&(0,b.fetchNarrative)(G,y).then(on).catch(()=>{})},[G,y,on]),(0,t.useEffect)(()=>{G&&y&&(0,b.fetchNarratives)(G,{archived:!0}).then(e=>{yt(e);const t=e.find(e=>e.id===y);t&&on(t)}).catch(e=>{console.warn("narrative list sweep failed; linkifying from pushed ids only",e)})},[G,y,on]),(0,t.useEffect)(()=>{if(!y)return;J(y,wt.current);const e=se((e,t)=>{if(e===y){tn();const e=Date.now();it(e),ae(y,{last_activity:e})}});return()=>{te(y),e()}},[y,J,te,se,tn]),(0,t.useEffect)(()=>{if(y)return ie((e,t,n,o)=>{e===y&&(n&&(We(n),ae(y,{summary:n})),null!=o&&(ut(o),ae(y,{cost_amount:o.amount,cost_unit:o.unit})))})},[y,ie]),(0,t.useEffect)(()=>{if(y)return ce((e,t)=>{e===y&&("mcp_connected"===t?(nt(!0),ae(y,{mcp_connected:!0})):"mcp_disconnected"===t?(nt(!1),ot(!1),ae(y,{mcp_connected:!1})):t===x.AWAITING_STATUS||t===x.NOT_AWAITING_STATUS?ot(t===x.AWAITING_STATUS):"active"!==t&&"ended"!==t||(et(t),ae(y,{status:t})))})},[y,ce]);const an=(0,t.useCallback)(async e=>{G&&y&&("all"!==e?await(0,v.openNarrativeExport)(G,y,[...xt.getSelected()],"excluded"===e?"except":"only"):await(0,v.openNarrativeExport)(G,y))},[G,y,xt]),sn=(0,t.useCallback)(async()=>{if(Pt.current)Ht.current=!0,Pt.current=!1,It(!1),Qt(),setTimeout(()=>{Ht.current=!1},600);else{const e=setTimeout(()=>Dt(!0),150);try{await tn()}finally{clearTimeout(e),Dt(!1)}Pt.current=!0,It(!0),Kt()}},[tn,Kt,Qt]),ln=(0,t.useCallback)(()=>{Et?Nt.current?.scrollToTop():Nt.current?.scrollToBottom()},[Et]),cn=(0,t.useCallback)(()=>{Lt?zt.current?.scrollToTop():zt.current?.scrollToBottom()},[Lt]),un=(0,t.useCallback)((e,t,n,o,a)=>{W.setParams((0,F.viewParams)(e,t,n,o,a))},[W]),dn=(0,t.useCallback)(e=>{Pe(t=>t===e?t:(un(e,Ae,ye,xe,Se),e))},[un,Ae,ye,xe,Se]),fn=(0,t.useCallback)(e=>{if(ke===e)return;const{pinned:t}=(0,H.selectPane)(ke,Ae,e);Pe(e),Ie(t),un(e,t,ye,xe,Se)},[un,ke,Ae,ye,xe,Se]),hn=(0,t.useCallback)(()=>{const{pinned:e}=(0,H.selectPane)(ke,Ae,"terminal");Pe("terminal"),Ie(e),un("terminal",e,ye,xe,Se),setTimeout(()=>Nt.current?.focus(),60)},[un,ke,Ae,ye,xe,Se]);(0,t.useEffect)(()=>{if(!e)return;if(Me.length<2)return;const t=e=>{const t=e.target;if(t?.closest?.(re))return;const n=t?.closest?.("[data-pane]"),o=n?.getAttribute("data-pane");"chat"!==o&&"terminal"!==o&&"files"!==o||(fn(o),"terminal"===o&&Nt.current?.focus())};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},[e,Me.length,fn]);const gn=(0,t.useCallback)(e=>{Ie(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),un(ke,n,ye,xe,Se),n})},[un,ke,ye,xe,Se]),[bn,mn]=(0,t.useState)(null),pn=(0,t.useCallback)((e,t)=>{(e!==y||t)&&W.push((0,P.narrativeHref)(e,t))},[W,y]),yn=(0,t.useCallback)((e,t)=>{W.push(`/${e}?scrollTo=${t}`)},[W]),vn=(0,t.useCallback)(e=>{const t=xt.toggle(e);W.setParams({scrollToSeq:t?String(e):void 0})},[W,xt]),xn=(0,t.useCallback)(()=>{0!==xt.clear().length&&W.setParams({scrollToSeq:void 0})},[W,xt]);(0,t.useEffect)(()=>{if(!e)return;const t=e=>{const t=e.target;t?.closest&&t.closest('[data-pane="chat"]')&&(t.closest("[data-bubble], [data-chrome]")||t.closest("input, textarea, [data-composer]")||window.getSelection()?.toString()||xn())};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[e,xn]);const wn=(0,t.useCallback)((e,t,n)=>{ve(e),we(t),Ce(n);"files"===ke||Ae.has("files")?un(ke,Ae,e,t,n):(Pe("files"),un("files",Ae,e,t,n))},[un,ke,Ae]),Sn=(0,t.useCallback)(e=>{const{path:t,line:n,lineEnd:o}=(0,I.parseRelLink)(e);wn(t,n,o)},[wn]),Cn=(0,t.useCallback)(e=>{if(!y)return;const{path:t,line:n,lineEnd:o}=(0,I.parseRelLink)(e);return(0,P.fileHref)(y,t,n,o,(0,F.serializePinned)(Ae)||void 0)},[y,Ae]),Tn=(0,t.useRef)(ke);Tn.current=ke;const jn=(0,t.useRef)(Ae);jn.current=Ae,(0,t.useEffect)(()=>{const e=(0,F.parseActiveTab)(A);e!==Tn.current&&Pe(e);const t=(0,F.parsePinnedTabs)(L),n=jn.current;(t.size!==n.size||[...t].some(e=>!n.has(e)))&&Ie(t)},[A,L]),(0,t.useEffect)(()=>{if(!je||!y)return;if(Re.current===y)return;if(Re.current=y,A||L)return;let e=null;try{e=sessionStorage.getItem(je)}catch{return}if(!e)return;let t=null;try{t=JSON.parse(e)}catch{}t&&(Pe((0,F.parseActiveTab)(t.tab)),Ie((0,F.parsePinnedTabs)(t.pinned)))},[y]);const Rn=(0,t.useMemo)(()=>{const e=new Map;if(0===ge.size||0===fe.length)return e;const t=fe[0].seq,n=fe[fe.length-1].seq;for(const o of ge.values()){let a=Math.min(o.after_seq,n);if(0===a){if(1!==t)continue;a=0}else if(a<t)continue;const s=e.get(a);s?s.push(o):e.set(a,[o])}for(const t of e.values())t.sort((e,t)=>e.started_at-t.started_at||e.dedup_key.localeCompare(t.dedup_key));return e},[fe,ge]),kn=(0,t.useCallback)(e=>G&&y?(0,b.fetchToolUse)(G,y,e):Promise.reject(new Error("no connection")),[G,y]),Pn=(0,t.useCallback)(({item:e})=>{const t=1===e.seq?Rn.get(0):void 0,n=Rn.get(e.seq),o=(0,O.jsx)(X,{item:e,nid:y,agentType:Ge,foldPath:Ke,conn:G,selection:xt,palette:St,onImagePress:$e,onForeignPress:yn,onFilePress:Sn,fileHref:Cn,onTimestampPress:vn});return t||n?(0,O.jsxs)(O.Fragment,{children:[t&&(0,O.jsx)(m.default,{rows:t,onNarrativePress:pn,onFetchFull:kn}),o,n&&(0,O.jsx)(m.default,{rows:n,onNarrativePress:pn,onFetchFull:kn})]}):o},[y,Ge,Ke,G,xt,St,yn,pn,Sn,Cn,vn,Rn,kn]),An=(0,t.useMemo)(()=>(0,F.viewParams)(ke,Ae,ye,xe,Se),[ke,Ae,ye,xe,Se]),In="undefined"!=typeof window&&!!G&&(0,F.isIsolated)(window.location.host,G.host),En=(0,B.useAppHost)(G,In),_n=(0,t.useCallback)(()=>{if(!G||!y)return;if("undefined"==typeof window)return;const e=(0,F.buildIsolateUrl)({host:window.location.host,protocol:window.location.protocol,search:window.location.search,path:`/${y}`,conn:G,appHost:En,view:An});e&&window.open(e,"_blank","noopener,noreferrer")},[G,y,An,En]),Ln=(0,t.useCallback)(async()=>{if(!G||!y)return;const e=!Ve;Je(e),ae(y,{archived:e});try{await(0,b.archiveNarrative)(G,y,e)}catch{return Je(!e),void ae(y,{archived:!e})}e&&W.push("/")},[G,y,Ve,W]),Mn=(0,t.useCallback)(()=>W.push("/"),[W]),Nn=(0,t.useCallback)(()=>{G&&(ft(!0),mt(!0),(0,b.fetchNarratives)(G).then(e=>{const t=e.filter(e=>e.mcp_connected||"active"===e.status||e.id===y);gt((0,$.sortNarratives)(t))}).catch(()=>{}).finally(()=>mt(!1)))},[G,y]);return(0,O.jsx)(u.default,{style:le.container,behavior:void 0,keyboardVerticalOffset:90,children:(0,O.jsxs)(N.MarkdownLinksProvider,{knownNarrativeIds:vt,onNarrativePress:pn,onProtocolPress:mn,children:[(0,O.jsx)(d.Stack.Screen,{options:V}),(0,O.jsx)(Y,{nid:y,narrativeSummary:De,narrativeFoldPath:Ke,narrativeRole:Ue,narrativeStatus:Ze,narrativeMcpConnected:tt,narrativeAwaiting:rt,palette:St,narrativeCreatedAt:at,narrativeLastActivity:lt,cost:(0,b.formatCost)(ct?.amount,ct?.unit),archived:Ve,selection:xt,openSwitcher:Nn,onDismiss:Mn,onDownload:an,onTerminate:()=>{hn(),Nt.current?.terminate()},onRevive:()=>{(0,v.revivesAsTwin)(Ue)||hn(),Nt.current?.revive()},onTwin:()=>Oe(!0),onArchiveToggle:Ln,onRecolor:Tt,onShowQr:()=>Be(!0),onIsolateDaemon:_n,isIsolated:In,canIsolate:!In||!!En}),(0,O.jsx)(n.default,{style:le.tabBar,children:F.CANONICAL_TABS.map((e,t)=>{const a=ke===e,s=Ae.has(e),i=a||s,c="chat"===e?"Chat":"terminal"===e?"Terminal":"Files",u="chat"===e?At:"terminal"===e?Et:Lt,d="chat"===e?sn:"terminal"===e?ln:cn;return(0,O.jsxs)(n.default,{style:[le.tab,t>0&&le.tabDivider,a&&le.tabActive],children:[(0,O.jsx)(l.default,{style:le.tabLabel,onPress:()=>dn(e),children:(0,O.jsx)(o.default,{style:[le.tabText,a&&le.tabTextActive],children:c})}),(0,O.jsx)(l.default,{style:le.tabPin,onPress:()=>gn(e),hitSlop:6,children:(0,O.jsx)(o.default,{style:[le.tabPinIcon,s?le.tabPinOn:le.tabPinOff],children:"\ud83d\udccc"})}),(0,O.jsx)(l.default,{style:le.tabArrowPress,onPress:d,disabled:!i,hitSlop:6,children:i?"chat"===e&&Ot?(0,O.jsx)(o.default,{style:le.tabArrowText,children:"\u267b\ufe0f"}):(0,O.jsx)(o.default,{style:le.tabArrowText,children:u?"\u2191":"\u2193"}):(0,O.jsx)(o.default,{style:le.tabArrowText})})]},e)})}),(0,O.jsxs)(n.default,Object.assign({style:{flex:1,overflow:"hidden",position:"relative"}},ze?{onTouchStart:e=>{const t=e.nativeEvent;Rt.current={x:t.pageX,y:t.pageY}},onTouchMove:e=>{if(!Rt.current)return;const t=e.nativeEvent,n=Math.abs(t.pageX-Rt.current.x),o=Math.abs(t.pageY-Rt.current.y);n>15&&n>1.5*o&&!kt.current&&(kt.current=!0)},onTouchEnd:e=>{if(!Rt.current)return;const t=e.nativeEvent,n=t.pageX-Rt.current.x,o=t.pageY-Rt.current.y;Rt.current=null,kt.current=!1;if(!("undefined"!=typeof window&&!!window.getSelection()?.toString())&&Math.abs(n)>60&&Math.abs(n)>1.5*Math.abs(o)){const e=Me[0],t=F.CANONICAL_TABS.indexOf(e),o=n<0?t+1:t-1;o>=0&&o<F.CANONICAL_TABS.length&&dn(F.CANONICAL_TABS[o])}}}:{},{children:[(0,O.jsxs)(n.default,{style:Ne.chat,dataSet:{pane:"chat"},children:[(0,O.jsx)("div",{ref:jt,style:Z,onScroll:e=>{const t=e.currentTarget,n=t.scrollTop>-50;n===Pt.current||Ht.current||(Pt.current=n,It(n));const o=t.scrollHeight-t.clientHeight+t.scrollTop,a=Date.now()-$t.current;o<200&&Wt&&!Xt.current&&!Ut.current&&qt.current&&$t.current>0&&a>Q&&nn()},children:(0,O.jsx)(n.default,{style:[le.list,ee],children:fe.map(e=>(0,O.jsx)("div",{"data-seq":e.seq,children:Pn({item:e})},e.seq))})}),(0,O.jsx)(U,{conn:G,nid:y,loadEvents:tn,chatActive:"chat"===ke,selection:xt,onDeselect:xn})]}),G&&y&&(0,O.jsx)(n.default,{style:Ne.terminal,dataSet:{pane:"terminal"},children:(0,O.jsx)(p.default,{ref:Nt,conn:G,nid:y,active:Me.includes("terminal"),keyboardActive:"terminal"===ke&&!dt&&!He&&null===qe,agentType:Ge,role:Ue,onAtBottomChange:_t,onTwin:()=>Oe(!0),onRevived:e=>W.push((0,F.terminalOnlyHref)(e))})}),G&&y&&(0,O.jsx)(n.default,{style:Ne.files,dataSet:{pane:"files"},children:(0,O.jsx)(E.default,{ref:zt,conn:G,nid:y,path:ye,line:xe,lineEnd:Se,active:Me.includes("files"),onPathChange:wn,onImagePress:$e,onAtBottomChange:Mt})})]})),(0,O.jsx)(i.default,{visible:dt,transparent:!0,animationType:"fade",onRequestClose:()=>ft(!1),children:(0,O.jsx)(l.default,{style:le.switcherOverlay,onPress:()=>ft(!1),children:(0,O.jsxs)(n.default,{style:le.switcherContent,children:[(0,O.jsxs)(n.default,{style:le.switcherTitleRow,children:[(0,O.jsx)(o.default,{style:le.switcherTitle,children:"Switch narrative"}),(0,O.jsx)(o.default,Object.assign({style:le.switcherListLink},(0,P.newTabLinkProps)("/",()=>ft(!1),()=>{ft(!1),W.push("/")}),{children:"All narratives"}))]}),(0,O.jsx)(s.default,{data:ht,keyExtractor:e=>e.id,style:le.switcherList,ListEmptyComponent:(0,O.jsx)(o.default,{style:le.switcherEmpty,children:bt?"Loading\u2026":"No active narratives"}),renderItem:({item:e})=>{const t="ended"===e.status&&!e.mcp_connected,n=(0,x.isAwaiting)({mcpConnected:e.mcp_connected,awaiting:e.awaiting})?(0,x.awaitingGlow)((0,T.glowHueFor)(e.id)):void 0;return(0,O.jsxs)(l.default,{style:[le.switcherItem,e.id===y&&le.switcherItemActive,t&&le.switcherItemEnded,n?{boxShadow:n}:null],onPress:()=>{ft(!1),e.id!==y&&W.push(`/${e.id}`)},children:[(0,O.jsx)(j.NarrativeIdentity,{id:e.id,foldPath:e.fold_path,titleStyle:t?{color:"#666"}:void 0,copyMarginLeft:5,dimmed:t}),(0,O.jsx)(j.NarrativeMetaLine,{role:e.role,cost:(0,b.formatCost)(e.cost_amount,e.cost_unit),createdAt:e.created_at,lastActivity:e.last_activity,status:e.status,mcpConnected:e.mcp_connected,dimmed:t,style:{marginTop:4}}),e.summary&&(0,O.jsx)("div",{style:{position:"relative"},children:(0,O.jsx)("div",{className:"no-scrollbar",style:{overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",WebkitOverflowScrolling:"touch",maskImage:"linear-gradient(to right, #000 calc(100% - 40px), transparent)",WebkitMaskImage:"linear-gradient(to right, #000 calc(100% - 40px), transparent)"},children:(0,O.jsx)(o.default,{style:[le.switcherItemSummary,t&&{color:"#555"}],children:e.summary})})})]})}}),(0,O.jsx)(l.default,{style:le.switcherCancel,onPress:()=>ft(!1),children:(0,O.jsx)(o.default,{style:le.switcherCancelText,children:"Cancel"})})]})})}),(0,O.jsx)(R.default,{visible:Fe,conn:G,path:`/${y}`,view:An,onClose:()=>Be(!1)}),(0,O.jsx)(_.default,{visible:He,conn:G,re:y,defaultFoldPath:Ke,onClose:()=>Oe(!1),onSpawned:e=>{Oe(!1),W.push(`/${e.id}`)}}),(0,O.jsx)(i.default,{visible:null!==qe,transparent:!0,animationType:"fade",onRequestClose:()=>$e(null),children:(0,O.jsxs)(l.default,{style:le.lightboxBackdrop,onPress:()=>$e(null),children:[qe&&(0,O.jsx)(a.default,{source:{uri:qe},style:le.lightboxImage,resizeMode:"contain"}),(0,O.jsx)(o.default,{style:le.lightboxHint,children:"Tap anywhere to close"})]})}),bn&&G&&(0,O.jsx)(N.MarkdownLinksProvider,{onNarrativePress:(e,t)=>{mn(null),pn(e,t)},children:(0,O.jsx)(M.default,{conn:G,target:{source:"protocols",slug:bn},onClose:()=>mn(null)})})]})})}const le=c.default.create({container:{flex:1},glowTransition:{transitionProperty:"box-shadow",transitionDuration:"400ms"},header:{flexDirection:"row",alignItems:"center",backgroundColor:"#1a1a1e",paddingHorizontal:4,paddingVertical:6,borderBottomWidth:c.default.hairlineWidth,borderBottomColor:"rgb(216, 216, 216)",position:"relative",zIndex:10},tabBar:{flexDirection:"row",borderBottomWidth:c.default.hairlineWidth,borderBottomColor:"#555",backgroundColor:"#111"},tab:{width:100/F.CANONICAL_TABS.length+"%",position:"relative"},tabDivider:{borderLeftWidth:c.default.hairlineWidth,borderLeftColor:"#555"},tabActive:{borderBottomWidth:2,borderBottomColor:"#4caf50"},tabLabel:{flex:1,paddingVertical:10,paddingHorizontal:36,alignItems:"center",justifyContent:"center"},tabPin:{position:"absolute",left:0,top:0,bottom:0,width:36,alignItems:"center",justifyContent:"center"},tabPinIcon:{fontSize:12},tabPinOn:{opacity:1},tabPinOff:{opacity:.25},tabArrowPress:{position:"absolute",right:0,top:0,bottom:0,width:36,alignItems:"center",justifyContent:"center"},tabText:{color:"#666",fontSize:14,fontWeight:"600"},tabTextActive:{color:"#4caf50"},tabArrowText:{color:"#8fd4b4",fontSize:16,fontWeight:"400"},headerTitleContainer:{flexDirection:"column",alignItems:"stretch",justifyContent:"center",flex:1,minWidth:0,paddingHorizontal:8},headerSubtitle:{color:"#888",fontSize:12,fontFamily:"monospace",marginTop:1},headerSummary:{color:"#9a9aa0",fontSize:12,lineHeight:12,whiteSpace:"nowrap"},list:{paddingHorizontal:12,paddingVertical:8},bubbleRow:{marginBottom:6,flexDirection:"row"},bubbleRowLeft:{justifyContent:"flex-start"},bubbleRowRight:{justifyContent:"flex-end"},bubbleRowCenter:{justifyContent:"center"},bubble:{maxWidth:"85%",borderRadius:16,paddingHorizontal:14,paddingVertical:10,borderWidth:1.5,borderColor:"transparent",borderStyle:"solid"},bubbleAgent:{backgroundColor:"#1c1c1e",borderBottomLeftRadius:4},bubbleOperator:{backgroundColor:"#1a4a7a",borderBottomRightRadius:4},bubbleForeign:{borderRadius:12},bubbleSystem:{backgroundColor:"transparent",borderWidth:1,borderStyle:"dashed",borderColor:"#3a3a3c",borderRadius:12},bubbleSelected:{borderColor:"#5b9bd5"},bubbleSourceRow:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",marginBottom:3},bubbleSourcePress:{alignSelf:"flex-start"},bubbleSource:{color:"#4caf50",fontSize:11,fontFamily:"monospace"},bubbleSourceLink:{textDecorationLine:"underline"},bubbleSourceAfterLink:{marginLeft:4},bubbleSourceSystem:{color:"#8a8a8e"},bubbleTimePress:{alignSelf:"flex-end",marginTop:4},bubbleTime:{color:"#666",fontSize:11,textAlign:"right"},inputRow:{flexDirection:"row",padding:8,paddingBottom:8,borderTopWidth:1,borderTopColor:"rgb(216, 216, 216)",backgroundColor:"#1a1a1a",alignItems:"flex-end"},input:{flex:1,backgroundColor:"#111",color:"#e0e0e0",borderRadius:20,paddingHorizontal:16,paddingVertical:8,fontSize:15,borderWidth:1,borderColor:"#555",maxHeight:120,minHeight:36},sendButton:Object.assign({marginLeft:8,width:36,height:36,borderRadius:18,backgroundColor:"#1c1c1e",borderWidth:1,borderColor:"#555",justifyContent:"center",alignItems:"center"},{transition:"box-shadow 160ms ease, border-color 160ms ease"}),sendText:{fontSize:20,lineHeight:20,transform:[{translateX:-1},{translateY:1},{rotate:"45deg"}]},sendTextInactive:{opacity:.35},attachButton:Object.assign({width:36,height:36,borderRadius:18,backgroundColor:"#1c1c1e",justifyContent:"center",alignItems:"center",marginRight:8,borderWidth:1,borderColor:"#555"},{transition:"box-shadow 160ms ease, border-color 160ms ease"}),attachText:{fontSize:20,lineHeight:20,marginTop:-3},circleGlowActive:Object.assign({borderColor:"rgba(255, 130, 180, 0.6)"},{boxShadow:["0 0 10px rgba(255, 130, 180, 0.9)","0 0 25px rgba(255, 110, 165, 0.7)","0 0 50px rgba(255, 100, 155, 0.4)"].join(", ")}),circleGlowSend:Object.assign({borderColor:"rgba(90, 230, 200, 0.6)"},{boxShadow:["0 0 10px rgba(90, 230, 200, 0.9)","0 0 25px rgba(70, 215, 190, 0.7)","0 0 50px rgba(60, 200, 180, 0.4)"].join(", ")}),payloadsContainer:{marginTop:6,gap:4},filePayload:{backgroundColor:"rgba(255,255,255,0.1)",borderRadius:6,paddingHorizontal:10,paddingVertical:6},filePayloadText:{color:"#6cf",fontSize:13},pendingPayloadsRow:{flexDirection:"row",paddingHorizontal:12,paddingTop:8,gap:8,backgroundColor:"#111"},pendingPayloadThumb:{position:"relative",width:60,height:60},pendingPayloadImage:{width:60,height:60,borderRadius:8,borderWidth:1,borderColor:"#555"},pendingPayloadRemove:{position:"absolute",top:-6,right:-6,width:20,height:20,borderRadius:10,backgroundColor:"#c00",justifyContent:"center",alignItems:"center"},pendingPayloadRemoveText:{color:"#fff",fontSize:14,fontWeight:"700",lineHeight:16},switcherOverlay:{flex:1,backgroundColor:"rgba(0,0,0,0.6)",justifyContent:"center",alignItems:"center",padding:24},switcherContent:{backgroundColor:"#1e1e1e",borderRadius:12,paddingTop:20,paddingHorizontal:20,paddingBottom:8,width:"100%",maxWidth:400,maxHeight:"70%"},switcherTitleRow:{flexDirection:"row",alignItems:"baseline",justifyContent:"space-between",marginBottom:16},switcherTitle:{color:"#e0e0e0",fontSize:18,fontWeight:"600"},switcherListLink:{color:"#8fd4b4",fontSize:14,padding:8,margin:-8},switcherList:{flexGrow:0,padding:4,margin:-4},switcherItem:{paddingVertical:12,paddingHorizontal:12,borderRadius:8,backgroundColor:"#2a2a2a",marginBottom:8},switcherItemActive:{outlineWidth:2,outlineStyle:"solid",outlineColor:"#4caf50",outlineOffset:2},switcherItemEnded:{opacity:.5},switcherItemSummary:{color:"#9a9aa0",fontSize:12,lineHeight:12,whiteSpace:"nowrap"},switcherEmpty:{color:"#888",fontSize:14,textAlign:"center",paddingVertical:20},switcherCancel:{paddingVertical:12,alignItems:"center",marginTop:4},switcherCancelText:{color:"#888",fontSize:15},lightboxBackdrop:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.95)",justifyContent:"center",alignItems:"center",padding:8},lightboxImage:{width:"100%",height:"92%"},lightboxHint:{color:"#888",fontSize:14,marginTop:20},reloadButton:{paddingHorizontal:8,paddingVertical:4,marginRight:4},reloadText:Object.assign({fontSize:20},{transition:"text-shadow 160ms ease"}),reloadTextActive:Object.assign({},{textShadow:["0 0 10px rgba(140, 230, 170, 0.9)","0 0 25px rgba(120, 215, 155, 0.7)","0 0 50px rgba(100, 200, 145, 0.4)","0 2px 15px rgba(130, 220, 165, 0.6)"].join(", ")})})},10,[11,13,105,106,113,145,146,153,26,160,116,161,165,736,745,759,762,773,769,755,774,771,770,776,778,780,786,761,958,959,972,779,973,950,752,976,977,747,978,980,6]);
|
|
26
|
+
__d(function(g,r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return se}});var t=r(_d[0]),n=e(r(_d[1])),o=e(r(_d[2])),a=e(r(_d[3])),s=e(r(_d[4]));r(_d[5]);var l=e(r(_d[6])),i=e(r(_d[7])),c=e(r(_d[8])),u=e(r(_d[9]));r(_d[10]);var d=r(_d[11]),f=r(_d[12]),h=r(_d[13]),b=r(_d[14]),m=e(r(_d[15])),p=e(r(_d[16])),y=e(r(_d[17])),v=r(_d[18]),x=r(_d[19]),w=r(_d[20]),S=r(_d[21]),C=r(_d[22]),T=r(_d[23]),j=r(_d[24]),R=e(r(_d[25])),k=r(_d[26]),A=r(_d[27]),P=r(_d[28]),I=r(_d[29]),E=e(I),_=e(r(_d[30])),L=e(r(_d[31])),M=e(r(_d[32])),N=r(_d[33]),z=r(_d[34]),q=r(_d[35]),$=r(_d[36]),F=r(_d[37]),B=r(_d[38]),H=r(_d[39]),O=r(_d[40]);function D(e,t=!1){const n=new Date(e),o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][n.getDay()],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],s=n.getDate(),l=n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"});if(t)return`${o} ${a} ${s}, ${n.getFullYear()} ${l}`;const i=new Date,c=n.getFullYear()===i.getFullYear();return c&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()?`${o} ${l}`:c?`${o} ${a} ${s} ${l}`:`${o} ${a} ${s}, ${n.getFullYear()} ${l}`}function W(e){return"agent_signal"===e}const G=(0,t.memo)(function({uri:e,onPress:n}){const[o,s]=(0,t.useState)(null);(0,t.useEffect)(()=>{a.default.getSize(e,(e,t)=>s({w:e,h:t}),()=>s({w:200,h:150}))},[e]);const i=o?Math.min(200/o.w,150/o.h):1,c=o?Math.round(o.w*i):200,u=o?Math.round(o.h*i):150;return(0,O.jsx)(l.default,{onPress:n,children:(0,O.jsx)(a.default,{source:{uri:e},style:{width:c,height:u,borderRadius:8},resizeMode:"cover"})})}),X=(0,t.memo)(function({item:e,nid:t,agentType:a,foldPath:s,conn:i,selection:c,palette:u=0,onImagePress:d,onForeignPress:f,onFilePress:h,fileHref:m,onTimestampPress:p}){const y=(0,w.useIsSelected)(c,e.seq),v="human_signal"===e.type;const x=W(e.type),C=(0,z.isSystemEvent)(e.type),T=i&&e.payloads?e.payloads.filter(b.isInlinePayload):[],j=i&&e.payloads?e.payloads.filter(e=>!(0,b.isInlinePayload)(e)):[],R=(0,O.jsxs)(O.Fragment,{children:[(e.source||C)&&(0,O.jsxs)(n.default,{style:le.bubbleSourceRow,children:[x&&e.source&&(0,O.jsx)(l.default,{onPress:()=>f?.(e.source,e.time),style:le.bubbleSourcePress,children:(0,O.jsx)(o.default,{style:[le.bubbleSource,le.bubbleSourceLink,{color:(0,S.speakerColor)(e.source,u)}],children:e.source})}),(0,O.jsx)(l.default,{onPress:()=>p?.(e.seq),style:[le.bubbleSourcePress,x&&le.bubbleSourceAfterLink],children:(0,O.jsx)(o.default,{style:[le.bubbleSource,x&&e.source&&{color:(0,S.speakerColor)(e.source,u)},C&&le.bubbleSourceSystem],children:C?`system (${t}:${e.seq})`:v?`you (${t}:${e.seq})`:x?`(${t}:${e.seq})`:`${e.source}:${e.seq}`})}),(0,O.jsx)(L.default,{text:`${t}:${e.seq}`,size:9,padding:3,marginLeft:1,translateY:-1})]}),e.content?(0,O.jsx)(k.MarkdownContent,{content:C?(0,z.systemLine)({type:e.type,content:e.content},{agent:a??(0,z.agentTypeOf)(t),fold:s}):e.content,foreign:x,system:C,onFilePress:h,fileHref:m}):null,T.length>0&&i&&(0,O.jsx)(n.default,{style:le.payloadsContainer,children:T.map(e=>(0,O.jsx)(G,{uri:(0,b.payloadUrl)(i,e),onPress:()=>d?.((0,b.payloadUrl)(i,e))},e))}),j.length>0&&i&&(0,O.jsx)(n.default,{style:le.payloadsContainer,children:j.map(e=>{const t=(0,P.downloadNameFor)(e),n=(0,b.payloadUrl)(i,e);return(0,O.jsx)(l.default,{onPress:()=>{"undefined"!=typeof window&&(0,P.downloadUrl)(n,t).catch(e=>console.error("Payload download failed:",e))},style:le.filePayload,children:(0,O.jsx)(o.default,{style:le.filePayloadText,children:t})},e)})}),(0,O.jsx)(l.default,{onPress:()=>p?.(e.seq),style:le.bubbleTimePress,children:(0,O.jsx)(o.default,{style:le.bubbleTime,children:D(e.time)})})]}),A=[le.bubble,C?le.bubbleSystem:v?le.bubbleOperator:x?[le.bubbleForeign,{backgroundColor:(0,S.speakerBgColor)(e.source||"unknown",u)}]:le.bubbleAgent,y&&le.bubbleSelected];return(0,O.jsx)(n.default,{style:[le.bubbleRow,v?le.bubbleRowRight:x||C?le.bubbleRowCenter:le.bubbleRowLeft],children:(0,O.jsx)(n.default,{dataSet:{bubble:String(e.seq)},style:A,children:R})})}),U=(0,t.memo)(function({conn:e,nid:s,loadEvents:i,chatActive:c,selection:u,onDeselect:d}){const h=(0,w.useSelectedSeqs)(u),[m,p]=(0,t.useState)(!1),[y,v]=(0,t.useState)(!1),[x,S]=(0,t.useState)([]),C=(0,t.useRef)(null),T=(0,t.useRef)(null),j=(0,t.useRef)(!1),R=(0,t.useRef)(!1),k=(0,f.useIsFocused)(),A=c&&k;R.current=A;const P=(0,t.useRef)(""),I=(0,t.useRef)(null),E=`brane:draft:${s}`;(0,t.useEffect)(()=>{try{const e=localStorage.getItem(E);if(e&&(P.current=e,v(e.trim().length>0),T.current)){T.current.value=e}}catch{}return()=>{I.current&&clearTimeout(I.current);try{const e=P.current;e.trim()?localStorage.setItem(E,e):localStorage.removeItem(E)}catch{}}},[E]);const _=(0,t.useCallback)(e=>{P.current=e;const t=0===e.trim().length;v(e=>e===!t?e:!t),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{try{e.trim()?localStorage.setItem(E,e):localStorage.removeItem(E)}catch{}},300)},[E]);(0,t.useEffect)(()=>{const e=T.current;if(!e)return;if(!A)return void(document.activeElement===e&&e.blur());if(!window.matchMedia?.("(pointer: fine)").matches)return;const t=requestAnimationFrame(()=>{try{e.focus({preventScroll:!0})}catch{e.focus()}});return()=>cancelAnimationFrame(t)},[A]),(0,t.useEffect)(()=>{if(!A)return;const e=e=>{if(!R.current)return;const t=e.target,n=t?.tagName;if("INPUT"===n||"TEXTAREA"===n||t?.isContentEditable)return;if(e.metaKey||e.ctrlKey||e.altKey)return;if(e.isComposing)return;if(1!==e.key.length)return;const o=T.current;if(!o)return;e.preventDefault();const a=(o.value||"")+e.key;o.value=a,o.focus({preventScroll:!0});try{o.setSelectionRange(a.length,a.length)}catch{}_(a)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[A,_]),(0,t.useEffect)(()=>{if(!k)return;const e=e=>{const t=e.clipboardData?.items;if(t)for(const e of Array.from(t)){if(!e.type.startsWith("image/"))continue;const t=e.getAsFile();if(!t)continue;const n=new FileReader;n.onload=()=>{const e=n.result,o=e.split(",")[1],a=t.type.split("/")[1]||"png";S(t=>[...t,{id:`${Date.now()}_${Math.random().toString(36).slice(2,6)}`,filename:`paste_${Date.now()}.${a}`,data:o,uri:e}])},n.readAsDataURL(t)}};return document.addEventListener("paste",e),()=>document.removeEventListener("paste",e)},[k]);const L=(0,t.useCallback)(()=>{if(!C.current){const e=document.createElement("input");e.type="file",e.accept="*/*",e.multiple=!0,e.style.display="none",e.addEventListener("change",()=>{const t=e.files;if(t){for(const e of Array.from(t)){const t=new FileReader;t.onload=()=>{const n=t.result,o=n.split(",")[1];S(t=>[...t,{id:String(Date.now())+e.name,filename:e.name,data:o,uri:n}])},t.readAsDataURL(e)}e.value=""}}),document.body.appendChild(e),C.current=e}C.current.click()},[]);(0,t.useEffect)(()=>()=>{C.current&&(C.current.remove(),C.current=null)},[]);const M=(0,t.useCallback)(e=>{S(t=>t.filter(t=>t.id!==e))},[]),N=(0,t.useCallback)(async()=>{const t=P.current.trim();if(!e||!s||!t&&0===x.length)return;const n=x.length>0?x.map(e=>({filename:e.filename,data:e.data})):void 0;p(!0),S([]);try{await(0,b.sendSignal)(e,s,t||"(attachment)","web",n,[...h]),h.length>0&&d(),P.current="",v(!1);try{localStorage.removeItem(E)}catch{}if(T.current){const e=T.current;"function"==typeof e.clear?e.clear():e.value=""}j.current=!0,i()}catch{}finally{p(!1)}},[e,s,E,x,h,d,i]);return(0,t.useEffect)(()=>{if(m)return;if(!j.current)return;if(j.current=!1,!R.current)return;const e=T.current;if(e)try{e.focus({preventScroll:!0})}catch{e.focus()}},[m]),(0,O.jsxs)(O.Fragment,{children:[x.length>0&&(0,O.jsx)(n.default,{style:le.pendingPayloadsRow,dataSet:{composer:"1"},children:x.map(e=>(0,O.jsxs)(n.default,{style:le.pendingPayloadThumb,children:[(0,b.isInlinePayload)(e.filename)?(0,O.jsx)(a.default,{source:{uri:e.uri},style:le.pendingPayloadImage,resizeMode:"cover"}):(0,O.jsx)(n.default,{style:[le.pendingPayloadImage,{justifyContent:"center",alignItems:"center",backgroundColor:"rgba(255,255,255,0.1)"}],children:(0,O.jsx)(o.default,{style:{color:"#aaa",fontSize:10},numberOfLines:2,children:e.filename.split(".").pop()})}),(0,O.jsx)(l.default,{style:le.pendingPayloadRemove,onPress:()=>M(e.id),children:(0,O.jsx)(o.default,{style:le.pendingPayloadRemoveText,children:"\xd7"})})]},e.id))}),(0,O.jsxs)(n.default,{style:le.inputRow,dataSet:{composer:"1"},children:[(0,O.jsx)(l.default,{onPress:L,accessibilityLabel:"Attach file",style:({hovered:e,pressed:t})=>[le.attachButton,(e||t)&&le.circleGlowActive],children:(0,O.jsx)(o.default,{style:le.attachText,children:"\ud83e\uddeb"})}),(0,O.jsx)("textarea",{ref:T,style:{flex:1,backgroundColor:"#111",color:"#e0e0e0",borderRadius:20,paddingLeft:16,paddingRight:16,paddingTop:6,paddingBottom:6,fontSize:16,border:"1px solid #555",resize:"none",overflow:"auto",maxHeight:120,fieldSizing:"content",fontFamily:"system-ui, -apple-system, sans-serif",outline:"none",lineHeight:"22px",boxSizing:"border-box"},onChange:e=>_(e.target.value),placeholder:"Compose message...",disabled:m,autoComplete:"off",autoCorrect:"on",spellCheck:!0,inputMode:"text",rows:1}),(0,O.jsx)(l.default,{style:[le.sendButton,!m&&(y||x.length>0)&&le.circleGlowSend],onPress:N,disabled:m||!y&&0===x.length,children:(0,O.jsx)(o.default,{style:[le.sendText,(m||!y&&0===x.length)&&le.sendTextInactive],children:"\ud83e\udd8b"})})]})]})}),Y=(0,t.memo)(function({nid:e,narrativeSummary:a,narrativeFoldPath:s,narrativeRole:i,narrativeStatus:c,narrativeMcpConnected:u,narrativeAwaiting:d,palette:f,narrativeCreatedAt:h,narrativeLastActivity:b,cost:m,archived:p,selection:S,openSwitcher:C,onDismiss:R,onDownload:k,onTerminate:A,onRevive:P,onTwin:I,onArchiveToggle:E,onRecolor:_,onShowQr:L,onIsolateDaemon:M,isIsolated:N,canIsolate:z}){const[q,$]=(0,t.useState)(!1),F=(0,w.useSelectedSeqs)(S).length,B=!!(i||s||h),H=(0,x.isAwaiting)({mcpConnected:u,awaiting:d})?(0,x.awaitingGlow)((0,T.glowHueFor)(e)):void 0,D=(0,t.useRef)(null),W=(0,t.useRef)(!1),G={onTouchStart:e=>{W.current=!1;const t=e.nativeEvent;D.current=q?null:{x:t.pageX,y:t.pageY}},onTouchEnd:e=>{const t=D.current;if(D.current=null,!t)return;const n=e.nativeEvent,o=n.pageX-t.x,a=n.pageY-t.y;a>60&&a>1.5*Math.abs(o)&&(W.current=!0,R())},onTouchCancel:()=>{D.current=null}};return(0,O.jsxs)(n.default,Object.assign({style:[le.header,le.glowTransition,H?{boxShadow:H}:null]},G,{children:[(0,O.jsxs)(l.default,{style:le.headerTitleContainer,onPress:()=>{W.current?W.current=!1:C()},children:[(0,O.jsx)(j.NarrativeIdentity,{id:e,foldPath:s,align:"center"}),B?(0,O.jsx)(j.NarrativeMetaLine,{role:i,cost:m,createdAt:h??void 0,lastActivity:b,status:c,mcpConnected:u,style:{marginTop:4}}):null,a?(0,O.jsx)("div",{style:{position:"relative",marginRight:8},children:(0,O.jsx)("div",{className:"no-scrollbar",style:{overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",WebkitOverflowScrolling:"touch",maskImage:"linear-gradient(to right, #000 calc(100% - 60px), transparent)",WebkitMaskImage:"linear-gradient(to right, #000 calc(100% - 60px), transparent)"},children:(0,O.jsx)(o.default,{style:le.headerSummary,children:a})})}):null]}),(0,O.jsxs)("div",{style:{position:"relative"},children:[(0,O.jsx)(l.default,{onPress:()=>$(e=>!e),style:le.reloadButton,hitSlop:8,children:(0,O.jsx)(o.default,{style:[le.reloadText,q&&le.reloadTextActive],children:"\ud83e\udda0"})}),q&&(0,O.jsx)(y.default,{items:(0,v.narrativeMenuItems)({role:i,status:c,mcpConnected:u,archived:p,isIsolated:N,canIsolate:z,selectedCount:F,onMeld:()=>{$(!1),L()},onIsolate:()=>{$(!1),M()},onExport:e=>{$(!1),k(e)},onRecolor:()=>{$(!1),_()},onTwin:()=>{$(!1),I()},onRevive:()=>{$(!1),P()},onEnd:()=>{$(!1),A()},onArchiveToggle:()=>{$(!1),E()}}),onClose:()=>$(!1)})]})]}))}),V={headerShown:!1},J=new Map;function K(e){return null!=e.cost_amount&&e.cost_unit?{amount:e.cost_amount,unit:e.cost_unit}:null}const Q=300,Z={flex:1,minHeight:0,display:"flex",flexDirection:"column-reverse",overflowY:"auto",overflowX:"hidden"},ee={marginBottom:"auto"},te=.3;function ne(e,t){const n=e?.querySelector(`[data-seq="${t}"]`);if(!e||!n)return!1;const o=n.getBoundingClientRect().top-e.getBoundingClientRect().top;return e.scrollTop+=o-e.clientHeight*te,!0}const re='button, a[href], [role="button"], [role="link"], [role="menuitem"]';function oe(e){return e?J.get(e)??{}:{}}function ae(e,t){const n=J.get(e)??{};J.set(e,Object.assign({},n,t))}function se(){const e=(0,f.useIsFocused)(),{nid:y,scrollTo:S,scrollToSeq:k,tab:P,pinned:L,path:z,line:D}=(0,d.useLocalSearchParams)(),W=(0,d.useRouter)(),{conn:G,subscribe:J,unsubscribe:te,onHint:se,onMeta:ie,onStatus:ce,onToolUses:ue,narrativeIds:de}=(0,h.useBrane)(),[fe,he]=(0,t.useState)([]),[ge,be]=(0,t.useState)(()=>new Map),me=(0,t.useRef)(0),pe=(0,t.useRef)(Number.MAX_SAFE_INTEGER),[ye,ve]=(0,t.useState)(()=>z??""),[xe,we]=(0,t.useState)(()=>(0,F.parseLineSpec)(D).line),[Se,Ce]=(0,t.useState)(()=>(0,F.parseLineSpec)(D).lineEnd),Te=y?`brane:files:${y}`:null,je=y?`brane:tabs:${y}`:null,Re=(0,t.useRef)(null),[ke,Ae]=(0,t.useState)(()=>(0,F.parseActiveTab)(P)),[Pe,Ie]=(0,t.useState)(()=>(0,F.parsePinnedTabs)(L)),Ee=(0,t.useRef)(y??null);(0,t.useEffect)(()=>{if(!y)return;if(Ee.current===y)return;Ee.current=y;const e=(0,F.parseLineSpec)(D);ve(z??""),we(e.line),Ce(e.lineEnd)},[y]);const Le=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(!Te||!y)return;if(Le.current===y)return;if(Le.current=y,z)return;let e=null;try{e=sessionStorage.getItem(Te)}catch{return}if(!e)return;let t=null;try{t=JSON.parse(e)}catch{}if(!t?.path)return;ve(t.path),we(t.line),Ce(t.lineEnd);const n=t.line?t.lineEnd&&t.lineEnd>t.line?`${t.line}-${t.lineEnd}`:String(t.line):void 0;W.setParams({path:t.path,line:n})},[y]),(0,t.useEffect)(()=>{if(Te)try{if(ye){const e={path:ye};xe&&(e.line=xe),Se&&(e.lineEnd=Se),sessionStorage.setItem(Te,JSON.stringify(e))}else sessionStorage.removeItem(Te)}catch{}},[Te,ye,xe,Se]),(0,t.useEffect)(()=>{if(je&&Re.current===y)try{sessionStorage.setItem(je,JSON.stringify({tab:ke,pinned:(0,F.serializePinned)(Pe)}))}catch{}},[je,y,ke,Pe]);const Me=(0,t.useMemo)(()=>(0,H.visiblePanes)(ke,Pe),[ke,Pe]),Ne=(0,t.useMemo)(()=>{const e=e=>{const t=Me.indexOf(e),n=Me.length;return t<0||1===n?{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:t<0?0:1,backgroundColor:"#111",pointerEvents:t<0?"none":"auto"}:{position:"absolute",top:0,bottom:0,left:t/n*100+"%",width:100/n+"%",zIndex:1,backgroundColor:"#111",borderLeftWidth:t>0?c.default.hairlineWidth:0,borderLeftColor:"#555"}};return{chat:e("chat"),terminal:e("terminal"),files:e("files")}},[Me]),ze=1===Me.length,[qe,$e]=(0,t.useState)(null),[Fe,Be]=(0,t.useState)(!1),[He,Oe]=(0,t.useState)(!1),[De,We]=(0,t.useState)(()=>oe(y).summary??null),[Ge,Xe]=(0,t.useState)(()=>oe(y).agent_type??null),[Ue,Ye]=(0,t.useState)(()=>oe(y).role??null),[Ve,Je]=(0,t.useState)(()=>oe(y).archived??!1),[Ke,Qe]=(0,t.useState)(()=>oe(y).fold_path??null),[Ze,et]=(0,t.useState)(()=>oe(y).status??null),[tt,nt]=(0,t.useState)(()=>oe(y).mcp_connected??!1),[rt,ot]=(0,t.useState)(!1),[at,st]=(0,t.useState)(()=>oe(y).created_at??null),[lt,it]=(0,t.useState)(()=>oe(y).last_activity??null),[ct,ut]=(0,t.useState)(()=>K(oe(y)));(0,t.useEffect)(()=>{const e=oe(y);We(e.summary??null),Xe(e.agent_type??null),Ye(e.role??null),Je(e.archived??!1),Qe(e.fold_path??null),et(e.status??null),nt(e.mcp_connected??!1),ot(!1),st(e.created_at??null),it(e.last_activity??null),ut(K(e))},[y]);const[dt,ft]=(0,t.useState)(!1),[ht,gt]=(0,t.useState)([]),[bt,mt]=(0,t.useState)(!1),[pt,yt]=(0,t.useState)(null),vt=(0,t.useMemo)(()=>(0,q.collectKnownNids)({viewing:y,pushed:[...de].map(e=>({id:e})),listed:pt}),[y,de,pt]),xt=(0,w.useMessageSelection)(y),wt=(0,t.useRef)(0),[St,Ct]=(0,t.useState)(()=>(0,C.readRecolorSalt)(y));(0,t.useEffect)(()=>Ct((0,C.readRecolorSalt)(y)),[y]);const Tt=(0,t.useCallback)(()=>{(0,T.recolorGlowHue)(y),Ct((0,C.bumpRecolorSalt)(y))},[y]),jt=(0,t.useRef)(null),Rt=(0,t.useRef)(null),kt=(0,t.useRef)(!1),At=(0,t.useRef)(!0),[Pt,It]=(0,t.useState)(!0),[Et,_t]=(0,t.useState)(!0),[Lt,Mt]=(0,t.useState)(!0),Nt=(0,t.useRef)(null),zt=(0,t.useRef)(null),qt=(0,t.useRef)(!0);qt.current=Me.includes("chat");const $t=(0,t.useRef)(0),Ft=(0,t.useRef)(S?Number(S):0),Bt=(0,t.useRef)(k?Number(k):0),Ht=(0,t.useRef)(!1),[Ot,Dt]=(0,t.useState)(!1),[Wt,Gt]=(0,t.useState)(!0),Xt=(0,t.useRef)(!1),Ut=(0,t.useRef)(!1),Yt=(0,t.useRef)(null),Vt=(0,t.useRef)(!1),Jt=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(Me.includes("chat")&&!Vt.current){const e=Bt.current,t=Ft.current;if((e||t)&&0===fe.length)return;Vt.current=!0,$t.current=Date.now();let n=-1;if(e&&fe.length>0)n=fe.findIndex(t=>t.seq===e),n>=0&&xt.replace([e]),Bt.current=0;else if(t&&fe.length>0){let e=1/0;for(let o=0;o<fe.length;o++){const a=Math.abs(fe[o].time-t);a<e&&(e=a,n=o)}Ft.current=0}if(n>=0){Ut.current=!0;const e=setTimeout(()=>{Ut.current=!1},2e3);return ne(jt.current,fe[n].seq),()=>clearTimeout(e)}At.current=!0,It(!0)}Me.includes("terminal")&&(Jt.current=!0)},[Me,fe.length]);const Kt=(0,t.useCallback)(()=>{jt.current?.scrollTo({top:0})},[]),Qt=(0,t.useCallback)(()=>{const e=jt.current;e?.scrollTo({top:-e.scrollHeight,behavior:"smooth"})},[]),Zt=(0,t.useRef)(!1),en=(0,t.useRef)(!1),tn=(0,t.useCallback)(async()=>{if(G&&y)if(Zt.current)en.current=!0;else{Zt.current=!0;try{do{en.current=!1;const e=await(0,b.fetchEvents)(G,y,wt.current);e.events.length>0&&(he(t=>{const n=t.length>0?t[t.length-1].seq:0,o=e.events.filter(e=>e.seq>n);return o.length>0?[...t,...o]:t}),wt.current=e.events[e.events.length-1].seq)}while(en.current)}finally{Zt.current=!1}}},[G,y]),nn=(0,t.useCallback)(async()=>{if(G&&y&&!Xt.current&&Wt){Xt.current=!0;try{const e=fe.length>0?fe[0].seq:1/0,t=await(0,b.fetchEventsBefore)(G,y,e,50);t.events.length>0&&he(e=>{const n=e.length>0?e[0].seq:1/0,o=t.events.filter(e=>e.seq<n);return o.length>0?[...o,...e]:e}),(t.events.length<50||t.events.length>0&&t.events[0].seq<=t.min_seq)&&Gt(!1)}finally{Xt.current=!1}}},[G,y,fe,Wt]),rn=(0,t.useCallback)(e=>{0!==e.length&&be(t=>{let n=null;for(const o of e){const e=(n??t).get(o.dedup_key);e&&e.rev>=o.rev||(n||(n=new Map(t)),n.set(o.dedup_key,o),o.rev>me.current&&(me.current=o.rev))}return n??t})},[]);(0,t.useEffect)(()=>{if(!G||!y||0===fe.length)return;const e=Math.max(0,fe[0].seq-1),t=pe.current;e>=t||(pe.current=e,(0,b.fetchAllToolUseWindow)(G,y,{afterSeqGte:e,afterSeqLt:t===Number.MAX_SAFE_INTEGER?void 0:t},rn).catch(()=>{pe.current=Number.MAX_SAFE_INTEGER}))},[G,y,fe,rn]),(0,t.useEffect)(()=>{if(G&&y)return ue((e,t,n)=>{e===y&&(t?rn(t):(0,b.fetchAllToolUsesSince)(G,y,me.current,rn).catch(()=>{pe.current=Number.MAX_SAFE_INTEGER}))})},[G,y,ue,rn]),(0,t.useEffect)(()=>{if(!G||!y)return;const e=`${G.host}|${G.token}|${y}`;if(Yt.current===e)return;Yt.current=e,he([]),Gt(!0),wt.current=0,be(new Map),me.current=0,pe.current=Number.MAX_SAFE_INTEGER;const t=Bt.current;Ft.current;(async()=>{try{if(t){const e=Math.floor(25),n=Math.max(0,t-e-1),o=await(0,b.fetchEvents)(G,y,n,50);o.events.length>0?(he(o.events),wt.current=o.events[o.events.length-1].seq,Gt(o.events[0].seq>1)):(wt.current=o.seq,Gt(!1))}else{const e=await(0,b.fetchEventsBefore)(G,y,Number.MAX_SAFE_INTEGER,50);e.events.length>0?(he(e.events),wt.current=e.events[e.events.length-1].seq,(e.events.length<50||e.events[0].seq<=e.min_seq)&&Gt(!1)):(wt.current=0,Gt(!1))}}catch{tn()}})()},[G,y]);const on=(0,t.useCallback)(e=>{if(!y)return;e.summary&&(We(e.summary),ae(y,{summary:e.summary})),e.agent_type&&(Xe(e.agent_type),ae(y,{agent_type:e.agent_type})),e.role&&(Ye(e.role),ae(y,{role:e.role})),Qe(e.fold_path??null),ae(y,{fold_path:e.fold_path??null});const t=!!e.archived;Je(t),ae(y,{archived:t}),e.status&&(et(e.status),ae(y,{status:e.status}));const n=!!e.mcp_connected;nt(n),ae(y,{mcp_connected:n}),ot(!!e.awaiting),st(e.created_at??null),ae(y,{created_at:e.created_at}),it(e.last_activity??null),ae(y,{last_activity:e.last_activity??null}),ut(K({cost_amount:e.cost_amount,cost_unit:e.cost_unit})),ae(y,{cost_amount:e.cost_amount??null,cost_unit:e.cost_unit??null})},[y]);(0,t.useEffect)(()=>{G&&y&&(0,b.fetchNarrative)(G,y).then(on).catch(()=>{})},[G,y,on]),(0,t.useEffect)(()=>{G&&y&&(0,b.fetchNarratives)(G,{archived:!0}).then(e=>{yt(e);const t=e.find(e=>e.id===y);t&&on(t)}).catch(e=>{console.warn("narrative list sweep failed; linkifying from pushed ids only",e)})},[G,y,on]),(0,t.useEffect)(()=>{if(!y)return;J(y,wt.current);const e=se((e,t)=>{if(e===y){tn();const e=Date.now();it(e),ae(y,{last_activity:e})}});return()=>{te(y),e()}},[y,J,te,se,tn]),(0,t.useEffect)(()=>{if(y)return ie((e,t,n,o)=>{e===y&&(n&&(We(n),ae(y,{summary:n})),null!=o&&(ut(o),ae(y,{cost_amount:o.amount,cost_unit:o.unit})))})},[y,ie]),(0,t.useEffect)(()=>{if(y)return ce((e,t)=>{e===y&&("mcp_connected"===t?(nt(!0),ae(y,{mcp_connected:!0})):"mcp_disconnected"===t?(nt(!1),ot(!1),ae(y,{mcp_connected:!1})):t===x.AWAITING_STATUS||t===x.NOT_AWAITING_STATUS?ot(t===x.AWAITING_STATUS):"active"!==t&&"ended"!==t||(et(t),ae(y,{status:t})))})},[y,ce]);const an=(0,t.useCallback)(async e=>{G&&y&&("all"!==e?await(0,v.openNarrativeExport)(G,y,[...xt.getSelected()],"excluded"===e?"except":"only"):await(0,v.openNarrativeExport)(G,y))},[G,y,xt]),sn=(0,t.useCallback)(async()=>{if(At.current)Ht.current=!0,At.current=!1,It(!1),Qt(),setTimeout(()=>{Ht.current=!1},600);else{const e=setTimeout(()=>Dt(!0),150);try{await tn()}finally{clearTimeout(e),Dt(!1)}At.current=!0,It(!0),Kt()}},[tn,Kt,Qt]),ln=(0,t.useCallback)(()=>{Et?Nt.current?.scrollToTop():Nt.current?.scrollToBottom()},[Et]),cn=(0,t.useCallback)(()=>{Lt?zt.current?.scrollToTop():zt.current?.scrollToBottom()},[Lt]),un=(0,t.useCallback)((e,t,n,o,a)=>{W.setParams((0,F.viewParams)(e,t,n,o,a))},[W]),dn=(0,t.useCallback)(e=>{Ae(t=>t===e?t:(un(e,Pe,ye,xe,Se),e))},[un,Pe,ye,xe,Se]),fn=(0,t.useCallback)(e=>{if(ke===e)return;const{pinned:t}=(0,H.selectPane)(ke,Pe,e);Ae(e),Ie(t),un(e,t,ye,xe,Se)},[un,ke,Pe,ye,xe,Se]),hn=(0,t.useCallback)(()=>{const{pinned:e}=(0,H.selectPane)(ke,Pe,"terminal");Ae("terminal"),Ie(e),un("terminal",e,ye,xe,Se),setTimeout(()=>Nt.current?.focus(),60)},[un,ke,Pe,ye,xe,Se]);(0,t.useEffect)(()=>{if(!e)return;if(Me.length<2)return;const t=e=>{const t=e.target;if(t?.closest?.(re))return;const n=t?.closest?.("[data-pane]"),o=n?.getAttribute("data-pane");"chat"!==o&&"terminal"!==o&&"files"!==o||(fn(o),"terminal"===o&&Nt.current?.focus())};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},[e,Me.length,fn]);const gn=(0,t.useCallback)(e=>{Ie(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),un(ke,n,ye,xe,Se),n})},[un,ke,ye,xe,Se]),[bn,mn]=(0,t.useState)(null),pn=(0,t.useCallback)((e,t)=>{(e!==y||t)&&W.push((0,A.narrativeHref)(e,t))},[W,y]),yn=(0,t.useCallback)((e,t)=>{W.push(`/${e}?scrollTo=${t}`)},[W]),vn=(0,t.useCallback)(e=>{const t=xt.toggle(e);W.setParams({scrollToSeq:t?String(e):void 0})},[W,xt]),xn=(0,t.useCallback)(()=>{0!==xt.clear().length&&W.setParams({scrollToSeq:void 0})},[W,xt]);(0,t.useEffect)(()=>{if(!e)return;const t=e=>{const t=e.target;t?.closest&&t.closest('[data-pane="chat"]')&&(t.closest("[data-bubble], [data-chrome]")||t.closest("input, textarea, [data-composer]")||window.getSelection()?.toString()||xn())};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[e,xn]);const wn=(0,t.useCallback)((e,t,n)=>{ve(e),we(t),Ce(n);"files"===ke||Pe.has("files")?un(ke,Pe,e,t,n):(Ae("files"),un("files",Pe,e,t,n))},[un,ke,Pe]),Sn=(0,t.useCallback)(e=>{const{path:t,line:n,lineEnd:o}=(0,I.parseRelLink)(e);wn(t,n,o)},[wn]),Cn=(0,t.useCallback)(e=>{if(!y)return;const{path:t,line:n,lineEnd:o}=(0,I.parseRelLink)(e);return(0,A.fileHref)(y,t,n,o,(0,F.serializePinned)(Pe)||void 0)},[y,Pe]),Tn=(0,t.useRef)(ke);Tn.current=ke;const jn=(0,t.useRef)(Pe);jn.current=Pe,(0,t.useEffect)(()=>{const e=(0,F.parseActiveTab)(P);e!==Tn.current&&Ae(e);const t=(0,F.parsePinnedTabs)(L),n=jn.current;(t.size!==n.size||[...t].some(e=>!n.has(e)))&&Ie(t)},[P,L]),(0,t.useEffect)(()=>{if(!je||!y)return;if(Re.current===y)return;if(Re.current=y,P||L)return;let e=null;try{e=sessionStorage.getItem(je)}catch{return}if(!e)return;let t=null;try{t=JSON.parse(e)}catch{}t&&(Ae((0,F.parseActiveTab)(t.tab)),Ie((0,F.parsePinnedTabs)(t.pinned)))},[y]);const Rn=(0,t.useMemo)(()=>{const e=new Map;if(0===ge.size||0===fe.length)return e;const t=fe[0].seq,n=fe[fe.length-1].seq;for(const o of ge.values()){let a=Math.min(o.after_seq,n);if(0===a){if(1!==t)continue;a=0}else if(a<t)continue;const s=e.get(a);s?s.push(o):e.set(a,[o])}for(const t of e.values())t.sort((e,t)=>e.started_at-t.started_at||e.dedup_key.localeCompare(t.dedup_key));return e},[fe,ge]),kn=(0,t.useCallback)(e=>G&&y?(0,b.fetchToolUse)(G,y,e):Promise.reject(new Error("no connection")),[G,y]),An=(0,t.useCallback)(({item:e})=>{const t=1===e.seq?Rn.get(0):void 0,n=Rn.get(e.seq),o=(0,O.jsx)(X,{item:e,nid:y,agentType:Ge,foldPath:Ke,conn:G,selection:xt,palette:St,onImagePress:$e,onForeignPress:yn,onFilePress:Sn,fileHref:Cn,onTimestampPress:vn});return t||n?(0,O.jsxs)(O.Fragment,{children:[t&&(0,O.jsx)(m.default,{rows:t,onNarrativePress:pn,onFetchFull:kn}),o,n&&(0,O.jsx)(m.default,{rows:n,onNarrativePress:pn,onFetchFull:kn})]}):o},[y,Ge,Ke,G,xt,St,yn,pn,Sn,Cn,vn,Rn,kn]),Pn=(0,t.useMemo)(()=>(0,F.viewParams)(ke,Pe,ye,xe,Se),[ke,Pe,ye,xe,Se]),In="undefined"!=typeof window&&!!G&&(0,F.isIsolated)(window.location.host,G.host),En=(0,B.useAppHost)(G,In),_n=(0,t.useCallback)(()=>{if(!G||!y)return;if("undefined"==typeof window)return;const e=(0,F.buildIsolateUrl)({host:window.location.host,protocol:window.location.protocol,search:window.location.search,path:`/${y}`,conn:G,appHost:En,view:Pn});e&&window.open(e,"_blank","noopener,noreferrer")},[G,y,Pn,En]),Ln=(0,t.useCallback)(async()=>{if(!G||!y)return;const e=!Ve;Je(e),ae(y,{archived:e});try{await(0,b.archiveNarrative)(G,y,e)}catch{return Je(!e),void ae(y,{archived:!e})}e&&W.push("/")},[G,y,Ve,W]),Mn=(0,t.useCallback)(()=>W.push("/"),[W]),Nn=(0,t.useCallback)(()=>{G&&(ft(!0),mt(!0),(0,b.fetchNarratives)(G).then(e=>{const t=e.filter(e=>e.mcp_connected||"active"===e.status||e.id===y);gt((0,$.sortNarratives)(t))}).catch(()=>{}).finally(()=>mt(!1)))},[G,y]);return(0,O.jsx)(u.default,{style:le.container,behavior:void 0,keyboardVerticalOffset:90,children:(0,O.jsxs)(N.MarkdownLinksProvider,{knownNarrativeIds:vt,onNarrativePress:pn,onProtocolPress:mn,children:[(0,O.jsx)(d.Stack.Screen,{options:V}),(0,O.jsx)(Y,{nid:y,narrativeSummary:De,narrativeFoldPath:Ke,narrativeRole:Ue,narrativeStatus:Ze,narrativeMcpConnected:tt,narrativeAwaiting:rt,palette:St,narrativeCreatedAt:at,narrativeLastActivity:lt,cost:(0,b.formatCost)(ct?.amount,ct?.unit),archived:Ve,selection:xt,openSwitcher:Nn,onDismiss:Mn,onDownload:an,onTerminate:()=>{hn(),Nt.current?.terminate()},onRevive:()=>{(0,v.revivesAsTwin)(Ue)||hn(),Nt.current?.revive()},onTwin:()=>Oe(!0),onArchiveToggle:Ln,onRecolor:Tt,onShowQr:()=>Be(!0),onIsolateDaemon:_n,isIsolated:In,canIsolate:!In||!!En}),(0,O.jsx)(n.default,{style:le.tabBar,children:F.CANONICAL_TABS.map((e,t)=>{const a=ke===e,s=Pe.has(e),i=a||s,c="chat"===e?"Chat":"terminal"===e?"Terminal":"Files",u="chat"===e?Pt:"terminal"===e?Et:Lt,d="chat"===e?sn:"terminal"===e?ln:cn;return(0,O.jsxs)(n.default,{style:[le.tab,t>0&&le.tabDivider,a&&le.tabActive],children:[(0,O.jsx)(l.default,{style:le.tabLabel,onPress:()=>dn(e),children:(0,O.jsx)(o.default,{style:[le.tabText,a&&le.tabTextActive],children:c})}),(0,O.jsx)(l.default,{style:le.tabPin,onPress:()=>gn(e),hitSlop:6,children:(0,O.jsx)(o.default,{style:[le.tabPinIcon,s?le.tabPinOn:le.tabPinOff],children:"\ud83d\udccc"})}),(0,O.jsx)(l.default,{style:le.tabArrowPress,onPress:d,disabled:!i,hitSlop:6,children:i?"chat"===e&&Ot?(0,O.jsx)(o.default,{style:le.tabArrowText,children:"\u267b\ufe0f"}):(0,O.jsx)(o.default,{style:le.tabArrowText,children:u?"\u2191":"\u2193"}):(0,O.jsx)(o.default,{style:le.tabArrowText})})]},e)})}),(0,O.jsxs)(n.default,Object.assign({style:{flex:1,overflow:"hidden",position:"relative"}},ze?{onTouchStart:e=>{const t=e.nativeEvent;Rt.current={x:t.pageX,y:t.pageY}},onTouchMove:e=>{if(!Rt.current)return;const t=e.nativeEvent,n=Math.abs(t.pageX-Rt.current.x),o=Math.abs(t.pageY-Rt.current.y);n>15&&n>1.5*o&&!kt.current&&(kt.current=!0)},onTouchEnd:e=>{if(!Rt.current)return;const t=e.nativeEvent,n=t.pageX-Rt.current.x,o=t.pageY-Rt.current.y;Rt.current=null,kt.current=!1;if(!("undefined"!=typeof window&&!!window.getSelection()?.toString())&&Math.abs(n)>60&&Math.abs(n)>1.5*Math.abs(o)){const e=Me[0],t=F.CANONICAL_TABS.indexOf(e),o=n<0?t+1:t-1;o>=0&&o<F.CANONICAL_TABS.length&&dn(F.CANONICAL_TABS[o])}}}:{},{children:[(0,O.jsxs)(n.default,{style:Ne.chat,dataSet:{pane:"chat"},children:[(0,O.jsx)("div",{ref:jt,style:Z,onScroll:e=>{const t=e.currentTarget,n=t.scrollTop>-50;n===At.current||Ht.current||(At.current=n,It(n));const o=t.scrollHeight-t.clientHeight+t.scrollTop,a=Date.now()-$t.current;o<200&&Wt&&!Xt.current&&!Ut.current&&qt.current&&$t.current>0&&a>Q&&nn()},children:(0,O.jsx)(n.default,{style:[le.list,ee],children:fe.map(e=>(0,O.jsx)("div",{"data-seq":e.seq,children:An({item:e})},e.seq))})}),(0,O.jsx)(U,{conn:G,nid:y,loadEvents:tn,chatActive:"chat"===ke,selection:xt,onDeselect:xn})]}),G&&y&&(0,O.jsx)(n.default,{style:Ne.terminal,dataSet:{pane:"terminal"},children:(0,O.jsx)(p.default,{ref:Nt,conn:G,nid:y,active:Me.includes("terminal"),keyboardActive:"terminal"===ke&&!dt&&!He&&null===qe,agentType:Ge,role:Ue,onAtBottomChange:_t,onTwin:()=>Oe(!0),onRevived:e=>W.push((0,F.terminalOnlyHref)(e))})}),G&&y&&(0,O.jsx)(n.default,{style:Ne.files,dataSet:{pane:"files"},children:(0,O.jsx)(E.default,{ref:zt,conn:G,nid:y,path:ye,line:xe,lineEnd:Se,active:Me.includes("files"),onPathChange:wn,onImagePress:$e,onAtBottomChange:Mt})})]})),(0,O.jsx)(i.default,{visible:dt,transparent:!0,animationType:"fade",onRequestClose:()=>ft(!1),children:(0,O.jsx)(l.default,{style:le.switcherOverlay,onPress:()=>ft(!1),children:(0,O.jsxs)(n.default,{style:le.switcherContent,children:[(0,O.jsxs)(n.default,{style:le.switcherTitleRow,children:[(0,O.jsx)(o.default,{style:le.switcherTitle,children:"Switch narrative"}),(0,O.jsx)(o.default,Object.assign({style:le.switcherListLink},(0,A.inAppLinkProps)("/",()=>{ft(!1),W.push("/")}),{children:"All narratives"}))]}),(0,O.jsx)(s.default,{data:ht,keyExtractor:e=>e.id,style:le.switcherList,ListEmptyComponent:(0,O.jsx)(o.default,{style:le.switcherEmpty,children:bt?"Loading\u2026":"No active narratives"}),renderItem:({item:e})=>{const t="ended"===e.status&&!e.mcp_connected,n=(0,x.isAwaiting)({mcpConnected:e.mcp_connected,awaiting:e.awaiting})?(0,x.awaitingGlow)((0,T.glowHueFor)(e.id)):void 0;return(0,O.jsxs)(l.default,{style:[le.switcherItem,e.id===y&&le.switcherItemActive,t&&le.switcherItemEnded,n?{boxShadow:n}:null],onPress:()=>{ft(!1),e.id!==y&&W.push(`/${e.id}`)},children:[(0,O.jsx)(j.NarrativeIdentity,{id:e.id,foldPath:e.fold_path,titleStyle:t?{color:"#666"}:void 0,copyMarginLeft:5,dimmed:t}),(0,O.jsx)(j.NarrativeMetaLine,{role:e.role,cost:(0,b.formatCost)(e.cost_amount,e.cost_unit),createdAt:e.created_at,lastActivity:e.last_activity,status:e.status,mcpConnected:e.mcp_connected,dimmed:t,style:{marginTop:4}}),e.summary&&(0,O.jsx)("div",{style:{position:"relative"},children:(0,O.jsx)("div",{className:"no-scrollbar",style:{overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",WebkitOverflowScrolling:"touch",maskImage:"linear-gradient(to right, #000 calc(100% - 40px), transparent)",WebkitMaskImage:"linear-gradient(to right, #000 calc(100% - 40px), transparent)"},children:(0,O.jsx)(o.default,{style:[le.switcherItemSummary,t&&{color:"#555"}],children:e.summary})})})]})}}),(0,O.jsx)(l.default,{style:le.switcherCancel,onPress:()=>ft(!1),children:(0,O.jsx)(o.default,{style:le.switcherCancelText,children:"Cancel"})})]})})}),(0,O.jsx)(R.default,{visible:Fe,conn:G,path:`/${y}`,view:Pn,onClose:()=>Be(!1)}),(0,O.jsx)(_.default,{visible:He,conn:G,re:y,defaultFoldPath:Ke,onClose:()=>Oe(!1),onSpawned:e=>{Oe(!1),W.push(`/${e.id}`)}}),(0,O.jsx)(i.default,{visible:null!==qe,transparent:!0,animationType:"fade",onRequestClose:()=>$e(null),children:(0,O.jsxs)(l.default,{style:le.lightboxBackdrop,onPress:()=>$e(null),children:[qe&&(0,O.jsx)(a.default,{source:{uri:qe},style:le.lightboxImage,resizeMode:"contain"}),(0,O.jsx)(o.default,{style:le.lightboxHint,children:"Tap anywhere to close"})]})}),bn&&G&&(0,O.jsx)(N.MarkdownLinksProvider,{onNarrativePress:(e,t)=>{mn(null),pn(e,t)},children:(0,O.jsx)(M.default,{conn:G,target:{source:"protocols",slug:bn},onClose:()=>mn(null)})})]})})}const le=c.default.create({container:{flex:1},glowTransition:{transitionProperty:"box-shadow",transitionDuration:"400ms"},header:{flexDirection:"row",alignItems:"center",backgroundColor:"#1a1a1e",paddingHorizontal:4,paddingVertical:6,borderBottomWidth:c.default.hairlineWidth,borderBottomColor:"rgb(216, 216, 216)",position:"relative",zIndex:10},tabBar:{flexDirection:"row",borderBottomWidth:c.default.hairlineWidth,borderBottomColor:"#555",backgroundColor:"#111"},tab:{width:100/F.CANONICAL_TABS.length+"%",position:"relative"},tabDivider:{borderLeftWidth:c.default.hairlineWidth,borderLeftColor:"#555"},tabActive:{borderBottomWidth:2,borderBottomColor:"#4caf50"},tabLabel:{flex:1,paddingVertical:10,paddingHorizontal:36,alignItems:"center",justifyContent:"center"},tabPin:{position:"absolute",left:0,top:0,bottom:0,width:36,alignItems:"center",justifyContent:"center"},tabPinIcon:{fontSize:12},tabPinOn:{opacity:1},tabPinOff:{opacity:.25},tabArrowPress:{position:"absolute",right:0,top:0,bottom:0,width:36,alignItems:"center",justifyContent:"center"},tabText:{color:"#666",fontSize:14,fontWeight:"600"},tabTextActive:{color:"#4caf50"},tabArrowText:{color:"#8fd4b4",fontSize:16,fontWeight:"400"},headerTitleContainer:{flexDirection:"column",alignItems:"stretch",justifyContent:"center",flex:1,minWidth:0,paddingHorizontal:8},headerSubtitle:{color:"#888",fontSize:12,fontFamily:"monospace",marginTop:1},headerSummary:{color:"#9a9aa0",fontSize:12,lineHeight:12,whiteSpace:"nowrap"},list:{paddingHorizontal:12,paddingVertical:8},bubbleRow:{marginBottom:6,flexDirection:"row"},bubbleRowLeft:{justifyContent:"flex-start"},bubbleRowRight:{justifyContent:"flex-end"},bubbleRowCenter:{justifyContent:"center"},bubble:{maxWidth:"85%",borderRadius:16,paddingHorizontal:14,paddingVertical:10,borderWidth:1.5,borderColor:"transparent",borderStyle:"solid"},bubbleAgent:{backgroundColor:"#1c1c1e",borderBottomLeftRadius:4},bubbleOperator:{backgroundColor:"#1a4a7a",borderBottomRightRadius:4},bubbleForeign:{borderRadius:12},bubbleSystem:{backgroundColor:"transparent",borderWidth:1,borderStyle:"dashed",borderColor:"#3a3a3c",borderRadius:12},bubbleSelected:{borderColor:"#5b9bd5"},bubbleSourceRow:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",marginBottom:3},bubbleSourcePress:{alignSelf:"flex-start"},bubbleSource:{color:"#4caf50",fontSize:11,fontFamily:"monospace"},bubbleSourceLink:{textDecorationLine:"underline"},bubbleSourceAfterLink:{marginLeft:4},bubbleSourceSystem:{color:"#8a8a8e"},bubbleTimePress:{alignSelf:"flex-end",marginTop:4},bubbleTime:{color:"#666",fontSize:11,textAlign:"right"},inputRow:{flexDirection:"row",padding:8,paddingBottom:8,borderTopWidth:1,borderTopColor:"rgb(216, 216, 216)",backgroundColor:"#1a1a1a",alignItems:"flex-end"},input:{flex:1,backgroundColor:"#111",color:"#e0e0e0",borderRadius:20,paddingHorizontal:16,paddingVertical:8,fontSize:15,borderWidth:1,borderColor:"#555",maxHeight:120,minHeight:36},sendButton:Object.assign({marginLeft:8,width:36,height:36,borderRadius:18,backgroundColor:"#1c1c1e",borderWidth:1,borderColor:"#555",justifyContent:"center",alignItems:"center"},{transition:"box-shadow 160ms ease, border-color 160ms ease"}),sendText:{fontSize:20,lineHeight:20,transform:[{translateX:-1},{translateY:1},{rotate:"45deg"}]},sendTextInactive:{opacity:.35},attachButton:Object.assign({width:36,height:36,borderRadius:18,backgroundColor:"#1c1c1e",justifyContent:"center",alignItems:"center",marginRight:8,borderWidth:1,borderColor:"#555"},{transition:"box-shadow 160ms ease, border-color 160ms ease"}),attachText:{fontSize:20,lineHeight:20,marginTop:-3},circleGlowActive:Object.assign({borderColor:"rgba(255, 130, 180, 0.6)"},{boxShadow:["0 0 10px rgba(255, 130, 180, 0.9)","0 0 25px rgba(255, 110, 165, 0.7)","0 0 50px rgba(255, 100, 155, 0.4)"].join(", ")}),circleGlowSend:Object.assign({borderColor:"rgba(90, 230, 200, 0.6)"},{boxShadow:["0 0 10px rgba(90, 230, 200, 0.9)","0 0 25px rgba(70, 215, 190, 0.7)","0 0 50px rgba(60, 200, 180, 0.4)"].join(", ")}),payloadsContainer:{marginTop:6,gap:4},filePayload:{backgroundColor:"rgba(255,255,255,0.1)",borderRadius:6,paddingHorizontal:10,paddingVertical:6},filePayloadText:{color:"#6cf",fontSize:13},pendingPayloadsRow:{flexDirection:"row",paddingHorizontal:12,paddingTop:8,gap:8,backgroundColor:"#111"},pendingPayloadThumb:{position:"relative",width:60,height:60},pendingPayloadImage:{width:60,height:60,borderRadius:8,borderWidth:1,borderColor:"#555"},pendingPayloadRemove:{position:"absolute",top:-6,right:-6,width:20,height:20,borderRadius:10,backgroundColor:"#c00",justifyContent:"center",alignItems:"center"},pendingPayloadRemoveText:{color:"#fff",fontSize:14,fontWeight:"700",lineHeight:16},switcherOverlay:{flex:1,backgroundColor:"rgba(0,0,0,0.6)",justifyContent:"center",alignItems:"center",padding:24},switcherContent:{backgroundColor:"#1e1e1e",borderRadius:12,paddingTop:20,paddingHorizontal:20,paddingBottom:8,width:"100%",maxWidth:400,maxHeight:"70%"},switcherTitleRow:{flexDirection:"row",alignItems:"baseline",justifyContent:"space-between",marginBottom:16},switcherTitle:{color:"#e0e0e0",fontSize:18,fontWeight:"600"},switcherListLink:{color:"#8fd4b4",fontSize:14,padding:8,margin:-8},switcherList:{flexGrow:0,padding:4,margin:-4},switcherItem:{paddingVertical:12,paddingHorizontal:12,borderRadius:8,backgroundColor:"#2a2a2a",marginBottom:8},switcherItemActive:{outlineWidth:2,outlineStyle:"solid",outlineColor:"#4caf50",outlineOffset:2},switcherItemEnded:{opacity:.5},switcherItemSummary:{color:"#9a9aa0",fontSize:12,lineHeight:12,whiteSpace:"nowrap"},switcherEmpty:{color:"#888",fontSize:14,textAlign:"center",paddingVertical:20},switcherCancel:{paddingVertical:12,alignItems:"center",marginTop:4},switcherCancelText:{color:"#888",fontSize:15},lightboxBackdrop:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.95)",justifyContent:"center",alignItems:"center",padding:8},lightboxImage:{width:"100%",height:"92%"},lightboxHint:{color:"#888",fontSize:14,marginTop:20},reloadButton:{paddingHorizontal:8,paddingVertical:4,marginRight:4},reloadText:Object.assign({fontSize:20},{transition:"text-shadow 160ms ease"}),reloadTextActive:Object.assign({},{textShadow:["0 0 10px rgba(140, 230, 170, 0.9)","0 0 25px rgba(120, 215, 155, 0.7)","0 0 50px rgba(100, 200, 145, 0.4)","0 2px 15px rgba(130, 220, 165, 0.6)"].join(", ")})})},10,[11,13,105,106,113,145,146,153,26,160,116,161,165,736,745,759,762,773,769,755,774,771,770,776,778,780,786,761,958,959,972,779,973,950,752,976,977,747,978,980,6]);
|
|
27
27
|
__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},11,[12]);
|
|
28
28
|
__d(function(g,r,_i,a,m,e,d){
|
|
29
29
|
/**
|
|
@@ -861,7 +861,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
|
|
|
861
861
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TAP_SLOP_PX",{enumerable:!0,get:function(){return o}}),e.isTextEntry=function(o){if(o.isContentEditable)return!0;const n=o.tagName.toUpperCase();return("INPUT"===n||"TEXTAREA"===n)&&(!o.disabled&&!o.readOnly&&("TEXTAREA"===n||!t.has((o.type??"text").toLowerCase())))},e.scrollBoxOf=function(o){const t=o.scrollHeight-o.clientHeight;if("auto"!==o.overflowY&&"scroll"!==o.overflowY||!(t>1))return{scrolls:!1,roomAbove:0,roomBelow:0};const[n,s]=o.reversed?[-t,0]:[0,t];return{scrolls:!0,roomAbove:o.scrollTop-n,roomBelow:s-o.scrollTop}},e.dragAllowed=function(o,t,n){if(Math.abs(o)>Math.abs(t))return!0;if(0===t)return!0;for(const o of n)if(o.scrolls){if(t>0&&o.roomAbove>1)return!0;if(t<0&&o.roomBelow>1)return!0}return!1},e.layoutHeight=function(o,t,n){return Math.abs(t-1)>.01?n:Math.round(o)},Object.defineProperty(e,"TAP_FOCUS_GRACE_MS",{enumerable:!0,get:function(){return n}}),e.mustBlur=function(o){return o.touch&&o.textEntryFocused&&!o.keyboardUp&&o.msSinceTapFocus>n};const o=10,t=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);const n=1e3},758,[]);
|
|
862
862
|
__d(function(g,r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return N}});var t=r(d[0]);r(d[1]);var n=e(r(d[2]));r(d[3]);var o=e(r(d[4])),l=e(r(d[5])),s=e(r(d[6])),u=r(d[7]),c=r(d[8]),f=r(d[9]);function p(e){const t=e.match(/^mcp__([^_]+(?:_[^_]+)*?)__(.+)$/);return t?`${t[1]}:${t[2]}`:e}function y(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function h(e){return"object"!=typeof e||null===e||Array.isArray(e)?null:e}function m(e){const t=h(y(e.output));if(!t)return null;if(Array.isArray(t.content)){const e=t.content.find(e=>"string"==typeof e?.text)?.text;return h(y("string"==typeof e?e:null))}return t}function x(e){const t=p(e.name);if("brane:listen"===t)return{kind:"listen"};if("brane:narrate"!==t)return{kind:"work"};const n=h(y(e.input))?.nid;if("string"!=typeof n||n===e.narrative_id)return{kind:"self_narrate"};const o=m(e)?.seq;return{kind:"foreign_narrate",nid:n,seq:"number"==typeof o?o:void 0}}const b=240,j=8e3;function _(e){if(!e.input)return"";let t;try{t=JSON.parse(e.input)}catch{return e.input}if("object"!=typeof t||null===t)return String(t);const n=t,o=n.command??n.file_path??n.pattern??n.url??n.query??n.path;if("string"==typeof o)return o;const l=Object.values(n).find(e=>"string"==typeof e);return"string"==typeof l?l:e.input}function w(e){const t=_(e).replace(/\s*\n\s*/g," \u23ce ");return t.length>b?`${t.slice(0,b)}\u2026`:t}function k(e){if(!e)return null;const t=y(e);return null===t?e:JSON.stringify(t,null,2)}function S(e){return e.length<=j?{body:e,note:null}:{body:e.slice(0,j),note:`+${(e.length-j).toLocaleString()} more characters`}}function v(e){const t=h(y(e));return!!t&&0===Object.keys(t).length}function L(e){const t=[],n=p(e.name).startsWith("brane:"),o=(e,o,l)=>{if(!o)return;if(n&&("input"===e||"output"===e)&&v(o))return;const{body:s,note:u}=S(o);t.push({label:e,body:s,note:[l?.note,u].filter(Boolean).join(" \xb7 ")||null,failed:l?.failed})};return o("input",k(e.input),{note:e.input_truncated?"excerpt \u2014 the daemon holds the full value":void 0}),o("output",k(e.output),{note:e.output_truncated?"excerpt \u2014 the daemon holds the full value":void 0}),o("error",e.error,{failed:!0}),(e.decided_by||e.decision_note)&&o("decision",[e.decided_by,e.decision_note].filter(Boolean).join(" \u2014 ")),t}function $(e){return[e.status,e.source,e.agent_type].filter(Boolean).join(" \xb7 ")}function O(e){return null==e?"":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function z(e){return"failed"===e.status||"denied"===e.status}function F(e){return z(e)?{glyph:"\u2717",failed:!0}:"unknown"===e.status?{glyph:"\u2013",failed:!1}:"pending"===e.status||"allowed"===e.status?{glyph:"\u2026",failed:!1}:null}function T({children:e}){const t=(0,u.useHorizontalPanGuard)();return(0,f.jsx)("div",Object.assign({style:{overflowX:"auto",overflowY:"hidden"}},t,{children:(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",width:"max-content",minWidth:"100%"},children:e})}))}function N({rows:e,onNarrativePress:o,onFetchFull:u}){const y=(0,t.useMemo)(()=>e.map(e=>({row:e,kind:x(e)})).filter(({kind:e})=>"self_narrate"!==e.kind),[e]),h=y.some(({row:e})=>z(e)),[m,b]=(0,t.useState)(h),j=(0,t.useRef)(!1);(0,t.useEffect)(()=>{h&&!j.current&&b(!0)},[h]);const[_,k]=(0,t.useState)(P),S=(0,t.useCallback)(e=>{k(t=>{const n=new Set(t);return n.delete(e)||n.add(e),n})},[]),[v,L]=(0,t.useState)(0),$=(0,t.useMemo)(()=>{const e=new Map;let t=0;for(const{row:n,kind:o}of y){const l=p(n.name);e.set(l,(e.get(l)??0)+1),"listen"!==o.kind&&(t+=n.duration_ms??0)}const n=[...e.entries()].map(([e,t])=>t>1?`${e} \xd7${t}`:e).join(", ");return`${1===y.length?"1 tool":`${y.length} tools`}${t>0?` (${O(t)})`:""}: ${n}`},[y]);return 0===y.length?null:(0,f.jsxs)(s.default,{style:R.container,dataSet:{chrome:"tools"},onLayout:e=>L(e.nativeEvent.layout.width),children:[(0,f.jsxs)(n.default,{onPress:()=>{j.current=!0,b(e=>(e&&k(P),!e))},style:R.summaryRow,children:[(0,f.jsx)(l.default,{style:R.gear,children:"\u2699"}),(0,f.jsx)(l.default,{style:[R.summaryText,h&&R.failText],numberOfLines:1,children:$})]}),m&&(0,f.jsx)(T,{children:y.map(({row:e,kind:y})=>{const h=F(e),m=_.has(e.dedup_key);return(0,f.jsxs)(t.Fragment,{children:[(0,f.jsxs)(n.default,{style:R.row,onPress:()=>S(e.dedup_key),accessibilityRole:"button",accessibilityState:{expanded:m},children:[(0,f.jsx)(l.default,{style:R.gear,children:"\u2699"}),(0,f.jsx)(l.default,{style:[R.name,h?.failed&&R.failText],numberOfLines:1,children:p(e.name)}),"foreign_narrate"===y.kind?(0,f.jsx)(l.default,{style:[R.args,C],numberOfLines:q?void 0:1,children:(0,f.jsxs)(l.default,Object.assign({style:R.link},A((0,c.narrativeHref)(y.nid,y.seq),()=>o?.(y.nid,y.seq)),{children:["\u2192\xa0",y.seq?`${y.nid}:${y.seq}`:y.nid]}))}):(0,f.jsx)(l.default,{style:[R.args,C],numberOfLines:q?void 0:1,children:w(e)}),(0,f.jsx)(s.default,{style:R.slack}),(0,f.jsxs)(s.default,{style:[R.trailing,M],children:[(0,f.jsx)(l.default,{style:R.duration,children:O(e.duration_ms)}),(0,f.jsx)(l.default,{style:[R.status,h?.failed&&R.failText],children:h?.glyph??" "})]})]}),m&&(0,f.jsx)(n.default,{style:[R.detail,D,v>0?{width:v-2*H}:null],onPress:()=>{"undefined"!=typeof window&&window.getSelection()?.toString()||S(e.dedup_key)},children:(0,f.jsx)(B,{row:e,onFetchFull:u})})]},e.dedup_key)})}),m&&y.map(({row:e})=>e).filter(z).map(e=>e.error?(0,f.jsx)(l.default,{style:[R.errorLine,R.failText],numberOfLines:2,children:e.error},`${e.dedup_key}-err`):null)]})}function B({row:e,onFetchFull:n}){const[o,u]=(0,t.useState)(null),[c,p]=(0,t.useState)(!1),y=!(!e.input_truncated&&!e.output_truncated);(0,t.useEffect)(()=>{if(!y||!n||o)return;let t=!0;return n(e.dedup_key).then(e=>{t&&u(e)}).catch(()=>{t&&p(!0)}),()=>{t=!1}},[y,n,o,e.dedup_key]);const h=o??e,m=(0,t.useMemo)(()=>L(h),[h]),x=y&&!o&&!c;return(0,f.jsxs)(f.Fragment,{children:[x&&(0,f.jsx)(l.default,{style:R.detailNote,children:"excerpt \u2014 fetching the rest\u2026"}),c&&(0,f.jsx)(l.default,{style:[R.detailNote,R.failText],children:"excerpt \u2014 the full value could not be fetched"}),0===m.length?(0,f.jsx)(l.default,{style:R.detailNote,children:"nothing recorded beyond the row itself"}):m.map(e=>(0,f.jsxs)(s.default,{style:R.detailSection,children:[(0,f.jsx)(l.default,{style:R.detailLabel,children:e.label}),(0,f.jsx)(l.default,{style:[R.detailBody,e.failed&&R.failText],selectable:!0,children:e.body}),e.note&&(0,f.jsx)(l.default,{style:R.detailNote,children:e.note})]},e.label)),(0,f.jsx)(l.default,{style:R.detailNote,children:$(h)})]})}const P=new Set;function A(e,t){const n=(0,c.inAppLinkProps)(e,t),o=n.onClick;return Object.assign({},n,{onClick:e=>{e.stopPropagation?.(),o?.(e)}})}const q=!0,C={whiteSpace:"nowrap",textOverflow:"clip"},M={position:"sticky",right:0},D={position:"sticky",left:0},H=12,R=o.default.create({container:{paddingHorizontal:H,paddingTop:4,paddingBottom:10},summaryRow:{flexDirection:"row",alignItems:"center"},row:{flexDirection:"row",alignItems:"center",paddingVertical:2,paddingLeft:18},gear:{color:"#666",fontSize:11,width:18,textAlign:"center"},summaryText:{color:"#8a8a8e",fontSize:12,flexShrink:1},name:{color:"#9a9aa0",fontSize:12,fontFamily:"monospace",minWidth:64,paddingRight:8},args:{color:"#666",fontSize:12,fontFamily:"monospace"},slack:{flex:1,minWidth:8},link:{color:"#6cb6ff",textDecorationLine:"underline"},trailing:{flexDirection:"row",alignItems:"center",backgroundColor:"#111",paddingLeft:10},duration:{color:"#666",fontSize:11,paddingLeft:8,textAlign:"right"},status:{fontSize:11,width:14,textAlign:"center",color:"#666"},detail:{alignSelf:"flex-start",backgroundColor:"#17171b",borderLeftWidth:2,borderLeftColor:"#333",paddingHorizontal:10,paddingVertical:6,marginBottom:4},detailSection:{paddingBottom:6},detailLabel:{color:"#8a8a8e",fontSize:10,textTransform:"uppercase",letterSpacing:.5,paddingBottom:2},detailBody:{color:"#c8c8cc",fontSize:11,fontFamily:"monospace",lineHeight:15},detailNote:{color:"#666",fontSize:10,fontStyle:"italic"},errorLine:{fontSize:11,fontFamily:"monospace",paddingLeft:36,paddingVertical:1},failText:{color:"#e57373"}})},759,[11,116,146,122,26,105,13,760,761,6]);
|
|
863
863
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useHorizontalPanGuard=function(){const e=(0,n.useRef)(null),u=(0,n.useRef)(!1);return(0,n.useMemo)(()=>{const n=n=>{u.current&&n.stopPropagation?.(),e.current=null,u.current=!1};return{onTouchStart:n=>{e.current=t(n),u.current=!1},onTouchMove:n=>{const o=e.current;if(o){if(!u.current){const{x:e,y:c}=t(n),s=Math.abs(e-o.x),l=Math.abs(c-o.y);s>6&&s>1.2*l&&(u.current=!0)}u.current&&n.stopPropagation()}},onTouchEnd:n,onTouchCancel:n}},[])};var n=r(d[0]);function t(n){const t=n.nativeEvent?.touches?.[0]??n.nativeEvent??n;return{x:t.pageX??t.clientX??0,y:t.pageY??t.clientY??0}}},760,[11]);
|
|
864
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.inAppLinkProps=function(o,
|
|
864
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.inAppLinkProps=function(o,u){return o?{href:(0,e.withDaemonFragment)(o,(0,t.getActiveDaemonBraneId)()),onClick:e=>{n(e)&&(e.preventDefault(),u())}}:{onPress:u}},_e.narrativeHref=function(e,t){return t?`/${e}?scrollToSeq=${t}`:`/${e}`},_e.fileHref=function(e,t,n,o,u){const c=new URLSearchParams({tab:"files",path:t});n&&c.set("line",o&&o>n?`${n}-${o}`:String(n));u&&c.set("pinned",u);return`/${e}?${c.toString()}`},r(d[0]);var e=r(d[1]),t=r(d[2]);function n(e){return!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)}},761,[116,747,751]);
|
|
865
865
|
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return H}});var t=r(d[0]);r(d[1]);var n=r(d[2]),o=r(d[3]),c=r(d[4]),s=r(d[5]),l=r(d[6]),i=e(r(d[7])),u=e(r(d[8])),f=e(r(d[9])),p=r(d[10]),y=r(d[11]);const h=1.4,v=16.799999999999997,b=(0,c.blockGlyphStylesheet)(h);function x(e,t){let n="";return e.ctrlKey&&(n+="C-"),e.altKey&&(n+="M-"),t&&e.shiftKey&&(n+="S-"),n}const C={Enter:"Enter",Escape:"Escape",Tab:"Tab",Backspace:"BSpace",Delete:"DC",Insert:"IC",ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right",Home:"Home",End:"End",PageUp:"PPage",PageDown:"NPage",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12"};function w(e){const t=C[e.key];if(t)return x(e,!0)+t;if(" "===e.key){const t=x(e,!1);return t?t+"Space":" "}return(e.ctrlKey||e.altKey)&&1===e.key.length?x(e,!1)+e.key.toLowerCase():1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey?null:e.key}const k=[{label:"Esc",keys:"Escape"},{label:"1",keys:"1"},{label:"2",keys:"2"},{label:"3",keys:"3"}],E="undefined"!=typeof navigator&&"undefined"!=typeof document&&(/iP(ad|hone|od)/.test(navigator.userAgent)||/Mac/.test(navigator.userAgent)&&"ontouchend"in document),S="undefined"!=typeof navigator&&/Mac|iP(ad|hone|od)/.test(navigator.platform||navigator.userAgent);function F(e){return"v"===e.key.toLowerCase()&&!e.altKey&&(S?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)}const R=/[\u23fa\u{1F518}]/gu;const M=/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g;function j(e){return e.replace(M,"")}function K({onPress:e,style:n,children:o}){const[c,s]=(0,t.useState)(!1),l=(0,t.useRef)(null),i=(0,t.useCallback)(()=>{e(),l.current&&clearTimeout(l.current),s(!0),l.current=setTimeout(()=>s(!1),180)},[e]);return(0,y.jsx)("button",{onClick:i,style:Object.assign({},n,c?{backgroundColor:"#4444cc",border:"1px solid #7c7cff",color:"#fff",boxShadow:"0 0 8px rgba(120, 120, 255, 0.8)"}:{boxShadow:"none"},{transition:"background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.15s ease"}),children:o})}const L=(0,t.forwardRef)(function({conn:e,nid:x,active:C=!0,keyboardActive:S,agentType:M,role:L,onAtBottomChange:H,onTwin:A,onRevived:T},D){const P=(0,t.useRef)(null),z=(0,t.useRef)(null),_=(0,t.useRef)(null),B=(0,t.useRef)(!0),I=(0,t.useRef)(null),N=(0,t.useRef)(null),X=(0,t.useRef)(null),Y=(0,t.useRef)(0),q=(0,t.useRef)(C);q.current=C;const O=(0,t.useRef)(S??C);O.current=S??C;const W=(0,n.useIsFocused)(),U=(0,t.useRef)(W);U.current=W;const[G,$]=(0,t.useState)(!1),[J,Q]=(0,t.useState)(!1),V=(0,t.useRef)(null),Z=(0,t.useRef)(!1);Z.current=J;const[ee,te]=(0,t.useState)(!1),[ne,re]=(0,t.useState)(!1),oe=(0,t.useRef)(()=>{}),[ce,se]=(0,t.useState)(!1),le=(0,t.useRef)(!1),ie=(0,t.useRef)(null),ue=(0,t.useRef)(null),ae=(0,t.useRef)(null),de=(S??C)&&W,fe=(0,t.useRef)(de);fe.current=de;const pe=(0,t.useRef)(!0),ye=(0,t.useRef)(H);ye.current=H;const he=(0,t.useCallback)(e=>{pe.current=e,le.current&&e!==B.current&&(B.current=e,ye.current?.(e))},[]),me=(0,t.useCallback)(e=>{"C-End"===e?he(!0):"PPage"!==e&&"C-Home"!==e||he(!1)},[he]);(0,t.useImperativeHandle)(D,()=>({focus:()=>{const e=P.current;if(e)try{e.focus({preventScroll:!0})}catch{e.focus()}},scrollToTop:()=>{if(le.current)return _.current?.sendKeys("C-Home"),void he(!1);const e=P.current;e&&(e.scrollTop=0,B.current=!1,H?.(!1))},scrollToBottom:()=>{if(le.current)return _.current?.sendKeys("C-End"),void he(!0);const e=P.current;e&&(e.scrollTop=e.scrollHeight,B.current=!0,H?.(!0))},terminate:()=>{(0,l.sendInterrupt)(e=>_.current?.sendKeys(e))},revive:()=>{oe.current()}}),[H,he]);const ve=(0,t.useRef)(new WeakMap),ge=(0,t.useCallback)((e,t)=>{var n;0===t.length?e.textContent="\xa0":z.current?e.innerHTML=(0,c.paintBlockGlyphs)(z.current.ansi_to_html((n=j(t),E?n.replace(R,"\u25cf"):n))):e.textContent=j(t)},[]),be=(0,t.useCallback)(e=>{const t=document.createElement("div");return t.style.display="block",t.style.minHeight="1.4em",t.style.position="relative",ge(t,e),ve.current.set(t,e),t},[ge]),xe=(0,t.useCallback)((e,t)=>{ge(e,t),ve.current.set(e,t)},[ge]),Ce=(0,t.useCallback)(e=>ve.current.get(e),[]),we=(0,t.useCallback)(()=>{const e=P.current?.querySelector("pre"),t=ae.current,n=ue.current,o=ie.current;if(!e||!n||!o)return void(t?.parentNode&&t.parentNode.removeChild(t));const c=e.children[n.line];if(!c)return void(t?.parentNode&&t.parentNode.removeChild(t));const s=t??document.createElement("span");t||(s.style.position="absolute",s.style.top="0",s.style.pointerEvents="none",s.style.backgroundColor="#fff",s.style.mixBlendMode="difference",ae.current=s),s.style.left=n.col*o.width+"px",s.style.width=`${o.width}px`,s.style.height=`${v}px`,fe.current?(s.style.backgroundColor="#fff",s.style.border="none",s.style.animation="brane-cursor-blink 1.06s steps(1, end) infinite"):(s.style.backgroundColor="transparent",s.style.border="1px solid #fff",s.style.boxSizing="border-box",s.style.animation="none"),"relative"!==c.style.position&&(c.style.position="relative"),s.parentNode!==c&&c.appendChild(s)},[]);(0,t.useEffect)(()=>{we()},[de,we]);const ke=(0,t.useCallback)(()=>{const e=P.current,t=e?.querySelector("pre");if(t){for(;t.firstChild;)t.removeChild(t.firstChild);ve.current=new WeakMap,ae.current=null}_.current?.refresh()},[]),Ee=(0,t.useCallback)((e,t)=>{const n=Array.from(e.children),o=t.length,c=n.length,s=Math.min(o,c);let l=o!==c;for(let e=0;e<s;e++)Ce(n[e])!==t[e]&&(xe(n[e],t[e]),l=!0);if(o>c){const n=document.createDocumentFragment();for(let e=c;e<o;e++)n.appendChild(be(t[e]));e.appendChild(n)}else if(c>o)for(let t=c-1;t>=o;t--)e.removeChild(n[t]);return l},[be,xe,Ce]),Se=(0,t.useCallback)((e,t,n,o)=>{const c=Math.max(0,0|n),s=Math.max(0,0|o),l=Array.from(e.children).length;let i=!1;if(c>l){const t=document.createDocumentFragment();for(let e=l;e<c;e++)t.appendChild(be(""));e.appendChild(t),i=!0}const u=Array.from(e.children);let f=null;for(let e=0;e<t.length;e++){const n=c+e;n<u.length?Ce(u[n])!==t[e]&&(xe(u[n],t[e]),i=!0):(f||(f=document.createDocumentFragment()),f.appendChild(be(t[e])),i=!0)}f&&e.appendChild(f);const p=e.children.length;if(p>s){for(let t=p-1;t>=s;t--){const n=e.children[t];n&&e.removeChild(n)}i=!0}return i},[be,xe,Ce]),Fe=(0,t.useCallback)(e=>{const t=P.current;if(!t||!z.current)return;const n=t.querySelector("pre");if(!n)return;const o=t,c=le.current?pe.current:o.scrollHeight-o.scrollTop-o.clientHeight<40;let s;c!==B.current&&H?.(c),B.current=c,"frame"!==e.type&&"append"!==e.type||(ue.current=e.cursor??null);let l=!1;if("frame"===e.type){const t=e.data.split("\n");l=Ee(n,t),s=e.alternate_on}else if("append"===e.type){const t=e.data.split("\n");l=Se(n,t,e.lineOffset,e.totalLines),s=e.alternate_on}void 0!==s&&s!==le.current&&(le.current=s,se(s)),we(),l&&B.current&&o.scrollHeight>o.clientHeight&&(o.scrollTop=o.scrollHeight)},[Ee,Se,H,we]),Re=(0,t.useCallback)(()=>{X.current=null;const e=N.current;e&&(N.current=null,Fe(e))},[Fe]),Me=(0,t.useCallback)(e=>{if(!q.current)return void(I.current=e);const t=null!==N.current;N.current=e,t||(Y.current=Date.now()),null!==X.current?Date.now()-Y.current>=400&&(cancelAnimationFrame(X.current),X.current=null,Re()):X.current=requestAnimationFrame(Re)},[Re]);(0,t.useEffect)(()=>{if("undefined"==typeof document)return;const e=()=>{"visible"===document.visibilityState&&(null!==X.current&&(cancelAnimationFrame(X.current),X.current=null),N.current&&Re(),q.current&&_.current?.refresh())};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[Re]),(0,t.useEffect)(()=>()=>{null!==X.current&&(cancelAnimationFrame(X.current),X.current=null),N.current=null},[]);const je=(0,t.useRef)(void 0);(0,t.useEffect)(()=>{const e=_.current;if(!e)return;const t=je.current;je.current=C,C?(e.start(),I.current&&(Fe(I.current),I.current=null),!1===t&&ke()):e.stop()},[C,Fe,ke]),(0,t.useEffect)(()=>{if(!z.current){const e=new o.AnsiUp;e.use_classes=!1,z.current=e}const t=(0,l.createTerminalChannel)({conn:e,nid:x,onFrame:Me,onCursor:e=>{ue.current=e,q.current&&we()},onTerminated:()=>te(!0)});return _.current=t,t.start(),()=>{t.close(),_.current=null}},[e,x,Me,we]),(0,t.useEffect)(()=>{const e=e=>{if(!O.current||!U.current)return;if(Z.current)return;if(F(e))return;let t=w(e);t&&le.current&&("Home"===t?t="C-Home":"End"===t&&(t="C-End")),t&&_.current&&(e.preventDefault(),_.current.sendKeys(t),me(t))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.useEffect)(()=>{const e=e=>{if(!O.current||!U.current)return;const t=e.clipboardData?.getData("text");t&&(e.preventDefault(),_.current?.sendPaste(t),Z.current&&Q(!1))};return document.addEventListener("paste",e),()=>document.removeEventListener("paste",e)},[]);const Ke=(0,t.useCallback)(async()=>{try{const e=await(navigator.clipboard?.readText());if(e)return void _.current?.sendPaste(e);if(""===e)return}catch{}Q(!0)},[]);(0,t.useEffect)(()=>{const e=P.current;if(!e)return;const t=document.createElement("span");t.style.fontFamily="'Menlo', 'Monaco', 'Courier New', monospace",t.style.fontSize="12px",t.style.lineHeight="1.4",t.style.position="absolute",t.style.visibility="hidden",t.style.whiteSpace="pre",t.textContent="X",document.body.appendChild(t);const n=t.getBoundingClientRect().width;if(document.body.removeChild(t),0===n)return;const o=v;let c=0,s=0;const l=new ResizeObserver(e=>{for(const t of e){const{width:e,height:l}=t.contentRect,i=Math.floor((e-16)/n),u=Math.floor((l-16)/o);i>0&&u>0&&(i!==c||u!==s)&&(c=i,s=u,_.current?.resize(i,u))}});return l.observe(e),()=>l.disconnect()},[]),(0,t.useEffect)(()=>{const e=document.createElement("span");e.style.fontFamily="'Menlo', 'Monaco', 'Courier New', monospace",e.style.fontSize="12px",e.style.lineHeight="1.4",e.style.position="absolute",e.style.visibility="hidden",e.style.whiteSpace="pre",e.textContent="X",document.body.appendChild(e),ie.current={width:e.getBoundingClientRect().width,height:v},document.body.removeChild(e)},[]),(0,t.useEffect)(()=>{const e=P.current;if(!e||ce)return;const t=t=>{if(t.altKey||t.shiftKey||t.metaKey||t.ctrlKey)return;const n=ue.current,o=ie.current,c=_.current;if(!n||!o||!c)return;const s="undefined"!=typeof window?window.getSelection():null;if(s&&!s.isCollapsed)return;const l=e.querySelector("pre");if(!l)return;let i=t.target;for(;i&&i.parentElement!==l;)i=i.parentElement;if(!i)return;if(Array.prototype.indexOf.call(l.children,i)!==n.line)return;const u=Math.max(0,Math.round((t.clientX-i.getBoundingClientRect().left)/o.width))-n.col;0!==u&&c.sendKeys(u>0?"Right":"Left",Math.abs(u))};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},[ce]),(0,t.useEffect)(()=>{const e=P.current;if(!e||!ce)return;const t=(t,n)=>{if(!ie.current)return null;const o=e.querySelector("pre");if(!o)return null;const c=o.getBoundingClientRect(),s=t-c.left-8,l=n-c.top-8;return{col:Math.max(0,Math.floor(s/ie.current.width)),row:Math.max(0,Math.floor(l/ie.current.height))}};let n=!1,o=0,c=null;const s=e=>e.altKey||e.shiftKey,l=l=>{if(s(l))return;const i=t(l.clientX,l.clientY);if(i&&_.current){try{e.focus({preventScroll:!0})}catch{e.focus()}var u;l.preventDefault(),u=l.button,o=1===u?1:2===u?2:0,n=!0,c=i,_.current.sendMouse(i.col,i.row,o,"down")}},i=e=>{if(!n)return;const s=t(e.clientX,e.clientY);s&&_.current&&(c&&s.col===c.col&&s.row===c.row||(c=s,_.current.sendMouse(s.col,s.row,o,"drag")))},u=e=>{if(!n)return;const s=t(e.clientX,e.clientY)??c;n=!1,s&&_.current?(_.current.sendMouse(s.col,s.row,o,"up"),c=null):c=null},f=e=>{const n=t(e.clientX,e.clientY);if(!n||!_.current)return;e.preventDefault();const o=e.deltaY>0?"scroll_down":"scroll_up";_.current.sendMouse(n.col,n.row,0,o),"scroll_up"===o&&he(!1)},p=e=>{s(e)||e.preventDefault()};return e.addEventListener("mousedown",l),e.addEventListener("wheel",f,{passive:!1}),e.addEventListener("contextmenu",p),window.addEventListener("mousemove",i),window.addEventListener("mouseup",u),()=>{e.removeEventListener("mousedown",l),e.removeEventListener("wheel",f),e.removeEventListener("contextmenu",p),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",u)}},[ce]),(0,t.useEffect)(()=>{const e=P.current;if(!e||!ce)return;let t=0,n=0,o=0,c=0,s=0;const l=l=>{if(1!==l.touches.length)return;const i=l.touches[0];if(t=i.clientX,n=i.clientY,o=i.clientY,ie.current){const t=(e.querySelector("pre")??e).getBoundingClientRect(),n=i.clientX-t.left-8,o=i.clientY-t.top-8;c=Math.max(0,Math.floor(n/ie.current.width)),s=Math.max(0,Math.floor(o/ie.current.height))}},i=e=>{if(1!==e.touches.length)return;if(!_.current)return;const l=e.touches[0],i=l.clientY-n,u=l.clientX-t;Math.abs(i)>Math.abs(u)&&e.preventDefault();const f=l.clientY-o;if(Math.abs(f)<20)return;const p=Math.trunc(f/20);o+=20*p;const y=p>0?"scroll_up":"scroll_down";for(let e=0;e<Math.abs(p);e++)_.current.sendMouse(c,s,0,y);"scroll_up"===y&&he(!1)};return e.addEventListener("touchstart",l,{passive:!0}),e.addEventListener("touchmove",i,{passive:!1}),()=>{e.removeEventListener("touchstart",l),e.removeEventListener("touchmove",i)}},[ce]),(0,t.useEffect)(()=>{const e=P.current;e&&B.current&&requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})},[G]);const Le=S??C;(0,t.useEffect)(()=>{if(!Le)return;const e=P.current;if(e)try{e.focus({preventScroll:!0})}catch{e.focus()}},[Le]),(0,t.useEffect)(()=>{const e=P.current;if(!e)return;let t=B.current;const n=()=>{const n=e.scrollHeight-e.scrollTop-e.clientHeight<40;n!==t&&(t=n,B.current=n,H?.(n))};return e.addEventListener("scroll",n,{passive:!0}),()=>e.removeEventListener("scroll",n)},[H]);const He=(0,t.useCallback)(async()=>{if((0,p.revivesAsTwin)(L)&&A)A();else{re(!0);try{const t=await(0,s.reviveNarrative)(e,x);if(t.nid&&t.nid!==x)return void T?.(t.nid);te(!1),_.current?.close();const n=(0,l.createTerminalChannel)({conn:e,nid:x,onFrame:Me,onTerminated:()=>te(!0)});_.current=n,n.start()}catch(e){console.error("Revive failed:",e)}finally{re(!1)}}},[e,x,Me,L,A,T]);oe.current=He;const Ae=(0,t.useCallback)(e=>{if(!_.current)return;if(e.keys)return void _.current.sendKeys(e.keys);if(!e.text)return;const t=e.text.split("\n");for(let e=0;e<t.length;e++)t[e]&&_.current.sendKeys(t[e]),e<t.length-1&&_.current.sendKeys("Enter")},[]),Te=(0,t.useCallback)(e=>{_.current?.sendKeys(e),me(e)},[me]),De=(0,t.useCallback)(e=>{if(_.current)return"transcript"===e.action?(_.current.sendKeys("C-o"),void ke()):void("paste"!==e.action?"clear-history"!==e.action?e.keys&&(_.current.sendKeys(e.keys),me(e.keys)):_.current.clearHistory():Ke())},[ke,me,Ke]);return(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"hidden"},children:[(0,y.jsx)("style",{children:"@keyframes brane-cursor-blink {\n 0%, 45% { opacity: 1; }\n 55%, 100% { opacity: 0; }\n}"}),(0,y.jsx)("style",{children:b}),(0,y.jsxs)("div",{style:{position:"relative",flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[ee&&(0,y.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.85)"},children:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{style:{position:"absolute",left:0,right:0,top:"50%",transform:"translateY(calc(-100% - 36px))",textAlign:"center",color:"#888",fontSize:15,fontFamily:"system-ui, -apple-system, sans-serif",pointerEvents:"none"},children:"Session ended"}),(0,y.jsx)("button",{onClick:()=>He(),disabled:ne,style:{padding:"10px 24px",borderRadius:8,border:"1px solid #4caf50",backgroundColor:ne?"#1c1c1e":"#2e7d32",color:"#fff",fontSize:15,fontWeight:"600",cursor:ne?"default":"pointer",opacity:ne?.6:1,fontFamily:"system-ui, -apple-system, sans-serif"},children:ne?"utility"===L?"Restarting\u2026":"Reviving\u2026":(0,p.revivesAsTwin)(L)?"/twin":"utility"===L?"Restart":"Revive"})]})}),(0,y.jsx)("div",{ref:P,tabIndex:0,style:Object.assign({flex:1,minHeight:0,overflow:ce?"hidden":"auto",backgroundColor:"#111",outline:"none",WebkitOverflowScrolling:"touch",touchAction:ce?"none":"auto"},ce?{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-start"}:{}),children:(0,y.jsx)("pre",{style:{margin:ce?"auto":0,padding:8,fontFamily:"'Menlo', 'Monaco', 'Courier New', monospace",fontSize:12,lineHeight:h,color:"#e0e0e0",whiteSpace:"pre",wordWrap:"normal",overflowX:"auto",cursor:ce?"pointer":"default"}})})]}),J&&(0,y.jsxs)("div",{style:{padding:"8px 10px",backgroundColor:"#1a1a1a",borderTop:"1px solid #444",flexShrink:0},children:[(0,y.jsx)("div",{style:{color:"#aaa",fontSize:12,marginBottom:6,fontFamily:"monospace"},children:"Paste here (long-press \u2192 Paste), or type and Send"}),(0,y.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,y.jsx)("textarea",{autoFocus:!0,ref:V,rows:2,style:{flex:1,backgroundColor:"#111",color:"#e0e0e0",border:"1px solid #555",borderRadius:6,padding:6,fontFamily:"'Menlo', 'Monaco', 'Courier New', monospace",fontSize:13,resize:"vertical"}}),(0,y.jsx)("button",{onClick:()=>{const e=V.current?.value??"";e&&_.current?.sendPaste(e),Q(!1)},style:{padding:"6px 10px",borderRadius:6,border:"1px solid #555",backgroundColor:"#252525",color:"#ccc",fontSize:13,fontFamily:"monospace",cursor:"pointer"},children:"Send"}),(0,y.jsx)("button",{onClick:()=>Q(!1),style:{padding:"6px 10px",borderRadius:6,border:"1px solid #555",backgroundColor:"#1e1e1e",color:"#888",fontSize:13,fontFamily:"monospace",cursor:"pointer"},children:"Cancel"})]})]}),G&&(0,y.jsx)(i.default,{sendKeys:Te}),(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",gap:8,padding:"6px 8px",paddingBottom:"max(6px, env(safe-area-inset-bottom))",minHeight:53,boxSizing:"border-box",backgroundColor:"#1a1a1a",borderTop:"1px solid rgb(216, 216, 216)",flexShrink:0,alignItems:"center"},children:[(0,y.jsx)("button",{onClick:()=>$(e=>!e),style:{padding:"6px 8px",borderRadius:6,border:"1px solid "+(G?"#4caf50":"#555"),backgroundColor:G?"#2e7d32":"#252525",color:G?"#fff":"#ccc",fontSize:15,lineHeight:"18px",fontFamily:"monospace",cursor:"pointer",whiteSpace:"nowrap"},children:"\ud83c\udfb9"}),(0,y.jsx)("div",{style:{width:1,height:24,backgroundColor:"#333",flexShrink:0}}),(0,y.jsx)(u.default,{onSelect:Ae}),(0,y.jsx)(f.default,{onControl:De}),(0,y.jsx)("div",{style:{width:1,height:24,backgroundColor:"#333",flexShrink:0}}),k.map(e=>(0,y.jsx)(K,{onPress:()=>_.current?.sendKeys(e.keys),style:{padding:"6px 8px",borderRadius:6,border:"1px solid #555",backgroundColor:"#1e1e1e",color:"#aaa",fontSize:14,fontFamily:"monospace",cursor:"pointer",whiteSpace:"nowrap",minWidth:28,textAlign:"center"},children:e.label},e.label)),(0,y.jsx)(K,{onPress:()=>_.current?.sendKeys("Enter"),style:{padding:"6px 8px",borderRadius:6,border:"1px solid #555",backgroundColor:"#1e1e1e",color:"#aaa",fontSize:14,fontFamily:"monospace",cursor:"pointer",whiteSpace:"nowrap",minWidth:34,textAlign:"center"},children:"Ret"})]})]})});var H=(0,t.memo)(L)},762,[11,116,165,763,764,745,749,765,766,768,769,6]);
|
|
866
866
|
__d(function(_g,_r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AnsiUp",{enumerable:!0,get:function(){return r}});var t,n,i,s,l=this&&this.__makeTemplateObject||function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t};!(function(t){t[t.EOS=0]="EOS",t[t.Text=1]="Text",t[t.Incomplete=2]="Incomplete",t[t.ESC=3]="ESC",t[t.Unknown=4]="Unknown",t[t.SGR=5]="SGR",t[t.OSCURL=6]="OSCURL"})(t||(t={}));class r{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer='',this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle='font-weight:bold',this.faintStyle='opacity:0.7',this.italicStyle='font-style:italic',this.underlineStyle='text-decoration:underline'}set use_classes(t){this._use_classes=t}get use_classes(){return this._use_classes}set url_allowlist(t){this._url_allowlist=t}get url_allowlist(){return this._url_allowlist}set escape_html(t){this._escape_html=t}get escape_html(){return this._escape_html}set boldStyle(t){this._boldStyle=t}get boldStyle(){return this._boldStyle}set faintStyle(t){this._faintStyle=t}get faintStyle(){return this._faintStyle}set italicStyle(t){this._italicStyle=t}get italicStyle(){return this._italicStyle}set underlineStyle(t){this._underlineStyle=t}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(t=>{t.forEach(t=>{this.palette_256.push(t)})});let t=[0,95,135,175,215,255];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let s=0;s<6;++s){let l={rgb:[t[n],t[i],t[s]],class_name:'truecolor'};this.palette_256.push(l)}let n=8;for(let t=0;t<24;++t,n+=10){let t={rgb:[n,n,n],class_name:'truecolor'};this.palette_256.push(t)}}escape_txt_for_html(t){return this._escape_html?t.replace(/[&<>"']/gm,t=>"&"===t?"&":"<"===t?"<":">"===t?">":"\""===t?""":"'"===t?"'":void 0):t}append_buffer(t){var n=this._buffer+t;this._buffer=n}get_next_packet(){var r={kind:t.EOS,text:'',url:''},_=this._buffer.length;if(0==_)return r;var c=this._buffer.indexOf("\x1b");if(-1==c)return r.kind=t.Text,r.text=this._buffer,this._buffer='',r;if(c>0)return r.kind=t.Text,r.text=this._buffer.slice(0,c),this._buffer=this._buffer.slice(c),r;if(0==c){if(_<3)return r.kind=t.Incomplete,r;var u=this._buffer.charAt(1);if('['!=u&&']'!=u&&'('!=u)return r.kind=t.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;if('['==u){this._csi_regex||(this._csi_regex=h(n||(n=l(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \x1b[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \x1b[ # CSI\n [ -~]* # anything legal\n ([\0-\x1f:]) # anything illegal\n )\n "],["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]))));let i=this._buffer.match(this._csi_regex);if(null===i)return r.kind=t.Incomplete,r;if(i[4])return r.kind=t.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;''!=i[1]||'m'!=i[3]?r.kind=t.Unknown:r.kind=t.SGR,r.text=i[2];var o=i[0].length;return this._buffer=this._buffer.slice(o),r}if(']'==u){if(_<4)return r.kind=t.Incomplete,r;if('8'!=this._buffer.charAt(2)||';'!=this._buffer.charAt(3))return r.kind=t.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;this._osc_st||(this._osc_st=f(i||(i=l(["\n (?: # legal sequence\n (\x1b\\) # ESC | # alternate\n (\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-\x06] # anything illegal\n | # alternate\n [\b-\x1a] # anything illegal\n | # alternate\n [\x1c-\x1f] # anything illegal\n )\n "],["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "])))),this._osc_st.lastIndex=0;{let n=this._osc_st.exec(this._buffer);if(null===n)return r.kind=t.Incomplete,r;if(n[3])return r.kind=t.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r}{let n=this._osc_st.exec(this._buffer);if(null===n)return r.kind=t.Incomplete,r;if(n[3])return r.kind=t.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r}this._osc_regex||(this._osc_regex=h(s||(s=l(["\n ^ # beginning of line\n #\n \x1b]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\x1b\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n \x1b]8;; # OSC Hyperlink End\n (?: # ST\n (?:\x1b\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n "],["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]))));let n=this._buffer.match(this._osc_regex);if(null===n)return r.kind=t.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;r.kind=t.OSCURL,r.url=n[1],r.text=n[2];o=n[0].length;return this._buffer=this._buffer.slice(o),r}if('('==u)return r.kind=t.Unknown,this._buffer=this._buffer.slice(3),r}}ansi_to_html(n){this.append_buffer(n);for(var i=[];;){var s=this.get_next_packet();if(s.kind==t.EOS||s.kind==t.Incomplete)break;s.kind!=t.ESC&&s.kind!=t.Unknown&&(s.kind==t.Text?i.push(this.transform_to_html(this.with_state(s))):s.kind==t.SGR?this.process_ansi(s):s.kind==t.OSCURL&&i.push(this.process_hyperlink(s)))}return i.join("")}with_state(t){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:t.text}}process_ansi(t){let n=t.text.split(';');for(;n.length>0;){let t=n.shift(),i=parseInt(t,10);if(isNaN(i)||0===i)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(1===i)this.bold=!0;else if(2===i)this.faint=!0;else if(3===i)this.italic=!0;else if(4===i)this.underline=!0;else if(21===i)this.bold=!1;else if(22===i)this.faint=!1,this.bold=!1;else if(23===i)this.italic=!1;else if(24===i)this.underline=!1;else if(39===i)this.fg=null;else if(49===i)this.bg=null;else if(i>=30&&i<38)this.fg=this.ansi_colors[0][i-30];else if(i>=40&&i<48)this.bg=this.ansi_colors[0][i-40];else if(i>=90&&i<98)this.fg=this.ansi_colors[1][i-90];else if(i>=100&&i<108)this.bg=this.ansi_colors[1][i-100];else if((38===i||48===i)&&n.length>0){let t=38===i,s=n.shift();if('5'===s&&n.length>0){let i=parseInt(n.shift(),10);i>=0&&i<=255&&(t?this.fg=this.palette_256[i]:this.bg=this.palette_256[i])}if('2'===s&&n.length>2){let i=parseInt(n.shift(),10),s=parseInt(n.shift(),10),l=parseInt(n.shift(),10);if(i>=0&&i<=255&&s>=0&&s<=255&&l>=0&&l<=255){let n={rgb:[i,s,l],class_name:'truecolor'};t?this.fg=n:this.bg=n}}}}}transform_to_html(t){let n=t.text;if(0===n.length)return n;if(n=this.escape_txt_for_html(n),!(t.bold||t.italic||t.faint||t.underline||null!==t.fg||null!==t.bg))return n;let i=[],s=[],l=t.fg,r=t.bg;t.bold&&i.push(this._boldStyle),t.faint&&i.push(this._faintStyle),t.italic&&i.push(this._italicStyle),t.underline&&i.push(this._underlineStyle),this._use_classes?(l&&('truecolor'!==l.class_name?s.push(`${l.class_name}-fg`):i.push(`color:rgb(${l.rgb.join(',')})`)),r&&('truecolor'!==r.class_name?s.push(`${r.class_name}-bg`):i.push(`background-color:rgb(${r.rgb.join(',')})`))):(l&&i.push(`color:rgb(${l.rgb.join(',')})`),r&&i.push(`background-color:rgb(${r.rgb})`));let h='',f='';return s.length&&(h=` class="${s.join(' ')}"`),i.length&&(f=` style="${i.join(';')}"`),`<span${f}${h}>${n}</span>`}process_hyperlink(t){let n=t.url.split(':');return n.length<1?'':this._url_allowlist[n[0]]?`<a href="${this.escape_txt_for_html(t.url)}">${this.escape_txt_for_html(t.text)}</a>`:''}}function h(t,...n){let i=t.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,'');return new RegExp(i)}function f(t,...n){let i=t.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,'');return new RegExp(i,'g')}},763,[]);
|
|
867
867
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"BLOCK_GLYPH_RE",{enumerable:!0,get:function(){return s}}),e.blockGlyphClass=$,e.paintBlockGlyphs=function(t){return p.test(t)?t.replace(s,t=>`<span class="tb ${$(t.charCodeAt(0))}">${t}</span>`):t},e.blockGlyphStylesheet=function(t){const n=[`.tb{display:inline-block;width:1ch;height:${t}em;overflow:hidden;vertical-align:top;-webkit-text-fill-color:transparent}`];for(const[t,o]of Object.entries(l))n.push(`.${$(+t)}{background:${o}}`);return n.join("\n")};const t="currentColor",n="transparent";function o(o,c){const l=+(100*c).toFixed(4)+"%";return`linear-gradient(to ${o},${t} ${l},${n} ${l})`}function c(o,c,l,s){const p=o=>o?t:n;return`conic-gradient(at 50% 50%,${p(o)} 0 25%,${p(c)} 0 50%,${p(l)} 0 75%,${p(s)} 0)`}const l={9600:o("bottom",.5),9601:o("top",.125),9602:o("top",.25),9603:o("top",.375),9604:o("top",.5),9605:o("top",.625),9606:o("top",.75),9607:o("top",.875),9608:t,9609:o("right",.875),9610:o("right",.75),9611:o("right",.625),9612:o("right",.5),9613:o("right",.375),9614:o("right",.25),9615:o("right",.125),9616:o("left",.5),9617:`color-mix(in srgb,${t} 25%,${n})`,9618:`color-mix(in srgb,${t} 50%,${n})`,9619:`color-mix(in srgb,${t} 75%,${n})`,9620:o("bottom",.125),9621:o("left",.125),9622:c(!1,!1,!0,!1),9623:c(!1,!0,!1,!1),9624:c(!1,!1,!1,!0),9625:c(!1,!0,!0,!0),9626:c(!1,!0,!1,!0),9627:c(!0,!1,!0,!0),9628:c(!0,!0,!1,!0),9629:c(!0,!1,!1,!1),9630:c(!0,!1,!0,!1),9631:c(!0,!0,!0,!1)},s=/[\u2580-\u259f]/g,p=/[\u2580-\u259f]/;function $(t){return`tb-${t.toString(16)}`}},764,[]);
|
package/expo/dist/index.html
CHANGED
|
@@ -172,6 +172,6 @@
|
|
|
172
172
|
</noscript>
|
|
173
173
|
<!-- The root element for your Expo app. -->
|
|
174
174
|
<div id="root"></div>
|
|
175
|
-
<script src="/_expo/static/js/web/entry-
|
|
175
|
+
<script src="/_expo/static/js/web/entry-523ef6a002ad040cec40c370616a0e15.js" defer></script>
|
|
176
176
|
</body>
|
|
177
177
|
</html>
|
package/expo/dist/sw.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
// in `dist/sw.js` by scripts/gen-precache.mjs, which reads the export that was
|
|
5
5
|
// actually produced. Editing them here has no effect on a build; see that script
|
|
6
6
|
// for why the list is generated rather than maintained by hand.
|
|
7
|
-
const CACHE_NAME = "brane-
|
|
7
|
+
const CACHE_NAME = "brane-13c7975b9be1";
|
|
8
8
|
const PRECACHE = [
|
|
9
9
|
"/",
|
|
10
|
-
"/_expo/static/js/web/entry-
|
|
10
|
+
"/_expo/static/js/web/entry-523ef6a002ad040cec40c370616a0e15.js",
|
|
11
11
|
"/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png",
|
|
12
12
|
"/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png",
|
|
13
13
|
"/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png",
|