@10play/expo-air 0.12.11 → 0.12.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -90,7 +90,7 @@ Configuration file created by `expo-air init`:
90
90
  "autoShow": true,
91
91
  "ui": {
92
92
  "bubbleSize": 60,
93
- "bubbleColor": "#007AFF"
93
+ "bubbleColor": "#000000"
94
94
  }
95
95
  }
96
96
  ```
@@ -99,7 +99,7 @@ Configuration file created by `expo-air init`:
99
99
  |--------|------|---------|-------------|
100
100
  | `autoShow` | boolean | `true` | Auto-show widget on app launch |
101
101
  | `ui.bubbleSize` | number | `60` | Size of the floating bubble |
102
- | `ui.bubbleColor` | string | `"#007AFF"` | Color of the floating bubble |
102
+ | `ui.bubbleColor` | string | `"#000000"` | Color of the floating bubble |
103
103
 
104
104
  ### .expo-air.local.json (gitignored)
105
105
 
@@ -533,7 +533,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
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
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&&"disconnected"!==U&&(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]);
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 c}});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=null;try{u=r(d[6],"expo-image-picker")}catch{}var c=(0,o.forwardRef)((e,c)=>{var T=e.onSubmit,S=e.onStop,I=e.disabled,w=void 0!==I&&I,O=e.isSending,v=void 0!==O&&O,f=e.isProcessing,y=void 0!==f&&f,R=(0,o.useState)(""),x=(0,i.default)(R,2),j=x[0],B=x[1],L=(0,o.useState)([]),N=(0,i.default)(L,2),A=N[0],_=N[1],E=(0,o.useRef)(null);(0,o.useImperativeHandle)(c,()=>({focus:()=>E.current?.focus()})),(0,o.useEffect)(()=>{if(n.NativeModules.WidgetBridge){var e=new n.NativeEventEmitter(n.NativeModules.WidgetBridge).addListener('onClipboardImagePaste',e=>{_(t=>t.length>=4?t:[...t,e])});return()=>e.remove()}},[]);var P=v||y,M=()=>{var e=j.trim();!(e.length>0||A.length>0)||w||P||(T(e,A.length>0?A:void 0),B(""),_([]))},U=(function(){var e=(0,t.default)(function*(){if(u)if(A.length>=4)n.Alert.alert("Limit reached","Maximum 4 images per message.");else try{var e=yield n.NativeModules.WidgetBridge.pickImages(4-A.length,.7);if(!e.canceled&&e.assets.length>0){var t=e.assets.map(e=>({uri:e.uri,width:e.width,height:e.height}));_(e=>[...e,...t].slice(0,4))}}catch(e){console.warn("[expo-air] Image picker error:",e)}});return function(){return e.apply(this,arguments)}})(),V=e=>{_(t=>t.filter((t,i)=>i!==e))},k=(j.trim().length>0||A.length>0)&&!w&&!P;return(0,l.jsxs)(n.View,{style:C.outerContainer,children:[A.length>0&&(0,l.jsx)(n.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:C.previewStrip,contentContainerStyle:C.previewContent,children:A.map((e,t)=>(0,l.jsxs)(n.View,{style:C.previewItem,children:[(0,l.jsx)(n.Image,{source:{uri:e.uri},style:C.previewImage}),(0,l.jsx)(n.TouchableOpacity,{style:C.removeButton,onPress:()=>V(t),hitSlop:{top:6,bottom:6,left:6,right:6},children:(0,l.jsxs)(n.View,{style:C.removeIcon,children:[(0,l.jsx)(n.View,{style:[C.removeLine,C.removeLineA]}),(0,l.jsx)(n.View,{style:[C.removeLine,C.removeLineB]})]})})]},t))}),(0,l.jsxs)(n.View,{style:C.container,children:[(0,l.jsx)(n.TouchableOpacity,{style:C.iconButton,onPress:U,disabled:P,activeOpacity:.6,children:(0,l.jsx)(h,{})}),(0,l.jsx)(n.TextInput,{ref:E,style:C.input,placeholder:"Ask Claude...",placeholderTextColor:s.COLORS.TEXT_TERTIARY,value:j,onChangeText:B,onSubmitEditing:M,editable:!P,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),y?(0,l.jsx)(n.TouchableOpacity,{style:[C.submitButton,C.stopButton],onPress:S,activeOpacity:.7,children:(0,l.jsx)(b,{})}):(0,l.jsx)(n.TouchableOpacity,{style:[C.submitButton,!k&&C.submitButtonDisabled],onPress:M,disabled:!k,activeOpacity:.7,children:(0,l.jsx)(p,{})})]})]})});function h(){return(0,l.jsxs)(n.View,{style:C.plusIcon,children:[(0,l.jsx)(n.View,{style:C.plusH}),(0,l.jsx)(n.View,{style:C.plusV})]})}function p(){return(0,l.jsxs)(n.View,{style:C.arrowIcon,children:[(0,l.jsx)(n.View,{style:C.arrowLine}),(0,l.jsx)(n.View,{style:C.arrowHead})]})}function b(){return(0,l.jsx)(n.View,{style:C.stopIcon})}var C=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:36,height:s.SIZES.SUBMIT_BUTTON,alignItems:"center",justifyContent:"center",marginRight:4},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_MUTED},plusV:{position:"absolute",width:2,height:16,borderRadius:1,backgroundColor:s.COLORS.TEXT_MUTED}})},484,[347,29,63,258,485,248,null]);
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]);
539
539
  __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.MessageItem=function(e){var t=e.message;switch(t.type){case"stream":case"status":default:return null;case"tool":return(0,u.jsx)(C,{tool:t});case"result":return(0,u.jsx)(b,{result:t});case"error":return(0,u.jsx)(l.View,{style:j.errorContainer,children:(0,u.jsx)(l.Text,{style:j.errorText,children:t.message})});case"user_prompt":return(0,u.jsx)(S,{message:t});case"history_result":return(0,u.jsx)(x,{message:t});case"assistant_parts":return(0,u.jsx)(f,{message:t});case"system_message":return(0,u.jsx)(p,{message:t})}},_e.PartsRenderer=T;var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),l=r(d[2]),i=r(d[3]),o=r(d[4]),u=r(d[5]);function c(e){var t=e.uri,i=(0,n.useState)(!0),c=(0,s.default)(i,2),S=c[0],x=c[1],p=(0,n.useState)(!1),T=(0,s.default)(p,2),f=T[0],h=T[1];return(0,u.jsxs)(l.View,{style:j.userImageThumb,children:[S&&!f&&(0,u.jsx)(l.ActivityIndicator,{size:"small",color:"rgba(255,255,255,0.4)",style:l.StyleSheet.absoluteFill}),f?null:(0,u.jsx)(l.Image,{source:{uri:t},style:[l.StyleSheet.absoluteFill,{borderRadius:o.SPACING.SM}],onLoad:()=>x(!1),onError:()=>{x(!1),h(!0)}})]})}function S(e){var t=e.message;return(0,u.jsxs)(l.View,{style:[j.userPromptContainer,t.pending&&j.userPromptPending],children:[t.images&&t.images.length>0&&(0,u.jsx)(l.View,{style:j.userImages,children:t.images.map((e,t)=>(0,u.jsx)(c,{uri:e.uri},t))}),t.content?(0,u.jsx)(l.Text,{style:j.userPromptText,selectable:!0,children:t.content}):null]})}function x(e){var t=e.message;return(0,u.jsx)(l.View,{style:j.resultContainer,children:(0,u.jsx)(i.FormattedText,{content:t.content})})}function p(e){var t=e.message;return"error"===t.messageType?(0,u.jsx)(l.View,{style:j.errorContainer,children:(0,u.jsx)(l.Text,{style:j.errorText,children:t.content})}):(0,u.jsx)(l.View,{style:j.systemContainer,children:(0,u.jsx)(l.Text,{style:j.systemText,children:t.content})})}function T(e){var t=e.parts,s=e.isStreaming;return(0,u.jsx)(l.View,{style:j.partsContainer,children:t.map((e,n)=>{if("text"===e.type){var o=n===t.length-1;return(0,u.jsx)(l.View,{style:j.messageContainer,children:(0,u.jsx)(i.FormattedText,{content:e.content,isStreaming:s&&o})},e.id)}return"tool"===e.type?(0,u.jsx)(P,{part:e},e.id):null})})}function f(e){var t=e.message;return(0,u.jsxs)(l.View,{style:j.resultContainer,children:[(0,u.jsx)(T,{parts:t.parts,isStreaming:!1}),!t.isComplete&&(0,u.jsx)(l.Text,{style:j.interruptedText,children:"(interrupted)"})]})}function h(e,t){var s=e=>e.split('/').pop()||e;switch(e){case"Read":return{label:"read",value:s(t?.file_path||"file")};case"Edit":return{label:"edit",value:s(t?.file_path||"file")};case"Write":return{label:"write",value:s(t?.file_path||"file")};case"Bash":var n=t?.command||"";return{label:"$",value:n.length>45?n.slice(0,45)+"\u2026":n};case"Glob":return{label:"glob",value:t?.pattern||"*"};case"Grep":return{label:"grep",value:t?.pattern||"search"};case"Task":return{label:"agent",value:t?.description||"task"};default:return{label:e.toLowerCase(),value:""}}}function y(e){var t=e.toolName,s=e.input,n=e.isFailed,i=h(t,s),o=i.label,c=i.value;return(0,u.jsxs)(l.View,{style:j.toolLine,children:[(0,u.jsx)(l.Text,{style:n?j.toolLabelFailed:j.toolLabel,children:o}),(0,u.jsx)(l.Text,{style:n?j.toolValueFailed:j.toolValue,numberOfLines:1,children:c}),n&&(0,u.jsx)(l.Text,{style:j.toolLabelFailed,children:" \u2715"})]})}function P(e){var t=e.part;return"started"===t.status?null:(0,u.jsx)(y,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function C(e){var t=e.tool;return"started"===t.status?null:(0,u.jsx)(y,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function b(e){var t=e.result;return!t.success&&t.error?(0,u.jsx)(l.View,{style:j.errorContainer,children:(0,u.jsx)(l.Text,{style:j.errorText,children:t.error})}):(0,u.jsxs)(l.View,{style:j.resultContainer,children:[t.result&&(0,u.jsx)(l.Text,{style:j.responseText,selectable:!0,children:t.result}),void 0!==t.durationMs&&(0,u.jsx)(l.Text,{style:j.metaText,children:`${t.durationMs}ms`})]})}var j=l.StyleSheet.create({messageContainer:{flexDirection:"row",flexWrap:"wrap"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:o.TYPOGRAPHY.SIZE_LG,lineHeight:22},resultContainer:{marginTop:o.SPACING.SM},partsContainer:{},interruptedText:{color:o.COLORS.TEXT_MUTED,fontSize:o.TYPOGRAPHY.SIZE_XS+1,fontStyle:"italic",marginTop:o.SPACING.XS},metaText:{color:o.COLORS.TEXT_MUTED,fontSize:o.TYPOGRAPHY.SIZE_XS+1,marginTop:o.SPACING.SM+2},errorContainer:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:o.SPACING.MD,padding:o.SPACING.MD,marginVertical:o.SPACING.SM-2},errorText:{color:"#FF6B6B",fontSize:o.TYPOGRAPHY.SIZE_MD},systemContainer:{backgroundColor:"rgba(255,255,255,0.05)",borderRadius:o.SPACING.MD,padding:o.SPACING.MD,marginVertical:o.SPACING.SM-2},systemText:{color:o.COLORS.TEXT_TERTIARY,fontSize:o.TYPOGRAPHY.SIZE_MD,fontStyle:"italic"},toolLine:{flexDirection:"row",alignItems:"center",marginVertical:o.SPACING.XS},toolLabel:{color:o.COLORS.TEXT_MUTED,fontSize:o.TYPOGRAPHY.SIZE_XS+1,fontFamily:"monospace",marginRight:o.SPACING.SM,minWidth:36},toolLabelFailed:{color:"rgba(255,100,100,0.6)",fontSize:o.TYPOGRAPHY.SIZE_XS+1,fontFamily:"monospace",marginRight:o.SPACING.SM,minWidth:36},toolValue:{color:"rgba(255,255,255,0.7)",fontSize:o.TYPOGRAPHY.SIZE_SM,fontFamily:"monospace",flexShrink:1},toolValueFailed:{color:"rgba(255,100,100,0.7)",fontSize:o.TYPOGRAPHY.SIZE_SM,fontFamily:"monospace",flexShrink:1},userPromptContainer:{backgroundColor:"rgba(0,122,255,0.15)",borderRadius:o.LAYOUT.BORDER_RADIUS_SM+2,padding:o.SPACING.MD,marginVertical:o.SPACING.SM,alignSelf:"flex-end",maxWidth:"85%"},userPromptPending:{opacity:.7},userPromptText:{color:o.COLORS.TEXT_PRIMARY,fontSize:o.TYPOGRAPHY.SIZE_LG,lineHeight:20},userImages:{flexDirection:"row",flexWrap:"wrap",gap:o.SPACING.SM,marginBottom:o.SPACING.SM},userImageThumb:{width:80,height:80,borderRadius:o.SPACING.SM,backgroundColor:"rgba(255,255,255,0.1)",overflow:"hidden",justifyContent:"center",alignItems:"center"}})},487,[29,63,258,488,485,248]);
@@ -543,7 +543,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule'
543
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]);
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
- __d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t,e){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var s={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};e&&e.length>0&&(s.imagePaths=e),this.ws.send(JSON.stringify(s)),this.setStatus("sending")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},494,[8,9]);
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]);
547
547
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useGitState=function(e){var t=e.handleSubmit,u=e.setActiveTab,h=(0,n.useState)(""),o=(0,s.default)(h,2),b=o[0],C=o[1],S=(0,n.useState)([]),f=(0,s.default)(S,2),k=f[0],p=f[1],v=(0,n.useState)(!1),w=(0,s.default)(v,2),_=w[0],B=w[1],P=(0,n.useState)(),y=(0,s.default)(P,2),R=y[0],q=y[1],L=(0,n.useState)(!1),W=(0,s.default)(L,2),M=W[0],N=W[1],U=(0,n.useState)([]),D=(0,s.default)(U,2),E=D[0],G=D[1],T=(0,n.useState)(!1),j=(0,s.default)(T,2),A=j[0],F=j[1],O=(0,n.useState)(null),V=(0,s.default)(O,2),x=V[0],z=V[1],H=(0,n.useRef)(""),I=R?.match(/\/pull\/(\d+)/)?.[1],J=(0,n.useCallback)(e=>{switch(e.type){case"git_status":C(e.branchName),p(e.changes),B(e.hasPR),q(e.prUrl);break;case"branches_list":G(e.branches),F(!1);break;case"branch_switched":if(e.success)z(null);else if(e.error){var t=H.current;C(t),G(e=>e.map(e=>({...e,isCurrent:e.name===t}))),N(!0),z(e.error)}break;case"branch_created":e.success?(N(!1),z(null)):e.error&&z(e.error)}},[]),K=(0,n.useCallback)(()=>{u("chat"),t("Look at my current git changes and create a commit with a good conventional commit message. Stage all changes, commit them, and push to the remote.")},[t,u]),Q=(0,n.useCallback)(()=>{u("chat"),t("Create a pull request for my current branch. First commit any uncommitted changes with a good message. Then generate a title and description based on the commits, and use `gh pr create --title \"...\" --body \"...\"` (non-interactive mode) to create it. Push to remote first if needed.")},[t,u]),X=(0,n.useCallback)(()=>{R&&l.Linking.openURL(R)},[R]),Y=(0,n.useCallback)(()=>{var e=(0,c.getWebSocketClient)();e&&e.requestDiscardChanges()},[]),Z=(0,n.useCallback)(()=>{if(N(e=>!e),!M){F(!0);var e=(0,c.getWebSocketClient)();e&&e.requestBranches()}},[M]),$=(0,n.useCallback)(e=>{z(null),H.current=b,C(e),G(t=>t.map(t=>({...t,isCurrent:t.name===e}))),N(!1);var t=(0,c.getWebSocketClient)();t&&t.requestSwitchBranch(e)},[b]),ee=(0,n.useCallback)(e=>{z(null);var t=(0,c.getWebSocketClient)();t&&t.requestCreateBranch(e)},[]);return{branchName:b,gitChanges:k,hasPR:_,prUrl:R,prNumber:I,showBranchSwitcher:M,branches:E,branchesLoading:A,branchError:x,handleGitMessage:J,handleCommit:K,handleCreatePR:Q,handleViewPR:X,handleDiscard:Y,handleBranchPress:Z,handleBranchSelect:$,handleBranchCreate:ee,setShowBranchSwitcher:N,setBranchError:z}};var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),c=r(d[2]),l=r(d[3])},495,[29,63,494,258]);
548
548
  __r(1);
