@10play/expo-air 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/server/gitOperations.d.ts +31 -0
- package/cli/dist/server/gitOperations.d.ts.map +1 -0
- package/cli/dist/server/gitOperations.js +232 -0
- package/cli/dist/server/gitOperations.js.map +1 -0
- package/cli/dist/server/promptServer.d.ts +1 -6
- package/cli/dist/server/promptServer.d.ts.map +1 -1
- package/cli/dist/server/promptServer.js +72 -264
- package/cli/dist/server/promptServer.js.map +1 -1
- package/cli/dist/tsconfig.tsbuildinfo +1 -1
- package/cli/dist/types/messages.d.ts +1 -0
- package/cli/dist/types/messages.d.ts.map +1 -1
- package/ios/FloatingBubbleManager.swift +73 -1
- package/ios/widget.jsbundle +12 -6
- package/package.json +1 -1
- package/widget/BubbleContent.tsx +85 -743
- package/widget/components/BranchSwitcher.tsx +205 -40
- package/widget/components/FormattedText.tsx +320 -0
- package/widget/components/Header.tsx +225 -0
- package/widget/components/MessageItems.tsx +308 -0
- package/widget/components/ResponseArea.tsx +32 -617
- package/widget/components/TabBar.tsx +161 -0
- package/widget/services/websocket.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../types/messages.ts"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../types/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,WAAW,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;CACpE;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAEvG,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,WAAW,GACX,aAAa,GACb,aAAa,GACb,YAAY,GACZ,qBAAqB,GACrB,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,qBAAqB,GACrB,wBAAwB,GACxB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,CAAC"}
|
|
@@ -114,6 +114,7 @@ class FloatingBubbleViewController: UIViewController, UIGestureRecognizerDelegat
|
|
|
114
114
|
private var reactSurfaceView: UIView?
|
|
115
115
|
private var nativeCloseButton: UIButton!
|
|
116
116
|
private var placeholderDot: UIView!
|
|
117
|
+
private var expandedPlaceholder: UIView!
|
|
117
118
|
|
|
118
119
|
var bubbleSize: CGFloat = 60
|
|
119
120
|
var bubbleColor: String = "#000000"
|
|
@@ -216,7 +217,70 @@ class FloatingBubbleViewController: UIViewController, UIGestureRecognizerDelegat
|
|
|
216
217
|
|
|
217
218
|
view.addSubview(bubbleContainer)
|
|
218
219
|
|
|
219
|
-
//
|
|
220
|
+
// Native expanded placeholder — shown until RN renders its content on top
|
|
221
|
+
// Added BEFORE reactSurfaceView so RN content covers it naturally
|
|
222
|
+
expandedPlaceholder = UIView()
|
|
223
|
+
expandedPlaceholder.isHidden = true
|
|
224
|
+
|
|
225
|
+
let titleLabel = UILabel()
|
|
226
|
+
titleLabel.text = "Server not running"
|
|
227
|
+
titleLabel.textColor = UIColor.white.withAlphaComponent(0.4)
|
|
228
|
+
titleLabel.font = .systemFont(ofSize: 15, weight: .semibold)
|
|
229
|
+
titleLabel.textAlignment = .center
|
|
230
|
+
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
231
|
+
|
|
232
|
+
let subtitleLabel = UILabel()
|
|
233
|
+
subtitleLabel.text = "Start the development server\nfrom your project directory:"
|
|
234
|
+
subtitleLabel.textColor = UIColor.white.withAlphaComponent(0.4)
|
|
235
|
+
subtitleLabel.font = .systemFont(ofSize: 13)
|
|
236
|
+
subtitleLabel.textAlignment = .center
|
|
237
|
+
subtitleLabel.numberOfLines = 0
|
|
238
|
+
subtitleLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
239
|
+
|
|
240
|
+
let codeBackground = UIView()
|
|
241
|
+
codeBackground.backgroundColor = UIColor.white.withAlphaComponent(0.06)
|
|
242
|
+
codeBackground.layer.cornerRadius = 14
|
|
243
|
+
codeBackground.layer.borderWidth = 1
|
|
244
|
+
codeBackground.layer.borderColor = UIColor.white.withAlphaComponent(0.08).cgColor
|
|
245
|
+
codeBackground.translatesAutoresizingMaskIntoConstraints = false
|
|
246
|
+
|
|
247
|
+
let codeLabel = UILabel()
|
|
248
|
+
codeLabel.text = "npx expo-air fly"
|
|
249
|
+
codeLabel.textColor = UIColor.white.withAlphaComponent(0.6)
|
|
250
|
+
codeLabel.font = UIFont(name: "Menlo", size: 13) ?? .monospacedSystemFont(ofSize: 13, weight: .regular)
|
|
251
|
+
codeLabel.textAlignment = .center
|
|
252
|
+
codeLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
253
|
+
codeBackground.addSubview(codeLabel)
|
|
254
|
+
|
|
255
|
+
let stack = UIStackView(arrangedSubviews: [titleLabel, subtitleLabel, codeBackground])
|
|
256
|
+
stack.axis = .vertical
|
|
257
|
+
stack.alignment = .center
|
|
258
|
+
stack.spacing = 8
|
|
259
|
+
stack.translatesAutoresizingMaskIntoConstraints = false
|
|
260
|
+
|
|
261
|
+
expandedPlaceholder.addSubview(stack)
|
|
262
|
+
expandedPlaceholder.translatesAutoresizingMaskIntoConstraints = false
|
|
263
|
+
bubbleContainer.addSubview(expandedPlaceholder)
|
|
264
|
+
|
|
265
|
+
NSLayoutConstraint.activate([
|
|
266
|
+
expandedPlaceholder.leadingAnchor.constraint(equalTo: bubbleContainer.leadingAnchor),
|
|
267
|
+
expandedPlaceholder.trailingAnchor.constraint(equalTo: bubbleContainer.trailingAnchor),
|
|
268
|
+
expandedPlaceholder.topAnchor.constraint(equalTo: bubbleContainer.topAnchor),
|
|
269
|
+
expandedPlaceholder.bottomAnchor.constraint(equalTo: bubbleContainer.bottomAnchor),
|
|
270
|
+
|
|
271
|
+
stack.centerXAnchor.constraint(equalTo: expandedPlaceholder.centerXAnchor),
|
|
272
|
+
stack.centerYAnchor.constraint(equalTo: expandedPlaceholder.centerYAnchor),
|
|
273
|
+
stack.widthAnchor.constraint(lessThanOrEqualToConstant: 240),
|
|
274
|
+
|
|
275
|
+
subtitleLabel.widthAnchor.constraint(equalTo: stack.widthAnchor),
|
|
276
|
+
|
|
277
|
+
codeLabel.topAnchor.constraint(equalTo: codeBackground.topAnchor, constant: 12),
|
|
278
|
+
codeLabel.bottomAnchor.constraint(equalTo: codeBackground.bottomAnchor, constant: -12),
|
|
279
|
+
codeLabel.leadingAnchor.constraint(equalTo: codeBackground.leadingAnchor, constant: 16),
|
|
280
|
+
codeLabel.trailingAnchor.constraint(equalTo: codeBackground.trailingAnchor, constant: -16),
|
|
281
|
+
])
|
|
282
|
+
|
|
283
|
+
// Add React Native surface view on top (covers expandedPlaceholder when rendered)
|
|
220
284
|
if let surfaceView = reactSurfaceView {
|
|
221
285
|
surfaceView.frame = bubbleContainer.bounds
|
|
222
286
|
surfaceView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
@@ -359,6 +423,10 @@ class FloatingBubbleViewController: UIViewController, UIGestureRecognizerDelegat
|
|
|
359
423
|
self.bubbleContainer.backgroundColor = .black
|
|
360
424
|
self.bubbleContainer.layer.cornerRadius = self.expandedCornerRadius
|
|
361
425
|
|
|
426
|
+
// Hide collapsed placeholder, show expanded placeholder
|
|
427
|
+
placeholderDot.isHidden = true
|
|
428
|
+
expandedPlaceholder.isHidden = false
|
|
429
|
+
|
|
362
430
|
// Show native close button and bring to front
|
|
363
431
|
bubbleContainer.bringSubviewToFront(nativeCloseButton)
|
|
364
432
|
nativeCloseButton.isHidden = false
|
|
@@ -399,8 +467,12 @@ class FloatingBubbleViewController: UIViewController, UIGestureRecognizerDelegat
|
|
|
399
467
|
self.bubbleContainer.backgroundColor = .clear
|
|
400
468
|
self.bubbleContainer.layer.cornerRadius = 0
|
|
401
469
|
self.nativeCloseButton.alpha = 0
|
|
470
|
+
self.expandedPlaceholder.alpha = 0
|
|
402
471
|
} completion: { _ in
|
|
403
472
|
self.nativeCloseButton.isHidden = true
|
|
473
|
+
self.expandedPlaceholder.isHidden = true
|
|
474
|
+
self.expandedPlaceholder.alpha = 1
|
|
475
|
+
self.placeholderDot.isHidden = false
|
|
404
476
|
}
|
|
405
477
|
}
|
|
406
478
|
|
package/ios/widget.jsbundle
CHANGED
|
@@ -534,7 +534,7 @@ __d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{v
|
|
|
534
534
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=(r(d[1]).default,!1),o=0;function f(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u||(u=!0,0===e[0]&&(n.default.vibrate(400),e=e.slice(1)),0!==e.length?setTimeout(()=>l(++o,e,t,1),e[0]):u=!1)}function l(e,t,f,v){if(u&&e===o){if(n.default.vibrate(400),v>=t.length){if(!f)return void(u=!1);v=0}setTimeout(()=>l(e,t,f,v+1),t[v])}}var v={vibrate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!u)if('number'==typeof e)n.default.vibrate(e);else{if(!Array.isArray(e))throw new Error('Vibration pattern should be a number or array');f(e,t)}},cancel:function(){u=!1}},c=v},482,[483,60]);
|
|
535
535
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e=r(d[0]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var t,n=((t=e)&&t.__esModule?t:{default:t}).default},483,[484]);
|
|
536
536
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])).getEnforcing('Vibration')},484,[50]);
|
|
537
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size,e.color;var T=e.expanded,C=void 0!==T&&T,O=e.serverUrl,f=void 0===O?"ws://localhost:3847":O,R=(0,s.useState)("disconnected"),x=(0,n.default)(R,2),y=x[0],I=x[1],P=(0,s.useState)([]),D=(0,n.default)(P,2),N=D[0],k=D[1],w=(0,s.useState)([]),B=(0,n.default)(w,2),j=B[0],L=B[1],U=(0,s.useState)("main"),G=(0,n.default)(U,2),V=G[0],M=G[1],Y=(0,s.useState)([]),W=(0,n.default)(Y,2),H=W[0],Z=W[1],q=(0,s.useState)(!1),z=(0,n.default)(q,2),X=z[0],F=z[1],K=(0,s.useState)(),$=(0,n.default)(K,2),J=$[0],Q=$[1],ee=(0,s.useState)("chat"),te=(0,n.default)(ee,2),ne=te[0],re=te[1],ae=(0,s.useState)(!1),se=(0,n.default)(ae,2),oe=se[0],ie=se[1],ce=(0,s.useState)([]),le=(0,n.default)(ce,2),ue=le[0],de=le[1],he=(0,s.useState)(!1),Se=(0,n.default)(he,2),pe=Se[0],me=Se[1],Te=(0,s.useState)(null),ge=(0,n.default)(Te,2),be=ge[0],Ce=ge[1],Oe=(0,s.useRef)("main"),fe=(0,s.useRef)(!1),Re=(0,s.useRef)(0),xe=(0,s.useRef)([]),ve=(0,s.useRef)(null),Ae=(0,s.useRef)(null);(0,s.useEffect)(()=>{C&&"chat"===ne&&setTimeout(()=>Ae.current?.focus(),100)},[C]);var ye=J?.match(/\/pull\/(\d+)/)?.[1];(0,s.useEffect)(()=>{console.log("[expo-air] Connecting to:",f?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,h.createWebSocketClient)({url:f,onStatusChange:I,onMessage:Ie,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[f]),(0,s.useEffect)(()=>(0,S.setupTapHandler)((e,t)=>{var n=(0,h.getWebSocketClient)();n&&!n.isConnected()&&n.connect()}),[]);var Ee=(0,s.useCallback)((e,t)=>{var n=xe.current;if(n.length>0){var s={type:"assistant_parts",promptId:e,parts:n,isComplete:t,timestamp:Date.now()};k(e=>[...e,s])}xe.current=[],ve.current=null,L([])},[]),Ie=(0,s.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==ve.current&&(xe.current.length>0&&ve.current&&Ee(ve.current,!1),ve.current=e.promptId),!e.done&&e.chunk){var t=xe.current,n=t[t.length-1];"text"===n?.type?(n.content+=e.chunk,xe.current=[...t]):xe.current=[...t,{type:"text",id:"text-"+Re.current++,content:e.chunk}],L([...xe.current])}break;case"tool":if("started"!==e.status){var s={type:"tool",id:"tool-"+Re.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};xe.current=[...xe.current,s],L([...xe.current])}break;case"result":if(xe.current.length>0){var o={type:"assistant_parts",promptId:e.promptId,parts:xe.current,isComplete:!0,timestamp:e.timestamp};if(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error){var c={...e,result:void 0};k(e=>[...e,o,c])}else k(e=>[...e,o])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&k(t=>[...t,e]);xe.current=[],ve.current=null,L([]);break;case"error":if(xe.current.length>0&&ve.current){var l={type:"assistant_parts",promptId:ve.current,parts:xe.current,isComplete:!1,timestamp:Date.now()};k(t=>[...t,l,e])}else k(t=>[...t,e]);xe.current=[],ve.current=null,L([]);break;case"status":break;case"session_cleared":k([]),xe.current=[],ve.current=null,Re.current=0,L([]);break;case"stopped":xe.current.length>0&&ve.current?Ee(ve.current,!1):(xe.current=[],ve.current=null,L([]));break;case"history":var u=e.entries.flatMap(e=>"user"===e.role?[{type:"user_prompt",content:e.content,timestamp:e.timestamp}]:"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]);k(u);break;case"git_status":M(e.branchName),Z(e.changes),F(e.hasPR),Q(e.prUrl);break;case"branches_list":de(e.branches),me(!1);break;case"branch_switched":if(e.success)Ce(null);else if(e.error){var h=Oe.current;M(h),de(e=>e.map(e=>({...e,isCurrent:e.name===h}))),ie(!0),Ce(e.error)}break;case"branch_created":e.success?(ie(!1),Ce(null)):e.error&&Ce(e.error)}},[Ee]),Pe=(0,s.useCallback)((function(){var e=(0,t.default)(function*(e,t){if(!fe.current){var n=yield(0,S.requestPushToken)();if(n){var s=(0,h.getWebSocketClient)();s?.isConnected()&&(s.sendPushToken(n),fe.current=!0)}}k(n=>[...n,{type:"user_prompt",content:e,images:t,timestamp:Date.now()}]),xe.current=[],ve.current=null,L([]);var o=t&&t.length>0?t.map(e=>e.uri):void 0,c=(0,h.getWebSocketClient)();c&&c.sendPrompt(e,o)});return function(t,n){return e.apply(this,arguments)}})(),[]),De=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestNewSession()},[]),Ne=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestStop()},[]),ke=(0,s.useCallback)(()=>{re("chat"),Pe("Look at my current git changes and create a commit with a good conventional commit message. Stage all changes and commit them.")},[Pe]),we=(0,s.useCallback)(()=>{re("chat"),Pe("Create a pull request for my current branch. First commit any uncommitted changes with a good message. Then generate a title and description based on the commits, and use `gh pr create --title \"...\" --body \"...\"` (non-interactive mode) to create it. Push to remote first if needed.")},[Pe]),Be=(0,s.useCallback)(()=>{J&&o.Linking.openURL(J)},[J]),je=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestDiscardChanges()},[]),Le=(0,s.useCallback)(()=>{if(ie(e=>!e),!oe){me(!0);var e=(0,h.getWebSocketClient)();e&&e.requestBranches()}},[oe]),Ue=(0,s.useCallback)(e=>{Ce(null),Oe.current=V,M(e),de(t=>t.map(t=>({...t,isCurrent:t.name===e}))),ie(!1);var t=(0,h.getWebSocketClient)();t&&t.requestSwitchBranch(e)},[V]),Ge=(0,s.useCallback)(e=>{Ce(null);var t=(0,h.getWebSocketClient)();t&&t.requestCreateBranch(e)},[]);if(!C)return(0,b.jsx)(o.View,{style:_.collapsedPill,children:(0,b.jsx)(E,{status:y})});return(0,b.jsxs)(o.View,{style:_.expanded,children:[(0,b.jsx)(v,{status:y,branchName:V,onBranchPress:Le}),(0,b.jsx)(A,{activeTab:ne,onTabChange:re,onNewSession:De,canStartNew:"connected"===y,hasPR:X,hasChanges:H.length>0,prNumber:ye,onCreatePR:we,onCommit:ke,onViewPR:Be}),(0,b.jsx)(o.View,{style:_.body,children:"chat"===ne?(0,b.jsx)(l.ResponseArea,{messages:N,currentParts:j}):(0,b.jsx)(u.GitChangesTab,{changes:H,onDiscard:je})}),"chat"===ne&&(0,b.jsx)(c.PromptInput,{ref:Ae,onSubmit:Pe,onStop:Ne,disabled:"disconnected"===y,isProcessing:"processing"===y}),oe&&(0,b.jsx)(p.BranchSwitcher,{branches:ue,currentBranch:V,loading:pe,onSelect:Ue,onCreate:Ge,onClose:()=>{ie(!1),Ce(null)},error:be})]})};var t=e(r(d[0])),n=e(r(d[1])),s=r(d[2]),o=r(d[3]),c=r(d[4]),l=r(d[5]),u=r(d[6]),h=r(d[7]),S=r(d[8]),p=r(d[9]),T=r(d[10]),b=r(d[11]),C=o.Animated.Text,O=o.Animated.View,f=o.NativeModules.WidgetBridge,R=o.NativeModules.ExpoAir;function x(){try{f?.collapse?f.collapse():R?.collapse?R.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}function v(e){var t=e.status,n=e.branchName,s=e.onBranchPress,c={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO};return(0,b.jsxs)(o.View,{style:_.header,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:x,style:_.closeButton,children:(0,b.jsx)(o.Text,{style:_.closeButtonText,children:"\u2715"})}),(0,b.jsxs)(o.TouchableOpacity,{style:_.branchButton,onPress:s,children:[(0,b.jsx)(o.Text,{style:_.branchName,numberOfLines:1,children:n}),(0,b.jsx)(o.Text,{style:_.branchChevron,children:"\u25be"})]}),(0,b.jsx)(o.View,{style:[_.statusDot,{backgroundColor:c[t]}]})]})}function A(e){var t=e.activeTab,n=e.onTabChange,s=e.onNewSession,c=e.canStartNew,l=e.hasPR,u=e.hasChanges,h=e.prNumber,S=e.onCreatePR,p=e.onCommit,T=e.onViewPR;return(0,b.jsxs)(o.View,{style:_.tabBar,children:[(0,b.jsxs)(o.View,{style:_.tabButtons,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("chat"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"chat"===t?_.tabTextActive:_.tabTextInactive],children:"Chat"})}),(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("changes"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"changes"===t?_.tabTextActive:_.tabTextInactive],children:"Changes"})})]}),"chat"===t?(0,b.jsx)(o.TouchableOpacity,{onPress:s,style:[_.ctaButton,!c&&_.ctaButtonDisabled],disabled:!c,children:(0,b.jsx)(o.Text,{style:[_.ctaText,!c&&_.ctaTextDisabled],children:"New"})}):!l&&u?(0,b.jsx)(y,{onPress:S,children:"Create PR"}):l&&u?(0,b.jsx)(y,{onPress:p,children:"Commit"}):l&&!u&&h?(0,b.jsxs)(y,{onPress:T,children:["#",h]}):null]})}function y(e){var t=e.children,n=e.onPress,c=(0,s.useRef)(new o.Animated.Value(.6)).current;return(0,s.useEffect)(()=>{var e=o.Animated.loop(o.Animated.sequence([o.Animated.timing(c,{toValue:.9,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(c,{toValue:.6,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>e.stop()},[c]),(0,b.jsx)(o.TouchableOpacity,{onPress:n,style:_.ctaButton,activeOpacity:.7,children:(0,b.jsx)(C,{style:[_.ctaText,{opacity:c}],children:t})})}function E(e){var t=e.status,n={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO},c="processing"===t||"connecting"===t,l=(0,s.useRef)(new o.Animated.Value(1)).current,u=(0,s.useRef)(new o.Animated.Value(.4)).current;return(0,s.useEffect)(()=>{if(c){var e=o.Animated.loop(o.Animated.sequence([o.Animated.parallel([o.Animated.timing(l,{toValue:1.3,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(u,{toValue:0,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]),o.Animated.parallel([o.Animated.timing(l,{toValue:1,duration:0,useNativeDriver:!0}),o.Animated.timing(u,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}l.setValue(1),u.setValue(.4)},[c,l,u]),(0,b.jsxs)(o.View,{style:_.indicatorContainer,children:[(0,b.jsx)(o.View,{style:[_.indicator,{backgroundColor:n[t]}]}),c&&(0,b.jsx)(O,{style:[_.indicatorRing,{borderColor:n[t],transform:[{scale:l}],opacity:u}]})]})}var _=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4},expanded:{flex:1,backgroundColor:T.COLORS.BACKGROUND,borderRadius:T.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},header:{flexDirection:"row",alignItems:"center",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},closeButton:{width:T.SIZES.CLOSE_BUTTON,height:T.SIZES.CLOSE_BUTTON,borderRadius:T.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:T.SPACING.MD},closeButtonText:{color:"transparent",fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:T.COLORS.TEXT_SECONDARY,fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:T.COLORS.TEXT_MUTED,fontSize:T.TYPOGRAPHY.SIZE_SM,marginLeft:T.SPACING.XS},statusDot:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2,marginLeft:T.SPACING.MD},ctaButton:{paddingHorizontal:T.SIZES.CTA_PADDING_H,paddingVertical:T.SIZES.CTA_PADDING_V,borderRadius:T.LAYOUT.BORDER_RADIUS_SM,backgroundColor:T.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:T.COLORS.TEXT_PRIMARY,fontSize:T.TYPOGRAPHY.SIZE_SM,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6},tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:T.SPACING.XL},tabText:{fontSize:T.TYPOGRAPHY.SIZE_LG,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:T.COLORS.TEXT_PRIMARY},tabTextInactive:{color:T.COLORS.TEXT_MUTED},body:{flex:1,backgroundColor:T.COLORS.BACKGROUND_ELEVATED}})},485,[346,29,63,258,486,520,521,522,523,524,519,250]);
|
|
537
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size,e.color;var n=e.expanded,x=void 0!==n&&n,O=e.serverUrl,p=void 0===O?"ws://localhost:3847":O,B=(0,s.useState)("chat"),j=(0,t.default)(B,2),A=j[0],E=j[1],G=(0,s.useRef)(null),w=(0,s.useRef)(()=>{}),y=(0,s.useCallback)(e=>{w.current(e)},[]),_=(0,b.useWebSocketMessages)({serverUrl:p,onGitMessage:y}),I=_.status,N=_.messages,D=_.currentParts,L=_.handleSubmit,v=_.handleNewSession,M=_.handleStop,Y=(0,R.useGitState)({handleSubmit:L,setActiveTab:E});if(w.current=Y.handleGitMessage,(0,s.useEffect)(()=>{x&&"chat"===A&&setTimeout(()=>G.current?.focus(),100)},[x]),!x)return(0,P.jsx)(o.View,{style:f.collapsedPill,children:(0,P.jsx)(S.PulsingIndicator,{status:I})});return(0,P.jsxs)(o.View,{style:f.expanded,children:[(0,P.jsx)(S.Header,{status:I,branchName:Y.branchName,onBranchPress:Y.handleBranchPress}),(0,P.jsx)(C.TabBar,{activeTab:A,onTabChange:E,onNewSession:v,canStartNew:"connected"===I,hasPR:Y.hasPR,hasChanges:Y.gitChanges.length>0,prNumber:Y.prNumber,onCreatePR:Y.handleCreatePR,onCommit:Y.handleCommit,onViewPR:Y.handleViewPR}),(0,P.jsx)(o.View,{style:f.body,children:"disconnected"===I&&0===N.length?(0,P.jsx)(T,{}):"chat"===A?(0,P.jsx)(l.ResponseArea,{messages:N,currentParts:D}):(0,P.jsx)(h.GitChangesTab,{changes:Y.gitChanges,onDiscard:Y.handleDiscard})}),"chat"===A&&"disconnected"!==I&&(0,P.jsx)(c.PromptInput,{ref:G,onSubmit:L,onStop:M,disabled:"disconnected"===I,isProcessing:"processing"===I}),Y.showBranchSwitcher&&(0,P.jsx)(u.BranchSwitcher,{branches:Y.branches,currentBranch:Y.branchName,onSelect:Y.handleBranchSelect,onCreate:Y.handleBranchCreate,onClose:()=>{Y.setShowBranchSwitcher(!1),Y.setBranchError(null)},error:Y.branchError})]})};var e,n=r(d[0]),t=(e=n)&&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]),x=r(d[11]),P=r(d[12]);function T(){return(0,P.jsxs)(o.View,{style:f.disconnectedContainer,children:[(0,P.jsx)(o.Text,{style:f.disconnectedTitle,children:"Server not running"}),(0,P.jsx)(o.Text,{style:f.disconnectedSubtitle,children:"Start the development server from your project directory:"}),(0,P.jsx)(o.View,{style:f.codeBlock,children:(0,P.jsx)(o.Text,{style:f.codeText,children:"npx expo-air fly"})})]})}var f=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"}})},485,[29,63,258,486,520,523,524,525,526,527,530,519,250]);
|
|
538
538
|
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PromptInput",{enumerable:!0,get:function(){return u}});var t=e(r(_d[0])),i=e(r(_d[1])),o=r(_d[2]),n=r(_d[3]),s=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}),t.default=e,t})(r(_d[4])),l=r(_d[5]),d=r(_d[6]),u=(0,o.forwardRef)((e,u)=>{var C=e.onSubmit,T=e.onStop,S=e.disabled,O=void 0!==S&&S,I=e.isProcessing,w=void 0!==I&&I,y=(0,o.useState)(""),f=(0,i.default)(y,2),v=f[0],R=f[1],j=(0,o.useState)([]),x=(0,i.default)(j,2),L=x[0],B=x[1],_=(0,o.useRef)(null);(0,o.useImperativeHandle)(u,()=>({focus:()=>_.current?.focus()})),(0,o.useEffect)(()=>{var e=new n.NativeEventEmitter(n.NativeModules.WidgetBridge).addListener('onClipboardImagePaste',e=>{B(t=>t.length>=4?t:[...t,e])});return()=>e.remove()},[]);var A=()=>{var e=v.trim();!(e.length>0||L.length>0)||O||w||(C(e,L.length>0?L:void 0),R(""),B([]))},P=(function(){var e=(0,t.default)(function*(){if(L.length>=4)n.Alert.alert("Limit reached","Maximum 4 images per message.");else try{var e=yield s.launchImageLibraryAsync({mediaTypes:["images"],allowsMultipleSelection:!0,selectionLimit:4-L.length,quality:.7});if(!e.canceled&&e.assets.length>0){var t=e.assets.map(e=>({uri:e.uri,width:e.width,height:e.height}));B(e=>[...e,...t].slice(0,4))}}catch(e){console.warn("[expo-air] Image picker error:",e)}});return function(){return e.apply(this,arguments)}})(),E=e=>{B(t=>t.filter((t,i)=>i!==e))},N=(v.trim().length>0||L.length>0)&&!O&&!w;return(0,d.jsxs)(n.View,{style:b.outerContainer,children:[L.length>0&&(0,d.jsx)(n.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:b.previewStrip,contentContainerStyle:b.previewContent,children:L.map((e,t)=>(0,d.jsxs)(n.View,{style:b.previewItem,children:[(0,d.jsx)(n.Image,{source:{uri:e.uri},style:b.previewImage}),(0,d.jsx)(n.TouchableOpacity,{style:b.removeButton,onPress:()=>E(t),hitSlop:{top:6,bottom:6,left:6,right:6},children:(0,d.jsxs)(n.View,{style:b.removeIcon,children:[(0,d.jsx)(n.View,{style:[b.removeLine,b.removeLineA]}),(0,d.jsx)(n.View,{style:[b.removeLine,b.removeLineB]})]})})]},t))}),(0,d.jsxs)(n.View,{style:b.container,children:[(0,d.jsx)(n.TouchableOpacity,{style:b.iconButton,onPress:P,disabled:w,activeOpacity:.6,children:(0,d.jsx)(c,{})}),(0,d.jsx)(n.TextInput,{ref:_,style:b.input,placeholder:"Ask Claude...",placeholderTextColor:l.COLORS.TEXT_TERTIARY,value:v,onChangeText:R,onSubmitEditing:A,editable:!w,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),w?(0,d.jsx)(n.TouchableOpacity,{style:[b.submitButton,b.stopButton],onPress:T,activeOpacity:.7,children:(0,d.jsx)(p,{})}):(0,d.jsx)(n.TouchableOpacity,{style:[b.submitButton,!N&&b.submitButtonDisabled],onPress:A,disabled:!N,activeOpacity:.7,children:(0,d.jsx)(h,{})})]})]})});function c(){return(0,d.jsxs)(n.View,{style:b.plusIcon,children:[(0,d.jsx)(n.View,{style:b.plusH}),(0,d.jsx)(n.View,{style:b.plusV})]})}function h(){return(0,d.jsxs)(n.View,{style:b.arrowIcon,children:[(0,d.jsx)(n.View,{style:b.arrowLine}),(0,d.jsx)(n.View,{style:b.arrowHead})]})}function p(){return(0,d.jsx)(n.View,{style:b.stopIcon})}var b=n.StyleSheet.create({outerContainer:{borderTopWidth:1,borderTopColor:l.COLORS.BORDER,backgroundColor:l.COLORS.BACKGROUND},previewStrip:{maxHeight:72,paddingHorizontal:l.LAYOUT.CONTENT_PADDING_H,paddingTop:l.SPACING.SM},previewContent:{gap:l.SPACING.SM,alignItems:"center"},previewItem:{position:"relative"},previewImage:{width:56,height:56,borderRadius:l.SPACING.SM,backgroundColor:"rgba(255,255,255,0.1)"},removeButton:{position:"absolute",top:-3,right:-3,width:18,height:18,borderRadius:9,backgroundColor:"#1C1C1E",alignItems:"center",justifyContent:"center"},removeIcon:{width:8,height:8,alignItems:"center",justifyContent:"center"},removeLine:{position:"absolute",width:9,height:1.2,backgroundColor:"rgba(255,255,255,0.9)",borderRadius:1},removeLineA:{transform:[{rotate:"45deg"}]},removeLineB:{transform:[{rotate:"-45deg"}]},container:{flexDirection:"row",alignItems:"flex-end",paddingHorizontal:l.LAYOUT.CONTENT_PADDING_H,paddingVertical:l.SPACING.MD},iconButton:{width:36,height:l.SIZES.SUBMIT_BUTTON,alignItems:"center",justifyContent:"center",marginRight:4},input:{flex:1,backgroundColor:l.COLORS.BACKGROUND_INPUT,borderRadius:22,paddingHorizontal:18,paddingVertical:l.SPACING.MD,color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_LG,maxHeight:100},submitButton:{width:l.SIZES.SUBMIT_BUTTON,height:l.SIZES.SUBMIT_BUTTON,borderRadius:l.SIZES.SUBMIT_BUTTON/2,backgroundColor:l.COLORS.BACKGROUND_BUTTON,alignItems:"center",justifyContent:"center",marginLeft:l.SPACING.SM+2},submitButtonDisabled:{opacity:.4},stopButton:{backgroundColor:l.COLORS.STATUS_NEUTRAL},stopIcon:{width:12,height:12,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:2},arrowIcon:{width:16,height:16,alignItems:"center",justifyContent:"center"},arrowLine:{width:2,height:10,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:1},arrowHead:{position:"absolute",top:0,width:0,height:0,borderLeftWidth:5,borderRightWidth:5,borderBottomWidth:6,borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:l.COLORS.TEXT_PRIMARY},plusIcon:{width:18,height:18,alignItems:"center",justifyContent:"center"},plusH:{position:"absolute",width:16,height:2,borderRadius:1,backgroundColor:l.COLORS.TEXT_MUTED},plusV:{position:"absolute",width:2,height:16,borderRadius:1,backgroundColor:l.COLORS.TEXT_MUTED}})},486,[346,29,63,258,487,519,250]);
|
|
539
539
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.getCameraPermissionsAsync=f,_e.getMediaLibraryPermissionsAsync=p,_e.requestCameraPermissionsAsync=v,_e.requestMediaLibraryPermissionsAsync=P,Object.defineProperty(_e,"useMediaLibraryPermissions",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"useCameraPermissions",{enumerable:!0,get:function(){return M}}),_e.getPendingResultAsync=function(){return I.apply(this,arguments)},_e.launchCameraAsync=function(){return E.apply(this,arguments)},_e.launchImageLibraryAsync=function(){return L.apply(this,arguments)},Object.defineProperty(_e,"PermissionStatus",{enumerable:!0,get:function(){return u.PermissionStatus}});var n=e(r(d[0])),t=e(r(d[1])),u=r(d[2]),s=e(r(d[3])),o=r(d[4]),l=r(d[5]);function c(e){var n=e.aspect,s=e.quality,o=e.videoMaxDuration;if(null!=n){var l=(0,t.default)(n,2),c=l[0],f=l[1];if(c<=0||f<=0)throw new u.CodedError('ERR_INVALID_ARGUMENT',`Invalid aspect ratio values ${c}:${f}. Provide positive numbers.`)}if(s&&(s<0||s>1))throw new u.CodedError('ERR_INVALID_ARGUMENT',`Invalid 'quality' value ${s}. Provide a value between 0 and 1.`);if(o&&o<0)throw new u.CodedError('ERR_INVALID_ARGUMENT',`Invalid 'videoMaxDuration' value ${o}. Provide a non-negative number.`);return e}function f(){return y.apply(this,arguments)}function y(){return(y=(0,n.default)(function*(){return s.default.getCameraPermissionsAsync()})).apply(this,arguments)}function p(){return h.apply(this,arguments)}function h(){return h=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.default.getMediaLibraryPermissionsAsync(e)}),h.apply(this,arguments)}function v(){return b.apply(this,arguments)}function b(){return(b=(0,n.default)(function*(){return s.default.requestCameraPermissionsAsync()})).apply(this,arguments)}function P(){return A.apply(this,arguments)}function A(){return A=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,s.default.requestMediaLibraryPermissionsAsync)(e)}),A.apply(this,arguments)}Object.keys(l).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return l[e]}})});var w=(0,u.createPermissionHook)({getMethod:e=>p(e?.writeOnly),requestMethod:e=>P(e?.writeOnly)}),M=(0,u.createPermissionHook)({getMethod:f,requestMethod:v});function I(){return(I=(0,n.default)(function*(){return s.default.getPendingResultAsync?s.default.getPendingResultAsync():null})).apply(this,arguments)}function E(){return E=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!s.default.launchCameraAsync)throw new u.UnavailabilityError('ImagePicker','launchCameraAsync');var n=(0,o.mapDeprecatedOptions)(e);return yield s.default.launchCameraAsync(c(n))}),E.apply(this,arguments)}function L(){return L=(0,n.default)(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,o.mapDeprecatedOptions)(e);if(!s.default.launchImageLibraryAsync)throw new u.UnavailabilityError('ImagePicker','launchImageLibraryAsync');return n?.allowsEditing&&n.allowsMultipleSelection&&console.warn("[expo-image-picker] `allowsEditing` is not supported when `allowsMultipleSelection` is enabled and will be ignored.Disable either 'allowsEditing' or 'allowsMultipleSelection' in 'launchImageLibraryAsync' to fix this warning."),yield s.default.launchImageLibraryAsync(n)}),L.apply(this,arguments)}},487,[346,29,488,516,517,518]);
|
|
540
540
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"EventEmitter",{enumerable:!0,get:function(){return t.EventEmitter}}),Object.defineProperty(_e,"NativeModule",{enumerable:!0,get:function(){return n.NativeModule}}),Object.defineProperty(_e,"SharedObject",{enumerable:!0,get:function(){return o.SharedObject}}),Object.defineProperty(_e,"SharedRef",{enumerable:!0,get:function(){return u.SharedRef}}),Object.defineProperty(_e,"Platform",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(_e,"uuid",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"requireNativeViewManager",{enumerable:!0,get:function(){return b.requireNativeViewManager}}),Object.defineProperty(_e,"CodedError",{enumerable:!0,get:function(){return h.CodedError}}),Object.defineProperty(_e,"UnavailabilityError",{enumerable:!0,get:function(){return E.UnavailabilityError}}),Object.defineProperty(_e,"LegacyEventEmitter",{enumerable:!0,get:function(){return w.LegacyEventEmitter}}),Object.defineProperty(_e,"NativeModulesProxy",{enumerable:!0,get:function(){return k.default}}),r(d[0]),r(d[1]);var t=r(d[2]),n=r(d[3]),o=r(d[4]),u=r(d[5]),c=e(r(d[6])),f=e(r(d[7])),b=r(d[8]),l=r(d[9]);Object.keys(l).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return l[e]}})});var y=r(d[10]);Object.keys(y).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return y[e]}})});var O=r(d[11]);Object.keys(O).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return O[e]}})});var p=r(d[12]);Object.keys(p).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return p[e]}})});var j=r(d[13]);Object.keys(j).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return j[e]}})});var P=r(d[14]);Object.keys(P).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return P[e]}})});var s=r(d[15]);Object.keys(s).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return s[e]}})});var v=r(d[16]);Object.keys(v).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return v[e]}})});var h=r(d[17]),E=r(d[18]),w=r(d[19]),k=e(r(d[20]))},488,[489,498,499,500,501,502,495,503,506,491,507,508,509,510,511,512,513,497,514,515,492]);
|
|
@@ -569,10 +569,16 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
569
569
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseMediaTypes=p,e.mapDeprecatedOptions=function(s){if(!s.mediaTypes)return s;return{...s,mediaTypes:p(s.mediaTypes??[])}};var s=r(d[0]);function p(p){return p===s.MediaTypeOptions.Images||p===s.MediaTypeOptions.Videos||p===s.MediaTypeOptions.All?(console.warn('[expo-image-picker] `ImagePicker.MediaTypeOptions` have been deprecated. Use `ImagePicker.MediaType` or an array of `ImagePicker.MediaType` instead.'),{Images:['images'],Videos:['videos'],All:['images','videos']}[p]):'string'==typeof p?[p]:p}},517,[518]);
|
|
570
570
|
__d(function(g,r,i,a,m,e,d){"use strict";var t,n,o,u,c,l;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MediaTypeOptions",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"VideoExportPreset",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"UIImagePickerControllerQualityType",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"UIImagePickerPresentationStyle",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"UIImagePickerPreferredAssetRepresentationMode",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"CameraType",{enumerable:!0,get:function(){return l}}),(function(t){t.All="All",t.Videos="Videos",t.Images="Images"})(t||(t={})),(function(t){t[t.Passthrough=0]="Passthrough",t[t.LowQuality=1]="LowQuality",t[t.MediumQuality=2]="MediumQuality",t[t.HighestQuality=3]="HighestQuality",t[t.H264_640x480=4]="H264_640x480",t[t.H264_960x540=5]="H264_960x540",t[t.H264_1280x720=6]="H264_1280x720",t[t.H264_1920x1080=7]="H264_1920x1080",t[t.H264_3840x2160=8]="H264_3840x2160",t[t.HEVC_1920x1080=9]="HEVC_1920x1080",t[t.HEVC_3840x2160=10]="HEVC_3840x2160"})(n||(n={})),(function(t){t[t.High=0]="High",t[t.Medium=1]="Medium",t[t.Low=2]="Low",t[t.VGA640x480=3]="VGA640x480",t[t.IFrame1280x720=4]="IFrame1280x720",t[t.IFrame960x540=5]="IFrame960x540"})(o||(o={})),(function(t){t.FULL_SCREEN="fullScreen",t.PAGE_SHEET="pageSheet",t.FORM_SHEET="formSheet",t.CURRENT_CONTEXT="currentContext",t.OVER_FULL_SCREEN="overFullScreen",t.OVER_CURRENT_CONTEXT="overCurrentContext",t.POPOVER="popover",t.AUTOMATIC="automatic"})(u||(u={})),(function(t){t.Automatic="automatic",t.Compatible="compatible",t.Current="current"})(c||(c={})),(function(t){t.back="back",t.front="front"})(l||(l={}))},518,[]);
|
|
571
571
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SPACING",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"LAYOUT",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"COLORS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"TYPOGRAPHY",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"SIZES",{enumerable:!0,get:function(){return D}});var T={XS:4,SM:8,MD:12,LG:16,XL:20,XXL:24},_={CONTENT_PADDING_H:T.LG,SECTION_PADDING_V:T.MD,ELEMENT_GAP:T.MD,BORDER_RADIUS_LG:32,BORDER_RADIUS_MD:20,BORDER_RADIUS_SM:14},E={BACKGROUND:"#000",BACKGROUND_ELEVATED:"rgba(255,255,255,0.03)",BACKGROUND_INTERACTIVE:"rgba(255,255,255,0.08)",BACKGROUND_INPUT:"rgba(255,255,255,0.1)",BACKGROUND_BUTTON:"rgba(255,255,255,0.15)",TEXT_PRIMARY:"#fff",TEXT_SECONDARY:"rgba(255,255,255,0.6)",TEXT_TERTIARY:"rgba(255,255,255,0.5)",TEXT_MUTED:"rgba(255,255,255,0.4)",BORDER:"rgba(255,255,255,0.08)",STATUS_SUCCESS:"#30D158",STATUS_ERROR:"#FF3B30",STATUS_INFO:"#007AFF",STATUS_NEUTRAL:"#8E8E93"},S={SIZE_XS:11,SIZE_SM:13,SIZE_MD:14,SIZE_LG:15,SIZE_XL:17,WEIGHT_NORMAL:"400",WEIGHT_MEDIUM:"500",WEIGHT_SEMIBOLD:"600"},D={STATUS_DOT:8,CLOSE_BUTTON:30,SUBMIT_BUTTON:40,CTA_PADDING_V:6,CTA_PADDING_H:12}},519,[]);
|
|
572
|
-
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ResponseArea=function(e){var i=e.messages,s=e.currentParts,u=(0,n.useRef)(null),h=(0,n.useState)(!0),S=(0,t.default)(h,2),T=S[0],x=S[1],f=(0,n.useRef)(0),p=(0,n.useRef)(0),C=(0,n.useCallback)(e=>{var t=e.nativeEvent,n=t.contentOffset,i=t.contentSize,l=t.layoutMeasurement,s=i.height-l.height-n.y;x(s<50)},[]),y=(0,n.useCallback)((e,t)=>{f.current=t},[]),I=(0,n.useCallback)(e=>{p.current=e.nativeEvent.layout.height},[]);(0,n.useEffect)(()=>{if(T){var e=setTimeout(()=>{u.current?.scrollToEnd({animated:!1})},16);return()=>clearTimeout(e)}},[i,s,T]),(0,n.useEffect)(()=>{var e=i[i.length-1];"user_prompt"===e?.type&&(u.current?.scrollToEnd({animated:!0}),x(!0))},[i]),(0,n.useEffect)(()=>{var e=l.Keyboard.addListener("keyboardWillShow",()=>{T&&setTimeout(()=>{u.current?.scrollToEnd({animated:!0})},100)});return()=>e.remove()},[T]);var G=(0,n.useCallback)(()=>{u.current?.scrollToEnd({animated:!0}),x(!0)},[]);if(!(i.length>0||s.length>0))return(0,o.jsx)(l.View,{style:O.emptyContainer,children:(0,o.jsx)(l.Text,{style:O.emptyText,children:"Send a prompt to start coding with Claude"})});return(0,o.jsxs)(l.View,{style:O.wrapper,children:[(0,o.jsxs)(l.ScrollView,{ref:u,style:O.container,contentContainerStyle:O.content,showsVerticalScrollIndicator:!0,onScroll:C,onContentSizeChange:y,onLayout:I,scrollEventThrottle:16,children:[i.map((e,t)=>(0,o.jsx)(c,{message:e},t)),s.length>0&&(0,o.jsx)(P,{parts:s,isStreaming:!0})]}),!T&&(0,o.jsx)(l.TouchableOpacity,{style:O.scrollButton,onPress:G,activeOpacity:.8,children:(0,o.jsx)(l.Text,{style:O.scrollButtonText,children:"\u2193"})})]})};var t=e(r(d[0])),n=r(d[1]),i=e(n),l=r(d[2]),s=r(d[3]),o=r(d[4]);function c(e){var t=e.message;switch(t.type){case"stream":case"status":default:return null;case"tool":return(0,o.jsx)(b,{tool:t});case"result":return(0,o.jsx)(A,{result:t});case"error":return(0,o.jsx)(l.View,{style:O.errorContainer,children:(0,o.jsx)(l.Text,{style:O.errorText,children:t.message})});case"user_prompt":return(0,o.jsx)(u,{message:t});case"history_result":return(0,o.jsx)(h,{message:t});case"assistant_parts":return(0,o.jsx)(C,{message:t});case"system_message":return(0,o.jsx)(S,{message:t})}}function u(e){var t=e.message;return(0,o.jsxs)(l.View,{style:O.userPromptContainer,children:[t.images&&t.images.length>0&&(0,o.jsx)(l.View,{style:O.userImages,children:t.images.map((e,t)=>(0,o.jsx)(l.Image,{source:{uri:e.uri},style:O.userImageThumb},t))}),t.content?(0,o.jsx)(l.Text,{style:O.userPromptText,selectable:!0,children:t.content}):null]})}function h(e){var t=e.message;return(0,o.jsx)(l.View,{style:O.resultContainer,children:(0,o.jsx)(T,{content:t.content})})}function S(e){var t=e.message;return"error"===t.messageType?(0,o.jsx)(l.View,{style:O.errorContainer,children:(0,o.jsx)(l.Text,{style:O.errorText,children:t.content})}):(0,o.jsx)(l.View,{style:O.systemContainer,children:(0,o.jsx)(l.Text,{style:O.systemText,children:t.content})})}function T(e){for(var n=e.content,i=e.isStreaming,c=n.split('\n'),u=[],h=0;h<c.length;){var S=c[h],T=S.trim();if(T.startsWith('```')){var f=[],p=T.slice(3).trim();for(h++;h<c.length&&!c[h].trim().startsWith('```');)f.push(c[h]),h++;u.push((0,o.jsxs)(l.View,{style:O.codeBlock,children:[p&&(0,o.jsx)(l.Text,{style:O.codeLang,children:p}),(0,o.jsx)(l.Text,{style:O.codeText,selectable:!0,children:f.join('\n')})]},`code-${h}`)),h++}else{var P=T.match(/^(#{1,6})\s+(.+)$/);if(P){var C=P[1].length,y=C<=2?O.heading1:C<=4?O.heading2:O.heading3;u.push((0,o.jsx)(l.Text,{style:y,selectable:!0,children:x(P[2])},h)),h++}else if(T.startsWith('> ')||'>'===T){for(var I=[];h<c.length&&(c[h].trim().startsWith('> ')||'>'===c[h].trim());){var G=c[h].trim().startsWith('> ')?c[h].trim().slice(2):'';I.push(G),h++}u.push((0,o.jsx)(l.View,{style:O.blockquote,children:(0,o.jsx)(l.Text,{style:O.blockquoteText,selectable:!0,children:x(I.join('\n'))})},`quote-${h}`))}else{var b=T.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(b){var A=' '!==b[1];u.push((0,o.jsxs)(l.View,{style:O.listItem,children:[(0,o.jsx)(l.Text,{style:O.listBullet,children:A?'\u2611':'\u2610'}),(0,o.jsx)(l.Text,{style:O.listText,selectable:!0,children:x(b[2])})]},h)),h++}else{var R=S.match(/^(\s*)(\d+)\.\s+(.+)$/);if(R){var j=Math.floor(R[1].length/2),E=(0,t.default)(R,4),M=E[2],L=E[3];u.push((0,o.jsxs)(l.View,{style:[O.listItem,j>0&&{paddingLeft:s.SPACING.SM+j*s.SPACING.LG}],children:[(0,o.jsxs)(l.Text,{style:O.listNumber,children:[M,"."]}),(0,o.jsx)(l.Text,{style:O.listText,selectable:!0,children:x(L)})]},h)),h++}else{var Y=S.match(/^(\s*)[-*]\s+(.+)$/);if(Y){var _=Math.floor(Y[1].length/2),v=0===_?'\u2022':1===_?'\u25e6':'\u25aa';u.push((0,o.jsxs)(l.View,{style:[O.listItem,_>0&&{paddingLeft:s.SPACING.SM+_*s.SPACING.LG}],children:[(0,o.jsx)(l.Text,{style:O.listBullet,children:v}),(0,o.jsx)(l.Text,{style:O.listText,selectable:!0,children:x(Y[2])})]},h)),h++}else/^[-*_]{3,}$/.test(T)?(u.push((0,o.jsx)(l.View,{style:O.horizontalRule},h)),h++):T?(u.push((0,o.jsx)(l.Text,{style:O.responseText,selectable:!0,children:x(S)},h)),h++):(u.push((0,o.jsx)(l.View,{style:O.paragraphBreak},h)),h++)}}}}}return(0,o.jsxs)(l.View,{style:O.formattedContainer,children:[u,i&&(0,o.jsx)(l.View,{style:O.cursor})]})}function x(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?f(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(l.Text,{style:O.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(i.default.Fragment,{children:f(e)},t))}function f(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?p(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(l.Text,{style:O.linkText,onPress:()=>l.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(i.default.Fragment,{children:p(e)},t)})}function p(e){var t=e.split(/(\*\*[^*]+\*\*|~~[^~]+~~|\*[^*]+\*)/g);return 1===t.length?e:t.map((e,t)=>e.startsWith('**')&&e.endsWith('**')?(0,o.jsx)(l.Text,{style:O.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(l.Text,{style:O.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(l.Text,{style:O.italicText,children:e.slice(1,-1)},t):e)}function P(e){var t=e.parts,n=e.isStreaming;return(0,o.jsx)(l.View,{style:O.partsContainer,children:t.map((e,i)=>{if("text"===e.type){var s=i===t.length-1;return(0,o.jsx)(l.View,{style:O.messageContainer,children:(0,o.jsx)(T,{content:e.content,isStreaming:n&&s})},e.id)}return"tool"===e.type?(0,o.jsx)(G,{part:e},e.id):null})})}function C(e){var t=e.message;return(0,o.jsxs)(l.View,{style:O.resultContainer,children:[(0,o.jsx)(P,{parts:t.parts,isStreaming:!1}),!t.isComplete&&(0,o.jsx)(l.Text,{style:O.interruptedText,children:"(interrupted)"})]})}function y(e,t){var n=e=>e.split('/').pop()||e;switch(e){case"Read":return{label:"read",value:n(t?.file_path||"file")};case"Edit":return{label:"edit",value:n(t?.file_path||"file")};case"Write":return{label:"write",value:n(t?.file_path||"file")};case"Bash":var i=t?.command||"";return{label:"$",value:i.length>45?i.slice(0,45)+"\u2026":i};case"Glob":return{label:"glob",value:t?.pattern||"*"};case"Grep":return{label:"grep",value:t?.pattern||"search"};case"Task":return{label:"agent",value:t?.description||"task"};default:return{label:e.toLowerCase(),value:""}}}function I(e){var t=e.toolName,n=e.input,i=e.isFailed,s=y(t,n),c=s.label,u=s.value;return(0,o.jsxs)(l.View,{style:O.toolLine,children:[(0,o.jsx)(l.Text,{style:i?O.toolLabelFailed:O.toolLabel,children:c}),(0,o.jsx)(l.Text,{style:i?O.toolValueFailed:O.toolValue,numberOfLines:1,children:u}),i&&(0,o.jsx)(l.Text,{style:O.toolLabelFailed,children:" \u2715"})]})}function G(e){var t=e.part;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function b(e){var t=e.tool;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function A(e){var t=e.result;return!t.success&&t.error?(0,o.jsx)(l.View,{style:O.errorContainer,children:(0,o.jsx)(l.Text,{style:O.errorText,children:t.error})}):(0,o.jsxs)(l.View,{style:O.resultContainer,children:[t.result&&(0,o.jsx)(l.Text,{style:O.responseText,selectable:!0,children:t.result}),(void 0!==t.costUsd||void 0!==t.durationMs)&&(0,o.jsxs)(l.Text,{style:O.metaText,children:[void 0!==t.durationMs&&`${t.durationMs}ms`,void 0!==t.costUsd&&void 0!==t.durationMs&&" \u2022 ",void 0!==t.costUsd&&`$${t.costUsd.toFixed(4)}`]})]})}var O=l.StyleSheet.create({wrapper:{flex:1,position:"relative"},container:{flex:1,backgroundColor:s.COLORS.BACKGROUND},content:{padding:s.LAYOUT.CONTENT_PADDING_H,paddingBottom:s.SPACING.XXL},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:s.SPACING.XXL},emptyText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,textAlign:"center",lineHeight:22},messageContainer:{flexDirection:"row",flexWrap:"wrap"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:s.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},resultContainer:{marginTop:s.SPACING.SM},partsContainer:{},formattedContainer:{flexDirection:"column"},listItem:{flexDirection:"row",marginVertical:s.SPACING.XS/2,paddingLeft:s.SPACING.SM},listNumber:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:s.SPACING.SM,padding:s.SPACING.MD,marginVertical:s.SPACING.SM},codeLang:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS,fontFamily:"Menlo",marginBottom:s.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"Menlo",fontSize:s.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_XL,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:s.SPACING.MD,marginBottom:s.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},boldText:{fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:s.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:s.COLORS.TEXT_MUTED},linkText:{color:s.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:s.SPACING.MD,marginVertical:s.SPACING.XS},blockquoteText:{color:s.COLORS.TEXT_SECONDARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:s.COLORS.BORDER,marginVertical:s.SPACING.MD},paragraphBreak:{height:s.SPACING.SM},interruptedText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontStyle:"italic",marginTop:s.SPACING.XS},metaText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,marginTop:s.SPACING.SM+2},errorContainer:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},errorText:{color:"#FF6B6B",fontSize:s.TYPOGRAPHY.SIZE_MD},systemContainer:{backgroundColor:"rgba(255,255,255,0.05)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},systemText:{color:s.COLORS.TEXT_TERTIARY,fontSize:s.TYPOGRAPHY.SIZE_MD,fontStyle:"italic"},toolLine:{flexDirection:"row",alignItems:"center",marginVertical:s.SPACING.XS},toolLabel:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolLabelFailed:{color:"rgba(255,100,100,0.6)",fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolValue:{color:"rgba(255,255,255,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},toolValueFailed:{color:"rgba(255,100,100,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},userPromptContainer:{backgroundColor:"rgba(0,122,255,0.15)",borderRadius:s.LAYOUT.BORDER_RADIUS_SM+2,padding:s.SPACING.MD,marginVertical:s.SPACING.SM,alignSelf:"flex-end",maxWidth:"85%"},userPromptText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:20},userImages:{flexDirection:"row",flexWrap:"wrap",gap:s.SPACING.SM,marginBottom:s.SPACING.SM},userImageThumb:{width:80,height:80,borderRadius:s.SPACING.SM,backgroundColor:"rgba(255,255,255,0.1)"},scrollButton:{position:"absolute",bottom:s.LAYOUT.CONTENT_PADDING_H,alignSelf:"center",left:"50%",marginLeft:-18,width:36,height:36,borderRadius:18,backgroundColor:"rgba(255,255,255,0.12)",borderWidth:1,borderColor:"rgba(255,255,255,0.2)",alignItems:"center",justifyContent:"center"},scrollButtonText:{color:s.COLORS.TEXT_PRIMARY,fontSize:18,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD}})},520,[29,63,258,519,250]);
|
|
573
|
-
__d(function(g,r,
|
|
574
|
-
__d(function(g,r,
|
|
575
|
-
__d(function(g,r,i,a,m,
|
|
576
|
-
__d(function(g,r,
|
|
572
|
+
__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,c=e.currentParts,h=(0,o.useRef)(null),T=(0,o.useState)(!0),p=(0,n.default)(T,2),y=p[0],C=p[1],S=(0,o.useRef)(0),x=(0,o.useRef)(0),E=(0,o.useCallback)(e=>{var t=e.nativeEvent,n=t.contentOffset,o=t.contentSize,l=t.layoutMeasurement,s=o.height-l.height-n.y;C(s<50)},[]),O=(0,o.useCallback)((e,t)=>{S.current=t},[]),b=(0,o.useCallback)(e=>{x.current=e.nativeEvent.layout.height},[]);(0,o.useEffect)(()=>{if(y){var e=setTimeout(()=>{h.current?.scrollToEnd({animated:!1})},16);return()=>clearTimeout(e)}},[t,c,y]),(0,o.useEffect)(()=>{var e=t[t.length-1];"user_prompt"===e?.type&&(h.current?.scrollToEnd({animated:!0}),C(!0))},[t]),(0,o.useEffect)(()=>{var e=l.Keyboard.addListener("keyboardWillShow",()=>{y&&setTimeout(()=>{h.current?.scrollToEnd({animated:!0})},100)});return()=>e.remove()},[y]);var v=(0,o.useCallback)(()=>{h.current?.scrollToEnd({animated:!0}),C(!0)},[]);if(!(t.length>0||c.length>0))return(0,u.jsx)(l.View,{style:f.emptyContainer,children:(0,u.jsx)(l.Text,{style:f.emptyText,children:"Send a prompt to start coding with Claude"})});return(0,u.jsxs)(l.View,{style:f.wrapper,children:[(0,u.jsxs)(l.ScrollView,{ref:h,style:f.container,contentContainerStyle:f.content,showsVerticalScrollIndicator:!0,onScroll:E,onContentSizeChange:O,onLayout:b,scrollEventThrottle:16,children:[t.map((e,t)=>(0,u.jsx)(s.MessageItem,{message:e},t)),c.length>0&&(0,u.jsx)(s.PartsRenderer,{parts:c,isStreaming:!0})]}),!y&&(0,u.jsx)(l.TouchableOpacity,{style:f.scrollButton,onPress:v,activeOpacity:.8,children:(0,u.jsx)(l.Text,{style:f.scrollButtonText,children:"\u2193"})})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),l=r(d[2]),s=r(d[3]),c=r(d[4]),u=r(d[5]);var f=l.StyleSheet.create({wrapper:{flex:1,position:"relative"},container:{flex:1,backgroundColor:c.COLORS.BACKGROUND},content:{padding:c.LAYOUT.CONTENT_PADDING_H,paddingBottom:c.SPACING.XXL},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:c.SPACING.XXL},emptyText:{color:c.COLORS.TEXT_MUTED,fontSize:c.TYPOGRAPHY.SIZE_LG,textAlign:"center",lineHeight:22},scrollButton:{position:"absolute",bottom:c.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:c.COLORS.TEXT_PRIMARY,fontSize:18,fontWeight:c.TYPOGRAPHY.WEIGHT_SEMIBOLD}})},520,[29,63,258,521,519,250]);
|
|
573
|
+
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.MessageItem=function(n){var s=n.message;switch(s.type){case"stream":case"status":default:return null;case"tool":return(0,l.jsx)(f,{tool:s});case"result":return(0,l.jsx)(h,{result:s});case"error":return(0,l.jsx)(t.View,{style:C.errorContainer,children:(0,l.jsx)(t.Text,{style:C.errorText,children:s.message})});case"user_prompt":return(0,l.jsx)(i,{message:s});case"history_result":return(0,l.jsx)(o,{message:s});case"assistant_parts":return(0,l.jsx)(x,{message:s});case"system_message":return(0,l.jsx)(u,{message:s})}},e.PartsRenderer=c,r(d[0]);var t=r(d[1]),n=r(d[2]),s=r(d[3]),l=r(d[4]);function i(n){var s=n.message;return(0,l.jsxs)(t.View,{style:C.userPromptContainer,children:[s.images&&s.images.length>0&&(0,l.jsx)(t.View,{style:C.userImages,children:s.images.map((n,s)=>(0,l.jsx)(t.Image,{source:{uri:n.uri},style:C.userImageThumb},s))}),s.content?(0,l.jsx)(t.Text,{style:C.userPromptText,selectable:!0,children:s.content}):null]})}function o(s){var i=s.message;return(0,l.jsx)(t.View,{style:C.resultContainer,children:(0,l.jsx)(n.FormattedText,{content:i.content})})}function u(n){var s=n.message;return"error"===s.messageType?(0,l.jsx)(t.View,{style:C.errorContainer,children:(0,l.jsx)(t.Text,{style:C.errorText,children:s.content})}):(0,l.jsx)(t.View,{style:C.systemContainer,children:(0,l.jsx)(t.Text,{style:C.systemText,children:s.content})})}function c(s){var i=s.parts,o=s.isStreaming;return(0,l.jsx)(t.View,{style:C.partsContainer,children:i.map((s,u)=>{if("text"===s.type){var c=u===i.length-1;return(0,l.jsx)(t.View,{style:C.messageContainer,children:(0,l.jsx)(n.FormattedText,{content:s.content,isStreaming:o&&c})},s.id)}return"tool"===s.type?(0,l.jsx)(p,{part:s},s.id):null})})}function x(n){var s=n.message;return(0,l.jsxs)(t.View,{style:C.resultContainer,children:[(0,l.jsx)(c,{parts:s.parts,isStreaming:!1}),!s.isComplete&&(0,l.jsx)(t.Text,{style:C.interruptedText,children:"(interrupted)"})]})}function S(t,n){var s=t=>t.split('/').pop()||t;switch(t){case"Read":return{label:"read",value:s(n?.file_path||"file")};case"Edit":return{label:"edit",value:s(n?.file_path||"file")};case"Write":return{label:"write",value:s(n?.file_path||"file")};case"Bash":var l=n?.command||"";return{label:"$",value:l.length>45?l.slice(0,45)+"\u2026":l};case"Glob":return{label:"glob",value:n?.pattern||"*"};case"Grep":return{label:"grep",value:n?.pattern||"search"};case"Task":return{label:"agent",value:n?.description||"task"};default:return{label:t.toLowerCase(),value:""}}}function T(n){var s=n.toolName,i=n.input,o=n.isFailed,u=S(s,i),c=u.label,x=u.value;return(0,l.jsxs)(t.View,{style:C.toolLine,children:[(0,l.jsx)(t.Text,{style:o?C.toolLabelFailed:C.toolLabel,children:c}),(0,l.jsx)(t.Text,{style:o?C.toolValueFailed:C.toolValue,numberOfLines:1,children:x}),o&&(0,l.jsx)(t.Text,{style:C.toolLabelFailed,children:" \u2715"})]})}function p(t){var n=t.part;return"started"===n.status?null:(0,l.jsx)(T,{toolName:n.toolName,input:n.input,isFailed:"failed"===n.status})}function f(t){var n=t.tool;return"started"===n.status?null:(0,l.jsx)(T,{toolName:n.toolName,input:n.input,isFailed:"failed"===n.status})}function h(n){var s=n.result;return!s.success&&s.error?(0,l.jsx)(t.View,{style:C.errorContainer,children:(0,l.jsx)(t.Text,{style:C.errorText,children:s.error})}):(0,l.jsxs)(t.View,{style:C.resultContainer,children:[s.result&&(0,l.jsx)(t.Text,{style:C.responseText,selectable:!0,children:s.result}),void 0!==s.durationMs&&(0,l.jsx)(t.Text,{style:C.metaText,children:`${s.durationMs}ms`})]})}var C=t.StyleSheet.create({messageContainer:{flexDirection:"row",flexWrap:"wrap"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},resultContainer:{marginTop:s.SPACING.SM},partsContainer:{},interruptedText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontStyle:"italic",marginTop:s.SPACING.XS},metaText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,marginTop:s.SPACING.SM+2},errorContainer:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},errorText:{color:"#FF6B6B",fontSize:s.TYPOGRAPHY.SIZE_MD},systemContainer:{backgroundColor:"rgba(255,255,255,0.05)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},systemText:{color:s.COLORS.TEXT_TERTIARY,fontSize:s.TYPOGRAPHY.SIZE_MD,fontStyle:"italic"},toolLine:{flexDirection:"row",alignItems:"center",marginVertical:s.SPACING.XS},toolLabel:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolLabelFailed:{color:"rgba(255,100,100,0.6)",fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolValue:{color:"rgba(255,255,255,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},toolValueFailed:{color:"rgba(255,100,100,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},userPromptContainer:{backgroundColor:"rgba(0,122,255,0.15)",borderRadius:s.LAYOUT.BORDER_RADIUS_SM+2,padding:s.SPACING.MD,marginVertical:s.SPACING.SM,alignSelf:"flex-end",maxWidth:"85%"},userPromptText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:20},userImages:{flexDirection:"row",flexWrap:"wrap",gap:s.SPACING.SM,marginBottom:s.SPACING.SM},userImageThumb:{width:80,height:80,borderRadius:s.SPACING.SM,backgroundColor:"rgba(255,255,255,0.1)"}})},521,[63,258,522,519,250]);
|
|
574
|
+
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FormattedText=function(e){var i=e.content,h=e.isStreaming,c=i.split('\n'),S=[],x=0;for(;x<c.length;){var u=c[x],P=u.trim();if(P.startsWith('```')){var f=[],G=P.slice(3).trim();for(x++;x<c.length&&!c[x].trim().startsWith('```');)f.push(c[x]),x++;S.push((0,o.jsxs)(l.View,{style:T.codeBlock,children:[G&&(0,o.jsx)(l.Text,{style:T.codeLang,children:G}),(0,o.jsx)(l.Text,{style:T.codeText,selectable:!0,children:f.join('\n')})]},`code-${x}`)),x++}else{var I=P.match(/^(#{1,6})\s+(.+)$/);if(I){var O=I[1].length,A=O<=2?T.heading1:O<=4?T.heading2:T.heading3;S.push((0,o.jsx)(l.Text,{style:A,selectable:!0,children:s(I[2])},x)),x++}else if(P.startsWith('> ')||'>'===P){for(var C=[];x<c.length&&(c[x].trim().startsWith('> ')||'>'===c[x].trim());){var R=c[x].trim().startsWith('> ')?c[x].trim().slice(2):'';C.push(R),x++}S.push((0,o.jsx)(l.View,{style:T.blockquote,children:(0,o.jsx)(l.Text,{style:T.blockquoteText,selectable:!0,children:s(C.join('\n'))})},`quote-${x}`))}else{var p=P.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(p){var L=' '!==p[1];S.push((0,o.jsxs)(l.View,{style:T.listItem,children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:L?'\u2611':'\u2610'}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(p[2])})]},x)),x++}else{var Y=u.match(/^(\s*)(\d+)\.\s+(.+)$/);if(Y){var E=Math.floor(Y[1].length/2),M=(0,t.default)(Y,4),b=M[2],y=M[3];S.push((0,o.jsxs)(l.View,{style:[T.listItem,E>0&&{paddingLeft:n.SPACING.SM+E*n.SPACING.LG}],children:[(0,o.jsxs)(l.Text,{style:T.listNumber,children:[b,"."]}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(y)})]},x)),x++}else{var _=u.match(/^(\s*)[-*]\s+(.+)$/);if(_){var H=Math.floor(_[1].length/2),j=0===H?'\u2022':1===H?'\u25e6':'\u25aa';S.push((0,o.jsxs)(l.View,{style:[T.listItem,H>0&&{paddingLeft:n.SPACING.SM+H*n.SPACING.LG}],children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:j}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(_[2])})]},x)),x++}else/^[-*_]{3,}$/.test(P)?(S.push((0,o.jsx)(l.View,{style:T.horizontalRule},x)),x++):P?(S.push((0,o.jsx)(l.Text,{style:T.responseText,selectable:!0,children:s(u)},x)),x++):(S.push((0,o.jsx)(l.View,{style:T.paragraphBreak},x)),x++)}}}}}return(0,o.jsxs)(l.View,{style:T.formattedContainer,children:[S,h&&(0,o.jsx)(l.View,{style:T.cursor})]})};var t=e(r(d[0])),i=e(r(d[1])),l=r(d[2]),n=r(d[3]),o=r(d[4]);function s(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?h(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(l.Text,{style:T.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(i.default.Fragment,{children:h(e)},t))}function h(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?c(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(l.Text,{style:T.linkText,onPress:()=>l.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(i.default.Fragment,{children:c(e)},t)})}function c(e){var t=e.split(/(\*\*[^*]+\*\*|~~[^~]+~~|\*[^*]+\*)/g);return 1===t.length?e:t.map((e,t)=>e.startsWith('**')&&e.endsWith('**')?(0,o.jsx)(l.Text,{style:T.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(l.Text,{style:T.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(l.Text,{style:T.italicText,children:e.slice(1,-1)},t):e)}var T=l.StyleSheet.create({formattedContainer:{flexDirection:"column"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:n.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},listItem:{flexDirection:"row",marginVertical:n.SPACING.XS/2,paddingLeft:n.SPACING.SM},listNumber:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:n.SPACING.SM,padding:n.SPACING.MD,marginVertical:n.SPACING.SM},codeLang:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_XS,fontFamily:"Menlo",marginBottom:n.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"Menlo",fontSize:n.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:n.COLORS.TEXT_PRIMARY,fontSize:n.TYPOGRAPHY.SIZE_XL,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:n.SPACING.MD,marginBottom:n.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},boldText:{fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:n.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:n.COLORS.TEXT_MUTED},linkText:{color:n.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:n.SPACING.MD,marginVertical:n.SPACING.XS},blockquoteText:{color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:n.COLORS.BORDER,marginVertical:n.SPACING.MD},paragraphBreak:{height:n.SPACING.SM}})},522,[29,63,258,519,250]);
|
|
575
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GitChangesTab=function(c){var f=c.changes,x=c.onDiscard;if(!(f.length>0))return(0,n.jsxs)(t.View,{style:s.emptyContainer,children:[(0,n.jsx)(t.Text,{style:s.emptyTitle,children:"No uncommitted changes"}),(0,n.jsx)(t.Text,{style:s.emptySubtext,children:"Your working directory is clean"})]});return(0,n.jsxs)(t.View,{style:s.container,children:[(0,n.jsx)(t.ScrollView,{style:s.fileList,contentContainerStyle:s.fileListContent,children:f.map((c,f)=>(0,n.jsxs)(t.View,{style:s.fileRow,children:[(0,n.jsx)(t.Text,{style:[s.statusIcon,{color:l[c.status]}],children:o[c.status]}),(0,n.jsx)(t.Text,{style:s.fileName,numberOfLines:1,children:c.file})]},`${c.file}-${f}`))}),(0,n.jsxs)(t.View,{style:s.footer,children:[(0,n.jsx)(t.TouchableOpacity,{style:s.discardButton,onPress:x,children:(0,n.jsx)(t.Text,{style:s.discardText,children:"Discard All Changes"})}),(0,n.jsx)(t.Text,{style:s.warningText,children:"Note: Discarding won't reset memory"})]})]})},r(d[0]);var t=r(d[1]),n=r(d[2]),o={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?"},l={added:"#30D158",modified:"#FFD60A",deleted:"#FF453A",renamed:"#BF5AF2",untracked:"#8E8E93"};var s=t.StyleSheet.create({container:{flex:1,backgroundColor:"#000"},emptyContainer:{flex:1,backgroundColor:"#000",alignItems:"center",justifyContent:"center",padding:24},emptyTitle:{color:"rgba(255,255,255,0.6)",fontSize:16,fontWeight:"500",marginBottom:8},emptySubtext:{color:"rgba(255,255,255,0.4)",fontSize:14},fileList:{flex:1},fileListContent:{padding:16},fileRow:{flexDirection:"row",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255,255,255,0.06)"},statusIcon:{width:20,fontSize:13,fontWeight:"600",fontFamily:"Menlo"},fileName:{flex:1,color:"rgba(255,255,255,0.8)",fontSize:14,fontFamily:"Menlo"},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(255,255,255,0.08)",alignItems:"center"},discardButton:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:12,paddingVertical:12,paddingHorizontal:24,marginBottom:8},discardText:{color:"#FF3B30",fontSize:15,fontWeight:"500"},warningText:{color:"rgba(255,255,255,0.3)",fontSize:12}})},523,[63,258,250]);
|
|
576
|
+
__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BranchSwitcher=function(e){var t=e.branches,s=e.currentBranch,S=e.loading,b=e.onSelect,C=e.onCreate,p=e.onClose,I=e.error,P=(0,o.useState)(!1),x=(0,n.default)(P,2),f=x[0],A=x[1],O=(0,o.useState)(""),R=(0,n.default)(O,2),G=R[0],y=R[1],M=u(t,""),E=()=>{var e=G.trim();e&&(C(e),y(""),A(!1))},H=(e,t)=>{var n=e.name===s;return(0,c.jsxs)(i.TouchableOpacity,{style:[T.branchItem,n&&T.branchItemCurrent,t&&T.branchItemFirst],onPress:()=>{n||b(e.name)},activeOpacity:n?1:.6,children:[(0,c.jsxs)(i.View,{style:T.branchInfo,children:[(0,c.jsx)(i.Text,{style:[T.branchName,n&&T.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,c.jsx)(i.View,{style:T.prBadge,children:(0,c.jsxs)(i.Text,{style:T.prBadgeText,children:["#",e.prNumber]})}),e.isRemote&&(0,c.jsx)(i.View,{style:T.remoteBadge,children:(0,c.jsx)(i.Text,{style:T.remoteBadgeText,children:"remote"})})]}),n&&(0,c.jsx)(i.Text,{style:T.currentIndicator,children:"\u2713"})]},e.name)};return(0,c.jsxs)(i.View,{style:T.overlay,children:[(0,c.jsx)(i.TouchableOpacity,{style:T.backdrop,onPress:p,activeOpacity:1}),(0,c.jsxs)(i.View,{style:T.dropdown,children:[I&&(0,c.jsx)(i.View,{style:T.errorBanner,children:(0,c.jsx)(i.Text,{style:T.errorText,numberOfLines:2,children:I})}),S&&0===t.length?(0,c.jsx)(i.View,{style:T.loadingContainer,children:(0,c.jsx)(h,{})}):(0,c.jsx)(i.ScrollView,{style:T.branchList,bounces:!1,children:M.map(e=>(0,c.jsxs)(i.View,{children:[(0,c.jsx)(i.View,{style:T.sectionHeader,children:(0,c.jsx)(i.Text,{style:T.sectionHeaderText,children:e.title})}),e.branches.map((e,t)=>H(e,0===t))]},e.title))}),(0,c.jsx)(i.View,{style:T.createSection,children:f?(0,c.jsxs)(i.View,{style:T.createInputRow,children:[(0,c.jsx)(i.TextInput,{style:T.createInput,value:G,onChangeText:y,placeholder:"branch-name",placeholderTextColor:l.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:E,returnKeyType:"done"}),(0,c.jsx)(i.TouchableOpacity,{style:[T.createConfirmButton,!G.trim()&&T.createConfirmDisabled],onPress:E,disabled:!G.trim(),children:(0,c.jsx)(i.Text,{style:T.createConfirmText,children:"Create"})})]}):(0,c.jsx)(i.TouchableOpacity,{style:T.createButton,onPress:()=>A(!0),children:(0,c.jsx)(i.Text,{style:T.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),i=r(d[2]),l=r(d[3]),c=r(d[4]),s=["main","master"],S=5;function u(e,t){var n=t.toLowerCase().trim(),o=n?e.filter(e=>e.name.toLowerCase().includes(n)):e,i=o.filter(e=>s.includes(e.name)),l=o.filter(e=>!s.includes(e.name)),c=l.filter(e=>!e.isRemote).slice(0,S),u=new Set(c.map(e=>e.name)),h=l.filter(e=>!u.has(e.name)),T=[];return i.length>0&&T.push({title:"Default",branches:i}),c.length>0&&T.push({title:"Recent",branches:c}),h.length>0&&T.push({title:"Other",branches:h}),T}function h(){var e=(0,o.useRef)(new i.Animated.Value(.3)).current,t=(0,o.useRef)(new i.Animated.Value(.3)).current,n=(0,o.useRef)(new i.Animated.Value(.3)).current;return(0,o.useEffect)(()=>{var o=(e,t)=>i.Animated.loop(i.Animated.sequence([i.Animated.delay(t),i.Animated.timing(e,{toValue:1,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0}),i.Animated.timing(e,{toValue:.3,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0})])),l=o(e,0),c=o(t,150),s=o(n,300);return l.start(),c.start(),s.start(),()=>{l.stop(),c.stop(),s.stop()}},[e,t,n]),(0,c.jsx)(i.View,{style:T.loadingDots,children:[e,t,n].map((e,t)=>(0,c.jsx)(i.Animated.View,{style:[T.loadingDot,{opacity:e}]},t))})}var T=i.StyleSheet.create({overlay:{...i.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...i.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:l.SPACING.SM,right:l.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:l.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},loadingContainer:{paddingVertical:l.SPACING.XL,alignItems:"center",justifyContent:"center"},loadingDots:{flexDirection:"row",gap:6},loadingDot:{width:6,height:6,borderRadius:3,backgroundColor:"rgba(255,255,255,0.5)"},branchList:{maxHeight:300},sectionHeader:{paddingHorizontal:l.SPACING.LG,paddingTop:l.SPACING.MD,paddingBottom:l.SPACING.XS},sectionHeaderText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD,textTransform:"uppercase",letterSpacing:.5},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD+2,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:l.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:l.COLORS.TEXT_PRIMARY,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},remoteBadge:{backgroundColor:"rgba(255,255,255,0.06)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},remoteBadgeText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL},currentIndicator:{color:l.COLORS.STATUS_SUCCESS,fontSize:l.TYPOGRAPHY.SIZE_SM,marginLeft:l.SPACING.SM},createSection:{paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD,borderTopWidth:i.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:l.SPACING.XS},createButtonText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_MD,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:l.COLORS.STATUS_INFO,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_SM,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.SM,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:l.TYPOGRAPHY.SIZE_SM}})},524,[29,63,258,519,250]);
|
|
577
|
+
__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,c=e.branchName,l=e.onBranchPress,T={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,processing:n.COLORS.STATUS_INFO};return(0,o.jsxs)(t.View,{style:u.header,children:[(0,o.jsx)(t.TouchableOpacity,{onPress:S,style:u.closeButton,children:(0,o.jsx)(t.Text,{style:u.closeButtonText,children:"\u2715"})}),(0,o.jsx)(t.TouchableOpacity,{style:u.branchButton,onPress:l,disabled:!c,children:c?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Text,{style:u.branchName,numberOfLines:1,children:c}),(0,o.jsx)(t.Text,{style:u.branchChevron,children:"\u25be"})]}):(0,o.jsx)(t.View,{style:u.branchLoadingBar})}),(0,o.jsx)(t.View,{style:[u.statusDot,{backgroundColor:T[s]}]})]})},_e.PulsingIndicator=function(c){var l=c.status,S={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,processing:n.COLORS.STATUS_INFO},T="processing"===l||"connecting"===l,O=(0,e.useRef)(new t.Animated.Value(1)).current,h=(0,e.useRef)(new t.Animated.Value(.4)).current;return(0,e.useEffect)(()=>{if(T){var e=t.Animated.loop(t.Animated.sequence([t.Animated.parallel([t.Animated.timing(O,{toValue:1.3,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0}),t.Animated.timing(h,{toValue:0,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0})]),t.Animated.parallel([t.Animated.timing(O,{toValue:1,duration:0,useNativeDriver:!0}),t.Animated.timing(h,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}O.setValue(1),h.setValue(.4)},[T,O,h]),(0,o.jsxs)(t.View,{style:u.indicatorContainer,children:[(0,o.jsx)(t.View,{style:[u.indicator,{backgroundColor:S[l]}]}),T&&(0,o.jsx)(s,{style:[u.indicatorRing,{borderColor:S[l],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,c=t.NativeModules.WidgetBridge,l=t.NativeModules.ExpoAir;function S(){try{c?.collapse?c.collapse():l?.collapse?l.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}var u=t.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.LAYOUT.CONTENT_PADDING_H,paddingVertical:n.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:n.COLORS.BORDER},closeButton:{width:n.SIZES.CLOSE_BUTTON,height:n.SIZES.CLOSE_BUTTON,borderRadius:n.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:n.SPACING.MD},closeButtonText:{color:"transparent",fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_SM,marginLeft:n.SPACING.XS},branchLoadingBar:{width:80,height:12,borderRadius:6,backgroundColor:"rgba(255,255,255,0.08)"},statusDot:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2,marginLeft:n.SPACING.MD},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}})},525,[63,258,519,250]);
|
|
578
|
+
__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}})},526,[63,258,519,250]);
|
|
579
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useWebSocketMessages=function(e){var o=e.serverUrl,l=e.onGitMessage,p=(0,n.useState)("disconnected"),f=(0,s.default)(p,2),v=f[0],b=f[1],k=(0,n.useState)([]),h=(0,s.default)(k,2),y=h[0],C=h[1],_=(0,n.useState)([]),S=(0,s.default)(_,2),w=S[0],M=S[1],W=(0,n.useRef)([]),I=(0,n.useRef)(null),N=(0,n.useRef)(0),x=(0,n.useRef)(!1),P=(0,n.useRef)(l);(0,n.useEffect)(()=>{P.current=l},[l]);var R=(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()};C(e=>[...e,n])}W.current=[],I.current=null,M([])},[]),E=(0,n.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==I.current&&(W.current.length>0&&I.current&&R(I.current,!1),I.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-"+N.current++,content:e.chunk}],M([...W.current])}break;case"tool":if("started"!==e.status){var n={type:"tool",id:"tool-"+N.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};W.current=[...W.current,n],M([...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};C(e=>[...e,u,c])}else C(e=>[...e,u])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&C(t=>[...t,e]);W.current=[],I.current=null,M([]);break;case"error":if(W.current.length>0&&I.current){var o={type:"assistant_parts",promptId:I.current,parts:W.current,isComplete:!1,timestamp:Date.now()};C(t=>[...t,o,e])}else C(t=>[...t,e]);W.current=[],I.current=null,M([]);break;case"status":break;case"session_cleared":C([]),W.current=[],I.current=null,N.current=0,M([]);break;case"stopped":W.current.length>0&&I.current?R(I.current,!1):(W.current=[],I.current=null,M([]));break;case"history":var l=e.entries.flatMap(e=>"user"===e.role?[{type:"user_prompt",content:e.content,timestamp:e.timestamp}]:"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]);C(l);break;case"git_status":case"branches_list":case"branch_switched":case"branch_created":P.current(e)}},[R]);(0,n.useEffect)(()=>{console.log("[expo-air] Connecting to:",o?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,u.createWebSocketClient)({url:o,onStatusChange:b,onMessage:E,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[o]),(0,n.useEffect)(()=>(0,c.setupTapHandler)((e,t)=>{var s=(0,u.getWebSocketClient)();s&&!s.isConnected()&&s.connect()}),[]);var T=(0,n.useCallback)((function(){var e=(0,t.default)(function*(e,t){if(!x.current){var s=yield(0,c.requestPushToken)();if(s){var n=(0,u.getWebSocketClient)();n?.isConnected()&&(n.sendPushToken(s),x.current=!0)}}C(s=>[...s,{type:"user_prompt",content:e,images:t,timestamp:Date.now()}]),W.current=[],I.current=null,M([]);var o=t&&t.length>0?t.map(e=>e.uri):void 0,l=(0,u.getWebSocketClient)();l&&l.sendPrompt(e,o)});return function(t,s){return e.apply(this,arguments)}})(),[]),q=(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:v,messages:y,currentParts:w,handleSubmit:T,handleNewSession:q,handleStop:D}};var t=e(r(d[0])),s=e(r(d[1])),n=r(d[2]),u=r(d[3]),c=r(d[4])},527,[346,29,63,528,529]);
|
|
580
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t,e){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var s={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};e&&e.length>0&&(s.imagePaths=e),this.ws.send(JSON.stringify(s)),this.setStatus("processing")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"sendPushToken",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"register_push_token",token:t}))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},528,[8,9]);
|
|
581
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.requestPushToken=function(){return u.apply(this,arguments)},_e.setupTapHandler=function(e){return console.log("[expo-air] setupTapHandler: tap handling managed by main app"),()=>{}};var e,n=r(d[0]),o=(e=n)&&e.__esModule?e:{default:e},t=r(d[1]).NativeModules.WidgetBridge;function u(){return(u=(0,o.default)(function*(){try{if(!t?.requestPushToken)return console.log("[expo-air] WidgetBridge.requestPushToken not available"),null;console.log("[expo-air] Requesting push token via native bridge");var e=yield t.requestPushToken();return e?(console.log("[expo-air] Got push token:",e),e):(console.log("[expo-air] Push notification permission denied or token unavailable"),null)}catch(e){return console.error("[expo-air] Failed to get push token:",e),null}})).apply(this,arguments)}},529,[346,258]);
|
|
582
|
+
__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])},530,[29,63,528,258]);
|
|
577
583
|
__r(1);
|
|
578
584
|
__r(0);
|