@10play/expo-air 0.13.10 → 0.13.11

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.
@@ -532,7 +532,7 @@ __d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{v
532
532
  __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 l}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};r(d[1]).default;var u={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('number'==typeof e)n.default.vibrate(e);else{if(!Array.isArray(e))throw new Error('Vibration pattern should be a number or array');n.default.vibrateByPattern(e,t?0:-1)}},cancel:function(){n.default.cancel()}},l=u},480,[481,60]);
533
533
  __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},481,[482]);
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 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')},482,[50]);
535
- __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size;var t=e.color,x=void 0===t?"#000000":t,p=e.expanded,E=void 0!==p&&p,B=e.serverUrl,v=void 0===B?"ws://localhost:3847":B,j=(0,s.useState)("chat"),A=(0,n.default)(j,2),G=A[0],w=A[1],y=(0,s.useRef)(null),N=(0,s.useState)(E),_=(0,n.default)(N,2),I=_[0],L=_[1];(0,s.useEffect)(()=>{if(P){var e=new o.NativeEventEmitter(P).addListener("onExpandCollapse",e=>{L(e.expanded)});return()=>e.remove()}},[]),(0,s.useEffect)(()=>{L(E)},[E]);var D=(0,s.useRef)(()=>{}),M=(0,s.useCallback)(e=>{D.current(e)},[]),Y=(0,b.useWebSocketMessages)({serverUrl:v,onGitMessage:M}),U=Y.status,k=Y.messages,V=Y.currentParts,H=Y.handleSubmit,z=Y.handleNewSession,W=Y.handleStop,X=(0,f.useGitState)({handleSubmit:H,setActiveTab:w});if(D.current=X.handleGitMessage,(0,s.useEffect)(()=>{I&&"chat"===G&&setTimeout(()=>y.current?.focus(),100)},[I]),!I)return(0,R.jsx)(o.View,{style:O.collapsedPill,children:(0,R.jsx)(S.PulsingIndicator,{status:U})});return(0,R.jsxs)(o.View,{style:[O.expanded,{backgroundColor:x}],children:[(0,R.jsx)(S.Header,{status:U,branchName:X.branchName,onBranchPress:X.handleBranchPress}),(0,R.jsx)(C.TabBar,{activeTab:G,onTabChange:w,onNewSession:z,canStartNew:"connected"===U,hasPR:X.hasPR,hasChanges:X.gitChanges.length>0,prNumber:X.prNumber,onCreatePR:X.handleCreatePR,onCommit:X.handleCommit,onViewPR:X.handleViewPR}),(0,R.jsx)(o.View,{style:O.body,children:"disconnected"===U&&0===k.length?(0,R.jsx)(T,{}):"chat"===G?(0,R.jsx)(l.ResponseArea,{messages:k,currentParts:V,status:U}):(0,R.jsx)(h.GitChangesTab,{changes:X.gitChanges,onDiscard:X.handleDiscard})}),"chat"===G&&(0,R.jsx)(c.PromptInput,{ref:y,onSubmit:H,onStop:W,disabled:"disconnected"===U,isSending:"sending"===U,isProcessing:"processing"===U}),X.showBranchSwitcher&&(0,R.jsx)(u.BranchSwitcher,{branches:X.branches,currentBranch:X.branchName,onSelect:X.handleBranchSelect,onCreate:X.handleBranchCreate,onClose:()=>{X.setShowBranchSwitcher(!1),X.setBranchError(null)},error:X.branchError})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]),c=r(d[3]),l=r(d[4]),h=r(d[5]),u=r(d[6]),S=r(d[7]),C=r(d[8]),b=r(d[9]),f=r(d[10]),x=r(d[11]),R=r(d[12]),P=o.NativeModules.WidgetBridge;function T(){return(0,R.jsxs)(o.View,{style:O.disconnectedContainer,children:[(0,R.jsx)(o.Text,{style:O.disconnectedTitle,children:"Server not running"}),(0,R.jsx)(o.Text,{style:O.disconnectedSubtitle,children:"Start the development server from your project directory:"}),(0,R.jsx)(o.View,{style:O.codeBlock,children:(0,R.jsx)(o.Text,{style:O.codeText,children:"npx expo-air fly"})})]})}var O=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},expanded:{flex:1,backgroundColor:x.COLORS.BACKGROUND,borderRadius:x.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},body:{flex:1,backgroundColor:x.COLORS.BACKGROUND_ELEVATED},disconnectedContainer:{flex:1,justifyContent:"center",alignItems:"center",paddingHorizontal:x.SPACING.XXL},disconnectedTitle:{color:x.COLORS.TEXT_MUTED,fontSize:x.TYPOGRAPHY.SIZE_LG,fontWeight:x.TYPOGRAPHY.WEIGHT_SEMIBOLD,marginBottom:x.SPACING.SM},disconnectedSubtitle:{color:x.COLORS.TEXT_MUTED,fontSize:x.TYPOGRAPHY.SIZE_SM,textAlign:"center",marginBottom:x.SPACING.LG},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:x.LAYOUT.BORDER_RADIUS_SM,paddingHorizontal:x.SPACING.LG,paddingVertical:x.SPACING.MD,borderWidth:1,borderColor:x.COLORS.BORDER},codeText:{color:x.COLORS.TEXT_SECONDARY,fontSize:x.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo"}})},483,[29,63,258,484,486,489,490,491,492,493,495,485,248]);
535
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size;var t=e.color,f=void 0===t?"#000000":t,O=e.expanded,E=void 0!==O&&O,A=e.serverUrl,v=void 0===A?"ws://localhost:3847":A,B=e.action,j=(0,o.useState)("chat"),w=(0,n.default)(j,2),G=w[0],y=w[1],N=(0,o.useRef)(null),_=(0,o.useState)(E),I=(0,n.default)(_,2),L=I[0],D=I[1];(0,o.useEffect)(()=>{if(R){var e=new s.NativeEventEmitter(R).addListener("onExpandCollapse",e=>{D(e.expanded)});return()=>e.remove()}},[]),(0,o.useEffect)(()=>{D(E)},[E]);var M=(0,o.useRef)(()=>{}),Y=(0,o.useCallback)(e=>{M.current(e)},[]),k=(0,b.useWebSocketMessages)({serverUrl:v,onGitMessage:Y}),U=k.status,V=k.messages,H=k.currentParts,z=k.handleSubmit,W=k.handleNewSession,X=k.handleStop,Z=(0,x.useGitState)({handleSubmit:z,setActiveTab:y});M.current=Z.handleGitMessage;var F=(0,o.useCallback)(()=>{try{R?.onActionPress&&R.onActionPress()}catch(e){console.warn("[expo-air] Failed to emit action press:",e)}},[]);if((0,o.useEffect)(()=>{L&&"chat"===G&&setTimeout(()=>N.current?.focus(),100)},[L]),!L)return(0,P.jsx)(s.View,{style:p.collapsedPill,children:(0,P.jsx)(S.PulsingIndicator,{status:U})});return(0,P.jsxs)(s.View,{style:[p.expanded,{backgroundColor:f}],children:[(0,P.jsx)(S.Header,{status:U,branchName:Z.branchName,onBranchPress:Z.handleBranchPress,action:B,onActionPress:F}),(0,P.jsx)(C.TabBar,{activeTab:G,onTabChange:y,onNewSession:W,canStartNew:"connected"===U,hasPR:Z.hasPR,hasChanges:Z.gitChanges.length>0,prNumber:Z.prNumber,onCreatePR:Z.handleCreatePR,onCommit:Z.handleCommit,onViewPR:Z.handleViewPR}),(0,P.jsx)(s.View,{style:p.body,children:"disconnected"===U&&0===V.length?(0,P.jsx)(T,{}):"chat"===G?(0,P.jsx)(l.ResponseArea,{messages:V,currentParts:H,status:U}):(0,P.jsx)(h.GitChangesTab,{changes:Z.gitChanges,onDiscard:Z.handleDiscard})}),"chat"===G&&(0,P.jsx)(c.PromptInput,{ref:N,onSubmit:z,onStop:X,disabled:"disconnected"===U,isSending:"sending"===U,isProcessing:"processing"===U}),Z.showBranchSwitcher&&(0,P.jsx)(u.BranchSwitcher,{branches:Z.branches,currentBranch:Z.branchName,onSelect:Z.handleBranchSelect,onCreate:Z.handleBranchCreate,onClose:()=>{Z.setShowBranchSwitcher(!1),Z.setBranchError(null)},error:Z.branchError})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),s=r(d[2]),c=r(d[3]),l=r(d[4]),h=r(d[5]),u=r(d[6]),S=r(d[7]),C=r(d[8]),b=r(d[9]),x=r(d[10]),f=r(d[11]),P=r(d[12]),R=s.NativeModules.WidgetBridge;function T(){return(0,P.jsxs)(s.View,{style:p.disconnectedContainer,children:[(0,P.jsx)(s.Text,{style:p.disconnectedTitle,children:"Server not running"}),(0,P.jsx)(s.Text,{style:p.disconnectedSubtitle,children:"Start the development server from your project directory:"}),(0,P.jsx)(s.View,{style:p.codeBlock,children:(0,P.jsx)(s.Text,{style:p.codeText,children:"npx expo-air fly"})})]})}var p=s.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},expanded:{flex:1,backgroundColor:f.COLORS.BACKGROUND,borderRadius:f.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},body:{flex:1,backgroundColor:f.COLORS.BACKGROUND_ELEVATED},disconnectedContainer:{flex:1,justifyContent:"center",alignItems:"center",paddingHorizontal:f.SPACING.XXL},disconnectedTitle:{color:f.COLORS.TEXT_MUTED,fontSize:f.TYPOGRAPHY.SIZE_LG,fontWeight:f.TYPOGRAPHY.WEIGHT_SEMIBOLD,marginBottom:f.SPACING.SM},disconnectedSubtitle:{color:f.COLORS.TEXT_MUTED,fontSize:f.TYPOGRAPHY.SIZE_SM,textAlign:"center",marginBottom:f.SPACING.LG},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:f.LAYOUT.BORDER_RADIUS_SM,paddingHorizontal:f.SPACING.LG,paddingVertical:f.SPACING.MD,borderWidth:1,borderColor:f.COLORS.BORDER},codeText:{color:f.COLORS.TEXT_SECONDARY,fontSize:f.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo"}})},483,[29,63,258,484,486,489,490,491,492,493,495,485,248]);
536
536
  __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=r(d[4]),l=r(d[5]),u=(0,o.forwardRef)((e,u)=>{var b=e.onSubmit,C=e.onStop,T=e.disabled,I=void 0!==T&&T,O=e.isSending,w=void 0!==O&&O,R=e.isProcessing,v=void 0!==R&&R,f=(0,o.useState)(""),y=(0,i.default)(f,2),B=y[0],x=y[1],N=(0,o.useState)([]),L=(0,i.default)(N,2),j=L[0],A=L[1],_=(0,o.useRef)(null);(0,o.useImperativeHandle)(u,()=>({focus:()=>_.current?.focus()})),(0,o.useEffect)(()=>{if(n.NativeModules.WidgetBridge){var e=new n.NativeEventEmitter(n.NativeModules.WidgetBridge).addListener('onClipboardImagePaste',e=>{A(t=>t.length>=4?t:[...t,e])});return()=>e.remove()}},[]);var E=w||v,P=()=>{var e=B.trim();!(e.length>0||j.length>0)||I||E||(b(e,j.length>0?j:void 0),x(""),A([]))},M=(function(){var e=(0,t.default)(function*(){if(n.NativeModules.WidgetBridge)if(j.length>=4)n.Alert.alert("Limit reached","Maximum 4 images per message.");else try{var e=yield n.NativeModules.WidgetBridge.pickImages(4-j.length,.7);if(!e.canceled&&e.assets.length>0){var t=e.assets.map(e=>({uri:e.uri,width:e.width,height:e.height}));A(e=>[...e,...t].slice(0,4))}}catch(e){console.warn("[expo-air] Image picker error:",e)}});return function(){return e.apply(this,arguments)}})(),U=e=>{A(t=>t.filter((t,i)=>i!==e))},V=(B.trim().length>0||j.length>0)&&!I&&!E;return(0,l.jsxs)(n.View,{style:S.outerContainer,children:[j.length>0&&(0,l.jsx)(n.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:S.previewStrip,contentContainerStyle:S.previewContent,children:j.map((e,t)=>(0,l.jsxs)(n.View,{style:S.previewItem,children:[(0,l.jsx)(n.Image,{source:{uri:e.uri},style:S.previewImage}),(0,l.jsx)(n.TouchableOpacity,{style:S.removeButton,onPress:()=>U(t),hitSlop:{top:6,bottom:6,left:6,right:6},children:(0,l.jsxs)(n.View,{style:S.removeIcon,children:[(0,l.jsx)(n.View,{style:[S.removeLine,S.removeLineA]}),(0,l.jsx)(n.View,{style:[S.removeLine,S.removeLineB]})]})})]},t))}),(0,l.jsxs)(n.View,{style:S.container,children:[(0,l.jsx)(n.TouchableOpacity,{style:S.iconButton,onPress:M,disabled:E,activeOpacity:.6,children:(0,l.jsx)(c,{})}),(0,l.jsx)(n.TextInput,{ref:_,style:S.input,placeholder:"Ask Claude...",placeholderTextColor:s.COLORS.TEXT_TERTIARY,value:B,onChangeText:x,onSubmitEditing:P,editable:!E,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),v?(0,l.jsx)(n.TouchableOpacity,{style:[S.submitButton,S.stopButton],onPress:C,activeOpacity:.7,children:(0,l.jsx)(p,{})}):(0,l.jsx)(n.TouchableOpacity,{style:[S.submitButton,!V&&S.submitButtonDisabled],onPress:P,disabled:!V,activeOpacity:.7,children:(0,l.jsx)(h,{})})]})]})});function c(){return(0,l.jsxs)(n.View,{style:S.plusIcon,children:[(0,l.jsx)(n.View,{style:S.plusH}),(0,l.jsx)(n.View,{style:S.plusV})]})}function h(){return(0,l.jsxs)(n.View,{style:S.arrowIcon,children:[(0,l.jsx)(n.View,{style:S.arrowLine}),(0,l.jsx)(n.View,{style:S.arrowHead})]})}function p(){return(0,l.jsx)(n.View,{style:S.stopIcon})}var S=n.StyleSheet.create({outerContainer:{borderTopWidth:1,borderTopColor:s.COLORS.BORDER,backgroundColor:s.COLORS.BACKGROUND},previewStrip:{maxHeight:72,paddingHorizontal:s.LAYOUT.CONTENT_PADDING_H,paddingTop:s.SPACING.SM},previewContent:{gap:s.SPACING.SM,alignItems:"center"},previewItem:{position:"relative"},previewImage:{width:56,height:56,borderRadius:s.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:s.LAYOUT.CONTENT_PADDING_H,paddingVertical:s.SPACING.MD},iconButton:{width:s.SIZES.SUBMIT_BUTTON,height:s.SIZES.SUBMIT_BUTTON,borderRadius:s.SIZES.SUBMIT_BUTTON/2,backgroundColor:s.COLORS.BACKGROUND_INPUT,alignItems:"center",justifyContent:"center",marginRight:s.SPACING.SM},input:{flex:1,backgroundColor:s.COLORS.BACKGROUND_INPUT,borderRadius:22,paddingHorizontal:18,paddingVertical:s.SPACING.MD,color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_LG,maxHeight:100},submitButton:{width:s.SIZES.SUBMIT_BUTTON,height:s.SIZES.SUBMIT_BUTTON,borderRadius:s.SIZES.SUBMIT_BUTTON/2,backgroundColor:s.COLORS.BACKGROUND_BUTTON,alignItems:"center",justifyContent:"center",marginLeft:s.SPACING.SM+2},submitButtonDisabled:{opacity:.4},stopButton:{backgroundColor:s.COLORS.STATUS_NEUTRAL},stopIcon:{width:12,height:12,backgroundColor:s.COLORS.TEXT_PRIMARY,borderRadius:2},arrowIcon:{width:16,height:16,alignItems:"center",justifyContent:"center"},arrowLine:{width:2,height:10,backgroundColor:s.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:s.COLORS.TEXT_PRIMARY},plusIcon:{width:18,height:18,alignItems:"center",justifyContent:"center"},plusH:{position:"absolute",width:16,height:2,borderRadius:1,backgroundColor:s.COLORS.TEXT_SECONDARY},plusV:{position:"absolute",width:2,height:16,borderRadius:1,backgroundColor:s.COLORS.TEXT_SECONDARY}})},484,[347,29,63,258,485,248]);