549
549
  __r(0);
@@ -11,7 +11,7 @@ import expo.modules.kotlin.records.Record
11
11
 
12
12
  class ShowBubbleOptions : Record {
13
13
  @Field var size: Double = 60.0
14
- @Field var color: String = "#007AFF"
14
+ @Field var color: String = "#000000"
15
15
  }
16
16
 
17
17
  class ExpoAirModule : Module() {
@@ -118,7 +118,7 @@ class ExpoAirReactActivityLifecycleListener : ReactActivityLifecycleListener {
118
118
  private data class BubbleConfig(
119
119
  var autoShow: Boolean = true,
120
120
  var bubbleSize: Float = 60f,
121
- var bubbleColor: String = "#007AFF",
121
+ var bubbleColor: String = "#000000",
122
122
  var serverUrl: String = "",
123
123
  var widgetMetroUrl: String = ""
124
124
  )
@@ -27,7 +27,7 @@ object FloatingBubbleManager {
27
27
  fun show(
28
28
  activity: Activity,
29
29
  size: Float = 60f,
30
- color: String = "#007AFF",
30
+ color: String = "#000000",
31
31
  bundleURL: String? = null,
32
32
  serverUrl: String? = null
33
33
  ) {
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../commands/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAkBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA8KrE"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../commands/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAkBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAkLrE"}
@@ -27,7 +27,8 @@ export async function initCommand(options) {
27
27
  ...packageJson.dependencies,
28
28
  ...packageJson.devDependencies,
29
29
  };
30
- if (!allDeps["@10play/expo-air"]) {
30
+ const moduleExists = fs.existsSync(path.join(projectRoot, "node_modules", "@10play", "expo-air"));
31
+ if (!allDeps["@10play/expo-air"] || !moduleExists) {
31
32
  console.log(chalk.gray(" Installing @10play/expo-air...\n"));
32
33
  const cmd = fs.existsSync(path.join(projectRoot, "bun.lockb")) ||
33
34
  fs.existsSync(path.join(projectRoot, "bun.lock"))
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAczB,MAAM,cAAc,GAAkB;IACpC,QAAQ,EAAE,IAAI;IACd,EAAE,EAAE;QACF,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,SAAS;KACvB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAoB;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAElC,2CAA2C;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAE9D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CA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CAAC;IAED,kBAAkB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,qDAAqD,CAAC,CACnE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC,CAAC;AAC7E,CAAC"}
@@ -8,7 +8,7 @@ public class ExpoAirAppDelegateSubscriber: ExpoAppDelegateSubscriber {
8
8
 
9
9
  // Config with defaults (localhost fallbacks only used in SDK development)
10
10
  private var bubbleSize: CGFloat = 60
11
- private var bubbleColor: String = "#007AFF"
11
+ private var bubbleColor: String = "#000000"
12
12
  private var autoShow: Bool = true
13
13
  private var serverUrl: String = ""
14
14
  private var widgetMetroUrl: String = ""
@@ -2,7 +2,7 @@ import ExpoModulesCore
2
2
 
3
3
  struct ShowBubbleOptions: Record {
4
4
  @Field var size: Double = 60
5
- @Field var color: String = "#007AFF"
5
+ @Field var color: String = "#000000"
6
6
  }
7
7
 
8
8
  public class ExpoAirModule: Module {
@@ -535,7 +535,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
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
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&&"disconnected"!==Y&&(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]);
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 c}});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=null;try{u=r(d[6],"expo-image-picker")}catch{}var c=(0,o.forwardRef)((e,c)=>{var T=e.onSubmit,S=e.onStop,I=e.disabled,w=void 0!==I&&I,O=e.isSending,v=void 0!==O&&O,f=e.isProcessing,y=void 0!==f&&f,R=(0,o.useState)(""),x=(0,i.default)(R,2),j=x[0],B=x[1],L=(0,o.useState)([]),N=(0,i.default)(L,2),A=N[0],_=N[1],E=(0,o.useRef)(null);(0,o.useImperativeHandle)(c,()=>({focus:()=>E.current?.focus()})),(0,o.useEffect)(()=>{if(n.NativeModules.WidgetBridge){var e=new n.NativeEventEmitter(n.NativeModules.WidgetBridge).addListener('onClipboardImagePaste',e=>{_(t=>t.length>=4?t:[...t,e])});return()=>e.remove()}},[]);var P=v||y,M=()=>{var e=j.trim();!(e.length>0||A.length>0)||w||P||(T(e,A.length>0?A:void 0),B(""),_([]))},U=(function(){var e=(0,t.default)(function*(){if(u)if(A.length>=4)n.Alert.alert("Limit reached","Maximum 4 images per message.");else try{var e=yield n.NativeModules.WidgetBridge.pickImages(4-A.length,.7);if(!e.canceled&&e.assets.length>0){var t=e.assets.map(e=>({uri:e.uri,width:e.width,height:e.height}));_(e=>[...e,...t].slice(0,4))}}catch(e){console.warn("[expo-air] Image picker error:",e)}});return function(){return e.apply(this,arguments)}})(),V=e=>{_(t=>t.filter((t,i)=>i!==e))},k=(j.trim().length>0||A.length>0)&&!w&&!P;return(0,l.jsxs)(n.View,{style:C.outerContainer,children:[A.length>0&&(0,l.jsx)(n.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:C.previewStrip,contentContainerStyle:C.previewContent,children:A.map((e,t)=>(0,l.jsxs)(n.View,{style:C.previewItem,children:[(0,l.jsx)(n.Image,{source:{uri:e.uri},style:C.previewImage}),(0,l.jsx)(n.TouchableOpacity,{style:C.removeButton,onPress:()=>V(t),hitSlop:{top:6,bottom:6,left:6,right:6},children:(0,l.jsxs)(n.View,{style:C.removeIcon,children:[(0,l.jsx)(n.View,{style:[C.removeLine,C.removeLineA]}),(0,l.jsx)(n.View,{style:[C.removeLine,C.removeLineB]})]})})]},t))}),(0,l.jsxs)(n.View,{style:C.container,children:[(0,l.jsx)(n.TouchableOpacity,{style:C.iconButton,onPress:U,disabled:P,activeOpacity:.6,children:(0,l.jsx)(h,{})}),(0,l.jsx)(n.TextInput,{ref:E,style:C.input,placeholder:"Ask Claude...",placeholderTextColor:s.COLORS.TEXT_TERTIARY,value:j,onChangeText:B,onSubmitEditing:M,editable:!P,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),y?(0,l.jsx)(n.TouchableOpacity,{style:[C.submitButton,C.stopButton],onPress:S,activeOpacity:.7,children:(0,l.jsx)(b,{})}):(0,l.jsx)(n.TouchableOpacity,{style:[C.submitButton,!k&&C.submitButtonDisabled],onPress:M,disabled:!k,activeOpacity:.7,children:(0,l.jsx)(p,{})})]})]})});function h(){return(0,l.jsxs)(n.View,{style:C.plusIcon,children:[(0,l.jsx)(n.View,{style:C.plusH}),(0,l.jsx)(n.View,{style:C.plusV})]})}function p(){return(0,l.jsxs)(n.View,{style:C.arrowIcon,children:[(0,l.jsx)(n.View,{style:C.arrowLine}),(0,l.jsx)(n.View,{style:C.arrowHead})]})}function b(){return(0,l.jsx)(n.View,{style:C.stopIcon})}var C=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:36,height:s.SIZES.SUBMIT_BUTTON,alignItems:"center",justifyContent:"center",marginRight:4},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_MUTED},plusV:{position:"absolute",width:2,height:16,borderRadius:1,backgroundColor:s.COLORS.TEXT_MUTED}})},486,[346,29,63,258,487,250,null]);
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]);
541
541
  __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.MessageItem=function(e){var t=e.message;switch(t.type){case"stream":case"status":default:return null;case"tool":return(0,u.jsx)(C,{tool:t});case"result":return(0,u.jsx)(b,{result:t});case"error":return(0,u.jsx)(l.View,{style:j.errorContainer,children:(0,u.jsx)(l.Text,{style:j.errorText,children:t.message})});case"user_prompt":return(0,u.jsx)(S,{message:t});case"history_result":return(0,u.jsx)(x,{message:t});case"assistant_parts":return(0,u.jsx)(f,{message:t});case"system_message":return(0,u.jsx)(T,{message:t})}},_e.PartsRenderer=p;var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),l=r(d[2]),i=r(d[3]),o=r(d[4]),u=r(d[5]);function c(e){var t=e.uri,i=(0,s.useState)(!0),c=(0,n.default)(i,2),S=c[0],x=c[1],T=(0,s.useState)(!1),p=(0,n.default)(T,2),f=p[0],h=p[1];return(0,u.jsxs)(l.View,{style:j.userImageThumb,children:[S&&!f&&(0,u.jsx)(l.ActivityIndicator,{size:"small",color:"rgba(255,255,255,0.4)",style:l.StyleSheet.absoluteFill}),f?null:(0,u.jsx)(l.Image,{source:{uri:t},style:[l.StyleSheet.absoluteFill,{borderRadius:o.SPACING.SM}],onLoad:()=>x(!1),onError:()=>{x(!1),h(!0)}})]})}function S(e){var t=e.message;return(0,u.jsxs)(l.View,{style:[j.userPromptContainer,t.pending&&j.userPromptPending],children:[t.images&&t.images.length>0&&(0,u.jsx)(l.View,{style:j.userImages,children:t.images.map((e,t)=>(0,u.jsx)(c,{uri:e.uri},t))}),t.content?(0,u.jsx)(l.Text,{style:j.userPromptText,selectable:!0,children:t.content}):null]})}function x(e){var t=e.message;return(0,u.jsx)(l.View,{style:j.resultContainer,children:(0,u.jsx)(i.FormattedText,{content:t.content})})}function T(e){var t=e.message;return"error"===t.messageType?(0,u.jsx)(l.View,{style:j.errorContainer,children:(0,u.jsx)(l.Text,{style:j.errorText,children:t.content})}):(0,u.jsx)(l.View,{style:j.systemContainer,children:(0,u.jsx)(l.Text,{style:j.systemText,children:t.content})})}function p(e){var t=e.parts,n=e.isStreaming;return(0,u.jsx)(l.View,{style:j.partsContainer,children:t.map((e,s)=>{if("text"===e.type){var o=s===t.length-1;return(0,u.jsx)(l.View,{style:j.messageContainer,children:(0,u.jsx)(i.FormattedText,{content:e.content,isStreaming:n&&o})},e.id)}return"tool"===e.type?(0,u.jsx)(P,{part:e},e.id):null})})}function f(e){var t=e.message;return(0,u.jsxs)(l.View,{style:j.resultContainer,children:[(0,u.jsx)(p,{parts:t.parts,isStreaming:!1}),!t.isComplete&&(0,u.jsx)(l.Text,{style:j.interruptedText,children:"(interrupted)"})]})}function h(e,t){var n=e=>e.split('/').pop()||e;switch(e){case"Read":return{label:"read",value:n(t?.file_path||"file")};case"Edit":return{label:"edit",value:n(t?.file_path||"file")};case"Write":return{label:"write",value:n(t?.file_path||"file")};case"Bash":var s=t?.command||"";return{label:"$",value:s.length>45?s.slice(0,45)+"\u2026":s};case"Glob":return{label:"glob",value:t?.pattern||"*"};case"Grep":return{label:"grep",value:t?.pattern||"search"};case"Task":return{label:"agent",value:t?.description||"task"};default:return{label:e.toLowerCase(),value:""}}}function y(e){var t=e.toolName,n=e.input,s=e.isFailed,i=h(t,n),o=i.label,c=i.value;return(0,u.jsxs)(l.View,{style:j.toolLine,children:[(0,u.jsx)(l.Text,{style:s?j.toolLabelFailed:j.toolLabel,children:o}),(0,u.jsx)(l.Text,{style:s?j.toolValueFailed:j.toolValue,numberOfLines:1,children:c}),s&&(0,u.jsx)(l.Text,{style:j.toolLabelFailed,children:" \u2715"})]})}function P(e){var t=e.part;return"started"===t.status?null:(0,u.jsx)(y,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function C(e){var t=e.tool;return"started"===t.status?null:(0,u.jsx)(y,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function b(e){var t=e.result;return!t.success&&t.error?(0,u.jsx)(l.View,{style:j.errorContainer,children:(0,u.jsx)(l.Text,{style:j.errorText,children:t.error})}):(0,u.jsxs)(l.View,{style:j.resultContainer,children:[t.result&&(0,u.jsx)(l.Text,{style:j.responseText,selectable:!0,children:t.result}),void 0!==t.durationMs&&(0,u.jsx)(l.Text,{style:j.metaText,children:`${t.durationMs}ms`})]})}var j=l.StyleSheet.create({messageContainer:{flexDirection:"row",flexWrap:"wrap"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:o.TYPOGRAPHY.SIZE_LG,lineHeight:22},resultContainer:{marginTop:o.SPACING.SM},partsContainer:{},interruptedText:{color:o.COLORS.TEXT_MUTED,fontSize:o.TYPOGRAPHY.SIZE_XS+1,fontStyle:"italic",marginTop:o.SPACING.XS},metaText:{color:o.COLORS.TEXT_MUTED,fontSize:o.TYPOGRAPHY.SIZE_XS+1,marginTop:o.SPACING.SM+2},errorContainer:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:o.SPACING.MD,padding:o.SPACING.MD,marginVertical:o.SPACING.SM-2},errorText:{color:"#FF6B6B",fontSize:o.TYPOGRAPHY.SIZE_MD},systemContainer:{backgroundColor:"rgba(255,255,255,0.05)",borderRadius:o.SPACING.MD,padding:o.SPACING.MD,marginVertical:o.SPACING.SM-2},systemText:{color:o.COLORS.TEXT_TERTIARY,fontSize:o.TYPOGRAPHY.SIZE_MD,fontStyle:"italic"},toolLine:{flexDirection:"row",alignItems:"center",marginVertical:o.SPACING.XS},toolLabel:{color:o.COLORS.TEXT_MUTED,fontSize:o.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:o.SPACING.SM,minWidth:36},toolLabelFailed:{color:"rgba(255,100,100,0.6)",fontSize:o.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:o.SPACING.SM,minWidth:36},toolValue:{color:"rgba(255,255,255,0.7)",fontSize:o.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},toolValueFailed:{color:"rgba(255,100,100,0.7)",fontSize:o.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},userPromptContainer:{backgroundColor:"rgba(0,122,255,0.15)",borderRadius:o.LAYOUT.BORDER_RADIUS_SM+2,padding:o.SPACING.MD,marginVertical:o.SPACING.SM,alignSelf:"flex-end",maxWidth:"85%"},userPromptPending:{opacity:.7},userPromptText:{color:o.COLORS.TEXT_PRIMARY,fontSize:o.TYPOGRAPHY.SIZE_LG,lineHeight:20},userImages:{flexDirection:"row",flexWrap:"wrap",gap:o.SPACING.SM,marginBottom:o.SPACING.SM},userImageThumb:{width:80,height:80,borderRadius:o.SPACING.SM,backgroundColor:"rgba(255,255,255,0.1)",overflow:"hidden",justifyContent:"center",alignItems:"center"}})},489,[29,63,258,490,487,250]);
@@ -545,7 +545,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule'
545
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]);
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
- __d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t,e){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var s={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};e&&e.length>0&&(s.imagePaths=e),this.ws.send(JSON.stringify(s)),this.setStatus("sending")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},496,[8,9]);
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]);
549
549
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useGitState=function(e){var t=e.handleSubmit,u=e.setActiveTab,h=(0,n.useState)(""),o=(0,s.default)(h,2),b=o[0],C=o[1],S=(0,n.useState)([]),f=(0,s.default)(S,2),k=f[0],p=f[1],v=(0,n.useState)(!1),w=(0,s.default)(v,2),_=w[0],B=w[1],P=(0,n.useState)(),y=(0,s.default)(P,2),R=y[0],q=y[1],L=(0,n.useState)(!1),W=(0,s.default)(L,2),M=W[0],N=W[1],U=(0,n.useState)([]),D=(0,s.default)(U,2),E=D[0],G=D[1],T=(0,n.useState)(!1),j=(0,s.default)(T,2),A=j[0],F=j[1],O=(0,n.useState)(null),V=(0,s.default)(O,2),x=V[0],z=V[1],H=(0,n.useRef)(""),I=R?.match(/\/pull\/(\d+)/)?.[1],J=(0,n.useCallback)(e=>{switch(e.type){case"git_status":C(e.branchName),p(e.changes),B(e.hasPR),q(e.prUrl);break;case"branches_list":G(e.branches),F(!1);break;case"branch_switched":if(e.success)z(null);else if(e.error){var t=H.current;C(t),G(e=>e.map(e=>({...e,isCurrent:e.name===t}))),N(!0),z(e.error)}break;case"branch_created":e.success?(N(!1),z(null)):e.error&&z(e.error)}},[]),K=(0,n.useCallback)(()=>{u("chat"),t("Look at my current git changes and create a commit with a good conventional commit message. Stage all changes, commit them, and push to the remote.")},[t,u]),Q=(0,n.useCallback)(()=>{u("chat"),t("Create a pull request for my current branch. First commit any uncommitted changes with a good message. Then generate a title and description based on the commits, and use `gh pr create --title \"...\" --body \"...\"` (non-interactive mode) to create it. Push to remote first if needed.")},[t,u]),X=(0,n.useCallback)(()=>{R&&l.Linking.openURL(R)},[R]),Y=(0,n.useCallback)(()=>{var e=(0,c.getWebSocketClient)();e&&e.requestDiscardChanges()},[]),Z=(0,n.useCallback)(()=>{if(N(e=>!e),!M){F(!0);var e=(0,c.getWebSocketClient)();e&&e.requestBranches()}},[M]),$=(0,n.useCallback)(e=>{z(null),H.current=b,C(e),G(t=>t.map(t=>({...t,isCurrent:t.name===e}))),N(!1);var t=(0,c.getWebSocketClient)();t&&t.requestSwitchBranch(e)},[b]),ee=(0,n.useCallback)(e=>{z(null);var t=(0,c.getWebSocketClient)();t&&t.requestCreateBranch(e)},[]);return{branchName:b,gitChanges:k,hasPR:_,prUrl:R,prNumber:I,showBranchSwitcher:M,branches:E,branchesLoading:A,branchError:x,handleGitMessage:J,handleCommit:K,handleCreatePR:Q,handleViewPR:X,handleDiscard:Y,handleBranchPress:Z,handleBranchSelect:$,handleBranchCreate:ee,setShowBranchSwitcher:N,setBranchError:z}};var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),c=r(d[2]),l=r(d[3])},497,[29,63,496,258]);
550
550
  __r(1);
