@10play/expo-air 0.10.0 → 0.10.2

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.
@@ -534,13 +534,45 @@ __d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{v
534
534
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=(r(d[1]).default,!1),o=0;function f(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u||(u=!0,0===e[0]&&(n.default.vibrate(400),e=e.slice(1)),0!==e.length?setTimeout(()=>l(++o,e,t,1),e[0]):u=!1)}function l(e,t,f,v){if(u&&e===o){if(n.default.vibrate(400),v>=t.length){if(!f)return void(u=!1);v=0}setTimeout(()=>l(e,t,f,v+1),t[v])}}var v={vibrate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!u)if('number'==typeof e)n.default.vibrate(e);else{if(!Array.isArray(e))throw new Error('Vibration pattern should be a number or array');f(e,t)}},cancel:function(){u=!1}},c=v},482,[483,60]);
535
535
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e=r(d[0]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var t,n=((t=e)&&t.__esModule?t:{default:t}).default},483,[484]);
536
536
  __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])).getEnforcing('Vibration')},484,[50]);
537
- __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}),_e.BubbleContent=function(e){e.size,e.color;var T=e.expanded,C=void 0!==T&&T,O=e.serverUrl,f=void 0===O?"ws://localhost:3847":O,R=(0,s.useState)("disconnected"),x=(0,n.default)(R,2),y=x[0],I=x[1],P=(0,s.useState)([]),D=(0,n.default)(P,2),N=D[0],k=D[1],w=(0,s.useState)([]),B=(0,n.default)(w,2),j=B[0],L=B[1],U=(0,s.useState)("main"),G=(0,n.default)(U,2),V=G[0],M=G[1],Y=(0,s.useState)([]),W=(0,n.default)(Y,2),H=W[0],Z=W[1],q=(0,s.useState)(!1),z=(0,n.default)(q,2),X=z[0],F=z[1],K=(0,s.useState)(),$=(0,n.default)(K,2),J=$[0],Q=$[1],ee=(0,s.useState)("chat"),te=(0,n.default)(ee,2),ne=te[0],ae=te[1],re=(0,s.useState)(!1),se=(0,n.default)(re,2),oe=se[0],ie=se[1],ce=(0,s.useState)([]),le=(0,n.default)(ce,2),ue=le[0],de=le[1],he=(0,s.useState)(null),Se=(0,n.default)(he,2),pe=Se[0],me=Se[1],Te=(0,s.useRef)(!1),be=(0,s.useRef)(0),ge=(0,s.useRef)([]),Ce=(0,s.useRef)(null),Oe=(0,s.useRef)(null);(0,s.useEffect)(()=>{C&&"chat"===ne&&setTimeout(()=>Oe.current?.focus(),100)},[C]);var fe=J?.match(/\/pull\/(\d+)/)?.[1];(0,s.useEffect)(()=>{console.log("[expo-air] Connecting to:",f?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,h.createWebSocketClient)({url:f,onStatusChange:I,onMessage:xe,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[f]),(0,s.useEffect)(()=>(0,S.setupTapHandler)((e,t)=>{var n=(0,h.getWebSocketClient)();n&&!n.isConnected()&&n.connect()}),[]);var Re=(0,s.useCallback)((e,t)=>{var n=ge.current;if(n.length>0){var s={type:"assistant_parts",promptId:e,parts:n,isComplete:t,timestamp:Date.now()};k(e=>[...e,s])}ge.current=[],Ce.current=null,L([])},[]),xe=(0,s.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==Ce.current&&(ge.current.length>0&&Ce.current&&Re(Ce.current,!1),Ce.current=e.promptId),!e.done&&e.chunk){var t=ge.current,n=t[t.length-1];"text"===n?.type?(n.content+=e.chunk,ge.current=[...t]):ge.current=[...t,{type:"text",id:"text-"+be.current++,content:e.chunk}],L([...ge.current])}break;case"tool":if("started"!==e.status){var s={type:"tool",id:"tool-"+be.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};ge.current=[...ge.current,s],L([...ge.current])}break;case"result":if(ge.current.length>0){var o={type:"assistant_parts",promptId:e.promptId,parts:ge.current,isComplete:!0,timestamp:e.timestamp};if(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error){var c={...e,result:void 0};k(e=>[...e,o,c])}else k(e=>[...e,o])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&k(t=>[...t,e]);ge.current=[],Ce.current=null,L([]);break;case"error":if(ge.current.length>0&&Ce.current){var l={type:"assistant_parts",promptId:Ce.current,parts:ge.current,isComplete:!1,timestamp:Date.now()};k(t=>[...t,l,e])}else k(t=>[...t,e]);ge.current=[],Ce.current=null,L([]);break;case"status":break;case"session_cleared":k([]),ge.current=[],Ce.current=null,be.current=0,L([]);break;case"stopped":ge.current.length>0&&Ce.current?Re(Ce.current,!1):(ge.current=[],Ce.current=null,L([]));break;case"history":var u=e.entries.flatMap(e=>"user"===e.role?[{type:"user_prompt",content:e.content,timestamp:e.timestamp}]:"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]);k(u);break;case"git_status":M(e.branchName),Z(e.changes),F(e.hasPR),Q(e.prUrl);break;case"branches_list":de(e.branches);break;case"branch_switched":case"branch_created":e.success?(ie(!1),me(null)):e.error&&me(e.error)}},[Re]),Ae=(0,s.useCallback)((function(){var e=(0,t.default)(function*(e){if(!Te.current){var t=yield(0,S.requestPushToken)();if(t){var n=(0,h.getWebSocketClient)();n?.isConnected()&&(n.sendPushToken(t),Te.current=!0)}}k(t=>[...t,{type:"user_prompt",content:e,timestamp:Date.now()}]),ge.current=[],Ce.current=null,L([]);var s=(0,h.getWebSocketClient)();s&&s.sendPrompt(e)});return function(t){return e.apply(this,arguments)}})(),[]),ve=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestNewSession()},[]),ye=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestStop()},[]),Ee=(0,s.useCallback)(()=>{ae("chat"),Ae("Look at my current git changes and create a commit with a good conventional commit message. Stage all changes and commit them.")},[Ae]),Ie=(0,s.useCallback)(()=>{ae("chat"),Ae("Create a pull request for my current branch. First commit any uncommitted changes with a good message. Then generate a title and description based on the commits, and use `gh pr create --title \"...\" --body \"...\"` (non-interactive mode) to create it. Push to remote first if needed.")},[Ae]),Pe=(0,s.useCallback)(()=>{J&&o.Linking.openURL(J)},[J]),De=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestDiscardChanges()},[]),Ne=(0,s.useCallback)(()=>{if(ie(e=>!e),!oe){var e=(0,h.getWebSocketClient)();e&&e.requestBranches()}},[oe]),ke=(0,s.useCallback)(e=>{me(null);var t=(0,h.getWebSocketClient)();t&&t.requestSwitchBranch(e)},[]),we=(0,s.useCallback)(e=>{me(null);var t=(0,h.getWebSocketClient)();t&&t.requestCreateBranch(e)},[]);if(!C)return(0,b.jsx)(o.View,{style:_.collapsedPill,children:(0,b.jsx)(E,{status:y})});return(0,b.jsxs)(o.View,{style:_.expanded,children:[(0,b.jsx)(A,{status:y,branchName:V,onBranchPress:Ne}),(0,b.jsx)(v,{activeTab:ne,onTabChange:ae,onNewSession:ve,canStartNew:"connected"===y,hasPR:X,hasChanges:H.length>0,prNumber:fe,onCreatePR:Ie,onCommit:Ee,onViewPR:Pe}),(0,b.jsx)(o.View,{style:_.body,children:"chat"===ne?(0,b.jsx)(l.ResponseArea,{messages:N,currentParts:j}):(0,b.jsx)(u.GitChangesTab,{changes:H,onDiscard:De})}),"chat"===ne&&(0,b.jsx)(c.PromptInput,{ref:Oe,onSubmit:Ae,onStop:ye,disabled:"disconnected"===y,isProcessing:"processing"===y}),oe&&(0,b.jsx)(p.BranchSwitcher,{branches:ue,currentBranch:V,onSelect:ke,onCreate:we,onClose:()=>{ie(!1),me(null)},error:pe})]})};var t=e(r(d[0])),n=e(r(d[1])),s=r(d[2]),o=r(d[3]),c=r(d[4]),l=r(d[5]),u=r(d[6]),h=r(d[7]),S=r(d[8]),p=r(d[9]),T=r(d[10]),b=r(d[11]),C=o.Animated.Text,O=o.Animated.View,f=o.NativeModules.WidgetBridge,R=o.NativeModules.ExpoAir;function x(){try{f?.collapse?f.collapse():R?.collapse?R.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}function A(e){var t=e.status,n=e.branchName,s=e.onBranchPress,c={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO};return(0,b.jsxs)(o.View,{style:_.header,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:x,style:_.closeButton,children:(0,b.jsx)(o.Text,{style:_.closeButtonText,children:"\u2715"})}),(0,b.jsxs)(o.TouchableOpacity,{style:_.branchButton,onPress:s,children:[(0,b.jsx)(o.Text,{style:_.branchName,numberOfLines:1,children:n}),(0,b.jsx)(o.Text,{style:_.branchChevron,children:"\u25be"})]}),(0,b.jsx)(o.View,{style:[_.statusDot,{backgroundColor:c[t]}]})]})}function v(e){var t=e.activeTab,n=e.onTabChange,s=e.onNewSession,c=e.canStartNew,l=e.hasPR,u=e.hasChanges,h=e.prNumber,S=e.onCreatePR,p=e.onCommit,T=e.onViewPR;return(0,b.jsxs)(o.View,{style:_.tabBar,children:[(0,b.jsxs)(o.View,{style:_.tabButtons,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("chat"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"chat"===t?_.tabTextActive:_.tabTextInactive],children:"Chat"})}),(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("changes"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"changes"===t?_.tabTextActive:_.tabTextInactive],children:"Changes"})})]}),"chat"===t?(0,b.jsx)(o.TouchableOpacity,{onPress:s,style:[_.ctaButton,!c&&_.ctaButtonDisabled],disabled:!c,children:(0,b.jsx)(o.Text,{style:[_.ctaText,!c&&_.ctaTextDisabled],children:"New"})}):!l&&u?(0,b.jsx)(y,{onPress:S,children:"Create PR"}):l&&u?(0,b.jsx)(y,{onPress:p,children:"Commit"}):l&&!u&&h?(0,b.jsxs)(y,{onPress:T,children:["#",h]}):null]})}function y(e){var t=e.children,n=e.onPress,c=(0,s.useRef)(new o.Animated.Value(.6)).current;return(0,s.useEffect)(()=>{var e=o.Animated.loop(o.Animated.sequence([o.Animated.timing(c,{toValue:.9,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(c,{toValue:.6,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>e.stop()},[c]),(0,b.jsx)(o.TouchableOpacity,{onPress:n,style:_.ctaButton,activeOpacity:.7,children:(0,b.jsx)(C,{style:[_.ctaText,{opacity:c}],children:t})})}function E(e){var t=e.status,n={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO},c="processing"===t||"connecting"===t,l=(0,s.useRef)(new o.Animated.Value(1)).current,u=(0,s.useRef)(new o.Animated.Value(.4)).current;return(0,s.useEffect)(()=>{if(c){var e=o.Animated.loop(o.Animated.sequence([o.Animated.parallel([o.Animated.timing(l,{toValue:1.3,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(u,{toValue:0,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]),o.Animated.parallel([o.Animated.timing(l,{toValue:1,duration:0,useNativeDriver:!0}),o.Animated.timing(u,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}l.setValue(1),u.setValue(.4)},[c,l,u]),(0,b.jsxs)(o.View,{style:_.indicatorContainer,children:[(0,b.jsx)(o.View,{style:[_.indicator,{backgroundColor:n[t]}]}),c&&(0,b.jsx)(O,{style:[_.indicatorRing,{borderColor:n[t],transform:[{scale:l}],opacity:u}]})]})}var _=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4},expanded:{flex:1,backgroundColor:T.COLORS.BACKGROUND,borderRadius:T.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},header:{flexDirection:"row",alignItems:"center",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},closeButton:{width:T.SIZES.CLOSE_BUTTON,height:T.SIZES.CLOSE_BUTTON,borderRadius:T.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:T.SPACING.MD},closeButtonText:{color:"transparent",fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:T.COLORS.TEXT_SECONDARY,fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:T.COLORS.TEXT_MUTED,fontSize:T.TYPOGRAPHY.SIZE_SM,marginLeft:T.SPACING.XS},statusDot:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2,marginLeft:T.SPACING.MD},ctaButton:{paddingHorizontal:T.SIZES.CTA_PADDING_H,paddingVertical:T.SIZES.CTA_PADDING_V,borderRadius:T.LAYOUT.BORDER_RADIUS_SM,backgroundColor:T.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:T.COLORS.TEXT_PRIMARY,fontSize:T.TYPOGRAPHY.SIZE_SM,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6},tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:T.SPACING.XL},tabText:{fontSize:T.TYPOGRAPHY.SIZE_LG,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:T.COLORS.TEXT_PRIMARY},tabTextInactive:{color:T.COLORS.TEXT_MUTED},body:{flex:1,backgroundColor:T.COLORS.BACKGROUND_ELEVATED}})},485,[346,29,63,258,486,488,489,490,491,492,487,250]);
538
- __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PromptInput",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),s=r(d[2]),l=r(d[3]),u=r(d[4]),c=(0,n.forwardRef)((e,t)=>{var c=e.onSubmit,R=e.onStop,h=e.disabled,S=void 0!==h&&h,C=e.isProcessing,p=void 0!==C&&C,I=(0,n.useState)(""),f=(0,o.default)(I,2),y=f[0],B=f[1],_=(0,n.useRef)(null);(0,n.useImperativeHandle)(t,()=>({focus:()=>_.current?.focus()}));var L=()=>{var e=y.trim();!e||S||p||(c(e),B(""))},w=y.trim().length>0&&!S&&!p;return(0,u.jsxs)(s.View,{style:O.container,children:[(0,u.jsx)(s.TextInput,{ref:_,style:O.input,placeholder:"Ask Claude...",placeholderTextColor:l.COLORS.TEXT_TERTIARY,value:y,onChangeText:B,onSubmitEditing:L,editable:!p,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),p?(0,u.jsx)(s.TouchableOpacity,{style:[O.submitButton,O.stopButton],onPress:R,activeOpacity:.7,children:(0,u.jsx)(b,{})}):(0,u.jsx)(s.TouchableOpacity,{style:[O.submitButton,!w&&O.submitButtonDisabled],onPress:L,disabled:!w,activeOpacity:.7,children:(0,u.jsx)(T,{})})]})});function T(){return(0,u.jsxs)(s.View,{style:O.arrowIcon,children:[(0,u.jsx)(s.View,{style:O.arrowLine}),(0,u.jsx)(s.View,{style:O.arrowHead})]})}function b(){return(0,u.jsx)(s.View,{style:O.stopIcon})}var O=s.StyleSheet.create({container:{flexDirection:"row",alignItems:"flex-end",paddingHorizontal:l.LAYOUT.CONTENT_PADDING_H,paddingVertical:l.SPACING.MD,borderTopWidth:1,borderTopColor:l.COLORS.BORDER,backgroundColor:l.COLORS.BACKGROUND},input:{flex:1,backgroundColor:l.COLORS.BACKGROUND_INPUT,borderRadius:22,paddingHorizontal:18,paddingVertical:l.SPACING.MD,color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_LG,maxHeight:100},submitButton:{width:l.SIZES.SUBMIT_BUTTON,height:l.SIZES.SUBMIT_BUTTON,borderRadius:l.SIZES.SUBMIT_BUTTON/2,backgroundColor:l.COLORS.BACKGROUND_BUTTON,alignItems:"center",justifyContent:"center",marginLeft:l.SPACING.SM+2},submitButtonDisabled:{opacity:.4},stopButton:{backgroundColor:l.COLORS.STATUS_NEUTRAL},stopIcon:{width:12,height:12,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:2},arrowIcon:{width:16,height:16,alignItems:"center",justifyContent:"center"},arrowLine:{width:2,height:10,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:1},arrowHead:{position:"absolute",top:0,width:0,height:0,borderLeftWidth:5,borderRightWidth:5,borderBottomWidth:6,borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:l.COLORS.TEXT_PRIMARY}})},486,[29,63,258,487,250]);
539
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SPACING",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"LAYOUT",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"COLORS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"TYPOGRAPHY",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"SIZES",{enumerable:!0,get:function(){return D}});var T={XS:4,SM:8,MD:12,LG:16,XL:20,XXL:24},_={CONTENT_PADDING_H:T.LG,SECTION_PADDING_V:T.MD,ELEMENT_GAP:T.MD,BORDER_RADIUS_LG:32,BORDER_RADIUS_MD:20,BORDER_RADIUS_SM:14},E={BACKGROUND:"#000",BACKGROUND_ELEVATED:"rgba(255,255,255,0.03)",BACKGROUND_INTERACTIVE:"rgba(255,255,255,0.08)",BACKGROUND_INPUT:"rgba(255,255,255,0.1)",BACKGROUND_BUTTON:"rgba(255,255,255,0.15)",TEXT_PRIMARY:"#fff",TEXT_SECONDARY:"rgba(255,255,255,0.6)",TEXT_TERTIARY:"rgba(255,255,255,0.5)",TEXT_MUTED:"rgba(255,255,255,0.4)",BORDER:"rgba(255,255,255,0.08)",STATUS_SUCCESS:"#30D158",STATUS_ERROR:"#FF3B30",STATUS_INFO:"#007AFF",STATUS_NEUTRAL:"#8E8E93"},S={SIZE_XS:11,SIZE_SM:13,SIZE_MD:14,SIZE_LG:15,SIZE_XL:17,WEIGHT_NORMAL:"400",WEIGHT_MEDIUM:"500",WEIGHT_SEMIBOLD:"600"},D={STATUS_DOT:8,CLOSE_BUTTON:30,SUBMIT_BUTTON:40,CTA_PADDING_V:6,CTA_PADDING_H:12}},487,[]);
540
- __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}),_e.ResponseArea=function(e){var l=e.messages,s=e.currentParts,u=(0,n.useRef)(null),h=(0,n.useState)(!0),T=(0,t.default)(h,2),S=T[0],x=T[1],f=(0,n.useRef)(0),p=(0,n.useRef)(0),C=(0,n.useCallback)(e=>{var t=e.nativeEvent,n=t.contentOffset,l=t.contentSize,i=t.layoutMeasurement,s=l.height-i.height-n.y;x(s<50)},[]),y=(0,n.useCallback)((e,t)=>{f.current=t},[]),I=(0,n.useCallback)(e=>{p.current=e.nativeEvent.layout.height},[]);(0,n.useEffect)(()=>{if(S){var e=setTimeout(()=>{u.current?.scrollToEnd({animated:!1})},16);return()=>clearTimeout(e)}},[l,s,S]),(0,n.useEffect)(()=>{var e=l[l.length-1];"user_prompt"===e?.type&&(u.current?.scrollToEnd({animated:!0}),x(!0))},[l]),(0,n.useEffect)(()=>{var e=i.Keyboard.addListener("keyboardWillShow",()=>{S&&setTimeout(()=>{u.current?.scrollToEnd({animated:!0})},100)});return()=>e.remove()},[S]);var G=(0,n.useCallback)(()=>{u.current?.scrollToEnd({animated:!0}),x(!0)},[]);if(!(l.length>0||s.length>0))return(0,o.jsx)(i.View,{style:A.emptyContainer,children:(0,o.jsx)(i.Text,{style:A.emptyText,children:"Send a prompt to start coding with Claude"})});return(0,o.jsxs)(i.View,{style:A.wrapper,children:[(0,o.jsxs)(i.ScrollView,{ref:u,style:A.container,contentContainerStyle:A.content,showsVerticalScrollIndicator:!0,onScroll:C,onContentSizeChange:y,onLayout:I,scrollEventThrottle:16,children:[l.map((e,t)=>(0,o.jsx)(c,{message:e},t)),s.length>0&&(0,o.jsx)(P,{parts:s,isStreaming:!0})]}),!S&&(0,o.jsx)(i.TouchableOpacity,{style:A.scrollButton,onPress:G,activeOpacity:.8,children:(0,o.jsx)(i.Text,{style:A.scrollButtonText,children:"\u2193"})})]})};var t=e(r(d[0])),n=r(d[1]),l=e(n),i=r(d[2]),s=r(d[3]),o=r(d[4]);function c(e){var t=e.message;switch(t.type){case"stream":case"status":default:return null;case"tool":return(0,o.jsx)(O,{tool:t});case"result":return(0,o.jsx)(b,{result:t});case"error":return(0,o.jsx)(i.View,{style:A.errorContainer,children:(0,o.jsx)(i.Text,{style:A.errorText,children:t.message})});case"user_prompt":return(0,o.jsx)(u,{message:t});case"history_result":return(0,o.jsx)(h,{message:t});case"assistant_parts":return(0,o.jsx)(C,{message:t});case"system_message":return(0,o.jsx)(T,{message:t})}}function u(e){var t=e.message;return(0,o.jsx)(i.View,{style:A.userPromptContainer,children:(0,o.jsx)(i.Text,{style:A.userPromptText,selectable:!0,children:t.content})})}function h(e){var t=e.message;return(0,o.jsx)(i.View,{style:A.resultContainer,children:(0,o.jsx)(S,{content:t.content})})}function T(e){var t=e.message;return"error"===t.messageType?(0,o.jsx)(i.View,{style:A.errorContainer,children:(0,o.jsx)(i.Text,{style:A.errorText,children:t.content})}):(0,o.jsx)(i.View,{style:A.systemContainer,children:(0,o.jsx)(i.Text,{style:A.systemText,children:t.content})})}function S(e){for(var n=e.content,l=e.isStreaming,c=n.split('\n'),u=[],h=0;h<c.length;){var T=c[h],S=T.trim();if(S.startsWith('```')){var f=[],p=S.slice(3).trim();for(h++;h<c.length&&!c[h].trim().startsWith('```');)f.push(c[h]),h++;u.push((0,o.jsxs)(i.View,{style:A.codeBlock,children:[p&&(0,o.jsx)(i.Text,{style:A.codeLang,children:p}),(0,o.jsx)(i.Text,{style:A.codeText,selectable:!0,children:f.join('\n')})]},`code-${h}`)),h++}else{var P=S.match(/^(#{1,6})\s+(.+)$/);if(P){var C=P[1].length,y=C<=2?A.heading1:C<=4?A.heading2:A.heading3;u.push((0,o.jsx)(i.Text,{style:y,selectable:!0,children:x(P[2])},h)),h++}else if(S.startsWith('> ')||'>'===S){for(var I=[];h<c.length&&(c[h].trim().startsWith('> ')||'>'===c[h].trim());){var G=c[h].trim().startsWith('> ')?c[h].trim().slice(2):'';I.push(G),h++}u.push((0,o.jsx)(i.View,{style:A.blockquote,children:(0,o.jsx)(i.Text,{style:A.blockquoteText,selectable:!0,children:x(I.join('\n'))})},`quote-${h}`))}else{var O=S.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(O){var b=' '!==O[1];u.push((0,o.jsxs)(i.View,{style:A.listItem,children:[(0,o.jsx)(i.Text,{style:A.listBullet,children:b?'\u2611':'\u2610'}),(0,o.jsx)(i.Text,{style:A.listText,selectable:!0,children:x(O[2])})]},h)),h++}else{var R=T.match(/^(\s*)(\d+)\.\s+(.+)$/);if(R){var j=Math.floor(R[1].length/2),E=(0,t.default)(R,4),M=E[2],L=E[3];u.push((0,o.jsxs)(i.View,{style:[A.listItem,j>0&&{paddingLeft:s.SPACING.SM+j*s.SPACING.LG}],children:[(0,o.jsxs)(i.Text,{style:A.listNumber,children:[M,"."]}),(0,o.jsx)(i.Text,{style:A.listText,selectable:!0,children:x(L)})]},h)),h++}else{var Y=T.match(/^(\s*)[-*]\s+(.+)$/);if(Y){var _=Math.floor(Y[1].length/2),v=0===_?'\u2022':1===_?'\u25e6':'\u25aa';u.push((0,o.jsxs)(i.View,{style:[A.listItem,_>0&&{paddingLeft:s.SPACING.SM+_*s.SPACING.LG}],children:[(0,o.jsx)(i.Text,{style:A.listBullet,children:v}),(0,o.jsx)(i.Text,{style:A.listText,selectable:!0,children:x(Y[2])})]},h)),h++}else/^[-*_]{3,}$/.test(S)?(u.push((0,o.jsx)(i.View,{style:A.horizontalRule},h)),h++):S?(u.push((0,o.jsx)(i.Text,{style:A.responseText,selectable:!0,children:x(T)},h)),h++):(u.push((0,o.jsx)(i.View,{style:A.paragraphBreak},h)),h++)}}}}}return(0,o.jsxs)(i.View,{style:A.formattedContainer,children:[u,l&&(0,o.jsx)(i.View,{style:A.cursor})]})}function x(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?f(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(i.Text,{style:A.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(l.default.Fragment,{children:f(e)},t))}function f(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?p(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(i.Text,{style:A.linkText,onPress:()=>i.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(l.default.Fragment,{children:p(e)},t)})}function p(e){var t=e.split(/(\*\*[^*]+\*\*|~~[^~]+~~|\*[^*]+\*)/g);return 1===t.length?e:t.map((e,t)=>e.startsWith('**')&&e.endsWith('**')?(0,o.jsx)(i.Text,{style:A.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(i.Text,{style:A.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(i.Text,{style:A.italicText,children:e.slice(1,-1)},t):e)}function P(e){var t=e.parts,n=e.isStreaming;return(0,o.jsx)(i.View,{style:A.partsContainer,children:t.map((e,l)=>{if("text"===e.type){var s=l===t.length-1;return(0,o.jsx)(i.View,{style:A.messageContainer,children:(0,o.jsx)(S,{content:e.content,isStreaming:n&&s})},e.id)}return"tool"===e.type?(0,o.jsx)(G,{part:e},e.id):null})})}function C(e){var t=e.message;return(0,o.jsxs)(i.View,{style:A.resultContainer,children:[(0,o.jsx)(P,{parts:t.parts,isStreaming:!1}),!t.isComplete&&(0,o.jsx)(i.Text,{style:A.interruptedText,children:"(interrupted)"})]})}function y(e,t){var n=e=>e.split('/').pop()||e;switch(e){case"Read":return{label:"read",value:n(t?.file_path||"file")};case"Edit":return{label:"edit",value:n(t?.file_path||"file")};case"Write":return{label:"write",value:n(t?.file_path||"file")};case"Bash":var l=t?.command||"";return{label:"$",value:l.length>45?l.slice(0,45)+"\u2026":l};case"Glob":return{label:"glob",value:t?.pattern||"*"};case"Grep":return{label:"grep",value:t?.pattern||"search"};case"Task":return{label:"agent",value:t?.description||"task"};default:return{label:e.toLowerCase(),value:""}}}function I(e){var t=e.toolName,n=e.input,l=e.isFailed,s=y(t,n),c=s.label,u=s.value;return(0,o.jsxs)(i.View,{style:A.toolLine,children:[(0,o.jsx)(i.Text,{style:l?A.toolLabelFailed:A.toolLabel,children:c}),(0,o.jsx)(i.Text,{style:l?A.toolValueFailed:A.toolValue,numberOfLines:1,children:u}),l&&(0,o.jsx)(i.Text,{style:A.toolLabelFailed,children:" \u2715"})]})}function G(e){var t=e.part;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function O(e){var t=e.tool;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function b(e){var t=e.result;return!t.success&&t.error?(0,o.jsx)(i.View,{style:A.errorContainer,children:(0,o.jsx)(i.Text,{style:A.errorText,children:t.error})}):(0,o.jsxs)(i.View,{style:A.resultContainer,children:[t.result&&(0,o.jsx)(i.Text,{style:A.responseText,selectable:!0,children:t.result}),(void 0!==t.costUsd||void 0!==t.durationMs)&&(0,o.jsxs)(i.Text,{style:A.metaText,children:[void 0!==t.durationMs&&`${t.durationMs}ms`,void 0!==t.costUsd&&void 0!==t.durationMs&&" \u2022 ",void 0!==t.costUsd&&`$${t.costUsd.toFixed(4)}`]})]})}var A=i.StyleSheet.create({wrapper:{flex:1,position:"relative"},container:{flex:1,backgroundColor:s.COLORS.BACKGROUND},content:{padding:s.LAYOUT.CONTENT_PADDING_H,paddingBottom:s.SPACING.XXL},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:s.SPACING.XXL},emptyText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,textAlign:"center",lineHeight:22},messageContainer:{flexDirection:"row",flexWrap:"wrap"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:s.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},resultContainer:{marginTop:s.SPACING.SM},partsContainer:{},formattedContainer:{flexDirection:"column"},listItem:{flexDirection:"row",marginVertical:s.SPACING.XS/2,paddingLeft:s.SPACING.SM},listNumber:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:s.SPACING.SM,padding:s.SPACING.MD,marginVertical:s.SPACING.SM},codeLang:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS,fontFamily:"Menlo",marginBottom:s.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"Menlo",fontSize:s.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_XL,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:s.SPACING.MD,marginBottom:s.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},boldText:{fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:s.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:s.COLORS.TEXT_MUTED},linkText:{color:s.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:s.SPACING.MD,marginVertical:s.SPACING.XS},blockquoteText:{color:s.COLORS.TEXT_SECONDARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:s.COLORS.BORDER,marginVertical:s.SPACING.MD},paragraphBreak:{height:s.SPACING.SM},interruptedText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontStyle:"italic",marginTop:s.SPACING.XS},metaText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,marginTop:s.SPACING.SM+2},errorContainer:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},errorText:{color:"#FF6B6B",fontSize:s.TYPOGRAPHY.SIZE_MD},systemContainer:{backgroundColor:"rgba(255,255,255,0.05)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},systemText:{color:s.COLORS.TEXT_TERTIARY,fontSize:s.TYPOGRAPHY.SIZE_MD,fontStyle:"italic"},toolLine:{flexDirection:"row",alignItems:"center",marginVertical:s.SPACING.XS},toolLabel:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolLabelFailed:{color:"rgba(255,100,100,0.6)",fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolValue:{color:"rgba(255,255,255,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},toolValueFailed:{color:"rgba(255,100,100,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},userPromptContainer:{backgroundColor:"rgba(0,122,255,0.15)",borderRadius:s.LAYOUT.BORDER_RADIUS_SM+2,padding:s.SPACING.MD,marginVertical:s.SPACING.SM,alignSelf:"flex-end",maxWidth:"85%"},userPromptText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:20},scrollButton:{position:"absolute",bottom:s.LAYOUT.CONTENT_PADDING_H,alignSelf:"center",left:"50%",marginLeft:-18,width:36,height:36,borderRadius:18,backgroundColor:"rgba(255,255,255,0.12)",borderWidth:1,borderColor:"rgba(255,255,255,0.2)",alignItems:"center",justifyContent:"center"},scrollButtonText:{color:s.COLORS.TEXT_PRIMARY,fontSize:18,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD}})},488,[29,63,258,487,250]);
541
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GitChangesTab=function(c){var f=c.changes,x=c.onDiscard;if(!(f.length>0))return(0,n.jsxs)(t.View,{style:s.emptyContainer,children:[(0,n.jsx)(t.Text,{style:s.emptyTitle,children:"No uncommitted changes"}),(0,n.jsx)(t.Text,{style:s.emptySubtext,children:"Your working directory is clean"})]});return(0,n.jsxs)(t.View,{style:s.container,children:[(0,n.jsx)(t.ScrollView,{style:s.fileList,contentContainerStyle:s.fileListContent,children:f.map((c,f)=>(0,n.jsxs)(t.View,{style:s.fileRow,children:[(0,n.jsx)(t.Text,{style:[s.statusIcon,{color:l[c.status]}],children:o[c.status]}),(0,n.jsx)(t.Text,{style:s.fileName,numberOfLines:1,children:c.file})]},`${c.file}-${f}`))}),(0,n.jsxs)(t.View,{style:s.footer,children:[(0,n.jsx)(t.TouchableOpacity,{style:s.discardButton,onPress:x,children:(0,n.jsx)(t.Text,{style:s.discardText,children:"Discard All Changes"})}),(0,n.jsx)(t.Text,{style:s.warningText,children:"Note: Discarding won't reset memory"})]})]})},r(d[0]);var t=r(d[1]),n=r(d[2]),o={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?"},l={added:"#30D158",modified:"#FFD60A",deleted:"#FF453A",renamed:"#BF5AF2",untracked:"#8E8E93"};var s=t.StyleSheet.create({container:{flex:1,backgroundColor:"#000"},emptyContainer:{flex:1,backgroundColor:"#000",alignItems:"center",justifyContent:"center",padding:24},emptyTitle:{color:"rgba(255,255,255,0.6)",fontSize:16,fontWeight:"500",marginBottom:8},emptySubtext:{color:"rgba(255,255,255,0.4)",fontSize:14},fileList:{flex:1},fileListContent:{padding:16},fileRow:{flexDirection:"row",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255,255,255,0.06)"},statusIcon:{width:20,fontSize:13,fontWeight:"600",fontFamily:"Menlo"},fileName:{flex:1,color:"rgba(255,255,255,0.8)",fontSize:14,fontFamily:"Menlo"},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(255,255,255,0.08)",alignItems:"center"},discardButton:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:12,paddingVertical:12,paddingHorizontal:24,marginBottom:8},discardText:{color:"#FF3B30",fontSize:15,fontWeight:"500"},warningText:{color:"rgba(255,255,255,0.3)",fontSize:12}})},489,[63,258,250]);
542
- __d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var e={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};this.ws.send(JSON.stringify(e)),this.setStatus("processing")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"sendPushToken",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"register_push_token",token:t}))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},490,[8,9]);
543
- __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.requestPushToken=function(){return u.apply(this,arguments)},_e.setupTapHandler=function(e){return console.log("[expo-air] setupTapHandler: tap handling managed by main app"),()=>{}};var e,n=r(d[0]),o=(e=n)&&e.__esModule?e:{default:e},t=r(d[1]).NativeModules.WidgetBridge;function u(){return(u=(0,o.default)(function*(){try{if(!t?.requestPushToken)return console.log("[expo-air] WidgetBridge.requestPushToken not available"),null;console.log("[expo-air] Requesting push token via native bridge");var e=yield t.requestPushToken();return e?(console.log("[expo-air] Got push token:",e),e):(console.log("[expo-air] Push notification permission denied or token unavailable"),null)}catch(e){return console.error("[expo-air] Failed to get push token:",e),null}})).apply(this,arguments)}},491,[346,258]);
544
- __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BranchSwitcher=function(e){var t=e.branches,h=(e.currentBranch,e.onSelect),b=e.onCreate,u=e.onClose,C=e.error,I=(0,n.useState)(!1),T=(0,o.default)(I,2),p=T[0],P=T[1],O=(0,n.useState)(""),x=(0,o.default)(O,2),A=x[0],f=x[1],y=()=>{var e=A.trim();e&&(b(e),f(""),P(!1))};return(0,s.jsxs)(l.View,{style:S.overlay,children:[(0,s.jsx)(l.TouchableOpacity,{style:S.backdrop,onPress:u,activeOpacity:1}),(0,s.jsxs)(l.View,{style:S.dropdown,children:[C&&(0,s.jsx)(l.View,{style:S.errorBanner,children:(0,s.jsx)(l.Text,{style:S.errorText,numberOfLines:2,children:C})}),(0,s.jsx)(l.ScrollView,{style:S.branchList,bounces:!1,children:t.map((e,t)=>(0,s.jsxs)(l.TouchableOpacity,{style:[S.branchItem,e.isCurrent&&S.branchItemCurrent,0===t&&S.branchItemFirst],onPress:()=>{e.isCurrent||h(e.name)},activeOpacity:e.isCurrent?1:.6,children:[(0,s.jsxs)(l.View,{style:S.branchInfo,children:[(0,s.jsx)(l.Text,{style:[S.branchName,e.isCurrent&&S.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,s.jsx)(l.View,{style:S.prBadge,children:(0,s.jsxs)(l.Text,{style:S.prBadgeText,children:["#",e.prNumber]})})]}),e.isCurrent&&(0,s.jsx)(l.Text,{style:S.currentIndicator,children:"\u2713"})]},e.name))}),(0,s.jsx)(l.View,{style:S.createSection,children:p?(0,s.jsxs)(l.View,{style:S.createInputRow,children:[(0,s.jsx)(l.TextInput,{style:S.createInput,value:A,onChangeText:f,placeholder:"branch-name",placeholderTextColor:c.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:y,returnKeyType:"done"}),(0,s.jsx)(l.TouchableOpacity,{style:[S.createConfirmButton,!A.trim()&&S.createConfirmDisabled],onPress:y,disabled:!A.trim(),children:(0,s.jsx)(l.Text,{style:S.createConfirmText,children:"Create"})})]}):(0,s.jsx)(l.TouchableOpacity,{style:S.createButton,onPress:()=>P(!0),children:(0,s.jsx)(l.Text,{style:S.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),l=r(d[2]),c=r(d[3]),s=r(d[4]);var S=l.StyleSheet.create({overlay:{...l.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...l.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:c.SPACING.SM,right:c.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:c.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},branchList:{maxHeight:300},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.MD+2,borderBottomWidth:l.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:c.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:c.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:c.TYPOGRAPHY.SIZE_MD,fontWeight:c.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:c.COLORS.TEXT_PRIMARY,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:c.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:c.COLORS.STATUS_INFO,fontSize:c.TYPOGRAPHY.SIZE_XS,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},currentIndicator:{color:c.COLORS.STATUS_SUCCESS,fontSize:c.TYPOGRAPHY.SIZE_SM,marginLeft:c.SPACING.SM},createSection:{paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.MD,borderTopWidth:l.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:c.SPACING.XS},createButtonText:{color:c.COLORS.STATUS_INFO,fontSize:c.TYPOGRAPHY.SIZE_MD,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:c.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:c.COLORS.TEXT_PRIMARY,fontSize:c.TYPOGRAPHY.SIZE_MD,paddingHorizontal:c.SPACING.MD,paddingVertical:c.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:c.COLORS.STATUS_INFO,paddingHorizontal:c.SPACING.MD,paddingVertical:c.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:c.COLORS.TEXT_PRIMARY,fontSize:c.TYPOGRAPHY.SIZE_SM,fontWeight:c.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.SM,borderBottomWidth:l.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:c.TYPOGRAPHY.SIZE_SM}})},492,[29,63,258,487,250]);
537
+ __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}),_e.BubbleContent=function(e){e.size,e.color;var T=e.expanded,C=void 0!==T&&T,O=e.serverUrl,f=void 0===O?"ws://localhost:3847":O,R=(0,s.useState)("disconnected"),x=(0,n.default)(R,2),y=x[0],I=x[1],P=(0,s.useState)([]),D=(0,n.default)(P,2),N=D[0],k=D[1],w=(0,s.useState)([]),B=(0,n.default)(w,2),j=B[0],L=B[1],U=(0,s.useState)("main"),G=(0,n.default)(U,2),V=G[0],M=G[1],Y=(0,s.useState)([]),W=(0,n.default)(Y,2),H=W[0],Z=W[1],q=(0,s.useState)(!1),z=(0,n.default)(q,2),X=z[0],F=z[1],K=(0,s.useState)(),$=(0,n.default)(K,2),J=$[0],Q=$[1],ee=(0,s.useState)("chat"),te=(0,n.default)(ee,2),ne=te[0],re=te[1],ae=(0,s.useState)(!1),se=(0,n.default)(ae,2),oe=se[0],ie=se[1],ce=(0,s.useState)([]),le=(0,n.default)(ce,2),ue=le[0],de=le[1],he=(0,s.useState)(!1),Se=(0,n.default)(he,2),pe=Se[0],me=Se[1],Te=(0,s.useState)(null),ge=(0,n.default)(Te,2),be=ge[0],Ce=ge[1],Oe=(0,s.useRef)("main"),fe=(0,s.useRef)(!1),Re=(0,s.useRef)(0),xe=(0,s.useRef)([]),ve=(0,s.useRef)(null),Ae=(0,s.useRef)(null);(0,s.useEffect)(()=>{C&&"chat"===ne&&setTimeout(()=>Ae.current?.focus(),100)},[C]);var ye=J?.match(/\/pull\/(\d+)/)?.[1];(0,s.useEffect)(()=>{console.log("[expo-air] Connecting to:",f?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,h.createWebSocketClient)({url:f,onStatusChange:I,onMessage:Ie,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[f]),(0,s.useEffect)(()=>(0,S.setupTapHandler)((e,t)=>{var n=(0,h.getWebSocketClient)();n&&!n.isConnected()&&n.connect()}),[]);var Ee=(0,s.useCallback)((e,t)=>{var n=xe.current;if(n.length>0){var s={type:"assistant_parts",promptId:e,parts:n,isComplete:t,timestamp:Date.now()};k(e=>[...e,s])}xe.current=[],ve.current=null,L([])},[]),Ie=(0,s.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==ve.current&&(xe.current.length>0&&ve.current&&Ee(ve.current,!1),ve.current=e.promptId),!e.done&&e.chunk){var t=xe.current,n=t[t.length-1];"text"===n?.type?(n.content+=e.chunk,xe.current=[...t]):xe.current=[...t,{type:"text",id:"text-"+Re.current++,content:e.chunk}],L([...xe.current])}break;case"tool":if("started"!==e.status){var s={type:"tool",id:"tool-"+Re.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};xe.current=[...xe.current,s],L([...xe.current])}break;case"result":if(xe.current.length>0){var o={type:"assistant_parts",promptId:e.promptId,parts:xe.current,isComplete:!0,timestamp:e.timestamp};if(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error){var c={...e,result:void 0};k(e=>[...e,o,c])}else k(e=>[...e,o])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&k(t=>[...t,e]);xe.current=[],ve.current=null,L([]);break;case"error":if(xe.current.length>0&&ve.current){var l={type:"assistant_parts",promptId:ve.current,parts:xe.current,isComplete:!1,timestamp:Date.now()};k(t=>[...t,l,e])}else k(t=>[...t,e]);xe.current=[],ve.current=null,L([]);break;case"status":break;case"session_cleared":k([]),xe.current=[],ve.current=null,Re.current=0,L([]);break;case"stopped":xe.current.length>0&&ve.current?Ee(ve.current,!1):(xe.current=[],ve.current=null,L([]));break;case"history":var u=e.entries.flatMap(e=>"user"===e.role?[{type:"user_prompt",content:e.content,timestamp:e.timestamp}]:"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]);k(u);break;case"git_status":M(e.branchName),Z(e.changes),F(e.hasPR),Q(e.prUrl);break;case"branches_list":de(e.branches),me(!1);break;case"branch_switched":if(e.success)Ce(null);else if(e.error){var h=Oe.current;M(h),de(e=>e.map(e=>({...e,isCurrent:e.name===h}))),ie(!0),Ce(e.error)}break;case"branch_created":e.success?(ie(!1),Ce(null)):e.error&&Ce(e.error)}},[Ee]),Pe=(0,s.useCallback)((function(){var e=(0,t.default)(function*(e,t){if(!fe.current){var n=yield(0,S.requestPushToken)();if(n){var s=(0,h.getWebSocketClient)();s?.isConnected()&&(s.sendPushToken(n),fe.current=!0)}}k(n=>[...n,{type:"user_prompt",content:e,images:t,timestamp:Date.now()}]),xe.current=[],ve.current=null,L([]);var o=t&&t.length>0?t.map(e=>e.uri):void 0,c=(0,h.getWebSocketClient)();c&&c.sendPrompt(e,o)});return function(t,n){return e.apply(this,arguments)}})(),[]),De=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestNewSession()},[]),Ne=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestStop()},[]),ke=(0,s.useCallback)(()=>{re("chat"),Pe("Look at my current git changes and create a commit with a good conventional commit message. Stage all changes and commit them.")},[Pe]),we=(0,s.useCallback)(()=>{re("chat"),Pe("Create a pull request for my current branch. First commit any uncommitted changes with a good message. Then generate a title and description based on the commits, and use `gh pr create --title \"...\" --body \"...\"` (non-interactive mode) to create it. Push to remote first if needed.")},[Pe]),Be=(0,s.useCallback)(()=>{J&&o.Linking.openURL(J)},[J]),je=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestDiscardChanges()},[]),Le=(0,s.useCallback)(()=>{if(ie(e=>!e),!oe){me(!0);var e=(0,h.getWebSocketClient)();e&&e.requestBranches()}},[oe]),Ue=(0,s.useCallback)(e=>{Ce(null),Oe.current=V,M(e),de(t=>t.map(t=>({...t,isCurrent:t.name===e}))),ie(!1);var t=(0,h.getWebSocketClient)();t&&t.requestSwitchBranch(e)},[V]),Ge=(0,s.useCallback)(e=>{Ce(null);var t=(0,h.getWebSocketClient)();t&&t.requestCreateBranch(e)},[]);if(!C)return(0,b.jsx)(o.View,{style:_.collapsedPill,children:(0,b.jsx)(E,{status:y})});return(0,b.jsxs)(o.View,{style:_.expanded,children:[(0,b.jsx)(v,{status:y,branchName:V,onBranchPress:Le}),(0,b.jsx)(A,{activeTab:ne,onTabChange:re,onNewSession:De,canStartNew:"connected"===y,hasPR:X,hasChanges:H.length>0,prNumber:ye,onCreatePR:we,onCommit:ke,onViewPR:Be}),(0,b.jsx)(o.View,{style:_.body,children:"chat"===ne?(0,b.jsx)(l.ResponseArea,{messages:N,currentParts:j}):(0,b.jsx)(u.GitChangesTab,{changes:H,onDiscard:je})}),"chat"===ne&&(0,b.jsx)(c.PromptInput,{ref:Ae,onSubmit:Pe,onStop:Ne,disabled:"disconnected"===y,isProcessing:"processing"===y}),oe&&(0,b.jsx)(p.BranchSwitcher,{branches:ue,currentBranch:V,loading:pe,onSelect:Ue,onCreate:Ge,onClose:()=>{ie(!1),Ce(null)},error:be})]})};var t=e(r(d[0])),n=e(r(d[1])),s=r(d[2]),o=r(d[3]),c=r(d[4]),l=r(d[5]),u=r(d[6]),h=r(d[7]),S=r(d[8]),p=r(d[9]),T=r(d[10]),b=r(d[11]),C=o.Animated.Text,O=o.Animated.View,f=o.NativeModules.WidgetBridge,R=o.NativeModules.ExpoAir;function x(){try{f?.collapse?f.collapse():R?.collapse?R.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}function v(e){var t=e.status,n=e.branchName,s=e.onBranchPress,c={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO};return(0,b.jsxs)(o.View,{style:_.header,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:x,style:_.closeButton,children:(0,b.jsx)(o.Text,{style:_.closeButtonText,children:"\u2715"})}),(0,b.jsxs)(o.TouchableOpacity,{style:_.branchButton,onPress:s,children:[(0,b.jsx)(o.Text,{style:_.branchName,numberOfLines:1,children:n}),(0,b.jsx)(o.Text,{style:_.branchChevron,children:"\u25be"})]}),(0,b.jsx)(o.View,{style:[_.statusDot,{backgroundColor:c[t]}]})]})}function A(e){var t=e.activeTab,n=e.onTabChange,s=e.onNewSession,c=e.canStartNew,l=e.hasPR,u=e.hasChanges,h=e.prNumber,S=e.onCreatePR,p=e.onCommit,T=e.onViewPR;return(0,b.jsxs)(o.View,{style:_.tabBar,children:[(0,b.jsxs)(o.View,{style:_.tabButtons,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("chat"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"chat"===t?_.tabTextActive:_.tabTextInactive],children:"Chat"})}),(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("changes"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"changes"===t?_.tabTextActive:_.tabTextInactive],children:"Changes"})})]}),"chat"===t?(0,b.jsx)(o.TouchableOpacity,{onPress:s,style:[_.ctaButton,!c&&_.ctaButtonDisabled],disabled:!c,children:(0,b.jsx)(o.Text,{style:[_.ctaText,!c&&_.ctaTextDisabled],children:"New"})}):!l&&u?(0,b.jsx)(y,{onPress:S,children:"Create PR"}):l&&u?(0,b.jsx)(y,{onPress:p,children:"Commit"}):l&&!u&&h?(0,b.jsxs)(y,{onPress:T,children:["#",h]}):null]})}function y(e){var t=e.children,n=e.onPress,c=(0,s.useRef)(new o.Animated.Value(.6)).current;return(0,s.useEffect)(()=>{var e=o.Animated.loop(o.Animated.sequence([o.Animated.timing(c,{toValue:.9,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(c,{toValue:.6,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>e.stop()},[c]),(0,b.jsx)(o.TouchableOpacity,{onPress:n,style:_.ctaButton,activeOpacity:.7,children:(0,b.jsx)(C,{style:[_.ctaText,{opacity:c}],children:t})})}function E(e){var t=e.status,n={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO},c="processing"===t||"connecting"===t,l=(0,s.useRef)(new o.Animated.Value(1)).current,u=(0,s.useRef)(new o.Animated.Value(.4)).current;return(0,s.useEffect)(()=>{if(c){var e=o.Animated.loop(o.Animated.sequence([o.Animated.parallel([o.Animated.timing(l,{toValue:1.3,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(u,{toValue:0,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]),o.Animated.parallel([o.Animated.timing(l,{toValue:1,duration:0,useNativeDriver:!0}),o.Animated.timing(u,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}l.setValue(1),u.setValue(.4)},[c,l,u]),(0,b.jsxs)(o.View,{style:_.indicatorContainer,children:[(0,b.jsx)(o.View,{style:[_.indicator,{backgroundColor:n[t]}]}),c&&(0,b.jsx)(O,{style:[_.indicatorRing,{borderColor:n[t],transform:[{scale:l}],opacity:u}]})]})}var _=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4},expanded:{flex:1,backgroundColor:T.COLORS.BACKGROUND,borderRadius:T.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},header:{flexDirection:"row",alignItems:"center",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},closeButton:{width:T.SIZES.CLOSE_BUTTON,height:T.SIZES.CLOSE_BUTTON,borderRadius:T.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:T.SPACING.MD},closeButtonText:{color:"transparent",fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:T.COLORS.TEXT_SECONDARY,fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:T.COLORS.TEXT_MUTED,fontSize:T.TYPOGRAPHY.SIZE_SM,marginLeft:T.SPACING.XS},statusDot:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2,marginLeft:T.SPACING.MD},ctaButton:{paddingHorizontal:T.SIZES.CTA_PADDING_H,paddingVertical:T.SIZES.CTA_PADDING_V,borderRadius:T.LAYOUT.BORDER_RADIUS_SM,backgroundColor:T.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:T.COLORS.TEXT_PRIMARY,fontSize:T.TYPOGRAPHY.SIZE_SM,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6},tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:T.SPACING.XL},tabText:{fontSize:T.TYPOGRAPHY.SIZE_LG,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:T.COLORS.TEXT_PRIMARY},tabTextInactive:{color:T.COLORS.TEXT_MUTED},body:{flex:1,backgroundColor:T.COLORS.BACKGROUND_ELEVATED}})},485,[346,29,63,258,486,520,521,522,523,524,519,250]);
538
+ __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,"PromptInput",{enumerable:!0,get:function(){return u}});var t=e(r(_d[0])),i=e(r(_d[1])),o=r(_d[2]),n=r(_d[3]),s=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}),t.default=e,t})(r(_d[4])),l=r(_d[5]),d=r(_d[6]),u=(0,o.forwardRef)((e,u)=>{var C=e.onSubmit,T=e.onStop,S=e.disabled,O=void 0!==S&&S,I=e.isProcessing,w=void 0!==I&&I,y=(0,o.useState)(""),f=(0,i.default)(y,2),v=f[0],R=f[1],j=(0,o.useState)([]),x=(0,i.default)(j,2),L=x[0],B=x[1],_=(0,o.useRef)(null);(0,o.useImperativeHandle)(u,()=>({focus:()=>_.current?.focus()})),(0,o.useEffect)(()=>{var e=new n.NativeEventEmitter(n.NativeModules.WidgetBridge).addListener('onClipboardImagePaste',e=>{B(t=>t.length>=4?t:[...t,e])});return()=>e.remove()},[]);var A=()=>{var e=v.trim();!(e.length>0||L.length>0)||O||w||(C(e,L.length>0?L:void 0),R(""),B([]))},P=(function(){var e=(0,t.default)(function*(){if(L.length>=4)n.Alert.alert("Limit reached","Maximum 4 images per message.");else try{var e=yield s.launchImageLibraryAsync({mediaTypes:["images"],allowsMultipleSelection:!0,selectionLimit:4-L.length,quality:.7});if(!e.canceled&&e.assets.length>0){var t=e.assets.map(e=>({uri:e.uri,width:e.width,height:e.height}));B(e=>[...e,...t].slice(0,4))}}catch(e){console.warn("[expo-air] Image picker error:",e)}});return function(){return e.apply(this,arguments)}})(),E=e=>{B(t=>t.filter((t,i)=>i!==e))},N=(v.trim().length>0||L.length>0)&&!O&&!w;return(0,d.jsxs)(n.View,{style:b.outerContainer,children:[L.length>0&&(0,d.jsx)(n.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:b.previewStrip,contentContainerStyle:b.previewContent,children:L.map((e,t)=>(0,d.jsxs)(n.View,{style:b.previewItem,children:[(0,d.jsx)(n.Image,{source:{uri:e.uri},style:b.previewImage}),(0,d.jsx)(n.TouchableOpacity,{style:b.removeButton,onPress:()=>E(t),hitSlop:{top:6,bottom:6,left:6,right:6},children:(0,d.jsxs)(n.View,{style:b.removeIcon,children:[(0,d.jsx)(n.View,{style:[b.removeLine,b.removeLineA]}),(0,d.jsx)(n.View,{style:[b.removeLine,b.removeLineB]})]})})]},t))}),(0,d.jsxs)(n.View,{style:b.container,children:[(0,d.jsx)(n.TouchableOpacity,{style:b.iconButton,onPress:P,disabled:w,activeOpacity:.6,children:(0,d.jsx)(c,{})}),(0,d.jsx)(n.TextInput,{ref:_,style:b.input,placeholder:"Ask Claude...",placeholderTextColor:l.COLORS.TEXT_TERTIARY,value:v,onChangeText:R,onSubmitEditing:A,editable:!w,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),w?(0,d.jsx)(n.TouchableOpacity,{style:[b.submitButton,b.stopButton],onPress:T,activeOpacity:.7,children:(0,d.jsx)(p,{})}):(0,d.jsx)(n.TouchableOpacity,{style:[b.submitButton,!N&&b.submitButtonDisabled],onPress:A,disabled:!N,activeOpacity:.7,children:(0,d.jsx)(h,{})})]})]})});function c(){return(0,d.jsxs)(n.View,{style:b.plusIcon,children:[(0,d.jsx)(n.View,{style:b.plusH}),(0,d.jsx)(n.View,{style:b.plusV})]})}function h(){return(0,d.jsxs)(n.View,{style:b.arrowIcon,children:[(0,d.jsx)(n.View,{style:b.arrowLine}),(0,d.jsx)(n.View,{style:b.arrowHead})]})}function p(){return(0,d.jsx)(n.View,{style:b.stopIcon})}var b=n.StyleSheet.create({outerContainer:{borderTopWidth:1,borderTopColor:l.COLORS.BORDER,backgroundColor:l.COLORS.BACKGROUND},previewStrip:{maxHeight:72,paddingHorizontal:l.LAYOUT.CONTENT_PADDING_H,paddingTop:l.SPACING.SM},previewContent:{gap:l.SPACING.SM,alignItems:"center"},previewItem:{position:"relative"},previewImage:{width:56,height:56,borderRadius:l.SPACING.SM,backgroundColor:"rgba(255,255,255,0.1)"},removeButton:{position:"absolute",top:-3,right:-3,width:18,height:18,borderRadius:9,backgroundColor:"#1C1C1E",alignItems:"center",justifyContent:"center"},removeIcon:{width:8,height:8,alignItems:"center",justifyContent:"center"},removeLine:{position:"absolute",width:9,height:1.2,backgroundColor:"rgba(255,255,255,0.9)",borderRadius:1},removeLineA:{transform:[{rotate:"45deg"}]},removeLineB:{transform:[{rotate:"-45deg"}]},container:{flexDirection:"row",alignItems:"flex-end",paddingHorizontal:l.LAYOUT.CONTENT_PADDING_H,paddingVertical:l.SPACING.MD},iconButton:{width:36,height:l.SIZES.SUBMIT_BUTTON,alignItems:"center",justifyContent:"center",marginRight:4},input:{flex:1,backgroundColor:l.COLORS.BACKGROUND_INPUT,borderRadius:22,paddingHorizontal:18,paddingVertical:l.SPACING.MD,color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_LG,maxHeight:100},submitButton:{width:l.SIZES.SUBMIT_BUTTON,height:l.SIZES.SUBMIT_BUTTON,borderRadius:l.SIZES.SUBMIT_BUTTON/2,backgroundColor:l.COLORS.BACKGROUND_BUTTON,alignItems:"center",justifyContent:"center",marginLeft:l.SPACING.SM+2},submitButtonDisabled:{opacity:.4},stopButton:{backgroundColor:l.COLORS.STATUS_NEUTRAL},stopIcon:{width:12,height:12,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:2},arrowIcon:{width:16,height:16,alignItems:"center",justifyContent:"center"},arrowLine:{width:2,height:10,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:1},arrowHead:{position:"absolute",top:0,width:0,height:0,borderLeftWidth:5,borderRightWidth:5,borderBottomWidth:6,borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:l.COLORS.TEXT_PRIMARY},plusIcon:{width:18,height:18,alignItems:"center",justifyContent:"center"},plusH:{position:"absolute",width:16,height:2,borderRadius:1,backgroundColor:l.COLORS.TEXT_MUTED},plusV:{position:"absolute",width:2,height:16,borderRadius:1,backgroundColor:l.COLORS.TEXT_MUTED}})},486,[346,29,63,258,487,519,250]);
539
+ __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}),_e.getCameraPermissionsAsync=f,_e.getMediaLibraryPermissionsAsync=p,_e.requestCameraPermissionsAsync=v,_e.requestMediaLibraryPermissionsAsync=P,Object.defineProperty(_e,"useMediaLibraryPermissions",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"useCameraPermissions",{enumerable:!0,get:function(){return M}}),_e.getPendingResultAsync=function(){return I.apply(this,arguments)},_e.launchCameraAsync=function(){return E.apply(this,arguments)},_e.launchImageLibraryAsync=function(){return L.apply(this,arguments)},Object.defineProperty(_e,"PermissionStatus",{enumerable:!0,get:function(){return u.PermissionStatus}});var n=e(r(d[0])),t=e(r(d[1])),u=r(d[2]),s=e(r(d[3])),o=r(d[4]),l=r(d[5]);function c(e){var n=e.aspect,s=e.quality,o=e.videoMaxDuration;if(null!=n){var l=(0,t.default)(n,2),c=l[0],f=l[1];if(c<=0||f<=0)throw new u.CodedError('ERR_INVALID_ARGUMENT',`Invalid aspect ratio values ${c}:${f}. Provide positive numbers.`)}if(s&&(s<0||s>1))throw new u.CodedError('ERR_INVALID_ARGUMENT',`Invalid 'quality' value ${s}. Provide a value between 0 and 1.`);if(o&&o<0)throw new u.CodedError('ERR_INVALID_ARGUMENT',`Invalid 'videoMaxDuration' value ${o}. Provide a non-negative number.`);return e}function f(){return y.apply(this,arguments)}function y(){return(y=(0,n.default)(function*(){return s.default.getCameraPermissionsAsync()})).apply(this,arguments)}function p(){return h.apply(this,arguments)}function h(){return h=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.default.getMediaLibraryPermissionsAsync(e)}),h.apply(this,arguments)}function v(){return b.apply(this,arguments)}function b(){return(b=(0,n.default)(function*(){return s.default.requestCameraPermissionsAsync()})).apply(this,arguments)}function P(){return A.apply(this,arguments)}function A(){return A=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,s.default.requestMediaLibraryPermissionsAsync)(e)}),A.apply(this,arguments)}Object.keys(l).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return l[e]}})});var w=(0,u.createPermissionHook)({getMethod:e=>p(e?.writeOnly),requestMethod:e=>P(e?.writeOnly)}),M=(0,u.createPermissionHook)({getMethod:f,requestMethod:v});function I(){return(I=(0,n.default)(function*(){return s.default.getPendingResultAsync?s.default.getPendingResultAsync():null})).apply(this,arguments)}function E(){return E=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!s.default.launchCameraAsync)throw new u.UnavailabilityError('ImagePicker','launchCameraAsync');var n=(0,o.mapDeprecatedOptions)(e);return yield s.default.launchCameraAsync(c(n))}),E.apply(this,arguments)}function L(){return L=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,o.mapDeprecatedOptions)(e);if(!s.default.launchImageLibraryAsync)throw new u.UnavailabilityError('ImagePicker','launchImageLibraryAsync');return n?.allowsEditing&&n.allowsMultipleSelection&&console.warn("[expo-image-picker] `allowsEditing` is not supported when `allowsMultipleSelection` is enabled and will be ignored.Disable either 'allowsEditing' or 'allowsMultipleSelection' in 'launchImageLibraryAsync' to fix this warning."),yield s.default.launchImageLibraryAsync(n)}),L.apply(this,arguments)}},487,[346,29,488,516,517,518]);
540
+ __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,"EventEmitter",{enumerable:!0,get:function(){return t.EventEmitter}}),Object.defineProperty(_e,"NativeModule",{enumerable:!0,get:function(){return n.NativeModule}}),Object.defineProperty(_e,"SharedObject",{enumerable:!0,get:function(){return o.SharedObject}}),Object.defineProperty(_e,"SharedRef",{enumerable:!0,get:function(){return u.SharedRef}}),Object.defineProperty(_e,"Platform",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(_e,"uuid",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"requireNativeViewManager",{enumerable:!0,get:function(){return b.requireNativeViewManager}}),Object.defineProperty(_e,"CodedError",{enumerable:!0,get:function(){return h.CodedError}}),Object.defineProperty(_e,"UnavailabilityError",{enumerable:!0,get:function(){return E.UnavailabilityError}}),Object.defineProperty(_e,"LegacyEventEmitter",{enumerable:!0,get:function(){return w.LegacyEventEmitter}}),Object.defineProperty(_e,"NativeModulesProxy",{enumerable:!0,get:function(){return k.default}}),r(d[0]),r(d[1]);var t=r(d[2]),n=r(d[3]),o=r(d[4]),u=r(d[5]),c=e(r(d[6])),f=e(r(d[7])),b=r(d[8]),l=r(d[9]);Object.keys(l).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return l[e]}})});var y=r(d[10]);Object.keys(y).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return y[e]}})});var O=r(d[11]);Object.keys(O).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return O[e]}})});var p=r(d[12]);Object.keys(p).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return p[e]}})});var j=r(d[13]);Object.keys(j).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return j[e]}})});var P=r(d[14]);Object.keys(P).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return P[e]}})});var s=r(d[15]);Object.keys(s).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return s[e]}})});var v=r(d[16]);Object.keys(v).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return v[e]}})});var h=r(d[17]),E=r(d[18]),w=r(d[19]),k=e(r(d[20]))},488,[489,498,499,500,501,502,495,503,506,491,507,508,509,510,511,512,513,497,514,515,492]);
541
+ __d(function(g,r,i,a,m,_e,d){"use strict";var o,e=r(d[0]);(o=e)&&o.__esModule;r(d[1]);var s=r(d[2]);globalThis.ExpoModulesCore_CodedError=s.CodedError},489,[490,495,497]);
542
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=(0,r(d[0]).requireOptionalNativeModule)('ExpoModulesCoreJSLogger')},490,[491]);
543
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.requireNativeModule=function(e){var o=s(e);if(!o)throw new Error(`Cannot find native module '${e}'`);return o},_e.requireOptionalNativeModule=s;var e,o=r(d[0]),u=r(d[1]),t=(e=u)&&e.__esModule?e:{default:e},l=r(d[2]),n=r(d[3]);function s(e){(0,n.ensureNativeModulesAreInstalled)();try{return globalThis.expo?.modules?.[e]??t.default[e]??(0,l.createTurboModuleToExpoProxy)(o.TurboModuleRegistry.get(e),e)??null}catch(o){var u=o;return console.warn(`An error occurred while requiring the '${e}' module: ${u.message}`),null}}},491,[258,492,493,494]);
544
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return v}});var t=r(d[0]),o=t.NativeModules?.NativeUnimoduleProxy,n=g.expo?.modules?.NativeModulesProxy,s='exportedMethods',u={};if(o){var l=n??o;Object.keys(l[s]).forEach(v=>{u[v]=l.modulesConstants[v]||{},l[s][v].forEach(t=>{u[v][t.name]=function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];if(n?.callMethod)return n.callMethod(v,t.name,u);var c=t.key,f=t.argumentsCount;return f!==u.length?Promise.reject(new Error(`Native method ${v}.${t.name} expects ${f} ${1===f?'argument':'arguments'} but received ${u.length}`)):o.callMethod(v,c,u)}}),t.NativeModules.EXReactNativeEventEmitter?(u[v].addListener=function(){for(var o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];return t.NativeModules.EXReactNativeEventEmitter.addProxiedListener(v,...n)},u[v].removeListeners=function(){for(var o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];return t.NativeModules.EXReactNativeEventEmitter.removeProxiedListeners(v,...n)}):(u[v].addListener=()=>{},u[v].removeListeners=()=>{})})}else console.warn("The \"EXNativeModulesProxy\" native module is not exported through NativeModules; verify that expo-modules-core's native code is linked properly");var v=u},492,[258]);
545
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createTurboModuleToExpoProxy=function(t,o){if(!t)return null;var n={__turboModule:t};if(Object.keys(Object.getPrototypeOf(t)).forEach(o=>{n[o]=t[o]}),t.getConstants){var u=t.getConstants();Object.keys(u).forEach(t=>{n[t]=u[t]})}return n.addListener=(o,n)=>(0,t[o])(n),n}},493,[]);
546
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ensureNativeModulesAreInstalled=function(){if(globalThis.expo)return;try{o.TurboModuleRegistry.get('ExpoModulesCore')?.installModules()}catch(o){console.error(`Unable to install Expo modules: ${o}`)}};var o=r(d[0])},494,[258]);
547
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var n=r(d[0]),t=r(d[1]),s={OS:"ios",select:'undefined'!=typeof window?n.Platform.select:function(n){return n.hasOwnProperty("ios")?n.ios:n.hasOwnProperty('native')?n.native:n.hasOwnProperty('default')?n.default:void 0},isDOMAvailable:t.isDOMAvailable,canUseEventListeners:t.canUseEventListeners,canUseViewport:t.canUseViewport,isAsyncDebugging:t.isAsyncDebugging}},495,[258,496]);
548
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"isDOMAvailable",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canUseEventListeners",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"canUseViewport",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isAsyncDebugging",{enumerable:!0,get:function(){return c}});var n=!1,t=!1,u=!1,c=!1},496,[]);
549
+ __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,"CodedError",{enumerable:!0,get:function(){return o}});var t=e(r(d[0])),u=e(r(d[1])),n=e(r(d[2])),f=e(r(d[3])),o=(function(e){function o(e,t){var f;return(0,u.default)(this,o),(f=(0,n.default)(this,o,[t])).code=e,f}return(0,f.default)(o,e),(0,t.default)(o)})((0,e(r(d[4])).default)(Error))},497,[9,8,13,18,42]);
550
+ __d(function(g,r,i,a,m,e,d){},498,[]);
551
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EventEmitter",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();var t=globalThis.expo.EventEmitter},499,[494]);
552
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NativeModule",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();var t=globalThis.expo.NativeModule},500,[494]);
553
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SharedObject",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();var t=globalThis.expo.SharedObject},501,[494]);
554
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SharedRef",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();var t=globalThis.expo.SharedRef},502,[494]);
555
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};var o={v4:function(){var e=globalThis?.expo?.uuidv4;if(!e)throw Error("Native UUID version 4 generator implementation wasn't found in `expo-modules-core`");return e()},v5:function(e,t){var o=Array.isArray(t)&&16===t.length?(0,n.default)(t):t;if(Array.isArray(o))throw new Error('`namespace` must be a valid UUID string or an Array of 16 byte values');var u=globalThis?.expo?.uuidv5;if(!u)throw Error("Native UUID type 5 generator implementation wasn't found in `expo-modules-core`");return u(e,o)},namespace:r(d[1]).Uuidv5Namespace}},503,[504,505]);
556
+ __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);var u=function(n,u){var o=u||0,i=t;return[i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]],'-',i[n[o++]],i[n[o++]],'-',i[n[o++]],i[n[o++]],'-',i[n[o++]],i[n[o++]],'-',i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]],i[n[o++]]].join('')}},504,[]);
557
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Uuidv5Namespace",{enumerable:!0,get:function(){return b}});var b=(function(b){return b.dns="6ba7b810-9dad-11d1-80b4-00c04fd430c8",b.url="6ba7b811-9dad-11d1-80b4-00c04fd430c8",b.oid="6ba7b812-9dad-11d1-80b4-00c04fd430c8",b.x500="6ba7b814-9dad-11d1-80b4-00c04fd430c8",b})({})},505,[]);
558
+ __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}),_e.requireNativeViewManager=function(e,s){l.NativeModules.NativeUnimoduleProxy.viewManagersMetadata;var _=w(e,s),p=(function(e){function s(){var e;(0,t.default)(this,s);for(var n=arguments.length,u=new Array(n),l=0;l<n;l++)u[l]=arguments[l];return(e=(0,o.default)(this,s,[...u])).nativeRef=(0,f.createRef)(),e.nativeTag=null,e}return(0,u.default)(s,e),(0,n.default)(s,[{key:"componentDidMount",value:function(){this.nativeTag=(0,l.findNodeHandle)(this.nativeRef.current)}},{key:"render",value:function(){return(0,c.jsx)(_,{...this.props,ref:this.nativeRef})}}])})(f.PureComponent);p.displayName=s||e;try{var h=(0,v.requireNativeModule)(e).ViewPrototypes[s?`${e}_${s}`:e];h&&Object.assign(p.prototype,h)}catch{}return p};var t=e(r(d[0])),n=e(r(d[1])),o=e(r(d[2])),u=e(r(d[3])),f=r(d[4]),l=r(d[5]),s=r(d[6]),v=r(d[7]),c=r(d[8]),_=new Map;function p(e,t){var n=globalThis.expo?.__expo_app_identifier__??'',o=n?`_${n}`:'',u=t?`ViewManagerAdapter_${e}_${t}${o}`:`ViewManagerAdapter_${e}${o}`;return(0,s.get)(u,()=>{var n=globalThis.expo?.getViewConfig(e,t);return n||console.warn('Unable to get the view config for %s from module &s',t??'default view',e),{uiViewClassName:u,...n}})}function w(e,t){var n=`${e}_${t}`,o=_.get(n);if(!o){var u=p(e,t);return _.set(n,u),u}return o}},506,[8,9,13,18,63,258,72,491,250]);
559
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.registerWebModule=function(s,l){if((0,o.ensureNativeModulesAreInstalled)(),!(l=l??s.name))throw new Error('Web module implementation is missing a name - it is either not a class or has been minified. Pass the name as a second argument to the `registerWebModule` function.');globalThis?.expo?.modules||(globalThis.expo.modules={});if(globalThis.expo.modules[l])return globalThis.expo.modules[l];return globalThis.expo.modules[l]=new s,globalThis.expo.modules[l]};var o=r(d[0])},507,[494]);
560
+ __d(function(g,r,i,a,m,e,d){},508,[]);
561
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PermissionStatus",{enumerable:!0,get:function(){return n}});var n=(function(n){return n.GRANTED="granted",n.UNDETERMINED="undetermined",n.DENIED="denied",n})({})},509,[]);
562
+ __d(function(g,r,i,a,m,_e,d){"use strict";var e=["get","request"];function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.createPermissionHook=function(e){return t=>l(e,t)};var u=t(r(d[0])),n=t(r(d[1])),o=t(r(d[2])),c=r(d[3]);function l(t,l){var f=(0,c.useRef)(!0),s=(0,c.useState)(null),h=(0,o.default)(s,2),v=h[0],M=h[1],y=l||{},_=y.get,b=void 0===_||_,k=y.request,q=void 0!==k&&k,j=(0,n.default)(y,e),O=(0,c.useCallback)((0,u.default)(function*(){var e;return e=Object.keys(j).length>0?yield t.getMethod(j):yield t.getMethod(),f.current&&M(e),e}),[t.getMethod]),C=(0,c.useCallback)((0,u.default)(function*(){var e;return e=Object.keys(j).length>0?yield t.requestMethod(j):yield t.requestMethod(),f.current&&M(e),e}),[t.requestMethod]);return(0,c.useEffect)(function(){q&&C(),!q&&b&&O()},[b,q,C,O]),(0,c.useEffect)(function(){return f.current=!0,()=>{f.current=!1}},[]),[v,C,O]}},510,[346,208,29,63]);
563
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createSnapshotFriendlyRef=function(){return(0,t.createRef)()};var t=r(d[0])},511,[63]);
564
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useReleasingSharedObject=function(n,t){var c=(0,u.useRef)(null),s=(0,u.useRef)(!1),l=(0,u.useRef)(t);null==c.current&&(c.current=n());var f=(0,u.useMemo)(()=>{var u=c.current,s=l.current?.length===t.length&&t.every((u,n)=>u===l.current[n]);return u&&s||(c.current?.release(),u=n(),c.current=u,l.current=t),u},t);return(0,u.useMemo)(()=>{s.current=!0},[]),(0,u.useEffect)(()=>(s.current=!1,()=>{!s.current&&c.current&&c.current.release()}),[]),f};var u=r(d[0])},512,[63]);
565
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.reloadAppAsync=function(){return n.apply(this,arguments)};var e,l=r(d[0]),t=(e=l)&&e.__esModule?e:{default:e};function n(){return n=(0,t.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'Reloaded from JS call';yield globalThis.expo?.reloadAppAsync(e)}),n.apply(this,arguments)}},513,[346]);
566
+ __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,"UnavailabilityError",{enumerable:!0,get:function(){return f}});var t=e(r(d[0])),n=e(r(d[1])),u=e(r(d[2])),o=e(r(d[3])),l=r(d[4]);r(d[5]);var f=(function(e){function l(e,t){return(0,n.default)(this,l),(0,u.default)(this,l,['ERR_UNAVAILABLE',`The method or property ${e}.${t} is not available on ios, are you sure you've linked all the native dependencies properly?`])}return(0,o.default)(l,e),(0,t.default)(l)})(l.CodedError)},514,[9,8,13,18,497,495]);
567
+ __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,"LegacyEventEmitter",{enumerable:!0,get:function(){return l}});var t=e(r(d[0])),n=e(r(d[1])),s=e(r(d[2])),u=r(d[3]),o='@@nativeEmitterSubscription@@',l=(function(){return(0,n.default)(function e(n){if((0,t.default)(this,e),this._listenerCount=0,n.__expo_module_name__)return n;this._nativeModule=n,this._eventEmitter=new u.NativeEventEmitter(n)},[{key:"addListener",value:function(e,t){this._listenerCount,this._listenerCount++;var n=this._eventEmitter.addListener(e,t),s={[o]:n,remove:()=>{this.removeSubscription(s)}};return s}},{key:"removeAllListeners",value:function(e){var t=this._eventEmitter.listenerCount?this._eventEmitter.listenerCount(e):this._eventEmitter.listeners(e).length;this._eventEmitter.removeAllListeners(e),this._listenerCount-=t,(0,s.default)(this._listenerCount>=0,"EventEmitter must have a non-negative number of listeners"),this._listenerCount}},{key:"removeSubscription",value:function(e){var t=e,n=t[o];n&&('remove'in n&&n.remove?.(),this._listenerCount--,delete t[o],e.remove=()=>{},this._listenerCount)}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];this._eventEmitter.emit(e,...n)}}])})()},515,[8,9,51,258]);
568
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=(0,r(d[0]).requireNativeModule)('ExponentImagePicker')},516,[488]);
569
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseMediaTypes=p,e.mapDeprecatedOptions=function(s){if(!s.mediaTypes)return s;return{...s,mediaTypes:p(s.mediaTypes??[])}};var s=r(d[0]);function p(p){return p===s.MediaTypeOptions.Images||p===s.MediaTypeOptions.Videos||p===s.MediaTypeOptions.All?(console.warn('[expo-image-picker] `ImagePicker.MediaTypeOptions` have been deprecated. Use `ImagePicker.MediaType` or an array of `ImagePicker.MediaType` instead.'),{Images:['images'],Videos:['videos'],All:['images','videos']}[p]):'string'==typeof p?[p]:p}},517,[518]);
570
+ __d(function(g,r,i,a,m,e,d){"use strict";var t,n,o,u,c,l;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MediaTypeOptions",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"VideoExportPreset",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"UIImagePickerControllerQualityType",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"UIImagePickerPresentationStyle",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"UIImagePickerPreferredAssetRepresentationMode",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"CameraType",{enumerable:!0,get:function(){return l}}),(function(t){t.All="All",t.Videos="Videos",t.Images="Images"})(t||(t={})),(function(t){t[t.Passthrough=0]="Passthrough",t[t.LowQuality=1]="LowQuality",t[t.MediumQuality=2]="MediumQuality",t[t.HighestQuality=3]="HighestQuality",t[t.H264_640x480=4]="H264_640x480",t[t.H264_960x540=5]="H264_960x540",t[t.H264_1280x720=6]="H264_1280x720",t[t.H264_1920x1080=7]="H264_1920x1080",t[t.H264_3840x2160=8]="H264_3840x2160",t[t.HEVC_1920x1080=9]="HEVC_1920x1080",t[t.HEVC_3840x2160=10]="HEVC_3840x2160"})(n||(n={})),(function(t){t[t.High=0]="High",t[t.Medium=1]="Medium",t[t.Low=2]="Low",t[t.VGA640x480=3]="VGA640x480",t[t.IFrame1280x720=4]="IFrame1280x720",t[t.IFrame960x540=5]="IFrame960x540"})(o||(o={})),(function(t){t.FULL_SCREEN="fullScreen",t.PAGE_SHEET="pageSheet",t.FORM_SHEET="formSheet",t.CURRENT_CONTEXT="currentContext",t.OVER_FULL_SCREEN="overFullScreen",t.OVER_CURRENT_CONTEXT="overCurrentContext",t.POPOVER="popover",t.AUTOMATIC="automatic"})(u||(u={})),(function(t){t.Automatic="automatic",t.Compatible="compatible",t.Current="current"})(c||(c={})),(function(t){t.back="back",t.front="front"})(l||(l={}))},518,[]);
571
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SPACING",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"LAYOUT",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"COLORS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"TYPOGRAPHY",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"SIZES",{enumerable:!0,get:function(){return D}});var T={XS:4,SM:8,MD:12,LG:16,XL:20,XXL:24},_={CONTENT_PADDING_H:T.LG,SECTION_PADDING_V:T.MD,ELEMENT_GAP:T.MD,BORDER_RADIUS_LG:32,BORDER_RADIUS_MD:20,BORDER_RADIUS_SM:14},E={BACKGROUND:"#000",BACKGROUND_ELEVATED:"rgba(255,255,255,0.03)",BACKGROUND_INTERACTIVE:"rgba(255,255,255,0.08)",BACKGROUND_INPUT:"rgba(255,255,255,0.1)",BACKGROUND_BUTTON:"rgba(255,255,255,0.15)",TEXT_PRIMARY:"#fff",TEXT_SECONDARY:"rgba(255,255,255,0.6)",TEXT_TERTIARY:"rgba(255,255,255,0.5)",TEXT_MUTED:"rgba(255,255,255,0.4)",BORDER:"rgba(255,255,255,0.08)",STATUS_SUCCESS:"#30D158",STATUS_ERROR:"#FF3B30",STATUS_INFO:"#007AFF",STATUS_NEUTRAL:"#8E8E93"},S={SIZE_XS:11,SIZE_SM:13,SIZE_MD:14,SIZE_LG:15,SIZE_XL:17,WEIGHT_NORMAL:"400",WEIGHT_MEDIUM:"500",WEIGHT_SEMIBOLD:"600"},D={STATUS_DOT:8,CLOSE_BUTTON:30,SUBMIT_BUTTON:40,CTA_PADDING_V:6,CTA_PADDING_H:12}},519,[]);
572
+ __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}),_e.ResponseArea=function(e){var i=e.messages,s=e.currentParts,u=(0,n.useRef)(null),h=(0,n.useState)(!0),S=(0,t.default)(h,2),T=S[0],x=S[1],f=(0,n.useRef)(0),p=(0,n.useRef)(0),C=(0,n.useCallback)(e=>{var t=e.nativeEvent,n=t.contentOffset,i=t.contentSize,l=t.layoutMeasurement,s=i.height-l.height-n.y;x(s<50)},[]),y=(0,n.useCallback)((e,t)=>{f.current=t},[]),I=(0,n.useCallback)(e=>{p.current=e.nativeEvent.layout.height},[]);(0,n.useEffect)(()=>{if(T){var e=setTimeout(()=>{u.current?.scrollToEnd({animated:!1})},16);return()=>clearTimeout(e)}},[i,s,T]),(0,n.useEffect)(()=>{var e=i[i.length-1];"user_prompt"===e?.type&&(u.current?.scrollToEnd({animated:!0}),x(!0))},[i]),(0,n.useEffect)(()=>{var e=l.Keyboard.addListener("keyboardWillShow",()=>{T&&setTimeout(()=>{u.current?.scrollToEnd({animated:!0})},100)});return()=>e.remove()},[T]);var G=(0,n.useCallback)(()=>{u.current?.scrollToEnd({animated:!0}),x(!0)},[]);if(!(i.length>0||s.length>0))return(0,o.jsx)(l.View,{style:O.emptyContainer,children:(0,o.jsx)(l.Text,{style:O.emptyText,children:"Send a prompt to start coding with Claude"})});return(0,o.jsxs)(l.View,{style:O.wrapper,children:[(0,o.jsxs)(l.ScrollView,{ref:u,style:O.container,contentContainerStyle:O.content,showsVerticalScrollIndicator:!0,onScroll:C,onContentSizeChange:y,onLayout:I,scrollEventThrottle:16,children:[i.map((e,t)=>(0,o.jsx)(c,{message:e},t)),s.length>0&&(0,o.jsx)(P,{parts:s,isStreaming:!0})]}),!T&&(0,o.jsx)(l.TouchableOpacity,{style:O.scrollButton,onPress:G,activeOpacity:.8,children:(0,o.jsx)(l.Text,{style:O.scrollButtonText,children:"\u2193"})})]})};var t=e(r(d[0])),n=r(d[1]),i=e(n),l=r(d[2]),s=r(d[3]),o=r(d[4]);function c(e){var t=e.message;switch(t.type){case"stream":case"status":default:return null;case"tool":return(0,o.jsx)(b,{tool:t});case"result":return(0,o.jsx)(A,{result:t});case"error":return(0,o.jsx)(l.View,{style:O.errorContainer,children:(0,o.jsx)(l.Text,{style:O.errorText,children:t.message})});case"user_prompt":return(0,o.jsx)(u,{message:t});case"history_result":return(0,o.jsx)(h,{message:t});case"assistant_parts":return(0,o.jsx)(C,{message:t});case"system_message":return(0,o.jsx)(S,{message:t})}}function u(e){var t=e.message;return(0,o.jsxs)(l.View,{style:O.userPromptContainer,children:[t.images&&t.images.length>0&&(0,o.jsx)(l.View,{style:O.userImages,children:t.images.map((e,t)=>(0,o.jsx)(l.Image,{source:{uri:e.uri},style:O.userImageThumb},t))}),t.content?(0,o.jsx)(l.Text,{style:O.userPromptText,selectable:!0,children:t.content}):null]})}function h(e){var t=e.message;return(0,o.jsx)(l.View,{style:O.resultContainer,children:(0,o.jsx)(T,{content:t.content})})}function S(e){var t=e.message;return"error"===t.messageType?(0,o.jsx)(l.View,{style:O.errorContainer,children:(0,o.jsx)(l.Text,{style:O.errorText,children:t.content})}):(0,o.jsx)(l.View,{style:O.systemContainer,children:(0,o.jsx)(l.Text,{style:O.systemText,children:t.content})})}function T(e){for(var n=e.content,i=e.isStreaming,c=n.split('\n'),u=[],h=0;h<c.length;){var S=c[h],T=S.trim();if(T.startsWith('```')){var f=[],p=T.slice(3).trim();for(h++;h<c.length&&!c[h].trim().startsWith('```');)f.push(c[h]),h++;u.push((0,o.jsxs)(l.View,{style:O.codeBlock,children:[p&&(0,o.jsx)(l.Text,{style:O.codeLang,children:p}),(0,o.jsx)(l.Text,{style:O.codeText,selectable:!0,children:f.join('\n')})]},`code-${h}`)),h++}else{var P=T.match(/^(#{1,6})\s+(.+)$/);if(P){var C=P[1].length,y=C<=2?O.heading1:C<=4?O.heading2:O.heading3;u.push((0,o.jsx)(l.Text,{style:y,selectable:!0,children:x(P[2])},h)),h++}else if(T.startsWith('> ')||'>'===T){for(var I=[];h<c.length&&(c[h].trim().startsWith('> ')||'>'===c[h].trim());){var G=c[h].trim().startsWith('> ')?c[h].trim().slice(2):'';I.push(G),h++}u.push((0,o.jsx)(l.View,{style:O.blockquote,children:(0,o.jsx)(l.Text,{style:O.blockquoteText,selectable:!0,children:x(I.join('\n'))})},`quote-${h}`))}else{var b=T.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(b){var A=' '!==b[1];u.push((0,o.jsxs)(l.View,{style:O.listItem,children:[(0,o.jsx)(l.Text,{style:O.listBullet,children:A?'\u2611':'\u2610'}),(0,o.jsx)(l.Text,{style:O.listText,selectable:!0,children:x(b[2])})]},h)),h++}else{var R=S.match(/^(\s*)(\d+)\.\s+(.+)$/);if(R){var j=Math.floor(R[1].length/2),E=(0,t.default)(R,4),M=E[2],L=E[3];u.push((0,o.jsxs)(l.View,{style:[O.listItem,j>0&&{paddingLeft:s.SPACING.SM+j*s.SPACING.LG}],children:[(0,o.jsxs)(l.Text,{style:O.listNumber,children:[M,"."]}),(0,o.jsx)(l.Text,{style:O.listText,selectable:!0,children:x(L)})]},h)),h++}else{var Y=S.match(/^(\s*)[-*]\s+(.+)$/);if(Y){var _=Math.floor(Y[1].length/2),v=0===_?'\u2022':1===_?'\u25e6':'\u25aa';u.push((0,o.jsxs)(l.View,{style:[O.listItem,_>0&&{paddingLeft:s.SPACING.SM+_*s.SPACING.LG}],children:[(0,o.jsx)(l.Text,{style:O.listBullet,children:v}),(0,o.jsx)(l.Text,{style:O.listText,selectable:!0,children:x(Y[2])})]},h)),h++}else/^[-*_]{3,}$/.test(T)?(u.push((0,o.jsx)(l.View,{style:O.horizontalRule},h)),h++):T?(u.push((0,o.jsx)(l.Text,{style:O.responseText,selectable:!0,children:x(S)},h)),h++):(u.push((0,o.jsx)(l.View,{style:O.paragraphBreak},h)),h++)}}}}}return(0,o.jsxs)(l.View,{style:O.formattedContainer,children:[u,i&&(0,o.jsx)(l.View,{style:O.cursor})]})}function x(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?f(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(l.Text,{style:O.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(i.default.Fragment,{children:f(e)},t))}function f(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?p(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(l.Text,{style:O.linkText,onPress:()=>l.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(i.default.Fragment,{children:p(e)},t)})}function p(e){var t=e.split(/(\*\*[^*]+\*\*|~~[^~]+~~|\*[^*]+\*)/g);return 1===t.length?e:t.map((e,t)=>e.startsWith('**')&&e.endsWith('**')?(0,o.jsx)(l.Text,{style:O.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(l.Text,{style:O.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(l.Text,{style:O.italicText,children:e.slice(1,-1)},t):e)}function P(e){var t=e.parts,n=e.isStreaming;return(0,o.jsx)(l.View,{style:O.partsContainer,children:t.map((e,i)=>{if("text"===e.type){var s=i===t.length-1;return(0,o.jsx)(l.View,{style:O.messageContainer,children:(0,o.jsx)(T,{content:e.content,isStreaming:n&&s})},e.id)}return"tool"===e.type?(0,o.jsx)(G,{part:e},e.id):null})})}function C(e){var t=e.message;return(0,o.jsxs)(l.View,{style:O.resultContainer,children:[(0,o.jsx)(P,{parts:t.parts,isStreaming:!1}),!t.isComplete&&(0,o.jsx)(l.Text,{style:O.interruptedText,children:"(interrupted)"})]})}function y(e,t){var n=e=>e.split('/').pop()||e;switch(e){case"Read":return{label:"read",value:n(t?.file_path||"file")};case"Edit":return{label:"edit",value:n(t?.file_path||"file")};case"Write":return{label:"write",value:n(t?.file_path||"file")};case"Bash":var i=t?.command||"";return{label:"$",value:i.length>45?i.slice(0,45)+"\u2026":i};case"Glob":return{label:"glob",value:t?.pattern||"*"};case"Grep":return{label:"grep",value:t?.pattern||"search"};case"Task":return{label:"agent",value:t?.description||"task"};default:return{label:e.toLowerCase(),value:""}}}function I(e){var t=e.toolName,n=e.input,i=e.isFailed,s=y(t,n),c=s.label,u=s.value;return(0,o.jsxs)(l.View,{style:O.toolLine,children:[(0,o.jsx)(l.Text,{style:i?O.toolLabelFailed:O.toolLabel,children:c}),(0,o.jsx)(l.Text,{style:i?O.toolValueFailed:O.toolValue,numberOfLines:1,children:u}),i&&(0,o.jsx)(l.Text,{style:O.toolLabelFailed,children:" \u2715"})]})}function G(e){var t=e.part;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function b(e){var t=e.tool;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function A(e){var t=e.result;return!t.success&&t.error?(0,o.jsx)(l.View,{style:O.errorContainer,children:(0,o.jsx)(l.Text,{style:O.errorText,children:t.error})}):(0,o.jsxs)(l.View,{style:O.resultContainer,children:[t.result&&(0,o.jsx)(l.Text,{style:O.responseText,selectable:!0,children:t.result}),(void 0!==t.costUsd||void 0!==t.durationMs)&&(0,o.jsxs)(l.Text,{style:O.metaText,children:[void 0!==t.durationMs&&`${t.durationMs}ms`,void 0!==t.costUsd&&void 0!==t.durationMs&&" \u2022 ",void 0!==t.costUsd&&`$${t.costUsd.toFixed(4)}`]})]})}var O=l.StyleSheet.create({wrapper:{flex:1,position:"relative"},container:{flex:1,backgroundColor:s.COLORS.BACKGROUND},content:{padding:s.LAYOUT.CONTENT_PADDING_H,paddingBottom:s.SPACING.XXL},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:s.SPACING.XXL},emptyText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,textAlign:"center",lineHeight:22},messageContainer:{flexDirection:"row",flexWrap:"wrap"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:s.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},resultContainer:{marginTop:s.SPACING.SM},partsContainer:{},formattedContainer:{flexDirection:"column"},listItem:{flexDirection:"row",marginVertical:s.SPACING.XS/2,paddingLeft:s.SPACING.SM},listNumber:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:s.SPACING.SM,padding:s.SPACING.MD,marginVertical:s.SPACING.SM},codeLang:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS,fontFamily:"Menlo",marginBottom:s.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"Menlo",fontSize:s.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_XL,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:s.SPACING.MD,marginBottom:s.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},boldText:{fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:s.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:s.COLORS.TEXT_MUTED},linkText:{color:s.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:s.SPACING.MD,marginVertical:s.SPACING.XS},blockquoteText:{color:s.COLORS.TEXT_SECONDARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:s.COLORS.BORDER,marginVertical:s.SPACING.MD},paragraphBreak:{height:s.SPACING.SM},interruptedText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontStyle:"italic",marginTop:s.SPACING.XS},metaText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,marginTop:s.SPACING.SM+2},errorContainer:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},errorText:{color:"#FF6B6B",fontSize:s.TYPOGRAPHY.SIZE_MD},systemContainer:{backgroundColor:"rgba(255,255,255,0.05)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},systemText:{color:s.COLORS.TEXT_TERTIARY,fontSize:s.TYPOGRAPHY.SIZE_MD,fontStyle:"italic"},toolLine:{flexDirection:"row",alignItems:"center",marginVertical:s.SPACING.XS},toolLabel:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolLabelFailed:{color:"rgba(255,100,100,0.6)",fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolValue:{color:"rgba(255,255,255,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},toolValueFailed:{color:"rgba(255,100,100,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},userPromptContainer:{backgroundColor:"rgba(0,122,255,0.15)",borderRadius:s.LAYOUT.BORDER_RADIUS_SM+2,padding:s.SPACING.MD,marginVertical:s.SPACING.SM,alignSelf:"flex-end",maxWidth:"85%"},userPromptText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:20},userImages:{flexDirection:"row",flexWrap:"wrap",gap:s.SPACING.SM,marginBottom:s.SPACING.SM},userImageThumb:{width:80,height:80,borderRadius:s.SPACING.SM,backgroundColor:"rgba(255,255,255,0.1)"},scrollButton:{position:"absolute",bottom:s.LAYOUT.CONTENT_PADDING_H,alignSelf:"center",left:"50%",marginLeft:-18,width:36,height:36,borderRadius:18,backgroundColor:"rgba(255,255,255,0.12)",borderWidth:1,borderColor:"rgba(255,255,255,0.2)",alignItems:"center",justifyContent:"center"},scrollButtonText:{color:s.COLORS.TEXT_PRIMARY,fontSize:18,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD}})},520,[29,63,258,519,250]);
573
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GitChangesTab=function(c){var f=c.changes,x=c.onDiscard;if(!(f.length>0))return(0,n.jsxs)(t.View,{style:s.emptyContainer,children:[(0,n.jsx)(t.Text,{style:s.emptyTitle,children:"No uncommitted changes"}),(0,n.jsx)(t.Text,{style:s.emptySubtext,children:"Your working directory is clean"})]});return(0,n.jsxs)(t.View,{style:s.container,children:[(0,n.jsx)(t.ScrollView,{style:s.fileList,contentContainerStyle:s.fileListContent,children:f.map((c,f)=>(0,n.jsxs)(t.View,{style:s.fileRow,children:[(0,n.jsx)(t.Text,{style:[s.statusIcon,{color:l[c.status]}],children:o[c.status]}),(0,n.jsx)(t.Text,{style:s.fileName,numberOfLines:1,children:c.file})]},`${c.file}-${f}`))}),(0,n.jsxs)(t.View,{style:s.footer,children:[(0,n.jsx)(t.TouchableOpacity,{style:s.discardButton,onPress:x,children:(0,n.jsx)(t.Text,{style:s.discardText,children:"Discard All Changes"})}),(0,n.jsx)(t.Text,{style:s.warningText,children:"Note: Discarding won't reset memory"})]})]})},r(d[0]);var t=r(d[1]),n=r(d[2]),o={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?"},l={added:"#30D158",modified:"#FFD60A",deleted:"#FF453A",renamed:"#BF5AF2",untracked:"#8E8E93"};var s=t.StyleSheet.create({container:{flex:1,backgroundColor:"#000"},emptyContainer:{flex:1,backgroundColor:"#000",alignItems:"center",justifyContent:"center",padding:24},emptyTitle:{color:"rgba(255,255,255,0.6)",fontSize:16,fontWeight:"500",marginBottom:8},emptySubtext:{color:"rgba(255,255,255,0.4)",fontSize:14},fileList:{flex:1},fileListContent:{padding:16},fileRow:{flexDirection:"row",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255,255,255,0.06)"},statusIcon:{width:20,fontSize:13,fontWeight:"600",fontFamily:"Menlo"},fileName:{flex:1,color:"rgba(255,255,255,0.8)",fontSize:14,fontFamily:"Menlo"},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(255,255,255,0.08)",alignItems:"center"},discardButton:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:12,paddingVertical:12,paddingHorizontal:24,marginBottom:8},discardText:{color:"#FF3B30",fontSize:15,fontWeight:"500"},warningText:{color:"rgba(255,255,255,0.3)",fontSize:12}})},521,[63,258,250]);
574
+ __d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t,e){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var s={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};e&&e.length>0&&(s.imagePaths=e),this.ws.send(JSON.stringify(s)),this.setStatus("processing")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"sendPushToken",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"register_push_token",token:t}))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},522,[8,9]);
575
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.requestPushToken=function(){return u.apply(this,arguments)},_e.setupTapHandler=function(e){return console.log("[expo-air] setupTapHandler: tap handling managed by main app"),()=>{}};var e,n=r(d[0]),o=(e=n)&&e.__esModule?e:{default:e},t=r(d[1]).NativeModules.WidgetBridge;function u(){return(u=(0,o.default)(function*(){try{if(!t?.requestPushToken)return console.log("[expo-air] WidgetBridge.requestPushToken not available"),null;console.log("[expo-air] Requesting push token via native bridge");var e=yield t.requestPushToken();return e?(console.log("[expo-air] Got push token:",e),e):(console.log("[expo-air] Push notification permission denied or token unavailable"),null)}catch(e){return console.error("[expo-air] Failed to get push token:",e),null}})).apply(this,arguments)}},523,[346,258]);
576
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BranchSwitcher=function(e){var t=e.branches,h=(e.currentBranch,e.onSelect),b=e.onCreate,u=e.onClose,C=e.error,I=(0,n.useState)(!1),T=(0,o.default)(I,2),p=T[0],P=T[1],O=(0,n.useState)(""),x=(0,o.default)(O,2),A=x[0],f=x[1],y=()=>{var e=A.trim();e&&(b(e),f(""),P(!1))};return(0,s.jsxs)(l.View,{style:S.overlay,children:[(0,s.jsx)(l.TouchableOpacity,{style:S.backdrop,onPress:u,activeOpacity:1}),(0,s.jsxs)(l.View,{style:S.dropdown,children:[C&&(0,s.jsx)(l.View,{style:S.errorBanner,children:(0,s.jsx)(l.Text,{style:S.errorText,numberOfLines:2,children:C})}),(0,s.jsx)(l.ScrollView,{style:S.branchList,bounces:!1,children:t.map((e,t)=>(0,s.jsxs)(l.TouchableOpacity,{style:[S.branchItem,e.isCurrent&&S.branchItemCurrent,0===t&&S.branchItemFirst],onPress:()=>{e.isCurrent||h(e.name)},activeOpacity:e.isCurrent?1:.6,children:[(0,s.jsxs)(l.View,{style:S.branchInfo,children:[(0,s.jsx)(l.Text,{style:[S.branchName,e.isCurrent&&S.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,s.jsx)(l.View,{style:S.prBadge,children:(0,s.jsxs)(l.Text,{style:S.prBadgeText,children:["#",e.prNumber]})})]}),e.isCurrent&&(0,s.jsx)(l.Text,{style:S.currentIndicator,children:"\u2713"})]},e.name))}),(0,s.jsx)(l.View,{style:S.createSection,children:p?(0,s.jsxs)(l.View,{style:S.createInputRow,children:[(0,s.jsx)(l.TextInput,{style:S.createInput,value:A,onChangeText:f,placeholder:"branch-name",placeholderTextColor:c.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:y,returnKeyType:"done"}),(0,s.jsx)(l.TouchableOpacity,{style:[S.createConfirmButton,!A.trim()&&S.createConfirmDisabled],onPress:y,disabled:!A.trim(),children:(0,s.jsx)(l.Text,{style:S.createConfirmText,children:"Create"})})]}):(0,s.jsx)(l.TouchableOpacity,{style:S.createButton,onPress:()=>P(!0),children:(0,s.jsx)(l.Text,{style:S.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),l=r(d[2]),c=r(d[3]),s=r(d[4]);var S=l.StyleSheet.create({overlay:{...l.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...l.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:c.SPACING.SM,right:c.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:c.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},branchList:{maxHeight:300},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.MD+2,borderBottomWidth:l.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:c.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:c.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:c.TYPOGRAPHY.SIZE_MD,fontWeight:c.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:c.COLORS.TEXT_PRIMARY,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:c.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:c.COLORS.STATUS_INFO,fontSize:c.TYPOGRAPHY.SIZE_XS,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},currentIndicator:{color:c.COLORS.STATUS_SUCCESS,fontSize:c.TYPOGRAPHY.SIZE_SM,marginLeft:c.SPACING.SM},createSection:{paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.MD,borderTopWidth:l.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:c.SPACING.XS},createButtonText:{color:c.COLORS.STATUS_INFO,fontSize:c.TYPOGRAPHY.SIZE_MD,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:c.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:c.COLORS.TEXT_PRIMARY,fontSize:c.TYPOGRAPHY.SIZE_MD,paddingHorizontal:c.SPACING.MD,paddingVertical:c.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:c.COLORS.STATUS_INFO,paddingHorizontal:c.SPACING.MD,paddingVertical:c.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:c.COLORS.TEXT_PRIMARY,fontSize:c.TYPOGRAPHY.SIZE_SM,fontWeight:c.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.SM,borderBottomWidth:l.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:c.TYPOGRAPHY.SIZE_SM}})},524,[29,63,258,519,250]);
545
577
  __r(1);
546
578
  __r(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10play/expo-air",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Vibe Coding for React-Native",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -74,6 +74,18 @@ const withAppDelegatePatch = (config) => {
74
74
  fs.writeFileSync(appDelegatePath, content);
75
75
  console.log("[expo-air] Patched AppDelegate for tunnel support");
76
76
  }
77
+ // Patch bridging header to expose RCTBridge to Swift.
78
+ // The prebuilt React.framework module map doesn't include RCTBridge.h,
79
+ // but the generated AppDelegate references RCTBridge in sourceURL(for:).
80
+ const bridgingHeaderPath = path.join(projectRoot, "ios", config.modRequest.projectName || "", `${config.modRequest.projectName || ""}-Bridging-Header.h`);
81
+ if (fs.existsSync(bridgingHeaderPath)) {
82
+ let header = fs.readFileSync(bridgingHeaderPath, "utf-8");
83
+ if (!header.includes("RCTBridge.h")) {
84
+ header += `#import <React/RCTBridge.h>\n`;
85
+ fs.writeFileSync(bridgingHeaderPath, header);
86
+ console.log("[expo-air] Patched bridging header for RCTBridge");
87
+ }
88
+ }
77
89
  return config;
78
90
  },
79
91
  ]);
@@ -13,6 +13,7 @@ import {
13
13
  type AnyConversationEntry,
14
14
  type AssistantPart,
15
15
  type AssistantPartsMessage,
16
+ type ImageAttachment,
16
17
  } from "./services/websocket";
17
18
  import { requestPushToken, setupTapHandler } from "./services/notifications";
18
19
  import { BranchSwitcher } from "./components/BranchSwitcher";
@@ -66,7 +67,9 @@ export function BubbleContent({
66
67
  const [activeTab, setActiveTab] = useState<TabType>("chat");
67
68
  const [showBranchSwitcher, setShowBranchSwitcher] = useState(false);
68
69
  const [branches, setBranches] = useState<BranchInfo[]>([]);
70
+ const [branchesLoading, setBranchesLoading] = useState(false);
69
71
  const [branchError, setBranchError] = useState<string | null>(null);
72
+ const previousBranchRef = useRef<string>("main");
70
73
  const pushTokenSentRef = useRef(false);
71
74
  const partIdCounter = useRef(0);
72
75
  // Use refs to avoid stale closure issues in handleMessage callback
@@ -294,12 +297,19 @@ export function BubbleContent({
294
297
  break;
295
298
  case "branches_list":
296
299
  setBranches(message.branches);
300
+ setBranchesLoading(false);
297
301
  break;
298
302
  case "branch_switched":
299
303
  if (message.success) {
300
- setShowBranchSwitcher(false);
301
304
  setBranchError(null);
302
305
  } else if (message.error) {
306
+ // Revert optimistic update on failure
307
+ const prev = previousBranchRef.current;
308
+ setBranchName(prev);
309
+ setBranches((b) =>
310
+ b.map((br) => ({ ...br, isCurrent: br.name === prev }))
311
+ );
312
+ setShowBranchSwitcher(true);
303
313
  setBranchError(message.error);
304
314
  }
305
315
  break;
@@ -314,7 +324,7 @@ export function BubbleContent({
314
324
  }
315
325
  }, [finalizeCurrentParts]);
316
326
 
317
- const handleSubmit = useCallback(async (prompt: string) => {
327
+ const handleSubmit = useCallback(async (prompt: string, images?: ImageAttachment[]) => {
318
328
  // Request push token on first submit (dev-only, lazy permission)
319
329
  if (!pushTokenSentRef.current) {
320
330
  const token = await requestPushToken();
@@ -327,12 +337,13 @@ export function BubbleContent({
327
337
  }
328
338
  }
329
339
 
330
- // Add user prompt to messages for display
340
+ // Add user prompt to messages for display (with local image URIs)
331
341
  setMessages((prev) => [
332
342
  ...prev,
333
343
  {
334
344
  type: "user_prompt" as const,
335
345
  content: prompt,
346
+ images,
336
347
  timestamp: Date.now(),
337
348
  },
338
349
  ]);
@@ -341,9 +352,15 @@ export function BubbleContent({
341
352
  currentPromptIdRef.current = null;
342
353
  setCurrentParts([]);
343
354
 
355
+ // Send prompt immediately with local file paths
356
+ // The server runs on the same machine and can read simulator temp files directly
357
+ const imagePaths = images && images.length > 0
358
+ ? images.map((img) => img.uri)
359
+ : undefined;
360
+
344
361
  const client = getWebSocketClient();
345
362
  if (client) {
346
- client.sendPrompt(prompt);
363
+ client.sendPrompt(prompt, imagePaths);
347
364
  }
348
365
  }, []);
349
366
 
@@ -388,6 +405,7 @@ export function BubbleContent({
388
405
  setShowBranchSwitcher((prev) => !prev);
389
406
  // Fetch branches when opening (side-effect outside state updater)
390
407
  if (!showBranchSwitcher) {
408
+ setBranchesLoading(true);
391
409
  const client = getWebSocketClient();
392
410
  if (client) {
393
411
  client.requestBranches();
@@ -397,11 +415,18 @@ export function BubbleContent({
397
415
 
398
416
  const handleBranchSelect = useCallback((name: string) => {
399
417
  setBranchError(null);
418
+ // Optimistically update UI before server confirms
419
+ previousBranchRef.current = branchName;
420
+ setBranchName(name);
421
+ setBranches((prev) =>
422
+ prev.map((b) => ({ ...b, isCurrent: b.name === name }))
423
+ );
424
+ setShowBranchSwitcher(false);
400
425
  const client = getWebSocketClient();
401
426
  if (client) {
402
427
  client.requestSwitchBranch(name);
403
428
  }
404
- }, []);
429
+ }, [branchName]);
405
430
 
406
431
  const handleBranchCreate = useCallback((name: string) => {
407
432
  setBranchError(null);
@@ -460,6 +485,7 @@ export function BubbleContent({
460
485
  <BranchSwitcher
461
486
  branches={branches}
462
487
  currentBranch={branchName}
488
+ loading={branchesLoading}
463
489
  onSelect={handleBranchSelect}
464
490
  onCreate={handleBranchCreate}
465
491
  onClose={() => { setShowBranchSwitcher(false); setBranchError(null); }}