537
537
  __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}},485,[]);
538
538
  __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ResponseArea=function(e){var t=e.messages,l=e.currentParts,f=e.status,p=(0,i.useRef)(null),T=(0,i.useState)(!0),y=(0,n.default)(T,2),C=y[0],S=y[1],v=(0,i.useRef)(0),E=(0,i.useRef)(0),x=(0,i.useCallback)(e=>{var t=e.nativeEvent,n=t.contentOffset,i=t.contentSize,o=t.layoutMeasurement,s=i.height-o.height-n.y;S(s<50)},[]),A=(0,i.useCallback)((e,t)=>{v.current=t},[]),O=(0,i.useCallback)(e=>{E.current=e.nativeEvent.layout.height},[]);(0,i.useEffect)(()=>{if(C){var e=setTimeout(()=>{p.current?.scrollToEnd({animated:!1})},16);return()=>clearTimeout(e)}},[t,l,C]),(0,i.useEffect)(()=>{var e=t[t.length-1];"user_prompt"===e?.type&&(p.current?.scrollToEnd({animated:!0}),S(!0))},[t]),(0,i.useEffect)(()=>{var e=o.Keyboard.addListener("keyboardDidShow",()=>{C&&setTimeout(()=>{p.current?.scrollToEnd({animated:!0})},100)});return()=>e.remove()},[C]);var b=(0,i.useCallback)(()=>{p.current?.scrollToEnd({animated:!0}),S(!0)},[]);if(!(t.length>0||l.length>0))return(0,c.jsx)(o.View,{style:h.emptyContainer,children:(0,c.jsx)(o.Text,{style:h.emptyText,children:"Send a prompt to start coding with Claude"})});return(0,c.jsxs)(o.View,{style:h.wrapper,children:[(0,c.jsxs)(o.ScrollView,{ref:p,style:h.container,contentContainerStyle:h.content,showsVerticalScrollIndicator:!0,onScroll:x,onContentSizeChange:A,onLayout:O,scrollEventThrottle:16,children:[t.map((e,t)=>(0,c.jsx)(s.MessageItem,{message:e},t)),l.length>0&&(0,c.jsx)(s.PartsRenderer,{parts:l,isStreaming:!0}),"processing"===f&&0===l.length&&(0,c.jsx)(u,{})]}),!C&&(0,c.jsx)(o.TouchableOpacity,{style:h.scrollButton,onPress:b,activeOpacity:.8,children:(0,c.jsx)(o.Text,{style:h.scrollButtonText,children:"\u2193"})})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},i=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]);function u(){var e=(0,i.useRef)(new o.Animated.Value(.3)).current,t=(0,i.useRef)(new o.Animated.Value(.3)).current,n=(0,i.useRef)(new o.Animated.Value(.3)).current;return(0,i.useEffect)(()=>{var i=(e,t)=>o.Animated.loop(o.Animated.sequence([o.Animated.delay(t),o.Animated.timing(e,{toValue:1,duration:400,easing:o.Easing.ease,useNativeDriver:!0}),o.Animated.timing(e,{toValue:.3,duration:400,easing:o.Easing.ease,useNativeDriver:!0})])),s=i(e,0),l=i(t,150),c=i(n,300);return s.start(),l.start(),c.start(),()=>{s.stop(),l.stop(),c.stop()}},[e,t,n]),(0,c.jsx)(o.View,{style:h.thinkingContainer,children:[e,t,n].map((e,t)=>(0,c.jsx)(o.Animated.View,{style:[h.thinkingDot,{opacity:e}]},t))})}var h=o.StyleSheet.create({wrapper:{flex:1,position:"relative"},container:{flex:1,backgroundColor:l.COLORS.BACKGROUND},content:{padding:l.LAYOUT.CONTENT_PADDING_H,paddingBottom:l.SPACING.XXL},thinkingContainer:{flexDirection:"row",gap:6,paddingVertical:l.SPACING.MD},thinkingDot:{width:6,height:6,borderRadius:3,backgroundColor:l.COLORS.TEXT_MUTED},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:l.SPACING.XXL},emptyText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_LG,textAlign:"center",lineHeight:22},scrollButton:{position:"absolute",bottom:l.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:l.COLORS.TEXT_PRIMARY,fontSize:18,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD}})},486,[29,63,258,487,485,248]);