551
551
  __r(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10play/expo-air",
3
- "version": "0.12.11",
3
+ "version": "0.12.14",
4
4
  "description": "Vibe Coding for React-Native",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -168,7 +168,7 @@ const withAndroidManifestConfig = (config) => {
168
168
  const metaData = {
169
169
  "expo.modules.expoair.AUTO_SHOW": String(expoAirConfig.autoShow ?? true),
170
170
  "expo.modules.expoair.BUBBLE_SIZE": String(expoAirConfig.ui?.bubbleSize ?? 60),
171
- "expo.modules.expoair.BUBBLE_COLOR": expoAirConfig.ui?.bubbleColor ?? "#007AFF",
171
+ "expo.modules.expoair.BUBBLE_COLOR": expoAirConfig.ui?.bubbleColor ?? "#000000",
172
172
  "expo.modules.expoair.SERVER_URL": expoAirConfig.serverUrl ?? "",
173
173
  "expo.modules.expoair.WIDGET_METRO_URL": expoAirConfig.widgetMetroUrl ?? "",
174
174
  "expo.modules.expoair.APP_METRO_URL": expoAirConfig.appMetroUrl ?? "",
@@ -240,7 +240,7 @@ const withExpoAir = (config) => {
240
240
  config.modResults.ExpoAir = {
241
241
  autoShow: expoAirConfig.autoShow ?? true,
242
242
  bubbleSize: expoAirConfig.ui?.bubbleSize ?? 60,
243
- bubbleColor: expoAirConfig.ui?.bubbleColor ?? "#007AFF",
243
+ bubbleColor: expoAirConfig.ui?.bubbleColor ?? "#000000",
244
244
  serverUrl: expoAirConfig.serverUrl ?? "",
245
245
  widgetMetroUrl: expoAirConfig.widgetMetroUrl ?? "",
246
246
  appMetroUrl: expoAirConfig.appMetroUrl ?? "",
@@ -12,15 +12,6 @@ import {
12
12
  } from "react-native";
13
13
  import { SPACING, LAYOUT, COLORS, TYPOGRAPHY, SIZES } from "../constants/design";
14
14
 
15
- // Lazy-load expo-image-picker: in the isolated widget runtime on Android,
16
- // expo-modules-core may not be fully initialized (no globalThis.expo),
17
- // so a top-level import would crash the entire bundle.
18
- let ImagePicker: typeof import("expo-image-picker") | null = null;
19
- try {
20
- ImagePicker = require("expo-image-picker");
21
- } catch {
22
- // expo-image-picker not available in this runtime (Android widget)
23
- }
24
15
  import type { ImageAttachment } from "../services/websocket";
25
16
 
26
17
  export interface PromptInputHandle {
@@ -78,7 +69,7 @@ export const PromptInput = forwardRef<PromptInputHandle, PromptInputProps>(({
78
69
  };
79
70
 
80
71
  const handlePickImages = async () => {
81
- if (!ImagePicker) return;
72
+ if (!NativeModules.WidgetBridge) return;
82
73
  if (images.length >= MAX_IMAGES) {
83
74
  Alert.alert("Limit reached", `Maximum ${MAX_IMAGES} images per message.`);
84
75
  return;
@@ -264,11 +255,13 @@ const styles = StyleSheet.create({
264
255
  paddingVertical: SPACING.MD,
265
256
  },
266
257
  iconButton: {
267
- width: 36,
258
+ width: SIZES.SUBMIT_BUTTON,
268
259
  height: SIZES.SUBMIT_BUTTON,
260
+ borderRadius: SIZES.SUBMIT_BUTTON / 2,
261
+ backgroundColor: COLORS.BACKGROUND_INPUT,
269
262
  alignItems: "center",
270
263
  justifyContent: "center",
271
- marginRight: 4,
264
+ marginRight: SPACING.SM,
272
265
  },
273
266
  input: {
274
267
  flex: 1,
@@ -337,13 +330,13 @@ const styles = StyleSheet.create({
337
330
  width: 16,
338
331
  height: 2,
339
332
  borderRadius: 1,
340
- backgroundColor: COLORS.TEXT_MUTED,
333
+ backgroundColor: COLORS.TEXT_SECONDARY,
341
334
  },
342
335
  plusV: {
343
336
  position: "absolute",
344
337
  width: 2,
345
338
  height: 16,
346
339
  borderRadius: 1,
347
- backgroundColor: COLORS.TEXT_MUTED,
340
+ backgroundColor: COLORS.TEXT_SECONDARY,
348
341
  },
349
342
  });
@@ -351,7 +351,7 @@ export class WebSocketClient {
351
351
  this.setStatus("disconnected");
352
352
  }
353
353
 
354
- sendPrompt(content: string, imagePaths?: string[]): void {
354
+ async sendPrompt(content: string, imagePaths?: string[]): Promise<void> {
355
355
  if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
356
356
  this.options.onError(new Error("Not connected"));
357
357
  return;
@@ -364,13 +364,64 @@ export class WebSocketClient {
364
364
  };
365
365
 
366
366
  if (imagePaths && imagePaths.length > 0) {
367
- message.imagePaths = imagePaths;
367
+ try {
368
+ console.log("[expo-air] Uploading", imagePaths.length, "image(s) to:", this.getUploadUrl());
369
+ const serverPaths = await this.uploadImages(imagePaths);
370
+ console.log("[expo-air] Upload returned paths:", serverPaths);
371
+ if (serverPaths.length > 0) {
372
+ message.imagePaths = serverPaths;
373
+ }
374
+ } catch (error) {
375
+ console.error("[expo-air] Image upload failed:", error);
376
+ }
368
377
  }
369
378
 
370
379
  this.ws.send(JSON.stringify(message));
371
380
  this.setStatus("sending");
372
381
  }
373
382
 
383
+ private getUploadUrl(): string {
384
+ let url = this.options.url;
385
+ // ws:// → http://, wss:// → https://
386
+ if (url.startsWith("wss://")) url = "https://" + url.slice(6);
387
+ else if (url.startsWith("ws://")) url = "http://" + url.slice(5);
388
+ // Insert /upload before the query string
389
+ const qIndex = url.indexOf("?");
390
+ if (qIndex >= 0) {
391
+ return url.slice(0, qIndex) + "/upload" + url.slice(qIndex);
392
+ }
393
+ return url + "/upload";
394
+ }
395
+
396
+ private async uploadImages(localPaths: string[]): Promise<string[]> {
397
+ const uploadUrl = this.getUploadUrl();
398
+
399
+ const formData = new FormData();
400
+ for (const path of localPaths) {
401
+ const uri = path.startsWith("file://") ? path : `file://${path}`;
402
+ const ext = path.split(".").pop()?.toLowerCase() || "jpg";
403
+ const mimeType = ext === "png" ? "image/png" : "image/jpeg";
404
+ formData.append("images", {
405
+ uri,
406
+ type: mimeType,
407
+ name: `image.${ext}`,
408
+ } as unknown as Blob);
409
+ }
410
+
411
+ const response = await fetch(uploadUrl, {
412
+ method: "POST",
413
+ body: formData,
414
+ });
415
+
416
+ if (!response.ok) {
417
+ const text = await response.text().catch(() => "");
418
+ throw new Error(`Upload failed: ${response.status} ${text}`);
419
+ }
420
+
421
+ const result = await response.json();
422
+ return result.paths || [];
423
+ }
424
+
374
425
  requestNewSession(): void {
375
426
  if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
376
427
  this.options.onError(new Error("Not connected"));