@@ -540,7 +540,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule'
540
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.FormattedText=function(e){var i=e.content,h=e.isStreaming,c=i.split('\n'),S=[],x=0;for(;x<c.length;){var u=c[x],P=u.trim();if(P.startsWith('```')){var f=[],G=P.slice(3).trim();for(x++;x<c.length&&!c[x].trim().startsWith('```');)f.push(c[x]),x++;S.push((0,o.jsxs)(l.View,{style:T.codeBlock,children:[G&&(0,o.jsx)(l.Text,{style:T.codeLang,children:G}),(0,o.jsx)(l.Text,{style:T.codeText,selectable:!0,children:f.join('\n')})]},`code-${x}`)),x++}else{var I=P.match(/^(#{1,6})\s+(.+)$/);if(I){var O=I[1].length,p=O<=2?T.heading1:O<=4?T.heading2:T.heading3;S.push((0,o.jsx)(l.Text,{style:p,selectable:!0,children:s(I[2])},x)),x++}else if(P.startsWith('> ')||'>'===P){for(var A=[];x<c.length&&(c[x].trim().startsWith('> ')||'>'===c[x].trim());){var C=c[x].trim().startsWith('> ')?c[x].trim().slice(2):'';A.push(C),x++}S.push((0,o.jsx)(l.View,{style:T.blockquote,children:(0,o.jsx)(l.Text,{style:T.blockquoteText,selectable:!0,children:s(A.join('\n'))})},`quote-${x}`))}else{var R=P.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(R){var L=' '!==R[1];S.push((0,o.jsxs)(l.View,{style:T.listItem,children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:L?'\u2611':'\u2610'}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(R[2])})]},x)),x++}else{var Y=u.match(/^(\s*)(\d+)\.\s+(.+)$/);if(Y){var E=Math.floor(Y[1].length/2),b=(0,t.default)(Y,4),y=b[2],M=b[3];S.push((0,o.jsxs)(l.View,{style:[T.listItem,E>0&&{paddingLeft:n.SPACING.SM+E*n.SPACING.LG}],children:[(0,o.jsxs)(l.Text,{style:T.listNumber,children:[y,"."]}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(M)})]},x)),x++}else{var _=u.match(/^(\s*)[-*]\s+(.+)$/);if(_){var H=Math.floor(_[1].length/2),j=0===H?'\u2022':1===H?'\u25e6':'\u25aa';S.push((0,o.jsxs)(l.View,{style:[T.listItem,H>0&&{paddingLeft:n.SPACING.SM+H*n.SPACING.LG}],children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:j}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(_[2])})]},x)),x++}else/^[-*_]{3,}$/.test(P)?(S.push((0,o.jsx)(l.View,{style:T.horizontalRule},x)),x++):P?(S.push((0,o.jsx)(l.Text,{style:T.responseText,selectable:!0,children:s(u)},x)),x++):(S.push((0,o.jsx)(l.View,{style:T.paragraphBreak},x)),x++)}}}}}return(0,o.jsxs)(l.View,{style:T.formattedContainer,children:[S,h&&(0,o.jsx)(l.View,{style:T.cursor})]})};var t=e(r(d[0])),i=e(r(d[1])),l=r(d[2]),n=r(d[3]),o=r(d[4]);function s(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?h(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(l.Text,{style:T.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(i.default.Fragment,{children:h(e)},t))}function h(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?c(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(l.Text,{style:T.linkText,onPress:()=>l.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(i.default.Fragment,{children:c(e)},t)})}function c(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:T.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(l.Text,{style:T.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(l.Text,{style:T.italicText,children:e.slice(1,-1)},t):e)}var T=l.StyleSheet.create({formattedContainer:{flexDirection:"column"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:n.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},listItem:{flexDirection:"row",marginVertical:n.SPACING.XS/2,paddingLeft:n.SPACING.SM},listNumber:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:n.SPACING.SM,padding:n.SPACING.MD,marginVertical:n.SPACING.SM},codeLang:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_XS,fontFamily:"monospace",marginBottom:n.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_SM,fontFamily:"monospace",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"monospace",fontSize:n.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:n.COLORS.TEXT_PRIMARY,fontSize:n.TYPOGRAPHY.SIZE_XL,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:n.SPACING.MD,marginBottom:n.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},boldText:{fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:n.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:n.COLORS.TEXT_MUTED},linkText:{color:n.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:n.SPACING.MD,marginVertical:n.SPACING.XS},blockquoteText:{color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:n.COLORS.BORDER,marginVertical:n.SPACING.MD},paragraphBreak:{height:n.SPACING.SM}})},488,[29,63,258,485,248]);
541
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,248]);
542
542
  __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,s=e.currentBranch,S=e.loading,b=e.onSelect,C=e.onCreate,p=e.onClose,I=e.error,P=(0,o.useState)(!1),x=(0,n.default)(P,2),f=x[0],A=x[1],O=(0,o.useState)(""),R=(0,n.default)(O,2),G=R[0],y=R[1],M=u(t,""),E=()=>{var e=G.trim();e&&(C(e),y(""),A(!1))},H=(e,t)=>{var n=e.name===s;return(0,c.jsxs)(i.TouchableOpacity,{style:[T.branchItem,n&&T.branchItemCurrent,t&&T.branchItemFirst],onPress:()=>{n||b(e.name)},activeOpacity:n?1:.6,children:[(0,c.jsxs)(i.View,{style:T.branchInfo,children:[(0,c.jsx)(i.Text,{style:[T.branchName,n&&T.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,c.jsx)(i.View,{style:T.prBadge,children:(0,c.jsxs)(i.Text,{style:T.prBadgeText,children:["#",e.prNumber]})}),e.isRemote&&(0,c.jsx)(i.View,{style:T.remoteBadge,children:(0,c.jsx)(i.Text,{style:T.remoteBadgeText,children:"remote"})})]}),n&&(0,c.jsx)(i.Text,{style:T.currentIndicator,children:"\u2713"})]},e.name)};return(0,c.jsxs)(i.View,{style:T.overlay,children:[(0,c.jsx)(i.TouchableOpacity,{style:T.backdrop,onPress:p,activeOpacity:1}),(0,c.jsxs)(i.View,{style:T.dropdown,children:[I&&(0,c.jsx)(i.View,{style:T.errorBanner,children:(0,c.jsx)(i.Text,{style:T.errorText,numberOfLines:2,children:I})}),S&&0===t.length?(0,c.jsx)(i.View,{style:T.loadingContainer,children:(0,c.jsx)(h,{})}):(0,c.jsx)(i.ScrollView,{style:T.branchList,bounces:!1,children:M.map(e=>(0,c.jsxs)(i.View,{children:[(0,c.jsx)(i.View,{style:T.sectionHeader,children:(0,c.jsx)(i.Text,{style:T.sectionHeaderText,children:e.title})}),e.branches.map((e,t)=>H(e,0===t))]},e.title))}),(0,c.jsx)(i.View,{style:T.createSection,children:f?(0,c.jsxs)(i.View,{style:T.createInputRow,children:[(0,c.jsx)(i.TextInput,{style:T.createInput,value:G,onChangeText:y,placeholder:"branch-name",placeholderTextColor:l.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:E,returnKeyType:"done"}),(0,c.jsx)(i.TouchableOpacity,{style:[T.createConfirmButton,!G.trim()&&T.createConfirmDisabled],onPress:E,disabled:!G.trim(),children:(0,c.jsx)(i.Text,{style:T.createConfirmText,children:"Create"})})]}):(0,c.jsx)(i.TouchableOpacity,{style:T.createButton,onPress:()=>A(!0),children:(0,c.jsx)(i.Text,{style:T.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),i=r(d[2]),l=r(d[3]),c=r(d[4]),s=["main","master"],S=5;function u(e,t){var n=t.toLowerCase().trim(),o=n?e.filter(e=>e.name.toLowerCase().includes(n)):e,i=o.filter(e=>s.includes(e.name)),l=o.filter(e=>!s.includes(e.name)),c=l.filter(e=>!e.isRemote).slice(0,S),u=new Set(c.map(e=>e.name)),h=l.filter(e=>!u.has(e.name)),T=[];return i.length>0&&T.push({title:"Default",branches:i}),c.length>0&&T.push({title:"Recent",branches:c}),h.length>0&&T.push({title:"Other",branches:h}),T}function h(){var e=(0,o.useRef)(new i.Animated.Value(.3)).current,t=(0,o.useRef)(new i.Animated.Value(.3)).current,n=(0,o.useRef)(new i.Animated.Value(.3)).current;return(0,o.useEffect)(()=>{var o=(e,t)=>i.Animated.loop(i.Animated.sequence([i.Animated.delay(t),i.Animated.timing(e,{toValue:1,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0}),i.Animated.timing(e,{toValue:.3,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0})])),l=o(e,0),c=o(t,150),s=o(n,300);return l.start(),c.start(),s.start(),()=>{l.stop(),c.stop(),s.stop()}},[e,t,n]),(0,c.jsx)(i.View,{style:T.loadingDots,children:[e,t,n].map((e,t)=>(0,c.jsx)(i.Animated.View,{style:[T.loadingDot,{opacity:e}]},t))})}var T=i.StyleSheet.create({overlay:{...i.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...i.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:l.SPACING.SM,right:l.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:l.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},loadingContainer:{paddingVertical:l.SPACING.XL,alignItems:"center",justifyContent:"center"},loadingDots:{flexDirection:"row",gap:6},loadingDot:{width:6,height:6,borderRadius:3,backgroundColor:"rgba(255,255,255,0.5)"},branchList:{maxHeight:300},sectionHeader:{paddingHorizontal:l.SPACING.LG,paddingTop:l.SPACING.MD,paddingBottom:l.SPACING.XS},sectionHeaderText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD,textTransform:"uppercase",letterSpacing:.5},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD+2,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:l.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:l.COLORS.TEXT_PRIMARY,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},remoteBadge:{backgroundColor:"rgba(255,255,255,0.06)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},remoteBadgeText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL},currentIndicator:{color:l.COLORS.STATUS_SUCCESS,fontSize:l.TYPOGRAPHY.SIZE_SM,marginLeft:l.SPACING.SM},createSection:{paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD,borderTopWidth:i.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:l.SPACING.XS},createButtonText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_MD,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:l.COLORS.STATUS_INFO,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_SM,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.SM,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:l.TYPOGRAPHY.SIZE_SM}})},490,[29,63,258,485,248]);
543
- __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,l=e.branchName,c=e.onBranchPress,O={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO};return(0,o.jsxs)(t.View,{style:T.header,children:[(0,o.jsx)(t.TouchableOpacity,{onPress:u,onLongPress:S,delayLongPress:500,style:T.closeButton,children:(0,o.jsx)(t.Text,{style:T.closeButtonText,children:"\u2715"})}),(0,o.jsx)(t.TouchableOpacity,{style:T.branchButton,onPress:c,disabled:!l,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Text,{style:T.branchName,numberOfLines:1,children:l}),(0,o.jsx)(t.Text,{style:T.branchChevron,children:"\u25be"})]}):(0,o.jsx)(t.View,{style:T.branchLoadingBar})}),(0,o.jsx)(t.TouchableOpacity,{onLongPress:S,delayLongPress:500,activeOpacity:.6,hitSlop:{top:10,bottom:10,left:10,right:10},style:T.statusDotTouchable,children:(0,o.jsx)(t.View,{style:[T.statusDot,{backgroundColor:O[s]}]})})]})},_e.PulsingIndicator=function(l){var c=l.status,S={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO},u="processing"===c||"connecting"===c||"sending"===c,O=(0,e.useRef)(new t.Animated.Value(1)).current,h=(0,e.useRef)(new t.Animated.Value(.4)).current;return(0,e.useEffect)(()=>{if(u){var e=t.Animated.loop(t.Animated.sequence([t.Animated.parallel([t.Animated.timing(O,{toValue:1.3,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0}),t.Animated.timing(h,{toValue:0,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0})]),t.Animated.parallel([t.Animated.timing(O,{toValue:1,duration:0,useNativeDriver:!0}),t.Animated.timing(h,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}O.setValue(1),h.setValue(.4)},[u,O,h]),(0,o.jsxs)(t.View,{style:T.indicatorContainer,children:[(0,o.jsx)(t.View,{style:[T.indicator,{backgroundColor:S[c]}]}),u&&(0,o.jsx)(s,{style:[T.indicatorRing,{borderColor:S[c],transform:[{scale:O}],opacity:h}]})]})};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=t.Animated.View,l=t.NativeModules.WidgetBridge,c=t.NativeModules.ExpoAir;function S(){try{l?.reloadMainApp?(console.log("[expo-air] Triggering main app reload"),l.reloadMainApp()):console.warn("[expo-air] No reloadMainApp method available")}catch(e){console.warn("[expo-air] Failed to reload main app:",e)}}function u(){try{l?.collapse?l.collapse():c?.collapse?c.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}var T=t.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.LAYOUT.CONTENT_PADDING_H,paddingVertical:n.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:n.COLORS.BORDER},closeButton:{width:n.SIZES.CLOSE_BUTTON,height:n.SIZES.CLOSE_BUTTON,borderRadius:n.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:n.SPACING.MD},closeButtonText:{color:"transparent",fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_SM,marginLeft:n.SPACING.XS},branchLoadingBar:{width:80,height:12,borderRadius:6,backgroundColor:"rgba(255,255,255,0.08)"},statusDot:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2,marginLeft:n.SPACING.MD},statusDotTouchable:{marginLeft:n.SPACING.MD,padding:10},collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4}})},491,[63,258,485,248]);
543
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,l=e.branchName,c=e.onBranchPress,O=e.action,h=e.onActionPress,A={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO};return(0,o.jsxs)(t.View,{style:u.header,children:[(0,o.jsx)(t.TouchableOpacity,{onPress:T,onLongPress:S,delayLongPress:500,style:u.closeButton,children:(0,o.jsx)(t.Text,{style:u.closeButtonText,children:"\u2715"})}),(0,o.jsx)(t.TouchableOpacity,{style:u.branchButton,onPress:c,disabled:!l,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Text,{style:u.branchName,numberOfLines:1,children:l}),(0,o.jsx)(t.Text,{style:u.branchChevron,children:"\u25be"})]}):(0,o.jsx)(t.View,{style:u.branchLoadingBar})}),O&&(0,o.jsx)(t.TouchableOpacity,{style:u.actionButton,onPress:h,activeOpacity:.7,children:(0,o.jsx)(t.Text,{style:[u.actionButtonText,O.textStyle],numberOfLines:1,children:O.label})}),(0,o.jsx)(t.TouchableOpacity,{onLongPress:S,delayLongPress:500,activeOpacity:.6,hitSlop:{top:10,bottom:10,left:10,right:10},style:u.statusDotTouchable,children:(0,o.jsx)(t.View,{style:[u.statusDot,{backgroundColor:A[s]}]})})]})},_e.PulsingIndicator=function(l){var c=l.status,S={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO},T="processing"===c||"connecting"===c||"sending"===c,O=(0,e.useRef)(new t.Animated.Value(1)).current,h=(0,e.useRef)(new t.Animated.Value(.4)).current;return(0,e.useEffect)(()=>{if(T){var e=t.Animated.loop(t.Animated.sequence([t.Animated.parallel([t.Animated.timing(O,{toValue:1.3,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0}),t.Animated.timing(h,{toValue:0,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0})]),t.Animated.parallel([t.Animated.timing(O,{toValue:1,duration:0,useNativeDriver:!0}),t.Animated.timing(h,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}O.setValue(1),h.setValue(.4)},[T,O,h]),(0,o.jsxs)(t.View,{style:u.indicatorContainer,children:[(0,o.jsx)(t.View,{style:[u.indicator,{backgroundColor:S[c]}]}),T&&(0,o.jsx)(s,{style:[u.indicatorRing,{borderColor:S[c],transform:[{scale:O}],opacity:h}]})]})};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=t.Animated.View,l=t.NativeModules.WidgetBridge,c=t.NativeModules.ExpoAir;function S(){try{l?.reloadMainApp?(console.log("[expo-air] Triggering main app reload"),l.reloadMainApp()):console.warn("[expo-air] No reloadMainApp method available")}catch(e){console.warn("[expo-air] Failed to reload main app:",e)}}function T(){try{l?.collapse?l.collapse():c?.collapse?c.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}var u=t.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.LAYOUT.CONTENT_PADDING_H,paddingVertical:n.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:n.COLORS.BORDER},closeButton:{width:n.SIZES.CLOSE_BUTTON,height:n.SIZES.CLOSE_BUTTON,borderRadius:n.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:n.SPACING.MD},closeButtonText:{color:"transparent",fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_SM,marginLeft:n.SPACING.XS},branchLoadingBar:{width:80,height:12,borderRadius:6,backgroundColor:"rgba(255,255,255,0.08)"},actionButton:{backgroundColor:n.COLORS.BACKGROUND_INTERACTIVE,borderRadius:n.LAYOUT.BORDER_RADIUS_MD,paddingHorizontal:n.SIZES.CTA_PADDING_H,paddingVertical:n.SIZES.CTA_PADDING_V,marginLeft:n.SPACING.SM},actionButtonText:{color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_SM,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},statusDot:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2,marginLeft:n.SPACING.MD},statusDotTouchable:{marginLeft:n.SPACING.MD,padding:10},collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4}})},491,[63,258,485,248]);
544
544
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TabBar=function(t){var s=t.activeTab,c=t.onTabChange,u=t.onNewSession,h=t.canStartNew,x=t.hasPR,b=t.hasChanges,O=t.prNumber,P=t.onCreatePR,A=t.onCommit,R=t.onViewPR;return(0,o.jsxs)(n.View,{style:T.tabBar,children:[(0,o.jsxs)(n.View,{style:T.tabButtons,children:[(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("chat"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"chat"===s?T.tabTextActive:T.tabTextInactive],children:"Chat"})}),(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("changes"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"changes"===s?T.tabTextActive:T.tabTextInactive],children:"Changes"})})]}),"chat"===s?(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:[T.ctaButton,!h&&T.ctaButtonDisabled],disabled:!h,children:(0,o.jsx)(n.Text,{style:[T.ctaText,!h&&T.ctaTextDisabled],children:"New"})}):!x&&b?(0,o.jsx)(l,{onPress:P,children:"Create PR"}):x&&b?(0,o.jsx)(l,{onPress:A,children:"Commit"}):x&&!b&&O?(0,o.jsxs)(l,{onPress:R,children:["#",O]}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=n.Animated.Text;function l(s){var l=s.children,u=s.onPress,h=(0,t.useRef)(new n.Animated.Value(.6)).current;return(0,t.useEffect)(()=>{var t=n.Animated.loop(n.Animated.sequence([n.Animated.timing(h,{toValue:.9,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0}),n.Animated.timing(h,{toValue:.6,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0})]));return t.start(),()=>t.stop()},[h]),(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:T.ctaButton,activeOpacity:.7,children:(0,o.jsx)(c,{style:[T.ctaText,{opacity:h}],children:l})})}var T=n.StyleSheet.create({tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:s.LAYOUT.CONTENT_PADDING_H,paddingVertical:s.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:s.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:s.SPACING.XL},tabText:{fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:s.COLORS.TEXT_PRIMARY},tabTextInactive:{color:s.COLORS.TEXT_MUTED},ctaButton:{paddingHorizontal:s.SIZES.CTA_PADDING_H,paddingVertical:s.SIZES.CTA_PADDING_V,borderRadius:s.LAYOUT.BORDER_RADIUS_SM,backgroundColor:s.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_SM,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6}})},492,[63,258,485,248]);
545
545
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useWebSocketMessages=function(e){var t=e.serverUrl,c=e.onGitMessage,o=(0,n.useState)("disconnected"),p=(0,s.default)(o,2),l=p[0],v=p[1],h=(0,n.useState)([]),b=(0,s.default)(h,2),f=b[0],k=b[1],y=(0,n.useState)([]),_=(0,s.default)(y,2),S=_[0],C=_[1],w=(0,n.useRef)([]),M=(0,n.useRef)(null),I=(0,n.useRef)(0),N=(0,n.useRef)(c);(0,n.useEffect)(()=>{N.current=c},[c]);var P=(0,n.useCallback)((e,t)=>{var s=w.current;if(s.length>0){var n={type:"assistant_parts",promptId:e,parts:s,isComplete:t,timestamp:Date.now()};k(e=>[...e,n])}w.current=[],M.current=null,C([])},[]),W=(0,n.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==M.current&&(w.current.length>0&&M.current&&P(M.current,!1),M.current=e.promptId),!e.done&&e.chunk){var t=w.current,s=t[t.length-1];"text"===s?.type?(s.content+=e.chunk,w.current=[...t]):w.current=[...t,{type:"text",id:"text-"+I.current++,content:e.chunk}],C([...w.current])}break;case"tool":if("started"!==e.status){var n={type:"tool",id:"tool-"+I.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};w.current=[...w.current,n],C([...w.current])}break;case"result":if(w.current.length>0){var u={type:"assistant_parts",promptId:e.promptId,parts:w.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,u,c])}else k(e=>[...e,u])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&k(t=>[...t,e]);w.current=[],M.current=null,C([]);break;case"error":if(w.current.length>0&&M.current){var o={type:"assistant_parts",promptId:M.current,parts:w.current,isComplete:!1,timestamp:Date.now()};k(t=>[...t,o,e])}else k(t=>[...t,e]);w.current=[],M.current=null,C([]);break;case"status":"processing"===e.status&&k(e=>{var t=e[e.length-1];return"user_prompt"===t?.type&&t.pending?[...e.slice(0,-1),{...t,pending:!1}]:e});break;case"session_cleared":k([]),w.current=[],M.current=null,I.current=0,C([]);break;case"stopped":w.current.length>0&&M.current?P(M.current,!1):(w.current=[],M.current=null,C([]));break;case"history":var p=e.entries.flatMap(e=>{if("user"===e.role){var t=e.imagePaths&&e.imagePaths.length>0?e.imagePaths.map(e=>({uri:e})):void 0;return[{type:"user_prompt",content:e.content,images:t,timestamp:e.timestamp}]}return"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(p);break;case"git_status":case"branches_list":case"branch_switched":case"branch_created":N.current(e)}},[P]);(0,n.useEffect)(()=>{console.log("[expo-air] Connecting to:",t?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,u.createWebSocketClient)({url:t,onStatusChange:v,onMessage:W,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[t]);var x=(0,n.useCallback)((e,t)=>{k(s=>[...s,{type:"user_prompt",content:e,images:t,pending:!0,timestamp:Date.now()}]),w.current=[],M.current=null,C([]);var s=t&&t.length>0?t.map(e=>e.uri):void 0,n=(0,u.getWebSocketClient)();n&&n.sendPrompt(e,s)},[]),R=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestNewSession()},[]),D=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestStop()},[]);return{status:l,messages:f,currentParts:S,handleSubmit:x,handleNewSession:R,handleStop:D}};var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),u=r(d[2])},493,[29,63,494]);
546
546
  __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 o}}),_e.getWebSocketClient=function(){return c},_e.createWebSocketClient=function(t){c&&c.disconnect();return c=new o(t)};var e=t(r(d[0])),s=t(r(d[1])),n=t(r(d[2])),o=(function(){return(0,n.default)(function t(e){(0,s.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:()=>{},...e}},[{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:(o=(0,e.default)(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)};if(e&&e.length>0)try{console.log("[expo-air] Uploading",e.length,"image(s) to:",this.getUploadUrl());var n=yield this.uploadImages(e);console.log("[expo-air] Upload returned paths:",n),n.length>0&&(s.imagePaths=n)}catch(t){console.error("[expo-air] Image upload failed:",t)}this.ws.send(JSON.stringify(s)),this.setStatus("sending")}else this.options.onError(new Error("Not connected"))}),function(t,e){return o.apply(this,arguments)})},{key:"getUploadUrl",value:function(){var t=this.options.url;t.startsWith("wss://")?t="https://"+t.slice(6):t.startsWith("ws://")&&(t="http://"+t.slice(5));var e=t.indexOf("?");return e>=0?t.slice(0,e)+"/upload"+t.slice(e):t+"/upload"}},{key:"uploadImages",value:(t=(0,e.default)(function*(t){var e=this.getUploadUrl(),s=new FormData;for(var n of t){var o=n.startsWith("file://")?n:`file://${n}`,c=n.split(".").pop()?.toLowerCase()||"jpg",h="png"===c?"image/png":"image/jpeg";s.append("images",{uri:o,type:h,name:`image.${c}`})}var u=yield fetch(e,{method:"POST",body:s});if(!u.ok){var l=yield u.text().catch(()=>"");throw new Error(`Upload failed: ${u.status} ${l}`)}return(yield u.json()).paths||[]}),function(e){return t.apply(this,arguments)})},{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:"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 t,o})();var c=null},494,[347,8,9]);
@@ -60,6 +60,10 @@ class ExpoAirModule : Module() {
60
60
  FloatingBubbleManager.onDragEnd = { x, y ->
61
61
  sendEvent("onDragEnd", mapOf("x" to x, "y" to y))
62
62
  }
63
+ FloatingBubbleManager.onActionPress = {
64
+ android.util.Log.d("ExpoAirModule", "onActionPress callback fired, sending event to host JS")
65
+ sendEvent("onActionPress", mapOf<String, Any>())
66
+ }
63
67
  }
64
68
 
65
69
  override fun definition() = ModuleDefinition {
@@ -69,7 +73,7 @@ class ExpoAirModule : Module() {
69
73
  Math.PI
70
74
  }
71
75
 
72
- Events("onChange", "onPress", "onExpand", "onCollapse", "onDragEnd")
76
+ Events("onChange", "onPress", "onExpand", "onCollapse", "onDragEnd", "onActionPress")
73
77
 
74
78
  Function("hello") {
75
79
  "Hello world!"
@@ -107,6 +111,11 @@ class ExpoAirModule : Module() {
107
111
  FloatingBubbleManager.updateServerUrl(url)
108
112
  }
109
113
 
114
+ Function("setAction") { config: Map<String, Any>? ->
115
+ android.util.Log.d("ExpoAirModule", "setAction called with config: $config")
116
+ FloatingBubbleManager.updateAction(config)
117
+ }
118
+
110
119
  Function("getServerUrl") {
111
120
  val context = appContext.reactContext ?: return@Function ""
112
121
 
@@ -28,6 +28,9 @@ object FloatingBubbleManager {
28
28
  var onExpand: (() -> Unit)? = null
29
29
  var onCollapse: (() -> Unit)? = null
30
30
  var onDragEnd: ((Float, Float) -> Unit)? = null
31
+ var onActionPress: (() -> Unit)? = null
32
+
33
+ private var currentAction: Bundle? = null
31
34
 
32
35
  fun show(
33
36
  activity: Activity,
@@ -126,10 +129,34 @@ object FloatingBubbleManager {
126
129
  }
127
130
  }
128
131
 
132
+ fun updateAction(config: Map<String, Any>?) {
133
+ android.util.Log.d("FloatingBubbleManager", "updateAction called with config: $config")
134
+ val activity = activityRef?.get()
135
+ if (config != null) {
136
+ currentAction = Bundle().apply {
137
+ putString("label", config["label"] as? String ?: "")
138
+ @Suppress("UNCHECKED_CAST")
139
+ val textStyle = config["textStyle"] as? Map<String, Any>
140
+ if (textStyle != null) {
141
+ putBundle("textStyle", Bundle().apply {
142
+ (textStyle["color"] as? String)?.let { putString("color", it) }
143
+ (textStyle["fontWeight"] as? String)?.let { putString("fontWeight", it) }
144
+ })
145
+ }
146
+ }
147
+ } else {
148
+ currentAction = null
149
+ }
150
+ activity?.runOnUiThread {
151
+ widgetRuntime?.updateSurfaceProps(buildSurfaceProps())
152
+ }
153
+ }
154
+
129
155
  private fun buildSurfaceProps(): Bundle = Bundle().apply {
130
156
  putDouble("size", currentSize)
131
157
  putString("color", currentColor)
132
158
  putBoolean("expanded", currentExpanded)
133
159
  currentServerUrl?.let { putString("serverUrl", it) }
160
+ currentAction?.let { putBundle("action", it) }
134
161
  }
135
162
  }
@@ -44,6 +44,14 @@ class WidgetBridge(private val reactContext: ReactApplicationContext) : ReactCon
44
44
  @ReactMethod
45
45
  fun removeListeners(@Suppress("UNUSED_PARAMETER") count: Int) {}
46
46
 
47
+ @ReactMethod
48
+ fun onActionPress() {
49
+ Log.d(TAG, "onActionPress called")
50
+ android.os.Handler(android.os.Looper.getMainLooper()).post {
51
+ FloatingBubbleManager.onActionPress?.invoke()
52
+ }
53
+ }
54
+
47
55
  @ReactMethod
48
56
  fun reloadMainApp() {
49
57
  try {
@@ -1,3 +1,10 @@
1
+ export interface ActionConfig {
2
+ label: string;
3
+ textStyle?: {
4
+ color?: string;
5
+ fontWeight?: string;
6
+ };
7
+ }
1
8
  export type ExpoAirModuleEvents = {
2
9
  onChange: (params: ChangeEventPayload) => void;
3
10
  onPress: () => void;
@@ -7,6 +14,7 @@ export type ExpoAirModuleEvents = {
7
14
  x: number;
8
15
  y: number;
9
16
  }) => void;
17
+ onActionPress: () => void;
10
18
  };
11
19
  export type ChangeEventPayload = {
12
20
  value: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoAir.types.d.ts","sourceRoot":"","sources":["../src/ExpoAir.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
1
+ {"version":3,"file":"ExpoAir.types.d.ts","sourceRoot":"","sources":["../src/ExpoAir.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtD,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoAir.types.js","sourceRoot":"","sources":["../src/ExpoAir.types.ts"],"names":[],"mappings":"","sourcesContent":["export type ExpoAirModuleEvents = {\n onChange: (params: ChangeEventPayload) => void;\n onPress: () => void;\n onExpand: () => void;\n onCollapse: () => void;\n onDragEnd: (params: { x: number; y: number }) => void;\n};\n\nexport type ChangeEventPayload = {\n value: string;\n};\n"]}
1
+ {"version":3,"file":"ExpoAir.types.js","sourceRoot":"","sources":["../src/ExpoAir.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface ActionConfig {\n label: string;\n textStyle?: { color?: string; fontWeight?: string };\n}\n\nexport type ExpoAirModuleEvents = {\n onChange: (params: ChangeEventPayload) => void;\n onPress: () => void;\n onExpand: () => void;\n onCollapse: () => void;\n onDragEnd: (params: { x: number; y: number }) => void;\n onActionPress: () => void;\n};\n\nexport type ChangeEventPayload = {\n value: string;\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { NativeModule } from "expo";
2
- import { ExpoAirModuleEvents } from "./ExpoAir.types";
2
+ import { ActionConfig, ExpoAirModuleEvents } from "./ExpoAir.types";
3
3
  declare class ExpoAirModule extends NativeModule<ExpoAirModuleEvents> {
4
4
  PI: number;
5
5
  hello(): string;
@@ -13,6 +13,7 @@ declare class ExpoAirModule extends NativeModule<ExpoAirModuleEvents> {
13
13
  collapse(): void;
14
14
  setServerUrl(url: string): void;
15
15
  getServerUrl(): string;
16
+ setAction(config: ActionConfig | null): void;
16
17
  }
17
18
  declare const _default: ExpoAirModule;
18
19
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoAirModule.d.ts","sourceRoot":"","sources":["../src/ExpoAirModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,OAAO,aAAc,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,IAAI,MAAM;IACf,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IACvD,IAAI,IAAI,IAAI;IACZ,MAAM,IAAI,IAAI;IACd,QAAQ,IAAI,IAAI;IAChB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAC/B,YAAY,IAAI,MAAM;CACvB;;AAGD,wBAA6D"}
1
+ {"version":3,"file":"ExpoAirModule.d.ts","sourceRoot":"","sources":["../src/ExpoAirModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,OAAO,aAAc,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,IAAI,MAAM;IACf,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IACvD,IAAI,IAAI,IAAI;IACZ,MAAM,IAAI,IAAI;IACd,QAAQ,IAAI,IAAI;IAChB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAC/B,YAAY,IAAI,MAAM;IACtB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI;CAC7C;;AAGD,wBAA6D"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoAirModule.js","sourceRoot":"","sources":["../src/ExpoAirModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAgBzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAgB,SAAS,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\";\n\nimport { ExpoAirModuleEvents } from \"./ExpoAir.types\";\n\ndeclare class ExpoAirModule extends NativeModule<ExpoAirModuleEvents> {\n PI: number;\n hello(): string;\n setValueAsync(value: string): Promise<void>;\n show(options?: { size?: number; color?: string }): void;\n hide(): void;\n expand(): void;\n collapse(): void;\n setServerUrl(url: string): void;\n getServerUrl(): string;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoAirModule>(\"ExpoAir\");\n"]}
1
+ {"version":3,"file":"ExpoAirModule.js","sourceRoot":"","sources":["../src/ExpoAirModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAiBzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAgB,SAAS,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\";\n\nimport { ActionConfig, ExpoAirModuleEvents } from \"./ExpoAir.types\";\n\ndeclare class ExpoAirModule extends NativeModule<ExpoAirModuleEvents> {\n PI: number;\n hello(): string;\n setValueAsync(value: string): Promise<void>;\n show(options?: { size?: number; color?: string }): void;\n hide(): void;\n expand(): void;\n collapse(): void;\n setServerUrl(url: string): void;\n getServerUrl(): string;\n setAction(config: ActionConfig | null): void;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoAirModule>(\"ExpoAir\");\n"]}
@@ -48,6 +48,10 @@ public class ExpoAirModule: Module {
48
48
  manager.onDragEnd = { [weak self] x, y in
49
49
  self?.sendEvent("onDragEnd", ["x": x, "y": y])
50
50
  }
51
+ manager.onActionPress = { [weak self] in
52
+ NSLog("[ExpoAirModule] onActionPress callback fired, sending event to host JS")
53
+ self?.sendEvent("onActionPress", [:])
54
+ }
51
55
  }
52
56
 
53
57
  public func definition() -> ModuleDefinition {
@@ -57,7 +61,7 @@ public class ExpoAirModule: Module {
57
61
  Double.pi
58
62
  }
59
63
 
60
- Events("onChange", "onPress", "onExpand", "onCollapse", "onDragEnd")
64
+ Events("onChange", "onPress", "onExpand", "onCollapse", "onDragEnd", "onActionPress")
61
65
 
62
66
  Function("hello") {
63
67
  return "Hello world!"
@@ -94,6 +98,11 @@ public class ExpoAirModule: Module {
94
98
  FloatingBubbleManager.shared.updateServerUrl(url)
95
99
  }
96
100
 
101
+ Function("setAction") { (config: [String: Any]?) in
102
+ NSLog("[ExpoAirModule] setAction called with config: %@", config?.description ?? "nil")
103
+ FloatingBubbleManager.shared.updateAction(config)
104
+ }
105
+
97
106
  Function("getServerUrl") { () -> String in
98
107
  // Check UserDefaults first (may be set by CLI)
99
108
  if let cached = UserDefaults.standard.string(forKey: "expo-air-server-url"), !cached.isEmpty {
@@ -141,6 +141,7 @@ class FloatingBubbleViewController: UIViewController, UIGestureRecognizerDelegat
141
141
  var bubbleColor: String = "#000000"
142
142
  var isExpanded: Bool = false
143
143
  var serverUrl: String?
144
+ var action: [String: Any]?
144
145
 
145
146
  var onPress: (() -> Void)?
146
147
  var onExpand: (() -> Void)?
@@ -416,6 +417,9 @@ class FloatingBubbleViewController: UIViewController, UIGestureRecognizerDelegat
416
417
  if let serverUrl = serverUrl {
417
418
  props["serverUrl"] = serverUrl
418
419
  }
420
+ if let action = action {
421
+ props["action"] = action
422
+ }
419
423
  surfaceView.appProperties = props
420
424
  }
421
425
 
@@ -540,8 +544,41 @@ class FloatingBubbleManager {
540
544
  var onExpand: (() -> Void)?
541
545
  var onCollapse: (() -> Void)?
542
546
  var onDragEnd: ((_ x: CGFloat, _ y: CGFloat) -> Void)?
543
-
544
- private init() {}
547
+ var onActionPress: (() -> Void)?
548
+
549
+ private var currentAction: [String: Any]?
550
+
551
+ // Observation tokens for NotificationCenter
552
+ private var collapseObserver: Any?
553
+ private var expandObserver: Any?
554
+ private var actionPressObserver: Any?
555
+
556
+ private init() {
557
+ // Listen for notifications from WidgetBridge (runs in the widget's isolated RN runtime).
558
+ // WidgetBridge is ObjC and can't directly reference this Swift class,
559
+ // so we use NotificationCenter as the bridge.
560
+ collapseObserver = NotificationCenter.default.addObserver(
561
+ forName: NSNotification.Name("ExpoAirCollapse"),
562
+ object: nil,
563
+ queue: .main
564
+ ) { [weak self] _ in
565
+ self?.collapse()
566
+ }
567
+ expandObserver = NotificationCenter.default.addObserver(
568
+ forName: NSNotification.Name("ExpoAirExpand"),
569
+ object: nil,
570
+ queue: .main
571
+ ) { [weak self] _ in
572
+ self?.expand()
573
+ }
574
+ actionPressObserver = NotificationCenter.default.addObserver(
575
+ forName: NSNotification.Name("ExpoAirActionPress"),
576
+ object: nil,
577
+ queue: .main
578
+ ) { [weak self] _ in
579
+ self?.handleActionPress()
580
+ }
581
+ }
545
582
 
546
583
  func show(size: CGFloat, color: String, bundleURL: URL?, serverUrl: String? = nil) {
547
584
  DispatchQueue.main.async {
@@ -573,6 +610,7 @@ class FloatingBubbleManager {
573
610
  vc.bubbleSize = size
574
611
  vc.bubbleColor = color
575
612
  vc.serverUrl = serverUrl
613
+ vc.action = self.currentAction
576
614
 
577
615
  // Create the widget runtime and surface view if we have a bundle URL
578
616
  NSLog("[FloatingBubbleManager] bundleURL = %@", bundleURL?.absoluteString ?? "nil")
@@ -592,6 +630,9 @@ class FloatingBubbleManager {
592
630
  if let serverUrl = serverUrl {
593
631
  initialProps["serverUrl"] = serverUrl
594
632
  }
633
+ if let action = self.currentAction {
634
+ initialProps["action"] = action
635
+ }
595
636
 
596
637
  if let surfaceView = self.widgetRuntime?.createSurfaceView(
597
638
  withModuleName: "ExpoAirBubble",
@@ -652,4 +693,18 @@ class FloatingBubbleManager {
652
693
  UserDefaults.standard.set(url, forKey: "expo-air-server-url")
653
694
  }
654
695
  }
696
+
697
+ func updateAction(_ config: [String: Any]?) {
698
+ NSLog("[FloatingBubbleManager] updateAction called with config: %@", config?.description ?? "nil")
699
+ DispatchQueue.main.async {
700
+ self.currentAction = config
701
+ self.bubbleVC?.action = config
702
+ self.bubbleVC?.updateSurfaceProps()
703
+ }
704
+ }
705
+
706
+ func handleActionPress() {
707
+ NSLog("[FloatingBubbleManager] handleActionPress called, onActionPress callback set: %@", self.onActionPress != nil ? "YES" : "NO")
708
+ self.onActionPress?()
709
+ }
655
710
  }
@@ -88,26 +88,9 @@ RCT_EXPORT_MODULE();
88
88
  }
89
89
 
90
90
  RCT_EXPORT_METHOD(collapse) {
91
- NSLog(@"[WidgetBridge] collapse called");
91
+ NSLog(@"[WidgetBridge] collapse called, posting notification");
92
92
  dispatch_async(dispatch_get_main_queue(), ^{
93
- // Use runtime to call FloatingBubbleManager.shared.collapse()
94
- Class managerClass = NSClassFromString(@"ExpoFlow.FloatingBubbleManager");
95
- if (!managerClass) {
96
- managerClass = NSClassFromString(@"FloatingBubbleManager");
97
- }
98
- if (managerClass) {
99
- SEL sharedSel = NSSelectorFromString(@"shared");
100
- SEL collapseSel = NSSelectorFromString(@"collapse");
101
- if ([managerClass respondsToSelector:sharedSel]) {
102
- #pragma clang diagnostic push
103
- #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
104
- id manager = [managerClass performSelector:sharedSel];
105
- if (manager && [manager respondsToSelector:collapseSel]) {
106
- [manager performSelector:collapseSel];
107
- }
108
- #pragma clang diagnostic pop
109
- }
110
- }
93
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"ExpoAirCollapse" object:nil];
111
94
  });
112
95
  }
113
96
 
@@ -118,26 +101,16 @@ RCT_EXPORT_METHOD(reloadMainApp) {
118
101
  }
119
102
 
120
103
  RCT_EXPORT_METHOD(expand) {
121
- NSLog(@"[WidgetBridge] expand called");
104
+ NSLog(@"[WidgetBridge] expand called, posting notification");
122
105
  dispatch_async(dispatch_get_main_queue(), ^{
123
- // Use runtime to call FloatingBubbleManager.shared.expand()
124
- Class managerClass = NSClassFromString(@"ExpoFlow.FloatingBubbleManager");
125
- if (!managerClass) {
126
- managerClass = NSClassFromString(@"FloatingBubbleManager");
127
- }
128
- if (managerClass) {
129
- SEL sharedSel = NSSelectorFromString(@"shared");
130
- SEL expandSel = NSSelectorFromString(@"expand");
131
- if ([managerClass respondsToSelector:sharedSel]) {
132
- #pragma clang diagnostic push
133
- #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
134
- id manager = [managerClass performSelector:sharedSel];
135
- if (manager && [manager respondsToSelector:expandSel]) {
136
- [manager performSelector:expandSel];
137
- }
138
- #pragma clang diagnostic pop
139
- }
140
- }
106
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"ExpoAirExpand" object:nil];
107
+ });
108
+ }
109
+
110
+ RCT_EXPORT_METHOD(onActionPress) {
111
+ NSLog(@"[WidgetBridge] onActionPress called, posting notification");
112
+ dispatch_async(dispatch_get_main_queue(), ^{
113
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"ExpoAirActionPress" object:nil];
141
114
  });
142
115
  }
143
116
 
@@ -534,7 +534,7 @@ __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";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size;var t=e.color,f=void 0===t?"#000000":t,O=e.expanded,p=void 0!==O&&O,B=e.serverUrl,E=void 0===B?"ws://localhost:3847":B,j=(0,s.useState)("chat"),A=(0,n.default)(j,2),G=A[0],w=A[1],y=(0,s.useRef)(null),_=(0,s.useState)(p),v=(0,n.default)(_,2),N=v[0],I=v[1];(0,s.useEffect)(()=>{},[]),(0,s.useEffect)(()=>{I(p)},[p]);var D=(0,s.useRef)(()=>{}),L=(0,s.useCallback)(e=>{D.current(e)},[]),M=(0,b.useWebSocketMessages)({serverUrl:E,onGitMessage:L}),Y=M.status,U=M.messages,k=M.currentParts,V=M.handleSubmit,H=M.handleNewSession,z=M.handleStop,W=(0,R.useGitState)({handleSubmit:V,setActiveTab:w});if(D.current=W.handleGitMessage,(0,s.useEffect)(()=>{N&&"chat"===G&&setTimeout(()=>y.current?.focus(),100)},[N]),!N)return(0,x.jsx)(o.View,{style:T.collapsedPill,children:(0,x.jsx)(S.PulsingIndicator,{status:Y})});return(0,x.jsxs)(o.View,{style:[T.expanded,{backgroundColor:f}],children:[(0,x.jsx)(S.Header,{status:Y,branchName:W.branchName,onBranchPress:W.handleBranchPress}),(0,x.jsx)(C.TabBar,{activeTab:G,onTabChange:w,onNewSession:H,canStartNew:"connected"===Y,hasPR:W.hasPR,hasChanges:W.gitChanges.length>0,prNumber:W.prNumber,onCreatePR:W.handleCreatePR,onCommit:W.handleCommit,onViewPR:W.handleViewPR}),(0,x.jsx)(o.View,{style:T.body,children:"disconnected"===Y&&0===U.length?(0,x.jsx)(P,{}):"chat"===G?(0,x.jsx)(l.ResponseArea,{messages:U,currentParts:k,status:Y}):(0,x.jsx)(h.GitChangesTab,{changes:W.gitChanges,onDiscard:W.handleDiscard})}),"chat"===G&&(0,x.jsx)(c.PromptInput,{ref:y,onSubmit:V,onStop:z,disabled:"disconnected"===Y,isSending:"sending"===Y,isProcessing:"processing"===Y}),W.showBranchSwitcher&&(0,x.jsx)(u.BranchSwitcher,{branches:W.branches,currentBranch:W.branchName,onSelect:W.handleBranchSelect,onCreate:W.handleBranchCreate,onClose:()=>{W.setShowBranchSwitcher(!1),W.setBranchError(null)},error:W.branchError})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]),c=r(d[3]),l=r(d[4]),h=r(d[5]),u=r(d[6]),S=r(d[7]),C=r(d[8]),b=r(d[9]),R=r(d[10]),f=r(d[11]),x=r(d[12]);o.NativeModules.WidgetBridge;function P(){return(0,x.jsxs)(o.View,{style:T.disconnectedContainer,children:[(0,x.jsx)(o.Text,{style:T.disconnectedTitle,children:"Server not running"}),(0,x.jsx)(o.Text,{style:T.disconnectedSubtitle,children:"Start the development server from your project directory:"}),(0,x.jsx)(o.View,{style:T.codeBlock,children:(0,x.jsx)(o.Text,{style:T.codeText,children:"npx expo-air fly"})})]})}var T=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},expanded:{flex:1,backgroundColor:f.COLORS.BACKGROUND,borderRadius:f.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},body:{flex:1,backgroundColor:f.COLORS.BACKGROUND_ELEVATED},disconnectedContainer:{flex:1,justifyContent:"center",alignItems:"center",paddingHorizontal:f.SPACING.XXL},disconnectedTitle:{color:f.COLORS.TEXT_MUTED,fontSize:f.TYPOGRAPHY.SIZE_LG,fontWeight:f.TYPOGRAPHY.WEIGHT_SEMIBOLD,marginBottom:f.SPACING.SM},disconnectedSubtitle:{color:f.COLORS.TEXT_MUTED,fontSize:f.TYPOGRAPHY.SIZE_SM,textAlign:"center",marginBottom:f.SPACING.LG},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:f.LAYOUT.BORDER_RADIUS_SM,paddingHorizontal:f.SPACING.LG,paddingVertical:f.SPACING.MD,borderWidth:1,borderColor:f.COLORS.BORDER},codeText:{color:f.COLORS.TEXT_SECONDARY,fontSize:f.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo"}})},485,[29,63,258,486,488,491,492,493,494,495,497,487,250]);
537
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size;var t=e.color,R=void 0===t?"#000000":t,p=e.expanded,A=void 0!==p&&p,B=e.serverUrl,E=void 0===B?"ws://localhost:3847":B,j=e.action,G=(0,s.useState)("chat"),w=(0,n.default)(G,2),y=w[0],v=w[1],_=(0,s.useRef)(null),N=(0,s.useState)(A),I=(0,n.default)(N,2),D=I[0],L=I[1];(0,s.useEffect)(()=>{},[]),(0,s.useEffect)(()=>{L(A)},[A]);var M=(0,s.useRef)(()=>{}),Y=(0,s.useCallback)(e=>{M.current(e)},[]),k=(0,b.useWebSocketMessages)({serverUrl:E,onGitMessage:Y}),U=k.status,V=k.messages,H=k.currentParts,z=k.handleSubmit,W=k.handleNewSession,X=k.handleStop,Z=(0,P.useGitState)({handleSubmit:z,setActiveTab:v});M.current=Z.handleGitMessage;var F=(0,s.useCallback)(()=>{try{x?.onActionPress&&x.onActionPress()}catch(e){console.warn("[expo-air] Failed to emit action press:",e)}},[]);if((0,s.useEffect)(()=>{D&&"chat"===y&&setTimeout(()=>_.current?.focus(),100)},[D]),!D)return(0,f.jsx)(o.View,{style:O.collapsedPill,children:(0,f.jsx)(S.PulsingIndicator,{status:U})});return(0,f.jsxs)(o.View,{style:[O.expanded,{backgroundColor:R}],children:[(0,f.jsx)(S.Header,{status:U,branchName:Z.branchName,onBranchPress:Z.handleBranchPress,action:j,onActionPress:F}),(0,f.jsx)(C.TabBar,{activeTab:y,onTabChange:v,onNewSession:W,canStartNew:"connected"===U,hasPR:Z.hasPR,hasChanges:Z.gitChanges.length>0,prNumber:Z.prNumber,onCreatePR:Z.handleCreatePR,onCommit:Z.handleCommit,onViewPR:Z.handleViewPR}),(0,f.jsx)(o.View,{style:O.body,children:"disconnected"===U&&0===V.length?(0,f.jsx)(T,{}):"chat"===y?(0,f.jsx)(l.ResponseArea,{messages:V,currentParts:H,status:U}):(0,f.jsx)(h.GitChangesTab,{changes:Z.gitChanges,onDiscard:Z.handleDiscard})}),"chat"===y&&(0,f.jsx)(c.PromptInput,{ref:_,onSubmit:z,onStop:X,disabled:"disconnected"===U,isSending:"sending"===U,isProcessing:"processing"===U}),Z.showBranchSwitcher&&(0,f.jsx)(u.BranchSwitcher,{branches:Z.branches,currentBranch:Z.branchName,onSelect:Z.handleBranchSelect,onCreate:Z.handleBranchCreate,onClose:()=>{Z.setShowBranchSwitcher(!1),Z.setBranchError(null)},error:Z.branchError})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]),c=r(d[3]),l=r(d[4]),h=r(d[5]),u=r(d[6]),S=r(d[7]),C=r(d[8]),b=r(d[9]),P=r(d[10]),R=r(d[11]),f=r(d[12]),x=o.NativeModules.WidgetBridge;function T(){return(0,f.jsxs)(o.View,{style:O.disconnectedContainer,children:[(0,f.jsx)(o.Text,{style:O.disconnectedTitle,children:"Server not running"}),(0,f.jsx)(o.Text,{style:O.disconnectedSubtitle,children:"Start the development server from your project directory:"}),(0,f.jsx)(o.View,{style:O.codeBlock,children:(0,f.jsx)(o.Text,{style:O.codeText,children:"npx expo-air fly"})})]})}var O=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},expanded:{flex:1,backgroundColor:R.COLORS.BACKGROUND,borderRadius:R.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},body:{flex:1,backgroundColor:R.COLORS.BACKGROUND_ELEVATED},disconnectedContainer:{flex:1,justifyContent:"center",alignItems:"center",paddingHorizontal:R.SPACING.XXL},disconnectedTitle:{color:R.COLORS.TEXT_MUTED,fontSize:R.TYPOGRAPHY.SIZE_LG,fontWeight:R.TYPOGRAPHY.WEIGHT_SEMIBOLD,marginBottom:R.SPACING.SM},disconnectedSubtitle:{color:R.COLORS.TEXT_MUTED,fontSize:R.TYPOGRAPHY.SIZE_SM,textAlign:"center",marginBottom:R.SPACING.LG},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:R.LAYOUT.BORDER_RADIUS_SM,paddingHorizontal:R.SPACING.LG,paddingVertical:R.SPACING.MD,borderWidth:1,borderColor:R.COLORS.BORDER},codeText:{color:R.COLORS.TEXT_SECONDARY,fontSize:R.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo"}})},485,[29,63,258,486,488,491,492,493,494,495,497,487,250]);
538
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=r(d[4]),l=r(d[5]),u=(0,o.forwardRef)((e,u)=>{var b=e.onSubmit,C=e.onStop,T=e.disabled,I=void 0!==T&&T,O=e.isSending,w=void 0!==O&&O,R=e.isProcessing,v=void 0!==R&&R,f=(0,o.useState)(""),y=(0,i.default)(f,2),B=y[0],x=y[1],N=(0,o.useState)([]),L=(0,i.default)(N,2),j=L[0],A=L[1],_=(0,o.useRef)(null);(0,o.useImperativeHandle)(u,()=>({focus:()=>_.current?.focus()})),(0,o.useEffect)(()=>{if(n.NativeModules.WidgetBridge){var e=new n.NativeEventEmitter(n.NativeModules.WidgetBridge).addListener('onClipboardImagePaste',e=>{A(t=>t.length>=4?t:[...t,e])});return()=>e.remove()}},[]);var E=w||v,P=()=>{var e=B.trim();!(e.length>0||j.length>0)||I||E||(b(e,j.length>0?j:void 0),x(""),A([]))},M=(function(){var e=(0,t.default)(function*(){if(n.NativeModules.WidgetBridge)if(j.length>=4)n.Alert.alert("Limit reached","Maximum 4 images per message.");else try{var e=yield n.NativeModules.WidgetBridge.pickImages(4-j.length,.7);if(!e.canceled&&e.assets.length>0){var t=e.assets.map(e=>({uri:e.uri,width:e.width,height:e.height}));A(e=>[...e,...t].slice(0,4))}}catch(e){console.warn("[expo-air] Image picker error:",e)}});return function(){return e.apply(this,arguments)}})(),U=e=>{A(t=>t.filter((t,i)=>i!==e))},V=(B.trim().length>0||j.length>0)&&!I&&!E;return(0,l.jsxs)(n.View,{style:S.outerContainer,children:[j.length>0&&(0,l.jsx)(n.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:S.previewStrip,contentContainerStyle:S.previewContent,children:j.map((e,t)=>(0,l.jsxs)(n.View,{style:S.previewItem,children:[(0,l.jsx)(n.Image,{source:{uri:e.uri},style:S.previewImage}),(0,l.jsx)(n.TouchableOpacity,{style:S.removeButton,onPress:()=>U(t),hitSlop:{top:6,bottom:6,left:6,right:6},children:(0,l.jsxs)(n.View,{style:S.removeIcon,children:[(0,l.jsx)(n.View,{style:[S.removeLine,S.removeLineA]}),(0,l.jsx)(n.View,{style:[S.removeLine,S.removeLineB]})]})})]},t))}),(0,l.jsxs)(n.View,{style:S.container,children:[(0,l.jsx)(n.TouchableOpacity,{style:S.iconButton,onPress:M,disabled:E,activeOpacity:.6,children:(0,l.jsx)(c,{})}),(0,l.jsx)(n.TextInput,{ref:_,style:S.input,placeholder:"Ask Claude...",placeholderTextColor:s.COLORS.TEXT_TERTIARY,value:B,onChangeText:x,onSubmitEditing:P,editable:!E,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),v?(0,l.jsx)(n.TouchableOpacity,{style:[S.submitButton,S.stopButton],onPress:C,activeOpacity:.7,children:(0,l.jsx)(p,{})}):(0,l.jsx)(n.TouchableOpacity,{style:[S.submitButton,!V&&S.submitButtonDisabled],onPress:P,disabled:!V,activeOpacity:.7,children:(0,l.jsx)(h,{})})]})]})});function c(){return(0,l.jsxs)(n.View,{style:S.plusIcon,children:[(0,l.jsx)(n.View,{style:S.plusH}),(0,l.jsx)(n.View,{style:S.plusV})]})}function h(){return(0,l.jsxs)(n.View,{style:S.arrowIcon,children:[(0,l.jsx)(n.View,{style:S.arrowLine}),(0,l.jsx)(n.View,{style:S.arrowHead})]})}function p(){return(0,l.jsx)(n.View,{style:S.stopIcon})}var S=n.StyleSheet.create({outerContainer:{borderTopWidth:1,borderTopColor:s.COLORS.BORDER,backgroundColor:s.COLORS.BACKGROUND},previewStrip:{maxHeight:72,paddingHorizontal:s.LAYOUT.CONTENT_PADDING_H,paddingTop:s.SPACING.SM},previewContent:{gap:s.SPACING.SM,alignItems:"center"},previewItem:{position:"relative"},previewImage:{width:56,height:56,borderRadius:s.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:s.LAYOUT.CONTENT_PADDING_H,paddingVertical:s.SPACING.MD},iconButton:{width:s.SIZES.SUBMIT_BUTTON,height:s.SIZES.SUBMIT_BUTTON,borderRadius:s.SIZES.SUBMIT_BUTTON/2,backgroundColor:s.COLORS.BACKGROUND_INPUT,alignItems:"center",justifyContent:"center",marginRight:s.SPACING.SM},input:{flex:1,backgroundColor:s.COLORS.BACKGROUND_INPUT,borderRadius:22,paddingHorizontal:18,paddingVertical:s.SPACING.MD,color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_LG,maxHeight:100},submitButton:{width:s.SIZES.SUBMIT_BUTTON,height:s.SIZES.SUBMIT_BUTTON,borderRadius:s.SIZES.SUBMIT_BUTTON/2,backgroundColor:s.COLORS.BACKGROUND_BUTTON,alignItems:"center",justifyContent:"center",marginLeft:s.SPACING.SM+2},submitButtonDisabled:{opacity:.4},stopButton:{backgroundColor:s.COLORS.STATUS_NEUTRAL},stopIcon:{width:12,height:12,backgroundColor:s.COLORS.TEXT_PRIMARY,borderRadius:2},arrowIcon:{width:16,height:16,alignItems:"center",justifyContent:"center"},arrowLine:{width:2,height:10,backgroundColor:s.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:s.COLORS.TEXT_PRIMARY},plusIcon:{width:18,height:18,alignItems:"center",justifyContent:"center"},plusH:{position:"absolute",width:16,height:2,borderRadius:1,backgroundColor:s.COLORS.TEXT_SECONDARY},plusV:{position:"absolute",width:2,height:16,borderRadius:1,backgroundColor:s.COLORS.TEXT_SECONDARY}})},486,[346,29,63,258,487,250]);
539
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
540
  __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ResponseArea=function(e){var t=e.messages,l=e.currentParts,f=e.status,p=(0,i.useRef)(null),T=(0,i.useState)(!0),y=(0,n.default)(T,2),C=y[0],S=y[1],v=(0,i.useRef)(0),E=(0,i.useRef)(0),x=(0,i.useCallback)(e=>{var t=e.nativeEvent,n=t.contentOffset,i=t.contentSize,o=t.layoutMeasurement,s=i.height-o.height-n.y;S(s<50)},[]),A=(0,i.useCallback)((e,t)=>{v.current=t},[]),O=(0,i.useCallback)(e=>{E.current=e.nativeEvent.layout.height},[]);(0,i.useEffect)(()=>{if(C){var e=setTimeout(()=>{p.current?.scrollToEnd({animated:!1})},16);return()=>clearTimeout(e)}},[t,l,C]),(0,i.useEffect)(()=>{var e=t[t.length-1];"user_prompt"===e?.type&&(p.current?.scrollToEnd({animated:!0}),S(!0))},[t]),(0,i.useEffect)(()=>{var e=o.Keyboard.addListener("keyboardWillShow",()=>{C&&setTimeout(()=>{p.current?.scrollToEnd({animated:!0})},100)});return()=>e.remove()},[C]);var b=(0,i.useCallback)(()=>{p.current?.scrollToEnd({animated:!0}),S(!0)},[]);if(!(t.length>0||l.length>0))return(0,c.jsx)(o.View,{style:h.emptyContainer,children:(0,c.jsx)(o.Text,{style:h.emptyText,children:"Send a prompt to start coding with Claude"})});return(0,c.jsxs)(o.View,{style:h.wrapper,children:[(0,c.jsxs)(o.ScrollView,{ref:p,style:h.container,contentContainerStyle:h.content,showsVerticalScrollIndicator:!0,onScroll:x,onContentSizeChange:A,onLayout:O,scrollEventThrottle:16,children:[t.map((e,t)=>(0,c.jsx)(s.MessageItem,{message:e},t)),l.length>0&&(0,c.jsx)(s.PartsRenderer,{parts:l,isStreaming:!0}),"processing"===f&&0===l.length&&(0,c.jsx)(u,{})]}),!C&&(0,c.jsx)(o.TouchableOpacity,{style:h.scrollButton,onPress:b,activeOpacity:.8,children:(0,c.jsx)(o.Text,{style:h.scrollButtonText,children:"\u2193"})})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},i=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]);function u(){var e=(0,i.useRef)(new o.Animated.Value(.3)).current,t=(0,i.useRef)(new o.Animated.Value(.3)).current,n=(0,i.useRef)(new o.Animated.Value(.3)).current;return(0,i.useEffect)(()=>{var i=(e,t)=>o.Animated.loop(o.Animated.sequence([o.Animated.delay(t),o.Animated.timing(e,{toValue:1,duration:400,easing:o.Easing.ease,useNativeDriver:!0}),o.Animated.timing(e,{toValue:.3,duration:400,easing:o.Easing.ease,useNativeDriver:!0})])),s=i(e,0),l=i(t,150),c=i(n,300);return s.start(),l.start(),c.start(),()=>{s.stop(),l.stop(),c.stop()}},[e,t,n]),(0,c.jsx)(o.View,{style:h.thinkingContainer,children:[e,t,n].map((e,t)=>(0,c.jsx)(o.Animated.View,{style:[h.thinkingDot,{opacity:e}]},t))})}var h=o.StyleSheet.create({wrapper:{flex:1,position:"relative"},container:{flex:1,backgroundColor:l.COLORS.BACKGROUND},content:{padding:l.LAYOUT.CONTENT_PADDING_H,paddingBottom:l.SPACING.XXL},thinkingContainer:{flexDirection:"row",gap:6,paddingVertical:l.SPACING.MD},thinkingDot:{width:6,height:6,borderRadius:3,backgroundColor:l.COLORS.TEXT_MUTED},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:l.SPACING.XXL},emptyText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_LG,textAlign:"center",lineHeight:22},scrollButton:{position:"absolute",bottom:l.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:l.COLORS.TEXT_PRIMARY,fontSize:18,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD}})},488,[29,63,258,489,487,250]);
@@ -542,7 +542,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule'
542
542
  __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.FormattedText=function(e){var i=e.content,h=e.isStreaming,c=i.split('\n'),S=[],x=0;for(;x<c.length;){var u=c[x],P=u.trim();if(P.startsWith('```')){var f=[],G=P.slice(3).trim();for(x++;x<c.length&&!c[x].trim().startsWith('```');)f.push(c[x]),x++;S.push((0,o.jsxs)(l.View,{style:T.codeBlock,children:[G&&(0,o.jsx)(l.Text,{style:T.codeLang,children:G}),(0,o.jsx)(l.Text,{style:T.codeText,selectable:!0,children:f.join('\n')})]},`code-${x}`)),x++}else{var I=P.match(/^(#{1,6})\s+(.+)$/);if(I){var O=I[1].length,A=O<=2?T.heading1:O<=4?T.heading2:T.heading3;S.push((0,o.jsx)(l.Text,{style:A,selectable:!0,children:s(I[2])},x)),x++}else if(P.startsWith('> ')||'>'===P){for(var C=[];x<c.length&&(c[x].trim().startsWith('> ')||'>'===c[x].trim());){var R=c[x].trim().startsWith('> ')?c[x].trim().slice(2):'';C.push(R),x++}S.push((0,o.jsx)(l.View,{style:T.blockquote,children:(0,o.jsx)(l.Text,{style:T.blockquoteText,selectable:!0,children:s(C.join('\n'))})},`quote-${x}`))}else{var p=P.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(p){var L=' '!==p[1];S.push((0,o.jsxs)(l.View,{style:T.listItem,children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:L?'\u2611':'\u2610'}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(p[2])})]},x)),x++}else{var Y=u.match(/^(\s*)(\d+)\.\s+(.+)$/);if(Y){var E=Math.floor(Y[1].length/2),M=(0,t.default)(Y,4),b=M[2],y=M[3];S.push((0,o.jsxs)(l.View,{style:[T.listItem,E>0&&{paddingLeft:n.SPACING.SM+E*n.SPACING.LG}],children:[(0,o.jsxs)(l.Text,{style:T.listNumber,children:[b,"."]}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(y)})]},x)),x++}else{var _=u.match(/^(\s*)[-*]\s+(.+)$/);if(_){var H=Math.floor(_[1].length/2),j=0===H?'\u2022':1===H?'\u25e6':'\u25aa';S.push((0,o.jsxs)(l.View,{style:[T.listItem,H>0&&{paddingLeft:n.SPACING.SM+H*n.SPACING.LG}],children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:j}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(_[2])})]},x)),x++}else/^[-*_]{3,}$/.test(P)?(S.push((0,o.jsx)(l.View,{style:T.horizontalRule},x)),x++):P?(S.push((0,o.jsx)(l.Text,{style:T.responseText,selectable:!0,children:s(u)},x)),x++):(S.push((0,o.jsx)(l.View,{style:T.paragraphBreak},x)),x++)}}}}}return(0,o.jsxs)(l.View,{style:T.formattedContainer,children:[S,h&&(0,o.jsx)(l.View,{style:T.cursor})]})};var t=e(r(d[0])),i=e(r(d[1])),l=r(d[2]),n=r(d[3]),o=r(d[4]);function s(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?h(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(l.Text,{style:T.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(i.default.Fragment,{children:h(e)},t))}function h(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?c(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(l.Text,{style:T.linkText,onPress:()=>l.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(i.default.Fragment,{children:c(e)},t)})}function c(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:T.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(l.Text,{style:T.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(l.Text,{style:T.italicText,children:e.slice(1,-1)},t):e)}var T=l.StyleSheet.create({formattedContainer:{flexDirection:"column"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:n.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},listItem:{flexDirection:"row",marginVertical:n.SPACING.XS/2,paddingLeft:n.SPACING.SM},listNumber:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:n.SPACING.SM,padding:n.SPACING.MD,marginVertical:n.SPACING.SM},codeLang:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_XS,fontFamily:"Menlo",marginBottom:n.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:n.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:n.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:n.COLORS.TEXT_PRIMARY,fontSize:n.TYPOGRAPHY.SIZE_XL,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:n.SPACING.MD,marginBottom:n.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},boldText:{fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:n.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:n.COLORS.TEXT_MUTED},linkText:{color:n.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:n.SPACING.MD,marginVertical:n.SPACING.XS},blockquoteText:{color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:n.COLORS.BORDER,marginVertical:n.SPACING.MD},paragraphBreak:{height:n.SPACING.SM}})},490,[29,63,258,487,250]);
543
543
  __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}})},491,[63,258,250]);
544
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,s=e.currentBranch,S=e.loading,b=e.onSelect,C=e.onCreate,p=e.onClose,I=e.error,P=(0,o.useState)(!1),x=(0,n.default)(P,2),f=x[0],A=x[1],O=(0,o.useState)(""),R=(0,n.default)(O,2),G=R[0],y=R[1],M=u(t,""),E=()=>{var e=G.trim();e&&(C(e),y(""),A(!1))},H=(e,t)=>{var n=e.name===s;return(0,c.jsxs)(i.TouchableOpacity,{style:[T.branchItem,n&&T.branchItemCurrent,t&&T.branchItemFirst],onPress:()=>{n||b(e.name)},activeOpacity:n?1:.6,children:[(0,c.jsxs)(i.View,{style:T.branchInfo,children:[(0,c.jsx)(i.Text,{style:[T.branchName,n&&T.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,c.jsx)(i.View,{style:T.prBadge,children:(0,c.jsxs)(i.Text,{style:T.prBadgeText,children:["#",e.prNumber]})}),e.isRemote&&(0,c.jsx)(i.View,{style:T.remoteBadge,children:(0,c.jsx)(i.Text,{style:T.remoteBadgeText,children:"remote"})})]}),n&&(0,c.jsx)(i.Text,{style:T.currentIndicator,children:"\u2713"})]},e.name)};return(0,c.jsxs)(i.View,{style:T.overlay,children:[(0,c.jsx)(i.TouchableOpacity,{style:T.backdrop,onPress:p,activeOpacity:1}),(0,c.jsxs)(i.View,{style:T.dropdown,children:[I&&(0,c.jsx)(i.View,{style:T.errorBanner,children:(0,c.jsx)(i.Text,{style:T.errorText,numberOfLines:2,children:I})}),S&&0===t.length?(0,c.jsx)(i.View,{style:T.loadingContainer,children:(0,c.jsx)(h,{})}):(0,c.jsx)(i.ScrollView,{style:T.branchList,bounces:!1,children:M.map(e=>(0,c.jsxs)(i.View,{children:[(0,c.jsx)(i.View,{style:T.sectionHeader,children:(0,c.jsx)(i.Text,{style:T.sectionHeaderText,children:e.title})}),e.branches.map((e,t)=>H(e,0===t))]},e.title))}),(0,c.jsx)(i.View,{style:T.createSection,children:f?(0,c.jsxs)(i.View,{style:T.createInputRow,children:[(0,c.jsx)(i.TextInput,{style:T.createInput,value:G,onChangeText:y,placeholder:"branch-name",placeholderTextColor:l.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:E,returnKeyType:"done"}),(0,c.jsx)(i.TouchableOpacity,{style:[T.createConfirmButton,!G.trim()&&T.createConfirmDisabled],onPress:E,disabled:!G.trim(),children:(0,c.jsx)(i.Text,{style:T.createConfirmText,children:"Create"})})]}):(0,c.jsx)(i.TouchableOpacity,{style:T.createButton,onPress:()=>A(!0),children:(0,c.jsx)(i.Text,{style:T.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),i=r(d[2]),l=r(d[3]),c=r(d[4]),s=["main","master"],S=5;function u(e,t){var n=t.toLowerCase().trim(),o=n?e.filter(e=>e.name.toLowerCase().includes(n)):e,i=o.filter(e=>s.includes(e.name)),l=o.filter(e=>!s.includes(e.name)),c=l.filter(e=>!e.isRemote).slice(0,S),u=new Set(c.map(e=>e.name)),h=l.filter(e=>!u.has(e.name)),T=[];return i.length>0&&T.push({title:"Default",branches:i}),c.length>0&&T.push({title:"Recent",branches:c}),h.length>0&&T.push({title:"Other",branches:h}),T}function h(){var e=(0,o.useRef)(new i.Animated.Value(.3)).current,t=(0,o.useRef)(new i.Animated.Value(.3)).current,n=(0,o.useRef)(new i.Animated.Value(.3)).current;return(0,o.useEffect)(()=>{var o=(e,t)=>i.Animated.loop(i.Animated.sequence([i.Animated.delay(t),i.Animated.timing(e,{toValue:1,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0}),i.Animated.timing(e,{toValue:.3,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0})])),l=o(e,0),c=o(t,150),s=o(n,300);return l.start(),c.start(),s.start(),()=>{l.stop(),c.stop(),s.stop()}},[e,t,n]),(0,c.jsx)(i.View,{style:T.loadingDots,children:[e,t,n].map((e,t)=>(0,c.jsx)(i.Animated.View,{style:[T.loadingDot,{opacity:e}]},t))})}var T=i.StyleSheet.create({overlay:{...i.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...i.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:l.SPACING.SM,right:l.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:l.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},loadingContainer:{paddingVertical:l.SPACING.XL,alignItems:"center",justifyContent:"center"},loadingDots:{flexDirection:"row",gap:6},loadingDot:{width:6,height:6,borderRadius:3,backgroundColor:"rgba(255,255,255,0.5)"},branchList:{maxHeight:300},sectionHeader:{paddingHorizontal:l.SPACING.LG,paddingTop:l.SPACING.MD,paddingBottom:l.SPACING.XS},sectionHeaderText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD,textTransform:"uppercase",letterSpacing:.5},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD+2,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:l.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:l.COLORS.TEXT_PRIMARY,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},remoteBadge:{backgroundColor:"rgba(255,255,255,0.06)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},remoteBadgeText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL},currentIndicator:{color:l.COLORS.STATUS_SUCCESS,fontSize:l.TYPOGRAPHY.SIZE_SM,marginLeft:l.SPACING.SM},createSection:{paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD,borderTopWidth:i.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:l.SPACING.XS},createButtonText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_MD,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:l.COLORS.STATUS_INFO,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_SM,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.SM,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:l.TYPOGRAPHY.SIZE_SM}})},492,[29,63,258,487,250]);
545
- __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,l=e.branchName,c=e.onBranchPress,O={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO};return(0,o.jsxs)(t.View,{style:T.header,children:[(0,o.jsx)(t.TouchableOpacity,{onPress:u,onLongPress:S,delayLongPress:500,style:T.closeButton,children:(0,o.jsx)(t.Text,{style:T.closeButtonText,children:"\u2715"})}),(0,o.jsx)(t.TouchableOpacity,{style:T.branchButton,onPress:c,disabled:!l,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Text,{style:T.branchName,numberOfLines:1,children:l}),(0,o.jsx)(t.Text,{style:T.branchChevron,children:"\u25be"})]}):(0,o.jsx)(t.View,{style:T.branchLoadingBar})}),(0,o.jsx)(t.TouchableOpacity,{onLongPress:S,delayLongPress:500,activeOpacity:.6,hitSlop:{top:10,bottom:10,left:10,right:10},style:T.statusDotTouchable,children:(0,o.jsx)(t.View,{style:[T.statusDot,{backgroundColor:O[s]}]})})]})},_e.PulsingIndicator=function(l){var c=l.status,S={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO},u="processing"===c||"connecting"===c||"sending"===c,O=(0,e.useRef)(new t.Animated.Value(1)).current,h=(0,e.useRef)(new t.Animated.Value(.4)).current;return(0,e.useEffect)(()=>{if(u){var e=t.Animated.loop(t.Animated.sequence([t.Animated.parallel([t.Animated.timing(O,{toValue:1.3,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0}),t.Animated.timing(h,{toValue:0,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0})]),t.Animated.parallel([t.Animated.timing(O,{toValue:1,duration:0,useNativeDriver:!0}),t.Animated.timing(h,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}O.setValue(1),h.setValue(.4)},[u,O,h]),(0,o.jsxs)(t.View,{style:T.indicatorContainer,children:[(0,o.jsx)(t.View,{style:[T.indicator,{backgroundColor:S[c]}]}),u&&(0,o.jsx)(s,{style:[T.indicatorRing,{borderColor:S[c],transform:[{scale:O}],opacity:h}]})]})};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=t.Animated.View,l=t.NativeModules.WidgetBridge,c=t.NativeModules.ExpoAir;function S(){try{l?.reloadMainApp?(console.log("[expo-air] Triggering main app reload"),l.reloadMainApp()):console.warn("[expo-air] No reloadMainApp method available")}catch(e){console.warn("[expo-air] Failed to reload main app:",e)}}function u(){try{l?.collapse?l.collapse():c?.collapse?c.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}var T=t.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.LAYOUT.CONTENT_PADDING_H,paddingVertical:n.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:n.COLORS.BORDER},closeButton:{width:n.SIZES.CLOSE_BUTTON,height:n.SIZES.CLOSE_BUTTON,borderRadius:n.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:n.SPACING.MD},closeButtonText:{color:"transparent",fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_SM,marginLeft:n.SPACING.XS},branchLoadingBar:{width:80,height:12,borderRadius:6,backgroundColor:"rgba(255,255,255,0.08)"},statusDot:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2,marginLeft:n.SPACING.MD},statusDotTouchable:{marginLeft:n.SPACING.MD,padding:10},collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4}})},493,[63,258,487,250]);
545
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,l=e.branchName,c=e.onBranchPress,O=e.action,h=e.onActionPress,A={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO};return(0,o.jsxs)(t.View,{style:u.header,children:[(0,o.jsx)(t.TouchableOpacity,{onPress:T,onLongPress:S,delayLongPress:500,style:u.closeButton,children:(0,o.jsx)(t.Text,{style:u.closeButtonText,children:"\u2715"})}),(0,o.jsx)(t.TouchableOpacity,{style:u.branchButton,onPress:c,disabled:!l,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Text,{style:u.branchName,numberOfLines:1,children:l}),(0,o.jsx)(t.Text,{style:u.branchChevron,children:"\u25be"})]}):(0,o.jsx)(t.View,{style:u.branchLoadingBar})}),O&&(0,o.jsx)(t.TouchableOpacity,{style:u.actionButton,onPress:h,activeOpacity:.7,children:(0,o.jsx)(t.Text,{style:[u.actionButtonText,O.textStyle],numberOfLines:1,children:O.label})}),(0,o.jsx)(t.TouchableOpacity,{onLongPress:S,delayLongPress:500,activeOpacity:.6,hitSlop:{top:10,bottom:10,left:10,right:10},style:u.statusDotTouchable,children:(0,o.jsx)(t.View,{style:[u.statusDot,{backgroundColor:A[s]}]})})]})},_e.PulsingIndicator=function(l){var c=l.status,S={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO},T="processing"===c||"connecting"===c||"sending"===c,O=(0,e.useRef)(new t.Animated.Value(1)).current,h=(0,e.useRef)(new t.Animated.Value(.4)).current;return(0,e.useEffect)(()=>{if(T){var e=t.Animated.loop(t.Animated.sequence([t.Animated.parallel([t.Animated.timing(O,{toValue:1.3,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0}),t.Animated.timing(h,{toValue:0,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0})]),t.Animated.parallel([t.Animated.timing(O,{toValue:1,duration:0,useNativeDriver:!0}),t.Animated.timing(h,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}O.setValue(1),h.setValue(.4)},[T,O,h]),(0,o.jsxs)(t.View,{style:u.indicatorContainer,children:[(0,o.jsx)(t.View,{style:[u.indicator,{backgroundColor:S[c]}]}),T&&(0,o.jsx)(s,{style:[u.indicatorRing,{borderColor:S[c],transform:[{scale:O}],opacity:h}]})]})};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=t.Animated.View,l=t.NativeModules.WidgetBridge,c=t.NativeModules.ExpoAir;function S(){try{l?.reloadMainApp?(console.log("[expo-air] Triggering main app reload"),l.reloadMainApp()):console.warn("[expo-air] No reloadMainApp method available")}catch(e){console.warn("[expo-air] Failed to reload main app:",e)}}function T(){try{l?.collapse?l.collapse():c?.collapse?c.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}var u=t.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.LAYOUT.CONTENT_PADDING_H,paddingVertical:n.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:n.COLORS.BORDER},closeButton:{width:n.SIZES.CLOSE_BUTTON,height:n.SIZES.CLOSE_BUTTON,borderRadius:n.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:n.SPACING.MD},closeButtonText:{color:"transparent",fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_SM,marginLeft:n.SPACING.XS},branchLoadingBar:{width:80,height:12,borderRadius:6,backgroundColor:"rgba(255,255,255,0.08)"},actionButton:{backgroundColor:n.COLORS.BACKGROUND_INTERACTIVE,borderRadius:n.LAYOUT.BORDER_RADIUS_MD,paddingHorizontal:n.SIZES.CTA_PADDING_H,paddingVertical:n.SIZES.CTA_PADDING_V,marginLeft:n.SPACING.SM},actionButtonText:{color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_SM,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},statusDot:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2,marginLeft:n.SPACING.MD},statusDotTouchable:{marginLeft:n.SPACING.MD,padding:10},collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4}})},493,[63,258,487,250]);
546
546
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TabBar=function(t){var s=t.activeTab,c=t.onTabChange,u=t.onNewSession,h=t.canStartNew,x=t.hasPR,b=t.hasChanges,O=t.prNumber,P=t.onCreatePR,A=t.onCommit,R=t.onViewPR;return(0,o.jsxs)(n.View,{style:T.tabBar,children:[(0,o.jsxs)(n.View,{style:T.tabButtons,children:[(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("chat"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"chat"===s?T.tabTextActive:T.tabTextInactive],children:"Chat"})}),(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("changes"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"changes"===s?T.tabTextActive:T.tabTextInactive],children:"Changes"})})]}),"chat"===s?(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:[T.ctaButton,!h&&T.ctaButtonDisabled],disabled:!h,children:(0,o.jsx)(n.Text,{style:[T.ctaText,!h&&T.ctaTextDisabled],children:"New"})}):!x&&b?(0,o.jsx)(l,{onPress:P,children:"Create PR"}):x&&b?(0,o.jsx)(l,{onPress:A,children:"Commit"}):x&&!b&&O?(0,o.jsxs)(l,{onPress:R,children:["#",O]}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=n.Animated.Text;function l(s){var l=s.children,u=s.onPress,h=(0,t.useRef)(new n.Animated.Value(.6)).current;return(0,t.useEffect)(()=>{var t=n.Animated.loop(n.Animated.sequence([n.Animated.timing(h,{toValue:.9,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0}),n.Animated.timing(h,{toValue:.6,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0})]));return t.start(),()=>t.stop()},[h]),(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:T.ctaButton,activeOpacity:.7,children:(0,o.jsx)(c,{style:[T.ctaText,{opacity:h}],children:l})})}var T=n.StyleSheet.create({tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:s.LAYOUT.CONTENT_PADDING_H,paddingVertical:s.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:s.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:s.SPACING.XL},tabText:{fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:s.COLORS.TEXT_PRIMARY},tabTextInactive:{color:s.COLORS.TEXT_MUTED},ctaButton:{paddingHorizontal:s.SIZES.CTA_PADDING_H,paddingVertical:s.SIZES.CTA_PADDING_V,borderRadius:s.LAYOUT.BORDER_RADIUS_SM,backgroundColor:s.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_SM,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6}})},494,[63,258,487,250]);
547
547
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useWebSocketMessages=function(e){var t=e.serverUrl,c=e.onGitMessage,o=(0,n.useState)("disconnected"),p=(0,s.default)(o,2),l=p[0],v=p[1],h=(0,n.useState)([]),b=(0,s.default)(h,2),f=b[0],k=b[1],y=(0,n.useState)([]),_=(0,s.default)(y,2),S=_[0],C=_[1],w=(0,n.useRef)([]),M=(0,n.useRef)(null),I=(0,n.useRef)(0),N=(0,n.useRef)(c);(0,n.useEffect)(()=>{N.current=c},[c]);var P=(0,n.useCallback)((e,t)=>{var s=w.current;if(s.length>0){var n={type:"assistant_parts",promptId:e,parts:s,isComplete:t,timestamp:Date.now()};k(e=>[...e,n])}w.current=[],M.current=null,C([])},[]),W=(0,n.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==M.current&&(w.current.length>0&&M.current&&P(M.current,!1),M.current=e.promptId),!e.done&&e.chunk){var t=w.current,s=t[t.length-1];"text"===s?.type?(s.content+=e.chunk,w.current=[...t]):w.current=[...t,{type:"text",id:"text-"+I.current++,content:e.chunk}],C([...w.current])}break;case"tool":if("started"!==e.status){var n={type:"tool",id:"tool-"+I.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};w.current=[...w.current,n],C([...w.current])}break;case"result":if(w.current.length>0){var u={type:"assistant_parts",promptId:e.promptId,parts:w.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,u,c])}else k(e=>[...e,u])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&k(t=>[...t,e]);w.current=[],M.current=null,C([]);break;case"error":if(w.current.length>0&&M.current){var o={type:"assistant_parts",promptId:M.current,parts:w.current,isComplete:!1,timestamp:Date.now()};k(t=>[...t,o,e])}else k(t=>[...t,e]);w.current=[],M.current=null,C([]);break;case"status":"processing"===e.status&&k(e=>{var t=e[e.length-1];return"user_prompt"===t?.type&&t.pending?[...e.slice(0,-1),{...t,pending:!1}]:e});break;case"session_cleared":k([]),w.current=[],M.current=null,I.current=0,C([]);break;case"stopped":w.current.length>0&&M.current?P(M.current,!1):(w.current=[],M.current=null,C([]));break;case"history":var p=e.entries.flatMap(e=>{if("user"===e.role){var t=e.imagePaths&&e.imagePaths.length>0?e.imagePaths.map(e=>({uri:e})):void 0;return[{type:"user_prompt",content:e.content,images:t,timestamp:e.timestamp}]}return"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(p);break;case"git_status":case"branches_list":case"branch_switched":case"branch_created":N.current(e)}},[P]);(0,n.useEffect)(()=>{console.log("[expo-air] Connecting to:",t?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,u.createWebSocketClient)({url:t,onStatusChange:v,onMessage:W,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[t]);var x=(0,n.useCallback)((e,t)=>{k(s=>[...s,{type:"user_prompt",content:e,images:t,pending:!0,timestamp:Date.now()}]),w.current=[],M.current=null,C([]);var s=t&&t.length>0?t.map(e=>e.uri):void 0,n=(0,u.getWebSocketClient)();n&&n.sendPrompt(e,s)},[]),R=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestNewSession()},[]),D=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestStop()},[]);return{status:l,messages:f,currentParts:S,handleSubmit:x,handleNewSession:R,handleStop:D}};var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),u=r(d[2])},495,[29,63,496]);
548
548
  __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 o}}),_e.getWebSocketClient=function(){return c},_e.createWebSocketClient=function(t){c&&c.disconnect();return c=new o(t)};var e=t(r(d[0])),s=t(r(d[1])),n=t(r(d[2])),o=(function(){return(0,n.default)(function t(e){(0,s.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:()=>{},...e}},[{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:(o=(0,e.default)(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)};if(e&&e.length>0)try{console.log("[expo-air] Uploading",e.length,"image(s) to:",this.getUploadUrl());var n=yield this.uploadImages(e);console.log("[expo-air] Upload returned paths:",n),n.length>0&&(s.imagePaths=n)}catch(t){console.error("[expo-air] Image upload failed:",t)}this.ws.send(JSON.stringify(s)),this.setStatus("sending")}else this.options.onError(new Error("Not connected"))}),function(t,e){return o.apply(this,arguments)})},{key:"getUploadUrl",value:function(){var t=this.options.url;t.startsWith("wss://")?t="https://"+t.slice(6):t.startsWith("ws://")&&(t="http://"+t.slice(5));var e=t.indexOf("?");return e>=0?t.slice(0,e)+"/upload"+t.slice(e):t+"/upload"}},{key:"uploadImages",value:(t=(0,e.default)(function*(t){var e=this.getUploadUrl(),s=new FormData;for(var n of t){var o=n.startsWith("file://")?n:`file://${n}`,c=n.split(".").pop()?.toLowerCase()||"jpg",h="png"===c?"image/png":"image/jpeg";s.append("images",{uri:o,type:h,name:`image.${c}`})}var u=yield fetch(e,{method:"POST",body:s});if(!u.ok){var l=yield u.text().catch(()=>"");throw new Error(`Upload failed: ${u.status} ${l}`)}return(yield u.json()).paths||[]}),function(e){return t.apply(this,arguments)})},{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:"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 t,o})();var c=null},496,[346,8,9]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10play/expo-air",
3
- "version": "0.13.10",
3
+ "version": "0.13.11",
4
4
  "description": "Vibe Coding for React-Native",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect, useCallback, useRef } from "react";
2
- import { View, Text, StyleSheet, NativeModules, NativeEventEmitter, Platform, TouchableOpacity } from "react-native";
2
+ import { View, Text, StyleSheet, NativeModules, NativeEventEmitter, Platform, TouchableOpacity, type TextStyle } from "react-native";
3
3
 
4
4
  import { PromptInput, type PromptInputHandle } from "./components/PromptInput";
5
5
  import { ResponseArea } from "./components/ResponseArea";
@@ -14,11 +14,17 @@ import { LAYOUT, COLORS, SPACING, TYPOGRAPHY } from "./constants/design";
14
14
 
15
15
  const { WidgetBridge } = NativeModules;
16
16
 
17
+ interface ActionConfig {
18
+ label: string;
19
+ textStyle?: TextStyle;
20
+ }
21
+
17
22
  interface BubbleContentProps {
18
23
  size?: number;
19
24
  color?: string;
20
25
  expanded?: boolean;
21
26
  serverUrl?: string;
27
+ action?: ActionConfig;
22
28
  }
23
29
 
24
30
  export function BubbleContent({
@@ -26,6 +32,7 @@ export function BubbleContent({
26
32
  color = "#000000", // Black to match Dynamic Island
27
33
  expanded: initialExpanded = false,
28
34
  serverUrl = "ws://localhost:3847",
35
+ action,
29
36
  }: BubbleContentProps) {
30
37
  const [activeTab, setActiveTab] = useState<TabType>("chat");
31
38
  const promptInputRef = useRef<PromptInputHandle>(null);
@@ -75,6 +82,16 @@ export function BubbleContent({
75
82
  // will be set before any git messages arrive
76
83
  gitMessageHandlerRef.current = git.handleGitMessage;
77
84
 
85
+ const handleActionPress = useCallback(() => {
86
+ try {
87
+ if (WidgetBridge?.onActionPress) {
88
+ WidgetBridge.onActionPress();
89
+ }
90
+ } catch (e) {
91
+ console.warn("[expo-air] Failed to emit action press:", e);
92
+ }
93
+ }, []);
94
+
78
95
  // Auto-focus input when widget expands
79
96
  useEffect(() => {
80
97
  if (expanded && activeTab === "chat") {
@@ -99,6 +116,8 @@ export function BubbleContent({
99
116
  status={status}
100
117
  branchName={git.branchName}
101
118
  onBranchPress={git.handleBranchPress}
119
+ action={action}
120
+ onActionPress={handleActionPress}
102
121
  />
103
122
  <TabBar
104
123
  activeTab={activeTab}
@@ -1,5 +1,5 @@
1
1
  import React, { useRef, useEffect } from "react";
2
- import { View, Text, StyleSheet, NativeModules, TouchableOpacity, Animated, Easing, type TextProps, type ViewProps } from "react-native";
2
+ import { View, Text, StyleSheet, NativeModules, TouchableOpacity, Animated, Easing, type TextStyle, type ViewProps } from "react-native";
3
3
  import type { ConnectionStatus } from "../services/websocket";
4
4
  import { SPACING, LAYOUT, COLORS, TYPOGRAPHY, SIZES } from "../constants/design";
5
5
 
@@ -38,13 +38,20 @@ function handleCollapse() {
38
38
  }
39
39
  }
40
40
 
41
+ interface ActionConfig {
42
+ label: string;
43
+ textStyle?: TextStyle;
44
+ }
45
+
41
46
  interface HeaderProps {
42
47
  status: ConnectionStatus;
43
48
  branchName: string;
44
49
  onBranchPress: () => void;
50
+ action?: ActionConfig;
51
+ onActionPress?: () => void;
45
52
  }
46
53
 
47
- export function Header({ status, branchName, onBranchPress }: HeaderProps) {
54
+ export function Header({ status, branchName, onBranchPress, action, onActionPress }: HeaderProps) {
48
55
  const statusColors: Record<ConnectionStatus, string> = {
49
56
  disconnected: COLORS.STATUS_ERROR,
50
57
  connecting: COLORS.STATUS_INFO,
@@ -72,6 +79,18 @@ export function Header({ status, branchName, onBranchPress }: HeaderProps) {
72
79
  )}
73
80
  </TouchableOpacity>
74
81
 
82
+ {action && (
83
+ <TouchableOpacity
84
+ style={styles.actionButton}
85
+ onPress={onActionPress}
86
+ activeOpacity={0.7}
87
+ >
88
+ <Text style={[styles.actionButtonText, action.textStyle]} numberOfLines={1}>
89
+ {action.label}
90
+ </Text>
91
+ </TouchableOpacity>
92
+ )}
93
+
75
94
  <TouchableOpacity
76
95
  onLongPress={handleReload}
77
96
  delayLongPress={500}
@@ -213,6 +232,18 @@ const styles = StyleSheet.create({
213
232
  borderRadius: 6,
214
233
  backgroundColor: "rgba(255,255,255,0.08)",
215
234
  },
235
+ actionButton: {
236
+ backgroundColor: COLORS.BACKGROUND_INTERACTIVE,
237
+ borderRadius: LAYOUT.BORDER_RADIUS_MD,
238
+ paddingHorizontal: SIZES.CTA_PADDING_H,
239
+ paddingVertical: SIZES.CTA_PADDING_V,
240
+ marginLeft: SPACING.SM,
241
+ },
242
+ actionButtonText: {
243
+ color: COLORS.TEXT_SECONDARY,
244
+ fontSize: TYPOGRAPHY.SIZE_SM,
245
+ fontWeight: TYPOGRAPHY.WEIGHT_MEDIUM,
246
+ },
216
247
  statusDot: {
217
248
  width: SIZES.STATUS_DOT,
218
249
  height: SIZES.STATUS_DOT,